微信小程序-省心预览工具

This commit is contained in:
Yeomai committed 2026-09-28 21:23:52 +08:00
commit edf1e51846
173 files changed
+78282

No files matched your search

+84
View File
@@ -0,0 +1,84 @@
var ci=Object.defineProperty;var dr=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var ur=Object.prototype.hasOwnProperty;var mr=(A,t,e)=>t in A?ci(A,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):A[t]=e;var Ni=(A,t)=>{for(var e in t)ci(A,e,{get:t[e],enumerable:!0})},gr=(A,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of fr(t))!ur.call(A,s)&&s!==e&&ci(A,s,{get:()=>t[s],enumerable:!(i=dr(t,s))||i.enumerable});return A};var pr=A=>gr(ci({},"__esModule",{value:!0}),A);var c=(A,t,e)=>mr(A,typeof t!="symbol"?t+"":t,e);var Qr={};Ni(Qr,{core:()=>Zi,webgl:()=>sr});module.exports=pr(Qr);var Zi={};Ni(Zi,{AlphaTimeline:()=>Re,Animation:()=>re,AnimationState:()=>yi,AnimationStateAdapter:()=>vi,AnimationStateData:()=>Si,AssetCache:()=>$s,AssetManagerBase:()=>Is,AtlasAttachmentLoader:()=>Ti,Attachment:()=>os,AttachmentTimeline:()=>Ut,BinaryInput:()=>ti,BlendMode:()=>qt,Bone:()=>us,BoneData:()=>Ke,BoundingBoxAttachment:()=>Ze,CURRENT:()=>Ui,ClippingAttachment:()=>Zt,Color:()=>N,ConstraintData:()=>Jt,CurveTimeline:()=>Ot,CurveTimeline1:()=>Xt,CurveTimeline2:()=>hs,DebugUtils:()=>ui,DeformTimeline:()=>Xe,Downloader:()=>ms,DrawOrderTimeline:()=>jt,Event:()=>Je,EventData:()=>Qe,EventQueue:()=>Qs,EventTimeline:()=>ne,EventType:()=>Yt,FIRST:()=>Ai,FakeTexture:()=>Ii,HOLD_FIRST:()=>Ks,HOLD_MIX:()=>Di,HOLD_SUBSEQUENT:()=>Ci,IkConstraint:()=>Ts,IkConstraintData:()=>_e,IkConstraintTimeline:()=>Le,Inherit:()=>xt,InheritTimeline:()=>Te,IntSet:()=>di,Interpolation:()=>Hs,MathUtils:()=>B,MeshAttachment:()=>Nt,MixBlend:()=>P,MixDirection:()=>Mt,PathAttachment:()=>zt,PathConstraint:()=>Es,PathConstraintData:()=>$e,PathConstraintMixTimeline:()=>Oe,PathConstraintPositionTimeline:()=>Be,PathConstraintSpacingTimeline:()=>Ve,Physics:()=>ae,PhysicsConstraintDampingTimeline:()=>Ue,PhysicsConstraintGravityTimeline:()=>qe,PhysicsConstraintInertiaTimeline:()=>Ne,PhysicsConstraintMassTimeline:()=>ze,PhysicsConstraintMixTimeline:()=>Ge,PhysicsConstraintResetTimeline:()=>He,PhysicsConstraintStrengthTimeline:()=>De,PhysicsConstraintTimeline:()=>$t,PhysicsConstraintWindTimeline:()=>We,PointAttachment:()=>Ms,Pool:()=>Qt,PositionMode:()=>Lt,Pow:()=>js,PowOut:()=>fi,RGB2Timeline:()=>ke,RGBA2Timeline:()=>Fe,RGBATimeline:()=>Ee,RGBTimeline:()=>Ye,RegionAttachment:()=>Kt,RotateMode:()=>te,RotateTimeline:()=>_t,SETUP:()=>Mi,SUBSEQUENT:()=>Zs,ScaleTimeline:()=>ve,ScaleXTimeline:()=>Ae,ScaleYTimeline:()=>Ce,SequenceTimeline:()=>je,ShearTimeline:()=>Me,ShearXTimeline:()=>Se,ShearYTimeline:()=>Ie,Skeleton:()=>Ys,SkeletonBinary:()=>Yi,SkeletonBounds:()=>Ps,SkeletonClipping:()=>Vs,SkeletonData:()=>ts,SkeletonJson:()=>Ri,Skin:()=>de,SkinEntry:()=>Ls,Slot:()=>Rs,SlotData:()=>es,SpacingMode:()=>bt,StringSet:()=>pe,Texture:()=>cs,TextureAtlas:()=>ds,TextureAtlasPage:()=>_s,TextureAtlasRegion:()=>fs,TextureFilter:()=>St,TextureRegion:()=>Cs,TextureWrap:()=>ce,TimeKeeper:()=>xe,Timeline:()=>gt,TrackEntry:()=>Js,TransformConstraint:()=>Fs,TransformConstraintData:()=>ss,TransformConstraintTimeline:()=>Pe,TranslateTimeline:()=>we,TranslateXTimeline:()=>be,TranslateYTimeline:()=>ye,Triangulator:()=>Bs,Utils:()=>O,Vector2:()=>Vt,VertexAttachment:()=>vt,WindowedMean:()=>mi});var di=class{constructor(){c(this,"array",new Array)}add(t){let e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}},pe=class{constructor(){c(this,"entries",{});c(this,"size",0)}add(t){let e=this.entries[t];return this.entries[t]=!0,e?!1:(this.size++,!0)}addAll(t){let e=this.size;for(var i=0,s=t.length;i<s;i++)this.add(t[i]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}},Dt=class Dt{constructor(t=0,e=0,i=0,s=0){c(this,"r");c(this,"g");c(this,"b");c(this,"a");this.r=t,this.g=e,this.b=i,this.a=s}set(t,e,i,s){return this.r=t,this.g=e,this.b=i,this.a=s,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)=="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,i,s){return this.r+=t,this.g+=e,this.b+=i,this.a+=s,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((e&4278190080)>>>24)/255,t.g=((e&16711680)>>>16)/255,t.b=((e&65280)>>>8)/255,t.a=(e&255)/255}static rgb888ToColor(t,e){t.r=((e&16711680)>>>16)/255,t.g=((e&65280)>>>8)/255,t.b=(e&255)/255}toRgb888(){let t=e=>("0"+(e*255).toString(16)).slice(-2);return+("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,e=new Dt){return e.setFromString(t)}};c(Dt,"WHITE",new Dt(1,1,1,1)),c(Dt,"RED",new Dt(1,0,0,1)),c(Dt,"GREEN",new Dt(0,1,0,1)),c(Dt,"BLUE",new Dt(0,0,1,1)),c(Dt,"MAGENTA",new Dt(1,0,1,1))Line truncated
`+i:""))}remove(t){t=this.pathPrefix+t;let e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(let t in this.cache.assets){let e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){let e=this.cache.assets[t];if(e instanceof ds){e.dispose();return}this.disposeAssetInternal(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(t){if(this.cache.assetsRefCount[t]>0&&--this.cache.assetsRefCount[t]===0)return this.remove(t)}createTextureAtlas(t,e){let i=new ds(e);return i.dispose=()=>{var s;if(!(this.cache.assetsRefCount[t]<=0)){this.disposeAssetInternal(t);for(let n of i.pages)(s=n.texture)==null||s.dispose()}},i}createTexture(t,e){let i=this.textureLoader(e),s=i.dispose.bind(i);return i.dispose=()=>{this.disposeAssetInternal(t)&&s()},i}},Ss=class Ss{constructor(){c(this,"assets",{});c(this,"assetsRefCount",{});c(this,"assetsLoaded",{})}static getCache(t){let e=Ss.AVAILABLE_CACHES.get(t);if(e)return e;let i=new Ss;return Ss.AVAILABLE_CACHES.set(t,i),i}async addAsset(t,e){this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=await e}};c(Ss,"AVAILABLE_CACHES",new Map);var $s=Ss,ms=class{constructor(){c(this,"callbacks",{});c(this,"rawDataUris",{})}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!=-1?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),i=e.length,s=new Uint8Array(i),n=0;n<i;n++)s[n]=e.charCodeAt(n);return s}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");if(e==-1)throw new Error("Not a binary data URI.");return e+=7,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,i){if(this.start(t,e,i))return;let s=this.rawDataUris[t];if(s&&!s.includes(".")){try{this.finish(t,200,this.dataUriToString(s))}catch(h){this.finish(t,400,JSON.stringify(h))}return}let n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.open("GET",s||t,!0);let o=()=>{this.finish(t,n.status,n.responseText)};n.onload=o,n.onerror=o,n.send()}downloadJson(t,e,i){this.downloadText(t,s=>{e(JSON.parse(s))},i)}downloadBinary(t,e,i){if(this.start(t,e,i))return;let s=this.rawDataUris[t];if(s&&!s.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(s))}catch(h){this.finish(t,400,JSON.stringify(h))}return}let n=new XMLHttpRequest;n.open("GET",s||t,!0),n.responseType="arraybuffer";let o=()=>{this.finish(t,n.status,n.response)};n.onload=()=>{n.status==200||n.status==0?this.finish(t,200,new Uint8Array(n.response)):o()},n.onerror=o,n.send()}start(t,e,i){let s=this.callbacks[t];try{if(s)return!0;this.callbacks[t]=s=[]}finally{s.push(e,i)}}finish(t,e,i){let s=this.callbacks[t];delete this.callbacks[t];let n=e==200||e==0?[i]:[e,i];for(let o=n.length-1,h=s.length;o<h;o+=2)s[o].apply(null,n)}};var Je=class{constructor(t,e){c(this,"data");c(this,"intValue",0);c(this,"floatValue",0);c(this,"stringValue",null);c(this,"time",0);c(this,"volume",0);c(this,"balance",0);if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}};var Qe=class{constructor(t){c(this,"name");c(this,"intValue",0);c(this,"floatValue",0);c(this,"stringValue",null);c(this,"audioPath",null);c(this,"volume",0);c(this,"balance",0);this.name=t}};var Ts=class{constructor(t,e){c(this,"data");c(this,"bones");c(this,"target");c(this,"bendDirection",0);c(this,"compress",!1);c(this,"stretch",!1);c(this,"mix",1);c(this,"softness",0);c(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let s=0;s<t.bones.length;s++){let n=e.findBone(t.bones[s].name);if(!n)throw new Error(`Couldn't find bone ${t.bones[s].name}`);this.bones.push(n)}let i=e.findBone(t.target.name);if(!i)throw new Error(`Couldn't find bone ${t.target.name}`);this.target=i,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}isActive(){return this.active}setToSetupPose(){let t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}update(t){if(this.mix==0)return;let e=this.target,i=this.bones;switch(i.length){case 1:this.apply1(i[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(i[0],i[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(t,e,i,s,n,o,h){let d=t.parent;if(!d)throw new Error("IK bone must have parent.");let r=d.a,a=d.b,l=d.c,f=d.d,m=-t.ashearX-t.arotation,u=0,g=0;switch(t.inherit){case xt.OnlyTransl Line truncated
attribute vec4 ${ut.POSITION};
attribute vec4 ${ut.COLOR};
attribute vec2 ${ut.TEXCOORDS};
uniform mat4 ${ut.MVP_MATRIX};
varying vec4 v_color;
varying vec2 v_texCoords;
void main () {
v_color = ${ut.COLOR};
v_texCoords = ${ut.TEXCOORDS};
gl_Position = ${ut.MVP_MATRIX} * ${ut.POSITION};
}
`,i=`
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
varying LOWP vec4 v_color;
varying vec2 v_texCoords;
uniform sampler2D u_texture;
void main () {
gl_FragColor = v_color * texture2D(u_texture, v_texCoords);
}
`;return new ut(t,e,i)}static newTwoColoredTextured(t){let e=`
attribute vec4 ${ut.POSITION};
attribute vec4 ${ut.COLOR};
attribute vec4 ${ut.COLOR2};
attribute vec2 ${ut.TEXCOORDS};
uniform mat4 ${ut.MVP_MATRIX};
varying vec4 v_light;
varying vec4 v_dark;
varying vec2 v_texCoords;
void main () {
v_light = ${ut.COLOR};
v_dark = ${ut.COLOR2};
v_texCoords = ${ut.TEXCOORDS};
gl_Position = ${ut.MVP_MATRIX} * ${ut.POSITION};
}
`,i=`
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
varying LOWP vec4 v_light;
varying LOWP vec4 v_dark;
varying vec2 v_texCoords;
uniform sampler2D u_texture;
void main () {
vec4 texColor = texture2D(u_texture, v_texCoords);
gl_FragColor.a = texColor.a * v_light.a;
gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;
}
`;return new ut(t,e,i)}static newColored(t){let e=`
attribute vec4 ${ut.POSITION};
attribute vec4 ${ut.COLOR};
uniform mat4 ${ut.MVP_MATRIX};
varying vec4 v_color;
void main () {
v_color = ${ut.COLOR};
gl_Position = ${ut.MVP_MATRIX} * ${ut.POSITION};
}
`,i=`
#ifdef GL_ES
#define LOWP lowp
precision mediump float;
#else
#define LOWP
#endif
varying LOWP vec4 v_color;
void main () {
gl_FragColor = v_color;
}
`;return new ut(t,e,i)}};c(ut,"MVP_MATRIX","u_projTrans"),c(ut,"POSITION","a_position"),c(ut,"COLOR","a_color"),c(ut,"COLOR2","a_color2"),c(ut,"TEXCOORDS","a_texCoords"),c(ut,"SAMPLER","u_texture");var Pt=ut;var ps=class{constructor(t,e,i,s){c(this,"attributes");c(this,"context");c(this,"vertices");c(this,"verticesBuffer",null);c(this,"verticesLength",0);c(this,"dirtyVertices",!1);c(this,"indices");c(this,"indicesBuffer",null);c(this,"indicesLength",0);c(this,"dirtyIndices",!1);c(this,"elementsPerVertex",0);this.attributes=e,this.context=t instanceof wt?t:new wt(t),this.elementsPerVertex=0;for(let n=0;n<e.length;n++)this.elementsPerVertex+=e[n].numElements;this.vertices=new Float32Array(i*this.elementsPerVertex),this.indices=new Uint16Array(s),this.context.addRestorable(this)}getAttributes(){return this.attributes}maxVertices(){return this.vertices.length/this.elementsPerVertex}numVertices(){return this.verticesLength/this.elementsPerVertex}setVerticesLength(t){this.dirtyVertices=!0,this.verticesLength=t}getVertices(){return this.vertices}maxIndices(){return this.indices.length}numIndices(){return this.indicesLength}setIndicesLength(t){this.dirtyIndices=!0,this.indicesLength=t}getIndices(){return this.indices}getVertexSizeInFloats(){let t=0;for(var e=0;e<this.attributes.length;e++){let i=this.attributes[e];t+=i.numElements}return t}setVertices(t){if(this.dirtyVertices=!0,t.length>this.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length}setIndices(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length}draw(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)}drawWithOffset(t,e,i,s){let n=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?n.drawElements(e,s,n.UNSIGNED_SHORT,i*2):n.drawArrays(e,i,s),this.unbind(t)}bind(t){let e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);let i=0;for(let s=0;s<this.attributes.length;s++){let n=this.attributes[s],o=t.getAttributeLocation(n.name);e.enableVertexAttribArray(o),e.vertexAttribPointer(o,n.numElements,e.FLOAT,!1,this.elementsPerVertex*4,i*4),i+=n.numElements}this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)}unbind(t){let e=this.context.gl;for(let i=0;i<this.attributes.length;i++){let s=this.attributes[i],n=t.getAttributeLocation(s.name);e.disableVertexAttribArray(n)}e.bindBuffer(e.ARRAY_BUFFER,null),this.indicesLength>0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)}update(){let t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)}restore(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()}dispose(){this.context.removeRestorable(this);let t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)}},rs=class{constructor(t,e,i){c(this,"name");c(this,"type");c(this,"numElements");this.name=t,this.type=e,this.numElements=i}},ns=class extends rs{constructor(){super(Pt.POSITION,ls.Float,2)}},Ji=class extends rs{constructor(){super(Pt.POSITION,ls.Float,3)}},Ns=class extends rs{constructor(t=0){super(Pt.TEXCOORDS+(t==0?"":t),ls.Float,2)}},as=class extends rs{constructor(){super(Pt.COLOR,ls.Float,4)}},ii=class extends rs{constructor(){super(Pt.COLOR2,ls.Float,4)}},ls;(function(A){A[A.Float=0]="Float"})(ls||(ls={}));var ue=1,jr=769,or=770,hr=771;var cr=774,se=class se{constructor(t,e=!0,i=10920){c(this,"context");c(this,"drawCalls",0);c(this,"isDrawing",!1);c(this,"mesh");c(this,"shader",null);c(this,"lastTexture",null);c(this,"verticesLength",0);c(this,"indicesLength",0);c(this,"srcColorBlend");c(this,"srcAlphaBlend");c(this,"dstBlend");c(this,"cullWasEnabled",!1);if(i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=t instanceof wt?t:new wt(t);let s=e?[new ns,new as,new Ns,new ii]:[new ns,new as,new Ns];this.mesh=new ps(t,s,i,i*3);let n=this.context.gl;this.srcColorBlend=n.SRC_ALPHA,this.srcAlphaBlend=n.ONE,this.dstBlend=n.ONE_MINUS_SRC_ALPHA}begin(t){if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0;let e=this.context.gl;e.enable(e.BLEND),e.blendFuncSeparate(this.srcColorBlend,this.dstBlend,this.srcAlphaBlend,this.dstBlend),se. Line truncated