@subiz/widget-v4 4.1.217 → 4.1.219
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/chatbox/Widget.js +13 -18
- package/compiled_src/store/api.js +1 -1
- package/dist/1a155409bb8.278.js +1 -0
- package/dist/1a155409bb8.app.js +1 -0
- package/dist/{1a12ed33347.chat.html → 1a155409bb8.chat.html} +1 -1
- package/dist/1a155409bb8.chat.js +1 -0
- package/dist/{1a12ed33347.form.html → 1a155409bb8.form.html} +1 -1
- package/dist/1a155409bb8.form.js +1 -0
- package/dist/{1a12ed33347.index.html → 1a155409bb8.index.html} +1 -1
- package/dist/{1a12ed33347.library.html → 1a155409bb8.library.html} +1 -1
- package/dist/1a155409bb8.library.js +1 -0
- package/dist/{1a12ed33347.preview.html → 1a155409bb8.preview.html} +1 -1
- package/dist/1a155409bb8.preview.js +1 -0
- package/dist/1a155409bb8.webview.js +1 -0
- package/dist/HASH +1 -1
- package/dist/screenshoot.js +219 -112
- package/package.json +3 -3
- package/src/chatbox/Widget.js +21 -21
- package/src/store/api.js +2 -1
- package/dist/1a12ed33347.278.js +0 -1
- package/dist/1a12ed33347.app.js +0 -1
- package/dist/1a12ed33347.chat.js +0 -1
- package/dist/1a12ed33347.form.js +0 -1
- package/dist/1a12ed33347.library.js +0 -1
- package/dist/1a12ed33347.preview.js +0 -1
- package/dist/1a12ed33347.webview.js +0 -1
- /package/dist/{1a12ed33347.127.js → 1a155409bb8.127.js} +0 -0
- /package/dist/{1a12ed33347.132.js → 1a155409bb8.132.js} +0 -0
- /package/dist/{1a12ed33347.185.js → 1a155409bb8.185.js} +0 -0
- /package/dist/{1a12ed33347.27.js → 1a155409bb8.27.js} +0 -0
- /package/dist/{1a12ed33347.339.js → 1a155409bb8.339.js} +0 -0
- /package/dist/{1a12ed33347.459.js → 1a155409bb8.459.js} +0 -0
- /package/dist/{1a12ed33347.490.js → 1a155409bb8.490.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{var t={318(t){var e="Content-Type",n="application/x-www-form-urlencoded",i="application/json; charset=utf-8";function r(t,e){return Object.assign(t.clone(),e)}var o={code:"network_error,retry",number:"SBZ-EQNETWORK",message:{En_US:"Can not connect to the server. Please check your internet connection.",Vi_VN:"Không thể kết nối tới máy chủ. Vui lòng kiểm tra lại kết nối mạng."}},s={code:"invalid_response,retry",number:"SBZ-EQRESPONSE",message:{En_US:"Server error, please try again later",Vi_VN:"Lỗi máy chủ, vui lòng thử lại sau"}},a={code:"not_200,retry",number:"SBZ-EQCN200",message:{En_US:"Error while connecting to the server, please try again later",Vi_VN:"Lỗi kết nối với máy chủ, vui lòng thử lại sau"}};function p(t){return(t||"").trim()}function l(t){return t&&"[object Function]"==={}.toString.call(t)}function c(t,e,n){if(!t||0===t.length)return n(e);var i=t.shift();if(!l(i))return c(t,e,n);i(e,function(i){return!1===i?n(e):c(t,e,n)})}function d(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16)})}function h(t){if(!t)return"";for(var e=Object.keys(t),n=[],i=0;i<e.length;i++){var r=e[i],o="",s=t[r];if(void 0!==s){if(null===s)o=d(r);else if(Array.isArray(s)){for(var a=[],p=0;p<s.length;p++)void 0!==s[p]&&(a.push(m(r,s[p],a.length)),a.push(n));o=a.join("&")}else o=d(r)+"="+d(s);o.length>0&&n.push(o)}}return n.join("&")}function m(t,e){return null===e?d(t):[d(t),"=",d(e)].join("")}var u,g=(u={parser:"",beforehooks:[],afterhooks:[],baseurl:"",query:{},clone:function(){return Object.assign({},this,{query:Object.assign({},this.query)})},addQuery:function(t,e){var n=this.clone();return n.query[t]=e,n},removeQuery:function(t){var e=this.clone();return void 0!==e.query[t]&&(e.query[t]=void 0),e},withCredentials:function(t){return r(this,{_withCredentials:t})},setQuery:function(t){return r(this,{query:t})},clearHooks:function(){return r(this,{beforehooks:[],afterhooks:[]})},beforeHook:function(t){var e=this.beforehooks.slice();return e.push(t),r(this,{beforehooks:e})},afterHook:function(t){var e=this.afterhooks.slice();return e.push(t),r(this,{afterhooks:e})},setHeader:function(t){return(t=Object.assign({},this.headers,t))[e]=void 0,r(this,{headers:t})}},["put","head","patch","delete","post","get"].map(function(t){u[t]=function(d,m,u){return function(t,r,p){p=p||function(){},l(r)&&(p=r,r=void 0);var d,m=new Promise(function(t){d=function(e){try{p(e.error,e.body,e.code)}catch(t){}t(e)}});return r&&((t=t.clone()).body=r,t.content_type===i&&(t.body=b.Jsonify(r)),t.content_type===n&&(t.body=h(r))),c(t.beforehooks.slice(),{request:t},function(n){if(n.error)return d({body:{error:bq.error},code:0,error:n.error});!function(t,n){let i=h(t.query);if(i&&(i="?"+i),!b.XMLHttpRequest)return function(t,n,i){var r=Object.assign({},t.headers);t.content_type&&(r[e]=t.content_type);var o=0;fetch(t.baseurl+i,{method:t.method,headers:r,credentials:t._withCredentials,body:t.body}).then(function(t){return o=t.status,t.text()}).then(function(t){n(void 0,t,o)}).catch(function(t){n("network_error",t,-1)})}(t,n,i);var r=new b.XMLHttpRequest;for(var o in t.xhr=r,r.onreadystatechange=function(t){4===r.readyState&&(0===r.status?n("network_error",r.responseText,r.status):n(void 0,r.responseText,r.status))},r.open(t.method,t.baseurl+i),r.withCredentials=t._withCredentials,t.headers)r.setRequestHeader(o,t.headers[o]);t.content_type&&r.setRequestHeader(e,t.content_type),r.send(t.body)}(n.request,function(e,n,i){c(t.afterhooks.slice(),{request:t,code:i,body:n,err:e},function(e){var n=e.body;if("network_error"==r)return d({body:{error:o},code:e.code,error:o});if("json"==t.parser&&e.body)try{n=b.ParseJson(e.body)}catch(t){return d({body:{error:s,origin_body:e.body},code:e.code,error:s})}var r=e.err;if("network_error"==r)return d({body:{error:o},code:e.code,error:o});!r&&(i<200||i>299)&&(r=n&&n.error?n.error:a),d({body:r?n||{error:r}:n,code:e.code,error:r})})})}),m}(r(this,{method:t,baseurl:(g=this.baseurl,f=d,g=p(g),(f=p(f))&&g?f.startsWith("http://")||f.startsWith("https://")||f.startsWith("//")?f:(g.endsWith("/")||(g+="/"),f.startsWith("/")&&(f=f.substring(1)),g+f):g+f)}),m,u);var g,f}}),u.setBaseUrl=function(t){return r(this,{baseurl:t})},u.contentTypeJson=function(){return r(this,{content_type:i})},u.contentTypeForm=function(){return r(this,{content_type:n})},u.setContentType=function(t){return r(this,{content_type:p(t)})},u.setParser=function(t){return r(this,{parser:p(t)})},u.setBody=function(t){return r(this,{body:t})},u),b={Jsonify:JSON.stringify,ParseJson:JSON.parse};g.env=b,g.waterfall=c,t.exports=g},9(t,e,n){var i=n(9143);t.exports=function(t,e,n){var r=[],o="idle",s=function(t){var e=t.map(function(t){return t.payload}),i=n(e);i&&i.then||(i=Promise.resolve(i));var r=t.map(function(t){return t.rs});return new Promise(function(t){i.then(function(e){r.map(function(t,n){t(e&&e[n])}),t()})})},a=function(){"executing"!==o&&(o="executing",i(function(){if(r.length<=t)return Promise.resolve(!1);var e=r.splice(0,t);return s(e).then(function(){return!0})}).then(function(){if(0!==r.length){var t=e-(Date.now()-r[0].created);if(t>=1){if(o="idle",r[0].settedTimeout)return;return r[0].settedTimeout=!0,void setTimeout(a,t)}var n=r;r=[],s(n).then(function(){o="idle",a()})}else o="idle"}))};return this.push=function(t,e){return new Promise(function(n){r.push({payload:t,priority:e,created:Date.now(),rs:n}),a()})},this}},9096(t){t.exports={map:function(t,e){if(!t)return[];e||(e=function(t){return t});var n=[];if(Array.isArray(t)){for(var i=0;i<t.length;i++)n.push(e(t[i],i));return n}if("object"==typeof t){var r=Object.keys(t);for(i=0;i<r.length;i++){var o=r[i];n.push(e(t[o],o))}return n}return n}}},8193(t,e,n){var i=n(9798),r=n(9143),o=n(5219),s=n(9);t.exports={sleep:i,loop:r,map:o,batch:s}},9143(t){t.exports=function t(e){var n=e();if(!n||!n.then){var i=n;n={then:function(t){t(i)}}}return n.then(function(n){return n?t(e):Promise.resolve()})}},5219(t,e,n){var i=n(9096);t.exports=function(t,e,n){if("number"==typeof e){let t=n;n=e,e=t}e||(e=function(){}),("number"!=typeof n||n<=0)&&(n=1);var r={};if(i.map(t,function(t,e){r[e]=t}),n<=0&&(n=1),0===Object.keys(r).length)return Promise.resolve([]);Object.keys(r).length<n&&(n=Object.keys(r).length);var o={};return new Promise(function(t){let s=Object.keys(r).length;for(var a=function(){var n=Object.keys(r);if(0!==n.length){var p=n.shift(),l=r[p];delete r[p];var c=e(l,p);c&&c.then||(c=Promise.resolve(c)),c.then(function(e){if(o[p]=e,Object.keys(o).length===s)return t(i.map(o));a()})}},p=0;p<n;p++)setTimeout(a,1)})}},9798(t){t.exports=function(t){return new Promise(function(e){setTimeout(e,t)})}},7695(t){t.exports={xhrsend:function(t,e,n,i){if("undefined"==typeof XMLHttpRequest)return function(t,e,n,i){let r={};n&&(r["content-type"]="text/plain"),fetch(e,{method:t,headers:r,body:n}).then(t=>t.text().then(e=>i&&i(e,t.status))).catch(t=>i&&i(t,-1))}(t,e,n,i);var r=new XMLHttpRequest;r.onreadystatechange=function(t){4===r.readyState&&(i&&i(r.responseText,r.status),i=void 0)},r.onerror=function(){i&&i(r.responseText,-1),i=void 0},r.open(t,e),n&&r.setRequestHeader("content-type","text/plain"),r.send(n)},parseJSON:function(t){try{return JSON.parse(t)}catch(t){}},Pubsub:function(){var t={};this.emit=function(e){for(var n=[],i=1;i<arguments.length;i++)n.push(arguments[i]);var r=t[e];if(r)for(i=0;i<r.length;i++)r[i].apply(void 0,n)},this.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)}}}},2839(t,e,n){var i=n(8193),{xhrsend:r,parseJSON:o,Pubsub:s}=n(7695);function a(t,e,n,s,a,d){a=a||r,e=e||{};var h="";d||(d="");var m=!1,u=!1,g=!0,b=0,f=!1,v=function(e){m||(b=Date.now(),a("get",t+"poll?token="+h+"&v=5&account-id="+d,void 0,function(n,i){if(!m){var r=250-(Date.now()-b);if(r<0&&(r=0),p(i))return u=!0,setTimeout(v,Math.max(function(t){if(!t||-1===t)return 0;var e=1e3*Math.pow(1.5,t);return Math.min(1e4,e)}(e),r),e+1);if(200!==i)return u=!0,_("poll");u=!1,(n=o(n)||{}).host&&(t=c(n.host));var a=n.sequential_token;return a?(h=a,s(n.events||[]),r>0?setTimeout(v,r,0):v(0)):_("poll")}}))},y=i.batch(50,100,function(n){if(m)return Promise.resolve(l("dead",n.length));if(n.length<=0)return Promise.resolve([]);var r,s=new Promise(t=>{r=t}),u=!1;return setTimeout(function(){u||m||(g=!0)},4e3),setTimeout(()=>{u||(u=!0,g=!0,r(l("dead",n.length)),m||_("subs"))},6e4),i.loop(function(){return new Promise(function(i){if(m)return r(l("dead",n.length)),i(!1);var s="?token="+h;Promise.resolve().then(function(){return e.getAccessToken()}).then(function(b){if(m)return r(l("dead",n.length)),i(!1);e.user_ref?s+="&user_ref="+encodeURIComponent(e.user_ref):e.user_mask?s+="&user-mask="+encodeURIComponent(e.user_mask):b&&(s+="&access-token="+b);var y=t+"subs"+s+"&v=5&account-id="+encodeURIComponent(d||e.account_id);a("post",y,JSON.stringify({events:n}),function(e,s){if(!u){if(m)return r(l("dead",n.length)),i(!1);if(p(s))return g=!0,setTimeout(i,3e3,!0);if(200!==s)return _("subs"),r(l("dead",n.length)),i(!1);if(g=!1,u=!0,h)return r(n),i(!1);var a=(e=o(e)||{}).initial_token;return a?(e.host&&(t=c(e.host)),h=a,f||(f=!0,v(0)),r(n),i(!1)):(_("subs"),r(l("dead",n.length)),i(!1))}})}).catch(function(){g=!0,setTimeout(i,3e3,!0)})})}),s});this.subscribe=y.push.bind(y),this.getStatus=function(){return m?"dead":g||u?"connecting":"active"};var _=function(t){m=!0,n(t)};this.kill=_}function p(t){return t>=500&&t<600||0===t||-1===t||429===t}function l(t,e){for(var n=[],i=0;i<e;i++)n.push(t);return n}function c(t){return(t=t||"").startsWith("//")?"https:"+t:t}t.exports=function(t,e,n,i,r){("string"==typeof t||t instanceof String)&&(t=[t]),(e=e||{}).getAccessToken||(e.getAccessToken=function(){return Promise.resolve("")}),i||(i=e.account_id||"");var o=new s,p={};this.stop=function(){if(l){var t=l;l=void 0,t.kill(),o.emit("interrupted")}},this.onEvent=function(t){return o.on("event",t)},this.onInterrupted=function(t){return o.on("interrupted",t)},this.getStatus=function(){return l?l.getStatus():"dead"};var l,c=function(t){if(!l)return Promise.resolve({error:"dead"});if("string"==typeof t&&(t=[t]),!Array.isArray(t))return Promise.resolve({error:"param should be an array or string"});for(var e=[],n=0;n<t.length;n++){var i=t[n];i&&(p[i]||(p[i]=!0,e.push(l.subscribe(i))))}return 0===e.length?Promise.resolve({}):Promise.all(e).then(function(){return l&&"dead"!=l.getStatus()?{}:{error:"dead"}})};this.subscribe=c;var d=function(){var s=t[Math.floor(Math.random()*t.length)];if(l){var h=l;l=void 0,h.kill()}var m=new a(s,e,function(t,e,n){void 0!==l&&m==l&&(l=void 0,o.emit("interrupted",t,e,n),r||setTimeout(d,2e3))},function(t){if(m==l)for(var e=0;e<t.length;e++)o.emit("event",t[e])},n,i);l=m;var u=Object.keys(p);return p={},c(u)};this.reconnect=d,d()}},2959(t,e,n){"use strict";n.d(e,{A:()=>s});var i=n(5922),r=n(2840),o=n(172);class s extends r.Mw{render(){var t=this.props.emojiCode;if(i.A.size(t)<3)return null;var e=t.replace(/:/g,"");return(0,o.h)("i",{"data-tooltip":t,class:`emoji emoji--${e}`})}}},7072(t,e,n){"use strict";n.d(e,{A:()=>p});var i=n(5922),r=n(2959),o=n(2840),s=n(172),a=n(4339);class p extends o.Mw{constructor(t){super(t)}renderBlock(t,e=!1){if(0==i.A.size(t))return null;let n={style:""};if(t.style&&i.A.map(t.style,(t,e)=>{n.style+=e+": "+t+";"}),n.attrs={},""!=t.title&&(n.attrs.title=t.title),""!=t.href&&(n.attrs.href=t.href),n.class=t.class,i.A.map(t.attrs,(t,e)=>{n.attrs[e]=t}),"bullet_list"!=t.type&&"ordered_list"!=t.type||("bullet_list"==t.type?n.tag="ul":n.tag="ol"),"list_item"==t.type&&(n.tag="li"),"heading"==t.type){let e=Math.max(1,Math.min(6,Math.floor(Number(t.level)||1)));n.tag="h"+e}if("paragraph"!=t.type&&"section"!=t.type&&"div"!=t.type||(n.tag="div"),n.text=t.text,""==t.type||"text"==t.type||"dynamic-field"==t.type){n.tag="span",t.bold&&(n.tag="b"),t.italic&&("b"==n.tag?n.style+="font-style: italic;":n.tag="em");let e=[];t.underline&&e.push("underline"),t.strike_through&&e.push("line-through"),e.length&&(n.style+="text-decoration: "+e.join(" ")+" !important;")}if("dynamic-field"==t.type){let e=i.A.get(t.attrs,"key");n.text=i.A.get(this.props.data,[e],n.text)}if("link"==t.type&&(n.tag="a",n.attrs.href=(0,a.P)(t.href),n.attrs.target=t.target,n.attrs.title=t.title),"mention-agent"==t.type||"mention"==t.type){n.tag="span",n.class="mention";let e=i.A.get(t,"attrs.id","");if("*"!=e&&"all"!=e||(n.text="@"+(this.props.t?this.props.t("all"):"all")),"string"==typeof e&&/^(ag|at)/.test(e)&&this.props.store){let t=this.props.store.matchAgent(e),r=i.A.getAgentDisplayName(this.props.store.matchAccount(),t);n.text="@"+r}}if("horizontal_rule"==t.type&&(n.tag="hr"),"emoji"==t.type){let e="";i.A.size(t.attrs)>0&&(e=t.attrs.code),e||(e=t.text||t.Text),""!=e&&(n.tag="Emoji",n.attrs.emojiCode=e)}"image"===t.type&&(n.tag="img",n.attrs.src=(0,a.P)(i.A.get(t,"image.url"),!0),n.attrs.alt=t.alt_text),"hard_break"==t.type&&(n.tag="br"),"pre"!=t.type&&"code"!=t.type||(n.tag=t.type);let o=null;switch(o=i.A.size(t.content)?i.A.map(t.content,n=>this.renderBlock(n,e||"code"==t.type)):"text"===t.type?e?n.text:i.A.extractText(n.text).map(t=>{if("link"===t.type){let e=t.text||"";return e.startsWith("//")||e.startsWith("https://")||e.startsWith("http://")||e.startsWith("data:")||(e="//"+e),e=(0,a.P)(e),e?(0,s.h)("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>this.props.onLink&&this.props.onLink(t,e)},t.text):t.text}return"phone"===t.type?(0,s.h)("a",{href:"tel:"+t.text},t.text):"email"===t.type?(0,s.h)("a",{href:"mailto:"+t.text},t.text):t.text}):n.text,n.tag){case"img":return n.attrs.src?(0,s.h)("a",{class:this.props.textMessage?"message-text-inline-image-wrapper":"",href:i.A.get(n,"attrs.src"),target:"_blank",rel:"noopener noreferrer"},(0,s.h)("img",{class:this.props.textMessage?"message-text-inline-image":"",src:i.A.get(n,"attrs.src"),alt:i.A.get(n,"attrs.alt")||""})):t.alt_text||null;case"div":return(0,s.h)("div",null,o);case"pre":return(0,s.h)("pre",{class:"message-block-pre"},o);case"code":return(0,s.h)("code",{class:"message-block-code"+(n.class?" "+n.class:"")},o);case"h1":return(0,s.h)("h1",null,o);case"h2":return(0,s.h)("h2",null,o);case"h3":return(0,s.h)("h3",null,o);case"h4":return(0,s.h)("h4",null,o);case"h5":return(0,s.h)("h5",null,o);case"h6":return(0,s.h)("h6",null,o);case"ol":return(0,s.h)("ol",{class:this.props.textMessage?"text-message-ol":""},o);case"ul":return(0,s.h)("ul",{class:this.props.textMessage?"text-message-ul":""},o);case"li":return(0,s.h)("li",{class:this.props.textMessage?"text-message-li":""},o);case"span":return(0,s.h)("span",{class:n.class,style:n.style},o);case"em":return(0,s.h)("em",{style:n.style},o);case"b":return(0,s.h)("b",{style:n.style},o);case"hr":return(0,s.h)("hr",null);case"br":return(0,s.h)("br",null);case"a":return n.attrs.href?(0,s.h)("a",{class:this.props.textMessage?"message-text-link":"",href:n.attrs.href,target:this.props.textMessage?"_blank":n.attrs.target,title:n.attrs.title,rel:"noopener noreferrer",onClick:t=>this.props.onLink&&this.props.onLink(t,n.attrs.href)},o):(0,s.h)("span",null,o);case"Emoji":return(0,s.h)(r.A,{emojiCode:n.attrs.emojiCode})}return o}render(){return this.renderBlock(this.props.block)}}},9278(t,e,n){"use strict";n.r(e);const i=n(1775);n.d(e,["default",0,i])},2988(t,e,n){"use strict";var i=n(5922);function r(t,e){return Math.abs(t-e)<=.001}n.d(e,["A",0,class{constructor(t){this.duration=t.duration||100,this.breakingV=t.breakingV||7,this.maxY=t.maxY||500,this.minY=t.minY||0}play(t,e,n){var r;this.stop();var o=s=>{s||(s=(new i.A.Date).getTime());var a=s-r,[p,l]=this.calcY(t,e,a);if(n(p),l)return this.stop();this.animationframe=window.requestAnimationFrame(o)};this.animationframe=window.requestAnimationFrame(t=>{r=t||(new i.A.Date).getTime(),o(r)})}calcY(t,e,n){var i,o=function(t,e,n,i){if(r(t,e))return t;var o=t+(e-t)/i*n;return(t<e&&o>e||e<t&&o<e)&&(o=e),o}(e,i=e>this.maxY?this.maxY:e<this.minY?this.minY:Math.abs(t)<this.breakingV?Math.abs(this.maxY-e)<Math.abs(this.minY-e)?this.maxY:this.minY:t<0?this.maxY:this.minY,n,this.duration);return[o,r(o,i)]}stop(){window.cancelAnimationFrame(this.animationframe)}}])},4188(t,e,n){"use strict";n.d(e,{A:()=>s});var i=n(2840),r=n(172);const o=n(6973);class s extends i.Mw{render(){(this.props.mode+"").toLowerCase();let t=this.props.size||14,e=(Math.ceil(t/14),`width: ${t}px !important;height: ${t}px !important;`);return this.props.center?(0,r.h)("div",{class:"loading"},(0,r.h)("img",{alt:"loading",style:e,src:o})):(0,r.h)("img",{alt:"loading",style:e,src:o})}}},1620(t,e,n){"use strict";n.d(e,{A:()=>a});var i=n(5922),r=n(2840),o=n(172),s=new i.A.Pubsub;i.A.setInterval(()=>s.publish("time"),2e4);class a extends r.Mw{constructor(t){super(t),this.setState({t:"",langCode:"en_US"})}updateTime(){var t="";let e="";this.props.t&&this.props.t.locale&&"function"==typeof this.props.t.locale&&(e=this.props.t.locale()),this.props.ago?(this.props.short,!t&&this.props.time>0&&(t=function(t,e,n){let i={s:"%d sec",m:"1 min",mm:"%d mins",h:"1 hour",hh:"%d hours",d:"1 day",dd:"%d days",M:"1 month",MM:"%d months",y:"1 year",yy:"%d years"};n&&(i={s:`%d ${n("second_short")}`,m:`1 ${n("minute_short")}`,mm:`%d ${n("minutes_short")}`,h:`1 ${n("hour_short")}`,hh:`%d ${n("hours_short")}`,d:`1 ${n("day_short")}`,dd:`%d ${n("days_short")}`,M:`1 ${n("month_short")}`,MM:`%d ${n("months_short")}`,y:`1 ${n("year_short")}`,yy:`%d ${n("years_short")}`});const r=i,o=[{l:"s",r:44,d:1e3},{l:"m",r:89},{l:"mm",r:44,d:6e4},{l:"h",r:89},{l:"hh",r:21,d:36e5},{l:"d",r:35},{l:"dd",r:25,d:864e5},{l:"M",r:45},{l:"MM",r:10,d:2592e6},{l:"y",r:17},{l:"yy",d:31536e6}],s=o.length;let a,p;for(let n=0;n<s;n+=1){let i=o[n];i.d&&(a=(t-e)/i.d);let s=Math.round(Math.abs(a));if(s<=i.r||!i.r){s<=1&&n>0&&(i=o[n-1]),p=r[i.l].replace("%d",s);break}}return p}(this.props.time,(new i.A.Date).getTime(),this.props.t))):t=i.A.shortTime(this.props.time,this.props.tzoffset,i.A.Date.now(),e),this.props.uppercase&&(t=t.toUpperCase()),t!==this.state.t&&this.setState({t})}componentDidMount(){s.on2(this,"time",()=>this.updateTime()),this.updateTime()}render(){let t=i.A.get(navigator,"languages.0","en-US");this.props.t&&this.props.t.locale&&"function"==typeof this.props.t.locale&&(t=this.props.t.locale());let e=new Date(this.props.time).toLocaleString(t);return(0,o.h)("span",{class:this.props.class,style:this.props.style,title:e},this.state.t)}}},2840(t,e,n){"use strict";n.d(e,{Dy:()=>l,Mw:()=>o,r9:()=>a,tW:()=>s});var i=n(172),r=n(5922);class o extends i.uA{constructor(t){super(t),this._isMounted=!0,this._subscriptions=new Set;const e=this.componentWillUnmount;this.componentWillUnmount=()=>{if(this._isMounted){this._isMounted=!1;for(const t of this._subscriptions)t();this._subscriptions.clear(),e&&e.call(this)}}}onDispose(t){return this._isMounted?this._subscriptions.add(t):t(),()=>this._subscriptions.delete(t)}}class s extends o{constructor(t){super(t),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(t){this.wrapperRef=t}onClick(t){this.wrapperRef&&!this.wrapperRef.contains(t.target)&&this.props.onClickaway&&this.props.onClickaway()}render(){return(0,i.h)("div",{ref:this.setWrapperRef},this.props.children)}}let a={},p=!1;function l(t,e,n){if(p)return new Promise(i=>r.A.setTimeout(()=>l(t,e,n).then(i),100));let i;return p=!0,"debug"===e||a[e]&&!n?(p=!1,Promise.resolve()):t.getLocaleContent(e).then(t=>{p=!1,i=r.A.get(t,"body.messages",[]),a[e]=i})}n.d(e,["JK",0,(t,e)=>{e||(e="");let n=r.A.find(t.locales,t=>t.toLowerCase().trim()===e.toLowerCase().trim());return n||(n=r.A.find(t.locales,t=>(t=t.replace("-","_").split("_")[0].trim().toLowerCase())==e.replace("-","_").split("_")[0].trim().toLowerCase()),n||t.locale||"en-US")}])},450(t){var e={},n={};e.length=0,e.cache=n,e.getItem=function(t){return t in n?n[t]:null},e.setItem=function(t,i){void 0===i?e.removeItem(t):(Object.prototype.hasOwnProperty.call(n,t)||e.length++,n[t]=i)},e.removeItem=function(t){Object.prototype.hasOwnProperty.call(n,t)&&(delete n[t],e.length--)},e.key=function(t){return Object.keys(n)[t]||null},e.clear=function(){n={},e.length=0},t.exports=e},3078(t,e,n){"use strict";n.r(e),n.d(e,{E_:()=>s,Jb:()=>l,Vx:()=>o,WD:()=>r,aL:()=>a});var i=n(9917);function r(t){let e=n=>{n.clientY>10||(t&&t(),document.removeEventListener("mouseout",e))};document.addEventListener("mouseout",e)}function o(t,e){let n=i=>{let r=i.srcElement.scrollingElement?i.srcElement.scrollingElement.scrollTop:i.srcElement.scrollTop,o=i.srcElement.scrollingElement?i.srcElement.scrollingElement.scrollHeight:i.srcElement.scrollHeight;r>0&&o>0&&(r+window.innerHeight)/o>=t&&(e&&e(),window.removeEventListener("scroll",n,!1))};window.addEventListener("scroll",n,!1)}function s(t,e){t&&(t=t||"",i.map(t.split("\n"),t=>{(t=i.trim(t))&&function(t,e,n){document.addEventListener("click",function(t){let i=document.querySelectorAll(e),r=t.target;for(let e=0,o=i.length;e<o;e++){let o=r,s=i[e];for(;o&&o!==document;){if(o===s)return n.call(s,t);o=o.parentNode}}})}(0,t,e)}))}function a(t=0,e){let n=["scroll","keyup","keydown","mousemove","mousewheel","mouseenter","mouseover","mousedown","touchstart","touchmove","touchenter"],r=0,o=()=>{r=0},s=i.setInterval(()=>{if(r++,!(r<t)){e&&e();for(let t of n)document.removeEventListener(t,o,!1);i.clearInterval(s)}},1e3);for(let t of n)document.addEventListener(t,o,!1)}let p=i.Date.now();function l(t=0,e){if(t<1)return i.setTimeout(function(){e(t)},100);let n=i.setInterval(()=>{let r=(i.Date.now()-p)/1e3;r<t||(e&&e(r),i.clearInterval(n))},200)}},9917(t,e,n){"use strict";n.r(e),n.d(e,{Date:()=>y,XMLHttpRequest:()=>z,agentsOfConvo:()=>U,blockToText:()=>Nt,checkRunConditions:()=>ft,checkUrlCondition:()=>Ht,clearInterval:()=>k,clearTimeout:()=>A,cloneDeep:()=>E,convoOfEv:()=>M,convoToEv:()=>S,detectLang:()=>St,diffDay:()=>kt,diffYear:()=>At,each:()=>F,extract:()=>d,extractEmails:()=>l,extractEmojis:()=>a,extractLinks:()=>p,extractPhones:()=>c,extractText:()=>m,filter:()=>P,find:()=>$,formatCurrency:()=>Et,getAgentDisplayName:()=>nt,getDayName:()=>vt,getMs:()=>Mt,getUrlParameter:()=>Dt,getUserAttr:()=>ot,hslToRgb:()=>s,includes:()=>L,isBlockEmpty:()=>Ft,isConvoSeen:()=>W,isEmail:()=>tt,isEmptyBlock:()=>Ot,isEmptyMessage:()=>Bt,isNumber:()=>K,isPhone:()=>Q,isURL:()=>X,isUserBanned:()=>it,js2css:()=>gt,last:()=>et,map:()=>N,merge:()=>j,noop:()=>at,norm:()=>st,offsetToMin:()=>xt,orderBy:()=>J,orderByF:()=>Y,parseJSON:()=>u,pipeExtracts:()=>h,preloadImg:()=>wt,preloadWebfonts:()=>_t,randomString:()=>T,replaceAll:()=>H,replaceCssVariable:()=>ct,replaceCssVariablePlugin:()=>lt,requestAnimationFrame:()=>_,rgbToHsl:()=>o,sameDay:()=>zt,scrollIntoViewIfNeeded:()=>Pt,setCss:()=>ht,setInterval:()=>x,setTimeout:()=>w,setUserAttr:()=>rt,shortTime:()=>It,size:()=>B,sleep:()=>jt,startsWith:()=>O,stringify:()=>f,throttle:()=>Z,tokenize:()=>dt,trim:()=>G,trimStart:()=>q,unicodeToAscii:()=>Tt,unixSec:()=>Ct,usersOfConvo:()=>R});var i=n(3259);const r=n(318);function o(t,e,n){t/=255,e/=255,n/=255;var i,r,o=Math.max(t,e,n),s=Math.min(t,e,n),a=(o+s)/2;if(o==s)i=r=0;else{var p=o-s;switch(r=a>.5?p/(2-o-s):p/(o+s),o){case t:i=(e-n)/p+(e<n?6:0);break;case e:i=(n-t)/p+2;break;case n:i=(t-e)/p+4}i/=6}return[i,r,a]}function s(t,e,n){var i,r,o;if(0==e)i=r=o=n;else{function p(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=p(a,s,t+1/3),r=p(a,s,t),o=p(a,s,t-1/3)}return[255*i,255*r,255*o]}function a(t){for(var e=[],n=0;n<t.length;n++)for(var i=0;i<Ut.length;i++)if(t.indexOf(Ut[i],n)===n){e.push({index:n,length:Ut[i].length}),n+=Ut[i].length-1;break}return e}function p(t){t=t||"";for(var e,n=/(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z()]{2,6}\b([-a-zA-Z0-9@:%_\+.,~#?&//=]*)/gim,i=[];e=n.exec(t);){const t=5;n.lastIndex-e.index>t+1&&i.push({index:e.index,length:n.lastIndex-e.index})}return i}function l(t){t=t||"";for(var e,n=/(([^<>()[\]\\.,;:\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,i=[];e=n.exec(t);)i.push({index:e.index,length:n.lastIndex-e.index});return i}function c(t){t=t||"";for(var e="",n={},i=0;i<t.length;i++){var r=t.charAt(i);if("."===r||"-"===r||" "===r){var o=i>0?t.charAt(i-1):"-",s=i<t.length-1?t.charAt(i+1):"-";-1!=="0123456789".indexOf(o)&&-1!=="0123456789".indexOf(s)||(n[(e+=r).length-1]=i)}else n[(e+=r).length-1]=i}for(var a,p=/([0-9]{8,13})/gim,l=[];a=p.exec(e);)l.push({index:n[a.index],length:n[p.lastIndex-1]-n[a.index]+1});return l}function d(t,e,n){if(!t)return[];var i=[],r=0,o=e(t);if(0===B(o))return[{type:"text",text:t}];F(o,e=>{i.push({type:"text",text:t.substr(r,e.index-r)}),i.push({type:n,text:t.substr(e.index,e.length)}),r=e.index+e.length});var s=et(o);return i.push({type:"text",text:t.substr(s.index+s.length,t.length-s.index+s.length)}),P(i,t=>""!==t.text)}function h(t,e){var n=[];if(0===B(e))return[{type:"text",text:t}];var i=e.shift();return F(d(t,i,i.type),t=>{if("text"!==t.type)return n.push(t);n=n.concat(h(t.text,e.slice()))}),n}function m(t){var e=t=>{const e=l(t);return p(t).map(e=>{const n=t.substr(e.index,e.length);return{...e,length:n.replace(/[.,;!?]+$/,"").length}}).filter(t=>!e.some(e=>t.index>=e.index&&t.index+t.length<=e.index+e.length))};e.type="link";var n=l;n.type="email";var i=c;i.type="phone";var r=a;return r.type="emoji",h(t,[e,n,i,r])}function u(t){try{return v(t)}catch(t){}}var g=document.createElement("iframe");g.style.display="none",document.documentElement.appendChild(g);const b=g.contentDocument.createElement("div");g.contentDocument.body.appendChild(b);var f=g.contentWindow.JSON.stringify,v=g.contentWindow.JSON.parse,y=g.contentWindow.Date,_=g.contentWindow.requestAnimationFrame,w=g.contentWindow.setTimeout.bind(g.contentWindow),x=g.contentWindow.setInterval.bind(g.contentWindow),k=g.contentWindow.clearInterval.bind(g.contentWindow),A=g.contentWindow.clearTimeout.bind(g.contentWindow),z=g.contentWindow.XMLHttpRequest;const I=z.prototype.open,C=z.prototype.send;function M(t){return t?i.get(t,"data.conversation.id",i.get(t,"data.message.conversation_id")):""}function S(t,e){if(!e)return"";switch(e.type){case"message_sent":case"message_updated":case"message_deleted":case"message_pong":return i.set(e,"data.message.conversation_id",t);case"ticket_updated":return i.set(e,"data.ticket.conversation_id",t);default:return i.set(e,"data.conversation.id",t)}}function D(t){return t&&"object"==typeof t&&!Array.isArray(t)}function j(t,...e){if(!e.length)return t;const n=e.shift();if(D(t)&&D(n))for(const e in n)D(n[e])?(t[e]||Object.assign(t,{[e]:{}}),j(t[e],n[e])):Object.assign(t,{[e]:n[e]});return j(t,...e)}function E(t){if(t!==Object(t))return t;var e=f(t);return void 0!==e?v(e):void 0}function T(t){var e,n="";(!t||t<1)&&(t=10);for(var i=0;i<t;i++)e=Math.floor(25*Math.random()+97),n+=String.fromCharCode(e);return n}function P(t,e){if(!t)return[];if(!e)return t;var n=[];if("object"==typeof t){var i=Object.keys(t);for(let o=0;o<i.length;o++){var r=i[o];e(t[r],r)&&n.push(t[r])}return n}if(Array.isArray(t)){for(let i=0;i<t.length;i++)e(t[i],i)&&n.push(t[i]);return n}return n}function L(t,e){if(!t)return!1;var n="string"==typeof t||t instanceof String;return!(!Array.isArray(t)&&!n)&&t.includes(e)}function N(t,e){if(!t)return[];e||(e=t=>t);var n=[];if("object"==typeof t){var i=Object.keys(t);for(let o=0;o<i.length;o++){var r=i[o];n.push(e(t[r],r))}return n}if(Array.isArray(t)){for(let i=0;i<t.length;i++)n.push(e(t[i],i));return n}return n}function F(t,e){return N(t,e)}function R(t){return t?N(P(t.members,t=>"user"===t.type),t=>t.id):[]}function W(t,e){if("ended"===t.state)return!0;let n=t.last_message_sent;if(!n)return!0;if(i.get(n,"by.id")===e)return!0;let r=$(t.members,t=>t.id===e);return!r||Mt(n.created)<Mt(r.seen_at)}function U(t,e){return t?N(P(t.members,t=>e?"agent"===t.type||"bot"===t.type:"agent"===t.type),t=>t.id):[]}function O(t,e){return((t||"")+"").startsWith(e)}function B(t){return t?void 0!==t.length?t.length:Object.keys(t).length:0}function H(t,e,n){return(t||"").split(e).join(n)}function G(t,e){return((t||"")+"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function q(t,e){for(t=(t||"")+"";t.charAt(0)===e;)t=t.substr(1);return t}function Z(t,e,n){var i,r,o,s=null,a=0;n||(n={});var p=function(){a=!1===n.leading?0:(new y).getTime(),s=null,o=t.apply(i,r),s||(i=r=null)};return function(){var l=(new y).getTime();a||!1!==n.leading||(a=l);var c=e-(l-a);return i=this,r=arguments,c<=0||c>e?(s&&(A(s),s=null),a=l,o=t.apply(i,r),s||(i=r=null)):s||!1===n.trailing||(s=w(p,c)),o}}function $(t,e){if(t)return t[V(t,e)]}function V(t,e){if(!t)return-1;if(!e)return-1;if("object"==typeof t){var n=Object.keys(t);for(let r=0;r<n.length;r++){var i=n[r];if(e(t[i],i))return i}}if(Array.isArray(t)){for(let n=0;n<t.length;n++)if(e(t[n],n))return n;return-1}return-1}function J(t,e,n){var i=[];return F(t,t=>i.push(t)),i.sort((t,i)=>{if(t[e]===i[e])return 0;var r=t[e]<i[e]?-1:1;return"desc"===n?-r:r}),i}function Y(t,e,n){var i=[];return F(t,t=>i.push(t)),i.sort((t,i)=>{let r=e(t),o=e(i);if(r===o)return 0;var s=r<o?-1:1;return"desc"===n?-s:s}),i}function Q(t){if("string"!=typeof t&&"number"!=typeof t)return!1;const e=String(t).trim(),n=e.replace(/\((\d+)\)/g,"$1");if(!/^\+?\d+(?:[ .-]\d+)*$/.test(n))return!1;const i=e.replace(/\D/g,"");return!(i.length<7||i.length>15||/^(\d)\1+$/.test(i)||e.startsWith("+")&&i.startsWith("0"))}function X(t){return/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi.test(String(t).toLowerCase())}function K(t){return/^\d+$/.test(String(t))}function tt(t){if("string"!=typeof t)return!1;const e=t.trim();if(e.length>254)return!1;const n=e.lastIndexOf("@"),i=e.slice(0,n),r=e.slice(n+1);return!(!i||i.length>64)&&(!(!i.startsWith('"')&&(i.startsWith(".")||i.endsWith(".")||i.includes("..")))&&(!(!r.startsWith("[")&&r.split(".").some(t=>t.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(t)))&&/^(([^<>()[\]\\.,;:\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(e.toLowerCase())))}function et(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}function nt(t,e){return i.get(e,"fullname")||i.get(e,"email")||i.get(t,"name")||"Agent"}function it(t){return ot(t,"is_ban","boolean")}function rt(t,e){if(t&&i.get(e,"key")){t.attributes=t.attributes||[];var n=V(t.attributes,t=>t&&t.key===e.key);-1!==n?t.attributes[n]=e:t.attributes.push(e)}}function ot(t,e,n){if(!t||!t.attributes)return;let i;return F(t.attributes,t=>{t&&t.key===e&&("datetime"===n&&(i=t.datetime),"boolean"===n&&(i=t.boolean),"number"===n&&(i=t.number),"text"===n&&(i=t.text),"list"===n&&(i=[t.text].concat(t.other_values)))}),i}function st(t){return(t=t||"").trim().toLowerCase()}function at(){}function pt(t){return("string"==typeof t||t instanceof String)&&(t=t.trim().replace(/;+$/,"")),t}function lt(t,e){var n=[t];let r=e.spacer||10;e=Object.assign({},e,{spacer:r+"px",spacer0:r/2+"px",spacer2:2*r+"px",spacer3:3*r+"px"}),n=dt(n,"'@font_family'"),n=dt(n,"'@font_size'"),n=dt(n,"'@text_color'"),n=dt(n,"'@faded_text_color'"),n=dt(n,"'@primary_color'"),n=dt(n,"'@background'"),n=dt(n,"'@spacer'"),n=dt(n,"'@spacer0'"),n=dt(n,"'@spacer2'"),n=dt(n,"'@spacer3'");let a=Wt(i.get(e,"primary_color")||i.get(ut,"primary_color"));a||(a={red:238,blue:238,green:238});let p=o(a.red,a.green,a.blue)[0],[l,c,d]=s(p,.25,.95);ut.primary_color_faded=`rgb(${l},${c},${d})`;for(var h=[],m=0;m<n.length;m++){var u=n[m];if("string"!=typeof u){var g=u.type.substr(2,u.type.length-3),b=i.get(e,g)||i.get(ut,g)||"";h.push(b)}else h.push(u)}return h.join("")}function ct(t,e){var n=[t];n=dt(n,"'@primary_color'"),n=dt(n,"'@primary_color_faded'"),n=dt(n,"@esc-primary-color-esc"),n=dt(n,"'@secondary_color'"),n=dt(n,"'@background'"),n=dt(n,"'@text_color'"),n=dt(n,"'@width'"),n=dt(n,"'@height'"),n=dt(n,"'@desktop_button.width'"),n=dt(n,"'@desktop_button.height'"),n=dt(n,"'@desktop_button.background'"),n=dt(n,"'@desktop_button.border_radius'"),n=dt(n,"'@desktop_button.margin_x'"),n=dt(n,"'@desktop_button.margin_y'"),n=dt(n,"'@desktop_widget_max_height'"),n=dt(n,"'@preview_max_width'"),n=dt(n,"'@mobile_button.width'"),n=dt(n,"'@mobile_button.height'"),n=dt(n,"'@mobile_button.background'"),n=dt(n,"'@mobile_button.border_radius'"),n=dt(n,"'@mobile_button.margin_x'"),n=dt(n,"'@mobile_button.margin_y'"),n=dt(n,"'@mobile_height'"),n=dt(n,"'@widget_position'"),n=dt(n,"'@z_index'"),n=dt(n,"'@z_index_2'"),n=dt(n,"'@z_index_3'"),n=dt(n,"'@z_index_4'"),n=dt(n,"'@z_index_5'"),n=dt(n,"'@form_background_color'"),n=dt(n,"'@form_header_font_size'"),n=dt(n,"'@form_header_font_family'"),n=dt(n,"'@form_desc_font_size'"),n=dt(n,"'@form_desc_font_family'"),n=dt(n,"'@form_input_label_font_size'"),n=dt(n,"'@form_input_label_font_family'");let r=Wt(i.get(e,"primary_color")||i.get(ut,"primary_color"));r||(r={red:238,blue:238,green:238});let a=o(r.red,r.green,r.blue)[0],[p,l,c]=s(a,.25,.95);ut.primary_color_faded=`rgb(${p},${l},${c})`;for(var d=[],h=0;h<n.length;h++){var m=n[h];if("string"!=typeof m)if("@esc-primary-color-esc"!==m.type)if("'@z_index_2'"!==m.type)if("'@z_index_3'"!==m.type)if("'@z_index_4'"!==m.type)if("'@z_index_5'"!==m.type){var u=m.type.substr(2,m.type.length-3);g=pt(g=i.get(e,u)||i.get(ut,u)||""),["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","form_header_font_size","form_desc_font_size","form_input_label_font_size","width","height"].includes(u)&&(g+="px"),"height"!==u||"full"!==i.get(e,"window_mode")?d.push(g):d.push("100%")}else g=i.get(e,"z_index")||i.get(ut,"z_index"),d.push(g+5);else g=i.get(e,"z_index")||i.get(ut,"z_index"),d.push(g+4);else{var g=i.get(e,"z_index")||i.get(ut,"z_index");d.push(g+3)}else{g=i.get(e,"z_index")||i.get(ut,"z_index");d.push(g+2)}else{g=i.get(e,"primary_color")||i.get(ut,"primary_color");d.push(encodeURIComponent(pt(g)))}else d.push(m)}return d.join("")}function dt(t,e){if(!t||!t.length)return[];var n=[];for(let o=0;o<t.length;o++){var i=t[o];if("string"==typeof i){var r=i.split(e);for(let t=0;t<r.length;t++)n.push(r[t]),n.push({type:e});n.pop()}else n.push(i)}return n}function ht(t,e,n){n=H(n,"#sbz92","#"+t),e.styleSheet?e.styleSheet.cssText=n:(e.innerHTML="",e.appendChild(document.createTextNode(n)))}z.prototype.open=function(t,e,n,i,r){return this._url=e,I.apply(this,arguments)},z.prototype.send=function(t){let e=this.onreadystatechange;return this.onreadystatechange=function(t,n,i){4==this.readyState&&((this.status>=400||0==this.status)&&"object"==typeof sbz_logs&&sbz_logs.push({type:"xhrfailed",url:this._url,status:this.status,response:this.responseText}),"function"==typeof e&&e(t,n,i))},C.apply(this,arguments)},r.env.XMLHttpRequest=z;const mt="https://vcdn.subiz-cdn.com/file/bubble_11.svg?v=5",ut={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:mt,margin_x:.3,margin_y:.3},mobile_button:{width:.3,height:.3,border_radius:"100%",background_mask_url:mt,margin_x:.3,margin_y:.3},mobile_height:"100%",widget_position:"fixed",z_index:2e9};function gt(t,e,n){var i={};for(var r in t)t.hasOwnProperty(r)&&(e&&e.length>0&&-1===e.indexOf(r)||("string"==typeof t[r]?i[r]=G(t[r]):i[r]=t[r]));t=i;let o="";for(var r in t)if(t.hasOwnProperty(r)){var s="";if(t.blur&&(s+="blur("+t.blur+") "),t.grayscale&&(s+="grayscale("+t+") "),s&&(o+="filter: "+s+"!important;"),void 0!==t.rotate&&(o+="transform:rotate("+t.rotate+") !important;"),void 0!==t[r]){let e=t[r]+"";N(n,(t,n)=>{-1!==e.indexOf(n)&&(e=H(e,n,t))}),o+=H(r,"_","-")+":"+e+" !important;","color"===r&&(o+="-webkit-text-fill-color: "+e+" !important;")}}return o}function bt(){var t=!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,e="undefined"!=typeof InstallTrigger,n=(/constructor/i.test(window.HTMLElement)||(!window.safari||"undefined"!=typeof safari&&window.safari.pushNotification).toString(),!!document.documentMode),i=!n&&!!window.StyleMedia,r=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime);r||(r=navigator.userAgent.indexOf("Chrome"));var o=r&&-1!=navigator.userAgent.indexOf("Edg"),s=(r||t)&&!!window.CSS;return t?"opera":e?"firefox":n?"ie":i||o?"edge":r?"chrome":s?"blink":"unknown"}function ft(t,e,n,r){var o=r.matchAccount()||{},s=r.matchLocation()||{};if(!function(t,e){return!(e&&(i.get(t,"once_per_user")||i.get(t,"once_per_session")&&zt(e.created,y.now())||i.get(t,"interval_sec")&&i.get(t,"interval_sec")>(y.now()-e.created)/1e3))}(t,n))return!1;for(let t=0;t<B(e);t++){var a=e[t];switch(a.key){case"url":if(!Ht(a,window.location.href))return!1;break;case"url_path":let t=P(a.exclude_url_paths,t=>st(t));if(B(t)>0){let e=new URL(window.location.href).pathname||"";if("string"==typeof e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),$(t,t=>("string"==typeof t&&t.endsWith("/")&&(t=t.substring(0,t.length-1)),e===t)))return!1}let e=P(a.url_paths,t=>st(t));if(B(e)>0){let t=new URL(window.location.href).pathname||"";if("string"==typeof t&&t.endsWith("/")&&(t=t.substring(0,t.length-1)),!$(e,e=>("string"==typeof e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),t===e)))return!1}break;case"browser":if(B(a.browsers)>0){var p=bt();if(!$(a.browsers,t=>st(t)===st(p)))return!1}break;case"location":if(B(a.exclude_locations)>0&&$(a.exclude_locations,t=>!(!t.city_name||!t.country_code||t.city_name!==s.city_name||t.country_code!==s.country_code)||!(!t.city_name||t.country_code||t.city_name!==s.city_name)||!(t.city_name||!t.country_code||t.country_code!==s.country_code)||void 0))return!1;if(B(a.locations)>0&&!$(a.locations,t=>!(!t.city_name||!t.country_code||t.city_name!==s.city_name||t.country_code!==s.country_code)||!(!t.city_name||t.country_code||t.city_name!==s.city_name)||!(t.city_name||!t.country_code||t.country_code!==s.country_code)||void 0))return!1;break;case"returning_visitor":if(a.returning_visitor&&r.new_visitor)return!1;if(!a.returning_visitor&&!r.new_visitor)return!1;break;case"user_is_a_contact":let n=i.get(r.matchUser(),"attributes",[]),d=$(n,t=>("emails"===t.key||"related_email"===t.key)&&t.text),h=$(n,t=>("phones"===t.key||"related_phone"===t.key)&&t.text),m=d||h;if(a.user_is_a_contact&&!m)return!1;if(!a.user_is_a_contact&&m)return!1;break;case"device_type":if(B(a.device_types)>0){let t="desktop";if(r.isMobile()&&(t="mobile"),r.isTablet()&&(t="tablet"),!$(a.device_types,e=>st(e)===st(t)))return!1}break;case"referer":if(B(a.exclude_referers)>0&&$(a.exclude_referers,t=>st(document.referrer).indexOf(st(t))>-1))return!1;if(B(a.urls)>0&&!$(a.referers,t=>st(document.referrer).indexOf(st(t))>-1))return!1;break;case"source":if(B(a.sources)>0){let t=r.matchTrafficSource()||"direct";if(!$(a.sources,e=>st(e)===st(t)))return!1}break;case"user_attribute":case"user":let g,b=i.get(r.matchUser(),"attributes",[]),f=i.get(a,"user.operator");F(b,t=>{t&&t.key===i.get(a,"user.key")&&(g=t.datetime||t.boolean||t.number||t.text||t.list)});let v=!0;switch(f){case"cons":let t=u(a.value)||[];if(0===B(t))return!1;v=!!$(t,t=>st(g).indexOf(st(t))>-1);break;case"notEmpty":v=!!g;break;case"empty":v=!g;break;case"true":v=!0===g||"true"===g;break;case"false":v=!g||!1===g||"false"===g}if(!v)return!1;break;case"timming":if("in"===a.business_hour&&!o.is_in_business_hour)return!1;if("notIn"===a.business_hour&&o.is_in_business_hour)return!1;if(B(a.days_of_week)>0&&!$(a.days_of_week,t=>st(vt((new y).getDay()))===st(t)))return!1;if(B(a.minutes_of_day)>0&&B(a.minutes_of_day)%2==0){var l=new y,c=l.getMinutes()+60*l.getHours();let t=!1;for(let e=0;e<a.minutes_of_day.length;e+=2){if(a.minutes_of_day[e]<=c&&c<=a.minutes_of_day[e+1]){t=!0;break}if(a.minutes_of_day[e]>a.minutes_of_day[e+1]&&(c>=a.minutes_of_day[e]||c<=a.minutes_of_day[e+1])){t=!0;break}}if(!t)return!1}break;case"offline":if(!o.is_online!=!!a.offline)return!1}}return!0}function vt(t){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][t]}let yt={};function _t(t,e){for(var n=0;n<t.length;n++){let e=t[n];if(e&&!yt[e]){yt[e]=!0;for(var i=0;i<2;i++){let t=[400,500][i],n=document.createElement("div");n.innerHTML="@!-/#Chào mỪng1",n.style.position="absolute",n.style.display="block",n.style.opacity="0.1",n.style.color="transparent",n.style.fontSize="20px",n.style.height="0px",n.style.top="0px",n.style.width="0px",n.style.fontWeight=t,n.setAttribute("subiz-preload",e+":"+t),document.body.appendChild(n),n.style.fontFamily=e,w(()=>n.remove(),3e3)}}}}function wt(t,e){if(e||(e=()=>{}),!t)return e(),Promise.resolve(!0);let n=new Image;return t=function(t){let e="https://vcdn.subiz-cdn.com/file/";return t?O(t,"/")||O(t,"data:")?t:(O(t,"http://")||O(t,"https://")||O(t,"//")||(t=G(e)+"/"+q(t,"/")),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("https://file-subiz.com/",e)).replace("http://file-subiz.com/",e)).replace("https://file-v4.subiz.com/",e)).replace("http://file-v4.subiz.com/",e)).replace("https://filev4.subiz.com/",e)).replace("http://filev4.subiz.com/",e)).replace("https://filev4-1.subiz.com/",e)).replace("http://filev4-1.subiz.com/",e)).replace("https://file.subiz.com/",e)).replace("http://file.subiz.com/",e)).replace("https://file.mysubiz.com/",e)).replace("http://file.mysubiz.com/",e)):""}(t),n.src=t,new Promise(t=>{n.onload=()=>{e(),t()}})}function xt(t){if(!t)return 0;t.length<=2&&(t+=":00");let e=t.split(":");if(2!==e.length)return 0;let n=parseInt(e[0]);if(n<0||n>23)return 0;let i=parseInt(e[1]);return i<0||i>59?0:60*n+i}function kt(t,e,n){var i=-(new y).getTimezoneOffset();n&&(i=xt(n));var r=new y(t).getTime(),o=new y(e).getTime(),s=Math.ceil((r/60/1e3+i)/60/24),a=Math.ceil((o/60/1e3+i)/60/24);return Math.abs(s-a)}function At(t,e,n){var i=-(new y).getTimezoneOffset(),r=-(new y).getTimezoneOffset();n&&(r=xt(n));var o=new y(t).getTime()+60*(r-i)*1e3,s=new y(e).getTime()+60*(r-i)*1e3;return Math.abs(new y(o).getYear()-new y(s).getYear())}function zt(t,e,n){return 0===kt(t,e,n)}function It(t,e,n,r){var o=-(new y).getTimezoneOffset(),s=o;e&&(s=xt(e));var a=new y(Mt(t));let p=new y(a);p.setMinutes(a.getMinutes()+s-o),n||(n=new y);let l=p.getHours(),c=p.getMinutes(),d=i.get(navigator,"languages.0","en-US");r&&(d=r);let h=p.toLocaleDateString(d,{weekday:"long"}),m=p.getFullYear(),u=p.getMonth()+1,g=p.toLocaleDateString(d,{month:"long"}),b=p.getDate();return l<10&&(l="0"+l),c<10&&(c="0"+c),zt(a,n,e)?l+":"+c:kt(a,n,e)<=5?h+", "+l+":"+c:0===At(a,n,e)?"vi-VN"===d?b+" "+g+", "+l+":"+c:g+" "+b+", "+l+":"+c:"vi-VN"===d?b+"/"+u+"/"+m+", "+l+":"+c:m+"/"+u+"/"+b+", "+l+":"+c}function Ct(t){return Math.floor(Mt(t)/1e3)}function Mt(t){return t?"number"!=typeof t&&(t=new y(t).getTime()):t=0,t>1e18?Math.floor(t/1e6):t>1e15?Math.floor(t/1e3):t>1e12?t:1e3*t}function St(){let t=Dt("sbz_locale"),e=document.getElementsByTagName("html")[0].getAttribute("xml:lang")||document.getElementsByTagName("html")[0].getAttribute("lang"),n=navigator.language;return t||e||n}function Dt(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))}var jt=t=>new Promise(e=>w(e,t));function Et(t,e="VND"){let n=Lt.find(t=>t.code===e)||{name:"Dong",code:"VND",symbol:"₫"},i="",r="";return"VND"===e?(i="",r=" "+n.symbol):(i=n.symbol+" ",r=""),t?i+(t=Math.round(t)).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")+r:`${i}0${r}`}function Tt(t){return(t=(t+="").replaceAll("đ","d").replaceAll("Đ","D")).normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Pt(t,e=!0){var n=t.parentNode,i=window.getComputedStyle(n,null),r=parseInt(i.getPropertyValue("border-top-width")),o=parseInt(i.getPropertyValue("border-left-width")),s=t.offsetTop-n.offsetTop<n.scrollTop,a=t.offsetTop-n.offsetTop+t.clientHeight-r>n.scrollTop+n.clientHeight,p=t.offsetLeft-n.offsetLeft<n.scrollLeft,l=t.offsetLeft-n.offsetLeft+t.clientWidth-o>n.scrollLeft+n.clientWidth,c=s&&!a;(s||a)&&e&&(n.scrollTop=t.offsetTop-n.offsetTop-n.clientHeight/2-r+t.clientHeight/2),(p||l)&&e&&(n.scrollLeft=t.offsetLeft-n.offsetLeft-n.clientWidth/2-o+t.clientWidth/2),(s||a||p||l)&&!e&&t.scrollIntoView(c)}const Lt=[{code:"USD",symbol:"$"},{code:"VND",symbol:"₫"}];function Nt(t){return Rt(t).trim()}function Ft(t){return Ot(t)}function Rt(t){if(!t)return"";let e="";return"bullet_list"==t.type||"ordered_list"==t.type?(N(t.content,(n,i)=>{let r="ordered_list"==t.type?"\n"+(Number(i)+1)+". ":"\n* ";e+=r+Rt(n).trim()}),e):("heading"!=t.type&&"paragraph"!=t.type||(e+="\n"),""!=t.type&&"text"!=t.type&&"link"!=t.type&&"mention-agent"!=t.type&&"mention"!=t.type&&"dynamic-field"!=t.type||B(t.content)?"horizontal_rule"==t.type?e+"\n---\n":"emoji"==t.type?e+(i.get(t,"attrs.code")||t.text||t.Text||""):B(t.content)?(N(t.content,t=>{e+=Rt(t)}),e):e+(t.text||""):e+(t.text||""))}function Wt(t){if(!t||!t.split)return"";b.style.color=t;const e=g.contentWindow.getComputedStyle(b).color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)/);return e?{red:parseInt(e[1]),green:parseInt(e[2]),blue:parseInt(e[3])}:null}let Ut=["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 Ot(t){if(!t)return!0;if("image"===t.type&&i.get(t,"image.url"))return!1;if("emoji"===t.type&&(i.get(t,"attrs.code")||t.Text))return!1;if("horizontal_rule"===t.type)return!1;let e=B(P(N(t.content,t=>Ot(t)),t=>!t))>0;return!G(t.text)&&!e}function Bt(t){return!t||!t.deleted&&!(t.text||!Ot(t.block)||!function(t){return!t||!B(t.attachments)||0==B(P(t.attachments,t=>"quick_replies"!=t.type||B(P(t.quick_replies,t=>B(G(t))>0))>0))}(t))}function Ht(t,e){let n=P(t.exclude_urls,t=>st(t)),i=!1,r=0;N(n,t=>{st(e).indexOf(t)>-1&&(r<B(t)&&(r=B(t)),i=!0)});let o=0,s=P(t.urls,t=>st(t)),a=0==B(s);return N(s,t=>{st(e).indexOf(t)>-1&&(o<B(t)&&(o=B(t)),a=!0)}),!(i&&r>=o||!a)}Ut=N(Ut,t=>":"+t+":"),n.d(e,["DEFVAL",0,ut,"DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL",0,mt])},1139(t,e,n){"use strict";n.d(e,{A:()=>i});class i{constructor(t){this.isOpen=!0===t,this.cbs=[]}open(){this.isOpen=!0;let t=[];this.cbs.forEach(e=>{this.isOpen?e():t.push(e)}),this.cbs=t}close(){this.isOpen=!1}entry(t,e){return this.isOpen?(e&&(this.isOpen=!1),t&&t(),Promise.resolve()):new Promise(n=>{this.cbs.push(()=>{e&&(this.isOpen=!1),t&&t(),n()})})}}},5922(t,e,n){"use strict";var i=n(9917),r=n(3078),o={};n.r(o),n.d(o,{trackAreaClicked:()=>r.E_,trackExitIntent:()=>r.WD,trackInactivity:()=>r.aL,trackScrollingPercentage:()=>r.Vx,trackTimeOnPage:()=>r.Jb});var s={};(s=Object.assign(s,i)).Gate=n(1139).A,s.Mutex=n(5369).A;var a=n(3259);s.get=a.get,s.set=a.set,s.take=a.take,s.Pubsub=n(6463).A;const p=s=Object.assign(s,o);n.d(e,["A",0,p])},5369(t,e,n){"use strict";n.d(e,{A:()=>i});class i{constructor(){this.isOpen=!0,this.cbs=[]}_check(){if(!this.isOpen)return;let t=this.cbs.pop();t&&(this.isOpen=!1,t())}lock(){return new Promise(t=>{this.cbs.push(t),this._check()})}unlock(){this.isOpen||(this.isOpen=!0,this._check())}}},3259(t,e,n){"use strict";n.r(e),n.d(e,{get:()=>a,set:()=>p,take:()=>l});var i=Object.prototype.toString,r=Array.isArray||function(t){return"[object Array]"===i.call(t)};function o(t){var e=parseInt(t);return e.toString()===t?e:t}function s(t,e){if(function(t,e){return"number"==typeof e&&r(t)||function(t,e){return null!=t&&Object.prototype.hasOwnProperty.call(t,e)}(t,e)}(t,e))return t[e]}function a(t,e,n){if("number"==typeof e&&(e=[e]),!e||0===e.length)return t;if(null==t)return n;if("string"==typeof e)return a(t,e.split("."),n);var i=o(e[0]),r=s(t,i);return void 0===r?n:1===e.length?r:a(t[i],e.slice(1),n)}function p(t,e,n){if("number"==typeof e&&(e=[e]),!e||0===e.length)return t;if("string"==typeof e)return p(t,e.split(".").map(o),n);var i=e[0],r=s(t,i);return 1===e.length?(t[i]=n,r):(void 0===r&&(t[i]="number"==typeof e[1]?[]:{}),p(t[i],e.slice(1),n))}function l(t,e=1){if(!Array.isArray(t))return[];let n=t.length;if("number"!=typeof n||n<=0)return[];if(e<=0)return[];let i=Math.min(e,n);return t.slice(0,i)}},6463(t,e,n){"use strict";n.d(e,{A:()=>i});class i{constructor(){this.listeners={}}publish(t,...e){const n=(this.listeners[t]||[]).slice();for(const t of n)t.obj._isMounted||t.unsubscribe(),t.active&&t.cb(...e)}on2(t,e,n){const i={obj:t,cb:n,active:!0};let r=()=>{};const o=()=>{i.active&&(i.active=!1,this.listeners[e]=(this.listeners[e]||[]).filter(t=>t!==i),this.listeners[e].length||delete this.listeners[e],r())};return i.unsubscribe=o,this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(i),"function"==typeof t.onDispose&&(r=t.onDispose(o)),o}clear(){for(const t of Object.values(this.listeners))for(const e of t.slice())e.unsubscribe()}}},4339(t,e,n){"use strict";function i(t,e=!1){if("string"!=typeof t)return"";const n=t.trim(),i=n.replace(/[\u0000-\u0020\u007f]/g,""),r=i.match(/^([a-z][a-z0-9+.-]*):/i);return r?/^https?$/i.test(r[1])||!e&&/^(mailto|tel)$/i.test(r[1])||e&&/^blob$/i.test(r[1])||e&&/^data:image\/(png|jpe?g|gif|webp|avif);base64,/i.test(i)?n:"":n}n.d(e,{P:()=>i})},5672(t){t.exports=function(){"use strict";var t=function(){return t.get.apply(t,arguments)},e=t.utils={isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},isPlainObject:function(t){return!!t&&"[object Object]"===Object.prototype.toString.call(t)},toArray:function(t){return Array.prototype.slice.call(t)},getKeys:Object.keys||function(t){var e=[],n="";for(n in t)t.hasOwnProperty(n)&&e.push(n);return e},encode:function(t){return String(t).replace(/[,;"\\=\s%]/g,function(t){return encodeURIComponent(t)})},decode:function(t){return decodeURIComponent(t)},retrieve:function(t,e){return t??e}};return t.defaults={},t.expiresMultiplier=86400,t.set=function(t,n,i){if(e.isPlainObject(t))for(var r in t)t.hasOwnProperty(r)&&this.set(r,t[r],n);else{var o=void 0!==(i=e.isPlainObject(i)?i:{expires:i}).expires?i.expires:this.defaults.expires||"",s=typeof o;"string"===s&&""!==o?o=new Date(o):"number"===s&&(o=new Date(+new Date+1e3*this.expiresMultiplier*o)),""!==o&&"toUTCString"in o&&(o=";expires="+o.toUTCString());var a=i.path||this.defaults.path;a=a?";path="+a:"";var p=i.domain||this.defaults.domain;p=p?";domain="+p:"";var l=i.secure||this.defaults.secure?";secure":"";!1===i.secure&&(l="");var c=i.sameSite||this.defaults.sameSite;c=c?";SameSite="+c:"",null===i.sameSite&&(c=""),document.cookie=e.encode(t)+"="+e.encode(n)+o+a+p+l+c}return this},t.setDefault=function(n,i,r){if(e.isPlainObject(n)){for(var o in n)void 0===this.get(o)&&this.set(o,n[o],i);return t}if(void 0===this.get(n))return this.set.apply(this,arguments)},t.remove=function(t){for(var n=0,i=(t=e.isArray(t)?t:e.toArray(arguments)).length;n<i;n++)this.set(t[n],"",-1);return this},t.removeSpecific=function(t,n){if(!n)return this.remove(t);t=e.isArray(t)?t:[t],n.expires=-1;for(var i=0,r=t.length;i<r;i++)this.set(t[i],"",n);return this},t.empty=function(){return this.remove(e.getKeys(this.all()))},t.get=function(t,n){var i=this.all();if(e.isArray(t)){for(var r={},o=0,s=t.length;o<s;o++){var a=t[o];r[a]=e.retrieve(i[a],n)}return r}return e.retrieve(i[t],n)},t.all=function(){if(""===document.cookie)return{};for(var t=document.cookie.split("; "),n={},i=0,r=t.length;i<r;i++){var o=t[i].split("="),s=e.decode(o.shift()),a=e.decode(o.join("="));n[s]=a}return n},t.enabled=function(){if(navigator.cookieEnabled)return!0;var e="_"===t.set("_","_").get("_");return t.remove("_"),e},t}()},1775(t,e,n){"use strict";n.r(e);var i=n(6314),r=n.n(i),o=n(4417),s=n.n(o),a=n(5457),p=n.n(a),l=n(5007),c=n.n(l),d=n(2729),h=n.n(d),m=n(1389),u=n.n(m),g=n(9658),b=n.n(g),f=n(3284),v=n.n(f),y=n(8226),_=n.n(y),w=n(6129),x=n.n(w),k=n(2420),A=n.n(k),z=n(7987),I=n.n(z),C=n(102),M=n.n(C),S=n(4681),D=n.n(S),j=n(2338),E=n.n(j),T=n(1196),P=n.n(T),L=n(4777),N=n.n(L),F=n(7435),R=n.n(F),W=n(4865),U=n.n(W),O=n(6501),B=n.n(O),H=n(9521),G=n.n(H),q=n(7698),Z=n.n(q),$=n(8362),V=n.n($),J=n(3970),Y=n.n(J),Q=n(8268),X=n.n(Q),K=n(6120),tt=n.n(K),et=r()(function(t){return t[1]}),nt=s()(p()),it=s()(c()),rt=s()(h()),ot=s()(u()),st=s()(b()),at=s()(v()),pt=s()(_()),lt=s()(x()),ct=s()(A()),dt=s()(I()),ht=s()(M()),mt=s()(D()),ut=s()(E()),gt=s()(P()),bt=s()(N()),ft=s()(R()),vt=s()(U()),yt=s()(B()),_t=s()(G()),wt=s()(Z()),xt=s()(V()),kt=s()(Y()),At=s()(X()),zt=s()(tt());et.push([t.id,"#sbz92 * {\n all: unset !important;\n}\n.sbz_no_scroll {\n overflow: hidden !important;\n overflow-x: hidden !important;\n overflow-y: hidden !important;\n}\n#sbz92 {\n /* Handle on hover */\n /*\n.widget-header--button-close {\n\tdisplay: flex;\n\tborder-radius: 6px;\n\tjustify-self: flex-end;\n\talign-items: center;\n\talign-self: flex-start;\n\n\tfilter: brightness(0.95);\n\t&:hover {\n\t\topacity: 1;\n\t\tfilter: brightness(1.1);\n\t\tscale: 1.1;\n\t}\n}\n*/\n /*\n[data-tooltip]::after {\n\ttext-align: center;\n\tmin-width: 60px;\n\tmax-width: 350px;\n\n\ttransform: translate3d(0, 0, 0);\n\t-webkit-backface-visibility: hidden;\n\tbackface-visibility: hidden;\n\twill-change: transform;\n\topacity: 0;\n\tpointer-events: none;\n\ttransition: opacity @tooltip-transition-duration @tooltip-transition-easing @tooltip-transition-delay;\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tz-index: @z-index + 2000;\n\ttransform-origin: top;\n\twhite-space: pre-wrap;\n\twidth: 100%;\n\n\tbackground: @black;\n\tborder-radius: 5px;\n\n\t.color(@white);\n\n\tcontent: attr(data-tooltip);\n\tfont-size: @tooltip-font-size;\n\tfont-weight: @tooltip-font-weight;\n\ttext-transform: @tooltip-text-transform;\n\tpadding: 0.5em;\n\tbox-sizing: content-box;\n}\n\n[data-tooltip]:hover::after,\n[data-tooltip]:focus::after {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n// ------------------------------------------------\n// [2] Position Modifiers\n// ------------------------------------------------\n\n[data-tooltip][data-tooltip-position|='top']::after {\n\tmargin-bottom: @tooltip-margin;\n\ttransform: translate3d(-50%, -5px, 0);\n\tbottom: 100%;\n\tleft: 50%;\n}\n\n// ------------------------------------------------\n// [2.1] Top Left\n// ------------------------------------------------\n[data-tooltip][data-tooltip-position='top-left']::after {\n\ttransform: translate3d(~'calc(-100% + 16px)', -5px, 0);\n\tbottom: 100%;\n}\n\n// ------------------------------------------------\n// [2.2] Top Right\n// ------------------------------------------------\n[data-tooltip][data-tooltip-position='top-right']::after {\n\ttransform: translate3d(~'calc(0% + -16px)', -5px, 0);\n\tbottom: 100%;\n}\n\n// ------------------------------------------------\n// [2.3] Bottom\n// ------------------------------------------------\n\n[data-tooltip][data-tooltip-position|='bottom']::after,\n[data-tooltip]:not([data-tooltip-position])::after {\n\ttransform: translate3d(-50%, 0, 0);\n\tmargin-top: @tooltip-margin;\n\tleft: 50%;\n\ttop: 100%;\n}\n\n// ------------------------------------------------\n// [2.4] Bottom Left\n// ------------------------------------------------\n[data-tooltip][data-tooltip-position='bottom-left']::after {\n\ttransform: translate3d(~'calc(-100% + 16px)', 0, 0);\n}\n\n// ------------------------------------------------\n// [2.5] Bottom Right\n// ------------------------------------------------\n[data-tooltip][data-tooltip-position='bottom-right']::after {\n\ttransform: translate3d(~'calc(0% + -16px)', 0, 0);\n}\n\n// ------------------------------------------------\n// [2.6] Left\n// ------------------------------------------------\n[data-tooltip][data-tooltip-position='left']::after {\n\tbottom: auto;\n\tleft: auto;\n\tright: 100%;\n\ttop: 50%;\n\ttransform: translate3d(0, -50%, 0);\n\tmargin-right: @tooltip-margin;\n}\n\n// ------------------------------------------------\n// [2.7] Right\n// ------------------------------------------------\n[data-tooltip][data-tooltip-position='right']::after {\n\tbottom: auto;\n\tleft: 100%;\n\ttop: 50%;\n\ttransform: translate3d(0, -50%, 0);\n\tmargin-left: @tooltip-margin;\n}\n\n*/\n}\n#sbz92 *,\n#sbz92 *::before,\n#sbz92 *::after {\n box-sizing: border-box !important;\n}\n#sbz92 [tabindex='-1']:focus:not(:focus-visible) {\n outline: 0 !important;\n}\n#sbz92 b,\n#sbz92 strong {\n font-weight: 500 !important;\n}\n#sbz92 a {\n color: #020202 !important;\n text-decoration: none !important;\n background-color: transparent !important;\n font-weight: 600 !important;\n}\n#sbz92 a:hover {\n cursor: pointer !important;\n color: #000000 !important;\n text-decoration: underline !important;\n}\n#sbz92 a:not([href]) {\n color: inherit !important;\n text-decoration: none !important;\n}\n#sbz92 a:not([href]):hover {\n color: inherit !important;\n text-decoration: none !important;\n}\n#sbz92 img {\n vertical-align: middle !important;\n border-style: none !important;\n}\n#sbz92 svg {\n overflow: hidden !important;\n vertical-align: middle !important;\n}\n#sbz92 label {\n display: inline-block !important;\n}\n#sbz92 button {\n border-radius: 0 !important;\n}\n#sbz92 button:focus {\n outline: 1px dotted !important;\n outline: 5px auto -webkit-focus-ring-color !important;\n}\n#sbz92 input,\n#sbz92 button,\n#sbz92 select,\n#sbz92 optgroup,\n#sbz92 textarea {\n margin: 0 !important;\n}\n#sbz92 button,\n#sbz92 input {\n overflow: visible !important;\n}\n#sbz92 button,\n#sbz92 select {\n text-transform: none !important;\n}\n#sbz92 select {\n word-wrap: normal !important;\n}\n#sbz92 button,\n#sbz92 [type=\"button\"],\n#sbz92 [type=\"reset\"],\n#sbz92 [type=\"submit\"] {\n -webkit-appearance: button !important;\n}\n#sbz92 button:not(:disabled),\n#sbz92 [type='button']:not(:disabled),\n#sbz92 [type='reset']:not(:disabled),\n#sbz92 [type='submit']:not(:disabled) {\n cursor: pointer !important;\n}\n#sbz92 button::-moz-focus-inner,\n#sbz92 [type='button']::-moz-focus-inner,\n#sbz92 [type='reset']::-moz-focus-inner,\n#sbz92 [type='submit']::-moz-focus-inner {\n padding: 0 !important;\n border-style: none !important;\n}\n#sbz92 input[type='radio'],\n#sbz92 input[type='checkbox'] {\n box-sizing: border-box !important;\n padding: 0 !important;\n}\n#sbz92 input[type='date'],\n#sbz92 input[type='time'],\n#sbz92 input[type='datetime-local'],\n#sbz92 input[type='month'] {\n -webkit-appearance: listbox !important;\n}\n#sbz92 textarea {\n overflow: auto !important;\n resize: vertical !important;\n}\n#sbz92 [type='number']::-webkit-inner-spin-button,\n#sbz92 [type='number']::-webkit-outer-spin-button {\n height: auto !important;\n}\n#sbz92 [hidden] {\n display: none !important;\n}\n#sbz92 ::-webkit-input-placeholder {\n /* Edge */\n color: #777 !important;\n}\n#sbz92 :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: #777 !important;\n}\n#sbz92 ::placeholder {\n color: #777 !important;\n}\n#sbz92 div {\n display: block !important;\n text-rendering: geometricPrecision !important;\n -webkit-font-smoothing: antialiased !important;\n -moz-osx-font-smoothing: grayscale !important;\n}\n#sbz92 ::-webkit-scrollbar {\n width: 7px !important;\n height: 7px !important;\n}\n#sbz92 ::-webkit-scrollbar-track {\n border-radius: 10px !important;\n}\n#sbz92 ::-webkit-scrollbar-thumb {\n border-radius: 10px !important;\n background: #d6d6d6 !important;\n}\n#sbz92 ::-webkit-scrollbar-thumb:hover {\n background: #aaa !important;\n}\n#sbz92 .badge {\n padding: 2px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n border-radius: 6px !important;\n display: inline-flex !important;\n align-items: center !important;\n}\n#sbz92 .badge.badge--success {\n color: #28a745 !important;\n -webkit-text-fill-color: #28a745 !important;\n background: #28a74526 !important;\n}\n#sbz92 .dot {\n width: 8px !important;\n height: 8px !important;\n border-radius: 4px !important;\n flex-shrink: 0 !important;\n background: #000 !important;\n}\n#sbz92 .dot.dot--success {\n background: #28a745 !important;\n}\n#sbz92 * {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;\n -webkit-tap-highlight-color: transparent !important;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji' !important;\n font-size: 16px !important;\n -webkit-box-sizing: border-box !important;\n -moz-box-sizing: border-box !important;\n box-sizing: border-box !important;\n margin: 0 !important;\n padding: 0 !important;\n border: 0 !important;\n vertical-align: baseline !important;\n}\n#sbz92 button:focus {\n outline: none !important;\n}\n#sbz92 button:focus-visible {\n outline: 2px solid #6c757d !important;\n outline-offset: 3px !important;\n}\n#sbz92 button:not(:disabled) {\n cursor: pointer !important;\n}\n#sbz92 img {\n overflow: hidden !important;\n flex-shrink: 0 !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n background-size: 100% 100% !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -o-user-select: none !important;\n user-select: none !important;\n -webkit-user-drag: none !important;\n}\n#sbz92 .pos-relative {\n position: relative !important;\n}\n#sbz92 .flex-row {\n flex-direction: row !important;\n}\n#sbz92 .flex-column {\n flex-direction: column !important;\n}\n#sbz92 .flex-grow-1 {\n flex-grow: 1 !important;\n}\n#sbz92 .align-self-end {\n align-self: flex-end !important;\n}\n#sbz92 .align-items-end {\n align-items: flex-end !important;\n}\n#sbz92 .justify-content-center {\n justify-content: center !important;\n}\n#sbz92 .h-full {\n height: 100% !important;\n}\n#sbz92 .w-full {\n width: 100% !important;\n}\n#sbz92 .text-muted {\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n}\n#sbz92 .text-lg {\n font-size: 18px !important;\n}\n#sbz92 .text-xl {\n font-size: 20px !important;\n}\n#sbz92 .text-sm {\n font-size: 14px !important;\n}\n#sbz92 .text-center {\n text-align: center !important;\n}\n#sbz92 .text-danger {\n color: #ea3d2f !important;\n}\n#sbz92 .text-italic {\n font-style: italic !important;\n}\n#sbz92 .d-none {\n display: none !important;\n}\n#sbz92 .d-flex {\n display: flex !important;\n}\n#sbz92 .d-inline-block {\n display: inline-block !important;\n}\n#sbz92 .ml-1 {\n margin-left: 7.5px !important;\n}\n#sbz92 .pl-2 {\n padding-left: 15px !important;\n}\n#sbz92 .pr-2 {\n padding-right: 15px !important;\n}\n#sbz92 .pb-2 {\n padding-bottom: 15px !important;\n}\n#sbz92 .mt-1 {\n margin-top: 7.5px !important;\n}\n#sbz92 .mt-2 {\n margin-top: 15px !important;\n}\n#sbz92 .ml-2 {\n margin-left: 15px !important;\n}\n#sbz92 .mr-1 {\n margin-right: 7.5px !important;\n}\n#sbz92 .mr-2 {\n margin-right: 15px !important;\n}\n#sbz92 .pt-3 {\n padding-top: 22.5px !important;\n}\n#sbz92 .pl-3 {\n padding-left: 22.5px !important;\n}\n#sbz92 .pr-3 {\n padding-right: 22.5px !important;\n}\n#sbz92 .pb-3 {\n padding-bottom: 22.5px !important;\n}\n#sbz92 .mt-3 {\n margin-top: 22.5px !important;\n}\n#sbz92 .ml-3 {\n margin-left: 22.5px !important;\n}\n#sbz92 .mr-3 {\n margin-right: 22.5px !important;\n}\n#sbz92 .mb-3 {\n margin-bottom: 22.5px !important;\n}\n#sbz92 .mb-2 {\n margin-bottom: 15px !important;\n}\n#sbz92 .mb-1 {\n margin-bottom: 7.5px !important;\n}\n#sbz92 .muted {\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n}\n#sbz92 .i {\n font-style: italic !important;\n}\n#sbz92 .align-items-center {\n align-items: center !important;\n}\n#sbz92 .text-truncate {\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n}\n#sbz92 .flex_1 {\n flex: 1 !important;\n flex-shrink: 0 !important;\n}\n#sbz92 .justify-content-between {\n justify-content: space-between !important;\n}\n#sbz92 .no-shrink {\n flex-shrink: 0 !important;\n}\n#sbz92 .loading {\n flex: 1 !important;\n align-items: center !important;\n justify-content: center !important;\n display: flex !important;\n flex-direction: column !important;\n background: white !important;\n}\n#sbz92 .avatar-container {\n text-align: center !important;\n}\n#sbz92 .avatar {\n position: relative !important;\n object-fit: cover !important;\n display: inline-block !important;\n}\n#sbz92 .group-avatar--primary .avatar {\n width: 40px !important;\n height: 40px !important;\n border-radius: 35px !important;\n}\n#sbz92 .group-avatar--secondary .avatar {\n position: relative !important;\n width: 35px !important;\n height: 35px !important;\n border-radius: 35px !important;\n}\n#sbz92 .avatar.avatar__account {\n width: 38px !important;\n height: 38px !important;\n border-radius: 38px !important;\n margin-right: 7.5px !important;\n}\n#sbz92 .group-avatar--primary .group-avatar--agent-middle {\n width: 50px !important;\n height: 50px !important;\n margin-left: -10px !important;\n z-index: 3 !important;\n position: relative !important;\n}\n#sbz92 .group-avatar--primary .group-avatar--agent-left {\n z-index: 2 !important;\n}\n#sbz92 .group-avatar--primary .group-avatar--agent-right {\n z-index: 2 !important;\n margin-left: -10px !important;\n}\n#sbz92 .group-avatar--secondary .group-avatar--agent-left {\n z-index: 3 !important;\n}\n#sbz92 .group-avatar--secondary .group-avatar--agent-middle {\n z-index: 2 !important;\n margin-left: -15px !important;\n}\n#sbz92 .group-avatar--secondary .group-avatar--agent-right {\n z-index: 1 !important;\n margin-left: -15px !important;\n}\n#sbz92 .widget-header {\n z-index: -1 !important;\n position: relative !important;\n transition: height 0.2s !important;\n border-radius: 15px 15px 0px 0px !important;\n background: '@background' !important;\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n width: 100% !important;\n}\n#sbz92 .widget-header .widget-header--total-unread-convo {\n font-size: 13px !important;\n font-weight: 500 !important;\n background: #ef000d !important;\n display: flex !important;\n border-radius: 50% !important;\n justify-content: center !important;\n align-items: center !important;\n width: 20px !important;\n height: 20px !important;\n position: absolute !important;\n cursor: pointer !important;\n right: -8px !important;\n top: -4px !important;\n}\n#sbz92 .widget-header--collapsed {\n height: auto !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--collapsed {\n height: auto !important;\n padding: 15px 22.5px !important;\n position: relative !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--collapsed .widget-header--title {\n white-space: nowrap !important;\n overflow: hidden !important;\n font-weight: 500 !important;\n text-overflow: ellipsis !important;\n font-size: 16px !important;\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--collapsed .widget-header--description {\n font-size: 14px !important;\n overflow: hidden !important;\n opacity: 0.7 !important;\n flex: 1 !important;\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n margin-top: 2.5px !important;\n position: relative !important;\n line-height: 1.5 !important;\n}\n#sbz92 .mobile .widget-header {\n border-radius: 0px !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--expanded {\n height: 224px !important;\n padding: 15px 22.5px !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--expanded .widget-header--top-wrapper {\n display: flex !important;\n flex-direction: row !important;\n align-items: center !important;\n margin-bottom: 10px !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--expanded .widget-header--avatar-wrapper {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--expanded .widget-header--title {\n white-space: nowrap !important;\n overflow: hidden !important;\n font-weight: 500 !important;\n text-overflow: ellipsis !important;\n flex: 1 !important;\n font-size: 16px !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--expanded .widget-header--description {\n position: relative !important;\n text-align: center !important;\n margin-top: 15px !important;\n white-space: pre-wrap !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 2 !important;\n overflow: hidden !important;\n line-height: 1.5 !important;\n}\n#sbz92 .widget-header--convo-expanded {\n height: 224px !important;\n}\n#sbz92 .widget-header--inner {\n position: absolute !important;\n top: 0 !important;\n left: 50% !important;\n transform: translateX(-50%) !important;\n width: 100% !important;\n opacity: 1 !important;\n display: flex !important;\n}\n#sbz92 .widget-header--inner.widget-header--inner--hidden {\n opacity: 0 !important;\n transform: scale(0) !important;\n animation-duration: 0.05s !important;\n animation-name: hide !important;\n}\n#sbz92 .widget-header--title-container {\n min-width: 0 !important;\n flex: 1 !important;\n display: flex !important;\n flex-direction: column !important;\n z-index: 1 !important;\n}\n#sbz92 .widget-header--button-close {\n display: flex !important;\n border-radius: 6px !important;\n justify-self: flex-end !important;\n align-items: center !important;\n align-self: flex-start !important;\n opacity: 0.6 !important;\n transition: opacity 0.15s ease, scale 0.15s ease, filter 0.15s ease !important;\n filter: brightness(0.95) !important;\n}\n#sbz92 .widget-header--button-close:hover {\n opacity: 1 !important;\n filter: brightness(1.1) !important;\n scale: 1.1 !important;\n}\n#sbz92 .widget-header--button-close-icon {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci14Ij48bGluZSB4MT0iMTgiIHkxPSI2IiB4Mj0iNiIgeTI9IjE4Ij48L2xpbmU+PGxpbmUgeDE9IjYiIHkxPSI2IiB4Mj0iMTgiIHkyPSIxOCI+PC9saW5lPjwvc3ZnPgo=') !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n width: 24px !important;\n height: 24px !important;\n display: block !important;\n cursor: pointer !important;\n}\n#sbz92 .widget-header--button-back {\n background-image: url('data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjI0IiAgaGVpZ2h0PSIyNCIgIHZpZXdCb3g9IjAgMCAyNCAyNCIgIGZpbGw9Im5vbmUiICBzdHJva2U9IndoaXRlIiAgc3Ryb2tlLXdpZHRoPSIyIiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PHBhdGggc3Ryb2tlPSJub25lIiBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTQgNmwxNiAwIiAvPjxwYXRoIGQ9Ik00IDEybDE2IDAiIC8+PHBhdGggZD0iTTQgMThsMTYgMCIgLz48L3N2Zz4K') !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n background-size: 24px 24px !important;\n width: 24px !important;\n height: 24px !important;\n display: block !important;\n position: relative !important;\n}\n#sbz92 .widget-header--wrap-button-back {\n display: flex !important;\n position: relative !important;\n margin-right: 7.5px !important;\n cursor: pointer !important;\n scale: 1 !important;\n opacity: 0.6 !important;\n transition: opacity 0.15s ease, scale 0.15s ease, filter 0.15s ease !important;\n filter: brightness(0.95) !important;\n}\n#sbz92 .widget-header--wrap-button-back:hover {\n opacity: 1 !important;\n filter: brightness(1.1) !important;\n scale: 1.1 !important;\n}\n#sbz92 .fade-enter-active,\n#sbz92 .fade-leave-active {\n transition: opacity 0.5s ease-out 0.2s !important;\n}\n#sbz92 .fade-enter,\n#sbz92 .fade-leave-to {\n opacity: 0 !important;\n}\n#sbz92 .slide-fade-enter-active {\n transition: all 0.3s ease !important;\n}\n#sbz92 .slide-fade-leave-active {\n transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1) !important;\n}\n#sbz92 .slide-fade-enter,\n#sbz92 .slide-fade-leave-to {\n transform: translateX(10px) !important;\n opacity: 0 !important;\n}\n#sbz92 .widget_header__body {\n padding-bottom: 70px !important;\n}\n#sbz92 .widget_header__body.widget_header__body__social {\n display: flex !important;\n}\n#sbz92 .social__account_logo {\n height: 90px !important;\n width: 90px !important;\n margin-right: 15px !important;\n border-radius: 15px !important;\n object-fit: cover !important;\n}\n#sbz92 .social__introduction {\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n max-height: 72px !important;\n overflow: hidden !important;\n display: -webkit-box !important;\n -webkit-box-orient: vertical !important;\n -webkit-line-clamp: 3 !important;\n}\n#sbz92 .social__links {\n display: flex !important;\n flex-direction: row !important;\n}\n#sbz92 .social__links-logo {\n height: 30px !important;\n width: 30px !important;\n border-radius: 50% !important;\n margin-right: 10px !important;\n margin-top: 5px !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n display: block !important;\n}\n#sbz92 .social__links-logo--facebook {\n background-image: url('data:image/svg+xml,%3C?xml%20version%3D%221.0%22%20?%3E%3Csvg%20width%3D%2230%22%20height%3D%2230%22%20viewBox%3D%220%200%2030%2030%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2215%22%20r%3D%2215%22%20fill%3D%22%230264FF%22/%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M17.2944%2029.8252C16.5464%2029.9404%2015.7803%2030%2015%2030C14.0962%2030%2013.2109%2029.9199%2012.3511%2029.7666V18.4775H10V14.4287H12.3511V11.8086C12.3511%209.93457%2013.2744%207%2017.3384%207L21%207.01465V10.9453H18.3433C17.9075%2010.9453%2017.2947%2011.1553%2017.2947%2012.0488V14.4326H20.989L20.5571%2018.4775H17.2944V29.8252Z%22%20fill%3D%22white%22/%3E%3C/svg%3E') !important;\n}\n#sbz92 .social__links-logo--messenger {\n background-image: url('data:image/svg+xml,%3C?xml%20version%3D%221.0%22%20?%3E%3Csvg%20width%3D%2230%22%20height%3D%2230%22%20viewBox%3D%220%200%2030%2030%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Crect%20width%3D%2230%22%20height%3D%2230%22%20rx%3D%2215%22%20fill%3D%22%23007FFF%22/%3E%3Crect%20x%3D%224.28564%22%20y%3D%226%22%20width%3D%2221.4286%22%20height%3D%2218.8571%22%20fill%3D%22white%22/%3E%3Cpath%20d%3D%22M14.9478%2014.5713C14.8228%2014.5917%2014.6974%2014.6104%2014.5715%2014.6276C14.6974%2014.6104%2014.8228%2014.5917%2014.9478%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.7507%2014.5713C14.691%2014.5823%2014.6313%2014.5923%2014.5715%2014.6026C14.6313%2014.5923%2014.691%2014.5823%2014.7507%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M15.0126%2014.5713C14.8663%2014.5878%2014.7192%2014.6024%2014.5715%2014.6148C14.7192%2014.6024%2014.8663%2014.5878%2015.0126%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.783%2014.5713C14.7128%2014.5807%2014.642%2014.5894%2014.5715%2014.5976C14.642%2014.5894%2014.7128%2014.5807%2014.783%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.7299%2014.5713C14.6773%2014.5825%2014.6244%2014.5937%2014.5715%2014.6045C14.6244%2014.5937%2014.6773%2014.5825%2014.7299%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.6992%2014.5713C14.6567%2014.5834%2014.6141%2014.5949%2014.5715%2014.6068C14.6141%2014.5949%2014.6567%2014.5834%2014.6992%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.7107%2014.5713C14.6645%2014.5834%2014.618%2014.5958%2014.5715%2014.6075C14.618%2014.5958%2014.6645%2014.5836%2014.7107%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.7194%2014.5713C14.6704%2014.5827%2014.621%2014.5935%2014.5715%2014.6045C14.621%2014.5935%2014.6704%2014.5827%2014.7194%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.8087%2014.5713C14.7297%2014.5779%2014.6507%2014.5839%2014.5715%2014.5891C14.6507%2014.5839%2014.7297%2014.5779%2014.8087%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M15.0417%2014.5713C14.8856%2014.5814%2014.7288%2014.5894%2014.5715%2014.5946C14.7288%2014.5894%2014.8856%2014.5814%2015.0417%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.8206%2014.5713C14.7377%2014.574%2014.6546%2014.5761%2014.5715%2014.5775C14.6546%2014.5761%2014.7377%2014.574%2014.8206%2014.5713Z%22%20fill%3D%22black%22/%3E%3Cpath%20d%3D%22M14.1547%2012.3174L9.29419%2017.4636L13.7176%2015.0365L16.0288%2017.4636L20.8621%2012.3174L16.4877%2014.7019L14.1547%2012.3174Z%22%20fill%3D%22%23448AFF%22/%3E%3Cpath%20d%3D%22M15%200C6.717%200%200%206.717%200%2015C0%2023.283%206.717%2030%2015%2030C23.283%2030%2030%2023.283%2030%2015C30%206.717%2023.283%200%2015%200ZM15.1172%2023.0294C14.1886%2023.0294%2013.2923%2022.8983%2012.4491%2022.6554L9.42421%2024.375V21.14C7.39815%2019.5982%206.10428%2017.2501%206.10428%2014.6203C6.10428%209.97581%2010.1395%206.21094%2015.1172%206.21094C20.0951%206.21094%2024.1301%209.97581%2024.1301%2014.6203C24.1301%2019.2643%2020.0951%2023.0294%2015.1172%2023.0294V23.0294Z%22%20fill%3D%22%23007FFF%22/%3E%3C/svg%3E') !important;\n}\n#sbz92 .social__links-logo--email {\n background-image: url('data:image/svg+xml,%3C?xml%20version%3D%221.0%22%20?%3E%3Csvg%20width%3D%2230%22%20height%3D%2230%22%20viewBox%3D%220%200%2030%2030%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M22.6875%2012.9688C21.9375%2013.5625%2020.3125%2014.75%2017.875%2016.5L17.5625%2016.75C17.0625%2017.125%2016.6875%2017.4062%2016.375%2017.5625C15.875%2017.875%2015.4062%2018%2015%2018C14.5625%2018%2014.125%2017.875%2013.625%2017.5938C13.3125%2017.4375%2012.9375%2017.1562%2012.4375%2016.7812L12.125%2016.5C9.59375%2014.6875%208%2013.5%207.3125%2012.9688C7.25%2012.9375%207.15625%2012.9375%207.09375%2012.9688C7.03125%2013%207%2013.0625%207%2013.125V19.5C7%2019.9375%207.125%2020.2812%207.4375%2020.5625C7.71875%2020.875%208.0625%2021%208.5%2021H21.5C21.9062%2021%2022.25%2020.875%2022.5625%2020.5625C22.8438%2020.2812%2023%2019.9375%2023%2019.5V13.125C23%2013.0625%2022.9375%2013%2022.875%2012.9375C22.8125%2012.9062%2022.75%2012.9062%2022.6875%2012.9688ZM15%2017C14.7188%2017%2014.375%2016.875%2014%2016.625C13.75%2016.5%2013.4375%2016.2812%2013.0312%2015.9375L12.7188%2015.7188C10.1562%2013.8438%208.40625%2012.5625%207.5%2011.8438L7.28125%2011.6875C7.09375%2011.5625%207%2011.3438%207%2011.0938V10.5C7%2010.0938%207.125%209.75%207.4375%209.4375C7.71875%209.15625%208.0625%209%208.5%209H21.5C21.9062%209%2022.25%209.15625%2022.5625%209.4375C22.8438%209.75%2023%2010.0938%2023%2010.5V11.0938C23%2011.3438%2022.9062%2011.5625%2022.7188%2011.6875L22.5625%2011.8125C21.6562%2012.5312%2019.9062%2013.8438%2017.2812%2015.7188L16.9688%2015.9375C16.5312%2016.2812%2016.2188%2016.5%2016%2016.625C15.5938%2016.875%2015.25%2017%2015%2017Z%22%20fill%3D%22white%22/%3E%3C/svg%3E') !important;\n}\n#sbz92 .social__links-logo--zalo {\n background-image: url('data:image/svg+xml,%3C?xml%20version%3D%221.0%22%20?%3E%3Csvg%20width%3D%2230%22%20height%3D%2230%22%20viewBox%3D%220%200%2030%2030%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M29.9999%2014.9385C29.9669%206.68262%2023.2639%200%2015%200C6.7157%200%200%206.71582%200%2015C0%2023.2842%206.7157%2030%2015%2030C23.2639%2030%2029.9669%2023.3174%2029.9999%2015.0615C29.9999%2015.041%2030%2015.0205%2030%2015C30%2014.9795%2029.9999%2014.959%2029.9999%2014.9385Z%22%20fill%3D%22white%22/%3E%3Cpath%20d%3D%22M24.5612%2017.4695C22.9394%2017.4726%2021.6242%2016.1862%2021.6279%2014.6005C21.6316%2013.0345%2022.9474%2011.7445%2024.5473%2011.7383C26.1556%2011.732%2027.4826%2013.0349%2027.4786%2014.6162C27.4746%2016.1926%2026.1719%2017.4665%2024.5612%2017.4695ZM22.8416%2014.6183C22.8459%2015.5573%2023.6166%2016.3004%2024.5777%2016.2923C25.5165%2016.2845%2026.2699%2015.5301%2026.2673%2014.6005C26.2646%2013.6712%2025.51%2012.9317%2024.56%2012.9277C23.6012%2012.9237%2022.8373%2013.6751%2022.8416%2014.6183Z%22%20fill%3D%22%230068FE%22/%3E%3Cpath%20d%3D%22M19.5054%2010.0762H20.795V17.4217H19.9447C19.7021%2017.4217%2019.5054%2017.225%2019.5054%2016.9823V10.0762Z%22%20fill%3D%22%230068FE%22/%3E%3Cpath%20d%3D%22M18.5227%2011.8907H17.2881V12.2935C16.5767%2011.8601%2015.8509%2011.6775%2015.06%2011.831C14.2526%2011.9876%2013.6164%2012.4043%2013.167%2013.0917C12.4538%2014.1826%2012.5894%2015.5904%2013.4938%2016.5431C14.3504%2017.4454%2015.8628%2017.8178%2017.2815%2016.9247C17.2835%2016.934%2017.286%2016.9422%2017.2881%2016.9511V16.9826C17.2881%2017.2252%2017.4849%2017.422%2017.7275%2017.422H18.5227V11.8907V11.8907ZM15.5853%2016.2787C14.6636%2016.268%2013.8924%2015.5006%2013.8986%2014.6004C13.9048%2013.692%2014.6716%2012.9481%2015.602%2012.9479C16.5427%2012.9477%2017.2871%2013.6781%2017.2882%2014.6026C17.2893%2015.5333%2016.521%2016.2896%2015.5853%2016.2787Z%22%20fill%3D%22%230068FE%22/%3E%3Cpath%20d%3D%22M8.0481%2016.2438C9.39854%2014.5856%2010.6939%2012.9885%2011.9984%2011.3989C12.2464%2011.0968%2012.3662%2010.7671%2012.3731%2010.3807C12.3761%2010.2135%2012.3261%2010.1646%2012.1596%2010.165C11.6056%2010.1666%206.41195%2010.165%206.41195%2010.165V11.4709H10.4978C10.4424%2011.543%207.83556%2014.7218%206.57932%2016.2403C6.37112%2016.4919%206.26503%2016.7645%206.25401%2017.0936C6.24628%2017.3242%206.28864%2017.4139%206.52267%2017.4211V17.4217H11.9356C12.1782%2017.4217%2012.3749%2017.225%2012.3749%2016.9823V16.2487V16.2438H8.0481V16.2438Z%22%20fill%3D%22%230068FE%22/%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.948%2026.1338C6.03613%2027.1172%207.26917%2027.9424%208.61108%2028.5752V26.1338H4.948ZM0.00268555%2014.7119C0.0775146%2010.7393%201.69666%207.14453%204.28479%204.50293C4.0459%204.98242%203.83435%205.47949%203.64661%205.99121C2.58862%208.87598%202.31299%2011.8506%202.69116%2014.8916C2.95862%2017.042%203.55518%2019.0869%204.63391%2020.9775C4.8269%2021.3154%205.02271%2021.6582%205.26489%2021.9609C5.76672%2022.5879%205.80981%2023.2725%205.59888%2024.0049C5.4873%2024.3926%205.32227%2024.75%205.11304%2025.082C4.95691%2025.3291%204.77612%2025.5635%204.57434%2025.7842C1.81921%2023.1201%200.0819092%2019.4102%200.00280762%2015.2939C0.000976562%2015.1963%200%2015.0986%200%2015C0%2014.9033%200.000854492%2014.8076%200.00268555%2014.7119Z%22%20fill%3D%22%230068FE%22/%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M24.8226%2026.3367C22.191%2028.6189%2018.7568%2029.9998%2015%2029.9998C11.1449%2029.9998%207.62952%2028.5457%204.97241%2026.156C6.32458%2026.1921%207.61877%2025.9031%208.86353%2025.3464C8.97681%2025.2957%209.06262%2025.3113%209.16443%2025.364C12.2258%2026.9646%2015.5131%2027.5125%2018.926%2027.3962C20.9574%2027.3269%2022.9333%2027.0046%2024.8226%2026.3367Z%22%20fill%3D%22%23015BDF%22/%3E%3C/svg%3E') !important;\n}\n@keyframes hide {\n 100% {\n opacity: 0;\n transform: scale(0);\n }\n}\n#sbz92 .widget-header-expand-container {\n width: 100% !important;\n}\n#sbz92 .message-input {\n width: 100% !important;\n border-top: 1px solid #e3e3e3 !important;\n display: flex !important;\n flex-direction: row !important;\n padding: 15px 22.5px !important;\n}\n#sbz92 .message-input--disabled {\n background: #f0f0f0 !important;\n opacity: 0.6 !important;\n filter: grayscale(1) !important;\n}\n#sbz92 textarea[disabled='disabled']::-webkit-input-placeholder {\n color: #a4a4a4 !important;\n -webkit-text-fill-color: #a4a4a4 !important;\n}\n#sbz92 textarea[disabled='disabled']:-ms-input-placeholder {\n color: #a4a4a4 !important;\n -webkit-text-fill-color: #a4a4a4 !important;\n}\n#sbz92 textarea[disabled='disabled']::placeholder {\n color: #a4a4a4 !important;\n -webkit-text-fill-color: #a4a4a4 !important;\n}\n#sbz92 .message-input--input {\n word-wrap: break-word !important;\n resize: none !important;\n flex: 1 !important;\n align-self: center !important;\n margin-right: 7.5px !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n}\n#sbz92 .message-input--input::placeholder {\n opacity: 0.5 !important;\n /* Firefox */\n}\n#sbz92 .message-input--input::-ms-input-placeholder {\n /* Edge 12 -18 */\n opacity: 0.5 !important;\n /* Firefox */\n}\n#sbz92 .message-input--emoji-button {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImdyYXkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLXNtaWxlIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCI+PC9jaXJjbGU+PHBhdGggZD0iTTggMTRzMS41IDIgNCAyIDQtMiA0LTIiPjwvcGF0aD48bGluZSB4MT0iOSIgeTE9IjkiIHgyPSI5LjAxIiB5Mj0iOSI+PC9saW5lPjxsaW5lIHgxPSIxNSIgeTE9IjkiIHgyPSIxNS4wMSIgeTI9IjkiPjwvbGluZT48L3N2Zz4K') !important;\n}\n#sbz92 .message-input--button {\n background-size: 70% !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n width: 32px !important;\n height: 32px !important;\n display: block !important;\n cursor: pointer !important;\n position: relative !important;\n border-radius: 20px !important;\n transition: background-color 0.2s !important;\n}\n#sbz92 .message-input--button:hover {\n background-color: #eeeeee !important;\n}\n#sbz92 .message-input--disabled .message-input--button {\n cursor: default !important;\n}\n#sbz92 .message-input--disabled .message-input--button {\n cursor: default !important;\n}\n#sbz92 .message-input--attachment-button {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImdyYXkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLXBhcGVyY2xpcCI+PHBhdGggZD0iTTIxLjQ0IDExLjA1bC05LjE5IDkuMTlhNiA2IDAgMCAxLTguNDktOC40OWw5LjE5LTkuMTlhNCA0IDAgMCAxIDUuNjYgNS42NmwtOS4yIDkuMTlhMiAyIDAgMCAxLTIuODMtMi44M2w4LjQ5LTguNDgiPjwvcGF0aD48L3N2Zz4K') !important;\n}\n#sbz92 .message-input--send-button {\n background-image: url('data:image/svg+xml,%3C?xml%20version%3D%221.0%22%20?%3E%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2225%22%20height%3D%2225%22%20viewBox%3D%220%200%2024%2024%22%20stroke-width%3D%221.5%22%20stroke%3D%22@esc-primary-color-esc%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20stroke%3D%22none%22%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3Cpath%20d%3D%22M4.698%204.034l16.302%207.966l-16.302%207.966a.503%20.503%200%200%201%20-.546%20-.124a.555%20.555%200%200%201%20-.12%20-.568l2.468%20-7.274l-2.468%20-7.274a.555%20.555%200%200%201%20.12%20-.568a.503%20.503%200%200%201%20.546%20-.124z%22%20fill%3D%22@esc-primary-color-esc%22/%3E%3Cpath%20d%3D%22M6.5%2012h14.5%22%20/%3E%3C/svg%3E') !important;\n background-size: 82% !important;\n}\n#sbz92 .message-input--preform {\n justify-content: center !important;\n padding: 11px !important;\n @spacer 2;\n}\n#sbz92 .btn--preform {\n border-radius: 7px !important;\n padding-left: 32px !important;\n padding-right: 32px !important;\n height: 40px !important;\n color: #fff !important;\n -webkit-text-fill-color: #fff !important;\n font-size: 14px !important;\n line-height: 20px !important;\n text-align: center !important;\n background: '@primary_color' !important;\n width: 60% !important;\n}\n#sbz92 .widget-body.embed-chat .message-input {\n border: 1px solid #e3e3e3 !important;\n border-radius: 8px !important;\n margin-bottom: 20px !important;\n}\n#sbz92 .form-label {\n margin-top: 15px !important;\n}\n#sbz92 .form {\n border: 1px solid #eeeeee !important;\n box-sizing: border-box !important;\n box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15) !important;\n border-radius: 7px !important;\n}\n#sbz92 textarea.form-control {\n resize: none !important;\n word-wrap: break-word !important;\n}\n#sbz92 .form-control--container {\n position: relative !important;\n}\n#sbz92 input.form-control[disabled] {\n background: #f9f9f9 !important;\n}\n#sbz92 .form-control--container .form-control--check {\n position: absolute !important;\n right: 10px !important;\n top: 10px !important;\n background-size: 100% 100% !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n width: 20px !important;\n height: 20px !important;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM1QkFBMUQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZWNrIj48cG9seWxpbmUgcG9pbnRzPSIyMCA2IDkgMTcgNCAxMiI+PC9wb2x5bGluZT48L3N2Zz4K') !important;\n}\n#sbz92 .form-control--valid-input--error {\n color: #dc3545 !important;\n -webkit-text-fill-color: #dc3545 !important;\n font-size: 14px !important;\n padding-top: 5px !important;\n}\n#sbz92 input[type='text'].form-control.input--error,\n#sbz92 input[type='tel'].form-control.input--error,\n#sbz92 input[type='email'].form-control.input--error,\n#sbz92 input[type='number'].form-control.input--error,\n#sbz92 input[type='date'].form-control.input--error,\n#sbz92 textarea.form-control.input--error,\n#sbz92 select.form-control.input--error {\n border: 1px solid #dc3545 !important;\n background: #dd41500f !important;\n}\n#sbz92 input[type='text'].form-control,\n#sbz92 input[type='tel'].form-control,\n#sbz92 input[type='email'].form-control,\n#sbz92 input[type='number'].form-control,\n#sbz92 input[type='date'].form-control,\n#sbz92 textarea.form-control,\n#sbz92 select.form-control {\n width: 100% !important;\n border: 1px solid #c4c4c4 !important;\n border-radius: 8px !important;\n transition: all 100ms ease !important;\n padding: 10px 12px !important;\n}\n#sbz92 input[type='text'].form-control:hover,\n#sbz92 input[type='tel'].form-control:hover,\n#sbz92 input[type='email'].form-control:hover,\n#sbz92 input[type='number'].form-control:hover,\n#sbz92 input[type='date'].form-control:hover,\n#sbz92 textarea.form-control:hover,\n#sbz92 select.form-control:hover {\n border: 1px solid #6c757d !important;\n}\n#sbz92 input[type='text'].form-control.input--error:hover,\n#sbz92 input[type='tel'].form-control.input--error:hover,\n#sbz92 input[type='email'].form-control.input--error:hover,\n#sbz92 input[type='number'].form-control.input--error:hover,\n#sbz92 input[type='date'].form-control.input--error:hover,\n#sbz92 textarea.form-control.input--error:hover,\n#sbz92 select.form-control.input--error:hover {\n border: 1px solid #dc3545 !important;\n}\n#sbz92 select.form-control {\n padding: 1px 8px !important;\n}\n#sbz92 input[type='date'].form-control {\n height: 40px !important;\n width: 100% !important;\n background-color: #fff !important;\n}\n#sbz92 .form-wrapper-attachment input[type='date'].form-control {\n height: 32px !important;\n padding-top: 6px !important;\n padding-bottom: 6px !important;\n}\n#sbz92 input[type='text'].form-control:focus,\n#sbz92 input[type='tel'].form-control:focus,\n#sbz92 input[type='email'].form-control:focus,\n#sbz92 input[type='number'].form-control:focus,\n#sbz92 input[type='date'].form-control:focus,\n#sbz92 textarea.form-control:focus,\n#sbz92 select.form-control:focus {\n border: 1px solid '@primary_color' !important;\n}\n#sbz92 input[type='text'].form-control.input--error:focus,\n#sbz92 input[type='tel'].form-control.input--error:focus,\n#sbz92 input[type='email'].form-control.input--error:focus,\n#sbz92 input[type='number'].form-control.input--error:focus,\n#sbz92 input[type='date'].form-control.input--error:focus,\n#sbz92 textarea.form-control.input--error:focus,\n#sbz92 select.form-control.input--error:focus {\n border: 1px solid #dc3545 !important;\n}\n#sbz92 .label {\n display: block !important;\n padding-bottom: 6px !important;\n margin-top: 8px !important;\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n font-size: 14px !important;\n font-weight: 500 !important;\n}\n#sbz92 .form--btn-submit {\n border-radius: 7px !important;\n padding-left: 32px !important;\n padding-right: 32px !important;\n width: 100% !important;\n}\n#sbz92 .form .radio {\n display: block !important;\n position: relative !important;\n width: 100% !important;\n margin-top: 5px !important;\n}\n#sbz92 .form .radio:first-of-type {\n margin-top: 0 !important;\n}\n#sbz92 .form input[type='radio'] {\n position: absolute !important;\n visibility: hidden !important;\n}\n#sbz92 .form .radio--label {\n padding-left: 22px !important;\n display: block !important;\n position: relative !important;\n z-index: 9 !important;\n cursor: pointer !important;\n}\n#sbz92 .form .radio--check {\n display: block !important;\n position: absolute !important;\n border: 1px solid #aaa !important;\n border-radius: 100% !important;\n height: 16px !important;\n width: 16px !important;\n top: 0px !important;\n left: 0px !important;\n z-index: 5 !important;\n transition: border 0.15s linear !important;\n -webkit-transition: border 0.15s linear !important;\n}\n#sbz92 .form .radio--check:hover {\n border: 1px solid #888 !important;\n}\n#sbz92 .form .radio--check::before {\n display: block !important;\n position: absolute !important;\n content: '' !important;\n border-radius: 100% !important;\n height: 10px !important;\n width: 10px !important;\n top: 2px !important;\n left: 2px !important;\n margin: auto !important;\n transition: background 0.15s linear !important;\n -webkit-transition: background 0.15s linear !important;\n}\n#sbz92 .form input[type='radio']:checked ~ .radio--check {\n border: 1px solid '@primary_color' !important;\n}\n#sbz92 .form input[type='radio']:checked ~ .radio--check::before {\n background: '@primary_color' !important;\n}\n#sbz92 .form .checkbox {\n display: block !important;\n position: relative !important;\n width: 100% !important;\n margin-top: 5px !important;\n}\n#sbz92 .form .checkbox:first-of-type {\n margin-top: 0 !important;\n}\n#sbz92 .form input[type='checkbox'] {\n position: absolute !important;\n visibility: hidden !important;\n}\n#sbz92 .form .checkbox--label {\n padding-left: 22px !important;\n display: block !important;\n position: relative !important;\n z-index: 9 !important;\n cursor: pointer !important;\n}\n#sbz92 .form .checkbox--check {\n display: block !important;\n position: absolute !important;\n border: 1px solid #aaa !important;\n border-radius: 4 px !important;\n height: 16px !important;\n width: 16px !important;\n top: 0px !important;\n left: 0px !important;\n z-index: 5 !important;\n transition: border 0.15s linear !important;\n -webkit-transition: border 0.15s linear !important;\n}\n#sbz92 .form .checkbox--check:hover {\n border: 1px solid #888 !important;\n}\n#sbz92 .form .checkbox--check::before {\n display: block !important;\n position: absolute !important;\n content: '' !important;\n height: 100% !important;\n width: 100% !important;\n margin: auto !important;\n transition: background 0.15s linear !important;\n -webkit-transition: background 0.15s linear !important;\n}\n#sbz92 .form input[type='checkbox']:checked ~ .checkbox--check {\n border: 1px solid '@primary_color' !important;\n}\n#sbz92 .form input[type='checkbox']:checked ~ .checkbox--check::before {\n background: '@primary_color' !important;\n}\n#sbz92 .form .select .form-control {\n padding-right: 20px !important;\n}\n#sbz92 .form select {\n /*background: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00LjQxMDU4IDYuOTExMDdDNC43MzYwMiA2LjU4NTYzIDUuMjYzNjYgNi41ODU2MyA1LjU4OTA5IDYuOTExMDdMOS45OTk4NCAxMS4zMjE4TDE0LjQxMDYgNi45MTEwN0MxNC43MzYgNi41ODU2MyAxNS4yNjM3IDYuNTg1NjMgMTUuNTg5MSA2LjkxMTA3QzE1LjkxNDUgNy4yMzY1MSAxNS45MTQ1IDcuNzY0MTQgMTUuNTg5MSA4LjA4OTU4TDEwLjU4OTEgMTMuMDg5NkMxMC4yNjM3IDEzLjQxNSA5LjczNjAyIDEzLjQxNSA5LjQxMDU4IDEzLjA4OTZMNC40MTA1OCA4LjA4OTU4QzQuMDg1MTQgNy43NjQxNCA0LjA4NTE0IDcuMjM2NTEgNC40MTA1OCA2LjkxMTA3WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+\") no-repeat right;*/\n}\n#sbz92 .form-require-info--list {\n background: #fff !important;\n overflow-y: auto !important;\n overflow-x: hidden !important;\n}\n#sbz92 .form-require-info--title {\n font-size: 18px !important;\n line-height: 20px !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n background: #fff !important;\n border-bottom: 1px solid #f0f0f0 !important;\n}\n#sbz92 .form-require-info--item {\n border-bottom: 1px solid #f0f0f0 !important;\n}\n#sbz92 .form-require-info--item:hover {\n cursor: pointer !important;\n background: #e0e0e0 !important;\n}\n#sbz92 input[type='checkbox'] {\n background-color: initial !important;\n cursor: default !important;\n -webkit-appearance: checkbox !important;\n box-sizing: border-box !important;\n margin: 3px 3px 3px 4px !important;\n padding: initial !important;\n border: initial !important;\n}\n#sbz92 input[type='radio'] {\n background-color: initial !important;\n cursor: default !important;\n -webkit-appearance: radio !important;\n box-sizing: border-box !important;\n margin: 3px 3px 0px 5px !important;\n padding: initial !important;\n border: initial !important;\n}\n#sbz92 option {\n font-weight: normal !important;\n display: block !important;\n white-space: pre !important;\n min-height: 1.2em !important;\n padding: 0px 2px 1px !important;\n}\n#sbz92 select {\n -webkit-writing-mode: horizontal-tb !important;\n text-rendering: auto !important;\n color: -internal-light-dark-color(black, white) !important;\n letter-spacing: normal !important;\n word-spacing: normal !important;\n text-transform: none !important;\n text-indent: 0px !important;\n text-shadow: none !important;\n display: inline-block !important;\n text-align: start !important;\n -webkit-appearance: menulist !important;\n box-sizing: border-box !important;\n align-items: center !important;\n white-space: pre !important;\n -webkit-rtl-ordering: logical !important;\n background-color: -internal-light-dark-color(white, black) !important;\n cursor: default !important;\n margin: 0em !important;\n font: 400 13.3333px Arial !important;\n border-radius: 0px !important;\n border-width: 1px !important;\n border-style: solid !important;\n border-color: #a9a9a9 !important;\n border-image: initial !important;\n}\n#sbz92 select {\n position: relative !important;\n display: inline-block !important;\n border: 2px #cccc solid !important;\n border-radius: 5px !important;\n height: 36px !important;\n line-height: 34px !important;\n padding: 0 12px !important;\n font-size: 14px !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n}\n#sbz92 .custom-select--wrap-selected {\n display: flex !important;\n position: relative !important;\n justify-content: space-between !important;\n cursor: pointer !important;\n border: 1px solid #d8d8d8 !important;\n border-radius: 5px !important;\n padding: 5px !important;\n}\n#sbz92 .custom-select--selected-items {\n display: flex !important;\n align-items: center !important;\n flex-wrap: wrap !important;\n}\n#sbz92 .custom-select--selected-item {\n display: flex !important;\n align-items: center !important;\n margin: 3px 3px !important;\n padding: 1px 6px !important;\n border-radius: 5px !important;\n border: 1px solid #d8d8d8 !important;\n font-size: 14px !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n vertical-align: top !important;\n}\n#sbz92 .icn-delete:before {\n display: flex !important;\n justify-items: center !important;\n font-size: 12px !important;\n margin-left: 5px !important;\n opacity: 0.5 !important;\n content: '\\2715' !important;\n}\n#sbz92 .custom-select--wrap-options {\n display: flex !important;\n flex-direction: column !important;\n position: absolute !important;\n left: 0 !important;\n top: 100% !important;\n border: 1px solid #dadce0 !important;\n -webkit-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;\n border-radius: 5px !important;\n width: 100% !important;\n background: #fff !important;\n z-index: 11 !important;\n max-height: 200px !important;\n overflow-y: auto !important;\n}\n#sbz92 .custom-select--input-search {\n font-size: 15px !important;\n padding: 8px !important;\n border-bottom: 1px solid #d8d8d8 !important;\n}\n#sbz92 .custom-select--items-options {\n margin: 0 !important;\n display: flex !important;\n flex-direction: column !important;\n}\n#sbz92 .custom-select--item-options {\n padding: 10px !important;\n cursor: pointer !important;\n}\n#sbz92 .custom-select--item-options:hover {\n background-color: '@primary_color' !important;\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n}\n#sbz92 .custom-select--icon-dropdown {\n margin-left: auto !important;\n float: right !important;\n cursor: pointer !important;\n}\n#sbz92 .custom-select--icon-dropdown path {\n d: path('M 7 9.5 L 12 14.5 L 17 9.5 H 7 Z') !important;\n fill: black !important;\n}\n#sbz92 .form-component {\n margin-bottom: 15px !important;\n}\n#sbz92 .form-component:last-child {\n margin-bottom: 0 !important;\n}\n#sbz92 .form-component.submitted {\n margin-bottom: 8px !important;\n}\n#sbz92 .form-component.form-component-submit-button {\n margin-top: 20px !important;\n}\n#sbz92 .form-wrapper.form {\n padding: 20px !important;\n background-color: #fff !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form {\n padding: 12px 15px !important;\n margin-top: 5px !important;\n box-shadow: 0 0 0 1px #eeeeee !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form input[type='text'].form-control,\n#sbz92 .form-wrapper.form-wrapper-attachment.form input[type='tel'].form-control,\n#sbz92 .form-wrapper.form-wrapper-attachment.form input[type='email'].form-control,\n#sbz92 .form-wrapper.form-wrapper-attachment.form input[type='number'].form-control,\n#sbz92 .form-wrapper.form-wrapper-attachment.form input[type='date'].form-control,\n#sbz92 .form-wrapper.form-wrapper-attachment.form select.form-control,\n#sbz92 .form-wrapper.form-wrapper-attachment.form textarea.form-control {\n padding: 6px 10px !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .form-component {\n margin-bottom: 12px !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .form-component:last-child {\n margin-bottom: 0 !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .form-component.submitted {\n margin-bottom: 5px !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .form-component.submitted:last-child {\n margin-bottom: 0 !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .form-component:first-child .label {\n margin-top: 0 !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .form-component.form-component-submit-button {\n margin-top: 16px !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .label {\n padding-bottom: 4px !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .form-control--valid-input--error {\n padding-top: 3px !important;\n}\n#sbz92 .form-wrapper.form-wrapper-attachment.form .btn--start-convo {\n height: 36px !important;\n}\n#sbz92 select.form-control.form-control--empty {\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n}\n@media only screen and (min-width: 968px) {\n #sbz92 .form-radios-wrapper.horizontal {\n display: flex;\n flex-wrap: wrap;\n }\n #sbz92 .form-radios-wrapper.horizontal .radio {\n margin-right: 10px;\n width: 300px;\n }\n #sbz92 .form-radios-wrapper.horizontal .radio:first-child {\n margin-top: 0;\n }\n #sbz92 .form-radios-wrapper.horizontal .radio:nth-child(2) {\n margin-top: 0;\n }\n #sbz92 .form-radios-wrapper.horizontal .radio:nth-child(2n) {\n margin-right: 0;\n }\n #sbz92 .form-checkboxes-wrapper.horizontal {\n display: flex;\n flex-wrap: wrap;\n }\n #sbz92 .form-checkboxes-wrapper.horizontal .checkbox {\n margin-right: 10px;\n width: 300px;\n }\n #sbz92 .form-checkboxes-wrapper.horizontal .checkbox:first-child {\n margin-top: 0;\n }\n #sbz92 .form-checkboxes-wrapper.horizontal .checkbox:nth-child(2) {\n margin-top: 0;\n }\n #sbz92 .form-checkboxes-wrapper.horizontal .checkbox:nth-child(2n) {\n margin-right: 0;\n }\n}\n#sbz92 .form-ratings-wrapper {\n display: inline-flex !important;\n}\n#sbz92 .star {\n width: 32px !important;\n height: 30px !important;\n background-image: url("+nt+") !important;\n background-position: 0px 0px !important;\n background-size: cover !important;\n}\n#sbz92 .form-wrapper-attachment .star-wrapper {\n padding-right: 12px !important;\n}\n#sbz92 .star-wrapper {\n cursor: pointer !important;\n padding-right: 20px !important;\n}\n#sbz92 .star-wrapper:last-child {\n padding-right: 0 !important;\n}\n#sbz92 .star-wrapper.hovering .star {\n background-position: -32px 0 !important;\n}\n#sbz92 .star-wrapper.selected {\n cursor: auto !important;\n}\n#sbz92 .star-wrapper.selected .star {\n background-position: -64px 0 !important;\n}\n#sbz92 .conversation-history-error {\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n margin: 8px 0 16px !important;\n padding: 8px 10px !important;\n border-radius: 10px !important;\n background: #f5f6f8 !important;\n color: #737782 !important;\n font-size: 12px !important;\n line-height: 18px !important;\n text-align: left !important;\n}\n#sbz92 .conversation-history-error__text {\n flex: 1 !important;\n min-width: 0 !important;\n}\n#sbz92 .conversation-history-error__retry {\n position: relative !important;\n flex-shrink: 0 !important;\n border: 0 !important;\n border-radius: 6px !important;\n padding: 5px 8px !important;\n background: transparent !important;\n color: #545866 !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 18px !important;\n cursor: pointer !important;\n}\n#sbz92 .conversation-history-error__retry:hover:not(:disabled) {\n background: #e8eaf0 !important;\n}\n#sbz92 .conversation-history-error__retry:disabled {\n cursor: wait !important;\n}\n#sbz92 .conversation-history-error__retry:focus-visible {\n outline: 2px solid #737782 !important;\n outline-offset: 2px !important;\n}\n#sbz92 .conversation-history-error__spinner {\n position: absolute !important;\n inset: 0 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n}\n#sbz92 .widget-body--events-container {\n overflow-x: hidden !important;\n overflow-y: auto !important;\n display: flex !important;\n flex-direction: column !important;\n flex: 1 !important;\n padding-left: 22.5px !important;\n padding-right: 22.5px !important;\n}\n#sbz92 .widget-body--events {\n padding-top: 20px !important;\n flex: 1 !important;\n}\n#sbz92 .mobile .widget-body--events {\n display: flex !important;\n flex-direction: column !important;\n justify-content: flex-end !important;\n padding-bottom: 15px !important;\n}\n#sbz92 .widget-body--events-container.widget-body--events-container__error {\n align-items: center !important;\n justify-content: center !important;\n}\n#sbz92 .convo-event {\n position: relative !important;\n}\n#sbz92 .convo-event-time {\n text-align: center !important;\n margin-top: 15px !important;\n}\n#sbz92 .convo-event-time span {\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n}\n#sbz92 .file-attachment {\n padding: 10px !important;\n border-radius: 10px !important;\n cursor: pointer !important;\n margin: 5px 0 0 0 !important;\n}\n#sbz92 .file-attachment--agent {\n background-color: '@primary_color' !important;\n width: fit-content !important;\n}\n#sbz92 .file-attachment--user {\n background-color: #eeeeee !important;\n align-self: flex-end !important;\n}\n#sbz92 .file-attachment--link {\n display: flex !important;\n flex-direction: row !important;\n align-items: center !important;\n width: fit-content !important;\n}\n#sbz92 .file-attachment--agent .file-attachment--filename {\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n text-decoration: underline !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n max-width: 200px !important;\n}\n#sbz92 .file-attachment--user .file-attachment--filename {\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n text-decoration: underline !important;\n text-overflow: ellipsis !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n max-width: 200px !important;\n}\n#sbz92 .file-attachment--download {\n width: 24px !important;\n height: 24px !important;\n border-radius: 30px !important;\n display: inline-block !important;\n}\n#sbz92 .file-attachment--agent .file-attachment--download {\n background: '@text_color' !important;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMjY1RkYiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWFycm93LWRvd24iPjxsaW5lIHgxPSIxMiIgeTE9IjUiIHgyPSIxMiIgeTI9IjE5Ij48L2xpbmU+PHBvbHlsaW5lIHBvaW50cz0iMTkgMTIgMTIgMTkgNSAxMiI+PC9wb2x5bGluZT48L3N2Zz4K') !important;\n background-size: 15px 15px !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n}\n#sbz92 .file-attachment--user .file-attachment--download {\n background: #c4c4c4 !important;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgY2xhc3M9ImZlYXRoZXIgZmVhdGhlci1hcnJvdy1kb3duIj48bGluZSB4MT0iMTIiIHkxPSI1IiB4Mj0iMTIiIHkyPSIxOSI+PC9saW5lPjxwb2x5bGluZSBwb2ludHM9IjE5IDEyIDEyIDE5IDUgMTIiPjwvcG9seWxpbmU+PC9zdmc+Cg==') !important;\n background-size: 15px 15px !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n}\n#sbz92 .message-text--user {\n line-height: 1.5 !important;\n margin: 5px 0 0 !important;\n display: inline-block !important;\n font-weight: 500 !important;\n background-color: '@primary_color' !important;\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n padding: 12px 16px 12px 16px !important;\n}\n#sbz92 .message-text--user.just-focused {\n box-shadow: 0 0 0 2px #000 !important;\n}\n#sbz92 .message-text--agent.just-focused {\n box-shadow: 0 0 0 2px #000 !important;\n}\n#sbz92 .message-text--user.message-user--error {\n background-color: #dc3545 !important;\n}\n#sbz92 .message-text--deleted {\n opacity: 0.7 !important;\n font-style: italic !important;\n}\n#sbz92 .message-text--agent {\n line-height: 1.5 !important;\n white-space: pre-wrap !important;\n display: inline-block !important;\n background: '@primary_color_faded' !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n padding: 12px 16px 12px 16px !important;\n}\n#sbz92 .message-agent.message-text--agent {\n max-width: 100% !important;\n margin-top: 0 !important;\n}\n#sbz92 .message-block-pre {\n display: block !important;\n min-width: 0 !important;\n max-width: 100% !important;\n margin: 4px 0 !important;\n padding: 10px 12px !important;\n border: 1px solid rgba(0, 0, 0, 0.06) !important;\n border-radius: 8px !important;\n background: rgba(0, 0, 0, 0.03) !important;\n white-space: pre-wrap !important;\n overflow-wrap: anywhere !important;\n word-break: normal !important;\n}\n#sbz92 .message-block-code,\n#sbz92 .message-block-code * {\n font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;\n font-size: 13px !important;\n line-height: 20px !important;\n}\n#sbz92 .message-block-pre .message-block-code {\n display: block !important;\n}\n#sbz92 .message-user__container {\n display: flex !important;\n flex-direction: row !important;\n align-items: flex-end !important;\n justify-content: flex-end !important;\n}\n#sbz92 .sending_dot.sending_dot__hide {\n opacity: 0 !important;\n background-color: #000 !important;\n}\n#sbz92 .sending_dot {\n width: 15px !important;\n height: 15px !important;\n margin-right: 5px !important;\n border-radius: 50% !important;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiM3NzciIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNsb2NrIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCI+PC9jaXJjbGU+PHBvbHlsaW5lIHBvaW50cz0iMTIgNiAxMiAxMiAxNiAxNCI+PC9wb2x5bGluZT48L3N2Zz4K') !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n}\n#sbz92 .message-user {\n border-radius: 18px !important;\n border-bottom-right-radius: 4px !important;\n max-width: 85% !important;\n align-self: flex-end !important;\n word-break: break-word !important;\n position: relative !important;\n white-space: pre-wrap !important;\n}\n#sbz92 .message-user.message-user-images-container {\n width: 85% !important;\n display: flex !important;\n justify-content: flex-end !important;\n}\n#sbz92 .message-user.message-user-audio {\n flex: 1 !important;\n}\n#sbz92 .message-agent {\n border-radius: 18px !important;\n border-bottom-left-radius: 4px !important;\n max-width: 85% !important;\n word-break: break-word !important;\n position: relative !important;\n}\n#sbz92 a.message_error {\n color: #dc3545 !important;\n -webkit-text-fill-color: #dc3545 !important;\n opacity: 0.8 !important;\n display: block !important;\n text-align: end !important;\n font-size: 13px !important;\n margin-top: 5px !important;\n margin-bottom: 10px !important;\n}\n#sbz92 a.message_error:hover {\n opacity: 1 !important;\n color: #dc3545 !important;\n -webkit-text-fill-color: #dc3545 !important;\n}\n#sbz92 .message_error__text {\n display: inline-block !important;\n vertical-align: text-top !important;\n}\n#sbz92 .message_error__icon {\n display: inline-block !important;\n vertical-align: bottom !important;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSIjZGMzNTQ1IiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWFsZXJ0LWNpcmNsZSI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiPjwvY2lyY2xlPjxsaW5lIHgxPSIxMiIgeTE9IjgiIHgyPSIxMiIgeTI9IjEyIj48L2xpbmU+PGxpbmUgeDE9IjEyIiB5MT0iMTYiIHgyPSIxMi4wMSIgeTI9IjE2Ij48L2xpbmU+PC9zdmc+Cgo=') !important;\n background-size: contain !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n width: 20px !important;\n height: 20px !important;\n}\n#sbz92 .image-attachment__img {\n width: 100% !important;\n margin: 5px 0 0 0 !important;\n border-radius: 7px !important;\n border: 1px solid #eeeeee !important;\n}\n#sbz92 .audio-attachment {\n width: 100% !important;\n margin: 5px 0 0 0 !important;\n height: 45px !important;\n display: inline !important;\n}\n#sbz92 .audio-attachment__audio {\n all: inherit !important;\n width: 100% !important;\n}\n#sbz92 .video-attachment {\n border-radius: 7px !important;\n width: 100% !important;\n margin: 5px 0 0 0 !important;\n}\n#sbz92 .video-attachment__video {\n all: inherit !important;\n width: 100% !important;\n}\n#sbz92 .info-message {\n text-align: center !important;\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n margin: 10px !important;\n}\n#sbz92 .info-message--ended {\n padding-top: 16px !important;\n}\n#sbz92 .conversation-event {\n display: block !important;\n min-width: 0 !important;\n border: 0 !important;\n padding: 0 !important;\n margin: 0 !important;\n}\n#sbz92 .conversation-history-start {\n display: block !important;\n height: 1px !important;\n flex-shrink: 0 !important;\n}\n#sbz92 .message-user__container--send {\n transition: transform 260ms cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;\n transform: translate3d(0, 0, 0) !important;\n}\n#sbz92 .message-user__container--send.message-user__container--enter {\n transform: translate3d(0, 14px, 0) !important;\n}\n@media (prefers-reduced-motion: reduce) {\n #sbz92 .message-user__container--send {\n transition: none !important;\n }\n #sbz92 .message-user__container--send.message-user__container--enter {\n transform: none !important;\n }\n}\n#sbz92 .conversation-event--history {\n filter: grayscale(0.8) !important;\n}\n#sbz92 .conversation-event--history + .conversation-event:not(.conversation-event--history)::before {\n content: '' !important;\n display: block !important;\n border-top: 2px solid '@primary_color_faded' !important;\n margin: 60px 40px !important;\n}\n#sbz92 .message-sender {\n margin-top: 10px !important;\n}\n#sbz92 .message-sender-avatar {\n border-radius: 50% !important;\n width: 25px !important;\n height: 25px !important;\n margin-right: 10px !important;\n}\n#sbz92 .message-sender-name {\n color: #495057 !important;\n -webkit-text-fill-color: #495057 !important;\n vertical-align: middle !important;\n}\n#sbz92 .message-system {\n text-align: center !important;\n margin: 10px !important;\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n}\n#sbz92 .form-attachment {\n display: flex !important;\n flex-direction: column !important;\n padding: 10px !important;\n -webkit-box-shadow: 0 0 10px #dee2e6 !important;\n box-shadow: 0 0 10px #dee2e6 !important;\n border-radius: 7px !important;\n margin-top: 10px !important;\n}\n#sbz92 .form-attachment-field {\n display: flex !important;\n flex-direction: column !important;\n margin-bottom: 0px !important;\n}\n#sbz92 .form-attachment-field__title {\n color: #4c4c4c !important;\n -webkit-text-fill-color: #4c4c4c !important;\n}\n#sbz92 .form-attachment-field__text {\n width: 100% !important;\n border: 1px solid #dbdbdb !important;\n padding: 10px !important;\n margin: 3px 0px 0px 0px !important;\n border-radius: 7px !important;\n}\n#sbz92 .input--error {\n border: 1px solid red !important;\n}\n#sbz92 .input--success {\n background-color: #f9f9f9 !important;\n pointer-events: none !important;\n}\n#sbz92 .form-attachment-field__error {\n color: brown !important;\n -webkit-text-fill-color: brown !important;\n float: right !important;\n}\n#sbz92 .form-attachment-field__checkbox {\n width: 100% !important;\n all: inherit !important;\n -webkit-appearance: textfield !important;\n margin-right: 8px !important;\n}\n#sbz92 .form-attachment-field__checkbox:hover {\n cursor: pointer !important;\n}\n#sbz92 .form-attachment-field__list-item {\n display: flex !important;\n align-items: center !important;\n margin: 4px !important;\n margin-left: 0px !important;\n}\n#sbz92 .form-attachment-field__radio {\n width: 100% !important;\n all: inherit !important;\n -webkit-appearance: textfield !important;\n margin-right: 8px !important;\n}\n#sbz92 .form-attachment-field__datetime {\n width: 100% !important;\n border: 1px solid #dbdbdb !important;\n padding: 10px !important;\n margin: 3px 0px 0px 0px !important;\n border-radius: 7px !important;\n}\n#sbz92 .form-attachment--submit-btn {\n background-color: '@primary_color' !important;\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n width: 100% !important;\n margin-top: 10px !important;\n border-radius: 7px !important;\n padding: 10px !important;\n text-align: center !important;\n font-size: 16px !important;\n}\n#sbz92 .form-attachment--submit-btn:hover {\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n}\n#sbz92 .red {\n color: #dc3545 !important;\n -webkit-text-fill-color: #dc3545 !important;\n}\n#sbz92 .typing {\n background-color: #f4f5f7 !important;\n color: #7a7a7b !important;\n -webkit-text-fill-color: #7a7a7b !important;\n padding: 10px !important;\n opacity: 1 !important;\n transition: all 0.2s !important;\n position: absolute !important;\n bottom: 0px !important;\n left: 0px !important;\n width: 100% !important;\n}\n#sbz92 .typing--hidden {\n opacity: 0 !important;\n display: none !important;\n}\n#sbz92 .markdown-message img {\n max-width: 100% !important;\n margin-top: 10px !important;\n}\n#sbz92 .button-attachments {\n display: block !important;\n margin-top: 5px !important;\n}\n#sbz92 .url-button-attachment:first-child {\n border-top-left-radius: 7px !important;\n border-top-right-radius: 7px !important;\n}\n#sbz92 .url-button-attachment:last-child {\n border-bottom-left-radius: 7px !important;\n border-bottom-right-radius: 7px !important;\n border-bottom: 1px solid '@primary_color' !important;\n}\n#sbz92 .agent-message .url-button-attachment {\n text-decoration: none !important;\n padding: 10px 18px !important;\n display: block !important;\n text-align: center !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n border: 1px solid #000 !important;\n border-radius: 12px !important;\n text-overflow: ellipsis !important;\n overflow: hidden !important;\n font-weight: 500 !important;\n white-space: nowrap !important;\n}\n#sbz92 .agent-message .url-button-attachment:hover {\n color: '@primary_color' !important;\n -webkit-text-fill-color: '@primary_color' !important;\n border-color: '@primary_color' !important;\n}\n#sbz92 .message_quick_replies {\n display: flex !important;\n flex-wrap: wrap !important;\n flex-direction: column !important;\n}\n#sbz92 .message_quick_reply {\n cursor: pointer !important;\n position: relative !important;\n padding: 10px 18px !important;\n margin-top: 8px !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n border-radius: 12px !important;\n user-select: none !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n width: fit-content !important;\n font-weight: 500 !important;\n max-width: 100% !important;\n text-overflow: ellipsis !important;\n border: 1px solid #000 !important;\n transition: all 100ms ease !important;\n}\n#sbz92 .message_quick_reply:hover {\n background: '@primary_color' !important;\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n border-color: '@primary_color' !important;\n}\n#sbz92 .generic-attachment-container {\n position: relative !important;\n margin-top: 10px !important;\n}\n#sbz92 .generic-attachments {\n display: block !important;\n}\n#sbz92 .generic-attachment {\n display: flex !important;\n width: 100% !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n user-select: none !important;\n cursor: grab !important;\n}\n#sbz92 .generic-attachment--element-content {\n flex: 1 !important;\n}\n#sbz92 .generic-attachment--element {\n border: 1px solid #d8d8d8 !important;\n background: white !important;\n border-radius: 7px !important;\n overflow: hidden !important;\n width: 220px !important;\n margin-right: 10px !important;\n vertical-align: top !important;\n display: flex !important;\n flex-direction: column !important;\n flex-shrink: 0 !important;\n}\n#sbz92 .generic-attachment--element:last-child {\n margin-right: 0 !important;\n}\n#sbz92 .generic-attachment--element .generic-attachment--element-img {\n width: 100% !important;\n height: 150px !important;\n object-fit: cover !important;\n}\n#sbz92 .generic-attachment--element .url-button-attachment {\n padding: 10px !important;\n display: block !important;\n padding-top: 9px !important;\n padding-bottom: 9px !important;\n text-align: center !important;\n border: none !important;\n border-top: 1px solid #d8d8d8 !important;\n border-radius: 0 !important;\n width: 100% !important;\n color: #0d6efd !important;\n -webkit-text-fill-color: #0d6efd !important;\n}\n#sbz92 .generic-attachment--element .url-button-attachment:hover {\n color: #024dbc !important;\n -webkit-text-fill-color: #024dbc !important;\n border-color: #d8d8d8 !important;\n}\n#sbz92 .generic-attachment--element .generic-attachment--element-title {\n padding: 0px 13px !important;\n margin-top: 13px !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n font-weight: 600 !important;\n font-size: 16px !important;\n line-height: 20px !important;\n white-space: normal !important;\n}\n#sbz92 .generic-attachment--element .generic-attachment--element-subtitle {\n padding: 0px 13px !important;\n color: gray !important;\n -webkit-text-fill-color: gray !important;\n margin-top: 5px !important;\n white-space: pre-wrap !important;\n display: -webkit-box !important;\n -webkit-line-clamp: 4 !important;\n -webkit-box-orient: vertical !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n}\n#sbz92 .generic-attachment--element.clickable {\n cursor: pointer !important;\n}\n#sbz92 .widget_body__events__error_msg {\n margin-top: 50px !important;\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n text-align: center !important;\n}\n#sbz92 .widget_body__events__error_retry {\n margin-top: 10px !important;\n}\n#sbz92 .generic-attachment-navigator {\n position: absolute !important;\n top: 50% !important;\n transform: translateY(-50%) !important;\n cursor: pointer !important;\n width: 20px !important;\n font-size: 80px !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n color: rgba(255, 255, 255, 0.85) !important;\n -webkit-text-fill-color: rgba(255, 255, 255, 0.85) !important;\n text-shadow: 0 10px 25px rgba(0, 0, 0, 0.75) !important;\n z-index: 999 !important;\n user-select: none !important;\n}\n#sbz92 .generic-attachment-navigator:hover {\n text-shadow: 0 10px 20px rgba(0, 0, 0, 0.75) !important;\n color: #ffffff !important;\n -webkit-text-fill-color: #ffffff !important;\n}\n#sbz92 .generic-attachment-navigator.generic-attachment-navigator--disabled {\n display: none !important;\n}\n#sbz92 .generic-attachment-navigator.generic-attachment-navigator--left {\n left: 2px !important;\n}\n#sbz92 .generic-attachment-navigator.generic-attachment-navigator--right {\n right: 2px !important;\n}\n#sbz92 .generic-attachment-navigator-icon {\n font-size: 80px !important;\n}\n#sbz92 .order_attachment__product_img {\n width: 40px !important;\n height: 40px !important;\n margin-right: 10px !important;\n border-radius: 5px !important;\n flex-shrink: 0 !important;\n display: block !important;\n object-fit: contain !important;\n background: whitesmoke !important;\n}\n#sbz92 .order_attachment__product_name {\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n color: black !important;\n -webkit-text-fill-color: black !important;\n}\n#sbz92 .order_attachment__header {\n padding-bottom: 5px !important;\n border-bottom: 1px solid #ccc !important;\n margin-bottom: 5px !important;\n display: flex !important;\n align-items: center !important;\n justify-content: space-between !important;\n}\n#sbz92 .order_attachment__product_desc {\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n color: #999 !important;\n -webkit-text-fill-color: #999 !important;\n font-size: 13px !important;\n}\n#sbz92 .order_attachment__product {\n display: flex !important;\n align-items: center !important;\n margin-top: 5px !important;\n margin-bottom: 5 !important;\n}\n#sbz92 .order_attachment__text_sm {\n font-size: 13px !important;\n}\n#sbz92 .order_attachment__text_muted {\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n}\n#sbz92 .order_attachment__text_truncate {\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n}\n#sbz92 .order_attachment {\n margin-top: 10px !important;\n color: black !important;\n -webkit-text-fill-color: black !important;\n border: 1px solid #aaa !important;\n background: white !important;\n border-radius: 8px !important;\n width: 220px !important;\n overflow-y: auto !important;\n overflow-x: hidden !important;\n padding: 10px !important;\n}\n#sbz92 .order_attachment__footer {\n margin-top: 10px !important;\n padding-top: 10px !important;\n border-top: 1px solid #ccc !important;\n}\n#sbz92 .order_attachment__total {\n font-size: 16px !important;\n}\n#sbz92 .order_attachment__label {\n font-size: 13px !important;\n color: #777 !important;\n -webkit-text-fill-color: #777 !important;\n margin-top: 10px !important;\n}\n#sbz92 .order_attachment__label.no_margin {\n margin-top: 0 !important;\n}\n#sbz92 .order_attachment.order_attachment__user {\n margin-right: 50px !important;\n align-self: flex-end !important;\n margin-right: 0 !important;\n margin-left: 50px !important;\n align-self: flex-start !important;\n}\n#sbz92 .product_attachment {\n margin-top: 10px !important;\n border: 1px solid #d8d8d8 !important;\n background: white !important;\n border-radius: 7px !important;\n overflow: hidden !important;\n width: 200px !important;\n display: inline-block !important;\n vertical-align: top !important;\n transition: all 0.1s !important;\n}\n#sbz92 .product_attachment.product_attachment__user {\n margin-right: 50px !important;\n align-self: flex-end !important;\n margin-right: 0 !important;\n margin-left: 50px !important;\n align-self: flex-start !important;\n}\n#sbz92 .product_attachment__img {\n width: 200px !important;\n height: 200px !important;\n border-bottom: 1px solid #d8d8d8 !important;\n object-fit: cover !important;\n display: block !important;\n}\n#sbz92 .product_attachment__price {\n padding-left: 10px !important;\n}\n#sbz92 .product_attachment__btns {\n margin-top: 5px !important;\n}\n#sbz92 .product_attachment__btn {\n border-top: 1px solid #d8d8d8 !important;\n display: flex !important;\n padding: 8px 10px !important;\n align-items: center !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n justify-content: center !important;\n cursor: pointer !important;\n text-transform: capitalize !important;\n}\n#sbz92 .product_attachment__btn:last-child {\n margin-right: 0 !important;\n}\n#sbz92 .product_attachment__btn:hover {\n color: '@primary_color' !important;\n -webkit-text-fill-color: '@primary_color' !important;\n}\n#sbz92 a.product_attachment__title {\n display: block !important;\n padding: 8px 10px 0 10px !important;\n font-weight: 500 !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n word-break: break-word !important;\n margin-bottom: 5px !important;\n}\n#sbz92 .product_attachment__subtitle {\n white-space: pre-wrap !important;\n display: -webkit-box !important;\n -webkit-line-clamp: 3 !important;\n -webkit-box-orient: vertical !important;\n overflow: hidden !important;\n padding: 5px 10px !important;\n color: #aaa !important;\n -webkit-text-fill-color: #aaa !important;\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n margin-bottom: 5px !important;\n}\n#sbz92 .product_attachment__btn_external_link {\n width: 16px !important;\n height: 16px !important;\n margin-left: 5px !important;\n margin-top: -2px !important;\n}\n#sbz92 .agent-convo-event-wrapper {\n max-width: 85% !important;\n margin-top: 5px !important;\n}\n#sbz92 .agent-convo-event-wrapper.full {\n max-width: 100% !important;\n}\n#sbz92 .agent-convo-event-inner {\n position: relative !important;\n display: inline-block !important;\n max-width: 100% !important;\n}\n#sbz92 .message-event-actions {\n position: absolute !important;\n bottom: -10px !important;\n opacity: 0.7 !important;\n left: calc(100% - 25px) !important;\n display: none !important;\n border: 1px solid #dee2e6 !important;\n background-color: white !important;\n border-radius: 4px !important;\n z-index: 10 !important;\n}\n#sbz92 .message-event-actions.ended {\n bottom: -10px !important;\n}\n#sbz92 .message-event-actions:hover {\n opacity: 1 !important;\n}\n#sbz92 .agent-convo-event-inner:hover .message-event-actions {\n display: flex !important;\n}\n#sbz92 .message-event-actions-static {\n display: none !important;\n margin-top: 2px !important;\n border: none !important;\n padding: 0 !important;\n gap: 4px !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-actions {\n display: none !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-actions-static {\n display: flex !important;\n position: absolute !important;\n bottom: -30px !important;\n left: 0 !important;\n z-index: 2 !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-action-btn {\n padding: 0 !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-action-btn .message-event-action-btn-svg {\n width: 24px !important;\n height: 24px !important;\n background-position: 2px 2px !important;\n background-size: 20px 20px !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-action-btn.message-event-action-btn__dev {\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n padding-right: 10px !important;\n border-radius: 5px !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-action-btn.message-event-action-btn__dev .message-event-action-btn-svg {\n width: 24px !important;\n height: 24px !important;\n background-position: 2px 2px !important;\n background-size: 20px 20px !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-action-btn.message-event-action-btn__dev:hover {\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-action-btn.message-event-action-btn__dev.message-event-action-btn_like.active {\n color: #34c759 !important;\n -webkit-text-fill-color: #34c759 !important;\n}\n#sbz92 .agent-convo-event-inner.last .message-event-action-btn.message-event-action-btn__dev.message-event-action-btn_like.active {\n color: #34c759 !important;\n -webkit-text-fill-color: #34c759 !important;\n}\n#sbz92 .message-event-action-btn.message-event-action-btn__dev:hover {\n background-color: unset !important;\n}\n#sbz92 .message-event-action-btn {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n cursor: pointer !important;\n padding: 2px !important;\n}\n#sbz92 .message-event-action-btn:hover {\n background-color: #ececec !important;\n}\n#sbz92 .message-event-action-btn.active:hover {\n background-color: #dbfde3 !important;\n}\n#sbz92 .message-event-action-btn.message-event-action-btn__dev {\n padding: 0px !important;\n}\n#sbz92 .message-event-action-btn.message-event-action-btn__dev:hover {\n background-color: unset !important;\n}\n#sbz92 .message-event-action-btn.message-event-action-btn__dev.active:hover {\n background-color: unset !important;\n}\n#sbz92 .message-event-action-btn .message-event-action-btn-svg {\n width: 20px !important;\n height: 20px !important;\n border-radius: 4px !important;\n background-position: 2px 2px !important;\n background-size: 16px 16px !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n}\n#sbz92 .message-event-action-btn-svg.like {\n background-image: url('data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjI0IiAgaGVpZ2h0PSIyNCIgIHZpZXdCb3g9IjAgMCAyNCAyNCIgIGZpbGw9Im5vbmUiICBzdHJva2U9IiM2Yzc1N2QiICBzdHJva2Utd2lkdGg9IjIiICBzdHJva2UtbGluZWNhcD0icm91bmQiICBzdHJva2UtbGluZWpvaW49InJvdW5kIiAgY2xhc3M9Imljb24gaWNvbi10YWJsZXIgaWNvbnMtdGFibGVyLW91dGxpbmUgaWNvbi10YWJsZXItdGh1bWItdXAiPjxwYXRoIHN0cm9rZT0ibm9uZSIgZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjxwYXRoIGQ9Ik03IDExdjhhMSAxIDAgMCAxIC0xIDFoLTJhMSAxIDAgMCAxIC0xIC0xdi03YTEgMSAwIDAgMSAxIC0xaDNhNCA0IDAgMCAwIDQgLTR2LTFhMiAyIDAgMCAxIDQgMHY1aDNhMiAyIDAgMCAxIDIgMmwtMSA1YTIgMyAwIDAgMSAtMiAyaC03YTMgMyAwIDAgMSAtMyAtMyIgLz48L3N2Zz4K') !important;\n}\n#sbz92 .message-event-action-btn-svg.dislike {\n background-image: url('data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjI0IiAgaGVpZ2h0PSIyNCIgIHZpZXdCb3g9IjAgMCAyNCAyNCIgIGZpbGw9Im5vbmUiICBzdHJva2U9IiM2Yzc1N2QiICBzdHJva2Utd2lkdGg9IjIiICBzdHJva2UtbGluZWNhcD0icm91bmQiICBzdHJva2UtbGluZWpvaW49InJvdW5kIiAgY2xhc3M9Imljb24gaWNvbi10YWJsZXIgaWNvbnMtdGFibGVyLW91dGxpbmUgaWNvbi10YWJsZXItdGh1bWItZG93biI+PHBhdGggc3Ryb2tlPSJub25lIiBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTcgMTN2LThhMSAxIDAgMCAwIC0xIC0xaC0yYTEgMSAwIDAgMCAtMSAxdjdhMSAxIDAgMCAwIDEgMWgzYTQgNCAwIDAgMSA0IDR2MWEyIDIgMCAwIDAgNCAwdi01aDNhMiAyIDAgMCAwIDIgLTJsLTEgLTVhMiAzIDAgMCAwIC0yIC0yaC03YTMgMyAwIDAgMCAtMyAzIiAvPjwvc3ZnPgo=') !important;\n}\n#sbz92 .message-event-action-btn-svg.info {\n background-image: url('data:image/svg+xml;base64,PHN2ZwogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB3aWR0aD0iMjQiCiAgaGVpZ2h0PSIyNCIKICB2aWV3Qm94PSIwIDAgMjQgMjQiCiAgZmlsbD0ibm9uZSIKICBzdHJva2U9IiM2Yzc1N2QiCiAgc3Ryb2tlLXdpZHRoPSIyIgogIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIKICBzdHJva2UtbGluZWpvaW49InJvdW5kIgo+CiAgPHBhdGggZD0iTTMgMTJhOSA5IDAgMSAwIDE4IDBhOSA5IDAgMCAwIC0xOCAwIiAvPgogIDxwYXRoIGQ9Ik0xMiA5aC4wMSIgLz4KICA8cGF0aCBkPSJNMTEgMTJoMXY0aDEiIC8+Cjwvc3ZnPgo=') !important;\n}\n#sbz92 .message-event-action-btn:hover .message-event-action-btn-svg.like {\n background-image: url('data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjI0IiAgaGVpZ2h0PSIyNCIgIHZpZXdCb3g9IjAgMCAyNCAyNCIgIGZpbGw9Im5vbmUiICBzdHJva2U9ImJsYWNrIiAgc3Ryb2tlLXdpZHRoPSIyIiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgIGNsYXNzPSJpY29uIGljb24tdGFibGVyIGljb25zLXRhYmxlci1vdXRsaW5lIGljb24tdGFibGVyLXRodW1iLXVwIj48cGF0aCBzdHJva2U9Im5vbmUiIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNNyAxMXY4YTEgMSAwIDAgMSAtMSAxaC0yYTEgMSAwIDAgMSAtMSAtMXYtN2ExIDEgMCAwIDEgMSAtMWgzYTQgNCAwIDAgMCA0IC00di0xYTIgMiAwIDAgMSA0IDB2NWgzYTIgMiAwIDAgMSAyIDJsLTEgNWEyIDMgMCAwIDEgLTIgMmgtN2EzIDMgMCAwIDEgLTMgLTMiIC8+PC9zdmc+Cg==') !important;\n}\n#sbz92 .message-event-action-btn:hover .message-event-action-btn-svg.dislike {\n background-image: url('data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjI0IiAgaGVpZ2h0PSIyNCIgIHZpZXdCb3g9IjAgMCAyNCAyNCIgIGZpbGw9Im5vbmUiICBzdHJva2U9ImJsYWNrIiAgc3Ryb2tlLXdpZHRoPSIyIiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgIGNsYXNzPSJpY29uIGljb24tdGFibGVyIGljb25zLXRhYmxlci1vdXRsaW5lIGljb24tdGFibGVyLXRodW1iLWRvd24iPjxwYXRoIHN0cm9rZT0ibm9uZSIgZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjxwYXRoIGQ9Ik03IDEzdi04YTEgMSAwIDAgMCAtMSAtMWgtMmExIDEgMCAwIDAgLTEgMXY3YTEgMSAwIDAgMCAxIDFoM2E0IDQgMCAwIDEgNCA0djFhMiAyIDAgMCAwIDQgMHYtNWgzYTIgMiAwIDAgMCAyIC0ybC0xIC01YTIgMyAwIDAgMCAtMiAtMmgtN2EzIDMgMCAwIDAgLTMgMyIgLz48L3N2Zz4K') !important;\n}\n#sbz92 .message-event-action-btn:hover .message-event-action-btn-svg.info {\n background-image: url('data:image/svg+xml;base64,PHN2ZwogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB3aWR0aD0iMjQiCiAgaGVpZ2h0PSIyNCIKICB2aWV3Qm94PSIwIDAgMjQgMjQiCiAgZmlsbD0ibm9uZSIKICBzdHJva2U9IiMwMDAiCiAgc3Ryb2tlLXdpZHRoPSIyIgogIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIKICBzdHJva2UtbGluZWpvaW49InJvdW5kIgo+CiAgPHBhdGggZD0iTTMgMTJhOSA5IDAgMSAwIDE4IDBhOSA5IDAgMCAwIC0xOCAwIiAvPgogIDxwYXRoIGQ9Ik0xMiA5aC4wMSIgLz4KICA8cGF0aCBkPSJNMTEgMTJoMXY0aDEiIC8+Cjwvc3ZnPgo=') !important;\n}\n#sbz92 .message-event-action-btn.active .message-event-action-btn-svg.like {\n background-image: url('data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjI0IiAgaGVpZ2h0PSIyNCIgIHZpZXdCb3g9IjAgMCAyNCAyNCIgIGZpbGw9IiMzNEM3NTkiICBjbGFzcz0iaWNvbiBpY29uLXRhYmxlciBpY29ucy10YWJsZXItZmlsbGVkIGljb24tdGFibGVyLXRodW1iLXVwIj48cGF0aCBzdHJva2U9Im5vbmUiIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMTMgM2EzIDMgMCAwIDEgMi45OTUgMi44MjRsLjAwNSAuMTc2djRoMmEzIDMgMCAwIDEgMi45OCAyLjY1bC4wMTUgLjE3NGwuMDA1IC4xNzZsLS4wMiAuMTk2bC0xLjAwNiA1LjAzMmMtLjM4MSAxLjYyNiAtMS41MDIgMi43OTYgLTIuODEgMi43OGwtLjE2NCAtLjAwOGgtOGExIDEgMCAwIDEgLS45OTMgLS44ODNsLS4wMDcgLS4xMTdsLjAwMSAtOS41MzZhMSAxIDAgMCAxIC41IC0uODY1YTIuOTk4IDIuOTk4IDAgMCAwIDEuNDkyIC0yLjM5N2wuMDA3IC0uMjAydi0xYTMgMyAwIDAgMSAzIC0zeiIgLz48cGF0aCBkPSJNNSAxMGExIDEgMCAwIDEgLjk5MyAuODgzbC4wMDcgLjExN3Y5YTEgMSAwIDAgMSAtLjg4MyAuOTkzbC0uMTE3IC4wMDdoLTFhMiAyIDAgMCAxIC0xLjk5NSAtMS44NWwtLjAwNSAtLjE1di03YTIgMiAwIDAgMSAxLjg1IC0xLjk5NWwuMTUgLS4wMDVoMXoiIC8+PC9zdmc+Cg==') !important;\n}\n#sbz92 .message-event-action-btn.active .message-event-action-btn-svg.dislike {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzI0ODBfOTUpIj4KPHBhdGggZD0iTTEzIDIxLjAwNzlDMTMuNzY1IDIxLjAwOCAxNC41MDEyIDIwLjcxNTcgMTUuMDU3OSAyMC4xOTFDMTUuNjE0NyAxOS42NjYyIDE1Ljk0OTkgMTguOTQ4NiAxNS45OTUgMTguMTg0OUwxNiAxOC4wMDc5VjE0LjAwNzlIMThDMTguNzM1MSAxNC4wMDggMTkuNDQ0NyAxMy43MzgyIDE5Ljk5NCAxMy4yNDk3QzIwLjU0MzQgMTIuNzYxMiAyMC44OTQyIDEyLjA4OCAyMC45OCAxMS4zNTc5TDIwLjk5NSAxMS4xODQ5TDIxIDExLjAwNzlMMjAuOTggMTAuODExOUwxOS45NzQgNS43Nzk5MkMxOS41OTMgNC4xNTQ5MiAxOC40NzIgMi45ODM5MiAxNy4xNjQgMi45OTk5MkwxNyAzLjAwNzkySDlDOC43NTQ5MSAzLjAwNzk4IDguNTE4MzggMy4wOTgwNCA4LjMzNTMzIDMuMjYxMDFDOC4xNTIyNyAzLjQyMzk3IDguMDM1NDMgMy42NDg0OSA4LjAwNyAzLjg5MTkyTDggNC4wMDc5Mkw4LjAwMSAxMy41NDM5QzguMDAxIDEzLjcxOTUgOC4wNDcyMSAxMy44OTE5IDguMTM0OTggMTQuMDQzOUM4LjIyMjc1IDE0LjE5NTkgOC4zNDg5OCAxNC4zMjIyIDguNTAxIDE0LjQwOTlDOC45MjcyOSAxNC42NTYxIDkuMjg2NCAxNS4wMDM1IDkuNTQ2NjEgMTUuNDIxM0M5LjgwNjgyIDE1LjgzOTIgOS45NjAxMyAxNi4zMTQ3IDkuOTkzIDE2LjgwNTlMMTAgMTcuMDA3OVYxOC4wMDc5QzEwIDE4LjgwMzYgMTAuMzE2MSAxOS41NjY2IDEwLjg3ODcgMjAuMTI5MkMxMS40NDEzIDIwLjY5MTggMTIuMjA0NCAyMS4wMDc5IDEzIDIxLjAwNzlaIiBmaWxsPSIjMzMzMzMzIi8+CjxwYXRoIGQ9Ik01IDE0LjAwODFDNS4yNDQ5MyAxNC4wMDggNS40ODEzNCAxMy45MTgxIDUuNjY0MzcgMTMuNzU1M0M1Ljg0NzQxIDEzLjU5MjYgNS45NjQzNCAxMy4zNjgzIDUuOTkzIDEzLjEyNTFMNiAxMy4wMDgxVjQuMDA4MDZDNS45OTk5NyAzLjc2MzEyIDUuOTEwMDQgMy41MjY3MiA1Ljc0NzI4IDMuMzQzNjhDNS41ODQ1MyAzLjE2MDY1IDUuMzYwMjUgMy4wNDM3MSA1LjExNyAzLjAxNTA2TDUgMy4wMDgwNkg0QzMuNDk1MSAzLjAwNzkzIDMuMDA4ODQgMy4xOTg3OCAyLjYzODgxIDMuNTQyMjlDMi4yNjg3OCAzLjg4NTc5IDIuMDQyMzYgNC4zNTY1NCAyLjAwNSA0Ljg2MDA2TDIgNS4wMTAwNlYxMi4wMTAxQzIuMDAwMDkgMTIuNTE0NSAyLjE5MDc3IDEzLjAwMDIgMi41MzM4NCAxMy4zN0MyLjg3NjkgMTMuNzM5NyAzLjM0NzAyIDEzLjk2NjIgMy44NSAxNC4wMDQxTDQgMTQuMDA5MUw1IDE0LjAwODFaIiBmaWxsPSIjMzMzMzMzIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDBfMjQ4MF85NSI+CjxyZWN0IHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K') !important;\n}\n#sbz92 .inline-time {\n font-size: 13px !important;\n margin-top: 6px !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n font-weight: 500 !important;\n opacity: 0.4 !important;\n}\n#sbz92 .message-text-inline-image-wrapper {\n display: block !important;\n margin-top: 8px !important;\n margin-bottom: 8px !important;\n max-width: 100% !important;\n}\n#sbz92 .message-text-inline-image {\n width: 100% !important;\n}\n#sbz92 .text-message-ul {\n display: block !important;\n list-style-type: disc !important;\n margin-block-start: 8px !important;\n margin-block-end: 8px !important;\n padding-inline-start: 20px !important;\n}\n#sbz92 .text-message-ol {\n display: block !important;\n list-style-type: decimal !important;\n margin-block-start: 8px !important;\n margin-block-end: 8px !important;\n padding-inline-start: 20px !important;\n}\n#sbz92 .text-message-li {\n display: list-item !important;\n}\n#sbz92 .agent-message .text-message-link {\n color: #0d6efd !important;\n -webkit-text-fill-color: #0d6efd !important;\n font-weight: 400 !important;\n}\n#sbz92 .agent-message .text-message-link:hover {\n color: #024dbc !important;\n -webkit-text-fill-color: #024dbc !important;\n}\n#sbz92 .user-message .text-message-link {\n text-decoration: underline !important;\n text-decoration-color: rgba(255, 255, 255, 0.6) !important;\n text-underline-offset: 4px !important;\n}\n#sbz92 .user-message .text-message-link:hover {\n text-decoration-color: #fff !important;\n background-color: rgba(255, 255, 255, 0.08) !important;\n}\n#sbz92 .message-quote {\n padding: 6px 10px !important;\n border-left: 3px solid '@primary_color' !important;\n background-color: #dfdfdf !important;\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n margin-bottom: 8px !important;\n max-width: 100% !important;\n}\n#sbz92 .message-quote-title {\n font-weight: 600 !important;\n font-size: 14px !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n}\n#sbz92 .message-quote-content {\n opacity: 0.7 !important;\n color: '@secondary_color' !important;\n -webkit-text-fill-color: '@secondary_color' !important;\n font-size: 14px !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n}\n#sbz92 .message-quote-inner-img {\n width: 36px !important;\n height: 36px !important;\n object-fit: cover !important;\n}\n#sbz92 .message-quote-inner {\n margin-left: 15px !important;\n flex: 1 !important;\n overflow: hidden !important;\n}\n#sbz92 .image-attachment.just-focused {\n box-shadow: 0 0 0 2px #000 !important;\n}\n#sbz92 .file-attachment.just-focused {\n box-shadow: 0 0 0 2px #000 !important;\n}\n#sbz92 .widget_body_empty_img {\n max-width: 150px !important;\n max-height: 150px !important;\n}\n#sbz92 .emoji {\n position: relative !important;\n width: 20px !important;\n height: 20px !important;\n background-size: 100% !important;\n background-repeat: no-repeat !important;\n border: none !important;\n display: inline-block !important;\n vertical-align: text-bottom !important;\n}\n#sbz92 .emoji--angry {\n background-image: url("+it+") !important;\n}\n#sbz92 .emoji--confused {\n background-image: url("+rt+") !important;\n}\n#sbz92 .emoji--crying,\n#sbz92 .emoji--cry {\n background-image: url("+ot+") !important;\n}\n#sbz92 .emoji--grinning {\n background-image: url("+st+") !important;\n}\n#sbz92 .emoji--heart_eyes,\n#sbz92 .emoji--heart-eyes {\n background-image: url("+at+") !important;\n}\n#sbz92 .emoji--neutral_face,\n#sbz92 .emoji--neutral {\n background-image: url("+pt+") !important;\n}\n#sbz92 .emoji--disappointed,\n#sbz92 .emoji--sad {\n background-image: url("+lt+") !important;\n}\n#sbz92 .emoji--sleepy {\n background-image: url("+ct+") !important;\n}\n#sbz92 .emoji--smile,\n#sbz92 .emoji--smiling {\n background-image: url("+dt+") !important;\n}\n#sbz92 .emoji--open_mouth,\n#sbz92 .emoji--surprised {\n background-image: url("+ht+") !important;\n}\n#sbz92 .emoji--tired_face,\n#sbz92 .emoji--tired {\n background-image: url("+mt+") !important;\n}\n#sbz92 .emoji--stuck_out_tongue,\n#sbz92 .emoji--tongue-out {\n background-image: url("+ut+") !important;\n}\n#sbz92 .emoji--wink {\n background-image: url("+gt+") !important;\n}\n#sbz92 .emoji--moyai {\n background-image: url("+bt+") !important;\n}\n#sbz92 .emoji--dislike,\n#sbz92 .emoji--unlike,\n#sbz92 .emoji--thumbsdown {\n background-image: url("+ft+") !important;\n}\n#sbz92 .emoji--like,\n#sbz92 .emoji--thumbsup {\n background-image: url("+vt+") !important;\n}\n#sbz92 .emoji--ok_hand {\n background-image: url("+yt+") !important;\n}\n#sbz92 .emoji--octopus {\n background-image: url("+_t+") !important;\n}\n#sbz92 .emoji--pig2 {\n background-image: url("+wt+") !important;\n}\n#sbz92 .emoji--wave {\n background-image: url("+xt+") !important;\n}\n#sbz92 .emoji--mouse {\n background-image: url("+kt+") !important;\n}\n#sbz92 .emoji--mouse2 {\n background-image: url("+At+") !important;\n}\n#sbz92 .emoji--rat {\n background-image: url("+zt+") !important;\n}\n#sbz92 .emoji-picker {\n display: flex !important;\n flex-direction: row !important;\n z-index: 20 !important;\n position: absolute !important;\n max-width: 240px !important;\n background: #fff !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n border-radius: 10px !important;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.15) !important;\n right: 15px !important;\n bottom: 55px !important;\n flex-wrap: wrap !important;\n padding: 10px !important;\n justify-content: space-between !important;\n align-items: center !important;\n}\n#sbz92 .emoji-picker--item {\n background-size: 100% !important;\n width: 30px !important;\n height: 30px !important;\n position: relative !important;\n background-repeat: no-repeat !important;\n display: inline-block !important;\n vertical-align: text-bottom !important;\n margin: 5px !important;\n cursor: pointer !important;\n transition: background-color 0.2s !important;\n}\n#sbz92 .emoji-picker-background-item {\n background-size: 50% !important;\n width: 40px !important;\n height: 40px !important;\n border-radius: 100% !important;\n}\n#sbz92 .emoji-picker-background-item:hover {\n background-color: #dee2e6 !important;\n}\n#sbz92 .convo-list {\n display: flex !important;\n flex-direction: column !important;\n flex: 1 !important;\n width: 100% !important;\n justify-content: space-between !important;\n overflow: auto !important;\n margin-top: -60px !important;\n padding-left: 22.5px !important;\n padding-right: 22.5px !important;\n}\n#sbz92 .convo-list--list {\n background: #fff !important;\n overflow-y: auto !important;\n overflow-x: hidden !important;\n}\n#sbz92 .convo-list--title {\n font-weight: 500 !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n background: #fff !important;\n border-bottom: 1px solid #f0f0f0 !important;\n padding: 15px !important;\n}\n#sbz92 .convo-list--container {\n border-radius: 10px !important;\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1) !important;\n overflow: auto !important;\n display: flex !important;\n flex-direction: column !important;\n user-select: none !important;\n}\n#sbz92 .convo-list--footer {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n margin-top: 22.5px !important;\n}\n#sbz92 .convo-list--convo-last-info {\n overflow: hidden !important;\n white-space: nowrap !important;\n justify-content: center !important;\n display: flex !important;\n flex-direction: column !important;\n flex: 1 !important;\n margin-left: 15px !important;\n}\n#sbz92 .convo-list--convo-last-message {\n font-weight: normal !important;\n flex: 1 !important;\n cursor: pointer !important;\n display: flex !important;\n width: 100% !important;\n overflow: hidden !important;\n align-items: center !important;\n}\n#sbz92 .convo-list--convo-last-mes {\n text-overflow: ellipsis !important;\n opacity: 0.6 !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n font-weight: normal !important;\n}\n#sbz92 .convo-list--convo-title {\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n font-weight: 500 !important;\n}\n#sbz92 .convo-list--convo-completed {\n width: 14px !important;\n}\n#sbz92 .convo-list--convo-name {\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n flex: 1 !important;\n margin-right: 16px !important;\n cursor: pointer !important;\n}\n#sbz92 .convo-list--item {\n cursor: pointer !important;\n border-bottom: 1px solid '@primary_color_faded' !important;\n padding: 15px !important;\n display: flex !important;\n flex-direction: row !important;\n transition: background 0.15s ease !important;\n}\n#sbz92 .convo-list--item:hover {\n background: '@primary_color_faded' !important;\n}\n#sbz92 .convo-list--convo-time span {\n font-size: 14px !important;\n line-height: 20px !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n opacity: 0.6 !important;\n min-width: 70px !important;\n cursor: pointer !important;\n}\n#sbz92 .convo-list--item-unread {\n width: 8px !important;\n height: 8px !important;\n background: #dc3545 !important;\n border-radius: 50% !important;\n margin-left: 15px !important;\n align-self: center !important;\n}\n#sbz92 .convo-list--item-avatar {\n width: 32px !important;\n height: 32px !important;\n}\n#sbz92 .widget-body--empty {\n display: flex !important;\n flex: 1 !important;\n justify-content: center !important;\n align-items: center !important;\n flex-direction: column !important;\n}\n#sbz92 .widget-body--empty-text {\n color: #343a40 !important;\n -webkit-text-fill-color: #343a40 !important;\n margin-top: 30px !important;\n text-align: center !important;\n}\n#sbz92 .mobile .widget-container {\n border-radius: 0px !important;\n max-height: 100% !important;\n margin-bottom: 0 !important;\n top: auto !important;\n left: 0 !important;\n right: 0 !important;\n width: 100% !important;\n height: '@mobile_height' !important;\n opacity: 1 !important;\n transition: opacity 0.15s cubic-bezier(1, 0.5, 0.8, 1) !important;\n}\n#sbz92 .mobile .widget-container.widget-container--left {\n left: 0 !important;\n right: 0 !important;\n}\n#sbz92 .mobile .widget-container.widget-container--right {\n right: 0 !important;\n left: 0 !important;\n}\n#sbz92 .mobile .widget-container.widget-container--hide {\n top: -100vh !important;\n opacity: 0 !important;\n transition: opacity 0.15s cubic-bezier(1, 0.5, 0.8, 1), bottom 0.15s cubic-bezier(1, 0.5, 0.8, 1) !important;\n}\n#sbz92 .widget-container.widget-container--left {\n left: '@desktop_button.margin_x' !important;\n right: unset !important;\n}\n#sbz92 .widget-container.widget-container--right {\n right: '@desktop_button.margin_x' !important;\n left: unset !important;\n}\n#sbz92 .widget-container {\n max-height: 100% !important;\n max-height: '@desktop_widget_max_height' !important;\n max-width: 100% !important;\n background: #fff !important;\n z-index: '@z_index_3' !important;\n border-radius: 15px !important;\n box-shadow: 0 5px 25px 0 rgba(0, 0, 0, 0.13) !important;\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n position: '@widget_position' !important;\n margin-bottom: '@desktop_button.margin_y' !important;\n width: '@width' !important;\n height: '@height' !important;\n bottom: 0 !important;\n opacity: 1 !important;\n transform: translateY(0) !important;\n transition: transform 0.15s cubic-bezier(1, 0.5, 0.8, 1), opacity 0.2s cubic-bezier(1, 0.5, 0.8, 1), scale 0.15s ease !important;\n visibility: visible !important;\n overflow: hidden !important;\n}\n#sbz92 .widget-container.widget-container--full {\n max-height: 100% !important;\n height: 100% !important;\n margin-bottom: 0 !important;\n}\n#sbz92 .widget-container.widget-container--hide {\n opacity: 0 !important;\n transform: translateY(20px) !important;\n visibility: hidden !important;\n transition: transform 0.15s cubic-bezier(1, 0.5, 0.8, 1), opacity 0.1s cubic-bezier(1, 0.5, 0.8, 1), visibility 0.1s cubic-bezier(1, 0.5, 0.8, 1) !important;\n}\n#sbz92 .btn--start-convo {\n border-radius: 7px !important;\n flex-shrink: 0 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n padding-left: 32px !important;\n padding-right: 32px !important;\n height: 42px !important;\n color: '@text_color' !important;\n -webkit-text-fill-color: '@text_color' !important;\n font-size: 16px !important;\n font-weight: 500 !important;\n line-height: 20px !important;\n text-align: center !important;\n background: '@primary_color' !important;\n width: 100% !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n transition: filter 250ms ease !important;\n}\n#sbz92 .btn--start-convo::after {\n display: none !important;\n}\n#sbz92 .btn--start-convo:hover {\n filter: brightness(1.1) !important;\n}\n#sbz92 .btn--start-convo:disabled {\n opacity: 0.5 !important;\n cursor: default !important;\n pointer-events: none !important;\n}\n#sbz92 .widget-body.widget-body--none {\n display: none !important;\n}\n#sbz92 .widget-body {\n flex: 1 !important;\n flex-grow: 1 !important;\n z-index: -1 !important;\n width: 100% !important;\n overflow-y: auto !important;\n flex-direction: column !important;\n display: flex !important;\n position: relative !important;\n}\n#sbz92 .embed-chat .widget-body--events {\n width: 600px !important;\n margin: 0 auto !important;\n max-width: 100% !important;\n}\n#sbz92 .embed-chat .message-input {\n max-width: 600px !important;\n margin: 20px auto !important;\n}\n#sbz92 .embed-chat .widget-header--inner {\n max-width: 100% !important;\n width: 600px !important;\n}\n#sbz92 .embed-chat .widget-body--content {\n width: 600px !important;\n margin: 0 auto !important;\n max-width: 100% !important;\n}\n#sbz92 .embed-chat .convo-list {\n width: 600px !important;\n margin: 0 auto !important;\n max-width: 100% !important;\n}\n#sbz92 .widget-body--content {\n overflow-y: auto !important;\n overflow-x: hidden !important;\n flex: 1 !important;\n display: flex !important;\n flex-direction: column !important;\n position: relative !important;\n min-height: 0 !important;\n}\n#sbz92 .poweredby {\n margin-bottom: 15px !important;\n text-align: center !important;\n}\n#sbz92 .poweredby .poweredby--text {\n text-decoration: none !important;\n font-size: 13px !important;\n color: #7c7c7c !important;\n -webkit-text-fill-color: #7c7c7c !important;\n vertical-align: baseline !important;\n}\n#sbz92 .poweredby .poweredby--text .poweredby--subiz-logo {\n opacity: 0.7 !important;\n margin-top: -1px !important;\n height: 12px !important;\n}\n#sbz92 .poweredby .poweredby--text:hover {\n color: #333 !important;\n -webkit-text-fill-color: #333 !important;\n}\n#sbz92 .poweredby .poweredby--text:hover .poweredby--subiz-logo {\n opacity: 1 !important;\n}\n#sbz92 .empty-container {\n display: flex !important;\n justify-content: center !important;\n flex-direction: column !important;\n margin-top: 30px !important;\n margin-bottom: 30px !important;\n}\n#sbz92 .empty-desc {\n text-align: center !important;\n margin: 30px !important;\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n}\n#sbz92 .chat-button--white-bg {\n display: none !important;\n z-index: -1 !important;\n}\n#sbz92 .chat-button--white-bg--mask-only {\n background: white !important;\n width: 66px !important;\n height: 66px !important;\n top: 2px !important;\n left: 2px !important;\n position: absolute !important;\n border-radius: 50% !important;\n display: block !important;\n}\n#sbz92 .mobile .chat-button--default {\n width: '@mobile_button.width' !important;\n height: '@mobile_button.height' !important;\n background: '@background' !important;\n border-radius: '@mobile_button.border_radius' !important;\n}\n#sbz92 .mobile .widget-layout {\n bottom: '@mobile_button.margin_y' !important;\n}\n#sbz92 .mobile .widget-layout.widget-layout--left {\n left: '@mobile_button.margin_x' !important;\n right: unset !important;\n}\n#sbz92 .mobile .widget-layout.widget-layout--right {\n right: '@mobile_button.margin_x' !important;\n left: unset !important;\n}\n#sbz92 .mobile .chat-button--img {\n min-width: '@mobile_button.width' !important;\n}\n#sbz92 .chat-button {\n cursor: pointer !important;\n position: relative !important;\n transform: scale(1) !important;\n transition: opacity 200ms ease-in, transform 250ms cubic-bezier(0.34, 1.5, 0.64, 1) !important;\n}\n#sbz92 .chat-button.hidden {\n visibility: hidden !important;\n opacity: 0 !important;\n transform: scale(0.2) !important;\n pointer-events: none !important;\n}\n@media (prefers-reduced-motion: reduce) {\n #sbz92 .chat-button {\n transition: none !important;\n }\n}\n#sbz92 .chat-button:not(.hidden):hover {\n filter: brightness(1.1) !important;\n transform: scale(1.05) !important;\n}\n#sbz92 .chat-button--img {\n opacity: 0 !important;\n min-width: '@desktop_button.width' !important;\n display: block !important;\n}\n#sbz92 .chat-button--fallback .chat-button--img-container {\n background-size: 100% 100% !important;\n}\n#sbz92 .chat-button--fallback .chat-button--img {\n width: 100% !important;\n min-width: 0 !important;\n height: 100% !important;\n}\n#sbz92 .chat-button.chat-button--left {\n float: left !important;\n}\n#sbz92 .chat-button.chat-button--right {\n float: right !important;\n}\n#sbz92 .widget-layout {\n z-index: '@z_index_2' !important;\n position: '@widget_position' !important;\n bottom: '@desktop_button.margin_y' !important;\n transition: opacity 150ms !important;\n opacity: 1 !important;\n}\n#sbz92 .widget-layout.widget-layout--hidden {\n opacity: 0 !important;\n pointer-events: none !important;\n}\n#sbz92 .widget-layout.widget-layout--left {\n left: '@desktop_button.margin_x' !important;\n right: unset !important;\n}\n#sbz92 .widget-layout.widget-layout--right {\n right: '@desktop_button.margin_x' !important;\n left: unset !important;\n}\n#sbz92 .chat-button--unread {\n position: absolute !important;\n right: 0px !important;\n top: -5px !important;\n background: #dc3545 !important;\n padding-left: 5px !important;\n padding-right: 5px !important;\n padding-top: 2px !important;\n padding-bottom: 2px !important;\n border-radius: 5px !important;\n color: #fff !important;\n -webkit-text-fill-color: #fff !important;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.15) !important;\n}\n#sbz92 .widget-preview {\n z-index: '@z_index_3' !important;\n background: #fff !important;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.15) !important;\n border-radius: 15px !important;\n max-width: 100% !important;\n width: 340px !important;\n margin-bottom: 20px !important;\n}\n#sbz92 .widget-preview.widget-preview--hidden {\n display: none !important;\n}\n#sbz92 .widget-preview--btn-close {\n cursor: pointer !important;\n opacity: 0.5 !important;\n align-self: flex-start !important;\n background-color: #e5e5e5 !important;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXIteCI+PGxpbmUgeDE9IjE4IiB5MT0iNiIgeDI9IjYiIHkyPSIxOCI+PC9saW5lPjxsaW5lIHgxPSI2IiB5MT0iNiIgeDI9IjE4IiB5Mj0iMTgiPjwvbGluZT48L3N2Zz4K') !important;\n background-size: 16px 16px !important;\n background-repeat: no-repeat !important;\n background-position: center !important;\n width: 24px !important;\n height: 24px !important;\n display: block !important;\n border-radius: 100% !important;\n transition: background-color 0.2s !important;\n}\n#sbz92 .widget-preview--btn-close:hover {\n opacity: 1 !important;\n}\n#sbz92 .widget-preview--avatar {\n width: 45px !important;\n height: 45px !important;\n border: 1px solid rgba(31, 54, 90, 0.1) !important;\n border-radius: 100% !important;\n margin-right: 15px !important;\n}\n#sbz92 .widget-preview--body {\n display: flex !important;\n padding: 15px !important;\n}\n#sbz92 .widget-preview--title {\n display: block !important;\n font-size: 15px !important;\n color: black !important;\n -webkit-text-fill-color: black !important;\n margin-bottom: 5px !important;\n opacity: 0.7 !important;\n}\n#sbz92 .widget-preview--content {\n cursor: pointer !important;\n flex: 1 !important;\n overflow: hidden !important;\n}\n#sbz92 .widget-preview--message {\n white-space: pre-wrap !important;\n word-wrap: break-word !important;\n font-weight: 500 !important;\n font-size: 16px !important;\n display: block !important;\n margin: 0 !important;\n margin-bottom: 0px !important;\n max-height: 78px !important;\n overflow: hidden !important;\n}\n#sbz92 .widget-preview--action {\n border-top: 1px solid #f0f0f0 !important;\n cursor: pointer !important;\n padding: 13px !important;\n}\n#sbz92 .widget-preview--action-text {\n display: block !important;\n text-align: center !important;\n font-weight: 500 !important;\n font-size: 16px !important;\n color: '@primary_color' !important;\n -webkit-text-fill-color: '@primary_color' !important;\n margin: 0 !important;\n}\n#sbz92 .widget-internet-status {\n position: absolute !important;\n bottom: 0 !important;\n left: 0 !important;\n width: 100% !important;\n font-size: 14px !important;\n z-index: 10 !important;\n text-align: center !important;\n padding: 6px 5px !important;\n}\n#sbz92 .widget-internet-status.negative {\n background-color: #212325 !important;\n color: #fff !important;\n}\n#sbz92 .widget-internet-status.positive {\n background-color: #19b600 !important;\n color: #fff !important;\n}\n#sbz92 .widget-preview-text-message--header {\n display: flex !important;\n overflow: hidden !important;\n align-items: center !important;\n width: 100% !important;\n}\n#sbz92 .widget-preview-text-message--header .widget-preview--avatar {\n width: 24px !important;\n height: 24px !important;\n flex-shrink: 0 !important;\n margin-right: 10px !important;\n}\n#sbz92 .widget-preview-text-message--author {\n flex: 1 !important;\n overflow: hidden !important;\n display: flex !important;\n align-items: center !important;\n}\n#sbz92 .widget-preview-text-message--author .badge {\n margin-left: 10px !important;\n}\n#sbz92 .widget-preview-text-message--author-text {\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n overflow: hidden !important;\n line-height: 1.5 !important;\n color: '@secondary_color' !important;\n -webkit-text-fill-color: '@secondary_color' !important;\n}\n#sbz92 .widget-preview-text-message--content {\n margin-top: 10px !important;\n white-space: pre-wrap !important;\n}\n#sbz92 .widget-preview-quick-reply-wrapper {\n z-index: '@z_index_3' !important;\n width: 100% !important;\n margin-bottom: 15px !important;\n display: flex !important;\n flex-direction: column !important;\n align-items: flex-start !important;\n}\n#sbz92 .widget-preview-quick-reply-wrapper.right {\n align-items: flex-end !important;\n}\n#sbz92 .widget-preview-quick-reply-wrapper.horizontal {\n flex-direction: row !important;\n flex-wrap: wrap !important;\n align-items: center !important;\n gap: 10px !important;\n}\n#sbz92 .widget-preview-quick-reply-wrapper.horizontal.right {\n justify-content: flex-end !important;\n}\n#sbz92 .widget-preview-quick-reply-wrapper.horizontal.left {\n justify-content: flex-start !important;\n}\n#sbz92 .widget-preview-quick-reply-wrapper.horizontal .widget-preview-quick-reply-item {\n margin: 0 !important;\n max-width: 200px !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n padding: 6px 15px !important;\n}\n#sbz92 .widget-preview-quick-reply-wrapper.horizontal .widget-preview-quick-reply-item:last-child {\n margin-bottom: 0 !important;\n}\n#sbz92 .widget-preview-quick-reply-item {\n border-radius: 20px !important;\n padding: 8px 20px !important;\n background: #fff !important;\n border: 1.5px solid !important;\n border-color: '@primary_color' !important;\n color: '@primary_color' !important;\n -webkit-text-fill-color: '@primary_color' !important;\n margin-bottom: 15px !important;\n cursor: pointer !important;\n transition: 0.3s ease !important;\n position: relative !important;\n}\n#sbz92 .widget-preview-quick-reply-item:last-child {\n margin-bottom: 0 !important;\n}\n#sbz92 .widget-preview-quick-reply-item:hover {\n color: #fff !important;\n -webkit-text-fill-color: #fff !important;\n background-color: '@primary_color' !important;\n}\n#sbz92 .widget-preview-image-wrapper {\n z-index: '@z_index_3' !important;\n width: 100% !important;\n margin-bottom: 15px !important;\n display: flex !important;\n flex-direction: column !important;\n align-items: flex-start !important;\n}\n#sbz92 .widget-preview-image-wrapper.right {\n align-items: flex-end !important;\n}\n#sbz92 .widget-preview-image-item {\n max-width: 300px !important;\n border-radius: 15px !important;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.15) !important;\n border: 1px solid #dee2e6 !important;\n overflow: hidden !important;\n cursor: pointer !important;\n}\n#sbz92 .widget-preview-image-item img {\n width: 100% !important;\n max-height: 300px !important;\n object-fit: cover !important;\n}\n#sbz92 .widget-preview-text-message {\n z-index: '@z_index_3' !important;\n background: #fff !important;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.15) !important;\n border-radius: 15px !important;\n max-width: 100% !important;\n min-width: 210px !important;\n margin-bottom: 15px !important;\n padding: 15px 20px !important;\n position: relative !important;\n cursor: pointer !important;\n}\n#sbz92 .widget-preview-text-message.right {\n border-bottom-right-radius: 8px !important;\n}\n#sbz92 .widget-preview-text-message.left {\n border-bottom-left-radius: 8px !important;\n}\n#sbz92 .widget-preview-new-wrapper {\n max-width: '@preview_max_width' !important;\n position: relative !important;\n opacity: 1 !important;\n transition: opacity 0.15s ease-in, transform 0.15s ease-in !important;\n transform: translateY(0) !important;\n}\n#sbz92 .widget-preview-new-wrapper.hidden {\n transform: translateY(20px) !important;\n transition: opacity 0.15s ease-out, transform 0.15s ease-out !important;\n opacity: 0 !important;\n}\n#sbz92 .widget-preview-new-wrapper:hover .widget-preview-x-wrapper {\n display: flex !important;\n}\n#sbz92 .widget-preview-x-wrapper {\n display: none !important;\n justify-content: flex-start !important;\n width: calc(100% + 40px) !important;\n position: absolute !important;\n padding: 15px 20px !important;\n left: -20px !important;\n bottom: 100% !important;\n}\n#sbz92 .widget-preview-x-wrapper.mobile {\n display: flex !important;\n}\n#sbz92 .widget-preview-x-wrapper.right {\n justify-content: flex-end !important;\n left: unset !important;\n right: -20px !important;\n}\n#sbz92 .widget-preview-x-wrapper .widget-preview--btn-close {\n opacity: 1 !important;\n width: 32px !important;\n height: 32px !important;\n border: 1px solid #ececec !important;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.15) !important;\n background-color: #00000040 !important;\n background-size: 16px 16px !important;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNlY2VjZWMiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXIteCI+PGxpbmUgeDE9IjE4IiB5MT0iNiIgeDI9IjYiIHkyPSIxOCI+PC9saW5lPjxsaW5lIHgxPSI2IiB5MT0iNiIgeDI9IjE4IiB5Mj0iMTgiPjwvbGluZT48L3N2Zz4K') !important;\n}\n#sbz92 .widget-preview-x-wrapper .widget-preview--btn-close:hover {\n border-color: #fff !important;\n background-color: #00000066 !important;\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iMi4yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXIteCI+PGxpbmUgeDE9IjE4IiB5MT0iNiIgeDI9IjYiIHkyPSIxOCI+PC9saW5lPjxsaW5lIHgxPSI2IiB5MT0iNiIgeDI9IjE4IiB5Mj0iMTgiPjwvbGluZT48L3N2Zz4K') !important;\n}\n#sbz92 .rating--overlay {\n position: absolute !important;\n height: 100% !important;\n width: 100% !important;\n background: black !important;\n opacity: 0.3 !important;\n top: 0 !important;\n left: 0 !important;\n border-bottom-left-radius: 15px !important;\n border-bottom-right-radius: 15px !important;\n z-index: 9 !important;\n}\n#sbz92 .rating {\n border-top-left-radius: 10px !important;\n border-top-right-radius: 10px !important;\n overflow: hidden !important;\n position: absolute !important;\n height: 400px !important;\n max-height: 80% !important;\n width: 100% !important;\n bottom: 0 !important;\n /* centering */\n left: 0 !important;\n background: white !important;\n border-bottom-left-radius: 15px !important;\n border-bottom-right-radius: 15px !important;\n z-index: 10 !important;\n}\n#sbz92 .rating .rating--comment {\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n resize: none !important;\n margin-left: 20px !important;\n margin-right: 20px !important;\n border: 2px solid lightgray !important;\n border-radius: 5px !important;\n padding: 10px !important;\n height: 60px !important;\n min-height: 60px !important;\n}\n#sbz92 .rating .rating--close-btn {\n right: 20px !important;\n top: -2px !important;\n width: 22px !important;\n height: 22px !important;\n position: absolute !important;\n background-image: url('data:image/svg+xml,%3C?xml%20version%3D%221.0%22%20?%3E%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23acacac%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22feather%20feather-x%22%3E%3Cline%20x1%3D%2218%22%20y1%3D%226%22%20x2%3D%226%22%20y2%3D%2218%22%3E%3C/line%3E%3Cline%20x1%3D%226%22%20y1%3D%226%22%20x2%3D%2218%22%20y2%3D%2218%22%3E%3C/line%3E%3C/svg%3E') !important;\n cursor: pointer !important;\n}\n#sbz92 .rating .rating--close-btn:hover {\n background-image: url('data:image/svg+xml,%3C?xml%20version%3D%221.0%22%20?%3E%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23a0a0a0%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22feather%20feather-x%22%3E%3Cline%20x1%3D%2218%22%20y1%3D%226%22%20x2%3D%226%22%20y2%3D%2218%22%3E%3C/line%3E%3Cline%20x1%3D%226%22%20y1%3D%226%22%20x2%3D%2218%22%20y2%3D%2218%22%3E%3C/line%3E%3C/svg%3E') !important;\n}\n#sbz92 .rating .rating--handle:hover .rating--thumb {\n background: #e0e0e0 !important;\n}\n#sbz92 .rating .rating--thumb {\n width: 70px !important;\n height: 6px !important;\n background: #eaeaea !important;\n border-radius: 5px !important;\n margin: 0 auto !important;\n cursor: grabbing !important;\n margin-top: 8px !important;\n margin-bottom: 20px !important;\n}\n#sbz92 .rating .rating--content {\n display: flex !important;\n flex: 1 !important;\n flex-grow: 1 !important;\n height: calc(100% - 40px) !important;\n flex-direction: column !important;\n justify-content: space-between !important;\n}\n#sbz92 .rating .rating--heading {\n margin: 0 !important;\n font-weight: 500 !important;\n font-size: 20px !important;\n line-height: 20px !important;\n text-align: center !important;\n flex-grow: 1 !important;\n position: relative !important;\n}\n#sbz92 .rating .rating--description {\n text-align: center !important;\n flex-grow: 1 !important;\n font-size: 15px !important;\n padding-left: 20px !important;\n padding-right: 20px !important;\n display: flex !important;\n align-items: center !important;\n margin-top: 10px !important;\n margin-bottom: 15px !important;\n}\n#sbz92 .rating .rating-faces-container {\n flex: 5 !important;\n display: flex !important;\n justify-content: space-around !important;\n align-items: center !important;\n margin: 10px 10px !important;\n}\n#sbz92 .rating .rating-face-container {\n padding: 15px !important;\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n cursor: pointer !important;\n border-radius: 10px !important;\n user-select: none !important;\n -webkit-transition: all 0.1s !important;\n transition: all 0.1s !important;\n}\n#sbz92 .rating .rating-face-container:hover {\n box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1) !important;\n}\n#sbz92 .rating .rating-face--text {\n margin-top: 10px !important;\n margin-bottom: 0px !important;\n font-size: 13px !important;\n color: #4d4d4d !important;\n -webkit-text-fill-color: #4d4d4d !important;\n}\n#sbz92 .rating .rating-no-thanks {\n flex: 10 !important;\n text-align: center !important;\n cursor: pointer !important;\n display: flex !important;\n justify-content: center !important;\n align-items: flex-end !important;\n color: #acacac !important;\n -webkit-text-fill-color: #acacac !important;\n}\n#sbz92 .rating .rating-no-thanks:hover {\n color: black !important;\n -webkit-text-fill-color: black !important;\n}\n#sbz92 .text__danger {\n color: #dc3545 !important;\n}\n#sbz92 .extension--close-btn {\n background: #00000088 !important;\n border-radius: 8px !important;\n color: #ffffffaa !important;\n -webkit-text-fill-color: #ffffffaa !important;\n right: 10px !important;\n top: -35px !important;\n font-size: 14px !important;\n position: absolute !important;\n padding: 5px 15px !important;\n cursor: pointer !important;\n}\n#sbz92 .extension--close-btn:hover {\n background: #000000 !important;\n color: #ffffff !important;\n -webkit-text-fill-color: #ffffff !important;\n}\n#sbz92 .extension--handle {\n margin-bottom: 10px !important;\n}\n#sbz92 .extension--handle:hover .extension--thumb {\n background: #e0e0e0 !important;\n}\n#sbz92 .extension--thumb {\n width: 70px !important;\n cursor: grabbing !important;\n margin: 0 auto !important;\n height: 6px !important;\n background: #eaeaea !important;\n border-radius: 5px !important;\n flex: 1 !important;\n margin-top: 5px !important;\n}\n#sbz92 .extension {\n border-top-left-radius: 10px !important;\n position: absolute !important;\n border-top-right-radius: 10px !important;\n width: 100% !important;\n bottom: 0 !important;\n /* centering */\n left: 0 !important;\n border-bottom-left-radius: 15px !important;\n border-bottom-right-radius: 15px !important;\n display: flex !important;\n flex-direction: column !important;\n background: white !important;\n z-index: 10 !important;\n}\n#sbz92 .extension--overlay {\n position: absolute !important;\n height: 100% !important;\n width: 100% !important;\n background: black !important;\n opacity: 0.3 !important;\n top: 0 !important;\n left: 0 !important;\n border-bottom-left-radius: 15px !important;\n border-bottom-right-radius: 15px !important;\n z-index: 9 !important;\n}\n#sbz92 .order__footer {\n margin-top: 40px !important;\n color: #888 !important;\n -webkit-text-fill-color: #888 !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n margin-bottom: 20px !important;\n}\n#sbz92 .order__footer_delimiter {\n width: 1px !important;\n height: 15px !important;\n border-right: 1px solid #bbb !important;\n}\n#sbz92 .order__footer_link {\n padding: 0 10px !important;\n font-size: 14px !important;\n cursor: pointer !important;\n}\n#sbz92 .order__footer_link:hover {\n text-decoration: none !important;\n color: #555 !important;\n -webkit-text-fill-color: #555 !important;\n}\n#sbz92 .desktop.order {\n border-radius: 0 !important;\n width: 780px !important;\n margin: 0 auto !important;\n height: 100% !important;\n}\n#sbz92 .desktop.order .order_section__line {\n display: none !important;\n}\n#sbz92 .desktop.order .desktop_order__heading {\n line-height: 20px !important;\n}\n#sbz92 .desktop.order .order_attachment__product_img {\n width: 50px !important;\n height: 50px !important;\n}\n#sbz92 .desktop.order .order_label {\n font-weight: 500 !important;\n margin-top: 30px !important;\n margin-bottom: 10px !important;\n font-size: 16px !important;\n}\n#sbz92 .desktop.order .order_label:first-child {\n margin-top: 0 !important;\n}\n#sbz92 .desktop.order .order_recap {\n margin-top: 0px !important;\n background: #f4f4f4 !important;\n margin-top: 20px !important;\n width: 270px !important;\n box-shadow: 0 0 0 1px hsla(0, 0%, 69%, 0.2), 0 15px 35px 0 rgba(49, 49, 93, 0.08), 0 5px 15px 0 rgba(0, 0, 0, 0.06) !important;\n border-radius: 6px !important;\n background-color: #fff !important;\n padding: 32px 32px 20px !important;\n}\n#sbz92 .desktop.order .order_acc_header {\n display: flex !important;\n align-items: center !important;\n margin-top: 20px !important;\n}\n#sbz92 .desktop.order .order_acc_logo {\n height: 50px !important;\n}\n#sbz92 .desktop.order .order_acc_name {\n font-size: 16px !important;\n margin-left: 10px !important;\n border-left: 1px solid #aaa !important;\n padding-left: 10px !important;\n}\n#sbz92 .desktop.order .order_summary_line {\n align-items: center !important;\n overflow: hidden !important;\n padding: 5px 0 !important;\n display: flex !important;\n justify-content: space-between !important;\n}\n#sbz92 .desktop_order__content {\n display: flex !important;\n}\n#sbz92 .order {\n width: 100% !important;\n display: flex !important;\n flex-direction: column !important;\n background: white !important;\n z-index: 10 !important;\n}\n#sbz92 .order .ship_card {\n display: flex !important;\n align-items: center !important;\n overflow: hidden !important;\n width: 190px !important;\n cursor: pointer !important;\n padding: 10px 15px !important;\n box-shadow: none !important;\n border: 2px solid #eee !important;\n color: #777 !important;\n -webkit-text-fill-color: #777 !important;\n margin-top: 5px !important;\n border-radius: 8px !important;\n background: white !important;\n transition: all 150ms ease-out !important;\n}\n#sbz92 .order .ship_card:hover {\n color: #555 !important;\n -webkit-text-fill-color: #555 !important;\n border: 2px solid #aaa !important;\n}\n#sbz92 .order .ship_card.ship_card__active {\n color: #333 !important;\n -webkit-text-fill-color: #333 !important;\n border: 2px solid #777 !important;\n background: #fafafa !important;\n}\n#sbz92 .order .order_ship_icon {\n margin-top: -3px !important;\n width: 15px !important;\n height: 15px !important;\n opacity: 0.6 !important;\n}\n#sbz92 .order .card_section {\n margin-top: 20px !important;\n max-width: 500px !important;\n box-shadow: 0 0 0 1px hsla(0, 0%, 69%, 0.2), 0 15px 35px 0 rgba(49, 49, 93, 0.08), 0 5px 15px 0 rgba(0, 0, 0, 0.06) !important;\n border-radius: 6px !important;\n background-color: #fff !important;\n padding: 32px !important;\n}\n#sbz92 .order input[type='text'].form-control,\n#sbz92 .order input[type='number'].form-control,\n#sbz92 .order input[type='date'].form-control,\n#sbz92 .order textarea.form-control,\n#sbz92 .order select.form-control {\n background: #f4f4f4 !important;\n border: 1px solid transparent !important;\n padding: 7px 10px !important;\n}\n#sbz92 .order input[type='text'].form-control:hover,\n#sbz92 .order input[type='number'].form-control:hover,\n#sbz92 .order input[type='date'].form-control:hover,\n#sbz92 .order textarea.form-control:hover,\n#sbz92 .order select.form-control:hover {\n background: #f0f0f0 !important;\n}\n#sbz92 .order input[type='text'].form-control:focus,\n#sbz92 .order input[type='number'].form-control:focus,\n#sbz92 .order input[type='date'].form-control:focus,\n#sbz92 .order textarea.form-control:focus,\n#sbz92 .order select.form-control:focus,\n#sbz92 .order input[type='text'].form-control:active,\n#sbz92 .order input[type='number'].form-control:active,\n#sbz92 .order input[type='date'].form-control:active,\n#sbz92 .order textarea.form-control:active,\n#sbz92 .order select.form-control:active {\n background: #eee !important;\n}\n#sbz92 .order input[type='text'].form-control.err,\n#sbz92 .order input[type='number'].form-control.err,\n#sbz92 .order input[type='date'].form-control.err,\n#sbz92 .order textarea.form-control.err,\n#sbz92 .order select.form-control.err {\n background: #ffe6e6 !important;\n border: 1px solid #ff8a8a !important;\n}\n#sbz92 .order .form {\n box-shadow: none !important;\n border: none !important;\n padding: 0 !important;\n}\n#sbz92 .order .form .radio {\n height: unset !important;\n}\n#sbz92 .order .order--content {\n display: flex !important;\n flex: 1 !important;\n flex-direction: column !important;\n}\n#sbz92 .order .order--content-content {\n flex: 1 !important;\n overflow: auto !important;\n}\n#sbz92 .order .order--heading {\n margin: 0 !important;\n margin-top: 20px !important;\n padding-left: 20px !important;\n padding-right: 20px !important;\n padding-bottom: 8px !important;\n line-height: 20px !important;\n position: relative !important;\n}\n#sbz92 .order .order--header-desc {\n color: #6c757d !important;\n -webkit-text-fill-color: #6c757d !important;\n font-size: 13px !important;\n}\n#sbz92 .order .order__product_line {\n display: flex !important;\n overflow: hidden !important;\n}\n#sbz92 .order .order--footer {\n text-align: k center !important;\n cursor: pointer !important;\n display: flex !important;\n justify-content: center !important;\n align-items: flex-end !important;\n color: #acacac !important;\n -webkit-text-fill-color: #acacac !important;\n}\n#sbz92 .order .order--footer:hover {\n color: black !important;\n -webkit-text-fill-color: black !important;\n}\n#sbz92 .order .order_section_label {\n color: #444 !important;\n -webkit-text-fill-color: #444 !important;\n margin-bottom: 5px !important;\n text-transform: uppercase !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n}\n#sbz92 .order .order_label {\n color: #444 !important;\n -webkit-text-fill-color: #444 !important;\n margin-bottom: 5px !important;\n text-transform: uppercase !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n}\n#sbz92 .order .order_section {\n padding-left: 20px !important;\n padding-right: 20px !important;\n padding-bottom: 15px !important;\n padding-top: 15px !important;\n}\n#sbz92 .order .order_section__line {\n border-top: 4px solid #eee !important;\n width: 100% !important;\n}\n#sbz92 .order .order_summary_line {\n overflow: hidden !important;\n padding: 3px 0 !important;\n display: flex !important;\n justify-content: space-between !important;\n}\n#sbz92 .order .order_btn {\n width: 100% !important;\n}\n#sbz92 .order .order_tracking_link {\n text-decoration: underline !important;\n cursor: pointer !important;\n}\n#sbz92 .order .order_tracking_link:hover {\n color: '@primary_color' !important;\n -webkit-text-fill-color: '@primary_color' !important;\n}\n#sbz92 .order .order_tracking_link_icon {\n margin-top: -3px !important;\n width: 15px !important;\n height: 15px !important;\n}\n#sbz92 .order .order_shipping_provider_logo {\n width: 32px !important;\n height: 32px !important;\n margin-right: 10px !important;\n}\n#sbz92 .order .order_btn.order__btn__light {\n background: #f0f0f0 !important;\n color: black !important;\n -webkit-text-fill-color: black !important;\n border-radius: 6px !important;\n text-align: center !important;\n padding: 8px !important;\n cursor: pointer !important;\n}\n#sbz92 .order .order_btn.order__btn__light:hover {\n color: black !important;\n -webkit-text-fill-color: black !important;\n background: #ddd !important;\n}\n#sbz92 div.order__card {\n display: flex !important;\n padding: 15px !important;\n box-shadow: none !important;\n border: 2px solid #eee !important;\n margin-top: 10px !important;\n border-radius: 8px !important;\n background: #fafafa !important;\n}\n#sbz92 div.order__card.order__card__active {\n border: 2px solid #777 !important;\n background: white !important;\n}\n#sbz92 .order_form_label {\n margin-top: 10px !important;\n margin-bottom: 4px !important;\n}\n#sbz92 .btn-confirm-order {\n width: 100% !important;\n background: '@primary_color' !important;\n display: flex !important;\n align-items: center !important;\n border-radius: 5px !important;\n color: #fff !important;\n -webkit-text-fill-color: #fff !important;\n padding: 15px 10px !important;\n cursor: pointer !important;\n justify-content: center !important;\n font-weight: 500 !important;\n margin-top: 10px !important;\n}\n#sbz92 .btn-confirm-order:hover {\n background: #0053d4 !important;\n}\n#sbz92 .order__total {\n font-weight: 500 !important;\n font-size: 20px !important;\n color: '@primary_color' !important;\n -webkit-text-fill-color: '@primary_color' !important;\n}\n#sbz92 .btn-cancel-order {\n color: #666 !important;\n -webkit-text-fill-color: #666 !important;\n text-decoration: underline !important;\n display: inline-block !important;\n margin-top: 10px !important;\n cursor: pointer !important;\n}\n#sbz92 .btn-cancel-order:hover {\n color: #333 !important;\n -webkit-text-fill-color: #333 !important;\n}\n#sbz92 .order_status {\n text-transform: uppercase !important;\n background: black !important;\n color: white !important;\n -webkit-text-fill-color: white !important;\n display: inline-block !important;\n border-radius: 4px !important;\n padding: 6px 6px 4px 6px !important;\n line-height: 1 !important;\n font-weight: 500 !important;\n font-size: 12px !important;\n}\n#sbz92 .order_status.order_status__canceled {\n background: whitesmoke !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n}\n#sbz92 .order_status.order_status__cancel {\n background: whitesmoke !important;\n color: #000 !important;\n -webkit-text-fill-color: #000 !important;\n}\n#sbz92 .order_status.order_status__confirmed {\n background: '@primary_color' !important;\n color: white !important;\n -webkit-text-fill-color: white !important;\n}\n#sbz92 .order_status.order_status__shipping {\n background: #000 !important;\n color: white !important;\n -webkit-text-fill-color: white !important;\n}\n#sbz92 .order_status.order_status__fullfilled {\n background: #28a745 !important;\n color: white !important;\n -webkit-text-fill-color: white !important;\n}\n#sbz92 .order_status.order_status__hold {\n background: #dc3545 !important;\n color: white !important;\n -webkit-text-fill-color: white !important;\n}\n#sbz92 .order_status.order_status__draft {\n background: #ffc107 !important;\n color: white !important;\n -webkit-text-fill-color: white !important;\n}\n#sbz92 .order_status.order_status__open {\n background: #ffc107 !important;\n color: white !important;\n -webkit-text-fill-color: white !important;\n}\n#sbz92 .order_error {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n justify-content: center !important;\n height: 100% !important;\n width: 100% !important;\n}\n#sbz92 .order_attachment__note {\n font-size: 14px !important;\n white-space: pre-wrap !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n display: -webkit-box !important;\n -webkit-line-clamp: 3 !important;\n -webkit-box-orient: vertical !important;\n}\n#sbz92 .dropdown_select {\n position: absolute !important;\n background: white !important;\n -webkit-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;\n border-radius: 5px !important;\n width: 150px !important;\n z-index: 20 !important;\n overflow: hidden !important;\n}\n#sbz92 .dropdown_select__overlay {\n top: 0 !important;\n overflow: hidden !important;\n position: absolute !important;\n background: #000000aa !important;\n z-index: 19 !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n}\n#sbz92 .dropdown_select__item {\n padding: 7px 10px !important;\n cursor: pointer !important;\n}\n#sbz92 .dropdown_select__item:hover {\n background: '@primary_color' !important;\n color: #fff !important;\n -webkit-text-fill-color: #fff !important;\n}\n#sbz92 .dropdown_select_filter {\n padding: 8px 10px !important;\n border-bottom: 1px solid #eee !important;\n position: relative !important;\n}\n#sbz92 .dropdown_select_filter:hover .dropdown_select_filter__icon {\n opacity: 1 !important;\n}\n#sbz92 .dropdown_select_filter_input {\n border-radius: 5px !important;\n width: 100% !important;\n display: block !important;\n background: #f4f4f4 !important;\n border: none !important;\n padding: 7px 10px !important;\n padding-left: 35px !important;\n}\n#sbz92 .dropdown_select_filter_input:hover {\n background: #f0f0f0 !important;\n}\n#sbz92 .dropdown_select_filter_input:focus,\n#sbz92 .dropdown_select_filter_input:active {\n background: #eee !important;\n}\n#sbz92 .dropdown_select_input {\n border-radius: 5px !important;\n overflow: hidden !important;\n cursor: pointer !important;\n flex-wrap: nowrap !important;\n display: flex !important;\n background: #f4f4f4 !important;\n border: 1px solid trasparent !important;\n padding: 7px 10px !important;\n height: 32px !important;\n min-width: 120px !important;\n width: 100% !important;\n}\n#sbz92 .dropdown_select_input:hover {\n background: #f0f0f0 !important;\n}\n#sbz92 .dropdown_select_input:focus,\n#sbz92 .dropdown_select_input:active {\n background: #eee !important;\n}\n#sbz92 .dropdown_select_input.err {\n background: #ffe6e6 !important;\n border: 1px solid #ff8a8a !important;\n}\n#sbz92 .dropdown_select__items {\n max-height: 300px !important;\n min-height: 100px !important;\n overflow-x: hidden !important;\n overflow-y: auto !important;\n}\n#sbz92 .dropdown_select_filter__icon {\n width: 22px !important;\n height: 15px !important;\n position: absolute !important;\n z-index: 2 !important;\n top: 15px !important;\n left: 18px !important;\n border-right: 1px solid #aaa !important;\n padding-right: 7px !important;\n opacity: 0.5 !important;\n}\n#sbz92 .dropdown_select_filter__empty {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n flex-direction: column !important;\n}\n#sbz92 .dropdown_select_filter__empty_img {\n height: 50px !important;\n margin-top: 10px !important;\n margin-bottom: 10px !important;\n}\n#sbz92 .dropdown_select__caret {\n width: 14px !important;\n margin-top: 3px !important;\n opacity: 0.6 !important;\n height: 15px !important;\n}\ndiv#sbz92 {\n all: initial;\n}\nbody div#sbz92 {\n all: initial !important;\n}\n",""]);const It=et;n.d(e,["default",0,It])},6314(t){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n}).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(i)for(var o=0;o<this.length;o++){var s=this[o][0];null!=s&&(r[s]=!0)}for(var a=0;a<t.length;a++){var p=[].concat(t[a]);i&&r[p[0]]||(n&&(p[2]?p[2]="".concat(n," and ").concat(p[2]):p[2]=n),e.push(p))}},e}},4417(t){"use strict";t.exports=function(t,e){return e||(e={}),"string"!=typeof(t=t&&t.__esModule?t.default:t)?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t)}},7574(t,e,n){t.exports=n.p+"assets/img/award1a.1a58e10.png"},9040(t,e,n){t.exports=n.p+"assets/img/award3a.3b74423.png"},4257(t,e,n){t.exports=n.p+"assets/img/award4a.ed6ccd4.png"},8011(t,e,n){t.exports=n.p+"assets/img/award5.39eb7ae.png"},1108(t,e,n){t.exports=n.p+"assets/img/bubble_default.6f6eec8.svg"},1370(t,e,n){t.exports=n.p+"assets/img/convos_empty.2353007.svg"},2876(t,e,n){t.exports=n.p+"assets/img/default.06e6ee0.jpg"},2538(t,e,n){t.exports=n.p+"assets/img/default_avatar.e449b04.png"},3763(t,e,n){t.exports=n.p+"assets/img/default_logo.dd13a2b.svg"},9150(t,e,n){t.exports=n.p+"assets/img/done_gray.d7e8203.svg"},4218(t,e,n){t.exports=n.p+"assets/img/dot_chat.335fd8a.svg"},6120(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_23.529_58.824.d5faf14.png"},8268(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_23.529_60.784.1420241.png"},7698(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_25.490_0.000.1e6b2c0.png"},3970(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_25.490_45.098.3dfbc08.png"},9521(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_25.490_5.882.4b49e94.png"},8362(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_27.451_72.549.7114f58.png"},6501(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_27.451_84.314.231e2b7.png"},4865(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_27.451_96.078.ddbb008.png"},7435(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_29.412_5.882.61f3359.png"},2338(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_58.824_100.000.6df72bc.png"},4777(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_58.824_45.098.3d7a7ad.png"},9658(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_58.824_47.059.0f4d6e2.png"},7987(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_58.824_54.902.65724c1.png"},1196(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_58.824_64.706.9da3cba.png"},3284(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_58.824_72.549.edca5cf.png"},8226(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_58.824_78.431.f910f2a.png"},2729(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_58.824_88.235.def4e71.png"},1389(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_60.784_11.765.49c03d0.png"},2420(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_60.784_27.451.46b54e5.png"},4681(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_60.784_29.412.e36d284.png"},6129(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_60.784_3.922.bb191b0.png"},102(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_60.784_35.294.af7b927.png"},5007(t,e,n){t.exports=n.p+"assets/img/emoji/messenger/sub_60.784_7.843.98f2a99.png"},9419(t,e,n){t.exports=n.p+"assets/img/empty.29bed2d.svg"},2106(t,e,n){t.exports=n.p+"assets/img/examplte_logo.f86535f.svg"},3266(t,e,n){t.exports=n.p+"assets/img/external-link.90577cc.svg"},3582(t,e,n){t.exports=n.p+"assets/img/image_default.be0698b.png"},6973(t,e,n){t.exports=n.p+"assets/img/loading_static.a27f0ac.svg"},6989(t,e,n){t.exports=n.p+"assets/img/main-service1.d536cc2.png"},3014(t,e,n){t.exports=n.p+"assets/img/main-service2.9b99549.png"},7134(t,e,n){t.exports=n.p+"assets/img/rating--average.1ea492c.svg"},940(t,e,n){t.exports=n.p+"assets/img/rating--great.e3d712e.svg"},9801(t,e,n){t.exports=n.p+"assets/img/rating--poor.2938a25.svg"},8506(t,e,n){t.exports=n.p+"assets/img/send.6db52a9.svg"},5457(t,e,n){t.exports=n.p+"assets/img/stars_v2.79cf728.png"},9529(t,e,n){t.exports=n.p+"assets/img/subiz-mono.8fbc067.svg"},172(t,e,n){"use strict";n.d(e,{FK:()=>y,XX:()=>W,_3:()=>v,h:()=>b,uA:()=>_});var i,r,o,s,a,p,l,c={},d=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function u(t,e){for(var n in e)t[n]=e[n];return t}function g(t){var e=t.parentNode;e&&e.removeChild(t)}function b(t,e,n){var r,o,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?o=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?i.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return f(t,a,r,o,null)}function f(t,e,n,i,s){var a={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++o,__i:-1,__u:0};return null==s&&null!=r.vnode&&r.vnode(a),a}function v(){return{current:null}}function y(t){return t.children}function _(t,e){this.props=t,this.context=e}function w(t,e){if(null==e)return t.__?w(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?w(t):null}function x(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return x(t)}}function k(t){(!t.__d&&(t.__d=!0)&&s.push(t)&&!A.__r++||a!==r.debounceRendering)&&((a=r.debounceRendering)||p)(A)}function A(){var t,e,n,i,o,a,p,c,d;for(s.sort(l);t=s.shift();)t.__d&&(e=s.length,i=void 0,a=(o=(n=t).__v).__e,c=[],d=[],(p=n.__P)&&((i=u({},o)).__v=o.__v+1,r.vnode&&r.vnode(i),T(p,i,o,n.__n,void 0!==p.ownerSVGElement,32&o.__u?[a]:null,c,a??w(o),!!(32&o.__u),d),i.__.__k[i.__i]=i,P(c,i,d),i.__e!=a&&x(i)),s.length>e&&s.sort(l));A.__r=0}function z(t,e,n,i,r,o,s,a,p,l,h){var m,u,g,b,f,v=i&&i.__k||d,y=e.length;for(n.__d=p,I(n,e,v),p=n.__d,m=0;m<y;m++)null!=(g=n.__k[m])&&"boolean"!=typeof g&&"function"!=typeof g&&(u=-1===g.__i?c:v[g.__i]||c,g.__i=m,T(t,g,u,r,o,s,a,p,l,h),b=g.__e,g.ref&&u.ref!=g.ref&&(u.ref&&N(u.ref,null,g),h.push(g.ref,g.__c||b,g)),null==f&&null!=b&&(f=b),65536&g.__u||u.__k===g.__k?p=C(g,p,t):"function"==typeof g.type&&void 0!==g.__d?p=g.__d:b&&(p=b.nextSibling),g.__d=void 0,g.__u&=-196609);n.__d=p,n.__e=f}function I(t,e,n){var i,r,o,s,a,p=e.length,l=n.length,c=l,d=0;for(t.__k=[],i=0;i<p;i++)null!=(r=t.__k[i]=null==(r=e[i])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?f(null,r,null,null,r):m(r)?f(y,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?f(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=t,r.__b=t.__b+1,a=M(r,n,s=i+d,c),r.__i=a,o=null,-1!==a&&(c--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__u|=65536)):a!==s&&(a===s+1?d++:a>s?c>p-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==i+d&&(r.__u|=65536))):(o=n[i])&&null==o.key&&o.__e&&(o.__e==t.__d&&(t.__d=w(o)),F(o,o,!1),n[i]=null,c--);if(c)for(i=0;i<l;i++)null!=(o=n[i])&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=w(o)),F(o,o))}function C(t,e,n){var i,r;if("function"==typeof t.type){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=C(i[r],e,n));return e}return t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function M(t,e,n,i){var r=t.key,o=t.type,s=n-1,a=n+1,p=e[n];if(null===p||p&&r==p.key&&o===p.type)return n;if(i>(null==p||131072&p.__u?0:1))for(;s>=0||a<e.length;){if(s>=0){if((p=e[s])&&!(131072&p.__u)&&r==p.key&&o===p.type)return s;s--}if(a<e.length){if((p=e[a])&&!(131072&p.__u)&&r==p.key&&o===p.type)return a;a++}}return-1}function S(t,e,n){"-"===e[0]?t.setProperty(e,n??""):t[e]=null==n?"":"number"!=typeof n||h.test(e)?n:n+"px"}function D(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||S(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||S(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n.u=i.u:(n.u=Date.now(),t.addEventListener(e,o?E:j,o)):t.removeEventListener(e,o?E:j,o);else{if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=n??"";break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function j(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(r.event?r.event(t):t)}function E(t){return this.l[t.type+!0](r.event?r.event(t):t)}function T(t,e,n,i,o,s,a,p,l,c){var d,h,g,b,f,v,w,x,k,A,I,C,M,S,D,j=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[p=e.__e=n.__e]),(d=r.__b)&&d(e);t:if("function"==typeof j)try{if(x=e.props,k=(d=j.contextType)&&i[d.__c],A=d?k?k.props.value:d.__:i,n.__c?w=(h=e.__c=n.__c).__=h.__E:("prototype"in j&&j.prototype.render?e.__c=h=new j(x,A):(e.__c=h=new _(x,A),h.constructor=j,h.render=R),k&&k.sub(h),h.props=x,h.state||(h.state={}),h.context=A,h.__n=i,g=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=u({},h.__s)),u(h.__s,j.getDerivedStateFromProps(x,h.__s))),b=h.props,f=h.state,h.__v=e,g)null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==j.getDerivedStateFromProps&&x!==b&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(x,A),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(x,h.__s,A)||e.__v===n.__v)){for(e.__v!==n.__v&&(h.props=x,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(t){t&&(t.__=e)}),I=0;I<h._sb.length;I++)h.__h.push(h._sb[I]);h._sb=[],h.__h.length&&a.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(x,h.__s,A),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(b,f,v)})}if(h.context=A,h.props=x,h.__P=t,h.__e=!1,C=r.__r,M=0,"prototype"in j&&j.prototype.render){for(h.state=h.__s,h.__d=!1,C&&C(e),d=h.render(h.props,h.state,h.context),S=0;S<h._sb.length;S++)h.__h.push(h._sb[S]);h._sb=[]}else do{h.__d=!1,C&&C(e),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++M<25);h.state=h.__s,null!=h.getChildContext&&(i=u(u({},i),h.getChildContext())),g||null==h.getSnapshotBeforeUpdate||(v=h.getSnapshotBeforeUpdate(b,f)),z(t,m(D=null!=d&&d.type===y&&null==d.key?d.props.children:d)?D:[D],e,n,i,o,s,a,p,l,c),h.base=e.__e,e.__u&=-161,h.__h.length&&a.push(h),w&&(h.__E=h.__=null)}catch(t){e.__v=null,l||null!=s?(e.__e=p,e.__u|=l?160:32,s[s.indexOf(p)]=null):(e.__e=n.__e,e.__k=n.__k),r.__e(t,e,n)}else null==s&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=L(n.__e,e,n,i,o,s,a,l,c);(d=r.diffed)&&d(e)}function P(t,e,n){e.__d=void 0;for(var i=0;i<n.length;i++)N(n[i],n[++i],n[++i]);r.__c&&r.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){r.__e(t,e.__v)}})}function L(t,e,n,r,o,s,a,p,l){var d,h,u,b,f,v,y,_=n.props,x=e.props,k=e.type;if("svg"===k&&(o=!0),null!=s)for(d=0;d<s.length;d++)if((f=s[d])&&"setAttribute"in f==!!k&&(k?f.localName===k:3===f.nodeType)){t=f,s[d]=null;break}if(null==t){if(null===k)return document.createTextNode(x);t=o?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,x.is&&x),s=null,p=!1}if(null===k)_===x||p&&t.data===x||(t.data=x);else{if(s=s&&i.call(t.childNodes),_=n.props||c,!p&&null!=s)for(_={},d=0;d<t.attributes.length;d++)_[(f=t.attributes[d]).name]=f.value;for(d in _)f=_[d],"children"==d||("dangerouslySetInnerHTML"==d?u=f:"key"===d||d in x||D(t,d,null,f,o));for(d in x)f=x[d],"children"==d?b=f:"dangerouslySetInnerHTML"==d?h=f:"value"==d?v=f:"checked"==d?y=f:"key"===d||p&&"function"!=typeof f||_[d]===f||D(t,d,f,_[d],o);if(h)p||u&&(h.__html===u.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(u&&(t.innerHTML=""),z(t,m(b)?b:[b],e,n,r,o&&"foreignObject"!==k,s,a,s?s[0]:n.__k&&w(n,0),p,l),null!=s)for(d=s.length;d--;)null!=s[d]&&g(s[d]);p||(d="value",void 0!==v&&(v!==t[d]||"progress"===k&&!v||"option"===k&&v!==_[d])&&D(t,d,v,_[d],!1),d="checked",void 0!==y&&y!==t[d]&&D(t,d,y,_[d],!1))}return t}function N(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){r.__e(t,n)}}function F(t,e,n){var i,o;if(r.unmount&&r.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||N(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){r.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(o=0;o<i.length;o++)i[o]&&F(i[o],e,n||"function"!=typeof t.type);n||null==t.__e||g(t.__e),t.__=t.__e=t.__d=void 0}function R(t,e,n){return this.constructor(t,n)}function W(t,e,n){var o,s,a,p;r.__&&r.__(t,e),s=(o="function"==typeof n)?null:n&&n.__k||e.__k,a=[],p=[],T(e,t=(!o&&n||e).__k=b(y,null,[t]),s||c,c,void 0!==e.ownerSVGElement,!o&&n?[n]:s?null:e.firstChild?i.call(e.childNodes):null,a,!o&&n?n:s?s.__e:e.firstChild,o,p),P(a,t,p)}i=d.slice,r={__e:function(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(e){t=e}throw t}},o=0,_.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof t&&(t=t(u({},n),this.props)),t&&u(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),k(this))},_.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),k(this))},_.prototype.render=y,s=[],p="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(t,e){return t.__v.__b-e.__v.__b},A.__r=0}};const e={};function n(i){const r=e[i];if(void 0!==r)return r.exports;const o=e[i]={id:i,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.m=t,n.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var r=e[i++],o=e[i++],s=0===o?{enumerable:!0,value:e[i++]}:{enumerable:!0,get:o};n.o(t,r)||Object.defineProperty(t,r,s)}else for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.f={},n.e=t=>{const e=[];return n.f.j(t,e),Promise.all(e)},n.u=t=>"1a12ed33347."+t+".js",n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{const t={},e="@subiz/widget-v4:";n.l=(i,r,o,s)=>{if(t[i])return void t[i].push(r);let a,p;if(void 0!==o){const t=document.getElementsByTagName("script");for(var l=0;l<t.length;l++){const n=t[l];if(n.getAttribute("src")==i||n.getAttribute("data-webpack")==e+o){a=n;break}}}a||(p=!0,a=document.createElement("script"),a.charset="utf-8",n.nc&&a.setAttribute("nonce",n.nc),a.setAttribute("data-webpack",e+o),a.src=i),t[i]=[r];const c=(e,n)=>{a.onerror=a.onload=null,clearTimeout(d);const r=t[i];if(delete t[i],a.parentNode?.removeChild(a),r?.forEach(t=>t(n)),e)return e(n)},d=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),p&&document.head.appendChild(a)}})(),n.r=t=>{Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.p="https://vcdn.subiz-cdn.com/widget-v4/public/",(()=>{const t={278:0,685:0};n.f.j=(e,i)=>{let r=n.o(t,e)?t[e]:void 0;if(0!==r)if(r)i.push(r[2]);else{const o=new Promise((n,i)=>r=t[e]=[n,i]);i.push(r[2]=o);const s=new Error,a=i=>{if(n.o(t,e)&&(r=t[e],0!==r&&(t[e]=void 0),r)){const t=i&&("load"===i.type?"missing":i.type),n=i&&i.target&&i.target.src;s.message="Loading chunk "+e+" failed.\n("+t+": "+n+")",s.name="ChunkLoadError",s.type=t,s.request=n,s.event=i,r[1](s)}};n.l(n.p+n.u(e),a,"chunk-"+e,e)}};const e=(e,i)=>{let[r,o,s]=i;var a,p,l=0;if(r.some(e=>0!==t[e])){for(a in o)n.o(o,a)&&(n.m[a]=o[a]);s&&s(n)}for(e&&e(i);l<r.length;l++)p=r[l],n.o(t,p)&&t[p]&&t[p][0](),t[p]=0},i=self.webpackChunk_subiz_widget_v4=self.webpackChunk_subiz_widget_v4||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})(),(()=>{"use strict";var t=()=>n(318),e=()=>n(450),i=()=>n(2876),r=()=>n(2538),o=()=>n(3763),s=()=>n(3266),a=()=>n(3582),p=n(5922);function l(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const c=t();function d(t,e){let n=t.request;"text/plain"===n.content_type&&void 0!==n.body&&(n.body=p.A.stringify(n.body)),e(!0)}let h=0,m=(t,e)=>{if("undefined"==typeof sbz_info)return e(!0);let n=t.request;h++,n._id=h,sbz_info["ajax."+h]={created:p.A.Date.now(),method:n.method,baseurl:n.baseurl,query:n.query},e(!0)},u=(t,e)=>{if("undefined"==typeof sbz_info)return e(!0);let n=t.request._id;sbz_info["ajax."+n]||(sbz_info["ajax."+n]={created:0}),sbz_info["ajax."+n].out={duration:p.A.Date.now()-sbz_info["ajax."+n].created,code:t.code,err:t.err},e(!0)};const g=class{constructor(t,e){l(this,"listConversations",t=>this.apireq.addQuery("user_id",this.uid).addQuery("integration_id",`${this.accid}.subizv4.subikon`).get(`/accounts/${this.accid}/conversations`)),l(this,"listMessages",(t,e,n)=>this.apireq.addQuery("limit",e).addQuery("start_id",n).get(`/accounts/${this.accid}/conversations/${t}/messages`)),l(this,"ajax",c),l(this,"start",(t,e,n,i)=>{let r=Object.assign({},t);return r.touchpoint||(r.touchpoint={}),r.touchpoint.channel||(r.touchpoint.channel="subiz"),r.touchpoint.source||(r.touchpoint.source="web"),r.source=p.A.get(document,"location.href"),this.apireq.post(`/accounts/${this.accid}/conversations`,r)}),l(this,"sendConvoEvent",(t,e)=>this.apireq.addQuery("x-referer",p.A.get(location,"origin","")).post(`/accounts/${this.accid}/conversations/${t}/events`,e)),l(this,"createPostback",(t,e)=>this.apireq.post(`/accounts/${this.accid}/conversations/${t}/postbacks`,e)),l(this,"markAsReceived",(t,e)=>this.apireq.post(`/accounts/${this.accid}/conversations/${t}/messages/${e}/receive`)),l(this,"markAsSeen",(t,e)=>this.apireq.post(`/accounts/${this.accid}/conversations/${t}/messages/${e}/seen`)),l(this,"getConversation",t=>this.apireq.get(`/accounts/${this.accid}/conversations/${t}`)),l(this,"getLocaleContent",t=>this.apireq.get(`/accounts/${this.accid}/languages/${t}`)),l(this,"sendEvent",t=>this.apireq.addQuery("shorten",!0).addQuery("x-referer",p.A.get(location,"origin","")).post(`/accounts/${this.accid}/users/${this.uid}/events`,t)),l(this,"websiteFormRequest",()=>this.apireq.setBaseUrl(this.ApiURL.replace(/\/4\.[01]\/?$/,"/4.1"))),l(this,"submitWebsiteForm",(t,e)=>this.websiteFormRequest().post(`/accounts/${this.accid}/external-forms/${encodeURIComponent(t)}/submissions`,e)),l(this,"submitForm",(t,e,n,i,r)=>this.apireq.addQuery("x-referer",p.A.get(location,"origin","")).post(`/accounts/${this.accid}/users/${this.uid}/events`,{by:{id:this.uid,device:n},type:"form_submitted",data:{user:r,form_submission:{user_id:this.uid,form_id:t,page_url:e,submitted_at:p.A.Date.now(),values:i}}})),l(this,"sendTyping",t=>this.apireq.post(`/accounts/${this.accid}/conversations/${t}/typing`)),l(this,"sendLostFocus",()=>this.apireq.post(`/accounts/${this.accid}/focuses/${this.uid}/delete`)),l(this,"uploadToS3",async t=>{let e=t.name.replace(/\s+/g,"_");var{body:n,error:i}=await this.apireq.setBaseUrl("https://api5.subiz.com.vn/4.1").setQuery({"account-id":this.accid,description:"upload\n user-client: web-widget",name:e,presign:!0,size:t.size,"content-type":t.type}).post("/files");if(i)return{body:n,error:i};let r=n.signed_url,o=n.id,s=await new Promise(e=>{const n=new p.A.XMLHttpRequest;n.open("PUT",r,!0),n.setRequestHeader("Content-Type",t.type||""),n.onload=function(){200===n.status?e():e(new Error(`Upload failed: ${n.statusText}`))},n.onerror=function(){e(new Error("Network error during upload."))},n.send(t)});if(s)return{error:s};var{body:n,error:i}=await this.apireq.setBaseUrl("https://api5.subiz.com.vn/4.1").setQuery({"account-id":this.accid}).post(`/files/${o}/uploaded`);return i?{error:i}:{url:p.A.get(n,"file.url","")}}),l(this,"uploadToS32",async t=>{var{body:e,error:n}=await c.setBaseUrl("https://api5.subiz.com.vn/4.1").withCredentials(!0).setQuery({"account-id":this.accid,description:"upload\n user-client: web-widget",name:t.name.replace(/\s+/g,"_"),size:t.size,type:t.type}).setParser("json").beforeHook((t,e)=>{if(this.token_generator){let n=this.profile_id;return void this.token_generator().then(i=>n!=this.profile_id?e(!0):i?"error"==i?e(!1):(t.request=t.request.addQuery("x-access-token",i),e(!0)):e(!1))}return this.ref?t.request=t.request.addQuery("x-user-ref",this.ref):this.mask&&(t.request=t.request.addQuery("x-user-mask",this.mask)),e(!0)}).post("/files",t);return n?{body:e,error:n}:{url:p.A.get(e,"file.url")}}),l(this,"time",t=>c.setBaseUrl(this.ApiURL).withCredentials(!0).setParser("json").get("/time")),l(this,"updateUser",t=>this.apireq.post(`/accounts/${this.accid}/users/${this.uid}`,t)),l(this,"getUser",t=>this.apireq.get(`/accounts/${this.accid}/users/${this.uid}`)),l(this,"getAccountSetting",async t=>{let e=p.A.get(document,"location.href"),n={};if(n=t&&t.bot_id?await this.apireq.addQuery("url",e).addQuery("bot_id",t.bot_id).get(`/accounts/${this.accid}/settings`):await this.apireq.addQuery("url",e).get(`/accounts/${this.accid}/settings`),n.error)return n;let i=p.A.get(n,"body.plugins")||[];return p.A.map(i,t=>{if("popup"===t.type){let e=p.A.get(t,"popup.pages")||[];p.A.map(e,t=>{p.A.map(t.components,t=>{if("image"===t.type){let e=p.A.get(t,"image.url");p.A.set(t,"image.url",function(t){try{const e=new URL(t),n="storage.googleapis.com"===e.hostname,i=e.pathname.startsWith("/public-gcs.subiz-cdn.com/");return n&&i?`https://${e.pathname.slice(1)}`:t}catch(e){return t}}(e))}})})}}),p.A.set(n,"body.plugins",i),n}),l(this,"sendImpression",t=>this.apireq.post(`/accounts/${this.accid}/campaigns/${t.campaign_id}/impressions`,t)),l(this,"sendConversion",t=>this.apireq.post(`/accounts/${this.accid}/campaigns/${t.campaign_id}/conversions`,t)),l(this,"lookupOrder",t=>c.setBaseUrl(this.ApiURL).setContentType("text/plain").beforeHook(d).setParser("json").addQuery("x-signed-key",t).get("/orders/123")),l(this,"getOrder",t=>this.apireq.get(`/accounts/${this.accid}/orders/`+t)),l(this,"updateOrder",t=>this.apireq.post(`/accounts/${this.accid}/orders/`+t.id,t)),l(this,"fetchShippingAddresses",()=>this.apireq.get(`/accounts/${this.accid}/users/${this.uid}/shipping-addresses`)),l(this,"createShippingAddress",t=>this.apireq.post(`/accounts/${this.accid}/users/${this.uid}/shipping-addresses`,t)),l(this,"list_provinces",()=>this.apireq.get(`/accounts/${this.accid}/provinces`)),l(this,"list_districts",t=>this.apireq.setQuery(t).get(`/accounts/${this.accid}/districts`)),l(this,"list_wards",t=>this.apireq.setQuery(t).get(`/accounts/${this.accid}/wards`)),l(this,"checkFormToken",(t,e)=>this.api41.addQuery("account-id",t).get(`/submissions/${e}`)),l(this,"submitForm2",(t,e,n)=>this.api41.addQuery("account-id",t).post(`/submissions/${e}`,n)),l(this,"suggest_address",t=>this.apireq.setQuery({keyword:t}).get(`/accounts/${this.accid}/addresses`)),l(this,"create_ticket",t=>this.apireq.post(`/accounts/${this.accid}/tickets`,t)),this.refreshLock=new p.A.Mutex,this.FileURL=e,this.ApiURL=t,this.api41=c.setBaseUrl("https://api.sbz.vn/4.1").withCredentials(!0).setContentType("text/plain").beforeHook(d).afterHook(u).beforeHook(m).setParser("json"),this.apireq=c.setBaseUrl(t).withCredentials(!0).addQuery("v","6").setContentType("text/plain").beforeHook(d).afterHook(u).setParser("json").beforeHook(m).beforeHook((t,e)=>{if(this.token_generator){let n=this.profile_id;return void this.token_generator().then(i=>n!=this.profile_id?e(!0):i?"error"==i?e(!1):(t.request=t.request.addQuery("x-access-token",i),e(!0)):e(!1))}return this.ref?t.request=t.request.addQuery("x-user-ref",this.ref):this.mask&&(t.request=t.request.addQuery("x-user-mask",this.mask)),e(!0)})}setAgentId(t){this.agentid=t}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 e=0;t=await c.setBaseUrl(this.ApiURL).withCredentials(!0).afterHook(u).beforeHook(m).addQuery("v","6").addQuery("x-user-ref",this.ref).setParser("json").get(`/accounts/${this.accid}/users/${this.ref}`),-1==p.A.get(t,"body.error.code","").indexOf("locked_account");e++){if(-1==p.A.get(t,"body.error.code","").indexOf("user_is_banned")){if(!p.A.get(t,"body.id")){let t=Math.min(2e3+400*e,6e4);await p.A.sleep(t);continue}break}await p.A.sleep(12e4)}return t.error?p.A.get(t.body.code)?{error:t.body.code}:t:(this.uid=t.body.id,t.body)}if(t.tokenGenerator){let e=t.tokenGenerator;this.tokensession=this.tokensession||0,this.tokensession++;let n=this.tokensession;if(!this.accid||!p.A.startsWith(this.accid,"ac"))return{error:"invalid_account_id"};if(!this.profile_id)return{error:"invalid_profile_id"};if("function"!=typeof e)return{error:"invalid_token_generator"};let i,r=this.profile_id;this.token_generator=async t=>{if(await this.refreshLock.lock(),n!=this.tokensession)return void this.refreshLock.unlock();let i,o,s=(p.A.Date.now()-(this.last_token_at||0))/1e3;if(!t&&this.last_token&&s<1800)return this.refreshLock.unlock(),this.last_token;if(!t&&this.last_token&&s<3e3)return this.token_generator&&p.A.setTimeout(async()=>{let t,i;try{t=await e(r)}catch(t){i=t}n==this.tokensession?(this.last_token=i?"error":t,this.last_token_at=p.A.Date.now(),this.refreshLock.unlock()):this.refreshLock.unlock()}),this.last_token;try{i=await e(r)}catch(t){o=t}if(n==this.tokensession)return this.last_token=o?"error":i,this.last_token_at=p.A.Date.now(),this.refreshLock.unlock(),this.last_token;this.refreshLock.unlock()};for(let t=0;await this.token_generator(!0),n==this.tokensession;t++){if(i=await c.setBaseUrl(this.ApiURL).withCredentials(!0).addQuery("v","6").afterHook(u).beforeHook(m).addQuery("x-access-token",this.last_token).setParser("json").get(`/accounts/${this.accid}/users/${r}`),!p.A.get(i,"body.id")){let e=Math.min(2e3+100*t,12e4);await p.A.sleep(e);continue}break}return i.error?p.A.get(i.body.code)?{error:i.body.code}:i:(this.uid=i.body.id,i.body)}if(this.mask){let t=this.mask.split("@");return this.uid=t[1],{id:this.uid}}return{error:"invalid_auth"}}sendContentView(t,e,n,i,r,o){return i||(i=void 0),r||(r=void 0),this.sendEvent({by:{id:this.uid,device:t},type:"content_viewed",data:{product:{id:i,source_id:r,url:e,name:n,title:n,sku:o}}})}};let b=e(),f="undefined"!=typeof window?window.requestIdleCallback:null;f||(f=t=>t());const v=class{constructor(t,e){if(this.localStorage=b,this.inmem=e,this.allkeys={},!e)try{window.localStorage.setItem("sbzstore1029","?"),window.localStorage.removeItem("sbzstore1029"),this.localStorage=window.localStorage}catch(t){}this.schema=t}all(t){let e=[];for(var n=0;n<this.localStorage.length;n++){let i=this.localStorage.key(n);i.startsWith(this.schema+"#"+t+"#")&&(this.allkeys[i]=!0,this.inmem?e.push(this.localStorage.getItem(i)):e.push(p.A.parseJSON(this.localStorage.getItem(i))))}return e}removes(t,e){for(var n=0;n<e.length;n++)delete this.allkeys[this.schema+"#"+t+"#"+e[n]],this.localStorage.removeItem(this.schema+"#"+t+"#"+e[n])}clear(t){for(var e=[],n=0;n<this.localStorage.length;n++){let i=this.localStorage.key(n);i.startsWith(this.schema+"#"+t+"#")&&e.push(i)}for(n=0;n<e.length;n++)this.localStorage.removeItem(e[n]);this.allkeys={}}put(t,e,n){if(this.allkeys[this.schema+"#"+t+"#"+e]=!0,this.inmem)return this.localStorage.setItem(this.schema+"#"+t+"#"+e,n);Object.keys(this.allkeys).length>80&&this.clear(t),f(()=>{try{this.localStorage.setItem(this.schema+"#"+t+"#"+e,void 0===(i=n)?"null":p.A.stringify(i))}catch(e){this.clear(t)}var i})}};class y{constructor(t,e,n){this.schema=e+"_chain",this.dead=!1,this.db=t,this.anchorCache={},this.cache={},this.init()}init(){let t={};this.db.all("items").map(e=>{t[e.chain]=t[e.chain]||{},t[e.chain][e.id]={id:e.id,chain:e.chain,full_id:e.full_id,index:e.index,value:e.value}}),w(t,(e,n)=>{if(x(e)<50)return;let i=(r=w(e),o=["index"],s=[],w(r,t=>s.push(t)),s.sort((t,e)=>{if(t[o]===e[o])return 0;var n=t[o]<e[o]?-1:1;return-n}),s);var r,o,s;let a=[];for(var p=50;p<i.length;p++)a.push(i[p].full_id),delete e[i[p].id];this.db.removes("items",a),t[n]=e}),this.cache=t}destroy(){this.db.clear("items"),this.dead=!0,this.cache={},this.anchorCache={},this.db=void 0}put(t,e,n,i){if(this.dead)return;let r=this.cache[t]||{},o=(_(r)||{}).index||"z";0==x(r)&&(o="");let s={id:e,index:n,value:i,chain:t,full_id:t+":"+e};delete r[s.id],o>s.index+""||(r[s.id]=s,this.cache[t]=r,this.db.put("items",s.full_id,s))}listM(t){if(this.dead)return{};let e=this.cache[t]||{},n={};return w(e,(t,e)=>{n[e]=t.value}),n}async fetchMore(t,e=20,n){if(this.dead)return{error:"dead"};if(!n)return{error:"no api"};let i=this.anchorCache[t]||"";var[r,o,s]=await n(t,i,e);if(s)return{error:s};if(this.dead)return{error:"dead"};let a=this.cache[t]||{};return 0===r.length?{end:!0}:(r.forEach(e=>{e.chain=t,e.full_id=t+":"+e.id,a[e.id]=e,this.db.put("items",e.full_id,e)}),this.anchorCache[t]=o,this.cache[t]=a,{})}merge(t,e){if(this.dead)return;const n=this.cache[t]||{};for(const i of e){const e={...i,chain:t,full_id:t+":"+i.id};n[i.id]=e,this.db.put("items",e.full_id,e)}this.cache[t]=n}del(t,e){if(this.dead)return;let n=t+":"+e;delete(this.cache[t]||{})[e],this.db.removes("items",[n])}match(t,e){return this.listM(t)[e]}async reload(t,e){if(this.dead)return;let n=(function(t){if(!t)return;let e=Object.keys(t);if(!e.length)return;let n=-1/0,i=Object.keys(t)[0];for(var r=0;r<e.length;r++){let o=t[e[r]]&&t[e[r]].index||-1/0;o>n&&(n=o,i=e[r])}return t[i]}(this.cache[t]||{})||{}).index;n||(n=Date.now());for(var i="",r={};;){if(this.dead)return;let[o,s,a]=await e(t,i,50);if(a)return;if(this.dead)return;if(o.map(e=>{r[e.id]=Object.assign({},e,{chain:t,full_id:t+":"+e.id})}),0===o.length||s===i)break;if((_(r)||{}).index<=n){i=this.anchorCache[t]||s;break}if(x(r)>=200){let e=this.cache[t]||{},n=[];w(e,e=>{e.chain===t&&n.push(e.full_id)}),this.db.removes("items",n),this.cache[t]={},i=s;break}i=s}for(const t of Object.values(r))this.db.put("items",t.full_id,t),this.cache[t.chain]=this.cache[t.chain]||{},this.cache[t.chain][t.id]=t;this.anchorCache[t]=i}}function _(t){if(!t)return;let e=Object.keys(t);if(!e.length)return;let n=1/0,i=Object.keys(t)[0];for(var r=0;r<e.length;r++){let o=t[e[r]]&&t[e[r]].index||1/0;o<n&&(n=o,i=e[r])}return t[i]}function w(t,e){if(!t)return[];if(!e)return t;var n=[];if(Array.isArray(t)){for(let i=0;i<t.length;i++)n.push(e(t[i],i));return n}if("object"==typeof t){var i=Object.keys(t);for(let o=0;o<i.length;o++){var r=i[o];n.push(e(t[r],r))}return n}return n}function x(t){return t?void 0!==t.length?t.length:Object.keys(t).length:0}const k=class{constructor(t,e){this.name=e,e+="_kv",this.dead=!1,this.db=t,this.cache={},this.initialized=!1,this.init()}refreshCache(){if(this.dead)return;let t={};this.db.all("items").forEach(function(e){t[e.key]=e.value}),this.cache=t}init(){if(this.initialized)return;let t={};this.db.all("items").forEach(function(e){t[e.key]=e.value}),this.cache=t,this.trimCache(),this.initialized=!0}trimCache(){const t=Object.keys(this.cache);if(t.length<=500)return;const e=t.slice(0,t.length-Math.floor(250));for(const t of e)delete this.cache[t];this.db.removes("items",e)}all(){return this.dead?[]:this.initialized?this.cache:[]}match(t){if(!this.dead&&this.initialized&&t)return this.cache[t]}put(t,e){if(t){if(this.dead)return[];if(!this.initialized)throw new Error("uninitialized");this.cache[t]=e,this.db.put("items",t,{key:t,value:e}),this.trimCache()}}del(t){if(!this.dead){if(!this.initialized)throw new Error("uninitialized");delete this.cache[t],this.db.removes("items",[t])}}destroy(){this.db.clear("items"),this.dead=!0,this.db=void 0,this.cache=void 0,this.initialized=!1}};function A(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const z=t();function I(t,e){let n=t.request;"text/plain"===n.content_type&&void 0!==n.body&&(n.body=p.A.stringify(n.body)),e(!0)}const C=Promise.resolve({code:200}),M=class{constructor(t,e){A(this,"listConversations",t=>{let e=S(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid);return Promise.resolve({body:{anchor:"",conversations:[e]},code:200})}),A(this,"listMessages",(t,e,n)=>{let i=function(t,e,n,i){let r=t+".subizv4.subikon",o={type:"user",id:n,last_page_view_url:"https://subiz.com.vn/",conversation_id:e,membership:"active",invited_by:{id:n,type:"user"}},s={type:"agent",conversation_id:e,id:i,membership:"active",invited_by:{id:n,type:"user"}};return[{id:"evqyiyjmxrjsylftvnrghrfmq",account_id:t,created:1616213202264,type:"conversation_invited",by:{id:n,type:"user"},data:{conversation:{id:e,account_id:t,members:[o],state:"pending"}}},{id:"evqyiyjmyqdgrouswczzawuzp",account_id:t,created:1616213202559,type:"conversation_invited",by:{id:n,type:"user"},data:{conversation:{id:e,account_id:t,members:[s],state:"pending",source:"https://subiz.com.vn/vi/"}}},{id:"evqyiyjmyzjpyehnngvmcyauf",account_id:t,created:1616213202668,type:"conversation_state_updated",by:{id:n,type:"user"},data:{conversation:{id:e,account_id:t,state:"active"}}},{id:"evqyiyjmzaozvqgbkljbwywdl",account_id:t,created:1616213202683,type:"conversation_joined",by:{id:n,type:"user"},data:{conversation:{id:e,members:[o]}}},{id:"evqyiyjmzatvtgpdmmpzwnwgn",source_event_id:"wrueysyjbhqrkiwhsejpqrwqrdkkyaibajdw",account_id:t,created:1616213202685,type:"message_sent",by:{id:n,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:e,text:"Xin chào",format:"plaintext",integration_id:r,pongs:[{member_id:n,type:"seen",created:1616213203068}]}}},{id:"evqyiyjrhsfyuxtetszmvkkke",account_id:t,created:1616213237491,type:"conversation_joined",by:{id:n,type:"user"},data:{conversation:{id:e,members:[s]}}},{id:"evqyiyjrhtroknjyakrlrwhgr",account_id:t,created:1616213237508,type:"message_sent",by:{id:i,client_id:"dashboard",type:"agent"},data:{message:{conversation_id:e,text:"chào bạn, mình có thể giúp gì được cho bạn :grinning:",format:"plaintext",integration_id:r,pongs:[{member_id:n,type:"receive",created:1616213237742},{member_id:n,type:"seen",created:1616213240057}]}}},{id:"evqyiyjuvjinmclneroerxmrl",account_id:t,created:1616213265805,type:"message_sent",by:{id:n,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:e,text:"mình muốn hỏi giá sản phẩm IPhone X",format:"plaintext",integration_id:r,pongs:[{member_id:n,type:"seen",created:1616213267090}]}}},{id:"evqyiyjzjxzfcsexshcjbbnnf",account_id:t,created:1616213302432,type:"message_sent",by:{id:i,client_id:"dashboard",type:"agent"},data:{message:{conversation_id:e,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:r,pongs:[{member_id:n,type:"receive",created:1616213302698},{member_id:n,type:"seen",created:1616213305071}]}}},{id:"evqyiykaoizbwnkaecwphttwk",account_id:t,created:1616213311830,type:"message_sent",by:{id:n,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:e,text:"ok cám ơn!",format:"plaintext",integration_id:r,pongs:[{member_id:n,type:"seen",created:1616213312110}]}}}]}(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid);return Promise.resolve({body:i,code:200})}),A(this,"ajax",z),A(this,"start",t=>C),A(this,"sendConvoEvent",(t,e)=>C),A(this,"createPostback",(t,e)=>C),A(this,"markAsReceived",(t,e)=>C),A(this,"markAsSeen",(t,e)=>C),A(this,"getConversation",t=>Promise.resolve({body:S(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid),code:200})),A(this,"getLocaleContent",t=>this.apireq.get(`/accounts/${this.accid}/locales/${t}`)),A(this,"sendEvent",t=>C),A(this,"submitForm",(t,e,n,i,r)=>C),A(this,"sendTyping",t=>C),A(this,"sendPresence",t=>C),A(this,"sendContent",t=>C),A(this,"sendLostFocus",t=>C),A(this,"sendContentView",t=>C),A(this,"uploadToS3",async t=>C),A(this,"time",t=>Promise.resolve({code:200,body:(new p.A.Date).toISOString()})),A(this,"updateUser",t=>C),A(this,"getUser",t=>Promise.resolve({code:200,body:{id:"usqzgtgfake",attributes:[{key:"fullname",text:"Kiều Thanh"}]}})),A(this,"getAccountSetting",()=>this.apireq.get(`/accounts/${this.accid}/settings`)),A(this,"sendImpression",t=>C),A(this,"sendConversion",t=>C),this.FileURL=e,this.apireq=z.setBaseUrl(t).setContentType("text/plain").beforeHook(I).setParser("json")}setAgentId(t){this.agentid=t}setAuth(t){return this.accid=t.accid,this.mask=t.mask,this.uid=t.uid,{account_id:this.accid,id:"usqzgtgfake",attributes:[{key:"fullname",text:"Kiều Thanh"}]}}};function S(t,e,n,i){return{id:e,account_id:t,created:1610452894916,members:[{type:"user",id:n,membership:"active",invited_by:{id:n,type:"user"}},{type:"agent",id:i,conversation_id:e,membership:"active",invited_by:{id:n,type:"user"}}],ended:1610454875505,state:"ended",actived:1610453070259,last_message_sent:{id:"evqyiykaoizbwnkaecwphttwk",account_id:t,created:1616213311830,type:"message_sent",by:{id:n,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:e,text:"ok cám ơn!",format:"plaintext",integration_id:t+".subizv4.subikon",pongs:[{member_id:n,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 D=class{onEvent(){}onInterrupted(){}subscribe(){}stop(){}getStatus(){return"active"}reconnect(){}};function j(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var E=n(8193),T=n(2839),P=n(5672);P.defaults.path="/",P.expiresMultiplier=86400,P.defaults.expires=3650;let L=e();const N=p.A.Date.now(),F="chat_state_cycle_started_at",R=["lastview","light_convos","bot_run_logs","close_preview_at"];class W{constructor(t,e,n,i,r){if(j(this,"inmem",!1),j(this,"cookie",P),j(this,"getConnectionStatus",()=>this.connectionStatus),j(this,"_currentViewingProduct",{}),j(this,"new_visitor",!0),j(this,"matchUser",()=>{if(this.cache)return this._touchAcc(),this.cache.match("user")}),j(this,"suggest_addresses",t=>this.api.suggest_address(t)),j(this,"matchAccount",()=>this.cache.match("account")),j(this,"matchPaymentMethods",()=>this.cache.match("payment_methods")),j(this,"matchUnread",()=>{let t=this.matchUser();if(!t||!t.id)return;let e=this.matchConvo("*"),n=0;return p.A.map(e,e=>{p.A.isConvoSeen(e,t.id)||n++}),n}),j(this,"matchPlugin",()=>{if(this.is_embed_chat_mode){let t=this.cache.match("plugin");p.A.size(this.forcePlugins)>0&&(t=this.forcePlugins);let e=p.A.filter(t,(t,e)=>t&&"chatbox"===t.type);if(0===p.A.size(e))return void console.error("no chatbox found.");let n=p.A.find(e,t=>!!t);return n||(n=e[0]),n=p.A.cloneDeep(n),n.triggers=void 0,{[n.id]:n}}return p.A.size(this.forcePlugins)>0?p.A.cloneDeep(this.forcePlugins):p.A.cloneDeep(this.cache.match("plugin"))||{}}),j(this,"device",{}),j(this,"browserVisibility","visible"),j(this,"matchAgent",t=>{let e=this.cache.match("agent")||{};return"*"===t?e:e[t]}),j(this,"matchConvo",t=>{if(t)return"*"===t?(this._touchAcc(),p.A.filter(this.cache.all(),(t,e)=>e.startsWith("convo_")).concat(p.A.map(this.lightConvos))):t.startsWith("cslight")?this.lightConvos[t]:(this.isInsync(t)||this.fetchConvo(t),this.cache.match("convo_"+t))}),j(this,"fetchConvo",async t=>{if(t&&!t.startsWith("cslight")){if(this._die)return Z;await this.readyGate.entry(),await this.reconnectGate.entry(void 0,!0);try{if(this._die||this.isInsync(t))return;if(this.convoFetchAfter=this.convoFetchAfter||{},p.A.Date.now()<(this.convoFetchAfter[t]||0))return;this.convoFetchAfter[t]=p.A.Date.now()+15e3;let{body:e,error:n}=await this.api.getConversation(t);e&&!n&&this._setConvo(e)}catch(t){return{error:t}}finally{this.reconnectGate.open()}}}),j(this,"list_provinces",()=>this.api.list_provinces()),j(this,"list_districts",t=>this.api.list_districts(t)),j(this,"list_wards",t=>this.api.list_wards(t)),j(this,"outofmsgM",{}),j(this,"listEvents",t=>{if(t&&"*"!==t&&"string"==typeof t)return t.startsWith("cslight")?p.A.get(this.lightConvos,[t,"events"],[]):this.chain.listM(t)}),j(this,"fetchMoreEvents",(t,e=150)=>{if(this.historyRequests=this.historyRequests||new Map,this.historyRequests.has(t))return this.historyRequests.get(t);this.historyFailures=this.historyFailures||{};const n=this.historyFailures[t];if(n&&p.A.Date.now()<n.retryAt)return Promise.resolve({error:n.error});const i=this._fetchMoreEvents(t,e).then(e=>(e.error?this.historyFailures[t]={error:e.error,retryAt:p.A.Date.now()+15e3}:delete this.historyFailures[t],e)).finally(()=>{this.historyRequests.get(t)===i&&this.historyRequests.delete(t)});return this.historyRequests.set(t,i),i}),j(this,"syncConvoEvents",t=>{if(this._die||!t||t.startsWith("cslight"))return Promise.resolve({});if(this.messageSyncRequests=this.messageSyncRequests||new Map,this.messageSyncRequests.has(t))return this.messageSyncRequests.get(t);if(this.messageSyncNextAt=this.messageSyncNextAt||{},p.A.Date.now()<(this.messageSyncNextAt[t]||0))return Promise.resolve({skipped:!0});const e=this.chain,n=this._syncConvoEvents(t,e).then(n=>{if(e===this.chain&&!this._die){this.messageSyncFailures=this.messageSyncFailures||{};const e=n.error?Math.min((this.messageSyncFailures[t]||0)+1,4):0;this.messageSyncFailures[t]=e,this.messageSyncNextAt[t]=p.A.Date.now()+(e?15e3*2**(e-1):15e3)}return n}).finally(()=>{this.messageSyncRequests.get(t)===n&&this.messageSyncRequests.delete(t)});return this.messageSyncRequests.set(t,n),n}),j(this,"reloadConvoEvents",async t=>{await this.chain.reload(t,()=>[[],""]);let{error:e}=await this.chain.fetchMore(t,150,async(e,n,i)=>{let[r,o,s,a]=await this.listmessageapi(e,n,i);return a&&(this.outofmsgM[t]=!0),[r,o,s]});return{error:e}}),j(this,"_doFetchMsg",async(t,e=150)=>{let{error:n}=await this.chain.fetchMore(t,e,async(e,n,i)=>{if(this.outofmsgM[t])return[[],""];let[r,o,s,a]=await this.listmessageapi(e,n,i);return a&&(this.outofmsgM[t]=!0),[r,o,s]});return this.pubsub.publish("account"),{error:n}}),j(this,"matchLocation",()=>this.cache.match("location")||{}),j(this,"matchBot",()=>this.cache.match("bot")||{}),j(this,"readyGate",new p.A.Gate),j(this,"convoGate",new p.A.Gate(!0)),j(this,"reconnectGate",new p.A.Gate(!0)),j(this,"wsGate",new p.A.Gate(!0)),j(this,"matchLastview",()=>this.kv.match("lastview")||{}),j(this,"matchIsOpen",()=>!!this.kv.match("isopen")),j(this,"matchClosePreviewAt",()=>this.kv.match("close_preview_at")||0),j(this,"checkFormToken",(t,e)=>this.api.checkFormToken(t,e)),j(this,"submitForm2",(t,e,n)=>this.api.submitForm2(t,e,n)),j(this,"sendPresence",p.A.throttle(async()=>{if(this._track_page_view){if(this._die)return Z;if(await this.readyGate.entry(),p.A.get(this.cache.match("user"),"id")&&!p.A.isUserBanned(this.cache.match("user")))return"visible"===this.browserVisibility&&document.hasFocus()?void this.sendPageview():this.api.sendLostFocus()}},1e3,{leading:!1})),j(this,"now",()=>p.A.Date.now()+this.timeDiff),j(this,"seenQueue",[]),j(this,"matchTrafficSource",()=>this.kv.match("traffic_source")),j(this,"_alreadyReceived",{}),j(this,"_typing",p.A.throttle(t=>this.api.sendTyping(t),3e3,{trailing:!1})),j(this,"onConvoEvent",(t,e)=>this.pubsub.on2(t,"events",e)),j(this,"onWidgetClose",(t,e)=>this.pubsub.on2(t,"sbz_close_widget",e)),j(this,"onMessageUpdated",(t,e)=>this.pubsub.on2(t,"message_updated",e)),j(this,"seenConvo",t=>{t&&"create"!==t&&this.seenQueue.push(t)}),j(this,"onUpdate",(t,e)=>this.pubsub.on2(t,"account",e)),j(this,"onDestroyed",(t,e)=>this.pubsub.on2(t,"destroy",e)),j(this,"onConnection",(t,e)=>this.pubsub.on2(t,"connection",e)),j(this,"onResetCSS",(t,e)=>this.pubsub.on2(t,"resetCSS",e)),j(this,"onHighlight",(t,e)=>this.pubsub.on2(t,"highlight",e)),j(this,"closePreview",()=>this.kv.put("close_preview_at",(new p.A.Date).getTime())),j(this,"updateLastview",t=>{let e=this.cache.match("user")||{};if(!e.id)return;let n=this.matchLastview()||{},i={...n,...t,user_id:e.id};this.kv.put("lastview",i),this.pubsub.publish("lastview",i,n)}),j(this,"onLastview",(t,e)=>this.pubsub.on2(t,"lastview",e)),j(this,"timeDiff",0),this.connectionStatus="active",this.CONNECTION_CHECK_INTERVAL=3e3,this.reconnectTimestamp=0,this.g_sync={},this._die=!1,this.forceDevice=null,this.forcePlugins={},this.forceAcc={},this.forceChatbox={},this.RealtimeURL=n,this.fake=r,this.FileURL=e,this._track_page_view=!0,this.device_type="desktop",this.fake?this.api=new M(t,e):this.api=new g(t,e),!i)try{document.cookie,localStorage}catch(t){i=!0}i&&(this.inmem=i,this.cookie=O),H(),this.pubsub=new p.A.Pubsub,this.kv=new k(new v("sbz2023",this.inmem),"kv"),this.cache=new k(new v("sbz2023",!0),"kv"),this.chain=new y(new v("cbz2023",!0),"ch"),this.getLocaleContent=this.api.getLocaleContent,this.g_haveSentSeenM={},this.last_focused=this.now(),this._onBlur=()=>{this._die||(this.last_focused=this.now(),this.sendPresence())},this._onFocus=()=>{this._die||(this.last_focused=0,this.sendPresence())},this._onBeforeUnload=()=>{this._die||this.api.sendLostFocus()},window.addEventListener("blur",this._onBlur),window.addEventListener("focus",this._onFocus),window.addEventListener("beforeunload",this._onBeforeUnload),this._lastPresenceURL=window.location.href,this._urlCheckInterval=p.A.setInterval(()=>{if(this._die)return p.A.clearInterval(this._urlCheckInterval);this._lastPresenceURL!==window.location.href&&(this._lastPresenceURL=window.location.href,this.sendPresence())},2e3),this.doNotStartBot=()=>{this._donotstartbot=!0},this.autoStartBot=()=>{this._donotstartbot=!1},this.matchAutoStartBot=()=>!this._donotstartbot,this._presenceInterval1=p.A.setInterval(()=>{if(this._die)return p.A.clearInterval(this._presenceInterval1);"visible"===this.browserVisibility&&document.hasFocus()&&this.sendPresence()},2e4),this._presenceInterval2=p.A.setInterval(()=>{if(this._die)return p.A.clearInterval(this._presenceInterval2);"visible"===this.browserVisibility&&document.hasFocus()||this.last_focused&&this.now()-this.last_focused>18e5||this.sendPresence()},6e4),this._visibilityCleanup=function(t){var e="hidden";let n,i=document,r={};if(e in document)n="visibilitychange";else if((e="mozHidden")in document)n="mozvisibilitychange";else if((e="webkitHidden")in document)n="webkitvisibilitychange";else if((e="msHidden")in document)n="msvisibilitychange";else if("onfocusin"in document)r={onfocusin:document.onfocusin,onfocusout:document.onfocusout},document.onfocusin=document.onfocusout=o;else{i=window;for(const t of["onpageshow","onpagehide","onfocus","onblur"])r[t]=window[t],window[t]=o}function o(n){var i="visible",r="hidden",o={focus:i,focusin:i,pageshow:i,blur:r,focusout:r,pagehide:r};(n=n||window.event).type in o?t(o[n.type]):t(this[e]?"hidden":"visible")}return n&&i.addEventListener(n,o),void 0!==document[e]&&o({type:document[e]?"blur":"focus"}),()=>{n&&i.removeEventListener(n,o);for(const t of Object.keys(r))i[t]===o&&(i[t]=r[t])}}(t=>{this._die||(this.browserVisibility=t,this.sendPresence())}),this.loopTime(),this.device=this.getDeviceInfo(),this._gaInterval=p.A.setInterval(()=>{if(this._die)return;let t=this.cache.match("user")||{};if(!t.id)return;var e=this.getDeviceInfo();if(!e.ga_tracking_ids||!e.ga_client_id)return;p.A.clearInterval(this._gaInterval),this.device=e;let n=e.ga_client_id;n!==p.A.getUserAttr(t,"ga_client_id","text")&&this.setUser({attributes:[{type:"text",text:n,key:"ga_client_id"}]})},2e3),this.loopCheckConnectionStatus()}async loopCheckConnectionStatus(){for(;!this._die;){if(await p.A.sleep(this.CONNECTION_CHECK_INTERVAL),!this.realtime)continue;if(!this.realtime.getStatus||!this.realtime.reconnect)continue;this.connectionStatus;let t=this.connectionStatus;this.connectionStatus=this.realtime.getStatus(),t!==this.connectionStatus&&(console.log("publish connectionStatus",this.connectionStatus),this.pubsub.publish("connection")),"active"!==this.connectionStatus||!this._needsMessageSync&&"active"===t||(this._needsMessageSync=!1,this.syncKnownConvoEvents())}}syncKnownConvoEvents(){if(this._die)return Promise.resolve();if(this.knownConvoSyncRequest)return this.knownConvoSyncRequest;const t=this.chain,e=(async()=>{const e=p.A.filter(this.cache.all(),(t,e)=>e.startsWith("convo_"));for(const n of e){if(this._die||t!==this.chain)break;await this.syncConvoEvents(n.id)}})().finally(()=>{this.knownConvoSyncRequest===e&&(this.knownConvoSyncRequest=null)});return this.knownConvoSyncRequest=e,e}linkProduct(t){t?(t.id&&(this._currentViewingProduct.id=(t.id+"").trim()),t.source_id&&(this._currentViewingProduct.source_id=(t.source_id+"").trim()),t.sku&&(this._currentViewingProduct.sku=(t.sku+"").trim())):this._currentViewingProduct={}}getTrackPageview(){return this._track_page_view}setTrackPageview(t){this._track_page_view=!!t}getLinkedProduct(){return p.A.cloneDeep(this._currentViewingProduct)}isInsync(t){return p.A.Date.now()-(this.g_sync[t]||0)<6e5}async fetchShippingAddresses(){let t=await this.api.fetchShippingAddresses();if(t.error)return null;this.cache.put("shipping_address",t.body.shipping_addresses)}matchShippingAddresses(){return this.cache.match("shipping_address")}updateOrder(t){return this.api.updateOrder(t)}createShippingAddress(t){return this.api.createShippingAddress(t)}createTicket(t){return this.api.create_ticket(t)}overrideWelcomeMessage(t){p.A.map(this.lightConvos,(e,n)=>{e.last_message_sent&&(e.last_message_sent.data.message=t,e.last_message_sent.data.message.conversation_id=n);let i=p.A.get(e.events,"0");i.data.message=t,i.data.message.conversation_id=n,this.pubsub.publish("events",i)})}async overrideAcc(t){this.forceAcc=p.A.cloneDeep(t),await this.readyGate.entry(),this.reconnect()}async overrideBotId(t){this.forceBotId=t,await this.readyGate.entry()}async overrideChatbox(t){this.forceChatbox=t,await this.readyGate.entry(),await this.reconnect(),p.A.setTimeout(this.pubsub.publish("resetCSS"),10)}onShowMessageInfo(t){this.pubsub.publish("events",{type:"show_event_info",id:t})}getDeviceInfo(){let t={screen_resolution:window.screen.width+"x"+window.screen.height,source_referrer:document.referrer,platform:window.navigator.platform,language:navigator.language,page_url:document.URL,page_title:document.title},e=function(){if(!window.ga)return;if(!window.ga.getAll)return;var t=window.ga.getAll()||[];let e="";return t.forEach(function(t){e=t.get("clientId")}),e}();e&&(t.ga_client_id=e);let n=(i=[],window.ga&&window.ga.getAll?window.ga&&window.ga.getAll?((window.ga.getAll()||[]).forEach(function(t){var e=t.get("trackingId");e&&i.push(e)}),i):[]:i);var i;return n.length>0&&(t.ga_tracking_ids=n),t}highlight(t,e){this.pubsub.publish("highlight",t,e)}emitConvoEvent(t){this.pubsub.publish("events",t)}setAIDevMode(t){this.ai_dev_mode=t}setEmbebedChatMode(){this.is_embed_chat_mode=!0}isAIDevMode(){return this.ai_dev_mode}isEmbededChatMode(){return this.is_embed_chat_mode}overrideDeviceType(t){this.forceDevice=t,this.pubsub.publish("account")}isMobile(){return this.forceDevice?"mobile"===this.forceDevice:"mobile"==this.device_type||p.A.get(window,"screen.width",1e3)<576}isTablet(){return this.forceDevice?"tablet"===this.forceDevice:"tablet"==this.device_type}isDesktop(){return this.forceDevice?"desktop"===this.forceDevice:!this.isMobile()&&!this.isTable()}disconnect(t){this.g_sync[t]=0}pageLoaded(){return N}overridePlugin(t){if(this._die)return Z;if(!Array.isArray(t))throw"plugins must be be an array";let e={};p.A.map(t,function(t){e[t.id]=t}),this.forcePlugins=e,this.pubsub.publish("account"),this.pubsub.publish("resetCSS")}markSync(t){this.g_sync[t]=p.A.Date.now()}async _touchAcc(){this.isInsync("account")||(await this.readyGate.entry(),this.isInsync("account")||this.refreshAccount())}refreshAccount(){if(!(this._die||p.A.Date.now()<(this.accountRefreshAfter||0)))return this.accountRefreshAfter=p.A.Date.now()+3e4,this.reconnect()}async _fetchMoreEvents(t,e=150){if(!t||t.startsWith("cslight"))return{};await this.readyGate.entry(),await this.reconnectGate.entry(void 0,!0);try{if(this._die)return Z;!this.isInsync("events"+t)&&(this.chain.anchorCache[t]="",delete this.outofmsgM[t]);const n=await this._doFetchMsg(t,e);return n.error||this.markSync("events"+t),n}catch(t){return{error:t}}finally{this.reconnectGate.open()}}async _syncConvoEvents(t,e){await this.readyGate.entry(),await this.reconnectGate.entry(void 0,!0);try{if(this._die||e!==this.chain)return Z;this.messageSyncTimes=this.messageSyncTimes||{},this.messageSyncProgress=this.messageSyncProgress||{};let n=this.messageSyncProgress[t];if(!n){const i=Object.values(e.listM(t)),r=this.messageSyncTimes[t]||i.reduce((t,e)=>Math.min(t,p.A.getMs(e.created)),1/0);n=this.messageSyncProgress[t]={boundary:r,anchor:"",newest:0,visited:new Set}}for(let i=0;i<5;i++){const i=(this.nextMessageSyncRequestAt||0)-p.A.Date.now();if(i>0&&await p.A.sleep(i),this._die||e!==this.chain)return Z;this.nextMessageSyncRequestAt=p.A.Date.now()+250;const[r,o,s,a]=await this.listmessageapi(t,n.anchor,150);if(this._die||e!==this.chain)return Z;if(s)return{error:s};e.merge(t,r);for(const t of r)n.newest=Math.max(n.newest,t.index);if(this.pubsub.publish("account"),a||!r.length||r.some(t=>t.index<n.boundary))return n.newest&&(this.messageSyncTimes[t]=n.newest),delete this.messageSyncProgress[t],{};if(n.visited.add(n.anchor),!o||n.visited.has(o))return delete this.messageSyncProgress[t],{error:"message_cursor_stalled"};n.anchor=o}return{pending:!0}}catch(t){return{error:t}}finally{this.reconnectGate.open()}}async init(t,e,n,i){if(this.g_sync={},"undefined"!=typeof sbz_info&&(sbz_info.store_0=!0),i&&i.use_subdomain_cookie||window&&window.location&&window.location.hostname&&(P.defaults.domain="."+window.location.hostname),"undefined"!=typeof sbz_info&&(sbz_info.store_1=!0),!n){try{n=this.cookie.get("__sbref","")}catch(t){}if("undefined"!=typeof sbz_info&&(sbz_info.store_2=!0),!n){if(!e)try{e=this.cookie.get("__sbmask","")}catch(t){}e?(e.split("@")[0]!=t&&(n=p.A.randomString(40),this.new_visitor=!0),this.new_visitor=!1,this.cookie.set("__sbmask",e)):(n=p.A.randomString(40),this.new_visitor=!0)}}return"undefined"!=typeof sbz_info&&(sbz_info.store_3=!0),this.cookie.get("__sbref",n)!=n&&(G(),this.clearBrowserData()),"undefined"!=typeof sbz_info&&(sbz_info.store_4=!0),this.api.setAuth({accid:t}),"undefined"!=typeof sbz_info&&(sbz_info.store_5=!0),n&&this.cookie.set("__sbref",n),"undefined"!=typeof sbz_info&&(sbz_info.store_6=!0),this._initResource(t,{accid:t,mask:e,ref:n},{account_id:t,user_ref:n,user_mask:e})}standardlizeLastview(){let t=this.kv.match("lastview")||{},e=this.cache.match("user")||{};if(e.id||(t={}),t.user_id!=e.id&&(t={}),t.screen||(t.screen="preview","list"!==t.view&&"chat"!==t.view||(t.screen="widget")),this.isMobile()){t.screen="preview";let e=this.matchPlugin()||{},n=p.A.find(e,t=>"chatbox"===t.type)||{};p.A.get(n,"chatbox.greeting.mobile_disabled")&&(t.screen="button")}this.kv.put("lastview",t)}resetChatStateIfExpired(){const t=this.now(),e=this.kv.match(F);return!Number.isFinite(e)||e<=0||e>t?(this.kv.put(F,t),!1):!(t-e<864e5||(p.A.map(R,t=>this.kv.del(t)),this.kv.put(F,t),0))}async _initResource(t,e,n){this.g_sync={};let i=await this.api.setAuth(e);if("undefined"!=typeof sbz_info&&(sbz_info.store_7=!0),i.error)return console.error(i),i;this.readyGate.close(),t=(t||"").trim(),this.resetChatStateIfExpired();let r=this.kv.match("light_convos")||{};return this.lightConvos={},p.A.map(r,e=>{if("widget"===e.light_type&&(e.account_id!==t||e.initial_by!==i.id))return;let n=e.created>p.A.Date.now()-6048e5,r=p.A.filter(e.events,t=>"message_sent"===t.type),o=p.A.map(r,t=>p.A.get(t,"data.message")||{});o=p.A.filter(o,t=>!p.A.isEmptyMessage(t)),n&&p.A.size(o)&&(this.lightConvos[e.id]=e)}),this.cache=new k(new v("sbz2023",!0),"kv"),this.realtime&&this.realtime.stop(),this.fake?this.realtime=new D:this.realtime=new T(this.RealtimeURL,n,q,t),this.realtime.onEvent(this.onWs.bind(this)),this.realtime.onInterrupted(async()=>{this._die||(this._needsMessageSync=!0,await this.reconnectWs(t,i.id),await this.refreshAccount())}),"undefined"!=typeof sbz_info&&(sbz_info.store_8=!0),this.seenLoop(),"undefined"!=typeof sbz_info&&(sbz_info.store_9=!0),await this.reconnect({user:i}),this.standardlizeLastview(),"undefined"!=typeof sbz_info&&(sbz_info.store_10=!0),this.readyGate.open(),this.reconnectWs(t,i.id),i}async login(t,e,n){return this._die?Z:(G(),this.clearBrowserData(),this.new_visitor=!1,this._initResource(t,{accid:t,profile_id:e,tokenGenerator:n},{getAccessToken:()=>this.api.token_generator()}))}logout(t){return this.api.setAuth({ref:t})}seenLoop(){this.seenQueue=[],p.A.clearInterval(this._seenInterval),this._seenInterval=p.A.setInterval(()=>{if(this._die)return p.A.clearInterval(this._seenInterval);if(!this.cache)return;this.seenQueue=[...new Set(this.seenQueue)];let t=this.cache.match("user")||{};p.A.map(this.seenQueue,e=>{var n=this.listEvents(e);if(!n)return;if(0===p.A.size(n))return;var i=(n=p.A.filter(n,t=>"message_sent"===t.type))[p.A.size(n)-1];if(!i)return;if(this.g_haveSentSeenM[i.id])return;if(i.id===i.source_event_id)return;if(this.pubsub.publish("events",{created:this.now(),type:"message_pong",by:{type:"user"},data:{message:{conversation_id:e,id:"*",pongs:[{type:"seen",created:this.now()}]}}}),e.startsWith("cslight")){let t=this.lightConvos[e],n=this.matchUser();if(!t)return;let r=p.A.find(t.members,t=>"user"==t.type&&t.id==n.id);return r&&(r.seen_at=this.now()),this.kv.put("light_convos",this.lightConvos),void(this.g_haveSentSeenM[i.id]=!0)}this.api.markAsSeen(e,i.id);let r=this.cache.match("convo_"+e)||{},o=p.A.find(r.members,e=>e.id===t.id);o&&(o.seen_at=this.now()),this._setConvo(r),this.g_haveSentSeenM[i.id]=!0}),this.seenQueue=[]},1e3)}async reconnectWs(t,e){await this.realtime.subscribe([`conversation_state_updated.account.${t}.user.${e}`,`conversation_joined.account.${t}.user.${e}`,`conversation_typing.account.${t}.user.${e}`,`message_sent.account.${t}.user.${e}`,`message_pong.account.${t}.user.${e}`,`conversation_rating_requested.account.${t}.user.${e}`,`conversation_rated.account.${t}.user.${e}`,`conversation_events.account.${t}.user.${e}`]),await this.readyGate.entry()}reconnect(t){if(this.reconnectRequest)return this.reconnectRequest;const e=this._reconnect(t).finally(()=>{this.reconnectRequest===e&&(this.reconnectRequest=null)});return this.reconnectRequest=e,e}async _reconnect(t){if(!this._die){await this.reconnectGate.entry(void 0,!0);try{let e=t&&t.user?Promise.resolve({body:t.user}):this.api.getUser(),n=await Promise.all([e,this.api.getAccountSetting({bot_id:this.forceBotId})]),i=p.A.find(n,t=>t.error);if(i)return i;let r=n[1].body;r.user=n[0].body,await this._setSetting(r);let o=await this.api.listConversations();i=o.error;let s=o.body;if(!i){let t=p.A.get(s,"conversations",[]);p.A.map(this.cache.all(),(t,e)=>{e.startsWith("convo_")&&this.now()-p.A.getMs(p.A.get(t,"actived"))>12096e5&&this.cache.del(e)}),p.A.map(t,t=>this._setConvo(t))}if(i)return{error:i};this.markSync("account")}catch(t){return{error:t}}finally{this.reconnectGate.open()}}}async submitWebsiteForm(t,e){await this.readyGate.entry();const n=$(this.api,t),i=this.kv,r=p.A.cloneDeep(e.values),o=function(t){const e=t&&t.body,n=t&&t.error||e&&e.error,i=t&&t.code,r=e&&"string"==typeof e.conversation_id&&e.conversation_id&&"string"==typeof e.submission_id&&e.submission_id;if(n||!(i>=200&&i<300)||!r){const t=new Error("Subiz form request failed");throw t.code=n&&n.code||"form_request_failed",t.status=i,t}return e}(await this.api.submitWebsiteForm(t,e));try{i.put(n,{conversation_id:o.conversation_id,values:r,expires_at:p.A.Date.now()+6048e5})}catch(t){}return o}getFormStatus(t){const e=$(this.api,t);try{const t=this.kv.match(e);return t?Number.isFinite(t.expires_at)&&"string"==typeof t.conversation_id&&t.conversation_id?t.expires_at<=p.A.Date.now()?(this.kv.del(e),{submitted:!1,status:"expired"}):{submitted:!0,status:"found",conversation_id:t.conversation_id,values:Array.isArray(t.values)?p.A.cloneDeep(t.values):[]}:(this.kv.del(e),{submitted:!1,status:"not_found"}):{submitted:!1,status:"not_found"}}catch(t){return{submitted:!1,status:"storage_unavailable"}}}async submitForm(t,e,n){return await this.readyGate.entry(),n&&await this.setUser(n),this.api.submitForm(t,document.URL,this.device,e,n)}async setUser(t){if(t)return await this.readyGate.entry(),this._setUser(t),this.api.updateUser(t)}async setUserDiff(t){if(!t)return;await this.readyGate.entry();let e=await this.api.updateUser(t);e&&200==e.code&&e.body.id&&this._setUser(e.body)}_setUser(t){t=p.A.cloneDeep(t);let e=this.cache.match("user")||{};var n=e.account_id||t.account_id,i=e.id||t.id;p.A.each(t.attributes,t=>{t&&(e.attributes=p.A.filter(e.attributes,e=>!!e&&e.key!==t.key))}),e.attributes=e.attributes||[],e.attributes=e.attributes.concat(t.attributes),e.account_id=n,e.id=i,this.cache.put("user",e),this.pubsub.publish("account")}async setSetting(t){if(t)return await this.readyGate.entry(),this._setSetting(t)}async _setSetting(t){(t=p.A.cloneDeep(t)||{}).account=Object.assign({},t.account,this.forceAcc),t.account.logo_url||(t.account.logo_url="https://vcdn.subiz-cdn.com/widget-v4/public/assets/img/default_logo.dd13a2b.svg"),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 e=p.A.get(t,"location",[]);this.cache.put("location",e);let n=p.A.get(t,"bots",[]),i={};p.A.map(n,t=>{i[t.id]=t}),this.cache.put("bot",i),this.device_type=t.device_type||"desktop";let r=p.A.get(t,"plugins",[]),o={};p.A.map(r,t=>{"chatbox"===t.type&&(t=p.A.merge(t,this.forceChatbox)),o[t.id]=t}),this.cache.put("plugin",o);var s=p.A.get(t,"agents",[]);if(p.A.size(s)>0){let t={};this.api.setAgentId(s[0].id),p.A.map(s,e=>{t[e.id]=e}),this.cache.put("agent",t)}let a=p.A.get(t,"payment_methods",[]);this.cache.put("payment_methods",a),this.pubsub.publish("account")}async sendPageview(t){t||(t={});let e=Object.assign({},this.device);return t.referrer&&(e.source_referrer=t.referrer),e.page_url=t.url||location.href,e.page_title=t.title||document.title,this.api.sendContentView(e,t.url||location.href,t.title||document.title,this._currentViewingProduct.id,this._currentViewingProduct.source_id,this._currentViewingProduct.sku)}async track(t){if(!t){let t=await this.sendPageview(),e=p.A.get(t,"body.by.device.source","");return e&&this.kv.put("traffic_source",e),t}return"object"==typeof t&&(t.data||(t.data={})),this.api.sendEvent(t)}async onWs(t){await this.wsGate.entry(void 0,!0);try{await this._onWs(t)}catch(t){return console.error(t),{error:t}}finally{this.wsGate.open()}}async _onWs(t){if(this._die)return;if(!t||!t.type)return;if("form"===p.A.get(t,"touchpoint.channel")||"form"===p.A.get(t,"data.conversation.touchpoint.channel"))return;if(t.created=p.A.getMs(t.created),"user_info_updated"===t.type)return;if("message_deleted"===t.type)return void this.pubsub.publish("message_updated",t);let e,n=this.cache.match("user")||{},i=p.A.convoOfEv(t),r=!1;if(i&&!i.startsWith("cslight")&&(e=this.cache.match("convo_"+i),!e||!e.id)){let{body:t,error:n}=await this.api.getConversation(i);if(!t)return;e=t,r=!0,this._setConvo(e)}if(i&&i.startsWith("cslight")){if(e=this.lightConvos[i],!e)return;return e.events.push(t),e.last_message_sent=t,this.kv.put("light_convos",this.lightConvos),void this.pubsub.publish("events",t)}if(e){if(this.pubsub.publish("events",t),"conversation_joined"===t.type){let n=p.A.get(t,"data.conversation.members",[]);if(p.A.find(n,t=>t.id===this.cache.match("user").id)&&!r){let{body:t}=await this.api.getConversation(i);t&&(e=t,this._setConvo(e)),this.pubsub.publish("account")}}return"message_sent"===t.type&&p.A.get(t,"by.id")!==n.id&&(this._alreadyReceived[t.id]||(this._alreadyReceived[t.id]=!0,this.api.markAsReceived(i,t.id))),p.A.startsWith(t.type,"message_")||p.A.startsWith(t.type,"conversation_")?(await this.restConvoEvent(t),void("message_sent"===t.type&&p.A.get(t,"by.id")!==n.id&&B("SUBIZ Chat","Received","User"))):void 0}}async restConvoEvent(t){let e=this.cache.match("user"),n=p.A.convoOfEv(t),i=this.cache.match("convo_"+n)||{};if("conversation_state_updated"===t.type){if(!p.A.get(i,"id")){let{body:t,error:e}=await this.api.getConversation(n);if(e)return}i=Object.assign(i,p.A.get(t,"data.conversation"))}if("message_pong"===t.type){var r=p.A.get(t,"data.message.id"),o=this.chain.match(n,r);if(!p.A.get(o,"data.message"))return;var s=p.A.get(o,"data.message.pongs",[]);let a=p.A.get(t,"data.message.pongs",[])||[];if(s=s.concat(a),1===a.length){let t=a[0].type;"like"!==t&&"remove_dislike"!==t||(s=s.filter(t=>"dislike"!==t.type)),"dislike"!==t&&"remove_like"!==t||(s=s.filter(t=>"like"!==t.type))}o.data.message.pongs=s,p.A.map(s,t=>{if(t.member_id==e.id&&"seen"===t.type){let n=p.A.find(i.members,t=>t.id===e.id);n&&(n.seen_at=t.created)}}),this.chain.put(n,o.id,p.A.getMs(o.created),o),this.pubsub.publish("events",o)}if("message_pong"!==t.type&&"conversation_typing"!==t.type){if("message_sent"===t.type){let e=p.A.get(t,"source_event_id"),r=p.A.find(this.listEvents(n),t=>t.id===e);r&&(this.chain.del(n,r.id),t.created=r.created),i.last_message_sent=t}this.chain.put(n,t.id,p.A.getMs(t.created),t)}this._setConvo(i),this.pubsub.publish("account")}emitCloseWidgetEvent(){this.pubsub.publish("sbz_close_widget",{type:"chatbox_closed"})}typing(t){t&&(t.startsWith("cslight")||this._typing(t))}deleteLightConvo(t){delete this.lightConvos[t],this.kv.put("light_convos",this.lightConvos)}startWidgetConvo(t,e){const n=this.matchUser(),i=p.A.find(this.lightConvos,t=>"widget"===t.light_type&&t.account_id===n.account_id&&t.initial_by===n.id);if(i)return{convo:i};const r="cslightwidget_"+p.A.randomString(24),o=p.A.cloneDeep(t);o.data.message.conversation_id=r;const s={id:r,account_id:n.account_id,initial_by:n.id,locale:e,light_type:"widget",state:"pending",created:o.created,members:[{id:n.id,type:"user",seen_at:o.created+1}],events:[o],last_message_sent:o,touchpoint:{id:r,channel:"subiz",source:"web"}};return this.lightConvos[r]=s,this.kv.put("light_convos",this.lightConvos),this.pubsub.publish("account"),{convo:s}}promoteWidgetConvo(t,e){this.widgetConvoOrigins=this.widgetConvoOrigins||{},this.widgetConvoOrigins[e]=t;const n=p.A.cloneDeep(p.A.get(this.lightConvos,[t,"events",0]));n&&(n.source_event_id=n.id,n.data.message.conversation_id=e,this.chain.merge(e,[{id:n.id,index:n.created,value:n}])),this.deleteLightConvo(t)}startLightConvo(t,e,n,i,r){let o="cslight"+t+"_"+this.now(),s=this.cache.match("user")||{},a=this.lightConvos[o];if(a)return{convo:a};let l=this.now(),c={},d=p.A.map(e,(e,n)=>{let i={};return i.created=l,i.event_time=l,i.id="evfake"+l+n,i.type="message_sent",i.by={id:t,type:"bot"},i.data={message:e},i.data.message.conversation_id=o,c=i,i}),h={id:o,locale:n,initial_by:t,created:l,actived:l,last_message_sent:c,members:[{type:"user",id:s.id},{type:"bot",id:t,membership:"active"}],state:"active",touchpoint:{id:o,channel:"subiz",source:"web"},traffic_source:"direct",events:d,is_testing:i,bot_versio:r};return this.lightConvos[o]=h,this.kv.put("light_convos",this.lightConvos),this.pubsub.publish("events",c),{convo:h}}async startConvo(t){t||(t={}),await this.readyGate.entry(),this.convoGate.close(),t.source||(t.source=document.location.href);let{body:e,error:n}=await this.api.start(t);return this.convoGate.open(),n?{error:n}:(this._setConvo(e),{convo:e})}fetchOrder(t){return this.api.getOrder(t)}lookupOrder(t){return this.api.lookupOrder(t)}createPostback(t,e){if(!t||!t.startsWith("cslight"))return this.api.createPostback(t,e)}sendReaction(t,e){if(!t||!t.startsWith("cslight"))return this.api.sendConvoEvent(t,e)}async sendConvoEvent(t,e,n){await this.readyGate.entry();var i=p.A.randomString(36),r={id:i,by:{id:(this.cache.match("user")||{}).id,type:"user",device:this.device},data:n,type:e,created:this.now()};p.A.convoToEv(t,r);let o=[];"message_sent"===e&&(r.source_event_id=i,r.data.message.conversation_id=t,await E.map(r.data.message.attachments,2,async(t,e)=>{var n;if("file"===t.type&&t._file&&(o.push(t),U.includes(t._file.type))){let{width:e,height:i,url:r}=await(n=t._file,new Promise(t=>{var e=new window.FileReader;e.onload=e=>{let n=e.target.result,i=new Image;i.onload=()=>{t({url:n,width:i.width,height:i.height})},i.src=n},e.readAsDataURL(n)}));t.url=r,t.width=e,t.height=i}})),this.onWs(r),await this.convoGate.entry();const s=await async function(t,e){let n,i;for(const r of t)try{const t=await e(r._file);if(t.body&&"invalid_field_size"===t.body.code&&(i="cannot_send_too_big_file"),t.error||!t.url){n=n||t.error||"upload_failed";continue}r.url=t.url}catch(t){n=n||t}return{error:n,errorMessage:i}}(o,t=>this.api.uploadToS3(t));if(r._error=s.error,s.errorMessage&&(r._error_message=s.errorMessage),r._error)return this.onWs(r);if(t&&t.startsWith("cslight"))return;let{body:a,error:l}=await this.api.sendConvoEvent(t,r);return l?(r._error=l,void this.onWs(r)):(this.onWs(a),B("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",this.now()),a)}_setConvo(t){this.cache.match("user");let e=p.A.get(t,"touchpoint.channel","");if(e&&"subiz"!=e)return;let n={};if(p.A.map(this.cache.all(),(t,e)=>{e.startsWith("convo_")&&(n[e]=t)}),p.A.size(n)>18){n=p.A.orderBy(p.A.map(n),"created","desc");for(var i=18;i<p.A.size(n);i++){let t=n[i];this.cache.del("convo_"+t.id)}}this.markSync(t.id),this.pubsub.publish("account"),this.cache.put("convo_"+t.id,t)}matchLastPluginRun(t){return(this.kv.match("plugin_run_logs")||{})[t]}matchLastBotRun(t){return(this.kv.match("bot_run_logs")||{})[t]}logBotRun(t){let e=this.kv.match("bot_run_logs")||{};e[t]={bot_id:t,created:this.now()},this.kv.put("bot_run_logs",e)}sendImpression(t){let e=this.cache.match("user")||{},n=this.kv.match("plugin_run_logs")||{};return n[t]={web_plugin_id:t,created:this.now()},this.kv.put("plugin_run_logs",n),this.api.sendImpression({account_id:e.account_id,campaign_id:t,web_plugin_id:t,user_id:e.id,url:window.location.href,device:this.device})}sendConversion(t,e,n){let i=this.cache.match("user")||{},r={account_id:i.account_id,user_id:i.id,fields:e},o=this.kv.match("conversions")||{};return o[t]=!0,this.kv.put("conversions",o),this.api.sendConversion({account_id:i.account_id,web_plugin_id:t,campaign_id:t,user_id:p.A.get(i,"id"),url:window.location.href,device:this.device,submission:r,impression_token:n})}isConverted(t){return(this.kv.match("conversions")||{})[t]}async listmessageapi(t,e,n){let i=t;if(i&&i.startsWith("cslight"))return[p.A.map(this.listEvents(i),t=>({id:t.id,index:t.created,value:t})),"",void 0,!0];let{body:r,code:o,error:s}=await this.api.listMessages(i,-n,e);if(s||200!==o)return[[],e,s||"message_fetch_failed"];e=p.A.get(p.A.last(r),"id"),r=p.A.map(r,t=>(t.created=p.A.getMs(t.created),{id:t.id,index:t.created,value:t}));let a=this.cache.match("user")||{};for(let t=0;t<r.length;t++){let e=r[t].value;if("message_sent"===e.type&&p.A.get(e,"by.id")!==a.id){if(p.A.find(p.A.get(e,"data.message.pongs"),t=>t.member_id===a.id))break;this._alreadyReceived[e.id]||(this._alreadyReceived[e.id]=!0,this.api.markAsReceived(i,e.id));break}}return[r,e,void 0,p.A.size(r)<n]}async loopTime(){if(this._die)return;let t=this.now();if(!this.cache||!p.A.get(this.cache.match("user"),"id"))return this._timeTimeout=p.A.setTimeout(()=>this.loopTime(),24e4);let{body:e,error:n}=await this.api.time();if(!this._die){if(n)return this._timeTimeout=p.A.setTimeout(()=>this.loopTime(),3e4);var i=Math.abs(this.now()-t)/2,r=new p.A.Date(e).getTime()+i,o=this.now();this.timeDiff=Math.floor(r-o),this._timeTimeout=p.A.setTimeout(()=>this.loopTime(),24e4)}}replaceFileUrl(t){return t?p.A.startsWith(t,"/")||p.A.startsWith(t,"data:")?t:(p.A.startsWith(t,"http://")||p.A.startsWith(t,"https://")||p.A.startsWith(t,"//")||(t=p.A.trim(this.FileURL,"/")+"/"+p.A.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(){p.A.each(this.cookie.all(),(t,e)=>{(e||"").startsWith("__sb")&&this.cookie.remove(e)}),this.kv&&this.kv.destroy(),this.kv=new k(new v("sbz2023",this.inmem),"kv"),this.chain&&this.chain.destroy(),this.chain=new y(new v("cbz2023",!0),"ch"),this.outofmsgM={},this.messageSyncTimes={},this.messageSyncNextAt={},this.messageSyncFailures={},this.messageSyncProgress={},this.accountRefreshAfter=0,this.historyFailures={},this.convoFetchAfter={},this.realtime&&this.realtime.stop(),this.cache&&this.cache.destroy(),this.pubsub.publish("destroy")}isDead(){return this._die}destroy(){this._die||(this._die=!0,this.clearBrowserData(),p.A.clearInterval(this._seenInterval),p.A.clearInterval(this._urlCheckInterval),p.A.clearInterval(this._presenceInterval1),p.A.clearInterval(this._presenceInterval2),p.A.clearInterval(this._gaInterval),p.A.clearTimeout(this._timeTimeout),this.realtime&&this.realtime.stop(),this.readyGate&&this.readyGate.close(),window.removeEventListener("blur",this._onBlur),window.removeEventListener("focus",this._onFocus),window.removeEventListener("beforeunload",this._onBeforeUnload),this._visibilityCleanup&&this._visibilityCleanup(),this.pubsub.clear())}}const U=["image/gif","image/jpeg","image/png","image/svg+xml"],O={data:{},get(t,e){return this.data[t]||e},set(t,e){return this.data[t]=t},all(){return this.data},remove(t){delete this.data[t]}};function B(t,e,n){document.dispatchEvent(new CustomEvent("subiz",{detail:{category:t,action:e,label:n}})),function(t,e,n){window.sbz_no_gtag?console.log("SKIPSENT.",t,e,n):((window.dataLayer||[]).push({event:t,event_action:e,event_label:n}),window.gtag&&window.gtag("event",t,{Action:e,Label:n}),window.ga&&window.ga.getAll&&(window.ga.getAll()||[]).forEach(function(i){const r=i.get("name");window.ga(r+".send","event",t,e,n)}))}(t,e,n),function(t,e,n){window.fbq&&window.fbq("trackCustom",t,{action:e,label:n})}(t,e,n)}let H=()=>{try{localStorage}catch(t){return}p.A.setTimeout(()=>{for(var t in localStorage)t&&(t.startsWith("cbz2020")||t.startsWith("sbz2020"))&&(localStorage.removeItem(t),L.removeItem(t))})},G=()=>{try{localStorage}catch(t){return}p.A.setTimeout(()=>{for(var t in localStorage)t&&(t.startsWith("cbz2020")||t.startsWith("sbz2020")||t.startsWith("sbz2022")||t.startsWith("sbz2023"))&&(localStorage.removeItem(t),L.removeItem(t))})};var q=function(t,e,n,i){if(void 0===p.A.XMLHttpRequest)return function(t,e,n,i){let r={};n&&(r["content-type"]="text/plain"),fetch(e,{method:t,headers:r,body:n}).then(t=>t.text().then(e=>i&&i(e,t.status))).catch(t=>i&&i(t,-1))}(t,e,n,i);var r=new p.A.XMLHttpRequest;r.onreadystatechange=function(t){4===r.readyState&&(i&&i(r.responseText,r.status),i=void 0)},r.onerror=function(){i&&i(r.responseText,-1),i=void 0},r.open(t,e),n&&r.setRequestHeader("content-type","text/plain"),r.send(n)};const Z=new Error("sdk unloaded");function $(t,e){return"sbz_form_submitted:"+p.A.stringify([t.accid,t.uid,e])}var V=n(2840),J=n(172),Y=n(2959),Q=n(7072),X=n(1108);const K=n(4218);let tt=r();class et extends V.Mw{constructor(t){super(t),this.state={hasPreviewDom:!1,previewExtraCls:"hidden",previewEvent:{},ready:!1},this.readyGate=new p.A.Gate,this.prepareButtonImage(),this.props.store.onUpdate(this,t=>this.forceUpdate()),this.props.store.onConvoEvent(this,t=>{if("message_sent"!==p.A.get(t,"type"))return;let e=p.A.get(t,"by.type");if("system"!==e&&"agent"!==e&&"bot"!==e)return;let n=p.A.get(t,"data.message")||{};if(p.A.isEmptyMessage(n))return;let i=p.A.get(this.props.store.matchLastview(),"screen"),r=p.A.get(this.props.store.matchLastview(),"minimized");if("widget"!==i&&!(r&&Date.now()-r<nt)){if(this.props.store.isMobile()&&p.A.get(this.props.plugin,"chatbox.greeting.mobile_disabled"))return this.props.store.updateLastview({screen:"button",previewEvent:t}),void this.forceUpdate();if("acsbdpjwipneldivgwcr"===p.A.get(this.props.store.matchAccount(),"id")){let e=p.A.convoOfEv(t);e&&this.props.onNewMessageShowWidget&&this.props.onNewMessageShowWidget(e)}else this.props.store.updateLastview({screen:"preview",previewEvent:t});this.forceUpdate()}}),this.props.store.onLastview(this,()=>{let t=p.A.get(this.props.store.matchLastview(),"screen"),e=p.A.get(this.props.store.matchLastview(),"previewEvent")||{};"preview"===t&&p.A.size(e)>0?this.makeAnimateShowPreview(e):this.makeAnimateHidePreview()}),this.loadGreeting()}fixMissingSetting(t){return t=p.A.cloneDeep(t),p.A.get(t,"desktop_button.background_image_url")&&(t.desktop_button.background_image_url=this.props.store.replaceFileUrl(t.desktop_button.background_image_url)),p.A.get(t,"desktop_button.background_mask_url")&&(t.desktop_button.background_mask_url=this.props.store.replaceFileUrl(t.desktop_button.background_mask_url)),p.A.get(t,"mobile_button.background_image_url")&&(t.mobile_button.background_image_url=this.props.store.replaceFileUrl(t.mobile_button.background_image_url)),p.A.get(t,"mobile_button.background_mask_url")&&(t.mobile_button.background_mask_url=this.props.store.replaceFileUrl(t.mobile_button.background_mask_url)),t}render(){let t=this.props.plugin.chatbox,e=p.A.get(t,"desktop_button.position")||"right";if(this.props.store.isMobile()&&(e=p.A.get(t,"mobile_button.position")||e,p.A.get(t,"mobile_button.hidden")))return null;if(p.A.get(t,"desktop_button.hidden"))return null;let n="widget-layout widget-layout--"+e;return this.props.isShow||(n+=" widget-layout--hidden"),(0,J.h)("div",{class:n},this.renderPreview(),this.renderButton())}pickBestGreeting(){let t=this.props.store.matchConvo("*"),e=p.A.filter(t,t=>!p.A.isConvoSeen(t,this.props.store.matchUser().id)).sort((t,e)=>p.A.get(e,"last_message_sent.created",0)-p.A.get(t,"last_message_sent.created",0));if(0==p.A.size(e)){if(this.props.store.isMobile()&&"acqjeefqeaoiagyfprap"===p.A.get(this.props.plugin,"chatbox.account_id",{}))return;let t=p.A.get(this.props.plugin,"chatbox.greeting",{}),e=this.props.store.matchAgent("*"),n=t.agent_id;n||(n=function(t){var e=p.A.filter(t,t=>"agent"===t.type);return e[Math.floor(Math.random()*p.A.size(e))]||{}}(e).id);let i=this.props.t.i18n(p.A.get(t,"greeting",{}))||t.message;return i?{by:{id:n,type:"agent"},data:{message:{text:i,format:"plaintext"}}}:{}}return e[0].last_message_sent}showPreview(t){this.props.store.updateLastview({screen:"preview",previewEvent:t})}async makeAnimateShowPreview(t){await this.readyGate.entry();let e=this.getAgentOfPreviewEvent(t);if(await p.A.preloadImg(e.avatar_url),this.state.hasPreviewDom)return this.setState({previewExtraCls:"hidden"}),this._animateTimeout&&clearTimeout(this._animateTimeout),void(this._animateTimeout=setTimeout(()=>{this.setState({previewExtraCls:"",previewEvent:t})},200));this.setState({hasPreviewDom:!0,previewExtraCls:"hidden",previewEvent:{}}),this._animateTimeout&&clearTimeout(this._animateTimeout),this._animateTimeout=setTimeout(()=>{this.setState({previewExtraCls:"",previewEvent:t})},200)}makeAnimateHidePreview(){this._animateTimeout&&clearTimeout(this._animateTimeout),this.setState({previewExtraCls:"hidden"}),this._animateTimeout=setTimeout(()=>{this.setState({hasPreviewDom:!1,previewEvent:{}})},200)}ShowGreeting(){let t=this.pickBestGreeting();this.showPreview(t)}HideGreeting(){this.props.store.updateLastview({screen:"button",minimized:Date.now(),previewEvent:{}})}loadGreeting(){let t=p.A.get(this.props.store.matchLastview(),"minimized");if("preview"!==p.A.get(this.props.store.matchLastview(),"screen"))return;if(t&&Date.now()-t<nt)return;let e=p.A.get(this.props.store.matchLastview(),"previewEvent")||{};if(p.A.size(e)>0)return void this.showPreview(e);let n=this.props.plugin.chatbox,i=p.A.get(n,"greeting",{}),r=this.props.t.i18n(p.A.get(i,"greeting",{}))||i.message,o=i.enabled,s=this.props.store.isMobile()&&i.mobile_disabled;r&&o&&!s&&this.ShowGreeting()}onClick(){let t=this.props.store.matchLastview();return p.A.get(t,"view")&&("list"!==t.view||p.A.size(this.props.store.matchConvo("*"))>0)&&("chat"!=t.view||p.A.get(t,"opts.cid"))?this.props.onClick&&this.props.onClick(Object.assign({},t.opts,{view:t.view})):this.onPreviewClick()}onPreviewClick(t){let e=p.A.get(this.props.store.matchLastview(),"previewEvent")||{},n=p.A.convoOfEv(e);if(!n){let t=p.A.map(this.props.store.matchConvo("*")),e=p.A.find(t,t=>!p.A.isConvoSeen(t,this.props.store.matchUser().id));e||(e=t[0]||{}),n=e.id}this.props.onClick&&this.props.onClick({view:"chat",cid:n})}renderUnread(){let t=this.props.store.matchUnread();return 0===t?null:(0,J.h)("div",{class:"chat-button--unread"},t)}getAgentOfPreviewEvent(t){let e=this.props.store.matchAccount(),n=this.props.plugin.chatbox,i=t,r=p.A.get(i,"by.display_id",p.A.get(i,"by.id")),o=this.props.store.matchAgent(r);return o||(o=this.props.store.matchAgent("*")[r]||{}),o=p.A.cloneDeep(o),o.fullname=o.fullname||p.A.get(e,"name")||this.props.t("agent"),o.avatar_url=o.avatar_url||e.logo_url||a(),n&&n.hide_agent_profile&&(o=Object.assign({},e,{avatar_url:e.logo_url||a(),fullname:e.name||this.props.t("agent")})),o}renderPreview(){if(!this.state.hasPreviewDom)return;let t=this.state.previewEvent,e=this.getAgentOfPreviewEvent(t),n=(this.props.store.matchAccount(),this.props.plugin.chatbox),i=p.A.get(n,"desktop_button.position")||"right";this.props.store.isMobile()&&(i=p.A.get(n,"mobile_button.position")||i);let r=this.renderMessagePreview(t),o=p.A.get(t,"data.message.attachments")||[],s=p.A.find(o,t=>"quick_replies"===t.type);s=p.A.get(s,"quick_replies")||[],s=p.A.take(s,10),p.A.get(n,"greeting.hide_quick_replies")&&(s=[]);let a=p.A.find(o,t=>p.A.includes(t.mimetype,"image")&&t.url),l=p.A.get(a,"url")||"";return!l||l.startsWith("https://")||l.startsWith("http://")||l.startsWith("content://")||l.startsWith("data:")||(l=this.props.store.FileURL+l),(0,J.h)("div",{class:`widget-preview-new-wrapper ${this.state.previewExtraCls}`},(0,J.h)("div",{class:`widget-preview-x-wrapper ${i} ${this.props.store.isMobile()?"mobile":""}`},(0,J.h)("div",{class:"widget-preview--btn-close",onClick:t=>this.closePreview(t)})),(0,J.h)("div",{class:`widget-preview-text-message ${i}`,onClick:t=>this.onPreviewClick(t)},(0,J.h)("div",{class:"widget-preview-text-message--header"},(0,J.h)("img",{alt:"widget avatar",class:"widget-preview--avatar",src:this.props.store.replaceFileUrl(e.avatar_url)}),(0,J.h)("div",{class:"widget-preview-text-message--author"},(0,J.h)("div",{class:"widget-preview-text-message--author-text"},e.fullname),n.is_online&&(0,J.h)("div",{class:"badge badge--success"},(0,J.h)("div",{class:"dot dot--success mr-1"}),"ONLINE"))),(0,J.h)("div",{class:"widget-preview-text-message--content"},r)),l&&(0,J.h)("div",{class:`widget-preview-image-wrapper ${i}`},(0,J.h)("div",{class:"widget-preview-image-item",onClick:()=>this.onPreviewClick()},(0,J.h)("img",{src:l}))),p.A.size(s)>0&&(0,J.h)("div",{class:`widget-preview-quick-reply-wrapper ${i} ${p.A.size(s)>4?"horizontal":""}`},p.A.map(s,e=>{if((e.title||"").trim())return(0,J.h)("div",{title:e.title,class:"widget-preview-quick-reply-item",onClick:()=>{this.props.onSelectQuickReply({text:e.title,format:"plaintext",conversation_id:p.A.convoOfEv(t),attachments:[{type:"postback",postback:{event_id:t.id,payload:e.payload}}]})}},e.title)})))}getButtonAppearance(){let t=this.props.plugin.chatbox;t=this.fixMissingSetting(t);let e=p.A.get(t,"desktop_button.background_image_url")||p.A.get(t,"desktop_button.background_mask_url")||X,n=p.A.get(t,"background")||rt,i=p.A.get(t,"desktop_button.position")||"right",r=p.A.get(t,"desktop_button.background_image_url"),o=p.A.get(t,"desktop_button.background_mask_url"),s=p.A.get(t,"desktop_button.width")||70,a=p.A.get(t,"desktop_button.height")||70;if(this.props.store.isMobile()){e=p.A.get(t,"mobile_button.background_image_url")||p.A.get(t,"mobile_button.background_mask_url")||e,i=p.A.get(t,"mobile_button.position")||i;let n=p.A.get(t,"mobile_button.background_image_url"),l=p.A.get(t,"mobile_button.background_mask_url");s=p.A.get(t,"mobile_button.width")||70,a=p.A.get(t,"mobile_button.height")||70,(n||l)&&(r=n,o=l)}const l=t=>{const e=function(t){return/^https:\/\/(?:storage\.googleapis\.com\/public-gcs\.subiz-cdn\.com|public-gcs\.subiz-cdn\.com|vcdn\.subiz-cdn\.com)\/dashboard-v4\/public\/img\/bubble\/dot_chat\.svg(?=$|[?#])/.test(t)?K:t}(this.props.store.replaceFileUrl(t));return e===K?e:function(t,e=8){if(!t)return t;try{const n=new URL(t);return n.searchParams.set("v",e),n.toString()}catch(n){const[i,r]=t.split("#"),o=i.includes("?"),s=i+(o?"&":"?")+`v=${e}`;return r?s+"#"+r:s}}(e)};e=l(e),r=l(r),o=l(o);const c=r||o?"":it,d=[...new Set([e,r&&encodeURI(r),o&&encodeURI(o),c].filter(Boolean))];return{imgsrc:e,imgurl:r,maskurl:o,background:n,position:i,imgwidth:s,imgheight:a,urls:d,maskAsset:o?encodeURI(o):c,key:JSON.stringify([d,o,c])}}componentDidUpdate(){this.getButtonAppearance().key!==this._buttonImageKey&&this.prepareButtonImage()}async prepareButtonImage(){const t=this.getButtonAppearance(),e=this._buttonImageVersion=(this._buttonImageVersion||0)+1;this._buttonImageKey=t.key,this.readyGate.close();const[n,i]=await Promise.all([Promise.all(t.urls.filter(e=>e!==t.maskAsset).map(t=>ot(t))),t.maskAsset?st(t.maskAsset):Promise.resolve(null)]),r=()=>!this._isMounted||this._buttonImageVersion!==e;if(r())return;const o=n.some(t=>!t)||!!t.maskAsset&&!i,s=!o||await ot(X);r()||(this._buttonElement&&window.getComputedStyle(this._buttonElement).transform,this.setState({ready:s,readyImageKey:t.key,fallbackButtonImage:o,buttonMaskUrl:i}),this.readyGate.open())}componentWillUnmount(){this._animateTimeout&&clearTimeout(this._animateTimeout)}renderButton(){"undefined"!=typeof sbz_info&&(sbz_info.render_chatbox_button=p.A.Date.now());const t=this.getButtonAppearance();let{imgsrc:e,imgurl:n,maskurl:i,background:r,position:o,imgwidth:s,imgheight:a}=t;const l=this.state.readyImageKey===t.key&&this.state.fallbackButtonImage;t.maskAsset&&(i=this.state.readyImageKey===t.key?this.state.buttonMaskUrl:"",e===t.maskAsset&&(e=i||"")),l&&(e=n=X,i="");let c="chat-button--white-bg";!n&&i&&(c+=" chat-button--white-bg--mask-only");let d="";n||i||(c+=" chat-button--white-bg--mask-only",d=`\n\t\t\t\t-webkit-mask-image: none !important;\n\t\t\t\t-o-mask-image: none !important;\n\t\t\t\t-moz-mask-image: none !important;\n\t\t\t\tmask-image: none !important;\n\t\t\t\theight: ${a}px !important;\n\t\t\t\twidth: ${s}px !important;\n\t\t\t\tbackground: ${r} !important;\n\t\t\t\tbackground: ${r} !important;\n mask-size: cover !important;\n -webkit-mask-size: cover !important;\n -o-mask-size: cover !important;\n -moz-mask-size: cover !important;\n mask-size: cover !important;\n\t\t\t`),n&&i&&(d=`\n\t\t\t\t-webkit-mask-image: url("${encodeURI(i)}") !important;\n\t\t\t\t-o-mask-image: url("${encodeURI(i)}") !important;\n\t\t\t\t-moz-mask-image: url("${encodeURI(i)}") !important;\n\t\t\t\tmask-image: url("${encodeURI(i)}") !important;\n\t\t\t\tbackground-image: url("${encodeURI(n)}") !important;\n\t\t\t\tbackground-repeat: no-repeat !important;\n -webkit-mask-size: cover !important;\n -o-mask-size: cover !important;\n -moz-mask-size: cover !important;\n mask-size: cover !important;\n\t\t\t`),n&&!i&&(d=`\n\t\t\t\tbackground-image: url("${encodeURI(n)}") !important;\n\t\t\t\tbackground-repeat: no-repeat !important;\n\t\t\t`),!n&&i&&(d=`\n\t\t\t\t-webkit-mask-image: url("${encodeURI(i)}") !important;\n\t\t\t\t-o-mask-image: url("${encodeURI(i)}") !important;\n\t\t\t\t-moz-mask-image: url("${encodeURI(i)}") !important;\n\t\t\t\tmask-image: url("${encodeURI(i)}") !important;\n\t\t\t\theight: ${a}px !important;\n\t\t\t\twidth: ${s}px !important;\n\t\t\t\tbackground: ${r} !important;\n -webkit-mask-size: cover !important;\n -o-mask-size: cover !important;\n -moz-mask-size: cover !important;\n mask-size: cover !important;\n\t\t\t`),l&&(d+=`width: ${s}px !important; height: ${a}px !important;`);let h="chat-button chat-button--"+o;l&&(h+=" chat-button--fallback");let m=`\n\t\t\twidth: ${s-4}px !important;\n\t\t\theight: ${a-4}px !important;\n\n `;return this.state.ready&&this.state.readyImageKey===t.key||(h+=" hidden"),(0,J.h)("button",{ref:t=>{this._buttonElement=t},type:"button",class:h,"aria-label":this.props.t("chat"),"aria-expanded":!this.props.isShow,onClick:t=>this.onClick(t)},(0,J.h)("div",{class:c,style:m}),(0,J.h)("div",{class:"chat-button--img-container",style:d},(0,J.h)("img",{width:"70",height:"70",alt:"chat button",class:"chat-button--img",src:e})),this.renderUnread())}onProfileError(t){t.target.src=tt,this.onProfileReady()}onChatButtonError(t){this._onChatButtonErrorExecuted||(this._onChatButtonErrorExecuted=!0,t.target.src=X)}renderMessagePreview(t,e){e=e||this.props.t("sent_you_a_message");let n=p.A.get(t,"data.message.format"),i=p.A.get(t,"data.message.block");if(i||"block"==n){if(p.A.isBlockEmpty(i)){let n=p.A.get(t,"data.message.attachments");return p.A.size(n)>0?(0,J.h)("div",null,`${this.props.t("send")} ${p.A.size(n)} ${p.A.size(n)>1?this.props.t("attachments"):this.props.t("attachment")}`):e}return(0,J.h)(Q.A,{block:i,store:this.props.store,t:this.props.t})}let r=p.A.get(t,"data.message.text",e);return!r&&p.A.size(p.A.get(t,"data.message.attachments"))>0&&(r=e),r?(p.A.get(t,"by.type"),p.A.extractText(r).map(t=>"emoji"===t.type?(0,J.h)(Y.A,{emojiCode:t.text}):t.text)):null}closePreview(t){t&&(t.preventDefault(),t.stopPropagation()),this.HideGreeting()}}const nt=18e5,it="https://vcdn.subiz-cdn.com/file/bubble_11.svg?v=5",rt="linear-gradient(280.16deg, #0053d3 22.03%, #0265ff 78.2%)";function ot(t,{crossOrigin:e=!1}={}){return new Promise(n=>{const i=new Image;e&&(i.crossOrigin="anonymous"),i.onerror=()=>n(!1),i.onload=async()=>{try{i.decode&&await i.decode(),n(!0)}catch(t){n(!1)}},i.src=t})}async function st(t){try{const e=await fetch(t);if(!e.ok)return null;const n=await e.blob(),i=await new Promise(t=>{const e=new FileReader;e.onload=()=>t(e.result),e.onerror=e.onabort=()=>t(""),e.readAsDataURL(n)});if(i&&await ot(i))return i}catch(t){}return await ot(t,{crossOrigin:!0})?t:null}var at=n(9529);function pt(t){if(t.store.isMobile())return null;if(t.store.isAIDevMode())return null;let e=t.store.matchUser()||{};var n=`https://subiz.com.vn/?utm_source=${window.location.host||`id-${e.account_id}`}&utm_medium=widget&utm_campaign=widget_referral`;return(0,J.h)("div",{class:"poweredby"},(0,J.h)("a",{href:n,class:"poweredby--text",target:"_blank",title:"Subiz"},(0,J.h)("img",{width:"17",height:"12",class:"poweredby--subiz-logo",src:at,alt:"powerred by subiz"})," Subiz"))}function lt(t){let e=t.plugin.chatbox,n=t.store.matchAccount()||{};var i=t.tooltipPos||"bottom",r=t.mode||"primary";if(e&&e.hide_agent_profile)return(0,J.h)("div",{class:`group-avatar group-avatar--${r}`},(0,J.h)("div",{class:"d-inline-block pos-relative","data-tooltip":n.name,"data-tooltip-position":i},(0,J.h)("img",{width:35,height:35,alt:"agent avatar left",class:"avatar group-avatar--agent-left",src:t.store.replaceFileUrl(n.logo_url)||a()})));let o=t.store.matchAgent("*");var s=p.A.map(t.agent_ids,t=>o[t]);if(void 0!==t.agent_ids&&0==p.A.size(t.agent_ids)){var l=p.A.get(e,"header.agent_ids",[]);s=0!==(l=p.A.filter(l,t=>!!o[t])).length?p.A.map(l,t=>o[t]):p.A.filter(o,t=>"agent"===t.type)}if(s=p.A.filter(s,t=>!!t),0===p.A.size(s))return(0,J.h)("div",{class:`group-avatar group-avatar--${r}`},(0,J.h)("div",{class:"d-inline-block pos-relative","data-tooltip":n.name,"data-tooltip-position":i},(0,J.h)("img",{width:35,height:35,alt:"agent avatar left",class:"avatar group-avatar--agent-left",src:t.store.replaceFileUrl(n.logo_url)||a()})));if(1===s.length){var c=s[0];let e=c.avatar_url||t.store.replaceFileUrl(n.logo_url)||a();var d="primary"===r?"group-avatar--agent-middle":"group-avatar--agent-left";return(0,J.h)("div",{class:`group-avatar group-avatar--${r}`},(0,J.h)("div",{class:"d-inline-block pos-relative","data-tooltip":c.fullname||n.name,"data-tooltip-position":i},(0,J.h)("img",{width:35,height:35,class:`avatar ${d}`,alt:"agent avatar",src:e})))}if(2===s.length){let e=s[0],o=s[1];return(0,J.h)("div",{class:`group-avatar group-avatar--${r}`},(0,J.h)("div",{class:"d-inline-block pos-relative","data-tooltip":e.fullname||n.name,"data-tooltip-position":i},(0,J.h)("img",{width:35,height:35,alt:"agent avatar left",class:"avatar group-avatar--agent-left",src:t.store.replaceFileUrl(e.avatar_url)||t.store.replaceFileUrl(n.logo_url)||a()})),(0,J.h)("div",{class:"d-inline-block pos-relative","data-tooltip":o.fullname||n.name,"data-tooltip-position":i},(0,J.h)("img",{alt:"agent avatar right",width:35,height:35,class:"avatar group-avatar--agent-right",src:t.store.replaceFileUrl(o.avatar_url)||t.store.replaceFileUrl(n.logo_url)||a()})))}let h=s[0],m=s[1],u=s[2];return(0,J.h)("div",{class:`group-avatar group-avatar--${r}`},(0,J.h)("div",{class:"d-inline-block pos-relative","data-tooltip":h.fullname||n.name,"data-tooltip-position":i},(0,J.h)("img",{width:35,height:35,alt:"agent avatar left",class:"avatar group-avatar--agent-left",src:t.store.replaceFileUrl(h.avatar_url)||t.store.replaceFileUrl(n.logo_url)||a()})),(0,J.h)("div",{class:"d-inline-block pos-relative","data-tooltip":m.fullname||n.name,"data-tooltip-position":i},(0,J.h)("img",{alt:"agent avatar middle",width:35,height:35,class:"avatar group-avatar--agent-middle",src:t.store.replaceFileUrl(m.avatar_url)||t.store.replaceFileUrl(n.logo_url)||a()})),(0,J.h)("div",{class:"d-inline-block pos-relative","data-tooltip":u.fullname||n.name,"data-tooltip-position":i},(0,J.h)("img",{width:35,height:35,alt:"agent avatar right",class:"avatar group-avatar--agent-right",src:t.store.replaceFileUrl(u.avatar_url)||t.store.replaceFileUrl(n.logo_url)||a()})))}class ct extends V.Mw{constructor(t){var e,n,i;super(t),e=this,i=()=>{let t=this.props.plugin.chatbox||{},e=p.A.get(t,"header.agent_ids")||[],n=p.A.get(this.props.store.matchAgent(e[0])),i=p.A.get(n,"avatar_url_128")||p.A.get(n,"avatar_url");if(i)return(0,J.h)("img",{width:38,height:38,class:"avatar avatar__account",src:this.props.store.replaceFileUrl(i)||o()})},(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n="renderAgentAvatar"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}renderAccountAvatar(){let t=this.props.store.matchAccount()||{},e=this.props.plugin.chatbox||{},n=p.A.get(e,"header.logo_url")||p.A.get(t,"logo_url");return n?(0,J.h)("img",{width:38,height:38,alt:t.name,class:"avatar avatar__account",src:this.props.store.replaceFileUrl(n)||o()}):null}render(){let t="widget-header",e=!1,n=!1,i=this.props.plugin.chatbox||{},r=p.A.get(i,"header.layout"),o="list"!==this.props.view&&!0,s=!o&&"classic"===r;return o||"classic"==r?t+=" widget-header--collapsed":(t+=" widget-header--convo-expanded",e="social"===r,n=!(e||s)),(0,J.h)("div",{class:t},this.renderCollapsedHeader(o||s,s),this.renderSocial(e),this.renderTeam(n))}renderCollapsedHeader(t,e){let n=this.props.plugin.chatbox||{},i=(this.props.store.matchAccount()||{}).is_online?this.props.t("agent_online"):this.props.t("agent_offline"),r=p.A.get(n,"tagline",{}),o=this.props.t.i18n(r)||n.introduction||i,s=(p.A.map(this.getAgentJoined(this.props.cid),t=>t.id),"widget-header--inner widget-header--inner--collapsed");t||(s+=" widget-header--inner--hidden");let a=null,l="";e?l="padding-bottom: 75px !important;":a=this.renderBackButton();let c=p.A.get(n,"header.layout");return(0,J.h)("div",{class:s,style:l},a,"agent"===c?this.renderAgentAvatar():this.renderAccountAvatar(),(0,J.h)("div",{class:"widget-header--title-container"},(0,J.h)("div",{class:"widget-header--title"},this.getTitle()),(0,J.h)("div",{class:"widget-header--description",title:o},o)),this.renderCloseButton())}renderSocial(t){let e=this.props.plugin.chatbox||{},n=this.props.store.matchAccount()||{},i=p.A.get(e,"header.links")||[],r=p.A.map(i,t=>t.url&&t.type&&"subiz"!==t.type?"email"===t.type?(0,J.h)("div",null,(0,J.h)("a",{href:`mailto:${t.url}`,title:t.url},(0,J.h)("i",{class:`social__links-logo social__links-logo--${t.type}`}))):(0,J.h)("div",null,(0,J.h)("a",{href:t.url,target:"_blank",title:t.url},(0,J.h)("i",{class:`social__links-logo social__links-logo--${t.type}`}))):null),o=p.A.get(e,"tagline",{});var s=this.props.t.i18n(o)||e.introduction||this.props.t("team_intro")||"Chúng tôi sẵn sàng trợ giúp :wave:.\nVui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi của bạn",a=p.A.extractText(s).map(t=>"emoji"===t.type?(0,J.h)(Y.A,{emojiCode:t.text}):t.text);let l="widget-header--inner widget-header--inner--expanded";return t||(l+=" widget-header--inner--hidden"),(0,J.h)("div",{class:l},(0,J.h)("div",{class:"widget-header-expand-container"},(0,J.h)("div",{class:"widget-header--top-wrapper"},(0,J.h)("div",{class:"widget-header--title"},this.getTitle()),this.renderCloseButton()),(0,J.h)("div",{class:"widget_header__body widget_header__body__social"},(0,J.h)("img",{alt:"logo",class:"social__account_logo",src:this.props.store.replaceFileUrl(p.A.get(e,"header.logo_url")||p.A.get(n,"logo_url"))}),(0,J.h)("div",null,(0,J.h)("div",{class:"social__introduction"},a),(0,J.h)("div",{class:"social__links"},r)))))}renderTeam(t){let e=this.props.plugin.chatbox||{},n=p.A.get(e,"tagline",{});var i=this.props.t.i18n(n)||e.introduction||this.props.t("team_intro")||"Chúng tôi sẵn sàng trợ giúp :wave:.\nVui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi của bạn",r=p.A.extractText(i).map(t=>"emoji"===t.type?(0,J.h)(Y.A,{emojiCode:t.text}):t.text);let o="widget-header--inner widget-header--inner--expanded";return t||(o+=" widget-header--inner--hidden"),(0,J.h)("div",{class:o},(0,J.h)("div",{class:"widget-header-expand-container"},(0,J.h)("div",{class:"widget-header--top-wrapper"},(0,J.h)("div",{class:"widget-header--title"},this.getTitle()),this.renderCloseButton()),(0,J.h)("div",{class:"widget_header__body"},(0,J.h)("div",{class:"widget-header--avatar-wrapper"},(0,J.h)(lt,{plugin:this.props.plugin,store:this.props.store,mode:"primary",agent_ids:[]})),(0,J.h)("div",{class:"widget-header--title-container"},(0,J.h)("div",{class:"widget-header--description"},r)))))}getTitle(){let t=this.props.plugin.chatbox||{},e=this.props.store.matchAccount()||{};if(t.hide_agent_profile)return e.name||this.props.t("widget_title");let n=this.getAgentJoined(this.props.cid),i=p.A.get(this.props.plugin,"chatbox.caption",{}),r=this.props.t.i18n(i)||t.title;return dt(n)||r||e.name||this.props.t("widget_title")}renderBackButton(){let t=this.props.store.matchConvo("*");if(0===p.A.size(t))return null;var e=null;let n=this.props.store.matchUser();if(!n||!n.id)return null;let i=0;return p.A.map(t,t=>{t.id!=this.props.cid&&(p.A.isConvoSeen(t,n.id)||i++)}),0!==i&&(e=(0,J.h)("span",{class:"widget-header--total-unread-convo"},i)),(0,J.h)("button",{type:"button","aria-label":this.props.t("menu_back"),class:"widget-header--wrap-button-back "+(i?"widget-header--has-convo-unred":""),onClick:t=>this.onBackClick(t)},(0,J.h)("div",{class:"widget-header--button-back","data-tooltip":this.props.t("menu_back")}),e)}renderCloseButton(){return(this.props.plugin.chatbox||{}).hide_close_button?null:this.props.store.isEmbededChatMode()?void 0:(0,J.h)("button",{type:"button","aria-label":this.props.t("close"),class:"widget-header--button-close","data-tooltip":this.props.t("close"),"data-tooltip-position":"bottom",onClick:t=>this.onCloseClick(t)},(0,J.h)("span",{class:"widget-header--button-close-icon"}))}onBackClick(t){t.stopPropagation(),t.preventDefault(),this.props.onGotoList&&this.props.onGotoList()}onCloseClick(t){t.stopPropagation(),t.preventDefault(),this.props.onClose&&this.props.onClose()}getAgentJoined(t){var e=this.props.store.matchConvo(t)||{};return p.A.filter(e.members,t=>"agent"===t.type&&"active"===t.membership)}}let dt=t=>(t=p.A.filter(t,t=>p.A.trim(t.fullname))).length?p.A.map(t,t=>t.fullname).join(", "):null;var ht=n(4188);class mt extends V.Mw{constructor(t){var e,n,i;super(t),e=this,n="onEnter",i=p.A.throttle(function(){this.submitMessage()},50),(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.refFileInput=(0,J._3)(),this.refMessageInput=(0,J._3)(),this.props.store.onUpdate(this,t=>this.forceUpdate()),this.props.store.onConvoEvent(this,t=>{p.A.convoOfEv(t)===this.props.cid&&this.forceUpdate()}),this.focus(),this._forceUpdate=p.A.throttle(()=>{this.forceUpdate()},500),this.resizeInput=p.A.throttle(function(){const t=this.refMessageInput.current;if(!t)return;t.style.setProperty("height","1em","important");const e=Math.min(200,t.scrollHeight);t.style.setProperty("height",`${e}px`,"important")},5)}blur(){const t=this.refMessageInput.current;t&&t.blur()}render(){const t=this.hasUnfinishRequiredFormOrLock()||this.props.disabled||this.props.is_loading;var e=(0,J.h)("div",{class:"d-flex flex-row align-self-end"},this.renderEmoji(),(0,J.h)("button",{type:"button",disabled:t,"aria-label":this.props.t("attachment"),"data-tooltip-position":"top-left",class:"message-input--button message-input--attachment-button",onClick:t=>this.selectFile(t)}));p.A.trim(this.state.msgValue).length>0&&(e=(0,J.h)("div",{class:"d-flex flex-row align-self-end"},this.renderEmoji(),(0,J.h)("button",{type:"button",disabled:t,"aria-label":this.props.t("send"),"data-tooltip-position":"top-left",class:"message-input--button message-input--send-button",onClick:()=>this.submitMessage()}))),this.props.is_loading&&(e=(0,J.h)("div",{class:"d-flex flex-row align-self-end"},(0,J.h)(ht.A,{size:"32"})));var n="";return(t||this.props.is_loading)&&(n="message-input--disabled"),(0,J.h)("div",{class:`message-input ${n}`,onClick:t=>{this.refMessageInput.current&&this.refMessageInput.current.focus()}},(0,J.h)("input",{class:"d-none",ref:this.refFileInput,type:"file",onChange:t=>this.sendFile(t),multiple:!0}),(0,J.h)("textarea",{disabled:t,"aria-label":this.props.t("message_input_help"),class:"message-input--input",maxlength:"1024",placeholder:this.props.t("message_input_help").substr(0,25),ref:this.refMessageInput,rows:"1",value:this.state.msgValue,onInput:t=>this.onChange(t),onPaste:t=>this.pasteImage(t),"data-emojiable":"true",onKeydown:t=>this.onKeydown(t)}),e)}hasUnfinishRequiredFormOrLock(){let t=this.props.store.matchConvo(this.props.cid);if("ended"===p.A.get(t,"state"))return!1;let e=this.props.store.listEvents(this.props.cid);e=p.A.orderBy(e,"created","desc").filter(t=>"message_sent"===t.type);let n=p.A.get(e[0],"data.message.attachments",[]);if(p.A.find(n,t=>p.A.get(t,"lock_input")))return!0;var i;for(let t of e)if("user"!==p.A.get(t,"by.type")){i=t;break}n=p.A.get(i,"data.message.attachments",[]);let r=p.A.filter(n,t=>{if(!t)return!1;if("form"!==t.type&&"ask_info_form"!==t.type)return!1;var e=t.form;return!(!e||!(p.A.parseJSON(e.state)||{}).require_finished&&"ask_info_form"!==t.type||function(t){let e=p.A.get(t,"fields")||[];return p.A.find(e,t=>!!t.answered)}(t.form))});return p.A.size(r)>0}renderEmojiPopup(){return this.state.openEmoji?(0,J.h)("div",{class:"emoji-picker","v-clickaway":t=>this.setState({openEmoji:!1})},(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":like:"),"data-tooltip":":like:",class:"emoji-picker--item emoji--like"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":unlike:"),"data-tooltip":":unlike:",class:"emoji-picker--item emoji--unlike"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":angry:"),"data-tooltip":":angry:",class:"emoji-picker--item emoji--angry"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":confused:"),"data-tooltip":":confused:",class:"emoji-picker--item emoji--confused"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":crying:"),"data-tooltip":":crying:",class:"emoji-picker--item emoji--crying"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":grinning:"),"data-tooltip":":grinning:",class:"emoji-picker--item emoji--grinning"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":heart-eyes:"),"data-tooltip":":heart-eyes:",class:"emoji-picker--item emoji--heart-eyes"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":neutral:"),"data-tooltip":":neutral:",class:"emoji-picker--item emoji--neutral"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":sad:"),"data-tooltip":":sad:",class:"emoji-picker--item emoji--sad"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":sleepy:"),"data-tooltip":":sleepy:",class:"emoji-picker--item emoji--sleepy"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":smiling:"),"data-tooltip":":smiling:",class:"emoji-picker--item emoji--smiling"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":surprised:"),"data-tooltip":":surprised:",class:"emoji-picker--item emoji--surprised"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":tired:"),"data-tooltip":":tired:",class:"emoji-picker--item emoji--tired"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":tongue-out:"),"data-tooltip":":tongue-out:",class:"emoji-picker--item emoji--tongue-out"})),(0,J.h)("div",{class:"emoji-picker-background-item"},(0,J.h)("div",{onClick:()=>this.emojiPick(":wink:"),"data-tooltip":":wink:",class:"emoji-picker--item emoji--wink"}))):null}applyMessage(t){this.setState({msgValue:t}),this.resizeInput()}focus(){if(this.props.disabled)return;const t=document.activeElement;let e=!1;t&&("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName||(e=!0),t.hasAttribute("contenteditable")&&"true"===t.getAttribute("contenteditable")&&(e=!0)),e||(this.refMessageInput.current&&this.refMessageInput.current.focus(),p.A.setTimeout(()=>{this.refMessageInput.current&&this.refMessageInput.current.focus()}),p.A.setTimeout(()=>{this.refMessageInput.current&&this.refMessageInput.current.focus()},100))}renderEmoji(){return(0,J.h)("div",null,this.renderEmojiPopup(),(0,J.h)("button",{type:"button","aria-label":"Emoji","aria-expanded":!!this.state.openEmoji,disabled:this.props.disabled||this.props.is_loading,class:"message-input--button message-input--emoji-button",onClick:t=>this.toggleEmoji(t)}))}toggleEmoji(t){t.stopPropagation(),this.focus(),this.props.disabled||this.setState({openEmoji:!this.state.openEmoji})}emojiPick(t){const e=this.refMessageInput.current,n=e.selectionStart,i=this.state.msgValue||"";this.setState({openEmoji:!1,msgValue:[i.slice(0,n),t,i.slice(n)].join("")}),this.resizeInput(),e.focus()}onKeydown(t){if(13===t.keyCode&&!1===t.shiftKey)return this.onEnter(),t.preventDefault();this._forceUpdate()}onChange(t){const e=t.target.value,n=e!==(this.state.msgValue||"");this.setState({msgValue:e}),this.resizeInput(),n&&p.A.trim(e)&&this.sendTyping()}selectFile(){this.props.disabled||this.refFileInput.current.click()}sendFile(){let t=this.refFileInput.current;this._sendFile(t.files),t.value=""}_sendFile(t){if(0===p.A.size(t))return;if(this.props.disabled)return;let e=p.A.map(t,t=>({type:"file",mimetype:t.type,name:t.name,_file:t,size:t.size}));this.props.onSend&&this.props.onSend({attachments:e})}async submitMessage(t){(t=t||p.A.trim(this.state.msgValue)||"")&&(this.props.disabled||this.props.onSend&&!1===await this.props.onSend({text:t,format:"plaintext"})||(this.setState({openEmoji:!1,msgValue:""}),this.resizeInput()))}sendTyping(){if(!this.props.disabled&&!this.props.is_loading&&this.props.cid&&"ended"!==p.A.get(this.props.store.matchConvo(this.props.cid),"state"))return this.props.store.typing(this.props.cid)}pasteImage(t){if(!(window.File&&window.FileReader&&window.FileList&&window.Blob))return;let e=new p.A.Date;const n=`Paste-image-${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}-${e.getHours()}-${e.getMinutes()}-${e.getSeconds()}`;let i=null;const r=t.clipboardData.items[0];if(0===r.type.indexOf("image")&&(i=r.getAsFile()),!i)return;const o=[i,new ArrayBuffer],s=new File(o,`${n}.png`,{type:"image/png"});this._sendFile([s])}}function ut(t){let e=p.A.get(t,"type");return"message_sent"===e||("conversation_state_updated"===e?"ended"==p.A.get(t,"data.conversation.state"):void 0)}function gt(t,e){if(!e)return[];const n=t.matchConvo(e);if(!n||!n.created)return[n||{id:e}];const i=p.A.map(t.matchConvo("*")),r=new Map;for(const t of i)t&&t.id&&t.id!==e&&!t.id.startsWith("cslight")&&(n.account_id&&t.account_id!==n.account_id||t.created&&p.A.getMs(t.created)<p.A.getMs(n.created)&&r.set(t.id,t));return[...r.values()].sort((t,e)=>p.A.getMs(t.created)-p.A.getMs(e.created)||t.id.localeCompare(e.id)).concat(n)}function bt(t){const e="message_sent"===t.type&&t.source_event_id||t.id;return t.type+":"+e}function ft(t,e,n=p.A.Date.now()){const i=p.A.get(t,"greeting",{}),r=e.i18n?e.i18n(i.greeting||{}):"",o=p.A.trim(r)||p.A.trim(i.message)||p.A.trim(e("team_intro"))||e("empty_convo_text");return{id:"widget-greeting-"+p.A.randomString(24),type:"message_sent",created:n,by:{type:"system",id:"system",...i.agent_id?{display_type:"agent",display_id:i.agent_id}:{}},data:{message:{text:o,format:"plaintext"}}}}class vt extends V.Mw{constructor(t){var e,n,i;super(t),e=this,n="containerRef",i=(0,J._3)(),(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.setState({ready:!1,errorIndecies:[],focusedIdx:-1})}componentDidMount(){this.setImageFrameDimension()}focusSourceEventFromQuote(t){if(t.id!==this.props.ev.id)return;let e=p.A.get(t,"data.message.fields")||[],n=p.A.find(e,t=>"attachment_index"===t.key),i=p.A.get(n,"value");try{i=JSON.parse(i)}catch(t){i=void 0}void 0!==i&&(this.setState({focusedIdx:i}),this.focusTimeout&&clearTimeout(this.focusTimeout),this.focusTimeout=setTimeout(()=>{this.setState({focusedIdx:-1})},3e3))}setImageFrameDimension(){let t=this.containerRef.current;this.frameWidth=t?t.parentNode.parentNode.offsetWidth:267,this.frameHeight=240,this.setState({ready:!0})}onErrorImage(t){let e=this.state.errorIndecies||[];e.push(t),e=[...e],this.setState({errorIndecies:e})}calculateImageDimension(t){if(!t.width||!t.height)return{width:this.frameWidth,height:this.frameHeight};if(t.width/t.height-this.frameWidth/this.frameHeight>=0){let e=this.frameWidth,n=t.height*this.frameWidth/t.width;return n=Math.round(n),{width:e,height:n}}{let e=this.frameHeight,n=t.width*this.frameHeight/t.height;return n=Math.round(n),{width:n,height:e}}}renderImage(t,e){if(!this.state.ready)return;let n=p.A.get(this.props.ev,"by.type");"user"!==n&&(n="agent");let r=`image-attachment image-attachment--${n}`;if(t._true_idx===this.state.focusedIdx&&(r+=" just-focused"),!t.width||!t.height)return(0,J.h)("div",{class:r},(0,J.h)("a",{href:this.props.store.replaceFileUrl(t.url),target:"_blank"},(0,J.h)("img",{alt:!0,class:"image-attachment__img",src:this.props.store.replaceFileUrl(t.thumbnail_url||t.url),onload:t=>this.props.onLoad&&this.props.onLoad()})));let{width:o,height:s}=this.calculateImageDimension(t),a=this.props.store.replaceFileUrl(t.thumbnail_url||t.url),l=this.props.store.replaceFileUrl(t.url);return this.state.errorIndecies.includes(e)&&(a=i(),l=a),(0,J.h)("div",{class:r},(0,J.h)("a",{href:l,target:"_blank"},(0,J.h)("img",{alt:!0,ref:t=>{t&&(t.style.setProperty("width",`${o}px`,"important"),t.style.setProperty("height",`${s}px`,"important"))},class:"image-attachment__img",src:a,onload:t=>this.props.onLoad&&this.props.onLoad(),onerror:t=>this.onErrorImage(e)})))}render(){var t=p.A.get(this.props.ev,"data.message.attachments",[]),e=[];let n=p.A.get(this.props.ev,"by.type");if("user"!==n&&(n="agent"),p.A.each(t,(t,n)=>{if(t&&p.A.includes(t.mimetype,"image")&&t.url){var i=t.url;i.startsWith("https://")||i.startsWith("http://")||i.startsWith("content://")||i.startsWith("data:")||(t.url=this.props.store.FileURL+i),e.push({...t,_true_idx:n})}}),0===e.length)return null;let i=p.A.map(e,(t,e)=>this.renderImage(t,e));return"agent"===n?(0,J.h)("div",{class:"message-agent",ref:this.containerRef},i):(0,J.h)("div",{class:"message-user message-user-images-container",ref:this.containerRef},i)}}function yt(t){let e=p.A.get(t.ev,"by.type");var n=p.A.get(t.ev,"data.message.attachments",[]),i=[];if(p.A.each(n,(t,e)=>{t&&p.A.includes(t.mimetype,"audio")&&i.push(t)}),0===i.length)return null;var r=p.A.map(i,(n,i)=>(0,J.h)("div",{key:i,class:`audio-attachment audio-attachment--${e}`},(0,J.h)("audio",{class:"audio-attachment__audio",controls:!0},(0,J.h)("source",{src:t.store.replaceFileUrl(n.url),type:n.mimetype}))));return(0,J.h)("div",{class:`message-${e} message-${e}-audio`},r)}class _t extends V.Mw{constructor(t){super(t),this.state={focusedIdx:-1}}render(){var t=p.A.get(this.props.ev,"by.type","agent");"user"!==t&&(t="agent");var e=p.A.get(this.props.ev,"data.message.attachments",[]),n=[];if(p.A.each(e,(t,e)=>{t&&(t.url||t._file)&&(p.A.includes(t.mimetype,"video")||p.A.includes(t.mimetype,"audio")||p.A.includes(t.mimetype,"image")||"button"===t.type||"quick_replies"===t.type||"form"===t.type||"form_submit"===t.type||n.push({...t,_true_idx:e}))}),0===n.length)return null;let i=p.A.map(n,(e,n)=>{let i=`file-attachment file-attachment--${t}`;return e._true_idx===this.state.focusedIdx&&(i+=" just-focused"),(0,J.h)("div",{key:n,class:i},(0,J.h)("a",{class:"file-attachment--link",href:this.props.store.replaceFileUrl(e.url),target:"_blank"},(0,J.h)("span",{class:"file-attachment--download mr-2"}),(0,J.h)("span",{class:"file-attachment--filename"},e.name)))});return(0,J.h)("div",{class:`message-${t}`},i)}focusSourceEventFromQuote(t){if(t.id!==this.props.ev.id)return;let e=p.A.get(t,"data.message.fields")||[],n=p.A.find(e,t=>"attachment_index"===t.key),i=p.A.get(n,"value");try{i=JSON.parse(i)}catch(t){i=void 0}void 0!==i&&(this.setState({focusedIdx:i}),this.focusTimeout&&clearTimeout(this.focusTimeout),this.focusTimeout=setTimeout(()=>{this.setState({focusedIdx:-1})},3e3))}}var wt=n(4339);function xt(t){if(0===p.A.size(t.buttons))return null;var e=p.A.map(t.buttons,(e,n)=>"call_button"===e.type?(0,J.h)("a",{class:"url-button-attachment",href:(0,wt.P)("tel:"+e.phone_number),key:n,title:e.title},t.t.i18n(e.i18n_title)||t.t.i18n(e.old_i18n_title)||e.title||`${t.t("call")} ${e.phone_number}`):"url_button"===e.type?(0,J.h)("a",{class:"url-button-attachment",href:(0,wt.P)(e.url)||void 0,target:"_blank",rel:"noopener noreferrer",key:n,title:e.title},t.t.i18n(e.i18n_title)||t.t.i18n(e.old_i18n_title)||e.title||e.url):"postback_button"===e.type?(0,J.h)("button",{type:"button",class:"url-button-attachment",key:n,onClick:n=>t.onSelect(e)},t.t.i18n(e.i18n_title)||e.title):("widget_ask_desktop_notify_button"===e.type||e.type,null));return(0,J.h)("div",{class:"button-attachments"},e)}function kt(t){if("user"===p.A.get(t.ev,"by.type"))return null;let e=[],n=p.A.get(t.ev,"data.message.attachments",[]);return p.A.each(n,(t,n)=>{t&&"button"===p.A.get(t,"type")&&p.A.each(p.A.get(t,"buttons")||[],t=>e.push(t))}),(0,J.h)(xt,{store:t.store,buttons:e,t:t.t})}class At extends V.Mw{constructor(t){super(t)}render(){if("user"===p.A.get(this.props.ev,"by.type"))return null;let t=[];if(p.A.map(p.A.get(this.props.ev,"data.message.attachments",[]),e=>{e&&"quick_replies"===e.type&&(t=p.A.get(e,"quick_replies",[]))}),t=p.A.filter(t,t=>t.title),0===t.length)return null;let e=p.A.convoOfEv(this.props.ev),n=this.props.store.matchConvo(e);if("ended"===p.A.get(n,"state"))return null;let i=p.A.map(this.props.store.listEvents(e));i=p.A.orderBy(i,"created","asc").filter(t=>"message_sent"===t.type);let r=0;for(var o=0;o<i.length;o++)if(i[o].id===this.props.ev.id){r=o;break}for(o=r+1;o<i.length;o++)if("user"===p.A.get(i[o],"by.type"))return null;let s=p.A.map(t,t=>(0,J.h)("div",{class:"message_quick_reply",onClick:e=>this.props.onSelect(t),title:t.title},t.title));return(0,J.h)("div",{class:"message_quick_replies"},s)}}function zt(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class It extends V.Mw{constructor(t){super(t),zt(this,"state",{hovering:0,selected:0}),zt(this,"onMouseEnter",t=>{let{selected:e,hovering:n}=this.state;t<=e?this.setState({hovering:e}):this.setState({hovering:t})}),zt(this,"onMouseLeave",()=>{let{selected:t,hovering:e}=this.state;this.setState({hovering:0})})}onToggleValue(t){let{selected:e}=this.state,n=t;t===e&&(n=0),this.setState({selected:n,hovering:n}),this.props.onChange(n)}render(){let{selected:t,hovering:e}=this.state,n="star-wrapper";t>=1?n+=" selected":e>=1&&(n+=" hovering");let i="star-wrapper";t>=2?i+=" selected":e>=2&&(i+=" hovering");let r="star-wrapper";t>=3?r+=" selected":e>=3&&(r+=" hovering");let o="star-wrapper";t>=4?o+=" selected":e>=4&&(o+=" hovering");let s="star-wrapper";return t>=5?s+=" selected":e>=5&&(s+=" hovering"),(0,J.h)("div",{class:"form-ratings-wrapper",onMouseLeave:()=>this.onMouseLeave()},(0,J.h)("div",{class:n,onClick:()=>this.onToggleValue(1),onMouseEnter:()=>this.onMouseEnter(1)},(0,J.h)("div",{class:"star"})),(0,J.h)("div",{class:i,onClick:()=>this.onToggleValue(2),onMouseEnter:()=>this.onMouseEnter(2)},(0,J.h)("div",{class:"star"})),(0,J.h)("div",{class:r,onClick:()=>this.onToggleValue(3),onMouseEnter:()=>this.onMouseEnter(3)},(0,J.h)("div",{class:"star"})),(0,J.h)("div",{class:o,onClick:()=>this.onToggleValue(4),onMouseEnter:()=>this.onMouseEnter(4)},(0,J.h)("div",{class:"star"})),(0,J.h)("div",{class:s,onClick:()=>this.onToggleValue(5),onMouseEnter:()=>this.onMouseEnter(5)},(0,J.h)("div",{class:"star"})))}}function Ct(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Mt extends V.Mw{constructor(t){super(t),Ct(this,"state",{errorFields:{},submiting:!1}),Ct(this,"renderFormComponent",(t,e)=>"input"===t.type?this.renderField(t,e):"button"===t.type?this.renderSubmitButton(t,e):this.props.isSubmited?void 0:(0,J.h)("div",{class:"form-component form-component-block"},(0,J.h)(Q.A,{block:t}))),Ct(this,"renderSubmitButton",(t,e)=>{if(!this.props.isSubmited)return(0,J.h)("div",{class:"form-component form-component-submit-button"},this.props.errorMessage&&(0,J.h)("div",{class:"form-control--valid-input--error mb-1"},this.props.errorMessage),(0,J.h)("div",null,(0,J.h)("button",{class:"btn--start-convo",disabled:this.props.submiting},t.label)))}),Ct(this,"renderField",(t,e)=>{let n=this.state.errorFields[t.key];if(this.props.isSubmited){let e=p.A.find(this.props.submission.values,e=>e.key===t.key)||{};return e=e.value||'""',e=p.A.parseJSON(e),Array.isArray(e)&&(e=e.join(", ")),(0,J.h)("div",{class:"form-component submitted",key:t.key},(0,J.h)("label",{class:"label"},t.label),(0,J.h)("div",null,e||(0,J.h)("span",{class:"text-muted text-italic"},this.props.t("no_info_input"))))}return(0,J.h)("div",{class:"form-component",key:t.key},(0,J.h)("label",{class:"label"},t.label," ",t.is_required&&(0,J.h)("span",{class:"red"},"*")),"text"===t.input_type&&this.renderFieldTextInput(t,e),"textarea"===t.input_type&&this.renderFieldTextareaInput(t,e),"date"===t.input_type&&this.renderFieldDateInput(t,e),"radio"===t.input_type&&this.renderFieldRadioInput(t,e),"checkbox"===t.input_type&&this.renderFieldCheckboxInput(t,e),("dropdown"===t.input_type||"select"===t.input_type)&&this.renderFieldDropdownInput(t,e),"rating"===t.input_type&&this.renderFieldRatingInput(t,e),n&&(0,J.h)("div",{class:"form-control--valid-input--error"},n))}),Ct(this,"renderFieldTextInput",(t,e)=>{let n="form-control";this.state.errorFields[t.key]&&(n="form-control input--error");let i=p.A.find(this.props.submission.values,e=>e.key===t.key)||{};return i=i.value||'""',i=p.A.parseJSON(i),(0,J.h)("input",{ref:this[`${t.key}_input`],type:"text",class:n,placeholder:t.placeholder,value:i,onInput:e=>{this.onChangeValue(t.key,e.target.value),this.clearError(t.key)}})}),Ct(this,"renderFieldDateInput",(t,e)=>{let n=p.A.find(this.props.submission.values,e=>e.key===t.key)||{};n=n.value||'""',n=p.A.parseJSON(n);let i="form-control";return this.state.errorFields[t.key]&&(i="form-control input--error"),(0,J.h)("input",{ref:this[`${t.key}_input`],class:i,type:"date",value:n,onInput:e=>{this.onChangeValue(t.key,e.target.value),this.clearError(t.key)}})}),Ct(this,"renderFieldRadioInput",(t,e)=>{let n=p.A.find(this.props.submission.values,e=>e.key===t.key)||{};n=n.value||'""',n=p.A.parseJSON(n);let i="form-radios-wrapper";return p.A.size(t.input_options)>=3&&"attachment"!==this.props.mode&&(i+=" horizontal"),(0,J.h)("div",{class:i},p.A.map(t.input_options,(e,i)=>{let r=t.key+"_"+i;return(0,J.h)("div",{class:"radio"},(0,J.h)("input",{type:"radio",name:t.key,id:r,checked:e.value===n,onChange:()=>this.toggleRadioField(t.key,e.value)}),(0,J.h)("label",{class:"radio--label",for:r},e.label),(0,J.h)("div",{class:"radio--check"}))}))}),Ct(this,"renderFieldCheckboxInput",(t,e)=>{let n=p.A.find(this.props.submission.values,e=>e.key===t.key)||{};n=n.value||"[]",n=p.A.parseJSON(n);let i="form-checkboxes-wrapper";return p.A.size(t.input_options)>=3&&"attachment"!==this.props.mode&&(i+=" horizontal"),(0,J.h)("div",{class:i},p.A.map(t.input_options,(e,i)=>{let r=t.key+"_"+i;return(0,J.h)("div",{class:"checkbox"},(0,J.h)("input",{type:"checkbox",name:t.key,id:r,checked:n.includes(e.value),onChange:()=>this.toggleCheckboxField(t.key,e.value)}),(0,J.h)("label",{class:"checkbox--label",for:r},e.label),(0,J.h)("div",{class:"checkbox--check"}))}))}),Ct(this,"renderFieldDropdownInput",(t,e)=>{let n=p.A.find(this.props.submission.values,e=>e.key===t.key)||{};n=n.value||'""',n=p.A.parseJSON(n);let i="form-control";return this.state.errorFields[t.key]&&(i+=" input--error"),n||(i+=" form-control--empty"),(0,J.h)("select",{class:i,ref:this[`${t.key}_input`],onChange:e=>{this.onChangeValue(t.key,e.target.value),this.clearError(t.key)}},(0,J.h)("option",{value:""},"-- ",this.props.t("no_select")," --"),p.A.map(t.input_options,t=>(0,J.h)("option",{value:t.value},t.label)))}),Ct(this,"renderFieldTextareaInput",(t,e)=>{let n=p.A.find(this.props.submission.values,e=>e.key===t.key)||{};return n=n.value||'""',n=p.A.parseJSON(n),(0,J.h)("textarea",{onInput:e=>{this.onChangeValue(t.key,e.target.value),this.clearError(t.key)},ref:this[`${t.key}_input`],rows:"3",class:"form-control",placeholder:t.placeholder})}),Ct(this,"renderFieldRatingInput",(t,e)=>(0,J.h)(It,{onChange:e=>this.onChangeValue(t.key,e)})),Ct(this,"onSubmit",t=>{t.preventDefault(),this.validateForm()&&this.props.onSubmit()}),Ct(this,"validateForm",()=>{let t=!0,e="",n={},i=p.A.get(this.props.formSetting,"components")||[];return p.A.each(i,i=>{if("input"===i.type){let r=p.A.find(this.props.submission.values,t=>t.key===i.key)||{};if(r=r.value||'""',r=p.A.parseJSON(r),i.is_required){let o=!1;"string"!=typeof r||r.trim()||(o=!0),Array.isArray(r)&&0===r.length&&(o=!0),o&&(t=!1,n[i.key]=this.props.t("cannot_be_empty"),e=`${i.key}_input`)}if(i.validation&&!Array.isArray(r)){let o=!1,s="";"email"!==i.validation||p.A.isEmail(r)||(s="Email",o=!0),"phone"!==i.validation||p.A.isPhone(r)||(s=this.props.t("phn"),o=!0),"number"!==i.validation||p.A.isNumber(r)||(s=this.props.t("number"),o=!0),"url"!==i.validation||p.A.isURL(r)||(o=!0,s="URL"),o&&(t=!1,n[i.key]=this.props.t("format_is_invalid")+" "+s,e=`${i.key}_input`)}}}),e&&this[e]&&this[e].current&&this[e].current.focus(),this.setState({errorFields:n}),t}),Ct(this,"onChangeValue",(t,e)=>{let n=p.A.get(this.props.submission,"values")||[],i=p.A.find(n,e=>e.key===t);i?i.value=JSON.stringify(e):n.push({key:t,value:JSON.stringify(e)}),this.props.onChangeFormValues(n)}),Ct(this,"clearError",t=>{let e=this.state.errorFields;e[t]="",this.setState({errorFields:e})}),Ct(this,"renderFormHeader",()=>{let t=p.A.get(this.props.formSetting,"title")||"",e=p.A.get(this.props.formSetting,"description")||"";if("attachment"===this.props.mode&&(t.trim()||e.trim()))return(0,J.h)("div",{class:"form-component form-component-block"},t&&(0,J.h)("div",null,t),e&&(0,J.h)("div",{class:"text-sm text-muted"},e));let n=p.A.get(this.props.formSetting,"logo.url"),i=p.A.get(this.props.formSetting,"brand_url"),r=null;n&&(r=(0,J.h)("div",{class:"form-page-logo-wrapper"},(0,J.h)("a",{href:i||"javascript:;"},(0,J.h)("img",{src:n,class:"form-page-logo"}))));let o=null;return(t.trim()||e.trim())&&(o=(0,J.h)("div",{class:"form-page-header"},(0,J.h)("div",{class:"form-page-title"},t),e&&(0,J.h)("div",{class:"form-page-desc"},e))),(0,J.h)(J.FK,null,r,o)});let e=p.A.get(this.props.formSetting,"components")||[];p.A.each(e,t=>{"input"===t.type&&"checkbox"!==t.input_type&&"radio"!==t.input_type&&(this[`${t.key}_input`]=(0,J._3)())})}toggleRadioField(t,e){this.clearError(t),this.onChangeValue(t,e)}toggleCheckboxField(t,e){let n=p.A.find(this.props.submission.values,e=>e.key===t)||{};n=n.value||"[]",n=p.A.parseJSON(n),n.includes(e)?n=n.filter(t=>t!==e):n.push(e),this.clearError(t),this.onChangeValue(t,n)}render(){let t=p.A.get(this.props.formSetting,"components")||[],e=(p.A.get(this.props.formSetting,"title"),p.A.get(this.props.formSetting,"description"),"form-wrapper form");return"attachment"===this.props.mode&&(e+=" form-wrapper-attachment"),(0,J.h)("div",{class:e},this.props.isSubmited&&(0,J.h)("div",{class:"form-component"},this.props.t("you_have_submitted_info_successfully")),(0,J.h)("form",{onSubmit:this.onSubmit},this.renderFormHeader(),p.A.map(t,this.renderFormComponent)))}}function St(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Dt extends V.Mw{constructor(t){super(t),St(this,"fetchFormSetting",()=>{let t=p.A.get(this.props.ev,"data.message.attachments")||[],e=p.A.find(t,t=>"form"===t.type);if(!e)return;let n=e.url;this.token=function(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}(n,"token");let i=e.form||{},r=e.form_submission||{},o=p.A.size(r)>0;this.setState({formSetting:i,submission:r,isSubmited:o})}),St(this,"onChangeFormValues",t=>{this.setState({submission:{values:t}})}),St(this,"onSubmit",async()=>{if(this.setState({errorMessage:""}),this.state.submiting)return;this.setState({submiting:!0});let t=await this.props.store.submitForm2(this.props.store.matchAccount().id,this.token,this.state.submission);t.error?this.setState({submiting:!1,errorMessage:p.A.get(t,"error.code")}):this.setState({submiting:!1,isSubmited:!0})}),this.state={submission:{},formSetting:{},submiting:!1,errorMessage:"",isSubmited:!1}}componentDidMount(){this.fetchFormSetting()}render(){let t=p.A.get(this.props.ev,"data.message.attachments")||[];if(!p.A.find(t,t=>"form"===t.type))return;const{submission:e,formSetting:n,errorMessage:i,isSubmited:r,submiting:o}=this.state;return(0,J.h)("div",{onClick:t=>t.stopPropagation()},(0,J.h)(Mt,{store:this.props.store,formSetting:n,mode:"attachment",t:this.props.t,submission:e,errorMessage:i,isSubmited:r,submiting:o,onChangeFormValues:this.onChangeFormValues,onSubmit:this.onSubmit}))}}class jt extends V.Mw{constructor(t){super(t)}render(){return null}}function Et(t){return t.touches&&t.touches.length?t.touches[0]:{}}class Tt extends V.Mw{constructor(t){super(t),this.state={focusing:0},this.galleryRef=(0,J._3)()}componentDidMount(){this.bindDrag()}focus(t){this.setState({focusing:t}),this.galleryRef.current.scrollTo({left:220*t,behavior:"smooth"})}render(){if("user"===p.A.get(this.props.ev,"by.type"))return null;let t=p.A.get(this.props.ev,"data.message.attachments",[]),e=p.A.filter(t,t=>"generic"===p.A.get(t,"type"));return 0===e.length?null:p.A.map(e,(e,n)=>{var r=p.A.map(e.elements,t=>{let e=this.props.t.i18n(t.i18n_title)||t.title,n=this.props.t.i18n(t.i18n_subtitle)||t.subtitle,r=e?(0,J.h)("div",{class:"generic-attachment--element-title"},e):null,o=n?(0,J.h)("div",{class:"generic-attachment--element-subtitle",title:n},n):null,s=this.props.store.replaceFileUrl(t.image_url);t.image_url||(s=i());let a=["url_button","web_url"].includes(p.A.get(t,"default_action.type"))&&p.A.get(t,"default_action.url"),l="generic-attachment--element swiper-slide";return a&&(l+=" clickable"),(0,J.h)("div",{class:l,onClick:()=>a&&window.open(a,"_blank")},(0,J.h)("div",null,(0,J.h)("img",{alt:"generic attachment element",class:"generic-attachment--element-img",src:s})),(0,J.h)("div",{class:"generic-attachment--element-content"},r,o),(0,J.h)(xt,{buttons:t.buttons,onSelect:t=>this.props.onSelect(t),t:this.props.t}))});let o=p.A.get(t,"0.elements",[]),s="generic-attachment-navigator generic-attachment-navigator--left",a="generic-attachment-navigator generic-attachment-navigator--right";return 0===this.state.focusing&&(s+=" generic-attachment-navigator--disabled"),this.state.focusing===o.length-1&&(a+=" generic-attachment-navigator--disabled"),(0,J.h)("div",{class:"generic-attachment-container"},(0,J.h)("div",{class:"generic-attachment",ref:this.galleryRef},r),!this.props.store.isMobile()&&(0,J.h)(J.FK,null,(0,J.h)("div",{class:s,onClick:t=>this.focus(this.state.focusing-1)},(0,J.h)("span",{class:"generic-attachment-navigator-icon"},"‹")),(0,J.h)("div",{class:a,onClick:t=>this.focus(this.state.focusing+1)},(0,J.h)("span",{class:"generic-attachment-navigator-icon"},"›"))))})}bindDrag(){if(!this.props.store.isMobile())return;let t=document.getElementsByClassName("generic-attachment");p.A.map(t,t=>{var e,n,i;(e=t)&&(e.removeEventListener("touchstart",e.md,0),window.removeEventListener("touchend",e.mu,0),window.removeEventListener("touchmove",e.mm,0),e.md=function(t){let r=Et(t);e.hasAttribute("nochilddrag")&&document.elementFromPoint(r.pageX,r.pageY)||(i=1,n=r.clientX,t.preventDefault())},e.mu=()=>{i=0},e.mm=function(t){if(!i)return;let r=Et(t);e.scrollLeft-=-n+r.clientX,n=r.clientX},e.addEventListener("touchstart",e.md,{passive:!0}),window.addEventListener("touchend",e.mu,{passive:!0}),window.addEventListener("touchmove",e.mm,{passive:!0}))})}}class Pt extends V.Mw{render(){let t=p.A.get(this.props.ev,"by.type");if("user"===t)return null;let e=p.A.get(this.props.ev,"data.message.attachments",[]),n=p.A.filter(e,t=>"product"===p.A.get(t,"type")||"product_preview"===p.A.get(t,"type"));if(n=n.filter(t=>t.product&&t.product.name),0===n.length)return null;let r=this.props.store.matchAccount();return p.A.map(n,(e,n)=>{let o=e.product,a=[],l=o.url||o.mobile_url;this.props.store.isMobile()&&(l=o.mobile_url||o.url),l&&0==p.A.size(o.buttons)&&a.push((0,J.h)("a",{class:"product_attachment__btn",href:l,target:"_blank"},this.props.t("detail"),(0,J.h)("img",{src:s(),class:"product_attachment__btn_external_link"}))),console.log("P",o),p.A.size(o.buttons)>0&&(a=a.concat(p.A.map(o.buttons,(t,e)=>"call_button"===t.type?(0,J.h)("a",{class:"product_attachment__btn",href:"tel:"+t.phone_number,key:e,title:t.title},this.props.t.i18n(t.i18n_title)||t.title):"url_button"===t.type?(0,J.h)("a",{class:"product_attachment__btn",href:t.url,target:"_blank",key:e,title:t.title},this.props.t.i18n(t.i18n_title)||t.title||this.props.t("detail")," ",(0,J.h)("img",{src:s(),class:"product_attachment__btn_external_link"})):"postback_button"===t.type?(0,J.h)("a",{class:"product_attachment__btn",href:"javascript:;",onClick:e=>this.props.onPostback(t)},this.props.t.i18n(t.i18n_title)||t.title):void 0)));let c=(0,J.h)("a",{href:l,class:"product_attachment__title",target:"_blank"},o.name),d=null,h=o.description||o.long_description;h&&(d=(0,J.h)("div",{class:"product_attachment__subtitle"},h));let m=o.currency||p.A.get(r,"currency","VND"),u=null;o.price&&(u=(0,J.h)("div",{class:"product_attachment__price"},p.A.formatCurrency(o.price,m)));let g=this.props.store.replaceFileUrl(o.image);return o.image||(g=i()),(0,J.h)("div",{class:"product_attachment product_attachment__"+t},(0,J.h)("div",null,(0,J.h)("a",{href:this.props.store.replaceFileUrl(o.image),target:"_blank"},(0,J.h)("img",{class:"product_attachment__img",src:g}))),c,d,u,(0,J.h)("div",{class:"product_attachment__btns"},a))})}}class Lt extends V.Mw{constructor(t){super(t)}render(){let t=p.A.get(this.props.ev,"by.type");var e=p.A.get(this.props.ev,"data.message.attachments",[]),n=[];if(p.A.each(e,(t,e)=>{t&&p.A.includes(t.mimetype,"video")&&n.push(t)}),0===n.length)return null;var i=p.A.map(n,(e,n)=>(0,J.h)("div",{key:n,class:`video-attachment video-attachment--${t}`},(0,J.h)("video",{class:"video-attachment__video",src:this.props.store.replaceFileUrl(e.url),width:"100%",height:"",poster:this.props.store.replaceFileUrl(e.thumbnail_url),controls:"controls",preload:"metadata"})));return(0,J.h)("div",{class:`message-${t}`},i)}}class Nt extends V.Mw{constructor(...t){var e,n,i;super(...t),e=this,i=t=>{let e=p.A.get(t,"by.type"),n=p.A.get(t,"by.display_id",p.A.get(t,"by.id"))||"";if("user"===e)return p.A.getUserDisplayName(this.props.store.matchUser());let i=this.props.store.matchAccount();if("agent"===e)return p.A.getAgentDisplayName(i,this.props.store.matchAgent(n));if(n.startsWith("at"))return p.A.getAgentDisplayName(i,this.props.store.matchAgent(n));if("bot"===e){let t=this.props.store.matchBot()[n];return t&&t.fullname||"Bot"}return"system"===n||"dummy"===e||"workflow"===e?i.name||"system":i.name},(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n="getSenderName"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i}render(){let t="",e=p.A.get(this.props.ev,"by.type");if(p.A.get(this.props.ev,"by.id"),"user"===e)t=this.props.t("you");else{t=this.getSenderName(this.props.ev);let e=this.props.store.matchAccount()||{};p.A.get(this.props,"chatbox.hide_agent_profile")&&(t=e.name)}let n=p.A.get(this.props.ev,"data.message.attachments.0");if(n&&!p.A.get(this.props.ev,"data.message.deleted")){if(p.A.includes(n.mimetype,"image")){let e=n.url;return e.startsWith("https://")||e.startsWith("http://")||e.startsWith("content://")||e.startsWith("data:")||(e=this.props.store.FileURL+e),(0,J.h)("div",{class:"message-quote d-flex",onClick:()=>this.scrollToSourceEvent(this.props.ev)},(0,J.h)("img",{src:e,class:"message-quote-inner-img"}),(0,J.h)("div",{class:"message-quote-inner"},(0,J.h)("div",{class:"message-quote-title"},t),(0,J.h)("div",{class:"message-quote-content"},"[",this.props.t("image"),"]")))}return(0,J.h)("div",{class:"message-quote",onClick:()=>this.scrollToSourceEvent(this.props.ev)},(0,J.h)("div",{class:"message-quote-title"},t),(0,J.h)("div",{class:"message-quote-content"},"[File] ",n.name))}p.A.get(this.props.ev,"data.message.format","plaintext");let i=p.A.get(this.props.ev,"data.message.block"),r=p.A.get(this.props.ev,"data.message.text");return i&&(r=p.A.blockToText(i)||r),p.A.get(this.props.ev,"data.message.deleted")&&(r=this.props.t("recalled_message")),(0,J.h)("div",{class:"message-quote",onClick:()=>this.scrollToSourceEvent(this.props.ev)},(0,J.h)("div",{class:"message-quote-title"},t),(0,J.h)("div",{class:"message-quote-content"},r))}scrollToSourceEvent(t){let e=document.querySelector(`.convo-event[data-ev-id=${t.id}]`);e&&"function"==typeof e.scrollIntoViewIfNeeded&&e.scrollIntoViewIfNeeded(),this.props.onFocusSourceEventFromQuote(t)}}class Ft extends V.Mw{constructor(t){super(t),this.state={focused:!1}}renderTime(){return null}componentWillUnmount(){p.A.clearTimeout(this.focusTimeout)}focusSourceEventFromQuote(t){if(t.id!==this.props.ev.id)return;let e=p.A.get(t,"data.message.fields")||[],n=p.A.find(e,t=>"attachment_index"===t.key),i=p.A.get(n,"value");try{i=p.A.parseJSON(i)}catch(t){i=void 0}void 0===i&&(this.setState({focused:!0}),this.focusTimeout&&p.A.clearTimeout(this.focusTimeout),this.focusTimeout=p.A.setTimeout(()=>{this.setState({focused:!1})},3e3))}render(){if(p.A.get(this.props.ev,"data.message.deleted")){let t="user"===p.A.get(this.props.ev,"by.type")?"user":"agent";return(0,J.h)("div",{class:"message-"+t+" message-text--"+t+" message-text--deleted"},this.props.t("recalled_message"))}let t=p.A.get(this.props.ev,"data.message.block");return t&&!p.A.isEmptyBlock(t)?this.renderBlock(t):this.renderPlainText()}renderPlainText(){var t=p.A.get(this.props.ev,"data.message.text");if(t=p.A.trim(t),0===p.A.size(t))return null;let e=new p.A.Date(p.A.get(this.props.ev,"created")).toLocaleString(),n=p.A.get(this.props.ev,"by.type");"user"!==n&&(n="agent");var i=p.A.extractText(t).map(t=>{if("emoji"===t.type)return(0,J.h)(Y.A,{emojiCode:t.text,byType:n});if("link"===t.type){let e=t.text||"";return e.startsWith("//")||e.startsWith("https://")||e.startsWith("http://")||e.startsWith("data:")||(e="//"+e),e=(0,wt.P)(e),e?(0,J.h)("a",{class:"text-message-link",href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>this.props.onLink&&this.props.onLink(t,e)},t.text):t.text}return"phone"===t.type?(0,J.h)("a",{class:"text-message-link",href:"tel:"+t.text},t.text):"email"===t.type?(0,J.h)("a",{class:"text-message-link",href:"mailto:"+t.text},t.text):t.text});if(0===p.A.size(i))return null;let r=p.A.get(this.props.ev,"data.message.attachments",[]),o=p.A.find(r,t=>"quote"===t.type);if("agent"===n){let t="message-agent message-text--agent";return this.state.focused&&(t+=" just-focused"),(0,J.h)("div",{class:t,title:e},o&&(0,J.h)(Nt,{ev:p.A.get(o,"quote"),t:this.props.t,store:this.props.store,onFocusSourceEventFromQuote:this.props.onFocusSourceEventFromQuote}),i,this.renderTime())}let s="message-user message-text--user";return this.props.ev._error&&(s+=" message-user--error"),this.state.focused&&(s+=" just-focused"),(0,J.h)("div",{class:s,title:e},i)}renderBlock(t){if(p.A.isEmptyBlock(t))return null;let e=new p.A.Date(p.A.get(this.props.ev,"created")).toLocaleString(),n=p.A.get(this.props.ev,"by.type");if("user"!==n&&(n="agent"),"agent"===n)return(0,J.h)("div",{class:"message-agent message-text--agent",title:e},(0,J.h)(Q.A,{block:t,onLink:this.props.onLink,store:this.props.store,t:this.props.t,textMessage:!0}),this.renderTime());let i="message-user message-text--user";return this.props.ev._error&&(i+=" message-user--error"),(0,J.h)("div",{class:i,title:e},(0,J.h)(Q.A,{block:t,onLink:this.props.onLink,store:this.props.store,t:this.props.t,textMessage:!0}))}}class Rt extends V.Mw{render(){let t=this.props.ev.ev;if("conversation_rated"===t.type){var e=p.A.get(t,"data.conversation.ratings.0",{no_rating:!0,rating:0});return e.no_rating?null:(0,J.h)("div",{class:"convo-event"},(0,J.h)("div",{class:"info-message"},this.props.t("rated_as")+" "+this.props.t(function(t){return t?t<2?"poor":t<4?"average":"great":"poor"}(e.rating)).toLowerCase()))}return"conversation_state_updated"===t.type&&"ended"===p.A.get(t,"data.conversation.state")?(0,J.h)("div",{class:"convo-event"},(0,J.h)("div",{class:"info-message info-message--ended"},this.props.t("conversation_ended"))):null}}var Wt=n(1620);function Ut(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let Ot=!1;class Bt extends V.Mw{constructor(t){super(t),Ut(this,"focusSourceEventFromQuote",t=>{let e=this.textMessageRef.current;e&&"function"==typeof e.focusSourceEventFromQuote&&e.focusSourceEventFromQuote(t);let n=this.fileAttachmentRef.current;n&&"function"==typeof n.focusSourceEventFromQuote&&n.focusSourceEventFromQuote(t);let i=this.imageAttachmentRef.current;i&&"function"==typeof i.focusSourceEventFromQuote&&i.focusSourceEventFromQuote(t)}),Ut(this,"resendMessage",()=>{let t=p.A.convoOfEv(this.props.event.ev);const e=p.A.get(this.props.event,"ev.data.message");this.props.store.sendConvoEvent(t,"message_sent",{message:e})}),this.props.store.onConvoEvent(this,t=>this.onEvent(t)),this.refForm=(0,J._3)(),this.state={pongs:p.A.get(this.props.event,"ev.data.message.pongs")||[]};const e=this.props.event.ev,n=(this.props.store.now?this.props.store.now():p.A.Date.now())-e.created;this.animateSend=!t.isHistory&&"message_sent"===e.type&&"user"===p.A.get(e,"by.type")&&e.id===p.A.get(e,"source_event_id")&&n>=0&&n<2e3,this.textMessageRef=(0,J._3)(),this.fileAttachmentRef=(0,J._3)(),this.imageAttachmentRef=(0,J._3)()}componentDidMount(){this.animateSend&&(this.sendAnimationFrame=window.requestAnimationFrame(()=>{this.sendAnimationFrame=window.requestAnimationFrame(()=>{this._isMounted&&this.setState({sendEntered:!0})})}))}componentWillUnmount(){this.sendAnimationFrame&&window.cancelAnimationFrame(this.sendAnimationFrame)}render(){var t=p.A.get(this.props.event,"ev",{});switch(t.type){case"conversation_typing":return this.renderTyping();case"conversation_joined":break;case"message_sent":return this.props.event.is_typing?this.renderTyping():this.renderMessageSent();case"conversation_state_updated":case"conversation_rating_requested":case"conversation_rated":return p.A.startsWith(t.id,"ev")?(0,J.h)(Rt,{t:this.props.t,store:this.props.store,ev:this.props.event}):null}return null}focus(){this.refForm.current&&this.refForm.current.focus()}onEvent(t){t.id===p.A.get(this.props.event,"ev.id")&&this.setState({pongs:p.A.get(t,"data.message.pongs")||[]})}hasLike(){let{pongs:t}=this.state;return!!p.A.find(t,t=>"like"===t.type)}hasDislike(){let{pongs:t}=this.state;return!!p.A.find(t,t=>"dislike"===t.type)}chooseQuickReply(t){if(this.props.isHistory)return;let e=p.A.get(this.props.event,"ev",{}),n={text:t.title,format:"plaintext"};t.payload&&(n.attachments=[{type:"postback",postback:{event_id:e.id,payload:t.payload}}]),this.props.onSend(n)}choosePostbackBtn(t){if(this.props.isHistory)return;let e=p.A.get(this.props.event,"ev",{}),n={text:t.title,format:"plaintext"};t.payload&&(n.attachments=[{type:"postback",postback:{event_id:e.id,payload:t.payload}}]),this.props.onSend(n)}renderAgentAvatar(t){let e=p.A.get(t,"by.type"),n=p.A.get(t,"by.display_id",p.A.get(t,"by.id"));if("user"===e)return null;var i=this.getSenderName(t);let o=this.props.store.matchAccount();var s=o.logo_url||a();if(p.A.get(this.props,"chatbox.hide_agent_profile"))return(0,J.h)("div",{class:"message-sender"},(0,J.h)("img",{alt:"sender",class:"message-sender-avatar",src:this.props.store.replaceFileUrl(s)}),(0,J.h)("p",{class:"message-sender-name"},o.name));let l=this.props.store.matchAgent("*");return"system"!==n&&"dummy"!==e&&"workflow"!==e&&(s=p.A.get(l[n],"avatar_url")||o.logo_url||r()),(0,J.h)("div",{class:"message-sender"},(0,J.h)("img",{alt:"sender",class:"message-sender-avatar",src:this.props.store.replaceFileUrl(s)}),(0,J.h)("p",{class:"message-sender-name"},i))}tryLoadOrder(t){if("user"!==p.A.get(t,"by.type")){this.props.store.matchAccount();var e=p.A.get(t,"data.message.attachments",[]);0!==p.A.filter(e,t=>"order"===t.type&&t.order).map(t=>t.order).length&&(Ot||p.A.setTimeout(async()=>{Ot=(await n.e(127).then(()=>n(6127))).default}))}}renderTyping(){if(!this.props.event.is_show)return(0,J.h)("div",{key:"container",class:"convo-event agent-message",style:"opacity: 0 !important"},(0,J.h)("div",{class:"agent-convo-event-wrapper"},(0,J.h)("div",{class:"agent-convo-event-inner"},(0,J.h)("div",{class:"message-agent message-text--agent",style:"opacity: 0.6 !important"},(0,J.h)("div",{style:"height: 20px !important; width: 35px !important"})))));let t="data:text/html,"+encodeURIComponent('\n<html>\n <head>\n <style>\n .typing-container {\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n gap: 4px;\n justify-content: center;\n }\n .typing-dot {\n display: inline-block;\n vertical-align: middle;\n width: 8px;\n height: 8px;\n background: black;\n border-radius: 50%;\n animation: typing 0.5s infinite alternate;\n }\n .typing-dot:nth-of-type(2) {\n animation-delay: 0.2s;\n }\n .typing-dot:nth-of-type(3) {\n animation-delay: 0.6s;\n }\n @keyframes typing {\n 0% {\n opacity: 0.9;\n }\n 100% {\n opacity: 0.4;\n }\n }\n </style>\n </head>\n <body style="padding: 0; margin: 0">\n <div class="typing-container">\n <span class="typing-dot"></span>\n <span class="typing-dot"></span>\n <span class="typing-dot"></span>\n </div>\n </body>\n</html>\n');return(0,J.h)("div",{key:"container",class:"convo-event agent-message",style:"opacity: 0.6 !important"},(0,J.h)("div",{class:"agent-convo-event-wrapper"},(0,J.h)("div",{class:"agent-convo-event-inner"},(0,J.h)("div",{class:"message-agent message-text--agent"},(0,J.h)("iframe",{src:t,style:"width: 35px !important; height: 20px !important; display: block !important; overflow: hidden !important; padding: 0 !important "})))))}renderMessageSent(){let t=this.props.event.ev;if(p.A.get(t,"data.message.deleted")){let e="user"===p.A.get(t,"by.type")?"user":"agent";return(0,J.h)("div",{class:"convo-event "+e+"-message","data-ev-id":t.id},(0,J.h)(Ft,{ev:t,t:this.props.t,store:this.props.store}))}let e=p.A.get(t,"data.message.attachments"),n=p.A.find(e,t=>"form"===t.type);if(p.A.isEmptyMessage(p.A.get(t,"data.message")))return null;if(this.tryLoadOrder(t),new p.A.Date(t.created).toLocaleString(),"user"!==p.A.get(t,"by.type")){let e=null;"lead"===this.props.event.mode&&(e=this.renderAgentAvatar(t));let i="agent-convo-event-inner";this.props.isLast&&(i+=" last");let r="agent-convo-event-wrapper";return n&&(r+=" full"),(0,J.h)("div",{class:"convo-event agent-message","data-ev-id":t.id},e,(0,J.h)("div",{class:r},(0,J.h)("div",{class:i},(0,J.h)(Ft,{ref:this.textMessageRef,onFocusSourceEventFromQuote:this.props.onFocusSourceEventFromQuote,showTime:this.props.event.show_time,isLast:this.props.isLast,store:this.props.store,t:this.props.t,ev:t,onLink:this.props.onLink}),(0,J.h)(vt,{ref:this.imageAttachmentRef,store:this.props.store,ev:t,focusSourceEventFromQuote:this.props.focusSourceEventFromQuote}),(0,J.h)(yt,{store:this.props.store,ev:t}),(0,J.h)(Lt,{store:this.props.store,ev:t}),(0,J.h)(_t,{ref:this.fileAttachmentRef,store:this.props.store,ev:t,focusSourceEventFromQuote:this.props.focusSourceEventFromQuote}),(0,J.h)(kt,{store:this.props.store,ev:t,t:this.props.t}),(0,J.h)(Dt,{store:this.props.store,ev:t,t:this.props.t}),(0,J.h)(jt,{store:this.props.store,ev:t,t:this.props.t}),(0,J.h)(Tt,{store:this.props.store,ev:t,onSelect:t=>this.choosePostbackBtn(t),t:this.props.t}),(0,J.h)(Pt,{t:this.props.t,onPostback:t=>this.choosePostbackBtn(t),store:this.props.store,ev:t}),(0,J.h)(Ot,{t:this.props.t,store:this.props.store,ev:t}),!this.props.isHistory&&(0,J.h)(At,{store:this.props.store,ev:t,onSelect:t=>this.chooseQuickReply(t)}),this.renderReactions(),this.renderAIDevNote())))}p.A.get(t,"source_event_id")===t.id&&this.props.store.now()-t.created<900&&p.A.setTimeout(()=>this.setState({refresh:this.state.refresh}),1e3);let i=(0,J.h)("div",{class:"sending_dot"});(this.props.store.now()-t.created<900||p.A.get(t,"source_event_id")!==t.id)&&(i=(0,J.h)("div",{class:"sending_dot sending_dot__hide"}));let r=null;"lead"===this.props.event.mode&&"user"!==p.A.get(t,"by.type")&&(r=(0,J.h)("div",{class:"pt-3"}));let o=null;if(t._error&&(i=null),t._error&&"message_sent"===t.type){let e=this.props.t("error_send_message");t._error_message&&(e=this.props.t(t._error_message)),o=(0,J.h)("a",{class:"message_error",src:"javascript:;",onClick:this.resendMessage},(0,J.h)("div",{class:"message_error__icon"})," ",(0,J.h)("div",{class:"message_error__text"},e))}return(0,J.h)("div",{class:"convo-event user-message","data-ev-id":t.id},r,(0,J.h)("div",{class:"message-user__container"+(this.animateSend&&!this.props.isHistory?" message-user__container--send"+(this.state.sendEntered?"":" message-user__container--enter"):"")},i,(0,J.h)(Ft,{ref:this.textMessageRef,store:this.props.store,t:this.props.t,ev:t,refresh:this.state.refresh,onLink:this.props.onLink}),(0,J.h)(vt,{store:this.props.store,ev:t,ref:this.imageAttachmentRef}),(0,J.h)(yt,{store:this.props.store,ev:t}),(0,J.h)(Lt,{store:this.props.store,ev:t}),(0,J.h)(_t,{store:this.props.store,ev:t,ref:this.fileAttachmentRef}),(0,J.h)(kt,{store:this.props.store,ev:t,t:this.props.t}),(0,J.h)(Dt,{store:this.props.store,t:this.props.t,ev:t}),(0,J.h)(Pt,{t:this.props.t,store:this.props.store,ev:t}),(0,J.h)(jt,{store:this.props.store,ev:t})),o)}async onSendReaction(t){if(this.props.isHistory)return;if(this._reacting)return;let e=this.props.event.ev,n=p.A.get(e,"data.message.conversation_id");e={type:"message_pong",data:{message:{id:e.id,pongs:[{type:t}],conversion_id:n}}},"dislike"==t&&this.props.store.isAIDevMode()&&this.props.store.emitConvoEvent({type:"bad_feedbacked",data:{event:e,id:e.id,conversion_id:n}});let{pongs:i}=this.state;"like"===t?(i=i.filter(t=>"dislike"!==t.type),i.push({type:"like"})):"dislike"===t?(i=i.filter(t=>"like"!==t.type),i.push({type:"dislike"})):"remove_like"===t?i=i.filter(t=>"like"!==t.type):"remove_dislike"===t&&(i=i.filter(t=>"dislike"!==t.type)),this.setState({pongs:i}),this._reacting=!0,await this.props.store.sendReaction(n,e),this._reacting=!1}renderReactions(){if(this.props.isHistory)return null;if(this.props.store.isAIDevMode())return null;if(p.A.get(this.props.event.ev,"data.message.conversation_id","").startsWith("cslight"))return null;let t=p.A.get(this.props.event,"ev")||{};if(p.A.get(t,"data.message.deleted"))return;p.A.get(t,"data.message.pongs");let e=this.hasLike(),n=this.hasDislike(),i="message-event-action-btn";e&&(i+=" active");let r="message-event-action-btn";n&&(r+=" active");let o="message-event-actions";return p.A.get(this.props.event,"is_end")&&(o+=" ended"),(0,J.h)(J.FK,null,(0,J.h)("div",{class:o},(0,J.h)("div",{class:i,onClick:()=>this.onSendReaction(e?"remove_like":"like")},(0,J.h)("div",{class:"message-event-action-btn-svg like"})),(0,J.h)("div",{class:r,onClick:()=>this.onSendReaction(n?"remove_dislike":"dislike")},(0,J.h)("div",{class:"message-event-action-btn-svg dislike"}))),p.A.get(this.props.event,"is_end")&&!this.props.isConvoEnded&&(0,J.h)("div",{class:"message-event-actions-static"},(0,J.h)("div",{class:i,onClick:()=>this.onSendReaction(e?"remove_like":"like")},(0,J.h)("div",{class:"message-event-action-btn-svg like"})),(0,J.h)("div",{class:r,onClick:()=>this.onSendReaction(n?"remove_dislike":"dislike")},(0,J.h)("div",{class:"message-event-action-btn-svg dislike"}))))}renderAIDevNote(){if(!this.props.store.isAIDevMode())return null;if(p.A.get(this.props.event.ev,"data.message.conversation_id","").startsWith("cslight"))return null;let t=p.A.get(this.props.event,"ev")||{},e=(p.A.get(t,"data.message.pongs"),this.hasLike()),n=this.hasDislike(),i="message-event-action-btn message-event-action-btn__dev message-event-action-btn_like";e&&(i+=" active");let r="message-event-action-btn message-event-action-btn__dev message-event-action-btn_dislike";return n&&(r+=" active"),(0,J.h)("div",{class:"message-event-actions-static"},(0,J.h)("div",{class:i,onClick:()=>this.onSendReaction(e?"remove_like":"like")},(0,J.h)("div",{class:"message-event-action-btn-svg like"})," Good"),(0,J.h)("div",{class:r,onClick:()=>this.onSendReaction(n?"remove_dislike":"dislike")},(0,J.h)("div",{class:"message-event-action-btn-svg dislike"})," Bad"),(0,J.h)("div",{class:"message-event-action-btn message-event-action-btn__dev",onClick:()=>this.props.store.onShowMessageInfo(t.id)},(0,J.h)("div",{class:"message-event-action-btn-svg info"})," Info"))}renderUpdateConvo(t){var e=p.A.get(t,"data.conversation.state");return"active"===e||"pending"===e?null:(0,J.h)("div",{class:"message-system"},this.props.t("conversation_state_updated",{state:e}))}getSenderName(t){let e=p.A.get(t,"by.type"),n=p.A.get(t,"by.display_id",p.A.get(t,"by.id"))||"";if("user"===e)return p.A.getUserDisplayName(this.props.store.matchUser());let i=this.props.store.matchAccount();if("agent"===e||"agent"===p.A.get(t,"by.display_type"))return p.A.getAgentDisplayName(i,this.props.store.matchAgent(n));if(n.startsWith("at"))return p.A.getAgentDisplayName(i,this.props.store.matchAgent(n));if("bot"===e){let t=this.props.store.matchBot()[n];return t&&t.fullname||"Bot"}return"system"===n||"dummy"===e||"workflow"===e?i.name||"system":i.name}}const Ht=n(1370);class Gt extends V.Mw{constructor(t){var e,n,i;super(t),e=this,i=t=>{let e=this.evRefs[t.id];e&&e.focusSourceEventFromQuote(t)},(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n="onFocusSourceEventFromQuote"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.props.store.onUpdate(this,t=>this.forceUpdate()),this.props.store.onConvoEvent(this,t=>this.onEvent(t)),this.loadConvo(),this.refBody=null,this.evRefs={},this.checkAndSeen=p.A.throttle(()=>{this.props.isShow&&this.isBottom()&&"visible"===this.props.store.browserVisibility&&document.hasFocus()&&this.props.store.seenConvo(this.props.cid)},500),this.checkAndSeen()}componentDidMount(){this.syncTimer=p.A.setInterval(()=>this.syncMessages(),12e4),this.resumeSync=()=>this.syncMessages(),window.addEventListener("focus",this.resumeSync),document.addEventListener("visibilitychange",this.resumeSync),this.syncMessages(),this.setState({isShowTyping:!1,typing_event:{}}),this.props.store.onConvoEvent(this,t=>{if(p.A.convoOfEv(t)!==this.props.cid)return;if("user"===p.A.get(t,"by.type"))return;let e=p.A.get(this.state.typing_event,"by.id");return e&&p.A.get(t,"by.id")!==e?void 0:"message_sent"===p.A.get(t,"type")?(this.timer&&p.A.clearTimeout(this.timer),this.timer=null,void this.setState({isShowTyping:!1})):void("conversation_typing"===p.A.get(t,"type")&&("agent"!=(this.props.store.matchAgent(p.A.get(t,"by.id"))||{}).type||p.A.get(this.props.plugin,"chatbox.show_agent_typing"))&&(this.setState({typing_event:t,isShowTyping:!0}),this.timer&&p.A.clearTimeout(this.timer),this.timer=p.A.setTimeout(()=>{p.A.convoOfEv(t)===this.props.cid&&(this.timer=null,this.setState({isShowTyping:!1}))},5e3)))}),this.props.store.onMessageUpdated(this,async t=>{const e=p.A.convoOfEv(t);this.visibleCounts&&this.visibleCounts[e]&&(await this.props.store.reloadConvoEvents(e),this.forceUpdate())}),this.restoreInitialBottom(),this.observeHistoryStart()}componentDidUpdate(t){t.cid===this.props.cid||this.isDraftPromotion(t,this.props)||this.loadConvo(),(t.cid!==this.props.cid||!t.isShow&&this.props.isShow)&&this.syncMessages(),this.restoreInitialBottom(),this.observeHistoryStart()}componentWillReceiveProps(t){if(t.cid!==this.props.cid){if(this.isDraftPromotion(this.props,t))return this.visibleCounts[t.cid]=this.visibleCounts[this.props.cid]||30,void delete this.visibleCounts[this.props.cid];this.loadVersion=(this.loadVersion||0)+1,this.visibleCounts=this.initialVisibleCounts(t),this.evRefs={},this.historyBusy=!0,this.setState({error:!1,historyError:!1,historyLoading:!1,isShowTyping:!1,loading:!!t.cid&&p.A.Date.now()})}}isDraftPromotion(t,e){return!!t.cid&&p.A.get(e.store.widgetConvoOrigins,e.cid)===t.cid}initialVisibleCounts(t){const e=t.cid?{[t.cid]:30}:{};if(!t.store.matchConvo||"widget"!==p.A.get(t.store.matchConvo(t.cid),"light_type"))return e;const n=gt(t.store,t.cid).slice(0,-1).reverse();let i=30;for(const r of n){const n=p.A.size(t.store.listEvents(r.id));if(!n||!i)break;if(e[r.id]=Math.min(n,i),i-=e[r.id],!p.A.get(t.store.outofmsgM,r.id))break}return e}syncMessages(){if(!this._isMounted||!this.props.isShow||"hidden"===document.visibilityState)return;const t=Object.keys(this.visibleCounts||{}).filter(t=>this.visibleCounts[t]);return Promise.all(t.map(t=>this.props.store.syncConvoEvents(t)))}componentWillUnmount(){p.A.clearInterval(this.syncTimer),window.removeEventListener("focus",this.resumeSync),document.removeEventListener("visibilitychange",this.resumeSync),this.loadVersion=(this.loadVersion||0)+1,this.timer&&p.A.clearTimeout(this.timer),this.historyCheckTimer&&p.A.clearTimeout(this.historyCheckTimer),this.historyObserver&&this.historyObserver.disconnect(),this.scrollTimer&&p.A.clearTimeout(this.scrollTimer),this.initialSizeObserver&&this.initialSizeObserver.disconnect()}stopInitialBottom(){this.initialBottom=!1}restoreInitialBottom(){this.initialBottom&&!1!==this.props.isShow&&this.refBody&&(!window.ResizeObserver||this.initialObservedBody===this.refBody&&this.initialObservedContent===this.refContent||(this.initialSizeObserver&&this.initialSizeObserver.disconnect(),this.initialObservedBody=this.refBody,this.initialObservedContent=this.refContent,this.initialSizeObserver=new window.ResizeObserver(()=>{this._isMounted&&this.restoreInitialBottom()}),this.initialSizeObserver.observe(this.refBody),this.refContent&&this.initialSizeObserver.observe(this.refContent)),this.refBody.scrollTop=this.refBody.scrollHeight,this.checkAndSeen&&this.checkAndSeen())}observeHistoryStart(){this.observedHistoryStart===this.historyStart&&this.observedHistoryRoot===this.refBody||(this.historyObserver&&this.historyObserver.disconnect(),this.observedHistoryStart=this.historyStart,this.observedHistoryRoot=this.refBody,this.historyStart&&this.refBody&&window.IntersectionObserver&&(this.historyObserver=new window.IntersectionObserver(t=>{t.some(t=>t.isIntersecting)&&this.queueHistoryCheck()},{root:this.refBody}),this.historyObserver.observe(this.historyStart))),this.queueHistoryCheck()}queueHistoryCheck(){!this.historyCheckTimer&&this._isMounted&&(this.historyCheckTimer=p.A.setTimeout(()=>{this.historyCheckTimer=null,this.loadVisibleHistory()},0))}loadVisibleHistory(){if(!this._isMounted||!1===this.props.isShow||this.historyBusy||this.state.historyError||!this.hasMore())return;if(!this.refBody||!this.historyStart)return;const t=this.refBody.getBoundingClientRect(),e=this.historyStart.getBoundingClientRect();return t.width<=0||t.height<=0||e.height<=0||e.right<=Math.max(t.left,0)||e.left>=Math.min(t.right,window.innerWidth)?void 0:e.bottom>Math.max(t.top,0)&&e.top<Math.min(t.bottom,window.innerHeight)?this.loadMore():void 0}setEventChildRef(t,e){this.evRefs[e]=t}ShowTyping(){this.setState({isShowTyping:!0,typing_event:{id:"evzz"+p.A.Date.now(),created:p.A.Date.now(),by:{type:"agent"},type:"conversation_typing"}}),this.timer&&p.A.clearTimeout(this.timer),this.timer=p.A.setTimeout(()=>{this.timer=null,this.setState({isShowTyping:!1})},5e3)}render(){if(this.state.error)return this.renderError();const t=gt(this.props.store,this.props.cid).filter(t=>this.visibleCounts&&this.visibleCounts[t.id]);let e=t.flatMap(t=>{const e=function(t,e){const n=p.A.orderBy(p.A.map(t.listEvents(e.id)),"created","asc"),i=new Map;for(const t of n){const e=bt(t),n=i.get(e);n?n.id===n.source_event_id&&t.id!==t.source_event_id&&i.set(e,{...t,created:n.created}):i.set(e,t)}return[...i.values()].map(t=>({ev:t}))}(this.props.store,t).slice(-this.visibleCounts[t.id]).filter(e=>t.id===this.props.cid||"conversation_state_updated"!==e.ev.type);return function(t,e){if((e=e.filter(t=>ut(t.ev))).length<1)return;for(var n,i=1;i<e.length;i++){let t=e[i],r=e[i-1];"user"==p.A.get(t,"ev.by.type")||t.is_typing||(n=t),ut(t.ev)&&p.A.unixSec(t.ev.created)-p.A.unixSec(r.ev.created)>300&&(t.show_time=!0)}for(n&&(n.show_time=!0),i=0;i<e.length;i++){let t=e[i];if("message_sent"===p.A.get(t,"ev.type")){t.show_time=!0;break}}let r=-1;for(i=0;i<e.length;i++){let t=e[i],n=e[i-1],o=e[i+1];"message_sent"!==t.ev.type||(r=i,t.mode="lead","message_sent"===p.A.get(n,"ev.type")&&p.A.get(n,"ev.by.id")===p.A.get(t,"ev.by.id")&&(t.mode="follow"),"message_sent"===p.A.get(o,"ev.type")&&p.A.get(o,"ev.by.id")===p.A.get(t,"ev.by.id")||(t.is_end=!0))}r>-1&&(e[r].is_last_message_send=!0)}(0,e),e.map(e=>({...e,convo:t}))});this.state.loading||this.props.creating||0!==e.length||this.props.cid||(this.greetingCreated||(this.greetingCreated=p.A.Date.now()),e.push({mode:"lead",is_last_message_send:!0,ev:{...ft(this.props.chatbox,this.props.t,this.greetingCreated),id:"widget-virtual-greeting"}})),this.renderedIds=new Set(e.map(t=>t.ev.id));let n=this.props.store.matchConvo(this.props.cid),i=this.state.typing_event||{id:"evzz"+p.A.Date.now(),created:p.A.Date.now(),by:{type:"agent"}},r={is_typing:!0,is_show:this.state.isShowTyping,id:i.id,ev:{id:i.id,created:i.created,by:i.by,type:"message_sent",data:{message:{text:"...",conversation_id:this.props.cid}}}};const o=e.some(t=>"message_sent"===t.ev.type);e.push(r);let s=p.A.map(e,t=>{const e=t.convo||n,i=e&&e.id!==this.props.cid;let r=!i&&t.is_last_message_send&&"ended"!==p.A.get(e,"state");const o=e?e.id:"",s=(p.A.get(this.props.store.widgetConvoOrigins,o)||o)+":"+bt(t.ev);return(0,J.h)("fieldset",{class:i?"conversation-event conversation-event--history":"conversation-event",disabled:i,"data-conversation-id":e&&e.id,key:s},(0,J.h)(Bt,{isHistory:i,isLast:r,chatbox:this.props.chatbox,onLink:this.props.onLink,store:this.props.store,onFormSubmit:this.props.onFormSubmit,onSend:this.props.onSend,onPostback:this.props.onPostback,onFocusSourceEventFromQuote:this.onFocusSourceEventFromQuote,ref:e=>this.setEventChildRef(e,t.ev.id),isConvoEnded:"ended"===p.A.get(e,"state"),event:t,t:this.props.t,key:s}))}),a=null;return o||!this.props.creating&&!this.state.loading||(a=(0,J.h)(ht.A,{static:!0,mode:p.A.get(this.props.chatbox,"primary_color","dark"),size:"120",center:!0})),(0,J.h)(J.FK,null,a,(0,J.h)("div",{ref:t=>this.refBody=t,class:"widget-body--events-container",onMouseOver:this.checkAndSeen,onScroll:()=>this.queueHistoryCheck(),onWheel:()=>this.stopInitialBottom(),onTouchStart:()=>this.stopInitialBottom(),onPointerDown:()=>this.stopInitialBottom(),onKeyDown:()=>this.stopInitialBottom()},this.hasMore()&&(0,J.h)("div",{ref:t=>{this.historyStart=t},class:"conversation-history-start","aria-hidden":"true"}),this.state.historyLoading&&!this.state.historyError&&(0,J.h)(ht.A,{size:"16",mode:"blue"}),this.state.historyError&&this.renderHistoryError(),(0,J.h)("div",{class:"widget-body--events",ref:t=>{this.refContent=t}},s),(0,J.h)(pt,{store:this.props.store})))}renderHistoryError(){const t=this.props.t,e=t("load_history_error"),n=(t.locale?t.locale().toLowerCase():"en").startsWith("vi")?"Chưa tải được tin nhắn cũ":"Couldn’t load earlier messages",i=e&&"load_history_error"!==e?e:n;return(0,J.h)("div",{class:"conversation-history-error",role:"status"},(0,J.h)("span",{class:"conversation-history-error__text"},i),(0,J.h)("button",{class:"conversation-history-error__retry",type:"button",disabled:this.state.historyLoading,"aria-label":t("try_again"),"aria-busy":!!this.state.historyLoading,onClick:()=>this.loadMore()},(0,J.h)("span",{class:"conversation-history-error__retry-label",style:{visibility:this.state.historyLoading?"hidden":"visible"}},t("try_again")),this.state.historyLoading&&(0,J.h)("span",{class:"conversation-history-error__spinner","aria-hidden":"true"},(0,J.h)(ht.A,{size:"14"}))))}renderError(){let t=(0,J.h)("a",{href:"#",onclick:t=>this.loadConvo()},this.props.t("try_again"));return this.state.loading&&(t=(0,J.h)(ht.A,{size:"16",mode:"blue"})),(0,J.h)("div",{class:"widget-body--events-container widget-body--events-container__error"},(0,J.h)("img",{alt:"empty",class:"widget_body_empty_img",src:Ht}),(0,J.h)("div",{class:"widget_body__events__error_msg"},this.props.t("load_convo_error")),(0,J.h)("div",{class:"widget_body__events__error_retry"},t))}focus(){let t=this.props.store.listEvents(this.props.cid);var e;t=p.A.orderBy(p.A.map(t),"created","desc");for(let n of t)if("message_sent"===p.A.get(n,"type")&&"user"!==p.A.get(n,"by.type")){e=n;break}"user"===p.A.get(e,"by.type")&&(e=null);let n=p.A.get(e,"data.message.attachments",[]),i=this.props.store.matchConvo(this.props.cid);p.A.filter(n,t=>{if(!t)return!1;if("form"!==t.type&&"ask_info_form"!==t.type)return!1;var e=t.form;return!(!e||!(p.A.parseJSON(e.state)||{}).require_finished&&"ask_info_form"!==t.type||function(t){let e=p.A.get(t,"fields")||[];return p.A.find(e,t=>!!t.answered)}(t.form)||"ended"===i.state)})}onEvent(t){const e=p.A.convoOfEv(t);if(!this.visibleCounts||!this.visibleCounts[e])return;if("message_sent"===t.type){const n=p.A.get(t,"source_event_id"),i=e+":"+(n||t.id);this.receivedMessageKeys=this.receivedMessageKeys||new Set;const r=this.receivedMessageKeys.has(i)||this.renderedIds&&(this.renderedIds.has(t.id)||this.renderedIds.has(n));if(this.receivedMessageKeys.add(i),r)return;this.renderedIds&&this.visibleCounts[e]++}if(e!==this.props.cid){const t=this.refBody,e=t?t.scrollHeight:0,n=t?t.scrollTop:0;return this.forceUpdate(),void p.A.setTimeout(()=>{t&&t===this.refBody&&(t.scrollTop=n+t.scrollHeight-e)})}let n=this.isBottom();"message_sent"===t.type&&this.stopInitialBottom();var i=!1;"message_sent"===p.A.get(t,"type")&&t.id===p.A.get(t,"source_event_id")&&(i=!0),(i||n)&&this.scrollToBottom("smooth")}historyTarget(){const t=gt(this.props.store,this.props.cid),e=t.findIndex(t=>this.visibleCounts&&this.visibleCounts[t.id]);if(e<0)return;const n=t[e],i=p.A.size(this.props.store.listEvents(n.id));return this.visibleCounts[n.id]<i||!n.id.startsWith("cslight")&&!p.A.get(this.props.store.outofmsgM,n.id)?n:t[e-1]}hasMore(){return!!this.historyTarget()}async fetchPage(t){if(t.startsWith("cslight")||p.A.get(this.props.store.outofmsgM,t))return{};this.eventRequests=this.eventRequests||new Map;let e=this.eventRequests.get(t);e||(e=this.props.store.fetchMoreEvents(t,30),this.eventRequests.set(t,e));try{return await e}finally{this.eventRequests.get(t)===e&&this.eventRequests.delete(t)}}async loadConvo(){const t=this.props.cid;this.receivedMessageKeys=new Set,this.initialBottom=!0;const e=this.loadVersion=(this.loadVersion||0)+1;this.visibleCounts=this.initialVisibleCounts(this.props),this.historyBusy=!0,this.evRefs={},this.setState({error:!1,historyError:!1,historyLoading:!1,isShowTyping:!1,loading:!(!t||p.A.size(this.props.store.listEvents(t)))&&p.A.Date.now()});try{if(t&&!p.A.size(this.props.store.listEvents(t))){const n=await this.fetchPage(t);if(e!==this.loadVersion||!this._isMounted)return;n&&n.error&&this.setState({error:!p.A.size(this.props.store.listEvents(t)),historyError:!0})}}catch(n){e===this.loadVersion&&this.setState({error:!p.A.size(this.props.store.listEvents(t)),historyError:!0})}finally{e===this.loadVersion&&this._isMounted&&(this.historyBusy=!1,this.setState({loading:!1}),!this.initialBottom&&this.receivedMessageKeys.size&&this.isBottom()&&this.scrollToBottom("smooth"),this.queueHistoryCheck(),t&&t.startsWith("cslightwidget_")&&1===Object.keys(this.visibleCounts).length&&this.hasMore()&&this.loadMore())}}async loadMore(){if(this.historyBusy||!this._isMounted)return;const t=this.historyTarget();if(!t)return;const e=this.loadVersion;this.historyBusy=!0;const n=this.refBody,i=this.visibleCounts[t.id]||0;this.setState({historyLoading:!0});try{if(i>=p.A.size(this.props.store.listEvents(t.id))){const e=await this.fetchPage(t.id);if(e&&e.error)throw e.error}if(e!==this.loadVersion||!this._isMounted)return;this.visibleCounts[t.id]=i+30,this.setState({historyError:!1})}catch(t){e===this.loadVersion&&this.setState({historyError:!0})}finally{if(e===this.loadVersion&&this._isMounted){const t=n?n.scrollHeight:0,i=n?n.scrollTop:0;this.setState({historyLoading:!1}),this.forceUpdate(),await new Promise(t=>p.A.setTimeout(t,0)),e===this.loadVersion&&this._isMounted&&(this.initialBottom?this.restoreInitialBottom():n&&n===this.refBody&&(n.scrollTop=i+n.scrollHeight-t,this.lastScrollTop=n.scrollTop),this.historyBusy=!1,this.queueHistoryCheck())}}}isBottom(){let t=this.refBody;return!!t&&t.scrollHeight<t.scrollTop+t.offsetHeight+50}scrollToBottom(t="auto"){this.scrollTimer&&p.A.clearTimeout(this.scrollTimer);const e=this.props.cid;this.scrollTimer=p.A.setTimeout(()=>{if(this.scrollTimer=null,!this._isMounted||this.props.cid!==e)return;const n=this.refBody;if(!n)return;const i=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;"smooth"===t&&!i&&n.scrollTo?n.scrollTo({top:n.scrollHeight,behavior:"smooth"}):n.scrollTop=n.scrollHeight}),this.props.isShow&&"visible"===this.props.store.browserVisibility&&document.hasFocus()&&this.props.store.seenConvo(this.props.cid)}}var qt=n(2988);class Zt extends V.Mw{constructor(t){var e,n,i;super(t),e=this,i={hide:!0,ratingHeight:0,overlayOpacity:.3,comment:""},(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n="state"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.refComment=(0,J._3)(),this.refRating=(0,J._3)(),this.refHandle=(0,J._3)()}componentDidMount(){this.props.store.onUpdate(this,()=>{this.shoudDisplay()&&this.open()}),this.props.store.onConvoEvent(this,t=>{p.A.convoOfEv(t)===this.props.cid&&(this.state.hide||"conversation_rated"!==t.type?this.shoudDisplay()&&this.open():this.close())}),this.mouseUp=t=>this.onMouseUp(t),this.mouseMove=t=>this.onMouseMove(t),this.mouseDown=t=>this.onMouseDown(t);var t=this.refHandle.current;t.addEventListener("mousedown",this.mouseDown,{passive:!0}),t.addEventListener("touchstart",this.mouseDown,{passive:!0}),window.addEventListener("mouseup",this.mouseUp,{passive:!0}),window.addEventListener("touchend",this.mouseUp,{passive:!0}),window.addEventListener("mousemove",this.mouseMove,{passive:!0}),window.addEventListener("touchmove",this.mouseMove,{passive:!0}),this.animation=new qt.A({maxY:400,minY:0,duration:150}),this.close(),(this.shoudDisplay()||"rating"===this.props.forceView)&&this.open()}componentWillUnmount(){var t=this.refHandle.current;t.removeEventListener("mousedown",this.mouseDown,0),t.removeEventListener("touchstart",this.mouseDown,0),window.removeEventListener("mouseup",this.mouseUp,0),window.removeEventListener("touchend",this.mouseUp,0),window.removeEventListener("mousemove",this.mouseMove,0),window.removeEventListener("touchmove",this.mouseMove,0)}render(){let t=this.state.hide?"d-none":"";return(0,J.h)("div",{class:t},(0,J.h)("div",{class:"rating--overlay",style:`opacity: ${.5*this.state.overlayOpacity} !important;`}),(0,J.h)("div",{class:"rating",ref:this.refRating,style:`color:red; height: ${this.state.ratingHeight}px !important;`},(0,J.h)("div",{class:"rating--handle",ref:this.refHandle},(0,J.h)("div",{class:"rating--thumb"})),(0,J.h)("div",{class:"rating--content"},(0,J.h)("div",{class:"rating--heading"},this.props.t("rating_title"),(0,J.h)("div",{class:"rating--close-btn",onClick:t=>this.onCloseRating(t)})),(0,J.h)("div",{class:"rating--description"},this.props.t("rating_description")),(0,J.h)("textarea",{ref:this.refComment,type:"text",class:"rating--comment"}),(0,J.h)("div",{class:"rating-faces-container"},(0,J.h)("div",{class:"rating-face-container",onClick:t=>this.onRatingPoor(t)},(0,J.h)("img",{alt:"poor",src:n(9801)}),(0,J.h)("p",{class:"rating-face--text"},this.props.t("poor"))),(0,J.h)("div",{class:"rating-face-container",onClick:t=>this.onRatingAverage(t)},(0,J.h)("img",{alt:"average",src:n(7134)}),(0,J.h)("p",{class:"rating-face--text"},this.props.t("average"))),(0,J.h)("div",{class:"rating-face-container",onClick:t=>this.onRatingGreat(t)},(0,J.h)("img",{alt:"great",src:n(940)}),(0,J.h)("p",{class:"rating-face--text"},this.props.t("great")))),(0,J.h)("div",{class:"rating-no-thanks",onClick:t=>this.onCloseRating(t)},this.props.t("no_thanks")))))}shoudDisplay(){if(!this.props.cid)return!1;let t,e,n,i=0,r=this.props.store.matchUser(),o=!1;if(p.A.map(this.props.store.listEvents(this.props.cid),s=>{s&&s.by&&("message_sent"===s.type&&("user"===p.A.get(s,"by.type")&&(o=!0),s.created>i&&(i=s.created)),"conversation_state_updated"===s.type&&"ended"===p.A.get(s,"data.conversation.state")&&(n=s),"conversation_rating_requested"===s.type&&(t=s),"conversation_rated"===s.type&&s.by.id===r.id&&(e=s))}),!o)return!1;if(e)return!1;let s=this.props.plugin.chatbox.auto_request_rating&&n;return s&&(s=!!i&&s&&Date.now()-i<9e5),t||s}onCloseRating(){this.props.onRate&&this.props.onRate({no_rating:!0,comment:this.refComment.current.value}),this.close()}onRatingPoor(){this.props.onRate&&this.props.onRate({rating:1,comment:this.refComment.current.value}),this.close()}onRatingAverage(){this.props.onRate&&this.props.onRate({rating:3,comment:this.refComment.current.value}),this.close()}onRatingGreat(){this.props.onRate&&this.props.onRate({rating:5,comment:this.refComment.current.value}),this.close()}open(){if(this.state.hide&&(this.setState({hide:!1}),this.refRating.current)){p.A.setTimeout(()=>{this.refComment.current&&this.refComment.current.focus()},400),this.refComment.current.value="";var t=this.refRating.current.currentStyle||window.getComputedStyle(this.refRating.current),e=parseFloat(t.height);this.animation.play(-20,e,t=>{this.setState({ratingHeight:t,overlayOpacity:Math.min(1,(t-0)/500)})})}}close(){if(!this.state.hide&&this.refRating.current){var t=this.refRating.current.currentStyle||window.getComputedStyle(this.refRating.current),e=parseFloat(t.height);this.animation.play(20,e,t=>{this.setState({ratingHeight:t,overlayOpacity:Math.min(1,(t-0)/500)}),t<10&&(this.state.hide||this.setState({hide:!0}))})}}onMouseDown(t){this.mousePushed=!0,this.animation.stop(),t.preventDefault(),t.touches&&t.touches[0]&&(t=t.touches[0]),this.mousePushedDy=t.pageY-window.pageYOffset-this.refRating.current.getBoundingClientRect().y}onMouseUp(t){if(this.mousePushed){t.touches&&t.touches[0]&&(t=t.touches[0]),this.mousePushed=!1;var e=this.refRating.current.currentStyle||window.getComputedStyle(this.refRating.current),n=parseFloat(e.height);this.animation.play(this.mouseVelocity,n,t=>{this.setState({ratingHeight:t,overlayOpacity:Math.min(1,(t-0)/500)}),t<10&&(this.state.hide||(this.setState({hide:!0}),this.props.onRate&&this.props.onRate({no_rating:!0})))})}}onMouseMove(t){if(this.mousePushed){t.touches&&t.touches[0]&&(t=t.touches[0]);var e=t.pageY;this.mouseVelocity=e-this.lastMouseY,this.lastMouseY=e,e-=this.mousePushedDy;var n=this.refRating.current.getBoundingClientRect().bottom-e;n>400&&(n=500-1e4/(n+-300)),this.setState({ratingHeight:n,overlayOpacity:Math.min(1,(n-0)/500)})}}}function $t(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Vt extends V.Mw{constructor(t){super(t),$t(this,"onChangeConnectionStatus",()=>{let t=this.props.store.getConnectionStatus(),e=this.state.status;this.setState({status:t}),"active"!==e&&"active"===t&&this.changeStatusFailedToSuccess()}),$t(this,"changeStatusFailedToSuccess",()=>{this.setState({status:"just_active"}),this.props.cid&&this.props.store.fetchMoreEvents(this.props.cid),this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(()=>{this.setState({status:"active"})},2e3)}),this.props.store.onConnection(this,this.onChangeConnectionStatus),this.state={status:this.props.store.getConnectionStatus()}}render(){if("active"===this.state.status)return;let t="widget-internet-status",e="";return"just_active"!==this.state.status?(t+=" negative",e=`${this.props.t("network_error")}. ${this.props.t("try_reconnecting")}...`):(t+=" positive",e=this.props.t("reconnect_successfully")),(0,J.h)("div",{class:t},e)}}class Jt extends V.Mw{constructor(t){super(t),this.setState({search:"",isShow:!1})}render(){let t=p.A.filter(this.props.items,t=>{let e=this.state.search.toLowerCase();return(t||"").toLowerCase().indexOf(e)>-1}),e=p.A.map(t,t=>(0,J.h)("li",{class:"custom-select--item-options",onClick:()=>this.add(t)},t)),n=p.A.map(this.props.selected,(t,e)=>(0,J.h)("div",{class:"custom-select--selected-item",onClick:t=>this.remove(t,e)},t,(0,J.h)("i",{class:"icn-delete delete-tag"}))),i=(0,J.h)("div",{class:"custom-select--wrap-options"},(0,J.h)("input",{onClick:t=>{t.preventDefault(),t.stopPropagation(),this.setState({isShow:!0})},type:"text",onInput:t=>this.setState({search:t.target.value}),value:this.state.search,placeholder:"Tìm kiếm",class:"custom-select--input-search"}),(0,J.h)("ul",{class:"custom-select--items-options"},e));return this.state.isShow||(i=null),(0,J.h)("div",{class:"form-control custom-select"},(0,J.h)(V.tW,{onClickaway:t=>this.clickaway()},(0,J.h)("div",{class:"custom-select--wrap-selected",onClick:()=>this.setState({isShow:!this.state.isShow})},(0,J.h)("div",{class:"custom-select--selected-items"},n),i,(0,J.h)("div",{class:"custom-select--icon-dropdown"},(0,J.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,J.h)("g",{opacity:"0.6"},(0,J.h)("path",{d:"M7 9.5L12 14.5L17 9.5H7Z",fill:"black"})))))))}clickaway(){this.setState({isShow:!1})}add(t){this.props.onAddItem&&this.props.onAddItem(t)}remove(t,e){t.preventDefault(),t.stopPropagation(),this.props.onRemoveItem&&this.props.onRemoveItem(e)}}function Yt(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qt=n(8506),Xt=n(9150),Kt=n(9419);let te=!1;const ee="https://vcdn.subiz-cdn.com/file/fiqoahedjbgwclpouoml-avatar_default_baa8a1d7.png";class ne extends V.Mw{constructor(t){super(t),Yt(this,"msgInput",(0,J._3)()),Yt(this,"formMounted",t=>{let e=this.fillForm(t);(t.question_required||this.state.quickReplyMessage.text)&&(e.question={key:"question",is_required:!1,label:this.props.t.i18n(p.A.get(t,"i18n_question_label",{}))||t.question_label,type:"text",value:this.state.quickReplyMessage.text}),this.setState({formData:e}),this.props.store.isMobile()||t._updated||this.focusInput()}),Yt(this,"sendMessage",async(t,{formSubmitted:e=!1,groupId:n}={})=>{if(this._sendingNewConversation)return!1;if("ended"===p.A.get(this.props.store.matchConvo(this.props.cid),"state")){const e=this.startingConversationForm();if(e&&(p.A.size(e.groups)||e.group_required||this.isFormRequired("")))return void this.setState({restartForm:!0,quickReplyMessage:t});this._sendingNewConversation=!0,this.setState({creating:!0,creatingError:null});try{const{convo:e,error:n}=await this.props.store.startConvo({locale:this.props.t.locale(),message:t.text,initial_by:this.props.store.matchUser().id});if(n)return this.setState({creatingError:n}),!1;await this.props.store.sendConvoEvent(e.id,"message_sent",{message:t}),this.props.onGo({view:"chat",cid:e.id})}finally{this._sendingNewConversation=!1,this.setState({creating:!1})}return}const i=this.startingConversationForm(),r=i&&!this.hasSentMessage(this.props.cid)&&(p.A.size(i.groups)||i.group_required);if(!e&&(this.isFormRequired()||r))return void this.setState({clickedJoin:!0,quickReplyMessage:t});let o=t.text;const s=this.props.store.matchConvo(this.props.cid);if(s&&"widget"===s.light_type){this._sendingNewConversation=!0,this.setState({creating:!0,creatingError:null});try{const{convo:r,error:a}=await this.props.store.startConvo({locale:s.locale,message:o,group_id:n,initial_by:this.props.store.matchUser().id,greeting_message:s.events[0]});if(a||!r)return this.setState({creatingError:a||"start_failed"}),!1;this.props.store.promoteWidgetConvo(s.id,r.id);const p=this.props.store.sendConvoEvent(r.id,"message_sent",{message:t});this.props.onGo({view:"chat",cid:r.id}),await p,this.userSent[r.id]=!0,e&&i&&i.end_conversation_after_submit&&await this.props.store.endConvo(r.id),this.setState({clickedJoin:!1,restartForm:!1,quickReplyMessage:{}})}catch(t){return this.setState({creatingError:t}),!1}finally{this._sendingNewConversation=!1,this.setState({creating:!1})}}else{if(this.props.cid&&this.props.cid.startsWith("cslight")){let e=this.props.cid;this._creating=(this._creating||0)+1;let n=this._creating;this.setState({creating:!0});let i=e.split("_")[0].slice(7),r=this.props.store.matchConvo(this.props.cid)||{},s=p.A.find(r.events,t=>"message_sent"==t.type&&t.by&&"bot"==t.by.type);const{convo:a,error:l}=await this.props.store.startConvo({state:"active",locale:this.props.t.locale(),message:o,members:[{type:"bot",id:i,bot_version:r.bot_version}],initial_by:i,is_testing:r.is_testing,greeting_message:s});if(n!=this._creating)return;if(l)return void this.setState({creating:!1});if(this.props.store.deleteLightConvo(e),await this.props.store.sendConvoEvent(a.id,"message_sent",{message:t}),n!=this._creating)return;return this.props.onGo({view:"chat",cid:a.id}),void this.setState({creating:!1})}if(!this.props.cid){this._creating=(this._creating||0)+1;let e=this._creating;this.setState({creating:!0});const{convo:n,error:i}=await this.props.store.startConvo({locale:this.props.t.locale(),message:o,initial_by:this.props.store.matchUser().id});if(e!=this._creating)return;if(i)return void this.setState({creating:!1});const r=this.props.store.sendConvoEvent(n.id,"message_sent",{message:t});if(this.props.onGo({view:"chat",cid:n.id}),await r,e!=this._creating)return;return void this.setState({creating:!1})}p.A.setTimeout(async()=>{await this.props.store.sendConvoEvent(this.props.cid,"message_sent",{message:t}),this.setState({creating:!1})},1)}}),Yt(this,"onLink",(t,e)=>{if(!e)return t.preventDefault();let i=e.replace(/(^\w+:|^)\/\//,"");if(i.startsWith("widget.subiz.com.vn/orders/")){let e=i.substr(27);return e=e.split("/")[0],p.A.setTimeout(async()=>{te||(te=(await n.e(185).then(()=>n(4185))).default),this.setState({showOrder:!0,order_id:e})}),void t.preventDefault()}}),Yt(this,"closeOrder",t=>{this.setState({showOrder:!1,order_id:""}),this.focusInput()}),this.userSent={},this.wasFormInputed=!1,this.setState({creating:!1,clickedJoin:!1,formData:{},showOrder:!1,order_id:"",quickReplyMessage:{}}),this.props.store.onUpdate(this,t=>this.forceUpdate()),this.refTyping=(0,J._3)()}componentDidMount(){this.props.store.isMobile()||this.focusInput(),this.updateFormDataFields()}applyMessage(t){this.focusInput(t)}componentDidUpdate(t){t.isShow!==this.props.isShow&&(this.props.isShow&&!this.props.store.isMobile()&&this.focusInput(),this.props.isShow&&this.props.store.isMobile()&&this.blur(),this.updateFormDataFields()),t.cid!==this.props.cid&&(this.closeOrder(),this.setState({clickedJoin:!1,restartForm:!1,quickReplyMessage:{}}),p.A.setTimeout(()=>{this.$events&&this.$events.focus(),this.props.store.isMobile()||this.focusInput()},100),this.updateFormDataFields())}componentWillUnmount(){this.cancelContainerFocus()}ShowTyping(){this.$events&&this.$events.ShowTyping()}shouldShowForm(){return!(!this.state.restartForm&&!this.state.clickedJoin)}render(){let t,e=this.shouldShowForm(),n="",i=this.props.plugin.chatbox||{},r=this.props.store.matchAccount()||{},o=this.props.t("prechat_form_btn");p.A.get(i,"prechat_form.enabled")&&(t=i.prechat_form);let s=p.A.get(i,"offline_form.enabled");this.isOffline(r,i)&&s&&(t=i.offline_form,o=this.props.t("offline_form_btn"),n="offline"),"offline_form"===this.props.view&&(e=!0,t=i.offline_form,n="offline",o=this.props.t("offline_form_btn")),"prechat_form"===this.props.view&&(e=!0,t=i.prechat_form,o=this.props.t("prechat_form_btn"),n="prechat");let a=null;a="list"===this.props.view?this.renderConvoList():e?this.renderForm(t,o,n):this.renderChat();let l=p.A.get(i,"desktop_button.position")||"right";(this.props.store.isMobile()||this.props.store.isEmbededChatMode())&&(l=p.A.get(i,"mobile_button.position",l));let c="widget-container widget-container--"+l;var d;return this.props.store.isEmbededChatMode()&&(c+=" embed-chat"),this.props.store.isMobile()||"full"!==p.A.get(i,"window_mode")||(c+=" widget-container--full"),this.props.isShow||(c+=" widget-container--hide"),p.A.get(i,"header.hidden",!1)||(d=(0,J.h)(ct,{t:this.props.t,plugin:this.props.plugin,store:this.props.store,cid:this.props.cid,view:this.props.view,onClose:this.props.onClose,onGotoList:()=>this.props.onGo({view:"list"})})),(0,J.h)("div",{class:c,onClick:this.onBgClick},d,a)}onBgClick(t){t.stopPropagation()}validateForm(t){let e={};return p.A.map(t,(t,n)=>{(t=Object.assign({},t)).is_empty_error=!1,t.is_required&&(null==t.value||"string"==typeof t.value&&!t.value.trim()||0===p.A.size(t.value)&&Array.isArray(t.value))?(t.is_empty_error=!0,t.error=this.props.t("error_empty")):t.error="","attr:emails"!==n||t.error||!String(t.value??"").trim()||p.A.isEmail(t.value)||(t.error=this.props.t("error_email_invalid")),"attr:phones"!==n||t.error||!String(t.value??"").trim()||p.A.isPhone(t.value)||(t.error=this.props.t("error_phone_invalid")),e[n]=t}),e}async submitPrechatForm(t,e){if(this.state.submiting||this.state.creating)return;let n=this.validateForm(this.state.formData);if(p.A.find(n,t=>!!t.error))return this.setState({formData:n}),void this.focusInput();let i=p.A.cloneDeep(this.state.formData),r=p.A.cloneDeep(this.props.store.matchUser()),o=!1;p.A.map(i,(t,e)=>{if(e.startsWith("attr:")){"attr:phones"===e&&(t.value=String(t.value??"").trim().replace(/[(). \-]/g,"")),"attr:emails"===e&&(t.value=String(t.value??"").trim());var n={key:e.substr(5)};o=o||"emails"==e||"phones"==e,"number"===t.type&&(n.number=parseInt(t.value)),"datetime"===t.type&&(n.datetime=new p.A.Date(t.value).toISOString()),"list"===t.type&&(n.text=t.value),"text"!==t.type&&"boolean"!==t.type||(n[t.type]=t.value),p.A.setUserAttr(r,n)}}),o&&p.A.setUserAttr(r,{key:"lead_source",text:"widget"});const s=String(p.A.get(i,"question.value","")??"").trim()||(/^vi(?:[-_]|$)/i.test(navigator.language||"")?"Xin chào":"Hello");let a=p.A.get(i,"group.value","");this._creating=(this._creating||0)+1;let l=this._creating;this.setState({creating:!0});let c=p.A.map(i,(t,e)=>({key:e,type:t.type,value:p.A.stringify(t.value)}));if(await this.props.store.submitForm("chatbox_"+e,c,r),await p.A.sleep(500),l!=this._creating)return;if(this.props.cid&&this.props.cid.startsWith("cslight"))return void await this.sendMessage({text:s,format:"plaintext",fields:[{key:"to_agent_group",value:p.A.stringify(a)}],attachments:this.state.quickReplyMessage.attachments},{formSubmitted:!0,groupId:a});if(this.props.cid&&"ended"!==p.A.get(this.props.store.matchConvo(this.props.cid),"state")){if(this.setState({clickedJoin:!1}),await this.props.store.sendConvoEvent(this.props.cid,"message_sent",{message:{text:s,format:"plaintext",fields:[{key:"to_agent_group",value:p.A.stringify(a)}],attachments:this.state.quickReplyMessage.attachments}}),l!=this._creating)return;return this.setState({creating:!1,quickReplyMessage:{}}),t.end_conversation_after_submit&&await this.props.store.endConvo(this.props.cid),void this._creating}let d={text:s,format:"plaintext",attachments:this.state.quickReplyMessage.attachments},h={group_id:a,message:s,locale:this.props.t.locale(),initial_by:r.id};this.setState({creatingError:null});const{error:m,convo:u}=await this.props.store.startConvo(h);if(l!=this._creating)return;if(m)return void this.setState({creating:!1,creatingError:m});let g=u.id;this.userSent[g]=!0,await this.props.store.sendConvoEvent(g,"message_sent",{message:d}),l==this._creating&&(t.end_conversation_after_submit&&await this.props.store.endConvo(g),l==this._creating&&(this.setState({creating:!1,clickedJoin:!1,restartForm:!1,quickReplyMessage:{}}),this.props.onGo({view:"chat",cid:g}),this.props.store.isMobile()||this.focusInput()))}onBooleanChange(t,e){this.wasFormInputed=!0;let n=p.A.cloneDeep(this.state.formData),i=p.A.find(n,(e,n)=>n===t);i&&(i.value=e.target.checked,this.setState({formData:n}))}onKeywordField(t,e,n,i){"Enter"==t.code&&this.submitPrechatForm(e,n)}onInputChange(t,e){this.wasFormInputed=!0;let n=p.A.cloneDeep(this.state.formData),i=p.A.find(n,(e,n)=>n===t);i&&(i.value=e,i.error=void 0,i.is_empty_error=!1,this.setState({formData:n}))}onListAddItem(t,e){this.wasFormInputed=!0;let n=p.A.cloneDeep(this.state.formData),i=p.A.find(n,(e,n)=>n===t);i&&(i.value=i.value||[],i.value.push(e),this.setState({formData:n}))}onListRemoveItem(t,e){this.wasFormInputed=!0;let n=p.A.cloneDeep(this.state.formData),i=p.A.find(n,(e,n)=>n===t);i&&(i.value=i.value||[],i.value.splice(e,1),this.setState({formData:n}))}renderCheckboxField(t){let e=p.A.get(t,"def.items",[]),n=[],i=t.value||"";return i&&(n=i.split(",")),(0,J.h)("div",null,p.A.map(e,e=>(0,J.h)("div",{class:"checkbox"},(0,J.h)("input",{type:"checkbox",id:"form-checkbox"+re(t.key)+e.value,onChange:n=>this.toggleCheckboxField(t.key,e.value),checked:n.includes(e.value)}),(0,J.h)("label",{class:"checkbox--label",for:"form-checkbox"+re(t.key)+e.value},this.props.t.i18n(e.i18n_label)||e.label||e.value),(0,J.h)("div",{class:"checkbox--check"},(0,J.h)("div",null)))))}toggleCheckboxField(t,e){this.wasFormInputed=!0;let n=p.A.cloneDeep(this.state.formData),i=p.A.find(n,(e,n)=>e.key===t);if(!i)return;let r=i.value||"",o=[];r&&(o=r.split(",")),o.includes(e)?o=p.A.filter(o,t=>t!==e):o.push(e),i.value=o.join(","),this.setState({formData:n})}renderRadioField(t){let e=p.A.get(t,"def.items",[]),n=t.value||"";return(0,J.h)("div",null,p.A.map(e,e=>(0,J.h)("div",{class:"radio"},(0,J.h)("input",{type:"radio",name:"form-radio"+re(t.key),id:"form-radio"+re(t.key)+e.value,onChange:n=>this.toggleRadioField(t.key,e.value),checked:n===e.value}),(0,J.h)("label",{class:"radio--label",for:"form-radio"+re(t.key)+e.value},this.props.t.i18n(e.i18n_label)||e.label||e.value),(0,J.h)("div",{class:"radio--check"},(0,J.h)("div",null)))))}toggleRadioField(t,e){this.wasFormInputed=!0;let n=p.A.cloneDeep(this.state.formData),i=p.A.find(n,(e,n)=>e.key===t);i&&(i.value=e,this.setState({formData:n}))}selectDropdownField(t,e){this.wasFormInputed=!0;let n=p.A.cloneDeep(this.state.formData),i=p.A.find(n,(e,n)=>e.key===t);i&&(i.value=e,this.setState({formData:n}))}renderDropdownField(t){let e=p.A.get(t,"def.items",[]);return(0,J.h)("select",{class:"form-control",value:t.value,onChange:e=>this.selectDropdownField(t.key,e.target.value)},(0,J.h)("option",{value:""},"-- ",this.props.t("no_select")," --"),p.A.map(e,t=>(0,J.h)("option",{value:t.value},this.props.t.i18n(t.i18n_label)||t.label||t.value)))}renderFields(t,e){if(0===p.A.size(this.state.formData))return null;let n=p.A.map(this.state.formData,(n,i)=>{if("question"===i&&p.A.find(this.state.quickReplyMessage.attachments,t=>"postback"===t.type))return null;let r=null;var o=n.error?"input--error":"";if("text"===n.type)r="question"==i||p.A.get(n,"def.multiple_line")?(0,J.h)("textarea",{class:`form-control ${o}`,ref:t=>{this["form_"+re(i)]=t},id:"form_"+re(i),value:n.value||"",onInput:t=>this.onInputChange(i,t.target.value),onChange:t=>this.onInputChange(i,t.target.value),row:"4"}):"checkbox"===p.A.get(n,"def.select")?this.renderCheckboxField(n):"radio"===p.A.get(n,"def.select")&&p.A.size(p.A.get(n,"def.items",[]))<5?this.renderRadioField(n):"dropdown"===p.A.get(n,"def.select")||p.A.size(p.A.get(n,"def.items",[]))>=5?this.renderDropdownField(n):(0,J.h)("input",{id:"form_"+re(i),value:n.value||"",onInput:t=>this.onInputChange(i,t.target.value),onChange:t=>this.onInputChange(i,t.target.value),onKeyDown:n=>this.onKeywordField(n,t,e,i),ref:t=>{this["form_"+re(i)]=t},class:`form-control ${o}`,type:"attr:phones"===i?"tel":"attr:emails"===i?"email":"text",inputMode:"attr:phones"===i?"tel":"attr:emails"===i?"email":void 0,autoComplete:"attr:phones"===i?"tel":"attr:emails"===i?"email":void 0,"aria-invalid":n.error?"true":void 0,"aria-describedby":n.error?"form-error_"+re(i):void 0});else if("number"===n.type)r=(0,J.h)("input",{id:"form_"+re(i),value:n.value,onInput:t=>this.onInputChange(i,t.target.value),ref:t=>{this["form_"+re(i)]=t},class:`form-control ${o}`,type:"number"});else if("boolean"===n.type)r=(0,J.h)("div",{class:"checkbox"},(0,J.h)("input",{type:"checkbox",id:"form-checkbox"+re(i),onInput:t=>this.onBooleanChange(i,t),checked:n.value}),(0,J.h)("label",{class:"checkbox--label",for:"form-checkbox"+re(i)},n.label),(0,J.h)("div",{class:"checkbox--check"},(0,J.h)("div",null)));else if("group"===n.type)r=p.A.map(n.list,t=>(0,J.h)("div",{class:"radio"},(0,J.h)("input",{type:"radio",id:"form-radio"+re(i)+re(t.value),checked:n.value===t.value,onInput:e=>this.onInputChange(i,t.value)}),(0,J.h)("label",{class:"radio--label",for:"form-radio"+re(i)+re(t.value)},this.props.t.i18n(t.i18n_label)||t.label||t.value),(0,J.h)("div",{class:"radio--check"},(0,J.h)("div",{class:"inside"}))));else if("list"===n.type){let t=this.state.formData[i].value||[],e=p.A.filter(p.A.get(n,"list",[]),e=>!p.A.includes(t,e));r=(0,J.h)(Jt,{selected:t,items:e,onAddItem:t=>this.onListAddItem(i,t),onRemoveItem:t=>this.onListRemoveItem(i,t)}),r=this.renderDropdownField(n)}else"datetime"===n.type&&(r=(0,J.h)("input",{id:"form_"+re(i),value:n.value,onInput:t=>this.onInputChange(i,t.target.value),class:`form-control ${o}`,type:"date"}));let s="";return"fullname"===n.key?s=this.props.t("fullname"):"emails"===n.key?s=this.props.t("email"):"phones"===n.key?s=this.props.t("phones"):"question"===n.key&&(s=n.label||this.props.t("your_question")),n.label&&(s=n.label),(0,J.h)("div",{key:"form_"+re(i)},(0,J.h)("label",{class:"label",for:"form_"+re(i)},s,n.is_required?(0,J.h)("span",{class:"red"},"*"):""),r,n.error?(0,J.h)("div",{id:"form-error_"+re(i),role:"alert",class:"form-control--valid-input--error"},n.error):"")});return(0,J.h)("div",{class:"pt-2"},n)}renderForm(t,e,n){let i=this.props.t.i18n(p.A.get(t,"i18n_title",{}));i||(i=p.A.get(t,"title",this.props.t("capture_lead_title"))),i=i.replace("↵","");let r=this.validateForm(this.state.formData),o=p.A.find(r,t=>!!t.is_empty_error);const s=String(p.A.get(this.state.formData,"attr:phones.value","")??"").trim(),a=s.length>0&&s.length<5;let l="widget-body";return this.props.store.isEmbededChatMode()&&(l+=" embed-chat"),(0,J.h)("div",{class:l},(0,J.h)(ie,{key:t._updated,form:t,onMount:this.formMounted}),(0,J.h)("div",{class:"widget-body--content flex-grow-1 pl-3 pr-3 pb-2 d-flex flex-column"},(0,J.h)("div",{class:"mt-2 d-flex flex-column"},(0,J.h)("div",null,i),this.renderFields(t,n)),this.props.store.isMobile()?(0,J.h)("div",{style:"height: 20px !important; flex-shrink: 0 !important"}):(0,J.h)("div",{style:"min-height: 15px !important; flex: 1 !important; flex-shrink: 0 !important"}),(0,J.h)("button",{class:"btn--start-convo ",onClick:e=>this.submitPrechatForm(t,n),disabled:!!o||a||this.state.creating},e)))}goToConvo(t){let e="chat";if(!t){const n=ft(this.props.plugin.chatbox,this.props.t);t=this.props.store.startWidgetConvo(n,this.props.t.locale()).convo.id;const i=this.startingConversationForm(),r=this.props.plugin.chatbox||{},o=p.A.get(r,"offline_form.enabled")&&this.isOffline(this.props.store.matchAccount()||{},r);i&&(o||this.isFormRequired(t)||p.A.size(i.groups)||i.group_required)&&(e=o?"offline_form":"prechat_form",this.setState({clickedJoin:!1,restartForm:!1,quickReplyMessage:{}}))}this.props.onGo({view:e,cid:t})}renderConvoList(){let t=this.props.store.matchConvo("*");var e=p.A.map(t,t=>this.props.store.matchConvo(t.id));e=p.A.filter(e,t=>!!t),e=p.A.orderByF(e,t=>p.A.get(t,"last_message_sent.created",t.actived),"desc");var n=p.A.map(e,t=>{let e=p.A.filter(t.members,t=>"agent"===t.type&&"active"===t.membership||"bot"===t.type),n=p.A.map(e,t=>t.id);return n=n||p.A.agentsOfConvo(t)[0],(0,J.h)("div",{class:"convo-list--item","data-cid":t.id,onClick:()=>this.goToConvo(t.id),key:t.id},(0,J.h)(lt,{plugin:this.props.plugin,store:this.props.store,mode:"secondary",class:"d-flex flex-row",tooltipPos:"right",agent_ids:[n[0]]}),this.renderConvoSummary(t))});let i=(0,J.h)("div",{class:"convo-list--list"},n);return 0===p.A.size(e)&&(i=(0,J.h)("div",{class:"convo-list--list"},(0,J.h)("div",{class:"empty-container"},(0,J.h)("img",{class:"widget_body_empty_img",alt:"empty",src:Kt}),(0,J.h)("div",{class:"empty-desc"},this.props.t("empty_convo"))))),(0,J.h)("div",{class:"convo-list"},(0,J.h)("div",{class:"convo-list--container"},(0,J.h)("div",{class:"convo-list--title"},this.props.t("conversations")),i),(0,J.h)("div",{class:"convo-list--footer"},(0,J.h)(pt,{store:this.props.store}),(0,J.h)("button",{class:"btn--start-convo",onClick:t=>this.goToConvo("")},(0,J.h)("span",null,this.props.t("start_conversation")),(0,J.h)("img",{src:Qt,alt:"send button",width:"26",height:"26"})),(0,J.h)("div",{class:"mt-2"})))}blur(){if(!this.props.store.isPreview){var t=this.msgInput.current;t&&(p.A.setTimeout(()=>t&&t.blur()),p.A.setTimeout(()=>t&&t.blur(),300))}}focusInput(t,e=!0){if(!this.props.store.isPreview){if(this.shouldShowForm()){let t="";return p.A.map(this.state.formData,(e,n)=>{t||"text"!==e.type||e.value&&!e.error||(t=n)}),(n=this["form_"+re(t)])&&n.focus(),void p.A.setTimeout(()=>{p.A.map(this.state.formData,(e,n)=>{t||"text"!==e.type||e.value&&!e.error||(t=n)});var e=this["form_"+re(t)];e&&e.focus()},200)}var n;if(n=this.msgInput.current){if(null!=t&&"string"==typeof t&&n.applyMessage(t),!e)return n.focus();p.A.setTimeout(()=>n.focus()),p.A.setTimeout(()=>n.focus(),300)}}}onRate(t){this.props.cid&&(this.props.store.sendConvoEvent(this.props.cid,"conversation_rated",{conversation:{ratings:[t]}}),this.focusInput())}fillQuickReplyToQuestion(t){let e=this.state.formData;e&&p.A.set(e,"question.value",t.text||this.props.t("get_started")),this.setState({formData:e,quickReplyMessage:t})}createPostback(t){this.props.store.createPostback(this.props.cid,t)}onChangeMessageInput(){this.wasFormInputed=!0}renderChat(){let t=(0,J.h)(mt,{store:this.props.store,ref:this.msgInput,cid:this.props.cid,onChange:this.onChangeMessageInput,is_loading:this.state.creating,onSend:this.sendMessage,t:this.props.t}),e="widget-body";return this.props.store.isEmbededChatMode()&&(e+=" embed-chat"),(0,J.h)("div",{class:e},(0,J.h)("div",{class:"widget-body--content",onPointerDown:()=>this.cancelContainerFocus(),onClick:t=>this.onContainerClick(t)},(0,J.h)(Gt,{isShow:this.props.isShow,onLink:this.onLink,store:this.props.store,chatbox:this.props.plugin.chatbox||{},onFormSubmit:t=>this.onEventFormSubmit(t),ref:t=>this.$events=t,cid:this.props.cid,creating:this.state.creating,onSend:t=>this.sendMessage(t),onPostback:t=>this.createPostback(t),t:this.props.t,plugin:this.props.plugin}),(0,J.h)(Vt,{cid:this.props.cid,store:this.props.store,t:this.props.t})),(0,J.h)(Zt,{forceView:this.props.view,plugin:this.props.plugin,store:this.props.store,onRate:t=>this.onRate(t),cid:this.props.cid,t:this.props.t}),(0,J.h)(te,{forceView:this.props.view,plugin:this.props.plugin,show:this.state.showOrder,order_id:this.state.order_id,store:this.props.store,onClose:this.closeOrder,cid:this.props.cid,t:this.props.t}),t)}onEventFormSubmit(){this.focusInput()}cancelContainerFocus(){this.containerFocusTimer&&p.A.clearTimeout(this.containerFocusTimer),this.containerFocusTimer=null}onContainerClick(t){this.cancelContainerFocus();const e=t&&t.target,n=e&&(1===e.nodeType?e:e.parentElement);if(n&&n.closest("a, button, input, textarea, select, [contenteditable]"))return;if(t&&t.detail>1)return;if(this.props.store.isMobile()||window.getSelection()?.toString())return;const i=this.props.cid;this.containerFocusTimer=p.A.setTimeout(()=>{this.containerFocusTimer=null,this._isMounted&&this.props.cid===i&&!1!==this.props.isShow&&!window.getSelection()?.toString()&&this.focusInput(void 0,!1)},300)}startingConversationForm(){const t=this.props.plugin.chatbox||{},e=this.props.store.matchAccount()||{};return this.isOffline(e,t)&&p.A.get(t,"offline_form.enabled")?t.offline_form:p.A.get(t,"prechat_form.enabled")?t.prechat_form:void 0}isFormRequired(t=this.props.cid){let e=this.startingConversationForm();if(!e)return!1;let n=this.fillForm(e),i=this.props.store.matchConvo(t)||{};if("ended"===i.state)return!0;i.state&&"pending"!==i.state&&delete n.group;let r=!0;return p.A.each(n,t=>{t.value&&(r=!1)}),!(!r||this.userHasSent(t))||!!p.A.find(n,t=>t.is_required&&(null==t.value||""===t.value))}renderConvoSummary(t){let e=this.props.plugin.chatbox||{},n=this.props.store.matchAgent("*"),i=p.A.filter(t.members,t=>"agent"===t.type||"bot"===t.type),r=p.A.map(i,t=>t.id);r=r||p.A.agentsOfConvo(t)[0];let o=p.A.map(r,t=>n[t]||{avatar_url:ee,fullname:"Offline Agent"});var s=p.A.each(o,t=>t.fullname).join(", ");!e.hide_agent_profile&&s||(s=this.props.store.matchAccount().name),s||(s=this.props.t("agent"));var a=null;"user"===t.lastSenderType&&(a=(0,J.h)("span",null,this.props.t("you"),":"));let l=p.A.isConvoSeen(t,this.props.store.matchUser().id);var c=this.renderMessagePreview(t.last_message_sent),d=p.A.getMs(p.A.get(t,"last_message_sent.created"))||p.A.getMs(t.created);let h=l?null:(0,J.h)("div",{class:"convo-list--item-unread"});return"ended"===t.state&&(h=(0,J.h)("img",{alt:"conversation ended",class:"convo-list--convo-completed",src:Xt,title:this.props.t("conversation_ended")})),(0,J.h)("div",{class:"convo-list--convo-last-info"},(0,J.h)("div",{class:"d-flex flex-row"},(0,J.h)("div",{class:"convo-list--convo-name"},s),(0,J.h)("div",{class:"convo-list--convo-time"},(0,J.h)(Wt.A,{ago:!0,time:d,t:this.props.t,short:!0}))),(0,J.h)("div",{class:"d-flex flex-row"},(0,J.h)("div",{class:"convo-list--convo-last-message"},a,c),h))}agentsOfConvo(t){let e=this.props.store.matchAgent("*");var n=p.A.agentsOfConvo(t,!0);return p.A.map(n,t=>e[t]||{avatar_url:ee,fullname:"Offline Agent"})}renderMessagePreview(t){let e=this.props.t("sent_you_a_message"),n=p.A.get(t,"data.message.text");if("plaintext"!==p.A.get(t,"data.message.format")&&(n=e),!n&&p.A.size(p.A.get(t,"data.message.attachments"))>0&&(n=e),!n)return null;let i=p.A.get(t,"by.type");return(0,J.h)("div",{class:"convo-list--convo-last-mes"},p.A.map(p.A.extractText(n),t=>"emoji"===t.type?(0,J.h)(Y.A,{emojiCode:t.text,byType:i}):t.text))}userHasSent(t){var e=this.props.store.matchConvo(t)||{};let n=this.props.store.matchUser();return!!this.userSent[t]||p.A.find(e.members,t=>t.id===n.id&&("active"===t.membership||t.last_sent>0))}hasSentMessage(t){if(this.userSent[t])return!0;let e=this.props.store.matchConvo(t)||{};return p.A.find(e.members,t=>"bot"===t.type||t.last_sent)}isOffline(t,e){let n=p.A.get(e,"offline_form.enable_when"),i=!0;return"all_agents_offline"===n&&(i=t.is_online),"out_of_bussiness_hour"===n&&(i=t.is_in_business_hour),!i}updateFormDataFields(){let t,e=this.props.plugin.chatbox||{},n=this.props.store.matchAccount()||{};p.A.get(e,"prechat_form.enabled")&&(t=e.prechat_form);let i=p.A.get(e,"offline_form.enabled");if(this.isOffline(n,e)&&i&&(t=e.offline_form),"offline_form"===this.props.view&&(t=e.offline_form),"prechat_form"===this.props.view&&(t=e.prechat_form),0===p.A.size(t))return[];var r={};p.A.each(t.fields,t=>{var e=Object.assign({},t);"list"===t.type&&(e.list=t.list),e.label=this.props.t.i18n(p.A.get(t,"i18n_label",{}))||t.label,r["attr:"+t.key]=e}),t.group_required&&p.A.size(t.groups)>0&&(r.group={key:"group",is_required:!!t.group_required,label:this.props.t.i18n(p.A.get(t,"i18n_group_label",{}))||t.group_label,type:"group",list:p.A.map(t.groups,t=>({value:t.id,label:t.name,i18n_label:t.i18n_name}))}),t.question_required&&(r.question={key:"question",is_required:!1,label:this.props.t.i18n(p.A.get(t,"i18n_question_label",{}))||t.question_label,type:"text"}),this.isFormChanged(this.state.formData,r)&&this.setState({formData:r})}isFormChanged(t,e){let n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++){if(p.A.get(t,`${n[r]}.label`)!==p.A.get(e,`${i[r]}.label`))return!0;if(p.A.get(t,`${n[r]}.is_required`)!==p.A.get(e,`${i[r]}.is_required`))return!0;if(p.A.stringify(p.A.get(t,`${n[r]}.list`))!==p.A.stringify(p.A.get(e,`${i[r]}.list`)))return!0}return!1}fillForm(t){if(0===p.A.size(t))return[];var e={};let n=this.props.store.matchUser();return p.A.each(t.fields,t=>{var i=Object.assign({},t);i.value=p.A.getUserAttr(n,t.key,t.type),"emails"!=i.key||i.value||(i.value=p.A.getUserAttr(n,"related_email","text")),"phones"!=i.key||i.value||(i.value=p.A.getUserAttr(n,"related_phone","text")),"boolean"!==t.type||i.value||(i.value=!1),"datetime"===t.type&&i.value&&(i.value=new p.A.Date(e.value).toLocaleDateString("en-CA")),"list"===t.type&&(i.list=t.list),i.label=this.props.t.i18n(p.A.get(t,"i18n_label",{}))||t.label,e["attr:"+t.key]=i}),t.group_required&&p.A.size(t.groups)>0&&(e.group={key:"group",is_required:!!t.group_required,label:this.props.t.i18n(p.A.get(t,"i18n_group_label",{}))||t.group_label,type:"group",list:p.A.map(t.groups,t=>({value:t.id,label:t.name}))}),e}}class ie extends V.Mw{componentDidMount(){this.props.onMount(this.props.form)}}function re(t){return encodeURIComponent(t)}var oe=n(9278);class se extends V.Mw{constructor(t){var e,n,i;super(t),e=this,i={cssReady:!1,changing:!1},(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n="state"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.refButton=(0,J._3)(),this.refWidget=(0,J._3)()}refreshCSS(){let t=this.props.store.matchPlugin(),e=p.A.find(t,t=>t.id===this.props.plugin.id);if(!e)return;let n=oe.default.default.toString()+"",i=e.chatbox,r=p.A.get(i,"desktop_button.margin_y");i.desktop_widget_max_height=r?`calc(100% - ${r+10}px)`:"calc(100% - 40px)";let o=Math.min(340,i.width);!Number.isNaN(o)&&o||(o=340),i.preview_max_width=o+"px";var s=p.A.replaceCssVariable(n,i);p.A.setCss(this.props.plugin.id,this.$cssStyleDiv,s)}componentWillUnmount(){p.A.setCss(this.props.plugin.id,this.$cssStyleDiv,"")}async componentDidMount(){this.$cssStyleDiv=document.getElementById("subiz-style-for-"+this.props.plugin.id),this.$cssStyleDiv||(this.$cssStyleDiv=document.createElement("style"),document.head.appendChild(this.$cssStyleDiv),this.$cssStyleDiv.type="text/css",this.$cssStyleDiv.id="subiz-style-for-"+this.props.plugin.id),this.checkExpand(),this.props.store.onResetCSS(this,()=>this.refreshCSS()),this.props.store.onConvoEvent(this,t=>this.onConvoEvent(t)),this.props.store.onUpdate(this,t=>this.checkExpand()),this.props.store.onDestroyed(this,t=>{this.setState({widgetView:"",widgetConvoId:""})}),this.refreshCSS();let t=this.props.store.matchLastview()||{},e="widget"===p.A.get(t,"screen")?p.A.get(t,"opts.cid"):"";e&&(this._last_cid=e,this.setState({changing:!0},()=>{this.props.store.fetchConvo(e).then(()=>{let t=this.props.store.matchConvo(e);if(e==this._last_cid)return this.setState({changing:!1}),t?void 0:this.showWidget({})})})),this.setState({cssReady:!0})}render(){if(this.state.changing)return"undefined"!=typeof sbz_info&&(sbz_info.render_chatbox_changing_ready=p.A.Date.now()),null;if(!this.state.cssReady)return"undefined"!=typeof sbz_info&&(sbz_info.render_chatbox_css_not_ready=p.A.Date.now()),null;if(p.A.isUserBanned(this.props.store.matchUser()))return"undefined"!=typeof sbz_info&&(sbz_info.render_chatbox_user_is_banned=p.A.Date.now()),null;if(!this.props.t)return"undefined"!=typeof sbz_info&&(sbz_info.render_chatbox_no_t=p.A.Date.now()),null;"undefined"!=typeof sbz_info&&(sbz_info.render_chatbox_main=p.A.Date.now());let t=this.props.store.matchLastview()||{},e="widget"===t.screen,n=t.view,i=p.A.get(t,"opts.cid");return(0,J.h)("div",{class:this.props.store.isMobile()||this.props.store.isEmbededChatMode()?"mobile":"desktop"},(0,J.h)(et,{plugin:this.props.plugin,store:this.props.store,key:"chat_button",ref:this.refButton,isShow:!e,onClick:t=>this.showWidget(t),onNewMessageShowWidget:t=>this.onNewMessageShowWidget(t),onSelectQuickReply:t=>this.onSelectQuickReply(t),t:this.props.t}),(0,J.h)(ne,{plugin:this.props.plugin,store:this.props.store,view:n,cid:i,isShow:e,onClose:t=>this.onWidgetClose(t),onGo:t=>this.showWidget(t),t:this.props.t,ref:this.refWidget}))}onConvoEvent(t){this.checkExpand(),this.checkShowBotConvo(t)}checkShowBotConvo(t){let e=this.refWidget.current;if(!e)return;if(e.wasFormInputed)return;if("message_sent"!==t.type)return;if("widget"!==p.A.get(this.props.store.matchLastview(),"screen"))return;let n=p.A.get(t,"by.type");if(!(p.A.get(t,"by.id")||"").startsWith("bb")||"agent"!==n)return;let i=p.A.get(t,"data.message.conversation_id");i&&this.showWidget({cid:i,view:"chat"})}checkExpand(){this.props.store.isMobile()||this.props.plugin._no_auto_expand}onSelectQuickReply(t){this.showWidget({view:"chat",cid:t.conversation_id}),this.forceUpdate(()=>{this.refWidget.current&&this.refWidget.current.sendMessage(t)})}onNewMessageShowWidget(t){this.props.store.isMobile()&&ae(this.shouldLockPageScroll()),this.props.store.updateLastview({screen:"widget",previewEvent:{},view:"chat",opts:{cid:t}}),this.forceUpdate()}shouldLockPageScroll(){return void 0===p.A.get(this.props.plugin,"chatbox.mobile_height")}async showWidget(t){let e=t.cid,n={screen:"widget",minimized:0,view:t.view,previewEvent:{},opts:{cid:e}};if(!t.view&&!t.cid){let t=this.props.store.matchConvo("*"),i=p.A.find(t,t=>!p.A.isConvoSeen(t,this.props.store.matchUser().id));e=p.A.get(i,"id",p.A.get(t,"0.id")),n.view="chat",n.opts={cid:e}}if("chat"===n.view&&!n.opts.cid&&this.refWidget.current)return this.refWidget.current.goToConvo("");this.props.store.isMobile()&&ae(this.shouldLockPageScroll()),this.props.store.updateLastview(n),this.forceUpdate()}getCurrentView(){let t=this.props.store.matchLastview()||{};return{is_show_widget:"widget"===p.A.get(t,"screen"),view:p.A.get(t,"view",""),conversation_id:p.A.get(t,"opts.cid","")}}applyMessage(t){this.refWidget.current&&this.refWidget.current.applyMessage(t)}showGreeting(){this.refButton.current&&this.refButton.current.ShowGreeting()}hideGreeting(){this.refButton.current&&this.refButton.current.HideGreeting()}showTyping(){this.refWidget.current&&this.refWidget.current.ShowTyping()}hideWidget(){!function(){document.body&&document.body.classList&&document.body.classList.remove("sbz_no_scroll"),document.documentElement&&document.documentElement.classList&&document.documentElement.classList.remove("sbz_no_scroll");let t=document.getElementById("subiz-meta-viewport");t&&t.remove()}(),this.props.store.updateLastview({screen:"button",previewEvent:{},minimized:Date.now()}),this.forceUpdate()}onWidgetClose(){this.hideWidget(),this.props.store.emitCloseWidgetEvent()}}function ae(t){t&&(document.body&&document.body.classList&&document.body.classList.add("sbz_no_scroll"),document.documentElement&&document.documentElement.classList&&document.documentElement.classList.add("sbz_no_scroll"));let e=document.querySelectorAll('meta[name="viewport"]'),n=!0;for(let t=0;t<e.length;t++)if((e[t].getAttribute("content")||"").indexOf("maximum-scale")>-1){n=!1;break}if(n){let t=document.createElement("meta");t.httpEquiv="X-UA-Compatible",t.name="viewport",t.id="subiz-meta-viewport",t.content="maximum-scale=1.0, user-scalable=no, width=device-width, initial-scale=1.0",document.getElementsByTagName("head")[0].appendChild(t)}}function pe(t,e,i,r){if(!i)throw"$div must is a valid html node";var o=document.createElement("div");if(o.id=t.id,e.isDead())return;let s=e.matchAccount();o.setAttribute("sbz-plugin-type",t.type),o.setAttribute("sbz-plugin-account-id",s.id),i.appendChild(o);let a=V.JK(t,p.A.detectLang());var l,c=new p.A.Gate,d=0,h="hold",m=this;this.getState=()=>h;var u=async function(){if("undefined"!=typeof sbz_info&&(sbz_info[p.A.Date.now()+".run"]=h),w)return;if("hold"!==h)return;if("popup"===t.type&&e.isConverted(t.id))return;let n=e.matchLastPluginRun(t.id);if("chatbox"!==t.type&&"notification"!==t.type||(n=void 0),!t.enabled)return;let i=p.A.checkRunConditions(t.initiative_frequency,t.conditions,n,e);"undefined"!=typeof sbz_info&&(sbz_info[p.A.Date.now()+".run.match"]=i),i&&(h="running",await m.update(t))};this.forceRunPopup=async()=>{p.A.get(g,"current")?g.current.openPopup():_()};var g=(0,J._3)();let b=null,f=null;var v=t=>r.showWidget(t),y=()=>{d++,_()},_=async()=>{w||o&&this.t&&("chatbox"===t.type&&("undefined"!=typeof sbz_info&&(sbz_info.render_chatbox=p.A.Date.now()),(0,J.XX)((0,J.h)(se,{destroy:w,plugin:t,store:e,ref:g,t:this.t}),o)),"popup"===t.type&&(b||(b=(await n.e(132).then(()=>n(132))).default),(0,J.XX)((0,J.h)(b,{destroy:w,t:this.t,highlight:l,mobile:e.isMobile(),plugin:t,store:e,ref:g,pageIndex:d,nextPage:y,showWidget:v}),o)),"notification"===t.type&&(f||(f=(await n.e(490).then(()=>n(1490))).default),(0,J.XX)((0,J.h)(f,{destroy:w,t:this.t,mobile:e.isMobile(),plugin:t,store:e,ref:g}),o)),c.open())};this.call=(t,e)=>c.entry().then(()=>{if(g.current&&"function"==typeof g.current[t])return g.current[t](e)});var w=!1;this.destroy=()=>{w||(w=!0,(0,J.XX)(null,o),o.parentNode&&o.parentNode.removeChild(o))},this.highlight=t=>{l=t,_()},this.update=e=>{w||(t=e,"hold"!==h&&"finished"!==h&&_())};let x=t=>{if("debug"===a)return`{{${t}}}`;let e=p.A.get(V.r9,a,[]),n=p.A.find(e,e=>e.key===t);return p.A.get(n,"message",t)};x.i18n=e=>{if(!e)return"";let n=t.locale||s.locale||"vi-VN";return n=n.replace("-","_"),e[a.replace("-","_")]||e[n]},x.locale=()=>a,this.forceDownloadLanguage=async()=>{await V.Dy(e,a,!0),this.update(t)},this.setLocale=async n=>a===n?n:(this.t=null,_(),a=V.JK(t,n),await V.Dy(e,a),this.t=x,_(),a);let k={};p.A.map(p.A.get(t,"popup.pages"),t=>{t&&p.A.map(t.components,t=>{"image"===t.type&&t.image&&t.image.url&&t.image.url.startsWith("http")&&(k[t.image.url]=!0)})}),p.A.size(k)>=0&&p.A.map(k,(t,e)=>p.A.preloadImg(e));let A=p.A.get(t,"triggers")||[{type:"after_pageview",after_pageview_sec:0,disabled:!1}];for(var z=0;z<p.A.size(A);z++){var I=A[z];I&&(I.disabled||("exit_intent"===I.type&&p.A.trackExitIntent(u),"area_clicked"===I.type&&p.A.trackAreaClicked(I.area_clicked_css_selector,u),"scrolling_percentage"===I.type&&p.A.trackScrollingPercentage(I.scrolling_percentage,u),"inactivity_duration"===I.type&&p.A.trackInactivity(I.inactivity_sec,u),"after_pageview"===I.type&&p.A.trackTimeOnPage(I.after_pageview_sec,u)))}this.update(t),"undefined"!=typeof sbz_info&&(sbz_info.load_lang=p.A.Date.now()),V.Dy(e,a).then(()=>{"undefined"!=typeof sbz_info&&(sbz_info.load_lang_done=p.A.Date.now()),this.t=x,this.update(t)})}class le{constructor(t,e){this.refM={},this.lib=t,this.$div=e,this.pluginM={},this._destroy=!1,this._subscriptions=[],this._subscriptions.push(t.store.onHighlight({_isMounted:!0},(t,e)=>{let n=this.pluginM[t];n&&n.highlight(e)})),this._subscriptions.push(t.store.onUpdate({_isMounted:!0},()=>{if(this._destroy)return;let n=this.lib.store.matchPlugin(),i=!1;p.A.each(n,n=>{if("chatbox"===n.type){if(i)return;i=!0}this.pluginM[n.id]?this.pluginM[n.id].update(n):this.pluginM[n.id]=new pe(n,this.lib.store,e,t)}),p.A.each(this.pluginM,(t,e)=>{n[e]||(this.pluginM[e].destroy(),delete this.pluginM[e])})}));let n=this.lib.store.matchPlugin();"undefined"!=typeof sbz_info&&(sbz_info.plugins=n);let i=!1;p.A.each(n,n=>{if("chatbox"===n.type){if(i)return;i=!0}this.pluginM[n.id]||(this.pluginM[n.id]=new pe(n,this.lib.store,e,t))})}findChatbox(){var t=this.lib.store.matchPlugin();let e=p.A.filter(this.pluginM,(e,n)=>"chatbox"===t[n].type);if(0===p.A.size(e))return void console.error("no chatbox found.");let n=p.A.find(e,t=>"running"===t.getState());if(n||(n=e[0]),n)return n;console.error("found no suitable chatbox to run.")}getCurrentView(){let t=this.findChatbox();if(t)return t.call("getCurrentView")}showCurrentChatbox(t){let e=this.findChatbox();if(e)return e.call("showWidget",t)}showCurrentChatboxTyping(){let t=this.findChatbox();if(t)return t.call("showTyping")}showCurrentGreeting(){let t=this.findChatbox();if(t)return t.call("showGreeting")}applyTextToCurrentChatbox(t){let e=this.findChatbox();if(e)return e.call("applyMessage",t)}hideCurrentGreeting(){let t=this.findChatbox();if(t)return t.call("hideGreeting")}hideCurrentChatbox(){let t=this.findChatbox();if(t)return t.call("hideWidget")}forceUpdateLang(t){let e=this.pluginM[t];if(e)return e.forceDownloadLanguage()}forceRunPopup(t){let e=this.pluginM[t];if(e)return e.forceRunPopup(t)}setPluginLocale(t,e){let n=this.pluginM[t];if(n)return n.setLocale(e)}setCurrentChatboxLocale(t){let e=this.findChatbox();if(e)return e.setLocale(t)}destroy(){if(!this._destroy){this._destroy=!0;for(const t of this._subscriptions)t();this._subscriptions=[],p.A.map(this.pluginM,(t,e)=>{t.destroy(),delete this.pluginM[e]})}}}function ce(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class de{constructor(t,e,n,i,r){ce(this,"version",()=>"4.5"),ce(this,"setSetting",t=>this.store.setSetting({account_setting:t})),ce(this,"getUser",()=>p.A.parseJSON(p.A.stringify(this.store.matchUser()))),ce(this,"setViewingProduct",t=>this.store.linkProduct(t)),ce(this,"getViewingProduct",()=>this.store.getLinkedProduct()),ce(this,"track",t=>this.store.track(t)),ce(this,"event",async(t,e,n)=>(await this.store.readyGate.entry(),this.store.api.sendEvent(function(t,e,n){if(t&&"object"==typeof t)return t;let i={type:t};return void 0!==e&&(i.payload=e),n&&"object"==typeof n&&(i=Object.assign({},n,i)),i}(t,e,n)))),ce(this,"pageview",t=>this.store.sendPageview(t)),this.impressionTokens={},this._containerTimers=new Set,this.domGate=new p.A.Gate,this.store=new W(t,e,n,i,r),window.sbz_store=this.store,this.subs=[],this.store.onConvoEvent({_isMounted:!0},t=>p.A.map(this.subs,e=>{e&&"function"==typeof e&&e(t)})),this.store.onWidgetClose({_isMounted:!0},t=>p.A.map(this.subs,e=>{e&&"function"==typeof e&&e(t)}))}async waitReady(t){await this.store.readyGate.entry(),t()}watchContainer(t){const e=this.pluginMgr,n=p.A.setInterval(()=>{!this.store.isDead()&&t&&t.isConnected||(e.destroy(),p.A.clearInterval(n),this._containerTimers.delete(n))},1e3);this._containerTimers.add(n)}setAIDevMode(t){this.store.setAIDevMode(t)}setEmbebedChatMode(){this.store.setEmbebedChatMode()}setTrackPageView(t){this.store.setTrackPageview(t)}getTrackPageView(){return this.store.getTrackPageview()}async cleanLogin(t,e){}async login(t,e,n,i){let r=await this.store.login(t,e,n);return i||(i=document.body),this.pluginMgr=new le(this,i),this.watchContainer(i),this.domGate.open(),r}logout(t){return this.store.logout(t)}overrideBotId(t){this.store.overrideBotId(t)}async init(t,e){let n=(t=t||{}).account_id,i=t.ref,r=await this.store.init(n,void 0,i,t);return this.store.isDead()||(p.A.setTimeout(()=>window.postMessage({type:"widget_loaded",account_id:n},"*"),0),e||(e=document.body||document),this.pluginMgr=new le(this,e),this.watchContainer(e),this.domGate.open()),r}async start(t,e,n,i){let r=(t=t||{}).account_id,o=await this.store.init(r,n,t.ref,t);return p.A.setTimeout(()=>window.postMessage({type:"widget_loaded",account_id:r},"*"),0),e||(e=document.body||document),this.pluginMgr=new le(this,e),this.watchContainer(e),this.domGate.open(),i&&i(o),o}async setAccount(t,e,n,i){if("undefined"!=typeof sbz_info&&(sbz_info.set_account=p.A.Date.now()),document&&document.location&&document.location.href&&document.location.href.indexOf("subiz-verification-1")>0)return window.subiz_verification_account_id=t,void("undefined"!=typeof sbz_info&&(sbz_info=void 0));if(!t)return{error:"empty_account_id"};"undefined"!=typeof sbz_info&&(sbz_info.set_account_1=p.A.Date.now());let r=await this.store.init(t,n);return"undefined"!=typeof sbz_info&&(sbz_info.set_account_2=p.A.Date.now()),p.A.setTimeout(()=>window.postMessage({type:"widget_loaded",account_id:t},"*"),0),e||(e=document.body||document),this.pluginMgr=new le(this,e),this.watchContainer(e),this.domGate.open(),"undefined"!=typeof sbz_info&&(sbz_info.set_account_done=p.A.Date.now()),i&&i(r),r}_setAccount(t,e){return this.setAccount(t,e)}async updateUserAttributes(t){await this.store.setUser({attributes:t});var e=this.store.matchUser();return p.A.cloneDeep(e.attributes)}async getUserAttributes(){await this.store.readyGate.entry();var t=this.store.matchUser();return p.A.cloneDeep(p.A.get(t,"attributes",[]))}async getWidgetCurrentView(){return await this.domGate.entry(),this.pluginMgr.getCurrentView()}async createTicket(t){return await this.domGate.entry(),this.store.createTicket(t)}expandWidget(t,e){return this.showWidget(t,e)}shrinkWidget(){return this.hideWidget()}async sendMessage(t,e){if(!t){const{convo:n,error:i}=await this.store.startConvo({message:e.text,initial_by:this.store.matchUser().id});if(i)return{error:i};t=n.id}return this.store.sendConvoEvent(t,"message_sent",{message:e})}async viewForm(t){if(!t||!p.A.startsWith(t,"cp"))return;let e=this.impressionTokens[t];if(e)return e;let{body:n}=await this.store.sendImpression(t);return e=p.A.get(n,"impression_token")||"",this.impressionTokens[t]=e,e}async submitForm(t,e,n={}){if(!t||!e)throw new TypeError("submitForm requires a form ID and fields");if(await this.store.readyGate.entry(),p.A.startsWith(t,"cp")){let n=p.A.cloneDeep(this.store.matchUser()),i={id:n.id,account_id:n.account_id},r=!1;e=p.A.map(e,t=>{let e=t.key;return"email"===e&&(e="emails"),"phone"===e&&(e="phones"),r=r||"emails"==e||"phones"==e,p.A.setUserAttr(i,{key:e,[t.type||"text"]:t.value}),{key:e,type:t.type||"text",value:p.A.stringify(t.value)}}),r&&p.A.setUserAttr(i,{key:"lead_source",text:"plugin."+t});let o=await this.viewForm(t);return this.store.setUserDiff(i),this.store.sendConversion(t,e,o)}const i=function(t,e,n={}){if(me(t),!Array.isArray(e)||!e.length)throw new TypeError("Form fields must be a nonempty array");if(!n||"object"!=typeof n||Array.isArray(n))throw new TypeError("Form options must be an object");return{form_name:void 0===n.name?t:n.name,page_url:void 0===n.page_url?window.location.href:n.page_url,submission_id:void 0===n.submission_id?p.A.randomString(36):n.submission_id,values:e.map(t=>{if(!t||"string"!=typeof t.key)throw new TypeError("Each field requires a key");const e=t.value;if(null!=e&&!["string","number","boolean"].includes(typeof e))throw new TypeError("Form field values must be strings, numbers or booleans");return{key:t.key,label:void 0===t.label?t.key:t.label,value:null==e?"":String(e)}})}}(t,e,n);return this.store.submitWebsiteForm(t,i)}async getFormStatus(t){return me(t),await this.store.readyGate.entry(),this.store.getFormStatus(t)}startConvo(t){if((t=p.A.cloneDeep(t)||{}).welcome_message)return this.store.startLightConvo(t.bot_id,[t.welcome_message],t.locale,t.is_testing,t.bot_version);let e=t.members||[];if(t.bot_id){let n=t.bot_id;delete t.bot_id,p.A.find(e,t=>t.id==n)||e.push({type:"bot",id:n,bot_version:t.bot_version})}return t.members=e,t.initial_by=this.store.matchUser().id,this.store.startConvo(t)}async showGreeting(){await this.domGate.entry(),this.pluginMgr.showCurrentGreeting()}async hideGreeting(){await this.domGate.entry(),this.pluginMgr.hideCurrentGreeting()}async showWidget(t,e){return await this.domGate.entry(),this.pluginMgr.showCurrentChatbox({view:t,cid:e})}async showTyping(){return await this.domGate.entry(),this.pluginMgr.showCurrentChatboxTyping()}async hideWidget(){await this.domGate.entry(),this.pluginMgr.hideCurrentChatbox()}async setLocale(t){return await this.domGate.entry(),this.pluginMgr.setCurrentChatboxLocale(t)}async setLanguage(t){return await this.domGate.entry(),this.pluginMgr.setCurrentChatboxLocale(t)}async setPluginLocale(t,e){return await this.domGate.entry(),this.pluginMgr.setPluginLocale(t,e)}_overrideDeviceType(t){this.store.overrideDeviceType(t)}unload(){for(const t of this._containerTimers)p.A.clearInterval(t);this._containerTimers.clear(),this.subs=[],this.pluginMgr&&this.pluginMgr.destroy(),this.store.destroy()}async applyMessage(t){await this.domGate.entry(),this.pluginMgr.applyTextToCurrentChatbox(t)}_overridePlugin(t){this.store.overridePlugin(t)}_forceUpdateLang(t){this.pluginMgr.forceUpdateLang(t)}_highlight(t,e){this.store.highlight(t,e)}openPopup(t){this.pluginMgr.forceRunPopup(t)}unEvent(t){this.subs=p.A.filter(this.subs,e=>e!==t)}async countUnreadMessages(){return await this.domGate.entry(),this.store.matchUnread()}onEvent(t){this.subs=p.A.filter(this.subs,e=>e!==t),this.subs.push(t)}overrideWelcomeMessage(t){this.store.overrideWelcomeMessage(t)}overrideAccount(t){this.store.overrideAcc(t)}async overrideChatbox(t){await this.store.overrideChatbox(t),p.A.get(t,"chatbox.greeting.greeting")&&this.pluginMgr.showCurrentGreeting()}stopAutobot(){this.store.doNotStartBot()}}window.__sbz_WIDGET=de;const he=de;function me(t){if("string"!=typeof t||!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/.test(t))throw new TypeError("Form ID must contain 1-64 letters, digits, underscores or hyphens");if(t.startsWith("cp"))throw new TypeError("Form IDs starting with cp are reserved for Subiz campaigns")}function ue(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))}!async function(){var t=ue("id")||ue("acc_id")||ue("account_id")||"acqsulrowbxiugvginhw",e=ue("real");let i;i=e?new he("https://api.subiz.com.vn/4.0/","https://vcdn.subiz-cdn.com/file/","https://api.subiz.com.vn/rt/0/"):new he("https://api.subiz.com.vn/4.0/","https://vcdn.subiz-cdn.com/file/","https://api.subiz.com.vn/rt/0/",!0,!0),console.log("ACCOUNT",t),console.log("REAL",e),window.widget=i,function(){var t=document.createElement("div");document.body.appendChild(t),(0,J.XX)((0,J.h)("div",{style:"opacity: 0.75"},(0,J.h)("header",{class:"header"},(0,J.h)("nav",{class:"navbar navbar-default navbar-fixed-top"},(0,J.h)("div",{class:"container"},(0,J.h)("nav",{class:"navbar navbar-expand-lg"},(0,J.h)("a",{class:"navbar-brand",href:"#"},(0,J.h)("img",{style:"width: 40px; height: 40px; margin-right: 20px",src:n(2106)})," ","Ngựa vằn"),(0,J.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,J.h)("span",{class:"navbar-toggler-icon"},(0,J.h)("i",{class:"fas fa-bars"}))),(0,J.h)("div",{class:"navbar-collapse collapse",id:"navbarCollapse",style:""},(0,J.h)("ul",{class:"navbar-nav ml-auto"},(0,J.h)("li",{class:"current"},(0,J.h)("a",{href:"#home"},"Trang chủ")),(0,J.h)("li",null,(0,J.h)("a",{href:"#pricing"},"Bảng giá")),(0,J.h)("li",null,(0,J.h)("a",{href:"#blog"},"Blog")),(0,J.h)("li",{class:"discover-link"},(0,J.h)("a",{href:"#",class:"external discover-btn"},"Bắt đầu")))))))),(0,J.h)("section",{class:"home-section",id:"home"},(0,J.h)("div",{class:"container"},(0,J.h)("div",{class:"row"},(0,J.h)("div",{class:"col-md-6 padding-top-80"},(0,J.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,J.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,J.h)("a",{href:"#",class:"btn-blue scrool"},"Start Your Free Trial")),(0,J.h)("div",{class:"col-md-6"},(0,J.h)("img",{src:"https://demo.epic-webdesign.com/tf-essentials/v1/images/website-development.jpg",class:"hero-image width-100",alt:"pic"}))))),(0,J.h)("section",{class:"section-grey section-top-border",id:"about"},(0,J.h)("div",{class:"container"},(0,J.h)("div",{class:"row"},(0,J.h)("div",{class:"col-md-12 text-center"},(0,J.h)("h2",{class:"section-title"},"Integrated solutions designed for small business"),(0,J.h)("p",{class:"section-subtitle"},"Communicate with flexible tools that go where your team goes.")),(0,J.h)("div",{class:"col-md-4"},(0,J.h)("div",{class:"main-services"},(0,J.h)("img",{src:n(6989),class:"width-100",alt:"pic"}),(0,J.h)("h3",null,"Designers"),(0,J.h)("p",null,"Curabitur quam etsum lacus netsum nulat iaculis ets vitae etsum nisle varius sed aliquam ets vitae netsum."),(0,J.h)("a",{href:"#about",class:"btn-blue-line small scrool"},"Essentials for Designers"))),(0,J.h)("div",{class:"col-md-4"},(0,J.h)("div",{class:"main-services"},(0,J.h)("img",{src:n(3014),class:"width-100",alt:"pic"}),(0,J.h)("h3",null,"Marketers"),(0,J.h)("p",null,"Curabitur quam etsum lacus netsum nulat iaculis ets vitae etsum nisle varius sed aliquam ets vitae netsum."),(0,J.h)("a",{href:"#about",class:"btn-blue-line small scrool"},"Essentials for Marketers"))),(0,J.h)("div",{class:"col-md-4"},(0,J.h)("div",{class:"main-services"},(0,J.h)("img",{src:"./assets/img/main-service3.png",class:"width-100",alt:"pic"}),(0,J.h)("h3",null,"Agencies"),(0,J.h)("p",null,"Curabitur quam etsum lacus netsum nulat iaculis ets vitae etsum nisle varius sed aliquam ets vitae netsum."),(0,J.h)("a",{href:"#about",class:"btn-blue-line small scrool"},"Essentials for Agencies")))))),(0,J.h)("section",{class:"section-grey",id:"pricing"},(0,J.h)("div",{class:"container"},(0,J.h)("div",{class:"row"},(0,J.h)("div",{class:"col-md-12 text-center padding-bottom-40"},(0,J.h)("h2",{class:"section-title"},"Pricing for every business, at any stage"),(0,J.h)("p",{class:"section-subtitle"},"All pricing packages are backed up by a 30-day money back guarantee.")),(0,J.h)("div",{class:"col-md-4"},(0,J.h)("div",{class:"price-box"},(0,J.h)("ul",{class:"pricing-list"},(0,J.h)("li",{class:"price-title"},"BASIC"),(0,J.h)("li",{class:"price-value"},"$25"),(0,J.h)("li",{class:"price-subtitle"},"Per Month"),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"Custom Charts"),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"5 Mailboxes, 10 Gb Storage"),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"Unlimited Free Dashboards"),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"Access to all APIs"),(0,J.h)("li",{class:"price-tag-line"},(0,J.h)("a",{href:"#"},"FREE 15-DAY TRIAL"))))),(0,J.h)("div",{class:"col-md-4"},(0,J.h)("div",{class:"price-box"},(0,J.h)("div",{class:"ribbon blue"},(0,J.h)("span",null,"Popular")),(0,J.h)("ul",{class:"pricing-list"},(0,J.h)("li",{class:"price-title"},"STANDARD"),(0,J.h)("li",{class:"price-value"},"$99"),(0,J.h)("li",{class:"price-subtitle"},"Per Month"),(0,J.h)("li",{class:"price-text strong"},(0,J.h)("i",{class:"fas fa-check blue"}),(0,J.h)("strong",null,"All Basic features")),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"15 Mailboxes, 50 Gb Storage"),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"Interactive Screen Sharing"),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"Full Reports History"),(0,J.h)("li",{class:"price-tag"},(0,J.h)("a",{href:"#"},"FREE 15-DAY TRIAL"))))),(0,J.h)("div",{class:"col-md-4"},(0,J.h)("div",{class:"price-box"},(0,J.h)("ul",{class:"pricing-list"},(0,J.h)("li",{class:"price-title white-text"},"PRO"),(0,J.h)("li",{class:"price-value white-text"},"$199"),(0,J.h)("li",{class:"price-subtitle white-text"},"Per Month"),(0,J.h)("li",{class:"price-text white-text"},(0,J.h)("i",{class:"fas fa-check blue"}),(0,J.h)("strong",null,"All Standard Features")),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"50 Mailboxes, 90 Gb Storage"),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"Dedicated Account Manager"),(0,J.h)("li",{class:"price-text"},(0,J.h)("i",{class:"fas fa-check blue"}),"24/7 Priority Support"),(0,J.h)("li",{class:"price-tag-line"},(0,J.h)("a",{href:"#"},"FREE 15-DAY TRIAL")))))))),(0,J.h)("section",{class:"section-grey partners-paddings section-top-border section-bottom-border"},(0,J.h)("div",{class:"container"},(0,J.h)("div",{class:"row"},(0,J.h)("div",{class:"col-md-12 text-center"},(0,J.h)("h3",{class:"section-title"},"Tin tưởng bởi 250 doanh nghiệp")),(0,J.h)("div",{class:"col-md-12 text-center"},(0,J.h)("ul",{class:"partners-mentions"},(0,J.h)("li",null,(0,J.h)("img",{src:n(4257),alt:"CSS Awards"})),(0,J.h)("li",null,(0,J.h)("img",{src:n(7574),alt:"Awwwards"})),(0,J.h)("li",null,(0,J.h)("img",{src:n(8011),alt:"CSS Winner"})),(0,J.h)("li",null,(0,J.h)("img",{src:n(9040),alt:"CSS Design Awards"}))))))),(0,J.h)("div",{class:"footer"},(0,J.h)("div",{class:"container"},(0,J.h)("div",{class:"row"},(0,J.h)("div",{class:"col-md-12 text-center"},(0,J.h)("p",null,"Bản quyền thuộc về Ngựa Vằn @2022"),(0,J.h)("ul",{class:"footer_social"},(0,J.h)("li",null,(0,J.h)("a",{href:"#"},(0,J.h)("i",{class:"fab fa-twitter"}))),(0,J.h)("li",null,(0,J.h)("a",{href:"#"},(0,J.h)("i",{class:"fab fa-pinterest"}))),(0,J.h)("li",null,(0,J.h)("a",{href:"#"},(0,J.h)("i",{class:"fab fa-facebook-square"}))),(0,J.h)("li",null,(0,J.h)("a",{href:"#"},(0,J.h)("i",{class:"fab fa-instagram"}))),(0,J.h)("li",null,(0,J.h)("a",{href:"#"},(0,J.h)("i",{class:"fab fa-skype"}))),(0,J.h)("li",null,(0,J.h)("a",{href:"#"},(0,J.h)("i",{class:"fab fa-dribble"}))))))))),t)}();var r=document.createElement("div");document.body.appendChild(r);let o=document.location.hash.substr(1),s=JSON.parse(decodeURIComponent(atob(o)));s.triggers=[{type:"after_pageview",after_pageview_sec:0,enabled:!0}],!1!==s._dont_close&&(s._dont_close=!0),s._page_index=0,console.log("PLUGIN",s),i._overridePlugin([s]),await i.setAccount(t,r)}()})()})();
|