diff --git a/page-uc/textEditor.html b/page-uc/textEditor.html index a1ac37481..94ac6f96a 100644 --- a/page-uc/textEditor.html +++ b/page-uc/textEditor.html @@ -3346,9 +3346,9 @@

🔒 Encryption and Decryption

Encrypt Text

-

+

1. Enter text to encrypt below
- 2. Enter an optional password
+ 2. Enter an optional password to be used as a key
3. Click "Encrypt" to generate encrypted text

modules
Light:
Dark:
Min:
Max:
(−1 for automatic, 0 to 7 for manual)
8x
Download
Output format:

Loading application...

(Are the JavaScript files missing?)

(The JavaScript code needs to be compiled from the TypeScript code.)

\ No newline at end of file diff --git a/page/textEditor-CUR.html b/page/textEditor-CUR.html index 031c317da..8f6135c5d 100644 --- a/page/textEditor-CUR.html +++ b/page/textEditor-CUR.html @@ -27,4 +27,4 @@ `+storedData,t.placeholder="",decryptionStage="data",scrollToTopFully())}let getPasswordKey=e=>window.crypto.subtle.importKey("raw",enc.encode(e),"PBKDF2",!1,["deriveKey"]),deriveKey=(e,t,a)=>window.crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:25e4,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!1,a);async function encryptData(e,t){try{var a=window.crypto.getRandomValues(new Uint8Array(16)),r=window.crypto.getRandomValues(new Uint8Array(12)),n=await getPasswordKey(t),o=await deriveKey(n,a,["encrypt"]),c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},o,enc.encode(e)),d=new Uint8Array(c),y=new Uint8Array(a.byteLength+r.byteLength+d.byteLength),s=(y.set(a,0),y.set(r,a.byteLength),y.set(d,a.byteLength+r.byteLength),buff_to_base64(y));return s}catch(e){return console.log("Error - "+e),""}}async function decryptData(e,t){try{var a=base64_to_buf(e),r=a.slice(0,16),n=a.slice(16,28),o=a.slice(28),c=await getPasswordKey(t),d=await deriveKey(c,r,["decrypt"]),y=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:n},d,o);return dec.decode(y)}catch(e){return console.log("Error - "+e),""}}

ތިރީގައި މިވާ އަކުރުތައް، މަތީގައިވާ ހުސްޖާގައިގައި ލިޔުމާއެކީ ވަގުތުން ދެންނެވިފައިވާ ބަސްތަކަށް ބަދަލުވެގެންދާނެއެވެ:

ތިރީގައިވާ ލަފްޒެއް ކްލިޕްބޯޑަށް ކުރުމަށް އޭގެ ބަޓަންއަށް ފިތާލާށެވެ.



ތިރީގައި ވަނީ ”KFGQPC Arabic Symbols 01“ ގެ ދިގު ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

ތިރީގައި ވަނީ ”KFGQPC Arabic Symbols 01“ ގެ ކުރު ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

ތިރީގައި ވަނީ ”AGA Arabesque Regular“ ގެ ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

Sum Total: 0.00

The Zakat for the total would be: 0.00


QR Code Generator 🏁

  8 pixels per module
QR:
Colors:Light = , dark =
Error correction:
Output format:
modules
Version range:Min = , Max =
(−1 for automatic, 0 to 7 for manual)
Boost ECC:
Statistics:QR Code version = 1, mask pattern = 6, character count = 0, encoding mode = none, error correction = level H, data bits = 0.


Third and Half of Night Calculator 🌙

Select Maghrib Time:    
Select Fajr Time:
Midnight is:
Last third is:
Second third is:
First third is:



If you don’t know the date of your child’s Aqiqah, you can use our Aqiqah date calculator.



Unit Converter 🧮






   
20 A    A

މަތީގައިވާ ލިޔާ ދެ ތަންކޮޅުގައި އެއްޗެއް ލިޔުމުން، އެ ދެ ލިޔުމުގެ ދެމެދުގައިވާ ތަފާތު ދައްކާނެ. ފަސޭހަވާނީ ޑެސްކްޓޮޕުން ބޭނުން ކުރަން.

މި ސަފުހާ ރަނގަޅަށް ލޯޑު ނުވާ ނަމަ، އަލުން ރީލޯޑު ކޮށްލުމުން ރަނގަޅުވާނެ.

ކަނާތު ފަޅީގައިވާ ބަދަލުތައް، ވާތު ފަޅިއަށް ލުމަށް '>' އަށް ފިތާލައްވާ.

ވާތު ފަޅީގައިވާ ބަދަލުތައް، ކަނާތު ފަޅިއަށް ލުމަށް '<' އަށް ފިތާލައްވާ.

މި ސަފުހާ ރަނގަޅަށް ލޯޑުނުވެ ހުރެދާނެއެވެ. އެ ހާލަތުގައި މަޑު ނުވަތަ ހަރު ރީލޯޑު ކުރާށެވެ.

ފިލިތަކުގައި ހުރި ތަފާތުތައް ނުދައްކަފާނެ.




އިތުރަށް ފައިދާކޮށްފާނެ ލިންކުތައް:




—  އިތުރު މައުލޫމާތު ހޯދުމަށް މިތަނަށް ފިތާލައްވާ  —

މިއީ މައިގަނޑު ގޮތެއްގައި ދިވެހި ބަހާއި އަރަބި ބަހުގެ ލިޔުންތެރިން ބޭނުން ހިފުމަށް ހަދާފައިވާ ޓެކްސްޓު އެޑިޓަރެކެވެ.

ބައެއް ބަޓަންތަކުގައި އެއް ފަހަރަށްވުރެ ގިނަ ފަހަރު ފިތާލީމާ އިތުރު ގޮތެއް ވާނެއެވެ.

ޑެސްކްޓޮޕް ބޭނުން ކުރާނަމަ، އެންމެ މަތީގައިވާ ލިޔާ ޖާގައިގެ ކަން މައުސް އިން ހިފާ ދަމާލައިގެން އެ ޖާގަ ބޮޑުކުރެވިދާނެއެވެ.

ވެބްސައިޓު ބޭނުން ކުރާނަމަ، މި ސަފުހާ ބަންދު ކުރިޔަސް، އެންމެ މަތީގައި ލިޔާ އެއްޗެއް ސޭވްވެފައި ހުންނާނެއެވެ.

ޑެސްކްޓޮޕްގައި އޮފްލައިންކޮށް މި ސަފުހާ ބޭނުންކުރަން އެދޭނަމަ، ބްރައުސާގައި ހުންނަވާއިރު ކީބޯޑުގައި ctrl+s އަށް ފިތާލުމަށްފަހު، ކޮމްޕްލީޓް ވެބްޕޭޖް html. ފައިލެއްހެން ސޭވްކޮށްގެން ބޭނުން ކުރެވިދާނެއެވެ. އޭގެ ފަހުން އަދާހަމަކުރަން އެދޭނަމަ އަލުން އެގޮތަށް ސޭވް ކުރާނީއެވެ.

ޑެސްކްޓޮޕުގައި ވަނިކޮށް، ބަޓަނެއްގައި ޖަހާފައިވާ އަކުރެއްގެ ތިރީގައި ރޮނގެއް ދަމާފައިވާ އެ އަކުރުގެ ކީއާއެކު Alt ކީއަށް ފިތައިފި ނަމަ، ކީބޯޑުން އެ ބަޓަނަކަށް ފިތޭ ގޮތް ވާނެއެވެ.




\ No newline at end of file +-10 gifts..."oninput=outputSum() autocapitalize=off autocomplete=off autocorrect=off spellcheck=false>

The Zakat for the total would be: 0.00


QR Code Generator 🏁

  8 pixels per module
QR:
Colors:Light = , dark =
Error correction:
Output format:
modules
Version range:Min = , Max =
(−1 for automatic, 0 to 7 for manual)
Boost ECC:
Statistics:QR Code version = 1, mask pattern = 6, character count = 0, encoding mode = none, error correction = level H, data bits = 0.


Third and Half of Night Calculator 🌙

Select Maghrib Time:    
Select Fajr Time:
Midnight is:
Last third is:
Second third is:
First third is:



If you don’t know the date of your child’s Aqiqah, you can use our Aqiqah date calculator.



Unit Converter 🧮






   
20 A    A

މަތީގައިވާ ލިޔާ ދެ ތަންކޮޅުގައި އެއްޗެއް ލިޔުމުން، އެ ދެ ލިޔުމުގެ ދެމެދުގައިވާ ތަފާތު ދައްކާނެ. ފަސޭހަވާނީ ޑެސްކްޓޮޕުން ބޭނުން ކުރަން.

މި ސަފުހާ ރަނގަޅަށް ލޯޑު ނުވާ ނަމަ، އަލުން ރީލޯޑު ކޮށްލުމުން ރަނގަޅުވާނެ.

ކަނާތު ފަޅީގައިވާ ބަދަލުތައް، ވާތު ފަޅިއަށް ލުމަށް '>' އަށް ފިތާލައްވާ.

ވާތު ފަޅީގައިވާ ބަދަލުތައް، ކަނާތު ފަޅިއަށް ލުމަށް '<' އަށް ފިތާލައްވާ.

މި ސަފުހާ ރަނގަޅަށް ލޯޑުނުވެ ހުރެދާނެއެވެ. އެ ހާލަތުގައި މަޑު ނުވަތަ ހަރު ރީލޯޑު ކުރާށެވެ.

ފިލިތަކުގައި ހުރި ތަފާތުތައް ނުދައްކަފާނެ.




އިތުރަށް ފައިދާކޮށްފާނެ ލިންކުތައް:




—  އިތުރު މައުލޫމާތު ހޯދުމަށް މިތަނަށް ފިތާލައްވާ  —

މިއީ މައިގަނޑު ގޮތެއްގައި ދިވެހި ބަހާއި އަރަބި ބަހުގެ ލިޔުންތެރިން ބޭނުން ހިފުމަށް ހަދާފައިވާ ޓެކްސްޓު އެޑިޓަރެކެވެ.

ބައެއް ބަޓަންތަކުގައި އެއް ފަހަރަށްވުރެ ގިނަ ފަހަރު ފިތާލީމާ އިތުރު ގޮތެއް ވާނެއެވެ.

ޑެސްކްޓޮޕް ބޭނުން ކުރާނަމަ، އެންމެ މަތީގައިވާ ލިޔާ ޖާގައިގެ ކަން މައުސް އިން ހިފާ ދަމާލައިގެން އެ ޖާގަ ބޮޑުކުރެވިދާނެއެވެ.

ވެބްސައިޓު ބޭނުން ކުރާނަމަ، މި ސަފުހާ ބަންދު ކުރިޔަސް، އެންމެ މަތީގައި ލިޔާ އެއްޗެއް ސޭވްވެފައި ހުންނާނެއެވެ.

ޑެސްކްޓޮޕްގައި އޮފްލައިންކޮށް މި ސަފުހާ ބޭނުންކުރަން އެދޭނަމަ، ބްރައުސާގައި ހުންނަވާއިރު ކީބޯޑުގައި ctrl+s އަށް ފިތާލުމަށްފަހު، ކޮމްޕްލީޓް ވެބްޕޭޖް html. ފައިލެއްހެން ސޭވްކޮށްގެން ބޭނުން ކުރެވިދާނެއެވެ. އޭގެ ފަހުން އަދާހަމަކުރަން އެދޭނަމަ އަލުން އެގޮތަށް ސޭވް ކުރާނީއެވެ.

ޑެސްކްޓޮޕުގައި ވަނިކޮށް، ބަޓަނެއްގައި ޖަހާފައިވާ އަކުރެއްގެ ތިރީގައި ރޮނގެއް ދަމާފައިވާ އެ އަކުރުގެ ކީއާއެކު Alt ކީއަށް ފިތައިފި ނަމަ، ކީބޯޑުން އެ ބަޓަނަކަށް ފިތޭ ގޮތް ވާނެއެވެ.




\ No newline at end of file diff --git a/page/textEditor-OLD.html b/page/textEditor-OLD.html index 8f6135c5d..8c36ceed0 100644 --- a/page/textEditor-OLD.html +++ b/page/textEditor-OLD.html @@ -27,4 +27,4 @@ `+storedData,t.placeholder="",decryptionStage="data",scrollToTopFully())}let getPasswordKey=e=>window.crypto.subtle.importKey("raw",enc.encode(e),"PBKDF2",!1,["deriveKey"]),deriveKey=(e,t,a)=>window.crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:25e4,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!1,a);async function encryptData(e,t){try{var a=window.crypto.getRandomValues(new Uint8Array(16)),r=window.crypto.getRandomValues(new Uint8Array(12)),n=await getPasswordKey(t),o=await deriveKey(n,a,["encrypt"]),c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},o,enc.encode(e)),d=new Uint8Array(c),y=new Uint8Array(a.byteLength+r.byteLength+d.byteLength),s=(y.set(a,0),y.set(r,a.byteLength),y.set(d,a.byteLength+r.byteLength),buff_to_base64(y));return s}catch(e){return console.log("Error - "+e),""}}async function decryptData(e,t){try{var a=base64_to_buf(e),r=a.slice(0,16),n=a.slice(16,28),o=a.slice(28),c=await getPasswordKey(t),d=await deriveKey(c,r,["decrypt"]),y=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:n},d,o);return dec.decode(y)}catch(e){return console.log("Error - "+e),""}}

ތިރީގައި މިވާ އަކުރުތައް، މަތީގައިވާ ހުސްޖާގައިގައި ލިޔުމާއެކީ ވަގުތުން ދެންނެވިފައިވާ ބަސްތަކަށް ބަދަލުވެގެންދާނެއެވެ:

ތިރީގައިވާ ލަފްޒެއް ކްލިޕްބޯޑަށް ކުރުމަށް އޭގެ ބަޓަންއަށް ފިތާލާށެވެ.



ތިރީގައި ވަނީ ”KFGQPC Arabic Symbols 01“ ގެ ދިގު ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

ތިރީގައި ވަނީ ”KFGQPC Arabic Symbols 01“ ގެ ކުރު ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

ތިރީގައި ވަނީ ”AGA Arabesque Regular“ ގެ ސިމްބޮލްތަކެވެ. ފޮންޓު އެޕްލައި ކުރުމަށް ފަހު ވޯރޑުގައި ޕޭސްޓު ކުރާށެވެ.

Sum Total: 0.00

The Zakat for the total would be: 0.00


QR Code Generator 🏁

  8 pixels per module
QR:
Colors:Light = , dark =
Error correction:
Output format:
modules
Version range:Min = , Max =
(−1 for automatic, 0 to 7 for manual)
Boost ECC:
Statistics:QR Code version = 1, mask pattern = 6, character count = 0, encoding mode = none, error correction = level H, data bits = 0.


Third and Half of Night Calculator 🌙

Select Maghrib Time:    
Select Fajr Time:
Midnight is:
Last third is:
Second third is:
First third is:



