@meltingspot/core 1.12.0 → 1.13.0

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/index.umd.js CHANGED
@@ -30,4 +30,4 @@ __p += '`),r&&(f+=`' +
30
30
  function print() { __p += __j.call(arguments, '') }
31
31
  `:`;
32
32
  `)+f+`return __p
33
- }`;var g=af(function(){return st(o,m+`return `+f).apply(n,s)});if(g.source=f,ou(g))throw g;return g}function Jd(e){return Q(e).toLowerCase()}function Yd(e){return Q(e).toUpperCase()}function Xd(e,t,r){if(e=Q(e),e&&(r||t===n))return zn(e);if(!e||!(t=Ta(t)))return e;var i=sr(e),a=sr(t);return La(i,Un(i,a),Wn(i,a)+1).join(``)}function Zd(e,t,r){if(e=Q(e),e&&(r||t===n))return e.slice(0,cr(e)+1);if(!e||!(t=Ta(t)))return e;var i=sr(e);return La(i,0,Wn(i,sr(t))+1).join(``)}function Qd(e,t,r){if(e=Q(e),e&&(r||t===n))return e.replace(Ue,``);if(!e||!(t=Ta(t)))return e;var i=sr(e);return La(i,Un(i,sr(t))).join(``)}function $d(e,t){var r=30,i=`...`;if(Y(t)){var a=`separator`in t?t.separator:a;r=`length`in t?Z(t.length):r,i=`omission`in t?Ta(t.omission):i}e=Q(e);var o=e.length;if(Xn(e)){var s=sr(e);o=s.length}if(r>=o)return e;var c=r-or(i);if(c<1)return i;var l=s?La(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),bu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=lt(a.source,Q(Ze.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(Ta(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function ef(e){return e=Q(e),e&&Ne.test(e)?e.replace(je,lr):e}var tf=ao(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),nf=io(`toUpperCase`);function rf(e,t,r){return e=Q(e),t=r?n:t,t===n?Zn(e)?fr(e):Tn(e):e.match(t)||[]}var af=U(function(e,t){try{return dn(e,n,t)}catch(e){return ou(e)?e:new ot(e)}}),of=Ao(function(e,t){return pn(t,function(t){t=bs(t),ci(e,t,xl(e[t],e))}),e});function sf(e){var t=e==null?0:e.length,n=W();return e=t?z(e,function(e){if(typeof e[1]!=`function`)throw new dt(r);return[n(e[0]),e[1]]}):[],U(function(n){for(var r=-1;++r<t;){var i=e[r];if(dn(i[0],this,n))return dn(i[1],this,n)}})}function cf(e){return fi(di(e,1))}function lf(e){return function(){return e}}function uf(e,t){return e==null||e!==e?t:e}var df=lo(),ff=lo(!0);function pf(e){return e}function mf(e){return Ji(typeof e==`function`?e:di(e,1))}function hf(e){return $i(di(e,1))}function gf(e,t){return ea(e,di(t,1))}var _f=U(function(e,t){return function(n){return Ii(n,e,t)}}),vf=U(function(e,t){return function(n){return Ii(e,n,t)}});function yf(e,t,n){var r=$(t),i=Ei(t,r);n==null&&!(Y(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=Ei(t,$(t)));var a=!(Y(n)&&`chain`in n)||!!n.chain,o=cu(e);return pn(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=Ya(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,yn([this.value()],arguments))})}),e}function bf(){return L._===this&&(L._=xt),this}function xf(){}function Sf(e){return e=Z(e),U(function(t){return ra(t,e)})}var Cf=mo(z),wf=mo(hn),Tf=mo(Sn);function Ef(e){return Zo(e)?Mn(bs(e)):sa(e)}function Df(e){return function(t){return e==null?n:Di(e,t)}}var Of=_o(),kf=_o(!0);function Af(){return[]}function jf(){return!1}function Mf(){return{}}function Nf(){return``}function Pf(){return!0}function Ff(e,t){if(e=Z(e),e<1||e>g)return[];var n=y,r=I(e,y);t=W(t),e-=y;for(var i=Ln(r,t);++n<e;)t(n);return i}function If(e){return q(e)?z(e,bs):wu(e)?[e]:Ya(ys(Q(e)))}function Lf(e){var t=++_t;return Q(e)+t}var Rf=po(function(e,t){return e+t},0),zf=bo(`ceil`),Bf=po(function(e,t){return e/t},1),Vf=bo(`floor`);function Hf(e){return e&&e.length?yi(e,pf,Ai):n}function Uf(e,t){return e&&e.length?yi(e,W(t,2),Ai):n}function Wf(e){return jn(e,pf)}function Gf(e,t){return jn(e,W(t,2))}function Kf(e){return e&&e.length?yi(e,pf,Zi):n}function qf(e,t){return e&&e.length?yi(e,W(t,2),Zi):n}var Jf=po(function(e,t){return e*t},1),Yf=bo(`round`),Xf=po(function(e,t){return e-t},0);function Zf(e){return e&&e.length?In(e,pf):0}function Qf(e,t){return e&&e.length?In(e,W(t,2)):0}return B.after=vl,B.ary=yl,B.assign=Lu,B.assignIn=Ru,B.assignInWith=zu,B.assignWith=Bu,B.at=Vu,B.before=bl,B.bind=xl,B.bindAll=of,B.bindKey=Sl,B.castArray=Vl,B.chain=Pc,B.chunk=ws,B.compact=Ts,B.concat=Es,B.cond=sf,B.conforms=cf,B.constant=lf,B.countBy=Gc,B.create=Hu,B.curry=Cl,B.curryRight=wl,B.debounce=Tl,B.defaults=Uu,B.defaultsDeep=Wu,B.defer=El,B.delay=Dl,B.difference=Ds,B.differenceBy=Os,B.differenceWith=ks,B.drop=As,B.dropRight=js,B.dropRightWhile=Ms,B.dropWhile=Ns,B.fill=Ps,B.filter=qc,B.flatMap=Xc,B.flatMapDeep=Zc,B.flatMapDepth=Qc,B.flatten=Ls,B.flattenDeep=Rs,B.flattenDepth=zs,B.flip=Ol,B.flow=df,B.flowRight=ff,B.fromPairs=Bs,B.functions=Zu,B.functionsIn=Qu,B.groupBy=tl,B.initial=Us,B.intersection=Ws,B.intersectionBy=Gs,B.intersectionWith=Ks,B.invert=nd,B.invertBy=rd,B.invokeMap=rl,B.iteratee=mf,B.keyBy=il,B.keys=$,B.keysIn=ad,B.map=al,B.mapKeys=od,B.mapValues=sd,B.matches=hf,B.matchesProperty=gf,B.memoize=kl,B.merge=cd,B.mergeWith=ld,B.method=_f,B.methodOf=vf,B.mixin=yf,B.negate=Al,B.nthArg=Sf,B.omit=ud,B.omitBy=dd,B.once=jl,B.orderBy=ol,B.over=Cf,B.overArgs=Ml,B.overEvery=wf,B.overSome=Tf,B.partial=Nl,B.partialRight=Pl,B.partition=sl,B.pick=fd,B.pickBy=pd,B.property=Ef,B.propertyOf=Df,B.pull=Zs,B.pullAll=Qs,B.pullAllBy=$s,B.pullAllWith=ec,B.pullAt=tc,B.range=Of,B.rangeRight=kf,B.rearg=Fl,B.reject=ul,B.remove=nc,B.rest=Il,B.reverse=rc,B.sampleSize=fl,B.set=hd,B.setWith=gd,B.shuffle=pl,B.slice=ic,B.sortBy=gl,B.sortedUniq=dc,B.sortedUniqBy=fc,B.split=Wd,B.spread=Ll,B.tail=pc,B.take=mc,B.takeRight=hc,B.takeRightWhile=gc,B.takeWhile=_c,B.tap=Fc,B.throttle=Rl,B.thru=Ic,B.toArray=ju,B.toPairs=_d,B.toPairsIn=vd,B.toPath=If,B.toPlainObject=Fu,B.transform=yd,B.unary=zl,B.union=vc,B.unionBy=yc,B.unionWith=bc,B.uniq=xc,B.uniqBy=Sc,B.uniqWith=Cc,B.unset=bd,B.unzip=wc,B.unzipWith=Tc,B.update=xd,B.updateWith=Sd,B.values=Cd,B.valuesIn=wd,B.without=Ec,B.words=rf,B.wrap=Bl,B.xor=Dc,B.xorBy=Oc,B.xorWith=kc,B.zip=Ac,B.zipObject=jc,B.zipObjectDeep=Mc,B.zipWith=Nc,B.entries=_d,B.entriesIn=vd,B.extend=Ru,B.extendWith=zu,yf(B,B),B.add=Rf,B.attempt=af,B.camelCase=Od,B.capitalize=kd,B.ceil=zf,B.clamp=Td,B.clone=Hl,B.cloneDeep=Wl,B.cloneDeepWith=Gl,B.cloneWith=Ul,B.conformsTo=Kl,B.deburr=Ad,B.defaultTo=uf,B.divide=Bf,B.endsWith=jd,B.eq=ql,B.escape=Md,B.escapeRegExp=Nd,B.every=Kc,B.find=Jc,B.findIndex=Fs,B.findKey=Gu,B.findLast=Yc,B.findLastIndex=Is,B.findLastKey=Ku,B.floor=Vf,B.forEach=$c,B.forEachRight=el,B.forIn=qu,B.forInRight=Ju,B.forOwn=Yu,B.forOwnRight=Xu,B.get=$u,B.gt=Jl,B.gte=Yl,B.has=ed,B.hasIn=td,B.head=Vs,B.identity=pf,B.includes=nl,B.indexOf=Hs,B.inRange=Ed,B.invoke=id,B.isArguments=Xl,B.isArray=q,B.isArrayBuffer=Zl,B.isArrayLike=Ql,B.isArrayLikeObject=J,B.isBoolean=$l,B.isBuffer=eu,B.isDate=tu,B.isElement=nu,B.isEmpty=ru,B.isEqual=iu,B.isEqualWith=au,B.isError=ou,B.isFinite=su,B.isFunction=cu,B.isInteger=lu,B.isLength=uu,B.isMap=du,B.isMatch=fu,B.isMatchWith=pu,B.isNaN=mu,B.isNative=hu,B.isNil=_u,B.isNull=gu,B.isNumber=vu,B.isObject=Y,B.isObjectLike=X,B.isPlainObject=yu,B.isRegExp=bu,B.isSafeInteger=xu,B.isSet=Su,B.isString=Cu,B.isSymbol=wu,B.isTypedArray=Tu,B.isUndefined=Eu,B.isWeakMap=Du,B.isWeakSet=Ou,B.join=qs,B.kebabCase=Pd,B.last=Js,B.lastIndexOf=Ys,B.lowerCase=Fd,B.lowerFirst=Id,B.lt=ku,B.lte=Au,B.max=Hf,B.maxBy=Uf,B.mean=Wf,B.meanBy=Gf,B.min=Kf,B.minBy=qf,B.stubArray=Af,B.stubFalse=jf,B.stubObject=Mf,B.stubString=Nf,B.stubTrue=Pf,B.multiply=Jf,B.nth=Xs,B.noConflict=bf,B.noop=xf,B.now=_l,B.pad=Ld,B.padEnd=Rd,B.padStart=zd,B.parseInt=Bd,B.random=Dd,B.reduce=cl,B.reduceRight=ll,B.repeat=Vd,B.replace=Hd,B.result=md,B.round=Yf,B.runInContext=e,B.sample=dl,B.size=ml,B.snakeCase=Ud,B.some=hl,B.sortedIndex=ac,B.sortedIndexBy=oc,B.sortedIndexOf=sc,B.sortedLastIndex=cc,B.sortedLastIndexBy=lc,B.sortedLastIndexOf=uc,B.startCase=Gd,B.startsWith=Kd,B.subtract=Xf,B.sum=Zf,B.sumBy=Qf,B.template=qd,B.times=Ff,B.toFinite=Mu,B.toInteger=Z,B.toLength=Nu,B.toLower=Jd,B.toNumber=Pu,B.toSafeInteger=Iu,B.toString=Q,B.toUpper=Yd,B.trim=Xd,B.trimEnd=Zd,B.trimStart=Qd,B.truncate=$d,B.unescape=ef,B.uniqueId=Lf,B.upperCase=tf,B.upperFirst=nf,B.each=$c,B.eachRight=el,B.first=Vs,yf(B,function(){var e={};return wi(B,function(t,n){A.call(B.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),B.VERSION=`4.17.21`,pn([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){B[e].placeholder=B}),pn([`drop`,`take`],function(e,t){V.prototype[e]=function(r){r=r===n?1:M(Z(r),0);var i=this.__filtered__&&!t?new V(this):this.clone();return i.__filtered__?i.__takeCount__=I(r,i.__takeCount__):i.__views__.push({size:I(r,y),type:e+(i.__dir__<0?`Right`:``)}),i},V.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),pn([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==1||n==3;V.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:W(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),pn([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);V.prototype[e]=function(){return this[n](1).value()[0]}}),pn([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);V.prototype[e]=function(){return this.__filtered__?new V(this):this[n](1)}}),V.prototype.compact=function(){return this.filter(pf)},V.prototype.find=function(e){return this.filter(e).head()},V.prototype.findLast=function(e){return this.reverse().find(e)},V.prototype.invokeMap=U(function(e,t){return typeof e==`function`?new V(this):this.map(function(n){return Ii(n,e,t)})}),V.prototype.reject=function(e){return this.filter(Al(W(e)))},V.prototype.slice=function(e,t){e=Z(e);var r=this;return r.__filtered__&&(e>0||t<0)?new V(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=Z(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},V.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},V.prototype.toArray=function(){return this.take(y)},wi(V.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=B[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(B.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof V,l=s[0],u=c||q(t),d=function(e){var t=a.apply(B,yn([e],s));return i&&f?t[0]:t};u&&r&&typeof l==`function`&&l.length!=1&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,m=o&&!f,h=c&&!p;if(!o&&u){t=h?t:new V(this);var g=e.apply(t,s);return g.__actions__.push({func:Ic,args:[d],thisArg:n}),new xr(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),pn([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=ft[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);B.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(q(i)?i:[],e)}return this[n](function(n){return t.apply(q(n)?n:[],e)})}}),wi(V.prototype,function(e,t){var n=B[t];if(n){var r=n.name+``;A.call(Nn,r)||(Nn[r]=[]),Nn[r].push({name:t,func:n})}}),Nn[uo(n,s).name]=[{name:`wrapper`,func:n}],V.prototype.clone=Sr,V.prototype.reverse=Cr,V.prototype.value=wr,B.prototype.at=Lc,B.prototype.chain=Rc,B.prototype.commit=zc,B.prototype.next=Bc,B.prototype.plant=Hc,B.prototype.reverse=Uc,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=Wc,B.prototype.first=B.prototype.head,Mt&&(B.prototype[Mt]=Vc),B})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(L._=pr,define(function(){return pr})):tn?((tn.exports=pr)._=pr,en._=pr):L._=pr}).call(e)}))()),Re=(e,t)=>{switch(t){case`fr`:case`it`:return Le.default.capitalize(e.format(`dddd D MMMM`));case`es`:return Le.default.capitalize(e.format(`dddd D [de] MMMM`));case`de`:return e.format(`dddd, D. MMMM`);default:return e.format(`dddd, MMMM Do`)}},ze=e=>e.format(`LT`),Be=(e,t)=>{let n=Re(e,t),r=ze(e);switch(t){case`fr`:return`${n} à ${r}`;case`it`:return`${n} alle ${r}`;case`es`:return`${n} a las ${r}`;case`de`:return`${n} um ${r}`;default:return`${n} at ${r}`}},Ve=e=>e.format(`ll`),He=(e,t)=>{switch(t){case`fr`:case`de`:case`it`:return e.format(`HH:mm`);case`es`:return e.format(`H:mm`);default:return e.format(`h:mm`)}},Ue=e=>e.format(`L`),O=e=>e.format(`L LT`),We=function(e){return e.SimpleDate=`SimpleDate`,e.SimpleDateTime=`SimpleDateTime`,e.ExtraShortDate=`ExtraShortDate`,e.InlineExtraShortDate=`InlineExtraShortDate`,e.ShortDate=`ShortDate`,e.InlineShortDate=`InlineShortDate`,e.Date=`Date`,e.LongDate=`LongDate`,e.LongDateTime=`LongDateTime`,e.ShortTime=`ShortTime`,e.Time=`Time`,e.DateTime=`DateTime`,e}({}),Ge=(e,t,n,r)=>{let i=(0,Ee.default)(e);r&&(i=i.tz(r)),n&&(i=i.locale(n));let a=i.locale();switch(t){case`SimpleDate`:return Ue(i);case`SimpleDateTime`:return O(i);case`ExtraShortDate`:return Pe(i,a);case`InlineExtraShortDate`:return Fe(i,a);case`ShortDate`:return Ve(i);case`InlineShortDate`:return Ie(i,a);case`Date`:return Me(i);case`LongDate`:return Re(i,a);case`LongDateTime`:return Be(i,a);case`ShortTime`:return He(i,a);case`Time`:return ze(i);case`DateTime`:return Ne(i)}},Ke=function(e){return e.Contains=`Contains`,e.DoesntContain=`DoesntContain`,e.DoesntEndWith=`DoesntEndWith`,e.DoesntEqual=`DoesntEqual`,e.DoesntStartWith=`DoesntStartWith`,e.EndsWith=`EndsWith`,e.Equals=`Equals`,e.MatchesRegex=`MatchesRegex`,e.StartsWith=`StartsWith`,e}({}),qe=`http://_meltingspot.local`,Je=200,Ye=/(\([^()]*[+*][^()]*\))[+*]/,Xe=e=>e.length<=Je&&!Ye.test(e),Ze=e=>{try{let t=new URL(e,qe);return`${t.pathname}${t.search}${t.hash}`}catch{return e}},Qe=e=>e.startsWith(`/`)?e:`/${e}`,$e=(e,t)=>{switch(t.operator){case Ke.MatchesRegex:if(!Xe(t.value))return!1;try{return new RegExp(t.value).test(e)}catch{return!1}case Ke.StartsWith:return e.startsWith(Qe(t.value));case Ke.DoesntStartWith:return!e.startsWith(Qe(t.value));case Ke.EndsWith:return e.endsWith(t.value);case Ke.DoesntEndWith:return!e.endsWith(t.value);case Ke.Contains:return e.includes(t.value);case Ke.DoesntContain:return!e.includes(t.value);case Ke.Equals:return e===Qe(t.value);case Ke.DoesntEqual:return e!==Qe(t.value)}},et=(e,t)=>{let n=t.rules.map(t=>$e(e,t));return t.ruleOperator===`AND`?n.every(Boolean):n.some(Boolean)},tt=(e,t)=>{let n=Ze(e),r=t.blocks.map(e=>et(n,e));return t.blockOperator===`AND`?r.every(Boolean):r.some(Boolean)},nt=e=>e.replace(/^https?:\/\//,``),rt=(e,t)=>{let n=nt(t);try{let t=new URL(e);return t.hostname===n||t.hostname.endsWith(`.${n}`)}catch{return!1}},it=`data-meltingspot-playbook-editor-active`,at=`meltingspot:playbook-editor:active-changed`;Object.values(function(e){return e.EditMode=`edit-mode`,e.Preview=`preview`,e}({}));var ot=()=>typeof document<`u`&&typeof document.dispatchEvent==`function`,st=()=>ot()?document.documentElement.getAttribute(it)===`true`:!1,ct=!1,k=()=>ct,lt=class{constructor(){this.listener=null,this.lastOptions=null,this.chain=Promise.resolve()}enqueue(e){let t=this.chain.then(e);return this.chain=t.catch(()=>void 0),t}get isBound(){return this.listener!==null}bind(e){if(this.listener!==null||typeof document>`u`)return;let t=()=>{if(st()){Promise.resolve().then(()=>e.onEditorActive()).catch(e=>{console.warn(`[playbook-editor] onEditorActive callback failed`,e)});return}let t=this.lastOptions;t!==null&&Promise.resolve().then(()=>e.onEditorInactive(t)).catch(e=>{console.warn(`[playbook-editor] onEditorInactive callback failed`,e)})};document.addEventListener(at,t),this.listener=t}cacheOptions(e){this.lastOptions=e}clearOptions(){this.lastOptions=null}unbind(){this.listener!==null&&typeof document<`u`&&document.removeEventListener(at,this.listener),this.listener=null,this.lastOptions=null}},ut=`1.12.0`,dt=class{constructor(e){this.debug=!1,this.debug=e?.debug??!1,this.appName=e?.appName,this.appVersion=e?.appVersion}log(e,...t){this.debug&&this.print(e,`info`,t)}warn(e,...t){this.print(e,`warn`,t)}error(e,...t){this.print(e,`error`,t)}print(e,t,n){let r=[`[${[`MeltingSpot`,this.appName,this.appVersion].filter(Boolean).join(` - `)}] ${e}`];n.length&&r.push(...n),console[t](...r)}},ft=new dt({appName:`Core SDK`,appVersion:ut}),pt=e=>{ft.debug=e},mt=e=>e.toLowerCase().replace(/[^a-z0-9-]/g,``),ht=[`/user`],gt=({deeplink:e,spotId:t})=>{try{let n=new URL(e,`https://unused.com`),r=n.pathname;return n.search&&(r+=n.search),n.hash&&(r+=n.hash),ht.some(e=>r.startsWith(e))||(r=`/spot/${t}/${ie(r)}`),r}catch(e){return ft.warn(`Failed to parse deeplink URL`,e),null}},A=[/(^|\.)meltingspot\.io$/i],_t=e=>{let t;try{let n=oe(e);t=new URL(n)}catch{throw Error(`Invalid baseURL: ${e}`)}let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`,r=t.protocol===`https:`,i=A.some(e=>e.test(t.hostname));if(!n&&(!r||!i))throw Error(`Untrusted baseURL origin: ${t.origin}`);return t.origin},vt={msApiBaseUrl:`https://openapi.meltingspot.io/`,msCommunityWebBaseUrl:`https://go.meltingspot.io/`,ssoToken:void 0,spotId:``,autoJoin:!1,rootDocument:globalThis.document},yt=class e{constructor(){this.configuration=vt}static getInstance(){return e.instance||=new e,e.instance}setConfiguration(e){this.configuration={...this.configuration,...e}}static getConfiguration(t={}){return{...e.getInstance().configuration,...t}}},bt=RegExp(`(%[a-f0-9]{2})|([^%]+?)`,`gi`),xt=RegExp(`(%[a-f0-9]{2})+`,`gi`);function St(e,t){try{return[decodeURIComponent(e.join(``))]}catch{}if(e.length===1)return e;t||=1;let n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],St(n),St(r))}function Ct(e){try{return decodeURIComponent(e)}catch{let t=e.match(bt)||[];for(let n=1;n<t.length;n++)e=St(t,n).join(``),t=e.match(bt)||[];return e}}function wt(e){let t={"%FE%FF":`��`,"%FF%FE":`��`},n=xt.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{let e=Ct(n[0]);e!==n[0]&&(t[n[0]]=e)}n=xt.exec(e)}t[`%C2`]=`�`;let r=Object.keys(t);for(let n of r)e=e.replace(new RegExp(n,`g`),t[n]);return e}function Tt(e){if(typeof e!=`string`)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return wt(e)}}function Et(e,t){let n={};if(Array.isArray(t))for(let r of t){let t=Object.getOwnPropertyDescriptor(e,r);t?.enumerable&&Object.defineProperty(n,r,t)}else for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){let a=e[r];t(r,a,e)&&Object.defineProperty(n,r,i)}}return n}function Dt(e,t){if(typeof e!=`string`||typeof t!=`string`)throw TypeError("Expected the arguments to be of type `string`");if(e===``||t===``)return[];let n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}var Ot=c({exclude:()=>M,extract:()=>Bt,parse:()=>Vt,parseUrl:()=>Ut,pick:()=>Gt,stringify:()=>Ht,stringifyUrl:()=>Wt}),kt=e=>e==null,At=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),jt=Symbol(`encodeFragmentIdentifier`);function Mt(e){switch(e.arrayFormat){case`index`:return t=>(n,r)=>{let i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?[...n,[j(t,e),`[`,i,`]`].join(``)]:[...n,[j(t,e),`[`,j(i,e),`]=`,j(r,e)].join(``)]};case`bracket`:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?[...n,[j(t,e),`[]`].join(``)]:[...n,[j(t,e),`[]=`,j(r,e)].join(``)];case`colon-list-separator`:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?[...n,[j(t,e),`:list=`].join(``)]:[...n,[j(t,e),`:list=`,j(r,e)].join(``)];case`comma`:case`separator`:case`bracket-separator`:{let t=e.arrayFormat===`bracket-separator`?`[]=`:`=`;return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===``?r:(i=i===null?``:i,r.length===0?[[j(n,e),t,j(i,e)].join(``)]:[[r,j(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?[...n,j(t,e)]:[...n,[j(t,e),`=`,j(r,e)].join(``)]}}function Nt(e){let t;switch(e.arrayFormat){case`index`:return(e,n,r)=>{if(t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,``),!t){r[e]=n;return}r[e]===void 0&&(r[e]={}),r[e][t[1]]=n};case`bracket`:return(e,n,r)=>{if(t=/(\[])$/.exec(e),e=e.replace(/\[]$/,``),!t){r[e]=n;return}if(r[e]===void 0){r[e]=[n];return}r[e]=[...r[e],n]};case`colon-list-separator`:return(e,n,r)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,``),!t){r[e]=n;return}if(r[e]===void 0){r[e]=[n];return}r[e]=[...r[e],n]};case`comma`:case`separator`:return(t,n,r)=>{let i=typeof n==`string`&&n.includes(e.arrayFormatSeparator),a=typeof n==`string`&&!i&&Ft(n,e).includes(e.arrayFormatSeparator);n=a?Ft(n,e):n,r[t]=i||a?n.split(e.arrayFormatSeparator).map(t=>Ft(t,e)):n===null?n:Ft(n,e)};case`bracket-separator`:return(t,n,r)=>{let i=/(\[])$/.test(t);if(t=t.replace(/\[]$/,``),!i){r[t]=n&&Ft(n,e);return}let a=n===null?[]:Ft(n,e).split(e.arrayFormatSeparator);if(r[t]===void 0){r[t]=a;return}r[t]=[...r[t],...a]};default:return(e,t,n)=>{if(n[e]===void 0){n[e]=t;return}n[e]=[...[n[e]].flat(),t]}}}function Pt(e){if(typeof e!=`string`||e.length!==1)throw TypeError(`arrayFormatSeparator must be single character string`)}function j(e,t){return t.encode?t.strict?At(e):encodeURIComponent(e):e}function Ft(e,t){return t.decode?Tt(e):e}function It(e){return Array.isArray(e)?e.sort():typeof e==`object`?It(Object.keys(e)).sort((e,t)=>Number(e)-Number(t)).map(t=>e[t]):e}function Lt(e){let t=e.indexOf(`#`);return t!==-1&&(e=e.slice(0,t)),e}function Rt(e){let t=``,n=e.indexOf(`#`);return n!==-1&&(t=e.slice(n)),t}function zt(e,t,n){return n===`string`&&typeof e==`string`?e:typeof n==`function`&&typeof e==`string`?n(e):n===`boolean`&&e===null?!0:n===`boolean`&&e!==null&&(e.toLowerCase()===`true`||e.toLowerCase()===`false`)?e.toLowerCase()===`true`:n===`boolean`&&e!==null&&(e.toLowerCase()===`1`||e.toLowerCase()===`0`)?e.toLowerCase()===`1`:n===`string[]`&&t.arrayFormat!==`none`&&typeof e==`string`?[e]:n===`number[]`&&t.arrayFormat!==`none`&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?[Number(e)]:n===`number`&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()===`true`||e.toLowerCase()===`false`)?e.toLowerCase()===`true`:t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?Number(e):e}function Bt(e){e=Lt(e);let t=e.indexOf(`?`);return t===-1?``:e.slice(t+1)}function Vt(e,t){t={decode:!0,sort:!0,arrayFormat:`none`,arrayFormatSeparator:`,`,parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},Pt(t.arrayFormatSeparator);let n=Nt(t),r=Object.create(null);if(typeof e!=`string`||(e=e.trim().replace(/^[?#&]/,``),!e))return r;for(let i of e.split(`&`)){if(i===``)continue;let e=t.decode?i.replaceAll(`+`,` `):i,[a,o]=Dt(e,`=`);a===void 0&&(a=e),o=o===void 0?null:[`comma`,`separator`,`bracket-separator`].includes(t.arrayFormat)?o:Ft(o,t),n(Ft(a,t),o,r)}for(let[e,n]of Object.entries(r))if(typeof n==`object`&&n&&t.types[e]!==`string`)for(let[r,i]of Object.entries(n)){let a=t.types[e]?t.types[e].replace(`[]`,``):void 0;n[r]=zt(i,t,a)}else r[e]=typeof n==`object`&&n&&t.types[e]===`string`?Object.values(n).join(t.arrayFormatSeparator):zt(n,t,t.types[e]);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let n=r[t];return e[t]=n&&typeof n==`object`&&!Array.isArray(n)?It(n):n,e},Object.create(null))}function Ht(e,t){if(!e)return``;t={encode:!0,strict:!0,arrayFormat:`none`,arrayFormatSeparator:`,`,...t},Pt(t.arrayFormatSeparator);let n=n=>t.skipNull&&kt(e[n])||t.skipEmptyString&&e[n]===``,r=Mt(t),i={};for(let[t,r]of Object.entries(e))n(t)||(i[t]=r);let a=Object.keys(i);return t.sort!==!1&&a.sort(t.sort),a.map(n=>{let i=e[n];return i===void 0?``:i===null?j(n,t):Array.isArray(i)?i.length===0&&t.arrayFormat===`bracket-separator`?j(n,t)+`[]`:i.reduce(r(n),[]).join(`&`):j(n,t)+`=`+j(i,t)}).filter(e=>e.length>0).join(`&`)}function Ut(e,t){t={decode:!0,...t};let[n,r]=Dt(e,`#`);return n===void 0&&(n=e),{url:n?.split(`?`)?.[0]??``,query:Vt(Bt(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Ft(r,t)}:{}}}function Wt(e,t){t={encode:!0,strict:!0,[jt]:!0,...t};let n=Lt(e.url).split(`?`)[0]||``,r=Ht({...Vt(Bt(e.url),{sort:!1,...t}),...e.query},t);r&&=`?${r}`;let i=Rt(e.url);if(typeof e.fragmentIdentifier==`string`){let r=new URL(n);r.hash=e.fragmentIdentifier,i=t[jt]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${r}${i}`}function Gt(e,t,n){n={parseFragmentIdentifier:!0,[jt]:!1,...n};let{url:r,query:i,fragmentIdentifier:a}=Ut(e,n);return Wt({url:r,query:Et(i,t),fragmentIdentifier:a},n)}function M(e,t,n){return Gt(e,Array.isArray(t)?e=>!t.includes(e):(e,n)=>!t(e,n),n)}var Kt=Ot,N=class e extends Error{constructor(t,n){super(`HTTP Error ${t}${n?`: ${n}`:``}`),this.code=t,this.name=`HttpError`,Object.setPrototypeOf(this,e.prototype)}},P=function(e){return e.DELETE=`DELETE`,e.GET=`GET`,e.PATCH=`PATCH`,e.POST=`POST`,e}({}),F=class{constructor(){this.headers={}}setHeaders(e){this.headers=e}async get(e){try{let t=e.query?`${e.url}?${this.serializeQuery(e.query)}`:e.url,n=await fetch(t,{headers:{...this.headers,...e.headers,"Content-Type":`application/json`},...e.signal?{signal:e.signal}:{}});return n.ok?T(await n.json()):E(new N(n.status,await n.text()))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(new N(D.INTERNAL_SERVER_ERROR,t))}}async post(e){try{let t=await fetch(e.url,{method:`POST`,headers:{...this.headers,...e.headers,"Content-Type":`application/json`},body:JSON.stringify(e.payload),...e.signal?{signal:e.signal}:{}});return t.ok?T(await t.json()):E(new N(t.status,await t.text()))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(new N(D.INTERNAL_SERVER_ERROR,t))}}async delete(e){try{let t=await fetch(e.url,{method:`DELETE`,headers:{...this.headers,...e.headers,Accept:`application/json`},...e.signal?{signal:e.signal}:{}});return t.ok?T(await t.json()):E(new N(t.status,await t.text()))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(new N(D.INTERNAL_SERVER_ERROR,t))}}async patch(e){try{let t=await fetch(e.url,{method:`PATCH`,headers:{...this.headers,...e.headers,"Content-Type":`application/json`},body:JSON.stringify(e.payload),...e.signal?{signal:e.signal}:{}});return t.ok?T(await t.json()):E(new N(t.status,await t.text()))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(new N(D.INTERNAL_SERVER_ERROR,t))}}serializeQuery(e){if(typeof e==`string`)return e;if(typeof e==`object`)for(let t in e)e[t]===void 0&&delete e[t];return e=Kt.stringify(e,{arrayFormat:`none`}),e}},I={accessToken:{email:`/v1/auth/accessToken/email`,sso:{jwt:`/v1/auth/accessToken/sso/jwt`}},refreshAccessToken:`/v1/auth/accessToken~refresh`,password:{reset:`/v1/auth/password~reset`}},qt=function(e){return e.TokensUpdated=`auth:tokens-updated`,e}({}),Jt=class e extends EventTarget{constructor(){super(),this.accessToken=null,this.refreshToken=null}static getInstance(){return e.instance||=new e,e.instance}async loginWithPassword(e,t){let n=await this.callApi({endpoint:I.accessToken.email,method:`POST`,body:{email:e,password:t},withSpotId:!0});if(n.isErr())return E(n.error);let{accessToken:r,refreshToken:i}=n.value;return this.setTokens(r.token,i.token),T({accessToken:r.token,refreshToken:i.token})}async loginWithSsoToken(e){let t=await this.callApi({endpoint:I.accessToken.sso.jwt,method:`POST`,body:{token:e},withSpotId:!0});if(t.isErr())return E(t.error);let{accessToken:n,refreshToken:r}=t.value;return this.setTokens(n.token,r.token),T({accessToken:n.token,refreshToken:r.token})}loginWithAuthTokens(e,t){return this.setTokens(e,t),{accessToken:e,refreshToken:t}}resetPassword(e){return this.callApi({endpoint:I.password.reset,method:`POST`,body:{email:e}})}async refresh(){let e=await this.callApi({endpoint:I.refreshAccessToken,method:`POST`,body:{refreshToken:this.refreshToken}});if(e.isErr())return E(e.error);let{accessToken:t,refreshToken:n}=e.value;return this.setTokens(t.token,n.token),T({accessToken:t.token,refreshToken:n.token})}async logout(){this.setTokens(null,null)}getAccessToken(){return this.accessToken}getRefreshToken(){return this.refreshToken}setTokens(e,t){if(this.accessToken!==e||this.refreshToken!==t){this.accessToken=e,this.refreshToken=t;let n=new CustomEvent(`auth:tokens-updated`,{detail:{accessToken:e,refreshToken:t}});this.dispatchEvent(n)}}async callApi(e){try{let{spotId:t,msApiBaseUrl:n}=yt.getConfiguration(),r=se(e.endpoint,n),i={"Content-Type":`application/json`,...e.headers};e.withSpotId&&t&&(i[Yt.SpotId]=t);let a=await fetch(r,{method:e.method,body:e.body?JSON.stringify(e.body):void 0,headers:i});return a.ok?a.status===D.NO_CONTENT?T(void 0):T(await a.json()):E(new N(a.status,a.statusText))}catch(e){return E(new N(D.INTERNAL_SERVER_ERROR,e instanceof Error?e.message:String(e)))}}},Yt=function(e){return e.Authorization=`Authorization`,e.SpotId=`x-spotid`,e}({}),Xt=class e{static getInstance(){return e.instance||=new e,e.instance}static buildAuthenticatedRequest(e){let{msApiBaseUrl:t,spotId:n}=yt.getConfiguration(),r=se(e,t),i=Jt.getInstance().getAccessToken();if(!i)return E(Error(`Not authenticated`));let a={"Content-Type":`application/json`,Authorization:`Bearer ${i}`};return n&&(a[`x-spotid`]=n),T({url:r,headers:a})}static async stream(t,n,r){let{streamTransport:i}=yt.getConfiguration();if(i)return i({endpoint:t,body:n,signal:r});let a=e.buildAuthenticatedRequest(t);if(a.isErr())return E(a.error);let{url:o,headers:s}=a.value;try{let e=await fetch(o,{method:`POST`,headers:s,...n===void 0?{}:{body:JSON.stringify(n)},...r?{signal:r}:{}});if(!e.ok){let t=await e.text();return E(Error(`HTTP ${e.status}: ${t}`))}return e.body?T(e.body):E(Error(`Response body is empty`))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(e instanceof Error?e:Error(t))}}get pendingCount(){return this.queue.length}constructor(){this.queue=[],this.isProcessing=!1,this.isPaused=!1,this.authService=Jt.getInstance(),this.httpService=new F}enqueue(e){return new Promise(t=>{this.queue.push(async()=>{try{t(await e())}catch(e){t(E(new N(D.INTERNAL_SERVER_ERROR,e instanceof Error?e.message:`Unknown error`)))}}),this.processQueue()})}async processQueue(){if(!this.isProcessing){this.isProcessing=!0;try{for(;!this.isPaused&&this.queue.length>0;){let e=this.queue.shift();if(!e)break;await e()}}finally{this.isProcessing=!1,!this.isPaused&&this.queue.length>0&&Promise.resolve().then(()=>this.processQueue())}}}pauseQueue(){this.isPaused=!0}resumeQueue(){let e=this.isPaused;this.isPaused=!1,e&&this.processQueue()}async call(e){return this.enqueue(async()=>{let t=async()=>{let{spotId:t,msApiBaseUrl:n}=yt.getConfiguration(),r={...e.options?.headers??{}};t&&(r[`x-spotid`]=t);let i=this.authService.getAccessToken(),{requiresAuth:a=!0}=e;if(!i&&a)return E(new N(D.UNAUTHORIZED));i&&(r.Authorization=`Bearer ${i}`);let o=se(e.endpoint,n);switch(e.method){case P.DELETE:return this.httpService.delete({...e.options??{},headers:r,url:o});case P.GET:return this.httpService.get({...e.options??{},headers:r,url:o});case P.PATCH:return this.httpService.patch({...e.options??{},headers:r,url:o});case P.POST:return this.httpService.post({...e.options??{},headers:r,url:o});default:return E(new N(D.METHOD_NOT_ALLOWED,`Method not allowed`))}},n=await t();if(n.isErr()&&n.error.code===D.UNAUTHORIZED){let e=await this.authService.refresh();if(e.isErr())return E(new N(D.UNAUTHORIZED,e.error.message));n=await t()}return n})}},Zt={playbooks:`/v1/playbooks`,pages:e=>`/v1/playbooks/${e}/pages`,hotspots:(e,t)=>`/v1/playbooks/${e}/pages/${t}/hotspots`,hotspot:(e,t,n)=>`/v1/playbooks/${e}/pages/${t}/hotspots/${n}`,accessibleIntents:(e,t)=>`/v1/playbooks/${e}/pages/${t}/accessibleIntents`,intents:(e,t,n)=>`/v1/playbooks/${e}/pages/${t}/hotspots/${n}/intents`,intent:(e,t,n,r)=>`/v1/playbooks/${e}/pages/${t}/hotspots/${n}/intents/${r}`},Qt=50,$t=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async listPlaybooks(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.playbooks,options:{query:{page:e?.page??1,limit:e?.limit??Qt,...e?.domain?{"domain[eq]":e.domain}:{},...e?.host===void 0?{}:{"domain[matchesHost]":e.host}}}});return t.isErr()?E(t.error):T(t.value)}async listPlaybookPages(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.pages(e.playbookId),options:{query:{page:e.page??1,limit:e.limit??Qt,...e.url?{"url[eq]":e.url}:{}}}});return t.isErr()?E(t.error):T(t.value)}async createPlaybookPage(e,t){let n=await this.meltingSpotApi.call({method:P.POST,endpoint:Zt.pages(e.playbookId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}async listAccessiblePlaybookIntents(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.accessibleIntents(e.playbookId,e.pageId),options:{query:{...e.domain?{domain:e.domain}:{}}}});return t.isErr()?E(t.error):T(t.value)}async listPlaybookHotspots(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.hotspots(e.playbookId,e.pageId),options:{query:{page:e.page??1,limit:e.limit??Qt,...e.intentStatus?{"intentStatus[eq]":e.intentStatus}:{},...e.widgetType?{"widgetType[eq]":e.widgetType}:{}}}});return t.isErr()?E(t.error):T(t.value)}async createPlaybookHotspot(e,t){let n=await this.meltingSpotApi.call({method:P.POST,endpoint:Zt.hotspots(e.playbookId,e.pageId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}async updatePlaybookHotspot(e,t){let n=await this.meltingSpotApi.call({method:P.PATCH,endpoint:Zt.hotspot(e.playbookId,e.pageId,e.hotspotId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}async listPlaybookIntents(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.intents(e.playbookId,e.pageId,e.hotspotId),options:{query:{page:e.page??1,limit:e.limit??Qt,...e.status?{"status[eq]":e.status}:{}}}});return t.isErr()?E(t.error):T(t.value)}async createPlaybookIntent(e,t){let n=await this.meltingSpotApi.call({method:P.POST,endpoint:Zt.intents(e.playbookId,e.pageId,e.hotspotId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}async updatePlaybookIntent(e,t){let n=await this.meltingSpotApi.call({method:P.PATCH,endpoint:Zt.intent(e.playbookId,e.pageId,e.hotspotId,e.intentId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}},L={me:`/v1/spots/me`},en=50,tn=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async listSpotsForMe(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:L.me,options:{query:{page:1,limit:en,...e?.spotMemberRole?{"spotMemberRole[eq]":e.spotMemberRole}:{}}}});return t.isErr()?E(t.error):T(t.value)}},nn={spotMember:{me:`/v1/spotMembers/me`,joinFromSso:`/v1/spotMembers~joinFromSso`,search:`/v1/spotMembers~search`}},rn=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async getSpotMemberForMe(){let e=await this.meltingSpotApi.call({method:P.GET,endpoint:nn.spotMember.me});return e.isErr()?E(e.error):T(e.value)}async searchSpotMembers(e){let t={page:e.page,limit:e.limit};e.search&&(t.search=e.search);let n=await this.meltingSpotApi.call({method:P.GET,endpoint:nn.spotMember.search,options:{query:t}});return n.isErr()?E(n.error):T(n.value)}async joinFromSso(e){let t=await this.meltingSpotApi.call({method:P.POST,endpoint:nn.spotMember.joinFromSso,options:{payload:{token:e}}});return t.isErr()?E(t.error):T(t.value)}},R={spotMemberSsoToken:`/v1/spotMembers/auth/sso/jwt`,previewAccessKey:`/v1/spotMembers/auth/preview/accessKey`},an=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async generateSsoToken(){let e=await this.meltingSpotApi.call({method:P.POST,endpoint:R.spotMemberSsoToken,options:{payload:{}}});return e.isErr()?E(e.error):T(e.value.token)}async generatePreviewAccessKey(e){let t=await this.meltingSpotApi.call({method:P.POST,endpoint:R.previewAccessKey,options:{payload:{targetSpotMemberId:e.targetSpotMemberId}}});return t.isErr()?E(t.error):T(t.value)}},on=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.spotMemberAuthApiService=an.getInstance()}async generateSsoToken(){return this.spotMemberAuthApiService.generateSsoToken()}},sn=class{constructor(e){this.active=!1,this.lastObservedUrl=null,this.options={onRouteChange:e.onRouteChange,debounceMs:e.debounceMs??0,enableDeduplication:e.enableDeduplication??!0,enableDomMutationDetection:e.enableDomMutationDetection??!1,enableHistoryChange:e.enableHistoryChange??!0,enablePopState:e.enablePopState??!0,enableHashChange:e.enableHashChange??!0,enableLoad:e.enableLoad??!0,rootDocument:e.rootDocument}}start(){this.active||(this.active=!0,this.lastObservedUrl=null,this.options.enablePopState&&(this.popStateListener=()=>this.handleNavigationEvent(`popstate`),window.addEventListener(`popstate`,this.popStateListener)),this.options.enableHashChange&&(this.hashChangeListener=()=>this.handleNavigationEvent(`hashchange`),window.addEventListener(`hashchange`,this.hashChangeListener)),this.options.enableLoad&&(this.loadListener=()=>this.handleNavigationEvent(`load`),window.addEventListener(`load`,this.loadListener)),this.options.enableDomMutationDetection&&(this.mutationObserver=new MutationObserver(()=>{this.handleNavigationEvent(`locationchange`)}),this.mutationObserver.observe(this.options.rootDocument??document,{childList:!0,subtree:!0})),this.options.enableHistoryChange&&this.patchHistoryListeners())}stop(){this.active&&(this.active=!1,this.debounceTimer!==void 0&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.popStateListener&&=(window.removeEventListener(`popstate`,this.popStateListener),void 0),this.hashChangeListener&&=(window.removeEventListener(`hashchange`,this.hashChangeListener),void 0),this.loadListener&&=(window.removeEventListener(`load`,this.loadListener),void 0),this.mutationObserver&&=(this.mutationObserver.disconnect(),void 0),(this.originalPushState||this.originalReplaceState)&&this.restoreHistoryListeners(),this.lastObservedUrl=null)}handleNavigationEvent(e){if(!this.active)return;let t=window.location.href;this.options.enableDeduplication&&this.lastObservedUrl===t||(this.lastObservedUrl=t,this.options.debounceMs>0?(this.debounceTimer!==void 0&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=void 0,this.options.onRouteChange(t,e)},this.options.debounceMs)):this.options.onRouteChange(t,e))}patchHistoryListeners(){this.originalPushState=window.history.pushState,this.originalReplaceState=window.history.replaceState,window.history.pushState=(...e)=>{let t=this.originalPushState?.apply(window.history,e);return this.handleNavigationEvent(`history.pushState`),t},window.history.replaceState=(...e)=>{let t=this.originalReplaceState?.apply(window.history,e);return this.handleNavigationEvent(`history.replaceState`),t}}restoreHistoryListeners(){this.originalPushState&&=(window.history.pushState=this.originalPushState,void 0),this.originalReplaceState&&=(window.history.replaceState=this.originalReplaceState,void 0)}},cn={events:`/v1/analytics/events`},ln=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async appendEvent(e){let t=await this.meltingSpotApi.call({method:P.POST,endpoint:cn.events,options:{payload:e}});return t.isErr()?E(t.error):T(t.value)}},un=e=>{let t=e.get(`utm_source`);if(t)return{source:t,medium:e.get(`utm_medium`)??void 0,campaign:e.get(`utm_campaign`)??void 0,term:e.get(`utm_term`)??void 0,content:e.get(`utm_content`)??void 0}},dn=e=>e?Object.entries(e).reduce((e,[t,n])=>(n!=null&&(e[`utm_${t}`]=n),e),{}):{},fn=function(e){return e.Mute30Min=`Mute30Min`,e.Mute1Hour=`Mute1Hour`,e.Mute2Hours=`Mute2Hours`,e.UntilTomorrow=`UntilTomorrow`,e.UntilNextWeek=`UntilNextWeek`,e.Always=`Always`,e}({}),pn=function(e){return e.Active=`Active`,e.Closed=`Closed`,e.Expired=`Expired`,e}({}),mn=function(e){return e.User=`User`,e.Assistant=`Assistant`,e}({}),hn=function(e){return e.Metadata=`metadata`,e.Token=`token`,e.StatusLabel=`status_label`,e.ActionsPending=`actions_pending`,e.Action=`action`,e.Bubble=`bubble`,e.Handoff=`handoff`,e.Done=`done`,e.Error=`error`,e}({}),gn=function(e){return e.NoSource=`NoSource`,e.LowConfidence=`LowConfidence`,e.HumanRequest=`HumanRequest`,e.OutOfScope=`OutOfScope`,e}({}),_n=function(e){return e.PoorExplanation=`poor_explanation`,e.FalseInformation=`false_information`,e.NotFollowingRequest=`not_following_request`,e.IncompleteResponse=`incomplete_response`,e.ChatHistoryIssue=`chat_history_issue`,e.PersonalizationIssue=`personalization_issue`,e.Other=`other`,e}({}),vn=function(e){return e.Up=`up`,e.Down=`down`,e}({}),z=function(e){return e.PlaybookIntent=`PlaybookIntent`,e.UserInitiated=`UserInitiated`,e.Welcome=`Welcome`,e.Resume=`Resume`,e.Discover=`Discover`,e.Recommend=`Recommend`,e}({}),yn=function(e){return e.ExtraExtraSmall=`ExtraExtraSmall`,e.ExtraSmall=`ExtraSmall`,e.Small=`Small`,e.Medium=`Medium`,e.Large=`Large`,e}({}),bn=function(e){return e.Dropdown=`Dropdown`,e.Inline=`Inline`,e.Overlay=`Overlay`,e}({}),xn=function(e){return e.Left=`Left`,e.Right=`Right`,e}({}),Sn=function(e){return e.Top=`Top`,e.Bottom=`Bottom`,e}({}),Cn=function(e){return e.TopLeft=`TopLeft`,e.TopRight=`TopRight`,e.BottomLeft=`BottomLeft`,e.BottomRight=`BottomRight`,e}({}),wn=function(e){return e.Button=`Button`,e.Card=`Card`,e.CardInline=`CardInline`,e.Carousel=`Carousel`,e.Helper=`Helper`,e.ListOfContent=`ListOfContent`,e.ListOfContentInline=`ListOfContentInline`,e}({}),Tn=function(e){return e.Inline=`Inline`,e.Modal=`Modal`,e.Drawer=`Drawer`,e}({}),En=function(e){return e.Self=`Self`,e.Parent=`Parent`,e.Top=`Top`,e}({}),Dn=function(e){return e.Left=`Left`,e.Right=`Right`,e}({}),On=function(e){return e.Body=`Body`,e.DOMSelector=`DOMSelector`,e}({}),kn=function(e){return e.After=`After`,e.AppendChild=`AppendChild`,e.Before=`Before`,e.PrependChild=`PrependChild`,e}({}),An=function(e){return e.CSSSelector=`CSSSelector`,e.Slot=`Slot`,e}({}),jn=function(e){return e.Element=`Element`,e.WebComponent=`WebComponent`,e}({}),Mn=function(e){return e.Inline=`Inline`,e.Flex=`Flex`,e}({}),Nn=function(e){return e.Horizontal=`Horizontal`,e.Vertical=`Vertical`,e}({}),Pn=function(e){return e.Start=`Start`,e.Center=`Center`,e.End=`End`,e.Stretch=`Stretch`,e.Baseline=`Baseline`,e}({}),Fn=function(e){return e.Course=`Course`,e.Live=`Live`,e.Link=`Link`,e.Page=`Page`,e}({}),In=function(e){return e.Workshop=`Workshop`,e.Conference=`Conference`,e}({}),Ln=function(e){return e.Ended=`Ended`,e.Planned=`Planned`,e.Live=`Live`,e}({}),Rn=function(e){return e.Hours=`Hours`,e.Days=`Days`,e.Never=`Never`,e}({}),zn=function(e){return e.CloseA=`CloseA`,e.CloseB=`CloseB`,e.Later=`Later`,e}({}),Bn=function(e){return e.NoLimit=`NoLimit`,e.OnlyOnce=`OnlyOnce`,e.OncePerDays=`OncePerDays`,e.UntilContentCompletion=`UntilContentCompletion`,e}({}),Vn=`a`,Hn=`mention_input`,Un=`mention`,Wn=`var`,Gn=`p`,Kn=`h1`,qn=`h2`,Jn=`h3`,Yn=`blockquote`,Xn=`layout`,Zn=`layout-column`,Qn=`ul`,$n=`ol`,er=`lic`,tr=`li`,nr=`img`,rr=`iframely`,ir=`code_block`,ar=`code_line`,or=function(e){return e.Element=`Element`,e.FullPage=`FullPage`,e}({}),sr=function(e){return e.Draft=`Draft`,e.Pending=`Pending`,e.Published=`Published`,e}({}),cr=function(e){return e.Beacon=`Beacon`,e.List=`List`,e}({}),lr=function(e){return e.Channel=`Channel`,e.Collection=`Collection`,e.Course=`Course`,e.Discussion=`Discussion`,e.Forum=`Forum`,e.Link=`Link`,e.Live=`Live`,e.LearningPath=`LearningPath`,e.Page=`Page`,e.RichText=`RichText`,e.Topic=`Topic`,e}({});function ur(e){return Object.values(lr).includes(e)}var dr=yt.getInstance(),fr=Jt.getInstance(),pr=on.getInstance(),mr={Playbook:$t.getInstance(),Spot:tn.getInstance(),SpotMember:rn.getInstance()},hr=globalThis;hr.MeltingSpot||={},hr.MeltingSpot.Configuration=dr,hr.MeltingSpot.Auth=fr,hr.MeltingSpot.Sso=pr,hr.MeltingSpot.Api=mr,e.ATTRIBUTE_BLOCKQUOTE=Yn,e.ATTRIBUTE_CODE_BLOCK=ir,e.ATTRIBUTE_CODE_LINE=ar,e.ATTRIBUTE_H1=Kn,e.ATTRIBUTE_H2=qn,e.ATTRIBUTE_H3=Jn,e.ATTRIBUTE_IFRAMELY=rr,e.ATTRIBUTE_IMAGE=nr,e.ATTRIBUTE_LAYOUT=Xn,e.ATTRIBUTE_LAYOUT_COLUMN=Zn,e.ATTRIBUTE_LI=tr,e.ATTRIBUTE_LIC=er,e.ATTRIBUTE_LINK=Vn,e.ATTRIBUTE_MENTION=Un,e.ATTRIBUTE_MENTION_INPUT=Hn,e.ATTRIBUTE_OL=$n,e.ATTRIBUTE_PARAGRAPH=Gn,e.ATTRIBUTE_UL=Qn,e.ATTRIBUTE_VARIABLE=Wn,e.AnalyticsApiService=ln,e.Api=mr,e.Auth=fr,e.AuthService=Jt,e.AuthServiceEvents=qt,e.BeaconIntegrationType=bn,e.BeaconRenderType=wn,e.ButtonBeaconSize=yn,e.CoachMutePreset=fn,e.Configuration=dr,e.ConfigurationService=yt,e.ConversationMessageRole=mn,e.ConversationSseEventType=hn,e.ConversationStatus=pn,e.DEFAULT_PERMISSION_POLICIES=ue,e.DateFormat=We,e.DisplayRuleTimeUnit=Rn,e.DrawerWidgetPosition=Dn,e.DropdownBeaconHorizontalPosition=xn,e.DropdownBeaconVerticalPosition=Sn,e.HttpError=N,e.HttpMethods=P,e.HttpService=F,e.LastActionState=zn,e.LearningPathContentType=Fn,e.LiveBuiltInType=In,e.LiveStatus=Ln,e.Logger=dt,e.MeltingSpotApi=Xt,e.MeltyHandoffReason=gn,e.MeltyMessageFeedbackReason=_n,e.MeltyMessageFeedbackSignal=vn,e.OverlayBeaconPosition=Cn,e.PLAYBOOK_EDITOR_ACTIVE_EVENT=at,e.PlaybookApiService=$t,e.PlaybookEditorAwareLifecycle=lt,e.PlaybookHotspotLocation=or,e.PlaybookIntentStatus=sr,e.PlaybookIntentWidgetMode=cr,e.PlaybookPageMatchingOperator=Ke,e.RepetitionMode=Bn,e.RouteChangeDetector=sn,e.SpotMemberApiService=rn,e.SpotMemberAuthApiService=an,e.SpotWidgetContentType=lr,e.Sso=pr,e.SsoService=on,e.TouchPointAnchorType=On,e.TouchPointDOMInjectionPosition=kn,e.TouchPointDOMSelectorCssStepMode=jn,e.TouchPointDOMSelectorPathStepType=An,e.TouchPointFlexAlign=Pn,e.TouchPointFlexDirection=Nn,e.TouchPointLayoutType=Mn,e.TriggerType=z,e.WidgetInjectionTarget=En,e.WidgetInjectionType=Tn,e.createDialog=le,e.createIframe=de,e.createIsolatedShadowHost=fe,e.dayjs=Ee.default,e.flattenUtmParameters=dn,e.formatBaseUrl=_t,e.formatDate=Ge,e.formatDeeplink=gt,e.formatUUID=mt,e.getHTMLElement=ce,e.getTimeInfoWithStartAndEndDate=je,e.isEditorPauseExempt=k,e.isPlaybookEditorActive=st,e.isSpotWidgetContentType=ur,e.isTouchDevice=pe,e.matchesDomain=rt,e.parseUtmParameters=un,e.sanitizeUrl=se,e.setLoggerDebugMode=pt,e.testUrlMatching=tt,e.trimSlashLeft=ie,e.trimSlashRight=oe});
33
+ }`;var g=af(function(){return st(o,m+`return `+f).apply(n,s)});if(g.source=f,ou(g))throw g;return g}function Jd(e){return Q(e).toLowerCase()}function Yd(e){return Q(e).toUpperCase()}function Xd(e,t,r){if(e=Q(e),e&&(r||t===n))return zn(e);if(!e||!(t=Ta(t)))return e;var i=sr(e),a=sr(t);return La(i,Un(i,a),Wn(i,a)+1).join(``)}function Zd(e,t,r){if(e=Q(e),e&&(r||t===n))return e.slice(0,cr(e)+1);if(!e||!(t=Ta(t)))return e;var i=sr(e);return La(i,0,Wn(i,sr(t))+1).join(``)}function Qd(e,t,r){if(e=Q(e),e&&(r||t===n))return e.replace(Ue,``);if(!e||!(t=Ta(t)))return e;var i=sr(e);return La(i,Un(i,sr(t))).join(``)}function $d(e,t){var r=30,i=`...`;if(Y(t)){var a=`separator`in t?t.separator:a;r=`length`in t?Z(t.length):r,i=`omission`in t?Ta(t.omission):i}e=Q(e);var o=e.length;if(Xn(e)){var s=sr(e);o=s.length}if(r>=o)return e;var c=r-or(i);if(c<1)return i;var l=s?La(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),bu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=lt(a.source,Q(Ze.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(Ta(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function ef(e){return e=Q(e),e&&Ne.test(e)?e.replace(je,lr):e}var tf=ao(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),nf=io(`toUpperCase`);function rf(e,t,r){return e=Q(e),t=r?n:t,t===n?Zn(e)?fr(e):Tn(e):e.match(t)||[]}var af=U(function(e,t){try{return dn(e,n,t)}catch(e){return ou(e)?e:new ot(e)}}),of=Ao(function(e,t){return pn(t,function(t){t=bs(t),ci(e,t,xl(e[t],e))}),e});function sf(e){var t=e==null?0:e.length,n=W();return e=t?z(e,function(e){if(typeof e[1]!=`function`)throw new dt(r);return[n(e[0]),e[1]]}):[],U(function(n){for(var r=-1;++r<t;){var i=e[r];if(dn(i[0],this,n))return dn(i[1],this,n)}})}function cf(e){return fi(di(e,1))}function lf(e){return function(){return e}}function uf(e,t){return e==null||e!==e?t:e}var df=lo(),ff=lo(!0);function pf(e){return e}function mf(e){return Ji(typeof e==`function`?e:di(e,1))}function hf(e){return $i(di(e,1))}function gf(e,t){return ea(e,di(t,1))}var _f=U(function(e,t){return function(n){return Ii(n,e,t)}}),vf=U(function(e,t){return function(n){return Ii(e,n,t)}});function yf(e,t,n){var r=$(t),i=Ei(t,r);n==null&&!(Y(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=Ei(t,$(t)));var a=!(Y(n)&&`chain`in n)||!!n.chain,o=cu(e);return pn(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=Ya(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,yn([this.value()],arguments))})}),e}function bf(){return L._===this&&(L._=xt),this}function xf(){}function Sf(e){return e=Z(e),U(function(t){return ra(t,e)})}var Cf=mo(z),wf=mo(hn),Tf=mo(Sn);function Ef(e){return Zo(e)?Mn(bs(e)):sa(e)}function Df(e){return function(t){return e==null?n:Di(e,t)}}var Of=_o(),kf=_o(!0);function Af(){return[]}function jf(){return!1}function Mf(){return{}}function Nf(){return``}function Pf(){return!0}function Ff(e,t){if(e=Z(e),e<1||e>g)return[];var n=y,r=I(e,y);t=W(t),e-=y;for(var i=Ln(r,t);++n<e;)t(n);return i}function If(e){return q(e)?z(e,bs):wu(e)?[e]:Ya(ys(Q(e)))}function Lf(e){var t=++_t;return Q(e)+t}var Rf=po(function(e,t){return e+t},0),zf=bo(`ceil`),Bf=po(function(e,t){return e/t},1),Vf=bo(`floor`);function Hf(e){return e&&e.length?yi(e,pf,Ai):n}function Uf(e,t){return e&&e.length?yi(e,W(t,2),Ai):n}function Wf(e){return jn(e,pf)}function Gf(e,t){return jn(e,W(t,2))}function Kf(e){return e&&e.length?yi(e,pf,Zi):n}function qf(e,t){return e&&e.length?yi(e,W(t,2),Zi):n}var Jf=po(function(e,t){return e*t},1),Yf=bo(`round`),Xf=po(function(e,t){return e-t},0);function Zf(e){return e&&e.length?In(e,pf):0}function Qf(e,t){return e&&e.length?In(e,W(t,2)):0}return B.after=vl,B.ary=yl,B.assign=Lu,B.assignIn=Ru,B.assignInWith=zu,B.assignWith=Bu,B.at=Vu,B.before=bl,B.bind=xl,B.bindAll=of,B.bindKey=Sl,B.castArray=Vl,B.chain=Pc,B.chunk=ws,B.compact=Ts,B.concat=Es,B.cond=sf,B.conforms=cf,B.constant=lf,B.countBy=Gc,B.create=Hu,B.curry=Cl,B.curryRight=wl,B.debounce=Tl,B.defaults=Uu,B.defaultsDeep=Wu,B.defer=El,B.delay=Dl,B.difference=Ds,B.differenceBy=Os,B.differenceWith=ks,B.drop=As,B.dropRight=js,B.dropRightWhile=Ms,B.dropWhile=Ns,B.fill=Ps,B.filter=qc,B.flatMap=Xc,B.flatMapDeep=Zc,B.flatMapDepth=Qc,B.flatten=Ls,B.flattenDeep=Rs,B.flattenDepth=zs,B.flip=Ol,B.flow=df,B.flowRight=ff,B.fromPairs=Bs,B.functions=Zu,B.functionsIn=Qu,B.groupBy=tl,B.initial=Us,B.intersection=Ws,B.intersectionBy=Gs,B.intersectionWith=Ks,B.invert=nd,B.invertBy=rd,B.invokeMap=rl,B.iteratee=mf,B.keyBy=il,B.keys=$,B.keysIn=ad,B.map=al,B.mapKeys=od,B.mapValues=sd,B.matches=hf,B.matchesProperty=gf,B.memoize=kl,B.merge=cd,B.mergeWith=ld,B.method=_f,B.methodOf=vf,B.mixin=yf,B.negate=Al,B.nthArg=Sf,B.omit=ud,B.omitBy=dd,B.once=jl,B.orderBy=ol,B.over=Cf,B.overArgs=Ml,B.overEvery=wf,B.overSome=Tf,B.partial=Nl,B.partialRight=Pl,B.partition=sl,B.pick=fd,B.pickBy=pd,B.property=Ef,B.propertyOf=Df,B.pull=Zs,B.pullAll=Qs,B.pullAllBy=$s,B.pullAllWith=ec,B.pullAt=tc,B.range=Of,B.rangeRight=kf,B.rearg=Fl,B.reject=ul,B.remove=nc,B.rest=Il,B.reverse=rc,B.sampleSize=fl,B.set=hd,B.setWith=gd,B.shuffle=pl,B.slice=ic,B.sortBy=gl,B.sortedUniq=dc,B.sortedUniqBy=fc,B.split=Wd,B.spread=Ll,B.tail=pc,B.take=mc,B.takeRight=hc,B.takeRightWhile=gc,B.takeWhile=_c,B.tap=Fc,B.throttle=Rl,B.thru=Ic,B.toArray=ju,B.toPairs=_d,B.toPairsIn=vd,B.toPath=If,B.toPlainObject=Fu,B.transform=yd,B.unary=zl,B.union=vc,B.unionBy=yc,B.unionWith=bc,B.uniq=xc,B.uniqBy=Sc,B.uniqWith=Cc,B.unset=bd,B.unzip=wc,B.unzipWith=Tc,B.update=xd,B.updateWith=Sd,B.values=Cd,B.valuesIn=wd,B.without=Ec,B.words=rf,B.wrap=Bl,B.xor=Dc,B.xorBy=Oc,B.xorWith=kc,B.zip=Ac,B.zipObject=jc,B.zipObjectDeep=Mc,B.zipWith=Nc,B.entries=_d,B.entriesIn=vd,B.extend=Ru,B.extendWith=zu,yf(B,B),B.add=Rf,B.attempt=af,B.camelCase=Od,B.capitalize=kd,B.ceil=zf,B.clamp=Td,B.clone=Hl,B.cloneDeep=Wl,B.cloneDeepWith=Gl,B.cloneWith=Ul,B.conformsTo=Kl,B.deburr=Ad,B.defaultTo=uf,B.divide=Bf,B.endsWith=jd,B.eq=ql,B.escape=Md,B.escapeRegExp=Nd,B.every=Kc,B.find=Jc,B.findIndex=Fs,B.findKey=Gu,B.findLast=Yc,B.findLastIndex=Is,B.findLastKey=Ku,B.floor=Vf,B.forEach=$c,B.forEachRight=el,B.forIn=qu,B.forInRight=Ju,B.forOwn=Yu,B.forOwnRight=Xu,B.get=$u,B.gt=Jl,B.gte=Yl,B.has=ed,B.hasIn=td,B.head=Vs,B.identity=pf,B.includes=nl,B.indexOf=Hs,B.inRange=Ed,B.invoke=id,B.isArguments=Xl,B.isArray=q,B.isArrayBuffer=Zl,B.isArrayLike=Ql,B.isArrayLikeObject=J,B.isBoolean=$l,B.isBuffer=eu,B.isDate=tu,B.isElement=nu,B.isEmpty=ru,B.isEqual=iu,B.isEqualWith=au,B.isError=ou,B.isFinite=su,B.isFunction=cu,B.isInteger=lu,B.isLength=uu,B.isMap=du,B.isMatch=fu,B.isMatchWith=pu,B.isNaN=mu,B.isNative=hu,B.isNil=_u,B.isNull=gu,B.isNumber=vu,B.isObject=Y,B.isObjectLike=X,B.isPlainObject=yu,B.isRegExp=bu,B.isSafeInteger=xu,B.isSet=Su,B.isString=Cu,B.isSymbol=wu,B.isTypedArray=Tu,B.isUndefined=Eu,B.isWeakMap=Du,B.isWeakSet=Ou,B.join=qs,B.kebabCase=Pd,B.last=Js,B.lastIndexOf=Ys,B.lowerCase=Fd,B.lowerFirst=Id,B.lt=ku,B.lte=Au,B.max=Hf,B.maxBy=Uf,B.mean=Wf,B.meanBy=Gf,B.min=Kf,B.minBy=qf,B.stubArray=Af,B.stubFalse=jf,B.stubObject=Mf,B.stubString=Nf,B.stubTrue=Pf,B.multiply=Jf,B.nth=Xs,B.noConflict=bf,B.noop=xf,B.now=_l,B.pad=Ld,B.padEnd=Rd,B.padStart=zd,B.parseInt=Bd,B.random=Dd,B.reduce=cl,B.reduceRight=ll,B.repeat=Vd,B.replace=Hd,B.result=md,B.round=Yf,B.runInContext=e,B.sample=dl,B.size=ml,B.snakeCase=Ud,B.some=hl,B.sortedIndex=ac,B.sortedIndexBy=oc,B.sortedIndexOf=sc,B.sortedLastIndex=cc,B.sortedLastIndexBy=lc,B.sortedLastIndexOf=uc,B.startCase=Gd,B.startsWith=Kd,B.subtract=Xf,B.sum=Zf,B.sumBy=Qf,B.template=qd,B.times=Ff,B.toFinite=Mu,B.toInteger=Z,B.toLength=Nu,B.toLower=Jd,B.toNumber=Pu,B.toSafeInteger=Iu,B.toString=Q,B.toUpper=Yd,B.trim=Xd,B.trimEnd=Zd,B.trimStart=Qd,B.truncate=$d,B.unescape=ef,B.uniqueId=Lf,B.upperCase=tf,B.upperFirst=nf,B.each=$c,B.eachRight=el,B.first=Vs,yf(B,function(){var e={};return wi(B,function(t,n){A.call(B.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),B.VERSION=`4.17.21`,pn([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){B[e].placeholder=B}),pn([`drop`,`take`],function(e,t){V.prototype[e]=function(r){r=r===n?1:M(Z(r),0);var i=this.__filtered__&&!t?new V(this):this.clone();return i.__filtered__?i.__takeCount__=I(r,i.__takeCount__):i.__views__.push({size:I(r,y),type:e+(i.__dir__<0?`Right`:``)}),i},V.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),pn([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==1||n==3;V.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:W(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),pn([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);V.prototype[e]=function(){return this[n](1).value()[0]}}),pn([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);V.prototype[e]=function(){return this.__filtered__?new V(this):this[n](1)}}),V.prototype.compact=function(){return this.filter(pf)},V.prototype.find=function(e){return this.filter(e).head()},V.prototype.findLast=function(e){return this.reverse().find(e)},V.prototype.invokeMap=U(function(e,t){return typeof e==`function`?new V(this):this.map(function(n){return Ii(n,e,t)})}),V.prototype.reject=function(e){return this.filter(Al(W(e)))},V.prototype.slice=function(e,t){e=Z(e);var r=this;return r.__filtered__&&(e>0||t<0)?new V(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=Z(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},V.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},V.prototype.toArray=function(){return this.take(y)},wi(V.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=B[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(B.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof V,l=s[0],u=c||q(t),d=function(e){var t=a.apply(B,yn([e],s));return i&&f?t[0]:t};u&&r&&typeof l==`function`&&l.length!=1&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,m=o&&!f,h=c&&!p;if(!o&&u){t=h?t:new V(this);var g=e.apply(t,s);return g.__actions__.push({func:Ic,args:[d],thisArg:n}),new xr(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),pn([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=ft[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);B.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(q(i)?i:[],e)}return this[n](function(n){return t.apply(q(n)?n:[],e)})}}),wi(V.prototype,function(e,t){var n=B[t];if(n){var r=n.name+``;A.call(Nn,r)||(Nn[r]=[]),Nn[r].push({name:t,func:n})}}),Nn[uo(n,s).name]=[{name:`wrapper`,func:n}],V.prototype.clone=Sr,V.prototype.reverse=Cr,V.prototype.value=wr,B.prototype.at=Lc,B.prototype.chain=Rc,B.prototype.commit=zc,B.prototype.next=Bc,B.prototype.plant=Hc,B.prototype.reverse=Uc,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=Wc,B.prototype.first=B.prototype.head,Mt&&(B.prototype[Mt]=Vc),B})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(L._=pr,define(function(){return pr})):tn?((tn.exports=pr)._=pr,en._=pr):L._=pr}).call(e)}))()),Re=(e,t)=>{switch(t){case`fr`:case`it`:return Le.default.capitalize(e.format(`dddd D MMMM`));case`es`:return Le.default.capitalize(e.format(`dddd D [de] MMMM`));case`de`:return e.format(`dddd, D. MMMM`);default:return e.format(`dddd, MMMM Do`)}},ze=e=>e.format(`LT`),Be=(e,t)=>{let n=Re(e,t),r=ze(e);switch(t){case`fr`:return`${n} à ${r}`;case`it`:return`${n} alle ${r}`;case`es`:return`${n} a las ${r}`;case`de`:return`${n} um ${r}`;default:return`${n} at ${r}`}},Ve=e=>e.format(`ll`),He=(e,t)=>{switch(t){case`fr`:case`de`:case`it`:return e.format(`HH:mm`);case`es`:return e.format(`H:mm`);default:return e.format(`h:mm`)}},Ue=e=>e.format(`L`),O=e=>e.format(`L LT`),We=function(e){return e.SimpleDate=`SimpleDate`,e.SimpleDateTime=`SimpleDateTime`,e.ExtraShortDate=`ExtraShortDate`,e.InlineExtraShortDate=`InlineExtraShortDate`,e.ShortDate=`ShortDate`,e.InlineShortDate=`InlineShortDate`,e.Date=`Date`,e.LongDate=`LongDate`,e.LongDateTime=`LongDateTime`,e.ShortTime=`ShortTime`,e.Time=`Time`,e.DateTime=`DateTime`,e}({}),Ge=(e,t,n,r)=>{let i=(0,Ee.default)(e);r&&(i=i.tz(r)),n&&(i=i.locale(n));let a=i.locale();switch(t){case`SimpleDate`:return Ue(i);case`SimpleDateTime`:return O(i);case`ExtraShortDate`:return Pe(i,a);case`InlineExtraShortDate`:return Fe(i,a);case`ShortDate`:return Ve(i);case`InlineShortDate`:return Ie(i,a);case`Date`:return Me(i);case`LongDate`:return Re(i,a);case`LongDateTime`:return Be(i,a);case`ShortTime`:return He(i,a);case`Time`:return ze(i);case`DateTime`:return Ne(i)}},Ke=function(e){return e.Contains=`Contains`,e.DoesntContain=`DoesntContain`,e.DoesntEndWith=`DoesntEndWith`,e.DoesntEqual=`DoesntEqual`,e.DoesntStartWith=`DoesntStartWith`,e.EndsWith=`EndsWith`,e.Equals=`Equals`,e.MatchesRegex=`MatchesRegex`,e.StartsWith=`StartsWith`,e}({}),qe=`http://_meltingspot.local`,Je=200,Ye=/(\([^()]*[+*][^()]*\))[+*]/,Xe=e=>e.length<=Je&&!Ye.test(e),Ze=e=>{try{let t=new URL(e,qe);return`${t.pathname}${t.search}${t.hash}`}catch{return e}},Qe=e=>e.startsWith(`/`)?e:`/${e}`,$e=(e,t)=>{switch(t.operator){case Ke.MatchesRegex:if(!Xe(t.value))return!1;try{return new RegExp(t.value).test(e)}catch{return!1}case Ke.StartsWith:return e.startsWith(Qe(t.value));case Ke.DoesntStartWith:return!e.startsWith(Qe(t.value));case Ke.EndsWith:return e.endsWith(t.value);case Ke.DoesntEndWith:return!e.endsWith(t.value);case Ke.Contains:return e.includes(t.value);case Ke.DoesntContain:return!e.includes(t.value);case Ke.Equals:return e===Qe(t.value);case Ke.DoesntEqual:return e!==Qe(t.value)}},et=(e,t)=>{let n=t.rules.map(t=>$e(e,t));return t.ruleOperator===`AND`?n.every(Boolean):n.some(Boolean)},tt=(e,t)=>{let n=Ze(e),r=t.blocks.map(e=>et(n,e));return t.blockOperator===`AND`?r.every(Boolean):r.some(Boolean)},nt=e=>e.replace(/^https?:\/\//,``),rt=(e,t)=>{let n=nt(t);try{let t=new URL(e);return t.hostname===n||t.hostname.endsWith(`.${n}`)}catch{return!1}},it=`data-meltingspot-playbook-editor-active`,at=`meltingspot:playbook-editor:active-changed`;Object.values(function(e){return e.EditMode=`edit-mode`,e.Preview=`preview`,e}({}));var ot=()=>typeof document<`u`&&typeof document.dispatchEvent==`function`,st=()=>ot()?document.documentElement.getAttribute(it)===`true`:!1,ct=!1,k=()=>ct,lt=class{constructor(){this.listener=null,this.lastOptions=null,this.chain=Promise.resolve()}enqueue(e){let t=this.chain.then(e);return this.chain=t.catch(()=>void 0),t}get isBound(){return this.listener!==null}bind(e){if(this.listener!==null||typeof document>`u`)return;let t=()=>{if(st()){Promise.resolve().then(()=>e.onEditorActive()).catch(e=>{console.warn(`[playbook-editor] onEditorActive callback failed`,e)});return}let t=this.lastOptions;t!==null&&Promise.resolve().then(()=>e.onEditorInactive(t)).catch(e=>{console.warn(`[playbook-editor] onEditorInactive callback failed`,e)})};document.addEventListener(at,t),this.listener=t}cacheOptions(e){this.lastOptions=e}clearOptions(){this.lastOptions=null}unbind(){this.listener!==null&&typeof document<`u`&&document.removeEventListener(at,this.listener),this.listener=null,this.lastOptions=null}},ut=`1.13.0`,dt=class{constructor(e){this.debug=!1,this.debug=e?.debug??!1,this.appName=e?.appName,this.appVersion=e?.appVersion}log(e,...t){this.debug&&this.print(e,`info`,t)}warn(e,...t){this.print(e,`warn`,t)}error(e,...t){this.print(e,`error`,t)}print(e,t,n){let r=[`[${[`MeltingSpot`,this.appName,this.appVersion].filter(Boolean).join(` - `)}] ${e}`];n.length&&r.push(...n),console[t](...r)}},ft=new dt({appName:`Core SDK`,appVersion:ut}),pt=e=>{ft.debug=e},mt=e=>e.toLowerCase().replace(/[^a-z0-9-]/g,``),ht=[`/user`],gt=({deeplink:e,spotId:t})=>{try{let n=new URL(e,`https://unused.com`),r=n.pathname;return n.search&&(r+=n.search),n.hash&&(r+=n.hash),ht.some(e=>r.startsWith(e))||(r=`/spot/${t}/${ie(r)}`),r}catch(e){return ft.warn(`Failed to parse deeplink URL`,e),null}},A=[/(^|\.)meltingspot\.io$/i],_t=e=>{let t;try{let n=oe(e);t=new URL(n)}catch{throw Error(`Invalid baseURL: ${e}`)}let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`,r=t.protocol===`https:`,i=A.some(e=>e.test(t.hostname));if(!n&&(!r||!i))throw Error(`Untrusted baseURL origin: ${t.origin}`);return t.origin},vt={msApiBaseUrl:`https://openapi.meltingspot.io/`,msCommunityWebBaseUrl:`https://go.meltingspot.io/`,ssoToken:void 0,spotId:``,autoJoin:!1,rootDocument:globalThis.document},yt=class e{constructor(){this.configuration=vt}static getInstance(){return e.instance||=new e,e.instance}setConfiguration(e){this.configuration={...this.configuration,...e}}static getConfiguration(t={}){return{...e.getInstance().configuration,...t}}},bt=RegExp(`(%[a-f0-9]{2})|([^%]+?)`,`gi`),xt=RegExp(`(%[a-f0-9]{2})+`,`gi`);function St(e,t){try{return[decodeURIComponent(e.join(``))]}catch{}if(e.length===1)return e;t||=1;let n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],St(n),St(r))}function Ct(e){try{return decodeURIComponent(e)}catch{let t=e.match(bt)||[];for(let n=1;n<t.length;n++)e=St(t,n).join(``),t=e.match(bt)||[];return e}}function wt(e){let t={"%FE%FF":`��`,"%FF%FE":`��`},n=xt.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{let e=Ct(n[0]);e!==n[0]&&(t[n[0]]=e)}n=xt.exec(e)}t[`%C2`]=`�`;let r=Object.keys(t);for(let n of r)e=e.replace(new RegExp(n,`g`),t[n]);return e}function Tt(e){if(typeof e!=`string`)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return wt(e)}}function Et(e,t){let n={};if(Array.isArray(t))for(let r of t){let t=Object.getOwnPropertyDescriptor(e,r);t?.enumerable&&Object.defineProperty(n,r,t)}else for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){let a=e[r];t(r,a,e)&&Object.defineProperty(n,r,i)}}return n}function Dt(e,t){if(typeof e!=`string`||typeof t!=`string`)throw TypeError("Expected the arguments to be of type `string`");if(e===``||t===``)return[];let n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}var Ot=c({exclude:()=>M,extract:()=>Bt,parse:()=>Vt,parseUrl:()=>Ut,pick:()=>Gt,stringify:()=>Ht,stringifyUrl:()=>Wt}),kt=e=>e==null,At=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),jt=Symbol(`encodeFragmentIdentifier`);function Mt(e){switch(e.arrayFormat){case`index`:return t=>(n,r)=>{let i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?[...n,[j(t,e),`[`,i,`]`].join(``)]:[...n,[j(t,e),`[`,j(i,e),`]=`,j(r,e)].join(``)]};case`bracket`:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?[...n,[j(t,e),`[]`].join(``)]:[...n,[j(t,e),`[]=`,j(r,e)].join(``)];case`colon-list-separator`:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?[...n,[j(t,e),`:list=`].join(``)]:[...n,[j(t,e),`:list=`,j(r,e)].join(``)];case`comma`:case`separator`:case`bracket-separator`:{let t=e.arrayFormat===`bracket-separator`?`[]=`:`=`;return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===``?r:(i=i===null?``:i,r.length===0?[[j(n,e),t,j(i,e)].join(``)]:[[r,j(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===``?n:r===null?[...n,j(t,e)]:[...n,[j(t,e),`=`,j(r,e)].join(``)]}}function Nt(e){let t;switch(e.arrayFormat){case`index`:return(e,n,r)=>{if(t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,``),!t){r[e]=n;return}r[e]===void 0&&(r[e]={}),r[e][t[1]]=n};case`bracket`:return(e,n,r)=>{if(t=/(\[])$/.exec(e),e=e.replace(/\[]$/,``),!t){r[e]=n;return}if(r[e]===void 0){r[e]=[n];return}r[e]=[...r[e],n]};case`colon-list-separator`:return(e,n,r)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,``),!t){r[e]=n;return}if(r[e]===void 0){r[e]=[n];return}r[e]=[...r[e],n]};case`comma`:case`separator`:return(t,n,r)=>{let i=typeof n==`string`&&n.includes(e.arrayFormatSeparator),a=typeof n==`string`&&!i&&Ft(n,e).includes(e.arrayFormatSeparator);n=a?Ft(n,e):n,r[t]=i||a?n.split(e.arrayFormatSeparator).map(t=>Ft(t,e)):n===null?n:Ft(n,e)};case`bracket-separator`:return(t,n,r)=>{let i=/(\[])$/.test(t);if(t=t.replace(/\[]$/,``),!i){r[t]=n&&Ft(n,e);return}let a=n===null?[]:Ft(n,e).split(e.arrayFormatSeparator);if(r[t]===void 0){r[t]=a;return}r[t]=[...r[t],...a]};default:return(e,t,n)=>{if(n[e]===void 0){n[e]=t;return}n[e]=[...[n[e]].flat(),t]}}}function Pt(e){if(typeof e!=`string`||e.length!==1)throw TypeError(`arrayFormatSeparator must be single character string`)}function j(e,t){return t.encode?t.strict?At(e):encodeURIComponent(e):e}function Ft(e,t){return t.decode?Tt(e):e}function It(e){return Array.isArray(e)?e.sort():typeof e==`object`?It(Object.keys(e)).sort((e,t)=>Number(e)-Number(t)).map(t=>e[t]):e}function Lt(e){let t=e.indexOf(`#`);return t!==-1&&(e=e.slice(0,t)),e}function Rt(e){let t=``,n=e.indexOf(`#`);return n!==-1&&(t=e.slice(n)),t}function zt(e,t,n){return n===`string`&&typeof e==`string`?e:typeof n==`function`&&typeof e==`string`?n(e):n===`boolean`&&e===null?!0:n===`boolean`&&e!==null&&(e.toLowerCase()===`true`||e.toLowerCase()===`false`)?e.toLowerCase()===`true`:n===`boolean`&&e!==null&&(e.toLowerCase()===`1`||e.toLowerCase()===`0`)?e.toLowerCase()===`1`:n===`string[]`&&t.arrayFormat!==`none`&&typeof e==`string`?[e]:n===`number[]`&&t.arrayFormat!==`none`&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?[Number(e)]:n===`number`&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()===`true`||e.toLowerCase()===`false`)?e.toLowerCase()===`true`:t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e==`string`&&e.trim()!==``?Number(e):e}function Bt(e){e=Lt(e);let t=e.indexOf(`?`);return t===-1?``:e.slice(t+1)}function Vt(e,t){t={decode:!0,sort:!0,arrayFormat:`none`,arrayFormatSeparator:`,`,parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},Pt(t.arrayFormatSeparator);let n=Nt(t),r=Object.create(null);if(typeof e!=`string`||(e=e.trim().replace(/^[?#&]/,``),!e))return r;for(let i of e.split(`&`)){if(i===``)continue;let e=t.decode?i.replaceAll(`+`,` `):i,[a,o]=Dt(e,`=`);a===void 0&&(a=e),o=o===void 0?null:[`comma`,`separator`,`bracket-separator`].includes(t.arrayFormat)?o:Ft(o,t),n(Ft(a,t),o,r)}for(let[e,n]of Object.entries(r))if(typeof n==`object`&&n&&t.types[e]!==`string`)for(let[r,i]of Object.entries(n)){let a=t.types[e]?t.types[e].replace(`[]`,``):void 0;n[r]=zt(i,t,a)}else r[e]=typeof n==`object`&&n&&t.types[e]===`string`?Object.values(n).join(t.arrayFormatSeparator):zt(n,t,t.types[e]);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{let n=r[t];return e[t]=n&&typeof n==`object`&&!Array.isArray(n)?It(n):n,e},Object.create(null))}function Ht(e,t){if(!e)return``;t={encode:!0,strict:!0,arrayFormat:`none`,arrayFormatSeparator:`,`,...t},Pt(t.arrayFormatSeparator);let n=n=>t.skipNull&&kt(e[n])||t.skipEmptyString&&e[n]===``,r=Mt(t),i={};for(let[t,r]of Object.entries(e))n(t)||(i[t]=r);let a=Object.keys(i);return t.sort!==!1&&a.sort(t.sort),a.map(n=>{let i=e[n];return i===void 0?``:i===null?j(n,t):Array.isArray(i)?i.length===0&&t.arrayFormat===`bracket-separator`?j(n,t)+`[]`:i.reduce(r(n),[]).join(`&`):j(n,t)+`=`+j(i,t)}).filter(e=>e.length>0).join(`&`)}function Ut(e,t){t={decode:!0,...t};let[n,r]=Dt(e,`#`);return n===void 0&&(n=e),{url:n?.split(`?`)?.[0]??``,query:Vt(Bt(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Ft(r,t)}:{}}}function Wt(e,t){t={encode:!0,strict:!0,[jt]:!0,...t};let n=Lt(e.url).split(`?`)[0]||``,r=Ht({...Vt(Bt(e.url),{sort:!1,...t}),...e.query},t);r&&=`?${r}`;let i=Rt(e.url);if(typeof e.fragmentIdentifier==`string`){let r=new URL(n);r.hash=e.fragmentIdentifier,i=t[jt]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${r}${i}`}function Gt(e,t,n){n={parseFragmentIdentifier:!0,[jt]:!1,...n};let{url:r,query:i,fragmentIdentifier:a}=Ut(e,n);return Wt({url:r,query:Et(i,t),fragmentIdentifier:a},n)}function M(e,t,n){return Gt(e,Array.isArray(t)?e=>!t.includes(e):(e,n)=>!t(e,n),n)}var Kt=Ot,N=class e extends Error{constructor(t,n){super(`HTTP Error ${t}${n?`: ${n}`:``}`),this.code=t,this.name=`HttpError`,Object.setPrototypeOf(this,e.prototype)}},P=function(e){return e.DELETE=`DELETE`,e.GET=`GET`,e.PATCH=`PATCH`,e.POST=`POST`,e}({}),F=class e{constructor(){this.headers={}}setHeaders(e){this.headers=e}async get(t){try{let n=t.query?`${t.url}?${this.serializeQuery(t.query)}`:t.url,r=await fetch(n,{headers:{...this.headers,...t.headers,"Content-Type":`application/json`},...t.signal?{signal:t.signal}:{}});return r.ok?T(await e.parseBody(r)):E(new N(r.status,await r.text()))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(new N(D.INTERNAL_SERVER_ERROR,t))}}async post(t){try{let n=await fetch(t.url,{method:`POST`,headers:{...this.headers,...t.headers,"Content-Type":`application/json`},body:JSON.stringify(t.payload),...t.signal?{signal:t.signal}:{}});return n.ok?T(await e.parseBody(n)):E(new N(n.status,await n.text()))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(new N(D.INTERNAL_SERVER_ERROR,t))}}async delete(t){try{let n=await fetch(t.url,{method:`DELETE`,headers:{...this.headers,...t.headers,Accept:`application/json`},...t.signal?{signal:t.signal}:{}});return n.ok?T(await e.parseBody(n)):E(new N(n.status,await n.text()))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(new N(D.INTERNAL_SERVER_ERROR,t))}}async patch(t){try{let n=await fetch(t.url,{method:`PATCH`,headers:{...this.headers,...t.headers,"Content-Type":`application/json`},body:JSON.stringify(t.payload),...t.signal?{signal:t.signal}:{}});return n.ok?T(await e.parseBody(n)):E(new N(n.status,await n.text()))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(new N(D.INTERNAL_SERVER_ERROR,t))}}static async parseBody(e){if(e.status!==D.NO_CONTENT)return await e.json()}serializeQuery(e){if(typeof e==`string`)return e;if(typeof e==`object`)for(let t in e)e[t]===void 0&&delete e[t];return e=Kt.stringify(e,{arrayFormat:`none`}),e}},I={accessToken:{email:`/v1/auth/accessToken/email`,sso:{jwt:`/v1/auth/accessToken/sso/jwt`}},refreshAccessToken:`/v1/auth/accessToken~refresh`,password:{reset:`/v1/auth/password~reset`}},qt=function(e){return e.TokensUpdated=`auth:tokens-updated`,e}({}),Jt=class e extends EventTarget{constructor(){super(),this.accessToken=null,this.refreshToken=null}static getInstance(){return e.instance||=new e,e.instance}async loginWithPassword(e,t){let n=await this.callApi({endpoint:I.accessToken.email,method:`POST`,body:{email:e,password:t},withSpotId:!0});if(n.isErr())return E(n.error);let{accessToken:r,refreshToken:i}=n.value;return this.setTokens(r.token,i.token),T({accessToken:r.token,refreshToken:i.token})}async loginWithSsoToken(e){let t=await this.callApi({endpoint:I.accessToken.sso.jwt,method:`POST`,body:{token:e},withSpotId:!0});if(t.isErr())return E(t.error);let{accessToken:n,refreshToken:r}=t.value;return this.setTokens(n.token,r.token),T({accessToken:n.token,refreshToken:r.token})}loginWithAuthTokens(e,t){return this.setTokens(e,t),{accessToken:e,refreshToken:t}}resetPassword(e){return this.callApi({endpoint:I.password.reset,method:`POST`,body:{email:e}})}async refresh(){let e=await this.callApi({endpoint:I.refreshAccessToken,method:`POST`,body:{refreshToken:this.refreshToken}});if(e.isErr())return E(e.error);let{accessToken:t,refreshToken:n}=e.value;return this.setTokens(t.token,n.token),T({accessToken:t.token,refreshToken:n.token})}async logout(){this.setTokens(null,null)}getAccessToken(){return this.accessToken}getRefreshToken(){return this.refreshToken}setTokens(e,t){if(this.accessToken!==e||this.refreshToken!==t){this.accessToken=e,this.refreshToken=t;let n=new CustomEvent(`auth:tokens-updated`,{detail:{accessToken:e,refreshToken:t}});this.dispatchEvent(n)}}async callApi(e){try{let{spotId:t,msApiBaseUrl:n}=yt.getConfiguration(),r=se(e.endpoint,n),i={"Content-Type":`application/json`,...e.headers};e.withSpotId&&t&&(i[Yt.SpotId]=t);let a=await fetch(r,{method:e.method,body:e.body?JSON.stringify(e.body):void 0,headers:i});return a.ok?a.status===D.NO_CONTENT?T(void 0):T(await a.json()):E(new N(a.status,a.statusText))}catch(e){return E(new N(D.INTERNAL_SERVER_ERROR,e instanceof Error?e.message:String(e)))}}},Yt=function(e){return e.Authorization=`Authorization`,e.SpotId=`x-spotid`,e}({}),Xt=class e{static getInstance(){return e.instance||=new e,e.instance}static buildAuthenticatedRequest(e){let{msApiBaseUrl:t,spotId:n}=yt.getConfiguration(),r=se(e,t),i=Jt.getInstance().getAccessToken();if(!i)return E(Error(`Not authenticated`));let a={"Content-Type":`application/json`,Authorization:`Bearer ${i}`};return n&&(a[`x-spotid`]=n),T({url:r,headers:a})}static async stream(t,n,r){let{streamTransport:i}=yt.getConfiguration();if(i)return i({endpoint:t,body:n,signal:r});let a=e.buildAuthenticatedRequest(t);if(a.isErr())return E(a.error);let{url:o,headers:s}=a.value;try{let e=await fetch(o,{method:`POST`,headers:s,...n===void 0?{}:{body:JSON.stringify(n)},...r?{signal:r}:{}});if(!e.ok){let t=await e.text();return E(Error(`HTTP ${e.status}: ${t}`))}return e.body?T(e.body):E(Error(`Response body is empty`))}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return E(e instanceof Error?e:Error(t))}}get pendingCount(){return this.queue.length}constructor(){this.queue=[],this.isProcessing=!1,this.isPaused=!1,this.authService=Jt.getInstance(),this.httpService=new F}enqueue(e){return new Promise(t=>{this.queue.push(async()=>{try{t(await e())}catch(e){t(E(new N(D.INTERNAL_SERVER_ERROR,e instanceof Error?e.message:`Unknown error`)))}}),this.processQueue()})}async processQueue(){if(!this.isProcessing){this.isProcessing=!0;try{for(;!this.isPaused&&this.queue.length>0;){let e=this.queue.shift();if(!e)break;await e()}}finally{this.isProcessing=!1,!this.isPaused&&this.queue.length>0&&Promise.resolve().then(()=>this.processQueue())}}}pauseQueue(){this.isPaused=!0}resumeQueue(){let e=this.isPaused;this.isPaused=!1,e&&this.processQueue()}async call(e){return this.enqueue(async()=>{let t=async()=>{let{spotId:t,msApiBaseUrl:n}=yt.getConfiguration(),r={...e.options?.headers??{}};t&&(r[`x-spotid`]=t);let i=this.authService.getAccessToken(),{requiresAuth:a=!0}=e;if(!i&&a)return E(new N(D.UNAUTHORIZED));i&&(r.Authorization=`Bearer ${i}`);let o=se(e.endpoint,n);switch(e.method){case P.DELETE:return this.httpService.delete({...e.options??{},headers:r,url:o});case P.GET:return this.httpService.get({...e.options??{},headers:r,url:o});case P.PATCH:return this.httpService.patch({...e.options??{},headers:r,url:o});case P.POST:return this.httpService.post({...e.options??{},headers:r,url:o});default:return E(new N(D.METHOD_NOT_ALLOWED,`Method not allowed`))}},n=await t();if(n.isErr()&&n.error.code===D.UNAUTHORIZED){let e=await this.authService.refresh();if(e.isErr())return E(new N(D.UNAUTHORIZED,e.error.message));n=await t()}return n})}},Zt={playbooks:`/v1/playbooks`,pages:e=>`/v1/playbooks/${e}/pages`,hotspots:(e,t)=>`/v1/playbooks/${e}/pages/${t}/hotspots`,hotspot:(e,t,n)=>`/v1/playbooks/${e}/pages/${t}/hotspots/${n}`,accessibleIntents:(e,t)=>`/v1/playbooks/${e}/pages/${t}/accessibleIntents`,intents:(e,t,n)=>`/v1/playbooks/${e}/pages/${t}/hotspots/${n}/intents`,intent:(e,t,n,r)=>`/v1/playbooks/${e}/pages/${t}/hotspots/${n}/intents/${r}`},Qt=50,$t=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async listPlaybooks(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.playbooks,options:{query:{page:e?.page??1,limit:e?.limit??Qt,...e?.domain?{"domain[eq]":e.domain}:{},...e?.host===void 0?{}:{"domain[matchesHost]":e.host}}}});return t.isErr()?E(t.error):T(t.value)}async listPlaybookPages(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.pages(e.playbookId),options:{query:{page:e.page??1,limit:e.limit??Qt,...e.url?{"url[eq]":e.url}:{}}}});return t.isErr()?E(t.error):T(t.value)}async createPlaybookPage(e,t){let n=await this.meltingSpotApi.call({method:P.POST,endpoint:Zt.pages(e.playbookId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}async listAccessiblePlaybookIntents(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.accessibleIntents(e.playbookId,e.pageId),options:{query:{...e.domain?{domain:e.domain}:{}}}});return t.isErr()?E(t.error):T(t.value)}async listPlaybookHotspots(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.hotspots(e.playbookId,e.pageId),options:{query:{page:e.page??1,limit:e.limit??Qt,...e.intentStatus?{"intentStatus[eq]":e.intentStatus}:{},...e.widgetType?{"widgetType[eq]":e.widgetType}:{}}}});return t.isErr()?E(t.error):T(t.value)}async createPlaybookHotspot(e,t){let n=await this.meltingSpotApi.call({method:P.POST,endpoint:Zt.hotspots(e.playbookId,e.pageId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}async updatePlaybookHotspot(e,t){let n=await this.meltingSpotApi.call({method:P.PATCH,endpoint:Zt.hotspot(e.playbookId,e.pageId,e.hotspotId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}async listPlaybookIntents(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:Zt.intents(e.playbookId,e.pageId,e.hotspotId),options:{query:{page:e.page??1,limit:e.limit??Qt,...e.status?{"status[eq]":e.status}:{}}}});return t.isErr()?E(t.error):T(t.value)}async createPlaybookIntent(e,t){let n=await this.meltingSpotApi.call({method:P.POST,endpoint:Zt.intents(e.playbookId,e.pageId,e.hotspotId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}async updatePlaybookIntent(e,t){let n=await this.meltingSpotApi.call({method:P.PATCH,endpoint:Zt.intent(e.playbookId,e.pageId,e.hotspotId,e.intentId),options:{payload:t}});return n.isErr()?E(n.error):T(n.value)}},L={me:`/v1/spots/me`},en=50,tn=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async listSpotsForMe(e){let t=await this.meltingSpotApi.call({method:P.GET,endpoint:L.me,options:{query:{page:1,limit:en,...e?.spotMemberRole?{"spotMemberRole[eq]":e.spotMemberRole}:{}}}});return t.isErr()?E(t.error):T(t.value)}},nn={spotMember:{me:`/v1/spotMembers/me`,joinFromSso:`/v1/spotMembers~joinFromSso`,search:`/v1/spotMembers~search`}},rn=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async getSpotMemberForMe(){let e=await this.meltingSpotApi.call({method:P.GET,endpoint:nn.spotMember.me});return e.isErr()?E(e.error):T(e.value)}async searchSpotMembers(e){let t={page:e.page,limit:e.limit};e.search&&(t.search=e.search);let n=await this.meltingSpotApi.call({method:P.GET,endpoint:nn.spotMember.search,options:{query:t}});return n.isErr()?E(n.error):T(n.value)}async joinFromSso(e){let t=await this.meltingSpotApi.call({method:P.POST,endpoint:nn.spotMember.joinFromSso,options:{payload:{token:e}}});return t.isErr()?E(t.error):T(t.value)}},R={spotMemberSsoToken:`/v1/spotMembers/auth/sso/jwt`,previewAccessKey:`/v1/spotMembers/auth/preview/accessKey`},an=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async generateSsoToken(){let e=await this.meltingSpotApi.call({method:P.POST,endpoint:R.spotMemberSsoToken,options:{payload:{}}});return e.isErr()?E(e.error):T(e.value.token)}async generatePreviewAccessKey(e){let t=await this.meltingSpotApi.call({method:P.POST,endpoint:R.previewAccessKey,options:{payload:{targetSpotMemberId:e.targetSpotMemberId}}});return t.isErr()?E(t.error):T(t.value)}},on=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.spotMemberAuthApiService=an.getInstance()}async generateSsoToken(){return this.spotMemberAuthApiService.generateSsoToken()}},sn=class{constructor(e){this.active=!1,this.lastObservedUrl=null,this.options={onRouteChange:e.onRouteChange,debounceMs:e.debounceMs??0,enableDeduplication:e.enableDeduplication??!0,enableDomMutationDetection:e.enableDomMutationDetection??!1,enableHistoryChange:e.enableHistoryChange??!0,enablePopState:e.enablePopState??!0,enableHashChange:e.enableHashChange??!0,enableLoad:e.enableLoad??!0,rootDocument:e.rootDocument}}start(){this.active||(this.active=!0,this.lastObservedUrl=null,this.options.enablePopState&&(this.popStateListener=()=>this.handleNavigationEvent(`popstate`),window.addEventListener(`popstate`,this.popStateListener)),this.options.enableHashChange&&(this.hashChangeListener=()=>this.handleNavigationEvent(`hashchange`),window.addEventListener(`hashchange`,this.hashChangeListener)),this.options.enableLoad&&(this.loadListener=()=>this.handleNavigationEvent(`load`),window.addEventListener(`load`,this.loadListener)),this.options.enableDomMutationDetection&&(this.mutationObserver=new MutationObserver(()=>{this.handleNavigationEvent(`locationchange`)}),this.mutationObserver.observe(this.options.rootDocument??document,{childList:!0,subtree:!0})),this.options.enableHistoryChange&&this.patchHistoryListeners())}stop(){this.active&&(this.active=!1,this.debounceTimer!==void 0&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.popStateListener&&=(window.removeEventListener(`popstate`,this.popStateListener),void 0),this.hashChangeListener&&=(window.removeEventListener(`hashchange`,this.hashChangeListener),void 0),this.loadListener&&=(window.removeEventListener(`load`,this.loadListener),void 0),this.mutationObserver&&=(this.mutationObserver.disconnect(),void 0),(this.originalPushState||this.originalReplaceState)&&this.restoreHistoryListeners(),this.lastObservedUrl=null)}handleNavigationEvent(e){if(!this.active)return;let t=window.location.href;this.options.enableDeduplication&&this.lastObservedUrl===t||(this.lastObservedUrl=t,this.options.debounceMs>0?(this.debounceTimer!==void 0&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=void 0,this.options.onRouteChange(t,e)},this.options.debounceMs)):this.options.onRouteChange(t,e))}patchHistoryListeners(){this.originalPushState=window.history.pushState,this.originalReplaceState=window.history.replaceState,window.history.pushState=(...e)=>{let t=this.originalPushState?.apply(window.history,e);return this.handleNavigationEvent(`history.pushState`),t},window.history.replaceState=(...e)=>{let t=this.originalReplaceState?.apply(window.history,e);return this.handleNavigationEvent(`history.replaceState`),t}}restoreHistoryListeners(){this.originalPushState&&=(window.history.pushState=this.originalPushState,void 0),this.originalReplaceState&&=(window.history.replaceState=this.originalReplaceState,void 0)}},cn={events:`/v1/analytics/events`},ln=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.meltingSpotApi=Xt.getInstance()}async appendEvent(e){let t=await this.meltingSpotApi.call({method:P.POST,endpoint:cn.events,options:{payload:e}});return t.isErr()?E(t.error):T(t.value)}},un=e=>{let t=e.get(`utm_source`);if(t)return{source:t,medium:e.get(`utm_medium`)??void 0,campaign:e.get(`utm_campaign`)??void 0,term:e.get(`utm_term`)??void 0,content:e.get(`utm_content`)??void 0}},dn=e=>e?Object.entries(e).reduce((e,[t,n])=>(n!=null&&(e[`utm_${t}`]=n),e),{}):{},fn=function(e){return e.Mute30Min=`Mute30Min`,e.Mute1Hour=`Mute1Hour`,e.Mute2Hours=`Mute2Hours`,e.UntilTomorrow=`UntilTomorrow`,e.UntilNextWeek=`UntilNextWeek`,e.Always=`Always`,e}({}),pn=function(e){return e.Active=`Active`,e.Closed=`Closed`,e.Expired=`Expired`,e}({}),mn=function(e){return e.User=`User`,e.Assistant=`Assistant`,e}({}),hn=function(e){return e.Metadata=`metadata`,e.Token=`token`,e.StatusLabel=`status_label`,e.ActionsPending=`actions_pending`,e.Action=`action`,e.Bubble=`bubble`,e.Handoff=`handoff`,e.Done=`done`,e.Error=`error`,e}({}),gn=function(e){return e.NoSource=`NoSource`,e.LowConfidence=`LowConfidence`,e.HumanRequest=`HumanRequest`,e.OutOfScope=`OutOfScope`,e}({}),_n=function(e){return e.PoorExplanation=`poor_explanation`,e.FalseInformation=`false_information`,e.NotFollowingRequest=`not_following_request`,e.IncompleteResponse=`incomplete_response`,e.ChatHistoryIssue=`chat_history_issue`,e.PersonalizationIssue=`personalization_issue`,e.Other=`other`,e}({}),vn=function(e){return e.Up=`up`,e.Down=`down`,e}({}),z=function(e){return e.PlaybookIntent=`PlaybookIntent`,e.UserInitiated=`UserInitiated`,e.Welcome=`Welcome`,e.Resume=`Resume`,e.Discover=`Discover`,e.Recommend=`Recommend`,e}({}),yn=function(e){return e.ExtraExtraSmall=`ExtraExtraSmall`,e.ExtraSmall=`ExtraSmall`,e.Small=`Small`,e.Medium=`Medium`,e.Large=`Large`,e}({}),bn=function(e){return e.Dropdown=`Dropdown`,e.Inline=`Inline`,e.Overlay=`Overlay`,e}({}),xn=function(e){return e.Left=`Left`,e.Right=`Right`,e}({}),Sn=function(e){return e.Top=`Top`,e.Bottom=`Bottom`,e}({}),Cn=function(e){return e.TopLeft=`TopLeft`,e.TopRight=`TopRight`,e.BottomLeft=`BottomLeft`,e.BottomRight=`BottomRight`,e}({}),wn=function(e){return e.Button=`Button`,e.Card=`Card`,e.CardInline=`CardInline`,e.Carousel=`Carousel`,e.Helper=`Helper`,e.ListOfContent=`ListOfContent`,e.ListOfContentInline=`ListOfContentInline`,e}({}),Tn=function(e){return e.Inline=`Inline`,e.Modal=`Modal`,e.Drawer=`Drawer`,e}({}),En=function(e){return e.Self=`Self`,e.Parent=`Parent`,e.Top=`Top`,e}({}),Dn=function(e){return e.Left=`Left`,e.Right=`Right`,e}({}),On=function(e){return e.Body=`Body`,e.DOMSelector=`DOMSelector`,e}({}),kn=function(e){return e.After=`After`,e.AppendChild=`AppendChild`,e.Before=`Before`,e.PrependChild=`PrependChild`,e}({}),An=function(e){return e.CSSSelector=`CSSSelector`,e.Slot=`Slot`,e}({}),jn=function(e){return e.Element=`Element`,e.WebComponent=`WebComponent`,e}({}),Mn=function(e){return e.Inline=`Inline`,e.Flex=`Flex`,e}({}),Nn=function(e){return e.Horizontal=`Horizontal`,e.Vertical=`Vertical`,e}({}),Pn=function(e){return e.Start=`Start`,e.Center=`Center`,e.End=`End`,e.Stretch=`Stretch`,e.Baseline=`Baseline`,e}({}),Fn=function(e){return e.Course=`Course`,e.Live=`Live`,e.Link=`Link`,e.Page=`Page`,e}({}),In=function(e){return e.Workshop=`Workshop`,e.Conference=`Conference`,e}({}),Ln=function(e){return e.Ended=`Ended`,e.Planned=`Planned`,e.Live=`Live`,e}({}),Rn=function(e){return e.Hours=`Hours`,e.Days=`Days`,e.Never=`Never`,e}({}),zn=function(e){return e.CloseA=`CloseA`,e.CloseB=`CloseB`,e.Later=`Later`,e}({}),Bn=function(e){return e.NoLimit=`NoLimit`,e.OnlyOnce=`OnlyOnce`,e.OncePerDays=`OncePerDays`,e.UntilContentCompletion=`UntilContentCompletion`,e}({}),Vn=`a`,Hn=`mention_input`,Un=`mention`,Wn=`var`,Gn=`p`,Kn=`h1`,qn=`h2`,Jn=`h3`,Yn=`blockquote`,Xn=`layout`,Zn=`layout-column`,Qn=`ul`,$n=`ol`,er=`lic`,tr=`li`,nr=`img`,rr=`iframely`,ir=`code_block`,ar=`code_line`,or=function(e){return e.Element=`Element`,e.FullPage=`FullPage`,e}({}),sr=function(e){return e.CustomText=`CustomText`,e.Hotspot=`Hotspot`,e.Url=`Url`,e}({}),cr=function(e){return e.Draft=`Draft`,e.Pending=`Pending`,e.Published=`Published`,e}({}),lr=function(e){return e.Beacon=`Beacon`,e.List=`List`,e}({}),ur=function(e){return e.Channel=`Channel`,e.Collection=`Collection`,e.Course=`Course`,e.Discussion=`Discussion`,e.Forum=`Forum`,e.Link=`Link`,e.Live=`Live`,e.LearningPath=`LearningPath`,e.Page=`Page`,e.RichText=`RichText`,e.Topic=`Topic`,e}({});function dr(e){return Object.values(ur).includes(e)}var fr=yt.getInstance(),pr=Jt.getInstance(),mr=on.getInstance(),hr={Playbook:$t.getInstance(),Spot:tn.getInstance(),SpotMember:rn.getInstance()},gr=globalThis;gr.MeltingSpot||={},gr.MeltingSpot.Configuration=fr,gr.MeltingSpot.Auth=pr,gr.MeltingSpot.Sso=mr,gr.MeltingSpot.Api=hr,e.ATTRIBUTE_BLOCKQUOTE=Yn,e.ATTRIBUTE_CODE_BLOCK=ir,e.ATTRIBUTE_CODE_LINE=ar,e.ATTRIBUTE_H1=Kn,e.ATTRIBUTE_H2=qn,e.ATTRIBUTE_H3=Jn,e.ATTRIBUTE_IFRAMELY=rr,e.ATTRIBUTE_IMAGE=nr,e.ATTRIBUTE_LAYOUT=Xn,e.ATTRIBUTE_LAYOUT_COLUMN=Zn,e.ATTRIBUTE_LI=tr,e.ATTRIBUTE_LIC=er,e.ATTRIBUTE_LINK=Vn,e.ATTRIBUTE_MENTION=Un,e.ATTRIBUTE_MENTION_INPUT=Hn,e.ATTRIBUTE_OL=$n,e.ATTRIBUTE_PARAGRAPH=Gn,e.ATTRIBUTE_UL=Qn,e.ATTRIBUTE_VARIABLE=Wn,e.AnalyticsApiService=ln,e.Api=hr,e.Auth=pr,e.AuthService=Jt,e.AuthServiceEvents=qt,e.BeaconIntegrationType=bn,e.BeaconRenderType=wn,e.ButtonBeaconSize=yn,e.CoachMutePreset=fn,e.Configuration=fr,e.ConfigurationService=yt,e.ConversationMessageRole=mn,e.ConversationSseEventType=hn,e.ConversationStatus=pn,e.DEFAULT_PERMISSION_POLICIES=ue,e.DateFormat=We,e.DisplayRuleTimeUnit=Rn,e.DrawerWidgetPosition=Dn,e.DropdownBeaconHorizontalPosition=xn,e.DropdownBeaconVerticalPosition=Sn,e.HttpError=N,e.HttpMethods=P,e.HttpService=F,e.LastActionState=zn,e.LearningPathContentType=Fn,e.LiveBuiltInType=In,e.LiveStatus=Ln,e.Logger=dt,e.MeltingSpotApi=Xt,e.MeltyHandoffReason=gn,e.MeltyMessageFeedbackReason=_n,e.MeltyMessageFeedbackSignal=vn,e.OverlayBeaconPosition=Cn,e.PLAYBOOK_EDITOR_ACTIVE_EVENT=at,e.PlaybookApiService=$t,e.PlaybookEditorAwareLifecycle=lt,e.PlaybookHotspotLocation=or,e.PlaybookIntentActionType=sr,e.PlaybookIntentStatus=cr,e.PlaybookIntentWidgetMode=lr,e.PlaybookPageMatchingOperator=Ke,e.RepetitionMode=Bn,e.RouteChangeDetector=sn,e.SpotMemberApiService=rn,e.SpotMemberAuthApiService=an,e.SpotWidgetContentType=ur,e.Sso=mr,e.SsoService=on,e.TouchPointAnchorType=On,e.TouchPointDOMInjectionPosition=kn,e.TouchPointDOMSelectorCssStepMode=jn,e.TouchPointDOMSelectorPathStepType=An,e.TouchPointFlexAlign=Pn,e.TouchPointFlexDirection=Nn,e.TouchPointLayoutType=Mn,e.TriggerType=z,e.WidgetInjectionTarget=En,e.WidgetInjectionType=Tn,e.createDialog=le,e.createIframe=de,e.createIsolatedShadowHost=fe,e.dayjs=Ee.default,e.flattenUtmParameters=dn,e.formatBaseUrl=_t,e.formatDate=Ge,e.formatDeeplink=gt,e.formatUUID=mt,e.getHTMLElement=ce,e.getTimeInfoWithStartAndEndDate=je,e.isEditorPauseExempt=k,e.isPlaybookEditorActive=st,e.isSpotWidgetContentType=dr,e.isTouchDevice=pe,e.matchesDomain=rt,e.parseUtmParameters=un,e.sanitizeUrl=se,e.setLoggerDebugMode=pt,e.testUrlMatching=tt,e.trimSlashLeft=ie,e.trimSlashRight=oe});
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "MeltingSpot Core SDK",
4
4
  "homepage": "https://meltingspot.io",
