@fluid-topics/ft-reader-toc 1.1.52 → 1.1.53

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.
@@ -201,7 +201,7 @@ class FtReaderToc extends FtReaderComponent {
201
201
  }
202
202
  getLeafNodeIcon() {
203
203
  return html `
204
- <ft-icon class="ft-reader-toc--leaf-node-icon" .variant="${this.leafNodeIconVariant}" .value="${this.leafNodeIcon}"></ft-icon>`;
204
+ <ft-icon class="ft-reader-toc--leaf-node-icon" part="leaf-node-icon" .variant="${this.leafNodeIconVariant}" .value="${this.leafNodeIcon}"></ft-icon>`;
205
205
  }
206
206
  }
207
207
  FtReaderToc.elementDefinitions = {
@@ -865,7 +865,7 @@ const V=Symbol.for(""),X=t=>{if(t?.r===V)return t?._$litStatic$},q=t=>({_$litSta
865
865
  ${o.setVariable(Vo.iconSize,Wr.iconFontSize)};
866
866
  }
867
867
 
868
- .ft-reader-toc--leaf-node-icon {
868
+ [part="leaf-node-icon"] {
869
869
  color: ${Wr.leafNodeIconColor};
870
870
  }
871
871
 
@@ -979,4 +979,4 @@ const V=Symbol.for(""),X=t=>{if(t?.r===V)return t?._$litStatic$},q=t=>({_$litSta
979
979
  `:e.nothing}
980
980
  </div>
981
981
  `}buildAutomaticallyExpandedNodes(t){var o,e;let r=new Set(this.autoCollapse?[]:this.automaticallyExpandedNodes);for(let a of t){let t=a;for(;t&&!r.has(t);)r.add(t),this.manuallyCollapsedNodes.delete(t),t=null===(e=null===(o=this.service)||void 0===o?void 0:o.getTocNodeNow(t))||void 0===e?void 0:e.parentTocId}return r}manuallyToggle(t,o){o?(this.manuallyCollapsedNodes.add(t),this.manuallyExpandedNodes.delete(t)):(this.manuallyExpandedNodes.add(t),this.manuallyCollapsedNodes.delete(t)),this.requestUpdate()}onViewportSizeChange(t){this.viewportSize=t.detail.category}toggleExpandCollapseAll(){this.expandAll=!this.expandAll,this.automaticallyExpandedNodes=new Set,this.manuallyExpandedNodes=new Set,this.manuallyCollapsedNodes=new Set}getExpandCollapseAllTooltipPosition(){switch(this.expandCollapseAllAlignment){case"right":return"left";case"left":return"right";default:return"bottom"}}getLeafNodeIcon(){return e.html`
