/home/u764571690/domains/savitrfoundation.com/public_html/F2
Edit: /home/u764571690/domains/savitrfoundation.com/public_html/F2/app.min.js (14175B)
// Obfuscated JavaScript - Variable names changed to protect logic
(function(){
'use strict';
const _0x1a2b=['images','imageDataCache','globalZoom','currentSpeed','contrast','brightness','sharpness','thermalActive','thermalIntensity','invertActive','pulseAnimation','pulsePhase','serialNumber','aadharNumber'];
const _0x3c4d=['getElementById','querySelector','addEventListener','createElement','getContext','drawImage','getImageData','putImageData','toDataURL','classList','style','textContent','value','click'];
let _0x5e6f=[],_0x7g8h={},_0x9i0j=52,_0x1k2l='normal',_0x3m4n=109,_0x5o6p=100,_0x7q8r=500,_0x9s0t=true,_0x1u2v=500,_0x3w4x=false,_0x5y6z=null,_0x7a8b=0,_0x9c0d='',_0x1e2f='';
const _0x2g3h={fast:0.5,normal:1.0,slow:2.0};
let _0x4i5j=true,_0x6k7l=false,_0x8m9n={},_0x0o1p=false;
const _0x2q3r=async(_0x4s5t,_0x6u7v)=>{
try{const _0x8w9x=await fetch('api_process.php',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({action:_0x4s5t,..._0x6u7v})});
return await _0x8w9x.json();}catch(_0x0y1z){return{success:false,error:_0x0y1z.message};}};
function _0xa1b2(_0xc3d4,_0xe5f6,_0xg7h8){
const _0xi9j0=new Image();
_0xi9j0.crossOrigin='anonymous';
_0xi9j0.onload=function(){
const _0xk1l2=280;
let _0xm3n4=_0xi9j0.width,_0xo5p6=_0xi9j0.height;
const _0xq7r8=_0xm3n4/_0xo5p6;
let _0xs9t0,_0xu1v2;
if(_0xm3n4>_0xo5p6){_0xs9t0=_0xk1l2;_0xu1v2=Math.round(_0xk1l2/_0xq7r8);}else{_0xu1v2=_0xk1l2;_0xs9t0=Math.round(_0xk1l2*_0xq7r8);}
const _0xw3y4=document.createElement('canvas');
const _0xz5a6=_0xw3y4.getContext('2d');
_0xw3y4.width=_0xs9t0;_0xw3y4.height=_0xu1v2;
_0xz5a6.drawImage(_0xi9j0,0,0,_0xs9t0,_0xu1v2);
const _0xb7c8=_0xz5a6.getImageData(0,0,_0xw3y4.width,_0xw3y4.height);
const _0xd9e0=new Uint8ClampedArray(_0xb7c8.data);
_0x7g8h[_0xe5f6]={original:_0xd9e0,width:_0xw3y4.width,height:_0xw3y4.height,displayWidth:_0xs9t0,displayHeight:_0xu1v2};
_0xf1g2(_0xe5f6,_0xb7c8,_0xw3y4,_0xz5a6);
_callback(_0xw3y4);};
_0xi9j0.src=_0xc3d4;}
function _0xf1g2(_0xh3i4,_0xj5k6,_0xl7m8,_0xn9o0){
const _0xp1q2=_0xj5k6.data;
const _0xr3s4=_0x7g8h[_0xh3i4];
if(!_0xr3s4)return;
const _0xt5u6=_0xr3s4.original;
for(let _0xv7w8=0;_0xv7w8<_0xp1q2.length;_0xv7w8++){_0xp1q2[_0xv7w8]=_0xt5u6[_0xv7w8];}
const _0xy9z0=(_0x5o6p-100)/100;
for(let _0xa1b2=0;_0xa1b2<_0xp1q2.length;_0xa1b2+=4){
let _0xc3d4=_0xp1q2[_0xa1b2]+_0xy9z0*128;
let _0xe5f6=_0xp1q2[_0xa1b2+1]+_0xy9z0*128;
let _0xg7h8=_0xp1q2[_0xa1b2+2]+_0xy9z0*128;
_0xp1q2[_0xa1b2]=Math.min(255,Math.max(0,_0xc3d4));
_0xp1q2[_0xa1b2+1]=Math.min(255,Math.max(0,_0xe5f6));
_0xp1q2[_0xa1b2+2]=Math.min(255,Math.max(0,_0xg7h8));}
const _0xi9j0=(_0x3m4n-100)/100;
for(let _0xk1l2=0;_0xk1l2<_0xp1q2.length;_0xk1l2+=4){
const _0xm3n4=(259*(_0xi9j0*255+255))/(255*(259-_0xi9j0*255));
_0xp1q2[_0xk1l2]=Math.min(255,Math.max(0,_0xm3n4*(_0xp1q2[_0xk1l2]-128)+128));
_0xp1q2[_0xk1l2+1]=Math.min(255,Math.max(0,_0xm3n4*(_0xp1q2[_0xk1l2+1]-128)+128));
_0xp1q2[_0xk1l2+2]=Math.min(255,Math.max(0,_0xm3n4*(_0xp1q2[_0xk1l2+2]-128)+128));}
if(_0x3w4x){
for(let _0xo5p6=0;_0xo5p6<_0xp1q2.length;_0xo5p6+=4){
_0xp1q2[_0xo5p6]=255-_0xp1q2[_0xo5p6];
_0xp1q2[_0xo5p6+1]=255-_0xp1q2[_0xo5p6+1];
_0xp1q2[_0xo5p6+2]=255-_0xp1q2[_0xo5p6+2];}}
if(_0x9s0t){
const _0xq7r8=_0x1u2v/500;
for(let _0xs9t0=0;_0xs9t0<_0xp1q2.length;_0xs9t0+=4){
const _0xu1v2=(_0xp1q2[_0xs9t0]+_0xp1q2[_0xs9t0+1]+_0xp1q2[_0xs9t0+2])/3;
let _0xw3y4,_0xz5a6,_0xb7c8;
if(_0xq7r8>=0.5){
const _0xd9e0=(_0xq7r8-0.5)/0.5;
if(_0xd9e0>=0.5){
const _0xf1g2=(_0xd9e0-0.5)/0.5;
_0xw3y4=255;_0xz5a6=Math.min(255,Math.max(0,(1-_0xf1g2)*100));_0xb7c8=0;
}else{
const _0xh3i4=_0xd9e0/0.5;
_0xw3y4=255;_0xz5a6=Math.min(255,100+_0xh3i4*155);_0xb7c8=0;}}
else{
const _0xj5k6=_0xq7r8/0.5;
if(_0xj5k6>=0.5){
const _0xl7m8=(_0xj5k6-0.5)/0.5;
_0xw3y4=255-_0xl7m8*255;_0xz5a6=255;_0xb7c8=_0xl7m8*255;
}else{
const _0xn9o0=_0xj5k6/0.5;
_0xw3y4=0;_0xz5a6=255-_0xn9o0*255;_0xb7c8=255;}}
const _0xp1q2=_0xu1v2/255;
_0xp1q2[_0xs9t0]=Math.min(255,Math.max(0,_0xw3y4*_0xp1q2));
_0xp1q2[_0xs9t0+1]=Math.min(255,Math.max(0,_0xz5a6*_0xp1q2));
_0xp1q2[_0xs9t0+2]=Math.min(255,Math.max(0,_0xb7c8*_0xp1q2));}}
if(_0x7q8r!==100){
const _0xr3s4=_0xr3s4.width;
const _0xt5u6=_0xr3s4.height;
const _0xv7w8=new Uint8ClampedArray(_0xp1q2);
let _0xy9z0=(_0x7q8r-100)/100;
if(_0xy9z0>0){
if(_0x7q8r>200){
const _0xa1b2=(_0x7q8r-200)/100;
_0xy9z0=1.0+(_0xa1b2*2.5);}}
else{_0xy9z0=Math.max(_0xy9z0,-0.5);}
for(let _0xc3d4=2;_0xc3d4<_0xt5u6-2;_0xc3d4++){
for(let _0xe5f6=2;_0xe5f6<_0xr3s4-2;_0xe5f6++){
const _0xg7h8=(_0xc3d4*_0xr3s4+_0xe5f6)*4;
const _0xi9j0=_0xv7w8[_0xg7h8];
const _0xk1l2=_0xv7w8[_0xg7h8+1];
const _0xm3n4=_0xv7w8[_0xg7h8+2];
let _0xo5p6=0,_0xq7r8=0,_0xs9t0=0,_0xu1v2=0;
for(let _0xw3y4=-1;_0xw3y4<=1;_0xw3y4++){
for(let _0xz5a6=-1;_0xz5a6<=1;_0xz5a6++){
if(_0xw3y4===0&&_0xz5a6===0)continue;
const _0xb7c8=((_0xc3d4+_0xw3y4)*_0xr3s4+(_0xe5f6+_0xz5a6))*4;
_0xo5p6+=_0xv7w8[_0xb7c8];
_0xq7r8+=_0xv7w8[_0xb7c8+1];
_0xs9t0+=_0xv7w8[_0xb7c8+2];
_0xu1v2++;}}}
const _0xd9e0=_0xo5p6/_0xu1v2;
const _0xf1g2=_0xq7r8/_0xu1v2;
const _0xh3i4=_0xs9t0/_0xu1v2;
const _0xj5k6=_0xi9j0-_0xd9e0;
const _0xl7m8=_0xk1l2-_0xf1g2;
const _0xn9o0=_0xm3n4-_0xh3i4;
_0xp1q2[_0xg7h8]=Math.min(255,Math.max(0,Math.round(_0xi9j0+_0xj5k6*_0xy9z0)));
_0xp1q2[_0xg7h8+1]=Math.min(255,Math.max(0,Math.round(_0xk1l2+_0xl7m8*_0xy9z0)));
_0xp1q2[_0xg7h8+2]=Math.min(255,Math.max(0,Math.round(_0xm3n4+_0xn9o0*_0xy9z0)));}}}
_0xn9o0.putImageData(_0xj5k6,0,0);}
function _0xw1x2(){if(_0x5e6f.length===3){_0xy3z4();}else{_0x5e6f.forEach(_0xa5b6=>{
const _0xc7d8=document.querySelector(`[data-id="${_0xa5b6.id}"] canvas`);
if(_0xc7d8&&_0x7g8h[_0xa5b6.id]){
const _0xe9f0=_0xc7d8.getContext('2d');
const _0xg1h2=_0x7g8h[_0xa5b6.id];
const _0xi3j4=_0xe9f0.createImageData(_0xg1h2.width,_0xg1h2.height);
for(let _0xk5l6=0;_0xk5l6<_0xi3j4.data.length;_0xk5l6++){_0xi3j4.data[_0xk5l6]=_0xg1h2.original[_0xk5l6];}
_0xf1g2(_0xa5b6.id,_0xi3j4,_0xc7d8,_0xe9f0);}});}}
function _0xy3z4(){
if(_0x5e6f.length!==3)return;
const _0xa7b8=document.getElementById('combinedCanvas');
if(!_0xa7b8)return;
const _0xc9d0=280;
const _0xe1f2=30;
const _0xg3h4=_0xc9d0*2+_0xe1f2;
const _0xi5j6=_0xc9d0*2+_0xe1f2;
_0xa7b8.width=_0xg3h4;
_0xa7b8.height=_0xi5j6;
_0xa7b8.style.width=_0xg3h4+'px';
_0xa7b8.style.height=_0xi5j6+'px';
_0xa7b8.style.transform=`scale(${_0x9i0j/100})`;
const _0xk7l8=_0xa7b8.getContext('2d');
_0xk7l8.clearRect(0,0,_0xg3h4,_0xi5j6);
const _0xm9n0=[{x:0,y:0},{x:_0xc9d0+_0xe1f2,y:0},{x:(_0xc9d0+_0xe1f2)/2,y:_0xc9d0+_0xe1f2}];
_0x5e6f.forEach((_0xo1p2,_0xq3r4)=>{
const _0xs5t6=_0x7g8h[_0xo1p2.id];
if(!_0xs5t6)return;
const _0xu7v8=_0xm9n0[_0xq3r4];
const _0xw9y0=document.createElement('canvas');
_0xw9y0.width=_0xs5t6.width;
_0xw9y0.height=_0xs5t6.height;
const _0xz1a2=_0xw9y0.getContext('2d');
const _0xb3c4=_0xz1a2.createImageData(_0xs5t6.width,_0xs5t6.height);
for(let _0xd5e6=0;_0xd5e6<_0xb3c4.data.length;_0xd5e6++){_0xb3c4.data[_0xd5e6]=_0xs5t6.original[_0xd5e6];}
_0xf1g2(_0xo1p2.id,_0xb3c4,_0xw9y0,_0xz1a2);
_0xk7l8.drawImage(_0xw9y0,_0xu7v8.x,_0xu7v8.y,_0xc9d0,_0xc9d0);});}
window._0xf7g8=function(_0xh9i0){_0x1k2l=_0xh9i0;document.querySelectorAll('.speed-btn').forEach(_0xj1k2=>_0xj1k2.classList.remove('active'));document.querySelector(`[data-speed="${_0xh9i0}"]`).classList.add('active');if(_0x4i5j){_0xl3m4();_0xn5o6();}};
window._0xp7q8=function(_0xr9s0){_0x9i0j=Math.max(50,Math.min(400,_0x9i0j+_0xr9s0));document.getElementById('zoomValue').textContent=_0x9i0j+'%';_0x5e6f.forEach(_0xt1u2=>{_0xt1u2.zoom=_0x9i0j;const _0xv3w4=document.querySelector(`[data-id="${_0xt1u2.id}"] canvas`);if(_0xv3w4){_0xv3w4.style.transform=`scale(${_0x9i0j/100})`;}});};
window._0xy5z6=function(_0xa7b8){_0x3m4n=parseInt(_0xa7b8);const _0xc9d0=document.querySelector('.left-slider-container .slider-value');if(_0xc9d0)_0xc9d0.textContent=_0x3m4n+'%';_0xw1x2();};
window._0xe1f2=function(_0xg3h4){_0x5o6p=parseInt(_0xg3h4);const _0xi5j6=document.querySelector('.right-slider-container .slider-value');if(_0xi5j6)_0xi5j6.textContent=_0x5o6p+'%';_0xw1x2();};
window._0xk7l8=function(_0xm9n0){_0x7q8r=parseInt(_0xm9n0);const _0xo1p2=document.getElementById('sharpnessValue');if(_0xo1p2)_0xo1p2.textContent=_0x7q8r+'%';_0xw1x2();};
window._0xq3r4=function(_0xs5t6){_0x1u2v=parseInt(_0xs5t6);const _0xu7v8=document.getElementById('thermalValue');if(_0xu7v8)_0xu7v8.textContent=_0x1u2v+'%';_0xw1x2();};
window._0xw9y0=function(){if(_0x9s0t===true)return;_0x9s0t=true;const _0xz1a2=document.getElementById('thermalApplyBtn');const _0xb3c4=document.getElementById('thermalRemoveBtn');if(_0xz1a2)_0xz1a2.style.display='none';if(_0xb3c4)_0xb3c4.style.display='inline-block';_0xw1x2();};
window._0xd5e6=function(){_0x9s0t=false;const _0xf7g8=document.getElementById('thermalApplyBtn');const _0xh9i0=document.getElementById('thermalRemoveBtn');if(_0xh9i0)_0xh9i0.style.display='none';if(_0xf7g8)_0xf7g8.style.display='inline-block';_0xw1x2();};
window._0xj1k2=function(){_0x3w4x=!_0x3w4x;const _0xl3m4=document.getElementById('invertBtn');if(_0xl3m4){if(_0x3w4x){_0xl3m4.style.background='#00cc00';_0xl3m4.style.borderColor='#00cc00';_0xl3m4.textContent='Invert ON';}else{_0xl3m4.style.background='#0066cc';_0xl3m4.style.borderColor='#0066cc';_0xl3m4.textContent='Invert';}}_0xw1x2();};
function _0xl3m4(){if(_0x5y6z){cancelAnimationFrame(_0x5y6z);_0x5y6z=null;}_0x6k7l=false;_0x5e6f.forEach(_0xn5o6=>{const _0xo1p2=document.querySelector(`[data-id="${_0xn5o6.id}"] canvas`);if(_0xo1p2){_0xo1p2.style.opacity=1.0;_0xo1p2.style.transform=`scale(${_0x9i0j/100})`;}});}
function _0xn5o6(){if(_0x5y6z){cancelAnimationFrame(_0x5y6z);}_0x7a8b=0;_0x0o1p=false;const _0xq3r4=_0x2g3h[_0x1k2l];let _0xs5t6=performance.now();function _0xu7v8(_0xw9y0){const _0xz1a2=(_0xw9y0-_0xs5t6)/1000;_0xs5t6=_0xw9y0;_0x7a8b+=_0xz1a2/_0xq3r4;if(_0x7a8b>=1){_0x7a8b-=1;}_0xw1x2();const _0xb3c4=_0x5e6f.length===1?0.5:0.7;const _0xd5e6=1.0;let _0xf7g8=_0xb3c4;if(_0x7a8b<0.3){const _0xh9i0=_0x7a8b/0.3;const _0xj1k2=_0xh9i0<0.5?2*_0xh9i0*_0xh9i0:1-Math.pow(-2*_0xh9i0+2,2)/2;_0xf7g8=_0xb3c4+(_0xd5e6-_0xb3c4)*_0xj1k2;_0x6k7l=true;}else if(_0x7a8b<0.6){const _0xl3m4=(_0x7a8b-0.3)/0.3;const _0xn5o6=_0xl3m4<0.5?2*_0xl3m4*_0xl3m4:1-Math.pow(-2*_0xl3m4+2,2)/2;_0xf7g8=_0xd5e6-(_0xd5e6-_0xb3c4)*_0xn5o6;_0x6k7l=false;}else if(_0x7a8b<0.8){const _0xo1p2=(_0x7a8b-0.6)/0.2;const _0xq3r4=_0xo1p2<0.5?2*_0xo1p2*_0xo1p2:1-Math.pow(-2*_0xo1p2+2,2)/2;_0xf7g8=_0xb3c4+(_0xd5e6-_0xb3c4)*_0xq3r4;_0x6k7l=true;}else{const _0xs5t6=(_0x7a8b-0.8)/0.2;const _0xu7v8=_0xs5t6<0.5?2*_0xs5t6*_0xs5t6:1-Math.pow(-2*_0xs5t6+2,2)/2;_0xf7g8=_0xd5e6-(_0xd5e6-_0xb3c4)*_0xu7v8;_0x6k7l=false;}if(_0x5e6f.length===3){const _0xw9y0=document.getElementById('combinedCanvas');if(_0xw9y0){_0xw9y0.style.transition='opacity 0.1s ease-in-out';_0xw9y0.style.opacity=_0xf7g8;}}else{_0x5e6f.forEach(_0xz1a2=>{const _0xb3c4=document.querySelector(`[data-id="${_0xz1a2.id}"] canvas`);if(_0xb3c4){_0xb3c4.style.transition='opacity 0.1s ease-in-out';_0xb3c4.style.opacity=_0xf7g8;_0xb3c4.style.transform=`scale(${_0x9i0j/100})`;}});}_0x5y6z=requestAnimationFrame(_0xu7v8);}_0x5y6z=requestAnimationFrame(_0xu7v8);}
async function _0xa1b2c(){const _0xd3e4=document.getElementById('serialNumber').value.trim();const _0xf5g6=document.getElementById('aadharNumber').value.trim();if(!_0xd3e4||!_0xf5g6){alert('Please enter both Serial Number and Aadhar Number');return;}const _0xh7i8=await _0x2q3r('validateData',{serial:_0xd3e4,aadhar:_0xf5g6});if(!_0xh7i8.success){alert(_0xh7i8.errors.join(', '));return;}_0x9c0d=_0xd3e4;_0x1e2f=_0xf5g6;const _0xj9k0=document.getElementById('aadharDisplay');const _0xl1m2=document.getElementById('serialNumberDisplay');const _0xn3o4=document.getElementById('aadharNumberDisplay');if(_0xj9k0&&_0xl1m2&&_0xn3o4){_0xj9k0.style.display='block';_0xl1m2.textContent=_0xd3e4;_0xn3o4.textContent=_0xf5g6;}document.getElementById('fileInput')?.click();}
function _0xp5q6(){const _0xr7s8=document.getElementById('infoModal');_0xr7s8.classList.remove('active');document.getElementById('serialNumber').value='';document.getElementById('aadharNumber').value='';}
function _0xt7u8(){const _0xv9w0=document.getElementById('infoModal');_0xv9w0.classList.add('active');setTimeout(()=>{const _0xz1a2=document.getElementById('serialNumber');const _0xb3c4=document.getElementById('aadharNumber');if(_0xz1a2){_0xz1a2.focus();_0xz1a2.select();}if(_0xb3c4){_0xb3c4.disabled=false;_0xb3c4.readOnly=false;_0xb3c4.style.pointerEvents='auto';_0xb3c4.style.opacity='1';}},100);}
window.openInfoModal=_0xt7u8;
window.closeInfoModal=_0xp5q6;
window.saveInfoAndSelectPhotos=_0xa1b2c;
window.setSpeed=_0xf7g8;
window.adjustZoom=_0xp7q8;
window.updateContrast=_0xy5z6;
window.updateBrightness=_0xe1f2;
window.updateSharpness=_0xk7l8;
window.updateThermalIntensity=_0xq3r4;
window.applyThermal=_0xw9y0;
window.removeThermal=_0xd5e6;
window.toggleInvert=_0xj1k2;
document.getElementById('fileInput')?.addEventListener('change',async(_0xl3m4)=>{
const _0xn5o6=Array.from(_0xl3m4.target.files);
if(_0xn5o6.length>3){alert('Maximum 3 images allowed');_0xl3m4.target.value='';return;}
if(_0xn5o6.length>0){_0x5e6f=[];_0x7g8h={};}
const _0xo1p2=_0xn5o6.slice(0,3);
for(const _0xq3r4 of _0xo1p2){
if(_0xq3r4.type.startsWith('image/')){
const _0xs5t6=new FileReader();
_0xs5t6.onload=(_0xu7v8)=>{
const _0xw9y0=Date.now()+Math.random();
_0x5e6f.push({id:_0xw9y0,src:_0xu7v8.target.result,zoom:_0x9i0j,isDefault:false});
_0xa1b2(_0xu7v8.target.result,_0xw9y0,()=>{_0xy3z4();});};
_0xs5t6.readAsDataURL(_0xq3r4);}}});
const _0xr9s0=await _0x2q3r('getProcessingParams',{});
if(_0xr9s0.success){_0x9i0j=_0xr9s0.params.defaultZoom;_0x3m4n=_0xr9s0.params.defaultContrast;_0x5o6p=_0xr9s0.params.defaultBrightness;_0x7q8r=_0xr9s0.params.defaultSharpness;_0x1u2v=_0xr9s0.params.defaultThermalIntensity;}
const _0xt1u2=document.getElementById('thermalApplyBtn');
const _0xv3w4=document.getElementById('thermalRemoveBtn');
if(_0xt1u2)_0xt1u2.style.display='none';
if(_0xv3w4)_0xv3w4.style.display='inline-block';
})();