@diplodoc/cli 5.22.1 → 5.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ (()=>{var e,t,r,n={66008(){var e,t;"u">typeof Element&&((t=(e=Element.prototype).matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector)?e.matches=e.matchesSelector=t:e.matches=e.matchesSelector=function(e){var t=this;return Array.prototype.some.call(document.querySelectorAll(e),function(e){return e===t})})},77628(e,t,r){"use strict";var n,o=r(71893),a=r(74848),i=r(96540),c=r(5338),u=r(33324),l=r(78184),s=r(81836),d=r(12905),h=(0,i.createContext)({pathname:"/",depth:0});h.displayName="RouterContext";var f=h.Provider,p=(0,i.createContext)(l.JA.En);p.displayName="Lang";var g=p.Provider,v=r(60478),m={theme:l.Sx.Light,textSize:l.ov.M,showMiniToc:!0,wideFormat:!0,fullScreen:!1},y=["ar","arc","ckb","dv","fa","ha","he","khw","ks","ps","sd","ur","uz_AF","yi"],w=((n={}).RTL="rtl",n.LTR="ltr",n);function _(){return"u">typeof document}(0,v._)(new Set((0,v._)(["href"]).concat((0,v._)(["src","url","href","icon","image","desktop","mobile","tablet","previewImg","image","avatar","logo","light","dark"]))));var b=function(e){return"boolean"==typeof e?e:!!e&&"true"===e};function S(){return!!_()&&document.body.clientWidth<769}function x(e){if(!_())return m[e];try{return sessionStorage.getItem(e)||m[e]}catch(t){return m[e]}}var k=r(50467),C=r(53014);function j(e,t){var r=(0,C._)((0,i.useState)(t[e]),2),n=r[0],o=r[1],a=(0,i.useMemo)(function(){var t,r;return t=e,r=o,function(e){if(_())try{sessionStorage.setItem(t,String(e))}catch(e){}r(e)}},[e,o]);return(0,i.useMemo)(function(){var t;return t={},(0,k._)(t,e,n),(0,k._)(t,"onChange"+e.replace(/^./,function(e){return e.toUpperCase()}),a),t},[e,n,a])}var L=r(51937),M=r(23614),E=r(55456);r(20553),r(66008),r(6429);var O=(0,M.default)("Layout");function T(){return null}function N(){return null}function P(){return null}var R={doc:!1},A=function(e){var t,r,n,c=(0,o._)({},R,e),u=c.children,l=c.doc,s=c.headerHeight;return i.Children.forEach(u,function(e){switch(e.type){case T:t=e.props.children;break;case N:r=e.props.children;break;case P:n=e.props.children}}),(0,a.jsxs)("div",{className:O({"full-header":(void 0===s?0:s)>0}),children:[t&&(0,a.jsx)("div",{className:O("header"),children:t}),(0,a.jsxs)("div",{className:O("body"),children:[r&&(0,a.jsx)("div",{className:O("content"),children:r}),n&&(0,a.jsx)("div",{className:O("footer",{doc:l}),children:n})]})]})};A.displayName="Layout",A.Header=T,A.Content=N,A.Footer=P,(0,M.default)("pc-page-constructor"),(0,M.default)("pc-constructor-row"),(0,M.default)("Suggest");var q=r(26141),F=r(25346);(0,i.memo)(function(e){var t=e.mobileView,r=e.theme,n=e.onChangeTheme,o=e.textSize,i=e.onChangeTextSize,c=e.wideFormat,u=e.onChangeWideFormat,s=e.showMiniToc,d=e.onChangeShowMiniToc,h=e.lang,f=e.langs,p=e.onChangeLang,g=e.availableLangs;return(0,a.jsx)(q.n,{controlClassName:"Control",controlSize:l.Uv.L,isWideView:t,isMobileView:t,children:(0,a.jsx)(F.A,{className:"Controls",theme:r,onChangeTheme:n,wideFormat:c,onChangeWideFormat:u,showMiniToc:s,onChangeShowMiniToc:d,textSize:o,onChangeTextSize:i,lang:h,langs:f,onChangeLang:p,availableLangs:void 0===g?[]:g})})}).displayName="HeaderControls",r(58498),r(89457),r(57016),r(81397),r(59071);var z=r(41374),U=r(30494),I=r(99407),W=r(53750),V=r(51735),B=function(){function e(t){var n=this,a=this;(0,U._)(this,e),(0,k._)(this,"worker",void 0),(0,k._)(this,"config",void 0),(0,k._)(this,"init",function(){var e;e=(0,E._)((0,o._)({},n.config),{base:n.base,mark:"Suggest__Item__Marker"}),n.worker=(0,z._)(function(){var t;return(0,V._)(this,function(n){switch(n.label){case 0:return[4,(0,z._)(function(){var e,t,n;return(0,V._)(this,function(o){try{return[2,new Worker(new URL(r.p+r.u("976"),r.b))]}catch(r){if((0,W._)(r,DOMException)&&(e=H.exec(r.message)))return t=e[1],n=new Blob(["importScripts('".concat(t,"');")],{type:"text/javascript"}),[2,new Worker(URL.createObjectURL(n))];throw r}})})()];case 1:return[4,J(t=n.sent(),(0,E._)((0,o._)({},e),{type:"init"}))];case 2:return n.sent(),[2,t]}})})()}),(0,k._)(this,"link",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=new URLSearchParams;r&&o.set("query",r),n>1&&o.set("page",n.toString());var a=o.toString()?"?".concat(o.toString()):"";return"".concat(e,"/").concat(t.link).concat(a)}(a.base,a.config,e,t)}),this.config=t}return(0,I._)(e,[{key:"suggest",value:function(e){return(0,z._)(function(){return(0,V._)(this,function(t){return[2,this.request({type:"suggest",query:e})]})}).call(this)}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return(0,z._)(function(){return(0,V._)(this,function(n){return[2,this.request({type:"search",query:e,page:t,count:r})]})}).call(this)}},{key:"base",get:function(){return window.location.href.split("/").slice(0,-this.config.depth).join("/")}},{key:"request",value:function(e){return(0,z._)(function(){return(0,V._)(this,function(t){switch(t.label){case 0:return[4,this.worker];case 1:return[2,J.apply(void 0,[t.sent(),e])]}})}).call(this)}}]),e}(),H=/Script at '(.*?)' cannot be accessed from origin/;function J(e,t){var r=new MessageChannel;return new Promise(function(n,o){r.port1.onmessage=function(e){e.data.error?o(e.data.error):n(e.data.result)},r.port1.onmessageerror=function(e){o(e.data.error)},e.postMessage(t,[r.port2])})}var $=(0,M.default)("Search");function D(e,t){var r=new URLSearchParams;e&&r.set("query",e),t>1&&r.set("page",String(t)),window.history.pushState({},"","?".concat(r.toString()))}var K=function(){var e,t,r,n,c,u,l,s,d=(e=(0,i.useContext)(p),r=void 0===(t=(0,i.useContext)(h).depth)?0:t,n=(0,i.useContext)(G),u=(c=(0,C._)((0,i.useState)(null),2))[0],l=c[1],s=(0,i.useMemo)(function(){return n?(0,E._)((0,o._)({},n),{depth:r,lang:e}):null},[e,r,n]),(0,i.useEffect)(function(){s&&l(s?new B(s):null)},[s]),u),f=(0,i.useContext)(h),g=(0,C._)((0,i.useState)(""),2),v=g[0],m=g[1],y=(0,C._)((0,i.useState)(1),2),w=y[0],_=y[1],b=(0,C._)((0,i.useState)([]),2),S=b[0],x=b[1],k=(0,C._)((0,i.useState)(0),2),j=k[0],M=k[1],O=(0,C._)((0,i.useState)(!1),2),T=O[0],N=O[1],P=(0,i.useRef)(null);(0,i.useEffect)(function(){var e;P.current=d,null==d||null==(e=d.init)||e.call(d)},[d]),(0,i.useEffect)(function(){var e,t={query:(e=new URLSearchParams(window.location.search)).get("query")||"",page:Number(e.get("page"))||1},r=t.query,n=t.page;m(r),_(n)},[f]),(0,i.useEffect)(function(){v&&P.current?(N(!0),P.current.search(v,w,10).then(function(e){var t,r=e.items,n=e.total;x(Array.isArray(t=null!=r?r:[])?t.map(function(e){var t,r,n;return{title:(null==e?void 0:e.title)||(null==e||null==(t=e.hierarchy)?void 0:t.lvl0)||(null==e||null==(r=e.hierarchy)?void 0:r.lvl1)||"",url:(null==e?void 0:e.url)||(null==e?void 0:e.link)||"#",description:(null==e?void 0:e.description)||(null==e?void 0:e.content)||(null==e?void 0:e.text)||"",section:(null==e?void 0:e.section)||(null==e||null==(n=e.hierarchy)?void 0:n.lvl1)||""}}):[]),M(n)}).catch(function(){x([]),M(0)}).finally(function(){return N(!1)})):(x([]),M(0))},[v,w,d]);var R=(0,i.useCallback)(function(e){D(v,e),_(e)},[v]),A=(0,i.useCallback)(function(e){D(e,1),m(e),_(1)},[]);return(0,a.jsx)("div",{className:$(),children:(0,a.jsx)(L.A,{query:v,items:S,page:w,totalItems:j,onPageChange:R,onSubmit:A,loading:T})})},G=(0,i.createContext)(null);G.displayName="SearchContext";var Q=G.Provider,X=document.getElementById("root");if(!X)throw Error("Root element not found!");var Y=window.__DATA__,Z=Y||{};Z.depth=Z.depth||3;var ee=new URL(window.location.href);(0,c.createRoot)(X).render((0,a.jsx)(function(e){var t,r,n,c,h,p,v,m,k,L,M,E,O,T,N,P=e.data,R=e.url,A=P.search,q=(null==A?void 0:A.lang)||l.JA.En,F=(v=j("theme",(t=x("theme"),r=x("textSize"),n=x("showMiniToc"),c=x("wideFormat"),h=x("fullScreen"),p={theme:t,textSize:r,showMiniToc:b(n),wideFormat:b(c),fullScreen:b(h)})),m=j("textSize",p),k=j("wideFormat",p),L=j("fullScreen",p),M=j("showMiniToc",p),(0,i.useMemo)(function(){return(0,o._)({},v,m,k,M,L)},[v,m,k,M,L])),z=(O=(E=(0,C._)((0,i.useState)(S()),2))[0],T=E[1],N=(0,i.useCallback)(function(){T(S())},[]),(0,i.useEffect)(N,[N]),(0,i.useEffect)(function(){return window.addEventListener("resize",N),function(){return window.removeEventListener("resize",N)}},[N]),O),U=s.Lq.includes(q)?q:l.JA.En,I=y.includes(U)?w.RTL:w.LTR;(0,d.jK)({lang:U,localeCode:U});var W={pathname:R.pathname,depth:3},V=F.theme,B=F.wideFormat;return(0,i.useEffect)(function(){var e={mobileView:z,wideFormat:B};if(_()){document.body.classList.add("g-root");var t=function(e,t){return document.body.classList.toggle(e,!!t)};Object.keys(e).forEach(function(r){switch(r){case"wideFormat":t("dc-root_wide-format",e[r]);break;case"focusSearch":t("dc-root_focused-search",e[r]);break;case"fullScreen":t("dc-root_full-screen",e[r]);break;case"landingPage":t("dc-root_document-page",!e[r]),t("dc-root_landing-page",e[r]);break;case"mobileView":t("mobile",e[r]),t("desktop",!e[r])}})}"u">typeof document&&document.querySelectorAll(".g-root").forEach(function(e){e.classList.toggle("g-root_theme_light","light"===V),e.classList.toggle("g-root_theme_dark","dark"===V)})},[V,z,B]),(0,a.jsx)(u.N,{theme:V,direction:I,children:(0,a.jsx)(g,{value:U,children:(0,a.jsx)(f,{value:W,children:(0,a.jsx)(Q,{value:A,children:(0,a.jsx)(K,{})})})})})},(0,o._)({},{data:Y,url:ee})))},98010(e,t,r){"use strict";function n(){}r.d(t,{A:()=>n})},14892(){},4320(){},80657(){},91190(){},7155(){},54318(){}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={id:e,loaded:!1,exports:{}};return n[e].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}a.m=n,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);a.r(r);var n={};i=i||[null,c({}),c([]),c(c)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~i.indexOf(o);o=c(o))Object.getOwnPropertyNames(o).forEach(t=>{n[t]=()=>e[t]});return n.default=()=>e,a.d(r,n),r},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.u=e=>""+e+"-40cbc1d2518eb8ea.js",a.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),u=[],a.O=(e,t,r,n)=>{if(t){n=n||0;for(var o=u.length;o>0&&u[o-1][2]>n;o--)u[o]=u[o-1];u[o]=[t,r,n];return}for(var i=1/0,o=0;o<u.length;o++){for(var[t,r,n]=u[o],c=!0,l=0;l<t.length;l++)(!1&n||i>=n)&&Object.keys(a.O).every(e=>a.O[e](t[l]))?t.splice(l--,1):(c=!1,n<i&&(i=n));if(c){u.splice(o--,1);var s=r();void 0!==s&&(e=s)}}return e},a.rv=()=>"1.7.4",a.j="328",a.g.importScripts&&(l=a.g.location+"");var i,c,u,l,s=a.g.document;if(!l&&s&&(s.currentScript&&"SCRIPT"===s.currentScript.tagName.toUpperCase()&&(l=s.currentScript.src),!l)){var d=s.getElementsByTagName("script");if(d.length)for(var h=d.length-1;h>-1&&(!l||!/^http(s?):/.test(l));)l=d[h--].src}if(!l)throw Error("Automatic publicPath is not supported in this browser");a.p=l=l.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.b=document.baseURI||self.location.href,e={328:0},a.O.j=t=>0===e[t],t=(t,r)=>{var n,o,[i,c,u]=r,l=0;if(i.some(t=>0!==e[t])){for(n in c)a.o(c,n)&&(a.m[n]=c[n]);if(u)var s=u(a)}for(t&&t(r);l<i.length;l++)o=i[l],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(s)},(r=self.webpackChunk_diplodoc_client=self.webpackChunk_diplodoc_client||[]).forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r)),a.ruid="bundler=rspack@1.7.4";var f=a.O(void 0,["85","474"],()=>a(77628));f=a.O(f)})();
2
+ //# sourceMappingURL=search-b6246854f4238deb.js.map