var uts=function(){"use strict";var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};var e=function(){return e=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function r(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i5},ut=function(){function t(t){var e=this;this.options=t,this.eventListener=function(t){e.onLogSend(t)},W.on("send",this.eventListener),this.flush()}return t.prototype.onLogSend=function(t){var e=t.eventType;"pageview"!==e&&"background"!==e||this.flush()},t.prototype.flush=function(){var t,i,r,a,l,c,d,p=0,f=function(){var t=[];return nt().forEach((function(e){var n=localStorage.getItem(e);n&&t.push(JSON.parse(n))})),t}();try{for(var v=o(f),h=v.next();!h.done;h=v.next()){var y=h.value,m=y.key,g=n(y,["key"]),x=st(m,null===(l=this.options)||void 0===l?void 0:l.keySuffix);rt(m,null===(c=this.options)||void 0===c?void 0:c.keySuffix),at(m,null===(d=this.options)||void 0===d?void 0:d.keySuffix);var b=Object.values(null!=x?x:{}),S=u(b,s()?10:100);try{for(var w=(r=void 0,o(S)),O=w.next();!O.done;O=w.next()){var I=O.value;if(5==p++)return this.clear(),void T.error("The number of concurrent requests is limited to ".concat(5));var k=e(e({},g),{eventItemList:I});W.emit("send",k,this.options)}}catch(t){r={error:t}}finally{try{O&&!O.done&&(a=w.return)&&a.call(w)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{h&&!h.done&&(i=v.return)&&i.call(v)}finally{if(t)throw t.error}}this.clear()},t.prototype.new=function(t){var e,n;if(!lt({key:t.key,keySuffix:null===(e=this.options)||void 0===e?void 0:e.keySuffix})){var o=t.key;it(t,o,null===(n=this.options)||void 0===n?void 0:n.keySuffix)}},t.prototype.add=function(t){var n,o,i,r,s,a,l,u;if(!lt({key:null===(o=null==t?void 0:t.baseImpression)||void 0===o?void 0:o.key,keySuffix:null===(i=this.options)||void 0===i?void 0:i.keySuffix,itemId:null==t?void 0:t.id})){var c=null!=t?t:{},d=c.baseImpression,p=c.id,f=c.params,v=c.area,h=c.durationMilliSeconds,m=c.percentage,g=c.completion,x=c.measured,b=(null!=d?d:{}).key;if(!d||null==b||!p)throw new E("Either baseImpression or id is missing");[y.ID,y.COUNT,y.AREA,y.DURATION,y.PERCENTAGE,y.COMPLETION,y.MEASURED].forEach((function(t){if(Object.keys(f).some((function(e){return t===e})))throw new E("".concat(t," is not avaiable as a key for params"))})),function(t,e){return!!localStorage.getItem(tt(t,e))}(b,null===(r=this.options)||void 0===r?void 0:r.keySuffix)||it(d,b,null===(s=this.options)||void 0===s?void 0:s.keySuffix);var S=st(b,null===(a=this.options)||void 0===a?void 0:a.keySuffix),w=p+(null!=v?v:"")+(null!=h?h:"")+(null!=m?m:"")+(null!=g?g:"")+(null!=x?x:""),O=S[w];O?(O[y.COUNT]++,S[w]=O):(S[w]=e(e({},f),((n={})[y.ID]=p,n[y.COUNT]=1,n)),v&&(S[w][y.AREA]=v),h&&(S[w][y.DURATION]=h),m&&(S[w][y.PERCENTAGE]=m),x&&(S[w][y.MEASURED]=x<0?0:x),S[w][y.MEASURED]?S[w][y.COMPLETION]=!0:!0===g&&(S[w][y.COMPLETION]=g)),it(d,b,null===(l=this.options)||void 0===l?void 0:l.keySuffix),function(t,e,n){localStorage.setItem(et(e,n),JSON.stringify(t))}(S,b,null===(u=this.options)||void 0===u?void 0:u.keySuffix)}},t.prototype.clear=function(){nt().forEach((function(t){return localStorage.removeItem(t)})),ot().forEach((function(t){return localStorage.removeItem(t)}))},t}(),ct="4.7.1",dt=function(){function t(){this.optional={},this.dimensions={}}return t.prototype.init=function(t){Object.keys(null!=t?t:{}).forEach((function(e){V(e,t,L)})),this.required=t,this.optional={},this.eventType=void 0,this.event=void 0,this.extra=void 0,this.dimensions={},this.timestamp=void 0},t.prototype.setContext=function(t){var n=this;return Object.entries(t).forEach((function(o){var r=i(o,2),s=r[0],a=r[1];/^dimension([0-9]|1[0-9])$/.test(s)?n.dimensions[s]=a:V(s,t,R)||(n.optional[s]="extra"===s?e(e({},n.optional.extra),a):a)})),this},t.prototype.setEvent=function(t){var e=t.type,n=t.event,o=t.timestamp;return this.eventType=e,this.event=n,this.timestamp=o,this},t.prototype.setExtra=function(t){return this.extra=t,this},t.prototype.build=function(t){var n,o,i,r,s,a,l,u;if(D(this.required),!this.required)throw new E("");var c=this.buildExtra(),d=c.extra,p=c.dimensions,f=null===(n=this.event)||void 0===n?void 0:n.category,v=this.buildEventParams(p),h=null!==(o=this.optional.screenName)&&void 0!==o?o:location.pathname,y="pageview"!==this.eventType?null==t?void 0:t.customScreenName:void 0;h&&y&&(d.uts={context_screen_name:h});var m=null!==(r=null!==(i=null==t?void 0:t.utsId)&&void 0!==i?i:this.optional.utsId)&&void 0!==r?r:this.required.utsId,g=null!=y?y:h,x=null!==(s=null==t?void 0:t.logType)&&void 0!==s?s:b.NORMAL;return(null==t?void 0:t.isWtsEvent)&&(m="".concat(m).concat("_wtslog")),e(e(e(e(e({},e(e(e({title:document.title,url:location.href,referrer:document.referrer,networkType:null===(a=navigator.connection)||void 0===a?void 0:a.type},this.required),this.optional),{utsId:m,screenName:g})),{logVersion:"3",logType:x,sdkVersion:ct,appType:"web",eventType:null!==(l=this.eventType)&&void 0!==l?l:"temporary",eventCategory:f}),v),d&&Object.keys(d).length?{extra:d}:void 0),{clientTimestamp:null!==(u=this.timestamp)&&void 0!==u?u:Date.now()})},t.prototype.buildExtra=function(){var t,o,i,r,s=null!==(o=null===(t=this.optional)||void 0===t?void 0:t.extra)&&void 0!==o?o:{},a=s.wts,l=s.liff,u=e(e({},a),null===(i=this.extra)||void 0===i?void 0:i.wts),c=u.dimensions,d=n(u,["dimensions"]),p=e(e({},l),null===(r=this.extra)||void 0===r?void 0:r.liff);Object.keys(d).forEach((function(t){V(t,d,U)})),Object.keys(p).forEach((function(t){V(t,p,$)}));var f={};return Object.keys(d).length&&(f.wts=JSON.stringify(d)),Object.keys(p).length&&(f.liff=JSON.stringify(p)),{extra:f,dimensions:e(e({},this.dimensions),c)}},t.prototype.buildEventParams=function(t){var n,o,i=null!==(n=this.event)&&void 0!==n?n:{},r=i.screenName,s=i.title;i.category;var a=i.params,l=i.CLS,u=i.FID,c=i.LCP,d=e(e(e({},a),t),{CLS:l,FID:u,LCP:c});(Object.keys(d).forEach((function(t){return void 0===d[t]?delete d[t]:{}})),"pageview"===this.eventType)&&(this.optional.screenName=null!==(o=null!=r?r:this.optional.screenName)&&void 0!==o?o:location.pathname,(null!=s?s:this.optional.title)&&(this.optional.title=null!=s?s:this.optional.title),this.optional.screenId=B());return Object.keys(d).length?{eventParams:d}:{}},t}(),pt=function(t){return t?a(t):void 0},ft=function(){function t(t,n){var s,a,u,c,d,p=this;this.logType=t,this.options=n,this.isUserSet=!1,this.isParamsSet=!1,this.isUserChanged=function(){return p.nextMc!==p.mc||p.nextTc!==p.tc||p.nextUc!==p.uc},this.isParamsChanged=function(){var t;return!l(null!==(t=p.sp)&&void 0!==t?t:{},e(e({},p.nextSp),p.utmParams))},this._session=function(t){var e,n=Y(t),o=z.get(n);if(!o){var i=Y(t,":");(o=z.get(i))&&(Q(JSON.parse(o),t),z.remove("".concat(i)))}if(!o&&(null==t?void 0:t.keySuffix)){var r=Y({logType:null==t?void 0:t.logType});(o=z.get(r,G))&&(Q(JSON.parse(o),t),z.remove(r))}if(o)try{e=JSON.parse(o)}catch(t){T.error(t)}return e}({logType:this.logType,keySuffix:null==n?void 0:n.keySuffix}),this.sp=null===(s=this._session)||void 0===s?void 0:s.sp,this.mc=null===(a=this._session)||void 0===a?void 0:a.mc,this.tc=null===(u=this._session)||void 0===u?void 0:u.tc,this.uc=null===(c=this._session)||void 0===c?void 0:c.uc;var f={};if(r([],i(new URLSearchParams(location.search).entries()),!1).forEach((function(t){O.includes(t[0])&&(f[t[0]]=encodeURI(t[1]))})),this.utmParams=Object.keys(f).length?f:void 0,this.utmParams&&Object.keys(this.utmParams).length){var v=function(t,e){var n,i,r={};try{for(var s=o(e),a=s.next();!a.done;a=s.next()){var l=a.value;Object.prototype.hasOwnProperty.call(t,l)&&(r[l]=t[l])}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return r}(null!==(d=this.sp)&&void 0!==d?d:{},O);this.isParamsSet=!l(v,this.utmParams)}}return t.prototype.renew=function(){var t;this.sp=void 0,this._session={},Q(this._session,{logType:this.logType,domain:this.domain,keySuffix:null===(t=this.options)||void 0===t?void 0:t.keySuffix})},t.prototype.refresh=function(){var t;this._session=e(e({},this._session),{expiredAt:Date.now()+this.duration}),Q(this._session,{logType:this.logType,domain:this.domain,keySuffix:null===(t=this.options)||void 0===t?void 0:t.keySuffix})},Object.defineProperty(t.prototype,"session",{get:function(){var t,n,o,i,r,s,a=+(null!==(n=null===(t=this._session)||void 0===t?void 0:t.expiredAt)&&void 0!==n?n:0)100)throw new E("percentage must be between 0 and 100, inclusive")}(r),i&&this.sessionManagers[s].addParams(i),r&&(null===(o=this.impressionManager)||void 0===o||o.add(r),this.sessionManagers[r.baseImpression.logType].refresh())},t.prototype.addSessionParams=function(t,e){this.add({sessionParams:t},e)},t.prototype.addImpression=function(t,e){this.add({impression:t},e)},t.prototype.flushImpression=function(t){var e;try{null===(e=this.impressionManager)||void 0===e||e.flush(),null==t||t()}catch(e){T.error(e),null==t||t(e)}},t.prototype.new=function(){for(var t,n=[],o=0;o