@digital-realty/ui-knowledgebase 18.0.1 → 18.0.2-IXUAT-11240.566978

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,6 +1,6 @@
1
1
  import{LitElement as e,css as t,html as n,nothing as r,svg as i}from"lit";import{customElement as a,property as o,state as s}from"lit/decorators.js";import{Router as c}from"@vaadin/router";import{unsafeHTML as l}from"lit/directives/unsafe-html.js";import"@digital-realty/ix-search-bar/ix-search-bar.js";import{styleMap as u}from"lit/directives/style-map.js";import"@digital-realty/ix-icon/ix-icon.js";import"@digital-realty/ix-progress/ix-progress.js";import{repeat as d}from"lit/directives/repeat.js";import"@digital-realty/ix-button/ix-button.js";import{live as f}from"lit/directives/live.js";import{ifDefined as p}from"lit/directives/if-defined.js";import"@digital-realty/ix-switch/ix-switch.js";var m=null;function ee(e,t,n){m=new c(e,{baseUrl:`/`}),m.setRoutes(n)}function te(){return m}function ne(){m?.unsubscribe(),m?.setRoutes([],!0),m=null}var h=window.registeredApps?.[`ui-knowledgebase`]?.path??`/knowledge-base`,re=e=>e===h||e.startsWith(`${h}/`);function g(e,t,n){if(e!=null){if(Array.isArray(e)){e.forEach((e,r)=>g(e,`${t}[${r}]`,n));return}if(typeof e==`object`){for(let[r,i]of Object.entries(e))i!==void 0&&g(i,`${t}[${r}]`,n);return}n.push(`${encodeURIComponent(t)}=${encodeURIComponent(String(e))}`)}}function ie(e){let t=[];for(let[n,r]of Object.entries(e))r!==void 0&&g(r,n,t);return t.length?`?${t.join(`&`)}`:``}function _(e,t){if(!e)return``;try{let n=new URL(t);if(![`http:`,`https:`].includes(n.protocol)||n.username||n.password)return``;n.pathname=`${n.pathname.replace(/\/$/,``)}/`,n.search=``,n.hash=``;let r=e.startsWith(`/`)&&!e.startsWith(`//`)?e.slice(1):e,i=new URL(r,n);if(![`http:`,`https:`].includes(i.protocol)||i.username||i.password)return``;let a=e=>[`localhost`,`127.0.0.1`,`[::1]`].includes(e)||e.endsWith(`.localhost`);return a(n.hostname)&&!a(i.hostname)?``:i.href}catch{return``}}function ae(e,t){this.v=e,this.k=t}function oe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e){if(Array.isArray(e))return e}function y(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function se(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ce(e,t){return v(e)||y(e,t)||le(e,t)||se()}function le(e,t){if(e){if(typeof e==`string`)return oe(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oe(e,t):void 0}}function ue(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof ae;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}ue.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},ue.prototype.next=function(e){return this._invoke(`next`,e)},ue.prototype.throw=function(e){return this._invoke(`throw`,e)},ue.prototype.return=function(e){return this._invoke(`return`,e)};var de=Object.entries,fe=Object.setPrototypeOf,pe=Object.isFrozen,me=Object.getPrototypeOf,he=Object.getOwnPropertyDescriptor,b=Object.freeze,x=Object.seal,ge=Object.create,_e=typeof Reflect<`u`&&Reflect,ve=_e.apply,ye=_e.construct;b||=function(e){return e},x||=function(e){return e},ve||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},ye||=function(e){return new e(...[...arguments].slice(1))};var be=E(Array.prototype.forEach);Array.prototype.indexOf;var xe=E(Array.prototype.lastIndexOf),Se=E(Array.prototype.pop),Ce=E(Array.prototype.push);Array.prototype.slice;var we=E(Array.prototype.splice),Te=Array.isArray,Ee=E(String.prototype.toLowerCase),De=E(String.prototype.toString),Oe=E(String.prototype.match),ke=E(String.prototype.replace),Ae=E(String.prototype.indexOf),je=E(String.prototype.trim),Me=E(Number.prototype.toString),Ne=E(Boolean.prototype.toString),S=typeof BigInt>`u`?null:E(BigInt.prototype.toString),Pe=typeof Symbol>`u`?null:E(Symbol.prototype.toString),C=E(Object.prototype.hasOwnProperty),Fe=E(Object.prototype.toString),w=E(RegExp.prototype.test),T=Ie(TypeError);function E(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ve(e,t,n)}}function Ie(e){return function(){return ye(e,[...arguments])}}function D(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ee;if(fe&&fe(e,null),!Te(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(pe(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Le(e){for(let t=0;t<e.length;t++)C(e,t)||(e[t]=null);return e}function O(e){let t=ge(null);for(let r of de(e)){var n=ce(r,2);let i=n[0],a=n[1];C(e,i)&&(t[i]=Te(a)?Le(a):a&&typeof a==`object`&&a.constructor===Object?O(a):a)}return t}function Re(e){switch(typeof e){case`string`:return e;case`number`:return Me(e);case`boolean`:return Ne(e);case`bigint`:return S?S(e):`0`;case`symbol`:return Pe?Pe(e):`Symbol()`;case`undefined`:return Fe(e);case`function`:case`object`:{if(e===null)return Fe(e);let t=e,n=k(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Fe(e)}return Fe(e)}default:return Fe(e)}}function k(e,t){for(;e!==null;){let n=he(e,t);if(n){if(n.get)return E(n.get);if(typeof n.value==`function`)return E(n.value)}e=me(e)}function n(){return null}return n}function ze(e){try{return w(e,``),!0}catch{return!1}}var Be=b(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ve=b(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),He=b([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ue=b([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),We=b(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ge=b([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ke=b([`#text`]),qe=b(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Je=b(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ye=b(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Xe=b([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ze=x(/{{[\w\W]*|^[\w\W]*}}/g),Qe=x(/<%[\w\W]*|^[\w\W]*%>/g),$e=x(/\${[\w\W]*/g),et=x(/^data-[\-\w.\u00B7-\uFFFF]+$/),tt=x(/^aria-[\-\w]+$/),nt=x(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rt=x(/^(?:\w+script|data):/i),it=x(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),at=x(/^html$/i),ot=x(/^[a-z][.\w]*(-[.\w]+)+$/i),st=x(/<[/\w!]/g),ct=x(/<[/\w]/g),lt=x(/<\/no(script|embed|frames)/i),ut=x(/\/>/i),A={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},dt=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],ft=b(D({},dt)),pt=function(){let e={};return be(dt,t=>{e[t]=x(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),b(e)}(),mt=function(){return typeof window>`u`?null:window},ht=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},gt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},j=function(e,t,n,r){return C(e,t)&&Te(e[t])?D(r.base?O(r.base):{},e[t],r.transform):n},_t=function(e,t,n){let r=C(e,t)?e[t]:void 0;return r&&typeof r==`object`?O(r):n()};function vt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mt(),t=e=>vt(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==A.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=k(d,`cloneNode`),p=k(d,`remove`),m=k(d,`removeAttributeNode`),ee=k(d,`nextSibling`),te=k(d,`childNodes`),ne=k(d,`parentNode`),h=k(d,`shadowRoot`),re=k(d,`attributes`),g=o&&o.prototype?k(o.prototype,`nodeType`):null,ie=o&&o.prototype?k(o.prototype,`nodeName`):null,_=o&&o.prototype?k(o.prototype,`ownerDocument`):null,ae=function(e){return g?g(e):e.nodeType},oe=function(e){return ie?ie(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,y=``,se,ce=!1,le=0,ue=function(){if(le>0)throw T(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},fe=function(e){ue(),le++;try{return v.createHTML(e)}finally{le--}},pe=function(e){ue(),le++;try{return v.createScriptURL(e)}finally{le--}},me=function(){return ce||=(se=ht(u,i),!0),se},he=n,_e=he.implementation,ve=he.createNodeIterator,ye=he.createDocumentFragment,Me=he.getElementsByTagName,Ne=r.importNode,S=gt();t.isSupported=typeof de==`function`&&typeof ne==`function`&&_e&&_e.createHTMLDocument!==void 0;let Pe=Ze,Fe=Qe,E=$e,Ie=et,Le=tt,dt=rt,yt=it,bt=ot,xt=nt,M=null,St=D({},[...Be,...Ve,...He,...We,...Ke]),N=null,P=D({},[...qe,...Je,...Ye,...Xe]),F=Object.seal(ge(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ct=null,wt=null,I=Object.seal(ge(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Tt=!0,L=!0,Et=!1,Dt=!0,R=!1,z=!0,Ot=!1,kt=!1,At=null,jt=null,Mt=!1,B=!1,Nt=!1,Pt=!1,Ft=!0,It=!1,Lt=`user-content-`,Rt=!0,zt=!1,Bt={},V=null,Vt=D({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),H=null,Ht=D({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ut=null,Wt=D({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Gt=`http://www.w3.org/1998/Math/MathML`,Kt=`http://www.w3.org/2000/svg`,U=`http://www.w3.org/1999/xhtml`,qt=U,Jt=!1,Yt=null,Xt=D({},[Gt,Kt,U],De),Zt=b([`mi`,`mo`,`mn`,`ms`,`mtext`]),Qt=D({},Zt),$t=b([`annotation-xml`]),en=D({},$t),tn=D({},[`title`,`style`,`font`,`a`,`script`]),W=null,nn=[`application/xhtml+xml`,`text/html`],G=null,rn=null,an=n.createElement(`form`),on=function(e){return e instanceof RegExp||e instanceof Function},sn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rn&&rn===e)return;(!e||typeof e!=`object`)&&(e={}),e=O(e),W=nn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,G=W===`application/xhtml+xml`?De:Ee,M=j(e,`ALLOWED_TAGS`,St,{transform:G}),N=j(e,`ALLOWED_ATTR`,P,{transform:G}),Yt=j(e,`ALLOWED_NAMESPACES`,Xt,{transform:De}),Ut=j(e,`ADD_URI_SAFE_ATTR`,Wt,{transform:G,base:Wt}),H=j(e,`ADD_DATA_URI_TAGS`,Ht,{transform:G,base:Ht}),V=j(e,`FORBID_CONTENTS`,Vt,{transform:G}),Ct=j(e,`FORBID_TAGS`,O({}),{transform:G}),wt=j(e,`FORBID_ATTR`,O({}),{transform:G}),Bt=C(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?O(e.USE_PROFILES):e.USE_PROFILES:!1,Tt=e.ALLOW_ARIA_ATTR!==!1,L=e.ALLOW_DATA_ATTR!==!1,Et=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,R=e.SAFE_FOR_TEMPLATES||!1,z=e.SAFE_FOR_XML!==!1,Ot=e.WHOLE_DOCUMENT||!1,B=e.RETURN_DOM||!1,Nt=e.RETURN_DOM_FRAGMENT||!1,Pt=e.RETURN_TRUSTED_TYPE||!1,Mt=e.FORCE_BODY||!1,Ft=e.SANITIZE_DOM!==!1,It=e.SANITIZE_NAMED_PROPS||!1,Rt=e.KEEP_CONTENT!==!1,zt=e.IN_PLACE||!1,xt=ze(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:nt,qt=typeof e.NAMESPACE==`string`?e.NAMESPACE:U,Qt=_t(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>D({},Zt)),en=_t(e,`HTML_INTEGRATION_POINTS`,()=>D({},$t));let t=_t(e,`CUSTOM_ELEMENT_HANDLING`,()=>ge(null));if(F=ge(null),C(t,`tagNameCheck`)&&on(t.tagNameCheck)&&(F.tagNameCheck=t.tagNameCheck),C(t,`attributeNameCheck`)&&on(t.attributeNameCheck)&&(F.attributeNameCheck=t.attributeNameCheck),C(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(F.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),x(F),R&&(L=!1),Nt&&(B=!0),Bt&&(M=D({},Ke),N=ge(null),Bt.html===!0&&(D(M,Be),D(N,qe)),Bt.svg===!0&&(D(M,Ve),D(N,Je),D(N,Xe)),Bt.svgFilters===!0&&(D(M,He),D(N,Je),D(N,Xe)),Bt.mathMl===!0&&(D(M,We),D(N,Ye),D(N,Xe))),I.tagCheck=null,I.attributeCheck=null,C(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?I.tagCheck=e.ADD_TAGS:Te(e.ADD_TAGS)&&(M===St&&(M=O(M)),D(M,e.ADD_TAGS,G))),C(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?I.attributeCheck=e.ADD_ATTR:Te(e.ADD_ATTR)&&(N===P&&(N=O(N)),D(N,e.ADD_ATTR,G))),C(e,`ADD_FORBID_CONTENTS`)&&Te(e.ADD_FORBID_CONTENTS)&&(V===Vt&&(V=O(V)),D(V,e.ADD_FORBID_CONTENTS,G)),Rt&&(M[`#text`]=!0),Ot&&D(M,[`html`,`head`,`body`]),M.table&&(D(M,[`tbody`]),delete Ct.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=v;v=e.TRUSTED_TYPES_POLICY;try{y=fe(``)}catch(e){throw v=t,e}}else e.TRUSTED_TYPES_POLICY===null?(v=void 0,y=``):(v===void 0&&(v=me()),v&&typeof y==`string`&&(y=fe(``)));b&&b(e),rn=e},cn=D({},[...Ve,...He,...Ue]),ln=D({},[...We,...Ge]),un=function(e,t,n){return t.namespaceURI===U?e===`svg`:t.namespaceURI===Gt?e===`svg`&&(n===`annotation-xml`||Qt[n]):!!cn[e]},dn=function(e,t,n){return t.namespaceURI===U?e===`math`:t.namespaceURI===Kt?e===`math`&&en[n]:!!ln[e]},fn=function(e,t,n){return t.namespaceURI===Kt&&!en[n]||t.namespaceURI===Gt&&!Qt[n]?!1:!ln[e]&&(tn[e]||!cn[e])},pn=function(e){let t=ne(e);(!t||!t.tagName)&&(t={namespaceURI:qt,tagName:`template`});let n=Ee(e.tagName),r=Ee(t.tagName);return Yt[e.namespaceURI]?e.namespaceURI===Kt?un(n,t,r):e.namespaceURI===Gt?dn(n,t,r):e.namespaceURI===U?fn(n,t,r):!!(W===`application/xhtml+xml`&&Yt[e.namespaceURI]):!1},K=function(e){Ce(t.removed,{element:e});try{ne(e).removeChild(e)}catch{if(p(e),!ne(e))throw T(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},mn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},hn=function(e){_n(e);let t=te(e);if(t){let e=[];be(t,t=>{Ce(e,t)}),be(e,e=>{try{p(e)}catch{}})}let n=re(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&mn(e,r,i)}},q=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Ce(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(B||Nt)try{K(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},gn=function(e){let t=re(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||N[G(i)]||mn(e,r,i)}},_n=function(e){let t=[e];for(;t.length>0;){let e=t.pop();ae(e)===A.element&&gn(e);let n=te(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},vn=function(e,t){return z?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},yn=function(e){if(!z)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=ae(e);if(n===A.processingInstruction||n===A.comment&&w(ct,e.data)){try{p(e)}catch{}continue}if(n===A.element){let t=e,n=G(oe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&vn(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=te(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},bn=function(e){let t=null,r=null;if(Mt)e=`<remove></remove>`+e;else{let t=Oe(e,/^[\r\n\t ]+/);r=t&&t[0]}W===`application/xhtml+xml`&&qt===U&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?fe(e):e;if(qt===U)try{t=new l().parseFromString(i,W)}catch{}if(!t||!t.documentElement){t=_e.createDocument(qt,`template`,null);try{t.documentElement.innerHTML=Jt?y:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),qt===U?Me.call(t,Ot?`html`:`body`)[0]:Ot?t.documentElement:a},xn=function(e){let t=_?_(e):e.ownerDocument;return ve.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Sn=function(e){return e=ke(e,Pe,` `),e=ke(e,Fe,` `),e=ke(e,E,` `),e},Cn=function(e){e.normalize();let t=_?_(e):e.ownerDocument,n=ve.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Sn(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&be(i,e=>{Tn(e.content)&&Cn(e.content)})},wn=function(e){let t=ie?ie(e):null;return typeof t!=`string`||G(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==re(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==g(e)||e.childNodes!==te(e)},Tn=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return g(e)===A.documentFragment}catch{return!1}},J=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return typeof g(e)==`number`}catch{return!1}};function Y(e,n,r){e.length!==0&&be(e,e=>{e.call(t,n,r,rn)})}let En=function(e,t){return!!(z&&e.hasChildNodes()&&!J(e.firstElementChild)&&w(st,e.textContent)&&w(st,e.innerHTML)||z&&e.namespaceURI===U&&ft[t]&&(J(e.firstElementChild)||typeof e.textContent==`string`&&w(pt[t],e.textContent))||e.nodeType===A.processingInstruction||z&&e.nodeType===A.comment&&w(ct,e.data))},X=function(e,t){return e instanceof RegExp?w(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Dn=function(e,t,n){if(!Ct[t]&&Mn(t)&&X(F.tagNameCheck,t))return!1;if(Rt&&!V[t]){let t=ne(e),r=te(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,ee(e))}}}return K(e),!0},On=function(e,t,n,r){return e.length===0?t:t===n||t===r?O(t):t},Z=function(e,t){return e===t||ne(e)!==null?!1:(zt&&_n(e),!0)},kn=function(e,n){if(Y(S.beforeSanitizeElements,e,null),Z(e,n))return!0;if(wn(e))return K(e),!0;let r=G(oe(e));if(M=On(S.uponSanitizeElement,M,St,At),Y(S.uponSanitizeElement,e,{tagName:r,allowedTags:M}),Z(e,n))return!0;if(En(e,r))return K(e),!0;if(Ct[r]||!(I.tagCheck instanceof Function&&I.tagCheck(r))&&!M[r]){let t=Dn(e,r,n);return t===!1&&(Y(S.afterSanitizeElements,e,null),Z(e,n))?!0:t}if(ae(e)===A.element&&!pn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&w(lt,e.innerHTML))return K(e),!0;if(R&&e.nodeType===A.text){let n=Sn(e.textContent);e.textContent!==n&&(Ce(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Y(S.afterSanitizeElements,e,null),Z(e,n)},An=function(e,t,r){if(wt[t]||vn(t,e)||Ft&&(t===`id`||t===`name`)&&(r in n||r in an))return!1;let i=N[t]||I.attributeCheck instanceof Function&&I.attributeCheck(t,e);return L&&w(Ie,t)||Tt&&w(Le,t)?!0:i?Ut[t]||w(xt,ke(r,yt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ae(r,`data:`)===0&&H[e]||Et&&!w(dt,ke(r,yt,``))?!0:!r:Mn(e)&&X(F.tagNameCheck,e)&&X(F.attributeNameCheck,t,e)||t===`is`&&F.allowCustomizedBuiltInElements&&X(F.tagNameCheck,r)},jn=D({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Mn=function(e){return!jn[Ee(e)]&&w(bt,e)},Nn=function(e,t,n,r){if(v&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return fe(r);case`TrustedScriptURL`:return pe(r)}return r},Pn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!wn(e)||(K(e),!1)}catch{return q(t,e),!1}},Fn=function(e,n){if(Y(S.beforeSanitizeAttributes,e,null),Z(e,n))return;let r=e.attributes;if(!r||wn(e))return;N=On(S.uponSanitizeAttribute,N,P,jt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:N,forceKeepAttr:void 0},a=r.length,o=G(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=G(s),d=l,f=s===`value`?d:je(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Y(S.uponSanitizeAttribute,e,i),f=i.attrValue,It&&(u===`id`||u===`name`)&&Ae(f,Lt)!==0&&(q(s,e,n),f=Lt+f,p=!0),z&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){q(s,e,n);continue}if(u===`attributename`&&Oe(f,`href`)){q(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){q(s,e,n);continue}if(!Dt&&w(ut,f)){q(s,e,n);continue}if(R&&(f=Sn(f)),!An(o,u,f)){q(s,e,n);continue}f=Nn(o,u,c,f),f!==d&&Pn(e,s,c,f)&&p&&Se(t.removed)}}Y(S.afterSanitizeAttributes,e,null),Z(e,n)},In=function(e){let t=null,n=xn(e);for(Y(S.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Y(S.uponSanitizeShadowNode,t,null),kn(t,e),Fn(t,e),Tn(t.content)&&In(t.content),ae(t)===A.element){let e=h(t);Tn(e)&&(Q(e),In(e))}Y(S.afterSanitizeShadowDOM,e,null)},Q=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){In(e.shadow);continue}let n=e.node,r=ae(n)===A.element,i=te(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=ie?ie(n):null;if(typeof e==`string`&&G(e)===`template`){let e=n.content;Tn(e)&&t.push({node:e,shadow:null})}}if(r){let e=h(n);Tn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Jt=!e,Jt&&(e=`<!-->`),typeof e!=`string`&&!J(e)&&(e=Re(e),typeof e!=`string`))throw T(`dirty is not a string, aborting`);if(!t.isSupported)return e;kt?(M=At,N=jt):sn(n),(S.uponSanitizeElement.length>0||S.uponSanitizeAttribute.length>0)&&(M=O(M)),S.uponSanitizeAttribute.length>0&&(N=O(N)),t.removed=[];let c=zt&&typeof e!=`string`&&J(e);if(c){yn(e);let t=oe(e);if(typeof t==`string`){let n=G(t);if(!M[n]||Ct[n])throw hn(e),T(`root node is forbidden and cannot be sanitized in-place`)}if(wn(e))throw hn(e),T(`root node is clobbered and cannot be sanitized in-place`);try{Q(e)}catch(t){throw hn(e),t}}else if(J(e))i=bn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===A.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Q(i);else{if(!B&&!R&&!Ot&&e.indexOf(`<`)===-1)return v&&Pt?fe(e):e;if(i=bn(e),!i)return B?null:Pt?y:``}i&&Mt&&K(i.firstChild);let l=c?e:i;try{let e=xn(l);for(;o=e.nextNode();)kn(o,l),Fn(o,l),Tn(o.content)&&In(o.content)}catch(n){throw c&&(hn(e),be(t.removed,e=>{e.element&&_n(e.element)})),n}if(c){let n=!1;if(be(t.removed,t=>{t.element&&(t.element===e&&(n=!0),_n(t.element))}),n)throw T(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return R&&Cn(e),e}if(B){if(R&&Cn(i),Nt)for(s=ye.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(N.shadowroot||N.shadowrootmode)&&(s=Ne.call(r,s,!0)),s}let u=Ot?i.outerHTML:i.innerHTML;return Ot&&M[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(at,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
- `+u),R&&(u=Sn(u)),v&&Pt?fe(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sn(e),kt=!0,At=M,jt=N},t.clearConfig=function(){rn=null,kt=!1,At=null,jt=null,v=se,y=``},t.isValidAttribute=function(e,t,n){rn||sn({});let r=G(e),i=G(t);return An(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&C(S,e)&&Ce(S[e],t)},t.removeHook=function(e,t){if(C(S,e)){if(t!==void 0){let n=xe(S[e],t);return n===-1?void 0:we(S[e],n,1)[0]}return Se(S[e])}},t.removeHooks=function(e){C(S,e)&&(S[e]=[])},t.removeAllHooks=function(){S=gt()},t}var yt=vt(),bt=(e,t)=>{t.attrName===`crossorigin`&&(t.keepAttr=[`audio`,`video`].includes(e.localName)&&t.attrValue.toLowerCase()===`anonymous`,t.keepAttr&&(t.attrValue=`anonymous`))};function xt(e){let t={ALLOWED_TAGS:`a.abbr.article.audio.b.blockquote.br.caption.cite.code.dd.del.details.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.i.img.ins.kbd.li.mark.ol.p.picture.pre.q.s.small.source.span.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.time.tr.track.u.ul.video.wbr`.split(`.`),ALLOWED_ATTR:`alt.class.colspan.controls.crossorigin.datetime.dir.download.height.href.id.kind.label.lang.loading.poster.preload.rel.rowspan.scope.src.srclang.start.target.title.type.width`.split(`.`),ALLOW_DATA_ATTR:!1};yt.addHook(`uponSanitizeAttribute`,bt);try{return yt.sanitize(e,t)}finally{yt.removeHook(`uponSanitizeAttribute`,bt)}}function M(e,t){let n=new DOMParser().parseFromString(e,`text/html`);return n.querySelectorAll(`a[href]`).forEach(e=>{let n=e.getAttribute(`href`)??``,r=/^(?:\/)?(?:uploads|media)\//.test(n)?_(n,t):n;r!==n&&e.setAttribute(`href`,r),St(r)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}),n.querySelectorAll(`img[src], video[src], audio[src], source[src], track[src]`).forEach(e=>{let n=_(e.getAttribute(`src`)??``,t);n?e.setAttribute(`src`,n):e.removeAttribute(`src`)}),n.querySelectorAll(`video[poster]`).forEach(e=>{let n=_(e.getAttribute(`poster`)??``,t);n?e.setAttribute(`poster`,n):e.removeAttribute(`poster`)}),n.querySelectorAll(`[srcset]`).forEach(e=>e.removeAttribute(`srcset`)),n.querySelectorAll(`[style]`).forEach(e=>{/url\s*\(|@import|\\/i.test(e.getAttribute(`style`)??``)&&e.removeAttribute(`style`)}),n.body.innerHTML}function St(e){if(!/^https?:\/\//i.test(e))return!1;try{return new URL(e).origin!==window.location.origin}catch{return!1}}function N(e,t){let r=M(xt(e??``),t);return n`${l(r)}`}function P(e,t){if(!e||!e.url)return null;let n=_(e.url,t);if(!n)return null;let r;if(e.formats){r={};for(let[n,i]of Object.entries(e.formats))i?.url&&(r[n]={url:_(i.url,t),width:i.width,height:i.height})}return{url:n,alternativeText:e.alternativeText??null,mime:e.mime,name:e.name,width:e.width,height:e.height,formats:r}}var F=e=>e===`text`||e===`accordion`||e===`video_card`||e===`document_card`?e:void 0;function Ct(e){return{documentId:e.documentId??``,code:e.code??``,name:e.name??``,icon:e.icon}}function wt(e,t){return{documentId:e.documentId??``,uid:e.uid??``,title:e.title??``,subtitle:e.subtitle,icon:e.icon,image:P(e.image,t),behavior:F(e.behavior),order:e.order,showSortBy:e.showSortBy??!1,showFilterByTopic:e.showFilterByTopic??!1}}function I(e,t){return{documentId:e.documentId??``,uid:e.uid??``,title:e.title??``,abstract:e.abstract,body:N(e.text,t),behavior:F(e.behavior)??F(e.category?.behavior),featured:e.featured??!1,duration:e.duration,dateAdded:e.dateAdded,publishedAt:e.publishedAt??null,topics:(e.topics??[]).map(Ct),category:e.category?wt(e.category,t):null,thumbnail:P(e.thumbnail,t),video:P(e.video,t),captions:P(e.captions,t),documents:(e.documents??[]).map(e=>P(e,t)).filter(e=>e!==null)}}function Tt(e,t){return e?{heading:e.heading??``,description:e.description??``,backgroundImage:P(e.backgroundImage,t)}:null}var L=class extends Error{constructor(e,t){super(e,t?.cause===void 0?void 0:{cause:t.cause}),this.name=`KbApiError`,this.status=t?.status}};function Et(e){return!e.uid||!e.title?null:{uid:e.uid,title:e.title,categoryUid:e.category?.uid??``,categoryIcon:e.category?.icon}}var Dt=`whats-new`,R=100,z={thumbnail:!0,video:!0,documents:!0,topics:!0,captions:!0,category:{populate:{image:!0}}};function Ot(e){let t=e.apiBaseUrl.replace(/\/+$/,``),n=e.mediaBaseUrl,r=()=>typeof e.previewDrafts==`function`?e.previewDrafts():e.previewDrafts===!0,i=e.locale,a=e.fetch??globalThis.fetch.bind(globalThis),o=e.pageSize??R;if(!Number.isInteger(o)||o<1||o>R)throw new L(`KB page size must be an integer from 1 to 100`);async function s(e,n){let o=r()?`draft`:`published`,s=ie({...n,status:o,locale:i}),c=`${t}/api/${e}${s}`,l;try{l=await a(c,{credentials:`omit`,redirect:`error`,signal:AbortSignal.timeout(15e3)})}catch(t){throw new L(`Network error fetching ${e}`,{cause:t})}if(!l.ok)throw new L(`Strapi responded ${l.status} for ${e}`,{status:l.status});let u;try{u=await l.json()}catch(t){throw new L(`Invalid JSON from ${e}`,{cause:t})}if(!u||typeof u!=`object`||!Object.hasOwn(u,`data`))throw new L(`Invalid Strapi response from ${e}`);return u}async function c(e,t){return(await s(e,t)).data}async function l(e,t,n=!0){let r=[];for(let i=1;i<=1e4;i++){let a=typeof t.pagination==`object`?t.pagination:{},o=await s(e,{...t,pagination:{...a,page:i}});if(!Array.isArray(o.data))throw new L(`Invalid Strapi collection from ${e}`);r.push(...o.data);let c=o.meta?.pagination;if(!c)return r;if(!Number.isInteger(c.page)||c.page!==i||!Number.isInteger(c.pageSize)||c.pageSize<1||!Number.isInteger(c.pageCount)||c.pageCount<0||!Number.isInteger(c.total)||c.total<0||c.pageCount>i&&o.data.length===0)throw new L(`Invalid Strapi pagination from ${e}`);if(!n||i>=c.pageCount)return r}throw new L(`Strapi pagination limit exceeded for ${e}`)}async function u(){return(await l(`categories`,{populate:{image:!0},sort:[`order:asc`,`id:asc`],pagination:{pageSize:o}})).map(e=>wt(e,n))}return{getCategories:u,async getLanding(){let[e,t,r,i,a]=await Promise.all([c(`index-page`,{populate:{backgroundImage:!0}}),u(),l(`topics`,{sort:[`order:asc`,`id:asc`],pagination:{pageSize:o}}),l(`posts`,{filters:{featured:{$eq:!0}},populate:z,sort:[`dateAdded:desc`,`id:asc`],pagination:{pageSize:o}}),l(`posts`,{filters:{category:{uid:{$eq:Dt}}},populate:z,sort:[`dateAdded:desc`,`id:asc`],pagination:{pageSize:o}})]);return{indexPage:Tt(e,n),categories:t,topics:r.map(e=>Ct(e)),featured:i.map(e=>I(e,n)),whatsNew:a.map(e=>I(e,n))}},async getCategory(e){let[t,r]=await Promise.all([l(`categories`,{filters:{uid:{$eq:e}},populate:{image:!0},pagination:{pageSize:1}},!1),l(`posts`,{filters:{category:{uid:{$eq:e}}},populate:z,sort:[`dateAdded:desc`,`id:asc`],pagination:{pageSize:o}})]);return{category:t[0]?wt(t[0],n):null,posts:r.map(e=>I(e,n))}},async getTopic(e){let[t,r]=await Promise.all([l(`topics`,{filters:{code:{$eq:e}},pagination:{pageSize:1}},!1),l(`posts`,{filters:{topics:{code:{$eq:e}}},populate:z,sort:[`dateAdded:desc`,`id:asc`],pagination:{pageSize:o}})]);return{topic:t[0]?Ct(t[0]):null,posts:r.map(e=>I(e,n))}},async getPost(e){let t=await l(`posts`,{filters:{uid:{$eq:e}},populate:z,pagination:{pageSize:1}},!1);return t[0]?I(t[0],n):null},async getPostLinks(e){let t={};return e?.categoryUid&&(t.category={uid:{$eq:e.categoryUid}}),e?.topicCode&&(t.topics={code:{$eq:e.topicCode}}),(await l(`posts`,{fields:[`uid`,`title`],populate:{category:{fields:[`uid`,`icon`]}},filters:Object.keys(t).length?t:void 0,sort:[`title:asc`,`id:asc`],pagination:{pageSize:o}})).map(Et).filter(e=>e!==null)}}}function kt(){return window.gpConfig?.[`ui-knowledgebase`]}function At(){let e=kt(),t=e?.[`KB:strapiBaseUrl`];if(!t)throw Error(`ui-knowledgebase config not loaded: window.gpConfig['ui-knowledgebase']['KB:strapiBaseUrl'] is missing. Ensure config.json is fetched before the KB route renders.`);let n;try{if(n=new URL(t),![`http:`,`https:`].includes(n.protocol)||n.username||n.password||n.search||n.hash||n.pathname!==`/`)throw Error()}catch{throw Error(`KB CMS configuration must be an HTTP(S) origin, without an API path or credentials.`)}return{apiBaseUrl:n.origin,mediaBaseUrl:n.origin,previewDrafts:e?.[`KB:previewDraftContent`]??!1}}var jt=`KB:previewDraftContent`,Mt=null,B=null,Nt=new Set;function Pt(){Mt===null&&(Mt=kt()?.[jt]===!0,B=Mt)}function Ft(){return Pt(),Mt}function It(){return Pt(),B}function Lt(e){if(Pt(),Mt&&e!==B){B=e;for(let e of Nt)e()}}function Rt(e){return Nt.add(e),()=>{Nt.delete(e)}}function zt(e){let t=new Map;function n(e,n){let r=t.get(e);if(r)return r;let i=n().catch(n=>{throw t.delete(e),n});return t.set(e,i),i}let r=e=>`${It()?`draft`:`pub`}:${e}`;return{getLanding:()=>n(r(`landing`),()=>e.getLanding()),getCategories:()=>n(r(`categories`),()=>e.getCategories()),getCategory:t=>n(r(`category:${t}`),()=>e.getCategory(t)),getTopic:t=>n(r(`topic:${t}`),()=>e.getTopic(t)),getPost:t=>n(r(`post:${t}`),()=>e.getPost(t)),getPostLinks:t=>n(r(`postlinks:${t?.categoryUid??``}:${t?.topicCode??``}`),()=>e.getPostLinks(t)),invalidate:e=>{e?t.delete(e):t.clear()}}}var Bt;function V(){return Bt||=zt(Ot({...At(),previewDrafts:()=>It()})),Bt}var Vt=t`
3
+ `+u),R&&(u=Sn(u)),v&&Pt?fe(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sn(e),kt=!0,At=M,jt=N},t.clearConfig=function(){rn=null,kt=!1,At=null,jt=null,v=se,y=``},t.isValidAttribute=function(e,t,n){rn||sn({});let r=G(e),i=G(t);return An(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&C(S,e)&&Ce(S[e],t)},t.removeHook=function(e,t){if(C(S,e)){if(t!==void 0){let n=xe(S[e],t);return n===-1?void 0:we(S[e],n,1)[0]}return Se(S[e])}},t.removeHooks=function(e){C(S,e)&&(S[e]=[])},t.removeAllHooks=function(){S=gt()},t}var yt=vt(),bt=(e,t)=>{t.attrName===`crossorigin`&&(t.keepAttr=[`audio`,`video`].includes(e.localName)&&t.attrValue.toLowerCase()===`anonymous`,t.keepAttr&&(t.attrValue=`anonymous`))};function xt(e){let t={ALLOWED_TAGS:`a.abbr.article.audio.b.blockquote.br.caption.cite.code.dd.del.details.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.i.img.ins.kbd.li.mark.ol.p.picture.pre.q.s.small.source.span.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.time.tr.track.u.ul.video.wbr`.split(`.`),ALLOWED_ATTR:`alt.class.colspan.controls.crossorigin.datetime.dir.download.height.href.id.kind.label.lang.loading.poster.preload.rel.rowspan.scope.src.srclang.start.target.title.type.width`.split(`.`),ALLOW_DATA_ATTR:!1};yt.addHook(`uponSanitizeAttribute`,bt);try{return yt.sanitize(e,t)}finally{yt.removeHook(`uponSanitizeAttribute`,bt)}}function M(e,t){let n=new DOMParser().parseFromString(e,`text/html`);return n.querySelectorAll(`a[href]`).forEach(e=>{let n=e.getAttribute(`href`)??``,r=/^(?:\/)?(?:uploads|media)\//.test(n)?_(n,t):n;r!==n&&e.setAttribute(`href`,r),St(r)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}),n.querySelectorAll(`img[src], video[src], audio[src], source[src], track[src]`).forEach(e=>{let n=_(e.getAttribute(`src`)??``,t);n?e.setAttribute(`src`,n):e.removeAttribute(`src`)}),n.querySelectorAll(`video[poster]`).forEach(e=>{let n=_(e.getAttribute(`poster`)??``,t);n?e.setAttribute(`poster`,n):e.removeAttribute(`poster`)}),n.querySelectorAll(`[srcset]`).forEach(e=>e.removeAttribute(`srcset`)),n.querySelectorAll(`[style]`).forEach(e=>{/url\s*\(|@import|\\/i.test(e.getAttribute(`style`)??``)&&e.removeAttribute(`style`)}),n.body.innerHTML}function St(e){if(!/^https?:\/\//i.test(e))return!1;try{return new URL(e).origin!==window.location.origin}catch{return!1}}function N(e,t){let r=M(xt(e??``),t);return n`${l(r)}`}function P(e,t){if(!e||!e.url)return null;let n=_(e.url,t);if(!n)return null;let r;if(e.formats){r={};for(let[n,i]of Object.entries(e.formats))i?.url&&(r[n]={url:_(i.url,t),width:i.width,height:i.height})}return{url:n,alternativeText:e.alternativeText??null,mime:e.mime,name:e.name,width:e.width,height:e.height,formats:r}}var F=e=>e===`text`||e===`accordion`||e===`video_card`||e===`document_card`?e:void 0;function Ct(e){return{documentId:e.documentId??``,code:e.code??``,name:e.name??``,icon:e.icon}}function wt(e,t){return{documentId:e.documentId??``,uid:e.uid??``,title:e.title??``,subtitle:e.subtitle,icon:e.icon,image:P(e.image,t),behavior:F(e.behavior),order:e.order,showSortBy:e.showSortBy??!1,showFilterByTopic:e.showFilterByTopic??!1}}function I(e,t){return{documentId:e.documentId??``,uid:e.uid??``,title:e.title??``,abstract:e.abstract,body:N(e.text,t),behavior:F(e.behavior)??F(e.category?.behavior),featured:e.featured??!1,duration:e.duration,dateAdded:e.dateAdded,publishedAt:e.publishedAt??null,topics:(e.topics??[]).map(Ct),category:e.category?wt(e.category,t):null,thumbnail:P(e.thumbnail,t),video:P(e.video,t),captions:P(e.captions,t),documents:(e.documents??[]).map(e=>P(e,t)).filter(e=>e!==null)}}function Tt(e,t){return e?{heading:e.heading??``,description:e.description??``,backgroundImage:P(e.backgroundImage,t)}:null}var L=class extends Error{constructor(e,t){super(e,t?.cause===void 0?void 0:{cause:t.cause}),this.name=`KbApiError`,this.status=t?.status}};function Et(e){return!e.uid||!e.title?null:{uid:e.uid,title:e.title,categoryUid:e.category?.uid??``,categoryIcon:e.category?.icon}}var Dt=`whats-new`,R=100,z={thumbnail:!0,video:!0,documents:!0,topics:!0,captions:!0,category:{populate:{image:!0}}};function Ot(e){let t=e.apiBaseUrl.replace(/\/+$/,``),n=e.mediaBaseUrl,r=()=>typeof e.previewDrafts==`function`?e.previewDrafts():e.previewDrafts===!0,i=e.locale,a=e.fetch??globalThis.fetch.bind(globalThis),o=e.pageSize??R;if(!Number.isInteger(o)||o<1||o>R)throw new L(`KB page size must be an integer from 1 to 100`);async function s(e,n){let o=r()?`draft`:`published`,s=ie({...n,status:o,locale:i}),c=`${t}/api/${e}${s}`,l;try{l=await a(c,{credentials:`omit`,redirect:`error`,signal:AbortSignal.timeout(15e3)})}catch(t){throw new L(`Network error fetching ${e}`,{cause:t})}if(!l.ok)throw new L(`Strapi responded ${l.status} for ${e}`,{status:l.status});let u;try{u=await l.json()}catch(t){throw new L(`Invalid JSON from ${e}`,{cause:t})}if(!u||typeof u!=`object`||!Object.hasOwn(u,`data`))throw new L(`Invalid Strapi response from ${e}`);return u}async function c(e,t){return(await s(e,t)).data}async function l(e,t,n=!0){let r=[];for(let i=1;i<=1e4;i++){let a=typeof t.pagination==`object`?t.pagination:{},o=await s(e,{...t,pagination:{...a,page:i}});if(!Array.isArray(o.data))throw new L(`Invalid Strapi collection from ${e}`);r.push(...o.data);let c=o.meta?.pagination;if(!c)return r;if(!Number.isInteger(c.page)||c.page!==i||!Number.isInteger(c.pageSize)||c.pageSize<1||!Number.isInteger(c.pageCount)||c.pageCount<0||!Number.isInteger(c.total)||c.total<0||c.pageCount>i&&o.data.length===0)throw new L(`Invalid Strapi pagination from ${e}`);if(!n||i>=c.pageCount)return r}throw new L(`Strapi pagination limit exceeded for ${e}`)}async function u(){return(await l(`categories`,{populate:{image:!0},sort:[`order:asc`,`id:asc`],pagination:{pageSize:o}})).map(e=>wt(e,n))}return{getCategories:u,async getLanding(){let[e,t,r,i,a]=await Promise.all([c(`index-page`,{populate:{backgroundImage:!0}}),u(),l(`topics`,{sort:[`order:asc`,`id:asc`],pagination:{pageSize:o}}),l(`posts`,{filters:{featured:{$eq:!0}},populate:z,sort:[`dateAdded:desc`,`id:asc`],pagination:{pageSize:o}}),l(`posts`,{filters:{category:{uid:{$eq:Dt}}},populate:z,sort:[`dateAdded:desc`,`id:asc`],pagination:{pageSize:1}},!1)]);return{indexPage:Tt(e,n),categories:t,topics:r.map(e=>Ct(e)),featured:i.map(e=>I(e,n)),whatsNew:a.map(e=>I(e,n))}},async getCategory(e){let[t,r]=await Promise.all([l(`categories`,{filters:{uid:{$eq:e}},populate:{image:!0},pagination:{pageSize:1}},!1),l(`posts`,{filters:{category:{uid:{$eq:e}}},populate:z,sort:[`dateAdded:desc`,`id:asc`],pagination:{pageSize:o}})]);return{category:t[0]?wt(t[0],n):null,posts:r.map(e=>I(e,n))}},async getTopic(e){let[t,r]=await Promise.all([l(`topics`,{filters:{code:{$eq:e}},pagination:{pageSize:1}},!1),l(`posts`,{filters:{topics:{code:{$eq:e}}},populate:z,sort:[`dateAdded:desc`,`id:asc`],pagination:{pageSize:o}})]);return{topic:t[0]?Ct(t[0]):null,posts:r.map(e=>I(e,n))}},async getPost(e){let t=await l(`posts`,{filters:{uid:{$eq:e}},populate:z,pagination:{pageSize:1}},!1);return t[0]?I(t[0],n):null},async getPostLinks(e){let t={};return e?.categoryUid&&(t.category={uid:{$eq:e.categoryUid}}),e?.topicCode&&(t.topics={code:{$eq:e.topicCode}}),(await l(`posts`,{fields:[`uid`,`title`],populate:{category:{fields:[`uid`,`icon`]}},filters:Object.keys(t).length?t:void 0,sort:[`title:asc`,`id:asc`],pagination:{pageSize:o}})).map(Et).filter(e=>e!==null)}}}function kt(){return window.gpConfig?.[`ui-knowledgebase`]}function At(){let e=kt(),t=e?.[`KB:strapiBaseUrl`];if(!t)throw Error(`ui-knowledgebase config not loaded: window.gpConfig['ui-knowledgebase']['KB:strapiBaseUrl'] is missing. Ensure config.json is fetched before the KB route renders.`);let n;try{if(n=new URL(t),![`http:`,`https:`].includes(n.protocol)||n.username||n.password||n.search||n.hash||n.pathname!==`/`)throw Error()}catch{throw Error(`KB CMS configuration must be an HTTP(S) origin, without an API path or credentials.`)}return{apiBaseUrl:n.origin,mediaBaseUrl:n.origin,previewDrafts:e?.[`KB:previewDraftContent`]??!1}}var jt=`KB:previewDraftContent`,Mt=null,B=null,Nt=new Set;function Pt(){Mt===null&&(Mt=kt()?.[jt]===!0,B=Mt)}function Ft(){return Pt(),Mt}function It(){return Pt(),B}function Lt(e){if(Pt(),Mt&&e!==B){B=e;for(let e of Nt)e()}}function Rt(e){return Nt.add(e),()=>{Nt.delete(e)}}function zt(e){let t=new Map;function n(e,n){let r=t.get(e);if(r)return r;let i=n().catch(n=>{throw t.delete(e),n});return t.set(e,i),i}let r=e=>`${It()?`draft`:`pub`}:${e}`;return{getLanding:()=>n(r(`landing`),()=>e.getLanding()),getCategories:()=>n(r(`categories`),()=>e.getCategories()),getCategory:t=>n(r(`category:${t}`),()=>e.getCategory(t)),getTopic:t=>n(r(`topic:${t}`),()=>e.getTopic(t)),getPost:t=>n(r(`post:${t}`),()=>e.getPost(t)),getPostLinks:t=>n(r(`postlinks:${t?.categoryUid??``}:${t?.topicCode??``}`),()=>e.getPostLinks(t)),invalidate:e=>{e?t.delete(e):t.clear()}}}var Bt;function V(){return Bt||=zt(Ot({...At(),previewDrafts:()=>It()})),Bt}var Vt=t`
4
4
  :host {
5
5
  display: block;
6
6
  width: 100%;
@@ -263,7 +263,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
263
263
  `}function $t(e){if(!e)return``;let t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(`en-US`,{month:`long`,year:`numeric`}).format(t)}function en(e){if(!e)return``;let t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(`en-US`,{month:`long`,day:`numeric`,year:`numeric`}).format(t)}function tn(e){return e.length===0?n`<p class="text-gray-500">Nothing here yet.</p>`:n`
264
264
  ${e[0]?.category?.subtitle?n`<p class="font-body m-0 mb-6 text-sm leading-6 font-normal tracking-[0.25px] text-[rgb(9,34,65)]">${e[0].category.subtitle}</p>`:r}
265
265
  <ul class="list-none p-0">
266
- ${e.map(e=>n`
266
+ ${e.slice(0,1).map(e=>n`
267
267
  <li class="mb-6">
268
268
  <time
269
269
  datetime="${e.dateAdded??``}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-realty/ui-knowledgebase",
3
- "version": "18.0.1",
3
+ "version": "18.0.2-IXUAT-11240.566978",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"