quran-madina-html 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/quran-madina-html.min.css +1 -1
- package/dist/quran-madina-html.min.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,6 +28,19 @@ the snippet above once it's on your own page.)
|
|
|
28
28
|
* **Three layouts** — the 1441H and 1405H Madina prints and the 15-line IndoPak, at any font size.
|
|
29
29
|
* **Word-level addressing** — render any word range, even across ayas, pages, and suras.
|
|
30
30
|
|
|
31
|
+
## New in 2.1: emphasise letters
|
|
32
|
+
|
|
33
|
+
`letters` marks single letters inside words, in a colour of your choice, optionally blinking —
|
|
34
|
+
on plain text and inside `highlight`/`error` words. See [Emphasising letters](#emphasising-letters).
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<quran-madina-html sura="1" aya="2-4" highlight="1" error="4"
|
|
38
|
+
letters="1:3, 4:3+5 lapis blink, 6:4 emerald"></quran-madina-html>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Also new: a [Flutter wrapper](#flutter-wrapper) for Android, iOS, macOS and the web, which
|
|
42
|
+
can work offline.
|
|
43
|
+
|
|
31
44
|
## New in 2.0: lines justified like the print
|
|
32
45
|
|
|
33
46
|
Version 2 stretches the **letters themselves** (kashida strokes and wider letter forms, the way a
|
|
@@ -166,6 +179,26 @@ a `words` selection, and even on a full `page` render:
|
|
|
166
179
|
|
|
167
180
|
<img src="demo/img/highlight.png" width="216" alt="highlight attribute marking words 2-3 of Al-Fatiha's first aya">
|
|
168
181
|
|
|
182
|
+
### Emphasising letters
|
|
183
|
+
|
|
184
|
+
`letters` marks single letters inside words, for teaching a letter or pointing at a mistake:
|
|
185
|
+
comma-separated groups of `word:letters colour blink`. Word numbers count like `highlight`/`error`;
|
|
186
|
+
letters are `3`, `3-5` or `3+5`; the colour is optional — `crimson` (default), `emerald`, `lapis`,
|
|
187
|
+
`gold`, `violet` or any CSS colour; `blink` is optional too (no animation by default). The letter
|
|
188
|
+
gets a soft halo of its own colour that sits behind the surrounding ink; with `blink` the halo
|
|
189
|
+
pulses gently while the letter keeps its colour in every frame (still in print and with reduced
|
|
190
|
+
motion). It works inside `highlight`/`error` words and gets a lighter shade on dark pages.
|
|
191
|
+
Nothing changes size or position.
|
|
192
|
+
|
|
193
|
+
```html
|
|
194
|
+
<quran-madina-html sura="1" aya="2-4" highlight="1" error="4"
|
|
195
|
+
letters="1:3, 4:3+5 lapis blink, 6:4 emerald"></quran-madina-html>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
<img src="demo/img/letters.png" width="300" alt="letters attribute marking letters inside highlighted, error and plain words">
|
|
199
|
+
|
|
200
|
+
Lam-alef (لا) is a single glyph, so marking either of its letters colours both.
|
|
201
|
+
|
|
169
202
|
## Getting Started
|
|
170
203
|
|
|
171
204
|
### Installation
|
|
@@ -268,6 +301,7 @@ By default a multiline render gets a header (sura name + copy/translate icons);
|
|
|
268
301
|
| `words` | `string` | - | 1-based word index or range (e.g., `"1:2"`, `"3-10"`, or single index `"5"`). |
|
|
269
302
|
| `highlight` | `string` | - | 1-based word range to mark soft yellow (same format as `words`). Works with or without `words`, and with `page` too. |
|
|
270
303
|
| `error` | `string` | - | 1-based word range to mark soft red (same format as `words`). Wins over `highlight` on overlap. |
|
|
304
|
+
| `letters` | `string` | - | Letters to emphasise inside words: `"1:3 crimson, 4:3-5 emerald blink"` (word:letters, optional colour — crimson by default — and optional `blink`). Works with `highlight`/`error`, `words` and `page`. |
|
|
271
305
|
| `headless` | `boolean \| string` | `false` | Set to `"true"` to remove top sura header chrome and copy/translate icons. |
|
|
272
306
|
| `notitle` | `boolean \| string` | `false` | Set to `"true"` to hide sura name text while retaining title frame decoration. |
|
|
273
307
|
| `data-layout` | `string` | `"1441H"` | Layout: `1441H`, `1405H`, `IndoPak`. |
|
|
@@ -294,6 +328,37 @@ import QuranMadinaHtml from "@tarekeldeeb/quran-madina-react";
|
|
|
294
328
|
See [`react/README.md`](react/README.md) for the full prop reference and the Capacitor
|
|
295
329
|
(iOS/Android) packaging guide.
|
|
296
330
|
|
|
331
|
+
## Flutter wrapper
|
|
332
|
+
|
|
333
|
+
For Flutter apps, use `quran_madina_flutter`, a widget with the same options as the React
|
|
334
|
+
component. It lives in this repo's [`flutter/`](flutter) folder and is released in step with
|
|
335
|
+
this package.
|
|
336
|
+
|
|
337
|
+
- **Android, iOS, macOS:** the text renders in the platform's own WebView (WKWebView on Apple
|
|
338
|
+
devices), the same engine as a Capacitor app.
|
|
339
|
+
- **Web:** no WebView; the `<quran-madina-html>` tag goes straight into the page.
|
|
340
|
+
- **Offline:** `dart run quran_madina_flutter:bundle` copies the library, databases and fonts
|
|
341
|
+
into the app's assets. `bundled: true` then loads them from there instead of unpkg.
|
|
342
|
+
|
|
343
|
+
```yaml
|
|
344
|
+
dependencies:
|
|
345
|
+
quran_madina_flutter:
|
|
346
|
+
git:
|
|
347
|
+
url: https://github.com/tarekeldeeb/quran-madina-html
|
|
348
|
+
path: flutter
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
```dart
|
|
352
|
+
import 'package:quran_madina_flutter/quran_madina_flutter.dart';
|
|
353
|
+
|
|
354
|
+
QuranMadinaFlutter(sura: 1, aya: '2-4', letters: '1:3, 4:3-5 emerald blink')
|
|
355
|
+
QuranMadinaFlutter(page: 106, bundled: true) // offline
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
See [`flutter/README.md`](flutter/README.md) for the full option reference and the one-time
|
|
359
|
+
platform settings for offline use. The example app's web build runs live at
|
|
360
|
+
<https://tarekeldeeb.github.io/quran-madina-html/flutter/>.
|
|
361
|
+
|
|
297
362
|
## Dev Setup
|
|
298
363
|
|
|
299
364
|
The project is published on npm ``npm install quran-madina-html``, with sources, assets and distributables.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
quran-madina-html{--qmh-background:#F5F5DC;--qmh-header:black;--qmh-highlight:#fff3b0;--qmh-error:#f5c6cb;--qmh-highlight-text:#1a1a1a;--qmh-error-text:#1a1a1a;display:inline-flex;direction:rtl;background-color:color-mix(in srgb,var(--qmh-background) 10%,transparent);border-radius:5px;overflow:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}quran-madina-html[data-qmh-text-scheme=dark]{--qmh-highlight:#5c4600;--qmh-error:#6b1a24;--qmh-highlight-text:#ffffff;--qmh-error-text:#ffffff}quran-madina-html-header{background-color:color-mix(in srgb,var(--qmh-header) 20%,transparent);font-size:smaller;display:block;padding:5px 5px 5px 10px;margin-bottom:5px;color:color-mix(in srgb,currentColor 60%,transparent);height:25px;line-height:25px}quran-madina-html-line{text-align:right;white-space:nowrap;transform-origin:top right;margin-right:5px}quran-madina-html.quran-madina-html-inline quran-madina-html-line::before{content:"\201D";color:color-mix(in srgb,currentColor 50%,transparent)}quran-madina-html.quran-madina-html-inline quran-madina-html-line::after{content:"\201C";color:color-mix(in srgb,currentColor 50%,transparent)}.quran-madina-html-part{transition:background-color .5s ease}.quran-madina-html-word-hidden{visibility:hidden}.quran-madina-html-word-highlight{background-color:var(--qmh-highlight);color:var(--qmh-highlight-text,currentColor)}.quran-madina-html-word-error{background-color:var(--qmh-error);color:var(--qmh-error-text,currentColor)}quran-madina-html-line:has(.quran-madina-html-sura-start){position:relative}quran-madina-html-line:has(.quran-madina-html-sura-start)::before{content:"";position:absolute;inset:0;background-color:currentColor;-webkit-mask-image:url(../assets/img/sura_border_sym4.svg);mask-image:url(../assets/img/sura_border_sym4.svg);-webkit-mask-size:95% 100%;mask-size:95% 100%;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;mask-mode:alpha;pointer-events:none}svg.quran-madina-html-icon{float:left;padding:4px 4px 0 7px;border-radius:5px}svg.quran-madina-html-icon:hover{background-color:color-mix(in srgb,var(--qmh-header) 50%,transparent)}svg.quran-madina-html-icon path{fill:color-mix(in srgb,currentColor 60%,transparent)}quran-madina-html-aya-popup{display:none;position:fixed;direction:rtl;z-index:1000;align-items:center;gap:2px;background-color:color-mix(in srgb,var(--qmh-header) 85%,transparent);border-radius:6px;padding:2px 4px;box-shadow:0 2px 10px rgba(0,0,0,.35)}quran-madina-html-aya-popup.quran-madina-html-open{display:flex}quran-madina-html-aya-popup svg.quran-madina-html-icon{float:none;padding:4px}quran-madina-html-aya-popup svg.quran-madina-html-icon path{fill:var(--qmh-background)}
|
|
1
|
+
quran-madina-html{--qmh-background:#F5F5DC;--qmh-header:black;--qmh-highlight:#fff3b0;--qmh-error:#f5c6cb;--qmh-highlight-text:#1a1a1a;--qmh-error-text:#1a1a1a;display:inline-flex;direction:rtl;background-color:color-mix(in srgb,var(--qmh-background) 10%,transparent);border-radius:5px;overflow:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}quran-madina-html[data-qmh-text-scheme=dark]{--qmh-highlight:#5c4600;--qmh-error:#6b1a24;--qmh-highlight-text:#ffffff;--qmh-error-text:#ffffff}quran-madina-html-header{background-color:color-mix(in srgb,var(--qmh-header) 20%,transparent);font-size:smaller;display:block;padding:5px 5px 5px 10px;margin-bottom:5px;color:color-mix(in srgb,currentColor 60%,transparent);height:25px;line-height:25px}quran-madina-html-line{text-align:right;white-space:nowrap;transform-origin:top right;margin-right:5px}quran-madina-html.quran-madina-html-inline quran-madina-html-line::before{content:"\201D";color:color-mix(in srgb,currentColor 50%,transparent)}quran-madina-html.quran-madina-html-inline quran-madina-html-line::after{content:"\201C";color:color-mix(in srgb,currentColor 50%,transparent)}.quran-madina-html-part{transition:background-color .5s ease}.quran-madina-html-word-hidden{visibility:hidden}.quran-madina-html-word-highlight{background-color:var(--qmh-highlight);color:var(--qmh-highlight-text,currentColor)}.quran-madina-html-word-error{background-color:var(--qmh-error);color:var(--qmh-error-text,currentColor)}.quran-madina-html-word-error,.quran-madina-html-word-highlight{-webkit-print-color-adjust:exact;print-color-adjust:exact}quran-madina-html{--qmh-letter:#a3263a}quran-madina-html.quran-madina-html-lettered .quran-madina-html-ink,quran-madina-html.quran-madina-html-lettered .quran-madina-html-word:not(.quran-madina-html-word-lettered){position:relative;z-index:1}.quran-madina-html-letter{color:var(--qmh-letter);text-shadow:0 0 .1em color-mix(in srgb,currentColor 30%,transparent);-webkit-print-color-adjust:exact;print-color-adjust:exact}.quran-madina-html-letter-blink{animation:quran-madina-html-letter-blink 1.4s ease-in-out infinite}quran-madina-html[data-qmh-text-scheme=dark] .quran-madina-html-letter{color:color-mix(in srgb,var(--qmh-letter) 45%,#fff)}@keyframes quran-madina-html-letter-blink{0%,100%,55%{text-shadow:0 0 .1em color-mix(in srgb,currentColor 30%,transparent)}70%,85%{text-shadow:0 0 .08em color-mix(in srgb,currentColor 75%,transparent),0 0 .28em color-mix(in srgb,currentColor 60%,transparent),0 0 .55em color-mix(in srgb,currentColor 40%,transparent)}}@media (prefers-reduced-motion:reduce){.quran-madina-html-letter{animation:none}}@media print{.quran-madina-html-letter{animation:none}}quran-madina-html-line:has(.quran-madina-html-sura-start){position:relative}quran-madina-html-line:has(.quran-madina-html-sura-start)::before{content:"";position:absolute;inset:0;background-color:currentColor;-webkit-mask-image:url(../assets/img/sura_border_sym4.svg);mask-image:url(../assets/img/sura_border_sym4.svg);-webkit-mask-size:95% 100%;mask-size:95% 100%;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;mask-mode:alpha;pointer-events:none}svg.quran-madina-html-icon{float:left;padding:4px 4px 0 7px;border-radius:5px}svg.quran-madina-html-icon:hover{background-color:color-mix(in srgb,var(--qmh-header) 50%,transparent)}svg.quran-madina-html-icon path{fill:color-mix(in srgb,currentColor 60%,transparent)}quran-madina-html-aya-popup{display:none;position:fixed;direction:rtl;z-index:1000;align-items:center;gap:2px;background-color:color-mix(in srgb,var(--qmh-header) 85%,transparent);border-radius:6px;padding:2px 4px;box-shadow:0 2px 10px rgba(0,0,0,.35)}quran-madina-html-aya-popup.quran-madina-html-open{display:flex}quran-madina-html-aya-popup svg.quran-madina-html-icon{float:none;padding:4px}quran-madina-html-aya-popup svg.quran-madina-html-icon path{fill:var(--qmh-background)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! quran-madina-html
|
|
2
|
-
!function(){var z="quran-madina-html",n=/localhost/.test(document.location.hostname)?"../":`https://www.unpkg.com/${z}/`,P={content:"Loading .."},g=/[\u0621-\u064A\u0671-\u06D3]/,T="﷽";function H(t,e){return 1===e&&0!==t}var o={};function m(e){try{for(var t=sessionStorage.length-1;0<=t;t--){var r=sessionStorage.key(t);r&&0===r.indexOf("quran-madina-html:"+e)&&sessionStorage.removeItem(r)}}catch(t){}Object.keys(o).forEach(function(t){0===t.indexOf(e)&&delete o[t]})}var l={};function a(s,t,e,r){var i,n=!r&&function(t){if(o[t])return o[t];try{var e=sessionStorage.getItem("quran-madina-html:"+t);if(e)return o[t]=JSON.parse(e)}catch(t){}return null}(s);n?t&&setTimeout(function(){t(n)},0):l[s]?l[s].push({success:t,error:e}):(l[s]=[{success:t,error:e}],(i=new XMLHttpRequest).onreadystatechange=function(){if(i.readyState===XMLHttpRequest.DONE){var t=l[s];if(delete l[s],200===i.status){var e=JSON.parse(i.responseText),r=s,n=e,a=i.responseText;o[r]=n;try{sessionStorage.setItem("quran-madina-html:"+r,a)}catch(t){}t.forEach(function(t){t.success&&t.success(e)})}else t.forEach(function(t){t.error&&t.error(i)})}},i.open("GET",s,!0),i.send())}function M(t){console.log(z+"> "+t)}function N(t){return null!=t&&(""===(t=String(t).trim().toLowerCase())||"true"===t||"1"===t||"yes"===t)}function j(t){var e=(e=(e=getComputedStyle(t).color)&&e.match(/[\d.]+/g))?.2126*r(+e[0])+.7152*r(+e[1])+.0722*r(+e[2]):1;function r(t){return(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}t.setAttribute("data-qmh-text-scheme",.5<e?"dark":"light")}function B(t){return Array(2).fill(t.split("-")[0]-1)}function O(t){return 2==t.split("-").length?t.split("-").map(t=>parseInt(t)+1):Array(2).fill(parseInt(t.split("-")[0])+1)}function V(t){return null==t||2!=(t=1==(t=t.split(/[-:]/).map(t=>parseInt(t,10))).length?[t[0],t[0]]:t).length||isNaN(t[0])||isNaN(t[1])||t[0]<1||t[1]<t[0]?null:t}function R(t,e,r){return null==e?null:e[0]<r[0]||e[1]>r[1]?(M(`${t} range ${e[0]}-${e[1]} outside displayed words ${r[0]}-${r[1]}, ignoring`),null):e}function D(t,e){if(null!=t&&"auto"!==t){if("no"===t)return!0;M("yes"===t?'inline="yes" is not implemented yet; falling back to "auto"':"Bad inline parameter: "+t)}return e}function u(t){return g.test(t)}function X(t,e){return(0===t?2:1)<=e}function F(t){var e=0;return t.t.split(/\s+/).forEach(function(t){u(t)&&(e+=1)}),e}function W(t){var e=0;return t.r.forEach(function(t){e+=F(t)}),e}function Y(t){for(var e=t.p,r=null,n=0;n<t.r.length;n++)null!==r&&t.r[n].l<r&&(e+=1),r=t.r[n].l;return e}function Z(t,e,r){for(var n=P.suras[t].ayas,a=0,s=e;s<=r;s++)X(t,s)&&(a+=W(n[s]));return a}function tt(t,e,r,n,a){for(var s=0,i=t;i<=r;i++)for(var o=P.suras[i].ayas,l=i===r?n:o.length-1,u=i===t?e:0;u<=l;u++){var c=o[u];void 0!==c&&c.p===a&&X(i,u)&&(s+=W(c))}return s}function et(t,e="class",n=null,a="transparent"){var s="tag"===e.toLowerCase()?document.getElementsByTagName(t):document.getElementsByClassName(t);Array.from(s).forEach(function(r){r.onmouseover=function(){var t,e=n||(t=r,getComputedStyle(t).getPropertyValue("--qmh-hover").trim())||`rgba(${(getComputedStyle(t).color.match(/[\d.]+/g)||[128,128,128]).slice(0,3).join(",")},0.12)`;Array.from(s).forEach(function(t){t.style.backgroundColor=e})},r.onmouseout=function(){Array.from(s).forEach(function(t){t.style.backgroundColor=a})}})}function rt(t,e){var r=(t,e)=>String(t).padStart(e,"0"),r=[z+"-part",`${z}-${r(t,3)}-`+r(e,3)];return(-1==e||1==t&&0==e)&&r.push("quran-madina-html-sura-start"),r}function y(){var t=document.createElement("div");return t.innerHTML='<svg viewBox="0 0 24 24" class="quran-madina-html-icon" width="20px"><path d="M16.02 20.96H3.78c-.41 0-.75-.34-.75-.75V7.74c0-.41.34-.75.75-.75h7.87c.21 0 .39.08.53.22l4.37 4.37c.14.14.22.32.22.53v8.11c0 .4-.34.74-.75.74ZM4.53 19.47h10.75v-6.61h-3.62c-.41 0-.75-.34-.75-.75V8.48H4.53v10.99Z"></path><path d="m20.74 7.63-4.37-4.37c-.14-.14-.36-.2-.53-.22H8.01c-.41 0-.75.34-.75.75V5.5h1.49v-.97h6.34v3.62c0 .41.34.75.75.75h3.62v8.19h-1.2v1.49h1.95c.41 0 .75-.34.75-.75V8.16c0-.21-.08-.4-.22-.53Z"></path></svg>'.trim(),t.firstChild}function v(){var t=document.createElement("div");return t.innerHTML='<svg class="quran-madina-html-icon" viewBox="0 0 820 615" style="height:20px"><path d="M70 1.9C37.6 8.8 12.6 33.4 3.4 67.5c-1.8 6.6-1.9 11.9-1.9 98v91l2.3 8c5.1 17.8 17 36.4 29.9 46.7 10.8 8.6 25.4 15.4 38.1 17.8 3.1.6 15.2 1 26.8 1 17.7 0 21.3.2 21.7 1.4.4.9.6 17.1.7 36.1 0 32.4.2 34.9 2 38.5 6.4 12.5 21.4 17.4 33.3 10.8 2.3-1.3 7.5-6.4 12.1-11.9l63-74.1c.6-.4 16.3-.8 34.9-.8H300l-.2-18.3-.3-18.2-42.8.1-43.1.5c-.2.2-12.7 15.1-27.9 33.1-15.1 18-27.8 32.4-28.1 32.1-.3-.4-.6-15.3-.6-33.2v-32.6l-38.8-.1c-42.1-.2-43.9-.4-54.3-6-6.5-3.6-16.9-14.6-20.2-21.5-5.8-11.9-5.7-10-5.7-100.7 0-92-.2-89.4 6.3-101.7 3.9-7.3 13.5-17.1 20.3-20.7C76 36.7 66.1 37 244.5 37L412 38.1c18 4.1 33.5 20.5 37.5 39.6 2.2 10.2 2.1 164.6 0 174.8-3.9 18.3-16.4 32.7-33.5 38.5-3.2 1.1-7.8 2-10 2-3.1 0-4 .4-4 1.7 0 1-.2 8.8-.3 17.3-.2 8.5-.2 16.2 0 17 .9 3.3 21.7-.5 34.1-6 13.7-6.3 27.5-17.9 36.2-30.5 5-7.2 10.8-20.4 13.2-30.1l2.3-8.9V165 76.5l-2.3-9c-8.1-31.4-30.5-54.9-61.7-64.8l-7-2.2-169-.2C87.7.1 78 .2 70 1.9zm277.294 102.559q19.5-.5 28.25 24.5 2.5 7.25-3.75 19.75-5.75 11.75-9.75 16-19.5 21.5-67 25.25-27.75 2.25-50.25-2.25-5.25 38.25-16.5 50-26 26.75-66 29.5-27.75 2-42.5-11-20.25-17.75-16.5-48.5 3-23.75 14.25-42.5 2.75-4.5 4.75-7.5 2-3 3-4.25 2.25-2.75 4.75-1.25 2.75 1.5 0 6.25-12.75 24.5-10 45 4 30.5 44.5 30.5 30.25 0 53.25-15.5 12.5-8.25 14.75-14.25-2.25-20.75-13.75-35.75-3.5-4.25-1.75-8l9.5-23.5q3-7.5 8.25 1.25l8.75 14.75q7.75 4.25 28.25 5 16.75-19.25 39.25-36.25 22.5-16.75 36.25-17.25zm11.5 40.5q-12.5-9.5-31.75-5.75-19 3.75-41.25 19.5 50.75.5 73-13.75zm-71.5-89.75q1.5-2 4.25-1.25 5 1.75 9.5 4.5 4.75 2.75 8.75 6.25 2 2 .75 4.5l-12 19q-1.75 2.5-4.5.5-2.5-2-18-11.25-2.75-1.75-1-4.25zm278.784 232.623c-4.7.4-4.7.4-6.7 6.1-1.2 3.1-9.3 25.9-18 50.7l-36.6 102.7-3.5 9.8h17.9 17.8l5.7-17 5.7-17h31.7 31.8l5.6 17.2 5.6 17.3 17.9-.3 18-.3-6-17.2-15-43.2-13.3-38.5-14.1-41-9.9-28.7c-.3-.6-30.2-1.1-34.6-.6zm35.7 106c-.2.2-10 .2-21.9.1l-21.5-.3 9.8-29.5 11-32.5c1.2-2.9 1.8-1.4 12.1 29.4l10.5 32.8zm148.8 139.609c32.4-6.9 57.4-31.5 66.6-65.6 1.8-6.6 1.9-11.9 1.9-98v-91l-2.3-8c-5.1-17.8-17-36.4-29.9-46.7-10.8-8.6-25.4-15.4-38.1-17.8-3.1-.6-15.2-1-26.8-1-17.7 0-21.3-.2-21.7-1.4-.4-.9-.6-17.1-.7-36.1 0-32.4-.2-34.9-2-38.5-6.4-12.5-21.4-17.4-33.3-10.8-2.3 1.3-7.5 6.4-12.1 11.9l-63 74.1c-.6.4-16.3.8-34.9.8h-33.7l.2 18.3.3 18.2 42.8-.1 43.1-.5c.2-.2 12.7-15.1 27.9-33.1 15.1-18 27.8-32.4 28.1-32.1.3.4.6 15.3.6 33.2v32.6l38.8.1c42.1.2 43.9.4 54.3 6 6.5 3.6 16.9 14.6 20.2 21.5 5.8 11.9 5.7 10 5.7 100.7 0 92 .2 89.4-6.3 101.7-3.9 7.3-13.5 17.1-20.3 20.7-11.4 6.1-1.5 5.8-179.9 5.8-108.2 0-164.5-.4-167.5-1.1-18-4.1-33.5-20.5-37.5-39.6-2.2-10.2-2.1-164.6 0-174.8 3.9-18.3 16.4-32.7 33.5-38.5 3.2-1.1 7.8-2 10-2 3.1 0 4-.4 4-1.7 0-1 .2-8.8.3-17.3.2-8.5.2-16.2 0-17-.9-3.3-21.7.5-34.1 6-13.7 6.3-27.5 17.9-36.2 30.5-5 7.2-10.8 20.4-13.2 30.1l-2.3 8.9v88.5 88.5l2.3 9c8.1 31.4 30.5 54.9 61.7 64.8l7 2.2 169 .2 177.5-1.6z"/></svg>'.trim(),t.firstChild}function nt(t){var e=document.createElement("quran-madina-html-header"),t=(e.innerHTML=t,y()),r=(t.addEventListener("click",_),v());return r.addEventListener("click",A),e.appendChild(t),e.appendChild(r),e}var h=null;function J(){h&&(h.popup.classList.remove(z+"-open"),document.removeEventListener("click",h.outsideClick),document.removeEventListener("keydown",h.onEscape),h=null)}function w(e,t,r,n,a){J();function s(t){u.contains(t.target)||J()}function i(t){"Escape"===t.key&&J()}o=e,(l=document.querySelector(`body > ${z}-aya-popup`))||((l=document.createElement(z+"-aya-popup")).appendChild(y()),l.appendChild(v()),document.body.appendChild(l)),["--qmh-header","--qmh-background"].forEach(function(t){l.style.setProperty(t,getComputedStyle(o).getPropertyValue(t))});var o,l,u=l,c=u.children[0],d=u.children[1];c.onclick=function(t){t.stopPropagation();t="“"+(t=e,t=Array.from(t.getElementsByClassName(r)).map(function(t){return t.textContent}).join(" ").replace(/\s+/g," ").trim(),G()?b(t):t)+"”\n\n"+P.suras[n-1].name;navigator.clipboard.writeText(t),alert("⎘ تم نسخ:\n\n"+t),J()},d.onclick=function(t){t.stopPropagation(),window.open(`https://quran.com/${n}/`+a,"_blank"),J()},c=u,d=(d=t).getBoundingClientRect(),c.style.left=Math.max(4,d.left)+"px",c.style.top=(0<d.top-34-6?d.top-34-6:d.bottom+6)+"px",u.classList.add(z+"-open");document.addEventListener("click",s),document.addEventListener("keydown",i),h={popup:u,outsideClick:s,onEscape:i}}function at(r,n,a,s){s<1||Array.from(r.getElementsByClassName(n)).forEach(function(e){e.style.cursor="pointer",e.onclick=function(t){t.stopPropagation(),w(r,e,n,a,s)}})}function st(t,e,r){t.style="display:block;",t.style.setProperty("font-family",P.font_family,""),t.style.setProperty("font-size",P.font_size+"px",""),"me_quran"===P.font_family&&t.style.setProperty("line-height",2*P.font_size+"px",""),G()&&t.style.setProperty("line-height","1.8",""),t.style.width=P.line_width+10+"px",r||t.style.setProperty("box-shadow","inset "+(e%2==1?"":"-")+"8px 0 7px -7px #333","")}function G(){return 2===P.version}function it(t,e,r){e=P.lines[e-1][r-1];t._qmh={row:e,words:0},e.z&&(t.style.setProperty("font-size",e.z+"em",""),t.style.setProperty("line-height",String(1.8/e.z),"")),t.style.setProperty("width",e.w/(e.z||1)+"em",""),t.style.setProperty("margin","0 auto",""),t.style.setProperty("white-space","nowrap",""),"text"!==e.k&&t.style.setProperty("text-align","center",""),e.x&&t.style.setProperty("transform",`scaleX(${e.x})`,"")}function U(a,t,s,i){t._qmh||(t._qmh={row:null,words:0});var o=t._qmh,l=null!==o.row&&"text"===o.row.k;s.t.split(" ").forEach(function(t,e){var r,n;""!==t&&(0<o.words&&(l?((n=document.createElement("span")).className=z+"-space",n.textContent=" ",r=o.row.s[o.words-1],n.style.cssText=0<=r?`display:inline-block;width:${r}em`:`display:inline-block;width:0;margin-left:${r}em`,a.appendChild(n)):a.appendChild(document.createTextNode(" "))),o.words=o.words+1,(r=document.createElement("span")).textContent=t,r.classList.add(z+"-word"),l&&s.f&&s.f[e]&&(r.style.fontFeatureSettings=s.f[e].split(",").map(function(t){t=t.split("=");return`"q${t[0].slice(2)}${Number(t[1]||1).toString(36)}"`}).join(", ")),l&&o.row.c&&t.indexOf("")<0&&(r.style.display="inline-block",r.style.transform=`scaleX(${o.row.c})`,0==(n=o.words-1)?r.style.transformOrigin="right":n===o.row.s.length&&(r.style.transformOrigin="left")),i&&i(r,t),a.appendChild(r))})}function b(t){return t.replace(/ا͏ٔ͏/g,"أ").replace(/إ͏/g,"إ").replace(/و͏ٔ͏/g,"ؤ").replace(/ي͏ٔ͏/g,"ئ").replace(/͏/g,"").replace(/ࣰ/g,"ً").replace(/ࣱ/g,"ٌ").replace(/ࣲ/g,"ٍ")}function ot(t,e){G()||(0<=e?t.style.setProperty("transform",`scaleX(${e*(P.stretch_scale||1)})`,""):t.style.setProperty("text-align","center",""))}function x(t,e,r,n){n&&e>=n[0]&&e<=n[1]?t.classList.add(z+"-word-error"):r&&e>=r[0]&&e<=r[1]&&t.classList.add(z+"-word-highlight")}function lt(r,t,n,a,s,i,e,o){return G()&&e&&o?U(r,o,e,function(t,e){u(e)&&(a+=1),n&&(a<n[0]||a>n[1])&&t.classList.add(z+"-word-hidden"),x(t,a,s,i)}):t.split(/(\s+)/).forEach(function(t){var e;""!==t&&(/^\s+$/.test(t)?r.appendChild(document.createTextNode(t)):((e=document.createElement("span")).textContent=t,e.classList.add(z+"-word"),u(t)&&(a+=1),n&&(a<n[0]||a>n[1])&&e.classList.add(z+"-word-hidden"),x(e,a,s,i),r.appendChild(e)))}),a}function ut(e,r,t,n,a){function s(t){return!t||e+1>=t[0]&&e+r<=t[1]}function i(t){return t&&!s(t)&&e+r>=t[0]&&e+1<=t[1]}return G()||!s(t)||i(n)||i(a)?{ligature:!1}:(t=null,a&&s(a)?t="error":n&&s(n)&&(t="highlight"),{ligature:!0,cls:t})}function C(t,e){for(var r=0;r<t.r.length;r++)if(t.r[r].l===e)return t.r[r];return null}function E(t,e,r){var n,t=P.suras[t].ayas;return e<=0||void 0===(n=t[e-1])||n.p!==t[e].p||null===C(n,r)}function K(t,e,r,n,a){for(var s=P.suras[t].ayas,i=[],o=n+a;0<=o&&o<s.length&&void 0!==s[o]&&s[o].p==e;o+=a){var l=C(s[o],r);if(null===l)break;if(a<0){if(i.unshift(l),E(t,o,r))break}else i.push(l)}return i}function Q(t,e){for(var r=0;r<e.length;r++){var n=document.createElement("div");n.style.cssText="display:inline;visibility:hidden",G()?U(n,t,e[r]):n.textContent=e[r].t,t.appendChild(n)}}function _(){var t=this.parentElement.parentElement,e=t.querySelector("quran-madina-html-header"),r=(e=e?e.textContent.replace(/\s+/g," ").trim():null!=(e=t.getAttribute("sura"))?P.suras[e-1].name:"",(r=(t=(t=t).cloneNode(!0)).querySelector("quran-madina-html-header"))&&r.parentNode.removeChild(r),Array.from(t.querySelectorAll(`.${z}-word-hidden`)).forEach(function(t){t.parentNode.removeChild(t)}),Array.from(t.querySelectorAll("div,span")).forEach(function(t){/visibility:\s*hidden/.test(t.getAttribute("style")||"")&&t.parentNode.removeChild(t)}),t),t=r.querySelectorAll("quran-madina-html-line"),t=t.length?Array.from(t).map(function(t){return t.textContent.replace(/\s+/g," ").trim()}).filter(function(t){return""!==t}).join(" "):r.textContent.replace(/\s+/g," ").trim(),r="“"+(t=G()?b(t):t)+"”\n\n"+e;navigator.clipboard.writeText(r),alert("⎘ تم نسخ:\n\n"+r)}function A(){var t=this.parentElement.parentElement;let e;e=null!=t.getAttribute("sura")&&null!=t.getAttribute("aya")?`https://quran.com/${t.getAttribute("sura")}/`+t.getAttribute("aya"):"https://quran.com/page/"+t.getAttribute("page"),window.open(e,"_blank")}function ct(o,t,e,l,r,n,a,u,c,d){(c||d)&&j(o);var t=function(t,e,r){for(var n=[],a=null,s=0,i=P.suras.length,o=2===e&&0<t?1:e,l=0;l<i;l++){for(var u=(t+l)%i,c=P.suras[u].ayas,d=!1,h=0===l?o:0;h<c.length;h++){var p=X(u,h),f=c[h];if(void 0===f)break;for(var g=0;g<f.r.length;g++){var m,y=f.r[g];""!==y.t&&(m=f.p+":"+y.l,a&&a.key===m||(a={key:m,stretch:y.s,parts:[]},n.push(a)),a.parts.push({sura:u,ayaIdx:h,part:y,countable:p}))}if(p&&(s+=W(f))>=r[1]){d=!0;break}}if(d)break}for(var v=0,w=(n.forEach(function(t){t.parts.forEach(function(t){t.countable&&(v+=F(t.part))}),t.lastWord=v}),0);w<n.length-1&&n[w].lastWord<r[0];)w+=1;for(var b=w;b<n.length-1&&n[b].lastWord<r[1];)b+=1;return{groups:n.slice(w,b+1),counterStart:0<w?n[w-1].lastWord:0}}(t,e,l),s=t.groups,h=D(a,1<s.length),p=t.counterStart;J(),o.innerHTML="",o.removeAttribute("style"),o.classList.toggle(z+"-inline",!h&&!n),h&&(e=parseInt(s[0].key.split(":")[0],10),st(o,e,r),r||o.appendChild(nt(P.suras[s[0].parts[0].sura].name))),s.forEach(function(t,e){var r,i=document.createElement("quran-madina-html-line");h?(i.style.setProperty("display","block",""),G()&&(r=t.key.split(":"),it(i,parseInt(r[0],10),parseInt(r[1],10))),ot(i,t.stretch),E((r=t.parts[0]).sura,r.ayaIdx,r.part.l)||Q(i,K(r.sura,P.suras[r.sura].ayas[r.ayaIdx].p,r.part.l,r.ayaIdx,-1))):(i.style.setProperty("font-family",P.font_family,""),i.style.setProperty("font-size",P.font_size+"px","")),o.appendChild(i),t.parts.forEach(function(t){var e,r,n,a=document.createElement("div"),s=rt(t.sura+1,t.ayaIdx-1);DOMTokenList.prototype.add.apply(a.classList,s),t.countable?(n=0<(e=H(t.sura,t.ayaIdx)?F(t.part):0)?ut(p,e,l,c,d):{ligature:!1}).ligature?((r=document.createElement("span")).classList.add(z+"-word",z+"-basmala"),n.cls&&r.classList.add(z+"-word-"+n.cls),r.textContent=T,a.appendChild(r),p+=e):p=lt(a,t.part.t,l,p,c,d,t.part,i):u&&(0===t.ayaIdx||0===t.sura&&1===t.ayaIdx)?((n=document.createElement("span")).textContent=t.part.t,n.style.visibility="hidden",a.appendChild(n)):a.textContent=t.part.t,a.style.cssText="display:inline",i.appendChild(a),et(s.slice(-1)[0]),at(o,s.slice(-1)[0],t.sura+1,t.ayaIdx-1)}),h&&e===s.length-1&&(r=t.parts[t.parts.length-1],Q(i,K(r.sura,P.suras[r.sura].ayas[r.ayaIdx].p,r.part.l,r.ayaIdx,1)))})}var q,t,c,e=16,r=[6,100],s=document.currentScript||document.querySelector(`script[src*="${z}"]`),k=s.getAttribute("data-name")||"Madina05",L=(s.getAttribute("data-font")||"me_quran").replaceAll(" ","_"),i=parseFloat(s.getAttribute("data-font-size"))||e,d=((i<r[0]||r[1]<i)&&(M(`font-size ${i} outside ${r[0]}..${r[1]}, using `+e),i=e),s.getAttribute("data-layout")||"1441H"),r=(["data-font","data-name"].forEach(function(t){s.hasAttribute(t)&&console.warn(z+`> ${t} is ignored since 2.0: every tag uses the v2 fonts `+'(choose a layout with data-layout="1441H" | "1405H" | "IndoPak")')}),{"1441H":"Madina-1441H","1405H":"Madina-1405H",indopak:"IndoPak-15"}),e=(void 0===r[d]&&(d=void 0!==r[String(d).toLowerCase()]?String(d).toLowerCase():(console.warn(z+`> unknown data-layout "${d}", using 1441H`),"1441H")),s.getAttribute("data-cdn")),e=(e&&(n=e.replace(/\/?$/,"/")),M(`layout: ${d} size: `+i),n+"dist/"+z+".min.css?v=1.1");function $(t){c=n+`assets/db/${k+`-${L}-${i=t}px`}/`}document.getElementById(z)||(q=document.getElementsByTagName("head")[0],(t=document.createElement("link")).id=z,t.rel="stylesheet",t.type="text/css",t.href=e,t.media="all",q.appendChild(t)),$(i);var I,p={};function f(t,e){if(!P.juz)return-1;for(var r=Math.max(e,2),n=0,a=P.juz,s=0;s<a.length&&(a[s][0]<t||a[s][0]===t&&a[s][1]<=r);s++)n=s;return n}function S(t,i){if(P.juz){for(var o,e=[],r=0;r<t.length;r++){var n=t[r];0<=n&&n<P.juz.length&&!p[n]&&e.indexOf(n)<0&&e.push(n)}0===e.length?i():(o=e.length,e.forEach(function(s){var t;a(c+"juz-"+((t=s+1)<10?"0":"")+t+".json",function(t){for(var e=t,r=0;r<e.d.length;r++){var n=e.d[r];P.suras[n[0]].ayas[n[1]]={p:n[2],r:n[3]}}if(e.L&&P.lines)for(var a in e.L)Object.prototype.hasOwnProperty.call(e.L,a)&&(P.lines[a-1]=e.L[a]);p[s]=!0,0==--o&&i()},function(t){console.error(z+"> failed to load juz "+(s+1),t),p[s]=!0,0==--o&&i()})}))}else i()}function dt(t){if(!P.juz)return[];var e,r=[];if(null!=t.getAttribute("sura")&&null!=t.getAttribute("aya")){var n,a=B(t.getAttribute("sura"))[0],s=O(t.getAttribute("aya"));if(null!=t.getAttribute("words"))return[n=f(a,s[0]),(n+1)%P.juz.length];for(e=f(a,s[0]);e<=f(a,s[1]);e++)r.push(e)}else{if(null==t.getAttribute("page"))return[];var i=P.pages[parseInt(t.getAttribute("page"),10)-1];if(!i)return[];for(e=f(i[0],i[1]);e<=f(i[2],i[3]);e++)r.push(e)}return r}function ht(){const t=new FontFace(P.font_family,"url("+encodeURI(null==(e=P.font_url)||/^(https?:)?\/\//.test(e)?e:n+String(e).replace(/^\//,""))+")");var e;t.load().then(()=>{document.fonts.add(t)});class r extends HTMLElement{static get observedAttributes(){return["page","page_param","aya","sura","words","highlight","error","headless","quotes","inline","notitle"]}constructor(){super(),this._data={}}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}get page(){return this.getAttribute("page")}set page(t){this._data.page=t}get page_param(){return this.getAttribute("page_param")}set page_param(t){this._data.page_param=t}get aya(){return this.getAttribute("aya")}set aya(t){this._data.aya=t}get sura(){return this.getAttribute("sura")}set sura(t){this._data.sura=t}get words(){return this.getAttribute("words")}set words(t){this._data.words=t}get highlight(){return this.getAttribute("highlight")}set highlight(t){this._data.highlight=t}get error(){return this.getAttribute("error")}set error(t){this._data.error=t}get headless(){return this.getAttribute("headless")}set headless(t){this._data.headless=t}get quotes(){return this.getAttribute("quotes")}set quotes(t){this._data.quotes=t}get inline(){return this.getAttribute("inline")}set inline(t){this._data.inline=t}get notitle(){return this.getAttribute("notitle")}set notitle(t){this._data.notitle=t}render(t=this){var e;this._data.rendering||S(dt(e=this),function(){if(!e._data.rendering){e._data.rendering=!0;try{e.doRender(t)}finally{e._data.rendering=!1}}})}doRender(e){var r,n,a,s,t=null,i=null!=this.highlight?V(this.highlight):null,o=(null!=this.highlight&&null==i&&M("Bad highlight parameter: "+this.highlight),null!=this.error?V(this.error):null),l=(null!=this.error&&null==o&&M("Bad error parameter: "+this.error),this.page),u=N(this.headless),c=N(this.notitle),d=null!=this.quotes&&!N(this.quotes),h=this.inline,p=null!=this.sura&&null!=this.aya;if(p)y=g=B(this.sura)[0],a=!1,[m,v]=O(this.aya),null!=this.page&&M("Ignoring page parameter!"),l=P.suras[g].ayas[m].p;else{if(null==this.page)return console.error(z+"> Bad arguments: Not rendering!"),1;if(P.pages)var f=P.pages[l-1],g=f[0],m=f[1],y=f[2],v=f[3];else{for(v=m=y=g=0;P.suras[g].ayas.slice(-1)[0].p<l;)g+=1;for(y=g;y<114&&P.suras[y].ayas[0].p<=l;)y+=1;for(y-=1;P.suras[g].ayas[m].p<l;)m+=1;for(v=P.suras[y].ayas.length-1;P.suras[y].ayas[v].p>l;)v-=1}a=!0,null!=this.inline&&M("Ignoring inline parameter with page!")}if(null!=this.words)if(p){if(null!=(t=V(this.words)))return v!==m&&M("Ignoring aya range end with words parameter!"),500<t[1]-t[0]+1&&(M("words selection capped at 500 words"),t[1]=t[0]+499),void ct(e,g,m,t,u,d,h,c,i=R("highlight",i,t),o=R("error",o,t));M("Bad words parameter: "+this.words)}else M("Ignoring words parameter with page!");if(p&&Y(P.suras[y].ayas[v])!=l)s=2===m&&0<g?W(P.suras[g].ayas[1]):0,i=(f=function(t){return null==t?null:[t[0]+s,t[1]+s]})(R("highlight",i,[1,c=Z(g,m,v)])),o=f(R("error",o,[1,c])),ct(e,g,m,[s+1,s+c],u,d,h,!1,i,o);else{var t=p?Z(g,m,v):tt(g,m,y,v,parseInt(l,10)),w=(i=R("highlight",i,[1,t]),o=R("error",o,[1,t]),null!=i||null!=o),b=(w&&j(e),J(),e.innerHTML="",e.removeAttribute("style"),a=D(h,a=(r=P.suras[g].ayas[m].r[0].l)!=(n=P.suras[y].ayas[v].r.slice(-1)[0].l)?!0:a),e.classList.toggle(z+"-inline",!a&&!d),a&&(st(e,l,u),u||e.appendChild(nt(P.suras[g].name))),m),x=g,C=0;for(let t=r;t<=n;t++){const S=t;var E=document.createElement("quran-madina-html-line"),_=(e.appendChild(E),a?(E.style.setProperty("display","block",""),G()&&it(E,parseInt(l,10),t)):(E.style.setProperty("font-family",P.font_family,""),E.style.setProperty("font-size",P.font_size+"px","")),a&&p&&t===r&&Q(E,K(g,l,r,m,-1)),g==y?v:P.suras[x].ayas.length-1);for(let t=b;t<=Math.min(b+5,_);t++){var A,q,k,L,$,I=P.suras[x].ayas[t];void 0!==I&&I.p==l&&(I=I.r.filter(t=>t.l==S)).length&&(a&&ot(E,I[0].s),A=document.createElement("div"),q=rt(x+1,t-1),DOMTokenList.prototype.add.apply(A.classList,q),w&&X(x,t)?($=0<(k=H(x,t)?F(I[0]):0)?ut(C,k,null,i,o):{ligature:!1}).ligature?((L=document.createElement("span")).classList.add(z+"-word",z+"-basmala"),$.cls&&L.classList.add(z+"-word-"+$.cls),L.textContent=T,A.appendChild(L),C+=k):C=lt(A,I[0].t,null,C,i,o,I[0],E):G()&&X(x,t)?U(A,E,I[0]):A.textContent=!G()&&H(x,t)&&""!==I[0].t?T:I[0].t,A.style.cssText="display:inline",E.appendChild(A),et(q.slice(-1)[0]),at(e,q.slice(-1)[0],x+1,t-1),b=t,$=x<113?P.suras[x+1].ayas[0]:void 0,_<=b)&&void 0!==$&&$.p==l&&$.r[0].l==S+1&&(x+=1,b=0)}a&&p&&t===n&&Q(E,K(y,l,n,v,1))}}}}customElements.define(z,r)}function pt(){P.font_size=i,P.line_width_em=P.line_width,P.line_width=P.line_width*i,ht()}a((c=n+`assets/db/v2/${I=r[d]||"Madina-"+d}/`)+"manifest.json",function(e){if(e.content_hash){var t="quran-madina-html:hash:"+c,r=null;try{r=sessionStorage.getItem(t)}catch(t){}null!==r&&r!==e.content_hash&&m(c);try{sessionStorage.setItem(t,e.content_hash)}catch(t){}}P={},Object.keys(e).forEach(function(t){"suras"!==t&&"n_pages"!==t&&(P[t]=e[t])}),P.suras=e.suras.map(function(t){return{name:t[0],ayas:new Array(t[1])}}),P.lines=new Array(e.n_pages),pt()},function(){c=null,a(n+`assets/db/v2/${I}.json`,function(t){P=t,pt()},function(t){console.error(z+"> no v2 DB for layout "+d,t)})},!0)}();
|
|
1
|
+
/*! quran-madina-html 17-10-2026 */
|
|
2
|
+
!function(){var z="quran-madina-html",n=/localhost/.test(document.location.hostname)?"../":`https://www.unpkg.com/${z}/`,P={content:"Loading .."},g=/[\u0621-\u064A\u0671-\u06D3]/,N="﷽";function j(t,e){return 1===e&&0!==t}var l={};function m(e){try{for(var t=sessionStorage.length-1;0<=t;t--){var r=sessionStorage.key(t);r&&0===r.indexOf("quran-madina-html:"+e)&&sessionStorage.removeItem(r)}}catch(t){}Object.keys(l).forEach(function(t){0===t.indexOf(e)&&delete l[t]})}var o={};function a(s,t,e,r){var i,n=!r&&function(t){if(l[t])return l[t];try{var e=sessionStorage.getItem("quran-madina-html:"+t);if(e)return l[t]=JSON.parse(e)}catch(t){}return null}(s);n?t&&setTimeout(function(){t(n)},0):o[s]?o[s].push({success:t,error:e}):(o[s]=[{success:t,error:e}],(i=new XMLHttpRequest).onreadystatechange=function(){if(i.readyState===XMLHttpRequest.DONE){var t=o[s];if(delete o[s],200===i.status){var e=JSON.parse(i.responseText),r=s,n=e,a=i.responseText;l[r]=n;try{sessionStorage.setItem("quran-madina-html:"+r,a)}catch(t){}t.forEach(function(t){t.success&&t.success(e)})}else t.forEach(function(t){t.error&&t.error(i)})}},i.open("GET",s,!0),i.send())}function T(t){console.log(z+"> "+t)}function H(t){return null!=t&&(""===(t=String(t).trim().toLowerCase())||"true"===t||"1"===t||"yes"===t)}function M(t){var e=(e=(e=getComputedStyle(t).color)&&e.match(/[\d.]+/g))?.2126*r(+e[0])+.7152*r(+e[1])+.0722*r(+e[2]):1;function r(t){return(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}t.setAttribute("data-qmh-text-scheme",.5<e?"dark":"light")}function B(t){return Array(2).fill(t.split("-")[0]-1)}function O(t){return 2==t.split("-").length?t.split("-").map(t=>parseInt(t)+1):Array(2).fill(parseInt(t.split("-")[0])+1)}function D(t){return null==t||2!=(t=1==(t=t.split(/[-:]/).map(t=>parseInt(t,10))).length?[t[0],t[0]]:t).length||isNaN(t[0])||isNaN(t[1])||t[0]<1||t[1]<t[0]?null:t}function F(t,e,r){return null==e?null:e[0]<r[0]||e[1]>r[1]?(T(`${t} range ${e[0]}-${e[1]} outside displayed words ${r[0]}-${r[1]}, ignoring`),null):e}function V(t,e){if(null!=t&&"auto"!==t){if("no"===t)return!0;T("yes"===t?'inline="yes" is not implemented yet; falling back to "auto"':"Bad inline parameter: "+t)}return e}function u(t){return g.test(t)}function R(t,e){return(0===t?2:1)<=e}function X(t){var e=0;return t.t.split(/\s+/).forEach(function(t){u(t)&&(e+=1)}),e}function W(t){var e=0;return t.r.forEach(function(t){e+=X(t)}),e}function Y(t){for(var e=t.p,r=null,n=0;n<t.r.length;n++)null!==r&&t.r[n].l<r&&(e+=1),r=t.r[n].l;return e}function Z(t,e,r){for(var n=P.suras[t].ayas,a=0,s=e;s<=r;s++)R(t,s)&&(a+=W(n[s]));return a}function tt(t,e,r,n,a){for(var s=0,i=t;i<=r;i++)for(var l=P.suras[i].ayas,o=i===r?n:l.length-1,u=i===t?e:0;u<=o;u++){var c=l[u];void 0!==c&&c.p===a&&R(i,u)&&(s+=W(c))}return s}function et(t,e="class",n=null,a="transparent"){var s="tag"===e.toLowerCase()?document.getElementsByTagName(t):document.getElementsByClassName(t);Array.from(s).forEach(function(r){r.onmouseover=function(){var t,e=n||(t=r,getComputedStyle(t).getPropertyValue("--qmh-hover").trim())||`rgba(${(getComputedStyle(t).color.match(/[\d.]+/g)||[128,128,128]).slice(0,3).join(",")},0.12)`;Array.from(s).forEach(function(t){t.style.backgroundColor=e})},r.onmouseout=function(){Array.from(s).forEach(function(t){t.style.backgroundColor=a})}})}function rt(t,e){var r=(t,e)=>String(t).padStart(e,"0"),r=[z+"-part",`${z}-${r(t,3)}-`+r(e,3)];return(-1==e||1==t&&0==e)&&r.push("quran-madina-html-sura-start"),r}function y(){var t=document.createElement("div");return t.innerHTML='<svg viewBox="0 0 24 24" class="quran-madina-html-icon" width="20px"><path d="M16.02 20.96H3.78c-.41 0-.75-.34-.75-.75V7.74c0-.41.34-.75.75-.75h7.87c.21 0 .39.08.53.22l4.37 4.37c.14.14.22.32.22.53v8.11c0 .4-.34.74-.75.74ZM4.53 19.47h10.75v-6.61h-3.62c-.41 0-.75-.34-.75-.75V8.48H4.53v10.99Z"></path><path d="m20.74 7.63-4.37-4.37c-.14-.14-.36-.2-.53-.22H8.01c-.41 0-.75.34-.75.75V5.5h1.49v-.97h6.34v3.62c0 .41.34.75.75.75h3.62v8.19h-1.2v1.49h1.95c.41 0 .75-.34.75-.75V8.16c0-.21-.08-.4-.22-.53Z"></path></svg>'.trim(),t.firstChild}function v(){var t=document.createElement("div");return t.innerHTML='<svg class="quran-madina-html-icon" viewBox="0 0 820 615" style="height:20px"><path d="M70 1.9C37.6 8.8 12.6 33.4 3.4 67.5c-1.8 6.6-1.9 11.9-1.9 98v91l2.3 8c5.1 17.8 17 36.4 29.9 46.7 10.8 8.6 25.4 15.4 38.1 17.8 3.1.6 15.2 1 26.8 1 17.7 0 21.3.2 21.7 1.4.4.9.6 17.1.7 36.1 0 32.4.2 34.9 2 38.5 6.4 12.5 21.4 17.4 33.3 10.8 2.3-1.3 7.5-6.4 12.1-11.9l63-74.1c.6-.4 16.3-.8 34.9-.8H300l-.2-18.3-.3-18.2-42.8.1-43.1.5c-.2.2-12.7 15.1-27.9 33.1-15.1 18-27.8 32.4-28.1 32.1-.3-.4-.6-15.3-.6-33.2v-32.6l-38.8-.1c-42.1-.2-43.9-.4-54.3-6-6.5-3.6-16.9-14.6-20.2-21.5-5.8-11.9-5.7-10-5.7-100.7 0-92-.2-89.4 6.3-101.7 3.9-7.3 13.5-17.1 20.3-20.7C76 36.7 66.1 37 244.5 37L412 38.1c18 4.1 33.5 20.5 37.5 39.6 2.2 10.2 2.1 164.6 0 174.8-3.9 18.3-16.4 32.7-33.5 38.5-3.2 1.1-7.8 2-10 2-3.1 0-4 .4-4 1.7 0 1-.2 8.8-.3 17.3-.2 8.5-.2 16.2 0 17 .9 3.3 21.7-.5 34.1-6 13.7-6.3 27.5-17.9 36.2-30.5 5-7.2 10.8-20.4 13.2-30.1l2.3-8.9V165 76.5l-2.3-9c-8.1-31.4-30.5-54.9-61.7-64.8l-7-2.2-169-.2C87.7.1 78 .2 70 1.9zm277.294 102.559q19.5-.5 28.25 24.5 2.5 7.25-3.75 19.75-5.75 11.75-9.75 16-19.5 21.5-67 25.25-27.75 2.25-50.25-2.25-5.25 38.25-16.5 50-26 26.75-66 29.5-27.75 2-42.5-11-20.25-17.75-16.5-48.5 3-23.75 14.25-42.5 2.75-4.5 4.75-7.5 2-3 3-4.25 2.25-2.75 4.75-1.25 2.75 1.5 0 6.25-12.75 24.5-10 45 4 30.5 44.5 30.5 30.25 0 53.25-15.5 12.5-8.25 14.75-14.25-2.25-20.75-13.75-35.75-3.5-4.25-1.75-8l9.5-23.5q3-7.5 8.25 1.25l8.75 14.75q7.75 4.25 28.25 5 16.75-19.25 39.25-36.25 22.5-16.75 36.25-17.25zm11.5 40.5q-12.5-9.5-31.75-5.75-19 3.75-41.25 19.5 50.75.5 73-13.75zm-71.5-89.75q1.5-2 4.25-1.25 5 1.75 9.5 4.5 4.75 2.75 8.75 6.25 2 2 .75 4.5l-12 19q-1.75 2.5-4.5.5-2.5-2-18-11.25-2.75-1.75-1-4.25zm278.784 232.623c-4.7.4-4.7.4-6.7 6.1-1.2 3.1-9.3 25.9-18 50.7l-36.6 102.7-3.5 9.8h17.9 17.8l5.7-17 5.7-17h31.7 31.8l5.6 17.2 5.6 17.3 17.9-.3 18-.3-6-17.2-15-43.2-13.3-38.5-14.1-41-9.9-28.7c-.3-.6-30.2-1.1-34.6-.6zm35.7 106c-.2.2-10 .2-21.9.1l-21.5-.3 9.8-29.5 11-32.5c1.2-2.9 1.8-1.4 12.1 29.4l10.5 32.8zm148.8 139.609c32.4-6.9 57.4-31.5 66.6-65.6 1.8-6.6 1.9-11.9 1.9-98v-91l-2.3-8c-5.1-17.8-17-36.4-29.9-46.7-10.8-8.6-25.4-15.4-38.1-17.8-3.1-.6-15.2-1-26.8-1-17.7 0-21.3-.2-21.7-1.4-.4-.9-.6-17.1-.7-36.1 0-32.4-.2-34.9-2-38.5-6.4-12.5-21.4-17.4-33.3-10.8-2.3 1.3-7.5 6.4-12.1 11.9l-63 74.1c-.6.4-16.3.8-34.9.8h-33.7l.2 18.3.3 18.2 42.8-.1 43.1-.5c.2-.2 12.7-15.1 27.9-33.1 15.1-18 27.8-32.4 28.1-32.1.3.4.6 15.3.6 33.2v32.6l38.8.1c42.1.2 43.9.4 54.3 6 6.5 3.6 16.9 14.6 20.2 21.5 5.8 11.9 5.7 10 5.7 100.7 0 92 .2 89.4-6.3 101.7-3.9 7.3-13.5 17.1-20.3 20.7-11.4 6.1-1.5 5.8-179.9 5.8-108.2 0-164.5-.4-167.5-1.1-18-4.1-33.5-20.5-37.5-39.6-2.2-10.2-2.1-164.6 0-174.8 3.9-18.3 16.4-32.7 33.5-38.5 3.2-1.1 7.8-2 10-2 3.1 0 4-.4 4-1.7 0-1 .2-8.8.3-17.3.2-8.5.2-16.2 0-17-.9-3.3-21.7.5-34.1 6-13.7 6.3-27.5 17.9-36.2 30.5-5 7.2-10.8 20.4-13.2 30.1l-2.3 8.9v88.5 88.5l2.3 9c8.1 31.4 30.5 54.9 61.7 64.8l7 2.2 169 .2 177.5-1.6z"/></svg>'.trim(),t.firstChild}function nt(t){var e=document.createElement("quran-madina-html-header"),t=(e.innerHTML=t,y()),r=(t.addEventListener("click",I),v());return r.addEventListener("click",$),e.appendChild(t),e.appendChild(r),e}var h=null;function J(){h&&(h.popup.classList.remove(z+"-open"),document.removeEventListener("click",h.outsideClick),document.removeEventListener("keydown",h.onEscape),h=null)}function w(e,t,r,n,a){J();function s(t){u.contains(t.target)||J()}function i(t){"Escape"===t.key&&J()}l=e,(o=document.querySelector(`body > ${z}-aya-popup`))||((o=document.createElement(z+"-aya-popup")).appendChild(y()),o.appendChild(v()),document.body.appendChild(o)),["--qmh-header","--qmh-background"].forEach(function(t){o.style.setProperty(t,getComputedStyle(l).getPropertyValue(t))});var l,o,u=o,c=u.children[0],d=u.children[1];c.onclick=function(t){t.stopPropagation();t="“"+(t=e,t=Array.from(t.getElementsByClassName(r)).map(function(t){return t.textContent}).join(" ").replace(/\s+/g," ").trim(),G()?b(t):t)+"”\n\n"+P.suras[n-1].name;navigator.clipboard.writeText(t),alert("⎘ تم نسخ:\n\n"+t),J()},d.onclick=function(t){t.stopPropagation(),window.open(`https://quran.com/${n}/`+a,"_blank"),J()},c=u,d=(d=t).getBoundingClientRect(),c.style.left=Math.max(4,d.left)+"px",c.style.top=(0<d.top-34-6?d.top-34-6:d.bottom+6)+"px",u.classList.add(z+"-open");document.addEventListener("click",s),document.addEventListener("keydown",i),h={popup:u,outsideClick:s,onEscape:i}}function at(r,n,a,s){s<1||Array.from(r.getElementsByClassName(n)).forEach(function(e){e.style.cursor="pointer",e.onclick=function(t){t.stopPropagation(),w(r,e,n,a,s)}})}function st(t,e,r){t.style="display:block;",t.style.setProperty("font-family",P.font_family,""),t.style.setProperty("font-size",P.font_size+"px",""),"me_quran"===P.font_family&&t.style.setProperty("line-height",2*P.font_size+"px",""),G()&&t.style.setProperty("line-height","1.8",""),t.style.width=P.line_width+10+"px",r||t.style.setProperty("box-shadow","inset "+(e%2==1?"":"-")+"8px 0 7px -7px #333","")}function G(){return 2===P.version}function it(t,e,r){e=P.lines[e-1][r-1];t._qmh={row:e,words:0},e.z&&(t.style.setProperty("font-size",e.z+"em",""),t.style.setProperty("line-height",String(1.8/e.z),"")),t.style.setProperty("width",e.w/(e.z||1)+"em",""),t.style.setProperty("margin","0 auto",""),t.style.setProperty("white-space","nowrap",""),"text"!==e.k&&t.style.setProperty("text-align","center",""),e.x&&t.style.setProperty("transform",`scaleX(${e.x})`,"")}function U(a,t,s,i){t._qmh||(t._qmh={row:null,words:0});var l=t._qmh,o=null!==l.row&&"text"===l.row.k;s.t.split(" ").forEach(function(t,e){var r,n;""!==t&&(0<l.words&&(o?((n=document.createElement("span")).className=z+"-space",n.textContent=" ",r=l.row.s[l.words-1],n.style.cssText=0<=r?`display:inline-block;width:${r}em`:`display:inline-block;width:0;margin-left:${r}em`,a.appendChild(n)):a.appendChild(document.createTextNode(" "))),l.words=l.words+1,(r=document.createElement("span")).textContent=t,r.classList.add(z+"-word"),o&&s.f&&s.f[e]&&(r.style.fontFeatureSettings=s.f[e].split(",").map(function(t){t=t.split("=");return`"q${t[0].slice(2)}${Number(t[1]||1).toString(36)}"`}).join(", ")),o&&l.row.c&&t.indexOf("")<0&&(r.style.display="inline-block",r.style.transform=`scaleX(${l.row.c})`,0==(n=l.words-1)?r.style.transformOrigin="right":n===l.row.s.length&&(r.style.transformOrigin="left")),i&&i(r,t),a.appendChild(r))})}function b(t){return t.replace(/ا͏ٔ͏/g,"أ").replace(/إ͏/g,"إ").replace(/و͏ٔ͏/g,"ؤ").replace(/ي͏ٔ͏/g,"ئ").replace(/͏/g,"").replace(/ࣰ/g,"ً").replace(/ࣱ/g,"ٌ").replace(/ࣲ/g,"ٍ")}function lt(t,e){G()||(0<=e?t.style.setProperty("transform",`scaleX(${e*(P.stretch_scale||1)})`,""):t.style.setProperty("text-align","center",""))}function E(t,e,r,n){n&&e>=n[0]&&e<=n[1]?t.classList.add(z+"-word-error"):r&&e>=r[0]&&e<=r[1]&&t.classList.add(z+"-word-highlight")}function ot(r,t,n,a,s,i,e,l){return G()&&e&&l?U(r,l,e,function(t,e){u(e)&&(a+=1,t.setAttribute("data-qmh-w",a)),n&&(a<n[0]||a>n[1])&&t.classList.add(z+"-word-hidden"),E(t,a,s,i)}):t.split(/(\s+)/).forEach(function(t){var e;""!==t&&(/^\s+$/.test(t)?r.appendChild(document.createTextNode(t)):((e=document.createElement("span")).textContent=t,e.classList.add(z+"-word"),u(t)&&(a+=1,e.setAttribute("data-qmh-w",a)),n&&(a<n[0]||a>n[1])&&e.classList.add(z+"-word-hidden"),E(e,a,s,i),r.appendChild(e)))}),a}var C={crimson:"#a3263a",emerald:"#0f6b4f",lapis:"#1f4fb0",gold:"#8a5a00",violet:"#5b2aa8"};function x(t){var n;return null!=t&&(n=[],String(t).split(",").forEach(function(t){var a,e,r,t=t.trim().match(/^(\d+)\s*:\s*([\d+\-\s]*\d)\s*(\S.*)?$/);t&&(a=[],t[2].replace(/\s+/g,"").split("+").forEach(function(t){t=t.match(/^(\d+)(?:-(\d+))?$/);if(t)for(var e=parseInt(t[1],10),r=t[2]?parseInt(t[2],10):e,n=e;n<=r&&n-e<50;n++)1<=n&&a.push(n)}),a.length)&&(e=!1,(r=t[3]?t[3].trim().split(/\s+/):[]).length&&"blink"===r[r.length-1].toLowerCase()&&(e=!0,r.pop()),(r=r.length?r.join(" "):null)&&C[r.toLowerCase()]&&(r=C[r.toLowerCase()]),n.push({word:parseInt(t[1],10),letters:a,color:r,blink:e}))}),n.length)?n:null}var q=/[\u0300-\u036F\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E8\u06EA-\u06ED\u08D3-\u08FF\u200C\u200D\u0640]/;function A(t){var e=document.createElement("span");return e.className=z+"-ink",e.textContent=t,e}function _(e,r){var n=e.textContent,a=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];q.test(n)||e.push(r)}return e.push(t.length),e}(n),s=[],i=0,l=!1;return Object.keys(r).map(Number).filter(function(t){return t<a.length}).sort(function(t,e){return t-e}).forEach(function(t){a[t-1]>i&&s.push(A(n.slice(i,a[t-1])));var e=document.createElement("span");e.className=z+"-letter",r[t].color&&e.style.setProperty("--qmh-letter",r[t].color),r[t].blink&&e.classList.add(z+"-letter-blink"),e.textContent=n.slice(a[t-1],a[t]),s.push(e),i=a[t],l=!0}),l&&(i<n.length&&s.push(A(n.slice(i))),e.textContent="",s.forEach(function(t){e.appendChild(t)}),e.classList.add(z+"-word-lettered"),1)}function k(t,e,r){var n,a,s;t.classList.remove(z+"-lettered"),e&&(M(t),n={},a={},t.querySelectorAll(`.${z}-word[data-qmh-w]`).forEach(function(t){n[t.getAttribute("data-qmh-w")]=t}),e.forEach(function(e){var r=a[e.word]=a[e.word]||{};e.letters.forEach(function(t){r[t]={color:e.color,blink:e.blink}})}),s=[],Object.keys(a).forEach(function(t){var e=n[parseInt(t,10)+(r||0)];e&&_(e,a[t])||s.push(t)}),s.length&&T("letters: no such word/letter for word(s) "+s.join(", ")),t.classList.add(z+"-lettered"))}function ut(e,r,t,n,a){function s(t){return!t||e+1>=t[0]&&e+r<=t[1]}function i(t){return t&&!s(t)&&e+r>=t[0]&&e+1<=t[1]}return G()||!s(t)||i(n)||i(a)?{ligature:!1}:(t=null,a&&s(a)?t="error":n&&s(n)&&(t="highlight"),{ligature:!0,cls:t})}function L(t,e){for(var r=0;r<t.r.length;r++)if(t.r[r].l===e)return t.r[r];return null}function S(t,e,r){var n,t=P.suras[t].ayas;return e<=0||void 0===(n=t[e-1])||n.p!==t[e].p||null===L(n,r)}function K(t,e,r,n,a){for(var s=P.suras[t].ayas,i=[],l=n+a;0<=l&&l<s.length&&void 0!==s[l]&&s[l].p==e;l+=a){var o=L(s[l],r);if(null===o)break;if(a<0){if(i.unshift(o),S(t,l,r))break}else i.push(o)}return i}function Q(t,e){for(var r=0;r<e.length;r++){var n=document.createElement("div");n.style.cssText="display:inline;visibility:hidden",G()?U(n,t,e[r]):n.textContent=e[r].t,t.appendChild(n)}}function I(){var t=this.parentElement.parentElement,e=t.querySelector("quran-madina-html-header"),r=(e=e?e.textContent.replace(/\s+/g," ").trim():null!=(e=t.getAttribute("sura"))?P.suras[e-1].name:"",(r=(t=(t=t).cloneNode(!0)).querySelector("quran-madina-html-header"))&&r.parentNode.removeChild(r),Array.from(t.querySelectorAll(`.${z}-word-hidden`)).forEach(function(t){t.parentNode.removeChild(t)}),Array.from(t.querySelectorAll("div,span")).forEach(function(t){/visibility:\s*hidden/.test(t.getAttribute("style")||"")&&t.parentNode.removeChild(t)}),t),t=r.querySelectorAll("quran-madina-html-line"),t=t.length?Array.from(t).map(function(t){return t.textContent.replace(/\s+/g," ").trim()}).filter(function(t){return""!==t}).join(" "):r.textContent.replace(/\s+/g," ").trim(),r="“"+(t=G()?b(t):t)+"”\n\n"+e;navigator.clipboard.writeText(r),alert("⎘ تم نسخ:\n\n"+r)}function $(){var t=this.parentElement.parentElement;let e;e=null!=t.getAttribute("sura")&&null!=t.getAttribute("aya")?`https://quran.com/${t.getAttribute("sura")}/`+t.getAttribute("aya"):"https://quran.com/page/"+t.getAttribute("page"),window.open(e,"_blank")}function ct(l,t,e,o,r,n,a,u,c,d){(c||d)&&M(l);var t=function(t,e,r){for(var n=[],a=null,s=0,i=P.suras.length,l=2===e&&0<t?1:e,o=0;o<i;o++){for(var u=(t+o)%i,c=P.suras[u].ayas,d=!1,h=0===o?l:0;h<c.length;h++){var p=R(u,h),f=c[h];if(void 0===f)break;for(var g=0;g<f.r.length;g++){var m,y=f.r[g];""!==y.t&&(m=f.p+":"+y.l,a&&a.key===m||(a={key:m,stretch:y.s,parts:[]},n.push(a)),a.parts.push({sura:u,ayaIdx:h,part:y,countable:p}))}if(p&&(s+=W(f))>=r[1]){d=!0;break}}if(d)break}for(var v=0,w=(n.forEach(function(t){t.parts.forEach(function(t){t.countable&&(v+=X(t.part))}),t.lastWord=v}),0);w<n.length-1&&n[w].lastWord<r[0];)w+=1;for(var b=w;b<n.length-1&&n[b].lastWord<r[1];)b+=1;return{groups:n.slice(w,b+1),counterStart:0<w?n[w-1].lastWord:0}}(t,e,o),s=t.groups,h=V(a,1<s.length),p=t.counterStart;J(),l.innerHTML="",l.removeAttribute("style"),l.classList.toggle(z+"-inline",!h&&!n),h&&(e=parseInt(s[0].key.split(":")[0],10),st(l,e,r),r||l.appendChild(nt(P.suras[s[0].parts[0].sura].name))),s.forEach(function(t,e){var r,i=document.createElement("quran-madina-html-line");h?(i.style.setProperty("display","block",""),G()&&(r=t.key.split(":"),it(i,parseInt(r[0],10),parseInt(r[1],10))),lt(i,t.stretch),S((r=t.parts[0]).sura,r.ayaIdx,r.part.l)||Q(i,K(r.sura,P.suras[r.sura].ayas[r.ayaIdx].p,r.part.l,r.ayaIdx,-1))):(i.style.setProperty("font-family",P.font_family,""),i.style.setProperty("font-size",P.font_size+"px","")),l.appendChild(i),t.parts.forEach(function(t){var e,r,n,a=document.createElement("div"),s=rt(t.sura+1,t.ayaIdx-1);DOMTokenList.prototype.add.apply(a.classList,s),t.countable?(n=0<(e=j(t.sura,t.ayaIdx)?X(t.part):0)?ut(p,e,o,c,d):{ligature:!1}).ligature?((r=document.createElement("span")).classList.add(z+"-word",z+"-basmala"),n.cls&&r.classList.add(z+"-word-"+n.cls),r.textContent=N,a.appendChild(r),p+=e):p=ot(a,t.part.t,o,p,c,d,t.part,i):u&&(0===t.ayaIdx||0===t.sura&&1===t.ayaIdx)?((n=document.createElement("span")).textContent=t.part.t,n.style.visibility="hidden",a.appendChild(n)):a.textContent=t.part.t,a.style.cssText="display:inline",i.appendChild(a),et(s.slice(-1)[0]),at(l,s.slice(-1)[0],t.sura+1,t.ayaIdx-1)}),h&&e===s.length-1&&(r=t.parts[t.parts.length-1],Q(i,K(r.sura,P.suras[r.sura].ayas[r.ayaIdx].p,r.part.l,r.ayaIdx,1)))})}var dt,t,c,e=16,r=[6,100],s=document.currentScript||document.querySelector(`script[src*="${z}"]`),ht=s.getAttribute("data-name")||"Madina05",pt=(s.getAttribute("data-font")||"me_quran").replaceAll(" ","_"),i=parseFloat(s.getAttribute("data-font-size"))||e,d=((i<r[0]||r[1]<i)&&(T(`font-size ${i} outside ${r[0]}..${r[1]}, using `+e),i=e),s.getAttribute("data-layout")||"1441H"),r=(["data-font","data-name"].forEach(function(t){s.hasAttribute(t)&&console.warn(z+`> ${t} is ignored since 2.0: every tag uses the v2 fonts `+'(choose a layout with data-layout="1441H" | "1405H" | "IndoPak")')}),{"1441H":"Madina-1441H","1405H":"Madina-1405H",indopak:"IndoPak-15"}),e=(void 0===r[d]&&(d=void 0!==r[String(d).toLowerCase()]?String(d).toLowerCase():(console.warn(z+`> unknown data-layout "${d}", using 1441H`),"1441H")),s.getAttribute("data-cdn")),e=(e&&(n=e.replace(/\/?$/,"/")),T(`layout: ${d} size: `+i),n+"dist/"+z+".min.css?v=1.1");function ft(t){c=n+`assets/db/${ht+`-${pt}-${i=t}px`}/`}document.getElementById(z)||(dt=document.getElementsByTagName("head")[0],(t=document.createElement("link")).id=z,t.rel="stylesheet",t.type="text/css",t.href=e,t.media="all",dt.appendChild(t)),ft(i);var gt,p={};function f(t,e){if(!P.juz)return-1;for(var r=Math.max(e,2),n=0,a=P.juz,s=0;s<a.length&&(a[s][0]<t||a[s][0]===t&&a[s][1]<=r);s++)n=s;return n}function mt(t,i){if(P.juz){for(var l,e=[],r=0;r<t.length;r++){var n=t[r];0<=n&&n<P.juz.length&&!p[n]&&e.indexOf(n)<0&&e.push(n)}0===e.length?i():(l=e.length,e.forEach(function(s){var t;a(c+"juz-"+((t=s+1)<10?"0":"")+t+".json",function(t){for(var e=t,r=0;r<e.d.length;r++){var n=e.d[r];P.suras[n[0]].ayas[n[1]]={p:n[2],r:n[3]}}if(e.L&&P.lines)for(var a in e.L)Object.prototype.hasOwnProperty.call(e.L,a)&&(P.lines[a-1]=e.L[a]);p[s]=!0,0==--l&&i()},function(t){console.error(z+"> failed to load juz "+(s+1),t),p[s]=!0,0==--l&&i()})}))}else i()}function yt(t){if(!P.juz)return[];var e,r=[];if(null!=t.getAttribute("sura")&&null!=t.getAttribute("aya")){var n,a=B(t.getAttribute("sura"))[0],s=O(t.getAttribute("aya"));if(null!=t.getAttribute("words"))return[n=f(a,s[0]),(n+1)%P.juz.length];for(e=f(a,s[0]);e<=f(a,s[1]);e++)r.push(e)}else{if(null==t.getAttribute("page"))return[];var i=P.pages[parseInt(t.getAttribute("page"),10)-1];if(!i)return[];for(e=f(i[0],i[1]);e<=f(i[2],i[3]);e++)r.push(e)}return r}function vt(){const t=new FontFace(P.font_family,"url("+encodeURI(null==(e=P.font_url)||/^(https?:)?\/\//.test(e)?e:n+String(e).replace(/^\//,""))+")");var e;t.load().then(()=>{document.fonts.add(t)});class r extends HTMLElement{static get observedAttributes(){return["page","page_param","aya","sura","words","highlight","error","headless","quotes","inline","notitle","letters"]}constructor(){super(),this._data={}}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}get page(){return this.getAttribute("page")}set page(t){this._data.page=t}get page_param(){return this.getAttribute("page_param")}set page_param(t){this._data.page_param=t}get aya(){return this.getAttribute("aya")}set aya(t){this._data.aya=t}get sura(){return this.getAttribute("sura")}set sura(t){this._data.sura=t}get words(){return this.getAttribute("words")}set words(t){this._data.words=t}get highlight(){return this.getAttribute("highlight")}set highlight(t){this._data.highlight=t}get error(){return this.getAttribute("error")}set error(t){this._data.error=t}get letters(){return this.getAttribute("letters")}set letters(t){this._data.letters=t}get headless(){return this.getAttribute("headless")}set headless(t){this._data.headless=t}get quotes(){return this.getAttribute("quotes")}set quotes(t){this._data.quotes=t}get inline(){return this.getAttribute("inline")}set inline(t){this._data.inline=t}get notitle(){return this.getAttribute("notitle")}set notitle(t){this._data.notitle=t}render(e=this){var r;this._data.rendering||mt(yt(r=this),function(){if(!r._data.rendering){r._data.rendering=!0;try{e._qmhLetterShift=0;var t=x(r.letters);null!=r.letters&&null==t&&T("Bad letters parameter: "+r.letters),e._qmhLetters=t,r.doRender(e),k(e,t,e._qmhLetterShift)}finally{r._data.rendering=!1}}})}doRender(e){var r,n,a,s,t=null,i=null!=this.highlight?D(this.highlight):null,l=(null!=this.highlight&&null==i&&T("Bad highlight parameter: "+this.highlight),null!=this.error?D(this.error):null),o=(null!=this.error&&null==l&&T("Bad error parameter: "+this.error),this.page),u=H(this.headless),c=H(this.notitle),d=null!=this.quotes&&!H(this.quotes),h=this.inline,p=null!=this.sura&&null!=this.aya;if(p)y=g=B(this.sura)[0],a=!1,[m,v]=O(this.aya),null!=this.page&&T("Ignoring page parameter!"),o=P.suras[g].ayas[m].p;else{if(null==this.page)return console.error(z+"> Bad arguments: Not rendering!"),1;if(P.pages)var f=P.pages[o-1],g=f[0],m=f[1],y=f[2],v=f[3];else{for(v=m=y=g=0;P.suras[g].ayas.slice(-1)[0].p<o;)g+=1;for(y=g;y<114&&P.suras[y].ayas[0].p<=o;)y+=1;for(y-=1;P.suras[g].ayas[m].p<o;)m+=1;for(v=P.suras[y].ayas.length-1;P.suras[y].ayas[v].p>o;)v-=1}a=!0,null!=this.inline&&T("Ignoring inline parameter with page!")}if(null!=this.words)if(p){if(null!=(t=D(this.words)))return v!==m&&T("Ignoring aya range end with words parameter!"),500<t[1]-t[0]+1&&(T("words selection capped at 500 words"),t[1]=t[0]+499),void ct(e,g,m,t,u,d,h,c,i=F("highlight",i,t),l=F("error",l,t));T("Bad words parameter: "+this.words)}else T("Ignoring words parameter with page!");if(p&&Y(P.suras[y].ayas[v])!=o)s=2===m&&0<g?W(P.suras[g].ayas[1]):0,f=Z(g,m,v),c=function(t){return null==t?null:[t[0]+s,t[1]+s]},e._qmhLetterShift=s,i=c(F("highlight",i,[1,f])),l=c(F("error",l,[1,f])),ct(e,g,m,[s+1,s+f],u,d,h,!1,i,l);else{var t=p?Z(g,m,v):tt(g,m,y,v,parseInt(o,10)),i=F("highlight",i,[1,t]),l=F("error",l,[1,t]),w=null!=i||null!=l||null!=e._qmhLetters,b=(w&&M(e),J(),e.innerHTML="",e.removeAttribute("style"),a=V(h,a=(r=P.suras[g].ayas[m].r[0].l)!=(n=P.suras[y].ayas[v].r.slice(-1)[0].l)?!0:a),e.classList.toggle(z+"-inline",!a&&!d),a&&(st(e,o,u),u||e.appendChild(nt(P.suras[g].name))),m),E=g,C=0;for(let t=r;t<=n;t++){const $=t;var x=document.createElement("quran-madina-html-line"),q=(e.appendChild(x),a?(x.style.setProperty("display","block",""),G()&&it(x,parseInt(o,10),t)):(x.style.setProperty("font-family",P.font_family,""),x.style.setProperty("font-size",P.font_size+"px","")),a&&p&&t===r&&Q(x,K(g,o,r,m,-1)),g==y?v:P.suras[E].ayas.length-1);for(let t=b;t<=Math.min(b+5,q);t++){var A,_,k,L,S,I=P.suras[E].ayas[t];void 0!==I&&I.p==o&&(I=I.r.filter(t=>t.l==$)).length&&(a&<(x,I[0].s),A=document.createElement("div"),_=rt(E+1,t-1),DOMTokenList.prototype.add.apply(A.classList,_),w&&R(E,t)?(S=0<(k=j(E,t)?X(I[0]):0)?ut(C,k,null,i,l):{ligature:!1}).ligature?((L=document.createElement("span")).classList.add(z+"-word",z+"-basmala"),S.cls&&L.classList.add(z+"-word-"+S.cls),L.textContent=N,A.appendChild(L),C+=k):C=ot(A,I[0].t,null,C,i,l,I[0],x):G()&&R(E,t)?U(A,x,I[0]):A.textContent=!G()&&j(E,t)&&""!==I[0].t?N:I[0].t,A.style.cssText="display:inline",x.appendChild(A),et(_.slice(-1)[0]),at(e,_.slice(-1)[0],E+1,t-1),b=t,S=E<113?P.suras[E+1].ayas[0]:void 0,q<=b)&&void 0!==S&&S.p==o&&S.r[0].l==$+1&&(E+=1,b=0)}a&&p&&t===n&&Q(x,K(y,o,n,v,1))}}}}customElements.define(z,r)}function wt(){P.font_size=i,P.line_width_em=P.line_width,P.line_width=P.line_width*i,vt()}a((c=n+`assets/db/v2/${gt=r[d]||"Madina-"+d}/`)+"manifest.json",function(e){if(e.content_hash){var t="quran-madina-html:hash:"+c,r=null;try{r=sessionStorage.getItem(t)}catch(t){}null!==r&&r!==e.content_hash&&m(c);try{sessionStorage.setItem(t,e.content_hash)}catch(t){}}P={},Object.keys(e).forEach(function(t){"suras"!==t&&"n_pages"!==t&&(P[t]=e[t])}),P.suras=e.suras.map(function(t){return{name:t[0],ayas:new Array(t[1])}}),P.lines=new Array(e.n_pages),wt()},function(){c=null,a(n+`assets/db/v2/${gt}.json`,function(t){P=t,wt()},function(t){console.error(z+"> no v2 DB for layout "+d,t)})},!0)}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quran-madina-html",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"grunt": "^1.6.2",
|
|
6
6
|
"grunt-contrib-clean": "^2.0.1",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
],
|
|
55
55
|
"after:bump": [
|
|
56
56
|
"node scripts/sync-wrapper-version.mjs ${version}",
|
|
57
|
-
"git add react/package.json react/package-lock.json"
|
|
57
|
+
"git add react/package.json react/package-lock.json flutter/pubspec.yaml flutter/CHANGELOG.md flutter/lib/src/version.dart"
|
|
58
58
|
],
|
|
59
59
|
"after:release": [
|
|
60
60
|
"node scripts/publish-wrapper.mjs ${version}"
|