qumra-engine 1.0.47 → 1.0.48

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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see bundle.cjs.js.LICENSE.txt */
2
- (()=>{var t={863:(t,r,e)=>{var n=e(93).getGlobal;t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){var r=n("app").currency.currencySymbol,e=t.toLocaleString("ar-EG",{minimumFractionDigits:2,maximumFractionDigits:2});return"".concat(r," ").concat(e)},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,r){return t-t*(r/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,r,e){return 1===t?r:e},truncate:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>r?t.slice(0,r)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,r,e)=>{var n=e(93),o=n.getGlobal,i=n.setGlobal,a=e(985).getLocales,c=e(413);t.exports={set:function(t,r){i(t,r)},get:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||r},t:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=o("lang")||"ar",n=a(e);return n&&c(n,t)||r}}},99:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";o=function(){return r};var t,r={},e=Object.prototype,i=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(t){f=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),c=new P(n||[]);return a(i,"_invoke",{value:_(t,e,c)}),i}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(F([])));E&&E!==e&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function G(t,r){function e(o,a,c,u){var l=p(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return e("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function _(r,e,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=p(r,e,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,k(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=p(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function A(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function C(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function F(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},O(G.prototype),f(G.prototype,l,(function(){return this})),r.AsyncIterator=G,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new G(h(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=F,P.prototype={constructor:P,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),C(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;C(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:F(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var a=e(271),c=e(928),u=e(168),l=e(915),s=e(896),f=e(863),h=e(908),p=e(926),v=e(985).setLocales,y=e(93).setGlobal,g=e(91);t.exports=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var e,n=(e=o().mark((function e(n,i,g){var d,m,b,w,x,L,j,E,S,O,G,_,k,A,C,P,F,N,T,I,U,D,q;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x=r.viewsDirectory,L=c.join(null!=x?x:null==i||null===(d=i.locals)||void 0===d||null===(d=d.app)||void 0===d?void 0:d.themePath,"views"),j=c.join(null!=x?x:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"locales"),E=n.originalUrl,S=n.protocol,!l(E)){e.next=7;break}return g(),e.abrupt("return");case 7:for(G in O=a.configure(L,{autoescape:!0,express:t,watch:r.watch||!1,noCache:r.noCache||!1}),f)O.addFilter(G,f[G]);for(_ in s.existsSync(j)&&s.statSync(j).isDirectory()?s.readdirSync(j).forEach((function(t){if(t.endsWith(".json")){var r=c.basename(t,".json"),e=c.join(j,t);if(s.existsSync(e)){var n=s.readFileSync(e,"utf-8");v(r,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),h)O.addGlobal(_,h[_]);return k=p(E),y("lang",k.language),A="".concat(S,"://").concat(n.get("host")).concat(k.path),console.log("🚀 ~ return ~ fullUrl:",A),C="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(A)),P={"Content-Type":"application/json",secretKey:null!==(b=null==i||null===(w=i.locals)||void 0===w||null===(w=w.app)||void 0===w?void 0:w.secretKey)&&void 0!==b?b:r.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":n.get("User-Agent")||"",Referer:n.get("Referer")||""},F={headers:P},e.next=20,fetch(C,F);case 20:return N=e.sent,(T=N.headers.getSetCookie())&&T.forEach((function(t){var r=u(t);Object.keys(r).forEach((function(t){var e=r[t],n=e.value,o=e.attributes;i.cookie(t,n,o)}))})),e.next=25,N.json();case 25:for(q in I=e.sent,U=I.global,D=I.context,U)Object.hasOwnProperty.call(U,q)&&y(q,U[q]);D.page?i.render(D.page.fileName,{global:U,context:D}):i.render("404",{global:U,context:D});case 29:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,r,e){return n.apply(this,arguments)}}()}},91:(t,r,e)=>{var n=e(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,r,e){o(t,r,(function(){e()}))}},93:t=>{var r={};t.exports={getGlobal:function(t,e){var n;return null!==(n=r[t])&&void 0!==n?n:e},setGlobal:function(t,e){r[t]=e}}},985:t=>{var r={};t.exports={getLocales:function(t){return r[t]},setLocales:function(t,e){r[t]=e}}},168:t=>{function r(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,r)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}t.exports=function(t){var e={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=r(n,1),i=r(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();e[u]||(e[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=r(n[s].split("="),2),h=f[0],p=f[1];h&&(e[u].attributes[h.trim()]=!p||p.trim())}}})),e}},926:t=>{t.exports=function(t){var r={language:"ar",path:null},e=t.match(/^\/([a-z]{2})\/(.*)$/);return e?(r.language=e[1],r.path="/".concat(e[2])):(e=t.match(/^\/([a-z]{2})$/))?(r.language=e[1],r.path="/"):r.path=t,r}},413:t=>{t.exports=function(t,r){return r.split(".").reduce((function(t,r){return t&&t[r]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(r){return t.endsWith(r)}))}},757:t=>{"use strict";t.exports=require("express-fingerprint")},271:t=>{"use strict";t.exports=require("nunjucks")},896:t=>{"use strict";t.exports=require("fs")},928:t=>{"use strict";t.exports=require("path")}},r={},e=function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}(99);module.exports=e})();
2
+ (()=>{var t={863:(t,r,e)=>{var n=e(93).getGlobal,o=e(38);t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){var r=n("app").currency,e=o({amount:100*t,currency:r.currencyCode}).toFormat();return"".concat(r.currencySymbol," ").concat(e)},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,r){return t-t*(r/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,r,e){return 1===t?r:e},truncate:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>r?t.slice(0,r)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,r,e)=>{var n=e(93),o=n.getGlobal,i=n.setGlobal,a=e(985).getLocales,c=e(413);t.exports={set:function(t,r){i(t,r)},get:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||r},t:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=o("lang")||"ar",n=a(e);return n&&c(n,t)||r}}},99:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";o=function(){return r};var t,r={},e=Object.prototype,i=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(t){f=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),c=new P(n||[]);return a(i,"_invoke",{value:_(t,e,c)}),i}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(N([])));E&&E!==e&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function G(t,r){function e(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return e("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function _(r,e,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(r,e,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,k(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function C(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function A(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function N(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},O(G.prototype),f(G.prototype,l,(function(){return this})),r.AsyncIterator=G,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new G(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=N,P.prototype={constructor:P,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),A(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;A(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:N(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var a=e(271),c=e(928),u=e(168),l=e(915),s=e(896),f=e(863),p=e(908),h=e(926),v=e(985).setLocales,y=e(93).setGlobal,g=e(91);t.exports=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var e,n=(e=o().mark((function e(n,i,g){var d,m,b,w,x,L,j,E,S,O,G,_,k,C,A,P,N,F,T,I,U,q,z;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x=r.viewsDirectory,L=c.join(null!=x?x:null==i||null===(d=i.locals)||void 0===d||null===(d=d.app)||void 0===d?void 0:d.themePath,"views"),j=c.join(null!=x?x:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"locales"),E=n.originalUrl,S=n.protocol,!l(E)){e.next=7;break}return g(),e.abrupt("return");case 7:for(G in O=a.configure(L,{autoescape:!0,express:t,watch:r.watch||!1,noCache:r.noCache||!1}),f)O.addFilter(G,f[G]);for(_ in s.existsSync(j)&&s.statSync(j).isDirectory()?s.readdirSync(j).forEach((function(t){if(t.endsWith(".json")){var r=c.basename(t,".json"),e=c.join(j,t);if(s.existsSync(e)){var n=s.readFileSync(e,"utf-8");v(r,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)O.addGlobal(_,p[_]);return k=h(E),y("lang",k.language),C="".concat(S,"://").concat(n.get("host")).concat(k.path),console.log("🚀 ~ return ~ fullUrl:",C),A="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(C)),P={"Content-Type":"application/json",secretKey:null!==(b=null==i||null===(w=i.locals)||void 0===w||null===(w=w.app)||void 0===w?void 0:w.secretKey)&&void 0!==b?b:r.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":n.get("User-Agent")||"",Referer:n.get("Referer")||""},N={headers:P},e.next=20,fetch(A,N);case 20:return F=e.sent,(T=F.headers.getSetCookie())&&T.forEach((function(t){var r=u(t);Object.keys(r).forEach((function(t){var e=r[t],n=e.value,o=e.attributes;i.cookie(t,n,o)}))})),e.next=25,F.json();case 25:for(z in I=e.sent,U=I.global,q=I.context,U)Object.hasOwnProperty.call(U,z)&&y(z,U[z]);q.page?i.render(q.page.fileName,{global:U,context:q}):i.render("404",{global:U,context:q});case 29:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,r,e){return n.apply(this,arguments)}}()}},91:(t,r,e)=>{var n=e(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,r,e){o(t,r,(function(){e()}))}},93:t=>{var r={};t.exports={getGlobal:function(t,e){var n;return null!==(n=r[t])&&void 0!==n?n:e},setGlobal:function(t,e){r[t]=e}}},985:t=>{var r={};t.exports={getLocales:function(t){return r[t]},setLocales:function(t,e){r[t]=e}}},168:t=>{function r(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,r)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}t.exports=function(t){var e={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=r(n,1),i=r(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();e[u]||(e[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=r(n[s].split("="),2),p=f[0],h=f[1];p&&(e[u].attributes[p.trim()]=!h||h.trim())}}})),e}},926:t=>{t.exports=function(t){var r={language:"ar",path:null},e=t.match(/^\/([a-z]{2})\/(.*)$/);return e?(r.language=e[1],r.path="/".concat(e[2])):(e=t.match(/^\/([a-z]{2})$/))?(r.language=e[1],r.path="/"):r.path=t,r}},413:t=>{t.exports=function(t,r){return r.split(".").reduce((function(t,r){return t&&t[r]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(r){return t.endsWith(r)}))}},38:t=>{"use strict";t.exports=require("dinero.js")},757:t=>{"use strict";t.exports=require("express-fingerprint")},271:t=>{"use strict";t.exports=require("nunjucks")},896:t=>{"use strict";t.exports=require("fs")},928:t=>{"use strict";t.exports=require("path")}},r={},e=function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}(99);module.exports=e})();
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see bundle.esm.js.LICENSE.txt */
2
- import{createRequire as t}from"node:module";var r={863:(t,r,e)=>{var n=e(93).getGlobal;t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){var r=n("app").currency.currencySymbol,e=t.toLocaleString("ar-EG",{minimumFractionDigits:2,maximumFractionDigits:2});return"".concat(r," ").concat(e)},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,r){return t-t*(r/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,r,e){return 1===t?r:e},truncate:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>r?t.slice(0,r)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,r,e)=>{var n=e(93),o=n.getGlobal,i=n.setGlobal,a=e(985).getLocales,c=e(413);t.exports={set:function(t,r){i(t,r)},get:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||r},t:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=o("lang")||"ar",n=a(e);return n&&c(n,t)||r}}},99:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){o=function(){return r};var t,r={},e=Object.prototype,i=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(t){f=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),c=new P(n||[]);return a(i,"_invoke",{value:_(t,e,c)}),i}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(F([])));E&&E!==e&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function G(t,r){function e(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return e("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function _(r,e,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(r,e,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,k(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function A(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function C(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function F(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},O(G.prototype),f(G.prototype,l,(function(){return this})),r.AsyncIterator=G,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new G(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=F,P.prototype={constructor:P,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),C(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;C(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:F(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var a=e(271),c=e(928),u=e(168),l=e(915),s=e(896),f=e(863),p=e(908),h=e(926),v=e(985).setLocales,y=e(93).setGlobal,g=e(91);t.exports=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var e,n=(e=o().mark((function e(n,i,g){var d,m,b,w,x,L,j,E,S,O,G,_,k,A,C,P,F,N,T,I,U,D,q;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x=r.viewsDirectory,L=c.join(null!=x?x:null==i||null===(d=i.locals)||void 0===d||null===(d=d.app)||void 0===d?void 0:d.themePath,"views"),j=c.join(null!=x?x:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"locales"),E=n.originalUrl,S=n.protocol,!l(E)){e.next=7;break}return g(),e.abrupt("return");case 7:for(G in O=a.configure(L,{autoescape:!0,express:t,watch:r.watch||!1,noCache:r.noCache||!1}),f)O.addFilter(G,f[G]);for(_ in s.existsSync(j)&&s.statSync(j).isDirectory()?s.readdirSync(j).forEach((function(t){if(t.endsWith(".json")){var r=c.basename(t,".json"),e=c.join(j,t);if(s.existsSync(e)){var n=s.readFileSync(e,"utf-8");v(r,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)O.addGlobal(_,p[_]);return k=h(E),y("lang",k.language),A="".concat(S,"://").concat(n.get("host")).concat(k.path),console.log("🚀 ~ return ~ fullUrl:",A),C="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(A)),P={"Content-Type":"application/json",secretKey:null!==(b=null==i||null===(w=i.locals)||void 0===w||null===(w=w.app)||void 0===w?void 0:w.secretKey)&&void 0!==b?b:r.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":n.get("User-Agent")||"",Referer:n.get("Referer")||""},F={headers:P},e.next=20,fetch(C,F);case 20:return N=e.sent,(T=N.headers.getSetCookie())&&T.forEach((function(t){var r=u(t);Object.keys(r).forEach((function(t){var e=r[t],n=e.value,o=e.attributes;i.cookie(t,n,o)}))})),e.next=25,N.json();case 25:for(q in I=e.sent,U=I.global,D=I.context,U)Object.hasOwnProperty.call(U,q)&&y(q,U[q]);D.page?i.render(D.page.fileName,{global:U,context:D}):i.render("404",{global:U,context:D});case 29:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,r,e){return n.apply(this,arguments)}}()}},91:(t,r,e)=>{var n=e(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,r,e){o(t,r,(function(){e()}))}},93:t=>{var r={};t.exports={getGlobal:function(t,e){var n;return null!==(n=r[t])&&void 0!==n?n:e},setGlobal:function(t,e){r[t]=e}}},985:t=>{var r={};t.exports={getLocales:function(t){return r[t]},setLocales:function(t,e){r[t]=e}}},168:t=>{function r(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,r)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}t.exports=function(t){var e={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=r(n,1),i=r(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();e[u]||(e[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=r(n[s].split("="),2),p=f[0],h=f[1];p&&(e[u].attributes[p.trim()]=!h||h.trim())}}})),e}},926:t=>{t.exports=function(t){var r={language:"ar",path:null},e=t.match(/^\/([a-z]{2})\/(.*)$/);return e?(r.language=e[1],r.path="/".concat(e[2])):(e=t.match(/^\/([a-z]{2})$/))?(r.language=e[1],r.path="/"):r.path=t,r}},413:t=>{t.exports=function(t,r){return r.split(".").reduce((function(t,r){return t&&t[r]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(r){return t.endsWith(r)}))}},757:t=>{t.exports=require("express-fingerprint")},271:t=>{t.exports=require("nunjucks")},896:r=>{r.exports=t(import.meta.url)("fs")},928:r=>{r.exports=t(import.meta.url)("path")}},e={};!function t(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return r[n](i,i.exports,t),i.exports}(99);
2
+ import{createRequire as t}from"node:module";var r={863:(t,r,e)=>{var n=e(93).getGlobal,o=e(38);t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){var r=n("app").currency,e=o({amount:100*t,currency:r.currencyCode}).toFormat();return"".concat(r.currencySymbol," ").concat(e)},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,r){return t-t*(r/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,r,e){return 1===t?r:e},truncate:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>r?t.slice(0,r)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,r,e)=>{var n=e(93),o=n.getGlobal,i=n.setGlobal,a=e(985).getLocales,c=e(413);t.exports={set:function(t,r){i(t,r)},get:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||r},t:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=o("lang")||"ar",n=a(e);return n&&c(n,t)||r}}},99:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){o=function(){return r};var t,r={},e=Object.prototype,i=e.hasOwnProperty,a=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(t){f=function(t,r,e){return t[r]=e}}function p(t,r,e,n){var o=r&&r.prototype instanceof b?r:b,i=Object.create(o.prototype),c=new P(n||[]);return a(i,"_invoke",{value:_(t,e,c)}),i}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(N([])));E&&E!==e&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function G(t,r){function e(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return e("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(i,i):i()}})}function _(r,e,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(r,e,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,k(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function C(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function A(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function N(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(i.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(n(r)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},r.awrap=function(t){return{__await:t}},O(G.prototype),f(G.prototype,l,(function(){return this})),r.AsyncIterator=G,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new G(p(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=N,P.prototype={constructor:P,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!r)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),A(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;A(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:N(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function i(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}var a=e(271),c=e(928),u=e(168),l=e(915),s=e(896),f=e(863),p=e(908),h=e(926),v=e(985).setLocales,y=e(93).setGlobal,g=e(91);t.exports=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var e,n=(e=o().mark((function e(n,i,g){var d,m,b,w,x,L,j,E,S,O,G,_,k,C,A,P,N,F,T,I,U,q,z;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x=r.viewsDirectory,L=c.join(null!=x?x:null==i||null===(d=i.locals)||void 0===d||null===(d=d.app)||void 0===d?void 0:d.themePath,"views"),j=c.join(null!=x?x:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"locales"),E=n.originalUrl,S=n.protocol,!l(E)){e.next=7;break}return g(),e.abrupt("return");case 7:for(G in O=a.configure(L,{autoescape:!0,express:t,watch:r.watch||!1,noCache:r.noCache||!1}),f)O.addFilter(G,f[G]);for(_ in s.existsSync(j)&&s.statSync(j).isDirectory()?s.readdirSync(j).forEach((function(t){if(t.endsWith(".json")){var r=c.basename(t,".json"),e=c.join(j,t);if(s.existsSync(e)){var n=s.readFileSync(e,"utf-8");v(r,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)O.addGlobal(_,p[_]);return k=h(E),y("lang",k.language),C="".concat(S,"://").concat(n.get("host")).concat(k.path),console.log("🚀 ~ return ~ fullUrl:",C),A="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(C)),P={"Content-Type":"application/json",secretKey:null!==(b=null==i||null===(w=i.locals)||void 0===w||null===(w=w.app)||void 0===w?void 0:w.secretKey)&&void 0!==b?b:r.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":n.get("User-Agent")||"",Referer:n.get("Referer")||""},N={headers:P},e.next=20,fetch(A,N);case 20:return F=e.sent,(T=F.headers.getSetCookie())&&T.forEach((function(t){var r=u(t);Object.keys(r).forEach((function(t){var e=r[t],n=e.value,o=e.attributes;i.cookie(t,n,o)}))})),e.next=25,F.json();case 25:for(z in I=e.sent,U=I.global,q=I.context,U)Object.hasOwnProperty.call(U,z)&&y(z,U[z]);q.page?i.render(q.page.fileName,{global:U,context:q}):i.render("404",{global:U,context:q});case 29:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,r,e){return n.apply(this,arguments)}}()}},91:(t,r,e)=>{var n=e(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,r,e){o(t,r,(function(){e()}))}},93:t=>{var r={};t.exports={getGlobal:function(t,e){var n;return null!==(n=r[t])&&void 0!==n?n:e},setGlobal:function(t,e){r[t]=e}}},985:t=>{var r={};t.exports={getLocales:function(t){return r[t]},setLocales:function(t,e){r[t]=e}}},168:t=>{function r(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=i.call(e)).done)&&(c.push(n.value),c.length!==r);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,r)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}t.exports=function(t){var e={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=r(n,1),i=r(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();e[u]||(e[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=r(n[s].split("="),2),p=f[0],h=f[1];p&&(e[u].attributes[p.trim()]=!h||h.trim())}}})),e}},926:t=>{t.exports=function(t){var r={language:"ar",path:null},e=t.match(/^\/([a-z]{2})\/(.*)$/);return e?(r.language=e[1],r.path="/".concat(e[2])):(e=t.match(/^\/([a-z]{2})$/))?(r.language=e[1],r.path="/"):r.path=t,r}},413:t=>{t.exports=function(t,r){return r.split(".").reduce((function(t,r){return t&&t[r]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(r){return t.endsWith(r)}))}},38:t=>{t.exports=require("dinero.js")},757:t=>{t.exports=require("express-fingerprint")},271:t=>{t.exports=require("nunjucks")},896:r=>{r.exports=t(import.meta.url)("fs")},928:r=>{r.exports=t(import.meta.url)("path")}},e={};!function t(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return r[n](i,i.exports,t),i.exports}(99);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "1.0.47",
3
+ "version": "1.0.48",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "module": "dist/bundle.esm.js",
6
6
  "scripts": {
@@ -13,6 +13,7 @@
13
13
  "description": "",
14
14
  "dependencies": {
15
15
  "@rollup/plugin-babel": "^6.0.4",
16
+ "dinero.js": "^1.9.1",
16
17
  "express-fingerprint": "^1.2.2",
17
18
  "nunjucks": "^3.2.4",
18
19
  "qumra-cli": "^1.1.8"