update usage-dashboard

This commit is contained in:
admin committed 2026-06-07 21:23:38 +07:00
1 parent 15fe48fe45
commit 524214e8e9
2 files changed
+123 -98

No files matched your search

+92 -91
View File
@@ -6,85 +6,86 @@
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20aria-hidden%3D%22true%22%20role%3D%22img%22%20class%3D%22iconify%20iconify--logos%22%20width%3D%2231.88%22%20height%3D%2232%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%20viewBox%3D%220%200%20256%20257%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22IconifyId1813088fe1fbc01fb466%22%20x1%3D%22-.828%25%22%20x2%3D%2257.636%25%22%20y1%3D%227.652%25%22%20y2%3D%2278.411%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%2341D1FF%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23BD34FE%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22IconifyId1813088fe1fbc01fb467%22%20x1%3D%2243.376%25%22%20x2%3D%2250.316%25%22%20y1%3D%222.242%25%22%20y2%3D%2289.03%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23FFEA83%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%228.333%25%22%20stop-color%3D%22%23FFDD35%22%3E%3C%2Fstop%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23FFA800%22%3E%3C%2Fstop%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22url(%23IconifyId1813088fe1fbc01fb466)%22%20d%3D%22M255.153%2037.938L134.897%20252.976c-2.483%204.44-8.862%204.466-11.382.048L.875%2037.958c-2.746-4.814%201.371-10.646%206.827-9.67l120.385%2021.517a6.537%206.537%200%200%200%202.322-.004l117.867-21.483c5.438-.991%209.574%204.796%206.877%209.62Z%22%3E%3C%2Fpath%3E%3Cpath%20fill%3D%22url(%23IconifyId1813088fe1fbc01fb467)%22%20d%3D%22M185.432.063L96.44%2017.501a3.268%203.268%200%200%200-2.634%203.014l-5.474%2092.456a3.268%203.268%200%200%200%203.997%203.378l24.777-5.718c2.318-.535%204.413%201.507%203.936%203.838l-7.361%2036.047c-.495%202.426%201.782%204.5%204.151%203.78l15.304-4.649c2.372-.72%204.652%201.36%204.15%203.788l-11.698%2056.621c-.732%203.542%203.979%205.473%205.943%202.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505%204.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CLI Proxy API Management Center</title>
<script type="module" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._statusLine truncated
<script type="module" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._statLine truncated
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return ve(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,je=t.log,Me=t.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var Ie=Math.clz32?Math.clz32:ze,Le=Math.log,Re=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(Le(e)/Re|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ie(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ie(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function $e(e,t){var n=t&-t;return n=n&42?1:et(n),(n&(e.suspendedLanes|t))===0?n:0}function et(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function nt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Cp(e.type)):e}function rt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var it=Math.random().toString(36).slice(2),at=`__reactFiber$`+it,ot=`__reactProps$`+it,st=`__reactContainer$`+it,ct=`__reactEvents$`+it,lt=`__reactListeners$`+it,ut=`__reactHandles$`+it,dt=`__reactResources$`+it,ft=`__reactMarker$`+it;function pt(e){delete e[at],delete e[ot],delete e[ct],delete e[lt],delete e[ut]}function mt(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bf(e);e!==null;){if(n=e[at])return n;e=bf(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[at]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function _t(e){var t=e[dt];return t||(t=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[ft]=!0}var yt=new Set,bt={};function xt(e,t){St(e,t),St(e+`Capture`,t)}function St(e,t){for(bt[e]=t,e=0;e<t.length;e++)yt.add(t[e])}var Ct=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3Line truncated
`).replace(zd,``)}function Vd(e,t){return t=Bd(t),Bd(e)===t}function Hd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Hd(e,t,`name`,a.name,a,null),Hd(e,t,`formEncType`,a.formEncType,a,null),Hd(e,t,`formMethod`,a.formMethod,a,null),Hd(e,t,`formTarget`,a.formTarget,a,null)):(Hd(e,t,`encType`,a.encType,a,null),Hd(e,t,`method`,a.method,a,null),Hd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&Od(`scroll`,e);break;case`onScrollEnd`:r!=null&&Od(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Od(`beforetoggle`,e),Od(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,Dt(e,n,r))}}function Ud(e,t,n,r,a,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&Od(`scroll`,e);break;case`onScrollEnd`:r!=null&&Od(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`inneLine truncated
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!yn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}N(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Yt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Yt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Xt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Xt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(yn(c.formMethod))return{path:t,submission:c};let l=R(t);return e&&l.search&&bn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:L(l),submission:c}}function St(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?fn(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&fn(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=Ke(o),k=o.map((i,o)=>{let{route:s}=i,c=null;if(w!=null&&o>w?c=!1:s.lazy?c=!0:Ct(s)?u?c=wt(s,a.loaderData,a.errors):Tt(a.loaderData,a.matches[o],i)&&(c=!0):c=!1,c!==null)return Bt(n,r,e,O,i,l,t,c);let f=!1;typeof b==`boolean`?f=b:E?f=!1:d||S.pathname+S.search===C.pathname+C.search?f=!0:S.search===C.search?Et(a.matches[o],i)&&(f=!0):f=!0;let p={...D,defaultShouldRevalidate:f};return Bt(n,r,e,O,i,l,t,Dt(i,p),p,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=de(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=xn(y,e.path),S=new AbortController,C=Jt(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Vt(n,r,C,y,x,l,t);else if(m)d&&(w=Vt(n,r,C,y,x,l,t));else{let e;e=typeof b==`boolean`?b:E?!1:d;let i={...D,defaultShouldRevalidate:e};Dt(x,i)&&(w=Vt(n,r,C,y,x,l,t,i))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function Ct(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function wt(e,t,n){if(e.lazy)return!0;if(!Ct(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader==`function`&&e.loader.hydrate===!0?!0:!r&&!i}function Tt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Et(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Dt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Ot(e,t,n,r,i,a){let o;if(e){let t=r[e];N(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>kt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=le(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=le([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function kt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((e,n)=>t.children?.some(t=>kt(e,t))):!1}var At=new WeakMap,jt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(N(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=At.get(i);o||(o={},At.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=ae(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)P(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)P(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Mt=new WeakMap;function Nt(eLine truncated
`+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,Oe=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,Ae=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:Ue,Ve=Math.log,He=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(Ve(e)/He|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ze(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $e(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function et(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Be(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&tt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function tt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function rt(e,t){var n=t&-t;return n=n&42?1:it(n),(n&(e.suspendedLanes|t))===0?n:0}function it(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function at(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Dp(e.type)):e}function st(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wf(e);e!==null;){if(n=e[lt])return n;e=wf(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||(t=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function St(e){e[gt]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3Line truncated
`).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Mt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Kd(e,t,`name`,a.name,a,null),Kd(e,t,`formEncType`,a.formEncType,a,null),Kd(e,t,`formMethod`,a.formMethod,a,null),Kd(e,t,`formTarget`,a.formTarget,a,null)):(Kd(e,t,`encType`,a.encType,a,null),Kd(e,t,`method`,a.method,a,null),Kd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=tn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Md(`beforetoggle`,e),Md(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=$t.get(n)||n,jt(e,n,r))}}function qd(e,t,n,r,a,o){switch(n){case`style`:Zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`inneLine truncated
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Cn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}M(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=$t(n.formData),s=n.formData;else if(n.body instanceof FormData)o=$t(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=en(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=en(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Cn(c.formMethod))return{path:t,submission:c};let l=re(t);return e&&l.search&&wn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:ne(l),submission:c}}function Et(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?gn(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&gn(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=Xe(o),k=o.map((i,o)=>{let{route:s}=i,c=null;if(w!=null&&o>w?c=!1:s.lazy?c=!0:Dt(s)?u?c=Ot(s,a.loaderData,a.errors):kt(a.loaderData,a.matches[o],i)&&(c=!0):c=!1,c!==null)return Wt(n,r,e,O,i,l,t,c);let f=!1;typeof b==`boolean`?f=b:E?f=!1:d||S.pathname+S.search===C.pathname+C.search?f=!0:S.search===C.search?At(a.matches[o],i)&&(f=!0):f=!0;let p={...D,defaultShouldRevalidate:f};return Wt(n,r,e,O,i,l,t,jt(i,p),p,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=he(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Tn(y,e.path),S=new AbortController,C=Qt(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Gt(n,r,C,y,x,l,t);else if(m)d&&(w=Gt(n,r,C,y,x,l,t));else{let e;e=typeof b==`boolean`?b:E?!1:d;let i={...D,defaultShouldRevalidate:e};jt(x,i)&&(w=Gt(n,r,C,y,x,l,t,i))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function Dt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Ot(e,t,n){if(e.lazy)return!0;if(!Dt(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader==`function`&&e.loader.hydrate===!0?!0:!r&&!i}function kt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function At(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function jt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Mt(e,t,n,r,i,a){let o;if(e){let t=r[e];M(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Nt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=pe(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=pe([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function Nt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((e,n)=>t.children?.some(t=>Nt(e,t))):!1}var Pt=new WeakMap,Ft=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(M(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Pt.get(i);o||(o={},Pt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=le(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)N(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)N(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},It=new WeakMap;function LtLine truncated
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let f=Yn(),p;if(t){let e=typeof t==`string`?R(t):t;N(u===`/`||e.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=f;let m=p.pathname||`/`,h=m;if(u!==`/`){let e=u.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=de(e,{pathname:h});P(d||g!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),P(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=pr(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:Be([u,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:Be([u,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&_?y.createElement(zn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...p},navigationType:`POP`}},_):_}function sr(){let e=Sr(),t=Ge(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=y.createElement(y.Fragment,null,y.createElement(`p`,null,`💿 Hey developer 👋`),y.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,y.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,y.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:i},n):null,o)}var cr=y.createElement(sr,null),lr=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Kn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:y.createElement(Bn.Provider,{value:this.props.routeContext},y.createElement(Vn.Provider,{value:e,children:this.props.component}));return this.context?y.createElement(dr,{error:e},t):t}};lr.contextType=Nn;var ur=new WeakMap;function dr({children:e,error:t}){let{basename:n}=y.useContext(Rn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Gn(t.digest);if(e){let r=ur.get(t);if(r)throw r;let i=Je(e.location,n);if(qe&&!ur.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ur.set(t,n),n}return y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function fr({routeContext:e,match:t,children:n}){let r=y.useContext(jn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Bn.Provider,{value:e},n)}function pr(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);N(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}let l=n&&r?Line truncated
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let f=$n(),p;if(t){let e=typeof t==`string`?re(t):t;M(u===`/`||e.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=f;let m=p.pathname||`/`,h=m;if(u!==`/`){let e=u.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=he(e,{pathname:h});N(d||g!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),N(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=hr(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:We([u,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:We([u,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&_?y.createElement(Un.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...p},navigationType:`POP`}},_):_}function lr(){let e=wr(),t=Ye(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=y.createElement(y.Fragment,null,y.createElement(`p`,null,`💿 Hey developer 👋`),y.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,y.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,y.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:i},n):null,o)}var ur=y.createElement(lr,null),dr=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Xn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:y.createElement(Wn.Provider,{value:this.props.routeContext},y.createElement(Gn.Provider,{value:e,children:this.props.component}));return this.context?y.createElement(pr,{error:e},t):t}};dr.contextType=Ln;var fr=new WeakMap;function pr({children:e,error:t}){let{basename:n}=y.useContext(Hn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Yn(t.digest);if(e){let r=fr.get(t);if(r)throw r;let i=Qe(e.location,n);if(Ze&&!fr.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw fr.set(t,n),n}return y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function mr({routeContext:e,match:t,children:n}){let r=y.useContext(Fn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Wn.Provider,{value:e},n)}function hr(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);M(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}let l=n&&rLine truncated
"Header-Name": "value"
}`,headers_hint:`以 JSON 对象格式输入自定义 HTTP 请求头,例如:{"X-My-Header": "value"}`,headers_invalid_json:`自定义请求头必须是有效的 JSON。`,headers_invalid_object:`自定义请求头必须是 JSON 对象。`,headers_invalid_value:`每个自定义请求头的值都必须是字符串。`,prefix_proxy_invalid_json:`该认证文件不是 JSON 对象,无法编辑字段。`,prefix_proxy_html_challenge:`下载到的是 HTML 验证页面,不是认证 JSON 对象。请重新认证或替换该认证文件后再编辑字段。`,prefix_proxy_saved_success:`已更新认证文件 "{{name}}"`,quota_refresh_success:`已刷新 "{{name}}" 的额度`,quota_refresh_failed:`刷新 "{{name}}" 的额度失败:{{message}}`},antigravity_quota:{title:`Antigravity 额度`,empty_title:`暂无 Antigravity 认证`,empty_desc:`上传 Antigravity 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_models:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`},claude_quota:{title:`Claude 额度`,empty_title:`暂无 Claude OAuth 认证`,empty_desc:`使用 Claude OAuth 登录后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_windows:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,five_hour:`5 小时限额`,seven_day:`7 天限额`,seven_day_oauth_apps:`7 天 OAuth 应用`,seven_day_opus:`7 天 Opus`,seven_day_sonnet:`7 天 Sonnet`,seven_day_cowork:`7 天 Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`额外用量`,plan_label:`套餐`,plan_unknown:`未知`,plan_free:`免费版`,plan_pro:`专业版`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`团队版`},codex_quota:{title:`Codex 额度`,empty_title:`暂无 Codex 认证`,empty_desc:`上传 Codex 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,missing_account_id:`Codex 凭证缺少 ChatGPT 账号 ID`,empty_windows:`暂无额度数据`,no_access:`该凭证已无 Codex 访问权限(free)。`,refresh_button:`刷新额度`,fetch_all:`获取全部`,primary_window:`5 小时限额`,secondary_window:`周限额`,code_review_primary_window:`代码审查 5 小时限额`,code_review_secondary_window:`代码审查周限额`,additional_primary_window:`{{name}} 5 小时限额`,additional_secondary_window:`{{name}} 周限额`,plan_label:`套餐`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},gemini_cli_quota:{title:`Gemini CLI 额度`,empty_title:`暂无 Gemini CLI 认证`,empty_desc:`上传 Gemini CLI 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,missing_project_id:`Gemini CLI 凭证缺少 Project ID`,empty_buckets:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,remaining_amount:`剩余 {{count}}`,tier_label:`层级`,tier_free:`免费版`,tier_legacy:`旧版`,tier_standard:`标准版`,tier_pro:`Pro`,tier_ultra:`Ultra`,credit_label:`Google One AI 积分`,credit_amount:`{{count}} 积分`},kimi_quota:{title:`Kimi 额度`,empty_title:`暂无 Kimi 认证`,empty_desc:`上传 Kimi 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_data:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,weekly_limit:`周限额`,limit_window:`{{duration}} 限额`,limit_index:`限额 #{{index}}`,reset_hint:`{{hint}} 后重置`},vertex_import:{title:`Vertex JSON 登录`,description:`上传 Google 服务账号 JSON,使用 CLI vertex-import 同步规则写入 auth-dir/vertex-<project>.json。`,location_label:`目标区域 (可选)`,location_placeholder:`us-central1`,location_hint:`留空表示使用默认区域 us-central1。`,file_label:`服务账号密钥 JSON`,file_hint:`仅支持 Google Cloud service account key JSON 文件,私钥会自动规范化。`,file_placeholder:`尚未选择文件`,choose_file:`选择文件`,import_button:`导入 Vertex 凭证`,file_required:`请先选择 .json 凭证文件`,success:`Vertex 凭证导入成功`,result_title:`凭证已保存`,result_project:`项目 ID`,result_email:`服务账号`,result_location:`区域`,result_file:`存储文件`},oauth_excluded:{title:`OAuth 模型禁用`,description:`按提供商分列展示,点击卡片编辑或删除;支持 * 通配符,范围跟随上方的配置文件过滤标签。`,add:`新增禁Line truncated
}`,headers_hint:`以 JSON 对象格式输入自定义 HTTP 请求头,例如:{"X-My-Header": "value"}`,headers_invalid_json:`自定义请求头必须是有效的 JSON。`,headers_invalid_object:`自定义请求头必须是 JSON 对象。`,headers_invalid_value:`每个自定义请求头的值都必须是字符串。`,prefix_proxy_invalid_json:`该认证文件不是 JSON 对象,无法编辑字段。`,prefix_proxy_html_challenge:`下载到的是 HTML 验证页面,不是认证 JSON 对象。请重新认证或替换该认证文件后再编辑字段。`,prefix_proxy_saved_success:`已更新认证文件 "{{name}}"`,quota_refresh_success:`已刷新 "{{name}}" 的额度`,quota_refresh_failed:`刷新 "{{name}}" 的额度失败:{{message}}`},antigravity_quota:{title:`Antigravity 额度`,empty_title:`暂无 Antigravity 认证`,empty_desc:`上传 Antigravity 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_models:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`},claude_quota:{title:`Claude 额度`,empty_title:`暂无 Claude OAuth 认证`,empty_desc:`使用 Claude OAuth 登录后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_windows:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,five_hour:`5 小时限额`,seven_day:`7 天限额`,seven_day_oauth_apps:`7 天 OAuth 应用`,seven_day_opus:`7 天 Opus`,seven_day_sonnet:`7 天 Sonnet`,seven_day_cowork:`7 天 Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`额外用量`,plan_label:`套餐`,plan_unknown:`未知`,plan_free:`免费版`,plan_pro:`专业版`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`团队版`},codex_quota:{title:`Codex 额度`,empty_title:`暂无 Codex 认证`,empty_desc:`上传 Codex 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,missing_account_id:`Codex 凭证缺少 ChatGPT 账号 ID`,empty_windows:`暂无额度数据`,no_access:`该凭证已无 Codex 访问权限(free)。`,refresh_button:`刷新额度`,fetch_all:`获取全部`,primary_window:`5 小时限额`,secondary_window:`周限额`,code_review_primary_window:`代码审查 5 小时限额`,code_review_secondary_window:`代码审查周限额`,additional_primary_window:`{{name}} 5 小时限额`,additional_secondary_window:`{{name}} 周限额`,plan_label:`套餐`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},gemini_cli_quota:{title:`Gemini CLI 额度`,empty_title:`暂无 Gemini CLI 认证`,empty_desc:`上传 Gemini CLI 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,missing_project_id:`Gemini CLI 凭证缺少 Project ID`,empty_buckets:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,remaining_amount:`剩余 {{count}}`,tier_label:`层级`,tier_free:`免费版`,tier_legacy:`旧版`,tier_standard:`标准版`,tier_pro:`Pro`,tier_ultra:`Ultra`,credit_label:`Google One AI 积分`,credit_amount:`{{count}} 积分`},kimi_quota:{title:`Kimi 额度`,empty_title:`暂无 Kimi 认证`,empty_desc:`上传 Kimi 认证文件后即可查看额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_data:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,weekly_limit:`周限额`,limit_window:`{{duration}} 限额`,limit_index:`限额 #{{index}}`,reset_hint:`{{hint}} 后重置`},xai_quota:{title:`Grok 额度`,empty_title:`暂无 xAI/Grok 认证`,empty_desc:`使用 xAI OAuth 登录后即可查看 Grok 额度。`,idle:`点击此处刷新额度`,loading:`正在加载额度...`,load_failed:`额度获取失败:{{message}}`,missing_auth_index:`认证文件缺少 auth_index`,empty_data:`暂无额度数据`,refresh_button:`刷新额度`,fetch_all:`获取全部`,monthly_credits:`月度积分`,pay_as_you_go_label:`按量付费`,pay_as_you_go_enabled:`已启用,封顶 {{cap}}`,pay_as_you_go_disabled:`未启用`},vertex_import:{title:`Vertex JSON 登录`,description:`上传 Google 服务账号 JSON,使用 CLI vertex-import 同步规则写入 auth-dir/vertex-<project>.json。`,location_label:`目标区域 (可选)`,location_placeholder:`us-central1`,location_hint:`留空表示使用默认区域 us-central1。`,file_label:`服务账号密钥 JSON`,file_hint:`仅支持 Google Cloud service account key JSON 文件,私钥会自动Line truncated
"Header-Name": "value"
}`,headers_hint:`以 JSON 物件格式輸入自訂 HTTP 請求標頭,例如:{"X-My-Header": "value"}`,headers_invalid_json:`自訂請求標頭必須是有效的 JSON。`,headers_invalid_object:`自訂請求標頭必須是 JSON 物件。`,headers_invalid_value:`每個自訂請求標頭的值都必須是字串。`,prefix_proxy_invalid_json:`該驗證檔案不是 JSON 物件,無法編輯欄位。`,prefix_proxy_html_challenge:`下載到的是 HTML 驗證頁面,不是驗證 JSON 物件。請重新驗證或替換該驗證檔案後再編輯欄位。`,prefix_proxy_saved_success:`已更新驗證檔案「{{name}}」`,quota_refresh_success:`已重新整理「{{name}}」的配額`,quota_refresh_failed:`重新整理「{{name}}」的配額失敗:{{message}}`},antigravity_quota:{title:`Antigravity 配額`,empty_title:`暫無 Antigravity 驗證`,empty_desc:`上傳 Antigravity 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_models:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`},claude_quota:{title:`Claude 配額`,empty_title:`暫無 Claude OAuth 驗證`,empty_desc:`使用 Claude OAuth 登入後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_windows:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,five_hour:`5 小時限額`,seven_day:`7 天限額`,seven_day_oauth_apps:`7 天 OAuth 應用`,seven_day_opus:`7 天 Opus`,seven_day_sonnet:`7 天 Sonnet`,seven_day_cowork:`7 天 Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`額外用量`,plan_label:`方案`,plan_unknown:`未知`,plan_free:`免費版`,plan_pro:`專業版`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`團隊版`},codex_quota:{title:`Codex 配額`,empty_title:`暫無 Codex 驗證`,empty_desc:`上傳 Codex 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,missing_account_id:`Codex 憑證缺少 ChatGPT 帳號 ID`,empty_windows:`暫無配額資料`,no_access:`該憑證已無 Codex 存取權限(free)。`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,primary_window:`5 小時限額`,secondary_window:`週限額`,code_review_primary_window:`程式碼審查 5 小時限額`,code_review_secondary_window:`程式碼審查週限額`,additional_primary_window:`{{name}} 5 小時限額`,additional_secondary_window:`{{name}} 週限額`,plan_label:`方案`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},gemini_cli_quota:{title:`Gemini CLI 配額`,empty_title:`暫無 Gemini CLI 驗證`,empty_desc:`上傳 Gemini CLI 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,missing_project_id:`Gemini CLI 憑證缺少 Project ID`,empty_buckets:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,remaining_amount:`剩餘 {{count}}`,tier_label:`層級`,tier_free:`免費版`,tier_legacy:`舊版`,tier_standard:`標準版`,tier_pro:`Pro`,tier_ultra:`Ultra`,credit_label:`Google One AI 點數`,credit_amount:`{{count}} 點數`},kimi_quota:{title:`Kimi 配額`,empty_title:`暫無 Kimi 驗證`,empty_desc:`上傳 Kimi 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_data:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,weekly_limit:`週限額`,limit_window:`{{duration}} 限額`,limit_index:`限額 #{{index}}`,reset_hint:`{{hint}} 後重置`},vertex_import:{title:`Vertex JSON 登入`,description:`上傳 Google 服務帳號 JSON,使用 CLI vertex-import 同步規則寫入 auth-dir/vertex-<project>.json。`,location_label:`目標區域(選填)`,location_placeholder:`us-central1`,location_hint:`留空表示使用預設區域 us-central1。`,file_label:`服務帳號金鑰 JSON`,file_hint:`僅支援 Google Cloud service account key JSON 檔案,私鑰會自動規範化。`,file_placeholder:`尚未選擇檔案`,choose_file:`選擇檔案`,import_button:`匯入 Vertex 憑證`,file_required:`請先選擇 .json 憑證檔案`,success:`Vertex 憑證匯入成功`,result_title:`憑證已儲存`,result_project:`專案 ID`,result_email:`服務帳號`,result_location:`區域`,result_file:`儲存檔案`},oauth_excluded:{title:`OAuth 模型停用`,description:`按供應商分列展示,點擊卡片編輯或刪除;Line truncated
}`,headers_hint:`以 JSON 物件格式輸入自訂 HTTP 請求標頭,例如:{"X-My-Header": "value"}`,headers_invalid_json:`自訂請求標頭必須是有效的 JSON。`,headers_invalid_object:`自訂請求標頭必須是 JSON 物件。`,headers_invalid_value:`每個自訂請求標頭的值都必須是字串。`,prefix_proxy_invalid_json:`該驗證檔案不是 JSON 物件,無法編輯欄位。`,prefix_proxy_html_challenge:`下載到的是 HTML 驗證頁面,不是驗證 JSON 物件。請重新驗證或替換該驗證檔案後再編輯欄位。`,prefix_proxy_saved_success:`已更新驗證檔案「{{name}}」`,quota_refresh_success:`已重新整理「{{name}}」的配額`,quota_refresh_failed:`重新整理「{{name}}」的配額失敗:{{message}}`},antigravity_quota:{title:`Antigravity 配額`,empty_title:`暫無 Antigravity 驗證`,empty_desc:`上傳 Antigravity 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_models:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`},claude_quota:{title:`Claude 配額`,empty_title:`暫無 Claude OAuth 驗證`,empty_desc:`使用 Claude OAuth 登入後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_windows:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,five_hour:`5 小時限額`,seven_day:`7 天限額`,seven_day_oauth_apps:`7 天 OAuth 應用`,seven_day_opus:`7 天 Opus`,seven_day_sonnet:`7 天 Sonnet`,seven_day_cowork:`7 天 Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`額外用量`,plan_label:`方案`,plan_unknown:`未知`,plan_free:`免費版`,plan_pro:`專業版`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`團隊版`},codex_quota:{title:`Codex 配額`,empty_title:`暫無 Codex 驗證`,empty_desc:`上傳 Codex 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,missing_account_id:`Codex 憑證缺少 ChatGPT 帳號 ID`,empty_windows:`暫無配額資料`,no_access:`該憑證已無 Codex 存取權限(free)。`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,primary_window:`5 小時限額`,secondary_window:`週限額`,code_review_primary_window:`程式碼審查 5 小時限額`,code_review_secondary_window:`程式碼審查週限額`,additional_primary_window:`{{name}} 5 小時限額`,additional_secondary_window:`{{name}} 週限額`,plan_label:`方案`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},gemini_cli_quota:{title:`Gemini CLI 配額`,empty_title:`暫無 Gemini CLI 驗證`,empty_desc:`上傳 Gemini CLI 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,missing_project_id:`Gemini CLI 憑證缺少 Project ID`,empty_buckets:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,remaining_amount:`剩餘 {{count}}`,tier_label:`層級`,tier_free:`免費版`,tier_legacy:`舊版`,tier_standard:`標準版`,tier_pro:`Pro`,tier_ultra:`Ultra`,credit_label:`Google One AI 點數`,credit_amount:`{{count}} 點數`},kimi_quota:{title:`Kimi 配額`,empty_title:`暫無 Kimi 驗證`,empty_desc:`上傳 Kimi 驗證檔案後即可查看配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_data:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,weekly_limit:`週限額`,limit_window:`{{duration}} 限額`,limit_index:`限額 #{{index}}`,reset_hint:`{{hint}} 後重置`},xai_quota:{title:`Grok 配額`,empty_title:`暫無 xAI/Grok 驗證`,empty_desc:`使用 xAI OAuth 登入後即可查看 Grok 配額。`,idle:`點擊此處重新整理配額`,loading:`正在載入配額...`,load_failed:`配額取得失敗:{{message}}`,missing_auth_index:`驗證檔案缺少 auth_index`,empty_data:`暫無配額資料`,refresh_button:`重新整理配額`,fetch_all:`取得全部`,monthly_credits:`月度點數`,pay_as_you_go_label:`按量付費`,pay_as_you_go_enabled:`已啟用,封頂 {{cap}}`,pay_as_you_go_disabled:`未啟用`},vertex_import:{title:`Vertex JSON 登入`,description:`上傳 Google 服務帳號 JSON,使用 CLI vertex-import 同步規則寫入 auth-dir/vertex-<project>.json。`,location_label:`目標區域(選填)`,location_placeholder:`us-central1`,location_hint:`留空表示使用預設區域 us-central1。`,file_label:`服務帳Line truncated
"Header-Name": "value"
}`,headers_hint:`Enter custom HTTP headers as a JSON object, e.g., {"X-My-Header": "value"}`,headers_invalid_json:`Custom headers must be valid JSON.`,headers_invalid_object:`Custom headers must be a JSON object.`,headers_invalid_value:`Each custom header value must be a string.`,prefix_proxy_invalid_json:`This auth file is not a JSON object, so fields cannot be edited.`,prefix_proxy_html_challenge:`Downloaded content is an HTML challenge page, not an auth JSON object. Re-authenticate or replace this auth file before editing fields.`,prefix_proxy_saved_success:`Updated auth file "{{name}}" successfully`,quota_refresh_success:`Quota refreshed for "{{name}}"`,quota_refresh_failed:`Failed to refresh quota for "{{name}}": {{message}}`},antigravity_quota:{title:`Antigravity Quota`,empty_title:`No Antigravity Auth Files`,empty_desc:`Upload an Antigravity credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_models:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`},claude_quota:{title:`Claude Quota`,empty_title:`No Claude OAuth Files`,empty_desc:`Log in with Claude OAuth to view quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_windows:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,five_hour:`5-hour limit`,seven_day:`7-day limit`,seven_day_oauth_apps:`7-day OAuth apps`,seven_day_opus:`7-day Opus`,seven_day_sonnet:`7-day Sonnet`,seven_day_cowork:`7-day Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`Extra Usage`,plan_label:`Plan`,plan_unknown:`Unknown`,plan_free:`Free`,plan_pro:`Pro`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`Team`},codex_quota:{title:`Codex Quota`,empty_title:`No Codex Auth Files`,empty_desc:`Upload a Codex credential to view quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,missing_account_id:`Codex credential missing ChatGPT account ID`,empty_windows:`No quota data available`,no_access:`This credential has no Codex access (plan: free).`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,primary_window:`5-hour limit`,secondary_window:`Weekly limit`,code_review_primary_window:`Code review 5-hour limit`,code_review_secondary_window:`Code review weekly limit`,additional_primary_window:`{{name}} 5-hour limit`,additional_secondary_window:`{{name}} weekly limit`,plan_label:`Plan`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},gemini_cli_quota:{title:`Gemini CLI Quota`,empty_title:`No Gemini CLI Auth Files`,empty_desc:`Upload a Gemini CLI credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,missing_project_id:`Gemini CLI credential missing project ID`,empty_buckets:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,remaining_amount:`Remaining {{count}}`,tier_label:`Tier`,tier_free:`Free`,tier_legacy:`Legacy`,tier_standard:`Standard`,tier_pro:`Pro`,tier_ultra:`Ultra`,credit_label:`Google One AI Credits`,credit_amount:`{{count}} credits`},kimi_quota:{title:`Kimi Quota`,empty_title:`No Kimi Auth Files`,empty_desc:`Upload a Kimi credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_data:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,weekly_limit:`Weekly limit`,limit_window:`{{duration}} limit`,limit_index:`Limit #{{index}}`,reset_hint:`resets in {{hint}}`},vertex_import:{title:`Vertex JSON Login`,description:`Upload a Google service account JSON to store it as auth-dir/vertex-<project>.json using the same rules as the CLI vertex-import helper.`,location_label:`Region (optional)`,location_placeholder:`us-central1`,location_hint:`Leave empty to use the default region us-central1.`,file_label:`Service account key JSON`,file_hint:`Only Google Cloud service account key JSON files are accepted.`,file_placeholder:`No file selected`,choose_file:`Choose File`,import_button:`Import Vertex Credential`,file_required:`Select a .json credential file first`,success:`Vertex credential imported successfully`,result_title:`Credential saved`,result_project:`Project ID`,result_email:`Service account`,result_location:`Region`,result_file:`Persisted file`},oauth_excluded:{title:`OAuth Model Disablement`,description:`Per-provider model disablement is shown as cards; click a card to edit or delete. Wildcards * are supported and the scope follows the auth file Line truncated
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Nu[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},Fu=Symbol(`internals`),Iu=/[^\x09\x20-\x7E\x80-\xFF]/g;function Lu(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function Ru(e){return e&&String(e).trim().toLowerCase()}function zu(e){return Lu(e.replace(Iu,``))}function Bu(e){return e===!1||e==null?e:U.isArray(e)?e.map(Bu):zu(String(e))}function Vu(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var Hu=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Uu(e,t,n,r,i){if(U.isFunction(r))return r.call(this,t,n);if(i&&(t=n),U.isString(t)){if(U.isString(r))return t.indexOf(r)!==-1;if(U.isRegExp(r))return r.test(t)}}function Wu(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Gu(e,t){let n=U.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var Ku=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=Ru(t);if(!i)throw Error(`header name must be a non-empty string`);let a=U.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Bu(e))}let a=(e,t)=>U.forEach(e,(e,n)=>i(e,n,t));if(U.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(U.isString(e)&&(e=e.trim())&&!Hu(e))a(Pu(e),t);else if(U.isObject(e)&&U.isIterable(e)){let n={},r,i;for(let t of e){if(!U.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?U.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=Ru(e),e){let n=U.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Vu(e);if(U.isFunction(t))return t.call(this,e,n);if(U.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=Ru(e),e){let n=U.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Uu(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=Ru(e),e){let i=U.findKey(n,e);i&&(!t||Uu(n,n[i],i,t))&&(delete n[i],r=!0)}}return U.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Uu(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return U.forEach(this,(r,i)=>{let a=U.findKey(n,i);if(a){t[a]=Bu(r),delete t[i];return}let o=e?Wu(i):String(i).trim();o!==i&&delete t[i],t[o]=Bu(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return U.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&U.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[Fu]=this[Fu]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=Ru(e);t[r]||(Gu(n,e),t[r]=!0)}return U.isArray(e)?e.forEach(r):r(e),this}};Ku.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),U.reduceDescriptors(Ku.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),U.freezeMethods(Ku);function qu(e,t){let n=this||Mu,r=t||n,i=Ku.from(r.headers),a=r.data;return U.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Ju(e){return!!(e&&e.__CANCEL__)}var Yu=class extends iu{constructor(e,t,n){super(e??`canceled`,iu.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function Xu(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new iu(`Request failed with status code `+n.status,[iu.ERR_BAD_REQUEST,iu.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Zu(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function Qu(e,t){e=e||10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function $u(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||(a=setTimeout(()=>{a=null,o(i)},r-s)))},()=>i&&o(i)]}var ed=(e,t,n=3)=>{let r=0,i=Qu(50,250);return $u(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},td=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},nd=e=>(...t)=>U.asap(()=>e(...t)),rd=Tu.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Tu.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Tu.origin),Tu.navigator&&/(msie|trident)/i.test(Tu.navigator.userAgent)):()=>!0,id=Tu.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];U.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),U.isString(r)&&s.push(`path=${r}`),U.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),U.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function ad(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function od(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function sd(e,t,n){let r=!ad(t);return e&&(r||n===!1)?od(e,t):t}var cd=e=>e instanceof Ku?{...e}:e;function ld(e,t){t=t||{};let n=Object.create(null);Object.defineProperty(n,`hasOwnProperty`,{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return U.isPlainObject(e)&&U.isPlainObject(t)?U.merge.call({caseless:r},e,t):U.isPlainObject(t)?U.merge({},t):U.isArray(t)?t.slice():t}function i(e,t,n,i){if(!U.isUndefined(t))return r(e,t,n,i);if(!U.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!U.isUndefined(t))return r(void 0,t)}function o(e,t){if(!U.isUndefined(t))return r(void 0,t);if(!U.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(U.hasOwnProp(t,a))return r(n,i);if(U.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(cd(e),cd(t),n,!0)};return U.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=U.hasOwnProp(c,r)?c[r]:i,o=a(U.hasOwnProp(e,r)?e[r]:void 0,U.hasOwnProp(t,r)?t[r]:void 0,r);U.isUndefined(o)&&a!==s||(n[r]=o)}),n}var ud=e=>{let t=ld({},e),n=e=>U.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=Ku.from(s),t.url=hu(sd(l,d,u),e.params,e.paramsSerializeLine truncated
`+e.map(Dd).join(`
`):` `+Dd(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var Ad={getAdapter:kd,adapters:Ed};function jd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Yu(null,e)}function Md(e){return jd(e),e.headers=Ku.from(e.headers),e.data=qu.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Ad.getAdapter(e.adapter||Mu.adapter,e)(e).then(function(t){return jd(e),t.data=qu.call(e,e.transformResponse,t),t.headers=Ku.from(t.headers),t},function(t){return Ju(t)||(jd(e),t&&t.response&&(t.response.data=qu.call(e,e.transformResponse,t.response),t.response.headers=Ku.from(t.response.headers))),Promise.reject(t)})}var Nd=`1.15.2`,Pd={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Pd[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Fd={};Pd.transitional=function(e,t,n){function r(e,t){return`[Axios v`+Nd+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new iu(r(i,` has been removed`+(t?` in `+t:``)),iu.ERR_DEPRECATED);return t&&!Fd[i]&&(Fd[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},Pd.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Id(e,t,n){if(typeof e!=`object`)throw new iu(`options must be an object`,iu.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new iu(`option `+a+` must be `+n,iu.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new iu(`Unknown option `+a,iu.ERR_BAD_OPTION)}}var Ld={assertOptions:Id,validators:Pd},Rd=Ld.validators,zd=class{constructor(e){this.defaults=e||{},this.interceptors={request:new gu,response:new gu}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(`
}`,headers_hint:`Enter custom HTTP headers as a JSON object, e.g., {"X-My-Header": "value"}`,headers_invalid_json:`Custom headers must be valid JSON.`,headers_invalid_object:`Custom headers must be a JSON object.`,headers_invalid_value:`Each custom header value must be a string.`,prefix_proxy_invalid_json:`This auth file is not a JSON object, so fields cannot be edited.`,prefix_proxy_html_challenge:`Downloaded content is an HTML challenge page, not an auth JSON object. Re-authenticate or replace this auth file before editing fields.`,prefix_proxy_saved_success:`Updated auth file "{{name}}" successfully`,quota_refresh_success:`Quota refreshed for "{{name}}"`,quota_refresh_failed:`Failed to refresh quota for "{{name}}": {{message}}`},antigravity_quota:{title:`Antigravity Quota`,empty_title:`No Antigravity Auth Files`,empty_desc:`Upload an Antigravity credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_models:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`},claude_quota:{title:`Claude Quota`,empty_title:`No Claude OAuth Files`,empty_desc:`Log in with Claude OAuth to view quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_windows:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,five_hour:`5-hour limit`,seven_day:`7-day limit`,seven_day_oauth_apps:`7-day OAuth apps`,seven_day_opus:`7-day Opus`,seven_day_sonnet:`7-day Sonnet`,seven_day_cowork:`7-day Cowork`,iguana_necktie:`Iguana Necktie`,extra_usage_label:`Extra Usage`,plan_label:`Plan`,plan_unknown:`Unknown`,plan_free:`Free`,plan_pro:`Pro`,plan_max:`Max`,plan_max5:`Max 5x`,plan_max20:`Max 20x`,plan_team:`Team`},codex_quota:{title:`Codex Quota`,empty_title:`No Codex Auth Files`,empty_desc:`Upload a Codex credential to view quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,missing_account_id:`Codex credential missing ChatGPT account ID`,empty_windows:`No quota data available`,no_access:`This credential has no Codex access (plan: free).`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,primary_window:`5-hour limit`,secondary_window:`Weekly limit`,code_review_primary_window:`Code review 5-hour limit`,code_review_secondary_window:`Code review weekly limit`,additional_primary_window:`{{name}} 5-hour limit`,additional_secondary_window:`{{name}} weekly limit`,plan_label:`Plan`,plan_plus:`Plus`,plan_team:`Team`,plan_free:`Free`,plan_pro:`Pro 20x`,plan_prolite:`Pro 5x`},gemini_cli_quota:{title:`Gemini CLI Quota`,empty_title:`No Gemini CLI Auth Files`,empty_desc:`Upload a Gemini CLI credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,missing_project_id:`Gemini CLI credential missing project ID`,empty_buckets:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,remaining_amount:`Remaining {{count}}`,tier_label:`Tier`,tier_free:`Free`,tier_legacy:`Legacy`,tier_standard:`Standard`,tier_pro:`Pro`,tier_ultra:`Ultra`,credit_label:`Google One AI Credits`,credit_amount:`{{count}} credits`},kimi_quota:{title:`Kimi Quota`,empty_title:`No Kimi Auth Files`,empty_desc:`Upload a Kimi credential to view remaining quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_data:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,weekly_limit:`Weekly limit`,limit_window:`{{duration}} limit`,limit_index:`Limit #{{index}}`,reset_hint:`resets in {{hint}}`},xai_quota:{title:`Grok Quota`,empty_title:`No xAI/Grok Auth Files`,empty_desc:`Log in with xAI OAuth to view Grok quota.`,idle:`Click here to refresh quota`,loading:`Loading quota...`,load_failed:`Failed to load quota: {{message}}`,missing_auth_index:`Auth file missing auth_index`,empty_data:`No quota data available`,refresh_button:`Refresh Quota`,fetch_all:`Fetch All`,monthly_credits:`Monthly credits`,pay_as_you_go_label:`Pay as you go`,pay_as_you_go_enabled:`Enabled, cap {{cap}}`,pay_as_you_go_disabled:`Disabled`},vertex_import:{title:`Vertex JSON Login`,description:`Upload a Google service account JSON to store it as auth-dir/vertex-<project>.json using the same rules as the CLI vertex-import helper.`,location_label:`Region (optional)`,location_placeholder:`us-central1`,location_hint:`Leave empty to use the default region us-central1.`,file_label:`Service account key JSON`,file_hint:`Only Google Cloud service account key JSON files are accepted.`,file_placeholder:`No file selected`Line truncated
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&Hu[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},Wu=Symbol(`internals`),Gu=/[^\x09\x20-\x7E\x80-\xFF]/g;function Ku(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function qu(e){return e&&String(e).trim().toLowerCase()}function Ju(e){return Ku(e.replace(Gu,``))}function Yu(e){return e===!1||e==null?e:R.isArray(e)?e.map(Yu):Ju(String(e))}function Xu(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var Zu=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Qu(e,t,n,r,i){if(R.isFunction(r))return r.call(this,t,n);if(i&&(t=n),R.isString(t)){if(R.isString(r))return t.indexOf(r)!==-1;if(R.isRegExp(r))return r.test(t)}}function $u(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function ed(e,t){let n=R.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var td=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=qu(t);if(!i)throw Error(`header name must be a non-empty string`);let a=R.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=Yu(e))}let a=(e,t)=>R.forEach(e,(e,n)=>i(e,n,t));if(R.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(R.isString(e)&&(e=e.trim())&&!Zu(e))a(Uu(e),t);else if(R.isObject(e)&&R.isIterable(e)){let n={},r,i;for(let t of e){if(!R.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?R.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=qu(e),e){let n=R.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Xu(e);if(R.isFunction(t))return t.call(this,e,n);if(R.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=qu(e),e){let n=R.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Qu(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=qu(e),e){let i=R.findKey(n,e);i&&(!t||Qu(n,n[i],i,t))&&(delete n[i],r=!0)}}return R.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Qu(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return R.forEach(this,(r,i)=>{let a=R.findKey(n,i);if(a){t[a]=Yu(r),delete t[i];return}let o=e?$u(i):String(i).trim();o!==i&&delete t[i],t[o]=Yu(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return R.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&R.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[Wu]=this[Wu]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=qu(e);t[r]||(ed(n,e),t[r]=!0)}return R.isArray(e)?e.forEach(r):r(e),this}};td.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),R.reduceDescriptors(td.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),R.freezeMethods(td);function nd(e,t){let n=this||Vu,r=t||n,i=td.from(r.headers),a=r.data;return R.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function rd(e){return!!(e&&e.__CANCEL__)}var id=class extends z{constructor(e,t,n){super(e??`canceled`,z.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function ad(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new z(`Request failed with status code `+n.status,[z.ERR_BAD_REQUEST,z.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function od(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function sd(e,t){e=e||10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function cd(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||(a=setTimeout(()=>{a=null,o(i)},r-s)))},()=>i&&o(i)]}var ld=(e,t,n=3)=>{let r=0,i=sd(50,250);return cd(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},ud=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},dd=e=>(...t)=>R.asap(()=>e(...t)),fd=Pu.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Pu.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Pu.origin),Pu.navigator&&/(msie|trident)/i.test(Pu.navigator.userAgent)):()=>!0,pd=Pu.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];R.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),R.isString(r)&&s.push(`path=${r}`),R.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),R.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function md(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function hd(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function gd(e,t,n){let r=!md(t);return e&&(r||n===!1)?hd(e,t):t}var _d=e=>e instanceof td?{...e}:e;function vd(e,t){t=t||{};let n=Object.create(null);Object.defineProperty(n,`hasOwnProperty`,{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return R.isPlainObject(e)&&R.isPlainObject(t)?R.merge.call({caseless:r},e,t):R.isPlainObject(t)?R.merge({},t):R.isArray(t)?t.slice():t}function i(e,t,n,i){if(!R.isUndefined(t))return r(e,t,n,i);if(!R.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!R.isUndefined(t))return r(void 0,t)}function o(e,t){if(!R.isUndefined(t))return r(void 0,t);if(!R.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(R.hasOwnProp(t,a))return r(n,i);if(R.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(_d(e),_d(t),n,!0)};return R.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=R.hasOwnProp(c,r)?c[r]:i,o=a(R.hasOwnProp(e,r)?e[r]:void 0,R.hasOwnProp(t,r)?t[r]:void 0,r);R.isUndefined(o)&&a!==s||(n[r]=o)}),n}var yd=e=>{let t=vd({},e),n=e=>R.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=td.from(s),t.url=wu(gd(l,d,u),e.params,e.paramsSerializer),c&Line truncated
`+e.map(Id).join(`
`):` `+Id(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var zd={getAdapter:Rd,adapters:Fd};function Bd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new id(null,e)}function Vd(e){return Bd(e),e.headers=td.from(e.headers),e.data=nd.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),zd.getAdapter(e.adapter||Vu.adapter,e)(e).then(function(t){return Bd(e),t.data=nd.call(e,e.transformResponse,t),t.headers=td.from(t.headers),t},function(t){return rd(t)||(Bd(e),t&&t.response&&(t.response.data=nd.call(e,e.transformResponse,t.response),t.response.headers=td.from(t.response.headers))),Promise.reject(t)})}var Hd=`1.15.2`,Ud={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Ud[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Wd={};Ud.transitional=function(e,t,n){function r(e,t){return`[Axios v`+Hd+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new z(r(i,` has been removed`+(t?` in `+t:``)),z.ERR_DEPRECATED);return t&&!Wd[i]&&(Wd[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},Ud.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Gd(e,t,n){if(typeof e!=`object`)throw new z(`options must be an object`,z.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new z(`option `+a+` must be `+n,z.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new z(`Unknown option `+a,z.ERR_BAD_OPTION)}}var Kd={assertOptions:Gd,validators:Ud},qd=Kd.validators,Jd=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Tu,response:new Tu}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>{if(!t.stack)return``;let e=t.stack.indexOf(`
`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
`),r=t===-1?-1:n.indexOf(`
`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t=t||{},t.url=e):t=e||{},t=ld(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Ld.assertOptions(n,{silentJSONParsing:Rd.transitional(Rd.boolean),forcedJSONParsing:Rd.transitional(Rd.boolean),clarifyTimeoutError:Rd.transitional(Rd.boolean),legacyInterceptorReqResOrdering:Rd.transitional(Rd.boolean)},!1),r!=null&&(U.isFunction(r)?t.paramsSerializer={serialize:r}:Ld.assertOptions(r,{encode:Rd.function,serialize:Rd.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Ld.assertOptions(t,{baseUrl:Rd.spelling(`baseURL`),withXsrfToken:Rd.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&U.merge(i.common,i[t.method]);i&&U.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=Ku.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s=s&&e.synchronous;let n=t.transitional||_u;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Md.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=Md.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=ld(this.defaults,e),hu(sd(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};U.forEach([`delete`,`get`,`head`,`options`],function(e){zd.prototype[e]=function(t,n){return this.request(ld(n||{},{method:e,url:t,data:(n||{}).data}))}}),U.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(ld(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}zd.prototype[e]=t(),zd.prototype[e+`Form`]=t(!0)});var Bd=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Yu(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Vd(e){return function(t){return e.apply(null,t)}}function Hd(e){return U.isObject(e)&&e.isAxiosError===!0}var Ud={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ud).forEach(([e,t])=>{Ud[t]=e});function Wd(e){let t=new zd(e),n=qc(zd.prototype.request,t);return U.extend(n,zd.prototype,t,{allOwnKeys:!0}),U.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Wd(ld(e,t))},n}var Gd=Wd(Mu);Gd.Axios=zd,Gd.CanceledError=Yu,Gd.CancelToken=Bd,Gd.isCancel=Ju,Gd.VERSION=Nd,Gd.toFormData=uu,Gd.AxiosError=iu,Gd.Cancel=Gd.CanceledErroLine truncated
`):``,vp=e=>{let t=String(e||``).trim();return t?(t=t.replace(/\/?v0\/management\/?$/i,``),t=t.replace(/\/+$/g,``),/^https?:\/\//i.test(t)||(t=`http://${t}`),t):``},yp=e=>{let t=String(e||``).trim();return t?(t=t.replace(/\/?v0\/management\/?$/i,``),t=t.replace(/\/+$/g,``),/^https?:\/\//i.test(t)||(t=`http://${t}`),t):`https://api.anthropic.com`},bp=e=>{let t=vp(e);return t?`${t}/models`:``},xp=e=>{let t=vp(e);return t?t.endsWith(`/chat/completions`)?t:`${t}/chat/completions`:``},Sp=e=>{let t=yp(e);return t?t.endsWith(`/v1/messages`)?t:t.endsWith(`/v1`)?`${t}/messages`:`${t}/v1/messages`:``},Cp={success:0,failed:0,recentRequests:[]},wp=e=>String(e??``).trim().toLowerCase();function Tp(e,t,n,r){if(!String(n??``).trim())return Cp;let i=wp(t),a=ip(r,n);return e.get(i)?.get(a)??Cp}function Ep(e,t,n,r){return Tp(e,t,n,r).recentRequests}function Dp(e,t,n,r){let i=Tp(e,t,n,r);return{success:i.success,failure:i.failed}}function Op(e,t){return e.apiKeyEntries?.length?cp(e.apiKeyEntries.map(n=>Ep(t,e.name,n.apiKey,e.baseUrl))):[]}function kp(e,t){return(e.apiKeyEntries||[]).reduce((n,r)=>{let i=Tp(t,e.name,r.apiKey,e.baseUrl);return{success:n.success+i.success,failure:n.failure+i.failed}},{success:0,failure:0})}function Ap(e,t){return lp(Op(e,t))}function jp(e,t){return up(Op(e,t))}var Mp=(e,t)=>ap(e.authIndex)||`${e.apiKey??``}::${e.baseUrl??``}::${e.proxyUrl??``}::${t}`,Np=(e,t)=>ap(e.authIndex)||`${e.name}::${e.baseUrl}::${e.prefix??``}::${t}`,Pp=e=>({apiKey:e?.apiKey??``,proxyUrl:e?.proxyUrl??``,headers:e?.headers??{}}),Fp=e=>!Array.isArray(e)||e.length===0?[{name:``,alias:``}]:e.map(e=>({name:e.from??``,alias:e.to??``})),Ip=e=>{let t=new Set,n=[];return e.forEach(e=>{let r=e.name.trim(),i=e.alias.trim();if(!r||!i)return;let a=r.toLowerCase();t.has(a)||(t.add(a),n.push({from:r,to:i}))}),n},Lp=e=>!Array.isArray(e)||e.length===0?[{upstreamApiKey:``,clientApiKeysText:``}]:e.map(e=>({upstreamApiKey:e.upstreamApiKey??``,clientApiKeysText:Array.isArray(e.apiKeys)?e.apiKeys.join(`
`):``})),Rp=e=>{let t=new Set,n=[];return e.forEach(e=>{let r=String(e?.upstreamApiKey??``).trim();if(!r||t.has(r))return;let i=Array.from(new Set(hp(String(e?.clientApiKeysText??``))));i.length&&(t.add(r),n.push({upstreamApiKey:r,apiKeys:i}))}),n},zp=e=>({upstreamUrl:e?.upstreamUrl??``,upstreamApiKey:``,forceModelMappings:e?.forceModelMappings??!1,mappingEntries:Fp(e?.modelMappings),upstreamApiKeyEntries:Lp(e?.upstreamApiKeys)}),Bp=(e,t)=>typeof e==`function`?e(t):e,Vp=()=>({name:``,prefix:``,baseUrl:``,headers:[],apiKeyEntries:[Pp()],modelEntries:[{name:``,alias:``}],testModel:void 0}),Hp=()=>({initialized:!1,baseline:null,form:Vp(),testModel:``,testStatus:`idle`,testMessage:``,keyTestStatuses:[]}),Up=Js((e,t)=>({drafts:{},refCounts:{},acquireDraft:t=>{t&&e(e=>{let n=e.drafts[t],r=e.refCounts[t]??0;return{drafts:n?e.drafts:{...e.drafts,[t]:Hp()},refCounts:{...e.refCounts,[t]:r+1}}})},releaseDraft:t=>{t&&e(e=>{let n=e.refCounts[t];if(!n)return e;if(n>1)return{refCounts:{...e.refCounts,[t]:n-1}};let r={...e.refCounts};delete r[t];let i={...e.drafts};return delete i[t],{refCounts:r,drafts:i}})},ensureDraft:n=>{n&&(t().drafts[n]||e(e=>({drafts:{...e.drafts,[n]:Hp()}})))},initDraft:(n,r)=>{n&&(t().drafts[n]?.initialized||e(e=>({drafts:{...e.drafts,[n]:{...r,initialized:!0}}})))},setDraftBaseline:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Hp();return{drafts:{...e.drafts,[t]:{...r,initialized:!0,baseline:n}}}})},setDraftForm:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Hp(),i=Bp(n,r.form);return{drafts:{...e.drafts,[t]:{...r,initialized:!0,form:i}}}})},setDraftTestModel:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Hp(),i=Bp(n,r.testModel);return{drafts:{...e.drafts,[t]:{...r,initialized:!0,testModel:i}}}})},setDraftTestStatus:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Hp(),i=Bp(n,r.testStatus);return{drafts:{...e.drafts,[t]:{...r,initialized:!0,testStatus:i}}}})},setDraftTestMessage:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Hp(),i=Bp(n,r.testMessage);return{drafts:{...e.drafts,[t]:{...r,initialized:!0,testMessage:i}}}})},setDraftKeyTestStatus:(t,n,r)=>{t&&e(e=>{let i=e.drafts[t]??Hp(),a=[...i.keyTestStatuses];return a[n]=r,{drafts:{...e.drafts,[t]:{...i,initialized:!0,keyTestStatuses:a}}}})},resetDraftKeyTestStatuses:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Hp();return{drafts:{...e.drafts,[t]:{...r,initialized:!0,keyTestStatuses:Array.from({length:n},()=>({status:`idle`,message:``}))}}}})},clearDraft:t=>{t&&e(e=>{if(!e.drafts[t]&&!e.refCounts[t])return e;let n={...e.drafts};delete n[t];let r={...e.refCounts};return delete r[t],{drafts:n,refCounts:r}})}})),Wp=(e,t)=>typeof e==`function`?e(t):e,Gp=()=>({apiKey:``,prefix:``,baseUrl:``,proxyUrl:``,headers:[],models:[],excludedModels:[],modelEntries:[{name:``,alias:``}],excludedText:``}),Kp=()=>({initialized:!1,baseline:null,form:Gp(),testModel:``,testStatus:`idle`,testMessage:``}),qp=Js((e,t)=>({drafts:{},refCounts:{},acquireDraft:t=>{t&&e(e=>{let n=e.drafts[t],r=e.refCounts[t]??0;return{drafts:n?e.drafts:{...e.drafts,[t]:Kp()},refCounts:{...e.refCounts,[t]:r+1}}})},releaseDraft:t=>{t&&e(e=>{let n=e.refCounts[t];if(!n)return e;if(n>1)return{refCounts:{...e.refCounts,[t]:n-1}};let r={...e.refCounts};delete r[t];let i={...e.drafts};return delete i[t],{refCounts:r,drafts:i}})},ensureDraft:n=>{n&&(t().drafts[n]||e(e=>({drafts:{...e.drafts,[n]:Kp()}})))},initDraft:(n,r)=>{n&&(t().drafts[n]?.initialized||e(e=>({drafts:{...e.drafts,[n]:{...r,initialized:!0}}})))},setDraftBaseline:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Kp();return{drafts:{...e.drafts,[t]:{...r,initialized:!0,baseline:n}}}})},setDraftForm:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Kp(),i=Wp(n,r.form);return{drafts:{...e.drafts,[t]:{...r,initialized:!0,form:i}}}})},setDraftTestModel:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Kp(),i=Wp(n,r.testModel);return{drafts:{...e.drafts,[t]:{...r,initialized:!0,testModel:i}}}})},setDraftTestStatus:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Kp(),i=Wp(n,r.testStatus);return{drafts:{...e.drafts,[t]:{...r,initialized:!0,testStatus:i}}}})},setDraftTestMessage:(t,n)=>{t&&e(e=>{let r=e.drafts[t]??Kp(),i=Wp(n,r.testMessage);return{drafts:{...e.drafts,[t]:{...r,initialized:!0,testMessage:i}}}})},clearDraft:t=>{t&&e(e=>{if(!e.drafts[t]&&!e.refCounts[t])return e;let n={...e.drafts};delete n[t];let r={...e.refCounts};return delete r[t],{drafts:n,refCounts:r}})}})),Jp={container:`LoginPage-module__container___bHtIX`,brandPanel:`LoginPage-module__brandPanel___kKUR5`,brandContent:`LoginPage-module__brandContent___ZEhbk`,brandWord:`LoginPage-module__brandWord___3DkwD`,brandFadeIn:`LoginPage-module__brandFadeIn___tpmGl`,formPanel:`LoginPage-module__formPanel___Nrtrt`,formContent:`LoginPage-module__formContent___H8fD-`,logo:`LoginPage-module__logo___ASmao`,loginCard:`LoginPage-module__loginCard___OgP-R`,loginHeader:`LoginPage-module__loginHeader___3kAvs`,titleRow:`LoginPage-module__titleRow___9h914`,title:`LoginPage-module__title___I-LuY`,subtitle:`LoginPage-module__subtitle___Q41SH`,languageSelect:`LoginPage-module__languageSelect___KUNwV`,connectionBLine truncated
`),onChange:e=>{let t=hp(e.target.value);u(e=>({...e,cloak:{...e.cloak??{},sensitiveWords:t.length?t:void 0}}))},rows:3,disabled:c||o||C}),(0,B.jsx)(`div`,{className:`hint`,children:e(`ai_providers.claude_cloak_sensitive_words_hint`)})]})]}):null]})]})})})}var B_=e=>e instanceof Error?e.message:typeof e==`string`?e:``;function V_(){let{t:e}=qo(),t=Qn(),{disableControls:n,loading:r,saving:i,form:a,mergeDiscoveredModels:o}=tr(),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)([]),[d,f]=(0,y.useState)(!1),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(``),[_,v]=(0,y.useState)(new Set),b=(0,y.useRef)(``),x=(0,y.useMemo)(()=>{let e=h.trim().toLowerCase();return e?l.filter(t=>{let n=(t.name||``).toLowerCase(),r=(t.alias||``).toLowerCase(),i=(t.description||``).toLowerCase();return n.includes(e)||r.includes(e)||i.includes(e)}):l},[l,h]),S=(0,y.useMemo)(()=>x.map(e=>e.name),[x]),C=(0,y.useMemo)(()=>S.length>0&&S.every(e=>_.has(e)),[_,S]),w=(0,y.useCallback)(async()=>{f(!0),m(``);let t=$d(a.headers);try{u(await Jf.fetchClaudeModelsViaApiCall(a.baseUrl??``,a.apiKey.trim()||void 0,t))}catch(n){u([]);let r=B_(n),i=Object.keys(t).some(e=>e.toLowerCase()===`x-api-key`),o=Object.keys(t).some(e=>e.toLowerCase()===`authorization`),s=r.toLowerCase().includes(`x-api-key`)||r.includes(`401`)?` [diag: apiKeyField=${a.apiKey.trim()?`yes`:`no`}, customXApiKey=${i?`yes`:`no`}, customAuthorization=${o?`yes`:`no`}]`:``;m(`${e(`ai_providers.claude_models_fetch_error`)}: ${r}${s}`)}finally{f(!1)}},[a.apiKey,a.baseUrl,a.headers,e]);(0,y.useEffect)(()=>{if(r)return;let e=Jf.buildClaudeModelsEndpoint(a.baseUrl??``);c(e),u([]),g(``),v(new Set),m(``);let t=$d(a.headers),n=Object.keys(t).some(e=>e.toLowerCase()===`x-api-key`),i=Object.keys(t).some(e=>e.toLowerCase()===`authorization`);if(!(a.apiKey.trim()||n||i))return;let o=Object.entries(t).sort(([e],[t])=>e.toLowerCase().localeCompare(t.toLowerCase())).map(([e,t])=>`${e}:${t}`).join(`|`),s=`${e}||${a.apiKey.trim()}||${o}`;b.current!==s&&(b.current=s,w())},[w,a.apiKey,a.baseUrl,a.headers,r]),(0,y.useEffect)(()=>{let e=new Set(l.map(e=>e.name));v(t=>{let n=!1,r=new Set;return t.forEach(t=>{e.has(t)?r.add(t):n=!0}),n?r:t})},[l]);let T=(0,y.useCallback)(()=>{t(-1)},[t]),E=c_({onBack:T});(0,y.useEffect)(()=>{let e=e=>{e.key===`Escape`&&T()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[T]);let D=e=>{v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},O=(0,y.useCallback)(()=>{v(e=>{let t=new Set(e);return S.forEach(e=>t.add(e)),t})},[S]),k=(0,y.useCallback)(()=>{v(new Set)},[]),A=()=>{let e=l.filter(e=>_.has(e.name));e.length&&o(e),T()},j=!n&&!i&&!d&&_.size>0;return(0,B.jsx)(f_,{ref:E,contentClassName:g_.content,title:e(`ai_providers.claude_models_fetch_title`),onBack:T,backLabel:e(`common.back`),backAriaLabel:e(`common.back`),hideTopBarBackButton:!0,hideTopBarRightAction:!0,floatingAction:(0,B.jsxs)(`div`,{className:g_.floatingActions,children:[(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:T,className:g_.floatingBackButton,children:e(`common.back`)}),(0,B.jsx)(V,{size:`sm`,onClick:A,disabled:!j,className:g_.floatingSaveButton,children:e(`ai_providers.claude_models_fetch_apply`)})]}),isLoading:r,loadingLabel:e(`common.loading`),children:(0,B.jsx)(fg,{children:(0,B.jsxs)(`div`,{className:G.openaiModelsContent,children:[(0,B.jsx)(`div`,{className:G.sectionHint,children:e(`ai_providers.claude_models_fetch_hint`)}),(0,B.jsxs)(`div`,{className:G.openaiModelsEndpointSection,children:[(0,B.jsx)(`label`,{className:G.openaiModelsEndpointLabel,children:e(`ai_providers.claude_models_fetch_url_label`)}),(0,B.jsxs)(`div`,{className:G.openaiModelsEndpointControls,children:[(0,B.jsx)(`input`,{className:`input ${G.openaiModelsEndpointInput}`,readOnly:!0,value:s}),(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:()=>void w(),loading:d,disabled:n||i,children:e(`ai_providers.claude_models_fetch_refresh`)})]})]}),(0,B.jsx)(H,{label:e(`ai_providers.claude_models_search_label`),placeholder:e(`ai_providers.claude_models_search_placeholder`),value:h,onChange:e=>g(e.target.value),disabled:d}),l.length>0&&(0,B.jsxs)(`div`,{className:G.modelDiscoveryToolbar,children:[(0,B.jsxs)(`div`,{className:G.modelDiscoveryToolbarActions,children:[(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:O,disabled:n||i||d||x.length===0||C,children:e(`ai_providers.model_discovery_select_visible`)}),(0,B.jsx)(V,{variant:`ghost`,size:`sm`,onClick:k,disabled:n||i||d||_.size===0,children:e(`ai_providers.model_discovery_clear_selection`)})]}),(0,B.jsx)(`div`,{className:G.modelDiscoverySelectionSummary,children:e(`ai_providers.model_discovery_selected_count`,{count:_.size})})]}),p&&(0,B.jsx)(`div`,{className:`error-box`,children:p}),d?(0,B.jsx)(`div`,{className:G.sectionHint,children:e(`ai_providers.claude_models_fetch_loading`)}):l.length===0?(0,B.jsx)(`div`,{className:G.sectionHint,children:e(`ai_providers.claude_models_fetch_empty`)}):x.length===0?(0,B.jsx)(`div`,{className:G.sectioLine truncated
`)}};oC.defaultYaml={explicit:!1,version:`1.2`},oC.defaultTags={"!!":`tag:yaml.org,2002:`};function sC(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function cC(e){let t=new Set;return ZS(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function lC(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function uC(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??(i=cC(e));let a=lC(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(US(t.node)||GS(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function dC(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=dC(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=dC(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=dC(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=dC(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function fC(e,t,n){if(Array.isArray(e))return e.map((e,t)=>fC(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!qS(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var pC=class{constructor(e){Object.defineProperty(this,RS,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!BS(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=fC(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?dC(i,{"":o},``,o):o}},mC=class extends pC{constructor(e){super(MS),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],ZS(e,{Node:(e,t)=>{(zS(t)||qS(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||(fC(a,null,t),o=n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=hC(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(sC(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function hC(e,t,n){if(zS(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(GS(t)){let r=0;for(let i of t.items){let t=hC(e,i,n);t>r&&(r=t)}return r}else if(HS(t)){let r=hC(e,t.key,n),i=hC(e,t.value,n);return Math.max(r,i)}return 1}var gC=e=>!e||typeof e!=`function`&&typeof e!=`object`,_C=class extends pC{constructor(e){super(IS),this.value=e}toJSON(e,t){return t?.keep?this.value:fC(this.value,e,t)}toString(){return String(this.value)}};_C.BLOCK_FOLDED=`BLOCK_FOLDED`,_C.BLOCK_LITERAL=`BLOCK_LITERAL`,_C.PLAIN=`PLAIN`,_C.QUOTE_DOUBLE=`QUOTE_DOUBLE`,_C.QUOTE_SINGLE=`QUOTE_SINGLE`;var vC=`tag:yaml.org,2002:`;function yC(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function bC(e,t,n){if(BS(e)&&(e=e.contents),KS(e))return e;if(HS(e)){let t=n.schema[PS].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new mC(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=vC+t.slice(2));let l=yC(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new _C(e);return c&&(c.node=t),t}l=e instanceof Map?o[PS]:Symbol.iterator in Object(e)?o[LS]:o[PS]}a&&(a(l),delete n.onTagObjLine truncated
`)?TC(n,t):n.includes(`
`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t=t||{},t.url=e):t=e||{},t=vd(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Kd.assertOptions(n,{silentJSONParsing:qd.transitional(qd.boolean),forcedJSONParsing:qd.transitional(qd.boolean),clarifyTimeoutError:qd.transitional(qd.boolean),legacyInterceptorReqResOrdering:qd.transitional(qd.boolean)},!1),r!=null&&(R.isFunction(r)?t.paramsSerializer={serialize:r}:Kd.assertOptions(r,{encode:qd.function,serialize:qd.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Kd.assertOptions(t,{baseUrl:qd.spelling(`baseURL`),withXsrfToken:qd.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&R.merge(i.common,i[t.method]);i&&R.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=td.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s=s&&e.synchronous;let n=t.transitional||Eu;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Vd.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=Vd.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=vd(this.defaults,e),wu(gd(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};R.forEach([`delete`,`get`,`head`,`options`],function(e){Jd.prototype[e]=function(t,n){return this.request(vd(n||{},{method:e,url:t,data:(n||{}).data}))}}),R.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(vd(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}Jd.prototype[e]=t(),Jd.prototype[e+`Form`]=t(!0)});var Yd=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new id(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Xd(e){return function(t){return e.apply(null,t)}}function Zd(e){return R.isObject(e)&&e.isAxiosError===!0}var Qd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Qd).forEach(([e,t])=>{Qd[t]=e});function $d(e){let t=new Jd(e),n=rl(Jd.prototype.request,t);return R.extend(n,Jd.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return $d(vd(e,t))},n}var ef=$d(Vu);ef.Axios=Jd,ef.CanceledError=id,ef.CancelToken=Yd,ef.isCancel=rd,ef.VERSION=Hd,ef.toFormData=yu,ef.AxiosError=z,ef.Cancel=ef.CanceledErrorLine truncated
`)})):[U_()],r=(t.modelMappings??[]).length?(t.modelMappings??[]).map(e=>({from:e.from??``,to:e.to??``})):[W_()];return{upstreamUrl:t.upstreamUrl??``,upstreamApiKey:``,forceModelMappings:t.forceModelMappings===!0,upstreamMappings:n,modelMappings:r}}var K_=e=>e.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean);function q_({resource:e,mutating:t,formId:n,onSubmit:r,onDirtyChange:i}){let{t:a}=qo(),o=(0,y.useId)(),s=e?.raw??{},[c,l]=(0,y.useState)(()=>G_(s)),[u]=(0,y.useState)(()=>JSON.stringify(G_(s))),[d,f]=(0,y.useState)(null),p=(0,y.useMemo)(()=>JSON.stringify(c)!==u,[c,u]);return(0,y.useEffect)(()=>{i?.(p)},[p,i]),(0,I.jsxs)(`form`,{id:n,className:H.form,onSubmit:async e=>{e.preventDefault();try{f(null);let e=[],t=new Set;c.upstreamMappings.forEach(n=>{let r=n.upstreamApiKey.trim();if(!r||t.has(r))return;let i=K_(n.clientKeysText);i.length&&(t.add(r),e.push({upstreamApiKey:r,apiKeys:i}))});let n=[],i=new Set;c.modelMappings.forEach(e=>{let t=e.from.trim(),r=e.to.trim();if(!t||!r)return;let a=t.toLowerCase();i.has(a)||(i.add(a),n.push({from:t,to:r}))}),await r({upstreamUrl:c.upstreamUrl.trim()||void 0,upstreamApiKey:c.upstreamApiKey.trim()||s.upstreamApiKey?.trim()||void 0,upstreamApiKeys:e.length?e:void 0,modelMappings:n.length?n:void 0,forceModelMappings:c.forceModelMappings})}catch(e){f(e instanceof Error?e.message:String(e))}},noValidate:!0,children:[(0,I.jsxs)(`div`,{className:H.section,children:[(0,I.jsxs)(`div`,{className:H.field,children:[(0,I.jsx)(`label`,{className:H.label,htmlFor:`${o}-url`,children:a(`providersPage.ampcode.upstreamUrl`)}),(0,I.jsx)(`input`,{id:`${o}-url`,className:H.input,value:c.upstreamUrl,onChange:e=>l(t=>({...t,upstreamUrl:e.target.value})),placeholder:`https://api.ampcode.com`,disabled:t})]}),(0,I.jsxs)(`div`,{className:H.field,children:[(0,I.jsxs)(`label`,{className:H.label,htmlFor:`${o}-key`,children:[a(`providersPage.ampcode.upstreamApiKey`),(0,I.jsxs)(`span`,{className:H.labelHint,children:[` `,`· `,a(`providersPage.ampcode.upstreamApiKeyHint`)]})]}),(0,I.jsx)(`input`,{id:`${o}-key`,className:H.input,type:`password`,value:c.upstreamApiKey,onChange:e=>l(t=>({...t,upstreamApiKey:e.target.value})),autoComplete:`new-password`,"data-1p-ignore":`true`,"data-lpignore":`true`,"data-bwignore":`true`,disabled:t})]}),(0,I.jsxs)(`label`,{className:H.checkboxRow,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:H.checkboxBox,checked:c.forceModelMappings,disabled:t,onChange:e=>l(t=>({...t,forceModelMappings:e.target.checked}))}),(0,I.jsxs)(`span`,{className:H.checkboxText,children:[(0,I.jsx)(`span`,{children:a(`providersPage.ampcode.forceModelMappings`)}),(0,I.jsx)(`small`,{children:a(`providersPage.ampcode.forceModelMappingsHint`)})]})]})]}),(0,I.jsx)(H_,{label:a(`providersPage.ampcode.keyMappingsSection`),defaultOpen:!0,children:(0,I.jsxs)(`div`,{className:H.entriesList,children:[c.upstreamMappings.map((e,n)=>(0,I.jsxs)(`div`,{className:H.entryCard,children:[(0,I.jsxs)(`div`,{className:H.entryCardHeader,children:[(0,I.jsx)(`span`,{children:a(`providersPage.ampcode.mappingRow`,{index:n+1})}),(0,I.jsx)(`button`,{type:`button`,className:H.removeBtn,disabled:t||c.upstreamMappings.length<=1,onClick:()=>l(e=>({...e,upstreamMappings:e.upstreamMappings.filter((e,t)=>t!==n)})),children:(0,I.jsx)(ys,{size:12})})]}),(0,I.jsxs)(`div`,{className:H.field,children:[(0,I.jsx)(`label`,{className:H.label,children:a(`providersPage.ampcode.upstreamApiKey`)}),(0,I.jsx)(`input`,{className:H.input,value:e.upstreamApiKey,onChange:e=>l(t=>({...t,upstreamMappings:t.upstreamMappings.map((t,r)=>r===n?{...t,upstreamApiKey:e.target.value}:t)})),disabled:t})]}),(0,I.jsxs)(`div`,{className:H.field,children:[(0,I.jsxs)(`label`,{className:H.label,children:[a(`providersPage.ampcode.clientKeys`),(0,I.jsxs)(`span`,{className:H.labelHint,children:[` `,`· `,a(`providersPage.ampcode.clientKeysHint`)]})]}),(0,I.jsx)(`textarea`,{className:H.textarea,rows:3,value:e.clientKeysText,onChange:e=>l(t=>({...t,upstreamMappings:t.upstreamMappings.map((t,r)=>r===n?{...t,clientKeysText:e.target.value}:t)})),disabled:t})]})]},n)),(0,I.jsxs)(`button`,{type:`button`,className:H.addBtn,disabled:t,onClick:()=>l(e=>({...e,upstreamMappings:[...e.upstreamMappings,U_()]})),children:[(0,I.jsx)(us,{size:12}),(0,I.jsx)(`span`,{children:a(`providersPage.ampcode.addMapping`)})]})]})}),(0,I.jsx)(H_,{label:a(`providersPage.ampcode.modelMappingsSection`),children:(0,I.jsxs)(`div`,{className:H.entriesList,children:[c.modelMappings.map((e,n)=>(0,I.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr auto`,gap:8},children:[(0,I.jsx)(`input`,{className:H.input,placeholder:`from`,value:e.from,onChange:e=>l(t=>({...t,modelMappings:t.modelMappings.map((t,r)=>r===n?{...t,from:e.target.value}:t)})),disabled:t}),(0,I.jsx)(`input`,{className:H.input,placeholder:`to`,value:e.to,onChange:e=>l(t=>({...t,modelMappings:t.modelMappings.map((t,r)=>r===n?{...t,to:e.target.value}:t)})),disabled:t}),(0,I.jsx)(`button`,{type:`button`,className:H.removeBtLine truncated
`),websockets:e===`codex`?i.websockets===!0:void 0,cloak:e===`claude`?{mode:i.cloak?.mode??``,strictMode:i.cloak?.strictMode===!0,sensitiveWordsText:i.cloak?.sensitiveWords?.join(`
`)??``}:void 0,testModel:e===`claude`?``:void 0}}function dv({state:e}){return e===`loading`?(0,I.jsx)(`span`,{className:`${H.statusIcon} ${H.statusIconLoading}`,children:(0,I.jsx)(ms,{size:14})}):e===`success`?(0,I.jsx)(`span`,{className:`${H.statusIcon} ${H.statusIconSuccess}`,children:(0,I.jsx)(ps,{size:14})}):e===`error`?(0,I.jsx)(`span`,{className:`${H.statusIcon} ${H.statusIconError}`,children:(0,I.jsx)(fs,{size:14})}):null}function fv({brand:e,resource:t,mode:n,mutating:r,formId:i,onSubmit:a,onDirtyChange:o}){let{t:s}=qo(),c=R_[e],l=(0,y.useId)(),[u,d]=(0,y.useState)(()=>uv(e,t,n)),[f]=(0,y.useState)(()=>JSON.stringify(uv(e,t,n))),[p,m]=(0,y.useState)(null),[h,g]=(0,y.useState)(new Set),[_,v]=(0,y.useState)(!1),b=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},x=(0,y.useMemo)(()=>JSON.stringify(u)!==f,[u,f]);(0,y.useEffect)(()=>{o?.(x)},[x,o]);let S=(0,y.useMemo)(()=>n!==`edit`||!t||e===`openaiCompatibility`?``:t.raw?.apiKey??``,[e,n,t]),C=(0,y.useMemo)(()=>n!==`edit`||!t?``:t.raw?.authIndex??``,[n,t]),w=(0,y.useMemo)(()=>({baseUrlRequired:s(`providersPage.connectivity.baseUrlRequired`),endpointInvalid:s(`providersPage.connectivity.endpointInvalid`),apiKeyRequired:s(`providersPage.connectivity.apiKeyRequired`),modelRequired:s(`providersPage.connectivity.modelRequired`),timeout:e=>s(`providersPage.connectivity.timeout`,{seconds:e}),requestFailed:s(`providersPage.connectivity.requestFailed`)}),[s]),T=ev({brand:e,baseUrl:u.baseUrl,testModel:u.testModel,models:u.models,formHeaders:u.headers,apiKeyEntries:u.apiKeyEntries,apiKey:u.apiKey,fallbackApiKey:S,authIndex:C},w),E=iv({brand:e,baseUrl:u.baseUrl,formHeaders:u.headers,apiKeyEntries:u.apiKeyEntries,apiKey:u.apiKey,fallbackApiKey:S,authIndex:C}),[D,O]=(0,y.useState)(!1),k=(0,y.useMemo)(()=>{let e=new Set;return u.models.forEach(t=>{let n=(t.name??``).trim();n&&e.add(n)}),e},[u.models]),A=(0,y.useMemo)(()=>{let e=new Set,t=[];u.models.forEach(n=>{let r=(n.name??``).trim();!r||e.has(r)||(e.add(r),t.push(r))});let n=t[0],r=[{value:``,label:n?s(`providersPage.form.testModelAutoWith`,{name:n}):s(`providersPage.form.testModelAutoEmpty`)}];t.forEach(e=>r.push({value:e,label:e}));let i=(u.testModel??``).trim();return i&&!e.has(i)&&r.push({value:i,label:s(`providersPage.form.testModelCustom`,{name:i})}),r},[u.models,u.testModel,s]),j=()=>{O(!0),!E.loading&&!E.hasFetched&&E.fetch()},ee=()=>{O(!1)},M=e=>{e.length&&d(t=>{let n=new Set,r=[];t.models.forEach(e=>{let t=(e.name??``).trim();if(t){if(n.has(t))return;n.add(t)}r.push(e)});let i=r.findIndex(e=>!(e.name??``).trim()&&!(e.alias??``).trim());return i!==-1&&r.splice(i,1),e.forEach(e=>{let t=e.name.trim();!t||n.has(t)||(n.add(t),r.push({name:t,alias:(e.alias??``).trim()}))}),{...t,models:r}})},N=(e,t)=>{d(n=>({...n,[e]:t}))},te=(e,t)=>{d(n=>({...n,cloak:{...n.cloak??{mode:``,strictMode:!1,sensitiveWordsText:``},[e]:t}}))},P=()=>c.supportsName&&!u.name.trim()?s(`providersPage.form.validation.nameRequired`):c.supportsApiKey&&n===`create`&&!u.apiKey.trim()?s(`providersPage.form.validation.apiKeyRequired`):c.baseUrlRequired&&!u.baseUrl.trim()?s(`providersPage.form.validation.baseUrlRequired`):e===`openaiCompatibility`&&n===`create`&&!u.apiKeyEntries?.some(e=>e.apiKey.trim())?s(`providersPage.form.validation.apiKeyRequired`):null,F=async e=>{e.preventDefault();let t=P();if(t){m(t);return}try{m(null),await a(u)}catch(e){m(e instanceof Error?e.message:String(e))}},ne=(0,y.useMemo)(()=>u.headers.length?u.headers:[ov()],[u.headers]),re=(0,y.useMemo)(()=>u.models.length?u.models:[sv()],[u.models]),ie=(0,y.useMemo)(()=>u.apiKeyEntries&&u.apiKeyEntries.length?u.apiKeyEntries:[cv()],[u.apiKeyEntries]),ae=e=>{g(t=>{if(!t.size)return t;let n=new Set;return t.forEach(t=>{t<e?n.add(t):t>e&&n.add(t-1)}),n}),N(`apiKeyEntries`,ie.filter((t,n)=>n!==e))};return(0,I.jsxs)(`form`,{id:i,className:H.form,onSubmit:F,noValidate:!0,children:[(0,I.jsxs)(`div`,{className:H.section,children:[c.supportsName?(0,I.jsxs)(`div`,{className:H.field,children:[(0,I.jsx)(`label`,{className:H.label,htmlFor:`${l}-name`,children:s(`providersPage.form.name`)}),(0,I.jsx)(`input`,{id:`${l}-name`,className:H.input,value:u.name,onChange:e=>N(`name`,e.target.value),disabled:r})]}):null,c.supportsApiKey?(0,I.jsxs)(`div`,{className:H.field,children:[(0,I.jsx)(`label`,{className:H.label,htmlFor:`${l}-apiKey`,children:s(`providersPage.form.apiKey`)}),(0,I.jsxs)(`div`,{className:H.passwordField,children:[(0,I.jsx)(`input`,{id:`${l}-apiKey`,className:H.passwordInput,type:_?`text`:`password`,value:u.apiKey,onChange:e=>N(`apiKey`,e.target.value),autoComplete:`new-password`,"data-1p-ignore":`true`,"data-lpignore":`true`,"data-bwignore":`true`,placeholder:s(n===`edit`?`providersPage.form.apiKeyEditPlaceholder`:`providersPage.form.apiKeyCreatePlaceholder`),disabled:r}),(0,I.jsx)(`button`,{type:`button`,className:H.passwordToggle,onClick:()=>v(e=>!e),disabled:r,"aria-label":s(_?`providersPage.form.hideApiKey`:`providersPage.form.showApiKey`),title:s(_?`Line truncated
model-2`})]})}):null,c.supportsCloak&&u.cloak?(0,I.jsx)(H_,{label:s(`providersPage.form.cloakSection`),children:(0,I.jsxs)(`div`,{className:H.section,children:[(0,I.jsxs)(`div`,{className:H.field,children:[(0,I.jsx)(`label`,{className:H.label,children:s(`providersPage.form.cloakMode`)}),(0,I.jsx)(`input`,{className:H.input,value:u.cloak.mode,onChange:e=>te(`mode`,e.target.value),placeholder:`auto / always / never`,disabled:r})]}),(0,I.jsxs)(`label`,{className:H.checkboxRow,children:[(0,I.jsx)(`input`,{type:`checkbox`,className:H.checkboxBox,checked:u.cloak.strictMode,disabled:r,onChange:e=>te(`strictMode`,e.target.checked)}),(0,I.jsx)(`span`,{className:H.checkboxText,children:(0,I.jsx)(`span`,{children:s(`providersPage.form.cloakStrict`)})})]}),(0,I.jsxs)(`div`,{className:H.field,children:[(0,I.jsx)(`label`,{className:H.label,children:s(`providersPage.form.cloakSensitiveWords`)}),(0,I.jsx)(`textarea`,{className:H.textarea,rows:3,value:u.cloak.sensitiveWordsText,onChange:e=>te(`sensitiveWordsText`,e.target.value),disabled:r})]})]})}):null,p?(0,I.jsx)(`div`,{className:H.errorBox,children:p}):null]})}function pv(e){let t=String(e||``).trim();if(!t)return``;let n=t.length<4?1:2,r=t.slice(0,n),i=t.slice(-n),a=Math.max(10-n*2,1);return`${r}${`*`.repeat(a)}${i}`}function mv(e){if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=1024,r=Math.floor(Math.log(e)/Math.log(n));return`${(e/n**+r).toFixed(2)} ${t[r]}`}function hv(e,t){if(e==null||e===``)return``;let n=typeof e==`number`?e:Number(e),r=(()=>{if(!Number.isFinite(n)||Number.isNaN(n))return Ch(e)??new Date(String(e));let t=Math.abs(n);return t<1e11?new Date(n*1e3):t<0x5af3107a4000?new Date(n):t<0x16345785d8a0000?new Date(Math.round(n/1e3)):new Date(Math.round(n/1e6))})();return Number.isNaN(r.getTime())?``:t?r.toLocaleString(t):r.toLocaleString()}function gv({resource:e,usageByProvider:t}){let{t:n}=qo(),r=[[`identifier`,e.identifier],[`baseUrl`,e.baseUrl??n(`providersPage.status.notSet`)],[`proxyUrl`,e.proxyUrl??n(`providersPage.status.notSet`)],[`prefix`,e.prefix??n(`providersPage.status.none`)],[`models`,String(e.modelCount)],[`headers`,String(e.headerCount)]],i=[[`authIndex`,e.authIndex??n(`providersPage.status.notSet`)],[`excludedModels`,String(e.excludedModelCount)],[`apiKeyEntries`,String(e.apiKeyEntryCount)]],a=e.brand===`openaiCompatibility`?e.raw:null,o=a?.apiKeyEntries??[];return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:H.detailHeader,children:(0,I.jsx)(`div`,{className:H.sectionTitle,children:e.name??e.identifier})}),(0,I.jsx)(`dl`,{className:H.dl,children:r.map(([e,t])=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:H.dt,children:n(`providersPage.detail.fields.${e}`)}),(0,I.jsx)(`dd`,{className:H.dd,children:t})]},e))}),a&&o.length>0?(0,I.jsxs)(`div`,{className:H.apiKeyEntriesSection,children:[(0,I.jsxs)(`div`,{className:H.apiKeyEntriesLabel,children:[n(`providersPage.form.apiKeyEntriesSection`),`: `,o.length]}),(0,I.jsx)(`div`,{className:H.apiKeyEntryList,children:o.map((e,n)=>{let r=t?Kg(t,a.name,e.apiKey,a.baseUrl):{success:0,failure:0};return(0,I.jsxs)(`div`,{className:H.apiKeyEntryCard,children:[(0,I.jsx)(`span`,{className:H.apiKeyEntryIndex,children:n+1}),(0,I.jsx)(`span`,{className:H.apiKeyEntryKey,children:pv(e.apiKey)}),e.proxyUrl?(0,I.jsx)(`span`,{className:H.apiKeyEntryProxy,children:e.proxyUrl}):null,(0,I.jsxs)(`div`,{className:H.apiKeyEntryStats,children:[(0,I.jsxs)(`span`,{className:`${H.apiKeyEntryStat} ${H.apiKeyEntryStatSuccess}`,children:[(0,I.jsx)(bs,{size:12}),` `,r.success]}),(0,I.jsxs)(`span`,{className:`${H.apiKeyEntryStat} ${H.apiKeyEntryStatFailure}`,children:[(0,I.jsx)(ys,{size:12}),` `,r.failure]})]})]},`${e.apiKey}-${n}`)})})]}):null,(0,I.jsx)(`div`,{style:{marginTop:16},children:(0,I.jsx)(H_,{label:n(`providersPage.detail.metadataTitle`),children:(0,I.jsx)(`dl`,{className:H.dl,children:i.map(([e,t])=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:H.dt,children:n(`providersPage.detail.fields.${e}`)}),(0,I.jsx)(`dd`,{className:H.dd,children:t})]},e))})})})]})}function _v({state:e,onClose:t,onSwitchToEdit:n,workbench:r,onCreated:i,onUpdated:a,mutationDisabled:o=!1,usageByProvider:s,ref:c}){let{t:l}=qo(),{showConfirmation:u}=Sc(),d=(0,y.useId)(),[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(!1);(0,y.useEffect)(()=>{h(!1)},[e.brand,e.mode,e.resource?.id,e.open]);let g=(0,y.useCallback)(e=>{h(e)},[]),_=R_[e.brand],v=e.brand===`ampcode`,b=e.mode===`create`||e.mode===`edit`,x=f||o,S=x||e.mode===`edit`&&!m,C=(0,y.useCallback)(()=>!b||!m||f?Promise.resolve(!0):new Promise(e=>{u({title:l(`providersPage.unsavedChanges.title`),message:l(`providersPage.unsavedChanges.message`),variant:`danger`,confirmText:l(`providersPage.unsavedChanges.discard`),cancelText:l(`providersPage.unsavedChanges.keepEditing`),onConfirm:()=>e(!0),onCancel:()=>e(!1)})}),[m,b,u,f,l]);(0,y.useImperativeHandle)(c,()=>({confirmDiscardIfDirty:C}),[C]);let w=(0,y.useCallback)(()=>{C().then(e=>{e&&t()})},[C,t]),T=e.mode===`create`?`${l(`provLine truncated
`)}};KC.defaultYaml={explicit:!1,version:`1.2`},KC.defaultTags={"!!":`tag:yaml.org,2002:`};function qC(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function JC(e){let t=new Set;return LC(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function YC(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function XC(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??(i=JC(e));let a=YC(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(kC(t.node)||jC(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function ZC(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=ZC(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=ZC(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=ZC(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=ZC(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function QC(e,t,n){if(Array.isArray(e))return e.map((e,t)=>QC(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!NC(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var $C=class{constructor(e){Object.defineProperty(this,wC,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!EC(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=QC(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?ZC(i,{"":o},``,o):o}},ew=class extends $C{constructor(e){super(vC),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],LC(e,{Node:(e,t)=>{(TC(t)||NC(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||(QC(a,null,t),o=n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=tw(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(qC(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function tw(e,t,n){if(TC(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(jC(t)){let r=0;for(let i of t.items){let t=tw(e,i,n);t>r&&(r=t)}return r}else if(OC(t)){let r=tw(e,t.key,n),i=tw(e,t.value,n);return Math.max(r,i)}return 1}var nw=e=>!e||typeof e!=`function`&&typeof e!=`object`,rw=class extends $C{constructor(e){super(SC),this.value=e}toJSON(e,t){return t?.keep?this.value:QC(this.value,e,t)}toString(){return String(this.value)}};rw.BLOCK_FOLDED=`BLOCK_FOLDED`,rw.BLOCK_LITERAL=`BLOCK_LITERAL`,rw.PLAIN=`PLAIN`,rw.QUOTE_DOUBLE=`QUOTE_DOUBLE`,rw.QUOTE_SINGLE=`QUOTE_SINGLE`;var iw=`tag:yaml.org,2002:`;function aw(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function ow(e,t,n){if(EC(e)&&(e=e.contents),MC(e))return e;if(OC(e)){let t=n.schema[bC].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new ew(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=iw+t.slice(2));let l=aw(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new rw(e);return c&&(c.node=t),t}l=e instanceof Map?o[bC]:Symbol.iterator in Object(e)?o[CC]:o[bC]}a&&(a(l),delete n.onTagObjLine truncated
`)?dw(n,t):n.includes(`
`)?`
`+TC(n,t):(e.endsWith(` `)?``:` `)+n,DC=`flow`,OC=`block`,kC=`quoted`;function AC(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=jC(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=jC(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+dw(n,t):(e.endsWith(` `)?``:` `)+n,pw=`flow`,mw=`block`,hw=`quoted`;function gw(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=_w(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=_w(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function jC(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var MC=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),NC=e=>/^(%|---|\.\.\.)/m.test(e);function PC(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function FC(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(NC(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){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:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function _w(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var vw=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),yw=e=>/^(%|---|\.\.\.)/m.test(e);function bw(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function xw(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(yw(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){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:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:AC(o,a,kC,MC(t,!1))}function IC(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return FC(e,t);let n=t.indent||(NC(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:AC(r,n,DC,MC(t,!1))}function LC(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=FC;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?IC:i&&!t?FC:n?IC:FC}return r(e,t)}var RC;try{RC=RegExp(`(^|(?<!
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:gw(o,a,hw,vw(t,!1))}function Sw(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return xw(e,t);let n=t.indent||(yw(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:gw(r,n,pw,vw(t,!1))}function Cw(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=xw;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Sw:i&&!t?xw:n?Sw:xw}return r(e,t)}var ww;try{ww=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{RC=/\n+(?!\n|$)/g}function zC({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return LC(n,r);let l=r.indent||(r.forceBlockIndent||NC(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===_C.BLOCK_FOLDED?!1:t===_C.BLOCK_LITERAL?!0:!PC(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{ww=/\n+(?!\n|$)/g}function Tw({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Cw(n,r);let l=r.indent||(r.forceBlockIndent||yw(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===rw.BLOCK_FOLDED?!1:t===rw.BLOCK_LITERAL?!0:!bw(n,c,l.length);if(!n)return u?`|
`:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p=p.replace(RC,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`&&(p=p.slice(0,-1)),p=p.replace(ww,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=MC(r,!0);o!==`folded`&&t!==_C.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=AC(`${v}${e}${p}`,l,OC,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function BC(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return LC(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?LC(a,t):zC(e,t,n,r);if(!s&&!u&&i!==_C.PLAIN&&a.includes(`
`))return zC(e,t,n,r);if(NC(a)){if(c===``)return t.forceBlockIndent=!0,zC(e,t,n,r);if(s&&c===l)return LC(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return LC(a,t)}return s?d:AC(d,c,DC,MC(t,!1))}function VC(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==_C.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=_C.QUOTE_DOUBLE);let c=e=>{switch(e){case _C.BLOCK_FOLDED:case _C.BLOCK_LITERAL:return i||a?LC(o.value,t):zC(o,t,n,r);case _C.QUOTE_DOUBLE:return FC(o.value,t);case _C.QUOTE_SINGLE:return IC(o.value,t);case _C.PLAIN:return BC(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function HC(e,t){let n=Object.assign({blockQuote:!0,commentString:wC,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,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function UC(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(US(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function WC(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(US(e)||GS(e))&&e.anchor;a&&sC(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function GC(e,t,n,r){if(HS(e))return e.toString(t,n,r);if(zS(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=KS(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=UC(t.doc.schema.tags,a));let o=WC(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):US(a)?VC(a,t,n,r):a.toString(t,n,r);return o?US(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function KC({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=KS(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(GS(e)||!KS(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||GS(e)||(US(e)?e.type===_C.BLOCK_FOLDED||e.type===_C.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=GC(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=EC(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=EC(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=EC(g,n.indent,l(f))));let _,v,y;KS(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&US(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&WS(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=GC(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${TC(e,n.indent)}`}x===``&&!n.inFlow?S===`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=vw(r,!0);o!==`folded`&&t!==rw.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=gw(`${v}${e}${p}`,l,mw,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Ew(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return Cw(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?Cw(a,t):Tw(e,t,n,r);if(!s&&!u&&i!==rw.PLAIN&&a.includes(`
`))return Tw(e,t,n,r);if(yw(a)){if(c===``)return t.forceBlockIndent=!0,Tw(e,t,n,r);if(s&&c===l)return Cw(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return Cw(a,t)}return s?d:gw(d,c,pw,vw(t,!1))}function Dw(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==rw.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=rw.QUOTE_DOUBLE);let c=e=>{switch(e){case rw.BLOCK_FOLDED:case rw.BLOCK_LITERAL:return i||a?Cw(o.value,t):Tw(o,t,n,r);case rw.QUOTE_DOUBLE:return xw(o.value,t);case rw.QUOTE_SINGLE:return Sw(o.value,t);case rw.PLAIN:return Ew(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Ow(e,t){let n=Object.assign({blockQuote:!0,commentString:uw,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,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function kw(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(kC(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Aw(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(kC(e)||jC(e))&&e.anchor;a&&qC(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function jw(e,t,n,r){if(OC(e))return e.toString(t,n,r);if(TC(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=MC(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=kw(t.doc.schema.tags,a));let o=Aw(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):kC(a)?Dw(a,t,n,r):a.toString(t,n,r);return o?kC(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Mw({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=MC(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(jC(e)||!MC(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||jC(e)||(kC(e)?e.type===rw.BLOCK_FOLDED||e.type===rw.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=jw(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=fw(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=fw(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=fw(g,n.indent,l(f))));let _,v,y;MC(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&kC(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&AC(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=jw(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${dw(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&GS(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&jC(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else (x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=EC(g,n.indent,l(y)):h&&i&&i(),g}function qC(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var JC=`<<`,YC={identify:e=>e===JC||typeof e==`symbol`&&e.description===JC,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new _C(Symbol(JC)),{addToJSMap:ZC}),stringify:()=>JC},XC=(e,t)=>(YC.identify(t)||US(t)&&(!t.type||t.type===_C.PLAIN)&&YC.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===YC.tag&&e.default);function ZC(e,t,n){if(n=e&&zS(n)?n.resolve(e.doc):n,WS(n))for(let r of n.items)QC(e,t,r);else if(Array.isArray(n))for(let r of n)QC(e,t,r);else QC(e,t,n)}function QC(e,t,n){let r=e&&zS(n)?n.resolve(e.doc):n;if(!VS(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function $C(e,t,{key:n,value:r}){if(KS(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(XC(e,n))ZC(e,t,r);else{let i=fC(n,``,e);if(t instanceof Map)t.set(i,fC(r,i,e));else if(t instanceof Set)t.add(i);else{let a=ew(n,i,e),o=fC(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function ew(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(KS(e)&&n?.doc){let t=HC(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),qC(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function tw(e,t,n){return new nw(bC(e,void 0,n),bC(t,void 0,n))}var nw=class e{constructor(e,t=null){Object.defineProperty(this,RS,{value:FS}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return KS(n)&&(n=n.clone(t)),KS(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return $C(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?KC(this,e,t,n):JSON.stringify(this)}};function rw(e,t,n){return(t.inFlow??e.flow?aw:iw)(e,t,n)}function iw({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(KS(i))!d&&i.spaceBefore&&f.push(``),ow(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(HS(i)){let e=KS(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),ow(n,f,e.commentBefore,d))}d=!1;let s=GC(i,u,()=>o=null,()=>d=!0);o&&(s+=EC(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=fw(g,n.indent,l(y)):h&&i&&i(),g}function Nw(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Pw=`<<`,Fw={identify:e=>e===Pw||typeof e==`symbol`&&e.description===Pw,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new rw(Symbol(Pw)),{addToJSMap:Lw}),stringify:()=>Pw},Iw=(e,t)=>(Fw.identify(t)||kC(t)&&(!t.type||t.type===rw.PLAIN)&&Fw.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Fw.tag&&e.default);function Lw(e,t,n){if(n=e&&TC(n)?n.resolve(e.doc):n,AC(n))for(let r of n.items)Rw(e,t,r);else if(Array.isArray(n))for(let r of n)Rw(e,t,r);else Rw(e,t,n)}function Rw(e,t,n){let r=e&&TC(n)?n.resolve(e.doc):n;if(!DC(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function zw(e,t,{key:n,value:r}){if(MC(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Iw(e,n))Lw(e,t,r);else{let i=QC(n,``,e);if(t instanceof Map)t.set(i,QC(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Bw(n,i,e),o=QC(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Bw(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(MC(e)&&n?.doc){let t=Ow(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Nw(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Vw(e,t,n){return new Hw(ow(e,void 0,n),ow(t,void 0,n))}var Hw=class e{constructor(e,t=null){Object.defineProperty(this,wC,{value:xC}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return MC(n)&&(n=n.clone(t)),MC(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return zw(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Mw(this,e,t,n):JSON.stringify(this)}};function Uw(e,t,n){return(t.inFlow??e.flow?Gw:Ww)(e,t,n)}function Ww({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(MC(i))!d&&i.spaceBefore&&f.push(``),Kw(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(OC(i)){let e=MC(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Kw(n,f,e.commentBefore,d))}d=!1;let s=jw(i,u,()=>o=null,()=>d=!0);o&&(s+=fw(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=`
`+TC(l(e),c),s&&s()):d&&o&&o(),p}function aw({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(KS(i))i.spaceBefore&&d.push(``),ow(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(HS(i)){let e=KS(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),ow(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=KS(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=GC(i,c,()=>a=null);l||(l=d.length>u||o.includes(`
`)),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth)),l&&(o+=`,`)),a&&(o+=EC(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function ow({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=TC(t(r),e);n.push(i.trimStart())}}function sw(e,t){let n=US(t)?t.value:t;for(let r of e)if(HS(r)&&(r.key===t||r.key===n||US(r.key)&&r.key.value===n))return r}var cw=class extends CC{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(PS,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(tw(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=HS(e)?e:!e||typeof e!=`object`||!(`key`in e)?new nw(e,e?.value):new nw(e.key,e.value);let r=sw(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);US(r.value)&&gC(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=sw(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=sw(this.items,e)?.value;return(!t&&US(n)?n.value:n)??void 0}has(e){return!!sw(this.items,e)}set(e,t){this.add(new nw(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)$C(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!HS(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),rw(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},lw={collection:`map`,default:!0,nodeClass:cw,tag:`tag:yaml.org,2002:map`,resolve(e,t){return VS(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>cw.from(e,t,n)},uw=class extends CC{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(LS,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=dw(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=dw(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&US(r)?r.value:r}has(e){let t=dw(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=dw(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];US(r)&&gC(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(fC(e,String(r++),t));return n}toString(e,t,n){return e?rw(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(bC(a,void 0,n))}}return i}};function dw(e){let t=US(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var fw={collection:`seq`,default:!0,nodeClass:uw,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return WS(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>uw.from(e,t,n)},pw={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),VC(e,t,n,r)}},mw={identify:e=>e==null,createNode:()=>new _C(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _C(null),stringify:({source:e},t)=>typeof e==`string`&&mw.test.test(e)?e:t.options.nullStr},hw={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new _C(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&hw.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function gw({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var _w={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:gw},vw={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let tLine truncated
`:` `)}return VC({comment:e,type:t,value:s},r,i,a)}};function Mw(e,t){if(WS(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!HS(r)){if(VS(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new nw(new _C(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=HS(r)?r:new nw(r)}}else t(`Expected a sequence for this tag`);return e}function Nw(e,t,n){let{replacer:r}=n,i=new uw(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(tw(o,s,n))}return i}var Pw={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Mw,createNode:Nw},Fw=class e extends uw{constructor(){super(),this.add=cw.prototype.add.bind(this),this.delete=cw.prototype.delete.bind(this),this.get=cw.prototype.get.bind(this),this.has=cw.prototype.has.bind(this),this.set=cw.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(HS(e)?(r=fC(e.key,``,t),i=fC(e.value,r,t)):r=fC(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Nw(e,t,n),i=new this;return i.items=r.items,i}};Fw.tag=`tag:yaml.org,2002:omap`;var Iw={collection:`seq`,identify:e=>e instanceof Map,nodeClass:Fw,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Mw(e,t),r=[];for(let{key:e}of n.items)US(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Fw,n)},createNode:(e,t,n)=>Fw.from(e,t,n)};function Lw({value:e,source:t},n){return t&&(e?Rw:zw).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Rw={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new _C(!0),stringify:Lw},zw={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new _C(!1),stringify:Lw},Bw={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:gw},Vw={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():gw(e)}},Hw={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new _C(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:gw},Uw=e=>typeof e==`bigint`||Number.isInteger(e);function Ww(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Gw(e,t,n){let{value:r}=e;if(Uw(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return gw(e)}var Kw={identify:Uw,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Ww(e,2,2,n),stringify:e=>Gw(e,2,`0b`)},qw={identify:Uw,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Ww(e,1,8,n),stringify:e=>Gw(e,8,`0`)},Jw={identify:Uw,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Ww(e,0,10,n),stringify:gw},Yw={identify:Uw,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Ww(e,2,16,n),stringify:e=>Gw(e,16,`0x`)},Xw=class e extends cw{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=HS(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new nw(e.key,null):new nw(e,null),sw(this.items,t.key)||this.items.push(t)}get(e,t){let n=sw(this.items,e);return!t&&HS(n)?US(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=sw(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new nw(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))retLine truncated
`)?(n.push(`...`),n.push(TC(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(TC(a(t),``)))}return n.join(`
`+dw(l(e),c),s&&s()):d&&o&&o(),p}function Gw({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(MC(i))i.spaceBefore&&d.push(``),Kw(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(OC(i)){let e=MC(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Kw(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=MC(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=jw(i,c,()=>a=null);l||(l=d.length>u||o.includes(`
`)),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth)),l&&(o+=`,`)),a&&(o+=fw(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Kw({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=dw(t(r),e);n.push(i.trimStart())}}function qw(e,t){let n=kC(t)?t.value:t;for(let r of e)if(OC(r)&&(r.key===t||r.key===n||kC(r.key)&&r.key.value===n))return r}var Jw=class extends lw{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(bC,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Vw(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=OC(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Hw(e,e?.value):new Hw(e.key,e.value);let r=qw(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);kC(r.value)&&nw(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=qw(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=qw(this.items,e)?.value;return(!t&&kC(n)?n.value:n)??void 0}has(e){return!!qw(this.items,e)}set(e,t){this.add(new Hw(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)zw(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!OC(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Uw(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Yw={collection:`map`,default:!0,nodeClass:Jw,tag:`tag:yaml.org,2002:map`,resolve(e,t){return DC(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Jw.from(e,t,n)},Xw=class extends lw{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(CC,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Zw(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=Zw(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&kC(r)?r.value:r}has(e){let t=Zw(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Zw(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];kC(r)&&nw(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(QC(e,String(r++),t));return n}toString(e,t,n){return e?Uw(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(ow(a,void 0,n))}}return i}};function Zw(e){let t=kC(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Qw={collection:`seq`,default:!0,nodeClass:Xw,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return AC(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Xw.from(e,t,n)},$w={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Dw(e,t,n,r)}},eT={identify:e=>e==null,createNode:()=>new rw(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new rw(null),stringify:({source:e},t)=>typeof e==`string`&&eT.test.test(e)?e:t.options.nullStr},tT={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new rw(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&tT.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function nT({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}var rT={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:nT},iT={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let tLine truncated
`:` `)}return Dw({comment:e,type:t,value:s},r,i,a)}};function vT(e,t){if(AC(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!OC(r)){if(DC(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Hw(new rw(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=OC(r)?r:new Hw(r)}}else t(`Expected a sequence for this tag`);return e}function yT(e,t,n){let{replacer:r}=n,i=new Xw(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Vw(o,s,n))}return i}var bT={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:vT,createNode:yT},xT=class e extends Xw{constructor(){super(),this.add=Jw.prototype.add.bind(this),this.delete=Jw.prototype.delete.bind(this),this.get=Jw.prototype.get.bind(this),this.has=Jw.prototype.has.bind(this),this.set=Jw.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(OC(e)?(r=QC(e.key,``,t),i=QC(e.value,r,t)):r=QC(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=yT(e,t,n),i=new this;return i.items=r.items,i}};xT.tag=`tag:yaml.org,2002:omap`;var ST={collection:`seq`,identify:e=>e instanceof Map,nodeClass:xT,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=vT(e,t),r=[];for(let{key:e}of n.items)kC(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new xT,n)},createNode:(e,t,n)=>xT.from(e,t,n)};function CT({value:e,source:t},n){return t&&(e?wT:TT).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var wT={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new rw(!0),stringify:CT},TT={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new rw(!1),stringify:CT},ET={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:nT},DT={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():nT(e)}},OT={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new rw(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:nT},kT=e=>typeof e==`bigint`||Number.isInteger(e);function AT(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function jT(e,t,n){let{value:r}=e;if(kT(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return nT(e)}var MT={identify:kT,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>AT(e,2,2,n),stringify:e=>jT(e,2,`0b`)},NT={identify:kT,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>AT(e,1,8,n),stringify:e=>jT(e,8,`0`)},PT={identify:kT,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>AT(e,0,10,n),stringify:nT},FT={identify:kT,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>AT(e,2,16,n),stringify:e=>jT(e,16,`0x`)},IT=class e extends Jw{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=OC(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Hw(e.key,null):new Hw(e,null),qw(this.items,t.key)||this.items.push(t)}get(e,t){let n=qw(this.items,e);return!t&&OC(n)?kC(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=qw(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Hw(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))retLine truncated
`)?(n.push(`...`),n.push(dw(t,``))):n.push(`... ${t}`)}else n.push(`...`);else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(dw(a(t),``)))}return n.join(`
`)+`
`}var dT=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,RS,{value:NS});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new oC({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[RS]:{value:NS}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=KS(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){fT(this.contents)&&this.contents.add(e)}addIn(e,t){fT(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=cC(this);e.anchor=!t||n.has(t)?lC(t||`a`,n):t}return new mC(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=uC(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=bC(e,l,p);return o&&GS(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new nw(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return fT(this.contents)?this.contents.delete(e):!1}deleteIn(e){return SC(e)?this.contents==null?!1:(this.contents=null,!0):fT(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return GS(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return SC(e)?!t&&US(this.contents)?this.contents.value:this.contents:GS(this.contents)?this.contents.getIn(e,t):void 0}has(e){return GS(this.contents)?this.contents.has(e):!1}hasIn(e){return SC(e)?this.contents!==void 0:GS(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=xC(this.schema,[e],t):fT(this.contents)&&this.contents.set(e,t)}setIn(e,t){SC(e)?this.contents=t:this.contents==null?this.contents=xC(this.schema,Array.from(e),t):fT(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new oC({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new oC({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new lT(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=fC(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?dC(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return uT(this,e)}};function fT(e){if(GS(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var pT=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},mT=class extends pT{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},hT=class extends pT{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},gT=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function _T(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),m=!1),h&&(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),h=null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function vT(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(vT(t.key)||vT(t.value))return!0}return!1;default:return!0}}function yT(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&vT(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function bT(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||US(e)&&US(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var xT=`All mapping items must start at the same column`;function ST({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??cw)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=_T(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,xT)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||vT(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,xT);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&yT(r.indent,u,i),n.atKey=!1,bT(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=_T(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&yT(r.indent,f,i),s=c.range[2];let l=new nw(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new nw(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function CT({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??uw)(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=_T(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&yT(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function wT(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var TT=`Block collections are not allowed within flow collections`,ET=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function DT({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?cw:uw))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=_T(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&vT(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];HS(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],ET(m)&&i(r.range,`BLOCK_IN_FLOW`,TT)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);ET(f)&&i(g.range,`BLOCK_IN_FLOW`,TT),n.atKey=!1;let _=_T(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?ET(m)&&i(v.range,`BLOCK_IN_FLOW`,TT):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new nw(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;bT(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new cw(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=wT(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function OT(e,t,n,r,i,a){let o=n.type===`block-map`?ST(e,t,n,r,a):n.type===`block-seq`?CT(e,t,n,r,a):DT(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function kT(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===cw.tagName&&s===`map`||o===uw.tagName&&s===`seq`)return OT(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),OT(e,t,n,i,o)}let l=OT(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=KS(u)?u:new _C(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function AT(e,t,n){let r=t.offset,i=jT(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?_C.BLOCK_FOLDED:_C.BLOCK_LITERAL,o=t.source?MT(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`}var ZT=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,wC,{value:yC});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new KC({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[wC]:{value:yC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=MC(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){QT(this.contents)&&this.contents.add(e)}addIn(e,t){QT(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=JC(this);e.anchor=!t||n.has(t)?YC(t||`a`,n):t}return new ew(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=XC(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=ow(e,l,p);return o&&jC(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Hw(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return QT(this.contents)?this.contents.delete(e):!1}deleteIn(e){return cw(e)?this.contents==null?!1:(this.contents=null,!0):QT(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return jC(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return cw(e)?!t&&kC(this.contents)?this.contents.value:this.contents:jC(this.contents)?this.contents.getIn(e,t):void 0}has(e){return jC(this.contents)?this.contents.has(e):!1}hasIn(e){return cw(e)?this.contents!==void 0:jC(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=sw(this.schema,[e],t):QT(this.contents)&&this.contents.set(e,t)}setIn(e,t){cw(e)?this.contents=t:this.contents==null?this.contents=sw(this.schema,Array.from(e),t):QT(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new KC({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new KC({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new YT(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=QC(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?ZC(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return XT(this,e)}};function QT(e){if(jC(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var $T=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},eE=class extends $T{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},tE=class extends $T{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},nE=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function rE(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),m=!1),h&&(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),h=null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function iE(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(iE(t.key)||iE(t.value))return!0}return!1;default:return!0}}function aE(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&iE(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function oE(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||kC(e)&&kC(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var sE=`All mapping items must start at the same column`;function cE({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Jw)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=rE(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,sE)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||iE(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,sE);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&aE(r.indent,u,i),n.atKey=!1,oE(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=rE(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&aE(r.indent,f,i),s=c.range[2];let l=new Hw(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new Hw(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function lE({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new(a?.nodeClass??Xw)(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=rE(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found)if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&aE(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function uE(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var dE=`Block collections are not allowed within flow collections`,fE=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function pE({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new(a?.nodeClass??(o?Jw:Xw))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=rE(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&iE(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];OC(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],fE(m)&&i(r.range,`BLOCK_IN_FLOW`,dE)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);fE(f)&&i(g.range,`BLOCK_IN_FLOW`,dE),n.atKey=!1;let _=rE(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?fE(m)&&i(v.range,`BLOCK_IN_FLOW`,dE):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new Hw(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;oE(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new Jw(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=uE(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function mE(e,t,n,r,i,a){let o=n.type===`block-map`?cE(e,t,n,r,a):n.type===`block-seq`?lE(e,t,n,r,a):pE(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function hE(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Jw.tagName&&s===`map`||o===Xw.tagName&&s===`seq`)return mE(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),mE(e,t,n,i,o)}let l=mE(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=MC(u)?u:new rw(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function gE(e,t,n){let r=t.offset,i=_E(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?rw.BLOCK_FOLDED:rw.BLOCK_LITERAL,o=t.source?vE(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===_C.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===rw.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -97,70 +98,70 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function jT({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function MT(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function NT(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=_C.PLAIN,c=PT(a,l);break;case`single-quoted-scalar`:s=_C.QUOTE_SINGLE,c=FT(a,l);break;case`double-quoted-scalar`:s=_C.QUOTE_DOUBLE,c=LT(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=wT(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function PT(e,t){let n=``;switch(e[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 ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),IT(e)}function FT(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),IT(e.slice(1,-1)).replace(/''/g,`'`)}function IT(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function _E({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function vE(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function yE(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=rw.PLAIN,c=bE(a,l);break;case`single-quoted-scalar`:s=rw.QUOTE_SINGLE,c=xE(a,l);break;case`double-quoted-scalar`:s=rw.QUOTE_DOUBLE,c=CE(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=uE(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function bE(e,t){let n=``;switch(e[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 ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),SE(e)}function xE(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),SE(e.slice(1,-1)).replace(/''/g,`'`)}function SE(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
`,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
`,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
`?i+=a:a=`
`:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function LT(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
`:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function CE(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
`))if(i===`
`){let{fold:t,offset:i}=RT(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=zT[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=wE(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=TE[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=BT(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=EE(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&!(a===`\r`&&e[r+2]===`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function RT(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function wE(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
`);)r===`
`&&(n+=`
`),t+=1,r=e[t+1];return n||(n=` `),{fold:n,offset:t}}var zT={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function BT(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function VT(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?AT(e,t,r):NT(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[IS]:c?HT(e.schema,i,c,n,r):t.type===`scalar`?UT(e,i,t,r):e.schema[IS];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=US(a)?a:new _C(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new _C(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function HT(e,t,n,r,i){if(n===`!`)return e[IS];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[IS])}function UT({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[IS];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[IS];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function WT(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var GT={composeNode:KT,composeEmptyNode:qT};function KT(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=JT(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=VT(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=kT(GT,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??(l=qT(e,t.offset,void 0,null,n,r)),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!US(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function qT(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=VT(e,{type:`scalar`,offset:WT(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function JT({options:e},{offset:t,source:n,end:r},i){let a=new mC(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=wT(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function YT(e,t,{offset:n,start:r,value:i,end:a},o){let s=new dT(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=_T(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?KT(c,i,l,o):qT(c,l.end,r,null,l,o);let u=s.contents.range[2],d=wT(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function XT(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function ZT(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`),t+=1,r=e[t+1];return n||(n=` `),{fold:n,offset:t}}var TE={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function EE(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function DE(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?gE(e,t,r):yE(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[SC]:c?OE(e.schema,i,c,n,r):t.type===`scalar`?kE(e,i,t,r):e.schema[SC];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=kC(a)?a:new rw(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new rw(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function OE(e,t,n,r,i){if(n===`!`)return e[SC];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(t.default&&t.test)a.push(t);else return t;for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[SC])}function kE({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[SC];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[SC];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function AE(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var jE={composeNode:ME,composeEmptyNode:NE};function ME(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=PE(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=DE(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=hE(jE,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??(l=NE(e,t.offset,void 0,null,n,r)),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!kC(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function NE(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=DE(e,{type:`scalar`,offset:AE(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function PE({options:e},{offset:t,source:n,end:r},i){let a=new ew(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=uE(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function FE(e,t,{offset:n,start:r,value:i,end:a},o){let s=new ZT(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=rE(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?ME(c,i,l,o):NE(c,l.end,r,null,l,o);let u=s.contents.range[2],d=uE(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function IE(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function LE(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var QT=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=XT(e);r?this.warnings.push(new hT(i,t,n)):this.errors.push(new mT(i,t,n))},this.directives=new oC({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=ZT(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(GS(i)&&!i.flow&&i.items.length>0){let e=i.items[0];HS(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(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:ZT(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=XT(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=YT(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new mT(XT(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new mT(XT(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=wT(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new mT(XT(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new dT(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},$T=Symbol(`break visit`),eE=Symbol(`skip children`),tE=Symbol(`remove item`);function nE(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),rE(Object.freeze([]),e,t)}nE.BREAK=$T,nE.SKIP=eE,nE.REMOVE=tE,nE.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},nE.parentCollection=(e,t)=>{let n=nE.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function rE(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=rE(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===$T)return $T;else r===tE&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function iE(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var RE=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=IE(e);r?this.warnings.push(new tE(i,t,n)):this.errors.push(new eE(i,t,n))},this.directives=new KC({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=LE(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(jC(i)&&!i.flow&&i.items.length>0){let e=i.items[0];OC(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(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:LE(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=IE(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=FE(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new eE(IE(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new eE(IE(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=uE(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new eE(IE(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new ZT(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},zE=Symbol(`break visit`),BE=Symbol(`skip children`),VE=Symbol(`remove item`);function HE(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),UE(Object.freeze([]),e,t)}HE.BREAK=zE,HE.SKIP=BE,HE.REMOVE=VE,HE.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},HE.parentCollection=(e,t)=>{let n=HE.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function UE(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=UE(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===zE)return zE;else r===VE&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function WE(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r
`: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(e[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 aE(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var oE=new Set(`0123456789ABCDEFabcdef`),sE=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),cE=new Set(`,[]{}`),lE=new Set(` ,[]{}
\r `),uE=e=>!e||lE.has(e),dE=class{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,t=!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=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`: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(e[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 GE(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var KE=new Set(`0123456789ABCDEFabcdef`),qE=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),JE=new Set(`,[]{}`),YE=new Set(` ,[]{}
\r `),XE=e=>!e||YE.has(e),ZE=class{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,t=!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=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`?!0:t===`\r`?this.buffer[e+1]===`
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&aE(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(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,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]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let 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`);let e=this.peek(3);if((e===`---`||e===`...`)&&aE(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!aE(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&aE(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);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(uE),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&aE(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`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,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(uE),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||aE(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&GE(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(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,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]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}else n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let 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`);let e=this.peek(3);if((e===`---`||e===`...`)&&GE(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!GE(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&GE(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);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(XE),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&GE(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]===`]`||r[0]===`}`)))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`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,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(XE),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||GE(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>aE(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>GE(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(aE(r)||e&&cE.has(r))break;t=n}else if(aE(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(GE(r)||e&&JE.has(r))break;t=n}else if(GE(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&cE.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&cE.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(uE))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(aE(t)||e&&cE.has(t))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,t=this.buffer[e];for(;!aE(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(sE.has(t))t=this.buffer[++e];else if(t===`%`&&oE.has(this.buffer[e+1])&&oE.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&JE.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&JE.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(XE))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(GE(t)||e&&JE.has(t))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,t=this.buffer[e];for(;!GE(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(qE.has(t))t=this.buffer[++e];else if(t===`%`&&KE.has(this.buffer[e+1])&&KE.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},fE=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function pE(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function mE(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function hE(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function gE(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function _E(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function vE(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!pE(t.start,`explicit-key-ind`)&&!pE(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,hE(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var yE=class{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 dE,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=iE(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){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}}*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(){let e=this.peek(1);if(this.type===`doc-end`&&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){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&vE(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&mE(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.itLine truncated
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},QE=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function $E(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function eD(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function tD(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function nD(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function rD(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function iD(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!$E(t.start,`explicit-key-ind`)&&!$E(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,tD(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var aD=class{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 ZE,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=WE(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){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}}*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(){let e=this.peek(1);if(this.type===`doc-end`&&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){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&iD(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&eD(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.itLine truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,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(t.explicitKey)if(!t.sep)if(pE(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=_E(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(pE(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(hE(t.key)&&!pE(t.sep,`newline`)){let e=_E(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):pE(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!pE(t.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 n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||pE(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newlLine truncated
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,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(t.explicitKey)if(!t.sep)if($E(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=rD(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if($E(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(tD(t.key)&&!$E(t.sep,`newline`)){let e=rD(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):$E(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!$E(t.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 n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||$E(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newlLine truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+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;let t=_E(gE(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=_E(gE(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function bE(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new fE||null,prettyErrors:t}}function xE(e,t={}){let{lineCounter:n,prettyErrors:r}=bE(t),i=new yE(n?.addNewLine),a=new QT(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new mT(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(gT(e,n)),o.warnings.forEach(gT(e,n))),o}function SE(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=xE(e,n);if(!i)return null;if(i.warnings.forEach(e=>qC(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var CE={section:`ConfigSection-module__section___36A5y`,header:`ConfigSection-module__header___9y9kI`,titleRow:`ConfigSection-module__titleRow___MDqPS`,indexBadge:`ConfigSection-module__indexBadge___BNk-6`,iconBadge:`ConfigSection-module__iconBadge___608--`,headingGroup:`ConfigSection-module__headingGroup___iqK3P`,title:`ConfigSection-module__title___fNwM-`,description:`ConfigSection-module__description___uM2Zw`,content:`ConfigSection-module__content___RBAGw`},wE=(0,y.forwardRef)(function({title:e,description:t,indexLabel:n,icon:r,className:i,children:a,...o},s){return(0,B.jsxs)(`section`,{ref:s,className:[CE.section,i].filter(Boolean).join(` `),...o,children:[(0,B.jsxs)(`header`,{className:CE.header,children:[(0,B.jsxs)(`div`,{className:CE.titleRow,children:[n?(0,B.jsx)(`span`,{className:CE.indexBadge,children:n}):null,r?(0,B.jsx)(`span`,{className:CE.iconBadge,children:r}):null]}),(0,B.jsxs)(`div`,{className:CE.headingGroup,children:[(0,B.jsx)(`h2`,{className:CE.title,children:e}),t?(0,B.jsx)(`p`,{className:CE.description,children:t}):null]})]}),(0,B.jsx)(`div`,{className:CE.content,children:a})]})});function TE(e){let[t,n]=(0,y.useState)(()=>window.matchMedia(e).matches);return(0,y.useEffect)(()=>{let t=window.matchMedia(e),r=e=>{n(e.matches)};return r({matches:t.matches}),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var q={visualEditor:`VisualConfigEditor-module__visualEditor___qt8bb`,expandableInputWrapper:`VisualConfigEditor-module__expandableInputWrapper___k5rpc`,expandableTextarea:`VisualConfigEditor-module__expandableTextarea___OVvmN`,expandableToggle:`VisualConfigEditor-module__expandableToggle___M5mBU`,expandableInputExpanded:`VisualConfigEditor-module__expandableInputExpanded___9zfyv`,overview:`VisualConfigEditor-module__overview___OzHQc`,overviewHeader:`VisualConfigEditor-module__overviewHeader___A8kWa`,overviewMeta:`VisualConfigEditor-module__overviewMeta___SM8ZF`,overviewPill:`VisualConfigEditor-module__overviewPill___eXq54`,overviewPillWarning:`VisualConfigEditor-module__overviewPillWarning___ruscj`,workspace:`VisualConfigEditor-module__workspace___gqLDP`,mobileSectionNav:`VisualConfigEditor-module__mobileSectionNav___d-TWK`,mobileSectionNavScroller:`VisualConfigEditor-module__mobileSectionNavScroller___VGXz-`,mobileSectionNavButton:`VisualConfigEditor-module__mobileSectionNavButton___mR9BT`,mobileSectionNavButtonActive:`VisualConfigEditor-module__mobileSectionNavButtonActive___ug6e6`,mobileSectionNavIndex:`VisualConfigEditor-module__mobileSectionNavIndex___eVeF8`,mobileSectionNavLabel:`VisualConfigEditor-module__mobileSectionLine truncated
`)}function jE(e){if(Object.prototype.hasOwnProperty.call(e,`api-keys`))return AE(e[`api-keys`]);let t=OE(OE(OE(e.auth)?.providers)?.[`config-api-key`]);return t?Object.prototype.hasOwnProperty.call(t,`api-key-entries`)?AE(t[`api-key-entries`]):AE(t[`api-keys`]):``}function ME(e,t){return e.hasIn(t)}function NE(e,t){VS(e.getIn(t,!0))||e.setIn(t,e.createNode({}))}function PE(e,t){let n=e.getIn(t,!0);VS(n)&&n.items.length===0&&e.deleteIn(t)}function FE(e,t,n){if(n){e.setIn(t,!0);return}ME(e,t)&&e.setIn(t,!1)}function IE(e,t,n,r){return ME(e,t)||n.has(r)}function LE(e,t,n){let r=typeof n==`string`?n:``;if(r.trim()!==``){e.setIn(t,r);return}ME(e,t)&&e.setIn(t,``)}function RE(e,t,n){let r=(typeof n==`string`?n:``).trim();if(r===``){ME(e,t)&&e.deleteIn(t);return}if(!/^-?\d+$/.test(r))return;let i=Number(r);if(Number.isFinite(i)){e.setIn(t,i);return}}function zE(e,t,n){if(n===`chat`){e.setIn(t,`chat`);return}if(n===`true`){e.setIn(t,!0);return}ME(e,t)&&e.setIn(t,!1)}function BE(e){let t=e.trim();if(t)return/^-?\d+$/.test(t)&&Number(t)>=0?void 0:`non_negative_integer`}function VE(e){let t=e.trim();if(!t)return;if(!/^\d+$/.test(t))return`port_range`;let n=Number(t);return n>=1&&n<=65535?void 0:`port_range`}function HE(e){return{port:VE(e.port),errorLogsMaxFiles:BE(e.errorLogsMaxFiles),logsMaxTotalSizeMb:BE(e.logsMaxTotalSizeMb),redisUsageQueueRetentionSeconds:BE(e.redisUsageQueueRetentionSeconds),requestRetry:BE(e.requestRetry),maxRetryCredentials:BE(e.maxRetryCredentials),maxRetryInterval:BE(e.maxRetryInterval),authAutoRefreshWorkers:BE(e.authAutoRefreshWorkers),"streaming.keepaliveSeconds":BE(e.streaming.keepaliveSeconds),"streaming.bootstrapRetries":BE(e.streaming.bootstrapRetries),"streaming.nonstreamKeepaliveInterval":BE(e.streaming.nonstreamKeepaliveInterval)}}function UE(e){let t=e.value.trim();switch(e.valueType){case`number`:{if(!t)return`payload_invalid_number`;let e=Number(t);return Number.isFinite(e)?void 0:`payload_invalid_number`}case`boolean`:{let e=t.toLowerCase();return e===`true`||e===`false`?void 0:`payload_invalid_boolean`}case`json`:if(!t)return`payload_invalid_json`;try{JSON.parse(e.value);return}catch{return`payload_invalid_json`}default:return}}function WE(e){return e.some(e=>e.params.some(e=>!!UE(e))||e.models.some(e=>(e.match??[]).some(e=>!!UE(e))||(e.notMatch??[]).some(e=>!!UE(e))))}function GE(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function KE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||r.name!==i.name||r.protocol!==i.protocol||r.fromProtocol!==i.fromProtocol||!JE(r.headers,i.headers)||!qE(r.match??[],i.match??[])||!qE(r.notMatch??[],i.notMatch??[])||!YE(r.exist,i.exist)||!YE(r.notExist,i.notExist))return!1}return!0}function qE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||r.path!==i.path||r.valueType!==i.valueType||r.value!==i.value)return!1}return!0}function JE(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1){let t=n[e],i=r[e];if(!t||!i||t.id!==i.id||t.name!==i.name||t.value!==i.value)return!1}return!0}function YE(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1)if(n[e]!==r[e])return!1;return!0}function XE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||!KE(r.models,i.models)||!qE(r.params,i.params))return!1}return!0}function ZE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||!KE(r.models,i.models)||r.params.length!==i.params.length)return!1;for(let e=0;e<r.params.length;e+=1)if(r.params[e]!==i.params[e])return!1}return!0}function QE(e){if(typeof e==`number`)return{valueType:`number`,value:String(e)};if(typeof e==`boolean`)return{valueType:`boolean`,value:String(e)};if(e===null||typeof e==`object`)try{return{valueType:`json`,value:JSON.stringify(e,null,2)??`null`}}catch{return{valueType:`json`,value:String(e)}}return{valueType:`string`,value:String(e??``)}}function $E(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??``}catch{return String(e??``)}}function eD(e){if(typeof e==`string`)return e.trim()?e:void 0}function tD(e){if(e===!0)return`true`;if(typeof e==`string`){let t=e.trim().toLowerCase();if(t===`true`)return`true`;if(t===`chat`)return`chat`}return`false`}function nD(e,t){let n=OE(e);return n?Object.entries(n).map(([e,n],r)=>({id:`${t}-header-${r}`,name:e,value:String(n??``)})):[]}function rD(e,t){if(!Array.isArray(e))return[];let n=[];return e.forEach((e,r)=>{let i=OE(e);if(!i){typeof e==`string`&&n.push({id:`${t}-condition-${r}-0`,path:e,valueType:`string`,value:``});return}Object.entries(i).forEach(([e,i],a)=>{let o=QE(i);n.push({id:`${t}-condition-${r}-${a}`,path:e,valueType:o.valLine truncated
`).map(e=>e.trim()).filter(Boolean);if(a.length>0?t.setIn([`api-keys`],a):ME(t,[`api-keys`])&&t.deleteIn([`api-keys`]),aD(t),FE(t,[`debug`],r.debug),FE(t,[`commercial-mode`],r.commercialMode),FE(t,[`logging-to-file`],r.loggingToFile),RE(t,[`logs-max-total-size-mb`],r.logsMaxTotalSizeMb),RE(t,[`error-logs-max-files`],r.errorLogsMaxFiles),FE(t,[`usage-statistics-enabled`],r.usageStatisticsEnabled),RE(t,[`redis-usage-queue-retention-seconds`],r.redisUsageQueueRetentionSeconds),LE(t,[`proxy-url`],r.proxyUrl),FE(t,[`force-model-prefix`],r.forceModelPrefix),FE(t,[`passthrough-headers`],r.passthroughHeaders),RE(t,[`request-retry`],r.requestRetry),RE(t,[`max-retry-credentials`],r.maxRetryCredentials),RE(t,[`max-retry-interval`],r.maxRetryInterval),FE(t,[`disable-cooling`],r.disableCooling),zE(t,[`disable-image-generation`],r.disableImageGeneration),RE(t,[`auth-auto-refresh-workers`],r.authAutoRefreshWorkers),FE(t,[`ws-auth`],r.wsAuth),FE(t,[`enable-gemini-cli-endpoint`],r.enableGeminiCliEndpoint),(ME(t,[`antigravity-signature-cache-enabled`])||!r.antigravitySignatureCacheEnabled)&&t.setIn([`antigravity-signature-cache-enabled`],r.antigravitySignatureCacheEnabled),FE(t,[`antigravity-signature-bypass-strict`],r.antigravitySignatureBypassStrict),(ME(t,[`claude-header-defaults`])||r.claudeHeaderUserAgent.trim()||r.claudeHeaderPackageVersion.trim()||r.claudeHeaderRuntimeVersion.trim()||r.claudeHeaderOs.trim()||r.claudeHeaderArch.trim()||r.claudeHeaderTimeout.trim()||r.claudeHeaderStabilizeDeviceProfile)&&(NE(t,[`claude-header-defaults`]),LE(t,[`claude-header-defaults`,`user-agent`],r.claudeHeaderUserAgent),LE(t,[`claude-header-defaults`,`package-version`],r.claudeHeaderPackageVersion),LE(t,[`claude-header-defaults`,`runtime-version`],r.claudeHeaderRuntimeVersion),LE(t,[`claude-header-defaults`,`os`],r.claudeHeaderOs),LE(t,[`claude-header-defaults`,`arch`],r.claudeHeaderArch),LE(t,[`claude-header-defaults`,`timeout`],r.claudeHeaderTimeout),FE(t,[`claude-header-defaults`,`stabilize-device-profile`],r.claudeHeaderStabilizeDeviceProfile),PE(t,[`claude-header-defaults`])),(ME(t,[`codex-header-defaults`])||r.codexHeaderUserAgent.trim()||r.codexHeaderBetaFeatures.trim())&&(NE(t,[`codex-header-defaults`]),LE(t,[`codex-header-defaults`,`user-agent`],r.codexHeaderUserAgent),LE(t,[`codex-header-defaults`,`beta-features`],r.codexHeaderBetaFeatures),PE(t,[`codex-header-defaults`])),ME(t,[`quota-exceeded`])||!r.quotaSwitchProject||!r.quotaSwitchPreviewModel||IE(t,[`quota-exceeded`,`antigravity-credits`],i,`quotaAntigravityCredits`)){NE(t,[`quota-exceeded`]);let e=IE(t,[`quota-exceeded`,`antigravity-credits`],i,`quotaAntigravityCredits`);t.setIn([`quota-exceeded`,`switch-project`],r.quotaSwitchProject),t.setIn([`quota-exceeded`,`switch-preview-model`],r.quotaSwitchPreviewModel),e&&t.setIn([`quota-exceeded`,`antigravity-credits`],r.quotaAntigravityCredits),PE(t,[`quota-exceeded`])}(ME(t,[`routing`])||r.routingStrategy!==`round-robin`||r.routingSessionAffinity||r.routingSessionAffinityTTL.trim())&&(NE(t,[`routing`]),t.setIn([`routing`,`strategy`],r.routingStrategy),FE(t,[`routing`,`session-affinity`],r.routingSessionAffinity),LE(t,[`routing`,`session-affinity-ttl`],r.routingSessionAffinityTTL),PE(t,[`routing`]));let o=typeof r.streaming?.keepaliveSeconds==`string`?r.streaming.keepaliveSeconds:``,s=typeof r.streaming?.bootstrapRetries==`string`?r.streaming.bootstrapRetries:``,c=typeof r.streaming?.nonstreamKeepaliveInterval==`string`?r.streaming.nonstreamKeepaliveInterval:``;return(ME(t,[`streaming`])||o.trim()||s.trim())&&(NE(t,[`streaming`]),RE(t,[`streaming`,`keepalive-seconds`],o),RE(t,[`streaming`,`bootstrap-retries`],s),PE(t,[`streaming`])),RE(t,[`nonstream-keepalive-interval`],c),(ME(t,[`payload`])||r.payloadDefaultRules.length>0||r.payloadDefaultRawRules.length>0||r.payloadOverrideRules.length>0||r.payloadOverrideRawRules.length>0||r.payloadFilterRules.length>0)&&(NE(t,[`payload`]),r.payloadDefaultRules.length>0?t.setIn([`payload`,`default`],hD(r.payloadDefaultRules)):ME(t,[`payload`,`default`])&&t.deleteIn([`payload`,`default`]),r.payloadDefaultRawRules.length>0?t.setIn([`payload`,`default-raw`],_D(r.payloadDefaultRawRules)):ME(t,[`payload`,`default-raw`])&&t.deleteIn([`payload`,`default-raw`]),r.payloadOverrideRules.length>0?t.setIn([`payload`,`override`],hD(r.payloadOverrideRules)):ME(t,[`payload`,`override`])&&t.deleteIn([`payload`,`override`]),r.payloadOverrideRawRules.length>0?t.setIn([`payload`,`override-raw`],_D(r.payloadOverrideRawRules)):ME(t,[`payload`,`override-raw`])&&t.deleteIn([`payload`,`override-raw`]),r.payloadFilterRules.length>0?t.setIn([`payload`,`filter`],gD(r.payloadFilterRules)):ME(t,[`payload`,`filter`])&&t.deleteIn([`payload`,`filter`]),PE(t,[`payload`])),t.toString({indent:2,lineWidth:120,minContentWidth:0})}catch{return e}},[i,n]),setVisualValues:(0,y.useCallback)(e=>{t({type:`set_values`,values:e})},[])}}var CD=[{value:``,labelKey:`config_management.visual.payload_rules.provider_default`,defaultLabelLine truncated
`).map(e=>e.trim()).filter(Boolean),[e]),[o,s]=(0,y.useState)(()=>a.map(()=>EE())),c=(0,y.useMemo)(()=>o.length===a.length?o:o.length>a.length?o.slice(0,a.length):[...o,...Array.from({length:a.length-o.length},()=>EE())],[o,a.length]),l=(0,y.useId)(),u=`${l}-hint`,d=`${l}-error`,[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(``),[v,b]=(0,y.useState)(``);function x(){let e=new Uint8Array(17);return crypto.getRandomValues(e),`sk-`+Array.from(e,e=>`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[e%62]).join(``)}let S=()=>{h(null),_(``),b(``),p(!0)},C=e=>{let t=c.findIndex(t=>t===e);h(e),_(a[t]??``),b(``),p(!0)},w=()=>{p(!1),_(``),h(null),b(``)},T=e=>{n(e.join(`
`))},E=e=>{let t=c.findIndex(t=>t===e);t<0||(s(c.filter(t=>t!==e)),T(a.filter((e,n)=>n!==t)))},D=()=>{let e=g.trim();if(!e){b(r(`config_management.visual.api_keys.error_empty`));return}if(!TD(e)){b(r(`config_management.visual.api_keys.error_invalid`));return}let t=m?c.findIndex(e=>e===m):-1,n=m===null?[...a,e]:a.map((n,r)=>r===t?e:n);m===null&&s([...c,EE()]),T(n),w()},O=async e=>{let t=await wv(e);i(r(t?`notification.link_copied`:`notification.copy_failed`),t?`success`:`error`)};return(0,B.jsxs)(`div`,{className:`form-group`,style:{marginBottom:0},children:[(0,B.jsxs)(`div`,{className:q.blockHeaderRow,children:[(0,B.jsx)(`label`,{style:{margin:0},children:r(`config_management.visual.api_keys.label`)}),(0,B.jsx)(V,{size:`sm`,onClick:S,disabled:t,children:r(`config_management.visual.api_keys.add`)})]}),a.length===0?(0,B.jsx)(`div`,{className:q.emptyState,children:r(`config_management.visual.api_keys.empty`)}):(0,B.jsx)(`div`,{className:`item-list`,style:{marginTop:4},children:a.map((e,n)=>(0,B.jsxs)(`div`,{className:`item-row`,children:[(0,B.jsxs)(`div`,{className:`item-meta`,children:[(0,B.jsxs)(`div`,{className:`pill`,children:[`#`,n+1]}),(0,B.jsx)(`div`,{className:`item-title`,children:r(`config_management.visual.api_keys.input_label`)}),(0,B.jsx)(`div`,{className:`item-subtitle`,children:mg(String(e||``))})]}),(0,B.jsxs)(`div`,{className:`item-actions`,children:[(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:()=>O(e),disabled:t,children:r(`common.copy`)}),(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:()=>C(c[n]??``),disabled:t,children:r(`config_management.visual.common.edit`)}),(0,B.jsx)(V,{variant:`danger`,size:`sm`,onClick:()=>E(c[n]??``),disabled:t,children:r(`config_management.visual.common.delete`)})]})]},c[n]??`${e}-${n}`))}),(0,B.jsx)(`div`,{className:`hint`,children:r(`config_management.visual.api_keys.hint`)}),(0,B.jsx)(sm,{open:f,onClose:w,title:r(m===null?`config_management.visual.api_keys.add_title`:`config_management.visual.api_keys.edit_title`),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(V,{variant:`secondary`,onClick:w,disabled:t,children:r(`config_management.visual.common.cancel`)}),(0,B.jsx)(V,{onClick:D,disabled:t,children:r(m===null?`config_management.visual.common.add`:`config_management.visual.common.update`)})]}),children:(0,B.jsxs)(`div`,{className:`form-group`,children:[(0,B.jsx)(`label`,{htmlFor:l,children:r(`config_management.visual.api_keys.input_label`)}),(0,B.jsxs)(`div`,{className:q.apiKeyModalInputRow,children:[(0,B.jsx)(`input`,{id:l,className:`input`,placeholder:r(`config_management.visual.api_keys.input_placeholder`),value:g,onChange:e=>_(e.target.value),disabled:t,"aria-describedby":v?`${d} ${u}`:u,"aria-invalid":!!v}),(0,B.jsx)(V,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>{_(x()),b(``)},disabled:t,children:r(`config_management.visual.api_keys.generate`)})]}),(0,B.jsx)(`div`,{id:u,className:`hint`,children:r(`config_management.visual.api_keys.input_hint`)}),v&&(0,B.jsx)(`div`,{id:d,className:`error-box`,children:v})]})})]})}),jD=(0,y.memo)(function({value:e,disabled:t,placeholder:n,inputAriaLabel:r,onChange:i}){let{t:a}=qo(),o=e.length?e:[],[s,c]=(0,y.useState)(()=>o.map(()=>EE())),l=(0,y.useMemo)(()=>s.length===o.length?s:s.length>o.length?s.slice(0,o.length):[...s,...Array.from({length:o.length-s.length},()=>EE())],[s,o.length]),u=(e,t)=>i(o.map((n,r)=>r===e?t:n)),d=()=>{c([...l,EE()]),i([...o,``])},f=e=>{c(l.filter((t,n)=>n!==e)),i(o.filter((t,n)=>n!==e))};return(0,B.jsxs)(`div`,{className:q.stringList,children:[o.map((e,i)=>(0,B.jsxs)(`div`,{className:q.stringListRow,children:[(0,B.jsx)(DD,{placeholder:n,ariaLabel:r??n,value:e,onChange:e=>u(i,e),disabled:t}),(0,B.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>f(i),disabled:t,children:a(`config_management.visual.common.delete`)})]},l[i]??`item-${i}`)),(0,B.jsx)(`div`,{className:q.actionRow,children:(0,B.jsx)(V,{variant:`secondary`,size:`sm`,onClick:d,disabled:t,children:a(`config_management.visual.common.add`)})})]})});function MD(e){return!!(e.fromProtocol||(e.headers?.length??0)>0||(e.match?.length??0)>0||(e.notMatch?.length??0)>0||(e.exist?.length??0)>0||(e.notExist?.length??0)>0)}var ND=(0,y.memo)(function({value:e,disabled:t,protocolFirst:n=!1,rawJsonValues:r=!1,onChange:i}){let{t:a}=qo(),o=e,s=(0,y.useMemo)(()=>kD(a,o),[o,a]),c=(0,y.useMemo)(()=>[{value:``,label:a(`config_management.visual.payload_rules.provider_default`)},{value:`openai`,label:a(`config_management.visual.payload_rules.provider_openai`)},{value:`responses`,label:a(`config_management.visual.payload_rules.provider_responses`)},{value:`gemini`,label:a(`config_management.visual.payload_rules.provider_gemini`)},{value:`claude`,label:a(`config_management.visual.payload_rules.provider_claude`)}],[a]),l=(0,y.useMemo)(()=>wD.map(e=>({value:e.value,label:a(e.labelKey,{defaultValue:e.defaultLabel})})),[a]),u=(0,y.useMemo)(()=>[{value:`true`,label:a(`config_management.visual.payload_rules.boolean_true`)},{value:`false`,label:a(Line truncated
`){[e,t]=aO(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},YO=class e extends qO{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=aO(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
`){[e,t]=aO(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new JO(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof JO&&c&&(n=u[u.length-1])instanceof JO&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new JO(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}},qO.empty=new JO([``],0),XO=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof JO?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof JO?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof JO){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof JO?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},ZO=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new XO(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},QO=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}},typeof Symbol<`u`&&(qO.prototype[Symbol.iterator]=function(){return this.iter()},XO.prototype[Symbol.iterator]=ZO.prototype[Symbol.iterator]=QO.prototype[Symbol.iterator]=function(){return this}),$O=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}},ek=/\r\n?|\n/,tk=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(tk||(tk={})),nk=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){mO(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:gO(this,e)}mapDesc(e,t=!1){return e.empty?this:hO(this,e,t)}mapPos(e,t=-1,n=tk.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=tk.Simple&&c>=e&&(n==tk.TrackDel&&r<e&&c>e||n==tk.TrackBefore&&r<e||n==tk.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},rk=class e extends nk{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return mO(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return hO(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(qO.empty);r.push(a?t.slice(i,i+a):qO.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:gO(this,e,!0)}map(e,t=!1){return e.empty?this:hO(this,e,t,!0)}iterChanges(e,t=!1){mO(this,e,t)}get desc(){return nk.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new ik(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);fO(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;fO(n,e,t),t>0&&pO(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);fO(n,e,-1),fO(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:nk.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+Line truncated
`}get readOnly(){return this.facet(Ck)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(_k))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){return PO(this.languageDataAt(`wordChars`,e).join(``))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=oO(t,a,!1);if(i(t.slice(e,a))!=Ak.Word)break;a=e}for(;o<r;){let e=oO(t,o);if(i(t.slice(o,e))!=Ak.Word)break;o=e}return a==o?null:J.range(a+n,o+n)}},Nk.allowMultipleSelections=vk,Nk.tabSize=sk.define({combine:e=>e.length?e[0]:4}),Nk.lineSeparator=yk,Nk.readOnly=Ck,Nk.phrases=sk.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),Nk.languageData=_k,Nk.changeFilter=bk,Nk.transactionFilter=xk,Nk.transactionExtender=Sk,mk.reconfigure=Dk.define(),Pk=class{eq(e){return this==e}range(e,t=e){return Fk.create(e,t,this)}},Pk.prototype.startSide=Pk.prototype.endSide=0,Pk.prototype.point=!1,Pk.prototype.mapMode=tk.TrackDel,Fk=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}},Ik=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},Lk=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(IO)),this.isEmpty)return n.length?e.of(n):this;let s=new zk(this,null,-1).goto(0),c=0,l=[],u=new Rk;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(Fk.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Bk.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Bk.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=RO(a,o,n),c=new Vk(a,s,i),l=new Vk(o,s,i);n.iterGaps((e,t,n)=>BO(c,e,l,t,n,r)),n.empty&&n.length==0&&BO(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??(r=999999999);let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=RO(i,a),s=new Vk(i,o,0).goto(n),c=new Vk(a,o,0).goto(n);for(;;){if(s.to!=c.to||!VO(s.activeLine truncated
`)}static newName(){let e=Kk[Wk]||1;return Kk[Wk]=e+1,Uk+e.toString(36)}static mount(e,t,n){let r=e[Gk],i=n&&n.nonce;r?i&&r.setNonce(i):r=new Yk(e,i),r.mount(Array.isArray(t)?t:[t],e)}},Jk=new Map,Yk=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=Jk.get(n);if(t)return e[Gk]=t;this.sheet=new r.CSSStyleSheet,Jk.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[Gk]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}}}));function Zk(e){var t=!(eA&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||tA&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?$k:Qk)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var Qk,$k,eA,tA,nA,rA=o((()=>{for(Qk={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},$k={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},eA=typeof navigator<`u`&&/Mac/.test(navigator.platform),tA=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),nA=0;nA<10;nA++)Qk[48+nA]=Qk[96+nA]=String(nA);for(nA=1;nA<=24;nA++)Qk[nA+111]=`F`+nA;for(nA=65;nA<=90;nA++)Qk[nA]=String.fromCharCode(nA+32),$k[nA]=String.fromCharCode(nA);for(var e in Qk)$k.hasOwnProperty(e)||($k[e]=Qk[e])}));function iA(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)aA(e,arguments[t]);return e}function aA(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)aA(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var oA=o((()=>{}));function sA(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function cA(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function lA(e,t){if(!t.anchorNode)return!1;try{return cA(e,t.anchorNode)}catch{return!1}}function uA(e){return e.nodeType==3?SA(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function dA(e,t,n,r){return n?mA(e,t,n,r,-1)||mA(e,t,n,r,1):!1}function fA(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function pA(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function mA(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:hA(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=fA(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?hA(e):0}else return!1}}function hA(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function gA(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function _A(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function vA(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function yA(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=_A(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=vA(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0Line truncated
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function jj(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==Ak.Space&&(i=t),i==t}}function Mj(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return J.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||-1),u=e.documentTop;if(l)o??(o=l.left-c.left),s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from))),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=r??e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(f+t)*a,r=Cj(e,{x:d,y:n},!1,a);if(n<c.top||n>c.bottom||(a<0?r<i:r>i)){let t=e.docView.coordsForChar(r),i=!t||n<t.top?-1:1;return J.cursor(r,i,void 0,o)}}}function Nj(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function Pj(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=Nj(e,i.from,0);t!=i.from&&(a=J.cursor(t,-1))}else{let t=Nj(e,i.from,-1),n=Nj(e,i.to,1);(t!=i.from||n!=i.to)&&(a=J.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||(n=t.ranges.slice()),n[r]=a)}return n?J.create(n,t.mainIndex):t}function Fj(e,t,n){let r=Nj(e.state.facet(RP).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:J.cursor(r,r<n.from?1:-1)}function Ij(e,t,n){for(;;){if(!t||n<hA(t))return!1;if(t==e)return!0;n=fA(t)+1,t=t.parentNode}}function Lj(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=RN.get(e);if(!(t?.isWidget||e.cmIgnore))return!1;t&&(n||(n=[])).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}function Rj(e,t){let n,{newSel:r}=t,i=e.state.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:o}=t.bounds,s=i.from,c=null;(a===8||Y.android&&t.text.length<o-r)&&(s=i.to,c=`end`);let l=Vj(e.state.doc.sliceString(r,o,KP),t.text,s-r,c);l&&(Y.chrome&&a==13&&l.toB==l.from+2&&t.text.slice(l.from,l.toB)==KP+KP&&l.toB--,n={from:r+l.from,to:r+l.toA,insert:qO.of(t.text.slice(l.from,l.toB).split(KP))})}else r&&(!e.hasFocus&&e.state.facet(kP)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(Y.mac||Y.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=J.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:qO.of([n.insert.toString().replace(`.`,` `)])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:e.state.doc.lineAt(i.from).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:Y.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
`&&e.lineWrapping&&(r&&(r=J.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:qO.of([` `])}),n)return zj(e,n,r,a);if(r&&!r.main.eq(i)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=Pj(e.state.facet(RP).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function zj(e,t,n,r=-1){if(Y.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Y.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&CA(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&CA(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&CA(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||(o=Bj(e,t,n));return e.state.facet(yP).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Bj(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Nj(i.facet(RP).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:J.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&lj(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?J.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Vj(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function Hj(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new JP(n,r)),(i!=n||a!=r)&&t.push(new JP(i,a))),t}function Uj(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?J.single(n+t,r+t):null}function Wj(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){aj(n.state,e)}}}function Gj(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(Wj(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(Wj(t.value,r))}}for(let e in nF)n(e).handlers.push(nF[e]);for(let e in rF)n(e).observers.push(rF[e]);return t}function Kj(e){return Math.max(0,e)*.7+8}function qj(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}function Jj(e,t){let n=e.state.facet(mP);return n.length?n[0](t):Y.mac?t.metaKey:t.ctrlKey}function Yj(e,t){let n=e.state.facet(hP);return n.length?n[0](t):Y.mac?!t.altKey:!t.ctrlKey}function Xj(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=sA(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function Zj(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=RN.get(n))&&r.ignoreEvent(t))return!1;return!0}function Qj(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textaLine truncated
`))};if((Y.mac||Y.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:qO.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);zj(e,u,J.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(JN.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:OP.of(JN.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=sA(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},X=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequeLine truncated
--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩-]`,fI),mI={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},hI=null,gI=sk.define({combine(e){let t=FO(e,{render:null,specialChars:pI,addSpecialChars:null});return(t.replaceTabs=!qM())&&(t.specialChars=RegExp(` |`+t.specialChars.source,fI)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,fI)),t}}),_I=null,vI=`•`,yI=class extends KN{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=XM(this.code),n=e.state.phrase(`Control character`)+` `+(mI[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},bI=class extends KN{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}},xI=JN.line({class:`cm-activeLine`}),SI=MP.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(xI.range(i.from)),t=i.from)}return JN.set(n)}},{decorations:e=>e.decorations}),CI=class extends KN{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?uA(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=gA(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}},wI=2e3,TI={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},EI={style:`cursor: crosshair`},DI=`-10000px`,OI=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}},kI=sk.define({combine:e=>({position:Y.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||aN})}),AI=new WeakMap,jI=MP.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(kI);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new OI(e,PI,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.Line truncated
`)),r=qO.of(t.split(`
`)),i=UB.build(n,r),a=0,o=0;return{hunks:i.map(e=>{let t=[],i=e.fromA<e.toA,s=e.fromB<e.toB,c=[];if(i){let t=n.lineAt(e.fromA).number,r=n.lineAt(e.toA-1).number;for(let e=t;e<=r;e++)c.push({num:e,text:n.line(e).text})}let l=[];if(s){let t=r.lineAt(e.fromB).number,n=r.lineAt(e.toB-1).number;for(let e=t;e<=n;e++)l.push({num:e,text:r.line(e).text})}o+=c.length,a+=l.length;let u,d,f,p;if(i)u=c[0].num-1,d=c[c.length-1].num+1;else{let t=$B(n,e.fromA),r=n.lineAt(t);e.fromA===r.from?(u=r.number-1,d=r.number):(u=r.number,d=r.number+1)}if(s)f=l[0].num-1,p=l[l.length-1].num+1;else{let t=$B(r,e.fromB),n=r.lineAt(t);e.fromB===n.from?(f=n.number-1,p=n.number):(f=n.number,p=n.number+1)}let m=Math.min(QB,Math.max(0,u),Math.max(0,f));for(let e=m;e>0;e--){let r=u-e+1,i=f-e+1;r>=1&&i>=1&&r<=n.lines&&t.push({type:`context`,oldNum:r,newNum:i,text:n.line(r).text})}for(let e of c)t.push({type:`deletion`,oldNum:e.num,newNum:null,text:e.text});for(let e of l)t.push({type:`addition`,oldNum:null,newNum:e.num,text:e.text});let h=Math.max(0,Math.min(QB,n.lines-d+1)),g=Math.max(0,Math.min(QB,r.lines-p+1)),_=Math.min(h,g);for(let e=0;e<_;e++){let i=d+e,a=p+e;i>=1&&i<=n.lines&&a>=1&&a<=r.lines&&t.push({type:`context`,oldNum:i,newNum:a,text:n.line(i).text})}let v=t.find(e=>e.oldNum!==null)?.oldNum??1,y=t.find(e=>e.newNum!==null)?.newNum??1;return{oldStart:v,oldCount:t.filter(e=>e.type!==`addition`).length,newStart:y,newCount:t.filter(e=>e.type!==`deletion`).length,lines:t}}),additions:a,deletions:o}}var tV=5;function nV({additions:e,deletions:t}){let n=e+t;if(n===0)return null;let r=Math.round(e/n*tV);return(0,B.jsx)(`span`,{className:ZB.statBar,children:Array.from({length:tV},(e,t)=>(0,B.jsx)(`span`,{className:`${ZB.statBlock} ${t<r?ZB.statBlockAdd:ZB.statBlockDel}`},t))})}function rV({open:e,original:t,modified:n,onConfirm:r,onCancel:i,loading:a=!1}){let{t:o}=qo(),s=(0,y.useMemo)(()=>eV(t,n),[t,n]);return(0,B.jsx)(sm,{open:e,title:o(`config_management.diff.title`),onClose:i,width:`min(1200px, 90vw)`,className:ZB.diffModal,closeDisabled:a,footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(V,{variant:`secondary`,onClick:i,disabled:a,children:o(`common.cancel`)}),(0,B.jsx)(V,{onClick:r,loading:a,disabled:a,children:o(`config_management.diff.confirm`)})]}),children:(0,B.jsx)(`div`,{className:ZB.content,children:s.hunks.length===0?(0,B.jsx)(`div`,{className:ZB.emptyState,children:o(`config_management.diff.no_changes`)}):(0,B.jsxs)(`div`,{className:ZB.diffContainer,children:[(0,B.jsxs)(`div`,{className:ZB.fileHeader,children:[(0,B.jsx)(`svg`,{className:ZB.fileIcon,viewBox:`0 0 16 16`,width:`16`,height:`16`,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,d:`M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z`,fill:`currentColor`})}),(0,B.jsx)(`span`,{className:ZB.fileName,children:`config.yaml`}),(0,B.jsxs)(`span`,{className:ZB.fileStats,children:[(0,B.jsxs)(`span`,{className:ZB.statAdditions,children:[`+`,s.additions]}),(0,B.jsxs)(`span`,{className:ZB.statDeletions,children:[`-`,s.deletions]}),(0,B.jsx)(nV,{additions:s.additions,deletions:s.deletions})]})]}),(0,B.jsx)(`div`,{className:ZB.diffBody,children:s.hunks.map((e,t)=>(0,B.jsxs)(`div`,{className:ZB.hunk,children:[(0,B.jsxs)(`div`,{className:ZB.hunkHeader,children:[(0,B.jsx)(`span`,{className:ZB.hunkGutter,children:(0,B.jsx)(`svg`,{className:ZB.hunkExpandIcon,viewBox:`0 0 16 16`,width:`12`,height:`12`,children:(0,B.jsx)(`path`,{d:`M8.177 1.677l2.896 2.896a.25.25 0 01-.177.427H8.75v1.25a.75.75 0 01-1.5 0V5H5.104a.25.25 0 01-.177-.427l2.896-2.896a.25.25 0 01.354 0zM7.25 11.75a.75.75 0 011.5 0V13h2.146a.25.25 0 01.177.427l-2.896 2.896a.25.25 0 01-.354 0l-2.896-2.896A.25.25 0 015.104 13H7.25v-1.25z`,fill:`currentColor`})})}),(0,B.jsx)(`span`,{className:ZB.hunkGutter}),(0,B.jsxs)(`span`,{className:ZB.hunkText,children:[`@@ -`,e.oldStart,`,`,e.oldCount,` +`,e.newStart,`,`,e.newCount,` @@`]})]}),e.lines.map((e,n)=>(0,B.jsxs)(`div`,{className:`${ZB.diffLine} ${ZB[e.type]}`,children:[(0,B.jsx)(`span`,{className:`${ZB.lineNum} ${e.oldNum===null?ZB.lineNumEmpty:``}`,children:e.oldNum??``}),(0,B.jsx)(`span`,{className:`${ZB.lineNum} ${e.newNum===null?ZB.lineNumEmpty:``}`,children:e.newNum??``}),(0,B.jsx)(`span`,{className:ZB.linePrefix,children:e.type===`deletion`?`-`:e.type===`addition`?`+`:` `}),(0,B.jsx)(`code`,{className:ZB.lineText,children:e.text||` `})]},`${t}-${n}`))]},t))})]})})})}var iV={container:`ConfigPage-module__container___5kN-Y`,pageHeader:`ConfigPage-module__pageHeader___Zulyi`,pageHeaderCopy:`ConfigPage-module__pageHeaderCopy___fiTfJ`,pageTitle:`ConfigPage-module__pageTitle___BoVLE`,tabBar:`ConfigPage-module__tabBar___PelpE`,tabItem:`ConfigPage-module__tabItem___Uj1rU`,tabActive:`ConfigPage-module__tabActive___sZLh-Line truncated
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new EW(this):new TW(this)}getCursor(e,t=0,n){let r=e.doc?e:Nk.create({doc:e});return n??(n=r.doc.length),this.regexp?GU(this,r,t,n):UU(this,r,t,n)}},wW=class{constructor(e){this.spec=e}},TW=class extends wW{constructor(e){super(e)}nextMatch(e,t,n){let r=UU(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=UU(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=UU(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=UU(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=UU(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},EW=class extends wW{nextMatch(e,t,n){let r=GU(this.spec,e,n,e.doc.length).next();return r.done&&(r=GU(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=GU(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=GU(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=GU(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},DW=Dk.define(),OW=Dk.define(),kW=uk.define({create(e){return new AW(ZU(e).create(),null)},update(e,t){for(let n of t.effects)n.is(DW)?e=new AW(n.value.create(),e.panel):n.is(OW)&&(e=new AW(e.query,n.value?XU:null));return e},provide:e=>WI.from(e,e=>e.panel)}),AW=class{constructor(e,t){this.query=e,this.panel=t}},jW=JN.mark({class:`cm-searchMatch`}),MW=JN.mark({class:`cm-searchMatch cm-searchMatch-selected`}),NW=MP.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(kW))}update(e){let t=e.state.field(kW);(t!=e.startState.field(kW)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return JN.none;let{view:n}=this,r=new Rk;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?MW:jW)})}return r.finish()}},{decorations:e=>e.decorations}),PW=YU((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=J.single(r.from,r.to),a=e.state.facet(SW);return e.dispatch({selection:i,effects:[tW(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),$U(e),!0}),FW=YU((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=J.single(i.from,i.to),o=e.state.facet(SW);return e.dispatch({selection:a,effects:[tW(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),$U(e),!0}),IW=YU((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:J.create(n.map(e=>J.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),LW=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new rW(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(J.range(t.value.from,t.value.to))}return t(e.update({selection:J.create(a,o),userEvent:`select.search.matches`})),!0},RW=YU((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(X.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=J.single(o.from,o.to).map(d),u.push(tW(e,o)),u.push(n.facet(SW).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effectLine truncated
`);gx({filename:`logs.txt`,blob:new Blob([n],{type:`text/plain`})}),t(e(`logs.download_success`),`success`)},ie=async()=>{if(r!==`connected`){O(!1);return}O(!0),A(``);try{let e=await og.fetchErrorLogs();E(Array.isArray(e.files)?e.files:[])}catch(t){console.error(`Failed to load error logs:`,t),E([]);let n=iX(t);A(n?`${e(`logs.error_logs_load_error`)}: ${n}`:e(`logs.error_logs_load_error`))}finally{O(!1)}},ae=async n=>{try{let r=await og.downloadErrorLog(n);gx({filename:n,blob:new Blob([r.data],{type:`text/plain`})}),t(e(`logs.error_log_download_success`),`success`)}catch(n){let r=iX(n);t(`${e(`notification.download_failed`)}${r?`: ${r}`:``}`,`error`)}};(0,y.useEffect)(()=>{r===`connected`&&(R.current=0,ne(!1))},[r]),(0,y.useEffect)(()=>{a===`errors`&&r===`connected`&&ie()},[a,r,i]),(0,y.useEffect)(()=>{if(!p||r!==`connected`)return;let e=window.setInterval(()=>{ne(!0)},8e3);return()=>window.clearInterval(e)},[p,r]);let oe=(0,y.useMemo)(()=>s.buffer.slice(s.visibleFrom),[s.buffer,s.visibleFrom]),se=_.trim(),ce=se.length>0,le=ce?s.buffer:oe,ue=(0,y.useMemo)(()=>{let e=le;if(v&&(e=e.filter(e=>!e.includes($s))),se){let t=se.toLowerCase();e=e.filter(e=>e.toLowerCase().includes(t))}return e.map(e=>qY(e))},[le,v,se]),de=YY({parsedLines:ue}),fe=`logs-structured-filters`,pe=de.methodFilters.length+de.statusFilters.length+de.pathFilters.length,{filteredParsedLines:me,filteredLines:he,removedCount:ge}=(0,y.useMemo)(()=>{let e=ue.filter(e=>{if(de.methodFilterSet.size>0&&(!e.method||!de.methodFilterSet.has(e.method)))return!1;let t=OY(e.statusCode);return!(de.statusFilterSet.size>0&&(!t||!de.statusFilterSet.has(t))||de.pathFilterSet.size>0&&(!e.path||!de.pathFilterSet.has(e.path)))});return{filteredParsedLines:e,filteredLines:e.map(e=>e.raw),removedCount:Math.max(le.length-e.length,0)}},[le,de.methodFilterSet,de.pathFilterSet,de.statusFilterSet,ue]),_e=(0,y.useMemo)(()=>x?[]:me,[me,x]),ve=(0,y.useMemo)(()=>he.join(`
`),[he]),ye=$Y({logState:s,setLogState:c,loading:l,isSearching:ce,filteredLineCount:he.length,hasStructuredFilters:de.hasStructuredFilters,showRawLogs:x});ee.current=ye;let be=async n=>{await wv(n)?t(e(`logs.copy_success`,{defaultValue:`Copied to clipboard`}),`success`):t(e(`logs.copy_failed`,{defaultValue:`Copy failed`}),`error`)},xe=()=>{F.current?.timer&&(window.clearTimeout(F.current.timer),F.current.timer=null)},Se=(e,t)=>{i&&t&&(j||(xe(),F.current={timer:window.setTimeout(()=>{M(t),F.current&&(F.current.fired=!0,F.current.timer=null)},nX),startX:e.clientX,startY:e.clientY,fired:!1}))},Ce=()=>{xe(),F.current=null},we=e=>{let t=F.current;if(!t||t.timer===null||t.fired)return;let n=Math.abs(e.clientX-t.startX),r=Math.abs(e.clientY-t.startY);(n>rX||r>rX)&&Ce()},Te=()=>{N||M(null)},Ee=async n=>{P(!0);try{let r=await og.downloadRequestLogById(n);gx({filename:`request-${n}.log`,blob:new Blob([r.data],{type:`text/plain`})}),t(e(`logs.request_log_download_success`),`success`),M(null)}catch(n){let r=iX(n);t(`${e(`notification.download_failed`)}${r?`: ${r}`:``}`,`error`)}finally{P(!1)}};return(0,y.useEffect)(()=>()=>{F.current?.timer&&(window.clearTimeout(F.current.timer),F.current.timer=null)},[]),(0,B.jsxs)(`div`,{className:$.container,children:[(0,B.jsx)(`h1`,{className:$.pageTitle,children:e(`logs.title`)}),(0,B.jsxs)(`div`,{className:$.tabBar,children:[(0,B.jsx)(`button`,{type:`button`,className:`${$.tabItem} ${a===`logs`?$.tabActive:``}`,onClick:()=>o(`logs`),children:e(`logs.log_content`)}),(0,B.jsx)(`button`,{type:`button`,className:`${$.tabItem} ${a===`errors`?$.tabActive:``}`,onClick:()=>o(`errors`),children:e(`logs.error_logs_modal_title`)})]}),(0,B.jsxs)(`div`,{className:$.content,children:[a===`logs`&&(0,B.jsxs)(fg,{className:$.logCard,children:[d&&(0,B.jsx)(`div`,{className:`error-box`,children:d}),(0,B.jsxs)(`div`,{className:$.filters,children:[(0,B.jsx)(`div`,{className:$.searchWrapper,children:(0,B.jsx)(H,{value:h,onChange:e=>g(e.target.value),placeholder:e(`logs.search_placeholder`),className:$.searchInput,rightElement:h?(0,B.jsx)(`button`,{type:`button`,className:$.searchClear,onClick:()=>g(``),title:`Clear`,"aria-label":`Clear`,children:(0,B.jsx)(ps,{size:16})}):(0,B.jsx)(fs,{size:16,className:$.searchIcon})})}),(0,B.jsx)(`div`,{className:$.filterPanelHeader,children:(0,B.jsx)(V,{type:`button`,variant:`secondary`,size:`sm`,className:$.filterPanelToggle,onClick:()=>w(e=>!e),"aria-expanded":C,"aria-controls":fe,title:e(C?`logs.filter_panel_collapse`:`logs.filter_panel_expand`),children:(0,B.jsxs)(`span`,{className:$.filterPanelButtonContent,children:[(0,B.jsx)(Qo,{size:16}),(0,B.jsx)(`span`,{children:e(`logs.filter_panel_title`)}),pe>0&&(0,B.jsx)(`span`,{className:$.filterPanelCount,children:e(`logs.filter_panel_active_count`,{count:pe})}),C?(0,B.jsx)(ls,{size:16}):(0,B.jsx)(us,{size:16})]})})}),C&&(0,B.jsxs)(`div`,{id:fe,className:$.structuredFilters,children:[(0,B.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,B.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_method`)}),(0,B.jsx)(`div`,{className:$.filterChipList,children:EY.map(e=>{let t=de.methodFilters.includes(e),n=de.methodCounts[e]??0;return(0,B.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${t?$.filterChipActive:``}`,onClick:()=>de.toggleMethodFilter(e),disabled:n===0&&!t,"aria-pressed":t,children:[e,` (`,n,`)`]},e)})})]}),(0,B.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,B.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_status`)}),(0,B.jsx)(`div`,{className:$.filterChipList,children:DY.map(t=>{let n=de.statusFilters.includes(t),r=de.statusCounts[t]??0;return(0,B.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${n?$.filterChipActive:``}`,onClick:()=>de.toggleStatusFilter(t),disabled:r===0&&!n,"aria-pressed":n,children:[e(`logs.filter_status_${t}`),` (`,r,`)`]},t)})})]}),(0,B.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,B.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_path`)}),(0,B.jsx)(`div`,{className:$.filterChipList,children:de.pathOptions.length===0?(0,B.jsx)(`span`,{className:$.filterChipHint,children:e(`logs.filter_path_empty`)}):de.pathOptions.map(({path:e,count:t})=>{let n=de.pathFilters.includes(e);return(0,B.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${n?$.filterChipActive:``}`,onClick:()=>de.togglePathFilter(e),"aria-pressed":n,title:e,children:[e,` (`,t,`)`]},e)})})]}),(0,B.jsx)(V,{variant:`ghost`,size:`sm`,onClick:de.clearStructuredFilters,disabled:!de.hasStructuredFilters,children:e(`logs.clear_filters`)})]}),(0,B.jsx)(yg,{checked:v,onChange:b,label:(0,B.jsxs)(`span`,{className:$.switchLabel,children:[(0,B.jsx)(gs,{size:16}),e(`logs.hide_management_logs`,{prefix:`/v0/management`})]})}),(0,B.jsx)(yg,{checked:x,onChange:S,label:(0,B.jsxs)(`span`,{className:$.switchLabel,title:e(`logs.show_raw_logs_hint`,{defaultValue:`Show original log text for easier multi-line copy`}),children:[(0,B.jsx)(ws,{size:16}),e(`logs.shLine truncated
<style rel="stylesheet" crossorigin>*,:before,:after{box-sizing:border-box;margin:0;padding:0}html,body{width:100%;height:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;line-height:1.5}#root{width:100%;height:100%}button,input,textarea,select{font:inherit}a{color:inherit;text-decoration:none}ul,ol{list-style:none}:root{--bg-secondary:#faf9f5;--bg-primary:#f0eee8;--bg-tertiary:#e9e6df;--bg-hover:var(--bg-tertiary);--bg-quinary:#f6f4ee;--bg-error-light:#c657461a;--floating-surface:#fffdf9;--floating-border:#d8d3ca;--floating-shadow:0 12px 26px #00000024;--text-primary:#2d2a26;--text-secondary:#6d6760;--text-tertiary:#a29c95;--text-quaternary:#c0bab3;--text-muted:var(--text-tertiary);--border-color:#e3e1db;--border-secondary:var(--border-color);--border-primary:#d5d2cb;--border-hover:#cecac4;--primary-color:#8b8680;--primary-hover:#7f7a74;--primary-active:#726d67;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#e0aa14;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c657461f;--warning-border:#c6574659;--warning-text:var(--warning-color);--success-badge-bg:#d1fae5;--success-badge-text:#065f46;--success-badge-border:#6ee7b7;--failure-badge-bg:#c6574624;--failure-badge-text:#8a3a30;--failure-badge-border:#c6574659;--count-badge-bg:#8b86802e;--count-badge-text:var(--primary-active);--shadow:0 1px 2px 0 #00000014;--shadow-lg:0 10px 18px -3px #0000001a;--radius-md:8px;--accent-tertiary:var(--bg-tertiary);--glass-blur:12px;--glass-backdrop-filter:blur(var(--glass-blur));--glass-filter:blur(var(--glass-blur));--glass-bg:color-mix(in srgb, var(--bg-primary) 82%, transparent);--glass-bg-secondary:color-mix(in srgb, var(--bg-secondary) 82%, transparent);--glass-border:color-mix(in srgb, var(--border-color) 60%, transparent)}[data-theme=white]{--bg-secondary:#fff;--bg-primary:#fff;--bg-tertiary:#f6f6f6;--bg-hover:var(--bg-tertiary);--bg-quinary:#fff;--bg-error-light:#c6574614;--floating-surface:#fff;--floating-border:#d9d9d9;--floating-shadow:0 12px 26px #0000001f;--text-primary:#2d2a26;--text-secondary:#6d6760;--text-tertiary:#a29c95;--text-quaternary:#c0bab3;--text-muted:var(--text-tertiary);--border-color:#e5e5e5;--border-secondary:var(--border-color);--border-primary:#d9d9d9;--border-hover:#ccc;--primary-color:#8b8680;--primary-hover:#7f7a74;--primary-active:#726d67;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#e0aa14;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c657461f;--warning-border:#c6574659;--warning-text:var(--warning-color);--success-badge-bg:#d1fae5;--success-badge-text:#065f46;--success-badge-border:#6ee7b7;--failure-badge-bg:#c6574624;--failure-badge-text:#8a3a30;--failure-badge-border:#c6574659;--count-badge-bg:#8b86802e;--count-badge-text:var(--primary-active);--shadow:0 1px 2px 0 #00000014;--shadow-lg:0 10px 18px -3px #0000001a;--radius-md:8px;--accent-tertiary:var(--bg-tertiary)}[data-theme=dark]{--bg-secondary:#151412;--bg-primary:#1d1b18;--bg-tertiary:#262320;--bg-hover:#2e2a26;--bg-quinary:#191714;--bg-error-light:#c657462e;--floating-surface:#2a2723;--floating-border:#4a443d;--floating-shadow:0 14px 30px #0006;--text-primary:#f6f4f1;--text-secondary:#c9c3bb;--text-tertiary:#9c958d;--text-quaternary:#6f6962;--text-muted:var(--text-tertiary);--border-color:#3a3530;--border-secondary:var(--border-color);--border-primary:#4a453f;--border-hover:#5a544d;--primary-color:#8b8680;--primary-hover:#9a948e;--primary-active:#a6a099;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#ffd862;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c6574638;--warning-border:#c6574673;--warning-text:#f1b0a6;--success-badge-bg:#064e3b4d;--success-badge-text:#6ee7b7;--success-badge-border:#059669;--failure-badge-bg:#c657463d;--failure-badge-text:#f1b0a6;--failure-badge-border:#c6574680;--count-badge-bg:#8b868047;--count-badge-text:var(--primary-active);--shadow:0 1px 3px 0 #0000004d;--shadow-lg:0 10px 15px -3px #0000004d;--radius-md:8px;--accent-tertiary:var(--bg-tertiary);--glass-border:color-mix(in srgb, var(--border-color) 55%, transparent)}@media (max-width:768px),(prefers-reduced-motion:reduce),(prefers-reduced-transparency:reduce){:root{--glass-backdrop-filter:none;--glass-filter:none;--glass-bg:var(--bg-primary);--glass-bg-secondary:var(--bg-secondary);--glass-border:var(--border-color)}}.btn{cursor:pointer;background-color:var(--bg-secondary);color:var(--text-primary);border:1px solid #0000;border-radius:8px;justify-content:center;align-items:center;gap:8px;padding:10px 14px;font-weight:600;transition:all .15s;display:inline-flex}.btn.btn-primaLine truncated
`,e)+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;let t=rD(nD(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=rD(nD(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function oD(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new QE||null,prettyErrors:t}}function sD(e,t={}){let{lineCounter:n,prettyErrors:r}=oD(t),i=new aD(n?.addNewLine),a=new RE(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new eE(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(nE(e,n)),o.warnings.forEach(nE(e,n))),o}function cD(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=sD(e,n);if(!i)return null;if(i.warnings.forEach(e=>Nw(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var lD={section:`ConfigSection-module__section___36A5y`,header:`ConfigSection-module__header___9y9kI`,titleRow:`ConfigSection-module__titleRow___MDqPS`,indexBadge:`ConfigSection-module__indexBadge___BNk-6`,iconBadge:`ConfigSection-module__iconBadge___608--`,headingGroup:`ConfigSection-module__headingGroup___iqK3P`,title:`ConfigSection-module__title___fNwM-`,description:`ConfigSection-module__description___uM2Zw`,content:`ConfigSection-module__content___RBAGw`},uD=(0,y.forwardRef)(function({title:e,description:t,indexLabel:n,icon:r,className:i,children:a,...o},s){return(0,I.jsxs)(`section`,{ref:s,className:[lD.section,i].filter(Boolean).join(` `),...o,children:[(0,I.jsxs)(`header`,{className:lD.header,children:[(0,I.jsxs)(`div`,{className:lD.titleRow,children:[n?(0,I.jsx)(`span`,{className:lD.indexBadge,children:n}):null,r?(0,I.jsx)(`span`,{className:lD.iconBadge,children:r}):null]}),(0,I.jsxs)(`div`,{className:lD.headingGroup,children:[(0,I.jsx)(`h2`,{className:lD.title,children:e}),t?(0,I.jsx)(`p`,{className:lD.description,children:t}):null]})]}),(0,I.jsx)(`div`,{className:lD.content,children:a})]})});function dD(e){let[t,n]=(0,y.useState)(()=>window.matchMedia(e).matches);return(0,y.useEffect)(()=>{let t=window.matchMedia(e),r=e=>{n(e.matches)};return r({matches:t.matches}),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var K={visualEditor:`VisualConfigEditor-module__visualEditor___qt8bb`,expandableInputWrapper:`VisualConfigEditor-module__expandableInputWrapper___k5rpc`,expandableTextarea:`VisualConfigEditor-module__expandableTextarea___OVvmN`,expandableToggle:`VisualConfigEditor-module__expandableToggle___M5mBU`,expandableInputExpanded:`VisualConfigEditor-module__expandableInputExpanded___9zfyv`,overview:`VisualConfigEditor-module__overview___OzHQc`,overviewHeader:`VisualConfigEditor-module__overviewHeader___A8kWa`,overviewMeta:`VisualConfigEditor-module__overviewMeta___SM8ZF`,overviewPill:`VisualConfigEditor-module__overviewPill___eXq54`,overviewPillWarning:`VisualConfigEditor-module__overviewPillWarning___ruscj`,workspace:`VisualConfigEditor-module__workspace___gqLDP`,mobileSectionNav:`VisualConfigEditor-module__mobileSectionNav___d-TWK`,mobileSectionNavScroller:`VisualConfigEditor-module__mobileSectionNavScroller___VGXz-`,mobileSectionNavButton:`VisualConfigEditor-module__mobileSectionNavButton___mR9BT`,mobileSectionNavButtonActive:`VisualConfigEditor-module__mobileSectionNavButtonActive___ug6e6`,mobileSectionNavIndex:`VisualConfigEditor-module__mobileSectionNavIndex___eVeF8`,mobileSectionNavLabel:`VisualConfigEditor-module__mobileSectionLine truncated
`)}function _D(e){if(Object.prototype.hasOwnProperty.call(e,`api-keys`))return gD(e[`api-keys`]);let t=mD(mD(mD(e.auth)?.providers)?.[`config-api-key`]);return t?Object.prototype.hasOwnProperty.call(t,`api-key-entries`)?gD(t[`api-key-entries`]):gD(t[`api-keys`]):``}function vD(e,t){return e.hasIn(t)}function yD(e,t){DC(e.getIn(t,!0))||e.setIn(t,e.createNode({}))}function bD(e,t){let n=e.getIn(t,!0);DC(n)&&n.items.length===0&&e.deleteIn(t)}function xD(e,t,n){if(n){e.setIn(t,!0);return}vD(e,t)&&e.setIn(t,!1)}function SD(e,t,n,r){return vD(e,t)||n.has(r)}function CD(e,t,n){let r=typeof n==`string`?n:``;if(r.trim()!==``){e.setIn(t,r);return}vD(e,t)&&e.setIn(t,``)}function wD(e,t,n){let r=(typeof n==`string`?n:``).trim();if(r===``){vD(e,t)&&e.deleteIn(t);return}if(!/^-?\d+$/.test(r))return;let i=Number(r);if(Number.isFinite(i)){e.setIn(t,i);return}}function TD(e,t,n){if(n===`chat`){e.setIn(t,`chat`);return}if(n===`true`){e.setIn(t,!0);return}vD(e,t)&&e.setIn(t,!1)}function ED(e){let t=e.trim();if(t)return/^-?\d+$/.test(t)&&Number(t)>=0?void 0:`non_negative_integer`}function DD(e){let t=e.trim();if(!t)return;if(!/^\d+$/.test(t))return`port_range`;let n=Number(t);return n>=1&&n<=65535?void 0:`port_range`}function OD(e){return{port:DD(e.port),errorLogsMaxFiles:ED(e.errorLogsMaxFiles),logsMaxTotalSizeMb:ED(e.logsMaxTotalSizeMb),redisUsageQueueRetentionSeconds:ED(e.redisUsageQueueRetentionSeconds),requestRetry:ED(e.requestRetry),maxRetryCredentials:ED(e.maxRetryCredentials),maxRetryInterval:ED(e.maxRetryInterval),authAutoRefreshWorkers:ED(e.authAutoRefreshWorkers),"streaming.keepaliveSeconds":ED(e.streaming.keepaliveSeconds),"streaming.bootstrapRetries":ED(e.streaming.bootstrapRetries),"streaming.nonstreamKeepaliveInterval":ED(e.streaming.nonstreamKeepaliveInterval)}}function kD(e){let t=e.value.trim();switch(e.valueType){case`number`:{if(!t)return`payload_invalid_number`;let e=Number(t);return Number.isFinite(e)?void 0:`payload_invalid_number`}case`boolean`:{let e=t.toLowerCase();return e===`true`||e===`false`?void 0:`payload_invalid_boolean`}case`json`:if(!t)return`payload_invalid_json`;try{JSON.parse(e.value);return}catch{return`payload_invalid_json`}default:return}}function AD(e){return e.some(e=>e.params.some(e=>!!kD(e))||e.models.some(e=>(e.match??[]).some(e=>!!kD(e))||(e.notMatch??[]).some(e=>!!kD(e))))}function jD(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function MD(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||r.name!==i.name||r.protocol!==i.protocol||r.fromProtocol!==i.fromProtocol||!PD(r.headers,i.headers)||!ND(r.match??[],i.match??[])||!ND(r.notMatch??[],i.notMatch??[])||!FD(r.exist,i.exist)||!FD(r.notExist,i.notExist))return!1}return!0}function ND(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||r.path!==i.path||r.valueType!==i.valueType||r.value!==i.value)return!1}return!0}function PD(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1){let t=n[e],i=r[e];if(!t||!i||t.id!==i.id||t.name!==i.name||t.value!==i.value)return!1}return!0}function FD(e,t){let n=e??[],r=t??[];if(n===r)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e+=1)if(n[e]!==r[e])return!1;return!0}function ID(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||!MD(r.models,i.models)||!ND(r.params,i.params))return!1}return!0}function LD(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.id!==i.id||!MD(r.models,i.models)||r.params.length!==i.params.length)return!1;for(let e=0;e<r.params.length;e+=1)if(r.params[e]!==i.params[e])return!1}return!0}function RD(e){if(typeof e==`number`)return{valueType:`number`,value:String(e)};if(typeof e==`boolean`)return{valueType:`boolean`,value:String(e)};if(e===null||typeof e==`object`)try{return{valueType:`json`,value:JSON.stringify(e,null,2)??`null`}}catch{return{valueType:`json`,value:String(e)}}return{valueType:`string`,value:String(e??``)}}function zD(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??``}catch{return String(e??``)}}function BD(e){if(typeof e==`string`)return e.trim()?e:void 0}function VD(e){if(e===!0)return`true`;if(typeof e==`string`){let t=e.trim().toLowerCase();if(t===`true`)return`true`;if(t===`chat`)return`chat`}return`false`}function HD(e,t){let n=mD(e);return n?Object.entries(n).map(([e,n],r)=>({id:`${t}-header-${r}`,name:e,value:String(n??``)})):[]}function UD(e,t){if(!Array.isArray(e))return[];let n=[];return e.forEach((e,r)=>{let i=mD(e);if(!i){typeof e==`string`&&n.push({id:`${t}-condition-${r}-0`,path:e,valueType:`string`,value:``});return}Object.entries(i).forEach(([e,i],a)=>{let o=RD(i);n.push({id:`${t}-condition-${r}-${a}`,path:e,valueType:o.valLine truncated
`).map(e=>e.trim()).filter(Boolean);if(a.length>0?t.setIn([`api-keys`],a):vD(t,[`api-keys`])&&t.deleteIn([`api-keys`]),GD(t),xD(t,[`debug`],r.debug),xD(t,[`commercial-mode`],r.commercialMode),xD(t,[`logging-to-file`],r.loggingToFile),wD(t,[`logs-max-total-size-mb`],r.logsMaxTotalSizeMb),wD(t,[`error-logs-max-files`],r.errorLogsMaxFiles),xD(t,[`usage-statistics-enabled`],r.usageStatisticsEnabled),wD(t,[`redis-usage-queue-retention-seconds`],r.redisUsageQueueRetentionSeconds),CD(t,[`proxy-url`],r.proxyUrl),xD(t,[`force-model-prefix`],r.forceModelPrefix),xD(t,[`passthrough-headers`],r.passthroughHeaders),wD(t,[`request-retry`],r.requestRetry),wD(t,[`max-retry-credentials`],r.maxRetryCredentials),wD(t,[`max-retry-interval`],r.maxRetryInterval),xD(t,[`disable-cooling`],r.disableCooling),TD(t,[`disable-image-generation`],r.disableImageGeneration),wD(t,[`auth-auto-refresh-workers`],r.authAutoRefreshWorkers),xD(t,[`ws-auth`],r.wsAuth),xD(t,[`enable-gemini-cli-endpoint`],r.enableGeminiCliEndpoint),(vD(t,[`antigravity-signature-cache-enabled`])||!r.antigravitySignatureCacheEnabled)&&t.setIn([`antigravity-signature-cache-enabled`],r.antigravitySignatureCacheEnabled),xD(t,[`antigravity-signature-bypass-strict`],r.antigravitySignatureBypassStrict),(vD(t,[`claude-header-defaults`])||r.claudeHeaderUserAgent.trim()||r.claudeHeaderPackageVersion.trim()||r.claudeHeaderRuntimeVersion.trim()||r.claudeHeaderOs.trim()||r.claudeHeaderArch.trim()||r.claudeHeaderTimeout.trim()||r.claudeHeaderStabilizeDeviceProfile)&&(yD(t,[`claude-header-defaults`]),CD(t,[`claude-header-defaults`,`user-agent`],r.claudeHeaderUserAgent),CD(t,[`claude-header-defaults`,`package-version`],r.claudeHeaderPackageVersion),CD(t,[`claude-header-defaults`,`runtime-version`],r.claudeHeaderRuntimeVersion),CD(t,[`claude-header-defaults`,`os`],r.claudeHeaderOs),CD(t,[`claude-header-defaults`,`arch`],r.claudeHeaderArch),CD(t,[`claude-header-defaults`,`timeout`],r.claudeHeaderTimeout),xD(t,[`claude-header-defaults`,`stabilize-device-profile`],r.claudeHeaderStabilizeDeviceProfile),bD(t,[`claude-header-defaults`])),(vD(t,[`codex-header-defaults`])||r.codexHeaderUserAgent.trim()||r.codexHeaderBetaFeatures.trim())&&(yD(t,[`codex-header-defaults`]),CD(t,[`codex-header-defaults`,`user-agent`],r.codexHeaderUserAgent),CD(t,[`codex-header-defaults`,`beta-features`],r.codexHeaderBetaFeatures),bD(t,[`codex-header-defaults`])),vD(t,[`quota-exceeded`])||!r.quotaSwitchProject||!r.quotaSwitchPreviewModel||SD(t,[`quota-exceeded`,`antigravity-credits`],i,`quotaAntigravityCredits`)){yD(t,[`quota-exceeded`]);let e=SD(t,[`quota-exceeded`,`antigravity-credits`],i,`quotaAntigravityCredits`);t.setIn([`quota-exceeded`,`switch-project`],r.quotaSwitchProject),t.setIn([`quota-exceeded`,`switch-preview-model`],r.quotaSwitchPreviewModel),e&&t.setIn([`quota-exceeded`,`antigravity-credits`],r.quotaAntigravityCredits),bD(t,[`quota-exceeded`])}(vD(t,[`routing`])||r.routingStrategy!==`round-robin`||r.routingSessionAffinity||r.routingSessionAffinityTTL.trim())&&(yD(t,[`routing`]),t.setIn([`routing`,`strategy`],r.routingStrategy),xD(t,[`routing`,`session-affinity`],r.routingSessionAffinity),CD(t,[`routing`,`session-affinity-ttl`],r.routingSessionAffinityTTL),bD(t,[`routing`]));let o=typeof r.streaming?.keepaliveSeconds==`string`?r.streaming.keepaliveSeconds:``,s=typeof r.streaming?.bootstrapRetries==`string`?r.streaming.bootstrapRetries:``,c=typeof r.streaming?.nonstreamKeepaliveInterval==`string`?r.streaming.nonstreamKeepaliveInterval:``;return(vD(t,[`streaming`])||o.trim()||s.trim())&&(yD(t,[`streaming`]),wD(t,[`streaming`,`keepalive-seconds`],o),wD(t,[`streaming`,`bootstrap-retries`],s),bD(t,[`streaming`])),wD(t,[`nonstream-keepalive-interval`],c),(vD(t,[`payload`])||r.payloadDefaultRules.length>0||r.payloadDefaultRawRules.length>0||r.payloadOverrideRules.length>0||r.payloadOverrideRawRules.length>0||r.payloadFilterRules.length>0)&&(yD(t,[`payload`]),r.payloadDefaultRules.length>0?t.setIn([`payload`,`default`],tO(r.payloadDefaultRules)):vD(t,[`payload`,`default`])&&t.deleteIn([`payload`,`default`]),r.payloadDefaultRawRules.length>0?t.setIn([`payload`,`default-raw`],rO(r.payloadDefaultRawRules)):vD(t,[`payload`,`default-raw`])&&t.deleteIn([`payload`,`default-raw`]),r.payloadOverrideRules.length>0?t.setIn([`payload`,`override`],tO(r.payloadOverrideRules)):vD(t,[`payload`,`override`])&&t.deleteIn([`payload`,`override`]),r.payloadOverrideRawRules.length>0?t.setIn([`payload`,`override-raw`],rO(r.payloadOverrideRawRules)):vD(t,[`payload`,`override-raw`])&&t.deleteIn([`payload`,`override-raw`]),r.payloadFilterRules.length>0?t.setIn([`payload`,`filter`],nO(r.payloadFilterRules)):vD(t,[`payload`,`filter`])&&t.deleteIn([`payload`,`filter`]),bD(t,[`payload`])),t.toString({indent:2,lineWidth:120,minContentWidth:0})}catch{return e}},[i,n]),setVisualValues:(0,y.useCallback)(e=>{t({type:`set_values`,values:e})},[])}}var lO=[{value:``,labelKey:`config_management.visual.payload_rules.provider_default`,defaultLabelLine truncated
`).map(e=>e.trim()).filter(Boolean),[e]),[o,s]=(0,y.useState)(()=>a.map(()=>fD())),c=(0,y.useMemo)(()=>o.length===a.length?o:o.length>a.length?o.slice(0,a.length):[...o,...Array.from({length:a.length-o.length},()=>fD())],[o,a.length]),l=(0,y.useId)(),u=`${l}-hint`,d=`${l}-error`,[f,p]=(0,y.useState)(!1),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(``),[v,b]=(0,y.useState)(``);function x(){let e=new Uint8Array(17);return crypto.getRandomValues(e),`sk-`+Array.from(e,e=>`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[e%62]).join(``)}let S=()=>{h(null),_(``),b(``),p(!0)},C=e=>{let t=c.findIndex(t=>t===e);h(e),_(a[t]??``),b(``),p(!0)},w=()=>{p(!1),_(``),h(null),b(``)},T=e=>{n(e.join(`
`))},E=e=>{let t=c.findIndex(t=>t===e);t<0||(s(c.filter(t=>t!==e)),T(a.filter((e,n)=>n!==t)))},D=()=>{let e=g.trim();if(!e){b(r(`config_management.visual.api_keys.error_empty`));return}if(!dO(e)){b(r(`config_management.visual.api_keys.error_invalid`));return}let t=m?c.findIndex(e=>e===m):-1,n=m===null?[...a,e]:a.map((n,r)=>r===t?e:n);m===null&&s([...c,fD()]),T(n),w()},O=async e=>{let t=await Vv(e);i(r(t?`notification.link_copied`:`notification.copy_failed`),t?`success`:`error`)};return(0,I.jsxs)(`div`,{className:`form-group`,style:{marginBottom:0},children:[(0,I.jsxs)(`div`,{className:K.blockHeaderRow,children:[(0,I.jsx)(`label`,{style:{margin:0},children:r(`config_management.visual.api_keys.label`)}),(0,I.jsx)(L,{size:`sm`,onClick:S,disabled:t,children:r(`config_management.visual.api_keys.add`)})]}),a.length===0?(0,I.jsx)(`div`,{className:K.emptyState,children:r(`config_management.visual.api_keys.empty`)}):(0,I.jsx)(`div`,{className:`item-list`,style:{marginTop:4},children:a.map((e,n)=>(0,I.jsxs)(`div`,{className:`item-row`,children:[(0,I.jsxs)(`div`,{className:`item-meta`,children:[(0,I.jsxs)(`div`,{className:`pill`,children:[`#`,n+1]}),(0,I.jsx)(`div`,{className:`item-title`,children:r(`config_management.visual.api_keys.input_label`)}),(0,I.jsx)(`div`,{className:`item-subtitle`,children:pv(String(e||``))})]}),(0,I.jsxs)(`div`,{className:`item-actions`,children:[(0,I.jsx)(L,{variant:`secondary`,size:`sm`,onClick:()=>O(e),disabled:t,children:r(`common.copy`)}),(0,I.jsx)(L,{variant:`secondary`,size:`sm`,onClick:()=>C(c[n]??``),disabled:t,children:r(`config_management.visual.common.edit`)}),(0,I.jsx)(L,{variant:`danger`,size:`sm`,onClick:()=>E(c[n]??``),disabled:t,children:r(`config_management.visual.common.delete`)})]})]},c[n]??`${e}-${n}`))}),(0,I.jsx)(`div`,{className:`hint`,children:r(`config_management.visual.api_keys.hint`)}),(0,I.jsx)(Cp,{open:f,onClose:w,title:r(m===null?`config_management.visual.api_keys.add_title`:`config_management.visual.api_keys.edit_title`),footer:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(L,{variant:`secondary`,onClick:w,disabled:t,children:r(`config_management.visual.common.cancel`)}),(0,I.jsx)(L,{onClick:D,disabled:t,children:r(m===null?`config_management.visual.common.add`:`config_management.visual.common.update`)})]}),children:(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsx)(`label`,{htmlFor:l,children:r(`config_management.visual.api_keys.input_label`)}),(0,I.jsxs)(`div`,{className:K.apiKeyModalInputRow,children:[(0,I.jsx)(`input`,{id:l,className:`input`,placeholder:r(`config_management.visual.api_keys.input_placeholder`),value:g,onChange:e=>_(e.target.value),disabled:t,"aria-describedby":v?`${d} ${u}`:u,"aria-invalid":!!v}),(0,I.jsx)(L,{type:`button`,variant:`secondary`,size:`sm`,onClick:()=>{_(x()),b(``)},disabled:t,children:r(`config_management.visual.api_keys.generate`)})]}),(0,I.jsx)(`div`,{id:u,className:`hint`,children:r(`config_management.visual.api_keys.input_hint`)}),v&&(0,I.jsx)(`div`,{id:d,className:`error-box`,children:v})]})})]})}),_O=(0,y.memo)(function({value:e,disabled:t,placeholder:n,inputAriaLabel:r,onChange:i}){let{t:a}=qo(),o=e.length?e:[],[s,c]=(0,y.useState)(()=>o.map(()=>fD())),l=(0,y.useMemo)(()=>s.length===o.length?s:s.length>o.length?s.slice(0,o.length):[...s,...Array.from({length:o.length-s.length},()=>fD())],[s,o.length]),u=(e,t)=>i(o.map((n,r)=>r===e?t:n)),d=()=>{c([...l,fD()]),i([...o,``])},f=e=>{c(l.filter((t,n)=>n!==e)),i(o.filter((t,n)=>n!==e))};return(0,I.jsxs)(`div`,{className:K.stringList,children:[o.map((e,i)=>(0,I.jsxs)(`div`,{className:K.stringListRow,children:[(0,I.jsx)(pO,{placeholder:n,ariaLabel:r??n,value:e,onChange:e=>u(i,e),disabled:t}),(0,I.jsx)(L,{variant:`ghost`,size:`sm`,onClick:()=>f(i),disabled:t,children:a(`config_management.visual.common.delete`)})]},l[i]??`item-${i}`)),(0,I.jsx)(`div`,{className:K.actionRow,children:(0,I.jsx)(L,{variant:`secondary`,size:`sm`,onClick:d,disabled:t,children:a(`config_management.visual.common.add`)})})]})});function vO(e){return!!(e.fromProtocol||(e.headers?.length??0)>0||(e.match?.length??0)>0||(e.notMatch?.length??0)>0||(e.exist?.length??0)>0||(e.notExist?.length??0)>0)}var yO=(0,y.memo)(function({value:e,disabled:t,protocolFirst:n=!1,rawJsonValues:r=!1,onChange:i}){let{t:a}=qo(),o=e,s=(0,y.useMemo)(()=>hO(a,o),[o,a]),c=(0,y.useMemo)(()=>[{value:``,label:a(`config_management.visual.payload_rules.provider_default`)},{value:`openai`,label:a(`config_management.visual.payload_rules.provider_openai`)},{value:`responses`,label:a(`config_management.visual.payload_rules.provider_responses`)},{value:`gemini`,label:a(`config_management.visual.payload_rules.provider_gemini`)},{value:`claude`,label:a(`config_management.visual.payload_rules.provider_claude`)}],[a]),l=(0,y.useMemo)(()=>uO.map(e=>({value:e.value,label:a(e.labelKey,{defaultValue:e.defaultLabel})})),[a]),u=(0,y.useMemo)(()=>[{value:`true`,label:a(`config_management.visual.payload_rules.boolean_true`)},{value:`false`,label:a(Line truncated
`){[e,t]=GO(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},Fk=class e extends Nk{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=GO(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
`){[e,t]=GO(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new Pk(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof Pk&&c&&(n=u[u.length-1])instanceof Pk&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new Pk(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}},Nk.empty=new Pk([``],0),Ik=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof Pk?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof Pk?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof Pk){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof Pk?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Lk=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new Ik(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},Rk=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}},typeof Symbol<`u`&&(Nk.prototype[Symbol.iterator]=function(){return this.iter()},Ik.prototype[Symbol.iterator]=Lk.prototype[Symbol.iterator]=Rk.prototype[Symbol.iterator]=function(){return this}),zk=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}},Bk=/\r\n?|\n/,Vk=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(Vk||(Vk={})),Hk=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){ek(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:nk(this,e)}mapDesc(e,t=!1){return e.empty?this:tk(this,e,t)}mapPos(e,t=-1,n=Vk.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=Vk.Simple&&c>=e&&(n==Vk.TrackDel&&r<e&&c>e||n==Vk.TrackBefore&&r<e||n==Vk.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},Uk=class e extends Hk{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return ek(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return tk(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(Nk.empty);r.push(a?t.slice(i,i+a):Nk.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:nk(this,e,!0)}map(e,t=!1){return e.empty?this:tk(this,e,t,!0)}iterChanges(e,t=!1){ek(this,e,t)}get desc(){return Hk.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new Wk(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);QO(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;QO(n,e,t),t>0&&$O(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);QO(n,e,-1),QO(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:Hk.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+Line truncated
`}get readOnly(){return this.facet(cA)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(nA))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){return bk(this.languageDataAt(`wordChars`,e).join(``))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=KO(t,a,!1);if(i(t.slice(e,a))!=hA.Word)break;a=e}for(;o<r;){let e=KO(t,o);if(i(t.slice(o,e))!=hA.Word)break;o=e}return a==o?null:q.range(a+n,o+n)}},vA.allowMultipleSelections=rA,vA.tabSize=J.define({combine:e=>e.length?e[0]:4}),vA.lineSeparator=iA,vA.readOnly=cA,vA.phrases=J.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),vA.languageData=nA,vA.changeFilter=aA,vA.transactionFilter=oA,vA.transactionExtender=sA,$k.reconfigure=fA.define(),yA=class{eq(e){return this==e}range(e,t=e){return bA.create(e,t,this)}},yA.prototype.startSide=yA.prototype.endSide=0,yA.prototype.point=!1,yA.prototype.mapMode=Vk.TrackDel,bA=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}},xA=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},SA=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(Sk)),this.isEmpty)return n.length?e.of(n):this;let s=new wA(this,null,-1).goto(0),c=0,l=[],u=new CA;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(bA.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return TA.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return TA.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=wk(a,o,n),c=new EA(a,s,i),l=new EA(o,s,i);n.iterGaps((e,t,n)=>Ek(c,e,l,t,n,r)),n.empty&&n.length==0&&Ek(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??(r=999999999);let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=wk(i,a),s=new EA(i,o,0).goto(n),c=new EA(a,o,0).goto(n);for(;;){if(s.to!=c.to||!Dk(s.active,cLine truncated
`)}static newName(){let e=jA[kA]||1;return jA[kA]=e+1,OA+e.toString(36)}static mount(e,t,n){let r=e[AA],i=n&&n.nonce;r?i&&r.setNonce(i):r=new PA(e,i),r.mount(Array.isArray(t)?t:[t],e)}},NA=new Map,PA=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=NA.get(n);if(t)return e[AA]=t;this.sheet=new r.CSSStyleSheet,NA.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[AA]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}}}));function IA(e){var t=!(zA&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||BA&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?RA:LA)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var LA,RA,zA,BA,VA,HA=o((()=>{for(LA={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},RA={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},zA=typeof navigator<`u`&&/Mac/.test(navigator.platform),BA=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),VA=0;VA<10;VA++)LA[48+VA]=LA[96+VA]=String(VA);for(VA=1;VA<=24;VA++)LA[VA+111]=`F`+VA;for(VA=65;VA<=90;VA++)LA[VA]=String.fromCharCode(VA+32),RA[VA]=String.fromCharCode(VA);for(var e in LA)RA.hasOwnProperty(e)||(RA[e]=LA[e])}));function UA(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)WA(e,arguments[t]);return e}function WA(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)WA(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var GA=o((()=>{}));function KA(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function qA(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function JA(e,t){if(!t.anchorNode)return!1;try{return qA(e,t.anchorNode)}catch{return!1}}function YA(e){return e.nodeType==3?sj(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function XA(e,t,n,r){return n?$A(e,t,n,r,-1)||$A(e,t,n,r,1):!1}function ZA(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function QA(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function $A(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ej(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=ZA(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?ej(e):0}else return!1}}function ej(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function tj(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function nj(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function rj(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function ij(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=nj(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=rj(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0Line truncated
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function gM(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==hA.Space&&(i=t),i==t}}function _M(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return q.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||-1),u=e.documentTop;if(l)o??(o=l.left-c.left),s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??(o=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from))),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=r??e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(f+t)*a,r=cM(e,{x:d,y:n},!1,a);if(n<c.top||n>c.bottom||(a<0?r<i:r>i)){let t=e.docView.coordsForChar(r),i=!t||n<t.top?-1:1;return q.cursor(r,i,void 0,o)}}}function vM(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function yM(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=vM(e,i.from,0);t!=i.from&&(a=q.cursor(t,-1))}else{let t=vM(e,i.from,-1),n=vM(e,i.to,1);(t!=i.from||n!=i.to)&&(a=q.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||(n=t.ranges.slice()),n[r]=a)}return n?q.create(n,t.mainIndex):t}function bM(e,t,n){let r=vM(e.state.facet(CF).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:q.cursor(r,r<n.from?1:-1)}function xM(e,t,n){for(;;){if(!t||n<ej(t))return!1;if(t==e)return!0;n=ZA(t)+1,t=t.parentNode}}function SM(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=CP.get(e);if(!(t?.isWidget||e.cmIgnore))return!1;t&&(n||(n=[])).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}function CM(e,t){let n,{newSel:r}=t,i=e.state.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:o}=t.bounds,s=i.from,c=null;(a===8||Y.android&&t.text.length<o-r)&&(s=i.to,c=`end`);let l=EM(e.state.doc.sliceString(r,o,jF),t.text,s-r,c);l&&(Y.chrome&&a==13&&l.toB==l.from+2&&t.text.slice(l.from,l.toB)==jF+jF&&l.toB--,n={from:r+l.from,to:r+l.toA,insert:Nk.of(t.text.slice(l.from,l.toB).split(jF))})}else r&&(!e.hasFocus&&e.state.facet(mF)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(Y.mac||Y.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=q.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Nk.of([n.insert.toString().replace(`.`,` `)])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:e.state.doc.lineAt(i.from).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:Y.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
`&&e.lineWrapping&&(r&&(r=q.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Nk.of([` `])}),n)return wM(e,n,r,a);if(r&&!r.main.eq(i)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=yM(e.state.facet(CF).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function wM(e,t,n,r=-1){if(Y.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Y.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&cj(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&cj(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&cj(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||(o=TM(e,t,n));return e.state.facet(iF).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function TM(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=vM(i.facet(CF).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:q.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&Jj(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?q.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function EM(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function DM(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new NF(n,r)),(i!=n||a!=r)&&t.push(new NF(i,a))),t}function OM(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?q.single(n+t,r+t):null}function kM(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){Wj(n.state,e)}}}function AM(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(kM(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(kM(t.value,r))}}for(let e in VF)n(e).handlers.push(VF[e]);for(let e in HF)n(e).observers.push(HF[e]);return t}function jM(e){return Math.max(0,e)*.7+8}function MM(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}function NM(e,t){let n=e.state.facet($P);return n.length?n[0](t):Y.mac?t.metaKey:t.ctrlKey}function PM(e,t){let n=e.state.facet(eF);return n.length?n[0](t):Y.mac?!t.altKey:!t.ctrlKey}function FM(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=KA(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function IM(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=CP.get(n))&&r.ignoreEvent(t))return!1;return!0}function LM(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textaLine truncated
`))};if((Y.mac||Y.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:Nk.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);wM(e,u,q.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(NP.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:pF.of(NP.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=KA(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},X=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequeLine truncated
--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩-]`,ZI),$I={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},eL=null,tL=J.define({combine(e){let t=xk(e,{render:null,specialChars:QI,addSpecialChars:null});return(t.replaceTabs=!MN())&&(t.specialChars=RegExp(` |`+t.specialChars.source,ZI)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,ZI)),t}}),nL=null,rL=`•`,iL=class extends jP{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=FN(this.code),n=e.state.phrase(`Control character`)+` `+($I[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},aL=class extends jP{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}},oL=NP.line({class:`cm-activeLine`}),sL=_F.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(oL.range(i.from)),t=i.from)}return NP.set(n)}},{decorations:e=>e.decorations}),cL=class extends jP{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?YA(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=tj(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}},lL=2e3,uL={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},dL={style:`cursor: crosshair`},fL=`-10000px`,pL=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}},mL=J.define({combine:e=>({position:Y.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||WN})}),hL=new WeakMap,gL=_F.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(mL);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new pL(e,yL,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.apLine truncated
`)),r=Nk.of(t.split(`
`)),i=OV.build(n,r),a=0,o=0;return{hunks:i.map(e=>{let t=[],i=e.fromA<e.toA,s=e.fromB<e.toB,c=[];if(i){let t=n.lineAt(e.fromA).number,r=n.lineAt(e.toA-1).number;for(let e=t;e<=r;e++)c.push({num:e,text:n.line(e).text})}let l=[];if(s){let t=r.lineAt(e.fromB).number,n=r.lineAt(e.toB-1).number;for(let e=t;e<=n;e++)l.push({num:e,text:r.line(e).text})}o+=c.length,a+=l.length;let u,d,f,p;if(i)u=c[0].num-1,d=c[c.length-1].num+1;else{let t=RV(n,e.fromA),r=n.lineAt(t);e.fromA===r.from?(u=r.number-1,d=r.number):(u=r.number,d=r.number+1)}if(s)f=l[0].num-1,p=l[l.length-1].num+1;else{let t=RV(r,e.fromB),n=r.lineAt(t);e.fromB===n.from?(f=n.number-1,p=n.number):(f=n.number,p=n.number+1)}let m=Math.min(LV,Math.max(0,u),Math.max(0,f));for(let e=m;e>0;e--){let r=u-e+1,i=f-e+1;r>=1&&i>=1&&r<=n.lines&&t.push({type:`context`,oldNum:r,newNum:i,text:n.line(r).text})}for(let e of c)t.push({type:`deletion`,oldNum:e.num,newNum:null,text:e.text});for(let e of l)t.push({type:`addition`,oldNum:null,newNum:e.num,text:e.text});let h=Math.max(0,Math.min(LV,n.lines-d+1)),g=Math.max(0,Math.min(LV,r.lines-p+1)),_=Math.min(h,g);for(let e=0;e<_;e++){let i=d+e,a=p+e;i>=1&&i<=n.lines&&a>=1&&a<=r.lines&&t.push({type:`context`,oldNum:i,newNum:a,text:n.line(i).text})}let v=t.find(e=>e.oldNum!==null)?.oldNum??1,y=t.find(e=>e.newNum!==null)?.newNum??1;return{oldStart:v,oldCount:t.filter(e=>e.type!==`addition`).length,newStart:y,newCount:t.filter(e=>e.type!==`deletion`).length,lines:t}}),additions:a,deletions:o}}var BV=5;function VV({additions:e,deletions:t}){let n=e+t;if(n===0)return null;let r=Math.round(e/n*BV);return(0,I.jsx)(`span`,{className:IV.statBar,children:Array.from({length:BV},(e,t)=>(0,I.jsx)(`span`,{className:`${IV.statBlock} ${t<r?IV.statBlockAdd:IV.statBlockDel}`},t))})}function HV({open:e,original:t,modified:n,onConfirm:r,onCancel:i,loading:a=!1}){let{t:o}=qo(),s=(0,y.useMemo)(()=>zV(t,n),[t,n]);return(0,I.jsx)(Cp,{open:e,title:o(`config_management.diff.title`),onClose:i,width:`min(1200px, 90vw)`,className:IV.diffModal,closeDisabled:a,footer:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(L,{variant:`secondary`,onClick:i,disabled:a,children:o(`common.cancel`)}),(0,I.jsx)(L,{onClick:r,loading:a,disabled:a,children:o(`config_management.diff.confirm`)})]}),children:(0,I.jsx)(`div`,{className:IV.content,children:s.hunks.length===0?(0,I.jsx)(`div`,{className:IV.emptyState,children:o(`config_management.diff.no_changes`)}):(0,I.jsxs)(`div`,{className:IV.diffContainer,children:[(0,I.jsxs)(`div`,{className:IV.fileHeader,children:[(0,I.jsx)(`svg`,{className:IV.fileIcon,viewBox:`0 0 16 16`,width:`16`,height:`16`,children:(0,I.jsx)(`path`,{fillRule:`evenodd`,d:`M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z`,fill:`currentColor`})}),(0,I.jsx)(`span`,{className:IV.fileName,children:`config.yaml`}),(0,I.jsxs)(`span`,{className:IV.fileStats,children:[(0,I.jsxs)(`span`,{className:IV.statAdditions,children:[`+`,s.additions]}),(0,I.jsxs)(`span`,{className:IV.statDeletions,children:[`-`,s.deletions]}),(0,I.jsx)(VV,{additions:s.additions,deletions:s.deletions})]})]}),(0,I.jsx)(`div`,{className:IV.diffBody,children:s.hunks.map((e,t)=>(0,I.jsxs)(`div`,{className:IV.hunk,children:[(0,I.jsxs)(`div`,{className:IV.hunkHeader,children:[(0,I.jsx)(`span`,{className:IV.hunkGutter,children:(0,I.jsx)(`svg`,{className:IV.hunkExpandIcon,viewBox:`0 0 16 16`,width:`12`,height:`12`,children:(0,I.jsx)(`path`,{d:`M8.177 1.677l2.896 2.896a.25.25 0 01-.177.427H8.75v1.25a.75.75 0 01-1.5 0V5H5.104a.25.25 0 01-.177-.427l2.896-2.896a.25.25 0 01.354 0zM7.25 11.75a.75.75 0 011.5 0V13h2.146a.25.25 0 01.177.427l-2.896 2.896a.25.25 0 01-.354 0l-2.896-2.896A.25.25 0 015.104 13H7.25v-1.25z`,fill:`currentColor`})})}),(0,I.jsx)(`span`,{className:IV.hunkGutter}),(0,I.jsxs)(`span`,{className:IV.hunkText,children:[`@@ -`,e.oldStart,`,`,e.oldCount,` +`,e.newStart,`,`,e.newCount,` @@`]})]}),e.lines.map((e,n)=>(0,I.jsxs)(`div`,{className:`${IV.diffLine} ${IV[e.type]}`,children:[(0,I.jsx)(`span`,{className:`${IV.lineNum} ${e.oldNum===null?IV.lineNumEmpty:``}`,children:e.oldNum??``}),(0,I.jsx)(`span`,{className:`${IV.lineNum} ${e.newNum===null?IV.lineNumEmpty:``}`,children:e.newNum??``}),(0,I.jsx)(`span`,{className:IV.linePrefix,children:e.type===`deletion`?`-`:e.type===`addition`?`+`:` `}),(0,I.jsx)(`code`,{className:IV.lineText,children:e.text||` `})]},`${t}-${n}`))]},t))})]})})})}var UV={container:`ConfigPage-module__container___5kN-Y`,pageHeader:`ConfigPage-module__pageHeader___Zulyi`,pageHeaderCopy:`ConfigPage-module__pageHeaderCopy___fiTfJ`,pageTitle:`ConfigPage-module__pageTitle___BoVLE`,tabBar:`ConfigPage-module__tabBar___PelpE`,tabItem:`ConfigPage-module__tabItem___Uj1rU`,tabActive:`ConfigPage-module__tabActive___sZLh-Line truncated
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new dG(this):new uG(this)}getCursor(e,t=0,n){let r=e.doc?e:vA.create({doc:e});return n??(n=r.doc.length),this.regexp?AW(this,r,t,n):OW(this,r,t,n)}},lG=class{constructor(e){this.spec=e}},uG=class extends lG{constructor(e){super(e)}nextMatch(e,t,n){let r=OW(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=OW(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=OW(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=OW(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=OW(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},dG=class extends lG{nextMatch(e,t,n){let r=AW(this.spec,e,n,e.doc.length).next();return r.done&&(r=AW(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=AW(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=AW(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=AW(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},fG=fA.define(),pG=fA.define(),mG=Yk.define({create(e){return new hG(IW(e).create(),null)},update(e,t){for(let n of t.effects)n.is(fG)?e=new hG(n.value.create(),e.panel):n.is(pG)&&(e=new hG(e.query,n.value?FW:null));return e},provide:e=>kL.from(e,e=>e.panel)}),hG=class{constructor(e,t){this.query=e,this.panel=t}},gG=NP.mark({class:`cm-searchMatch`}),_G=NP.mark({class:`cm-searchMatch cm-searchMatch-selected`}),vG=_F.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(mG))}update(e){let t=e.state.field(mG);(t!=e.startState.field(mG)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return NP.none;let{view:n}=this,r=new CA;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?_G:gG)})}return r.finish()}},{decorations:e=>e.decorations}),yG=PW((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=q.single(r.from,r.to),a=e.state.facet(sG);return e.dispatch({selection:i,effects:[BW(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),RW(e),!0}),bG=PW((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=q.single(i.from,i.to),o=e.state.facet(sG);return e.dispatch({selection:a,effects:[BW(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),RW(e),!0}),xG=PW((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:q.create(n.map(e=>q.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),SG=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new HW(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(q.range(t.value.from,t.value.to))}return t(e.update({selection:q.create(a,o),userEvent:`select.search.matches`})),!0},CG=PW((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(X.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=q.single(o.from,o.to).map(d),u.push(BW(e,o)),u.push(n.facet(sG).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effectLine truncated
`);Xx({filename:`logs.txt`,blob:new Blob([n],{type:`text/plain`})}),t(e(`logs.download_success`),`success`)},xe=async()=>{if(r!==`connected`){F(!1);return}if(u){F(!1),te([]),re(``);return}F(!0),re(``);try{let e=await ng.fetchErrorLogs();te(Array.isArray(e.files)?e.files:[])}catch(t){console.error(`Failed to load error logs:`,t),te([]);let n=KX(t);re(n?`${e(`logs.error_logs_load_error`)}: ${n}`:e(`logs.error_logs_load_error`))}finally{F(!1)}},Se=async n=>{try{let r=await ng.downloadErrorLog(n);Xx({filename:n,blob:new Blob([r.data],{type:`text/plain`})}),t(e(`logs.error_log_download_success`),`success`)}catch(n){let r=KX(n);t(`${e(`notification.download_failed`)}${r?`: ${r}`:``}`,`error`)}};(0,y.useEffect)(()=>{r===`connected`&&(pe.current=void 0,le.current={},f(!1),ve(!1))},[r,c]),(0,y.useEffect)(()=>{if(r!==`connected`||i!==`unknown`)return;let e=!1;return(async()=>{let t=await uf.detectRuntimeKind();!e&&(t===`cpa`||t===`home`)&&a(t)})(),()=>{e=!0}},[r,i,a]),(0,y.useEffect)(()=>{m===`errors`&&r===`connected`&&xe()},[m,r,s]),(0,y.useEffect)(()=>{if(!C||r!==`connected`||p)return;let e=window.setInterval(()=>{ve(!0)},8e3);return()=>window.clearInterval(e)},[C,r,p]);let Ce=(0,y.useMemo)(()=>g.buffer.slice(g.visibleFrom),[g.buffer,g.visibleFrom]),we=D.trim(),Te=we.length>0,Ee=Te?g.buffer:Ce,De=(0,y.useMemo)(()=>{let e=Ee;if(O&&(e=e.filter(e=>!e.includes(ac))),we){let t=we.toLowerCase();e=e.filter(e=>e.toLowerCase().includes(t))}return e.map(e=>FX(e))},[Ee,O,we]),Oe=LX({parsedLines:De}),ke=`logs-structured-filters`,Ae=Oe.methodFilters.length+Oe.statusFilters.length+Oe.pathFilters.length,{filteredParsedLines:je,filteredLines:Me,removedCount:Ne}=(0,y.useMemo)(()=>{let e=De.filter(e=>{if(Oe.methodFilterSet.size>0&&(!e.method||!Oe.methodFilterSet.has(e.method)))return!1;let t=mX(e.statusCode);return!(Oe.statusFilterSet.size>0&&(!t||!Oe.statusFilterSet.has(t))||Oe.pathFilterSet.size>0&&(!e.path||!Oe.pathFilterSet.has(e.path)))});return{filteredParsedLines:e,filteredLines:e.map(e=>e.raw),removedCount:Math.max(Ee.length-e.length,0)}},[Ee,Oe.methodFilterSet,Oe.pathFilterSet,Oe.statusFilterSet,De]),Pe=(0,y.useMemo)(()=>A?[]:je,[je,A]),Fe=(0,y.useMemo)(()=>Me.join(`
`),[Me]),Ie=VX({logState:g,setLogState:_,loading:v,isSearching:Te,filteredLineCount:Me.length,hasStructuredFilters:Oe.hasStructuredFilters,showRawLogs:A});ce.current=Ie;let Le=async n=>{await Vv(n)?t(e(`logs.copy_success`,{defaultValue:`Copied to clipboard`}),`success`):t(e(`logs.copy_failed`,{defaultValue:`Copy failed`}),`error`)},Re=()=>{ue.current?.timer&&(window.clearTimeout(ue.current.timer),ue.current.timer=null)},ze=(e,t)=>{s&&t&&(ie||(Re(),ue.current={timer:window.setTimeout(()=>{ae(t),ue.current&&(ue.current.fired=!0,ue.current.timer=null)},WX),startX:e.clientX,startY:e.clientY,fired:!1}))},Be=()=>{Re(),ue.current=null},Ve=e=>{let t=ue.current;if(!t||t.timer===null||t.fired)return;let n=Math.abs(e.clientX-t.startX),r=Math.abs(e.clientY-t.startY);(n>GX||r>GX)&&Be()},He=()=>{oe||ae(null)},Ue=async n=>{se(!0);try{let r=await ng.downloadRequestLogById(n,le.current[n]);Xx({filename:`request-${n}.log`,blob:new Blob([r.data],{type:`text/plain`})}),t(e(`logs.request_log_download_success`),`success`),ae(null)}catch(n){let r=KX(n);t(`${e(`notification.download_failed`)}${r?`: ${r}`:``}`,`error`)}finally{se(!1)}};return(0,y.useEffect)(()=>()=>{ue.current?.timer&&(window.clearTimeout(ue.current.timer),ue.current.timer=null)},[]),(0,I.jsxs)(`div`,{className:$.container,children:[(0,I.jsxs)(`div`,{className:$.pageHeader,children:[(0,I.jsx)(`h1`,{className:$.pageTitle,children:e(`logs.title`)}),(0,I.jsx)(`div`,{className:$.runtimeNotice,children:e(`logs.runtime_${i}`)})]}),(0,I.jsxs)(`div`,{className:$.tabBar,children:[(0,I.jsx)(`button`,{type:`button`,className:`${$.tabItem} ${m===`logs`?$.tabActive:``}`,onClick:()=>h(`logs`),children:e(`logs.log_content`)}),(0,I.jsx)(`button`,{type:`button`,className:`${$.tabItem} ${m===`errors`?$.tabActive:``}`,onClick:()=>h(`errors`),children:e(`logs.error_logs_modal_title`)})]}),(0,I.jsxs)(`div`,{className:$.content,children:[m===`logs`&&(0,I.jsxs)(zv,{className:$.logCard,children:[p&&(0,I.jsx)(`div`,{className:`status-badge warning`,children:e(l?`logs.cpa_file_logging_required`:`logs.file_logging_required`)}),x&&(0,I.jsx)(`div`,{className:`error-box`,children:x}),(0,I.jsxs)(`div`,{className:$.filters,children:[(0,I.jsx)(`div`,{className:$.searchWrapper,children:(0,I.jsx)(Xo,{value:T,onChange:e=>E(e.target.value),placeholder:e(`logs.search_placeholder`),className:$.searchInput,rightElement:T?(0,I.jsx)(`button`,{type:`button`,className:$.searchClear,onClick:()=>E(``),title:`Clear`,"aria-label":`Clear`,children:(0,I.jsx)(ys,{size:16})}):(0,I.jsx)(vs,{size:16,className:$.searchIcon})})}),(0,I.jsx)(`div`,{className:$.filterPanelHeader,children:(0,I.jsx)(L,{type:`button`,variant:`secondary`,size:`sm`,className:$.filterPanelToggle,onClick:()=>M(e=>!e),"aria-expanded":ee,"aria-controls":ke,title:e(ee?`logs.filter_panel_collapse`:`logs.filter_panel_expand`),children:(0,I.jsxs)(`span`,{className:$.filterPanelButtonContent,children:[(0,I.jsx)($o,{size:16}),(0,I.jsx)(`span`,{children:e(`logs.filter_panel_title`)}),Ae>0&&(0,I.jsx)(`span`,{className:$.filterPanelCount,children:e(`logs.filter_panel_active_count`,{count:Ae})}),ee?(0,I.jsx)(hs,{size:16}):(0,I.jsx)(gs,{size:16})]})})}),ee&&(0,I.jsxs)(`div`,{id:ke,className:$.structuredFilters,children:[(0,I.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,I.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_method`)}),(0,I.jsx)(`div`,{className:$.filterChipList,children:fX.map(e=>{let t=Oe.methodFilters.includes(e),n=Oe.methodCounts[e]??0;return(0,I.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${t?$.filterChipActive:``}`,onClick:()=>Oe.toggleMethodFilter(e),disabled:n===0&&!t,"aria-pressed":t,children:[e,` (`,n,`)`]},e)})})]}),(0,I.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,I.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_status`)}),(0,I.jsx)(`div`,{className:$.filterChipList,children:pX.map(t=>{let n=Oe.statusFilters.includes(t),r=Oe.statusCounts[t]??0;return(0,I.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${n?$.filterChipActive:``}`,onClick:()=>Oe.toggleStatusFilter(t),disabled:r===0&&!n,"aria-pressed":n,children:[e(`logs.filter_status_${t}`),` (`,r,`)`]},t)})})]}),(0,I.jsxs)(`div`,{className:$.filterChipGroup,children:[(0,I.jsx)(`span`,{className:$.filterChipLabel,children:e(`logs.filter_path`)}),(0,I.jsx)(`div`,{className:$.filterChipList,children:Oe.pathOptions.length===0?(0,I.jsx)(`span`,{className:$.filterChipHint,children:e(`logs.filter_path_empty`)}):Oe.pathOptions.map(({path:e,count:t})=>{let n=Oe.pathFilters.includes(e);return(0,I.jsxs)(`button`,{type:`button`,className:`${$.filterChip} ${n?$.filterChipActive:``}`,onClick:()=>Oe.togglePathFilter(e),"aria-pressed":n,title:e,children:[e,` (`,t,`)`]},e)})})]}),(0,I.jsx)(L,{variant:`ghost`,size:`sm`,onClick:Oe.clearStructuredFilters,disabled:!Oe.hasStructuredFilters,children:e(`logs.clear_filters`)})]}),(0,I.jsx)(g_,{checked:O,onChange:k,label:(0,I.jsxs)(`span`,{className:$.switchLabel,children:[(0,I.jsx)(Ss,{siLine truncated
<style rel="stylesheet" crossorigin>*,:before,:after{box-sizing:border-box;margin:0;padding:0}html,body{width:100%;height:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;line-height:1.5}#root{width:100%;height:100%}button,input,textarea,select{font:inherit}a{color:inherit;text-decoration:none}ul,ol{list-style:none}:root{--bg-secondary:#faf9f5;--bg-primary:#f0eee8;--bg-tertiary:#e9e6df;--bg-hover:var(--bg-tertiary);--bg-quinary:#f6f4ee;--bg-error-light:#c657461a;--floating-surface:#fffdf9;--floating-border:#d8d3ca;--floating-shadow:0 12px 26px #00000024;--text-primary:#2d2a26;--text-secondary:#6d6760;--text-tertiary:#a29c95;--text-quaternary:#c0bab3;--text-muted:var(--text-tertiary);--border-color:#e3e1db;--border-secondary:var(--border-color);--border-primary:#d5d2cb;--border-hover:#cecac4;--primary-color:#8b8680;--primary-hover:#7f7a74;--primary-active:#726d67;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#e0aa14;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c657461f;--warning-border:#c6574659;--warning-text:var(--warning-color);--success-badge-bg:#d1fae5;--success-badge-text:#065f46;--success-badge-border:#6ee7b7;--failure-badge-bg:#c6574624;--failure-badge-text:#8a3a30;--failure-badge-border:#c6574659;--count-badge-bg:#8b86802e;--count-badge-text:var(--primary-active);--shadow:0 1px 2px 0 #00000014;--shadow-lg:0 10px 18px -3px #0000001a;--radius-md:8px;--accent-tertiary:var(--bg-tertiary);--primary-8:color-mix(in srgb, var(--primary-color) 8%, transparent);--primary-10:color-mix(in srgb, var(--primary-color) 10%, transparent);--primary-30:color-mix(in srgb, var(--primary-color) 30%, transparent);--amber-color:#d97706;--amber-text:#92400e;--amber-10:color-mix(in srgb, var(--amber-color) 10%, transparent);--amber-30:color-mix(in srgb, var(--amber-color) 30%, transparent);--destructive-color:var(--error-color);--destructive-10:color-mix(in srgb, var(--destructive-color) 10%, transparent);--destructive-30:color-mix(in srgb, var(--destructive-color) 30%, transparent);--muted-bg:var(--bg-tertiary);--muted-foreground:var(--text-secondary);--accent-bg:var(--bg-tertiary);--glass-blur:12px;--glass-backdrop-filter:blur(var(--glass-blur));--glass-filter:blur(var(--glass-blur));--glass-bg:color-mix(in srgb, var(--bg-primary) 82%, transparent);--glass-bg-secondary:color-mix(in srgb, var(--bg-secondary) 82%, transparent);--glass-border:color-mix(in srgb, var(--border-color) 60%, transparent)}[data-theme=white]{--bg-secondary:#fff;--bg-primary:#fff;--bg-tertiary:#f6f6f6;--bg-hover:var(--bg-tertiary);--bg-quinary:#fff;--bg-error-light:#c6574614;--floating-surface:#fff;--floating-border:#d9d9d9;--floating-shadow:0 12px 26px #0000001f;--text-primary:#2d2a26;--text-secondary:#6d6760;--text-tertiary:#a29c95;--text-quaternary:#c0bab3;--text-muted:var(--text-tertiary);--border-color:#e5e5e5;--border-secondary:var(--border-color);--border-primary:#d9d9d9;--border-hover:#ccc;--primary-color:#8b8680;--primary-hover:#7f7a74;--primary-active:#726d67;--primary-contrast:#fff;--success-color:#10b981;--quota-medium-color:#e0aa14;--warning-color:#c65746;--error-color:#c65746;--danger-color:var(--error-color);--info-color:var(--primary-color);--warning-bg:#c657461f;--warning-border:#c6574659;--warning-text:var(--warning-color);--success-badge-bg:#d1fae5;--success-badge-text:#065f46;--success-badge-border:#6ee7b7;--failure-badge-bg:#c6574624;--failure-badge-text:#8a3a30;--failure-badge-border:#c6574659;--count-badge-bg:#8b86802e;--count-badge-text:var(--primary-active);--shadow:0 1px 2px 0 #00000014;--shadow-lg:0 10px 18px -3px #0000001a;--radius-md:8px;--accent-tertiary:var(--bg-tertiary);--primary-8:color-mix(in srgb, var(--primary-color) 8%, transparent);--primary-10:color-mix(in srgb, var(--primary-color) 10%, transparent);--primary-30:color-mix(in srgb, var(--primary-color) 30%, transparent);--amber-color:#d97706;--amber-text:#92400e;--amber-10:color-mix(in srgb, var(--amber-color) 10%, transparent);--amber-30:color-mix(in srgb, var(--amber-color) 30%, transparent);--destructive-color:var(--error-color);--destructive-10:color-mix(in srgb, var(--destructive-color) 10%, transparent);--destructive-30:color-mix(in srgb, var(--destructive-color) 30%, transparent);--muted-bg:var(--bg-tertiary);--muted-foreground:var(--text-secondary);--accent-bg:var(--bg-tertiary)}[data-theme=dark]{--bg-secondary:#151412;--bg-primary:#1d1b18;--bg-tertiary:#262320;--bg-hover:#2e2a26;--bg-quinary:#191714;--bg-error-light:#c657462e;--floating-surface:#2a2723;--floating-border:#4a443d;--floating-shadow:0 14px 30px #0006;--text-primary:#f6f4f1;--text-secondary:#c9c3bb;--text-tertiary:#9c958d;--text-quaternary:#6f6962;--text-muted:var(--text-tertiary);--border-color:#3a3530;--border-seLine truncated
/*$vite$:1*/</style>
</head>
<body>