If you don’t know the date of your child’s Aqiqah, you can use our Aqiqah date calculator.



Unit Converter 🧮






   
20 A    A

މަތީގައިވާ ލިޔާ ދެ ތަންކޮޅުގައި އެއްޗެއް ލިޔުމުން، އެ ދެ ލިޔުމުގެ ދެމެދުގައިވާ ތަފާތު ދައްކާނެ. ފަސޭހަވާނީ ޑެސްކްޓޮޕުން ބޭނުން ކުރަން.

މި ސަފުހާ ރަނގަޅަށް ލޯޑު ނުވާ ނަމަ، އަލުން ރީލޯޑު ކޮށްލުމުން ރަނގަޅުވާނެ.

ކަނާތު ފަޅީގައިވާ ބަދަލުތައް، ވާތު ފަޅިއަށް ލުމަށް '>' އަށް ފިތާލައްވާ.

ވާތު ފަޅީގައިވާ ބަދަލުތައް، ކަނާތު ފަޅިއަށް ލުމަށް '<' އަށް ފިތާލައްވާ.

މި ސަފުހާ ރަނގަޅަށް ލޯޑުނުވެ ހުރެދާނެއެވެ. އެ ހާލަތުގައި މަޑު ނުވަތަ ހަރު ރީލޯޑު ކުރާށެވެ.

ފިލިތަކުގައި ހުރި ތަފާތުތައް ނުދައްކަފާނެ.




އިތުރަށް ފައިދާކޮށްފާނެ ލިންކުތައް:




—  އިތުރު މައުލޫމާތު ހޯދުމަށް މިތަނަށް ފިތާލައްވާ  —

މިއީ މައިގަނޑު ގޮތެއްގައި ދިވެހި ބަހާއި އަރަބި ބަހުގެ ލިޔުންތެރިން ބޭނުން ހިފުމަށް ހަދާފައިވާ ޓެކްސްޓު އެޑިޓަރެކެވެ.

ބައެއް ބަޓަންތަކުގައި އެއް ފަހަރަށްވުރެ ގިނަ ފަހަރު ފިތާލީމާ އިތުރު ގޮތެއް ވާނެއެވެ.

ޑެސްކްޓޮޕް ބޭނުން ކުރާނަމަ، އެންމެ މަތީގައިވާ ލިޔާ ޖާގައިގެ ކަން މައުސް އިން ހިފާ ދަމާލައިގެން އެ ޖާގަ ބޮޑުކުރެވިދާނެއެވެ.

ވެބްސައިޓު ބޭނުން ކުރާނަމަ، މި ސަފުހާ ބަންދު ކުރިޔަސް، އެންމެ މަތީގައި ލިޔާ އެއްޗެއް ސޭވްވެފައި ހުންނާނެއެވެ.

ޑެސްކްޓޮޕްގައި އޮފްލައިންކޮށް މި ސަފުހާ ބޭނުންކުރަން އެދޭނަމަ، ބްރައުސާގައި ހުންނަވާއިރު ކީބޯޑުގައި ctrl+s އަށް ފިތާލުމަށްފަހު، ކޮމްޕްލީޓް ވެބްޕޭޖް html. ފައިލެއްހެން ސޭވްކޮށްގެން ބޭނުން ކުރެވިދާނެއެވެ. އޭގެ ފަހުން އަދާހަމަކުރަން އެދޭނަމަ އަލުން އެގޮތަށް ސޭވް ކުރާނީއެވެ.

ޑެސްކްޓޮޕުގައި ވަނިކޮށް، ބަޓަނެއްގައި ޖަހާފައިވާ އަކުރެއްގެ ތިރީގައި ރޮނގެއް ދަމާފައިވާ އެ އަކުރުގެ ކީއާއެކު Alt ކީއަށް ފިތައިފި ނަމަ، ކީބޯޑުން އެ ބަޓަނަކަށް ފިތޭ ގޮތް ވާނެއެވެ.




\ No newline at end of file +-10 gifts..."oninput=outputSum() autocapitalize=off autocomplete=off autocorrect=off spellcheck=false>

The Zakat for the total would be: 0.00


QR Code Generator 🏁

  8 pixels per module
QR:
Colors:Light = , dark =
Error correction:
Output format:
modules
Version range:Min = , Max =
(−1 for automatic, 0 to 7 for manual)
Boost ECC:
Statistics:QR Code version = 1, mask pattern = 6, character count = 0, encoding mode = none, error correction = level H, data bits = 0.


Third and Half of Night Calculator 🌙

Select Maghrib Time:    
Select Fajr Time:
Midnight is:
Last third is:
Second third is:
First third is:



If you don’t know the date of your child’s Aqiqah, you can use our Aqiqah date calculator.



Unit Converter 🧮






   
20 A    A

މަތީގައިވާ ލިޔާ ދެ ތަންކޮޅުގައި އެއްޗެއް ލިޔުމުން، އެ ދެ ލިޔުމުގެ ދެމެދުގައިވާ ތަފާތު ދައްކާނެ. ފަސޭހަވާނީ ޑެސްކްޓޮޕުން ބޭނުން ކުރަން.

މި ސަފުހާ ރަނގަޅަށް ލޯޑު ނުވާ ނަމަ، އަލުން ރީލޯޑު ކޮށްލުމުން ރަނގަޅުވާނެ.

ކަނާތު ފަޅީގައިވާ ބަދަލުތައް، ވާތު ފަޅިއަށް ލުމަށް '>' އަށް ފިތާލައްވާ.

ވާތު ފަޅީގައިވާ ބަދަލުތައް، ކަނާތު ފަޅިއަށް ލުމަށް '<' އަށް ފިތާލައްވާ.

މި ސަފުހާ ރަނގަޅަށް ލޯޑުނުވެ ހުރެދާނެއެވެ. އެ ހާލަތުގައި މަޑު ނުވަތަ ހަރު ރީލޯޑު ކުރާށެވެ.

ފިލިތަކުގައި ހުރި ތަފާތުތައް ނުދައްކަފާނެ.




އިތުރަށް ފައިދާކޮށްފާނެ ލިންކުތައް:




—  އިތުރު މައުލޫމާތު ހޯދުމަށް މިތަނަށް ފިތާލައްވާ  —

މިއީ މައިގަނޑު ގޮތެއްގައި ދިވެހި ބަހާއި އަރަބި ބަހުގެ ލިޔުންތެރިން ބޭނުން ހިފުމަށް ހަދާފައިވާ ޓެކްސްޓު އެޑިޓަރެކެވެ.

ބައެއް ބަޓަންތަކުގައި އެއް ފަހަރަށްވުރެ ގިނަ ފަހަރު ފިތާލީމާ އިތުރު ގޮތެއް ވާނެއެވެ.

ޑެސްކްޓޮޕް ބޭނުން ކުރާނަމަ، އެންމެ މަތީގައިވާ ލިޔާ ޖާގައިގެ ކަން މައުސް އިން ހިފާ ދަމާލައިގެން އެ ޖާގަ ބޮޑުކުރެވިދާނެއެވެ.

ވެބްސައިޓު ބޭނުން ކުރާނަމަ، މި ސަފުހާ ބަންދު ކުރިޔަސް، އެންމެ މަތީގައި ލިޔާ އެއްޗެއް ސޭވްވެފައި ހުންނާނެއެވެ.

ޑެސްކްޓޮޕްގައި އޮފްލައިންކޮށް މި ސަފުހާ ބޭނުންކުރަން އެދޭނަމަ، ބްރައުސާގައި ހުންނަވާއިރު ކީބޯޑުގައި ctrl+s އަށް ފިތާލުމަށްފަހު، ކޮމްޕްލީޓް ވެބްޕޭޖް html. ފައިލެއްހެން ސޭވްކޮށްގެން ބޭނުން ކުރެވިދާނެއެވެ. އޭގެ ފަހުން އަދާހަމަކުރަން އެދޭނަމަ އަލުން އެގޮތަށް ސޭވް ކުރާނީއެވެ.

ޑެސްކްޓޮޕުގައި ވަނިކޮށް، ބަޓަނެއްގައި ޖަހާފައިވާ އަކުރެއްގެ ތިރީގައި ރޮނގެއް ދަމާފައިވާ އެ އަކުރުގެ ކީއާއެކު Alt ކީއަށް ފިތައިފި ނަމަ، ކީބޯޑުން އެ ބަޓަނަކަށް ފިތޭ ގޮތް ވާނެއެވެ.




\ No newline at end of file diff --git a/page/textEditor.html b/page/textEditor.html index 508fc5d2c..edc8e8912 100644 --- a/page/textEditor.html +++ b/page/textEditor.html @@ -5,4 +5,4 @@ To divide, write a forward slash between the numbers. Use this to calculate the total cost for a list of items, or add up kilos when packing luggage. Eg: 50 books --10 gifts..."style=direction:ltr;text-align:left>
The Zakat for the total would be: 0.00

🔢 Direct Proportion Calculator

If g = $
then g = $
If g = $
then g = $

🌙 Islamic Night Time Calculator

Midnight: --:--
Second Third: --:--
Last Third: --:--


🩸 If you don’t know the date of your child’s Aqiqah, you can use our
Aqiqah date calculator.


🔄 You can convert different units of measurement using the
Unit Converter.


🔗 Link to Calculator Soup
A free online calculator. Includes time value of money, math, algebra, trigonometry, fractions, physics, statistics, time & date and conversions calculators.


- Results on this pageare not guaranteed to be 100% correct. -

🔒 Text Encryption and Decryption

(Uses AES 256-GCM & PBKDF2)

Encrypt Text

1. Enter text to encrypt below
2. Enter an optional password
3. Click "Encrypt" to generate encrypted text

Decrypt Text

1. Paste encrypted text below
2. Enter the same password used for encryption
3. Click "Decrypt" to reveal original text

Encrypt File

1. Select a file to encrypt
2. Enter an optional password
3. Click "Encrypt" to download encrypted file

Decrypt File

1. Select an encrypted file
2. Enter the same password used for encryption
3. Click "Decrypt" to download original file

\ No newline at end of file +-10 gifts..."style=direction:ltr;text-align:left>
The Zakat for the total would be: 0.00

🔢 Direct Proportion Calculator

If g = $
then g = $
If g = $
then g = $

🌙 Islamic Night Time Calculator

Midnight: --:--
Second Third: --:--
Last Third: --:--


🩸 If you don’t know the date of your child’s Aqiqah, you can use our
Aqiqah date calculator.


🔄 You can convert different units of measurement using the
Unit Converter.


🔗 Link to Calculator Soup
A free online calculator. Includes time value of money, math, algebra, trigonometry, fractions, physics, statistics, time & date and conversions calculators.


- Results on this pageare not guaranteed to be 100% correct. -

🔒 Encryption and Decryption

(Uses AES 256-GCM & PBKDF2)

Encrypt Text

1. Enter text to encrypt below
2. Enter an optional password
3. Click "Encrypt" to generate encrypted text

Decrypt Text

1. Paste encrypted text below
2. Enter the same password used for encryption
3. Click "Decrypt" to reveal original text

Encrypt File

1. Select a file to encrypt
2. Enter an optional password
3. Click "Encrypt" to download encrypted file

Decrypt File

1. Select an encrypted file
2. Enter the same password used for encryption
3. Click "Decrypt" to download original file

