@servicenow/aiux 22.42.1 → 22.42.3

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.
@@ -1,12 +1,12 @@
1
- let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap,s=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(i&&void 0===e){let i=void 0!==t&&1===t.length;i&&(e=r.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(t,e))}return e}toString(){return this.cssText}},o=(e,...t)=>new s(1===e.length?e[0]:t.reduce((t,i,n)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[n+1],e[0]),e,n),a=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t,i="";for(let t of e.cssRules)i+=t.cssText;return new s("string"==typeof(t=i)?t:t+"",void 0,n)})(e):e,{is:l,defineProperty:c,getOwnPropertyDescriptor:d,getOwnPropertyNames:h,getOwnPropertySymbols:u,getPrototypeOf:p}=Object,v=globalThis,w=v.trustedTypes,g=w?w.emptyScript:"",f=v.reactiveElementPolyfillSupport,m={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},b=(e,t)=>!l(e,t),_={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:b};Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;let y=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,t);void 0!==n&&c(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){let{get:n,set:r}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,set(t){let s=n?.call(this);r?.call(this,t),this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=p(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...h(e),...u(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,i]of t)this.elementProperties.set(e,i)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let i of new Set(e.flat(1/0).reverse()))t.unshift(a(i));else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){let i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,n)=>{if(i)e.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let i of n){let n=document.createElement("style"),r=t.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,e.appendChild(n)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(void 0!==n&&!0===i.reflect){let r=(i.converter?.toAttribute!==void 0?i.converter:m).toAttribute(t,i.type);this._$Em=e,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(e,t){let i=this.constructor,n=i._$Eh.get(e);if(void 0!==n&&this._$Em!==n){let e=i.getPropertyOptions(n),r="function"==typeof e.converter?{fromAttribute:e.converter}:e.converter?.fromAttribute!==void 0?e.converter:m;this._$Em=n;let s=r.fromAttribute(t,e.type);this[n]=s??this._$Ej?.get(n)??s,this._$Em=null}}requestUpdate(e,t,i,n=!1,r){if(void 0!==e){let s=this.constructor;if(!1===n&&(r=this[e]),!(((i??=s.getPropertyOptions(e)).hasChanged??b)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:n,wrapped:r},s){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==r||void 0!==s)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===n&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,i]of e){let{wrapped:e}=i,n=this[t];!0!==e||this._$AL.has(t)||void 0===n||this.C(t,void 0,i,n)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};y.elementStyles=[],y.shadowRootOptions={mode:"open"},y.elementProperties=new Map,y.finalized=new Map,f?.({ReactiveElement:y}),(v.reactiveElementVersions??=[]).push("2.1.2");let x=globalThis,C=e=>e,E=x.trustedTypes,$=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,k="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+A,S=`<${I}>`,L=document,T=()=>L.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,R=`[
2
- \f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,N=/>/g,W=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,V=/"/g,H=/^(?:script|style|textarea|title)$/i,B=(e,...t)=>({_$litType$:1,strings:e,values:t}),j=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),G=new WeakMap,z=L.createTreeWalker(L,129);function X(e,t){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==$?$.createHTML(t):t}class q{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,s=0,o=e.length-1,a=this.parts,[l,c]=((e,t)=>{let i=e.length-1,n=[],r,s=2===t?"<svg>":3===t?"<math>":"",o=P;for(let t=0;t<i;t++){let i=e[t],a,l,c=-1,d=0;for(;d<i.length&&(o.lastIndex=d,null!==(l=o.exec(i)));)d=o.lastIndex,o===P?"!--"===l[1]?o=U:void 0!==l[1]?o=N:void 0!==l[2]?(H.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=W):void 0!==l[3]&&(o=W):o===W?">"===l[0]?(o=r??P,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?W:'"'===l[3]?V:M):o===V||o===M?o=W:o===U||o===N?o=P:(o=W,r=void 0);let h=o===W&&e[t+1].startsWith("/>")?" ":"";s+=o===P?i+S:c>=0?(n.push(a),i.slice(0,c)+k+i.slice(c)+A+h):i+A+(-2===c?t:h)}return[X(e,s+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]})(e,t);if(this.el=q.createElement(l,i),z.currentNode=this.el.content,2===t||3===t){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=z.nextNode())&&a.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(let e of n.getAttributeNames())if(e.endsWith(k)){let t=c[s++],i=n.getAttribute(e).split(A),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:r,name:o[2],strings:i,ctor:"."===o[1]?Y:"?"===o[1]?ee:"@"===o[1]?et:J}),n.removeAttribute(e)}else e.startsWith(A)&&(a.push({type:6,index:r}),n.removeAttribute(e));if(H.test(n.tagName)){let e=n.textContent.split(A),t=e.length-1;if(t>0){n.textContent=E?E.emptyScript:"";for(let i=0;i<t;i++)n.append(e[i],T()),z.nextNode(),a.push({type:2,index:++r});n.append(e[t],T())}}}else if(8===n.nodeType)if(n.data===I)a.push({type:2,index:r});else{let e=-1;for(;-1!==(e=n.data.indexOf(A,e+1));)a.push({type:7,index:r}),e+=A.length-1}r++}}static createElement(e,t){let i=L.createElement("template");return i.innerHTML=e,i}}function K(e,t,i=e,n){if(t===j)return t;let r=void 0!==n?i._$Co?.[n]:i._$Cl,s=O(t)?void 0:t._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),void 0===s?r=void 0:(r=new s(e))._$AT(e,i,n),void 0!==n?(i._$Co??=[])[n]=r:i._$Cl=r),void 0!==r&&(t=K(e,r._$AS(e,t.values),r,n)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,n=(e?.creationScope??L).importNode(t,!0);z.currentNode=n;let r=z.nextNode(),s=0,o=0,a=i[0];for(;void 0!==a;){if(s===a.index){let t;2===a.type?t=new Z(r,r.nextSibling,this,e):1===a.type?t=new a.ctor(r,a.name,a.strings,this,e):6===a.type&&(t=new ei(r,this,e)),this._$AV.push(t),a=i[++o]}s!==a?.index&&(r=z.nextNode(),s++)}return z.currentNode=L,n}p(e){let t=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Z{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){let i;O(e=K(this,e,t))?e===F||null==e||""===e?(this._$AH!==F&&this._$AR(),this._$AH=F):e!==this._$AH&&e!==j&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):D(i=e)||"function"==typeof i?.[Symbol.iterator]?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==F&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,n="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=q.createElement(X(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(t);else{let e=new Q(n,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new q(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,n=0;for(let r of e)n===t.length?t.push(i=new Z(this.O(T()),this.O(T()),this,this.options)):i=t[n],i._$AI(r),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=C(e).nextSibling;C(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,r){this.type=1,this._$AH=F,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=F}_$AI(e,t=this,i,n){let r=this.strings,s=!1;if(void 0===r)(s=!O(e=K(this,e,t,0))||e!==this._$AH&&e!==j)&&(this._$AH=e);else{let n,o,a=e;for(e=r[0],n=0;n<r.length-1;n++)(o=K(this,a[i+n],t,n))===j&&(o=this._$AH[n]),s||=!O(o)||o!==this._$AH[n],o===F?e=F:e!==F&&(e+=(o??"")+r[n+1]),this._$AH[n]=o}s&&!n&&this.j(e)}j(e){e===F?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Y extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===F?void 0:e}}class ee extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==F)}}class et extends J{constructor(e,t,i,n,r){super(e,t,i,n,r),this.type=5}_$AI(e,t=this){if((e=K(this,e,t,0)??F)===j)return;let i=this._$AH,n=e===F&&i!==F||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==F&&(i===F||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ei{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){K(this,e)}}let en=x.litHtmlPolyfillSupport;en?.(q,Z),(x.litHtmlVersions??=[]).push("3.3.2");let er=globalThis,es=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{let n=i?.renderBefore??t,r=n._$litPart$;if(void 0===r){let e=i?.renderBefore??null;n._$litPart$=r=new Z(t.insertBefore(T(),e),e,void 0,i??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return j}};es._$litElement$=!0,es.finalized=!0,er.litElementHydrateSupport?.({LitElement:es});let eo=er.litElementPolyfillSupport;eo?.({LitElement:es}),(er.litElementVersions??=[]).push("4.2.2");class ea extends es{connectedCallback(){super.connectedCallback(),function(e){if(typeof document>"u")return;let t=parseFloat(getComputedStyle(document.documentElement).fontSize);!Number.isFinite(t)||t<=0||16===Math.round(t)||e.style.setProperty("--aiex-rem-scale",String(16/t))}(this)}}let el={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:b};function ec(e){return(t,i)=>{let n;return"object"==typeof i?((e=el,t,i)=>{let{kind:n,metadata:r}=i,s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),s.set(i.name,e),"accessor"===n){let{name:n}=i;return{set(i){let r=t.get.call(this);t.set.call(this,i),this.requestUpdate(n,r,e,!0,i)},init(t){return void 0!==t&&this.C(n,void 0,e,t),t}}}if("setter"===n){let{name:n}=i;return function(i){let r=this[n];t.call(this,i),this.requestUpdate(n,r,e,!0,i)}}throw Error("Unsupported decorator location: "+n)})(e,t,i):(n=t.hasOwnProperty(i),t.constructor.createProperty(i,e),n?Object.getOwnPropertyDescriptor(t,i):void 0)}}function ed(e){return ec({...e,state:!0,attribute:!1})}function eh(e,t){return(t,i,n)=>{let r;return(r={get(){return this.renderRoot?.querySelector(e)??null}}).configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof i&&Object.defineProperty(t,i,r),r}}var eu,ep,ev,ew,eg,ef,em,eb,e_,ey,ex,eC,eE,e$,ek,eA,eI,eS,eL,eT,eO,eD,eR,eP,eU,eN,eW,eM,eV,eH,eB,ej,eF,eG,ez,eX,eq,eK,eQ,eZ,eJ,eY,e0,e2,e1,e3,e5,e6,e9,e8,e7,e4,te,tt,ti,tn,tr,ts,to,ta,tl,tc,td,th,tu,tp,tv,tw,tg,tf,tm,tb,t_,ty,tx,tC,tE,t$,tk,tA,tI,tS,tL,tT,tO,tD,tR,tP,tU,tN,tW,tM,tV,tH,tB,tj,tF,tG,tz,tX,tq,tK,tQ,tZ,tJ,tY,t0="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{};function t2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t1(){return ep?eu:(ep=1,eu=Array.isArray)}function t3(){if(ef)return eg;ef=1;var e=ew?ev:(ew=1,ev="object"==typeof t0&&t0&&t0.Object===Object&&t0),t="object"==typeof self&&self&&self.Object===Object&&self;return eg=e||t||Function("return this")()}function t5(){return eb?em:(eb=1,em=t3().Symbol)}function t6(){if(e$)return eE;e$=1;var e=t5(),t=function(){if(ey)return e_;ey=1;var e=t5(),t=Object.prototype,i=t.hasOwnProperty,n=t.toString,r=e?e.toStringTag:void 0;return e_=function(e){var t=i.call(e,r),s=e[r];try{e[r]=void 0;var o=!0}catch{}var a=n.call(e);return o&&(t?e[r]=s:delete e[r]),a}}(),i=function(){if(eC)return ex;eC=1;var e=Object.prototype.toString;return ex=function(t){return e.call(t)}}(),n=e?e.toStringTag:void 0;return eE=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":n&&n in Object(e)?t(e):i(e)}}function t9(){if(eS)return eI;eS=1;var e=t6(),t=eA?ek:(eA=1,ek=function(e){return null!=e&&"object"==typeof e});return eI=function(i){return"symbol"==typeof i||t(i)&&"[object Symbol]"==e(i)}}function t8(){return eD?eO:(eD=1,eO=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)})}function t7(){if(eX)return ez;eX=1;var e=function(){if(ej)return eB;ej=1;var e=function(){if(eP)return eR;eP=1;var e=t6(),t=t8();return eR=function(i){if(!t(i))return!1;var n=e(i);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}}(),t=function(){if(eM)return eW;eM=1;var e,t=eN?eU:(eN=1,eU=t3()["__core-js_shared__"]),i=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return eW=function(e){return!!i&&i in e}}(),i=t8(),n=function(){if(eH)return eV;eH=1;var e=Function.prototype.toString;return eV=function(t){if(null!=t){try{return e.call(t)}catch{}try{return t+""}catch{}}return""}}(),r=/^\[object .+?Constructor\]$/,s=Object.prototype,o=Function.prototype.toString,a=s.hasOwnProperty,l=RegExp("^"+o.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return eB=function(s){return!(!i(s)||t(s))&&(e(s)?l:r).test(n(s))}}(),t=eG?eF:(eG=1,eF=function(e,t){return e?.[t]});return ez=function(i,n){var r=t(i,n);return e(r)?r:void 0}}function t4(){return eK?eq:(eK=1,eq=t7()(Object,"create"))}function ie(){if(tn)return ti;tn=1;var e=tt?te:(tt=1,te=function(e,t){return e===t||e!=e&&t!=t});return ti=function(t,i){for(var n=t.length;n--;)if(e(t[n][0],i))return n;return -1}}function it(){if(ty)return t_;ty=1;var e=tb?tm:(tb=1,tm=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e});return t_=function(t,i){var n=t.__data__;return e(i)?n["string"==typeof i?"string":"hash"]:n.map}}let ii=t2(function(){if(tZ)return tQ;tZ=1;var e=function(){if(tK)return tq;tK=1;var e=function(){if(tG)return tF;tG=1;var e=t1(),t=function(){if(eT)return eL;eT=1;var e=t1(),t=t9(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return eL=function(r,s){if(e(r))return!1;var o=typeof r;return!!("number"==o||"symbol"==o||"boolean"==o||null==r||t(r))||n.test(r)||!i.test(r)||null!=s&&r in Object(s)}}(),i=function(){if(tN)return tU;tN=1;var e=function(){if(tP)return tR;tP=1;var e=function(){if(tD)return tO;tD=1;var e=function(){if(tT)return tL;tT=1;var e=function(){if(tf)return tg;tf=1;var e=function(){if(e8)return e9;e8=1;var e=function(){if(eZ)return eQ;eZ=1;var e=t4();return eQ=function(){this.__data__=e?e(null):{},this.size=0}}(),t=eY?eJ:(eY=1,eJ=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}),i=function(){if(e2)return e0;e2=1;var e=t4(),t=Object.prototype.hasOwnProperty;return e0=function(i){var n=this.__data__;if(e){var r=n[i];return"__lodash_hash_undefined__"===r?void 0:r}return t.call(n,i)?n[i]:void 0}}(),n=function(){if(e3)return e1;e3=1;var e=t4(),t=Object.prototype.hasOwnProperty;return e1=function(i){var n=this.__data__;return e?void 0!==n[i]:t.call(n,i)}}(),r=function(){if(e6)return e5;e6=1;var e=t4();return e5=function(t,i){var n=this.__data__;return this.size+=+!this.has(t),n[t]=e&&void 0===i?"__lodash_hash_undefined__":i,this}}();function s(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=i,s.prototype.has=n,s.prototype.set=r,e9=s}(),t=function(){if(tp)return tu;tp=1;var e=e4?e7:(e4=1,e7=function(){this.__data__=[],this.size=0}),t=function(){if(ts)return tr;ts=1;var e=ie(),t=Array.prototype.splice;return tr=function(i){var n=this.__data__,r=e(n,i);return!(r<0)&&(r==n.length-1?n.pop():t.call(n,r,1),--this.size,!0)}}(),i=function(){if(ta)return to;ta=1;var e=ie();return to=function(t){var i=this.__data__,n=e(i,t);return n<0?void 0:i[n][1]}}(),n=function(){if(tc)return tl;tc=1;var e=ie();return tl=function(t){return e(this.__data__,t)>-1}}(),r=function(){if(th)return td;th=1;var e=ie();return td=function(t,i){var n=this.__data__,r=e(n,t);return r<0?(++this.size,n.push([t,i])):n[r][1]=i,this}}();function s(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=i,s.prototype.has=n,s.prototype.set=r,tu=s}(),i=tw?tv:(tw=1,tv=t7()(t3(),"Map"));return tg=function(){this.size=0,this.__data__={hash:new e,map:new(i||t),string:new e}}}(),t=function(){if(tC)return tx;tC=1;var e=it();return tx=function(t){var i=e(this,t).delete(t);return this.size-=!!i,i}}(),i=function(){if(t$)return tE;t$=1;var e=it();return tE=function(t){return e(this,t).get(t)}}(),n=function(){if(tA)return tk;tA=1;var e=it();return tk=function(t){return e(this,t).has(t)}}(),r=function(){if(tS)return tI;tS=1;var e=it();return tI=function(t,i){var n=e(this,t),r=n.size;return n.set(t,i),this.size+=+(n.size!=r),this}}();function s(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=i,s.prototype.has=n,s.prototype.set=r,tL=s}();function t(i,n){if("function"!=typeof i||null!=n&&"function"!=typeof n)throw TypeError("Expected a function");var r=function(){var e=arguments,t=n?n.apply(this,e):e[0],s=r.cache;if(s.has(t))return s.get(t);var o=i.apply(this,e);return r.cache=s.set(t,o)||s,o};return r.cache=new(t.Cache||e),r}return t.Cache=e,tO=t}();return tR=function(t){var i=e(t,function(e){return 500===n.size&&n.clear(),e}),n=i.cache;return i}}(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;return tU=e(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(t,function(e,t,r,s){n.push(r?s.replace(i,"$1"):t||e)}),n})}(),n=function(){if(tj)return tB;tj=1;var e=function(){if(tH)return tV;tH=1;var e=t5(),t=tM?tW:(tM=1,tW=function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}),i=t1(),n=t9(),r=e?e.prototype:void 0,s=r?r.toString:void 0;return tV=function e(r){if("string"==typeof r)return r;if(i(r))return t(r,e)+"";if(n(r))return s?s.call(r):"";var o=r+"";return"0"==o&&1/r==-1/0?"-0":o}}();return tB=function(t){return null==t?"":e(t)}}();return tF=function(r,s){return e(r)?r:t(r,s)?[r]:i(n(r))}}(),t=function(){if(tX)return tz;tX=1;var e=t9();return tz=function(t){if("string"==typeof t||e(t))return t;var i=t+"";return"0"==i&&1/t==-1/0?"-0":i}}();return tq=function(i,n){n=e(n,i);for(var r=0,s=n.length;null!=i&&r<s;)i=i[t(n[r++])];return r&&r==s?i:void 0}}();return tQ=function(t,i,n){var r=null==t?void 0:e(t,i);return void 0===r?n:r}}()),ir=(e,t=null)=>ii(window,`ux_globals.sysprops['${e}']`,t),is=(e,{name:t="undefined",transform:i=e=>e})=>{let n=ii(window,`ux_globals.presource['${e}:${t}']`,{}),r=n;try{r="function"==typeof i?i(n):n}catch(e){console.error(e),r=n}return{name:t,initialState:r}},io=is("sn-workspace-header",{name:"wsUserData",transform:e=>ii(e,"data.GlideDomain_Query.user",{})});is("sn-workspace-content",{name:"agentRoles",transform:e=>ii(e,"data.GlideDomain_Query.user.roles",[])}),is("sn-workspace-header",{name:"wsConfigSysId",transform:e=>ii(e,["data","GlideRecord_Query","sys_aw_master_config","_results",0,"sys_id","value"],"")}),io.initialState.preferences;let ia="SHOW_INTERACTIVE_VIEW",il="CLOSE_INTERACTIVE_VIEW",ic="interactive-view:toggle",id="GLOBAL_NAVIGATION_REQUESTED",ih="NAV_ITEM_SELECTED",iu="POP_OUT_INTERACTIVE_VIEW",ip="BACK_INTERACTIVE_VIEW",iv="NAVIGATE_INTERACTIVE_VIEW",iw="NAVIGATE_RECORD_FROM_IV",ig="kb_view",im="WIDGET_FORM_DIRTY",ib="Leave without saving",i_="me_kb_view",iy="surf_kb_article",ix="kb_knowledge",iC="kb_article",iE="kb_article_view",i$="service_catalog",ik="va_sc_cat_item",iA="va_sc_cat_item_producer",iI="va_sc_cat_item_content",iS="nw_sc_cat_item",iL="nw_sc_cat_item_guide",iT="sc_cat_item",iO="com.glideapp.servicecatalog_category_view",iD="com.glideapp.servicecatalog_cat_item_view",iR="com.glideapp.servicecatalog_cat_item_guide_view",iP=[ix,ig,iC,iE,i_,iy],iU=[iT,iD,iR,ik,iA,iI,iS,iL,i$],iN="Open interactive view",iW="Close interactive view",iM={navigationOptions:{navigateExternal:!0},context:{experienceName:"Unified Navigation App",path:"now/nav/ui"},route:"search",fields:{globalSearchViewConfigId:"0f8b85d0c7922010099a308dc7c2606a"},params:{globalSearchDataConfigId:"6ebf8fe1531201107f03ddeeff7b122b",searchContext:"now/nav/ui"}},iV="aiel:sessionUpdated",iH=new Map,iB=()=>{};function ij(e,t,i,n){void 0!==n?e(`[${t}]`,i,n):e(`[${t}]`,i)}function iF(e){var t;let i,n=`AIEX:${e}`,r=iH.get(n);if(r)return r;let s=function(){if(!(typeof window>"u"))return window.AIEL?.logger}(),o=s?(i="function"==typeof(t=s.register(n)).record?t.record.bind(t):(e,i,n)=>{let r=t[e];"function"==typeof r&&r(i,n)},{name:n,debug:(e,t)=>i("debug",e,t),info:(e,t)=>{ij(console.log,n,e,t),i("info",e,t)},warn:(e,t)=>i("warn",e,t),error:(e,t)=>{ij(console.error,n,e,t),i("error",e,t)}}):{name:n,debug:iB,info:(e,t)=>ij(console.log,n,e,t),warn:iB,error:(e,t)=>ij(console.error,n,e,t)};return iH.set(n,o),o}let iG=iF("ChatLoader"),iz="aiex-lbf-client-loader";async function iX(){try{let e;return await (e=ir("com.glide.aiel_asset_server")||window.NOW?.aiel_asset_server||"",new Promise((t,i)=>{let n=`${e}/sncapps/nextwave/assets/lbf-chat-client.js`,r=new Date;r.setSeconds(0),r.setMilliseconds(0);let s=r.valueOf(),o=`${n}?v=${window?.ux_globals?.assetCacheBuster||s}`;if(document.getElementById(iz)){iG.warn("LBF Chat Client loader script called more than once"),t(!0);return}let a=document.createElement("script");a.src=o,a.async=!0,a.id=iz,a.type="module",a.onload=()=>{iG.info("LBF Chat Client loaded successfully"),t(!0)},a.onerror=()=>{i(Error(`Failed to load the LBF Chat Client script. ${o}`))},document.head.appendChild(a)}))}catch(e){return iG.error("Failed to load LBF Chat Client",e),!1}}let iq={},iK=e=>(...t)=>({_$litDirective$:e,values:t}),iQ=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},iZ=(e,t)=>{let i=e._$AN;if(void 0===i)return!1;for(let e of i)e._$AO?.(t,!1),iZ(e,t);return!0},iJ=e=>{let t,i;do{if(void 0===(t=e._$AM))break;(i=t._$AN).delete(e),e=t}while(i?.size===0)},iY=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),i1(t)}};function i0(e){void 0!==this._$AN?(iJ(this),this._$AM=e,iY(this)):this._$AM=e}function i2(e,t=!1,i=0){let n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(n))for(let e=i;e<n.length;e++)iZ(n[e],!1),iJ(n[e]);else null!=n&&(iZ(n,!1),iJ(n));else iZ(this,e)}let i1=e=>{2==e.type&&(e._$AP??=i2,e._$AQ??=i0)};class i3 extends iQ{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),iY(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(iZ(this,e),iJ(this))}setValue(e){if(void 0===this._$Ct.strings)this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}let i5=()=>new i6;class i6{}let i9=new WeakMap,i8=iK(class extends i3{render(e){return F}update(e,[t]){let i=t!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),F}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){let t=this.ht??globalThis,i=i9.get(t);void 0===i&&(i=new WeakMap,i9.set(t,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?i9.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),i7="INTERACTIVE_VIEW",i4="iframe-content-ready",ne=iF("InteractiveView");function nt(e){let{type:t}=e.detail;"SHOW_INTERACTIVE_HEADER"===t?ni.call(this,e.detail):ne.error(`Unknown event type: ${t}`)}function ni(e){let{headerHost:t}=e;t(this.interactiveViewSlot),this.filledInteractiveViewSlot=!0}class nn{constructor(e,t=!1,i){this.isHidden=!1,this.accumulatedDistance=0,this.debounceTimer=null,this.lastScrollTops=new WeakMap,this.suppressUntil=0,this.onScroll=null,this.target=e,this.useCapture=t,this.minHideHeadroom=i,this.boundHandleScroll=this.handleScroll.bind(this),e.addEventListener("scroll",this.boundHandleScroll,t)}getScrollTop(e){return"number"==typeof e.scrollTop?e.scrollTop:e.documentElement&&(e.documentElement.scrollTop||e.body?.scrollTop)||0}getScrollHeadroom(e){if("number"==typeof e.scrollHeight&&"number"==typeof e.clientHeight)return e.scrollHeight-e.clientHeight;if(e.documentElement){let t=e.documentElement;return(t.scrollHeight??0)-(t.clientHeight??0)}return 0}hide(e){if(void 0!==this.minHideHeadroom&&this.getScrollHeadroom(e)<=this.minHideHeadroom){this.clearDebounce(),this.accumulatedDistance=0;return}this.clearDebounce(),this.isHidden=!0,this.accumulatedDistance=0,this.suppressUntil=Date.now()+250,this.onScroll&&this.onScroll("down")}handleScroll(e){let t=e.target;if(!t)return;let i=this.getScrollTop(t);if(Date.now()<this.suppressUntil)return void this.lastScrollTops.set(t,i);let n=this.lastScrollTops.get(t)??i,r=i-n;if(this.lastScrollTops.set(t,i),0!==r){if((r>0?"down":"up")=="up")this.clearDebounce(),this.accumulatedDistance=0,this.isHidden&&(this.isHidden=!1,this.suppressUntil=Date.now()+250,this.onScroll&&this.onScroll("up"));else if(!this.isHidden){if(this.accumulatedDistance+=r,this.accumulatedDistance>=50)return void this.hide(t);this.clearDebounce(),this.debounceTimer=setTimeout(()=>this.hide(t),150)}}}clearDebounce(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}destroy(){this.target.removeEventListener("scroll",this.boundHandleScroll,this.useCapture),this.clearDebounce(),this.onScroll=null}}let nr=iK(class extends iQ{constructor(){super(...arguments),this.key=F}render(e,t){return this.key=e,t}update(e,[t,i]){return t!==this.key&&(((e,t=iq)=>e._$AH=t)(e),this.key=t),i}}),ns=iF("WaitForCustomElement");async function no(e,t=5e3){let i;if(customElements.get(e))return!0;try{return await Promise.race([customElements.whenDefined(e),new Promise((n,r)=>{i=window.setTimeout(()=>r(Error(`Timeout waiting for <${e}> after ${t}ms`)),t)})]),!0}catch(i){let t=i instanceof Error?i.message:String(i);return ns.error(`Failed to register widget '${e}': ${t}`),!1}finally{i&&clearTimeout(i)}}let na=["https:","http:","blob:"];var nl=Object.defineProperty,nc=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nl(t,i,s),s};let nd=new CSSStyleSheet;nd.replaceSync("*{box-sizing:border-box}:host{--border-color: #ddd;--btn-primary-bg: #007bff;--btn-primary-hover-bg: #0056b3;--btn-disabled-bg: #ccc;--text-primary: #333;--text-on-primary: white;display:flex;flex-direction:column;width:100%;height:100%}.not-supported{display:flex;justify-content:center;align-items:center}.attachment-container{display:flex;justify-content:center;overflow:auto}.csv-container{width:100%;height:100%;overflow:auto}.attachment-portrait{height:100%;display:block}.attachment-landscape{width:100%;display:block}.loading{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.pagination-controls{width:100%;height:10%;display:flex;justify-content:center;align-items:center;gap:calc(1rem * var(--aiex-rem-scale, 1));padding:calc(1rem * var(--aiex-rem-scale, 1));background-color:transparent;flex-shrink:0}.pagination-btn{padding:calc(.5rem * var(--aiex-rem-scale, 1)) calc(1rem * var(--aiex-rem-scale, 1));background-color:var(--btn-primary-bg);color:var(--text-on-primary);border:none;border-radius:4px;cursor:pointer;font-size:calc(.9rem * var(--aiex-rem-scale, 1));transition:background-color .2s}.pagination-btn:hover:not(:disabled){background-color:var(--btn-primary-hover-bg)}.pagination-btn:disabled{background-color:var(--btn-disabled-bg);cursor:not-allowed;opacity:.6}.page-indicator{font-size:calc(.9rem * var(--aiex-rem-scale, 1));color:var(--text-primary);font-weight:500}.spinner{animation:spin 1s linear infinite;width:calc(2rem * var(--aiex-rem-scale, 1));height:calc(2rem * var(--aiex-rem-scale, 1))}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}");class nh extends ea{constructor(){super(...arguments),this.isLoading=!0,this.notSupported=!1,this.currentPage=1,this.totalPages=1,this.isPortrait=!1,this.documentViewerTag="sn-document-viewer"}static{this.styles=[nd]}connectedCallback(){super.connectedCallback(),this.isLoading=!0,this.notSupported=!1,this.fetchAttachmentData()}updated(e){super.updated(e),e.has("widget")&&(this.isLoading=!0,this.notSupported=!1,this.fetchAttachmentData())}async fetchAttachmentData(){switch(this.csvMarkdown=void 0,this.plainText=void 0,this.renderURL=void 0,this.widget.mime_type){case"image/jpeg":case"image/jpg":case"image/png":this.fetchImageURL();break;case"application/pdf":this.fetchPDFURL();break;case"text/csv":case"text/plain":this.fetchTextBased();break;case"application/docx":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":this.fetchDocumentURL();break;default:this.isLoading=!1}}fetchDocumentURL(){try{let e=this.widget?.upload_url||null;if(!(e=>{if(!e)return!1;if(e.startsWith("/"))return!0;try{let t=new URL(e);return na.includes(t.protocol)}catch{return!1}})(e))return void console.error("Unsafe URL detected:",e);window.open(e,"_blank","noopener,noreferrer")}catch(e){console.error("Error opening document:",e)}finally{this.notSupported=!0,this.isLoading=!1}}async fetchImageURL(){let e=`${this.widget.sys_id||this.widget.id}.iix`,t=new Image;t.onload=()=>{this.isPortrait=t.naturalHeight>t.naturalWidth;let e=document.createElement("canvas");e.width=t.naturalWidth,e.height=t.naturalHeight,e.getContext("2d").drawImage(t,0,0),this.renderURL=e.toDataURL(),this.isLoading=!1},t.onerror=()=>{this.renderURL=e,this.isLoading=!1},t.src=e}async fetchPDFURL(){await no(this.documentViewerTag,2e3)||(this.notSupported=!0),this.isLoading=!1}async fetchTextBased(){try{let e=this.widget.sys_id||this.widget.id,t=await fetch(`sys_attachment.do?sys_id=${e}`).then(e=>e.text());"text/csv"===this.widget.mime_type?this.csvMarkdown=function(e){let t=function(e){let t=[],i=[],n="",r=!1,s=0,o=e.trim().replace(/\r\n|\r/g,`
1
+ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap,s=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(i&&void 0===e){let i=void 0!==t&&1===t.length;i&&(e=r.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(t,e))}return e}toString(){return this.cssText}},o=(e,...t)=>new s(1===e.length?e[0]:t.reduce((t,i,n)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[n+1],e[0]),e,n),a=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t,i="";for(let t of e.cssRules)i+=t.cssText;return new s("string"==typeof(t=i)?t:t+"",void 0,n)})(e):e,{is:l,defineProperty:c,getOwnPropertyDescriptor:d,getOwnPropertyNames:h,getOwnPropertySymbols:u,getPrototypeOf:p}=Object,v=globalThis,w=v.trustedTypes,g=w?w.emptyScript:"",f=v.reactiveElementPolyfillSupport,m={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},b=(e,t)=>!l(e,t),_={attribute:!0,type:String,converter:m,reflect:!1,useDefault:!1,hasChanged:b};Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;let y=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(e,i,t);void 0!==n&&c(this.prototype,e,n)}}static getPropertyDescriptor(e,t,i){let{get:n,set:r}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:n,set(t){let s=n?.call(this);r?.call(this,t),this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=p(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...h(e),...u(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,i]of t)this.elementProperties.set(e,i)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let i of new Set(e.flat(1/0).reverse()))t.unshift(a(i));else void 0!==e&&t.push(a(e));return t}static _$Eu(e,t){let i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,n)=>{if(i)e.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let i of n){let n=document.createElement("style"),r=t.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,e.appendChild(n)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){let i=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,i);if(void 0!==n&&!0===i.reflect){let r=(i.converter?.toAttribute!==void 0?i.converter:m).toAttribute(t,i.type);this._$Em=e,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(e,t){let i=this.constructor,n=i._$Eh.get(e);if(void 0!==n&&this._$Em!==n){let e=i.getPropertyOptions(n),r="function"==typeof e.converter?{fromAttribute:e.converter}:e.converter?.fromAttribute!==void 0?e.converter:m;this._$Em=n;let s=r.fromAttribute(t,e.type);this[n]=s??this._$Ej?.get(n)??s,this._$Em=null}}requestUpdate(e,t,i,n=!1,r){if(void 0!==e){let s=this.constructor;if(!1===n&&(r=this[e]),!(((i??=s.getPropertyOptions(e)).hasChanged??b)(r,t)||i.useDefault&&i.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:n,wrapped:r},s){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==r||void 0!==s)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===n&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,i]of e){let{wrapped:e}=i,n=this[t];!0!==e||this._$AL.has(t)||void 0===n||this.C(t,void 0,i,n)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};y.elementStyles=[],y.shadowRootOptions={mode:"open"},y.elementProperties=new Map,y.finalized=new Map,f?.({ReactiveElement:y}),(v.reactiveElementVersions??=[]).push("2.1.2");let x=globalThis,C=e=>e,E=x.trustedTypes,$=E?E.createPolicy("lit-html",{createHTML:e=>e}):void 0,k="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,I="?"+A,S=`<${I}>`,L=document,T=()=>L.createComment(""),O=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,P=`[
2
+ \f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,N=/>/g,M=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),W=/'/g,V=/"/g,H=/^(?:script|style|textarea|title)$/i,B=(e,...t)=>({_$litType$:1,strings:e,values:t}),j=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),G=new WeakMap,z=L.createTreeWalker(L,129);function X(e,t){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==$?$.createHTML(t):t}class q{constructor({strings:e,_$litType$:t},i){let n;this.parts=[];let r=0,s=0,o=e.length-1,a=this.parts,[l,c]=((e,t)=>{let i=e.length-1,n=[],r,s=2===t?"<svg>":3===t?"<math>":"",o=R;for(let t=0;t<i;t++){let i=e[t],a,l,c=-1,d=0;for(;d<i.length&&(o.lastIndex=d,null!==(l=o.exec(i)));)d=o.lastIndex,o===R?"!--"===l[1]?o=U:void 0!==l[1]?o=N:void 0!==l[2]?(H.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=M):void 0!==l[3]&&(o=M):o===M?">"===l[0]?(o=r??R,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?M:'"'===l[3]?V:W):o===V||o===W?o=M:o===U||o===N?o=R:(o=M,r=void 0);let h=o===M&&e[t+1].startsWith("/>")?" ":"";s+=o===R?i+S:c>=0?(n.push(a),i.slice(0,c)+k+i.slice(c)+A+h):i+A+(-2===c?t:h)}return[X(e,s+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),n]})(e,t);if(this.el=q.createElement(l,i),z.currentNode=this.el.content,2===t||3===t){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(n=z.nextNode())&&a.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(let e of n.getAttributeNames())if(e.endsWith(k)){let t=c[s++],i=n.getAttribute(e).split(A),o=/([.?@])?(.*)/.exec(t);a.push({type:1,index:r,name:o[2],strings:i,ctor:"."===o[1]?Y:"?"===o[1]?ee:"@"===o[1]?et:J}),n.removeAttribute(e)}else e.startsWith(A)&&(a.push({type:6,index:r}),n.removeAttribute(e));if(H.test(n.tagName)){let e=n.textContent.split(A),t=e.length-1;if(t>0){n.textContent=E?E.emptyScript:"";for(let i=0;i<t;i++)n.append(e[i],T()),z.nextNode(),a.push({type:2,index:++r});n.append(e[t],T())}}}else if(8===n.nodeType)if(n.data===I)a.push({type:2,index:r});else{let e=-1;for(;-1!==(e=n.data.indexOf(A,e+1));)a.push({type:7,index:r}),e+=A.length-1}r++}}static createElement(e,t){let i=L.createElement("template");return i.innerHTML=e,i}}function K(e,t,i=e,n){if(t===j)return t;let r=void 0!==n?i._$Co?.[n]:i._$Cl,s=O(t)?void 0:t._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),void 0===s?r=void 0:(r=new s(e))._$AT(e,i,n),void 0!==n?(i._$Co??=[])[n]=r:i._$Cl=r),void 0!==r&&(t=K(e,r._$AS(e,t.values),r,n)),t}class Q{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,n=(e?.creationScope??L).importNode(t,!0);z.currentNode=n;let r=z.nextNode(),s=0,o=0,a=i[0];for(;void 0!==a;){if(s===a.index){let t;2===a.type?t=new Z(r,r.nextSibling,this,e):1===a.type?t=new a.ctor(r,a.name,a.strings,this,e):6===a.type&&(t=new ei(r,this,e)),this._$AV.push(t),a=i[++o]}s!==a?.index&&(r=z.nextNode(),s++)}return z.currentNode=L,n}p(e){let t=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class Z{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,n){this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){let i;O(e=K(this,e,t))?e===F||null==e||""===e?(this._$AH!==F&&this._$AR(),this._$AH=F):e!==this._$AH&&e!==j&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):D(i=e)||"function"==typeof i?.[Symbol.iterator]?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==F&&O(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,n="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=q.createElement(X(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(t);else{let e=new Q(n,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=G.get(e.strings);return void 0===t&&G.set(e.strings,t=new q(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,n=0;for(let r of e)n===t.length?t.push(i=new Z(this.O(T()),this.O(T()),this,this.options)):i=t[n],i._$AI(r),n++;n<t.length&&(this._$AR(i&&i._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=C(e).nextSibling;C(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class J{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,n,r){this.type=1,this._$AH=F,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=F}_$AI(e,t=this,i,n){let r=this.strings,s=!1;if(void 0===r)(s=!O(e=K(this,e,t,0))||e!==this._$AH&&e!==j)&&(this._$AH=e);else{let n,o,a=e;for(e=r[0],n=0;n<r.length-1;n++)(o=K(this,a[i+n],t,n))===j&&(o=this._$AH[n]),s||=!O(o)||o!==this._$AH[n],o===F?e=F:e!==F&&(e+=(o??"")+r[n+1]),this._$AH[n]=o}s&&!n&&this.j(e)}j(e){e===F?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Y extends J{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===F?void 0:e}}class ee extends J{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==F)}}class et extends J{constructor(e,t,i,n,r){super(e,t,i,n,r),this.type=5}_$AI(e,t=this){if((e=K(this,e,t,0)??F)===j)return;let i=this._$AH,n=e===F&&i!==F||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==F&&(i===F||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ei{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){K(this,e)}}let en=x.litHtmlPolyfillSupport;en?.(q,Z),(x.litHtmlVersions??=[]).push("3.3.2");let er=globalThis,es=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,i)=>{let n=i?.renderBefore??t,r=n._$litPart$;if(void 0===r){let e=i?.renderBefore??null;n._$litPart$=r=new Z(t.insertBefore(T(),e),e,void 0,i??{})}return r._$AI(e),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return j}};es._$litElement$=!0,es.finalized=!0,er.litElementHydrateSupport?.({LitElement:es});let eo=er.litElementPolyfillSupport;eo?.({LitElement:es}),(er.litElementVersions??=[]).push("4.2.2");class ea extends es{connectedCallback(){super.connectedCallback(),function(e){if(typeof document>"u")return;let t=parseFloat(getComputedStyle(document.documentElement).fontSize);!Number.isFinite(t)||t<=0||16===Math.round(t)||e.style.setProperty("--aiex-rem-scale",String(16/t))}(this)}}let el={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:b};function ec(e){return(t,i)=>{let n;return"object"==typeof i?((e=el,t,i)=>{let{kind:n,metadata:r}=i,s=globalThis.litPropertyMetadata.get(r);if(void 0===s&&globalThis.litPropertyMetadata.set(r,s=new Map),"setter"===n&&((e=Object.create(e)).wrapped=!0),s.set(i.name,e),"accessor"===n){let{name:n}=i;return{set(i){let r=t.get.call(this);t.set.call(this,i),this.requestUpdate(n,r,e,!0,i)},init(t){return void 0!==t&&this.C(n,void 0,e,t),t}}}if("setter"===n){let{name:n}=i;return function(i){let r=this[n];t.call(this,i),this.requestUpdate(n,r,e,!0,i)}}throw Error("Unsupported decorator location: "+n)})(e,t,i):(n=t.hasOwnProperty(i),t.constructor.createProperty(i,e),n?Object.getOwnPropertyDescriptor(t,i):void 0)}}function ed(e){return ec({...e,state:!0,attribute:!1})}function eh(e,t){return(t,i,n)=>{let r;return(r={get(){return this.renderRoot?.querySelector(e)??null}}).configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof i&&Object.defineProperty(t,i,r),r}}var eu,ep,ev,ew,eg,ef,em,eb,e_,ey,ex,eC,eE,e$,ek,eA,eI,eS,eL,eT,eO,eD,eP,eR,eU,eN,eM,eW,eV,eH,eB,ej,eF,eG,ez,eX,eq,eK,eQ,eZ,eJ,eY,e0,e2,e1,e3,e5,e6,e9,e8,e7,e4,te,tt,ti,tn,tr,ts,to,ta,tl,tc,td,th,tu,tp,tv,tw,tg,tf,tm,tb,t_,ty,tx,tC,tE,t$,tk,tA,tI,tS,tL,tT,tO,tD,tP,tR,tU,tN,tM,tW,tV,tH,tB,tj,tF,tG,tz,tX,tq,tK,tQ,tZ,tJ,tY,t0="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{};function t2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t1(){return ep?eu:(ep=1,eu=Array.isArray)}function t3(){if(ef)return eg;ef=1;var e=ew?ev:(ew=1,ev="object"==typeof t0&&t0&&t0.Object===Object&&t0),t="object"==typeof self&&self&&self.Object===Object&&self;return eg=e||t||Function("return this")()}function t5(){return eb?em:(eb=1,em=t3().Symbol)}function t6(){if(e$)return eE;e$=1;var e=t5(),t=function(){if(ey)return e_;ey=1;var e=t5(),t=Object.prototype,i=t.hasOwnProperty,n=t.toString,r=e?e.toStringTag:void 0;return e_=function(e){var t=i.call(e,r),s=e[r];try{e[r]=void 0;var o=!0}catch{}var a=n.call(e);return o&&(t?e[r]=s:delete e[r]),a}}(),i=function(){if(eC)return ex;eC=1;var e=Object.prototype.toString;return ex=function(t){return e.call(t)}}(),n=e?e.toStringTag:void 0;return eE=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":n&&n in Object(e)?t(e):i(e)}}function t9(){if(eS)return eI;eS=1;var e=t6(),t=eA?ek:(eA=1,ek=function(e){return null!=e&&"object"==typeof e});return eI=function(i){return"symbol"==typeof i||t(i)&&"[object Symbol]"==e(i)}}function t8(){return eD?eO:(eD=1,eO=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)})}function t7(){if(eX)return ez;eX=1;var e=function(){if(ej)return eB;ej=1;var e=function(){if(eR)return eP;eR=1;var e=t6(),t=t8();return eP=function(i){if(!t(i))return!1;var n=e(i);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}}(),t=function(){if(eW)return eM;eW=1;var e,t=eN?eU:(eN=1,eU=t3()["__core-js_shared__"]),i=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return eM=function(e){return!!i&&i in e}}(),i=t8(),n=function(){if(eH)return eV;eH=1;var e=Function.prototype.toString;return eV=function(t){if(null!=t){try{return e.call(t)}catch{}try{return t+""}catch{}}return""}}(),r=/^\[object .+?Constructor\]$/,s=Object.prototype,o=Function.prototype.toString,a=s.hasOwnProperty,l=RegExp("^"+o.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return eB=function(s){return!(!i(s)||t(s))&&(e(s)?l:r).test(n(s))}}(),t=eG?eF:(eG=1,eF=function(e,t){return e?.[t]});return ez=function(i,n){var r=t(i,n);return e(r)?r:void 0}}function t4(){return eK?eq:(eK=1,eq=t7()(Object,"create"))}function ie(){if(tn)return ti;tn=1;var e=tt?te:(tt=1,te=function(e,t){return e===t||e!=e&&t!=t});return ti=function(t,i){for(var n=t.length;n--;)if(e(t[n][0],i))return n;return -1}}function it(){if(ty)return t_;ty=1;var e=tb?tm:(tb=1,tm=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e});return t_=function(t,i){var n=t.__data__;return e(i)?n["string"==typeof i?"string":"hash"]:n.map}}let ii=t2(function(){if(tZ)return tQ;tZ=1;var e=function(){if(tK)return tq;tK=1;var e=function(){if(tG)return tF;tG=1;var e=t1(),t=function(){if(eT)return eL;eT=1;var e=t1(),t=t9(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return eL=function(r,s){if(e(r))return!1;var o=typeof r;return!!("number"==o||"symbol"==o||"boolean"==o||null==r||t(r))||n.test(r)||!i.test(r)||null!=s&&r in Object(s)}}(),i=function(){if(tN)return tU;tN=1;var e=function(){if(tR)return tP;tR=1;var e=function(){if(tD)return tO;tD=1;var e=function(){if(tT)return tL;tT=1;var e=function(){if(tf)return tg;tf=1;var e=function(){if(e8)return e9;e8=1;var e=function(){if(eZ)return eQ;eZ=1;var e=t4();return eQ=function(){this.__data__=e?e(null):{},this.size=0}}(),t=eY?eJ:(eY=1,eJ=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t}),i=function(){if(e2)return e0;e2=1;var e=t4(),t=Object.prototype.hasOwnProperty;return e0=function(i){var n=this.__data__;if(e){var r=n[i];return"__lodash_hash_undefined__"===r?void 0:r}return t.call(n,i)?n[i]:void 0}}(),n=function(){if(e3)return e1;e3=1;var e=t4(),t=Object.prototype.hasOwnProperty;return e1=function(i){var n=this.__data__;return e?void 0!==n[i]:t.call(n,i)}}(),r=function(){if(e6)return e5;e6=1;var e=t4();return e5=function(t,i){var n=this.__data__;return this.size+=+!this.has(t),n[t]=e&&void 0===i?"__lodash_hash_undefined__":i,this}}();function s(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=i,s.prototype.has=n,s.prototype.set=r,e9=s}(),t=function(){if(tp)return tu;tp=1;var e=e4?e7:(e4=1,e7=function(){this.__data__=[],this.size=0}),t=function(){if(ts)return tr;ts=1;var e=ie(),t=Array.prototype.splice;return tr=function(i){var n=this.__data__,r=e(n,i);return!(r<0)&&(r==n.length-1?n.pop():t.call(n,r,1),--this.size,!0)}}(),i=function(){if(ta)return to;ta=1;var e=ie();return to=function(t){var i=this.__data__,n=e(i,t);return n<0?void 0:i[n][1]}}(),n=function(){if(tc)return tl;tc=1;var e=ie();return tl=function(t){return e(this.__data__,t)>-1}}(),r=function(){if(th)return td;th=1;var e=ie();return td=function(t,i){var n=this.__data__,r=e(n,t);return r<0?(++this.size,n.push([t,i])):n[r][1]=i,this}}();function s(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=i,s.prototype.has=n,s.prototype.set=r,tu=s}(),i=tw?tv:(tw=1,tv=t7()(t3(),"Map"));return tg=function(){this.size=0,this.__data__={hash:new e,map:new(i||t),string:new e}}}(),t=function(){if(tC)return tx;tC=1;var e=it();return tx=function(t){var i=e(this,t).delete(t);return this.size-=!!i,i}}(),i=function(){if(t$)return tE;t$=1;var e=it();return tE=function(t){return e(this,t).get(t)}}(),n=function(){if(tA)return tk;tA=1;var e=it();return tk=function(t){return e(this,t).has(t)}}(),r=function(){if(tS)return tI;tS=1;var e=it();return tI=function(t,i){var n=e(this,t),r=n.size;return n.set(t,i),this.size+=+(n.size!=r),this}}();function s(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=i,s.prototype.has=n,s.prototype.set=r,tL=s}();function t(i,n){if("function"!=typeof i||null!=n&&"function"!=typeof n)throw TypeError("Expected a function");var r=function(){var e=arguments,t=n?n.apply(this,e):e[0],s=r.cache;if(s.has(t))return s.get(t);var o=i.apply(this,e);return r.cache=s.set(t,o)||s,o};return r.cache=new(t.Cache||e),r}return t.Cache=e,tO=t}();return tP=function(t){var i=e(t,function(e){return 500===n.size&&n.clear(),e}),n=i.cache;return i}}(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;return tU=e(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(t,function(e,t,r,s){n.push(r?s.replace(i,"$1"):t||e)}),n})}(),n=function(){if(tj)return tB;tj=1;var e=function(){if(tH)return tV;tH=1;var e=t5(),t=tW?tM:(tW=1,tM=function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}),i=t1(),n=t9(),r=e?e.prototype:void 0,s=r?r.toString:void 0;return tV=function e(r){if("string"==typeof r)return r;if(i(r))return t(r,e)+"";if(n(r))return s?s.call(r):"";var o=r+"";return"0"==o&&1/r==-1/0?"-0":o}}();return tB=function(t){return null==t?"":e(t)}}();return tF=function(r,s){return e(r)?r:t(r,s)?[r]:i(n(r))}}(),t=function(){if(tX)return tz;tX=1;var e=t9();return tz=function(t){if("string"==typeof t||e(t))return t;var i=t+"";return"0"==i&&1/t==-1/0?"-0":i}}();return tq=function(i,n){n=e(n,i);for(var r=0,s=n.length;null!=i&&r<s;)i=i[t(n[r++])];return r&&r==s?i:void 0}}();return tQ=function(t,i,n){var r=null==t?void 0:e(t,i);return void 0===r?n:r}}()),ir=(e,t=null)=>ii(window,`ux_globals.sysprops['${e}']`,t),is=(e,{name:t="undefined",transform:i=e=>e})=>{let n=ii(window,`ux_globals.presource['${e}:${t}']`,{}),r=n;try{r="function"==typeof i?i(n):n}catch(e){console.error(e),r=n}return{name:t,initialState:r}},io=is("sn-workspace-header",{name:"wsUserData",transform:e=>ii(e,"data.GlideDomain_Query.user",{})});is("sn-workspace-content",{name:"agentRoles",transform:e=>ii(e,"data.GlideDomain_Query.user.roles",[])}),is("sn-workspace-header",{name:"wsConfigSysId",transform:e=>ii(e,["data","GlideRecord_Query","sys_aw_master_config","_results",0,"sys_id","value"],"")}),io.initialState.preferences;let ia="SHOW_INTERACTIVE_VIEW",il="CLOSE_INTERACTIVE_VIEW",ic="interactive-view:toggle",id="GLOBAL_NAVIGATION_REQUESTED",ih="NAV_ITEM_SELECTED",iu="POP_OUT_INTERACTIVE_VIEW",ip="BACK_INTERACTIVE_VIEW",iv="NAVIGATE_INTERACTIVE_VIEW",iw="NAVIGATE_RECORD_FROM_IV",ig="kb_view",im="WIDGET_FORM_DIRTY",ib="Leave without saving",i_="me_kb_view",iy="surf_kb_article",ix="kb_knowledge",iC="kb_article",iE="kb_article_view",i$="service_catalog",ik="va_sc_cat_item",iA="va_sc_cat_item_producer",iI="va_sc_cat_item_content",iS="nw_sc_cat_item",iL="nw_sc_cat_item_guide",iT="sc_cat_item",iO="com.glideapp.servicecatalog_category_view",iD="com.glideapp.servicecatalog_cat_item_view",iP="com.glideapp.servicecatalog_cat_item_guide_view",iR=[ix,ig,iC,iE,i_,iy],iU=[iT,iD,iP,ik,iA,iI,iS,iL,i$],iN="Open interactive view",iM="Close interactive view",iW={navigationOptions:{navigateExternal:!0},context:{experienceName:"Unified Navigation App",path:"now/nav/ui"},route:"search",fields:{globalSearchViewConfigId:"0f8b85d0c7922010099a308dc7c2606a"},params:{globalSearchDataConfigId:"6ebf8fe1531201107f03ddeeff7b122b",searchContext:"now/nav/ui"}},iV="aiel:sessionUpdated",iH=new Map,iB=()=>{};function ij(e,t,i,n){void 0!==n?e(`[${t}]`,i,n):e(`[${t}]`,i)}function iF(e){var t;let i,n=`AIEX:${e}`,r=iH.get(n);if(r)return r;let s=function(){if(!(typeof window>"u"))return window.AIEL?.logger}(),o=s?(i="function"==typeof(t=s.register(n)).record?t.record.bind(t):(e,i,n)=>{let r=t[e];"function"==typeof r&&r(i,n)},{name:n,debug:(e,t)=>i("debug",e,t),info:(e,t)=>{ij(console.log,n,e,t),i("info",e,t)},warn:(e,t)=>i("warn",e,t),error:(e,t)=>{ij(console.error,n,e,t),i("error",e,t)}}):{name:n,debug:iB,info:(e,t)=>ij(console.log,n,e,t),warn:iB,error:(e,t)=>ij(console.error,n,e,t)};return iH.set(n,o),o}let iG=iF("ChatLoader"),iz="aiex-lbf-client-loader";async function iX(){try{let e;return await (e=ir("com.glide.aiel_asset_server")||window.NOW?.aiel_asset_server||"",new Promise((t,i)=>{let n=`${e}/sncapps/nextwave/assets/lbf-chat-client.js`,r=new Date;r.setSeconds(0),r.setMilliseconds(0);let s=r.valueOf(),o=`${n}?v=${window?.ux_globals?.assetCacheBuster||s}`;if(document.getElementById(iz)){iG.warn("LBF Chat Client loader script called more than once"),t(!0);return}let a=document.createElement("script");a.src=o,a.async=!0,a.id=iz,a.type="module",a.onload=()=>{iG.info("LBF Chat Client loaded successfully"),t(!0)},a.onerror=()=>{i(Error(`Failed to load the LBF Chat Client script. ${o}`))},document.head.appendChild(a)}))}catch(e){return iG.error("Failed to load LBF Chat Client",e),!1}}let iq={},iK=e=>(...t)=>({_$litDirective$:e,values:t}),iQ=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},iZ=(e,t)=>{let i=e._$AN;if(void 0===i)return!1;for(let e of i)e._$AO?.(t,!1),iZ(e,t);return!0},iJ=e=>{let t,i;do{if(void 0===(t=e._$AM))break;(i=t._$AN).delete(e),e=t}while(i?.size===0)},iY=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),i1(t)}};function i0(e){void 0!==this._$AN?(iJ(this),this._$AM=e,iY(this)):this._$AM=e}function i2(e,t=!1,i=0){let n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(n))for(let e=i;e<n.length;e++)iZ(n[e],!1),iJ(n[e]);else null!=n&&(iZ(n,!1),iJ(n));else iZ(this,e)}let i1=e=>{2==e.type&&(e._$AP??=i2,e._$AQ??=i0)};class i3 extends iQ{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),iY(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(iZ(this,e),iJ(this))}setValue(e){if(void 0===this._$Ct.strings)this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}let i5=()=>new i6;class i6{}let i9=new WeakMap,i8=iK(class extends i3{render(e){return F}update(e,[t]){let i=t!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),F}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){let t=this.ht??globalThis,i=i9.get(t);void 0===i&&(i=new WeakMap,i9.set(t,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?i9.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),i7="INTERACTIVE_VIEW",i4="iframe-content-ready",ne=iF("InteractiveView");function nt(e){let{type:t}=e.detail;"SHOW_INTERACTIVE_HEADER"===t?ni.call(this,e.detail):ne.error(`Unknown event type: ${t}`)}function ni(e){let{headerHost:t}=e;t(this.interactiveViewSlot),this.filledInteractiveViewSlot=!0}class nn{constructor(e,t=!1,i){this.isHidden=!1,this.accumulatedDistance=0,this.debounceTimer=null,this.lastScrollTops=new WeakMap,this.suppressUntil=0,this.onScroll=null,this.target=e,this.useCapture=t,this.minHideHeadroom=i,this.boundHandleScroll=this.handleScroll.bind(this),e.addEventListener("scroll",this.boundHandleScroll,t)}getScrollTop(e){return"number"==typeof e.scrollTop?e.scrollTop:e.documentElement&&(e.documentElement.scrollTop||e.body?.scrollTop)||0}getScrollHeadroom(e){if("number"==typeof e.scrollHeight&&"number"==typeof e.clientHeight)return e.scrollHeight-e.clientHeight;if(e.documentElement){let t=e.documentElement;return(t.scrollHeight??0)-(t.clientHeight??0)}return 0}hide(e){if(void 0!==this.minHideHeadroom&&this.getScrollHeadroom(e)<=this.minHideHeadroom){this.clearDebounce(),this.accumulatedDistance=0;return}this.clearDebounce(),this.isHidden=!0,this.accumulatedDistance=0,this.suppressUntil=Date.now()+250,this.onScroll&&this.onScroll("down")}handleScroll(e){let t=e.target;if(!t)return;let i=this.getScrollTop(t);if(Date.now()<this.suppressUntil)return void this.lastScrollTops.set(t,i);let n=this.lastScrollTops.get(t)??i,r=i-n;if(this.lastScrollTops.set(t,i),0!==r){if((r>0?"down":"up")=="up")this.clearDebounce(),this.accumulatedDistance=0,this.isHidden&&(this.isHidden=!1,this.suppressUntil=Date.now()+250,this.onScroll&&this.onScroll("up"));else if(!this.isHidden){if(this.accumulatedDistance+=r,this.accumulatedDistance>=50)return void this.hide(t);this.clearDebounce(),this.debounceTimer=setTimeout(()=>this.hide(t),150)}}}clearDebounce(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}destroy(){this.target.removeEventListener("scroll",this.boundHandleScroll,this.useCapture),this.clearDebounce(),this.onScroll=null}}let nr=iK(class extends iQ{constructor(){super(...arguments),this.key=F}render(e,t){return this.key=e,t}update(e,[t,i]){return t!==this.key&&(((e,t=iq)=>e._$AH=t)(e),this.key=t),i}}),ns=iF("WaitForCustomElement");async function no(e,t=5e3){let i;if(customElements.get(e))return!0;try{return await Promise.race([customElements.whenDefined(e),new Promise((n,r)=>{i=window.setTimeout(()=>r(Error(`Timeout waiting for <${e}> after ${t}ms`)),t)})]),!0}catch(i){let t=i instanceof Error?i.message:String(i);return ns.error(`Failed to register widget '${e}': ${t}`),!1}finally{i&&clearTimeout(i)}}let na=["https:","http:","blob:"];var nl=Object.defineProperty,nc=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nl(t,i,s),s};let nd=new Set(["image/jpeg","image/jpg","image/png","application/pdf"]),nh=new CSSStyleSheet;nh.replaceSync("*{box-sizing:border-box}:host{--border-color: #ddd;--btn-primary-bg: #007bff;--btn-primary-hover-bg: #0056b3;--btn-disabled-bg: #ccc;--text-primary: #333;--text-on-primary: white;display:flex;flex-direction:column;width:100%;height:100%;position:relative}.not-supported{display:flex;justify-content:center;align-items:center}.attachment-container{display:flex;justify-content:center;overflow:auto}.csv-container{width:100%;height:100%;overflow:auto}.attachment-portrait{height:100%;display:block}.attachment-landscape{width:100%;display:block}.loading{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.pagination-controls{width:100%;height:10%;display:flex;justify-content:center;align-items:center;gap:calc(1rem * var(--aiex-rem-scale, 1));padding:calc(1rem * var(--aiex-rem-scale, 1));background-color:transparent;flex-shrink:0}.pagination-btn{padding:calc(.5rem * var(--aiex-rem-scale, 1)) calc(1rem * var(--aiex-rem-scale, 1));background-color:var(--btn-primary-bg);color:var(--text-on-primary);border:none;border-radius:4px;cursor:pointer;font-size:calc(.9rem * var(--aiex-rem-scale, 1));transition:background-color .2s}.pagination-btn:hover:not(:disabled){background-color:var(--btn-primary-hover-bg)}.pagination-btn:disabled{background-color:var(--btn-disabled-bg);cursor:not-allowed;opacity:.6}.page-indicator{font-size:calc(.9rem * var(--aiex-rem-scale, 1));color:var(--text-primary);font-weight:500}.spinner{animation:spin 1s linear infinite;width:calc(2rem * var(--aiex-rem-scale, 1));height:calc(2rem * var(--aiex-rem-scale, 1))}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}");class nu extends ea{constructor(){super(...arguments),this.isLoading=!0,this.notSupported=!1,this.currentPage=1,this.totalPages=1,this.documentViewerTag="sn-document-viewer"}static{this.styles=[nh]}connectedCallback(){super.connectedCallback(),this.isLoading=!0,this.notSupported=!1,this.fetchAttachmentData()}updated(e){super.updated(e),e.has("widget")&&(this.isLoading=!0,this.notSupported=!1,this.fetchAttachmentData())}async fetchAttachmentData(){if(this.csvMarkdown=void 0,this.plainText=void 0,nd.has(this.widget.mime_type))return void this.documentViewer();switch(this.widget.mime_type){case"text/csv":case"text/plain":this.fetchTextBased();break;case"application/docx":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":this.fetchDocumentURL();break;default:this.isLoading=!1}}fetchDocumentURL(){try{let e=this.widget?.upload_url||null;if(!(e=>{if(!e)return!1;if(e.startsWith("/"))return!0;try{let t=new URL(e);return na.includes(t.protocol)}catch{return!1}})(e))return void console.error("Unsafe URL detected:",e);window.open(e,"_blank","noopener,noreferrer")}catch(e){console.error("Error opening document:",e)}finally{this.notSupported=!0,this.isLoading=!1}}async documentViewer(){await no(this.documentViewerTag,2e3)||(this.notSupported=!0),this.isLoading=!1}async fetchTextBased(){try{let e=this.widget.sys_id||this.widget.id,t=await fetch(`sys_attachment.do?sys_id=${e}`).then(e=>e.text());"text/csv"===this.widget.mime_type?this.csvMarkdown=function(e){let t=function(e){let t=[],i=[],n="",r=!1,s=0,o=e.trim().replace(/\r\n|\r/g,`
4
4
  `);for(;s<o.length;){let e=o[s];r?'"'===e&&'"'===o[s+1]?(n+='"',s+=2):('"'===e?r=!1:e===`
5
5
  `?n+=" ":n+=e,s++):('"'===e?r=!0:","===e?(i.push(n.trim()),n=""):e===`
6
6
  `?(i.push(n.trim()),t.push(i),i=[],n=""):n+=e,s++)}return(n.length>0||i.length>0)&&(i.push(n.trim()),t.push(i)),t}(e);if(0===t.length)return"";let[i,...n]=t,r=i.map(()=>"---");return[i,r,...n].map(e=>`| ${e.map(e=>e.replace(/\|/g,"\\|")).join(" | ")} |`).join(`
7
7
  `)}(t):this.plainText=t}finally{this.isLoading=!1}}render(){if(this.isLoading)return B`<div class="loading">
8
8
  <img src="${"data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='8'%20cy='8'%20r='6'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-dasharray='38'%20stroke-dashoffset='10'/%3e%3c/svg%3e"}" class="spinner" alt="Loading" />
9
- </div>`;let{title:e,mime_type:t}=this.widget,i=this.widget?.sys_id||this.widget?.id;return void 0!==this.plainText?B`
9
+ </div>`;let{mime_type:e}=this.widget,t=this.widget?.sys_id||this.widget?.id,i=nd.has(e);return void 0!==this.plainText?B`
10
10
  <div class="csv-container">
11
11
  <chatkit-widget-renderer
12
12
  .widget=${{type:"Markdown",value:"```\n"+this.plainText+"\n```"}}
@@ -18,26 +18,17 @@ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeSh
18
18
  .widget=${{type:"Markdown",value:this.csvMarkdown}}
19
19
  ></chatkit-widget-renderer>
20
20
  </div>
21
- `:B`
22
- <div class="attachment-container">
23
- ${this.renderURL?B`<img
24
- class="${this.isPortrait?"attachment-portrait":"attachment-landscape"}"
25
- src="${this.renderURL}"
26
- alt="${e}"
27
- />`:null}
28
- </div>
29
-
30
- ${"application/pdf"===t&&i&&!this.notSupported?B`
31
- ${nr(i,B`<sn-document-viewer sys-id=${i} />`)}
32
- `:B`<div class="not-supported">
33
- <p>Unable to load document viewer</p>
34
- </div>`}
21
+ `:i?t&&!this.notSupported?B`
22
+ ${nr(t,B`<sn-document-viewer sys-id=${t} close-hidden=${!0} />`)}
23
+ `:B`<div class="not-supported">
24
+ <p>Unable to load document viewer</p>
25
+ </div>`:B`
26
+ <div class="attachment-container"></div>
35
27
 
36
- ${this.notSupported?B`<div class="not-supported">
37
- <p>This file type is not supported for preview.</p>
38
- </div>`:""}
39
- </div>
40
- `}}nc([ec({type:Object})],nh.prototype,"widget"),nc([ed()],nh.prototype,"isLoading"),nc([ed()],nh.prototype,"notSupported"),nc([ed()],nh.prototype,"renderURL"),nc([ed()],nh.prototype,"csvMarkdown"),nc([ed()],nh.prototype,"plainText"),nc([ed()],nh.prototype,"currentPage"),nc([ed()],nh.prototype,"totalPages"),nc([ed()],nh.prototype,"isPortrait"),customElements.get("sn-attachment-renderer")||customElements.define("sn-attachment-renderer",nh);let nu=iF("WidgetLoad"),np=new Set,nv=e=>{if(e)return np.has(e)?(nu.info("Widget already requested",e),!0):(np.add(e),!1)},nw=async e=>{if(!nv(e))try{return await window.__TECTONIC__$devsnc_library_uxf?.getComponentsByTagNames([e]),!0}catch(t){return nu.error("Failed to load widget",{widgetName:e,error:t}),np.delete(e),!1}},ng=async e=>{if(!nv(e))try{return await window.__TECTONIC__$devsnc_library_uxf?.getTemplates([e]),!0}catch(t){return nu.error("Failed to load widget",{macroponentId:e,error:t}),np.delete(e),!1}},nf=async(e,t)=>{"seismic"===e?await nw(t):"macroponent"===e&&await ng(t)};var nm=Object.defineProperty,nb=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nm(t,i,s),s};let n_=iF("SeismicWidget");class ny extends es{constructor(){super(...arguments),this.widget={},this.widgetElement=null}static{this.styles=o`
28
+ ${this.notSupported?B`<div class="not-supported">
29
+ <p>This file type is not supported for preview.</p>
30
+ </div>`:""}
31
+ `}}nc([ec({type:Object})],nu.prototype,"widget"),nc([ed()],nu.prototype,"isLoading"),nc([ed()],nu.prototype,"notSupported"),nc([ed()],nu.prototype,"csvMarkdown"),nc([ed()],nu.prototype,"plainText"),nc([ed()],nu.prototype,"currentPage"),nc([ed()],nu.prototype,"totalPages"),customElements.get("sn-attachment-renderer")||customElements.define("sn-attachment-renderer",nu);let np=iF("WidgetLoad"),nv=new Set,nw=e=>{if(e)return nv.has(e)?(np.info("Widget already requested",e),!0):(nv.add(e),!1)},ng=async e=>{if(!nw(e))try{return await window.__TECTONIC__$devsnc_library_uxf?.getComponentsByTagNames([e]),!0}catch(t){return np.error("Failed to load widget",{widgetName:e,error:t}),nv.delete(e),!1}},nf=async e=>{if(!nw(e))try{return await window.__TECTONIC__$devsnc_library_uxf?.getTemplates([e]),!0}catch(t){return np.error("Failed to load widget",{macroponentId:e,error:t}),nv.delete(e),!1}},nm=async(e,t)=>{"seismic"===e?await ng(t):"macroponent"===e&&await nf(t)};var nb=Object.defineProperty,n_=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nb(t,i,s),s};let ny=iF("SeismicWidget");class nx extends es{constructor(){super(...arguments),this.widget={},this.widgetElement=null}static{this.styles=o`
41
32
  :host {
42
33
  display: block;
43
34
  width: 100%;
@@ -84,17 +75,17 @@ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeSh
84
75
  transform: rotate(360deg);
85
76
  }
86
77
  }
87
- `}async updated(e){if(super.updated(e),!e.has("widget"))return;let{widget_id:t,payload:i,type:n}=this.widget;t&&(this.showLoadingState(),await nf(n,t));let r="seismic"==n?t:`macroponent-${t}`;await this.mountWidget(r,i)}disconnectedCallback(){super.disconnectedCallback(),this.widgetElement&&(this.widgetElement.remove(),this.widgetElement=null)}render(){return B`<div class="lit-container"></div>`}async mountWidget(e,t){if(!this.container)return void n_.warn("Container not ready yet");if(this.widgetElement&&(this.widgetElement.remove(),this.widgetElement=null),!e){this.container.innerHTML="<div>No widget name provided</div>";return}try{if(!await this.waitForCustomElement(e,5e3)){this.container.innerHTML=`<div style="padding: 20px; color: red;">Error: Widget '${e}' not registered after loading. Make sure the widget is imported and registered before use.</div>`;return}if(this.widgetElement=document.createElement(e),t)for(let[e,i]of Object.entries(t))this.widgetElement[e]=i;this.container.innerHTML="",this.container.appendChild(this.widgetElement)}catch(e){this.container.innerHTML=`<div style="padding: 20px; color: red;">Error rendering widget: ${e}</div>`}}async waitForCustomElement(e,t=5e3){return no(e,t)}showLoadingState(){this.container&&(this.container.innerHTML=`
78
+ `}async updated(e){if(super.updated(e),!e.has("widget"))return;let{widget_id:t,payload:i,type:n}=this.widget;t&&(this.showLoadingState(),await nm(n,t));let r="seismic"==n?t:`macroponent-${t}`;await this.mountWidget(r,i)}disconnectedCallback(){super.disconnectedCallback(),this.widgetElement&&(this.widgetElement.remove(),this.widgetElement=null)}render(){return B`<div class="lit-container"></div>`}async mountWidget(e,t){if(!this.container)return void ny.warn("Container not ready yet");if(this.widgetElement&&(this.widgetElement.remove(),this.widgetElement=null),!e){this.container.innerHTML="<div>No widget name provided</div>";return}try{if(!await this.waitForCustomElement(e,5e3)){this.container.innerHTML=`<div style="padding: 20px; color: red;">Error: Widget '${e}' not registered after loading. Make sure the widget is imported and registered before use.</div>`;return}if(this.widgetElement=document.createElement(e),t)for(let[e,i]of Object.entries(t))this.widgetElement[e]=i;this.container.innerHTML="",this.container.appendChild(this.widgetElement)}catch(e){this.container.innerHTML=`<div style="padding: 20px; color: red;">Error rendering widget: ${e}</div>`}}async waitForCustomElement(e,t=5e3){return no(e,t)}showLoadingState(){this.container&&(this.container.innerHTML=`
88
79
  <div class="loading-container">
89
80
  <div class="loading-spinner"></div>
90
81
  <div class="loading-text">Loading component...</div>
91
82
  </div>
92
- `)}}nb([ec({type:Object})],ny.prototype,"widget"),nb([eh(".lit-container")],ny.prototype,"container"),customElements.get("seismic-renderer")||customElements.define("seismic-renderer",ny);let nx=iF("WidgetLoader"),nC="aiex-chatkit-widget-renderer-loader";async function nE(){let e=ir("com.glide.aiel_asset_server")||window.NOW?.aiel_asset_server||"";try{let t=`${e}/sncapps/nextwave/assets/chatkit-widget-renderer.js`,i=new Date;i.setSeconds(0),i.setMilliseconds(0);let n=i.valueOf(),r=`${t}?v=${window?.ux_globals?.assetCacheBuster||n}`;if(document.getElementById(nC))return void nx.warn("Chatkit Widget Renderer loader script called more than once");let s=document.createElement("script");s.id=nC,s.src=r,s.type="module",s.async=!0,s.onload=()=>{nx.info("Chatkit Widget Renderer loaded successfully"),window.dispatchEvent(new CustomEvent("now-chatkit-widget-renderer-loaded"))},s.onerror=()=>{nx.error("Failed to load the Chatkit Widget Renderer script"),window.dispatchEvent(new CustomEvent("now-chatkit-widget-renderer-error"))},document.head.appendChild(s),nx.debug("Chatkit Widget Renderer loaded successfully from sk8 endpoint")}catch(e){nx.error("Failed to load Chatkit Widget Renderer from sk8 endpoint",e)}}let n$=iF("Navigation"),nk=(e,t)=>{let i=t?`&sysparm_catalog=${t}`:"";return`/${iO}.do?v=1&sysparm_parent=${e}${i}&sysparm_stack=no`},nA=e=>{try{return new URL(e,window.location.origin).origin!==window.location.origin}catch(e){return n$.error("Error parsing URL",e),!1}},nI=e=>{if(nA(e))return!1;let t=e.split("/")?.[1]?.split(".do")?.[0]||e.split(".do")?.[0],i=new URL(e,window.location.origin).searchParams.get("id");return!!(iP.some(e=>t.includes(e))||iP.some(e=>(i||"").includes(e))||iU.some(e=>t.includes(e))||iU.some(e=>(i||"").includes(e))||"sys_user"===t||"hri_user_profile"===i)},nS=({targetUrl:e})=>({type:id,payload:{options:{},...(({targetUrl:e}={})=>{let t=null;if(e&&(t={fallbackRoute:{context:{experienceName:"Unified Navigation App",path:"now/nav/ui"},route:"classic",params:{target:(e=>{try{let t=new URL(e,window.location.origin);return t.href.replace(t.origin,"")}catch(t){return n$.error("Error parsing URL",t),e}})(e)}}}),e&&(e.startsWith("/swp")||e.startsWith("/esc")||e.startsWith("/sp")))return t;n$.debug("Navigating to",e);let i=e?.split("/")?.[1]?.split(".do")?.[0]||"",n=e?.split("sys_id=")?.[1]?.split("=")?.[1]?.split("&")?.[0]||"",r=e;return i&&n&&(r=`${i}.do?sys_id=${n}`),"kb_knowledge"===i?r=`/kb_view.do?sys_kb_id=${n}`:"kb_view"===i?(i="kb_knowledge",n=(()=>{let t=e?.split(".do?")[1];if(!t)return"";let i=e=>t.split(`${e}=`)[1]?.split("&")[0];return i("sys_kb_id")||i("sys_id")||""})(),r=`/kb_view.do?sys_kb_id=${n}`):"sc_cat_item"===i?r=`/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=${n}`:"com.glideapp.servicecatalog_cat_item_view"===i&&(n=e?.split("sysparm_id=")?.[1]?.split("&")[0]||""),i&&n&&(t.feature="record",t.fields={table:i,sysId:n,target:r},t.fallbackRoute.params.target=r),t})({targetUrl:e})},error:null,meta:{path:[globalThis?.location?.host],appended:{},event:null,options:{}}}),nL=e=>{let t=new URL(e,window.location.origin),i=t.searchParams.get("id")||void 0,n=t.pathname.split("/").pop()?.split(".do")?.[0],r=iP.includes(n||"")||iP.includes(i||""),s=iU.includes(n||"")||iU.includes(i||"");return r?nT(e,n,i):s?nO(e,n,i):{ivUrl:e,popoutUrl:{platform:e,portal:e}}},nT=(e,t,i)=>{let n,r,s=new URL(e,window.location.origin);t===ix?r=s.searchParams.get("sys_id"):t===ig?r=e.split("sys_kb_id=")?.[1].split("&")[0]:i===i_?(n=s.searchParams.get("sysparm_article"),r=s.searchParams.get("sys_id")):i===iy?(n=s.searchParams.get("number"),r=s.searchParams.get("sys_id")):(i===iC||i===iE)&&(r=s.searchParams.get("sys_id"));let o=i===iy,a=o?iy:iE;return{ivUrl:r?`/swp?id=${i_}&sys_id=${r}`:n?`/swp?id=${i_}&sysparm_article=${n}`:e,popoutUrl:{platform:r?`/${ig}.do?sys_kb_id=${r}`:`/swp?id=${i_}&sysparm_article=${n}`,portal:r?`/${window.NOW?.portal_url_suffix||"swp"}?id=${a}&sys_id=${r}`:`/${window.NOW?.portal_url_suffix||"swp"}?id=${a}&${o?"number":"sysparm_article"}=${n}`}}},nO=(e,t,i)=>{let n,r,s,o,a=new URL(e,window.location.origin);if(i===iS||i===iL){let t=a.searchParams.get("sys_id");return{ivUrl:e,popoutUrl:{platform:t?`/${iD}.do?sysparm_id=${t}`:e,portal:t?`/${window.NOW?.portal_url_suffix||"swp"}?id=${iT}&sys_id=${t}`:e}}}return t===iT?n=e.split("sys_id=")?.[1].split("&")[0]:t===iD?n=e.split("sysparm_id=")?.[1].split("&")[0]:i===ik||i===iA||i===iI||i===iT?n=a.searchParams.get("sys_id"):i===i$?(n=a.searchParams.get("sc_cat_item"),r=a.searchParams.get("sc_category"),s=a.searchParams.get("sc_catalog")):t===iR&&(o=a.searchParams.get("sysparm_guide")),{ivUrl:n?`/swp?id=${ik}&sys_id=${n}&referrer=va`:r?nk(r,s||void 0):s?`/${iO}.do?v=1&sysparm_catalog=${s}&sysparm_stack=no`:o?`/${iR}.do?v=1&sysparm_guide=${o}`:e,popoutUrl:{platform:n?`/${iD}.do?sysparm_id=${n}`:r?nk(r,s||void 0):s?`/${iO}.do?v=1&sysparm_catalog=${s}&sysparm_stack=no`:o?`/${iR}.do?v=1&sysparm_guide=${o}`:e,portal:n?`/${window.NOW?.portal_url_suffix||"swp"}?id=${iT}&sys_id=${n}`:r?nk(r,s||void 0):s?`/${iO}.do?v=1&sysparm_catalog=${s}&sysparm_stack=no`:o?`/${iR}.do?v=1&sysparm_guide=${o}`:e}}},nD=iF("ExternalWidget"),nR=iF("Renderer");function nP(e,t){let i=Object.getOwnPropertyDescriptor(e,t);if(i&&!1===i.configurable)return;let n=e[t];null==n?nR.warn(`Skipping lock for ${String(t)}: no value present yet`):Object.defineProperty(e,t,{get:()=>n,set(e){nR.warn(`Blocked attempt to overwrite ${String(t)}`,e)},enumerable:!0,configurable:!1})}var nU=Object.defineProperty,nN=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nU(t,i,s),s};let nW=new CSSStyleSheet;nW.replaceSync("*{box-sizing:border-box}.widget-container{width:100%;height:calc(100% - calc(2rem * var(--aiex-rem-scale, 1)))}.pinned{height:100%}");let nM=iF("Renderer"),nV=o`
83
+ `)}}n_([ec({type:Object})],nx.prototype,"widget"),n_([eh(".lit-container")],nx.prototype,"container"),customElements.get("seismic-renderer")||customElements.define("seismic-renderer",nx);let nC=iF("WidgetLoader"),nE="aiex-chatkit-widget-renderer-loader";async function n$(){let e=ir("com.glide.aiel_asset_server")||window.NOW?.aiel_asset_server||"";try{let t=`${e}/sncapps/nextwave/assets/chatkit-widget-renderer.js`,i=new Date;i.setSeconds(0),i.setMilliseconds(0);let n=i.valueOf(),r=`${t}?v=${window?.ux_globals?.assetCacheBuster||n}`;if(document.getElementById(nE))return void nC.warn("Chatkit Widget Renderer loader script called more than once");let s=document.createElement("script");s.id=nE,s.src=r,s.type="module",s.async=!0,s.onload=()=>{nC.info("Chatkit Widget Renderer loaded successfully"),window.dispatchEvent(new CustomEvent("now-chatkit-widget-renderer-loaded"))},s.onerror=()=>{nC.error("Failed to load the Chatkit Widget Renderer script"),window.dispatchEvent(new CustomEvent("now-chatkit-widget-renderer-error"))},document.head.appendChild(s),nC.debug("Chatkit Widget Renderer loaded successfully from sk8 endpoint")}catch(e){nC.error("Failed to load Chatkit Widget Renderer from sk8 endpoint",e)}}let nk=iF("Navigation"),nA=(e,t)=>{let i=t?`&sysparm_catalog=${t}`:"";return`/${iO}.do?v=1&sysparm_parent=${e}${i}&sysparm_stack=no`},nI=e=>{try{return new URL(e,window.location.origin).origin!==window.location.origin}catch(e){return nk.error("Error parsing URL",e),!1}},nS=e=>{if(nI(e))return!1;let t=e.split("/")?.[1]?.split(".do")?.[0]||e.split(".do")?.[0],i=new URL(e,window.location.origin).searchParams.get("id");return!!(iR.some(e=>t.includes(e))||iR.some(e=>(i||"").includes(e))||iU.some(e=>t.includes(e))||iU.some(e=>(i||"").includes(e))||"sys_user"===t||"hri_user_profile"===i)},nL=({targetUrl:e})=>({type:id,payload:{options:{},...(({targetUrl:e}={})=>{let t=null;if(e&&(t={fallbackRoute:{context:{experienceName:"Unified Navigation App",path:"now/nav/ui"},route:"classic",params:{target:(e=>{try{let t=new URL(e,window.location.origin);return t.href.replace(t.origin,"")}catch(t){return nk.error("Error parsing URL",t),e}})(e)}}}),e&&(e.startsWith("/swp")||e.startsWith("/esc")||e.startsWith("/sp")))return t;nk.debug("Navigating to",e);let i=e?.split("/")?.[1]?.split(".do")?.[0]||"",n=e?.split("sys_id=")?.[1]?.split("=")?.[1]?.split("&")?.[0]||"",r=e;return i&&n&&(r=`${i}.do?sys_id=${n}`),"kb_knowledge"===i?r=`/kb_view.do?sys_kb_id=${n}`:"kb_view"===i?(i="kb_knowledge",n=(()=>{let t=e?.split(".do?")[1];if(!t)return"";let i=e=>t.split(`${e}=`)[1]?.split("&")[0];return i("sys_kb_id")||i("sys_id")||""})(),r=`/kb_view.do?sys_kb_id=${n}`):"sc_cat_item"===i?r=`/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=${n}`:"com.glideapp.servicecatalog_cat_item_view"===i&&(n=e?.split("sysparm_id=")?.[1]?.split("&")[0]||""),i&&n&&(t.feature="record",t.fields={table:i,sysId:n,target:r},t.fallbackRoute.params.target=r),t})({targetUrl:e})},error:null,meta:{path:[globalThis?.location?.host],appended:{},event:null,options:{}}}),nT=e=>{let t=new URL(e,window.location.origin),i=t.searchParams.get("id")||void 0,n=t.pathname.split("/").pop()?.split(".do")?.[0],r=iR.includes(n||"")||iR.includes(i||""),s=iU.includes(n||"")||iU.includes(i||"");return r?nO(e,n,i):s?nD(e,n,i):{ivUrl:e,popoutUrl:{platform:e,portal:e}}},nO=(e,t,i)=>{let n,r,s=new URL(e,window.location.origin);t===ix?r=s.searchParams.get("sys_id"):t===ig?r=e.split("sys_kb_id=")?.[1].split("&")[0]:i===i_?(n=s.searchParams.get("sysparm_article"),r=s.searchParams.get("sys_id")):i===iy?(n=s.searchParams.get("number"),r=s.searchParams.get("sys_id")):(i===iC||i===iE)&&(r=s.searchParams.get("sys_id"));let o=i===iy,a=o?iy:iE;return{ivUrl:r?`/swp?id=${i_}&sys_id=${r}`:n?`/swp?id=${i_}&sysparm_article=${n}`:e,popoutUrl:{platform:r?`/${ig}.do?sys_kb_id=${r}`:`/swp?id=${i_}&sysparm_article=${n}`,portal:r?`/${window.NOW?.portal_url_suffix||"swp"}?id=${a}&sys_id=${r}`:`/${window.NOW?.portal_url_suffix||"swp"}?id=${a}&${o?"number":"sysparm_article"}=${n}`}}},nD=(e,t,i)=>{let n,r,s,o,a=new URL(e,window.location.origin);if(i===iS||i===iL){let t=a.searchParams.get("sys_id");return{ivUrl:e,popoutUrl:{platform:t?`/${iD}.do?sysparm_id=${t}`:e,portal:t?`/${window.NOW?.portal_url_suffix||"swp"}?id=${iT}&sys_id=${t}`:e}}}return t===iT?n=e.split("sys_id=")?.[1].split("&")[0]:t===iD?n=e.split("sysparm_id=")?.[1].split("&")[0]:i===ik||i===iA||i===iI||i===iT?n=a.searchParams.get("sys_id"):i===i$?(n=a.searchParams.get("sc_cat_item"),r=a.searchParams.get("sc_category"),s=a.searchParams.get("sc_catalog")):t===iP&&(o=a.searchParams.get("sysparm_guide")),{ivUrl:n?`/swp?id=${ik}&sys_id=${n}&referrer=va`:r?nA(r,s||void 0):s?`/${iO}.do?v=1&sysparm_catalog=${s}&sysparm_stack=no`:o?`/${iP}.do?v=1&sysparm_guide=${o}`:e,popoutUrl:{platform:n?`/${iD}.do?sysparm_id=${n}`:r?nA(r,s||void 0):s?`/${iO}.do?v=1&sysparm_catalog=${s}&sysparm_stack=no`:o?`/${iP}.do?v=1&sysparm_guide=${o}`:e,portal:n?`/${window.NOW?.portal_url_suffix||"swp"}?id=${iT}&sys_id=${n}`:r?nA(r,s||void 0):s?`/${iO}.do?v=1&sysparm_catalog=${s}&sysparm_stack=no`:o?`/${iP}.do?v=1&sysparm_guide=${o}`:e}}},nP=iF("ExternalWidget"),nR=iF("Renderer");function nU(e,t){let i=Object.getOwnPropertyDescriptor(e,t);if(i&&!1===i.configurable)return;let n=e[t];null==n?nR.warn(`Skipping lock for ${String(t)}: no value present yet`):Object.defineProperty(e,t,{get:()=>n,set(e){nR.warn(`Blocked attempt to overwrite ${String(t)}`,e)},enumerable:!0,configurable:!1})}var nN=Object.defineProperty,nM=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nN(t,i,s),s};let nW=new CSSStyleSheet;nW.replaceSync("*{box-sizing:border-box}.widget-container{width:100%;height:calc(100% - calc(2rem * var(--aiex-rem-scale, 1)))}.pinned{height:100%}");let nV=iF("Renderer"),nH=o`
93
84
  :host {
94
85
  width: 100%;
95
86
  height: 100%;
96
87
  }
97
- `;class nH extends ea{constructor(){super(...arguments),this.documentViewerLoaded=!1,this.documentViewerResolved=!1,this.widget={},this.itemId="",this.useKarunaWorkload=!1,this.isPinned=!1,this.iframeCatalogHandler=null,this.iframeCatalogWindow=null,this.documentViewerTag="sn-document-viewer",this.handleWidgetAction=e=>{let t=e.detail;if(!t?.type)return;let i=this.activeConversationId;i&&window.__AIEX_GLOBALS__?.sendCustomAction({params:{thread_id:i,item_id:this.itemId,action:{type:t.type,payload:t.payload??{}}},conversationId:i})},this.handlePostMessage=e=>{if(e.origin!==window.location.origin)return;let{msg:t,target_sys_id:i,target_table:n}=e.data||{};t===im&&this.dispatchEvent(new CustomEvent(im,{bubbles:!0,composed:!0,detail:{isDirty:e.data.dirty}})),"TARGET_RECORD_SELECTED"===t&&n&&i?this.dispatchEvent(new CustomEvent(iw,{bubbles:!0,composed:!0,detail:{targetUrl:`/${n}.do?sys_id=${i}`,targetTable:n,targetSysId:i,source:"catalogPostMessage"}})):"CATALOG_ITEM_CLOSED"===t&&this.dispatchEvent(new CustomEvent(il,{bubbles:!0,composed:!0}))},this.iframeClickHandler=null,this.handleIframeLoad=e=>{let t=e.target;try{let e=t.contentDocument;if(!e)return;this.iframeClickHandler&&e.removeEventListener("click",this.iframeClickHandler),this.iframeClickHandler=e=>{this.handleIframeLinkClick(e,t)},e.addEventListener("click",this.iframeClickHandler);let i=e.createElement("style");if(i.textContent="#back_button_in_header, .sc_header_back_button, #back_cell { display: none !important; }",e.head.appendChild(i),this.dispatchEvent(new CustomEvent(i4,{bubbles:!0,composed:!0,detail:{contentDocument:e}})),this.forwardIframeCatalogEvents(e),this.isOnCatalogConfirmationPage(t))try{let e=t.contentWindow;e&&(e.open=()=>null)}catch{}}catch{}},this.handleIframeLinkClick=(e,t)=>{let i,n=e.target?.closest?.("a");if(!n)return;let r=n.getAttribute("href");if(!r||"#"===r||r.startsWith("javascript:")||"about:blank"===r)return;try{i=new URL(r,t.contentDocument?.baseURI||t.src)}catch{return}let s=new URL(t.src,window.location.origin);if(i.origin===s.origin&&i.pathname===s.pathname&&i.search===s.search&&i.hash)return;e.preventDefault(),e.stopPropagation();let o=i.href,a=i.pathname+i.search,l=nI(o),c=nI(a);if(l||c){let e=l?o:a;this.dispatchEvent(new CustomEvent(iv,{bubbles:!0,composed:!0,detail:{widgetId:"default-iframe-widget",widgetData:{type:"iframe",url:e,normalizedURLs:nL(e)}}}));return}if(nA(o))return void window.open(o,"_blank");if(a.match(/\/?\w+\.do\b/)){this.isOnCatalogConfirmationPage(t)||this.dispatchEvent(new CustomEvent(iw,{bubbles:!0,composed:!0,detail:{targetUrl:a}}));return}this.isOnCatalogConfirmationPage(t)||window.open(o,"_blank")}}static{this.styles=[nW,nV]}async connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.handlePostMessage),this.addEventListener("widget-action",this.handleWidgetAction);try{nE(),window.nowUiFramework&&(nP(window.nowUiFramework,"snHttp"),nP(window.nowUiFramework,"batchGQLEffectRequests")),await function({assetPath:e,scriptId:t,loadedEvent:i,skipBaseServerURL:n=!1}){return new Promise((r,s)=>{let o=n?"":ir("com.glide.aiel_asset_server")||window.NOW?.aiel_asset_server||"";try{if(document.getElementById(t))return;let n=new Date;n.setSeconds(0),n.setMilliseconds(0);let a=window?.ux_globals?.assetCacheBuster||n.valueOf(),l=`${o}${e}?v=${a}`,c=document.createElement("script");c.id=t,c.src=l,c.type="module",c.async=!0,c.onload=()=>{i&&window.dispatchEvent(new CustomEvent(i)),r()},c.onerror=()=>{nD.error(`Failed to load external widget: ${e}`),s(`Failed to load external widget: ${e}`)},document.head.appendChild(c)}catch(t){nD.error(`Failed to load external widget ${e}`,t),s(t)}})}({assetPath:"/aiux/assets/core/document-viewer.js",scriptId:"aiex-document-viewer-loader",skipBaseServerURL:!0}),this.documentViewerLoaded=!0}catch(e){nM.error("Failed to load widget renderer",e)}finally{this.documentViewerResolved=!0,this.documentViewerLoaded||nf("seismic",this.documentViewerTag)}}disconnectedCallback(){if(super.disconnectedCallback(),this.iframeClickHandler){try{this.shadowRoot?.querySelector("iframe")?.contentDocument?.removeEventListener("click",this.iframeClickHandler)}catch{}this.iframeClickHandler=null}window.removeEventListener("message",this.handlePostMessage),this.removeEventListener("widget-action",this.handleWidgetAction),this.cleanupIframeCatalogListener()}isOnCatalogConfirmationPage(e){try{let t=e.contentWindow?.location?.search??"";return"va_order_status"===new URLSearchParams(t).get("id")}catch{return!1}}forwardIframeCatalogEvents(e){let t=e.defaultView;t&&(this.cleanupIframeCatalogListener(),this.iframeCatalogHandler=e=>{let{msg:t}=e.data||{};("TARGET_RECORD_SELECTED"===t||"CATALOG_ITEM_CLOSED"===t||t===im)&&window.postMessage(e.data,"*")},this.iframeCatalogWindow=t,t.addEventListener("message",this.iframeCatalogHandler))}cleanupIframeCatalogListener(){if(this.iframeCatalogHandler&&this.iframeCatalogWindow)try{this.iframeCatalogWindow.removeEventListener("message",this.iframeCatalogHandler)}catch{}this.iframeCatalogHandler=null,this.iframeCatalogWindow=null}get activeConversationId(){return window.__AIEX_GLOBALS__?.getLatestState()?.activeConversation||""}render(){let e=this.isPinned?"widget-container pinned":"widget-container";return B` <div class=${e}>${this.renderWidget()}</div> `}renderWidget(){if(!this.widget)return B`<div>No widget data provided</div>`;let{type:e,mime_type:t}=this.widget;if("iframe"===this.widget.type){let e=this.widget.normalizedURLs?.ivUrl||this.widget.url;return e+=e.includes("?")?"&":"?",e+="sys_canvas=true",B`
88
+ `;class nB extends ea{constructor(){super(...arguments),this.documentViewerLoaded=!1,this.documentViewerResolved=!1,this.widget={},this.itemId="",this.useKarunaWorkload=!1,this.isPinned=!1,this.iframeCatalogHandler=null,this.iframeCatalogWindow=null,this.documentViewerTag="sn-document-viewer",this.handleWidgetAction=e=>{let t=e.detail;if(!t?.type)return;let i=this.activeConversationId;i&&window.__AIEX_GLOBALS__?.sendCustomAction({params:{thread_id:i,item_id:this.itemId,action:{type:t.type,payload:t.payload??{}}},conversationId:i})},this.handlePostMessage=e=>{if(e.origin!==window.location.origin)return;let{msg:t,target_sys_id:i,target_table:n}=e.data||{};t===im&&this.dispatchEvent(new CustomEvent(im,{bubbles:!0,composed:!0,detail:{isDirty:e.data.dirty}})),"TARGET_RECORD_SELECTED"===t&&n&&i?this.dispatchEvent(new CustomEvent(iw,{bubbles:!0,composed:!0,detail:{targetUrl:`/${n}.do?sys_id=${i}`,targetTable:n,targetSysId:i,source:"catalogPostMessage"}})):"CATALOG_ITEM_CLOSED"===t&&this.dispatchEvent(new CustomEvent(il,{bubbles:!0,composed:!0}))},this.iframeClickHandler=null,this.handleIframeLoad=e=>{let t=e.target;try{let e=t.contentDocument;if(!e)return;this.iframeClickHandler&&e.removeEventListener("click",this.iframeClickHandler),this.iframeClickHandler=e=>{this.handleIframeLinkClick(e,t)},e.addEventListener("click",this.iframeClickHandler);let i=e.createElement("style");if(i.textContent="#back_button_in_header, .sc_header_back_button, #back_cell { display: none !important; }",e.head.appendChild(i),this.dispatchEvent(new CustomEvent(i4,{bubbles:!0,composed:!0,detail:{contentDocument:e}})),this.forwardIframeCatalogEvents(e),this.isOnCatalogConfirmationPage(t))try{let e=t.contentWindow;e&&(e.open=()=>null)}catch{}}catch{}},this.handleIframeLinkClick=(e,t)=>{let i,n=e.target?.closest?.("a");if(!n)return;let r=n.getAttribute("href");if(!r||"#"===r||r.startsWith("javascript:")||"about:blank"===r)return;try{i=new URL(r,t.contentDocument?.baseURI||t.src)}catch{return}let s=new URL(t.src,window.location.origin);if(i.origin===s.origin&&i.pathname===s.pathname&&i.search===s.search&&i.hash)return;e.preventDefault(),e.stopPropagation();let o=i.href,a=i.pathname+i.search,l=nS(o),c=nS(a);if(l||c){let e=l?o:a;this.dispatchEvent(new CustomEvent(iv,{bubbles:!0,composed:!0,detail:{widgetId:"default-iframe-widget",widgetData:{type:"iframe",url:e,normalizedURLs:nT(e)}}}));return}if(nI(o))return void window.open(o,"_blank");if(a.match(/\/?\w+\.do\b/)){this.isOnCatalogConfirmationPage(t)||this.dispatchEvent(new CustomEvent(iw,{bubbles:!0,composed:!0,detail:{targetUrl:a}}));return}this.isOnCatalogConfirmationPage(t)||window.open(o,"_blank")}}static{this.styles=[nW,nH]}async connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.handlePostMessage),this.addEventListener("widget-action",this.handleWidgetAction);try{n$(),window.nowUiFramework&&(nU(window.nowUiFramework,"snHttp"),nU(window.nowUiFramework,"batchGQLEffectRequests")),await function({assetPath:e,scriptId:t,loadedEvent:i,skipBaseServerURL:n=!1}){return new Promise((r,s)=>{let o=n?"":ir("com.glide.aiel_asset_server")||window.NOW?.aiel_asset_server||"";try{if(document.getElementById(t))return;let n=new Date;n.setSeconds(0),n.setMilliseconds(0);let a=window?.ux_globals?.assetCacheBuster||n.valueOf(),l=`${o}${e}?v=${a}`,c=document.createElement("script");c.id=t,c.src=l,c.type="module",c.async=!0,c.onload=()=>{i&&window.dispatchEvent(new CustomEvent(i)),r()},c.onerror=()=>{nP.warn(`Failed to load external widget: ${e}`),s(`Failed to load external widget: ${e}`)},document.head.appendChild(c)}catch(t){nP.warn(`Failed to load external widget ${e}`,t),s(t)}})}({assetPath:"/aiux/assets/core/document-viewer.js",scriptId:"aiex-document-viewer-loader",skipBaseServerURL:!0}),this.documentViewerLoaded=!0}catch(e){nV.warn("Failed to load widget renderer",e)}finally{this.documentViewerResolved=!0,this.documentViewerLoaded||nm("seismic",this.documentViewerTag)}}disconnectedCallback(){if(super.disconnectedCallback(),this.iframeClickHandler){try{this.shadowRoot?.querySelector("iframe")?.contentDocument?.removeEventListener("click",this.iframeClickHandler)}catch{}this.iframeClickHandler=null}window.removeEventListener("message",this.handlePostMessage),this.removeEventListener("widget-action",this.handleWidgetAction),this.cleanupIframeCatalogListener()}isOnCatalogConfirmationPage(e){try{let t=e.contentWindow?.location?.search??"";return"va_order_status"===new URLSearchParams(t).get("id")}catch{return!1}}forwardIframeCatalogEvents(e){let t=e.defaultView;t&&(this.cleanupIframeCatalogListener(),this.iframeCatalogHandler=e=>{let{msg:t}=e.data||{};("TARGET_RECORD_SELECTED"===t||"CATALOG_ITEM_CLOSED"===t||t===im)&&window.postMessage(e.data,"*")},this.iframeCatalogWindow=t,t.addEventListener("message",this.iframeCatalogHandler))}cleanupIframeCatalogListener(){if(this.iframeCatalogHandler&&this.iframeCatalogWindow)try{this.iframeCatalogWindow.removeEventListener("message",this.iframeCatalogHandler)}catch{}this.iframeCatalogHandler=null,this.iframeCatalogWindow=null}get activeConversationId(){return window.__AIEX_GLOBALS__?.getLatestState()?.activeConversation||""}render(){let e=this.isPinned?"widget-container pinned":"widget-container";return B` <div class=${e}>${this.renderWidget()}</div> `}renderWidget(){if(!this.widget)return B`<div>No widget data provided</div>`;let{type:e,mime_type:t}=this.widget;if("iframe"===this.widget.type){let e=this.widget.normalizedURLs?.ivUrl||this.widget.url;return e+=e.includes("?")?"&":"?",e+="sys_canvas=true",B`
98
89
  <iframe
99
90
  src=${e}
100
91
  style="width: 100%; height: 100%; border: none;"
@@ -104,7 +95,7 @@ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeSh
104
95
  ></iframe>
105
96
  `}if("file"!==e&&"attachment"!==e)return"seismic"===this.widget.type||"macroponent"===this.widget.type?B`
106
97
  <seismic-renderer .widget=${this.widget}></seismic-renderer>
107
- `:(nM.debug("Returning chatkit widget renderer",this.widget),B`
98
+ `:(nV.debug("Returning chatkit widget renderer",this.widget),B`
108
99
  <chatkit-widget-renderer
109
100
  .widget=${this.widget}
110
101
  item-id=${this.itemId}
@@ -128,13 +119,13 @@ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeSh
128
119
  .keyboardShortcuts=${!0}
129
120
  @dv:viewer:closed=${this.handleDocumentViewerClose}
130
121
  ></aiux-document-viewer>
131
- `}}handleDocumentViewerClose(){nM.debug("Document viewer closed"),this.dispatchEvent(new CustomEvent("CLOSE_INTERACTIVE_VIEW",{bubbles:!0,composed:!0}))}}nN([ed()],nH.prototype,"documentViewerLoaded"),nN([ed()],nH.prototype,"documentViewerResolved"),nN([ec()],nH.prototype,"widget"),nN([ec()],nH.prototype,"itemId"),nN([ec()],nH.prototype,"useKarunaWorkload"),nN([ec({attribute:"is-pinned"})],nH.prototype,"isPinned"),customElements.get("sn-widget-renderer")||customElements.define("sn-widget-renderer",nH);var nB=Object.defineProperty,nj=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nB(t,i,s),s};let nF=new CSSStyleSheet;nF.replaceSync("*{box-sizing:border-box}:host{height:100%;display:block;color-scheme:light dark;--aiex-icon-color: var( --aiex-text-primary, rgb(var(--now-color_text--primary, 16, 23, 26)) )}:host-context([data-theme=\"dark\"]),:host-context(.dark-theme),:host-context(.sn-dark-theme){color-scheme:dark}.interactive-view-container{display:flex;flex-direction:column;height:100%;width:100%;position:relative;min-width:calc(20rem * var(--aiex-rem-scale, 1))}.interactive-view-header{display:flex;align-items:center;justify-content:space-between;padding:calc(.25rem * var(--aiex-rem-scale, 1)) calc(.5rem * var(--aiex-rem-scale, 1)) calc(.25rem * var(--aiex-rem-scale, 1)) calc(.75rem * var(--aiex-rem-scale, 1));flex-shrink:0;height:calc(3rem * var(--aiex-rem-scale, 1));box-sizing:border-box;margin-bottom:calc(.25rem * var(--aiex-rem-scale, 1));background-color:var( --aiex-bg-primary, rgb(var(--now-color_background--primary, 255, 255, 255)) );border-bottom:1px solid light-dark(rgb(229,231,235),rgba(255,255,255,.1));transition:height .2s cubic-bezier(.52,.01,.3,.99),margin-bottom .2s cubic-bezier(.52,.01,.3,.99),padding .2s cubic-bezier(.52,.01,.3,.99),opacity .2s cubic-bezier(.52,.01,.3,.99);gap:calc(.5rem * var(--aiex-rem-scale, 1));overflow:hidden}.interactive-view-header.hidden{height:0;margin-bottom:0;opacity:0;pointer-events:none;padding:0 calc(.5rem * var(--aiex-rem-scale, 1)) 0 calc(.75rem * var(--aiex-rem-scale, 1))}.interactive-view-header.visible{margin-bottom:0;position:relative;z-index:1;overflow:visible;box-shadow:0 calc(.075rem * var(--aiex-rem-scale, 1)) calc(.25rem * var(--aiex-rem-scale, 1)) light-dark(rgba(0 0 0 .08),rgba(0,0,0,.4))}.interactive-view-header .header-actions{display:flex;align-items:center;gap:calc(.5rem * var(--aiex-rem-scale, 1));flex-shrink:0;margin-inline-start:auto}.interactive-view-header .icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;background:#fff3;border-radius:8px;backdrop-filter:blur(10px);transition:all .3s ease}.interactive-view-header .icon img{width:20px;height:20px;object-fit:contain}.interactive-view-header .label{flex:1;min-width:0;font-size:calc(1.125rem * var(--aiex-rem-scale, 1));font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var( --aiex-text-primary, rgb(var(--now-color_text--primary, 16, 23, 26)) )}.interactive-view-header .slot{flex:1;display:flex;align-items:center;justify-content:flex-end;gap:calc(.25rem * var(--aiex-rem-scale, 1));min-width:0;overflow:hidden;margin-inline-end:6%}.header-icon-button{position:relative;display:flex;align-items:center;justify-content:center;height:calc(2rem * var(--aiex-rem-scale, 1));width:calc(2rem * var(--aiex-rem-scale, 1));padding:0;background-color:transparent;border:none;cursor:pointer;border-radius:calc(.5rem * var(--aiex-rem-scale, 1));flex-shrink:0;color:var(--aiex-icon-color);transition:background-color .2s ease}.header-icon-button:hover{background-color:color-mix(in srgb,currentColor 12%,transparent)}.header-icon-button:active{background-color:color-mix(in srgb,currentColor 20%,transparent)}.tooltip{visibility:hidden;opacity:0;position:absolute;top:calc(100% + calc(.375rem * var(--aiex-rem-scale, 1)));left:50%;transform:translate(-50%);background:rgb(var(--now-tooltip--background-color, 0, 0, 0));color:rgb(var(--now-tooltip--color, 255, 255, 255));font-size:calc(.75rem * var(--aiex-rem-scale, 1));font-weight:500;line-height:1;padding:calc(.375rem * var(--aiex-rem-scale, 1)) calc(.5rem * var(--aiex-rem-scale, 1));border-radius:calc(.25rem * var(--aiex-rem-scale, 1));white-space:nowrap;pointer-events:none;z-index:10;transition:opacity .15s ease,visibility .15s ease}.tooltip:before{content:\"\";position:absolute;bottom:100%;left:50%;transform:translate(-50%);border:calc(.1875rem * var(--aiex-rem-scale, 1)) solid transparent;border-bottom-color:rgb(var(--now-tooltip--background-color, 0, 0, 0))}.header-icon-button:hover>.tooltip,.header-icon-button:focus-visible>.tooltip{visibility:visible;opacity:1}.aiex-popout-button:after,.aiex-back-button:after,.aiex-toggle-button:after{content:\"\";position:absolute;inset:0;background-color:currentColor}.aiex-popout-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15.5%2011C15.7761%2011%2016%2011.2239%2016%2011.5C16%2011.7761%2015.7761%2012%2015.5%2012H15C13.8157%2012%2012.9693%2012.0006%2012.3164%2012.0742C11.6738%2012.1467%2011.2809%2012.2847%2010.9785%2012.5166C10.8052%2012.6496%2010.6496%2012.8052%2010.5166%2012.9785C10.2847%2013.2809%2010.1467%2013.6738%2010.0742%2014.3164C10.0006%2014.9693%2010%2015.8157%2010%2017C10%2018.1843%2010.0006%2019.0307%2010.0742%2019.6836C10.1467%2020.3262%2010.2847%2020.7191%2010.5166%2021.0215C10.6496%2021.1948%2010.8052%2021.3504%2010.9785%2021.4834C11.2809%2021.7153%2011.6738%2021.8533%2012.3164%2021.9258C12.9693%2021.9994%2013.8157%2022%2015%2022C16.1843%2022%2017.0307%2021.9994%2017.6836%2021.9258C18.3262%2021.8533%2018.7191%2021.7153%2019.0215%2021.4834C19.1948%2021.3504%2019.3504%2021.1948%2019.4834%2021.0215C19.7153%2020.7191%2019.8533%2020.3262%2019.9258%2019.6836C19.9994%2019.0307%2020%2018.1843%2020%2017V16.5C20%2016.2239%2020.2239%2016%2020.5%2016C20.7761%2016%2021%2016.2239%2021%2016.5V17C21%2018.1612%2021.0003%2019.074%2020.9189%2019.7959C20.8364%2020.5278%2020.6642%2021.1254%2020.2764%2021.6309C20.0903%2021.8733%2019.8733%2022.0903%2019.6309%2022.2764C19.1254%2022.6642%2018.5278%2022.8364%2017.7959%2022.9189C17.074%2023.0003%2016.1612%2023%2015%2023C13.8388%2023%2012.926%2023.0003%2012.2041%2022.9189C11.4722%2022.8364%2010.8746%2022.6642%2010.3691%2022.2764C10.1267%2022.0903%209.90971%2021.8733%209.72363%2021.6309C9.33577%2021.1254%209.16358%2020.5278%209.08105%2019.7959C8.99967%2019.074%209%2018.1612%209%2017C9%2015.8388%208.99967%2014.926%209.08105%2014.2041C9.16358%2013.4722%209.33577%2012.8746%209.72363%2012.3691C9.90971%2012.1267%2010.1267%2011.9097%2010.3691%2011.7236C10.8746%2011.3358%2011.4722%2011.1636%2012.2041%2011.0811C12.926%2010.9997%2013.8388%2011%2015%2011H15.5Z'%20fill='%231E293B'/%3e%3cpath%20d='M22.5%209C22.7761%209%2023%209.22386%2023%209.5V14.5C23%2014.7761%2022.7761%2015%2022.5%2015C22.2239%2015%2022%2014.7761%2022%2014.5V10.707L15.8535%2016.8535C15.6583%2017.0488%2015.3417%2017.0488%2015.1465%2016.8535C14.9512%2016.6583%2014.9512%2016.3417%2015.1465%2016.1465L21.293%2010H17.5C17.2239%2010%2017%209.77614%2017%209.5C17%209.22386%2017.2239%209%2017.5%209H22.5Z'%20fill='%231E293B'/%3e%3c/svg%3e\") no-repeat center / 100%;mask:url(\"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15.5%2011C15.7761%2011%2016%2011.2239%2016%2011.5C16%2011.7761%2015.7761%2012%2015.5%2012H15C13.8157%2012%2012.9693%2012.0006%2012.3164%2012.0742C11.6738%2012.1467%2011.2809%2012.2847%2010.9785%2012.5166C10.8052%2012.6496%2010.6496%2012.8052%2010.5166%2012.9785C10.2847%2013.2809%2010.1467%2013.6738%2010.0742%2014.3164C10.0006%2014.9693%2010%2015.8157%2010%2017C10%2018.1843%2010.0006%2019.0307%2010.0742%2019.6836C10.1467%2020.3262%2010.2847%2020.7191%2010.5166%2021.0215C10.6496%2021.1948%2010.8052%2021.3504%2010.9785%2021.4834C11.2809%2021.7153%2011.6738%2021.8533%2012.3164%2021.9258C12.9693%2021.9994%2013.8157%2022%2015%2022C16.1843%2022%2017.0307%2021.9994%2017.6836%2021.9258C18.3262%2021.8533%2018.7191%2021.7153%2019.0215%2021.4834C19.1948%2021.3504%2019.3504%2021.1948%2019.4834%2021.0215C19.7153%2020.7191%2019.8533%2020.3262%2019.9258%2019.6836C19.9994%2019.0307%2020%2018.1843%2020%2017V16.5C20%2016.2239%2020.2239%2016%2020.5%2016C20.7761%2016%2021%2016.2239%2021%2016.5V17C21%2018.1612%2021.0003%2019.074%2020.9189%2019.7959C20.8364%2020.5278%2020.6642%2021.1254%2020.2764%2021.6309C20.0903%2021.8733%2019.8733%2022.0903%2019.6309%2022.2764C19.1254%2022.6642%2018.5278%2022.8364%2017.7959%2022.9189C17.074%2023.0003%2016.1612%2023%2015%2023C13.8388%2023%2012.926%2023.0003%2012.2041%2022.9189C11.4722%2022.8364%2010.8746%2022.6642%2010.3691%2022.2764C10.1267%2022.0903%209.90971%2021.8733%209.72363%2021.6309C9.33577%2021.1254%209.16358%2020.5278%209.08105%2019.7959C8.99967%2019.074%209%2018.1612%209%2017C9%2015.8388%208.99967%2014.926%209.08105%2014.2041C9.16358%2013.4722%209.33577%2012.8746%209.72363%2012.3691C9.90971%2012.1267%2010.1267%2011.9097%2010.3691%2011.7236C10.8746%2011.3358%2011.4722%2011.1636%2012.2041%2011.0811C12.926%2010.9997%2013.8388%2011%2015%2011H15.5Z'%20fill='%231E293B'/%3e%3cpath%20d='M22.5%209C22.7761%209%2023%209.22386%2023%209.5V14.5C23%2014.7761%2022.7761%2015%2022.5%2015C22.2239%2015%2022%2014.7761%2022%2014.5V10.707L15.8535%2016.8535C15.6583%2017.0488%2015.3417%2017.0488%2015.1465%2016.8535C14.9512%2016.6583%2014.9512%2016.3417%2015.1465%2016.1465L21.293%2010H17.5C17.2239%2010%2017%209.77614%2017%209.5C17%209.22386%2017.2239%209%2017.5%209H22.5Z'%20fill='%231E293B'/%3e%3c/svg%3e\") no-repeat center / 100%}.aiex-back-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.8686%2010.1621C19.0552%2010.3657%2019.0414%2010.682%2018.8379%2010.8686L13.2399%2016L18.8379%2021.1314C19.0414%2021.318%2019.0552%2021.6343%2018.8686%2021.8379C18.682%2022.0414%2018.3657%2022.0552%2018.1621%2021.8686L12.1621%2016.3686C12.0588%2016.2739%2012%2016.1402%2012%2016C12%2015.8598%2012.0588%2015.7261%2012.1621%2015.6314L18.1621%2010.1314C18.3657%209.94483%2018.682%209.95858%2018.8686%2010.1621Z'%20fill='%234A5E65'/%3e%3c/svg%3e\") no-repeat center / 100%;mask:url(\"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.8686%2010.1621C19.0552%2010.3657%2019.0414%2010.682%2018.8379%2010.8686L13.2399%2016L18.8379%2021.1314C19.0414%2021.318%2019.0552%2021.6343%2018.8686%2021.8379C18.682%2022.0414%2018.3657%2022.0552%2018.1621%2021.8686L12.1621%2016.3686C12.0588%2016.2739%2012%2016.1402%2012%2016C12%2015.8598%2012.0588%2015.7261%2012.1621%2015.6314L18.1621%2010.1314C18.3657%209.94483%2018.682%209.95858%2018.8686%2010.1621Z'%20fill='%234A5E65'/%3e%3c/svg%3e\") no-repeat center / 100%}.aiex-toggle-button{color:color-mix(in srgb,var( --lbf-text-secondary, var( --color-text-secondary, rgb(var(--now-color_text--secondary, 30, 41, 59)) ) ) 80%,black)}.aiex-toggle-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205L5%2015M5%205L15%2015'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e\") no-repeat center / 50%;mask:url(\"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205L5%2015M5%205L15%2015'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e\") no-repeat center / 50%}.aiex-toggle-button-floating{position:absolute;top:calc(1rem * var(--aiex-rem-scale, 1));inset-inline-end:calc(1.5rem * var(--aiex-rem-scale, 1));z-index:999;height:calc(2rem * var(--aiex-rem-scale, 1));width:calc(2rem * var(--aiex-rem-scale, 1));padding:0;border:none;cursor:pointer;border-radius:calc(.5rem * var(--aiex-rem-scale, 1));background-color:transparent;color:color-mix(in srgb,var( --lbf-text-secondary, var( --color-text-secondary, rgb(var(--now-color_text--secondary, 30, 41, 59)) ) ) 80%,black);transition:background-color .2s ease}.aiex-toggle-button-floating:after{content:\"\";position:absolute;inset:0;-webkit-mask:url(\"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205L5%2015M5%205L15%2015'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e\") no-repeat center / 50%;mask:url(\"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205L5%2015M5%205L15%2015'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e\") no-repeat center / 50%;background-color:currentColor}.aiex-toggle-button-floating:hover{background-color:color-mix(in srgb,currentColor 12%,transparent)}.aiex-toggle-button-floating:active{background-color:color-mix(in srgb,currentColor 20%,transparent)}@media(max-width:767px){.aiex-popout-button{display:none}}.widget-content-area{overflow:auto;flex:1;display:flex;flex-direction:column}");let nG=["annotations-search-results"],nz=o`
122
+ `}}handleDocumentViewerClose(){nV.debug("Document viewer closed"),this.dispatchEvent(new CustomEvent("CLOSE_INTERACTIVE_VIEW",{bubbles:!0,composed:!0}))}}nM([ed()],nB.prototype,"documentViewerLoaded"),nM([ed()],nB.prototype,"documentViewerResolved"),nM([ec()],nB.prototype,"widget"),nM([ec()],nB.prototype,"itemId"),nM([ec()],nB.prototype,"useKarunaWorkload"),nM([ec({attribute:"is-pinned"})],nB.prototype,"isPinned"),customElements.get("sn-widget-renderer")||customElements.define("sn-widget-renderer",nB);var nj=Object.defineProperty,nF=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nj(t,i,s),s};let nG=new CSSStyleSheet;nG.replaceSync("*{box-sizing:border-box}:host{height:100%;display:block;color-scheme:light dark;--aiex-icon-color: var( --aiex-text-primary, rgb(var(--now-color_text--primary, 16, 23, 26)) )}:host-context([data-theme=\"dark\"]),:host-context(.dark-theme),:host-context(.sn-dark-theme){color-scheme:dark}.interactive-view-container{display:flex;flex-direction:column;height:100%;width:100%;position:relative;min-width:calc(20rem * var(--aiex-rem-scale, 1))}.interactive-view-header{display:flex;align-items:center;justify-content:space-between;padding:calc(.25rem * var(--aiex-rem-scale, 1)) calc(.5rem * var(--aiex-rem-scale, 1)) calc(.25rem * var(--aiex-rem-scale, 1)) calc(.75rem * var(--aiex-rem-scale, 1));flex-shrink:0;height:calc(3rem * var(--aiex-rem-scale, 1));box-sizing:border-box;margin-bottom:calc(.25rem * var(--aiex-rem-scale, 1));background-color:var( --aiex-bg-primary, rgb(var(--now-color_background--primary, 255, 255, 255)) );border-bottom:1px solid light-dark(rgb(229,231,235),rgba(255,255,255,.1));transition:height .2s cubic-bezier(.52,.01,.3,.99),margin-bottom .2s cubic-bezier(.52,.01,.3,.99),padding .2s cubic-bezier(.52,.01,.3,.99),opacity .2s cubic-bezier(.52,.01,.3,.99);gap:calc(.5rem * var(--aiex-rem-scale, 1));overflow:hidden}.interactive-view-header.hidden{height:0;margin-bottom:0;opacity:0;pointer-events:none;padding:0 calc(.5rem * var(--aiex-rem-scale, 1)) 0 calc(.75rem * var(--aiex-rem-scale, 1))}.interactive-view-header.visible{margin-bottom:0;position:relative;z-index:1;overflow:visible;box-shadow:0 calc(.075rem * var(--aiex-rem-scale, 1)) calc(.25rem * var(--aiex-rem-scale, 1)) light-dark(rgba(0 0 0 .08),rgba(0,0,0,.4))}.interactive-view-header .header-actions{display:flex;align-items:center;gap:calc(.5rem * var(--aiex-rem-scale, 1));flex-shrink:0;margin-inline-start:auto}.interactive-view-header .icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;background:#fff3;border-radius:8px;backdrop-filter:blur(10px);transition:all .3s ease}.interactive-view-header .icon img{width:20px;height:20px;object-fit:contain}.interactive-view-header .label{flex:1;min-width:0;font-size:calc(1.125rem * var(--aiex-rem-scale, 1));font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var( --aiex-text-primary, rgb(var(--now-color_text--primary, 16, 23, 26)) )}.interactive-view-header .slot{flex:1;display:flex;align-items:center;justify-content:flex-end;gap:calc(.25rem * var(--aiex-rem-scale, 1));min-width:0;overflow:hidden;margin-inline-end:6%}.header-icon-button{position:relative;display:flex;align-items:center;justify-content:center;height:calc(2rem * var(--aiex-rem-scale, 1));width:calc(2rem * var(--aiex-rem-scale, 1));padding:0;background-color:transparent;border:none;cursor:pointer;border-radius:calc(.5rem * var(--aiex-rem-scale, 1));flex-shrink:0;color:var(--aiex-icon-color);transition:background-color .2s ease}.header-icon-button:hover{background-color:color-mix(in srgb,currentColor 12%,transparent)}.header-icon-button:active{background-color:color-mix(in srgb,currentColor 20%,transparent)}.tooltip{visibility:hidden;opacity:0;position:absolute;top:calc(100% + calc(.375rem * var(--aiex-rem-scale, 1)));left:50%;transform:translate(-50%);background:rgb(var(--now-tooltip--background-color, 0, 0, 0));color:rgb(var(--now-tooltip--color, 255, 255, 255));font-size:calc(.75rem * var(--aiex-rem-scale, 1));font-weight:500;line-height:1;padding:calc(.375rem * var(--aiex-rem-scale, 1)) calc(.5rem * var(--aiex-rem-scale, 1));border-radius:calc(.25rem * var(--aiex-rem-scale, 1));white-space:nowrap;pointer-events:none;z-index:10;transition:opacity .15s ease,visibility .15s ease}.tooltip:before{content:\"\";position:absolute;bottom:100%;left:50%;transform:translate(-50%);border:calc(.1875rem * var(--aiex-rem-scale, 1)) solid transparent;border-bottom-color:rgb(var(--now-tooltip--background-color, 0, 0, 0))}.header-icon-button:hover>.tooltip,.header-icon-button:focus-visible>.tooltip{visibility:visible;opacity:1}.aiex-popout-button:after,.aiex-back-button:after,.aiex-toggle-button:after{content:\"\";position:absolute;inset:0;background-color:currentColor}.aiex-popout-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15.5%2011C15.7761%2011%2016%2011.2239%2016%2011.5C16%2011.7761%2015.7761%2012%2015.5%2012H15C13.8157%2012%2012.9693%2012.0006%2012.3164%2012.0742C11.6738%2012.1467%2011.2809%2012.2847%2010.9785%2012.5166C10.8052%2012.6496%2010.6496%2012.8052%2010.5166%2012.9785C10.2847%2013.2809%2010.1467%2013.6738%2010.0742%2014.3164C10.0006%2014.9693%2010%2015.8157%2010%2017C10%2018.1843%2010.0006%2019.0307%2010.0742%2019.6836C10.1467%2020.3262%2010.2847%2020.7191%2010.5166%2021.0215C10.6496%2021.1948%2010.8052%2021.3504%2010.9785%2021.4834C11.2809%2021.7153%2011.6738%2021.8533%2012.3164%2021.9258C12.9693%2021.9994%2013.8157%2022%2015%2022C16.1843%2022%2017.0307%2021.9994%2017.6836%2021.9258C18.3262%2021.8533%2018.7191%2021.7153%2019.0215%2021.4834C19.1948%2021.3504%2019.3504%2021.1948%2019.4834%2021.0215C19.7153%2020.7191%2019.8533%2020.3262%2019.9258%2019.6836C19.9994%2019.0307%2020%2018.1843%2020%2017V16.5C20%2016.2239%2020.2239%2016%2020.5%2016C20.7761%2016%2021%2016.2239%2021%2016.5V17C21%2018.1612%2021.0003%2019.074%2020.9189%2019.7959C20.8364%2020.5278%2020.6642%2021.1254%2020.2764%2021.6309C20.0903%2021.8733%2019.8733%2022.0903%2019.6309%2022.2764C19.1254%2022.6642%2018.5278%2022.8364%2017.7959%2022.9189C17.074%2023.0003%2016.1612%2023%2015%2023C13.8388%2023%2012.926%2023.0003%2012.2041%2022.9189C11.4722%2022.8364%2010.8746%2022.6642%2010.3691%2022.2764C10.1267%2022.0903%209.90971%2021.8733%209.72363%2021.6309C9.33577%2021.1254%209.16358%2020.5278%209.08105%2019.7959C8.99967%2019.074%209%2018.1612%209%2017C9%2015.8388%208.99967%2014.926%209.08105%2014.2041C9.16358%2013.4722%209.33577%2012.8746%209.72363%2012.3691C9.90971%2012.1267%2010.1267%2011.9097%2010.3691%2011.7236C10.8746%2011.3358%2011.4722%2011.1636%2012.2041%2011.0811C12.926%2010.9997%2013.8388%2011%2015%2011H15.5Z'%20fill='%231E293B'/%3e%3cpath%20d='M22.5%209C22.7761%209%2023%209.22386%2023%209.5V14.5C23%2014.7761%2022.7761%2015%2022.5%2015C22.2239%2015%2022%2014.7761%2022%2014.5V10.707L15.8535%2016.8535C15.6583%2017.0488%2015.3417%2017.0488%2015.1465%2016.8535C14.9512%2016.6583%2014.9512%2016.3417%2015.1465%2016.1465L21.293%2010H17.5C17.2239%2010%2017%209.77614%2017%209.5C17%209.22386%2017.2239%209%2017.5%209H22.5Z'%20fill='%231E293B'/%3e%3c/svg%3e\") no-repeat center / 100%;mask:url(\"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15.5%2011C15.7761%2011%2016%2011.2239%2016%2011.5C16%2011.7761%2015.7761%2012%2015.5%2012H15C13.8157%2012%2012.9693%2012.0006%2012.3164%2012.0742C11.6738%2012.1467%2011.2809%2012.2847%2010.9785%2012.5166C10.8052%2012.6496%2010.6496%2012.8052%2010.5166%2012.9785C10.2847%2013.2809%2010.1467%2013.6738%2010.0742%2014.3164C10.0006%2014.9693%2010%2015.8157%2010%2017C10%2018.1843%2010.0006%2019.0307%2010.0742%2019.6836C10.1467%2020.3262%2010.2847%2020.7191%2010.5166%2021.0215C10.6496%2021.1948%2010.8052%2021.3504%2010.9785%2021.4834C11.2809%2021.7153%2011.6738%2021.8533%2012.3164%2021.9258C12.9693%2021.9994%2013.8157%2022%2015%2022C16.1843%2022%2017.0307%2021.9994%2017.6836%2021.9258C18.3262%2021.8533%2018.7191%2021.7153%2019.0215%2021.4834C19.1948%2021.3504%2019.3504%2021.1948%2019.4834%2021.0215C19.7153%2020.7191%2019.8533%2020.3262%2019.9258%2019.6836C19.9994%2019.0307%2020%2018.1843%2020%2017V16.5C20%2016.2239%2020.2239%2016%2020.5%2016C20.7761%2016%2021%2016.2239%2021%2016.5V17C21%2018.1612%2021.0003%2019.074%2020.9189%2019.7959C20.8364%2020.5278%2020.6642%2021.1254%2020.2764%2021.6309C20.0903%2021.8733%2019.8733%2022.0903%2019.6309%2022.2764C19.1254%2022.6642%2018.5278%2022.8364%2017.7959%2022.9189C17.074%2023.0003%2016.1612%2023%2015%2023C13.8388%2023%2012.926%2023.0003%2012.2041%2022.9189C11.4722%2022.8364%2010.8746%2022.6642%2010.3691%2022.2764C10.1267%2022.0903%209.90971%2021.8733%209.72363%2021.6309C9.33577%2021.1254%209.16358%2020.5278%209.08105%2019.7959C8.99967%2019.074%209%2018.1612%209%2017C9%2015.8388%208.99967%2014.926%209.08105%2014.2041C9.16358%2013.4722%209.33577%2012.8746%209.72363%2012.3691C9.90971%2012.1267%2010.1267%2011.9097%2010.3691%2011.7236C10.8746%2011.3358%2011.4722%2011.1636%2012.2041%2011.0811C12.926%2010.9997%2013.8388%2011%2015%2011H15.5Z'%20fill='%231E293B'/%3e%3cpath%20d='M22.5%209C22.7761%209%2023%209.22386%2023%209.5V14.5C23%2014.7761%2022.7761%2015%2022.5%2015C22.2239%2015%2022%2014.7761%2022%2014.5V10.707L15.8535%2016.8535C15.6583%2017.0488%2015.3417%2017.0488%2015.1465%2016.8535C14.9512%2016.6583%2014.9512%2016.3417%2015.1465%2016.1465L21.293%2010H17.5C17.2239%2010%2017%209.77614%2017%209.5C17%209.22386%2017.2239%209%2017.5%209H22.5Z'%20fill='%231E293B'/%3e%3c/svg%3e\") no-repeat center / 100%}.aiex-back-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.8686%2010.1621C19.0552%2010.3657%2019.0414%2010.682%2018.8379%2010.8686L13.2399%2016L18.8379%2021.1314C19.0414%2021.318%2019.0552%2021.6343%2018.8686%2021.8379C18.682%2022.0414%2018.3657%2022.0552%2018.1621%2021.8686L12.1621%2016.3686C12.0588%2016.2739%2012%2016.1402%2012%2016C12%2015.8598%2012.0588%2015.7261%2012.1621%2015.6314L18.1621%2010.1314C18.3657%209.94483%2018.682%209.95858%2018.8686%2010.1621Z'%20fill='%234A5E65'/%3e%3c/svg%3e\") no-repeat center / 100%;mask:url(\"data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.8686%2010.1621C19.0552%2010.3657%2019.0414%2010.682%2018.8379%2010.8686L13.2399%2016L18.8379%2021.1314C19.0414%2021.318%2019.0552%2021.6343%2018.8686%2021.8379C18.682%2022.0414%2018.3657%2022.0552%2018.1621%2021.8686L12.1621%2016.3686C12.0588%2016.2739%2012%2016.1402%2012%2016C12%2015.8598%2012.0588%2015.7261%2012.1621%2015.6314L18.1621%2010.1314C18.3657%209.94483%2018.682%209.95858%2018.8686%2010.1621Z'%20fill='%234A5E65'/%3e%3c/svg%3e\") no-repeat center / 100%}.aiex-toggle-button{color:color-mix(in srgb,var( --lbf-text-secondary, var( --color-text-secondary, rgb(var(--now-color_text--secondary, 30, 41, 59)) ) ) 80%,black)}.aiex-toggle-button:after{-webkit-mask:url(\"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205L5%2015M5%205L15%2015'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e\") no-repeat center / 50%;mask:url(\"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205L5%2015M5%205L15%2015'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e\") no-repeat center / 50%}.aiex-toggle-button-floating{position:absolute;top:calc(1rem * var(--aiex-rem-scale, 1));inset-inline-end:calc(1.5rem * var(--aiex-rem-scale, 1));z-index:999;height:calc(2rem * var(--aiex-rem-scale, 1));width:calc(2rem * var(--aiex-rem-scale, 1));padding:0;border:none;cursor:pointer;border-radius:calc(.5rem * var(--aiex-rem-scale, 1));background-color:transparent;color:color-mix(in srgb,var( --lbf-text-secondary, var( --color-text-secondary, rgb(var(--now-color_text--secondary, 30, 41, 59)) ) ) 80%,black);transition:background-color .2s ease}.aiex-toggle-button-floating:after{content:\"\";position:absolute;inset:0;-webkit-mask:url(\"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205L5%2015M5%205L15%2015'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e\") no-repeat center / 50%;mask:url(\"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%205L5%2015M5%205L15%2015'%20stroke='currentColor'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e\") no-repeat center / 50%;background-color:currentColor}.aiex-toggle-button-floating:hover{background-color:color-mix(in srgb,currentColor 12%,transparent)}.aiex-toggle-button-floating:active{background-color:color-mix(in srgb,currentColor 20%,transparent)}@media(max-width:767px){.aiex-popout-button{display:none}}.widget-content-area{overflow:auto;flex:1;display:flex;flex-direction:column}");let nz=["annotations-search-results"],nX=o`
132
123
  :host {
133
124
  display: block;
134
125
  width: 100%;
135
126
  height: 100%;
136
127
  }
137
- `;class nX extends ea{constructor(){super(...arguments),this.widget={},this.itemId="",this.useKarunaWorkload=!1,this.showInteractiveView=!1,this.canGoBack=!1,this.filledInteractiveViewSlot=!1,this.headerVisible=!0,this.detectors=[],this.onScrollDirection=e=>{this.headerVisible="up"===e},this.onIframeReady=e=>{let{contentDocument:t}=e.detail;for(;this.detectors.length>1;)this.detectors.pop().destroy();this.headerVisible=!0;let i=new nn(t,!0,this.getHeaderHeightPx());i.onScroll=this.onScrollDirection,this.detectors.push(i)},this.header=()=>B`
128
+ `;class nq extends ea{constructor(){super(...arguments),this.widget={},this.itemId="",this.useKarunaWorkload=!1,this.showInteractiveView=!1,this.canGoBack=!1,this.filledInteractiveViewSlot=!1,this.headerVisible=!0,this.detectors=[],this.onScrollDirection=e=>{this.headerVisible="up"===e},this.onIframeReady=e=>{let{contentDocument:t}=e.detail;for(;this.detectors.length>1;)this.detectors.pop().destroy();this.headerVisible=!0;let i=new nn(t,!0,this.getHeaderHeightPx());i.onScroll=this.onScrollDirection,this.detectors.push(i)},this.header=()=>B`
138
129
  <div
139
130
  class="interactive-view-header ${this.headerVisible?"visible":"hidden"}"
140
131
  >
@@ -168,7 +159,7 @@ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeSh
168
159
  @click="${()=>this.dispatchEvent(new CustomEvent("CLOSE_INTERACTIVE_VIEW",{bubbles:!0,composed:!0,detail:{widgetData:this.widget}}))}"
169
160
  aria-label="Toggle Interactive View"
170
161
  ></button>
171
- `:null}static{this.styles=[nF,nz]}connectedCallback(){super.connectedCallback(),this.addEventListener(i7,nt),this.addEventListener(i4,this.onIframeReady)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(i7,nt),this.removeEventListener(i4,this.onIframeReady),this.detectors.forEach(e=>e.destroy()),this.detectors=[]}firstUpdated(){let e=this.widgetContentArea;e&&this.attachDetector(e)}getHeaderHeightPx(){return this.interactiveViewHeader?.offsetHeight||void 0}attachDetector(e){let t=new nn(e,!1,this.getHeaderHeightPx());t.onScroll=this.onScrollDirection,this.detectors.push(t)}widgetHasOwnHeader(){let e=this.widget?.id;return"string"==typeof e&&nG.includes(e)}render(){let e=this.widgetHasOwnHeader();return B`
162
+ `:null}static{this.styles=[nG,nX]}connectedCallback(){super.connectedCallback(),this.addEventListener(i7,nt),this.addEventListener(i4,this.onIframeReady)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(i7,nt),this.removeEventListener(i4,this.onIframeReady),this.detectors.forEach(e=>e.destroy()),this.detectors=[]}firstUpdated(){let e=this.widgetContentArea;e&&this.attachDetector(e)}getHeaderHeightPx(){return this.interactiveViewHeader?.offsetHeight||void 0}attachDetector(e){let t=new nn(e,!1,this.getHeaderHeightPx());t.onScroll=this.onScrollDirection,this.detectors.push(t)}widgetHasOwnHeader(){let e=this.widget?.id;return"string"==typeof e&&nz.includes(e)}render(){let e=this.widgetHasOwnHeader();return B`
172
163
  <div class="interactive-view-container">
173
164
  ${e?this.renderCloseButton(!0):this.header()}
174
165
  <div class="widget-content-area">${this.renderWidget()}</div>
@@ -179,13 +170,13 @@ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeSh
179
170
  .itemId=${this.itemId}
180
171
  .useKarunaWorkload=${this.useKarunaWorkload}
181
172
  ></sn-widget-renderer>
182
- `:B`<div>No widget data provided</div>`}}nj([ec()],nX.prototype,"widget"),nj([ec()],nX.prototype,"itemId"),nj([ec()],nX.prototype,"useKarunaWorkload"),nj([ec()],nX.prototype,"showInteractiveView"),nj([ec()],nX.prototype,"canGoBack"),nj([eh("#interactive-view-slot")],nX.prototype,"interactiveViewSlot"),nj([eh(".widget-content-area")],nX.prototype,"widgetContentArea"),nj([eh(".interactive-view-header")],nX.prototype,"interactiveViewHeader"),nj([ed()],nX.prototype,"filledInteractiveViewSlot"),nj([ed()],nX.prototype,"headerVisible"),customElements.get("sn-interactive-view")||customElements.define("sn-interactive-view",nX);var nq=Object.defineProperty,nK=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nq(t,i,s),s};let nQ=new CSSStyleSheet;nQ.replaceSync(":host{box-sizing:border-box}");class nZ extends ea{constructor(){super(...arguments),this.setRoute=void 0,this.mode="primary",this.mwProps={}}static{this.styles=[nQ]}async connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}updated(e){super.updated(e)}render(){switch(this.mode){case"primary":case"side":default:return B` <mw-main-content></mw-main-content> `;case"hero":return B`
173
+ `:B`<div>No widget data provided</div>`}}nF([ec()],nq.prototype,"widget"),nF([ec()],nq.prototype,"itemId"),nF([ec()],nq.prototype,"useKarunaWorkload"),nF([ec()],nq.prototype,"showInteractiveView"),nF([ec()],nq.prototype,"canGoBack"),nF([eh("#interactive-view-slot")],nq.prototype,"interactiveViewSlot"),nF([eh(".widget-content-area")],nq.prototype,"widgetContentArea"),nF([eh(".interactive-view-header")],nq.prototype,"interactiveViewHeader"),nF([ed()],nq.prototype,"filledInteractiveViewSlot"),nF([ed()],nq.prototype,"headerVisible"),customElements.get("sn-interactive-view")||customElements.define("sn-interactive-view",nq);var nK=Object.defineProperty,nQ=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nK(t,i,s),s};let nZ=new CSSStyleSheet;nZ.replaceSync(":host{box-sizing:border-box}");class nJ extends ea{constructor(){super(...arguments),this.setRoute=void 0,this.mode="primary",this.mwProps={}}static{this.styles=[nZ]}async connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}updated(e){super.updated(e)}render(){switch(this.mode){case"primary":case"side":default:return B` <mw-main-content></mw-main-content> `;case"hero":return B`
183
174
  <mw-omnibar
184
175
  variant="default"
185
176
  show-recommended-queries
186
177
  show-greeting-header
187
178
  ></mw-omnibar>
188
- `;case"omni":return B` <mw-omnibar variant="omni"></mw-omnibar> `}}}function nJ(){return new Promise((e,t)=>{let i=0,n=()=>{if(window.__AIEX_GLOBALS__)e(!0);else{if(++i>=10)return void t(!1);setTimeout(n,500)}};n()})}function nY(e){return new Promise((t,i)=>{let n=0,r=()=>{if(!e.isConnected)return void i(!1);if(e.shadowRoot?.querySelector("now-lbf-chat-client"))t(!0);else{if(++n>=10)return void i(!1);setTimeout(r,500)}};r()})}nK([ec()],nZ.prototype,"setRoute"),nK([ec()],nZ.prototype,"mode"),nK([ec()],nZ.prototype,"mwProps"),customElements.get("sn-mw-component")||customElements.define("sn-mw-component",nZ);let n0=iF("Subscription");function n2(e){if(!e||0===Object.keys(e).length)return;let t={...e};if("string"==typeof t.transferred_search_result)try{t.transferred_search_result=JSON.parse(t.transferred_search_result)}catch{}return t}function n1(e,t,i,n){e.sessionContext&&(!function(e){let{deploymentDocumentId:t,deploymentDocumentTable:i,nowAssistDeploymentId:n,...r}=e;return 0===Object.keys(r).length}(t)?e.sessionContext.pageContext=t:(e.sessionContext.pageContext={...t,...function(){let e=window.ux_globals?.initialRoute;if(!e)return{};let t={};return e.context?.experienceName==="Unified Navigation App"?(t.experienceName="Core UI",t.pageType="Core ui"):(t.experienceName="workspace",t.pageType="UXF"),e.route&&(t.route=e?.route,["record","list","home","search","other"].includes(e.route)?t.type=e?.route:t.type="other"),e.fields&&(e.fields?.sysId&&(t.sysId=e?.fields?.sysId),e.fields?.table&&(t.table=e?.fields?.table)),t}()},window.__AIEX_GLOBALS__?.updatePageContext(e.sessionContext.pageContext)),e.sessionContext.pageContext?.deploymentDocumentId||(e.sessionContext.pageContext.deploymentDocumentId=i),e.sessionContext.pageContext?.deploymentDocumentTable||(e.sessionContext.pageContext.deploymentDocumentTable=n))}function n3(e){let t=e.lbfProps?.[".pageContext"];t&&e.sessionContext?.pageContext&&(t.deploymentDocumentId&&(e.sessionContext.pageContext.deploymentDocumentId=t.deploymentDocumentId),t.deploymentDocumentTable&&(e.sessionContext.pageContext.deploymentDocumentTable=t.deploymentDocumentTable))}let n5=iF("Mobile"),n6=e=>`com.servicenow.cabrillo.${e}`,n9=()=>{let e=window.CabrilloClient;if("object"==typeof e&&null!==e)return"function"==typeof e.hasMethod&&"function"==typeof e.postMethod?e:void 0},n8=e=>{let t=window.webkit?.messageHandlers?.[e];if("object"==typeof t&&null!==t)return"function"==typeof t.postMessage?t:void 0},n7=()=>(void 0===e&&(e=typeof window>"u"?"web":void 0!==n9()?"android":void 0!==n8(n6("modal.presentModal"))?"ios":"web"),e),n4=e=>"web"!==n7()&&((e,t="",i="close")=>((e,t)=>{let i=n6(e),n=n9();if(n)return!!n.hasMethod(i)&&(n.postMethod(i,JSON.stringify({options:t})),!0);let r=n8(i);return!!r&&(r.postMessage({options:t}),!0)})("modal.presentModal",{url:e,title:t,closeButtonStyle:i}))(e)?(n5.info("presentModal",{platform:n7(),url:e}),!0):!!navigator.userAgent.includes("SnMobile")&&(n5.info("UA fallback -> location.href",{url:e}),window.location.href=e,!0),re=iF("Events");function rt(e,t){if(e.isFormDirty){let i=e.getIframeCurrentUrl(),n=e.getIframeOriginalSrc();if(i&&n&&i!==n)e.isFormDirty=!1;else{e.pendingDirtyAction=t;return}}t()}function ri(e){if(nA(e)||!function(e){try{let t=new URL(e,window.location.origin);if(!t.searchParams.has("id"))return!1;let i=t.pathname.split("/").filter(Boolean)[0]??"";return!i.includes(".do")&&"api"!==i}catch{return!1}}(e))return e;let t=window.__AIEX_GLOBALS__?.getActiveConversation?.(),i=t?`&aiex_cid=${t}`:"";return`${e}&aiex_open=true&aiex_float=true${i}`}function rn(e){let{isDirty:t}=e.detail;this.isFormDirty=t}function rr(){this.pendingDirtyAction=null,this.pendingDirtyResolver&&(this.pendingDirtyResolver({allow:!1}),this.pendingDirtyResolver=null)}function rs(){this.isFormDirty=!1,this.showInteractiveView=!1,this.pendingDirtyResolver&&(this.pendingDirtyResolver({allow:!0}),this.pendingDirtyResolver=null)}function ro(e){let{type:t}=e.detail;switch(t){case"conversation:created":rd.call(this,e.detail);break;case"conversation:selected":ru.call(this,e.detail);break;case"execute:client:tool":rv.call(this,e.detail);break;case"AGENTIC_EXECUTION_STARTED":rh.call(this,e.detail);break;case ia:rw.call(this,e.detail);break;case"HIDE_INTERACTIVE_VIEW":rg.call(this);break;case ic:rf.call(this);break;case"conversation:switched":rp.call(this,e.detail);break;case"bootstrap:end":rC.call(this,e.detail);break;case"session:success":rE.call(this,e.detail);break;case"session:failure":r$.call(this);break;case"link:clicked":rc.call(this,e.detail);break;case"search:view-all-clicked":rk(e.detail?.payload);break;case"conversation:create-prevented":ra.call(this);break;case"relay:custom-action":rl.call(this,e.detail);break;case"auth:session-expired":rA.call(this)}}async function ra(){this.lbfClientRef?.value?.focus()}async function rl(e){let{params:t,conversationId:i}=e.payload;try{await window.__AIEX_GLOBALS__?.sendCustomAction({params:t,conversationId:i})}catch(e){re.error("Failed to relay custom action",e)}}async function rc({payload:e}){let{href:t,event:i,openInNewTab:n}=e;re.info("Navigation request received on AIEX",{targetUrl:t});let r=i?.composedPath?.().find(e=>e?.tagName?.toLowerCase?.()==="a")?.getAttribute?.("target")==="_blank";try{if(await window.__AIEX_GLOBALS__?.navigateToRoute(e),!i?.defaultPrevented&&(i.preventDefault(),t&&!(!nI(t)&&n4(t))))if(!0===n)window.open(t,"_blank");else if(nA(t))window.NOW?.isPolarisWrapper?this.dispatchEvent(new CustomEvent(ih,{composed:!0,bubbles:!0,detail:(({targetUrl:e})=>({type:ih,payload:{options:{},context:{path:globalThis?.ux_globals?.siteName,experienceName:globalThis?.ux_globals?.experienceConfigs?.[globalThis?.ux_globals?.siteName]?.experienceName},external:{url:e}},error:null,meta:{path:[globalThis?.location?.host],appended:{},event:null,options:{}}}))({targetUrl:t})})):window.open(t,"_blank");else if((e=>{try{return e.split("/")?.[1]?.split(".do")?.[0]==="$"}catch{return!1}})(t))window.open(t.replace("/$","/"),"_blank");else if(nI(t))rw.call(this,{detail:{widgetId:"default-iframe-widget",widgetData:{type:"iframe",url:t}}});else if(r)window.open(ri(t),"_blank");else if(window.NOW?.isPolarisWrapper){let e=t+(t.includes("?")?"&":"?")+"sys_canvas=true";this.dispatchEvent(new CustomEvent(id,{composed:!0,bubbles:!0,detail:nS({targetUrl:e})})),this.isModal&&window.nowWindowManager?.toggleModal("now-ai-canvas-window"),this.isDocked||window.nowWindowManager?.toggleDock("now-ai-canvas-window","rtl"===document.dir?"left":"right")}else window.open(ri(t),"_blank")}catch(e){re.error("Navigation request failed on AIEX",e)}}function rd(e){this.debug&&re.debug("New conversation created"),this.isFormDirty=!1,this.pendingDirtyAction=null,window.__AIEX_GLOBALS__?.setActiveConversation(e.payload.conversationId),this.lbfProps={...this.lbfProps,".forceNewConversation":!1,".conversationId":e.payload.conversationId}}function rh(e){this.showInteractiveView=!1}function ru(e){window.__AIEX_GLOBALS__?.setActiveConversation(e.payload.conversationId),rt(this,()=>{this.isFormDirty=!1,this.widgetData={},this.activeWidgetId="",this.hasInteractiveView=!1,this.showInteractiveView=!1,this.interactiveViewHistoryStack=[]})}function rp(e){window.__AIEX_GLOBALS__?.setActiveConversation(e.payload.toConversationId),rt(this,()=>{this.isFormDirty=!1,this.widgetData={},this.activeWidgetId="",this.hasInteractiveView=!1,this.showInteractiveView=!1,this.interactiveViewHistoryStack=[],this.lbfProps={...this.lbfProps,".forceNewConversation":!1,".conversationId":e.payload.toConversationId}})}function rv(e){let{callId:t,threadId:i,widgetId:n,actionType:r,args:s,resolve:o,reject:a}=e.payload;window.__AIEX_GLOBALS__?.updateIntent({callId:t,threadId:i,widgetId:n,actionType:r,args:s}),this.toolExecutionCallbacks[t]={resolve:o,reject:a}}function rw(e){let{widgetData:t,widgetId:i,itemId:n,useKarunaWorkload:r}=e.detail;if(t?.type==="iframe"&&!nI(t.url)){n4(t.url)||(window.NOW?.isPolarisWrapper?(this.dispatchEvent(new CustomEvent(id,{composed:!0,bubbles:!0,detail:nS({targetUrl:t.url})})),this.isModal&&window.nowWindowManager?.toggleModal("now-ai-canvas-window"),this.isDocked||window.nowWindowManager?.toggleDock("now-ai-canvas-window","rtl"===document.dir?"left":"right")):window.open(t.url,"_blank"));return}let s=t;t?.type==="iframe"&&t?.url&&(s={...t,normalizedURLs:nL(t.url)}),rt(this,()=>{this.isFormDirty=!1,this.widgetData?.normalizedURLs?.ivUrl&&s?.normalizedURLs?.ivUrl&&this.widgetData.normalizedURLs.ivUrl===s.normalizedURLs.ivUrl?(this.widgetData=null,requestAnimationFrame(()=>{this.widgetData=s,this.activeWidgetId=i,this.itemId=n??"",this.useKarunaWorkload=r??!1})):(this.widgetData=s,this.activeWidgetId=i,this.itemId=n??"",this.useKarunaWorkload=r??!1),this.showInteractiveView=!0,this.hasInteractiveView=!0,this.isDocked&&window.nowWindowManager?.toggleModal("now-ai-canvas-window",!0);let e=function(e,t){if("org-user-chart"===e)return{tableName:"sys_user",sysId:t?.payload?.selectedUserId};if("default-iframe-widget"===e){let e=(e=>{if(!e)return{table:"",sysId:""};let t=e.split("/")?.[1]?.split(".do")?.[0]||"",i=e.split(".do?")[1];if(!i)return{table:t,sysId:""};let n=e=>i.split(`${e}=`)[1]?.split("&")[0];return{table:t,sysId:n("sys_id")||n("sys_kb_id")||n("sysparm_id")||""}})(t?.url);return{tableName:t?.tableName||e.table,sysId:t?.sysId||e.sysId}}return null}(i,s);e&&window.__AIEX_GLOBALS__?.telemetryRequested(iN,{"Table name":e.tableName,"Sys id":e.sysId})})}function rg(){rt(this,()=>{this.isFormDirty=!1,this.showInteractiveView=!1,this.activeWidgetId="",this.interactiveViewHistoryStack=[],window.__AIEX_GLOBALS__?.telemetryRequested(iW,{"Closed by":"user"})})}function rf(){this.showInteractiveView?rt(this,()=>{this.isFormDirty=!1,this.showInteractiveView=!1,this.activeWidgetId="",this.interactiveViewHistoryStack=[],window.__AIEX_GLOBALS__?.telemetryRequested(iW,{"Closed by":"user"})}):(this.showInteractiveView=!0,this.isDocked&&window.nowWindowManager?.toggleModal("now-ai-canvas-window",!0),window.__AIEX_GLOBALS__?.telemetryRequested(iN,{"Opened by":"user","Table name":this.widgetData?.tableName,"Sys id":this.widgetData?.sysId}))}function rm(e){let{widgetData:t,widgetId:i}=e.detail;rt(this,()=>{this.isFormDirty=!1,this.widgetData&&(this.interactiveViewHistoryStack=[...this.interactiveViewHistoryStack,{widgetData:this.widgetData,widgetId:this.activeWidgetId}]),this.widgetData=t,this.activeWidgetId=i})}let rb=0;function r_(e){let{targetUrl:t,targetTable:i,targetSysId:n}=e.detail;if(!t)return;let r=Date.now();if(!(r-rb<300))if(rb=r,window.NOW?.isPolarisWrapper)this.dispatchEvent(new CustomEvent(id,{composed:!0,bubbles:!0,detail:nS({targetUrl:t})})),this.showInteractiveView=!1,this.activeWidgetId="",this.interactiveViewHistoryStack=[],this.isModal&&window.nowWindowManager?.toggleModal("now-ai-canvas-window"),window.nowWindowManager?.toggleDock("now-ai-canvas-window","right");else{let e=window.location.pathname.split("/")[1],r=window.__AIEX_GLOBALS__?.getActiveConversation?.(),s=e&&i&&n?`/${e}?id=form&table=${i}&sys_id=${n}&aiex_open=true&aiex_float=true${r?`&aiex_cid=${r}`:""}`:t;window.open(s,"_blank")}}function ry(){0!==this.interactiveViewHistoryStack.length&&rt(this,()=>{this.isFormDirty=!1;let e=this.interactiveViewHistoryStack[this.interactiveViewHistoryStack.length-1];this.interactiveViewHistoryStack=this.interactiveViewHistoryStack.slice(0,-1),this.widgetData=e.widgetData,this.activeWidgetId=e.widgetId})}function rx(e){let{widgetData:t}=e.detail,i=this.getIframeCurrentUrl(),n=this.getIframeOriginalSrc(),r=t?.url,s=i&&n&&i!==n,o=s?i:r;o&&rt(this,()=>{this.isFormDirty=!1;let e=window.NOW?.isPolarisWrapper?t?.normalizedURLs?.popoutUrl?.platform:t?.normalizedURLs?.popoutUrl?.portal;if(!(e&&nA(e))&&window.NOW?.isPolarisWrapper){let t=e||o;if(s)try{let e=new URL(o,window.location.origin),i=e.searchParams.get("table"),n=e.searchParams.get("sys_id");i&&n&&(t=`/${i}.do?sys_id=${n}`)}catch{}let i=t.split("/")?.[1]?.split("?")?.[0],n="swp"===i||"esc"===i||"sp"===i?t+(t.includes("?")?"&":"?")+"sys_canvas=true":t;this.dispatchEvent(new CustomEvent(id,{composed:!0,bubbles:!0,detail:nS({targetUrl:n})})),this.showInteractiveView=!1,this.activeWidgetId="",this.interactiveViewHistoryStack=[],this.isModal&&window.nowWindowManager?.toggleModal("now-ai-canvas-window"),window.nowWindowManager?.toggleDock("now-ai-canvas-window","rtl"===document.dir?"left":"right")}else{let t=window.NOW?.portal_url_suffix||window.location.pathname.split("/")[1],i=window.__AIEX_GLOBALS__?.getActiveConversation?.(),n=null;if(s)try{let e=new URL(o,window.location.origin),r=e.searchParams.get("table"),s=e.searchParams.get("sys_id");t&&r&&s&&(n=`/${t}?id=form&table=${r}&sys_id=${s}&aiex_open=true&aiex_float=true${i?`&aiex_cid=${i}`:""}`)}catch{}window.open(n||e||o,"_blank")}})}function rC(e){let{componentId:t}=e;this.initializedChatClients.has(t)||(this.aielUnsubscribers.forEach(e=>e()),this.aielUnsubscribers=[],this.initializedChatClients.add(t),Promise.resolve(window.NOW?.user_name==="guest"?window.__AIEX_GLOBALS__?.fetchCorrelationToken?.():void 0).catch(e=>{re.error("Failed to fetch correlation token",e)}).finally(()=>{var e;e=this,nJ().then(()=>{let t;if(e.isConnected&&window.__AIEX_GLOBALS__){var i=window.location.hostname.split(".")[0];"www"===i&&(i=window.location.hostname.split(".")[1]);let n="c86a62e2c7022010099a308dc7c26022",r="sys_ux_app",s=window.__AIEX_GLOBALS__?.getLatestState?.(e=>e.pageContext);s&&(n=s?.deploymentDocumentId||n,r=s?.deploymentDocumentTable||r),n0.info("latestPageContext",s);let o=window.__AIEX_GLOBALS__.subscribeToEvent(iV,s=>{e.sessionContext=s.session,e.sessionContext&&(e.sessionContext.userId||(e.sessionContext.userId=""),e.sessionContext.instanceName||(e.sessionContext.instanceName=i),e.sessionContext.experienceId||(e.sessionContext.experienceId=n,window.__AIEX_GLOBALS__?.mergePageContext({deploymentDocumentId:n,deploymentDocumentTable:r})),"nextwave"===e.chatType&&nY(e).then(()=>{if(!e.isConnected)return;e.sessionContext&&(e.sessionContext.pageContext=s.pageContext,e.sessionContext.customContext=s.customContext,e.sessionContext.widgetContext=s.customWidgetContext,e.sessionContext.clientToolContext=s.clientToolContext,n1(e,o.initialContext.pageContext,n,"sys_ux_app"),n3(e),e.sessionContext.conversationId=e.lbfProps[".conversationId"]||"",e.sessionContext.applications=e.lbfProps[".applications"],e.sessionContext.clientContext=e.lbfProps[".clientContext"]),t=window.__AIEX_GLOBALS__?.takePendingForceNewConversation();let i=e.lbfProps[".forceNewConversation"]||t?.forceNewConversation||void 0;e.lbfClientRef.value?.setSession({session:{...e.sessionContext,...i&&{conversationId:""},forceNewConversation:i,newConversationContext:n2(t?.context)||{}}}),e.sessionHandshakeSent=!0}).catch(()=>{n0.error("Failed to pass session info to LBF client")}))});e.aielUnsubscribers.push(o.unsubscribe),e.sessionContext=o.initialContext.session,e.sessionContext&&void 0!==e.sessionContext&&(e.sessionContext.userId||(e.sessionContext.userId=""),e.sessionContext.instanceName||(e.sessionContext.instanceName=i),e.sessionContext.experienceId||(e.sessionContext.experienceId=n,window.__AIEX_GLOBALS__?.mergePageContext({deploymentDocumentId:n,deploymentDocumentTable:r})),"nextwave"===e.chatType&&nY(e).then(()=>{if(!e.isConnected)return;e.sessionContext&&(e.sessionContext.pageContext=o.initialContext.pageContext,e.sessionContext.customContext=o.initialContext.customContext,e.sessionContext.widgetContext=o.initialContext.customWidgetContext,e.sessionContext.clientToolContext=o.initialContext.clientToolContext,n1(e,o.initialContext.pageContext,n,r),n3(e),e.sessionContext.conversationId=e.lbfProps[".conversationId"]||e.contextConversationId||"",e.sessionContext.applications=e.lbfProps[".applications"],e.sessionContext.clientContext=e.lbfProps[".clientContext"]),t=window.__AIEX_GLOBALS__?.takePendingForceNewConversation();let i=e.skillContext,s=e.seedUserMessage&&e.seedUserMessage!==e.lastSentSeed?e.seedUserMessage:void 0,a={...n2(t?.context)||{},...i&&{skillId:i.skill,skillParams:i.skillParams},...s&&{searchText:s},...e.contextConversationEnabled&&{contextConversationEnabled:!0}};i&&(e.skillContext=void 0),s&&(e.lastSentSeed=s);let l=e.contextConversationForceNew,c=e.lbfProps[".forceNewConversation"]||t?.forceNewConversation||l||!!i||!!s||void 0;l&&(e.contextConversationForceNew=!1),e.lbfClientRef.value?.setSession({session:{...e.sessionContext,...c&&{conversationId:""},forceNewConversation:c,newConversationContext:a}}),e.sessionHandshakeSent=!0}).catch(()=>{n0.error("Failed to pass session info to LBF client")})),function(e){if(window.__AIEX_GLOBALS__){let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:clientToolEnded",t=>{let i,n=t.clientToolContext?.lastCompletedCall,r=t.clientToolContext;if(r.completed[n])i=r.completed[n];else{if(!r.failed[n])return;i=r.failed[n]}e.toolExecutionCallbacks[n]&&(i?.success?e.toolExecutionCallbacks[n].resolve(i):e.toolExecutionCallbacks[n].reject(i))});e.aielUnsubscribers.push(t.unsubscribe)}}(e),function(e){if(window.__AIEX_GLOBALS__){let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:forcedNewConversation",(t={})=>{"nextwave"===e.chatType&&nY(e).then(()=>{e.isConnected&&(e.lbfClientRef.value?.createConversation({context:n2(t.context)||{}}),window.__AIEX_GLOBALS__?.takePendingForceNewConversation())}).catch(()=>{n0.error("Failed to force new conversation on LBF client")})});e.aielUnsubscribers.push(t.unsubscribe)}}(e),function(e){if(!window.__AIEX_GLOBALS__)return;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:refreshConversations",t=>{"nextwave"===e.chatType&&nY(e).then(()=>{e.isConnected&&e.lbfClientRef.value?.refreshConversationList()}).catch(()=>{n0.error("Failed to refresh conversation list on LBF client")})});e.aielUnsubscribers.push(t.unsubscribe)}(e),function(e){if(!window.__AIEX_GLOBALS__)return;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:voiceInputRequested",t=>{"nextwave"===e.chatType&&nY(e).then(()=>{e.isConnected&&e.lbfClientRef.value?.startVoiceInput?.()}).catch(()=>{n0.error("Failed to start voice input on LBF client")})});e.aielUnsubscribers.push(t.unsubscribe)}(e),function(e){if(!window.__AIEX_GLOBALS__)return;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:skillExecutionRequested",t=>{let i=t.sessionContext;if(!i)return;let n=i.skill,r=i.skillParams;e.sessionContext&&nY(e).then(()=>{e.isConnected&&e.lbfClientRef.value?.invokeSkill({skillId:n,skillParams:r})}).catch(()=>{n0.error("Failed to execute skill via LBF client")})});e.aielUnsubscribers.push(t.unsubscribe)}(e),function(e){if(!window.__AIEX_GLOBALS__)return;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:brandingConfigUpdated",t=>{let{icon:i,header:n,...r}=t.brandingConfig;e.brandingConfig={vaLogo:i?.replace(".iix",""),headerLabel:n,...r}}),i=t.initialContext?.brandingConfig;if(i){let{icon:t,header:n,...r}=i;e.brandingConfig={vaLogo:t?.replace(".iix",""),headerLabel:n,...r}}e.aielUnsubscribers.push(t.unsubscribe)}(e)}}).catch(()=>{n0.error("AIEL not found, unable to subscribe to events")})}))}function rE(e){let{sessionId:t}=e.payload;window.__AIEX_GLOBALS__?.updateCustomContext({sessionSuccess:!0,sessionId:t})}function r$(){window.__AIEX_GLOBALS__?.updateCustomContext({sessionSuccess:!1,sessionId:void 0})}let rk=(e={})=>{let{searchQuery:t,searchApplicationId:i}=e&&"object"==typeof e?e:{},n="string"==typeof t?t.trim():"",r="string"==typeof i?i.trim():"";if(n||r){let e=window.NOW?.portal_url_suffix;if(e){let t,i=(t=new URLSearchParams({id:"search",spa:"1",q:n,disableAllSuggestions:"false",disableSpellCheck:"false",searchFromChat:"true"}),`/${e}?${t.toString()}`);window.open(i,"_blank");return}let t=(({searchQuery:e="",searchApplicationId:t=""}={})=>{let i="string"==typeof e?e.trim():"",n="string"==typeof t?t.trim():"";return{...iM,params:{...iM.params,...n&&{globalSearchDataConfigId:n},...i&&{searchTerm:i}}}})({searchQuery:n,searchApplicationId:r});if((e=>{let t=window.nowWindowManager?.unifiedNavComponent;if(!t)return!1;try{if("function"==typeof t.dispatchAction)return t.dispatchAction(ih,e),!0;if("function"==typeof t.dispatch)return t.dispatch(ih,e),!0;if("function"==typeof t.dispatchEvent)return t.dispatchEvent(new CustomEvent(ih,{bubbles:!0,composed:!0,detail:e})),!0}catch(e){re.warn("search:view-all-clicked: failed to dispatch search payload",e)}return!1})(t))return;window.location.assign((e=>{let{context:t={},route:i="search",params:n={}}=e,r="string"==typeof t.path&&t.path.trim().length>0?t.path.trim().replace(/^\/+|\/+$/g,""):"now/nav/ui",s="string"==typeof i&&i.trim().length>0?i.trim().replace(/^\/+/,""):"search",o=new URLSearchParams;Object.entries(n).forEach(([e,t])=>{"string"==typeof t&&t.length>0&&o.set(e,t)});let a=o.toString(),l=`/${r}/${s}`;return a?`${l}?${a}`:l})(t));return}re.warn("search:view-all-clicked: missing searchQuery/searchApplicationId in payload",e)};function rA(){window.__AIEX_GLOBALS__?.clearAuthTokenCache()}let rI="now:chat:event";class rS extends i3{constructor(){super(...arguments),this.prevData={}}render(e){return F}update(e,[t]){var i;this.element!==e.element&&(this.element=e.element),this.host=(null==(i=e.options)?void 0:i.host)||this.element,this.apply(t),this.groom(t),this.prevData={...t}}apply(e){if(!e)return;let{prevData:t,element:i}=this;for(let n in e){let r=e[n];r!==t[n]&&(i[n]=r)}}groom(e){let{prevData:t,element:i}=this;if(t)for(let n in t)e&&(n in e||i[n]!==t[n])||(i[n]=void 0)}}class rL extends rS{constructor(){super(...arguments),this.eventData={}}apply(e){if(e)for(let t in e){let i=e[t];i!==this.eventData[t]&&this.applyEvent(t,i)}}applyEvent(e,t){let{prevData:i,element:n}=this;this.eventData[e]=t,i[e]&&n.removeEventListener(e,this,t),n.addEventListener(e,this,t)}groom(e){let{prevData:t,element:i}=this;if(t)for(let n in t)e&&(n in e||i[n]!==t[n])||this.groomEvent(n,t[n])}groomEvent(e,t){let{element:i}=this;delete this.eventData[e],i.removeEventListener(e,this,t)}handleEvent(e){let t=this.eventData[e.type];"function"==typeof t?t.call(this.host,e):t.handleEvent(e)}disconnected(){let{eventData:e,element:t}=this;for(let i in e){let n=i.slice(1),r=e[i];t.removeEventListener(n,this,r)}}reconnected(){let{eventData:e,element:t}=this;for(let i in e){let n=i.slice(1),r=e[i];t.addEventListener(n,this,r)}}}let rT=iK(class extends rL{apply(e){if(!e)return;let{prevData:t,element:i}=this;for(let n in e){let r=e[n];if(r===t[n])continue;let s=n.slice(1);switch(n[0]){case"@":this.eventData[s]=r,this.applyEvent(s,r);break;case".":i[s]=r;break;case"?":r?i.setAttribute(s,""):i.removeAttribute(s);break;default:null!=r?i.setAttribute(n,String(r)):i.removeAttribute(n)}}}groom(e){let{prevData:t,element:i}=this;if(t)for(let n in t){let r=n.slice(1);if(!e||!(n in e)&&i[r]===t[n])switch(n[0]){case"@":this.groomEvent(r,t[n]);break;case".":i[r]=void 0;break;case"?":i.removeAttribute(r);break;default:i.removeAttribute(n)}}}}),rO=t2(function(){if(tY)return tJ;tY=1;var e=NaN,t=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,s=parseInt,o="object"==typeof t0&&t0&&t0.Object===Object&&t0,a="object"==typeof self&&self&&self.Object===Object&&self,l=o||a||Function("return this")(),c=Object.prototype.toString,d=Math.max,h=Math.min,u=function(){return l.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(o){if("number"==typeof o)return o;if("symbol"==typeof(a=o)||a&&"object"==typeof a&&"[object Symbol]"==c.call(a))return e;if(p(o)){var a,l="function"==typeof o.valueOf?o.valueOf():o;o=p(l)?l+"":l}if("string"!=typeof o)return 0===o?o:+o;o=o.replace(t,"");var d=n.test(o);return d||r.test(o)?s(o.slice(2),d?2:8):i.test(o)?e:+o}return tJ=function(e,t,i){var n,r,s,o,a,l,c=0,w=!1,g=!1,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function m(t){var i=n,s=r;return n=r=void 0,c=t,o=e.apply(s,i)}function b(e){var i=e-l,n=e-c;return void 0===l||i>=t||i<0||g&&n>=s}function _(){var e,i,n,r=u();if(b(r))return y(r);a=setTimeout(_,(e=r-l,i=r-c,n=t-e,g?h(n,s-i):n))}function y(e){return a=void 0,f&&n?m(e):(n=r=void 0,o)}function x(){var e,i=u(),s=b(i);if(n=arguments,r=this,l=i,s){if(void 0===a)return c=e=l,a=setTimeout(_,t),w?m(e):o;if(g)return a=setTimeout(_,t),m(l)}return void 0===a&&(a=setTimeout(_,t)),o}return t=v(t)||0,p(i)&&(w=!!i.leading,s=(g="maxWait"in i)?d(v(i.maxWait)||0,t):s,f="trailing"in i?!!i.trailing:f),x.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=r=a=void 0},x.flush=function(){return void 0===a?o:y(u())},x}}());var rD=Object.defineProperty,rR=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&rD(t,i,s),s};let rP=new CSSStyleSheet;rP.replaceSync(":host{--aiex-ease: var( --now-motion--ease--guided-enter, cubic-bezier(.21, .64, .52, 1) );--aiex-border-radius: var(--now-unified-border-radius--md, calc(.75rem * var(--aiex-rem-scale, 1)));box-sizing:border-box}:host([isWindowManager]){height:98%!important;width:99%!important}.engagement-experience-container{box-sizing:border-box;flex:1;display:flex;flex-direction:column;justify-content:center;height:100%;container-type:inline-size;container-name:engagement-container}.aiex-content{position:relative;display:flex;z-index:1;height:100%}.aiex-content-base{position:relative;display:flex;z-index:1;height:100%;transition:padding .3s var(--aiex-ease),gap .3s var(--aiex-ease)}.aiex-content-chat-only{.aiex-chat-container{width:100%}.aiex-interactive-container{width:0;overflow:hidden}}.aiex-content-interactive-only{.aiex-chat-container{width:0;overflow:hidden}.aiex-interactive-container{width:100%}}.aiex-content-chat-and-interactive{.aiex-chat-container{width:420px;overflow:auto;border-radius:var(--aiex-border-radius) 0 0 var(--aiex-border-radius)}.aiex-interactive-container{width:calc(100% - 420px);overflow:auto;border-radius:0 var(--aiex-border-radius) var(--aiex-border-radius) 0}}.aiex-content-chat-and-interactive-search{.aiex-chat-container{width:calc(100% - 420px);border-radius:var(--aiex-border-radius) 0 0 var(--aiex-border-radius)}.aiex-interactive-container{width:420px;border-radius:0 var(--aiex-border-radius) var(--aiex-border-radius) 0}}#react-container{flex-basis:0}.aiex-interactive-container{height:100%;border-radius:var(--aiex-border-radius);overflow:hidden;transition:width .8s var(--aiex-ease)}.aiex-chat-container{height:100%;border-radius:var(--aiex-border-radius);transition:width .8s var(--aiex-ease)}@media(max-width:767px){.aiex-chat-container{transition:width .8s var(--aiex-ease),transform .4s var(--aiex-ease),border-radius .4s var(--aiex-ease);transform-origin:top}.aiex-content-interactive-only .aiex-chat-container{width:100%;overflow:auto;transform:scale(.96,.8);border-radius:calc(1rem * var(--aiex-rem-scale, 1))}.aiex-interactive-container{background-color:var( --aiex-bg-primary, rgb(var(--now-color_background--primary, 255, 255, 255)) );position:absolute;bottom:0;left:0;width:100%;height:0;border-radius:calc(1rem * var(--aiex-rem-scale, 1)) calc(1rem * var(--aiex-rem-scale, 1)) 0 0;box-shadow:0 -4px 20px #00000026;transition:height .4s var(--aiex-ease);z-index:10}.aiex-content-interactive-only .aiex-interactive-container,.aiex-content-chat-and-interactive .aiex-interactive-container,.aiex-content-chat-and-interactive-search .aiex-interactive-container{height:100%}.aiex-content-chat-only .aiex-interactive-container{height:0;width:100%}}.aiex-content-popover-wrapper{position:relative;display:flex;z-index:1;height:100%;width:100%;justify-content:flex-start;align-items:center;transition:padding .3s var(--aiex-ease)}.aiex-chat-popover{height:100%;width:100%;overflow:hidden;border-radius:var(--aiex-border-radius)}.aiex-interactive-popover-base{position:absolute;top:0;left:100%;height:100%;overflow:hidden;transition:width var(--aiex-iv-transition-duration, .8s) var(--aiex-iv-transition-timing, ease);z-index:1}.aiex-interactive-popover{width:var(--aiex-interactive-view-width, 0)}.aiex-interactive-popover-hidden{width:0}sn-mw-component{width:100%}.overflow-visible{overflow:visible}@container engagement-container (min-width: 768px){.aiex-content-base{padding-block-end:calc(1rem * var(--aiex-rem-scale, 1));padding-inline:calc(1rem * var(--aiex-rem-scale, 1));gap:2px}.aiex-content-base-moveworks,.aiex-content-base-lbf-omni{padding:0}.aiex-content-popover-wrapper{padding:calc(1rem * var(--aiex-rem-scale, 1))}.aiex-content-popover-wrapper-moveworks{padding:0}}@container engagement-container (min-width: 972px){.aiex-content-chat-and-interactive{.aiex-chat-container{width:420px}.aiex-interactive-container{width:calc(100% - 420px)}}.aiex-content-chat-and-interactive-search{.aiex-chat-container{width:calc(100% - 420px)}.aiex-interactive-container{width:420px}}}@container engagement-container (max-width: 972px){.aiex-content-chat-and-interactive,.aiex-content-chat-and-interactive-search{.aiex-chat-container{width:0px}.aiex-interactive-container{width:100%}}}");let rU=iF("Engagement"),rN=class e extends ea{constructor(){super(...arguments),this.properties=window?.NOW?.aiux?.getExperienceProperties?.(),this.chatType=this.properties?Object.values(this.properties).find(e=>"chatType"===e.name)?.value??"nextwave":"nextwave",this.debug=!1,this.isWindowManager=!1,this.sessionHandshakeSent=!1,this.defaultLbfProps={mode:"primary","disable-header":!0,"always-show-first-utterance":!1,".forceNewConversation":void 0,".enableIntroBanner":!1,".enablePageHistory":!1,".activeWidgetId":"",".branding":void 0},this.sessionData="",this.lbfClientRef=i5(),this.aiexRef=i5(),this.lbfProps={},this.aiexMode="chat_and_interactive_view",this.isDocked=!1,this.isModal=!1,this.availablePanels=1,this.widgetData={},this.itemId="",this.useKarunaWorkload=!1,this.activeConversationId="",this.chatEnabled=!0,this.interactiveViewEnabled=!0,this.hasInteractiveView=!1,this.showInteractiveView=!1,this.chatLoaded=!1,this.contextConversationReady=!1,this.contextConversationEnabled=!1,this.contextConversationForceNew=!1,this.toolExecutionCallbacks={},this.aielUnsubscribers=[],this.earlyUnsubscribers=[],this.initializedChatClients=new Set,this.activeWidgetId="",this.interactiveViewHistoryStack=[],this.isFormDirty=!1,this.pendingDirtyAction=null,this.pendingDirtyResolver=null,this.handleSwitchOrNewConversation=e=>this.clearStaleDirtyForm()?new Promise(e=>{this.pendingDirtyResolver=e}):{allow:!0},this.resizeObserver=new ResizeObserver(rO(t=>{let i=t[0];i.target===this.aiexRef.value&&(this.availablePanels=i.contentRect.width>=e.MIN_WIDTH_FOR_TWO_PANELS?2:1)},7)),this.language=window?.__aiexLibrary?.getUserLanguage()}static{this.styles=[rP]}static{this.MIN_WIDTH_FOR_TWO_PANELS=972.8}shouldDisplayChat(){return 2===this.availablePanels?this.chatEnabled:this.chatEnabled&&!this.showInteractiveView}shouldDisplayInteractiveView(){return this.interactiveViewEnabled&&this.showInteractiveView}getIframeCurrentUrl(){try{let e=this.renderRoot?.querySelector("sn-interactive-view")?.shadowRoot?.querySelector("sn-widget-renderer")?.shadowRoot?.querySelector("iframe");if(e?.contentWindow?.location?.pathname)return e.contentWindow.location.pathname+e.contentWindow.location.search}catch{}return null}getIframeOriginalSrc(){try{let e=this.renderRoot?.querySelector("sn-interactive-view")?.shadowRoot?.querySelector("sn-widget-renderer")?.shadowRoot?.querySelector("iframe");if(e?.src){let t=new URL(e.src,window.location.origin);return t.pathname+t.search}}catch{}return null}clearStaleDirtyForm(){if(this.isFormDirty){let e=this.getIframeCurrentUrl(),t=this.getIframeOriginalSrc();e&&t&&e!==t&&(this.isFormDirty=!1)}return this.isFormDirty}getAiexClass(){return this.chatEnabled&&this.shouldDisplayInteractiveView()?this.widgetData?.type==="SearchResults"?"aiex-content-chat-and-interactive-search":"aiex-content-chat-and-interactive":this.chatEnabled?"aiex-content-chat-only":this.shouldDisplayInteractiveView()?"aiex-content-interactive-only":"aiex-content"}handleSkillContextChange(){if(!this.sessionContext)return;let e=this.lbfClientRef.value;e&&this.skillContext&&window.__AIEX_GLOBALS__?.getLatestState?.(e=>e.sessionSuccess)&&e.invokeSkill({skillId:this.skillContext.skill,skillParams:this.skillContext.skillParams})}handleSeedUserMessageChange(){let e=this.seedUserMessage;if(!e||e===this.lastSentSeed||!this.sessionHandshakeSent)return;let t=this.lbfClientRef.value;t&&(this.lastSentSeed=e,t.createConversation({context:{searchText:e}}))}handleLegacyVoiceShortcut(){let e=this.lbfProps?.[".napShortcutCommand"];e!==this.prevNapShortcutCommand&&(this.prevNapShortcutCommand=e,e?.command==="VOICE_INPUT_SELECTED"&&"nextwave"===this.chatType&&nY(this).then(()=>{this.isConnected&&this.lbfClientRef.value?.startVoiceInput?.()}).catch(()=>{rU.error("Failed to start voice input on LBF client")}))}async firstUpdated(){if(this.aiexRef.value&&(this.resizeObserver.observe(this.aiexRef.value),this.availablePanels=this.aiexRef.value.offsetWidth>=e.MIN_WIDTH_FOR_TWO_PANELS?2:1),"nextwave"===this.chatType)try{this.chatLoaded=await iX()}catch(e){rU.error("Failed to load LBF client",e),this.chatLoaded=!1}else"moveworks"===this.chatType&&(this.chatLoaded=!0);this.debug}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect(),this.aielUnsubscribers.forEach(e=>e()),this.aielUnsubscribers=[],this.earlyUnsubscribers.forEach(e=>e()),this.earlyUnsubscribers=[],this.initializedChatClients.clear(),this.removeEventListener(rI,ro),this.removeEventListener(ia,rw),this.removeEventListener(il,rg),this.removeEventListener(ic,rf),this.removeEventListener(iu,rx),this.removeEventListener(ip,ry),this.removeEventListener(iv,rm),this.removeEventListener(iw,r_),this.removeEventListener(im,rn)}async connectedCallback(){switch(super.connectedCallback(),this.aiexMode){case"chat_only":this.chatEnabled=!0,this.interactiveViewEnabled=!1,this.showInteractiveView=!1;break;case"interactive_view_only":this.chatEnabled=!1,this.interactiveViewEnabled=!0,this.showInteractiveView=!0;break;case"chat_and_interactive_view":case"popover":this.chatEnabled=!0,this.interactiveViewEnabled=!0,this.showInteractiveView=!1}this.addEventListener(rI,ro),this.addEventListener(ia,rw),this.addEventListener(il,rg),this.addEventListener(ic,rf),this.addEventListener(iu,rx),this.addEventListener(ip,ry),this.addEventListener(iv,rm),this.addEventListener(iw,r_),this.addEventListener(im,rn),function(e){let t=window.__AIEX_GLOBALS__;if(!t)return;let i=t.subscribeToEvent("aiel:pageContextChanged",t=>{e.sessionContext&&t.pageContext&&(e.sessionContext.pageContext=t.pageContext,e.lbfClientRef?.value?.setPageContext?.(t.pageContext))}),n=t.subscribeToEvent("aiel:contextConversationSwitch",(t,i)=>{let{conversationId:n}=i;e.contextConversationReady=!0,n&&n!==e.lbfProps[".conversationId"]&&e.lbfClientRef?.value?.setSession({session:{...e.sessionContext,conversationId:n,forceNewConversation:void 0,newConversationContext:{contextConversationEnabled:!0}}})}),r=n.initialContext?.contextConversation;r?.enabled&&(e.contextConversationEnabled=!0,(r.conversationId||r.forceNewConversation)&&(e.contextConversationReady=!0,r.conversationId&&(e.contextConversationId=r.conversationId),r.forceNewConversation&&(e.contextConversationForceNew=!0)));let s=t.subscribeToEvent("aiel:contextConversationNew",()=>{e.contextConversationReady=!0,e.lbfClientRef?.value?.setSession({session:{...e.sessionContext,conversationId:"",forceNewConversation:!0,newConversationContext:{contextConversationEnabled:!0}}})}),o=t.subscribeToEvent("aiel:contextConversationEnabled",(t,i)=>{e.contextConversationEnabled=i.enabled,!1===i.enabled&&(e.contextConversationReady=!0)});e.earlyUnsubscribers.push(i.unsubscribe),e.earlyUnsubscribers.push(n.unsubscribe),e.earlyUnsubscribers.push(s.unsubscribe),e.earlyUnsubscribers.push(o.unsubscribe)}(this),window.__AIEX_GLOBALS__?.getLatestState?.()?.contextConversation?.enabled||(this.contextConversationReady=!0)}updated(e){if(super.updated(e),e.has("aiexMode"))switch(this.aiexMode){case"chat_only":this.chatEnabled=!0,this.interactiveViewEnabled=!1,this.showInteractiveView=!1;break;case"interactive_view_only":this.chatEnabled=!1,this.interactiveViewEnabled=!0,this.showInteractiveView=!0;break;case"chat_and_interactive_view":case"popover":this.chatEnabled=!0,this.interactiveViewEnabled=!0,this.showInteractiveView=!1}if(e.has("isDocked")&&this.isDocked&&(this.showInteractiveView=!1),(e.has("skillContext")||e.has("sessionContext")&&this.skillContext)&&this.handleSkillContextChange(),(e.has("seedUserMessage")||e.has("sessionHandshakeSent")&&this.seedUserMessage)&&this.handleSeedUserMessageChange(),e.has("isFormDirty")&&(window.__AIEX_GLOBALS__?.updateCustomContext({isFormDirty:this.isFormDirty}),!this.isFormDirty&&this.pendingDirtyAction)){let e=this.pendingDirtyAction;this.pendingDirtyAction=null,e()}e.has("widgetData")&&(this.isFormDirty=!1),e.has("lbfProps")&&this.handleLegacyVoiceShortcut()}async willUpdate(e){super.willUpdate(e),e.has("showInteractiveView")&&(this.showInteractiveView?this.setAttribute("data-iv-visible",""):this.removeAttribute("data-iv-visible"))}getAiexWrapperClass(){if("popover"===this.aiexMode)return"moveworks"===this.chatType?"aiex-content-popover-wrapper aiex-content-popover-wrapper-moveworks":"aiex-content-popover-wrapper";let e="omni"===this.lbfProps.mode;return`${this.getAiexClass()} aiex-content-base ${"moveworks"===this.chatType?"aiex-content-base-moveworks":""}${e?" aiex-content-base-lbf-omni":""}`}getAiexChatClass(){return"popover"===this.aiexMode?"aiex-chat-popover":`${!0===this.lbfProps[".inputOnly"]||"hero"===this.lbfProps.mode?"overflow-visible ":""}aiex-chat-container`}getAiexInteractiveViewClass(){return"popover"===this.aiexMode?this.showInteractiveView?"aiex-interactive-popover-base aiex-interactive-popover":"aiex-interactive-popover-base aiex-interactive-popover-hidden":"aiex-interactive-container"}render(){var e;let t,i,n={...this.defaultLbfProps,".activeWidgetId":this.activeWidgetId,".branding":this.brandingConfig,userlanguage:this.language,...this.lbfProps},r=("primary"===n.mode||"DEFAULT"===n.mode)&&(!0===n[".inputOnly"]||"hero"===n[".mode"])?"hero":n.mode,{".napShortcutCommand":s,...o}=n;return"moveworks"===this.chatType&&(this.sessionData=(t=window.__AIEX_GLOBALS__?.subscribeToEvent(iV,()=>{}),i=JSON.stringify(t?.initialContext.session),t?.unsubscribe?.(),i)),B`
179
+ `;case"omni":return B` <mw-omnibar variant="omni"></mw-omnibar> `}}}function nY(){return new Promise((e,t)=>{let i=0,n=()=>{if(window.__AIEX_GLOBALS__)e(!0);else{if(++i>=10)return void t(!1);setTimeout(n,500)}};n()})}function n0(e){return new Promise((t,i)=>{let n=0,r=()=>{if(!e.isConnected)return void i(!1);if(e.shadowRoot?.querySelector("now-lbf-chat-client"))t(!0);else{if(++n>=10)return void i(!1);setTimeout(r,500)}};r()})}nQ([ec()],nJ.prototype,"setRoute"),nQ([ec()],nJ.prototype,"mode"),nQ([ec()],nJ.prototype,"mwProps"),customElements.get("sn-mw-component")||customElements.define("sn-mw-component",nJ);let n2=iF("Subscription"),n1=0;function n3(e){if(!e||0===Object.keys(e).length)return;let t={...e};if("string"==typeof t.transferred_search_result)try{t.transferred_search_result=JSON.parse(t.transferred_search_result)}catch{}return t}function n5(e,t,i,n){if(!e.sessionContext)return;!function(e){let{deploymentDocumentId:t,deploymentDocumentTable:i,nowAssistDeploymentId:n,...r}=e;return 0===Object.keys(r).length}(t)?e.sessionContext.pageContext={...t}:(e.sessionContext.pageContext={...t,...function(){let e=window.ux_globals?.initialRoute;if(!e)return{};let t={};return e.context?.experienceName==="Unified Navigation App"?(t.experienceName="Core UI",t.pageType="Core ui"):(t.experienceName="workspace",t.pageType="UXF"),e.route&&(t.route=e?.route,["record","list","home","search","other"].includes(e.route)?t.type=e?.route:t.type="other"),e.fields&&(e.fields?.sysId&&(t.sysId=e?.fields?.sysId),e.fields?.table&&(t.table=e?.fields?.table)),t}()},window.__AIEX_GLOBALS__?.updatePageContext(e.sessionContext.pageContext));let r=e.sessionContext.pageContext;e.sessionContext.pageContext={...r,deploymentDocumentId:r?.deploymentDocumentId||i,deploymentDocumentTable:r?.deploymentDocumentTable||n}}function n6(e){let t=e.lbfProps?.[".pageContext"];t&&e.sessionContext?.pageContext&&(t.deploymentDocumentId||t.deploymentDocumentTable)&&(e.sessionContext.pageContext={...e.sessionContext.pageContext,...t.deploymentDocumentId&&{deploymentDocumentId:t.deploymentDocumentId},...t.deploymentDocumentTable&&{deploymentDocumentTable:t.deploymentDocumentTable}})}let n9=iF("Mobile"),n8=e=>`com.servicenow.cabrillo.${e}`,n7=()=>{let e=window.CabrilloClient;if("object"==typeof e&&null!==e)return"function"==typeof e.hasMethod&&"function"==typeof e.postMethod?e:void 0},n4=e=>{let t=window.webkit?.messageHandlers?.[e];if("object"==typeof t&&null!==t)return"function"==typeof t.postMessage?t:void 0},re=()=>(void 0===e&&(e=typeof window>"u"?"web":void 0!==n7()?"android":void 0!==n4(n8("modal.presentModal"))?"ios":"web"),e),rt=e=>"web"!==re()&&((e,t="",i="close")=>((e,t)=>{let i=n8(e),n=n7();if(n)return!!n.hasMethod(i)&&(n.postMethod(i,JSON.stringify({options:t})),!0);let r=n4(i);return!!r&&(r.postMessage({options:t}),!0)})("modal.presentModal",{url:e,title:t,closeButtonStyle:i}))(e)?(n9.info("presentModal",{platform:re(),url:e}),!0):!!navigator.userAgent.includes("SnMobile")&&(n9.info("UA fallback -> location.href",{url:e}),window.location.href=e,!0),ri=iF("Events");function rn(e,t){if(e.isFormDirty){let i=e.getIframeCurrentUrl(),n=e.getIframeOriginalSrc();if(i&&n&&i!==n)e.isFormDirty=!1;else{e.pendingDirtyAction=t;return}}t()}function rr(e){if(nI(e)||!function(e){try{let t=new URL(e,window.location.origin);if(!t.searchParams.has("id"))return!1;let i=t.pathname.split("/").filter(Boolean)[0]??"";return!i.includes(".do")&&"api"!==i}catch{return!1}}(e))return e;let t=window.__AIEX_GLOBALS__?.getActiveConversation?.(),i=t?`&aiex_cid=${t}`:"";return`${e}&aiex_open=true&aiex_float=true${i}`}function rs(e){let{isDirty:t}=e.detail;this.isFormDirty=t}function ro(){this.pendingDirtyAction=null,this.pendingDirtyResolver&&(this.pendingDirtyResolver({allow:!1}),this.pendingDirtyResolver=null)}function ra(){this.isFormDirty=!1,this.showInteractiveView=!1,this.pendingDirtyResolver&&(this.pendingDirtyResolver({allow:!0}),this.pendingDirtyResolver=null)}function rl(e){let{type:t}=e.detail;switch(t){case"conversation:created":ru.call(this,e.detail);break;case"conversation:selected":rv.call(this,e.detail);break;case"execute:client:tool":rg.call(this,e.detail);break;case"AGENTIC_EXECUTION_STARTED":rp.call(this,e.detail);break;case ia:rf.call(this,e.detail);break;case"HIDE_INTERACTIVE_VIEW":rm.call(this);break;case ic:rb.call(this);break;case"conversation:switched":rw.call(this,e.detail);break;case"bootstrap:end":r$.call(this,e.detail);break;case"session:success":rk.call(this,e.detail);break;case"session:failure":rA.call(this);break;case"link:clicked":rh.call(this,e.detail);break;case"search:view-all-clicked":rI(e.detail?.payload);break;case"conversation:create-prevented":rc.call(this);break;case"relay:custom-action":rd.call(this,e.detail);break;case"auth:session-expired":rS.call(this)}}async function rc(){this.lbfClientRef?.value?.focus()}async function rd(e){let{params:t,conversationId:i}=e.payload;try{await window.__AIEX_GLOBALS__?.sendCustomAction({params:t,conversationId:i})}catch(e){ri.error("Failed to relay custom action",e)}}async function rh({payload:e}){let{href:t,event:i,openInNewTab:n}=e;ri.info("Navigation request received on AIEX",{targetUrl:t});let r=i?.composedPath?.().find(e=>e?.tagName?.toLowerCase?.()==="a")?.getAttribute?.("target")==="_blank";try{if(await window.__AIEX_GLOBALS__?.navigateToRoute(e),!i?.defaultPrevented&&(i.preventDefault(),t&&!(!nS(t)&&rt(t))))if(!0===n)window.open(t,"_blank");else if(nI(t))window.NOW?.isPolarisWrapper?this.dispatchEvent(new CustomEvent(ih,{composed:!0,bubbles:!0,detail:(({targetUrl:e})=>({type:ih,payload:{options:{},context:{path:globalThis?.ux_globals?.siteName,experienceName:globalThis?.ux_globals?.experienceConfigs?.[globalThis?.ux_globals?.siteName]?.experienceName},external:{url:e}},error:null,meta:{path:[globalThis?.location?.host],appended:{},event:null,options:{}}}))({targetUrl:t})})):window.open(t,"_blank");else if((e=>{try{return e.split("/")?.[1]?.split(".do")?.[0]==="$"}catch{return!1}})(t))window.open(t.replace("/$","/"),"_blank");else if(nS(t))rf.call(this,{detail:{widgetId:"default-iframe-widget",widgetData:{type:"iframe",url:t}}});else if(r)window.open(rr(t),"_blank");else if(window.NOW?.isPolarisWrapper){let e=t+(t.includes("?")?"&":"?")+"sys_canvas=true";this.dispatchEvent(new CustomEvent(id,{composed:!0,bubbles:!0,detail:nL({targetUrl:e})})),this.isModal&&window.nowWindowManager?.toggleModal("now-ai-canvas-window"),this.isDocked||window.nowWindowManager?.toggleDock("now-ai-canvas-window","rtl"===document.dir?"left":"right")}else window.open(rr(t),"_blank")}catch(e){ri.error("Navigation request failed on AIEX",e)}}function ru(e){this.debug&&ri.debug("New conversation created"),this.isFormDirty=!1,this.pendingDirtyAction=null,window.__AIEX_GLOBALS__?.setActiveConversation(e.payload.conversationId),this.lbfProps={...this.lbfProps,".forceNewConversation":!1,".conversationId":e.payload.conversationId}}function rp(e){this.showInteractiveView=!1}function rv(e){window.__AIEX_GLOBALS__?.setActiveConversation(e.payload.conversationId),rn(this,()=>{this.isFormDirty=!1,this.widgetData={},this.activeWidgetId="",this.hasInteractiveView=!1,this.showInteractiveView=!1,this.interactiveViewHistoryStack=[]})}function rw(e){window.__AIEX_GLOBALS__?.setActiveConversation(e.payload.toConversationId),rn(this,()=>{this.isFormDirty=!1,this.widgetData={},this.activeWidgetId="",this.hasInteractiveView=!1,this.showInteractiveView=!1,this.interactiveViewHistoryStack=[],this.lbfProps={...this.lbfProps,".forceNewConversation":!1,".conversationId":e.payload.toConversationId}})}function rg(e){let{callId:t,threadId:i,widgetId:n,actionType:r,args:s,resolve:o,reject:a}=e.payload;window.__AIEX_GLOBALS__?.updateIntent({callId:t,threadId:i,widgetId:n,actionType:r,args:s}),this.toolExecutionCallbacks[t]={resolve:o,reject:a}}function rf(e){let{widgetData:t,widgetId:i,itemId:n,useKarunaWorkload:r}=e.detail;if(t?.type==="iframe"&&!nS(t.url)){rt(t.url)||(window.NOW?.isPolarisWrapper?(this.dispatchEvent(new CustomEvent(id,{composed:!0,bubbles:!0,detail:nL({targetUrl:t.url})})),this.isModal&&window.nowWindowManager?.toggleModal("now-ai-canvas-window"),this.isDocked||window.nowWindowManager?.toggleDock("now-ai-canvas-window","rtl"===document.dir?"left":"right")):window.open(t.url,"_blank"));return}let s=t;t?.type==="iframe"&&t?.url&&(s={...t,normalizedURLs:nT(t.url)}),rn(this,()=>{this.isFormDirty=!1,this.widgetData?.normalizedURLs?.ivUrl&&s?.normalizedURLs?.ivUrl&&this.widgetData.normalizedURLs.ivUrl===s.normalizedURLs.ivUrl?(this.widgetData=null,requestAnimationFrame(()=>{this.widgetData=s,this.activeWidgetId=i,this.itemId=n??"",this.useKarunaWorkload=r??!1})):(this.widgetData=s,this.activeWidgetId=i,this.itemId=n??"",this.useKarunaWorkload=r??!1),this.showInteractiveView=!0,this.hasInteractiveView=!0,this.isDocked&&window.nowWindowManager?.toggleModal("now-ai-canvas-window",!0);let e=function(e,t){if("org-user-chart"===e)return{tableName:"sys_user",sysId:t?.payload?.selectedUserId};if("default-iframe-widget"===e){let e=(e=>{if(!e)return{table:"",sysId:""};let t=e.split("/")?.[1]?.split(".do")?.[0]||"",i=e.split(".do?")[1];if(!i)return{table:t,sysId:""};let n=e=>i.split(`${e}=`)[1]?.split("&")[0];return{table:t,sysId:n("sys_id")||n("sys_kb_id")||n("sysparm_id")||""}})(t?.url);return{tableName:t?.tableName||e.table,sysId:t?.sysId||e.sysId}}return null}(i,s);e&&window.__AIEX_GLOBALS__?.telemetryRequested(iN,{"Table name":e.tableName,"Sys id":e.sysId})})}function rm(){rn(this,()=>{this.isFormDirty=!1,this.showInteractiveView=!1,this.activeWidgetId="",this.interactiveViewHistoryStack=[],window.__AIEX_GLOBALS__?.telemetryRequested(iM,{"Closed by":"user"})})}function rb(){this.showInteractiveView?rn(this,()=>{this.isFormDirty=!1,this.showInteractiveView=!1,this.activeWidgetId="",this.interactiveViewHistoryStack=[],window.__AIEX_GLOBALS__?.telemetryRequested(iM,{"Closed by":"user"})}):(this.showInteractiveView=!0,this.isDocked&&window.nowWindowManager?.toggleModal("now-ai-canvas-window",!0),window.__AIEX_GLOBALS__?.telemetryRequested(iN,{"Opened by":"user","Table name":this.widgetData?.tableName,"Sys id":this.widgetData?.sysId}))}function r_(e){let{widgetData:t,widgetId:i}=e.detail;rn(this,()=>{this.isFormDirty=!1,this.widgetData&&(this.interactiveViewHistoryStack=[...this.interactiveViewHistoryStack,{widgetData:this.widgetData,widgetId:this.activeWidgetId}]),this.widgetData=t,this.activeWidgetId=i})}let ry=0;function rx(e){let{targetUrl:t,targetTable:i,targetSysId:n}=e.detail;if(!t)return;let r=Date.now();if(!(r-ry<300))if(ry=r,window.NOW?.isPolarisWrapper)this.dispatchEvent(new CustomEvent(id,{composed:!0,bubbles:!0,detail:nL({targetUrl:t})})),this.showInteractiveView=!1,this.activeWidgetId="",this.interactiveViewHistoryStack=[],this.isModal&&window.nowWindowManager?.toggleModal("now-ai-canvas-window"),window.nowWindowManager?.toggleDock("now-ai-canvas-window","right");else{let e=window.location.pathname.split("/")[1],r=window.__AIEX_GLOBALS__?.getActiveConversation?.(),s=e&&i&&n?`/${e}?id=form&table=${i}&sys_id=${n}&aiex_open=true&aiex_float=true${r?`&aiex_cid=${r}`:""}`:t;window.open(s,"_blank")}}function rC(){0!==this.interactiveViewHistoryStack.length&&rn(this,()=>{this.isFormDirty=!1;let e=this.interactiveViewHistoryStack[this.interactiveViewHistoryStack.length-1];this.interactiveViewHistoryStack=this.interactiveViewHistoryStack.slice(0,-1),this.widgetData=e.widgetData,this.activeWidgetId=e.widgetId})}function rE(e){let{widgetData:t}=e.detail,i=this.getIframeCurrentUrl(),n=this.getIframeOriginalSrc(),r=t?.url,s=i&&n&&i!==n,o=s?i:r;o&&rn(this,()=>{this.isFormDirty=!1;let e=window.NOW?.isPolarisWrapper?t?.normalizedURLs?.popoutUrl?.platform:t?.normalizedURLs?.popoutUrl?.portal;if(!(e&&nI(e))&&window.NOW?.isPolarisWrapper){let t=e||o;if(s)try{let e=new URL(o,window.location.origin),i=e.searchParams.get("table"),n=e.searchParams.get("sys_id");i&&n&&(t=`/${i}.do?sys_id=${n}`)}catch{}let i=t.split("/")?.[1]?.split("?")?.[0],n="swp"===i||"esc"===i||"sp"===i?t+(t.includes("?")?"&":"?")+"sys_canvas=true":t;this.dispatchEvent(new CustomEvent(id,{composed:!0,bubbles:!0,detail:nL({targetUrl:n})})),this.showInteractiveView=!1,this.activeWidgetId="",this.interactiveViewHistoryStack=[],this.isModal&&window.nowWindowManager?.toggleModal("now-ai-canvas-window"),window.nowWindowManager?.toggleDock("now-ai-canvas-window","rtl"===document.dir?"left":"right")}else{let t=window.NOW?.portal_url_suffix||window.location.pathname.split("/")[1],i=window.__AIEX_GLOBALS__?.getActiveConversation?.(),n=null;if(s)try{let e=new URL(o,window.location.origin),r=e.searchParams.get("table"),s=e.searchParams.get("sys_id");t&&r&&s&&(n=`/${t}?id=form&table=${r}&sys_id=${s}&aiex_open=true&aiex_float=true${i?`&aiex_cid=${i}`:""}`)}catch{}window.open(n||e||o,"_blank")}})}function r$(e){let{componentId:t}=e;this.initializedChatClients.has(t)||(this.aielUnsubscribers.forEach(e=>e()),this.aielUnsubscribers=[],this.initializedChatClients.add(t),Promise.resolve(window.NOW?.user_name==="guest"?window.__AIEX_GLOBALS__?.fetchCorrelationToken?.():void 0).catch(e=>{ri.error("Failed to fetch correlation token",e)}).finally(()=>{var e;e=this,nY().then(()=>{let t;if(e.isConnected&&window.__AIEX_GLOBALS__){var i=window.location.hostname.split(".")[0];"www"===i&&(i=window.location.hostname.split(".")[1]);let n="c86a62e2c7022010099a308dc7c26022",r="sys_ux_app",s=window.__AIEX_GLOBALS__?.getLatestState?.(e=>e.pageContext);s&&(n=s?.deploymentDocumentId||n,r=s?.deploymentDocumentTable||r),n2.info("latestPageContext",s);let o=window.__AIEX_GLOBALS__.subscribeToEvent(iV,s=>{e.sessionContext=s.session,e.sessionContext&&(e.sessionContext.userId||(e.sessionContext.userId=""),e.sessionContext.instanceName||(e.sessionContext.instanceName=i),e.sessionContext.experienceId||(e.sessionContext.experienceId=n,window.__AIEX_GLOBALS__?.mergePageContext({deploymentDocumentId:n,deploymentDocumentTable:r})),"nextwave"===e.chatType&&n0(e).then(()=>{if(!e.isConnected)return;e.sessionContext&&(e.sessionContext.pageContext=s.pageContext,e.sessionContext.customContext=s.customContext,e.sessionContext.widgetContext=s.customWidgetContext,e.sessionContext.clientToolContext=s.clientToolContext,n5(e,o.initialContext.pageContext,n,"sys_ux_app"),n6(e),e.sessionContext.conversationId=e.lbfProps[".conversationId"]||"",e.sessionContext.applications=e.lbfProps[".applications"],e.sessionContext.clientContext=e.lbfProps[".clientContext"]),t=window.__AIEX_GLOBALS__?.takePendingForceNewConversation();let i=e.lbfClientRef.value;if(e.sessionHandshakeSent&&i?.updateCredentials&&i.requestConversation){i.updateCredentials({session:{...e.sessionContext}}),t?.forceNewConversation&&i.requestConversation({new:!0,context:n3(t?.context)||{},key:`aiex-pending-new-${++n1}`});return}let r=e.lbfProps[".forceNewConversation"]||t?.forceNewConversation||void 0;e.lbfClientRef.value?.setSession({session:{...e.sessionContext,...r&&{conversationId:""},forceNewConversation:r,newConversationContext:n3(t?.context)||{}}}),e.sessionHandshakeSent=!0}).catch(()=>{n2.error("Failed to pass session info to LBF client")}))});e.aielUnsubscribers.push(o.unsubscribe),e.sessionContext=o.initialContext.session,e.sessionContext&&void 0!==e.sessionContext&&(e.sessionContext.userId||(e.sessionContext.userId=""),e.sessionContext.instanceName||(e.sessionContext.instanceName=i),e.sessionContext.experienceId||(e.sessionContext.experienceId=n,window.__AIEX_GLOBALS__?.mergePageContext({deploymentDocumentId:n,deploymentDocumentTable:r})),"nextwave"===e.chatType&&n0(e).then(()=>{if(!e.isConnected)return;e.sessionContext&&(e.sessionContext.pageContext=o.initialContext.pageContext,e.sessionContext.customContext=o.initialContext.customContext,e.sessionContext.widgetContext=o.initialContext.customWidgetContext,e.sessionContext.clientToolContext=o.initialContext.clientToolContext,n5(e,o.initialContext.pageContext,n,r),n6(e),e.sessionContext.conversationId=e.lbfProps[".conversationId"]||e.contextConversationId||"",e.sessionContext.applications=e.lbfProps[".applications"],e.sessionContext.clientContext=e.lbfProps[".clientContext"]),t=window.__AIEX_GLOBALS__?.takePendingForceNewConversation();let i=e.skillContext,s=e.seedUserMessage&&e.seedUserMessage!==e.lastSentSeed?e.seedUserMessage:void 0,a={...n3(t?.context)||{},...i&&{skillId:i.skill,skillParams:i.skillParams},...s&&{searchText:s},...e.contextConversationEnabled&&{contextConversationEnabled:!0}};i&&(e.skillContext=void 0),s&&(e.lastSentSeed=s);let l=e.contextConversationForceNew,c=e.lbfProps[".forceNewConversation"]||t?.forceNewConversation||l||!!i||!!s||void 0;l&&(e.contextConversationForceNew=!1),e.lbfClientRef.value?.setSession({session:{...e.sessionContext,...c&&{conversationId:""},forceNewConversation:c,newConversationContext:a}}),e.sessionHandshakeSent=!0}).catch(e=>{n2.error("Failed to pass session info to LBF client",e)})),function(e){if(window.__AIEX_GLOBALS__){let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:clientToolEnded",t=>{let i,n=t.clientToolContext?.lastCompletedCall,r=t.clientToolContext;if(r.completed[n])i=r.completed[n];else{if(!r.failed[n])return;i=r.failed[n]}e.toolExecutionCallbacks[n]&&(i?.success?e.toolExecutionCallbacks[n].resolve(i):e.toolExecutionCallbacks[n].reject(i))});e.aielUnsubscribers.push(t.unsubscribe)}}(e),function(e){if(window.__AIEX_GLOBALS__){let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:forcedNewConversation",(t={})=>{"nextwave"===e.chatType&&n0(e).then(()=>{e.isConnected&&(e.lbfClientRef.value?.createConversation({context:n3(t.context)||{}}),window.__AIEX_GLOBALS__?.takePendingForceNewConversation())}).catch(()=>{n2.error("Failed to force new conversation on LBF client")})});e.aielUnsubscribers.push(t.unsubscribe)}}(e),function(e){if(!window.__AIEX_GLOBALS__)return;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:refreshConversations",t=>{"nextwave"===e.chatType&&n0(e).then(()=>{e.isConnected&&e.lbfClientRef.value?.refreshConversationList()}).catch(()=>{n2.error("Failed to refresh conversation list on LBF client")})});e.aielUnsubscribers.push(t.unsubscribe)}(e),function(e){if(!window.__AIEX_GLOBALS__)return;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:voiceInputRequested",t=>{"nextwave"===e.chatType&&n0(e).then(()=>{e.isConnected&&e.lbfClientRef.value?.startVoiceInput?.()}).catch(()=>{n2.error("Failed to start voice input on LBF client")})});e.aielUnsubscribers.push(t.unsubscribe)}(e),function(e){if(!window.__AIEX_GLOBALS__)return;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:skillExecutionRequested",t=>{let i=t.sessionContext;if(!i)return;let n=i.skill,r=i.skillParams;e.sessionContext&&n0(e).then(()=>{e.isConnected&&e.lbfClientRef.value?.invokeSkill({skillId:n,skillParams:r})}).catch(()=>{n2.error("Failed to execute skill via LBF client")})});e.aielUnsubscribers.push(t.unsubscribe)}(e),function(e){if(!window.__AIEX_GLOBALS__)return;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:brandingConfigUpdated",t=>{let{icon:i,header:n,...r}=t.brandingConfig;e.brandingConfig={vaLogo:i?.replace(".iix",""),headerLabel:n,...r}}),i=t.initialContext?.brandingConfig;if(i){let{icon:t,header:n,...r}=i;e.brandingConfig={vaLogo:t?.replace(".iix",""),headerLabel:n,...r}}e.aielUnsubscribers.push(t.unsubscribe)}(e)}}).catch(()=>{n2.error("AIEL not found, unable to subscribe to events")})}))}function rk(e){let{sessionId:t}=e.payload;window.__AIEX_GLOBALS__?.updateCustomContext({sessionSuccess:!0,sessionId:t})}function rA(){window.__AIEX_GLOBALS__?.updateCustomContext({sessionSuccess:!1,sessionId:void 0})}let rI=(e={})=>{let{searchQuery:t,searchApplicationId:i}=e&&"object"==typeof e?e:{},n="string"==typeof t?t.trim():"",r="string"==typeof i?i.trim():"";if(n||r){let e=window.NOW?.portal_url_suffix;if(e){let t,i=(t=new URLSearchParams({id:"search",spa:"1",q:n,disableAllSuggestions:"false",disableSpellCheck:"false",searchFromChat:"true"}),`/${e}?${t.toString()}`);window.open(i,"_blank");return}let t=(({searchQuery:e="",searchApplicationId:t=""}={})=>{let i="string"==typeof e?e.trim():"",n="string"==typeof t?t.trim():"";return{...iW,params:{...iW.params,...n&&{globalSearchDataConfigId:n},...i&&{searchTerm:i}}}})({searchQuery:n,searchApplicationId:r});if((e=>{let t=window.nowWindowManager?.unifiedNavComponent;if(!t)return!1;try{if("function"==typeof t.dispatchAction)return t.dispatchAction(ih,e),!0;if("function"==typeof t.dispatch)return t.dispatch(ih,e),!0;if("function"==typeof t.dispatchEvent)return t.dispatchEvent(new CustomEvent(ih,{bubbles:!0,composed:!0,detail:e})),!0}catch(e){ri.warn("search:view-all-clicked: failed to dispatch search payload",e)}return!1})(t))return;window.location.assign((e=>{let{context:t={},route:i="search",params:n={}}=e,r="string"==typeof t.path&&t.path.trim().length>0?t.path.trim().replace(/^\/+|\/+$/g,""):"now/nav/ui",s="string"==typeof i&&i.trim().length>0?i.trim().replace(/^\/+/,""):"search",o=new URLSearchParams;Object.entries(n).forEach(([e,t])=>{"string"==typeof t&&t.length>0&&o.set(e,t)});let a=o.toString(),l=`/${r}/${s}`;return a?`${l}?${a}`:l})(t));return}ri.warn("search:view-all-clicked: missing searchQuery/searchApplicationId in payload",e)};function rS(){window.__AIEX_GLOBALS__?.clearAuthTokenCache()}let rL="now:chat:event";class rT extends i3{constructor(){super(...arguments),this.prevData={}}render(e){return F}update(e,[t]){var i;this.element!==e.element&&(this.element=e.element),this.host=(null==(i=e.options)?void 0:i.host)||this.element,this.apply(t),this.groom(t),this.prevData={...t}}apply(e){if(!e)return;let{prevData:t,element:i}=this;for(let n in e){let r=e[n];r!==t[n]&&(i[n]=r)}}groom(e){let{prevData:t,element:i}=this;if(t)for(let n in t)e&&(n in e||i[n]!==t[n])||(i[n]=void 0)}}class rO extends rT{constructor(){super(...arguments),this.eventData={}}apply(e){if(e)for(let t in e){let i=e[t];i!==this.eventData[t]&&this.applyEvent(t,i)}}applyEvent(e,t){let{prevData:i,element:n}=this;this.eventData[e]=t,i[e]&&n.removeEventListener(e,this,t),n.addEventListener(e,this,t)}groom(e){let{prevData:t,element:i}=this;if(t)for(let n in t)e&&(n in e||i[n]!==t[n])||this.groomEvent(n,t[n])}groomEvent(e,t){let{element:i}=this;delete this.eventData[e],i.removeEventListener(e,this,t)}handleEvent(e){let t=this.eventData[e.type];"function"==typeof t?t.call(this.host,e):t.handleEvent(e)}disconnected(){let{eventData:e,element:t}=this;for(let i in e){let n=i.slice(1),r=e[i];t.removeEventListener(n,this,r)}}reconnected(){let{eventData:e,element:t}=this;for(let i in e){let n=i.slice(1),r=e[i];t.addEventListener(n,this,r)}}}let rD=iK(class extends rO{apply(e){if(!e)return;let{prevData:t,element:i}=this;for(let n in e){let r=e[n];if(r===t[n])continue;let s=n.slice(1);switch(n[0]){case"@":this.eventData[s]=r,this.applyEvent(s,r);break;case".":i[s]=r;break;case"?":r?i.setAttribute(s,""):i.removeAttribute(s);break;default:null!=r?i.setAttribute(n,String(r)):i.removeAttribute(n)}}}groom(e){let{prevData:t,element:i}=this;if(t)for(let n in t){let r=n.slice(1);if(!e||!(n in e)&&i[r]===t[n])switch(n[0]){case"@":this.groomEvent(r,t[n]);break;case".":i[r]=void 0;break;case"?":i.removeAttribute(r);break;default:i.removeAttribute(n)}}}}),rP=t2(function(){if(tY)return tJ;tY=1;var e=NaN,t=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,s=parseInt,o="object"==typeof t0&&t0&&t0.Object===Object&&t0,a="object"==typeof self&&self&&self.Object===Object&&self,l=o||a||Function("return this")(),c=Object.prototype.toString,d=Math.max,h=Math.min,u=function(){return l.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(o){if("number"==typeof o)return o;if("symbol"==typeof(a=o)||a&&"object"==typeof a&&"[object Symbol]"==c.call(a))return e;if(p(o)){var a,l="function"==typeof o.valueOf?o.valueOf():o;o=p(l)?l+"":l}if("string"!=typeof o)return 0===o?o:+o;o=o.replace(t,"");var d=n.test(o);return d||r.test(o)?s(o.slice(2),d?2:8):i.test(o)?e:+o}return tJ=function(e,t,i){var n,r,s,o,a,l,c=0,w=!1,g=!1,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function m(t){var i=n,s=r;return n=r=void 0,c=t,o=e.apply(s,i)}function b(e){var i=e-l,n=e-c;return void 0===l||i>=t||i<0||g&&n>=s}function _(){var e,i,n,r=u();if(b(r))return y(r);a=setTimeout(_,(e=r-l,i=r-c,n=t-e,g?h(n,s-i):n))}function y(e){return a=void 0,f&&n?m(e):(n=r=void 0,o)}function x(){var e,i=u(),s=b(i);if(n=arguments,r=this,l=i,s){if(void 0===a)return c=e=l,a=setTimeout(_,t),w?m(e):o;if(g)return a=setTimeout(_,t),m(l)}return void 0===a&&(a=setTimeout(_,t)),o}return t=v(t)||0,p(i)&&(w=!!i.leading,s=(g="maxWait"in i)?d(v(i.maxWait)||0,t):s,f="trailing"in i?!!i.trailing:f),x.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=r=a=void 0},x.flush=function(){return void 0===a?o:y(u())},x}}());var rR=Object.defineProperty,rU=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&rR(t,i,s),s};let rN=new CSSStyleSheet;rN.replaceSync(":host{--aiex-ease: var( --now-motion--ease--guided-enter, cubic-bezier(.21, .64, .52, 1) );--aiex-border-radius: var(--now-unified-border-radius--md, calc(.75rem * var(--aiex-rem-scale, 1)));box-sizing:border-box}:host([isWindowManager]){height:98%!important;width:99%!important}.engagement-experience-container{box-sizing:border-box;flex:1;display:flex;flex-direction:column;justify-content:center;height:100%;container-type:inline-size;container-name:engagement-container}.aiex-content{position:relative;display:flex;z-index:1;height:100%}.aiex-content-base{position:relative;display:flex;z-index:1;height:100%;transition:padding .3s var(--aiex-ease),gap .3s var(--aiex-ease)}.aiex-content-chat-only{.aiex-chat-container{width:100%}.aiex-interactive-container{width:0;overflow:hidden}}.aiex-content-interactive-only{.aiex-chat-container{width:0;overflow:hidden}.aiex-interactive-container{width:100%}}.aiex-content-chat-and-interactive{.aiex-chat-container{width:420px;overflow:auto;border-radius:var(--aiex-border-radius) 0 0 var(--aiex-border-radius)}.aiex-interactive-container{width:calc(100% - 420px);overflow:auto;border-radius:0 var(--aiex-border-radius) var(--aiex-border-radius) 0}}.aiex-content-chat-and-interactive-search{.aiex-chat-container{width:calc(100% - 420px);border-radius:var(--aiex-border-radius) 0 0 var(--aiex-border-radius)}.aiex-interactive-container{width:420px;border-radius:0 var(--aiex-border-radius) var(--aiex-border-radius) 0}}#react-container{flex-basis:0}.aiex-interactive-container{height:100%;border-radius:var(--aiex-border-radius);overflow:hidden;transition:width .8s var(--aiex-ease)}.aiex-chat-container{height:100%;border-radius:var(--aiex-border-radius);transition:width .8s var(--aiex-ease)}@media(max-width:767px){.aiex-chat-container{transition:width .8s var(--aiex-ease),transform .4s var(--aiex-ease),border-radius .4s var(--aiex-ease);transform-origin:top}.aiex-content-interactive-only .aiex-chat-container{width:100%;overflow:auto;transform:scale(.96,.8);border-radius:calc(1rem * var(--aiex-rem-scale, 1))}.aiex-interactive-container{background-color:var( --aiex-bg-primary, rgb(var(--now-color_background--primary, 255, 255, 255)) );position:absolute;bottom:0;left:0;width:100%;height:0;border-radius:calc(1rem * var(--aiex-rem-scale, 1)) calc(1rem * var(--aiex-rem-scale, 1)) 0 0;box-shadow:0 -4px 20px #00000026;transition:height .4s var(--aiex-ease);z-index:10}.aiex-content-interactive-only .aiex-interactive-container,.aiex-content-chat-and-interactive .aiex-interactive-container,.aiex-content-chat-and-interactive-search .aiex-interactive-container{height:100%}.aiex-content-chat-only .aiex-interactive-container{height:0;width:100%}}.aiex-content-popover-wrapper{position:relative;display:flex;z-index:1;height:100%;width:100%;justify-content:flex-start;align-items:center;transition:padding .3s var(--aiex-ease)}.aiex-chat-popover{height:100%;width:100%;overflow:hidden;border-radius:var(--aiex-border-radius)}.aiex-interactive-popover-base{position:absolute;top:0;left:100%;height:100%;overflow:hidden;transition:width var(--aiex-iv-transition-duration, .8s) var(--aiex-iv-transition-timing, ease);z-index:1}.aiex-interactive-popover{width:var(--aiex-interactive-view-width, 0)}.aiex-interactive-popover-hidden{width:0}sn-mw-component{width:100%}.overflow-visible{overflow:visible}@container engagement-container (min-width: 768px){.aiex-content-base{padding-block-end:calc(1rem * var(--aiex-rem-scale, 1));padding-inline:calc(1rem * var(--aiex-rem-scale, 1));gap:2px}.aiex-content-base-moveworks,.aiex-content-base-lbf-omni{padding:0}.aiex-content-popover-wrapper{padding:calc(1rem * var(--aiex-rem-scale, 1))}.aiex-content-popover-wrapper-moveworks{padding:0}}@container engagement-container (min-width: 972px){.aiex-content-chat-and-interactive{.aiex-chat-container{width:420px}.aiex-interactive-container{width:calc(100% - 420px)}}.aiex-content-chat-and-interactive-search{.aiex-chat-container{width:calc(100% - 420px)}.aiex-interactive-container{width:420px}}}@container engagement-container (max-width: 972px){.aiex-content-chat-and-interactive,.aiex-content-chat-and-interactive-search{.aiex-chat-container{width:0px}.aiex-interactive-container{width:100%}}}");let rM=iF("Engagement"),rW=class e extends ea{constructor(){super(...arguments),this.properties=window?.NOW?.aiux?.getExperienceProperties?.(),this.chatType=this.properties?Object.values(this.properties).find(e=>"chatType"===e.name)?.value??"nextwave":"nextwave",this.debug=!1,this.isWindowManager=!1,this.sessionHandshakeSent=!1,this.defaultLbfProps={mode:"primary","disable-header":!0,"always-show-first-utterance":!1,".forceNewConversation":void 0,".enableIntroBanner":!1,".enablePageHistory":!1,".activeWidgetId":"",".branding":void 0},this.sessionData="",this.lbfClientRef=i5(),this.aiexRef=i5(),this.lbfProps={},this.aiexMode="chat_and_interactive_view",this.isDocked=!1,this.isModal=!1,this.availablePanels=1,this.widgetData={},this.itemId="",this.useKarunaWorkload=!1,this.activeConversationId="",this.chatEnabled=!0,this.interactiveViewEnabled=!0,this.hasInteractiveView=!1,this.showInteractiveView=!1,this.chatLoaded=!1,this.contextConversationReady=!1,this.contextConversationEnabled=!1,this.contextConversationForceNew=!1,this.toolExecutionCallbacks={},this.aielUnsubscribers=[],this.earlyUnsubscribers=[],this.initializedChatClients=new Set,this.activeWidgetId="",this.interactiveViewHistoryStack=[],this.isFormDirty=!1,this.pendingDirtyAction=null,this.pendingDirtyResolver=null,this.handleSwitchOrNewConversation=e=>this.clearStaleDirtyForm()?new Promise(e=>{this.pendingDirtyResolver=e}):{allow:!0},this.resizeObserver=new ResizeObserver(rP(t=>{let i=t[0];i.target===this.aiexRef.value&&(this.availablePanels=i.contentRect.width>=e.MIN_WIDTH_FOR_TWO_PANELS?2:1)},7)),this.language=window?.__aiexLibrary?.getUserLanguage()}static{this.styles=[rN]}static{this.MIN_WIDTH_FOR_TWO_PANELS=972.8}shouldDisplayChat(){return 2===this.availablePanels?this.chatEnabled:this.chatEnabled&&!this.showInteractiveView}shouldDisplayInteractiveView(){return this.interactiveViewEnabled&&this.showInteractiveView}getIframeCurrentUrl(){try{let e=this.renderRoot?.querySelector("sn-interactive-view")?.shadowRoot?.querySelector("sn-widget-renderer")?.shadowRoot?.querySelector("iframe");if(e?.contentWindow?.location?.pathname)return e.contentWindow.location.pathname+e.contentWindow.location.search}catch{}return null}getIframeOriginalSrc(){try{let e=this.renderRoot?.querySelector("sn-interactive-view")?.shadowRoot?.querySelector("sn-widget-renderer")?.shadowRoot?.querySelector("iframe");if(e?.src){let t=new URL(e.src,window.location.origin);return t.pathname+t.search}}catch{}return null}clearStaleDirtyForm(){if(this.isFormDirty){let e=this.getIframeCurrentUrl(),t=this.getIframeOriginalSrc();e&&t&&e!==t&&(this.isFormDirty=!1)}return this.isFormDirty}getAiexClass(){return this.chatEnabled&&this.shouldDisplayInteractiveView()?this.widgetData?.type==="SearchResults"?"aiex-content-chat-and-interactive-search":"aiex-content-chat-and-interactive":this.chatEnabled?"aiex-content-chat-only":this.shouldDisplayInteractiveView()?"aiex-content-interactive-only":"aiex-content"}handleSkillContextChange(){if(!this.sessionContext)return;let e=this.lbfClientRef.value;e&&this.skillContext&&window.__AIEX_GLOBALS__?.getLatestState?.(e=>e.sessionSuccess)&&e.invokeSkill({skillId:this.skillContext.skill,skillParams:this.skillContext.skillParams})}handleSeedUserMessageChange(){let e=this.seedUserMessage;if(!e||e===this.lastSentSeed||!this.sessionHandshakeSent)return;let t=this.lbfClientRef.value;t&&(this.lastSentSeed=e,t.createConversation({context:{searchText:e}}))}handleLegacyVoiceShortcut(){let e=this.lbfProps?.[".napShortcutCommand"];e!==this.prevNapShortcutCommand&&(this.prevNapShortcutCommand=e,e?.command==="VOICE_INPUT_SELECTED"&&"nextwave"===this.chatType&&n0(this).then(()=>{this.isConnected&&this.lbfClientRef.value?.startVoiceInput?.()}).catch(()=>{rM.error("Failed to start voice input on LBF client")}))}async firstUpdated(){if(this.aiexRef.value&&(this.resizeObserver.observe(this.aiexRef.value),this.availablePanels=this.aiexRef.value.offsetWidth>=e.MIN_WIDTH_FOR_TWO_PANELS?2:1),"nextwave"===this.chatType)try{this.chatLoaded=await iX()}catch(e){rM.error("Failed to load LBF client",e),this.chatLoaded=!1}else"moveworks"===this.chatType&&(this.chatLoaded=!0);this.debug}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect(),this.aielUnsubscribers.forEach(e=>e()),this.aielUnsubscribers=[],this.earlyUnsubscribers.forEach(e=>e()),this.earlyUnsubscribers=[],this.initializedChatClients.clear(),this.removeEventListener(rL,rl),this.removeEventListener(ia,rf),this.removeEventListener(il,rm),this.removeEventListener(ic,rb),this.removeEventListener(iu,rE),this.removeEventListener(ip,rC),this.removeEventListener(iv,r_),this.removeEventListener(iw,rx),this.removeEventListener(im,rs)}async connectedCallback(){switch(super.connectedCallback(),this.aiexMode){case"chat_only":this.chatEnabled=!0,this.interactiveViewEnabled=!1,this.showInteractiveView=!1;break;case"interactive_view_only":this.chatEnabled=!1,this.interactiveViewEnabled=!0,this.showInteractiveView=!0;break;case"chat_and_interactive_view":case"popover":this.chatEnabled=!0,this.interactiveViewEnabled=!0,this.showInteractiveView=!1}this.addEventListener(rL,rl),this.addEventListener(ia,rf),this.addEventListener(il,rm),this.addEventListener(ic,rb),this.addEventListener(iu,rE),this.addEventListener(ip,rC),this.addEventListener(iv,r_),this.addEventListener(iw,rx),this.addEventListener(im,rs),function(e){let t=window.__AIEX_GLOBALS__;if(!t)return;let i=t.subscribeToEvent("aiel:pageContextChanged",t=>{e.sessionContext&&t.pageContext&&(e.sessionContext.pageContext={...t.pageContext},e.lbfClientRef?.value?.setPageContext?.(t.pageContext))}),n=t.subscribeToEvent("aiel:contextConversationSwitch",(t,i)=>{let{conversationId:n}=i;e.contextConversationReady=!0,n&&n!==e.lbfProps[".conversationId"]&&e.lbfClientRef?.value?.setSession({session:{...e.sessionContext,conversationId:n,forceNewConversation:void 0,newConversationContext:{contextConversationEnabled:!0}}})}),r=n.initialContext?.contextConversation;r?.enabled&&(e.contextConversationEnabled=!0,(r.conversationId||r.forceNewConversation)&&(e.contextConversationReady=!0,r.conversationId&&(e.contextConversationId=r.conversationId),r.forceNewConversation&&(e.contextConversationForceNew=!0)));let s=t.subscribeToEvent("aiel:contextConversationNew",()=>{e.contextConversationReady=!0,e.lbfClientRef?.value?.setSession({session:{...e.sessionContext,conversationId:"",forceNewConversation:!0,newConversationContext:{contextConversationEnabled:!0}}})}),o=t.subscribeToEvent("aiel:contextConversationEnabled",(t,i)=>{e.contextConversationEnabled=i.enabled,!1===i.enabled&&(e.contextConversationReady=!0)});e.earlyUnsubscribers.push(i.unsubscribe),e.earlyUnsubscribers.push(n.unsubscribe),e.earlyUnsubscribers.push(s.unsubscribe),e.earlyUnsubscribers.push(o.unsubscribe)}(this),window.__AIEX_GLOBALS__?.getLatestState?.()?.contextConversation?.enabled||(this.contextConversationReady=!0)}updated(e){if(super.updated(e),e.has("aiexMode"))switch(this.aiexMode){case"chat_only":this.chatEnabled=!0,this.interactiveViewEnabled=!1,this.showInteractiveView=!1;break;case"interactive_view_only":this.chatEnabled=!1,this.interactiveViewEnabled=!0,this.showInteractiveView=!0;break;case"chat_and_interactive_view":case"popover":this.chatEnabled=!0,this.interactiveViewEnabled=!0,this.showInteractiveView=!1}if(e.has("isDocked")&&this.isDocked&&(this.showInteractiveView=!1),(e.has("skillContext")||e.has("sessionContext")&&this.skillContext)&&this.handleSkillContextChange(),(e.has("seedUserMessage")||e.has("sessionHandshakeSent")&&this.seedUserMessage)&&this.handleSeedUserMessageChange(),e.has("isFormDirty")&&(window.__AIEX_GLOBALS__?.updateCustomContext({isFormDirty:this.isFormDirty}),!this.isFormDirty&&this.pendingDirtyAction)){let e=this.pendingDirtyAction;this.pendingDirtyAction=null,e()}e.has("widgetData")&&(this.isFormDirty=!1),e.has("lbfProps")&&this.handleLegacyVoiceShortcut()}async willUpdate(e){super.willUpdate(e),e.has("showInteractiveView")&&(this.showInteractiveView?this.setAttribute("data-iv-visible",""):this.removeAttribute("data-iv-visible"))}getAiexWrapperClass(){if("popover"===this.aiexMode)return"moveworks"===this.chatType?"aiex-content-popover-wrapper aiex-content-popover-wrapper-moveworks":"aiex-content-popover-wrapper";let e="omni"===this.lbfProps.mode;return`${this.getAiexClass()} aiex-content-base ${"moveworks"===this.chatType?"aiex-content-base-moveworks":""}${e?" aiex-content-base-lbf-omni":""}`}getAiexChatClass(){return"popover"===this.aiexMode?"aiex-chat-popover":`${!0===this.lbfProps[".inputOnly"]||"hero"===this.lbfProps.mode?"overflow-visible ":""}aiex-chat-container`}getAiexInteractiveViewClass(){return"popover"===this.aiexMode?this.showInteractiveView?"aiex-interactive-popover-base aiex-interactive-popover":"aiex-interactive-popover-base aiex-interactive-popover-hidden":"aiex-interactive-container"}render(){var e;let t,i,n={...this.defaultLbfProps,".activeWidgetId":this.activeWidgetId,".branding":this.brandingConfig,userlanguage:this.language,...this.lbfProps},r=("primary"===n.mode||"DEFAULT"===n.mode)&&(!0===n[".inputOnly"]||"hero"===n[".mode"])?"hero":n.mode,{".napShortcutCommand":s,...o}=n;return"moveworks"===this.chatType&&(this.sessionData=(t=window.__AIEX_GLOBALS__?.subscribeToEvent(iV,()=>{}),i=JSON.stringify(t?.initialContext.session),t?.unsubscribe?.(),i)),B`
189
180
  <div class="engagement-experience-container" ${i8(this.aiexRef)}>
190
181
  ${this.chatLoaded?B`<div class="${this.getAiexWrapperClass()}">
191
182
  ${this.chatEnabled?B` <div class="${this.getAiexChatClass()}">
@@ -195,7 +186,7 @@ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeSh
195
186
  ></sn-mw-component>
196
187
  `:this.contextConversationReady?B`<now-lbf-chat-client
197
188
  id="lbf-client"
198
- ${rT(o)}
189
+ ${rD(o)}
199
190
  ${i8(this.lbfClientRef)}
200
191
  .onSwitchOrNewConversation=${this.handleSwitchOrNewConversation}
201
192
  ></now-lbf-chat-client>`:null}
@@ -217,24 +208,24 @@ let e;let t=globalThis,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeSh
217
208
  header-label=${"Unsaved changes"}
218
209
  content=${"Looks like you have some unsaved progress. If you leave now, your changes will be lost."}
219
210
  .footerActions=${[{label:ib,variant:"primary",clickActionType:"DIRTY_FORM_LEAVE"},{label:"Stay on page",variant:"secondary",clickActionType:"DIRTY_FORM_STAY"}]}
220
- @click=${t=>(function(e,t){for(let i of t.composedPath()){if(!i.tagName)continue;let n=i.tagName.toLowerCase();if("now-button-iconic"===n){t.stopPropagation(),rr.call(e);return}if("now-button"===n||"now-button-bare"===n){t.stopPropagation(),(i.label||i.getAttribute("label")||i.shadowRoot?.textContent?.trim()||i.textContent?.trim()||"")===ib?rs.call(e):rr.call(e);return}}})(e,t)}
211
+ @click=${t=>(function(e,t){for(let i of t.composedPath()){if(!i.tagName)continue;let n=i.tagName.toLowerCase();if("now-button-iconic"===n){t.stopPropagation(),ro.call(e);return}if("now-button"===n||"now-button-bare"===n){t.stopPropagation(),(i.label||i.getAttribute("label")||i.shadowRoot?.textContent?.trim()||i.textContent?.trim()||"")===ib?ra.call(e):ro.call(e);return}}})(e,t)}
221
212
  ></now-modal>
222
213
  `):null}
223
214
  </div>`:null}
224
215
  </div>`:B`<div></div>`}
225
216
  </div>
226
- `}};function rW(){nJ().then(()=>{if(!this.isConnected||!window.__AIEX_GLOBALS__||!window.__AIEX_GLOBALS__.subscribeToEvent)return;let e=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:sessionUpdated",e=>{e.session&&e.session.authToken&&(this.authToken=e.session.authToken,this.authUnsubscribe())});this.authUnsubscribe=e.unsubscribe;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:customContextUpdated",e=>{e.sessionId&&(this.sessionId=e.sessionId,this.sessionIdUnsubscribe())});this.sessionIdUnsubscribe=t.unsubscribe,e.initialContext.session?.authToken&&(this.authToken=e.initialContext.session.authToken,this.authUnsubscribe()),t.initialContext.sessionId&&(this.sessionId=t.initialContext.sessionId,this.sessionIdUnsubscribe())})}async function rM(e,t,i){if(!e.toolM2mId||!t||!i)throw Error("[getWidgetData] toolContext, authToken, or sessionId is undefined");let n=await fetch(function(){let e=globalThis.NOW?.nextwaveUri||globalThis.APP_CONFIG?.backendUrl;if(e){try{let t=new URL(e);"localhost"===t.hostname||"127.0.0.1"===t.hostname||t.pathname.includes("/backend")||(t.pathname=t.pathname.replace(/\/$/,"")+"/backend",e=t.toString())}catch{e.includes("localhost")||e.includes("127.0.0.1")||e.includes("/backend")||(e=`${e}/backend`)}e=e.replace(/\/$/,"")}return`${e}/api/tools/execute`}(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+t},body:JSON.stringify({sessionId:i,toolM2mId:e.toolM2mId,inputs:e.inputs||{}})});if(!n.ok)throw Error("[getWidgetData] Server widget response is not ok");let r=await n.json();if("SUCCESS"===r.status){let e=r?.result?.widgetResponse?.widget;if(!e)throw Error("[getWidgetData] Widget data not provided in response");return e}throw Error("[getWidgetData] Server widget response status is not SUCCESS")}rR([ed()],rN.prototype,"chatType"),rR([ec()],rN.prototype,"debug"),rR([ec({type:Boolean,reflect:!0})],rN.prototype,"isWindowManager"),rR([ec({type:Object})],rN.prototype,"skillContext"),rR([ec()],rN.prototype,"seedUserMessage"),rR([ed()],rN.prototype,"lastSentSeed"),rR([ed()],rN.prototype,"sessionHandshakeSent"),rR([ed()],rN.prototype,"lbfClientRef"),rR([ed()],rN.prototype,"aiexRef"),rR([ec()],rN.prototype,"lbfProps"),rR([ec()],rN.prototype,"aiexMode"),rR([ec()],rN.prototype,"isDocked"),rR([ec()],rN.prototype,"isModal"),rR([ed()],rN.prototype,"availablePanels"),rR([ed()],rN.prototype,"widgetData"),rR([ed()],rN.prototype,"itemId"),rR([ed()],rN.prototype,"useKarunaWorkload"),rR([ed()],rN.prototype,"activeConversationId"),rR([ed()],rN.prototype,"chatEnabled"),rR([ed()],rN.prototype,"interactiveViewEnabled"),rR([ed()],rN.prototype,"hasInteractiveView"),rR([ed()],rN.prototype,"showInteractiveView"),rR([ed()],rN.prototype,"chatLoaded"),rR([ed()],rN.prototype,"contextConversationReady"),rR([ed()],rN.prototype,"contextConversationId"),rR([ed()],rN.prototype,"contextConversationEnabled"),rR([ed()],rN.prototype,"contextConversationForceNew"),rR([ed()],rN.prototype,"toolExecutionCallbacks"),rR([ed()],rN.prototype,"brandingConfig"),rR([ed()],rN.prototype,"activeWidgetId"),rR([ed()],rN.prototype,"interactiveViewHistoryStack"),rR([ed()],rN.prototype,"isFormDirty"),rR([ed()],rN.prototype,"pendingDirtyAction"),rR([ed()],rN.prototype,"pendingDirtyResolver"),rR([ed()],rN.prototype,"sessionContext"),customElements.get("sn-engagement-experience")||customElements.define("sn-engagement-experience",rN);var rV=Object.defineProperty,rH=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&rV(t,i,s),s};let rB=iF("PinnedWidget"),rj=new CSSStyleSheet;rj.replaceSync("*{box-sizing:border-box}.loading-widget{width:100%;height:100%;display:flex;justify-content:center;align-items:center;font-style:normal;font-size:calc(1rem * var(--aiex-rem-scale, 1))}.pinned-widget-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}");let rF=o`
217
+ `}};function rV(){nY().then(()=>{if(!this.isConnected||!window.__AIEX_GLOBALS__||!window.__AIEX_GLOBALS__.subscribeToEvent)return;let e=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:sessionUpdated",e=>{e.session&&e.session.authToken&&(this.authToken=e.session.authToken,this.authUnsubscribe())});this.authUnsubscribe=e.unsubscribe;let t=window.__AIEX_GLOBALS__.subscribeToEvent("aiel:customContextUpdated",e=>{e.sessionId&&(this.sessionId=e.sessionId,this.sessionIdUnsubscribe())});this.sessionIdUnsubscribe=t.unsubscribe,e.initialContext.session?.authToken&&(this.authToken=e.initialContext.session.authToken,this.authUnsubscribe()),t.initialContext.sessionId&&(this.sessionId=t.initialContext.sessionId,this.sessionIdUnsubscribe())})}async function rH(e,t,i){if(!e.toolM2mId||!t||!i)throw Error("[getWidgetData] toolContext, authToken, or sessionId is undefined");let n=await fetch(function(){let e=globalThis.NOW?.nextwaveUri||globalThis.APP_CONFIG?.backendUrl;if(e){try{let t=new URL(e);"localhost"===t.hostname||"127.0.0.1"===t.hostname||t.pathname.includes("/backend")||(t.pathname=t.pathname.replace(/\/$/,"")+"/backend",e=t.toString())}catch{e.includes("localhost")||e.includes("127.0.0.1")||e.includes("/backend")||(e=`${e}/backend`)}e=e.replace(/\/$/,"")}return`${e}/api/tools/execute`}(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+t},body:JSON.stringify({sessionId:i,toolM2mId:e.toolM2mId,inputs:e.inputs||{}})});if(!n.ok)throw Error("[getWidgetData] Server widget response is not ok");let r=await n.json();if("SUCCESS"===r.status){let e=r?.result?.widgetResponse?.widget;if(!e)throw Error("[getWidgetData] Widget data not provided in response");return e}throw Error("[getWidgetData] Server widget response status is not SUCCESS")}rU([ed()],rW.prototype,"chatType"),rU([ec()],rW.prototype,"debug"),rU([ec({type:Boolean,reflect:!0})],rW.prototype,"isWindowManager"),rU([ec({type:Object})],rW.prototype,"skillContext"),rU([ec()],rW.prototype,"seedUserMessage"),rU([ed()],rW.prototype,"lastSentSeed"),rU([ed()],rW.prototype,"sessionHandshakeSent"),rU([ed()],rW.prototype,"lbfClientRef"),rU([ed()],rW.prototype,"aiexRef"),rU([ec()],rW.prototype,"lbfProps"),rU([ec()],rW.prototype,"aiexMode"),rU([ec()],rW.prototype,"isDocked"),rU([ec()],rW.prototype,"isModal"),rU([ed()],rW.prototype,"availablePanels"),rU([ed()],rW.prototype,"widgetData"),rU([ed()],rW.prototype,"itemId"),rU([ed()],rW.prototype,"useKarunaWorkload"),rU([ed()],rW.prototype,"activeConversationId"),rU([ed()],rW.prototype,"chatEnabled"),rU([ed()],rW.prototype,"interactiveViewEnabled"),rU([ed()],rW.prototype,"hasInteractiveView"),rU([ed()],rW.prototype,"showInteractiveView"),rU([ed()],rW.prototype,"chatLoaded"),rU([ed()],rW.prototype,"contextConversationReady"),rU([ed()],rW.prototype,"contextConversationId"),rU([ed()],rW.prototype,"contextConversationEnabled"),rU([ed()],rW.prototype,"contextConversationForceNew"),rU([ed()],rW.prototype,"toolExecutionCallbacks"),rU([ed()],rW.prototype,"brandingConfig"),rU([ed()],rW.prototype,"activeWidgetId"),rU([ed()],rW.prototype,"interactiveViewHistoryStack"),rU([ed()],rW.prototype,"isFormDirty"),rU([ed()],rW.prototype,"pendingDirtyAction"),rU([ed()],rW.prototype,"pendingDirtyResolver"),rU([ed()],rW.prototype,"sessionContext"),customElements.get("sn-engagement-experience")||customElements.define("sn-engagement-experience",rW);var rB=Object.defineProperty,rj=(e,t,i,n)=>{for(var r,s=void 0,o=e.length-1;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&rB(t,i,s),s};let rF=iF("PinnedWidget"),rG=new CSSStyleSheet;rG.replaceSync("*{box-sizing:border-box}.loading-widget{width:100%;height:100%;display:flex;justify-content:center;align-items:center;font-style:normal;font-size:calc(1rem * var(--aiex-rem-scale, 1))}.pinned-widget-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}");let rz=o`
227
218
  :host {
228
219
  display: block;
229
220
  width: 100%;
230
221
  height: 100%;
231
222
  }
232
- `;class rG extends ea{constructor(){super(...arguments),this.widget={},this.toolContext={toolM2mId:"",inputs:{}},this.onWidgetRefresh=()=>{rB.error("onWidgetRefresh is not defined")},this.authToken="",this.sessionId="",this.authUnsubscribe=()=>{},this.sessionIdUnsubscribe=()=>{}}static{this.styles=[rj,rF]}async refresh(){if(this.toolContext.toolM2mId)if(this.authToken){if(!this.sessionId)throw Error("[Pinned Widget] Unable to refresh widget data: sessionId is undefined")}else throw Error("[Pinned Widget] Unable to refresh widget data: authToken is undefined");else throw Error("[Pinned Widget] Unable to refresh widget data: toolContext.toolM2mId is undefined");try{let e=await rM(this.toolContext,this.authToken,this.sessionId);this.widget=e,this.onWidgetRefresh({status:"SUCCESS",widget:e})}catch(e){this.onWidgetRefresh({status:"ERROR",error:e})}}async connectedCallback(){super.connectedCallback(),rW.call(this)}disconnectedCallback(){super.disconnectedCallback(),this.authUnsubscribe?.(),this.sessionIdUnsubscribe?.()}async updated(e){if(super.updated(e),e.has("authToken")||e.has("sessionId")){if(!this.authToken||!this.sessionId||0!==Object.keys(this.widget).length)return;await this.refresh()}if(e.has("widget")&&0===Object.keys(this.widget).length){if(!this.authToken||!this.sessionId)return;await this.refresh()}}render(){return this.widget?B`
223
+ `;class rX extends ea{constructor(){super(...arguments),this.widget={},this.toolContext={toolM2mId:"",inputs:{}},this.onWidgetRefresh=()=>{rF.error("onWidgetRefresh is not defined")},this.authToken="",this.sessionId="",this.authUnsubscribe=()=>{},this.sessionIdUnsubscribe=()=>{}}static{this.styles=[rG,rz]}async refresh(){if(this.toolContext.toolM2mId)if(this.authToken){if(!this.sessionId)throw Error("[Pinned Widget] Unable to refresh widget data: sessionId is undefined")}else throw Error("[Pinned Widget] Unable to refresh widget data: authToken is undefined");else throw Error("[Pinned Widget] Unable to refresh widget data: toolContext.toolM2mId is undefined");try{let e=await rH(this.toolContext,this.authToken,this.sessionId);this.widget=e,this.onWidgetRefresh({status:"SUCCESS",widget:e})}catch(e){this.onWidgetRefresh({status:"ERROR",error:e})}}async connectedCallback(){super.connectedCallback(),rV.call(this)}disconnectedCallback(){super.disconnectedCallback(),this.authUnsubscribe?.(),this.sessionIdUnsubscribe?.()}async updated(e){if(super.updated(e),e.has("authToken")||e.has("sessionId")){if(!this.authToken||!this.sessionId||0!==Object.keys(this.widget).length)return;await this.refresh()}if(e.has("widget")&&0===Object.keys(this.widget).length){if(!this.authToken||!this.sessionId)return;await this.refresh()}}render(){return this.widget?B`
233
224
  <div class="pinned-widget-container">
234
225
  <sn-widget-renderer
235
226
  .widget=${this.widget}
236
227
  is-pinned=${!0}
237
228
  ></sn-widget-renderer>
238
229
  </div>
239
- `:B` <div class="loading-widget">Loading widget...</div> `}}rH([ec()],rG.prototype,"widget"),rH([ec()],rG.prototype,"toolContext"),rH([ec()],rG.prototype,"onWidgetRefresh"),rH([ed()],rG.prototype,"authToken"),rH([ed()],rG.prototype,"sessionId"),customElements.get("sn-engagement-pinned-widget")||customElements.define("sn-engagement-pinned-widget",rG),window.___INTERFACE_VERSIONS___||(window.___INTERFACE_VERSIONS___={}),window.___INTERFACE_VERSIONS___["ai-engagement-shell-experience"]="1.4.0-rc.5";
240
- //# sourceMappingURL=aiex-BOLhPDhB.js.map
230
+ `:B` <div class="loading-widget">Loading widget...</div> `}}rj([ec()],rX.prototype,"widget"),rj([ec()],rX.prototype,"toolContext"),rj([ec()],rX.prototype,"onWidgetRefresh"),rj([ed()],rX.prototype,"authToken"),rj([ed()],rX.prototype,"sessionId"),customElements.get("sn-engagement-pinned-widget")||customElements.define("sn-engagement-pinned-widget",rX),window.___INTERFACE_VERSIONS___||(window.___INTERFACE_VERSIONS___={}),window.___INTERFACE_VERSIONS___["ai-engagement-shell-experience"]="1.4.0-rc.9";
231
+ //# sourceMappingURL=aiex-Dh5lMLmr.js.map