al-quran.reflectslight.io/build/al-quran/js/loaders/surah-index-loader.js
2024-09-30 15:53:21 -03:00

1 line
No EOL
2.9 KiB
JavaScript

(()=>{"use strict";const t=(t,e)=>({priority:1,group:"fonts",requestId:"font",href:e,fontFamily:t}),e=(t,e)=>({priority:4,group:"scripts",requestId:"script",href:t,props:e}),r=t=>t,n={font(t){const{fontFamily:e,href:r}=t;return new FontFace(e,r).load()},script(t,e={}){const{href:r}=t;return fetch(r,e).then((t=>t.text())).then((e=>({type:"application/javascript",text:e,...t.props}))).then((t=>Object.assign(document.createElement("script"),t)))},css(t,e={}){const{href:r}=t;return fetch(r,e).then((t=>t.text())).then((t=>({innerText:t}))).then((t=>Object.assign(document.createElement("style"),t)))},image(t){const{href:e}=t;return new Promise(((t,r)=>{const n=document.createElement("img");n.onload=()=>t(n),n.onerror=r,n.src=e}))},json(t,e={}){const{href:r}=t;return fetch(r,e).then((t=>t.text())).then((t=>({type:"application/json",text:t}))).then((e=>Object.assign(e,t.props||{}))).then((t=>Object.assign(document.createElement("script"),t)))}};var o=Object.defineProperty,s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;!function(){const o=document.documentElement,u=o.querySelector("meta[name='revision']").getAttribute("content"),l={name:o.lang,direction:o.dir,displayName:""},f=o.querySelector(".postman.loader"),p=o.querySelector(".css.postman"),m=f.querySelector("progress"),h=f.querySelector(".percentage"),d="rtl"===o.dir?[t("Cairo Regular","url(/fonts/cairo-regular.ttf)"),t("Cairo Bold","url(/fonts/cairo-bold.ttf)")]:[t("Kanit Regular","url(/fonts/kanit-regular.ttf)")];(function(...t){const e=Object.create(null),r={fonts:[],images:[],css:[],scripts:[],json:[]},[o,s]=function(t){const e=[];let r=t=>t;return t.forEach((t=>{"function"==typeof t?r=t:e.push(t)})),[e,r]}(t);o.sort(((t,e)=>t.priority>=e.priority?1:-1));let c=0;const a=t=>(c++,c<=o.length&&s(c/o.length*100),t);return e.fetch=async()=>(await Promise.all((()=>{const t=o.map((t=>{if("fontFamily"in t)return(0,n.font)(t).then((t=>a(t))).then((t=>r.fonts.push(t))).then((()=>r));if("font"!==t.requestId&&"fonts"!==t.group){const e=n[t.requestId],o=r[t.group];return e(t).then((t=>a(t))).then((t=>o.push(t))).then((()=>r))}return null}));return t})()),r),e})(e(`/js/main/vendor.js?v=${u}`,{id:"0"}),e(`/js/main/surah-index.js?v=${u}`,{id:"1"}),...d,r((t=>{m.value=t,h.innerText=function(t,e,r={}){const n="ar"===t.name?"ar-SA":t.name;return new Intl.NumberFormat(n,((t,e)=>{for(var r in e||(e={}))c.call(e,r)&&i(t,r,e[r]);if(s)for(var r of s(e))a.call(e,r)&&i(t,r,e[r]);return t})({maximumFractionDigits:1},r)).format(e)}(l,Number(t.toFixed(0)))}))).fetch().then((t=>{[f,p].forEach((t=>t.remove())),t.fonts.forEach((t=>document.fonts.add(t))),t.css.forEach((t=>document.head.appendChild(t))),t.scripts.sort(((t,e)=>Number(t.id)-Number(e.id))).forEach((t=>{document.body.removeChild(document.body.appendChild(t))}))}))}()})();