(j)
| 2159 | `).replace(/[\r\u0085\u2028]/g,` |
| 2160 | `)}function x6K(q){this.options=q||{locator:{}}}x6K.prototype.parseFromString=function(q,K){var _=this.options,z=new iuz,Y=_.domBuilder||new ot6,$=_.errorHandler,A=_.locator,O=_.xmlns||{},w=/\/x?html?$/.test(K),j=w?R6K.HTML_ENTITIES:R6K.XML_ENTITIES;if(A)Y.setDocumentLocator(A);if(z.errorHandler=ruz($,Y,A),z.domBuilder=_.domBuilder||Y,w)O[""]=h6K.HTML;O.xml=O.xml||h6K.XML;var H=_.normalizeLineEndings||b6K;if(q&&typeof q==="string")z.parse(H(q),O,j);else z.errorHandler.error("invalid doc source");return Y.doc};function ruz(q,K,_){if(!q){if(K instanceof ot6)return K;q=K}var z={},Y=q instanceof Function;_=_||{};function $(A){var O=q[A];if(!O&&Y)O=q.length==2?function(w){q(A,w)}:q;z[A]=O&&function(w){O("[xmldom "+A+"]\t"+w+Ln1(_))}||function(){}}return $("warning"),$("error"),$("fatalError"),z}function ot6(){this.cdata=!1}function KE6(q,K){K.lineNumber=q.lineNumber,K.columnNumber=q.columnNumber}ot6.prototype={startDocument:function(){if(this.doc=new luz().createDocument(null,null,null),this.locator)this.doc.documentURI=this.locator.systemId},startElement:function(q,K,_,z){var Y=this.doc,$=Y.createElementNS(q,_||K),A=z.length;aS8(this,$),this.currentElement=$,this.locator&&KE6(this.locator,$);for(var O=0;O<A;O++){var q=z.getURI(O),w=z.getValue(O),_=z.getQName(O),j=Y.createAttributeNS(q,_);this.locator&&KE6(z.getLocator(O),j),j.value=j.nodeValue=w,$.setAttributeNode(j)}},endElement:function(q,K,_){var z=this.currentElement,Y=z.tagName;this.currentElement=z.parentNode},startPrefixMapping:function(q,K){},endPrefixMapping:function(q){},processingInstruction:function(q,K){var _=this.doc.createProcessingInstruction(q,K);this.locator&&KE6(this.locator,_),aS8(this,_)},ignorableWhitespace:function(q,K,_){},characters:function(q,K,_){if(q=S6K.apply(this,arguments),q){if(this.cdata)var z=this.doc.createCDATASection(q);else var z=this.doc.createTextNode(q);if(this.currentElement)this.currentElement.appendChild(z);else if(/^\s*$/.test(q))this.doc.appendChild(z);this.locator&&KE6(this.locator,z)}},skippedEntity:function(q){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(q){if(this.locator=q)q.lineNumber=0},comment:function(q,K,_){q=S6K.apply(this,arguments);var z=this.doc.createComment(q);this.locator&&KE6(this.locator,z),aS8(this,z)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(q,K,_){var z=this.doc.implementation;if(z&&z.createDocumentType){var Y=z.createDocumentType(q,K,_);this.locator&&KE6(this.locator,Y),aS8(this,Y),this.doc.doctype=Y}},warning:function(q){console.warn("[xmldom warning]\t"+q,Ln1(this.locator))},error:function(q){console.error("[xmldom error]\t"+q,Ln1(this.locator))},fatalError:function(q){throw new nuz(q,this.locator)}};function Ln1(q){if(q)return` |
| 2161 | @`+(q.systemId||"")+"#[line:"+q.lineNumber+",col:"+q.columnNumber+"]"}function S6K(q,K,_){if(typeof q=="string")return q.substr(K,_);else{if(q.length>=K+_||K)return new java.lang.String(q,K,_)+"";return q}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(q){ot6.prototype[q]=function(){return null}});function aS8(q,K){if(!q.currentElement)q.doc.appendChild(K);else q.currentElement.appendChild(K)}ouz.__DOMHandler=ot6;ouz.normalizeLineEndings=b6K;ouz.DOMParser=x6K});var m6K=m((euz)=>{var u6K=yn1();euz.DOMImplementation=u6K.DOMImplementation;euz.XMLSerializer=u6K.XMLSerializer;euz.DOMParser=I6K().DOMParser});var B6K=m((Amz)=>{var{DOMParser:zmz}=m6K();Amz.parse=$mz;var sS8=3,p6K=4,Ymz=8;function Rn1(q){return q.nodeType===sS8||q.nodeType===Ymz||q.nodeType===p6K}function mo(q){if(!q.childNodes||q.childNodes.length===0)return!0;else return!1}function p26(q,K){if(!q)throw Error(K)}function $mz(q){var K=new zmz().parseFromString(q);p26(K.documentElement.nodeName==="plist","malformed document. First element should be <plist>");var _=_E6(K.documentElement);if(_.length==1)_=_[0];return _}function _E6(q){var K,_,z,Y,$,A,O,w;if(!q)return null;if(q.nodeName==="plist"){if($=[],mo(q))return $;for(K=0;K<q.childNodes.length;K++)if(!Rn1(q.childNodes[K]))$.push(_E6(q.childNodes[K]));return $}else if(q.nodeName==="dict"){if(_={},z=null,O=0,mo(q))return _;for(K=0;K<q.childNodes.length;K++){if(Rn1(q.childNodes[K]))continue;if(O%2===0)p26(q.childNodes[K].nodeName==="key","Missing key while parsing <dict/>."),z=_E6(q.childNodes[K]);else p26(q.childNodes[K].nodeName!=="key",'Unexpected key "'+_E6(q.childNodes[K])+'" while parsing <dict/>.'),_[z]=_E6(q.childNodes[K]);O+=1}if(O%2===1)_[z]="";return _}else if(q.nodeName==="array"){if($=[],mo(q))return $;for(K=0;K<q.childNodes.length;K++)if(!Rn1(q.childNodes[K])){if(A=_E6(q.childNodes[K]),A!=null)$.push(A)}return $}else if(q.nodeName==="#text");else if(q.nodeName==="key"){if(mo(q))return"";return p26(q.childNodes[0].nodeValue!=="__proto__","__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912"),q.childNodes[0].nodeValue}else if(q.nodeName==="string"){if(A="",mo(q))return A;for(K=0;K<q.childNodes.length;K++){var w=q.childNodes[K].nodeType;if(w===sS8||w===p6K)A+=q.childNodes[K].nodeValue}return A}else if(q.nodeName==="integer")return p26(!mo(q),'Cannot parse "" as integer.'),parseInt(q.childNodes[0].nodeValue,10);else if(q.nodeName==="real"){p26(!mo(q),'Cannot parse "" as real.'),A="";for(K=0;K<q.childNodes.length;K++)if(q.childNodes[K].nodeType===sS8)A+=q.childNodes[K].nodeValue;return parseFloat(A)}else if(q.nodeName==="data"){if(A="",mo(q))return Buffer.from(A,"base64");for(K=0;K<q.childNodes.length;K++)if(q.childNodes[K].nodeType===sS8)A+=q.childNodes[K].nodeValue.replace(/\s+/g,"");return Buffer.from(A,"base64")}else if(q.nodeName==="date")return p26(!mo(q),'Cannot parse "" as Date.'),new Date(q.childNodes[0].nodeValue);else if(q.nodeName==="null")return null;else if(q.nodeName==="true")return!0;else if(q.nodeName==="false")return!1;else throw Error("Invalid PLIST tag "+q.nodeName)}});var fQ=m((g6K,B46)=>{(function(){var q,K,_,z,Y,$,A,O={}.hasOwnProperty;q=function(w,...j){var H,J,M,X;if(Y(Object.assign))Object.assign.apply(null,arguments);else for(H=0,M=j.length;H<M;H++)if(X=j[H],X!=null)for(J in X){if(!O.call(X,J))continue;w[J]=X[J]}return w},Y=function(w){return!!w&&Object.prototype.toString.call(w)==="[object Function]"},$=function(w){var j;return!!w&&((j=typeof w)==="function"||j==="object")},_=function(w){if(Y(Array.isArray))return Array.isArray(w);else return Object.prototype.toString.call(w)==="[object Array]"},z=function(w){var j;if(_(w))return!w.length;else{for(j in w){if(!O.call(w,j))continue;return!1}return!0}},A=function(w){var j,H;return $(w)&&(H=Object.getPrototypeOf(w))&&(j=H.constructor)&&typeof j==="function"&&j instanceof j&&Function.prototype.toString.call(j)===Function.prototype.toString.call(Object)},K=function(w){if(Y(w.valueOf))return w.valueOf();else return w},g6K.assign=q,g6K.isFunction=Y,g6K.isObject=$,g6K.isArray=_,g6K.isEmpty=z,g6K.isPlainObject=A,g6K.getValue=K}).call(g6K)});var hn1=m((F6K,U6K)=>{(function(){var q;U6K.exports=q=class{hasFeature(_,z){return!0}createDocumentType(_,z,Y){throw Error("This DOM method is not implemented.")}createDocument(_,z,Y){throw Error("This DOM method is not implemented.")}createHTMLDocument(_){throw Error("This DOM method is not implemented.")}getFeature(_,z){throw Error("This DOM method is not implemented.")}}}).call(F6K)});var c6K=m((Q6K,d6K)=>{(function(){var q;d6K.exports=q=class{constructor(){}handleError(_){throw Error(_)}}}).call(Q6K)});var i6K=m((l6K,n6K)=>{(function(){var q;n6K.exports=q=function(){class K{constructor(_){this.arr=_||[]}item(_){return this.arr[_]||null}contains(_){return this.arr.indexOf(_)!==-1}}return Object.defineProperty(K.prototype,"length",{get:function(){return this.arr.length}}),K}.call(this)}).call(l6K)});var a6K=m((r6K,o6K)=>{(function(){var q,K,_;K=c6K(),_=i6K(),o6K.exports=q=function(){class z{constructor(){var Y;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new K,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Y=Object.create(this.defaultParams)}getParameter(Y){if(this.params.hasOwnProperty(Y))return this.params[Y];else return null}canSetParameter(Y,$){return!0}setParameter(Y,$){if($!=null)return this.params[Y]=$;else return delete this.params[Y]}}return Object.defineProperty(z.prototype,"parameterNames",{get:function(){return new _(Object.keys(this.defaultParams))}}),z}.call(this)}).call(r6K)});var kM=m((s6K,t6K)=>{(function(){t6K.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(s6K)});var Sn1=m((e6K,q8K)=>{(function(){var q,K,_;q=kM(),_=lL(),q8K.exports=K=function(){class z{constructor(Y,$,A){if(this.parent=Y,this.parent)this.options=this.parent.options,this.stringify=this.parent.stringify;if($==null)throw Error("Missing attribute name. "+this.debugInfo($));this.name=this.stringify.name($),this.value=this.stringify.attValue(A),this.type=q.Attribute,this.isId=!1,this.schemaTypeInfo=null}clone(){return Object.create(this)}toString(Y){return this.options.writer.attribute(this,this.options.writer.filterOptions(Y))}debugInfo(Y){if(Y=Y||this.name,Y==null)return"parent: <"+this.parent.name+">";else return"attribute: {"+Y+"}, parent: <"+this.parent.name+">"}isEqualNode(Y){if(Y.namespaceURI!==this.namespaceURI)return!1;if(Y.prefix!==this.prefix)return!1;if(Y.localName!==this.localName)return!1;if(Y.value!==this.value)return!1;return!0}}return Object.defineProperty(z.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(z.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(z.prototype,"textContent",{get:function(){return this.value},set:function(Y){return this.value=Y||""}}),Object.defineProperty(z.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(z.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(z.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(z.prototype,"specified",{get:function(){return!0}}),z}.call(this)}).call(e6K)});var tS8=m((K8K,_8K)=>{(function(){var q;_8K.exports=q=function(){class K{constructor(_){this.nodes=_}clone(){return this.nodes=null}getNamedItem(_){return this.nodes[_]}setNamedItem(_){var z=this.nodes[_.nodeName];return this.nodes[_.nodeName]=_,z||null}removeNamedItem(_){var z=this.nodes[_];return delete this.nodes[_],z||null}item(_){return this.nodes[Object.keys(this.nodes)[_]]||null}getNamedItemNS(_,z){throw Error("This DOM method is not implemented.")}setNamedItemNS(_){throw Error("This DOM method is not implemented.")}removeNamedItemNS(_,z){throw Error("This DOM method is not implemented.")}}return Object.defineProperty(K.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),K}.call(this)}).call(K8K)});var eS8=m((z8K,Y8K)=>{(function(){var q,K,_,z,Y,$,A,O,w={}.hasOwnProperty;({isObject:O,isFunction:A,getValue:$}=fQ()),Y=lL(),q=kM(),K=Sn1(),z=tS8(),Y8K.exports=_=function(){class j extends Y{constructor(H,J,M){var X,P,W,D;super(H);if(J==null)throw Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(J),this.type=q.Element,this.attribs={},this.schemaTypeInfo=null,M!=null)this.attribute(M);if(H.type===q.Document){if(this.isRoot=!0,this.documentObject=H,H.rootObject=this,H.children){D=H.children;for(P=0,W=D.length;P<W;P++)if(X=D[P],X.type===q.DocType){X.name=this.name;break}}}}clone(){var H,J,M,X;if(M=Object.create(this),M.isRoot)M.documentObject=null;M.attribs={},X=this.attribs;for(J in X){if(!w.call(X,J))continue;H=X[J],M.attribs[J]=H.clone()}return M.children=[],this.children.forEach(function(P){var W=P.clone();return W.parent=M,M.children.push(W)}),M}attribute(H,J){var M,X;if(H!=null)H=$(H);if(O(H))for(M in H){if(!w.call(H,M))continue;X=H[M],this.attribute(M,X)}else{if(A(J))J=J.apply();if(this.options.keepNullAttributes&&J==null)this.attribs[H]=new K(this,H,"");else if(J!=null)this.attribs[H]=new K(this,H,J)}return this}removeAttribute(H){var J,M,X;if(H==null)throw Error("Missing attribute name. "+this.debugInfo());if(H=$(H),Array.isArray(H))for(M=0,X=H.length;M<X;M++)J=H[M],delete this.attribs[J];else delete this.attribs[H];return this}toString(H){return this.options.writer.element(this,this.options.writer.filterOptions(H))}att(H,J){return this.attribute(H,J)}a(H,J){return this.attribute(H,J)}getAttribute(H){if(this.attribs.hasOwnProperty(H))return this.attribs[H].value;else return null}setAttribute(H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNode(H){if(this.attribs.hasOwnProperty(H))return this.attribs[H];else return null}setAttributeNode(H){throw Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNode(H){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(H){throw Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNS(H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNS(H,J,M){throw Error("This DOM method is not implemented."+this.debugInfo())}removeAttributeNS(H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}getAttributeNodeNS(H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}setAttributeNodeNS(H){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}hasAttribute(H){return this.attribs.hasOwnProperty(H)}hasAttributeNS(H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}setIdAttribute(H,J){if(this.attribs.hasOwnProperty(H))return this.attribs[H].isId;else return J}setIdAttributeNS(H,J,M){throw Error("This DOM method is not implemented."+this.debugInfo())}setIdAttributeNode(H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(H){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(H){throw Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(H){var J,M,X;if(!super.isEqualNode(H))return!1;if(H.namespaceURI!==this.namespaceURI)return!1;if(H.prefix!==this.prefix)return!1;if(H.localName!==this.localName)return!1;if(H.attribs.length!==this.attribs.length)return!1;for(J=M=0,X=this.attribs.length-1;0<=X?M<=X:M>=X;J=0<=X?++M:--M)if(!this.attribs[J].isEqualNode(H.attribs[J]))return!1;return!0}}return Object.defineProperty(j.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(j.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(j.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(j.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(j.prototype,"id",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(j.prototype,"className",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(j.prototype,"classList",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(j.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes)this.attributeMap=new z(this.attribs);return this.attributeMap}}),j}.call(this)}).call(z8K)});var at6=m(($8K,A8K)=>{(function(){var q,K;K=lL(),A8K.exports=q=function(){class _ extends K{constructor(z){super(z);this.value=""}clone(){return Object.create(this)}substringData(z,Y){throw Error("This DOM method is not implemented."+this.debugInfo())}appendData(z){throw Error("This DOM method is not implemented."+this.debugInfo())}insertData(z,Y){throw Error("This DOM method is not implemented."+this.debugInfo())}deleteData(z,Y){throw Error("This DOM method is not implemented."+this.debugInfo())}replaceData(z,Y,$){throw Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(z){if(!super.isEqualNode(z))return!1;if(z.data!==this.data)return!1;return!0}}return Object.defineProperty(_.prototype,"data",{get:function(){return this.value},set:function(z){return this.value=z||""}}),Object.defineProperty(_.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(_.prototype,"textContent",{get:function(){return this.value},set:function(z){return this.value=z||""}}),_}.call(this)}).call($8K)});var qC8=m((O8K,w8K)=>{(function(){var q,K,_;q=kM(),_=at6(),w8K.exports=K=class extends _{constructor(Y,$){super(Y);if($==null)throw Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=q.CData,this.value=this.stringify.cdata($)}clone(){return Object.create(this)}toString(Y){return this.options.writer.cdata(this,this.options.writer.filterOptions(Y))}}}).call(O8K)});var KC8=m((j8K,H8K)=>{(function(){var q,K,_;q=kM(),K=at6(),H8K.exports=_=class extends K{constructor(Y,$){super(Y);if($==null)throw Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=q.Comment,this.value=this.stringify.comment($)}clone(){return Object.create(this)}toString(Y){return this.options.writer.comment(this,this.options.writer.filterOptions(Y))}}}).call(j8K)});var _C8=m((J8K,M8K)=>{(function(){var q,K,_,z;({isObject:z}=fQ()),_=lL(),q=kM(),M8K.exports=K=class extends _{constructor($,A,O,w){super($);if(z(A))({version:A,encoding:O,standalone:w}=A);if(!A)A="1.0";if(this.type=q.Declaration,this.version=this.stringify.xmlVersion(A),O!=null)this.encoding=this.stringify.xmlEncoding(O);if(w!=null)this.standalone=this.stringify.xmlStandalone(w)}toString($){return this.options.writer.declaration(this,this.options.writer.filterOptions($))}}}).call(J8K)});var zC8=m((X8K,P8K)=>{(function(){var q,K,_;_=lL(),q=kM(),P8K.exports=K=class extends _{constructor(Y,$,A,O,w,j){super(Y);if($==null)throw Error("Missing DTD element name. "+this.debugInfo());if(A==null)throw Error("Missing DTD attribute name. "+this.debugInfo($));if(!O)throw Error("Missing DTD attribute type. "+this.debugInfo($));if(!w)throw Error("Missing DTD attribute default. "+this.debugInfo($));if(w.indexOf("#")!==0)w="#"+w;if(!w.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo($));if(j&&!w.match(/^(#FIXED|#DEFAULT)$/))throw Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo($));if(this.elementName=this.stringify.name($),this.type=q.AttributeDeclaration,this.attributeName=this.stringify.name(A),this.attributeType=this.stringify.dtdAttType(O),j)this.defaultValue=this.stringify.dtdAttDefault(j);this.defaultValueType=w}toString(Y){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(Y))}}}).call(X8K)});var YC8=m((W8K,D8K)=>{(function(){var q,K,_,z;({isObject:z}=fQ()),_=lL(),q=kM(),D8K.exports=K=function(){class Y extends _{constructor($,A,O,w){super($);if(O==null)throw Error("Missing DTD entity name. "+this.debugInfo(O));if(w==null)throw Error("Missing DTD entity value. "+this.debugInfo(O));if(this.pe=!!A,this.name=this.stringify.name(O),this.type=q.EntityDeclaration,!z(w))this.value=this.stringify.dtdEntityValue(w),this.internal=!0;else{if(!w.pubID&&!w.sysID)throw Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(O));if(w.pubID&&!w.sysID)throw Error("System identifier is required for a public external entity. "+this.debugInfo(O));if(this.internal=!1,w.pubID!=null)this.pubID=this.stringify.dtdPubID(w.pubID);if(w.sysID!=null)this.sysID=this.stringify.dtdSysID(w.sysID);if(w.nData!=null)this.nData=this.stringify.dtdNData(w.nData);if(this.pe&&this.nData)throw Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(O))}}toString($){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions($))}}return Object.defineProperty(Y.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(Y.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(Y.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(Y.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(Y.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(Y.prototype,"xmlVersion",{get:function(){return null}}),Y}.call(this)}).call(W8K)});var $C8=m((f8K,Z8K)=>{(function(){var q,K,_;_=lL(),q=kM(),Z8K.exports=K=class extends _{constructor(Y,$,A){super(Y);if($==null)throw Error("Missing DTD element name. "+this.debugInfo());if(!A)A="(#PCDATA)";if(Array.isArray(A))A="("+A.join(",")+")";this.name=this.stringify.name($),this.type=q.ElementDeclaration,this.value=this.stringify.dtdElementValue(A)}toString(Y){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(Y))}}}).call(f8K)});var AC8=m((G8K,T8K)=>{(function(){var q,K,_;_=lL(),q=kM(),T8K.exports=K=function(){class z extends _{constructor(Y,$,A){super(Y);if($==null)throw Error("Missing DTD notation name. "+this.debugInfo($));if(!A.pubID&&!A.sysID)throw Error("Public or system identifiers are required for an external entity. "+this.debugInfo($));if(this.name=this.stringify.name($),this.type=q.NotationDeclaration,A.pubID!=null)this.pubID=this.stringify.dtdPubID(A.pubID);if(A.sysID!=null)this.sysID=this.stringify.dtdSysID(A.sysID)}toString(Y){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(Y))}}return Object.defineProperty(z.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(z.prototype,"systemId",{get:function(){return this.sysID}}),z}.call(this)}).call(G8K)});var OC8=m((v8K,k8K)=>{(function(){var q,K,_,z,Y,$,A,O,w;({isObject:w}=fQ()),O=lL(),q=kM(),K=zC8(),z=YC8(),_=$C8(),Y=AC8(),A=tS8(),k8K.exports=$=function(){class j extends O{constructor(H,J,M){var X,P,W,D;super(H);if(this.type=q.DocType,H.children){D=H.children;for(P=0,W=D.length;P<W;P++)if(X=D[P],X.type===q.Element){this.name=X.name;break}}if(this.documentObject=H,w(J))({pubID:J,sysID:M}=J);if(M==null)[M,J]=[J,M];if(J!=null)this.pubID=this.stringify.dtdPubID(J);if(M!=null)this.sysID=this.stringify.dtdSysID(M)}element(H,J){var M=new _(this,H,J);return this.children.push(M),this}attList(H,J,M,X,P){var W=new K(this,H,J,M,X,P);return this.children.push(W),this}entity(H,J){var M=new z(this,!1,H,J);return this.children.push(M),this}pEntity(H,J){var M=new z(this,!0,H,J);return this.children.push(M),this}notation(H,J){var M=new Y(this,H,J);return this.children.push(M),this}toString(H){return this.options.writer.docType(this,this.options.writer.filterOptions(H))}ele(H,J){return this.element(H,J)}att(H,J,M,X,P){return this.attList(H,J,M,X,P)}ent(H,J){return this.entity(H,J)}pent(H,J){return this.pEntity(H,J)}not(H,J){return this.notation(H,J)}up(){return this.root()||this.documentObject}isEqualNode(H){if(!super.isEqualNode(H))return!1;if(H.name!==this.name)return!1;if(H.publicId!==this.publicId)return!1;if(H.systemId!==this.systemId)return!1;return!0}}return Object.defineProperty(j.prototype,"entities",{get:function(){var H,J,M,X,P;X={},P=this.children;for(J=0,M=P.length;J<M;J++)if(H=P[J],H.type===q.EntityDeclaration&&!H.pe)X[H.name]=H;return new A(X)}}),Object.defineProperty(j.prototype,"notations",{get:function(){var H,J,M,X,P;X={},P=this.children;for(J=0,M=P.length;J<M;J++)if(H=P[J],H.type===q.NotationDeclaration)X[H.name]=H;return new A(X)}}),Object.defineProperty(j.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(j.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(j.prototype,"internalSubset",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo())}}),j}.call(this)}).call(v8K)});var wC8=m((V8K,N8K)=>{(function(){var q,K,_;q=kM(),K=lL(),N8K.exports=_=class extends K{constructor(Y,$){super(Y);if($==null)throw Error("Missing raw text. "+this.debugInfo());this.type=q.Raw,this.value=this.stringify.raw($)}clone(){return Object.create(this)}toString(Y){return this.options.writer.raw(this,this.options.writer.filterOptions(Y))}}}).call(V8K)});var jC8=m((y8K,E8K)=>{(function(){var q,K,_;q=kM(),K=at6(),E8K.exports=_=function(){class z extends K{constructor(Y,$){super(Y);if($==null)throw Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=q.Text,this.value=this.stringify.text($)}clone(){return Object.create(this)}toString(Y){return this.options.writer.text(this,this.options.writer.filterOptions(Y))}splitText(Y){throw Error("This DOM method is not implemented."+this.debugInfo())}replaceWholeText(Y){throw Error("This DOM method is not implemented."+this.debugInfo())}}return Object.defineProperty(z.prototype,"isElementContentWhitespace",{get:function(){throw Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(z.prototype,"wholeText",{get:function(){var Y,$,A;A="",$=this.previousSibling;while($)A=$.data+A,$=$.previousSibling;A+=this.data,Y=this.nextSibling;while(Y)A=A+Y.data,Y=Y.nextSibling;return A}}),z}.call(this)}).call(y8K)});var HC8=m((L8K,R8K)=>{(function(){var q,K,_;q=kM(),K=at6(),R8K.exports=_=class extends K{constructor(Y,$,A){super(Y);if($==null)throw Error("Missing instruction target. "+this.debugInfo());if(this.type=q.ProcessingInstruction,this.target=this.stringify.insTarget($),this.name=this.target,A)this.value=this.stringify.insValue(A)}clone(){return Object.create(this)}toString(Y){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(Y))}isEqualNode(Y){if(!super.isEqualNode(Y))return!1;if(Y.target!==this.target)return!1;return!0}}}).call(L8K)});var Cn1=m((h8K,S8K)=>{(function(){var q,K,_;_=lL(),q=kM(),S8K.exports=K=class extends _{constructor(Y){super(Y);this.type=q.Dummy}clone(){return Object.create(this)}toString(Y){return""}}}).call(h8K)});var x8K=m((C8K,b8K)=>{(function(){var q;b8K.exports=q=function(){class K{constructor(_){this.nodes=_}clone(){return this.nodes=null}item(_){return this.nodes[_]||null}}return Object.defineProperty(K.prototype,"length",{get:function(){return this.nodes.length||0}}),K}.call(this)}).call(C8K)});var m8K=m((I8K,u8K)=>{(function(){u8K.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(I8K)});var lL=m((p8K,B8K)=>{(function(){var q,K,_,z,Y,$,A,O,w,j,H,J,M,X,P,W,D,f,G={}.hasOwnProperty,Z=[].splice;({isObject:f,isFunction:D,isEmpty:W,getValue:P}=fQ()),O=null,_=null,z=null,Y=null,$=null,M=null,X=null,J=null,A=null,K=null,H=null,w=null,q=null,B8K.exports=j=function(){class T{constructor(v){if(this.parent=v,this.parent)this.options=this.parent.options,this.stringify=this.parent.stringify;if(this.value=null,this.children=[],this.baseURI=null,!O)O=eS8(),_=qC8(),z=KC8(),Y=_C8(),$=OC8(),M=wC8(),X=jC8(),J=HC8(),A=Cn1(),K=kM(),H=x8K(),w=tS8(),q=m8K()}setParent(v){var V,E,S,R,x;if(this.parent=v,v)this.options=v.options,this.stringify=v.stringify;R=this.children,x=[];for(E=0,S=R.length;E<S;E++)V=R[E],x.push(V.setParent(this));return x}element(v,V,E){var S,R,x,I,B,p,C,g,F;if(p=null,V===null&&E==null)[V,E]=[{},null];if(V==null)V={};if(V=P(V),!f(V))[E,V]=[V,E];if(v!=null)v=P(v);if(Array.isArray(v))for(x=0,C=v.length;x<C;x++)R=v[x],p=this.element(R);else if(D(v))p=this.element(v.apply());else if(f(v))for(B in v){if(!G.call(v,B))continue;if(F=v[B],D(F))F=F.apply();if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&B.indexOf(this.stringify.convertAttKey)===0)p=this.attribute(B.substr(this.stringify.convertAttKey.length),F);else if(!this.options.separateArrayItems&&Array.isArray(F)&&W(F))p=this.dummy();else if(f(F)&&W(F))p=this.element(B);else if(!this.options.keepNullNodes&&F==null)p=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(F))for(I=0,g=F.length;I<g;I++)R=F[I],S={},S[B]=R,p=this.element(S);else if(f(F))if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&B.indexOf(this.stringify.convertTextKey)===0)p=this.element(F);else p=this.element(B),p.element(F);else p=this.element(B,F)}else if(!this.options.keepNullNodes&&E===null)p=this.dummy();else if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&v.indexOf(this.stringify.convertTextKey)===0)p=this.text(E);else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&v.indexOf(this.stringify.convertCDataKey)===0)p=this.cdata(E);else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&v.indexOf(this.stringify.convertCommentKey)===0)p=this.comment(E);else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&v.indexOf(this.stringify.convertRawKey)===0)p=this.raw(E);else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&v.indexOf(this.stringify.convertPIKey)===0)p=this.instruction(v.substr(this.stringify.convertPIKey.length),E);else p=this.node(v,V,E);if(p==null)throw Error("Could not create any elements with: "+v+". "+this.debugInfo());return p}insertBefore(v,V,E){var S,R,x,I,B;if(v!=null?v.type:void 0){if(x=v,I=V,x.setParent(this),I)R=children.indexOf(I),B=children.splice(R),children.push(x),Array.prototype.push.apply(children,B);else children.push(x);return x}else{if(this.isRoot)throw Error("Cannot insert elements at root level. "+this.debugInfo(v));return R=this.parent.children.indexOf(this),B=this.parent.children.splice(R),S=this.parent.element(v,V,E),Array.prototype.push.apply(this.parent.children,B),S}}insertAfter(v,V,E){var S,R,x;if(this.isRoot)throw Error("Cannot insert elements at root level. "+this.debugInfo(v));return R=this.parent.children.indexOf(this),x=this.parent.children.splice(R+1),S=this.parent.element(v,V,E),Array.prototype.push.apply(this.parent.children,x),S}remove(){var v,V;if(this.isRoot)throw Error("Cannot remove the root element. "+this.debugInfo());return v=this.parent.children.indexOf(this),Z.apply(this.parent.children,[v,v-v+1].concat(V=[])),this.parent}node(v,V,E){var S;if(v!=null)v=P(v);if(V||(V={}),V=P(V),!f(V))[E,V]=[V,E];if(S=new O(this,v,V),E!=null)S.text(E);return this.children.push(S),S}text(v){var V;if(f(v))this.element(v);return V=new X(this,v),this.children.push(V),this}cdata(v){var V=new _(this,v);return this.children.push(V),this}comment(v){var V=new z(this,v);return this.children.push(V),this}commentBefore(v){var V,E,S;return E=this.parent.children.indexOf(this),S=this.parent.children.splice(E),V=this.parent.comment(v),Array.prototype.push.apply(this.parent.children,S),this}commentAfter(v){var V,E,S;return E=this.parent.children.indexOf(this),S=this.parent.children.splice(E+1),V=this.parent.comment(v),Array.prototype.push.apply(this.parent.children,S),this}raw(v){var V=new M(this,v);return this.children.push(V),this}dummy(){var v=new A(this);return v}instruction(v,V){var E,S,R,x,I;if(v!=null)v=P(v);if(V!=null)V=P(V);if(Array.isArray(v))for(x=0,I=v.length;x<I;x++)E=v[x],this.instruction(E);else if(f(v))for(E in v){if(!G.call(v,E))continue;S=v[E],this.instruction(E,S)}else{if(D(V))V=V.apply();R=new J(this,v,V),this.children.push(R)}return this}instructionBefore(v,V){var E,S,R;return S=this.parent.children.indexOf(this),R=this.parent.children.splice(S),E=this.parent.instruction(v,V),Array.prototype.push.apply(this.parent.children,R),this}instructionAfter(v,V){var E,S,R;return S=this.parent.children.indexOf(this),R=this.parent.children.splice(S+1),E=this.parent.instruction(v,V),Array.prototype.push.apply(this.parent.children,R),this}declaration(v,V,E){var S,R;if(S=this.document(),R=new Y(S,v,V,E),S.children.length===0)S.children.unshift(R);else if(S.children[0].type===K.Declaration)S.children[0]=R;else S.children.unshift(R);return S.root()||S}dtd(v,V){var E,S,R,x,I,B,p,C,g,F;S=this.document(),R=new $(S,v,V),g=S.children;for(x=I=0,p=g.length;I<p;x=++I)if(E=g[x],E.type===K.DocType)return S.children[x]=R,R;F=S.children;for(x=B=0,C=F.length;B<C;x=++B)if(E=F[x],E.isRoot)return S.children.splice(x,0,R),R;return S.children.push(R),R}up(){if(this.isRoot)throw Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent}root(){var v=this;while(v)if(v.type===K.Document)return v.rootObject;else if(v.isRoot)return v;else v=v.parent}document(){var v=this;while(v)if(v.type===K.Document)return v;else v=v.parent}end(v){return this.document().end(v)}prev(){var v=this.parent.children.indexOf(this);if(v<1)throw Error("Already at the first node. "+this.debugInfo());return this.parent.children[v-1]}next(){var v=this.parent.children.indexOf(this);if(v===-1||v===this.parent.children.length-1)throw Error("Already at the last node. "+this.debugInfo());return this.parent.children[v+1]}importDocument(v){var V,E,S,R,x;if(E=v.root().clone(),E.parent=this,E.isRoot=!1,this.children.push(E),this.type===K.Document){if(E.isRoot=!0,E.documentObject=this,this.rootObject=E,this.children){x=this.children;for(S=0,R=x.length;S<R;S++)if(V=x[S],V.type===K.DocType){V.name=E.name;break}}}return this}debugInfo(v){var V,E;if(v=v||this.name,v==null&&!((V=this.parent)!=null?V.name:void 0))return"";else if(v==null)return"parent: <"+this.parent.name+">";else if(!((E=this.parent)!=null?E.name:void 0))return"node: <"+v+">";else return"node: <"+v+">, parent: <"+this.parent.name+">"}ele(v,V,E){return this.element(v,V,E)}nod(v,V,E){return this.node(v,V,E)}txt(v){return this.text(v)}dat(v){return this.cdata(v)}com(v){return this.comment(v)}ins(v,V){return this.instruction(v,V)}doc(){return this.document()}dec(v,V,E){return this.declaration(v,V,E)}e(v,V,E){return this.element(v,V,E)}n(v,V,E){return this.node(v,V,E)}t(v){return this.text(v)}d(v){return this.cdata(v)}c(v){return this.comment(v)}r(v){return this.raw(v)}i(v,V){return this.instruction(v,V)}u(){return this.up()}importXMLBuilder(v){return this.importDocument(v)}attribute(v,V){throw Error("attribute() applies to element nodes only.")}att(v,V){return this.attribute(v,V)}a(v,V){return this.attribute(v,V)}removeAttribute(v){throw Error("attribute() applies to element nodes only.")}replaceChild(v,V){throw Error("This DOM method is not implemented."+this.debugInfo())}removeChild(v){throw Error("This DOM method is not implemented."+this.debugInfo())}appendChild(v){throw Error("This DOM method is not implemented."+this.debugInfo())}hasChildNodes(){return this.children.length!==0}cloneNode(v){throw Error("This DOM method is not implemented."+this.debugInfo())}normalize(){throw Error("This DOM method is not implemented."+this.debugInfo())}isSupported(v,V){return!0}hasAttributes(){return this.attribs.length!==0}compareDocumentPosition(v){var V,E;if(V=this,V===v)return 0;else if(this.document()!==v.document()){if(E=q.Disconnected|q.ImplementationSpecific,Math.random()<0.5)E|=q.Preceding;else E|=q.Following;return E}else if(V.isAncestor(v))return q.Contains|q.Preceding;else if(V.isDescendant(v))return q.Contains|q.Following;else if(V.isPreceding(v))return q.Preceding;else return q.Following}isSameNode(v){throw Error("This DOM method is not implemented."+this.debugInfo())}lookupPrefix(v){throw Error("This DOM method is not implemented."+this.debugInfo())}isDefaultNamespace(v){throw Error("This DOM method is not implemented."+this.debugInfo())}lookupNamespaceURI(v){throw Error("This DOM method is not implemented."+this.debugInfo())}isEqualNode(v){var V,E,S;if(v.nodeType!==this.nodeType)return!1;if(v.children.length!==this.children.length)return!1;for(V=E=0,S=this.children.length-1;0<=S?E<=S:E>=S;V=0<=S?++E:--E)if(!this.children[V].isEqualNode(v.children[V]))return!1;return!0}getFeature(v,V){throw Error("This DOM method is not implemented."+this.debugInfo())}setUserData(v,V,E){throw Error("This DOM method is not implemented."+this.debugInfo())}getUserData(v){throw Error("This DOM method is not implemented."+this.debugInfo())}contains(v){if(!v)return!1;return v===this||this.isDescendant(v)}isDescendant(v){var V,E,S,R,x;x=this.children;for(S=0,R=x.length;S<R;S++){if(V=x[S],v===V)return!0;if(E=V.isDescendant(v),E)return!0}return!1}isAncestor(v){return v.isDescendant(this)}isPreceding(v){var V,E;if(V=this.treePosition(v),E=this.treePosition(this),V===-1||E===-1)return!1;else return V<E}isFollowing(v){var V,E;if(V=this.treePosition(v),E=this.treePosition(this),V===-1||E===-1)return!1;else return V>E}treePosition(v){var V,E;if(E=0,V=!1,this.foreachTreeNode(this.document(),function(S){if(E++,!V&&S===v)return V=!0}),V)return E;else return-1}foreachTreeNode(v,V){var E,S,R,x,I;v||(v=this.document()),x=v.children;for(S=0,R=x.length;S<R;S++)if(E=x[S],I=V(E))return I;else if(I=this.foreachTreeNode(E,V),I)return I}}return Object.defineProperty(T.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(T.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(T.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(T.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(T.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes)this.childNodeList=new H(this.children);return this.childNodeList}}),Object.defineProperty(T.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(T.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(T.prototype,"previousSibling",{get:function(){var v=this.parent.children.indexOf(this);return this.parent.children[v-1]||null}}),Object.defineProperty(T.prototype,"nextSibling",{get:function(){var v=this.parent.children.indexOf(this);return this.parent.children[v+1]||null}}),Object.defineProperty(T.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(T.prototype,"textContent",{get:function(){var v,V,E,S,R;if(this.nodeType===K.Element||this.nodeType===K.DocumentFragment){R="",S=this.children;for(V=0,E=S.length;V<E;V++)if(v=S[V],v.textContent)R+=v.textContent;return R}else return null},set:function(v){throw Error("This DOM method is not implemented."+this.debugInfo())}}),T}.call(this)}).call(p8K)});var bn1=m((g8K,F8K)=>{(function(){var q,K={}.hasOwnProperty;F8K.exports=q=function(){class _{constructor(z){var Y,$,A;if(this.assertLegalChar=this.assertLegalChar.bind(this),this.assertLegalName=this.assertLegalName.bind(this),z||(z={}),this.options=z,!this.options.version)this.options.version="1.0";$=z.stringify||{};for(Y in $){if(!K.call($,Y))continue;A=$[Y],this[Y]=A}}name(z){if(this.options.noValidation)return z;return this.assertLegalName(""+z||"")}text(z){if(this.options.noValidation)return z;return this.assertLegalChar(this.textEscape(""+z||""))}cdata(z){if(this.options.noValidation)return z;return z=""+z||"",z=z.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(z)}comment(z){if(this.options.noValidation)return z;if(z=""+z||"",z.match(/--/))throw Error("Comment text cannot contain double-hypen: "+z);return this.assertLegalChar(z)}raw(z){if(this.options.noValidation)return z;return""+z||""}attValue(z){if(this.options.noValidation)return z;return this.assertLegalChar(this.attEscape(z=""+z||""))}insTarget(z){if(this.options.noValidation)return z;return this.assertLegalChar(""+z||"")}insValue(z){if(this.options.noValidation)return z;if(z=""+z||"",z.match(/\?>/))throw Error("Invalid processing instruction value: "+z);return this.assertLegalChar(z)}xmlVersion(z){if(this.options.noValidation)return z;if(z=""+z||"",!z.match(/1\.[0-9]+/))throw Error("Invalid version number: "+z);return z}xmlEncoding(z){if(this.options.noValidation)return z;if(z=""+z||"",!z.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw Error("Invalid encoding: "+z);return this.assertLegalChar(z)}xmlStandalone(z){if(this.options.noValidation)return z;if(z)return"yes";else return"no"}dtdPubID(z){if(this.options.noValidation)return z;return this.assertLegalChar(""+z||"")}dtdSysID(z){if(this.options.noValidation)return z;return this.assertLegalChar(""+z||"")}dtdElementValue(z){if(this.options.noValidation)return z;return this.assertLegalChar(""+z||"")}dtdAttType(z){if(this.options.noValidation)return z;return this.assertLegalChar(""+z||"")}dtdAttDefault(z){if(this.options.noValidation)return z;return this.assertLegalChar(""+z||"")}dtdEntityValue(z){if(this.options.noValidation)return z;return this.assertLegalChar(""+z||"")}dtdNData(z){if(this.options.noValidation)return z;return this.assertLegalChar(""+z||"")}assertLegalChar(z){var Y,$;if(this.options.noValidation)return z;if(this.options.version==="1.0"){if(Y=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,this.options.invalidCharReplacement!==void 0)z=z.replace(Y,this.options.invalidCharReplacement);else if($=z.match(Y))throw Error(`Invalid character in string: ${z} at index ${$.index}`)}else if(this.options.version==="1.1"){if(Y=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,this.options.invalidCharReplacement!==void 0)z=z.replace(Y,this.options.invalidCharReplacement);else if($=z.match(Y))throw Error(`Invalid character in string: ${z} at index ${$.index}`)}return z}assertLegalName(z){var Y;if(this.options.noValidation)return z;if(z=this.assertLegalChar(z),Y=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!z.match(Y))throw Error(`Invalid character in name: ${z}`);return z}textEscape(z){var Y;if(this.options.noValidation)return z;return Y=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g,z.replace(Y,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
")}attEscape(z){var Y;if(this.options.noValidation)return z;return Y=this.options.noDoubleEncoding?/(?!&(lt|gt|amp|apos|quot);)&/g:/&/g,z.replace(Y,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
")}}return _.prototype.convertAttKey="@",_.prototype.convertPIKey="?",_.prototype.convertTextKey="#text",_.prototype.convertCDataKey="#cdata",_.prototype.convertCommentKey="#comment",_.prototype.convertRawKey="#raw",_}.call(this)}).call(g8K)});var st6=m((U8K,Q8K)=>{(function(){Q8K.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(U8K)});var xn1=m((d8K,c8K)=>{(function(){var q,K,_,z,Y,$,A,O,w,j,H,J,M,X,P,W,D,f={}.hasOwnProperty;({assign:D}=fQ()),q=kM(),w=_C8(),j=OC8(),_=qC8(),z=KC8(),J=eS8(),X=wC8(),P=jC8(),M=HC8(),H=Cn1(),Y=zC8(),$=$C8(),A=YC8(),O=AC8(),K=st6(),c8K.exports=W=class{constructor(Z){var T,v,V;Z||(Z={}),this.options=Z,v=Z.writer||{};for(T in v){if(!f.call(v,T))continue;V=v[T],this["_"+T]=this[T],this[T]=V}}filterOptions(Z){var T,v,V,E,S,R,x,I,B;if(Z||(Z={}),Z=D({},this.options,Z),T={writer:this},T.pretty=Z.pretty||!1,T.allowEmpty=Z.allowEmpty||!1,T.indent=(v=Z.indent)!=null?v:" ",T.newline=(V=Z.newline)!=null?V:` |
| 2162 | `,T.offset=(E=Z.offset)!=null?E:0,T.width=(S=Z.width)!=null?S:0,T.dontPrettyTextNodes=(R=(x=Z.dontPrettyTextNodes)!=null?x:Z.dontprettytextnodes)!=null?R:0,T.spaceBeforeSlash=(I=(B=Z.spaceBeforeSlash)!=null?B:Z.spacebeforeslash)!=null?I:"",T.spaceBeforeSlash===!0)T.spaceBeforeSlash=" ";return T.suppressPrettyCount=0,T.user={},T.state=K.None,T}indent(Z,T,v){var V;if(!T.pretty||T.suppressPrettyCount)return"";else if(T.pretty){if(V=(v||0)+T.offset+1,V>0)return Array(V).join(T.indent)}return""}endline(Z,T,v){if(!T.pretty||T.suppressPrettyCount)return"";else return T.newline}attribute(Z,T,v){var V;if(this.openAttribute(Z,T,v),T.pretty&&T.width>0)V=Z.name+'="'+Z.value+'"';else V=" "+Z.name+'="'+Z.value+'"';return this.closeAttribute(Z,T,v),V}cdata(Z,T,v){var V;return this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v)+"<![CDATA[",T.state=K.InsideTag,V+=Z.value,T.state=K.CloseTag,V+="]]>"+this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}comment(Z,T,v){var V;return this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v)+"<!-- ",T.state=K.InsideTag,V+=Z.value,T.state=K.CloseTag,V+=" -->"+this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}declaration(Z,T,v){var V;if(this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v)+"<?xml",T.state=K.InsideTag,V+=' version="'+Z.version+'"',Z.encoding!=null)V+=' encoding="'+Z.encoding+'"';if(Z.standalone!=null)V+=' standalone="'+Z.standalone+'"';return T.state=K.CloseTag,V+=T.spaceBeforeSlash+"?>",V+=this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}docType(Z,T,v){var V,E,S,R,x;if(v||(v=0),this.openNode(Z,T,v),T.state=K.OpenTag,R=this.indent(Z,T,v),R+="<!DOCTYPE "+Z.root().name,Z.pubID&&Z.sysID)R+=' PUBLIC "'+Z.pubID+'" "'+Z.sysID+'"';else if(Z.sysID)R+=' SYSTEM "'+Z.sysID+'"';if(Z.children.length>0){R+=" [",R+=this.endline(Z,T,v),T.state=K.InsideTag,x=Z.children;for(E=0,S=x.length;E<S;E++)V=x[E],R+=this.writeChildNode(V,T,v+1);T.state=K.CloseTag,R+="]"}return T.state=K.CloseTag,R+=T.spaceBeforeSlash+">",R+=this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),R}element(Z,T,v){var V,E,S,R,x,I,B,p,C,g,F,U,c,K6,t,q6,e,i,$6;if(v||(v=0),U=!1,this.openNode(Z,T,v),T.state=K.OpenTag,c=this.indent(Z,T,v)+"<"+Z.name,T.pretty&&T.width>0){p=c.length,t=Z.attribs;for(F in t){if(!f.call(t,F))continue;if(V=t[F],K6=this.attribute(V,T,v),E=K6.length,p+E>T.width)$6=this.indent(Z,T,v+1)+K6,c+=this.endline(Z,T,v)+$6,p=$6.length;else $6=" "+K6,c+=$6,p+=$6.length}}else{q6=Z.attribs;for(F in q6){if(!f.call(q6,F))continue;V=q6[F],c+=this.attribute(V,T,v)}}if(R=Z.children.length,x=R===0?null:Z.children[0],R===0||Z.children.every(function(M6){return(M6.type===q.Text||M6.type===q.Raw||M6.type===q.CData)&&M6.value===""}))if(T.allowEmpty)c+=">",T.state=K.CloseTag,c+="</"+Z.name+">"+this.endline(Z,T,v);else T.state=K.CloseTag,c+=T.spaceBeforeSlash+"/>"+this.endline(Z,T,v);else if(T.pretty&&R===1&&(x.type===q.Text||x.type===q.Raw||x.type===q.CData)&&x.value!=null)c+=">",T.state=K.InsideTag,T.suppressPrettyCount++,U=!0,c+=this.writeChildNode(x,T,v+1),T.suppressPrettyCount--,U=!1,T.state=K.CloseTag,c+="</"+Z.name+">"+this.endline(Z,T,v);else{if(T.dontPrettyTextNodes){e=Z.children;for(I=0,C=e.length;I<C;I++)if(S=e[I],(S.type===q.Text||S.type===q.Raw||S.type===q.CData)&&S.value!=null){T.suppressPrettyCount++,U=!0;break}}c+=">"+this.endline(Z,T,v),T.state=K.InsideTag,i=Z.children;for(B=0,g=i.length;B<g;B++)S=i[B],c+=this.writeChildNode(S,T,v+1);if(T.state=K.CloseTag,c+=this.indent(Z,T,v)+"</"+Z.name+">",U)T.suppressPrettyCount--;c+=this.endline(Z,T,v),T.state=K.None}return this.closeNode(Z,T,v),c}writeChildNode(Z,T,v){switch(Z.type){case q.CData:return this.cdata(Z,T,v);case q.Comment:return this.comment(Z,T,v);case q.Element:return this.element(Z,T,v);case q.Raw:return this.raw(Z,T,v);case q.Text:return this.text(Z,T,v);case q.ProcessingInstruction:return this.processingInstruction(Z,T,v);case q.Dummy:return"";case q.Declaration:return this.declaration(Z,T,v);case q.DocType:return this.docType(Z,T,v);case q.AttributeDeclaration:return this.dtdAttList(Z,T,v);case q.ElementDeclaration:return this.dtdElement(Z,T,v);case q.EntityDeclaration:return this.dtdEntity(Z,T,v);case q.NotationDeclaration:return this.dtdNotation(Z,T,v);default:throw Error("Unknown XML node type: "+Z.constructor.name)}}processingInstruction(Z,T,v){var V;if(this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v)+"<?",T.state=K.InsideTag,V+=Z.target,Z.value)V+=" "+Z.value;return T.state=K.CloseTag,V+=T.spaceBeforeSlash+"?>",V+=this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}raw(Z,T,v){var V;return this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v),T.state=K.InsideTag,V+=Z.value,T.state=K.CloseTag,V+=this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}text(Z,T,v){var V;return this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v),T.state=K.InsideTag,V+=Z.value,T.state=K.CloseTag,V+=this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}dtdAttList(Z,T,v){var V;if(this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v)+"<!ATTLIST",T.state=K.InsideTag,V+=" "+Z.elementName+" "+Z.attributeName+" "+Z.attributeType,Z.defaultValueType!=="#DEFAULT")V+=" "+Z.defaultValueType;if(Z.defaultValue)V+=' "'+Z.defaultValue+'"';return T.state=K.CloseTag,V+=T.spaceBeforeSlash+">"+this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}dtdElement(Z,T,v){var V;return this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v)+"<!ELEMENT",T.state=K.InsideTag,V+=" "+Z.name+" "+Z.value,T.state=K.CloseTag,V+=T.spaceBeforeSlash+">"+this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}dtdEntity(Z,T,v){var V;if(this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v)+"<!ENTITY",T.state=K.InsideTag,Z.pe)V+=" %";if(V+=" "+Z.name,Z.value)V+=' "'+Z.value+'"';else{if(Z.pubID&&Z.sysID)V+=' PUBLIC "'+Z.pubID+'" "'+Z.sysID+'"';else if(Z.sysID)V+=' SYSTEM "'+Z.sysID+'"';if(Z.nData)V+=" NDATA "+Z.nData}return T.state=K.CloseTag,V+=T.spaceBeforeSlash+">"+this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}dtdNotation(Z,T,v){var V;if(this.openNode(Z,T,v),T.state=K.OpenTag,V=this.indent(Z,T,v)+"<!NOTATION",T.state=K.InsideTag,V+=" "+Z.name,Z.pubID&&Z.sysID)V+=' PUBLIC "'+Z.pubID+'" "'+Z.sysID+'"';else if(Z.pubID)V+=' PUBLIC "'+Z.pubID+'"';else if(Z.sysID)V+=' SYSTEM "'+Z.sysID+'"';return T.state=K.CloseTag,V+=T.spaceBeforeSlash+">"+this.endline(Z,T,v),T.state=K.None,this.closeNode(Z,T,v),V}openNode(Z,T,v){}closeNode(Z,T,v){}openAttribute(Z,T,v){}closeAttribute(Z,T,v){}}}).call(d8K)});var JC8=m((l8K,n8K)=>{(function(){var q,K;K=xn1(),n8K.exports=q=class extends K{constructor(z){super(z)}document(z,Y){var $,A,O,w,j;Y=this.filterOptions(Y),w="",j=z.children;for(A=0,O=j.length;A<O;A++)$=j[A],w+=this.writeChildNode($,Y,0);if(Y.pretty&&w.slice(-Y.newline.length)===Y.newline)w=w.slice(0,-Y.newline.length);return w}}}).call(l8K)});var In1=m((i8K,r8K)=>{(function(){var q,K,_,z,Y,$,A,O;({isPlainObject:O}=fQ()),_=hn1(),K=a6K(),Y=lL(),q=kM(),A=bn1(),$=JC8(),r8K.exports=z=function(){class w extends Y{constructor(j){super(null);if(this.name="#document",this.type=q.Document,this.documentURI=null,this.domConfig=new K,j||(j={}),!j.writer)j.writer=new $;this.options=j,this.stringify=new A(j)}end(j){var H={};if(!j)j=this.options.writer;else if(O(j))H=j,j=this.options.writer;return j.document(this,j.filterOptions(H))}toString(j){return this.options.writer.document(this,this.options.writer.filterOptions(j))}createElement(j){throw Error("This DOM method is not implemented."+this.debugInfo())}createDocumentFragment(){throw Error("This DOM method is not implemented."+this.debugInfo())}createTextNode(j){throw Error("This DOM method is not implemented."+this.debugInfo())}createComment(j){throw Error("This DOM method is not implemented."+this.debugInfo())}createCDATASection(j){throw Error("This DOM method is not implemented."+this.debugInfo())}createProcessingInstruction(j,H){throw Error("This DOM method is not implemented."+this.debugInfo())}createAttribute(j){throw Error("This DOM method is not implemented."+this.debugInfo())}createEntityReference(j){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagName(j){throw Error("This DOM method is not implemented."+this.debugInfo())}importNode(j,H){throw Error("This DOM method is not implemented."+this.debugInfo())}createElementNS(j,H){throw Error("This DOM method is not implemented."+this.debugInfo())}createAttributeNS(j,H){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByTagNameNS(j,H){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementById(j){throw Error("This DOM method is not implemented."+this.debugInfo())}adoptNode(j){throw Error("This DOM method is not implemented."+this.debugInfo())}normalizeDocument(){throw Error("This DOM method is not implemented."+this.debugInfo())}renameNode(j,H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}getElementsByClassName(j){throw Error("This DOM method is not implemented."+this.debugInfo())}createEvent(j){throw Error("This DOM method is not implemented."+this.debugInfo())}createRange(){throw Error("This DOM method is not implemented."+this.debugInfo())}createNodeIterator(j,H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}createTreeWalker(j,H,J){throw Error("This DOM method is not implemented."+this.debugInfo())}}return Object.defineProperty(w.prototype,"implementation",{value:new _}),Object.defineProperty(w.prototype,"doctype",{get:function(){var j,H,J,M;M=this.children;for(H=0,J=M.length;H<J;H++)if(j=M[H],j.type===q.DocType)return j;return null}}),Object.defineProperty(w.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(w.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(w.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(w.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===q.Declaration)return this.children[0].encoding;else return null}}),Object.defineProperty(w.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===q.Declaration)return this.children[0].standalone==="yes";else return!1}}),Object.defineProperty(w.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===q.Declaration)return this.children[0].version;else return"1.0"}}),Object.defineProperty(w.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(w.prototype,"origin",{get:function(){return null}}),Object.defineProperty(w.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(w.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(w.prototype,"contentType",{get:function(){return null}}),w}.call(this)}).call(i8K)});var s8K=m((o8K,a8K)=>{(function(){var q,K,_,z,Y,$,A,O,w,j,H,J,M,X,P,W,D,f,G,Z,T,v,V,E={}.hasOwnProperty;({isObject:v,isFunction:T,isPlainObject:V,getValue:Z}=fQ()),q=kM(),J=In1(),X=eS8(),z=qC8(),Y=KC8(),W=wC8(),G=jC8(),P=HC8(),j=_C8(),H=OC8(),$=zC8(),O=YC8(),A=$C8(),w=AC8(),_=Sn1(),f=bn1(),D=JC8(),K=st6(),a8K.exports=M=class{constructor(R,x,I){var B;if(this.name="?xml",this.type=q.Document,R||(R={}),B={},!R.writer)R.writer=new D;else if(V(R.writer))B=R.writer,R.writer=new D;this.options=R,this.writer=R.writer,this.writerOptions=this.writer.filterOptions(B),this.stringify=new f(R),this.onDataCallback=x||function(){},this.onEndCallback=I||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}createChildNode(R){var x,I,B,p,C,g,F,U;switch(R.type){case q.CData:this.cdata(R.value);break;case q.Comment:this.comment(R.value);break;case q.Element:B={},F=R.attribs;for(I in F){if(!E.call(F,I))continue;x=F[I],B[I]=x.value}this.node(R.name,B);break;case q.Dummy:this.dummy();break;case q.Raw:this.raw(R.value);break;case q.Text:this.text(R.value);break;case q.ProcessingInstruction:this.instruction(R.target,R.value);break;default:throw Error("This XML node type is not supported in a JS object: "+R.constructor.name)}U=R.children;for(C=0,g=U.length;C<g;C++)if(p=U[C],this.createChildNode(p),p.type===q.Element)this.up();return this}dummy(){return this}node(R,x,I){if(R==null)throw Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw Error("Document can only have one root node. "+this.debugInfo(R));if(this.openCurrent(),R=Z(R),x==null)x={};if(x=Z(x),!v(x))[I,x]=[x,I];if(this.currentNode=new X(this,R,x),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,I!=null)this.text(I);return this}element(R,x,I){var B,p,C,g,F,U;if(this.currentNode&&this.currentNode.type===q.DocType)this.dtdElement(...arguments);else if(Array.isArray(R)||v(R)||T(R)){g=this.options.noValidation,this.options.noValidation=!0,U=new J(this.options).element("TEMP_ROOT"),U.element(R),this.options.noValidation=g,F=U.children;for(p=0,C=F.length;p<C;p++)if(B=F[p],this.createChildNode(B),B.type===q.Element)this.up()}else this.node(R,x,I);return this}attribute(R,x){var I,B;if(!this.currentNode||this.currentNode.children)throw Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(R));if(R!=null)R=Z(R);if(v(R))for(I in R){if(!E.call(R,I))continue;B=R[I],this.attribute(I,B)}else{if(T(x))x=x.apply();if(this.options.keepNullAttributes&&x==null)this.currentNode.attribs[R]=new _(this,R,"");else if(x!=null)this.currentNode.attribs[R]=new _(this,R,x)}return this}text(R){var x;return this.openCurrent(),x=new G(this,R),this.onData(this.writer.text(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}cdata(R){var x;return this.openCurrent(),x=new z(this,R),this.onData(this.writer.cdata(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}comment(R){var x;return this.openCurrent(),x=new Y(this,R),this.onData(this.writer.comment(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}raw(R){var x;return this.openCurrent(),x=new W(this,R),this.onData(this.writer.raw(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}instruction(R,x){var I,B,p,C,g;if(this.openCurrent(),R!=null)R=Z(R);if(x!=null)x=Z(x);if(Array.isArray(R))for(I=0,C=R.length;I<C;I++)B=R[I],this.instruction(B);else if(v(R))for(B in R){if(!E.call(R,B))continue;p=R[B],this.instruction(B,p)}else{if(T(x))x=x.apply();g=new P(this,R,x),this.onData(this.writer.processingInstruction(g,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this}declaration(R,x,I){var B;if(this.openCurrent(),this.documentStarted)throw Error("declaration() must be the first node.");return B=new j(this,R,x,I),this.onData(this.writer.declaration(B,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}doctype(R,x,I){if(this.openCurrent(),R==null)throw Error("Missing root node name.");if(this.root)throw Error("dtd() must come before the root node.");return this.currentNode=new H(this,x,I),this.currentNode.rootNodeName=R,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this}dtdElement(R,x){var I;return this.openCurrent(),I=new A(this,R,x),this.onData(this.writer.dtdElement(I,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}attList(R,x,I,B,p){var C;return this.openCurrent(),C=new $(this,R,x,I,B,p),this.onData(this.writer.dtdAttList(C,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}entity(R,x){var I;return this.openCurrent(),I=new O(this,!1,R,x),this.onData(this.writer.dtdEntity(I,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}pEntity(R,x){var I;return this.openCurrent(),I=new O(this,!0,R,x),this.onData(this.writer.dtdEntity(I,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}notation(R,x){var I;return this.openCurrent(),I=new w(this,R,x),this.onData(this.writer.dtdNotation(I,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this}up(){if(this.currentLevel<0)throw Error("The document node has no parent.");if(this.currentNode){if(this.currentNode.children)this.closeNode(this.currentNode);else this.openNode(this.currentNode);this.currentNode=null}else this.closeNode(this.openTags[this.currentLevel]);return delete this.openTags[this.currentLevel],this.currentLevel--,this}end(){while(this.currentLevel>=0)this.up();return this.onEnd()}openCurrent(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)}openNode(R){var x,I,B,p;if(!R.isOpen){if(!this.root&&this.currentLevel===0&&R.type===q.Element)this.root=R;if(I="",R.type===q.Element){this.writerOptions.state=K.OpenTag,I=this.writer.indent(R,this.writerOptions,this.currentLevel)+"<"+R.name,p=R.attribs;for(B in p){if(!E.call(p,B))continue;x=p[B],I+=this.writer.attribute(x,this.writerOptions,this.currentLevel)}I+=(R.children?">":"/>")+this.writer.endline(R,this.writerOptions,this.currentLevel),this.writerOptions.state=K.InsideTag}else{if(this.writerOptions.state=K.OpenTag,I=this.writer.indent(R,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+R.rootNodeName,R.pubID&&R.sysID)I+=' PUBLIC "'+R.pubID+'" "'+R.sysID+'"';else if(R.sysID)I+=' SYSTEM "'+R.sysID+'"';if(R.children)I+=" [",this.writerOptions.state=K.InsideTag;else this.writerOptions.state=K.CloseTag,I+=">";I+=this.writer.endline(R,this.writerOptions,this.currentLevel)}return this.onData(I,this.currentLevel),R.isOpen=!0}}closeNode(R){var x;if(!R.isClosed){if(x="",this.writerOptions.state=K.CloseTag,R.type===q.Element)x=this.writer.indent(R,this.writerOptions,this.currentLevel)+"</"+R.name+">"+this.writer.endline(R,this.writerOptions,this.currentLevel);else x=this.writer.indent(R,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(R,this.writerOptions,this.currentLevel);return this.writerOptions.state=K.None,this.onData(x,this.currentLevel),R.isClosed=!0}}onData(R,x){return this.documentStarted=!0,this.onDataCallback(R,x+1)}onEnd(){return this.documentCompleted=!0,this.onEndCallback()}debugInfo(R){if(R==null)return"";else return"node: <"+R+">"}ele(){return this.element(...arguments)}nod(R,x,I){return this.node(R,x,I)}txt(R){return this.text(R)}dat(R){return this.cdata(R)}com(R){return this.comment(R)}ins(R,x){return this.instruction(R,x)}dec(R,x,I){return this.declaration(R,x,I)}dtd(R,x,I){return this.doctype(R,x,I)}e(R,x,I){return this.element(R,x,I)}n(R,x,I){return this.node(R,x,I)}t(R){return this.text(R)}d(R){return this.cdata(R)}c(R){return this.comment(R)}r(R){return this.raw(R)}i(R,x){return this.instruction(R,x)}att(){if(this.currentNode&&this.currentNode.type===q.DocType)return this.attList(...arguments);else return this.attribute(...arguments)}a(){if(this.currentNode&&this.currentNode.type===q.DocType)return this.attList(...arguments);else return this.attribute(...arguments)}ent(R,x){return this.entity(R,x)}pent(R,x){return this.pEntity(R,x)}not(R,x){return this.notation(R,x)}}}).call(o8K)});var q1K=m((t8K,e8K)=>{(function(){var q,K,_,z,Y={}.hasOwnProperty;q=kM(),z=xn1(),K=st6(),e8K.exports=_=class extends z{constructor(A,O){super(O);this.stream=A}endline(A,O,w){if(A.isLastRootNode&&O.state===K.CloseTag)return"";else return super.endline(A,O,w)}document(A,O){var w,j,H,J,M,X,P,W,D;P=A.children;for(j=H=0,M=P.length;H<M;j=++H)w=P[j],w.isLastRootNode=j===A.children.length-1;O=this.filterOptions(O),W=A.children,D=[];for(J=0,X=W.length;J<X;J++)w=W[J],D.push(this.writeChildNode(w,O,0));return D}cdata(A,O,w){return this.stream.write(super.cdata(A,O,w))}comment(A,O,w){return this.stream.write(super.comment(A,O,w))}declaration(A,O,w){return this.stream.write(super.declaration(A,O,w))}docType(A,O,w){var j,H,J,M;if(w||(w=0),this.openNode(A,O,w),O.state=K.OpenTag,this.stream.write(this.indent(A,O,w)),this.stream.write("<!DOCTYPE "+A.root().name),A.pubID&&A.sysID)this.stream.write(' PUBLIC "'+A.pubID+'" "'+A.sysID+'"');else if(A.sysID)this.stream.write(' SYSTEM "'+A.sysID+'"');if(A.children.length>0){this.stream.write(" ["),this.stream.write(this.endline(A,O,w)),O.state=K.InsideTag,M=A.children;for(H=0,J=M.length;H<J;H++)j=M[H],this.writeChildNode(j,O,w+1);O.state=K.CloseTag,this.stream.write("]")}return O.state=K.CloseTag,this.stream.write(O.spaceBeforeSlash+">"),this.stream.write(this.endline(A,O,w)),O.state=K.None,this.closeNode(A,O,w)}element(A,O,w){var j,H,J,M,X,P,W,D,f,G,Z,T,v,V,E,S;if(w||(w=0),this.openNode(A,O,w),O.state=K.OpenTag,Z=this.indent(A,O,w)+"<"+A.name,O.pretty&&O.width>0){W=Z.length,v=A.attribs;for(f in v){if(!Y.call(v,f))continue;if(j=v[f],T=this.attribute(j,O,w),H=T.length,W+H>O.width)S=this.indent(A,O,w+1)+T,Z+=this.endline(A,O,w)+S,W=S.length;else S=" "+T,Z+=S,W+=S.length}}else{V=A.attribs;for(f in V){if(!Y.call(V,f))continue;j=V[f],Z+=this.attribute(j,O,w)}}if(this.stream.write(Z),M=A.children.length,X=M===0?null:A.children[0],M===0||A.children.every(function(R){return(R.type===q.Text||R.type===q.Raw||R.type===q.CData)&&R.value===""}))if(O.allowEmpty)this.stream.write(">"),O.state=K.CloseTag,this.stream.write("</"+A.name+">");else O.state=K.CloseTag,this.stream.write(O.spaceBeforeSlash+"/>");else if(O.pretty&&M===1&&(X.type===q.Text||X.type===q.Raw||X.type===q.CData)&&X.value!=null)this.stream.write(">"),O.state=K.InsideTag,O.suppressPrettyCount++,G=!0,this.writeChildNode(X,O,w+1),O.suppressPrettyCount--,G=!1,O.state=K.CloseTag,this.stream.write("</"+A.name+">");else{this.stream.write(">"+this.endline(A,O,w)),O.state=K.InsideTag,E=A.children;for(P=0,D=E.length;P<D;P++)J=E[P],this.writeChildNode(J,O,w+1);O.state=K.CloseTag,this.stream.write(this.indent(A,O,w)+"</"+A.name+">")}return this.stream.write(this.endline(A,O,w)),O.state=K.None,this.closeNode(A,O,w)}processingInstruction(A,O,w){return this.stream.write(super.processingInstruction(A,O,w))}raw(A,O,w){return this.stream.write(super.raw(A,O,w))}text(A,O,w){return this.stream.write(super.text(A,O,w))}dtdAttList(A,O,w){return this.stream.write(super.dtdAttList(A,O,w))}dtdElement(A,O,w){return this.stream.write(super.dtdElement(A,O,w))}dtdEntity(A,O,w){return this.stream.write(super.dtdEntity(A,O,w))}dtdNotation(A,O,w){return this.stream.write(super.dtdNotation(A,O,w))}}}).call(t8K)});var _1K=m((K1K,g46)=>{(function(){var q,K,_,z,Y,$,A,O,w;({assign:O,isFunction:w}=fQ()),_=hn1(),z=In1(),Y=s8K(),A=JC8(),$=q1K(),q=kM(),K=st6(),K1K.create=function(j,H,J,M){var X,P;if(j==null)throw Error("Root element needs a name.");if(M=O({},H,J,M),X=new z(M),P=X.element(j),!M.headless){if(X.declaration(M),M.pubID!=null||M.sysID!=null)X.dtd(M)}return P},K1K.begin=function(j,H,J){if(w(j))[H,J]=[j,H],j={};if(H)return new Y(j,H,J);else return new z(j)},K1K.stringWriter=function(j){return new A(j)},K1K.streamWriter=function(j,H){return new $(j,H)},K1K.implementation=new _,K1K.nodeType=q,K1K.writerState=K}).call(K1K)});var $1K=m((Mmz)=>{var z1K=FG1(),wmz=_1K();Mmz.build=Jmz;function jmz(q){function K(_){return _<10?"0"+_:_}return q.getUTCFullYear()+"-"+K(q.getUTCMonth()+1)+"-"+K(q.getUTCDate())+"T"+K(q.getUTCHours())+":"+K(q.getUTCMinutes())+":"+K(q.getUTCSeconds())+"Z"}var Hmz=Object.prototype.toString;function Y1K(q){var K=Hmz.call(q).match(/\[object (.*)\]/);return K?K[1]:K}function Jmz(q,K){var _={version:"1.0",encoding:"UTF-8"},z={pubid:"-//Apple//DTD PLIST 1.0//EN",sysid:"http://www.apple.com/DTDs/PropertyList-1.0.dtd"},Y=wmz.create("plist");if(Y.dec(_.version,_.encoding,_.standalone),Y.dtd(z.pubid,z.sysid),Y.att("version","1.0"),un1(q,Y),!K)K={};return K.pretty=K.pretty!==!1,Y.end(K)}function un1(q,K){var _,z,Y,$=Y1K(q);if($=="Undefined")return;else if(Array.isArray(q)){K=K.ele("array");for(z=0;z<q.length;z++)un1(q[z],K)}else if(Buffer.isBuffer(q))K.ele("data").raw(q.toString("base64"));else if($=="Object"){K=K.ele("dict");for(Y in q)if(q.hasOwnProperty(Y))K.ele("key").txt(Y),un1(q[Y],K)}else if($=="Number")_=q%1===0?"integer":"real",K.ele(_).txt(q.toString());else if($=="BigInt")K.ele("integer").txt(q);else if($=="Date")K.ele("date").txt(jmz(new Date(q)));else if($=="Boolean")K.ele(q?"true":"false");else if($=="String")K.ele("string").txt(q);else if($=="ArrayBuffer")K.ele("data").raw(z1K.fromByteArray(q));else if(q&&q.buffer&&Y1K(q.buffer)=="ArrayBuffer")K.ele("data").raw(z1K.fromByteArray(new Uint8Array(q.buffer),K));else if($==="Null")K.ele("null").txt("")}});var w1K=m((mn1)=>{var A1K=B6K();Object.keys(A1K).forEach(function(q){mn1[q]=A1K[q]});var O1K=$1K();Object.keys(O1K).forEach(function(q){mn1[q]=O1K[q]})});async function ZQ(q,K){let z=j8().preferredNotifChannel;await bU(q);let Y=await Pmz(z,q,K);d("tengu_notification_method_used",{configured_channel:z,method_used:Y,term:a1.terminal})}async function Pmz(q,K,_){let z=K.title||j1K;try{switch(q){case"auto":return Wmz(K,_);case"iterm2":return _.notifyITerm2(K),"iterm2";case"iterm2_with_bell":return _.notifyITerm2(K),_.notifyBell(),"iterm2_with_bell";case"kitty":return _.notifyKitty({...K,title:z,id:H1K()}),"kitty";case"ghostty":return _.notifyGhostty({...K,title:z}),"ghostty";case"terminal_bell":return _.notifyBell(),"terminal_bell";case"notifications_disabled":return"disabled";default:return"none"}}catch{return"error"}}async function Wmz(q,K){let _=q.title||j1K;switch(a1.terminal){case"Apple_Terminal":{if(await Dmz())return K.notifyBell(),"terminal_bell";return"no_method_available"}case"iTerm.app":return K.notifyITerm2(q),"iterm2";case"kitty":return K.notifyKitty({...q,title:_,id:H1K()}),"kitty";case"ghostty":return K.notifyGhostty({...q,title:_}),"ghostty";default:return"no_method_available"}}function H1K(){return Math.floor(Math.random()*1e4)}async function Dmz(){try{if(a1.terminal!=="Apple_Terminal")return!1;let K=(await a8("osascript",["-e",'tell application "Terminal" to name of current settings of front window'])).stdout.trim();if(!K)return!1;let _=await a8("defaults",["export","com.apple.Terminal","-"]);if(_.code!==0)return!1;let A=(await Promise.resolve().then(() => O6(w1K(),1))).parse(_.stdout)?.["Window Settings"]?.[K];if(!A)return!1;return A.Bell===!1}catch(q){return H6(q),!1}}var j1K="Claude Code";var tt6=y(()=>{V1();y_();XK();y$();E8();k8()});function F46(){let q=new Date,K=String(q.getHours()).padStart(2,"0"),_=String(q.getMinutes()).padStart(2,"0"),z=String(q.getSeconds()).padStart(2,"0");return`${K}:${_}:${z}`}function U46(q,K){return`${ap1(void 0,K)}/code?bridge=${q}`}function X1K(q,K,_){return`${MM(q,_)}?bridge=${K}`}function P1K(q,K){let _=K+20;return K+10-q%_}function W1K(q,K){let _=O1(q),z=K-1,Y=K+1;if(z>=_||Y<0)return{before:q,shimmer:"",after:""};let $=Math.max(0,z),A=0,O="",w="",j="";for(let{segment:H}of YH().segment(q)){let J=O1(H);if(A+J<=$)O+=H;else if(A>Y)j+=H;else w+=H;A+=J}return{before:O,shimmer:w,after:j}}function MC8({error:q,connected:K,sessionActive:_,reconnecting:z}){if(q)return{label:"Remote Control failed",color:"error"};if(z)return{label:"Remote Control reconnecting",color:"warning"};if(_||K)return{label:"Remote Control active",color:"success"};return{label:"Remote Control connecting…",color:"warning"}}function XC8(q){return`Code everywhere with the Claude app or ${q}`}function PC8(q){return`Continue coding in the Claude app or ${q}`}function D1K(q,K){return`\x1B]8;;${K}\x07${q}\x1B]8;;\x07`}var J1K=30000,M1K=150,WC8="Something went wrong, please try again";var Q46=y(()=>{Q5();U7();mk()});function Gmz(q,K){return q+fmz(Zmz()*(K-q+1))}var fmz,Zmz,f1K;var Z1K=y(()=>{fmz=Math.floor,Zmz=Math.random;f1K=Gmz});function Tmz(q){var K=q.length;return K?q[f1K(0,K-1)]:void 0}var DC8;var pn1=y(()=>{Z1K();DC8=Tmz});function vmz(q,K){return St(K,function(_){return q[_]})}var G1K;var T1K=y(()=>{hb6();G1K=vmz});function kmz(q){return q==null?[]:G1K(q,nR(q))}var v1K;var k1K=y(()=>{T1K();p36();v1K=kmz});function Vmz(q){return DC8(v1K(q))}var V1K;var N1K=y(()=>{pn1();k1K();V1K=Vmz});function Nmz(q){var K=MA(q)?DC8:V1K;return K(q)}var IX;var po=y(()=>{pn1();N1K();yT();IX=Nmz});class GQ{activeOperations=new Set;lastUserActivityTime=0;lastCLIRecordedTime;isCLIActive=!1;USER_ACTIVITY_TIMEOUT_MS=5000;getNow;getActiveTimeCounter;static instance=null;constructor(q){this.getNow=q?.getNow??(()=>Date.now()),this.getActiveTimeCounter=q?.getActiveTimeCounter??Ji8,this.lastCLIRecordedTime=this.getNow()}static getInstance(){if(!GQ.instance)GQ.instance=new GQ;return GQ.instance}static resetInstance(){GQ.instance=null}static createInstance(q){return GQ.instance=new GQ(q),GQ.instance}recordUserActivity(){if(!this.isCLIActive&&this.lastUserActivityTime!==0){let K=(this.getNow()-this.lastUserActivityTime)/1000;if(K>0){let _=this.getActiveTimeCounter();if(_){let z=this.USER_ACTIVITY_TIMEOUT_MS/1000;if(K<z)_.add(K,{type:"user"})}}}this.lastUserActivityTime=this.getNow()}startCLIActivity(q){if(this.activeOperations.has(q))this.endCLIActivity(q);let K=this.activeOperations.size===0;if(this.activeOperations.add(q),K)this.isCLIActive=!0,this.lastCLIRecordedTime=this.getNow()}endCLIActivity(q){if(this.activeOperations.delete(q),this.activeOperations.size===0){let K=this.getNow(),_=(K-this.lastCLIRecordedTime)/1000;if(_>0){let z=this.getActiveTimeCounter();if(z)z.add(_,{type:"cli"})}this.lastCLIRecordedTime=K,this.isCLIActive=!1}}async trackOperation(q,K){this.startCLIActivity(q);try{return await K()}finally{this.endCLIActivity(q)}}getActivityStates(){return{isUserActive:(this.getNow()-this.lastUserActivityTime)/1000<this.USER_ACTIVITY_TIMEOUT_MS/1000,isCLIActive:this.isCLIActive,activeOperationCount:this.activeOperations.size}}}var B26;var Bn1=y(()=>{v8();B26=GQ.getInstance()});function g26(){let K=N7().spinnerVerbs;if(!K)return gn1;if(K.mode==="replace")return K.verbs.length>0?K.verbs:gn1;return[...gn1,...K.verbs]}var gn1;var fC8=y(()=>{U1();gn1=["Accomplishing","Actioning","Actualizing","Architecting","Baking","Beaming","Beboppin'","Befuddling","Billowing","Blanching","Bloviating","Boogieing","Boondoggling","Booping","Bootstrapping","Brewing","Bunning","Burrowing","Calculating","Canoodling","Caramelizing","Cascading","Catapulting","Cerebrating","Channeling","Channelling","Choreographing","Churning","Clauding","Coalescing","Cogitating","Combobulating","Composing","Computing","Concocting","Considering","Contemplating","Cooking","Crafting","Creating","Crunching","Crystallizing","Cultivating","Deciphering","Deliberating","Determining","Dilly-dallying","Discombobulating","Doing","Doodling","Drizzling","Ebbing","Effecting","Elucidating","Embellishing","Enchanting","Envisioning","Evaporating","Fermenting","Fiddle-faddling","Finagling","Flambéing","Flibbertigibbeting","Flowing","Flummoxing","Fluttering","Forging","Forming","Frolicking","Frosting","Gallivanting","Galloping","Garnishing","Generating","Gesticulating","Germinating","Gitifying","Grooving","Gusting","Harmonizing","Hashing","Hatching","Herding","Honking","Hullaballooing","Hyperspacing","Ideating","Imagining","Improvising","Incubating","Inferring","Infusing","Ionizing","Jitterbugging","Julienning","Kneading","Leavening","Levitating","Lollygagging","Manifesting","Marinating","Meandering","Metamorphosing","Misting","Moonwalking","Moseying","Mulling","Mustering","Musing","Nebulizing","Nesting","Newspapering","Noodling","Nucleating","Orbiting","Orchestrating","Osmosing","Perambulating","Percolating","Perusing","Philosophising","Photosynthesizing","Pollinating","Pondering","Pontificating","Pouncing","Precipitating","Prestidigitating","Processing","Proofing","Propagating","Puttering","Puzzling","Quantumizing","Razzle-dazzling","Razzmatazzing","Recombobulating","Reticulating","Roosting","Ruminating","Sautéing","Scampering","Schlepping","Scurrying","Seasoning","Shenaniganing","Shimmying","Simmering","Skedaddling","Sketching","Slithering","Smooshing","Sock-hopping","Spelunking","Spinning","Sprouting","Stewing","Sublimating","Swirling","Swooping","Symbioting","Synthesizing","Tempering","Thinking","Thundering","Tinkering","Tomfoolering","Topsy-turvying","Transfiguring","Transmuting","Twisting","Undulating","Unfurling","Unravelling","Vibing","Waddling","Wandering","Warping","Whatchamacalliting","Whirlpooling","Whirring","Whisking","Wibbling","Working","Wrangling","Zesting","Zigzagging"]});function xH(q){return typeof q==="object"&&q!==null&&"type"in q&&q.type==="in_process_teammate"}function F26(q,K){if(q===void 0||q.length===0)return[K];if(q.length>=y1K){let _=q.slice(-(y1K-1));return _.push(K),_}return[...q,K]}var y1K=50;import{mkdir as ymz,readdir as Fn1,readFile as E1K,unlink as L1K,writeFile as ZC8}from"fs/promises";import{join as qe6}from"path";function h1K(q){if(et6===q)return;et6=q,d46()}function S1K(){if(et6===void 0)return;et6=void 0,d46()}function d46(){try{R1K.emit()}catch{}}function b1K(q){return qe6(Ob(q),Lmz)}async function Un1(q){let K=b1K(q);try{let _=(await E1K(K,"utf-8")).trim(),z=parseInt(_,10);return isNaN(z)?0:z}catch{return 0}}async function x1K(q,K){let _=b1K(q);await ZC8(_,String(K))}function IH(){if(i6(process.env.CLAUDE_CODE_ENABLE_TASKS))return!0;return!i7()}async function GC8(q){let K=Ob(q),_=await dn1(q),z;try{z=await PJ(_,Ke6);let Y=await I1K(q);if(Y>0){let A=await Un1(q);if(Y>A)await x1K(q,Y)}let $;try{$=await Fn1(K)}catch{$=[]}for(let A of $)if(A.endsWith(".json")&&!A.startsWith(".")){let O=qe6(K,A);try{await L1K(O)}catch{}}d46()}finally{if(z)await z()}}function cG(){if(process.env.CLAUDE_CODE_TASK_LIST_ID)return process.env.CLAUDE_CODE_TASK_LIST_ID;let q=VP();if(q)return q.teamName;return $9()||et6||N8()}function zE6(q){return q.replace(/[^a-zA-Z0-9_-]/g,"-")}function Ob(q){return qe6(c1(),"tasks",zE6(q))}function YE6(q,K){return qe6(Ob(q),`${zE6(K)}.json`)}async function TC8(q){let K=Ob(q);try{await ymz(K,{recursive:!0})}catch{}}async function I1K(q){let K=Ob(q),_;try{_=await Fn1(K)}catch{return 0}let z=0;for(let Y of _){if(!Y.endsWith(".json"))continue;let $=parseInt(Y.replace(".json",""),10);if(!isNaN($)&&$>z)z=$}return z}async function Rmz(q){let[K,_]=await Promise.all([I1K(q),Un1(q)]);return Math.max(K,_)}async function u1K(q,K){let _=await dn1(q),z;try{z=await PJ(_,Ke6);let Y=await Rmz(q),$=String(Y+1),A={id:$,...K},O=YE6(q,$);return await ZC8(O,g6(A,null,2)),d46(),$}finally{if(z)await z()}}async function Cm(q,K){let _=YE6(q,K);try{let z=await E1K(_,"utf-8"),Y=r8(z),$=Emz().safeParse(Y);if(!$.success)return N(`[Tasks] Task ${K} failed schema validation: ${$.error.message}`),null;return $.data}catch(z){if(s1(z)==="ENOENT")return null;return N(`[Tasks] Failed to read task ${K}: ${d6(z)}`),H6(z),null}}async function m1K(q,K,_){let z=await Cm(q,K);if(!z)return null;let Y={...z,..._,id:K},$=YE6(q,K);return await ZC8($,g6(Y,null,2)),d46(),Y}async function TQ(q,K,_){let z=YE6(q,K);if(!await Cm(q,K))return null;let $;try{return $=await PJ(z,Ke6),await m1K(q,K,_)}finally{await $?.()}}async function vC8(q,K){let _=YE6(q,K);try{let z=parseInt(K,10);if(!isNaN(z)){let $=await Un1(q);if(z>$)await x1K(q,z)}try{await L1K(_)}catch($){if(s1($)==="ENOENT")return!1;throw $}let Y=await LD(q);for(let $ of Y){let A=$.blocks.filter((w)=>w!==K),O=$.blockedBy.filter((w)=>w!==K);if(A.length!==$.blocks.length||O.length!==$.blockedBy.length)await TQ(q,$.id,{blocks:A,blockedBy:O})}return d46(),!0}catch{return!1}}async function LD(q){let K=Ob(q),_;try{_=await Fn1(K)}catch{return[]}let z=_.filter(($)=>$.endsWith(".json")).map(($)=>$.replace(".json",""));return(await Promise.all(z.map(($)=>Cm(q,$)))).filter(($)=>$!==null)}async function Qn1(q,K,_){let[z,Y]=await Promise.all([Cm(q,K),Cm(q,_)]);if(!z||!Y)return!1;if(!z.blocks.includes(_))await TQ(q,K,{blocks:[...z.blocks,_]});if(!Y.blockedBy.includes(K))await TQ(q,_,{blockedBy:[...Y.blockedBy,K]});return!0}function hmz(q){return qe6(Ob(q),".lock")}async function dn1(q){await TC8(q);let K=hmz(q);try{await ZC8(K,"",{flag:"wx"})}catch{}return K}async function cn1(q,K,_,z={}){let Y=YE6(q,K);if(!await Cm(q,K))return{success:!1,reason:"task_not_found"};if(z.checkAgentBusy)return Smz(q,K,_);let A;try{A=await PJ(Y,Ke6);let O=await Cm(q,K);if(!O)return{success:!1,reason:"task_not_found"};if(O.owner&&O.owner!==_)return{success:!1,reason:"already_claimed",task:O};if(O.status==="completed")return{success:!1,reason:"already_resolved",task:O};let w=await LD(q),j=new Set(w.filter((M)=>M.status!=="completed").map((M)=>M.id)),H=O.blockedBy.filter((M)=>j.has(M));if(H.length>0)return{success:!1,reason:"blocked",task:O,blockedByTasks:H};return{success:!0,task:await m1K(q,K,{owner:_})}}catch(O){return N(`[Tasks] Failed to claim task ${K}: ${d6(O)}`),H6(O),{success:!1,reason:"task_not_found"}}finally{if(A)await A()}}async function Smz(q,K,_){let z=await dn1(q),Y;try{Y=await PJ(z,Ke6);let $=await LD(q),A=$.find((J)=>J.id===K);if(!A)return{success:!1,reason:"task_not_found"};if(A.owner&&A.owner!==_)return{success:!1,reason:"already_claimed",task:A};if(A.status==="completed")return{success:!1,reason:"already_resolved",task:A};let O=new Set($.filter((J)=>J.status!=="completed").map((J)=>J.id)),w=A.blockedBy.filter((J)=>O.has(J));if(w.length>0)return{success:!1,reason:"blocked",task:A,blockedByTasks:w};let j=$.filter((J)=>J.status!=="completed"&&J.owner===_&&J.id!==K);if(j.length>0)return{success:!1,reason:"agent_busy",task:A,busyWithTasks:j.map((J)=>J.id)};return{success:!0,task:await TQ(q,K,{owner:_})}}catch($){return N(`[Tasks] Failed to claim task ${K} with busy check: ${d6($)}`),H6($),{success:!1,reason:"task_not_found"}}finally{if(Y)await Y()}}async function c46(q,K,_,z){let $=(await LD(q)).filter((w)=>w.status!=="completed"&&(w.owner===K||w.owner===_));for(let w of $)await TQ(q,w.id,{owner:void 0,status:"pending"});if($.length>0)N(`[Tasks] Unassigned ${$.length} task(s) from ${_}`);let O=`${_} ${z==="terminated"?"was terminated":"has shut down"}.`;if($.length>0){let w=$.map((j)=>`#${j.id} "${j.subject}"`).join(", ");O+=` ${$.length} task(s) were unassigned: ${w}. Use TaskList to check availability and TaskUpdate with owner to reassign them to idle teammates.`}return{unassignedTasks:$.map((w)=>({id:w.id,subject:w.subject})),notificationMessage:O}}var R1K,et6,C1K,U26,Emz,Lmz=".highwatermark",Ke6,ln1="tasklist";var gj=y(()=>{x7();v8();_8();m8();y8();E8();l8();AY();JG();R1K=Dz();C1K=R1K.subscribe;U26=B6(()=>L.enum(["pending","in_progress","completed"])),Emz=B6(()=>L.object({id:L.string(),subject:L.string(),description:L.string(),activeForm:L.string().optional(),owner:L.string().optional(),status:U26(),blocks:L.array(L.string()),blockedBy:L.array(L.string()),metadata:L.record(L.string(),L.unknown()).optional()})),Ke6={retries:{retries:30,minTimeout:5,maxTimeout:100}}});function _e6(q,K){let _=parseInt(q.id,10),z=parseInt(K.id,10);if(!isNaN(_)&&!isNaN(z))return _-z;return q.id.localeCompare(K.id)}function kC8({tasks:q,isStandalone:K=!1}){let _=P8((S)=>S.teamContext),z=P8((S)=>S.tasks),[,Y]=j5.useState(0),{rows:$,columns:A}=t1(),O=j5.useRef(new Map),w=j5.useRef(null);if(w.current===null)w.current=new Set(q.filter((S)=>S.status==="completed").map((S)=>S.id));let j=$<=10?0:Math.min(10,Math.max(3,$-14)),H=new Set(q.filter((S)=>S.status==="completed").map((S)=>S.id)),J=Date.now();for(let S of H)if(!w.current.has(S))O.current.set(S,J);for(let S of O.current.keys())if(!H.has(S))O.current.delete(S);if(w.current=H,j5.useEffect(()=>{if(O.current.size===0)return;let S=Date.now(),R=1/0;for(let I of O.current.values()){let B=I+p1K;if(B>S&&B<R)R=B}if(R===1/0)return;let x=setTimeout((I)=>I((B)=>B+1),R-S,Y);return()=>clearTimeout(x)},[q]),!IH())return null;if(q.length===0)return null;let M={};if(nq()&&_?.teammates){for(let S of Object.values(_.teammates))if(S.color){let R=vX[S.color];if(R)M[S.name]=R}}let X={},P=new Set;if(nq()){for(let S of Object.values(z))if(xH(S)&&S.status==="running"){P.add(S.identity.agentName),P.add(S.identity.agentId);let R=S.progress?.recentActivities,x=(R&&$E6(R))??S.progress?.lastActivity?.activityDescription;if(x)X[S.identity.agentName]=x,X[S.identity.agentId]=x}}let W=$7(q,(S)=>S.status==="completed"),D=$7(q,(S)=>S.status==="pending"),f=q.length-W-D,G=new Set(q.filter((S)=>S.status!=="completed").map((S)=>S.id)),Z=q.length>j,T,v;if(Z){let S=[],R=[];for(let p of q.filter((C)=>C.status==="completed")){let C=O.current.get(p.id);if(C&&J-C<p1K)S.push(p);else R.push(p)}S.sort(_e6),R.sort(_e6);let x=q.filter((p)=>p.status==="in_progress").sort(_e6),I=q.filter((p)=>p.status==="pending").sort((p,C)=>{let g=p.blockedBy.some((U)=>G.has(U)),F=C.blockedBy.some((U)=>G.has(U));if(g!==F)return g?1:-1;return _e6(p,C)}),B=[...S,...x,...I,...R];T=B.slice(0,j),v=B.slice(j)}else T=[...q].sort(_e6),v=[];let V="";if(v.length>0){let S=[],R=$7(v,(B)=>B.status==="pending"),x=$7(v,(B)=>B.status==="in_progress"),I=$7(v,(B)=>B.status==="completed");if(x>0)S.push(`${x} in progress`);if(R>0)S.push(`${R} pending`);if(I>0)S.push(`${I} completed`);V=` … +${S.join(", ")}`}let E=j5.createElement(j5.Fragment,null,T.map((S)=>j5.createElement(bmz,{key:S.id,task:S,ownerColor:S.owner?M[S.owner]:void 0,openBlockers:S.blockedBy.filter((R)=>G.has(R)),activity:S.owner?X[S.owner]:void 0,ownerActive:S.owner?P.has(S.owner):!1,columns:A})),j>0&&V&&j5.createElement(k,{dimColor:!0},V));if(K)return j5.createElement(u,{flexDirection:"column",marginTop:1,marginLeft:2},j5.createElement(u,null,j5.createElement(k,{dimColor:!0},j5.createElement(k,{bold:!0},q.length)," tasks (",j5.createElement(k,{bold:!0},W)," done, ",f>0&&j5.createElement(j5.Fragment,null,j5.createElement(k,{bold:!0},f)," in progress, "),j5.createElement(k,{bold:!0},D)," open)")),E);return j5.createElement(u,{flexDirection:"column"},E)}function Cmz(q){switch(q){case"completed":return{icon:t6.tick,color:"success"};case"in_progress":return{icon:t6.squareSmallFilled,color:"claude"};case"pending":return{icon:t6.squareSmall,color:void 0}}}function bmz(q){let K=z6(37),{task:_,ownerColor:z,openBlockers:Y,activity:$,ownerActive:A,columns:O}=q,w=_.status==="completed",j=_.status==="in_progress",H=Y.length>0,J;if(K[0]!==_.status)J=Cmz(_.status),K[0]=_.status,K[1]=J;else J=K[1];let{icon:M,color:X}=J,P=j&&!H&&$,W=O>=60&&_.owner&&A,D;if(K[2]!==W||K[3]!==_.owner)D=W?O1(` (@${_.owner})`):0,K[2]=W,K[3]=_.owner,K[4]=D;else D=K[4];let f=D,G=Math.max(15,O-15-f),Z;if(K[5]!==G||K[6]!==_.subject)Z=T4(_.subject,G),K[5]=G,K[6]=_.subject,K[7]=Z;else Z=K[7];let T=Z,v=Math.max(15,O-15),V;if(K[8]!==$||K[9]!==v)V=$?T4($,v):void 0,K[8]=$,K[9]=v,K[10]=V;else V=K[10];let E=V,S;if(K[11]!==X||K[12]!==M)S=j5.createElement(k,{color:X},M," "),K[11]=X,K[12]=M,K[13]=S;else S=K[13];let R=w||H,x;if(K[14]!==T||K[15]!==w||K[16]!==j||K[17]!==R)x=j5.createElement(k,{bold:j,strikethrough:w,dimColor:R},T),K[14]=T,K[15]=w,K[16]=j,K[17]=R,K[18]=x;else x=K[18];let I;if(K[19]!==z||K[20]!==W||K[21]!==_.owner)I=W&&j5.createElement(k,{dimColor:!0}," (",z?j5.createElement(k,{color:z},"@",_.owner):`@${_.owner}`,")"),K[19]=z,K[20]=W,K[21]=_.owner,K[22]=I;else I=K[22];let B;if(K[23]!==H||K[24]!==Y)B=H&&j5.createElement(k,{dimColor:!0}," ",t6.pointerSmall," blocked by"," ",[...Y].sort(Imz).map(xmz).join(", ")),K[23]=H,K[24]=Y,K[25]=B;else B=K[25];let p;if(K[26]!==S||K[27]!==x||K[28]!==I||K[29]!==B)p=j5.createElement(u,null,S,x,I,B),K[26]=S,K[27]=x,K[28]=I,K[29]=B,K[30]=p;else p=K[30];let C;if(K[31]!==E||K[32]!==P)C=P&&E&&j5.createElement(u,null,j5.createElement(k,{dimColor:!0}," ",E,t6.ellipsis)),K[31]=E,K[32]=P,K[33]=C;else C=K[33];let g;if(K[34]!==p||K[35]!==C)g=j5.createElement(u,{flexDirection:"column"},p,C),K[34]=p,K[35]=C,K[36]=g;else g=K[36];return g}function xmz(q){return`#${q}`}function Imz(q,K){return parseInt(q,10)-parseInt(K,10)}var j5,p1K=30000;var nn1=y(()=>{q8();bq();t4();Q5();s6();C7();$0();i$();Bo();U7();gj();TA6();j5=O6(D6(),1)});import{watch as umz}from"fs";class B1K{#q=void 0;#K=!1;#_=null;#Y=null;#z=null;#O=null;#$=null;#w=null;#H=Dz();#j=0;#A=!1;getSnapshot=()=>{return this.#K?void 0:this.#q};subscribe=(q)=>{let K=this.#H.subscribe(q);if(this.#j++,!this.#A)this.#A=!0,this.#w=C1K(this.#P),this.#J();let _=!1;return()=>{if(_)return;if(_=!0,K(),this.#j--,this.#j===0)this.#G()}};#M(){this.#H.emit()}#D(q){if(q===this.#Y&&this.#_!==null)return;this.#_?.close(),this.#_=null,this.#Y=q;try{this.#_=umz(q,this.#P),this.#_.unref()}catch{}}#P=()=>{if(this.#O)clearTimeout(this.#O);this.#O=setTimeout(()=>void this.#J(),pmz),this.#O.unref()};#J=async()=>{let q=cG();this.#D(Ob(q));let K=(await LD(q)).filter((z)=>!z.metadata?._internal);this.#q=K;let _=K.some((z)=>z.status!=="completed");if(_||K.length===0)this.#K=K.length===0,this.#W();else if(this.#z===null&&!this.#K)this.#z=setTimeout(this.#f.bind(this,q),mmz),this.#z.unref();if(this.#M(),this.#$)clearTimeout(this.#$),this.#$=null;if(_)this.#$=setTimeout(this.#P,Bmz),this.#$.unref()};#f(q){this.#z=null;let K=cG();if(K!==q)return;LD(K).then(async(_)=>{if(_.length>0&&_.every((Y)=>Y.status==="completed"))await GC8(K),this.#q=[],this.#K=!0;this.#M()})}#W(){if(this.#z)clearTimeout(this.#z),this.#z=null}#G(){if(this.#_?.close(),this.#_=null,this.#Y=null,this.#w?.(),this.#w=null,this.#W(),this.#O)clearTimeout(this.#O);if(this.#$)clearTimeout(this.#$);this.#O=null,this.#$=null,this.#A=!1}}function Fmz(){return gmz??=new B1K}function ze6(){let q=P8((z)=>z.teamContext),_=IH()&&(!q||MG(q))?Fmz():null;return VC8.useSyncExternalStore(_?_.subscribe:Qmz,_?_.getSnapshot:dmz)}function g1K(){let q=ze6(),K=s7(),_=q===void 0;return VC8.useEffect(()=>{if(!_)return;K((z)=>{if(z.expandedView!=="tasks")return z;return{...z,expandedView:"none"}})},[_,K]),q}var VC8,mmz=5000,pmz=50,Bmz=5000,gmz=null,Umz=()=>{},Qmz=()=>Umz,dmz=()=>{return};var NC8=y(()=>{C7();gj();AY();VC8=O6(D6(),1)});function Ye6(){if(process.env.TERM==="xterm-ghostty")return["·","✢","✳","✶","✻","*"];return process.platform==="darwin"?["·","✢","✳","✶","✻","✽"]:["·","✢","*","✶","✻","✽"]}function bm(q,K,_){return{r:Math.round(q.r+(K.r-q.r)*_),g:Math.round(q.g+(K.g-q.g)*_),b:Math.round(q.b+(K.b-q.b)*_)}}function nL(q){return`rgb(${q.r},${q.g},${q.b})`}function yC8(q){let K=(q%360+360)%360,_=0.7,z=0.6,Y=(1-Math.abs(0.19999999999999996))*0.7,$=Y*(1-Math.abs(K/60%2-1)),A=0.6-Y/2,O=0,w=0,j=0;if(K<60)O=Y,w=$;else if(K<120)O=$,w=Y;else if(K<180)w=Y,j=$;else if(K<240)w=$,j=Y;else if(K<300)O=$,j=Y;else O=Y,j=$;return{r:Math.round((O+A)*255),g:Math.round((w+A)*255),b:Math.round((j+A)*255)}}function Q26(q){let K=F1K.get(q);if(K!==void 0)return K;let _=q.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/),z=_?{r:parseInt(_[1],10),g:parseInt(_[2],10),b:parseInt(_[3],10)}:null;return F1K.set(q,z),z}var F1K;var go=y(()=>{F1K=new Map});var cmz;var U1K=y(()=>{q8();s6();Tu();go();cmz=O6(D6(),1)});function in1(q){let K=z6(75),{message:_,mode:z,messageColor:Y,glimmerIndex:$,flashOpacity:A,shimmerColor:O,stalledIntensity:w}=q,j=w===void 0?0:w,[H]=Aq(),J,M,X;if(K[0]!==A||K[1]!==_||K[2]!==Y||K[3]!==z||K[4]!==O||K[5]!==j||K[6]!==H){X=Symbol.for("react.early_return_sentinel");q:{let x=sW(H),I;if(K[10]!==_){I=[];for(let{segment:C}of YH().segment(_))I.push({segment:C,width:O1(C)});K[10]=_,K[11]=I}else I=K[11];let B;if(K[12]!==_)B=O1(_),K[12]=_,K[13]=B;else B=K[13];let p;if(K[14]!==I||K[15]!==B)p={segments:I,messageWidth:B},K[14]=I,K[15]=B,K[16]=p;else p=K[16];if({segments:M,messageWidth:J}=p,!_){X=null;break q}if(j>0){let C=x[Y],g=C?Q26(C):null;if(g){let t=bm(g,lmz,j),q6=nL(t),e;if(K[17]!==q6)e=v5.createElement(k,{color:q6}," "),K[17]=q6,K[18]=e;else e=K[18];X=v5.createElement(v5.Fragment,null,v5.createElement(k,{color:q6},_),e);break q}let F=j>0.5?"error":Y,U;if(K[19]!==F||K[20]!==_)U=v5.createElement(k,{color:F},_),K[19]=F,K[20]=_,K[21]=U;else U=K[21];let c;if(K[22]!==F)c=v5.createElement(k,{color:F}," "),K[22]=F,K[23]=c;else c=K[23];let K6;if(K[24]!==U||K[25]!==c)K6=v5.createElement(v5.Fragment,null,U,c),K[24]=U,K[25]=c,K[26]=K6;else K6=K[26];X=K6;break q}if(z==="tool-use"){let C=x[Y],g=x[O],F=C?Q26(C):null,U=g?Q26(g):null;if(F&&U){let e=bm(F,U,A),i=v5.createElement(k,{color:nL(e)},_),$6;if(K[27]!==Y)$6=v5.createElement(k,{color:Y}," "),K[27]=Y,K[28]=$6;else $6=K[28];let M6;if(K[29]!==i||K[30]!==$6)M6=v5.createElement(v5.Fragment,null,i,$6),K[29]=i,K[30]=$6,K[31]=M6;else M6=K[31];X=M6;break q}let c=A>0.5?O:Y,K6;if(K[32]!==c||K[33]!==_)K6=v5.createElement(k,{color:c},_),K[32]=c,K[33]=_,K[34]=K6;else K6=K[34];let t;if(K[35]!==Y)t=v5.createElement(k,{color:Y}," "),K[35]=Y,K[36]=t;else t=K[36];let q6;if(K[37]!==K6||K[38]!==t)q6=v5.createElement(v5.Fragment,null,K6,t),K[37]=K6,K[38]=t,K[39]=q6;else q6=K[39];X=q6;break q}}K[0]=A,K[1]=_,K[2]=Y,K[3]=z,K[4]=O,K[5]=j,K[6]=H,K[7]=J,K[8]=M,K[9]=X}else J=K[7],M=K[8],X=K[9];if(X!==Symbol.for("react.early_return_sentinel"))return X;let P=$-1,W=$+1;if(P>=J||W<0){let x;if(K[40]!==_||K[41]!==Y)x=v5.createElement(k,{color:Y},_),K[40]=_,K[41]=Y,K[42]=x;else x=K[42];let I;if(K[43]!==Y)I=v5.createElement(k,{color:Y}," "),K[43]=Y,K[44]=I;else I=K[44];let B;if(K[45]!==x||K[46]!==I)B=v5.createElement(v5.Fragment,null,x,I),K[45]=x,K[46]=I,K[47]=B;else B=K[47];return B}let D=Math.max(0,P),f=0,G="",Z="",T="";if(K[48]!==T||K[49]!==G||K[50]!==D||K[51]!==f||K[52]!==M||K[53]!==Z||K[54]!==W){for(let{segment:x,width:I}of M){if(f+I<=D)G=G+x;else if(f>W)T=T+x;else Z=Z+x;f=f+I}K[48]=T,K[49]=G,K[50]=D,K[51]=f,K[52]=M,K[53]=Z,K[54]=W,K[55]=G,K[56]=T,K[57]=Z,K[58]=f}else G=K[55],T=K[56],Z=K[57],f=K[58];let v;if(K[59]!==G||K[60]!==Y)v=G&&v5.createElement(k,{color:Y},G),K[59]=G,K[60]=Y,K[61]=v;else v=K[61];let V;if(K[62]!==Z||K[63]!==O)V=v5.createElement(k,{color:O},Z),K[62]=Z,K[63]=O,K[64]=V;else V=K[64];let E;if(K[65]!==T||K[66]!==Y)E=T&&v5.createElement(k,{color:Y},T),K[65]=T,K[66]=Y,K[67]=E;else E=K[67];let S;if(K[68]!==Y)S=v5.createElement(k,{color:Y}," "),K[68]=Y,K[69]=S;else S=K[69];let R;if(K[70]!==v||K[71]!==V||K[72]!==E||K[73]!==S)R=v5.createElement(v5.Fragment,null,v,V,E,S),K[70]=v,K[71]=V,K[72]=E,K[73]=S,K[74]=R;else R=K[74];return R}var v5,lmz;var rn1=y(()=>{q8();Q5();s6();mk();Tu();go();v5=O6(D6(),1),lmz={r:171,g:43,b:63}});function AE6(q){let K=z6(3),{char:_,index:z,glimmerIndex:Y,messageColor:$,shimmerColor:A}=q,O=z===Y,w=Math.abs(z-Y)===1,H=O||w?A:$,J;if(K[0]!==_||K[1]!==H)J=on1.createElement(k,{color:H},_),K[0]=_,K[1]=H,K[2]=J;else J=K[2];return J}var on1;var $e6=y(()=>{q8();s6();on1=O6(D6(),1)});function Ae6(q){let K=z6(9),{frame:_,messageColor:z,stalledIntensity:Y,reducedMotion:$,time:A}=q,O=Y===void 0?0:Y,w=$===void 0?!1:$,j=A===void 0?0:A,[H]=Aq(),J=sW(H);if(w){let P=Math.floor(j/(imz/2))%2===1,W;if(K[0]!==P||K[1]!==z)W=L0.createElement(u,{flexWrap:"wrap",height:1,width:2},L0.createElement(k,{color:z,dimColor:P},nmz)),K[0]=P,K[1]=z,K[2]=W;else W=K[2];return W}let M=d1K[_%d1K.length];if(O>0){let P=J[z],W=P?Q26(P):null;if(W){let G=bm(W,rmz,O);return L0.createElement(u,{flexWrap:"wrap",height:1,width:2},L0.createElement(k,{color:nL(G)},M))}let D=O>0.5?"error":z,f;if(K[3]!==D||K[4]!==M)f=L0.createElement(u,{flexWrap:"wrap",height:1,width:2},L0.createElement(k,{color:D},M)),K[3]=D,K[4]=M,K[5]=f;else f=K[5];return f}let X;if(K[6]!==z||K[7]!==M)X=L0.createElement(u,{flexWrap:"wrap",height:1,width:2},L0.createElement(k,{color:z},M)),K[6]=z,K[7]=M,K[8]=X;else X=K[8];return X}var L0,Q1K,d1K,nmz="●",imz=2000,rmz;var EC8=y(()=>{q8();s6();Tu();go();L0=O6(D6(),1),Q1K=Ye6(),d1K=[...Q1K,...[...Q1K].reverse()],rmz={r:171,g:43,b:63}});function LC8(q,K,_){let z=q==="requesting"?50:200,[Y,$]=vH(_?null:z),A=c1K.useMemo(()=>O1(K),[K]);if(_)return[Y,-100];let O=Math.floor($/z),w=A+20;if(q==="requesting")return[Y,O%w-10];return[Y,A+10-O%w]}var c1K;var RC8=y(()=>{Q5();s6();c1K=O6(D6(),1)});function an1(q,K,_=!1,z=!1){let Y=OE6.useRef(q),$=OE6.useRef(K),A=OE6.useRef(q),O=OE6.useRef(0),w=OE6.useRef(q);if(K>$.current)Y.current=q,$.current=K,O.current=0,w.current=q;let j;if(_)j=0,Y.current=q;else if(K>0)j=q-Y.current;else j=q-A.current;let H=j>3000&&!_,J=H?Math.min((j-3000)/2000,1):0;if(!z&&(J>0||O.current>0)){let X=q-w.current;if(X>=50){let P=Math.floor(X/50),W=O.current;for(let D=0;D<P;D++){let f=J-W;if(Math.abs(f)<0.01){W=J;break}W+=f*0.1}O.current=W,w.current=q}}else O.current=J,w.current=q;let M=z?J:O.current;return{isStalled:H,stalledIntensity:M}}var OE6;var sn1=y(()=>{OE6=O6(D6(),1)});var l1K=y(()=>{U1K();rn1();$e6();EC8();RC8();sn1();go()});function R0(q){if(!q)return omz;let K=vX[q];if(K)return K;return`ansi:${q}`}var omz="cyan_FOR_SUBAGENTS_ONLY";var Fo=y(()=>{$0()});function r1K({mode:q,reducedMotion:K,hasActiveTools:_,responseLengthRef:z,message:Y,messageColor:$,shimmerColor:A,overrideColor:O,loadingStartTimeRef:w,totalPausedMsRef:j,pauseStartTimeRef:H,spinnerSuffix:J,verbose:M,columns:X,hasRunningTeammates:P,teammateTokens:W,foregroundedTeammate:D,leaderIsIdle:f=!1,thinkingStatus:G,effortSuffix:Z}){let[T,v]=vH(K?null:50),V=Date.now(),E=H.current!==null?H.current-w.current-j.current:V-w.current-j.current,S=V-E,R=Oe6.useRef(S);if(!P||S<R.current)R.current=S;let x=z.current,{isStalled:I,stalledIntensity:B}=an1(v,x,_||f,K),p=K?0:Math.floor(v/120),C=q==="requesting"?50:200,g=Oe6.useMemo(()=>O1(Y),[Y]),F=g+20,U=Math.floor(v/C),c=K?-100:I?-100:q==="requesting"?U%F-10:g+10-U%F,K6=K?0:q==="tool-use"?(Math.sin(v/1000*Math.PI)+1)/2:0,t=Oe6.useRef(x);if(K)t.current=x;else{let S6=x-t.current;if(S6>0){let E6;if(S6<70)E6=3;else if(S6<200)E6=Math.max(8,Math.ceil(S6*0.15));else E6=50;t.current=Math.min(t.current+E6,x)}}let q6=t.current,e=Math.round(q6/4),i=P?Math.max(E,V-R.current):E,$6=I5(i),M6=O1($6),j6=D&&!D.isIdle?D.progress?.tokenCount??0:e+W,G6=mK(j6),w6=P?`${G6} tokens`:`${t6.arrowDown} ${G6} tokens`,o=O1(w6),s=G==="thinking"?`thinking${Z}`:typeof G==="number"?`thought for ${Math.max(1,Math.round(G/1000))}s`:null,a=s?O1(s):0,n=g+2,l=amz,A6=G!==null,J6=M||P||i>smz,X6=X-n-5,f6=A6&&X6>a;if(!f6&&A6&&G==="thinking"&&Z){if(X6>n1K)s="thinking",a=n1K,f6=!0}let N6=f6?a+l:0,Z6=J6&&X6>N6+M6,V6=N6+(Z6?M6+l:0),y6=J6&&j6>0&&X6>V6+o,T6=f6&&G==="thinking"&&!J&&!Z6&&!y6&&!0,n6=(v-i1K)/1000,o6=v<i1K?0:(Math.sin(n6*Math.PI*2/qpz)+1)/2,I6=nL(bm(tmz,emz,o6)),C6=[...J?[g5.createElement(k,{dimColor:!0,key:"suffix"},J)]:[],...Z6?[g5.createElement(k,{dimColor:!0,key:"elapsedTime"},$6)]:[],...y6?[g5.createElement(u,{flexDirection:"row",key:"tokens"},!P&&g5.createElement(Kpz,{mode:q}),g5.createElement(k,{dimColor:!0},G6," tokens"))]:[],...f6&&s?[G==="thinking"&&!K?g5.createElement(k,{key:"thinking",color:I6},T6?`(${s})`:s):g5.createElement(k,{dimColor:!0,key:"thinking"},s)]:[]],l6=D&&!D.isIdle?g5.createElement(g5.Fragment,null,g5.createElement(k,{dimColor:!0},"(esc to interrupt "),g5.createElement(k,{color:R0(D.identity.color)},D.identity.agentName),g5.createElement(k,{dimColor:!0},")")):!D&&C6.length>0?T6?g5.createElement(I1,null,C6):g5.createElement(g5.Fragment,null,g5.createElement(k,{dimColor:!0},"("),g5.createElement(I1,null,C6),g5.createElement(k,{dimColor:!0},")")):null;return g5.createElement(u,{ref:T,flexDirection:"row",flexWrap:"wrap",marginTop:1,width:"100%"},g5.createElement(Ae6,{frame:p,messageColor:$,stalledIntensity:O?0:B,reducedMotion:K,time:v}),g5.createElement(in1,{message:Y,mode:q,messageColor:$,glimmerIndex:c,flashOpacity:K6,shimmerColor:A,stalledIntensity:O?0:B}),l6)}function Kpz(q){let K=z6(2),{mode:_}=q;switch(_){case"tool-input":case"tool-use":case"responding":case"thinking":{let z;if(K[0]===Symbol.for("react.memo_cache_sentinel"))z=g5.createElement(u,{width:2},g5.createElement(k,{dimColor:!0},t6.arrowDown)),K[0]=z;else z=K[0];return z}case"requesting":{let z;if(K[1]===Symbol.for("react.memo_cache_sentinel"))z=g5.createElement(u,{width:2},g5.createElement(k,{dimColor:!0},t6.arrowUp)),K[1]=z;else z=K[1];return z}}}var g5,Oe6,amz,n1K,smz=30000,tmz,emz,i1K=3000,qpz=2;var o1K=y(()=>{q8();bq();Q5();s6();U7();Fo();QK();rn1();EC8();sn1();go();g5=O6(D6(),1),Oe6=O6(D6(),1),amz=O1(" · "),n1K=O1("thinking"),tmz={r:153,g:153,b:153},emz={r:185,g:185,b:185}});function uH(q){if(q.status!=="running"&&q.status!=="pending")return!1;if("isBackgrounded"in q&&q.isBackgrounded===!1)return!1;return!0}var wE6;var hC8=y(()=>{wE6=["Baked","Brewed","Churned","Cogitated","Cooked","Crunched","Sautéed","Worked"]});function iL(q,K){return`${q}@${K}`}function we6(q){let K=q.indexOf("@");if(K===-1)return null;return{agentName:q.slice(0,K),teamName:q.slice(K+1)}}function jE6(q,K){let _=Date.now();return`${q}-${_}@${K}`}function d26(q){return q==="tmux"||q==="iterm2"}function JE6(){return`claude-swarm-${process.pid}`}var wz="team-lead",nN="claude-swarm",HE6="swarm-view",h0="tmux",tn1="claude-hidden",ME6="CLAUDE_CODE_TEAMMATE_COMMAND";var en1={};T8(en1,{resetDetectionCache:()=>zpz,isTmuxAvailable:()=>l46,isIt2CliAvailable:()=>Je6,isInsideTmuxSync:()=>c26,isInsideTmux:()=>xm,isInITerm2:()=>vQ,getLeaderPaneId:()=>SC8,IT2_COMMAND:()=>XE6});function c26(){return!!a1K}async function xm(){if(je6!==null)return je6;return je6=!!a1K,je6}function SC8(){return _pz||null}async function l46(){return(await a8(h0,["-V"])).code===0}function vQ(){if(He6!==null)return He6;let q=process.env.TERM_PROGRAM,K=!!process.env.ITERM_SESSION_ID,_=a1.terminal==="iTerm.app";return He6=q==="iTerm.app"||K||_,He6}async function Je6(){return(await a8(XE6,["session","list"])).code===0}function zpz(){je6=null,He6=null}var a1K,_pz,je6=null,He6=null,XE6="it2";var wb=y(()=>{y_();XK();a1K=process.env.TMUX,_pz=process.env.TMUX_PANE});var t1K,Ypz,zpO,$pz,YpO,Apz,$pO,ApO,Opz,wpz,jpz,OpO,Hpz,Jpz,Mpz,Xpz,bC8,Ppz,Wpz,Ki1,wpO,PE6,CC8,qi1,Me6,s1K,jpO,Uo,Dpz,e1K,vw,fpz,Zpz,Gpz,Tpz,vpz,kpz,Vpz,Npz,ypz,Epz,Lpz,Rpz,hpz,Spz,Cpz,bpz,xpz,Ipz,upz,mpz,ppz,Bpz,gpz,Fpz,Upz,Qpz,dpz,cpz,lpz,npz,ipz,rpz,q7K,opz,apz,spz,tpz,epz,qBz,KBz,_Bz,zBz,YBz,$Bz,ABz,OBz,wBz,jBz,HBz,JBz,HpO,MBz,JpO,MpO,_i1,zi1,K7K,_7K,XBz,z7K,XpO,PpO,WpO,PBz,WBz,DBz,s$,Y7K,Yi1,fBz,$7K,$i1,ZBz,GBz,TBz,vBz,A7K,O7K,w7K,kBz,VBz,NBz,yBz,EBz,LBz,RBz,j7K,hBz,SBz,CBz,bBz,xBz,IBz,uBz,mBz,pBz,BBz,gBz,FBz,UBz,QBz,dBz,DpO,H7K,Xe6;var Ai1=y(()=>{x7();t1K=B6(()=>L.object({inputTokens:L.number(),outputTokens:L.number(),cacheReadInputTokens:L.number(),cacheCreationInputTokens:L.number(),webSearchRequests:L.number(),costUSD:L.number(),contextWindow:L.number(),maxOutputTokens:L.number()})),Ypz=B6(()=>L.literal("json_schema")),zpO=B6(()=>L.object({type:Ypz()})),$pz=B6(()=>L.object({type:L.literal("json_schema"),schema:L.record(L.string(),L.unknown())})),YpO=B6(()=>$pz()),Apz=B6(()=>L.enum(["user","project","org","temporary","oauth"])),$pO=B6(()=>L.enum(["local","user","project"]).describe("Config scope for settings.")),ApO=B6(()=>L.literal("context-1m-2025-08-07")),Opz=B6(()=>L.object({type:L.literal("adaptive")}).describe("Claude decides when and how much to think (Opus 4.6+).")),wpz=B6(()=>L.object({type:L.literal("enabled"),budgetTokens:L.number().optional()}).describe("Fixed thinking token budget (older models)")),jpz=B6(()=>L.object({type:L.literal("disabled")}).describe("No extended thinking")),OpO=B6(()=>L.union([Opz(),wpz(),jpz()]).describe("Controls Claude's thinking/reasoning behavior. When set, takes precedence over the deprecated maxThinkingTokens.")),Hpz=B6(()=>L.object({type:L.literal("stdio").optional(),command:L.string(),args:L.array(L.string()).optional(),env:L.record(L.string(),L.string()).optional()})),Jpz=B6(()=>L.object({type:L.literal("sse"),url:L.string(),headers:L.record(L.string(),L.string()).optional()})),Mpz=B6(()=>L.object({type:L.literal("http"),url:L.string(),headers:L.record(L.string(),L.string()).optional()})),Xpz=B6(()=>L.object({type:L.literal("sdk"),name:L.string()})),bC8=B6(()=>L.union([Hpz(),Jpz(),Mpz(),Xpz()])),Ppz=B6(()=>L.object({type:L.literal("claudeai-proxy"),url:L.string(),id:L.string()})),Wpz=B6(()=>L.union([bC8(),Ppz()])),Ki1=B6(()=>L.object({name:L.string().describe("Server name as configured"),status:L.enum(["connected","failed","needs-auth","pending","disabled"]).describe("Current connection status"),serverInfo:L.object({name:L.string(),version:L.string()}).optional().describe("Server information (available when connected)"),error:L.string().optional().describe("Error message (available when status is 'failed')"),config:Wpz().optional().describe("Server configuration (includes URL for HTTP/SSE servers)"),scope:L.string().optional().describe("Configuration scope (e.g., project, user, local, claudeai, managed)"),tools:L.array(L.object({name:L.string(),description:L.string().optional(),annotations:L.object({readOnly:L.boolean().optional(),destructive:L.boolean().optional(),openWorld:L.boolean().optional()}).optional()})).optional().describe("Tools provided by this server (available when connected)"),capabilities:L.object({experimental:L.record(L.string(),L.unknown()).optional()}).optional().describe("@internal Server capabilities (available when connected). experimental['claude/channel'] is only present if the server's plugin is on the approved channels allowlist — use its presence to decide whether to show an Enable-channel prompt.")}).describe("Status information for an MCP server connection.")),wpO=B6(()=>L.object({added:L.array(L.string()).describe("Names of servers that were added"),removed:L.array(L.string()).describe("Names of servers that were removed"),errors:L.record(L.string(),L.string()).describe("Map of server names to error messages for servers that failed to connect")}).describe("Result of a setMcpServers operation.")),PE6=B6(()=>L.enum(["userSettings","projectSettings","localSettings","session","cliArg"])),CC8=B6(()=>L.enum(["allow","deny","ask"])),qi1=B6(()=>L.object({toolName:L.string(),ruleContent:L.string().optional()})),Me6=B6(()=>L.discriminatedUnion("type",[L.object({type:L.literal("addRules"),rules:L.array(qi1()),behavior:CC8(),destination:PE6()}),L.object({type:L.literal("replaceRules"),rules:L.array(qi1()),behavior:CC8(),destination:PE6()}),L.object({type:L.literal("removeRules"),rules:L.array(qi1()),behavior:CC8(),destination:PE6()}),L.object({type:L.literal("setMode"),mode:L.lazy(()=>Uo()),destination:PE6()}),L.object({type:L.literal("addDirectories"),directories:L.array(L.string()),destination:PE6()}),L.object({type:L.literal("removeDirectories"),directories:L.array(L.string()),destination:PE6()})])),s1K=B6(()=>L.enum(["user_temporary","user_permanent","user_reject"]).describe("Classification of this permission decision for telemetry. SDK hosts that prompt users (desktop apps, IDEs) should set this to reflect what actually happened: user_temporary for allow-once, user_permanent for always-allow (both the click and later cache hits), user_reject for deny. If unset, the CLI infers conservatively (temporary for allow, reject for deny). The vocabulary matches tool_decision OTel events (monitoring-usage docs).")),jpO=B6(()=>L.union([L.object({behavior:L.literal("allow"),updatedInput:L.record(L.string(),L.unknown()).optional(),updatedPermissions:L.array(Me6()).optional(),toolUseID:L.string().optional(),decisionClassification:s1K().optional()}),L.object({behavior:L.literal("deny"),message:L.string(),interrupt:L.boolean().optional(),toolUseID:L.string().optional(),decisionClassification:s1K().optional()})])),Uo=B6(()=>L.enum(["default","acceptEdits","bypassPermissions","plan","dontAsk"]).describe("Permission mode for controlling how tool executions are handled. 'default' - Standard behavior, prompts for dangerous operations. 'acceptEdits' - Auto-accept file edit operations. 'bypassPermissions' - Bypass all permission checks (requires allowDangerouslySkipPermissions). 'plan' - Planning mode, no actual tool execution. 'dontAsk' - Don't prompt for permissions, deny if not pre-approved.")),Dpz=["PreToolUse","PostToolUse","PostToolUseFailure","Notification","UserPromptSubmit","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged"],e1K=B6(()=>L.enum(Dpz)),vw=B6(()=>L.object({session_id:L.string(),transcript_path:L.string(),cwd:L.string(),permission_mode:L.string().optional(),agent_id:L.string().optional().describe("Subagent identifier. Present only when the hook fires from within a subagent (e.g., a tool called by an AgentTool worker). Absent for the main thread, even in --agent sessions. Use this field (not agent_type) to distinguish subagent calls from main-thread calls."),agent_type:L.string().optional().describe('Agent type name (e.g., "general-purpose", "code-reviewer"). Present when the hook fires from within a subagent (alongside agent_id), or on the main thread of a session started with --agent (without agent_id).')})),fpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("PreToolUse"),tool_name:L.string(),tool_input:L.unknown(),tool_use_id:L.string()}))),Zpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("PermissionRequest"),tool_name:L.string(),tool_input:L.unknown(),permission_suggestions:L.array(Me6()).optional()}))),Gpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("PostToolUse"),tool_name:L.string(),tool_input:L.unknown(),tool_response:L.unknown(),tool_use_id:L.string()}))),Tpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("PostToolUseFailure"),tool_name:L.string(),tool_input:L.unknown(),tool_use_id:L.string(),error:L.string(),is_interrupt:L.boolean().optional()}))),vpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("PermissionDenied"),tool_name:L.string(),tool_input:L.unknown(),tool_use_id:L.string(),reason:L.string()}))),kpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("Notification"),message:L.string(),title:L.string().optional(),notification_type:L.string()}))),Vpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("UserPromptSubmit"),prompt:L.string()}))),Npz=B6(()=>vw().and(L.object({hook_event_name:L.literal("SessionStart"),source:L.enum(["startup","resume","clear","compact"]),agent_type:L.string().optional(),model:L.string().optional()}))),ypz=B6(()=>vw().and(L.object({hook_event_name:L.literal("Setup"),trigger:L.enum(["init","maintenance"])}))),Epz=B6(()=>vw().and(L.object({hook_event_name:L.literal("Stop"),stop_hook_active:L.boolean(),last_assistant_message:L.string().optional().describe("Text content of the last assistant message before stopping. Avoids the need to read and parse the transcript file.")}))),Lpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("StopFailure"),error:Yi1(),error_details:L.string().optional(),last_assistant_message:L.string().optional()}))),Rpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("SubagentStart"),agent_id:L.string(),agent_type:L.string()}))),hpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("SubagentStop"),stop_hook_active:L.boolean(),agent_id:L.string(),agent_transcript_path:L.string(),agent_type:L.string(),last_assistant_message:L.string().optional().describe("Text content of the last assistant message before stopping. Avoids the need to read and parse the transcript file.")}))),Spz=B6(()=>vw().and(L.object({hook_event_name:L.literal("PreCompact"),trigger:L.enum(["manual","auto"]),custom_instructions:L.string().nullable()}))),Cpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("PostCompact"),trigger:L.enum(["manual","auto"]),compact_summary:L.string().describe("The conversation summary produced by compaction")}))),bpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("TeammateIdle"),teammate_name:L.string(),team_name:L.string()}))),xpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("TaskCreated"),task_id:L.string(),task_subject:L.string(),task_description:L.string().optional(),teammate_name:L.string().optional(),team_name:L.string().optional()}))),Ipz=B6(()=>vw().and(L.object({hook_event_name:L.literal("TaskCompleted"),task_id:L.string(),task_subject:L.string(),task_description:L.string().optional(),teammate_name:L.string().optional(),team_name:L.string().optional()}))),upz=B6(()=>vw().and(L.object({hook_event_name:L.literal("Elicitation"),mcp_server_name:L.string(),message:L.string(),mode:L.enum(["form","url"]).optional(),url:L.string().optional(),elicitation_id:L.string().optional(),requested_schema:L.record(L.string(),L.unknown()).optional()})).describe("Hook input for the Elicitation event. Fired when an MCP server requests user input. Hooks can auto-respond (accept/decline) instead of showing the dialog.")),mpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("ElicitationResult"),mcp_server_name:L.string(),elicitation_id:L.string().optional(),mode:L.enum(["form","url"]).optional(),action:L.enum(["accept","decline","cancel"]),content:L.record(L.string(),L.unknown()).optional()})).describe("Hook input for the ElicitationResult event. Fired after the user responds to an MCP elicitation. Hooks can observe or override the response before it is sent to the server.")),ppz=["user_settings","project_settings","local_settings","policy_settings","skills"],Bpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("ConfigChange"),source:L.enum(ppz),file_path:L.string().optional()}))),gpz=["session_start","nested_traversal","path_glob_match","include","compact"],Fpz=["User","Project","Local","Managed"],Upz=B6(()=>vw().and(L.object({hook_event_name:L.literal("InstructionsLoaded"),file_path:L.string(),memory_type:L.enum(Fpz),load_reason:L.enum(gpz),globs:L.array(L.string()).optional(),trigger_file_path:L.string().optional(),parent_file_path:L.string().optional()}))),Qpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("WorktreeCreate"),name:L.string()}))),dpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("WorktreeRemove"),worktree_path:L.string()}))),cpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("CwdChanged"),old_cwd:L.string(),new_cwd:L.string()}))),lpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("FileChanged"),file_path:L.string(),event:L.enum(["change","add","unlink"])}))),npz=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],ipz=B6(()=>L.enum(npz)),rpz=B6(()=>vw().and(L.object({hook_event_name:L.literal("SessionEnd"),reason:ipz()}))),q7K=B6(()=>L.union([fpz(),Gpz(),Tpz(),vpz(),kpz(),Vpz(),Npz(),rpz(),Epz(),Lpz(),Rpz(),hpz(),Spz(),Cpz(),Zpz(),ypz(),bpz(),xpz(),Ipz(),upz(),mpz(),Bpz(),Upz(),Qpz(),dpz(),cpz(),lpz()])),opz=B6(()=>L.object({async:L.literal(!0),asyncTimeout:L.number().optional()})),apz=B6(()=>L.object({hookEventName:L.literal("PreToolUse"),permissionDecision:CC8().optional(),permissionDecisionReason:L.string().optional(),updatedInput:L.record(L.string(),L.unknown()).optional(),additionalContext:L.string().optional()})),spz=B6(()=>L.object({hookEventName:L.literal("UserPromptSubmit"),additionalContext:L.string().optional()})),tpz=B6(()=>L.object({hookEventName:L.literal("SessionStart"),additionalContext:L.string().optional(),initialUserMessage:L.string().optional(),watchPaths:L.array(L.string()).optional()})),epz=B6(()=>L.object({hookEventName:L.literal("Setup"),additionalContext:L.string().optional()})),qBz=B6(()=>L.object({hookEventName:L.literal("SubagentStart"),additionalContext:L.string().optional()})),KBz=B6(()=>L.object({hookEventName:L.literal("PostToolUse"),additionalContext:L.string().optional(),updatedMCPToolOutput:L.unknown().optional()})),_Bz=B6(()=>L.object({hookEventName:L.literal("PostToolUseFailure"),additionalContext:L.string().optional()})),zBz=B6(()=>L.object({hookEventName:L.literal("PermissionDenied"),retry:L.boolean().optional()})),YBz=B6(()=>L.object({hookEventName:L.literal("Notification"),additionalContext:L.string().optional()})),$Bz=B6(()=>L.object({hookEventName:L.literal("PermissionRequest"),decision:L.union([L.object({behavior:L.literal("allow"),updatedInput:L.record(L.string(),L.unknown()).optional(),updatedPermissions:L.array(Me6()).optional()}),L.object({behavior:L.literal("deny"),message:L.string().optional(),interrupt:L.boolean().optional()})])})),ABz=B6(()=>L.object({hookEventName:L.literal("CwdChanged"),watchPaths:L.array(L.string()).optional()})),OBz=B6(()=>L.object({hookEventName:L.literal("FileChanged"),watchPaths:L.array(L.string()).optional()})),wBz=B6(()=>L.object({continue:L.boolean().optional(),suppressOutput:L.boolean().optional(),stopReason:L.string().optional(),decision:L.enum(["approve","block"]).optional(),systemMessage:L.string().optional(),reason:L.string().optional(),hookSpecificOutput:L.union([apz(),spz(),tpz(),epz(),qBz(),KBz(),_Bz(),zBz(),YBz(),$Bz(),jBz(),HBz(),ABz(),OBz(),JBz()]).optional()})),jBz=B6(()=>L.object({hookEventName:L.literal("Elicitation"),action:L.enum(["accept","decline","cancel"]).optional(),content:L.record(L.string(),L.unknown()).optional()}).describe("Hook-specific output for the Elicitation event. Return this to programmatically accept or decline an MCP elicitation request.")),HBz=B6(()=>L.object({hookEventName:L.literal("ElicitationResult"),action:L.enum(["accept","decline","cancel"]).optional(),content:L.record(L.string(),L.unknown()).optional()}).describe("Hook-specific output for the ElicitationResult event. Return this to override the action or content before the response is sent to the MCP server.")),JBz=B6(()=>L.object({hookEventName:L.literal("WorktreeCreate"),worktreePath:L.string()}).describe("Hook-specific output for the WorktreeCreate event. Provides the absolute path to the created worktree directory. Command hooks print the path on stdout instead.")),HpO=B6(()=>L.union([opz(),wBz()])),MBz=B6(()=>L.object({key:L.string().describe("Unique key for this option, returned in the response"),label:L.string().describe("Display text for this option"),description:L.string().optional().describe("Optional description shown below the label")})),JpO=B6(()=>L.object({prompt:L.string().describe("Request ID. Presence of this key marks the line as a prompt request."),message:L.string().describe("The prompt message to display to the user"),options:L.array(MBz()).describe("Available options for the user to choose from")})),MpO=B6(()=>L.object({prompt_response:L.string().describe("The request ID from the corresponding prompt request"),selected:L.string().describe("The key of the selected option")})),_i1=B6(()=>L.object({name:L.string().describe("Skill name (without the leading slash)"),description:L.string().describe("Description of what the skill does"),argumentHint:L.string().describe('Hint for skill arguments (e.g., "<file>")')}).describe("Information about an available skill (invoked via /command syntax).")),zi1=B6(()=>L.object({name:L.string().describe('Agent type identifier (e.g., "Explore")'),description:L.string().describe("Description of when to use this agent"),model:L.string().optional().describe("Model alias this agent uses. If omitted, inherits the parent's model")}).describe("Information about an available subagent that can be invoked via the Task tool.")),K7K=B6(()=>L.object({value:L.string().describe("Model identifier to use in API calls"),displayName:L.string().describe("Human-readable display name"),description:L.string().describe("Description of the model's capabilities"),supportsEffort:L.boolean().optional().describe("Whether this model supports effort levels"),supportedEffortLevels:L.array(L.enum(["low","medium","high","max"])).optional().describe("Available effort levels for this model"),supportsAdaptiveThinking:L.boolean().optional().describe("Whether this model supports adaptive thinking (Claude decides when and how much to think)"),supportsFastMode:L.boolean().optional().describe("Whether this model supports fast mode"),supportsAutoMode:L.boolean().optional().describe("Whether this model supports auto mode")}).describe("Information about an available model.")),_7K=B6(()=>L.object({email:L.string().optional(),organization:L.string().optional(),subscriptionType:L.string().optional(),tokenSource:L.string().optional(),apiKeySource:L.string().optional(),apiProvider:L.enum(["firstParty","bedrock","vertex","foundry"]).optional().describe('Active API backend. Anthropic OAuth login only applies when "firstParty"; for 3P providers the other fields are absent and auth is external (AWS creds, gcloud ADC, etc.).')}).describe("Information about the logged in user's account.")),XBz=B6(()=>L.union([L.string(),L.record(L.string(),bC8())])),z7K=B6(()=>L.object({description:L.string().describe("Natural language description of when to use this agent"),tools:L.array(L.string()).optional().describe("Array of allowed tool names. If omitted, inherits all tools from parent"),disallowedTools:L.array(L.string()).optional().describe("Array of tool names to explicitly disallow for this agent"),prompt:L.string().describe("The agent's system prompt"),model:L.string().optional().describe("Model alias (e.g. 'sonnet', 'opus', 'haiku') or full model ID (e.g. 'claude-opus-4-5'). If omitted or 'inherit', uses the main model"),mcpServers:L.array(XBz()).optional(),criticalSystemReminder_EXPERIMENTAL:L.string().optional().describe("Experimental: Critical reminder added to system prompt"),skills:L.array(L.string()).optional().describe("Array of skill names to preload into the agent context"),initialPrompt:L.string().optional().describe("Auto-submitted as the first user turn when this agent is the main thread agent. Slash commands are processed. Prepended to any user-provided prompt."),maxTurns:L.number().int().positive().optional().describe("Maximum number of agentic turns (API round-trips) before stopping"),background:L.boolean().optional().describe("Run this agent as a background task (non-blocking, fire-and-forget) when invoked"),memory:L.enum(["user","project","local"]).optional().describe("Scope for auto-loading agent memory files. 'user' - ~/.claude/agent-memory/<agentType>/, 'project' - .claude/agent-memory/<agentType>/, 'local' - .claude/agent-memory-local/<agentType>/"),effort:L.union([L.enum(["low","medium","high","max"]),L.number().int()]).optional().describe("Reasoning effort level for this agent. Either a named level or an integer"),permissionMode:Uo().optional().describe("Permission mode controlling how tool executions are handled")}).describe("Definition for a custom subagent that can be invoked via the Agent tool.")),XpO=B6(()=>L.enum(["user","project","local"]).describe("Source for loading filesystem-based settings. 'user' - Global user settings (~/.claude/settings.json). 'project' - Project settings (.claude/settings.json). 'local' - Local settings (.claude/settings.local.json).")),PpO=B6(()=>L.object({type:L.literal("local").describe("Plugin type. Currently only 'local' is supported"),path:L.string().describe("Absolute or relative path to the plugin directory")}).describe("Configuration for loading a plugin.")),WpO=B6(()=>L.object({canRewind:L.boolean(),error:L.string().optional(),filesChanged:L.array(L.string()).optional(),insertions:L.number().optional(),deletions:L.number().optional()}).describe("Result of a rewindFiles operation.")),PBz=B6(()=>L.unknown()),WBz=B6(()=>L.unknown()),DBz=B6(()=>L.unknown()),s$=B6(()=>L.string()),Y7K=B6(()=>L.unknown()),Yi1=B6(()=>L.enum(["authentication_failed","billing_error","rate_limit","invalid_request","server_error","unknown","max_output_tokens"])),fBz=B6(()=>L.union([L.literal("compacting"),L.null()])),$7K=B6(()=>L.object({type:L.literal("user"),message:PBz(),parent_tool_use_id:L.string().nullable(),isSynthetic:L.boolean().optional(),tool_use_result:L.unknown().optional(),priority:L.enum(["now","next","later"]).optional(),timestamp:L.string().optional().describe("ISO timestamp when the message was created on the originating process. Older emitters omit it; consumers should fall back to receive time.")})),$i1=B6(()=>$7K().extend({uuid:s$().optional(),session_id:L.string().optional()})),ZBz=B6(()=>$7K().extend({uuid:s$(),session_id:L.string(),isReplay:L.literal(!0)})),GBz=B6(()=>L.object({status:L.enum(["allowed","allowed_warning","rejected"]),resetsAt:L.number().optional(),rateLimitType:L.enum(["five_hour","seven_day","seven_day_opus","seven_day_sonnet","overage"]).optional(),utilization:L.number().optional(),overageStatus:L.enum(["allowed","allowed_warning","rejected"]).optional(),overageResetsAt:L.number().optional(),overageDisabledReason:L.enum(["overage_not_provisioned","org_level_disabled","org_level_disabled_until","out_of_credits","seat_tier_level_disabled","member_level_disabled","seat_tier_zero_credit_limit","group_zero_credit_limit","member_zero_credit_limit","org_service_level_disabled","org_service_zero_credit_limit","no_limits_configured","unknown"]).optional(),isUsingOverage:L.boolean().optional(),surpassedThreshold:L.number().optional()}).describe("Rate limit information for claude.ai subscription users.")),TBz=B6(()=>L.object({type:L.literal("assistant"),message:WBz(),parent_tool_use_id:L.string().nullable(),error:Yi1().optional(),uuid:s$(),session_id:L.string()})),vBz=B6(()=>L.object({type:L.literal("rate_limit_event"),rate_limit_info:GBz(),uuid:s$(),session_id:L.string()}).describe("Rate limit event emitted when rate limit info changes.")),A7K=B6(()=>L.object({type:L.literal("streamlined_text"),text:L.string().describe("Text content preserved from the assistant message"),session_id:L.string(),uuid:s$()}).describe("@internal Streamlined text message - replaces SDKAssistantMessage in streamlined output. Text content preserved, thinking and tool_use blocks removed.")),O7K=B6(()=>L.object({type:L.literal("streamlined_tool_use_summary"),tool_summary:L.string().describe('Summary of tool calls (e.g., "Read 2 files, wrote 1 file")'),session_id:L.string(),uuid:s$()}).describe("@internal Streamlined tool use summary - replaces tool_use blocks in streamlined output with a cumulative summary string.")),w7K=B6(()=>L.object({tool_name:L.string(),tool_use_id:L.string(),tool_input:L.record(L.string(),L.unknown())})),kBz=B6(()=>L.object({type:L.literal("result"),subtype:L.literal("success"),duration_ms:L.number(),duration_api_ms:L.number(),is_error:L.boolean(),num_turns:L.number(),result:L.string(),stop_reason:L.string().nullable(),total_cost_usd:L.number(),usage:Y7K(),modelUsage:L.record(L.string(),t1K()),permission_denials:L.array(w7K()),structured_output:L.unknown().optional(),fast_mode_state:Xe6().optional(),uuid:s$(),session_id:L.string()})),VBz=B6(()=>L.object({type:L.literal("result"),subtype:L.enum(["error_during_execution","error_max_turns","error_max_budget_usd","error_max_structured_output_retries"]),duration_ms:L.number(),duration_api_ms:L.number(),is_error:L.boolean(),num_turns:L.number(),stop_reason:L.string().nullable(),total_cost_usd:L.number(),usage:Y7K(),modelUsage:L.record(L.string(),t1K()),permission_denials:L.array(w7K()),errors:L.array(L.string()),fast_mode_state:Xe6().optional(),uuid:s$(),session_id:L.string()})),NBz=B6(()=>L.union([kBz(),VBz()])),yBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("init"),agents:L.array(L.string()).optional(),apiKeySource:Apz(),betas:L.array(L.string()).optional(),claude_code_version:L.string(),cwd:L.string(),tools:L.array(L.string()),mcp_servers:L.array(L.object({name:L.string(),status:L.string()})),model:L.string(),permissionMode:Uo(),slash_commands:L.array(L.string()),output_style:L.string(),skills:L.array(L.string()),plugins:L.array(L.object({name:L.string(),path:L.string(),source:L.string().optional().describe('@internal Plugin source identifier in "name\\@marketplace" format. Sentinels: "name\\@inline" for --plugin-dir, "name\\@builtin" for built-in plugins.')})),fast_mode_state:Xe6().optional(),uuid:s$(),session_id:L.string()})),EBz=B6(()=>L.object({type:L.literal("stream_event"),event:DBz(),parent_tool_use_id:L.string().nullable(),uuid:s$(),session_id:L.string()})),LBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("compact_boundary"),compact_metadata:L.object({trigger:L.enum(["manual","auto"]),pre_tokens:L.number(),preserved_segment:L.object({head_uuid:s$(),anchor_uuid:s$(),tail_uuid:s$()}).optional().describe("Relink info for messagesToKeep. Loaders splice the preserved segment at anchor_uuid (summary for suffix-preserving, boundary for prefix-preserving partial compact) so resume includes preserved content. Unset when compaction summarizes everything (no messagesToKeep).")}),uuid:s$(),session_id:L.string()})),RBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("status"),status:fBz(),permissionMode:Uo().optional(),uuid:s$(),session_id:L.string()})),j7K=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("post_turn_summary"),summarizes_uuid:L.string(),status_category:L.enum(["blocked","waiting","completed","review_ready","failed"]),status_detail:L.string(),is_noteworthy:L.boolean(),title:L.string(),description:L.string(),recent_action:L.string(),needs_action:L.string(),artifact_urls:L.array(L.string()),uuid:s$(),session_id:L.string()}).describe("@internal Background post-turn summary emitted after each assistant turn. summarizes_uuid points to the assistant message this summarizes.")),hBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("api_retry"),attempt:L.number(),max_retries:L.number(),retry_delay_ms:L.number(),error_status:L.number().nullable(),error:Yi1(),uuid:s$(),session_id:L.string()}).describe("Emitted when an API request fails with a retryable error and will be retried after a delay. error_status is null for connection errors (e.g. timeouts) that had no HTTP response.")),SBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("local_command_output"),content:L.string(),uuid:s$(),session_id:L.string()}).describe("Output from a local slash command (e.g. /voice, /cost). Displayed as assistant-style text in the transcript.")),CBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("hook_started"),hook_id:L.string(),hook_name:L.string(),hook_event:L.string(),uuid:s$(),session_id:L.string()})),bBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("hook_progress"),hook_id:L.string(),hook_name:L.string(),hook_event:L.string(),stdout:L.string(),stderr:L.string(),output:L.string(),uuid:s$(),session_id:L.string()})),xBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("hook_response"),hook_id:L.string(),hook_name:L.string(),hook_event:L.string(),output:L.string(),stdout:L.string(),stderr:L.string(),exit_code:L.number().optional(),outcome:L.enum(["success","error","cancelled"]),uuid:s$(),session_id:L.string()})),IBz=B6(()=>L.object({type:L.literal("tool_progress"),tool_use_id:L.string(),tool_name:L.string(),parent_tool_use_id:L.string().nullable(),elapsed_time_seconds:L.number(),task_id:L.string().optional(),uuid:s$(),session_id:L.string()})),uBz=B6(()=>L.object({type:L.literal("auth_status"),isAuthenticating:L.boolean(),output:L.array(L.string()),error:L.string().optional(),uuid:s$(),session_id:L.string()})),mBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("files_persisted"),files:L.array(L.object({filename:L.string(),file_id:L.string()})),failed:L.array(L.object({filename:L.string(),error:L.string()})),processed_at:L.string(),uuid:s$(),session_id:L.string()})),pBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("task_notification"),task_id:L.string(),tool_use_id:L.string().optional(),status:L.enum(["completed","failed","stopped"]),output_file:L.string(),summary:L.string(),usage:L.object({total_tokens:L.number(),tool_uses:L.number(),duration_ms:L.number()}).optional(),uuid:s$(),session_id:L.string()})),BBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("task_started"),task_id:L.string(),tool_use_id:L.string().optional(),description:L.string(),task_type:L.string().optional(),workflow_name:L.string().optional().describe("meta.name from the workflow script (e.g. 'spec'). Only set when task_type is 'local_workflow'."),prompt:L.string().optional(),uuid:s$(),session_id:L.string()})),gBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("session_state_changed"),state:L.enum(["idle","running","requires_action"]),uuid:s$(),session_id:L.string()}).describe("Mirrors notifySessionStateChanged. 'idle' fires after heldBackResult flushes and the bg-agent do-while exits — authoritative turn-over signal.")),FBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("task_progress"),task_id:L.string(),tool_use_id:L.string().optional(),description:L.string(),usage:L.object({total_tokens:L.number(),tool_uses:L.number(),duration_ms:L.number()}),last_tool_name:L.string().optional(),summary:L.string().optional(),uuid:s$(),session_id:L.string()})),UBz=B6(()=>L.object({type:L.literal("tool_use_summary"),summary:L.string(),preceding_tool_use_ids:L.array(L.string()),uuid:s$(),session_id:L.string()})),QBz=B6(()=>L.object({type:L.literal("system"),subtype:L.literal("elicitation_complete"),mcp_server_name:L.string(),elicitation_id:L.string(),uuid:s$(),session_id:L.string()}).describe("Emitted when an MCP server confirms that a URL-mode elicitation is complete.")),dBz=B6(()=>L.object({type:L.literal("prompt_suggestion"),suggestion:L.string(),uuid:s$(),session_id:L.string()}).describe("Predicted next user prompt, emitted after each turn when promptSuggestions is enabled.")),DpO=B6(()=>L.object({sessionId:L.string().describe("Unique session identifier (UUID)."),summary:L.string().describe("Display title for the session: custom title, auto-generated summary, or first prompt."),lastModified:L.number().describe("Last modified time in milliseconds since epoch."),fileSize:L.number().optional().describe("File size in bytes. Only populated for local JSONL storage."),customTitle:L.string().optional().describe("User-set session title via /rename."),firstPrompt:L.string().optional().describe("First meaningful user prompt in the session."),gitBranch:L.string().optional().describe("Git branch at the end of the session."),cwd:L.string().optional().describe("Working directory for the session."),tag:L.string().optional().describe("User-set session tag."),createdAt:L.number().optional().describe("Creation time in milliseconds since epoch, extracted from the first entry's timestamp.")}).describe("Session metadata returned by listSessions and getSessionInfo.")),H7K=B6(()=>L.union([TBz(),$i1(),ZBz(),NBz(),yBz(),EBz(),LBz(),RBz(),hBz(),SBz(),CBz(),bBz(),xBz(),IBz(),uBz(),pBz(),BBz(),FBz(),gBz(),mBz(),UBz(),vBz(),QBz(),dBz()])),Xe6=B6(()=>L.enum(["off","cooldown","on"]).describe("Fast mode state: off, in cooldown after rate limit, or actively enabled."))});var f7K={};T8(f7K,{writeToMailbox:()=>R_,sendShutdownRequestToMailbox:()=>uC8,readUnreadMessages:()=>n26,readMailbox:()=>Qo,markMessagesAsReadByPredicate:()=>Pi1,markMessagesAsRead:()=>We6,markMessageAsReadByIndex:()=>Pe6,isTeamPermissionUpdate:()=>BC8,isTaskAssignment:()=>pC8,isStructuredProtocolMessage:()=>UC8,isShutdownRequest:()=>n46,isShutdownRejected:()=>mC8,isShutdownApproved:()=>qk,isSandboxPermissionResponse:()=>Ge6,isSandboxPermissionRequest:()=>IC8,isPlanApprovalResponse:()=>fE6,isPlanApprovalRequest:()=>r26,isPermissionResponse:()=>i26,isPermissionRequest:()=>Ze6,isModeSetRequest:()=>FC8,isIdleNotification:()=>fe6,getLastPeerDmSummary:()=>Te6,getInboxPath:()=>l26,formatTeammateMessages:()=>rBz,createShutdownRequestMessage:()=>DE6,createShutdownRejectedMessage:()=>Xi1,createShutdownApprovedMessage:()=>Mi1,createSandboxPermissionResponseMessage:()=>Ji1,createSandboxPermissionRequestMessage:()=>Hi1,createPermissionResponseMessage:()=>ji1,createPermissionRequestMessage:()=>wi1,createModeSetRequestMessage:()=>gC8,createIdleNotification:()=>De6,clearMailbox:()=>iBz,ShutdownRequestMessageSchema:()=>X7K,ShutdownRejectedMessageSchema:()=>W7K,ShutdownApprovedMessageSchema:()=>P7K,PlanApprovalResponseMessageSchema:()=>M7K,PlanApprovalRequestMessageSchema:()=>J7K,ModeSetRequestMessageSchema:()=>D7K});import{mkdir as cBz,readFile as lBz,writeFile as WE6}from"fs/promises";import{join as Oi1}from"path";function l26(q,K){let _=K||$9()||"default",z=zE6(_),Y=zE6(q),$=Oi1(FX6(),z,"inboxes"),A=Oi1($,`${Y}.json`);return N(`[TeammateMailbox] getInboxPath: agent=${q}, team=${_}, fullPath=${A}`),A}async function nBz(q){let K=q||$9()||"default",_=zE6(K),z=Oi1(FX6(),_,"inboxes");await cBz(z,{recursive:!0}),N(`[TeammateMailbox] Ensured inbox directory: ${z}`)}async function Qo(q,K){let _=l26(q,K);N(`[TeammateMailbox] readMailbox: path=${_}`);try{let z=await lBz(_,"utf-8"),Y=r8(z);return N(`[TeammateMailbox] readMailbox: read ${Y.length} message(s)`),Y}catch(z){if(s1(z)==="ENOENT")return N("[TeammateMailbox] readMailbox: file does not exist"),[];return N(`Failed to read inbox for ${q}: ${z}`),H6(z),[]}}async function n26(q,K){let _=await Qo(q,K),z=_.filter((Y)=>!Y.read);return N(`[TeammateMailbox] readUnreadMessages: ${z.length} unread of ${_.length} total`),z}async function R_(q,K,_){await nBz(_);let z=l26(q,_),Y=`${z}.lock`;N(`[TeammateMailbox] writeToMailbox: recipient=${q}, from=${K.from}, path=${z}`);try{await WE6(z,"[]",{encoding:"utf-8",flag:"wx"}),N("[TeammateMailbox] writeToMailbox: created new inbox file")}catch(A){if(s1(A)!=="EEXIST"){N(`[TeammateMailbox] writeToMailbox: failed to create inbox file: ${A}`),H6(A);return}}let $;try{$=await PJ(z,{lockfilePath:Y,...xC8});let A=await Qo(q,_),O={...K,read:!1};A.push(O),await WE6(z,g6(A,null,2),"utf-8"),N(`[TeammateMailbox] Wrote message to ${q}'s inbox from ${K.from}`)}catch(A){N(`Failed to write to inbox for ${q}: ${A}`),H6(A)}finally{if($)await $()}}async function Pe6(q,K,_){let z=l26(q,K);N(`[TeammateMailbox] markMessageAsReadByIndex called: agentName=${q}, teamName=${K}, index=${_}, path=${z}`);let Y=`${z}.lock`,$;try{N("[TeammateMailbox] markMessageAsReadByIndex: acquiring lock..."),$=await PJ(z,{lockfilePath:Y,...xC8}),N("[TeammateMailbox] markMessageAsReadByIndex: lock acquired");let A=await Qo(q,K);if(N(`[TeammateMailbox] markMessageAsReadByIndex: read ${A.length} messages after lock`),_<0||_>=A.length){N(`[TeammateMailbox] markMessageAsReadByIndex: index ${_} out of bounds (${A.length} messages)`);return}let O=A[_];if(!O||O.read){N("[TeammateMailbox] markMessageAsReadByIndex: message already read or missing");return}A[_]={...O,read:!0},await WE6(z,g6(A,null,2),"utf-8"),N(`[TeammateMailbox] markMessageAsReadByIndex: marked message at index ${_} as read`)}catch(A){if(s1(A)==="ENOENT"){N(`[TeammateMailbox] markMessageAsReadByIndex: file does not exist at ${z}`);return}N(`[TeammateMailbox] markMessageAsReadByIndex FAILED for ${q}: ${A}`),H6(A)}finally{if($)await $(),N("[TeammateMailbox] markMessageAsReadByIndex: lock released")}}async function We6(q,K){let _=l26(q,K);N(`[TeammateMailbox] markMessagesAsRead called: agentName=${q}, teamName=${K}, path=${_}`);let z=`${_}.lock`,Y;try{N("[TeammateMailbox] markMessagesAsRead: acquiring lock..."),Y=await PJ(_,{lockfilePath:z,...xC8}),N("[TeammateMailbox] markMessagesAsRead: lock acquired");let $=await Qo(q,K);if(N(`[TeammateMailbox] markMessagesAsRead: read ${$.length} messages after lock`),$.length===0){N("[TeammateMailbox] markMessagesAsRead: no messages to mark");return}let A=$7($,(O)=>!O.read);N(`[TeammateMailbox] markMessagesAsRead: ${A} unread of ${$.length} total`);for(let O of $)O.read=!0;await WE6(_,g6($,null,2),"utf-8"),N(`[TeammateMailbox] markMessagesAsRead: WROTE ${A} message(s) as read to ${_}`)}catch($){if(s1($)==="ENOENT"){N(`[TeammateMailbox] markMessagesAsRead: file does not exist at ${_}`);return}N(`[TeammateMailbox] markMessagesAsRead FAILED for ${q}: ${$}`),H6($)}finally{if(Y)await Y(),N("[TeammateMailbox] markMessagesAsRead: lock released")}}async function iBz(q,K){let _=l26(q,K);try{await WE6(_,"[]",{encoding:"utf-8",flag:"r+"}),N(`[TeammateMailbox] Cleared inbox for ${q}`)}catch(z){if(s1(z)==="ENOENT")return;N(`Failed to clear inbox for ${q}: ${z}`),H6(z)}}function rBz(q){return q.map((K)=>{let _=K.color?` color="${K.color}"`:"",z=K.summary?` summary="${K.summary}"`:"";return`<${dJ} teammate_id="${K.from}"${_}${z}> |
| 2163 | ${K.text} |
| 2164 | </${dJ}>`}).join(` |
no test coverage detected