shadow$provide.module$node_modules$pixi_DOT_js$lib$assets$loader$parsers$textures$loadSVG = function(global, require, module, exports) {
  async function loadAsTexture(url, asset, loader, crossOrigin) {
    var response = await adapter.DOMAdapter.get().fetch(url);
    const image = adapter.DOMAdapter.get().createImage();
    image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(await response.text())}`;
    image.crossOrigin = crossOrigin;
    await image.decode();
    crossOrigin = asset.data?.width ?? image.width;
    response = asset.data?.height ?? image.height;
    const resolution = asset.data?.resolution || getResolutionOfUrl.getResolutionOfUrl(url);
    var canvasWidth = Math.ceil(crossOrigin * resolution), canvasHeight = Math.ceil(response * resolution);
    canvasWidth = adapter.DOMAdapter.get().createCanvas(canvasWidth, canvasHeight);
    canvasHeight = canvasWidth.getContext("2d");
    canvasHeight.imageSmoothingEnabled = !0;
    canvasHeight.imageSmoothingQuality = "high";
    canvasHeight.drawImage(image, 0, 0, crossOrigin * resolution, response * resolution);
    const {parseAsGraphicsContext:_p, ...rest} = asset.data ?? {};
    asset = new ImageSource.ImageSource({resource:canvasWidth, alphaMode:"premultiply-alpha-on-upload", resolution, ...rest});
    return createTexture.createTexture(asset, loader, url);
  }
  async function loadAsGraphics(url) {
    url = await (await adapter.DOMAdapter.get().fetch(url)).text();
    const context = new GraphicsContext.GraphicsContext();
    context.svg(url);
    return context;
  }
  var adapter = require("module$node_modules$pixi_DOT_js$lib$environment$adapter");
  global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
  var ImageSource = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$sources$ImageSource"), GraphicsContext = require("module$node_modules$pixi_DOT_js$lib$scene$graphics$shared$GraphicsContext"), getResolutionOfUrl = require("module$node_modules$pixi_DOT_js$lib$utils$network$getResolutionOfUrl"), checkDataUrl = require("module$node_modules$pixi_DOT_js$lib$assets$utils$checkDataUrl"), checkExtension = require("module$node_modules$pixi_DOT_js$lib$assets$utils$checkExtension");
  module = require("module$node_modules$pixi_DOT_js$lib$assets$loader$parsers$LoaderParser");
  var createTexture = require("module$node_modules$pixi_DOT_js$lib$assets$loader$parsers$textures$utils$createTexture");
  "use strict";
  exports.loadSvg = {extension:{type:global.ExtensionType.LoadParser, priority:module.LoaderParserPriority.Low, name:"loadSVG"}, name:"loadSVG", id:"svg", config:{crossOrigin:"anonymous", parseAsGraphicsContext:!1}, test(url) {
    return checkDataUrl.checkDataUrl(url, "image/svg+xml") || checkExtension.checkExtension(url, ".svg");
  }, async load(url, asset, loader) {
    return asset.data?.parseAsGraphicsContext ?? this.config.parseAsGraphicsContext ? loadAsGraphics(url) : loadAsTexture(url, asset, loader, this.config.crossOrigin);
  }, unload(asset) {
    asset.destroy(!0);
  }};
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$assets$loader$parsers$textures$loadSVG.js.map
