@diplodoc/transform 4.70.3 → 4.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/_yfm-only.css +4 -4
- package/dist/css/_yfm-only.css.map +3 -3
- package/dist/css/_yfm-only.min.css +1 -1
- package/dist/css/_yfm-only.min.css.map +3 -3
- package/dist/css/base.css +1 -0
- package/dist/css/base.css.map +3 -3
- package/dist/css/base.min.css +1 -1
- package/dist/css/base.min.css.map +3 -3
- package/dist/css/print.css.map +1 -1
- package/dist/css/yfm.css +6 -4
- package/dist/css/yfm.css.map +3 -3
- package/dist/css/yfm.min.css +1 -1
- package/dist/css/yfm.min.css.map +3 -3
- package/dist/js/base.js +396 -215
- package/dist/js/base.js.map +4 -4
- package/dist/js/base.min.js +1 -6
- package/dist/js/base.min.js.map +4 -4
- package/dist/js/yfm.js +429 -228
- package/dist/js/yfm.js.map +4 -4
- package/dist/js/yfm.min.js +1 -6
- package/dist/js/yfm.min.js.map +4 -4
- package/dist/scss/_common.scss +1 -0
- package/dist/scss/_modal.scss +1 -0
- package/dist/scss/{_inline-code.scss → _tooltip.scss} +1 -1
- package/dist/scss/_yfm-only.scss +1 -1
- package/lib/plugins/anchors/index.js +1 -1
- package/lib/plugins/anchors/index.js.map +1 -1
- package/package.json +1 -1
- package/src/js/anchor.ts +27 -3
- package/src/js/{inline-code/constant.ts → constant.ts} +1 -9
- package/src/js/inline-code/index.ts +24 -42
- package/src/js/tooltip/constant.ts +25 -0
- package/src/js/tooltip/index.ts +2 -0
- package/src/js/tooltip/tooltip.ts +263 -0
- package/src/js/tooltip/types.ts +59 -0
- package/src/js/tooltip/utils.ts +247 -0
- package/src/scss/_common.scss +1 -0
- package/src/scss/_modal.scss +1 -0
- package/src/scss/{_inline-code.scss → _tooltip.scss} +1 -1
- package/src/scss/_yfm-only.scss +1 -1
- package/src/transform/plugins/anchors/index.ts +1 -1
- package/src/js/inline-code/utils.ts +0 -217
package/dist/js/yfm.min.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
"use strict";(()=>{(()=>{var he=Object.create,X=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,oe=Object.getOwnPropertyNames,ve=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,ye=(e,t,n)=>t in e?X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Te=(e,t)=>function(){return t||(0,e[oe(e)[0]])((t={exports:{}}).exports,t),t.exports},Le=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of oe(t))!be.call(e,l)&&l!==n&&X(e,l,{get:()=>t[l],enumerable:!(s=ge(t,l))||s.enumerable});return e},we=(e,t,n)=>(n=e!=null?he(ve(e)):{},Le(t||!e||!e.__esModule?X(n,"default",{value:e,enumerable:!0}):n,e)),Ee=(e,t,n)=>ye(e,typeof t!="symbol"?t+"":t,n),Ae=Te({"node_modules/get-root-node-polyfill/index.js"(e,t){"use strict";function n(c){var h=typeof c=="object"&&!!c.composed;return h?s(this):l(this)}function s(c){var h=l(c);return d(h)?s(h.host):h}function l(c){return c.parentNode!=null?l(c.parentNode):c}function d(c){return c.nodeName==="#document-fragment"&&c.constructor.name==="ShadowRoot"}typeof t=="object"&&t.exports&&(t.exports=n)}});(()=>{var e="yfm_cut",t={Cut:"yfm-cut",Title:"yfm-cut-title",Content:"yfm-cut-content",Highlight:"yfm-cut-highlight"},n=class{constructor(){Ee(this,"disposers",[]),this.disposers.push(this.init())}init(){let d=!1,c=()=>{d=!0},h=()=>{d=!1},v=L=>{l(L.target)&&!d&&this.focusActiveCut(L.target)};return document.addEventListener("mousedown",c),document.addEventListener("mouseup",h),document.addEventListener("focus",v,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",h),document.removeEventListener("focus",v,!0)}}dispose(){for(let d of this.disposers)d()}focusActiveCut(d){let c=d.parentNode;if(!s(c))return;let h=c;for(;h;)s(h)&&(h.open=!0),h=h.parentElement;setTimeout(()=>{c.classList.add(t.Highlight)},70),setTimeout(()=>{c.classList.remove(t.Highlight)},1e3)}};function s(d){var c;return((c=d==null?void 0:d.tagName)==null?void 0:c.toLowerCase())==="details"&&(d==null?void 0:d.classList.contains(t.Cut))}function l(d){var c;return((c=d==null?void 0:d.tagName)==null?void 0:c.toLowerCase())==="summary"&&(d==null?void 0:d.classList.contains(t.Title))}typeof window<"u"&&!window[e]&&(window[e]=new n)})(),(()=>{var e="yfm-tabs",t="yfm-tab",n="yfm-tab-panel",s="yfm-tab-list",l="active",d="data-diplodoc-group",c="data-diplodoc-key",h="data-diplodoc-variant",v="data-diplodoc-id",L="defaultTabsGroup-",C="data-diplodoc-forced",D="yfm-tabs-dropdown-select",B="yfm-tabs-vertical",O=(o=>(o.Regular="regular",o.Radio="radio",o.Dropdown="dropdown",o.Accordion="accordion",o))(O||{}),w=Symbol.for("diplodocTabs"),E=o=>{let i=o.composedPath();return Array.isArray(i)&&i.length>0?i[0]:o.target},I=o=>{let i=E(o);return!i||!i.matches},k=o=>Math.abs(o.scrollHeight-o.clientHeight)>1?o:o.parentElement?k(o.parentElement):void 0,R=(o,i)=>{let r=o.getBoundingClientRect(),a=i.getBoundingClientRect();return{top:r.top-a.top,left:r.left-a.left,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft}},b={TABS:`.${e}`,TAB_LIST:`.${s}`,TAB:`.${t}`,TAB_PANEL:`.${n}`,VERTICAL_TABS:`.${B}`},$=class{constructor(o,i={}){this._onSelectTabHandlers=new Set,this._currentPageTabGroups=[],this._isRestoringTabs=!1,this._document=o,this._options=Object.assign({saveTabsToLocalStorage:!1,saveTabsToQueryStateMode:"none"},i),this._document.addEventListener("click",r=>{let a=E(r);if(r.target&&this.hideAllDropdown(r.target),I(r))return;if(this.isElementDropdownSelect(a)){a.classList.toggle(l);return}if(!this.isValidTabElement(a))return;let u=this.getTabDataFromHTMLElement(a);u&&this._selectTab(u,a)}),this._document.addEventListener("keydown",r=>{let a=null;switch(r.key){case"ArrowLeft":{a="left";break}case"ArrowRight":{a="right";break}case"ArrowUp":{a="left";break}case"ArrowDown":{a="right";break}}if(!a)return;let u=E(r);if(I(r)||!this.isValidTabElement(u))return;let{tabs:f,nodes:m}=this.getTabs(u),p=this.getTabDataFromHTMLElement(u),g=f.findIndex(({key:T})=>(p==null?void 0:p.key)&&T===p.key);if(!p||f.length<=1||g===-1)return;let y=(g+(a==="left"?-1:1)+f.length)%f.length;this.selectTab(f[y]),m[y].focus()})}configure(o){this._options=Object.assign(this._options,o)}onSelectTab(o){return this._onSelectTabHandlers.add(o),()=>{this._onSelectTabHandlers.delete(o)}}selectTabById(o,i){let r=this._document.querySelector(`${b.TAB}[${v}="${o}"]`);if(!r||!this.isValidTabElement(r))return;let a=this.getTabDataFromHTMLElement(r);a&&this._selectTab(a,r),i!=null&&i.scrollToElement&&r.scrollIntoView()}selectTab(o){this._selectTab(o)}restoreTabs(o){this._isRestoringTabs=!0;try{for(let[i,r]of Object.entries(o))if(i){let a={group:i,...r};this.selectTab(a)}}finally{this._isRestoringTabs=!1}}getTabsFromLocalStorage(){return JSON.parse(localStorage.getItem("tabsHistory")||"{}")}getTabsFromSearchQuery(){let o={},i=new URLSearchParams(window.location.search);return i.has("tabs")&&(i.get("tabs")||"").split(",").forEach(r=>{let a=r.split("_"),[u,f]=a,m="regular";if(a.length===3&&(m=a[2]),u&&f&&Object.values(O).includes(m)){let p=f;o[u]={key:p,variant:m}}}),o}updateLocalStorageWithTabs(o){this._options.saveTabsToLocalStorage&&(this._isRestoringTabs||localStorage.setItem("tabsHistory",JSON.stringify(o)))}updateQueryParamWithTabs(o){if(this._isRestoringTabs)return;let i=new URLSearchParams(window.location.search),r=Object.entries(o).map(([f,{key:m,variant:p}])=>p==="regular"?`${f}_${m}`:`${f}_${m}_${p}`);r.length>0?i.set("tabs",r.join(",")):i.delete("tabs");let a=history.state||{},u=new URL(window.location.href);u.search=i.toString(),window.history.replaceState({...a},document.title,u.href)}getCurrentPageTabHistory(o){return Object.fromEntries(Object.entries(o).filter(([i])=>this._currentPageTabGroups.includes(i)))}onPageChanged(){this._currentPageTabGroups=this.getCurrentPageTabGroups()}getCurrentPageTabGroups(){let o=this._document.getElementsByClassName(e),i=new Set;return Array.from(o).forEach(r=>{let a=r.getAttribute(d);a&&i.add(a)}),Array.from(i)}clearTabsPreferred(){localStorage.removeItem("tabsHistory"),this.updateQueryParamWithTabs({})}_selectTab(o,i){let{group:r,key:a,variant:u}=o;if(!r)return;this.saveTabPreferred({group:r,key:a,variant:u});let f=i&&k(i),m=f&&R(i,f);this.updateHTML({group:r,key:a,variant:u},i,u)>0&&(this.fireSelectTabEvent({group:r,key:a,variant:u},i==null?void 0:i.dataset.diplodocId),m&&this.resetScroll(i,f,m))}updateHTML(o,i,r){switch(r){case"radio":return this.updateHTMLRadio(o,i);case"accordion":return this.updateHTMLAccordion(o,i);case"regular":return this.updateHTMLRegular(o);case"dropdown":return this.updateHTMLDropdown(o);default:return 0}}saveTabPreferred(o){let i={};switch(this._options.saveTabsToLocalStorage&&(i=JSON.parse(localStorage.getItem("tabsHistory")||"{}")),i[o.group]={key:o.key,variant:o.variant},this._options.saveTabsToLocalStorage&&this.updateLocalStorageWithTabs(i),this._options.saveTabsToQueryStateMode){case"all":{this.updateQueryParamWithTabs(i);break}case"page":{this.updateQueryParamWithTabs(this.getCurrentPageTabHistory(i));break}}}updateHTMLRadio(o,i){let{group:r,key:a}=o,{isForced:u,root:f}=this.didTabOpenForce(i),m=u?`.yfm-vertical-tab[${C}="true"]`:"",p=this._document.querySelectorAll(`${b.TABS}[${d}="${r}"] ${b.TAB}[${c}="${a}"]${m}`);u&&(f==null||f.removeAttribute(C));let g=0;return p.forEach(y=>{let T=y.parentNode.children;for(let _=0;_<T.length;_+=2){let[S,A]=[T.item(_),T.item(_+1)],P=S.children.item(0);if(S===y){P.checked?(S.classList.remove("active"),A==null||A.classList.remove("active"),P.removeAttribute("checked")):(S.classList.add("active"),A==null||A.classList.add("active"),P.setAttribute("checked","true"));continue}P.hasAttribute("checked")&&(S.classList.remove("active"),A==null||A.classList.remove("active"),P.removeAttribute("checked")),g++}}),g}updateHTMLRegular(o){let{group:i,key:r}=o,a=this._document.querySelectorAll(`${b.TABS}[${d}="${i}"] ${b.TAB}[${c}="${r}"]`),u=0;return a.forEach(f=>{let m=f;if(!this.isValidTabElement(m)||m.dataset.diplodocIsActive==="true")return;u++;let p=f,g=p.parentNode,y=g==null?void 0:g.parentNode,T=Array.from((g==null?void 0:g.querySelectorAll(b.TAB))||[]),_=Array.from((y==null?void 0:y.children)||[]).filter(A=>A.classList.contains(n)),S=T.indexOf(p);T.forEach((A,P)=>{let Ue=_[P],W=P===S,Qe=A;Qe.dataset.diplodocIsActive=W?"true":"false",A.classList.toggle(l,W),A.setAttribute("aria-selected",W.toString()),A.setAttribute("tabindex",W?"0":"-1"),Ue.classList.toggle(l,W)})}),u}updateHTMLDropdown(o){let{group:i,key:r}=o,a=this._document.querySelectorAll(`${b.TABS}[${d}="${i}"] ${b.TAB}[${c}="${r}"]`),u=0;return a.forEach(f=>{let m=f.closest(`[${h}=dropdown]`);if(!(m!=null&&m.children))return;let p=m.children.item(0),g=m.children.item(1);p==null||p.classList.remove(l);let y=Array.from((g==null?void 0:g.children)||[]).indexOf(f)+2;for(let T=2;T<m.children.length;T++){let _=m.children.item(T),S=g==null?void 0:g.children.item(T-2);if(u++,y===T){_==null||_.classList.add(l),S.classList.add(l),p.innerHTML=f.innerHTML,p.classList.add("filled");continue}S.classList.remove(l),_.classList.remove(l)}}),u}updateHTMLAccordion(o,i){let{group:r,key:a}=o,u=this._document.querySelectorAll(`${b.TABS}[${d}="${r}"] ${b.TAB}[${c}="${a}"]`),f=0;return u.forEach(m=>{let p=m.closest(`[${h}=accordion]`);if(p!=null&&p.children)for(let g=0;g<p.children.length;g+=2){let y=p.children.item(g),T=p.children.item(g+1);if(f++,m===y){y==null||y.classList.toggle(l),T==null||T.classList.toggle(l);continue}y==null||y.classList.remove(l),T==null||T.classList.remove(l)}}),i&&!this.checkVisible(i)&&setTimeout(()=>{i.scrollIntoView({block:"nearest"})}),f}checkVisible(o){let i=o.getBoundingClientRect(),r=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(i.bottom<0||i.top-r>=0)}hideAllDropdown(o){this._document.querySelectorAll(".yfm-tabs-dropdown-select.active").forEach(i=>{i.contains(o)||i.classList.remove(l)})}resetScroll(o,i,r){let a=R(o,i),u=a.top-r.top,f=a.left-r.left,m=a.scrollTop-r.scrollTop,p=a.scrollLeft-r.scrollLeft;i.scrollTo(i.scrollLeft+f-p,i.scrollTop+u-m)}didTabOpenForce(o){if(!o)return{};if(o.dataset.diplodocForced)return{root:o,isForced:!0};let i=o.dataset.diplodocVerticalTab?o:o.parentElement,r=typeof(i==null?void 0:i.dataset.diplodocForced)!="undefined";return{root:i,isForced:r}}fireSelectTabEvent(o,i){let{group:r,key:a,variant:u}=o,f=r.startsWith(L)?{key:a,variant:u}:o;this._onSelectTabHandlers.forEach(m=>{m({tab:f,currentTabId:i})})}getTabsType(o){let i=o.closest(`[${h}]`);if(i)return i.dataset.diplodocVariant}isValidTabElement(o){return!!this.getTabsType(o)}isElementDropdownSelect(o){return o.classList.contains(D)}getTabDataFromHTMLElement(o){var i,r,a;let u=this.getTabsType(o);if(u==="radio"){let p=o.dataset.diplodocVerticalTab?o:o.parentElement,g=p.dataset.diplodocKey,y=(i=p.closest(b.TABS))==null?void 0:i.dataset.diplodocGroup;return g&&y?{group:y,key:g,variant:"radio"}:null}if(u==="dropdown"||u==="accordion"){let p=o.dataset.diplodocKey,g=(r=o.closest(b.TABS))==null?void 0:r.dataset.diplodocGroup;return p&&g?{group:g,key:p,variant:u}:null}let f=o.dataset.diplodocKey,m=(a=o.closest(b.TABS))==null?void 0:a.dataset.diplodocGroup;return f&&m?{group:m,key:f,variant:"regular"}:null}getTabs(o){var i,r;let a=(i=o.closest(b.TABS))==null?void 0:i.dataset.diplodocGroup,u=(r=o.closest(b.TAB_LIST))==null?void 0:r.querySelectorAll(b.TAB),f=[];return u.forEach(m=>{let p=m==null?void 0:m.dataset.diplodocKey;p&&f.push({group:a,key:p,variant:"regular"})}),{tabs:f,nodes:u}}};typeof window!="undefined"&&typeof document!="undefined"&&!window[w]&&(window[w]=new $(document))})();var _e=we(Ae());typeof document!="undefined"&&(function(e){let t=e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector;t?e.matches=e.matchesSelector=t:e.matches=e.matchesSelector=function(s){let d=(e.getRootNode?e.getRootNode():_e.default.call(e)).querySelectorAll(s),c=this;return Array.prototype.some.call(d,h=>h===c)}})(Element.prototype);var H=e=>{let t=e.composedPath();return Array.isArray(t)&&t.length>0?t[0]:e.target},q=e=>{let t=H(e);return!t||!t.matches},j=async e=>{if(!e)return;if(navigator.clipboard&&typeof navigator.clipboard.writeText)return navigator.clipboard.writeText(e);let t=document.createElement("textarea");t.setAttribute("style","position: absolute; left: 1000%"),t.textContent=e,document.body.append(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},Se=".yfm-clipboard-button",Ce=".yfm-wrapping-button";function Ne(e){if(!e)return;let t=e.getAttribute("data-animation"),n=e.getRootNode().getElementById(`visibileAnimation-${t}`);n&&n.beginElement()}function Be(e){var t;let n=(t=e.parentNode)==null?void 0:t.parentNode,s=n==null?void 0:n.querySelector("pre code");if(!n||!s)return;let l=Array.from(s.childNodes).filter(d=>!(d instanceof HTMLElement&&d.classList.contains("yfm-line-number"))).map(d=>d.textContent).join("");j(l.trim()).then(()=>{Ne(n.querySelector(".yfm-clipboard-icon")),setTimeout(()=>e.blur(),1500)})}function Oe(e){var t;let n=(t=e.parentNode)==null?void 0:t.parentNode,s=n==null?void 0:n.querySelector("pre code");!n||!s||(s.classList.toggle("wrap"),setTimeout(()=>e.blur(),500))}typeof document!="undefined"&&document.addEventListener("click",e=>{if(q(e))return;let t=H(e);t.matches(Se)?Be(t):t.matches(Ce)&&Oe(t)});var Ie=".yfm-clipboard-anchor";typeof document!="undefined"&&document.addEventListener("click",e=>{let t=H(e);if(q(e)||!t.matches(Ie))return;let n=t.getAttribute("data-href")||"",s=new URL(n,window.location.href).toString();j(s)});var U=".yfm-clipboard-inline-code",ie="tooltip_inline_clipboard_dialog",ke="yfm inline_code_tooltip",x="open",re={ru:"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E",en:"Copied",ar:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",cs:"Zkop\xEDrov\xE1no",fr:"Copi\xE9",es:"Copiado",he:"\u05D4\u05D5\u05E2\u05EA\u05E7",bg:"\u041A\u043E\u043F\u0438\u0440\u0430\u043D\u043E",et:"Kopeeritud",el:"\u0391\u03BD\u03C4\u03B9\u03B3\u03C1\u03AC\u03C6\u03B7\u03BA\u03B5",pt:"Copiado",zh:"\u5DF2\u590D\u5236","zh-tw":"\u5DF2\u8907\u88FD",kk:"\u041A\u04E9\u0448\u0456\u0440\u0456\u043B\u0434\u0456",tr:"Kopyaland\u0131",uz:"Nusxalandi"},Q={TITLE:".yfm .yfm-term_title",CONTENT:".yfm .yfm-term_dfn"},M="open",V=Q.CONTENT.replace(/\./g,"")+" "+M,G=!0;function Re(e,t){let n=t.getAttribute("id")||Math.random().toString(36).substr(2,8);e==null||e.setAttribute("term-id",n)}function Pe(e,t){let n=t.getAttribute("aria-live")||"polite";e==null||e.setAttribute("aria-live",n),e==null||e.setAttribute("aria-modal","true")}function J(e,t){let{x:n,y:s,right:l,left:d,width:c,height:h}=t.getBoundingClientRect(),v=le(t);if(!v)return;let{right:L,left:C}=v.getBoundingClientRect();if((L<d||C>l)&&!G){K(e);return}G&&v&&(v.addEventListener("scroll",se),G=!1);let D=Number(e.getAttribute("relativeX")),B=Number(e.getAttribute("relativeY"));if(D===n&&B===s)return;e.setAttribute("relativeX",String(n)),e.setAttribute("relativeY",String(s));let O=h+5,w=e.parentElement;if(!w)return;let{width:E}=e.getBoundingClientRect(),{left:I}=w.getBoundingClientRect(),k=Number(N(t).left),R=E+k,b=k-E<0,$=R>document.body.clientWidth,i=($||document.dir==="rtl")&&!b?E-c:0,r=N(w).top-w.offsetTop,u=$?R-document.body.clientWidth+5:0,f=N(t).left-I+w.offsetLeft-i,m=f+E>=document.body.clientWidth;e.style.top=Number(N(t).top+O-r)+"px",e.style.left=Number(f-(m?u:0))+"px"}function se(){let e=document.getElementsByClassName(V)[0];if(!e)return;let t=e.getAttribute("term-id")||"",n=document.getElementById(t);n&&J(e,n)}function le(e){return e?e.closest("table")||e.closest("code")||e.parentElement:null}function ae(e){let t=document.getElementsByClassName(V)[0],n=e.getAttribute("id"),l=`${e.getAttribute("term-key")}_element`,d=e.closest(".wide-container"),c;if(d){let L=e.closest(".wide-content");if(!L)return;c=L.querySelector(`[id="${l}"]`)}else c=document.getElementById(l);if(t&&n===t.getAttribute("term-id")){K(t);return}let v=e.closest([Q.CONTENT.replace(" ",""),M].join("."));t&&!v&&K(t),!(!e.matches(Q.TITLE)||!c)&&(Re(c,e),Pe(c,e),J(c,e),c.classList.toggle(M),De(c))}function K(e){e.classList.remove(M);let t=ce(e),n=le(t);n&&(n.removeEventListener("scroll",se),G=!0)}function N(e){let t=e.getBoundingClientRect(),n=document.body,s=document.documentElement,l=window.pageYOffset||s.scrollTop||n.scrollTop,d=window.pageXOffset||s.scrollLeft||n.scrollLeft,c=s.clientTop||n.clientTop||0,h=s.clientLeft||n.clientLeft||0,v=t.top+l-c,L=t.left+d-h;return{top:Math.round(v),left:Math.round(L)}}function De(e){let t=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=t[0],s=t[t.length-1];n&&n.focus(),e.addEventListener("keydown",function(l){(l.key==="Tab"||l.keyCode===9)&&(l.shiftKey?document.activeElement===n&&(s.focus(),l.preventDefault()):document.activeElement===s&&(n.focus(),l.preventDefault()))})}function ce(e){let t=e.getAttribute("term-id");if(!t)return null;if(e.closest(".wide-container")){let s=e.closest(".wide-content");return s?s.querySelector(`[id="${t}"]`):null}return document.getElementById(t)}var F=null,Y=!0;function z(){return document.getElementById(ie)}function $e(e,t){let n=t.getAttribute("aria-live")||"polite";e==null||e.setAttribute("aria-live",n),e==null||e.setAttribute("aria-modal","true")}function de(){F&&(clearTimeout(F),F=null)}function Z(e){return e?e.closest("table")||e.closest("code")||e.parentElement:null}function ue(){let e=z();if(!e)return;let t=e.getAttribute("inline-id")||"",n=document.getElementById(t);n&&ee(e,n)}function ee(e,t){let{x:n,y:s,right:l,left:d,width:c,height:h}=t.getBoundingClientRect(),v=Z(t);if(!v)return;let{right:L,left:C}=v.getBoundingClientRect();if((L<d||C>l)&&!Y){te(e);return}Y&&v&&(v.addEventListener("scroll",ue),Y=!1);let D=Number(e.getAttribute("relativeX")),B=Number(e.getAttribute("relativeY"));if(D===n&&B===s)return;e.setAttribute("relativeX",String(n)),e.setAttribute("relativeY",String(s));let O=h+5,w=e.parentElement;if(!w)return;let{width:E}=e.getBoundingClientRect(),{left:I}=w.getBoundingClientRect(),k=Number(N(t).left),R=E+k,b=k-E<0,$=R>document.body.clientWidth,i=($||document.dir==="rtl")&&!b?E-c:0,r=N(w).top-w.offsetTop,u=$?R-document.body.clientWidth+5:0,f=N(t).left-I+w.offsetLeft-i,m=f+E>=document.body.clientWidth;e.style.top=Number(N(t).top+O-r)+"px",e.style.left=Number(f-(m?u:0))+"px"}function fe(e){let t=e.getAttribute("inline-id");return t?document.getElementById(t):null}function He(e){e.classList.remove(x);let t=fe(e),n=Z(t),s=Z(e);e.removeAttribute("inline-id"),!(!n||!s)&&(s.removeChild(e),n.removeEventListener("scroll",ue),Y=!0)}function xe(){var e;let t=z();if(!t){let n=document.querySelector(".dc-doc-page__content")||document.body,s=document.documentElement.lang||"en",l=(e=re[s])!=null?e:re.en,d=document.createElement("div");d.innerHTML=`
|
|
2
|
-
<div id="${ie}" class="${ke}"
|
|
3
|
-
role="dialog" aria-live="polite" aria-modal="true">
|
|
4
|
-
${l}
|
|
5
|
-
</div>
|
|
6
|
-
`,t=d.firstElementChild,n.appendChild(t)}return t}function Me(e){let t=xe();if(!(!e.matches(U)||!t))return t.setAttribute("inline-id",e.getAttribute("id")||""),$e(t,e),ee(t,e),t.classList.contains(x)?(t.classList.remove(x),requestAnimationFrame(()=>{t.classList.add(x)})):t.classList.add(x),t}function te(e){de(),He(e)}function me(e){let t=Me(e);t&&(de(),F=setTimeout(()=>{te(t),F=null},1e3))}function Fe(e){let t=e.innerText;t&&j(t).then(()=>{me(e)})}typeof document!="undefined"&&(document.addEventListener("click",e=>{let t=H(e),n=t.matches(U);q(e)||!n||Fe(t)}),document.addEventListener("keydown",e=>{var t;if(e.key==="Enter"&&document.activeElement){let s=document.activeElement,l=U.replace(".","");if(!s.classList.contains(l))return;let d=s.innerText;if(!d)return;j(d).then(()=>{me(s)})}let n=z();e.key==="Escape"&&n&&(te(n),(t=fe(n))==null||t.focus())}),window.addEventListener("resize",()=>{let e=z();if(!e)return;let t=e.getAttribute("inline-id")||"",n=document.getElementById(t);if(!n){e.classList.toggle(x);return}ee(e,n)})),typeof document!="undefined"&&(document.addEventListener("click",e=>{(H(e)||!q(e))&&ae(H(e))}),document.addEventListener("keydown",e=>{var t;let n=document.getElementsByClassName(V)[0];e.key==="Enter"&&document.activeElement&&ae(document.activeElement),e.key==="Escape"&&n&&(K(n),(t=ce(n))==null||t.focus())}),window.addEventListener("resize",()=>{let e=document.getElementsByClassName(V)[0];if(!e)return;let t=e.getAttribute("term-id")||"",n=document.getElementById(t);if(!n){e.classList.toggle(M);return}J(e,n)}));var We="[wide-content]",qe='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M7.754 2.004a.75.75 0 0 0 0 1.5h4.75v4.742a.75.75 0 0 0 1.5 0V2.754a.75.75 0 0 0-.75-.75zm.492 11.992a.75.75 0 0 0 0-1.5h-4.75V7.754a.75.75 0 0 0-1.5 0v5.492a.75.75 0 0 0 .75.75z" clip-rule="evenodd"/></svg>',je='<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" class="close-action"><path fillRule="evenodd" clipRule="evenodd" d="M9.46967 9.46967C9.76256 9.17678 10.2374 9.17678 10.5303 9.46967L14 12.9393L17.4697 9.46967C17.7626 9.17678 18.2374 9.17678 18.5303 9.46967C18.8232 9.76256 18.8232 10.2374 18.5303 10.5303L15.0607 14L18.5303 17.4697C18.8232 17.7626 18.8232 18.2374 18.5303 18.5303C18.2374 18.8232 17.7626 18.8232 17.4697 18.5303L14 15.0607L10.5303 18.5303C10.2374 18.8232 9.76256 18.8232 9.46967 18.5303C9.17678 18.2374 9.17678 17.7626 9.46967 17.4697L12.9393 14L9.46967 10.5303C9.17678 10.2374 9.17678 9.76256 9.46967 9.46967Z" fill="var(--g-color-text-primary)" fillOpacity="0.85"/></svg>',ne=()=>{window.wideTemplate&&(window.wideTemplate.style.display="none",window.wideTemplate.content(void 0))},Ve=e=>{if(e.tagName!=="TABLE")return;let t=Array.from(e.children);return t.find(l=>l.tagName==="THEAD")?void 0:t.find(l=>l.tagName==="TBODY")},Ge=()=>{if(window.wideTemplate)return window.wideTemplate;let e=document.createElement("div");e.classList.add("dc-doc-page","wide-container");let t=document.createElement("div");t.classList.add("wide-content-overlay"),t.addEventListener("click",ne);let n=document.createElement("div");n.classList.add("yfm","wide-content-wrapper");let s=document.createElement("div");s.classList.add("wide-toolbar");let l=document.createElement("div");l.classList.add("wide-actions"),l.addEventListener("click",ne),l.innerHTML=je;let d=document.createElement("p");d.classList.add("wide-entity-name"),e.label=h=>{d.innerHTML=h||""};let c=document.createElement("div");return c.classList.add("wide-content"),e.content=h=>{var v;if(typeof h=="undefined"){c.innerHTML="";return}let L=h.cloneNode(!0),C=Ve(L);(v=C==null?void 0:C.classList)==null||v.add("wide-thead-content");let D=L.querySelectorAll(".yfm-term_title"),B=[];D.forEach(O=>{let w=O.getAttribute("term-key");if(w){let E=document.getElementById(w+"_element");if(E){let I=E.cloneNode(!0);B.push(I)}}}),c.replaceChildren(L,...B)},s.append(d,l),n.append(s,c),e.append(t,n),e.style.display="none",document.body.appendChild(e),window.wideTemplate=e,e},Ke=e=>{let t=Ge();t.label(e.title),t.content(e),t.style.display="flex"},Ye={render:Ke,remove:ne},ze=e=>{var t;if((t=e.parentElement)!=null&&t.classList.contains("wide-element-wrapper"))return;e.classList.add("wide-inner-element");let n=document.createElement("div");n.innerHTML=qe,n.classList.add("wide-content-viewer"),n.addEventListener("click",()=>Ye.render(e));let s=document.createElement("div");s.classList.add("wide-element-wrapper"),e.before(s),s.appendChild(e),s.appendChild(n)},pe=()=>{Array.from(document.querySelectorAll(We)).forEach(ze)};typeof window!="undefined"&&typeof document!="undefined"&&window.addEventListener("load",pe);var Xe=()=>{pe()};typeof window!="undefined"&&(window.patchAfterRender=Xe)})();})();
|
|
1
|
+
"use strict";(()=>{(()=>{var wt=Object.create,z=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,tt=Object.getOwnPropertyNames,Et=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty,_t=(t,e,o)=>e in t?z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,St=(t,e)=>function(){return e||(0,t[tt(t)[0]])((e={exports:{}}).exports,e),e.exports},Ct=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of tt(e))!At.call(t,n)&&n!==o&&z(t,n,{get:()=>e[n],enumerable:!(i=Lt(e,n))||i.enumerable});return t},Ot=(t,e,o)=>(o=t!=null?wt(Et(t)):{},Ct(e||!t||!t.__esModule?z(o,"default",{value:t,enumerable:!0}):o,t)),Nt=(t,e,o)=>_t(t,typeof e!="symbol"?e+"":e,o),It=St({"node_modules/get-root-node-polyfill/index.js"(t,e){"use strict";function o(c){var u=typeof c=="object"&&!!c.composed;return u?i(this):n(this)}function i(c){var u=n(c);return l(u)?i(u.host):u}function n(c){return c.parentNode!=null?n(c.parentNode):c}function l(c){return c.nodeName==="#document-fragment"&&c.constructor.name==="ShadowRoot"}typeof e=="object"&&e.exports&&(e.exports=o)}});(()=>{var t="yfm_cut",e={Cut:"yfm-cut",Title:"yfm-cut-title",Content:"yfm-cut-content",Highlight:"yfm-cut-highlight"},o=class{constructor(){Nt(this,"disposers",[]),this.disposers.push(this.init())}init(){let l=!1,c=()=>{l=!0},u=()=>{l=!1},v=g=>{n(g.target)&&!l&&this.focusActiveCut(g.target)};return document.addEventListener("mousedown",c),document.addEventListener("mouseup",u),document.addEventListener("focus",v,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",u),document.removeEventListener("focus",v,!0)}}dispose(){for(let l of this.disposers)l()}focusActiveCut(l){let c=l.parentNode;if(!i(c))return;let u=c;for(;u;)i(u)&&(u.open=!0),u=u.parentElement;setTimeout(()=>{c.classList.add(e.Highlight)},70),setTimeout(()=>{c.classList.remove(e.Highlight)},1e3)}};function i(l){var c;return((c=l==null?void 0:l.tagName)==null?void 0:c.toLowerCase())==="details"&&(l==null?void 0:l.classList.contains(e.Cut))}function n(l){var c;return((c=l==null?void 0:l.tagName)==null?void 0:c.toLowerCase())==="summary"&&(l==null?void 0:l.classList.contains(e.Title))}typeof window<"u"&&!window[t]&&(window[t]=new o)})(),(()=>{var t="yfm-tabs",e="yfm-tab",o="yfm-tab-panel",i="yfm-tab-list",n="active",l="data-diplodoc-group",c="data-diplodoc-key",u="data-diplodoc-variant",v="data-diplodoc-id",g="defaultTabsGroup-",_="data-diplodoc-forced",S="yfm-tabs-dropdown-select",y="yfm-tabs-vertical",b=(r=>(r.Regular="regular",r.Radio="radio",r.Dropdown="dropdown",r.Accordion="accordion",r))(b||{}),w=Symbol.for("diplodocTabs"),C=r=>{let s=r.composedPath();return Array.isArray(s)&&s.length>0?s[0]:r.target},x=r=>{let s=C(r);return!s||!s.matches},$=r=>Math.abs(r.scrollHeight-r.clientHeight)>1?r:r.parentElement?$(r.parentElement):void 0,M=(r,s)=>{let a=r.getBoundingClientRect(),d=s.getBoundingClientRect();return{top:a.top-d.top,left:a.left-d.left,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft}},A={TABS:`.${t}`,TAB_LIST:`.${i}`,TAB:`.${e}`,TAB_PANEL:`.${o}`,VERTICAL_TABS:`.${y}`},U=class{constructor(r,s={}){this._onSelectTabHandlers=new Set,this._currentPageTabGroups=[],this._isRestoringTabs=!1,this._document=r,this._options=Object.assign({saveTabsToLocalStorage:!1,saveTabsToQueryStateMode:"none"},s),this._document.addEventListener("click",a=>{let d=C(a);if(a.target&&this.hideAllDropdown(a.target),x(a))return;if(this.isElementDropdownSelect(d)){d.classList.toggle(n);return}if(!this.isValidTabElement(d))return;let f=this.getTabDataFromHTMLElement(d);f&&this._selectTab(f,d)}),this._document.addEventListener("keydown",a=>{let d=null;switch(a.key){case"ArrowLeft":{d="left";break}case"ArrowRight":{d="right";break}case"ArrowUp":{d="left";break}case"ArrowDown":{d="right";break}}if(!d)return;let f=C(a);if(x(a)||!this.isValidTabElement(f))return;let{tabs:p,nodes:m}=this.getTabs(f),h=this.getTabDataFromHTMLElement(f),T=p.findIndex(({key:E})=>(h==null?void 0:h.key)&&E===h.key);if(!h||p.length<=1||T===-1)return;let L=(T+(d==="left"?-1:1)+p.length)%p.length;this.selectTab(p[L]),m[L].focus()})}configure(r){this._options=Object.assign(this._options,r)}onSelectTab(r){return this._onSelectTabHandlers.add(r),()=>{this._onSelectTabHandlers.delete(r)}}selectTabById(r,s){let a=this._document.querySelector(`${A.TAB}[${v}="${r}"]`);if(!a||!this.isValidTabElement(a))return;let d=this.getTabDataFromHTMLElement(a);d&&this._selectTab(d,a),s!=null&&s.scrollToElement&&a.scrollIntoView()}selectTab(r){this._selectTab(r)}restoreTabs(r){this._isRestoringTabs=!0;try{for(let[s,a]of Object.entries(r))if(s){let d={group:s,...a};this.selectTab(d)}}finally{this._isRestoringTabs=!1}}getTabsFromLocalStorage(){return JSON.parse(localStorage.getItem("tabsHistory")||"{}")}getTabsFromSearchQuery(){let r={},s=new URLSearchParams(window.location.search);return s.has("tabs")&&(s.get("tabs")||"").split(",").forEach(a=>{let d=a.split("_"),[f,p]=d,m="regular";if(d.length===3&&(m=d[2]),f&&p&&Object.values(b).includes(m)){let h=p;r[f]={key:h,variant:m}}}),r}updateLocalStorageWithTabs(r){this._options.saveTabsToLocalStorage&&(this._isRestoringTabs||localStorage.setItem("tabsHistory",JSON.stringify(r)))}updateQueryParamWithTabs(r){if(this._isRestoringTabs)return;let s=new URLSearchParams(window.location.search),a=Object.entries(r).map(([p,{key:m,variant:h}])=>h==="regular"?`${p}_${m}`:`${p}_${m}_${h}`);a.length>0?s.set("tabs",a.join(",")):s.delete("tabs");let d=history.state||{},f=new URL(window.location.href);f.search=s.toString(),window.history.replaceState({...d},document.title,f.href)}getCurrentPageTabHistory(r){return Object.fromEntries(Object.entries(r).filter(([s])=>this._currentPageTabGroups.includes(s)))}onPageChanged(){this._currentPageTabGroups=this.getCurrentPageTabGroups()}getCurrentPageTabGroups(){let r=this._document.getElementsByClassName(t),s=new Set;return Array.from(r).forEach(a=>{let d=a.getAttribute(l);d&&s.add(d)}),Array.from(s)}clearTabsPreferred(){localStorage.removeItem("tabsHistory"),this.updateQueryParamWithTabs({})}_selectTab(r,s){let{group:a,key:d,variant:f}=r;if(!a)return;this.saveTabPreferred({group:a,key:d,variant:f});let p=s&&$(s),m=p&&M(s,p);this.updateHTML({group:a,key:d,variant:f},s,f)>0&&(this.fireSelectTabEvent({group:a,key:d,variant:f},s==null?void 0:s.dataset.diplodocId),m&&this.resetScroll(s,p,m))}updateHTML(r,s,a){switch(a){case"radio":return this.updateHTMLRadio(r,s);case"accordion":return this.updateHTMLAccordion(r,s);case"regular":return this.updateHTMLRegular(r);case"dropdown":return this.updateHTMLDropdown(r);default:return 0}}saveTabPreferred(r){let s={};switch(this._options.saveTabsToLocalStorage&&(s=JSON.parse(localStorage.getItem("tabsHistory")||"{}")),s[r.group]={key:r.key,variant:r.variant},this._options.saveTabsToLocalStorage&&this.updateLocalStorageWithTabs(s),this._options.saveTabsToQueryStateMode){case"all":{this.updateQueryParamWithTabs(s);break}case"page":{this.updateQueryParamWithTabs(this.getCurrentPageTabHistory(s));break}}}updateHTMLRadio(r,s){let{group:a,key:d}=r,{isForced:f,root:p}=this.didTabOpenForce(s),m=f?`.yfm-vertical-tab[${_}="true"]`:"",h=this._document.querySelectorAll(`${A.TABS}[${l}="${a}"] ${A.TAB}[${c}="${d}"]${m}`);f&&(p==null||p.removeAttribute(_));let T=0;return h.forEach(L=>{let E=L.parentNode.children;for(let N=0;N<E.length;N+=2){let[I,O]=[E.item(N),E.item(N+1)],R=I.children.item(0);if(I===L){R.checked?(I.classList.remove("active"),O==null||O.classList.remove("active"),R.removeAttribute("checked")):(I.classList.add("active"),O==null||O.classList.add("active"),R.setAttribute("checked","true"));continue}R.hasAttribute("checked")&&(I.classList.remove("active"),O==null||O.classList.remove("active"),R.removeAttribute("checked")),T++}}),T}updateHTMLRegular(r){let{group:s,key:a}=r,d=this._document.querySelectorAll(`${A.TABS}[${l}="${s}"] ${A.TAB}[${c}="${a}"]`),f=0;return d.forEach(p=>{let m=p;if(!this.isValidTabElement(m)||m.dataset.diplodocIsActive==="true")return;f++;let h=p,T=h.parentNode,L=T==null?void 0:T.parentNode,E=Array.from((T==null?void 0:T.querySelectorAll(A.TAB))||[]),N=Array.from((L==null?void 0:L.children)||[]).filter(O=>O.classList.contains(o)),I=E.indexOf(h);E.forEach((O,R)=>{let be=N[R],H=R===I,Te=O;Te.dataset.diplodocIsActive=H?"true":"false",O.classList.toggle(n,H),O.setAttribute("aria-selected",H.toString()),O.setAttribute("tabindex",H?"0":"-1"),be.classList.toggle(n,H)})}),f}updateHTMLDropdown(r){let{group:s,key:a}=r,d=this._document.querySelectorAll(`${A.TABS}[${l}="${s}"] ${A.TAB}[${c}="${a}"]`),f=0;return d.forEach(p=>{let m=p.closest(`[${u}=dropdown]`);if(!(m!=null&&m.children))return;let h=m.children.item(0),T=m.children.item(1);h==null||h.classList.remove(n);let L=Array.from((T==null?void 0:T.children)||[]).indexOf(p)+2;for(let E=2;E<m.children.length;E++){let N=m.children.item(E),I=T==null?void 0:T.children.item(E-2);if(f++,L===E){N==null||N.classList.add(n),I.classList.add(n),h.innerHTML=p.innerHTML,h.classList.add("filled");continue}I.classList.remove(n),N.classList.remove(n)}}),f}updateHTMLAccordion(r,s){let{group:a,key:d}=r,f=this._document.querySelectorAll(`${A.TABS}[${l}="${a}"] ${A.TAB}[${c}="${d}"]`),p=0;return f.forEach(m=>{let h=m.closest(`[${u}=accordion]`);if(h!=null&&h.children)for(let T=0;T<h.children.length;T+=2){let L=h.children.item(T),E=h.children.item(T+1);if(p++,m===L){L==null||L.classList.toggle(n),E==null||E.classList.toggle(n);continue}L==null||L.classList.remove(n),E==null||E.classList.remove(n)}}),s&&!this.checkVisible(s)&&setTimeout(()=>{s.scrollIntoView({block:"nearest"})}),p}checkVisible(r){let s=r.getBoundingClientRect(),a=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(s.bottom<0||s.top-a>=0)}hideAllDropdown(r){this._document.querySelectorAll(".yfm-tabs-dropdown-select.active").forEach(s=>{s.contains(r)||s.classList.remove(n)})}resetScroll(r,s,a){let d=M(r,s),f=d.top-a.top,p=d.left-a.left,m=d.scrollTop-a.scrollTop,h=d.scrollLeft-a.scrollLeft;s.scrollTo(s.scrollLeft+p-h,s.scrollTop+f-m)}didTabOpenForce(r){if(!r)return{};if(r.dataset.diplodocForced)return{root:r,isForced:!0};let s=r.dataset.diplodocVerticalTab?r:r.parentElement,a=typeof(s==null?void 0:s.dataset.diplodocForced)!="undefined";return{root:s,isForced:a}}fireSelectTabEvent(r,s){let{group:a,key:d,variant:f}=r,p=a.startsWith(g)?{key:d,variant:f}:r;this._onSelectTabHandlers.forEach(m=>{m({tab:p,currentTabId:s})})}getTabsType(r){let s=r.closest(`[${u}]`);if(s)return s.dataset.diplodocVariant}isValidTabElement(r){return!!this.getTabsType(r)}isElementDropdownSelect(r){return r.classList.contains(S)}getTabDataFromHTMLElement(r){var s,a,d;let f=this.getTabsType(r);if(f==="radio"){let h=r.dataset.diplodocVerticalTab?r:r.parentElement,T=h.dataset.diplodocKey,L=(s=h.closest(A.TABS))==null?void 0:s.dataset.diplodocGroup;return T&&L?{group:L,key:T,variant:"radio"}:null}if(f==="dropdown"||f==="accordion"){let h=r.dataset.diplodocKey,T=(a=r.closest(A.TABS))==null?void 0:a.dataset.diplodocGroup;return h&&T?{group:T,key:h,variant:f}:null}let p=r.dataset.diplodocKey,m=(d=r.closest(A.TABS))==null?void 0:d.dataset.diplodocGroup;return p&&m?{group:m,key:p,variant:"regular"}:null}getTabs(r){var s,a;let d=(s=r.closest(A.TABS))==null?void 0:s.dataset.diplodocGroup,f=(a=r.closest(A.TAB_LIST))==null?void 0:a.querySelectorAll(A.TAB),p=[];return f.forEach(m=>{let h=m==null?void 0:m.dataset.diplodocKey;h&&p.push({group:d,key:h,variant:"regular"})}),{tabs:p,nodes:f}}};typeof window!="undefined"&&typeof document!="undefined"&&!window[w]&&(window[w]=new U(document))})();var Rt=Ot(It());typeof document!="undefined"&&(function(t){let e=t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector;e?t.matches=t.matchesSelector=e:t.matches=t.matchesSelector=function(i){let l=(t.getRootNode?t.getRootNode():Rt.default.call(t)).querySelectorAll(i),c=this;return Array.prototype.some.call(l,u=>u===c)}})(Element.prototype);var k=t=>{let e=t.composedPath();return Array.isArray(e)&&e.length>0?e[0]:t.target},F=t=>{let e=k(t);return!e||!e.matches},K=async t=>{if(!t)return;if(navigator.clipboard&&typeof navigator.clipboard.writeText)return navigator.clipboard.writeText(t);let e=document.createElement("textarea");e.setAttribute("style","position: absolute; left: 1000%"),e.textContent=t,document.body.append(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)},kt=".yfm-clipboard-button",xt=".yfm-wrapping-button";function Pt(t){if(!t)return;let e=t.getAttribute("data-animation"),o=t.getRootNode().getElementById(`visibileAnimation-${e}`);o&&o.beginElement()}function Bt(t){var e;let o=(e=t.parentNode)==null?void 0:e.parentNode,i=o==null?void 0:o.querySelector("pre code");if(!o||!i)return;let n=Array.from(i.childNodes).filter(l=>!(l instanceof HTMLElement&&l.classList.contains("yfm-line-number"))).map(l=>l.textContent).join("");K(n.trim()).then(()=>{Pt(o.querySelector(".yfm-clipboard-icon")),setTimeout(()=>t.blur(),1500)})}function Dt(t){var e;let o=(e=t.parentNode)==null?void 0:e.parentNode,i=o==null?void 0:o.querySelector("pre code");!o||!i||(i.classList.toggle("wrap"),setTimeout(()=>t.blur(),500))}typeof document!="undefined"&&document.addEventListener("click",t=>{if(F(t))return;let e=k(t);e.matches(kt)?Bt(e):e.matches(xt)&&Dt(e)});var $t=".dc-doc-page__content",et="yfm yfm-tooltip",ot="open",Y="data-tooltip-id",Mt={mainAxis:5},Ht={top:"bottom",bottom:"top",left:"right",right:"left"},Ft={top:0,bottom:0,left:0,right:0};function nt(t){return t==="top"||t==="bottom"}function qt(t=0){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:{...Ft,...t}}function Q(t){let[e,o]=t.split("-");return{side:e,alignment:o}}function rt(t){return Ht[t]}function Wt(t){let{side:e,alignment:o}=Q(t),i=rt(e);return o?`${i}-${o}`:i}function it(t,e,o){let i=st(t,{top:e.y,left:e.x});return Kt(o,i,5)}function Vt(t,e,o){let i=rt(o);return t[o]>0&&e[i]<t[o]}function jt(t,e,o,i,n,l,c=!0){let u=at(t,e,n,i,l);if(!c)return{coords:u,placement:i};let v=it(e,u,o),{side:g}=Q(i);if(v[g]<=0)return{coords:u,placement:i};let _=Wt(i),S=at(t,e,n,_,l),y=it(e,S,o);return Vt(v,y,g)?{coords:S,placement:_}:{coords:u,placement:i}}function Gt(){let t=Math.random().toString(36).substring(2,6),e=Date.now().toString(36);return`${t}${e}`}function P(t){return{...t,right:t.left+t.width,bottom:t.top+t.height}}function st(t,e){var o,i,n,l;return P({top:(o=e.top)!=null?o:t.top,left:(i=e.left)!=null?i:t.left,width:(n=e.width)!=null?n:t.width,height:(l=e.height)!=null?l:t.height})}function lt(){let{documentElement:t,body:e}=document,o=window.scrollY||t.scrollTop||e.scrollTop,i=window.scrollX||t.scrollLeft||e.scrollLeft,n=t.clientTop||e.clientTop||0,l=t.clientLeft||e.clientLeft||0;return P({top:Math.round(o-n),left:Math.round(i-l),width:document.body.clientWidth,height:document.body.clientHeight})}function ct(t){let e=lt(),o=t.getBoundingClientRect();return P({top:Math.round(o.top+e.top),left:Math.round(o.left+e.left),width:o.width,height:o.height})}function Ut(t,e,o){let{mainAxis:i=0,crossAxis:n=0}=t,l=nt(e),c=e==="top"||e==="left"?-1:1,u=o&&l?-1:1,v=i*c,g=n*u;return l?{x:g,y:v}:{x:v,y:g}}function at(t,e,o,i,n){let{side:l,alignment:c}=Q(i),u=nt(l),v=u?"x":"y",g=v==="y"?"height":"width",_=t.left+t.width/2-e.width/2,S=t.top+t.height/2-e.height/2,y=t[g]/2-e[g]/2,b={x:t.left,y:t.top};switch(l){case"top":{b.x=_,b.y=t.top-e.height;break}case"bottom":{b.x=_,b.y=t.top+t.height;break}case"right":{b.x=t.left+t.width,b.y=S;break}case"left":{b.x=t.left-e.width,b.y=S;break}}switch(c){case"start":{b[v]-=y*(n&&u?-1:1);break}case"end":{b[v]+=y*(n&&u?-1:1);break}}let w=Ut(o,l,n);return b.x+=w.x,b.y+=w.y,b}function zt(t,e){let o=ct(e);return P({top:t.top-o.top+e.offsetTop,left:t.left-o.left+e.offsetLeft,width:t.width,height:t.height})}function Kt(t,e,o=0){let{top:i,bottom:n,left:l,right:c}=qt(o);return{top:t.top-e.top+i,bottom:e.bottom-t.bottom+n,left:t.left-e.left+l,right:e.right-t.right+c}}function dt(t={}){let{closeDelay:e=1e3,additionalClassName:o}=t,i=!1,n={currentId:null,timer:null,unsubscribe:null},l=()=>n.currentId?document.getElementById(n.currentId):null,c=()=>n.currentId?ut(n.currentId):null,u=()=>{let y=l();n.timer&&(clearTimeout(n.timer),n.timer=null),n.unsubscribe&&(n.unsubscribe(),n.unsubscribe=null),y&&(y.classList.remove(ot),Xt(y),n.currentId=null)},v=(y,b)=>{u();let w=Yt({text:b,className:o}),C=ft.bind(null,t,y,w);n.currentId=w.id,Qt(w,y),n.unsubscribe=Jt(y,C),w.classList.add(ot),C(),e>0&&(n.timer=setTimeout(u,e))},g=()=>{let y=l(),b=c();if(y&&!b){u();return}y&&b&&ft(t,b,y)};return{get visible(){return!!n.currentId},getActiveReference:c,show:v,hide:u,init:()=>{i||(i=!0,window.addEventListener("scroll",g),window.addEventListener("resize",g))},cleanup:()=>{i&&(i=!1,window.removeEventListener("scroll",g),window.removeEventListener("resize",g))}}}function Yt(t){let{text:e,className:o}=t,i=Gt(),n=document.createElement("div");return n.id=i,n.className=o?`${et} ${o}`:et,n.setAttribute("role","tooltip"),n.setAttribute("aria-live","polite"),n.textContent=e,n}function Qt(t,e){let o=document.querySelector($t)||document.body,i=e.getAttribute("aria-live");e.setAttribute(Y,t.id),i&&t.setAttribute("aria-live",i),o.appendChild(t)}function Xt(t){if(t.id){let e=ut(t.id);e==null||e.removeAttribute(Y)}t.remove()}function ut(t){return document.querySelector(`[${Y}="${t}"]`)}function Jt(t,e){let o=Zt(t);return o.addEventListener("scroll",e),()=>{o.removeEventListener("scroll",e)}}function Zt(t){return t.closest("table")||t.closest("code")||t.parentElement||document.body}function te(t,e){let o=e.parentElement;if(!o)return null;let i={reference:t,tooltip:e,offsetParent:o},n=lt(),l=ct(t),{width:c,height:u}=e.getBoundingClientRect();return{isRtl:document.dir==="rtl",viewport:n,reference:l,tooltip:P({top:0,left:0,width:c,height:u}),elements:i}}function ft(t,e,o){let i=te(e,o);if(!i)return;let n=ee(i,t);o.style.top=`${n.y}px`,o.style.left=`${n.x}px`}function ee(t,e){let{placement:o="bottom-start",offset:i=Mt,flip:n=!0}=e,{reference:l,tooltip:c,viewport:u,isRtl:v}=t,{coords:g}=jt(l,c,u,o,i,v,n),_=st(c,{top:g.y,left:g.x}),S=zt(_,t.elements.offsetParent);return{x:S.left,y:S.top}}var q={ru:"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E",en:"Copied",ar:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",cs:"Zkop\xEDrov\xE1no",fr:"Copi\xE9",es:"Copiado",he:"\u05D4\u05D5\u05E2\u05EA\u05E7",bg:"\u041A\u043E\u043F\u0438\u0440\u0430\u043D\u043E",et:"Kopeeritud",el:"\u0391\u03BD\u03C4\u03B9\u03B3\u03C1\u03AC\u03C6\u03B7\u03BA\u03B5",pt:"Copiado",zh:"\u5DF2\u590D\u5236","zh-tw":"\u5DF2\u8907\u88FD",kk:"\u041A\u04E9\u0448\u0456\u0440\u0456\u043B\u0434\u0456",tr:"Kopyaland\u0131",uz:"Nusxalandi"},oe=/^(?:https?|file):$/,ne=".yfm-clipboard-anchor",pt=dt();function re(t){let e=t.nodeName==="A"?t.href:t.dataset.href,o=new URL(e||"",window.location.href);return oe.test(o.protocol)?o.href:window.location.href}typeof document!="undefined"&&(pt.init(),document.addEventListener("click",t=>{let e=k(t);if(F(t)||!e.matches(ne))return;let o=re(e);K(o).then(()=>{var i;let n=document.documentElement.lang||"en",l=(i=q[n])!=null?i:q.en;pt.show(e,l)})}));var mt="yfm-clipboard-inline-code",ie=`.${mt}`,B=dt({additionalClassName:"inline_code_tooltip"});function ht(t){let e=t.innerText;e&&K(e).then(()=>{var o;let i=document.documentElement.lang||"en",n=(o=q[i])!=null?o:q.en;B.show(t,n)})}typeof document!="undefined"&&(B.init(),document.addEventListener("click",t=>{let e=k(t),o=e.matches(ie);F(t)||!o||ht(e)}),document.addEventListener("keydown",t=>{if(t.key==="Enter"&&document.activeElement){let e=document.activeElement;if(!e.classList.contains(mt))return;ht(e)}if(t.key==="Escape"&&B.visible){let e=B.getActiveReference();B.hide(),e==null||e.focus()}}));var X={TITLE:".yfm .yfm-term_title",CONTENT:".yfm .yfm-term_dfn"},D="open",W=X.CONTENT.replace(/\./g,"")+" "+D,V=!0;function se(t,e){let o=e.getAttribute("id")||Math.random().toString(36).substr(2,8);t==null||t.setAttribute("term-id",o)}function le(t,e){let o=e.getAttribute("aria-live")||"polite";t==null||t.setAttribute("aria-live",o),t==null||t.setAttribute("aria-modal","true")}function J(t,e){let{x:o,y:i,right:n,left:l,width:c,height:u}=e.getBoundingClientRect(),v=vt(e);if(!v)return;let{right:g,left:_}=v.getBoundingClientRect();if((g<l||_>n)&&!V){j(t);return}V&&v&&(v.addEventListener("scroll",gt),V=!1);let S=Number(t.getAttribute("relativeX")),y=Number(t.getAttribute("relativeY"));if(S===o&&y===i)return;t.setAttribute("relativeX",String(o)),t.setAttribute("relativeY",String(i));let b=u+5,w=t.parentElement;if(!w)return;let{width:C}=t.getBoundingClientRect(),{left:x}=w.getBoundingClientRect(),$=Number(G(e).left),M=C+$,A=$-C<0,U=M>document.body.clientWidth,s=(U||document.dir==="rtl")&&!A?C-c:0,a=G(w).top-w.offsetTop,f=U?M-document.body.clientWidth+5:0,p=G(e).left-x+w.offsetLeft-s,m=p+C>=document.body.clientWidth;t.style.top=Number(G(e).top+b-a)+"px",t.style.left=Number(p-(m?f:0))+"px"}function gt(){let t=document.getElementsByClassName(W)[0];if(!t)return;let e=t.getAttribute("term-id")||"",o=document.getElementById(e);o&&J(t,o)}function vt(t){return t?t.closest("table")||t.closest("code")||t.parentElement:null}function bt(t){let e=document.getElementsByClassName(W)[0],o=t.getAttribute("id"),n=`${t.getAttribute("term-key")}_element`,l=t.closest(".wide-container"),c;if(l){let g=t.closest(".wide-content");if(!g)return;c=g.querySelector(`[id="${n}"]`)}else c=document.getElementById(n);if(e&&o===e.getAttribute("term-id")){j(e);return}let v=t.closest([X.CONTENT.replace(" ",""),D].join("."));e&&!v&&j(e),!(!t.matches(X.TITLE)||!c)&&(se(c,t),le(c,t),J(c,t),c.classList.toggle(D),ce(c))}function j(t){t.classList.remove(D);let e=Tt(t),o=vt(e);o&&(o.removeEventListener("scroll",gt),V=!0)}function G(t){let e=t.getBoundingClientRect(),o=document.body,i=document.documentElement,n=window.pageYOffset||i.scrollTop||o.scrollTop,l=window.pageXOffset||i.scrollLeft||o.scrollLeft,c=i.clientTop||o.clientTop||0,u=i.clientLeft||o.clientLeft||0,v=e.top+n-c,g=e.left+l-u;return{top:Math.round(v),left:Math.round(g)}}function ce(t){let e=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=e[0],i=e[e.length-1];o&&o.focus(),t.addEventListener("keydown",function(n){(n.key==="Tab"||n.keyCode===9)&&(n.shiftKey?document.activeElement===o&&(i.focus(),n.preventDefault()):document.activeElement===i&&(o.focus(),n.preventDefault()))})}function Tt(t){let e=t.getAttribute("term-id");if(!e)return null;if(t.closest(".wide-container")){let i=t.closest(".wide-content");return i?i.querySelector(`[id="${e}"]`):null}return document.getElementById(e)}typeof document!="undefined"&&(document.addEventListener("click",t=>{(k(t)||!F(t))&&bt(k(t))}),document.addEventListener("keydown",t=>{var e;let o=document.getElementsByClassName(W)[0];t.key==="Enter"&&document.activeElement&&bt(document.activeElement),t.key==="Escape"&&o&&(j(o),(e=Tt(o))==null||e.focus())}),window.addEventListener("resize",()=>{let t=document.getElementsByClassName(W)[0];if(!t)return;let e=t.getAttribute("term-id")||"",o=document.getElementById(e);if(!o){t.classList.toggle(D);return}J(t,o)}));var ae="[wide-content]",de='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M7.754 2.004a.75.75 0 0 0 0 1.5h4.75v4.742a.75.75 0 0 0 1.5 0V2.754a.75.75 0 0 0-.75-.75zm.492 11.992a.75.75 0 0 0 0-1.5h-4.75V7.754a.75.75 0 0 0-1.5 0v5.492a.75.75 0 0 0 .75.75z" clip-rule="evenodd"/></svg>',ue='<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" class="close-action"><path fillRule="evenodd" clipRule="evenodd" d="M9.46967 9.46967C9.76256 9.17678 10.2374 9.17678 10.5303 9.46967L14 12.9393L17.4697 9.46967C17.7626 9.17678 18.2374 9.17678 18.5303 9.46967C18.8232 9.76256 18.8232 10.2374 18.5303 10.5303L15.0607 14L18.5303 17.4697C18.8232 17.7626 18.8232 18.2374 18.5303 18.5303C18.2374 18.8232 17.7626 18.8232 17.4697 18.5303L14 15.0607L10.5303 18.5303C10.2374 18.8232 9.76256 18.8232 9.46967 18.5303C9.17678 18.2374 9.17678 17.7626 9.46967 17.4697L12.9393 14L9.46967 10.5303C9.17678 10.2374 9.17678 9.76256 9.46967 9.46967Z" fill="var(--g-color-text-primary)" fillOpacity="0.85"/></svg>',Z=()=>{window.wideTemplate&&(window.wideTemplate.style.display="none",window.wideTemplate.content(void 0))},fe=t=>{if(t.tagName!=="TABLE")return;let e=Array.from(t.children);return e.find(n=>n.tagName==="THEAD")?void 0:e.find(n=>n.tagName==="TBODY")},pe=()=>{if(window.wideTemplate)return window.wideTemplate;let t=document.createElement("div");t.classList.add("dc-doc-page","wide-container");let e=document.createElement("div");e.classList.add("wide-content-overlay"),e.addEventListener("click",Z);let o=document.createElement("div");o.classList.add("yfm","wide-content-wrapper");let i=document.createElement("div");i.classList.add("wide-toolbar");let n=document.createElement("div");n.classList.add("wide-actions"),n.addEventListener("click",Z),n.innerHTML=ue;let l=document.createElement("p");l.classList.add("wide-entity-name"),t.label=u=>{l.innerHTML=u||""};let c=document.createElement("div");return c.classList.add("wide-content"),t.content=u=>{var v;if(typeof u=="undefined"){c.innerHTML="";return}let g=u.cloneNode(!0),_=fe(g);(v=_==null?void 0:_.classList)==null||v.add("wide-thead-content");let S=g.querySelectorAll(".yfm-term_title"),y=[];S.forEach(b=>{let w=b.getAttribute("term-key");if(w){let C=document.getElementById(w+"_element");if(C){let x=C.cloneNode(!0);y.push(x)}}}),c.replaceChildren(g,...y)},i.append(l,n),o.append(i,c),t.append(e,o),t.style.display="none",document.body.appendChild(t),window.wideTemplate=t,t},me=t=>{let e=pe();e.label(t.title),e.content(t),e.style.display="flex"},he={render:me,remove:Z},ge=t=>{var e;if((e=t.parentElement)!=null&&e.classList.contains("wide-element-wrapper"))return;t.classList.add("wide-inner-element");let o=document.createElement("div");o.innerHTML=de,o.classList.add("wide-content-viewer"),o.addEventListener("click",()=>he.render(t));let i=document.createElement("div");i.classList.add("wide-element-wrapper"),t.before(i),i.appendChild(t),i.appendChild(o)},yt=()=>{Array.from(document.querySelectorAll(ae)).forEach(ge)};typeof window!="undefined"&&typeof document!="undefined"&&window.addEventListener("load",yt);var ve=()=>{yt()};typeof window!="undefined"&&(window.patchAfterRender=ve)})();})();
|
|
7
2
|
//# sourceMappingURL=yfm.min.js.map
|