@sarafapp/iron_core 1.0.45 → 1.0.46
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/dist/IronCore.js +1 -1
- package/dist/IronCore.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/IronCore.js
CHANGED
package/dist/IronCore.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(r,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("dayjs"),require("vue"),require("json2typescript"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","dayjs","vue","json2typescript","pinia"],M):(r=typeof globalThis<"u"?globalThis:r||self,M(r.IronCore={},r.dayjs,r.Vue,r.json2typescript,r.pinia))})(this,function(r,M,v,_,Fe){"use strict";var re=(t=>(t.BankCard="####-####-####-####",t.Iban="##-####-####-####-####-####-##",t))(re||{}),q=(t=>(t.FullDate="YYYY/M/D HH:mm",t.SimpleDate="YYYY/M/D",t.CompactGregorianDate="YYYYMMDD",t.ShortJalaliDate="YYMM",t.JustHour="HH:mm:ss",t))(q||{});const Be=[{62198619:{persian:"بلو",english:"blue"}},{603799:{persian:"بانک ملی ایران",english:"melli"}},{589210:{persian:"بانک سپه",english:"sepah"}},{627648:{persian:"بانک توسعه صادرات",english:"export-development"}},{627961:{persian:"بانک صنعت و معدن",english:"industry-mine"}},{603770:{persian:"بانک کشاورزی",english:"agriculture"}},{628023:{persian:"بانک مسکن",english:"housing"}},{627760:{persian:"پست بانک ایران",english:"post"}},{502908:{persian:"بانک توسعه تعاون",english:"development-cooperation"}},{627412:{persian:"بانک اقتصاد نوین",english:"eghtesad-novin"}},{622106:{persian:"بانک پارسیان",english:"parsian"}},{502229:{persian:"بانک پاسارگاد",english:"pasargad"}},{639599:{persian:"بانک قوامین",english:"ghavamin"}},{627488:{persian:"بانک کارآفرین",english:"karafarin"}},{621986:{persian:"بانک سامان",english:"saman"}},{639346:{persian:"بانک سینا",english:"sina"}},{639607:{persian:"بانک سرمایه",english:"sarmayeh"}},{504706:{persian:"بانک شهر",english:"shahr"}},{502806:{persian:"بانک شهر",english:"shahr"}},{502938:{persian:"بانک دی",english:"day"}},{603769:{persian:"بانک صادرات",english:"saderat"}},{610433:{persian:"بانک ملت",english:"mellat"}},{627353:{persian:"بانک تجارت",english:"tejarat"}},{585983:{persian:"بانک تجارت",english:"tejarat"}},{589463:{persian:"بانک رفاه",english:"refah"}},{627381:{persian:"بانک انصار",english:"ansar"}},{639370:{persian:"بانک مهر اقتصاد",english:"mehr-eqtesad"}},{505801:{persian:"موسسه اعتباری کوثر",english:"kosar"}},{606373:{persian:"بانک قرض الحسنه مهرایرانیان",english:"mehr"}},{186214:{persian:"بانک آینده",english:"ayandeh"}},{504172:{persian:"بانک قرض الحسنه رسالت",english:"resalat"}},{505416:{persian:"بانک گردشگری",english:"tourism"}},{505785:{persian:"بانک ایرانزمین",english:"iran-zamin"}},{505809:{persian:"بانک خاورمیانه",english:"middle-east"}},{585947:{persian:"بانک خاورمیانه",english:"middle-east"}},{604932:{persian:"بانک سپه",english:"sepah"}},{627961:{persian:"بانک صنعت و معدن",english:"industry-mine"}},{636214:{persian:"بانک آینده",english:"ayandeh"}},{636795:{persian:"بانک مرکزی",english:"markazi"}},{636949:{persian:"بانک حکمت ایرانیان",english:"hekmat-iranian"}},{639217:{persian:"بانک کشاورزی",english:"agriculture"}}],Ne=[{"010":{persian:"بانک مرکزی",english:"markazi"}},{"011":{persian:"بانک صنعت و معدن",english:"industry-mine"}},{"012":{persian:"بانک ملت",english:"mellat"}},{"013":{persian:"بانک رفاه",english:"refah"}},{"014":{persian:"بانک مسکن",english:"housing"}},{"015":{persian:"بانک سپه",english:"sepah"}},{"016":{persian:"بانک کشاورزی",english:"agriculture"}},{"017":{persian:"بانک ملّی ایران",english:"melli"}},{"018":{persian:"بانک تجارت",english:"tejarat"}},{"019":{persian:"بانک صادرات",english:"saderat"}},{"020":{persian:"بانک توسعه صادرات",english:"export-development"}},{"021":{persian:"پست بانک",english:"post"}},{"053":{persian:"بانک کارآفرین",english:"karafarin"}},{"054":{persian:"بانک پارسیان",english:"parsian"}},{"055":{persian:"بانک اقتصاد نوین",english:"eghtesad-novin"}},{"056":{persian:"بانک سامان",english:"saman"}},{"057":{persian:"بانک پاسارگاد",english:"pasargad"}},{"058":{persian:"بانک سرمایه",english:"sarmayeh"}},{"059":{persian:"بانک سینا",english:"sina"}},{"060":{persian:"بانک قرض الحسنه مهرایرانیان",english:"mehr"}},{"061":{persian:"بانک شهر",english:"shahr"}},{"062":{persian:"بانک آینده",english:"ayandeh"}},{"065":{persian:"بانک حکمت ایرانیان",english:"hekmat-iranian"}},{"066":{persian:"بانک دی",english:"day"}},{"069":{persian:"بانک ایران زمین",english:"iran-zamin"}},{"070":{persian:"بانک قرض الحسنه رسالت",english:"resalat"}},{"078":{persian:"بانک خاورمیانه",english:"middle-east"}}];var Ue=(t=>(t.Normal="YYYY-MM-DD",t.ContainsHour="YYYY-MM-DD HH:mm",t.OnlyHour="HH:mm",t))(Ue||{});function ie(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ne={exports:{}},ut=ne.exports,Ye;function ht(){return Ye||(Ye=1,function(t,e){(function(s,a){t.exports=a()})(ut,function(){return function(s,a){a.prototype.weekday=function(i){var n=this.$locale().weekStart||0,o=this.$W,d=(o<n?o+7:o)-n;return this.$utils().u(i)?d:this.subtract(d,"day").add(i,"day")}}})}(ne)),ne.exports}var dt=ht();const ft=ie(dt);var oe={exports:{}},mt=oe.exports,je;function gt(){return je||(je=1,function(t,e){(function(s,a){t.exports=a()})(mt,function(){var s="week",a="year";return function(i,n,o){var d=n.prototype;d.week=function(u){if(u===void 0&&(u=null),u!==null)return this.add(7*(u-this.week()),"day");var p=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var m=o(this).startOf(a).add(1,a).date(p),h=o(this).endOf(s);if(m.isBefore(h))return 1}var g=o(this).startOf(a).date(p).startOf(s).subtract(1,"millisecond"),S=this.diff(g,s,!0);return S<0?o(this).startOf("week").week():Math.ceil(S)},d.weeks=function(u){return u===void 0&&(u=null),this.week(u)}}})}(oe)),oe.exports}var vt=gt();const yt=ie(vt);var le={exports:{}},pt=le.exports,He;function St(){return He||(He=1,function(t,e){(function(s,a){t.exports=a()})(pt,function(){return function(s,a){a.prototype.weekYear=function(){var i=this.month(),n=this.week(),o=this.year();return n===1&&i===11?o+1:i===0&&n>=52?o-1:o}}})}(le)),le.exports}var It=St();const wt=ie(It);var ce={exports:{}},bt=ce.exports,qe;function At(){return qe||(qe=1,function(t,e){(function(s,a){t.exports=a(M)})(bt,function(s){function a(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var i=a(s),n={name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(o){return o},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return i.default.locale(n,null,!0),n})}(ce)),ce.exports}var Dt=At();const Mt=ie(Dt);function ue(t,e){return _t(t)||Ct(t,e)||Rt()}function _t(t){if(Array.isArray(t))return t}function Ct(t,e){var s=[],a=!0,i=!1,n=void 0;try{for(var o=t[Symbol.iterator](),d;!(a=(d=o.next()).done)&&(s.push(d.value),!(e&&s.length===e));a=!0);}catch(u){i=!0,n=u}finally{try{!a&&o.return!=null&&o.return()}finally{if(i)throw n}}return s}function Rt(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function ze(t,e,s){e<=2&&(t-=1,e+=12);var a=Math.floor(t/100),i=2-a+Math.floor(a/4),n=Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+s+i-1524.5;return n}function Lt(t){t=t+.5;var e=Math.floor(t),s=t-e,a=e;if(e>=2299161){var i=Math.floor((e-186721625e-2)/36524.25);a=e+1+i-Math.floor(i/4)}var n=a+1524,o=Math.floor((n-122.1)/365.25),d=Math.floor(365.25*o),u=Math.floor((n-d)/30.6001),p=n-d-Math.floor(30.6001*u)+s,m=u<14?u-1:u-13,h=m>2?o-4716:o-4715;return Et(h,m,p)}function Tt(t){t=t+.5;var e=Math.floor(t),s=t-e,a=e;if(e>=2299161){var i=Math.floor((e-186721625e-2)/36524.25);a=e+1+i-Math.floor(i/4)}var n=a+1524,o=Math.floor((n-122.1)/365.25),d=Math.floor(365.25*o),u=Math.floor((n-d)/30.6001),p=n-d-Math.floor(30.6001*u)+s,m=u<14?u-1:u-13,h=m>2?o-4716:o-4715;return[Math.floor(h),Math.floor(m),Math.floor(p)]}function Ot(t,e,s){var a=[31,28,31,30,31,30,31,31,30,31,30,31],i=[31,31,31,31,31,31,30,30,30,30,30,29];function n(S,A){return Math.floor(S/A)}t-=979;for(var o=365*t+n(t,33)*8+n(t%33+3,4),d=0;d<e-1;++d)o+=i[d];o+=s-1;var u=o+79,p=1600+400*n(u,146097);u=u%146097;var m=!0;for(u>=36525&&(u--,p+=100*n(u,36524),u=u%36524,u>=365?u++:m=!1),p+=4*n(u,1461),u%=1461,u>=366&&(m=!1,u--,p+=n(u,365),u=u%365),d=0;u>=a[d]+(d==1&&m);d++)u-=a[d]+(d==1&&m);var h=d+1,g=u+1;return ze(p,h,g)}function Et(t,e,s){var a=[31,28,31,30,31,30,31,31,30,31,30,31],i=[31,31,31,31,31,31,30,30,30,30,30,29];function n(K,Z){return Math.floor(K/Z)}for(var o=t-1600,d=e-1,u=s-1,p=365*o+n(o+3,4)-n(o+99,100)+n(o+399,400),m=0;m<d;++m)p+=a[m];d>1&&(t%4==0&&t%100!=0||t%400==0)&&p++,p+=u;var h=p-79,g=n(h,12053);h%=12053;var S=979+33*g+4*n(h,1461);h%=1461,h>=366&&(S+=n(h-1,365),h=(h-1)%365);for(var A=0;A<11&&h>=i[A];++A)h-=i[A];var W=A+1,x=h+1;return[S,W,x]}var he={J:function(e,s,a){return Lt(ze(e,s,a))},G:function(e,s,a){return Tt(Ot(e,s,a))}},kt=/^(\d{4})[-/]?(\d{1,2})[-/]?(\d{0,2})(.*)?$/,Pt=/\[.*?\]|jY{2,4}|jM{1,4}|jD{1,2}|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,be="date",z="day",V="month",$="year",Je="week",Vt="YYYY-MM-DDTHH:mm:ssZ",$t={jmonths:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_")},Ft=function(t,e,s){var a=e.prototype,i=a.$utils(),n=function(c){return c.$C==="jalali"},o=i.prettyUnit||i.p,d=i.isUndefined||i.u,u=i.padStart||i.s,p=i.monthDiff||i.m,m=i.absFloor||i.a,h=function(c){return function(){var f=c.bind(this).apply(void 0,arguments);return f.$C=this.$C,f.isJalali()&&f.InitJalali(),f}};a.startOf=h(a.startOf),a.endOf=h(a.endOf),a.add=h(a.add),a.subtract=h(a.subtract),a.set=h(a.set);var g=a.parse,S=a.init,A=a.startOf,W=a.$set,x=a.add,K=a.format,Z=a.diff,Pe=a.year,Ve=a.month,pe=a.date,$e=a.daysInMonth,se=a.toArray;s.$C="gregory",s.$fdow=6,s.calendar=function(l){return s.$C=l,s},a.calendar=function(l){var c=this.clone();return c.$C=l,c.isJalali()&&c.InitJalali(),c},a.isJalali=function(){return n(this)},s.en.jmonths="Farvardin_Ordibehesht_Khordaad_Tir_Mordaad_Shahrivar_Mehr_Aabaan_Aazar_Dey_Bahman_Esfand".split("_"),s.locale("fa",Object.assign({},Mt,{},$t),!0);var X=function(c,f){return s(c,{locale:f.$L,utc:f.$u,calendar:f.$C})};a.init=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};S.bind(this)(l),this.isJalali()&&this.InitJalali()},a.parse=function(l){var c;if(this.$C=l.calendar||this.$C||s.$C,l.jalali&&typeof l.date=="string"&&/.*[^Z]$/i.test(l.date)&&(c=l.date.match(kt))){var f=he.G(parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3]||1,10)),w=ue(f,3),b=w[0],I=w[1],D=w[2];l.date="".concat(b,"-").concat(I,"-").concat(D).concat(c[4]||"")}return g.bind(this)(l)},a.InitJalali=function(){var l=he.J(this.$y,this.$M+1,this.$D),c=ue(l,3),f=c[0],w=c[1],b=c[2];this.$jy=f,this.$jM=w-1,this.$jD=b},a.startOf=function(l,c){var f=this;if(!n(this))return A.bind(this)(l,c);var w=d(c)?!0:c,b=o(l),I=function(Q,j){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.$jy,Ie=he.G(E,j+1,Q),H=ue(Ie,3),ae=H[0],we=H[1],Ys=H[2],ct=X(new Date(ae,we-1,Ys),f);return(w?ct:ct.endOf(z)).$set("hour",1)},D=(this.$W+(7-s.$fdow))%7;switch(b){case $:return w?I(1,0):I(0,0,this.$jy+1);case V:return w?I(1,this.$jM):I(0,(this.$jM+1)%12,this.$jy+parseInt((this.$jM+1)/12,10));case Je:return w?I(this.$jD-D,this.$jM):I(this.$jD+(6-D),this.$jM);default:return A.bind(this)(l,c)}},a.$set=function(l,c){var f=this;if(!n(this))return W.bind(this)(l,c);var w=o(l),b=function(D,Se){var Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.$jy,j=he.G(Q,Se+1,D),E=ue(j,3),Ie=E[0],H=E[1],ae=E[2];return f.$d.setFullYear(Ie),f.$d.setMonth(H-1),f.$d.setDate(ae),f};switch(w){case be:case z:b(c,this.$jM);break;case V:b(this.$jD,c);break;case $:b(this.$jD,this.$jM,c);break;default:return W.bind(this)(l,c)}return this.init(),this},a.add=function(l,c){var f=this;if(!n(this))return x.bind(this)(l,c);l=Number(l);var w=c&&(c.length===1||c==="ms")?c:o(c),b=function(H,ae){var we=f.set(be,1).set(H,ae+l);return we.set(be,Math.min(f.$jD,we.daysInMonth()))};if(["M",V].indexOf(w)>-1){var I=this.$jM+l,D=I<0?-Math.ceil(-I/12):Math.floor(I/12),Se=this.$jD,Q=this.set(z,1).add(D,$).set(V,I-D*12);return Q.set(z,Math.min(Q.daysInMonth(),Se))}if(["y",$].indexOf(w)>-1)return b($,this.$jy);if(["d",z].indexOf(w)>-1){var j=new Date(this.$d);return j.setDate(j.getDate()+l),X(j,this)}if(["w",Je].indexOf(w)>-1){var E=new Date(this.$d);return E.setDate(E.getDate()+l*7),X(E,this)}return x.bind(this)(l,c)},a.format=function(l,c){var f=this;if(!n(this))return K.bind(this)(l,c);var w=l||Vt,b=c||this.$locale(),I=b.jmonths;return w.replace(Pt,function(D){if(D.indexOf("[")>-1)return D.replace(/\[|\]/g,"");switch(D){case"YY":return String(f.$jy).slice(-2);case"YYYY":return String(f.$jy);case"M":return String(f.$jM+1);case"MM":return u(f.$jM+1,2,"0");case"MMM":return I[f.$jM].slice(0,3);case"MMMM":return I[f.$jM];case"D":return String(f.$jD);case"DD":return u(f.$jD,2,"0");default:return K.bind(f)(D,c)}})},a.diff=function(l,c,f){if(!n(this))return Z.bind(this)(l,c,f);var w=o(c),b=s(l),I=p(this,b);switch(w){case $:I/=12;break;case V:break;default:return Z.bind(this)(l,c,f)}return f?I:m(I)},a.$g=function(l,c,f){return d(l)?this[c]:this.set(f,l)},a.year=function(l){return n(this)?this.$g(l,"$jy",$):Pe.bind(this)(l)},a.month=function(l){return n(this)?this.$g(l,"$jM",V):Ve.bind(this)(l)},a.date=function(l){return n(this)?this.$g(l,"$jD",z):pe.bind(this)(l)},a.daysInMonth=function(){return n(this)?this.endOf(V).$jD:$e.bind(this)()},se&&(a.toArray=function(){return n(this)?[this.$jy,this.$jM,this.$jD,this.$H,this.$m,this.$s,this.$ms]:se.bind(this)()}),a.clone=function(){return X(this.toDate(),this)}};const Bt={ordinal(t){},relativeTime:void 0,name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),months:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),monthsShort:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),weekStart:6,formats:{L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};function Ge(){M.extend(Ft),M.calendar("jalali"),M.extend(ft),M.extend(yt),M.extend(wt),M.locale(Bt,{},!0)}class Nt{constructor(e,s){this.start=e,this.end=s}}class Ut{constructor(e,s,a){this.maxDate=e,this.minDate=s,this.disabledDates=a}}class F{static standardToUnix(e){return Math.floor(new Date(e).getTime()/1e3)}static unixToStandard(e){return new Date(e*1e3).toString()}static getUnixEndOfDayInUnix(e){return M.unix(e).endOf("day").unix()}}class ee{static isDateDisabled(e,s){for(const a of e.disabledDates)if(ee.areUnixesInSameDate(a,s.unix()))return!0;return!!(e.maxDate&&ee.isDateGraterOrSame(e.maxDate,s.unix())||e.minDate&&ee.isDateLowerOrSame(e.minDate,s.unix()))}static areUnixesInSameDate(e,s){return F.getUnixEndOfDayInUnix(e)===F.getUnixEndOfDayInUnix(s)}static isDateGraterOrSame(e,s){return F.getUnixEndOfDayInUnix(s)>=F.getUnixEndOfDayInUnix(e)}static isDateLowerOrSame(e,s){return F.getUnixEndOfDayInUnix(s)<=F.getUnixEndOfDayInUnix(e)}}Ge();class C{static toCurrency(e,s){return e.toLocaleString("en-US",s)}static toCurrencyWithDotSeparator(e){return C.toCurrency(e).replaceAll(",",".")}static applyMask(e,s){let a="",i=0,n=0;for(;i<e.length;){if(e[i]==="#"){if(n>=s.length)throw new Error("Value length does not match the format.");a+=s[n],n++}else a+=e[i];i++}if(n!==s.length)throw new Error("Value length does not match the format.");return a}static applyBankCardMask(e){return C.applyMask(re.BankCard,String(e))}static applyIbanMask(e){return C.applyMask(re.Iban,String(e))}static toEnglishDigits(e){const s=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],a=["١","٢","٣","٤","٥","٦","٧","٨","٩","٠"],i=["1","2","3","4","5","6","7","8","9","0"];return e.split("").map(n=>i[s.indexOf(n)]||i[a.indexOf(n)]||n).join("")}static mapUnixToDate(e,s){return M(new Date(e)).subtract(1,"day").format(s)}}var y=(t=>(t.FetchList="fetchList",t.AutoRefresh="autoRefresh",t.FetchItem="fetchItem",t.FetchLastItems="fetchLastItems",t.FetchPreviousItems="fetchPreviousItems",t.Create="CREATE",t.Update="UPDATE",t.Delete="DELETE",t.Search="SEARCH",t.Sort="SORT",t.Success="SUCCESS",t.Error="ERROR",t.Idle="IDLE",t))(y||{}),k=(t=>(t.Width="width",t.Height="height",t[t.DefaultWidth=500]="DefaultWidth",t[t.DefaultHeight=350]="DefaultHeight",t[t.MinimalAvailableSize=0]="MinimalAvailableSize",t))(k||{}),O=(t=>(t.ASC="ASC",t.DESC="DESC",t))(O||{}),We=(t=>(t.ASC="ascend",t.DESC="descend",t))(We||{}),de=(t=>(t.Left="left",t.Right="right",t.Center="center",t))(de||{}),fe=(t=>(t.Text="text",t))(fe||{}),me=(t=>(t.Text="text",t.ACTION="action",t.Tag="tag",t.Iban="iban",t.BankCard="bankCard",t.Symbol="symbol",t.TradeDetail="tradeDetail",t.SymbolPrice="symbolPrice",t.TradeSymbol="tradeSymbol",t.Price="price",t.DynamicCurrencyPrice="dynamicCurrencyPrice",t.TradeDate="tradeDate",t.RequestResponseIdentity="requestResponseIdentity",t.Image="image",t))(me||{}),Ae=(t=>(t[t.MINIMAL_LOADABLE_HEADER_COUNT=0]="MINIMAL_LOADABLE_HEADER_COUNT",t[t.DEFAULT_ITEM_COUNT_PER_PAGE=20]="DEFAULT_ITEM_COUNT_PER_PAGE",t.PAGINATION_POSITION="bottomCenter",t))(Ae||{});r.ApplicationTheme=(t=>(t.FontFamily="IRANSansX",t))(r.ApplicationTheme||{});var J=(t=>(t.Open="open",t.Close="close",t))(J||{}),xe=(t=>(t[t.NotFound=404]="NotFound",t[t.Unauthorized=401]="Unauthorized",t[t.ServerError=500]="ServerError",t))(xe||{}),te=(t=>(t[t.Invalid=0]="Invalid",t[t.Valid=1]="Valid",t))(te||{}),P=(t=>(t.Theme="theme",t.AccessList="accessList",t.Token="token",t.SSO_ACCESS_LIST="ssoAccessList",t))(P||{});r.ApplicationTheme=(t=>(t.Light="light",t.Dark="dark",t))(r.ApplicationTheme||{});var ge=(t=>(t.Dialog="dialog",t.Drawer="drawer",t.Module="module",t.Toast="toast",t))(ge||{}),Ke=(t=>(t.USDT="USDT",t))(Ke||{});class B{static getBankImageBaseOnCardInfo(e,s){return e===void 0?"/img/banks/shetab.png":s==="IBAN"?(e=C.toEnglishDigits(e.replace(/IR/g,"").split(" ").join("")),`/img/banks/${B.iban(e).english}.png`):(e=C.toEnglishDigits(e.replace(/ /g,"")),`/img/banks/${B.card(e).english}.png`)}static card(e){const s={persian:"نامشخص",english:"shetab"};if(e==null)return s;e=e.substring(0,6);try{const a=Be.find(i=>Object.keys(i)[0]===e);return a===void 0?s:Object.values(a)[0]}catch{return s}}static iban(e){const s={persian:"نامشخص",english:"shetab"};if(e==null)return s;e=e.substring(2,5);try{const a=Ne.find(i=>Object.keys(i)[0]===e);return a===void 0?s:Object.values(a)[0]}catch{return s}}static async copyValueToClipboard(e){await navigator.clipboard.writeText(String(e))}static downloadBlob(e,s=B.extractFileNameFromHeader(e)){const a=document.createElement("a");a.href=URL.createObjectURL(e.data),a.download=s,a.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0})),a.remove()}static extractFileNameFromHeader(e){var a,i,n,o;return((o=(a=e.headers["content-disposition"])==null?void 0:a.split("filename=")[1])==null?void 0:o.slice(1,((n=(i=e.headers["content-disposition"])==null?void 0:i.split("filename="))==null?void 0:n[1].length)-1))||"Saraf-File"}static removeSpacesFromString(e){return e&&typeof e.normalize=="function"&&(e=e.normalize("NFC")),e.replace(/[\s\u00A0\u1680\u180E\u2000-\u200A\u200B-\u200D\u2060\uFEFF\u2028\u2029\u202F\u205F\u3000]+/g,"")}static isArraySorted(e,s=i=>i,a=O.ASC){return e.every((i,n)=>e.length-1===n?!0:a===O.ASC?s(i)<=s(e[n+1]):s(i)>=s(e[n+1]))}}const N=class N{constructor(){this.availableAccesses=new Set}setAvailableAccesses(e){this.setAccessListToStorage(e);for(const s of e)this.availableAccesses.add(s)}setAccessListToStorage(e){localStorage.setItem(P.AccessList,JSON.stringify(e))}everyAccess(e){return e.every(s=>this.availableAccesses.has(s))}someAccess(e){return e.some(s=>this.availableAccesses.has(s))}clearAvailableAccesses(){this.availableAccesses.clear(),localStorage.removeItem(P.AccessList)}initialize(){const e=localStorage.getItem(P.AccessList);e!==null&&this.setAvailableAccesses(JSON.parse(e))}static GetInstance(){return N.Instance||(N.Instance=new N),N.Instance}};N.Instance=null;let G=N;class De{constructor(){this.mounted=(e,s)=>{this.checkAccess(e,s.value)},this.updated=(e,s)=>{this.checkAccess(e,s.value)},this.checkAccess=(e,s)=>{this.hasAccess(s)||e.remove()},this.accessService=G.GetInstance()}}class Yt extends De{hasAccess(e){return this.accessService.everyAccess(e)}}class jt extends De{hasAccess(e){return this.accessService.someAccess(e)}}const U=class U{constructor(){this._accessLevels=new Map}initialize(){this.setAccessLevelFromStorage()}setAccessLevels(e){for(const s in e)this._accessLevels.set(s,new Set(e[s]));this.setAccessLevelsToStorage(e)}setAccessLevelsToStorage(e){localStorage.setItem(P.SSO_ACCESS_LIST,JSON.stringify(e))}getAccessLevelsFromStorage(){let e=localStorage.getItem(P.SSO_ACCESS_LIST);return e!==null?JSON.parse(e):e}getAccessLevelsOfScope(e){if(this._accessLevels.has(e))return this._accessLevels.get(e);throw new Error(`The scope is not exists ${e}`)}setAccessLevelFromStorage(){const e=this.getAccessLevelsFromStorage();e&&this.setAccessLevels(e)}everyAccess(e,s){const a=this.getAccessLevelsOfScope(e);return a?s.every(i=>a.has(i)):!1}someAccess(e,s){const a=this.getAccessLevelsOfScope(e);return a?s.some(i=>a.has(i)):!1}hasScope(e){return this._accessLevels.has(e)}clear(){localStorage.removeItem(P.SSO_ACCESS_LIST),this._accessLevels=new Map}static GetInstance(){return U._instance||(U._instance=new U),U._instance}};U._instance=null;let ve=U;class Me{constructor(){this._authorizationService=ve.GetInstance(),this.mounted=this.mounted.bind(this),this.updated=this.updated.bind(this),this.hasAccess=this.hasAccess.bind(this),this.manageElement=this.manageElement.bind(this)}mounted(e,s,a){this.manageElement(e,s.arg,s.modifiers)}updated(e,s,a){this.manageElement(e,s.arg,s.modifiers)}manageElement(e,s,a){if(!this._authorizationService.hasScope(s)){e.remove();return}const i=this.getAccessLevels(s,a);this.hasAccess(s,i)||e.remove()}getAccessLevels(e,s){var i;let a=Object.keys(s);return a.length||(a=Array.from(((i=this._authorizationService.getAccessLevelsOfScope(e))==null?void 0:i.values())??[])),a}}class Ht extends Me{hasAccess(e,s){return this._authorizationService.everyAccess(e,s)}}class qt extends Me{hasAccess(e,s){return this._authorizationService.someAccess(e,s)}}class Ze{constructor(){this.value=null,this.initialValue=null,this.name="",this.isValid=!1,this.isBlurSensitive=!1,this.isRequired=!1,this.isIncludeInRequestBody=!0,this.isChangeSensitive=!1,this.notValidMessage="",this.isEmptySensitive=!0,this.hasCustomValidationCheck=!1,this.shouldRemoveValidationMessageOnInteract=!1}}function zt(t){return t===1}function Jt(t,e){return t-1===e}function Xe(t){return String(t).length===0||t===null||t===void 0}function Gt(t){t()}class Wt{constructor(e,s){this.initialData=null,this.data=new Ze,this._validators=[],this._id=Math.random(),this.data.value=s,this.data.name=e,this.shouldRunValidation()&&this.runValidation(!0)}shouldRunValidation(){return this.data.hasCustomValidationCheck?!1:this.data.isRequired?!0:!Xe(this.data.value)}async runValidation(e=!1){for(const s of this._validators){const a=await s.validate(this.data.value);if(a){this.setFormToInvalidState(e,a);return}}this.setFormToValidState()}setFormToInvalidState(e,s){this.data.isValid=!1,(this.data.isChangeSensitive||e)&&this.setNotValidMessage(s)}setFormToValidState(){this.data.isValid=!0,this.setNotValidMessage("")}reset(){this.initialData?this.data=structuredClone(v.toRaw(this.initialData)):console.warn("The "+this.data.name+`input control has no initial data,
|
|
2
|
-
the initial data will be available after calling the [markAsInitial] method on this instance`)}markAsInitial(){this.initialData=structuredClone(v.toRaw(this.data))}setValidators(e){this._validators=e}getChangeSensitive(){return this.data.isChangeSensitive}setChangeSensitive(e){if(e&&this.data.shouldRemoveValidationMessageOnInteract)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.isChangeSensitive=e}getIsBlurSensitive(){return this.data.isBlurSensitive}setIsBlurSensitive(e){this.data.isBlurSensitive=e}getIsRequired(){return this.data.isRequired}setIsRequired(e){this.data.isRequired=e}getIsValid(){return this.data.isValid}setIsValid(e){this.data.isValid=e}getIsIncludeInRequestBody(){return this.data.isIncludeInRequestBody}setIsIncludeInRequestBody(e){this.data.isIncludeInRequestBody=e}getNotValidMessage(){return this.data.notValidMessage}setNotValidMessage(e){this.data.notValidMessage=e}getName(){return this.data.name}setName(e){this.data.name=e}setId(e){this._id=e}getId(){return this._id}getIsEmptySensitive(){return this.data.isEmptySensitive}setIsEmptySensitive(e){this.data.isEmptySensitive=e}setHasCustomValidationCheck(e){this.data.hasCustomValidationCheck=e}setShouldRemoveValidationOnInteract(e){if(e&&this.data.isChangeSensitive)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.shouldRemoveValidationMessageOnInteract=e}getShouldRemoveValidationOnInteract(){return this.data.shouldRemoveValidationMessageOnInteract}hasCustomValidationCheck(){return this.data.hasCustomValidationCheck}set value(e){this.data.value=e,this.shouldRunValidation()&&this.runValidation(),this.getShouldRemoveValidationOnInteract()&&this.setNotValidMessage("")}get value(){return this.data.value}}class xt{constructor(e){this._inputControl=e}setValidators(e){return this._inputControl.setValidators(e),this}setChangeSensitive(){return this._inputControl.setChangeSensitive(!0),this}setRequired(){return this._inputControl.setIsRequired(!0),this}setValid(){return this._inputControl.setIsValid(!0),this}setBlurSensitive(){return this._inputControl.setIsBlurSensitive(!0),this}setId(e){return this._inputControl.setId(e),this}removeEmptySensitive(){return this._inputControl.setIsEmptySensitive(!1),this}setHasCustomValidationCheck(){return this._inputControl.setHasCustomValidationCheck(!0),this}removeErrorOnInteract(){return this._inputControl.setShouldRemoveValidationOnInteract(!0),this}build(){return this._inputControl}}class Kt{constructor(){this.mounted=(e,s)=>{s.value&&s.value.getIsBlurSensitive()&&(e.addEventListener("click",this.handleFocus.bind(this,s.value)),e.addEventListener("blur",this.handleBlur.bind(this,s.value),!0))},this.beforeUnMount=(e,s)=>{e.removeEventListener("blur",this.handleBlur.bind(this,s.value)),e.removeEventListener("click",this.handleFocus.bind(this,s.value))}}handleBlur(e){e.runValidation(!0)}handleFocus(e){e.value||e.getIsEmptySensitive()||e.setNotValidMessage("")}}class Zt{constructor(){this._inputControls=new Map,this._isValid=!1,this._id=Math.random()}getInputControlsAsArray(){return Array.from(this._inputControls.values())}async runValidation(e){let s=!0;for(const a of this.getInputControlsAsArray())if(e&&await a.runValidation(!0),!a.getIsValid()&&(s=!1,!e)){this._isValid=!1;return}this._isValid=s}addInputControls(e){for(const s of e)this._inputControls.set(s.getName(),s)}getInputControl(e){const s=this._inputControls.get(e);if(!s)throw new Error(`The provided input name (${e}}) has no controls.`);return s}resetControls(e){for(const s of e){const a=this._inputControls.get(s);a?a.reset():console.warn(`Provided input name ${s} has no controllers in this form`)}}resetAll(){for(const e of this.getInputControlsAsArray())e.reset()}createRequestBody(){const e={};for(const s of this.getInputControlsAsArray())s.getIsIncludeInRequestBody()&&(e[s.getName()]=s.value);return e}setIsValid(e){this._isValid=e}getIsValid(){return this._isValid}setId(e){this._id=e}getId(){return this._id}}function Xt(t,e=!1){const s=v.reactive(t),a=v.ref(te.Invalid);return v.watch(()=>s.getInputControlsAsArray(),()=>{e||(s.runValidation(),s.getIsValid()?a.value=te.Valid:a.value=te.Invalid)},{immediate:!0,deep:!0}),{reactiveForm:s,validationStatus:a}}class _e{constructor(e){this.timerId=null,this.setupInterval=this.setupInterval.bind(this),this.schedule=e}setupInterval(e){const s=this;this.timerId=setTimeout(async function a(){await s.schedule.runAction(),s.timerId=setTimeout(()=>{a()},e)},e)}clearInterval(){this.timerId&&clearInterval(this.timerId)}}const Ce="150px",Re=2,Qt={path:"id",key:"id",title:"عملیات",colspan:Re,width:Ce,cellType:me.ACTION,align:de.Center,headerType:fe.Text,accessLevel:null},Qe={width:Ce,align:de.Center,headerType:fe.Text,cellType:me.Text,colspan:Re};class ye{constructor(e,s){this.key=e,this.order=s}}class Le{aSort(e,s){return e.sort((a,i)=>{const n=a[s]??a,o=i[s]??i;if(typeof n=="string"&&typeof o=="string")return n.localeCompare(o);if(typeof n=="number"&&typeof o=="number")return n-o;throw new Error("Not supported data type")})}bSort(e,s){return e.sort((a,i)=>{const n=a[s]??a,o=i[s]??i;if(typeof n=="string"&&typeof o=="string")return o.localeCompare(n);if(typeof n=="number"&&typeof o=="number")return o-n;throw new Error("Not supported data type")})}}class es{arrayOfObjectSort(e,s,a,i=new Le){return a===O.ASC?i.aSort(e,s):i.bSort(e,s)}arraySort(e,s,a=new Le){return s===O.ASC?a.aSort(e):a.bSort(e)}}class et{constructor(e){this.currentPage=1,this.currentPageSize=20,this.currentSortDetail=new ye("id",O.DESC),this.loadedRows=[],this.headerSchema=[],this.service=e,this.accessService=G.GetInstance()}addHeader(e){this.headerSchema.push(e)}async load(){this.headerSchema=this.filterItemsBaseOnAccessLevel(await this.loadHeader()),await this.loadRows()}filterItemsBaseOnAccessLevel(e){return e.filter(s=>s.hasAccess?s.hasAccess():!0)}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail=e,this.loadedRows=(await this.handleSort(this.currentSortDetail)).items)}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.key||e.order!==this.currentSortDetail.order}async paginate(e,s){this.shouldSendPaginationRequest(e,s)&&(this.currentPage=e,this.currentPageSize=s,this.loadedRows=(await this.handlePagination(this.currentPage,this.currentPageSize)).items)}shouldSendPaginationRequest(e,s){return this.currentPage!==e||this.currentPageSize!==s}async loadRows(){return this.loadedRows=(await this.service.fetchRows()).items,this.loadedRows}getData(){return this.service.getData()}async handleSort(e){return await this.service.sort(e)}async handlePagination(e,s){return await this.service.paginate(e,s)}getItemCountPerPage(){return Ae.DEFAULT_ITEM_COUNT_PER_PAGE}isLoading(){const e=this.getLoadingStatuses();return e.has(y.Search)||e.has(y.FetchList)||e.has(y.Sort)||e.has(y.FetchLastItems)||e.has(y.FetchPreviousItems)}getLoadingStatuses(){return this.getData().loadingStatus}hasAnyAction(){for(const e of this.loadedRows)if(this.getAccessedActions(e).length)return!0;return!1}getAccessedActions(e){return this.filterItemsBaseOnAccessLevel(this.getActions(e))}getActions(e){return[]}getScrollDetail(){return null}isExpandable(){return!1}async handleClick(e){}async handleMetaClick(e){}async handleDoubleClick(e){}async onDestroy(){}async loadHeader(){throw new Error("No header provided for the table.")}loadSummarySchema(){return{summaryTitle:"",summaryItems:[]}}}class R{constructor(e){this.observers=[],this.next(e)}attach(e){this.observers.push(e),this.notifyObject(e)}detach(e){this.observers=this.observers.filter(s=>s!==e)}notify(){for(const e of this.observers)this.notifyObject(e)}notifyObject(e){typeof e=="function"?e(this._value):e.update(this._value)}next(e){typeof e=="function"?this._value=e(this._value):this._value=e,this.notify()}getValue(){return this._value}}class ts extends et{constructor(e){super(e),this.selectedRows=new R(new Map),this.rowSelect=this.rowSelect.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.handlePagination=this.handlePagination.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRows=this.getSelectedRows.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}rowSelect(e){this.getSelectedRowsValue().has(e.id)?(this.getSelectedRowsValue().delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.loadedRows)this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRowsValue().size===this.currentPageSize||this.loadedRows.length===this.getSelectedRowsValue().size}async handlePagination(e,s){return this.clearAllSelectedItems(),await super.handlePagination(e,s)}async handleSort(e){return this.clearAllSelectedItems(),await super.handleSort(e)}clearAllSelectedItems(){this.selectedRows.getValue().clear(),this.selectedRows.next(this.selectedRows.getValue())}getSelectedRows(){return this.selectedRows}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}getSelectedRowsValue(){return this.selectedRows.getValue()}}function ss(t){return{...Qe,...t}}function as(t){return function(s,a){s.constructor.prototype.headers||(s.constructor.prototype.headers=[]),s.constructor.prototype.headers.push({path:a,...t})}}function rs(t){return function(s){async function a(){return s.prototype._table=this,s.prototype.headers}function i(d){const u=[],p=s.prototype.actions||[];for(const m of p){if(!m.isAvailable(d))continue;const h={handler:m.handler.bind(d),accessLevel:m.accessLevel,actionName:m.actionName};u.push(h)}return u}async function n(d){s.prototype.rowClick&&await s.prototype.rowClick.call(d)}async function o(){s.prototype.tableDestroy&&await s.prototype.tableDestroy()}t.prototype.loadHeader=a,t.prototype.getActions=i,t.prototype.handleClick=n,t.prototype.onDestroy=o}}function is(t){return function(s,a,i){s.constructor.prototype.actions||(s.constructor.prototype.actions=[]),t.handler=i.value,s.constructor.prototype.actions.push(t)}}function ns(){return function(e,s,a){e.constructor.prototype.tableDestroy=a.value}}function os(){return function(e,s,a){e.constructor.prototype.rowClick=a.value}}class ls{constructor(){this.observers=[]}attach(e){this.observers.push(e)}detach(e){this.observers=this.observers.filter(s=>s!==e)}notify(){for(const e of this.observers)e.update(this)}}class tt{constructor(e){this.rows=new R([]),this.headerSchema=new R([]),this.currentPage=new R(1),this.currentPageSize=new R(20),this.totalItems=new R(0),this.currentSortDetail=new R(new ye("id",O.DESC)),this.scrollDetail=new R(null),this.isExpandable=new R(!1),this.tableSource=e,this.accessService=G.GetInstance()}async load(){this.rows.next(await this.tableSource.loadRows()),this.headerSchema.next(this.filterItemsBaseOnAccessLevel(await this.tableSource.loadHeaderSchema()))}async paginate(e,s){this.shouldSendPaginationRequest(e,s)&&(this.currentPage.next(e),this.currentPageSize.next(s),this.rows.next(await this.tableSource.paginate(e,s)))}shouldSendPaginationRequest(e,s){return this.currentPage.getValue()!==e||this.currentPageSize.getValue()!==s}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail.next(e),this.rows.next(await this.tableSource.sort(e)))}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.getValue().key||e.order!==this.currentSortDetail.getValue().order}async handleClick(e){this.tableSource.onRowClick&&await this.tableSource.onRowClick()}async handleMetaClick(e){this.tableSource.onRowMetaClick&&await this.tableSource.onRowMetaClick}async handleDoubleClick(e){this.tableSource.onRowDoubleClick&&await this.tableSource.onRowDoubleClick()}hasAnyAction(){for(const e of this.rows.getValue())if(this.getRowActions(e).length)return!0;return!1}getRowActions(e){return this.filterItemsBaseOnAccessLevel(this.tableSource.loadRowActions(e))}loadSummarySchema(){return this.tableSource.loadSummarySchema?this.tableSource.loadSummarySchema():{summaryTitle:"",summaryItems:[]}}filterItemsBaseOnAccessLevel(e){return e.filter(s=>s.hasAccess?s.hasAccess():!0)}async onDestroy(){this.tableSource.onTableDestroy()}}class cs extends tt{constructor(e){super(e),this.selectedRows=new R(new Map),this.selectRow=this.selectRow.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}selectRow(e){const s=this.getSelectedRows();s.has(e.id)?(s.delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(s.set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.rows.getValue())this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRows().size===this.currentPageSize.getValue()||this.rows.getValue().length===this.getSelectedRows().size}clearAllSelectedItems(){this.getSelectedRows().clear(),this.selectedRows.next(this.selectedRows.getValue)}getSelectedRows(){return this.selectedRows.getValue()}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}}class us{constructor(){this.setCellComponentRegistry=this.setCellComponentRegistry.bind(this),this.getCellComponentRegistry=this.getCellComponentRegistry.bind(this)}setCellComponentRegistry(e){this.cellComponentRegistry=e}getCellComponentRegistry(){return this.cellComponentRegistry}}class hs{constructor(){this.registeredComponents=new Map}initialize(){this.registerComponents()}getRegisteredComponents(){return this.registeredComponents}}function ds(t){return function(s,a){s.constructor.prototype.headers||(s.constructor.prototype.headers=[]),s.constructor.prototype.headers.push({path:a,...t})}}function fs(t){return function(s){async function a(){return s.prototype.headers||[]}t.loadHeaderSchema=a}}function st(){const t=v.ref(new Map),e=v.ref(0),s=v.ref(null),a=v.computed(()=>Array.from(t.value.values()));function i(g){e.value=g}function n(g){for(const S of g)o(S)}function o(g){t.value.set(g.id,g)}function d(g){return s.value=t.value.get(g)||null,s.value}function u(g){const S=d(g);return S&&t.value.delete(g),!!S}function p(){t.value.clear()}function m(g){s.value=g}function h(){s.value=null}return{itemsAsArray:a,totalCount:e,currentItem:s,setTotalCount:i,addOrReplaceItems:n,getById:d,removeById:u,clearItems:p,setCurrentItem:m,clearCurrentItem:h}}class at{constructor(){this.pageNumber=1,this.itemCount=20,this.sortDetail=new ye("id",O.DESC),this.filters=[]}}class ms{constructor(e,s){this.items=e,this.totalItems=s}}class gs{constructor(e,s){this.shouldKeepSync=e,this.intervalInMillisecond=s}}const rt=new at;function it(){const t=v.ref(structuredClone(rt));function e(){t.value.pageNumber=t.value.pageNumber+1}function s(){t.value.pageNumber=t.value.pageNumber-1}function a(h){t.value.pageNumber=h}function i(h){t.value.itemCount=h}function n(h){t.value.sortDetail.key=h.key,t.value.sortDetail.order=h.order}function o(h){for(const g in h)d(g,h[g])}function d(h,g){const S=t.value.filters.findIndex(A=>A.key===h);S>-1?t.value.filters[S].value=g:t.value.filters.push({key:h,value:g})}function u(h){let g=t.value.filters;g=g.filter(S=>S.key!==h),t.value.filters=g}function p(){const h={page:t.value.pageNumber,count:t.value.itemCount};t.value.sortDetail&&(h.by=t.value.sortDetail.key,h.order=t.value.sortDetail.order);for(const g of t.value.filters)if(g.value)if(typeof g.value=="string"||typeof g.value=="number")h[g.key]=g.value;else{const S=JSON.stringify(g.value);S!=="[]"&&S!=="{}"&&(h[g.key]=S)}return h}function m(){t.value=structuredClone(rt)}return{params:t,setNextPage:e,setPreventPage:s,setPageNumber:a,setItemCount:i,setSortDetail:n,setFilter:d,removeFilter:u,getRequestParams:p,clearParam:m,setFiltersBaseOnRequestBody:o}}function nt(){const t=v.ref(new Set),e=v.computed(()=>t.value.has(y.FetchList)),s=v.computed(()=>t.value.has(y.FetchItem)),a=v.computed(()=>t.value.has(y.FetchLastItems)),i=v.computed(()=>t.value.has(y.FetchPreviousItems)),n=v.computed(()=>t.value.has(y.Create)),o=v.computed(()=>t.value.has(y.Update)),d=v.computed(()=>t.value.has(y.Delete)),u=v.computed(()=>t.value.has(y.Search)),p=v.computed(()=>t.value.has(y.Sort));function m(g){t.value.add(g)}function h(g){t.value.delete(g)}return{loadingStatus:t,isFetchingList:e,isFetchingItem:s,isFetchingLastItems:a,isFetchingPreviousItems:i,isCreating:n,isUpdating:o,isDeleting:d,isSearching:u,isSorting:p,setStatus:m,removeStatus:h}}function vs(t){const e=st(),s=it(),a=nt(),i=new _e({runAction:async()=>h(y.AutoRefresh)}),n=v.computed(()=>{const l=s.params.value.pageNumber,c=s.params.value.itemCount,f=l*c-c,w=l*c-1,b=[];for(let I=f;I<=w&&e.itemsAsArray.value[I];I++)b.push(e.itemsAsArray.value[I]);return b}),o=v.computed(()=>({totalItems:e.totalCount.value,currentPage:s.params.value.pageNumber,rows:e.itemsAsArray.value,loadingStatus:a.loadingStatus.value,currentPageItems:n.value})),d=v.computed(()=>({getData:p,sort:se,paginate:pe,fetchRows:h})),u=v.computed(()=>t.getSyncDetail());function p(){return o.value}async function m(l){const c=await t.fetchList(l);return e.clearItems(),e.addOrReplaceItems(c.items),e.setTotalCount(c.totalItems),c}async function h(l=y.FetchList){a.setStatus(l);const c=await m(s.getRequestParams());return a.removeStatus(l),c}async function g(){S(),await h()}function S(){if(!u.value.shouldKeepSync)throw new Error("The provided repository does not support auto refresh");i.setupInterval(u.value.intervalInMillisecond)}function A(){i.clearInterval()}async function W(l,c=!0){a.setStatus(y.FetchItem),c&&e.clearCurrentItem();const f=await t.fetchItemById(l);return e.setCurrentItem(f),a.removeStatus(y.FetchItem),f}async function x(l){a.setStatus(y.Create);const c=await t.createItem(l);return c&&e.addOrReplaceItems([c]),a.removeStatus(y.Create),c}async function K(l,c){a.setStatus(y.Update);const f=await t.updateItem(l,c);return f&&e.addOrReplaceItems([f]),a.removeStatus(y.Update),f}async function Z(l){return a.setStatus(y.Delete),await t.deleteItem(l),a.removeStatus(y.Delete),e.removeById(l)}async function Pe(){s.setNextPage(),a.setStatus(y.FetchLastItems);const l=await m(s.getRequestParams());return a.removeStatus(y.FetchLastItems),l}async function Ve(){s.setPreventPage(),a.setStatus(y.FetchPreviousItems);const l=await m(s.getRequestParams());return a.removeStatus(y.FetchPreviousItems),l}async function pe(l){s.setPageNumber(l),a.setStatus(y.FetchList);const c=await m(s.getRequestParams());return a.removeStatus(y.FetchList),c}async function $e(l){s.setFilter("search",l),a.setStatus(y.Search),e.clearItems();const c=await m(s.getRequestParams());return a.removeStatus(y.Search),c}async function se(l){s.setSortDetail(l),a.setStatus(y.Sort),e.clearItems();const c=await m(s.getRequestParams());return a.removeStatus(y.Sort),c}async function X(){return s.clearParam(),await h()}return v.onBeforeUnmount(()=>{A()}),{loadingStatusManager:a,dataManger:e,paramsManager:s,tableRenderingData:o,fetchList:h,fetchWithAutoRefresh:g,setupAutoRefresh:S,stopAutoRefresh:A,fetchItemById:W,createItem:x,updateItem:K,deleteItem:Z,fetchLastItems:Pe,fetchPreviousItems:Ve,fetchItemsByPageNumber:pe,search:$e,sort:se,clearFilters:X,tableService:d,currentPageItems:n}}function ys(t){const e=v.ref(t),s=v.computed(()=>({getData(){return{totalItems:e.value.length,currentPageItems:e.value,loadingStatus:new Set,rows:e.value,currentPage:1}},async sort(a){return{totalItems:e.value.length,items:e.value}},async fetchRows(){return{totalItems:e.value.length,items:e.value}},async paginate(a,i){return{totalItems:e.value.length,items:e.value}}}));return{tableRows:e,staticTableService:s}}function ps(){const t=v.ref(new Map),e=v.ref(0),s=v.computed(()=>e.value),a=v.computed(()=>Array.from(t.value.values()));function i(m){e.value=m}function n(m){for(const h of m)o(h)}function o(m){t.value.set(String(m.id),m)}function d(m){const h=u(m);return t.value.delete(String(m)),h}function u(m){return t.value.get(String(m))||null}function p(){t.value.clear()}return{entityItemsAsArray:a,addOrReplaceItems:n,removeById:d,getItemById:u,clearItems:p,setTotalCount:i,getTotalCount:s}}class Ss{constructor(e,s=500){this.timerId=null,this.debounceTimeout=s,this.action=e}runAction(){this.cancelDebounce(),this.action.runImmediate(),this.timerId=setTimeout(()=>{this.action.runDebounce()},this.debounceTimeout)}cancelDebounce(){this.timerId&&clearTimeout(this.timerId)}}function Is(t){return function(e,s,a){const i=a.value;a.value=async function(...n){try{return await i.apply(this,n)}catch(o){for(const d of t)await d.handleError(o)}}}}function ws(t){return function(e,s,a){const i=a.value;a.value=async function(...n){try{const o=await i.apply(this,n);for(const d of t)d.shouldResolveSuccess(o)&&await d.handleSuccess(o);return o}catch(o){for(const d of t)d.shouldResolveFailure(o)&&await d.handleFailure(o)}}}}class bs{constructor(e,s,a=()=>!0,i=()=>!0){this.successMessageResolver=e,this.failureMessageResolver=s,this.shouldResolveSuccess=a,this.shouldResolveFailure=i}async handleSuccess(e){}async handleFailure(e){}async handleInfo(){}async handleWarning(){}}const T=class T{constructor(){}static GetInstance(){return T.instance||(T.instance=new T),T.instance}static registerHandler(e,s){T.handlers.set(e,s)}handle(e){var i;const s=((i=e.response)==null?void 0:i.status)??0,a=T.handlers.get(s);a&&a.handleError(e)}};T.handlers=new Map,T.instance=null;let Te=T;class As{constructor(e){this.axiosInstance=e}setBaseURL(e){return this.axiosInstance.defaults.baseURL=e,this}setTimeout(e){return this.axiosInstance.defaults.timeout=e,this}setHeaders(e){return this.axiosInstance.defaults.headers.common=e,this}attachRequestInterceptors(e){return this.axiosInstance.interceptors.request.use(s=>{for(const a of e)a.intercept(s);return s},s=>Promise.reject(s)),this}attachResponseInterceptors(e){return this.axiosInstance.interceptors.response.use(s=>s,s=>{throw e.handle(s),s}),this}build(){return this.axiosInstance}}class Ds{constructor(e){this.axiosInstance=e}async get(e,s){return await this.axiosInstance.get(e,s)}async post(e,s,a){return await this.axiosInstance.post(e,s,a)}async patch(e,s,a){return await this.axiosInstance.patch(e,s,a)}async put(e,s,a){return await this.axiosInstance.put(e,s,a)}async delete(e,s){return await this.axiosInstance.delete(e,s)}}class Ms{constructor(){this._initializer=[]}setupInitializers(e){this._initializer.push(...e)}initialize(){for(const e of this._initializer)e.initialize()}}const Y=class Y{constructor(){this.jsonConverter=new _.JsonConvert}serializeObject(e,s){return this.jsonConverter.serializeObject(e,s)}deserializeObject(e,s){return this.jsonConverter.deserializeObject(e,s)}deserializeArray(e,s){return this.jsonConverter.deserializeArray(e,s)}tryDeserialize(e,s){for(const a of s)try{return this.deserializeObject(e,a)}catch{}throw new Error("Unable to deserialize object")}static GetInstance(){return Y.Instance||(Y.Instance=new Y),Y.Instance}};Y.Instance=null;let Oe=Y;var ot=(t=>(t.Success="success",t.Failure="error",t.Info="info",t.Warning="warning",t))(ot||{}),Ee=(t=>(t.BottomLeft="bottomLeft",t.TopLeft="topLeft",t))(Ee||{});class _s{constructor(e,s,a){this.placement=Ee.BottomLeft,this.type=e,this.message=s,this.description=a}}const Cs=Fe.defineStore(ge.Dialog,()=>{const t=v.reactive({dialogComponent:null,width:k.DefaultWidth,height:k.DefaultHeight,props:null,header:""}),e=v.computed(()=>!!t.dialogComponent),s=v.computed(()=>!!t.header);function a(u){t.dialogComponent=u}function i(u){t.header=u}function n(u){if(!e.value)throw new Error("there is no dialog to set props on");t.props=u}function o(u,p){if(!e.value)throw new Error("there is no dialog to set size on");if(u<k.MinimalAvailableSize)throw new Error("negative size not supported");p===k.Width?t.width=u:t.height=u}function d(){t.props=null,t.height=k.DefaultHeight,t.width=k.DefaultWidth,t.header="",t.dialogComponent=null}return{dialogData:t,openDialog:a,clearDialog:d,setSize:o,setDialogHeader:i,setProps:n,isDialogExists:e,hasDefaultHeader:s}}),Rs=Fe.defineStore(ge.Drawer,()=>{const t=v.ref(J.Close),e=v.computed(()=>t.value===J.Open);function s(){t.value=J.Close}function a(){t.value=J.Open}return{closeDrawer:s,openDrawer:a,isDrawerOpen:e}});class Ls{constructor(e){this.mapProcesses=new Map,this.processes=e,this.assignProcessManager()}assignProcessManager(){this.processes.addToManager(this)}setProcessToMap(e){this.mapProcesses.set(e.name,e)}async start(){await this.processes.execute()}async startFrom(e){const s=this.mapProcesses.get(e);if(!s)throw new Error(`Process ${e} not found`);await s.execute()}}class Ts{constructor(e,s){this.next=null,this.name=e,this.next=s}addToManager(e){e.setProcessToMap(this),this.next&&this.next.addToManager(e)}}class Os{constructor(){this.checkAccessibility=this.checkAccessibility.bind(this),this.isAccessible=this.isAccessible.bind(this),this.getDestinationRouteName=this.getDestinationRouteName.bind(this)}async checkAccessibility(e,s,a){if(await this.isAccessible(e,s)){a();return}if(await this.getDestinationRouteName()){a({name:await this.getDestinationRouteName()});return}if(await this.getDestinationRouteLocation(e,s)){a(await this.getDestinationRouteLocation(e,s));return}a(!1)}async getDestinationRouteName(){return""}async getDestinationRouteLocation(e,s){return null}}class Es{constructor(e,s,a){this.scheduler=new _e({runAction:async()=>{await this.fetchList()}}),this.repository=e,this.crudDataManagement=s,this.syncDetail=this.repository.getSyncDetail(),this.paramManager=a,this.syncListWithApi()}async fetchList(){const e=await this.repository.fetchList(this.paramManager.getRequestParams());return this.crudDataManagement.addOrReplaceItems(e.items),this.crudDataManagement.setTotalCount(e.totalItems),e}async fetchItemById(e){const s=await this.repository.fetchItemById(e);return s&&this.crudDataManagement.addOrReplaceItems([s]),s}async createItem(e){const s=await this.repository.createItem(e);return s&&!this.shouldRefreshListAfterCreate()&&this.crudDataManagement.addOrReplaceItems([s]),s&&this.shouldRefreshListAfterCreate()&&await this.fetchList(),s}shouldRefreshListAfterCreate(){return!0}async deleteItem(e){return await this.repository.deleteItem(e)?this.crudDataManagement.removeById(e):null}async updateItem(e,s){const a=await this.repository.updateItem(e,s);return this.shouldRefreshListAfterUpdate()&&a?(await this.fetchList(),this.crudDataManagement.getItemById(e)):a}shouldRefreshListAfterUpdate(){return!0}async removeItem(e){const s=await this.repository.deleteItem(e);return s&&this.shouldRefreshListAfterDelete()&&await this.fetchList(),s?this.crudDataManagement.removeById(e):null}shouldRefreshListAfterDelete(){return!1}syncListWithApi(){this.scheduler.clearInterval(),this.syncDetail.shouldKeepSync&&this.scheduler.setupInterval(this.syncDetail.intervalInMillisecond)}onDestroy(){this.crudDataManagement.clearItems(),this.clearInterval()}clearInterval(){this.scheduler.clearInterval()}}class lt{}class ks extends lt{search(e,s,a){const i=[];e:for(const n of e)for(const o of a(n))if(B.removeSpacesFromString(String(o).toLowerCase()).indexOf(B.removeSpacesFromString(String(s).toLowerCase()))>-1){i.push(n);continue e}return i}}var ke=(t=>(t.Hidden="hidden",t.Visible="visible",t))(ke||{});class Ps{constructor(e){this._visibilityControl=e,this.mangeVisibilityEvent()}mangeVisibilityEvent(){document.addEventListener("visibilitychange",e=>{document.visibilityState===ke.Hidden?this._visibilityControl.screenInvisible(e):this._visibilityControl.screenVisible(e)})}}var Vs=Object.defineProperty,$s=Object.getOwnPropertyDescriptor,L=(t,e,s,a)=>{for(var i=a>1?void 0:a?$s(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=(a?o(e,s,i):o(i))||i);return a&&i&&Vs(e,s,i),i};r.Amount=class{constructor(){this.value="",this.symbol=""}get tradeValueInNumber(){return Number(this.value)}get truncatedValue(){return this.tradeValueInNumber.toLocaleString("en-US",{maximumFractionDigits:8})}},L([_.JsonProperty("value",String,!0)],r.Amount.prototype,"value",2),L([_.JsonProperty("symbol",String)],r.Amount.prototype,"symbol",2),r.Amount=L([_.JsonObject("Amount")],r.Amount),r.BaseModel=class{getTable(){const e=Object.getPrototypeOf(this)._table;if(!e)throw new Error("No Table found for the model. are you sure decorated the model with @Table() ?");return e}},L([_.JsonProperty("id",Object)],r.BaseModel.prototype,"id",2),r.BaseModel=L([_.JsonObject("BaseModel")],r.BaseModel),r.MinifiedSymbolModel=class extends r.BaseModel{},L([_.JsonProperty("symbol",String)],r.MinifiedSymbolModel.prototype,"symbol",2),L([_.JsonProperty("enName",String)],r.MinifiedSymbolModel.prototype,"enName",2),L([_.JsonProperty("faName",String)],r.MinifiedSymbolModel.prototype,"faName",2),L([_.JsonProperty("image",String)],r.MinifiedSymbolModel.prototype,"image",2),r.MinifiedSymbolModel=L([_.JsonObject("MinifiedSymbolModel")],r.MinifiedSymbolModel);class Fs{constructor(e,s){this.requestedDate=e,this.executedDate=s}get requestedDateInJalali(){return C.mapUnixToDate(this.requestedDate,q.SimpleDate)}get requestedTime(){return C.mapUnixToDate(this.requestedDate,q.JustHour)}get executedDateInJalali(){return C.mapUnixToDate(this.executedDate,q.SimpleDate)}get executedDateTime(){return C.mapUnixToDate(this.executedDate,q.JustHour)}}class Bs{constructor(e,s){this.requestedAmount=e,this.executedAmount=s}}class Ns{constructor(e,s,a,i,n){this.symbolPrice=e,this.USDTPrice=s,this.symobl=a,this.symbolImage=i,this.USDTImage=n}get truncatedSymbolPrice(){return this.symbolPrice.toLocaleString("en-US",{maximumFractionDigits:8})}get truncatedUSDTPrice(){return this.USDTPrice.toLocaleString("en-US",{maximumFractionDigits:8})}}class Us{constructor(e,s){this.soldSymbol=e,this.buySymbol=s}}r.APIErrorHandlerRegistry=Te,r.AbstractSubject=ls,r.AccessControl=De,r.AccessLevel=G,r.Action=is,r.ApiBuilder=As,r.ApplicationDrawerStatus=J,r.ApplicationInitializer=Ms,r.AuthorizationDirective=Me,r.AuthorizationService=ve,r.BaseTable=et,r.BehaviorSubject=R,r.CellType=me,r.ClientArraySearch=ks,r.ClientSearch=lt,r.Column=as,r.CommonMaskFormats=re,r.CrudService=Es,r.DateConverter=F,r.DateDisabledOptions=Ut,r.DateFormat=q,r.DateFormats=Ue,r.DateTools=ee,r.DebounceService=Ss,r.DialogDimensions=k,r.EveryAccess=Yt,r.EveryLevelAuthorizationDirective=Ht,r.Feedback=bs,r.FetchListResponse=ms,r.FormManager=Zt,r.FormValidationStatus=te,r.Formatter=C,r.GColumn=ds,r.GTable=fs,r.HandleError=Is,r.HandleFeedback=ws,r.HeaderType=fe,r.HttpClient=Ds,r.InputControl=Wt,r.InputControlBuilder=xt,r.InputControlData=Ze,r.JsonMapper=Oe,r.LoadingStatus=y,r.Params=at,r.Process=Ts,r.ProcessManager=Ls,r.RangeValue=Nt,r.RouteGuard=Os,r.Scheduler=_e,r.SelectableTable=ts,r.SelectableTableGenerator=cs,r.SimpleSort=Le,r.SomeAccess=jt,r.SomeLevelsAuthorizationDirective=qt,r.SortDetail=ye,r.SortOrder=O,r.SortOrderTableHeader=We,r.Sorter=es,r.StatusCode=xe,r.StorageKeys=P,r.StoreNames=ge,r.SymbolInTrade=Us,r.SymbolPriceInTrade=Ns,r.Symbols=Ke,r.SyncDetail=gs,r.TABLE_ACTION_COLUMN=Qt,r.TABLE_COLUMN_DEFAULT_COLSPAN=Re,r.TABLE_COLUMN_DEFAULT_VALUES=Qe,r.TABLE_COLUMN_DEFAULT_WIDTH=Ce,r.Table=rs,r.TableCellComponentRegistry=hs,r.TableConfig=us,r.TableConstants=Ae,r.TableDestroy=ns,r.TableGenerator=tt,r.TableHeaderAlign=de,r.TableRowClick=os,r.ToastLocation=Ee,r.ToastMessage=_s,r.ToastType=ot,r.TouchSensitiveControl=Kt,r.TradeAmount=Bs,r.TradeDate=Fs,r.Util=B,r.VisibilityManager=Ps,r.VisibilityState=ke,r.cards=Be,r.generateHeader=ss,r.ibans=Ne,r.isEmpty=Xe,r.isLastItem=Jt,r.isOnlyOneItem=zt,r.setupJalaliDate=Ge,r.setupStore=Gt,r.useCrud=ps,r.useData=st,r.useDialogService=Cs,r.useDrawerService=Rs,r.useForm=Xt,r.useLoadingStatus=nt,r.useParams=it,r.useRepository=vs,r.useStaticTableService=ys,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
the initial data will be available after calling the [markAsInitial] method on this instance`)}markAsInitial(){this.initialData=structuredClone(v.toRaw(this.data))}setValidators(e){this._validators=e}getChangeSensitive(){return this.data.isChangeSensitive}setChangeSensitive(e){if(e&&this.data.shouldRemoveValidationMessageOnInteract)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.isChangeSensitive=e}getIsBlurSensitive(){return this.data.isBlurSensitive}setIsBlurSensitive(e){this.data.isBlurSensitive=e}getIsRequired(){return this.data.isRequired}setIsRequired(e){this.data.isRequired=e}getIsValid(){return this.data.isValid}setIsValid(e){this.data.isValid=e}getIsIncludeInRequestBody(){return this.data.isIncludeInRequestBody}setIsIncludeInRequestBody(e){this.data.isIncludeInRequestBody=e}getNotValidMessage(){return this.data.notValidMessage}setNotValidMessage(e){this.data.notValidMessage=e}getName(){return this.data.name}setName(e){this.data.name=e}setId(e){this._id=e}getId(){return this._id}getIsEmptySensitive(){return this.data.isEmptySensitive}setIsEmptySensitive(e){this.data.isEmptySensitive=e}setHasCustomValidationCheck(e){this.data.hasCustomValidationCheck=e}setShouldRemoveValidationOnInteract(e){if(e&&this.data.isChangeSensitive)throw new Error("Input control "+this.getName()+" can not be both change sensitive and remove validation meessage on interact");this.data.shouldRemoveValidationMessageOnInteract=e}getShouldRemoveValidationOnInteract(){return this.data.shouldRemoveValidationMessageOnInteract}hasCustomValidationCheck(){return this.data.hasCustomValidationCheck}set value(e){this.data.value=e,this.shouldRunValidation()&&this.runValidation(),this.getShouldRemoveValidationOnInteract()&&this.setNotValidMessage("")}get value(){return this.data.value}}class xt{constructor(e){this._inputControl=e}setValidators(e){return this._inputControl.setValidators(e),this}setChangeSensitive(){return this._inputControl.setChangeSensitive(!0),this}setRequired(){return this._inputControl.setIsRequired(!0),this}setValid(){return this._inputControl.setIsValid(!0),this}setBlurSensitive(){return this._inputControl.setIsBlurSensitive(!0),this}setId(e){return this._inputControl.setId(e),this}removeEmptySensitive(){return this._inputControl.setIsEmptySensitive(!1),this}setHasCustomValidationCheck(){return this._inputControl.setHasCustomValidationCheck(!0),this}removeErrorOnInteract(){return this._inputControl.setShouldRemoveValidationOnInteract(!0),this}build(){return this._inputControl}}class Kt{constructor(){this.mounted=(e,s)=>{s.value&&s.value.getIsBlurSensitive()&&(e.addEventListener("click",this.handleFocus.bind(this,s.value)),e.addEventListener("blur",this.handleBlur.bind(this,s.value),!0))},this.beforeUnMount=(e,s)=>{e.removeEventListener("blur",this.handleBlur.bind(this,s.value)),e.removeEventListener("click",this.handleFocus.bind(this,s.value))}}handleBlur(e){e.runValidation(!0)}handleFocus(e){e.value||e.getIsEmptySensitive()||e.setNotValidMessage("")}}class Zt{constructor(){this._inputControls=new Map,this._isValid=!1,this._id=Math.random()}getInputControlsAsArray(){return Array.from(this._inputControls.values())}async runValidation(e){let s=!0;for(const a of this.getInputControlsAsArray())if(e&&await a.runValidation(!0),!a.getIsValid()&&(s=!1,!e)){this._isValid=!1;return}this._isValid=s}addInputControls(e){for(const s of e)this._inputControls.set(s.getName(),s)}getInputControl(e){const s=this._inputControls.get(e);if(!s)throw new Error(`The provided input name (${e}}) has no controls.`);return s}resetControls(e){for(const s of e){const a=this._inputControls.get(s);a?a.reset():console.warn(`Provided input name ${s} has no controllers in this form`)}}resetAll(){for(const e of this.getInputControlsAsArray())e.reset()}createRequestBody(){const e={};for(const s of this.getInputControlsAsArray())s.getIsIncludeInRequestBody()&&(e[s.getName()]=s.value);return e}setIsValid(e){this._isValid=e}getIsValid(){return this._isValid}setId(e){this._id=e}getId(){return this._id}}function Xt(t,e=!1){const s=v.reactive(t),a=v.ref(te.Invalid);return v.watch(()=>s.getInputControlsAsArray(),()=>{e||(s.runValidation(),s.getIsValid()?a.value=te.Valid:a.value=te.Invalid)},{immediate:!0,deep:!0}),{reactiveForm:s,validationStatus:a}}class _e{constructor(e){this.timerId=null,this.setupInterval=this.setupInterval.bind(this),this.schedule=e}setupInterval(e){const s=this;this.timerId=setTimeout(async function a(){await s.schedule.runAction(),s.timerId=setTimeout(()=>{a()},e)},e)}clearInterval(){this.timerId&&clearInterval(this.timerId)}}const Ce="150px",Re=2,Qt={path:"id",key:"id",title:"عملیات",colspan:Re,width:Ce,cellType:me.ACTION,align:de.Center,headerType:fe.Text,accessLevel:null},Qe={width:Ce,align:de.Center,headerType:fe.Text,cellType:me.Text,colspan:Re};class ye{constructor(e,s){this.key=e,this.order=s}}class Le{aSort(e,s){return e.sort((a,i)=>{const n=a[s]??a,o=i[s]??i;if(typeof n=="string"&&typeof o=="string")return n.localeCompare(o);if(typeof n=="number"&&typeof o=="number")return n-o;throw new Error("Not supported data type")})}bSort(e,s){return e.sort((a,i)=>{const n=a[s]??a,o=i[s]??i;if(typeof n=="string"&&typeof o=="string")return o.localeCompare(n);if(typeof n=="number"&&typeof o=="number")return o-n;throw new Error("Not supported data type")})}}class es{arrayOfObjectSort(e,s,a,i=new Le){return a===O.ASC?i.aSort(e,s):i.bSort(e,s)}arraySort(e,s,a=new Le){return s===O.ASC?a.aSort(e):a.bSort(e)}}class et{constructor(e){this.currentPage=1,this.currentPageSize=20,this.currentSortDetail=new ye("id",O.DESC),this.loadedRows=[],this.headerSchema=[],this.service=e,this.accessService=G.GetInstance()}addHeader(e){this.headerSchema.push(e)}async load(){this.headerSchema=this.filterItemsBaseOnAccessLevel(await this.loadHeader()),await this.loadRows()}filterItemsBaseOnAccessLevel(e){return e.filter(s=>s.hasAccess?s.hasAccess():!0)}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail=e,this.loadedRows=(await this.handleSort(this.currentSortDetail)).items)}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.key||e.order!==this.currentSortDetail.order}async paginate(e,s){this.shouldSendPaginationRequest(e,s)&&(this.currentPage=e,this.currentPageSize=s,this.loadedRows=(await this.handlePagination(this.currentPage,this.currentPageSize)).items)}shouldSendPaginationRequest(e,s){return this.currentPage!==e||this.currentPageSize!==s}async loadRows(){return this.loadedRows=(await this.service.fetchRows()).items,this.loadedRows}getData(){return this.service.getData()}async handleSort(e){return await this.service.sort(e)}async handlePagination(e,s){return await this.service.paginate(e,s)}getItemCountPerPage(){return Ae.DEFAULT_ITEM_COUNT_PER_PAGE}isLoading(){const e=this.getLoadingStatuses();return e.has(y.Search)||e.has(y.FetchList)||e.has(y.Sort)||e.has(y.FetchLastItems)||e.has(y.FetchPreviousItems)}getLoadingStatuses(){return this.getData().loadingStatus}hasAnyAction(){for(const e of this.loadedRows)if(this.getAccessedActions(e).length)return!0;return!1}getAccessedActions(e){return this.filterItemsBaseOnAccessLevel(this.getActions(e))}getActions(e){return[]}getScrollDetail(){return null}isExpandable(){return!1}async handleClick(e){}async handleMetaClick(e){}async handleDoubleClick(e){}async onDestroy(){}async loadHeader(){throw new Error("No header provided for the table.")}loadSummarySchema(){return{summaryTitle:"",summaryItems:[]}}}class R{constructor(e){this.observers=[],this.next(e)}attach(e){this.observers.push(e),this.notifyObject(e)}detach(e){this.observers=this.observers.filter(s=>s!==e)}notify(){for(const e of this.observers)this.notifyObject(e)}notifyObject(e){typeof e=="function"?e(this._value):e.update(this._value)}next(e){typeof e=="function"?this._value=e(this._value):this._value=e,this.notify()}getValue(){return this._value}}class ts extends et{constructor(e){super(e),this.selectedRows=new R(new Map),this.rowSelect=this.rowSelect.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.handlePagination=this.handlePagination.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRows=this.getSelectedRows.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}rowSelect(e){this.getSelectedRowsValue().has(e.id)?(this.getSelectedRowsValue().delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.loadedRows)this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRowsValue().size===this.currentPageSize||this.loadedRows.length===this.getSelectedRowsValue().size}async handlePagination(e,s){return this.clearAllSelectedItems(),await super.handlePagination(e,s)}async handleSort(e){return this.clearAllSelectedItems(),await super.handleSort(e)}clearAllSelectedItems(){this.selectedRows.getValue().clear(),this.selectedRows.next(this.selectedRows.getValue())}getSelectedRows(){return this.selectedRows}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}getSelectedRowsValue(){return this.selectedRows.getValue()}}function ss(t){return{...Qe,...t}}function as(t){return function(s,a){s.constructor.prototype.headers||(s.constructor.prototype.headers=[]),s.constructor.prototype.headers.push({path:a,...t})}}function rs(t){return function(s){async function a(){return s.prototype._table=this,s.prototype.headers}function i(d){const u=[],p=s.prototype.actions||[];for(const m of p){if(!m.isAvailable(d))continue;const h={handler:m.handler.bind(d),accessLevel:m.accessLevel,actionName:m.actionName};u.push(h)}return u}async function n(d){s.prototype.rowClick&&await s.prototype.rowClick.call(d)}async function o(){s.prototype.tableDestroy&&await s.prototype.tableDestroy()}t.prototype.loadHeader=a,t.prototype.getActions=i,t.prototype.handleClick=n,t.prototype.onDestroy=o}}function is(t){return function(s,a,i){s.constructor.prototype.actions||(s.constructor.prototype.actions=[]),t.handler=i.value,s.constructor.prototype.actions.push(t)}}function ns(){return function(e,s,a){e.constructor.prototype.tableDestroy=a.value}}function os(){return function(e,s,a){e.constructor.prototype.rowClick=a.value}}class ls{constructor(){this.observers=[]}attach(e){this.observers.push(e)}detach(e){this.observers=this.observers.filter(s=>s!==e)}notify(){for(const e of this.observers)e.update(this)}}class tt{constructor(e){this.rows=new R([]),this.headerSchema=new R([]),this.currentPage=new R(1),this.currentPageSize=new R(20),this.totalItems=new R(0),this.currentSortDetail=new R(new ye("id",O.DESC)),this.scrollDetail=new R(null),this.isExpandable=new R(!1),this.tableSource=e,this.accessService=G.GetInstance()}async load(){this.rows.next(await this.tableSource.loadRows()),this.headerSchema.next(this.filterItemsBaseOnAccessLevel(await this.tableSource.loadHeaderSchema()))}async paginate(e,s){this.shouldSendPaginationRequest(e,s)&&(this.currentPage.next(e),this.currentPageSize.next(s),this.rows.next(await this.tableSource.paginate(e,s)))}shouldSendPaginationRequest(e,s){return this.currentPage.getValue()!==e||this.currentPageSize.getValue()!==s}async sort(e){this.shouldSendSortRequest(e)&&(this.currentSortDetail.next(e),this.rows.next(await this.tableSource.sort(e)))}shouldSendSortRequest(e){return e.key!==this.currentSortDetail.getValue().key||e.order!==this.currentSortDetail.getValue().order}async handleClick(e){this.tableSource.onRowClick&&await this.tableSource.onRowClick()}async handleMetaClick(e){this.tableSource.onRowMetaClick&&await this.tableSource.onRowMetaClick}async handleDoubleClick(e){this.tableSource.onRowDoubleClick&&await this.tableSource.onRowDoubleClick()}hasAnyAction(){for(const e of this.rows.getValue())if(this.getRowActions(e).length)return!0;return!1}getRowActions(e){return this.filterItemsBaseOnAccessLevel(this.tableSource.loadRowActions(e))}loadSummarySchema(){return this.tableSource.loadSummarySchema?this.tableSource.loadSummarySchema():{summaryTitle:"",summaryItems:[]}}filterItemsBaseOnAccessLevel(e){return e.filter(s=>s.hasAccess?s.hasAccess():!0)}async onDestroy(){this.tableSource.onTableDestroy()}}class cs extends tt{constructor(e){super(e),this.selectedRows=new R(new Map),this.selectRow=this.selectRow.bind(this),this.selectAll=this.selectAll.bind(this),this.isEveryRowSelected=this.isEveryRowSelected.bind(this),this.clearAllSelectedItems=this.clearAllSelectedItems.bind(this),this.getSelectedRowsAsArray=this.getSelectedRowsAsArray.bind(this),this.getSelectedRowIds=this.getSelectedRowIds.bind(this)}selectRow(e){const s=this.getSelectedRows();s.has(e.id)?(s.delete(e.id),this.selectedRows.next(this.selectedRows.getValue())):(s.set(e.id,e),this.selectedRows.next(this.selectedRows.getValue()))}selectAll(){if(this.isEveryRowSelected())this.clearAllSelectedItems();else for(const e of this.rows.getValue())this.selectedRows.getValue().set(e.id,e),this.selectedRows.next(this.selectedRows.getValue())}isEveryRowSelected(){return this.getSelectedRows().size===this.currentPageSize.getValue()||this.rows.getValue().length===this.getSelectedRows().size}clearAllSelectedItems(){this.getSelectedRows().clear(),this.selectedRows.next(this.selectedRows.getValue)}getSelectedRows(){return this.selectedRows.getValue()}getSelectedRowsAsArray(){return Array.from(this.selectedRows.getValue().values())}getSelectedRowIds(){return Array.from(this.selectedRows.getValue().keys())}}class us{constructor(){this.setCellComponentRegistry=this.setCellComponentRegistry.bind(this),this.getCellComponentRegistry=this.getCellComponentRegistry.bind(this)}setCellComponentRegistry(e){this.cellComponentRegistry=e}getCellComponentRegistry(){return this.cellComponentRegistry}}class hs{constructor(){this.registeredComponents=new Map}initialize(){this.registerComponents()}getRegisteredComponents(){return this.registeredComponents}}function ds(t){return function(s,a){s.constructor.prototype.headers||(s.constructor.prototype.headers=[]),s.constructor.prototype.headers.push({path:a,...t})}}function fs(t){return function(s){async function a(){return s.prototype.headers||[]}t.prototype.loadHeaderSchema=a}}function st(){const t=v.ref(new Map),e=v.ref(0),s=v.ref(null),a=v.computed(()=>Array.from(t.value.values()));function i(g){e.value=g}function n(g){for(const S of g)o(S)}function o(g){t.value.set(g.id,g)}function d(g){return s.value=t.value.get(g)||null,s.value}function u(g){const S=d(g);return S&&t.value.delete(g),!!S}function p(){t.value.clear()}function m(g){s.value=g}function h(){s.value=null}return{itemsAsArray:a,totalCount:e,currentItem:s,setTotalCount:i,addOrReplaceItems:n,getById:d,removeById:u,clearItems:p,setCurrentItem:m,clearCurrentItem:h}}class at{constructor(){this.pageNumber=1,this.itemCount=20,this.sortDetail=new ye("id",O.DESC),this.filters=[]}}class ms{constructor(e,s){this.items=e,this.totalItems=s}}class gs{constructor(e,s){this.shouldKeepSync=e,this.intervalInMillisecond=s}}const rt=new at;function it(){const t=v.ref(structuredClone(rt));function e(){t.value.pageNumber=t.value.pageNumber+1}function s(){t.value.pageNumber=t.value.pageNumber-1}function a(h){t.value.pageNumber=h}function i(h){t.value.itemCount=h}function n(h){t.value.sortDetail.key=h.key,t.value.sortDetail.order=h.order}function o(h){for(const g in h)d(g,h[g])}function d(h,g){const S=t.value.filters.findIndex(A=>A.key===h);S>-1?t.value.filters[S].value=g:t.value.filters.push({key:h,value:g})}function u(h){let g=t.value.filters;g=g.filter(S=>S.key!==h),t.value.filters=g}function p(){const h={page:t.value.pageNumber,count:t.value.itemCount};t.value.sortDetail&&(h.by=t.value.sortDetail.key,h.order=t.value.sortDetail.order);for(const g of t.value.filters)if(g.value)if(typeof g.value=="string"||typeof g.value=="number")h[g.key]=g.value;else{const S=JSON.stringify(g.value);S!=="[]"&&S!=="{}"&&(h[g.key]=S)}return h}function m(){t.value=structuredClone(rt)}return{params:t,setNextPage:e,setPreventPage:s,setPageNumber:a,setItemCount:i,setSortDetail:n,setFilter:d,removeFilter:u,getRequestParams:p,clearParam:m,setFiltersBaseOnRequestBody:o}}function nt(){const t=v.ref(new Set),e=v.computed(()=>t.value.has(y.FetchList)),s=v.computed(()=>t.value.has(y.FetchItem)),a=v.computed(()=>t.value.has(y.FetchLastItems)),i=v.computed(()=>t.value.has(y.FetchPreviousItems)),n=v.computed(()=>t.value.has(y.Create)),o=v.computed(()=>t.value.has(y.Update)),d=v.computed(()=>t.value.has(y.Delete)),u=v.computed(()=>t.value.has(y.Search)),p=v.computed(()=>t.value.has(y.Sort));function m(g){t.value.add(g)}function h(g){t.value.delete(g)}return{loadingStatus:t,isFetchingList:e,isFetchingItem:s,isFetchingLastItems:a,isFetchingPreviousItems:i,isCreating:n,isUpdating:o,isDeleting:d,isSearching:u,isSorting:p,setStatus:m,removeStatus:h}}function vs(t){const e=st(),s=it(),a=nt(),i=new _e({runAction:async()=>h(y.AutoRefresh)}),n=v.computed(()=>{const l=s.params.value.pageNumber,c=s.params.value.itemCount,f=l*c-c,w=l*c-1,b=[];for(let I=f;I<=w&&e.itemsAsArray.value[I];I++)b.push(e.itemsAsArray.value[I]);return b}),o=v.computed(()=>({totalItems:e.totalCount.value,currentPage:s.params.value.pageNumber,rows:e.itemsAsArray.value,loadingStatus:a.loadingStatus.value,currentPageItems:n.value})),d=v.computed(()=>({getData:p,sort:se,paginate:pe,fetchRows:h})),u=v.computed(()=>t.getSyncDetail());function p(){return o.value}async function m(l){const c=await t.fetchList(l);return e.clearItems(),e.addOrReplaceItems(c.items),e.setTotalCount(c.totalItems),c}async function h(l=y.FetchList){a.setStatus(l);const c=await m(s.getRequestParams());return a.removeStatus(l),c}async function g(){S(),await h()}function S(){if(!u.value.shouldKeepSync)throw new Error("The provided repository does not support auto refresh");i.setupInterval(u.value.intervalInMillisecond)}function A(){i.clearInterval()}async function W(l,c=!0){a.setStatus(y.FetchItem),c&&e.clearCurrentItem();const f=await t.fetchItemById(l);return e.setCurrentItem(f),a.removeStatus(y.FetchItem),f}async function x(l){a.setStatus(y.Create);const c=await t.createItem(l);return c&&e.addOrReplaceItems([c]),a.removeStatus(y.Create),c}async function K(l,c){a.setStatus(y.Update);const f=await t.updateItem(l,c);return f&&e.addOrReplaceItems([f]),a.removeStatus(y.Update),f}async function Z(l){return a.setStatus(y.Delete),await t.deleteItem(l),a.removeStatus(y.Delete),e.removeById(l)}async function Pe(){s.setNextPage(),a.setStatus(y.FetchLastItems);const l=await m(s.getRequestParams());return a.removeStatus(y.FetchLastItems),l}async function Ve(){s.setPreventPage(),a.setStatus(y.FetchPreviousItems);const l=await m(s.getRequestParams());return a.removeStatus(y.FetchPreviousItems),l}async function pe(l){s.setPageNumber(l),a.setStatus(y.FetchList);const c=await m(s.getRequestParams());return a.removeStatus(y.FetchList),c}async function $e(l){s.setFilter("search",l),a.setStatus(y.Search),e.clearItems();const c=await m(s.getRequestParams());return a.removeStatus(y.Search),c}async function se(l){s.setSortDetail(l),a.setStatus(y.Sort),e.clearItems();const c=await m(s.getRequestParams());return a.removeStatus(y.Sort),c}async function X(){return s.clearParam(),await h()}return v.onBeforeUnmount(()=>{A()}),{loadingStatusManager:a,dataManger:e,paramsManager:s,tableRenderingData:o,fetchList:h,fetchWithAutoRefresh:g,setupAutoRefresh:S,stopAutoRefresh:A,fetchItemById:W,createItem:x,updateItem:K,deleteItem:Z,fetchLastItems:Pe,fetchPreviousItems:Ve,fetchItemsByPageNumber:pe,search:$e,sort:se,clearFilters:X,tableService:d,currentPageItems:n}}function ys(t){const e=v.ref(t),s=v.computed(()=>({getData(){return{totalItems:e.value.length,currentPageItems:e.value,loadingStatus:new Set,rows:e.value,currentPage:1}},async sort(a){return{totalItems:e.value.length,items:e.value}},async fetchRows(){return{totalItems:e.value.length,items:e.value}},async paginate(a,i){return{totalItems:e.value.length,items:e.value}}}));return{tableRows:e,staticTableService:s}}function ps(){const t=v.ref(new Map),e=v.ref(0),s=v.computed(()=>e.value),a=v.computed(()=>Array.from(t.value.values()));function i(m){e.value=m}function n(m){for(const h of m)o(h)}function o(m){t.value.set(String(m.id),m)}function d(m){const h=u(m);return t.value.delete(String(m)),h}function u(m){return t.value.get(String(m))||null}function p(){t.value.clear()}return{entityItemsAsArray:a,addOrReplaceItems:n,removeById:d,getItemById:u,clearItems:p,setTotalCount:i,getTotalCount:s}}class Ss{constructor(e,s=500){this.timerId=null,this.debounceTimeout=s,this.action=e}runAction(){this.cancelDebounce(),this.action.runImmediate(),this.timerId=setTimeout(()=>{this.action.runDebounce()},this.debounceTimeout)}cancelDebounce(){this.timerId&&clearTimeout(this.timerId)}}function Is(t){return function(e,s,a){const i=a.value;a.value=async function(...n){try{return await i.apply(this,n)}catch(o){for(const d of t)await d.handleError(o)}}}}function ws(t){return function(e,s,a){const i=a.value;a.value=async function(...n){try{const o=await i.apply(this,n);for(const d of t)d.shouldResolveSuccess(o)&&await d.handleSuccess(o);return o}catch(o){for(const d of t)d.shouldResolveFailure(o)&&await d.handleFailure(o)}}}}class bs{constructor(e,s,a=()=>!0,i=()=>!0){this.successMessageResolver=e,this.failureMessageResolver=s,this.shouldResolveSuccess=a,this.shouldResolveFailure=i}async handleSuccess(e){}async handleFailure(e){}async handleInfo(){}async handleWarning(){}}const T=class T{constructor(){}static GetInstance(){return T.instance||(T.instance=new T),T.instance}static registerHandler(e,s){T.handlers.set(e,s)}handle(e){var i;const s=((i=e.response)==null?void 0:i.status)??0,a=T.handlers.get(s);a&&a.handleError(e)}};T.handlers=new Map,T.instance=null;let Te=T;class As{constructor(e){this.axiosInstance=e}setBaseURL(e){return this.axiosInstance.defaults.baseURL=e,this}setTimeout(e){return this.axiosInstance.defaults.timeout=e,this}setHeaders(e){return this.axiosInstance.defaults.headers.common=e,this}attachRequestInterceptors(e){return this.axiosInstance.interceptors.request.use(s=>{for(const a of e)a.intercept(s);return s},s=>Promise.reject(s)),this}attachResponseInterceptors(e){return this.axiosInstance.interceptors.response.use(s=>s,s=>{throw e.handle(s),s}),this}build(){return this.axiosInstance}}class Ds{constructor(e){this.axiosInstance=e}async get(e,s){return await this.axiosInstance.get(e,s)}async post(e,s,a){return await this.axiosInstance.post(e,s,a)}async patch(e,s,a){return await this.axiosInstance.patch(e,s,a)}async put(e,s,a){return await this.axiosInstance.put(e,s,a)}async delete(e,s){return await this.axiosInstance.delete(e,s)}}class Ms{constructor(){this._initializer=[]}setupInitializers(e){this._initializer.push(...e)}initialize(){for(const e of this._initializer)e.initialize()}}const Y=class Y{constructor(){this.jsonConverter=new _.JsonConvert}serializeObject(e,s){return this.jsonConverter.serializeObject(e,s)}deserializeObject(e,s){return this.jsonConverter.deserializeObject(e,s)}deserializeArray(e,s){return this.jsonConverter.deserializeArray(e,s)}tryDeserialize(e,s){for(const a of s)try{return this.deserializeObject(e,a)}catch{}throw new Error("Unable to deserialize object")}static GetInstance(){return Y.Instance||(Y.Instance=new Y),Y.Instance}};Y.Instance=null;let Oe=Y;var ot=(t=>(t.Success="success",t.Failure="error",t.Info="info",t.Warning="warning",t))(ot||{}),Ee=(t=>(t.BottomLeft="bottomLeft",t.TopLeft="topLeft",t))(Ee||{});class _s{constructor(e,s,a){this.placement=Ee.BottomLeft,this.type=e,this.message=s,this.description=a}}const Cs=Fe.defineStore(ge.Dialog,()=>{const t=v.reactive({dialogComponent:null,width:k.DefaultWidth,height:k.DefaultHeight,props:null,header:""}),e=v.computed(()=>!!t.dialogComponent),s=v.computed(()=>!!t.header);function a(u){t.dialogComponent=u}function i(u){t.header=u}function n(u){if(!e.value)throw new Error("there is no dialog to set props on");t.props=u}function o(u,p){if(!e.value)throw new Error("there is no dialog to set size on");if(u<k.MinimalAvailableSize)throw new Error("negative size not supported");p===k.Width?t.width=u:t.height=u}function d(){t.props=null,t.height=k.DefaultHeight,t.width=k.DefaultWidth,t.header="",t.dialogComponent=null}return{dialogData:t,openDialog:a,clearDialog:d,setSize:o,setDialogHeader:i,setProps:n,isDialogExists:e,hasDefaultHeader:s}}),Rs=Fe.defineStore(ge.Drawer,()=>{const t=v.ref(J.Close),e=v.computed(()=>t.value===J.Open);function s(){t.value=J.Close}function a(){t.value=J.Open}return{closeDrawer:s,openDrawer:a,isDrawerOpen:e}});class Ls{constructor(e){this.mapProcesses=new Map,this.processes=e,this.assignProcessManager()}assignProcessManager(){this.processes.addToManager(this)}setProcessToMap(e){this.mapProcesses.set(e.name,e)}async start(){await this.processes.execute()}async startFrom(e){const s=this.mapProcesses.get(e);if(!s)throw new Error(`Process ${e} not found`);await s.execute()}}class Ts{constructor(e,s){this.next=null,this.name=e,this.next=s}addToManager(e){e.setProcessToMap(this),this.next&&this.next.addToManager(e)}}class Os{constructor(){this.checkAccessibility=this.checkAccessibility.bind(this),this.isAccessible=this.isAccessible.bind(this),this.getDestinationRouteName=this.getDestinationRouteName.bind(this)}async checkAccessibility(e,s,a){if(await this.isAccessible(e,s)){a();return}if(await this.getDestinationRouteName()){a({name:await this.getDestinationRouteName()});return}if(await this.getDestinationRouteLocation(e,s)){a(await this.getDestinationRouteLocation(e,s));return}a(!1)}async getDestinationRouteName(){return""}async getDestinationRouteLocation(e,s){return null}}class Es{constructor(e,s,a){this.scheduler=new _e({runAction:async()=>{await this.fetchList()}}),this.repository=e,this.crudDataManagement=s,this.syncDetail=this.repository.getSyncDetail(),this.paramManager=a,this.syncListWithApi()}async fetchList(){const e=await this.repository.fetchList(this.paramManager.getRequestParams());return this.crudDataManagement.addOrReplaceItems(e.items),this.crudDataManagement.setTotalCount(e.totalItems),e}async fetchItemById(e){const s=await this.repository.fetchItemById(e);return s&&this.crudDataManagement.addOrReplaceItems([s]),s}async createItem(e){const s=await this.repository.createItem(e);return s&&!this.shouldRefreshListAfterCreate()&&this.crudDataManagement.addOrReplaceItems([s]),s&&this.shouldRefreshListAfterCreate()&&await this.fetchList(),s}shouldRefreshListAfterCreate(){return!0}async deleteItem(e){return await this.repository.deleteItem(e)?this.crudDataManagement.removeById(e):null}async updateItem(e,s){const a=await this.repository.updateItem(e,s);return this.shouldRefreshListAfterUpdate()&&a?(await this.fetchList(),this.crudDataManagement.getItemById(e)):a}shouldRefreshListAfterUpdate(){return!0}async removeItem(e){const s=await this.repository.deleteItem(e);return s&&this.shouldRefreshListAfterDelete()&&await this.fetchList(),s?this.crudDataManagement.removeById(e):null}shouldRefreshListAfterDelete(){return!1}syncListWithApi(){this.scheduler.clearInterval(),this.syncDetail.shouldKeepSync&&this.scheduler.setupInterval(this.syncDetail.intervalInMillisecond)}onDestroy(){this.crudDataManagement.clearItems(),this.clearInterval()}clearInterval(){this.scheduler.clearInterval()}}class lt{}class ks extends lt{search(e,s,a){const i=[];e:for(const n of e)for(const o of a(n))if(B.removeSpacesFromString(String(o).toLowerCase()).indexOf(B.removeSpacesFromString(String(s).toLowerCase()))>-1){i.push(n);continue e}return i}}var ke=(t=>(t.Hidden="hidden",t.Visible="visible",t))(ke||{});class Ps{constructor(e){this._visibilityControl=e,this.mangeVisibilityEvent()}mangeVisibilityEvent(){document.addEventListener("visibilitychange",e=>{document.visibilityState===ke.Hidden?this._visibilityControl.screenInvisible(e):this._visibilityControl.screenVisible(e)})}}var Vs=Object.defineProperty,$s=Object.getOwnPropertyDescriptor,L=(t,e,s,a)=>{for(var i=a>1?void 0:a?$s(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=(a?o(e,s,i):o(i))||i);return a&&i&&Vs(e,s,i),i};r.Amount=class{constructor(){this.value="",this.symbol=""}get tradeValueInNumber(){return Number(this.value)}get truncatedValue(){return this.tradeValueInNumber.toLocaleString("en-US",{maximumFractionDigits:8})}},L([_.JsonProperty("value",String,!0)],r.Amount.prototype,"value",2),L([_.JsonProperty("symbol",String)],r.Amount.prototype,"symbol",2),r.Amount=L([_.JsonObject("Amount")],r.Amount),r.BaseModel=class{getTable(){const e=Object.getPrototypeOf(this)._table;if(!e)throw new Error("No Table found for the model. are you sure decorated the model with @Table() ?");return e}},L([_.JsonProperty("id",Object)],r.BaseModel.prototype,"id",2),r.BaseModel=L([_.JsonObject("BaseModel")],r.BaseModel),r.MinifiedSymbolModel=class extends r.BaseModel{},L([_.JsonProperty("symbol",String)],r.MinifiedSymbolModel.prototype,"symbol",2),L([_.JsonProperty("enName",String)],r.MinifiedSymbolModel.prototype,"enName",2),L([_.JsonProperty("faName",String)],r.MinifiedSymbolModel.prototype,"faName",2),L([_.JsonProperty("image",String)],r.MinifiedSymbolModel.prototype,"image",2),r.MinifiedSymbolModel=L([_.JsonObject("MinifiedSymbolModel")],r.MinifiedSymbolModel);class Fs{constructor(e,s){this.requestedDate=e,this.executedDate=s}get requestedDateInJalali(){return C.mapUnixToDate(this.requestedDate,q.SimpleDate)}get requestedTime(){return C.mapUnixToDate(this.requestedDate,q.JustHour)}get executedDateInJalali(){return C.mapUnixToDate(this.executedDate,q.SimpleDate)}get executedDateTime(){return C.mapUnixToDate(this.executedDate,q.JustHour)}}class Bs{constructor(e,s){this.requestedAmount=e,this.executedAmount=s}}class Ns{constructor(e,s,a,i,n){this.symbolPrice=e,this.USDTPrice=s,this.symobl=a,this.symbolImage=i,this.USDTImage=n}get truncatedSymbolPrice(){return this.symbolPrice.toLocaleString("en-US",{maximumFractionDigits:8})}get truncatedUSDTPrice(){return this.USDTPrice.toLocaleString("en-US",{maximumFractionDigits:8})}}class Us{constructor(e,s){this.soldSymbol=e,this.buySymbol=s}}r.APIErrorHandlerRegistry=Te,r.AbstractSubject=ls,r.AccessControl=De,r.AccessLevel=G,r.Action=is,r.ApiBuilder=As,r.ApplicationDrawerStatus=J,r.ApplicationInitializer=Ms,r.AuthorizationDirective=Me,r.AuthorizationService=ve,r.BaseTable=et,r.BehaviorSubject=R,r.CellType=me,r.ClientArraySearch=ks,r.ClientSearch=lt,r.Column=as,r.CommonMaskFormats=re,r.CrudService=Es,r.DateConverter=F,r.DateDisabledOptions=Ut,r.DateFormat=q,r.DateFormats=Ue,r.DateTools=ee,r.DebounceService=Ss,r.DialogDimensions=k,r.EveryAccess=Yt,r.EveryLevelAuthorizationDirective=Ht,r.Feedback=bs,r.FetchListResponse=ms,r.FormManager=Zt,r.FormValidationStatus=te,r.Formatter=C,r.GColumn=ds,r.GTable=fs,r.HandleError=Is,r.HandleFeedback=ws,r.HeaderType=fe,r.HttpClient=Ds,r.InputControl=Wt,r.InputControlBuilder=xt,r.InputControlData=Ze,r.JsonMapper=Oe,r.LoadingStatus=y,r.Params=at,r.Process=Ts,r.ProcessManager=Ls,r.RangeValue=Nt,r.RouteGuard=Os,r.Scheduler=_e,r.SelectableTable=ts,r.SelectableTableGenerator=cs,r.SimpleSort=Le,r.SomeAccess=jt,r.SomeLevelsAuthorizationDirective=qt,r.SortDetail=ye,r.SortOrder=O,r.SortOrderTableHeader=We,r.Sorter=es,r.StatusCode=xe,r.StorageKeys=P,r.StoreNames=ge,r.SymbolInTrade=Us,r.SymbolPriceInTrade=Ns,r.Symbols=Ke,r.SyncDetail=gs,r.TABLE_ACTION_COLUMN=Qt,r.TABLE_COLUMN_DEFAULT_COLSPAN=Re,r.TABLE_COLUMN_DEFAULT_VALUES=Qe,r.TABLE_COLUMN_DEFAULT_WIDTH=Ce,r.Table=rs,r.TableCellComponentRegistry=hs,r.TableConfig=us,r.TableConstants=Ae,r.TableDestroy=ns,r.TableGenerator=tt,r.TableHeaderAlign=de,r.TableRowClick=os,r.ToastLocation=Ee,r.ToastMessage=_s,r.ToastType=ot,r.TouchSensitiveControl=Kt,r.TradeAmount=Bs,r.TradeDate=Fs,r.Util=B,r.VisibilityManager=Ps,r.VisibilityState=ke,r.cards=Be,r.generateHeader=ss,r.ibans=Ne,r.isEmpty=Xe,r.isLastItem=Jt,r.isOnlyOneItem=zt,r.setupJalaliDate=Ge,r.setupStore=Gt,r.useCrud=ps,r.useData=st,r.useDialogService=Cs,r.useDrawerService=Rs,r.useForm=Xt,r.useLoadingStatus=nt,r.useParams=it,r.useRepository=vs,r.useStaticTableService=ys,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|