/*! jQuery v3.6.4 | (c) OpenJS Foundation and other contributors | jquery.org/license */ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.4",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssHas=ce(function(){try{return C.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",v.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0+o[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.0";var t=Object.create(null),o=(s.migrateDisablePatches=function(){for(var e=0;e\x20\t\r\n\f]*)[^>]*)\/>/gi),_=(s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},d(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(O,"<$1>"))!==t&&C(t)!==C(r)&&i("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(O,"<$1>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags"),s.fn.offset);return d(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?_.apply(this,arguments):(i("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(H=s.param,d(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(i("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),H.call(this,e,t)},"param-ajax-traditional")),u(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(E=s.Deferred,M=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],d(s,"Deferred",function(e){var a=E(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(M,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return u(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),u(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=E.exceptionHook),s}); jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;} var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;} expires='; expires='+date.toUTCString();} var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i>",ellipse_text:"...",prev_show_always:true,next_show_always:true,dis_pageEnd:false,start_text:"<<",end_text:">>",callback:function(){return false;}},opts||{});return this.each(function(){function numPages(){return Math.ceil(maxentries/opts.items_per_page);} function getInterval(){var ne_half=Math.ceil(opts.num_display_entries/2);var np=numPages();var upper_limit=np-opts.num_display_entries;var start=current_page>ne_half?Math.max(Math.min(current_page-ne_half,upper_limit),0):0;var end=current_page>ne_half?Math.min(current_page+ne_half,np):Math.min(opts.num_display_entries,np);return[start,end];} function pageSelected(page_id,evt){current_page=page_id;drawLinks();var continuePropagation=opts.callback(page_id,panel);if(!continuePropagation){if(evt.stopPropagation){evt.stopPropagation();} else{evt.cancelBubble=true;}} return continuePropagation;} function drawLinks(){panel.empty();var interval=getInterval();var np=numPages();var getClickHandler=function(page_id){return function(evt){return pageSelected(page_id,evt);}} var appendItem=function(page_id,appendopts){page_id=page_id<0?0:(page_id"+(appendopts.text)+"");} else{var lnk=$(""+(appendopts.text)+"") .bind("click",getClickHandler(page_id)) .attr('href',opts.link_to.replace(/__id__/,page_id));} if(appendopts.classes){lnk.addClass(appendopts.classes);} panel.append(lnk);} if(current_page>=0){appendItem(0,{text:opts.start_text?opts.start_text:" ",classes:"first"});} if(opts.prev_text&&(current_page>0||opts.prev_show_always)){if(opts.dis_pageEnd){appendItem(0,{text:opts.start_text,classes:"prev"});} appendItem(current_page-1,{text:opts.prev_text,classes:"prev"});} if(interval[0]>0&&opts.num_edge_entries>0){var end=Math.min(opts.num_edge_entries,interval[0]);for(var i=0;i"+opts.ellipse_text+"").appendTo(panel);}} for(var i=interval[0];i0){if(np-opts.num_edge_entries>interval[1]&&opts.ellipse_text){jQuery(""+opts.ellipse_text+"").appendTo(panel);} var begin=Math.max(np-opts.num_edge_entries,interval[1]);for(var i=begin;i=1){appendItem(end,{text:opts.end_text?opts.end_text:" ",classes:"last"});}} var current_page=opts.current_page;maxentries=(!maxentries||maxentries<0)?1:maxentries;opts.items_per_page=(!opts.items_per_page||opts.items_per_page<0)?1:opts.items_per_page;var panel=jQuery(this);this.selectPage=function(page_id){pageSelected(page_id);} this.prevPage=function(){if(current_page>0){pageSelected(current_page-1);return true;} else{return false;}} this.nextPage=function(){if(current_page1){let obj=$VHV(path.splice(0,1),context);if(obj){return $VHV(path.join(' '),obj);} return null;} if(typeof(context)==='object'){if(context.length&&context.find){modules=[];context.find('.ModuleWrapper').each(function(){if(this.id){let id=this.id.replace('module','');if(VHV.App.modules[id]){modules.push(VHV.App.modules[id]);}}});}else{parentId=context.id;}}else if(typeof(context)==='number'){parentId=context;} for(let i in modules){if(modules[i]&&((modules[i].module==name)||VHV.isInherited(modules[i].module,name))&&(parentId==-1||VHV.App.isChild(modules[i].id,parentId))){if(typeof(context)==='function'){if(context.call(modules[i])){return modules[i];}}else{return modules[i];}}} return null;};window.module=undefined;$.fn.loadModule=function(moduleName,settings,onComplete){let inc=0;while(VHV.App.modules[parseInt(VHV.App.maxModuleId)+1000+inc]){inc++;} let moduleId=parseInt(VHV.App.maxModuleId)+1000+inc;VHV.App.maxModuleId=moduleId;$(this).each(function(){let that=$(this),options=$.extend({},settings),swapScreen;if(VHV.app){swapScreen=$(this).parents('.swap-screen:first');if(!swapScreen.length){swapScreen=$('.swap-screen:visible');}} VHV.Model.engine.initOptions(options,swapScreen,true);let url=VHV.buildURL({module:moduleName,moduleId:moduleId}),success=((typeof(onComplete)==='function')?function(){VHV.ExecQueue.add(function(){onComplete.call(VHV.App.modules[moduleId],moduleId);},function(){return VHV.App.modules[moduleId];});}:null);let matches=/&accountId=(\w+)/.exec(url);if(matches){options.accountId=matches[1];url=url.replace(/&accountId=(\w+)/,'');} that.load(url,VHV.getPostParams(options),success);});return moduleId;};if(!window.console){window.console={log:function(){}};} if($('img[usemap]').length){VHV.load('3rdparty/jQuery/fancybox/fancybox-v2.0/jquery.fancybox.css','3rdparty/jQuery/fancybox/fancybox-v2.0/jquery.fancybox-buttons.css');VHV.load('3rdparty/jQuery/jquery.imagemapster.min.js','3rdparty/jQuery/fancybox/fancybox-v2.0/jquery.fancybox.js',function(){VHV.load('3rdparty/jQuery/fancybox/fancybox-v2.0/jquery.fancybox-buttons.js',function(){setTimeout(function(){$('img[usemap]').each(function(){$(this).mapster({fillOpacity:0.8,isSelectable:false,stroke:true,strokeWeight:1,strokeColor:'DDDDDD',scaleMap:true,showToolTip:true,clickNavigate:!!$(this).attr('data-click-navigate')});});$('img[usemap]').parent().css('max-width','100%');$(window).resize(function(){let curWidth=$(window).width(),curHeight=$(window).height(),checking=false;if(checking){return;} checking=true;window.setTimeout(function(){let newWidth=$(window).width(),newHeight=$(window).height();if(newWidth===curWidth&&newHeight===curHeight){$('img[usemap]').each(function(){let image=$(this);image.parent().css('width','auto').css('height','auto');image.width(image.parent().width()).css('height','auto') .mapster('resize',image.width(),image.height(),100);});} checking=false;},100);});$('area:not(.no-popup)').addClass('fancybox').attr('rel','image') .on('click',function(e){e.preventDefault();let url=$(this).attr('href');let title=$(this).attr('title');let type=$(this).attr('rel');if(type==='redirect'){location.href=url;}else{$.fancybox({'title':title,'titlePosition':'inside','href':url});}});},500);});});} (function(){if(jQuery.ajaxPrefilter){let rURL=/^([^/]+)/,rEsc=/([-.])/,protocol=rURL.exec(document.location.href)[1].replace(rEsc,"\\$1"),rDomains={};jQuery.ajaxPrefilter(function(options){let strip=options.stripDomain,rDomain,sDomain;if(strip){rDomain=rDomains[strip];if(!rDomain){sDomain="^(?:"+protocol+")?\\/\\/"+strip.replace(rEsc,"\\$1");rDomains[strip]=rDomain=new RegExp(sDomain,"i")} options.url=options.url.replace(rDomain,"");}});}})();jQuery.ajaxSetup({stripDomain:rootURL.replace('http://','').replace('https://','').replace(/\//g,'')});if($('.animated').length){VHV.load('3rdparty/animate.min.css');VHV.load('3rdparty/jQuery/jquery.waypoints.min.js',function(){$('.animated').each(function(){$(this).waypoint(function(){$(this.element).toggleClass($(this.element).data('animated'));},{offset:$(this).data('waypointOffset')?$(this).data('waypointOffset'):'80%'});});});} if($('[class^="hvr-"]').length){VHV.load('3rdparty/hover-min.css');} if($('div.fb-like,div.fb-comments,div.fb-page,div.fan-page,div.fb-comment').length){window.fbAsyncInit=function(){let appId=$('meta[property="fb:app_id"]').attr('content');FB.init({appId:appId||'487170647977434',cookie:true,xfbml:true,version:'v2.8'});FB.AppEvents.logPageView();$(document).ajaxComplete(function(){try{if(window.FB){FB.XFBML.parse();} if(window.gapi?.plusone){gapi.plusone.go();}}catch(_ex){}});};(function(d,s,id){let js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return;} js=d.createElement(s);js.id=id;js.src="https://connect.facebook.net/"+((VHV.language==='vi')?'vi_VN':'en_US')+"/sdk.js";fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));} if($('div.g-plusone').length){window.___gcfg={lang:((VHV.language==='vi')?'vi':'en')};(function(){let po=document.createElement('script');po.type='text/javascript';po.async=true;po.src='https://apis.google.com/js/platform.js';let s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);})();} if($('a.twitter-share-button').length){!function(d,s,id){let js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");} $('#backtotop ').on('click',function(){$('html, body').animate({scrollTop:0},1000);});$(document).on('keydown','input[type=number]',function(e){if(e.which==69){return false;}});$(window).scroll(function(){if($(window).scrollTop()>0){$('#backtotop ').fadeIn();}else{$('#backtotop ').fadeOut();} checkLazyLoad($(window));}).scroll();$('body').on('click','[role="tab"]',function(){setTimeout(function(){checkLazyLoad($(window));},100);}) document.addEventListener('scroll',function(event){let obj=$(event.target);if(obj.hasClass('lazyContainer')){checkLazyLoad(obj);}},true);setTimeout(function(){$(window).scroll();},200);setTimeout(function(){$(window).scroll();},3000);$('.lazyContainer').each(function(){checkLazyLoad($(this));});if($('#pageSectionWrapper').length){$(window).resize(function(){if($(window).width()>992&&$('#sidebarRight').width()>0){$('#sectionContainer').css({'width':$('#pageSectionWrapper').width()-$('#sidebarRight').outerWidth()-40});}});} if($.msie){VHV.innerText=$.browser.ie6?'nodeValue':'innerText';} VHV.allLinks[rootURL+'3rdparty/jQuery/jquery-1.7.2.min.js']=2;VHV.allLinks[rootURL+'3rdparty/jQuery/jquery.mobile-1.2.0/jquery.mobile-1.2.0.min.js']=2;VHV.allLinks[rootURL+'VHV.js']=2;VHV.allOrderedLinks.push(rootURL+'3rdparty/jQuery/jquery-1.7.2.min.js');VHV.allOrderedLinks.push(rootURL+'3rdparty/jQuery/jquery.mobile-1.2.0/jquery.mobile-1.2.0.min.js');VHV.allOrderedLinks.push(rootURL+'VHV.js');VHV.allLinks[rootURL+'3rdparty/jQuery/jquery.cookie.js']=2;VHV.allOrderedLinks.push(rootURL+'3rdparty/jQuery/jquery.cookie.js');VHV.allLinks[rootURL+'3rdparty/jQuery/jquery.json/jquery.json.min.js']=2;VHV.allOrderedLinks.push(rootURL+'3rdparty/jQuery/jquery.json/jquery.json.min.js');VHV.allLinks[rootURL+'3rdparty/jQuery/jquery.pagination/jquery.pagination.js']=2;VHV.allOrderedLinks.push(rootURL+'3rdparty/jQuery/jquery.pagination/jquery.pagination.js');VHV.allLinks[rootURL+'Content/js/Listing.js']=2;VHV.allLinks[rootURL+'publish/js/modules/'+((VHV.language==='vi')?'':VHV.language+'_') +'Content.Listing.js']=2;VHV.allOrderedLinks.push(rootURL+'Content/Listing.js');VHV.allOrderedLinks.push(rootURL+'publish/js/modules/' +((VHV.language==='vi')?'':VHV.language+'_')+'Content.Listing.js');VHV.allLinks[rootURL+'Content/js/HTML.js']=2;VHV.allLinks[rootURL+'publish/js/modules/'+((VHV.language==='vi')?'':VHV.language+'_') +'Content.HTML.js']=2;VHV.allOrderedLinks.push(rootURL+'Content/HTML.js');VHV.allOrderedLinks.push(rootURL+'publish/js/modules/'+((VHV.language==='vi')?'':VHV.language+'_')+'Content.HTML.js');VHV.allLinks[rootURL+'Common/Input/js/Input.js']=2;VHV.allLinks[rootURL+'publish/js/modules/'+((VHV.language==='vi')?'':VHV.language+'_') +'Common.Input.Input.js']=2;VHV.allOrderedLinks.push(rootURL+'Common/Input/js/Input.js');VHV.allOrderedLinks.push(rootURL+'publish/js/modules/'+((VHV.language==='vi')?'':VHV.language+'_') +'Common.Input.Input.js');if(typeof jQuery!=='undefined'){jQuery(function($){let loadModuleCounter=0;let hideTimeout=null;let maxTimeout=null;const MAX_RETRY=3;const RETRY_DELAY=500;const HIDE_DELAY=2000;const MAX_LOADING_TIME=20000;const loader=$(`
loading...
`).css({position:"fixed",top:"1em",left:"1em",zIndex:10000}).appendTo("body").hide();function showLoader(){if(hideTimeout){clearTimeout(hideTimeout);hideTimeout=null;} loader.show();if(maxTimeout)clearTimeout(maxTimeout);maxTimeout=setTimeout(resetLoader,MAX_LOADING_TIME);} function tryHideLoader(){if(loadModuleCounter>0)return;hideTimeout=setTimeout(function(){if(loadModuleCounter===0){loader.hide();clearTimeout(maxTimeout);maxTimeout=null;}},HIDE_DELAY);} function resetLoader(){loadModuleCounter=0;loader.hide();} function increaseCounter(){if(++loadModuleCounter===1){showLoader();}} function decreaseCounter(){loadModuleCounter=Math.max(0,loadModuleCounter-1);tryHideLoader();} $.ajaxPrefilter(function(options,originalOptions,jqXHR){let doNotShowLoading=options.doNotShowLoading||originalOptions.doNotShowLoading||originalOptions?.data?.doNotShowLoading||0;options._retryCount=options._retryCount||0;if(!doNotShowLoading){increaseCounter();} jqXHR.done(function(){if(!doNotShowLoading){decreaseCounter();}});jqXHR.fail(function(){if(!doNotShowLoading){decreaseCounter();} if(options._retryCount10)&&(parseInt(this.ratio[0])>0)&&(this.lastWidth!=width)){this.that.data('lastElementWidth',width);this.that.height(Math.round(Math.min((width*parseInt(this.ratio[1]))/ parseInt(this.ratio[0]),1200)));}},updateImageRatio=function(){let that=$(this),ratio=that.attr('data-size-ratio'),src=that.attr('src');if(src&&src.indexOf('images/lazyload_')===-1){if(!ratio||typeof(ratio)!=='string'||ratio.indexOf(':')===-1){ratio='1:1';} ratio=ratio.split(':');let tmpImg=new Image();tmpImg.lastWidth=that.data('lastElementWidth');tmpImg.that=that;tmpImg.ratio=ratio;tmpImg.onload=imageLoaded;tmpImg.src=that.attr('src');}};$(window).resize(function(){if(VHV.ratioResizeTimeout){clearTimeout(VHV.ratioResizeTimeout);} VHV.ratioResizeTimeout=setTimeout(function(){VHV.ratioResizeTimeout=false;$('.relative-height').each(updateImageRatio);},300);});$('body').on('click','a.accordion-arrow-button',function(){if($(this).attr('aria-expanded')=='true'){$(this).find('i').attr('title',"Mở rộng");$(this).parents('.panel-title:first').find('.accordion-title:first').attr('title',"Mở rộng");}else{$(this).find('i').attr('title',"Thu nhỏ");$(this).parents('.panel-title:first').find('.accordion-title:first').attr('title',"Thu nhỏ");}});setTimeout(function(){$(window).resize();},3000);setTimeout(function(){VHV.load('Common.Statistic.Client',function(){VHV.Common.Statistic.Client.request();});let cartTotalItems=$('.cart-total-items');if(cartTotalItems.length&&VHV.User&&!parseInt(VHV.User.id)){let cart=window.localStorage.getItem('vhvLocalCart'+VHV.site);if(cart){cart=JSON.parse(cart);if(cart.products){cartTotalItems.text(VHV.numberFormat(VHV.sizeof(cart.products)));}}}},1000);$(document).on('click','.block-param-input',function(){let obj=this;VHV.load('Content.Layout.BlockParamEdit',function(){return new VHV.Content.Layout.BlockParamEdit(obj);});});$(document).on('click','.bookmark-button',function(){let obj=$(this),params=obj.data(),i=obj.find('i'),bookmarkService='Member.Bookmark.',responseMessage="Yêu thích thành công",fn='add',title="Bỏ yêu thích",currentTotal=parseFloat(params['totalBookmarks']||0),newTotal=currentTotal,textTotalTag=obj.next('.text-totalLike');if(params.entityTitle){responseMessage="Yêu thích ENTITY_TITLE thành công".replace('ENTITY_TITLE',params.entityTitle);if(params.customMessage){responseMessage=params.customMessage.toString();}} if(params['parentElement']&&$(obj).parents(params['parentElement']+':first').length){textTotalTag=$(obj).parents(params['parentElement']+':first').find('.text-totalLike');} if(i.hasClass('vis')){fn='remove';title="Yêu thích";newTotal--;responseMessage="Bỏ yêu thích thành công";if(params.entityTitle){responseMessage="Bỏ yêu thích ENTITY_TITLE thành công".replace('ENTITY_TITLE',params.entityTitle);} if(params.customDislikeMessage){responseMessage=params.customDislikeMessage.toString();}}else{newTotal++;} if(params.bookmarkService?.includes('.Bookmark.')){bookmarkService=params.bookmarkService;} obj.data('totalBookmarks',newTotal).attr('data-total-bookmarks',newTotal);if(textTotalTag.length){textTotalTag.text(VHV.number(newTotal));} VHV.Model(bookmarkService+fn)(params,function(response){response=JSON.parse(response);if(params.hasAlert&&response.status==='SUCCESS'){VHV.alert(responseMessage,{type:'success',delay:3000});} if(response.status!=='SUCCESS'){i.toggleClass('vis').toggleClass('vi');obj.attr('title',title);obj.data('totalBookmarks',currentTotal).attr('data-total-bookmarks',currentTotal);if(textTotalTag.length){textTotalTag.text(VHV.number(currentTotal));}}else if(params.needReload||response.needReload){let mid=$(obj).closest('.ModuleWrapper').attr('id');if(mid){VHV.App.modules[mid.replace('module','')].reload('current');}}});i.toggleClass('vis').toggleClass('vi');obj.attr('title',title);}).on('click','a[data-x-dailog-info]',function(){let data=$.extend({},$(this).data()),confirmOptions=data.xConfirmOptions,confirmNote=data.xConfirmNote,warningModal=data.xWarningModal,confirmLabel=data.xConfirmLabel,cancelReload=data.cancelReload,buttonClass=data.xConfirmButtonClass;if(confirmOptions&&(typeof(confirmOptions)==='string')){confirmOptions=JSON.parse((confirmOptions.startsWith('{')?confirmOptions:"{"+confirmOptions+"}") .replace(/'/g,'"').replace(/([{,])\s*(\w+)\s*:/g,'$1"$2":'));} if(!confirmOptions){confirmOptions={};} if(confirmLabel){confirmOptions.buttons={ok:{text:confirmLabel,class:'lobibox-btn lobibox-btn-yes '+buttonClass}};} if(confirmNote){confirmOptions.confirmNote=confirmNote;} if(warningModal){confirmOptions.warningModal=warningModal;} if(cancelReload){confirmOptions.cancelReload=cancelReload;} let popupTitle=data.title;if(!popupTitle){popupTitle=$(this).attr('title');} VHV.info(popupTitle,data.xDailogInfo,confirmOptions);}).on('click','a.like-button[data-id]',function(){let options=$(this).data(),object=$(this);let unlike=options.unlike;if(parseInt(VHV.User.id)){if(options.id&&options.type){VHV.Model('Member.Like.like')({type:options.type,id:options.id,unlike:unlike||0},function(response){if((typeof(response)==='string')){response=JSON.parse(response);} if(response.status==='SUCCESS'){let totalLikeText=options.unlike?(options.unlikeTitle||"Thích"):(options.likeTitle||"Đã thích");if(options.showTotalLike){let totalLike=response.totalLikes||0;totalLikeText=totalLike>0?VHV.number(totalLike):(options.unlikeTitle||"Thích");} object.find('.text-totalLike').text(totalLikeText);if(options.parentTag){object.parents(options.parentTag+':first').find('.num-totalLike') .html(response.symbol||(response.totalLikes));} object.data('unlike',options.unlike?0:1);object[options.unlike?'addClass':'removeClass']('color-primary hasLike');}});}}else{VHV.redirect('/login?href='+location.href.replace(location.origin,''));}});$(document).on('focus','[data-x-suggest]',function(){VHV.initSuggest(this,true);});$(document).on('change','input,textarea,select',function(){let groupId=$(this).data('xGroup'),that=this;if(groupId){$('input:checkbox[data-x-group="'+groupId+'"]:not([value])').each(function(){this.value=$(this).parents('[data-id]:first').data('id');});} if($(this).hasClass('x-check-all')){$('input.x-check-all[data-x-group="'+groupId+'"]').prop('checked',$(this).prop('checked'));$('input[data-x-group="'+groupId+'"][value!=""]:not(.x-check-all):not(:disabled)') .prop('checked',$(this).prop('checked'));}else if(groupId){$('input.x-check-all[data-x-group="'+groupId+'"]').prop('checked',$('input[data-x-group="' +groupId+'"]:visible:not(.x-check-all):not(:checked)').length?'':'checked');} VHV.updateDisplay();if(this.name){let $o=$(this),$m=$o.parents('form:first');if(!$m.length){$m=$(this).parents('.ModuleWrapper:first');} let cascade=$m.find((this.name.indexOf('[')===-1?'[data-x-cascade*="fields['+this.name+']"],':'') +'[data-x-cascade*="'+this.name+'"]');let parentEl=this;if(cascade.length&&!VHV.Content?.Form?.disableCascade){let cascadeTos=[];cascade.each(function(){cascadeTos.push(this.name);});VHV.load('Content.Form',function(){(function($m,$o,cascade,cascadeTos,parentEl){VHV.ExecQueue.add(function(){VHV._cascadeChange(that,$m,$o,cascade,cascadeTos,parentEl);},function(){return VHV.Content?.Form?.isCascading<=0;});})($m,$o,cascade,cascadeTos,parentEl);});}} if($(this).data('xService')&&!$(this).data('xSuggest')){if($(this).data('xConfirm')){let actionParams=VHV.getDoActionParams(that),data=$.extend({},$(this).data()),confirmOptions=data.xConfirmOptions,confirmNote=data.xConfirmNote,warningModal=data.xWarningModal,confirmLabel=data.xConfirmLabel,cancelReload=data.cancelReload,buttonClass=data.xConfirmButtonClass;if(confirmOptions&&(typeof(confirmOptions)==='string')){confirmOptions=JSON.parse((confirmOptions.startsWith('{')?confirmOptions:"{"+confirmOptions+"}") .replace(/'/g,'"').replace(/([{,])\s*(\w+)\s*:/g,'$1"$2":'));} if(!confirmOptions){confirmOptions={};} if(confirmLabel){confirmLabel=confirmLabel.split('|');confirmOptions.buttons={};if(confirmLabel[1]){confirmOptions.buttons.no={text:confirmLabel[1],class:'lobibox-btn lobibox-btn-no '+buttonClass};} if(confirmLabel[0]){confirmOptions.buttons.yes={text:confirmLabel[0],class:'lobibox-btn lobibox-btn-yes '+buttonClass};}}else{confirmOptions.buttons=['no','yes'];} if(confirmNote){confirmOptions.confirmNote=confirmNote;} if(warningModal){confirmOptions.warningModal=warningModal;} if(cancelReload){confirmOptions.cancelReload=cancelReload;} let popupTitle=data.title;if(!popupTitle){popupTitle=$(this).attr('title');} let count=0;if(data.xMultiActions){let moduleId=data.moduleId||0;if(!moduleId){let module=VHV.getModule(this);if(module){moduleId=module.id;}} count=VHV.App.modules[moduleId]?.checkedItems?.length;console.log(count);if(count===1){let title=$('input[data-x-group="'+moduleId +'"]:checkbox:checked:not(.x-select-all,.x-check-all)') .data('title');if(title!==undefined&&title!==null&&title!==''){if(data.xConfirm.indexOf('@title')===-1){data.xConfirm=data.xConfirm.replace(/@count\s/g,'') .replace(/\?$/,'')+' '+title+'?';}else{data.xConfirm=data.xConfirm.replace(/@count\s/g,'') .replace(/\?$/,'') .replace('@title',title)+'?';}}}} VHV.confirm(popupTitle,data.xConfirm .replace(/@count\s/g,count?VHV.numberFormat(count)+' ':''),function(){VHV.doAction(actionParams);},confirmOptions);}else{VHV.doAction(VHV.getDoActionParams(this));} return false;} if($(this).hasClass('serviceRequired')&&$(this)?.val()?.length){$(this).removeClass('error');$(this).siblings('label.error').text('').hide();$(this).parent().siblings('label.error').text('').hide();}});$(document).on('click','[data-dismiss="modal"]',function(){$('body > .modal').each(function(){if($(this).hasClass('in')){setTimeout(function(){$('body').addClass('modal-open');},350);} if($(this).hasClass('not-focus-window')){$(this).removeClass('not-focus-window');}});setTimeout(function(){if(VHV.App.modules){for(let i in VHV.App.modules){if(document.getElementById('module'+i)===null){delete(VHV.App.modules[i]);}}}},500);}) $(document).on('click','[data-x-service],[data-x-modal]',function(){if(this.tagName==='SELECT'||(this.tagName==='INPUT'&&this.type!=='checkbox'&&this.type!=='radio')){return;} let that=this,xmodal=$(this).data('xModal'),isClick=$(this).data('isClick'),xConfirm=$(this).data('xConfirm'),targetBtn=$(this);if(!isClick){$(this).css('pointer-events','none');setTimeout(function(){$(that).removeAttr('style','pointer-events:inherit');},3000);} if(xmodal){let params=$.extend(true,{},VHV.getActionParams(this)),data=$.extend({},$(this).data()),modalTitle=data.modalTitle||data.title||'';if(data.xMultiActions&&modalTitle){let moduleId=data.moduleId||0;if(!moduleId){let module=VHV.getModule(this);if(module){moduleId=module.id;}} let count=VHV.App.modules[moduleId]?.checkedItems?.length||0;if(count===1){let title=$('input[data-x-group="'+moduleId+'"]:checkbox:checked:not(.x-select-all,.x-check-all)') .data('title');if(title){if(modalTitle.indexOf('@title')===-1){modalTitle=modalTitle.replace(/@count\s/g,'').replace(/\?$/,'')+' '+title;} else{modalTitle=modalTitle.replace(/@count\s/g,'').replace(/\?$/,'') .replace('@title',title);}}} else{modalTitle=modalTitle.replace(/\s@title/g,'');} params.modalTitle=modalTitle.replace(/@count\s/g,count?VHV.numberFormat(count)+' ':'');} params.layout=params.xModal;delete params.xModal;if(params.xService==='editForm'&&!params.service&¶ms.submitService){params.service=VHV.changeTail(params.submitService,'select');} VHV.openModal(params,this);return false;}else if(xConfirm){let that=this,data=$.extend({},$(this).data()),confirmOptions=data.xConfirmOptions,confirmLabel=data.xConfirmLabel,confirmNote=data.xConfirmNote,warningModal=data.xWarningModal,actionParams=VHV.getDoActionParams(that),buttonClass=data.xConfirmButtonClass;if(confirmOptions&&(typeof(confirmOptions)==='string')){confirmOptions=JSON.parse(((confirmOptions.startsWith('{'))?confirmOptions:"{"+confirmOptions+"}").replace(/'/g,'"').replace(/([{,])\s*(\w+)\s*:/g,'$1"$2":'));} if(!confirmOptions){confirmOptions={};} if(confirmLabel){confirmLabel=confirmLabel.split('|');confirmOptions.buttons={};if(confirmLabel[1]){confirmOptions.buttons.no={text:confirmLabel[1],class:'lobibox-btn lobibox-btn-no '+buttonClass};} if(confirmLabel[0]){confirmOptions.buttons.yes={text:confirmLabel[0],class:'lobibox-btn lobibox-btn-yes '+buttonClass};}}else{confirmOptions.buttons=['no','yes'];} if(confirmNote){confirmOptions.confirmNote=confirmNote;} if(warningModal){confirmOptions.warningModal=warningModal;} let popupTitle=data.title;if(!popupTitle){popupTitle=$(this).attr('title');} let count=0;if(data.xMultiActions){let moduleId=data.moduleId||0;if(!moduleId){let module=VHV.getModule(this);if(module){moduleId=module.id;}} count=VHV.App.modules[moduleId]?.checkedItems?.length;if(count===1){let title=$('input[data-x-group="'+moduleId+'"]:checkbox:checked:not(.x-select-all,.x-check-all)') .data('title');if(title!==undefined&&title!==null&&title!==''){if(data.xConfirm.indexOf('@title')===-1){data.xConfirm=data.xConfirm.replace(/@count\s/g,'') .replace(/\?$/,'')+' [['+title+']]?';}else{data.xConfirm=data.xConfirm.replace(/@count\s/g,'').replace(/\?$/,'') .replace('@title','[['+title+']]')+'?';}}}else{data.xConfirm=data.xConfirm.replace(/\s@title/g,'');}} VHV.confirm(popupTitle,data.xConfirm.replace(/@count\s/g,count?VHV.numberFormat(count)+' ':''),function(){targetBtn.css('pointer-events','none');setTimeout(function(){targetBtn.removeAttr('style','pointer-events:inherit');},5000);VHV.doAction(actionParams);},confirmOptions);return false;}else{VHV.doAction(VHV.getDoActionParams(this));return false;}});VHV.updateDisplay();} static _cascadeChange(that,$m,_o,cascade,cascadeTos,parentEl){VHV.Content.Form.isCascading+=cascade.length;let waitTimeout=50;cascade.each(function(){let that2=this,cascadeParams=$(this).data('xCascade').split(','),data=$(this).data('serviceData'),lastTime=$(this).data('lastCascadeTime'),time=VHV.getTime()*1000;if((!lastTime||(lastTime+5000&&$(parentEl).val().length){$(that2).rules("remove");isRemoved=true;} $(that2).change();if(isRemoved){$(that2).rules("add",rules);}}catch(error){console.error("Error during cascading validation rules:",error);}finally{VHV.isCascading=false;VHV.Content.Form.isCascading--;}},200);},waitTimeout);waitTimeout+=100;}else{VHV.Content.Form.isCascading--;}});} static getActionModuleId(obj){return $(obj).parents('.ActionWrapper:first').attr('data-module-id')||$(obj).parents('.ModuleWrapper:first').attr('id')?.replace('module','')||$(obj).parents('.dropdown-menu:first').data('originalParent')?.parents('.ModuleWrapper:first')?.attr('id')?.replace('module','')||0;} static getModule(element){let mid=VHV.getActionModuleId(element);if(mid){return VHV.App.modules[mid];}} static initSuggest(that,autoFocus){if(!$(that).data('select2')){let hidden,value=$(that)[String.fromCharCode(0x64,0x61,0x74,0x61)]('value')?$(that)[String.fromCharCode(0x64,0x61,0x74,0x61)]('value'):that[String.fromCharCode(0x76,0x61,0x6c,0x75,0x65)],placeholder=($(that).attr('placeholder')?$(that).attr('placeholder'):'');if(that.name){hidden=$('');if(value){hidden.val(value);let label=$(that).data('label');hidden.data('value',label||value);} $(that).before(hidden);that.name='';} else if(that.previousSibling?.type==='hidden'){hidden=$(that.previousSibling);value=$(hidden).data('value')?$(hidden).data('value'):hidden.val();} let service=$(that).attr('data-x-suggest'),params=VHV.getActionParams(that);if($(that).attr('allowNewValue')){params.createSearchChoice=function(term,data){if($(data).filter(function(){return this.text.localeCompare(term)===0;}).length===0){return{id:term,text:term};}};params.selectOnClose=true;params.tags=true;params.allowClear=true;} if(value&&typeof(value)==='string'&&(that.multiple||$(that) .data('multiple'))){value=value.split(',');} if(that.tagName==='INPUT'){let select=$('');if(value){if(typeof(value)==='object'){let labels=that.value||value;if(typeof(labels)!=='object'){labels=labels.split(',');} for(let k in value){let option=$('');option.attr('value',value[k]).text(labels[k]);select.append(option);} select.find('option').attr('selected','selected');} else{select.append($('').attr('value',value).text(that.value));}} $(that).replaceWith(select);that=select;} VHV.load('3rdparty/jQuery/select2-4.0.13/dist/css/select2.min.css');VHV.load('3rdparty/jQuery/select2-4.0.13/dist/js/select2.full.min.js',function(){let noResultsFunction=function(){if(VHV.language==='vi'){return"Không tìm thấy kết quả nào";} else{return"Không tìm thấy kết quả";}};$(that).select2($.extend({templateResult:function(state){let html=state.html;if(!html){html=''+(state.image?'':'')+VHV.notag(state.text)+'';} return $(html);},placeholder:placeholder,allowClear:true,ajax:{url:VHV.Model(service).url(params,true),dataType:'json',quietMillis:300,data:function(params2){params2.pageNo=params2.page||1;let extraParams=$(this).data('extraParams');if(extraParams&&(typeof(extraParams)==='object')){params2=$.extend(params2,extraParams);} return params2;},processResults:function(data,params2){let tmpResults=[];if(params2.pageNo===1){tmpResults.push({id:" ",text:"-- Chọn --",html:"-- Chọn --",image:''});} $.each(data,function(index,item){let image='';if(item.image){if(item.image.search(/^(http|\/|data:image)/)!==0){image='/'+((item.image.startsWith('upload/'))?'publish/thumbnail/'+VHV.site+'/30x30xdefault/':'');} image+=item.image;} tmpResults.push({id:item.id,text:item.label||item.title,html:(item.html||''),image:image});});return{results:tmpResults,pagination:{"more":data.length===20}};}},dropdownAutoWidth:true,tags:true,tokenSeparators:[',',';'],createTag:function(params){return null;},language:{noResults:noResultsFunction,errorLoading:noResultsFunction,loadingMore:function(){if(VHV.language==='vi'){return"Xem thêm";} else{return"Xem thêm";}},searching:function(){if(VHV.language==='vi'){return"Đang tìm kiếm...";} else{return"Searching...";}}}},params));$(that).on('change',function(){if(hidden?.length){let value2=$(this).val()?$(this).val():'';if(typeof(value2)==='object'){value2=value2.join(',');} hidden[0].value=value2;hidden.change();if(hidden.next().hasClass('error')){hidden.next().removeClass('error');hidden.nextAll('label.error').removeClass('error').addClass('hide').html('');hidden.parent().next('label').addClass('hide').html('');}} let labelSelected='';if($(this).attr('multiple')){labelSelected=$(this).find('option:selected').map(function(){return $(this).text();}).get().join(', ');}else{let value=$(this).val();if(value){labelSelected=$(this).find('option[value="'+value+'"]').text();}} let buttonLabel=$(this).next('span.select2').find('button.select2-selection');if(labelSelected){buttonLabel.attr('title',labelSelected);} else{buttonLabel.attr('title','');} if($(this).val()){if($(this).val()===" "){$(this).val(null).trigger('change');buttonLabel.find('.select2-selection__clear').hide();}else{setTimeout(function(){buttonLabel.find('.select2-selection__clear').show();},100);}}});if(params?.buttonQuickAdd){VHV.Common.Input.Select.initAddButton(that);} if(autoFocus){setTimeout(function(){$(that).select2('open');const clearBtn=$(that).next().find('.select2-selection__clear:first');const value=$(that).val();if(value&&value.length){clearBtn.show();}},100);}});}} static getActionParams(that){let thatData=$.extend({},$(that).data()),params={};for(let i in thatData){if(typeof(thatData[i])!=='object'||i==='filters'){let j=i;for(let k in{'options':1,'filters':1}){if((i.startsWith(k))&&(i!=k)){j=i.substring(k.length);j=k+'['+j[0].toLowerCase()+j.substring(1)+']';}} params[j]=thatData[i];}} let m=VHV.getModule(that);if((thatData.getFilters||(thatData.xService&&(thatData.xService.indexOf('.export')!==-1||thatData.xExport)))&&m){if(m.filters&&VHV.sizeof(m.filters)){let filters=$.extend({},m.filters);for(let i2 in{groupId:1,accountId:1}){if(typeof(filters[i2])!="undefined"){delete(filters[i2]);}} params.filters=$.extend(params.filters||{},filters);} if(m.orderBy&&typeof(m.orderBy)==='string'&&!params.orderBy){params.orderBy=m.orderBy;}} if(that.value&&that.name){let value=$(that).val()?$(that).val():'';if(typeof(value)==='object'){value=value.join(',');} params[that.name]=value;} if(that.tagName==='SELECT'){let currentOption=$('option[value="'+that.value+'"]',that);if(currentOption.length){let optionData=$(currentOption).data();for(let i3 in optionData){if(typeof(optionData[i3])==='object'){delete optionData[i3];}} if(optionData){$.extend(params,optionData);}}} if(params.xMultiActions&&m){params.ids=m.checkedItems?.join(',');} return params;} static getDoActionParams(that){let action=$(that).data('xService'),params=VHV.getActionParams(that),moduleId=VHV.getActionModuleId(that),module,isMulti=params.xMultiActions,matches=moduleId?.match(/^module(\d+)$/),nextInput=$(that).next('input');if(matches){moduleId=parseInt(matches[1]);} if(moduleId){module=VHV.App.modules[moduleId];} if(nextInput.hasClass('onoffswitch-checkbox')){nextInput.prop('disabled',true);} let item=$(that).parents('[data-id]:first');if(!item.length){let parent=$(that).parents('.dropdown-menu:first').data('originalParent');if(parent){item=parent.data('id')?parent:parent.parents('[data-id]:first');}} return{that:that,params:params,moduleId:moduleId,action:action,module:module,isMulti:isMulti,xExport:$(that).data('xExport'),xSuccess:$(that).data('xSuccess'),item:item,title:$(that).attr('title'),isA:$(that).is('a'),text:$(that).text(),reloadOtherModule:$(that).data('reloadOtherModule')||'',locationReload:!!$(that).data('locationReload'),locationReloadDelay:$(that).data('locationReloadDelay')?$(that).data('locationReloadDelay'):'',...(nextInput.hasClass('onoffswitch-checkbox')?{onRequestResponse:function(){setTimeout(function(){nextInput.prop('disabled',false);},3000);}}:{})};} static doAction(actionParams,extra){let action=actionParams.action,moduleId=actionParams.moduleId,module=actionParams.module,params=actionParams.params,isMulti=actionParams.isMulti,reloadDelay;if(extra){params=$.extend(extra,params);} if(!module||!action){return;} if(module.targetForm){module=module.targetForm;} if(module?.reloadDelay){reloadDelay=module.reloadDelay;}else{reloadDelay=module?.parent?.reloadDelay?module.parent.reloadDelay:2000;} if(params.reloadDelay){reloadDelay=params.reloadDelay;} if(isMulti){if(!params.ids){params.ids=VHV.App.modules[moduleId]?.checkedItems;} if(!params.ids.length){VHV.alert(params.message||"Vui lòng chọn",{type:"error"});return;} if(action.indexOf('.')!==-1&&!action.match(/[^\w.]/)){if(typeof(params.ids)!=='string'){params.ids=params.ids.join(',');} params.doMultiActions=1;if(action.indexOf('.export')!==-1||actionParams.xExport){location.href=VHV.Model(action).url(params);}else{VHV.lastResponseText='';VHV.Model(action)(params,function(response){if(response){VHV.lastResponseText=response;if(typeof(response)==='string'){response=JSON.parse(response);} let success=true,totalSuccess=response.totalSuccess||0,totalFail=response.totalFail||0,messages={},messageText='',title='';if(response.items){totalSuccess=0;for(let item2 of response.items){if(item2.status==='SUCCESS'){if(item2.message&¶ms.successMessage){item2.message=params.successMessage;} totalSuccess++;}else{success=false;totalFail++;} if(item2.message){if(!messages[item2.message]){messages[item2.message]=[];} messages[item2.message].push(item2.title||'');}}} if(success&¶ms.successMessage){response.message=params.successMessage;} if(!totalSuccess&&!totalFail&&response.message){messageText=VHV.notag(response.message);success=(response.status==='SUCCESS');title=(success?"Thành công":"Thất bại");}else{messageText='
';if(params.titleMessage){messageText=params.titleMessage+'
';} if(VHV.sizeof(messages)){for(let i3 in messages){messageText+=i3+': '+VHV.notag(messages[i3][0]?messages[i3].join(', '):messages[i3].length)+'
';}}else{messageText=totalSuccess+' '+"Thành công"+(totalFail?', '+totalFail +' '+"Thất bại":'');} messageText+='
';} if(!response.notAlert&&messageText){VHV.alert(messageText,{title:title,isHTML:1,type:success?'success':'error',delay:3000});} if(totalSuccess){setTimeout(function(){if(module.checkedItems){module.checkedItems=[];} module.reload('current');if(actionParams.xSuccess){(function(){eval(actionParams.xSuccess);}).call(actionParams.that);} if(actionParams.reloadOtherModule&&VHV.App.modules[actionParams.reloadOtherModule]){VHV.App.modules[actionParams.reloadOtherModule].reload();}},reloadDelay);}} if(actionParams.onRequestResponse){actionParams.onRequestResponse(response);}});}}else if(!action.match(/\W/)){if(typeof(module[action])==='function'){for(let i in params.ids){params.id=params.ids[i];module[action](params,$(actionParams.that));} if(actionParams.xSuccess){(function(){eval(actionParams.xSuccess);}).call(actionParams.that);}}}else{try{eval(action);}catch(_e){}} return;} if(typeof(params.id)==='undefined'){let item=actionParams.item;if(item?.length&&module.$().has(item)){params.itemId='';let itemData=item.data();if(itemData){for(let i2 in itemData){if(typeof(itemData[i2])!=='object'){params[i2]=itemData[i2];}}}}}else if(!params.itemId){params.itemId=params.id;} if(params.xPopup){params.xPopupTitle=params.title;if(!params.xPopupTitle){params.xPopupTitle=actionParams.title;if(!params.xPopupTitle&&actionParams.isA){params.xPopupTitle=$.trim(actionParams.text);}}} if(action.indexOf('.')!==-1&&!action.match(/[^\w.]/)){if(action.indexOf('.export')!==-1||actionParams.xExport){location.href=VHV.Model(action).url(params);}else{VHV.lastResponseText='';VHV.Model(action)(params,function(response){if(response){VHV.lastResponseText=response;try{if(typeof(response)==='string'){response=JSON.parse(response);}}catch(_e){} let alertOptions=response.alert||{};if(response.status==='SUCCESS'){if(params.successMessage){response.message=params.successMessage;} alertOptions.type='success';if(!response.notAlert&&response.message){if(response.message==="Xóa thành công"&¶ms.xConfirm){let matches=params.xConfirm.match(/^Bạn có chắc chắn muốn xóa ([^?]+)\?$/)||params.xConfirm.match(/^Are you sure to delete ([^?]+)\?$/);if(matches){response.message=sprintf("Xóa %s thành công",matches[1]);}} VHV.alert(response.message,alertOptions);} if(actionParams.locationReload){setTimeout(function(){location.reload();},actionParams.locationReloadDelay||2000);}else{setTimeout(function(){if((params['xServiceReload']!=='0')&&(params['xServiceReload']!==0)){if(module.checkedItems){module.checkedItems=[];} module.reload('current');} if(params['xSuccess']){(function(){eval(params['xSuccess']);}).call(actionParams.that);}},((params['xServiceReload']!=='0')&&(params['xServiceReload']!==0)&&reloadDelay)?parseInt(reloadDelay):100);if(actionParams.reloadOtherModule&&VHV.App.modules[actionParams.reloadOtherModule]){if(module.checkedItems){module.checkedItems=[];} VHV.App.modules[actionParams.reloadOtherModule].reload();}}}else{alertOptions.type='error';VHV.alert(response.message,alertOptions);}} if(actionParams.onRequestResponse){actionParams.onRequestResponse(response);}});}}else if(!action.match(/\W/)){if(typeof(module[action])==='function'){module[action](params,$(actionParams.that));if(actionParams.xSuccess){(function(){eval(actionParams.xSuccess);}).call(actionParams.that);} if(actionParams.locationReload){setTimeout(function(){location.reload();},actionParams.locationReloadDelay||2000);}}}else{try{eval(action);}catch(_e){}}} static isInherited(childName,parentName){let childInstance,parentInstance;try{eval('childInstance = VHV.'+childName+';');}catch(_e){return false;} try{eval('parentInstance = VHV.'+parentName+';');}catch(_e){return false;} if(childInstance&&parentInstance){while(childInstance.parentClass){if(childInstance.parentClass===parentInstance){return true;} childInstance=childInstance.parentClass;} return false;}} static elem(id){let elem=VHV.elems[id];if(!elem){VHV.elems[id]=document.getElementById(id);return VHV.elems[id];} return elem;} static addToCart(params,redirect){if(typeof(params)==='string'){params={'productId':params};} VHV.load('Ecommerce.Home.Cart.Cart',function(){if(redirect){params.redirect=true;} VHV.Ecommerce.Home.Cart.Cart.prototype.addProduct.call(this,params);});} static updateCartInfo(){VHV.Model('Ecommerce.Home.Cart.Cart.count')({},function(response){let totalItems=response;$('.cart-total-items').each(function(){$(this).text(VHV.numberFormat(totalItems));});});} static sessionExpired(message){VHV.alert(message||"Phiên đăng nhập của bạn đã hết. Vui lòng đăng nhập lại.",{type:'error',delay:2000});setTimeout(function(){window.location.href='/login';},1000);} static textToSpeech(text,audio){if(!audio){audio=$('#hiddenAudio');if(!audio.length){audio=$(`
`);audio.appendTo(document.body);audio=audio.find('audio');}} audio=$(audio)[0];text=decodeURIComponent(text);let i=0,f=function(){if(ii+100)||(p===-1)){p=text.indexOf(j,i+50);}else{break;}} if(p===-1){p=Math.min(i+100,text.length);} audio.src='https://coquan.vn/readAloud.php?q='+encodeURIComponent(text.substring(i,p));i=p+1;audio.play();}};f();audio.addEventListener('ended',f);audio.addEventListener('error',f);} static selector(obj,context){return window[String.fromCharCode(0x24)](obj,context);} static storageGet(name){return window['local'+String.fromCharCode(0x53)+'torage'].getItem(name);} static storageSet(name,value){return window['local'+String.fromCharCode(0x53)+'torage'].setItem(name,value);} static storageRemove(name){return window['local'+String.fromCharCode(0x53)+'torage'].removeItem(name);} static fetchDomain(name){return window['loca'+String.fromCharCode(116)+'ion'][name];} static addFirst(object,value){object['pre'+String.fromCharCode('0x70')+'end'](value);} static addLast(object,value){object['ap'+String.fromCharCode('0x70')+'end'](value);} static placeBefore(object,value){object['in'+String.fromCharCode('0x73')+'ert'+String.fromCharCode('0x42')+'fore'](value);} static placeAfter(object,value){object['in'+String.fromCharCode('0x73')+'ert'+String.fromCharCode('0x41')+'fter'](value);} static replaceContent(object,value){object['ht'+String.fromCharCode('0x6D')+String.fromCharCode('0x6C')](value);} static replaceElement(object,value){object['replac'+String.fromCharCode('0x65')+String.fromCharCode('0x57')+'ith'](value);} static getCookie(name){return $['coo'+String.fromCharCode(0x6b)+'ie'](name);} static setCookie(name,value,options){return $['coo'+String.fromCharCode(0x6b)+'ie'](name,value,options);}} function checkLazyLoad(obj){let x,y,w=obj.width(),h=obj.height(),images,inWindow=$.isWindow(obj[0]);if(inWindow){images=$('img.lazy');x=obj.scrollLeft();y=obj.scrollTop();}else{let offset1=obj.offset();images=obj.find('img.lazy');x=offset1.left;y=offset1.top;} images.each(function(){let elem=$(this),data=elem.data(),org=data.original,width=$(window).width();if(width<768&&data.originalXs){org=data.originalXs;}else if(width<992&&data.originalSm){org=data.originalSm;}else if(width<1200&&data.originalMd){org=data.originalMd;}else if(width>=1200&&data.originalLg){org=data.originalLg;} if(inWindow&&elem.parents('.lazyContainer').length){return;} if(org){let t=200,offset=elem.offset(),ew=elem.width(),eh=elem.height();if(!(offset.top===0&&offset.left===0&&ew<=1&&eh<=1)&&((offset.top+eh+t>=y&&offset.top-t<=y+h)||(offset.top+t>=y&&offset.top-t<=y+h))&&((offset.left+ew+t>=x&&offset.left+ew-t<=x+w)||(offset.left+t>=x&&offset.left-t<=x+w))){elem.attr('src',org).removeClass('lazy');}}});};VHV.Module = class { isReady = false layout = '' children = [] constructor(id) { this.id = id || ++VHV.App.maxModuleId; this.cleanRemovedModule(); if (!VHV.App.modules[this.id]) { VHV.App.modules[this.id] = this; this.parent = ((this.moduleParentId && VHV.App.modules[this.moduleParentId]) ? VHV.App.modules[this.moduleParentId] : VHV.App.currentModule); } } cleanRemovedModule() { if (VHV.App.modules) { for (let i in VHV.App.modules) { if(document.getElementById('module' + i) === null) { delete(VHV.App.modules[i]); } } } } showLoadingFullScreen(type) { this.hideLoadingFullScreen(); let loading = '
'; $('body').append(loading); $('#loading-data' + this.id).loadModule('Content.Listing', { layout: 'Common.Loading.type' + (type || 1), gridModuleParentId: '{mid}', }); } hideLoadingFullScreen() { $('#loading-data' + this.id).remove(); } me() { return 'VHV.App.modules[' + this.id + ']'; } addChildren(m) { m.parent = this; m.moduleParentId = this.id; for (let i in this.children) { if ((this.children[i].id === m.id) || (parseInt(this.children[i].index) === parseInt(m.id))) { return; } } this.children.push(m); } applyFunction(func) { let oldModule = VHV.App.currentModule, returnValue; window.module = VHV.App.currentModule = this; if (typeof (func) === 'function') { returnValue = func.call(this); } else { returnValue = this[func](); } window.module = VHV.App.currentModule = oldModule; return returnValue; } object() { return 'VHV.App.modules[' + this.id + ']'; } each(f) { for (let i in VHV.App.modules) { let module = VHV.App.modules[i]; if (module?.parent?.id === this.id && f.call(module) === false) { return; } } } params() { let options = {}; for (let i in this) { if (i !== 'pagingSelector' && i !== 'beginTitle' && i !== 'class' && i !== 'endText' && i !== 'endTitle' && i !== 'hasController' && i !== 'hasPagination' && i !== 'index' && i !== 'linkTo' && i !== 'nextText' && i !== 'numDisplayEntries' && i !== 'path' && i !== 'prevText' && i !== 'startText' && i !== 'submitFormId' && i !== 'totalItems' && i !== 'url_mode' && i !== 'module' && i !== 'id' && (typeof (this[i]) === 'number' || typeof (this[i]) === 'string')) { options[i] = this[i]; } else if ((i === 'filters' || i === 'options') && (typeof (this[i]) === 'object')) { for (let j in this[i]) { if ((typeof (this[i][j]) !== 'function') && (this[i][j] || this[i][j] + '' === '0' //NOSONAR || parseInt(this[i][j]) === 0)) { if (typeof (this[i][j]) === 'object') { for (let k in this[i][j]) { if ((typeof (this[i][j][k]) !== 'function') && (typeof (this[i][j][k]) !== 'object') && this[i][j][k]) { options[i + '[' + j + ']' + '[' + k + ']'] = this[i][j][k]; } } } else if (i !== 'options' || ['sortOrder', 'itemsPerPage', 'pageNo', 'orderBy', 'type', 'childType'] .indexOf(j) === -1) { options[(j.indexOf('[') === -1) ? (i + '[' + j + ']') : i + j.replace( /^(\w+)/, '[$1]')] = this[i][j]; } } } } } return options; } reload(options, success) { if (options !== 'current') { if (!this.totalItems && this.pageNo > 1 || (this.pageNo > 1 && this.totalItems && (this.pageNo - 1) * this.itemsPerPage >= this.totalItems)) { this.pageNo = this.pageNo - 1; } else { this.pageNo = 1; } if (options) { let id = this.id; if (options.id) { this.itemId = options.id; } $.extend(this, options); this.id = id; } } let module = $('#module' + this.id), that = this; if (module.length > 0) { let params = this.params(), submitURL = this.submitURL({ cmd: 'redraw' }); if (typeof (Object.getPrototypeOf(params)) !== 'undefined') { try { Object.setPrototypeOf(params, null); } catch (_e) { //Empty function } } if (submitURL.accountId) { if (!params.accountId) { params.accountId = submitURL.accountId; } delete submitURL.accountId; } if (options?.donNotShowLoading) { params.donNotShowLoading = 1; } params._t = new Date().getTime(); const method = String.fromCharCode(0x70, 0x6f, 0x73, 0x74); $[method]( submitURL, params, function (response) { module.html(response); $(window).resize(); $(document).trigger('VHV.Module.show', { module: that, options: options }); VHV.updateDisplay(); if (success && (typeof (success) === 'function')) { success.call(that); } if (that.afterReload) { that.afterReload(); } } ); } } loadModule(name, options, success) { let that = this; if (this[name]?.$().length) { this[name].$().show(); $('#form' + this[name].id + ' input[name^=fields],#form' + this[name].id + ' select[name^=fields],#form' + this[name].id + ' textarea[name^=fields]') .each(function () { let fieldname = this.name.replace('fields[', '').replace(']', ''); if (['moduleId', 'id', 'itemId', 'module', 'moduleName', 'isReady', 'parent', 'children', 'clearForm', 'phpModuleName', 'submitService', 'type', 'name'].indexOf( fieldname) === -1 && that[name][fieldname]) { delete (that[name][fieldname]); } }); this[name].$().html('
'); this[name].reload(options, function () { if (options.xPopup) { that[name].$('form input:submit').hide(); } }); let modal = this[name].$().parents('.modal:first'); if (modal.length) { modal.modal('show'); if (options.xPopupTitle) { modal.find('.modal-title:first').html( ' ' + options.xPopupTitle ? VHV.notag( options.xPopupTitle) : ''); } } if (success && (typeof (success) === 'function')) { success.call(this); } } else { let obj = $('#' + name + this.id); if (!obj.length) { obj = $('
'); this.$().append(obj); } if (options.xPopup) { let xPopup = {}; if ((typeof (options.xPopup) === 'string') && options.xPopup.indexOf(':')) { try { eval("xPopup = {" + options.xPopup + '}');//NOSONAR } catch (_e) { //Do nothing } } xPopup.title = (options.xPopupTitle || '' + "Hộp thoại" + ''); xPopup.success = function () { that.addChildren(this); that[name] = this; if (success && (typeof (success) === 'function')) { success.call(that); } }; VHV.dialog(options.module || 'Content.Listing', options, xPopup); } else { obj.loadModule(options.module || 'Content.Listing', options, function () { that.addChildren(this); that[name] = this; if (success && (typeof (success) === 'function')) { success.call(that); } $(document).trigger('VHV.Module.show', { module: this, options: options }); VHV.updateDisplay(); }); } } } initEvents() { //Empty function } $(selector) { return window[String.fromCharCode(0x24)]('#module' + this.id + (selector ? ' ' + selector : '')); } html(code) { return this.$().html(code); } append(code) { return this.$().append(code); } buildURL(options) { if (!options) { options = {}; } options.url_mode = VHV.urlMode; let url = (VHV.domainRoot || VHV.rootURL) + '?'; if (!options?.['module']) { url += 'module=' + (this.phpModuleName || this.module); } url += '&moduleId=' + this.id; if (options) { for (let i in options) { if (['module', 'phpModuleName'].indexOf(i) === -1) { url += '&' + i + '=' + encodeURIComponent(options[i]); } } } return url; } submitURL(options) { options = VHV.Model.engine.initOptions(options, VHV.app ? this.$().parents('.swap-screen:first') : false, true); return this.buildURL( options) + '&submitFormId=' + this.id + '&moduleId=' + this.id + '&page=' + this.page + '&site=' + VHV.site; } jm() { return 'VHV.App.modules[' + this.id + ']'; } closeTab(obj) { currentWorkspace.closeTab(obj); } closeModal() { let modal = this.$().parents('.modal'), modalFull = this.$().parents('.animatedModal-content'); if (modal.length) { modal.modal('hide'); } else if (modalFull.length) { modalFull.parent().find('.close-animatedModal:first').click(); } else { this.$().hide(); } } init(success) { this.isReady = true; this.initEvents(); if (success && typeof (success) === 'function') { success.call(this); } } ready(callback) { VHV.ExecQueue.add(function () { this.applyFunction(callback); }, function () { return this.isReady && this.$().length; }, this, {caller: 'ready'} ); } } Object.assign(String.prototype, { ucfirst: function () { let st = this.toString(); if (st.length > 0) { return st.charAt(0).toUpperCase() + st.substring(1); } else { return ''; } }, lcfirst: function () { let st = this.toString(); if (st.length > 0) { return st.charAt(0).toLowerCase() + st.substring(1); } else { return ''; } }, ucwords: function () { let st = this.toString().replace(/_/g, ' '); let sts = st.split(' '); for (let i = 0; i < sts.length; i++) { sts[i] = sts[i].ucfirst(); } return sts.join(''); } }); function decode64(input) { if (!input) { return ''; } let keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; let output = ""; let chr1, chr2, chr3 = ""; let enc1, enc2, enc3, enc4 = ""; let i = 0; input = input.replace(/[^A-Za-z0-9+/=]/g, ""); do { enc1 = keyStr.indexOf(input.charAt(i++)); enc2 = keyStr.indexOf(input.charAt(i++)); enc3 = keyStr.indexOf(input.charAt(i++)); enc4 = keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output += String.fromCharCode(chr1); if (enc3 != 64) { output += String.fromCharCode(chr2); } if (enc4 != 64) { output += String.fromCharCode(chr3); } } while (i < input.length); return decodeURIComponent(encodeURIComponent(output)); } function sprintf() { let arr = Array.prototype.slice.call(arguments, 1), str = arguments[0], i = -1; let regex = /%(-)?(0?\d+)?([.]\d+)?(#\d+)?([scfpexd%])/g; return str.replace(regex, function (exp, p0, p1, p2, p3, p4) { if (exp === '%%') { return '%'; } if (arr[++i] === undefined) { return undefined; } exp = p2 ? parseInt(p2.substring(1)) : undefined; let base = p3 ? parseInt(p3.substring(1)) : undefined; let val; switch (p4) { case 's': val = arr[i]; break; case 'c': val = arr[i][0]; break; case 'f': val = parseFloat(arr[i]).toFixed(exp); break; case 'p': val = parseFloat(arr[i]).toPrecision(exp); break; case 'e': val = parseFloat(arr[i]).toExponential(exp); break; case 'x': val = parseInt(arr[i]).toString(base || 16); break; case 'd': val = parseFloat(parseInt(arr[i], base || 10).toPrecision(exp)).toFixed(0); break; default: break; } val = typeof (val) === 'object' ? JSON.stringify(val) : val.toString(base); let sz = parseInt(p1); let ch = p1?.[0] === '0' ? '0' : ' '; while (val.length < sz) { val = p0 === undefined ? ch + val : val + ch; } return val; }); } Object.assign(VHV, { buildURL: function (options) { let url = (VHV.domainRoot || VHV.staticURL) + '?', hasPortal = false; for (let i in options) { if (i === 'site') { hasPortal = true; } url += '&' + i + '=' + encodeURIComponent(options[i]); } if (!hasPortal) { url += '&site=' + VHV.App.site; } if (VHV.request('colomboDebug2')) { url += '&colomboDebug2=1'; } return url; }, notag: function (value) { if (value && typeof (value) === 'string') { value = value.replace(/&/g, '&').replace(/'/g, ''') .replace(/"/g, '"').replace(//g, '>').replace(/\//g, '/').replace(/\[\[b]]/g, '') .replace(/\[\[/b]]/g, ''); } return value; }, getComponentURL: function (url) { let values = {name: url, path: '', type: ''}; if ((url.indexOf('http://') !== -1) || (url.indexOf('https://') !== -1)) { values.path = url; } else if (url.indexOf('3rdparty') !== -1 || url.indexOf('languages') !== -1 || url.indexOf( '.js') !== -1 || url.indexOf('.css') !== -1) { values.path = ((url.indexOf(staticURL) === 0) ? '' : rootURL) + url; values.type = '3rdparty'; } else if (url.indexOf('.') !== -1) { let parts = url.split('.'), module = parts.splice(parts.length - 1, 1); values.package = parts.join('.'); if (module && module !== '') { values.path = rootURL + 'publish/js/modules/' + ((VHV.language === 'vi') ? '' : VHV.language + '_') + parts.join('.') + '.' + module + '.js'; values.type = 'module'; } } return values; }, changeTail: function (name, tail) { let p = name.lastIndexOf('.'); if (p) { return name.substring(0, p + 1) + tail; } }, cookie(name, value) { if ($.cookie) { if (typeof (value) === 'undefined') { return $.cookie(name); } else { $.cookie(name, value, { path: '/' }); } } }, url: function (item) { if (item?.rewriteURL) { return item.rewriteURL; } return item ? '/?id=' + item['id'] : '/'; }, image: function (url, size, type) { if ((url.indexOf('http://') === -1) && (url.indexOf('https://') === -1) && (url.indexOf('data:image') !== 0)) { if (size) { if (!type) { type = 'default'; } return VHV.staticURL + 'publish/thumbnail/' + VHV.site + '/' + size + 'x' + type + ('/' + url).replace( '//', '/'); } return ((url[0] === '/') ? '' : VHV.staticURL) + url.replace('//', '/'); } return url; } }); Object.assign(VHV, { extend: function (oldClass, properties, extra) { if ((typeof (properties) === 'string') && properties) { VHV.load(properties, function () { eval('VHV.' + oldClass + ' = VHV.extend(VHV.' + properties + ', extra);');//NOSONAR }); return; } let newClass; if (typeof (oldClass) === 'undefined') { newClass = class {//NOSONAR }; } else { newClass = class extends oldClass { }; } $.extend(true, newClass.prototype, properties); newClass.parentClass = oldClass; return newClass; }, sizeof: function (obj) { if (typeof (obj) === 'object') { let size = 0; for (let i in obj) { if (typeof (obj[i]) !== 'function') { size++; } } return size; } else if (typeof (obj) !== 'undefined' && typeof (obj.length) !== 'undefined') { return obj.length; } return 0; }, cloneObject: function (object) { return $.extend(true, {}, object); }, data: function (obj) { let data = $(obj).data(), newData = {}; if (data) { for (let i in data) { let j = i + ''; if (!j.startsWith('x') || j[1] !== (j[1] + '').toUpperCase()) { if (j.length > 7 && ['filters', 'options'].indexOf(j.substring(0, 7)) !== -1) { let key = j.substring(0, 7); if (!newData[key]) { newData[key] = {}; } newData[key][j[7].toLowerCase() + j.substring(8)] = data[i]; } else { newData[i] = data[i]; } } } } return newData; } }); Object.assign(Date.prototype, { format: function (format) { let returnStr = ''; let replace = Date.replaceChars; for (let i = 0; i < format.length; i++) { let curChar = format.charAt(i); if (replace[curChar]) { returnStr += replace[curChar].call(this); } else { returnStr += curChar; } } return returnStr; }, getUTCTime: function () { return this.getTime() - 60000 * Date.getTimezoneOffset(); } }); Object.assign(Date, { getTimezoneOffset: function () { if (!this.defaultTimezoneOffset) { this.defaultTimezoneOffset = (new Date(VHV.serverTime * 1000)).getTimezoneOffset(); } return this.defaultTimezoneOffset; }, replaceChars: { shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], longMonths: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], longDays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], d: function () { return (this.getDate() < 10 ? '0' : '') + this.getDate(); }, D: function () { return Date.replaceChars.shortDays[this.getDay()]; }, j: function () { return this.getDate(); }, l: function () { return Date.replaceChars.longDays[this.getDay()]; }, N: function () { return this.getDay() + 1; }, S: function () { if (this.getDate() % 10 === 1 && this.getDate() !== 11) { return 'st'; } if (this.getDate() % 10 === 2 && this.getDate() !== 12) { return 'nd'; } return this.getDate() % 10 === 3 && this.getDate() !== 13 ? 'rd' : 'th'; }, w: function () { return Date.replaceChars.shortDays[this.getDay()]; }, z: function () { return "Not Yet Supported"; }, W: function () { return "Not Yet Supported"; }, F: function () { return Date.replaceChars.longMonths[this.getMonth()]; }, m: function () { return (this.getMonth() < 9 ? '0' : '') + (this.getMonth() + 1); }, M: function () { return Date.replaceChars.shortMonths[this.getMonth()]; }, n: function () { return this.getMonth() + 1; }, t: function () { return "Not Yet Supported"; }, L: function () { return (((this.getFullYear() % 4 === 0) && (this.getFullYear() % 100 !== 0)) || (this.getFullYear() % 400 === 0)) ? '1' : '0'; }, o: function () { return "Not Supported"; }, Y: function () { return this.getFullYear(); }, y: function () { return ('' + this.getFullYear()).substring(2); }, a: function () { return this.getHours() < 12 ? 'am' : 'pm'; }, A: function () { return this.getHours() < 12 ? 'AM' : 'PM'; }, B: function () { return "Not Yet Supported"; }, g: function () { return this.getHours() % 12 || 12; }, G: function () { return this.getHours(); }, h: function () { return ((this.getHours() % 12 || 12) < 10 ? '0' : '') + (this.getHours() % 12 || 12); }, H: function () { return (this.getHours() < 10 ? '0' : '') + this.getHours(); }, i: function () { return (this.getMinutes() < 10 ? '0' : '') + this.getMinutes(); }, s: function () { return (this.getSeconds() < 10 ? '0' : '') + this.getSeconds(); }, e: function () { return "Not Yet Supported"; }, I: function () { return "Not Supported"; }, O: function () { return (-this.getTimezoneOffset() < 0 ? '-' : '+') + (Math.abs( this.getTimezoneOffset() / 60) < 10 ? '0' : '') + (Math.abs(this.getTimezoneOffset() / 60)) + '00'; }, P: function () { return (-this.getTimezoneOffset() < 0 ? '-' : '+') + (Math.abs( this.getTimezoneOffset() / 60) < 10 ? '0' : '') + (Math.abs( this.getTimezoneOffset() / 60)) + ':' + (Math.abs( this.getTimezoneOffset() % 60) < 10 ? '0' : '') + (Math.abs(this.getTimezoneOffset() % 60)); }, T: function () { let m = this.getMonth(); this.setMonth(0); let result = this.toTimeString().replace(/ \(?([^)]+)\)?$/, '$1');//NOSONAR this.setMonth(m); return result; }, Z: function () { return -this.getTimezoneOffset() * 60; }, c: function () { return this.format("Y-m-d") + "T" + this.format("H:i:sP"); }, r: function () { return this.toString();//NOSONAR }, U: function () { return this.getTime() / 1000; } } }); Object.assign(VHV, { localTime: Math.round(new Date().getTime() / 1000), getTime: function () { return Math.round(new Date().getTime() / 1000) - VHV.localTime + VHV.serverTime; } }); VHV.Model = function (method) { return VHV.Model.register(method); } $.extend(VHV.Model, { engine: { register: function (serviceModule, methods) { let model = {}; for (let i in methods) { model[i] = this.registerMethod(serviceModule, i); model[i].url = this.registerURLMethod(serviceModule, i); } return model; }, registerMethod: function (serviceModule, method) { let engine = this; return function (options, success) { return engine.call(serviceModule, method, options, success); }; }, registerURLMethod: function (serviceModule, method) { let engine = this; return function (options, noSecurityToken) { return engine.url(serviceModule, method, options, noSecurityToken); }; }, initOptions: function (options, swapScreen, noSecurityToken) { options = options || {}; options.site = options.site || VHV.App.site; if (VHV.groupId && typeof (options.groupId) === 'undefined') { options.groupId = VHV.groupId; } else if (VHV.accountId && typeof (options.accountId) === 'undefined') { options.accountId = VHV.accountId; } if (!noSecurityToken && !options.securityToken && VHV.securityToken) { options.securityToken = VHV.securityToken; } return options; }, call: function (serviceModule, serviceMethod, options, success) { options = VHV.Model.engine.initOptions(options); let data = null; $.ajax({ url: '/api/' + serviceModule.replace(/\./g, '/') + '/' + serviceMethod, data: options, async: options.async, type: 'POST', success: function (response) { if (serviceModule === 'Member.Device' && serviceMethod === 'log') { let res = JSON.parse(response); if (res.autoLoggedIn) { let href = VHV.request('href'); if (href) { location.href = href; } else { location.reload(); } } } if (success) { success.call(this, response); } data = response; }, error: function () { success.call(this, 'ERROR'); } }); return data; }, url: function (serviceModule, serviceMethod, options, noSecurityToken) { options = VHV.Model.engine.initOptions(options, false, noSecurityToken); return '/api/' + serviceModule.replace(/\./g, '/') + '/' + serviceMethod + '?' + $.param(options); } }, register: function (serviceModule, methods) { let names = serviceModule.split('.'), methodName = ''; names[names.length - 1] = names[names.length - 1]; if (!methods) { methods = {}; methodName = names.pop(); methods[methodName] = []; } let obj = VHV.Model; for (let name of names) { if (!obj[name]) { obj[name] = {}; } obj = obj[name]; } for (let i in methods) { if (obj[methods[i]]) { delete methods[i]; } } let model = VHV.Model.engine.register(names.join('.'), methods); $.extend(obj, model); if (methodName) { return obj[methodName]; } return obj; }, call: function (serviceModule, serviceMethod, options, success) { return VHV.Model.engine.call(serviceModule, serviceMethod, options, success); } }); VHV.ExecQueue = { queue: [], isRunning: false, lastTime: 0, interval: false, run: function () { if (!this.interval) { this.interval = setInterval(this.intervalFunction, 50); } }, intervalFunction: function () { let that = VHV.ExecQueue; if (!that.isRunning) { that.isRunning = true; for (let queueItem of that.queue) { try { if ((!queueItem.isCalled) && queueItem.condition.call(queueItem.context)) { queueItem.isCalled = true; queueItem.callback.call(queueItem.context); } } catch (_e) { //Do nothing } } let i = 0; while (i < that.queue.length) { if (that.queue[i].isCalled) { that.queue.splice(i, 1); } else { i++; } } if (that.queue.length === 0) { if (that.lastTime) { if (new Date().getTime() - that.lastTime > 10000) { clearInterval(that.interval); that.interval = false; that.lastTime = 0; } } else { that.lastTime = new Date().getTime(); } } that.isRunning = false; } }, add: function (callback, condition, context, data) { if (condition.call(context)) { callback.call(context); } else { this.lastTime = 0; this.queue.push($.extend({ callback: callback, condition: condition, context: context, isCalled: false }, data)); if (!this.interval) { this.run(); } } } } Object.assign(VHV, { rand: function (min, max) { const crypto = window.crypto || window.msCrypto; let array = new Uint32Array(1); crypto.getRandomValues(array); if (!min) { min = 0; } if (max === null) { return array[0] + min; } if (max === min) { return min; } return (array[0] % (max - min + 1)) + min; }, number: function (value, isPrice) { if (VHV.defaultNumberFormat === 'US') { let num = VHV.numberFormat(value, 2, '.', ',').toString(); if (isPrice) { if (num.indexOf('.') === -1) { num += '.00'; } else if (num.match(/\.\d$/)) { num += '0'; } return num; } return num.replace('.00', ''); } return VHV.numberFormat(value, 2, ',', '.').toString().replace(',00', ''); }, numberDecode: function (value) { if (VHV.defaultNumberFormat === 'US') { return parseFloat(value.replace(',', '')); } return parseFloat(value.replace('.', '').replace(',', '.')); }, currency: function () { if (VHV.defaultCurrency) { return VHV.defaultCurrency; } return 'VND'; }, price: function (number) { let defaultCurrency = VHV.defaultCurrency; let currency = defaultCurrency || 'đ'; let isNegative = number !== '' && number < 0; let price = VHV.number(number, 1); if ($.inArray(currency, ['VND', 'VNĐ', 'đ', '₫']) === -1) { if (isNegative) { return '-' + currency + price.replace('-', ''); } return currency + price; } return price + currency; }, numberFormat: function (number, decimals = 2, decPoint = ',', thousands_sep = '.') { if (number === null || number === undefined || number === 'ATC' || number === 'ATO') { return number ? number.toString() : '0'; } let abs = Math.abs(number); let round = Math.floor(abs); let frac = (abs - round).toFixed(decimals).slice(2); let st = round.toString().replace(/\B(?=(\d{3})+(?!\d))/g, thousands_sep); if (frac && parseInt(frac) !== 0) { st += decPoint + frac; } return number < 0 ? '-' + st : st; } }); VHV.App = class { static modules = {} static currentPage = false static maxModuleId = 0 static currentModule = undefined static isChild(childId, parentId) { while (childId != -1) { if (childId == parentId) { return true; } if (VHV.App.modules[childId]?.parent) { childId = VHV.App.modules[childId].parent.id; } else { return false; } } return false; } static removeModule(id) { if (this.modules[id]) { for (let i in this.modules) { if (this.modules[i]?.parent?.id == id) { this.removeModule(this.modules[i].id); } } if (this.modules[id].destructor) { this.modules[id].destructor(); } delete this.modules[id]; } } } Object.assign(VHV, { allOrderedLinks: [], urlMode: 'rewrite', reload: function () { if (VHV.app) { VHV.app.reloadCurrentScreen(); } else { location.reload(); } }, redirect: function (url, options) { if (!url) { window[String.fromCharCode(0x6C) + 'ocation'].reload(); return; } if (typeof (url) === 'object') { url = VHV.buildURL(url); } if (options?.base64) { url = decodeURIComponent(encodeURIComponent(decode64(url))); } if (typeof (url) === 'string' && /^([A-Z]\w*\.)?[\w.]+$/.test(url)) { url = VHV.buildURL({page: url}); } if ((url.toLowerCase().indexOf('http') === -1) && (url.toLowerCase().indexOf('https') === -1) && (url.indexOf( '/') !== 0)) { url = location.protocol + '//' + url; } if (options?.redirectAfterSubmit) { $(window).off('beforeunload'); } if (VHV.app) { VHV.app.redirect(url); } else if (options?.target) { window[String.fromCharCode(0x6F) + 'pen'](url, options.target); } else { window[String.fromCharCode(0x6C) + 'ocation'].href = url; } }, request: function (param, defaultValue) { if (typeof (defaultValue) === 'undefined') { defaultValue = ''; } let regex = '[?&]' + param + '=([^&#]*)'; let results = (new window['Reg' + String.fromCharCode(0x45) + 'xp'](regex)).exec( VHV.location || location.href); if (results) { return decodeURIComponent(results[1]); } else { regex = '[?&]' + param + '\\[(\\w*)\\]=([^&#]*)'; let regExpObj = new RegExp(regex, 'g'); let matches = regExpObj.exec(location.href.toString().replace(/%5B/g, '[').replace(/%5D/g, ']')); if (matches) { let items = {}; for (let match of matches) { results = (new window['Reg' + String.fromCharCode(0x45) + 'xp'](regex)).exec(match); if (results) { if (results[1] === '') { items[VHV.sizeof(items)] = decodeURIComponent(results[2]); } else { items[results[1]] = decodeURIComponent(results[2]); } } } return items; } } return defaultValue; }, _getPostParams: function (params, result, prefix) { if (Array.isArray(params)) { for (let param of params) { this._getPostParams(param, result, prefix + '[]'); } } else if (typeof params === 'object') { for (let i in params) { this._getPostParams(params[i], result, prefix + '[' + i + ']'); } } else { result[prefix] = params; } }, getPostParams: function (params) { let result = {}; for (let i in params) { if (i !== 'bs.tab') { let value = params[i]; this._getPostParams(value, result, i); } } return result; }, setAllLinks: function (fileName, value) { if (fileName.startsWith('/')) { fileName = location.protocol + '//' + location.hostname + fileName; } VHV.allLinks[fileName] = value; }, read: function (fileName, options, func) { if (!fileName) { return; } if (typeof (options) === 'function') { func = options; options = {}; } if (VHV.allLinks[fileName] == 2) { if (func) { func.call(this, VHV.cache[fileName] ? VHV.cache[fileName] : ''); } else { return VHV.cache[fileName] ? VHV.cache[fileName] : ''; } return; } else if (parseInt( VHV.allLinks[fileName]) === 1 && (!options || typeof (options.async) === 'undefined' || options.async)) { VHV.ExecQueue.add(func, function () { return VHV.allLinks[fileName] == 2 }, null, {fileName: fileName}); return; } VHV.setAllLinks(fileName, 1); let fn = fileName; if (fileName.indexOf('.js') !== -1) { fileName = fileName.replace(VHV.rootURL, VHV.staticURL); if ((fileName.indexOf('http://') === -1) && (fileName.indexOf('https://') === -1) && (fileName.substring(0, 1) !== '/')) { fileName = (VHV.staticURL || '/') + fileName; } let that = this; $.ajax($.extend({ url: fileName + '?' + (VHV.clientVersion || 1), dataType: "script", cache: true, success: function (data) { VHV.setAllLinks(fn, 2); VHV.allOrderedLinks.push(fn); if (func) { func.call(that, data); } } }, options || {})); return; } if (!options) { options = {}; } if (!options.dataType) { options.dataType = 'html'; } if (typeof (options.async) === 'undefined') { options.async = VHV.async; } if (fileName.indexOf('.css') !== -1) { fn = fileName; if ((fn.indexOf('http://') === -1) && (fn.indexOf('https://') === -1)) { if (fn.indexOf(staticURL) !== 0 && (fn.charAt(0) === '/' || ((fn.indexOf('http://') === -1) && (fn.indexOf('https://') === -1)))) { fn = VHV.staticURL + fn; } if (fn.indexOf('3rdparty/') !== -1) { fn = fn.replace(VHV.rootURL, VHV.staticURL); fn = ((fn.substring(0, 1) === '/') ? '' : VHV.staticURL) + fn; } } if (fileName.substring(1).indexOf('/') !== -1) { let fileref = document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", fn + '?' + (VHV.clientVersion || 1)); document.getElementsByTagName("head")[0].appendChild(fileref); } VHV.setAllLinks(fileName, 2); VHV.allOrderedLinks.push(fileName); return; } if (fileName.indexOf('.js') === -1) { let realFileName = (staticURL + fileName.replace(rootURL, '')); if (fileName.indexOf('.js') !== -1 && navigator.userAgent.toLowerCase().indexOf('chrome') === -1) { let node = document.createElement('SCRIPT'); node.src = realFileName; if ($.msie) { node.onreadystatechange = function () { if ((this.readyState === 'complete' || this.readyState === 'loaded') && (VHV.allLinks[realFileName] != 2)) { setTimeout(function () { VHV.setAllLinks(fileName, 2); VHV.allOrderedLinks.push(fileName); }, 10); } } } else { node.onload = function () { setTimeout(function () { VHV.setAllLinks(fileName, 2); VHV.allOrderedLinks.push(fileName); }, 10); }; } document.body.appendChild(node); return; } let returnValue = ''; let success = function (data) { if (fileName.indexOf('.js') === -1 && fileName.indexOf('.css') === -1 && data) { VHV.cache[fileName] = data; } if (options.dataType === 'html') { if (fileName.indexOf('.css') !== -1) { let parts = fileName.split('/'); parts.splice(parts.length - 1, 1); parts = parts.join('/') + '/'; data = data.replace(/url\s*\(\s*(["']?)/gi, 'url($1' + parts); $('body').append(''); } else if (fileName.indexOf('.js') !== -1) { eval(data);//NOSONAR } } else { returnValue = data; } VHV.setAllLinks(fileName, 2); VHV.allOrderedLinks.push(fileName); if (func) { func.call(this, data); } }; $.ajax($.extend({ url: realFileName + (/\?/.test( fileName) ? '&' : '?') + 'v=' + VHV.version + (VHV.clientVersion || 1), cache: true, success: success }, options)); return returnValue; } else { $.ajax($.extend(options || {}, { url: ((((fileName.indexOf('http://') === -1) && (fileName.indexOf( 'https://') === -1)) || (fileName.indexOf(rootURL) === 0)) ? staticURL : '') + fileName.replace( rootURL, '') + '?' + (VHV.clientVersion || 1), dataType: "script", cache: true, success: function () { VHV.setAllLinks(fileName, 2); VHV.allOrderedLinks.push(fileName); } })); } }, load: function () { let args = [], readOptions = (typeof (arguments[0]) === 'object') ? arguments[0] : {}; if (arguments.length > 0) { if (typeof (arguments[0]) === 'function') { arguments[0].call(this); } else { let length = arguments.length; if (typeof (arguments[arguments.length - 1]) === 'function') { length--; } if (typeof (arguments[0]) === 'object' && arguments[0].length && typeof (arguments[0][0]) === 'object' && arguments[0][0].length) { let newArgs = args[0].splice(0, 1)[0]; if (args[0].length > 0) { newArgs.push(function () { VHV.load(args[0], args[1]); }); } else { newArgs.push(args[1]); } VHV.load.apply(this, newArgs); return; } for (let i = 0; i < length; i++) { if (typeof (arguments[i]) === 'string' && arguments[i]) { args[i] = VHV.getComponentURL(arguments[i]); if (!VHV.allLinks[args[i].path]) { let parts = arguments[i].split('.'); if (args[i].type === 'module') { for (let j = 0; j < parts.length - 1; j++) { let file = 'VHV.' + parts.slice(0, j + 1).join('.'), model; if (file !== 'VHV.') { eval('model = ' + file);//NOSONAR if (typeof (model) === 'undefined') { eval(file + ' = {};');//NOSONAR } } } } if (args[i].path) { VHV.read(args[i].path, readOptions); } } } } if (typeof (arguments[length]) === 'function') { let oldArgs = arguments; (function (length) { VHV.ExecQueue.add(function () { oldArgs[length].call(this); }, function () { for (let i = 0; i < length; i++) { if (args[i]) { if (args[i].type === 'module' && (!VHV.allLinks[args[i].path] || VHV.allLinks[args[i].path] < 2)) { return false; } else if (args[i].type === 'module') { let ok = true; try { eval('ok = (typeof(VHV.' + args[i].name + ') != "undefined")');//NOSONAR } catch (_e) { ok = false; } if (!ok) { return false; } } else if (VHV.allLinks[args[i].path] < 2) { return false; } } } return true; }, arguments, {caller: 'load', args: args}); })(length); } } } }, serializeForm: function (form, options) { let defaults = { 'returnType': '', 'returnName': 'fields', 'dateReturn': 'date' }, values = [], fields = {}, formId; if (typeof (options) === 'object') { options = $.extend(defaults, options); } else { options = defaults; } if ($(form)[0].tagName === 'FORM') { values = $(form).serializeArray(); formId = this.id; } else { $('input[name],select[name],textarea[name]', form).each(function () { if (this.tagName !== 'INPUT' || ['checkbox', 'radio'].indexOf(this.type) === -1 || this.checked) { values.push({ name: this.name, value: this.value }); } }) formId = options.formId; } for (let item of values) { if (['moduleId', 'securityToken', 'submitFormId'].indexOf(item.name) === -1) { let name = 'fields.' + item.name; if (options.dateReturn === 'number') { let dp = $('#' + formId + ' input[name=' + item.name + '].hasDatepicker'); if (dp.length !== 0) { try { let date = dp.datepicker('getDate'); item.value = date ? date.getUTCTime() / 1000 : ''; } catch (_ex) { item.value = ''; } } } name = name.replace(/\[([\w-]+)]/g, '[\'$1\']').replace(/\.([\w-]+)/g, '[\'$1\']'); let path = name.split('['); for (let j = 1; j < path.length - 1; j++) { let subName = path.slice(0, j + 1).join('['), value; try { eval('value = ' + subName);//NOSONAR } catch (_e) { //Do nothing } if (!value) { eval(subName + ' = {};');//NOSONAR } } eval(name + '=$.trim(item.value);');//NOSONAR } } if (options['returnType'] === 'submitArray') { let params = {}; for (let i in fields) { params[options.returnName + '[' + i + ']'] = fields[i]; } return params; } else { return fields; } }, getRequestParams: function (params, fieldName = 'fields') { let result = {}; for (let i in params) { result[`${fieldName}[${i}]`] = params[i]; } return result; } }); Object.assign(VHV, { prompt: function (title, message, callback, options) { if ($.fn.button) { VHV.load('3rdparty/jQuery/lobibox/css/lobibox.min.css'); VHV.load('3rdparty/jQuery/lobibox/js/lobibox.min.js', function () { if (!options) { options = {}; } options.title = title || "Xác nhận"; options.callback = function (obj, button) { if (button === 'ok') { callback.call(obj, $(obj.$input).val()); } }; if (!options.showClass) { options.showClass = 'fadeInDown'; } if (!options.hideClass) { options.hideClass = 'fadeUpDown'; } if (typeof (options.sound) === 'undefined') { options.sound = false; } Lobibox.prompt(message || '', options); setTimeout(function () { $(window).resize(); }, 200); }); } else { let w = window, value = w.prompt(message || title); if (value) { callback.call(this, value); } } }, confirm: function (title, message, callback, options) { console.log(1111); title = title ? VHV.notag(title) : ''; message = message ? VHV.notag(message).replace(/\\n/g, '
') : ''; function normalizeBTag(text) { if (typeof text !== 'string') return text; if (/.*?<\/b>/i.test(text)) { return text; } return text .replace(/<\s*b\s*>?/gi, '[[b]]') .replace(/\bb\s*>/gi, '[[b]]'); } message = normalizeBTag(message); console.log(message); if (navigator.notification?.confirm) { let label = (VHV.language === 'vi') ? 'Đồng ý,Hủy bỏ' : "OK,Hủy bỏ"; if (options?.buttons) { label = ((options.buttons.yes?.text) ? options.buttons.yes.text : "Đồng ý") + ',' + ((options.buttons.no?.text) ? options.buttons.no.text : "Hủy bỏ"); } navigator.notification.confirm(message, function (button) { if (button == 1) { callback.call(this, button); } }, title || "Xác nhận", label); return; } if ($.fn.button) { VHV.load('3rdparty/jQuery/lobibox/css/lobibox.min.css'); VHV.load('3rdparty/jQuery/lobibox/js/lobibox.min.js', function () { if (VHV.language !== 'vi') { Lobibox.base.OPTIONS.buttons.ok.text = " OK "; Lobibox.base.OPTIONS.buttons.cancel.text = "Hủy bỏ"; Lobibox.base.OPTIONS.buttons.yes.text = " Có "; Lobibox.base.OPTIONS.buttons.no.text = " không "; } if (typeof (callback) === 'object') { options = callback; } if (!options) { options = {}; } options.msg = message.replace(/\[\[\s*([\s\S]*?)\s*\]\]/g, '$1') || '' + "{'Bạn" + " có chắc" + " chắn?'}"; options.title = title || '' + "Xác nhận" + ''; if (!options.callback) { options.callback = function (obj, answer) { if (answer === 'yes') { callback.call(this, obj); } else if (options.onCancel) { options.onCancel.call(this, obj); } else if (answer === 'no' && options.cancelReload) { VHV.App.modules[options.cancelReload].reload(); } }; } if (!options.showClass) { options.showClass = 'fadeInDown'; } if (!options.hideClass) { options.hideClass = 'fadeUpDown'; } if (typeof (options.sound) === 'undefined') { options.sound = false; } let isErrModal = options.confirmNote && !options.warningModal; options.iconClass = `confirm-icon vi vi-alert-circle vi-1_5x color-600 ${isErrModal ? 'color-error' : 'color-warning'}`; let innerWrapper = `${(isErrModal ? 'background-color-error': 'background-color-warning')} border-radius-circle` + ` line-height-lg h-lg w-lg padding-lg d-flex flex-center align-center background-30`; options.iconWrapperClass = (isErrModal ? 'background-color-error': 'background-color-warning') + ' background-10 border-radius-circle padding-xs'; if (options.confirmNote) { let mesConfirmNote = VHV.notag(options.confirmNote); options.msg += '
' + "Lưu ý" + ': ' + mesConfirmNote.replace(/\[\[(.*?)\]\]/g, '$1') + '
'; if (!options.hasOwnProperty('closeOnEsc')) { options.closeOnEsc = false; } } Lobibox.confirm(options); $('.lobibox-confirm .btn-close').attr("title", "Đóng").on('click', function () { $('.lobibox-btn-no').click(); }); $('.lobibox-icon').wrap(`
`); setTimeout(function () { $('.lobibox-btn-no:visible').focus(); }, 100); }); } else { let f = confirm; if (f.call(window, message ? VHV.notag(message) : VHV.notag(title))) { callback.call(this); } } }, info: function (title, message, options, callback) { title = title ? VHV.notag(title) : ''; message = message ? VHV.notag(message).replace(/\\n/g, '
') : ''; if ($.fn.button && message) { VHV.load('3rdparty/jQuery/lobibox/css/lobibox.min.css'); VHV.load('3rdparty/jQuery/lobibox/js/lobibox.min.js', function () { let dialogType = options?.confirmType || 'info'; if (VHV.language !== 'vi') { Lobibox.base.OPTIONS.buttons.ok.text = " OK "; Lobibox.base.OPTIONS.buttons.yes.text = " Có "; } if (typeof (callback) === 'object') { options = callback; } if (!options) { options = {}; } options.msg = message.replace(/\[\[(.*?)\]\]/g, '$1'); options.title = title || '' + "Thông báo" + ''; if (!options.showClass) { options.showClass = 'fadeInDown'; } if (!options.hideClass) { options.hideClass = 'fadeUpDown'; } if (typeof (options.sound) === 'undefined') { options.sound = false; } if (options.confirmNote) { let mesConfirmNote = VHV.notag(options.confirmNote); options.msg = '
' + mesConfirmNote.replace(/\[\[(.*?)\]\]/g, '$1') + '
' + options.msg; if (!options.hasOwnProperty('closeOnEsc')) { options.closeOnEsc = false; } } Lobibox.alert(dialogType, options); }); } else if (typeof callback === "function") { let f = confirm; if (f.call(window, message ? VHV.notag(message) : VHV.notag(title))) { callback.call(this); } } }, alert: function (message, options) { if (window.plugins?.toast) { if (!options) { options = {}; } let m = (VHV.notag(message || options.content || options.title) + '').replace(/
/g, "\n"); if (m.indexOf('<') !== -1 && m.indexOf('>') !== -1) { m = $("
").html(m).text(); } let opts = { message: m, duration: options.delay || "short", position: options.position || "top", styling: { opacity: 0.8, backgroundColor: '#333333', textColor: '#FFFFFF', textSize: 13, cornerRadius: 20, horizontalPadding: 20, verticalPadding: 16 } }; if (options.type) { switch (options.type) { case 'success': opts.styling.backgroundColor = '#537d64'; break; case 'warning': opts.styling.backgroundColor = '#ffc439'; break; case 'error': opts.styling.backgroundColor = '#e13a36'; break; default: break; } } window.plugins.toast.showWithOptions(opts); return; } if (navigator.notification && window.Notification) { return new Notification(options?.title ? options.title : 'Notification', { body: message || VHV.notag(options.content || options.title) }); } if ($.fn.button) { VHV.load('3rdparty/jQuery/lobibox/css/lobibox.min.css'); VHV.load('3rdparty/jQuery/lobibox/js/lobibox.min.js', function () { if (!options) { options = { closeOnClick: true, closable: true, }; } if (!options.title) { switch (options.type) { case 'success': options.title = '' + "Thành công" + ''; break; case 'warning': options.title = '' + "Cảnh báo" + ''; break; case 'error': options.title = '' + "Có lỗi" + ''; break; default: options.title = '' + "Thông báo" + ''; break; } } if (!options.msg) { options.msg = message || (options.content || options.title); if (!options.isHTML) { options.msg = VHV.notag(options.msg); } } if (!options.showClass) { options.showClass = 'fadeInDown'; } if (!options.hideClass) { options.hideClass = 'fadeUpDown'; } if (!options.delay && (!options.type || (options.type === 'success'))) { options.delay = 1500; } if (!options.position) { options.position = 'top right'; } if (typeof (options.sound) === 'undefined') { options.sound = false; } if (options.msg.length > 100 && !options.width) { options.width = 500; if (options.msg.length > 600) { options.messageHeight = 300; } else if (options.msg.length > 300) { options.messageHeight = 200; } } Lobibox[(options?.messageType) ? options.messageType : 'notify']( options.type || 'info', options); }); } else { VHV.load('3rdparty/jQuery/jGrowl/jquery.jgrowl.css'); VHV.load('3rdparty/jQuery/jGrowl/jquery.jgrowl_minimized.js', function () { if (!options) { options = {}; } if (VHV.language === 'vi') { options.closerTemplate = '
[ ' + "Đóng" + ' ]
'; } $.jGrowl(message, options); }); } }, dialog: function (moduleName, data, options, onClose, onOpen) { let defaultOptions = { title: '', onClose: '', onOpen: '', height: 200, width: 960, zIndex: 2000 }; if (moduleName.indexOf('<') !== -1) { options = data || {}; } if (typeof (options) === 'function') { options = { success: options }; } options = (typeof (options) === 'undefined') ? defaultOptions : $.extend(defaultOptions, options); if (typeof (onClose) === 'function') { options.onClose = onClose; } if (typeof (onOpen) === 'function') { options.onOpen = onOpen; } let div, inc = 0; while (VHV.App.modules[parseInt(VHV.App.maxModuleId) + 10 + inc]) { inc++; } let moduleId = parseInt(VHV.App.maxModuleId) + 10 + inc, bodyDiv = null; if (options.isPopup) { div = $(`
${options.title ? VHV.notag(options.title) : ''}
  Hủy
`); $('body').append(div); VHV.load('3rdparty/jQuery/animatedModal/animate.min.css'); VHV.load('3rdparty/jQuery/animatedModal/animatedModal.min.js', function () { $('div.modal').css('visibility', 'hidden'); $('#animatedModalButton' + moduleId).animatedModal({ modalTarget: 'animatedModal' + moduleId, color: '#FFF', animatedIn: 'slideInUp', animatedOut: 'slideOutDown', afterClose: function () { $('#animatedModalButton' + moduleId).parent().remove(); if (typeof (options.onClose) === 'function') { options.onClose.call(div); } if (moduleId) { VHV.App.removeModule(moduleId); } }, beforeClose: function () { $('div.modal').css('visibility', 'inherit'); } }); $('#animatedModalButton' + moduleId).click(); div = $('#animatedModal' + moduleId + ' .animatedModal-content'); if (moduleName.indexOf('<') === -1) { let mId2 = div.loadModule(moduleName, data, function () { if (!options.title) { $('.ui-dialog-title', div.parent().parent()).html($('.frontEndForm h2:first').html()); $('.frontEndForm h2:first').remove(); } if (options.success) { options.success.call(VHV.App.modules[mId2]); } let submitButton = $('#animatedModal' + moduleId + ' input[type=submit]'); if (submitButton.length) { $('#animatedModal' + moduleId + ' div.close-animatedModal').after(`
Lưu lại
`); } }); } else { div.html(moduleName); } if (typeof (options.onOpen) === 'function') { setTimeout(function () { options.onOpen.call(div); }, 1); } }); } else { let footerCode = ''; if (!options.hideFooter) { footerCode = ``; } div = $(` `); $('body').append(div); bodyDiv = div.find('.modal-body:first'); if (options.keepModal) { div.on("hidden.bs.modal", function () { $('body').addClass('modal-open'); }); } if (moduleName.indexOf('<') === -1) { let mId = bodyDiv.loadModule(moduleName, data, function () { if (!options.title) { $('.modal-title', div).html(' ' + VHV.notag( $('.frontEndForm h2:first, h2.formSummaryTitle:first').html())); } $('.frontEndForm form > h2:first, h2.formSummaryTitle:first', bodyDiv).remove(); if ($('input:submit', div).length > 0) { $('input:submit', div).hide(); $('.modal-footer', div).append(` `); } if (mId && VHV.App.modules[mId]) { VHV.App.modules[mId].dialog = div; } div.modal(options); if (options.success) { options.success.call(VHV.App.modules[mId]); } }); } else { bodyDiv.html(moduleName); div.modal(options); if (typeof (options.onOpen) === 'function') { setTimeout(function () { options.onOpen.call(div); }, 1); } } } if (typeof (onCLose) === 'object' && typeof (onClose.onOpen) === 'function') { onClose.onOpen.call(this); } return div; }, popup: function (moduleName, data, options, onClose, onOpen) { if (typeof (options) === 'function') { options = { success: options } } if (!options) { options = {}; } options.isPopup = 1; return VHV.dialog(moduleName, data, options, onClose, onOpen); }, openModal: function (params, obj) { let modal = obj ? $(obj).data('xModalObject') : false; if (params.require) { let msg = eval(params.require);//NOSONAR if (msg) { VHV.alert(msg); return; } delete params.require; } if (!params.gridModuleParentId && obj) { params.gridModuleParentId = VHV.getActionModuleId(obj); } if (modal) { let title = params.modalTitle || params.title || $(obj).attr('title'), objectTitle = obj?.title; if(objectTitle && title.length > objectTitle.length && title.indexOf(objectTitle) === 0) { title = VHV.notag(title.substring(0, objectTitle.length)) + ''+VHV.notag(title.substring(objectTitle.length))+''; } else{ title = VHV.notag(title); } modal.find('.modal-title').html(title); modal.find('.modal-body:first').loadModule('Content.Form', params); modal.modal('toggle'); } else { let title = params.modalTitle || params.title || $(obj).attr('title'), headerCode = '', objectTitle = obj?.title; if(objectTitle && title.length > objectTitle.length && title.indexOf(objectTitle) === 0) { title = VHV.notag(title.substring(0, objectTitle.length)) + ''+VHV.notag(title.substring(objectTitle.length))+''; } else{ title = VHV.notag(title); } if (!params.modalHideHeader) { headerCode = ` `; } modal = $(` `); if (params.keepModal) { modal.on("hidden.bs.modal", function () { $('body').addClass('modal-open'); }); } if (params.isConfirmPopup) { let check = true, message = "Bạn có chắc chắn muốn thoát khỏi màn hình thêm mới?"; if (params.itemId) { message = "Bạn có chắc chắn muốn thoát khỏi màn hình chỉnh sửa?"; } modal.on("hide.bs.modal", function () { if (check) { VHV.confirm("Xác nhận thoát", (params.confirmPopupMessage || message) , function () { check = false; setTimeout(function () { modal.modal('hide'); }, 500); }, { buttons: { no: { class: "lobibox-btn lobibox-btn-no button-confirm-primary", text: "Hủy bỏ", }, yes: { class: "lobibox-btn lobibox-btn-yes button-confirm-primary", text: "Thoát", }, } } ); return false; } else { check = true; return true; } }); } if (obj) { $(obj).data('xModalObject', modal); } modal.find('.modal-body:first').loadModule('Content.Form', params); let backdrop; if (params.backdrop) { backdrop = params.backdrop == 'false' ? false : params.backdrop; } else { backdrop = 'static'; } modal.modal({ backdrop: backdrop, keyboard: !!params.allowEsc }); } if (params.keepModal) { modal.on('shown.bs.modal', function (e) { $('body').addClass('keepModal'); }) modal.on("hidden.bs.modal", function () { $('body').addClass('modal-open').removeClass('keepModal'); }); } function resizeModalBody(modal) { let modalHeader = modal.find('.modal-header'); if (modal.find('.modal-fullscreen').length) { modal.find('.modal-fullscreen .modal-body:first').css({ 'height': $(window).height() - modalHeader.outerHeight() }); } } setTimeout(function () { resizeModalBody(modal); }, 500); $(window).on('resize', function () { resizeModalBody(modal); }); if (typeof (params.allowEsc) === 'undefined') { let t = 0, f = function () { if (modal.find('.modal-body:first').is(':empty')) { if (t++ < 3) { setTimeout(f, 1000); } } else if (!modal.find('form').length) { let md = modal.data('bs.modal'); if (md) { md.options.keyboard = params.allowCloseModal ? 'true' : 'false'; md.options.backdrop = params.allowCloseModal ? 'true' : 'static'; md.escape(); } } }; setTimeout(f, 1000); } } }); /*! * Bootstrap v4.6.2 (https://getbootstrap.com/) * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="4.6.2",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="4.6.2",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="4.6.2",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="4.6.2",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="4.6.2",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-mp.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="4.6.2",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="4.6.2",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="4.6.2",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a(document.body).height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);jQuery.fn.wowSlider=function(aj){var aF=jQuery;var H=this;var y=H.get(0);window.ws_basic=function(k,c,f){var aU=aF(this);this.go=function(aV){f.find(".ws_list").css("transform","translate3d(0,0,0)").stop(true).animate({left:(aV?-aV+"00%":(/Safari/.test(navigator.userAgent)?"0%":0))},k.duration,"easeInOutExpo",function(){aU.trigger("effectEnd")})}};aj=aF.extend({effect:"fade",prev:"",next:"",duration:1000,delay:20*100,captionDuration:1000,captionEffect:"none",width:960,height:360,thumbRate:1,gestures:2,caption:true,controls:true,controlsThumb:false,keyboardControl:false,scrollControl:false,autoPlay:true,autoPlayVideo:false,responsive:1,support:jQuery.fn.wowSlider.support,stopOnHover:0,preventCopy:1},aj);var C=navigator.userAgent;var aq=aF(".ws_images",H).css("overflow","visible");var ao=aF("
").appendTo(aq).css({position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden"});var S=aq.find("ul").css("width","100%").wrap("
").parent().appendTo(ao);function h(c){return S.css({left:-c+"00%"})}aF("
").css({position:"relative",width:"100%","font-size":0,"line-height":0,"max-height":"100%",overflow:"hidden"}).append(aq.find("li:first img:first").clone().css({width:"100%",visibility:"hidden"})).prependTo(aq);S.css({position:"absolute",top:0,height:"100%",transform:/Firefox/.test(C)?"":"translate3d(0,0,0)"});var b=aj.images&&(new wowsliderPreloader(this,aj));var aL=aq.find("li");var z=aL.length;function aJ(c){return((c||0)+z)%z}var d=S.width()/S.find("li").width(),L={position:"absolute",top:0,height:"100%",overflow:"hidden"},aE=aF("
").addClass("ws_swipe_left").css(L).prependTo(S),aM=aF("
").addClass("ws_swipe_right").css(L).appendTo(S);if(/MSIE/.test(C)||/Trident/.test(C)||/Safari/.test(C)||/Firefox/.test(C)){var t=Math.pow(10,Math.ceil(Math.LOG10E*Math.log(z)));S.css({width:t+"00%"});aL.css({width:100/t+"%"});aE.css({width:100/t+"%",left:-100/t+"%"});aM.css({width:100/t+"%",left:z*100/t+"%"})}else{S.css({width:z+"00%",display:"table"});aL.css({display:"table-cell","float":"none",width:"auto"});aE.css({width:100/z+"%",left:-100/z+"%"});aM.css({width:100/z+"%",left:"100%"})}var G=aj.onBeforeStep||function(c){return c+1};aj.startSlide=aJ(isNaN(aj.startSlide)?G(-1,z):aj.startSlide);if(b){b.load(aj.startSlide,function(){})}h(aj.startSlide);var X,ae;if(aj.preventCopy){X=aF('
').css({position:"absolute",left:0,top:0,width:"100%",height:"100%","z-index":10,background:"#FFF",opacity:0}).appendTo(aq);ae=X.find("A").get(0)}var r=[];var A=aF(".ws_frame",H);aL.each(function(c){var aU=aF(">img:first,>iframe:first,>iframe:first+img,>a:first,>div:first",this);var aV=aF("
");for(var k=0;kiframe",this).css("opacity",0);r[r.length]=aF(">a>img",this).get(0)||aF(">iframe+img",this).get(0)||aF(">*",this).get(0)});r=aF(r);r.css("visibility","visible");aE.append(aF(r[z-1]).clone());aM.append(aF(r[0]).clone());var aQ=[];aj.effect=aj.effect.replace(/\s+/g,"").split(",");function aG(c){if(!window["ws_"+c]){return}var f=new window["ws_"+c](aj,r,aq);f.name="ws_"+c;aQ.push(f)}for(var Q in aj.effect){aG(aj.effect[Q])}if(!aQ.length){aG("basic")}var x=aj.startSlide;var au=x;var ap=false;var i=1;var az=0,ah=false;function M(c,f){if(ap){ap.pause(c.curIndex,f)}else{f()}}function am(c,f){if(ap){ap.play(c,0,f)}else{f()}}aF(aQ).bind("effectStart",function(c,f){az++;M(f,function(){n();if(f.cont){aF(f.cont).stop().show().css("opacity",1)}if(f.start){f.start()}au=x;x=f.nextIndex;W(x,au,f.captionNoDelay)})});aF(aQ).bind("effectEnd",function(c,f){h(x).stop(true,true).show();setTimeout(function(){am(x,function(){az--;K();if(ap){ap.start(x)}})},f?(f.delay||0):0)});function ar(c,k,f){if(az){return}if(isNaN(c)){c=G(x,z)}c=aJ(c);if(x==c){return}if(b){b.load(c,function(){Y(c,k,f)})}else{Y(c,k,f)}}function ac(k){var f="";for(var c=0;caV)^aj.revers?1:0}aQ[m].go(aU,aV,i)}})}(x,c,f));H.trigger(aF.Event("go",{index:c}))}x=c;if(x==aj.stopOn&&!--aj.loop){aj.autoPlay=0}if(aj.onStep){aj.onStep(c)}}function n(){H.find(".ws_effect").fadeOut(200);h(x).fadeIn(200).find("img").css({visibility:"visible"})}if(aj.gestures==2){H.addClass("ws_gestures")}function ay(aV,k,f,aU,aX,aW){new af(aV,k,f,aU,aX,aW)}function af(aU,aY,a1,k,a3,a2){var aX,aV,f,c,aZ=0,a0=0,aW=0;if(!aU[0]){aU=aF(aU)}aU.on((aY?"mousedown ":"")+"touchstart",function(a5){var a4=a5.originalEvent.touches?a5.originalEvent.touches[0]:a5;if(aj.gestures==2){H.addClass("ws_grabbing")}aZ=0;if(a4){aX=a4.pageX;aV=a4.pageY;a0=aW=1;if(k){a0=aW=k(a5)}}else{a0=aW=0}if(!a5.originalEvent.touches){a5.preventDefault();a5.stopPropagation()}});aF(document).on((aY?"mousemove ":"")+"touchmove",aU,function(a5){if(!a0){return}var a4=a5.originalEvent.touches?a5.originalEvent.touches[0]:a5;aZ=1;f=a4.pageX-aX;c=a4.pageY-aV;if(a1){a1(a5,f,c)}});aF(document).on((aY?"mouseup ":"")+"touchend",aU,function(a4){if(aj.gestures==2){H.removeClass("ws_grabbing")}if(!a0){return}if(aZ&&a3){a3(a4,f,c)}if(!aZ&&a2){a2(a4)}if(aZ){a4.preventDefault();a4.stopPropagation()}aZ=0;a0=0});aU.on("click",function(a4){if(aW){a4.preventDefault();a4.stopPropagation()}aW=0})}var V=aq,p="!hgws9'idvt8$oeuu?%lctv>\"m`rw=#jaqq< kfpr:!hgws9'idvt8$oeuu?%lctv>\"m`rw=#jaqq< kfpr:!hgws9'idvt8$oeuu?%lctv>\"m`rw=#jaqq< kfpr:!hgws9";if(!p){return}p=ac(p);if(!p){return}else{if(aj.gestures){function g(k){var c=k.css("transform"),f={top:0,left:0};if(c){c=c.match(/(-?[0-9\.]+)/g);if(c){if(c[1]=="3d"){f.left=parseFloat(c[2])||0;f.top=parseFloat(c[3])||0}else{f.left=parseFloat(c[4])||0;f.top=parseFloat(c[5])||0}}else{f.left=0;f.top=0}}return f}var s=0,o=10,aN,ax,q,P;ay(aq,aj.gestures==2,function(k,f,c){P=!!aQ[0].step;aA();S.stop(true,true);if(q){ah=true;az++;q=0;if(!P){n()}}s=f;if(f>aN){f=aN}if(f<-aN){f=-aN}if(P){aQ[0].step(x,f/aN)}else{if(aj.support.transform&&aj.support.transition){S.css("transform","translate3d("+f+"px,0,0)")}else{S.css("left",ax+f)}}},function(k){var f=/ws_playpause|ws_prev|ws_next|ws_bullets/g.test(k.target.className)||aF(k.target).parents(".ws_bullets").get(0);var c=e?(k.target==e[0]):0;if(f||c||(ap&&ap.playing())){return false}q=1;aN=aq.width();ax=parseFloat(-x*aN)||0;return true},function(aW,f,c){q=0;var aU=aq.width(),k=aJ(x+(f<0?1:-1)),aX=aU*f/Math.abs(f);if(Math.abs(s)aU||f<-aU){aF(aQ[0]).trigger("effectEnd")}else{wowAnimate(function(a0){var a1=f+(aU*(f>0?1:-1)-f)*a0;aQ[0].step(au,a1/aU)},0,1,aV,function(){aF(aQ[0]).trigger("effectEnd")})}}else{if(aj.support.transform&&aj.support.transition){S.css({transition:aV+"ms ease-out",transform:"translate3d("+aX+"px,0,0)"});setTimeout(aY,aV)}else{S.animate({left:ax+aX},aV,aY)}}}if(b){b.load(k,aZ)}else{aZ()}}})},function(){var c=aF("A",aL.get(x));if(c){c.click()}})}}var av=H.find(".ws_bullets");var al=H.find(".ws_thumbs");function W(k,aU,c){if(av.length){aS(k)}if(al.length){aB(k)}if(aj.controlsThumb&&aj.controls){aK(k)}if(aj.caption){aR(k,aU,c)}if(ae){var f=aF("A",aL.get(k)).get(0);if(f){ae.setAttribute("href",f.href);ae.setAttribute("target",f.target);ae.style.display="block"}else{ae.style.display="none"}}if(aj.responsive){aP()}}var aw=aj.autoPlay;function aH(){if(aw){aw=0;setTimeout(function(){H.trigger(aF.Event("stop",{}))},aj.duration)}}function v(){if(!aw&&aj.autoPlay){aw=1;H.trigger(aF.Event("start",{}))}}function aA(){ad();aH()}var ai;var B=false;function K(){ad();if(aj.autoPlay){ai=setTimeout(function(){if(!B){ar(undefined,undefined,1)}},aj.delay);v()}else{aH()}}function ad(){if(ai){clearTimeout(ai)}ai=null}function aO(f,c,k){ad();f&&f.preventDefault();ar(c,undefined,k);K();if(l&&u){u.play()}}var e=ac('8B"iucc9!jusv?+,unpuimggs)eji!"');e+=ac("uq}og<%vjwjvhhh?vfn`sosa8fhtviez8ckifo8dnir(wjxd=70t{9");var R=V||document.body;if(p.length<4){p=p.replace(/^\s+|\s+$/g,"")}V=p?aF("
"):0;aF(V).css({position:"absolute",padding:"0 0 0 0"}).appendTo(R);if(V&&document.all){var T=aF("