| Current Path : /home/users/unlimited/www/whatsjet-saas/Source/public/dist/js/ |
| Current File : /home/users/unlimited/www/whatsjet-saas/Source/public/dist/js/jsware.js |
var dbits,canary=0xdeadbeefcafe,j_lm=15715070==(16777215&canary);function BigInteger(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function nbi(){return new BigInteger(null)}function am1(t,e,r,n,i,o){for(;--o>=0;){var a=e*this[t++]+r[n]+i;i=Math.floor(a/67108864),r[n++]=67108863&a}return i}function am2(t,e,r,n,i,o){for(var a=32767&e,s=e>>15;--o>=0;){var l=32767&this[t],c=this[t++]>>15,u=s*l+c*a;i=((l=a*l+((32767&u)<<15)+r[n]+(1073741823&i))>>>30)+(u>>>15)+s*c+(i>>>30),r[n++]=1073741823&l}return i}function am3(t,e,r,n,i,o){for(var a=16383&e,s=e>>14;--o>=0;){var l=16383&this[t],c=this[t++]>>14,u=s*l+c*a;i=((l=a*l+((16383&u)<<14)+r[n]+i)>>28)+(u>>14)+s*c,r[n++]=268435455&l}return i}j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28),BigInteger.prototype.DB=dbits,BigInteger.prototype.DM=(1<<dbits)-1,BigInteger.prototype.DV=1<<dbits;var BI_FP=52;BigInteger.prototype.FV=Math.pow(2,BI_FP),BigInteger.prototype.F1=BI_FP-dbits,BigInteger.prototype.F2=2*dbits-BI_FP;var rr,vv,BI_RM="0123456789abcdefghijklmnopqrstuvwxyz",BI_RC=new Array;for(rr="0".charCodeAt(0),vv=0;vv<=9;++vv)BI_RC[rr++]=vv;for(rr="a".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;for(rr="A".charCodeAt(0),vv=10;vv<36;++vv)BI_RC[rr++]=vv;function int2char(t){return BI_RM.charAt(t)}function intAt(t,e){var r=BI_RC[t.charCodeAt(e)];return null==r?-1:r}function bnpCopyTo(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function bnpFromInt(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+DV:this.t=0}function nbv(t){var e=nbi();return e.fromInt(t),e}function bnpFromString(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,o=0;--n>=0;){var a=8==r?255&t[n]:intAt(t,n);a<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&128&t[0]&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&BigInteger.ZERO.subTo(this,this)}function bnpClamp(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function bnToString(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else if(64==t)e=6;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%e;if(a-- >0)for(s<this.DB&&(r=this[a]>>s)>0&&(i=!0,o=int2char(r));a>=0;)s<e?(r=(this[a]&(1<<s)-1)<<e-s,r|=this[--a]>>(s+=this.DB-e)):(r=this[a]>>(s-=e)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=int2char(r));return i?o:"0"}function bnNegate(){var t=nbi();return BigInteger.ZERO.subTo(this,t),t}function bnAbs(){return this.s<0?this.negate():this}function bnCompareTo(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0}function nbits(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}function bnpDRShiftTo(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}function bnpLShiftTo(t,e){var r,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,a=Math.floor(t/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+a+1]=this[r]>>i|s,s=(this[r]&o)<<n;for(r=a-1;r>=0;--r)e[r]=0;e[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()}function bnpRShiftTo(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var a=r+1;a<this.t;++a)e[a-r-1]|=(this[a]&o)<<i,e[a-r]=this[a]>>n;n>0&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}}function bnpSubTo(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()}function bnpMultiplyTo(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e[i]=0;for(i=0;i<n.t;++i)e[i+r.t]=r.am(0,n[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&BigInteger.ZERO.subTo(e,e)}function bnpSquareTo(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function bnpDivRemTo(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=nbi());var o=nbi(),a=this.s,s=t.s,l=this.DB-nbits(n[n.t-1]);l>0?(n.lShiftTo(l,o),i.lShiftTo(l,r)):(n.copyTo(o),i.copyTo(r));var c=o.t,u=o[c-1];if(0!=u){var d=u*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),p=this.FV/d,h=(1<<this.F1)/d,f=1<<this.F2,g=r.t,m=g-c,_=null==e?nbi():e;for(o.dlShiftTo(m,_),r.compareTo(_)>=0&&(r[r.t++]=1,r.subTo(_,r)),BigInteger.ONE.dlShiftTo(c,_),_.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--m>=0;){var b=r[--g]==u?this.DM:Math.floor(r[g]*p+(r[g-1]+f)*h);if((r[g]+=o.am(0,b,r,m,0,c))<b)for(o.dlShiftTo(m,_),r.subTo(_,r);r[g]<--b;)r.subTo(_,r)}null!=e&&(r.drShiftTo(c,e),a!=s&&BigInteger.ZERO.subTo(e,e)),r.t=c,r.clamp(),l>0&&r.rShiftTo(l,r),a<0&&BigInteger.ZERO.subTo(r,r)}}}function bnMod(t){var e=nbi();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(BigInteger.ZERO)>0&&t.subTo(e,e),e}function Classic(t){this.m=t}function cConvert(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function cRevert(t){return t}function cReduce(t){t.divRemTo(this.m,null,t)}function cMulTo(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function cSqrTo(t,e){t.squareTo(e),this.reduce(e)}function bnpInvDigit(){if(this.t<1)return 0;var t=this[0];if(!(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e}function Montgomery(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function montConvert(t){var e=nbi();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(BigInteger.ZERO)>0&&this.m.subTo(e,e),e}function montRevert(t){var e=nbi();return t.copyTo(e),this.reduce(e),e}function montReduce(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function montSqrTo(t,e){t.squareTo(e),this.reduce(e)}function montMulTo(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function bnpIsEven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpExp(t,e){if(t>4294967295||t<1)return BigInteger.ONE;var r=nbi(),n=nbi(),i=e.convert(this),o=nbits(t)-1;for(i.copyTo(r);--o>=0;)if(e.sqrTo(r,n),(t&1<<o)>0)e.mulTo(n,i,r);else{var a=r;r=n,n=a}return e.revert(r)}function bnModPowInt(t,e){var r;return r=t<256||e.isEven()?new Classic(e):new Montgomery(e),this.exp(t,r)}function bnClone(){var t=nbi();return this.copyTo(t),t}function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function bnByteValue(){return 0==this.t?this.s:this[0]<<24>>24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function bnSigNum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnpToRadix(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=nbv(r),i=nbi(),o=nbi(),a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(t).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(t)+a}function bnpFromRadix(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,o=0,a=0,s=0;s<t.length;++s){var l=intAt(t,s);l<0?"-"==t.charAt(s)&&0==this.signum()&&(i=!0):(a=e*a+l,++o>=r&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(a,0)),i&&BigInteger.ZERO.subTo(this,this)}function bnpFromNumber(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(t-1),op_or,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(BigInteger.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}}function bnToByteArray(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e}function bnEquals(t){return 0==this.compareTo(t)}function bnMin(t){return this.compareTo(t)<0?this:t}function bnMax(t){return this.compareTo(t)>0?this:t}function bnpBitwiseTo(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()}function op_and(t,e){return t&e}function bnAnd(t){var e=nbi();return this.bitwiseTo(t,op_and,e),e}function op_or(t,e){return t|e}function bnOr(t){var e=nbi();return this.bitwiseTo(t,op_or,e),e}function op_xor(t,e){return t^e}function bnXor(t){var e=nbi();return this.bitwiseTo(t,op_xor,e),e}function op_andnot(t,e){return t&~e}function bnAndNot(t){var e=nbi();return this.bitwiseTo(t,op_andnot,e),e}function bnNot(){for(var t=nbi(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function bnShiftLeft(t){var e=nbi();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function bnShiftRight(t){var e=nbi();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function lbit(t){if(0==t)return-1;var e=0;return 65535&t||(t>>=16,e+=16),255&t||(t>>=8,e+=8),15&t||(t>>=4,e+=4),3&t||(t>>=2,e+=2),1&t||++e,e}function bnGetLowestSetBit(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+lbit(this[t]);return this.s<0?this.t*this.DB:-1}function cbit(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function bnBitCount(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=cbit(this[r]^e);return t}function bnTestBit(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:!!(this[e]&1<<t%this.DB)}function bnpChangeBit(t,e){var r=BigInteger.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r}function bnSetBit(t){return this.changeBit(t,op_or)}function bnClearBit(t){return this.changeBit(t,op_andnot)}function bnFlipBit(t){return this.changeBit(t,op_xor)}function bnpAddTo(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()}function bnAdd(t){var e=nbi();return this.addTo(t,e),e}function bnSubtract(t){var e=nbi();return this.subTo(t,e),e}function bnMultiply(t){var e=nbi();return this.multiplyTo(t,e),e}function bnSquare(){var t=nbi();return this.squareTo(t),t}function bnDivide(t){var e=nbi();return this.divRemTo(t,e,null),e}function bnRemainder(t){var e=nbi();return this.divRemTo(t,null,e),e}function bnDivideAndRemainder(t){var e=nbi(),r=nbi();return this.divRemTo(t,e,r),new Array(e,r)}function bnpDMultiply(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function bnpDAddOffset(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function NullExp(){}function nNop(t){return t}function nMulTo(t,e,r){t.multiplyTo(e,r)}function nSqrTo(t,e){t.squareTo(e)}function bnPow(t){return this.exp(t,new NullExp)}function bnpMultiplyLowerTo(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()}function bnpMultiplyUpperTo(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)}function Barrett(t){this.r2=nbi(),this.q3=nbi(),BigInteger.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function barrettConvert(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=nbi();return t.copyTo(e),this.reduce(e),e}function barrettRevert(t){return t}function barrettReduce(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function barrettSqrTo(t,e){t.squareTo(e),this.reduce(e)}function barrettMulTo(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function bnModPow(t,e){var r,n,i=t.bitLength(),o=nbv(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new Classic(e):e.isEven()?new Barrett(e):new Montgomery(e);var a=new Array,s=3,l=r-1,c=(1<<r)-1;if(a[1]=n.convert(this),r>1){var u=nbi();for(n.sqrTo(a[1],u);s<=c;)a[s]=nbi(),n.mulTo(u,a[s-2],a[s]),s+=2}var d,p,h=t.t-1,f=!0,g=nbi();for(i=nbits(t[h])-1;h>=0;){for(i>=l?d=t[h]>>i-l&c:(d=(t[h]&(1<<i+1)-1)<<l-i,h>0&&(d|=t[h-1]>>this.DB+i-l)),s=r;!(1&d);)d>>=1,--s;if((i-=s)<0&&(i+=this.DB,--h),f)a[d].copyTo(o),f=!1;else{for(;s>1;)n.sqrTo(o,g),n.sqrTo(g,o),s-=2;s>0?n.sqrTo(o,g):(p=o,o=g,g=p),n.mulTo(g,a[d],o)}for(;h>=0&&!(t[h]&1<<i);)n.sqrTo(o,g),p=o,o=g,g=p,--i<0&&(i=this.DB-1,--h)}return n.revert(o)}function bnGCD(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r}function bnpModInt(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r}function bnModInverse(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return BigInteger.ZERO;for(var r=t.clone(),n=this.clone(),i=nbv(1),o=nbv(0),a=nbv(0),s=nbv(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(t,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),e?(a.isEven()&&s.isEven()||(a.addTo(this,a),s.subTo(t,s)),a.rShiftTo(1,a)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(a,i),o.subTo(s,o)):(n.subTo(r,n),e&&a.subTo(i,a),s.subTo(o,s))}return 0!=n.compareTo(BigInteger.ONE)?BigInteger.ZERO:s.compareTo(t)>=0?s.subtract(t):s.signum()<0?(s.addTo(t,s),s.signum()<0?s.add(t):s):s}Classic.prototype.convert=cConvert,Classic.prototype.revert=cRevert,Classic.prototype.reduce=cReduce,Classic.prototype.mulTo=cMulTo,Classic.prototype.sqrTo=cSqrTo,Montgomery.prototype.convert=montConvert,Montgomery.prototype.revert=montRevert,Montgomery.prototype.reduce=montReduce,Montgomery.prototype.mulTo=montMulTo,Montgomery.prototype.sqrTo=montSqrTo,BigInteger.prototype.copyTo=bnpCopyTo,BigInteger.prototype.fromInt=bnpFromInt,BigInteger.prototype.fromString=bnpFromString,BigInteger.prototype.clamp=bnpClamp,BigInteger.prototype.dlShiftTo=bnpDLShiftTo,BigInteger.prototype.drShiftTo=bnpDRShiftTo,BigInteger.prototype.lShiftTo=bnpLShiftTo,BigInteger.prototype.rShiftTo=bnpRShiftTo,BigInteger.prototype.subTo=bnpSubTo,BigInteger.prototype.multiplyTo=bnpMultiplyTo,BigInteger.prototype.squareTo=bnpSquareTo,BigInteger.prototype.divRemTo=bnpDivRemTo,BigInteger.prototype.invDigit=bnpInvDigit,BigInteger.prototype.isEven=bnpIsEven,BigInteger.prototype.exp=bnpExp,BigInteger.prototype.toString=bnToString,BigInteger.prototype.negate=bnNegate,BigInteger.prototype.abs=bnAbs,BigInteger.prototype.compareTo=bnCompareTo,BigInteger.prototype.bitLength=bnBitLength,BigInteger.prototype.mod=bnMod,BigInteger.prototype.modPowInt=bnModPowInt,BigInteger.ZERO=nbv(0),BigInteger.ONE=nbv(1),NullExp.prototype.convert=nNop,NullExp.prototype.revert=nNop,NullExp.prototype.mulTo=nMulTo,NullExp.prototype.sqrTo=nSqrTo,Barrett.prototype.convert=barrettConvert,Barrett.prototype.revert=barrettRevert,Barrett.prototype.reduce=barrettReduce,Barrett.prototype.mulTo=barrettMulTo,Barrett.prototype.sqrTo=barrettSqrTo;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];function bnIsProbablePrime(t){var e,r=this.abs();if(1==r.t&&r[0]<=lowprimes[lowprimes.length-1]){for(e=0;e<lowprimes.length;++e)if(r[0]==lowprimes[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<lowprimes.length;){for(var n=lowprimes[e],i=e+1;i<lowprimes.length&&n<lplim;)n*=lowprimes[i++];for(n=r.modInt(n);e<i;)if(n%lowprimes[e++]==0)return!1}return r.millerRabin(t)}function bnpMillerRabin(t){var e=this.subtract(BigInteger.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var n=e.shiftRight(r);(t=t+1>>1)>lowprimes.length&&(t=lowprimes.length);for(var i=nbi(),o=0;o<t;++o){i.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);var a=i.modPow(n,this);if(0!=a.compareTo(BigInteger.ONE)&&0!=a.compareTo(e)){for(var s=1;s++<r&&0!=a.compareTo(e);)if(0==(a=a.modPowInt(2,this)).compareTo(BigInteger.ONE))return!1;if(0!=a.compareTo(e))return!1}}return!0}function Arcfour(){this.i=0,this.j=0,this.S=new Array}function ARC4init(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0}function ARC4next(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}function prng_newstate(){return new Arcfour}BigInteger.prototype.chunkSize=bnpChunkSize,BigInteger.prototype.toRadix=bnpToRadix,BigInteger.prototype.fromRadix=bnpFromRadix,BigInteger.prototype.fromNumber=bnpFromNumber,BigInteger.prototype.bitwiseTo=bnpBitwiseTo,BigInteger.prototype.changeBit=bnpChangeBit,BigInteger.prototype.addTo=bnpAddTo,BigInteger.prototype.dMultiply=bnpDMultiply,BigInteger.prototype.dAddOffset=bnpDAddOffset,BigInteger.prototype.multiplyLowerTo=bnpMultiplyLowerTo,BigInteger.prototype.multiplyUpperTo=bnpMultiplyUpperTo,BigInteger.prototype.modInt=bnpModInt,BigInteger.prototype.millerRabin=bnpMillerRabin,BigInteger.prototype.clone=bnClone,BigInteger.prototype.intValue=bnIntValue,BigInteger.prototype.byteValue=bnByteValue,BigInteger.prototype.shortValue=bnShortValue,BigInteger.prototype.signum=bnSigNum,BigInteger.prototype.toByteArray=bnToByteArray,BigInteger.prototype.equals=bnEquals,BigInteger.prototype.min=bnMin,BigInteger.prototype.max=bnMax,BigInteger.prototype.and=bnAnd,BigInteger.prototype.or=bnOr,BigInteger.prototype.xor=bnXor,BigInteger.prototype.andNot=bnAndNot,BigInteger.prototype.not=bnNot,BigInteger.prototype.shiftLeft=bnShiftLeft,BigInteger.prototype.shiftRight=bnShiftRight,BigInteger.prototype.getLowestSetBit=bnGetLowestSetBit,BigInteger.prototype.bitCount=bnBitCount,BigInteger.prototype.testBit=bnTestBit,BigInteger.prototype.setBit=bnSetBit,BigInteger.prototype.clearBit=bnClearBit,BigInteger.prototype.flipBit=bnFlipBit,BigInteger.prototype.add=bnAdd,BigInteger.prototype.subtract=bnSubtract,BigInteger.prototype.multiply=bnMultiply,BigInteger.prototype.divide=bnDivide,BigInteger.prototype.remainder=bnRemainder,BigInteger.prototype.divideAndRemainder=bnDivideAndRemainder,BigInteger.prototype.modPow=bnModPow,BigInteger.prototype.modInverse=bnModInverse,BigInteger.prototype.pow=bnPow,BigInteger.prototype.gcd=bnGCD,BigInteger.prototype.isProbablePrime=bnIsProbablePrime,BigInteger.prototype.square=bnSquare,Arcfour.prototype.init=ARC4init,Arcfour.prototype.next=ARC4next;var rng_state,rng_pool,rng_pptr,rng_psize=256;function rng_seed_int(t){rng_pool[rng_pptr++]^=255&t,rng_pool[rng_pptr++]^=t>>8&255,rng_pool[rng_pptr++]^=t>>16&255,rng_pool[rng_pptr++]^=t>>24&255,rng_pptr>=rng_psize&&(rng_pptr-=rng_psize)}function rng_seed_time(){rng_seed_int((new Date).getTime())}if(null==rng_pool){var t;if(rng_pool=new Array,rng_pptr=0,window.crypto&&window.crypto.getRandomValues){var ua=new Uint8Array(32);for(window.crypto.getRandomValues(ua),t=0;t<32;++t)rng_pool[rng_pptr++]=ua[t]}if("Netscape"==navigator.appName&&navigator.appVersion<"5"&&window.crypto){var z=window.crypto.random(32);for(t=0;t<z.length;++t)rng_pool[rng_pptr++]=255&z.charCodeAt(t)}for(;rng_pptr<rng_psize;)t=Math.floor(65536*Math.random()),rng_pool[rng_pptr++]=t>>>8,rng_pool[rng_pptr++]=255&t;rng_pptr=0,rng_seed_time()}function rng_get_byte(){if(null==rng_state){for(rng_seed_time(),(rng_state=prng_newstate()).init(rng_pool),rng_pptr=0;rng_pptr<rng_pool.length;++rng_pptr)rng_pool[rng_pptr]=0;rng_pptr=0}return rng_state.next()}function rng_get_bytes(t){var e;for(e=0;e<t.length;++e)t[e]=rng_get_byte()}function SecureRandom(){}SecureRandom.prototype.nextBytes=rng_get_bytes;var RSAPublicKey=function(t,e){this.modulus=new BigInteger(Hex.encode(t),16),this.encryptionExponent=new BigInteger(Hex.encode(e),16)},UTF8={encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e},decode:function(t){for(var e="",r=0,n=$c1=$c2=0;r<t.length;)(n=t.charCodeAt(r))<128?(e+=String.fromCharCode(n),r++):n>191&&n<224?($c2=t.charCodeAt(r+1),e+=String.fromCharCode((31&n)<<6|63&$c2),r+=2):($c2=t.charCodeAt(r+1),$c3=t.charCodeAt(r+2),e+=String.fromCharCode((15&n)<<12|(63&$c2)<<6|63&$c3),r+=3);return e}},Base64={base64:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){if(!t)return!1;var e,r,n,i,o,a,s,l="",c=0;do{i=(e=t.charCodeAt(c++))>>2,o=(3&e)<<4|(r=t.charCodeAt(c++))>>4,a=(15&r)<<2|(n=t.charCodeAt(c++))>>6,s=63&n,isNaN(r)?a=s=64:isNaN(n)&&(s=64),l+=this.base64.charAt(i)+this.base64.charAt(o)+this.base64.charAt(a)+this.base64.charAt(s)}while(c<t.length);return l},decode:function(t){if(!t)return!1;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");var e,r,n,i,o="",a=0;do{e=this.base64.indexOf(t.charAt(a++)),r=this.base64.indexOf(t.charAt(a++)),n=this.base64.indexOf(t.charAt(a++)),i=this.base64.indexOf(t.charAt(a++)),o+=String.fromCharCode(e<<2|r>>4),64!=n&&(o+=String.fromCharCode((15&r)<<4|n>>2)),64!=i&&(o+=String.fromCharCode((3&n)<<6|i))}while(a<t.length);return o}},Hex={hex:"0123456789abcdef",encode:function(t){if(!t)return!1;var e,r="",n=0;do{e=t.charCodeAt(n++),r+=this.hex.charAt(e>>4&15)+this.hex.charAt(15&e)}while(n<t.length);return r},decode:function(t){if(!t)return!1;t=t.replace(/[^0-9abcdef]/g,"");var e="",r=0;do{e+=String.fromCharCode(this.hex.indexOf(t.charAt(r++))<<4&240|15&this.hex.indexOf(t.charAt(r++)))}while(r<t.length);return e}},ASN1Data=function(t){this.error=!1,this.parse=function(t){if(!t)return this.error=!0,null;for(var e=[];t.length>0;){var r=t.charCodeAt(0);t=t.substr(1);var n=0;if(5==(31&r))t=t.substr(1);else if(128&t.charCodeAt(0)){var i=127&t.charCodeAt(0);if(t=t.substr(1),i>0&&(n=t.charCodeAt(0)),i>1&&(n=n<<8|t.charCodeAt(1)),i>2)return this.error=!0,null;t=t.substr(i)}else n=t.charCodeAt(0),t=t.substr(1);var o="";if(n){if(n>t.length)return this.error=!0,null;o=t.substr(0,n),t=t.substr(n)}32&r?e.push(this.parse(o)):e.push(this.value(128&r?4:31&r,o))}return e},this.value=function(t,e){if(1==t)return!!e;if(2==t)return e;if(3==t)return this.parse(e.substr(1));if(5==t)return null;if(6==t){var r=[],n=e.charCodeAt(0);r.push(Math.floor(n/40)),r.push(n-40*r[0]);var i,o=[],a=0;for(i=1;i<e.length;i++){var s=e.charCodeAt(i);if(o.push(127&s),128&s)a++;else{var l,c=0;for(l=0;l<o.length;l++)c+=o[l]*Math.pow(128,a--);r.push(c),a=0,o=[]}}return r.join(".")}return null},this.data=this.parse(t)},RSA={getPublicKey:function(t){return!(t.length<50)&&("-----BEGIN PUBLIC KEY-----"==t.substr(0,26)&&("-----END PUBLIC KEY-----"==(t=t.substr(26)).substr(t.length-24)&&(t=t.substr(0,t.length-24),!(t=new ASN1Data(Base64.decode(t))).error&&("1.2.840.113549.1.1.1"==(t=t.data)[0][0][0]&&new RSAPublicKey(t[0][1][0][0],t[0][1][0][1])))))},encrypt:function(t,e){if(!e)return!1;var r=e.modulus.bitLength()+7>>3;if(!(t=this.pkcs1pad2(t,r)))return!1;if(!(t=t.modPowInt(e.encryptionExponent,e.modulus)))return!1;for(t=t.toString(16);t.length<2*r;)t="0"+t;return Base64.encode(Hex.decode(t))},decrypt:function(t,e){if(!e)return!1;for(t=Hex.encode(Base64.decode(t)).toString(16);"0"==t[0];)t=t.replace("0","");if(!(t=(t=new BigInteger(t,16)).modPowInt(e.encryptionExponent,e.modulus)))return!1;var r=e.modulus.bitLength()+7>>3;return t=this.pkcs1unpad2(t,r)},pkcs1pad2:function(t,e){if(e<t.length+11)return null;for(var r=new Array,n=t.length-1;n>=0&&e>0;){var i=t.charCodeAt(n--);i<128?r[--e]=i:i>127&&i<2048?(r[--e]=63&i|128,r[--e]=i>>6|192):(r[--e]=63&i|128,r[--e]=i>>6&63|128,r[--e]=i>>12|224)}r[--e]=0;for(var o=new SecureRandom,a=new Array;e>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);r[--e]=a[0]}return r[--e]=2,r[--e]=0,new BigInteger(r)},pkcs1unpad2:function(t,e){for(var r=t.toByteArray(),n=0;n<r.length&&0==r[n];)++n;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var o=255&r[n];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&o)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}};!function(t){"use strict";t.__InputSecurity={rsaDecrypt:function(t){return RSA.decrypt(t,__InputSecurity.getPublicRSA())},rsaEncrypt:function(t){return RSA.encrypt(t,__InputSecurity.getPublicRSA())},getPublicRSA:function(){return RSA.getPublicKey(t.__pbkey?t.__pbkey:"-----BEGIN PUBLIC KEY-----MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAPJwwNa//eaQYxkNsAODohg38azVtalEh7Lw4wxlBrbDONgYaebgscpjPRloeL0kj4aLI462lcQGVAxhyh8JijsCAwEAAQ==-----END PUBLIC KEY-----")},processSecuredData:function(t){if(t&&t.__maskedData){for(var e=t.__maskedData.split("__==__"),r="",n=0;n<e.length;n++)e[n]&&(r+=__InputSecurity.rsaDecrypt(e[n]));return JSON.parse(r)}return!1},processResponseData:function(t){var e=__InputSecurity.processSecuredData(t);return 0==e?t:e},processFormFields:function(t,e){if(t&&!_.isEmpty(t)){var r={};e||(e={}),e.secured=!0,e&&1==e.secured?_.forEach(t,(function(t,n){var i=__InputSecurity.rsaEncrypt(n);if(e.unsecuredFields&&!1!==_.includes(e.unsecuredFields,n)||!0!==_.isArray(t)&&!0!==_.isObject(t)||!0!==_.isEmpty(t))if(e.unsecuredFields&&!1!==_.includes(e.unsecuredFields,n)||!0!==_.isArray(t)&&!0!==_.isObject(t)||!1!==_.isEmpty(t)){if(e.unsecuredFields&&!1!==_.includes(e.unsecuredFields,n)||!0===_.isArray(t)||!0===_.isObject(t))r[n]=t;else if(t||0==t){(_.isBoolean(t)||_.isNumber(t))&&(t=String(t));var o=__InputSecurity.rsaEncrypt(t);if(0==o){for(var a=t.match(/.{1,30}/g),s="",l=0;l<a.length;l++){var c=__InputSecurity.rsaEncrypt(a[l]);if(0==c)throw"Encryption Failed for { "+n+" } VALUE due to length";s=s+c+"__==__"}o=s}if(0==i)throw"Encryption Failed for { "+i+" } KEY due to length";r[i]=o}}else r[i]=__InputSecurity.processFormFields(t);else r[i]=t})):r=t}return r}}}(window),function(t){"use strict";if(_.templateSettings.variable="__tData",t.__globals={translate_strings:{},default_show_message:!1},t.appConfig.locale)var e=new Intl.NumberFormat(t.appConfig.locale,{useGrouping:!1});else e=null;t.__Utils={log:function(e,r){if(t.appConfig&&t.appConfig.debug){var n="",i="";r&&_.isString(e)?(n=r,i="%c ",console.log(i+e,n)):console.log(e),n=i=null}},syntaxHighlight:function(t){return(t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,(function(t){var e="color: darkorange;";return/^"/.test(t)?e=/:$/.test(t)?"color: red;":"color: green;":/true|false/.test(t)?e="color: blue;":/null/.test(t)&&(e="color: magenta;"),'<span style="'+e+'">'+t+"</span>"}))},displayInTabWindow:function(e){if(t.appConfig&&t.appConfig.debug){if(e){var r="";_.isObject(e)?(_.has(e,"data")&&(r='<pre style="font-size:14px; outline: 1px solid #ccc; padding: 10px; margin: 0px;"><strong>URL: </strong>'+(e.config?e.config.url:"")+" <strong><br>Method: </strong>"+(e.config?e.config.method:"")+" <strong><br>statusText: </strong>"+e.statusText+" ("+e.status+') <strong style="color:red"><br>Error Message: '+e.data.message+"</strong></pre>"),r+='<pre style="outline: 1px solid #ccc; padding: 5px; margin: 0px;">'+__Utils.syntaxHighlight(JSON.stringify(e,null,4))+"</pre>"):r=e;var n=t.open("","_blank");n.document.write(r),n.document.close(),n.focus()}else console.log("__Utils: Text not found for window.");e=r=null}},openEmailDebugView:function(e){t.appConfig&&t.appConfig.debug&&(t.open(e,"__emailDebugView"),__Utils.info("Request Sent to open Email Debug View."))},error:function(e){t.appConfig&&t.appConfig.debug&&console.error(e)},info:function(e){t.appConfig&&t.appConfig.debug&&console.info(e)},warn:function(e){t.appConfig&&t.appConfig.debug&&console.warn(e)},throwError:function(e){if(t.appConfig&&t.appConfig.debug)throw new Error(e)},jsdd:function(e){if(t.appConfig&&t.appConfig.debug){if(e.__dd&&e.__pr&&!e.__prExecuted){var r=1;_.forEach(e.__pr,(function(t){var e="";console.log("%c Server __pr "+r+" --------------------------------------------------","color:#f0ad4e"),_.forEach(t,(function(t,r){"debug_backtrace"!==r?console.log(t):e=t})),console.log("%c Reference --------------------------------------------------","color:#f0ad4e"),console.log(e),r++})),e.__prExecuted=!0,console.log("%c ------------------------------------------------------------ __pr end","color: #f0ad4e")}if(e.__dd&&e.__clog&&(e.__clogExecuted||(__Utils.clog(e),e.__clogExecuted=!0)),e.__dd&&"__dd"===e.__dd){if(!e.__ddExecuted){console.log("%c Server __dd --------------------------------------------------","color:#ff0000");_.forEach(e.data,(function(t,e){"debug_backtrace"!==e?console.log(t):(console.log("%c Reference --------------------------------------------------","color:#ff0000"),console.log(t))})),e.__ddExecuted=!0}throw console.log("%c ------------------------------------------------------------ __dd end","color: #ff0000"),"------------------------------------------------------------ __dd end."}}},clog:function(t){if(!e)var e={__clogCount:0};var r=1,n=t.__clogType?t.__clogType:"";_.forEach(t.__clog,(function(t){_.forEach(t,(function(t){console.log("%c __clog "+n+" "+r+" --------------------------------------------------","color: #bada55"),console.log("%c "+t,"color: #9c9c9c"),r++,e.__clogCount++}))})),console.log("%c ------------------------------------------------------------ __clog "+n+" items end. TotalCount: "+e.__clogCount,"color: #bada55")},detectIE:function(){var e=t.navigator.userAgent,r=e.indexOf("MSIE ");if(r>0)return parseInt(e.substring(r+5,e.indexOf(".",r)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var i=e.indexOf("Edge/");return i>0&&parseInt(e.substring(i+5,e.indexOf(".",i)),10)},time:function(e){t.appConfig&&t.appConfig.debug&&(__Utils.detectIE()>=11||0==__Utils.detectIE())&&(console.time(e),e=null)},timeEnd:function(e){t.appConfig&&t.appConfig.debug&&(__Utils.detectIE()>=11||0==__Utils.detectIE())&&(console.timeEnd(e),e=null)},modalTemplatize:function(t,e,r,n){var i=$(t),o=$.Deferred(),a=i.data("modalEvent"),s=i.data("modalCloseEvent"),l=i.data("modalId"),c=(_.template(i.html()),i.data("replaceTarget"),{});return e?$(l).on((a||"show")+".bs.modal",(function(r){var n=$(t),i=_.template(n.html()),a=n.data("replaceTarget");"function"==typeof e?(c=e(r,$(r.relatedTarget).data()),o.resolve(c)):__Utils.error("responseCallback should be function"),$(a||"modal-body").html(i(c))})):o.resolve(c),n&&$(l).on("shown.bs.modal",(function(t){"function"==typeof n?n(t,c):__Utils.error("shownCallback should be function")})),r&&$(l).on((s||"hidden")+".bs.modal",(function(t){"function"==typeof r?r(t,c):__Utils.error("closeCallback should be function")})),i=s=l=c=null,o.promise()},queryConvertToObject:function(t){if(_.isString(t)){for(var e=t.replace("?","&").split("&"),r={},n=0,i=e.length;n<i;n++){var o=e[n].split("=");r[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t=e=null,r}return t},viewReload:function(){location.reload()},template:function(t,e){var r=$("script"+t).html();if(r){var n=_.template(r);return r=t=null,n(e)}return e},apiURL:function(t,e){return _.isString(t)?!_.isEmpty(e)&&_.isObject(e)&&_.forEach(e,(function(e,r){t=t.replace(r,e)})):__Utils.error("__Utils:: Invalid API url"),e=null,t},getTranslation:function(t,e){return __globals.translate_strings[t]?__globals.translate_strings[t]:e||t},setTranslation:function(t,e){return _.isObject(t)?(__globals.translate_strings=_.assign(__globals.translate_strings,t),t=e=null,!0):_.isString(t)&&e?(__globals.translate_strings[t]=e,t=e=null,!0):(t=e=null,!1)},lwReInitPlugins:function(e){var r=e.find("[data-lw-plugin]");r.length&&$.each(r,(function(e,r){var n=$(r);t.lwPluginFuncs[n.data("lw-plugin")]("[data-lw-plugin="+n.data("lw-plugin")+"]")})),e.find("[lwDataTable]").length&&t.initializeDatatable&&t.initializeDatatable()},formatAsLocaleNumber:function(t){return e&&_.isNumber(t)?e.format(t):t},generateUniqueId:function(t,e){e||(e=16),t||(t="");const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let t=0;t<e;t++){n+=r[Math.floor(62*Math.random())]}return t+n}},__globals.clog=__Utils.clog,t.__DataRequest={__formValidateInit:function(t){return $('[data-form-id="#'+t.prop("id")+'"].lw-validation-error').hide(),t.find("label.lw-validation-error").hide(),t.validate({errorClass:"lw-validation-error",errorPlacement:function(t,e){var r=$(e);$(".lw-error-container-"+r.prop("name")).length?$(".lw-error-container-"+r.prop("name")).addClass("lw-validation-error").html(t).show():r.siblings(".input-group-prepend").length||r.siblings(".input-group-append").length||r.parents(".input-group").length?t.insertAfter(r.parents(".input-group")).show():$(e).parent().hasClass("selectize-input")?t.insertAfter(r.parents(".selectize-input")).show():t.insertAfter(e).show(),r=t=null}}),t},__processSubmitForm:function(t,e){if(!(e=__DataRequest.__formValidateInit(e)).valid())return e.addClass("lw-form-has-errors").addClass(e.data("error-class")),!1;if(e.data("show-processing")){e.find(".lw-spinner-box").remove();var r=$('<div class="lw-spinner-box" style="display:none"><div class="text-center align-middle lw-spinner-box-inner"><div class="lds-ring"><div></div><div></div><div></div><div></div></div><div><div class="lw-spinner-box-text" x-cloak x-data={lwProgressText:"..."} x-text="lwProgressText"></div></div>');e.addClass("lw-form-in-process").prepend(r),_.defer((function(){r.css({"margin-left":.5*e.outerWidth()-.5*r.outerWidth(),"margin-top":.5*e.outerHeight()-.5*r.outerHeight()}),_.delay((function(){r.show()}),150)}))}t.data("action")&&e.attr("action",t.data("action")),__DataRequest.process(e).then((function(t){if(e.data("show-processing")){var r=t.responseJSON;21==r.reaction||r.response_action&&"redirect"==r.response_action.type||e.removeClass("lw-form-has-errors").removeClass("lw-form-in-process").removeClass(e.data("error-class")).find(".lw-spinner-box").remove()}}))},process:function(e){var r=e.is("form"),n=e.data("method")?e.data("method"):e.attr("method")?e.attr("method"):!0===r?"post":"get",i=e.data("unsecured-fields"),o=e.data("secured"),a=r?e.attr("action"):e.data("action")?e.data("action"):e.attr("href"),s={};if(i&&(s.unsecuredFields=i.split(",")),1==o)var l=__InputSecurity.processFormFields(__Utils.queryConvertToObject(!0===r?e.serialize():e.data("post-data")),s);else l=!0===r?e.serializeArray():e.data("post-data");var c=_.get(t,e.data("callback")),u={thisScope:e};_.isUndefined(c)&&(c=null),e.data("pre-callback")&&(u.preCallback=_.get(t,e.data("pre-callback"))),u.callbackParams=null,e.data("callback-params")&&(u.callbackParams=e.data("callbackParams")),e.data("showMessage")&&(u.showMessage=e.data("showMessage")),u.responseTemplate=null,e.data("responseTemplate")&&(u.responseTemplate=e.data("responseTemplate"));var d=__DataRequest.__protectedAjaxProcess(a,l,c,n,u);return r=n=i=o=a=s=s=l=c=u=null,d},post:function(t,e,r,n){if(e=e||{},r=r||null,!n)n={};var i=n.unsecuredFields?n.unsecuredFields:[],o=!!n.secured&&n.secured,a={};i&&(a.unsecuredFields=i),1==o&&(e=__InputSecurity.processFormFields(e,a));var s=__DataRequest.__protectedAjaxProcess(t,e,r,"post",n);return t=e=r=n=null,s},get:function(t,e,r,n){e=e||{},r=r||null;var i=__DataRequest.__protectedAjaxProcess(t,e,r,"get",n);return t=e=r=n=null,i},__protectedAjaxProcess:function(e,r,n,i,o){var a=$.Deferred();o||(o={}),r=__Utils.queryConvertToObject(r);var s=!1,l={},c=(o=_.assign({csrf:!0,thisScope:$(this),preCallback:null,showMessage:!1,preventAllReactions:!1,trimKeyName:null},o)).thisScope instanceof jQuery?o.thisScope:$(o.thisScope);if(c.find(".lw-validation-error").remove(),(o=_.assign({eventStreamUpdate:c.data("eventStreamUpdate"),preCallbackEvent:c.data("preCallbackEvent"),callbackEvent:c.data("callbackEvent")},o)).eventStreamUpdate&&(l["X-Event-Stream-Update"]="yes"),c.data("is-request-processing",!0).addClass("lw-form-processing"),!0===o.csrf&&(l["X-CSRF-TOKEN"]=appConfig.csrf_token),o.preCallback&&_.isFunction(o.preCallback)){var u=o.preCallback(r,c);r=u||r}return o.preCallbackEvent&&$(document).trigger(o.preCallbackEvent,{response:r,scopeElement:c}),$.ajax({type:i||"get",url:e,data:r||{},headers:l,error:function(t){var e=t.responseJSON?t.responseJSON:__DataRequest.__processEventStreamFinalData(t,o);c.prop("disabled",!1).removeClass("disabled"),c.data("is-request-processing",!1).removeClass("lw-form-processing"),a.resolve(t),e&&e.message?showErrorMessage(e.message):e&&e.data&&e.data.message&&showErrorMessage(e.data.message),422===t.status?$.each(e.errors,(function(t,e){var r=t;_.includes(t,".")&&(r=t.replace(/\.(.+?)(?=\.|$)/g,(function(t,e){return"_"+e})),t=t.replace(/\.(.+?)(?=\.|$)/g,(function(t,e){return"["+e+"]"})),o.trimKeyName&&(r=r.replace(o.trimKeyName,""))),c.find("#"+r+"-error").length?c.find("#"+r+"-error").text(e).show():$(".lw-error-container-"+c.find('[name="'+t+'"]').prop("name")).length?$(".lw-error-container-"+c.find('[name="'+t+'"]').prop("name")).addClass("lw-validation-error").html(e).show():c.find('.input-group-prepend ~ [name="'+t+'"]').length||c.find('[name="'+t+'"] ~ .input-group-append').length||c.find('[name="'+t+'"]').parents(".input-group").length?$('<div id="'+r+'-error" class="lw-validation-error">'+e+"</div>").insertAfter(c.find('[name="'+t+'"]').parents(".input-group")).show():c.find('[name="'+t+'"] ~ .selectize-control').length?$('<div id="'+r+'-error" class="lw-validation-error">'+e+"</div>").insertAfter(c.find('[name="'+t+'"] ~ .selectize-control')).show():c.find('div > [name="'+t+'"]').length?$('<div id="'+r+'-error" class="lw-validation-error">'+e+"</div>").insertAfter($(c.find('[name="'+t+'"]')[0])).show():$('<div id="'+r+'-error" class="lw-validation-error">'+e+"</div>").insertAfter(c.find('[name="'+t+'"]')[0]).show()})):e&&!e.reaction&&__Utils.displayInTabWindow(t.responseJSON)},beforeSend:function(){if(o.responseTemplate){var t=$(o.responseTemplate).parents("form.lw-form");t.length&&t.addClass("lw-form-processing")}c.prop("disabled","disabled").addClass("disabled"),__Utils.time("DataRequest."+i+" "+e+" ")},success:function(r){if(o.preventAllReactions)return!1;var i=__DataRequest.__processEventStreamFinalData(r,o);if(r=__InputSecurity.processResponseData(i),_.has(r,"exception"))__Utils.displayInTabWindow(r);else if(o.responseTemplate&&1==r.reaction){var a=$("script"+o.responseTemplate+"-template"),s=$(o.responseTemplate),l=_.template(a.html());s.html(l(r.data)),s.find(".lw-file-uploader").length&&t.initUploader(),__Utils.lwReInitPlugins(s);var u=s.parents("form.lw-form");u.length&&u.removeClass("lw-form-processing")}var d=!1;if((r.show_message||o.showMessage||r.data&&r.data.show_message)&&(d=!0),!0===t.__globals.default_show_message&&(d=!r.hide_message&&!o.hideMessage),r.message&&d)1==r.reaction_code||"success"===_.get(r,"messageType")?showSuccessMessage(r.message):14==r.reaction_code||"warning"===_.get(r,"messageType")?showWarnMessage(r.message):showErrorMessage(r.message);else if(r.data&&d){var p=r.data.message?r.data.message:null;p&&(1==r.reaction||"success"===_.get(r,"data.messageType")?showSuccessMessage(p):14==r.reaction||"warning"===_.get(r,"data.messageType")?showWarnMessage(p):showErrorMessage(p))}if(r.data&&r.client_models&&!_.isEmpty(r.client_models)&&__DataRequest.updateModels(r.client_models),r.data&&r.data.errors&&$.each(r.data.errors,(function(t,e){var r=t;_.includes(t,".")&&(r=t.replace(/\.(.+?)(?=\.|$)/g,(function(t,e){return"_"+e})),t=t.replace(/\.(.+?)(?=\.|$)/g,(function(t,e){return"["+e+"]"})),o.trimKeyName&&(r=r.replace(o.trimKeyName,""))),c.find("#"+r+"-error").length?c.find("#"+r+"-error").text(e).show():$(".lw-error-container-"+c.find('[name="'+t+'"]').prop("name")).length?$(".lw-error-container-"+c.find('[name="'+t+'"]').prop("name")).addClass("lw-validation-error").html(e).show():c.find('.input-group-prepend ~ [name="'+t+'"]').length||c.find('[name="'+t+'"] ~ .input-group-append').length||c.find('[name="'+t+'"]').parents(".input-group").length?$('<div id="'+r+'-error" class="lw-validation-error">'+e+"</div>").insertAfter(c.find('[name="'+t+'"]').parents(".input-group")).show():c.find('[name="'+t+'"] ~ .selectize-control').length?$('<div id="'+r+'-error" class="lw-validation-error">'+e+"</div>").insertAfter(c.find('[name="'+t+'"] ~ .selectize-control')).show():c.find('div > [name="'+t+'"]').length?$('<div id="'+r+'-error" class="lw-validation-error">'+e+"</div>").insertAfter($(c.find('[name="'+t+'"]')[0])).show():$('<div id="'+r+'-error" class="lw-validation-error">'+e+"</div>").insertAfter(c.find('[name="'+t+'"]')[0]).show()})),21==r.reaction&&(_.has(r.data,"reloadPage")&&!0===r.data.reloadPage?_.delay((function(){__Utils.viewReload()}),500):_.has(r.data,"redirectUrl")?t.location=r.data.redirectUrl:_.has(r.data,"redirect_to")&&(t.location=r.data.redirect_to)),n&&"function"==typeof n&&n(r,o.callbackParams,c),o.callbackEvent&&$(document).trigger(o.callbackEvent,{response:r,callbackParams:o.callbackParams,scopeElement:c}),r.response_action)if("redirect"===r.response_action.type)t.CURRENT_PAGE_URL&&r.response_action.url===t.CURRENT_PAGE_URL?t.location.reload():t.location=r.response_action.url;else if("replace"===r.response_action.type&&(c.hasClass("lw-action-with-url")&&$(document).trigger("lw_events_ajax_start_replace",{response:r,scopeElement:c}),(s=$(r.response_action.target).html(r.response_action.content)).find("form.lw-ajax-form").each((function(){__DataRequest.__formValidateInit($(this))})),__Utils.lwReInitPlugins(s),c.hasClass("lw-action-with-url"))){document.title=c.data("title")?c.data("title").trim():c.text().trim(),t.history.pushState(r,"",e),$(document).trigger("lw_events_ajax_success_replace",{response:r,scopeElement:c});var h=(e?new URL(e).hash:"").trim();$("html, body").stop().animate({scrollTop:$(h||"body").offset().top},500,"easeInOutExpo")}c.data("eventCallback")&&$(document).trigger(c.data("eventCallback"),{response:r,scopeElement:c}),$(document).trigger("lw_events_ajax_success",{response:r,scopeElement:c}),r=null},complete:function(r){if(o.preventAllReactions)return!1;var n=r.responseJSON?r.responseJSON:__DataRequest.__processEventStreamFinalData(r.responseText,o),s=__InputSecurity.processResponseData(n);a.resolve(_.assign(r,{responseJSON:s})),21==s.reaction||s.response_action&&"redirect"==s.response_action.type||(c.prop("disabled",!1).removeClass("disabled"),c.data("is-request-processing",!1).removeClass("lw-form-processing")),__Utils.timeEnd("DataRequest."+i+" "+e+" "),s&&s.__emailDebugView&&__Utils.openEmailDebugView(s.__emailDebugView),s&&s.__dd&&__Utils.jsdd(s);var l=_.get(s,"data.reloadDatatableId");l&&t.reloadDT(l),r=null},xhrFields:{onprogress:o.eventStreamUpdate?function(t){var e,r=t.currentTarget.response;!1===s?(e=r,s=r.length):(e=r.substring(s),s=r.length);try{if(e&&_.isString(e)){var n=JSON.parse("["+e.replaceAll("}{","},{")+"]");_.forEach(n,(function(t){t.event&&("__update_client_models"===t.event?__DataRequest.updateModels(t.data):$(document).trigger(t.event,{data:t.data,scopeElement:c}))}))}}catch(t){__Utils.warn(t)}}:null}}),a.promise()},__processEventStreamFinalData:function(t,e){if(e.eventStreamUpdate&&t&&_.isString(t)){var r=JSON.parse("["+t.replaceAll("}{","},{")+"]");return r[r.length-1]}if(!t.responseText)return t;try{return $.parseJSON(t.responseText)}catch(e){return t}},updateModels:function(e,r){e&&_.isObject(e)?(r=e,e=""):e&&_.isString(e)?e+=".":e="",r&&!_.isObject(r)&&__Utils.error("dataObject should be present as object");var n=document.querySelectorAll("[x-data]"),i=_.size(r),o=1;for(var a in r)if(r&&r.hasOwnProperty(a)){if("__extend__"==a||_.startsWith(a,"@"))continue;var s=r[a],l=e+a;n.length&&_.each(n,(function(e){if(e._x_dataStack&&e._x_dataStack[0]&&!_.isUndefined(e._x_dataStack[0][l])){var n=e._x_dataStack[0][l],a=n&&(_.isObject(n)?_.size(n):n.length);_.isObject(n)||_.isArray(n)?"extend"==_.get(r,"@"+l)&&a?_.assign(e._x_dataStack[0][l],s):"append"==_.get(r,"@"+l)&&a?e._x_dataStack[0][l]=_.merge({},n,s):"prepend"==_.get(r,"@"+l)&&a?e._x_dataStack[0][l]=_.merge({},s,n):e._x_dataStack[0][l]=s:e._x_dataStack[0][l]=s,n=null,a=null}o===i&&_.delay((function(){var e=$("[data-lw-plugin-on-model-update]");e.length&&$.each(e,(function(e,r){var n=$(r);t.lwPluginFuncs[n.data("lw-plugin-on-model-update")]("[data-lw-plugin-on-model-update="+n.data("lw-plugin-on-model-update")+"]")}))}),500),o++}));var c=$.find('[data-model="'+e+a+'"]');c.length&&$.each(c,(function(t,e){var r=$(e);r.is("input:radio")||r.is("input:checkbox")?s&&r.val()==s?r.prop("checked",!0):r.prop("checked",!1):r.is("input")||r.is("select")?r.val(s):r.text(s),r=null}));var u=$.find('[data-model-html="'+e+a+'"]');u.length&&$.each(u,(function(t,e){var r=$(e);r.html(s),r=null}));var d=$.find('[data-show-if="'+e+a+'"]');d.length&&$.each(d,(function(e,r){var n=$(r),i=_.get(t,s);i||(i=s),i?n.show():n.hide(),n=null})),c=u=d=s=null}e=r=null},getModelValue:function(t,e){e||(e="");var r=document.querySelectorAll("[x-data]");return r.length&&_.each(r,(function(r){if(r._x_dataStack&&r._x_dataStack[0]&&!_.isUndefined(r._x_dataStack[0][t]))return e=r._x_dataStack[0][t]})),e}},t.__dd=function(e,r){if(t.appConfig&&t.appConfig.debug){console.error("JS __dd --------------------------------------------------");for(var n=Array.prototype.slice.call(arguments),i=0;i<n.length;++i)console.debug(n[i]);throw new Error("-------------------------------------------------- JS __dd END")}},t.__pr=function(){if(t.appConfig&&t.appConfig.debug){console.info("JS __pr --------------------------------------------------");for(var e=Array.prototype.slice.call(arguments),r=0;r<e.length;++r)console.debug(e[r]);console.groupCollapsed("-------------------------------------------------- JS __pr END"),console.trace(),console.groupEnd()}},t.__Cookie={set:function(t,e,r){var n=new Date;n.setTime(n.getTime()+24*r*60*60*1e3);var i="expires="+n.toUTCString();document.cookie=t+"="+e+";"+i+";path=/"},get:function(t){for(var e=t+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(e))return i.substring(e.length,i.length)}return""}},t.toJsonString=function(t){return JSON.stringify(t)},$("body").on("submit","form.lw-ajax-form",(function(t){t.preventDefault();var e=$(t.target),r=$(this),n=r.data("confirm"),i=r.data("confirm-options"),o=r.data("confirm-params");if(!n){var a=__DataRequest.__processSubmitForm(e,r);return e=r=null,n=i=o=null,a}showConfirmation(n,(function(){var t=__DataRequest.__processSubmitForm(e,r);return e=r=null,n=i=o=null,t}),i||{},o||{})})),$("body").on("change","form.lw-ajax-form[lwSubmitOnChange]",(function(t){t.preventDefault();var e=$(t.target),r=$(this),n=__DataRequest.__processSubmitForm(e,r);return e=r=null,n})),$("body").addClass("lw-ajax-form-ready"),$("body").on("click",".lw-ajax-form-submit-action",(function(t){t.preventDefault();var e=$(this),r=e.parents("form"),n=__DataRequest.__processSubmitForm(e,r);return e=r=null,n})),$("body").on("click",".lw-ajax-link-action",(function(t){t.preventDefault();var e=$(this),r=e.data("confirm"),n=e.data("confirm-options"),i=e.data("confirm-params");if(!r)return r=n=i=null,__DataRequest.process(e);showConfirmation(r,(function(){return r=n=i=null,__DataRequest.process(e)}),n||{},i||{})})),$("body").on("click",".lw-ajax-link-action-via-confirm",(function(t){t.preventDefault();var e=$(this),r=e.data("confirm"),n=e.data("confirm-options"),i=e.data("confirm-params");r&&showConfirmation(r,(function(){return __DataRequest.process(e)}),n||{},i||{}),r=n=i=null})),$("form.lw-ajax-form").each((function(){__DataRequest.__formValidateInit($(this))}));var r=_.clone(t.location.pathname);$(t).on("popstate",(function(e){r!=t.location.pathname?t.location.reload():r=_.clone(t.location.pathname)}))}(window),function(t){"use strict";$.fn.dataTable&&$.extend($.fn.dataTable.defaults,{serverSide:!0,iCookieDuration:60,paging:!0,processing:!0,responsive:!0,destroy:!0,retrieve:!0,lengthChange:!0,language:{emptyTable:"There are no records to display."},searching:!1,ajax:{data:function(t){t.page=t.start/t.length+1}}}),t.dataTable=function(e,r,n,i){return i&&(r.callbackFunction=i),$(e).DataTable(function(e,r){r&&_.isObject(r)||(r={});var n={ajax:function(t,n,i){t.page=t.start/t.length+1;var o=!!t.draw&&t.draw,a={params:t,fresh:!!r.fresh&&r.fresh};_.has(r,"persist")&&(a.persist=r.persist);var s=e.url,l="";a.params&&(l=s+"?"+$.param(a.params),_.has(a.params,"draw")&&delete a.params.draw,s=s+"?"+$.param(a.params)),__DataRequest.get(l,{},(function(t){t.draw=o,e.callbackFunction&&_.isFunction(e.callbackFunction)&&e.callbackFunction.call(this,t),n(t)}),{thisScope:e.scope})},drawCallback:function(t){var e=this.api().table();_.has(e.columns,"adjust")&&_.has(e.responsive,"recalc")&&_.delay((function(){e.columns.adjust().responsive.recalc()}),180),$(".paginate_button").not(".previous, .next").find(".page-link").each((function(t,e){var r=$(e).text();$(e).text(__Utils.formatAsLocaleNumber(r))}))},columns:[],formatNumber:function(t){return __Utils.formatAsLocaleNumber(t)},responsive:{details:{renderer:function(r,n,i){var o=_.map(i,(function(t,e){return t.hidden?'<li data-dtr-index="'+t.columnIndex+'" data-dt-row="'+t.rowIndex+'" data-dt-column="'+t.columnIndex+'"><span class="dtr-title">'+t.title+'</span> <span class="dtr-data">'+t.data+"</span></li>":""})).join("");return _.defer((function(){e.elementData&&e.elementData.callback&&t[e.elementData.callback](r,n,i)})),o}}}};e.dtOptions&&_.assign(n,e.dtOptions);return n.columns=_.map(e.columnsData,(function(t){return{defaultContent:"",data:t.name?t.name:null,orderable:!!t.orderable,className:t.className?t.className:null,render:function(e,r,n,i){return t.name?n.dtSubject=t.name:n=e,t.template?__Utils.template(t.template,n):n[t.name]}}})),n}(r,n))},t.reloadDT=function(t,e){e||(e=null),_.isArray(t)?_.each(t,(function(t){$(t).dataTable().api().ajax.reload(e,!1)})):_.isString(t)?$(t).dataTable().api().ajax.reload(e,!1):t.ajax.reload(e,!1),__Utils.log("__DataStore:: DataTable reloaded")},t.initializeDatatable=function(){var e=$("[lwDataTable]");e.length&&e.each((function(e){var r=$(this),n=[],i=r.data(),o=r.find("thead th"),a={searching:!0,order:[]};if(_.isUndefined(i.order)||(a.order=[i.order,_.isUndefined(i.orderType)?"asc":i.orderType]),_.isUndefined(i.orderBy)||(a.order=[i.orderBy,i.orderType]),o.each((function(t){var e=$(this),r=e.data();_.isUndefined(r.orderBy)||(r.orderType?a.order=[t,r.orderType]:a.order=[t,"asc"]),n.push(_.assign({name:_.snakeCase(e.text())},e.data()))})),r.removeData(),i.pageLength&&_.isInteger(i.pageLength)&&(a.pageLength=i.pageLength,_.includes($.fn.dataTable.defaults.aLengthMenu,a.pageLength)||$.extend($.fn.dataTable.defaults,{lengthMenu:_.assign($.fn.dataTable.defaults.aLengthMenu,[a.pageLength])})),i.rowcallback&&(a.rowCallback=t[i.rowcallback]),i.callback&&(a.drawCallback=t[i.callback]),_.isEmpty(n))throw Error("Columns not defined");if(!i.url)throw Error("DataTable url is missing, it should be on table as data-url");dataTable(r,{url:i.url,dtOptions:a,columnsData:n,scope:r,elementData:i})}))},document.addEventListener("DOMContentLoaded",t.initializeDatatable)}(window),function(t){"use strict";t.__showMessage=function(e,r,n){if(!t.mdtoast)return __Utils.warn("mdtoast not found for showMessage"),"";if(!n)n={};var i=$.extend({},{},n);switch(r){case"success":i.type=mdtoast.SUCCESS;break;case"error":i.type=mdtoast.ERROR;break;case"warning":i.type=mdtoast.WARNING;break;case"info":i.type=mdtoast.INFO;break;default:mdtoast(e)}mdtoast(e,i)},t.showSuccessMessage=function(e){t.__showMessage(e,"success")},t.showErrorMessage=function(e){t.__showMessage(e,"error")},t.showInfoMessage=function(e){t.__showMessage(e,"info")},t.showWarnMessage=function(e){t.__showMessage(e,"warning")},t.showConfirmation=function(t,e,r,n){var i=!_.includes(t," ")&&$(t),o="";o=i&&i.length?_.template(i.html()):t,r||(r={}),r=_.assign({cancelButtonText:__Utils.getTranslation("confirmation_no","Cancel"),confirmButtonText:__Utils.getTranslation("confirmation_yes","Yes")},r),n||(n={}),Swal.fire({html:_.isString(o)?o:o(n),icon:r.type?r.type:"warning",showCancelButton:!r.showCancelBtn||r.showCancelBtn,confirmButtonColor:r.confirmBtnColor?r.confirmBtnColor:"#d33d33",cancelButtonText:r.cancelButtonText?r.cancelButtonText:"Cancel",confirmButtonText:r.confirmButtonText?r.confirmButtonText:"Yes"}).then((function(t){t.isConfirmed&&e()}))},t.showAlert=function(t,e){Swal.fire({icon:e||"info",text:t})}}(window),function(t){"use strict";__globals.translate_strings.uploader_default_text="<span class='filepond--label-action'><?= __tr('Drag & Drop Files or Browse') ?></span>",t("#sidebarToggle, #sidebarToggleTop").on("click tap",(function(e){t("body").toggleClass("sidebar-toggled"),t(".sidebar").toggleClass("toggled"),t(".sidebar").hasClass("toggled")&&t(".sidebar .collapse").collapse("hide")})),t(window).resize((function(){t(window).width()<768&&t(".sidebar .collapse").collapse("hide")})),t(window).width()<768&&(t("body").toggleClass("sidebar-toggled"),t(".sidebar").toggleClass("toggled")),t("body.fixed-nav .sidebar").on("mousewheel DOMMouseScroll wheel",(function(e){if(t(window).width()>768){var r=e.originalEvent,n=r.wheelDelta||-r.detail;this.scrollTop+=30*(n<0?1:-1),e.preventDefault()}})),t(document).on("scroll",(function(){t(this).scrollTop()>100?t(".scroll-to-top").fadeIn():t(".scroll-to-top").fadeOut()})),t(document).on("click","a.scroll-to-top",(function(e){var r=t(this);t("html, body").stop().animate({scrollTop:t(r.attr("href")).offset().top},1e3,"easeInOutExpo"),e.preventDefault()})),window.initUploader=function(){window.FilePond&&(FilePond.registerPlugin(FilePondPluginImagePreview,FilePondPluginFilePoster,FilePondPluginFileValidateType,FilePondPluginMediaPreview),t(".lw-file-uploader").each((function(e,r){var n=t(this),i=n.data("action"),o=n.data("callback"),a=n.data("default-image-url"),s=n.data("remove-media"),l=n.data("allow-replace"),c=n.data("allow-revert"),u=n.data("remove-all-media"),d=n.data("allowed-media"),p={allowVideoPreview:!1,allowImagePreview:!1,maxParallelUploads:10,imagePreviewMaxHeight:175,labelIdle:n.data("label-idle")?n.data("label-idle"):__Utils.getTranslation("uploader_default_text"),acceptedFileTypes:d,fileValidateTypeDetectType:function(t,e){return new Promise((function(t,r){d&&d.indexOf(e)<0&&r(),t(e)}))},allowRevert:c||!1,allowReplace:l||!1,credits:!1,server:{process:{url:i,method:"POST",headers:{"X-CSRF-TOKEN":appConfig.csrf_token},withCredentials:!1,onload:function(e){var r=JSON.parse(e);switch(r.reaction){case 1:t(".lw-uploaded-file").val(r.data.fileName),showSuccessMessage(r.data.message);break;case 14:showWarnMessage(r.data.message);break;default:showErrorMessage(r.data.message)}if(n.data("file-input-element")){var i=t(n.data("file-input-element"));i.length&&i.val(r.data.fileName)}if(n.data("raw-upload-data-element")){var a=t(n.data("raw-upload-data-element"));a.length&&a.val(JSON.stringify(r.data))}var s=window[o];"function"==typeof s&&s(r,n)},onerror:function(t){var e=JSON.parse(t);e.reaction&&showErrorMessage(e.data.message)}}},onprocessfile:function(t,e){s&&h.removeFile(e.id),u&&h.removeFiles()},onremovefile:function(e,r){if(t(".lw-uploaded-file").val(""),n.data("file-input-element")){var i=t(n.data("file-input-element"));i.length&&i.val("")}if(n.data("raw-upload-data-element")){var o=t(n.data("raw-upload-data-element"));o.length&&o.val("")}}};a&&void 0!==a&&!_.isEmpty(a)&&(p=_.assign(p,{files:[{options:{type:"local",file:{name:"",size:r.size,type:"image/jpg"},metadata:{poster:a}}}]}));var h=FilePond.create(this,p)})))},initUploader(),window.lwCopyToClipboard=function(t){var e=document.getElementById(t);e.select(),e.setSelectionRange(0,99999),window.navigator.clipboard.writeText(e.value)},window.lwScrollTo=function(e,r){t(e);r||(t(e).addClass("lw-highlight-replied-message"),setTimeout((function(){t(e).removeClass("lw-highlight-replied-message")}),2e3)),_.defer((function(){document.getElementById("lwConversionChatContainer").scrollBy({top:t(e).offset().top-.5*t("#lwConversionChatContainer").outerHeight(),behavior:"smooth"})}))};var e=function(t,e){var r={index:e=parseInt(e),history:!1,focus:!1,closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!1,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToToggleControls:!1,showAnimationDuration:0,hideAnimationDuration:0};new PhotoSwipe(document.querySelectorAll(".pswp")[0],PhotoSwipeUI_Default,t,r).init()};t(".lw-datatable-photoswipe-gallery").on("click",(function(r){var n;t(r.target).hasClass("lw-photoswipe-gallery-img")&&(n=[{src:t(r.target).attr("src"),w:900,h:900}],e(n,0))})),t(".lw-photoswipe-gallery-img").on("click",(function(r){var n,i=t(this).siblings(".lw-photoswipe-gallery-img").addBack(),o=0;i.length>0?(n=i.map((function(e,r){return{src:t(r).attr("src"),w:900,h:900}})),t(r.target).data("img-index")&&(o=t(r.target).data("img-index")),n.length>0&&e(n,o)):(n=[{src:t(r.target).attr("src"),w:900,h:900}]).length>0&&e(n,o)}));t(document).on("lwPrepareUploadPlugIn",(function(t,e){window.initUploader()})),window.Lazy&&t(".lw-lazy-img").Lazy({beforeLoad:function(t){},afterLoad:function(t){t.addClass("lw-lazy-img-loaded")},onError:function(t){t.addClass("lw-lazy-img-error"),console.log("error loading "+t.data("src"))}})}(jQuery),function(t,e){"use strict";t.lwPluginFuncs={lwDatePicker:function(t){e(t).each((function(t,r){var n=e(r),i=e(n).data();i&&(i=_.assign({format:"d mmmm yyyy",formatSubmit:"yyyy-mm-dd",hiddenName:!0},i)),e(n).pickadate(i),n=r=i=null})),t=null},lwTimePicker:function(t){e(t).each((function(t,r){var n=e(r),i=e(n).data();i&&(i=_.assign({format:"h:i A",formatSubmit:"HH:i",hiddenName:!0},i)),e(n).pickatime(i),n=r=i=null})),t=null},lwSwitchery:function(t){e(t).each((function(t,r){var n=e(r),i=n.siblings(".switchery").length,o=e(n).data();i||(o&&(o=_.assign({},o)),new Switchery(n[0],o)),n=r=o=null})),t=null},lwSelectize:function(t){e(t).each((function(t,r){var n=e(r),i={onChange:function(t){var r={},n=e(this.$input[0]).attr("x-model");n&&(r[n]=t,__DataRequest.updateModels(r)),e(this.$input[0]).trigger("lwSelectizeOnChange",t)}},o=n.data();o&&(o.selected&&(i.items=_.isArray(o.selected)?o.selected:[o.selected]),i=_.assign(i,o));try{i.options=e.parseJSON(n.attr("data-options"))}catch(t){i.options=n.attr("data-options")}e(n).selectize(i),i=n=o=r=null})),t=null},lwSignaturePad:function(r){e(r).each((function(r,n){var i=e(n),o=i.data(),a=i.siblings(".lw-signature-input-field");if(!a.val()){o&&(o=_.assign({onEnd:function(){var t=s.toDataURL("image/png");a.val(t)}},o));var s=new SignaturePad(n,o);function l(){var e=Math.max(t.devicePixelRatio||1,1);n.width=n.offsetWidth*e,n.height=n.offsetHeight*e,n.getContext("2d").scale(e,e),s.clear()}i.parent().on("click",".lw-clear-signature-btn",(function(t){t.preventDefault(),a.val(""),s.clear()})),o=null,t.addEventListener("resize",l),l()}})),r=null},lwTextEditor:function(t){e(t).each((function(t,r){var n=e(r);e(n).data();n.trumbowyg&&n.trumbowyg("destroy"),n.trumbowyg({btns:[["indent","outdent"],["unorderedList","orderedList"]],autogrow:!0})})),t=null},lwUploader:function(r){t.FilePond&&(FilePond.registerPlugin(FilePondPluginImagePreview,FilePondPluginFilePoster,FilePondPluginFileValidateType),e(r).each((function(r,n){var i=e(this),o=i.data("action"),a=i.data("callback"),s=i.data("default-image-url"),l=i.data("remove-media"),c=i.data("remove-all-media"),u=i.data("allowed-media"),d=_.assign({maxParallelUploads:10,imagePreviewMaxHeight:175,labelIdle:i.data("label-idle")?i.data("label-idle"):__Utils.getTranslation("uploader_default_text"),acceptedFileTypes:u,fileValidateTypeDetectType:function(t,e){return new Promise((function(t,r){u&&u.indexOf(e)<0&&r(),t(e)}))},allowRevert:!1,allowReplace:!1,credits:!1,server:{process:{url:o,method:"POST",headers:{"X-CSRF-TOKEN":appConfig.csrf_token},withCredentials:!1,onload:function(r){var n=JSON.parse(r);switch(n.reaction){case 1:i.find(".lw-uploaded-file").val(n.data.fileName),showSuccessMessage(n.data.message);break;case 14:showWarnMessage(n.data.message);break;default:showErrorMessage(n.data.message)}if(i.data("file-input-element")){var o=e(i.data("file-input-element"));o.length&&o.val(n.data.fileName)}if(i.data("raw-upload-data-element")){var s=e(i.data("raw-upload-data-element"));s.length&&s.val(JSON.stringify(n.data))}var l=t[a];"function"==typeof l&&l(n,i)},onerror:function(t){var e=JSON.parse(t);e.reaction&&showErrorMessage(e.data.message)}}},onprocessfile:function(t,e){l&&p.removeFile(e.id),c&&p.removeFiles()}},i.data?i.data:{});s&&void 0!==s&&!_.isEmpty(s)&&(d=_.assign(d,{files:[{options:{type:"local",file:{name:"",size:n.size,type:"image/jpg"},metadata:{poster:s}}}]}));var p=FilePond.create(this,d)})),r=null)},lwCopyToClipboard:function(r){e(r).on("click",(function(){var r=document.getElementById(e(this).data("target-id"));r.select(),r.setSelectionRange(0,99999),t.navigator.clipboard.writeText(r.value)}))}},t.lwPluginsInit=function(r){r||(r="");var n=e(r+"[data-lw-plugin]");n.length&&n.each((function(r,n){var i=e(n).data("lw-plugin");t.lwPluginFuncs[i]("[data-lw-plugin="+i+"]"),i=null})),n=null},lwPluginsInit()}(window,jQuery);