mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2026-02-06 00:00:32 -07:00
10 lines
8.9 KiB
JavaScript
10 lines
8.9 KiB
JavaScript
import{a as d}from"./react-CcTm0Ooe.js";import{P as n}from"./prop-types-CWaErGoZ.js";import{f as A,h as F,s as z,a as V}from"./property-information-CI8MXcm-.js";import{v as B}from"./unist-util-visit-SwKB2sUE.js";import{a as W}from"./@icons-BDZNmjFP.js";import{w as q}from"./hast-util-whitespace-D1ONPEmv.js";import{s as G}from"./space-separated-tokens-DD3iYX1K.js";import{s as J}from"./comma-separated-tokens-xMQ5YY98.js";import{S as K}from"./style-to-object-pmhRd-Nr.js";import{u as Q}from"./unified-DVSGJAo0.js";import{r as X}from"./remark-parse-CQxuRO-h.js";import{r as Y}from"./remark-rehype-BJ4RwZvz.js";import{V as Z}from"./vfile-BlpNzP9y.js";const L=["http","https","mailto","tel"];function ee(e){const t=(e||"").trim(),s=t.charAt(0);if(s==="#"||s==="/")return t;const l=t.indexOf(":");if(l===-1)return t;let r=-1;for(;++r<L.length;){const i=L[r];if(l===i.length&&t.slice(0,i.length).toLowerCase()===i)return t}return r=t.indexOf("?"),r!==-1&&l>r||(r=t.indexOf("#"),r!==-1&&l>r)?t:"javascript:void(0)"}function te(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{B(t,"element",(s,l,r)=>{const i=r;let f;if(e.allowedElements?f=!e.allowedElements.includes(s.tagName):e.disallowedElements&&(f=e.disallowedElements.includes(s.tagName)),!f&&e.allowElement&&typeof l=="number"&&(f=!e.allowElement(s,l,i)),f&&typeof l=="number")return e.unwrapDisallowed&&s.children?i.children.splice(l,1,...s.children):i.children.splice(l,1),l})}}var H={exports:{}},c={};/**
|
|
* @license React
|
|
* react-is.production.min.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var j=Symbol.for("react.element"),C=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),S=Symbol.for("react.context"),re=Symbol.for("react.server_context"),k=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),U;U=Symbol.for("react.module.reference");function u(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case j:switch(e=e.type,e){case g:case b:case w:case $:case v:return e;default:switch(e=e&&e.$$typeof,e){case re:case S:case k:case T:case P:case E:return e;default:return t}}case C:return t}}}c.ContextConsumer=S;c.ContextProvider=E;c.Element=j;c.ForwardRef=k;c.Fragment=g;c.Lazy=T;c.Memo=P;c.Portal=C;c.Profiler=b;c.StrictMode=w;c.Suspense=$;c.SuspenseList=v;c.isAsyncMode=function(){return!1};c.isConcurrentMode=function(){return!1};c.isContextConsumer=function(e){return u(e)===S};c.isContextProvider=function(e){return u(e)===E};c.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===j};c.isForwardRef=function(e){return u(e)===k};c.isFragment=function(e){return u(e)===g};c.isLazy=function(e){return u(e)===T};c.isMemo=function(e){return u(e)===P};c.isPortal=function(e){return u(e)===C};c.isProfiler=function(e){return u(e)===b};c.isStrictMode=function(e){return u(e)===w};c.isSuspense=function(e){return u(e)===$};c.isSuspenseList=function(e){return u(e)===v};c.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===g||e===b||e===w||e===$||e===v||e===ne||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===P||e.$$typeof===E||e.$$typeof===S||e.$$typeof===k||e.$$typeof===U||e.getModuleId!==void 0)};c.typeOf=u;H.exports=c;var le=H.exports;const oe=W(le),I={}.hasOwnProperty,ie=new Set(["table","thead","tbody","tfoot","tr"]);function _(e,t){const s=[];let l=-1,r;for(;++l<t.children.length;)r=t.children[l],r.type==="element"?s.push(se(e,r,l,t)):r.type==="text"?(t.type!=="element"||!ie.has(t.tagName)||!q(r))&&s.push(r.value):r.type==="raw"&&!e.options.skipHtml&&s.push(r.value);return s}function se(e,t,s,l){const r=e.options,i=r.transformLinkUri===void 0?ee:r.transformLinkUri,f=e.schema,a=t.tagName,o={};let R=f,y;if(f.space==="html"&&a==="svg"&&(R=z,e.schema=R),t.properties)for(y in t.properties)I.call(t.properties,y)&&ce(o,y,t.properties[y],e);(a==="ol"||a==="ul")&&e.listDepth++;const D=_(e,t);(a==="ol"||a==="ul")&&e.listDepth--,e.schema=f;const O=t.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},p=r.components&&I.call(r.components,a)?r.components[a]:a,m=typeof p=="string"||p===d.Fragment;if(!oe.isValidElementType(p))throw new TypeError(`Component for name \`${a}\` not defined or is not renderable`);if(o.key=[a,O.start.line,O.start.column,s].join("-"),a==="a"&&r.linkTarget&&(o.target=typeof r.linkTarget=="function"?r.linkTarget(String(o.href||""),t.children,typeof o.title=="string"?o.title:null):r.linkTarget),a==="a"&&i&&(o.href=i(String(o.href||""),t.children,typeof o.title=="string"?o.title:null)),!m&&a==="code"&&l.type==="element"&&l.tagName!=="pre"&&(o.inline=!0),!m&&(a==="h1"||a==="h2"||a==="h3"||a==="h4"||a==="h5"||a==="h6")&&(o.level=Number.parseInt(a.charAt(1),10)),a==="img"&&r.transformImageUri&&(o.src=r.transformImageUri(String(o.src||""),String(o.alt||""),typeof o.title=="string"?o.title:null)),!m&&a==="li"&&l.type==="element"){const x=ae(t);o.checked=x&&x.properties?!!x.properties.checked:null,o.index=N(l,t),o.ordered=l.tagName==="ol"}return!m&&(a==="ol"||a==="ul")&&(o.ordered=a==="ol",o.depth=e.listDepth),(a==="td"||a==="th")&&(o.align&&(o.style||(o.style={}),o.style.textAlign=o.align,delete o.align),m||(o.isHeader=a==="th")),!m&&a==="tr"&&l.type==="element"&&(o.isHeader=l.tagName==="thead"),r.sourcePos&&(o["data-sourcepos"]=me(O)),!m&&r.rawSourcePos&&(o.sourcePosition=t.position),!m&&r.includeElementIndex&&(o.index=N(l,t),o.siblingCount=N(l)),m||(o.node=t),D.length>0?d.createElement(p,o,D):d.createElement(p,o)}function ae(e){let t=-1;for(;++t<e.children.length;){const s=e.children[t];if(s.type==="element"&&s.tagName==="input")return s}return null}function N(e,t){let s=-1,l=0;for(;++s<e.children.length&&e.children[s]!==t;)e.children[s].type==="element"&&l++;return l}function ce(e,t,s,l){const r=A(l.schema,t);let i=s;i==null||i!==i||(Array.isArray(i)&&(i=r.commaSeparated?J(i):G(i)),r.property==="style"&&typeof i=="string"&&(i=fe(i)),r.space&&r.property?e[I.call(F,r.property)?F[r.property]:r.property]=i:r.attribute&&(e[r.attribute]=i))}function fe(e){const t={};try{K(e,s)}catch{}return t;function s(l,r){const i=l.slice(0,4)==="-ms-"?`ms-${l.slice(4)}`:l;t[i.replace(/-([a-z])/g,ue)]=r}}function ue(e,t){return t.toUpperCase()}function me(e){return[e.start.line,":",e.start.column,"-",e.end.line,":",e.end.column].map(String).join("")}const M={}.hasOwnProperty,de="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",h={plugins:{to:"remarkPlugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function pe(e){for(const i in h)if(M.call(h,i)&&M.call(e,i)){const f=h[i];console.warn(`[react-markdown] Warning: please ${f.to?`use \`${f.to}\` instead of`:"remove"} \`${i}\` (see <${de}#${f.id}> for more info)`),delete h[i]}const t=Q().use(X).use(e.remarkPlugins||[]).use(Y,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(te,e),s=new Z;typeof e.children=="string"?s.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const l=t.runSync(t.parse(s),s);if(l.type!=="root")throw new TypeError("Expected a `root` node");let r=d.createElement(d.Fragment,{},_({options:e,schema:V,listDepth:0},l));return e.className&&(r=d.createElement("div",{className:e.className},r)),r}pe.propTypes={children:n.string,className:n.string,allowElement:n.func,allowedElements:n.arrayOf(n.string),disallowedElements:n.arrayOf(n.string),unwrapDisallowed:n.bool,remarkPlugins:n.arrayOf(n.oneOfType([n.object,n.func,n.arrayOf(n.oneOfType([n.bool,n.string,n.object,n.func,n.arrayOf(n.any)]))])),rehypePlugins:n.arrayOf(n.oneOfType([n.object,n.func,n.arrayOf(n.oneOfType([n.bool,n.string,n.object,n.func,n.arrayOf(n.any)]))])),sourcePos:n.bool,rawSourcePos:n.bool,skipHtml:n.bool,includeElementIndex:n.bool,transformLinkUri:n.oneOfType([n.func,n.bool]),linkTarget:n.oneOfType([n.func,n.string]),transformImageUri:n.func,components:n.object};export{pe as R};
|