//#region src/svg/cache.ts
/**
* Provides svg caching functionality to avoid redundant XHR requests.
* When the retrieved item doesn't exist in cache yet, a request is sent
* to its 'src' url. The request's promise is cached for that 'src' key
* and can be used for the whole session without repeating requests.
*/
var Cache = class {
	cache = /* @__PURE__ */ new Map();
	add = (src, svg) => {
		this.cache.set(src, svg);
	};
	get = (src) => {
		const item = this.cache.get(src);
		if (!item) {
			const promise = fetch(src).then((res) => res.text());
			this.add(src, promise);
			return promise;
		}
		return item;
	};
	reset = () => {
		this.cache.clear();
	};
};
const cache = new Cache();

//#endregion
export { cache as default };
globalThis.__vuiVersion__ = "4.0.3"
//# sourceMappingURL=cache.js.map