shadow$provide.module$node_modules$pixi_DOT_js$lib$filters$defaults$blur$BlurFilterPass = function(global, require, module, exports) {
  var TexturePool = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$TexturePool"), types = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$types");
  global = require("module$node_modules$pixi_DOT_js$lib$filters$Filter");
  var generateBlurGlProgram = require("module$node_modules$pixi_DOT_js$lib$filters$defaults$blur$gl$generateBlurGlProgram"), generateBlurProgram = require("module$node_modules$pixi_DOT_js$lib$filters$defaults$blur$gpu$generateBlurProgram");
  "use strict";
  const node_modules$pixi_DOT_js$lib$filters$defaults$blur$BlurFilterPass$classdecl$var40 = class extends global.Filter {
    constructor(options) {
      options = {...node_modules$pixi_DOT_js$lib$filters$defaults$blur$BlurFilterPass$classdecl$var40.defaultOptions, ...options};
      const glProgram = generateBlurGlProgram.generateBlurGlProgram(options.horizontal, options.kernelSize), gpuProgram = generateBlurProgram.generateBlurProgram(options.horizontal, options.kernelSize);
      super({glProgram, gpuProgram, resources:{blurUniforms:{uStrength:{value:0, type:"f32"}}}, ...options});
      this.horizontal = options.horizontal;
      this.legacy = options.legacy ?? !1;
      this._quality = 0;
      this.quality = options.quality;
      this.blur = options.strength;
      this._blurUniforms = this.resources.blurUniforms;
      this._uniforms = this._blurUniforms.uniforms;
    }
    apply(filterManager, input, output, clearMode) {
      this.legacy ? this._applyLegacy(filterManager, input, output, clearMode) : this._applyOptimized(filterManager, input, output, clearMode);
    }
    _applyLegacy(filterManager, input, output, clearMode) {
      this._uniforms.uStrength = this.strength / this.passes;
      if (1 === this.passes) {
        filterManager.applyFilter(this, input, output, clearMode);
      } else {
        const tempTexture = TexturePool.TexturePool.getSameSizeTexture(input);
        let flop = tempTexture;
        this._state.blend = !1;
        const shouldClear = filterManager.renderer.type === types.RendererType.WEBGPU;
        for (let i = 0; i < this.passes - 1; i++) {
          filterManager.applyFilter(this, input, flop, 0 === i ? !0 : shouldClear);
          const temp = flop;
          flop = input;
          input = temp;
        }
        this._state.blend = !0;
        filterManager.applyFilter(this, input, output, clearMode);
        TexturePool.TexturePool.returnTexture(tempTexture);
      }
    }
    _applyOptimized(filterManager, input, output, clearMode) {
      this._uniforms.uStrength = this._calculateInitialStrength();
      if (1 === this.passes) {
        filterManager.applyFilter(this, input, output, clearMode);
      } else {
        const tempTexture = TexturePool.TexturePool.getSameSizeTexture(input);
        let flop = tempTexture;
        this._state.blend = !1;
        var renderer = filterManager.renderer;
        const isWebGPU = renderer.type === types.RendererType.WEBGPU;
        renderer = isWebGPU ? renderer.renderPipes.uniformBatch : null;
        for (let i = 0; i < this.passes - 1; i++) {
          renderer && this.groups[1].setResource(renderer.getUboResource(this._blurUniforms), 0);
          filterManager.applyFilter(this, input, flop, isWebGPU);
          const temp = flop;
          flop = input;
          input = temp;
          this._uniforms.uStrength *= 0.5;
        }
        renderer && this.groups[1].setResource(renderer.getUboResource(this._blurUniforms), 0);
        this._state.blend = !0;
        filterManager.applyFilter(this, input, output, clearMode);
        TexturePool.TexturePool.returnTexture(tempTexture);
      }
    }
    _calculateInitialStrength() {
      let sumOfSquares = 1, coefficient = 0.5;
      for (let i = 1; i < this.passes; i++) {
        sumOfSquares += coefficient * coefficient, coefficient *= 0.5;
      }
      return this.strength / Math.sqrt(sumOfSquares);
    }
    get blur() {
      return this.strength;
    }
    set blur(value) {
      this.padding = 1 + 2 * Math.abs(value);
      this.strength = value;
    }
    get quality() {
      return this._quality;
    }
    set quality(value) {
      this.passes = this._quality = value;
    }
  };
  require = node_modules$pixi_DOT_js$lib$filters$defaults$blur$BlurFilterPass$classdecl$var40;
  require.defaultOptions = {strength:8, quality:4, kernelSize:5, legacy:!1};
  exports.BlurFilterPass = require;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$filters$defaults$blur$BlurFilterPass.js.map
