1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8123],{64956:function(e,t,r){var n=r(48764).Buffer,a=r(42474),l="aes-256-ctr",i={encrypt:function(e,t){if("string"!=typeof e||!e)throw TypeError('Provided "key" must be a non-empty string');var r="string"==typeof t,i=n.isBuffer(t);if(!(r||i)||r&&!t||i&&!n.byteLength(t))throw TypeError('Provided "input" must be a non-empty string or buffer');var s=a.createHash("sha256");s.update(e);var o=a.randomBytes(16),c=a.createCipheriv(l,s.digest(),o),u=t;r&&(u=n.from(t));var d=c.update(u),m=n.concat([o,d,c.final()]);return r&&(m=m.toString("base64")),m},decrypt:function(e,t){if("string"!=typeof e||!e)throw TypeError('Provided "key" must be a non-empty string');var r="string"==typeof t,i=n.isBuffer(t);if(!(r||i)||r&&!t||i&&!n.byteLength(t))throw TypeError('Provided "encrypted" must be a non-empty string or buffer');var s=a.createHash("sha256");s.update(e);var o=t;if(r){if((o=n.from(t,"base64")).length<17)throw TypeError('Provided "encrypted" must decrypt to a non-empty string or buffer')}else if(17>n.byteLength(t))throw TypeError('Provided "encrypted" must decrypt to a non-empty string or buffer');var c=o.slice(0,16),u=a.createDecipheriv(l,s.digest(),c),d=o.slice(16);return r?u.update(d)+u.final():n.concat([u.update(d),u.final()])}};function s(e){if("string"!=typeof e||!e)throw TypeError('Provided "key" must be a non-empty string');Object.defineProperty(this,"key",{value:e})}s.prototype.encrypt=function(e){return i.encrypt(this.key,e)},s.prototype.decrypt=function(e){return i.decrypt(this.key,e)},i.createCipher=function(e){return new s(e)},e.exports=i},27484:function(e){var t;t=function(){"use strict";var e="millisecond",t="second",r="minute",n="hour",a="week",l="month",i="quarter",s="year",o="date",c="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},h="en",f={};f[h]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||"th")+"]"}};var p="$isDayjsObject",_=function(e){return e instanceof g||!(!e||!e[p])},y=function e(t,r,n){var a;if(!t)return h;if("string"==typeof t){var l=t.toLowerCase();f[l]&&(a=l),r&&(f[l]=r,a=l);var i=t.split("-");if(!a&&i.length>1)return e(i[0])}else{var s=t.name;f[s]=t,a=s}return!n&&a&&(h=a),a||!n&&h},v=function(e,t){if(_(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new g(r)},b={s:m,z:function(e){var t=-e.utcOffset(),r=Math.abs(t);return(t<=0?"+":"-")+m(Math.floor(r/60),2,"0")+":"+m(r%60,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),a=t.clone().add(n,l),i=r-a<0,s=t.clone().add(n+(i?-1:1),l);return+(-(n+(r-a)/(i?a-s:s-a))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(c){return({M:l,y:s,w:a,d:"day",D:o,h:n,m:r,s:t,ms:e,Q:i})[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};b.l=y,b.i=_,b.w=function(e,t){return v(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var g=function(){function m(e){this.$L=y(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[p]=!0}var h=m.prototype;return h.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(b.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(u);if(n){var a=n[2]-1||0,l=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],a,n[3]||1,n[4]||0,n[5]||0,n[6]||0,l)):new Date(n[1],a,n[3]||1,n[4]||0,n[5]||0,n[6]||0,l)}}return new Date(t)}(e),this.init()},h.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},h.$utils=function(){return b},h.isValid=function(){return this.$d.toString()!==c},h.isSame=function(e,t){var r=v(e);return this.startOf(t)<=r&&r<=this.endOf(t)},h.isAfter=function(e,t){return v(e)<this.startOf(t)},h.isBefore=function(e,t){return this.endOf(t)<v(e)},h.$g=function(e,t,r){return b.u(e)?this[t]:this.set(r,e)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(e,i){var c=this,u=!!b.u(i)||i,d=b.p(e),m=function(e,t){var r=b.w(c.$u?Date.UTC(c.$y,t,e):new Date(c.$y,t,e),c);return u?r:r.endOf("day")},h=function(e,t){return b.w(c.toDate()[e].apply(c.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),c
1)},f=this.$W,p=this.$M,_=this.$D,y="set"+(this.$u?"UTC":"");switch(d){case s:return u?m(1,0):m(31,11);case l:return u?m(1,p):m(0,p+1);case a:var v=this.$locale().weekStart||0,g=(f<v?f+7:f)-v;return m(u?_-g:_+(6-g),p);case"day":case o:return h(y+"Hours",0);case n:return h(y+"Minutes",1);case r:return h(y+"Seconds",2);case t:return h(y+"Milliseconds",3);default:return this.clone()}},h.endOf=function(e){return this.startOf(e,!1)},h.$set=function(a,i){var c,u=b.p(a),d="set"+(this.$u?"UTC":""),m=((c={}).day=d+"Date",c[o]=d+"Date",c[l]=d+"Month",c[s]=d+"FullYear",c[n]=d+"Hours",c[r]=d+"Minutes",c[t]=d+"Seconds",c[e]=d+"Milliseconds",c)[u],h="day"===u?this.$D+(i-this.$W):i;if(u===l||u===s){var f=this.clone().set(o,1);f.$d[m](h),f.init(),this.$d=f.set(o,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](h);return this.init(),this},h.set=function(e,t){return this.clone().$set(e,t)},h.get=function(e){return this[b.p(e)]()},h.add=function(e,i){var o,c=this;e=Number(e);var u=b.p(i),d=function(t){var r=v(c);return b.w(r.date(r.date()+Math.round(t*e)),c)};if(u===l)return this.set(l,this.$M+e);if(u===s)return this.set(s,this.$y+e);if("day"===u)return d(1);if(u===a)return d(7);var m=((o={})[r]=6e4,o[n]=36e5,o[t]=1e3,o)[u]||1,h=this.$d.getTime()+e*m;return b.w(h,this)},h.subtract=function(e,t){return this.add(-1*e,t)},h.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||c;var n=e||"YYYY-MM-DDTHH:mm:ssZ",a=b.z(this),l=this.$H,i=this.$m,s=this.$M,o=r.weekdays,u=r.months,m=r.meridiem,h=function(e,r,a,l){return e&&(e[r]||e(t,n))||a[r].slice(0,l)},f=function(e){return b.s(l%12||12,e,"0")},p=m||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(d,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return b.s(t.$y,4,"0");case"M":return s+1;case"MM":return b.s(s+1,2,"0");case"MMM":return h(r.monthsShort,s,u,3);case"MMMM":return h(u,s);case"D":return t.$D;case"DD":return b.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return h(r.weekdaysMin,t.$W,o,2);case"ddd":return h(r.weekdaysShort,t.$W,o,3);case"dddd":return o[t.$W];case"H":return String(l);case"HH":return b.s(l,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return p(l,i,!0);case"A":return p(l,i,!1);case"m":return String(i);case"mm":return b.s(i,2,"0");case"s":return String(t.$s);case"ss":return b.s(t.$s,2,"0");case"SSS":return b.s(t.$ms,3,"0");case"Z":return a}return null}(e)||a.replace(":","")})},h.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},h.diff=function(e,o,c){var u,d=this,m=b.p(o),h=v(e),f=(h.utcOffset()-this.utcOffset())*6e4,p=this-h,_=function(){return b.m(d,h)};switch(m){case s:u=_()/12;break;case l:u=_();break;case i:u=_()/3;break;case a:u=(p-f)/6048e5;break;case"day":u=(p-f)/864e5;break;case n:u=p/36e5;break;case r:u=p/6e4;break;case t:u=p/1e3;break;default:u=p}return c?u:b.a(u)},h.daysInMonth=function(){return this.endOf(l).$D},h.$locale=function(){return f[this.$L]},h.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=y(e,t,!0);return n&&(r.$L=n),r},h.clone=function(){return b.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},m}(),x=g.prototype;return v.prototype=x,[["$ms",e],["$s",t],["$m",r],["$H",n],["$W","day"],["$M",l],["$y",s],["$D",o]].forEach(function(e){x[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),v.extend=function(e,t){return e.$i||(e(t,g,v),e.$i=!0),v},v.locale=y,v.isDayjs=_,v.unix=function(e){return v(1e3*e)},v.en=f[h],v.Ls=f,v.p={},v},e.exports=t()},47443:function(e,t,r){var n=r(42118);e.exports=function(e,t){return!!(null==e?0:e.length)&&n(e,t,0)>-1}},1196:function(e){e.exports=function(e,t,r){for(var n=-1,a=null==e?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}},41848:function(e){e.exports=function(e,t,r,n){for(var a=e.length,l=r+(n?1:-1);n?l--:++l<a;)if(t(e[l],l,e))return l;return -1}},42118:function(e,t,r){var n=r(41848),a=r(62722),l=r(42351);e.exports=function(e,t,r){return t==t?l(e,t,r):n(e,a,r)}},62722:function(e){e.exports=function(e){return e!=e}},45652:function(e,t,r){var n=r(88668),a=r(47443),l=r(1196),i=r(74757),s=r(23593),o=r(21814);e.exports=function(e,t,r){var c=-1,u=a,d=e.length,m=!0,h=[],f=h;if(r)m=!1,u=l;else if(d>=200){var p=t?null:s(e);if(p)return o(p);m=!1,u=i,f=new n}else f=t?[]:h;e:for(;++c<d;){var _=e[c],y=t?t(_):_;if(_=r||0!==_?_:0,m&&y==y){for(var v=f.length;v--;)if(f[v]===y)continue e;t&&f.push(y),h.push(_)}else u(f,y,r)||(f!==h&&f.push(y),h.push(_))}return h}},23593:function(e,t,r){var n=r(58525),a=r(50308),l=r(21814),i=n&&1/l(new n([,-0]))[1]==1/0?function(e){return new n(e)}:a;e.exports=i},42351:function(e){e.exports=function(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return -1}},41609:function(e,t,r){var n=r(280),a=r(64160),l=r(35694),i=r(1469),s=r(98612),o=r(44144),c=r(25726),u=r(36719),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;
1if(s(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||o(e)||u(e)||l(e)))return!e.length;var t=a(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!n(e).length;for(var r in e)if(d.call(e,r))return!1;return!0}},50308:function(e){e.exports=function(){}},44908:function(e,t,r){var n=r(45652);e.exports=function(e){return e&&e.length?n(e):[]}},55630:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/contact/cxm/form2",function(){return r(23869)}])},70744:function(e,t,r){"use strict";r.d(t,{d:function(){return n}});let n=(0,r(67294).createContext)({methods:{},isLoading:!1,isError:!1,setIsError:()=>({}),getData:()=>({}),handleSelected:()=>({}),handleSubmit:()=>({}),handleBack:()=>({})})},33719:function(e,t,r){"use strict";r.d(t,{AD:function(){return v},DQ:function(){return y},RC:function(){return _},mv:function(){return f}});var n=r(85893),a=r(11163),l=r(67294),i=r(27484),s=r.n(i),o=r(96486),c=r.n(o),u=r(87536),d=r(88773),m=r(8060),h=r(70744);let f="_ttbbs-seq",p="_ttbbs-data",_="_ttbbs-uid",y="_ttbbs-mb",v=e=>{let{levels:t=[],children:r}=e,i=t.length>0?t[0]:"level1",o=(0,a.useRouter)(),{level:v=i,branch_code:b=""}=o.query,g=(0,u.cI)(),{getValues:x,setValue:j,clearErrors:w,trigger:S,reset:N}=g,[$,k]=(0,l.useState)(!1),[C,D]=(0,l.useState)(!1),O=()=>{let[e]=(0,d.Z)().split("-"),t=new Date(Date.now()).getTime().toString().slice(-5);return"".concat("ttbbs","-").concat(e,"-").concat(t)},T=()=>{let e=localStorage.getItem(_);c().isEmpty(e)&&localStorage.setItem(_,O())},M=()=>{var e;let t=I()>=0,r=null!==(e=sessionStorage.getItem(f))&&void 0!==e?e:"";if(c().isEmpty(r)&&t){let e={url:window.location.href.replace(/\/(level1|level2|level3|level4|level5)/,""),application_version:localStorage.getItem(_)||"",created_time:s()().format("YYYY/MM/DD HH:mm:ss")};b&&(e.branch_code=b),k(!0),fetch("/api/branch-survey/transaction",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.json()).then(e=>{let{sequence_id:t}=e;sessionStorage.setItem(f,t)}).catch(()=>{D(!0),k(!1)})}},q=()=>{if(c().isEmpty(x())){var e;null===(e=E().items)||void 0===e||e.map(e=>{j(e.label,e.answer,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})})}},A=()=>{let e=E();c().isEmpty(e.id)&&v.startsWith("level")&&o.replace({pathname:"/th/branch-survey/level1",query:c().omit(o.query,"level")})},P=e=>m.Z.encrypt(_,e),I=()=>t.findIndex(e=>e===v),E=()=>{var e;return JSON.parse(null!==(e=sessionStorage.getItem(p))&&void 0!==e?e:"{}")},Z=e=>sessionStorage.setItem(p,JSON.stringify(e)),L=()=>{sessionStorage.removeItem(p),sessionStorage.removeItem(f)},Y=async e=>{k(!0),fetch("/api/branch-survey/transaction",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.json()).then(r=>{let{success:n=!1}=r;if(n){let r=I();if(r<t.length){let n=E();if(r===t.length-1){let t=e.find(e=>"Feedback"===e.labelKey);if(t){if("Yes"===t.answer){let e=n.items.find(e=>"Mobile"===e.labelKey),t={};if(null==e?void 0:e.answer){let t=P(e.answer.replaceAll("-",""));sessionStorage.setItem(y,t)}c().isEmpty(n.branchCode)||(t.branch_code=n.branchCode),L(),o.push({pathname:"/th/contact/cxm/level1",query:t});return}L(),o.push("/th/branch-survey/success");return}L(),o.push("/th")}else{let e=t[r+1];n.currentLevel=e,Z(n),w(),o.push({pathname:"/th/branch-survey/".concat(e),query:c().omit(o.query,"level")})}}}else D(!0),k(!1)}).catch(()=>{D(!0),k(!1)})},F=()=>{var e;let t=window.location.pathname.split("/").slice(-1)[0]||i,r=E(),n=(null==r?void 0:null===(e=r.items)||void 0===e?void 0:e.filter(e=>e.level===t))||[],a=n.map(e=>e.label),l={};null==n||n.map(e=>{l[e.label]=e.answer}),N({...l}),n.map(e=>{j(e.label,e.answer)}),S(a)};return(0,l.useEffect)(()=>{T(),M(),q(),A();let e=()=>{k(!1),F()};return o.events.on("routeChangeComplete",e),()=>{o.events.off("routeChangeComplete",e)}},[]),(0,n.jsx)(h.d.Provider,{value:{methods:g,isLoading:$,getData:E,isError:C,setIsError:D,handleSelected:e=>{let t=E();if(c().isEmpty(t.createdAt)&&(t.createdAt=s()().format("DD/MM/YYYY")),c().isEmpty(t.id)&&(t.id=sessionStorage.getItem(f)||""),c().isEmpty(t.branchCode)&&b&&(t.branchCode=b),t.items){let r=t.items.filter(t=>{let{labelKey:r}=t;return r!==e.labelKey});t.items=[...r,e]}else t.items=[e];Z(t)},handleSubmit:Y,handleBack:()=>{let e=I();if(e<=t.length){let r=t[e-1],n=E();n.currentLevel=r,Z(n),w(),o.push({pathname:"/th/branch-survey/".concat(r),query:c().omit(o.query,"level")})}}},children:r})}},50514:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(85893),a=r(96486),l=r.n(a),i=r(49587),s=r.n(i);let o=["level1","level2","level3","level4","form1","form2","form3"],c={th:{text_level1:"สิà¹à¸à¸à¸µà¹à¸à¸¸à¸à¸à¸¢à¸²à¸à¸à¸à¸ à¸à¸µà¹à¸à¹à¸¡à¸à¸µà¸à¸à¸à¸²à¸ (à¸à¸µà¸à¸µà¸à¸µ)",text_level2:"à¹à¸à¸µà¹à¸¢à¸§à¸à¸±à¸"},en:{text_level1:"Your comment or suggestion to ttb",text_level2:"relating to"}};function u(e){var t,r;let a=(o.indexOf(e.levelName)+1)/o.length*100;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"".concat(s().contianer," ").concat(s()["container-mobile"]," ").concat(s()["desktop-only"]," "),style:{width:"100%"},children:["form3"==e.levelName?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("input",{type:"range",className:"".concat(s().range1," "),value:l().floor(a,-1),max:"100",onChange:()=>{}})}):"level1"==e.levelName?(0,n.jsx)(n.Fragment,{}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("input",{type:"range",className:"".concat(s().range," "),value:l().floor(a,-1),max:"100",onChange:()=>{}})}),"level1"==e.levelName?(0,n.jsx)(n.Fragment,{}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:"".concat(s().circle," ").concat(s()["cir
1cle-mobile"]," ").concat("form3"==e.levelName?s()["circle-fulfilled"]:""),children:"level2"==e.levelName?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("p",{className:"".concat(s()["persent-text-center"]),children:"15%"})}):"level3"==e.levelName?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"".concat(s()["persent-text-center"]),children:"30%"})," "]}):"level4"==e.levelName?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"".concat(s()["persent-text-center"]),children:"45%"})," "]}):"form1"==e.levelName?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"".concat(s()["persent-text-center"]),children:"65%"})," "]}):"form2"==e.levelName?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"".concat(s()["persent-text-center"]),children:"80%"})," "]}):"form3"==e.levelName?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"".concat(s()["persent-text-center"]),children:"100%"})," "]}):""})})]}),"level1"===e.levelName&&(0,n.jsx)("h2",{className:"".concat(s()["h2-mobile-2"]," ").concat(s()["hide-on-desk"]),style:{textAlign:"left",marginTop:"2%"},children:c[null!==(t=e.locale)&&void 0!==t?t:"en"].text_level1}),"level2"===e.levelName&&(0,n.jsx)("h2",{className:"".concat(s()["h2-mobile"]," ").concat(s()["hide-on-desk"]),style:{textAlign:"left",marginTop:"2%"},children:c[null!==(r=e.locale)&&void 0!==r?r:"en"].text_level2})]})}},23869:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return j}});var n=r(85893),a=r(11752),l=r.n(a),i=r(9008),s=r.n(i),o=r(11163),c=r(67294),u=r(57492),d=r(87536),m=r(86455),h=r.n(m),f=r(74231),p=r(33719),_=r(50514),y=r(47859),v=r(8060),b=r(81717),g=r.n(b);let{publicRuntimeConfig:x}=l()();var j=!0;t.default=e=>{var t,r,a,l;let i;let{locale:m}=e,b=(0,o.useRouter)(),[j,w]=(0,c.useState)(!1),[S,N]=(0,c.useState)(!1),[$,k]=(0,c.useState)("phone"),[C,D]=(0,c.useState)(!1),[O,T]=(0,c.useState)(!1),[M,q]=(0,c.useState)(0),[A,P]=(0,c.useState)(null),I=["Backspace","Delete","ArrowLeft","ArrowRight","Tab"];(0,c.useEffect)(()=>{Z(),L(),z()},[]);let E=e=>e.trim().replace(/\s+/g," ").toLowerCase(),Z=()=>{let e=sessionStorage.getItem(y.sessionStorageKey);if(e){let t=E(JSON.parse(e).level_1),r={à¸à¸·à¹à¸à¸à¸¡:()=>q(1),à¹à¸ªà¸à¸à¹à¸à¸°:()=>q(1),สà¸à¸à¸à¸²à¸¡à¸à¹à¸à¸¡à¸¹à¸¥:()=>q(2),"à¹à¸à¹à¸à¸à¸±à¸à¸«à¸² à¸à¸µà¸à¸µà¸à¸µ à¸à¸±à¸":()=>q(2),รà¹à¸à¸à¹à¸£à¸µà¸¢à¸:()=>q(3)};t&&r[t]?r[t]():(console.error("Unknown case"),b.push("/contact/cxm/level1"))}else b.push("/contact/cxm/level1")},L=()=>{let e=document.getElementById("captcha");e&&(e.src="/api/captcha?".concat(new Date().getTime()))},Y=async e=>{if(C||O)return;T(!0);let t="/api/captcha/verify?captcha="+e.txtCaptcha,r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}}),n=await r.json();if(T(!1),"success"==n.status){P(null);let t={first_name:"",last_name:"",phone:"",email:"",is_call_back:"",call_back_by:""},[r,...n]=e.full_name.split(" "),a=n.join(" ")||" ";t.first_name=r.replace(/[,|]+/g,""),t.last_name=a.replace(/[,|]+/g,""),t.phone=e.mobile_no,t.email=0==e.email.length?" ":e.email,1===M&&(t.is_call_back="N",t.call_back_by=""),2===M&&(t.is_call_back=S?"Y":"N",t.call_back_by=S?"email":""),3===M&&(t.is_call_back=!0==j?"Y":"N",t.call_back_by=""==$?!0==j?"phone":"":$),D(!0);let l=await fetch("/api/cxm/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(B(),l.ok)sessionStorage.removeItem(y.sessionStorageKey),await b.push("/".concat(m,"/contact/cxm/form3/?check=").concat(j)),D(!1);else{h().fire({html:"th"===m?"ระà¸à¸à¸à¸±à¸à¸à¹à¸à¸ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹à¸ ายหลัà¸":"System is not ready please try again later",icon:"error",confirmButtonText:"th"===m?"à¸à¸´à¸":"Close"}),D(!1);return}}else P(F[m].validate_captcha),L(),D(!1)},F={th:{title:"à¹à¸à¸£à¸à¹à¸ªà¹à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸à¸à¸à¸¸à¸",validate_fullname:"à¹à¸à¸£à¸à¸à¸£à¸§à¸à¸ªà¸à¸à¸à¸·à¹à¸",validate_email:"à¹à¸à¸£à¸à¸à¸£à¸§à¸à¸ªà¸à¸à¸à¸µà¹à¸¡à¸¥",validate_mobile:"à¹à¸à¸£à¸à¸à¸£à¸§à¸à¸ªà¸à¸à¹à¸à¸à¸£à¹à¹à¸à¸£à¸¨à¸±à¸à¸à¹",validate_subject:"à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¸«à¸±à¸§à¸à¹à¸à¸ªà¸à¸à¸à¸²à¸¡à¹à¸«à¹à¸à¸£à¸à¸à¹à¸§à¸",required_fullname:"à¹à¸à¸£à¸à¸£à¸°à¸à¸¸à¸à¸·à¹à¸",required_email:"à¹à¸à¸£à¸à¸£à¸°à¸à¸¸à¸à¸µà¹à¸¡à¸¥",required_mobile:"à¹à¸à¸£à¸à¸£à¸°à¸à¸¸à¹à¸à¸à¸£à¹à¹à¸à¸£à¸¨à¸±à¸à¸à¹",label_name:"à¸à¸·à¹à¸",label_email:"à¸à¸µà¹à¸¡à¸¥",label_phone:"à¹à¸à¸à¸£à¹à¹à¸à¸£à¸¨à¸±à¸à¸à¹",label_submit:"สà¹à¸à¸à¹à¸à¸¡à¸¹à¸¥",error_title:"มีà¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸´à¸à¸à¸¶à¹à¸",error_text:"à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹à¸ ายหลัà¸",radio_text1:"à¸à¸²à¸à¹à¸à¸à¸£à¹à¹à¸à¸£à¸¨à¸±à¸à¸à¹",radio_text2:"à¸à¸²à¸à¸à¸µà¹à¸¡à¸¥",required_captcha:"à¹à¸à¸£à¸à¸£à¸°à¸à¸¸ CAPTCHA",validate_captcha:"à¹à¸à¸£à¸à¸£à¸°à¸à¸¸ CAPTCHA à¹à¸«à¹à¸à¸¹à¸à¸à¹à¸à¸",helptext_captcha:"à¹à¸à¸£à¸à¹à¸ªà¹à¸£à¸«à¸±à¸ªà¸à¸µà¹à¹à¸«à¹à¸",contact_channel:"à¸à¹à¸à¸à¸à¸²à¸£à¹à¸«à¹à¸à¸à¸²à¸à¸²à¸£à¸à¸´à¸à¸à¹à¸à¸à¸¥à¸±à¸",contact_channel_with_email:"à¸à¸à¸¸à¸à¸²à¸à¹à¸«à¹à¸à¸´à¸à¸à¹à¸à¸à¸¥à¸±à¸à¸à¹à¸²à¸à¸à¸²à¸à¸à¸µà¹à¸¡à¸¥"},en:{title:"Please enter your information",validate_fullname:"Please enter your name",validate_email:"Please enter your e-mail address",validate_mobile:"Please enter your phone number",validate_subject:"please fillup the form",required_fullname:"Please enter your name",required_email:"Please enter your e-mail address",required_mobile:"Please enter your phone number",label_name:"Name",label_email:"Email",label_phone:"Phone Number",label_submit:"Submit",error_title:"something went wrong",error_text:"please try again later",radio_text1:"Phone",radio_text2:"Email",required_captcha:"plase enter CAPTCHA",validate_captcha:"Please enter CAPTCHA correctly",helptext_captcha:"",contact_channel:"Contact channel via ",contact_channel_with_email:"Allow to contact via email"}};if((0,c.useEffect)(()=>{!1===j&&k(" "),!0===j&&" "===$&&k("phone")},[j]),(1===M||2===M)&&(i=f.Ry().shape({switchlang:f.Z_().required(),txtCaptcha:f.Z_().test("len",F[m].required_captcha,e=>(null==e?void 0:e.length)===4).required(F[m].required_captcha),full_name:f.Z_().trim().required(F[m].required_fullname).matches(/^[a-zA-Zà¸-à¹.\-/\s]+$/,F[m].required_fullname),email:f.Z_().trim().required(F[m].required_email).matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{1,}$/i,F[m].validate_email),mobile_no:f.Z_().matches(/^((?!00|01|06|08|09)[0-9]{9}||(06|08|09)[0-9]{8})$/i,F[m].validate_mobile).required(F[m].required_mobile)})),3===M){let e={switchlang:f.Z_().required(),txtCaptcha:f.Z_().test("len",F[m].required_captcha,e=>(null==e?void 0:e.length)===4).required(F[m].required_captcha),full_name:f.Z_().trim().required(F[m].required_fullname).matches(/^[a-zA-Zà¸-à¹.-/\s]+$/,F[m].required_fullname),mobile_no:f.Z_().matches(/^((?!00|01|06|08|09)[0-9]{9}||(06|08|09)[0-9]{8})$/i,F[m].validate_mobile)}
1,t=f.Z_().trim().matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{1,}$/i,{message:F[m].validate_email,excludeEmptyString:!0}),r=f.Z_().trim().required(F[m].required_email).matches(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{1,}$/i,F[m].validate_email);if(j)switch($){case"phone":i=f.Ry().shape({...e,email:t,mobile_no:e.mobile_no.required(F[m].required_mobile)});break;case"email":i=f.Ry().shape({...e,email:r,mobile_no:e.mobile_no.required(F[m].required_mobile)});break;default:i=f.Ry().shape({...e,email:t,mobile_no:e.mobile_no})}else i=f.Ry().shape({...e,email:t,mobile_no:e.mobile_no.required(F[m].required_mobile)})}let{register:H,handleSubmit:R,reset:B,setValue:J,formState:{errors:U}}=(0,d.cI)({resolver:(0,u.X)(i)}),z=async()=>{var e;let t=null!==(e=sessionStorage.getItem(p.DQ))&&void 0!==e?e:"",r="";t&&(r=v.Z.decrypt(p.RC,t)),r&&J("mobile_no",r)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s(),{children:(0,n.jsx)("script",{type:"text/javascript",src:"/global/assets/js/vendor/range-touch.min.js"})}),(0,n.jsxs)("div",{className:"".concat(g()["cxm-header"]),children:[(0,n.jsx)("img",{className:"".concat(g()["logo-mobile"]),src:"/global/assets/img/media-img/logo-default.png",height:"28",onClick:()=>{b.push("/".concat(m))},style:{marginLeft:"5%",marginTop:"2%",cursor:"pointer"}}),(0,n.jsx)("img",{className:"".concat(g()["logo-mobile1"]),src:"/ba/icon/close.png",height:"21",onClick:()=>{b.push("/".concat(m,"/contact"))},style:{marginTop:"3%",marginRight:"5%",cursor:"pointer"}})]}),(0,n.jsx)("div",{style:{marginTop:"5%",width:"100%"},className:"container",children:(0,n.jsxs)("div",{className:"container",children:[(0,n.jsx)(_.Z,{pathName:"cxm",levelName:"form2"}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("div",{className:"col-12",children:(0,n.jsx)("div",{className:"form-product pt-5 align-item-center",children:(0,n.jsxs)("form",{onSubmit:R(Y),id:"formContact",children:[(0,n.jsx)("input",{type:"hidden",value:m,...H("switchlang")}),(0,n.jsx)("h2",{children:F[m].title}),(0,n.jsxs)("div",{className:"row mb-2",children:[(0,n.jsx)("div",{className:"col-lg-6 col-md-6",children:(0,n.jsxs)("div",{className:"border-input-form",style:{paddingBottom:"1.5rem"},children:[(0,n.jsx)("div",{className:"title__form",children:(0,n.jsxs)("div",{style:{display:"flex"},children:[(0,n.jsx)("h2",{children:F[m].label_name}),(0,n.jsx)("h2",{style:{color:"red"},children:"*"})]})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{autoComplete:"off",className:"form-input-deletable input-control",style:{marginBottom:"0",borderColor:"#fff"},type:"text",...H("full_name"),onKeyDown:e=>{/^[a-zA-Zà¸-à¹.\-/\s]+$/.test(e.key)||I.includes(e.key)||e.preventDefault()}}),(0,n.jsx)("p",{style:{float:"left",color:"#da2110",fontSize:".8rem",bottom:".3rem",width:"100%"},children:null===(t=U.full_name)||void 0===t?void 0:t.message})]})]})}),(0,n.jsx)("div",{className:"col-lg-6 col-md-6",children:(0,n.jsxs)("div",{className:"border-input-form",style:{paddingBottom:"1.5rem"},children:[(0,n.jsx)("div",{className:"title__form",children:(0,n.jsxs)("div",{style:{display:"flex"},children:[(0,n.jsx)("h2",{children:F[m].label_phone}),(0,n.jsx)("h2",{style:{color:"red"},children:"*"})]})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{autoComplete:"off",type:"text",maxLength:10,className:"form-input-deletable",style:{marginBottom:"0",borderColor:"#fff",backgroundColor:"#fff"},...H("mobile_no"),onKeyDown:e=>{/[0-9]/.test(e.key)||I.includes(e.key)||e.preventDefault()}}),(0,n.jsx)("p",{style:{float:"left",color:"#da2110",fontSize:".8rem",bottom:".3rem",width:"100%"},children:null===(r=U.mobile_no)||void 0===r?void 0:r.message})]})]})})]}),(0,n.jsx)("div",{className:"row mb-2",children:(0,n.jsx)("div",{className:"col-lg-6 col-md-6",children:(0,n.jsxs)("div",{className:"border-input-form",style:{paddingBottom:"1.5rem"},children:[(0,n.jsx)("div",{className:"title__form",children:(0,n.jsxs)("div",{style:{display:"flex"},children:[(0,n.jsx)("h2",{children:F[m].label_email}),(0,n.jsxs)("h2",{style:{color:"red"},children:[(1===M||2===M)&&(0,n.jsx)("h2",{style:{color:"red"},children:"*"}),3===M&&j&&"email"===$&&(0,n.jsx)("h2",{style:{color:"red"},children:"*"})]})]})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{autoComplete:"off",className:"form-input-deletable input-control",type:"text",...H("email"),onKeyDown:e=>
1{/[a-zA-Z0-9.@_%+-]+$/i.test(e.key)||I.includes(e.key)||e.preventDefault()},style:{marginBottom:"0",borderColor:"#fff"}}),(0,n.jsx)("p",{style:{float:"left",color:"#da2110",fontSize:".8rem",bottom:".3rem",width:"100%"},children:null===(a=U.email)||void 0===a?void 0:a.message})]})]})})}),2===M&&(0,n.jsxs)("div",{className:"check-box-accept",style:{display:"inline-block",width:"100%"},children:[(0,n.jsxs)("label",{htmlFor:"acceptcond",children:[" ",(0,n.jsx)("input",{className:"checkbox-component",type:"checkbox",checked:S,onChange:()=>{N(!S)}}),F[m].contact_channel_with_email]}),(0,n.jsx)("br",{})]}),3===M&&(0,n.jsxs)("div",{className:"check-box-accept",style:{display:"inline-block",width:"100%"},children:[(0,n.jsxs)("label",{htmlFor:"acceptcond",children:[" ",(0,n.jsx)("input",{className:"checkbox-component",type:"checkbox",checked:j,...H("acceptcond"),onChange:()=>{w(!j),k(" ")}}),F[m].contact_channel]}),(0,n.jsx)("br",{})]}),3===M&&(0,n.jsxs)("div",{className:"row",style:{marginLeft:"2%",marginBottom:"2%"},children:[(0,n.jsx)("div",{className:"col-lg-3 col-md-12",children:(0,n.jsxs)("label",{className:"container-bullet-selector",children:[(0,n.jsx)("span",{className:"span-text-selected"}),F[m].radio_text1,(0,n.jsx)("input",{type:"radio",name:"need_contact",onClick:()=>k("phone"),className:"compare-select ",checked:j&&"phone"===$,disabled:!j}),(0,n.jsx)("span",{style:{backgroundColor:"#fff"},className:"bullet-selector"})]})}),(0,n.jsx)("div",{className:"col-lg-4 col-md-12",children:(0,n.jsxs)("label",{className:"container-bullet-selector",children:[(0,n.jsx)("span",{className:"span-text-selected"}),F[m].radio_text2,(0,n.jsx)("input",{type:"radio",name:"need_contact",value:"email",onClick:()=>k("email"),disabled:!j,className:"compare-select",checked:j&&"email"===$}),(0,n.jsx)("span",{style:{backgroundColor:"#fff"},className:"bullet-selector"})]})})]}),(0,n.jsxs)("div",{className:"row mt-3",children:[(0,n.jsx)("div",{className:"col-lg-3 col-md-3 col-sm-12 text-center",children:(0,n.jsxs)("div",{className:"bottom-form",children:[(0,n.jsx)("img",{src:"".concat(x.baseUrl[e.env],"/api/captcha"),id:"captcha",alt:""}),(0,n.jsx)("a",{id:"recaptcha",onClick:()=>{L(),J("txtCaptcha","")},children:(0,n.jsx)("i",{className:"fa fa-refresh ml-3"})})]})}),(0,n.jsxs)("div",{className:"col-lg-3 col-md-3 col-sm-3 text-center mt-2",children:[(0,n.jsx)("input",{autoComplete:"off",onKeyDown:()=>{P(null)},...H("txtCaptcha"),className:"form-input-deletable input-control",type:"text",id:"textCaptcha",maxLength:4,placeholder:F[m].helptext_captcha,style:{fontSize:"16px"}}),(0,n.jsx)("br",{}),(0,n.jsxs)("p",{id:"errorCaptcha",style:{float:"left",color:"#da2110",fontSize:".8rem",marginTop:"0",width:"100%",marginLeft:".5rem"},children:[A,null===(l=U.txtCaptcha)||void 0===l?void 0:l.message]})]})]}),(0,n.jsx)("div",{className:"row ",children:(0,n.jsx)("div",{className:"".concat(g()["button-mobile"]," col-sm-12 "),children:(0,n.jsx)("button",{disabled:C,type:"submit",id:"submitLoading",className:"btn btn-primary py-2",style:{textAlign:"center"},children:F[m].label_submit})})})]})})})})]})})]})}},47859:function(e,t,r){"use strict";r.r(t),r.d(t,{sessionStorageKey:function(){return h}});var n=r(11163),a=r(67294),l=r(41609),i=r.n(l),s=r(44908),o=r.n(s),c=r(97334),u=r.n(c),d=r(86455),m=r.n(d);let h="cxm_form";t.default=(e,t,r,l,s,c,d)=>{let f=(0,n.useRouter)(),[p,_]=(0,a.useState)([]),[y,v]=(0,a.useState)(""),[b,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{j()},[e]);let x=(t,r)=>{if(1===e)return"th"===d?t["level_".concat(r)]:t["level_".concat(r,"_en")];let n=t["level_".concat(r)].split("|"),a=t["level_".concat(r,"_en")].split("|"),l=n[0],i=a[0];return"th"===d?l:i},j=(0,a.useCallback)(async()=>{let r=await k();if(1===e){sessionStorage.removeItem(h);let e=t.map(e=>x(e,1));_(o()(e))}else{if(r)switch(e){case 2:v(r.level_1);break;case 3:v(r.level_2);break;case 4:v(r.level_3)}else{if(i()(l))f.push("/".concat(d,"/contact/cxm/level1"));else{let e=u().stringify(l);f.push("/".concat(d,"/contact/cxm/level1?").concat(e))}return}let n=t.filter(t=>2===e?r.level_1.includes(x(t,1)):3===e?r.level_1.includes(x(t,1))&&r.level_2.includes(x(t,2)):4===e?r.level_1.includes(x(t,1))&&r.level_2.includes(x(t,2))&&r.level_3.includes(x(t,3)):(console.error("invalid level"),!1)).map(t=>x(t,e));_(o()(n))}},[e,r,l]),w=(0,a.useCallback)(async n=>{let a=n.split("|"),i="",o="";if(a.length>0&&(i=a[0],a.length>1)){let e=(0,a[1]).match(/url-link:\s*(\S+)/);e&&e[1]&&(o=e[1])}let u=await k();if(!b){if(g(!0),1===e){let e={level_1_text:i,branch_code:r,...s,locale:d,ref_channel:c};try{if(!(await fetch("/api/cxm/create-level1",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw Error("Failed to create level 1 answer")}catch(e){m().fire({html:"th"===d?"ระà¸à¸à¸à¸±à¸à¸à¹à¸à¸ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹à¸ ายหลัà¸":"System is not ready please try again later",icon:"error",confirmButtonText:"th"===d?"à¸à¸´à¸":"Close"});return}}if(4===e){if(!u)return;let e=t.find(e=>x(e,1)===u.level_1&&x(e,2)===u.level_2&&x(e,3)===u.level_3&&x(e,4)===i),n={...u,level_4:i,branch_code:r,level_id:e.id};try{if((await fetch("/api/cxm/update-all-level",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)f.push("/".concat(d,"/contact/cxm/form1?requireMessage=").concat(["à¸à¸·à¹à¸à¹","à¹à¸à¸£à¸à¸£à¸°à¸à¸¸à¸£à¸²à¸¢à¸¥à¸°à¹à¸à¸µà¸¢à¸"].includes(i)));else throw Error("Failed to update all levels")}catch(e){m().fire({html:"th"===d?"ระà¸à¸à¸à¸±à¸à¸à¹à¸à¸ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹à¸ ายหลัà¸":"System is not ready please try again later",icon:"error",confirmButtonText:"th"===d?"à¸à¸´à¸":"Close"});return}g(!1);return}
1if($(h,{...u,["level_".concat(e)]:i}),g(!1),o){N(o,l,u,e,i);return}S(f,d,e,l)}},[e,r,b,l,s,c]),S=(e,t,r,n)=>{let a=u().stringify(n),l="/".concat(t,"/contact/cxm/level").concat(r+1);e.push(a?"".concat(l,"?").concat(a):l)},N=(e,t,r,n,a)=>{if(!i()(t)){let e=u().stringify(t);$(h,{...r,["level_".concat(n)]:a,search_params:e})}window.location.href=e},$=(e,t)=>{sessionStorage.setItem(e,JSON.stringify(t))},k=(0,a.useCallback)(()=>{let e=sessionStorage.getItem(h);return e?JSON.parse(e):null},[]);return{choices:p,handleAnswer:w,previousAnswer:y}}},8060:function(e,t,r){"use strict";let n=r(64956);t.Z=n},49587:function(e){e.exports={contianer:"styles_contianer__7uV8J","container-mobile":"styles_container-mobile__LyTlQ",circle:"styles_circle__L2Ov2","circle-fulfilled":"styles_circle-fulfilled__O_olJ","desktop-only":"styles_desktop-only__9HpsH","circle-opacity":"styles_circle-opacity__kdNpz",range:"styles_range__ooSNV",range1:"styles_range1__n_5_K","range-opacity":"styles_range-opacity__lizT6","h2-mobile":"styles_h2-mobile__oG1x4","h2-mobile-2":"styles_h2-mobile-2__tnzhd","circle-mobile":"styles_circle-mobile__Gc3L8","persent-text-center":"styles_persent-text-center__kPyf1","hide-on-desk":"styles_hide-on-desk__SJ1oq"}},81717:function(e){e.exports={"cxm-header":"style_cxm-header__eKZbM","button-submit":"style_button-submit__2WUpE","img-form3":"style_img-form3__3AePU","button-form3":"style_button-form3__Hj_9b","hide-on-mobile-1":"style_hide-on-mobile-1__EwyuC","logo-mobile":"style_logo-mobile__RSGYC","logo-mobile1":"style_logo-mobile1__Qr7vZ","h2-mobile":"style_h2-mobile__d0FeV","button-mobile":"style_button-mobile__dih2D","error-message":"style_error-message__C1VbK","logo-mobile-margin":"style_logo-mobile-margin__VICU_","logo-close-margin":"style_logo-close-margin__kbJ8h","textarea-style":"style_textarea-style___GLr0","container-margin":"style_container-margin__htXh0","flex-title":"style_flex-title__Pl2IO",red:"style_red__6x3yH","text-center":"style_text-center__fYiDL"}},97334:function(e){!function(){"use strict";var t={815:function(e){e.exports=function(e,r,n,a){r=r||"&",n=n||"=";var l={};if("string"!=typeof e||0===e.length)return l;var i=/\+/g;e=e.split(r);var s=1e3;a&&"number"==typeof a.maxKeys&&(s=a.maxKeys);var o=e.length;s>0&&o>s&&(o=s);for(var c=0;c<o;++c){var u,d,m,h,f=e[c].replace(i,"%20"),p=f.indexOf(n);(p>=0?(u=f.substr(0,p),d=f.substr(p+1)):(u=f,d=""),m=decodeURIComponent(u),h=decodeURIComponent(d),Object.prototype.hasOwnProperty.call(l,m))?t(l[m])?l[m].push(h):l[m]=[l[m],h]:l[m]=h}return l};var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},577:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,l,i,s){return(l=l||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e)?n(a(e),function(a){var s=encodeURIComponent(t(a))+i;return r(e[a])?n(e[a],function(e){return s+encodeURIComponent(t(e))}).join(l):s+encodeURIComponent(t(e[a]))}).join(l):s?encodeURIComponent(t(s))+i+encodeURIComponent(t(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var l=r[e]={exports:{}},i=!0;try{t[e](l,l.exports,n),i=!1}finally{i&&delete r[e]}return l.exports}n.ab="//";var a={};a.decode=a.parse=n(815),a.encode=a.stringify=n(577),e.exports=a}()}},function(e){e.O(0,[33714,86455,56817,92888,49774,40179],function(){return e(e.s=55630)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.