PageSourceSearch

https://www.musicart.ai/_next/static/chunks/86656.f3f70ace462797c3.js

js musicart.ai collected 2026-10-05 01:56:49 UTC 11,302 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[86656],{86656:(e,t,r)=>{var i=r(76955);class n{constructor(e){this._renderer=e}push(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:t,filterEffect:e})}pop(e,t,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(e){"pushFilter"===e.action?this._renderer.filter.push(e):"popFilter"===e.action&&this._renderer.filter.pop()}destroy(){this._renderer=null}}n.extension={type:[i.Ag.WebGLPipes,i.Ag.WebGPUPipes,i.Ag.CanvasPipes],name:"filter"};var a=r(15054),u=r(84845),l=r(32636),s=r(95577),o="struct GlobalFilterUniforms {\n  uInputSize: vec4<f32>,\n  uInputPixel: vec4<f32>,\n  uInputClamp: vec4<f32>,\n  uOutputFrame: vec4<f32>,\n  uGlobalFrame: vec4<f32>,\n  uOutputTexture: vec4<f32>,\n};\n\n@group(0) @binding(0) var <uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler: sampler;\n\nstruct VSOutput {\n  @builtin(position) position: vec4<f32>,\n  @location(0) uv: vec2<f32>\n};\n\nfn filterVertexPosition(aPosition: vec2<f32>) -> vec4<f32>\n{\n    var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n    position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n    position.y = position.y * (2.0 * gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n    return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord(aPosition: vec2<f32>) -> vec2<f32>\n{\n    return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\n@vertex\nfn mainVertex(\n  @location(0) aPosition: vec2<f32>,\n) -> VSOutput {\n  return VSOutput(\n   filterVertexPosition(aPosition),\n   filterTextureCoord(aPosition)\n  );\n}\n\n@fragment\nfn mainFragment(\n  @location(0) uv: vec2<f32>,\n) -> @location(0) vec4<f32> {\n    return textureSample(uTexture, uSampler, uv);\n}\n";class d extends l.d{constructor(){super({gpuProgram:u.B.from({vertex:{source:o,entryPoint:"mainVertex"},fragment:{source:o,entryPoint:"mainFragment"},name:"passthrough-filter"}),glProgram:a.M.from({vertex:s.A,fragment:"in vec2 vTextureCoord;\nout vec4 finalColor;\nuniform sampler2D uTexture;\nvoid main() {\n    finalColor = texture(uTexture, vTextureCoord);\n}\n",name:"passthrough-filter"})})}}var p=r(51585),h=r(6979),f=r(11890),c=r(50048),g=r(99244),x=r(43463),m=r(3503),T=r(74280);let b=new p.u;var _=r(2698);let F=new f.V({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class v{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new T.c,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0},this.firstEnabledIndex=-1,this.lastEnabledIndex=-1}}class y{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new c.k({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new h.T({}),this.renderer=e}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){let t=this.renderer,r=e.filterEffect.filters,i=this._pushFilterData();i.skip=!1,i.filters=r,i.container=e.container,i.outputRenderSurface=t.renderTarget.renderSurface;let n=t.renderTarget.renderTarget.colorTexture.source,a=n.resolution,u=n.antialias;if(r.every(e=>!e.enabled)){i.skip=!0;return}let l=i.bounds;if(this._calculateFilterArea(e,l),this._calculateFilterBounds(i,t.renderTarget.rootViewPort,u,a,1),i.skip)return;let s=this._getPreviousFilterData(),o=this._findFilterResolution(a),d=0,p=0;s&&(d=s.bounds.minX,p=s.bounds.minY),this._calculateGlobalFrame(i,d,p,o,n.width,n.height),this._setupFilterTextures(i,l,t,s)}generateFilteredTexture({texture:e,filters:t}){let r=this._pushFilterData();this._activeFilterData=r,r.skip=!1,r.filters=t;let i=e.source,n=i.resolution,a=i.antialias;if(t.every(e=>!e.enabled))return r.skip=!0,e;let u=r.bounds;if(u.addRect(e.frame),this._calculateFilterBounds(r,u.rectangle,a,n,0),r.skip)return e;this._calculateGlobalFrame(r,0,0,n,i.width,i.height),r.outputRenderSurface=x.W.getOptimalTexture(u.width,u.height,r.resolution,r.antialias),r.backTexture=g.g.EMPTY,r.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(r,!0);let l=r.outputRenderSurface;return l.source.alphaMode="premultiplied-alpha",l}pop(){let e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,!1),t.blendRequired&&x.W.returnTexture(t.backTexture),x.W.returnTexture(t.inputTexture))}getBackTexture(e,t,r){let i=e.colorTexture.source._resolution,n=x.W.getOptimalTexture(t.width,t.height,i,!1),a=t.minX,u=t.minY;r&&(a-=r.minX,u-=r.minY),a=Math.floor(a*i),u=Math.floor(u*i);let l=Math.ceil(t.width*i),s=Math.ceil(t.height*i);return this.renderer.renderTarget.copyToTexture(e,n,{x:a,y:u},{width:l,height:s},{x:0,y:0}),n}
1applyFilter(e,t,r,i){let n=this.renderer,a=this._activeFilterData,u=a.outputRenderSurface===r,l=n.renderTarget.rootRenderTarget.colorTexture.source._resolution,s=this._findFilterResolution(l),o=0,d=0;if(u){let e=this._findPreviousFilterOffset();o=e.x,d=e.y}this._updateFilterUniforms(t,r,a,o,d,s,u,i);let p=e.enabled?e:this._getPassthroughFilter();this._setupBindGroupsAndRender(p,t,n)}calculateSpriteMatrix(e,t){let r=this._activeFilterData,i=e.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),n=t.worldTransform.copyTo(p.u.shared),a=t.renderGroup||t.parentRenderGroup;return a&&a.cacheToLocalTransform&&n.prepend(a.cacheToLocalTransform),n.invert(),i.prepend(n),i.scale(1/t.texture.orig.width,1/t.texture.orig.height),i.translate(t.anchor.x,t.anchor.y),i}destroy(){this._passthroughFilter?.destroy(!0),this._passthroughFilter=null}_getPassthroughFilter(){return this._passthroughFilter??(this._passthroughFilter=new d),this._passthroughFilter}_setupBindGroupsAndRender(e,t,r){if(r.renderPipes.uniformBatch){let e=r.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(e,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,r.encoder.draw({geometry:F,shader:e,state:e._state,topology:"triangle-list"}),r.type===m.W.WEBGL&&r.renderTarget.finishRenderPass()}_setupFilterTextures(e,t,r,i){if(e.backTexture=g.g.EMPTY,e.inputTexture=x.W.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),e.blendRequired){r.renderTarget.finishRenderPass();let n=r.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(n,t,i?.bounds)}r.renderTarget.bind(e.inputTexture,!0),r.globalUniforms.push({offset:t})}_calculateGlobalFrame(e,t,r,i,n,a){let u=e.globalFrame;u.x=t*i,u.y=r*i,u.width=n*i,u.height=a*i}_updateFilterUniforms(e,t,r,i,n,a,u,l){let s=this._filterGlobalUniforms.uniforms,o=s.uOutputFrame,d=s.uInputSize,p=s.uInputPixel,h=s.uInputClamp,f=s.uGlobalFrame,c=s.uOutputTexture;u?(o[0]=r.bounds.minX-i,o[1]=r.bounds.minY-n):(o[0]=0,o[1]=0),o[2]=e.frame.width,o[3]=e.frame.height,d[0]=e.source.width,d[1]=e.source.height,d[2]=1/d[0],d[3]=1/d[1],p[0]=e.source.pixelWidth,p[1]=e.source.pixelHeight,p[2]=1/p[0],p[3]=1/p[1],h[0]=.5*p[2],h[1]=.5*p[3],h[2]=e.frame.width*d[2]-.5*p[2],h[3]=e.frame.height*d[3]-.5*p[3];let x=this.renderer.renderTarget.rootRenderTarget.colorTexture;f[0]=i*a,f[1]=n*a,f[2]=x.source.width*a,f[3]=x.source.height*a,t instanceof g.g&&(t.source.resource=null);let m=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!l),t instanceof g.g?(c[0]=t.frame.width,c[1]=t.frame.height):(c[0]=m.width,c[1]=m.height),c[2]=m.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(e){let t=this._filterStackIndex-1;for(;t>0&&this._filterStack[t].skip;)--t;return t>0&&this._filterStack[t].inputTexture?this._filterStack[t].inputTexture.source._resolution:e}_findPreviousFilterOffset(){let e=0,t=0,r=this._filterStackIndex;for(;r>0;){r--;let i=this._filterStack[r];if(!i.skip){e=i.bounds.minX,t=i.bounds.minY;break}}return{x:e,y:t}}_calculateFilterArea(e,t){if(e.renderables?!function(e,t){t.clear();let r=t.matrix;for(let r=0;r<e.length;r++){let i=e[r];if(i.globalDisplayStatus<7)continue;let n=i.renderGroup??i.parentRenderGroup;n?.isCachedAsTexture?t.matrix=b.copyFrom(n.textureOffsetInverseTransform).append(i.worldTransform):n?._parentCacheAsTextureRenderGroup?t.matrix=b.copyFrom(n._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(i.groupTransform):t.matrix=i.worldTransform,t.addBounds(i.bounds)}t.matrix=r}(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(!0,t),e.container){let r=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;r&&t.applyMatrix(r)}}_applyFiltersToTexture(e,t){let r=e.inputTexture,i=e.bounds,n=e.filters,a=e.firstEnabledIndex,u=e.lastEnabledIndex;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),a===u)n[a].apply(this,r,e.outputRenderSurface,t);else{let r=e.inputTexture,l=x.W.getOptimalTexture(i.width,i.height,r.source._resolution,!1),s=l;for(let e=a;
1e<u;e++){let t=n[e];if(!t.enabled)continue;t.apply(this,r,s,!0);let i=r;r=s,s=i}n[u].apply(this,r,e.outputRenderSurface,t),x.W.returnTexture(l)}}_calculateFilterBounds(e,t,r,i,n){let a=this.renderer,u=e.bounds,l=e.filters,s=1/0,o=0,d=!0,p=!1,h=!1,f=!0,c=-1,g=-1;for(let e=0;e<l.length;e++){let t=l[e];if(t.enabled){if(-1===c&&(c=e),g=e,s=Math.min(s,"inherit"===t.resolution?i:t.resolution),o+=t.padding,"off"===t.antialias?d=!1:"inherit"===t.antialias&&d&&(d=r),t.clipToViewport||(f=!1),!(t.compatibleRenderers&a.type)){h=!1;break}if(t.blendRequired&&!(a.backBuffer?.useBackBuffer??!0)){(0,_.R)("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),h=!1;break}h=!0,p||(p=t.blendRequired)}}if(!h||(f&&u.fitBounds(0,t.width/i,0,t.height/i),u.scale(s).ceil().scale(1/s).pad((0|o)*n),!u.isPositive)){e.skip=!0;return}e.antialias=d,e.resolution=s,e.blendRequired=p,e.firstEnabledIndex=c,e.lastEnabledIndex=g}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>0&&(t--,(e=this._filterStack[t]).skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new v),this._filterStackIndex++,e}}y.extension={type:[i.Ag.WebGLSystem,i.Ag.WebGPUSystem],name:"filter"},i.XO.add(y),i.XO.add(n)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.