@subiz/widget-v4 4.1.106 → 4.1.108
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/compiled_src/popup/popup.js +7 -1
- package/compiled_src/util/common.js +33 -1
- package/dist/132.js +6433 -2568
- package/dist/178.js +406 -0
- package/dist/18a02a9c54e.132.js +1 -0
- package/dist/18a02a9c54e.178.js +1 -0
- package/dist/18a02a9c54e.213.js +1 -0
- package/dist/18a02a9c54e.335.js +1 -0
- package/dist/18a02a9c54e.362.js +1 -0
- package/dist/18a02a9c54e.441.js +1 -0
- package/dist/18a02a9c54e.605.js +1 -0
- package/dist/18a02a9c54e.678.js +1 -0
- package/dist/18a02a9c54e.782.js +1 -0
- package/dist/18a02a9c54e.app.js +1 -0
- package/dist/{19258dbe3c2.index.html → 18a02a9c54e.index.html} +4 -28
- package/dist/{19258dbe3c2.library.html → 18a02a9c54e.library.html} +4 -28
- package/dist/18a02a9c54e.library.js +1 -0
- package/dist/{19258dbe3c2.preview.html → 18a02a9c54e.preview.html} +1 -1
- package/dist/18a02a9c54e.preview.js +1 -0
- package/dist/18a02a9c54e.screenshoot.js +1 -0
- package/dist/18a02a9c54e.webview.js +1 -0
- package/dist/213.js +2780 -0
- package/dist/{74.js → 335.js} +35 -35
- package/dist/{459.js → 362.js} +7 -7
- package/dist/441.js +2855 -0
- package/dist/{490.js → 605.js} +82 -82
- package/dist/{997.js → 678.js} +6 -6
- package/dist/{27.js → 782.js} +7 -7
- package/dist/HASH +1 -1
- package/dist/assets/img/{subiz-mono.8fbc067.svg → subiz-mono.877e9f5.svg} +1 -1
- package/dist/malicious-app.js +4 -6
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +2565 -6819
- package/package.json +1 -1
- package/src/popup/popup.js +7 -1
- package/src/util/common.js +36 -1
- package/dist/127.js +0 -273
- package/dist/185.js +0 -1885
- package/dist/19258dbe3c2.127.js +0 -1
- package/dist/19258dbe3c2.132.js +0 -1
- package/dist/19258dbe3c2.185.js +0 -1
- package/dist/19258dbe3c2.27.js +0 -1
- package/dist/19258dbe3c2.278.js +0 -1
- package/dist/19258dbe3c2.459.js +0 -1
- package/dist/19258dbe3c2.490.js +0 -1
- package/dist/19258dbe3c2.74.js +0 -1
- package/dist/19258dbe3c2.997.js +0 -1
- package/dist/19258dbe3c2.app.js +0 -1
- package/dist/19258dbe3c2.library.js +0 -1
- package/dist/19258dbe3c2.preview.js +0 -1
- package/dist/19258dbe3c2.webview.js +0 -1
- package/dist/278.js +0 -406
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e,t,i={7460:e=>{var t="Content-Type",i="application/x-www-form-urlencoded",n="application/json; charset=utf-8";function s(e,t){return Object.assign(e.clone(),t)}function r(e){return(e||"").trim()}function a(e){return e&&"[object Function]"==={}.toString.call(e)}function o(e,t,i){if(!e||0===e.length)return i(t);var n=e.shift();if(!a(n))return o(e,t,i);n(t,(function(n){return!1===n?i(t):o(e,t,i)}))}function c(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}function l(e){if(!e)return"";for(var t=Object.keys(e),i=[],n=0;n<t.length;n++){var s=t[n],r="",a=e[s];if(void 0!==a){if(null===a)r=c(s);else if(Array.isArray(a)){for(var o=[],l=0;l<a.length;l++)void 0!==a[l]&&(o.push(u(s,a[l],o.length)),o.push(i));r=o.join("&")}else r=c(s)+"="+c(a);r.length>0&&i.push(r)}}return i.join("&")}function u(e,t){return null===t?c(e):[c(e),"=",c(t)].join("")}var d,h=(d={parser:"",beforehooks:[],afterhooks:[],baseurl:"",query:{},meta:{},clone:function(){return Object.assign({},this,{query:Object.assign({},this.query),meta:Object.assign({},this.meta)})},addQuery:function(e,t){var i=this.clone();return i.query[e]=t,i},removeQuery:function(e){var t=this.clone();return void 0!==t.query[e]&&(t.query[e]=void 0),t},withCredentials:function(e){return s(this,{_withCredentials:e})},setQuery:function(e){return s(this,{query:e})},clearHooks:function(){return s(this,{beforehooks:[],afterhooks:[]})},beforeHook:function(e){var t=this.beforehooks.slice();return t.push(e),s(this,{beforehooks:t})},afterHook:function(e){var t=this.afterhooks.slice();return t.push(e),s(this,{afterhooks:t})},setHeader:function(e){return(e=Object.assign({},this.headers,e))[t]=void 0,s(this,{headers:e})}},["put","head","patch","delete","post","get"].map((function(e){d[e]=function(c,u,d){return function(e,s,r){r=r||function(){},a(s)&&(r=s,s=void 0);var c,u=new Promise((function(e){c=function(t){try{r(t.error,t.body,t.code)}catch(e){}e(t)}}));return s&&((e=e.clone()).body=s,e.content_type===n&&(e.body=p.Jsonify(s)),e.content_type===i&&(e.body=l(s))),o(e.beforehooks.slice(),{request:e},(function(i){if(i.error)return c({body:void 0,code:0,error:i.error});!function(e,i){let n=l(e.query);if(n&&(n="?"+n),!p.XMLHttpRequest)return function(e,i,n){var s=Object.assign({},e.headers);e.content_type&&(s[t]=e.content_type),fetch(e.baseurl+n,{method:e.method,headers:s,credentials:e._withCredentials,body:e.body}).then((e=>e.text().then((t=>i(void 0,t,e.status))))).catch((e=>i("network_error",e,-1)))}(e,i,n);var s=new p.XMLHttpRequest;for(var r in s.onreadystatechange=function(e){4===s.readyState&&(0===s.status?i("network_error",s.responseText,s.status):i(void 0,s.responseText,s.status))},s.open(e.method,e.baseurl+n),s.withCredentials=e._withCredentials,e.headers)s.setRequestHeader(r,e.headers[r]);e.content_type&&s.setRequestHeader(t,e.content_type),s.send(e.body)}(i.request,(function(t,i,n){o(e.afterhooks.slice(),{request:e,code:n,body:i,err:t},(function(t){var i=t.body;if("json"==e.parser&&t.body)try{i=p.ParseJson(t.body)}catch(e){t.err=t.err||"invalid json"}var s=t.err;(n<200||n>299)&&(s="not 200"),c({body:i,code:t.code,error:s})}))}))})),u}(s(this,{method:e,baseurl:(h=this.baseurl,m=c,h=r(h),(m=r(m))&&h?m.startsWith("http://")||m.startsWith("https://")||m.startsWith("//")?m:(h.endsWith("/")||(h+="/"),m.startsWith("/")&&(m=m.substring(1)),h+m):h+m)}),u,d);var h,m}})),d.setBaseUrl=function(e){return s(this,{baseurl:e})},d.contentTypeJson=function(){return s(this,{content_type:n})},d.contentTypeForm=function(){return s(this,{content_type:i})},d.setContentType=function(e){return s(this,{content_type:r(e)})},d.setParser=function(e){return s(this,{parser:r(e)})},d.setBody=function(e){return s(this,{body:e})},d.setMeta=function(e,t){var i=this.clone();return i.meta[e]=t,i},d),p={Jsonify:JSON.stringify,ParseJson:JSON.parse};h.env=p,h.waterfall=o,e.exports=h},5530:(e,t,i)=>{var n=i(8368);e.exports=function(e,t,i){var s=[],r="idle",a=function(e){var t=e.map((function(e){return e.payload})),n=i(t);n&&n.then||(n=Promise.resolve(n));var s=e.map((function(e){return e.rs}));return new Promise((function(e){n.then((function(t){s.map((function(e,i){e(t&&t[i])})),e()}))}))},o=function(){"executing"!==r&&(r="executing",n((function(){if(s.length<=e)return Promise.resolve(!1);var t=s.splice(0,e);return a(t).then((function(){return!0}))})).then((function(){if(0!==s.length){var e=t-(Date.now()-s[0].created);if(e>=1){if(r="idle",s[0].settedTimeout)return;return s[0].settedTimeout=!0,void setTimeout(o,e)}var i=s;s=[],a(i).then((function(){r="idle",o()}))}else r="idle"})))};return this.push=function(e,t){return new Promise((function(i){s.push({payload:e,priority:t,created:Date.now(),rs:i}),o()}))},this}},3538:e=>{e.exports={map:function(e,t){if(!e)return[];t||(t=function(e){return e});var i=[];if(Array.isArray(e)){for(var n=0;n<e.length;n++)i.push(t(e[n],n));return i}if("object"==typeof e){var s=Object.keys(e);for(n=0;n<s.length;n++){var r=s[n];i.push(t(e[r],r))}return i}return i}}},3165:(e,t,i)=>{var n=i(2349),s=i(8368),r=i(8874),a=i(5530);e.exports={sleep:n,loop:s,map:r,batch:a}},8368:e=>{e.exports=function e(t){var i=t();if(!i||!i.then){var n=i;i={then:function(e){e(n)}}}return i.then((function(i){return i?e(t):Promise.resolve()}))}},8874:(e,t,i)=>{var n=i(3538);e.exports=function(e,t,i){if("number"==typeof t){let e=i;i=t,t=e}t||(t=function(){}),("number"!=typeof i||i<=0)&&(i=1);var s={};if(n.map(e,(function(e,t){s[t]=e})),i<=0&&(i=1),0===Object.keys(s).length)return Promise.resolve([]);Object.keys(s).length<i&&(i=Object.keys(s).length);var r={};return new Promise((function(e){let a=Object.keys(s).length;for(var o=function(){var i=Object.keys(s);if(0!==i.length){var c=i.pop(),l=s[c];delete s[c];var u=t(l,c);u&&u.then||(u=Promise.resolve(u)),u.then((function(t){if(r[c]=t,Object.keys(r).length===a)return e(n.map(r));o()}))}},c=0;c<i;c++)setTimeout(o,1)}))}},2349:e=>{e.exports=function(e){return new Promise((function(t){setTimeout(t,e)}))}},8454:(e,t,i)=>{e.exports=i(608)},608:(e,t,i)=>{var n=i(3165);function s(e,t,i,s,o){o=o||r,t=t||{};var h=!1,p="";this.kill=function(){h=!0};var m=function(t){h||o("get",e+"poll?token="+p,void 0,(function(n,r){if(!h){if(l(r))return setTimeout(m,c(t),t+1);if(200!==r)return h=!0,i("poll");(n=a(n)||{}).host&&(e=d(n.host));var o=n.sequential_token;return o?(p=o,s(n.events||[]),m(0)):setTimeout(m,c(t),t+1)}}))},f=n.batch(50,100,(function(s){if(h)return["dead"];if(s.length<=0)return[];var r=[];return n.loop((function(){return new Promise((function(n){var c="?token="+p;t.getAccessToken().then((function(f){t.user_ref?c+="&user_ref="+encodeURIComponent(t.user_ref)+"&account_id="+encodeURIComponent(t.account_id):t.user_mask?c+="&user-mask="+encodeURIComponent(t.user_mask):f&&(c+="&access-token="+f),o("post",e+"subs"+c,JSON.stringify({events:s}),(function(t,o){if(h)return r=u("dead",s.length),n(!1);if(l(o))return setTimeout(n,3e3,!0);if(200!==o)return h=!0,i("subscribe",t,o),r=u("dead",s.length),n(!1);if(p)return n(!1);var c=(t=a(t)||{}).initial_token;return c?(t.host&&(e=d(t.host)),p=c,m(0),n(!1)):setTimeout(n,3e3,!0)}))}))}))})).then((function(){return r}))}));this.subscribe=f.push.bind(f)}var r=function(e,t,i,n){if("undefined"==typeof XMLHttpRequest)return function(e,t,i,n){let s={};i&&(s["content-type"]="text/plain"),fetch(t,{method:e,headers:s,body:i}).then((e=>e.text().then((t=>n&&n(t,e.status))))).catch((e=>n&&n(e,-1)))}(e,t,i,n);var s=new XMLHttpRequest;s.onreadystatechange=function(e){4===s.readyState&&(n&&n(s.responseText,s.status),n=void 0)},s.onerror=function(){n&&n(s.responseText,-1),n=void 0},s.open(e,t),i&&s.setRequestHeader("content-type","text/plain"),s.send(i)};function a(e){try{return JSON.parse(e)}catch(e){}}function o(){var e={};this.emit=function(t){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var s=e[t];if(s)for(n=0;n<s.length;n++)s[n].apply(void 0,i)},this.on=function(t,i){e[t]||(e[t]=[]),e[t].push(i)}}function c(e){if(!e||-1===e)return 0;var t=1e3*Math.pow(1.5,e);return Math.min(1e4,t)}function l(e){return e>=500&&e<600||0===e||-1===e||429===e}function u(e,t){for(var i=[],n=0;n<t;n++)i.push(e);return i}function d(e){return(e=e||"").startsWith("//")?"https:"+e:e}e.exports=function(e,t,i){("string"==typeof e||e instanceof String)&&(e=[e]),(t=t||{}).getAccessToken||(t.getAccessToken=function(){return Promise.resolve("")});var n,r=new o,a={},c=!1;this.stop=function(){c||(c=!0,n.kill())},this.onEvent=function(e){return r.on("event",e)},this.onInterrupted=function(e){return r.on("interrupted",e)},this.subscribe=function(e){if(c)return Promise.resolve({});if("string"==typeof e&&(e=[e]),!Array.isArray(e))return Promise.resolve({error:"param should be an array or string"});for(var t=[],i=0;i<e.length;i++){var s=e[i];s&&(a[s]||t.push(n.subscribe(s)))}return 0===t.length?Promise.resolve({}):Promise.all(t).then((function(t){for(var i=0;i<t.length;i++)if(t[i])return{error:t[i]};for(var n=0;n<e.length;n++)a[e[n]]=!0;return{}}))};var l=function(){if(!c){for(var o=Object.keys(a),u=0;u<o.length;u++)a[o[u]]=!1;var d=e[Math.floor(Math.random()*e.length)];n=new s(d,t,(function(e,t,i){c||(r.emit("interrupted",e,t,i),setTimeout(l,2e3))}),(function(e){if(!c)for(var t=0;t<e.length;t++)r.emit("event",e[t])}),i);var h=Object.keys(a);for(u=0;u<h.length;u++)n.subscribe(h[u])}};l()}},4878:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{constructor(e,t,i){this.schema=t+"_chain",this.dead=!1,this.db=e,this.anchorCache={},this.cache={},this.init()}init(){let e={};this.db.all("items").map((t=>{e[t.chain]=e[t.chain]||{},e[t.chain][t.id]={id:t.id,chain:t.chain,full_id:t.full_id,index:t.index,value:t.value}})),r(e,((t,i)=>{if(((n=t)?void 0!==n.length?n.length:Object.keys(n).length:0)<50)return;var n;let s=(a=r(t),o=["index"],"desc",c=[],r(a,(e=>c.push(e))),c.sort(((e,t)=>{if(e[o]===t[o])return 0;var i=e[o]<t[o]?-1:1;return-i})),c);var a,o,c;let l=[];for(var u=50;u<s.length;u++)l.push(s[u].full_id),delete t[s[u].id];this.db.removes("items",l),e[i]=t})),this.cache=e}destroy(){this.db.clear("items"),this.dead=!0,this.cache={},this.anchorCache={},this.db=void 0}put(e,t,i,n){if(this.dead)return;let r=this.cache[e]||{},a=(s(r)||{}).index||"z",o={id:t,index:i,value:n,chain:e,full_id:e+":"+t};delete r[o.id],a>o.index+""||(r[o.id]=o,this.cache[e]=r,this.db.put("items",o.full_id,o))}listM(e){if(this.dead)return{};let t=this.cache[e]||{},i={};return r(t,((e,t)=>{i[t]=e.value})),i}async fetchMore(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,i=arguments.length>2?arguments[2]:void 0;if(this.dead)return{error:"dead"};if(!i)return{error:"no api"};let n=this.anchorCache[e]||"";var[s,r,a]=await i(e,n,t);if(a)return{error:a};if(this.dead)return{error:"dead"};let o=this.cache[e]||{};return 0===s.length?{end:!0}:(s.forEach((t=>{t.chain=e,t.full_id=e+":"+t.id,o[t.id]=t,this.db.put("items",t.full_id,t)})),this.anchorCache[e]=r,this.cache[e]=o,{})}del(e,t){if(this.dead)return;let i=e+":"+t;delete(this.cache[e]||{})[t],this.db.removes("items",[i])}match(e,t){return this.listM(e)[t]}async reload(e,t){if(this.dead)return;let i=function(e){if(!e)return;let t=Object.keys(e);if(!t.length)return;let i=-1/0,n=Object.keys(e)[0];for(var s=0;s<t.length;s++){let r=e[t[s]]&&e[t[s]].index||-1/0;r>i&&(i=r,n=t[s])}return e[t[n]]}(this.listM(e))||{},n=i.index;n||(n=Date.now());for(var a="",o={};;){if(this.dead)return;let[i,c,l]=await t(e,a,50);if(l)return;if(this.dead)return;if(i.map((t=>{o[t.id]=Object.assign({},t,{chain:e,full_id:e+":"+t.id})})),0===i.length||c===a)break;if(o.length>=200){let t=this.cache[e]||{},i=[];r(t,(t=>{t.chain===e&&i.push(t.full_id)})),this.db.removes("items",i),this.cache[e]={};break}if((s(o)||{}).index<=n){a=this.anchorCache[e]||c;break}a=c}for(var c=0;c<Object.keys(o).length;c++){let e=o[Object.keys(o)[c]];this.db.put("items",e.full_id,e),this.cache[e.chain]=this.cache[e.chain]||{},this.cache[e.chain][e.id]=e}this.anchorCache[e]=a}}function s(e){if(!e)return;let t=Object.keys(e);if(!t.length)return;let i=1/0,n=Object.keys(e)[0];for(var s=0;s<t.length;s++){let r=e[t[s]]&&e[t[s]].index||1/0;r<i&&(i=r,n=t[s])}return e[n]}function r(e,t){if(!e)return[];if(!t)return e;var i=[];if(Array.isArray(e)){for(let n=0;n<e.length;n++)i.push(t(e[n],n));return i}if("object"==typeof e){var n=Object.keys(e);for(let r=0;r<n.length;r++){var s=n[r];i.push(t(e[s],s))}return i}return i}},9489:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var n={},s={};n.length=0,n.getItem=function(e){return e in s?s[e]:null},n.setItem=function(e,t){void 0===t?n.removeItem(e):s[e]=""+t,n.length=Object.keys(s).length},n.removeItem=function(e){Object.prototype.hasOwnProperty.call(s,e)&&(delete s[e],n.length=Object.keys(s).length)},n.key=function(e){return Object.keys(s)[e]||null},n.clear=function(){s={},n.length=0};const r=n},1606:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});const n=class{constructor(e,t){this.name=t,t+="_kv",this.dead=!1,this.db=e,this.cache={},this.initialized=!1,this.init()}refreshCache(){if(this.dead)return;let e={};this.db.all("items").forEach((function(t){e[t.key]=t.value})),this.cache=e}init(){if(this.initialized)return;let e={};console.time("KV"+this.name),this.db.all("items").forEach((function(t){e[t.key]=t.value})),this.cache=e;let t=Object.keys(this.cache);if(t.length>500){let e=250/t.lenth,n=[];for(var i=0;i<500;i++){if(Math.random()<=e)continue;let s=t[i];delete this.cache[s],n.push(s)}this.db.removes("items",[n])}this.initialized=!0,console.timeEnd("KV"+this.name)}all(){return this.dead?[]:this.initialized?this.cache:[]}match(e){if(!this.dead&&this.initialized&&e)return this.cache[e]}put(e,t){if(e){if(this.dead)return[];if(!this.initialized)throw new Error("uninitialized");this.cache[e]=t,this.db.put("items",e,{key:e,value:t})}}del(e){if(!this.dead){if(!this.initialized)throw new Error("uninitialized");delete this.cache[e],this.db.removes("items",[e])}}destroy(){this.db.clear("items"),this.dead=!0,this.db=void 0,this.cache=void 0,this.initialized=!1}}},6929:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let n=i(9489).Z,s=window.requestIdleCallback||(e=>e());const r=class{constructor(e,t){if(this.localStorage=n,this.allkeys={},!t)try{window.localStorage.setItem("sbzstore1029","?"),window.localStorage.removeItem("sbzstore1029"),this.localStorage=window.localStorage}catch(e){}this.schema=e}all(e){let t=[];for(var i=0;i<this.localStorage.length;i++){let n=this.localStorage.key(i);n.startsWith(this.schema+"#"+e+"#")&&(this.allkeys[n]=!0,t.push(JSON.parse(this.localStorage.getItem(n))))}return t}removes(e,t){for(var i=0;i<t.length;i++)delete this.allkeys[this.schema+"#"+e+"#"+t[i]],this.localStorage.removeItem(this.schema+"#"+e+"#"+t[i])}clear(e){let t=[];for(var i=0;i<this.localStorage.length;i++){let n=this.localStorage.key(i);n.startsWith(this.schema+"#"+e+"#")&&t.push(n)}for(i=0;i<t.length;i++)this.localStorage.removeItem(t[i]);this.allkeys={}}put(e,t,i){this.allkeys[this.schema+"#"+e+"#"+t]=!0,Object.keys(this.allkeys).length>80&&this.clear(e),s((()=>{try{this.localStorage.setItem(this.schema+"#"+e+"#"+t,void 0===(n=i)?"null":JSON.stringify(n))}catch(t){this.clear(e)}var n}))}}},2493:(e,t,i)=>{"use strict";i.d(t,{Kd:()=>o,Rs:()=>c,WW:()=>u,u$:()=>a,up:()=>r});var n=i(6400),s=i(4494);class r extends n.wA{constructor(e){super(e),this._isMounted=!0,s.Z.setTimeout((()=>{if(this.componentWillUnmount){let e=this.componentWillUnmount.bind(this);this.componentWillUnmount=()=>{e(),this._isMounted=!1}}}),10)}}class a extends r{constructor(e){super(e),this.setWrapperRef=this.setWrapperRef.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){document.addEventListener("mousedown",this.onClick)}componentWillUnmount(){document.removeEventListener("mousedown",this.onClick)}setWrapperRef(e){this.wrapperRef=e}onClick(e){this.wrapperRef&&!this.wrapperRef.contains(e.target)&&this.props.onClickaway&&this.props.onClickaway()}render(){return(0,n.h)("div",{ref:this.setWrapperRef},this.props.children)}}const o=(e,t)=>{t||(t="");let i=s.Z.find(e.locales,(e=>e.toLowerCase().trim()===t.toLowerCase().trim()));return i||(i=s.Z.find(e.locales,(e=>(e=e.replace("-","_").split("_")[0].trim().toLowerCase())==t.replace("-","_").split("_")[0].trim().toLowerCase())),i||e.locale||"en-US")};let c={},l=!1;function u(e,t,i){if(l)return new Promise((n=>s.Z.setTimeout((()=>u(e,t,i).then(n)),100)));let n;return l=!0,"debug"===t||c[t]&&!i?(l=!1,Promise.resolve()):e.getLocaleContent(t).then((e=>{l=!1,n=s.Z.get(e,"body.messages",[]),c[t]=n}))}},8733:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DEFVAL:()=>ne,DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL:()=>ie,Date:()=>c,XMLHttpRequest:()=>m,agentsOfConvo:()=>M,checkRunConditions:()=>ae,clearInterval:()=>h,clearTimeout:()=>p,cloneDeep:()=>w,convoOfEv:()=>f,convoToEv:()=>g,detectLang:()=>ve,diffDay:()=>he,diffYear:()=>pe,each:()=>Z,filter:()=>x,find:()=>O,formatCurrency:()=>we,getAgentDisplayName:()=>N,getDayName:()=>oe,getMs:()=>_e,getMsgField:()=>v,getUrlParameter:()=>ye,getUserAttr:()=>V,includes:()=>C,isConvoSeen:()=>A,isEmail:()=>G,isNumber:()=>$,isPhone:()=>q,isURL:()=>W,isUserBanned:()=>B,js2css:()=>se,last:()=>F,map:()=>S,merge:()=>b,noop:()=>X,norm:()=>K,offsetToMin:()=>de,orderBy:()=>j,orderByF:()=>I,parseJSON:()=>s,preloadImg:()=>ue,preloadWebfonts:()=>le,randomString:()=>k,replaceAll:()=>L,replaceCssVariable:()=>J,replaceCssVariablePlugin:()=>Q,requestAnimationFrame:()=>l,sameDay:()=>me,scrollIntoViewIfNeeded:()=>xe,setCss:()=>te,setInterval:()=>d,setMsgField:()=>_,setTimeout:()=>u,setUserAttr:()=>H,shortTime:()=>fe,size:()=>T,sleep:()=>be,startsWith:()=>D,stringify:()=>a,throttle:()=>R,tokenize:()=>ee,trim:()=>z,trimStart:()=>U,unicodeToAscii:()=>ke,unixSec:()=>ge,usersOfConvo:()=>P});var n=i(6877);function s(e){try{return o(e)}catch(e){}}var r=document.createElement("iframe");r.style.display="none",document.documentElement.appendChild(r);var a=r.contentWindow.JSON.stringify,o=r.contentWindow.JSON.parse,c=r.contentWindow.Date,l=r.contentWindow.requestAnimationFrame,u=r.contentWindow.setTimeout.bind(r.contentWindow),d=r.contentWindow.setInterval.bind(r.contentWindow),h=r.contentWindow.clearInterval.bind(r.contentWindow),p=r.contentWindow.clearTimeout.bind(r.contentWindow),m=r.contentWindow.XMLHttpRequest;function f(e){if(!e)return"";switch(e.type){case"conversation_state_updated":case"conversation_joined":case"conversation_invited":case"conversation_left":case"conversation_tagged":case"conversation_untagged":case"conversation_typing":case"conversation_rating_requested":case"conversation_rated":return n.get(e,"data.conversation.id");case"message_sent":case"message_updated":case"message_pong":return n.get(e,"data.message.conversation_id");case"ticket_updated":return n.get(e,"data.ticket.conversation_id");default:return""}}function g(e,t){if(!t)return"";switch(t.type){case"conversation_state_updated":case"conversation_joined":case"conversation_invited":case"conversation_left":case"conversation_tagged":case"conversation_untagged":case"conversation_typing":case"conversation_rating_requested":case"conversation_rated":return n.set(t,"data.conversation.id",e);case"message_sent":case"message_updated":case"message_pong":return n.set(t,"data.message.conversation_id",e);case"ticket_updated":return n.set(t,"data.ticket.conversation_id",e);default:return""}}function _(e,t,i){var s=n.get(e,"data.message.fields")||[];(s=x(s,(e=>e.key!==t))).push({key:t,value:a(i)}),n.set(e,"data.message.fields",s)}function v(e,t){var i=n.get(e,"data.message.fields");if(0===T(i))return;let s=i.find((e=>e.key===t));try{return s?o(s.value):void 0}catch(e){}}function y(e){return e&&"object"==typeof e&&!Array.isArray(e)}function b(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];if(!i.length)return e;const s=i.shift();if(y(e)&&y(s))for(const t in s)y(s[t])?(e[t]||Object.assign(e,{[t]:{}}),b(e[t],s[t])):Object.assign(e,{[t]:s[t]});return b(e,...i)}function w(e){if(e!==Object(e))return e;var t=a(e);return void 0!==t?o(t):void 0}function k(e){var t,i="";(!e||e<1)&&(e=10);for(var n=0;n<e;n++)t=Math.floor(25*Math.random()+97),i+=String.fromCharCode(t);return i}function x(e,t){if(!e)return[];if(!t)return e;var i=[];if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(e[n],n)&&i.push(e[n]);return i}if("object"==typeof e){var n=Object.keys(e);for(let r=0;r<n.length;r++){var s=n[r];t(e[s],s)&&i.push(e[s])}return i}return i}function C(e,t){if(!e)return!1;var i="string"==typeof e||e instanceof String;return!(!Array.isArray(e)&&!i)&&e.includes(t)}function S(e,t){if(!e)return[];t||(t=e=>e);var i=[];if(Array.isArray(e)){for(let n=0;n<e.length;n++)i.push(t(e[n],n));return i}if("object"==typeof e){var n=Object.keys(e);for(let r=0;r<n.length;r++){var s=n[r];i.push(t(e[s],s))}return i}return i}function Z(e,t){return S(e,t)}function P(e){return e?S(x(e.members,(e=>"user"===e.type)),(e=>e.id)):[]}function A(e,t){if("ended"===e.state)return!0;let i=e.last_message_sent;if(!i)return!0;if(n.get(i,"by.id")===t)return!0;let s=O(e.members,(e=>e.id===t));return!s||_e(i.created)<_e(s.seen_at)}function M(e,t){return e?S(x(e.members,(e=>t?"agent"===e.type||"bot"===e.type:"agent"===e.type)),(e=>e.id)):[]}function D(e,t){return((e||"")+"").startsWith(t)}function T(e){return e?void 0!==e.length?e.length:Object.keys(e).length:0}function L(e,t,i){return(e||"").split(t).join(i)}function z(e,t){return((e||"")+"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function U(e,t){for(e=(e||"")+"";e.charAt(0)===t;)e=e.substr(1);return e}function R(e,t,i){var n,s,r,a=null,o=0;i||(i={});var l=function(){o=!1===i.leading?0:(new c).getTime(),a=null,r=e.apply(n,s),a||(n=s=null)};return function(){var d=(new c).getTime();o||!1!==i.leading||(o=d);var h=t-(d-o);return n=this,s=arguments,h<=0||h>t?(a&&(p(a),a=null),o=d,r=e.apply(n,s),a||(n=s=null)):a||!1===i.trailing||(a=u(l,h)),r}}function O(e,t){if(e)return e[E(e,t)]}function E(e,t){if(!e)return-1;if(!t)return-1;if(Array.isArray(e)){for(let i=0;i<e.length;i++)if(t(e[i],i))return i;return-1}if("object"==typeof e){var i=Object.keys(e);for(let s=0;s<i.length;s++){var n=i[s];if(t(e[n],n))return n}}return-1}function j(e,t,i){var n=[];return Z(e,(e=>n.push(e))),n.sort(((e,n)=>{if(e[t]===n[t])return 0;var s=e[t]<n[t]?-1:1;return"desc"===i?-s:s})),n}function I(e,t,i){var n=[];return Z(e,(e=>n.push(e))),n.sort(((e,n)=>{let s=t(e),r=t(n);if(s===r)return 0;var a=s<r?-1:1;return"desc"===i?-a:a})),n}function q(e){return/^[\+]?[(]?[0-9]{2,3}[)]?[-\s\.]?[0-9]{3,4}[-\s\.]?[0-9]{4,6}$/im.test(String(e))}function W(e){return/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi.test(String(e).toLowerCase())}function $(e){return/^\d+$/.test(String(e))}function G(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())}function F(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function N(e,t){return n.get(t,"fullname")||n.get(t,"email")||n.get(e,"name")||"Agent"}function B(e){return V(e,"is_ban","boolean")}function H(e,t){if(e&&n.get(t,"key")){e.attributes=e.attributes||[];var i=E(e.attributes,(e=>e.key===t.key));-1!==i?e.attributes[i]=t:e.attributes.push(t)}}function V(e,t,i){if(!e||!e.attributes)return;let n;return Z(e.attributes,(e=>{e&&e.key===t&&("datetime"===i&&(n=e.datetime),"boolean"===i&&(n=e.boolean),"number"===i&&(n=e.number),"text"===i&&(n=e.text),"list"===i&&(n=[e.text].concat(e.other_values)))})),n}function K(e){return(e=e||"").trim().toLowerCase()}function X(){}function Y(e){return("string"==typeof e||e instanceof String)&&(e=e.trim().replace(/;+$/,"")),e}function Q(e,t){var i=[e];let s=t.spacer||10;t=Object.assign({},t,{spacer:s+"px",spacer0:s/2+"px",spacer2:2*s+"px",spacer3:3*s+"px"}),i=ee(i,"'@font_family'"),i=ee(i,"'@font_size'"),i=ee(i,"'@text_color'"),i=ee(i,"'@faded_text_color'"),i=ee(i,"'@primary_color'"),i=ee(i,"'@background'"),i=ee(i,"'@spacer'"),i=ee(i,"'@spacer0'"),i=ee(i,"'@spacer2'"),i=ee(i,"'@spacer3'");for(var r=[],a=0;a<i.length;a++){var o=i[a];if("string"!=typeof o){var c=o.type.substr(2,o.type.length-3),l=n.get(t,c)||n.get(ne,c)||"";r.push(l)}else r.push(o)}return r.join("")}function J(e,t){var i=[e];i=ee(i,"'@primary_color'"),i=ee(i,"@esc-primary-color-esc"),i=ee(i,"'@secondary_color'"),i=ee(i,"'@background'"),i=ee(i,"'@text_color'"),i=ee(i,"'@width'"),i=ee(i,"'@height'"),i=ee(i,"'@desktop_button.width'"),i=ee(i,"'@desktop_button.height'"),i=ee(i,"'@desktop_button.background'"),i=ee(i,"'@desktop_button.border_radius'"),i=ee(i,"'@desktop_button.margin_x'"),i=ee(i,"'@desktop_button.margin_y'"),i=ee(i,"'@mobile_button.width'"),i=ee(i,"'@mobile_button.height'"),i=ee(i,"'@mobile_button.background'"),i=ee(i,"'@mobile_button.border_radius'"),i=ee(i,"'@mobile_button.margin_x'"),i=ee(i,"'@mobile_button.margin_y'"),i=ee(i,"'@widget_position'"),i=ee(i,"'@z_index'"),i=ee(i,"'@z_index_2'"),i=ee(i,"'@z_index_3'"),i=ee(i,"'@z_index_4'"),i=ee(i,"'@z_index_5'");for(var s=[],r=0;r<i.length;r++){var a=i[r];if("string"!=typeof a)if("@esc-primary-color-esc"!==a.type)if("'@z_index_2'"!==a.type)if("'@z_index_3'"!==a.type)if("'@z_index_4'"!==a.type)if("'@z_index_5'"!==a.type){var o=a.type.substr(2,a.type.length-3);c=Y(c=n.get(t,o)||n.get(ne,o)||""),["mobile_button.width","mobile_button.height","mobile_button.margin_x","mobile_button.margin_y","desktop_button.width","desktop_button.height","desktop_button.margin_x","desktop_button.margin_y","width","height"].includes(o)&&(c+="px"),"height"!==o||"full"!==n.get(t,"window_mode")?s.push(c):s.push("100%")}else c=n.get(t,"z_index")||n.get(ne,"z_index"),s.push(c+5);else c=n.get(t,"z_index")||n.get(ne,"z_index"),s.push(c+4);else{var c=n.get(t,"z_index")||n.get(ne,"z_index");s.push(c+3)}else{c=n.get(t,"z_index")||n.get(ne,"z_index");s.push(c+2)}else{c=n.get(t,"primary_color")||n.get(ne,"primary_color");s.push(encodeURIComponent(Y(c)))}else s.push(a)}return s.join("")}function ee(e,t){if(!e||!e.length)return[];var i=[];for(let r=0;r<e.length;r++){var n=e[r];if("string"==typeof n){var s=n.split(t);for(let e=0;e<s.length;e++)i.push(s[e]),i.push({type:t});i.pop()}else i.push(n)}return i}function te(e,t,i){i=L(i,"#sbz92","#"+e),t.styleSheet?t.styleSheet.cssText=i:(t.innerHTML="",t.appendChild(document.createTextNode(i)))}const ie="https://vcdn.subiz-cdn.com/file/bubble_11.svg?v=5",ne={primary_color:"#0265FF",secondary_color:"#555555",background:"linear-gradient(280.16deg, #0053d3 22.03%, #0265ff 78.2%)",text_color:"white",width:375,height:705,window_mode:"mini",desktop_button:{width:.3,height:.3,border_radius:"100%",background_mask_url:ie,margin_x:.3,margin_y:.3},mobile_button:{width:.3,height:.3,border_radius:"100%",background_mask_url:ie,margin_x:.3,margin_y:.3},widget_position:"fixed",z_index:2e9};function se(e,t,i){var n={};for(var s in e)e.hasOwnProperty(s)&&(t&&t.length>0&&-1===t.indexOf(s)||("string"==typeof e[s]?n[s]=z(e[s]):n[s]=e[s]));e=n;let r="";for(var s in e)if(e.hasOwnProperty(s)){var a="";if(e.blur&&(a+="blur("+e.blur+") "),e.grayscale&&(a+="grayscale("+e+") "),a&&(r+="filter: "+a+"!important;"),void 0!==e.rotate&&(r+="transform:rotate("+e.rotate+") !important;"),void 0!==e[s]){let t=e[s]+"";S(i,((e,i)=>{-1!==t.indexOf(i)&&(t=L(t,i,e))})),r+=L(s,"_","-")+":"+t+" !important;","color"===s&&(r+="-webkit-text-fill-color: "+t+" !important;")}}return r}function re(){var e=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,t="undefined"!=typeof InstallTrigger,i=(/constructor/i.test(window.HTMLElement)||(!window.safari||"undefined"!=typeof safari&&window.safari.pushNotification).toString(),!!document.documentMode),n=!i&&!!window.StyleMedia,s=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime);s||(s=navigator.userAgent.indexOf("Chrome"));var r=s&&-1!=navigator.userAgent.indexOf("Edg"),a=(s||e)&&!!window.CSS;return e?"opera":t?"firefox":i?"ie":n||r?"edge":s?"chrome":a?"blink":"unknown"}function ae(e,t,i,r){var a=r.matchAccount()||{},o=r.matchLocation()||{};if(!function(e,t,i){return!(t&&(n.get(e,"once_per_user")||n.get(e,"once_per_session")&&me(t.created,c.now())||n.get(e,"interval_sec")&&n.get(e,"interval_sec")>(c.now()-t.created)/1e3))}(e,i))return!1;for(var l=0;l<T(t);l++){var u=t[l];switch(u.key){case"url":let e=x(u.exclude_urls,(e=>K(e)));if(T(e)>0&&O(e,(e=>K(window.location.href).indexOf(K(e))>-1)))return!1;let t=x(u.urls,(e=>K(e)));if(T(t)>0&&!O(t,(e=>K(window.location.href).indexOf(K(e))>-1)))return!1;break;case"browser":if(T(u.browsers)>0){var d=re();if(!O(u.browsers,(e=>K(e)===K(d))))return!1}break;case"location":if(T(u.exclude_locations)>0&&O(u.exclude_locations,(e=>!(!e.city_name||!e.country_code||e.city_name!==o.city_name||e.country_code!==o.country_code)||!(!e.city_name||e.country_code||e.city_name!==o.city_name)||!(e.city_name||!e.country_code||e.country_code!==o.country_code)||void 0)))return!1;if(T(u.locations)>0&&!O(u.locations,(e=>!(!e.city_name||!e.country_code||e.city_name!==o.city_name||e.country_code!==o.country_code)||!(!e.city_name||e.country_code||e.city_name!==o.city_name)||!(e.city_name||!e.country_code||e.country_code!==o.country_code)||void 0)))return!1;break;case"returning_visitor":if(u.returning_visitor&&r.new_visitor)return!1;if(!u.returning_visitor&&!r.new_visitor)return!1;break;case"user_is_a_contact":let i=n.get(r.matchUser(),"attributes",[]),m=O(i,(e=>"emails"===e.key))||{},f=O(i,(e=>"phones"===e.key))||{},g=m.text||f.text;if(u.user_is_a_contact&&!g)return!1;if(!u.user_is_a_contact&&g)return!1;break;case"device_type":if(T(u.device_types)>0){let e="desktop";if(r.isMobile()&&(e="mobile"),r.isTablet()&&(e="tablet"),!O(u.device_types,(t=>K(t)===K(e))))return!1}break;case"referer":if(T(u.exclude_referers)>0&&O(u.exclude_referers,(e=>K(document.referrer).indexOf(K(e))>-1)))return!1;if(T(u.urls)>0&&!O(u.referers,(e=>K(document.referrer).indexOf(K(e))>-1)))return!1;break;case"source":if(T(u.sources)>0){let e=r.matchTrafficSource()||"direct";if(!O(u.sources,(t=>K(t)===K(e))))return!1}break;case"user_attribute":let _,v=n.get(r.matchUser(),"attributes",[]),y=n.get(u,"user.operator");Z(v,(e=>{e&&e.key===n.get(u,"user.key")&&(_=e.datetime||e.boolean||e.number||e.text||e.list)}));let b=!0;switch(y){case"cons":let e=s(u.value)||[];if(0===T(e))return!1;b=!!O(e,(e=>K(_).indexOf(K(e))>-1));break;case"notEmpty":b=!!_;break;case"empty":b=!_;break;case"true":b=!0===_||"true"===_;break;case"false":b=!_||!1===_||"false"===_}if(!b)return!1;break;case"timming":if("in"===u.business_hour&&!a.is_in_business_hour)return!1;if("notIn"===u.business_hour&&a.is_in_business_hour)return!1;if(T(u.days_of_week)>0&&!O(u.days_of_week,(e=>K(oe((new c).getDay()))===K(e))))return!1;if(T(u.minute_of_days)>0&&T(u.minute_of_days)%2==0){var h=new c,p=h.getMinutes()+60*h.getHours();let e=!1;for(l=0;l<u.minute_of_days.length;l+=2)if(u.minute_of_days[l]<=p&&p<=u.minute_of_days[l+1]){e=!0;break}if(!e)return!1}break;case"offline":if(!a.is_online!=!!u.offline)return!1}}return!0}function oe(e){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e]}let ce={};function le(e,t){for(var i=0;i<e.length;i++){let t=e[i];if(t&&!ce[t]){ce[t]=!0;for(var n=0;n<2;n++){let e=[400,500][n],i=document.createElement("div");i.innerHTML="@!-/#Chào mỪng1",i.style.position="absolute",i.style.display="block",i.style.opacity="0.1",i.style.color="transparent",i.style.fontSize="20px",i.style.height="0px",i.style.top="0px",i.style.width="0px",i.style.fontWeight=e,i.setAttribute("subiz-preload",t+":"+e),document.body.appendChild(i),i.style.fontFamily=t,u((()=>i.remove()),3e3)}}}}function ue(e,t){if(t||(t=()=>{}),!e)return t(),Promise.resolve(!0);let i=new Image;return e=function(e){let t="https://vcdn.subiz-cdn.com/file/";return e?D(e,"/")||D(e,"data:")?e:(D(e,"http://")||D(e,"https://")||D(e,"//")||(e=z(t)+"/"+U(e,"/")),(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace("https://file-subiz.com/",t)).replace("http://file-subiz.com/",t)).replace("https://file-v4.subiz.com/",t)).replace("http://file-v4.subiz.com/",t)).replace("https://filev4.subiz.com/",t)).replace("http://filev4.subiz.com/",t)).replace("https://filev4-1.subiz.com/",t)).replace("http://filev4-1.subiz.com/",t)).replace("https://file.subiz.com/",t)).replace("http://file.subiz.com/",t)).replace("https://file.mysubiz.com/",t)).replace("http://file.mysubiz.com/",t)):""}(e),i.src=e,new Promise((e=>{i.onload=()=>{t(),e()}}))}function de(e){if(!e)return 0;e.length<=2&&(e+=":00");let t=e.split(":");if(2!==t.length)return 0;let i=parseInt(t[0]);if(i<0||i>23)return 0;let n=parseInt(t[1]);return n<0||n>59?0:60*i+n}function he(e,t,i){var n=-(new c).getTimezoneOffset();i&&(n=de(i));var s=new c(e).getTime(),r=new c(t).getTime(),a=Math.ceil((s/60/1e3+n)/60/24),o=Math.ceil((r/60/1e3+n)/60/24);return Math.abs(a-o)}function pe(e,t,i){var n=-(new c).getTimezoneOffset(),s=-(new c).getTimezoneOffset();i&&(s=de(i));var r=new c(e).getTime()+60*(s-n)*1e3,a=new c(t).getTime()+60*(s-n)*1e3;return Math.abs(new c(r).getYear()-new c(a).getYear())}function me(e,t,i){return 0===he(e,t,i)}function fe(e,t,i){var s=-(new c).getTimezoneOffset(),r=s;t&&(r=de(t));var a=new c(_e(e));let o=new c(a);o.setMinutes(a.getMinutes()+r-s),i||(i=new c);let l=o.getHours(),u=o.getMinutes(),d=n.get(navigator,"languages.0","en-US"),h=o.toLocaleDateString(d,{weekday:"long"}),p=o.getFullYear(),m=o.getMonth()+1,f=o.toLocaleDateString(d,{month:"long"}),g=o.getDate();return l<10&&(l="0"+l),u<10&&(u="0"+u),me(a,i,t)?l+":"+u:he(a,i,t)<=5?h+", "+l+":"+u:0===pe(a,i,t)?f+" "+g+", "+l+":"+u:p+"/"+m+"/"+g+", "+l+":"+u}function ge(e){return Math.floor(_e(e)/1e3)}function _e(e){return e?"number"!=typeof e&&(e=new c(e).getTime()):e=0,e>1e18?Math.floor(e/1e6):e>1e15?Math.floor(e/1e3):e>1e12?e:1e3*e}function ve(){let e=ye(),t=document.getElementsByTagName("html")[0].getAttribute("xml:lang")||document.getElementsByTagName("html")[0].getAttribute("lang"),i=navigator.language;return e||t||i}function ye(){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+name+"=([^&#]*)").exec(location.search);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))}var be=e=>new Promise((t=>u(t,e)));function we(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"VND",i=Ce.find((e=>e.code===t))||{name:"Dong",code:"VND",symbol:"₫"},n="",s="";return"VND"===t?(n="",s=" "+i.symbol):(n=i.symbol+" ",s=""),e?n+(e=Math.round(e)).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")+s:`${n}0${s}`}function ke(e){return(e=(e+="").replace("đ","d").replace("Đ","D")).normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function xe(e){centerIfNeeded=0===arguments.length||!!centerIfNeeded;var t=e.parentNode,i=window.getComputedStyle(t,null),n=parseInt(i.getPropertyValue("border-top-width")),s=parseInt(i.getPropertyValue("border-left-width")),r=e.offsetTop-t.offsetTop<t.scrollTop,a=e.offsetTop-t.offsetTop+e.clientHeight-n>t.scrollTop+t.clientHeight,o=e.offsetLeft-t.offsetLeft<t.scrollLeft,c=e.offsetLeft-t.offsetLeft+e.clientWidth-s>t.scrollLeft+t.clientWidth,l=r&&!a;(r||a)&¢erIfNeeded&&(t.scrollTop=e.offsetTop-t.offsetTop-t.clientHeight/2-n+e.clientHeight/2),(o||c)&¢erIfNeeded&&(t.scrollLeft=e.offsetLeft-t.offsetLeft-t.clientWidth/2-s+e.clientWidth/2),(r||a||o||c)&&!centerIfNeeded&&e.scrollIntoView(l)}const Ce=[{name:"Afghani",code:"AFN",symbol:"؋"},{name:"Euro",code:"EUR",symbol:"€"},{name:"Lek",code:"ALL",symbol:"Lek"},{name:"Algerian Dinar",code:"DZD"},{name:"US Dollar",code:"USD",symbol:"$"},{name:"Kwanza",code:"AOA"},{name:"East Caribbean Dollar",code:"XCD",symbol:"$"},{name:"Argentine Peso",code:"ARS",symbol:"$"},{name:"Armenian Dram",code:"AMD"},{name:"Aruban Florin",code:"AWG",symbol:"ƒ"},{name:"Australian Dollar",code:"AUD",symbol:"$"},{name:"Azerbaijan Manat",code:"AZN",symbol:"₼"},{name:"Bahamian Dollar",code:"BSD",symbol:"$"},{name:"Bahraini Dinar",code:"BHD"},{name:"Taka",code:"BDT"},{name:"Barbados Dollar",code:"BBD",symbol:"$"},{name:"Belarusian Ruble",code:"BYN",symbol:"Br"},{name:"Belize Dollar",code:"BZD",symbol:"BZ$"},{name:"CFA Franc BCEAO",code:"XOF"},{name:"Bermudian Dollar",code:"BMD",symbol:"$"},{name:"Indian Rupee",code:"INR",symbol:"₹"},{name:"Ngultrum",code:"BTN"},{name:"Boliviano",code:"BOB",symbol:"$b"},{name:"Mvdol",code:"BOV"},{name:"Convertible Mark",code:"BAM",symbol:"KM"},{name:"Pula",code:"BWP",symbol:"P"},{name:"Norwegian Krone",code:"NOK",symbol:"kr"},{name:"Brazilian Real",code:"BRL",symbol:"R$"},{name:"Brunei Dollar",code:"BND",symbol:"$"},{name:"Bulgarian Lev",code:"BGN",symbol:"лв"},{name:"Burundi Franc",code:"BIF"},{name:"Cabo Verde Escudo",code:"CVE"},{name:"Riel",code:"KHR",symbol:"៛"},{name:"CFA Franc BEAC",code:"XAF"},{name:"Canadian Dollar",code:"CAD",symbol:"$"},{name:"Cayman Islands Dollar",code:"KYD",symbol:"$"},{name:"Chilean Peso",code:"CLP",symbol:"$"},{name:"Unidad de Fomento",code:"CLF"},{name:"Yuan Renminbi",code:"CNY",symbol:"¥"},{name:"Colombian Peso",code:"COP",symbol:"$"},{name:"Unidad de Valor Real",code:"COU"},{name:"Comorian Franc ",code:"KMF"},{name:"Congolese Franc",code:"CDF"},{name:"New Zealand Dollar",code:"NZD",symbol:"$"},{name:"Costa Rican Colon",code:"CRC",symbol:"₡"},{name:"Kuna",code:"HRK",symbol:"kn"},{name:"Cuban Peso",code:"CUP",symbol:"₱"},{name:"Peso Convertible",code:"CUC"},{name:"Netherlands Antillean Guilder",code:"ANG",symbol:"ƒ"},{name:"Czech Koruna",code:"CZK",symbol:"Kč"},{name:"Danish Krone",code:"DKK",symbol:"kr"},{name:"Djibouti Franc",code:"DJF"},{name:"Dominican Peso",code:"DOP",symbol:"RD$"},{name:"Egyptian Pound",code:"EGP",symbol:"£"},{name:"El Salvador Colon",code:"SVC",symbol:"$"},{name:"Nakfa",code:"ERN"},{name:"Lilangeni",code:"SZL"},{name:"Ethiopian Birr",code:"ETB"},{name:"Falkland Islands Pound",code:"FKP",symbol:"£"},{name:"Fiji Dollar",code:"FJD",symbol:"$"},{name:"CFP Franc",code:"XPF"},{name:"Dalasi",code:"GMD"},{name:"Lari",code:"GEL"},{name:"Ghana Cedi",code:"GHS",symbol:"¢"},{name:"Gibraltar Pound",code:"GIP",symbol:"£"},{name:"Quetzal",code:"GTQ",symbol:"Q"},{name:"Pound Sterling",code:"GBP",symbol:"£"},{name:"Guinean Franc",code:"GNF"},{name:"Guyana Dollar",code:"GYD",symbol:"$"},{name:"Gourde",code:"HTG"},{name:"Lempira",code:"HNL",symbol:"L"},{name:"Hong Kong Dollar",code:"HKD",symbol:"$"},{name:"Forint",code:"HUF",symbol:"Ft"},{name:"Iceland Krona",code:"ISK",symbol:"kr"},{name:"Rupiah",code:"IDR",symbol:"Rp"},{name:"SDR (Special Drawing Right)",code:"XDR"},{name:"Iranian Rial",code:"IRR",symbol:"﷼"},{name:"Iraqi Dinar",code:"IQD"},{name:"New Israeli Sheqel",code:"ILS",symbol:"₪"},{name:"Jamaican Dollar",code:"JMD",symbol:"J$"},{name:"Yen",code:"JPY",symbol:"¥"},{name:"Jordanian Dinar",code:"JOD"},{name:"Tenge",code:"KZT",symbol:"лв"},{name:"Kenyan Shilling",code:"KES"},{name:"North Korean Won",code:"KPW",symbol:"₩"},{name:"Won",code:"KRW",symbol:"₩"},{name:"Kuwaiti Dinar",code:"KWD"},{name:"Som",code:"KGS",symbol:"лв"},{name:"Lao Kip",code:"LAK",symbol:"₭"},{name:"Lebanese Pound",code:"LBP",symbol:"£"},{name:"Loti",code:"LSL"},{name:"Rand",code:"ZAR",symbol:"R"},{name:"Liberian Dollar",code:"LRD",symbol:"$"},{name:"Libyan Dinar",code:"LYD"},{name:"Swiss Franc",code:"CHF",symbol:"CHF"},{name:"Pataca",code:"MOP"},{name:"Denar",code:"MKD",symbol:"ден"},{name:"Malagasy Ariary",code:"MGA"},{name:"Malawi Kwacha",code:"MWK"},{name:"Malaysian Ringgit",code:"MYR",symbol:"RM"},{name:"Rufiyaa",code:"MVR"},{name:"Ouguiya",code:"MRU"},{name:"Mauritius Rupee",code:"MUR",symbol:"₨"},{name:"ADB Unit of Account",code:"XUA"},{name:"Mexican Peso",code:"MXN",symbol:"$"},{name:"Mexican Unidad de Inversion (UDI)",code:"MXV"},{name:"Moldovan Leu",code:"MDL"},{name:"Tugrik",code:"MNT",symbol:"₮"},{name:"Moroccan Dirham",code:"MAD"},{name:"Mozambique Metical",code:"MZN",symbol:"MT"},{name:"Kyat",code:"MMK"},{name:"Namibia Dollar",code:"NAD",symbol:"$"},{name:"Nepalese Rupee",code:"NPR",symbol:"₨"},{name:"Cordoba Oro",code:"NIO",symbol:"C$"},{name:"Naira",code:"NGN",symbol:"₦"},{name:"Rial Omani",code:"OMR",symbol:"﷼"},{name:"Pakistan Rupee",code:"PKR",symbol:"₨"},{name:"Balboa",code:"PAB",symbol:"B/."},{name:"Kina",code:"PGK"},{name:"Guarani",code:"PYG",symbol:"Gs"},{name:"Sol",code:"PEN",symbol:"S/."},{name:"Philippine Peso",code:"PHP",symbol:"₱"},{name:"Zloty",code:"PLN",symbol:"zł"},{name:"Qatari Rial",code:"QAR",symbol:"﷼"},{name:"Romanian Leu",code:"RON",symbol:"lei"},{name:"Russian Ruble",code:"RUB",symbol:"₽"},{name:"Rwanda Franc",code:"RWF"},{name:"Saint Helena Pound",code:"SHP",symbol:"£"},{name:"Tala",code:"WST"},{name:"Dobra",code:"STN"},{name:"Saudi Riyal",code:"SAR",symbol:"﷼"},{name:"Serbian Dinar",code:"RSD",symbol:"Дин."},{name:"Seychelles Rupee",code:"SCR",symbol:"₨"},{name:"Leone",code:"SLL"},{name:"Singapore Dollar",code:"SGD",symbol:"$"},{name:"Sucre",code:"XSU"},{name:"Solomon Islands Dollar",code:"SBD",symbol:"$"},{name:"Somali Shilling",code:"SOS",symbol:"S"},{name:"South Sudanese Pound",code:"SSP"},{name:"Sri Lanka Rupee",code:"LKR",symbol:"₨"},{name:"Sudanese Pound",code:"SDG"},{name:"Surinam Dollar",code:"SRD",symbol:"$"},{name:"Swedish Krona",code:"SEK",symbol:"kr"},{name:"WIR Euro",code:"CHE"},{name:"WIR Franc",code:"CHW"},{name:"Syrian Pound",code:"SYP",symbol:"£"},{name:"New Taiwan Dollar",code:"TWD",symbol:"NT$"},{name:"Somoni",code:"TJS"},{name:"Tanzanian Shilling",code:"TZS"},{name:"Baht",code:"THB",symbol:"฿"},{name:"Pa’anga",code:"TOP"},{name:"Trinidad and Tobago Dollar",code:"TTD",symbol:"TT$"},{name:"Tunisian Dinar",code:"TND"},{name:"Turkish Lira",code:"TRY",symbol:"₺"},{name:"Turkmenistan New Manat",code:"TMT"},{name:"Uganda Shilling",code:"UGX"},{name:"Hryvnia",code:"UAH",symbol:"₴"},{name:"UAE Dirham",code:"AED",symbol:" د.إ"},{name:"US Dollar (Next day)",code:"USN"},{name:"Peso Uruguayo",code:"UYU",symbol:"$U"},{name:"Uruguay Peso en Unidades Indexadas (UI)",code:"UYI"},{name:"Unidad Previsional",code:"UYW"},{name:"Uzbekistan Sum",code:"UZS",symbol:"лв"},{name:"Vatu",code:"VUV"},{name:"Bolívar Soberano",code:"VES"},{name:"Bolívar Soberano",code:"VED"},{name:"Dong",code:"VND",symbol:"₫"},{name:"Yemeni Rial",code:"YER",symbol:"﷼"},{name:"Zambian Kwacha",code:"ZMW"},{name:"Zimbabwe Dollar",code:"ZWL"},{name:"Bond Markets Unit European Composite Unit (EURCO)",code:"XBA"},{name:"Bond Markets Unit European Monetary Unit (E.M.U.-6)",code:"XBB"},{name:"Bond Markets Unit European Unit of Account 9 (E.U.A.-9)",code:"XBC"},{name:"Bond Markets Unit European Unit of Account 17 (E.U.A.-17)",code:"XBD"},{name:"Codes specifically reserved for testing purposes",code:"XTS"},{name:"The codes assigned for transactions where no currency is involved",code:"XXX"},{name:"Gold",code:"XAU"},{name:"Palladium",code:"XPD"},{name:"Platinum",code:"XPT"},{name:"Silver",code:"XAG"}]},2302:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{constructor(e){this.isOpen=!0===e,this.cbs=[]}open(){this.isOpen=!0;let e=[];this.cbs.forEach((t=>{this.isOpen?t():e.push(t)})),this.cbs=e}close(){this.isOpen=!1}entry(e,t){return this.isOpen?(t&&(this.isOpen=!1),e&&e(),Promise.resolve()):new Promise((i=>{this.cbs.push((()=>{t&&(this.isOpen=!1),e&&e(),i()}))}))}}},4494:(e,t,i)=>{"use strict";i.d(t,{Z:()=>T});var n={};i.r(n),i.d(n,{extract:()=>p,extractEmails:()=>d,extractEmojis:()=>l,extractLinks:()=>u,extractPhones:()=>h,extractText:()=>f,pipeExtracts:()=>m});var s={};i.r(s),i.d(s,{trackAreaClicked:()=>y,trackExitIntent:()=>_,trackInactivity:()=>b,trackScrollingPercentage:()=>v,trackTimeOnPage:()=>k});var r={};i.r(r),i.d(r,{calcOrderTotal:()=>A,displayOrderShippingAddress:()=>P,getOrderDisplayName:()=>Z,getProductPropName:()=>S});var a=i(8733),o=i(8733);let c=["like","unlike","wink","tongue-out","tired","surprised","smiling","sleepy","sad","neutral","heart-eyes","grinning","crying","confused","angry","cry","heart_eyes","neutral_face","emoji--disappointed","smile","open_mouth","tired_face","stuck_out_tongue","moyai","thumbsdown","dislike","thumbsup","ok_hand","octopus","pig2","wave","mouse","mouse2","rat"];function l(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<c.length;n++)if(e.indexOf(c[n],i)===i){t.push({index:i,length:c[n].length}),i+=c[n].length-1;break}return t}function u(e){e=e||"";for(var t,i=/(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.,~#?&//=]*)/gim,n=[];t=i.exec(e);)n.push({index:t.index,length:i.lastIndex-t.index});return n}function d(e){e=e||"";for(var t,i=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/gim,n=[];t=i.exec(e);)n.push({index:t.index,length:i.lastIndex-t.index});return n}function h(e){e=e||"";for(var t="",i={},n=0;n<e.length;n++){var s=e.charAt(n);if("."===s||"-"===s||" "===s){var r=n>0?e.charAt(n-1):"-",a=n<e.length-1?e.charAt(n+1):"-";-1!=="0123456789".indexOf(r)&&-1!=="0123456789".indexOf(a)||(i[(t+=s).length-1]=n)}else i[(t+=s).length-1]=n}for(var o,c=/([0-9]{8,13})/gim,l=[];o=c.exec(t);)l.push({index:i[o.index],length:i[c.lastIndex-1]-i[o.index]+1});return l}function p(e,t,i){if(!e)return[];var n=[],s=0,r=t(e);if(0===o.size(r))return[{type:"text",text:e}];o.each(r,(t=>{n.push({type:"text",text:e.substr(s,t.index-s)}),n.push({type:i,text:e.substr(t.index,t.length)}),s=t.index+t.length}));var a=o.last(r);return n.push({type:"text",text:e.substr(a.index+a.length,e.length-a.index+a.length)}),o.filter(n,(e=>""!==e.text))}function m(e,t){var i=[];if(0===o.size(t))return[{type:"text",text:e}];var n=t.shift(),s=p(e,n,n.type);return o.each(s,(e=>{if("text"!==e.type)return i.push(e);i=i.concat(m(e.text,t.slice()))})),i}function f(e){var t=u;t.type="link";var i=d;i.type="email";var n=h;n.type="phone";var s=l;return s.type="emoji",m(e,[i,t,n,s])}c=o.map(c,(e=>":"+e+":"));var g=i(8733);function _(e){let t=i=>{i.clientY>10||(e&&e(),document.removeEventListener("mouseout",t))};document.addEventListener("mouseout",t)}function v(e,t){let i=n=>{let s=n.srcElement.scrollingElement?n.srcElement.scrollingElement.scrollTop:n.srcElement.scrollTop,r=n.srcElement.scrollingElement?n.srcElement.scrollingElement.scrollHeight:n.srcElement.scrollHeight;s>0&&r>0&&(s+window.innerHeight)/r>=e&&(t&&t(),window.removeEventListener("scroll",i,!1))};window.addEventListener("scroll",i,!1)}function y(e,t){e&&(e=e||"",g.map(e.split("\n"),(e=>{(e=g.trim(e))&&function(e,t,i){document.addEventListener("click",(function(e){let n=document.querySelectorAll(t),s=e.target;for(let t=0,r=n.length;t<r;t++){let r=s,a=n[t];for(;r&&r!==document;){if(r===a)return i.call(a,e);r=r.parentNode}}}))}(0,e,t)})))}function b(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0,i=["scroll","keyup","keydown","mousemove","mousewheel","mouseenter","mouseover","mousedown","touchstart","touchmove","touchenter"],n=0,s=()=>{n=0},r=g.setInterval((()=>{if(n++,!(n<e)){t&&t();for(let e of i)document.removeEventListener(e,s,!1);g.clearInterval(r)}}),1e3);for(let e of i)document.addEventListener(e,s,!1)}let w=0;function k(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;if(e<1)return g.setTimeout((function(){t(e)}),100);let i=g.setInterval((()=>{w<e||(t&&t(w),g.clearInterval(i))}),1e3)}g.setInterval((()=>{w+=5}),5e3);const x=i(6877),C=i(8733);function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" - ",i=x.get(e,"options",[]),n=x.get(e,"props",[]),s=x.filter(i,(e=>x.size(e.values)>1)),r=[];return x.each(s,(e=>{let t=x.find(n,(t=>t.key===e.key))||{};t.value&&r.push(t.value)})),r.join(t)}function Z(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.number||e.id||""}function P(e,t){let i=x.get(e,"shipping.address",{}),n=[i.address,i.ward,i.district,i.province].filter((e=>e)).join(", ").trim();return t&&(n=(n||"").replace(/Hà Nội/gi,"HN").replace(/Hồ Chí Minh/gi,"HCM").replace(/Thành Phố/gi,"TP")),n}function A(e){let t=0,i=0,n=0;x.map(e.items,(e=>{if(!e.product)return 0;let s=x.get(e,"product.price",0)*(e.quantity||0);n+=s,"percentage"==e.discount_type?e.discount_percentage>0&&(i+=s*e.discount_percentage/1e4,s*=1-(e.discount_percentage||0)/1e4):"amount"==e.discount_type&&e.discount_amount>0&&(i+=e.discount_amount,s-=e.discount_amount||0,s<=0&&(s=0)),e.total=s,t+=s}));let s={};x.map(e.items,((e,t)=>{if(!e.product)return;let i=e.product.tax;if(!i)return;if(!i.id)return;let n=e.total*i.percentage/1e4;e.total_tax=n,s[t]={tax:i,taxprice:n}}));let r=0;x.map(s,(e=>r+=e.taxprice));let a=0;"percentage"==e.discount_type&&e.discount_percentage>0?a=(t+r)*e.discount_percentage/1e4:"amount"==e.discount_type&&(a=e.discount_amount||0);let o=x.get(e,"shipping.nominal_fee",0);if(o>0&&x.get(e,"shipping.tax.id")){let t=e.shipping.tax,i=o*(t.percentage/1e4);s.ship={tax:t,taxprice:i},e.shipping.total_tax=i}r=0,x.map(s,(e=>r+=e.taxprice));let c=t+r-a+o;c+=e.adjustment||0,c<0&&(c=0),e.subtotal=t,e._computed_discount=a,e._taxM=s,e.total=c,e.total_tax=r,e._discount_before_tax=i,e._order_value=n}x.filter=C.filter,x.map=C.map,x.each=C.each,x.size=C.size,x.find=C.find;var M={};(M=Object.assign(M,a)).Gate=i(2302).Z,M.Mutex=i(3657).Z;var D=i(6877);M.get=D.get,M.set=D.set,M.Pubsub=i(2851).Z,M=Object.assign(M,n),M=Object.assign(M,s);const T=M=Object.assign(M,r)},3657:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{constructor(){this.isOpen=!0,this.cbs=[]}_check(){if(!this.isOpen)return;let e=this.cbs.pop();e&&(this.isOpen=!1,e())}lock(){return new Promise((e=>{this.cbs.push(e),this._check()}))}unlock(){this.isOpen||(this.isOpen=!0,this._check())}}},6877:(e,t,i)=>{"use strict";i.r(t),i.d(t,{get:()=>o,set:()=>c});var n=Object.prototype.toString,s=Array.isArray||function(e){return"[object Array]"===n.call(e)};function r(e){var t=parseInt(e);return t.toString()===e?t:e}function a(e,t){if(function(e,t){return"number"==typeof t&&s(e)||function(e,t){return null!=e&&Object.prototype.hasOwnProperty.call(e,t)}(e,t)}(e,t))return e[t]}function o(e,t,i){if("number"==typeof t&&(t=[t]),!t||0===t.length)return e;if(null==e)return i;if("string"==typeof t)return o(e,t.split("."),i);var n=r(t[0]),s=a(e,n);return void 0===s?i:1===t.length?s:o(e[n],t.slice(1),i)}function c(e,t,i){if("number"==typeof t&&(t=[t]),!t||0===t.length)return e;if("string"==typeof t)return c(e,t.split(".").map(r),i);var n=t[0],s=a(e,n);return 1===t.length?(e[n]=i,s):(void 0===s&&(e[n]="number"==typeof t[1]?[]:{}),c(e[n],t.slice(1),i))}},2851:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var{filter:n,map:s}=i(8733);class r{constructor(){this.listeners={}}publish(e,t,i,r){this.listeners[e]=n(this.listeners[e],(e=>e.obj._isMounted)),s(this.listeners[e],(e=>{let{cb:n}=e;return n(t,i,r)}))}on2(e,t,i){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({obj:e,cb:i})}}},9554:function(e){e.exports=function(){"use strict";var e=function(){return e.get.apply(e,arguments)},t=e.utils={isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isPlainObject:function(e){return!!e&&"[object Object]"===Object.prototype.toString.call(e)},toArray:function(e){return Array.prototype.slice.call(e)},getKeys:Object.keys||function(e){var t=[],i="";for(i in e)e.hasOwnProperty(i)&&t.push(i);return t},encode:function(e){return String(e).replace(/[,;"\\=\s%]/g,(function(e){return encodeURIComponent(e)}))},decode:function(e){return decodeURIComponent(e)},retrieve:function(e,t){return null==e?t:e}};return e.defaults={},e.expiresMultiplier=86400,e.set=function(e,i,n){if(t.isPlainObject(e))for(var s in e)e.hasOwnProperty(s)&&this.set(s,e[s],i);else{var r=void 0!==(n=t.isPlainObject(n)?n:{expires:n}).expires?n.expires:this.defaults.expires||"",a=typeof r;"string"===a&&""!==r?r=new Date(r):"number"===a&&(r=new Date(+new Date+1e3*this.expiresMultiplier*r)),""!==r&&"toUTCString"in r&&(r=";expires="+r.toUTCString());var o=n.path||this.defaults.path;o=o?";path="+o:"";var c=n.domain||this.defaults.domain;c=c?";domain="+c:"";var l=n.secure||this.defaults.secure?";secure":"";!1===n.secure&&(l="");var u=n.sameSite||this.defaults.sameSite;u=u?";SameSite="+u:"",null===n.sameSite&&(u=""),document.cookie=t.encode(e)+"="+t.encode(i)+r+o+c+l+u}return this},e.setDefault=function(i,n,s){if(t.isPlainObject(i)){for(var r in i)void 0===this.get(r)&&this.set(r,i[r],n);return e}if(void 0===this.get(i))return this.set.apply(this,arguments)},e.remove=function(e){for(var i=0,n=(e=t.isArray(e)?e:t.toArray(arguments)).length;i<n;i++)this.set(e[i],"",-1);return this},e.removeSpecific=function(e,i){if(!i)return this.remove(e);e=t.isArray(e)?e:[e],i.expires=-1;for(var n=0,s=e.length;n<s;n++)this.set(e[n],"",i);return this},e.empty=function(){return this.remove(t.getKeys(this.all()))},e.get=function(e,i){var n=this.all();if(t.isArray(e)){for(var s={},r=0,a=e.length;r<a;r++){var o=e[r];s[o]=t.retrieve(n[o],i)}return s}return t.retrieve(n[e],i)},e.all=function(){if(""===document.cookie)return{};for(var e=document.cookie.split("; "),i={},n=0,s=e.length;n<s;n++){var r=e[n].split("="),a=t.decode(r.shift()),o=t.decode(r.join("="));i[a]=o}return i},e.enabled=function(){if(navigator.cookieEnabled)return!0;var t="_"===e.set("_","_").get("_");return e.remove("_"),t},e}()},8690:(e,t,i)=>{e.exports=i.p+"assets/img/award1a.1a58e10.png"},2300:(e,t,i)=>{e.exports=i.p+"assets/img/award3a.3b74423.png"},4546:(e,t,i)=>{e.exports=i.p+"assets/img/award4a.ed6ccd4.png"},5459:(e,t,i)=>{e.exports=i.p+"assets/img/award5.39eb7ae.png"},7002:(e,t,i)=>{e.exports=i.p+"assets/img/examplte_logo.f86535f.svg"},639:(e,t,i)=>{e.exports=i.p+"assets/img/main-service1.d536cc2.png"},9417:(e,t,i)=>{e.exports=i.p+"assets/img/main-service2.9b99549.png"},6400:(e,t,i)=>{"use strict";i.d(t,{HY:()=>g,Vf:()=>f,h:()=>p,sY:()=>R,wA:()=>_});var n,s,r,a,o,c={},l=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,t){for(var i in t)e[i]=t[i];return e}function h(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,i){var s,r,a,o={};for(a in t)"key"==a?s=t[a]:"ref"==a?r=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return m(e,o,s,r,null)}function m(e,t,i,n,a){var o={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++r:a};return null==a&&null!=s.vnode&&s.vnode(o),o}function f(){return{current:null}}function g(e){return e.children}function _(e,t){this.props=e,this.context=t}function v(e,t){if(null==t)return e.__?v(e.__,e.__.__k.indexOf(e)+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?v(e):null}function y(e){var t,i;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e){e.__e=e.__c.base=i.__e;break}return y(e)}}function b(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!w.__r++||o!==s.debounceRendering)&&((o=s.debounceRendering)||setTimeout)(w)}function w(){for(var e;w.__r=a.length;)e=a.sort((function(e,t){return e.__v.__b-t.__v.__b})),a=[],e.some((function(e){var t,i,n,s,r,a;e.__d&&(r=(s=(t=e).__v).__e,(a=t.__P)&&(i=[],(n=d({},s)).__v=s.__v+1,M(a,s,n,t.__n,void 0!==a.ownerSVGElement,null!=s.__h?[r]:null,i,null==r?v(s):r,s.__h),D(i,s),s.__e!=r&&y(s)))}))}function k(e,t,i,n,s,r,a,o,u,d){var h,p,f,_,y,b,w,k=n&&n.__k||l,S=k.length;for(i.__k=[],h=0;h<t.length;h++)if(null!=(_=i.__k[h]=null==(_=t[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?m(null,_,null,null,_):Array.isArray(_)?m(g,{children:_},null,null,null):_.__b>0?m(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)){if(_.__=i,_.__b=i.__b+1,null===(f=k[h])||f&&_.key==f.key&&_.type===f.type)k[h]=void 0;else for(p=0;p<S;p++){if((f=k[p])&&_.key==f.key&&_.type===f.type){k[p]=void 0;break}f=null}M(e,_,f=f||c,s,r,a,o,u,d),y=_.__e,(p=_.ref)&&f.ref!=p&&(w||(w=[]),f.ref&&w.push(f.ref,null,_),w.push(p,_.__c||y,_)),null!=y?(null==b&&(b=y),"function"==typeof _.type&&_.__k===f.__k?_.__d=u=x(_,u,e):u=C(e,_,f,k,y,u),"function"==typeof i.type&&(i.__d=u)):u&&f.__e==u&&u.parentNode!=e&&(u=v(f))}for(i.__e=b,h=S;h--;)null!=k[h]&&z(k[h],k[h]);if(w)for(h=0;h<w.length;h++)L(w[h],w[++h],w[++h])}function x(e,t,i){for(var n,s=e.__k,r=0;s&&r<s.length;r++)(n=s[r])&&(n.__=e,t="function"==typeof n.type?x(n,t,i):C(i,n,n,s,n.__e,t));return t}function C(e,t,i,n,s,r){var a,o,c;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==i||s!=r||null==s.parentNode)e:if(null==r||r.parentNode!==e)e.appendChild(s),a=null;else{for(o=r,c=0;(o=o.nextSibling)&&c<n.length;c+=1)if(o==s)break e;e.insertBefore(s,r),a=r}return void 0!==a?a:s.nextSibling}function S(e,t,i){"-"===t[0]?e.setProperty(t,i):e[t]=null==i?"":"number"!=typeof i||u.test(t)?i:i+"px"}function Z(e,t,i,n,s){var r;e:if("style"===t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)i&&t in i||S(e.style,t,"");if(i)for(t in i)n&&i[t]===n[t]||S(e.style,t,i[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?n||e.addEventListener(t,r?A:P,r):e.removeEventListener(t,r?A:P,r);else if("dangerouslySetInnerHTML"!==t){if(s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,i))}}function P(e){this.l[e.type+!1](s.event?s.event(e):e)}function A(e){this.l[e.type+!0](s.event?s.event(e):e)}function M(e,t,i,n,r,a,o,c,l){var u,h,p,m,f,v,y,b,w,x,C,S,Z,P,A,M=t.type;if(void 0!==t.constructor)return null;null!=i.__h&&(l=i.__h,c=t.__e=i.__e,t.__h=null,a=[c]),(u=s.__b)&&u(t);try{e:if("function"==typeof M){if(b=t.props,w=(u=M.contextType)&&n[u.__c],x=u?w?w.props.value:u.__:n,i.__c?y=(h=t.__c=i.__c).__=h.__E:("prototype"in M&&M.prototype.render?t.__c=h=new M(b,x):(t.__c=h=new _(b,x),h.constructor=M,h.render=U),w&&w.sub(h),h.props=b,h.state||(h.state={}),h.context=x,h.__n=n,p=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=M.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,M.getDerivedStateFromProps(b,h.__s))),m=h.props,f=h.state,p)null==M.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==M.getDerivedStateFromProps&&b!==m&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,x)||t.__v===i.__v){for(h.props=b,h.state=h.__s,t.__v!==i.__v&&(h.__d=!1),h.__v=t,t.__e=i.__e,t.__k=i.__k,t.__k.forEach((function(e){e&&(e.__=t)})),C=0;C<h._sb.length;C++)h.__h.push(h._sb[C]);h._sb=[],h.__h.length&&o.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,x),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(m,f,v)}))}if(h.context=x,h.props=b,h.__v=t,h.__P=e,S=s.__r,Z=0,"prototype"in M&&M.prototype.render){for(h.state=h.__s,h.__d=!1,S&&S(t),u=h.render(h.props,h.state,h.context),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[]}else do{h.__d=!1,S&&S(t),u=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++Z<25);h.state=h.__s,null!=h.getChildContext&&(n=d(d({},n),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(v=h.getSnapshotBeforeUpdate(m,f)),A=null!=u&&u.type===g&&null==u.key?u.props.children:u,k(e,Array.isArray(A)?A:[A],t,i,n,r,a,o,c,l),h.base=t.__e,t.__h=null,h.__h.length&&o.push(h),y&&(h.__E=h.__=null),h.__e=!1}else null==a&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=T(i.__e,t,i,n,r,a,o,l);(u=s.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=a)&&(t.__e=c,t.__h=!!l,a[a.indexOf(c)]=null),s.__e(e,t,i)}}function D(e,t){s.__c&&s.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){s.__e(e,t.__v)}}))}function T(e,t,i,s,r,a,o,l){var u,d,p,m=i.props,f=t.props,g=t.type,_=0;if("svg"===g&&(r=!0),null!=a)for(;_<a.length;_++)if((u=a[_])&&"setAttribute"in u==!!g&&(g?u.localName===g:3===u.nodeType)){e=u,a[_]=null;break}if(null==e){if(null===g)return document.createTextNode(f);e=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,f.is&&f),a=null,l=!1}if(null===g)m===f||l&&e.data===f||(e.data=f);else{if(a=a&&n.call(e.childNodes),d=(m=i.props||c).dangerouslySetInnerHTML,p=f.dangerouslySetInnerHTML,!l){if(null!=a)for(m={},_=0;_<e.attributes.length;_++)m[e.attributes[_].name]=e.attributes[_].value;(p||d)&&(p&&(d&&p.__html==d.__html||p.__html===e.innerHTML)||(e.innerHTML=p&&p.__html||""))}if(function(e,t,i,n,s){var r;for(r in i)"children"===r||"key"===r||r in t||Z(e,r,null,i[r],n);for(r in t)s&&"function"!=typeof t[r]||"children"===r||"key"===r||"value"===r||"checked"===r||i[r]===t[r]||Z(e,r,t[r],i[r],n)}(e,f,m,r,l),p)t.__k=[];else if(_=t.props.children,k(e,Array.isArray(_)?_:[_],t,i,s,r&&"foreignObject"!==g,a,o,a?a[0]:i.__k&&v(i,0),l),null!=a)for(_=a.length;_--;)null!=a[_]&&h(a[_]);l||("value"in f&&void 0!==(_=f.value)&&(_!==e.value||"progress"===g&&!_||"option"===g&&_!==m.value)&&Z(e,"value",_,m.value,!1),"checked"in f&&void 0!==(_=f.checked)&&_!==e.checked&&Z(e,"checked",_,m.checked,!1))}return e}function L(e,t,i){try{"function"==typeof e?e(t):e.current=t}catch(e){s.__e(e,i)}}function z(e,t,i){var n,r;if(s.unmount&&s.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||L(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){s.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(r=0;r<n.length;r++)n[r]&&z(n[r],t,i||"function"!=typeof e.type);i||null==e.__e||h(e.__e),e.__=e.__e=e.__d=void 0}function U(e,t,i){return this.constructor(e,i)}function R(e,t,i){var r,a,o;s.__&&s.__(e,t),a=(r="function"==typeof i)?null:i&&i.__k||t.__k,o=[],M(t,e=(!r&&i||t).__k=p(g,null,[e]),a||c,c,void 0!==t.ownerSVGElement,!r&&i?[i]:a?null:t.firstChild?n.call(t.childNodes):null,o,!r&&i?i:a?a.__e:t.firstChild,r),D(o,e)}n=l.slice,s={__e:function(e,t,i,n){for(var s,r,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((r=s.constructor)&&null!=r.getDerivedStateFromError&&(s.setState(r.getDerivedStateFromError(e)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,n||{}),a=s.__d),a)return s.__E=s}catch(t){e=t}throw e}},r=0,_.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},i),this.props)),e&&d(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),b(this))},_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),b(this))},_.prototype.render=g,a=[],w.__r=0}},n={};function s(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,exports:{}};return i[e].call(r.exports,r,r.exports,s),r.exports}s.m=i,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,i)=>(s.f[i](e,t),t)),[])),s.u=e=>"18a02a9c54e."+e+".js",s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@subiz/widget-v4:",s.l=(i,n,r,a)=>{if(e[i])e[i].push(n);else{var o,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==i||d.getAttribute("data-webpack")==t+r){o=d;break}}o||(c=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-webpack",t+r),o.src=i),e[i]=[n];var h=(t,n)=>{o.onerror=o.onload=null,clearTimeout(p);var s=e[i];if(delete e[i],o.parentNode&&o.parentNode.removeChild(o),s&&s.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=h.bind(null,o.onerror),o.onload=h.bind(null,o.onload),c&&document.head.appendChild(o)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="https://vcdn.subiz-cdn.com/widget-v4/public/",(()=>{var e={493:0};s.f.j=(t,i)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else{var r=new Promise(((i,s)=>n=e[t]=[i,s]));i.push(n[2]=r);var a=s.p+s.u(t),o=new Error;s.l(a,(i=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+a+")",o.name="ChunkLoadError",o.type=r,o.request=a,n[1](o)}}),"chunk-"+t,t)}};var t=(t,i)=>{var n,r,[a,o,c]=i,l=0;if(a.some((t=>0!==e[t]))){for(n in o)s.o(o,n)&&(s.m[n]=o[n]);c&&c(s)}for(t&&t(i);l<a.length;l++)r=a[l],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0},i=self.webpackChunk_subiz_widget_v4=self.webpackChunk_subiz_widget_v4||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),(()=>{"use strict";var e=s(4494),t=s(1606).Z,i=s(4878).Z,n=s(9489).Z;const r={kv:t,lsdb:s(6929).Z,chain:i,inmem_localstorage:n};function a(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const o=s(7460);function c(t,i){let n=t.request;"text/plain"===n.content_type&&void 0!==n.body&&(n.body=e.Z.stringify(n.body)),i(!0)}function l(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}o.env.XMLHttpRequest=e.Z.XMLHttpRequest;const u=s(7460);function d(t,i){let n=t.request;"text/plain"===n.content_type&&void 0!==n.body&&(n.body=e.Z.stringify(n.body)),i(!0)}u.env.XMLHttpRequest=window.XMLHttpRequest;const h=Promise.resolve({code:200});function p(e,t,i,n){let s=e+".subizv4.subikon";return{id:t,account_id:e,created:1610452894916,members:[{type:"user",id:i,membership:"active",invited_by:{id:i,type:"user"}},{type:"agent",id:n,conversation_id:t,membership:"active",invited_by:{id:i,type:"user"}}],ended:1610454875505,state:"ended",integration:{account_id:e,connector_id:"subikon",name:"Subiz Widget",connector_type:"subiz",state:"activated",id:s},actived:1610453070259,last_message_sent:{id:"evqyiykaoizbwnkaecwphttwk",account_id:e,created:1616213311830,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"ok cám ơn!",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213312110}]}}},assigned_to:{},first_message:"Xin chào",subject:"Chúc một ngày tốt lành",source:"https://subiz.com.vn/"}}const m=class{onEvent(){}onInterrupted(){}subscribe(){}stop(){}};function f(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var g=s(3165),_=s(8454),v=s(9554);v.defaults.path="/",v.expiresMultiplier=86400,v.defaults.expires=3650;const y=e.Z.Date.now();class b{constructor(t,i,n,s,m){if(f(this,"inmem",!1),f(this,"cookie",v),f(this,"_currentViewingProduct",{}),f(this,"new_visitor",!0),f(this,"matchUser",(()=>(this._touchAcc(),this.cache.match("user")))),f(this,"suggest_addresses",(e=>this.api.suggest_address(e))),f(this,"matchAccount",(()=>this.cache.match("account"))),f(this,"matchPaymentMethods",(()=>this.cache.match("payment_methods"))),f(this,"matchUnread",(()=>{let t=this.matchUser(),i=this.matchConvo("*"),n=0;return e.Z.map(i,(i=>{e.Z.isConvoSeen(i,t.id)||n++})),n})),f(this,"matchPlugin",(()=>e.Z.size(this.forcePlugins)>0?e.Z.cloneDeep(this.forcePlugins):e.Z.cloneDeep(this.cache.match("plugin"))||{})),f(this,"device",{}),f(this,"browserVisibility","visible"),f(this,"matchAgent",(e=>{let t=this.cache.match("agent")||{};return"*"===e?t:t[e]})),f(this,"matchConvo",(t=>{if(t)return"*"===t?(this._touchAcc(),e.Z.filter(this.cache.all(),((e,t)=>t.startsWith("convo_")))):(this.isInsync(t)||this.fetchConvo(t),this.cache.match("convo_"+t))})),f(this,"fetchConvo",(async e=>{if(await this.readyGate.entry(),await this.reconnectGate.entry(void 0,!0),this.isInsync(e))return this.reconnectGate.open();this.markSync(e);let{body:t,error:i}=await this.api.getConversation(e);return t&&!i&&this._setConvo(t),this.reconnectGate.open()})),f(this,"list_provinces",(()=>this.api.list_provinces())),f(this,"list_districts",(e=>this.api.list_districts(e))),f(this,"list_wards",(e=>this.api.list_wards(e))),f(this,"listEvents",(t=>{if(t&&"*"!==t&&"string"==typeof t)return this.isInsync("events"+t)||e.Z.setTimeout((async()=>(await this.readyGate.entry(),await this.reconnectGate.entry(void 0,!0),this.isInsync("events"+t)||(this.markSync("events"+t),await this.chain.reload(t,((e,t,i)=>this.listmessageapi(e,t,i))),this.pubsub.publish("account")),this.reconnectGate.open())),10),this.chain.listM(t)})),f(this,"fetchMoreEvents",(async e=>{let{error:t}=await this.chain.fetchMore(e,50,((e,t,i)=>this.listmessageapi(e,t,i)));return this.pubsub.publish("account"),{error:t}})),f(this,"matchLocation",(()=>this.cache.match("location")||{})),f(this,"matchBot",(()=>this.cache.match("bot")||{})),f(this,"readyGate",new e.Z.Gate),f(this,"convoGate",new e.Z.Gate(!0)),f(this,"reconnectGate",new e.Z.Gate(!0)),f(this,"wsGate",new e.Z.Gate(!0)),f(this,"matchLastview",(()=>{let e=this.kv.match("lastview")||{},t=this.cache.match("user")||{};return t.id?e.user_id!=t.id?{}:e:{}})),f(this,"matchIsOpen",(()=>!!this.kv.match("isopen"))),f(this,"matchHasManuallyClosed",(()=>!!this.kv.match("hasManuallyClosed"))),f(this,"matchClosePreviewAt",(()=>this.kv.match("close_preview_at")||0)),f(this,"sendPresence",e.Z.throttle((async()=>{await this.readyGate.entry(),e.Z.get(this.cache.match("user"),"id")&&(e.Z.isUserBanned(this.cache.match("user"))||("visible"===this.browserVisibility&&document.hasFocus()?this.api.sendContentView(this.device,location.href,document.title,this._currentViewingProduct.id,this._currentViewingProduct.source_id,this._currentViewingProduct.sku):this.api.sendLostFocus(this.device,this._currentViewingProduct.id,this._currentViewingProduct.source_id,this._currentViewingProduct.sku)))}),1e3,{leading:!1})),f(this,"now",(()=>e.Z.Date.now()+this.timeDiff)),f(this,"seenQueue",[]),f(this,"matchTrafficSource",(()=>this.kv.match("traffic_source"))),f(this,"_typing",e.Z.throttle((e=>this.api.sendTyping(e)),3e3,{trailing:!1})),f(this,"onConvoEvent",((e,t)=>this.pubsub.on2(e,"events",t))),f(this,"seenConvo",(e=>{e&&"create"!==e&&this.seenQueue.push(e)})),f(this,"onUpdate",((e,t)=>this.pubsub.on2(e,"account",t))),f(this,"onResetCSS",((e,t)=>this.pubsub.on2(e,"resetCSS",t))),f(this,"onHighlight",((e,t)=>this.pubsub.on2(e,"highlight",t))),f(this,"setHasManuallyClosed",(()=>this.kv.put("hasManuallyClosed",!0))),f(this,"setIsOpen",(e=>{let t=this.kv.match("isopen");this.kv.put("isopen",e),!t&&e&&x("SUBIZ Chat","Opened","Subiz Windows")})),f(this,"closePreview",(()=>this.kv.put("close_preview_at",(new e.Z.Date).getTime()))),f(this,"setLastview",((e,t)=>{let i=this.cache.match("user")||{};i.id&&this.kv.put("lastview",{user_id:i.id,view:e,opts:t})})),f(this,"timeDiff",0),this.g_sync={},this.forceDevice=null,this.forcePlugins={},this.forceAcc={},this.forceChatbox={},this.RealtimeURL=n,this.fake=m,this.FileURL=i,this.fake?this.api=new class{constructor(t,i){l(this,"listConversations",(e=>{let t=p(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid);return Promise.resolve({body:{anchor:"",conversations:[t]},code:200})})),l(this,"listMessages",((e,t,i)=>{let n=function(e,t,i,n){let s=e+".subizv4.subikon";return[{id:"evqyiyjmxrjsylftvnrghrfmq",account_id:e,created:1616213202264,type:"conversation_invited",by:{id:i,type:"user"},data:{conversation:{id:t,account_id:e,members:[{type:"user",id:i,last_page_view_url:"https://subiz.com.vn/",membership:"observer",invited_by:{id:i,type:"user"}}],state:"pending"}}},{id:"evqyiyjmyqdgrouswczzawuzp",account_id:e,created:1616213202559,type:"conversation_invited",by:{id:i,type:"user"},data:{conversation:{id:t,account_id:e,members:[{type:"agent",id:n,conversation_id:t,membership:"observer",invited_by:{id:i,type:"user"}}],state:"pending",source:"https://subiz.com.vn/vi/"}}},{id:"evqyiyjmyzjpyehnngvmcyauf",account_id:e,created:1616213202668,type:"conversation_state_updated",by:{id:i,type:"user"},data:{conversation:{id:t,account_id:e,state:"active"}}},{id:"evqyiyjmzaozvqgbkljbwywdl",account_id:e,created:1616213202683,type:"conversation_joined",by:{id:i,type:"user"},data:{conversation:{id:t,members:[{type:"user",id:i,last_page_view_url:"https://subiz.com.vn/",membership:"active",invited_by:{id:i,type:"user"}}]}}},{id:"evqyiyjmzatvtgpdmmpzwnwgn",account_id:e,created:1616213202685,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"Xin chào",format:"plaintext",fields:[{key:"idempotency",value:'"wrueysyjbhqrkiwhsejpqrwqrdkkyaibajdw"'}],integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213203068}]}}},{id:"evqyiyjrhsfyuxtetszmvkkke",account_id:e,created:1616213237491,type:"conversation_joined",by:{id:i,type:"user"},data:{conversation:{id:t,members:[{type:"agent",id:n,conversation_id:t,membership:"active",invited_by:{id:i,type:"user"}}]}}},{id:"evqyiyjrhtroknjyakrlrwhgr",account_id:e,created:1616213237508,type:"message_sent",by:{id:n,client_id:"dashboard",type:"agent"},data:{message:{conversation_id:t,text:"chào bạn, mình có thể giúp gì được cho bạn :grinning:",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"receive",created:1616213237742},{member_id:i,type:"seen",created:1616213240057}]}}},{id:"evqyiyjuvjinmclneroerxmrl",account_id:e,created:1616213265805,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"mình muốn hỏi giá sản phẩm IPhone X",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213267090}]}}},{id:"evqyiyjzjxzfcsexshcjbbnnf",account_id:e,created:1616213302432,type:"message_sent",by:{id:n,client_id:"dashboard",type:"agent"},data:{message:{conversation_id:t,text:"IPhone X hiện đang được bán tại cửa hàng với giá 12tr đồng nha bạn",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"receive",created:1616213302698},{member_id:i,type:"seen",created:1616213305071}]}}},{id:"evqyiykaoizbwnkaecwphttwk",account_id:e,created:1616213311830,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"ok cám ơn!",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213312110}]}}}]}(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid);return Promise.resolve({body:n,code:200})})),l(this,"ajax",u),l(this,"start",(e=>h)),l(this,"sendConvoEvent",((e,t)=>h)),l(this,"createPostback",((e,t)=>h)),l(this,"markAsReceived",((e,t)=>h)),l(this,"markAsSeen",((e,t)=>h)),l(this,"getConversation",(e=>Promise.resolve({body:p(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid),code:200}))),l(this,"getLocaleContent",(e=>this.apireq.get(`/accounts/${this.accid}/locales/${e}`))),l(this,"sendEvent",(e=>h)),l(this,"sendTyping",(e=>h)),l(this,"sendPresence",(e=>h)),l(this,"sendContent",(e=>h)),l(this,"sendLostFocus",(e=>h)),l(this,"sendContentView",(e=>h)),l(this,"uploadToS3",(async e=>h)),l(this,"getChallenge",(e=>h)),l(this,"time",(t=>Promise.resolve({code:200,body:(new e.Z.Date).toISOString()}))),l(this,"updateUser",(e=>h)),l(this,"getUser",(e=>Promise.resolve({code:200,body:{id:"usqzgtgfake",attributes:[{key:"fullname",text:"Kiều Thanh"}]}}))),l(this,"getAccountSetting",(()=>this.apireq.get(`/accounts/${this.accid}/settings`))),l(this,"getIsOnline",(()=>this.apireq.get(`/accounts/${this.accid}/is_online`))),l(this,"sendImpression",(e=>h)),l(this,"sendConversion",(e=>h)),this.FileURL=i,this.apireq=u.setBaseUrl(t).setContentType("text/plain").beforeHook(d).setParser("json")}setAgentId(e){this.agentid=e}setAuth(e){return this.accid=e.accid,this.mask=e.mask,this.uid=e.uid,{account_id:this.accid,id:"usqzgtgfake",attributes:[{key:"fullname",text:"Kiều Thanh"}]}}}(t,i):this.api=new class{constructor(t,i){a(this,"listConversations",(e=>this.apireq.addQuery("user_id",this.uid).addQuery("integration_id",`${this.accid}.subizv4.subikon`).get(`/accounts/${this.accid}/conversations`))),a(this,"listMessages",((e,t,i)=>this.apireq.addQuery("limit",t).addQuery("start_id",i).get(`/accounts/${this.accid}/conversations/${e}/messages`))),a(this,"ajax",o),a(this,"start",(t=>{let i={starter_id:this.uid,starter_type:"user",touchpoint:{channel:"subiz",source:"web"}};return e.Z.each(t,((e,t)=>{i[t]=e})),this.apireq.post(`/accounts/${this.accid}/conversations`,i)})),a(this,"sendConvoEvent",((e,t)=>this.apireq.post(`/accounts/${this.accid}/conversations/${e}/events`,t))),a(this,"createPostback",((e,t)=>this.apireq.post(`/accounts/${this.accid}/conversations/${e}/postbacks`,t))),a(this,"markAsReceived",((e,t)=>this.apireq.post(`/accounts/${this.accid}/conversations/${e}/messages/${t}/receive`))),a(this,"markAsSeen",((e,t)=>this.apireq.post(`/accounts/${this.accid}/conversations/${e}/messages/${t}/seen`))),a(this,"getConversation",(e=>this.apireq.get(`/accounts/${this.accid}/conversations/${e}`))),a(this,"getLocaleContent",(e=>this.apireq.get(`/accounts/${this.accid}/locales/${e}`))),a(this,"sendEvent",(e=>this.apireq.addQuery("shorten",!0).post(`/accounts/${this.accid}/users/${this.uid}/events`,e))),a(this,"sendTyping",(e=>this.apireq.post(`/accounts/${this.accid}/conversations/${e}/typing`))),a(this,"sendLostFocus",((t,i,n,s)=>this.sendEvent({by:{id:this.uid,device:t},type:"presence_updated",data:{presence:{viewing_product_sku:s,viewing_product_source_id:n,viewing_product_id:i,pinged:e.Z.Date.now(),is_focused:!1}}}))),a(this,"uploadToS3",(async e=>{let{body:t,error:i}=await this.apireq.post(`/accounts/${this.accid}/files`,{account_id:this.accid,description:"upload\n user-client: web-widget",name:e.name.replace(/\s+/g,"_"),size:e.size,type:e.type});if(i)return{body:t,error:i};let n,s=e.type||"application/octet-stream";return({error:i}=await o.setContentType(s).put(t.signed_url,e)),i?{error:i}:(({body:n,error:i}=await this.apireq.post(`/accounts/${this.accid}/files/${t.id}`,{account_id:this.accid})),i?{body:n,error:i}:{url:this.FileURL+n.url})})),a(this,"time",(e=>o.setBaseUrl(this.ApiURL).withCredentials(!0).setParser("json").get("/time"))),a(this,"updateUser",(e=>this.apireq.post(`/accounts/${this.accid}/users/${this.uid}`,e))),a(this,"getUser",(e=>this.apireq.get(`/accounts/${this.accid}/users/${this.uid}`))),a(this,"getAccountSetting",(()=>this.apireq.get(`/accounts/${this.accid}/settings`))),a(this,"getIsOnline",(()=>this.apireq.get(`/accounts/${this.accid}/is_online`))),a(this,"sendImpression",(e=>this.apireq.post(`/accounts/${this.accid}/campaigns/${e.campaign_id}/impressions`,e))),a(this,"sendConversion",(e=>this.apireq.post(`/accounts/${this.accid}/campaigns/${e.campaign_id}/conversions`,e))),a(this,"lookupOrder",(e=>o.setBaseUrl(this.ApiURL).setContentType("text/plain").beforeHook(c).setParser("json").addQuery("x-signed-key",e).get("/orders/123"))),a(this,"getOrder",(e=>this.apireq.get(`/accounts/${this.accid}/orders/`+e))),a(this,"updateOrder",(e=>this.apireq.post(`/accounts/${this.accid}/orders/`+e.id,e))),a(this,"fetchShippingAddresses",(()=>this.apireq.get(`/accounts/${this.accid}/users/${this.uid}/shipping-addresses`))),a(this,"createShippingAddress",(e=>this.apireq.post(`/accounts/${this.accid}/users/${this.uid}/shipping-addresses`,e))),a(this,"list_provinces",(()=>this.apireq.get(`/accounts/${this.accid}/provinces`))),a(this,"list_districts",(e=>this.apireq.setQuery(e).get(`/accounts/${this.accid}/districts`))),a(this,"list_wards",(e=>this.apireq.setQuery(e).get(`/accounts/${this.accid}/wards`))),a(this,"suggest_address",(e=>this.apireq.setQuery({keyword:e}).get(`/accounts/${this.accid}/addresses`))),this.refreshLock=new e.Z.Mutex,this.FileURL=i,this.ApiURL=t,this.apireq=o.setBaseUrl(t).withCredentials(!0).addQuery("v","6").setContentType("text/plain").beforeHook(c).setParser("json").beforeHook(((e,t)=>{if(!this.token_generator)return this.ref?e.request=e.request.addQuery("x-user-ref",this.ref):this.mask&&(e.request=e.request.addQuery("x-user-mask",this.mask)),t(!0);{let i=this.profile_id;this.token_generator().then((n=>i!=this.profile_id?t(!0):n?"error"==n?t(!1):(e.request=e.request.addQuery("x-access-token",n),t(!0)):t(!1)))}}))}setAgentId(e){this.agentid=e}async setAuth(t){if(t.accid&&(this.accid=t.accid),t.ref&&(this.ref=t.ref),this.mask=t.mask,this.profile_id=t.profile_id,t.ref){let t;for(let i=0;t=await o.setBaseUrl(this.ApiURL).withCredentials(!0).addQuery("v","6").addQuery("x-user-ref",this.ref).setParser("json").get(`/accounts/${this.accid}/users/${this.ref}`),!e.Z.get(t,"body.id");i++){let t=Math.min(2e3+200*i,6e4);await e.Z.sleep(t)}return t.error?e.Z.get(t.body.code)?{error:t.body.code}:t:(this.uid=t.body.id,t.body)}if(t.tokenGenerator){let i=t.tokenGenerator;this.tokensession=this.tokensession||0,this.tokensession++;let n=this.tokensession;if(!this.accid||!e.Z.startsWith(this.accid,"ac"))return{error:"invalid_account_id"};if(!this.profile_id)return{error:"invalid_profile_id"};if("function"!=typeof i)return{error:"invalid_token_generator"};let s,r=this.profile_id;this.token_generator=async t=>{if(await this.refreshLock.lock(),n!=this.tokensession)return void this.refreshLock.unlock();let s,a,o=(e.Z.Date.now()-(this.last_token_at||0))/1e3;if(!t&&this.last_token&&o<1800)return this.refreshLock.unlock(),this.last_token;if(!t&&this.last_token&&o<3e3)return this.token_generator&&e.Z.setTimeout((async()=>{let t,s;try{t=await i(r)}catch(e){s=e}n==this.tokensession?(this.last_token=s?"error":t,this.last_token_at=e.Z.Date.now(),this.refreshLock.unlock()):this.refreshLock.unlock()})),this.last_token;try{s=await i(r)}catch(e){a=e}if(n==this.tokensession)return this.last_token=a?"error":s,this.last_token_at=e.Z.Date.now(),this.refreshLock.unlock(),this.last_token;this.refreshLock.unlock()};for(let t=0;await this.token_generator(!0),n==this.tokensession&&(s=await o.setBaseUrl(this.ApiURL).withCredentials(!0).addQuery("v","6").addQuery("x-access-token",this.last_token).setParser("json").get(`/accounts/${this.accid}/users/${r}`),!e.Z.get(s,"body.id"));t++){let i=Math.min(2e3+100*t,12e4);await e.Z.sleep(i)}return s.error?e.Z.get(s.body.code)?{error:s.body.code}:s:(this.uid=s.body.id,s.body)}if(this.mask){let e=this.mask.split("@");return this.uid=e[1],{id:this.uid}}return{error:"invalid_auth"}}sendContentView(e,t,i,n,s,r){return n||(n=void 0),s||(s=void 0),this.sendEvent({by:{id:this.uid,device:e},type:"content_viewed",data:{product:{id:n,source_id:s,url:t,name:i,title:i,sku:r}}})}}(t,i),!s)try{document.cookie,localStorage}catch(e){s=!0}s&&(this.inmem=s,this.cookie=k),P(),this.pubsub=new e.Z.Pubsub,this.kv=new r.kv(new r.lsdb("sbz2023",this.inmem),"kv"),this.cache=new r.kv(new r.lsdb("sbz2023",!0),"kv"),this.chain=new r.chain(new r.lsdb("cbz2023",!0),"ch"),this.getLocaleContent=this.api.getLocaleContent,this.g_haveSentSeenM={},window.addEventListener("blur",(()=>this.sendPresence())),window.addEventListener("focus",(()=>this.sendPresence())),e.Z.setInterval((()=>"visible"===this.browserVisibility&&document.hasFocus()&&this.sendPresence()),2e4),e.Z.setInterval((()=>("visible"!==this.browserVisibility||document.hasFocus())&&this.sendPresence()),6e4),function(e){var t="hidden";function i(i){var n="visible",s="hidden",r={focus:n,focusin:n,pageshow:n,blur:s,focusout:s,pagehide:s};(i=i||window.event).type in r?e(r[i.type]):e(this[t]?"hidden":"visible")}t in document?document.addEventListener("visibilitychange",i):(t="mozHidden")in document?document.addEventListener("mozvisibilitychange",i):(t="webkitHidden")in document?document.addEventListener("webkitvisibilitychange",i):(t="msHidden")in document?document.addEventListener("msvisibilitychange",i):"onfocusin"in document?document.onfocusin=document.onfocusout=i:window.onpageshow=window.onpagehide=window.onfocus=window.onblur=i,void 0!==document[t]&&i({type:document[t]?"blur":"focus"})}((e=>{this.browserVisibility=e,this.sendPresence()})),this.loopTime(),this.device=this.getDeviceInfo();const g=e.Z.setInterval((()=>{let t=this.cache.match("user")||{};if(!t.id)return;var i=this.getDeviceInfo();if(!i.ga_tracking_ids||!i.ga_client_id)return;e.Z.clearInterval(g),this.device=i;let n=i.ga_client_id;n!==e.Z.getUserAttr(t,"ga_client_id","text")&&this.setUser({attributes:[{type:"text",text:n,key:"ga_client_id"}]})}),2e3)}linkProduct(e){e?(e.id&&(this._currentViewingProduct.id=(e.id+"").trim()),e.source_id&&(this._currentViewingProduct.source_id=(e.source_id+"").trim()),e.sku&&(this._currentViewingProduct.sku=(e.sku+"").trim())):this._currentViewingProduct={}}getLinkedProduct(){return e.Z.cloneDeep(this._currentViewingProduct)}isInsync(t){return e.Z.Date.now()-(this.g_sync[t]||0)<6e5}async fetchShippingAddresses(){let e=await this.api.fetchShippingAddresses();if(e.error)return null;this.cache.put("shipping_address",e.body.shipping_addresses)}matchShippingAddresses(){return this.cache.match("shipping_address")}updateOrder(e){return this.api.updateOrder(e)}createShippingAddress(e){return this.api.createShippingAddress(e)}async overrideAcc(t){this.forceAcc=e.Z.cloneDeep(t),await this.readyGate.entry(),this.disconnect("account"),this.reconnect()}async overrideChatbox(t){this.forceChatbox=t,await this.readyGate.entry(),this.disconnect("account"),await this.reconnect(),e.Z.setTimeout(this.pubsub.publish("resetCSS"),10)}getDeviceInfo(){let e={user_agent:window.navigator.userAgent,screen_resolution:window.screen.width+"x"+window.screen.height,source_referrer:document.referrer,platform:window.navigator.platform,referrer:document.URL,type:this.isMobile()?"mobile":"desktop",language:navigator.language,page_url:document.URL,page_title:document.title},t=function(){if(!window.ga)return;if(!window.ga.getAll)return;var e=window.ga.getAll()||[];let t="";return e.forEach((function(e){t=e.get("clientId")})),t}();t&&(e.ga_client_id=t);let i=(n=[],window.ga&&window.ga.getAll?window.ga&&window.ga.getAll?((window.ga.getAll()||[]).forEach((function(e){var t=e.get("trackingId");t&&n.push(t)})),n):[]:n);var n;return i.length>0&&(e.ga_tracking_ids=i),e}highlight(e,t){this.pubsub.publish("highlight",e,t)}overrideDeviceType(e){this.forceDevice=e,this.pubsub.publish("account")}isMobile(){return"mobile"===this.forceDevice||C}isTablet(){return"tablet"===this.forceDevice||Z}isDesktop(){return"desktop"===this.forceDevice||!this.isMobile()&&!this.isTable()}disconnect(e){this.g_sync[e]=0}pageLoaded(){return y}overridePlugin(t){if(!Array.isArray(t))throw"plugins must be be an array";let i={};e.Z.map(t,(function(e){i[e.id]=e})),this.forcePlugins=i,this.pubsub.publish("account"),this.pubsub.publish("resetCSS")}markSync(t){this.g_sync[t]=e.Z.Date.now()}async _touchAcc(){this.isInsync("account")||(await this.readyGate.entry(),this.isInsync("account")||this.reconnect())}async init(t,i,n){if(this.readyGate.close(),t=(t||"").trim(),this.g_sync={},!n){try{n=this.cookie.get("__sbref","")}catch(e){}if(!n){if(!i)try{i=this.cookie.get("__sbmask","")}catch(e){}i?(i.split("@")[0]!=t&&(n=e.Z.randomString(40),this.new_visitor=!0),this.new_visitor=!1,this.cookie.set("__sbmask",i)):(n=e.Z.randomString(40),this.new_visitor=!0)}}this.cookie.get("__sbref",n)!=n&&A(),this.api.setAuth({accid:t}),n&&this.cookie.set("__sbref",n);let s=await this.api.setAuth({accid:t,mask:i,ref:n});if(!s.error)return this.realtime&&this.realtime.stop(),this.fake?this.realtime=new m:this.realtime=new _(this.RealtimeURL,{account_id:t,user_ref:n,user_mask:i},M),this.realtime.onEvent(this.onWs.bind(this)),this.realtime.onInterrupted((()=>this.reconnectWs(t,s.id))),this.seenLoop(),await this.reconnect(),this.readyGate.open(),this.reconnectWs(t,s.id),s}async login(e,t,i){let n=await this.api.setAuth({accid:e,profile_id:t,tokenGenerator:i});return n.error||(this.clearBrowserData(),this.readyGate.close(),e=(e||"").trim(),this.g_sync={},this.new_visitor=!1,this.realtime&&this.realtime.stop(),this.fake?this.realtime=new m:this.realtime=new _(this.RealtimeURL,{getAccessToken:()=>this.api.token_generator()}),this.realtime.onEvent(this.onWs.bind(this)),this.realtime.onInterrupted((()=>this.reconnectWs(e,n.id))),this.seenLoop(),await this.reconnect(),this.readyGate.open(),this.reconnectWs(e,n.id)),n}logout(e){return this.api.setAuth({ref:e})}seenLoop(){this.seenQueue=[],e.Z.clearInterval(this._seenInterval),this._seenInterval=e.Z.setInterval((()=>{this.seenQueue=[...new Set(this.seenQueue)];let t=this.cache.match("user")||{};e.Z.map(this.seenQueue,(i=>{var n=this.listEvents(i);if(!n)return;if(0===e.Z.size(n))return;var s=(n=e.Z.filter(n,(e=>"message_sent"===e.type)))[e.Z.size(n)-1];if(!s)return;if(this.g_haveSentSeenM[s.id])return;if(s.id===e.Z.getMsgField(s,"idempotency"))return;this.api.markAsSeen(i,s.id);let r=this.cache.match("convo_"+i)||{},a=e.Z.find(r.members,(e=>e.id===t.id));a&&(a.seen_at=Date.now()),this._setConvo(r),this.g_haveSentSeenM[s.id]=!0})),this.seenQueue=[]}),1e3)}async reconnectWs(e,t){return await this.realtime.subscribe([`conversation_state_updated.account.${e}.user.${t}`,`conversation_joined.account.${e}.user.${t}`,`conversation_typing.account.${e}.user.${t}`,`message_sent.account.${e}.user.${t}`,`conversation_pending.account.${e}.user.${t}`,`user_info_updated.account.${e}.user.${t}`,`message_pong.account.${e}.user.${t}`,`conversation_rating_requested.account.${e}.user.${t}`,`conversation_rated.account.${e}.user.${t}`]),await this.readyGate.entry(),this.disconnect("account"),this.reconnect()}async reconnect(){if(this._die)return;if(await this.reconnectGate.entry(void 0,!0),this.isInsync("account"))return this.reconnectGate.open();this.markSync("account");let t=await Promise.all([this.api.getUser(),this.api.getAccountSetting(),this.api.getIsOnline()]),i=e.Z.find(t,(e=>e.error));if(i)return console.error(i);let n=Object.assign(t[1].body,t[2].body);n.user=t[0].body,await this._setSetting(n);let s=await this.api.listConversations();i=s.error;let r=s.body;if(!i){let t=e.Z.get(r,"conversations",[]);e.Z.map(this.cache.all(),((t,i)=>{i.startsWith("convo_")&&this.now()-e.Z.getMs(e.Z.get(t,"actived"))>12096e5&&this.cache.del(i)})),e.Z.map(t,(e=>this._setConvo(e)))}return this.reconnectGate.open()}async setUser(e){if(e)return await this.readyGate.entry(),this._setUser(e),this.api.updateUser(e)}async setUserDiff(e){if(!e)return;await this.readyGate.entry();let t=await this.api.updateUser(e);t&&200==t.code&&t.body.id&&this._setUser(t.body)}_setUser(t){t=e.Z.cloneDeep(t);let i=this.cache.match("user")||{};var n=i.account_id||t.account_id,s=i.id||t.id;e.Z.each(t.attributes,(t=>{t&&(i.attributes=e.Z.filter(i.attributes,(e=>!!e&&e.key!==t.key)))})),i.attributes=i.attributes||[],i.attributes=i.attributes.concat(t.attributes),i.account_id=n,i.id=s,this.cache.put("user",i),this.pubsub.publish("account")}async setSetting(e){if(e)return await this.readyGate.entry(),this._setSetting(e)}async _setSetting(t){(t=e.Z.cloneDeep(t)||{}).account=Object.assign({},t.account,this.forceAcc),t.account.logo_url||(t.account.logo_url="https://file-subiz.com/fiqpezhkmeyesdscyetk-default_logo.jpg"),t.user&&(t.user.account_id=t.account.id,delete t.user.session,this._setUser(t.user)),t.account&&(t.account.is_online=t.is_online,t.account.is_in_business_hour=t.is_in_business_hour,this.cache.put("account",t.account),delete t.account);let i=e.Z.get(t,"location",[]);this.cache.put("location",i);let n=e.Z.get(t,"bots",[]),s={};e.Z.map(n,(e=>{s[e.id]=e})),this.cache.put("bot",s);let r=e.Z.get(t,"plugins",[]),a={};e.Z.map(r,(t=>{"chatbox"===t.type&&(t=e.Z.merge(t,this.forceChatbox)),a[t.id]=t})),this.cache.put("plugin",a);var o=e.Z.get(t,"agents",[]);if(e.Z.size(o)>0){let t={};this.api.setAgentId(o[0].id),e.Z.map(o,(e=>{t[e.id]=e})),this.cache.put("agent",t)}let c=e.Z.get(t,"payment_methods",[]);this.cache.put("payment_methods",c),this.pubsub.publish("account")}async track(){let t=await this.api.sendContentView(this.device,location.href,document.title,this._currentViewingProduct.id,this._currentViewingProduct.source_id,this._currentViewingProduct.sku),i=e.Z.get(t,"body.by.device.source","");i&&this.kv.put("traffic_source",i)}async onWs(e){await this.wsGate.entry(),this.wsGate.close(),await this._onWs(e),this.wsGate.open()}async _onWs(t){if(!t||!t.type)return;if(t.created=e.Z.getMs(t.created),"user_info_updated"===t.type){let i=e.Z.cloneDeep(this.cache.match("user")),n=e.Z.get(t,"data.user.attributes")||[];return e.Z.map(n,(t=>e.Z.setUserAttr(i,t))),void this._setUser(i)}let i,n=this.cache.match("user")||{},s=e.Z.convoOfEv(t),r=!1;if(s&&(i=this.cache.match("convo_"+s),!i||!i.id)){let{body:e,error:t}=await this.api.getConversation(s);if(!e)return;i=e,r=!0,this._setConvo(i)}if(!i)return;let a=e.Z.get(t,"touchpoint.channel","");if(!a||"subiz"==a){if(this.pubsub.publish("events",t),"conversation_joined"===t.type){let n=e.Z.get(t,"data.conversation.members",[]);if(e.Z.find(n,(e=>e.id===this.cache.match("user").id))&&(await this.chain.reload(s,((e,t,i)=>this.listmessageapi(e,t,i))),this.markSync("events"+s),!r)){let{body:e}=await this.api.getConversation(s);e&&(i=e,this._setConvo(i)),this.pubsub.publish("account")}}return"message_sent"===t.type&&e.Z.get(t,"by.id")!==n.id&&this.api.markAsReceived(s,t.id),e.Z.startsWith(t.type,"message_")||e.Z.startsWith(t.type,"conversation_")?(this.restConvoEvent(t),void("message_sent"===t.type&&e.Z.get(t,"by.id")!==n.id&&x("SUBIZ Chat","Received","User"))):void 0}}async restConvoEvent(t){let i=this.cache.match("user"),n=e.Z.convoOfEv(t),s=this.cache.match("convo_"+n)||{};if("conversation_state_updated"===t.type){if(!e.Z.get(s,"id")){let{body:e,error:t}=await this.api.getConversation(n);if(t)return}s=Object.assign(s,e.Z.get(t,"data.conversation"))}if("message_pong"===t.type){var r=e.Z.get(t,"data.message.id"),a=this.chain.match(n,r);if(!e.Z.get(a,"data.message"))return;var o=e.Z.get(a,"data.message.pongs",[]);o=o.concat(e.Z.get(t,"data.message.pongs",[])),a.data.message.pongs=o,e.Z.map(o,(t=>{if(t.member_id==i.id&&"seen"===t.type){let n=e.Z.find(s.members,(e=>e.id===i.id));n&&(n.seen_at=t.created)}})),this.chain.put(n,a.id,e.Z.getMs(a.created),a)}if("message_sent"===t.type){let i=e.Z.getMsgField(t,"idempotency"),r=e.Z.find(this.listEvents(n),(e=>e.id===i));r&&(this.chain.del(n,r.id),t.created=r.created),s.last_message_sent=t}"message_pong"!==t.type&&"conversation_typing"!==t.type&&this.chain.put(n,t.id,e.Z.getMs(t.created),t),this._setConvo(s),this.pubsub.publish("account")}handleFormSubmit(t,i){if("message_sent"!==i.type)return;let n=[],s=e.Z.get(i,"data.message.attachments")||[];e.Z.each(s,(e=>{e&&"form_submit"===e.type&&n.push(e.form_submit)})),e.Z.each(n,(i=>{let n=e.Z.get(this.convoEventM,t+"."+i.form_message_id);if(!n)return;let s=e.Z.filter(e.Z.get(n,"data.message.attachments"),(e=>!!e&&("form"===e.type||"ask_info_form"===e.type)));e.Z.each(s,(t=>{t=t.form,e.Z.each(t.fields,(t=>{e.Z.each(i.fields,(e=>{t.name===e.name&&(t.default_answer||(t.default_answer=e.value))}))}))})),e.Z.size(s)>0&&this.pubsub.publish("state.convoEventM",this.convoEventM,t)}))}typing(e){e&&this._typing(e)}async startConvo(e){await this.readyGate.entry(),this.convoGate.close(),e.source||(e.source=document.location.href);let{body:t,error:i}=await this.api.start(e);return this.convoGate.open(),i?{error:i}:(this._setConvo(t),{convo:t})}fetchOrder(e){return this.api.getOrder(e)}lookupOrder(e){return this.api.lookupOrder(e)}createPostback(e,t){return this.api.createPostback(e,t)}async sendConvoEvent(t,i,n){await this.readyGate.entry();var s=e.Z.randomString(36),r={id:s,by:{id:(this.cache.match("user")||{}).id,type:"user",device:this.device},data:n,type:i,created:this.now()};e.Z.convoToEv(t,r);let a=[];if("message_sent"===i&&(e.Z.setMsgField(r,"idempotency",s),r.data.message.conversation_id=t,await g.map(r.data.message.attachments,2,(async(e,t)=>{var i;"file"===e.type&&e._file&&(a.push(e),w.includes(e._file.type)&&(e.url=await(i=e._file,new Promise((e=>{var t=new window.FileReader;t.onload=t=>{e(t.target.result)},t.readAsDataURL(i)})))))}))),this.onWs(r),await this.convoGate.entry(),await g.map(a,1,(async t=>{const{body:i,url:n,error:s}=await this.api.uploadToS3(t._file);"invalid_field_size"==e.Z.get(i,"code")&&(r._error_message="cannot_send_too_big_file"),r._error=s,t.url=n})),r._error)return this.onWs(r);let{body:o,error:c}=await this.api.sendConvoEvent(t,r);return c?(r._error=c,void this.onWs(r)):(this.onWs(o),x("SUBIZ Chat","Sent","User"),this.kv.match("last_msg_sent")||(window.dataLayer||[]).push({event:"SUBIZ Chat",event_action:"Sent",event_label:"User",first_interaction:1}),this.kv.put("last_msg_sent",e.Z.Date.now()),o)}_setConvo(t){this.cache.match("user");let i=e.Z.get(t,"touchpoint.channel","");if(i&&"subiz"!=i)return;let n={};if(e.Z.map(this.cache.all(),((e,t)=>{t.startsWith("convo_")&&(n[t]=e)})),e.Z.size(n)>18){n=e.Z.orderBy(e.Z.map(n),"created","desc");for(var s=18;s<e.Z.size(n);s++){let e=n[s];this.cache.del("convo_"+e.id)}}this.markSync(t.id),this.pubsub.publish("account"),this.cache.put("convo_"+t.id,t)}matchLastPluginRun(e){return(this.kv.match("plugin_run_logs")||{})[e]}matchLastBotRun(e){return(this.kv.match("bot_run_logs")||{})[e]}logBotRun(e){let t=this.kv.match("bot_run_logs")||{};t[e]={bot_id:e,created:this.now()},this.kv.put("bot_run_logs",t)}sendImpression(e){let t=this.cache.match("user")||{},i=this.kv.match("plugin_run_logs")||{};return i[e]={web_plugin_id:e,created:this.now()},this.kv.put("plugin_run_logs",i),this.api.sendImpression({account_id:t.account_id,campaign_id:e,web_plugin_id:e,user_id:t.id,url:window.location.href,device:this.device})}sendConversion(t,i,n){let s=this.cache.match("user")||{},r={account_id:s.account_id,user_id:s.id,fields:i},a=this.kv.match("conversions")||{};return a[t]=!0,this.kv.put("conversions",a),this.api.sendConversion({account_id:s.account_id,web_plugin_id:t,campaign_id:t,user_id:e.Z.get(s,"id"),url:window.location.href,device:this.device,submission:r,impression_token:n})}isConverted(e){return(this.kv.match("conversions")||{})[e]}async listmessageapi(t,i,n){let s=t,{body:r,code:a,error:o}=await this.api.listMessages(s,-n,i);if(o||200!==a)return[[],i,o];i=e.Z.get(e.Z.last(r),"id"),r=e.Z.map(r,(t=>(t.created=e.Z.getMs(t.created),{id:t.id,index:t.created,value:t})));let c=this.cache.match("user")||{};for(let t=0;t<r.length;t++){let i=r[t].value;if("message_sent"===i.type&&e.Z.get(i,"by.id")!==c.id){if(e.Z.find(e.Z.get(i,"data.message.pongs"),(e=>e.member_id===c.id)))break;this.api.markAsReceived(s,i.id);break}}return[r,i]}async loopTime(){let t=e.Z.Date.now();if(!e.Z.get(this.cache.match("user"),"id"))return e.Z.setTimeout((()=>this.loopTime()),24e4);let{body:i,error:n}=await this.api.time();if(n)return e.Z.setTimeout((()=>this.loopTime()),3e4);var s=Math.abs(e.Z.Date.now()-t)/2,r=new e.Z.Date(i).getTime()+s,a=e.Z.Date.now();this.timeDiff=Math.floor(r-a),e.Z.setTimeout((()=>this.loopTime()),24e4)}replaceFileUrl(t){return t?e.Z.startsWith(t,"/")||e.Z.startsWith(t,"data:")?t:(e.Z.startsWith(t,"http://")||e.Z.startsWith(t,"https://")||e.Z.startsWith(t,"//")||(t=e.Z.trim(this.FileURL,"/")+"/"+e.Z.trimStart(t,"/")),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("https://file-subiz.com/",this.FileURL)).replace("http://file-subiz.com/",this.FileURL)).replace("https://file-v4.subiz.com/",this.FileURL)).replace("http://file-v4.subiz.com/",this.FileURL)).replace("https://filev4.subiz.com/",this.FileURL)).replace("http://filev4.subiz.com/",this.FileURL)).replace("https://filev4-1.subiz.com/",this.FileURL)).replace("http://filev4-1.subiz.com/",this.FileURL)).replace("https://file.subiz.com/",this.FileURL)).replace("http://file.subiz.com/",this.FileURL)).replace("https://file.mysubiz.com/",this.FileURL)).replace("http://file.mysubiz.com/",this.FileURL)):""}clearBrowserData(){e.Z.each(this.cookie.all(),((e,t)=>{(t||"").startsWith("__sb")&&this.cookie.remove(t)})),this.kv.destroy(),this.kv=new r.kv(new r.lsdb("sbz2023",this.inmem),"kv"),this.chain.destroy(),this.chain=new r.chain(new r.lsdb("cbz2023",!0),"ch")}destroy(){this._die=!0,this.clearBrowserData(),this.realtime&&this.realtime.stop(),this.readyGate.close()}}const w=["image/gif","image/jpeg","image/png","image/svg+xml"],k={data:{},get(e,t){return this.data[e]||t},set(e,t){return this.data[e]=e},all(){return this.data},remove(e){delete this.data[e]}};function x(e,t,i){document.dispatchEvent(new CustomEvent("subiz",{detail:{category:e,action:t,label:i}})),function(e,t,i){window.gtag&&window.gtag("event",e,{Action:t,Label:i}),window.ga&&window.ga.getAll&&(window.ga.getAll()||[]).forEach((function(n){const s=n.get("name");window.ga(s+".send","event",e,t,i)}))}(e,t,i),function(e,t,i){window.fbq&&window.fbq("trackCustom",e,{action:t,label:i})}(e,t,i),(window.dataLayer||[]).push({event:e,event_action:t,event_label:i})}let C=(S=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(S)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(S.substr(0,4)));var S;let Z=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(navigator.userAgent),P=()=>{try{localStorage}catch(e){return}e.Z.setTimeout((()=>{for(var e in localStorage)e&&(e.startsWith("cbz2020")||e.startsWith("sbz2020"))&&localStorage.removeItem(e)}))},A=()=>{try{localStorage}catch(e){return}e.Z.setTimeout((()=>{for(var e in localStorage)e&&(e.startsWith("cbz2020")||e.startsWith("sbz2020")||e.startsWith("sbz2022")||e.startsWith("sbz2023"))&&localStorage.removeItem(e)}))};var M=function(t,i,n,s){if(void 0===e.Z.XMLHttpRequest)return function(e,t,i,n){let s={};i&&(s["content-type"]="text/plain"),fetch(t,{method:e,headers:s,body:i}).then((e=>e.text().then((t=>n&&n(t,e.status))))).catch((e=>n&&n(e,-1)))}(t,i,n,s);var r=new e.Z.XMLHttpRequest;r.onreadystatechange=function(e){4===r.readyState&&(s&&s(r.responseText,r.status),s=void 0)},r.onerror=function(){s&&s(r.responseText,-1),s=void 0},r.open(t,i),n&&r.setRequestHeader("content-type","text/plain"),r.send(n)},D=s(2493),T=s(6400);function L(t,i,n,r){if(!n)throw"$div must is a valid html node";var a=document.createElement("div");a.id=t.id,n.appendChild(a);let o=D.Kd(t,e.Z.detectLang());var c,l=new e.Z.Gate,u=0,d="hold",h=this;this.getState=()=>d;var p=async function(){if(k)return;if("hold"!==d)return;if("popup"===t.type&&i.isConverted(t.id))return;let n=i.matchLastPluginRun(t.id);"chatbox"!==t.type&&"notification"!==t.type||(n=void 0),t.enabled&&e.Z.checkRunConditions(t.initiative_frequency,t.conditions,n,i)&&(d="running",await h.update(t))};this.forceRunPopup=async()=>{e.Z.get(m,"current")?m.current.openPopup():w()};var m=(0,T.Vf)();let f=null,g=null,_=null,v=null;var y=e=>r.showWidget(e),b=()=>{u++,w()},w=async()=>{k||a&&("chatbox"===t.type&&(f||(f=(await s.e(132).then(s.bind(s,8132))).default),(0,T.sY)((0,T.h)(f,{destroy:k,plugin:t,store:i,ref:m,t:this.t}),a)),"popup"===t.type&&(g||(g=(await s.e(213).then(s.bind(s,8213))).default),(0,T.sY)((0,T.h)(g,{destroy:k,t:this.t,highlight:c,mobile:i.isMobile(),plugin:t,store:i,ref:m,pageIndex:u,nextPage:b,showWidget:y}),a)),"notification"===t.type&&(v||(v=(await s.e(605).then(s.bind(s,9605))).default),(0,T.sY)((0,T.h)(v,{destroy:k,t:this.t,mobile:i.isMobile(),plugin:t,store:i,ref:m}),a)),"contact"===t.type&&(_||(_=(await s.e(335).then(s.bind(s,2335))).default),(0,T.sY)((0,T.h)(_,{destroy:k,t:this.t,plugin:t,store:i,ref:m}),a)),l.open())};this.call=(e,t)=>l.entry().then((()=>m.current[e](t)));var k=!1;this.destroy=()=>{k=!0,(0,T.sY)(null,a),a.parentNode.removeChild(a)},this.highlight=e=>{c=e,w()},this.update=e=>{k||(t=e,"hold"!==d&&"finished"!==d&&w())};let x=t=>{if("debug"===o)return`{{${t}}}`;let i=e.Z.get(D.Rs,o,[]),n=e.Z.find(i,(e=>e.key===t));return e.Z.get(n,"message",t)},C=i.matchAccount();x.i18n=e=>{if(!e)return"";let i=t.locale||C.locale||"vi-VN";return i=i.replace("-","_"),e[o.replace("-","_")]||e[i]},x.locale=()=>o,this.forceDownloadLanguage=async()=>{await D.WW(i,o,!0),this.update(t)},this.setLocale=async e=>o===e?e:(this.t=null,w(),o=D.Kd(t,e),await D.WW(i,o),this.t=x,w(),o);let S={};e.Z.map(e.Z.get(t,"popup.pages"),(t=>{t&&e.Z.map(t.components,(e=>{"image"===e.type&&e.image&&e.image.url&&e.image.url.startsWith("http")&&(S[e.image.url]=!0)}))})),e.Z.size(S)>=0&&e.Z.map(S,((t,i)=>e.Z.preloadImg(i)));let Z=e.Z.get(t,"triggers")||[{type:"after_pageview",after_pageview_sec:0,disabled:!1}];for(var P=0;P<e.Z.size(Z);P++){var A=Z[P];A&&(A.disabled||("exit_intent"===A.type&&e.Z.trackExitIntent(p),"area_clicked"===A.type&&e.Z.trackAreaClicked(A.area_clicked_css_selector,p),"scrolling_percentage"===A.type&&e.Z.trackScrollingPercentage(A.scrolling_percentage,p),"inactivity_duration"===A.type&&e.Z.trackInactivity(A.inactivity_sec,p),"after_pageview"===A.type&&e.Z.trackTimeOnPage(A.after_pageview_sec,p)))}this.update(t),D.WW(i,o).then((()=>{this.t=x,this.update(t)}))}class z{constructor(t,i){this.refM={},this.lib=t,this.$div=i,this.pluginM={},this._destroy=!1,t.store.onHighlight({_isMounted:!0},((e,t)=>{let i=this.pluginM[e];i&&i.highlight(t)})),t.store.onUpdate({_isMounted:!0},(()=>{if(this._destroy)return;let n=this.lib.store.matchPlugin(),s=!1;e.Z.each(n,(e=>{if("chatbox"===e.type){if(s)return;s=!0}this.pluginM[e.id]?this.pluginM[e.id].update(e):this.pluginM[e.id]=new L(e,this.lib.store,i,t)})),e.Z.each(this.pluginM,((e,t)=>{n[t]||(this.pluginM[t].destroy(),delete this.pluginM[t])}))}));let n=this.lib.store.matchPlugin(),s=!1;e.Z.each(n,(e=>{if("chatbox"===e.type){if(s)return;s=!0}this.pluginM[e.id]||(this.pluginM[e.id]=new L(e,this.lib.store,i,t))}))}findChatbox(){var t=this.lib.store.matchPlugin();let i=e.Z.filter(this.pluginM,((e,i)=>"chatbox"===t[i].type));if(0===e.Z.size(i))return void console.error("no chatbox found.");let n=e.Z.find(i,(e=>"running"===e.getState()));if(n||(n=i[0]),n)return n;console.error("found no suitable chatbox to run.")}getCurrentView(){let e=this.findChatbox();if(e)return e.call("getCurrentView")}showCurrentChatbox(e){let t=this.findChatbox();t&&t.call("showWidget",e)}showCurrentGreeting(){let e=this.findChatbox();e&&e.call("showGreeting")}hideCurrentGreeting(){let e=this.findChatbox();e&&e.call("hideGreeting")}hideCurrentChatbox(){let e=this.findChatbox();e&&e.call("hideWidget")}forceUpdateLang(e){let t=this.pluginM[e];t&&t.forceDownloadLanguage()}forceRunPopup(e){let t=this.pluginM[e];t&&t.forceRunPopup(e)}setPluginLocale(e,t){let i=this.pluginM[e];if(i)return i.setLocale(t)}setCurrentChatboxLocale(e){let t=this.findChatbox();t&&t.setLocale(e)}destroy(){e.Z.map(this.pluginM,((e,t)=>{this.pluginM[t]||(this.pluginM[t].destroy(),delete this.pluginM[t])})),this._destroy=!0}}function U(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var R=document.createElement("link");R.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap",R.rel="stylesheet",document.head.append(R),e.Z.preloadWebfonts(["Inter"],[400,500,600]);class O{constructor(t,i,n,s,r){U(this,"version",(()=>"4.5")),U(this,"setSetting",(e=>this.store.setSetting({account_setting:e}))),U(this,"getUser",(()=>e.Z.parseJSON(e.Z.stringify(this.store.matchUser())))),U(this,"setViewingProduct",(e=>this.store.linkProduct(e))),U(this,"getViewingProduct",(()=>this.store.getLinkedProduct())),U(this,"track",(()=>this.store.track())),this.impressionTokens={},this.domGate=new e.Z.Gate,this.store=new b(t,i,n,s,r),window.sbz_store=this.store,this.subs=[],this.store.onConvoEvent({_isMounted:!0},(t=>e.Z.map(this.subs,(e=>e(t)))))}async waitReady(e){await this.store.readyGate.entry(),e()}async cleanLogin(e,t){}async login(t,i,n,s){let r=await this.store.login(t,i,n);s||(s=document.body),this.pluginMgr=new z(this,s);let a=e.Z.setInterval((()=>{s&&s.isConnected||(this.pluginMgr.destroy(),e.Z.clearInterval(a))}),1e3);return this.domGate.open(),r}logout(e){return this.store.logout(e)}async init(t,i){let n=(t=t||{}).account_id,s=t.ref,r=await this.store.init(n,void 0,s);i||(i=document.body||document),this.pluginMgr=new z(this,i);let a=e.Z.setInterval((()=>{i&&i.isConnected||(this.pluginMgr.destroy(),e.Z.clearInterval(a))}),1e3);return this.domGate.open(),r}async setAccount(t,i,n,s){let r=await this.store.init(t,n);i||(i=document.body||document),this.pluginMgr=new z(this,i);let a=e.Z.setInterval((()=>{i&&i.isConnected||(this.pluginMgr.destroy(),e.Z.clearInterval(a))}),1e3);return this.domGate.open(),s&&s(r),r}_setAccount(e,t){return this.setAccount(e,t)}async updateUserAttributes(t){await this.store.setUser({attributes:t});var i=this.store.matchUser();return e.Z.cloneDeep(i.attributes)}async getUserAttributes(){await this.store.readyGate.entry();var t=this.store.matchUser();return e.Z.cloneDeep(e.Z.get(t,"attributes",[]))}async getWidgetCurrentView(){return await this.domGate.entry(),this.pluginMgr.getCurrentView()}expandWidget(e,t){return this.showWidget(e,t)}shrinkWidget(){return this.hideWidget()}async sendMessage(e,t){if(!e){const{convo:i,error:n}=await this.store.startConvo({message:t.text,initial_by:this.store.matchUser().id});if(n)return{error:n};e=i.id}return this.store.sendConvoEvent(e,"message_sent",{message:t})}async viewForm(t){if(!t||!e.Z.startsWith(t,"cp"))return;let i=this.impressionTokens[t];if(i)return i;let{body:n}=await this.store.sendImpression(t);return i=e.Z.get(n,"impression_token")||"",this.impressionTokens[t]=i,i}async submitForm(t,i){if(!t||!e.Z.startsWith(t,"cp"))return;let n=e.Z.cloneDeep(this.store.matchUser()),s={id:n.id,account_id:n.account_id},r=!1;i=e.Z.map(i,(t=>{let i=t.key;return"email"===i&&(i="emails"),"phone"===i&&(i="phones"),r=r||"emails"==i||"phones"==i,e.Z.setUserAttr(s,{key:i,[t.type||"text"]:t.value}),{key:i,type:t.type||"text",value:e.Z.stringify(t.value)}})),r&&e.Z.setUserAttr(s,{key:"lead_source",text:"plugin."+t});let a=await this.viewForm(t);return this.store.setUserDiff(s),this.store.sendConversion(t,i,a)}startConvo(e){return this.store.startConvo(e)}async showGreeting(){await this.domGate.entry(),this.pluginMgr.showCurrentGreeting()}async hideGreeting(){await this.domGate.entry(),this.pluginMgr.hideCurrentGreeting()}async showWidget(e,t){await this.domGate.entry(),this.pluginMgr.showCurrentChatbox({view:e,cid:t})}async hideWidget(){await this.domGate.entry(),this.pluginMgr.hideCurrentChatbox()}async setLocale(e){return await this.domGate.entry(),this.pluginMgr.setCurrentChatboxLocale(e)}async setLanguage(e){return await this.domGate.entry(),this.pluginMgr.setCurrentChatboxLocale(e)}async setPluginLocale(e,t){return await this.domGate.entry(),this.pluginMgr.setPluginLocale(e,t)}_overrideDeviceType(e){this.store.overrideDeviceType(e)}_overridePlugin(e){this.store.overridePlugin(e)}_forceUpdateLang(e){this.pluginMgr.forceUpdateLang(e)}_highlight(e,t){this.store.highlight(e,t)}openPopup(e){this.pluginMgr.forceRunPopup(e)}unEvent(t){this.subs=e.Z.filter(this.subs,(e=>e!==t))}async countUnreadMessages(){return await this.domGate.entry(),this.store.matchUnread()}onEvent(t){this.subs=e.Z.filter(this.subs,(e=>e!==t)),this.subs.push(t)}overrideAccount(e){this.store.overrideAcc(e)}async overrideChatbox(t){await this.store.overrideChatbox(t),e.Z.get(t,"chatbox.greeting.greeting")&&this.pluginMgr.showCurrentGreeting()}}window.__sbz_WIDGET=O;const E=O;function j(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}!async function(){var e=j("id")||j("acc_id")||j("account_id")||"acqsulrowbxiugvginhw",t=j("real");let i;i=t?new E("https://api.subiz.com.vn/4.0/","https://file-subiz.com/","https://rt-0.subiz.com.vn/"):new E("https://api.subiz.com.vn/4.0/","https://file-subiz.com/","https://rt-0.subiz.com.vn/",!0,!0),console.log("ACCOUNT",e),console.log("REAL",t),window.widget=i,function(){var e=document.createElement("div");document.body.appendChild(e),(0,T.sY)((0,T.h)("div",{style:"opacity: 0.75"},(0,T.h)("header",{class:"header"},(0,T.h)("nav",{class:"navbar navbar-default navbar-fixed-top"},(0,T.h)("div",{class:"container"},(0,T.h)("nav",{class:"navbar navbar-expand-lg"},(0,T.h)("a",{class:"navbar-brand",href:"#"},(0,T.h)("img",{style:"width: 40px; height: 40px; margin-right: 20px",src:s(7002)})," ","Ngựa vằn"),(0,T.h)("button",{class:"navbar-toggler collapsed",type:"button","data-toggle":"collapse","data-target":"#navbarCollapse","aria-controls":"navbarCollapse","aria-expanded":"false","aria-label":"Toggle navigation"},(0,T.h)("span",{class:"navbar-toggler-icon"},(0,T.h)("i",{class:"fas fa-bars"}))),(0,T.h)("div",{class:"navbar-collapse collapse",id:"navbarCollapse",style:""},(0,T.h)("ul",{class:"navbar-nav ml-auto"},(0,T.h)("li",{class:"current"},(0,T.h)("a",{href:"#home"},"Trang chủ")),(0,T.h)("li",null,(0,T.h)("a",{href:"#pricing"},"Bảng giá")),(0,T.h)("li",null,(0,T.h)("a",{href:"#blog"},"Blog")),(0,T.h)("li",{class:"discover-link"},(0,T.h)("a",{href:"#",class:"external discover-btn"},"Bắt đầu")))))))),(0,T.h)("section",{class:"home-section",id:"home"},(0,T.h)("div",{class:"container"},(0,T.h)("div",{class:"row"},(0,T.h)("div",{class:"col-md-6 padding-top-80"},(0,T.h)("h1",null,"Chào mừng đến với Ngựa Vằn, dịch vụ giao hàng uy tín nhất tại Việt Nam"),(0,T.h)("p",null,"Essentials is designed with your customers in mind, so you can track and analyze all your data in one central location. There are no limits to how you can look at your data."),(0,T.h)("a",{href:"#",class:"btn-blue scrool"},"Start Your Free Trial")),(0,T.h)("div",{class:"col-md-6"},(0,T.h)("img",{src:"https://demo.epic-webdesign.com/tf-essentials/v1/images/website-development.jpg",class:"hero-image width-100",alt:"pic"}))))),(0,T.h)("section",{class:"section-grey section-top-border",id:"about"},(0,T.h)("div",{class:"container"},(0,T.h)("div",{class:"row"},(0,T.h)("div",{class:"col-md-12 text-center"},(0,T.h)("h2",{class:"section-title"},"Integrated solutions designed for small business"),(0,T.h)("p",{class:"section-subtitle"},"Communicate with flexible tools that go where your team goes.")),(0,T.h)("div",{class:"col-md-4"},(0,T.h)("div",{class:"main-services"},(0,T.h)("img",{src:s(639),class:"width-100",alt:"pic"}),(0,T.h)("h3",null,"Designers"),(0,T.h)("p",null,"Curabitur quam etsum lacus netsum nulat iaculis ets vitae etsum nisle varius sed aliquam ets vitae netsum."),(0,T.h)("a",{href:"#about",class:"btn-blue-line small scrool"},"Essentials for Designers"))),(0,T.h)("div",{class:"col-md-4"},(0,T.h)("div",{class:"main-services"},(0,T.h)("img",{src:s(9417),class:"width-100",alt:"pic"}),(0,T.h)("h3",null,"Marketers"),(0,T.h)("p",null,"Curabitur quam etsum lacus netsum nulat iaculis ets vitae etsum nisle varius sed aliquam ets vitae netsum."),(0,T.h)("a",{href:"#about",class:"btn-blue-line small scrool"},"Essentials for Marketers"))),(0,T.h)("div",{class:"col-md-4"},(0,T.h)("div",{class:"main-services"},(0,T.h)("img",{src:"./assets/img/main-service3.png",class:"width-100",alt:"pic"}),(0,T.h)("h3",null,"Agencies"),(0,T.h)("p",null,"Curabitur quam etsum lacus netsum nulat iaculis ets vitae etsum nisle varius sed aliquam ets vitae netsum."),(0,T.h)("a",{href:"#about",class:"btn-blue-line small scrool"},"Essentials for Agencies")))))),(0,T.h)("section",{class:"section-grey",id:"pricing"},(0,T.h)("div",{class:"container"},(0,T.h)("div",{class:"row"},(0,T.h)("div",{class:"col-md-12 text-center padding-bottom-40"},(0,T.h)("h2",{class:"section-title"},"Pricing for every business, at any stage"),(0,T.h)("p",{class:"section-subtitle"},"All pricing packages are backed up by a 30-day money back guarantee.")),(0,T.h)("div",{class:"col-md-4"},(0,T.h)("div",{class:"price-box"},(0,T.h)("ul",{class:"pricing-list"},(0,T.h)("li",{class:"price-title"},"BASIC"),(0,T.h)("li",{class:"price-value"},"$25"),(0,T.h)("li",{class:"price-subtitle"},"Per Month"),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"Custom Charts"),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"5 Mailboxes, 10 Gb Storage"),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"Unlimited Free Dashboards"),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"Access to all APIs"),(0,T.h)("li",{class:"price-tag-line"},(0,T.h)("a",{href:"#"},"FREE 15-DAY TRIAL"))))),(0,T.h)("div",{class:"col-md-4"},(0,T.h)("div",{class:"price-box"},(0,T.h)("div",{class:"ribbon blue"},(0,T.h)("span",null,"Popular")),(0,T.h)("ul",{class:"pricing-list"},(0,T.h)("li",{class:"price-title"},"STANDARD"),(0,T.h)("li",{class:"price-value"},"$99"),(0,T.h)("li",{class:"price-subtitle"},"Per Month"),(0,T.h)("li",{class:"price-text strong"},(0,T.h)("i",{class:"fas fa-check blue"}),(0,T.h)("strong",null,"All Basic features")),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"15 Mailboxes, 50 Gb Storage"),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"Interactive Screen Sharing"),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"Full Reports History"),(0,T.h)("li",{class:"price-tag"},(0,T.h)("a",{href:"#"},"FREE 15-DAY TRIAL"))))),(0,T.h)("div",{class:"col-md-4"},(0,T.h)("div",{class:"price-box"},(0,T.h)("ul",{class:"pricing-list"},(0,T.h)("li",{class:"price-title white-text"},"PRO"),(0,T.h)("li",{class:"price-value white-text"},"$199"),(0,T.h)("li",{class:"price-subtitle white-text"},"Per Month"),(0,T.h)("li",{class:"price-text white-text"},(0,T.h)("i",{class:"fas fa-check blue"}),(0,T.h)("strong",null,"All Standard Features")),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"50 Mailboxes, 90 Gb Storage"),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"Dedicated Account Manager"),(0,T.h)("li",{class:"price-text"},(0,T.h)("i",{class:"fas fa-check blue"}),"24/7 Priority Support"),(0,T.h)("li",{class:"price-tag-line"},(0,T.h)("a",{href:"#"},"FREE 15-DAY TRIAL")))))))),(0,T.h)("section",{class:"section-grey partners-paddings section-top-border section-bottom-border"},(0,T.h)("div",{class:"container"},(0,T.h)("div",{class:"row"},(0,T.h)("div",{class:"col-md-12 text-center"},(0,T.h)("h3",{class:"section-title"},"Tin tưởng bởi 250 doanh nghiệp")),(0,T.h)("div",{class:"col-md-12 text-center"},(0,T.h)("ul",{class:"partners-mentions"},(0,T.h)("li",null,(0,T.h)("img",{src:s(4546),alt:"CSS Awards"})),(0,T.h)("li",null,(0,T.h)("img",{src:s(8690),alt:"Awwwards"})),(0,T.h)("li",null,(0,T.h)("img",{src:s(5459),alt:"CSS Winner"})),(0,T.h)("li",null,(0,T.h)("img",{src:s(2300),alt:"CSS Design Awards"}))))))),(0,T.h)("div",{class:"footer"},(0,T.h)("div",{class:"container"},(0,T.h)("div",{class:"row"},(0,T.h)("div",{class:"col-md-12 text-center"},(0,T.h)("p",null,"Bản quyền thuộc về Ngựa Vằn @2022"),(0,T.h)("ul",{class:"footer_social"},(0,T.h)("li",null,(0,T.h)("a",{href:"#"},(0,T.h)("i",{class:"fab fa-twitter"}))),(0,T.h)("li",null,(0,T.h)("a",{href:"#"},(0,T.h)("i",{class:"fab fa-pinterest"}))),(0,T.h)("li",null,(0,T.h)("a",{href:"#"},(0,T.h)("i",{class:"fab fa-facebook-square"}))),(0,T.h)("li",null,(0,T.h)("a",{href:"#"},(0,T.h)("i",{class:"fab fa-instagram"}))),(0,T.h)("li",null,(0,T.h)("a",{href:"#"},(0,T.h)("i",{class:"fab fa-skype"}))),(0,T.h)("li",null,(0,T.h)("a",{href:"#"},(0,T.h)("i",{class:"fab fa-dribble"}))))))))),e)}();var n=document.createElement("div");document.body.appendChild(n);let r=document.location.hash.substr(1),a=JSON.parse(decodeURIComponent(atob(r)));a.triggers=[{type:"after_pageview",after_pageview_sec:0,enabled:!0}],!1!==a._dont_close&&(a._dont_close=!0),a._page_index=0,console.log("PLUGIN",a),i._overridePlugin([a]),await i.setAccount(e,n)}()})()})();
|