dsh-thoughtdag 0.4.4
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/LICENSE +21 -0
- package/README.md +92 -0
- package/cordis.patch.yml +11 -0
- package/dist-app/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist-app/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist-app/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist-app/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist-app/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist-app/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist-app/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist-app/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist-app/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist-app/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist-app/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist-app/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist-app/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist-app/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist-app/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist-app/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist-app/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist-app/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist-app/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist-app/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist-app/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist-app/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist-app/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist-app/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist-app/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist-app/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist-app/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist-app/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist-app/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist-app/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist-app/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist-app/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist-app/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist-app/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist-app/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist-app/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist-app/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist-app/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist-app/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist-app/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist-app/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist-app/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist-app/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist-app/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist-app/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist-app/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist-app/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist-app/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist-app/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist-app/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist-app/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist-app/assets/canonical-DbPqsMYz.js +2 -0
- package/dist-app/assets/canvas-record-C1A8ExlM.js +1 -0
- package/dist-app/assets/claude-code-session-DQRgWy00.js +7 -0
- package/dist-app/assets/codex-session--KVj3_vb.js +12 -0
- package/dist-app/assets/dsh-session-6OCSm4h5.js +6 -0
- package/dist-app/assets/experiment-loop-BfxITu2e.js +2 -0
- package/dist-app/assets/index-6m02Pb4Q.js +761 -0
- package/dist-app/assets/index-BH-U0zVI.js +105 -0
- package/dist-app/assets/index-BL39OXsY.js +221 -0
- package/dist-app/assets/index-BeoRn2gJ.js +2 -0
- package/dist-app/assets/index-D-BTv0n0.js +3 -0
- package/dist-app/assets/index-DEHbIrRr.css +1 -0
- package/dist-app/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist-app/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist-app/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist-app/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist-app/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist-app/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist-app/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist-app/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist-app/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist-app/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist-app/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist-app/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist-app/assets/live-mirror-BElcCk_a.js +2 -0
- package/dist-app/assets/pdf-gh-BrLFn.js +12 -0
- package/dist-app/assets/pdf.worker.min-C_APr3k7.js +1 -0
- package/dist-app/assets/pdf.worker.min-yatZIOMy.mjs +21 -0
- package/dist-app/assets/purify.es-Cz4mVeUR.js +3 -0
- package/dist-app/assets/sensitive-scan-L0rFzufE.js +7 -0
- package/dist-app/assets/session-handoff-CGrowwZp.js +2 -0
- package/dist-app/assets/shared-CURSZnXt.js +10 -0
- package/dist-app/assets/turndown-plugin-gfm.cjs-p3SpZgsj.js +22 -0
- package/dist-app/assets/turndown.browser.es-kLzRgxYD.js +61 -0
- package/dist-app/assets/update-check-D5daO3Cz.js +1 -0
- package/dist-app/favicon.svg +10 -0
- package/dist-app/index.html +31 -0
- package/dist-app/logo-social.png +0 -0
- package/dist-app/logo-social.svg +52 -0
- package/dist-app/og-twitter.jpg +0 -0
- package/dist-app/og.jpg +0 -0
- package/dist-app/robots.txt +4 -0
- package/dist-app/sitemap.xml +6 -0
- package/dist-app/tutorial/map-en.gif +0 -0
- package/dist-app/tutorial/map-zh.gif +0 -0
- package/dist-app/tutorial/prune-en.gif +0 -0
- package/dist-app/tutorial/prune-zh.gif +0 -0
- package/dist-app/tutorial/reading-en.gif +0 -0
- package/dist-app/tutorial/reading-zh.gif +0 -0
- package/dist-app/tutorial/ref-en.gif +0 -0
- package/dist-app/tutorial/ref-zh.gif +0 -0
- package/lib/client.js +84 -0
- package/lib/index.js +845 -0
- package/package.json +107 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
function ke(o,i){(i==null||i>o.length)&&(i=o.length);for(var s=0,c=Array(i);s<i;s++)c[s]=o[s];return c}function wn(o){if(Array.isArray(o))return o}function Cn(o,i){var s=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(s!=null){var c,f,d,S,lt=[],P=!0,ct=!1;try{if(d=(s=s.call(o)).next,i!==0)for(;!(P=(c=d.call(s)).done)&&(lt.push(c.value),lt.length!==i);P=!0);}catch(Pt){ct=!0,f=Pt}finally{try{if(!P&&s.return!=null&&(S=s.return(),Object(S)!==S))return}finally{if(ct)throw f}}return lt}}function Mn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pn(o,i){return wn(o)||Cn(o,i)||xn(o,i)||Mn()}function xn(o,i){if(o){if(typeof o=="string")return ke(o,i);var s={}.toString.call(o).slice(8,-1);return s==="Object"&&o.constructor&&(s=o.constructor.name),s==="Map"||s==="Set"?Array.from(o):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?ke(o,i):void 0}}const Ke=Object.entries,ve=Object.setPrototypeOf,kn=Object.isFrozen,vn=Object.getPrototypeOf,Un=Object.getOwnPropertyDescriptor;let R=Object.freeze,N=Object.seal,st=Object.create,Ze=typeof Reflect<"u"&&Reflect,ie=Ze.apply,ae=Ze.construct;R||(R=function(i){return i});N||(N=function(i){return i});ie||(ie=function(i,s){for(var c=arguments.length,f=new Array(c>2?c-2:0),d=2;d<c;d++)f[d-2]=arguments[d];return i.apply(s,f)});ae||(ae=function(i){for(var s=arguments.length,c=new Array(s>1?s-1:0),f=1;f<s;f++)c[f-1]=arguments[f];return new i(...c)});const it=y(Array.prototype.forEach),Fn=y(Array.prototype.lastIndexOf),Ue=y(Array.prototype.pop),at=y(Array.prototype.push),zn=y(Array.prototype.splice),j=Array.isArray,_t=y(String.prototype.toLowerCase),te=y(String.prototype.toString),Fe=y(String.prototype.match),Tt=y(String.prototype.replace),ze=y(String.prototype.indexOf),Hn=y(String.prototype.trim),Gn=y(Number.prototype.toString),Bn=y(Boolean.prototype.toString),He=typeof BigInt>"u"?null:y(BigInt.prototype.toString),Ge=typeof Symbol>"u"?null:y(Symbol.prototype.toString),O=y(Object.prototype.hasOwnProperty),ht=y(Object.prototype.toString),b=y(RegExp.prototype.test),Z=Wn(TypeError);function y(o){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var s=arguments.length,c=new Array(s>1?s-1:0),f=1;f<s;f++)c[f-1]=arguments[f];return ie(o,i,c)}}function Wn(o){return function(){for(var i=arguments.length,s=new Array(i),c=0;c<i;c++)s[c]=arguments[c];return ae(o,s)}}function p(o,i){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_t;if(ve&&ve(o,null),!j(i))return o;let c=i.length;for(;c--;){let f=i[c];if(typeof f=="string"){const d=s(f);d!==f&&(kn(i)||(i[c]=d),f=d)}o[f]=!0}return o}function Yn(o){for(let i=0;i<o.length;i++)O(o,i)||(o[i]=null);return o}function I(o){const i=st(null);for(const c of Ke(o)){var s=Pn(c,2);const f=s[0],d=s[1];O(o,f)&&(j(d)?i[f]=Yn(d):d&&typeof d=="object"&&d.constructor===Object?i[f]=I(d):i[f]=d)}return i}function jn(o){switch(typeof o){case"string":return o;case"number":return Gn(o);case"boolean":return Bn(o);case"bigint":return He?He(o):"0";case"symbol":return Ge?Ge(o):"Symbol()";case"undefined":return ht(o);case"function":case"object":{if(o===null)return ht(o);const i=o,s=k(i,"toString");if(typeof s=="function"){const c=s(i);return typeof c=="string"?c:ht(c)}return ht(o)}default:return ht(o)}}function k(o,i){for(;o!==null;){const c=Un(o,i);if(c){if(c.get)return y(c.get);if(typeof c.value=="function")return y(c.value)}o=vn(o)}function s(){return null}return s}function $n(o){try{return b(o,""),!0}catch{return!1}}const Be=R(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ee=R(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ne=R(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Xn=R(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),oe=R(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Vn=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),We=R(["#text"]),Ye=R(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),re=R(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),je=R(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Mt=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qn=N(/{{[\w\W]*|^[\w\W]*}}/g),Kn=N(/<%[\w\W]*|^[\w\W]*%>/g),Zn=N(/\${[\w\W]*/g),Jn=N(/^data-[\-\w.\u00B7-\uFFFF]+$/),Qn=N(/^aria-[\-\w]+$/),$e=N(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),to=N(/^(?:\w+script|data):/i),eo=N(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),no=N(/^html$/i),oo=N(/^[a-z][.\w]*(-[.\w]+)+$/i),Xe=N(/<[/\w!]/g),Ve=N(/<[/\w]/g),ro=N(/<\/no(script|embed|frames)/i),io=N(/\/>/i),x={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ao=function(){return typeof window>"u"?null:window},so=function(i,s){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let c=null;const f="data-tt-policy-suffix";s&&s.hasAttribute(f)&&(c=s.getAttribute(f));const d="dompurify"+(c?"#"+c:"");try{return i.createPolicy(d,{createHTML(S){return S},createScriptURL(S){return S}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},qe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Y=function(i,s,c,f){return O(i,s)&&j(i[s])?p(f.base?I(f.base):{},i[s],f.transform):c};function Je(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ao();const i=r=>Je(r);if(i.version="3.4.13",i.removed=[],!o||!o.document||o.document.nodeType!==x.document||!o.Element)return i.isSupported=!1,i;let s=o.document;const c=s,f=c.currentScript;o.DocumentFragment;const d=o.HTMLTemplateElement,S=o.Node,lt=o.Element,P=o.NodeFilter,ct=o.NamedNodeMap;ct===void 0&&(o.NamedNodeMap||o.MozNamedAttrMap),o.HTMLFormElement;const Pt=o.DOMParser,gt=o.trustedTypes,$=lt.prototype,Qe=k($,"cloneNode"),xt=k($,"remove"),tn=k($,"nextSibling"),J=k($,"childNodes"),X=k($,"parentNode"),se=k($,"shadowRoot"),kt=k($,"attributes"),D=S&&S.prototype?k(S.prototype,"nodeType"):null,v=S&&S.prototype?k(S.prototype,"nodeName"):null,Et=S&&S.prototype?k(S.prototype,"ownerDocument"):null;if(typeof d=="function"){const r=s.createElement("template");r.content&&r.content.ownerDocument&&(s=r.content.ownerDocument)}let w,V="",vt,le=!1,ut=0;const ce=function(){if(ut>0)throw Z('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Q=function(t){ce(),ut++;try{return w.createHTML(t)}finally{ut--}},en=function(t){ce(),ut++;try{return w.createScriptURL(t)}finally{ut--}},nn=function(){return le||(vt=so(gt,f),le=!0),vt},At=s,Ut=At.implementation,ue=At.createNodeIterator,on=At.createDocumentFragment,rn=At.getElementsByTagName,an=c.importNode;let T=qe();i.isSupported=typeof Ke=="function"&&typeof X=="function"&&Ut&&Ut.createHTMLDocument!==void 0;const sn=qn,ln=Kn,cn=Zn,un=Jn,fn=Qn,pn=to,fe=eo,mn=oo;let pe=$e,h=null;const Ft=p({},[...Be,...ee,...ne,...oe,...We]);let _=null;const zt=p({},[...Ye,...re,...je,...Mt]);let A=Object.seal(st(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ft=null,me=null;const H=Object.seal(st(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let de=!0,Ht=!0,Te=!1,he=!0,G=!1,B=!0,q=!1,Gt=!1,yt=null,St=null,Bt=!1,tt=!1,bt=!1,Ot=!1,_e=!0,ge=!1;const Ee="user-content-";let Wt=!0,Rt=!1,et={},U=null;const Yt=p({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ae=null;const ye=p({},["audio","video","img","source","image","track"]);let jt=null;const Se=p({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Nt="http://www.w3.org/1998/Math/MathML",It="http://www.w3.org/2000/svg",F="http://www.w3.org/1999/xhtml";let nt=F,$t=!1,Xt=null;const dn=p({},[Nt,It,F],te),be=R(["mi","mo","mn","ms","mtext"]);let Vt=p({},be);const Oe=R(["annotation-xml"]);let qt=p({},Oe);const Tn=p({},["title","style","font","a","script"]);let pt=null;const hn=["application/xhtml+xml","text/html"],_n="text/html";let g=null,ot=null;const gn=s.createElement("form"),Re=function(t){return t instanceof RegExp||t instanceof Function},Kt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ot&&ot===t)return;(!t||typeof t!="object")&&(t={}),t=I(t),pt=hn.indexOf(t.PARSER_MEDIA_TYPE)===-1?_n:t.PARSER_MEDIA_TYPE,g=pt==="application/xhtml+xml"?te:_t,h=Y(t,"ALLOWED_TAGS",Ft,{transform:g}),_=Y(t,"ALLOWED_ATTR",zt,{transform:g}),Xt=Y(t,"ALLOWED_NAMESPACES",dn,{transform:te}),jt=Y(t,"ADD_URI_SAFE_ATTR",Se,{transform:g,base:Se}),Ae=Y(t,"ADD_DATA_URI_TAGS",ye,{transform:g,base:ye}),U=Y(t,"FORBID_CONTENTS",Yt,{transform:g}),ft=Y(t,"FORBID_TAGS",I({}),{transform:g}),me=Y(t,"FORBID_ATTR",I({}),{transform:g}),et=O(t,"USE_PROFILES")?t.USE_PROFILES&&typeof t.USE_PROFILES=="object"?I(t.USE_PROFILES):t.USE_PROFILES:!1,de=t.ALLOW_ARIA_ATTR!==!1,Ht=t.ALLOW_DATA_ATTR!==!1,Te=t.ALLOW_UNKNOWN_PROTOCOLS||!1,he=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=t.SAFE_FOR_TEMPLATES||!1,B=t.SAFE_FOR_XML!==!1,q=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,bt=t.RETURN_DOM_FRAGMENT||!1,Ot=t.RETURN_TRUSTED_TYPE||!1,Bt=t.FORCE_BODY||!1,_e=t.SANITIZE_DOM!==!1,ge=t.SANITIZE_NAMED_PROPS||!1,Wt=t.KEEP_CONTENT!==!1,Rt=t.IN_PLACE||!1,pe=$n(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:$e,nt=typeof t.NAMESPACE=="string"?t.NAMESPACE:F,Vt=O(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&typeof t.MATHML_TEXT_INTEGRATION_POINTS=="object"?I(t.MATHML_TEXT_INTEGRATION_POINTS):p({},be),qt=O(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&typeof t.HTML_INTEGRATION_POINTS=="object"?I(t.HTML_INTEGRATION_POINTS):p({},Oe);const e=O(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING=="object"?I(t.CUSTOM_ELEMENT_HANDLING):st(null);if(A=st(null),O(e,"tagNameCheck")&&Re(e.tagNameCheck)&&(A.tagNameCheck=e.tagNameCheck),O(e,"attributeNameCheck")&&Re(e.attributeNameCheck)&&(A.attributeNameCheck=e.attributeNameCheck),O(e,"allowCustomizedBuiltInElements")&&typeof e.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),N(A),G&&(Ht=!1),bt&&(tt=!0),et&&(h=p({},We),_=st(null),et.html===!0&&(p(h,Be),p(_,Ye)),et.svg===!0&&(p(h,ee),p(_,re),p(_,Mt)),et.svgFilters===!0&&(p(h,ne),p(_,re),p(_,Mt)),et.mathMl===!0&&(p(h,oe),p(_,je),p(_,Mt))),H.tagCheck=null,H.attributeCheck=null,O(t,"ADD_TAGS")&&(typeof t.ADD_TAGS=="function"?H.tagCheck=t.ADD_TAGS:j(t.ADD_TAGS)&&(h===Ft&&(h=I(h)),p(h,t.ADD_TAGS,g))),O(t,"ADD_ATTR")&&(typeof t.ADD_ATTR=="function"?H.attributeCheck=t.ADD_ATTR:j(t.ADD_ATTR)&&(_===zt&&(_=I(_)),p(_,t.ADD_ATTR,g))),O(t,"ADD_URI_SAFE_ATTR")&&j(t.ADD_URI_SAFE_ATTR)&&p(jt,t.ADD_URI_SAFE_ATTR,g),O(t,"FORBID_CONTENTS")&&j(t.FORBID_CONTENTS)&&(U===Yt&&(U=I(U)),p(U,t.FORBID_CONTENTS,g)),O(t,"ADD_FORBID_CONTENTS")&&j(t.ADD_FORBID_CONTENTS)&&(U===Yt&&(U=I(U)),p(U,t.ADD_FORBID_CONTENTS,g)),Wt&&(h["#text"]=!0),q&&p(h,["html","head","body"]),h.table&&(p(h,["tbody"]),delete ft.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const n=w;w=t.TRUSTED_TYPES_POLICY;try{V=Q("")}catch(a){throw w=n,a}}else t.TRUSTED_TYPES_POLICY===null?(w=void 0,V=""):(w===void 0&&(w=nn()),w&&typeof V=="string"&&(V=Q("")));R&&R(t),ot=t},Ne=p({},[...ee,...ne,...Xn]),Ie=p({},[...oe,...Vn]),En=function(t,e,n){return e.namespaceURI===F?t==="svg":e.namespaceURI===Nt?t==="svg"&&(n==="annotation-xml"||Vt[n]):!!Ne[t]},An=function(t,e,n){return e.namespaceURI===F?t==="math":e.namespaceURI===It?t==="math"&&qt[n]:!!Ie[t]},yn=function(t,e,n){return e.namespaceURI===It&&!qt[n]||e.namespaceURI===Nt&&!Vt[n]?!1:!Ie[t]&&(Tn[t]||!Ne[t])},Sn=function(t){let e=X(t);(!e||!e.tagName)&&(e={namespaceURI:nt,tagName:"template"});const n=_t(t.tagName),a=_t(e.tagName);return Xt[t.namespaceURI]?t.namespaceURI===It?En(n,e,a):t.namespaceURI===Nt?An(n,e,a):t.namespaceURI===F?yn(n,e,a):!!(pt==="application/xhtml+xml"&&Xt[t.namespaceURI]):!1},W=function(t){at(i.removed,{element:t});try{X(t).removeChild(t)}catch{if(xt(t),!X(t))throw Z("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Dt=function(t){mt(t);const e=J(t);if(e){const a=[];it(e,l=>{at(a,l)}),it(a,l=>{try{xt(l)}catch{}})}const n=kt(t);if(n)for(let a=n.length-1;a>=0;--a){const l=n[a],u=l&&l.name;if(typeof u=="string")try{t.removeAttribute(u)}catch{}}},K=function(t,e){try{at(i.removed,{attribute:e.getAttributeNode(t),from:e})}catch{at(i.removed,{attribute:null,from:e})}if(e.removeAttribute(t),t==="is")if(tt||bt)try{W(e)}catch{}else try{e.setAttribute(t,"")}catch{}},bn=function(t){const e=kt(t);if(e)for(let n=e.length-1;n>=0;--n){const a=e[n],l=a&&a.name;if(!(typeof l!="string"||_[g(l)]))try{t.removeAttribute(l)}catch{}}},mt=function(t){const e=[t];for(;e.length>0;){const n=e.pop();(D?D(n):n.nodeType)===x.element&&bn(n);const l=J(n);if(l)for(let u=l.length-1;u>=0;--u)e.push(l[u])}},On=function(t){if(!B)return;const e=[t];for(;e.length>0;){const n=e.pop(),a=D?D(n):n.nodeType;if(a===x.processingInstruction||a===x.comment&&b(Ve,n.data)){try{xt(n)}catch{}continue}if(a===x.element){const u=n,m=g(v?v(n):n.nodeName);try{u.hasAttribute&&u.hasAttribute("patchsrc")&&u.removeAttribute("patchsrc"),u.hasAttribute&&u.hasAttribute("for")&&m!=="label"&&m!=="output"&&u.removeAttribute("for")}catch{}}const l=J(n);if(l)for(let u=l.length-1;u>=0;--u)e.push(l[u])}},De=function(t){let e=null,n=null;if(Bt)t="<remove></remove>"+t;else{const u=Fe(t,/^[\r\n\t ]+/);n=u&&u[0]}pt==="application/xhtml+xml"&&nt===F&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const a=w?Q(t):t;if(nt===F)try{e=new Pt().parseFromString(a,pt)}catch{}if(!e||!e.documentElement){e=Ut.createDocument(nt,"template",null);try{e.documentElement.innerHTML=$t?V:a}catch{}}const l=e.body||e.documentElement;return t&&n&&l.insertBefore(s.createTextNode(n),l.childNodes[0]||null),nt===F?rn.call(e,q?"html":"body")[0]:q?e.documentElement:l},Le=function(t){const e=Et?Et(t):t.ownerDocument;return ue.call(e||t,t,P.SHOW_ELEMENT|P.SHOW_COMMENT|P.SHOW_TEXT|P.SHOW_PROCESSING_INSTRUCTION|P.SHOW_CDATA_SECTION,null)},Lt=function(t){return t=Tt(t,sn," "),t=Tt(t,ln," "),t=Tt(t,cn," "),t},Zt=function(t){var e;t.normalize();const n=Et?Et(t):t.ownerDocument,a=ue.call(n||t,t,P.SHOW_TEXT|P.SHOW_COMMENT|P.SHOW_CDATA_SECTION|P.SHOW_PROCESSING_INSTRUCTION,null);let l=a.nextNode();for(;l;)l.data=Lt(l.data),l=a.nextNode();const u=(e=t.querySelectorAll)===null||e===void 0?void 0:e.call(t,"template");u&&it(u,m=>{rt(m.content)&&Zt(m.content)})},wt=function(t){const e=v?v(t):null;return typeof e!="string"||g(e)!=="form"?!1:typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||t.attributes!==kt(t)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function"||t.nodeType!==D(t)||t.childNodes!==J(t)},rt=function(t){if(!D||typeof t!="object"||t===null)return!1;try{return D(t)===x.documentFragment}catch{return!1}},dt=function(t){if(!D||typeof t!="object"||t===null)return!1;try{return typeof D(t)=="number"}catch{return!1}};function z(r,t,e){r.length!==0&&it(r,n=>{n.call(i,t,e,ot)})}const Rn=function(t,e){return!!(B&&t.hasChildNodes()&&!dt(t.firstElementChild)&&b(Xe,t.textContent)&&b(Xe,t.innerHTML)||B&&t.namespaceURI===F&&e==="style"&&dt(t.firstElementChild)||t.nodeType===x.processingInstruction||B&&t.nodeType===x.comment&&b(Ve,t.data))},Nn=function(t,e,n){if(!ft[e]&&Pe(e)&&(A.tagNameCheck instanceof RegExp&&b(A.tagNameCheck,e)||A.tagNameCheck instanceof Function&&A.tagNameCheck(e)))return!1;if(Wt&&!U[e]){const a=X(t),l=J(t);if(l&&a){const u=l.length;for(let m=u-1;m>=0;--m){const E=t===n?Qe(l[m],!0):l[m];a.insertBefore(E,tn(t))}}}return W(t),!0},we=function(t,e,n,a){return t.length===0?e:e===n||e===a?I(e):e},Ce=function(t,e){if(z(T.beforeSanitizeElements,t,null),t!==e&&X(t)===null)return Rt&&mt(t),!0;if(wt(t))return W(t),!0;const n=g(v?v(t):t.nodeName);if(h=we(T.uponSanitizeElement,h,Ft,yt),z(T.uponSanitizeElement,t,{tagName:n,allowedTags:h}),t!==e&&X(t)===null)return Rt&&mt(t),!0;if(Rn(t,n))return W(t),!0;if(ft[n]||!(H.tagCheck instanceof Function&&H.tagCheck(n))&&!h[n]){const l=Nn(t,n,e);return l===!1&&z(T.afterSanitizeElements,t,null),l}if((D?D(t):t.nodeType)===x.element&&!Sn(t)||(n==="noscript"||n==="noembed"||n==="noframes")&&b(ro,t.innerHTML))return W(t),!0;if(G&&t.nodeType===x.text){const l=Lt(t.textContent);t.textContent!==l&&(at(i.removed,{element:t.cloneNode()}),t.textContent=l)}return z(T.afterSanitizeElements,t,null),!1},Me=function(t,e,n){if(me[e]||B&&e==="patchsrc"||B&&e==="for"&&t!=="label"&&t!=="output"||_e&&(e==="id"||e==="name")&&(n in s||n in gn))return!1;const a=_[e]||H.attributeCheck instanceof Function&&H.attributeCheck(e,t);if(!(Ht&&b(un,e))){if(!(de&&b(fn,e))){if(a){if(!jt[e]){if(!b(pe,Tt(n,fe,""))){if(!((e==="src"||e==="xlink:href"||e==="href")&&t!=="script"&&ze(n,"data:")===0&&Ae[t])){if(!(Te&&!b(pn,Tt(n,fe,"")))){if(n)return!1}}}}}else if(!(Pe(t)&&(A.tagNameCheck instanceof RegExp&&b(A.tagNameCheck,t)||A.tagNameCheck instanceof Function&&A.tagNameCheck(t))&&(A.attributeNameCheck instanceof RegExp&&b(A.attributeNameCheck,e)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(e,t))||e==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&b(A.tagNameCheck,n)||A.tagNameCheck instanceof Function&&A.tagNameCheck(n))))return!1}}return!0},In=p({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Pe=function(t){return!In[_t(t)]&&b(mn,t)},Dn=function(t,e,n,a){if(w&&typeof gt=="object"&&typeof gt.getAttributeType=="function"&&!n)switch(gt.getAttributeType(t,e)){case"TrustedHTML":return Q(a);case"TrustedScriptURL":return en(a)}return a},Ln=function(t,e,n,a){try{n?t.setAttributeNS(n,e,a):t.setAttribute(e,a),wt(t)?W(t):Ue(i.removed)}catch{K(e,t)}},xe=function(t){z(T.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||wt(t))return;_=we(T.uponSanitizeAttribute,_,zt,St);const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let a=e.length;const l=g(t.nodeName);for(;a--;){const u=e[a],m=u.name,E=u.namespaceURI,C=u.value,M=g(m),Qt=C;let L=m==="value"?Qt:Hn(Qt);if(n.attrName=M,n.attrValue=L,n.keepAttr=!0,n.forceKeepAttr=void 0,z(T.uponSanitizeAttribute,t,n),L=n.attrValue,ge&&(M==="id"||M==="name")&&ze(L,Ee)!==0&&(K(m,t),L=Ee+L),B&&b(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,L)){K(m,t);continue}if(M==="attributename"&&Fe(L,"href")){K(m,t);continue}if(!n.forceKeepAttr){if(!n.keepAttr){K(m,t);continue}if(!he&&b(io,L)){K(m,t);continue}if(G&&(L=Lt(L)),!Me(l,M,L)){K(m,t);continue}L=Dn(l,M,E,L),L!==Qt&&Ln(t,m,E,L)}}z(T.afterSanitizeAttributes,t,null)},Ct=function(t){let e=null;const n=Le(t);for(z(T.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(z(T.uponSanitizeShadowNode,e,null),Ce(e,t),xe(e),rt(e.content)&&Ct(e.content),(D?D(e):e.nodeType)===x.element){const l=se(e);rt(l)&&(Jt(l),Ct(l))}z(T.afterSanitizeShadowDOM,t,null)},Jt=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const n=e.pop();if(n.shadow){Ct(n.shadow);continue}const a=n.node,u=(D?D(a):a.nodeType)===x.element,m=J(a);if(m)for(let E=m.length-1;E>=0;--E)e.push({node:m[E],shadow:null});if(u){const E=v?v(a):null;if(typeof E=="string"&&g(E)==="template"){const C=a.content;rt(C)&&e.push({node:C,shadow:null})}}if(u){const E=se(a);rt(E)&&e.push({node:null,shadow:E},{node:E,shadow:null})}}};return i.sanitize=function(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,n=null,a=null,l=null;if($t=!r,$t&&(r="<!-->"),typeof r!="string"&&!dt(r)&&(r=jn(r),typeof r!="string"))throw Z("dirty is not a string, aborting");if(!i.isSupported)return r;Gt?(h=yt,_=St):Kt(t),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(h=I(h)),T.uponSanitizeAttribute.length>0&&(_=I(_)),i.removed=[];const u=Rt&&typeof r!="string"&&dt(r);if(u){On(r);const C=v?v(r):r.nodeName;if(typeof C=="string"){const M=g(C);if(!h[M]||ft[M])throw Dt(r),Z("root node is forbidden and cannot be sanitized in-place")}if(wt(r))throw Dt(r),Z("root node is clobbered and cannot be sanitized in-place");try{Jt(r)}catch(M){throw Dt(r),M}}else if(dt(r))e=De("<!---->"),n=e.ownerDocument.importNode(r,!0),n.nodeType===x.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?e=n:e.appendChild(n),Jt(n);else{if(!tt&&!G&&!q&&r.indexOf("<")===-1)return w&&Ot?Q(r):r;if(e=De(r),!e)return tt?null:Ot?V:""}e&&Bt&&W(e.firstChild);const m=u?r:e;try{const C=Le(m);for(;a=C.nextNode();)Ce(a,m),xe(a),rt(a.content)&&Ct(a.content)}catch(C){throw u&&(Dt(r),it(i.removed,M=>{M.element&&mt(M.element)})),C}if(u)return it(i.removed,C=>{C.element&&mt(C.element)}),G&&Zt(r),r;if(tt){if(G&&Zt(e),bt)for(l=on.call(e.ownerDocument);e.firstChild;)l.appendChild(e.firstChild);else l=e;return(_.shadowroot||_.shadowrootmode)&&(l=an.call(c,l,!0)),l}let E=q?e.outerHTML:e.innerHTML;return q&&h["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&b(no,e.ownerDocument.doctype.name)&&(E="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
|
|
3
|
+
`+E),G&&(E=Lt(E)),w&&Ot?Q(E):E},i.setConfig=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kt(r),Gt=!0,yt=h,St=_},i.clearConfig=function(){ot=null,Gt=!1,yt=null,St=null,w=vt,V=""},i.isValidAttribute=function(r,t,e){ot||Kt({});const n=g(r),a=g(t);return Me(n,a,e)},i.addHook=function(r,t){typeof t=="function"&&O(T,r)&&at(T[r],t)},i.removeHook=function(r,t){if(O(T,r)){if(t!==void 0){const e=Fn(T[r],t);return e===-1?void 0:zn(T[r],e,1)[0]}return Ue(T[r])}},i.removeHooks=function(r){O(T,r)&&(T[r]=[])},i.removeAllHooks=function(){T=qe()},i}var lo=Je();export{lo as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{f as c,a,w as g}from"./index-6m02Pb4Q.js";const k=[{kind:"sk-… key",re:/\bsk-[A-Za-z0-9_-]{16,}\b/g},{kind:"GitHub token",re:/\bgh[pousr]_[A-Za-z0-9]{20,}\b/g},{kind:"AWS access key",re:/\bAKIA[0-9A-Z]{16}\b/g},{kind:"Slack token",re:/\bxox[baprs]-[A-Za-z0-9-]{10,}\b/g},{kind:"Google API key",re:/\bAIza[0-9A-Za-z_-]{35}\b/g},{kind:"JWT",re:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{6,}\b/g},{kind:"private key block",re:/-----BEGIN [A-Z ]*PRIVATE KEY-----/g},{kind:"token assignment",re:/\b(?:API_KEY|APIKEY|SECRET|TOKEN|PASSWORD|ACCESS_KEY|AUTH_TOKEN)[A-Z_]*\s*[=:]\s*['"]?[A-Za-z0-9_/+-]{16,}/g},{kind:"HuggingFace token",re:/\bhf_[A-Za-z0-9]{30,}\b/g},{kind:"npm token",re:/\bnpm_[A-Za-z0-9]{30,}\b/g}],f=t=>t.length<=10?`${t.slice(0,4)}…`:`${t.slice(0,6)}…${t.slice(-2)}`;function o(t,e,s){if(t)for(const{kind:i,re:n}of k){n.lastIndex=0;const r=n.exec(t);if(r&&s.push({where:e,kind:i,sample:f(r[0])}),s.length>=20)return}}function l(t){const e=[];for(const s of t){const i=(s.data.question||s.data.summaries?.[0]||s.id).replace(/\s+/g," ").slice(0,28);o(s.data.question,i,e);for(const n of s.data.responses??[])o(n,i,e);for(const n of s.data.attachments??[])n.type.startsWith("image/")||o(n.content,`${i} · ${n.name}`,e);if(e.length>=20)break}return e}async function b(t){const e=l(t);if(e.length===0)return!0;const s=e.slice(0,5).map(n=>`· ${n.where} — ${n.kind}(${n.sample})`).join(`
|
|
2
|
+
`),i=e.length>5?`
|
|
3
|
+
${c(a("sensitive.more"),{n:e.length-5})}`:"";return g({title:a("sensitive.title"),message:`${c(a("sensitive.body"),{n:e.length})}
|
|
4
|
+
|
|
5
|
+
${s}${i}
|
|
6
|
+
|
|
7
|
+
${a("sensitive.hint")}`,confirmLabel:a("sensitive.proceed"),danger:!0})}export{b as confirmIfSensitive,l as scanNodes};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canonical-DbPqsMYz.js","assets/index-6m02Pb4Q.js","assets/index-DEHbIrRr.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as n,a as e,_ as p,f as a,u as h}from"./index-6m02Pb4Q.js";const l=/^http:\/\/(127\.0\.0\.1|localhost|\[::1\])(:\d+)?\//i;async function w(){const s=window.location.hash,r=s.match(/[#&]import-url=([^&]+)/);if(!r)return;const c=/[#&]mode=harvest\b/.test(s);history.replaceState(null,"",window.location.pathname+window.location.search);const i=decodeURIComponent(r[1]);if(!l.test(i)){n("error",e("handoff.notLoopback"),9e3);return}try{const o=await fetch(i);if(!o.ok)throw new Error(`HTTP ${o.status}`);const d=await o.text(),{importOrAppendSession:f}=await p(async()=>{const{importOrAppendSession:u}=await import("./canonical-DbPqsMYz.js");return{importOrAppendSession:u}},__vite__mapDeps([0,1,2])),t=await f(d);if(!t)throw new Error(e("handoff.notASession"));t.kind==="appended"?n("success",a(e("atlas.appended"),{n:t.turns}),9e3):t.kind==="mounted"?n("success",a(e(t.mode==="continue"?"atlas.mountedChapter":"atlas.mountedBranch"),{n:t.turns}),12e3):t.kind==="opened"?n("info",e("atlas.upToDate"),6e3):n("info",a(e("handoff.saved"),{n:t.nodeCount}),12e3,{label:e("handoff.backupAction"),run:()=>h.getState().setBackupDialogOpen(!0)})}catch(o){n("error",a(e("handoff.failed"),{msg:o instanceof Error?o.message:String(o)}),12e3)}}export{w as consumeSessionHandoff};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{v as m,o as p,B as h,C as g}from"./index-6m02Pb4Q.js";const _=[[/^(Read|NotebookRead|read_file|view_image)$/i,"read"],[/^(Write|write_file)$/i,"write"],[/^(Edit|MultiEdit|NotebookEdit|apply_patch)$/i,"edit"],[/^(Bash|BashOutput|Shell|exec_command|local_shell|write_stdin)$/i,"run"],[/^(Grep|Glob|LS|Search|WebSearch|web_search)$/i,"search"],[/^(WebFetch|Fetch)$/i,"fetch"],[/^(Task|Agent)$/i,"agent"]];function y(e){return _.find(([t])=>t.test(e))?.[1]??"other"}const x=800,O=32e3,S=4e3,I=(e,t)=>e.length>t?{text:`${e.slice(0,t)}
|
|
2
|
+
…[truncated, ${e.length} chars total]`,truncated:!0}:{text:e,truncated:!1},$=["<command-name>/thoughtdag</command-name>","[[thoughtdag:command]]"];function M(e){return e.filter(t=>!$.some(n=>t.question.includes(n)))}function w(e){e.width=460}function b(e){const t=g(e.data.response,90);t&&(e.data.summaries=[t])}function L(e){return e.tools.map(t=>({id:p(),name:`tool: ${t.name}${t.truncated?" (truncated)":""}`,type:"text/plain",size:t.call.length+t.result.length,content:`[call] ${t.call}
|
|
3
|
+
[result]
|
|
4
|
+
${t.result}`,...t.paths?.length?{paths:t.paths}:{},...t.op?{op:t.op}:{}}))}function k(e,t,n,s,i){if(e.length===0)return null;const r=[],l=[];let u={id:s.id};for(const o of e){const a=m(o.question||"(tool-only turn)",o.response,!1);a.data.importSource={runner:n,sessionId:t,itemIds:o.itemIds,...i?{cwd:i}:{}},a.data.source={question:a.data.question,response:a.data.response},a.data.attachments=L(o),b(a),r.length===0&&(a.data.isBranch=!0),r.push(a),l.push({id:p(),source:u.id,target:a.id,type:"smoothstep"}),u=a}const c=h(r,l.filter(o=>o.source!==s.id)),f=Math.min(...c.map(o=>o.position.x)),d=Math.min(...c.map(o=>o.position.y));for(const o of c)o.position={x:o.position.x-f+s.x+560,y:o.position.y-d+s.y};return{nodes:c,edges:l,turnCount:e.length}}function A(e){const t=e??{},n={};typeof t.url=="string"&&/^https?:\/\//.test(t.url)&&(n.url=t.url);const s={};if(typeof t.pages=="string"&&t.pages.trim()&&(s.pages=t.pages.trim()),typeof t.offset=="number"||typeof t.limit=="number"){const i=Math.max(1,typeof t.offset=="number"?t.offset:1),r=typeof t.limit=="number"?i+Math.max(0,t.limit)-1:i;s.lines=[i,Math.max(i,r)]}return Object.keys(s).length&&(n.locator=s),n}function C(e){const t=e??{},n=t.file_path??t.notebook_path;return typeof n=="string"&&n?[n]:[]}function q(e,t){const n=t??{},s=y(e);return s==="write"&&typeof n.content=="string"?`${n.file_path??""}
|
|
5
|
+
|
|
6
|
+
${n.content}`:s==="edit"&&typeof n.new_string=="string"?`${n.file_path??n.notebook_path??""}${n.replace_all?" (replace all)":""}
|
|
7
|
+
--- old
|
|
8
|
+
${n.old_string??""}
|
|
9
|
+
+++ new
|
|
10
|
+
${n.new_string}`:JSON.stringify(t??{})}export{O as A,S as T,y as a,A as b,C as c,M as d,I as e,L as f,x as g,w as m,q as r,b as s,k as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{A as W}from"./index-6m02Pb4Q.js";function Y(d,p){for(var g=0;g<p.length;g++){const s=p[g];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in d)){const o=Object.getOwnPropertyDescriptor(s,c);o&&Object.defineProperty(d,c,o.get?o:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}))}var u={},E;function J(){if(E)return u;E=1,Object.defineProperty(u,"__esModule",{value:!0});var d=/highlight-(?:text|source)-([a-z0-9]+)/;function p(t){t.addRule("highlightedCodeBlock",{filter:function(e){var r=e.firstChild;return e.nodeName==="DIV"&&d.test(e.className)&&r&&r.nodeName==="PRE"},replacement:function(e,r,n){var l=r.className||"",i=(l.match(d)||[null,""])[1];return`
|
|
2
|
+
|
|
3
|
+
`+n.fence+i+`
|
|
4
|
+
`+r.firstChild.textContent+`
|
|
5
|
+
`+n.fence+`
|
|
6
|
+
|
|
7
|
+
`}})}function g(t){t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}})}var s=Array.prototype.indexOf,c=Array.prototype.every,o={},O={left:":---",right:"---:",center:":---:"};let m=null,C=null;const A=new WeakMap;function $(t){return t?(t.getAttribute("align")||t.style.textAlign||"").toLowerCase():""}function k(t){return t?O[t]:"---"}function w(t,e){for(var r={left:0,right:0,center:0,"":0},n="",l=0;l<t.rows.length;++l){var i=t.rows[l];if(e<i.childNodes.length){var a=$(i.childNodes[e]);++r[a],r[a]>r[n]&&(n=a)}}return n}o.tableCell={filter:["th","td"],replacement:function(t,e){return v(P(e))?t:T(t,e)}},o.tableRow={filter:"tr",replacement:function(t,e){const r=P(e);if(v(r))return t;var n="";if(D(e)){const a=_(r);for(var l=0;l<a;l++){const f=l<e.childNodes.length?e.childNodes[l]:null;var i=k(w(r,l));n+=T(i,f,l)}}return`
|
|
8
|
+
`+t+(n?`
|
|
9
|
+
`+n:"")}},o.table={filter:function(t,e){return t.nodeName==="TABLE"},replacement:function(t,e){if(S(e,C)){let f=e.outerHTML,h=U(e);return h===null||!h.classList.contains("joplin-table-wrapper")?`
|
|
10
|
+
|
|
11
|
+
<div class="joplin-table-wrapper">${f}</div>
|
|
12
|
+
|
|
13
|
+
`:f}else{if(v(e))return t;t=t.replace(/\n+/g,`
|
|
14
|
+
`);var r=t.trim().split(`
|
|
15
|
+
`);r.length>=2&&(r=r[1]);var n=/\| :?---/.test(r),l=_(e),i="";if(l&&!n){i="|"+" |".repeat(l)+`
|
|
16
|
+
|`;for(var a=0;a<l;++a)i+=" "+k(w(e,a))+" |"}const f=e.querySelector?e.querySelector("caption"):e.caption,h=f&&f.textContent||"",K=h?`${h}
|
|
17
|
+
|
|
18
|
+
`:"",Q=`${i}${t}`.trimStart();return`
|
|
19
|
+
|
|
20
|
+
${K}${Q}
|
|
21
|
+
|
|
22
|
+
`}}},o.tableCaption={filter:["caption"],replacement:()=>""},o.tableColgroup={filter:["colgroup","col"],replacement:()=>""},o.tableSection={filter:["thead","tbody","tfoot"],replacement:function(t){return t}};function D(t){var e=t.parentNode;return e.nodeName==="THEAD"||e.firstChild===t&&(e.nodeName==="TABLE"||R(e))&&c.call(t.childNodes,function(r){return r.nodeName==="TH"})}function R(t){var e=t.previousSibling;return t.nodeName==="TBODY"&&(!e||e.nodeName==="THEAD"&&/^\s*$/i.test(e.textContent))}function T(t,e=null,r=null){r===null&&(r=s.call(e.parentNode.childNodes,e));var n=" ";r===0&&(n="| ");let l=t.trim().replace(/\n\r/g,"<br>").replace(/\n/g,"<br>");for(l=l.replace(/\|+/g,"\\|");l.length<3;)l+=" ";return e&&(l=V(l,e," ")),n+l+" |"}function y(t){if(!t.childNodes)return!1;for(let e=0;e<t.childNodes.length;e++){const r=t.childNodes[e];if(r.nodeName==="TABLE"||y(r))return!0}return!1}const b=(t,e)=>{if(!t.childNodes)return!1;for(let r=0;r<t.childNodes.length;r++){const n=t.childNodes[r];if(e==="code"&&m&&m(n)||e.includes(n.nodeName)||b(n,e))return!0}return!1},I=["background-color","background","border-color","border","border-top","border-right","border-bottom","border-left","border-style","border-width","padding","padding-top","padding-right","padding-bottom","padding-left","float","margin-left","margin-right"],B=["bgcolor","bordercolor","background"],G=t=>{if(!t||!t.getAttribute)return!1;const e=t.getAttribute("style");if(!e)return!1;const r=e.split(";").map(n=>n.split(":")[0].trim().toLowerCase()).filter(n=>n.length>0);for(let n=0;n<r.length;n++)if(I.includes(r[n]))return!0;return!1},L=(t,e)=>{if(!t||!t.getAttribute)return!1;const r=t.getAttribute(e);if(r===null)return!1;const n=`${r}`.trim().toLowerCase();return!(!n||n==="0"||n==="0px")},M=t=>{if(!t||!t.getAttribute)return!1;for(let e=0;e<B.length;e++){const r=t.getAttribute(B[e]);if(r!==null&&`${r}`.trim()!=="")return!0}return!!(t.nodeName==="TABLE"&&(L(t,"cellpadding")||L(t,"cellspacing")))},N=t=>G(t)||M(t),q=t=>{if(N(t))return!0;const e=t.rows;if(!e)return!1;for(let r=0;r<e.length;r++){const n=e[r];if(N(n))return!0;for(let l=0;l<n.childNodes.length;l++){const i=n.childNodes[l];if((i.nodeName==="TD"||i.nodeName==="TH")&&N(i))return!0}}return!1},S=(t,e)=>{const r=["UL","OL","H1","H2","H3","H4","H5","H6","HR","BLOCKQUOTE"];return e.preserveNestedTables&&r.push("TABLE"),b(t,"code")||b(t,r)||e.preserveTableStyles&&q(t)};function v(t){const e=A.get(t);if(e!==void 0)return e;const r=F(t);return A.set(t,r),r}function F(t){return!!(!t||!t.rows||t.rows.length===1&&t.rows[0].childNodes.length<=1||y(t))}function U(t){let e=t.parentNode;for(;e.nodeName!=="DIV";)if(e=e.parentNode,!e)return null;return e}function P(t){let e=t.parentNode;for(;e.nodeName!=="TABLE";)if(e=e.parentNode,!e)return null;return e}function V(t,e,r){const n=e.getAttribute("colspan")||1;for(let l=1;l<n;l++)t+=" | "+r.repeat(3);return t}function _(t){let e=0;for(let r=0;r<t.rows.length;r++){const l=t.rows[r].childNodes.length;l>e&&(e=l)}return e}function H(t){m=t.isCodeBlock,C=t.options,t.keep(function(r){return!!(r.nodeName==="TABLE"&&S(r,t.options))});for(var e in o)t.addRule(e,o[e])}function j(t){t.addRule("taskListItems",{filter:function(e){const r=e.parentNode,n=r.parentNode,l=!!n&&n.nodeName==="LI";return(e.type==="checkbox"||e.getAttribute("role")==="checkbox")&&(r.nodeName==="LI"||r.nodeName==="LABEL"&&l||r.nodeName==="SPAN"&&l)},replacement:function(e,r){return((r.nodeName==="INPUT"?r.checked:r.getAttribute("aria-checked")==="true")?"[x]":"[ ]")+" "}})}function z(t){t.use([p,g,H,j])}return u.gfm=z,u.highlightedCodeBlock=p,u.strikethrough=g,u.tables=H,u.taskListItems=j,u}var x=J();const X=W(x),tt=Y({__proto__:null,default:X},[x]);export{tt as t};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function H(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function g(e,r){return Array(r+1).join(e)}function R(e){return e.replace(/^\n*/,"")}function b(e){for(var r=e.length;r>0&&e[r-1]===`
|
|
2
|
+
`;)r--;return e.substring(0,r)}function O(e){return b(R(e))}var F=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function A(e){return N(e,F)}var S=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function w(e){return N(e,S)}function $(e){return B(e,S)}var D=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function V(e){return N(e,D)}function U(e){return B(e,D)}function N(e,r){return r.indexOf(e.nodeName)>=0}function B(e,r){return e.getElementsByTagName&&r.some(function(t){return e.getElementsByTagName(t).length})}var W=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function P(e){return W.reduce(function(r,t){return r.replace(t[0],t[1])},e)}var s={};s.paragraph={filter:"p",replacement:function(e){return`
|
|
3
|
+
|
|
4
|
+
`+e+`
|
|
5
|
+
|
|
6
|
+
`}};s.lineBreak={filter:"br",replacement:function(e,r,t){return t.br+`
|
|
7
|
+
`}};s.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,r,t){var n=Number(r.nodeName.charAt(1));if(t.headingStyle==="setext"&&n<3){var i=g(n===1?"=":"-",e.length);return`
|
|
8
|
+
|
|
9
|
+
`+e+`
|
|
10
|
+
`+i+`
|
|
11
|
+
|
|
12
|
+
`}else return`
|
|
13
|
+
|
|
14
|
+
`+g("#",n)+" "+e+`
|
|
15
|
+
|
|
16
|
+
`}};s.blockquote={filter:"blockquote",replacement:function(e){return e=O(e).replace(/^/gm,"> "),`
|
|
17
|
+
|
|
18
|
+
`+e+`
|
|
19
|
+
|
|
20
|
+
`}};s.list={filter:["ul","ol"],replacement:function(e,r){var t=r.parentNode;return t.nodeName==="LI"&&t.lastElementChild===r?`
|
|
21
|
+
`+e:`
|
|
22
|
+
|
|
23
|
+
`+e+`
|
|
24
|
+
|
|
25
|
+
`}};s.listItem={filter:"li",replacement:function(e,r,t){var n=t.bulletListMarker+" ",i=r.parentNode;if(i.nodeName==="OL"){var a=i.getAttribute("start"),f=Array.prototype.indexOf.call(i.children,r);n=(a?Number(a)+f:f+1)+". "}var u=/\n$/.test(e);return e=O(e)+(u?`
|
|
26
|
+
`:""),e=e.replace(/\n/gm,`
|
|
27
|
+
`+" ".repeat(n.length)),n+e+(r.nextSibling?`
|
|
28
|
+
`:"")}};s.indentedCodeBlock={filter:function(e,r){return r.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,r,t){return`
|
|
29
|
+
|
|
30
|
+
`+r.firstChild.textContent.replace(/\n/g,`
|
|
31
|
+
`)+`
|
|
32
|
+
|
|
33
|
+
`}};s.fencedCodeBlock={filter:function(e,r){return r.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,r,t){for(var n=r.firstChild.getAttribute("class")||"",i=(n.match(/language-(\S+)/)||[null,""])[1],a=r.firstChild.textContent,f=t.fence.charAt(0),u=3,l=new RegExp("^"+f+"{3,}","gm"),o;o=l.exec(a);)o[0].length>=u&&(u=o[0].length+1);var c=g(f,u);return`
|
|
34
|
+
|
|
35
|
+
`+c+i+`
|
|
36
|
+
`+a.replace(/\n$/,"")+`
|
|
37
|
+
`+c+`
|
|
38
|
+
|
|
39
|
+
`}};s.horizontalRule={filter:"hr",replacement:function(e,r,t){return`
|
|
40
|
+
|
|
41
|
+
`+t.hr+`
|
|
42
|
+
|
|
43
|
+
`}};s.inlineLink={filter:function(e,r){return r.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,r){var t=y(r.getAttribute("href")),n=E(h(r.getAttribute("title"))),i=n?' "'+n+'"':"";return"["+e+"]("+t+i+")"}};s.referenceLink={filter:function(e,r){return r.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,r,t){var n=y(r.getAttribute("href")),i=h(r.getAttribute("title"));i&&(i=' "'+E(i)+'"');var a,f;switch(t.linkReferenceStyle){case"collapsed":a="["+e+"][]",f="["+e+"]: "+n+i;break;case"shortcut":a="["+e+"]",f="["+e+"]: "+n+i;break;default:var u=this.references.length+1;a="["+e+"]["+u+"]",f="["+u+"]: "+n+i}return this.references.push(f),a},references:[],append:function(e){var r="";return this.references.length&&(r=`
|
|
44
|
+
|
|
45
|
+
`+this.references.join(`
|
|
46
|
+
`)+`
|
|
47
|
+
|
|
48
|
+
`,this.references=[]),r}};s.emphasis={filter:["em","i"],replacement:function(e,r,t){return e.trim()?t.emDelimiter+e+t.emDelimiter:""}};s.strong={filter:["strong","b"],replacement:function(e,r,t){return e.trim()?t.strongDelimiter+e+t.strongDelimiter:""}};s.code={filter:function(e){var r=e.previousSibling||e.nextSibling,t=e.parentNode.nodeName==="PRE"&&!r;return e.nodeName==="CODE"&&!t},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var r=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",t="`",n=e.match(/`+/gm)||[];n.indexOf(t)!==-1;)t=t+"`";return t+r+e+r+t}};s.image={filter:"img",replacement:function(e,r){var t=P(h(r.getAttribute("alt"))),n=y(r.getAttribute("src")||""),i=h(r.getAttribute("title")),a=i?' "'+E(i)+'"':"";return n?"":""}};function h(e){return e?e.replace(/(\n+\s*)+/g,`
|
|
49
|
+
`):""}function y(e){var r=e.replace(/([<>()])/g,"\\$1");return r.indexOf(" ")>=0?"<"+r+">":r}function E(e){return e.replace(/"/g,'\\"')}function L(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var r in e.rules)this.array.push(e.rules[r])}L.prototype={add:function(e,r){this.array.unshift(r)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var r;return(r=p(this.array,e,this.options))||(r=p(this._keep,e,this.options))||(r=p(this._remove,e,this.options))?r:this.defaultRule},forEach:function(e){for(var r=0;r<this.array.length;r++)e(this.array[r],r)}};function p(e,r,t){for(var n=0;n<e.length;n++){var i=e[n];if(_(i,r,t))return i}}function _(e,r,t){var n=e.filter;if(typeof n=="string"){if(n===r.nodeName.toLowerCase())return!0}else if(Array.isArray(n)){if(n.indexOf(r.nodeName.toLowerCase())>-1)return!0}else if(typeof n=="function"){if(n.call(e,r,t))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function j(e){var r=e.element,t=e.isBlock,n=e.isVoid,i=e.isPre||function(I){return I.nodeName==="PRE"};if(!(!r.firstChild||i(r))){for(var a=null,f=!1,u=null,l=T(u,r,i);l!==r;){if(l.nodeType===3||l.nodeType===4){var o=l.data.replace(/[ \r\n\t]+/g," ");if((!a||/ $/.test(a.data))&&!f&&o[0]===" "&&(o=o.substr(1)),!o){l=m(l);continue}l.data=o,a=l}else if(l.nodeType===1)t(l)||l.nodeName==="BR"?(a&&(a.data=a.data.replace(/ $/,"")),a=null,f=!1):n(l)||i(l)?(a=null,f=!0):a&&(f=!1);else{l=m(l);continue}var c=T(u,l,i);u=l,l=c}a&&(a.data=a.data.replace(/ $/,""),a.data||m(a))}}function m(e){var r=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),r}function T(e,r,t){return e&&e.parentNode===r||t(r)?r.nextSibling||r.parentNode:r.firstChild||r.nextSibling||r.parentNode}var k=typeof window<"u"?window:{};function G(){var e=k.DOMParser,r=!1;try{new e().parseFromString("","text/html")&&(r=!0)}catch{}return r}function X(){var e=function(){};return K()?e.prototype.parseFromString=function(r){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(r),t.close(),t}:e.prototype.parseFromString=function(r){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(r),t.close(),t},e}function K(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{k.ActiveXObject&&(e=!0)}return e}var Y=G()?k.DOMParser:X();function q(e,r){var t;if(typeof e=="string"){var n=z().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");t=n.getElementById("turndown-root")}else t=e.cloneNode(!0);return j({element:t,isBlock:A,isVoid:w,isPre:r.preformattedCode?Q:null}),t}var d;function z(){return d=d||new Y,d}function Q(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function J(e,r){return e.isBlock=A(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Z(e),e.flankingWhitespace=ee(e,r),e}function Z(e){return!w(e)&&!V(e)&&/^\s*$/i.test(e.textContent)&&!$(e)&&!U(e)}function ee(e,r){if(e.isBlock||r.preformattedCode&&e.isCode)return{leading:"",trailing:""};var t=re(e.textContent);return t.leadingAscii&&C("left",e,r)&&(t.leading=t.leadingNonAscii),t.trailingAscii&&C("right",e,r)&&(t.trailing=t.trailingNonAscii),{leading:t.leading,trailing:t.trailing}}function re(e){var r=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]}}function C(e,r,t){var n,i,a;return e==="left"?(n=r.previousSibling,i=/ $/):(n=r.nextSibling,i=/^ /),n&&(n.nodeType===3?a=i.test(n.nodeValue):t.preformattedCode&&n.nodeName==="CODE"?a=!1:n.nodeType===1&&!A(n)&&(a=i.test(n.textContent))),a}var te=Array.prototype.reduce;function v(e){if(!(this instanceof v))return new v(e);var r={rules:s,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(t,n){return n.isBlock?`
|
|
50
|
+
|
|
51
|
+
`:""},keepReplacement:function(t,n){return n.isBlock?`
|
|
52
|
+
|
|
53
|
+
`+n.outerHTML+`
|
|
54
|
+
|
|
55
|
+
`:n.outerHTML},defaultReplacement:function(t,n){return n.isBlock?`
|
|
56
|
+
|
|
57
|
+
`+t+`
|
|
58
|
+
|
|
59
|
+
`:t}};this.options=H({},r,e),this.rules=new L(this.options)}v.prototype={turndown:function(e){if(!ae(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var r=x.call(this,new q(e,this.options));return ne.call(this,r)},use:function(e){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.use(e[r]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,r){return this.rules.add(e,r),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return P(e)}};function x(e){var r=this;return te.call(e.childNodes,function(t,n){n=new J(n,r.options);var i="";return n.nodeType===3?i=n.isCode?n.nodeValue:r.escape(n.nodeValue):n.nodeType===1&&(i=ie.call(r,n)),M(t,i)},"")}function ne(e){var r=this;return this.rules.forEach(function(t){typeof t.append=="function"&&(e=M(e,t.append(r.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function ie(e){var r=this.rules.forNode(e),t=x.call(this,e),n=e.flankingWhitespace;return(n.leading||n.trailing)&&(t=t.trim()),n.leading+r.replacement(t,e,this.options)+n.trailing}function M(e,r){var t=b(e),n=R(r),i=Math.max(e.length-t.length,r.length-n.length),a=`
|
|
60
|
+
|
|
61
|
+
`.substring(0,i);return t+a+n}function ae(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as u,a as n,f}from"./index-6m02Pb4Q.js";const h=15*6e4;let i=!1;const d=new URLSearchParams(window.location.search),s=d.get("dv"),p=d.get("su")==="1",w=30*6e4;let c=!1,r=0;async function a(){if(!(!s||p||c)&&!(Date.now()-r<w)){r=Date.now();try{const t=await fetch("https://api.github.com/repos/chenxiachan/thoughtdag/releases?per_page=1");if(!t.ok)return;const o=(await t.json())?.[0]?.tag_name?.replace(/^v/,"");if(!o||o===s)return;c=!0,u("info",f(n("update.desktopAvailable"),{v:o}),0,{label:n("update.desktopDownload"),run:()=>window.open("https://chenxiachan.github.io/thoughtdag/#download","_blank")})}catch{}}}function v(){for(const t of document.querySelectorAll("script[src]")){const e=t.src.match(/assets\/index-[^/?#]+\.js/);if(e)return e[0]}return null}async function m(){try{const t=await fetch(`${window.location.pathname}?u=${Date.now()}`,{cache:"no-store"});if(!t.ok)return null;const e=(await t.text()).match(/assets\/index-[^"'?#]+\.js/);return e?e[0]:null}catch{return null}}async function l(){if(i)return;const t=v();if(!t)return;const e=await m();e&&e!==t&&(i=!0,u("info",n("update.available"),0,{label:n("update.refresh"),run:()=>window.location.reload()}))}function b(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(l(),a())}),setInterval(()=>{l(),a()},h),s&&setTimeout(()=>{a()},5e3)}export{b as bootUpdateCheck};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44">
|
|
2
|
+
<rect width="44" height="44" rx="10" fill="#FAF9F7"/>
|
|
3
|
+
<line x1="19" y1="10" x2="19" y2="18" stroke="#6B5CE7" stroke-width="2.5" stroke-linecap="round"/>
|
|
4
|
+
<line x1="19" y1="25" x2="19" y2="33" stroke="#6B5CE7" stroke-width="2.5" stroke-linecap="round"/>
|
|
5
|
+
<line x1="22.5" y1="23.5" x2="30" y2="28.5" stroke="#E08A3C" stroke-width="2.5" stroke-linecap="round" stroke-dasharray="3 3"/>
|
|
6
|
+
<circle cx="19" cy="7" r="3.8" fill="#6B5CE7"/>
|
|
7
|
+
<circle cx="19" cy="21.5" r="3.8" fill="none" stroke="#6B5CE7" stroke-width="2.6"/>
|
|
8
|
+
<circle cx="19" cy="36" r="3.8" fill="#6B5CE7" opacity="0.4"/>
|
|
9
|
+
<circle cx="33" cy="30" r="3.8" fill="#E08A3C"/>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/thoughtdag/favicon.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>ThoughtDAG</title>
|
|
8
|
+
<meta name="description" content="Wires are the context: an infinite canvas where LLM conversations grow into an editable thought graph. 连线即上下文。" />
|
|
9
|
+
<link rel="canonical" href="https://app.thoughtdag.workers.dev/" />
|
|
10
|
+
<!-- Link previews, English-first to match the card. og:image (type card,
|
|
11
|
+
shrink-proof) serves WeChat / Slack / Discord; twitter:image (seal
|
|
12
|
+
waterfall, atmospheric) serves the large summary card. Absolute
|
|
13
|
+
URLs — scrapers resolve nothing. -->
|
|
14
|
+
<meta property="og:type" content="website" />
|
|
15
|
+
<meta property="og:title" content="ThoughtDAG — your thinking deserves a map" />
|
|
16
|
+
<meta property="og:description" content="Wires are the context: an infinite canvas where LLM conversations grow into an editable thought graph. No signup; the example canvas needs no key." />
|
|
17
|
+
<meta property="og:url" content="https://app.thoughtdag.workers.dev" />
|
|
18
|
+
<meta property="og:image" content="https://app.thoughtdag.workers.dev/og.jpg" />
|
|
19
|
+
<meta property="og:image:width" content="1200" />
|
|
20
|
+
<meta property="og:image:height" content="630" />
|
|
21
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
22
|
+
<meta name="twitter:title" content="ThoughtDAG — Your thinking deserves a map" />
|
|
23
|
+
<meta name="twitter:description" content="Wires are the context: an infinite canvas where LLM conversations grow into an editable thought graph. No signup; the example canvas needs no key." />
|
|
24
|
+
<meta name="twitter:image" content="https://app.thoughtdag.workers.dev/og-twitter.jpg" />
|
|
25
|
+
<script type="module" crossorigin src="/thoughtdag/assets/index-6m02Pb4Q.js"></script>
|
|
26
|
+
<link rel="stylesheet" crossorigin href="/thoughtdag/assets/index-DEHbIrRr.css">
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<div id="root"></div>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">ThoughtDAG social logo</title>
|
|
3
|
+
<desc id="desc">A purple vertical context chain with an editable center node and a dashed orange branch.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<radialGradient id="background" cx="45%" cy="38%" r="78%">
|
|
6
|
+
<stop offset="0" stop-color="#FFFFFF"/>
|
|
7
|
+
<stop offset="0.58" stop-color="#FAF9F7"/>
|
|
8
|
+
<stop offset="1" stop-color="#EEEAFB"/>
|
|
9
|
+
</radialGradient>
|
|
10
|
+
<linearGradient id="purple" x1="0" y1="0" x2="1" y2="1">
|
|
11
|
+
<stop offset="0" stop-color="#8175F0"/>
|
|
12
|
+
<stop offset="1" stop-color="#5847D7"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
<linearGradient id="orange" x1="0" y1="0" x2="1" y2="1">
|
|
15
|
+
<stop offset="0" stop-color="#F2A45F"/>
|
|
16
|
+
<stop offset="1" stop-color="#D8742D"/>
|
|
17
|
+
</linearGradient>
|
|
18
|
+
<filter id="nodeShadow" x="-50%" y="-50%" width="200%" height="200%">
|
|
19
|
+
<feDropShadow dx="0" dy="18" stdDeviation="18" flood-color="#41378D" flood-opacity="0.18"/>
|
|
20
|
+
</filter>
|
|
21
|
+
<filter id="softShadow" x="-30%" y="-30%" width="160%" height="160%">
|
|
22
|
+
<feDropShadow dx="0" dy="22" stdDeviation="34" flood-color="#6B5CE7" flood-opacity="0.12"/>
|
|
23
|
+
</filter>
|
|
24
|
+
</defs>
|
|
25
|
+
|
|
26
|
+
<rect width="1024" height="1024" rx="224" fill="url(#background)"/>
|
|
27
|
+
<rect x="18" y="18" width="988" height="988" rx="208" fill="none" stroke="#FFFFFF" stroke-width="4" opacity="0.9"/>
|
|
28
|
+
|
|
29
|
+
<g filter="url(#softShadow)">
|
|
30
|
+
<circle cx="430" cy="510" r="292" fill="#6B5CE7" opacity="0.035"/>
|
|
31
|
+
<circle cx="430" cy="510" r="224" fill="#6B5CE7" opacity="0.025"/>
|
|
32
|
+
</g>
|
|
33
|
+
|
|
34
|
+
<g fill="none" stroke-linecap="round">
|
|
35
|
+
<path d="M430 242 L430 426" stroke="#6B5CE7" stroke-width="42"/>
|
|
36
|
+
<path d="M430 594 L430 778" stroke="#6B5CE7" stroke-width="42" opacity="0.62"/>
|
|
37
|
+
<path d="M493 543 C572 561 631 635 738 649"
|
|
38
|
+
stroke="url(#orange)"
|
|
39
|
+
stroke-width="36"
|
|
40
|
+
stroke-dasharray="42 34"/>
|
|
41
|
+
</g>
|
|
42
|
+
|
|
43
|
+
<g filter="url(#nodeShadow)">
|
|
44
|
+
<circle cx="430" cy="190" r="76" fill="url(#purple)"/>
|
|
45
|
+
<circle cx="430" cy="510" r="92" fill="#FAF9F7" stroke="url(#purple)" stroke-width="42"/>
|
|
46
|
+
<circle cx="430" cy="834" r="76" fill="url(#purple)" opacity="0.62"/>
|
|
47
|
+
<circle cx="802" cy="657" r="76" fill="url(#orange)"/>
|
|
48
|
+
</g>
|
|
49
|
+
|
|
50
|
+
<circle cx="403" cy="164" r="20" fill="#FFFFFF" opacity="0.35"/>
|
|
51
|
+
<circle cx="777" cy="631" r="20" fill="#FFFFFF" opacity="0.32"/>
|
|
52
|
+
</svg>
|
|
Binary file
|
package/dist-app/og.jpg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// dsh-thoughtdag client half — the lightest possible browser shim.
|
|
2
|
+
// It renders a floating "对话 | 思维图" switch over the harness UI and, on
|
|
3
|
+
// "思维图", shows a full-screen SAME-ORIGIN iframe at /thoughtdag/ (the SPA
|
|
4
|
+
// is served by the host half on the same web server — no CORS, no second
|
|
5
|
+
// origin). All conversation smarts live inside the ThoughtDAG app; this file
|
|
6
|
+
// only opens the door and forwards the current session id so the canvas can
|
|
7
|
+
// offer to mirror it.
|
|
8
|
+
//
|
|
9
|
+
// Same pattern as dsh-synapse: window.__ModuleLoader__.load with a module
|
|
10
|
+
// whose inject lists the client services it reads (sessions) and whose apply
|
|
11
|
+
// touches the DOM.
|
|
12
|
+
|
|
13
|
+
window.__ModuleLoader__.load({
|
|
14
|
+
id: 'dsh-thoughtdag',
|
|
15
|
+
factory: () => {
|
|
16
|
+
const module = { exports: {} }
|
|
17
|
+
|
|
18
|
+
module.exports.inject = ['sessions']
|
|
19
|
+
module.exports.apply = ctx => {
|
|
20
|
+
const currentSession = () => {
|
|
21
|
+
const snapshot = ctx.sessions.list.getSnapshot()
|
|
22
|
+
const id = snapshot.current
|
|
23
|
+
if (id === undefined) return null
|
|
24
|
+
const session = snapshot.byId[id]
|
|
25
|
+
return session === undefined ? null : { id, title: session.displayTitle ?? null, cwd: session.cwd ?? null }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const style = document.createElement('style')
|
|
29
|
+
style.textContent = '.dsh-td-switch{position:fixed;z-index:120;top:12px;left:50%;display:flex;gap:2px;transform:translateX(-50%);border:1px solid #d1d5db;border-radius:999px;background:rgba(255,255,255,.96);padding:3px;backdrop-filter:blur(10px)}.dsh-td-switch button{height:28px;border:0;border-radius:999px;background:transparent;padding:0 11px;color:#6b7280;font:600 12px Inter,system-ui,sans-serif;cursor:pointer;white-space:nowrap}.dsh-td-switch button:hover{background:#f3f4f6;color:#111827}.dsh-td-switch button.active{background:#111827;color:#fff}.dsh-td-overlay{position:fixed;z-index:100;inset:0;background:#faf9f7}.dsh-td-overlay[hidden]{display:none}.dsh-td-overlay iframe{display:block;width:100%;height:100%;border:0}'
|
|
30
|
+
document.head.append(style)
|
|
31
|
+
|
|
32
|
+
const host = document.createElement('div')
|
|
33
|
+
host.innerHTML = '<div class="dsh-td-switch" role="group" aria-label="view switch"><button type="button" data-view="dialog" class="active" aria-pressed="true">对话</button><button type="button" data-view="map" aria-pressed="false">思维图</button></div><section class="dsh-td-overlay" hidden><iframe title="ThoughtDAG" data-src="/thoughtdag/"></iframe></section>'
|
|
34
|
+
document.body.append(host)
|
|
35
|
+
|
|
36
|
+
const dialogBtn = host.querySelector('[data-view="dialog"]')
|
|
37
|
+
const mapBtn = host.querySelector('[data-view="map"]')
|
|
38
|
+
const overlay = host.querySelector('.dsh-td-overlay')
|
|
39
|
+
const frame = host.querySelector('iframe')
|
|
40
|
+
|
|
41
|
+
const setView = map => {
|
|
42
|
+
dialogBtn.classList.toggle('active', !map)
|
|
43
|
+
dialogBtn.setAttribute('aria-pressed', String(!map))
|
|
44
|
+
mapBtn.classList.toggle('active', map)
|
|
45
|
+
mapBtn.setAttribute('aria-pressed', String(map))
|
|
46
|
+
}
|
|
47
|
+
const close = () => { overlay.hidden = true; setView(false) }
|
|
48
|
+
const send = (type, payload) => frame.contentWindow?.postMessage({ source: 'dsh-thoughtdag', type, ...payload }, location.origin)
|
|
49
|
+
|
|
50
|
+
const syncCurrent = () => {
|
|
51
|
+
const session = currentSession()
|
|
52
|
+
send('td:current-session', { session })
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
mapBtn.addEventListener('click', () => {
|
|
56
|
+
overlay.hidden = false
|
|
57
|
+
setView(true)
|
|
58
|
+
// the SPA boots on first open, never while hidden: a canvas that
|
|
59
|
+
// measures itself inside a display:none frame fits its view to a 0×0
|
|
60
|
+
// box and shows nothing when revealed
|
|
61
|
+
if (!frame.src) frame.src = frame.dataset.src
|
|
62
|
+
syncCurrent()
|
|
63
|
+
// let the SPA boot, then re-sync so its listener is ready
|
|
64
|
+
window.setTimeout(syncCurrent, 400)
|
|
65
|
+
})
|
|
66
|
+
dialogBtn.addEventListener('click', close)
|
|
67
|
+
|
|
68
|
+
window.addEventListener('message', event => {
|
|
69
|
+
if (event.origin !== location.origin || event.data?.source !== 'dsh-thoughtdag') return
|
|
70
|
+
if (event.data.type === 'td:close') return close()
|
|
71
|
+
if (event.data.type === 'td:request-current') return syncCurrent()
|
|
72
|
+
// the canvas forked or continued a session: stage it and go back to the
|
|
73
|
+
// chat, which now shows exactly the context the canvas produced
|
|
74
|
+
if (event.data.type === 'td:select-session' && typeof event.data.session === 'string') {
|
|
75
|
+
ctx.sessions.select(event.data.session)
|
|
76
|
+
if (event.data.close !== false) close()
|
|
77
|
+
syncCurrent()
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return module.exports
|
|
83
|
+
},
|
|
84
|
+
})
|