UnisMindMap/web_ui/public/markmap/markmap-view.js

10 lines
25 KiB
JavaScript
Raw Permalink Normal View History

/**
* Minified by jsDelivr using Terser v5.39.0.
* Original file: /npm/markmap-view@0.18.12/dist/browser/index.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
!function(t,e){"use strict";const n=Math.random().toString(36).slice(2,8);let r=0;function i(){}function a(t,e){const n=(t,r)=>e(t,(()=>{var e;return null==(e=t.children)?void 0:e.map((e=>n(e,t)))}),r);return n(t)}function s(){const t={};return t.promise=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),t}
/*! @gera2ld/jsx-dom v2.2.2 | ISC License */
const o="http://www.w3.org/1999/xlink",l={show:o,actuate:o,href:o};function h(t,e,...n){return function(t,e){let n;if("string"==typeof t)n=1;else{if("function"!=typeof t)throw new Error("Invalid VNode type");n=2}return{vtype:n,type:t,props:e}}(t,e=Object.assign({},e,{children:1===n.length?n[0]:n}))}function c(t){return t.children}const d={isSvg:!1};function p(t,e){Array.isArray(e)||(e=[e]),(e=e.filter(Boolean)).length&&t.append(...e)}const u={className:"class",labelFor:"for"};function g(t,e,n,r){if(e=u[e]||e,!0===n)t.setAttribute(e,"");else if(!1===n)t.removeAttribute(e);else{const i=r?l[e]:void 0;void 0!==i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}}function m(t,e){return Array.isArray(t)?t.map((t=>m(t,e))).reduce(((t,e)=>t.concat(e)),[]):f(t,e)}function f(t,e=d){if(null==t||"boolean"==typeof t)return null;if(t instanceof Node)return t;if(2===(null==(n=t)?void 0:n.vtype)){const{type:n,props:r}=t;if(n===c){const t=document.createDocumentFragment();if(r.children){p(t,m(r.children,e))}return t}return f(n(r),e)}var n;if((t=>"string"==typeof t||"number"==typeof t)(t))return document.createTextNode(`${t}`);if((t=>1===(null==t?void 0:t.vtype))(t)){let n;const{type:r,props:i}=t;if(e.isSvg||"svg"!==r||(e=Object.assign({},e,{isSvg:!0})),n=e.isSvg?document.createElementNS("http://www.w3.org/2000/svg",r):document.createElement(r),function(t,e,n){for(const r in e)if("key"!==r&&"children"!==r&&"ref"!==r)if("dangerouslySetInnerHTML"===r)t.innerHTML=e[r].__html;else if("innerHTML"===r||"textContent"===r||"innerText"===r||"value"===r&&["textarea","select"].includes(t.tagName)){const n=e[r];null!=n&&(t[r]=n)}else r.startsWith("on")?t[r.toLowerCase()]=e[r]:g(t,r,e[r],n.isSvg)}(n,i,e),i.children){let t=e;e.isSvg&&"foreignObject"===r&&(t=Object.assign({},t,{isSvg:!1}));const a=m(i.children,t);null!=a&&p(n,a)}const{ref:a}=i;return"function"==typeof a&&a(n),n}throw new Error("mount: Invalid Vnode!")}function v(...t){return f(h(...t))}const y=function(t){const e={};return function(...n){const r=`${n[0]}`;let i=e[r];return i||(i={value:t(...n)},e[r]=i),i.value}}((t=>{document.head.append(v("link",{rel:"preload",as:"script",href:t}))})),x={},k={};async function w(t,e){var n;const r="script"===t.type&&(null==(n=t.data)?void 0:n.src)||"";if(t.loaded||(t.loaded=x[r]),!t.loaded){const n=s();if(t.loaded=n.promise,"script"===t.type&&(document.head.append(v("script",{...t.data,onLoad:()=>n.resolve(),onError:n.reject})),r?x[r]=t.loaded:n.resolve()),"iife"===t.type){const{fn:r,getParams:i}=t.data;r(...(null==i?void 0:i(e))||[]),n.resolve()}}await t.loaded}const b="undefined"!=typeof navigator&&navigator.userAgent.includes("Macintosh"),z=e.scaleOrdinal(e.schemeCategory10),S=(t=1,e=3,n=2)=>r=>t+e/n**r.state.depth,E={autoFit:!1,duration:500,embedGlobalCSS:!0,fitRatio:.95,maxInitialScale:2,scrollForPan:b,initialExpandLevel:-1,zoom:!0,pan:!0,toggleRecursively:!1,color:t=>{var e;return z(`${(null==(e=t.state)?void 0:e.path)||""}`)},lineWidth:S(),maxWidth:0,nodeMinHeight:16,paddingX:8,spacingHorizontal:80,spacingVertical:5};function C(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return(e>>>0).toString(36)}function X(t){if("string"==typeof t){const e=t;t=t=>t.matches(e)}const e=t;return function(){let t=Array.from(this.childNodes);return e&&(t=t.filter((t=>e(t)))),t}}function A(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function j(t,e){var n,r,i,a,s,o=new M(t),l=+t.value&&(o.value=t.value),h=[o];for(null==e&&(e=R);n=h.pop();)if(l&&(n.value=+n.data.value),(i=e(n.data))&&(s=i.length))for(n.children=new Array(s),a=s-1;a>=0;--a)h.push(r=n.children[a]=new M(i[a])),r.parent=n,r.depth=n.depth+1;return o.eachBefore($)}function R(t){return t.children}function O(t){t.data=t.data.data}function $(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function M(t){this.data=t,this.depth=this.height=0,this.parent=null}M.prototype=j.prototype={constructor:M,count:function(){return this.eachAfter(A)},each:function(t){var e,n,r,i,a=this,s=[a];do{for(e=s.reverse(),s=[];a=e.pop();)if(t(a),n=a.children)for(
//# sourceMappingURL=/sm/110abf9063f6ee4fb04c8b1324a7593e2b618205c89e4a3ba636f91260ce2b5d.map