{"version":3,"file":"index-BHqlYS6b.cjs","sources":["../node_modules/.pnpm/@nhtio+tiny-typed-emitter@1.20251213.1/node_modules/@nhtio/tiny-typed-emitter/index.mjs"],"sourcesContent":["const n = \"1.20251213.1\";\nclass o {\n  /**\n   * The internal event listener map for the emitter.\n   */\n  e;\n  /**\n   * Creates a new TypedEventEmitter instance.\n   */\n  constructor() {\n    this.e = {};\n  }\n  /**\n   * Subscribe to an event with a typed listener.\n   * @param event - The event name.\n   * @param listener - The listener function.\n   * @param ctx - The `this` context to apply to the listener when it is called\n   * @returns the current instance for chaining\n   */\n  on(s, r, i) {\n    return Array.isArray(this.e[s]) || (this.e[s] = []), this.e[s].push({\n      fn: r,\n      ctx: i || null\n    }), this;\n  }\n  /**\n   * Subscribe to an event once with a typed listener.\n   * @param event - The event name.\n   * @param listener - The listener function.\n   * @param ctx - The `this` context to apply to the listener when it is called\n   * @returns the current instance for chaining\n   */\n  once(s, r, i) {\n    const t = this;\n    function f() {\n      r.apply(i || null, arguments), t.off(s, f);\n    }\n    return f._ = r, this.on(s, f, i);\n  }\n  /**\n   * Emit an event.\n   * @param event - The event name.\n   * @param args - The arguments to pass to the listeners.\n   * @returns the current instance for chaining\n   */\n  emit(s, ...r) {\n    const i = this.e[s];\n    return Array.isArray(i) && i.forEach((t) => {\n      t.fn.apply(t.ctx || null, r);\n    }), this;\n  }\n  /**\n   * Unsubscribe from an event.\n   * @param event - The event name.\n   * @param listener - Optional. The listener function to remove.\n   * @returns the current instance for chaining\n   *\n   * @remarks When no listener is provided, all listeners for the event will be removed, otherwise\n   * only the specified listener will be removed.\n   */\n  off(s, r) {\n    return Array.isArray(this.e[s]) && (r ? this.e[s] = this.e[s].filter(\n      // @ts-ignore\n      (i) => i.fn !== r && i.fn._ !== r\n    ) : this.e[s] = []), this;\n  }\n}\nexport {\n  o as TypedEventEmitter,\n  n as version\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";AACA,MAAM,EAAE;AAAA;AAAA;AAA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