\ No newline at end of file diff --git a/page/textEditor.min.js b/page/textEditor.min.js index 64c6b9998..b2890ffb5 100644 --- a/page/textEditor.min.js +++ b/page/textEditor.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",(()=>{function e(){const e=this.value;E.value=e,f.value=e,b.style.fontSize=`${e}px`}function t(){var e=b.value;const t=e.trim()?e.trim().split(/\s+/).length:0,a=e?e.split("\n").length:0;k.textContent=`Char: ${e.length}`,I.textContent=`Wrd: ${t}`,$.textContent=`Ln: ${a}`,e=new Blob([e]).size,B.textContent=1024>e?`B: ${e}`:1048576>e?`KB: ${(e/1024).toFixed(2)}`:1073741824>e?`MB: ${(e/1048576).toFixed(2)}`:`GB: ${(e/1073741824).toFixed(2)}`}function a(e){C[w-1].content=b.value,w=e,b.value=C.find((t=>t.id===e)).content,document.querySelectorAll(".numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),t()}function n(){b.style.direction="ltr",b.style.textAlign="left"}function r(){window.scrollTo({top:0,behavior:"smooth"})}function l(){document.querySelectorAll(".dropdown-content").forEach((e=>{e.classList.remove("show")}))}function o(){const e=new Date,t="true"===localStorage.getItem("militaryTime"),a=e.getHours()%12||12,n=String(e.getHours()).padStart(2,"0");var r=t?n:a;const l=12<=e.getHours()?"PM":"AM";String(e.getMinutes()).padStart(2,"0");var o=e.toLocaleDateString("en-GB",{weekday:"long",day:"numeric",month:"long",year:"numeric"});o=o.replace(/^(\w+)\s+(\d+)/,((e,t,a)=>`${t}, ${a}${["th","st","nd","rd"][3{if("weekday"===e.type&&(m=d[e.value]||e.value),"day"===e.type&&(p=e.value),"month"===e.type){var t=e.value;g=r[t]?.[0]||t}"year"===e.type&&(v=e.value)})),document.getElementById("hijriLongEn").textContent=`${m}, ${parseInt(p)} ${g} ${v} AH, at ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`,i.forEach((e=>{if("day"===e.type&&(y=e.value),"month"===e.type){var t=e.value;h=r[t]?.[1]||t}"year"===e.type&&(b=e.value)})),document.getElementById("hijriLongDv").textContent=`${o[e.getDay()]}، ${parseInt(y)} ${h} ${b}، ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+c}`;const E=new Intl.DateTimeFormat("en-u-ca-islamic",{day:"numeric",month:"numeric",year:"numeric",calendar:"islamic"}).format(e).replace(/[^0-9/]/g,"");document.getElementById("hijriShort").textContent=`${E} ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`}catch(e){console.error("Error formatting Hijri dates:",e),["hijriLongAr","hijriLongEn","hijriLongDv","hijriShort"].forEach((e=>{document.getElementById(e).textContent="Hijri date unavailable"}))}document.getElementById("gregorianShort").textContent=`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()} ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`}function c(e,t){const a=document.createElement("span");a.textContent=t,a.className="copy-feedback",e.appendChild(a),e.classList.add("copy-success"),setTimeout((()=>{a.remove(),e.classList.remove("copy-success")}),1e3)}function s(){var e=document.getElementById("maghribTime"),t=document.getElementById("fajrTime");if(e.value&&t.value){e=u(e.value),(t=u(t.value)){const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>a(n.error),n.readAsArrayBuffer(e)}))}function g(e,t){e=URL.createObjectURL(e);const a=document.createElement("a");a.href=e,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(e)}function v(e,t="Choose File"){e.nextElementSibling.textContent=e.files[0]?.name||t}const y=document.querySelectorAll(".top-tab"),h=document.querySelectorAll(".tab-content"),b=document.getElementById("textArea"),E=document.getElementById("fontSizeSlider"),f=document.getElementById("fontSize"),k=document.getElementById("charCount"),I=document.getElementById("wordCount"),$=document.getElementById("lineCount"),B=document.getElementById("fileSize"),S=document.getElementById("addTab"),L=document.querySelector(".numbered-tabs");let w=1,C=[{id:1,content:""}];y.forEach((e=>{e.addEventListener("click",(()=>{y.forEach((e=>e.classList.remove("active"))),e.classList.add("active"),h.forEach((t=>{t.classList.remove("active"),t.id===`${e.dataset.tab}Tab`&&t.classList.add("active")}))}))})),E.addEventListener("input",e),f.addEventListener("change",e),f.addEventListener("click",(function(){})),b.addEventListener("input",function(e){let t;return function(...a){clearTimeout(t),t=setTimeout((()=>{clearTimeout(t),e(...a)}),300)}}(t)),S.addEventListener("click",(()=>{const e=C.length+1;C.push({id:e,content:""});const t=document.createElement("button");t.classList.add("numbered-tab"),t.dataset.tab=e,t.textContent=e,L.insertBefore(t,S),a(e)})),L.addEventListener("click",(e=>{e.target.classList.contains("numbered-tab")&&a(parseInt(e.target.dataset.tab))})),document.querySelectorAll(".dropdown-button").forEach((e=>{const a=e.querySelector(".function-button"),o=e.querySelector(".dropdown-content");a.addEventListener("click",(e=>{e.stopPropagation(),l(),o.classList.toggle("show")})),o.addEventListener("click",(e=>{e.stopPropagation(),"BUTTON"===e.target.tagName&&e.target.dataset.action&&(function(e){switch(e){case"arabicToRegular":b.value=b.value.replace(/[٠١٢٣٤٥٦٧٨٩]/g,(e=>"٠١٢٣٤٥٦٧٨٩".indexOf(e)));break;case"regularToArabic":b.value=b.value.replace(/[0-9]/g,(e=>"٠١٢٣٤٥٦٧٨٩"[e]));case"convertNumerals":var a={regular:"0123456789",arabic:"٠١٢٣٤٥٦٧٨٩",superscript:"⁰¹²³⁴⁵⁶⁷⁸⁹",mathSansSerif:"𝟢𝟣𝟤𝟥𝟦𝟧𝟨𝟩𝟪𝟫",mathSansSerifBold:"𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵",fullWidth:"0123456789",circled:"⓪①②③④⑤⑥⑦⑧⑨",negativeCircled:"⓿❶❷❸❹❺❻❼❽❾"};const v=a[document.getElementById("numeralFrom").value],y=a[document.getElementById("numeralTo").value];b.value=b.value.replace(/[0-9]/g,(e=>{const t=v.indexOf(e);return-1!==t?y[t]:e}));break;case"removePrecedingZeros":b.value=b.value.replace(/\b0+(\d)/g,"$1");break;case"removeAllNumbers":b.value=b.value.replace(/[٠-٩0-9]/g,"");break;case"keepOnlyNumbers":b.value=b.value.replace(/[^٠-٩0-9]/g,"");break;case"rtlStraightToCurly":case"ltrStraightToCurly":a="rtlStraightToCurly"===e,b.value=b.value.replace(/(\W|^)"(\S)/g,`$1${a?"”":"“"}$2`).replace(new RegExp(`(${a?"”":"“"}[^"]*)"([^"]*$|[^${a?"”":"“"}"]*${a?"”":"“"})`,"g"),`$1${a?"“":"”"}$2`).replace(/([^0-9])"/g,"$1"+(a?"“":"”")).replace(/(\W|^)'(\S)/g,`$1${a?"’":"‘"}$2`).replace(/([a-z])'([a-z])/gi,"$1‘$2").replace(/((\u2019[^']*)|[a-z])'([^0-9]|$)/gi,`$1${a?"‘":"’"}$3`).replace(/(\u2019)([0-9]{2}[^\u2018]*)(\u2019([^0-9]|$)|$|\u2018[a-z])/gi,"‘$2$3").replace(/(\B|^)\u2019(?=([^\u2018]*\u2018\b)*([^\u2018\u2019]*\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1‘").replace(/'''/g,"‴").replace(/''/g,"″").replace(/'/g,"′");break;case"curlyToStraight":b.value=b.value.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"');break;case"reverseCurlyQuotes":b.value=b.value.replace(/“|”/g,(e=>"“"===e?"”":"“")).replace(/‘|’/g,(e=>"‘"===e?"’":"‘")).replace(/❝|❞/g,(e=>"❝"===e?"❞":"❝")).replace(/\ud83d\ude76|\ud83d\ude77/g,(e=>"🙷"));break;case"convertQuotes":var o={straightSingle:["'","'"],straightDouble:['"','"'],ltrCurlyDouble:["“","”"],rtlCurlyDouble:["”","“"],ltrCurlySingle:["‘","’"],rtlCurlySingle:["’","‘"],angleQuotes:["«","»"],doubleBrackets:["((","))"],heavyCommaQuotes:["❝","❞"],sansSerifHeavyCommaQuotes:["🙶","🙷"]};a=o[document.getElementById("quoteFrom").value],o=o[document.getElementById("quoteTo").value];var c=a[0].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a[1].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),b.value=b.value.replace(new RegExp(`${c}([^${a}]*)${a}`,"g"),`${o[0]}$1${o[1]}`);break;case"removeJsComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeHtmlComments":b.value=b.value.replace(/\x3c!--[\s\S]*?--\x3e/g,""),n();break;case"removeCssComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\//g,""),n();break;case"removePowershellComments":b.value=b.value.replace(/#.*$/gm,"").replace(/<#[\s\S]*?#>/g,""),n();break;case"removePythonComments":b.value=b.value.replace(/#.*$/gm,"").replace(/'''[\s\S]*?'''|"""[\s\S]*?"""/g,""),n();break;case"removePhpComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*|#.*$/gm,""),n();break;case"removeCComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeCSharpComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeJavaComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\*\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeRubyComments":b.value=b.value.replace(/#.*$/gm,"").replace(/^=begin[\s\S]*?^=end/gm,""),n();break;case"removeBashComments":b.value=b.value.replace(/#.*$/gm,""),n();break;case"removeGoComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeRustComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\/!.*|\/\/.*/g,""),n();break;case"removeSwiftComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeKotlinComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\*\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeDartComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeSqlComments":b.value=b.value.replace(/\/\*[\s\S]*?\*\/|--.*$/gm,""),n();break;case"textToParagraphs":b.value=b.value.split("\n").filter((e=>e.trim())).map((e=>`

${e}

`)).join("\n"),n();break;case"textToBrTags":b.value=b.value.split("\n").join("
\n"),n();break;case"textToOrderedList":b.value="
    \n"+b.value.split("\n").filter((e=>e.trim())).map((e=>`
  1. ${e}
  2. `)).join("\n")+"\n
",n();break;case"textToUnorderedList":b.value="",n();break;case"removeHtmlTags":b.value=b.value.replace(/<[^>]*>/g,"");break;case"removeArabicDiacritics":b.value=b.value.replace(/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/g,"");break;case"removeDhivehiFili":b.value=b.value.replace(/[\u07A6-\u07B0]/g,"");break;case"removeThikijehiThaana":const h={"ޘ":"ސ","ޙ":"ހ","ޛ":"ޒ","ޜ":"ޒ","ޞ":"ސ","ޠ":"ތ","ޡ":"ޒ","ޢ":"އ","ޤ":"ގ","ޥ":"ވ"};b.value=b.value.replace(/[ޘޙޛޜޞޠޡޢޤޥ]/g,(e=>h[e]||e));break;case"saveFile":a=new Blob([b.value],{type:"text/plain;charset=utf-8"}),(o=document.createElement("a")).href=URL.createObjectURL(a),o.download="saved_text.txt",o.click();break;case"loadFile":(a=document.createElement("input")).type="file",a.accept="text/plain",a.onchange=e=>{e=e.target.files[0];const a=new FileReader;a.onload=e=>{b.value=e.target.result,t()},a.readAsText(e)},a.click();break;case"titleCase":b.value=b.value.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()));break;case"sentenceCase":b.value=b.value.toLowerCase().replace(/(^\w|\.\s+\w)/g,(e=>e.toUpperCase()));break;case"lowercase":b.value=b.value.toLowerCase();break;case"UPPERCASE":b.value=b.value.toUpperCase();break;case"alternatingCase":b.value=b.value.split("").map(((e,t)=>0==t%2?e.toLowerCase():e.toUpperCase())).join("");break;case"inverseCase":b.value=b.value.split("").map((e=>e===e.toUpperCase()?e.toLowerCase():e.toUpperCase())).join("");break;case"randomCase":b.value=b.value.split("").map((e=>.5t.toUpperCase()));break;case"pascalCase":b.value=b.value.toLowerCase().replace(/(^|[^a-zA-Z0-9]+)(.)/g,((e,t,a)=>a.toUpperCase()));break;case"snakeCase":b.value=b.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"");break;case"constantCase":b.value=b.value.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"");break;case"kebabCase":b.value=b.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"");break;case"dotCase":b.value=b.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,".").replace(/^\.+|\.+$/g,"");break;case"flatcase":b.value=b.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"");break;case"splitIntoWords":b.value=b.value.split(/\s+/).filter((e=>0{E[e]=(E[e]||0)+1})),a=Object.entries(E).sort(((e,t)=>t[1]-e[1])).map((([e,t])=>`${t}: ${e}`)),b.value=a.join("\n");break;case"sortLinesByFrequency":r();const f={};b.value.split("\n").filter((e=>""!==e.trim())).forEach((e=>{f[e]=(f[e]||0)+1})),a=Object.entries(f).sort(((e,t)=>t[1]-e[1])).map((([e,t])=>`${t}: ${e}`)),b.value=a.join("\n");break;case"sortLinesAscending":b.value=b.value.split("\n").sort(((e,t)=>e.localeCompare(t))).join("\n");break;case"sortLinesDescending":b.value=b.value.split("\n").sort(((e,t)=>t.localeCompare(e))).join("\n");break;case"randomizeLines":b.value=b.value.split("\n").sort((()=>Math.random()-.5)).join("\n");break;case"removeDuplicateLines":b.value=[...new Set(b.value.split("\n"))].join("\n");break;case"reverseTextHorizontal":b.value=b.value.split("").reverse().join("");break;case"reverseTextVertical":b.value=b.value.split("\n").reverse().join("\n");break;case"addLineNumbers":const k=document.getElementById("addNumbersWith").value;a=b.value.split("\n").map(((e,t)=>`${t+1}${k} ${e}`)),b.value=a.join("\n");break;case"removeLineNumbers":o=document.getElementById("removeNumbersWith").value,a=b.value.split("\n"),o=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const I=new RegExp(`^\\d+${o}\\s+`);a=a.map((e=>e.replace(I,""))),b.value=a.join("\n");break;case"decodeUnicode":b.value=b.value.replace(/\\u([0-9a-fA-F]{4})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})),n();break;case"encodeUnicode":b.value=b.value.replace(/[\s\S]/g,(function(e){for(e=e.charCodeAt(0).toString(16);4>e.length;)e="0"+e;return"\\u"+e})),n();break;case"decodeURL":try{b.value=decodeURI(b.value)}catch(U){alert("Invalid URL encoding")}n();break;case"encodeURL":b.value=encodeURI(b.value),n();break;case"whichUnicodeCharacter":for(a=b.value,o="",c=0;c"rtl"===S&&"corner"===L?e===$[0]?B[1]:B[0]:e===$[0]?B[0]:B[1]));break;case"reverseBracketDirection":const w={"(":")",")":"(","[":"]","]":"[","⁽":"⁾","⁾":"⁽","⌜":"⌝","⌝":"⌜"};b.value=b.value.replace(/[()[\]⁽⁾⌜⌝]/g,(e=>w[e]));break;case"convertNumberBrackets":const C={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"},x=(a={none:["",""],round:["(",")"],square:["[","]"],superscript:["⁽","⁾"]})[document.getElementById("numberBracketFrom").value],T=a[document.getElementById("numberBracketTo").value],A=document.getElementById("numberBracketTo").value;a=b.value,x[0]&&(a=a.replace(new RegExp(`\\${x[0]}\\d+\\${x[1]}`,"g"),(e=>e.slice(x[0].length,-x[1].length)))),T[0]&&(a=a.replace(/\d+/g,(e=>(e="superscript"===A?e.split("").map((e=>C[e])).join(""):e,`${T[0]}${e}${T[1]}`)))),b.value=a;break;case"removeNumberBrackets":a={round:["(",")"],square:["[","]"],superscript:["⁽","⁾"],none:["",""]}[document.getElementById("numberBracketRemove").value],b.value=b.value.replace(new RegExp(`\\${a[0]}\\d+\\${a[1]}`,"g"),""),t();break;case"keepOnlyDhivehi":b.value=b.value.replace(/[^\u0780-\u07BF\s]/g,"");break;case"removeAllDhivehi":b.value=b.value.replace(/[\u0780-\u07BF]/g,"");break;case"keepOnlyArabic":b.value=b.value.replace(/[^\u0600-\u06ff\u0750-\u077f\ufb50-\ufbc1\ufbd3-\ufd3f\ufd50-\ufd8f\ufd92-\ufdc7\ufe70-\ufefc\uFDF0-\uFDFD\s]/g,"");break;case"removeAllArabic":b.value=b.value.replace(/[\u0600-\u06ff\u0750-\u077f\ufb50-\ufbc1\ufbd3-\ufd3f\ufd50-\ufd8f\ufd92-\ufdc7\ufe70-\ufefc\uFDF0-\uFDFD]/g,"");break;case"keepOnlyEnglish":b.value=b.value.replace(/[^A-Za-z\s]/g,"");break;case"removeAllEnglish":b.value=b.value.replace(/[A-Za-z]/g,"");break;case"removeSpacesAndSingleLines":b.value=b.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim().replace(/\n{2,}/g,"\n");break;case"removeSpacesAndDoubleLines":b.value=b.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim().replace(/\n{3,}/g,"\n\n");break;case"wordWrap":b.value=b.value.replace(/\s+/g," ").trim();break;case"removeExtraSpacesOnly":b.value=b.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim();break;case"removeSingleLinesOnly":b.value=b.value.trim().replace(/\n{2,}/g,"\n");break;case"removeDoubleLinesOnly":b.value=b.value.trim().replace(/\n{3,}/g,"\n\n");break;case"dotsToEllipsis":b.value=b.value.replace(/\.{3}/g,"…");break;case"ellipsisToDots":b.value=b.value.replace(/…/g,"...");break;case"convertDashes":a=(o={hyphen:"-",en:"–",em:"—"})[document.getElementById("dashFrom").value],o=o[document.getElementById("dashTo").value],b.value=b.value.replace(new RegExp(a,"g"),o);break;function i(e){var t="";e.useUppercase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.useLowercase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.useNumbers&&(t+="0123456789"),e.useSymbols&&(t+="!@#$%^&*()_+-=[]{}|;:,.<>?"),t||="abcdefghijklmnopqrstuvwxyz";let a="";for(let n=0;n?]/.test(a)&&(e=Math.floor(Math.random()*e.length),a=a.substring(0,e)+"!@#$%^&*()_+-=[]{}|;:,.<>?".charAt(Math.floor(26*Math.random()))+a.substring(e+1)),a}case"setupPasswordGenerator":const D=document.getElementById("passwordCount");D&&D.addEventListener("input",(()=>{let e=parseInt(D.value);1>e&&(D.value=1),100{let e=parseInt(M.value);4>e&&(M.value=4),128{e.addEventListener("change",(()=>{Array.from(F).some((e=>e.checked))||(e.checked=!0)}))}));break;case"generatePasswords":for(a=parseInt(document.getElementById("passwordCount").value)||1,o={length:parseInt(document.getElementById("passwordLength").value)||8,useUppercase:document.getElementById("useUppercase").checked,useLowercase:document.getElementById("useLowercase").checked,useNumbers:document.getElementById("useNumbers").checked,useSymbols:document.getElementById("useSymbols").checked},c=[],s=0;sc&&([j,c]=[c,j],document.getElementById("seqMinInput").value=j,document.getElementById("seqMaxInput").value=c);var d=document.getElementById("seqPadStart")?.checked||!1,m=parseInt(document.getElementById("seqPadLength")?.value)||1;a="\\n"===document.getElementById("seqSeparator").value?"\n":document.getElementById("seqSeparator").value||"\n",o=document.getElementById("seqReverse")?.checked||!1;var p=document.getElementById("seqPrefix")?.value||"",g=document.getElementById("seqSuffix")?.value||"";c=Array.from({length:c-j+1},((e,t)=>(e=j+t,d&&(e=String(e).padStart(m,"0")),`${p}${e}${g}`))),o&&c.reverse(),b.value=c.join(a),t(),l();break;case"generateRandomNumber":let q=parseInt(document.getElementById("randNoMinInput").value)||1;if(o=parseInt(document.getElementById("randNoMaxInput").value)||10,u=parseInt(document.getElementById("randNoCount").value)||1,c=document.getElementById("randNoUnique").checked,q>o&&([q,o]=[o,q],document.getElementById("randNoMinInput").value=q,document.getElementById("randNoMaxInput").value=o),s=o-q+1,a=u,c&&u>s&&(a=s),u=[],c){for(c=(o=Array.from({length:s},((e,t)=>q+t))).length-1;0"ْ"===t?e:a+t));break;case"textToArabicDiacritics":case"arabicDiacriticsToText":b.value=Object.entries({"رضي الله عنهما":"رَضِيَ اللَّهُ عَنْهُمَا","رضي الله عنهم":"رَضِيَ اللَّهُ عَنْهُمْ","رضي الله عنها":"رَضِيَ اللَّهُ عَنْهَا","رضي الله عنه":"رَضِيَ اللَّهُ عَنْهُ","عليهما السلام":"عَلَيهِمَا السَّلَامُ","عليهم السلام":"عَلَيهِمُ السَّلَامُ","عليها السلام":"عَلَيهَا السَّلَامُ","عليه السلام":"عَلَيهِ السَّلَامُ","رحمهما الله":"رَحِمَهُمَا اللَّهُ","رحمهم الله":"رَحِمَهُمُ اللَّهُ","رحمها الله":"رَحِمَهَا اللَّهُ","رحمه الله":"رَحِمَهُ اللَّهُ","عز وجل":"عَزَّ وَجَلَّ","جل جلاله":"جَلَّ جَلَاﻟَﻪُ","تبارك وتعالى":"تَبَارَكَ وَتَعَالَى","تعالى":"تَعَالَى"}).reduce(((t,[a,n])=>t.replace(new RegExp(("textToArabicDiacritics"===e?a:n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"textToArabicDiacritics"===e?n:a)),b.value);break;case"removeQuranicMarks":b.value=b.value.replace(/[ۖۗۘۙۚۛۜ۝۞ۣ۟۠ۡۢۤۥۦۧۨ۩۪ۭ۫۬﴾﴿]/g,"").replace(/\s+/g," ").trim();break;case"replaceDoubleBracketsToSingle":b.value=b.value.replace(/\(\(([^)]*)\)\)/g,"($1)");break;case"textToQuranicBrackets":b.value=b.value.replace(/\{/g,"﴾").replace(/\}/g,"﴿").replace(/\*/g,"۝");break;case"quranicToTextBrackets":b.value=b.value.replace(/﴾/g,"{").replace(/﴿/g,"}").replace(/۝/g,"*");break;case"convertPunctuation":a=(o={colon:":",fullstop:".",comma:","})[document.getElementById("punctuationFrom").value],o=o[document.getElementById("punctuationTo").value],a=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),b.value=b.value.replace(new RegExp(a,"g"),o);break;case"ltrToRtlPunc":b.value=b.value.replace(/[,;?]/g,(e=>({",":"،",";":"؛","?":"؟"}[e]||e)));break;case"rtlToLtrPunc":b.value=b.value.replace(/[،؛؟]/g,(e=>({"،":",","؛":";","؟":"?"}[e]||e)))}t()}(e.target.dataset.action),o.classList.remove("show"))}))})),document.addEventListener("click",l),document.getElementById("copyToClipboard").addEventListener("click",(()=>{navigator.clipboard.writeText(b.value)})),document.getElementById("clearAll").addEventListener("click",(()=>{b.value="",C=[{id:1,content:""}],L.innerHTML='',w=1,t()}));let x=!0;document.getElementById("toggleDirection").addEventListener("click",(()=>{x=!x,b.style.direction=x?"rtl":"ltr",b.style.textAlign=x?"right":"left"}));let T=!1;document.getElementById("convertQuotes").addEventListener("click",(()=>{b.value=T?b.value.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"'):b.value.replace(/(\W|^)"(\S)/g,"$1”$2").replace(/(\u201D[^"]*)"([^"]*$|[^\u201D"]*\u201D)/g,"$1“$2").replace(/([^0-9])"/g,"$1“").replace(/(\W|^)'(\S)/g,"$1’$2").replace(/([a-z])'([a-z])/gi,"$1‘$2").replace(/((\u2019[^']*)|[a-z])'([^0-9]|$)/gi,"$1‘$3").replace(/(\u2019)([0-9]{2}[^\u2018]*)(\u2019([^0-9]|$)|$|\u2018[a-z])/gi,"‘$2$3").replace(/(\B|^)\u2019(?=([^\u2018]*\u2018\b)*([^\u2018\u2019]*\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1‘").replace(/'''/g,"‴").replace(/''/g,"″").replace(/'/g,"′"),T=!T,t()}));const A=[["އަ","a"],["އާ","aa"],["އި","i"],["އީ","ee"],["އު","u"],["އޫ","oo"],["އެ","e"],["އޭ","ey"],["އޮ","o"],["އޯ","oa"],["ުއް","uh"],["ިއް","ih"],["ެއް","eh"],["ަށް","ah"],["ައް","ah"],["ށް","h"],["ތް","i"],["ާއް","aah"],["އް","h"],["ަ","a"],["ާ","aa"],["ި","i"],["ީ","ee"],["ު","u"],["ޫ","oo"],["ެ","e"],["ޭ","ey"],["ޮ","o"],["ޯ","oa"],["ް",""],["ހ","h"],["ށ","sh"],["ނ","n"],["ރ","r"],["ބ","b"],["ޅ","lh"],["ކ","k"],["އ","a"],["ވ","v"],["މ","m"],["ފ","f"],["ދ","dh"],["ތ","th"],["ލ","l"],["ގ","g"],["ޏ","y"],["ސ","s"],["ޑ","d"],["ޒ","z"],["ޓ","t"],["ޔ","y"],["ޕ","p"],["ޖ","j"],["ޗ","ch"],["ޙ","h"],["ޚ","kh"],["ޛ‎","z"],["ޜ‎","z"],["ޝ‎","sh"],["ޝ","sh"],["ޤ","q"],["ޢ","a"],["ޞ","s"],["ޟ","dh"],["ޡ","z"],["ޠ","t"],["ާާޣ","gh"],["ޘ","th"],["ޛ","dh"],["ާާޜ","z"]];document.getElementById("transliterateDvToEn").addEventListener("click",(()=>{r(),b.value=function(e){e=e.replace(/[\u200B-\u200D\uFEFF]/g,"");for(const[t,a]of A)e=e.replace(new RegExp(t,"g"),a);return e.replace(/(^\s*\w|[.!?]\s*\w)/g,(e=>e.toUpperCase()))}(b.value),n(),t()}));const D=[["ـ",""],["آ","އާ"],["ب","ބ"],["ت","ތ"],["ث","ޘ"],["ج","ޖ"],["ح","ޙ"],["خ","ޚ"],["د","ދ"],["ذ","ޛ"],["ر","ރ"],["ز","ޒ"],["س","ސ"],["ش","ޝ"],["ص","ޞ"],["ض","ޟ"],["ط","ޠ"],["ظ","ޡ"],["ع","ޢ"],["غ","ޣ"],["ف","ފ"],["ق","ޤ"],["ك","ކ"],["ل","ލ"],["م","މ"],["ن","ނ"],["ه","ހ"],["و","ވ"],["ي","ޔ"],["ة","ތ"],["ء","އ"],["أ","އ"],["ؤ","އ"],["إ","އ"],["ئ","އ"],["ى","އ"],["َ","ަ"],["ِ","ި"],["ُ","ު"],["ْ","ް"],["ً","ަން"],["ٍ","ިން"],["ٌ","ުން"],["ަا","ާ"],["اލ","ލ"],["ލއްލަހ","ﷲ"],["ލލހ","ﷲ"],["ލއް","އް"],["ާ އްލަ","ަ އްލަ"],["ا",""],["ުވ","ޫ"],["އ އް"," އް"],["ޫ ލ","ު ލ"],["އްލަލ","އްލަ"],["«",'"'],["»",'"']];document.getElementById("transliterateArToDv").addEventListener("click",(()=>{r(),b.value=function(e){e=e.replace(/(.)ّ/g,((e,t)=>`އް${D.find((([e])=>e===t))?.[1]||t}`)),e=(e=e.replace(/ة([َِ ُ ً ٍ ٌ])/g,"ތ$1")).replace(/ة(?![َِ ُ ً ٍ ٌ])/g,"ހ");for(const[t,a]of D)e=e.replace(new RegExp(t,"g"),a);return e}(b.value),t()}));const M=new class{constructor(){this.ehbari="ސުމެއް އެއް ދެ ތިން ހަތަރު ފަސް ހަ ހަތް އަށް ނުވަ ދިހަ އެގާރަ ބާރަ ތޭރަ ސާދަ ފަނަރަ ސޯޅަ ސަތާރަ އަށާރަ ނަވާރަ ވިހި އެކާވީސް ބާވީސް ތޭވީސް ސައުވީސް ފަންސަވީސް ސައްބީސް ހަތާވީސް އަށާވީސް ނަވާވީސް".split(" "),this.dhihabari="ސުން ދިހަ ވިހި ތިރީސް ސާޅީސް ފަންސާސް ފަސްދޮޅަސް ހައްދިހަ އައްޑިހަ ނުވަދިހަ".split(" "),this.sunbari=["","ހާސް","މިލިޔަން","ބިލިޔަން","ޓްރިލިޔަން"]}convert(e){return e?1e3>(e=parseInt(e))?this.thousandSub(e):this.thousandUp(e):null}thousandSub(e){var t="ސަތޭކަ ";if(0>=e||29>=e)return this.ehbari[e];if(99>=e)return t=Math.floor(e/10),0===(e%=10)?this.dhihabari[t]:`${this.dhihabari[t]} ${this.ehbari[e]}`;if(999>=e){const a=e%100;return 2===(e=Math.floor(e/100))&&(this.ehbari[2]="ދުވި",t="ސައްތަ "),0===a?`${this.ehbari[e]} ${t}`:`${this.ehbari[e]} ${t}${this.thousandSub(a)}`}return""}thousandHalf(e){const t=[];for(;0!==e;)t.push(e%1e3),e=Math.floor(e/1e3);return t}thousandUp(e){var t=this.thousandHalf(e);e=t.length-1;const a=[];for(var n of t.reverse()){t=`${this.thousandSub(n)} `;let r=`${this.sunbari[e]} `;if(" "===t)break;"ސުން "!==t&&"ސުމެއް "!==t||(r=t=""),a.push(t+r),--e}return(n=a.join("")).endsWith(",")&&(n=n.slice(0,-1)),n.trim()}};document.getElementById("Nos2DvTxt").addEventListener("click",(()=>{r();const e=b.value.split("\n").map((e=>{const t=e.match(/\d+/g);return t?t.map((e=>M.convert(e).replace(/\s+/g," ").trim())).join("، "):e.trim()}));b.value=e.filter((e=>0{const e=/[\u07a6-\u07b0]/,t=/[\u064b-\u0650\u0652-\u0656]/,a=/[\u0780-\u07a5]/,n=/[\u064e\u064f\u0650]/,r=b.value.split(/\s+/),l=[];for(let o=0;oe+t.issues.length),0),a=b.value.split(/\s+/),n=`Found ${t} issue${1`;e.forEach(((e,t)=>{const r=a[e.index-1]||"",l=a[e.index+1]||"";let o=e.issues.map((t=>{let a,n;switch(a="multiple"===t.type?`${e.word[t.index-1]||""}${e.word[t.index]} ${e.word[t.index+1]}`:`${e.word[t.index-1]||""} ${e.word[t.index]}`,t.type){case"multiple":n=`Multiple Fili :  ${a}`;break;case"noDvFili":n=`Thaana w/o Fili :  ${a}`;break;case"standalone":n=`Standalone Fili :  ${a}`}return n})).join(", ");n+=`${t+1}. ${r} ${e.word} ${l} : ${o}
`})),F.innerHTML=n}F.style.display="block"}(l)})),document.getElementById("removePunctuation").addEventListener("click",(()=>{r(),b.value=b.value.replace(/[^\w\s]/g,""),t()}));let j=!1;const q={a:"4",e:"3",i:"!",o:"0",t:"7",l:"1",s:"5"},U=Object.fromEntries(Object.entries(q).map((([e,t])=>[t,e])));document.getElementById("toggleLeetSpeak").addEventListener("click",(()=>{b.value=j?b.value.replace(/[43!0715]/g,(e=>U[e])):b.value.toLowerCase().replace(/[aeiotls]/g,(e=>q[e])),j=!j,t(),n()})),document.getElementById("numerateWords").addEventListener("click",(()=>{const e=document.getElementById("textArea");document.getElementById("numerateWords").textContent.includes("No → Wrd")?(e.value=e.value.replace(/\b\d+\b/g,(e=>function(e){const t=" one two three four five six seven eight nine".split(" "),a=" twenty thirty forty fifty sixty seventy eighty ninety".split(" ");var n="ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split(" ");return 10>e?t[e]:20>e?n[e-10]:100>e?(n=e%10,a[Math.floor(e/10)]+(n?`-${t[n]}`:"")):e}(parseInt(e)))).replace(/%/g,"percent"),document.getElementById("numerateWords").textContent="Wrd → No"):(e.value=e.value.replace(/\b(?:\w+(?:-\w+)*)\b/g,(e=>{var t=e.toLowerCase();return e={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90,hundred:100},t.includes("-")?e=(e[(t=t.split("-"))[0]]||0)+(e[t[1]]||0):e=e[t]||t,e})).replace(/\bpercent\b/g,"%"),document.getElementById("numerateWords").textContent="No → Wrd"),t()}));const R=document.getElementById("prefixInput"),N=document.getElementById("suffixInput");document.getElementById("prefixSuffixToLine").addEventListener("click",(()=>{if("none"===R.style.display)R.style.display="inline-block",N.style.display="inline-block";else{const e=R.value,a=N.value,n=b.value.split("\n").map((t=>e+t+a));b.value=n.join("\n"),t()}}));const P=document.getElementById("removeFromStart"),z=document.getElementById("removeFromEnd");document.getElementById("rmvNoOfCharsPerLine").addEventListener("click",(()=>{if("none"===P.style.display)P.style.display="inline-block",z.style.display="inline-block";else{const e=parseInt(P.value)||0,a=parseInt(z.value)||0,n=b.value.split("\n").map((t=>t.length<=e+a?"":t.slice(e,t.length-a)));b.value=n.join("\n"),t()}}));const H=document.getElementById("findInput"),O=document.getElementById("replaceInput");document.getElementById("findAndReplaceText").addEventListener("click",(()=>{var e=H.value;const a=O.value;e&&(e=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),b.value=b.value.replace(e,a),t())})),document.getElementById("diffCompare").addEventListener("click",(()=>{window.open("diffCompare.html","_blank")})),document.getElementById("keyboardPage").addEventListener("click",(()=>{window.open("keyboardPage.html","_blank")})),document.getElementById("qrGenerator").addEventListener("click",(()=>{window.open("qrGenerator.html","_blank")})),document.getElementById("fullscreen").addEventListener("click",(()=>{document.fullscreenElement?(document.exitFullscreen(),b.style.height="300px"):(document.documentElement.requestFullscreen(),b.style.height="100vh")})),document.addEventListener("fullscreenchange",(()=>{document.fullscreenElement||(b.style.height="300px")})),o(),setInterval(o,6e4),document.getElementById("toggleMilitaryTime").addEventListener("click",(()=>{const e="true"===localStorage.getItem("militaryTime");localStorage.setItem("militaryTime",!e),o()})),b.addEventListener("input",(e=>{const t=e.target.selectionStart;var a=e.target.value.substring(0,t);"ss-"===a.split(/\s/).pop()&&(a=a.replace(/ss-$/,"ﷺ")+e.target.value.substring(t),e.target.value=a,e.target.setSelectionRange(t,t))})),document.querySelectorAll(".copy-button, .copy-button-lit, .copy-button-other").forEach((e=>{e.addEventListener("click",(async()=>{const t=e.dataset.text||e.textContent.trim();try{await navigator.clipboard.writeText(t),c(e,"Copied")}catch(e){console.error("Failed to copy:",e)}}))})),document.querySelectorAll("button").forEach((e=>{e.addEventListener("click",(t=>{e.closest(".dropdown-button")||c(e,"Clicked")}))}));var W=JSON.parse(localStorage.getItem("editorTabs"));W&&(C=W,C.forEach((e=>{if(1{C[w-1].content=b.value,localStorage.setItem("editorTabs",JSON.stringify(C)),localStorage.setItem("currentTab",w)}),5e3),t();const Z=document.getElementById("calcArea"),_=document.getElementById("addCalcTab"),J=document.querySelector(".calc-numbered-tabs");if(Z&&_&&J){let be=1,Ee=[{id:1,content:""}];const fe=document.getElementById("sumTotal"),ke=document.getElementById("zakatAmount"),Ie=document.getElementById("lineResults"),$e=document.getElementById("copyTotal"),Be=document.getElementById("clearCalc");function G(){let e=0,t="";Z.value.split("\n").forEach((a=>{a=function(e){let t=e.match(/[+-]?\d*\.?\d+(?:,\d{3})*(?:\d*\.?\d+)?/g)||[];e=e.match(/[\+\-\*x\/÷]/g)||[],t=t.map((e=>parseFloat(e.replace(/,/g,""))));for(let a=0;ae+t),0)}(a),e+=a,t+=`${e.toFixed(2)}\n`})),fe.textContent=e.toFixed(2),ke.textContent=(.025*e).toFixed(2),Ie.textContent=t}function Q(e){Ee[be-1].content=Z.value,be=e,Z.value=Ee[be-1].content,document.querySelectorAll(".calc-numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),G()}_.addEventListener("click",(()=>{const e=Ee.length+1;Ee.push({id:e,content:""});const t=document.createElement("button");t.classList.add("calc-numbered-tab"),t.dataset.tab=e,t.textContent=e,J.insertBefore(t,_),Q(e)})),J.addEventListener("click",(e=>{e.target.classList.contains("calc-numbered-tab")&&Q(e=parseInt(e.target.dataset.tab))})),Z.addEventListener("input",G),$e.addEventListener("click",(()=>{navigator.clipboard.writeText(fe.textContent),c($e,"Copied")})),Be.addEventListener("click",(()=>{Z.value="",Ie.textContent="",fe.textContent="0.00",ke.textContent="0.00",Ee=[{id:1,content:""}],be=1;const e=J.querySelectorAll(".calc-numbered-tab");e.forEach((e=>{"1"!==e.dataset.tab&&e.remove()})),e[0].classList.add("active"),c(Be,"Cleared")})),(W=JSON.parse(localStorage.getItem("calculatorTabs")))&&(Ee=W,Ee.forEach((e=>{if(1{Ee[be-1].content=Z.value,localStorage.setItem("calculatorTabs",JSON.stringify(Ee)),localStorage.setItem("currentCalcTab",be)}),5e3)}const K=document.querySelector(".proportion-container"),V=document.getElementById("addPropTab"),Y=document.querySelector(".prop-numbered-tabs");if(K&&V&&Y){let Se=1,Le=[{id:1,content:K.innerHTML}];function X(){document.querySelectorAll(".proportion-set").forEach((e=>{e.querySelectorAll(".prop-input").forEach((t=>{t.addEventListener("input",(()=>function(e){if(e=e.querySelectorAll(".prop-input"),3<=Array.from(e).filter((e=>""!==e.value)).length){const t=e[0].value,a=e[1].value,n=e[2].value;t&&a&&n&&(e[3].value=(a/t*n).toFixed(2))}else e[3].value=""}(e)))}))}))}function ee(e){Le[Se-1].content=K.innerHTML,Se=e,K.innerHTML=Le[Se-1].content,document.querySelectorAll(".prop-numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),X()}V.addEventListener("click",(()=>{const e=Le.length+1;Le.push({id:e,content:K.innerHTML});const t=document.createElement("button");t.classList.add("prop-numbered-tab"),t.dataset.tab=e,t.textContent=e,Y.insertBefore(t,V),ee(e)})),Y.addEventListener("click",(e=>{e.target.classList.contains("prop-numbered-tab")&&ee(e=parseInt(e.target.dataset.tab))})),X(),(W=JSON.parse(localStorage.getItem("proportionTabs")))&&(Le=W,Le.forEach((e=>{if(1{Le[Se-1].content=K.innerHTML,localStorage.setItem("proportionTabs",JSON.stringify(Le)),localStorage.setItem("currentPropTab",Se)}),5e3);const we=document.getElementById("clearProp");we.addEventListener("click",(()=>{document.querySelectorAll(".proportion-set").forEach((e=>{e.querySelectorAll(".prop-input").forEach(((e,t)=>{e.value=2===t?"1":""}))})),Le=[{id:1,content:K.innerHTML}],Se=1;const e=Y.querySelectorAll(".prop-numbered-tab");e.forEach((e=>{"1"!==e.dataset.tab&&e.remove()})),e[0].classList.add("active"),c(we,"Cleared")}))}let te="true"===localStorage.getItem("nightCalcMilitaryTime");document.getElementById("maghribTime").addEventListener("change",s),document.getElementById("fajrTime").addEventListener("change",s),document.getElementById("toggleNightCalcFormat").addEventListener("click",(()=>{te=!te,localStorage.setItem("nightCalcMilitaryTime",te),s()}));const ae=e=>btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),"")),ne=e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))),re=new TextEncoder,le=new TextDecoder,oe=e=>window.crypto.subtle.importKey("raw",re.encode(e||"empty"),"PBKDF2",!1,["deriveKey"]),ce=(e,t,a)=>window.crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:25e4,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!1,a),se=document.querySelectorAll(".crypt-tab"),ue=document.querySelectorAll(".crypt-panel");se.forEach((e=>{e.addEventListener("click",(()=>{se.forEach((e=>e.classList.remove("active"))),ue.forEach((e=>e.classList.remove("active"))),e.classList.add("active"),document.getElementById(e.dataset.crypttab+"Crypt").classList.add("active")}))}));const ie=document.getElementById("encryptButton"),de=document.getElementById("decryptButton"),me=document.getElementById("copyEncrypted"),pe=document.getElementById("copyDecrypted");ie&&ie.addEventListener("click",(async()=>{const e=document.getElementById("textToEncrypt").value,t=document.getElementById("encryptPassword").value;if(e)try{const a=await d(e,t);document.getElementById("encryptedText").value=a,c(ie,"Encrypted")}catch(e){console.error("Encryption failed:",e),c(ie,"Encryption failed")}else c(ie,"Please enter text to encrypt")})),de&&de.addEventListener("click",(async()=>{const e=document.getElementById("textToDecrypt").value,t=document.getElementById("decryptPassword").value;if(e)try{const a=await m(e,t);document.getElementById("decryptedText").value=a||"Decryption failed",c(de,a?"Decrypted":"Failed")}catch(e){console.error("Decryption failed:",e),c(de,"Decryption failed"),document.getElementById("decryptedText").value="Decryption failed"}else c(de,"Please enter text to decrypt")})),me&&me.addEventListener("click",(()=>{const e=document.getElementById("encryptedText").value;e&&(navigator.clipboard.writeText(e),c(me,"Copied"))})),pe&&pe.addEventListener("click",(()=>{const e=document.getElementById("decryptedText").value;e&&(navigator.clipboard.writeText(e),c(pe,"Copied"))}));const ge=document.getElementById("fileToEncrypt"),ve=document.getElementById("fileToDecrypt"),ye=document.getElementById("fileEncryptButton"),he=document.getElementById("fileDecryptButton");ye?.addEventListener("click",(async()=>{const e=ge.files[0],t=document.getElementById("fileEncryptPassword").value;if(e)try{c(ye,"Encrypting...");const a=await p(e),n=await d(new Uint8Array(a),t);g(new Blob([ne(n)]),e.name+".encrypted"),c(ye,"Encrypted")}catch(e){console.error("File encryption failed:",e),c(ye,"Encryption failed")}else c(ye,"Please select a file")})),he?.addEventListener("click",(async()=>{const e=ve.files[0],t=document.getElementById("fileDecryptPassword").value;if(e)try{c(he,"Decrypting...");const a=await p(e),n=await m(ae(new Uint8Array(a)),t);g(new Blob([(new TextEncoder).encode(n)]),e.name.replace(/\.encrypted$/,"")),c(he,"Decrypted")}catch(e){console.error("File decryption failed:",e),c(he,"Decryption failed")}else c(he,"Please select a file")})),ge?.addEventListener("change",(()=>{v(ge)})),ve?.addEventListener("change",(()=>{v(ve)})),document.querySelectorAll(".file-label").forEach((e=>{e.addEventListener("dragover",(t=>{t.preventDefault(),e.classList.add("dragover")})),e.addEventListener("dragleave",(()=>{e.classList.remove("dragover")})),e.addEventListener("drop",(t=>{t.preventDefault(),e.classList.remove("dragover");const a=document.getElementById(e.getAttribute("for"));0<(t=t.dataTransfer.files).length&&(a.files=t,v(a))}))}))})); \ No newline at end of file +document.addEventListener("DOMContentLoaded",(()=>{function e(){const e=this.value;E.value=e,f.value=e,h.style.fontSize=`${e}px`}function t(){var e=h.value;const t=e.trim()?e.trim().split(/\s+/).length:0,a=e?e.split("\n").length:0;k.textContent=`Char: ${e.length}`,I.textContent=`Wrd: ${t}`,$.textContent=`Ln: ${a}`,e=new Blob([e]).size,B.textContent=1024>e?`B: ${e}`:1048576>e?`KB: ${(e/1024).toFixed(2)}`:1073741824>e?`MB: ${(e/1048576).toFixed(2)}`:`GB: ${(e/1073741824).toFixed(2)}`}function a(e){C[w-1].content=h.value,w=e,h.value=C.find((t=>t.id===e)).content,document.querySelectorAll(".numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),t()}function n(){h.style.direction="ltr",h.style.textAlign="left"}function r(){window.scrollTo({top:0,behavior:"smooth"})}function l(){document.querySelectorAll(".dropdown-content").forEach((e=>{e.classList.remove("show")}))}function o(){const e=new Date,t="true"===localStorage.getItem("militaryTime"),a=e.getHours()%12||12,n=String(e.getHours()).padStart(2,"0");var r=t?n:a;const l=12<=e.getHours()?"PM":"AM";String(e.getMinutes()).padStart(2,"0");var o=e.toLocaleDateString("en-GB",{weekday:"long",day:"numeric",month:"long",year:"numeric"});o=o.replace(/^(\w+)\s+(\d+)/,((e,t,a)=>`${t}, ${a}${["th","st","nd","rd"][3{if("weekday"===e.type&&(m=d[e.value]||e.value),"day"===e.type&&(p=e.value),"month"===e.type){var t=e.value;g=r[t]?.[0]||t}"year"===e.type&&(v=e.value)})),document.getElementById("hijriLongEn").textContent=`${m}, ${parseInt(p)} ${g} ${v} AH, at ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`,i.forEach((e=>{if("day"===e.type&&(y=e.value),"month"===e.type){var t=e.value;b=r[t]?.[1]||t}"year"===e.type&&(h=e.value)})),document.getElementById("hijriLongDv").textContent=`${o[e.getDay()]}، ${parseInt(y)} ${b} ${h}، ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+c}`;const E=new Intl.DateTimeFormat("en-u-ca-islamic",{day:"numeric",month:"numeric",year:"numeric",calendar:"islamic"}).format(e).replace(/[^0-9/]/g,"");document.getElementById("hijriShort").textContent=`${E} ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`}catch(e){console.error("Error formatting Hijri dates:",e),["hijriLongAr","hijriLongEn","hijriLongDv","hijriShort"].forEach((e=>{document.getElementById(e).textContent="Hijri date unavailable"}))}document.getElementById("gregorianShort").textContent=`${String(e.getDate()).padStart(2,"0")}/${String(e.getMonth()+1).padStart(2,"0")}/${e.getFullYear()} ${t?n:a}:${String(e.getMinutes()).padStart(2,"0")}${t?"":" "+l}`}function c(e,t){const a=document.createElement("span");a.textContent=t,a.className="copy-feedback",e.appendChild(a),e.classList.add("copy-success"),setTimeout((()=>{a.remove(),e.classList.remove("copy-success")}),1e3)}function s(){var e=document.getElementById("maghribTime"),t=document.getElementById("fajrTime");if(e.value&&t.value){e=u(e.value),(t=u(t.value)){const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>a(n.error),n.readAsArrayBuffer(e)}))}function g(e,t){e=URL.createObjectURL(e);const a=document.createElement("a");a.href=e,a.download=t,a.type="application/octet-stream",a.setAttribute("download",t),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(e)}function v(e,t="Choose File"){e.nextElementSibling.textContent=e.files[0]?.name||t}const y=document.querySelectorAll(".top-tab"),b=document.querySelectorAll(".tab-content"),h=document.getElementById("textArea"),E=document.getElementById("fontSizeSlider"),f=document.getElementById("fontSize"),k=document.getElementById("charCount"),I=document.getElementById("wordCount"),$=document.getElementById("lineCount"),B=document.getElementById("fileSize"),S=document.getElementById("addTab"),L=document.querySelector(".numbered-tabs");let w=1,C=[{id:1,content:""}];y.forEach((e=>{e.addEventListener("click",(()=>{y.forEach((e=>e.classList.remove("active"))),e.classList.add("active"),b.forEach((t=>{t.classList.remove("active"),t.id===`${e.dataset.tab}Tab`&&t.classList.add("active")}))}))})),E.addEventListener("input",e),f.addEventListener("change",e),f.addEventListener("click",(function(){})),h.addEventListener("input",function(e){let t;return function(...a){clearTimeout(t),t=setTimeout((()=>{clearTimeout(t),e(...a)}),300)}}(t)),S.addEventListener("click",(()=>{const e=C.length+1;C.push({id:e,content:""});const t=document.createElement("button");t.classList.add("numbered-tab"),t.dataset.tab=e,t.textContent=e,L.insertBefore(t,S),a(e)})),L.addEventListener("click",(e=>{e.target.classList.contains("numbered-tab")&&a(parseInt(e.target.dataset.tab))})),document.querySelectorAll(".dropdown-button").forEach((e=>{const a=e.querySelector(".function-button"),o=e.querySelector(".dropdown-content");a.addEventListener("click",(e=>{e.stopPropagation(),l(),o.classList.toggle("show")})),o.addEventListener("click",(e=>{e.stopPropagation(),"BUTTON"===e.target.tagName&&e.target.dataset.action&&(function(e){switch(e){case"arabicToRegular":h.value=h.value.replace(/[٠١٢٣٤٥٦٧٨٩]/g,(e=>"٠١٢٣٤٥٦٧٨٩".indexOf(e)));break;case"regularToArabic":h.value=h.value.replace(/[0-9]/g,(e=>"٠١٢٣٤٥٦٧٨٩"[e]));case"convertNumerals":var a={regular:"0123456789",arabic:"٠١٢٣٤٥٦٧٨٩",superscript:"⁰¹²³⁴⁵⁶⁷⁸⁹",mathSansSerif:"𝟢𝟣𝟤𝟥𝟦𝟧𝟨𝟩𝟪𝟫",mathSansSerifBold:"𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵",fullWidth:"0123456789",circled:"⓪①②③④⑤⑥⑦⑧⑨",negativeCircled:"⓿❶❷❸❹❺❻❼❽❾"};const v=a[document.getElementById("numeralFrom").value],y=a[document.getElementById("numeralTo").value];h.value=h.value.replace(/[0-9]/g,(e=>{const t=v.indexOf(e);return-1!==t?y[t]:e}));break;case"removePrecedingZeros":h.value=h.value.replace(/\b0+(\d)/g,"$1");break;case"removeAllNumbers":h.value=h.value.replace(/[٠-٩0-9]/g,"");break;case"keepOnlyNumbers":h.value=h.value.replace(/[^٠-٩0-9]/g,"");break;case"rtlStraightToCurly":case"ltrStraightToCurly":a="rtlStraightToCurly"===e,h.value=h.value.replace(/(\W|^)"(\S)/g,`$1${a?"”":"“"}$2`).replace(new RegExp(`(${a?"”":"“"}[^"]*)"([^"]*$|[^${a?"”":"“"}"]*${a?"”":"“"})`,"g"),`$1${a?"“":"”"}$2`).replace(/([^0-9])"/g,"$1"+(a?"“":"”")).replace(/(\W|^)'(\S)/g,`$1${a?"’":"‘"}$2`).replace(/([a-z])'([a-z])/gi,"$1‘$2").replace(/((\u2019[^']*)|[a-z])'([^0-9]|$)/gi,`$1${a?"‘":"’"}$3`).replace(/(\u2019)([0-9]{2}[^\u2018]*)(\u2019([^0-9]|$)|$|\u2018[a-z])/gi,"‘$2$3").replace(/(\B|^)\u2019(?=([^\u2018]*\u2018\b)*([^\u2018\u2019]*\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1‘").replace(/'''/g,"‴").replace(/''/g,"″").replace(/'/g,"′");break;case"curlyToStraight":h.value=h.value.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"');break;case"reverseCurlyQuotes":h.value=h.value.replace(/“|”/g,(e=>"“"===e?"”":"“")).replace(/‘|’/g,(e=>"‘"===e?"’":"‘")).replace(/❝|❞/g,(e=>"❝"===e?"❞":"❝")).replace(/\ud83d\ude76|\ud83d\ude77/g,(e=>"🙷"));break;case"convertQuotes":var o={straightSingle:["'","'"],straightDouble:['"','"'],ltrCurlyDouble:["“","”"],rtlCurlyDouble:["”","“"],ltrCurlySingle:["‘","’"],rtlCurlySingle:["’","‘"],angleQuotes:["«","»"],doubleBrackets:["((","))"],heavyCommaQuotes:["❝","❞"],sansSerifHeavyCommaQuotes:["🙶","🙷"]};a=o[document.getElementById("quoteFrom").value],o=o[document.getElementById("quoteTo").value];var c=a[0].replace(/[.*+?^${}()|[\]\\]/g,"\\$&");a=a[1].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h.value=h.value.replace(new RegExp(`${c}([^${a}]*)${a}`,"g"),`${o[0]}$1${o[1]}`);break;case"removeJsComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeHtmlComments":h.value=h.value.replace(/\x3c!--[\s\S]*?--\x3e/g,""),n();break;case"removeCssComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\//g,""),n();break;case"removePowershellComments":h.value=h.value.replace(/#.*$/gm,"").replace(/<#[\s\S]*?#>/g,""),n();break;case"removePythonComments":h.value=h.value.replace(/#.*$/gm,"").replace(/'''[\s\S]*?'''|"""[\s\S]*?"""/g,""),n();break;case"removePhpComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*|#.*$/gm,""),n();break;case"removeCComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeCSharpComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeJavaComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\*\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeRubyComments":h.value=h.value.replace(/#.*$/gm,"").replace(/^=begin[\s\S]*?^=end/gm,""),n();break;case"removeBashComments":h.value=h.value.replace(/#.*$/gm,""),n();break;case"removeGoComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeRustComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\/!.*|\/\/.*/g,""),n();break;case"removeSwiftComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeKotlinComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\*\*[\s\S]*?\*\/|\/\/.*/g,""),n();break;case"removeDartComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|\/\/\/.*|\/\/.*/g,""),n();break;case"removeSqlComments":h.value=h.value.replace(/\/\*[\s\S]*?\*\/|--.*$/gm,""),n();break;case"textToParagraphs":h.value=h.value.split("\n").filter((e=>e.trim())).map((e=>`

${e}

`)).join("\n"),n();break;case"textToBrTags":h.value=h.value.split("\n").join("
\n"),n();break;case"textToOrderedList":h.value="
    \n"+h.value.split("\n").filter((e=>e.trim())).map((e=>`
  1. ${e}
  2. `)).join("\n")+"\n
",n();break;case"textToUnorderedList":h.value="
    \n"+h.value.split("\n").filter((e=>e.trim())).map((e=>`
  • ${e}
  • `)).join("\n")+"\n
",n();break;case"removeHtmlTags":h.value=h.value.replace(/<[^>]*>/g,"");break;case"removeArabicDiacritics":h.value=h.value.replace(/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/g,"");break;case"removeDhivehiFili":h.value=h.value.replace(/[\u07A6-\u07B0]/g,"");break;case"removeThikijehiThaana":const b={"ޘ":"ސ","ޙ":"ހ","ޛ":"ޒ","ޜ":"ޒ","ޞ":"ސ","ޠ":"ތ","ޡ":"ޒ","ޢ":"އ","ޤ":"ގ","ޥ":"ވ"};h.value=h.value.replace(/[ޘޙޛޜޞޠޡޢޤޥ]/g,(e=>b[e]||e));break;case"saveFile":a=new Blob([h.value],{type:"text/plain;charset=utf-8"}),(o=document.createElement("a")).href=URL.createObjectURL(a),o.download="saved_text.txt",o.click();break;case"loadFile":(a=document.createElement("input")).type="file",a.accept="text/plain",a.onchange=e=>{e=e.target.files[0];const a=new FileReader;a.onload=e=>{h.value=e.target.result,t()},a.readAsText(e)},a.click();break;case"titleCase":h.value=h.value.replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()));break;case"sentenceCase":h.value=h.value.toLowerCase().replace(/(^\w|\.\s+\w)/g,(e=>e.toUpperCase()));break;case"lowercase":h.value=h.value.toLowerCase();break;case"UPPERCASE":h.value=h.value.toUpperCase();break;case"alternatingCase":h.value=h.value.split("").map(((e,t)=>0==t%2?e.toLowerCase():e.toUpperCase())).join("");break;case"inverseCase":h.value=h.value.split("").map((e=>e===e.toUpperCase()?e.toLowerCase():e.toUpperCase())).join("");break;case"randomCase":h.value=h.value.split("").map((e=>.5t.toUpperCase()));break;case"pascalCase":h.value=h.value.toLowerCase().replace(/(^|[^a-zA-Z0-9]+)(.)/g,((e,t,a)=>a.toUpperCase()));break;case"snakeCase":h.value=h.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"");break;case"constantCase":h.value=h.value.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"");break;case"kebabCase":h.value=h.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"");break;case"dotCase":h.value=h.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,".").replace(/^\.+|\.+$/g,"");break;case"flatcase":h.value=h.value.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"");break;case"splitIntoWords":h.value=h.value.split(/\s+/).filter((e=>0{E[e]=(E[e]||0)+1})),a=Object.entries(E).sort(((e,t)=>t[1]-e[1])).map((([e,t])=>`${t}: ${e}`)),h.value=a.join("\n");break;case"sortLinesByFrequency":r();const f={};h.value.split("\n").filter((e=>""!==e.trim())).forEach((e=>{f[e]=(f[e]||0)+1})),a=Object.entries(f).sort(((e,t)=>t[1]-e[1])).map((([e,t])=>`${t}: ${e}`)),h.value=a.join("\n");break;case"sortLinesAscending":h.value=h.value.split("\n").sort(((e,t)=>e.localeCompare(t))).join("\n");break;case"sortLinesDescending":h.value=h.value.split("\n").sort(((e,t)=>t.localeCompare(e))).join("\n");break;case"randomizeLines":h.value=h.value.split("\n").sort((()=>Math.random()-.5)).join("\n");break;case"removeDuplicateLines":h.value=[...new Set(h.value.split("\n"))].join("\n");break;case"reverseTextHorizontal":h.value=h.value.split("").reverse().join("");break;case"reverseTextVertical":h.value=h.value.split("\n").reverse().join("\n");break;case"addLineNumbers":const k=document.getElementById("addNumbersWith").value;a=h.value.split("\n").map(((e,t)=>`${t+1}${k} ${e}`)),h.value=a.join("\n");break;case"removeLineNumbers":o=document.getElementById("removeNumbersWith").value,a=h.value.split("\n"),o=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const I=new RegExp(`^\\d+${o}\\s+`);a=a.map((e=>e.replace(I,""))),h.value=a.join("\n");break;case"decodeUnicode":h.value=h.value.replace(/\\u([0-9a-fA-F]{4})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})),n();break;case"encodeUnicode":h.value=h.value.replace(/[\s\S]/g,(function(e){for(e=e.charCodeAt(0).toString(16);4>e.length;)e="0"+e;return"\\u"+e})),n();break;case"decodeURL":try{h.value=decodeURI(h.value)}catch(U){alert("Invalid URL encoding")}n();break;case"encodeURL":h.value=encodeURI(h.value),n();break;case"whichUnicodeCharacter":for(a=h.value,o="",c=0;c"rtl"===S&&"corner"===L?e===$[0]?B[1]:B[0]:e===$[0]?B[0]:B[1]));break;case"reverseBracketDirection":const w={"(":")",")":"(","[":"]","]":"[","⁽":"⁾","⁾":"⁽","⌜":"⌝","⌝":"⌜"};h.value=h.value.replace(/[()[\]⁽⁾⌜⌝]/g,(e=>w[e]));break;case"convertNumberBrackets":const C={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"},x=(a={none:["",""],round:["(",")"],square:["[","]"],superscript:["⁽","⁾"]})[document.getElementById("numberBracketFrom").value],T=a[document.getElementById("numberBracketTo").value],A=document.getElementById("numberBracketTo").value;a=h.value,x[0]&&(a=a.replace(new RegExp(`\\${x[0]}\\d+\\${x[1]}`,"g"),(e=>e.slice(x[0].length,-x[1].length)))),T[0]&&(a=a.replace(/\d+/g,(e=>(e="superscript"===A?e.split("").map((e=>C[e])).join(""):e,`${T[0]}${e}${T[1]}`)))),h.value=a;break;case"removeNumberBrackets":a={round:["(",")"],square:["[","]"],superscript:["⁽","⁾"],none:["",""]}[document.getElementById("numberBracketRemove").value],h.value=h.value.replace(new RegExp(`\\${a[0]}\\d+\\${a[1]}`,"g"),""),t();break;case"keepOnlyDhivehi":h.value=h.value.replace(/[^\u0780-\u07BF\s]/g,"");break;case"removeAllDhivehi":h.value=h.value.replace(/[\u0780-\u07BF]/g,"");break;case"keepOnlyArabic":h.value=h.value.replace(/[^\u0600-\u06ff\u0750-\u077f\ufb50-\ufbc1\ufbd3-\ufd3f\ufd50-\ufd8f\ufd92-\ufdc7\ufe70-\ufefc\uFDF0-\uFDFD\s]/g,"");break;case"removeAllArabic":h.value=h.value.replace(/[\u0600-\u06ff\u0750-\u077f\ufb50-\ufbc1\ufbd3-\ufd3f\ufd50-\ufd8f\ufd92-\ufdc7\ufe70-\ufefc\uFDF0-\uFDFD]/g,"");break;case"keepOnlyEnglish":h.value=h.value.replace(/[^A-Za-z\s]/g,"");break;case"removeAllEnglish":h.value=h.value.replace(/[A-Za-z]/g,"");break;case"removeSpacesAndSingleLines":h.value=h.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim().replace(/\n{2,}/g,"\n");break;case"removeSpacesAndDoubleLines":h.value=h.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim().replace(/\n{3,}/g,"\n\n");break;case"wordWrap":h.value=h.value.replace(/\s+/g," ").trim();break;case"removeExtraSpacesOnly":h.value=h.value.replace(/^ +| +$/gm,"").replace(/ +/g," ").trim();break;case"removeSingleLinesOnly":h.value=h.value.trim().replace(/\n{2,}/g,"\n");break;case"removeDoubleLinesOnly":h.value=h.value.trim().replace(/\n{3,}/g,"\n\n");break;case"dotsToEllipsis":h.value=h.value.replace(/\.{3}/g,"…");break;case"ellipsisToDots":h.value=h.value.replace(/…/g,"...");break;case"convertDashes":a=(o={hyphen:"-",en:"–",em:"—"})[document.getElementById("dashFrom").value],o=o[document.getElementById("dashTo").value],h.value=h.value.replace(new RegExp(a,"g"),o);break;function i(e){var t="";e.useUppercase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.useLowercase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.useNumbers&&(t+="0123456789"),e.useSymbols&&(t+="!@#$%^&*()_+-=[]{}|;:,.<>?"),t||="abcdefghijklmnopqrstuvwxyz";let a="";for(let n=0;n?]/.test(a)&&(e=Math.floor(Math.random()*e.length),a=a.substring(0,e)+"!@#$%^&*()_+-=[]{}|;:,.<>?".charAt(Math.floor(26*Math.random()))+a.substring(e+1)),a}case"setupPasswordGenerator":const D=document.getElementById("passwordCount");D&&D.addEventListener("input",(()=>{let e=parseInt(D.value);1>e&&(D.value=1),100{let e=parseInt(M.value);4>e&&(M.value=4),128{e.addEventListener("change",(()=>{Array.from(F).some((e=>e.checked))||(e.checked=!0)}))}));break;case"generatePasswords":for(a=parseInt(document.getElementById("passwordCount").value)||1,o={length:parseInt(document.getElementById("passwordLength").value)||8,useUppercase:document.getElementById("useUppercase").checked,useLowercase:document.getElementById("useLowercase").checked,useNumbers:document.getElementById("useNumbers").checked,useSymbols:document.getElementById("useSymbols").checked},c=[],s=0;sc&&([j,c]=[c,j],document.getElementById("seqMinInput").value=j,document.getElementById("seqMaxInput").value=c);var d=document.getElementById("seqPadStart")?.checked||!1,m=parseInt(document.getElementById("seqPadLength")?.value)||1;a="\\n"===document.getElementById("seqSeparator").value?"\n":document.getElementById("seqSeparator").value||"\n",o=document.getElementById("seqReverse")?.checked||!1;var p=document.getElementById("seqPrefix")?.value||"",g=document.getElementById("seqSuffix")?.value||"";c=Array.from({length:c-j+1},((e,t)=>(e=j+t,d&&(e=String(e).padStart(m,"0")),`${p}${e}${g}`))),o&&c.reverse(),h.value=c.join(a),t(),l();break;case"generateRandomNumber":let q=parseInt(document.getElementById("randNoMinInput").value)||1;if(o=parseInt(document.getElementById("randNoMaxInput").value)||10,u=parseInt(document.getElementById("randNoCount").value)||1,c=document.getElementById("randNoUnique").checked,q>o&&([q,o]=[o,q],document.getElementById("randNoMinInput").value=q,document.getElementById("randNoMaxInput").value=o),s=o-q+1,a=u,c&&u>s&&(a=s),u=[],c){for(c=(o=Array.from({length:s},((e,t)=>q+t))).length-1;0"ْ"===t?e:a+t));break;case"textToArabicDiacritics":case"arabicDiacriticsToText":h.value=Object.entries({"رضي الله عنهما":"رَضِيَ اللَّهُ عَنْهُمَا","رضي الله عنهم":"رَضِيَ اللَّهُ عَنْهُمْ","رضي الله عنها":"رَضِيَ اللَّهُ عَنْهَا","رضي الله عنه":"رَضِيَ اللَّهُ عَنْهُ","عليهما السلام":"عَلَيهِمَا السَّلَامُ","عليهم السلام":"عَلَيهِمُ السَّلَامُ","عليها السلام":"عَلَيهَا السَّلَامُ","عليه السلام":"عَلَيهِ السَّلَامُ","رحمهما الله":"رَحِمَهُمَا اللَّهُ","رحمهم الله":"رَحِمَهُمُ اللَّهُ","رحمها الله":"رَحِمَهَا اللَّهُ","رحمه الله":"رَحِمَهُ اللَّهُ","عز وجل":"عَزَّ وَجَلَّ","جل جلاله":"جَلَّ جَلَاﻟَﻪُ","تبارك وتعالى":"تَبَارَكَ وَتَعَالَى","تعالى":"تَعَالَى"}).reduce(((t,[a,n])=>t.replace(new RegExp(("textToArabicDiacritics"===e?a:n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"textToArabicDiacritics"===e?n:a)),h.value);break;case"removeQuranicMarks":h.value=h.value.replace(/[ۖۗۘۙۚۛۜ۝۞ۣ۟۠ۡۢۤۥۦۧۨ۩۪ۭ۫۬﴾﴿]/g,"").replace(/\s+/g," ").trim();break;case"replaceDoubleBracketsToSingle":h.value=h.value.replace(/\(\(([^)]*)\)\)/g,"($1)");break;case"textToQuranicBrackets":h.value=h.value.replace(/\{/g,"﴾").replace(/\}/g,"﴿").replace(/\*/g,"۝");break;case"quranicToTextBrackets":h.value=h.value.replace(/﴾/g,"{").replace(/﴿/g,"}").replace(/۝/g,"*");break;case"convertPunctuation":a=(o={colon:":",fullstop:".",comma:","})[document.getElementById("punctuationFrom").value],o=o[document.getElementById("punctuationTo").value],a=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h.value=h.value.replace(new RegExp(a,"g"),o);break;case"ltrToRtlPunc":h.value=h.value.replace(/[,;?]/g,(e=>({",":"،",";":"؛","?":"؟"}[e]||e)));break;case"rtlToLtrPunc":h.value=h.value.replace(/[،؛؟]/g,(e=>({"،":",","؛":";","؟":"?"}[e]||e)))}t()}(e.target.dataset.action),o.classList.remove("show"))}))})),document.addEventListener("click",l),document.getElementById("copyToClipboard").addEventListener("click",(()=>{navigator.clipboard.writeText(h.value)})),document.getElementById("clearAll").addEventListener("click",(()=>{h.value="",C=[{id:1,content:""}],L.innerHTML='',w=1,t()}));let x=!0;document.getElementById("toggleDirection").addEventListener("click",(()=>{x=!x,h.style.direction=x?"rtl":"ltr",h.style.textAlign=x?"right":"left"}));let T=!1;document.getElementById("convertQuotes").addEventListener("click",(()=>{h.value=T?h.value.replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"'):h.value.replace(/(\W|^)"(\S)/g,"$1”$2").replace(/(\u201D[^"]*)"([^"]*$|[^\u201D"]*\u201D)/g,"$1“$2").replace(/([^0-9])"/g,"$1“").replace(/(\W|^)'(\S)/g,"$1’$2").replace(/([a-z])'([a-z])/gi,"$1‘$2").replace(/((\u2019[^']*)|[a-z])'([^0-9]|$)/gi,"$1‘$3").replace(/(\u2019)([0-9]{2}[^\u2018]*)(\u2019([^0-9]|$)|$|\u2018[a-z])/gi,"‘$2$3").replace(/(\B|^)\u2019(?=([^\u2018]*\u2018\b)*([^\u2018\u2019]*\W[\u2018\u2019]\b|[^\u2018\u2019]*$))/gi,"$1‘").replace(/'''/g,"‴").replace(/''/g,"″").replace(/'/g,"′"),T=!T,t()}));const A=[["އަ","a"],["އާ","aa"],["އި","i"],["އީ","ee"],["އު","u"],["އޫ","oo"],["އެ","e"],["އޭ","ey"],["އޮ","o"],["އޯ","oa"],["ުއް","uh"],["ިއް","ih"],["ެއް","eh"],["ަށް","ah"],["ައް","ah"],["ށް","h"],["ތް","i"],["ާއް","aah"],["އް","h"],["ަ","a"],["ާ","aa"],["ި","i"],["ީ","ee"],["ު","u"],["ޫ","oo"],["ެ","e"],["ޭ","ey"],["ޮ","o"],["ޯ","oa"],["ް",""],["ހ","h"],["ށ","sh"],["ނ","n"],["ރ","r"],["ބ","b"],["ޅ","lh"],["ކ","k"],["އ","a"],["ވ","v"],["މ","m"],["ފ","f"],["ދ","dh"],["ތ","th"],["ލ","l"],["ގ","g"],["ޏ","y"],["ސ","s"],["ޑ","d"],["ޒ","z"],["ޓ","t"],["ޔ","y"],["ޕ","p"],["ޖ","j"],["ޗ","ch"],["ޙ","h"],["ޚ","kh"],["ޛ‎","z"],["ޜ‎","z"],["ޝ‎","sh"],["ޝ","sh"],["ޤ","q"],["ޢ","a"],["ޞ","s"],["ޟ","dh"],["ޡ","z"],["ޠ","t"],["ާާޣ","gh"],["ޘ","th"],["ޛ","dh"],["ާާޜ","z"]];document.getElementById("transliterateDvToEn").addEventListener("click",(()=>{r(),h.value=function(e){e=e.replace(/[\u200B-\u200D\uFEFF]/g,"");for(const[t,a]of A)e=e.replace(new RegExp(t,"g"),a);return e.replace(/(^\s*\w|[.!?]\s*\w)/g,(e=>e.toUpperCase()))}(h.value),n(),t()}));const D=[["ـ",""],["آ","އާ"],["ب","ބ"],["ت","ތ"],["ث","ޘ"],["ج","ޖ"],["ح","ޙ"],["خ","ޚ"],["د","ދ"],["ذ","ޛ"],["ر","ރ"],["ز","ޒ"],["س","ސ"],["ش","ޝ"],["ص","ޞ"],["ض","ޟ"],["ط","ޠ"],["ظ","ޡ"],["ع","ޢ"],["غ","ޣ"],["ف","ފ"],["ق","ޤ"],["ك","ކ"],["ل","ލ"],["م","މ"],["ن","ނ"],["ه","ހ"],["و","ވ"],["ي","ޔ"],["ة","ތ"],["ء","އ"],["أ","އ"],["ؤ","އ"],["إ","އ"],["ئ","އ"],["ى","އ"],["َ","ަ"],["ِ","ި"],["ُ","ު"],["ْ","ް"],["ً","ަން"],["ٍ","ިން"],["ٌ","ުން"],["ަا","ާ"],["اލ","ލ"],["ލއްލަހ","ﷲ"],["ލލހ","ﷲ"],["ލއް","އް"],["ާ އްލަ","ަ އްލަ"],["ا",""],["ުވ","ޫ"],["އ އް"," އް"],["ޫ ލ","ު ލ"],["އްލަލ","އްލަ"],["«",'"'],["»",'"']];document.getElementById("transliterateArToDv").addEventListener("click",(()=>{r(),h.value=function(e){e=e.replace(/(.)ّ/g,((e,t)=>`އް${D.find((([e])=>e===t))?.[1]||t}`)),e=(e=e.replace(/ة([َِ ُ ً ٍ ٌ])/g,"ތ$1")).replace(/ة(?![َِ ُ ً ٍ ٌ])/g,"ހ");for(const[t,a]of D)e=e.replace(new RegExp(t,"g"),a);return e}(h.value),t()}));const M=new class{constructor(){this.ehbari="ސުމެއް އެއް ދެ ތިން ހަތަރު ފަސް ހަ ހަތް އަށް ނުވަ ދިހަ އެގާރަ ބާރަ ތޭރަ ސާދަ ފަނަރަ ސޯޅަ ސަތާރަ އަށާރަ ނަވާރަ ވިހި އެކާވީސް ބާވީސް ތޭވީސް ސައުވީސް ފަންސަވީސް ސައްބީސް ހަތާވީސް އަށާވީސް ނަވާވީސް".split(" "),this.dhihabari="ސުން ދިހަ ވިހި ތިރީސް ސާޅީސް ފަންސާސް ފަސްދޮޅަސް ހައްދިހަ އައްޑިހަ ނުވަދިހަ".split(" "),this.sunbari=["","ހާސް","މިލިޔަން","ބިލިޔަން","ޓްރިލިޔަން"]}convert(e){return e?1e3>(e=parseInt(e))?this.thousandSub(e):this.thousandUp(e):null}thousandSub(e){var t="ސަތޭކަ ";if(0>=e||29>=e)return this.ehbari[e];if(99>=e)return t=Math.floor(e/10),0===(e%=10)?this.dhihabari[t]:`${this.dhihabari[t]} ${this.ehbari[e]}`;if(999>=e){const a=e%100;return 2===(e=Math.floor(e/100))&&(this.ehbari[2]="ދުވި",t="ސައްތަ "),0===a?`${this.ehbari[e]} ${t}`:`${this.ehbari[e]} ${t}${this.thousandSub(a)}`}return""}thousandHalf(e){const t=[];for(;0!==e;)t.push(e%1e3),e=Math.floor(e/1e3);return t}thousandUp(e){var t=this.thousandHalf(e);e=t.length-1;const a=[];for(var n of t.reverse()){t=`${this.thousandSub(n)} `;let r=`${this.sunbari[e]} `;if(" "===t)break;"ސުން "!==t&&"ސުމެއް "!==t||(r=t=""),a.push(t+r),--e}return(n=a.join("")).endsWith(",")&&(n=n.slice(0,-1)),n.trim()}};document.getElementById("Nos2DvTxt").addEventListener("click",(()=>{r();const e=h.value.split("\n").map((e=>{const t=e.match(/\d+/g);return t?t.map((e=>M.convert(e).replace(/\s+/g," ").trim())).join("، "):e.trim()}));h.value=e.filter((e=>0{const e=/[\u07a6-\u07b0]/,t=/[\u064b-\u0650\u0652-\u0656]/,a=/[\u0780-\u07a5]/,n=/[\u064e\u064f\u0650]/,r=h.value.split(/\s+/),l=[];for(let o=0;oe+t.issues.length),0),a=h.value.split(/\s+/),n=`Found ${t} issue${1`;e.forEach(((e,t)=>{const r=a[e.index-1]||"",l=a[e.index+1]||"";let o=e.issues.map((t=>{let a,n;switch(a="multiple"===t.type?`${e.word[t.index-1]||""}${e.word[t.index]} ${e.word[t.index+1]}`:`${e.word[t.index-1]||""} ${e.word[t.index]}`,t.type){case"multiple":n=`Multiple Fili :  ${a}`;break;case"noDvFili":n=`Thaana w/o Fili :  ${a}`;break;case"standalone":n=`Standalone Fili :  ${a}`}return n})).join(", ");n+=`${t+1}. ${r} ${e.word} ${l} : ${o}
`})),F.innerHTML=n}F.style.display="block"}(l)})),document.getElementById("removePunctuation").addEventListener("click",(()=>{r(),h.value=h.value.replace(/[^\w\s]/g,""),t()}));let j=!1;const q={a:"4",e:"3",i:"!",o:"0",t:"7",l:"1",s:"5"},U=Object.fromEntries(Object.entries(q).map((([e,t])=>[t,e])));document.getElementById("toggleLeetSpeak").addEventListener("click",(()=>{h.value=j?h.value.replace(/[43!0715]/g,(e=>U[e])):h.value.toLowerCase().replace(/[aeiotls]/g,(e=>q[e])),j=!j,t(),n()})),document.getElementById("numerateWords").addEventListener("click",(()=>{const e=document.getElementById("textArea");document.getElementById("numerateWords").textContent.includes("No → Wrd")?(e.value=e.value.replace(/\b\d+\b/g,(e=>function(e){const t=" one two three four five six seven eight nine".split(" "),a=" twenty thirty forty fifty sixty seventy eighty ninety".split(" ");var n="ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split(" ");return 10>e?t[e]:20>e?n[e-10]:100>e?(n=e%10,a[Math.floor(e/10)]+(n?`-${t[n]}`:"")):e}(parseInt(e)))).replace(/%/g,"percent"),document.getElementById("numerateWords").textContent="Wrd → No"):(e.value=e.value.replace(/\b(?:\w+(?:-\w+)*)\b/g,(e=>{var t=e.toLowerCase();return e={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90,hundred:100},t.includes("-")?e=(e[(t=t.split("-"))[0]]||0)+(e[t[1]]||0):e=e[t]||t,e})).replace(/\bpercent\b/g,"%"),document.getElementById("numerateWords").textContent="No → Wrd"),t()}));const R=document.getElementById("prefixInput"),N=document.getElementById("suffixInput");document.getElementById("prefixSuffixToLine").addEventListener("click",(()=>{if("none"===R.style.display)R.style.display="inline-block",N.style.display="inline-block";else{const e=R.value,a=N.value,n=h.value.split("\n").map((t=>e+t+a));h.value=n.join("\n"),t()}}));const P=document.getElementById("removeFromStart"),z=document.getElementById("removeFromEnd");document.getElementById("rmvNoOfCharsPerLine").addEventListener("click",(()=>{if("none"===P.style.display)P.style.display="inline-block",z.style.display="inline-block";else{const e=parseInt(P.value)||0,a=parseInt(z.value)||0,n=h.value.split("\n").map((t=>t.length<=e+a?"":t.slice(e,t.length-a)));h.value=n.join("\n"),t()}}));const H=document.getElementById("findInput"),O=document.getElementById("replaceInput");document.getElementById("findAndReplaceText").addEventListener("click",(()=>{var e=H.value;const a=O.value;e&&(e=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),h.value=h.value.replace(e,a),t())})),document.getElementById("diffCompare").addEventListener("click",(()=>{window.open("diffCompare.html","_blank")})),document.getElementById("keyboardPage").addEventListener("click",(()=>{window.open("keyboardPage.html","_blank")})),document.getElementById("qrGenerator").addEventListener("click",(()=>{window.open("qrGenerator.html","_blank")})),document.getElementById("fullscreen").addEventListener("click",(()=>{document.fullscreenElement?(document.exitFullscreen(),h.style.height="300px"):(document.documentElement.requestFullscreen(),h.style.height="100vh")})),document.addEventListener("fullscreenchange",(()=>{document.fullscreenElement||(h.style.height="300px")})),o(),setInterval(o,6e4),document.getElementById("toggleMilitaryTime").addEventListener("click",(()=>{const e="true"===localStorage.getItem("militaryTime");localStorage.setItem("militaryTime",!e),o()})),h.addEventListener("input",(e=>{const t=e.target.selectionStart;var a=e.target.value.substring(0,t);"ss-"===a.split(/\s/).pop()&&(a=a.replace(/ss-$/,"ﷺ")+e.target.value.substring(t),e.target.value=a,e.target.setSelectionRange(t,t))})),document.querySelectorAll(".copy-button, .copy-button-lit, .copy-button-other").forEach((e=>{e.addEventListener("click",(async()=>{const t=e.dataset.text||e.textContent.trim();try{await navigator.clipboard.writeText(t),c(e,"Copied")}catch(e){console.error("Failed to copy:",e)}}))})),document.querySelectorAll("button").forEach((e=>{e.addEventListener("click",(t=>{e.closest(".dropdown-button")||c(e,"Clicked")}))}));var W=JSON.parse(localStorage.getItem("editorTabs"));W&&(C=W,C.forEach((e=>{if(1{C[w-1].content=h.value,localStorage.setItem("editorTabs",JSON.stringify(C)),localStorage.setItem("currentTab",w)}),5e3),t();const Z=document.getElementById("calcArea"),_=document.getElementById("addCalcTab"),J=document.querySelector(".calc-numbered-tabs");if(Z&&_&&J){let he=1,Ee=[{id:1,content:""}];const fe=document.getElementById("sumTotal"),ke=document.getElementById("zakatAmount"),Ie=document.getElementById("lineResults"),$e=document.getElementById("copyTotal"),Be=document.getElementById("clearCalc");function G(){let e=0,t="";Z.value.split("\n").forEach((a=>{a=function(e){let t=e.match(/[+-]?\d*\.?\d+(?:,\d{3})*(?:\d*\.?\d+)?/g)||[];e=e.match(/[\+\-\*x\/÷]/g)||[],t=t.map((e=>parseFloat(e.replace(/,/g,""))));for(let a=0;ae+t),0)}(a),e+=a,t+=`${e.toFixed(2)}\n`})),fe.textContent=e.toFixed(2),ke.textContent=(.025*e).toFixed(2),Ie.textContent=t}function Q(e){Ee[he-1].content=Z.value,he=e,Z.value=Ee[he-1].content,document.querySelectorAll(".calc-numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),G()}_.addEventListener("click",(()=>{const e=Ee.length+1;Ee.push({id:e,content:""});const t=document.createElement("button");t.classList.add("calc-numbered-tab"),t.dataset.tab=e,t.textContent=e,J.insertBefore(t,_),Q(e)})),J.addEventListener("click",(e=>{e.target.classList.contains("calc-numbered-tab")&&Q(e=parseInt(e.target.dataset.tab))})),Z.addEventListener("input",G),$e.addEventListener("click",(()=>{navigator.clipboard.writeText(fe.textContent),c($e,"Copied")})),Be.addEventListener("click",(()=>{Z.value="",Ie.textContent="",fe.textContent="0.00",ke.textContent="0.00",Ee=[{id:1,content:""}],he=1;const e=J.querySelectorAll(".calc-numbered-tab");e.forEach((e=>{"1"!==e.dataset.tab&&e.remove()})),e[0].classList.add("active"),c(Be,"Cleared")})),(W=JSON.parse(localStorage.getItem("calculatorTabs")))&&(Ee=W,Ee.forEach((e=>{if(1{Ee[he-1].content=Z.value,localStorage.setItem("calculatorTabs",JSON.stringify(Ee)),localStorage.setItem("currentCalcTab",he)}),5e3)}const K=document.querySelector(".proportion-container"),V=document.getElementById("addPropTab"),Y=document.querySelector(".prop-numbered-tabs");if(K&&V&&Y){let Se=1,Le=[{id:1,content:K.innerHTML}];function X(){document.querySelectorAll(".proportion-set").forEach((e=>{e.querySelectorAll(".prop-input").forEach((t=>{t.addEventListener("input",(()=>function(e){if(e=e.querySelectorAll(".prop-input"),3<=Array.from(e).filter((e=>""!==e.value)).length){const t=e[0].value,a=e[1].value,n=e[2].value;t&&a&&n&&(e[3].value=(a/t*n).toFixed(2))}else e[3].value=""}(e)))}))}))}function ee(e){Le[Se-1].content=K.innerHTML,Se=e,K.innerHTML=Le[Se-1].content,document.querySelectorAll(".prop-numbered-tab").forEach((t=>{t.classList.toggle("active",parseInt(t.dataset.tab)===e)})),X()}V.addEventListener("click",(()=>{const e=Le.length+1;Le.push({id:e,content:K.innerHTML});const t=document.createElement("button");t.classList.add("prop-numbered-tab"),t.dataset.tab=e,t.textContent=e,Y.insertBefore(t,V),ee(e)})),Y.addEventListener("click",(e=>{e.target.classList.contains("prop-numbered-tab")&&ee(e=parseInt(e.target.dataset.tab))})),X(),(W=JSON.parse(localStorage.getItem("proportionTabs")))&&(Le=W,Le.forEach((e=>{if(1{Le[Se-1].content=K.innerHTML,localStorage.setItem("proportionTabs",JSON.stringify(Le)),localStorage.setItem("currentPropTab",Se)}),5e3);const we=document.getElementById("clearProp");we.addEventListener("click",(()=>{document.querySelectorAll(".proportion-set").forEach((e=>{e.querySelectorAll(".prop-input").forEach(((e,t)=>{e.value=2===t?"1":""}))})),Le=[{id:1,content:K.innerHTML}],Se=1;const e=Y.querySelectorAll(".prop-numbered-tab");e.forEach((e=>{"1"!==e.dataset.tab&&e.remove()})),e[0].classList.add("active"),c(we,"Cleared")}))}let te="true"===localStorage.getItem("nightCalcMilitaryTime");document.getElementById("maghribTime").addEventListener("change",s),document.getElementById("fajrTime").addEventListener("change",s),document.getElementById("toggleNightCalcFormat").addEventListener("click",(()=>{te=!te,localStorage.setItem("nightCalcMilitaryTime",te),s()}));const ae=e=>btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),"")),ne=e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))),re=new TextEncoder,le=new TextDecoder,oe=e=>window.crypto.subtle.importKey("raw",re.encode(e||"empty"),"PBKDF2",!1,["deriveKey"]),ce=(e,t,a)=>window.crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:25e4,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!1,a),se=document.querySelectorAll(".crypt-tab"),ue=document.querySelectorAll(".crypt-panel");se.forEach((e=>{e.addEventListener("click",(()=>{se.forEach((e=>e.classList.remove("active"))),ue.forEach((e=>e.classList.remove("active"))),e.classList.add("active"),document.getElementById(e.dataset.crypttab+"Crypt").classList.add("active")}))}));const ie=document.getElementById("encryptButton"),de=document.getElementById("decryptButton"),me=document.getElementById("copyEncrypted"),pe=document.getElementById("copyDecrypted");ie&&ie.addEventListener("click",(async()=>{const e=document.getElementById("textToEncrypt").value,t=document.getElementById("encryptPassword").value;if(e)try{const a=await d(e,t);document.getElementById("encryptedText").value=a,c(ie,"Encrypted")}catch(e){console.error("Encryption failed:",e),c(ie,"Encryption failed")}else c(ie,"Please enter text to encrypt")})),de&&de.addEventListener("click",(async()=>{const e=document.getElementById("textToDecrypt").value,t=document.getElementById("decryptPassword").value;if(e)try{const a=await m(e,t);document.getElementById("decryptedText").value=a||"Decryption failed",c(de,a?"Decrypted":"Failed")}catch(e){console.error("Decryption failed:",e),c(de,"Decryption failed"),document.getElementById("decryptedText").value="Decryption failed"}else c(de,"Please enter text to decrypt")})),me&&me.addEventListener("click",(()=>{const e=document.getElementById("encryptedText").value;e&&(navigator.clipboard.writeText(e),c(me,"Copied"))})),pe&&pe.addEventListener("click",(()=>{const e=document.getElementById("decryptedText").value;e&&(navigator.clipboard.writeText(e),c(pe,"Copied"))}));const ge=document.getElementById("fileToEncrypt"),ve=document.getElementById("fileToDecrypt"),ye=document.getElementById("fileEncryptButton"),be=document.getElementById("fileDecryptButton");ye?.addEventListener("click",(async()=>{const e=ge.files[0],t=document.getElementById("fileEncryptPassword").value;if(e)try{c(ye,"Encrypting...");const a=await p(e),n=await d(new Uint8Array(a),t);g(new Blob([ne(n)],{type:"application/octet-stream"}),e.name+".encrypted"),c(ye,"Encrypted")}catch(e){console.error("File encryption failed:",e),c(ye,"Encryption failed")}else c(ye,"Please select a file")})),be?.addEventListener("click",(async()=>{const e=ve.files[0],t=document.getElementById("fileDecryptPassword").value;if(e)try{c(be,"Decrypting...");const a=await p(e),n=await m(ae(new Uint8Array(a)),t);g(new Blob([(new TextEncoder).encode(n)],{type:"application/octet-stream"}),e.name.replace(/\.encrypted$/,"")),c(be,"Decrypted")}catch(e){console.error("File decryption failed:",e),c(be,"Decryption failed")}else c(be,"Please select a file")})),ge?.addEventListener("change",(()=>{v(ge)})),ve?.addEventListener("change",(()=>{v(ve)})),document.querySelectorAll(".file-label").forEach((e=>{e.addEventListener("dragover",(t=>{t.preventDefault(),e.classList.add("dragover")})),e.addEventListener("dragleave",(()=>{e.classList.remove("dragover")})),e.addEventListener("drop",(t=>{t.preventDefault(),e.classList.remove("dragover");const a=document.getElementById(e.getAttribute("for"));0<(t=t.dataTransfer.files).length&&(a.files=t,v(a))}))}))})); \ No newline at end of file