1import{s as X,ap as f}from"./app-BMFFSvzt.js";import Y from"./PageShellStandard-CoL-3z9K.js";import{e as Z}from"./empty-DGjrVIvN.js";import{h as q,r as k,o as L,j as R,k as j,D as H,E as W,v as b,I as G,N as U,p as K}from"./_plugin-vue_export-helper-Bjah6Hf_.js";import"./CollectionChestAnimated-B0-XGTof.js";import"./useCollectAnimation-D-2c2JX2.js";const J={class:"burn-page"},Q=["src"],$=["src"],E=.01,tt={__name:"Burn",setup(et){const I=Object.assign({
1"/resources/images/item_images_bare/1000001_praded.png":()=>f(()=>import("./1000001_praded-CxUYk1nl.js"),[]).then(s=>s.default),
1"/resources/images/item_images_bare/1000218_sovinec.png":()=>f(()=>import("./1000218_sovinec-CsAqW_5O.js"),[]).then(s=>s.default),
1"/resources/images/item_images_bare/1002000_NC_TZ.png":()=>f(()=>import("./1002000_NC_TZ-C07Ozrum.js"),[]).then(s=>s.default),
1"/resources/images/item_images_bare/TZ_191.png":()=>f(()=>import("./TZ_191-Dk38rIAl.js"),[]).then(s=>s.default),
1"/resources/images/item_images_bare/TZ_200.png":()=>f(()=>import("./TZ_200-6T2LvxPn.js"),[]).then(s=>s.default),
1"/resources/images/item_images_bare/TZ_2746.png":()=>f(()=>import("./TZ_2746-VfYStL0v.js"),[]).then(s=>s.default),
1"/resources/images/item_images_bare/TZ_2955.png":()=>f(()=>import("./TZ_2955-CdCFda-G.js"),[]).then(s=>s.default),
1"/resources/images/item_images_bare/TZ_331.png":()=>f(()=>import("./TZ_331-BZwPEsEC.js"),[]).then(s=>s.default),
1"/resources/images/item_images_bare/TZ_975.png":()=>f(()=>import("./TZ_975-BhEd-DUz.js"),[])
1.then(s=>s.default)}),v=Object.keys(I).sort((s,t)=>s.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})),T=k(null),w=k(null),S=k(0),C=k("");async function D(s){if(!v.length)return;const t=(s%v.length+v.length)%v.length,e=await I[v[t]]();C.value=e.default||e}L(()=>{D(S.value)});let d=null;const x=k(0),A=R(()=>x.value>E&&x.value<1-E),B=R(()=>x.value>=1-E?"Smazat":"Vypálit"),F=()=>{A.value||(x.value>=1-E?V():N())};function O(){const s=w.value;if(s){const t=parseFloat(getComputedStyle(s).opacity)||0;x.value=t}requestAnimationFrame(O)}L(()=>{requestAnimationFrame(O)});function N(){d&&(d.destroy(),d=null);const s=w.value;s.crossOrigin="anonymous";const t=()=>{d=new z({stack:T.value,img:s},{delayMs:0,headMs:400,durationMs:1e3,tailMs:900,intensity:.5,smokeDurationMs:3e3,smokeIntensity:.33,fireLift:.1,smokeLift:.05,stepPx:3,particlesPerPx:.015,maxPerPx:.12,smokePerPx:.008,aThresh:160}),d.start()},e=new URL(s.src,location.href);e.searchParams.set("_cors",Date.now().toString()),s.addEventListener("load",t,{once:!0}),s.src=e.toString()}function V(){d&&(d.destroy(),d=null);const s=w.value;s.style.transition="opacity 300ms linear",requestAnimationFrame(()=>{s.style.opacity="0"});const t=async()=>{s.style.transition="",S.value=(S.value+1)%v.length,await D(S.value)};s.addEventListener("transitionend",t,{once:!0})}j(()=>{d&&(d.destroy(),d=null)});class z{constructor(t,e={}){if(this.host=t?.stack,this.img=t?.img,!this.host||!this.img)throw new Error("FireBurnIn: chybà stack/img");this.opt={delayMs:0,headMs:700,durationMs:700,tailMs:700,intensity:1,smokeDurationMs:1e3,smokeIntensity:.6,fireLift:.006,smokeLift:.006,stepPx:3,particlesPerPx:.015,maxPerPx:.12,smokePerPx:.008,aThresh:160,padScaleX:.25,padScaleTop:.7,padScaleBottom:.25,...e},this.canvas=document.createElement("canvas"),this.canvas.className="firefx",this.canvas.style.position="absolute",this.canvas.style.pointerEvents="none",this.host.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d",{alpha:!0}),this.spriteFire=this.makeFireSprite(28),this.spriteSmoke=this.makeSmokeSprite(48),this.emitters=[],this.fireParts=[],this.smokeParts=[],this.scale=1,this.offX=0,this.offY=0,this.padX=0,this.padTop=0,this.padBottom=0,this.coveredAreaPx=0,this.spawnNorm=0,this.maxParticles=1500,this.smokeSpawnNorm=0,this.alignDy=0,this._t0=null,this._raf=null,this._ro=new ResizeObserver(()=>this.relayout()),this._ro.observe(this.host),this._ro.observe(this.img)}start(){const t=()=>{this.relayout(),this.prepImage(),this.autoAlignY(),this.relayout(),this.buildEmitters();const e=()=>{this._t0=null,this.fireParts.length=0,this.smokeParts.length=0,this.img.style.opacity="0",this._raf=requestAnimationFrame(i=>this.frame(i))};this.opt.delayMs>0?setTimeout(e,this.opt.delayMs):e()};this.img.complete&&this.img.naturalWidth?t():this.img.addEventListener("load",t,{once:!0})}destroy(){cancelAnimationFrame(this._raf),this._ro.disconnect(),this.canvas.remove(),this.img.style.opacity="1"}makeFireSprite(t=28){const e=document.createElement("canvas");e.width=e.height=t*2;const i=e.getContext("2d"),o=i.createRadialGradient(t,t,0,t,t,t);return o.addColorStop(0,"rgba(255,255,210,0.33)"),o.addColorStop(.2,"rgba(255,190,60,0.22)"),o.addColorStop(.55,"rgba(255,90,10,0.11)"),o.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=o,i.fillRect(0,0,e.width,e.height),e}makeSmokeSprite(t=48){const e=document.createElement("canvas");e.width=e.height=t*2;const i=e.getContext("2d"),o=i.createRadialGradient(t,t,0,t,t,t);return o.addColorStop(0,"rgba(20,20,20,0.2)"),o.addColorStop(.4,"rgba(10,10,10,0.1
1)"),o.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=o,i.fillRect(0,0,e.width,e.height),e}relayout(){const t=this.img.getBoundingClientRect(),e=this.host.getBoundingClientRect(),i=t.width,o=t.height,c=50*(.85+.6*Math.max(.1,+this.opt.smokeIntensity||1))*2.6;this.padX=Math.round(Math.max(i*this.opt.padScaleX,c*.6)),this.padTop=Math.round(o*this.opt.padScaleTop+c*.8),this.padBottom=Math.round(Math.max(o*this.opt.padScaleBottom,c*.3));const n=t.left-e.left-this.padX,l=t.top-e.top-this.padTop;Object.assign(this.canvas.style,{left:n+"px",top:l+"px"}),this.canvas.width=Math.max(1,Math.round(i+this.padX*2)),this.canvas.height=Math.max(1,Math.round(o+this.padTop+this.padBottom)),this.canvas.style.width=this.canvas.width+"px",this.canvas.style.height=this.canvas.height+"px",this.scale=i/(this.img.naturalWidth||1),this.offX=this.padX,this.offY=this.padTop}prepImage(){this.offscreen=document.createElement("canvas"),this.offscreen.width=this.img.naturalWidth,this.offscreen.height=this.img.naturalHeight;const t=this.offscreen.getContext("2d");t.drawImage(this.img,0,0),this.imgData=t.getImageData(0,0,this.offscreen.width,this.offscreen.height)}autoAlignY(){const t=this.opt.aThresh,e=this.offscreen.width,i=this.offscreen.height,o=this.imgData.data;let h=i,c=-1;for(let n=0;n<i;n++)for(let l=0;l<e;l++)if(o[(n*e+l)*4+3]>t){n<h&&(h=n),n>c&&(c=n);break}if(this.alignDy=0,c>=h&&c>=0){const n=(h+c)/2*this.scale,l=this.img.naturalHeight*this.scale/2;this.alignDy=l-n}}buildEmitters(){const t=this.imgData.data,e=this.offscreen.width,i=this.offscreen.height,o=Math.max(1,this.opt.stepPx|0),h=Math.max(1,Math.round(this.img.naturalWidth*this.scale)),c=Math.max(1,Math.round(this.img.naturalHeight*this.scale)),n=[];let l=0;for(let m=0;m<c;m+=o){const _=Math.min(i-1,Math.max(0,Math.round(m/this.scale)));for(let M=0;M<h;M+=o){const g=Math.min(e-1,Math.max(0,Math.round(M/this.scale)));t[(_*e+g)*4+3]>this.opt.aThresh&&(n.push({x:M+this.offX,y:m+this.offY+this.alignDy}),l++)}}for(;n.length>15e3;)n.splice(Math.random()*n.length|0,1);this.emitters=n,this.coveredAreaPx=l*o*o,this.spawnNorm=this.opt.intensity*this.opt.particlesPerPx*this.coveredAreaPx,this.maxParticles=Math.max(300,Math.round(this.opt.maxPerPx*this.coveredAreaPx)),this.smokeSpawnNorm=this.opt.smokeIntensity*this.opt.smokePerPx*this.coveredAreaPx}easeOutCubic(t){return 1-Math.pow(1-t,3)}easeInCubic(t){return t*t*t}spawnFire(t,e){if(!this.emitters.length)return;const i=Math.min(t|0,Math.max(0,this.maxParticles-this.fireParts.length)),o=Math.max(.1,this.opt.intensity),h=.6+.4*o,c=.8+.4*o;for(let n=0;n<i;n++){const l=this.emitters[Math.random()*this.emitters.length|0];this.fireParts.push({x:l.x+(Math.random()-.5)*2,y:l.y+(Math.random()-.5)*2,vx:(Math.random()-.5)*.35*e*h,vy:-(.65+Math.random()*1)*e*h,life:0,max:16+(Math.random()*12|0),size:(8+Math.random()*16)*c})}}spawnSmoke(t){if(!this.emitters.length)return;const e=Math.max(0,t|0),i=Math.max(.1,+this.opt.smokeIntensity||1);for(let o=0;o<e;o++){const h=this.emitters[Math.random()*this.emitters.length|0];this.smokeParts.push({x:h.x+(Math.random()-.5)*6,y:h.y+(Math.random()-.5)*4,vx:(Math.random()-.5)*.22*i,vy:-(.35+Math.random()*.45)*i,life:0,max:46+(Math.random()*44|0),size:(20+Math.random()*30)*(.85+.6*i),alpha:.42*Math.min(1,i),seed:Math.random()*6.28318})}}frame(t){this._t0==null&&(this._t0=t);const e=t-this._t0,i=this.opt.headMs,o=this.opt.durationMs,h=this.opt.tailMs,c=i+o+h,n=this.opt.smokeDurationMs;let l=0;if(e>i){const r=Math.min(1,(e-i)/Math.max(1,o+h));l=Math.pow(r,2.2)}this.img.style.opacity=String(l);const m=this.ctx;m.clearRect(0,0,this.canvas.width,this.canvas.height);let _=0;if(e<i)_=this.easeInCubic(i?e/i:1);else if(e<i+o)_=1;else if(e<c){const r=(e-(i+o))/Math.max(1,h);_=1-this.easeOutCubic(Math.min(1,r))}m.globalCompositeOperation="lighter",this.spawnFire(this.spawnNorm*_,Math.max(.25,_));for(let r=this.fireParts.length-1;r>=0;r--){const a=this.fireParts[r];a.vx+=(Math.random()-.5)*.02,a.vy-=this.opt.fireLift,a.x+=a.vx,a.y+=a.vy,a.vy*=.986,a.life++;const p=a.life/a.max;if(p>=1){this.fireParts.splice(r,1);continue}const P=1-p,u=a.size*(.6+.6*(1-p));m.globalAlpha=P*.9,m.drawImage(this.spriteFire,a.x-u/2,a.y-u/2,u,u)}const g=e-0;let y=0;if(n>0&&g>=0){const r=Math.max(1,Math.min(i,n*.35)),a=Math.max(0,n*.35),p=Math.max(1,n-r-a);if(g<r)y=this.easeInCubic(g/r);else if(g<r+a)y=1;else if(g<r+a+p){const P=(g-r-a)/p;y=1-this.easeOutCubic(P)}}y>0&&(m.globalCompositeOperation="destination-over",this.spawnSmoke(this.smokeSpawnNorm*y)),m.globalCompositeOperation="destination-over";for(let r=this.smokeParts.length-1;r>=0;r--){const a=this.smokeParts[r],p=a.life/a.max;if(a.vx+=.005*Math.sin(a.seed+a.life*.05)+(Math.random()-.5)*.01,a.vy-=this.opt.smokeLift*(1+.5*p),a.vy*=.992,a.x+=a.vx,a.y+=a.vy,a.life++,p>=1){this.smokeParts.splice(r,1);continue}const P=a.alpha*(1-p*.9),u=a.size*(1+p*1.6);m.globalAlpha=P,m.drawImage(this.spriteSmoke,a.x-u/2,a.y-u/2,u,u)}if(m.globalAlpha=1,e>=i+o+Math.max(h,0)+n&&this.fireParts.length===0&&this.smokeParts.length===0){this.img.style.opacity="1";try{this.opt.onDone&&this.opt.onDone()}finally{}return}this._raf=requestAnimationFrame(r=>this.frame(r))}}return(s,t)=>{const e=X;return K(),H(Y,null,{content:W(()=>[t[0]||(t[0]=b("div",{class:"page-bg","aria-hidden":"true"},null,-1)),b("div",J,[b("div",{class:"img-stack",role:"img","aria-label":"Burn preview",ref_key:"stackEl",ref:T},[b("img",{class:"base",src:U(Z),alt:"empty"},null,8,Q),b("img",{class:"overlay",src:C.value,alt:"overlay",ref_key:"overlayEl",ref:w,crossorigin:"anonymous"},null,8,$)],512),G(e,{label:B.value,size:"large",disabled:A.value,onClick:F},null,8,["label","disabled"])])]),_:1})}}},lt=q(tt,[["__scopeId","data-v-6fc55ef6"]]);export{lt as default};
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.