rhua-chatgpt-web 1.1.5 → 1.1.7
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/{api_chain-EzupCauA.js → api_chain-8rLd0TuD.js} +2 -2
- package/dist/{api_chain-CQbpemiQ.cjs → api_chain-DBmoQA_7.cjs} +1 -1
- package/dist/{combine_docs_chain-CYSCkppE.js → combine_docs_chain-BH4-g2GW.js} +2 -2
- package/dist/{combine_docs_chain-BRxg6UtZ.cjs → combine_docs_chain-DfTwsFo0.cjs} +1 -1
- package/dist/{few_shot-q_TnpUqa.js → few_shot-DJCpSBvt.js} +1 -1
- package/dist/{few_shot-DfTvwnAe.cjs → few_shot-DQaRrbJw.cjs} +1 -1
- package/dist/{index-Z4SoiuPK.js → index-BAXNGSXw.js} +1 -1
- package/dist/{index-CJL6IhdJ.js → index-BDxCvrgc.js} +1 -1
- package/dist/{index-xlf6-zoR.cjs → index-BQO11CzB.cjs} +1 -1
- package/dist/index-B_x2i-jO.js +4 -0
- package/dist/{index-DAVe9cfb.js → index-BaQU1IvP.js} +320 -33
- package/dist/index-C8LQxWL1.js +4 -0
- package/dist/{index-gSOuomS5.js → index-CD6GBfkZ.js} +1 -1
- package/dist/{index-BnjwO3Bw.cjs → index-CFln1NC2.cjs} +1 -1
- package/dist/{index-DWYbc6d-.cjs → index-CUnp2vsA.cjs} +1 -1
- package/dist/{index-DXTOnzOs.js → index-CXpHNR4F.js} +1 -1
- package/dist/index-CYDd-qnF.js +4 -0
- package/dist/{index-DXa2ayFF.cjs → index-CvCPvUjj.cjs} +1 -1
- package/dist/{index-KdW7xIM8.cjs → index-DFYcGKuT.cjs} +31 -31
- package/dist/index-DH4SzrZB.js +4 -0
- package/dist/{index-DZFTEz-j.cjs → index-DRg4CNkS.cjs} +1 -1
- package/dist/{index-BfavGjvq.js → index-Dy-SzFud.js} +2 -2
- package/dist/{index-D__lg2sO.cjs → index-FAGD8ZFV.cjs} +1 -1
- package/dist/{index-BI4EdlAm.js → index-GSRYlXZ2.js} +1 -1
- package/dist/{index-Chp1R4-v.cjs → index-PQbFNXZe.cjs} +1 -1
- package/dist/{index-CtXnaw8Y.cjs → index-VviEQjAE.cjs} +1 -1
- package/dist/{index-CgCXN3R6.js → index-Wbrx5M_5.js} +2 -2
- package/dist/{index-ybRvvKbH.cjs → index-faFDPW0m.cjs} +1 -1
- package/dist/{index-DT9dJ8WJ.cjs → index-jiGOdiuu.cjs} +1 -1
- package/dist/{index-DEbJFy6H.cjs → index-xDEsnKsG.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-CC8FXRVt.cjs → index.es-DUhQYmQQ.cjs} +3 -3
- package/dist/{index.es-BV1sWnV8.js → index.es-Ofj7pWXh.js} +60 -59
- package/dist/index.esm.js +6 -5
- package/dist/{llm_chain-zANp5jfK.js → llm_chain-D_TCnPCU.js} +1 -1
- package/dist/{llm_chain-Bv5-BS50.cjs → llm_chain-uxhdn-1W.cjs} +1 -1
- package/dist/{sequential_chain-Bw8lqqn7.js → sequential_chain-BIzQ7CWb.js} +1 -1
- package/dist/{sequential_chain-_P-m2t1s.cjs → sequential_chain-CMYssdOR.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{vector_db_qa-CSVVrc_O.cjs → vector_db_qa-Bf6oOghB.cjs} +1 -1
- package/dist/{vector_db_qa-CIJfQI3s.js → vector_db_qa-DnXdDGBx.js} +3 -3
- package/package.json +135 -135
- package/dist/index-BcSVqRCu.js +0 -4
- package/dist/index-CjhpPaDq.js +0 -4
- package/dist/index-CvsV56bR.js +0 -4
- package/dist/index-DP9UqkZn.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DFYcGKuT.cjs");exports.default=e.remarkRehype,exports.defaultFootnoteBackContent=e.defaultFootnoteBackContent,exports.defaultFootnoteBackLabel=e.defaultFootnoteBackLabel,exports.defaultHandlers=e.handlers;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as minifyWhitespace, e as embedded, p as phrasing } from "./index-
|
|
2
|
-
import { v as visitParents, S as SKIP, w as whitespace } from "./index-
|
|
1
|
+
import { m as minifyWhitespace, e as embedded, p as phrasing } from "./index-CXpHNR4F.js";
|
|
2
|
+
import { v as visitParents, S as SKIP, w as whitespace } from "./index-BaQU1IvP.js";
|
|
3
3
|
const whitespaceSensitiveTagNames = [
|
|
4
4
|
"pre",
|
|
5
5
|
"script",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BQO11CzB.cjs"),t=require("./index-DFYcGKuT.cjs"),n=["pre","script","style","textarea"],i={};function a(e,t){return Boolean(t&&"element"===t.type&&e.blanks.length>0&&e.blanks.includes(t.tagName))}function l(t,n){return"root"===n.type||"element"===n.type&&(t.head||"script"===n.tagName||e.embedded(n)||!e.phrasing(n))}exports.default=function(r){return function(c){!function(r,c){const d=c||i,s={blanks:d.blanks||[],head:!1,indentInitial:!1!==d.indentInitial,indent:"number"==typeof d.indent?" ".repeat(d.indent):"string"==typeof d.indent?d.indent:" "};function o(e,n,i){const l=e[e.length-1],r=l&&t.whitespace(l)?e[e.length-2]:l,c=(a(s,r)&&a(s,i)?"\n\n":"\n")+s.indent.repeat(Math.max(n,0));l&&"text"===l.type?l.value=t.whitespace(l)?c:l.value+c:e.push({type:"text",value:c})}e.minifyWhitespace(r,{newlines:!0}),t.visitParents(r,function(e,i){if(!("children"in e))return;if("element"===e.type&&"head"===e.tagName&&(s.head=!0),s.head&&"element"===e.type&&"body"===e.tagName&&(s.head=!1),"element"===e.type&&n.includes(e.tagName))return t.SKIP;if(0===e.children.length||!l(s,e))return;let a=i.length;s.indentInitial||a--;let r=!1;for(const t of e.children)"comment"!==t.type&&"text"!==t.type||(t.value.includes("\n")&&(r=!0),t.value=t.value.replace(/ *\n/g,"$&"+s.indent.repeat(a)));const c=[];let d;for(const t of e.children)(l(s,t)||r&&!d)&&(o(c,a,t),r=!0),d=t,c.push(t);d&&(r||l(s,d))&&(t.whitespace(d)&&(c.pop(),d=c[c.length-1]),o(c,a-1)),e.children=c})}(c,r)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DFYcGKuT.cjs");exports.default=e.remarkParse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-KdW7xIM8.cjs"),e=require("./index-xlf6-zoR.cjs");function n(t){const e=String(t);let n=e.length;for(;n>0;){const t=e.codePointAt(n-1);if(void 0===t||10!==t&&13!==t)break;n--}return e.slice(0,n)}const r="language-";function i(e,i){const l=i.children;let o,c,s=-1;if("pre"===i.tagName)for(;++s<l.length;){const t=l[s];if("element"===t.type&&"code"===t.tagName&&t.properties&&t.properties.className&&Array.isArray(t.properties.className)){o=t.properties.className;break}}if(o)for(s=-1;++s<o.length;)if(String(o[s]).slice(0,9)===r){c=String(o[s]).slice(9);break}const a={type:"code",lang:c||null,meta:null,value:n(t.toText(i))};return e.patch(i,a),a}function l(t,e){const n={type:"delete",children:t.all(e)};return t.patch(e,n),n}function o(t){let e=-1;if(t.length>1)for(;++e<t.length;)if(t[e].spread)return!0;return!1}function c(t,e){const n=t.all({type:"root",children:e}),r=t.toSpecificContent(n,s);return 0===r.length?[]:1===r.length?r[0].children:[{type:"list",ordered:!1,start:null,spread:o(r),children:r}]}function s(){return{type:"listItem",spread:!1,checked:null,children:[]}}function a(t,e){const n={type:"emphasis",children:t.all(e)};return t.patch(e,n),n}function p(t){let e=0,n=t.length;for(;e<n&&"break"===t[e].type;)e++;for(;n>e&&"break"===t[n-1].type;)n--;return 0===e&&n===t.length?t:t.slice(e,n)}function u(t,e){const n={type:"heading",depth:Number(e.tagName.charAt(1))||1,children:p(t.all(e))};return t.patch(e,n),n}function h(t,e){const n=e.properties||{},r={type:"image",url:t.resolve(String(n.src||"")||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):""};return t.patch(e,r),r}function d(e,n){const r={type:"inlineCode",value:t.toText(n)};return e.patch(n,r),r}function f(e,n){const r=[],i=[],l=n||e.properties||{},o=g(e),c=Math.min(Number.parseInt(String(l.size),10),0)||(l.multiple?4:1);let s=-1;for(;++s<o.length;){const t=o[s];t&&t.properties&&t.properties.selected&&r.push(t)}const a=r.length>0?r:o,p=Math.min(a.length,c);for(s=-1;++s<p;){const e=a[s],n=e.properties||{},r=t.toText(e),l=r||String(n.label||""),o=String(n.value||"")||r;i.push([o,l===o?void 0:l])}return i}function g(t){const e=[];let n=-1;for(;++n<t.children.length;){const r=t.children[n];"children"in r&&Array.isArray(r.children)&&e.push(...g(r)),"element"!==r.type||"option"!==r.tagName||r.properties&&r.properties.disabled||e.push(r)}return e}function y(t,e){const{rest:n,checkbox:r}=b(e),i=r?Boolean(r.properties.checked):null,l={type:"listItem",spread:m(n),checked:i,children:t.toFlow(t.all(n))};return t.patch(e,l),l}function m(t){let n=-1,r=!1;for(;++n<t.children.length;){const i=t.children[n];if("element"===i.type){if(e.phrasing(i))continue;if("p"===i.tagName||r||m(i))return!0;r=!0}}return!1}function b(t){const e=t.children[0];if(e&&"element"===e.type&&"input"===e.tagName&&e.properties&&("checkbox"===e.properties.type||"radio"===e.properties.type)){return{checkbox:e,rest:{...t,children:t.children.slice(1)}}}if(e&&"element"===e.type&&"p"===e.tagName){const{checkbox:n,rest:r}=b(e);if(n){return{checkbox:n,rest:{...t,children:[r,...t.children.slice(1)]}}}}return{checkbox:void 0,rest:t}}function v(t,e){const n="ol"===e.tagName,r=t.toSpecificContent(t.all(e),S);let i=null;n&&(i=e.properties&&e.properties.start?Number.parseInt(String(e.properties.start),10):1);const l={type:"list",ordered:n,start:i,spread:o(r),children:r};return t.patch(e,l),l}function S(){return{type:"listItem",spread:!1,checked:null,children:[]}}function x(t){let e=-1;for(;++e<t.length;){const n=t[e];if(!w(n)||"children"in n&&x(n.children))return!0}return!1}function k(e){return T(e,function(e){return e.every(function(e){return"text"===e.type&&t.whitespace(e.value)})?[]:[{type:"paragraph",children:p(e)}]},function(t){return t})}function N(t){return T(t.children,function(e){const n=C(t);return n.children=e,[n]},function(e){if("children"in e&&"children"in t){const n=C(t),r=C(e);return n.children=e.children,r.children.push(n),r}return{...e}})}function T(t,e,n){const r=function(t){const e=[];let n=-1;for(;++n<t.length;){const r=t[n];"delete"!==r.type&&"link"!==r.type||!x(r.children)?e.push(r):e.push(...N(r))}return e}(t),i=[];let l=[],o=-1;for(;++o<r.length;){const t=r[o];w(t)?l.push(t):(l.length>0&&(i.push(...e(l)),l=[]),i.push(n(t)))}return l.length>0&&(i.push(...e(l)),l=[]),i}function w(n){const r=n.data&&n.data.hName;return r?e.phrasing({type:"element",tagName:r,properties:{},children:[]}):t.phrasing(n)}function C(e){return t.structuredClone({...e,children:[]})}function I(e,n){const r=n.properties||{},i="video"===n.tagName?String(r.poster||""):"";let l=String(r.src||""),o=-1,c=!1,s=e.all(n);const a={type:"root",children:s};if(t.visit(a,function(e){if("link"===e.type)return c=!0,t.EXIT}),c||x(s))return s;for(;!l&&++o<n.children.length;){const t=n.children[o];"element"===t.type&&"source"===t.tagName&&t.properties&&(l=String(t.properties.src||""))}if(i){const r={type:"image",title:null,url:e.resolve(i),alt:t.toString(s)};e.patch(n,r),s=[r]}const p=s,u={type:"link",title:r.title?String(r.title):null,url:e.resolve(l),children:p};return e.patch(n,u),u}function M(t,e){const n=p(t.all(e));if(n.length>0){const r={type:"paragraph",children:n};return t.patch(e,r),r}}const A=['"'];function U(t,e){const n={type:"strong",children:t.all(e)};return t.patch(e,n),n}function q(t,e){const n={type:"tableCell",children:t.all(e)};if(t.patch(e,n),e.properties){const t=e.properties.rowSpan,r=e.properties.colSpan;if(t||r){const e=n.data||(n.data={});t&&(e.hastUtilToMdastTemporaryRowSpan=t),r&&(e.hastUtilToMdastTemporaryColSpan=r)}}return n}function B(){return{type:"tableCell",children:[]}}function R(){return{type:"tableCell",children:[]}}function j(){return{type:"tableRow",children:[]}}const F={comment:function(t,e){const n={type:"html",value:"\x3c!--"+e.value+"--\x3e"};return t.patch(e,n),n},doctype:O,root:function(t,e){let n=t.all(e);(t.options.document||x(n))&&(n=k(n));const r={type:"root",children:n};return t.patch(e,r),r},text:function(t,e){const n={type:"text",value:e.value};return t.patch(e,n),n}},z={applet:O,area:O,basefont:O,bgsound:O,caption:O,col:O,colgroup:O,command:O,content:O,datalist:O,dialog:O,element:O,embed:O,frame:O,frameset:O,isindex:O,keygen:O,link:O,math:O,menu:O,menuitem:O,meta:O,nextid:O,noembed:O,noframes:O,optgroup:O,option:O,param:O,script:O,shadow:O,source:O,spacer:O,style:O,svg:O,template:O,title:O,track:O,abbr:H,acronym:H,bdi:H,bdo:H,big:H,blink:H,button:H,canvas:H,cite:H,data:H,details:H,dfn:H,font:H,ins:H,label:H,map:H,marquee:H,meter:H,nobr:H,noscript:H,object:H,output:H,progress:H,rb:H,rbc:H,rp:H,rt:H,rtc:H,ruby:H,slot:H,small:H,span:H,sup:H,sub:H,tbody:H,tfoot:H,thead:H,time:H,address:P,article:P,aside:P,body:P,center:P,div:P,fieldset:P,figcaption:P,figure:P,form:P,footer:P,header:P,hgroup:P,html:P,legend:P,main:P,multicol:P,nav:P,picture:P,section:P,a:function(t,e){const n=e.properties||{},r=t.all(e),i={type:"link",url:t.resolve(String(n.href||"")||null),title:n.title?String(n.title):null,children:r};return t.patch(e,i),i},audio:I,b:U,base:function(t,e){t.baseFound||(t.frozenBaseUrl=String(e.properties&&e.properties.href||"")||void 0,t.baseFound=!0)},blockquote:function(t,e){const n={type:"blockquote",children:t.toFlow(t.all(e))};return t.patch(e,n),n},br:function(t,e){const n={type:"break"};return t.patch(e,n),n},code:d,dir:v,dl:function(t,e){const n=[],r=[];let i=-1;for(;++i<e.children.length;){const t=e.children[i];"element"===t.type&&"div"===t.tagName?n.push(...t.children):n.push(t)}let l={definitions:[],titles:[]};for(i=-1;++i<n.length;){const t=n[i];if("element"===t.type&&"dt"===t.tagName){const e=n[i-1];e&&"element"===e.type&&"dd"===e.tagName&&(r.push(l),l={definitions:[],titles:[]}),l.titles.push(t)}else l.definitions.push(t)}r.push(l),i=-1;const s=[];for(;++i<r.length;){const e=[...c(t,r[i].titles),...c(t,r[i].definitions)];e.length>0&&s.push({type:"listItem",spread:e.length>1,checked:null,children:e})}if(s.length>0){const n={type:"list",ordered:!1,start:null,spread:o(s),children:s};return t.patch(e,n),n}},dt:y,dd:y,del:l,em:a,h1:u,h2:u,h3:u,h4:u,h5:u,h6:u,hr:function(t,e){const n={type:"thematicBreak"};return t.patch(e,n),n},i:a,iframe:function(t,e){const n=e.properties||{},r=String(n.src||""),i=String(n.title||"");if(r&&i){const n={type:"link",title:null,url:t.resolve(r),children:[{type:"text",value:i}]};return t.patch(e,n),n}},img:h,image:h,input:function(t,e){const n=e.properties||{},r=String(n.value||n.placeholder||"");if(n.disabled||"hidden"===n.type||"file"===n.type)return;if("checkbox"===n.type||"radio"===n.type){const r={type:"text",value:n.checked?t.options.checked||"[x]":t.options.unchecked||"[ ]"};return t.patch(e,r),r}if("image"===n.type){const i=n.alt||r;if(i){const r={type:"image",url:t.resolve(String(n.src||"")||null),title:String(n.title||"")||null,alt:String(i)};return t.patch(e,r),r}return}let i=[];if(r)i=[[r,void 0]];else if("button"!==n.type&&"file"!==n.type&&"password"!==n.type&&"reset"!==n.type&&"submit"!==n.type&&n.list){const e=String(n.list),r=t.elementById.get(e);r&&"datalist"===r.tagName&&(i=f(r,n))}if(0===i.length)return;if("password"===n.type&&(i[0]=["•".repeat(i[0][0].length),void 0]),"email"===n.type||"url"===n.type){const e=[];let r=-1;for(;++r<i.length;){const l=t.resolve(i[r][0]),o={type:"link",title:null,url:"email"===n.type?"mailto:"+l:l,children:[{type:"text",value:i[r][1]||l}]};e.push(o),r!==i.length-1&&e.push({type:"text",value:", "})}return e}const l=[];let o=-1;for(;++o<i.length;)l.push(i[o][1]?i[o][1]+" ("+i[o][0]+")":i[o][0]);const c={type:"text",value:l.join(", ")};return t.patch(e,c),c},kbd:d,li:y,listing:i,mark:a,ol:v,p:M,plaintext:i,pre:i,q:function(t,e){const n=t.options.quotes||A;t.qNesting++;const r=t.all(e);t.qNesting--;const i=n[t.qNesting%n.length],l=r[0],o=r[r.length-1],c=i.charAt(0),s=i.length>1?i.charAt(1):i;return l&&"text"===l.type?l.value=c+l.value:r.unshift({type:"text",value:c}),o&&"text"===o.type?o.value+=s:r.push({type:"text",value:s}),r},s:l,samp:d,select:function(t,e){const n=f(e);let r=-1;const i=[];for(;++r<n.length;){const t=n[r];i.push(t[1]?t[1]+" ("+t[0]+")":t[0])}if(i.length>0){const n={type:"text",value:i.join(", ")};return t.patch(e,n),n}},strike:l,strong:U,summary:M,table:function(e,n){if(e.inTable){const r={type:"text",value:t.toText(n)};return e.patch(n,r),r}e.inTable=!0;const{align:r,headless:i}=function(e){const n={align:[null],headless:!0};let r=0,i=0;return t.visit(e,function(l){if("element"===l.type){if("table"===l.tagName&&e!==l)return t.SKIP;if("th"!==l.tagName&&"td"!==l.tagName||!l.properties)"thead"===l.tagName?n.headless=!1:"tr"===l.tagName&&(r++,i=0);else{if(!n.align[i]){const t=String(l.properties.align||"")||null;"center"!==t&&"left"!==t&&"right"!==t&&null!==t||(n.align[i]=t)}n.headless&&r<2&&"th"===l.tagName&&(n.headless=!1),i++}}}),n}(n),l=e.toSpecificContent(e.all(n),j);i&&l.unshift({type:"tableRow",children:[]});let o=-1;for(;++o<l.length;){const t=l[o],n=e.toSpecificContent(t.children,R);t.children=n}let c=1;for(o=-1;++o<l.length;){const t=l[o].children;let e=-1;for(;++e<t.length;){const n=t[e];if(n.data){const t=n.data,r=Number.parseInt(String(t.hastUtilToMdastTemporaryColSpan),10)||1,i=Number.parseInt(String(t.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||i>1){let t=o-1;for(;++t<o+i;){let n=e-1;for(;++n<e+r&&l[t];){const r=[];t===o&&n===e||r.push({type:"tableCell",children:[]}),l[t].children.splice(n,0,...r)}}}"hastUtilToMdastTemporaryColSpan"in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,"hastUtilToMdastTemporaryRowSpan"in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,0===Object.keys(n.data).length&&delete n.data}}t.length>c&&(c=t.length)}for(o=-1;++o<l.length;){const t=l[o].children;let e=t.length-1;for(;++e<c;)t.push({type:"tableCell",children:[]})}let s=r.length-1;for(;++s<c;)r.push(null);e.inTable=!1;const a={type:"table",align:r,children:l};return e.patch(n,a),a},td:q,textarea:function(e,n){const r={type:"text",value:t.toText(n)};return e.patch(n,r),r},th:q,tr:function(t,e){const n={type:"tableRow",children:t.toSpecificContent(t.all(e),B)};return t.patch(e,n),n},tt:d,u:a,ul:v,var:d,video:I,wbr:function(t,e){const n={type:"text",value:""};return t.patch(e,n),n},xmp:i};function H(t,e){return t.all(e)}function P(t,e){return t.toFlow(t.all(e))}function O(){}const $={}.hasOwnProperty;function E(t){const e=t.children||[],n=[];let r=-1;for(;++r<e.length;){const i=e[r],l=this.one(i,t);Array.isArray(l)?n.push(...l):l&&n.push(l)}return n}function K(t,e){if("element"===t.type){if(t.properties&&"ignore"===t.properties.dataMdast)return;if($.call(this.handlers,t.tagName))return this.handlers[t.tagName](this,t,e)||void 0}else if($.call(this.nodeHandlers,t.type))return this.nodeHandlers[t.type](this,t,e)||void 0;if("value"in t&&"string"==typeof t.value){const e={type:"text",value:t.value};return this.patch(t,e),e}if("children"in t)return this.all(t)}function L(e,n){e.position&&(n.position=t.position(e))}function W(t){const e=this.frozenBaseUrl;return null==t?"":e?String(new URL(t,e)):t}function X(t){return k(t)}function D(t,e){const n=e(),r=[];let i=[],l=-1;for(;++l<t.length;){const e=t[l];if(o(e))i.length>0&&(e.children.unshift(...i),i=[]),r.push(e);else{const t=e;i.push(t)}}if(i.length>0){let t=r[r.length-1];t||(t=e(),r.push(t)),t.children.push(...i),i=[]}return r;function o(t){return t.type===n.type}}const G={};function J(n,r){const i=t.structuredClone(n),l=r||G,o=function(t){return function(n){e.minifyWhitespace(n,t)}}({newlines:!0===l.newlines}),c=function(t){return{all:E,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...z,...t.handlers},inTable:!1,nodeHandlers:{...F,...t.nodeHandlers},one:K,options:t,patch:L,qNesting:0,resolve:W,toFlow:X,toSpecificContent:D}}(l);let s;o(i),t.visit(i,function(t){if(t&&"element"===t.type&&t.properties){const e=String(t.properties.id||"")||void 0;e&&!c.elementById.has(e)&&c.elementById.set(e,t)}});const a=c.one(i,void 0);if(a)if(Array.isArray(a)){s={type:"root",children:a}}else s=a;else s={type:"root",children:[]};return t.visit(s,function(t,e,n){if("text"===t.type&&void 0!==e&&n){const r=n.children[e-1];if(r&&r.type===t.type)return r.value+=t.value,n.children.splice(e,1),r.position&&t.position&&(r.position.end=t.position.end),e-1;if(t.value=t.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,"$1"),!n||"heading"!==n.type&&"paragraph"!==n.type&&"root"!==n.type||(e||(t.value=t.value.replace(/^[\t ]+/,"")),e===n.children.length-1&&(t.value=t.value.replace(/[\t ]+$/,""))),!t.value)return n.children.splice(e,1),e}}),s}const Q={document:!0};exports.default=function(t,e){return t&&"run"in t?async function(n,r){const i=J(n,{...Q,...e});await t.run(i,r)}:function(e){return J(e,{...Q,...t})}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DFYcGKuT.cjs"),e=require("./index-BQO11CzB.cjs");function n(t){const e=String(t);let n=e.length;for(;n>0;){const t=e.codePointAt(n-1);if(void 0===t||10!==t&&13!==t)break;n--}return e.slice(0,n)}const r="language-";function i(e,i){const l=i.children;let o,c,s=-1;if("pre"===i.tagName)for(;++s<l.length;){const t=l[s];if("element"===t.type&&"code"===t.tagName&&t.properties&&t.properties.className&&Array.isArray(t.properties.className)){o=t.properties.className;break}}if(o)for(s=-1;++s<o.length;)if(String(o[s]).slice(0,9)===r){c=String(o[s]).slice(9);break}const a={type:"code",lang:c||null,meta:null,value:n(t.toText(i))};return e.patch(i,a),a}function l(t,e){const n={type:"delete",children:t.all(e)};return t.patch(e,n),n}function o(t){let e=-1;if(t.length>1)for(;++e<t.length;)if(t[e].spread)return!0;return!1}function c(t,e){const n=t.all({type:"root",children:e}),r=t.toSpecificContent(n,s);return 0===r.length?[]:1===r.length?r[0].children:[{type:"list",ordered:!1,start:null,spread:o(r),children:r}]}function s(){return{type:"listItem",spread:!1,checked:null,children:[]}}function a(t,e){const n={type:"emphasis",children:t.all(e)};return t.patch(e,n),n}function p(t){let e=0,n=t.length;for(;e<n&&"break"===t[e].type;)e++;for(;n>e&&"break"===t[n-1].type;)n--;return 0===e&&n===t.length?t:t.slice(e,n)}function u(t,e){const n={type:"heading",depth:Number(e.tagName.charAt(1))||1,children:p(t.all(e))};return t.patch(e,n),n}function h(t,e){const n=e.properties||{},r={type:"image",url:t.resolve(String(n.src||"")||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):""};return t.patch(e,r),r}function d(e,n){const r={type:"inlineCode",value:t.toText(n)};return e.patch(n,r),r}function f(e,n){const r=[],i=[],l=n||e.properties||{},o=g(e),c=Math.min(Number.parseInt(String(l.size),10),0)||(l.multiple?4:1);let s=-1;for(;++s<o.length;){const t=o[s];t&&t.properties&&t.properties.selected&&r.push(t)}const a=r.length>0?r:o,p=Math.min(a.length,c);for(s=-1;++s<p;){const e=a[s],n=e.properties||{},r=t.toText(e),l=r||String(n.label||""),o=String(n.value||"")||r;i.push([o,l===o?void 0:l])}return i}function g(t){const e=[];let n=-1;for(;++n<t.children.length;){const r=t.children[n];"children"in r&&Array.isArray(r.children)&&e.push(...g(r)),"element"!==r.type||"option"!==r.tagName||r.properties&&r.properties.disabled||e.push(r)}return e}function y(t,e){const{rest:n,checkbox:r}=b(e),i=r?Boolean(r.properties.checked):null,l={type:"listItem",spread:m(n),checked:i,children:t.toFlow(t.all(n))};return t.patch(e,l),l}function m(t){let n=-1,r=!1;for(;++n<t.children.length;){const i=t.children[n];if("element"===i.type){if(e.phrasing(i))continue;if("p"===i.tagName||r||m(i))return!0;r=!0}}return!1}function b(t){const e=t.children[0];if(e&&"element"===e.type&&"input"===e.tagName&&e.properties&&("checkbox"===e.properties.type||"radio"===e.properties.type)){return{checkbox:e,rest:{...t,children:t.children.slice(1)}}}if(e&&"element"===e.type&&"p"===e.tagName){const{checkbox:n,rest:r}=b(e);if(n){return{checkbox:n,rest:{...t,children:[r,...t.children.slice(1)]}}}}return{checkbox:void 0,rest:t}}function v(t,e){const n="ol"===e.tagName,r=t.toSpecificContent(t.all(e),S);let i=null;n&&(i=e.properties&&e.properties.start?Number.parseInt(String(e.properties.start),10):1);const l={type:"list",ordered:n,start:i,spread:o(r),children:r};return t.patch(e,l),l}function S(){return{type:"listItem",spread:!1,checked:null,children:[]}}function x(t){let e=-1;for(;++e<t.length;){const n=t[e];if(!w(n)||"children"in n&&x(n.children))return!0}return!1}function k(e){return T(e,function(e){return e.every(function(e){return"text"===e.type&&t.whitespace(e.value)})?[]:[{type:"paragraph",children:p(e)}]},function(t){return t})}function N(t){return T(t.children,function(e){const n=C(t);return n.children=e,[n]},function(e){if("children"in e&&"children"in t){const n=C(t),r=C(e);return n.children=e.children,r.children.push(n),r}return{...e}})}function T(t,e,n){const r=function(t){const e=[];let n=-1;for(;++n<t.length;){const r=t[n];"delete"!==r.type&&"link"!==r.type||!x(r.children)?e.push(r):e.push(...N(r))}return e}(t),i=[];let l=[],o=-1;for(;++o<r.length;){const t=r[o];w(t)?l.push(t):(l.length>0&&(i.push(...e(l)),l=[]),i.push(n(t)))}return l.length>0&&(i.push(...e(l)),l=[]),i}function w(n){const r=n.data&&n.data.hName;return r?e.phrasing({type:"element",tagName:r,properties:{},children:[]}):t.phrasing(n)}function C(e){return t.structuredClone({...e,children:[]})}function I(e,n){const r=n.properties||{},i="video"===n.tagName?String(r.poster||""):"";let l=String(r.src||""),o=-1,c=!1,s=e.all(n);const a={type:"root",children:s};if(t.visit(a,function(e){if("link"===e.type)return c=!0,t.EXIT}),c||x(s))return s;for(;!l&&++o<n.children.length;){const t=n.children[o];"element"===t.type&&"source"===t.tagName&&t.properties&&(l=String(t.properties.src||""))}if(i){const r={type:"image",title:null,url:e.resolve(i),alt:t.toString(s)};e.patch(n,r),s=[r]}const p=s,u={type:"link",title:r.title?String(r.title):null,url:e.resolve(l),children:p};return e.patch(n,u),u}function M(t,e){const n=p(t.all(e));if(n.length>0){const r={type:"paragraph",children:n};return t.patch(e,r),r}}const A=['"'];function U(t,e){const n={type:"strong",children:t.all(e)};return t.patch(e,n),n}function q(t,e){const n={type:"tableCell",children:t.all(e)};if(t.patch(e,n),e.properties){const t=e.properties.rowSpan,r=e.properties.colSpan;if(t||r){const e=n.data||(n.data={});t&&(e.hastUtilToMdastTemporaryRowSpan=t),r&&(e.hastUtilToMdastTemporaryColSpan=r)}}return n}function B(){return{type:"tableCell",children:[]}}function R(){return{type:"tableCell",children:[]}}function j(){return{type:"tableRow",children:[]}}const F={comment:function(t,e){const n={type:"html",value:"\x3c!--"+e.value+"--\x3e"};return t.patch(e,n),n},doctype:O,root:function(t,e){let n=t.all(e);(t.options.document||x(n))&&(n=k(n));const r={type:"root",children:n};return t.patch(e,r),r},text:function(t,e){const n={type:"text",value:e.value};return t.patch(e,n),n}},z={applet:O,area:O,basefont:O,bgsound:O,caption:O,col:O,colgroup:O,command:O,content:O,datalist:O,dialog:O,element:O,embed:O,frame:O,frameset:O,isindex:O,keygen:O,link:O,math:O,menu:O,menuitem:O,meta:O,nextid:O,noembed:O,noframes:O,optgroup:O,option:O,param:O,script:O,shadow:O,source:O,spacer:O,style:O,svg:O,template:O,title:O,track:O,abbr:H,acronym:H,bdi:H,bdo:H,big:H,blink:H,button:H,canvas:H,cite:H,data:H,details:H,dfn:H,font:H,ins:H,label:H,map:H,marquee:H,meter:H,nobr:H,noscript:H,object:H,output:H,progress:H,rb:H,rbc:H,rp:H,rt:H,rtc:H,ruby:H,slot:H,small:H,span:H,sup:H,sub:H,tbody:H,tfoot:H,thead:H,time:H,address:P,article:P,aside:P,body:P,center:P,div:P,fieldset:P,figcaption:P,figure:P,form:P,footer:P,header:P,hgroup:P,html:P,legend:P,main:P,multicol:P,nav:P,picture:P,section:P,a:function(t,e){const n=e.properties||{},r=t.all(e),i={type:"link",url:t.resolve(String(n.href||"")||null),title:n.title?String(n.title):null,children:r};return t.patch(e,i),i},audio:I,b:U,base:function(t,e){t.baseFound||(t.frozenBaseUrl=String(e.properties&&e.properties.href||"")||void 0,t.baseFound=!0)},blockquote:function(t,e){const n={type:"blockquote",children:t.toFlow(t.all(e))};return t.patch(e,n),n},br:function(t,e){const n={type:"break"};return t.patch(e,n),n},code:d,dir:v,dl:function(t,e){const n=[],r=[];let i=-1;for(;++i<e.children.length;){const t=e.children[i];"element"===t.type&&"div"===t.tagName?n.push(...t.children):n.push(t)}let l={definitions:[],titles:[]};for(i=-1;++i<n.length;){const t=n[i];if("element"===t.type&&"dt"===t.tagName){const e=n[i-1];e&&"element"===e.type&&"dd"===e.tagName&&(r.push(l),l={definitions:[],titles:[]}),l.titles.push(t)}else l.definitions.push(t)}r.push(l),i=-1;const s=[];for(;++i<r.length;){const e=[...c(t,r[i].titles),...c(t,r[i].definitions)];e.length>0&&s.push({type:"listItem",spread:e.length>1,checked:null,children:e})}if(s.length>0){const n={type:"list",ordered:!1,start:null,spread:o(s),children:s};return t.patch(e,n),n}},dt:y,dd:y,del:l,em:a,h1:u,h2:u,h3:u,h4:u,h5:u,h6:u,hr:function(t,e){const n={type:"thematicBreak"};return t.patch(e,n),n},i:a,iframe:function(t,e){const n=e.properties||{},r=String(n.src||""),i=String(n.title||"");if(r&&i){const n={type:"link",title:null,url:t.resolve(r),children:[{type:"text",value:i}]};return t.patch(e,n),n}},img:h,image:h,input:function(t,e){const n=e.properties||{},r=String(n.value||n.placeholder||"");if(n.disabled||"hidden"===n.type||"file"===n.type)return;if("checkbox"===n.type||"radio"===n.type){const r={type:"text",value:n.checked?t.options.checked||"[x]":t.options.unchecked||"[ ]"};return t.patch(e,r),r}if("image"===n.type){const i=n.alt||r;if(i){const r={type:"image",url:t.resolve(String(n.src||"")||null),title:String(n.title||"")||null,alt:String(i)};return t.patch(e,r),r}return}let i=[];if(r)i=[[r,void 0]];else if("button"!==n.type&&"file"!==n.type&&"password"!==n.type&&"reset"!==n.type&&"submit"!==n.type&&n.list){const e=String(n.list),r=t.elementById.get(e);r&&"datalist"===r.tagName&&(i=f(r,n))}if(0===i.length)return;if("password"===n.type&&(i[0]=["•".repeat(i[0][0].length),void 0]),"email"===n.type||"url"===n.type){const e=[];let r=-1;for(;++r<i.length;){const l=t.resolve(i[r][0]),o={type:"link",title:null,url:"email"===n.type?"mailto:"+l:l,children:[{type:"text",value:i[r][1]||l}]};e.push(o),r!==i.length-1&&e.push({type:"text",value:", "})}return e}const l=[];let o=-1;for(;++o<i.length;)l.push(i[o][1]?i[o][1]+" ("+i[o][0]+")":i[o][0]);const c={type:"text",value:l.join(", ")};return t.patch(e,c),c},kbd:d,li:y,listing:i,mark:a,ol:v,p:M,plaintext:i,pre:i,q:function(t,e){const n=t.options.quotes||A;t.qNesting++;const r=t.all(e);t.qNesting--;const i=n[t.qNesting%n.length],l=r[0],o=r[r.length-1],c=i.charAt(0),s=i.length>1?i.charAt(1):i;return l&&"text"===l.type?l.value=c+l.value:r.unshift({type:"text",value:c}),o&&"text"===o.type?o.value+=s:r.push({type:"text",value:s}),r},s:l,samp:d,select:function(t,e){const n=f(e);let r=-1;const i=[];for(;++r<n.length;){const t=n[r];i.push(t[1]?t[1]+" ("+t[0]+")":t[0])}if(i.length>0){const n={type:"text",value:i.join(", ")};return t.patch(e,n),n}},strike:l,strong:U,summary:M,table:function(e,n){if(e.inTable){const r={type:"text",value:t.toText(n)};return e.patch(n,r),r}e.inTable=!0;const{align:r,headless:i}=function(e){const n={align:[null],headless:!0};let r=0,i=0;return t.visit(e,function(l){if("element"===l.type){if("table"===l.tagName&&e!==l)return t.SKIP;if("th"!==l.tagName&&"td"!==l.tagName||!l.properties)"thead"===l.tagName?n.headless=!1:"tr"===l.tagName&&(r++,i=0);else{if(!n.align[i]){const t=String(l.properties.align||"")||null;"center"!==t&&"left"!==t&&"right"!==t&&null!==t||(n.align[i]=t)}n.headless&&r<2&&"th"===l.tagName&&(n.headless=!1),i++}}}),n}(n),l=e.toSpecificContent(e.all(n),j);i&&l.unshift({type:"tableRow",children:[]});let o=-1;for(;++o<l.length;){const t=l[o],n=e.toSpecificContent(t.children,R);t.children=n}let c=1;for(o=-1;++o<l.length;){const t=l[o].children;let e=-1;for(;++e<t.length;){const n=t[e];if(n.data){const t=n.data,r=Number.parseInt(String(t.hastUtilToMdastTemporaryColSpan),10)||1,i=Number.parseInt(String(t.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||i>1){let t=o-1;for(;++t<o+i;){let n=e-1;for(;++n<e+r&&l[t];){const r=[];t===o&&n===e||r.push({type:"tableCell",children:[]}),l[t].children.splice(n,0,...r)}}}"hastUtilToMdastTemporaryColSpan"in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,"hastUtilToMdastTemporaryRowSpan"in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,0===Object.keys(n.data).length&&delete n.data}}t.length>c&&(c=t.length)}for(o=-1;++o<l.length;){const t=l[o].children;let e=t.length-1;for(;++e<c;)t.push({type:"tableCell",children:[]})}let s=r.length-1;for(;++s<c;)r.push(null);e.inTable=!1;const a={type:"table",align:r,children:l};return e.patch(n,a),a},td:q,textarea:function(e,n){const r={type:"text",value:t.toText(n)};return e.patch(n,r),r},th:q,tr:function(t,e){const n={type:"tableRow",children:t.toSpecificContent(t.all(e),B)};return t.patch(e,n),n},tt:d,u:a,ul:v,var:d,video:I,wbr:function(t,e){const n={type:"text",value:""};return t.patch(e,n),n},xmp:i};function H(t,e){return t.all(e)}function P(t,e){return t.toFlow(t.all(e))}function O(){}const $={}.hasOwnProperty;function E(t){const e=t.children||[],n=[];let r=-1;for(;++r<e.length;){const i=e[r],l=this.one(i,t);Array.isArray(l)?n.push(...l):l&&n.push(l)}return n}function K(t,e){if("element"===t.type){if(t.properties&&"ignore"===t.properties.dataMdast)return;if($.call(this.handlers,t.tagName))return this.handlers[t.tagName](this,t,e)||void 0}else if($.call(this.nodeHandlers,t.type))return this.nodeHandlers[t.type](this,t,e)||void 0;if("value"in t&&"string"==typeof t.value){const e={type:"text",value:t.value};return this.patch(t,e),e}if("children"in t)return this.all(t)}function L(e,n){e.position&&(n.position=t.position(e))}function W(t){const e=this.frozenBaseUrl;return null==t?"":e?String(new URL(t,e)):t}function X(t){return k(t)}function D(t,e){const n=e(),r=[];let i=[],l=-1;for(;++l<t.length;){const e=t[l];if(o(e))i.length>0&&(e.children.unshift(...i),i=[]),r.push(e);else{const t=e;i.push(t)}}if(i.length>0){let t=r[r.length-1];t||(t=e(),r.push(t)),t.children.push(...i),i=[]}return r;function o(t){return t.type===n.type}}const G={};function J(n,r){const i=t.structuredClone(n),l=r||G,o=function(t){return function(n){e.minifyWhitespace(n,t)}}({newlines:!0===l.newlines}),c=function(t){return{all:E,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...z,...t.handlers},inTable:!1,nodeHandlers:{...F,...t.nodeHandlers},one:K,options:t,patch:L,qNesting:0,resolve:W,toFlow:X,toSpecificContent:D}}(l);let s;o(i),t.visit(i,function(t){if(t&&"element"===t.type&&t.properties){const e=String(t.properties.id||"")||void 0;e&&!c.elementById.has(e)&&c.elementById.set(e,t)}});const a=c.one(i,void 0);if(a)if(Array.isArray(a)){s={type:"root",children:a}}else s=a;else s={type:"root",children:[]};return t.visit(s,function(t,e,n){if("text"===t.type&&void 0!==e&&n){const r=n.children[e-1];if(r&&r.type===t.type)return r.value+=t.value,n.children.splice(e,1),r.position&&t.position&&(r.position.end=t.position.end),e-1;if(t.value=t.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,"$1"),!n||"heading"!==n.type&&"paragraph"!==n.type&&"root"!==n.type||(e||(t.value=t.value.replace(/^[\t ]+/,"")),e===n.children.length-1&&(t.value=t.value.replace(/[\t ]+$/,""))),!t.value)return n.children.splice(e,1),e}}),s}const Q={document:!0};exports.default=function(t,e){return t&&"run"in t?async function(n,r){const i=J(n,{...Q,...e});await t.run(i,r)}:function(e){return J(e,{...Q,...t})}};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DFYcGKuT.cjs");require("katex/dist/katex.min.css"),require("@semi-bot/semi-theme-xiangshuishidai/scss/index.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/global.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/animation.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/local.scss"),require("@semi-bot/semi-theme-xiangshuishidai/semi.css"),exports.AgentWebIndex=e.AgentWebIndex,exports.AiBlockEdit=e.AiBlockEdit,exports.BlockEditNew=e.AiBlockEdit$1,exports.CommonUtil=e.CommonUtil,exports.MessageUtil=e.MessageUtil,exports.PluginExecutor=e.PluginExecutor,exports.Storage=e.LocalForageService;
|