@tom2012/cc-web 1.5.88 → 1.5.90

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.
Files changed (90) hide show
  1. package/README.md +1 -1
  2. package/backend/dist/backup/config.d.ts.map +1 -1
  3. package/backend/dist/backup/config.js +14 -3
  4. package/backend/dist/backup/config.js.map +1 -1
  5. package/backend/dist/backup/engine.d.ts +1 -1
  6. package/backend/dist/backup/engine.d.ts.map +1 -1
  7. package/backend/dist/backup/engine.js +16 -2
  8. package/backend/dist/backup/engine.js.map +1 -1
  9. package/backend/dist/backup/scheduler.d.ts.map +1 -1
  10. package/backend/dist/backup/scheduler.js +3 -1
  11. package/backend/dist/backup/scheduler.js.map +1 -1
  12. package/backend/dist/index.d.ts.map +1 -1
  13. package/backend/dist/index.js +6 -2
  14. package/backend/dist/index.js.map +1 -1
  15. package/backend/dist/memory-pool/templates.d.ts +4 -0
  16. package/backend/dist/memory-pool/templates.d.ts.map +1 -0
  17. package/backend/dist/memory-pool/templates.js +267 -0
  18. package/backend/dist/memory-pool/templates.js.map +1 -0
  19. package/backend/dist/notify-service.d.ts.map +1 -1
  20. package/backend/dist/notify-service.js +8 -3
  21. package/backend/dist/notify-service.js.map +1 -1
  22. package/backend/dist/plan-control/executor.d.ts +2 -0
  23. package/backend/dist/plan-control/executor.d.ts.map +1 -1
  24. package/backend/dist/plan-control/executor.js +39 -5
  25. package/backend/dist/plan-control/executor.js.map +1 -1
  26. package/backend/dist/plan-control/templates.d.ts +3 -3
  27. package/backend/dist/plan-control/templates.d.ts.map +1 -1
  28. package/backend/dist/plan-control/templates.js +53 -2
  29. package/backend/dist/plan-control/templates.js.map +1 -1
  30. package/backend/dist/routes/auth.d.ts.map +1 -1
  31. package/backend/dist/routes/auth.js +14 -3
  32. package/backend/dist/routes/auth.js.map +1 -1
  33. package/backend/dist/routes/backup.d.ts.map +1 -1
  34. package/backend/dist/routes/backup.js +57 -3
  35. package/backend/dist/routes/backup.js.map +1 -1
  36. package/backend/dist/routes/filesystem.d.ts.map +1 -1
  37. package/backend/dist/routes/filesystem.js +4 -2
  38. package/backend/dist/routes/filesystem.js.map +1 -1
  39. package/backend/dist/routes/hooks.d.ts.map +1 -1
  40. package/backend/dist/routes/hooks.js +37 -2
  41. package/backend/dist/routes/hooks.js.map +1 -1
  42. package/backend/dist/routes/memory-pool.d.ts +3 -0
  43. package/backend/dist/routes/memory-pool.d.ts.map +1 -0
  44. package/backend/dist/routes/memory-pool.js +159 -0
  45. package/backend/dist/routes/memory-pool.js.map +1 -0
  46. package/backend/dist/routes/plugin-bridge.d.ts.map +1 -1
  47. package/backend/dist/routes/plugin-bridge.js +5 -0
  48. package/backend/dist/routes/plugin-bridge.js.map +1 -1
  49. package/backend/dist/routes/plugins.js +1 -1
  50. package/backend/dist/routes/plugins.js.map +1 -1
  51. package/backend/dist/routes/projects.d.ts.map +1 -1
  52. package/backend/dist/routes/projects.js +4 -0
  53. package/backend/dist/routes/projects.js.map +1 -1
  54. package/backend/dist/routes/share.d.ts.map +1 -1
  55. package/backend/dist/routes/share.js +27 -12
  56. package/backend/dist/routes/share.js.map +1 -1
  57. package/backend/dist/routes/shortcuts.d.ts.map +1 -1
  58. package/backend/dist/routes/shortcuts.js +10 -5
  59. package/backend/dist/routes/shortcuts.js.map +1 -1
  60. package/backend/dist/routes/skillhub.d.ts.map +1 -1
  61. package/backend/dist/routes/skillhub.js +11 -2
  62. package/backend/dist/routes/skillhub.js.map +1 -1
  63. package/backend/dist/routes/update.d.ts.map +1 -1
  64. package/backend/dist/routes/update.js +16 -9
  65. package/backend/dist/routes/update.js.map +1 -1
  66. package/backend/dist/terminal-manager.d.ts.map +1 -1
  67. package/backend/dist/terminal-manager.js +5 -2
  68. package/backend/dist/terminal-manager.js.map +1 -1
  69. package/frontend/dist/assets/{GraphPreview-feAPYB5u.js → GraphPreview-CbixawCn.js} +2 -2
  70. package/frontend/dist/assets/OfficePreview-BKFpUTs8.js +2 -0
  71. package/frontend/dist/assets/PlanPanel-bUu_sV4H.js +13 -0
  72. package/frontend/dist/assets/ProjectPage-s1JC2yAP.js +26 -0
  73. package/frontend/dist/assets/{SettingsPage-CYQjVIeH.js → SettingsPage-VWurD9vD.js} +2 -2
  74. package/frontend/dist/assets/{ShareViewPage-Dn3EcZ5d.js → ShareViewPage-BzJceBPR.js} +1 -1
  75. package/frontend/dist/assets/{SkillHubPage-C-xu9SLm.js → SkillHubPage-z6-QYbeA.js} +2 -2
  76. package/frontend/dist/assets/{bot-Bif2ovQt.js → bot-C6ta8gNS.js} +1 -1
  77. package/frontend/dist/assets/{chevron-down-OwwVCmlq.js → chevron-down-Qw7I16EM.js} +1 -1
  78. package/frontend/dist/assets/{download-BP9ssOVk.js → download-f-UhXlfC.js} +1 -1
  79. package/frontend/dist/assets/{index-DT0eASks.css → index-DI_KxA3y.css} +1 -1
  80. package/frontend/dist/assets/{index-YFMWntDQ.js → index-F8RufYqJ.js} +1 -1
  81. package/frontend/dist/assets/{index-4zUhcEdy.js → index-eauITBRu.js} +4 -4
  82. package/frontend/dist/assets/{jszip.min-CVjUiTKy.js → jszip.min-CNjQoxL5.js} +1 -1
  83. package/frontend/dist/assets/{maximize-2-px9TeTfg.js → maximize-2-BKTJzQIz.js} +1 -1
  84. package/frontend/dist/assets/{save-DmHhw7Kk.js → save-y3-fzCMJ.js} +1 -1
  85. package/frontend/dist/assets/{user-02ng5LoF.js → user-cRXoceLl.js} +1 -1
  86. package/frontend/dist/index.html +2 -2
  87. package/package.json +1 -1
  88. package/frontend/dist/assets/OfficePreview-Cqsgj27r.js +0 -3
  89. package/frontend/dist/assets/PlanPanel-fI-aULxe.js +0 -13
  90. package/frontend/dist/assets/ProjectPage-BtAMiJYD.js +0 -26
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-YFMWntDQ.js","assets/index-4zUhcEdy.js","assets/index-DT0eASks.css","assets/jszip.min-CVjUiTKy.js"])))=>i.map(i=>d[i]);
2
- import{j as e,r as t,_ as n,b as o,h as r}from"./index-4zUhcEdy.js";
3
- /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:a,setPrototypeOf:i,isFrozen:l,getPrototypeOf:s,getOwnPropertyDescriptor:c}=Object;let{freeze:u,seal:m,create:p}=Object,{apply:d,construct:f}="undefined"!=typeof Reflect&&Reflect;u||(u=function(e){return e}),m||(m=function(e){return e}),d||(d=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return e.apply(t,o)}),f||(f=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return new e(...n)});const h=C(Array.prototype.forEach),g=C(Array.prototype.lastIndexOf),T=C(Array.prototype.pop),x=C(Array.prototype.push),y=C(Array.prototype.splice),E=C(String.prototype.toLowerCase),_=C(String.prototype.toString),b=C(String.prototype.match),A=C(String.prototype.replace),S=C(String.prototype.indexOf),N=C(String.prototype.trim),w=C(Object.prototype.hasOwnProperty),v=C(RegExp.prototype.test),D=(R=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f(R,t)});var R;function C(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return d(e,t,o)}}function O(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;i&&i(e,null);let o=t.length;for(;o--;){let r=t[o];if("string"==typeof r){const e=n(r);e!==r&&(l(t)||(t[o]=e),r=e)}e[r]=!0}return e}function k(e){for(let t=0;t<e.length;t++){w(e,t)||(e[t]=null)}return e}function L(e){const t=p(null);for(const[n,o]of a(e)){w(e,n)&&(Array.isArray(o)?t[n]=k(o):o&&"object"==typeof o&&o.constructor===Object?t[n]=L(o):t[n]=o)}return t}function I(e,t){for(;null!==e;){const n=c(e,t);if(n){if(n.get)return C(n.get);if("function"==typeof n.value)return C(n.value)}e=s(e)}return function(){return null}}const M=u(["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"]),z=u(["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"]),P=u(["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"]),U=u(["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"]),F=u(["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"]),H=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),j=u(["#text"]),B=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),G=u(["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","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-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"]),W=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),Y=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),X=m(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$=m(/<%[\w\W]*|[\w\W]*%>/gm),q=m(/\$\{[\w\W]*/gm),V=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),K=m(/^aria-[\-\w]+$/),Z=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),J=m(/^(?:\w+script|data):/i),Q=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ee=m(/^html$/i),te=m(/^[a-z][.\w]*(-[.\w]+)+$/i);var ne=Object.freeze({__proto__:null,ARIA_ATTR:K,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:te,DATA_ATTR:V,DOCTYPE_NAME:ee,ERB_EXPR:$,IS_ALLOWED_URI:Z,IS_SCRIPT_OR_DATA:J,MUSTACHE_EXPR:X,TMPLIT_EXPR:q});const oe=1,re=3,ae=7,ie=8,le=9;var se=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const n=t=>e(t);if(n.version="3.3.3",n.removed=[],!t||!t.document||t.document.nodeType!==le||!t.Element)return n.isSupported=!1,n;let{document:o}=t;const r=o,i=r.currentScript,{DocumentFragment:l,HTMLTemplateElement:s,Node:c,Element:m,NodeFilter:d,NamedNodeMap:f=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:R,DOMParser:C,trustedTypes:k}=t,X=m.prototype,$=I(X,"cloneNode"),q=I(X,"remove"),V=I(X,"nextSibling"),K=I(X,"childNodes"),J=I(X,"parentNode");if("function"==typeof s){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let Q,te="";const{implementation:se,createNodeIterator:ce,createDocumentFragment:ue,getElementsByTagName:me}=o,{importNode:pe}=r;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof a&&"function"==typeof J&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:fe,ERB_EXPR:he,TMPLIT_EXPR:ge,DATA_ATTR:Te,ARIA_ATTR:xe,IS_SCRIPT_OR_DATA:ye,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:_e}=ne;let{IS_ALLOWED_URI:be}=ne,Ae=null;const Se=O({},[...M,...z,...P,...F,...j]);let Ne=null;const we=O({},[...B,...G,...W,...Y]);let ve=Object.seal(p(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}})),De=null,Re=null;const Ce=Object.seal(p(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Oe=!0,ke=!0,Le=!1,Ie=!0,Me=!1,ze=!0,Pe=!1,Ue=!1,Fe=!1,He=!1,je=!1,Be=!1,Ge=!0,We=!1,Ye=!0,Xe=!1,$e={},qe=null;const Ve=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ke=null;const Ze=O({},["audio","video","img","source","image","track"]);let Je=null;const Qe=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,at=null;const it=O({},[et,tt,nt],_);let lt=O({},["mi","mo","mn","ms","mtext"]),st=O({},["annotation-xml"]);const ct=O({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,dt=null;const ft=o.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!dt||dt!==e){if(e&&"object"==typeof e||(e={}),e=L(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?_:E,Ae=w(e,"ALLOWED_TAGS")?O({},e.ALLOWED_TAGS,pt):Se,Ne=w(e,"ALLOWED_ATTR")?O({},e.ALLOWED_ATTR,pt):we,at=w(e,"ALLOWED_NAMESPACES")?O({},e.ALLOWED_NAMESPACES,_):it,Je=w(e,"ADD_URI_SAFE_ATTR")?O(L(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ke=w(e,"ADD_DATA_URI_TAGS")?O(L(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,qe=w(e,"FORBID_CONTENTS")?O({},e.FORBID_CONTENTS,pt):Ve,De=w(e,"FORBID_TAGS")?O({},e.FORBID_TAGS,pt):L({}),Re=w(e,"FORBID_ATTR")?O({},e.FORBID_ATTR,pt):L({}),$e=!!w(e,"USE_PROFILES")&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,ke=!1!==e.ALLOW_DATA_ATTR,Le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,ze=!1!==e.SAFE_FOR_XML,Pe=e.WHOLE_DOCUMENT||!1,He=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Fe=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,We=e.SANITIZE_NAMED_PROPS||!1,Ye=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||Z,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,st=e.HTML_INTEGRATION_POINTS||st,ve=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ve.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ve.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ve.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(ke=!1),je&&(He=!0),$e&&(Ae=O({},j),Ne=p(null),!0===$e.html&&(O(Ae,M),O(Ne,B)),!0===$e.svg&&(O(Ae,z),O(Ne,G),O(Ne,Y)),!0===$e.svgFilters&&(O(Ae,P),O(Ne,G),O(Ne,Y)),!0===$e.mathMl&&(O(Ae,F),O(Ne,W),O(Ne,Y))),w(e,"ADD_TAGS")||(Ce.tagCheck=null),w(e,"ADD_ATTR")||(Ce.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Ce.tagCheck=e.ADD_TAGS:(Ae===Se&&(Ae=L(Ae)),O(Ae,e.ADD_TAGS,pt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Ce.attributeCheck=e.ADD_ATTR:(Ne===we&&(Ne=L(Ne)),O(Ne,e.ADD_ATTR,pt))),e.ADD_URI_SAFE_ATTR&&O(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&(qe===Ve&&(qe=L(qe)),O(qe,e.FORBID_CONTENTS,pt)),e.ADD_FORBID_CONTENTS&&(qe===Ve&&(qe=L(qe)),O(qe,e.ADD_FORBID_CONTENTS,pt)),Ye&&(Ae["#text"]=!0),Pe&&O(Ae,["html","head","body"]),Ae.table&&(O(Ae,["tbody"]),delete De.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw D('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw D('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Q=e.TRUSTED_TYPES_POLICY,te=Q.createHTML("")}else void 0===Q&&(Q=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(a){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(k,i)),null!==Q&&"string"==typeof te&&(te=Q.createHTML(""));u&&u(e),dt=e}},Tt=O({},[...z,...P,...U]),xt=O({},[...F,...H]),yt=function(e){x(n.removed,{element:e});try{J(e).removeChild(e)}catch(t){q(e)}},Et=function(e,t){try{x(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(o){x(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(He||je)try{yt(t)}catch(o){}else try{t.setAttribute(e,"")}catch(o){}},_t=function(e){let t=null,n=null;if(Fe)e="<remove></remove>"+e;else{const t=b(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=Q?Q.createHTML(e):e;if(ot===nt)try{t=(new C).parseFromString(r,ut)}catch(i){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?te:r}catch(i){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),ot===nt?me.call(t,Pe?"html":"body")[0]:Pe?t.documentElement:a},bt=function(e){return ce.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},At=function(e){return e instanceof R&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof f)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},St=function(e){return"function"==typeof c&&e instanceof c};function Nt(e,t,o){h(e,e=>{e.call(n,t,o,dt)})}const wt=function(e){let t=null;if(Nt(de.beforeSanitizeElements,e,null),At(e))return yt(e),!0;const o=pt(e.nodeName);if(Nt(de.uponSanitizeElement,e,{tagName:o,allowedTags:Ae}),ze&&e.hasChildNodes()&&!St(e.firstElementChild)&&v(/<[/\w!]/g,e.innerHTML)&&v(/<[/\w!]/g,e.textContent))return yt(e),!0;if(e.nodeType===ae)return yt(e),!0;if(ze&&e.nodeType===ie&&v(/<[/\w]/g,e.data))return yt(e),!0;if(!(Ce.tagCheck instanceof Function&&Ce.tagCheck(o))&&(!Ae[o]||De[o])){if(!De[o]&&Dt(o)){if(ve.tagNameCheck instanceof RegExp&&v(ve.tagNameCheck,o))return!1;if(ve.tagNameCheck instanceof Function&&ve.tagNameCheck(o))return!1}if(Ye&&!qe[o]){const t=J(e)||e.parentNode,n=K(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,V(e))}}}return yt(e),!0}return e instanceof m&&!function(e){let t=J(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=E(e.tagName),o=E(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&st[o]:Boolean(xt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!st[o])&&!(t.namespaceURI===et&&!lt[o])&&!xt[n]&&(ct[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!at[e.namespaceURI]))}(e)?(yt(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!v(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&e.nodeType===re&&(t=e.textContent,h([fe,he,ge],e=>{t=A(t,e," ")}),e.textContent!==t&&(x(n.removed,{element:e.cloneNode()}),e.textContent=t)),Nt(de.afterSanitizeElements,e,null),!1):(yt(e),!0)},vt=function(e,t,n){if(Re[t])return!1;if(Ge&&("id"===t||"name"===t)&&(n in o||n in ft))return!1;if(ke&&!Re[t]&&v(Te,t));else if(Oe&&v(xe,t));else if(Ce.attributeCheck instanceof Function&&Ce.attributeCheck(t,e));else if(!Ne[t]||Re[t]){if(!(Dt(e)&&(ve.tagNameCheck instanceof RegExp&&v(ve.tagNameCheck,e)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(e))&&(ve.attributeNameCheck instanceof RegExp&&v(ve.attributeNameCheck,t)||ve.attributeNameCheck instanceof Function&&ve.attributeNameCheck(t,e))||"is"===t&&ve.allowCustomizedBuiltInElements&&(ve.tagNameCheck instanceof RegExp&&v(ve.tagNameCheck,n)||ve.tagNameCheck instanceof Function&&ve.tagNameCheck(n))))return!1}else if(Je[t]);else if(v(be,A(n,Ee,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==S(n,"data:")||!Ke[e]){if(Le&&!v(ye,A(n,Ee,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&b(e,_e)},Rt=function(e){Nt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||At(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:l,namespaceURI:s,value:c}=i,u=pt(l),m=c;let p="value"===l?m:N(m);if(o.attrName=u,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,Nt(de.uponSanitizeAttribute,e,o),p=o.attrValue,!We||"id"!==u&&"name"!==u||(Et(l,e),p="user-content-"+p),ze&&v(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,p)){Et(l,e);continue}if("attributename"===u&&b(p,"href")){Et(l,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){Et(l,e);continue}if(!Ie&&v(/\/>/i,p)){Et(l,e);continue}Me&&h([fe,he,ge],e=>{p=A(p,e," ")});const d=pt(e.nodeName);if(vt(d,u,p)){if(Q&&"object"==typeof k&&"function"==typeof k.getAttributeType)if(s);else switch(k.getAttributeType(d,u)){case"TrustedHTML":p=Q.createHTML(p);break;case"TrustedScriptURL":p=Q.createScriptURL(p)}if(p!==m)try{s?e.setAttributeNS(s,l,p):e.setAttribute(l,p),At(e)?yt(e):T(n.removed)}catch(a){Et(l,e)}}else Et(l,e)}Nt(de.afterSanitizeAttributes,e,null)},Ct=function e(t){let n=null;const o=bt(t);for(Nt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Nt(de.uponSanitizeShadowNode,n,null),wt(n),Rt(n),n.content instanceof l&&e(n.content);Nt(de.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,a=null,i=null,s=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!St(e)){if("function"!=typeof e.toString)throw D("toString is not a function");if("string"!=typeof(e=e.toString()))throw D("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Ue||gt(t),n.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ae[t]||De[t])throw D("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)o=_t("\x3c!----\x3e"),a=o.ownerDocument.importNode(e,!0),a.nodeType===oe&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!He&&!Me&&!Pe&&-1===e.indexOf("<"))return Q&&Be?Q.createHTML(e):e;if(o=_t(e),!o)return He?null:Be?te:""}o&&Fe&&yt(o.firstChild);const u=bt(Xe?e:o);for(;i=u.nextNode();)wt(i),Rt(i),i.content instanceof l&&Ct(i.content);if(Xe)return e;if(He){if(je)for(s=ue.call(o.ownerDocument);o.firstChild;)s.appendChild(o.firstChild);else s=o;return(Ne.shadowroot||Ne.shadowrootmode)&&(s=pe.call(r,s,!0)),s}let m=Pe?o.outerHTML:o.innerHTML;return Pe&&Ae["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&v(ee,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),Me&&h([fe,he,ge],e=>{m=A(m,e," ")}),Q&&Be?Q.createHTML(m):m},n.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Ue=!0},n.clearConfig=function(){dt=null,Ue=!1},n.isValidAttribute=function(e,t,n){dt||gt({});const o=pt(e),r=pt(t);return vt(o,r,n)},n.addHook=function(e,t){"function"==typeof t&&x(de[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=g(de[e],t);return-1===n?void 0:y(de[e],n,1)[0]}return T(de[e])},n.removeHooks=function(e){de[e]=[]},n.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();async function ce(e){let t=r(e);const n=o();n&&(t+=`${t.includes("?")?"&":"?"}token=${encodeURIComponent(n)}`);const a=await fetch(t);if(!a.ok)throw new Error(`Failed to fetch file: ${a.status}`);return a.arrayBuffer()}function ue({filePath:o,zoom:r}){const[a,i]=t.useState(""),[l,s]=t.useState(null),[c,u]=t.useState(!0);return t.useEffect(()=>{let e=!1;return u(!0),s(null),(async()=>{try{const t=await n(()=>import("./index-YFMWntDQ.js").then(e=>e.i),__vite__mapDeps([0,1,2,3])),r=await ce(o),a=await t.convertToHtml({arrayBuffer:r});e||i(a.value)}catch(t){e||s(t instanceof Error?t.message:"Failed to render docx")}finally{e||u(!1)}})(),()=>{e=!0}},[o]),c?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Word 文档中..."}):l?e.jsx("p",{className:"text-sm text-destructive p-4",children:l}):e.jsx("div",{className:"p-6 prose dark:prose-invert max-w-none",style:{fontSize:12*r/100+"px"},dangerouslySetInnerHTML:{__html:se.sanitize(a)}})}function me({filePath:o,zoom:r}){var a;const[i,l]=t.useState([]),[s,c]=t.useState(0),[u,m]=t.useState(null),[p,d]=t.useState(!0);return t.useEffect(()=>{let e=!1;return d(!0),m(null),(async()=>{try{const t=await n(()=>import("./xlsx-DfDjAMCE.js"),[]),r=await ce(o),a=t.read(r,{type:"array"}),i=a.SheetNames.map(e=>({name:e,html:t.utils.sheet_to_html(a.Sheets[e],{editable:!1})}));e||(l(i),c(0))}catch(t){e||m(t instanceof Error?t.message:"Failed to render xlsx")}finally{e||d(!1)}})(),()=>{e=!0}},[o]),p?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Excel 文件中..."}):u?e.jsx("p",{className:"text-sm text-destructive p-4",children:u}):0===i.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsxs("div",{className:"flex flex-col h-full",children:[i.length>1&&e.jsx("div",{className:"flex gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30 flex-shrink-0 overflow-x-auto",children:i.map((t,n)=>e.jsx("button",{onClick:()=>c(n),className:"px-3 py-1 text-xs rounded-t transition-colors whitespace-nowrap "+(n===s?"bg-background text-foreground border border-b-0 border-border":"text-muted-foreground hover:text-foreground"),children:t.name},n))}),e.jsx("div",{className:"flex-1 overflow-auto p-2 xlsx-preview",style:{fontSize:12*r/100+"px"},dangerouslySetInnerHTML:{__html:se.sanitize((null==(a=i[s])?void 0:a.html)??"")}}),e.jsx("style",{children:"\n .xlsx-preview table { border-collapse: collapse; width: auto; min-width: 100%; }\n .xlsx-preview td, .xlsx-preview th {\n border: 1px solid hsl(var(--border));\n padding: 4px 8px;\n text-align: left;\n white-space: nowrap;\n font-size: inherit;\n }\n .xlsx-preview th { background: hsl(var(--muted)); font-weight: 600; }\n .xlsx-preview tr:hover td { background: hsl(var(--accent) / 0.3); }\n "})]})}function pe({filePath:o,zoom:r}){const[a,i]=t.useState([]),[l,s]=t.useState(null),[c,u]=t.useState(!0);return t.useEffect(()=>{let e=!1;return u(!0),s(null),(async()=>{try{const t=await ce(o),r=await async function(e){const{default:t}=await n(async()=>{const{default:e}=await import("./jszip.min-CVjUiTKy.js").then(e=>e.j);return{default:e}},__vite__mapDeps([3,1,2])),o=await t.loadAsync(e),r=[],a=Object.keys(o.files).filter(e=>/^ppt\/slides\/slide\d+\.xml$/i.test(e)).sort((e,t)=>{var n,o;return parseInt((null==(n=e.match(/slide(\d+)/))?void 0:n[1])??"0")-parseInt((null==(o=t.match(/slide(\d+)/))?void 0:o[1])??"0")});for(let n=0;n<a.length;n++){const e=await o.file(a[n]).async("text"),t=[],i=/<a:t[^>]*>([\s\S]*?)<\/a:t>/g;let l;for(;null!==(l=i.exec(e));){const e=l[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').trim();e&&t.push(e)}r.push({index:n+1,texts:t})}return r}(t);e||i(r)}catch(t){e||s(t instanceof Error?t.message:"Failed to render pptx")}finally{e||u(!1)}})(),()=>{e=!0}},[o]),c?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 PPT 文件中..."}):l?e.jsx("p",{className:"text-sm text-destructive p-4",children:l}):0===a.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsx("div",{className:"p-4 space-y-4",style:{fontSize:12*r/100+"px"},children:a.map(t=>e.jsxs("div",{className:"border border-border rounded-lg p-5 bg-muted/20",children:[e.jsxs("div",{className:"text-xs text-muted-foreground mb-2 font-medium",children:["Slide ",t.index]}),t.texts.length>0?e.jsx("div",{className:"space-y-1.5",children:t.texts.map((t,n)=>e.jsx("p",{className:"text-foreground leading-relaxed",style:{fontSize:"inherit"},children:t},n))}):e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"(无文本内容)"})]},t.index))})}const de=new Set(["docx","xlsx","xls","pptx"]);function fe({filePath:t,ext:n,zoom:o}){return"docx"===n?e.jsx(ue,{filePath:t,zoom:o}):"xlsx"===n||"xls"===n?e.jsx(me,{filePath:t,zoom:o}):"pptx"===n?e.jsx(pe,{filePath:t,zoom:o}):null}export{de as OFFICE_EXTS,fe as OfficePreview};
@@ -1,13 +0,0 @@
1
- import{c as e,r as s,j as t,b3 as a,b4 as n,b5 as l,t as r,b6 as i,b7 as o,b8 as c,b9 as d,ba as h,B as x}from"./index-4zUhcEdy.js";import{Z as u,a as m,L as f,P as y,A as g}from"./ProjectPage-BtAMiJYD.js";import{M as b}from"./maximize-2-px9TeTfg.js";import"./save-DmHhw7Kk.js";import"./download-BP9ssOVk.js";import"./chevron-down-OwwVCmlq.js";import"./bot-Bif2ovQt.js";import"./user-02ng5LoF.js";
2
- /**
3
- * @license lucide-react v0.309.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */const p=e("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),j=e("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]),k=e("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),v=e("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),w=140,N=36,C={pending:{fill:"#71717a20",stroke:"#71717a"},running:{fill:"#3b82f633",stroke:"#3b82f6"},success:{fill:"#22c55e26",stroke:"#22c55e"},failed:{fill:"#ef444426",stroke:"#ef4444"},blocked:{fill:"#eab30826",stroke:"#eab308"},skipped:{fill:"#71717a14",stroke:"#71717a"}},M={fill:"#71717a15",stroke:"#52525b"};
8
- /**
9
- * @license lucide-react v0.309.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */function _({tree:e,currentLine:a}){const n=s.useRef(null),[l,r]=s.useState(1),[i,o]=s.useState({x:0,y:0}),[c,d]=s.useState(!1),[h,x]=s.useState({x:0,y:0}),[f,y]=s.useState(null),{layoutNodes:g,edges:p,bounds:j}=s.useMemo(()=>{const s=[],t=[];const a=function e(a,n,l,r){const i=[];let o=l;for(const c of a){const a=40+160*r,n={id:c.id,x:a,y:o,w:w,h:N,type:c.type,label:c.label,status:c.status,node_id:c.node_id,line:c.line,children:[]};if(c.children.length>0){const s=e(c.children,a,o+N+16,r+1);n.children=s.nodes,o=Math.max(o+N+16,o+N+16+s.height);for(const e of s.nodes)t.push({x1:n.x+70,y1:n.y+N,x2:e.x+70,y2:e.y,dashed:"call"===c.type})}else o+=52;i.push(n),s.push(n)}return{nodes:i,height:o-l}}(e,0,20,0);for(let e=1;e<a.nodes.length;e++){const s=a.nodes[e-1],n=a.nodes[e];if(s.x===n.x){const e=z(s);t.push({x1:s.x+70,y1:e,x2:n.x+70,y2:n.y})}}let n=1/0,l=1/0,r=-1/0,i=-1/0;for(const e of s)n=Math.min(n,e.x),l=Math.min(l,e.y),r=Math.max(r,e.x+e.w),i=Math.max(i,e.y+e.h);return{layoutNodes:s,edges:t,bounds:{minX:n,minY:l,maxX:r+40,maxY:i+20}}},[e]);s.useEffect(()=>{k()},[e]),s.useEffect(()=>{if(null===a)return;const e=g.find(e=>e.line===a);if(!e||!n.current)return;const s=n.current.getBoundingClientRect(),t=e.x+70,r=e.y+18;o({x:s.width/2-t*l,y:s.height/2-r*l})},[a]);const k=s.useCallback(()=>{if(!n.current||0===g.length)return;const e=n.current.getBoundingClientRect(),s=j.maxX-j.minX,t=j.maxY-j.minY;if(0===s||0===t)return;const a=.9*Math.min(e.width/s,e.height/t,2);r(a),o({x:(e.width-s*a)/2-j.minX*a,y:(e.height-t*a)/2-j.minY*a})},[g,j]),v=s.useCallback(e=>{e.preventDefault(),r(s=>Math.max(.2,Math.min(3,s+(e.deltaY>0?-.1:.1))))},[]),_=s.useCallback(e=>{0===e.button&&(d(!0),x({x:e.clientX-i.x,y:e.clientY-i.y}))},[i]),S=s.useCallback(e=>{c&&o({x:e.clientX-h.x,y:e.clientY-h.y})},[c,h]),P=s.useCallback(()=>d(!1),[]);return t.jsxs("div",{className:"relative w-full h-full",children:[t.jsxs("div",{className:"absolute top-1 right-1 z-10 flex gap-0.5",children:[t.jsx("button",{className:"p-1 rounded bg-muted/50 hover:bg-muted",onClick:()=>r(e=>Math.min(3,e+.2)),children:t.jsx(u,{className:"h-3 w-3"})}),t.jsx("button",{className:"p-1 rounded bg-muted/50 hover:bg-muted",onClick:()=>r(e=>Math.max(.2,e-.2)),children:t.jsx(m,{className:"h-3 w-3"})}),t.jsx("button",{className:"p-1 rounded bg-muted/50 hover:bg-muted",onClick:k,children:t.jsx(b,{className:"h-3 w-3"})})]}),t.jsxs("svg",{ref:n,className:"w-full h-full",onWheel:v,onMouseDown:_,onMouseMove:S,onMouseUp:P,onMouseLeave:P,style:{cursor:c?"grabbing":"grab"},children:[t.jsx("defs",{children:t.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:t.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#71717a"})})}),t.jsxs("g",{transform:`translate(${i.x},${i.y}) scale(${l})`,children:[p.map((e,s)=>t.jsx("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:"#71717a",strokeWidth:1,strokeDasharray:e.dashed?"4,2":void 0,markerEnd:"url(#arrow)"},`e${s}`)),g.map(e=>{const s=C[e.status??""]??M,n=a===e.line;return t.jsxs("g",{onClick:()=>y(e),style:{cursor:"pointer"},children:[t.jsx("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:6,fill:s.fill,stroke:n?"#60a5fa":s.stroke,strokeWidth:n?2:1,strokeDasharray:"skipped"===e.status?"4,2":void 0}),"running"===e.status&&t.jsx("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:6,fill:"none",stroke:"#3b82f6",strokeWidth:2,opacity:.5,children:t.jsx("animate",{attributeName:"opacity",values:"0.5;0;0.5",dur:"2s",repeatCount:"indefinite"})}),t.jsx("text",{x:e.x+6,y:e.y+13,fontSize:9,fill:"#a1a1aa",fontFamily:"monospace",children:e.type}),t.jsx("text",{x:e.x+6,y:e.y+26,fontSize:10,fill:"#e4e4e7",clipPath:"inset(0 0 0 0)",children:e.label.length>16?e.label.slice(0,16)+"…":e.label}),e.node_id&&t.jsxs("text",{x:e.x+e.w-4,y:e.y+10,fontSize:7,fill:"#71717a",textAnchor:"end",children:["#",e.node_id]})]},e.id)})]})]}),f&&t.jsxs("div",{className:"absolute bottom-2 left-2 right-2 bg-background/95 border border-border rounded-lg p-3 text-xs shadow-lg z-20",onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex justify-between items-start mb-1",children:[t.jsxs("span",{className:"font-mono text-muted-foreground",children:[f.type," L",f.line]}),t.jsx("button",{className:"text-muted-foreground hover:text-foreground",onClick:()=>y(null),children:"✕"})]}),t.jsx("div",{className:"text-foreground mb-1",children:f.label}),f.status&&t.jsxs("div",{className:"text-muted-foreground",children:["状态: ",f.status]}),f.node_id&&t.jsxs("div",{className:"text-muted-foreground",children:["节点 ID: #",f.node_id]})]})]})}function z(e){return 0===e.children.length?e.y+e.h:Math.max(e.y+e.h,...e.children.map(z))}function S({projectId:e,planStatus:u,planNodeUpdate:m,planReplan:b}){const[w,N]=s.useState(null),[C,M]=s.useState(null),[z,S]=s.useState(null),[L,Y]=s.useState(!1);s.useEffect(()=>{let s=!1;return(async()=>{try{const t=await a(e);if(s||N(t),t.hasMainPc){const t=await n(e);s||S(t.tree)}}catch{}})(),()=>{s=!0}},[e]),s.useEffect(()=>{m&&z&&S(e=>e?P(e,m.node_id,m.status):e)},[m]),s.useEffect(()=>{u&&N(e=>e?{...e,state:e.state?{...e.state,...u}:{status:u.status,current_line:u.current_line,executed_tasks:u.executed_tasks,estimated_tasks:u.estimated_tasks}}:e)},[u]),s.useEffect(()=>{b&&n(e).then(e=>S(e.tree)).catch(()=>{})},[b,e]);const X=s.useCallback(async()=>{Y(!0);try{await l(e);const s=await a(e);N(s),r.success("Plan Control 已初始化")}catch(s){r.error(s.message)}finally{Y(!1)}},[e]),E=s.useCallback(async()=>{Y(!0);try{const s=await i(e);if(M(s),s.valid){r.success("语法检查通过");const s=await n(e);S(s.tree)}else r.error(`${s.errors.length} 个语法错误`)}catch(s){r.error(s.message)}finally{Y(!1)}},[e]),D=s.useCallback(async()=>{try{await o(e);const s=await a(e);N(s)}catch(s){r.error(s.message)}},[e]),R=s.useCallback(async()=>{try{await c(e)}catch(s){r.error(s.message)}},[e]),W=s.useCallback(async()=>{try{await d(e);const s=await a(e);N(s)}catch(s){r.error(s.message)}},[e]),$=s.useCallback(async()=>{try{await h(e)}catch(s){r.error(s.message)}},[e]),B=null==w?void 0:w.state,q=(null==B?void 0:B.status)??((null==w?void 0:w.hasMainPc)?"ready":(null==w?void 0:w.initialized)?"editing":"none");return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsxs("div",{className:"flex-none h-8 flex items-center gap-1 px-2 border-b border-border text-xs",children:["none"===q&&t.jsxs(x,{size:"sm",variant:"ghost",className:"h-6 text-xs",onClick:X,disabled:L,children:[L?t.jsx(f,{className:"h-3 w-3 animate-spin mr-1"}):null,"初始化"]}),("editing"===q||"ready"===q)&&t.jsxs(t.Fragment,{children:[t.jsxs(x,{size:"sm",variant:"ghost",className:"h-6 text-xs",onClick:E,disabled:L,children:[L?t.jsx(f,{className:"h-3 w-3 animate-spin mr-1"}):t.jsx(p,{className:"h-3 w-3 mr-1"}),"检查"]}),(null==C?void 0:C.valid)&&t.jsxs(x,{size:"sm",variant:"ghost",className:"h-6 text-xs",onClick:D,children:[t.jsx(y,{className:"h-3 w-3 mr-1"}),"启动"]})]}),("running"===q||"waiting"===q)&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-muted-foreground",children:["已完成 ",(null==B?void 0:B.executed_tasks)??0,"(≥",(null==B?void 0:B.estimated_tasks)??0,")"]}),t.jsx("div",{className:"flex-1"}),t.jsx(x,{size:"sm",variant:"ghost",className:"h-6 text-xs",onClick:R,children:t.jsx(j,{className:"h-3 w-3"})}),t.jsx(x,{size:"sm",variant:"ghost",className:"h-6 text-xs",onClick:$,children:t.jsx(v,{className:"h-3 w-3"})})]}),("paused"===q||"stopped"===q)&&t.jsxs(x,{size:"sm",variant:"ghost",className:"h-6 text-xs",onClick:W,children:[t.jsx(k,{className:"h-3 w-3 mr-1"}),"继续"]}),"completed"===q&&t.jsxs("span",{className:"text-green-500 flex items-center gap-1",children:[t.jsx(p,{className:"h-3 w-3"})," 已完成"]})]}),C&&!C.valid&&t.jsx("div",{className:"flex-none max-h-24 overflow-y-auto px-2 py-1 border-b border-border bg-red-500/5",children:C.errors.map((e,s)=>t.jsxs("div",{className:"text-[10px] text-red-400 flex gap-1",children:[t.jsx(g,{className:"h-3 w-3 flex-shrink-0 mt-0.5"}),t.jsxs("span",{children:["第",e.line,"行: ",e.message]})]},s))}),t.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:z?t.jsx(_,{tree:z,currentLine:(null==B?void 0:B.current_line)??null}):t.jsx("div",{className:"flex items-center justify-center h-full text-xs text-muted-foreground",children:(null==w?void 0:w.initialized)?(null==w?void 0:w.hasMainPc)?'点击"检查"查看任务树':"等待 AI 编写计划...":'点击"初始化"开始'})})]})}function P(e,s,t){return e.map(e=>e.node_id===s?{...e,status:t}:e.children.length>0?{...e,children:P(e.children,s,t)}:e)}export{S as PlanPanel};