class o{static#e=new Map;tag;contents;constructor(e,t=void 0){this.tag=e,this.contents=t}get noChildren(){return!!o.#e.get(this.tag)?.noChildren}static registerDecoder(e,t,n){const i=this.#e.get(e);return this.#e.set(e,t),i&&("comment"in t||(t.comment=i.comment),"noChildren"in t||(t.noChildren=i.noChildren)),n&&!t.comment&&(t.comment=()=>`(${n})`),i}static clearDecoder(e){const t=this.#e.get(e);return this.#e.delete(e),t}static getDecoder(e){return this.#e.get(e)}static getAllDecoders(){return new Map(this.#e)}*[Symbol.iterator](){yield this.contents}push(e){return this.contents=e,1}decode(e){const t=e?.tags?.get(this.tag)??(e?.ignoreGlobalTags?void 0:o.#e.get(this.tag));return t?t(this,e):this}comment(e,t){const n=e?.tags?.get(this.tag)??(e?.ignoreGlobalTags?void 0:o.#e.get(this.tag));if(n?.comment)return n.comment(this,e,t)}toCBOR(){return[this.tag,this.contents]}[Symbol.for("nodejs.util.inspect.custom")](e,t,n){return`${this.tag}(${n(this.contents,t)})`}}export{o as Tag};
