@cnv-vn/track 0.3.0-beta.1 → 0.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/dist/cnv-track.esm.js +2 -2
- package/dist/cnv-track.min.js +2 -2
- package/dist/cnv-track.umd.cjs +2 -2
- package/dist/types/index.d.ts +35 -0
- package/package.json +1 -1
package/dist/cnv-track.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cnv-vn/track v0.3.0-beta.
|
|
2
|
+
* @cnv-vn/track v0.3.0-beta.2
|
|
3
3
|
* (c) 2026 CNV
|
|
4
4
|
* Released under the UNLICENSED license.
|
|
5
5
|
*/
|
|
6
|
-
!function(n){function t(n){try{n()}catch(n){}}function e(n,t){try{return n()}catch(n){return t}}function o(n){return n&&t(n),null}const r=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","csv","rtf","zip","rar","7z","tar","gz","mp3","mp4","mov","wav","avi","mkv","dmg","exe","pkg","apk","msi","svg"];function i(n){return!!n&&"object"==typeof n&&1===n.nodeType&&"A"===n.tagName}function c(n){const t=n.lastIndexOf("/");return-1===t?n:n.slice(t+1)}function l(n){var t,e,o;let r=(null!==(t=n.textContent)&&void 0!==t?t:"").trim();return r||(r=(null!==(e=n.getAttribute("aria-label"))&&void 0!==e?e:"").trim()),r||(r=(null!==(o=n.getAttribute("title"))&&void 0!==o?o:"").trim()),r.length>200?r.slice(0,200):r}const a=200;function u(n){let t="";try{t=(n.textContent||"").replace(/\s+/g," ").trim(),t||(t=(n.getAttribute("aria-label")||"").trim()),t||(t=(n.getAttribute("title")||"").trim()),t=t.normalize("NFC")}catch(n){return""}return t.length>a?t.slice(0,a):t}function s(n){const t=!1!==n.caseInsensitive;if("regex"===n.mode)return{mode:"regex",needle:n.value,ci:t,re:x(n.value,t)};const e=n.value.normalize("NFC");return{mode:n.mode,needle:t?e.toLowerCase():e,ci:t,re:null}}function d(n,t){try{return n.matches(t)}catch(n){return!1}}function h(n){try{if("A"===n.tagName){const t=n.getAttribute("href");return t?w(t):null}const t=n.getAttribute("formaction");if(t)return w(t);const e=n.getAttribute("data-href");if(e)return w(e);const o=n.closest("form");if(o){const n=o.getAttribute("action");if(n)return w(n)}return null}catch(n){return null}}function p(n){return"regex"===n.mode?{mode:"regex",needle:n.value,re:x(n.value,!0)}:{mode:n.mode,needle:n.value.toLowerCase(),re:null}}function f(n){if("startsWith"===n.mode)return{mode:"startsWith",needle:n.value,re:null};const t="glob"===n.mode?"^"+n.value.replace(/[.+^${}()|[\]\\?]/g,"\\$&").replace(/\*/g,".*")+"$":n.value;return{mode:n.mode,needle:n.value,re:x(t,!1)}}function v(n,t){return"startsWith"===n.mode?0===t.indexOf(n.needle):!n.re||_(n.re,t)}const g=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,m=/\+?\d[\d\s().-]{7,}\d/g;function b(n){if(!n)return n;try{return n.replace(g,"[email]").replace(m,"[phone]")}catch(t){return n}}function y(n){return!!n&&"object"==typeof n&&1===n.nodeType}function w(n){try{return new URL(n,location.href).href}catch(t){return n}}function x(n,t){try{return!n||n.length>1e3?null:new RegExp(n,t?"i":"")}catch(n){return null}}function _(n,t){try{return n.test(t)}catch(n){return!1}}function k(n,e){if("undefined"==typeof document)return()=>{};const o=(n=>{const t=n.globalThrottle||{},e=[],o=n.rules||[];for(let n=0;n<o.length;n++){const r=o[n];if(!r||!1===r.enabled)continue;if(!r.match||!r.event)continue;const i=r.match,c=r.throttle||{};e.push({rule:r,elementSpec:M(r),selector:i.selector||null,text:i.text?s(i.text):null,dest:i.destinationUrl?p(i.destinationUrl):null,urlScope:r.urlScope?f(r.urlScope):null,dedupeWindowMs:z(c.dedupeWindowMs,z(t.dedupeWindowMs,500)),maxPerPageview:z(c.maxPerPageview,z(t.maxPerPageview,1/0)),samplingRate:S(z(c.samplingRate,z(t.samplingRate,1)))})}return e.sort((n,t)=>(n.rule.priority||0)-(t.rule.priority||0)),e})(e);if(0===o.length)return()=>{};const r=new WeakMap;let i=0;const c=n=>{let t=r.get(n);return void 0===t&&(t=++i,r.set(n,t)),String(t)},l=new Map,a=new Map;let u=j();function d(e){try{if(0!==e.button)return;const r=j();r!==u&&(u=r,a.clear(),l.clear());const i=(n=>{const t=[];try{const e="function"==typeof n.composedPath?n.composedPath():[];if(e&&e.length>0){for(const n of e)y(n)&&t.push(n);return t}let o=n.target;for(;o;)y(o)&&t.push(o),o=o.parentNode}catch(n){}return t})(e);if(0===i.length)return;const s=(()=>{try{return"undefined"!=typeof location?location.pathname+location.search:""}catch(n){return""}})();for(let r=0;r<o.length;r++){const u=o[r];if(u.urlScope&&!v(u.urlScope,s))continue;let d=null;for(let n=0;n<i.length;n++)if(A(u,i[n])){d=i[n];break}if(!d)continue;const h=u.rule.id;if((a.get(h)||0)>=u.maxPerPageview)return;const p=h+"#"+c(d),f=Date.now(),g=l.get(p);if(void 0!==g&&f-g<u.dedupeWindowMs)return;if(u.samplingRate<1&&Math.random()>=u.samplingRate)return;l.set(p,f),a.set(h,(a.get(h)||0)+1);const m=C(u.rule,d,e);return void t(()=>n.track("clicked",m))}}catch(n){}}try{document.addEventListener("click",d,!0)}catch(n){return()=>{}}return()=>{try{document.removeEventListener("click",d,!0)}catch(n){}l.clear(),a.clear()}}function M(n){const t=n.match;return t.element?t.element:t.selector||t.id||t.dataAttr||t.classes&&t.classes.length>0||t.destinationUrl?"any":void 0}function A(n,t){if(!((n,t)=>{if(!t)return(n=>{const t=n.tagName;if("BUTTON"===t||"A"===t)return!0;if("INPUT"===t){const t=(n.getAttribute("type")||"").toLowerCase();return"submit"===t||"button"===t||"reset"===t}return"button"===n.getAttribute("role")})(n);if("any"===t)return!0;if("button"===t){const t=n.tagName;if("BUTTON"===t)return!0;if("INPUT"===t){const t=(n.getAttribute("type")||"").toLowerCase();return"submit"===t||"button"===t||"reset"===t}return"button"===n.getAttribute("role")}return"link"===t?"A"===n.tagName:d(n,t)})(t,n.elementSpec))return!1;const e=n.rule.match;return!(n.selector&&!d(t,n.selector)||void 0!==e.id&&!((n,t)=>n.id===t)(t,e.id)||e.classes&&e.classes.length>0&&!((n,t)=>{try{for(let e=0;e<t.length;e++)if(!n.classList.contains(t[e]))return!1;return!0}catch(n){return!1}})(t,e.classes)||e.dataAttr&&!((n,t,e)=>{try{return!!n.hasAttribute(t)&&(void 0===e||n.getAttribute(t)===e)}catch(n){return!1}})(t,e.dataAttr.name,e.dataAttr.value)||n.text&&!((n,t)=>{const e=u(n);if("regex"===t.mode)return!!t.re&&_(t.re,e);const o=t.ci?e.toLowerCase():e;return"exact"===t.mode?o===t.needle:"startsWith"===t.mode?0===o.indexOf(t.needle):-1!==o.indexOf(t.needle)})(t,n.text)||n.dest&&!((n,t)=>{const e=h(n);if(!e)return!1;if("regex"===t.mode)return!!t.re&&_(t.re,e);if("domain"===t.mode)try{return new URL(e).host.toLowerCase()===t.needle}catch(n){return!1}const o=e.toLowerCase();return"exact"===t.mode?o===t.needle:"startsWith"===t.mode?0===o.indexOf(t.needle):-1!==o.indexOf(t.needle)})(t,n.dest))}function C(n,t,e){const o={},r=n.event.staticProps;if(r)for(const n of Object.keys(r))o[n]=r[n];const i=n.capture;if(i)try{if(i.text){const n=b(u(t));n&&(o.text=n)}if(i.href){const n=h(t);n&&(o.href=n)}if(i.elementId&&t.id&&(o.element_id=t.id),i.classes&&(o.element_classes=Array.from(t.classList)),i.dataAttrs&&i.dataAttrs.length>0)for(let n=0;n<i.dataAttrs.length;n++){const e=i.dataAttrs[n],r=t.getAttribute(e);null!==r&&(o[e]=b(r))}if(i.valueFrom){const n=((n,t)=>{try{const e=n.querySelector(t.selector)||(n.parentElement?n.parentElement.querySelector(t.selector):null);if(!e)return null;const o=t.attr?e.getAttribute(t.attr):e.textContent||"";if(null===o)return null;const r=b(o.replace(/\s+/g," ").trim());return r.length>a?r.slice(0,a):r}catch(n){return null}})(t,i.valueFrom);null!==n&&(o[i.valueFrom.as]=n)}i.selectorPath&&(o.selector_path=((n,t=5)=>{try{const e=[];let o=n,r=0;for(;o&&1===o.nodeType&&r<t;){let n=o.tagName.toLowerCase();if(o.id){e.unshift(n+"#"+o.id);break}const t=Array.from(o.classList).slice(0,2).join(".");t&&(n+="."+t),e.unshift(n),o=o.parentElement,r++}return e.join(" > ")}catch(n){return""}})(t)),i.position&&(o.x=e.clientX,o.y=e.clientY)}catch(n){}return o.rule_id=n.id,n.name&&(o.rule_name=n.name),n.event&&n.event.name&&(o.event_name=n.event.name),o.tag=t.tagName.toLowerCase(),o}function j(){try{return"undefined"!=typeof location?location.href:""}catch(n){return""}}function z(n,t){return"number"!=typeof n||isNaN(n)?t:n}function S(n){return n<0?0:n>1?1:n}const T="__cnvPatched";function O(n){if("undefined"==typeof window||"undefined"==typeof history)return()=>{};let t=N();function e(){try{const e=N();if(e===t)return;t=e,n(e)}catch(n){}}const o=history.pushState,r=history.replaceState,i=!0===o[T],c=!0===r[T];if(!i){function u(...n){o.apply(this,n),e()}u[T]=!0,history.pushState=u}if(!c){function s(...n){r.apply(this,n),e()}s[T]=!0,history.replaceState=s}const l=()=>e(),a=()=>e();try{window.addEventListener("popstate",l),window.addEventListener("hashchange",a)}catch(d){}return()=>{try{window.removeEventListener("popstate",l),window.removeEventListener("hashchange",a)}catch(n){}try{!i&&history.pushState[T]&&(history.pushState=o),!c&&history.replaceState[T]&&(history.replaceState=r)}catch(n){}}}function N(){try{return"undefined"!=typeof location?location.href:""}catch(n){return""}}const F=["q","s","query","search","keyword"],I={spa:!0,outboundClicks:!0,scroll:!0,downloads:!0,siteSearch:!0},P={spa:!1,outboundClicks:!1,scroll:!1,downloads:!1,siteSearch:!1};const $=2147483e3,D="#6C5CE7",H="#FFFFFF";function R(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(max-width: 768px)").matches:"undefined"!=typeof window&&"number"==typeof window.innerWidth&&window.innerWidth<=768}catch(n){return!1}}function L(n,t){return(n=>"string"==typeof n&&/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(n))(n)?n:t}function E(n){if("string"!=typeof n||0===n.trim().length)return!1;try{const t="undefined"!=typeof location?location.href:void 0,e=new URL(n,t);return"https:"===e.protocol||"http:"===e.protocol||"data:"===e.protocol&&/^data:image\//i.test(n.trim())}catch(n){return!1}}function B(n){return"number"==typeof n&&Number.isFinite(n)?Math.min(Math.max(Math.trunc(n),0),2147483647):null}function U(n,t=20){return"number"==typeof n&&Number.isFinite(n)?Math.min(Math.max(n,0),2e3):t}function V(n,t){const e=n.replace("#",""),o=3===e.length?e.replace(/(.)/g,"$1$1"):e;return`rgba(${parseInt(o.slice(0,2),16)}, ${parseInt(o.slice(2,4),16)}, ${parseInt(o.slice(4,6),16)}, ${t})`}function K(n,t){const e=t?null==n?void 0:n.placementMobile:null==n?void 0:n.placementDesktop;return{side:"LEFT"===(null==e?void 0:e.position)?"left":"right",sideSpacingPx:U(null==e?void 0:e.sideSpacing),bottomSpacingPx:U(null==e?void 0:e.bottomSpacing)}}function q(n,t){const e=document.createElement("div");e.setAttribute(n,"");const o=e.attachShadow({mode:"open"}),r=document.createElement("style");return r.textContent=t,o.appendChild(r),{hostEl:e,shadow:o}}function G(n){var t;(null!==(t=document.body)&&void 0!==t?t:document.documentElement).appendChild(n)}const Z="cnv:panel:opened",Y="cnv:panel:closed";function J(n,t,e){if(e)n.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 6l12 12M18 6 6 18" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></svg>';else if("CUSTOM"===t.iconType&&E(t.customIconUrl)){n.innerHTML="";const e=document.createElement("img");e.src=t.customIconUrl,e.alt="",n.appendChild(e)}else n.innerHTML=(n=>{switch(n){case"BAG_HEART":return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 8V6a5 5 0 0 1 10 0v2" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><path d="M4.5 8h15l-1 12.5a1.5 1.5 0 0 1-1.5 1.4H7a1.5 1.5 0 0 1-1.5-1.4L4.5 8Z" fill="currentColor"/><path d="M12 12.8c1-1.4 3.6-1 3.6 1 0 1.7-2.2 2.9-3.6 3.9-1.4-1-3.6-2.2-3.6-3.9 0-2 2.6-2.4 3.6-1Z" fill="#fff"/></svg>';case"TAG":return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.6 3.4 20 10.8a2 2 0 0 1 0 2.8l-6.4 6.4a2 2 0 0 1-2.8 0L3.4 12.6A2 2 0 0 1 2.8 11l.6-6.2A2 2 0 0 1 5.2 3l6.2-.6a2 2 0 0 1 1.2.4Z" fill="currentColor"/><circle cx="8" cy="8" r="1.6" fill="#fff"/></svg>';case"STAR":return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5l2.9 6 6.6.7-4.9 4.5 1.3 6.5L12 16.9l-5.9 3.3 1.3-6.5-4.9-4.5 6.6-.7L12 2.5Z" fill="currentColor"/></svg>';case"GIFT":return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3.5" y="9.5" width="17" height="10" rx="1.2" fill="currentColor"/><rect x="2.5" y="6.5" width="19" height="3.5" rx="1" fill="currentColor"/><rect x="11" y="6.5" width="2" height="13" fill="#fff"/><path d="M12 6.5c0-2 -2-3.5-3.6-3.5S6 4.3 6 5.4c0 .9.8 1.1 1.6 1.1H12Z" fill="currentColor"/><path d="M12 6.5c0-2 2-3.5 3.6-3.5S18 4.3 18 5.4c0 .9-.8 1.1-1.6 1.1H12Z" fill="currentColor"/></svg>';default:return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9.5 7 12l5-6 5 6 4-2.5-1.6 9.5a1.5 1.5 0 0 1-1.5 1.3H6.1a1.5 1.5 0 0 1-1.5-1.3L3 9.5Z" fill="currentColor"/></svg>'}})(t.iconPreset)}function Q(n,o){if("undefined"==typeof document||"undefined"==typeof window)return()=>{};try{const{hostEl:n,shadow:r}=q("data-cnv-launcher",'\n :host { all: initial; }\n .cnv-launcher-fab {\n display: inline-flex; align-items: center; gap: 8px;\n height: 48px; padding: 0 18px; border: none; cursor: pointer;\n box-shadow: 0 6px 18px rgba(0, 0, 0, .18);\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;\n font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;\n transition: transform .18s cubic-bezier(.16, 1, .3, 1), box-shadow .18s ease;\n /* KHÔNG dùng animation-fill-mode ở đây: fill giữ lại transform cuối của keyframe, mà animation\n thắng cả declaration thường → :hover/:active sẽ mất tác dụng vĩnh viễn sau khi FAB hiện ra. */\n animation: cnv-fab-in .32s cubic-bezier(.16, 1, .3, 1);\n }\n .cnv-launcher-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .24); }\n .cnv-launcher-fab:active { transform: translateY(0) scale(.96); }\n .cnv-launcher-fab__icon {\n display: inline-flex; align-items: center; justify-content: center;\n width: 20px; height: 20px; flex-shrink: 0;\n }\n .cnv-launcher-fab__icon svg, .cnv-launcher-fab__icon img {\n width: 20px; height: 20px; object-fit: contain;\n /* Animation đặt trên CHÍNH node icon chứ không phải trên wrapper: mỗi lần đổi icon là thay\n innerHTML, tức node mới → animation tự chạy lại. Không cần toggle class rồi ép reflow để\n "restart" như cách thường làm. */\n animation: cnv-fab-icon-in .28s cubic-bezier(.16, 1, .3, 1);\n }\n @keyframes cnv-fab-in {\n from { opacity: 0; transform: translateY(10px) scale(.9); }\n to { opacity: 1; transform: none; }\n }\n /* Xoay + phóng: quà ↔ dấu × không biến hình được vào nhau, nhưng xoay nhanh thì mắt đọc thành một\n cú lật mặt chứ không phải một cú thay ảnh. */\n @keyframes cnv-fab-icon-in {\n from { opacity: 0; transform: rotate(-90deg) scale(.4); }\n to { opacity: 1; transform: none; }\n }\n @media (prefers-reduced-motion: reduce) {\n .cnv-launcher-fab, .cnv-launcher-fab__icon svg, .cnv-launcher-fab__icon img {\n animation: none !important; transition: none !important;\n }\n }\n'),i=document.createElement("button");i.type="button",i.className="cnv-launcher-fab",i.setAttribute("aria-label","Launcher");const c=document.createElement("span");c.className="cnv-launcher-fab__icon";const l=document.createElement("span");l.className="cnv-launcher-fab__text",i.appendChild(c),i.appendChild(l),r.appendChild(i),((n,t,e)=>{n.style.backgroundColor=L(e.backgroundColor,D),n.style.color=L(e.textColor,H),n.style.borderRadius=(n=>{switch(n){case"SQUARE":return"2px";case"SHAVED":return"8px";case"ROUNDED":return"16px";default:return"999px"}})(e.buttonShape),J(t,e,!1)})(i,c,o);let a=!1;const u=()=>((n,t,o,r,i)=>{try{const c=R();if(((n,t)=>{if("DESKTOP_ONLY"===n.deviceVisibility&&t)return!0;if(n.hideOnHomepage&&e(()=>"/"===location.pathname||""===location.pathname,!1))return!0;const o=n.hideUrlConditions;if(o&&o.length>0){const n=e(()=>location.pathname+location.search,"");if(o.some(t=>"string"==typeof t&&t.length>0&&n.includes(t)))return!0}return!1})(r,c))return void n.style.setProperty("display","none");n.style.removeProperty("display");const{side:l,sideSpacingPx:a,bottomSpacingPx:u}=K(r,c),s=r.useCustomZIndex?B(r.zIndex):null,d=r.addImportantRule?"important":"",h=(t,e)=>n.style.setProperty(t,e,d);h("position","fixed"),h("bottom",u+"px"),h("left","left"===l?a+"px":"auto"),h("right","right"===l?a+"px":"auto"),h("z-index",String(null!=s?s:$));const p=c?r.contentLayoutMobile:r.contentLayoutDesktop,f=!i&&"ICON_ONLY"!==p;t.style.display=i||"TEXT_ONLY"!==p?"inline-flex":"none",o.style.display=f?"inline":"none",f&&(o.textContent=(c?r.buttonTextMobile:r.buttonTextDesktop)||"")}catch(n){}})(n,c,l,o,a),s=n=>{a!==n&&(a=n,t(()=>{J(c,o,n),i.setAttribute("aria-label",n?"Đóng":"Launcher"),u()}))},d=()=>s(!0),h=()=>s(!1);window.addEventListener(Z,d),window.addEventListener(Y,h);const p=()=>{t(()=>window.dispatchEvent(new CustomEvent("cnv:launcher:click",{detail:{config:o}})))};i.addEventListener("click",p);const f=()=>{t(()=>{G(n),u()})};document.body?f():document.addEventListener("DOMContentLoaded",f,{once:!0});const v=e(()=>window.matchMedia("(max-width: 768px)"),null),g=()=>u(),m=v;v&&"function"==typeof v.addEventListener?v.addEventListener("change",g):v&&"function"==typeof m.addListener?m.addListener(g):window.addEventListener("resize",g);const b=O(u);return()=>{t(()=>{document.removeEventListener("DOMContentLoaded",f),i.removeEventListener("click",p),window.removeEventListener(Z,d),window.removeEventListener(Y,h),v&&"function"==typeof v.removeEventListener?v.removeEventListener("change",g):v&&"function"==typeof m.removeListener?m.removeListener(g):window.removeEventListener("resize",g),n.remove()}),t(b)}}catch(n){return()=>{}}}const W=(n,t)=>{let e=n;const o=X[t];let r=null,i=0,c=null;const l=[],a={},u=(n,t)=>{i=4*e+17,r=(n=>{const t=new Array(n);for(let e=0;e<n;e+=1){t[e]=new Array(n);for(let o=0;o<n;o+=1)t[e][o]=null}return t})(i),s(0,0),s(i-7,0),s(0,i-7),h(),d(),f(n,t),e>=7&&p(n),null==c&&(c=g(e,o,l)),v(c,t)},s=(n,t)=>{for(let e=-1;e<=7;e+=1)if(!(n+e<=-1||i<=n+e))for(let o=-1;o<=7;o+=1)t+o<=-1||i<=t+o||(r[n+e][t+o]=0<=e&&e<=6&&(0==o||6==o)||0<=o&&o<=6&&(0==e||6==e)||2<=e&&e<=4&&2<=o&&o<=4)},d=()=>{for(let n=8;n<i-8;n+=1)null==r[n][6]&&(r[n][6]=n%2==0);for(let n=8;n<i-8;n+=1)null==r[6][n]&&(r[6][n]=n%2==0)},h=()=>{const n=nn.getPatternPosition(e);for(let t=0;t<n.length;t+=1)for(let e=0;e<n.length;e+=1){const o=n[t],i=n[e];if(null==r[o][i])for(let n=-2;n<=2;n+=1)for(let t=-2;t<=2;t+=1)r[o+n][i+t]=-2==n||2==n||-2==t||2==t||0==n&&0==t}},p=n=>{const t=nn.getBCHTypeNumber(e);for(let e=0;e<18;e+=1){const o=!n&&1==(t>>e&1);r[Math.floor(e/3)][e%3+i-8-3]=o}for(let e=0;e<18;e+=1){const o=!n&&1==(t>>e&1);r[e%3+i-8-3][Math.floor(e/3)]=o}},f=(n,t)=>{const e=nn.getBCHTypeInfo(o<<3|t);for(let t=0;t<15;t+=1){const o=!n&&1==(e>>t&1);t<6?r[t][8]=o:t<8?r[t+1][8]=o:r[i-15+t][8]=o}for(let t=0;t<15;t+=1){const o=!n&&1==(e>>t&1);t<8?r[8][i-t-1]=o:t<9?r[8][15-t-1+1]=o:r[8][15-t-1]=o}r[i-8][8]=!n},v=(n,t)=>{let e=-1,o=i-1,c=7,l=0;const a=nn.getMaskFunction(t);for(let t=i-1;t>0;t-=2)for(6==t&&(t-=1);;){for(let e=0;e<2;e+=1)if(null==r[o][t-e]){let i=!1;l<n.length&&(i=1==(n[l]>>>c&1)),a(o,t-e)&&(i=!i),r[o][t-e]=i,c-=1,-1==c&&(l+=1,c=7)}if(o+=e,o<0||i<=o){o-=e,e=-e;break}}},g=(n,t,e)=>{const o=on.getRSBlocks(n,t),r=rn();for(let t=0;t<e.length;t+=1){const o=e[t];r.put(o.getMode(),4),r.put(o.getLength(),nn.getLengthInBits(o.getMode(),n)),o.write(r)}let i=0;for(let n=0;n<o.length;n+=1)i+=o[n].dataCount;if(r.getLengthInBits()>8*i)throw"code length overflow. ("+r.getLengthInBits()+">"+8*i+")";for(r.getLengthInBits()+4<=8*i&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=8*i||(r.put(236,8),r.getLengthInBits()>=8*i));)r.put(17,8);return((n,t)=>{let e=0,o=0,r=0;const i=new Array(t.length),c=new Array(t.length);for(let l=0;l<t.length;l+=1){const a=t[l].dataCount,u=t[l].totalCount-a;o=Math.max(o,a),r=Math.max(r,u),i[l]=new Array(a);for(let t=0;t<i[l].length;t+=1)i[l][t]=255&n.getBuffer()[t+e];e+=a;const s=nn.getErrorCorrectPolynomial(u),d=en(i[l],s.getLength()-1).mod(s);c[l]=new Array(s.getLength()-1);for(let n=0;n<c[l].length;n+=1){const t=n+d.getLength()-c[l].length;c[l][n]=t>=0?d.getAt(t):0}}let l=0;for(let n=0;n<t.length;n+=1)l+=t[n].totalCount;const a=new Array(l);let u=0;for(let n=0;n<o;n+=1)for(let e=0;e<t.length;e+=1)n<i[e].length&&(a[u]=i[e][n],u+=1);for(let n=0;n<r;n+=1)for(let e=0;e<t.length;e+=1)n<c[e].length&&(a[u]=c[e][n],u+=1);return a})(r,o)};a.addData=(n,t)=>{let e=null;switch(t=t||"Byte"){case"Numeric":e=cn(n);break;case"Alphanumeric":e=ln(n);break;case"Byte":e=an(n);break;case"Kanji":e=un(n);break;default:throw"mode:"+t}l.push(e),c=null},a.isDark=(n,t)=>{if(n<0||i<=n||t<0||i<=t)throw n+","+t;return r[n][t]},a.getModuleCount=()=>i,a.make=()=>{if(e<1){let n=1;for(;n<40;n++){const t=on.getRSBlocks(n,o),e=rn();for(let t=0;t<l.length;t++){const o=l[t];e.put(o.getMode(),4),e.put(o.getLength(),nn.getLengthInBits(o.getMode(),n)),o.write(e)}let r=0;for(let n=0;n<t.length;n++)r+=t[n].dataCount;if(e.getLengthInBits()<=8*r)break}e=n}u(!1,(()=>{let n=0,t=0;for(let e=0;e<8;e+=1){u(!0,e);const o=nn.getLostPoint(a);(0==e||n>o)&&(n=o,t=e)}return t})())},a.createTableTag=(n,t)=>{n=n||2;let e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+(t=void 0===t?4*n:t)+"px;",e+='">',e+="<tbody>";for(let t=0;t<a.getModuleCount();t+=1){e+="<tr>";for(let o=0;o<a.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+n+"px;",e+=" height: "+n+"px;",e+=" background-color: ",e+=a.isDark(t,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>",e},a.createSvgTag=function(n,t,e,o){let r={};"object"==typeof arguments[0]&&(r=arguments[0],n=r.cellSize,t=r.margin,e=r.alt,o=r.title),n=n||2,t=void 0===t?4*n:t,(e="string"==typeof e?{text:e}:e||{}).text=e.text||null,e.id=e.text?e.id||"qrcode-description":null,(o="string"==typeof o?{text:o}:o||{}).text=o.text||null,o.id=o.text?o.id||"qrcode-title":null;const i=a.getModuleCount()*n+2*t;let c,l,u,s,d,h="";for(d="l"+n+",0 0,"+n+" -"+n+",0 0,-"+n+"z ",h+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',h+=r.scalable?"":' width="'+i+'px" height="'+i+'px"',h+=' viewBox="0 0 '+i+" "+i+'" ',h+=' preserveAspectRatio="xMinYMin meet"',h+=o.text||e.text?' role="img" aria-labelledby="'+m([o.id,e.id].join(" ").trim())+'"':"",h+=">",h+=o.text?'<title id="'+m(o.id)+'">'+m(o.text)+"</title>":"",h+=e.text?'<description id="'+m(e.id)+'">'+m(e.text)+"</description>":"",h+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',h+='<path d="',u=0;u<a.getModuleCount();u+=1)for(s=u*n+t,c=0;c<a.getModuleCount();c+=1)a.isDark(u,c)&&(l=c*n+t,h+="M"+l+","+s+d);return h+='" stroke="transparent" fill="black"/>',h+="</svg>",h},a.createDataURL=(n,t)=>{n=n||2,t=void 0===t?4*n:t;const e=a.getModuleCount()*n+2*t,o=t,r=e-t;return hn(e,e,(t,e)=>{if(o<=t&&t<r&&o<=e&&e<r){const r=Math.floor((t-o)/n),i=Math.floor((e-o)/n);return a.isDark(i,r)?0:1}return 1})},a.createImgTag=(n,t,e)=>{n=n||2,t=void 0===t?4*n:t;const o=a.getModuleCount()*n+2*t;let r="";return r+="<img",r+=' src="',r+=a.createDataURL(n,t),r+='"',r+=' width="',r+=o,r+='"',r+=' height="',r+=o,r+='"',e&&(r+=' alt="',r+=m(e),r+='"'),r+="/>",r};const m=n=>{let t="";for(let e=0;e<n.length;e+=1){const o=n.charAt(e);switch(o){case"<":t+="<";break;case">":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=o}}return t};return a.createASCII=(n,t)=>{if((n=n||1)<2)return(n=>{n=void 0===n?2:n;const t=1*a.getModuleCount()+2*n,e=n,o=t-n;let r,i,c,l,u;const s={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "};let h="";for(r=0;r<t;r+=2){for(c=Math.floor((r-e)/1),l=Math.floor((r+1-e)/1),i=0;i<t;i+=1)u="█",e<=i&&i<o&&e<=r&&r<o&&a.isDark(c,Math.floor((i-e)/1))&&(u=" "),e<=i&&i<o&&e<=r+1&&r+1<o&&a.isDark(l,Math.floor((i-e)/1))?u+=" ":u+="█",h+=n<1&&r+1>=o?d[u]:s[u];h+="\n"}return t%2&&n>0?h.substring(0,h.length-t-1)+Array(t+1).join("▀"):h.substring(0,h.length-1)})(t);n-=1,t=void 0===t?2*n:t;const e=a.getModuleCount()*n+2*t,o=t,r=e-t;let i,c,l,u;const s=Array(n+1).join("██"),d=Array(n+1).join(" ");let h="",p="";for(i=0;i<e;i+=1){for(l=Math.floor((i-o)/n),p="",c=0;c<e;c+=1)u=1,o<=c&&c<r&&o<=i&&i<r&&a.isDark(l,Math.floor((c-o)/n))&&(u=0),p+=u?s:d;for(l=0;l<n;l+=1)h+=p+"\n"}return h.substring(0,h.length-1)},a.renderTo2dContext=(n,t)=>{t=t||2;const e=a.getModuleCount();for(let o=0;o<e;o++)for(let r=0;r<e;r++)n.fillStyle=a.isDark(o,r)?"black":"white",n.fillRect(r*t,o*t,t,t)},a};W.stringToBytes=n=>{const t=[];for(let e=0;e<n.length;e+=1){const o=n.charCodeAt(e);t.push(255&o)}return t},W.createStringToBytes=(n,t)=>{const e=(()=>{const e=dn(n),o=()=>{const n=e.read();if(-1==n)throw"eof";return n};let r=0;const i={};for(;;){const n=e.read();if(-1==n)break;const t=o(),c=o(),l=o();i[String.fromCharCode(n<<8|t)]=c<<8|l,r+=1}if(r!=t)throw r+" != "+t;return i})(),o="?".charCodeAt(0);return n=>{const t=[];for(let r=0;r<n.length;r+=1){const i=n.charCodeAt(r);if(i<128)t.push(i);else{const i=e[n.charAt(r)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(o)}}return t}};const X={L:1,M:0,Q:3,H:2},nn=(()=>{const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,e=7973,o={},r=n=>{let t=0;for(;0!=n;)t+=1,n>>>=1;return t};return o.getBCHTypeInfo=n=>{let e=n<<10;for(;r(e)-r(t)>=0;)e^=t<<r(e)-r(t);return 21522^(n<<10|e)},o.getBCHTypeNumber=n=>{let t=n<<12;for(;r(t)-r(e)>=0;)t^=e<<r(t)-r(e);return n<<12|t},o.getPatternPosition=t=>n[t-1],o.getMaskFunction=n=>{switch(n){case 0:return(n,t)=>(n+t)%2==0;case 1:return(n,t)=>n%2==0;case 2:return(n,t)=>t%3==0;case 3:return(n,t)=>(n+t)%3==0;case 4:return(n,t)=>(Math.floor(n/2)+Math.floor(t/3))%2==0;case 5:return(n,t)=>n*t%2+n*t%3==0;case 6:return(n,t)=>(n*t%2+n*t%3)%2==0;case 7:return(n,t)=>(n*t%3+(n+t)%2)%2==0;default:throw"bad maskPattern:"+n}},o.getErrorCorrectPolynomial=n=>{let t=en([1],0);for(let e=0;e<n;e+=1)t=t.multiply(en([1,tn.gexp(e)],0));return t},o.getLengthInBits=(n,t)=>{if(1<=t&&t<10)switch(n){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+n}else if(t<27)switch(n){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+n}else{if(!(t<41))throw"type:"+t;switch(n){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+n}}},o.getLostPoint=n=>{const t=n.getModuleCount();let e=0;for(let o=0;o<t;o+=1)for(let r=0;r<t;r+=1){let i=0;const c=n.isDark(o,r);for(let e=-1;e<=1;e+=1)if(!(o+e<0||t<=o+e))for(let l=-1;l<=1;l+=1)r+l<0||t<=r+l||0==e&&0==l||c==n.isDark(o+e,r+l)&&(i+=1);i>5&&(e+=3+i-5)}for(let o=0;o<t-1;o+=1)for(let r=0;r<t-1;r+=1){let t=0;n.isDark(o,r)&&(t+=1),n.isDark(o+1,r)&&(t+=1),n.isDark(o,r+1)&&(t+=1),n.isDark(o+1,r+1)&&(t+=1),0!=t&&4!=t||(e+=3)}for(let o=0;o<t;o+=1)for(let r=0;r<t-6;r+=1)n.isDark(o,r)&&!n.isDark(o,r+1)&&n.isDark(o,r+2)&&n.isDark(o,r+3)&&n.isDark(o,r+4)&&!n.isDark(o,r+5)&&n.isDark(o,r+6)&&(e+=40);for(let o=0;o<t;o+=1)for(let r=0;r<t-6;r+=1)n.isDark(r,o)&&!n.isDark(r+1,o)&&n.isDark(r+2,o)&&n.isDark(r+3,o)&&n.isDark(r+4,o)&&!n.isDark(r+5,o)&&n.isDark(r+6,o)&&(e+=40);let o=0;for(let e=0;e<t;e+=1)for(let r=0;r<t;r+=1)n.isDark(r,e)&&(o+=1);return e+=Math.abs(100*o/t/t-50)/5*10,e},o})(),tn=(()=>{const n=new Array(256),t=new Array(256);for(let t=0;t<8;t+=1)n[t]=1<<t;for(let t=8;t<256;t+=1)n[t]=n[t-4]^n[t-5]^n[t-6]^n[t-8];for(let e=0;e<255;e+=1)t[n[e]]=e;return{glog(n){if(n<1)throw"glog("+n+")";return t[n]},gexp(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return n[t]}}})(),en=(n,t)=>{if(void 0===n.length)throw n.length+"/"+t;const e=(()=>{let e=0;for(;e<n.length&&0==n[e];)e+=1;const o=new Array(n.length-e+t);for(let t=0;t<n.length-e;t+=1)o[t]=n[t+e];return o})(),o={getAt:n=>e[n],getLength:()=>e.length,multiply(n){const t=new Array(o.getLength()+n.getLength()-1);for(let e=0;e<o.getLength();e+=1)for(let r=0;r<n.getLength();r+=1)t[e+r]^=tn.gexp(tn.glog(o.getAt(e))+tn.glog(n.getAt(r)));return en(t,0)},mod(n){if(o.getLength()-n.getLength()<0)return o;const t=tn.glog(o.getAt(0))-tn.glog(n.getAt(0)),e=new Array(o.getLength());for(let n=0;n<o.getLength();n+=1)e[n]=o.getAt(n);for(let o=0;o<n.getLength();o+=1)e[o]^=tn.gexp(tn.glog(n.getAt(o))+t);return en(e,0).mod(n)}};return o},on=(()=>{const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=(n,t)=>{const e={};return e.totalCount=n,e.dataCount=t,e};return{getRSBlocks(e,o){const r=((t,e)=>{switch(e){case X.L:return n[4*(t-1)+0];case X.M:return n[4*(t-1)+1];case X.Q:return n[4*(t-1)+2];case X.H:return n[4*(t-1)+3];default:return}})(e,o);if(void 0===r)throw"bad rs block @ typeNumber:"+e+"/errorCorrectionLevel:"+o;const i=r.length/3,c=[];for(let n=0;n<i;n+=1){const e=r[3*n+0],o=r[3*n+1],i=r[3*n+2];for(let n=0;n<e;n+=1)c.push(t(o,i))}return c}}})(),rn=()=>{const n=[];let t=0;const e={getBuffer:()=>n,getAt(t){const e=Math.floor(t/8);return 1==(n[e]>>>7-t%8&1)},put(n,t){for(let o=0;o<t;o+=1)e.putBit(1==(n>>>t-o-1&1))},getLengthInBits:()=>t,putBit(e){const o=Math.floor(t/8);n.length<=o&&n.push(0),e&&(n[o]|=128>>>t%8),t+=1}};return e},cn=n=>{const t=n,e={getMode:()=>1,getLength:n=>t.length,write(n){const e=t;let r=0;for(;r+2<e.length;)n.put(o(e.substring(r,r+3)),10),r+=3;r<e.length&&(e.length-r==1?n.put(o(e.substring(r,r+1)),4):e.length-r==2&&n.put(o(e.substring(r,r+2)),7))}},o=n=>{let t=0;for(let e=0;e<n.length;e+=1)t=10*t+r(n.charAt(e));return t},r=n=>{if("0"<=n&&n<="9")return n.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+n};return e},ln=n=>{const t=n,e={getMode:()=>2,getLength:n=>t.length,write(n){const e=t;let r=0;for(;r+1<e.length;)n.put(45*o(e.charAt(r))+o(e.charAt(r+1)),11),r+=2;r<e.length&&n.put(o(e.charAt(r)),6)}},o=n=>{if("0"<=n&&n<="9")return n.charCodeAt(0)-"0".charCodeAt(0);if("A"<=n&&n<="Z")return n.charCodeAt(0)-"A".charCodeAt(0)+10;switch(n){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+n}};return e},an=n=>{const t=W.stringToBytes(n);return{getMode:()=>4,getLength:n=>t.length,write(n){for(let e=0;e<t.length;e+=1)n.put(t[e],8)}}},un=n=>{const t=W.stringToBytes;(()=>{const n=t("友");if(2!=n.length||38726!=(n[0]<<8|n[1]))throw"sjis not supported."})();const e=t(n),o={getMode:()=>8,getLength:n=>~~(e.length/2),write(n){const t=e;let o=0;for(;o+1<t.length;){let e=(255&t[o])<<8|255&t[o+1];if(33088<=e&&e<=40956)e-=33088;else{if(!(57408<=e&&e<=60351))throw"illegal char at "+(o+1)+"/"+e;e-=49472}e=192*(e>>>8&255)+(255&e),n.put(e,13),o+=2}if(o<t.length)throw"illegal char at "+(o+1)}};return o},sn=()=>{const n=[],t={writeByte(t){n.push(255&t)},writeShort(n){t.writeByte(n),t.writeByte(n>>>8)},writeBytes(n,e,o){e=e||0,o=o||n.length;for(let r=0;r<o;r+=1)t.writeByte(n[r+e])},writeString(n){for(let e=0;e<n.length;e+=1)t.writeByte(n.charCodeAt(e))},toByteArray:()=>n,toString(){let t="";t+="[";for(let e=0;e<n.length;e+=1)e>0&&(t+=","),t+=n[e];return t+="]",t}};return t},dn=n=>{const t=n;let e=0,o=0,r=0;const i={read(){for(;r<8;){if(e>=t.length){if(0==r)return-1;throw"unexpected end of file./"+r}const n=t.charAt(e);if(e+=1,"="==n)return r=0,-1;n.match(/^\s$/)||(o=o<<6|c(n.charCodeAt(0)),r+=6)}const n=o>>>r-8&255;return r-=8,n}},c=n=>{if(65<=n&&n<=90)return n-65;if(97<=n&&n<=122)return n-97+26;if(48<=n&&n<=57)return n-48+52;if(43==n)return 62;if(47==n)return 63;throw"c:"+n};return i},hn=(n,t,e)=>{const o=((n,t)=>{const e=n,o=t,r=new Array(n*t),i={setPixel(n,t,o){r[t*e+n]=o},write(n){n.writeString("GIF87a"),n.writeShort(e),n.writeShort(o),n.writeByte(128),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(255),n.writeByte(255),n.writeByte(255),n.writeString(","),n.writeShort(0),n.writeShort(0),n.writeShort(e),n.writeShort(o),n.writeByte(0);const t=c(2);n.writeByte(2);let r=0;for(;t.length-r>255;)n.writeByte(255),n.writeBytes(t,r,255),r+=255;n.writeByte(t.length-r),n.writeBytes(t,r,t.length-r),n.writeByte(0),n.writeString(";")}},c=n=>{const t=1<<n,e=1+(1<<n);let o=n+1;const i=l();for(let n=0;n<t;n+=1)i.add(String.fromCharCode(n));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(e));const c=sn(),a=(n=>{const t=n;let e=0,o=0;return{write(n,r){if(n>>>r!=0)throw"length over";for(;e+r>=8;)t.writeByte(255&(n<<e|o)),r-=8-e,n>>>=8-e,o=0,e=0;o|=n<<e,e+=r},flush(){e>0&&t.writeByte(o)}}})(c);a.write(t,o);let u=0,s=String.fromCharCode(r[u]);for(u+=1;u<r.length;){const n=String.fromCharCode(r[u]);u+=1,i.contains(s+n)?s+=n:(a.write(i.indexOf(s),o),i.size()<4095&&(i.size()==1<<o&&(o+=1),i.add(s+n)),s=n)}return a.write(i.indexOf(s),o),a.write(e,o),a.flush(),c.toByteArray()},l=()=>{const n={};let t=0;const e={add(o){if(e.contains(o))throw"dup key:"+o;n[o]=t,t+=1},size(){return t},indexOf(t){return n[t]},contains(t){return void 0!==n[t]}};return e};return i})(n,t);for(let r=0;r<t;r+=1)for(let t=0;t<n;t+=1)o.setPixel(t,r,e(t,r));const r=sn();o.write(r);const i=(()=>{let n=0,t=0,e=0,o="";const r={},i=n=>{o+=String.fromCharCode(c(63&n))},c=n=>{if(n<0)throw"n:"+n;if(n<26)return 65+n;if(n<52)return n-26+97;if(n<62)return n-52+48;if(62==n)return 43;if(63==n)return 47;throw"n:"+n};return r.writeByte=o=>{for(n=n<<8|255&o,t+=8,e+=1;t>=6;)i(n>>>t-6),t-=6},r.flush=()=>{if(t>0&&(i(n<<6-t),n=0,t=0),e%3!=0){const n=3-e%3;for(let t=0;t<n;t+=1)o+="="}},r.toString=()=>o,r})(),c=r.toByteArray();for(let n=0;n<c.length;n+=1)i.writeByte(c[n]);return i.flush(),"data:image/gif;base64,"+i},pn="undefined"!=typeof window&&"undefined"!=typeof document;function fn(n){if(!pn)return null;try{const t=document.cookie;if(!t)return null;const e=encodeURIComponent(n),o=t.split(";");for(let t=0;t<o.length;t++){const r=o[t].indexOf("=");if(r<0)continue;const i=o[t].slice(0,r).trim();if(i===e||i===n)try{return decodeURIComponent(o[t].slice(r+1))}catch(n){return o[t].slice(r+1)}}return null}catch(n){return null}}function vn(n,t,e={}){var o,r,i;if(!pn)return!1;try{let c=`${encodeURIComponent(n)}=${encodeURIComponent(t)}`;if(c+=`; path=${null!==(o=e.path)&&void 0!==o?o:"/"}`,e.domain&&(c+=`; domain=${e.domain}`),"number"==typeof e.maxAgeDays){const n=Math.floor(86400*e.maxAgeDays);c+=`; max-age=${n}`,c+=`; expires=${new Date(Date.now()+1e3*n).toUTCString()}`}return c+=`; SameSite=${null!==(r=e.sameSite)&&void 0!==r?r:"Lax"}`,(null!==(i=e.secure)&&void 0!==i?i:"undefined"!=typeof location&&"https:"===location.protocol)&&(c+="; Secure"),document.cookie=c,fn(n)===t}catch(n){return!1}}function gn(){if(!pn)return!1;try{const n="__cnv_probe__";return localStorage.setItem(n,"1"),localStorage.removeItem(n),!0}catch(n){return!1}}function mn(n){if(!gn())return null;try{return localStorage.getItem(n)}catch(n){return null}}function bn(n,t){if(!gn())return!1;try{return localStorage.setItem(n,t),!0}catch(n){return!1}}function yn(n){if(!gn())return!1;try{return localStorage.removeItem(n),!0}catch(n){return!1}}function wn(){if(!pn)return!1;try{const n="__cnv_probe__";return sessionStorage.setItem(n,"1"),sessionStorage.removeItem(n),!0}catch(n){return!1}}function xn(n,t,e,o){return new(e||(e=Promise))((r,i)=>{function c(n){try{a(o.next(n))}catch(n){i(n)}}function l(n){try{a(o.throw(n))}catch(n){i(n)}}function a(n){var t;n.done?r(n.value):(t=n.value,t instanceof e?t:new e(n=>{n(t)})).then(c,l)}a((o=o.apply(n,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const _n=2e4,kn=/^(https:|zalo:)/i;class Mn extends Error{constructor(n){super(`loginWithZalo() thất bại: ${n}`),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:n}),this.name="ZaloQrLoginError"}}function An(n,t,e,o){return`${n}${t}?${new URLSearchParams(Object.assign({projectId:e},o)).toString()}`}function Cn(n){return{title:"string"==typeof n.title?n.title:void 0,description:"string"==typeof n.description?n.description:void 0,points:jn(n.points),expPoints:jn(n.expPoints),balanceAfter:jn(n.balanceAfter),expBalanceAfter:jn(n.expBalanceAfter),rankAfter:"string"==typeof n.rankAfter?n.rankAfter:void 0,createdAt:"string"==typeof n.createdAt?n.createdAt:void 0}}function jn(n){return"number"==typeof n&&Number.isFinite(n)?n:void 0}function zn(n){return{id:jn(n.id),name:"string"==typeof n.name?n.name:void 0,iconUrl:"string"==typeof n.iconUrl?n.iconUrl:void 0,colorCode:"string"==typeof n.colorCode?n.colorCode:void 0,threshold:jn(n.threshold),level:jn(n.level),benefits:Array.isArray(n.benefits)?n.benefits.filter(n=>"string"==typeof n&&""!==n.trim()):[]}}function Sn(n){return{id:jn(n.id),name:"string"==typeof n.name?n.name:void 0,iconUrl:"string"==typeof n.iconUrl?n.iconUrl:void 0,colorCode:"string"==typeof n.colorCode?n.colorCode:void 0,level:jn(n.level),progressCurrent:jn(n.progressCurrent),progressTarget:jn(n.progressTarget),remaining:jn(n.remaining),nextLevelName:"string"==typeof n.nextLevelName?n.nextLevelName:void 0,isHighestLevel:!0===n.isHighestLevel}}function Tn(n){return{title:"string"==typeof n.title?n.title:void 0,imageUrl:"string"==typeof n.imageUrl?n.imageUrl:void 0,code:"string"==typeof n.code?n.code:void 0,discountValue:"string"==typeof n.discountValue?n.discountValue:void 0,expiredAt:"string"==typeof n.expiredAt?n.expiredAt:void 0,useRemain:"number"==typeof n.useRemain&&Number.isFinite(n.useRemain)?n.useRemain:void 0}}function On(n,t){return xn(this,void 0,void 0,function*(){var e,o,r;if(!n.projectId||!n.endpoint)throw new Mn("not-initialized");if(!n.zaloQrLoginEnabled)throw new Mn("disabled");if(!n.consentGranted)throw new Mn("consent-required");const i={preferSse:null===(e=null==t?void 0:t.preferSse)||void 0===e||e,pollIntervalMs:null!==(o=null==t?void 0:t.pollIntervalMs)&&void 0!==o?o:2e3,autoIdentify:null===(r=null==t?void 0:t.autoIdentify)||void 0===r||r},c=n.projectId,l=n.endpoint,a=yield function(n,t){return xn(this,void 0,void 0,function*(){const e="undefined"!=typeof AbortController?new AbortController:null,o=e?setTimeout(()=>e.abort(),8e3):null;let r;try{r=yield fetch(An(n,"/zalo-qr/session",t),{method:"POST",credentials:"omit",mode:"cors",signal:e?e.signal:void 0})}catch(n){throw new Mn("network")}finally{o&&clearTimeout(o)}if(!r.ok)throw new Mn(401===(i=r.status)?"invalid-project-key":403===i?"project-suspended":"network");var i;return(n=>{const t=n;if(!t||"string"!=typeof t.sessionToken||!t.sessionToken||"string"!=typeof t.miniAppDeepLink||!kn.test(t.miniAppDeepLink)||"number"!=typeof t.expiresInSeconds||!Number.isFinite(t.expiresInSeconds)||t.expiresInSeconds<=0)throw new Mn("network");return{sessionToken:t.sessionToken,miniAppDeepLink:t.miniAppDeepLink,expiresInSeconds:t.expiresInSeconds}})(yield r.json())})}(l,c),u=((n,t,e,o,r)=>{let i=!1,c=null,l=null,a=null,u=null,s=null;const d=()=>{c&&(c.close(),c=null),null!==l&&(clearInterval(l),l=null),null!==a&&(clearTimeout(a),a=null),null!==u&&(clearTimeout(u),u=null)};return{promise:new Promise((h,p)=>{s=p;const f=n=>{i||(i=!0,d(),n())},v=n=>{"success"===n.status?f(()=>h((n=>({contactId:n.contactId,fullName:n.fullName,level:n.level,xp:n.xp,panelSessionToken:n.panelSessionToken,panelSessionExp:n.panelSessionExp}))(n))):"denied"===n.status?f(()=>p(new Mn("denied"))):"expired"===n.status&&f(()=>p(new Mn("expired")))},g=()=>{null!==l||i||(l=setInterval(()=>{fetch(An(n,"/zalo-qr/status",t,{sessionToken:e}),{method:"GET",credentials:"omit",mode:"cors"}).then(n=>404===n.status?v({status:"expired"}):n.ok?n.json().then(n=>v(n)):void 0).catch(()=>{})},r.pollIntervalMs))};if(r.preferSse&&"undefined"!=typeof EventSource)try{c=new EventSource(An(n,"/zalo-qr/stream",t,{sessionToken:e})),c.addEventListener("success",n=>{try{v(JSON.parse(n.data))}catch(n){}}),c.addEventListener("denied",()=>v({status:"denied"})),c.onerror=()=>{null!==u||i||(u=setTimeout(()=>{u=null,i||(c&&(c.close(),c=null),g())},3e3))}}catch(n){g()}else g();a=setTimeout(()=>{f(()=>p(new Mn("expired")))},1e3*o)}),cancel(){i||(i=!0,d(),null==s||s(new Mn("cancelled")))}}})(l,c,a.sessionToken,a.expiresInSeconds,i),s=u.promise.then(t=>{try{if(i.autoIdentify&&null!=t.contactId){const e=String(t.contactId),o=n.getUserId();null!=o&&o!==e?n.alias(e,o):n.identify(e,Object.assign(Object.assign(Object.assign({},t.fullName?{name:t.fullName}:{}),t.level?{level:t.level}:{}),null!=t.xp?{xp:t.xp}:{}))}}catch(n){}return t});return{sessionToken:a.sessionToken,qrPayload:a.miniAppDeepLink,expiresInSeconds:a.expiresInSeconds,result:s,cancel:u.cancel,retry(){return u.cancel(),On(n,t)}}})}const Nn="cnv:launcher:click",Fn="cnv:panel:identify",In="cnv-panel-card--leaving";function Pn(n){return"cnv_panel_session_"+(null!=n?n:"default")}function $n(n){const t=mn(Pn(n));return t?e(()=>{const n=JSON.parse(t);return n&&"string"==typeof n.token&&n.token&&"number"==typeof n.contactId&&"number"==typeof n.exp?n:null},null):null}function Dn(n,t){bn(Pn(n),JSON.stringify(t))}function Hn(n){yn(Pn(n))}function Rn(n){return"SQUARE"===n?"0px":"12px"}function Ln(n){const t=n.colors;return L(null==t?void 0:t.iconColor,L(null==t?void 0:t.buttonBg,L(null==t?void 0:t.bannerBg,D)))}function En(n,t){n.style.background=V(t,.12),n.style.color=t}const Bn='<path d="M20 12v9H4v-9M2 7h20v5H2V7Zm10 0V4a2.5 2.5 0 0 0-5 0v3h5Zm0 0V4a2.5 2.5 0 0 1 5 0v3h-5Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/>',Un='<path d="M9 6l6 6-6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>',Vn='<path d="M12 2.5l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.8 5.9 21.1l1.4-6.8-5.1-4.7 6.9-.8L12 2.5Z" fill="currentColor"/>',Kn='<circle cx="9" cy="8" r="3.2" stroke="currentColor" stroke-width="1.8"/><path d="M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>',qn='<circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="1.8"/><path d="M12 7v5l3.5 2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>',Gn='<path d="M5 13l4.5 4.5L19 8" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>',Zn='<circle cx="11" cy="4.6" r="2.3" fill="currentColor"/><rect x="2.2" y="10" width="3" height="6.4" rx="1.5" fill="currentColor"/><path d="M7.4 12.2c2 0 3.4.6 4.6 1.8h2.2a1.6 1.6 0 1 1 0 3.2h-3.4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><path d="M7.4 12.2v7c3.2 1.2 6.2.5 9-2l3.2-2.9a1.7 1.7 0 0 0-2.2-2.6l-3 2.3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>';function Yn(n,t,e){const o=document.createElement("span");return o.className=e?"cnv-panel-icon "+e:"cnv-panel-icon",o.innerHTML=`<svg viewBox="0 0 24 24" fill="none" width="${t}" height="${t}">${n}</svg>`,o}function Jn(n,t){const e=document.createElement("div");return e.className="cnv-panel-chip",En(e,t),e.appendChild(Yn(n,14)),e}function Qn(n,t){const e=document.createElement("span");return e.className="cnv-panel-badge",En(e,t),e.textContent=n,e}const Wn={POINTS:{label:"Điểm thưởng",icon:Vn},REFERRAL:{label:"Giới thiệu bạn bè",icon:Kn},VIP:{label:"Hạng thành viên (VIP)",icon:'<path d="M3 8l3.2 3 3.6-5.4L12 3l2.2 2.6L17.8 11 21 8l-1.6 10H4.6L3 8Z" fill="currentColor"/>'}},Xn={rewards:'<path d="M3 9V6.4c0-.8.6-1.4 1.4-1.4h15.2c.8 0 1.4.6 1.4 1.4V9a3 3 0 0 0 0 6v2.6c0 .8-.6 1.4-1.4 1.4H4.4c-.8 0-1.4-.6-1.4-1.4V15a3 3 0 0 0 0-6Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M14.6 5.6v12.8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-dasharray="2.2 2.6"/>',earn:Zn,redeem:Bn,history:qn},nt={ORDER:'<path d="M4.4 8h15.2l-1.1 12.3H5.5L4.4 8Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M8.7 8V6.3a3.3 3.3 0 0 1 6.6 0V8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>',STAR:Vn,GIFT:Bn,USERS:Kn,CAKE:'<path d="M3.6 20.6h16.8v-5.1c0-1-.8-1.9-1.9-1.9H5.5c-1 0-1.9.8-1.9 1.9v5.1Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M12 13.6V9.7" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="12" cy="7.5" r="1.8" fill="currentColor"/>',SHARE:'<circle cx="17.8" cy="5.6" r="2.6" stroke="currentColor" stroke-width="1.8"/><circle cx="6.2" cy="12" r="2.6" stroke="currentColor" stroke-width="1.8"/><circle cx="17.8" cy="18.4" r="2.6" stroke="currentColor" stroke-width="1.8"/><path d="M15.5 6.9 8.5 10.7M8.5 13.3l7 3.8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>',COIN:Zn,CHECK:Gn},tt={earn:{label:"Cách kiếm thêm điểm",icon:Zn},redeem:{label:"Cách đổi điểm",icon:Bn}},et="Tham gia ngay",ot=[[tt.earn.label,"earn"],[tt.redeem.label,"redeem"]];function rt(n,t){var e;const o=document.createElement("div");var r,i;return o.className=t?"cnv-panel-card__section "+t:"cnv-panel-card__section",o.style.borderRadius=Rn(null===(e=n.shapes)||void 0===e?void 0:e.card),(r=o).style.backgroundColor="DARK"===(i=n.theme)?"#3F4254":"#FFFFFF",r.style.boxShadow="DARK"===i?"none":"0 2px 4px rgba(15, 42, 81, 0.04)",o}function it(n,t){const e=document.createElement("div");return e.className="cnv-panel-zalo__skeleton",e.style.width=n+"px",e.style.height=t+"px",e}function ct(n,t){const e=document.createElement("div");e.className="cnv-panel-zalo__corner tl",e.style.borderColor=t;const o=document.createElement("div");o.className="cnv-panel-zalo__corner br",o.style.borderColor=t,n.append(e,o)}function lt(n){const t=document.createElement("div");t.className="cnv-panel-vstack";const e=document.createElement("div");e.className="cnv-panel-zalo__qr",e.appendChild(it(180,180)),ct(e,n),t.appendChild(e);const o=document.createElement("div");return o.className="cnv-panel-vstack",o.style.gap="6px",o.append(it(240,14),it(160,14)),t.appendChild(o),t.appendChild(it(120,14)),t}function at(n,t,e,o){const r=document.createElement("div");r.className="cnv-panel-zalo__overlay-bubble";const i=document.createElement("div");i.className="cnv-panel-bubble-icon",i.style.background=e,i.style.color=t,i.appendChild(Yn(n,20));const c=document.createElement("div");return c.className="cnv-panel-zalo__title",c.textContent=o,r.append(i,c),r}function ut(n,t,e){let o=n,r=null;const i=()=>{null!==r&&(clearInterval(r),r=null)};return!0===t(o)||(r=setInterval(()=>{o-=1,(!0===t(o)||o<=0)&&(i(),e&&e())},1e3)),i}function st(n){return n instanceof Mn?n.reason:null}function dt(n){switch(st(n)){case"disabled":return"Đăng nhập bằng Zalo hiện đang tắt.";case"consent-required":return"Cần đồng ý thu thập dữ liệu để đăng nhập bằng Zalo.";case"expired":return"Mã QR đã hết hạn.";case"denied":return"Đăng nhập đã bị từ chối.";case"cancelled":return"Đã huỷ đăng nhập.";default:return"Vui lòng thử lại giúp mình nhé."}}function ht(n,r){if("undefined"==typeof document||"undefined"==typeof window)return()=>{};try{let i,c=null,l=null,a=null,u=null,s=null,d=null,h=null,p=null,f=null,v=null,g=null,m=!1,b=null,y=null,w=!1,x=!1,_=!1,k=[],M=0,A=!1,C=null,j=null,z=null,S=!1,T=[],O=0,N=null,F=!1,I=!1,P=0,U=0,Z=null,Y=null,J=null;const Q=n=>{"Escape"===n.key&&It()};function X(n){return!w||n!==P}function nn(n,t){return e(()=>{const e=new CustomEvent(n,{detail:{action:t},cancelable:!0});return window.dispatchEvent(e),e.defaultPrevented},!1)}function tn(n){nn("cnv:panel:cta-click",n)}function en(n){return()=>{m&&n()}}function on(n,t,e){const o=document.createElement("div");o.className="cnv-panel-section__row",e&&(o.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2");const i=Xn[t];if(i){const n=Yn(i,20);n.style.color=Ln(r),o.appendChild(n)}const c=document.createElement("span");return c.className="cnv-panel-section__row-label",c.textContent=n,o.appendChild(c),o.appendChild(Yn(Un,12,"cnv-panel-icon--chevron")),o.addEventListener("click",en(()=>{nn("cnv:panel:menu-click",t)||("rewards"===t?(x=!0,yt(),fn()):"history"===t?(_=!0,yt(),bn(),k.length||(M=0,mn())):tt[t]&&(C=t,yt(),Mn()))})),o}function rn(){var n,t,e,o;const i=rt(r,"cnv-panel-cta"),c=r.accountCreationCta,l=document.createElement("div");l.className="cnv-panel-cta__title",l.textContent=(null==c?void 0:c.title)||"";const a=document.createElement("div");a.className="cnv-panel-cta__desc",a.textContent=(null==c?void 0:c.description)||"";const u=document.createElement("button");u.type="button",u.className="cnv-panel-cta__btn",u.style.borderRadius=Rn(null===(n=r.shapes)||void 0===n?void 0:n.button),u.style.backgroundColor=L(null===(t=r.colors)||void 0===t?void 0:t.buttonBg,D),u.style.color=L(null===(e=r.colors)||void 0===e?void 0:e.buttonFont,H),u.appendChild(Yn(Bn,15)),u.appendChild(document.createTextNode(((null==c?void 0:c.createAccountButtonText)||"").trim()||et)),u.addEventListener("click",en(()=>{tn("create-account"),Tt()})),i.append(l,a,u);const s=((null==c?void 0:c.signInLinkText)||"").trim();if(s){const n=document.createElement("div");n.className="cnv-panel-cta__signin",n.style.color=L(null===(o=r.colors)||void 0===o?void 0:o.linkColor,D),n.appendChild(document.createTextNode(s)),n.appendChild(Yn(Un,12,"cnv-panel-icon--chevron")),n.addEventListener("click",en(()=>{tn("sign-in"),Tt()})),i.appendChild(n)}return i}function cn(){var n;const t=r.accountCreationCta,e=((null==t?void 0:t.description)||"").trim()||((null==t?void 0:t.title)||"").trim();if(!e)return null;const o="DARK"===r.theme,i=document.createElement("div");return i.className="cnv-panel-card__section cnv-panel-join-hint",i.style.borderRadius=Rn(null===(n=r.shapes)||void 0===n?void 0:n.card),i.style.backgroundColor=o?"#2A2E44":"#F1F1F4",i.style.color=o?"rgba(255,255,255,.72)":"rgba(24,28,50,.66)",i.textContent=e,i}function ln(){var n,t,e,o;const i=r.accountCreationCta,c="DARK"===r.theme,l=document.createElement("div");l.className="cnv-panel-joinbar",l.style.backgroundColor=c?"#181C32":"#FFFFFF",l.style.borderTop=c?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2";const a=document.createElement("button");a.type="button",a.className="cnv-panel-cta__btn",a.style.borderRadius=Rn(null===(n=r.shapes)||void 0===n?void 0:n.button),a.style.backgroundColor=L(null===(t=r.colors)||void 0===t?void 0:t.buttonBg,D),a.style.color=L(null===(e=r.colors)||void 0===e?void 0:e.buttonFont,H),a.appendChild(Yn(Bn,15)),a.appendChild(document.createTextNode(((null==i?void 0:i.createAccountButtonText)||"").trim()||et)),a.addEventListener("click",en(()=>{tn("create-account"),Tt()})),l.appendChild(a);const u=((null==i?void 0:i.signInLinkText)||"").trim();if(u){const n=document.createElement("div");n.className="cnv-panel-cta__signin",n.style.color=L(null===(o=r.colors)||void 0===o?void 0:o.linkColor,D),n.appendChild(document.createTextNode(u)),n.appendChild(Yn(Un,12,"cnv-panel-icon--chevron")),n.addEventListener("click",en(()=>{tn("sign-in"),Tt()})),l.appendChild(n)}return l}function an(){var n;return null!==(n=null==z?void 0:z.rewardsAvailableCount)&&void 0!==n?n:null==b?void 0:b.rewardsAvailableCount}function un(){if(!(null==b?void 0:b.isMember)||z||S)return;const t=$n(n.projectId);t&&(S=!0,n.fetchRewardsSummary(t.token).then(n=>{S=!1,n&&(z=n,T=n.rewards.slice(),O=1,m&>())}).catch(()=>{S=!1}))}function sn(){return(Array.isArray(r.sections)?r.sections:[]).some(n=>"VIP"===n.type&&n.enabled)}function dn(){const n=null==z?void 0:z.rewardsAvailableCount;return"number"==typeof n&&O?Math.max(0,n-T.length):0}function hn(){if(I||!dn())return;const t=$n(n.projectId);if(!t)return;const e=O+1;I=!0,x&&fn(),n.fetchRewardsSummary(t.token,e).then(n=>{I=!1,O=e,n&&(n.rewards.length&&(T=T.concat(n.rewards)),"number"==typeof n.rewardsAvailableCount&&z&&(z=Object.assign(Object.assign({},z),{rewardsAvailableCount:n.rewardsAvailableCount}))),x&&fn()}).catch(()=>{I=!1,x&&fn()})}function pn(n,t,e){const o=document.createElement("div");if(o.className="cnv-panel-reward",t&&(o.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2"),E(n.imageUrl)){const t=document.createElement("img");t.className="cnv-panel-reward__thumb",t.src=n.imageUrl,t.alt="",t.loading="lazy",t.decoding="async",t.addEventListener("error",()=>t.remove()),o.appendChild(t)}const i=document.createElement("div");i.className="cnv-panel-reward__main";const c=document.createElement("div");c.className="cnv-panel-reward__title",c.textContent=n.title||"Ưu đãi",i.appendChild(c);const l="number"==typeof n.useRemain&&n.useRemain>1;if(n.discountValue||l){const t=document.createElement("div");if(t.className="cnv-panel-reward__tags",n.discountValue){const o=document.createElement("span");o.className="cnv-panel-reward__value",En(o,e),o.textContent=n.discountValue,t.appendChild(o)}if(l){const e=document.createElement("span");e.className="cnv-panel-reward__uses",e.textContent=`Còn ${n.useRemain} lượt`,t.appendChild(e)}i.appendChild(t)}if(n.code){const t=document.createElement("div");t.className="cnv-panel-reward__code",t.textContent=n.code,i.appendChild(t)}const a=(n=>{if(!n)return null;const t=Date.parse(n);if(!Number.isFinite(t))return null;const e=new Date(t),o=n=>String(n).padStart(2,"0");return`${o(e.getDate())}/${o(e.getMonth()+1)}/${e.getFullYear()}`})(n.expiredAt);if(a){const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent=`HSD ${a}`,i.appendChild(n)}return o.appendChild(i),o}function fn(){if(!h)return;xt(),_t(),wt(!0),h.textContent="";const n=Ln(r),t=rt(r),e=document.createElement("div");e.className="cnv-panel-section__head",e.appendChild(Jn(Bn,n));const o=document.createElement("div");if(o.className="cnv-panel-section__title",o.textContent="Ưu đãi của bạn",e.appendChild(o),t.appendChild(e),T.length){const e=document.createElement("div");e.className="cnv-panel-reward__list",T.forEach((t,o)=>e.appendChild(pn(t,o>0,n))),t.appendChild(e);const o=dn();if(o>0||I){const n=document.createElement("button");n.type="button",n.className="cnv-panel-zalo__btn cnv-panel-reward__more",n.disabled=I,n.textContent=I?"Đang tải…":`Xem thêm ${o} ưu đãi`,n.addEventListener("click",hn),t.appendChild(n)}}else{const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent="Bạn chưa có ưu đãi nào.",t.appendChild(n)}h.appendChild(t)}function vn(n){const t="earn"===n?r.earnBlocks:"redeem"===n?r.redeemBlocks:null;return Array.isArray(t)?t.filter(n=>n&&"string"==typeof n.title&&""!==n.title.trim()).slice(0,12):[]}function gn(n,t,e,o){const i=document.createElement("div");i.className="cnv-panel-block",t&&(i.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2");const c=nt[n.icon];i.appendChild(Jn("string"==typeof c?c:o,e));const l=document.createElement("div");l.className="cnv-panel-block__main";const a=document.createElement("div");a.className="cnv-panel-block__title",a.textContent=n.title.trim(),l.appendChild(a);const u="string"==typeof n.description?n.description.trim():"";if(u){const n=document.createElement("div");n.className="cnv-panel-block__desc",n.textContent=u,l.appendChild(n)}return i.appendChild(l),i}function mn(){if(A)return;const t=$n(n.projectId);if(!t)return;const e=M+1;A=!0,_&&bn(),n.fetchPointHistory(t.token,e).then(n=>{A=!1,M=e,n&&("number"==typeof n.totalCount&&(i=n.totalCount),n.items.length&&(k=k.concat(n.items))),_&&bn()}).catch(()=>{A=!1,_&&bn()})}function bn(){if(!h)return;xt(),_t(),wt(!0),h.textContent="";const n=Ln(r),t=rt(r);if(t.appendChild(An({label:"Lịch sử hoạt động",icon:qn},n)),!k.length&&A)t.appendChild(it(180,12)),t.appendChild(it(120,12));else if(k.length){const n=document.createElement("div");n.className="cnv-panel-history__list",k.forEach((t,e)=>n.appendChild(yn(t,e>0))),t.appendChild(n);const e="number"==typeof i&&M?Math.max(0,i-k.length):0;if(e>0||A){const n=document.createElement("button");n.type="button",n.className="cnv-panel-zalo__btn cnv-panel-reward__more",n.disabled=A,n.textContent=A?"Đang tải…":`Xem thêm ${e} hoạt động`,n.addEventListener("click",en(mn)),t.appendChild(n)}}else{const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent="Chưa có hoạt động nào.",t.appendChild(n)}h.appendChild(t)}function yn(n,t){const e=document.createElement("div");e.className="cnv-panel-history__row",t&&(e.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2");const o=document.createElement("div");o.className="cnv-panel-history__main";const i=document.createElement("div");i.className="cnv-panel-history__title",i.textContent=(n.title||"").trim()||"Hoạt động",o.appendChild(i);const c=(n.description||"").trim();c&&o.appendChild(wn(c));const l=[];"number"==typeof n.balanceAfter&&l.push("Điểm tích lũy: "+_n(n.balanceAfter));const a=(n.rankAfter||"").trim();"number"==typeof n.expBalanceAfter?l.push("Điểm xét hạng: "+_n(n.expBalanceAfter)+(a?" (Hạng "+a+")":"")):a&&l.push("Hạng "+a),l.length&&o.appendChild(wn(l.join(" / ")));const u=kn(n.createdAt);u&&o.appendChild(wn(u)),e.appendChild(o);const s=document.createElement("div");if(s.className="cnv-panel-history__amounts","number"==typeof n.points){const t=document.createElement("div");t.className="cnv-panel-history__points",t.textContent=xn(n.points)+" điểm",s.appendChild(t)}if("number"==typeof n.expPoints&&0!==n.expPoints){const t=document.createElement("div");t.className="cnv-panel-history__exp",t.textContent=xn(n.expPoints)+" xét hạng",s.appendChild(t)}return s.childElementCount&&e.appendChild(s),e}function wn(n){const t=document.createElement("div");return t.className="cnv-panel-history__meta",t.textContent=n,t}function xn(n){const t=Math.round(n);return(t>0?"+":"")+t.toLocaleString("vi-VN")}function _n(n){return Math.round(n).toLocaleString("vi-VN")}function kn(n){if(!n)return null;const t=new Date(n);return Number.isNaN(t.getTime())?null:t.toLocaleDateString("vi-VN")+" "+t.toLocaleTimeString("vi-VN",{hour:"2-digit",minute:"2-digit"})}function Mn(){if(!h||!C)return;const n=tt[C];if(!n)return C=null,void ft();const t=vn(C);xt(),_t(),wt(!0),h.textContent="";const e=Ln(r),o=rt(r);if(o.appendChild(An(n,e)),t.length){const r=document.createElement("div");r.className="cnv-panel-block__list",t.forEach((t,o)=>r.appendChild(gn(t,o>0,e,n.icon))),o.appendChild(r)}else{const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent="redeem"===C?"Shop chưa cập nhật cách đổi điểm. Bạn quay lại sau nhé.":"Shop chưa cập nhật cách kiếm thêm điểm. Bạn quay lại sau nhé.",o.appendChild(n)}if(h.appendChild(o),!bt()){const n=cn();n&&h.appendChild(n)}j=bt()}function An(n,t){const e=document.createElement("div");e.className="cnv-panel-section__head",e.appendChild(Jn(n.icon,t));const o=document.createElement("div");return o.className="cnv-panel-section__title",o.textContent=n.label,e.appendChild(o),e}function Cn(n){if(!(Array.isArray(r.sections)?r.sections:[]).some(n=>"POINTS"===n.type&&n.enabled))return null;const t=rt(r),e=document.createElement("div");e.className="cnv-panel-section__desc",e.textContent="Kiếm điểm từ nhiều hoạt động, rồi đổi điểm lấy những ưu đãi hấp dẫn.";const o=document.createElement("div");return ot.forEach((n,t)=>o.appendChild(on(n[0],n[1],t>0))),t.append(An(Wn.POINTS,n),e,o),t}function jn(n){const t=Math.max(0,Math.round(n)).toLocaleString("vi-VN");return"SPENDING"===(null==N?void 0:N.applyFor)?t+"đ":t+" điểm"}function zn(n){return"number"!=typeof n.threshold||n.threshold<=0?"":"RELATIVE"===(null==N?void 0:N.thresholdKind)?"cần thêm "+jn(n.threshold):"từ "+jn(n.threshold)}function Sn(n){const t=document.createElement("span");if(t.className="cnv-panel-tier__badge",E(n.iconUrl)){const e=document.createElement("img");return e.className="cnv-panel-tier__badge-img",e.alt="",e.src=n.iconUrl,t.appendChild(e),t}return t.style.backgroundColor=L(n.colorCode,Ln(r)),t}function Tn(n,t){var e,o;const r=document.createElement("div");r.className="cnv-panel-tier__row",t&&r.classList.add("cnv-panel-tier__row--current"),r.appendChild(Sn(n));const i=document.createElement("span");i.className="cnv-panel-tier__name",i.textContent=t?(null!==(e=n.name)&&void 0!==e?e:"")+" — bạn đang ở đây":null!==(o=n.name)&&void 0!==o?o:"";const c=document.createElement("span");return c.className="cnv-panel-tier__threshold",c.textContent=zn(n),r.append(i,c),r}function On(n){const t=n.filter(n=>"string"==typeof n&&""!==n.trim());if(!t.length)return null;const e=document.createElement("ul");return e.className="cnv-panel-tier__benefits",t.forEach(n=>{const t=document.createElement("li");t.textContent=n.trim(),e.appendChild(t)}),e}function Pn(n,t){const e=document.createElement("div");return e.className="cnv-panel-tier__more",e.textContent="…và "+n+(t?" hạng cao hơn":" hạng thấp hơn"),e}function Vn(n,t){var e;const o=n.progressTarget,i=null!==(e=n.progressCurrent)&&void 0!==e?e:0;if("number"!=typeof o||o<=0)return null;const c=document.createElement("div");c.className="cnv-panel-tier__progress";const l=document.createElement("div");l.className="cnv-panel-tier__bar",l.style.backgroundColor="DARK"===r.theme?"rgba(255,255,255,.16)":"rgba(24,28,50,.10)";const a=document.createElement("div");a.className="cnv-panel-tier__fill",a.style.backgroundColor=t,a.style.width=Math.max(0,Math.min(100,i/o*100)).toFixed(1)+"%",l.appendChild(a);const u=document.createElement("div");u.className="cnv-panel-tier__hint";const s="number"==typeof n.remaining?n.remaining:o-i;return u.textContent=n.nextLevelName?"Còn "+jn(s)+" nữa để lên "+n.nextLevelName:"Còn "+jn(s)+" nữa để lên hạng kế tiếp",c.append(l,u),c}function Kn(n,t){if(t<0)return{from:0,to:Math.min(n.length,4)};const e=Math.max(0,t-1);return{from:e,to:Math.min(n.length,e+4)}}function Zn(n,t){var e,o;const i=null!==(e=null==N?void 0:N.tiers)&&void 0!==e?e:[];if(!i.length)return null;const c=rt(r),l=document.createElement("div"),a=t?null==z?void 0:z.tier:void 0;if(null==a?void 0:a.name){const t=document.createElement("div");t.className="cnv-panel-tier__current",t.appendChild(Sn(a));const e=document.createElement("span");e.className="cnv-panel-tier__current-name",e.style.color=n,e.textContent=a.name,t.appendChild(e),l.appendChild(t);const o=Vn(a,n);if(o)l.appendChild(o);else if(a.isHighestLevel){const n=document.createElement("div");n.className="cnv-panel-tier__hint",n.textContent="Bạn đang ở hạng cao nhất.",l.appendChild(n)}}else if(!t){const n=document.createElement("div");n.className="cnv-panel-section__desc",n.textContent="Mua càng nhiều, hạng càng cao, quyền lợi càng nhiều.",l.appendChild(n)}const u=null!=(null==a?void 0:a.id)?i.findIndex(n=>n.id===a.id):-1,{from:s,to:d}=Kn(i,u),h=document.createElement("div");h.className="cnv-panel-tier__list",s>0&&h.appendChild(Pn(s,!1));for(let n=s;n<d;n++){const t=n===u;if(h.appendChild(Tn(i[n],t)),t||u<0){const t=On(i[n].benefits);t&&h.appendChild(t)}}const p=Math.max(null!==(o=null==N?void 0:N.totalTiers)&&void 0!==o?o:i.length,i.length)-d;return p>0&&h.appendChild(Pn(p,!0)),l.appendChild(h),c.append(An(Wn.VIP,n),l),c}function ht(n,t){const e=Wn[n];if(!e||"string"!=typeof e.label)return null;if("VIP"===n)return Zn(t,!0);const o=rt(r),i=An(e,t),c=document.createElement("div");if("POINTS"!==n)return c.appendChild(Qn("Sắp ra mắt",t)),o.append(i,c),o;const l=null!==(a=null==z?void 0:z.points)&&void 0!==a?a:null==b?void 0:b.points;var a;if("number"==typeof l&&Number.isFinite(l)){const n=document.createElement("div");n.className="cnv-panel-section__points",n.style.color=t;const e=l.toLocaleString("vi-VN");n.textContent=e,e.length>15&&(n.style.fontSize="20px"),c.appendChild(n)}else c.appendChild(Qn("Đang cập nhật",t));const u=an();return[["number"==typeof u?`Ưu đãi của bạn — ${u} ưu đãi khả dụng`:"Ưu đãi của bạn","rewards"],...ot,["Lịch sử hoạt động","history"]].forEach((n,t)=>c.appendChild(on(n[0],n[1],t>0))),o.append(i,c),o}function pt(){if(!s||!d)return;const n=r.colors;l&&(l.style.backgroundColor="DARK"===r.theme?"#181C32":"#FFFFFF",l.style.color="DARK"===r.theme?"#FFFFFF":"#181C32");const t=s.parentElement;if(t&&(t.style.backgroundColor=L(null==n?void 0:n.bannerBg,D),t.style.color=L(null==n?void 0:n.bannerFont,H)),a&&(E(r.bannerImageUrl)?(a.src=r.bannerImageUrl,a.style.display="block"):(a.style.display="none",a.removeAttribute("src"))),u){const t=u.parentElement;E(r.brandIconUrl)?(u.src=r.brandIconUrl,t&&(t.style.display="flex",t.style.background=V(L(null==n?void 0:n.bannerFont,H),.18))):(t&&(t.style.display="none"),u.removeAttribute("src"))}const e=(null==b?void 0:b.isMember)?r.headerMember:r.headerVisitor;s.textContent=(null==e?void 0:e.caption)||"",d.textContent=(null==e?void 0:e.title)||""}function ft(){if(!h||w||x||_||C)return;xt(),_t(),wt(!0),h.textContent="";const n=Ln(r);if(!(null==b?void 0:b.isMember)){let t=0;vt(rn(),t++);const e=Cn(n);e&&vt(e,t++);const o=sn()?Zn(n,!1):null;return void(o&&vt(o,t++))}const t=Array.isArray(r.sections)?[...r.sections]:[];let e=0;t.filter(n=>n.enabled&&"string"==typeof n.type).sort((n,t)=>{var e,o;return(null!==(e=n.order)&&void 0!==e?e:0)-(null!==(o=t.order)&&void 0!==o?o:0)}).forEach(t=>{const o=ht(t.type,n);o&&vt(o,e++)})}function vt(n,t){n.style.animationDelay=40+55*t+"ms",h.appendChild(n)}function gt(){pt(),C?j!==bt()&&Mn():ft()}function mt(){z=null,T=[],O=0,x=!1,k=[],i=void 0,M=0,_=!1}function bt(){return!!(null==b?void 0:b.isMember)}function yt(){h&&(h.scrollTop=0)}function wt(n){l&&(l.style.backgroundImage=n?((n,t)=>{if(!n||"NONE"===n)return"none";const e=((n,t)=>{switch(n){case"WAVES":return`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="24" viewBox="0 0 48 24"><path d="M0 12c6 0 6 8 12 8s6-8 12-8 6 8 12 8 6-8 12-8" fill="none" stroke="${t}" stroke-width="2"/></svg>`;case"CUBES":return`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><rect x="4" y="4" width="14" height="14" fill="none" stroke="${t}" stroke-width="2"/><rect x="22" y="22" width="14" height="14" fill="none" stroke="${t}" stroke-width="2"/></svg>`;case"FUN":return`<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 44 44"><circle cx="8" cy="10" r="2.4" fill="${t}"/><path d="M30 6l1.6 3.4 3.6.4-2.6 2.6.7 3.7-3.3-1.8-3.3 1.8.7-3.7-2.6-2.6 3.6-.4z" fill="${t}"/><circle cx="34" cy="34" r="2.4" fill="${t}"/><circle cx="10" cy="34" r="1.8" fill="${t}"/></svg>`;case"GEOMETRIC":return`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M8 36 16 12l8 24Z" fill="none" stroke="${t}" stroke-width="2"/><circle cx="36" cy="14" r="6" fill="none" stroke="${t}" stroke-width="2"/></svg>`;case"CROSS_HATCHING":return`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0 24 24M0 24 24 0" stroke="${t}" stroke-width="1.4"/></svg>`;default:return""}})(n,t?"rgba(255,255,255,0.16)":"rgba(17,17,17,0.10)");return e?`url("data:image/svg+xml,${encodeURIComponent(e)}")`:"none"})(r.wallpaper,"DARK"===r.theme):"none")}function xt(){const n=w||x||_||null!==C;f&&(f.style.display=n?"inline-flex":"none"),p&&p.classList.toggle("cnv-panel-banner--sub",n)}function _t(){if(!l)return;const n=!bt()&&null!==C;if(n&&!g)return g=ln(),void l.insertBefore(g,v);!n&&g&&(g.remove(),g=null)}function kt(){w&&(At(),w=!1),x=!1,_=!1,C=null,yt(),ft()}function Mt(){Z=o(Z)}function At(){Y=o(Y)}function Ct(n,t){Mt();const e=Date.now()+1e3*t.expiresInSeconds;Z=ut(t.expiresInSeconds,()=>{const t=Math.max(0,Math.round((e-Date.now())/1e3)),o=String(Math.floor(t/60)).padStart(2,"0"),r=String(t%60).padStart(2,"0");return n.textContent=`Hết hạn sau ${o}:${r}`,t<=0})}function jt(){if(w=!1,Mt(),At(),y){const n=y;y=null,t(()=>n.cancel())}}function zt(){const n=document.createElement("button");return n.type="button",n.className="cnv-panel-zalo__btn",n.textContent="Huỷ",n.addEventListener("click",()=>{jt(),gt()}),n}function St(n){var t;if(!h)return;xt(),_t(),wt(!1),h.textContent="";const e=Ln(r),o=rt(r,"cnv-panel-zalo");if("loading"===n.phase)o.appendChild(lt(e)),o.appendChild(zt());else if("qr"===n.phase){const t=(n=>{try{const t=W(0,"M");t.addData(n),t.make();const e=t.getModuleCount(),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox",`0 0 ${e} ${e}`),o.setAttribute("width",String(180)),o.setAttribute("height",String(180));const r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttribute("width",String(e)),r.setAttribute("height",String(e)),r.setAttribute("fill","#fff"),o.appendChild(r);let i="";for(let n=0;n<e;n++)for(let o=0;o<e;o++)t.isDark(n,o)&&(i+=`M${o} ${n}h1v1h-1z`);const c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",i),c.setAttribute("fill","#000"),o.appendChild(c),o}catch(n){return null}})(n.session.qrPayload);if(t){const n=document.createElement("div");n.className="cnv-panel-zalo__qr cnv-panel-zalo__qr--white",n.appendChild(t),ct(n,e),o.appendChild(n)}const r=document.createElement("div");r.className="cnv-panel-zalo__status",r.appendChild(document.createTextNode("Mở "));const i=document.createElement("b");i.style.color=e,i.textContent="Zalo",r.appendChild(i),r.appendChild(document.createTextNode(" trên điện thoại và quét mã để đăng nhập")),o.appendChild(r);const c=document.createElement("div");c.className="cnv-panel-zalo__timer",c.appendChild(Yn(qn,12));const l=document.createElement("span");c.appendChild(l),o.appendChild(c),Ct(l,n.session),o.appendChild(zt())}else{o.style.position="relative",o.appendChild(lt(e));const l=document.createElement("div");let a;if(l.className="cnv-panel-zalo__overlay",l.style.borderRadius=Rn(null===(t=r.shapes)||void 0===t?void 0:t.card),l.style.background="DARK"===r.theme?"rgba(63, 66, 84, 0.94)":"rgba(255, 255, 255, 0.94)","success"===n.phase)a=at(Gn,"#1E9E5B","rgba(30, 158, 91, 0.12)",n.result.fullName?`Xin chào ${n.result.fullName}!`:"Đăng nhập thành công!");else{const t="expired"===n.reason;a=at(t?qn:'<path d="M2 8.5a17 17 0 0 1 20 0M5.5 12.3a11.6 11.6 0 0 1 13 0M9 16a6 6 0 0 1 6 0M3 3l18 18" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>',t?"#6B7280":"#D64545",t?"rgba(107, 114, 128, 0.12)":"rgba(214, 69, 69, 0.10)",t?"Mã QR đã hết hạn":"Có lỗi xảy ra");const o=document.createElement("div");if(o.className="cnv-panel-zalo__status",o.textContent=t?'Bấm "Thử lại" để lấy mã mới.':n.message,a.appendChild(o),n.canRetry){const n=document.createElement("button");if(n.type="button",n.className="cnv-panel-zalo__btn",n.style.backgroundColor=e,n.style.borderColor=e,n.style.color="#fff",n.textContent="Thử lại",n.addEventListener("click",en(()=>Tt())),U>=3){const t=Math.min(5+5*(U-3),20);i=n,c=t,At(),i.disabled=!0,Y=ut(c,n=>{n>0&&(i.textContent=`Thử lại (${n}s)`)},()=>{i.disabled=!1,i.textContent="Thử lại"})}a.appendChild(n)}}l.appendChild(a),o.appendChild(l)}var i,c;h.appendChild(o)}function Tt(){if(!h)return;jt(),C=null,w=!0,yt();const e=++P;St({phase:"loading"}),n.loginWithZalo().then(o=>{X(e)?t(()=>o.cancel()):(y=o,U=0,St({phase:"qr",session:o}),o.result.then(t=>{X(e)||(Mt(),y=null,St({phase:"success",result:t}),null!=t.contactId&&"string"==typeof t.panelSessionToken&&t.panelSessionToken&&"number"==typeof t.panelSessionExp&&Dn(n.projectId,{token:t.panelSessionToken,contactId:t.contactId,fullName:t.fullName,level:t.level,xp:t.xp,exp:t.panelSessionExp}),b={isMember:!0},un(),setTimeout(()=>{X(e)||(w=!1,gt())},1500))}).catch(n=>{X(e)||(Mt(),y=null,St({phase:"error",message:dt(n),canRetry:!0,reason:st(n)}))}))}).catch(n=>{X(e)||(U+=1,St({phase:"error",message:dt(n),canRetry:!0,reason:st(n)}))})}function Ot(n){var t,e,o;if(c)return;const i=q("data-cnv-panel",'\n :host { all: initial; }\n .cnv-panel-card {\n /* max-height ở đây chỉ là mức sàn cho lúc chưa đặt vị trí — placeCard() LUÔN ghi đè bằng trần\n có trừ khoảng cách đáy thật (xem ghi chú ở đó). Sửa số 32 ở đây mà quên chỗ kia là vô nghĩa. */\n /* Chiều cao CỐ ĐỊNH, không co theo nội dung — đúng cách smile.io bày: banner ghim trên, chân ghim\n dưới, chỉ thân giữa cuộn. Nội dung ít thì panel vẫn đúng khổ đó (còn khoảng trống dưới), nội dung\n nhiều thì thân cuộn. max-height vẫn cần: màn hình thấp hơn 600px thì panel co lại theo, nếu\n không thì mép trên trôi ra ngoài viewport và mất luôn nút đóng.\n display: flex là điều kiện để chia 3 phần — bỏ nó là chân panel rơi vào giữa thân. */\n position: fixed; display: flex; flex-direction: column; background-repeat: repeat;\n width: min(360px, calc(100vw - 32px)); height: 600px; max-height: calc(100vh - 32px);\n overflow: hidden; box-shadow: 0 20px 44px rgba(24, 28, 50, .22), 0 4px 10px rgba(24, 28, 50, .12);\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;\n font-size: 14px; line-height: 1.4;\n /* transform-origin do placeCard() đặt theo bên của FAB — panel BUNG RA TỪ nút vừa bấm chứ không\n nở ra từ tâm nó. Đây là thứ làm chuyển động thấy "có nguồn gốc" thay vì thấy rời rạc. */\n animation: cnv-panel-in .34s cubic-bezier(.16, 1, .3, 1) both;\n }\n /* Đóng NHANH HƠN mở (.18s vs .34s) và bằng đường cong tăng tốc: đi vào thì mắt cần theo dõi, đi ra\n thì chỉ cần biết là nó đi — kéo dài lúc ra chỉ làm thao tác thấy chậm. */\n .cnv-panel-card--leaving {\n animation: cnv-panel-out .18s cubic-bezier(.4, 0, 1, 1) both;\n /* Panel đã đóng về mặt logic nhưng còn hiện để chạy animation — phải thôi ăn click NGAY, nếu\n không khách bấm trúng thân panel đang mờ dần là kích hoạt hành động của một panel đã đóng\n (xem whileOpen). opacity: 0 KHÔNG tắt hit-test, đã đo: elementFromPoint ở khung cuối của\n cnv-panel-out vẫn trả về đúng nút bên trong. */\n pointer-events: none;\n }\n @keyframes cnv-panel-in {\n from { opacity: 0; transform: translateY(14px) scale(.92); }\n to { opacity: 1; transform: none; }\n }\n @keyframes cnv-panel-out {\n from { opacity: 1; transform: none; }\n to { opacity: 0; transform: translateY(10px) scale(.96); }\n }\n @keyframes cnv-panel-bubble-in {\n from { opacity: 0; transform: translateY(4px) scale(.97); }\n to { opacity: 1; transform: none; }\n }\n /* Card trong thân panel trồi lên so le (delay do renderBody đặt) — mắt đọc được thứ tự nội dung\n thay vì bị đập vào cả khối. Cũng chạy khi đổi view (Ưu đãi/QR) vì card lúc đó dựng lại. */\n @keyframes cnv-panel-rise {\n from { opacity: 0; transform: translateY(10px); }\n to { opacity: 1; transform: none; }\n }\n @media (prefers-reduced-motion: reduce) {\n .cnv-panel-card, .cnv-panel-card--leaving, .cnv-panel-card__section,\n .cnv-panel-zalo__overlay-bubble { animation: none !important; }\n }\n /* z-index BẮT BUỘC: nút đóng nằm TRƯỚC .cnv-panel-banner trong DOM và cả hai đều là positioned\n element không z-index, nên banner (đứng sau) vẽ ĐÈ LÊN nút — nút vẫn có trong DOM nhưng vô hình\n và elementFromPoint tại tâm nút trả về .cnv-panel-banner__caption, tức không bấm được. */\n .cnv-panel-close {\n position: absolute; z-index: 2; top: 10px; right: 10px; width: 26px; height: 26px; border: none;\n border-radius: 999px; background: rgba(0, 0, 0, .18); color: #fff; cursor: pointer; font-size: 16px;\n display: inline-flex; align-items: center; justify-content: center; line-height: 1; padding: 0;\n transition: background .15s;\n }\n .cnv-panel-close:hover { background: rgba(0, 0, 0, .3); }\n /* Nút quay lại — ĐỐI XỨNG với .cnv-panel-close (cùng z-index vì cùng lý do: banner đứng sau trong DOM\n nên nếu không nâng z-index thì nó vẽ đè lên và nút không bấm được). Chỉ hiện khi đang ở view con. */\n .cnv-panel-back {\n position: absolute; z-index: 2; top: 10px; left: 10px; width: 26px; height: 26px; border: none;\n border-radius: 999px; background: rgba(0, 0, 0, .18); color: #fff; cursor: pointer; padding: 0;\n display: none; align-items: center; justify-content: center; transition: background .15s;\n }\n .cnv-panel-back:hover { background: rgba(0, 0, 0, .3); }\n /* min-height 160px: banner chiếm ~27% chiều cao panel như smile.io (ta từng để 88px = 14,7%, banner\n đọc ra một dải header mỏng chứ không ra phông nền).\n margin-bottom ÂM kéo thân panel lên, để card đầu tiên CHỒNG lên banner — chữ ký của smile.io. Số\n 54 = 38px chồng thật + 16px padding-top của thân. KHÔNG làm bằng margin-top âm trên card đầu: thân\n là vùng cuộn, phần tràn lên trên mép nó thì scrollTop không xuống âm được nên bị cắt vĩnh viễn. */\n .cnv-panel-banner {\n position: relative; flex: 0 0 auto; padding: 20px 20px 22px; min-height: 160px;\n margin-bottom: -54px; box-sizing: border-box; overflow: hidden;\n }\n /* Đẩy nội dung banner sang phải để chừa chỗ cho nút quay lại — nếu không thì chip thương hiệu và\n dòng caption (cả hai bắt đầu ở góc trên-trái) nằm ĐÈ lên nút.\n PHẢI đứng SAU rule trên: .cnv-panel-banner dùng shorthand "padding", cùng độ ưu tiên nên rule nào\n ở sau thì thắng — đặt trước là "padding-left" này bị xoá sạch (đã đo: caption đè lên nút 16px). */\n .cnv-panel-banner--sub { padding-left: 44px; }\n .cnv-panel-banner__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; display: none; }\n .cnv-panel-banner__brandchip {\n position: relative; width: 34px; height: 34px; border-radius: 10px; margin: 0 0 10px;\n display: none; align-items: center; justify-content: center; overflow: hidden;\n }\n .cnv-panel-banner__brandicon { width: 100%; height: 100%; object-fit: cover; display: block; }\n .cnv-panel-banner__caption { position: relative; font-size: 11.5px; opacity: .85; }\n .cnv-panel-banner__title { position: relative; font-size: 26px; font-weight: 800; line-height: 1.24; margin-top: 3px; }\n /* Vùng cuộn DUY NHẤT của panel. flex: 1 để nó ăn hết chỗ giữa banner và chân — nhờ vậy chân luôn ở\n đáy dù nội dung ngắn. overscroll-behavior chặn cuộn hết thân rồi kéo trôi cả trang phía sau. */\n .cnv-panel-body {\n flex: 1 1 auto; min-height: 0; overflow: hidden auto; overscroll-behavior: contain;\n padding: 16px; display: flex; flex-direction: column; gap: 12px;\n /* BẮT BUỘC khi banner có margin-bottom âm: banner là positioned element (position: relative cho\n ảnh/caption tuyệt đối bên trong) nên nó vẽ ĐÈ lên thân dù thân đứng sau trong DOM — không nâng\n thân lên thì phần chồng nhau bị banner che, card đầu bị cắt mất 38px trên. */\n position: relative; z-index: 1;\n /* Ẩn thanh cuộn nhưng VẪN cuộn được — smile.io không hiện thanh nào. Dấu hiệu "còn nội dung phía\n dưới" là card bị chân panel cắt ngang, đúng cách smile.io làm. */\n scrollbar-width: none; -ms-overflow-style: none;\n }\n .cnv-panel-body::-webkit-scrollbar { width: 0; height: 0; display: none; }\n /* Phần tử flex thứ 3 của card, KHÔNG còn "position: sticky": từ khi card cao cố định và thân cuộn\n riêng thì chân tự nằm đáy: sticky trong một vùng KHÔNG cuộn sẽ để chân nổi giữa panel khi nội dung\n ngắn (đúng lỗi đó đã gặp lúc chuyển sang chiều cao cố định).\n Làm mờ bằng MÀU CHỮ, tuyệt đối không dùng opacity: opacity áp lên cả element nên nền mờ theo. */\n .cnv-panel-footer {\n flex: 0 0 auto; padding: 11px 16px;\n display: flex; align-items: center; justify-content: center; gap: 4px;\n font-size: 11.5px; font-weight: 500;\n }\n .cnv-panel-footer__brand { font-weight: 800; }\n .cnv-panel-card__section {\n padding: 16px; box-sizing: border-box;\n animation: cnv-panel-rise .34s cubic-bezier(.16, 1, .3, 1) both;\n }\n .cnv-panel-chip {\n width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center;\n flex-shrink: 0;\n }\n .cnv-panel-section__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }\n /* Card mời tham gia của MÀN CHÍNH — giữ nguyên đủ bộ (tiêu đề + mô tả + nút + link), đúng như\n smile.io bày màn chính cho khách chưa đăng nhập. Canh giữa cả cụm; nút và dòng "Đăng nhập" vốn đã\n tự canh giữa bằng flex, chỉ 2 khối chữ này còn canh trái. */\n .cnv-panel-cta { text-align: center; }\n .cnv-panel-cta__title { font-size: 15px; font-weight: 800; margin-bottom: 5px; }\n .cnv-panel-cta__desc { font-size: 12.5px; line-height: 1.5; opacity: .72; margin-bottom: 14px; }\n /* Dải mời tham gia của VIEW CON ("Cách kiếm thêm điểm"/"Cách đổi điểm"): MỘT câu trên nền mờ.\n Vì sao view con KHÁC màn chính: ở đó khách đang đọc nội dung shop soạn, nhắc lại cả card CTA đủ bộ\n là một cục cao gần gấp đôi phần nội dung đang đọc. smile.io cũng chỉ để một dải mờ trong view con,\n còn nút thì ghim đáy panel (.cnv-panel-joinbar).\n padding PHẢI đứng sau .cnv-panel-card__section trong file (cùng độ đặc hiệu, luật sau thắng) —\n đảo thứ tự là padding 16px của section ăn mất dòng này, đúng lỗi đã gặp với .cnv-panel-banner--sub.\n Nền do JS đặt và phải ĐẶC: thân panel có hoạ tiết wallpaper, nền alpha để hoạ tiết lộ xuyên qua. */\n /* Dòng lịch sử: nhãn + các dòng phụ bên trái, biến động điểm bên phải. Cùng nhịp padding với dòng\n ưu đãi/block. */\n .cnv-panel-history__row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }\n .cnv-panel-history__main { flex: 1; min-width: 0; }\n .cnv-panel-history__title { font-size: 13px; font-weight: 700; line-height: 1.35; }\n .cnv-panel-history__meta { font-size: 11.5px; line-height: 1.45; opacity: .66; margin-top: 2px; }\n /* flex-shrink: 0 để cột điểm không bị nhãn dài bóp xuống dòng; tabular-nums cho các số thẳng cột.\n KHÔNG tô màu theo dấu +/- — xem ghi chú ở formatPointDelta(). */\n .cnv-panel-history__amounts { flex: 0 0 auto; text-align: right; }\n .cnv-panel-history__points {\n font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;\n }\n .cnv-panel-history__exp {\n font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;\n opacity: .66; margin-top: 2px;\n }\n .cnv-panel-join-hint { padding: 13px 16px; text-align: center; font-size: 12.5px; line-height: 1.5; font-weight: 600; }\n /* Thanh ghim đáy — con TRỰC TIẾP của card như chân panel, KHÔNG nằm trong thân cuộn: cả điểm của nó\n là nút tham gia luôn trong tầm mắt dù khách đang cuộn ở đâu (smile.io ghim "Join now" y vậy).\n flex: 0 0 auto để thân (flex: 1 1 auto) không co nó lại khi nội dung dài. */\n .cnv-panel-joinbar { flex: 0 0 auto; padding: 12px 16px; }\n /* Nút + link đăng nhập: GIỮ tên lớp .cnv-panel-cta__* dù card CTA đã bỏ — chúng vẫn đúng nghĩa\n "nút CTA / link đăng nhập", và site của shop có thể đang bắt đúng selector này. */\n .cnv-panel-cta__btn {\n display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 40px;\n border: none; font-weight: 700; cursor: pointer; margin-bottom: 10px; font-size: 13.5px;\n transition: filter .15s, transform .15s cubic-bezier(.16, 1, .3, 1);\n }\n .cnv-panel-cta__btn:hover { filter: brightness(1.06); transform: translateY(-1px); }\n .cnv-panel-cta__btn:active { transform: translateY(0) scale(.985); }\n .cnv-panel-cta__signin {\n display: flex; align-items: center; justify-content: center; gap: 4px;\n font-size: 12.5px; text-align: center; cursor: pointer; font-weight: 700;\n }\n /* Viewport THẤP (điện thoại xoay ngang) — các phần CỐ ĐỊNH phải nhường chỗ.\n Vì sao bắt buộc: từ khi card cao cố định + "overflow: hidden", ".cnv-panel-body" là phần tử DUY\n NHẤT co được, nên nó gánh hết phần thiếu và co về 0 — khách không cuộn tới được nội dung nào, mà\n card không còn van an toàn nào (trước đây card tự cuộn được). Đo thật trong Chrome: chiều cao\n viewport 375px (iPhone 6/7/8 nằm ngang) ⇒ trần card = 100vh - 108 = 267px, mà phần cố định của\n màn KHÁCH = banner 106 + padding thân 32 + thanh ghim 92 + chân 38 = 268 ⇒ thân = 0px và cả\n thanh ghim lẫn chân panel bị cắt. Chính thanh ghim đẩy ngưỡng vỡ từ ~284px lên ~375px.\n Với block này: vh 375 ⇒ thân còn ~86px và cuộn được bình thường. */\n @media (max-height: 560px) {\n .cnv-panel-banner { min-height: 96px; margin-bottom: -38px; padding: 14px 16px 16px; }\n .cnv-panel-banner--sub { padding-left: 44px; }\n .cnv-panel-banner__title { font-size: 20px; }\n .cnv-panel-body { padding: 12px; gap: 8px; }\n .cnv-panel-joinbar { padding: 8px 12px; }\n .cnv-panel-cta__btn { height: 34px; margin-bottom: 6px; }\n .cnv-panel-footer { padding: 6px 12px; }\n }\n .cnv-panel-icon { display: inline-flex; flex-shrink: 0; }\n .cnv-panel-icon--chevron { transition: transform .15s; }\n .cnv-panel-cta__signin:hover .cnv-panel-icon--chevron { transform: translateX(2px); }\n .cnv-panel-section__title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; opacity: .68; }\n .cnv-panel-section__points { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 6px; }\n .cnv-panel-section__desc { font-size: 12.5px; line-height: 1.5; opacity: .72; margin-bottom: 4px; }\n .cnv-panel-section__row {\n font-size: 12.5px; display: flex; align-items: center; gap: 10px;\n padding: 10px 0; cursor: pointer;\n }\n /* flex:1 đẩy chevron về sát mép phải (thay cho justify-content:space-between hồi dòng chưa có\n icon dẫn đầu); min-width:0 để nhãn dài tự co lại thay vì đội chevron ra ngoài card. */\n .cnv-panel-section__row-label { flex: 1; min-width: 0; }\n .cnv-panel-section__row:hover .cnv-panel-icon--chevron { transform: translateX(2px); }\n .cnv-panel-badge {\n display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase;\n letter-spacing: .03em; padding: 3px 8px; border-radius: 999px;\n }\n /* ── Hạng thành viên (VIP) ──────────────────────────────────────────────── */\n .cnv-panel-tier__current { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }\n .cnv-panel-tier__current-name { font-size: 19px; font-weight: 800; line-height: 1.2; }\n /* Huy hiệu là chấm màu khi shop không tải icon lên; kích thước cố định để hàng nào cũng thẳng cột. */\n .cnv-panel-tier__badge {\n flex: 0 0 auto; width: 18px; height: 18px; border-radius: 999px; overflow: hidden;\n display: inline-flex; align-items: center; justify-content: center;\n }\n .cnv-panel-tier__badge-img { width: 100%; height: 100%; object-fit: cover; display: block; }\n .cnv-panel-tier__progress { margin-bottom: 8px; }\n /* Nền thanh làm nhạt bằng MÀU CÓ ALPHA đặt inline theo theme, KHÔNG dùng opacity: opacity áp lên cả\n element nên nó kéo mờ luôn lớp fill bên trong (fill còn 14% đậm → thanh đọc ra ngược chiều). */\n .cnv-panel-tier__bar { height: 6px; border-radius: 999px; overflow: hidden; }\n .cnv-panel-tier__fill { height: 100%; border-radius: 999px; transition: width .35s ease; }\n .cnv-panel-tier__hint { font-size: 12px; line-height: 1.5; opacity: .72; }\n /* KHÔNG có trần/cuộn riêng: panel cuộn bằng MỘT thanh duy nhất ở .cnv-panel-card, chân panel ghim\n sticky ở đáy — đúng cách smile.io bày. Hộp cuộn lồng trong từng card tạo 2 tầng cuộn: khách cuộn\n tới giữa card là bị "kẹt" trong hộp con, và nội dung dài vẫn không đọc hết được. */\n .cnv-panel-tier__list { }\n .cnv-panel-tier__row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 7px 0; }\n .cnv-panel-tier__row--current { font-weight: 800; }\n /* Tên hạng do merchant tự đặt và loyalty KHÔNG giới hạn độ dài (chỉ bắt khác rỗng + không trùng),\n nên phải kẹp 1 dòng: tên 200 ký tự mà để tự xuống dòng là đẩy ngưỡng ra khỏi hàng. */\n .cnv-panel-tier__name {\n flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n }\n .cnv-panel-tier__threshold { flex: 0 0 auto; font-size: 11.5px; opacity: .66; font-variant-numeric: tabular-nums; }\n .cnv-panel-tier__benefits { margin: 0 0 6px 26px; padding: 0 0 0 14px; font-size: 12px; line-height: 1.55; opacity: .72; }\n .cnv-panel-tier__more { font-size: 11.5px; padding: 5px 0 5px 26px; opacity: .58; }\n .cnv-panel-zalo {\n display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;\n text-align: center;\n /* Khoá chiều cao theo khung phase \'loading\'/\'qr\' (cao nhất: khối QR 180 + viền 20 + hint 2 dòng\n + timer + nút Huỷ + padding card) để panel KHÔNG co/giãn đột ngột khi chuyển sang\n success/error. Trước đây đo runtime bằng scrollHeight ngay sau khi append card — ép browser\n flush style+layout đồng bộ ngay trong click handler; con số này suy được từ chính các hằng số\n ở trên nên không cần đo. */\n min-height: 346px;\n }\n .cnv-panel-vstack { display: flex; flex-direction: column; align-items: center; gap: 8px; }\n .cnv-panel-zalo__qr { position: relative; padding: 10px; border-radius: 12px; }\n .cnv-panel-zalo__qr--white { background: #fff; }\n .cnv-panel-zalo__qr svg { display: block; }\n .cnv-panel-zalo__corner { position: absolute; width: 16px; height: 16px; border: 3px solid; border-radius: 5px 0 0 0; }\n .cnv-panel-zalo__corner.tl { top: -3px; left: -3px; border-right: none; border-bottom: none; }\n .cnv-panel-zalo__corner.br { bottom: -3px; right: -3px; border-left: none; border-top: none; border-radius: 0 0 5px 0; }\n .cnv-panel-zalo__title { font-size: 14px; font-weight: 800; }\n .cnv-panel-zalo__status { font-size: 12.5px; font-weight: 500; line-height: 1.45; max-width: 250px; }\n .cnv-panel-zalo__timer {\n font-size: 11.5px; font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums;\n display: inline-flex; align-items: center; gap: 5px;\n }\n /* Không cuộn riêng — xem ghi chú ở .cnv-panel-tier__list. */\n .cnv-panel-reward__list { }\n .cnv-panel-reward { padding: 10px 0; display: flex; gap: 10px; align-items: flex-start; }\n .cnv-panel-reward__main { min-width: 0; flex: 1; }\n .cnv-panel-reward__thumb {\n width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover;\n background: rgba(127, 127, 127, .12);\n }\n /* Tên dài (ưu đãi hay có tên rất dài) kẹp 2 dòng rồi "…" — không để 1 ưu đãi chiếm 3-4 dòng đẩy\n các ưu đãi khác ra khỏi khung. min-width:0 ở __main là điều kiện để ellipsis hoạt động\n trong flex. */\n .cnv-panel-reward__title {\n font-size: 13px; font-weight: 700; line-height: 1.4;\n display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;\n }\n .cnv-panel-reward__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }\n .cnv-panel-reward__value {\n font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px;\n white-space: nowrap;\n }\n .cnv-panel-reward__uses {\n font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px;\n background: rgba(127, 127, 127, .14); white-space: nowrap;\n }\n .cnv-panel-reward__code {\n font-size: 13px; font-weight: 800; letter-spacing: .06em; margin-top: 6px;\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all;\n }\n .cnv-panel-reward__meta { font-size: 11.5px; opacity: .7; margin-top: 4px; line-height: 1.45; }\n .cnv-panel-reward__more { width: 100%; margin-top: 10px; }\n /* ── Block nội dung merchant tự soạn (Cách kiếm thêm điểm / Cách đổi điểm) ──\n Không cuộn riêng — xem ghi chú ở .cnv-panel-tier__list. */\n .cnv-panel-block__list { }\n .cnv-panel-block { padding: 11px 0; display: flex; gap: 10px; align-items: flex-start; }\n /* Chip lệch xuống 1px cho khớp đường chân chữ của dòng tiêu đề bên cạnh. */\n .cnv-panel-block .cnv-panel-chip { margin-top: 1px; }\n .cnv-panel-block__main { min-width: 0; flex: 1; }\n .cnv-panel-block__title { font-size: 13px; font-weight: 700; line-height: 1.4; }\n .cnv-panel-block__desc { font-size: 12px; line-height: 1.5; opacity: .72; margin-top: 3px; white-space: pre-line; }\n .cnv-panel-zalo__btn {\n height: 36px; padding: 0 16px; border: 1px solid rgba(127, 127, 127, .3); border-radius: 10px;\n background: transparent; color: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;\n transition: filter .15s;\n }\n .cnv-panel-zalo__btn:hover:not(:disabled) { filter: brightness(1.1); }\n .cnv-panel-zalo__btn:disabled { opacity: .5; cursor: default; }\n .cnv-panel-zalo__overlay {\n position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;\n padding: 16px;\n }\n .cnv-panel-zalo__overlay-bubble {\n display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;\n padding: 0 8px; max-width: 100%; animation: cnv-panel-bubble-in .2s ease;\n }\n .cnv-panel-bubble-icon {\n width: 40px; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center;\n }\n .cnv-panel-zalo__skeleton {\n border-radius: 6px; background: rgba(127, 127, 127, .15);\n background-image: linear-gradient(\n 90deg, rgba(127, 127, 127, .15) 25%, rgba(127, 127, 127, .32) 37%, rgba(127, 127, 127, .15) 63%\n );\n background-size: 400% 100%; animation: cnv-panel-shimmer 1.4s ease infinite;\n }\n @keyframes cnv-panel-shimmer {\n 0% { background-position: 100% 50%; }\n 100% { background-position: 0% 50%; }\n }\n @media (prefers-reduced-motion: reduce) { .cnv-panel-zalo__skeleton { animation: none; } }\n');c=i.hostEl;const g=i.shadow;c.style.setProperty("display","none");const m=null!==(t=(null==n?void 0:n.useCustomZIndex)?B(n.zIndex):null)&&void 0!==t?t:$,b=null!==(e=B(m+600))&&void 0!==e?e:$;l=document.createElement("div"),l.className="cnv-panel-card",l.style.zIndex=String(b),l.addEventListener("animationend",n=>{"cnv-panel-out"===n.animationName&&Pt()}),l.style.borderRadius=Rn(null===(o=r.shapes)||void 0===o?void 0:o.container);const y=document.createElement("button");y.type="button",y.className="cnv-panel-close",y.setAttribute("aria-label","Đóng"),y.textContent="×",y.addEventListener("click",It),f=document.createElement("button"),f.type="button",f.className="cnv-panel-back",f.setAttribute("aria-label","Quay lại"),f.appendChild(Yn('<path d="M15 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>',15)),f.addEventListener("click",en(kt));const w=document.createElement("div");p=w,w.className="cnv-panel-banner",a=document.createElement("img"),a.className="cnv-panel-banner__img",a.alt="",u=document.createElement("img"),u.className="cnv-panel-banner__brandicon",u.alt="";const x=document.createElement("div");x.className="cnv-panel-banner__brandchip",x.appendChild(u),s=document.createElement("div"),s.className="cnv-panel-banner__caption",d=document.createElement("div"),d.className="cnv-panel-banner__title",w.append(a,x,s,d),h=document.createElement("div"),h.className="cnv-panel-body",l.append(y,f,w,h),v=Nt(),v&&l.appendChild(v),g.appendChild(l),G(c)}function Nt(){if(r.hideBranding)return null;const n="DARK"===r.theme,t=document.createElement("div");t.className="cnv-panel-footer",t.style.backgroundColor=n?"#181C32":"#FFFFFF",t.style.borderTop=n?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2",t.style.color=n?"rgba(255,255,255,.62)":"rgba(24,28,50,.58)",t.appendChild(document.createTextNode("Cung cấp bởi "));const e=document.createElement("span");return e.className="cnv-panel-footer__brand",e.textContent="CNV Loyalty",t.appendChild(e),t}function Ft(n){if(!l)return;const{side:t,sideSpacingPx:e,bottomSpacingPx:o}=K(n,R());l.style.left="left"===t?e+"px":"auto",l.style.right="right"===t?e+"px":"auto";const r=o+48+24;l.style.bottom=r+"px",l.style.maxHeight=`calc(100vh - ${r+16}px)`,l.style.transformOrigin="left"===t?"left bottom":"right bottom"}function It(){c&&m&&(m=!1,jt(),x=!1,_=!1,C=null,document.removeEventListener("keydown",Q),Dt("cnv:panel:closed"),l&&!e(()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,!1)?(l.classList.add(In),J=setTimeout(Pt,320)):Pt())}function Pt(){null!==J&&(clearTimeout(J),J=null),null==l||l.classList.remove(In),null==c||c.style.setProperty("display","none")}function $t(){null!==J&&(clearTimeout(J),J=null),null==l||l.classList.remove(In)}function Dt(n){t(()=>window.dispatchEvent(new CustomEvent(n)))}const Ht=e=>{t(()=>{var t;const o=e.detail;var r;m?It():(Ot(r=null!==(t=null==o?void 0:o.config)&&void 0!==t?t:null),c&&($t(),Ft(r),c.style.setProperty("display","block"),m=!0,gt(),un(),!sn()||N||F||(F=!0,n.fetchPanelTiers().then(n=>{F=!1,n&&n.tiers.length&&(N=n,m&>())}).catch(()=>{F=!1})),document.addEventListener("keydown",Q),Dt("cnv:panel:opened")))})},Rt=n=>{t(()=>{const t=n.detail;b=(null==t?void 0:t.isMember)?{isMember:!0,points:t.points,rewardsAvailableCount:t.rewardsAvailableCount}:{isMember:!1},b.isMember||mt(),m&>(),m&&un()})};function Lt(){const t=$n(n.projectId);t&&(Date.now()>t.exp?Hn(n.projectId):(b={isMember:!0},gt(),n.restorePanelSession(t.token).then(e=>{e?(b={isMember:!0},Dn(n.projectId,Object.assign(Object.assign({},t),{fullName:e.fullName,level:e.level,xp:e.xp}))):(Hn(n.projectId),b={isMember:!1},mt()),gt()}).catch(()=>{})))}return window.addEventListener(Nn,Ht),window.addEventListener(Fn,Rt),Lt(),()=>{jt(),t(()=>{window.removeEventListener(Nn,Ht),window.removeEventListener(Fn,Rt),document.removeEventListener("keydown",Q),$t(),null==c||c.remove()})}}catch(Et){return()=>{}}}const pt={path:"/config",timeoutMs:4e3,ttlMs:3e5};function ft(n,t){var e,o;const r=null!=t?t:Object.assign({enabled:!0},pt);return void 0===n?Object.assign({},r):!0===n?Object.assign(Object.assign({},r),{enabled:!0}):!1===n?Object.assign(Object.assign({},r),{enabled:!1}):{enabled:null===(e=n.enabled)||void 0===e||e,path:null!==(o=n.path)&&void 0!==o?o:r.path,timeoutMs:"number"==typeof n.timeoutMs?n.timeoutMs:r.timeoutMs,ttlMs:"number"==typeof n.ttlMs?n.ttlMs:r.ttlMs}}function vt(n){return"_cnv_cfg_"+n}function gt(n){const t=mn(vt(n));if(!t)return null;try{const n=JSON.parse(t);return n&&"object"==typeof n&&n.envelope?n:null}catch(n){return null}}function mt(n,t,e){try{const o={etag:t,envelope:e,fetchedAt:Date.now()};bn(vt(n),JSON.stringify(o))}catch(n){}}function bt(n){const t=gt(n);return!t||!1!==(null===(o=null==(e=t.envelope)?void 0:e.zaloQrLogin)||void 0===o?void 0:o.enabled);var e,o}const yt=["gclid","fbclid","ttclid","msclkid","dclid"],wt=[["utm_source","source"],["utm_medium","medium"],["utm_campaign","name"],["utm_term","term"],["utm_content","content"],["utm_id","id"]];function xt(){const n=e(()=>window.location.href,"");let t="",o="",r="";if(n)try{const e=new URL(n);t=e.pathname,o=e.search,r=e.hash}catch(n){}return{url:n,path:t,search:o,hash:r,title:e(()=>document.title,""),referrer:e(()=>document.referrer,"")}}function _t(n){var t,e;let o="@cnv-vn/track",r="0.0.0-dev";try{o="@cnv-vn/track"}catch(n){}try{r="0.3.0-beta.1"}catch(n){}return{name:null!==(t=null==n?void 0:n.name)&&void 0!==t?t:o,version:null!==(e=null==n?void 0:n.version)&&void 0!==e?e:r}}const kt="0123456789abcdef";function Mt(n){return kt[n>>>4&15]+kt[15&n]}function At(){if("undefined"!=typeof crypto){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();if("function"==typeof crypto.getRandomValues){const n=new Uint8Array(16);return crypto.getRandomValues(n),n[6]=15&n[6]|64,n[8]=63&n[8]|128,Mt(n[0])+Mt(n[1])+Mt(n[2])+Mt(n[3])+"-"+Mt(n[4])+Mt(n[5])+"-"+Mt(n[6])+Mt(n[7])+"-"+Mt(n[8])+Mt(n[9])+"-"+Mt(n[10])+Mt(n[11])+Mt(n[12])+Mt(n[13])+Mt(n[14])+Mt(n[15])}}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const t=16*Math.random()|0;return("x"===n?t:3&t|8).toString(16)})}const Ct=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function jt(n){return"string"==typeof n&&Ct.test(n)}const zt="_cnv_cid";function St(n={}){const t=fn(zt),e=mn(zt);let o=null;return jt(t)?o=t:jt(e)&&(o=e),o||(o=At()),Tt(o,n),o}function Tt(n,t={}){var e;vn(zt,n,{domain:t.cookieDomain,maxAgeDays:null!==(e=t.cookieMaxAgeDays)&&void 0!==e?e:730,sameSite:"Lax"}),bn(zt,n)}const Ot="1.0";function Nt(){return(new Date).toISOString()}function Ft(n,t){var e;const o=null!==(e=t.timestamp)&&void 0!==e?e:Nt(),r=Object.assign(Object.assign({},t.context),{projectId:t.projectId,schemaVersion:Ot}),i={type:n,messageId:At(),anonymousId:t.anonymousId,timestamp:o,originalTimestamp:o,context:r};return t.userId&&(i.userId=t.userId),t.sessionId&&(i.sessionId=t.sessionId),t.integrations&&(i.integrations=t.integrations),i}const It="_cnv_sid";function Pt(n){if(!n)return null;const t=n.lastIndexOf(".");if(t<0)return null;const e=n.slice(0,t),o=Number(n.slice(t+1));return!jt(e)||!Number.isFinite(o)||o<=0?null:{id:e,lastActivity:o}}function $t(n={}){const t=Date.now(),e=(n=>{var t;return 6e4*(null!==(t=n.timeoutMinutes)&&void 0!==t?t:30)})(n),o=Pt(fn(It)),r=Pt((n=>{if(!wn())return null;try{return sessionStorage.getItem(n)}catch(n){return null}})(It));let i=null;for(const n of[o,r])n&&(t-n.lastActivity>e||(!i||n.lastActivity>i.lastActivity)&&(i=n));const c=i?{id:i.id,lastActivity:t}:{id:At(),lastActivity:t};return Dt(c,n),c.id}function Dt(n,t={}){var e;const o=(n=>`${n.id}.${n.lastActivity}`)(n),r=null!==(e=t.timeoutMinutes)&&void 0!==e?e:30;vn(It,o,{domain:t.cookieDomain,maxAgeDays:r/1440,sameSite:"Lax"}),((n,t)=>{if(!wn())return!1;try{return sessionStorage.setItem(n,t),!0}catch(n){return!1}})(It,o)}class Ht{constructor(n){var t,e;Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"flushing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"onlineHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.storageKey=null!==(t=n.storageKey)&&void 0!==t?t:"_cnv_rq",this.maxMessages=null!==(e=n.maxMessages)&&void 0!==e?e:100,this.installOnlineListener()}stash(n){if(n&&0!==n.length)try{const t=this.read();for(t.push(n);t.length>1&&Rt(t)>this.maxMessages;)t.shift();this.write(t),this.config.debug&&console.log("[cnv-track] retry queued",n.length,"buffered",Rt(t))}catch(n){}}flush(){if(this.flushing||"undefined"!=typeof navigator&&!1===navigator.onLine)return Promise.resolve();const n=this.read();if(0===n.length)return Promise.resolve();this.flushing=!0,this.write([]);const t=()=>{this.flushing=!1};return n.reduce((n,t)=>n.then(()=>this.config.resend(t)),Promise.resolve()).then(t,t)}size(){return Rt(this.read())}clear(){try{yn(this.storageKey)}catch(n){}}destroy(){if(this.onlineHandler){try{window.removeEventListener("online",this.onlineHandler)}catch(n){}this.onlineHandler=null}}installOnlineListener(){if("undefined"==typeof window)return;const n=()=>{this.flush()};try{window.addEventListener("online",n),this.onlineHandler=n}catch(n){}}read(){const n=mn(this.storageKey);if(!n)return[];try{const t=JSON.parse(n);return Array.isArray(t)?t.filter(n=>Array.isArray(n)&&n.length>0):[]}catch(n){return[]}}write(n){0!==n.length?bn(this.storageKey,JSON.stringify(n)):yn(this.storageKey)}}function Rt(n){let t=0;for(const e of n)t+=e.length;return t}class Lt{constructor(n){Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"buffer",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"destroyed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"retryQueue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.retryQueue=new Ht({debug:n.debug,resend:n=>this.send(n)}),this.installPageLifecycleHandlers(),this.retryQueue.flush()}setConfig(n){this.config=Object.assign(Object.assign({},this.config),n)}enqueue(n){this.destroyed||(this.buffer.push(n),this.buffer.length>=this.config.flushAt?this.flush():this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.flush()},this.config.flushInterval)))}flush(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),0===this.buffer.length)return Promise.resolve();const n=this.buffer;return this.buffer=[],this.send(n)}bufferedCount(){return this.buffer.length}destroy(){this.destroyed||(this.destroyed=!0,this.timer&&(clearTimeout(this.timer),this.timer=null),this.uninstallPageLifecycleHandlers(),this.retryQueue.destroy())}send(n){try{return this.config.useBatch?this.sendBatch(n):Promise.all(n.map(n=>this.sendSingle(n))).then(()=>{})}catch(n){return this.config.debug&&console.warn("[cnv-track] send failed synchronously; dropped batch",n),Promise.resolve()}}sendBatch(n){var t;const e=Nt(),o={batch:n.map(n=>Et(n,e)),context:Object.assign(Object.assign({},null!==(t=this.config.batchContext)&&void 0!==t?t:{}),{projectId:this.config.projectId,sentAt:e}),sentAt:e};return this.post(this.batchUrl(),o,n)}sendSingle(n){const t=Et(n,Nt());return this.post(this.singleUrl(n.type),t,[n])}batchUrl(){return this.config.endpoint+this.config.batchPath+"?projectId="+encodeURIComponent(this.config.projectId)}singleUrl(n){const t=this.config.singlePath.replace("{type}",n);return this.config.endpoint+t+"?projectId="+encodeURIComponent(this.config.projectId)}post(n,t,e){const o=JSON.stringify(t),r=((n,t)=>{try{return new Blob([n],{type:t})}catch(n){return null}})(o,this.config.contentType),i=r?r.size:(n=>{try{return new Blob([n]).size}catch(t){return n.length}})(o),c=i>65536?null:e;return c&&"undefined"!=typeof navigator&&!1===navigator.onLine?(this.retryQueue.stash(c),this.config.debug&&console.log("[cnv-track] offline; queued for retry",n),Promise.resolve()):r&&this.sendViaBeacon(n,r)?(this.config.debug&&console.log("[cnv-track] beacon",n),Promise.resolve()):this.sendViaFetch(n,o,c)}sendViaBeacon(n,t){if("undefined"==typeof navigator||"function"!=typeof navigator.sendBeacon)return!1;if(t.size>65536)return!1;try{return navigator.sendBeacon(n,t)}catch(n){return!1}}sendViaFetch(n,t,e){return"function"!=typeof fetch?(this.config.debug&&console.warn("[cnv-track] no transport available; queued for retry"),e&&this.retryQueue.stash(e),Promise.resolve()):fetch(n,{method:"POST",headers:{"Content-Type":this.config.contentType},body:t,keepalive:!0,credentials:"omit",mode:"cors"}).then(t=>{this.config.debug&&console.log("[cnv-track] fetch flushed",n,t.status)}).catch(t=>{this.config.debug&&console.warn("[cnv-track] flush failed; queued for retry",n,t),e&&this.retryQueue.stash(e)})}installPageLifecycleHandlers(){if("undefined"==typeof window||"undefined"==typeof document)return;const n=()=>{this.flush()},t=()=>{"hidden"===document.visibilityState&&this.flush()};try{window.addEventListener("pagehide",n),document.addEventListener("visibilitychange",t),this.handlers={pagehide:n,visibility:t}}catch(n){}}uninstallPageLifecycleHandlers(){if(this.handlers){try{window.removeEventListener("pagehide",this.handlers.pagehide),document.removeEventListener("visibilitychange",this.handlers.visibility)}catch(n){}this.handlers=null}}}function Et(n,t){return Object.assign(Object.assign({},n),{sentAt:t})}const Bt="_cnv_uid",Ut="_cnv_traits";function Vt(){return fn(Bt)||mn(Bt)}const Kt={endpoint:"https://tracking.cnvcdp.com/js/v1",batchPath:"/batch",singlePath:"/{type}",useBatch:!0,contentType:"text/plain",debug:!1,allowAdTracking:!0,cookieMaxAgeDays:730,sessionTimeoutMinutes:30,flushAt:20,flushInterval:5e3,autoPageview:!0,autotrack:!1,integrations:{},remoteConfig:ft(void 0)},qt={analytics:!0,marketing:!0};function Gt(n,t){if(!Array.isArray(t)||0===t.length)return;const e=t;try{switch(e[0]){case"init":n.init(e[1],e[2]);break;case"pageview":n.pageview(e[1],e[2]);break;case"page":n.page(e[1],e[2]);break;case"screen":n.screen(e[1],e[2]);break;case"track":n.track(e[1],e[2]);break;case"identify":n.identify(e[1],e[2]);break;case"alias":n.alias(e[1],e[2]);break;case"group":n.group(e[1],e[2]);break;case"reset":n.reset();break;case"flush":n.flush();break;case"consent":n.consent(e[1]);break;case"set":n.set(e[1])}}catch(n){}}const Zt="0.3.0-beta.1",Yt="@cnv-vn/track",Jt=function(){let n=null,a=Object.assign({},Kt),u=Object.assign({},qt),s=null,d=!1,h=null;function p(n,t){let e=null,r=null;return{apply(i,c){e&&null!==c&&c===r||(e=o(e),r=c,i&&(e=n(t(),i)))},dispose(){e=o(e),r=null}}}let f=null;const v=()=>f,g=p(k,v),m=p(Q,v),b=p(ht,v);function y(n){const t=Object.assign({},a);return n?(void 0!==n.endpoint&&(t.endpoint=(e=n.endpoint).endsWith("/")?e.slice(0,-1):e),void 0!==n.batchPath&&(t.batchPath=n.batchPath),void 0!==n.singlePath&&(t.singlePath=n.singlePath),void 0!==n.useBatch&&(t.useBatch=n.useBatch),void 0!==n.contentType&&(t.contentType=n.contentType),void 0!==n.debug&&(t.debug=n.debug),void 0!==n.allowAdTracking&&(t.allowAdTracking=n.allowAdTracking),void 0!==n.cookieDomain&&(t.cookieDomain=n.cookieDomain),void 0!==n.cookieMaxAgeDays&&(t.cookieMaxAgeDays=n.cookieMaxAgeDays),void 0!==n.sessionTimeoutMinutes&&(t.sessionTimeoutMinutes=n.sessionTimeoutMinutes),void 0!==n.flushAt&&(t.flushAt=n.flushAt),void 0!==n.flushInterval&&(t.flushInterval=n.flushInterval),void 0!==n.autoPageview&&(t.autoPageview=n.autoPageview),void 0!==n.autotrack&&(t.autotrack=n.autotrack),void 0!==n.integrations&&(t.integrations=n.integrations),void 0!==n.remoteConfig&&(t.remoteConfig=ft(n.remoteConfig,a.remoteConfig)),t):t;var e}function w(){return s||(s=new Lt({endpoint:a.endpoint,batchPath:a.batchPath,singlePath:a.singlePath,useBatch:a.useBatch,contentType:a.contentType,flushAt:a.flushAt,flushInterval:a.flushInterval,projectId:null!=n?n:"",debug:a.debug}),s)}function x(){var t;if(!n)return null;const o=((n={})=>{var t;const o={page:xt(),screen:{width:e(()=>window.screen.width,0),height:e(()=>window.screen.height,0),density:e(()=>window.devicePixelRatio||1,1)},locale:e(()=>navigator.language||"",""),timezone:e(()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"",""),userAgent:e(()=>navigator.userAgent||"",""),library:_t(n.library)},r=((n,t=!0)=>{const o=e(()=>window.location.search,"");if(!o)return;let r;try{r=new URLSearchParams(o)}catch(n){return}const i={};let c=!1;for(const[n,t]of wt){const e=r.get(n);e&&e.length>0&&(i[t]=e,c=!0)}if(t){const n={};for(const t of yt){const e=r.get(t);e&&e.length>0&&(n[t]=e)}Object.keys(n).length>0&&(i.clickIds=n,c=!0)}return c?i:void 0})(0,null===(t=n.allowAdTracking)||void 0===t||t);return r&&(o.campaign=r),o})({allowAdTracking:a.allowAdTracking});return u.analytics&&u.marketing||(o.consent=Object.assign({},u)),{anonymousId:St({cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays}),sessionId:$t({cookieDomain:a.cookieDomain,timeoutMinutes:a.sessionTimeoutMinutes}),userId:null!==(t=Vt())&&void 0!==t?t:void 0,context:o,projectId:n,integrations:Object.keys(a.integrations).length>0?a.integrations:void 0}}function _(n){a.debug&&console.warn(`[cnv-track] ${n}() called before init()`)}function M(n,t){try{const e=x();if(!e)return _("pageview");const o=((n,t,e)=>{const o=Ft("page",e);return n&&(o.name=n),o.properties=null!=t?t:{},o})(n,((n,t)=>{const e={};return n&&(n.url&&(e.url=n.url),n.path&&(e.path=n.path),n.title&&(e.title=n.title),n.referrer&&(e.referrer=n.referrer),n.search&&(e.search=n.search)),Object.assign(Object.assign({},e),null!=t?t:{})})(e.context.page,t),e);w().enqueue(o)}catch(n){}}function A(n,t){M(n,t)}function C(n,t){try{if("string"!=typeof n||0===n.length)return;const e=x();if(!e)return _("track");const o=((n,t,e)=>{const o=Ft("track",e);return o.event=n,o.properties=null!=t?t:{},o})(n,t,e);w().enqueue(o)}catch(n){}}function j(n,t){try{if("string"!=typeof n||0===n.length)return;((n,t,e={})=>{var o,r;if(n&&(vn(Bt,n,{domain:e.cookieDomain,maxAgeDays:null!==(o=e.cookieMaxAgeDays)&&void 0!==o?o:730,sameSite:"Lax"}),bn(Bt,n),null!=t)){const n=null!==(r=(()=>{const n=mn(Ut);if(!n)return null;try{const t=JSON.parse(n);return t&&"object"==typeof t&&!Array.isArray(t)?t:null}catch(n){return null}})())&&void 0!==r?r:{},e=Object.assign(Object.assign({},n),t);try{bn(Ut,JSON.stringify(e))}catch(n){}}})(n,t,{cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays});const e=x();if(!e)return _("identify");const o=((n,t,e)=>{var o;const r=Ft("identify",e);return n&&(r.userId=n),r.traits=null!==(o=t)&&void 0!==o?o:{},r})(n,t,e);w().enqueue(o)}catch(n){}}function z(n,t){}return{get initialized(){return d},get projectId(){return n},get endpoint(){return a.endpoint},isZaloQrLoginEnabled:()=>!!n&&bt(n),get consentGranted(){return u.analytics&&u.marketing},init(e,p){var v,x;try{if(!e||"string"!=typeof e)return;a=y(p),(null==p?void 0:p.consent)&&(u=Object.assign(Object.assign({},u),p.consent)),n=e,s&&s.destroy(),s=null,w(),d=!0,St({cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays}),$t({cookieDomain:a.cookieDomain,timeoutMinutes:a.sessionTimeoutMinutes}),a.autoPageview&&M(),h=o(h);const _={page(n,t){return A(n,t)},track(n,t){return C(n,t)},loginWithZalo(t){return On({projectId:n,endpoint:a.endpoint,zaloQrLoginEnabled:!!n&&bt(n),consentGranted:u.analytics&&u.marketing,identify:j,alias:z,getUserId:Vt},t)},projectId:n,restorePanelSession(t){return n?function(n,t,e){return xn(this,void 0,void 0,function*(){const o="undefined"!=typeof AbortController?new AbortController:null,r=o?setTimeout(()=>o.abort(),8e3):null;try{const r=yield fetch(An(n,"/panel/session",t),{method:"GET",credentials:"omit",mode:"cors",headers:{Authorization:`Bearer ${e}`},signal:o?o.signal:void 0});if(!r.ok)return null;const i=yield r.json();return i&&"number"==typeof i.contactId?{contactId:i.contactId,fullName:"string"==typeof i.fullName?i.fullName:void 0,level:"string"==typeof i.level?i.level:void 0,xp:"number"==typeof i.xp?i.xp:void 0}:null}catch(n){return null}finally{r&&clearTimeout(r)}})}(a.endpoint,n,t):Promise.resolve(null)},fetchRewardsSummary(t,e){return n?function(n,t,e){return xn(this,arguments,void 0,function*(n,t,e,o=1){const r="undefined"!=typeof AbortController?new AbortController:null,i=r?setTimeout(()=>r.abort(),_n):null;try{const i=An(n,"/panel/rewards-summary",t),c=o>1?`${i}${i.includes("?")?"&":"?"}page=${o}`:i,l=yield fetch(c,{method:"GET",credentials:"omit",mode:"cors",headers:{Authorization:`Bearer ${e}`},signal:r?r.signal:void 0});return l.ok?(n=>{if(!n||"object"!=typeof n)return null;const t=n,e=Array.isArray(t.rewards)?t.rewards.filter(n=>!!n&&"object"==typeof n).map(Tn):[];return{points:"number"==typeof t.points&&Number.isFinite(t.points)?t.points:void 0,rewardsAvailableCount:"number"==typeof t.rewardsAvailableCount&&Number.isFinite(t.rewardsAvailableCount)?t.rewardsAvailableCount:void 0,rewards:e,tier:t.tier&&"object"==typeof t.tier?Sn(t.tier):void 0}})(yield l.json()):null}catch(n){return null}finally{i&&clearTimeout(i)}})}(a.endpoint,n,t,e):Promise.resolve(null)},fetchPanelTiers(){return n?function(n,t){return xn(this,void 0,void 0,function*(){const e="undefined"!=typeof AbortController?new AbortController:null,o=e?setTimeout(()=>e.abort(),_n):null;try{const o=yield fetch(An(n,"/panel/tiers",t),{method:"GET",credentials:"omit",mode:"cors",signal:e?e.signal:void 0});return o.ok?(n=>{if(!n||"object"!=typeof n)return null;const t=n,e=Array.isArray(t.tiers)?t.tiers.filter(n=>!!n&&"object"==typeof n).map(zn):[];return{applyFor:"SPENDING"===t.applyFor||"POINTS"===t.applyFor?t.applyFor:void 0,thresholdKind:"RELATIVE"===t.thresholdKind||"ABSOLUTE"===t.thresholdKind?t.thresholdKind:void 0,totalTiers:jn(t.totalTiers),tiers:e}})(yield o.json()):null}catch(n){return null}finally{o&&clearTimeout(o)}})}(a.endpoint,n):Promise.resolve(null)},fetchPointHistory(t,e){return n?function(n,t,e){return xn(this,arguments,void 0,function*(n,t,e,o=1){const r="undefined"!=typeof AbortController?new AbortController:null,i=r?setTimeout(()=>r.abort(),_n):null;try{const i=An(n,"/panel/point-history",t),c=o>1?`${i}${i.includes("?")?"&":"?"}page=${o}`:i,l=yield fetch(c,{method:"GET",credentials:"omit",mode:"cors",headers:{Authorization:`Bearer ${e}`},signal:r?r.signal:void 0});return l.ok?(n=>{if(!n||"object"!=typeof n)return null;const t=n,e=Array.isArray(t.items)?t.items.filter(n=>!!n&&"object"==typeof n).map(Cn):[];return{totalCount:"number"==typeof t.totalCount&&Number.isFinite(t.totalCount)?t.totalCount:void 0,items:e}})(yield l.json()):null}catch(n){return null}finally{i&&clearTimeout(i)}})}(a.endpoint,n,t,e):Promise.resolve(null)}};if(f=_,a.autotrack){let n=a.autotrack;a.remoteConfig.enabled&&"object"==typeof n&&n.buttonTracking&&(n=Object.assign(Object.assign({},n),{buttonTracking:void 0})),h=function(n,e){const o=void 0===(a=e)||!1===a?Object.assign(Object.assign({},P),{searchParams:F}):!0===a?Object.assign(Object.assign({},I),{searchParams:F}):{spa:null===(u=a.spa)||void 0===u||u,outboundClicks:null===(s=a.outboundClicks)||void 0===s||s,scroll:null===(d=a.scroll)||void 0===d||d,downloads:null===(h=a.downloads)||void 0===h||h,siteSearch:null===(p=a.siteSearch)||void 0===p||p,downloadExtensions:a.downloadExtensions,searchParams:null!==(f=a.searchParams)&&void 0!==f?f:F,buttonTracking:a.buttonTracking};var a,u,s,d,h,p,f;o.outboundClicks=!1,o.downloads=!1,o.scroll=!1,o.siteSearch=!1;const v=[];let g=null;function m(e){if(o.siteSearch)try{const r=null!=e?e:(()=>{try{return"undefined"!=typeof location?location.href:""}catch(n){return""}})();if(r===g)return;g=r;const i=((n,t=F)=>{try{if(!n){if("undefined"==typeof location)return null;n=location.href}const e=n instanceof URL?n:new URL(n,(()=>{try{return"undefined"!=typeof location?location.href:"http://localhost/"}catch(n){return"http://localhost/"}})());if(!e.search)return null;for(const n of t){const t=e.searchParams.get(n);if(null===t)continue;const o=t.trim();if(0!==o.length)return{query:o,param:n}}return null}catch(n){return null}})(r,o.searchParams);i&&t(()=>n.track("Site Searched",{query:i.query,param:i.param}))}catch(n){}}if(o.outboundClicks||o.downloads){const e=(n=>{var t;if("undefined"==typeof document)return()=>{};const e=new Set((null!==(t=n.downloadExtensions)&&void 0!==t?t:r).map(n=>n.toLowerCase())),o=!!n.onOutbound,a=!!n.onDownload;if(!o&&!a)return()=>{};function u(t){var r,u;try{if(0!==t.button)return;if(t.defaultPrevented)return;const s=(n=>{const t="function"==typeof n.composedPath?n.composedPath():[];if(t.length>0)for(const n of t)if(i(n))return n;let e=n.target;for(;e;){if(i(e))return e;e=e.parentNode}return null})(t);if(!s)return;const d=s.getAttribute("href");if(!d)return;if(/^(javascript:|mailto:|tel:|sms:)/i.test(d))return;if(d.startsWith("#"))return;const h=(n=>{try{return new URL(n,location.href)}catch(n){return null}})(d);if(!h)return;let p=!1;if(a){const t=s.hasAttribute("download"),o=(n=>{const t=c(n),e=t.lastIndexOf(".");return e<=0||e===t.length-1?null:t.slice(e+1).toLowerCase()})(h.pathname);(t||o&&e.has(o))&&(p=!0,null===(r=n.onDownload)||void 0===r||r.call(n,{url:h.href,fileName:c(h.pathname),fileExtension:null!=o?o:"",text:l(s)}))}o&&!p&&h.host!==(()=>{try{return"undefined"!=typeof location?location.hostname:""}catch(n){return""}})()&&h.host&&(null===(u=n.onOutbound)||void 0===u||u.call(n,{url:h.href,host:h.host,text:l(s),target:s.target||"_self"}))}catch(n){}}try{document.addEventListener("click",u,!0)}catch(n){return()=>{}}return()=>{try{document.removeEventListener("click",u,!0)}catch(n){}}})({downloadExtensions:o.downloadExtensions,onOutbound:o.outboundClicks?e=>t(()=>n.track("Clicked",e)):void 0,onDownload:o.downloads?e=>t(()=>n.track("File Downloaded",e)):void 0});v.push(e)}o.buttonTracking&&o.buttonTracking.rules&&o.buttonTracking.rules.length>0&&v.push(k(n,o.buttonTracking));let b=null;if(o.scroll&&(b=(n=>{if("undefined"==typeof window||"undefined"==typeof document)return{destroy(){},reset(){}};let t=!1,e=null,o=!1;function r(){if(e=null,!o&&!t)try{const e=document.documentElement,o=document.body,r=Math.max(e?e.scrollHeight:0,o?o.scrollHeight:0),i=Math.max(e?e.clientHeight:0,window.innerHeight||0);if(r<=i)return t=!0,c(),void n(90);((window.scrollY||(e?e.scrollTop:0)||0)+i)/r>=.9&&(t=!0,c(),n(90))}catch(n){}}function i(){if(null===e)try{e=window.requestAnimationFrame(r)}catch(n){r()}}function c(){try{window.removeEventListener("scroll",i),null!==e&&window.cancelAnimationFrame(e),e=null}catch(n){}}try{window.addEventListener("scroll",i,{passive:!0})}catch(n){try{window.addEventListener("scroll",i)}catch(n){}}try{window.requestAnimationFrame(r)}catch(n){r()}return{destroy(){o=!0,c()},reset(){if(!o){t=!1;try{window.addEventListener("scroll",i,{passive:!0})}catch(n){try{window.addEventListener("scroll",i)}catch(n){}}try{window.requestAnimationFrame(r)}catch(n){r()}}}}})(e=>{t(()=>n.track("Scrolled",{percent:e}))}),v.push(()=>null==b?void 0:b.destroy())),o.spa){const e=[],o=O(o=>{const r=setTimeout(()=>{const o=e.indexOf(r);-1!==o&&e.splice(o,1),t(()=>n.page())},0);e.push(r),null==b||b.reset(),m(o)});v.push(()=>{for(let n=0;n<e.length;n++)clearTimeout(e[n]);e.length=0,o()})}return m(),()=>{for(;v.length>0;){const n=v.pop();try{null==n||n()}catch(n){}}g=null}}(_,n)}if(g.dispose(),m.dispose(),b.dispose(),a.remoteConfig.enabled&&n){const t=n=>{var t,e,o,r;g.apply((n=>{const t=null==n?void 0:n.buttonTracking;if(!t||!1===t.enabled)return null;const e=Array.isArray(t.rules)?t.rules:[];return 0===e.length?null:{rules:e,globalThrottle:t.globalThrottle}})(n),null),m.apply((n=>{var t;const e=null===(t=null==n?void 0:n.launcher)||void 0===t?void 0:t.config;return e?"NONE"===e.deviceVisibility?null:e:null})(n),null!==(e=null===(t=null==n?void 0:n.launcher)||void 0===t?void 0:t.version)&&void 0!==e?e:null),b.apply((n=>{var t;const e=null===(t=null==n?void 0:n.panel)||void 0===t?void 0:t.config;return null!=e?e:null})(n),null!==(r=null===(o=null==n?void 0:n.panel)||void 0===o?void 0:o.version)&&void 0!==r?r:null)};t(null!==(x=null===(v=gt(n))||void 0===v?void 0:v.envelope)&&void 0!==x?x:null),function(n){return xn(this,void 0,void 0,function*(){if(!n.projectId)return{status:"error"};const t=gt(n.projectId);if(t&&Date.now()-t.fetchedAt<n.ttlMs)return{status:"unchanged"};const e=yield function(n){return xn(this,void 0,void 0,function*(){var t;if("function"!=typeof fetch)return null;const e=n.endpoint+n.path+"?projectId="+encodeURIComponent(n.projectId),o="undefined"!=typeof AbortController?new AbortController:null,r=o?setTimeout(()=>o.abort(),n.timeoutMs):null;try{const r={};n.etag&&(r["If-None-Match"]=n.etag);const i=yield fetch(e,{method:"GET",headers:r,credentials:"omit",mode:"cors",cache:"no-store",signal:o?o.signal:void 0});if(304===i.status)return{envelope:null,etag:null!==(t=n.etag)&&void 0!==t?t:"",notModified:!0};if(!i.ok)return null;const c=i.headers&&"function"==typeof i.headers.get?i.headers.get("ETag"):null;return{envelope:yield i.json(),etag:null!=c?c:"",notModified:!1}}catch(n){return null}finally{r&&clearTimeout(r)}})}({endpoint:n.endpoint,path:n.path,projectId:n.projectId,timeoutMs:n.timeoutMs,etag:null==t?void 0:t.etag});return e?e.notModified?(t&&mt(n.projectId,t.etag,t.envelope),{status:"unchanged"}):e.envelope?(mt(n.projectId,e.etag,e.envelope),{status:"updated",envelope:e.envelope}):{status:"error"}:{status:"error"}})}({endpoint:a.endpoint,path:a.remoteConfig.path,projectId:n,timeoutMs:a.remoteConfig.timeoutMs,ttlMs:a.remoteConfig.ttlMs}).then(n=>{"updated"===n.status&&t(n.envelope)}).catch(()=>{})}}catch(n){}},pageview:M,page:A,screen(n,t){},track:C,identify:j,alias:z,group(n,t){},reset(){try{((n={})=>{((n,t={})=>{var e;if(!pn)return!1;try{let o=`${encodeURIComponent(n)}=`;return o+=`; path=${null!==(e=t.path)&&void 0!==e?e:"/"}`,t.domain&&(o+=`; domain=${t.domain}`),o+="; max-age=0",o+="; expires=Thu, 01 Jan 1970 00:00:00 GMT",document.cookie=o,null===fn(n)}catch(n){return!1}})(Bt,{domain:n.cookieDomain}),yn(Bt),yn(Ut)})({cookieDomain:a.cookieDomain}),((n={})=>{Tt(At(),n)})({cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays}),((n={})=>{Dt({id:At(),lastActivity:Date.now()},n)})({cookieDomain:a.cookieDomain,timeoutMinutes:a.sessionTimeoutMinutes})}catch(n){}},flush(){try{s&&s.flush()}catch(n){}},consent(n){try{u=Object.assign(Object.assign({},u),n)}catch(n){}},set(n){try{a=y(n),n.consent&&(u=Object.assign(Object.assign({},u),n.consent)),s&&s.setConfig({endpoint:a.endpoint,batchPath:a.batchPath,singlePath:a.singlePath,useBatch:a.useBatch,contentType:a.contentType,flushAt:a.flushAt,flushInterval:a.flushInterval,debug:a.debug})}catch(n){}},destroy(){h=o(h),g.dispose(),m.dispose(),b.dispose(),f=null,s&&s.destroy(),s=null,d=!1,n=null,a=Object.assign({},Kt),u=Object.assign({},qt)}}}();function Qt(n){return On({projectId:Jt.projectId,endpoint:Jt.endpoint,zaloQrLoginEnabled:Jt.isZaloQrLoginEnabled(),consentGranted:Jt.consentGranted,identify:Jt.identify,alias:Jt.alias,getUserId:Vt},n)}"undefined"!=typeof window&&(n=>{if("undefined"==typeof window)return()=>{};const t=window.cnvQ;if(t&&t.__loaded)return()=>{};const e=window.cnvQ=null!=t?t:[],o=e.splice(0,e.length);e.push.bind(e),e.push=(...t)=>{for(const e of t)Gt(n,e);return e.length},e.__loaded=!0;for(const t of o)Gt(n,t)})(Jt);const Wt=Object.assign(Jt,{version:Zt,name:Yt,schemaVersion:Ot,loginWithZalo:Qt});n.NAME=Yt,n.SCHEMA_VERSION=Ot,n.VERSION=Zt,n.ZaloQrLoginError=Mn,n.default=Wt,n.loginWithZalo=Qt,Object.defineProperty(n,"t",{value:!0})}(this.cnvTrack=this.cnvTrack||{});
|
|
6
|
+
!function(n){function t(n){try{n()}catch(n){}}function e(n,t){try{return n()}catch(n){return t}}function o(n){return n&&t(n),null}const r=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","csv","rtf","zip","rar","7z","tar","gz","mp3","mp4","mov","wav","avi","mkv","dmg","exe","pkg","apk","msi","svg"];function i(n){return!!n&&"object"==typeof n&&1===n.nodeType&&"A"===n.tagName}function c(n){const t=n.lastIndexOf("/");return-1===t?n:n.slice(t+1)}function l(n){var t,e,o;let r=(null!==(t=n.textContent)&&void 0!==t?t:"").trim();return r||(r=(null!==(e=n.getAttribute("aria-label"))&&void 0!==e?e:"").trim()),r||(r=(null!==(o=n.getAttribute("title"))&&void 0!==o?o:"").trim()),r.length>200?r.slice(0,200):r}const a=200;function u(n){let t="";try{t=(n.textContent||"").replace(/\s+/g," ").trim(),t||(t=(n.getAttribute("aria-label")||"").trim()),t||(t=(n.getAttribute("title")||"").trim()),t=t.normalize("NFC")}catch(n){return""}return t.length>a?t.slice(0,a):t}function s(n){const t=!1!==n.caseInsensitive;if("regex"===n.mode)return{mode:"regex",needle:n.value,ci:t,re:x(n.value,t)};const e=n.value.normalize("NFC");return{mode:n.mode,needle:t?e.toLowerCase():e,ci:t,re:null}}function d(n,t){try{return n.matches(t)}catch(n){return!1}}function f(n){try{if("A"===n.tagName){const t=n.getAttribute("href");return t?w(t):null}const t=n.getAttribute("formaction");if(t)return w(t);const e=n.getAttribute("data-href");if(e)return w(e);const o=n.closest("form");if(o){const n=o.getAttribute("action");if(n)return w(n)}return null}catch(n){return null}}function p(n){return"regex"===n.mode?{mode:"regex",needle:n.value,re:x(n.value,!0)}:{mode:n.mode,needle:n.value.toLowerCase(),re:null}}function h(n){if("startsWith"===n.mode)return{mode:"startsWith",needle:n.value,re:null};const t="glob"===n.mode?"^"+n.value.replace(/[.+^${}()|[\]\\?]/g,"\\$&").replace(/\*/g,".*")+"$":n.value;return{mode:n.mode,needle:n.value,re:x(t,!1)}}function v(n,t){return"startsWith"===n.mode?0===t.indexOf(n.needle):!n.re||_(n.re,t)}const m=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,g=/\+?\d[\d\s().-]{7,}\d/g;function b(n){if(!n)return n;try{return n.replace(m,"[email]").replace(g,"[phone]")}catch(t){return n}}function y(n){return!!n&&"object"==typeof n&&1===n.nodeType}function w(n){try{return new URL(n,location.href).href}catch(t){return n}}function x(n,t){try{return!n||n.length>1e3?null:new RegExp(n,t?"i":"")}catch(n){return null}}function _(n,t){try{return n.test(t)}catch(n){return!1}}function k(n,e){if("undefined"==typeof document)return()=>{};const o=(n=>{const t=n.globalThrottle||{},e=[],o=n.rules||[];for(let n=0;n<o.length;n++){const r=o[n];if(!r||!1===r.enabled)continue;if(!r.match||!r.event)continue;const i=r.match,c=r.throttle||{};e.push({rule:r,elementSpec:M(r),selector:i.selector||null,text:i.text?s(i.text):null,dest:i.destinationUrl?p(i.destinationUrl):null,urlScope:r.urlScope?h(r.urlScope):null,dedupeWindowMs:C(c.dedupeWindowMs,C(t.dedupeWindowMs,500)),maxPerPageview:C(c.maxPerPageview,C(t.maxPerPageview,1/0)),samplingRate:S(C(c.samplingRate,C(t.samplingRate,1)))})}return e.sort((n,t)=>(n.rule.priority||0)-(t.rule.priority||0)),e})(e);if(0===o.length)return()=>{};const r=new WeakMap;let i=0;const c=n=>{let t=r.get(n);return void 0===t&&(t=++i,r.set(n,t)),String(t)},l=new Map,a=new Map;let u=z();function d(e){try{if(0!==e.button)return;const r=z();r!==u&&(u=r,a.clear(),l.clear());const i=(n=>{const t=[];try{const e="function"==typeof n.composedPath?n.composedPath():[];if(e&&e.length>0){for(const n of e)y(n)&&t.push(n);return t}let o=n.target;for(;o;)y(o)&&t.push(o),o=o.parentNode}catch(n){}return t})(e);if(0===i.length)return;const s=(()=>{try{return"undefined"!=typeof location?location.pathname+location.search:""}catch(n){return""}})();for(let r=0;r<o.length;r++){const u=o[r];if(u.urlScope&&!v(u.urlScope,s))continue;let d=null;for(let n=0;n<i.length;n++)if(A(u,i[n])){d=i[n];break}if(!d)continue;const f=u.rule.id;if((a.get(f)||0)>=u.maxPerPageview)return;const p=f+"#"+c(d),h=Date.now(),m=l.get(p);if(void 0!==m&&h-m<u.dedupeWindowMs)return;if(u.samplingRate<1&&Math.random()>=u.samplingRate)return;l.set(p,h),a.set(f,(a.get(f)||0)+1);const g=j(u.rule,d,e);return void t(()=>n.track("clicked",g))}}catch(n){}}try{document.addEventListener("click",d,!0)}catch(n){return()=>{}}return()=>{try{document.removeEventListener("click",d,!0)}catch(n){}l.clear(),a.clear()}}function M(n){const t=n.match;return t.element?t.element:t.selector||t.id||t.dataAttr||t.classes&&t.classes.length>0||t.destinationUrl?"any":void 0}function A(n,t){if(!((n,t)=>{if(!t)return(n=>{const t=n.tagName;if("BUTTON"===t||"A"===t)return!0;if("INPUT"===t){const t=(n.getAttribute("type")||"").toLowerCase();return"submit"===t||"button"===t||"reset"===t}return"button"===n.getAttribute("role")})(n);if("any"===t)return!0;if("button"===t){const t=n.tagName;if("BUTTON"===t)return!0;if("INPUT"===t){const t=(n.getAttribute("type")||"").toLowerCase();return"submit"===t||"button"===t||"reset"===t}return"button"===n.getAttribute("role")}return"link"===t?"A"===n.tagName:d(n,t)})(t,n.elementSpec))return!1;const e=n.rule.match;return!(n.selector&&!d(t,n.selector)||void 0!==e.id&&!((n,t)=>n.id===t)(t,e.id)||e.classes&&e.classes.length>0&&!((n,t)=>{try{for(let e=0;e<t.length;e++)if(!n.classList.contains(t[e]))return!1;return!0}catch(n){return!1}})(t,e.classes)||e.dataAttr&&!((n,t,e)=>{try{return!!n.hasAttribute(t)&&(void 0===e||n.getAttribute(t)===e)}catch(n){return!1}})(t,e.dataAttr.name,e.dataAttr.value)||n.text&&!((n,t)=>{const e=u(n);if("regex"===t.mode)return!!t.re&&_(t.re,e);const o=t.ci?e.toLowerCase():e;return"exact"===t.mode?o===t.needle:"startsWith"===t.mode?0===o.indexOf(t.needle):-1!==o.indexOf(t.needle)})(t,n.text)||n.dest&&!((n,t)=>{const e=f(n);if(!e)return!1;if("regex"===t.mode)return!!t.re&&_(t.re,e);if("domain"===t.mode)try{return new URL(e).host.toLowerCase()===t.needle}catch(n){return!1}const o=e.toLowerCase();return"exact"===t.mode?o===t.needle:"startsWith"===t.mode?0===o.indexOf(t.needle):-1!==o.indexOf(t.needle)})(t,n.dest))}function j(n,t,e){const o={},r=n.event.staticProps;if(r)for(const n of Object.keys(r))o[n]=r[n];const i=n.capture;if(i)try{if(i.text){const n=b(u(t));n&&(o.text=n)}if(i.href){const n=f(t);n&&(o.href=n)}if(i.elementId&&t.id&&(o.element_id=t.id),i.classes&&(o.element_classes=Array.from(t.classList)),i.dataAttrs&&i.dataAttrs.length>0)for(let n=0;n<i.dataAttrs.length;n++){const e=i.dataAttrs[n],r=t.getAttribute(e);null!==r&&(o[e]=b(r))}if(i.valueFrom){const n=((n,t)=>{try{const e=n.querySelector(t.selector)||(n.parentElement?n.parentElement.querySelector(t.selector):null);if(!e)return null;const o=t.attr?e.getAttribute(t.attr):e.textContent||"";if(null===o)return null;const r=b(o.replace(/\s+/g," ").trim());return r.length>a?r.slice(0,a):r}catch(n){return null}})(t,i.valueFrom);null!==n&&(o[i.valueFrom.as]=n)}i.selectorPath&&(o.selector_path=((n,t=5)=>{try{const e=[];let o=n,r=0;for(;o&&1===o.nodeType&&r<t;){let n=o.tagName.toLowerCase();if(o.id){e.unshift(n+"#"+o.id);break}const t=Array.from(o.classList).slice(0,2).join(".");t&&(n+="."+t),e.unshift(n),o=o.parentElement,r++}return e.join(" > ")}catch(n){return""}})(t)),i.position&&(o.x=e.clientX,o.y=e.clientY)}catch(n){}return o.rule_id=n.id,n.name&&(o.rule_name=n.name),n.event&&n.event.name&&(o.event_name=n.event.name),o.tag=t.tagName.toLowerCase(),o}function z(){try{return"undefined"!=typeof location?location.href:""}catch(n){return""}}function C(n,t){return"number"!=typeof n||isNaN(n)?t:n}function S(n){return n<0?0:n>1?1:n}const O="__cnvPatched";function T(n){if("undefined"==typeof window||"undefined"==typeof history)return()=>{};let t=I();function e(){try{const e=I();if(e===t)return;t=e,n(e)}catch(n){}}const o=history.pushState,r=history.replaceState,i=!0===o[O],c=!0===r[O];if(!i){function u(...n){o.apply(this,n),e()}u[O]=!0,history.pushState=u}if(!c){function s(...n){r.apply(this,n),e()}s[O]=!0,history.replaceState=s}const l=()=>e(),a=()=>e();try{window.addEventListener("popstate",l),window.addEventListener("hashchange",a)}catch(d){}return()=>{try{window.removeEventListener("popstate",l),window.removeEventListener("hashchange",a)}catch(n){}try{!i&&history.pushState[O]&&(history.pushState=o),!c&&history.replaceState[O]&&(history.replaceState=r)}catch(n){}}}function I(){try{return"undefined"!=typeof location?location.href:""}catch(n){return""}}const N=["q","s","query","search","keyword"],R={spa:!0,outboundClicks:!0,scroll:!0,downloads:!0,siteSearch:!0},F={spa:!1,outboundClicks:!1,scroll:!1,downloads:!1,siteSearch:!1};const $=2147483e3,E="#6C5CE7",D="#FFFFFF";function P(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(max-width: 768px)").matches:"undefined"!=typeof window&&"number"==typeof window.innerWidth&&window.innerWidth<=768}catch(n){return!1}}function L(n,t){return(n=>"string"==typeof n&&/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(n))(n)?n:t}function B(n){if("string"!=typeof n||0===n.trim().length)return!1;try{const t="undefined"!=typeof location?location.href:void 0,e=new URL(n,t);return"https:"===e.protocol||"http:"===e.protocol||"data:"===e.protocol&&/^data:image\//i.test(n.trim())}catch(n){return!1}}function U(n){return"number"==typeof n&&Number.isFinite(n)?Math.min(Math.max(Math.trunc(n),0),2147483647):null}function V(n,t=20){return"number"==typeof n&&Number.isFinite(n)?Math.min(Math.max(n,0),2e3):t}function H(n,t){const e=n.replace("#",""),o=3===e.length?e.replace(/(.)/g,"$1$1"):e;return`rgba(${parseInt(o.slice(0,2),16)}, ${parseInt(o.slice(2,4),16)}, ${parseInt(o.slice(4,6),16)}, ${t})`}function q(n,t){const e=t?null==n?void 0:n.placementMobile:null==n?void 0:n.placementDesktop;return{side:"LEFT"===(null==e?void 0:e.position)?"left":"right",sideSpacingPx:V(null==e?void 0:e.sideSpacing),bottomSpacingPx:V(null==e?void 0:e.bottomSpacing)}}function Z(n,t){const e=document.createElement("div");e.setAttribute(n,"");const o=e.attachShadow({mode:"open"}),r=document.createElement("style");return r.textContent=t,o.appendChild(r),{hostEl:e,shadow:o}}function K(n){var t;(null!==(t=document.body)&&void 0!==t?t:document.documentElement).appendChild(n)}const G="cnv:panel:opened",J="cnv:panel:closed";function Y(n,t,e){if(e)n.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 6l12 12M18 6 6 18" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></svg>';else if("CUSTOM"===t.iconType&&B(t.customIconUrl)){n.innerHTML="";const e=document.createElement("img");e.src=t.customIconUrl,e.alt="",n.appendChild(e)}else n.innerHTML=(n=>{switch(n){case"BAG_HEART":return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 8V6a5 5 0 0 1 10 0v2" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><path d="M4.5 8h15l-1 12.5a1.5 1.5 0 0 1-1.5 1.4H7a1.5 1.5 0 0 1-1.5-1.4L4.5 8Z" fill="currentColor"/><path d="M12 12.8c1-1.4 3.6-1 3.6 1 0 1.7-2.2 2.9-3.6 3.9-1.4-1-3.6-2.2-3.6-3.9 0-2 2.6-2.4 3.6-1Z" fill="#fff"/></svg>';case"TAG":return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.6 3.4 20 10.8a2 2 0 0 1 0 2.8l-6.4 6.4a2 2 0 0 1-2.8 0L3.4 12.6A2 2 0 0 1 2.8 11l.6-6.2A2 2 0 0 1 5.2 3l6.2-.6a2 2 0 0 1 1.2.4Z" fill="currentColor"/><circle cx="8" cy="8" r="1.6" fill="#fff"/></svg>';case"STAR":return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5l2.9 6 6.6.7-4.9 4.5 1.3 6.5L12 16.9l-5.9 3.3 1.3-6.5-4.9-4.5 6.6-.7L12 2.5Z" fill="currentColor"/></svg>';case"GIFT":return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3.5" y="9.5" width="17" height="10" rx="1.2" fill="currentColor"/><rect x="2.5" y="6.5" width="19" height="3.5" rx="1" fill="currentColor"/><rect x="11" y="6.5" width="2" height="13" fill="#fff"/><path d="M12 6.5c0-2 -2-3.5-3.6-3.5S6 4.3 6 5.4c0 .9.8 1.1 1.6 1.1H12Z" fill="currentColor"/><path d="M12 6.5c0-2 2-3.5 3.6-3.5S18 4.3 18 5.4c0 .9-.8 1.1-1.6 1.1H12Z" fill="currentColor"/></svg>';default:return'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9.5 7 12l5-6 5 6 4-2.5-1.6 9.5a1.5 1.5 0 0 1-1.5 1.3H6.1a1.5 1.5 0 0 1-1.5-1.3L3 9.5Z" fill="currentColor"/></svg>'}})(t.iconPreset)}function W(n,o){if("undefined"==typeof document||"undefined"==typeof window)return()=>{};try{const{hostEl:n,shadow:r}=Z("data-cnv-launcher",':host{all:initial;}.cnv-launcher-fab{display:inline-flex;align-items:center;gap:8px;height:48px;padding:0 18px;border:none;cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.18);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:14px;font-weight:600;line-height:1;white-space:nowrap;transition:transform .18s cubic-bezier(.16,1,.3,1),box-shadow .18s ease;animation:cnv-fab-in .32s cubic-bezier(.16,1,.3,1);}.cnv-launcher-fab:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(0,0,0,.24);}.cnv-launcher-fab:active{transform:translateY(0) scale(.96);}.cnv-launcher-fab__icon{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;}.cnv-launcher-fab__icon svg,.cnv-launcher-fab__icon img{width:20px;height:20px;object-fit:contain;animation:cnv-fab-icon-in .28s cubic-bezier(.16,1,.3,1);}@keyframes cnv-fab-in{from{opacity:0;transform:translateY(10px) scale(.9);}to{opacity:1;transform:none;}}@keyframes cnv-fab-icon-in{from{opacity:0;transform:rotate(-90deg) scale(.4);}to{opacity:1;transform:none;}}@media (prefers-reduced-motion:reduce){.cnv-launcher-fab,.cnv-launcher-fab__icon svg,.cnv-launcher-fab__icon img{animation:none !important;transition:none !important;}}'),i=document.createElement("button");i.type="button",i.className="cnv-launcher-fab",i.setAttribute("aria-label","Launcher");const c=document.createElement("span");c.className="cnv-launcher-fab__icon";const l=document.createElement("span");l.className="cnv-launcher-fab__text",i.appendChild(c),i.appendChild(l),r.appendChild(i),((n,t,e)=>{n.style.backgroundColor=L(e.backgroundColor,E),n.style.color=L(e.textColor,D),n.style.borderRadius=(n=>{switch(n){case"SQUARE":return"2px";case"SHAVED":return"8px";case"ROUNDED":return"16px";default:return"999px"}})(e.buttonShape),Y(t,e,!1)})(i,c,o);let a=!1;const u=()=>((n,t,o,r,i)=>{try{const c=P();if(((n,t)=>{if("DESKTOP_ONLY"===n.deviceVisibility&&t)return!0;if(n.hideOnHomepage&&e(()=>"/"===location.pathname||""===location.pathname,!1))return!0;const o=n.hideUrlConditions;if(o&&o.length>0){const n=e(()=>location.pathname+location.search,"");if(o.some(t=>"string"==typeof t&&t.length>0&&n.includes(t)))return!0}return!1})(r,c))return void n.style.setProperty("display","none");n.style.removeProperty("display");const{side:l,sideSpacingPx:a,bottomSpacingPx:u}=q(r,c),s=r.useCustomZIndex?U(r.zIndex):null,d=r.addImportantRule?"important":"",f=(t,e)=>n.style.setProperty(t,e,d);f("position","fixed"),f("bottom",u+"px"),f("left","left"===l?a+"px":"auto"),f("right","right"===l?a+"px":"auto"),f("z-index",String(null!=s?s:$));const p=c?r.contentLayoutMobile:r.contentLayoutDesktop,h=!i&&"ICON_ONLY"!==p;t.style.display=i||"TEXT_ONLY"!==p?"inline-flex":"none",o.style.display=h?"inline":"none",h&&(o.textContent=(c?r.buttonTextMobile:r.buttonTextDesktop)||"")}catch(n){}})(n,c,l,o,a),s=n=>{a!==n&&(a=n,t(()=>{Y(c,o,n),i.setAttribute("aria-label",n?"Đóng":"Launcher"),u()}))},d=()=>s(!0),f=()=>s(!1);window.addEventListener(G,d),window.addEventListener(J,f);const p=()=>{t(()=>window.dispatchEvent(new CustomEvent("cnv:launcher:click",{detail:{config:o}})))};i.addEventListener("click",p);const h=()=>{t(()=>{K(n),u()})};document.body?h():document.addEventListener("DOMContentLoaded",h,{once:!0});const v=e(()=>window.matchMedia("(max-width: 768px)"),null),m=()=>u(),g=v;v&&"function"==typeof v.addEventListener?v.addEventListener("change",m):v&&"function"==typeof g.addListener?g.addListener(m):window.addEventListener("resize",m);const b=T(u);return()=>{t(()=>{document.removeEventListener("DOMContentLoaded",h),i.removeEventListener("click",p),window.removeEventListener(G,d),window.removeEventListener(J,f),v&&"function"==typeof v.removeEventListener?v.removeEventListener("change",m):v&&"function"==typeof g.removeListener?g.removeListener(m):window.removeEventListener("resize",m),n.remove()}),t(b)}}catch(n){return()=>{}}}const Q=(n,t)=>{let e=n;const o=X[t];let r=null,i=0,c=null;const l=[],a={},u=(n,t)=>{i=4*e+17,r=(n=>{const t=new Array(n);for(let e=0;e<n;e+=1){t[e]=new Array(n);for(let o=0;o<n;o+=1)t[e][o]=null}return t})(i),s(0,0),s(i-7,0),s(0,i-7),f(),d(),h(n,t),e>=7&&p(n),null==c&&(c=m(e,o,l)),v(c,t)},s=(n,t)=>{for(let e=-1;e<=7;e+=1)if(!(n+e<=-1||i<=n+e))for(let o=-1;o<=7;o+=1)t+o<=-1||i<=t+o||(r[n+e][t+o]=0<=e&&e<=6&&(0==o||6==o)||0<=o&&o<=6&&(0==e||6==e)||2<=e&&e<=4&&2<=o&&o<=4)},d=()=>{for(let n=8;n<i-8;n+=1)null==r[n][6]&&(r[n][6]=n%2==0);for(let n=8;n<i-8;n+=1)null==r[6][n]&&(r[6][n]=n%2==0)},f=()=>{const n=nn.getPatternPosition(e);for(let t=0;t<n.length;t+=1)for(let e=0;e<n.length;e+=1){const o=n[t],i=n[e];if(null==r[o][i])for(let n=-2;n<=2;n+=1)for(let t=-2;t<=2;t+=1)r[o+n][i+t]=-2==n||2==n||-2==t||2==t||0==n&&0==t}},p=n=>{const t=nn.getBCHTypeNumber(e);for(let e=0;e<18;e+=1){const o=!n&&1==(t>>e&1);r[Math.floor(e/3)][e%3+i-8-3]=o}for(let e=0;e<18;e+=1){const o=!n&&1==(t>>e&1);r[e%3+i-8-3][Math.floor(e/3)]=o}},h=(n,t)=>{const e=nn.getBCHTypeInfo(o<<3|t);for(let t=0;t<15;t+=1){const o=!n&&1==(e>>t&1);t<6?r[t][8]=o:t<8?r[t+1][8]=o:r[i-15+t][8]=o}for(let t=0;t<15;t+=1){const o=!n&&1==(e>>t&1);t<8?r[8][i-t-1]=o:t<9?r[8][15-t-1+1]=o:r[8][15-t-1]=o}r[i-8][8]=!n},v=(n,t)=>{let e=-1,o=i-1,c=7,l=0;const a=nn.getMaskFunction(t);for(let t=i-1;t>0;t-=2)for(6==t&&(t-=1);;){for(let e=0;e<2;e+=1)if(null==r[o][t-e]){let i=!1;l<n.length&&(i=1==(n[l]>>>c&1)),a(o,t-e)&&(i=!i),r[o][t-e]=i,c-=1,-1==c&&(l+=1,c=7)}if(o+=e,o<0||i<=o){o-=e,e=-e;break}}},m=(n,t,e)=>{const o=on.getRSBlocks(n,t),r=rn();for(let t=0;t<e.length;t+=1){const o=e[t];r.put(o.getMode(),4),r.put(o.getLength(),nn.getLengthInBits(o.getMode(),n)),o.write(r)}let i=0;for(let n=0;n<o.length;n+=1)i+=o[n].dataCount;if(r.getLengthInBits()>8*i)throw"code length overflow. ("+r.getLengthInBits()+">"+8*i+")";for(r.getLengthInBits()+4<=8*i&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=8*i||(r.put(236,8),r.getLengthInBits()>=8*i));)r.put(17,8);return((n,t)=>{let e=0,o=0,r=0;const i=new Array(t.length),c=new Array(t.length);for(let l=0;l<t.length;l+=1){const a=t[l].dataCount,u=t[l].totalCount-a;o=Math.max(o,a),r=Math.max(r,u),i[l]=new Array(a);for(let t=0;t<i[l].length;t+=1)i[l][t]=255&n.getBuffer()[t+e];e+=a;const s=nn.getErrorCorrectPolynomial(u),d=en(i[l],s.getLength()-1).mod(s);c[l]=new Array(s.getLength()-1);for(let n=0;n<c[l].length;n+=1){const t=n+d.getLength()-c[l].length;c[l][n]=t>=0?d.getAt(t):0}}let l=0;for(let n=0;n<t.length;n+=1)l+=t[n].totalCount;const a=new Array(l);let u=0;for(let n=0;n<o;n+=1)for(let e=0;e<t.length;e+=1)n<i[e].length&&(a[u]=i[e][n],u+=1);for(let n=0;n<r;n+=1)for(let e=0;e<t.length;e+=1)n<c[e].length&&(a[u]=c[e][n],u+=1);return a})(r,o)};a.addData=(n,t)=>{let e=null;switch(t=t||"Byte"){case"Numeric":e=cn(n);break;case"Alphanumeric":e=ln(n);break;case"Byte":e=an(n);break;case"Kanji":e=un(n);break;default:throw"mode:"+t}l.push(e),c=null},a.isDark=(n,t)=>{if(n<0||i<=n||t<0||i<=t)throw n+","+t;return r[n][t]},a.getModuleCount=()=>i,a.make=()=>{if(e<1){let n=1;for(;n<40;n++){const t=on.getRSBlocks(n,o),e=rn();for(let t=0;t<l.length;t++){const o=l[t];e.put(o.getMode(),4),e.put(o.getLength(),nn.getLengthInBits(o.getMode(),n)),o.write(e)}let r=0;for(let n=0;n<t.length;n++)r+=t[n].dataCount;if(e.getLengthInBits()<=8*r)break}e=n}u(!1,(()=>{let n=0,t=0;for(let e=0;e<8;e+=1){u(!0,e);const o=nn.getLostPoint(a);(0==e||n>o)&&(n=o,t=e)}return t})())},a.createTableTag=(n,t)=>{n=n||2;let e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+(t=void 0===t?4*n:t)+"px;",e+='">',e+="<tbody>";for(let t=0;t<a.getModuleCount();t+=1){e+="<tr>";for(let o=0;o<a.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+n+"px;",e+=" height: "+n+"px;",e+=" background-color: ",e+=a.isDark(t,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>",e},a.createSvgTag=function(n,t,e,o){let r={};"object"==typeof arguments[0]&&(r=arguments[0],n=r.cellSize,t=r.margin,e=r.alt,o=r.title),n=n||2,t=void 0===t?4*n:t,(e="string"==typeof e?{text:e}:e||{}).text=e.text||null,e.id=e.text?e.id||"qrcode-description":null,(o="string"==typeof o?{text:o}:o||{}).text=o.text||null,o.id=o.text?o.id||"qrcode-title":null;const i=a.getModuleCount()*n+2*t;let c,l,u,s,d,f="";for(d="l"+n+",0 0,"+n+" -"+n+",0 0,-"+n+"z ",f+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',f+=r.scalable?"":' width="'+i+'px" height="'+i+'px"',f+=' viewBox="0 0 '+i+" "+i+'" ',f+=' preserveAspectRatio="xMinYMin meet"',f+=o.text||e.text?' role="img" aria-labelledby="'+g([o.id,e.id].join(" ").trim())+'"':"",f+=">",f+=o.text?'<title id="'+g(o.id)+'">'+g(o.text)+"</title>":"",f+=e.text?'<description id="'+g(e.id)+'">'+g(e.text)+"</description>":"",f+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',f+='<path d="',u=0;u<a.getModuleCount();u+=1)for(s=u*n+t,c=0;c<a.getModuleCount();c+=1)a.isDark(u,c)&&(l=c*n+t,f+="M"+l+","+s+d);return f+='" stroke="transparent" fill="black"/>',f+="</svg>",f},a.createDataURL=(n,t)=>{n=n||2,t=void 0===t?4*n:t;const e=a.getModuleCount()*n+2*t,o=t,r=e-t;return fn(e,e,(t,e)=>{if(o<=t&&t<r&&o<=e&&e<r){const r=Math.floor((t-o)/n),i=Math.floor((e-o)/n);return a.isDark(i,r)?0:1}return 1})},a.createImgTag=(n,t,e)=>{n=n||2,t=void 0===t?4*n:t;const o=a.getModuleCount()*n+2*t;let r="";return r+="<img",r+=' src="',r+=a.createDataURL(n,t),r+='"',r+=' width="',r+=o,r+='"',r+=' height="',r+=o,r+='"',e&&(r+=' alt="',r+=g(e),r+='"'),r+="/>",r};const g=n=>{let t="";for(let e=0;e<n.length;e+=1){const o=n.charAt(e);switch(o){case"<":t+="<";break;case">":t+=">";break;case"&":t+="&";break;case'"':t+=""";break;default:t+=o}}return t};return a.createASCII=(n,t)=>{if((n=n||1)<2)return(n=>{n=void 0===n?2:n;const t=1*a.getModuleCount()+2*n,e=n,o=t-n;let r,i,c,l,u;const s={"██":"█","█ ":"▀"," █":"▄"," ":" "},d={"██":"▀","█ ":"▀"," █":" "," ":" "};let f="";for(r=0;r<t;r+=2){for(c=Math.floor((r-e)/1),l=Math.floor((r+1-e)/1),i=0;i<t;i+=1)u="█",e<=i&&i<o&&e<=r&&r<o&&a.isDark(c,Math.floor((i-e)/1))&&(u=" "),e<=i&&i<o&&e<=r+1&&r+1<o&&a.isDark(l,Math.floor((i-e)/1))?u+=" ":u+="█",f+=n<1&&r+1>=o?d[u]:s[u];f+="\n"}return t%2&&n>0?f.substring(0,f.length-t-1)+Array(t+1).join("▀"):f.substring(0,f.length-1)})(t);n-=1,t=void 0===t?2*n:t;const e=a.getModuleCount()*n+2*t,o=t,r=e-t;let i,c,l,u;const s=Array(n+1).join("██"),d=Array(n+1).join(" ");let f="",p="";for(i=0;i<e;i+=1){for(l=Math.floor((i-o)/n),p="",c=0;c<e;c+=1)u=1,o<=c&&c<r&&o<=i&&i<r&&a.isDark(l,Math.floor((c-o)/n))&&(u=0),p+=u?s:d;for(l=0;l<n;l+=1)f+=p+"\n"}return f.substring(0,f.length-1)},a.renderTo2dContext=(n,t)=>{t=t||2;const e=a.getModuleCount();for(let o=0;o<e;o++)for(let r=0;r<e;r++)n.fillStyle=a.isDark(o,r)?"black":"white",n.fillRect(r*t,o*t,t,t)},a};Q.stringToBytes=n=>{const t=[];for(let e=0;e<n.length;e+=1){const o=n.charCodeAt(e);t.push(255&o)}return t},Q.createStringToBytes=(n,t)=>{const e=(()=>{const e=dn(n),o=()=>{const n=e.read();if(-1==n)throw"eof";return n};let r=0;const i={};for(;;){const n=e.read();if(-1==n)break;const t=o(),c=o(),l=o();i[String.fromCharCode(n<<8|t)]=c<<8|l,r+=1}if(r!=t)throw r+" != "+t;return i})(),o="?".charCodeAt(0);return n=>{const t=[];for(let r=0;r<n.length;r+=1){const i=n.charCodeAt(r);if(i<128)t.push(i);else{const i=e[n.charAt(r)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(o)}}return t}};const X={L:1,M:0,Q:3,H:2},nn=(()=>{const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,e=7973,o={},r=n=>{let t=0;for(;0!=n;)t+=1,n>>>=1;return t};return o.getBCHTypeInfo=n=>{let e=n<<10;for(;r(e)-r(t)>=0;)e^=t<<r(e)-r(t);return 21522^(n<<10|e)},o.getBCHTypeNumber=n=>{let t=n<<12;for(;r(t)-r(e)>=0;)t^=e<<r(t)-r(e);return n<<12|t},o.getPatternPosition=t=>n[t-1],o.getMaskFunction=n=>{switch(n){case 0:return(n,t)=>(n+t)%2==0;case 1:return(n,t)=>n%2==0;case 2:return(n,t)=>t%3==0;case 3:return(n,t)=>(n+t)%3==0;case 4:return(n,t)=>(Math.floor(n/2)+Math.floor(t/3))%2==0;case 5:return(n,t)=>n*t%2+n*t%3==0;case 6:return(n,t)=>(n*t%2+n*t%3)%2==0;case 7:return(n,t)=>(n*t%3+(n+t)%2)%2==0;default:throw"bad maskPattern:"+n}},o.getErrorCorrectPolynomial=n=>{let t=en([1],0);for(let e=0;e<n;e+=1)t=t.multiply(en([1,tn.gexp(e)],0));return t},o.getLengthInBits=(n,t)=>{if(1<=t&&t<10)switch(n){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+n}else if(t<27)switch(n){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+n}else{if(!(t<41))throw"type:"+t;switch(n){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+n}}},o.getLostPoint=n=>{const t=n.getModuleCount();let e=0;for(let o=0;o<t;o+=1)for(let r=0;r<t;r+=1){let i=0;const c=n.isDark(o,r);for(let e=-1;e<=1;e+=1)if(!(o+e<0||t<=o+e))for(let l=-1;l<=1;l+=1)r+l<0||t<=r+l||0==e&&0==l||c==n.isDark(o+e,r+l)&&(i+=1);i>5&&(e+=3+i-5)}for(let o=0;o<t-1;o+=1)for(let r=0;r<t-1;r+=1){let t=0;n.isDark(o,r)&&(t+=1),n.isDark(o+1,r)&&(t+=1),n.isDark(o,r+1)&&(t+=1),n.isDark(o+1,r+1)&&(t+=1),0!=t&&4!=t||(e+=3)}for(let o=0;o<t;o+=1)for(let r=0;r<t-6;r+=1)n.isDark(o,r)&&!n.isDark(o,r+1)&&n.isDark(o,r+2)&&n.isDark(o,r+3)&&n.isDark(o,r+4)&&!n.isDark(o,r+5)&&n.isDark(o,r+6)&&(e+=40);for(let o=0;o<t;o+=1)for(let r=0;r<t-6;r+=1)n.isDark(r,o)&&!n.isDark(r+1,o)&&n.isDark(r+2,o)&&n.isDark(r+3,o)&&n.isDark(r+4,o)&&!n.isDark(r+5,o)&&n.isDark(r+6,o)&&(e+=40);let o=0;for(let e=0;e<t;e+=1)for(let r=0;r<t;r+=1)n.isDark(r,e)&&(o+=1);return e+=Math.abs(100*o/t/t-50)/5*10,e},o})(),tn=(()=>{const n=new Array(256),t=new Array(256);for(let t=0;t<8;t+=1)n[t]=1<<t;for(let t=8;t<256;t+=1)n[t]=n[t-4]^n[t-5]^n[t-6]^n[t-8];for(let e=0;e<255;e+=1)t[n[e]]=e;return{glog(n){if(n<1)throw"glog("+n+")";return t[n]},gexp(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return n[t]}}})(),en=(n,t)=>{if(void 0===n.length)throw n.length+"/"+t;const e=(()=>{let e=0;for(;e<n.length&&0==n[e];)e+=1;const o=new Array(n.length-e+t);for(let t=0;t<n.length-e;t+=1)o[t]=n[t+e];return o})(),o={getAt:n=>e[n],getLength:()=>e.length,multiply(n){const t=new Array(o.getLength()+n.getLength()-1);for(let e=0;e<o.getLength();e+=1)for(let r=0;r<n.getLength();r+=1)t[e+r]^=tn.gexp(tn.glog(o.getAt(e))+tn.glog(n.getAt(r)));return en(t,0)},mod(n){if(o.getLength()-n.getLength()<0)return o;const t=tn.glog(o.getAt(0))-tn.glog(n.getAt(0)),e=new Array(o.getLength());for(let n=0;n<o.getLength();n+=1)e[n]=o.getAt(n);for(let o=0;o<n.getLength();o+=1)e[o]^=tn.gexp(tn.glog(n.getAt(o))+t);return en(e,0).mod(n)}};return o},on=(()=>{const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=(n,t)=>{const e={};return e.totalCount=n,e.dataCount=t,e};return{getRSBlocks(e,o){const r=((t,e)=>{switch(e){case X.L:return n[4*(t-1)+0];case X.M:return n[4*(t-1)+1];case X.Q:return n[4*(t-1)+2];case X.H:return n[4*(t-1)+3];default:return}})(e,o);if(void 0===r)throw"bad rs block @ typeNumber:"+e+"/errorCorrectionLevel:"+o;const i=r.length/3,c=[];for(let n=0;n<i;n+=1){const e=r[3*n+0],o=r[3*n+1],i=r[3*n+2];for(let n=0;n<e;n+=1)c.push(t(o,i))}return c}}})(),rn=()=>{const n=[];let t=0;const e={getBuffer:()=>n,getAt(t){const e=Math.floor(t/8);return 1==(n[e]>>>7-t%8&1)},put(n,t){for(let o=0;o<t;o+=1)e.putBit(1==(n>>>t-o-1&1))},getLengthInBits:()=>t,putBit(e){const o=Math.floor(t/8);n.length<=o&&n.push(0),e&&(n[o]|=128>>>t%8),t+=1}};return e},cn=n=>{const t=n,e={getMode:()=>1,getLength:n=>t.length,write(n){const e=t;let r=0;for(;r+2<e.length;)n.put(o(e.substring(r,r+3)),10),r+=3;r<e.length&&(e.length-r==1?n.put(o(e.substring(r,r+1)),4):e.length-r==2&&n.put(o(e.substring(r,r+2)),7))}},o=n=>{let t=0;for(let e=0;e<n.length;e+=1)t=10*t+r(n.charAt(e));return t},r=n=>{if("0"<=n&&n<="9")return n.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+n};return e},ln=n=>{const t=n,e={getMode:()=>2,getLength:n=>t.length,write(n){const e=t;let r=0;for(;r+1<e.length;)n.put(45*o(e.charAt(r))+o(e.charAt(r+1)),11),r+=2;r<e.length&&n.put(o(e.charAt(r)),6)}},o=n=>{if("0"<=n&&n<="9")return n.charCodeAt(0)-"0".charCodeAt(0);if("A"<=n&&n<="Z")return n.charCodeAt(0)-"A".charCodeAt(0)+10;switch(n){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+n}};return e},an=n=>{const t=Q.stringToBytes(n);return{getMode:()=>4,getLength:n=>t.length,write(n){for(let e=0;e<t.length;e+=1)n.put(t[e],8)}}},un=n=>{const t=Q.stringToBytes;(()=>{const n=t("友");if(2!=n.length||38726!=(n[0]<<8|n[1]))throw"sjis not supported."})();const e=t(n),o={getMode:()=>8,getLength:n=>~~(e.length/2),write(n){const t=e;let o=0;for(;o+1<t.length;){let e=(255&t[o])<<8|255&t[o+1];if(33088<=e&&e<=40956)e-=33088;else{if(!(57408<=e&&e<=60351))throw"illegal char at "+(o+1)+"/"+e;e-=49472}e=192*(e>>>8&255)+(255&e),n.put(e,13),o+=2}if(o<t.length)throw"illegal char at "+(o+1)}};return o},sn=()=>{const n=[],t={writeByte(t){n.push(255&t)},writeShort(n){t.writeByte(n),t.writeByte(n>>>8)},writeBytes(n,e,o){e=e||0,o=o||n.length;for(let r=0;r<o;r+=1)t.writeByte(n[r+e])},writeString(n){for(let e=0;e<n.length;e+=1)t.writeByte(n.charCodeAt(e))},toByteArray:()=>n,toString(){let t="";t+="[";for(let e=0;e<n.length;e+=1)e>0&&(t+=","),t+=n[e];return t+="]",t}};return t},dn=n=>{const t=n;let e=0,o=0,r=0;const i={read(){for(;r<8;){if(e>=t.length){if(0==r)return-1;throw"unexpected end of file./"+r}const n=t.charAt(e);if(e+=1,"="==n)return r=0,-1;n.match(/^\s$/)||(o=o<<6|c(n.charCodeAt(0)),r+=6)}const n=o>>>r-8&255;return r-=8,n}},c=n=>{if(65<=n&&n<=90)return n-65;if(97<=n&&n<=122)return n-97+26;if(48<=n&&n<=57)return n-48+52;if(43==n)return 62;if(47==n)return 63;throw"c:"+n};return i},fn=(n,t,e)=>{const o=((n,t)=>{const e=n,o=t,r=new Array(n*t),i={setPixel(n,t,o){r[t*e+n]=o},write(n){n.writeString("GIF87a"),n.writeShort(e),n.writeShort(o),n.writeByte(128),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(255),n.writeByte(255),n.writeByte(255),n.writeString(","),n.writeShort(0),n.writeShort(0),n.writeShort(e),n.writeShort(o),n.writeByte(0);const t=c(2);n.writeByte(2);let r=0;for(;t.length-r>255;)n.writeByte(255),n.writeBytes(t,r,255),r+=255;n.writeByte(t.length-r),n.writeBytes(t,r,t.length-r),n.writeByte(0),n.writeString(";")}},c=n=>{const t=1<<n,e=1+(1<<n);let o=n+1;const i=l();for(let n=0;n<t;n+=1)i.add(String.fromCharCode(n));i.add(String.fromCharCode(t)),i.add(String.fromCharCode(e));const c=sn(),a=(n=>{const t=n;let e=0,o=0;return{write(n,r){if(n>>>r!=0)throw"length over";for(;e+r>=8;)t.writeByte(255&(n<<e|o)),r-=8-e,n>>>=8-e,o=0,e=0;o|=n<<e,e+=r},flush(){e>0&&t.writeByte(o)}}})(c);a.write(t,o);let u=0,s=String.fromCharCode(r[u]);for(u+=1;u<r.length;){const n=String.fromCharCode(r[u]);u+=1,i.contains(s+n)?s+=n:(a.write(i.indexOf(s),o),i.size()<4095&&(i.size()==1<<o&&(o+=1),i.add(s+n)),s=n)}return a.write(i.indexOf(s),o),a.write(e,o),a.flush(),c.toByteArray()},l=()=>{const n={};let t=0;const e={add(o){if(e.contains(o))throw"dup key:"+o;n[o]=t,t+=1},size(){return t},indexOf(t){return n[t]},contains(t){return void 0!==n[t]}};return e};return i})(n,t);for(let r=0;r<t;r+=1)for(let t=0;t<n;t+=1)o.setPixel(t,r,e(t,r));const r=sn();o.write(r);const i=(()=>{let n=0,t=0,e=0,o="";const r={},i=n=>{o+=String.fromCharCode(c(63&n))},c=n=>{if(n<0)throw"n:"+n;if(n<26)return 65+n;if(n<52)return n-26+97;if(n<62)return n-52+48;if(62==n)return 43;if(63==n)return 47;throw"n:"+n};return r.writeByte=o=>{for(n=n<<8|255&o,t+=8,e+=1;t>=6;)i(n>>>t-6),t-=6},r.flush=()=>{if(t>0&&(i(n<<6-t),n=0,t=0),e%3!=0){const n=3-e%3;for(let t=0;t<n;t+=1)o+="="}},r.toString=()=>o,r})(),c=r.toByteArray();for(let n=0;n<c.length;n+=1)i.writeByte(c[n]);return i.flush(),"data:image/gif;base64,"+i},pn="undefined"!=typeof window&&"undefined"!=typeof document;function hn(n){if(!pn)return null;try{const t=document.cookie;if(!t)return null;const e=encodeURIComponent(n),o=t.split(";");for(let t=0;t<o.length;t++){const r=o[t].indexOf("=");if(r<0)continue;const i=o[t].slice(0,r).trim();if(i===e||i===n)try{return decodeURIComponent(o[t].slice(r+1))}catch(n){return o[t].slice(r+1)}}return null}catch(n){return null}}function vn(n,t,e={}){var o,r,i;if(!pn)return!1;try{let c=`${encodeURIComponent(n)}=${encodeURIComponent(t)}`;if(c+=`; path=${null!==(o=e.path)&&void 0!==o?o:"/"}`,e.domain&&(c+=`; domain=${e.domain}`),"number"==typeof e.maxAgeDays){const n=Math.floor(86400*e.maxAgeDays);c+=`; max-age=${n}`,c+=`; expires=${new Date(Date.now()+1e3*n).toUTCString()}`}return c+=`; SameSite=${null!==(r=e.sameSite)&&void 0!==r?r:"Lax"}`,(null!==(i=e.secure)&&void 0!==i?i:"undefined"!=typeof location&&"https:"===location.protocol)&&(c+="; Secure"),document.cookie=c,hn(n)===t}catch(n){return!1}}function mn(){if(!pn)return!1;try{const n="__cnv_probe__";return localStorage.setItem(n,"1"),localStorage.removeItem(n),!0}catch(n){return!1}}function gn(n){if(!mn())return null;try{return localStorage.getItem(n)}catch(n){return null}}function bn(n,t){if(!mn())return!1;try{return localStorage.setItem(n,t),!0}catch(n){return!1}}function yn(n){if(!mn())return!1;try{return localStorage.removeItem(n),!0}catch(n){return!1}}function wn(){if(!pn)return!1;try{const n="__cnv_probe__";return sessionStorage.setItem(n,"1"),sessionStorage.removeItem(n),!0}catch(n){return!1}}const xn="0123456789abcdef";function _n(n){return xn[n>>>4&15]+xn[15&n]}function kn(){if("undefined"!=typeof crypto){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();if("function"==typeof crypto.getRandomValues){const n=new Uint8Array(16);return crypto.getRandomValues(n),n[6]=15&n[6]|64,n[8]=63&n[8]|128,_n(n[0])+_n(n[1])+_n(n[2])+_n(n[3])+"-"+_n(n[4])+_n(n[5])+"-"+_n(n[6])+_n(n[7])+"-"+_n(n[8])+_n(n[9])+"-"+_n(n[10])+_n(n[11])+_n(n[12])+_n(n[13])+_n(n[14])+_n(n[15])}}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const t=16*Math.random()|0;return("x"===n?t:3&t|8).toString(16)})}const Mn=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function An(n){return"string"==typeof n&&Mn.test(n)}function jn(n,t,e,o){return new(e||(e=Promise))((r,i)=>{function c(n){try{a(o.next(n))}catch(n){i(n)}}function l(n){try{a(o.throw(n))}catch(n){i(n)}}function a(n){var t;n.done?r(n.value):(t=n.value,t instanceof e?t:new e(n=>{n(t)})).then(c,l)}a((o=o.apply(n,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const zn=2e4,Cn=/^(https:|zalo:)/i;class Sn extends Error{constructor(n){super(`loginWithZalo() thất bại: ${n}`),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:n}),this.name="ZaloQrLoginError"}}function On(n,t,e,o){return`${n}${t}?${new URLSearchParams(Object.assign({projectId:e},o)).toString()}`}function Tn(n){return{title:"string"==typeof n.title?n.title:void 0,description:"string"==typeof n.description?n.description:void 0,points:Rn(n.points),expPoints:Rn(n.expPoints),balanceAfter:Rn(n.balanceAfter),expBalanceAfter:Rn(n.expBalanceAfter),rankAfter:"string"==typeof n.rankAfter?n.rankAfter:void 0,createdAt:"string"==typeof n.createdAt?n.createdAt:void 0}}function In(n){return{campaignId:Rn(n.campaignId),title:"string"==typeof n.title?n.title:void 0,imageUrl:"string"==typeof n.imageUrl?n.imageUrl:void 0,discountValue:"string"==typeof n.discountValue?n.discountValue:void 0,redeemPoints:Rn(n.redeemPoints),redeemRemain:Rn(n.redeemRemain),expiredAt:"string"==typeof n.expiredAt?n.expiredAt:void 0,stock:"boolean"==typeof n.stock?n.stock:void 0}}function Nn(n,t){return n?"string"==typeof n.error&&n.error?n.error:t&&"string"==typeof n.code&&n.code?n.code:null:null}function Rn(n){return"number"==typeof n&&Number.isFinite(n)?n:void 0}function Fn(n){return{id:Rn(n.id),name:"string"==typeof n.name?n.name:void 0,iconUrl:"string"==typeof n.iconUrl?n.iconUrl:void 0,colorCode:"string"==typeof n.colorCode?n.colorCode:void 0,threshold:Rn(n.threshold),level:Rn(n.level),benefits:Array.isArray(n.benefits)?n.benefits.filter(n=>"string"==typeof n&&""!==n.trim()):[]}}function $n(n){return{id:Rn(n.id),name:"string"==typeof n.name?n.name:void 0,iconUrl:"string"==typeof n.iconUrl?n.iconUrl:void 0,colorCode:"string"==typeof n.colorCode?n.colorCode:void 0,level:Rn(n.level),progressCurrent:Rn(n.progressCurrent),progressTarget:Rn(n.progressTarget),remaining:Rn(n.remaining),nextLevelName:"string"==typeof n.nextLevelName?n.nextLevelName:void 0,isHighestLevel:!0===n.isHighestLevel}}function En(n){return{title:"string"==typeof n.title?n.title:void 0,imageUrl:"string"==typeof n.imageUrl?n.imageUrl:void 0,code:"string"==typeof n.code?n.code:void 0,discountValue:"string"==typeof n.discountValue?n.discountValue:void 0,expiredAt:"string"==typeof n.expiredAt?n.expiredAt:void 0,useRemain:"number"==typeof n.useRemain&&Number.isFinite(n.useRemain)?n.useRemain:void 0}}function Dn(n,t){return jn(this,void 0,void 0,function*(){var e,o,r;if(!n.projectId||!n.endpoint)throw new Sn("not-initialized");if(!n.zaloQrLoginEnabled)throw new Sn("disabled");if(!n.consentGranted)throw new Sn("consent-required");const i={preferSse:null===(e=null==t?void 0:t.preferSse)||void 0===e||e,pollIntervalMs:null!==(o=null==t?void 0:t.pollIntervalMs)&&void 0!==o?o:2e3,autoIdentify:null===(r=null==t?void 0:t.autoIdentify)||void 0===r||r},c=n.projectId,l=n.endpoint,a=yield function(n,t,e){return jn(this,void 0,void 0,function*(){const o="undefined"!=typeof AbortController?new AbortController:null,r=o?setTimeout(()=>o.abort(),8e3):null;let i;try{i=yield fetch(On(n,"/zalo-qr/session",t),{method:"POST",credentials:"omit",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:o?o.signal:void 0})}catch(n){throw new Sn("network")}finally{r&&clearTimeout(r)}if(!i.ok)throw new Sn(401===(c=i.status)?"invalid-project-key":403===c?"project-suspended":"network");var c;return(n=>{const t=n;if(!t||"string"!=typeof t.sessionToken||!t.sessionToken||"string"!=typeof t.miniAppDeepLink||!Cn.test(t.miniAppDeepLink)||"number"!=typeof t.expiresInSeconds||!Number.isFinite(t.expiresInSeconds)||t.expiresInSeconds<=0)throw new Sn("network");return{sessionToken:t.sessionToken,miniAppDeepLink:t.miniAppDeepLink,expiresInSeconds:t.expiresInSeconds}})(yield i.json())})}(l,c,(n=>{var t,e,o;const r={};try{const i=null===(t=n.getAnonymousId)||void 0===t?void 0:t.call(n);i&&(r.anonymousId=i);const c=null===(e=n.getSessionId)||void 0===e?void 0:e.call(n);c&&(r.sessionId=c);const l=null===(o=n.getAttribution)||void 0===o?void 0:o.call(n);l&&(r.attribution=l)}catch(n){}return r})(n)),u=((n,t,e,o,r)=>{let i=!1,c=null,l=null,a=null,u=null,s=null;const d=()=>{c&&(c.close(),c=null),null!==l&&(clearInterval(l),l=null),null!==a&&(clearTimeout(a),a=null),null!==u&&(clearTimeout(u),u=null)};return{promise:new Promise((f,p)=>{s=p;const h=n=>{i||(i=!0,d(),n())},v=n=>{"success"===n.status?h(()=>f((n=>({contactId:n.contactId,fullName:n.fullName,level:n.level,xp:n.xp,panelSessionToken:n.panelSessionToken,panelSessionExp:n.panelSessionExp}))(n))):"denied"===n.status?h(()=>p(new Sn("denied"))):"expired"===n.status&&h(()=>p(new Sn("expired")))},m=()=>{null!==l||i||(l=setInterval(()=>{fetch(On(n,"/zalo-qr/status",t,{sessionToken:e}),{method:"GET",credentials:"omit",mode:"cors"}).then(n=>404===n.status?v({status:"expired"}):n.ok?n.json().then(n=>v(n)):void 0).catch(()=>{})},r.pollIntervalMs))};if(r.preferSse&&"undefined"!=typeof EventSource)try{c=new EventSource(On(n,"/zalo-qr/stream",t,{sessionToken:e})),c.addEventListener("success",n=>{try{v(JSON.parse(n.data))}catch(n){}}),c.addEventListener("denied",()=>v({status:"denied"})),c.onerror=()=>{null!==u||i||(u=setTimeout(()=>{u=null,i||(c&&(c.close(),c=null),m())},3e3))}}catch(n){m()}else m();a=setTimeout(()=>{h(()=>p(new Sn("expired")))},1e3*o)}),cancel(){i||(i=!0,d(),null==s||s(new Sn("cancelled")))}}})(l,c,a.sessionToken,a.expiresInSeconds,i),s=u.promise.then(t=>{try{if(i.autoIdentify&&null!=t.contactId){const e=String(t.contactId),o=n.getUserId();null!=o&&o!==e?n.alias(e,o):n.identify(e,Object.assign(Object.assign(Object.assign({},t.fullName?{name:t.fullName}:{}),t.level?{level:t.level}:{}),null!=t.xp?{xp:t.xp}:{}))}}catch(n){}return t});return{sessionToken:a.sessionToken,qrPayload:a.miniAppDeepLink,expiresInSeconds:a.expiresInSeconds,result:s,cancel:u.cancel,retry(){return u.cancel(),Dn(n,t)}}})}const Pn="cnv:launcher:click",Ln="cnv:panel:identify",Bn="cnv-panel-card--leaving";function Un(n){return"cnv_panel_session_"+(null!=n?n:"default")}function Vn(n){const t=gn(Un(n));return t?e(()=>{const n=JSON.parse(t);return n&&"string"==typeof n.token&&n.token&&"number"==typeof n.contactId&&"number"==typeof n.exp?n:null},null):null}function Hn(n,t){bn(Un(n),JSON.stringify(t))}function qn(n){yn(Un(n))}function Zn(n){return"SQUARE"===n?"0px":"12px"}function Kn(n){const t=n.colors;return L(null==t?void 0:t.iconColor,L(null==t?void 0:t.buttonBg,L(null==t?void 0:t.bannerBg,E)))}function Gn(n,t){n.style.background=H(t,.12),n.style.color=t}const Jn='<path d="M20 12v9H4v-9M2 7h20v5H2V7Zm10 0V4a2.5 2.5 0 0 0-5 0v3h5Zm0 0V4a2.5 2.5 0 0 1 5 0v3h-5Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/>',Yn='<path d="M9 6l6 6-6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>',Wn='<path d="M12 2.5l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.8 5.9 21.1l1.4-6.8-5.1-4.7 6.9-.8L12 2.5Z" fill="currentColor"/>',Qn='<circle cx="9" cy="8" r="3.2" stroke="currentColor" stroke-width="1.8"/><path d="M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>',Xn='<circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="1.8"/><path d="M12 7v5l3.5 2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>',nt='<path d="M5 13l4.5 4.5L19 8" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>',tt='<circle cx="11" cy="4.6" r="2.3" fill="currentColor"/><rect x="2.2" y="10" width="3" height="6.4" rx="1.5" fill="currentColor"/><path d="M7.4 12.2c2 0 3.4.6 4.6 1.8h2.2a1.6 1.6 0 1 1 0 3.2h-3.4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><path d="M7.4 12.2v7c3.2 1.2 6.2.5 9-2l3.2-2.9a1.7 1.7 0 0 0-2.2-2.6l-3 2.3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>',et="#1E9E5B",ot="rgba(30, 158, 91, 0.12)",rt="#D64545",it="rgba(214, 69, 69, 0.10)",ct="#6B7280",lt="rgba(107, 114, 128, 0.12)";function at(n,t,e){const o=document.createElement("span");return o.className=e?"cnv-panel-icon "+e:"cnv-panel-icon",o.innerHTML=`<svg viewBox="0 0 24 24" fill="none" width="${t}" height="${t}">${n}</svg>`,o}function ut(n,t){const e=document.createElement("div");return e.className="cnv-panel-chip",Gn(e,t),e.appendChild(at(n,14)),e}function st(n,t){const e=document.createElement("span");return e.className="cnv-panel-badge",Gn(e,t),e.textContent=n,e}const dt={POINTS:{label:"Điểm thưởng",icon:Wn},REFERRAL:{label:"Giới thiệu bạn bè",icon:Qn},VIP:{label:"Hạng thành viên (VIP)",icon:'<path d="M3 8l3.2 3 3.6-5.4L12 3l2.2 2.6L17.8 11 21 8l-1.6 10H4.6L3 8Z" fill="currentColor"/>'}},ft={rewards:'<path d="M3 9V6.4c0-.8.6-1.4 1.4-1.4h15.2c.8 0 1.4.6 1.4 1.4V9a3 3 0 0 0 0 6v2.6c0 .8-.6 1.4-1.4 1.4H4.4c-.8 0-1.4-.6-1.4-1.4V15a3 3 0 0 0 0-6Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M14.6 5.6v12.8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-dasharray="2.2 2.6"/>',earn:tt,redeem:Jn,history:Xn},pt={ORDER:'<path d="M4.4 8h15.2l-1.1 12.3H5.5L4.4 8Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M8.7 8V6.3a3.3 3.3 0 0 1 6.6 0V8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>',STAR:Wn,GIFT:Jn,USERS:Qn,CAKE:'<path d="M3.6 20.6h16.8v-5.1c0-1-.8-1.9-1.9-1.9H5.5c-1 0-1.9.8-1.9 1.9v5.1Z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M12 13.6V9.7" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="12" cy="7.5" r="1.8" fill="currentColor"/>',SHARE:'<circle cx="17.8" cy="5.6" r="2.6" stroke="currentColor" stroke-width="1.8"/><circle cx="6.2" cy="12" r="2.6" stroke="currentColor" stroke-width="1.8"/><circle cx="17.8" cy="18.4" r="2.6" stroke="currentColor" stroke-width="1.8"/><path d="M15.5 6.9 8.5 10.7M8.5 13.3l7 3.8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>',COIN:tt,CHECK:nt},ht={earn:{label:"Cách kiếm thêm điểm",icon:tt},redeem:{label:"Cách đổi điểm",icon:Jn}},vt="cnv-panel-reward__title--full",mt="Tham gia ngay",gt=[[ht.earn.label,"earn"],[ht.redeem.label,"redeem"]],bt=[{key:"redeem",label:"Đổi điểm"},{key:"owned",label:"Ưu đãi của bạn"}],yt={INSUFFICIENT_POINTS:{message:"Bạn không đủ điểm để đổi ưu đãi này.",action:"other"},REDEMPTION_LIMIT_EXCEEDED:{message:"Bạn đã đổi ưu đãi này đủ số lượt cho phép.",action:"other"},REWARD_OUT_OF_STOCK:{message:"Ưu đãi này vừa hết. Bạn chọn ưu đãi khác nhé.",action:"other"},REWARD_EXPIRED:{message:"Ưu đãi này đã hết hạn.",action:"other"},LOYALTY_SERVICE_UNAVAILABLE:{message:"Hệ thống điểm đang bận. Bạn thử lại sau ít phút nhé.",action:"retry"},VENDOR_ERROR:{message:"Nhà cung cấp ưu đãi đang bận. Bạn thử lại sau ít phút nhé.",action:"retry"},MISSING_VOUCHER:{message:"Điểm đã được trừ nhưng mã ưu đãi chưa phát kịp. Bạn liên hệ shop để được cấp mã nhé.",action:"none"},MISSING_SERIAL:{message:"Điểm đã được trừ nhưng mã ưu đãi chưa phát kịp. Bạn liên hệ shop để được cấp mã nhé.",action:"none"},UNCONFIRMED:{message:'Chưa xác nhận được kết quả. Điểm có thể đã được trừ — bạn kiểm tra ở tab "Ưu đãi của bạn" trước khi đổi lại nhé.',action:"owned"}},wt={message:"Không đổi được ưu đãi lúc này. Bạn thử lại sau nhé.",action:"retry"},xt={other:"Chọn ưu đãi khác",retry:"Thử lại",owned:"Kiểm tra ưu đãi của bạn",none:""};function _t(n,t){var e;const o=document.createElement("div");var r,i;return o.className=t?"cnv-panel-card__section "+t:"cnv-panel-card__section",o.style.borderRadius=Zn(null===(e=n.shapes)||void 0===e?void 0:e.card),(r=o).style.backgroundColor="DARK"===(i=n.theme)?"#3F4254":"#FFFFFF",r.style.boxShadow="DARK"===i?"none":"0 2px 4px rgba(15, 42, 81, 0.04)",o}function kt(n,t){const e=document.createElement("div");return e.className="cnv-panel-zalo__skeleton",e.style.width=n+"px",e.style.height=t+"px",e}function Mt(n,t){const e=document.createElement("div");e.className="cnv-panel-zalo__corner tl",e.style.borderColor=t;const o=document.createElement("div");o.className="cnv-panel-zalo__corner br",o.style.borderColor=t,n.append(e,o)}function At(n){const t=document.createElement("div");t.className="cnv-panel-vstack";const e=document.createElement("div");e.className="cnv-panel-zalo__qr",e.appendChild(kt(180,180)),Mt(e,n),t.appendChild(e);const o=document.createElement("div");return o.className="cnv-panel-vstack",o.style.gap="6px",o.append(kt(240,14),kt(160,14)),t.appendChild(o),t.appendChild(kt(120,14)),t}function jt(n,t,e,o){const r=document.createElement("div");r.className="cnv-panel-zalo__overlay-bubble";const i=document.createElement("div");i.className="cnv-panel-bubble-icon",i.style.background=e,i.style.color=t,i.appendChild(at(n,20));const c=document.createElement("div");return c.className="cnv-panel-zalo__title",c.textContent=o,r.append(i,c),r}function zt(n,t,e){let o=n,r=null;const i=()=>{null!==r&&(clearInterval(r),r=null)};return!0===t(o)||(r=setInterval(()=>{o-=1,(!0===t(o)||o<=0)&&(i(),e&&e())},1e3)),i}function Ct(n){if(!n)return null;const t=Date.parse(n);if(!Number.isFinite(t))return null;const e=new Date(t),o=n=>String(n).padStart(2,"0");return`${o(e.getDate())}/${o(e.getMonth()+1)}/${e.getFullYear()}`}function St(n){return n instanceof Sn?n.reason:null}function Ot(n){switch(St(n)){case"disabled":return"Đăng nhập bằng Zalo hiện đang tắt.";case"consent-required":return"Cần đồng ý thu thập dữ liệu để đăng nhập bằng Zalo.";case"expired":return"Mã QR đã hết hạn.";case"denied":return"Đăng nhập đã bị từ chối.";case"cancelled":return"Đã huỷ đăng nhập.";default:return"Vui lòng thử lại giúp mình nhé."}}function Tt(n,r){if("undefined"==typeof document||"undefined"==typeof window)return()=>{};try{let i,c,l,a=null,u=null,s=null,d=null,f=null,p=null,h=null,v=null,m=null,g=null,b=null,y=!1,w=null,x=null,_=!1,k=!1,M=!1,A=[],j=0,z=!1,C=null,S=null,O=null,T=!1,I=[],N=0,R=null,F=!1,V=!1,G=bt[0].key,J=[],Y=0,W=!1,X=null,nn=!1,tn=null,en=0,on=0,rn=0,cn=null,ln=null,an=null;const un=n=>{"Escape"===n.key&&ke()};function sn(n){return!_||n!==on}function dn(n,t){return e(()=>{const e=new CustomEvent(n,{detail:{action:t},cancelable:!0});return window.dispatchEvent(e),e.defaultPrevented},!1)}function fn(n){dn("cnv:panel:cta-click",n)}function pn(n){return()=>{y&&n()}}function hn(n,t,e){const o=document.createElement("div");o.className="cnv-panel-section__row",e&&(o.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2");const i=ft[t];if(i){const n=at(i,20);n.style.color=Kn(r),o.appendChild(n)}const c=document.createElement("span");return c.className="cnv-panel-section__row-label",c.textContent=n,o.appendChild(c),o.appendChild(at(Yn,12,"cnv-panel-icon--chevron")),o.addEventListener("click",pn(()=>{dn("cnv:panel:menu-click",t)||("rewards"===t?(k=!0,G=bt[0].key,X=null,ae(),Nt(),An()):"history"===t?(M=!0,ae(),Dt(),A.length||(j=0,Et())):ht[t]&&(C=t,ae(),Ht()))})),o}function vn(){var n,t,e,o;const i=_t(r,"cnv-panel-cta"),c=r.accountCreationCta,l=document.createElement("div");l.className="cnv-panel-cta__title",l.textContent=(null==c?void 0:c.title)||"";const a=document.createElement("div");a.className="cnv-panel-cta__desc",a.textContent=(null==c?void 0:c.description)||"";const u=document.createElement("button");u.type="button",u.className="cnv-panel-cta__btn",u.style.borderRadius=Zn(null===(n=r.shapes)||void 0===n?void 0:n.button),u.style.backgroundColor=L(null===(t=r.colors)||void 0===t?void 0:t.buttonBg,E),u.style.color=L(null===(e=r.colors)||void 0===e?void 0:e.buttonFont,D),u.appendChild(at(Jn,15)),u.appendChild(document.createTextNode(((null==c?void 0:c.createAccountButtonText)||"").trim()||mt)),u.addEventListener("click",pn(()=>{fn("create-account"),ye()})),i.append(l,a,u);const s=((null==c?void 0:c.signInLinkText)||"").trim();if(s){const n=document.createElement("div");n.className="cnv-panel-cta__signin",n.style.color=L(null===(o=r.colors)||void 0===o?void 0:o.linkColor,E),n.appendChild(document.createTextNode(s)),n.appendChild(at(Yn,12,"cnv-panel-icon--chevron")),n.addEventListener("click",pn(()=>{fn("sign-in"),ye()})),i.appendChild(n)}return i}function mn(){var n;const t=r.accountCreationCta,e=((null==t?void 0:t.description)||"").trim()||((null==t?void 0:t.title)||"").trim();if(!e)return null;const o="DARK"===r.theme,i=document.createElement("div");return i.className="cnv-panel-card__section cnv-panel-join-hint",i.style.borderRadius=Zn(null===(n=r.shapes)||void 0===n?void 0:n.card),i.style.backgroundColor=o?"#2A2E44":"#F1F1F4",i.style.color=o?"rgba(255,255,255,.72)":"rgba(24,28,50,.66)",i.textContent=e,i}function gn(){var n,t,e,o;const i=r.accountCreationCta,c="DARK"===r.theme,l=document.createElement("div");l.className="cnv-panel-joinbar",l.style.backgroundColor=c?"#181C32":"#FFFFFF",l.style.borderTop=c?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2";const a=document.createElement("button");a.type="button",a.className="cnv-panel-cta__btn",a.style.borderRadius=Zn(null===(n=r.shapes)||void 0===n?void 0:n.button),a.style.backgroundColor=L(null===(t=r.colors)||void 0===t?void 0:t.buttonBg,E),a.style.color=L(null===(e=r.colors)||void 0===e?void 0:e.buttonFont,D),a.appendChild(at(Jn,15)),a.appendChild(document.createTextNode(((null==i?void 0:i.createAccountButtonText)||"").trim()||mt)),a.addEventListener("click",pn(()=>{fn("create-account"),ye()})),l.appendChild(a);const u=((null==i?void 0:i.signInLinkText)||"").trim();if(u){const n=document.createElement("div");n.className="cnv-panel-cta__signin",n.style.color=L(null===(o=r.colors)||void 0===o?void 0:o.linkColor,E),n.appendChild(document.createTextNode(u)),n.appendChild(at(Yn,12,"cnv-panel-icon--chevron")),n.addEventListener("click",pn(()=>{fn("sign-in"),ye()})),l.appendChild(n)}return l}function bn(){var n;return null!==(n=null==O?void 0:O.points)&&void 0!==n?n:null==w?void 0:w.points}function yn(){if(!(null==w?void 0:w.isMember)||O||T)return;const t=Vn(n.projectId);t&&(T=!0,n.fetchRewardsSummary(t.token).then(n=>{T=!1,n&&(O=n,I=n.rewards.slice(),N=1,y&&ie())}).catch(()=>{T=!1}))}function wn(){return(Array.isArray(r.sections)?r.sections:[]).some(n=>"VIP"===n.type&&n.enabled)}function xn(){const n=null==O?void 0:O.rewardsAvailableCount;return"number"==typeof n&&N?Math.max(0,n-I.length):0}function _n(){if(V||!xn())return;const t=Vn(n.projectId);if(!t)return;const e=N+1;V=!0,k&&Nt(),n.fetchRewardsSummary(t.token,e).then(n=>{V=!1,N=e,n&&(n.rewards.length&&(I=I.concat(n.rewards)),"number"==typeof n.rewardsAvailableCount&&O&&(O=Object.assign(Object.assign({},O),{rewardsAvailableCount:n.rewardsAvailableCount}))),k&&Nt()}).catch(()=>{V=!1,k&&Nt()})}function Mn(n){G!==n&&(G=n,X=null,ae(),Nt(),An())}function An(){"redeem"!==G||J.length||(Y=0,jn())}function jn(){if(W)return;const t=Vn(n.projectId);if(!t)return;const e=Y+1;W=!0,k&&Nt(),n.fetchRedeemableRewards(t.token,e).then(n=>{W=!1,Y=e,n&&("number"==typeof n.total&&(c=n.total),"number"==typeof n.points&&(l=n.points),n.rewards.length&&(J=J.concat(n.rewards))),k&&Nt()}).catch(()=>{W=!1,k&&Nt()})}function zn(){return null!=l?l:bn()}function Cn(){return null!==Vn(n.projectId)}function Sn(n,t,e){const o=document.createElement("div");o.className="cnv-panel-reward__meta",o.textContent=e,n.appendChild(o);const r=document.createElement("button");r.type="button",r.className="cnv-panel-zalo__btn cnv-panel-reward__more",r.textContent="Đăng nhập bằng Zalo",r.style.borderColor=t,r.style.color=t,r.addEventListener("click",pn(ye)),n.appendChild(r)}function On(t,e=!1){const o=t.campaignId;if(nn||"number"!=typeof o)return;const r=Vn(n.projectId);if(!r)return;if(dn("cnv:panel:redeem-click","redeem-confirm"))return;const a=e&&tn?tn:kn();tn=a;const u=++en;nn=!0,X={kind:"confirm",item:t},Nt(),n.redeemReward(r.token,o,a).then(n=>{var e;Tn(u)&&(nn=!1),n.ok&&(tn=null,O=null,I=[],N=0,A=[],i=void 0,j=0,J=[],c=void 0,Y=0,l="number"==typeof(e=n.result).pointsRemaining?e.pointsRemaining:void 0,yn()),k&&Tn(u)&&(X=n.ok?{kind:"success",item:t,result:n.result}:{kind:"error",code:n.code,item:t},Nt())}).catch(()=>{Tn(u)&&(nn=!1),k&&Tn(u)&&(X={kind:"error",code:"UNCONFIRMED",item:t},Nt())})}function Tn(n){return n===en}function In(){X=null,nn=!1,en++}function Nn(n,t,e){const o=document.createElement("div");if(o.className="cnv-panel-reward",t&&(o.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2"),B(n.imageUrl)){const t=document.createElement("img");t.className="cnv-panel-reward__thumb",t.src=n.imageUrl,t.alt="",t.loading="lazy",t.decoding="async",t.addEventListener("error",()=>t.remove()),o.appendChild(t)}const i=document.createElement("div");i.className="cnv-panel-reward__main",i.appendChild(Dn(n.title||"Ưu đãi"));const c="number"==typeof n.useRemain&&n.useRemain>1;if(n.discountValue||c){const t=document.createElement("div");if(t.className="cnv-panel-reward__tags",n.discountValue){const o=document.createElement("span");o.className="cnv-panel-reward__value",Gn(o,e),o.textContent=n.discountValue,t.appendChild(o)}if(c){const e=document.createElement("span");e.className="cnv-panel-reward__uses",e.textContent=`Còn ${n.useRemain} lượt`,t.appendChild(e)}i.appendChild(t)}if(n.code){const t=document.createElement("div");t.className="cnv-panel-reward__code",t.textContent=n.code,i.appendChild(t)}const l=Ct(n.expiredAt);if(l){const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent=`HSD ${l}`,i.appendChild(n)}return o.appendChild(i),o}function Rn(n){const t=document.createElement("div");return t.className="cnv-panel-rtabs",t.setAttribute("role","tablist"),bt.forEach(e=>{const o=e.key===G,r=document.createElement("button");r.type="button",r.className="cnv-panel-rtab"+(o?" cnv-panel-rtab--on":""),r.setAttribute("role","tab"),r.setAttribute("aria-selected",o?"true":"false"),r.textContent=e.label,o&&(r.style.borderBottomColor=n,r.style.color=n),r.addEventListener("click",pn(()=>Mn(e.key))),t.appendChild(r)}),t}function Fn(n){return n.toLocaleString("vi-VN")+" điểm"}function $n(n,t,e){t.length>15?n.style.fontSize=Math.round(.62*e)+"px":t.length>11&&(n.style.fontSize=Math.round(.77*e)+"px")}function En(n,t){const e=document.createElement("div");e.className="cnv-panel-balance";const o=document.createElement("div");o.className="cnv-panel-balance__label",o.textContent="Điểm của bạn";const r=document.createElement("div");r.className="cnv-panel-balance__row";const i=document.createElement("div");i.className="cnv-panel-balance__num",i.style.color=t;const c=n.toLocaleString("vi-VN");i.textContent=c,$n(i,c,26);const l=document.createElement("div");return l.className="cnv-panel-balance__unit",l.textContent="điểm",r.append(i,l),e.append(o,r),e}function Dn(n){const t=document.createElement("div");t.className="cnv-panel-reward__name";const e=document.createElement("div");e.className="cnv-panel-reward__title",e.textContent=n,e.title=n;const o=document.createElement("button");return o.type="button",o.className="cnv-panel-reward__info",o.setAttribute("aria-label","Xem đầy đủ tên ưu đãi"),o.appendChild(at('<circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="1.8"/><path d="M12 10.6v6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="12" cy="7.6" r="1.1" fill="currentColor"/>',14)),o.addEventListener("click",()=>{e.classList.toggle(vt)}),t.append(e,o),t}function Un(n){if("number"!=typeof n.campaignId||"number"!=typeof n.redeemPoints)return"Chưa thể đổi ưu đãi này";if(!1===n.stock)return"Đã hết hàng";if("number"==typeof n.redeemRemain&&n.redeemRemain<=0)return"Bạn đã đạt giới hạn đổi";const t=zn();return"number"==typeof t&&t<n.redeemPoints?`Cần thêm ${Fn(n.redeemPoints-t)}`:null}function Wn(n,t,e){const o=document.createElement("div");if(o.className="cnv-panel-reward",t&&(o.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2"),B(n.imageUrl)){const t=document.createElement("img");t.className="cnv-panel-reward__thumb",t.src=n.imageUrl,t.alt="",t.loading="lazy",t.decoding="async",t.addEventListener("error",()=>t.remove()),o.appendChild(t)}const i=document.createElement("div");if(i.className="cnv-panel-reward__main",i.appendChild(Dn(n.title||"Ưu đãi")),n.discountValue){const t=document.createElement("div");t.className="cnv-panel-reward__tags";const o=document.createElement("span");o.className="cnv-panel-reward__value",Gn(o,e),o.textContent=n.discountValue,t.appendChild(o),i.appendChild(t)}const c=Ct(n.expiredAt);if(c){const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent=`HSD ${c}`,i.appendChild(n)}const l=Un(n);if(l){const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent=l,i.appendChild(n)}o.appendChild(i);const a=document.createElement("div");if(a.className="cnv-panel-reward__side","number"==typeof n.redeemPoints){const t=document.createElement("div");t.className="cnv-panel-reward__price",t.style.color=e,t.textContent=Fn(n.redeemPoints),a.appendChild(t)}const u=document.createElement("button");return u.type="button",u.className="cnv-panel-zalo__btn cnv-panel-reward__cta",u.textContent="Đổi",u.disabled=null!==l||nn,u.disabled||(u.style.borderColor=e,u.style.color=e,u.addEventListener("click",pn(()=>{X={kind:"confirm",item:n},ae(),Nt()}))),a.appendChild(u),o.appendChild(a),o}function Qn(n,t){const e=zn();if("number"==typeof e&&n.appendChild(En(e,t)),!Cn())return void Sn(n,t,"Bạn cần đăng nhập để xem ưu đãi có thể đổi.");if(W&&!J.length)return n.appendChild(kt(200,12)),void n.appendChild(kt(150,12));if(!J.length){const t=document.createElement("div");return t.className="cnv-panel-reward__meta",t.textContent="Hiện chưa có ưu đãi nào để đổi.",void n.appendChild(t)}const o=document.createElement("div");o.className="cnv-panel-reward__list",J.forEach((n,e)=>o.appendChild(Wn(n,e>0,t))),n.appendChild(o);const r="number"==typeof c&&Y?Math.max(0,c-J.length):0;if(r>0||W){const t=document.createElement("button");t.type="button",t.className="cnv-panel-zalo__btn cnv-panel-reward__more",t.disabled=W,t.textContent=W?"Đang tải…":`Xem thêm ${r} ưu đãi`,t.addEventListener("click",pn(jn)),n.appendChild(t)}}function tt(n,t,e){const o=jt(Jn,t,H(t,.12),e.title||"Ưu đãi");if("number"==typeof e.redeemPoints){const n=document.createElement("div");n.className="cnv-panel-redeem__cost",n.style.color=t;const r=Fn(e.redeemPoints);n.textContent=r,$n(n,r,20),o.appendChild(n);const i=zn();if("number"==typeof i){const n=document.createElement("div");n.className="cnv-panel-redeem__sub",n.textContent=`Còn lại ${Fn(i-e.redeemPoints)}`,o.appendChild(n)}}n.appendChild(o);const r=document.createElement("div");r.className="cnv-panel-redeem__actions";const i=document.createElement("button");i.type="button",i.className="cnv-panel-zalo__btn",i.textContent="Hủy",i.disabled=nn,nn||i.addEventListener("click",pn(()=>{X=null,Nt()}));const c=document.createElement("button");c.type="button",c.className="cnv-panel-zalo__btn",c.textContent=nn?"Đang đổi…":"Đổi",c.disabled=nn,nn||(c.style.borderColor=t,c.style.color=t,c.addEventListener("click",pn(()=>On(e)))),r.append(i,c),n.appendChild(r)}function Tt(n,t,e){var o;const r=jt(nt,et,ot,"Đổi thành công"),i=document.createElement("div");if(i.className="cnv-panel-redeem__sub",i.textContent=t.title||"Ưu đãi",r.appendChild(i),e.code){const n=document.createElement("div");n.className="cnv-panel-reward__code",n.textContent=e.code,r.appendChild(n)}else{const n=document.createElement("div");n.className="cnv-panel-redeem__sub",n.textContent='Chưa có mã ngay — bạn kiểm tra ở tab "Ưu đãi của bạn" nhé.',r.appendChild(n)}const c=null!==(o=e.pointsSpent)&&void 0!==o?o:t.redeemPoints,l=[];if("number"==typeof c&&l.push(`Đã dùng ${Fn(c)}`),"number"==typeof e.pointsRemaining&&l.push(`còn lại ${Fn(e.pointsRemaining)}`),l.length){const n=document.createElement("div");n.className="cnv-panel-redeem__sub",n.textContent=l.join(" · "),r.appendChild(n)}if(e.transactionId){const n=document.createElement("div");n.className="cnv-panel-redeem__sub",n.textContent=`Mã giao dịch ${e.transactionId}`,r.appendChild(n)}n.appendChild(r);const a=document.createElement("div");a.className="cnv-panel-redeem__actions";const u=document.createElement("button");u.type="button",u.className="cnv-panel-zalo__btn",u.textContent="Ưu đãi của bạn",u.addEventListener("click",pn(()=>Mn("owned")));const s=document.createElement("button");s.type="button",s.className="cnv-panel-zalo__btn",s.textContent="Đổi tiếp",s.addEventListener("click",pn(()=>{X=null,ae(),Nt(),An()})),a.append(s,u),n.appendChild(a)}function It(n,t,e,o){const r=o&&yt[o]||wt,i="UNCONFIRMED"===o;n.appendChild(jt(i?Xn:Jn,i?ct:rt,i?lt:it,i?"Chưa xác nhận được":"Không đổi được ưu đãi"));const c=document.createElement("div");c.className="cnv-panel-zalo__status",c.textContent=r.message,n.appendChild(c);const l=document.createElement("div");l.className="cnv-panel-redeem__actions";const a=()=>{X=null,ae(),Nt()},u=xt[r.action];if("other"===r.action){const n=document.createElement("button");n.type="button",n.className="cnv-panel-zalo__btn",n.textContent=u,n.addEventListener("click",pn(a)),l.appendChild(n)}else if("owned"===r.action){const n=document.createElement("button");n.type="button",n.className="cnv-panel-zalo__btn",n.textContent=u,n.addEventListener("click",pn(()=>Mn("owned"))),l.appendChild(n)}else{const n=document.createElement("button");if(n.type="button",n.className="cnv-panel-zalo__btn",n.textContent="Về danh sách",n.addEventListener("click",pn(a)),l.appendChild(n),"retry"===r.action){const n=document.createElement("button");n.type="button",n.className="cnv-panel-zalo__btn",n.textContent=u,n.style.borderColor=t,n.style.color=t,n.addEventListener("click",pn(()=>On(e,!0))),l.appendChild(n)}}n.appendChild(l)}function Nt(){if(!h)return;se(),de(),ue(!0),h.textContent="";const n=Kn(r),t=_t(r),e=document.createElement("div");e.className="cnv-panel-section__head",e.appendChild(ut(Jn,n));const o=document.createElement("div");o.className="cnv-panel-section__title",o.textContent="Ưu đãi",e.appendChild(o),t.appendChild(e),t.appendChild(Rn(n)),"redeem"===G?"confirm"===(null==X?void 0:X.kind)?tt(t,n,X.item):"success"===(null==X?void 0:X.kind)?Tt(t,X.item,X.result):"error"===(null==X?void 0:X.kind)?It(t,n,X.item,X.code):Qn(t,n):Rt(t,n),h.appendChild(t),h&&h.querySelectorAll(".cnv-panel-reward__name").forEach(n=>{const t=n.querySelector(".cnv-panel-reward__title");if(!t)return;if(t.clientWidth<=0)return;const e=t.offsetHeight;t.classList.add(vt);const o=t.offsetHeight;t.classList.remove(vt),n.classList.toggle("cnv-panel-reward__name--clamped",o>e+1)})}function Rt(n,t){if(!Cn())return void Sn(n,t,"Bạn cần đăng nhập để xem ưu đãi của bạn.");if(T&&!I.length)return n.appendChild(kt(200,12)),void n.appendChild(kt(150,12));if(!I.length){const t=document.createElement("div");return t.className="cnv-panel-reward__meta",t.textContent="Bạn chưa có ưu đãi nào.",void n.appendChild(t)}const e=document.createElement("div");e.className="cnv-panel-reward__list",I.forEach((n,o)=>e.appendChild(Nn(n,o>0,t))),n.appendChild(e);const o=xn();if(o>0||V){const t=document.createElement("button");t.type="button",t.className="cnv-panel-zalo__btn cnv-panel-reward__more",t.disabled=V,t.textContent=V?"Đang tải…":`Xem thêm ${o} ưu đãi`,t.addEventListener("click",_n),n.appendChild(t)}}function Ft(n){const t="earn"===n?r.earnBlocks:"redeem"===n?r.redeemBlocks:null;return Array.isArray(t)?t.filter(n=>n&&"string"==typeof n.title&&""!==n.title.trim()).slice(0,12):[]}function $t(n,t,e,o){const i=document.createElement("div");i.className="cnv-panel-block",t&&(i.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2");const c=pt[n.icon];i.appendChild(ut("string"==typeof c?c:o,e));const l=document.createElement("div");l.className="cnv-panel-block__main";const a=document.createElement("div");a.className="cnv-panel-block__title",a.textContent=n.title.trim(),l.appendChild(a);const u="string"==typeof n.description?n.description.trim():"";if(u){const n=document.createElement("div");n.className="cnv-panel-block__desc",n.textContent=u,l.appendChild(n)}return i.appendChild(l),i}function Et(){if(z)return;const t=Vn(n.projectId);if(!t)return;const e=j+1;z=!0,M&&Dt(),n.fetchPointHistory(t.token,e).then(n=>{z=!1,j=e,n&&("number"==typeof n.totalCount&&(i=n.totalCount),n.items.length&&(A=A.concat(n.items))),M&&Dt()}).catch(()=>{z=!1,M&&Dt()})}function Dt(){if(!h)return;se(),de(),ue(!0),h.textContent="";const n=Kn(r),t=_t(r);if(t.appendChild(qt({label:"Lịch sử hoạt động",icon:Xn},n)),!A.length&&z)t.appendChild(kt(180,12)),t.appendChild(kt(120,12));else if(A.length){const n=document.createElement("div");n.className="cnv-panel-history__list",A.forEach((t,e)=>n.appendChild(Pt(t,e>0))),t.appendChild(n);const e="number"==typeof i&&j?Math.max(0,i-A.length):0;if(e>0||z){const n=document.createElement("button");n.type="button",n.className="cnv-panel-zalo__btn cnv-panel-reward__more",n.disabled=z,n.textContent=z?"Đang tải…":`Xem thêm ${e} hoạt động`,n.addEventListener("click",pn(Et)),t.appendChild(n)}}else{const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent="Chưa có hoạt động nào.",t.appendChild(n)}h.appendChild(t)}function Pt(n,t){const e=document.createElement("div");e.className="cnv-panel-history__row",t&&(e.style.borderTop="DARK"===r.theme?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2");const o=document.createElement("div");o.className="cnv-panel-history__main";const i=document.createElement("div");i.className="cnv-panel-history__title",i.textContent=(n.title||"").trim()||"Hoạt động",o.appendChild(i);const c=(n.description||"").trim();c&&o.appendChild(Lt(c));const l=[];"number"==typeof n.balanceAfter&&l.push("Điểm tích lũy: "+Ut(n.balanceAfter));const a=(n.rankAfter||"").trim();"number"==typeof n.expBalanceAfter?l.push("Điểm xét hạng: "+Ut(n.expBalanceAfter)+(a?" (Hạng "+a+")":"")):a&&l.push("Hạng "+a),l.length&&o.appendChild(Lt(l.join(" / ")));const u=Vt(n.createdAt);u&&o.appendChild(Lt(u)),e.appendChild(o);const s=document.createElement("div");if(s.className="cnv-panel-history__amounts","number"==typeof n.points){const t=document.createElement("div");t.className="cnv-panel-history__points",t.textContent=Bt(n.points)+" điểm",s.appendChild(t)}if("number"==typeof n.expPoints&&0!==n.expPoints){const t=document.createElement("div");t.className="cnv-panel-history__exp",t.textContent=Bt(n.expPoints)+" xét hạng",s.appendChild(t)}return s.childElementCount&&e.appendChild(s),e}function Lt(n){const t=document.createElement("div");return t.className="cnv-panel-history__meta",t.textContent=n,t}function Bt(n){const t=Math.round(n);return(t>0?"+":"")+t.toLocaleString("vi-VN")}function Ut(n){return Math.round(n).toLocaleString("vi-VN")}function Vt(n){if(!n)return null;const t=new Date(n);return Number.isNaN(t.getTime())?null:t.toLocaleDateString("vi-VN")+" "+t.toLocaleTimeString("vi-VN",{hour:"2-digit",minute:"2-digit"})}function Ht(){if(!h||!C)return;const n=ht[C];if(!n)return C=null,void oe();const t=Ft(C);se(),de(),ue(!0),h.textContent="";const e=Kn(r),o=_t(r);if(o.appendChild(qt(n,e)),t.length){const r=document.createElement("div");r.className="cnv-panel-block__list",t.forEach((t,o)=>r.appendChild($t(t,o>0,e,n.icon))),o.appendChild(r)}else{const n=document.createElement("div");n.className="cnv-panel-reward__meta",n.textContent="redeem"===C?"Shop chưa cập nhật cách đổi điểm. Bạn quay lại sau nhé.":"Shop chưa cập nhật cách kiếm thêm điểm. Bạn quay lại sau nhé.",o.appendChild(n)}if(h.appendChild(o),!le()){const n=mn();n&&h.appendChild(n)}S=le()}function qt(n,t){const e=document.createElement("div");e.className="cnv-panel-section__head",e.appendChild(ut(n.icon,t));const o=document.createElement("div");return o.className="cnv-panel-section__title",o.textContent=n.label,e.appendChild(o),e}function Zt(n){if(!(Array.isArray(r.sections)?r.sections:[]).some(n=>"POINTS"===n.type&&n.enabled))return null;const t=_t(r),e=document.createElement("div");e.className="cnv-panel-section__desc",e.textContent="Kiếm điểm từ nhiều hoạt động, rồi đổi điểm lấy những ưu đãi hấp dẫn.";const o=document.createElement("div");return gt.forEach((n,t)=>o.appendChild(hn(n[0],n[1],t>0))),t.append(qt(dt.POINTS,n),e,o),t}function Kt(n){const t=Math.max(0,Math.round(n)).toLocaleString("vi-VN");return"SPENDING"===(null==R?void 0:R.applyFor)?t+"đ":t+" điểm"}function Gt(n){const t=document.createElement("span");if(t.className="cnv-panel-tier__badge",B(n.iconUrl)){const e=document.createElement("img");return e.className="cnv-panel-tier__badge-img",e.alt="",e.src=n.iconUrl,t.appendChild(e),t}return t.style.backgroundColor=L(n.colorCode,Kn(r)),t}function Jt(n,t){var e,o;const r=document.createElement("div");r.className="cnv-panel-tier__row",t&&r.classList.add("cnv-panel-tier__row--current"),r.appendChild(Gt(n));const i=document.createElement("span");return i.className="cnv-panel-tier__name",i.textContent=t?(null!==(e=n.name)&&void 0!==e?e:"")+" — bạn đang ở đây":null!==(o=n.name)&&void 0!==o?o:"",r.appendChild(i),r}function Yt(n){const t=n.filter(n=>"string"==typeof n&&""!==n.trim());if(!t.length)return null;const e=document.createElement("ul");return e.className="cnv-panel-tier__benefits",t.forEach(n=>{const t=document.createElement("li");t.textContent=n.trim(),e.appendChild(t)}),e}function Wt(n,t){const e=document.createElement("div");return e.className="cnv-panel-tier__more",e.textContent="…và "+n+(t?" hạng cao hơn":" hạng thấp hơn"),e}function Qt(n,t){var e;const o=n.progressTarget,i=null!==(e=n.progressCurrent)&&void 0!==e?e:0;if("number"!=typeof o||o<=0)return null;const c=document.createElement("div");c.className="cnv-panel-tier__progress";const l=document.createElement("div");l.className="cnv-panel-tier__bar",l.style.backgroundColor="DARK"===r.theme?"rgba(255,255,255,.16)":"rgba(24,28,50,.10)";const a=document.createElement("div");a.className="cnv-panel-tier__fill",a.style.backgroundColor=t,a.style.width=Math.max(0,Math.min(100,i/o*100)).toFixed(1)+"%",l.appendChild(a);const u=document.createElement("div");u.className="cnv-panel-tier__hint";const s="number"==typeof n.remaining?n.remaining:o-i;return u.textContent=n.nextLevelName?"Còn "+Kt(s)+" nữa để lên "+n.nextLevelName:"Còn "+Kt(s)+" nữa để lên hạng kế tiếp",c.append(l,u),c}function Xt(n,t){if(t<0)return{from:0,to:Math.min(n.length,4)};const e=Math.max(0,t-1);return{from:e,to:Math.min(n.length,e+4)}}function ne(n,t){var e,o;const i=null!==(e=null==R?void 0:R.tiers)&&void 0!==e?e:[];if(!i.length)return null;const c=_t(r),l=document.createElement("div"),a=t?null==O?void 0:O.tier:void 0;if(null==a?void 0:a.name){const t=document.createElement("div");t.className="cnv-panel-tier__current",t.appendChild(Gt(a));const e=document.createElement("span");e.className="cnv-panel-tier__current-name",e.style.color=n,e.textContent=a.name,t.appendChild(e),l.appendChild(t);const o=Qt(a,n);if(o)l.appendChild(o);else if(a.isHighestLevel){const n=document.createElement("div");n.className="cnv-panel-tier__hint",n.textContent="Bạn đang ở hạng cao nhất.",l.appendChild(n)}}else if(!t){const n=document.createElement("div");n.className="cnv-panel-section__desc",n.textContent="Mua càng nhiều, hạng càng cao, quyền lợi càng nhiều.",l.appendChild(n)}const u=null!=(null==a?void 0:a.id)?i.findIndex(n=>n.id===a.id):-1,{from:s,to:d}=Xt(i,u),f=document.createElement("div");f.className="cnv-panel-tier__list",s>0&&f.appendChild(Wt(s,!1));for(let n=s;n<d;n++){const t=n===u;if(f.appendChild(Jt(i[n],t)),t||u<0){const t=Yt(i[n].benefits);t&&f.appendChild(t)}}const p=Math.max(null!==(o=null==R?void 0:R.totalTiers)&&void 0!==o?o:i.length,i.length)-d;return p>0&&f.appendChild(Wt(p,!0)),l.appendChild(f),c.append(qt(dt.VIP,n),l),c}function te(n,t){const e=dt[n];if(!e||"string"!=typeof e.label)return null;if("VIP"===n)return ne(t,!0);const o=_t(r),i=qt(e,t),c=document.createElement("div");if("POINTS"!==n)return c.appendChild(st("Sắp ra mắt",t)),o.append(i,c),o;const l=bn();if("number"==typeof l&&Number.isFinite(l)){const n=document.createElement("div");n.className="cnv-panel-section__points",n.style.color=t;const e=l.toLocaleString("vi-VN");n.textContent=e,e.length>15&&(n.style.fontSize="20px"),c.appendChild(n)}else c.appendChild(st("Đang cập nhật",t));const a=null!==(u=null==O?void 0:O.rewardsAvailableCount)&&void 0!==u?u:null==w?void 0:w.rewardsAvailableCount;var u;return[["number"==typeof a?`Ưu đãi của bạn — ${a} ưu đãi khả dụng`:"Ưu đãi của bạn","rewards"],...gt,["Lịch sử hoạt động","history"]].forEach((n,t)=>c.appendChild(hn(n[0],n[1],t>0))),o.append(i,c),o}function ee(){if(!f||!p)return;const n=r.colors;u&&(u.style.backgroundColor="DARK"===r.theme?"#181C32":"#FFFFFF",u.style.color="DARK"===r.theme?"#FFFFFF":"#181C32");const t=f.parentElement;if(t&&(t.style.backgroundColor=L(null==n?void 0:n.bannerBg,E),t.style.color=L(null==n?void 0:n.bannerFont,D)),s&&(B(r.bannerImageUrl)?(s.src=r.bannerImageUrl,s.style.display="block"):(s.style.display="none",s.removeAttribute("src"))),d){const t=d.parentElement;B(r.brandIconUrl)?(d.src=r.brandIconUrl,t&&(t.style.display="flex",t.style.background=H(L(null==n?void 0:n.bannerFont,D),.18))):(t&&(t.style.display="none"),d.removeAttribute("src"))}const e=(null==w?void 0:w.isMember)?r.headerMember:r.headerVisitor;f.textContent=(null==e?void 0:e.caption)||"",p.textContent=(null==e?void 0:e.title)||""}function oe(){if(!h||_||k||M||C)return;se(),de(),ue(!0),h.textContent="";const n=Kn(r);if(!(null==w?void 0:w.isMember)){let t=0;re(vn(),t++);const e=Zt(n);e&&re(e,t++);const o=wn()?ne(n,!1):null;return void(o&&re(o,t++))}const t=Array.isArray(r.sections)?[...r.sections]:[];let e=0;t.filter(n=>n.enabled&&"string"==typeof n.type).sort((n,t)=>{var e,o;return(null!==(e=n.order)&&void 0!==e?e:0)-(null!==(o=t.order)&&void 0!==o?o:0)}).forEach(t=>{const o=te(t.type,n);o&&re(o,e++)})}function re(n,t){n.style.animationDelay=40+55*t+"ms",h.appendChild(n)}function ie(){ee(),C?S!==le()&&Ht():oe()}function ce(){O=null,I=[],N=0,k=!1,J=[],c=void 0,Y=0,l=void 0,tn=null,In(),A=[],i=void 0,j=0,M=!1}function le(){return!!(null==w?void 0:w.isMember)}function ae(){h&&(h.scrollTop=0)}function ue(n){u&&(u.style.backgroundImage=n?((n,t)=>{if(!n||"NONE"===n)return"none";const e=((n,t)=>{switch(n){case"WAVES":return`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="24" viewBox="0 0 48 24"><path d="M0 12c6 0 6 8 12 8s6-8 12-8 6 8 12 8 6-8 12-8" fill="none" stroke="${t}" stroke-width="2"/></svg>`;case"CUBES":return`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><rect x="4" y="4" width="14" height="14" fill="none" stroke="${t}" stroke-width="2"/><rect x="22" y="22" width="14" height="14" fill="none" stroke="${t}" stroke-width="2"/></svg>`;case"FUN":return`<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 44 44"><circle cx="8" cy="10" r="2.4" fill="${t}"/><path d="M30 6l1.6 3.4 3.6.4-2.6 2.6.7 3.7-3.3-1.8-3.3 1.8.7-3.7-2.6-2.6 3.6-.4z" fill="${t}"/><circle cx="34" cy="34" r="2.4" fill="${t}"/><circle cx="10" cy="34" r="1.8" fill="${t}"/></svg>`;case"GEOMETRIC":return`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M8 36 16 12l8 24Z" fill="none" stroke="${t}" stroke-width="2"/><circle cx="36" cy="14" r="6" fill="none" stroke="${t}" stroke-width="2"/></svg>`;case"CROSS_HATCHING":return`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0 24 24M0 24 24 0" stroke="${t}" stroke-width="1.4"/></svg>`;default:return""}})(n,t?"rgba(255,255,255,0.16)":"rgba(17,17,17,0.10)");return e?`url("data:image/svg+xml,${encodeURIComponent(e)}")`:"none"})(r.wallpaper,"DARK"===r.theme):"none")}function se(){const n=_||k||M||null!==C;m&&(m.style.display=n?"inline-flex":"none"),v&&v.classList.toggle("cnv-panel-banner--sub",n)}function de(){if(!u)return;const n=!le()&&null!==C;if(n&&!b)return b=gn(),void u.insertBefore(b,g);!n&&b&&(b.remove(),b=null)}function fe(){_&&(he(),_=!1),k=!1,In(),M=!1,C=null,ae(),oe()}function pe(){cn=o(cn)}function he(){ln=o(ln)}function ve(n,t){pe();const e=Date.now()+1e3*t.expiresInSeconds;cn=zt(t.expiresInSeconds,()=>{const t=Math.max(0,Math.round((e-Date.now())/1e3)),o=String(Math.floor(t/60)).padStart(2,"0"),r=String(t%60).padStart(2,"0");return n.textContent=`Hết hạn sau ${o}:${r}`,t<=0})}function me(){if(_=!1,pe(),he(),x){const n=x;x=null,t(()=>n.cancel())}}function ge(){const n=document.createElement("button");return n.type="button",n.className="cnv-panel-zalo__btn",n.textContent="Huỷ",n.addEventListener("click",()=>{me(),ie()}),n}function be(n){var t;if(!h)return;se(),de(),ue(!1),h.textContent="";const e=Kn(r),o=_t(r,"cnv-panel-zalo");if("loading"===n.phase)o.appendChild(At(e)),o.appendChild(ge());else if("qr"===n.phase){const t=(n=>{try{const t=Q(0,"M");t.addData(n),t.make();const e=t.getModuleCount(),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox",`0 0 ${e} ${e}`),o.setAttribute("width",String(180)),o.setAttribute("height",String(180));const r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttribute("width",String(e)),r.setAttribute("height",String(e)),r.setAttribute("fill","#fff"),o.appendChild(r);let i="";for(let n=0;n<e;n++)for(let o=0;o<e;o++)t.isDark(n,o)&&(i+=`M${o} ${n}h1v1h-1z`);const c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",i),c.setAttribute("fill","#000"),o.appendChild(c),o}catch(n){return null}})(n.session.qrPayload);if(t){const n=document.createElement("div");n.className="cnv-panel-zalo__qr cnv-panel-zalo__qr--white",n.appendChild(t),Mt(n,e),o.appendChild(n)}const r=document.createElement("div");r.className="cnv-panel-zalo__status",r.appendChild(document.createTextNode("Mở "));const i=document.createElement("b");i.style.color=e,i.textContent="Zalo",r.appendChild(i),r.appendChild(document.createTextNode(" trên điện thoại và quét mã để đăng nhập")),o.appendChild(r);const c=document.createElement("div");c.className="cnv-panel-zalo__timer",c.appendChild(at(Xn,12));const l=document.createElement("span");c.appendChild(l),o.appendChild(c),ve(l,n.session),o.appendChild(ge())}else{o.style.position="relative",o.appendChild(At(e));const l=document.createElement("div");let a;if(l.className="cnv-panel-zalo__overlay",l.style.borderRadius=Zn(null===(t=r.shapes)||void 0===t?void 0:t.card),l.style.background="DARK"===r.theme?"rgba(63, 66, 84, 0.94)":"rgba(255, 255, 255, 0.94)","success"===n.phase)a=jt(nt,et,ot,n.result.fullName?`Xin chào ${n.result.fullName}!`:"Đăng nhập thành công!");else{const t="expired"===n.reason;a=jt(t?Xn:'<path d="M2 8.5a17 17 0 0 1 20 0M5.5 12.3a11.6 11.6 0 0 1 13 0M9 16a6 6 0 0 1 6 0M3 3l18 18" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>',t?ct:rt,t?lt:it,t?"Mã QR đã hết hạn":"Có lỗi xảy ra");const o=document.createElement("div");if(o.className="cnv-panel-zalo__status",o.textContent=t?'Bấm "Thử lại" để lấy mã mới.':n.message,a.appendChild(o),n.canRetry){const n=document.createElement("button");if(n.type="button",n.className="cnv-panel-zalo__btn",n.style.backgroundColor=e,n.style.borderColor=e,n.style.color="#fff",n.textContent="Thử lại",n.addEventListener("click",pn(()=>ye())),rn>=3){const t=Math.min(5+5*(rn-3),20);i=n,c=t,he(),i.disabled=!0,ln=zt(c,n=>{n>0&&(i.textContent=`Thử lại (${n}s)`)},()=>{i.disabled=!1,i.textContent="Thử lại"})}a.appendChild(n)}}l.appendChild(a),o.appendChild(l)}var i,c;h.appendChild(o)}function ye(){if(!h)return;me(),C=null,_=!0,ae();const e=++on;be({phase:"loading"}),n.loginWithZalo().then(o=>{sn(e)?t(()=>o.cancel()):(x=o,rn=0,be({phase:"qr",session:o}),o.result.then(t=>{sn(e)||(pe(),x=null,be({phase:"success",result:t}),null!=t.contactId&&"string"==typeof t.panelSessionToken&&t.panelSessionToken&&"number"==typeof t.panelSessionExp&&Hn(n.projectId,{token:t.panelSessionToken,contactId:t.contactId,fullName:t.fullName,level:t.level,xp:t.xp,exp:t.panelSessionExp}),w={isMember:!0},yn(),setTimeout(()=>{sn(e)||(_=!1,ie())},1500))}).catch(n=>{sn(e)||(pe(),x=null,be({phase:"error",message:Ot(n),canRetry:!0,reason:St(n)}))}))}).catch(n=>{sn(e)||(rn+=1,be({phase:"error",message:Ot(n),canRetry:!0,reason:St(n)}))})}function we(n){var t,e,o;if(a)return;const i=Z("data-cnv-panel",':host{all:initial;}.cnv-panel-card{position:fixed;display:flex;flex-direction:column;background-repeat:repeat;width:min(360px,calc(100vw - 32px));height:600px;max-height:calc(100vh - 32px);overflow:hidden;box-shadow:0 20px 44px rgba(24,28,50,.22),0 4px 10px rgba(24,28,50,.12);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;font-size:14px;line-height:1.4;animation:cnv-panel-in .34s cubic-bezier(.16,1,.3,1) both;}.cnv-panel-card--leaving{animation:cnv-panel-out .18s cubic-bezier(.4,0,1,1) both;pointer-events:none;}@keyframes cnv-panel-in{from{opacity:0;transform:translateY(14px) scale(.92);}to{opacity:1;transform:none;}}@keyframes cnv-panel-out{from{opacity:1;transform:none;}to{opacity:0;transform:translateY(10px) scale(.96);}}@keyframes cnv-panel-bubble-in{from{opacity:0;transform:translateY(4px) scale(.97);}to{opacity:1;transform:none;}}@keyframes cnv-panel-rise{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}@media (prefers-reduced-motion:reduce){.cnv-panel-card,.cnv-panel-card--leaving,.cnv-panel-card__section,.cnv-panel-zalo__overlay-bubble{animation:none !important;}}.cnv-panel-close{position:absolute;z-index:2;top:10px;right:10px;width:26px;height:26px;border:none;border-radius:999px;background:rgba(0,0,0,.18);color:#fff;cursor:pointer;font-size:16px;display:inline-flex;align-items:center;justify-content:center;line-height:1;padding:0;transition:background .15s;}.cnv-panel-close:hover{background:rgba(0,0,0,.3);}.cnv-panel-back{position:absolute;z-index:2;top:10px;left:10px;width:26px;height:26px;border:none;border-radius:999px;background:rgba(0,0,0,.18);color:#fff;cursor:pointer;padding:0;display:none;align-items:center;justify-content:center;transition:background .15s;}.cnv-panel-back:hover{background:rgba(0,0,0,.3);}.cnv-panel-banner{position:relative;flex:0 0 auto;padding:20px 20px 22px;min-height:160px;margin-bottom:-54px;box-sizing:border-box;overflow:hidden;}.cnv-panel-banner--sub{padding-left:44px;}.cnv-panel-banner__img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.35;display:none;}.cnv-panel-banner__brandchip{position:relative;width:34px;height:34px;border-radius:10px;margin:0 0 10px;display:none;align-items:center;justify-content:center;overflow:hidden;}.cnv-panel-banner__brandicon{width:100%;height:100%;object-fit:cover;display:block;}.cnv-panel-banner__caption{position:relative;font-size:11.5px;opacity:.85;}.cnv-panel-banner__title{position:relative;font-size:26px;font-weight:800;line-height:1.24;margin-top:3px;}.cnv-panel-body{flex:1 1 auto;min-height:0;overflow:hidden auto;overscroll-behavior:contain;padding:16px;display:flex;flex-direction:column;gap:12px;position:relative;z-index:1;scrollbar-width:none;-ms-overflow-style:none;}.cnv-panel-body::-webkit-scrollbar{width:0;height:0;display:none;}.cnv-panel-footer{flex:0 0 auto;padding:11px 16px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:11.5px;font-weight:500;}.cnv-panel-footer__brand{font-weight:800;}.cnv-panel-card__section{padding:16px;box-sizing:border-box;animation:cnv-panel-rise .34s cubic-bezier(.16,1,.3,1) both;}.cnv-panel-chip{width:26px;height:26px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}.cnv-panel-section__head{display:flex;align-items:center;gap:8px;margin-bottom:10px;}.cnv-panel-cta{text-align:center;}.cnv-panel-cta__title{font-size:15px;font-weight:800;margin-bottom:5px;}.cnv-panel-cta__desc{font-size:12.5px;line-height:1.5;opacity:.72;margin-bottom:14px;}.cnv-panel-history__row{display:flex;align-items:flex-start;gap:10px;padding:10px 0;}.cnv-panel-history__main{flex:1;min-width:0;}.cnv-panel-history__title{font-size:13px;font-weight:700;line-height:1.35;}.cnv-panel-history__meta{font-size:11.5px;line-height:1.45;opacity:.66;margin-top:2px;}.cnv-panel-history__amounts{flex:0 0 auto;text-align:right;}.cnv-panel-history__points{font-size:12.5px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap;}.cnv-panel-history__exp{font-size:11px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;opacity:.66;margin-top:2px;}.cnv-panel-join-hint{padding:13px 16px;text-align:center;font-size:12.5px;line-height:1.5;font-weight:600;}.cnv-panel-joinbar{flex:0 0 auto;padding:12px 16px;}.cnv-panel-cta__btn{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;height:40px;border:none;font-weight:700;cursor:pointer;margin-bottom:10px;font-size:13.5px;transition:filter .15s,transform .15s cubic-bezier(.16,1,.3,1);}.cnv-panel-cta__btn:hover{filter:brightness(1.06);transform:translateY(-1px);}.cnv-panel-cta__btn:active{transform:translateY(0) scale(.985);}.cnv-panel-cta__signin{display:flex;align-items:center;justify-content:center;gap:4px;font-size:12.5px;text-align:center;cursor:pointer;font-weight:700;}@media (max-height:560px){.cnv-panel-banner{min-height:96px;margin-bottom:-38px;padding:14px 16px 16px;}.cnv-panel-banner--sub{padding-left:44px;}.cnv-panel-banner__title{font-size:20px;}.cnv-panel-body{padding:12px;gap:8px;}.cnv-panel-joinbar{padding:8px 12px;}.cnv-panel-cta__btn{height:34px;margin-bottom:6px;}.cnv-panel-footer{padding:6px 12px;}}.cnv-panel-icon{display:inline-flex;flex-shrink:0;}.cnv-panel-icon--chevron{transition:transform .15s;}.cnv-panel-cta__signin:hover .cnv-panel-icon--chevron{transform:translateX(2px);}.cnv-panel-section__title{font-size:11.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;opacity:.68;}.cnv-panel-section__points{font-size:28px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1;margin-bottom:6px;}.cnv-panel-section__desc{font-size:12.5px;line-height:1.5;opacity:.72;margin-bottom:4px;}.cnv-panel-section__row{font-size:12.5px;display:flex;align-items:center;gap:10px;padding:10px 0;cursor:pointer;}.cnv-panel-section__row-label{flex:1;min-width:0;}.cnv-panel-section__row:hover .cnv-panel-icon--chevron{transform:translateX(2px);}.cnv-panel-badge{display:inline-flex;align-items:center;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.03em;padding:3px 8px;border-radius:999px;}.cnv-panel-tier__current{display:flex;align-items:center;gap:8px;margin-bottom:10px;}.cnv-panel-tier__current-name{font-size:19px;font-weight:800;line-height:1.2;}.cnv-panel-tier__badge{flex:0 0 auto;width:18px;height:18px;border-radius:999px;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;}.cnv-panel-tier__badge-img{width:100%;height:100%;object-fit:cover;display:block;}.cnv-panel-tier__progress{margin-bottom:8px;}.cnv-panel-tier__bar{height:6px;border-radius:999px;overflow:hidden;}.cnv-panel-tier__fill{height:100%;border-radius:999px;transition:width .35s ease;}.cnv-panel-tier__hint{font-size:12px;line-height:1.5;opacity:.72;}.cnv-panel-tier__list{}.cnv-panel-tier__row{display:flex;align-items:center;gap:8px;font-size:12.5px;padding:7px 0;}.cnv-panel-tier__row--current{font-weight:800;}.cnv-panel-tier__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.cnv-panel-tier__benefits{margin:0 0 6px 26px;padding:0 0 0 14px;font-size:12px;line-height:1.55;opacity:.72;}.cnv-panel-tier__more{font-size:11.5px;padding:5px 0 5px 26px;opacity:.58;}.cnv-panel-zalo{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;min-height:346px;}.cnv-panel-vstack{display:flex;flex-direction:column;align-items:center;gap:8px;}.cnv-panel-zalo__qr{position:relative;padding:10px;border-radius:12px;}.cnv-panel-zalo__qr--white{background:#fff;}.cnv-panel-zalo__qr svg{display:block;}.cnv-panel-zalo__corner{position:absolute;width:16px;height:16px;border:3px solid;border-radius:5px 0 0 0;}.cnv-panel-zalo__corner.tl{top:-3px;left:-3px;border-right:none;border-bottom:none;}.cnv-panel-zalo__corner.br{bottom:-3px;right:-3px;border-left:none;border-top:none;border-radius:0 0 5px 0;}.cnv-panel-zalo__title{font-size:14px;font-weight:800;}.cnv-panel-zalo__status{font-size:12.5px;font-weight:500;line-height:1.45;max-width:250px;}.cnv-panel-zalo__timer{font-size:11.5px;font-weight:700;opacity:.7;font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:5px;}.cnv-panel-reward__list{}.cnv-panel-reward{padding:10px 0;display:flex;gap:10px;align-items:flex-start;}.cnv-panel-reward__main{min-width:0;flex:1;}.cnv-panel-reward__thumb{width:44px;height:44px;flex:none;border-radius:8px;object-fit:cover;background:rgba(127,127,127,.12);}.cnv-panel-reward__title{font-size:13px;font-weight:700;line-height:1.4;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}.cnv-panel-reward__title--full{display:block;-webkit-line-clamp:none;overflow:visible;}.cnv-panel-reward__name{display:flex;align-items:flex-start;gap:4px;}.cnv-panel-reward__name>.cnv-panel-reward__title{flex:1 1 auto;min-width:0;}.cnv-panel-reward__info{display:none;flex:none;padding:0;margin-top:1px;border:none;background:transparent;color:inherit;opacity:.45;cursor:pointer;line-height:0;}.cnv-panel-reward__info:hover{opacity:.85;}.cnv-panel-reward__name--clamped .cnv-panel-reward__info{display:inline-flex;}.cnv-panel-reward__tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;}.cnv-panel-reward__value{font-size:12px;font-weight:800;padding:3px 8px;border-radius:999px;white-space:nowrap;}.cnv-panel-reward__uses{font-size:11.5px;font-weight:600;padding:3px 8px;border-radius:999px;background:rgba(127,127,127,.14);white-space:nowrap;}.cnv-panel-reward__code{font-size:13px;font-weight:800;letter-spacing:.06em;margin-top:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;user-select:all;}.cnv-panel-reward__meta{font-size:11.5px;opacity:.7;margin-top:4px;line-height:1.45;}.cnv-panel-reward__more{width:100%;margin-top:10px;}.cnv-panel-balance{padding:2px 0 8px;}.cnv-panel-balance__label{font-size:11.5px;opacity:.66;margin-bottom:2px;}.cnv-panel-balance__row{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;}.cnv-panel-balance__num{font-size:26px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1;}.cnv-panel-balance__unit{font-size:12.5px;font-weight:700;opacity:.7;}.cnv-panel-rtabs{display:flex;gap:2px;margin:2px 0 2px;border-bottom:1px solid rgba(127,127,127,.22);}.cnv-panel-rtab{flex:1;padding:9px 6px;margin-bottom:-1px;background:transparent;border:none;border-bottom:2px solid transparent;color:inherit;cursor:pointer;font-size:12.5px;font-weight:700;opacity:.6;transition:opacity .15s;font-family:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.cnv-panel-rtab:hover{opacity:.85;}.cnv-panel-rtab--on{opacity:1;font-weight:800;}.cnv-panel-reward__side{flex:0 0 auto;max-width:45%;display:flex;flex-direction:column;align-items:flex-end;gap:6px;}.cnv-panel-reward__price{font-size:12.5px;font-weight:800;font-variant-numeric:tabular-nums;text-align:right;}.cnv-panel-reward__cta{height:30px;padding:0 12px;font-size:12px;}.cnv-panel-redeem__cost{font-size:20px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1;}.cnv-panel-redeem__sub{font-size:11.5px;opacity:.66;line-height:1.45;}.cnv-panel-redeem__actions{display:flex;gap:8px;margin-top:12px;}.cnv-panel-redeem__actions .cnv-panel-zalo__btn{flex:1;}.cnv-panel-block__list{}.cnv-panel-block{padding:11px 0;display:flex;gap:10px;align-items:flex-start;}.cnv-panel-block .cnv-panel-chip{margin-top:1px;}.cnv-panel-block__main{min-width:0;flex:1;}.cnv-panel-block__title{font-size:13px;font-weight:700;line-height:1.4;}.cnv-panel-block__desc{font-size:12px;line-height:1.5;opacity:.72;margin-top:3px;white-space:pre-line;}.cnv-panel-zalo__btn{height:36px;padding:0 16px;border:1px solid rgba(127,127,127,.3);border-radius:10px;background:transparent;color:inherit;font-size:12.5px;font-weight:700;cursor:pointer;transition:filter .15s;}.cnv-panel-zalo__btn:hover:not(:disabled){filter:brightness(1.1);}.cnv-panel-zalo__btn:disabled{opacity:.5;cursor:not-allowed;}.cnv-panel-zalo__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:16px;}.cnv-panel-zalo__overlay-bubble{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;padding:0 8px;max-width:100%;animation:cnv-panel-bubble-in .2s ease;}.cnv-panel-bubble-icon{width:40px;height:40px;border-radius:999px;display:flex;align-items:center;justify-content:center;}.cnv-panel-zalo__skeleton{border-radius:6px;background:rgba(127,127,127,.15);background-image:linear-gradient( 90deg,rgba(127,127,127,.15) 25%,rgba(127,127,127,.32) 37%,rgba(127,127,127,.15) 63% );background-size:400% 100%;animation:cnv-panel-shimmer 1.4s ease infinite;}@keyframes cnv-panel-shimmer{0%{background-position:100% 50%;}100%{background-position:0% 50%;}}@media (prefers-reduced-motion:reduce){.cnv-panel-zalo__skeleton{animation:none;}}');a=i.hostEl;const c=i.shadow;a.style.setProperty("display","none");const l=null!==(t=(null==n?void 0:n.useCustomZIndex)?U(n.zIndex):null)&&void 0!==t?t:$,b=null!==(e=U(l+600))&&void 0!==e?e:$;u=document.createElement("div"),u.className="cnv-panel-card",u.style.zIndex=String(b),u.addEventListener("animationend",n=>{"cnv-panel-out"===n.animationName&&Me()}),u.style.borderRadius=Zn(null===(o=r.shapes)||void 0===o?void 0:o.container);const y=document.createElement("button");y.type="button",y.className="cnv-panel-close",y.setAttribute("aria-label","Đóng"),y.textContent="×",y.addEventListener("click",ke),m=document.createElement("button"),m.type="button",m.className="cnv-panel-back",m.setAttribute("aria-label","Quay lại"),m.appendChild(at('<path d="M15 6l-6 6 6 6" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>',15)),m.addEventListener("click",pn(fe));const w=document.createElement("div");v=w,w.className="cnv-panel-banner",s=document.createElement("img"),s.className="cnv-panel-banner__img",s.alt="",d=document.createElement("img"),d.className="cnv-panel-banner__brandicon",d.alt="";const x=document.createElement("div");x.className="cnv-panel-banner__brandchip",x.appendChild(d),f=document.createElement("div"),f.className="cnv-panel-banner__caption",p=document.createElement("div"),p.className="cnv-panel-banner__title",w.append(s,x,f,p),h=document.createElement("div"),h.className="cnv-panel-body",u.append(y,m,w,h),g=xe(),g&&u.appendChild(g),c.appendChild(u),K(a)}function xe(){if(r.hideBranding)return null;const n="DARK"===r.theme,t=document.createElement("div");t.className="cnv-panel-footer",t.style.backgroundColor=n?"#181C32":"#FFFFFF",t.style.borderTop=n?"1px solid rgba(255,255,255,.12)":"1px solid #F1F1F2",t.style.color=n?"rgba(255,255,255,.62)":"rgba(24,28,50,.58)",t.appendChild(document.createTextNode("Cung cấp bởi "));const e=document.createElement("span");return e.className="cnv-panel-footer__brand",e.textContent="CNV Loyalty",t.appendChild(e),t}function _e(n){if(!u)return;const{side:t,sideSpacingPx:e,bottomSpacingPx:o}=q(n,P());u.style.left="left"===t?e+"px":"auto",u.style.right="right"===t?e+"px":"auto";const r=o+48+24;u.style.bottom=r+"px",u.style.maxHeight=`calc(100vh - ${r+16}px)`,u.style.transformOrigin="left"===t?"left bottom":"right bottom"}function ke(){a&&y&&(y=!1,me(),k=!1,In(),M=!1,C=null,document.removeEventListener("keydown",un),je("cnv:panel:closed"),u&&!e(()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,!1)?(u.classList.add(Bn),an=setTimeout(Me,320)):Me())}function Me(){null!==an&&(clearTimeout(an),an=null),null==u||u.classList.remove(Bn),null==a||a.style.setProperty("display","none")}function Ae(){null!==an&&(clearTimeout(an),an=null),null==u||u.classList.remove(Bn)}function je(n){t(()=>window.dispatchEvent(new CustomEvent(n)))}const ze=e=>{t(()=>{var t;const o=e.detail;var r;y?ke():(we(r=null!==(t=null==o?void 0:o.config)&&void 0!==t?t:null),a&&(Ae(),_e(r),a.style.setProperty("display","block"),y=!0,ie(),yn(),!wn()||R||F||(F=!0,n.fetchPanelTiers().then(n=>{F=!1,n&&n.tiers.length&&(R=n,y&&ie())}).catch(()=>{F=!1})),document.addEventListener("keydown",un),je("cnv:panel:opened")))})},Ce=n=>{t(()=>{const t=n.detail;w=(null==t?void 0:t.isMember)?{isMember:!0,points:t.points,rewardsAvailableCount:t.rewardsAvailableCount}:{isMember:!1},w.isMember||ce(),y&&ie(),y&&yn()})};function Se(){const t=Vn(n.projectId);t&&(Date.now()>t.exp?qn(n.projectId):(w={isMember:!0},ie(),n.restorePanelSession(t.token).then(e=>{e?(w={isMember:!0},Hn(n.projectId,Object.assign(Object.assign({},t),{fullName:e.fullName,level:e.level,xp:e.xp}))):(qn(n.projectId),w={isMember:!1},ce()),ie()}).catch(()=>{})))}return window.addEventListener(Pn,ze),window.addEventListener(Ln,Ce),Se(),()=>{me(),t(()=>{window.removeEventListener(Pn,ze),window.removeEventListener(Ln,Ce),document.removeEventListener("keydown",un),Ae(),null==a||a.remove()})}}catch(Oe){return()=>{}}}const It={path:"/config",timeoutMs:4e3,ttlMs:3e5};function Nt(n,t){var e,o;const r=null!=t?t:Object.assign({enabled:!0},It);return void 0===n?Object.assign({},r):!0===n?Object.assign(Object.assign({},r),{enabled:!0}):!1===n?Object.assign(Object.assign({},r),{enabled:!1}):{enabled:null===(e=n.enabled)||void 0===e||e,path:null!==(o=n.path)&&void 0!==o?o:r.path,timeoutMs:"number"==typeof n.timeoutMs?n.timeoutMs:r.timeoutMs,ttlMs:"number"==typeof n.ttlMs?n.ttlMs:r.ttlMs}}function Rt(n){return"_cnv_cfg_"+n}function Ft(n){const t=gn(Rt(n));if(!t)return null;try{const n=JSON.parse(t);return n&&"object"==typeof n&&n.envelope?n:null}catch(n){return null}}function $t(n,t,e){try{const o={etag:t,envelope:e,fetchedAt:Date.now()};bn(Rt(n),JSON.stringify(o))}catch(n){}}function Et(n){const t=Ft(n);return!t||!1!==(null===(o=null==(e=t.envelope)?void 0:e.zaloQrLogin)||void 0===o?void 0:o.enabled);var e,o}const Dt=["gclid","fbclid","ttclid","msclkid","dclid"],Pt=[["utm_source","source"],["utm_medium","medium"],["utm_campaign","name"],["utm_term","term"],["utm_content","content"],["utm_id","id"]];function Lt(){const n=e(()=>window.location.href,"");let t="",o="",r="";if(n)try{const e=new URL(n);t=e.pathname,o=e.search,r=e.hash}catch(n){}return{url:n,path:t,search:o,hash:r,title:e(()=>document.title,""),referrer:e(()=>document.referrer,"")}}function Bt(n,t=!0){const o=e(()=>window.location.search,"");if(!o)return;let r;try{r=new URLSearchParams(o)}catch(n){return}const i={};let c=!1;for(const[n,t]of Pt){const e=r.get(n);e&&e.length>0&&(i[t]=e,c=!0)}if(t){const n={};for(const t of Dt){const e=r.get(t);e&&e.length>0&&(n[t]=e)}Object.keys(n).length>0&&(i.clickIds=n,c=!0)}return c?i:void 0}function Ut(n){var t,e;let o="@cnv-vn/track",r="0.0.0-dev";try{o="@cnv-vn/track"}catch(n){}try{r="0.3.0-beta.2"}catch(n){}return{name:null!==(t=null==n?void 0:n.name)&&void 0!==t?t:o,version:null!==(e=null==n?void 0:n.version)&&void 0!==e?e:r}}function Vt(n){if(n)try{const t=new URL(n);if("http:"!==t.protocol&&"https:"!==t.protocol)return;return t.origin+t.pathname}catch(n){return}}const Ht=256;function qt(n,t){if("string"!=typeof n)return;const e=n.trim();return e?e.length>t?e.slice(0,t):e:void 0}function Zt(n){return"_cnv_ft_"+n}function Kt(n){const t=gn(Zt(n));if(!t)return null;const o=e(()=>(n=>{if(!n||"object"!=typeof n)return null;const t=n;if("number"!=typeof t.ts||!Number.isFinite(t.ts))return null;const e={ts:t.ts},o=qt(t.source,Ht);o&&(e.source=o);const r=qt(t.medium,Ht);r&&(e.medium=r);const i=qt(t.name,Ht);i&&(e.name=i);const c=qt(t.term,Ht);c&&(e.term=c);const l=qt(t.content,Ht);l&&(e.content=l);const a=qt(t.id,Ht);a&&(e.id=a);const u=qt(t.referrer,1024);u&&(e.referrer=u);const s=qt(t.landingPage,1024);if(s&&(e.landingPage=s),t.clickIds&&"object"==typeof t.clickIds){const n={};for(const[e,o]of Object.entries(t.clickIds)){if(Object.keys(n).length>=8)break;const t=qt(e,Ht),r=qt(o,Ht);t&&r&&(n[t]=r)}Object.keys(n).length>0&&(e.clickIds=n)}return 1===Object.keys(e).length?null:e})(JSON.parse(t)),null);if(!o)return yn(Zt(n)),null;const r=Date.now()-o.ts;return r>63072e6||r<-864e5?(yn(Zt(n)),null):o}function Gt(n,t=!0){const e={first_seen_at:n.ts};return n.source&&(e.utm_source=n.source),n.medium&&(e.utm_medium=n.medium),n.name&&(e.utm_campaign=n.name),n.term&&(e.utm_term=n.term),n.content&&(e.utm_content=n.content),n.id&&(e.utm_id=n.id),n.clickIds&&t&&(e.click_ids=n.clickIds),n.referrer&&(e.referrer=n.referrer),n.landingPage&&(e.landing_page=n.landingPage),e}const Jt="_cnv_cid";function Yt(n={}){const t=hn(Jt),e=gn(Jt);let o=null;return An(t)?o=t:An(e)&&(o=e),o||(o=kn()),Wt(o,n),o}function Wt(n,t={}){var e;vn(Jt,n,{domain:t.cookieDomain,maxAgeDays:null!==(e=t.cookieMaxAgeDays)&&void 0!==e?e:730,sameSite:"Lax"}),bn(Jt,n)}const Qt="1.0";function Xt(){return(new Date).toISOString()}function ne(n,t){var e;const o=null!==(e=t.timestamp)&&void 0!==e?e:Xt(),r=Object.assign(Object.assign({},t.context),{projectId:t.projectId,schemaVersion:Qt}),i={type:n,messageId:kn(),anonymousId:t.anonymousId,timestamp:o,originalTimestamp:o,context:r};return t.userId&&(i.userId=t.userId),t.sessionId&&(i.sessionId=t.sessionId),t.integrations&&(i.integrations=t.integrations),i}const te="_cnv_sid";function ee(n){if(!n)return null;const t=n.lastIndexOf(".");if(t<0)return null;const e=n.slice(0,t),o=Number(n.slice(t+1));return!An(e)||!Number.isFinite(o)||o<=0?null:{id:e,lastActivity:o}}function oe(n={}){const t=Date.now(),e=(n=>{var t;return 6e4*(null!==(t=n.timeoutMinutes)&&void 0!==t?t:30)})(n),o=ee(hn(te)),r=ee((n=>{if(!wn())return null;try{return sessionStorage.getItem(n)}catch(n){return null}})(te));let i=null;for(const n of[o,r])n&&(t-n.lastActivity>e||(!i||n.lastActivity>i.lastActivity)&&(i=n));const c=i?{id:i.id,lastActivity:t}:{id:kn(),lastActivity:t};return re(c,n),c.id}function re(n,t={}){var e;const o=(n=>`${n.id}.${n.lastActivity}`)(n),r=null!==(e=t.timeoutMinutes)&&void 0!==e?e:30;vn(te,o,{domain:t.cookieDomain,maxAgeDays:r/1440,sameSite:"Lax"}),((n,t)=>{if(!wn())return!1;try{return sessionStorage.setItem(n,t),!0}catch(n){return!1}})(te,o)}class ie{constructor(n){var t,e;Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"flushing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"onlineHandler",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.storageKey=null!==(t=n.storageKey)&&void 0!==t?t:"_cnv_rq",this.maxMessages=null!==(e=n.maxMessages)&&void 0!==e?e:100,this.installOnlineListener()}stash(n){if(n&&0!==n.length)try{const t=this.read();for(t.push(n);t.length>1&&ce(t)>this.maxMessages;)t.shift();this.write(t),this.config.debug&&console.log("[cnv-track] retry queued",n.length,"buffered",ce(t))}catch(n){}}flush(){if(this.flushing||"undefined"!=typeof navigator&&!1===navigator.onLine)return Promise.resolve();const n=this.read();if(0===n.length)return Promise.resolve();this.flushing=!0,this.write([]);const t=()=>{this.flushing=!1};return n.reduce((n,t)=>n.then(()=>this.config.resend(t)),Promise.resolve()).then(t,t)}size(){return ce(this.read())}clear(){try{yn(this.storageKey)}catch(n){}}destroy(){if(this.onlineHandler){try{window.removeEventListener("online",this.onlineHandler)}catch(n){}this.onlineHandler=null}}installOnlineListener(){if("undefined"==typeof window)return;const n=()=>{this.flush()};try{window.addEventListener("online",n),this.onlineHandler=n}catch(n){}}read(){const n=gn(this.storageKey);if(!n)return[];try{const t=JSON.parse(n);return Array.isArray(t)?t.filter(n=>Array.isArray(n)&&n.length>0):[]}catch(n){return[]}}write(n){0!==n.length?bn(this.storageKey,JSON.stringify(n)):yn(this.storageKey)}}function ce(n){let t=0;for(const e of n)t+=e.length;return t}class le{constructor(n){Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"buffer",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"destroyed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"retryQueue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.retryQueue=new ie({debug:n.debug,resend:n=>this.send(n)}),this.installPageLifecycleHandlers(),this.retryQueue.flush()}setConfig(n){this.config=Object.assign(Object.assign({},this.config),n)}enqueue(n){this.destroyed||(this.buffer.push(n),this.buffer.length>=this.config.flushAt?this.flush():this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.flush()},this.config.flushInterval)))}flush(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),0===this.buffer.length)return Promise.resolve();const n=this.buffer;return this.buffer=[],this.send(n)}bufferedCount(){return this.buffer.length}destroy(){this.destroyed||(this.destroyed=!0,this.timer&&(clearTimeout(this.timer),this.timer=null),this.uninstallPageLifecycleHandlers(),this.retryQueue.destroy())}send(n){try{return this.config.useBatch?this.sendBatch(n):Promise.all(n.map(n=>this.sendSingle(n))).then(()=>{})}catch(n){return this.config.debug&&console.warn("[cnv-track] send failed synchronously; dropped batch",n),Promise.resolve()}}sendBatch(n){var t;const e=Xt(),o={batch:n.map(n=>ae(n,e)),context:Object.assign(Object.assign({},null!==(t=this.config.batchContext)&&void 0!==t?t:{}),{projectId:this.config.projectId,sentAt:e}),sentAt:e};return this.post(this.batchUrl(),o,n)}sendSingle(n){const t=ae(n,Xt());return this.post(this.singleUrl(n.type),t,[n])}batchUrl(){return this.config.endpoint+this.config.batchPath+"?projectId="+encodeURIComponent(this.config.projectId)}singleUrl(n){const t=this.config.singlePath.replace("{type}",n);return this.config.endpoint+t+"?projectId="+encodeURIComponent(this.config.projectId)}post(n,t,e){const o=JSON.stringify(t),r=((n,t)=>{try{return new Blob([n],{type:t})}catch(n){return null}})(o,this.config.contentType),i=r?r.size:(n=>{try{return new Blob([n]).size}catch(t){return n.length}})(o),c=i>65536?null:e;return c&&"undefined"!=typeof navigator&&!1===navigator.onLine?(this.retryQueue.stash(c),this.config.debug&&console.log("[cnv-track] offline; queued for retry",n),Promise.resolve()):r&&this.sendViaBeacon(n,r)?(this.config.debug&&console.log("[cnv-track] beacon",n),Promise.resolve()):this.sendViaFetch(n,o,c)}sendViaBeacon(n,t){if("undefined"==typeof navigator||"function"!=typeof navigator.sendBeacon)return!1;if(t.size>65536)return!1;try{return navigator.sendBeacon(n,t)}catch(n){return!1}}sendViaFetch(n,t,e){return"function"!=typeof fetch?(this.config.debug&&console.warn("[cnv-track] no transport available; queued for retry"),e&&this.retryQueue.stash(e),Promise.resolve()):fetch(n,{method:"POST",headers:{"Content-Type":this.config.contentType},body:t,keepalive:!0,credentials:"omit",mode:"cors"}).then(t=>{this.config.debug&&console.log("[cnv-track] fetch flushed",n,t.status)}).catch(t=>{this.config.debug&&console.warn("[cnv-track] flush failed; queued for retry",n,t),e&&this.retryQueue.stash(e)})}installPageLifecycleHandlers(){if("undefined"==typeof window||"undefined"==typeof document)return;const n=()=>{this.flush()},t=()=>{"hidden"===document.visibilityState&&this.flush()};try{window.addEventListener("pagehide",n),document.addEventListener("visibilitychange",t),this.handlers={pagehide:n,visibility:t}}catch(n){}}uninstallPageLifecycleHandlers(){if(this.handlers){try{window.removeEventListener("pagehide",this.handlers.pagehide),document.removeEventListener("visibilitychange",this.handlers.visibility)}catch(n){}this.handlers=null}}}function ae(n,t){return Object.assign(Object.assign({},n),{sentAt:t})}const ue="_cnv_uid",se="_cnv_traits";function de(){return hn(ue)||gn(ue)}const fe={endpoint:"https://tracking.cnvcdp.com/js/v1",batchPath:"/batch",singlePath:"/{type}",useBatch:!0,contentType:"text/plain",debug:!1,allowAdTracking:!0,cookieMaxAgeDays:730,sessionTimeoutMinutes:30,flushAt:20,flushInterval:5e3,autoPageview:!0,autotrack:!1,integrations:{},remoteConfig:Nt(void 0)},pe={analytics:!0,marketing:!0};function he(n,t){if(!Array.isArray(t)||0===t.length)return;const e=t;try{switch(e[0]){case"init":n.init(e[1],e[2]);break;case"pageview":n.pageview(e[1],e[2]);break;case"page":n.page(e[1],e[2]);break;case"screen":n.screen(e[1],e[2]);break;case"track":n.track(e[1],e[2]);break;case"identify":n.identify(e[1],e[2]);break;case"alias":n.alias(e[1],e[2]);break;case"group":n.group(e[1],e[2]);break;case"reset":n.reset();break;case"flush":n.flush();break;case"consent":n.consent(e[1]);break;case"set":n.set(e[1])}}catch(n){}}const ve="0.3.0-beta.2",me="@cnv-vn/track",ge=function(){let n=null,a=Object.assign({},fe),u=Object.assign({},pe),s=null,d=!1,f=null;function p(n,t){let e=null,r=null;return{apply(i,c){e&&null!==c&&c===r||(e=o(e),r=c,i&&(e=n(t(),i)))},dispose(){e=o(e),r=null}}}let h=null;const v=()=>h,m=p(k,v),g=p(W,v),b=p(Tt,v);function y(n){const t=Object.assign({},a);return n?(void 0!==n.endpoint&&(t.endpoint=(e=n.endpoint).endsWith("/")?e.slice(0,-1):e),void 0!==n.batchPath&&(t.batchPath=n.batchPath),void 0!==n.singlePath&&(t.singlePath=n.singlePath),void 0!==n.useBatch&&(t.useBatch=n.useBatch),void 0!==n.contentType&&(t.contentType=n.contentType),void 0!==n.debug&&(t.debug=n.debug),void 0!==n.allowAdTracking&&(t.allowAdTracking=n.allowAdTracking),void 0!==n.cookieDomain&&(t.cookieDomain=n.cookieDomain),void 0!==n.cookieMaxAgeDays&&(t.cookieMaxAgeDays=n.cookieMaxAgeDays),void 0!==n.sessionTimeoutMinutes&&(t.sessionTimeoutMinutes=n.sessionTimeoutMinutes),void 0!==n.flushAt&&(t.flushAt=n.flushAt),void 0!==n.flushInterval&&(t.flushInterval=n.flushInterval),void 0!==n.autoPageview&&(t.autoPageview=n.autoPageview),void 0!==n.autotrack&&(t.autotrack=n.autotrack),void 0!==n.integrations&&(t.integrations=n.integrations),void 0!==n.remoteConfig&&(t.remoteConfig=Nt(n.remoteConfig,a.remoteConfig)),t):t;var e}function w(){return s||(s=new le({endpoint:a.endpoint,batchPath:a.batchPath,singlePath:a.singlePath,useBatch:a.useBatch,contentType:a.contentType,flushAt:a.flushAt,flushInterval:a.flushInterval,projectId:null!=n?n:"",debug:a.debug}),s)}function x(){var t;if(!n)return null;const o=((n={})=>{var t;const o={page:Lt(),screen:{width:e(()=>window.screen.width,0),height:e(()=>window.screen.height,0),density:e(()=>window.devicePixelRatio||1,1)},locale:e(()=>navigator.language||"",""),timezone:e(()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"",""),userAgent:e(()=>navigator.userAgent||"",""),library:Ut(n.library)},r=Bt(0,null===(t=n.allowAdTracking)||void 0===t||t);return r&&(o.campaign=r),o})({allowAdTracking:a.allowAdTracking});return u.analytics&&u.marketing||(o.consent=Object.assign({},u)),{anonymousId:Yt({cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays}),sessionId:oe({cookieDomain:a.cookieDomain,timeoutMinutes:a.sessionTimeoutMinutes}),userId:null!==(t=de())&&void 0!==t?t:void 0,context:o,projectId:n,integrations:Object.keys(a.integrations).length>0?a.integrations:void 0}}function _(n){a.debug&&console.warn(`[cnv-track] ${n}() called before init()`)}function M(n,t){try{const e=x();if(!e)return _("pageview");(n=>{const t=Kt(n.projectId);t&&(n.context.firstTouch=Gt(t,a.allowAdTracking))})(e);const o=((n,t,e)=>{const o=ne("page",e);return n&&(o.name=n),o.properties=null!=t?t:{},o})(n,((n,t)=>{const e={};return n&&(n.url&&(e.url=n.url),n.path&&(e.path=n.path),n.title&&(e.title=n.title),n.referrer&&(e.referrer=n.referrer),n.search&&(e.search=n.search)),Object.assign(Object.assign({},e),null!=t?t:{})})(e.context.page,t),e);w().enqueue(o)}catch(n){}}function A(n,t){M(n,t)}function j(n,t){try{if("string"!=typeof n||0===n.length)return;const e=x();if(!e)return _("track");const o=((n,t,e)=>{const o=ne("track",e);return o.event=n,o.properties=null!=t?t:{},o})(n,t,e);w().enqueue(o)}catch(n){}}function z(n,t){try{if("string"!=typeof n||0===n.length)return;((n,t,e={})=>{var o,r;if(n&&(vn(ue,n,{domain:e.cookieDomain,maxAgeDays:null!==(o=e.cookieMaxAgeDays)&&void 0!==o?o:730,sameSite:"Lax"}),bn(ue,n),null!=t)){const n=null!==(r=(()=>{const n=gn(se);if(!n)return null;try{const t=JSON.parse(n);return t&&"object"==typeof t&&!Array.isArray(t)?t:null}catch(n){return null}})())&&void 0!==r?r:{},e=Object.assign(Object.assign({},n),t);try{bn(se,JSON.stringify(e))}catch(n){}}})(n,t,{cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays});const e=x();if(!e)return _("identify");const o=((n,t,e)=>{var o;const r=ne("identify",e);return n&&(r.userId=n),r.traits=null!==(o=t)&&void 0!==o?o:{},r})(n,t,e);w().enqueue(o)}catch(n){}}function C(n,t){}return{get initialized(){return d},get projectId(){return n},get endpoint(){return a.endpoint},isZaloQrLoginEnabled:()=>!!n&&Et(n),get consentGranted(){return u.analytics&&u.marketing},init(p,v){var x,_;try{if(!p||"string"!=typeof p)return;a=y(v),(null==v?void 0:v.consent)&&(u=Object.assign(Object.assign({},u),v.consent)),n=p,s&&s.destroy(),s=null,w(),d=!0,Yt({cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays}),oe({cookieDomain:a.cookieDomain,timeoutMinutes:a.sessionTimeoutMinutes}),((n,t=!0,o)=>{const r=Kt(n);if(r)return r;const i=Bt(0,t),c=(n=>{const t=e(()=>document.referrer,"");if(t){try{const o=new URL(t).host;if(o===e(()=>window.location.host,""))return;const r=n?n.replace(/^\./,"").toLowerCase():"";if(r){const n=o.toLowerCase();if(n===r||n.endsWith("."+r))return}}catch(n){return}return Vt(t)}})(o);if(!i&&!c)return null;const l=Object.assign(Object.assign({},null!=i?i:{}),{referrer:c,landingPage:Vt(e(()=>window.location.href,"")),ts:Date.now()});bn(Zt(n),JSON.stringify(l))})(p,a.allowAdTracking,a.cookieDomain),a.autoPageview&&M(),f=o(f);const S={page(n,t){return A(n,t)},track(n,t){return j(n,t)},loginWithZalo(t){return Dn({projectId:n,endpoint:a.endpoint,zaloQrLoginEnabled:!!n&&Et(n),consentGranted:u.analytics&&u.marketing,identify:z,alias:C,getUserId:de,getAttribution(){const t=n?Kt(n):null;return t?Gt(t,a.allowAdTracking):null},getAnonymousId(){return Yt({cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays})},getSessionId(){return oe({cookieDomain:a.cookieDomain,timeoutMinutes:a.sessionTimeoutMinutes})}},t)},projectId:n,restorePanelSession(t){return n?function(n,t,e){return jn(this,void 0,void 0,function*(){const o="undefined"!=typeof AbortController?new AbortController:null,r=o?setTimeout(()=>o.abort(),8e3):null;try{const r=yield fetch(On(n,"/panel/session",t),{method:"GET",credentials:"omit",mode:"cors",headers:{Authorization:`Bearer ${e}`},signal:o?o.signal:void 0});if(!r.ok)return null;const i=yield r.json();return i&&"number"==typeof i.contactId?{contactId:i.contactId,fullName:"string"==typeof i.fullName?i.fullName:void 0,level:"string"==typeof i.level?i.level:void 0,xp:"number"==typeof i.xp?i.xp:void 0}:null}catch(n){return null}finally{r&&clearTimeout(r)}})}(a.endpoint,n,t):Promise.resolve(null)},fetchRewardsSummary(t,e){return n?function(n,t,e){return jn(this,arguments,void 0,function*(n,t,e,o=1){const r="undefined"!=typeof AbortController?new AbortController:null,i=r?setTimeout(()=>r.abort(),zn):null;try{const i=On(n,"/panel/rewards-summary",t),c=o>1?`${i}${i.includes("?")?"&":"?"}page=${o}`:i,l=yield fetch(c,{method:"GET",credentials:"omit",mode:"cors",headers:{Authorization:`Bearer ${e}`},signal:r?r.signal:void 0});return l.ok?(n=>{if(!n||"object"!=typeof n)return null;const t=n,e=Array.isArray(t.rewards)?t.rewards.filter(n=>!!n&&"object"==typeof n).map(En):[];return{points:"number"==typeof t.points&&Number.isFinite(t.points)?t.points:void 0,rewardsAvailableCount:"number"==typeof t.rewardsAvailableCount&&Number.isFinite(t.rewardsAvailableCount)?t.rewardsAvailableCount:void 0,rewards:e,tier:t.tier&&"object"==typeof t.tier?$n(t.tier):void 0}})(yield l.json()):null}catch(n){return null}finally{i&&clearTimeout(i)}})}(a.endpoint,n,t,e):Promise.resolve(null)},fetchPanelTiers(){return n?function(n,t){return jn(this,void 0,void 0,function*(){const e="undefined"!=typeof AbortController?new AbortController:null,o=e?setTimeout(()=>e.abort(),zn):null;try{const o=yield fetch(On(n,"/panel/tiers",t),{method:"GET",credentials:"omit",mode:"cors",signal:e?e.signal:void 0});return o.ok?(n=>{if(!n||"object"!=typeof n)return null;const t=n,e=Array.isArray(t.tiers)?t.tiers.filter(n=>!!n&&"object"==typeof n).map(Fn):[];return{applyFor:"SPENDING"===t.applyFor||"POINTS"===t.applyFor?t.applyFor:void 0,thresholdKind:"RELATIVE"===t.thresholdKind||"ABSOLUTE"===t.thresholdKind?t.thresholdKind:void 0,totalTiers:Rn(t.totalTiers),tiers:e}})(yield o.json()):null}catch(n){return null}finally{o&&clearTimeout(o)}})}(a.endpoint,n):Promise.resolve(null)},fetchPointHistory(t,e){return n?function(n,t,e){return jn(this,arguments,void 0,function*(n,t,e,o=1){const r="undefined"!=typeof AbortController?new AbortController:null,i=r?setTimeout(()=>r.abort(),zn):null;try{const i=On(n,"/panel/point-history",t),c=o>1?`${i}${i.includes("?")?"&":"?"}page=${o}`:i,l=yield fetch(c,{method:"GET",credentials:"omit",mode:"cors",headers:{Authorization:`Bearer ${e}`},signal:r?r.signal:void 0});return l.ok?(n=>{if(!n||"object"!=typeof n)return null;const t=n,e=Array.isArray(t.items)?t.items.filter(n=>!!n&&"object"==typeof n).map(Tn):[];return{totalCount:"number"==typeof t.totalCount&&Number.isFinite(t.totalCount)?t.totalCount:void 0,items:e}})(yield l.json()):null}catch(n){return null}finally{i&&clearTimeout(i)}})}(a.endpoint,n,t,e):Promise.resolve(null)},fetchRedeemableRewards(t,e){return n?function(n,t,e){return jn(this,arguments,void 0,function*(n,t,e,o=1){const r="undefined"!=typeof AbortController?new AbortController:null,i=r?setTimeout(()=>r.abort(),zn):null;try{const i=On(n,"/panel/redeemable-rewards",t),c=o>1?`${i}${i.includes("?")?"&":"?"}page=${o}`:i,l=yield fetch(c,{method:"GET",credentials:"omit",mode:"cors",headers:{Authorization:`Bearer ${e}`},signal:r?r.signal:void 0});return l.ok?(n=>{if(!n||"object"!=typeof n)return null;const t=n,e=Array.isArray(t.rewards)?t.rewards.filter(n=>!!n&&"object"==typeof n).map(In):[];return{points:Rn(t.points),total:Rn(t.total),rewards:e}})(yield l.json()):null}catch(n){return null}finally{i&&clearTimeout(i)}})}(a.endpoint,n,t,e):Promise.resolve(null)},redeemReward(t,e,o){return n?function(n,t,e,o,r){return jn(this,void 0,void 0,function*(){const i="undefined"!=typeof AbortController?new AbortController:null,c=i?setTimeout(()=>i.abort(),8e3):null;try{const c=yield fetch(On(n,"/panel/redeem",t),{method:"POST",credentials:"omit",mode:"cors",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`,"Idempotency-Key":r},body:JSON.stringify({campaignId:o}),signal:i?i.signal:void 0}),a=yield c.json().then(n=>n&&"object"==typeof n?n:null).catch(()=>null);if(!c.ok)return{ok:!1,code:a?Nn(a,!0):null};const u=Nn(a,!1);return u?{ok:!1,code:u}:{ok:!0,result:(l=a,l?{code:"string"==typeof l.code?l.code:void 0,pointsSpent:Rn(l.pointsSpent),pointsRemaining:Rn(l.pointsRemaining),transactionId:"string"==typeof l.transactionId?l.transactionId:void 0}:{})}}catch(n){return{ok:!1,code:"UNCONFIRMED"}}finally{c&&clearTimeout(c)}var l})}(a.endpoint,n,t,e,o):Promise.resolve({ok:!1,code:"NOT_INITIALIZED"})}};if(h=S,a.autotrack){let n=a.autotrack;a.remoteConfig.enabled&&"object"==typeof n&&n.buttonTracking&&(n=Object.assign(Object.assign({},n),{buttonTracking:void 0})),f=function(n,e){const o=void 0===(a=e)||!1===a?Object.assign(Object.assign({},F),{searchParams:N}):!0===a?Object.assign(Object.assign({},R),{searchParams:N}):{spa:null===(u=a.spa)||void 0===u||u,outboundClicks:null===(s=a.outboundClicks)||void 0===s||s,scroll:null===(d=a.scroll)||void 0===d||d,downloads:null===(f=a.downloads)||void 0===f||f,siteSearch:null===(p=a.siteSearch)||void 0===p||p,downloadExtensions:a.downloadExtensions,searchParams:null!==(h=a.searchParams)&&void 0!==h?h:N,buttonTracking:a.buttonTracking};var a,u,s,d,f,p,h;o.outboundClicks=!1,o.downloads=!1,o.scroll=!1,o.siteSearch=!1;const v=[];let m=null;function g(e){if(o.siteSearch)try{const r=null!=e?e:(()=>{try{return"undefined"!=typeof location?location.href:""}catch(n){return""}})();if(r===m)return;m=r;const i=((n,t=N)=>{try{if(!n){if("undefined"==typeof location)return null;n=location.href}const e=n instanceof URL?n:new URL(n,(()=>{try{return"undefined"!=typeof location?location.href:"http://localhost/"}catch(n){return"http://localhost/"}})());if(!e.search)return null;for(const n of t){const t=e.searchParams.get(n);if(null===t)continue;const o=t.trim();if(0!==o.length)return{query:o,param:n}}return null}catch(n){return null}})(r,o.searchParams);i&&t(()=>n.track("Site Searched",{query:i.query,param:i.param}))}catch(n){}}if(o.outboundClicks||o.downloads){const e=(n=>{var t;if("undefined"==typeof document)return()=>{};const e=new Set((null!==(t=n.downloadExtensions)&&void 0!==t?t:r).map(n=>n.toLowerCase())),o=!!n.onOutbound,a=!!n.onDownload;if(!o&&!a)return()=>{};function u(t){var r,u;try{if(0!==t.button)return;if(t.defaultPrevented)return;const s=(n=>{const t="function"==typeof n.composedPath?n.composedPath():[];if(t.length>0)for(const n of t)if(i(n))return n;let e=n.target;for(;e;){if(i(e))return e;e=e.parentNode}return null})(t);if(!s)return;const d=s.getAttribute("href");if(!d)return;if(/^(javascript:|mailto:|tel:|sms:)/i.test(d))return;if(d.startsWith("#"))return;const f=(n=>{try{return new URL(n,location.href)}catch(n){return null}})(d);if(!f)return;let p=!1;if(a){const t=s.hasAttribute("download"),o=(n=>{const t=c(n),e=t.lastIndexOf(".");return e<=0||e===t.length-1?null:t.slice(e+1).toLowerCase()})(f.pathname);(t||o&&e.has(o))&&(p=!0,null===(r=n.onDownload)||void 0===r||r.call(n,{url:f.href,fileName:c(f.pathname),fileExtension:null!=o?o:"",text:l(s)}))}o&&!p&&f.host!==(()=>{try{return"undefined"!=typeof location?location.hostname:""}catch(n){return""}})()&&f.host&&(null===(u=n.onOutbound)||void 0===u||u.call(n,{url:f.href,host:f.host,text:l(s),target:s.target||"_self"}))}catch(n){}}try{document.addEventListener("click",u,!0)}catch(n){return()=>{}}return()=>{try{document.removeEventListener("click",u,!0)}catch(n){}}})({downloadExtensions:o.downloadExtensions,onOutbound:o.outboundClicks?e=>t(()=>n.track("Clicked",e)):void 0,onDownload:o.downloads?e=>t(()=>n.track("File Downloaded",e)):void 0});v.push(e)}o.buttonTracking&&o.buttonTracking.rules&&o.buttonTracking.rules.length>0&&v.push(k(n,o.buttonTracking));let b=null;if(o.scroll&&(b=(n=>{if("undefined"==typeof window||"undefined"==typeof document)return{destroy(){},reset(){}};let t=!1,e=null,o=!1;function r(){if(e=null,!o&&!t)try{const e=document.documentElement,o=document.body,r=Math.max(e?e.scrollHeight:0,o?o.scrollHeight:0),i=Math.max(e?e.clientHeight:0,window.innerHeight||0);if(r<=i)return t=!0,c(),void n(90);((window.scrollY||(e?e.scrollTop:0)||0)+i)/r>=.9&&(t=!0,c(),n(90))}catch(n){}}function i(){if(null===e)try{e=window.requestAnimationFrame(r)}catch(n){r()}}function c(){try{window.removeEventListener("scroll",i),null!==e&&window.cancelAnimationFrame(e),e=null}catch(n){}}try{window.addEventListener("scroll",i,{passive:!0})}catch(n){try{window.addEventListener("scroll",i)}catch(n){}}try{window.requestAnimationFrame(r)}catch(n){r()}return{destroy(){o=!0,c()},reset(){if(!o){t=!1;try{window.addEventListener("scroll",i,{passive:!0})}catch(n){try{window.addEventListener("scroll",i)}catch(n){}}try{window.requestAnimationFrame(r)}catch(n){r()}}}}})(e=>{t(()=>n.track("Scrolled",{percent:e}))}),v.push(()=>null==b?void 0:b.destroy())),o.spa){const e=[],o=T(o=>{const r=setTimeout(()=>{const o=e.indexOf(r);-1!==o&&e.splice(o,1),t(()=>n.page())},0);e.push(r),null==b||b.reset(),g(o)});v.push(()=>{for(let n=0;n<e.length;n++)clearTimeout(e[n]);e.length=0,o()})}return g(),()=>{for(;v.length>0;){const n=v.pop();try{null==n||n()}catch(n){}}m=null}}(S,n)}if(m.dispose(),g.dispose(),b.dispose(),a.remoteConfig.enabled&&n){const t=n=>{var t,e,o,r;m.apply((n=>{const t=null==n?void 0:n.buttonTracking;if(!t||!1===t.enabled)return null;const e=Array.isArray(t.rules)?t.rules:[];return 0===e.length?null:{rules:e,globalThrottle:t.globalThrottle}})(n),null),g.apply((n=>{var t;const e=null===(t=null==n?void 0:n.launcher)||void 0===t?void 0:t.config;return e?"NONE"===e.deviceVisibility?null:e:null})(n),null!==(e=null===(t=null==n?void 0:n.launcher)||void 0===t?void 0:t.version)&&void 0!==e?e:null),b.apply((n=>{var t;const e=null===(t=null==n?void 0:n.panel)||void 0===t?void 0:t.config;return null!=e?e:null})(n),null!==(r=null===(o=null==n?void 0:n.panel)||void 0===o?void 0:o.version)&&void 0!==r?r:null)};t(null!==(_=null===(x=Ft(n))||void 0===x?void 0:x.envelope)&&void 0!==_?_:null),function(n){return jn(this,void 0,void 0,function*(){if(!n.projectId)return{status:"error"};const t=Ft(n.projectId);if(t&&Date.now()-t.fetchedAt<n.ttlMs)return{status:"unchanged"};const e=yield function(n){return jn(this,void 0,void 0,function*(){var t;if("function"!=typeof fetch)return null;const e=n.endpoint+n.path+"?projectId="+encodeURIComponent(n.projectId),o="undefined"!=typeof AbortController?new AbortController:null,r=o?setTimeout(()=>o.abort(),n.timeoutMs):null;try{const r={};n.etag&&(r["If-None-Match"]=n.etag);const i=yield fetch(e,{method:"GET",headers:r,credentials:"omit",mode:"cors",cache:"no-store",signal:o?o.signal:void 0});if(304===i.status)return{envelope:null,etag:null!==(t=n.etag)&&void 0!==t?t:"",notModified:!0};if(!i.ok)return null;const c=i.headers&&"function"==typeof i.headers.get?i.headers.get("ETag"):null;return{envelope:yield i.json(),etag:null!=c?c:"",notModified:!1}}catch(n){return null}finally{r&&clearTimeout(r)}})}({endpoint:n.endpoint,path:n.path,projectId:n.projectId,timeoutMs:n.timeoutMs,etag:null==t?void 0:t.etag});return e?e.notModified?(t&&$t(n.projectId,t.etag,t.envelope),{status:"unchanged"}):e.envelope?($t(n.projectId,e.etag,e.envelope),{status:"updated",envelope:e.envelope}):{status:"error"}:{status:"error"}})}({endpoint:a.endpoint,path:a.remoteConfig.path,projectId:n,timeoutMs:a.remoteConfig.timeoutMs,ttlMs:a.remoteConfig.ttlMs}).then(n=>{"updated"===n.status&&t(n.envelope)}).catch(()=>{})}}catch(n){}},pageview:M,page:A,screen(n,t){},track:j,identify:z,alias:C,group(n,t){},reset(){try{((n={})=>{((n,t={})=>{var e;if(!pn)return!1;try{let o=`${encodeURIComponent(n)}=`;return o+=`; path=${null!==(e=t.path)&&void 0!==e?e:"/"}`,t.domain&&(o+=`; domain=${t.domain}`),o+="; max-age=0",o+="; expires=Thu, 01 Jan 1970 00:00:00 GMT",document.cookie=o,null===hn(n)}catch(n){return!1}})(ue,{domain:n.cookieDomain}),yn(ue),yn(se)})({cookieDomain:a.cookieDomain}),((n={})=>{Wt(kn(),n)})({cookieDomain:a.cookieDomain,cookieMaxAgeDays:a.cookieMaxAgeDays}),((n={})=>{re({id:kn(),lastActivity:Date.now()},n)})({cookieDomain:a.cookieDomain,timeoutMinutes:a.sessionTimeoutMinutes}),n&&(n=>{yn(Zt(n))})(n)}catch(n){}},flush(){try{s&&s.flush()}catch(n){}},consent(n){try{u=Object.assign(Object.assign({},u),n)}catch(n){}},set(n){try{a=y(n),n.consent&&(u=Object.assign(Object.assign({},u),n.consent)),s&&s.setConfig({endpoint:a.endpoint,batchPath:a.batchPath,singlePath:a.singlePath,useBatch:a.useBatch,contentType:a.contentType,flushAt:a.flushAt,flushInterval:a.flushInterval,debug:a.debug})}catch(n){}},destroy(){f=o(f),m.dispose(),g.dispose(),b.dispose(),h=null,s&&s.destroy(),s=null,d=!1,n=null,a=Object.assign({},fe),u=Object.assign({},pe)}}}();function be(n){return Dn({projectId:ge.projectId,endpoint:ge.endpoint,zaloQrLoginEnabled:ge.isZaloQrLoginEnabled(),consentGranted:ge.consentGranted,identify:ge.identify,alias:ge.alias,getUserId:de},n)}"undefined"!=typeof window&&(n=>{if("undefined"==typeof window)return()=>{};const t=window.cnvQ;if(t&&t.__loaded)return()=>{};const e=window.cnvQ=null!=t?t:[],o=e.splice(0,e.length);e.push.bind(e),e.push=(...t)=>{for(const e of t)he(n,e);return e.length},e.__loaded=!0;for(const t of o)he(n,t)})(ge);const ye=Object.assign(ge,{version:ve,name:me,schemaVersion:Qt,loginWithZalo:be});n.NAME=me,n.SCHEMA_VERSION=Qt,n.VERSION=ve,n.ZaloQrLoginError=Sn,n.default=ye,n.loginWithZalo=be,Object.defineProperty(n,"t",{value:!0})}(this.cnvTrack=this.cnvTrack||{});
|