982
- <ft-icon class="ft-reader-toc--leaf-node-icon" .variant="${this.leafNodeIconVariant}" .value="${this.leafNodeIcon}"></ft-icon>`}}Rr.elementDefinitions={"ft-button":xr,"ft-icon":Ko,"ft-reader-internal-link":Uo,"ft-size-watcher":Ir,"ft-typography":Co},Rr.styles=kr,Ur([n.property({type:Boolean})],Rr.prototype,"expanded",void 0),Ur([n.property()],Rr.prototype,"iconVariant",void 0),Ur([n.property()],Rr.prototype,"collapseIcon",void 0),Ur([n.property()],Rr.prototype,"expandIcon",void 0),Ur([n.property()],Rr.prototype,"leafNodeIconVariant",void 0),Ur([n.property()],Rr.prototype,"leafNodeIcon",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"expandCollapseAll",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"expandCollapseAllHideLabel",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"expandCollapseAllTrailingIcon",void 0),Ur([n.property()],Rr.prototype,"expandCollapseAllAlignment",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"expandCollapseAllHideIcon",void 0),Ur([n.property()],Rr.prototype,"expandCollapseAllIconVariant",void 0),Ur([n.property()],Rr.prototype,"collapseAllIcon",void 0),Ur([n.property()],Rr.prototype,"expandAllIcon",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"autoCollapse",void 0),Ur([n.property()],Rr.prototype,"scope",void 0),Ur([n.property({type:Boolean,reflect:!0})],Rr.prototype,"empty",void 0),Ur([o.jsonProperty({})],Rr.prototype,"labels",void 0),Ur([o.redux({selector:(t,o)=>{var e,r,a;return o.isCurrentPageToc?(null===(e=t.paginationConfiguration)||void 0===e?void 0:e.splitCurrentPageToc)?null===(r=t.currentPage)||void 0===r?void 0:r.toc:void 0:(null===(a=t.paginationConfiguration)||void 0===a?void 0:a.splitCurrentPageToc)?t.pagesToc:t.toc}})],Rr.prototype,"toc",void 0),Ur([o.redux()],Rr.prototype,"currentPage",void 0),Ur([o.redux({selector:(t,o)=>{var e,r;return(null===(e=t.paginationConfiguration)||void 0===e?void 0:e.splitCurrentPageToc)&&!o.isCurrentPageToc?[null===(r=t.currentPage)||void 0===r?void 0:r.rootTocId]:t.visibleTopics}})],Rr.prototype,"highlightedTocIds",void 0),Ur([n.state({hasChanged:(t,e)=>!o.deepEqual(t,e)})],Rr.prototype,"automaticallyExpandedNodes",void 0),Ur([n.state({hasChanged:(t,e)=>!o.deepEqual(t,e)})],Rr.prototype,"manuallyExpandedNodes",void 0),Ur([n.state({hasChanged:(t,e)=>!o.deepEqual(t,e)})],Rr.prototype,"manuallyCollapsedNodes",void 0),Ur([n.state()],Rr.prototype,"expandAll",void 0),Ur([n.state()],Rr.prototype,"viewportSize",void 0),o.customElement("ft-reader-toc")(Rr),t.DEFAULT_LABELS=Er,t.FtReaderToc=Rr,t.FtReaderTocCssVariables=Wr,t.styles=kr}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litRepeat,ftGlobals.litClassMap,ftGlobals.litStyleMap,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML);
982
+ <ft-icon class="ft-reader-toc--leaf-node-icon" part="leaf-node-icon" .variant="${this.leafNodeIconVariant}" .value="${this.leafNodeIcon}"></ft-icon>`}}Rr.elementDefinitions={"ft-button":xr,"ft-icon":Ko,"ft-reader-internal-link":Uo,"ft-size-watcher":Ir,"ft-typography":Co},Rr.styles=kr,Ur([n.property({type:Boolean})],Rr.prototype,"expanded",void 0),Ur([n.property()],Rr.prototype,"iconVariant",void 0),Ur([n.property()],Rr.prototype,"collapseIcon",void 0),Ur([n.property()],Rr.prototype,"expandIcon",void 0),Ur([n.property()],Rr.prototype,"leafNodeIconVariant",void 0),Ur([n.property()],Rr.prototype,"leafNodeIcon",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"expandCollapseAll",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"expandCollapseAllHideLabel",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"expandCollapseAllTrailingIcon",void 0),Ur([n.property()],Rr.prototype,"expandCollapseAllAlignment",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"expandCollapseAllHideIcon",void 0),Ur([n.property()],Rr.prototype,"expandCollapseAllIconVariant",void 0),Ur([n.property()],Rr.prototype,"collapseAllIcon",void 0),Ur([n.property()],Rr.prototype,"expandAllIcon",void 0),Ur([n.property({type:Boolean})],Rr.prototype,"autoCollapse",void 0),Ur([n.property()],Rr.prototype,"scope",void 0),Ur([n.property({type:Boolean,reflect:!0})],Rr.prototype,"empty",void 0),Ur([o.jsonProperty({})],Rr.prototype,"labels",void 0),Ur([o.redux({selector:(t,o)=>{var e,r,a;return o.isCurrentPageToc?(null===(e=t.paginationConfiguration)||void 0===e?void 0:e.splitCurrentPageToc)?null===(r=t.currentPage)||void 0===r?void 0:r.toc:void 0:(null===(a=t.paginationConfiguration)||void 0===a?void 0:a.splitCurrentPageToc)?t.pagesToc:t.toc}})],Rr.prototype,"toc",void 0),Ur([o.redux()],Rr.prototype,"currentPage",void 0),Ur([o.redux({selector:(t,o)=>{var e,r;return(null===(e=t.paginationConfiguration)||void 0===e?void 0:e.splitCurrentPageToc)&&!o.isCurrentPageToc?[null===(r=t.currentPage)||void 0===r?void 0:r.rootTocId]:t.visibleTopics}})],Rr.prototype,"highlightedTocIds",void 0),Ur([n.state({hasChanged:(t,e)=>!o.deepEqual(t,e)})],Rr.prototype,"automaticallyExpandedNodes",void 0),Ur([n.state({hasChanged:(t,e)=>!o.deepEqual(t,e)})],Rr.prototype,"manuallyExpandedNodes",void 0),Ur([n.state({hasChanged:(t,e)=>!o.deepEqual(t,e)})],Rr.prototype,"manuallyCollapsedNodes",void 0),Ur([n.state()],Rr.prototype,"expandAll",void 0),Ur([n.state()],Rr.prototype,"viewportSize",void 0),o.customElement("ft-reader-toc")(Rr),t.DEFAULT_LABELS=Er,t.FtReaderToc=Rr,t.FtReaderTocCssVariables=Wr,t.styles=kr}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litRepeat,ftGlobals.litClassMap,ftGlobals.litStyleMap,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML);
@@ -138,7 +138,7 @@ function(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=${r}
138
138
  * @license
139
139
  * Copyright 2019 Google LLC
140
140
  * SPDX-License-Identifier: BSD-3-Clause
141
- */const Ri=window,ki=Ri.ShadowRoot&&(void 0===Ri.ShadyCSS||Ri.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;class Li extends be{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([e,o])=>t.registry.define(e,o))));const e={...t.shadowRootOptions,customElements:t.registry},o=this.renderOptions.creationScope=this.attachShadow(e);return((t,e)=>{ki?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const o=document.createElement("style"),r=Ri.litNonce;void 0!==r&&o.setAttribute("nonce",r),o.textContent=e.cssText,t.appendChild(o)}))})(o,t.elementStyles),o}}var Wi,Ui=Object.freeze({__proto__:null,ScopedRegistryLitElement:Li}),zi=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Bi=Symbol("constructorPrototype"),Fi=Symbol("constructorName"),Ai=Symbol("exportpartsDebouncer");class ji extends Li{constructor(){super(),this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Wi]=new no(5),this[Fi]=this.constructor.name,this[Bi]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Fi]&&Object.setPrototypeOf(this,this[Bi])}connectedCallback(){super.connectedCallback(),this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet])}updated(t){var e;super.updated(t),t.has("customStylesheet")&&this.adoptedCustomStyleSheet.replace(null!==(e=this.customStylesheet)&&void 0!==e?e:""),this.updateComplete.then((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}))}contentAvailableCallback(t){}scheduleExportpartsUpdate(){var t,e,o;((null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())||null!==(o=null===(e=this.exportpartsPrefixes)||void 0===e?void 0:e.length)&&void 0!==o&&o)&&this[Ai].run((()=>{var t,e;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&(null===(e=this.exportpartsPrefixes)||void 0===e?void 0:e.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,o,r,i,n,a;const l=t=>null!=t&&t.trim().length>0,s=t.filter(l).map((t=>t.trim()));if(0===s.length)return void this.removeAttribute("exportparts");const c=new Set;for(let t of null!==(o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==o?o:[]){const e=null!==(i=null===(r=t.getAttribute("part"))||void 0===r?void 0:r.split(" "))&&void 0!==i?i:[],o=null!==(a=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==a?a:[];new Array(...e,...o).filter(l).map((t=>t.trim())).forEach((t=>c.add(t)))}if(0===c.size)return void this.removeAttribute("exportparts");const f=[...c.values()].flatMap((t=>s.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...f].join(", "))}}Wi=Ai,zi([we()],ji.prototype,"exportpartsPrefix",void 0),zi([uo([])],ji.prototype,"exportpartsPrefixes",void 0),zi([we()],ji.prototype,"customStylesheet",void 0);var _i=Object.freeze({__proto__:null,FtLitElement:ji}),Pi=Object.freeze({__proto__:null});class Mi{constructor(t,e=!0,o=[],r=5e3){this.ctx=t,this.iframes=e,this.exclude=o,this.iframesTimeout=r}static matches(t,e){const o="string"==typeof e?[e]:e,r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;if(r){let e=!1;return o.every((o=>!r.call(t,o)||(e=!0,!1))),e}return!1}getContexts(){let t,e=[];return t=void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[],t.forEach((t=>{const o=e.filter((e=>e.contains(t))).length>0;-1!==e.indexOf(t)||o||e.push(t)})),e}getIframeContents(t,e,o=(()=>{})){let r;try{const e=t.contentWindow;if(r=e.document,!e||!r)throw new Error("iframe inaccessible")}catch(t){o()}r&&e(r)}isIframeBlank(t){const e="about:blank",o=t.getAttribute("src").trim();return t.contentWindow.location.href===e&&o!==e&&o}observeIframeLoad(t,e,o){let r=!1,i=null;const n=()=>{if(!r){r=!0,clearTimeout(i);try{this.isIframeBlank(t)||(t.removeEventListener("load",n),this.getIframeContents(t,e,o))}catch(t){o()}}};t.addEventListener("load",n),i=setTimeout(n,this.iframesTimeout)}onIframeReady(t,e,o){try{"complete"===t.contentWindow.document.readyState?this.isIframeBlank(t)?this.observeIframeLoad(t,e,o):this.getIframeContents(t,e,o):this.observeIframeLoad(t,e,o)}catch(t){o()}}waitForIframes(t,e){let o=0;this.forEachIframe(t,(()=>!0),(t=>{o++,this.waitForIframes(t.querySelector("html"),(()=>{--o||e()}))}),(t=>{t||e()}))}forEachIframe(t,e,o,r=(()=>{})){let i=t.querySelectorAll("iframe"),n=i.length,a=0;i=Array.prototype.slice.call(i);const l=()=>{--n<=0&&r(a)};n||l(),i.forEach((t=>{Mi.matches(t,this.exclude)?l():this.onIframeReady(t,(r=>{e(t)&&(a++,o(r)),l()}),l)}))}createIterator(t,e,o){return document.createNodeIterator(t,e,o,!1)}createInstanceOnIframe(t){return new Mi(t.querySelector("html"),this.iframes)}compareNodeIframe(t,e,o){if(t.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING){if(null===e)return!0;if(e.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}getIteratorNode(t){const e=t.previousNode();let o;return o=(null===e||t.nextNode())&&t.nextNode(),{prevNode:e,node:o}}checkIframeFilter(t,e,o,r){let i=!1,n=!1;return r.forEach(((t,e)=>{t.val===o&&(i=e,n=t.handled)})),this.compareNodeIframe(t,e,o)?(!1!==i||n?!1===i||n||(r[i].handled=!0):r.push({val:o,handled:!0}),!0):(!1===i&&r.push({val:o,handled:!1}),!1)}handleOpenIframes(t,e,o,r){t.forEach((t=>{t.handled||this.getIframeContents(t.val,(t=>{this.createInstanceOnIframe(t).forEachNode(e,o,r)}))}))}iterateThroughNodes(t,e,o,r,i){const n=this.createIterator(e,t,r);let a,l,s=[],c=[],f=()=>(({prevNode:l,node:a}=this.getIteratorNode(n)),a);for(;f();)this.iframes&&this.forEachIframe(e,(t=>this.checkIframeFilter(a,l,t,s)),(e=>{this.createInstanceOnIframe(e).forEachNode(t,(t=>c.push(t)),r)})),c.push(a);c.forEach((t=>{o(t)})),this.iframes&&this.handleOpenIframes(s,t,o,r),i()}forEachNode(t,e,o,r=(()=>{})){const i=this.getContexts();let n=i.length;n||r(),i.forEach((i=>{const a=()=>{this.iterateThroughNodes(t,i,e,o,(()=>{--n<=0&&r()}))};this.iframes?this.waitForIframes(i,a):a()}))}}const Zi=function(t){const e=new class{constructor(t){this.ctx=t,this.ie=!1;const e=window.navigator.userAgent;(e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1)&&(this.ie=!0)}set opt(t){this._opt=Object.assign({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:"disabled",each:()=>{},noMatch:()=>{},filter:()=>!0,done:()=>{},debug:!1,log:window.console},t)}get opt(){return this._opt}get iterator(){return new Mi(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(t,e="debug"){const o=this.opt.log;this.opt.debug&&"object"==typeof o&&"function"==typeof o[e]&&o[e](`mark.js: ${t}`)}escapeStr(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}createRegExp(t){return"disabled"!==this.opt.wildcards&&(t=this.setupWildcardsRegExp(t)),t=this.escapeStr(t),Object.keys(this.opt.synonyms).length&&(t=this.createSynonymsRegExp(t)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),this.opt.diacritics&&(t=this.createDiacriticsRegExp(t)),t=this.createMergedBlanksRegExp(t),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.createJoinersRegExp(t)),"disabled"!==this.opt.wildcards&&(t=this.createWildcardsRegExp(t)),this.createAccuracyRegExp(t)}createSynonymsRegExp(t){const e=this.opt.synonyms,o=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let i in e)if(e.hasOwnProperty(i)){const n=e[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),l="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(n):this.escapeStr(n);""!==a&&""!==l&&(t=t.replace(new RegExp(`(${this.escapeStr(a)}|${this.escapeStr(l)})`,`gm${o}`),r+`(${this.processSynomyms(a)}|`+`${this.processSynomyms(l)})`+r))}return t}processSynomyms(t){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),t}setupWildcardsRegExp(t){return(t=t.replace(/(?:\\)*\?/g,(t=>"\\"===t.charAt(0)?"?":""))).replace(/(?:\\)*\*/g,(t=>"\\"===t.charAt(0)?"*":""))}createWildcardsRegExp(t){let e="withSpaces"===this.opt.wildcards;return t.replace(/\u0001/g,e?"[\\S\\s]?":"\\S?").replace(/\u0002/g,e?"[\\S\\s]*?":"\\S*")}setupIgnoreJoinersRegExp(t){return t.replace(/[^(|)\\]/g,((t,e,o)=>{let r=o.charAt(e+1);return/[(|)\\]/.test(r)||""===r?t:t+"\0"}))}createJoinersRegExp(t){let e=[];const o=this.opt.ignorePunctuation;return Array.isArray(o)&&o.length&&e.push(this.escapeStr(o.join(""))),this.opt.ignoreJoiners&&e.push("\\u00ad\\u200b\\u200c\\u200d"),e.length?t.split(/\u0000+/).join(`[${e.join("")}]*`):t}createDiacriticsRegExp(t){const e=this.opt.caseSensitive?"":"i",o=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"];let r=[];return t.split("").forEach((i=>{o.every((o=>{if(-1!==o.indexOf(i)){if(r.indexOf(o)>-1)return!1;t=t.replace(new RegExp(`[${o}]`,`gm${e}`),`[${o}]`),r.push(o)}return!0}))})),t}createMergedBlanksRegExp(t){return t.replace(/[\s]+/gim,"[\\s]+")}createAccuracyRegExp(t){let e=this.opt.accuracy,o="string"==typeof e?e:e.value,r="string"==typeof e?[]:e.limiters,i="";switch(r.forEach((t=>{i+=`|${this.escapeStr(t)}`})),o){case"partially":default:return`()(${t})`;case"complementary":return i="\\s"+(i||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")),`()([^${i}]*${t}[^${i}]*)`;case"exactly":return`(^|\\s${i})(${t})(?=$|\\s${i})`}}getSeparatedKeywords(t){let e=[];return t.forEach((t=>{this.opt.separateWordSearch?t.split(" ").forEach((t=>{t.trim()&&-1===e.indexOf(t)&&e.push(t)})):t.trim()&&-1===e.indexOf(t)&&e.push(t)})),{keywords:e.sort(((t,e)=>e.length-t.length)),length:e.length}}isNumeric(t){return Number(parseFloat(t))==t}checkRanges(t){if(!Array.isArray(t)||"[object Object]"!==Object.prototype.toString.call(t[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(t),[];const e=[];let o=0;return t.sort(((t,e)=>t.start-e.start)).forEach((t=>{let{start:r,end:i,valid:n}=this.callNoMatchOnInvalidRanges(t,o);n&&(t.start=r,t.length=i-r,e.push(t),o=i)})),e}callNoMatchOnInvalidRanges(t,e){let o,r,i=!1;return t&&void 0!==t.start?(o=parseInt(t.start,10),r=o+parseInt(t.length,10),this.isNumeric(t.start)&&this.isNumeric(t.length)&&r-e>0&&r-o>0?i=!0:(this.log(`Ignoring invalid or overlapping range: ${JSON.stringify(t)}`),this.opt.noMatch(t))):(this.log(`Ignoring invalid range: ${JSON.stringify(t)}`),this.opt.noMatch(t)),{start:o,end:r,valid:i}}checkWhitespaceRanges(t,e,o){let r,i=!0,n=o.length,a=e-n,l=parseInt(t.start,10)-a;return l=l>n?n:l,r=l+parseInt(t.length,10),r>n&&(r=n,this.log(`End range automatically set to the max value of ${n}`)),l<0||r-l<0||l>n||r>n?(i=!1,this.log(`Invalid range: ${JSON.stringify(t)}`),this.opt.noMatch(t)):""===o.substring(l,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(t)),this.opt.noMatch(t)),{start:l,end:r,valid:i}}getTextNodes(t){let e="",o=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,(t=>{o.push({start:e.length,end:(e+=t.textContent).length,node:t})}),(t=>this.matchesExclude(t.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT),(()=>{t({value:e,nodes:o})}))}matchesExclude(t){return Mi.matches(t,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(t,e,o){const r=this.opt.element?this.opt.element:"mark",i=t.splitText(e),n=i.splitText(o-e);let a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),n}wrapRangeInMappedTextNode(t,e,o,r,i){t.nodes.every(((n,a)=>{const l=t.nodes[a+1];if(void 0===l||l.start>e){if(!r(n.node))return!1;const l=e-n.start,s=(o>n.end?n.end:o)-n.start,c=t.value.substr(0,n.start),f=t.value.substr(s+n.start);if(n.node=this.wrapRangeInTextNode(n.node,l,s),t.value=c+f,t.nodes.forEach(((e,o)=>{o>=a&&(t.nodes[o].start>0&&o!==a&&(t.nodes[o].start-=s),t.nodes[o].end-=s)})),o-=s,i(n.node.previousSibling,n.start),!(o>n.end))return!1;e=n.end}return!0}))}wrapMatches(t,e,o,r,i){const n=0===e?0:e+1;this.getTextNodes((e=>{e.nodes.forEach((e=>{let i;for(e=e.node;null!==(i=t.exec(e.textContent))&&""!==i[n];){if(!o(i[n],e))continue;let a=i.index;if(0!==n)for(let t=1;t<n;t++)a+=i[t].length;e=this.wrapRangeInTextNode(e,a,a+i[n].length),r(e.previousSibling),t.lastIndex=0}})),i()}))}wrapMatchesAcrossElements(t,e,o,r,i){const n=0===e?0:e+1;this.getTextNodes((e=>{let a;for(;null!==(a=t.exec(e.value))&&""!==a[n];){let i=a.index;if(0!==n)for(let t=1;t<n;t++)i+=a[t].length;const l=i+a[n].length;this.wrapRangeInMappedTextNode(e,i,l,(t=>o(a[n],t)),((e,o)=>{t.lastIndex=o,r(e)}))}i()}))}wrapRangeFromIndex(t,e,o,r){this.getTextNodes((i=>{const n=i.value.length;t.forEach(((t,r)=>{let{start:a,end:l,valid:s}=this.checkWhitespaceRanges(t,n,i.value);s&&this.wrapRangeInMappedTextNode(i,a,l,(o=>e(o,t,i.value.substring(a,l),r)),(e=>{o(e,t)}))})),r()}))}unwrapMatches(t){const e=t.parentNode;let o=document.createDocumentFragment();for(;t.firstChild;)o.appendChild(t.removeChild(t.firstChild));e.replaceChild(o,t),this.ie?this.normalizeTextNode(e):e.normalize()}normalizeTextNode(t){if(t){if(3===t.nodeType)for(;t.nextSibling&&3===t.nextSibling.nodeType;)t.nodeValue+=t.nextSibling.nodeValue,t.parentNode.removeChild(t.nextSibling);else this.normalizeTextNode(t.firstChild);this.normalizeTextNode(t.nextSibling)}}markRegExp(t,e){this.opt=e,this.log(`Searching with expression "${t}"`);let o=0,r="wrapMatches";this.opt.acrossElements&&(r="wrapMatchesAcrossElements"),this[r](t,this.opt.ignoreGroups,((t,e)=>this.opt.filter(e,t,o)),(t=>{o++,this.opt.each(t)}),(()=>{0===o&&this.opt.noMatch(t),this.opt.done(o)}))}mark(t,e){this.opt=e;let o=0,r="wrapMatches";const{keywords:i,length:n}=this.getSeparatedKeywords("string"==typeof t?[t]:t),a=this.opt.caseSensitive?"":"i",l=t=>{let e=new RegExp(this.createRegExp(t),`gm${a}`),s=0;this.log(`Searching with expression "${e}"`),this[r](e,1,((e,r)=>this.opt.filter(r,t,o,s)),(t=>{s++,o++,this.opt.each(t)}),(()=>{0===s&&this.opt.noMatch(t),i[n-1]===t?this.opt.done(o):l(i[i.indexOf(t)+1])}))};this.opt.acrossElements&&(r="wrapMatchesAcrossElements"),0===n?this.opt.done(o):l(i[0])}markRanges(t,e){this.opt=e;let o=0,r=this.checkRanges(t);r&&r.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(r)),this.wrapRangeFromIndex(r,((t,e,o,r)=>this.opt.filter(t,e,o,r)),((t,e)=>{o++,this.opt.each(t,e)}),(()=>{this.opt.done(o)}))):this.opt.done(o)}unmark(t){this.opt=t;let e=this.opt.element?this.opt.element:"*";e+="[data-markjs]",this.opt.className&&(e+=`.${this.opt.className}`),this.log(`Removal selector "${e}"`),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,(t=>{this.unwrapMatches(t)}),(t=>{const o=Mi.matches(t,e),r=this.matchesExclude(t);return!o||r?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),this.opt.done)}}(t);return this.mark=(t,o)=>(e.mark(t,o),this),this.markRegExp=(t,o)=>(e.markRegExp(t,o),this),this.markRanges=(t,o)=>(e.markRanges(t,o),this),this.unmark=t=>(e.unmark(t),this),this},Ki=mo.create("--ft-utils-highlight-html-background-color","","COLOR","#FFF26E"),Di=pt`
141
+ */const Ri=window,ki=Ri.ShadowRoot&&(void 0===Ri.ShadyCSS||Ri.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;class Li extends be{createRenderRoot(){const t=this.constructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,Object.entries(t.elementDefinitions).forEach((([e,o])=>t.registry.define(e,o))));const e={...t.shadowRootOptions,customElements:t.registry},o=this.renderOptions.creationScope=this.attachShadow(e);return((t,e)=>{ki?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const o=document.createElement("style"),r=Ri.litNonce;void 0!==r&&o.setAttribute("nonce",r),o.textContent=e.cssText,t.appendChild(o)}))})(o,t.elementStyles),o}}var Wi,Ui=Object.freeze({__proto__:null,ScopedRegistryLitElement:Li}),zi=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Bi=Symbol("constructorPrototype"),Fi=Symbol("constructorName"),Ai=Symbol("exportpartsDebouncer");class ji extends Li{constructor(){super(),this.adoptedCustomStyleSheet=new CSSStyleSheet,this.useAdoptedStyleSheets=!0,this[Wi]=new no(5),this[Fi]=this.constructor.name,this[Bi]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Fi]&&Object.setPrototypeOf(this,this[Bi])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet])}catch(t){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",t)}}updated(t){super.updated(t),this.updateComplete.then((()=>{this.contentAvailableCallback(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate()}))}contentAvailableCallback(t){}applyCustomStylesheet(t){var e,o,r;if(this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync(null!==(e=this.customStylesheet)&&void 0!==e?e:"")}catch(t){console.error(t,this.customStylesheet)}}else if((null!==(r=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==r?r:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){var t,e,o;((null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())||null!==(o=null===(e=this.exportpartsPrefixes)||void 0===e?void 0:e.length)&&void 0!==o&&o)&&this[Ai].run((()=>{var t,e;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&(null===(e=this.exportpartsPrefixes)||void 0===e?void 0:e.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,o,r,i,n,a;const l=t=>null!=t&&t.trim().length>0,s=t.filter(l).map((t=>t.trim()));if(0===s.length)return void this.removeAttribute("exportparts");const c=new Set;for(let t of null!==(o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==o?o:[]){const e=null!==(i=null===(r=t.getAttribute("part"))||void 0===r?void 0:r.split(" "))&&void 0!==i?i:[],o=null!==(a=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==a?a:[];new Array(...e,...o).filter(l).map((t=>t.trim())).forEach((t=>c.add(t)))}if(0===c.size)return void this.removeAttribute("exportparts");const f=[...c.values()].flatMap((t=>s.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...f].join(", "))}}Wi=Ai,zi([we()],ji.prototype,"exportpartsPrefix",void 0),zi([uo([])],ji.prototype,"exportpartsPrefixes",void 0),zi([we()],ji.prototype,"customStylesheet",void 0);var _i=Object.freeze({__proto__:null,FtLitElement:ji}),Pi=Object.freeze({__proto__:null});class Mi{constructor(t,e=!0,o=[],r=5e3){this.ctx=t,this.iframes=e,this.exclude=o,this.iframesTimeout=r}static matches(t,e){const o="string"==typeof e?[e]:e,r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector;if(r){let e=!1;return o.every((o=>!r.call(t,o)||(e=!0,!1))),e}return!1}getContexts(){let t,e=[];return t=void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[],t.forEach((t=>{const o=e.filter((e=>e.contains(t))).length>0;-1!==e.indexOf(t)||o||e.push(t)})),e}getIframeContents(t,e,o=(()=>{})){let r;try{const e=t.contentWindow;if(r=e.document,!e||!r)throw new Error("iframe inaccessible")}catch(t){o()}r&&e(r)}isIframeBlank(t){const e="about:blank",o=t.getAttribute("src").trim();return t.contentWindow.location.href===e&&o!==e&&o}observeIframeLoad(t,e,o){let r=!1,i=null;const n=()=>{if(!r){r=!0,clearTimeout(i);try{this.isIframeBlank(t)||(t.removeEventListener("load",n),this.getIframeContents(t,e,o))}catch(t){o()}}};t.addEventListener("load",n),i=setTimeout(n,this.iframesTimeout)}onIframeReady(t,e,o){try{"complete"===t.contentWindow.document.readyState?this.isIframeBlank(t)?this.observeIframeLoad(t,e,o):this.getIframeContents(t,e,o):this.observeIframeLoad(t,e,o)}catch(t){o()}}waitForIframes(t,e){let o=0;this.forEachIframe(t,(()=>!0),(t=>{o++,this.waitForIframes(t.querySelector("html"),(()=>{--o||e()}))}),(t=>{t||e()}))}forEachIframe(t,e,o,r=(()=>{})){let i=t.querySelectorAll("iframe"),n=i.length,a=0;i=Array.prototype.slice.call(i);const l=()=>{--n<=0&&r(a)};n||l(),i.forEach((t=>{Mi.matches(t,this.exclude)?l():this.onIframeReady(t,(r=>{e(t)&&(a++,o(r)),l()}),l)}))}createIterator(t,e,o){return document.createNodeIterator(t,e,o,!1)}createInstanceOnIframe(t){return new Mi(t.querySelector("html"),this.iframes)}compareNodeIframe(t,e,o){if(t.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING){if(null===e)return!0;if(e.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}getIteratorNode(t){const e=t.previousNode();let o;return o=(null===e||t.nextNode())&&t.nextNode(),{prevNode:e,node:o}}checkIframeFilter(t,e,o,r){let i=!1,n=!1;return r.forEach(((t,e)=>{t.val===o&&(i=e,n=t.handled)})),this.compareNodeIframe(t,e,o)?(!1!==i||n?!1===i||n||(r[i].handled=!0):r.push({val:o,handled:!0}),!0):(!1===i&&r.push({val:o,handled:!1}),!1)}handleOpenIframes(t,e,o,r){t.forEach((t=>{t.handled||this.getIframeContents(t.val,(t=>{this.createInstanceOnIframe(t).forEachNode(e,o,r)}))}))}iterateThroughNodes(t,e,o,r,i){const n=this.createIterator(e,t,r);let a,l,s=[],c=[],f=()=>(({prevNode:l,node:a}=this.getIteratorNode(n)),a);for(;f();)this.iframes&&this.forEachIframe(e,(t=>this.checkIframeFilter(a,l,t,s)),(e=>{this.createInstanceOnIframe(e).forEachNode(t,(t=>c.push(t)),r)})),c.push(a);c.forEach((t=>{o(t)})),this.iframes&&this.handleOpenIframes(s,t,o,r),i()}forEachNode(t,e,o,r=(()=>{})){const i=this.getContexts();let n=i.length;n||r(),i.forEach((i=>{const a=()=>{this.iterateThroughNodes(t,i,e,o,(()=>{--n<=0&&r()}))};this.iframes?this.waitForIframes(i,a):a()}))}}const Zi=function(t){const e=new class{constructor(t){this.ctx=t,this.ie=!1;const e=window.navigator.userAgent;(e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1)&&(this.ie=!0)}set opt(t){this._opt=Object.assign({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:"disabled",each:()=>{},noMatch:()=>{},filter:()=>!0,done:()=>{},debug:!1,log:window.console},t)}get opt(){return this._opt}get iterator(){return new Mi(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(t,e="debug"){const o=this.opt.log;this.opt.debug&&"object"==typeof o&&"function"==typeof o[e]&&o[e](`mark.js: ${t}`)}escapeStr(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}createRegExp(t){return"disabled"!==this.opt.wildcards&&(t=this.setupWildcardsRegExp(t)),t=this.escapeStr(t),Object.keys(this.opt.synonyms).length&&(t=this.createSynonymsRegExp(t)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),this.opt.diacritics&&(t=this.createDiacriticsRegExp(t)),t=this.createMergedBlanksRegExp(t),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.createJoinersRegExp(t)),"disabled"!==this.opt.wildcards&&(t=this.createWildcardsRegExp(t)),this.createAccuracyRegExp(t)}createSynonymsRegExp(t){const e=this.opt.synonyms,o=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let i in e)if(e.hasOwnProperty(i)){const n=e[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),l="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(n):this.escapeStr(n);""!==a&&""!==l&&(t=t.replace(new RegExp(`(${this.escapeStr(a)}|${this.escapeStr(l)})`,`gm${o}`),r+`(${this.processSynomyms(a)}|`+`${this.processSynomyms(l)})`+r))}return t}processSynomyms(t){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(t=this.setupIgnoreJoinersRegExp(t)),t}setupWildcardsRegExp(t){return(t=t.replace(/(?:\\)*\?/g,(t=>"\\"===t.charAt(0)?"?":""))).replace(/(?:\\)*\*/g,(t=>"\\"===t.charAt(0)?"*":""))}createWildcardsRegExp(t){let e="withSpaces"===this.opt.wildcards;return t.replace(/\u0001/g,e?"[\\S\\s]?":"\\S?").replace(/\u0002/g,e?"[\\S\\s]*?":"\\S*")}setupIgnoreJoinersRegExp(t){return t.replace(/[^(|)\\]/g,((t,e,o)=>{let r=o.charAt(e+1);return/[(|)\\]/.test(r)||""===r?t:t+"\0"}))}createJoinersRegExp(t){let e=[];const o=this.opt.ignorePunctuation;return Array.isArray(o)&&o.length&&e.push(this.escapeStr(o.join(""))),this.opt.ignoreJoiners&&e.push("\\u00ad\\u200b\\u200c\\u200d"),e.length?t.split(/\u0000+/).join(`[${e.join("")}]*`):t}createDiacriticsRegExp(t){const e=this.opt.caseSensitive?"":"i",o=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"];let r=[];return t.split("").forEach((i=>{o.every((o=>{if(-1!==o.indexOf(i)){if(r.indexOf(o)>-1)return!1;t=t.replace(new RegExp(`[${o}]`,`gm${e}`),`[${o}]`),r.push(o)}return!0}))})),t}createMergedBlanksRegExp(t){return t.replace(/[\s]+/gim,"[\\s]+")}createAccuracyRegExp(t){let e=this.opt.accuracy,o="string"==typeof e?e:e.value,r="string"==typeof e?[]:e.limiters,i="";switch(r.forEach((t=>{i+=`|${this.escapeStr(t)}`})),o){case"partially":default:return`()(${t})`;case"complementary":return i="\\s"+(i||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")),`()([^${i}]*${t}[^${i}]*)`;case"exactly":return`(^|\\s${i})(${t})(?=$|\\s${i})`}}getSeparatedKeywords(t){let e=[];return t.forEach((t=>{this.opt.separateWordSearch?t.split(" ").forEach((t=>{t.trim()&&-1===e.indexOf(t)&&e.push(t)})):t.trim()&&-1===e.indexOf(t)&&e.push(t)})),{keywords:e.sort(((t,e)=>e.length-t.length)),length:e.length}}isNumeric(t){return Number(parseFloat(t))==t}checkRanges(t){if(!Array.isArray(t)||"[object Object]"!==Object.prototype.toString.call(t[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(t),[];const e=[];let o=0;return t.sort(((t,e)=>t.start-e.start)).forEach((t=>{let{start:r,end:i,valid:n}=this.callNoMatchOnInvalidRanges(t,o);n&&(t.start=r,t.length=i-r,e.push(t),o=i)})),e}callNoMatchOnInvalidRanges(t,e){let o,r,i=!1;return t&&void 0!==t.start?(o=parseInt(t.start,10),r=o+parseInt(t.length,10),this.isNumeric(t.start)&&this.isNumeric(t.length)&&r-e>0&&r-o>0?i=!0:(this.log(`Ignoring invalid or overlapping range: ${JSON.stringify(t)}`),this.opt.noMatch(t))):(this.log(`Ignoring invalid range: ${JSON.stringify(t)}`),this.opt.noMatch(t)),{start:o,end:r,valid:i}}checkWhitespaceRanges(t,e,o){let r,i=!0,n=o.length,a=e-n,l=parseInt(t.start,10)-a;return l=l>n?n:l,r=l+parseInt(t.length,10),r>n&&(r=n,this.log(`End range automatically set to the max value of ${n}`)),l<0||r-l<0||l>n||r>n?(i=!1,this.log(`Invalid range: ${JSON.stringify(t)}`),this.opt.noMatch(t)):""===o.substring(l,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(t)),this.opt.noMatch(t)),{start:l,end:r,valid:i}}getTextNodes(t){let e="",o=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,(t=>{o.push({start:e.length,end:(e+=t.textContent).length,node:t})}),(t=>this.matchesExclude(t.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT),(()=>{t({value:e,nodes:o})}))}matchesExclude(t){return Mi.matches(t,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(t,e,o){const r=this.opt.element?this.opt.element:"mark",i=t.splitText(e),n=i.splitText(o-e);let a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),n}wrapRangeInMappedTextNode(t,e,o,r,i){t.nodes.every(((n,a)=>{const l=t.nodes[a+1];if(void 0===l||l.start>e){if(!r(n.node))return!1;const l=e-n.start,s=(o>n.end?n.end:o)-n.start,c=t.value.substr(0,n.start),f=t.value.substr(s+n.start);if(n.node=this.wrapRangeInTextNode(n.node,l,s),t.value=c+f,t.nodes.forEach(((e,o)=>{o>=a&&(t.nodes[o].start>0&&o!==a&&(t.nodes[o].start-=s),t.nodes[o].end-=s)})),o-=s,i(n.node.previousSibling,n.start),!(o>n.end))return!1;e=n.end}return!0}))}wrapMatches(t,e,o,r,i){const n=0===e?0:e+1;this.getTextNodes((e=>{e.nodes.forEach((e=>{let i;for(e=e.node;null!==(i=t.exec(e.textContent))&&""!==i[n];){if(!o(i[n],e))continue;let a=i.index;if(0!==n)for(let t=1;t<n;t++)a+=i[t].length;e=this.wrapRangeInTextNode(e,a,a+i[n].length),r(e.previousSibling),t.lastIndex=0}})),i()}))}wrapMatchesAcrossElements(t,e,o,r,i){const n=0===e?0:e+1;this.getTextNodes((e=>{let a;for(;null!==(a=t.exec(e.value))&&""!==a[n];){let i=a.index;if(0!==n)for(let t=1;t<n;t++)i+=a[t].length;const l=i+a[n].length;this.wrapRangeInMappedTextNode(e,i,l,(t=>o(a[n],t)),((e,o)=>{t.lastIndex=o,r(e)}))}i()}))}wrapRangeFromIndex(t,e,o,r){this.getTextNodes((i=>{const n=i.value.length;t.forEach(((t,r)=>{let{start:a,end:l,valid:s}=this.checkWhitespaceRanges(t,n,i.value);s&&this.wrapRangeInMappedTextNode(i,a,l,(o=>e(o,t,i.value.substring(a,l),r)),(e=>{o(e,t)}))})),r()}))}unwrapMatches(t){const e=t.parentNode;let o=document.createDocumentFragment();for(;t.firstChild;)o.appendChild(t.removeChild(t.firstChild));e.replaceChild(o,t),this.ie?this.normalizeTextNode(e):e.normalize()}normalizeTextNode(t){if(t){if(3===t.nodeType)for(;t.nextSibling&&3===t.nextSibling.nodeType;)t.nodeValue+=t.nextSibling.nodeValue,t.parentNode.removeChild(t.nextSibling);else this.normalizeTextNode(t.firstChild);this.normalizeTextNode(t.nextSibling)}}markRegExp(t,e){this.opt=e,this.log(`Searching with expression "${t}"`);let o=0,r="wrapMatches";this.opt.acrossElements&&(r="wrapMatchesAcrossElements"),this[r](t,this.opt.ignoreGroups,((t,e)=>this.opt.filter(e,t,o)),(t=>{o++,this.opt.each(t)}),(()=>{0===o&&this.opt.noMatch(t),this.opt.done(o)}))}mark(t,e){this.opt=e;let o=0,r="wrapMatches";const{keywords:i,length:n}=this.getSeparatedKeywords("string"==typeof t?[t]:t),a=this.opt.caseSensitive?"":"i",l=t=>{let e=new RegExp(this.createRegExp(t),`gm${a}`),s=0;this.log(`Searching with expression "${e}"`),this[r](e,1,((e,r)=>this.opt.filter(r,t,o,s)),(t=>{s++,o++,this.opt.each(t)}),(()=>{0===s&&this.opt.noMatch(t),i[n-1]===t?this.opt.done(o):l(i[i.indexOf(t)+1])}))};this.opt.acrossElements&&(r="wrapMatchesAcrossElements"),0===n?this.opt.done(o):l(i[0])}markRanges(t,e){this.opt=e;let o=0,r=this.checkRanges(t);r&&r.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(r)),this.wrapRangeFromIndex(r,((t,e,o,r)=>this.opt.filter(t,e,o,r)),((t,e)=>{o++,this.opt.each(t,e)}),(()=>{this.opt.done(o)}))):this.opt.done(o)}unmark(t){this.opt=t;let e=this.opt.element?this.opt.element:"*";e+="[data-markjs]",this.opt.className&&(e+=`.${this.opt.className}`),this.log(`Removal selector "${e}"`),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,(t=>{this.unwrapMatches(t)}),(t=>{const o=Mi.matches(t,e),r=this.matchesExclude(t);return!o||r?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),this.opt.done)}}(t);return this.mark=(t,o)=>(e.mark(t,o),this),this.markRegExp=(t,o)=>(e.markRegExp(t,o),this),this.markRanges=(t,o)=>(e.markRanges(t,o),this),this.unmark=t=>(e.unmark(t),this),this},Ki=mo.create("--ft-utils-highlight-html-background-color","","COLOR","#FFF26E"),Di=pt`
142
142
  .highlight-html-match {
143
143
  background: ${Ki};
144
144
  }
@@ -1035,7 +1035,7 @@ function(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=${r}
1035
1035
  ${vo(sc.iconSize,Mc.iconFontSize)};
1036
1036
  }
1037
1037
 
1038
- .ft-reader-toc--leaf-node-icon {
1038
+ [part="leaf-node-icon"] {
1039
1039
  color: ${Mc.leafNodeIconColor};
1040
1040
  }
1041
1041
 
@@ -1149,4 +1149,4 @@ function(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=${r}
1149
1149
  `:te}
1150
1150
  </div>
1151
1151
  `}buildAutomaticallyExpandedNodes(t){var e,o;let r=new Set(this.autoCollapse?[]:this.automaticallyExpandedNodes);for(let i of t){let t=i;for(;t&&!r.has(t);)r.add(t),this.manuallyCollapsedNodes.delete(t),t=null===(o=null===(e=this.service)||void 0===e?void 0:e.getTocNodeNow(t))||void 0===o?void 0:o.parentTocId}return r}manuallyToggle(t,e){e?(this.manuallyCollapsedNodes.add(t),this.manuallyExpandedNodes.delete(t)):(this.manuallyExpandedNodes.add(t),this.manuallyCollapsedNodes.delete(t)),this.requestUpdate()}onViewportSizeChange(t){this.viewportSize=t.detail.category}toggleExpandCollapseAll(){this.expandAll=!this.expandAll,this.automaticallyExpandedNodes=new Set,this.manuallyExpandedNodes=new Set,this.manuallyCollapsedNodes=new Set}getExpandCollapseAllTooltipPosition(){switch(this.expandCollapseAllAlignment){case"right":return"left";case"left":return"right";default:return"bottom"}}getLeafNodeIcon(){return Jt`
1152
- <ft-icon class="ft-reader-toc--leaf-node-icon" .variant="${this.leafNodeIconVariant}" .value="${this.leafNodeIcon}"></ft-icon>`}}Dc.elementDefinitions={"ft-button":Lc,"ft-icon":qs,"ft-reader-internal-link":Ds,"ft-size-watcher":_c,"ft-typography":js},Dc.styles=Zc,Kc([we({type:Boolean})],Dc.prototype,"expanded",void 0),Kc([we()],Dc.prototype,"iconVariant",void 0),Kc([we()],Dc.prototype,"collapseIcon",void 0),Kc([we()],Dc.prototype,"expandIcon",void 0),Kc([we()],Dc.prototype,"leafNodeIconVariant",void 0),Kc([we()],Dc.prototype,"leafNodeIcon",void 0),Kc([we({type:Boolean})],Dc.prototype,"expandCollapseAll",void 0),Kc([we({type:Boolean})],Dc.prototype,"expandCollapseAllHideLabel",void 0),Kc([we({type:Boolean})],Dc.prototype,"expandCollapseAllTrailingIcon",void 0),Kc([we()],Dc.prototype,"expandCollapseAllAlignment",void 0),Kc([we({type:Boolean})],Dc.prototype,"expandCollapseAllHideIcon",void 0),Kc([we()],Dc.prototype,"expandCollapseAllIconVariant",void 0),Kc([we()],Dc.prototype,"collapseAllIcon",void 0),Kc([we()],Dc.prototype,"expandAllIcon",void 0),Kc([we({type:Boolean})],Dc.prototype,"autoCollapse",void 0),Kc([we()],Dc.prototype,"scope",void 0),Kc([we({type:Boolean,reflect:!0})],Dc.prototype,"empty",void 0),Kc([uo({})],Dc.prototype,"labels",void 0),Kc([tn({selector:(t,e)=>{var o,r,i;return e.isCurrentPageToc?(null===(o=t.paginationConfiguration)||void 0===o?void 0:o.splitCurrentPageToc)?null===(r=t.currentPage)||void 0===r?void 0:r.toc:void 0:(null===(i=t.paginationConfiguration)||void 0===i?void 0:i.splitCurrentPageToc)?t.pagesToc:t.toc}})],Dc.prototype,"toc",void 0),Kc([tn()],Dc.prototype,"currentPage",void 0),Kc([tn({selector:(t,e)=>{var o,r;return(null===(o=t.paginationConfiguration)||void 0===o?void 0:o.splitCurrentPageToc)&&!e.isCurrentPageToc?[null===(r=t.currentPage)||void 0===r?void 0:r.rootTocId]:t.visibleTopics}})],Dc.prototype,"highlightedTocIds",void 0),Kc([Se({hasChanged:(t,e)=>!fo(t,e)})],Dc.prototype,"automaticallyExpandedNodes",void 0),Kc([Se({hasChanged:(t,e)=>!fo(t,e)})],Dc.prototype,"manuallyExpandedNodes",void 0),Kc([Se({hasChanged:(t,e)=>!fo(t,e)})],Dc.prototype,"manuallyCollapsedNodes",void 0),Kc([Se()],Dc.prototype,"expandAll",void 0),Kc([Se()],Dc.prototype,"viewportSize",void 0),ho("ft-reader-toc")(Dc),t.DEFAULT_LABELS=Pc,t.FtReaderToc=Dc,t.FtReaderTocCssVariables=Mc,t.styles=Zc}({});
1152
+ <ft-icon class="ft-reader-toc--leaf-node-icon" part="leaf-node-icon" .variant="${this.leafNodeIconVariant}" .value="${this.leafNodeIcon}"></ft-icon>`}}Dc.elementDefinitions={"ft-button":Lc,"ft-icon":qs,"ft-reader-internal-link":Ds,"ft-size-watcher":_c,"ft-typography":js},Dc.styles=Zc,Kc([we({type:Boolean})],Dc.prototype,"expanded",void 0),Kc([we()],Dc.prototype,"iconVariant",void 0),Kc([we()],Dc.prototype,"collapseIcon",void 0),Kc([we()],Dc.prototype,"expandIcon",void 0),Kc([we()],Dc.prototype,"leafNodeIconVariant",void 0),Kc([we()],Dc.prototype,"leafNodeIcon",void 0),Kc([we({type:Boolean})],Dc.prototype,"expandCollapseAll",void 0),Kc([we({type:Boolean})],Dc.prototype,"expandCollapseAllHideLabel",void 0),Kc([we({type:Boolean})],Dc.prototype,"expandCollapseAllTrailingIcon",void 0),Kc([we()],Dc.prototype,"expandCollapseAllAlignment",void 0),Kc([we({type:Boolean})],Dc.prototype,"expandCollapseAllHideIcon",void 0),Kc([we()],Dc.prototype,"expandCollapseAllIconVariant",void 0),Kc([we()],Dc.prototype,"collapseAllIcon",void 0),Kc([we()],Dc.prototype,"expandAllIcon",void 0),Kc([we({type:Boolean})],Dc.prototype,"autoCollapse",void 0),Kc([we()],Dc.prototype,"scope",void 0),Kc([we({type:Boolean,reflect:!0})],Dc.prototype,"empty",void 0),Kc([uo({})],Dc.prototype,"labels",void 0),Kc([tn({selector:(t,e)=>{var o,r,i;return e.isCurrentPageToc?(null===(o=t.paginationConfiguration)||void 0===o?void 0:o.splitCurrentPageToc)?null===(r=t.currentPage)||void 0===r?void 0:r.toc:void 0:(null===(i=t.paginationConfiguration)||void 0===i?void 0:i.splitCurrentPageToc)?t.pagesToc:t.toc}})],Dc.prototype,"toc",void 0),Kc([tn()],Dc.prototype,"currentPage",void 0),Kc([tn({selector:(t,e)=>{var o,r;return(null===(o=t.paginationConfiguration)||void 0===o?void 0:o.splitCurrentPageToc)&&!e.isCurrentPageToc?[null===(r=t.currentPage)||void 0===r?void 0:r.rootTocId]:t.visibleTopics}})],Dc.prototype,"highlightedTocIds",void 0),Kc([Se({hasChanged:(t,e)=>!fo(t,e)})],Dc.prototype,"automaticallyExpandedNodes",void 0),Kc([Se({hasChanged:(t,e)=>!fo(t,e)})],Dc.prototype,"manuallyExpandedNodes",void 0),Kc([Se({hasChanged:(t,e)=>!fo(t,e)})],Dc.prototype,"manuallyCollapsedNodes",void 0),Kc([Se()],Dc.prototype,"expandAll",void 0),Kc([Se()],Dc.prototype,"viewportSize",void 0),ho("ft-reader-toc")(Dc),t.DEFAULT_LABELS=Pc,t.FtReaderToc=Dc,t.FtReaderTocCssVariables=Mc,t.styles=Zc}({});
@@ -44,7 +44,7 @@ export const styles = css `
44
44
  ${setVariable(FtButtonCssVariables.iconSize, FtReaderTocCssVariables.iconFontSize)};
45
45
  }
46
46
 
47
- .ft-reader-toc--leaf-node-icon {
47
+ [part="leaf-node-icon"] {
48
48
  color: ${FtReaderTocCssVariables.leafNodeIconColor};
49
49
  }
50
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-toc",
3
- "version": "1.1.52",
3
+ "version": "1.1.53",
4
4
  "description": "Main table of content for integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-icon": "1.1.52",
23
- "@fluid-topics/ft-reader-context": "1.1.52",
24
- "@fluid-topics/ft-size-watcher": "1.1.52",
25
- "@fluid-topics/ft-typography": "1.1.52",
26
- "@fluid-topics/ft-wc-utils": "1.1.52",
22
+ "@fluid-topics/ft-icon": "1.1.53",
23
+ "@fluid-topics/ft-reader-context": "1.1.53",
24
+ "@fluid-topics/ft-size-watcher": "1.1.53",
25
+ "@fluid-topics/ft-typography": "1.1.53",
26
+ "@fluid-topics/ft-wc-utils": "1.1.53",
27
27
  "lit": "3.1.0"
28
28
  },
29
- "gitHead": "8b2c90df3e7d82be373f6e963272a37ebf57b017"
29
+ "gitHead": "9533374bb075edb940b4426a00561f27c34d2f01"
30
30
  }