5
5
  "license": "BSD-3-Clause",
6
- "version": "1.12.0",
6
+ "version": "1.13.0",
7
7
  "main": "./index.umd.js",
8
8
  "module": "./index.mjs",
9
9
  "typings": "./index.d.ts",
@@ -5,6 +5,7 @@ import { Playbook } from '../../../types/widget/playbook/playbook';
5
5
  import { PlaybookHotspot } from '../../../types/widget/playbook/playbookHotspot';
6
6
  import { PlaybookHotspotLocation } from '../../../types/widget/playbook/playbookHotspotLocation';
7
7
  import { PlaybookIntent } from '../../../types/widget/playbook/playbookIntent';
8
+ import { PlaybookIntentActionSummary } from '../../../types/widget/playbook/playbookIntentActionSummary';
8
9
  import { PlaybookIntentWidgetMode } from '../../../types/widget/playbook/playbookIntentWidgetMode';
9
10
  import { PlaybookPage } from '../../../types/widget/playbook/playbookPage';
10
11
  export interface ListPlaybooksOutput {
@@ -51,6 +52,7 @@ export interface AccessiblePlaybookIntentCandidateOutput {
51
52
  mode: PlaybookIntentWidgetMode;
52
53
  widgetMetadata: WidgetContentMetadata[];
53
54
  displayConfig?: MeltyDisplayConfig;
55
+ action?: PlaybookIntentActionSummary;
54
56
  }
55
57
  export interface AccessiblePlaybookHotspotOutput {
56
58
  hotspotId: string;
@@ -33,5 +33,6 @@ export declare class HttpService {
33
33
  post<TResponse>(input: HttpPostInput): Promise<Result<TResponse, HttpError>>;
34
34
  delete<TResponse>(input: HttpDeleteInput): Promise<Result<TResponse, HttpError>>;
35
35
  patch<TResponse>(input: HttpPatchInput): Promise<Result<TResponse, HttpError>>;
36
+ private static parseBody;
36
37
  private serializeQuery;
37
38
  }
@@ -2,6 +2,7 @@ import { Nullable } from '../nullable';
2
2
  import { MeltyHandoffReason } from './meltyHandoffReason';
3
3
  import { MeltyMessageFeedbackReason } from './meltyMessageFeedbackReason';
4
4
  import { MeltyMessageFeedbackSignal } from './meltyMessageFeedbackSignal';
5
+ import { MessageIntentAction } from './messageIntentAction';
5
6
  import { RenderableWidgetAction } from './renderableWidgetAction';
6
7
  export interface ConversationMessage {
7
8
  id: string;
@@ -16,6 +17,7 @@ export interface ConversationMessage {
16
17
  reason?: Nullable<MeltyMessageFeedbackReason>;
17
18
  };
18
19
  feedbackEligible?: boolean;
20
+ intentAction?: MessageIntentAction;
19
21
  createdAt: string;
20
22
  }
21
23
  export declare enum ConversationMessageRole {
@@ -5,6 +5,7 @@ import { MeltyHandoffReason } from './meltyHandoffReason';
5
5
  import { MeltyMessageFeedbackReason } from './meltyMessageFeedbackReason';
6
6
  import { MeltyMessageFeedbackSignal } from './meltyMessageFeedbackSignal';
7
7
  import { MeltyWidgetAction } from './meltyWidgetAction';
8
+ import { MessageIntentAction } from './messageIntentAction';
8
9
  /**
9
10
  * Raw payload of GET /melty/conversations/:id/messages. It differs from the SDK
10
11
  * `Conversation`: the id is `conversationId`, and per-message widget actions are
@@ -20,6 +21,7 @@ export interface GetConversationMessageResponse {
20
21
  handoff?: {
21
22
  reason: MeltyHandoffReason;
22
23
  };
24
+ intentAction?: MessageIntentAction;
23
25
  }>;
24
26
  feedback?: {
25
27
  signal: MeltyMessageFeedbackSignal;
@@ -31,6 +33,7 @@ export interface GetConversationMessageResponse {
31
33
  export interface GetConversationMessagesResponse {
32
34
  conversationId: string;
33
35
  status: ConversationStatus;
36
+ intentId?: Nullable<string>;
34
37
  createdAt: string;
35
38
  messages: GetConversationMessageResponse[];
36
39
  }
@@ -9,6 +9,7 @@ export * from './meltyHandoffReason';
9
9
  export * from './meltyMessageFeedbackReason';
10
10
  export * from './meltyMessageFeedbackSignal';
11
11
  export * from './meltyWidgetAction';
12
+ export * from './messageIntentAction';
12
13
  export * from './renderableWidgetAction';
13
14
  export * from './proactiveCheckResponse';
14
15
  export * from './triggerType';
@@ -0,0 +1,10 @@
1
+ import { PlaybookIntentActionType } from '../widget/playbook/playbookIntentActionType';
2
+ export interface MessageIntentAction {
3
+ actionId: string;
4
+ intentId: string;
5
+ type: PlaybookIntentActionType;
6
+ targetHotspotId?: string;
7
+ url?: string;
8
+ openInNewTab?: boolean;
9
+ clickedAt?: string;
10
+ }
@@ -2,6 +2,8 @@ export * from './playbook';
2
2
  export * from './playbookHotspot';
3
3
  export * from './playbookHotspotLocation';
4
4
  export * from './playbookIntent';
5
+ export * from './playbookIntentActionSummary';
6
+ export * from './playbookIntentActionType';
5
7
  export * from './playbookIntentStatus';
6
8
  export * from './playbookIntentWidgetMode';
7
9
  export * from './playbookMatchingRules';
@@ -0,0 +1,6 @@
1
+ import { PlaybookIntentActionType } from './playbookIntentActionType';
2
+ export interface PlaybookIntentActionSummary {
3
+ id: string;
4
+ type: PlaybookIntentActionType;
5
+ targetHotspotId?: string;
6
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum PlaybookIntentActionType {
2
+ CustomText = "CustomText",
3
+ Hotspot = "Hotspot",
4
+ Url = "Url"
5
+ }