lke-component 2.0.0-beta.13 → 2.0.0-beta.14

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.
@@ -26,7 +26,7 @@
26
26
  `,f&&Object.keys(f).length>0){const C=S.renderer.rules.link_open||function(A,T,D,k,M){return M.renderToken(A,T,D)};S.renderer.rules.link_open=(A,T,D,k,M)=>(Object.keys(f).map(I=>{let N=A[T].attrIndex(I),L=f[I];N<0?A[T].attrPush([I,L]):A[T].attrs[N][1]=L}),C(A,T,D,k,M))}return h&&S.use(aI,{tocClassName:d,tocFirstLevel:p,...v?{tocLastLevel:v}:{},anchorLink:g,anchorLinkSymbol:m,anchorLinkSpace:y,anchorClassName:_,anchorLinkSymbolClassName:b,tocCallback:(C,A,T)=>{T&&(x&&document.getElementById(x)&&(document.getElementById(x).innerHTML=T),w&&w(T))}}),S}function Q_(e,t){const r=new RegExp("&(?!#?\\w+;)","g");return e&&e.replace?e.replace(t?new RegExp("&","g"):r,"&amp;").replace(new RegExp("<","g"),"&lt;").replace(new RegExp(">","g"),"&gt;").replace(new RegExp('"',"g"),"&quot;").replace(new RegExp("'","g"),"&#39;"):e}function J_(e){return e&&e.replace?e.replace(new RegExp("&quot;","g"),'"').replace(new RegExp("&#39;","g"),"'").replace(new RegExp("&lt;","g"),"<").replace(new RegExp("&gt;","g"),">").replace(new RegExp("&amp;","g"),"&").replace(new RegExp("<span>\\\\<\\/span>","g"),"\\\\"):e}function eb(e){const t=[],r=new RegExp("```[\\s\\S]*?```","g");return{modifiedMdString:e.replace(r,i=>(t.push(i),"{{CODE_BLOCK}}")),codeBlocks:t}}function tb(e,t){const r=new RegExp("\\{\\{CODE_BLOCK\\}\\}","g");let n=0;return e.replace(r,()=>t[n++])}function rb(e){const t=new RegExp("<video[\\s\\S]*?<\\/video>","gi"),r=[];return{replacedString:e.replace(t,i=>{const a=i.replace(/>\s+</g,"><").replace(/\n\s*/g," ").trim();return r.push(a),"HTML@@Video"}),videoTags:r}}function nb(e,t){let r=e;return t.forEach(n=>{r=r.replace("HTML@@Video",n)}),r}const wI={"$@$":"DEOLLERQ1","$@":"DEOLLERQ2"};Object.fromEntries(Object.entries(wI).map(([e,t])=>[t,e]));let Zs;const Fp=()=>{if(typeof Zs=="boolean")return Zs;try{new RegExp("(?<!x)y"),Zs=!0}catch{Zs=!1}return Zs},SI=e=>(console.log(9999,Fp()),Fp()?e.replace(new RegExp("(?<!!)\\[\\]\\((https?:\\/\\/[^)]+)\\)","g"),function(r,n){return"["+n+"]("+n+")"}):e.replace(new RegExp("(\\!?)(\\[\\]\\((https?:\\/\\/[^)]+)\\))","g"),function(t,r,n,i){return r==="!"?t:"["+i+"]("+i+")"}));var Bh={exports:{}},tt={},Fh={exports:{}},uo={};function ib(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function CI(e,t,r){}function AI(e,t,r){}var TI=/javascript\s*\:/img;function DI(e,t){return TI.test(t)?"":t}uo.whiteList=ib();uo.getDefaultWhiteList=ib;uo.onAttr=CI;uo.onIgnoreAttr=AI;uo.safeAttrValue=DI;var EI={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,i;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},Ys=EI;function kI(e,t){e=Ys.trimRight(e),e[e.length-1]!==";"&&(e+=";");var r=e.length,n=!1,i=0,a=0,o="";function s(){if(!n){var c=Ys.trim(e.slice(i,a)),f=c.indexOf(":");if(f!==-1){var h=Ys.trim(c.slice(0,f)),d=Ys.trim(c.slice(f+1));if(h){var p=t(i,o.length,h,d,c);p&&(o+=p+"; ")}}}i=a+1}for(;a<r;a++){var u=e[a];if(u==="/"&&e[a+1]==="*"){var l=e.indexOf("*/",a+2);if(l===-1)break;a=l+1,i=a+1,n=!1}else u==="("?n=!0:u===")"?n=!1:u===";"?n||s():u===`
27
27
  `&&s()}return Ys.trim(o)}var MI=kI,u1=uo,LI=MI;function zp(e){return e==null}function II(e){var t={};for(var r in e)t[r]=e[r];return t}function ab(e){e=II(e||{}),e.whiteList=e.whiteList||u1.whiteList,e.onAttr=e.onAttr||u1.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||u1.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||u1.safeAttrValue,this.options=e}ab.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,i=r.onAttr,a=r.onIgnoreAttr,o=r.safeAttrValue,s=LI(e,function(u,l,c,f,h){var d=n[c],p=!1;if(d===!0?p=d:typeof d=="function"?p=d(f):d instanceof RegExp&&(p=d.test(f)),p!==!0&&(p=!1),f=o(c,f),!!f){var v={position:l,sourcePosition:u,source:h,isWhite:p};if(p){var g=i(c,f,v);return zp(g)?c+":"+f:g}else{var g=a(c,f,v);if(!zp(g))return g}}});return s};var PI=ab;(function(e,t){var r=uo,n=PI;function i(o,s){var u=new n(s);return u.process(o)}t=e.exports=i,t.FilterCSS=n;for(var a in r)t[a]=r[a];typeof window<"u"&&(window.filterCSS=e.exports)})(Fh,Fh.exports);var V4=Fh.exports,$4={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,i;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,r=t.exec(e);return r?r.index:-1}},RI=V4.FilterCSS,NI=V4.getDefaultWhiteList,U0=$4;function ob(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var sb=new RI;function OI(e,t,r){}function BI(e,t,r){}function FI(e,t,r){}function zI(e,t,r){}function ub(e){return e.replace($I,"&lt;").replace(GI,"&gt;")}function VI(e,t,r,n){if(r=pb(r),t==="href"||t==="src"){if(r=U0.trim(r),r==="#")return"#";if(!(r.substr(0,7)==="http://"||r.substr(0,8)==="https://"||r.substr(0,7)==="mailto:"||r.substr(0,4)==="tel:"||r.substr(0,11)==="data:image/"||r.substr(0,6)==="ftp://"||r.substr(0,2)==="./"||r.substr(0,3)==="../"||r[0]==="#"||r[0]==="/"))return""}else if(t==="background"){if(l1.lastIndex=0,l1.test(r))return""}else if(t==="style"){if(Vp.lastIndex=0,Vp.test(r)||($p.lastIndex=0,$p.test(r)&&(l1.lastIndex=0,l1.test(r))))return"";n!==!1&&(n=n||sb,r=n.process(r))}return r=vb(r),r}var $I=/</g,GI=/>/g,HI=/"/g,UI=/&quot;/g,WI=/&#([a-zA-Z0-9]*);?/gim,qI=/&colon;?/gim,ZI=/&newline;?/gim,l1=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Vp=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,$p=/u\s*r\s*l\s*\(.*/gi;function lb(e){return e.replace(HI,"&quot;")}function cb(e){return e.replace(UI,'"')}function fb(e){return e.replace(WI,function(r,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10))})}function hb(e){return e.replace(qI,":").replace(ZI," ")}function db(e){for(var t="",r=0,n=e.length;r<n;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return U0.trim(t)}function pb(e){return e=cb(e),e=fb(e),e=hb(e),e=db(e),e}function vb(e){return e=lb(e),e=ub(e),e}function YI(){return""}function XI(e,t){typeof t!="function"&&(t=function(){});var r=!Array.isArray(e);function n(o){return r?!0:U0.indexOf(e,o)!==-1}var i=[],a=!1;return{onIgnoreTag:function(o,s,u){if(n(o))if(u.isClosing){var l="[/removed]",c=u.position+l.length;return i.push([a!==!1?a:u.position,c]),a=!1,l}else return a||(a=u.position),"[removed]";else return t(o,s,u)},remove:function(o){var s="",u=0;return U0.forEach(i,function(l){s+=o.slice(u,l[0]),u=l[1]}),s+=o.slice(u),s}}}function jI(e){for(var t="",r=0;r<e.length;){var n=e.indexOf("<!--",r);if(n===-1){t+=e.slice(r);break}t+=e.slice(r,n);var i=e.indexOf("-->",n);if(i===-1)break;r=i+3}return t}function KI(e){var t=e.split("");return t=t.filter(function(r){var n=r.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0}),t.join("")}tt.whiteList=ob();tt.getDefaultWhiteList=ob;tt.onTag=OI;tt.onIgnoreTag=BI;tt.onTagAttr=FI;tt.onIgnoreTagAttr=zI;tt.safeAttrValue=VI;tt.escapeHtml=ub;tt.escapeQuote=lb;tt.unescapeQuote=cb;tt.escapeHtmlEntities=fb;tt.escapeDangerHtml5Entities=hb;tt.clearNonPrintableCharacter=db;tt.friendlyAttrValue=pb;tt.escapeAttrValue=vb;tt.onIgnoreTagStripAll=YI;tt.StripTagBody=XI;tt.stripCommentTag=jI;tt.stripBlankChar=KI;tt.attributeWrapSign='"';tt.cssFilter=sb;tt.getDefaultCSSWhiteList=NI;var Qc={},vi=$4;function QI(e){var t=vi.spaceIndex(e),r;return t===-1?r=e.slice(1,-1):r=e.slice(1,t+1),r=vi.trim(r).toLowerCase(),r.slice(0,1)==="/"&&(r=r.slice(1)),r.slice(-1)==="/"&&(r=r.slice(0,-1)),r}function JI(e){return e.slice(0,2)==="</"}function eP(e,t,r){var n="",i=0,a=!1,o=!1,s=0,u=e.length,l="",c="";e:for(s=0;s<u;s++){var f=e.charAt(s);if(a===!1){if(f==="<"){a=s;continue}}else if(o===!1){if(f==="<"){n+=r(e.slice(i,s)),a=s,i=s;continue}if(f===">"||s===u-1){n+=r(e.slice(i,a)),c=e.slice(a,s+1),l=QI(c),n+=t(a,n.length,l,c,JI(c)),i=s+1,a=!1;continue}if(f==='"'||f==="'")for(var h=1,d=e.charAt(s-h);d.trim()===""||d==="=";){if(d==="="){o=f;continue e}d=e.charAt(s-++h)}}else if(f===o){o=!1;continue}}return i<u&&(n+=r(e.substr(i))),n}var tP=/[^a-zA-Z0-9\\_:.-]/gim;function rP(e,t){var r=0,n=0,i=[],a=!1,o=e.length;function s(h,d){if(h=vi.trim(h),h=h.replace(tP,"").toLowerCase(),!(h.length<1)){var p=t(h,d||"");p&&i.push(p)}}for(var u=0;u<o;u++){var l=e.charAt(u),c,f;if(a===!1&&l==="="){a=e.slice(r,u),r=u+1,n=e.charAt(r)==='"'||e.charAt(r)==="'"?r:iP(e,u+1);continue}if(a!==!1&&u===n){if(f=e.indexOf(l,u+1),f===-1)break;c=vi.trim(e.slice(n+1,f)),s(a,c),a=!1,u=f,r=u+1;continue}if(/\s|\n|\t/.test(l))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(f=nP(e,u),f===-1){c=vi.trim(e.slice(r,u)),s(c),a=!1,r=u+1;continue}else{u=f-1;continue}else if(f=aP(e,u-1),f===-1){c=vi.trim(e.slice(r,u)),c=Gp(c),s(a,c),a=!1,r=u+1;continue}else continue}return r<e.length&&(a===!1?s(e.slice(r)):s(a,Gp(vi.trim(e.slice(r))))),vi.trim(i.join(" "))}function nP(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="="?t:-1}}function iP(e,t){for(;t<e.length;t++){var r=e[t];if(r!==" ")return r==="'"||r==='"'?t:-1}}function aP(e,t){for(;t>0;t--){var r=e[t];if(r!==" ")return r==="="?t:-1}}function oP(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function Gp(e){return oP(e)?e.substr(1,e.length-2):e}Qc.parseTag=eP;Qc.parseAttr=rP;var sP=V4.FilterCSS,xr=tt,gb=Qc,uP=gb.parseTag,lP=gb.parseAttr,b0=$4;function c1(e){return e==null}function cP(e){var t=b0.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=b0.trim(e.slice(t+1,-1));var r=e[e.length-1]==="/";return r&&(e=b0.trim(e.slice(0,-1))),{html:e,closing:r}}function fP(e){var t={};for(var r in e)t[r]=e[r];return t}function hP(e){var t={};for(var r in e)Array.isArray(e[r])?t[r.toLowerCase()]=e[r].map(function(n){return n.toLowerCase()}):t[r.toLowerCase()]=e[r];return t}function mb(e){e=fP(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=xr.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=hP(e.whiteList||e.allowList):e.whiteList=xr.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":xr.attributeWrapSign,e.onTag=e.onTag||xr.onTag,e.onTagAttr=e.onTagAttr||xr.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||xr.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||xr.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||xr.safeAttrValue,e.escapeHtml=e.escapeHtml||xr.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new sP(e.css))}mb.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,i=r.onTag,a=r.onIgnoreTag,o=r.onTagAttr,s=r.onIgnoreTagAttr,u=r.safeAttrValue,l=r.escapeHtml,c=t.attributeWrapSign,f=t.cssFilter;r.stripBlankChar&&(e=xr.stripBlankChar(e)),r.allowCommentTag||(e=xr.stripCommentTag(e));var h=!1;r.stripIgnoreTagBody&&(h=xr.StripTagBody(r.stripIgnoreTagBody,a),a=h.onIgnoreTag);var d=uP(e,function(p,v,g,m,y){var _={sourcePosition:p,position:v,isClosing:y,isWhite:Object.prototype.hasOwnProperty.call(n,g)},b=i(g,m,_);if(!c1(b))return b;if(_.isWhite){if(_.isClosing)return"</"+g+">";var x=cP(m),w=n[g],S=lP(x.html,function(C,A){var T=b0.indexOf(w,C)!==-1,D=o(g,C,A,T);return c1(D)?T?(A=u(g,C,A,f),A?C+"="+c+A+c:C):(D=s(g,C,A,T),c1(D)?void 0:D):D});return m="<"+g,S&&(m+=" "+S),x.closing&&(m+=" /"),m+=">",m}else return b=a(g,m,_),c1(b)?l(m):b},l);return h&&(d=h.remove(d)),d};var dP=mb;(function(e,t){var r=tt,n=Qc,i=dP;function a(s,u){var l=new i(u);return l.process(s)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var s in r)t[s]=r[s];for(var u in n)t[u]=n[u]}(),typeof window<"u"&&(window.filterXSS=e.exports);function o(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=e.exports)})(Bh,Bh.exports);var Un=Bh.exports;const Jc=Un.getDefaultWhiteList();Jc.a=["href","title","target"];Jc.source=["src","type"];console.log("myWhiteList",Jc);const yb={css:!1,whiteList:Jc,onTag:function(e,t,r){return e.startsWith("mjx-")||e.startsWith("mjx")||e.startsWith("mj")?t:null},onTagAttr(e,t,r,n){if((f=>f?/[<>]|[\"']\\s*>|=\\s*[\"'][^\"']*>|javascript:|data:text\/html|onerror|onload|onclick|onmouseover|on\\w+\\s*=|vbscript:/i.test(f):!1)(r))return console.log(`阻止包含危险字符的属性: ${e} ${t}="${r}"`),"";if(e.indexOf("_")!==-1)return`${t}="${r}"`;if(["div","span","strong","p","mark"].includes(e)&&!new RegExp("^on").test(t))return`${t}="${r}"`;if(["class","style"].includes(t))return`${t}="${r}"`;if(e==="a"&&["rel","data-link-url"].includes(t))return`${t}="${r}"`;if(e==="a"&&t==="href"){const f=["qdweb","qdim","mqqwpa"],h=r.split(":")[0];if(f.includes(h))return`${t}="${Un.escapeAttrValue(r)}"`}if(e==="video"&&["rel","webkit-playsinline","x5-playsinline","title","size","format"].includes(t))return`${t}="${r}"`;if(e==="audio"&&["controls","controlslist","id","speed","title","size","format","data-duration-ms"].includes(t))return`${t}="${r}"`;if(e==="img"&&["alt","data-value"].includes(t))return`${t}="${r}"`;if((e.startsWith("mjx-")||e.startsWith("mjx")||e.startsWith("mj")||e.startsWith("mo"))&&(t==="class"||t==="style"))return`${t}="${Un.escapeAttrValue(r)}"`}},G4=Un.getDefaultWhiteList();G4.a=["href","title","target"];G4.source=["src","type"];const pP={css:!1,whiteList:G4,onTag:function(e,t,r){return e.startsWith("mjx-")||e.startsWith("mjx")||e.startsWith("mj")?t:null},onTagAttr(e,t,r,n){if((f=>f?/[<>]|["']\s*>|=\s*["'][^"']*>|javascript:|data:text\/html|onerror|onload|onclick|onmouseover|on\w+\s*=|vbscript:/i.test(f):!1)(r))return console.log(`阻止包含危险字符的属性: ${e} ${t}="${r}"`),"";if(e.indexOf("_")!==-1)return`${t}="${r}"`;if(["div","span","strong","p","mark"].includes(e)&&!new RegExp("^on").test(t))return`${t}="${r}"`;if(["class","style"].includes(t))return`${t}="${r}"`;if(e==="a"&&["rel","data-link-url"].includes(t))return`${t}="${r}"`;if(e==="a"&&t==="href"){const f=["qdweb","qdim","mqqwpa"],h=r.split(":")[0];if(f.includes(h))return`${t}="${Un.escapeAttrValue(r)}"`}if(e==="video"&&["rel","webkit-playsinline","x5-playsinline","title","size","format"].includes(t))return`${t}="${r}"`;if(e==="audio"&&["controls","controlslist","id","speed","title","size","format","data-duration-ms"].includes(t))return`${t}="${r}"`;if(e==="img"&&["alt","data-value"].includes(t))return`${t}="${r}"`;if((e.startsWith("mjx-")||e.startsWith("mjx")||e.startsWith("mj")||e.startsWith("mo"))&&(t==="class"||t==="style"))return`${t}="${Un.escapeAttrValue(r)}"`}},vP={success:"success",failed:"failed",processing:"processing",stop:"stop"};window.isMathJaxLoaded=!1;function gP({loadType:e,url:t}){if(console.log("injectMathJax 3"),!window.isMathJaxLoaded){const r=document.createElement("script");r.src=window.mathjaxSrc?window.mathjaxSrc:"https://cdn.xiaowei.qq.com/webim/assets/static/mathjax/es5/tex-chtml.min.es5.js",r.async=!0,document.head.appendChild(r)}}function _b(e={},t){if(window.isMathJaxLoaded)t&&t();else if(window.MathJax){const r=window.MathJax.startup.pageReady;window.MathJax.startup.pageReady=()=>{console.log("MathJax callback"),t&&t(),window.isMathJaxLoaded=!0,r()}}else gP({}),window.MathJax={loader:{load:["[tex]/mhchem"]},tex:{inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEnvironments:!0,processRefs:!0,processEscapes:!0,packages:{"[+]":["mhchem"]},equationNumbers:{autoNumber:"AMS"}},options:{skipHtmlTags:["script","noscript","style","textarea","pre","code","a"],ignoreHtmlClass:"tex2jax_ignore"},startup:{pageReady:()=>{console.log("initMathJax 4 pageReady"),t&&t(),window.isMathJaxLoaded=!0}},svg:{fontCache:"global"}}}function bb(e){return e&&!Array.isArray(e)&&(e=[e]),new Promise((t,r)=>{_b({},()=>{window.MathJax.typesetPromise(e).then(()=>{t(void 0)}).catch(n=>r(n))})})}function Hp(e){let t="$"+e+"$";return console.log("isMathJaxFormula 66",t),[/\$\d+(\.\d+)?.*(change|up|down|gain|loss|move).*([\+\-]?\d+(\.\d+)?).*([\+\-]?\d+(\.\d+)?%)/i,/(market\s+cap|capitalization|market\s+value).*(is|\:)\s*\$\d+/i,/(trading|volume|shares|stock).*(at|\@)\s*\$\d+/i,/\$\d+(\.\d+)?\s*(to|-|~)\s*\$\d+(\.\d+)?/i].some(n=>n.test(t))}function Up(e){if(console.log("isMathJaxFormula 6",Hp(e),e),Hp(e)||e.includes("\\&quot;")&&(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")||/\\&quot;[^\\]+\\&quot;\s*:\s*\\&quot;[^\\]*\\&quot;/.test(e))||(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))&&(e.includes('\\"')||e.includes('\\"')||e.includes("\\&quot;")||e.includes("&quot;"))&&e.includes(":")||/^#{1,6}\s+/.test(e.trim())||e.includes("###")||e.includes("##")||/^#\s+/.test(e.trim())||!e||e.trim()===""||e.match(/^CONST\[/)||e.match(/^[A-Z_]+\[/)||e.includes("@\\`")||e.startsWith("$")&&e.endsWith("$")&&e.includes("\\`")||/\$[a-zA-Z0-9_]+\\`/.test(e)||/`[^`]*`/.test(e)||/\*\*.*?\*\*|__.*?__|_.*?_|\*.*?\*|~~.*?~~|\[.*?\]\(.*?\)/.test(e)&&!/(\\frac|\\sum|\\int|\\prod|\\lim|\\{|\\}|\\[|\\]|\\(|\\))/.test(e))return!1;if(e.includes(`
28
28
  `)){const d=e.trim().split(`
29
- `);if(d.length>=2&&/^(\$)?\s*\d+(\.\d+)?\s*$/.test(d[0].trim())){const p=d[1].trim();if(/^\*\*.*?(价格|原价|折扣|优惠|促销|售价).*?\*\*\s*:/.test(p)||/^\*\*(Price|Original|Discount|Sale|Special).*?\*\*\s*:/i.test(p))return!1}for(const p of d)if(/^#{1,6}\s+/.test(p.trim()))return!1}const t=e.trim();if(/^(Based on|According to|From|In|The) .*(answer|correct|material|provided|explanation).*:?$/i.test(t)||/(at least|\bat\b|\bof\b|\bis\b|\bfine\b|\bpay\b|\bfees?\b|\bprice\b|\bcosts?\b|\bpenalty|\bpenalties)\s+(\*\*)?\$\d+/i.test(e)||/^[-•*]\s+.*\$\d+/.test(e)||/^[\d]+\.?\s+.*\$\d+/.test(e)||/table\s+\d+|general\s+impairment|high\s+rate|highest\s+rate/i.test(e)&&/\$\d+/.test(e)||/^(\$)?\s*\d+(\.\d+)?\s*$/.test(t))return!1;const r=[/(原价|现价|优惠价|折扣价|促销价|售价|定价|价格|折扣信息|优惠信息)\s*[::]?\s*$/,/(价格|费用|金额)\s*[::]?\s*$/,/^\s*([¥$€₤₹₽¢₩]|USD|CAD|EUR|GBP|JPY|RMB|CNY)/,/\b(quotation|budget|controller|department|head|manager|director|verbal|approval|vendor|supplier)\b/i,/^(price|cost|fee|amount|fine|penalty|minimum)\s*:?\s*$/i,/(original|discount|sale|special|retail|list|offer)\s+(price|cost)\s*:?\s*$/i,/(price|cost|fine)\s+(before|after|is|of|at least)\s+(tax|discount)\s*:?\s*$/i,/(minimum|maximum|guaranteed)\s+(fine|penalty|cost|payment)/i];for(const d of r)if(d.test(t))return!1;const n=[/\|.*\|/,/\n.*\|/,/^\s*\$?\d{1,3}(,\d{3})+(\.\d{2})?\s*$/,/\$\d+,\d+/,/[A-Z][a-z]+\s+[A-Z][a-z]+/];for(const d of n)if(d.test(t))return!1;const i=[/^\*\*[\s\S]*?(价格|折扣|优惠|促销|售价|特价|打折|fine|penalty|payment|fee)[\s\S]*?\*\*\s*:?$/i,/^\*\*(商品|产品|规格|型号|尺寸|数量|Table|BAC|Rate|offense|conviction|Explanation|Notes|Additional)[\s\S]*?\*\*\s*:?$/i];for(const d of i)if(d.test(t))return!1;if(/\$\d+(\.\d+)?([\s,]+(across|for|in|when|per|each|every|all|any|most|minimum|maximum))/i.test(e)||/^(\d+)?\.?\d+$/.test(t)||/['"][^'"]*\$\d+[^'"]*['"]/.test(e)||/^>.*\$\d+/.test(t))return!1;if(e.startsWith("$")&&e.endsWith("$")&&e.length>2){const d=e.slice(1,-1);if(/^\s*\d+(\.\d+)?\s*$/.test(d)||/.*\\`.*/.test(d)||d.includes("#"))return!1;if(/^[a-zA-Z]+$/.test(d.trim()))return!0}if(/^[A-Za-z]$/.test(t)||/^[A-Z]{2}$/.test(t))return!0;const o=e.replace(/\\\\(?=\w)/g,"\\");if(/\([^()]+,[^()]+\)|\[[^[\]]+,[^[\]]+\]/.test(o))return!0;if(/\\`/.test(o)&&/\$[a-zA-Z0-9_]+\\`/.test(o)||o.includes("#"))return!1;if(/\\([a-zA-Z]+|[=<>])/.test(o)||/\b[a-zA-Z]\s*[\+\-\*\/]?\s*\d+\s*[=<>]?\s*\d*\b/.test(o)||/\b[a-zA-Z]\s*[=<>≤≥]\s*[a-zA-Z0-9]\b/.test(o))return!0;const c=["geq","leq","gt","lt","neq","approx","equiv","geqslant","leqslant","sim","simeq","cong"];if(new RegExp(`\\\\(${c.join("|")})`).test(o)||/\\text\{[^}]*\}.*?[=+\-*\/\^_\\]/.test(o))return!0;const h=[/\\frac/,/(?!^\s*[\[\{].*?\\\".*?[\]\}]\s*$)[\{\}\(\)\[\]]{2,}/,/[+\-*\/=<>^_]/,/\\(times|div|cdot|pm|mp|sum|int|infty|partial|sqrt|over)/,/\\(begin|end)\{(matrix|pmatrix|bmatrix|vmatrix)\}/,/\\(sum|int|prod|lim)/];for(const d of h)if(d.test(o))return!0;return!!(o.match(/[\\^_{}]|\\[a-z]+/)&&!o.match(/\\`/)&&!o.includes("\\&quot;"))}function xb(e){let t=[],r=e,n=0;const i=[],a=/\$\$([\s\S]*?)\$\$/g;let o,s=[];for(;(o=a.exec(e))!==null;)s.push({start:o.index,end:o.index+o[0].length-1}),i.push(o[0]);for(let v=0;v<i.length;v++){const g=`__DOUBLE_DOLLAR_TEMP_${v}__`;r=r.replace(i[v],g)}const u=/\\\[([\s\S]*?)\\\]/g;let l,c=[];for(;(l=u.exec(r))!==null;)c.push({full:l[0],content:l[1],start:l.index,end:l.index+l[0].length});for(let v=c.length-1;v>=0;v--){const g=c[v];if(!Up(g.content)){const m=`__PLACEHOLDER_${n}__`;t[n]=g.full,n++,r=r.substring(0,g.start)+m+r.substring(g.end)}}const f=/\$([^\$]+?)\$/g;let h;const d=r;let p=[];for(;(h=f.exec(d))!==null;){const v=h[0],g=h[1],m=h.index,y=m+v.length;let _=!1;for(const b of s)if(m>=b.start&&y<=b.end){_=!0;break}!_&&g.trim()!==""&&p.push({full:v,content:g,start:m,end:y})}for(let v=p.length-1;v>=0;v--){const g=p[v];if(console.log("isMathJaxFormula111"),!Up(g.content)){const m=`__PLACEHOLDER_${n}__`;t[n]=g.full,n++,r=r.substring(0,g.start)+m+r.substring(g.end)}}for(let v=0;v<i.length;v++){const g=`__DOUBLE_DOLLAR_TEMP_${v}__`;r=r.replace(g,i[v])}return console.log("extractDollarEnclosedStrings1",r,t),{transformed:r,extracted:t}}function wb(e,t,r=[]){let n=e;const i=new RegExp("__PLACEHOLDER_(\\d+)__","g");n=n.replace(i,(o,s)=>{const u=parseInt(s,10);return u<t.length?t[u]:o});const a=new RegExp("__DOUBLE_DOLLAR_TEMP_(\\d+)__","g");return n=n.replace(a,(o,s)=>{const u=parseInt(s,10);return u<r.length?r[u]:o}),n}window.isMermaidLoaded=!1;window.mermaidLoadError=!1;function mP(e){if(!e)return"";try{const r=new DOMParser().parseFromString(e,"image/svg+xml"),n=r.querySelector("parsererror");if(n)return console.error("SVG 解析错误:",n.textContent),"";const i=r.querySelector("svg");return i?(["script","iframe","object","embed","link","style","img","video","audio","frame","frameset","base","meta","form"].forEach(l=>{i.querySelectorAll(l).forEach(f=>f.remove())}),["foreignObject","use","animate","animateTransform","set"].forEach(l=>{i.querySelectorAll(l).forEach(f=>{if(l==="use"){const h=f.getAttribute("href")||f.getAttribute("xlink:href");h&&!h.startsWith("#")&&f.remove()}else f.remove()})}),[i,...i.querySelectorAll("*")].forEach(l=>{Array.from(l.attributes).forEach(f=>{const h=f.name.toLowerCase(),d=f.value;if(h.startsWith("on")){l.removeAttribute(f.name);return}if(d){const p=d.toLowerCase();if(p.includes("javascript:")||p.includes("data:text/html")||p.includes("vbscript:")||p.includes("data:application/")||/<script/i.test(d)){l.removeAttribute(f.name);return}}(h==="href"||h==="xlink:href")&&d&&!d.startsWith("#")&&!d.startsWith("http://")&&!d.startsWith("https://")&&l.removeAttribute(f.name)})}),new XMLSerializer().serializeToString(i)):(console.warn("未找到 SVG 元素"),e)}catch(t){return console.error("清理 SVG 时发生错误:",t),""}}function yP(e){if(!e||typeof e!="string")return"";let t=e;return t=t.replace(/<[^>]*>/g,""),t=t.replace(/\bon\w+\s*=\s*["'][^"']*["']/gi,""),t=t.replace(/\bon\w+\s*=\s*[^\s>]*/gi,""),t=t.replace(/javascript:/gi,""),t=t.replace(/vbscript:/gi,""),t=t.replace(/data:text\/html/gi,""),t=t.replace(/data:application/gi,""),t=t.replace(/<script[\s\S]*?<\/script>/gi,""),t=t.replace(/&lt;script/gi,""),t=t.replace(/&lt;img/gi,""),t=t.replace(/&lt;iframe/gi,""),t}const Sb="data-mermaid-source",bi="data-mermaid-rendered",Fu="data-mermaid-rendering",es="data-mermaid-rendered-source",Ni="data-mermaid-key",_P="[MermaidTrace]";function At(e,t={}){const r=window.__MERMAID_TRACE_SEQ__=(window.__MERMAID_TRACE_SEQ__||0)+1;console.log(`${_P}[${r}][${e}]`,t)}function W0(e){var t;return e&&(e.getAttribute(Sb)||((t=e.querySelector("pre > code.language-mermaid"))==null?void 0:t.textContent))||""}function bP(e,t=0){return`mermaid-slot-${t}`}function yn(e=""){return yP(e).trim()}function xP(e="",t=""){if(!e||!t||e===t)return!1;const r=yn(e),n=yn(t);return!!r&&!!n&&n.startsWith(r)}function wP(e="",t=""){if(!e||!t||e===t)return!1;const r=yn(e),n=yn(t);if(!r||!n||!r.startsWith(n))return!1;const i=r.length-n.length;return i>0&&i<=4}function q0(e,t){e.setAttribute(Sb,t||"")}function Wp(e,t,r){e.setAttribute(Ni,bP(t,r))}function SP(e){var t;if(!(!e||e.nodeType!==1))return(t=e.classList)!=null&&t.contains("mermaid-container")?e.getAttribute(Ni)||void 0:e.id||void 0}function Xs(e){var t,r;return!e||e.nodeType!==1?!1:(t=e.classList)!=null&&t.contains("mermaid-container")||e.tagName==="PRE"&&e.querySelector("code.language-mermaid")?!0:e.tagName==="CODE"&&((r=e.classList)==null?void 0:r.contains("language-mermaid"))}function Ki(e){var i,a,o,s,u;if(!e||e.nodeType!==1)return null;const t=(i=e.classList)!=null&&i.contains("mermaid-container")?e:(a=e.closest)==null?void 0:a.call(e,".mermaid-container"),r=e.tagName==="CODE"&&((o=e.classList)!=null&&o.contains("language-mermaid"))?e:((s=e.querySelector)==null?void 0:s.call(e,"code.language-mermaid"))||((u=t==null?void 0:t.querySelector)==null?void 0:u.call(t,"code.language-mermaid")),n=t?W0(t):(r==null?void 0:r.textContent)||"";return{tag:e.tagName,key:(t==null?void 0:t.getAttribute(Ni))||"",rendered:(t==null?void 0:t.getAttribute(bi))||"",rendering:(t==null?void 0:t.getAttribute(Fu))||"",sourceLen:n.length,textPreview:n.slice(0,80)}}function CP(e,t){const r=document.createElement("pre"),n=document.createElement("code");n.className="language-mermaid",n.textContent=t||"",r.appendChild(n),e.innerHTML="",e.appendChild(r)}function Cb(e=document){return e.querySelectorAll("pre > code.language-mermaid").forEach((r,n)=>{var u;const i=r.parentElement,a=i==null?void 0:i.parentElement,o=r.textContent||"";if(!i||!a)return;if((u=a.classList)!=null&&u.contains("mermaid-container")){q0(a,o),Wp(a,o,n),At("prepare.update",{index:n,key:a.getAttribute(Ni),sourceLen:o.length});return}const s=document.createElement("div");s.className="mermaid-container",q0(s,o),Wp(s,o,n),s.appendChild(i.cloneNode(!0)),a.replaceChild(s,i),At("prepare.wrap",{index:n,key:s.getAttribute(Ni),sourceLen:o.length})}),e}function AP(e,t){var g,m;if(!e||!t||e.nodeType!==1||t.nodeType!==1||!((g=e.classList)!=null&&g.contains("mermaid-container"))||!((m=t.classList)!=null&&m.contains("mermaid-container")))return!1;const r=e.getAttribute(Ni)||"",n=t.getAttribute(Ni)||"";if(r&&n&&r!==n)return At("preserve.key_mismatch",{fromKey:r,toKey:n}),!1;const i=W0(e),a=W0(t);if(!a)return At("preserve.source_mismatch",{fromKey:r,toKey:n,fromSourceLen:i.length,toSourceLen:0}),!1;Array.from(t.attributes).forEach(y=>{e.setAttribute(y.name,y.value)});const o=yn(e.getAttribute(es)||""),s=yn(a),u=yn(i),l=e.getAttribute(Fu)==="true",c=e.getAttribute(bi)==="true",f=c&&!!e.querySelector("svg"),h=u===s,d=f&&xP(o||u,s),p=f&&wP(u||o,s),v=l||c&&h||d||p;return At(v?"preserve.hit":"preserve.miss",{key:r||n,isRendering:l,isRendered:c,hasRenderedSvg:f,isSameSource:h,isStreamingUpdate:d,isSettlingUpdate:p,currentSourceLen:u.length,renderedSourceLen:o.length,nextSourceLen:s.length}),v}function TP(e,t){if(!window.isMermaidLoaded){const r=document.createElement("script");r.src=window.MermaidSrc?window.MermaidSrc:"https://cdn.xiaowei.qq.com/webim/assets/static/mermaid.min.js",r.async=!0,At("script.inject",{src:r.src}),r.onload=()=>{window.isMermaidLoaded=!0,At("script.loaded",{src:r.src}),t()},r.onerror=n=>{console.error("Mermaid script加载失败:",n),window.mermaidLoadError=!0,At("script.error",{message:(n==null?void 0:n.message)||String(n)})},document.head.appendChild(r)}}const DP=80;function zh(e){e!=null&&e.__mermaidRenderTimer&&(clearTimeout(e.__mermaidRenderTimer),e.__mermaidRenderTimer=null)}async function qp(e,t){if(!e||!t)return;const{index:r,key:n,code:i,comparableCode:a}=t;if(e.getAttribute(Fu)==="true"){e.__mermaidPendingPayload=t,At("render.defer.rendering",{index:r,key:n,sourceLen:a.length});return}const o=e.getAttribute(bi)==="true"&&!!e.querySelector("svg"),s=yn(e.getAttribute(es)||"");q0(e,i),e.setAttribute(Fu,"true"),At("render.begin",{index:r,key:n,sourceLen:a.length,hadRenderedSvg:o,previousRenderedSourceLen:s.length});try{const u=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,{svg:l}=await window.mermaid.render(u,a),c=mP(l);if(!c)throw new Error("Mermaid SVG 清理结果为空");e.innerHTML=c,e.setAttribute(bi,"true"),e.setAttribute(es,a),e.removeAttribute("data-mermaid-error"),At("render.success",{index:r,key:n,svgLen:c.length})}catch(u){console.error(`MermaidService: 渲染失败 #${r+1}:`,u),o?(e.setAttribute(bi,"true"),e.setAttribute(es,s),e.setAttribute("data-mermaid-error","stale"),At("render.keep_previous",{index:r,key:n,previousRenderedSourceLen:s.length,nextSourceLen:a.length,message:(u==null?void 0:u.message)||String(u)})):(CP(e,a),e.setAttribute(bi,"error"),e.setAttribute(es,a),e.setAttribute("data-mermaid-error","true"),At("render.error",{index:r,key:n,message:(u==null?void 0:u.message)||String(u)}))}finally{e.removeAttribute(Fu);const u=e.__mermaidPendingPayload;e.__mermaidPendingPayload=null,u&&Ab(e,u)}}function Ab(e,t){if(!e||!t)return;zh(e);const r=t.hadRenderedSvg?DP:0;if(!r){qp(e,t);return}e.__mermaidRenderTimer=setTimeout(()=>{e.__mermaidRenderTimer=null,qp(e,t)},r),At("render.schedule",{index:t.index,key:t.key,sourceLen:t.comparableCode.length,delay:r})}const f1={initialized:!1,init(){this.initialized||(window.mermaid&&window.mermaid.initialize?(window.mermaid.initialize({startOnLoad:!1,theme:"default",suppressErrorRendering:!0,securityLevel:"strict"}),this.initialized=!0):console.error("Mermaid library not loaded"))},async renderAll(e=document){this.init(),Cb(e);const t=e.querySelectorAll(".mermaid-container");At("renderAll.start",{count:t.length});for(let r=0;r<t.length;r++){const n=t[r],i=W0(n),a=n.getAttribute(Ni)||"",o=yn(i);if(!o){zh(n),n.__mermaidPendingPayload=null,At("render.skip.empty",{index:r,key:a,sourceLen:i.length});continue}const s=yn(n.getAttribute(es)||"");if(n.getAttribute(bi)==="true"&&s===o){zh(n),n.__mermaidPendingPayload=null,At("render.skip.rendered",{index:r,key:a,sourceLen:o.length});continue}q0(n,i),Ab(n,{index:r,key:a,code:i,comparableCode:o,hadRenderedSvg:n.getAttribute(bi)==="true"&&!!n.querySelector("svg")})}},onMermaidLoaded(e){if(window.isMermaidLoaded)e();else{if(window.mermaidLoadError)return;const t=setInterval(()=>{window.isMermaidLoaded&&(clearInterval(t),e())},500);setTimeout(()=>{clearInterval(t),console.error("Mermaid加载超时")},3e4)}}};function pr(e,t,r,n,i,a,o,s){var u=typeof e=="function"?e.options:e;t&&(u.render=t,u.staticRenderFns=r,u._compiled=!0),n&&(u.functional=!0),a&&(u._scopeId="data-v-"+a);var l;if(o?(l=function(h){h=h||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!h&&typeof __VUE_SSR_CONTEXT__<"u"&&(h=__VUE_SSR_CONTEXT__),i&&i.call(this,h),h&&h._registeredComponents&&h._registeredComponents.add(o)},u._ssrRegister=l):i&&(l=s?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(d,p){return l.call(p),c(d,p)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}const EP={name:"MDRender",props:{className:{type:String,default:""},source:{type:String,default:""},show:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},html:{type:Boolean,default:!0},xhtmlOut:{type:Boolean,default:!0},breaks:{type:Boolean,default:!0},linkify:{type:Boolean,default:!0},emoji:{type:Boolean,default:!0},typographer:{type:Boolean,default:!1},langPrefix:{type:String,default:"language-"},quotes:{type:String,default:"“”‘’"},tableClass:{type:String,default:"table"},taskLists:{type:Boolean,default:!0},toc:{type:Boolean,default:!1},tocId:String,tocClass:{type:String,default:"table-of-contents"},tocFirstLevel:{type:Number,default:2},tocLastLevel:Number,tocAnchorLink:{type:Boolean,default:!0},tocAnchorClass:{type:String,default:"toc-anchor"},tocAnchorLinkSymbol:{type:String,default:"#"},tocAnchorLinkSpace:{type:Boolean,default:!0},tocAnchorLinkClass:{type:String,default:"toc-anchor-link"},anchorAttributes:{type:Object,default:()=>({})},prerender:{type:Function,default:e=>e},postrender:{type:Function,default:e=>e},onRendered:Function,onDestroy:{type:Function,default:()=>{}},onTocRendered:Function,incremental:{type:Boolean,default:!0}},data(){return{sourceData:"",renderSeq:0}},computed:{tocLastLevelComputed(){return this.tocLastLevel>this.tocFirstLevel?this.tocLastLevel:this.tocFirstLevel+1},renderContent(){if(!this.show)return"";const t=this.configureMd().render(this.prerender(this.sourceData.replace(/--&gt;/g,"-->").replace(/(^|[^~\\])~([^~]|$)/g,"$1\\~$2")));return this.postrender(t)}},watch:{source:{handler(e){const t=++this.renderSeq,r=document.createElement("div"),{replacedString:n,videoTags:i}=rb(e),{modifiedMdString:a,codeBlocks:o}=eb(n),s=Q_(a),{transformed:u,extracted:l}=xb(s);r.innerHTML=u;const c=()=>{if(t!==this.renderSeq)return;const f=this.prerender(SI(wb(J_(nb(tb(r.innerHTML,o),i)),l)));this.sourceData=this.xssHandler.process(f)};bb(r).then(c).catch(c)},immediate:!0},renderContent:{handler(e){const t=this.$refs.container;if(!t)return;if(!e){t.innerHTML="",this.$nextTick(()=>this.$emit("rendered",t));return}if(!this.incremental){t.innerHTML=e,this.$nextTick(()=>this.$emit("rendered",t));return}const r=document.createElement("div");r.innerHTML=e,TE(t,r,{childrenOnly:!0,getNodeKey(n){return SP(n)},onBeforeElUpdated(n,i){return AP(n,i)?(console.log("[MermaidTrace][Vue2][morph.preserve]",{from:Ki(n),to:Ki(i)}),!1):((Xs(n)||Xs(i))&&console.log("[MermaidTrace][Vue2][morph.update]",{from:Ki(n),to:Ki(i)}),n._widgetMounted&&n.classList.contains("widget-container")?(Array.from(i.attributes).forEach(a=>{a.name.startsWith("data-")&&n.setAttribute(a.name,a.value)}),!1):!(n._classifyTagMounted&&n.classList.contains("classify-tag-container")||n._planConfirmMounted&&n.classList.contains("plan-confirm-container")||n.classList.contains("audio-stream-container")&&n.children.length>0||n.tagName==="CODE"&&n.classList.contains("hljs")&&n.textContent===i.textContent))},onBeforeNodeDiscarded(n){return Xs(n)&&console.log("[MermaidTrace][Vue2][morph.beforeDiscard]",Ki(n)),!0},onNodeDiscarded(n){Xs(n)&&console.log("[MermaidTrace][Vue2][morph.discarded]",Ki(n))},onNodeAdded(n){return n.nodeType===1&&n.tagName==="CODE"&&n.parentElement&&n.parentElement.tagName==="PRE"&&(n._needsHighlight=!0),Xs(n)&&console.log("[MermaidTrace][Vue2][morph.added]",Ki(n)),n}}),this.$nextTick(()=>{this.$emit("rendered",t)})},immediate:!0}},created(){this.xssHandler=new Un.FilterXSS(yb)},mounted(){TP({},()=>{})},beforeDestroy(){this.$refs.container&&this.$emit("destroy",this.$refs.container)},methods:{configureMd(){return K_({html:this.html,xhtmlOut:this.xhtmlOut,breaks:this.breaks,linkify:this.linkify,emoji:this.emoji,typographer:this.typographer,langPrefix:this.langPrefix,quotes:this.quotes,taskLists:this.taskLists,tableClass:this.tableClass,anchorAttributes:this.anchorAttributes,toc:this.toc,tocClass:this.tocClass,tocFirstLevel:this.tocFirstLevel,tocLastLevel:this.tocLastLevelComputed,tocAnchorLink:this.tocAnchorLink,tocAnchorLinkSymbol:this.tocAnchorLinkSymbol,tocAnchorLinkSpace:this.tocAnchorLinkSpace,tocAnchorClass:this.tocAnchorClass,tocAnchorLinkClass:this.tocAnchorLinkClass,tocId:this.tocId,onTocRendered:e=>{this.$emit("tocRendered",e),this.$emit("toc-rendered",e)}})}}};var kP=function(){var t=this,r=t._self._c;return r("div",{ref:"container",class:t.className})},MP=[],LP=pr(EP,kP,MP,!1,null,null,null,null);const IP=LP.exports;function Tb(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const r=e[t],n=typeof r;(n==="object"||n==="function")&&!Object.isFrozen(r)&&Tb(r)}),e}class Zp{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Db(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function xi(e,...t){const r=Object.create(null);for(const n in e)r[n]=e[n];return t.forEach(function(n){for(const i in n)r[i]=n[i]}),r}const PP="</span>",Yp=e=>!!e.scope,RP=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const r=e.split(".");return[`${t}${r.shift()}`,...r.map((n,i)=>`${n}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class NP{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=Db(t)}openNode(t){if(!Yp(t))return;const r=RP(t.scope,{prefix:this.classPrefix});this.span(r)}closeNode(t){Yp(t)&&(this.buffer+=PP)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const Xp=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class H4{constructor(){this.rootNode=Xp(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const r=Xp({scope:t});this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,r){return typeof r=="string"?t.addText(r):r.children&&(t.openNode(r),r.children.forEach(n=>this._walk(t,n)),t.closeNode(r)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(r=>typeof r=="string")?t.children=[t.children.join("")]:t.children.forEach(r=>{H4._collapse(r)}))}}class OP extends H4{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,r){const n=t.root;r&&(n.scope=`language:${r}`),this.add(n)}toHTML(){return new NP(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ol(e){return e?typeof e=="string"?e:e.source:null}function Eb(e){return lo("(?=",e,")")}function BP(e){return lo("(?:",e,")*")}function FP(e){return lo("(?:",e,")?")}function lo(...e){return e.map(r=>ol(r)).join("")}function zP(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function U4(...e){return"("+(zP(e).capture?"":"?:")+e.map(n=>ol(n)).join("|")+")"}function kb(e){return new RegExp(e.toString()+"|").exec("").length-1}function VP(e,t){const r=e&&e.exec(t);return r&&r.index===0}const $P=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function W4(e,{joinWith:t}){let r=0;return e.map(n=>{r+=1;const i=r;let a=ol(n),o="";for(;a.length>0;){const s=$P.exec(a);if(!s){o+=a;break}o+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?o+="\\"+String(Number(s[1])+i):(o+=s[0],s[0]==="("&&r++)}return o}).map(n=>`(${n})`).join(t)}const GP=/\b\B/,Mb="[a-zA-Z]\\w*",q4="[a-zA-Z_]\\w*",Lb="\\b\\d+(\\.\\d+)?",Ib="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Pb="\\b(0b[01]+)",HP="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",UP=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=lo(t,/.*\b/,e.binary,/\b.*/)),xi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},e)},sl={begin:"\\\\[\\s\\S]",relevance:0},WP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[sl]},qP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[sl]},ZP={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e2=function(e,t,r={}){const n=xi({scope:"comment",begin:e,end:t,contains:[]},r);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=U4("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:lo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},YP=e2("//","$"),XP=e2("/\\*","\\*/"),jP=e2("#","$"),KP={scope:"number",begin:Lb,relevance:0},QP={scope:"number",begin:Ib,relevance:0},JP={scope:"number",begin:Pb,relevance:0},eR={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[sl,{begin:/\[/,end:/\]/,relevance:0,contains:[sl]}]},tR={scope:"title",begin:Mb,relevance:0},rR={scope:"title",begin:q4,relevance:0},nR={begin:"\\.\\s*"+q4,relevance:0},iR=function(e){return Object.assign(e,{"on:begin":(t,r)=>{r.data._beginMatch=t[1]},"on:end":(t,r)=>{r.data._beginMatch!==t[1]&&r.ignoreMatch()}})};var h1=Object.freeze({__proto__:null,APOS_STRING_MODE:WP,BACKSLASH_ESCAPE:sl,BINARY_NUMBER_MODE:JP,BINARY_NUMBER_RE:Pb,COMMENT:e2,C_BLOCK_COMMENT_MODE:XP,C_LINE_COMMENT_MODE:YP,C_NUMBER_MODE:QP,C_NUMBER_RE:Ib,END_SAME_AS_BEGIN:iR,HASH_COMMENT_MODE:jP,IDENT_RE:Mb,MATCH_NOTHING_RE:GP,METHOD_GUARD:nR,NUMBER_MODE:KP,NUMBER_RE:Lb,PHRASAL_WORDS_MODE:ZP,QUOTE_STRING_MODE:qP,REGEXP_MODE:eR,RE_STARTERS_RE:HP,SHEBANG:UP,TITLE_MODE:tR,UNDERSCORE_IDENT_RE:q4,UNDERSCORE_TITLE_MODE:rR});function aR(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function oR(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function sR(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=aR,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function uR(e,t){Array.isArray(e.illegal)&&(e.illegal=U4(...e.illegal))}function lR(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function cR(e,t){e.relevance===void 0&&(e.relevance=1)}const fR=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const r=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=r.keywords,e.begin=lo(r.beforeMatch,Eb(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},hR=["of","and","for","in","not","or","if","then","parent","list","value"],dR="keyword";function Rb(e,t,r=dR){const n=Object.create(null);return typeof e=="string"?i(r,e.split(" ")):Array.isArray(e)?i(r,e):Object.keys(e).forEach(function(a){Object.assign(n,Rb(e[a],t,a))}),n;function i(a,o){t&&(o=o.map(s=>s.toLowerCase())),o.forEach(function(s){const u=s.split("|");n[u[0]]=[a,pR(u[0],u[1])]})}}function pR(e,t){return t?Number(t):vR(e)?0:1}function vR(e){return hR.includes(e.toLowerCase())}const jp={},Ga=e=>{console.error(e)},Kp=(e,...t)=>{console.log(`WARN: ${e}`,...t)},wo=(e,t)=>{jp[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),jp[`${e}/${t}`]=!0)},Z0=new Error;function Nb(e,t,{key:r}){let n=0;const i=e[r],a={},o={};for(let s=1;s<=t.length;s++)o[s+n]=i[s],a[s+n]=!0,n+=kb(t[s-1]);e[r]=o,e[r]._emit=a,e[r]._multi=!0}function gR(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ga("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Z0;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ga("beginScope must be object"),Z0;Nb(e,e.begin,{key:"beginScope"}),e.begin=W4(e.begin,{joinWith:""})}}function mR(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ga("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Z0;if(typeof e.endScope!="object"||e.endScope===null)throw Ga("endScope must be object"),Z0;Nb(e,e.end,{key:"endScope"}),e.end=W4(e.end,{joinWith:""})}}function yR(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function _R(e){yR(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),gR(e),mR(e)}function bR(e){function t(o,s){return new RegExp(ol(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,s]),this.matchAt+=kb(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(u=>u[1]);this.matcherRe=t(W4(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(s);if(!u)return null;const l=u.findIndex((f,h)=>h>0&&f!==void 0),c=this.matchIndexes[l];return u.splice(0,l),Object.assign(u,c)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const u=new r;return this.rules.slice(s).forEach(([l,c])=>u.addRule(l,c)),u.compile(),this.multiRegexes[s]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,u){this.rules.push([s,u]),u.type==="begin"&&this.count++}exec(s){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let l=u.exec(s);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){const c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,l=c.exec(s)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function i(o){const s=new n;return o.contains.forEach(u=>s.addRule(u.begin,{rule:u,type:"begin"})),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&s.addRule(o.illegal,{type:"illegal"}),s}function a(o,s){const u=o;if(o.isCompiled)return u;[oR,lR,_R,fR].forEach(c=>c(o,s)),e.compilerExtensions.forEach(c=>c(o,s)),o.__beforeBegin=null,[sR,uR,cR].forEach(c=>c(o,s)),o.isCompiled=!0;let l=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),l=o.keywords.$pattern,delete o.keywords.$pattern),l=l||/\w+/,o.keywords&&(o.keywords=Rb(o.keywords,e.case_insensitive)),u.keywordPatternRe=t(l,!0),s&&(o.begin||(o.begin=/\B|\b/),u.beginRe=t(u.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(u.endRe=t(u.end)),u.terminatorEnd=ol(u.end)||"",o.endsWithParent&&s.terminatorEnd&&(u.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(u.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(c){return xR(c==="self"?o:c)})),o.contains.forEach(function(c){a(c,u)}),o.starts&&a(o.starts,s),u.matcher=i(u),u}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=xi(e.classNameAliases||{}),a(e)}function Ob(e){return e?e.endsWithParent||Ob(e.starts):!1}function xR(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return xi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ob(e)?xi(e,{starts:e.starts?xi(e.starts):null}):Object.isFrozen(e)?xi(e):e}var wR="11.11.1";class SR extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const rf=Db,Qp=xi,Jp=Symbol("nomatch"),CR=7,Bb=function(e){const t=Object.create(null),r=Object.create(null),n=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:OP};function u(L){return s.noHighlightRe.test(L)}function l(L){let O=L.className+" ";O+=L.parentNode?L.parentNode.className:"";const P=s.languageDetectRe.exec(O);if(P){const R=C(P[1]);return R||(Kp(a.replace("{}",P[1])),Kp("Falling back to no-highlight mode for this block.",L)),R?P[1]:"no-highlight"}return O.split(/\s+/).find(R=>u(R)||C(R))}function c(L,O,P){let R="",B="";typeof O=="object"?(R=L,P=O.ignoreIllegals,B=O.language):(wo("10.7.0","highlight(lang, code, ...args) has been deprecated."),wo("10.7.0",`Please use highlight(code, options) instead.
29
+ `);if(d.length>=2&&/^(\$)?\s*\d+(\.\d+)?\s*$/.test(d[0].trim())){const p=d[1].trim();if(/^\*\*.*?(价格|原价|折扣|优惠|促销|售价).*?\*\*\s*:/.test(p)||/^\*\*(Price|Original|Discount|Sale|Special).*?\*\*\s*:/i.test(p))return!1}for(const p of d)if(/^#{1,6}\s+/.test(p.trim()))return!1}const t=e.trim();if(/^(Based on|According to|From|In|The) .*(answer|correct|material|provided|explanation).*:?$/i.test(t)||/(at least|\bat\b|\bof\b|\bis\b|\bfine\b|\bpay\b|\bfees?\b|\bprice\b|\bcosts?\b|\bpenalty|\bpenalties)\s+(\*\*)?\$\d+/i.test(e)||/^[-•*]\s+.*\$\d+/.test(e)||/^[\d]+\.?\s+.*\$\d+/.test(e)||/table\s+\d+|general\s+impairment|high\s+rate|highest\s+rate/i.test(e)&&/\$\d+/.test(e)||/^(\$)?\s*\d+(\.\d+)?\s*$/.test(t))return!1;const r=[/(原价|现价|优惠价|折扣价|促销价|售价|定价|价格|折扣信息|优惠信息)\s*[::]?\s*$/,/(价格|费用|金额)\s*[::]?\s*$/,/^\s*([¥$€₤₹₽¢₩]|USD|CAD|EUR|GBP|JPY|RMB|CNY)/,/\b(quotation|budget|controller|department|head|manager|director|verbal|approval|vendor|supplier)\b/i,/^(price|cost|fee|amount|fine|penalty|minimum)\s*:?\s*$/i,/(original|discount|sale|special|retail|list|offer)\s+(price|cost)\s*:?\s*$/i,/(price|cost|fine)\s+(before|after|is|of|at least)\s+(tax|discount)\s*:?\s*$/i,/(minimum|maximum|guaranteed)\s+(fine|penalty|cost|payment)/i];for(const d of r)if(d.test(t))return!1;const n=[/\|.*\|/,/\n.*\|/,/^\s*\$?\d{1,3}(,\d{3})+(\.\d{2})?\s*$/,/\$\d+,\d+/,/[A-Z][a-z]+\s+[A-Z][a-z]+/];for(const d of n)if(d.test(t))return!1;const i=[/^\*\*[\s\S]*?(价格|折扣|优惠|促销|售价|特价|打折|fine|penalty|payment|fee)[\s\S]*?\*\*\s*:?$/i,/^\*\*(商品|产品|规格|型号|尺寸|数量|Table|BAC|Rate|offense|conviction|Explanation|Notes|Additional)[\s\S]*?\*\*\s*:?$/i];for(const d of i)if(d.test(t))return!1;if(/\$\d+(\.\d+)?([\s,]+(across|for|in|when|per|each|every|all|any|most|minimum|maximum))/i.test(e)||/^(\d+)?\.?\d+$/.test(t)||/['"][^'"]*\$\d+[^'"]*['"]/.test(e)||/^>.*\$\d+/.test(t))return!1;if(e.startsWith("$")&&e.endsWith("$")&&e.length>2){const d=e.slice(1,-1);if(/^\s*\d+(\.\d+)?\s*$/.test(d)||/.*\\`.*/.test(d)||d.includes("#"))return!1;if(/^[a-zA-Z]+$/.test(d.trim()))return!0}if(/^[A-Za-z]$/.test(t)||/^[A-Z]{2}$/.test(t))return!0;const o=e.replace(/\\\\(?=\w)/g,"\\");if(/\([^()]+,[^()]+\)|\[[^[\]]+,[^[\]]+\]/.test(o))return!0;if(/\\`/.test(o)&&/\$[a-zA-Z0-9_]+\\`/.test(o)||o.includes("#"))return!1;if(/\\([a-zA-Z]+|[=<>])/.test(o)||/\b[a-zA-Z]\s*[\+\-\*\/]?\s*\d+\s*[=<>]?\s*\d*\b/.test(o)||/\b[a-zA-Z]\s*[=<>≤≥]\s*[a-zA-Z0-9]\b/.test(o))return!0;const c=["geq","leq","gt","lt","neq","approx","equiv","geqslant","leqslant","sim","simeq","cong"];if(new RegExp(`\\\\(${c.join("|")})`).test(o)||/\\text\{[^}]*\}.*?[=+\-*\/\^_\\]/.test(o))return!0;const h=[/\\frac/,/(?!^\s*[\[\{].*?\\\".*?[\]\}]\s*$)[\{\}\(\)\[\]]{2,}/,/[+\-*\/=<>^_]/,/\\(times|div|cdot|pm|mp|sum|int|infty|partial|sqrt|over)/,/\\(begin|end)\{(matrix|pmatrix|bmatrix|vmatrix)\}/,/\\(sum|int|prod|lim)/];for(const d of h)if(d.test(o))return!0;return!!(o.match(/[\\^_{}]|\\[a-z]+/)&&!o.match(/\\`/)&&!o.includes("\\&quot;"))}function xb(e){let t=[],r=e,n=0;const i=[],a=/\$\$([\s\S]*?)\$\$/g;let o,s=[];for(;(o=a.exec(e))!==null;)s.push({start:o.index,end:o.index+o[0].length-1}),i.push(o[0]);for(let v=0;v<i.length;v++){const g=`__DOUBLE_DOLLAR_TEMP_${v}__`;r=r.replace(i[v],g)}const u=/\\\[([\s\S]*?)\\\]/g;let l,c=[];for(;(l=u.exec(r))!==null;)c.push({full:l[0],content:l[1],start:l.index,end:l.index+l[0].length});for(let v=c.length-1;v>=0;v--){const g=c[v];if(!Up(g.content)){const m=`__PLACEHOLDER_${n}__`;t[n]=g.full,n++,r=r.substring(0,g.start)+m+r.substring(g.end)}}const f=/\$([^\$]+?)\$/g;let h;const d=r;let p=[];for(;(h=f.exec(d))!==null;){const v=h[0],g=h[1],m=h.index,y=m+v.length;let _=!1;for(const b of s)if(m>=b.start&&y<=b.end){_=!0;break}!_&&g.trim()!==""&&p.push({full:v,content:g,start:m,end:y})}for(let v=p.length-1;v>=0;v--){const g=p[v];if(console.log("isMathJaxFormula111"),!Up(g.content)){const m=`__PLACEHOLDER_${n}__`;t[n]=g.full,n++,r=r.substring(0,g.start)+m+r.substring(g.end)}}for(let v=0;v<i.length;v++){const g=`__DOUBLE_DOLLAR_TEMP_${v}__`;r=r.replace(g,i[v])}return console.log("extractDollarEnclosedStrings1",r,t),{transformed:r,extracted:t}}function wb(e,t,r=[]){let n=e;const i=new RegExp("__PLACEHOLDER_(\\d+)__","g");n=n.replace(i,(o,s)=>{const u=parseInt(s,10);return u<t.length?t[u]:o});const a=new RegExp("__DOUBLE_DOLLAR_TEMP_(\\d+)__","g");return n=n.replace(a,(o,s)=>{const u=parseInt(s,10);return u<r.length?r[u]:o}),n}window.isMermaidLoaded=!1;window.mermaidLoadError=!1;function mP(e){if(!e)return"";try{const r=new DOMParser().parseFromString(e,"image/svg+xml"),n=r.querySelector("parsererror");if(n)return console.error("SVG 解析错误:",n.textContent),"";const i=r.querySelector("svg");return i?(["script","iframe","object","embed","link","style","img","video","audio","frame","frameset","base","meta","form"].forEach(l=>{i.querySelectorAll(l).forEach(f=>f.remove())}),["foreignObject","use","animate","animateTransform","set"].forEach(l=>{i.querySelectorAll(l).forEach(f=>{if(l==="use"){const h=f.getAttribute("href")||f.getAttribute("xlink:href");h&&!h.startsWith("#")&&f.remove()}else f.remove()})}),[i,...i.querySelectorAll("*")].forEach(l=>{Array.from(l.attributes).forEach(f=>{const h=f.name.toLowerCase(),d=f.value;if(h.startsWith("on")){l.removeAttribute(f.name);return}if(d){const p=d.toLowerCase();if(p.includes("javascript:")||p.includes("data:text/html")||p.includes("vbscript:")||p.includes("data:application/")||/<script/i.test(d)){l.removeAttribute(f.name);return}}(h==="href"||h==="xlink:href")&&d&&!d.startsWith("#")&&!d.startsWith("http://")&&!d.startsWith("https://")&&l.removeAttribute(f.name)})}),new XMLSerializer().serializeToString(i)):(console.warn("未找到 SVG 元素"),e)}catch(t){return console.error("清理 SVG 时发生错误:",t),""}}function yP(e){if(!e||typeof e!="string")return"";let t=e;return t=t.replace(/<\s*\/?\s*(script|style|iframe|object|embed|form|input|button|select|textarea|link|meta|base|applet)[\s>\/][^>]*>/gi,""),t=t.replace(/\bon\w+\s*=\s*["'][^"']*["']/gi,""),t=t.replace(/\bon\w+\s*=\s*[^\s>]*/gi,""),t=t.replace(/javascript:/gi,""),t=t.replace(/vbscript:/gi,""),t=t.replace(/data:text\/html/gi,""),t=t.replace(/data:application/gi,""),t=t.replace(/<script[\s\S]*?<\/script>/gi,""),t=t.replace(/&lt;script/gi,""),t=t.replace(/&lt;img/gi,""),t=t.replace(/&lt;iframe/gi,""),t}const Sb="data-mermaid-source",bi="data-mermaid-rendered",Fu="data-mermaid-rendering",es="data-mermaid-rendered-source",Ni="data-mermaid-key",_P="[MermaidTrace]";function At(e,t={}){const r=window.__MERMAID_TRACE_SEQ__=(window.__MERMAID_TRACE_SEQ__||0)+1;console.log(`${_P}[${r}][${e}]`,t)}function W0(e){var t;return e&&(e.getAttribute(Sb)||((t=e.querySelector("pre > code.language-mermaid"))==null?void 0:t.textContent))||""}function bP(e,t=0){return`mermaid-slot-${t}`}function yn(e=""){return yP(e).trim()}function xP(e="",t=""){if(!e||!t||e===t)return!1;const r=yn(e),n=yn(t);return!!r&&!!n&&n.startsWith(r)}function wP(e="",t=""){if(!e||!t||e===t)return!1;const r=yn(e),n=yn(t);if(!r||!n||!r.startsWith(n))return!1;const i=r.length-n.length;return i>0&&i<=4}function q0(e,t){e.setAttribute(Sb,t||"")}function Wp(e,t,r){e.setAttribute(Ni,bP(t,r))}function SP(e){var t;if(!(!e||e.nodeType!==1))return(t=e.classList)!=null&&t.contains("mermaid-container")?e.getAttribute(Ni)||void 0:e.id||void 0}function Xs(e){var t,r;return!e||e.nodeType!==1?!1:(t=e.classList)!=null&&t.contains("mermaid-container")||e.tagName==="PRE"&&e.querySelector("code.language-mermaid")?!0:e.tagName==="CODE"&&((r=e.classList)==null?void 0:r.contains("language-mermaid"))}function Ki(e){var i,a,o,s,u;if(!e||e.nodeType!==1)return null;const t=(i=e.classList)!=null&&i.contains("mermaid-container")?e:(a=e.closest)==null?void 0:a.call(e,".mermaid-container"),r=e.tagName==="CODE"&&((o=e.classList)!=null&&o.contains("language-mermaid"))?e:((s=e.querySelector)==null?void 0:s.call(e,"code.language-mermaid"))||((u=t==null?void 0:t.querySelector)==null?void 0:u.call(t,"code.language-mermaid")),n=t?W0(t):(r==null?void 0:r.textContent)||"";return{tag:e.tagName,key:(t==null?void 0:t.getAttribute(Ni))||"",rendered:(t==null?void 0:t.getAttribute(bi))||"",rendering:(t==null?void 0:t.getAttribute(Fu))||"",sourceLen:n.length,textPreview:n.slice(0,80)}}function CP(e,t){const r=document.createElement("pre"),n=document.createElement("code");n.className="language-mermaid",n.textContent=t||"",r.appendChild(n),e.innerHTML="",e.appendChild(r)}function Cb(e=document){return e.querySelectorAll("pre > code.language-mermaid").forEach((r,n)=>{var u;const i=r.parentElement,a=i==null?void 0:i.parentElement,o=r.textContent||"";if(!i||!a)return;if((u=a.classList)!=null&&u.contains("mermaid-container")){q0(a,o),Wp(a,o,n),At("prepare.update",{index:n,key:a.getAttribute(Ni),sourceLen:o.length});return}const s=document.createElement("div");s.className="mermaid-container",q0(s,o),Wp(s,o,n),s.appendChild(i.cloneNode(!0)),a.replaceChild(s,i),At("prepare.wrap",{index:n,key:s.getAttribute(Ni),sourceLen:o.length})}),e}function AP(e,t){var g,m;if(!e||!t||e.nodeType!==1||t.nodeType!==1||!((g=e.classList)!=null&&g.contains("mermaid-container"))||!((m=t.classList)!=null&&m.contains("mermaid-container")))return!1;const r=e.getAttribute(Ni)||"",n=t.getAttribute(Ni)||"";if(r&&n&&r!==n)return At("preserve.key_mismatch",{fromKey:r,toKey:n}),!1;const i=W0(e),a=W0(t);if(!a)return At("preserve.source_mismatch",{fromKey:r,toKey:n,fromSourceLen:i.length,toSourceLen:0}),!1;Array.from(t.attributes).forEach(y=>{e.setAttribute(y.name,y.value)});const o=yn(e.getAttribute(es)||""),s=yn(a),u=yn(i),l=e.getAttribute(Fu)==="true",c=e.getAttribute(bi)==="true",f=c&&!!e.querySelector("svg"),h=u===s,d=f&&xP(o||u,s),p=f&&wP(u||o,s),v=l||c&&h||d||p;return At(v?"preserve.hit":"preserve.miss",{key:r||n,isRendering:l,isRendered:c,hasRenderedSvg:f,isSameSource:h,isStreamingUpdate:d,isSettlingUpdate:p,currentSourceLen:u.length,renderedSourceLen:o.length,nextSourceLen:s.length}),v}function TP(e,t){if(!window.isMermaidLoaded){const r=document.createElement("script");r.src=window.MermaidSrc?window.MermaidSrc:"https://cdn.xiaowei.qq.com/webim/assets/static/mermaid.min.js",r.async=!0,At("script.inject",{src:r.src}),r.onload=()=>{window.isMermaidLoaded=!0,At("script.loaded",{src:r.src}),t()},r.onerror=n=>{console.error("Mermaid script加载失败:",n),window.mermaidLoadError=!0,At("script.error",{message:(n==null?void 0:n.message)||String(n)})},document.head.appendChild(r)}}const DP=80;function zh(e){e!=null&&e.__mermaidRenderTimer&&(clearTimeout(e.__mermaidRenderTimer),e.__mermaidRenderTimer=null)}async function qp(e,t){if(!e||!t)return;const{index:r,key:n,code:i,comparableCode:a}=t;if(e.getAttribute(Fu)==="true"){e.__mermaidPendingPayload=t,At("render.defer.rendering",{index:r,key:n,sourceLen:a.length});return}const o=e.getAttribute(bi)==="true"&&!!e.querySelector("svg"),s=yn(e.getAttribute(es)||"");q0(e,i),e.setAttribute(Fu,"true"),At("render.begin",{index:r,key:n,sourceLen:a.length,hadRenderedSvg:o,previousRenderedSourceLen:s.length});try{const u=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,{svg:l}=await window.mermaid.render(u,a),c=mP(l);if(!c)throw new Error("Mermaid SVG 清理结果为空");e.innerHTML=c,e.setAttribute(bi,"true"),e.setAttribute(es,a),e.removeAttribute("data-mermaid-error"),At("render.success",{index:r,key:n,svgLen:c.length})}catch(u){console.error(`MermaidService: 渲染失败 #${r+1}:`,u),o?(e.setAttribute(bi,"true"),e.setAttribute(es,s),e.setAttribute("data-mermaid-error","stale"),At("render.keep_previous",{index:r,key:n,previousRenderedSourceLen:s.length,nextSourceLen:a.length,message:(u==null?void 0:u.message)||String(u)})):(CP(e,a),e.setAttribute(bi,"error"),e.setAttribute(es,a),e.setAttribute("data-mermaid-error","true"),At("render.error",{index:r,key:n,message:(u==null?void 0:u.message)||String(u)}))}finally{e.removeAttribute(Fu);const u=e.__mermaidPendingPayload;e.__mermaidPendingPayload=null,u&&Ab(e,u)}}function Ab(e,t){if(!e||!t)return;zh(e);const r=t.hadRenderedSvg?DP:0;if(!r){qp(e,t);return}e.__mermaidRenderTimer=setTimeout(()=>{e.__mermaidRenderTimer=null,qp(e,t)},r),At("render.schedule",{index:t.index,key:t.key,sourceLen:t.comparableCode.length,delay:r})}const f1={initialized:!1,init(){this.initialized||(window.mermaid&&window.mermaid.initialize?(window.mermaid.initialize({startOnLoad:!1,theme:"default",suppressErrorRendering:!0,securityLevel:"strict"}),this.initialized=!0):console.error("Mermaid library not loaded"))},async renderAll(e=document){this.init(),Cb(e);const t=e.querySelectorAll(".mermaid-container");At("renderAll.start",{count:t.length});for(let r=0;r<t.length;r++){const n=t[r],i=W0(n),a=n.getAttribute(Ni)||"",o=yn(i);if(!o){zh(n),n.__mermaidPendingPayload=null,At("render.skip.empty",{index:r,key:a,sourceLen:i.length});continue}const s=yn(n.getAttribute(es)||"");if(n.getAttribute(bi)==="true"&&s===o){zh(n),n.__mermaidPendingPayload=null,At("render.skip.rendered",{index:r,key:a,sourceLen:o.length});continue}q0(n,i),Ab(n,{index:r,key:a,code:i,comparableCode:o,hadRenderedSvg:n.getAttribute(bi)==="true"&&!!n.querySelector("svg")})}},onMermaidLoaded(e){if(window.isMermaidLoaded)e();else{if(window.mermaidLoadError)return;const t=setInterval(()=>{window.isMermaidLoaded&&(clearInterval(t),e())},500);setTimeout(()=>{clearInterval(t),console.error("Mermaid加载超时")},3e4)}}};function pr(e,t,r,n,i,a,o,s){var u=typeof e=="function"?e.options:e;t&&(u.render=t,u.staticRenderFns=r,u._compiled=!0),n&&(u.functional=!0),a&&(u._scopeId="data-v-"+a);var l;if(o?(l=function(h){h=h||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!h&&typeof __VUE_SSR_CONTEXT__<"u"&&(h=__VUE_SSR_CONTEXT__),i&&i.call(this,h),h&&h._registeredComponents&&h._registeredComponents.add(o)},u._ssrRegister=l):i&&(l=s?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(d,p){return l.call(p),c(d,p)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}const EP={name:"MDRender",props:{className:{type:String,default:""},source:{type:String,default:""},show:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},html:{type:Boolean,default:!0},xhtmlOut:{type:Boolean,default:!0},breaks:{type:Boolean,default:!0},linkify:{type:Boolean,default:!0},emoji:{type:Boolean,default:!0},typographer:{type:Boolean,default:!1},langPrefix:{type:String,default:"language-"},quotes:{type:String,default:"“”‘’"},tableClass:{type:String,default:"table"},taskLists:{type:Boolean,default:!0},toc:{type:Boolean,default:!1},tocId:String,tocClass:{type:String,default:"table-of-contents"},tocFirstLevel:{type:Number,default:2},tocLastLevel:Number,tocAnchorLink:{type:Boolean,default:!0},tocAnchorClass:{type:String,default:"toc-anchor"},tocAnchorLinkSymbol:{type:String,default:"#"},tocAnchorLinkSpace:{type:Boolean,default:!0},tocAnchorLinkClass:{type:String,default:"toc-anchor-link"},anchorAttributes:{type:Object,default:()=>({})},prerender:{type:Function,default:e=>e},postrender:{type:Function,default:e=>e},onRendered:Function,onDestroy:{type:Function,default:()=>{}},onTocRendered:Function,incremental:{type:Boolean,default:!0}},data(){return{sourceData:"",renderSeq:0}},computed:{tocLastLevelComputed(){return this.tocLastLevel>this.tocFirstLevel?this.tocLastLevel:this.tocFirstLevel+1},renderContent(){if(!this.show)return"";const t=this.configureMd().render(this.prerender(this.sourceData.replace(/--&gt;/g,"-->").replace(/(^|[^~\\])~([^~]|$)/g,"$1\\~$2")));return this.postrender(t)}},watch:{source:{handler(e){const t=++this.renderSeq,r=document.createElement("div"),{replacedString:n,videoTags:i}=rb(e),{modifiedMdString:a,codeBlocks:o}=eb(n),s=Q_(a),{transformed:u,extracted:l}=xb(s);r.innerHTML=u;const c=()=>{if(t!==this.renderSeq)return;const f=this.prerender(SI(wb(J_(nb(tb(r.innerHTML,o),i)),l)));this.sourceData=this.xssHandler.process(f)};bb(r).then(c).catch(c)},immediate:!0},renderContent:{handler(e){const t=this.$refs.container;if(!t)return;if(!e){t.innerHTML="",this.$nextTick(()=>this.$emit("rendered",t));return}if(!this.incremental){t.innerHTML=e,this.$nextTick(()=>this.$emit("rendered",t));return}const r=document.createElement("div");r.innerHTML=e,TE(t,r,{childrenOnly:!0,getNodeKey(n){return SP(n)},onBeforeElUpdated(n,i){return AP(n,i)?(console.log("[MermaidTrace][Vue2][morph.preserve]",{from:Ki(n),to:Ki(i)}),!1):((Xs(n)||Xs(i))&&console.log("[MermaidTrace][Vue2][morph.update]",{from:Ki(n),to:Ki(i)}),n._widgetMounted&&n.classList.contains("widget-container")?(Array.from(i.attributes).forEach(a=>{a.name.startsWith("data-")&&n.setAttribute(a.name,a.value)}),!1):!(n._classifyTagMounted&&n.classList.contains("classify-tag-container")||n._planConfirmMounted&&n.classList.contains("plan-confirm-container")||n.classList.contains("audio-stream-container")&&n.children.length>0||n.tagName==="CODE"&&n.classList.contains("hljs")&&n.textContent===i.textContent))},onBeforeNodeDiscarded(n){return Xs(n)&&console.log("[MermaidTrace][Vue2][morph.beforeDiscard]",Ki(n)),!0},onNodeDiscarded(n){Xs(n)&&console.log("[MermaidTrace][Vue2][morph.discarded]",Ki(n))},onNodeAdded(n){return n.nodeType===1&&n.tagName==="CODE"&&n.parentElement&&n.parentElement.tagName==="PRE"&&(n._needsHighlight=!0),Xs(n)&&console.log("[MermaidTrace][Vue2][morph.added]",Ki(n)),n}}),this.$nextTick(()=>{this.$emit("rendered",t)})},immediate:!0}},created(){this.xssHandler=new Un.FilterXSS(yb)},mounted(){TP({},()=>{})},beforeDestroy(){this.$refs.container&&this.$emit("destroy",this.$refs.container)},methods:{configureMd(){return K_({html:this.html,xhtmlOut:this.xhtmlOut,breaks:this.breaks,linkify:this.linkify,emoji:this.emoji,typographer:this.typographer,langPrefix:this.langPrefix,quotes:this.quotes,taskLists:this.taskLists,tableClass:this.tableClass,anchorAttributes:this.anchorAttributes,toc:this.toc,tocClass:this.tocClass,tocFirstLevel:this.tocFirstLevel,tocLastLevel:this.tocLastLevelComputed,tocAnchorLink:this.tocAnchorLink,tocAnchorLinkSymbol:this.tocAnchorLinkSymbol,tocAnchorLinkSpace:this.tocAnchorLinkSpace,tocAnchorClass:this.tocAnchorClass,tocAnchorLinkClass:this.tocAnchorLinkClass,tocId:this.tocId,onTocRendered:e=>{this.$emit("tocRendered",e),this.$emit("toc-rendered",e)}})}}};var kP=function(){var t=this,r=t._self._c;return r("div",{ref:"container",class:t.className})},MP=[],LP=pr(EP,kP,MP,!1,null,null,null,null);const IP=LP.exports;function Tb(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const r=e[t],n=typeof r;(n==="object"||n==="function")&&!Object.isFrozen(r)&&Tb(r)}),e}class Zp{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Db(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function xi(e,...t){const r=Object.create(null);for(const n in e)r[n]=e[n];return t.forEach(function(n){for(const i in n)r[i]=n[i]}),r}const PP="</span>",Yp=e=>!!e.scope,RP=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const r=e.split(".");return[`${t}${r.shift()}`,...r.map((n,i)=>`${n}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class NP{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=Db(t)}openNode(t){if(!Yp(t))return;const r=RP(t.scope,{prefix:this.classPrefix});this.span(r)}closeNode(t){Yp(t)&&(this.buffer+=PP)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const Xp=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class H4{constructor(){this.rootNode=Xp(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const r=Xp({scope:t});this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,r){return typeof r=="string"?t.addText(r):r.children&&(t.openNode(r),r.children.forEach(n=>this._walk(t,n)),t.closeNode(r)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(r=>typeof r=="string")?t.children=[t.children.join("")]:t.children.forEach(r=>{H4._collapse(r)}))}}class OP extends H4{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,r){const n=t.root;r&&(n.scope=`language:${r}`),this.add(n)}toHTML(){return new NP(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ol(e){return e?typeof e=="string"?e:e.source:null}function Eb(e){return lo("(?=",e,")")}function BP(e){return lo("(?:",e,")*")}function FP(e){return lo("(?:",e,")?")}function lo(...e){return e.map(r=>ol(r)).join("")}function zP(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function U4(...e){return"("+(zP(e).capture?"":"?:")+e.map(n=>ol(n)).join("|")+")"}function kb(e){return new RegExp(e.toString()+"|").exec("").length-1}function VP(e,t){const r=e&&e.exec(t);return r&&r.index===0}const $P=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function W4(e,{joinWith:t}){let r=0;return e.map(n=>{r+=1;const i=r;let a=ol(n),o="";for(;a.length>0;){const s=$P.exec(a);if(!s){o+=a;break}o+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?o+="\\"+String(Number(s[1])+i):(o+=s[0],s[0]==="("&&r++)}return o}).map(n=>`(${n})`).join(t)}const GP=/\b\B/,Mb="[a-zA-Z]\\w*",q4="[a-zA-Z_]\\w*",Lb="\\b\\d+(\\.\\d+)?",Ib="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Pb="\\b(0b[01]+)",HP="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",UP=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=lo(t,/.*\b/,e.binary,/\b.*/)),xi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},e)},sl={begin:"\\\\[\\s\\S]",relevance:0},WP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[sl]},qP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[sl]},ZP={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e2=function(e,t,r={}){const n=xi({scope:"comment",begin:e,end:t,contains:[]},r);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=U4("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:lo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},YP=e2("//","$"),XP=e2("/\\*","\\*/"),jP=e2("#","$"),KP={scope:"number",begin:Lb,relevance:0},QP={scope:"number",begin:Ib,relevance:0},JP={scope:"number",begin:Pb,relevance:0},eR={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[sl,{begin:/\[/,end:/\]/,relevance:0,contains:[sl]}]},tR={scope:"title",begin:Mb,relevance:0},rR={scope:"title",begin:q4,relevance:0},nR={begin:"\\.\\s*"+q4,relevance:0},iR=function(e){return Object.assign(e,{"on:begin":(t,r)=>{r.data._beginMatch=t[1]},"on:end":(t,r)=>{r.data._beginMatch!==t[1]&&r.ignoreMatch()}})};var h1=Object.freeze({__proto__:null,APOS_STRING_MODE:WP,BACKSLASH_ESCAPE:sl,BINARY_NUMBER_MODE:JP,BINARY_NUMBER_RE:Pb,COMMENT:e2,C_BLOCK_COMMENT_MODE:XP,C_LINE_COMMENT_MODE:YP,C_NUMBER_MODE:QP,C_NUMBER_RE:Ib,END_SAME_AS_BEGIN:iR,HASH_COMMENT_MODE:jP,IDENT_RE:Mb,MATCH_NOTHING_RE:GP,METHOD_GUARD:nR,NUMBER_MODE:KP,NUMBER_RE:Lb,PHRASAL_WORDS_MODE:ZP,QUOTE_STRING_MODE:qP,REGEXP_MODE:eR,RE_STARTERS_RE:HP,SHEBANG:UP,TITLE_MODE:tR,UNDERSCORE_IDENT_RE:q4,UNDERSCORE_TITLE_MODE:rR});function aR(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function oR(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function sR(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=aR,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function uR(e,t){Array.isArray(e.illegal)&&(e.illegal=U4(...e.illegal))}function lR(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function cR(e,t){e.relevance===void 0&&(e.relevance=1)}const fR=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const r=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=r.keywords,e.begin=lo(r.beforeMatch,Eb(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},hR=["of","and","for","in","not","or","if","then","parent","list","value"],dR="keyword";function Rb(e,t,r=dR){const n=Object.create(null);return typeof e=="string"?i(r,e.split(" ")):Array.isArray(e)?i(r,e):Object.keys(e).forEach(function(a){Object.assign(n,Rb(e[a],t,a))}),n;function i(a,o){t&&(o=o.map(s=>s.toLowerCase())),o.forEach(function(s){const u=s.split("|");n[u[0]]=[a,pR(u[0],u[1])]})}}function pR(e,t){return t?Number(t):vR(e)?0:1}function vR(e){return hR.includes(e.toLowerCase())}const jp={},Ga=e=>{console.error(e)},Kp=(e,...t)=>{console.log(`WARN: ${e}`,...t)},wo=(e,t)=>{jp[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),jp[`${e}/${t}`]=!0)},Z0=new Error;function Nb(e,t,{key:r}){let n=0;const i=e[r],a={},o={};for(let s=1;s<=t.length;s++)o[s+n]=i[s],a[s+n]=!0,n+=kb(t[s-1]);e[r]=o,e[r]._emit=a,e[r]._multi=!0}function gR(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ga("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Z0;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ga("beginScope must be object"),Z0;Nb(e,e.begin,{key:"beginScope"}),e.begin=W4(e.begin,{joinWith:""})}}function mR(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ga("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Z0;if(typeof e.endScope!="object"||e.endScope===null)throw Ga("endScope must be object"),Z0;Nb(e,e.end,{key:"endScope"}),e.end=W4(e.end,{joinWith:""})}}function yR(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function _R(e){yR(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),gR(e),mR(e)}function bR(e){function t(o,s){return new RegExp(ol(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,s]),this.matchAt+=kb(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(u=>u[1]);this.matcherRe=t(W4(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(s);if(!u)return null;const l=u.findIndex((f,h)=>h>0&&f!==void 0),c=this.matchIndexes[l];return u.splice(0,l),Object.assign(u,c)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const u=new r;return this.rules.slice(s).forEach(([l,c])=>u.addRule(l,c)),u.compile(),this.multiRegexes[s]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,u){this.rules.push([s,u]),u.type==="begin"&&this.count++}exec(s){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let l=u.exec(s);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){const c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,l=c.exec(s)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function i(o){const s=new n;return o.contains.forEach(u=>s.addRule(u.begin,{rule:u,type:"begin"})),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&s.addRule(o.illegal,{type:"illegal"}),s}function a(o,s){const u=o;if(o.isCompiled)return u;[oR,lR,_R,fR].forEach(c=>c(o,s)),e.compilerExtensions.forEach(c=>c(o,s)),o.__beforeBegin=null,[sR,uR,cR].forEach(c=>c(o,s)),o.isCompiled=!0;let l=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),l=o.keywords.$pattern,delete o.keywords.$pattern),l=l||/\w+/,o.keywords&&(o.keywords=Rb(o.keywords,e.case_insensitive)),u.keywordPatternRe=t(l,!0),s&&(o.begin||(o.begin=/\B|\b/),u.beginRe=t(u.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(u.endRe=t(u.end)),u.terminatorEnd=ol(u.end)||"",o.endsWithParent&&s.terminatorEnd&&(u.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(u.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(c){return xR(c==="self"?o:c)})),o.contains.forEach(function(c){a(c,u)}),o.starts&&a(o.starts,s),u.matcher=i(u),u}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=xi(e.classNameAliases||{}),a(e)}function Ob(e){return e?e.endsWithParent||Ob(e.starts):!1}function xR(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return xi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ob(e)?xi(e,{starts:e.starts?xi(e.starts):null}):Object.isFrozen(e)?xi(e):e}var wR="11.11.1";class SR extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const rf=Db,Qp=xi,Jp=Symbol("nomatch"),CR=7,Bb=function(e){const t=Object.create(null),r=Object.create(null),n=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:OP};function u(L){return s.noHighlightRe.test(L)}function l(L){let O=L.className+" ";O+=L.parentNode?L.parentNode.className:"";const P=s.languageDetectRe.exec(O);if(P){const R=C(P[1]);return R||(Kp(a.replace("{}",P[1])),Kp("Falling back to no-highlight mode for this block.",L)),R?P[1]:"no-highlight"}return O.split(/\s+/).find(R=>u(R)||C(R))}function c(L,O,P){let R="",B="";typeof O=="object"?(R=L,P=O.ignoreIllegals,B=O.language):(wo("10.7.0","highlight(lang, code, ...args) has been deprecated."),wo("10.7.0",`Please use highlight(code, options) instead.
30
30
  https://github.com/highlightjs/highlight.js/issues/2277`),B=L,R=O),P===void 0&&(P=!0);const z={code:R,language:B};I("before:highlight",z);const V=z.result?z.result:f(z.language,z.code,P);return V.code=z.code,I("after:highlight",V),V}function f(L,O,P,R){const B=Object.create(null);function z(re,pe){return re.keywords[pe]}function V(){if(!de.keywords){Ke.addText(Oe);return}let re=0;de.keywordPatternRe.lastIndex=0;let pe=de.keywordPatternRe.exec(Oe),Le="";for(;pe;){Le+=Oe.substring(re,pe.index);const Ge=Te.case_insensitive?pe[0].toLowerCase():pe[0],It=z(de,Ge);if(It){const[Mn,fE]=It;if(Ke.addText(Le),Le="",B[Ge]=(B[Ge]||0)+1,B[Ge]<=CR&&(ji+=fE),Mn.startsWith("_"))Le+=pe[0];else{const hE=Te.classNameAliases[Mn]||Mn;K(pe[0],hE)}}else Le+=pe[0];re=de.keywordPatternRe.lastIndex,pe=de.keywordPatternRe.exec(Oe)}Le+=Oe.substring(re),Ke.addText(Le)}function U(){if(Oe==="")return;let re=null;if(typeof de.subLanguage=="string"){if(!t[de.subLanguage]){Ke.addText(Oe);return}re=f(de.subLanguage,Oe,!0,wt[de.subLanguage]),wt[de.subLanguage]=re._top}else re=d(Oe,de.subLanguage.length?de.subLanguage:null);de.relevance>0&&(ji+=re.relevance),Ke.__addSublanguage(re._emitter,re.language)}function q(){de.subLanguage!=null?U():V(),Oe=""}function K(re,pe){re!==""&&(Ke.startScope(pe),Ke.addText(re),Ke.endScope())}function xe(re,pe){let Le=1;const Ge=pe.length-1;for(;Le<=Ge;){if(!re._emit[Le]){Le++;continue}const It=Te.classNameAliases[re[Le]]||re[Le],Mn=pe[Le];It?K(Mn,It):(Oe=Mn,V(),Oe=""),Le++}}function Ve(re,pe){return re.scope&&typeof re.scope=="string"&&Ke.openNode(Te.classNameAliases[re.scope]||re.scope),re.beginScope&&(re.beginScope._wrap?(K(Oe,Te.classNameAliases[re.beginScope._wrap]||re.beginScope._wrap),Oe=""):re.beginScope._multi&&(xe(re.beginScope,pe),Oe="")),de=Object.create(re,{parent:{value:de}}),de}function ue(re,pe,Le){let Ge=VP(re.endRe,Le);if(Ge){if(re["on:end"]){const It=new Zp(re);re["on:end"](pe,It),It.isMatchIgnored&&(Ge=!1)}if(Ge){for(;re.endsParent&&re.parent;)re=re.parent;return re}}if(re.endsWithParent)return ue(re.parent,pe,Le)}function ee(re){return de.matcher.regexIndex===0?(Oe+=re[0],1):(Z2=!0,0)}function he(re){const pe=re[0],Le=re.rule,Ge=new Zp(Le),It=[Le.__beforeBegin,Le["on:begin"]];for(const Mn of It)if(Mn&&(Mn(re,Ge),Ge.isMatchIgnored))return ee(pe);return Le.skip?Oe+=pe:(Le.excludeBegin&&(Oe+=pe),q(),!Le.returnBegin&&!Le.excludeBegin&&(Oe=pe)),Ve(Le,re),Le.returnBegin?0:pe.length}function Q(re){const pe=re[0],Le=O.substring(re.index),Ge=ue(de,re,Le);if(!Ge)return Jp;const It=de;de.endScope&&de.endScope._wrap?(q(),K(pe,de.endScope._wrap)):de.endScope&&de.endScope._multi?(q(),xe(de.endScope,re)):It.skip?Oe+=pe:(It.returnEnd||It.excludeEnd||(Oe+=pe),q(),It.excludeEnd&&(Oe=pe));do de.scope&&Ke.closeNode(),!de.skip&&!de.subLanguage&&(ji+=de.relevance),de=de.parent;while(de!==Ge.parent);return Ge.starts&&Ve(Ge.starts,re),It.returnEnd?0:pe.length}function se(){const re=[];for(let pe=de;pe!==Te;pe=pe.parent)pe.scope&&re.unshift(pe.scope);re.forEach(pe=>Ke.openNode(pe))}let Fe={};function Pe(re,pe){const Le=pe&&pe[0];if(Oe+=re,Le==null)return q(),0;if(Fe.type==="begin"&&pe.type==="end"&&Fe.index===pe.index&&Le===""){if(Oe+=O.slice(pe.index,pe.index+1),!i){const Ge=new Error(`0 width match regex (${L})`);throw Ge.languageName=L,Ge.badRule=Fe.rule,Ge}return 1}if(Fe=pe,pe.type==="begin")return he(pe);if(pe.type==="illegal"&&!P){const Ge=new Error('Illegal lexeme "'+Le+'" for mode "'+(de.scope||"<unnamed>")+'"');throw Ge.mode=de,Ge}else if(pe.type==="end"){const Ge=Q(pe);if(Ge!==Jp)return Ge}if(pe.type==="illegal"&&Le==="")return Oe+=`
31
31
  `,1;if(q2>1e5&&q2>pe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Oe+=Le,Le.length}const Te=C(L);if(!Te)throw Ga(a.replace("{}",L)),new Error('Unknown language: "'+L+'"');const Ze=bR(Te);let rt="",de=R||Ze;const wt={},Ke=new s.__emitter(s);se();let Oe="",ji=0,zr=0,q2=0,Z2=!1;try{if(Te.__emitTokens)Te.__emitTokens(O,Ke);else{for(de.matcher.considerAll();;){q2++,Z2?Z2=!1:de.matcher.considerAll(),de.matcher.lastIndex=zr;const re=de.matcher.exec(O);if(!re)break;const pe=O.substring(zr,re.index),Le=Pe(pe,re);zr=re.index+Le}Pe(O.substring(zr))}return Ke.finalize(),rt=Ke.toHTML(),{language:L,value:rt,relevance:ji,illegal:!1,_emitter:Ke,_top:de}}catch(re){if(re.message&&re.message.includes("Illegal"))return{language:L,value:rf(O),illegal:!0,relevance:0,_illegalBy:{message:re.message,index:zr,context:O.slice(zr-100,zr+100),mode:re.mode,resultSoFar:rt},_emitter:Ke};if(i)return{language:L,value:rf(O),illegal:!1,relevance:0,errorRaised:re,_emitter:Ke,_top:de};throw re}}function h(L){const O={value:rf(L),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return O._emitter.addText(L),O}function d(L,O){O=O||s.languages||Object.keys(t);const P=h(L),R=O.filter(C).filter(T).map(q=>f(q,L,!1));R.unshift(P);const B=R.sort((q,K)=>{if(q.relevance!==K.relevance)return K.relevance-q.relevance;if(q.language&&K.language){if(C(q.language).supersetOf===K.language)return 1;if(C(K.language).supersetOf===q.language)return-1}return 0}),[z,V]=B,U=z;return U.secondBest=V,U}function p(L,O,P){const R=O&&r[O]||P;L.classList.add("hljs"),L.classList.add(`language-${R}`)}function v(L){let O=null;const P=l(L);if(u(P))return;if(I("before:highlightElement",{el:L,language:P}),L.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",L);return}if(L.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(L)),s.throwUnescapedHTML))throw new SR("One of your code blocks includes unescaped HTML.",L.innerHTML);O=L;const R=O.textContent,B=P?c(R,{language:P,ignoreIllegals:!0}):d(R);L.innerHTML=B.value,L.dataset.highlighted="yes",p(L,P,B.language),L.result={language:B.language,re:B.relevance,relevance:B.relevance},B.secondBest&&(L.secondBest={language:B.secondBest.language,relevance:B.secondBest.relevance}),I("after:highlightElement",{el:L,result:B,text:R})}function g(L){s=Qp(s,L)}const m=()=>{b(),wo("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){b(),wo("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _=!1;function b(){function L(){b()}if(document.readyState==="loading"){_||window.addEventListener("DOMContentLoaded",L,!1),_=!0;return}document.querySelectorAll(s.cssSelector).forEach(v)}function x(L,O){let P=null;try{P=O(e)}catch(R){if(Ga("Language definition for '{}' could not be registered.".replace("{}",L)),i)Ga(R);else throw R;P=o}P.name||(P.name=L),t[L]=P,P.rawDefinition=O.bind(null,e),P.aliases&&A(P.aliases,{languageName:L})}function w(L){delete t[L];for(const O of Object.keys(r))r[O]===L&&delete r[O]}function S(){return Object.keys(t)}function C(L){return L=(L||"").toLowerCase(),t[L]||t[r[L]]}function A(L,{languageName:O}){typeof L=="string"&&(L=[L]),L.forEach(P=>{r[P.toLowerCase()]=O})}function T(L){const O=C(L);return O&&!O.disableAutodetect}function D(L){L["before:highlightBlock"]&&!L["before:highlightElement"]&&(L["before:highlightElement"]=O=>{L["before:highlightBlock"](Object.assign({block:O.el},O))}),L["after:highlightBlock"]&&!L["after:highlightElement"]&&(L["after:highlightElement"]=O=>{L["after:highlightBlock"](Object.assign({block:O.el},O))})}function k(L){D(L),n.push(L)}function M(L){const O=n.indexOf(L);O!==-1&&n.splice(O,1)}function I(L,O){const P=L;n.forEach(function(R){R[P]&&R[P](O)})}function N(L){return wo("10.7.0","highlightBlock will be removed entirely in v12.0"),wo("10.7.0","Please use highlightElement now."),v(L)}Object.assign(e,{highlight:c,highlightAuto:d,highlightAll:b,highlightElement:v,highlightBlock:N,configure:g,initHighlighting:m,initHighlightingOnLoad:y,registerLanguage:x,unregisterLanguage:w,listLanguages:S,getLanguage:C,registerAliases:A,autoDetection:T,inherit:Qp,addPlugin:k,removePlugin:M}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=wR,e.regex={concat:lo,lookahead:Eb,either:U4,optional:FP,anyNumberOfTimes:BP};for(const L in h1)typeof h1[L]=="object"&&Tb(h1[L]);return Object.assign(e,h1),e},vs=Bb({});vs.newInstance=()=>Bb({});var AR=vs;vs.HighlightJS=vs;vs.default=vs;const Ft=ir(AR),ev="[A-Za-z$_][0-9A-Za-z$_]*",TR=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],DR=["true","false","null","undefined","NaN","Infinity"],Fb=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],zb=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vb=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ER=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],kR=[].concat(Vb,Fb,zb);function MR(e){const t=e.regex,r=(P,{after:R})=>{const B="</"+P[0].slice(1);return P.input.indexOf(B,R)!==-1},n=ev,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,R)=>{const B=P[0].length+P.index,z=P.input[B];if(z==="<"||z===","){R.ignoreMatch();return}z===">"&&(r(P,{after:B})||R.ignoreMatch());let V;const U=P.input.substring(B);if(V=U.match(/^\s*=/)){R.ignoreMatch();return}if((V=U.match(/^\s+extends\s+/))&&V.index===0){R.ignoreMatch();return}}},s={$pattern:ev,keyword:TR,literal:DR,built_in:kR,"variable.language":ER},u="[0-9](_?[0-9])*",l=`\\.(${u})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${u})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},d={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},_=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,v,g,{match:/\$\d+/},f];h.contains=_.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(_)});const b=[].concat(y,h.contains),x=b.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:x},S={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Fb,...zb]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function k(P){return t.concat("(?!",P.join("|"),")")}const M={match:t.concat(/\b/,k([...Vb,"super","import"].map(P=>`${P}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},N={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,v,g,y,{match:/\$\d+/},f,C,{scope:"attr",match:n+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:L,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},M,D,S,N,{match:/\$[(.]/}]}}var LR=MR;const IR=ir(LR);function PR(e){const t=e.regex,r=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},c={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,c,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,c,l]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,c,l]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,l]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",d=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,p=`\\b|${n.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${d}))[eE][+-]?(${h})[jJ]?(?=${p})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${h})[jJ](?=${p})`}]},g={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",u,v,f,e.HASH_COMMENT_MODE]}]};return l.contains=[f,v,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|\?)|=>/,contains:[u,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[v,m,f]}]}}var RR=PR;const NR=ir(RR);function OR(e){const t=e.regex,r=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),u=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,u,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,u,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(r,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}var BR=OR;const FR=ir(BR);function zR(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],i={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[t,r,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var VR=zR;const $R=ir(VR);function GR(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="<[^<>]+>",o="("+n+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional(a)+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+u+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",g={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},m=[f,s,r,e.C_BLOCK_COMMENT_MODE,c,l],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:m.concat([{begin:/\(/,end:/\)/,keywords:g,contains:m.concat(["self"]),relevance:0}]),relevance:0},_={begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,l,c,s,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,c,s]}]},s,r,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:g,disableAutodetect:!0,illegal:"</",contains:[].concat(y,_,m,[f,{begin:e.IDENT_RE+"::",keywords:g},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:l,keywords:g}}}var HR=GR;const UR=ir(HR);function WR(e){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}var qR=WR;const ZR=ir(qR);var Yo="[0-9](_*[0-9])*",d1=`\\.(${Yo})`,p1="[0-9a-fA-F](_*[0-9a-fA-F])*",tv={className:"number",variants:[{begin:`(\\b(${Yo})((${d1})|\\.)?|(${d1}))[eE][+-]?(${Yo})[fFdD]?\\b`},{begin:`\\b(${Yo})((${d1})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${d1})[fFdD]?\\b`},{begin:`\\b(${Yo})[fFdD]\\b`},{begin:`\\b0[xX]((${p1})\\.?|(${p1})?\\.(${p1}))[pP][+-]?(${Yo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${p1})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $b(e,t,r){return r===-1?"":e.replace(t,n=>$b(e,t,r-1))}function YR(e){const t=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=r+$b("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},l={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},c={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[l,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,tv,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},tv,l]}}var XR=YR;const jR=ir(XR);function KR(e){const t=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(n,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},f={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},h="[1-9](_?[0-9])*|0",d="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},w=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:r}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,l),relevance:0}].concat(u,l);c.contains=w,v.contains=w;const S="[>?]>",C="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",A="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",T=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^("+S+"|"+C+"|"+A+")(?=[ ])",starts:{end:"$",keywords:o,contains:w}}];return l.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(l).concat(w)}}var QR=KR;const JR=ir(QR);function eN(e){const t="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),u="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",c="(\\.[0-9]*)?",f="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",h={className:"number",begin:"\\b"+u+l+c+f+"\\b"},d={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},p={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},v={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},g=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,v,a,o],m=[...g];return m.pop(),m.push(s),d.contains=m,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}var tN=eN;const rN=ir(tN);function nN(e){const t=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="<[^<>]+>",o="(?!struct)("+n+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional(a)+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",l={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+u+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],m=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],b={type:v,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},x={className:"function.dispatch",relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},w=[x,f,s,r,e.C_BLOCK_COMMENT_MODE,c,l],S={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:w.concat([{begin:/\(/,end:/\)/,keywords:b,contains:w.concat(["self"]),relevance:0}]),relevance:0},C={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:b,relevance:0},{begin:d,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,l,c,s,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,c,s]}]},s,r,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:b,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(S,C,x,w,[f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:b,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:b},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}var iN=nN;const aN=ir(iN),oN=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),sN=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],uN=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],lN=[...sN,...uN],cN=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),fN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),hN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),dN=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function pN(e){const t=e.regex,r=oN(e),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",s=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,n,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+fN.join("|")+")"},{begin:":(:)?("+hN.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+dN.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:cN.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+lN.join("|")+")\\b"}]}}var vN=pN;const gN=ir(vN);function mN(e){const t={className:"subst",variants:[{begin:"\\$[A-Za-z0-9_]+"}]},r={className:"subst",variants:[{begin:/\$\{/,end:/\}/}],keywords:"true false null this is new super"},n={className:"number",relevance:0,variants:[{match:/\b[0-9][0-9_]*(\.[0-9][0-9_]*)?([eE][+-]?[0-9][0-9_]*)?\b/},{match:/\b0[xX][0-9A-Fa-f][0-9A-Fa-f_]*\b/}]},i={className:"string",variants:[{begin:"r'''",end:"'''"},{begin:'r"""',end:'"""'},{begin:"r'",end:"'",illegal:"\\n"},{begin:'r"',end:'"',illegal:"\\n"},{begin:"'''",end:"'''",contains:[e.BACKSLASH_ESCAPE,t,r]},{begin:'"""',end:'"""',contains:[e.BACKSLASH_ESCAPE,t,r]},{begin:"'",end:"'",illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,r]},{begin:'"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,t,r]}]};r.contains=[n,i];const a=["Comparable","DateTime","Duration","Function","Iterable","Iterator","List","Map","Match","Object","Pattern","RegExp","Set","Stopwatch","String","StringBuffer","StringSink","Symbol","Type","Uri","bool","double","int","num","Element","ElementList"],o=a.map(l=>`${l}?`);return{name:"Dart",keywords:{keyword:["abstract","as","assert","async","await","base","break","case","catch","class","const","continue","covariant","default","deferred","do","dynamic","else","enum","export","extends","extension","external","factory","false","final","finally","for","Function","get","hide","if","implements","import","in","interface","is","late","library","mixin","new","null","on","operator","part","required","rethrow","return","sealed","set","show","static","super","switch","sync","this","throw","true","try","typedef","var","void","when","while","with","yield"],built_in:a.concat(o).concat(["Never","Null","dynamic","print","document","querySelector","querySelectorAll","window"]),$pattern:/[A-Za-z][A-Za-z0-9_]*\??/},contains:[i,e.COMMENT(/\/\*\*(?!\/)/,/\*\//,{subLanguage:"markdown",relevance:0}),e.COMMENT(/\/{3,} ?/,/$/,{contains:[{subLanguage:"markdown",begin:".",end:"$",relevance:0}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},n,{className:"meta",begin:"@[A-Za-z]+"},{begin:"=>"}]}}var yN=mN;const _N=ir(yN);Ft.registerLanguage("javascript",IR);Ft.registerLanguage("python",NR);Ft.registerLanguage("xml",FR);Ft.registerLanguage("json",$R);Ft.registerLanguage("c",UR);Ft.registerLanguage("go",ZR);Ft.registerLanguage("java",jR);Ft.registerLanguage("ruby",JR);Ft.registerLanguage("yaml",rN);Ft.registerLanguage("cpp",aN);Ft.registerLanguage("css",gN);Ft.registerLanguage("dart",_N);window.hljs=Ft;let rv=!1;async function bN(){if(!rv)try{await Promise.resolve().then(()=>require("./highlightjs-line-numbers.min-b98a1afd.js")),window.hljs&&window.hljs.initLineNumbersOnLoad&&window.hljs.initLineNumbersOnLoad(),rv=!0}catch(e){console.error("Failed to load highlightjs-line-numbers:",e)}}function nf(e){Ft.highlightBlock(e)}function nv(e){Ft.lineNumbersBlock&&Ft.lineNumbersBlock(e)}const xN=e=>e.replace(/(\d)\*(\d)/g,"$1\\*$2"),wN=e=>{const t=/(^|\n\n)?(\$\$(.*?)\$\$)(\n\n|$)?/g;return e.replace(t,(n,i,a,o,s)=>`
32
32
 
@@ -44,7 +44,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),B=L,R=O),P===void 0&&(
44
44
 
45
45
  <div class="video-placeholder"></div>
46
46
 
47
- `))}return e=WN(e),e=UN(e),r&&(e=QN(e,n)),ZN(e)||(e=YN(e),e=jN.clean(e)),e=DN(e),e=EN(e),e=SN(e),e=kN(e),e=xN(e),e=wN(e),e=HN(e),i||(e=CN(e)),e=AN(e),a&&(e=BN(e)),o&&(e=ON(e,s)),u?e=IN(e,l):e=PN(e),c&&c.length>0?e=RN(e,c):e=NN(e),f?e=FN(e):e=zN(e),h?e=VN(e):e=$N(e),e=TN(e),e=XN.process(dE(e)),e}function QN(e,t){if(!e||Gb(window.location.hash,"from"))return e;let n=["lke.cloud.tencent.com","qidian"];t&&(n=t.concat(n));const i=GN(e);i.forEach((u,l)=>{e=e.replace(u,`IMG_URL${l}`)});const a=`${window.location.protocol}//${window.location.host}/lke#/link-info/redirect?target=`,o=n.map(u=>`(?!.*${u})`).join(""),s=new RegExp(`(\\[([^\\]]+)\\]\\((https?:\\/\\/${o}[^\\s)]+)\\))|(<a\\s+[^>]*href="(${o}[^"]+)"[^>]*>(.*?)<\\/a>)`,"gi");return e=e.replace(s,(u,l,c,f,h,d,p)=>l&&c?`[${c}](${a}${encodeURIComponent(f)})`:d&&!d.startsWith("#")?`<a href="${a}${encodeURIComponent(d)}">${p}</a>`:u),i.forEach((u,l)=>{e=e.replace(`IMG_URL${l}`,u)}),e}function af(e,t={}){return MN(e,r=>KN(r,t))}const JN={data(){return{currentTimer:null,currentIndex:0}},methods:{clearTimer(){this.currentTimer&&(clearTimeout(this.currentTimer),this.currentTimer=null)},startCurrentTimer(e={}){const{printCount:t=1,printCountTime:r=16,hideCursorPoint:n=!1,isFinal:i=!1}=e;this.clearTimer(),this.currentTimer=setTimeout(()=>{const a=t;this.currentIndex+=a,this.renderText=n?this.currentText.substring(0,this.currentIndex):this.currentText.substring(0,this.currentIndex)+"CURSOR_POINT",(this.currentIndex<this.currentText.length||!i)&&this.startCurrentTimer(e)},r)}},beforeDestroy(){this.clearTimer()}};function eO(e,t={}){const{type:r="text/javascript",crossOrigin:n}=t;return new Promise((i,a)=>{if(document.querySelector(`script[src="${e}"]`)){i();return}const o=document.createElement("script");o.src=e,o.type=r,n&&(o.crossOrigin=n),o.onload=i,o.onerror=()=>a(new Error(`Failed to load: ${e}`)),document.head.appendChild(o)})}function tO(){const e=Date.now(),t=5*60*1e3;return Math.floor(e/t)*t}async function rO(){try{window.tdWidgetSrc="/cdn-proxy/webim/assets/static/widget/release/lib/js/";const e=window.tdWidgetSrc||"https://cdn.xiaowei.qq.com/webim/assets/static/widget/release/lib/js/",t=tO();return await eO(`${e}adp-widget.js?nounce=${t}`,{type:"module"}),!0}catch(e){throw console.error("Failed to load adp-widget:",e),e}}Ia.config&&!Ia.config.ignoredElements.includes("adp-widget")&&Ia.config.ignoredElements.push("adp-widget");const nO={name:"MsgWidget",props:{output:{type:String,default:""},locale:{type:String,default:"zh-CN"},disable:{type:Boolean,default:!1}},data(){return{loaded:!1}},async mounted(){try{await rO(),this.loaded=!0}catch(e){console.error("[MsgWidget] 加载 adp-widget 失败:",e)}},methods:{handleAction(e){const{action:t}=e.detail||{};this.$emit("widget-action",t),this.$emit("widget-event",e)},handleRendered(e){const{success:t,config:r,error:n,timestamp:i}=e.detail||{};this.$emit("widget-rendered",{success:t,config:r,error:n,timestamp:i})}}};var iO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"lke__widget-container"},[t.output&&t.loaded?r("adp-widget",{ref:"widget",attrs:{locale:t.locale,"widget-json":t.output,disable:t.disable},on:{"widget-rendered":t.handleRendered,"widget-action":t.handleAction}}):t._e()],1)},aO=[],oO=pr(nO,iO,aO,!1,null,"c152fdb4",null,null);const Hb=oO.exports,Y=(...e)=>{console.log("[StreamAudioPlayer24]",...e)};let Ub=class{constructor(){this.playMode=null,this.audioContext=null,this.audioQueue=[],this.pendingChunks=[],this.isPlaying=!1,this.totalDuration=0,this.estimatedDuration=0,this.pausedAt=0,this.startedAt=0,this.timeUpdateInterval=null,this.scheduledSources=[],this.nextScheduleTime=0,this.scheduledCount=0,this.autoPlayCheckInterval=null,this.autoPlayCheckWaitTime=0,this.processedChunkCount=0,this.decodingInProgress=!1,this.isSchedulingFromPosition=!1,this.decodeAheadCount=1;const t=this.isMobileDevice();this.maxDecodedBuffers=t?8:20,this.playedBufferCount=0,this.audioElement=null,this.iosUnlockAudio=null,this.mediaStreamDestination=null,this.wasPlayingBeforeHidden=!1,this.handleVisibilityChange=null,this.onPlayCallback=null,this.onPauseCallback=null,this.onEndCallback=null,this.onErrorCallback=null,this.onTimeUpdateCallback=null,this.onDurationChangeCallback=null,this.onUrlReadyCallback=null,this.generationComplete=!1,this.durationFromUrlSet=!1,this.urlReady=!1,this.fullAudioUrl=null,this.preloadedAudioElement=null}isMobileDevice(){return typeof navigator>"u"?!1:/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}initAudioContext(){if(!this.audioContext)try{const t=window.AudioContext||window.webkitAudioContext;this.audioContext=new t,Y("[initAudioContext] AudioContext 创建成功",{state:this.audioContext.state,sampleRate:this.audioContext.sampleRate,isIOS:/iPhone|iPad|iPod/i.test(navigator.userAgent)}),this.audioContext.onstatechange=()=>{if(Y("[AudioContext.onstatechange] 状态变化:",this.audioContext.state),(this.audioContext.state==="interrupted"||this.audioContext.state==="suspended")&&this.isPlaying&&this.iosUnlockAudio)try{this.iosUnlockAudio.pause(),Y("[AudioContext.onstatechange] iOS audio 元素已暂停")}catch{}},this.handleVisibilityChange=()=>{var r,n,i,a;document.hidden?(this.wasPlayingBeforeHidden=this.isPlaying,Y("[visibilitychange] 页面隐藏,记录播放状态:",this.wasPlayingBeforeHidden)):(Y("[visibilitychange] 页面可见",{wasPlayingBeforeHidden:this.wasPlayingBeforeHidden,isPlaying:this.isPlaying,audioContextState:(r=this.audioContext)==null?void 0:r.state}),this.wasPlayingBeforeHidden&&(((n=this.audioContext)==null?void 0:n.state)==="suspended"||((i=this.audioContext)==null?void 0:i.state)==="interrupted"?this.audioContext.resume().then(()=>{Y("[visibilitychange] AudioContext 已恢复"),this.isPlaying&&this.iosUnlockAudio&&this.iosUnlockAudio.play().catch(o=>{Y("[visibilitychange] iOS audio 恢复播放失败:",o)})}).catch(o=>{Y("[visibilitychange] AudioContext 恢复失败:",o),this.isPlaying&&(this.isPlaying=!1,this.onPauseCallback&&this.onPauseCallback())}):((a=this.audioContext)==null?void 0:a.state)==="running"&&this.isPlaying&&this.iosUnlockAudio&&this.iosUnlockAudio.play().catch(o=>{Y("[visibilitychange] iOS audio 恢复播放失败:",o)})),this.wasPlayingBeforeHidden=!1)},document.addEventListener("visibilitychange",this.handleVisibilityChange),/iPhone|iPad|iPod/i.test(navigator.userAgent)&&this.setupIOSAudioRoute()}catch(t){console.error("[initAudioContext] 创建 AudioContext 失败:",t),this.onErrorCallback&&this.onErrorCallback(new Error("浏览器不支持音频播放"))}}setupIOSAudioRoute(){if(this.audioContext)try{if(typeof this.audioContext.createMediaStreamDestination!="function"){Y("[setupIOSAudioRoute] 浏览器不支持 createMediaStreamDestination");return}this.mediaStreamDestination=this.audioContext.createMediaStreamDestination(),this.iosUnlockAudio=document.createElement("audio"),this.iosUnlockAudio.srcObject=this.mediaStreamDestination.stream,this.iosUnlockAudio.setAttribute("playsinline","true"),this.iosUnlockAudio.setAttribute("webkit-playsinline","true"),this.iosUnlockAudio.onerror=t=>{Y("[setupIOSAudioRoute] iOS audio 元素错误:",t)},Y("[setupIOSAudioRoute] iOS 音频路由设置完成")}catch(t){console.error("[setupIOSAudioRoute] 设置失败:",t),this.mediaStreamDestination=null,this.iosUnlockAudio=null}}getAudioDestination(){return this.mediaStreamDestination?this.mediaStreamDestination:this.audioContext?this.audioContext.destination:null}async startIOSAudioElement(){if(this.iosUnlockAudio)try{await this.iosUnlockAudio.play(),Y("[startIOSAudioElement] iOS audio 元素播放启动成功")}catch(t){Y("[startIOSAudioElement] iOS audio 元素播放失败:",t)}}initAudioElement(){this.audioElement||(this.audioElement=new Audio,this.audioElement.preload="metadata",this.audioElement.addEventListener("play",()=>{this.isPlaying=!0,this.onPlayCallback&&this.onPlayCallback()}),this.audioElement.addEventListener("pause",()=>{this.isPlaying=!1,this.onPauseCallback&&this.onPauseCallback()}),this.audioElement.addEventListener("ended",()=>{this.isPlaying=!1,this.onEndCallback&&this.onEndCallback()}),this.audioElement.addEventListener("timeupdate",()=>{this.onTimeUpdateCallback&&this.onTimeUpdateCallback(this.audioElement.currentTime,this.audioElement.duration||0)}),this.audioElement.addEventListener("durationchange",()=>{this.totalDuration=this.audioElement.duration||0,this.onDurationChangeCallback&&this.onDurationChangeCallback(this.totalDuration)}),this.audioElement.addEventListener("error",t=>{this.onErrorCallback&&this.onErrorCallback(new Error("音频加载失败: "+(t.message||"未知错误")))}),this.audioElement.addEventListener("loadedmetadata",()=>{this.totalDuration=this.audioElement.duration||0,this.onDurationChangeCallback&&this.onDurationChangeCallback(this.totalDuration)}))}setPlayMode(t){this.playMode!==t&&(this.playMode==="stream"?this.clearStreamMode():this.playMode==="url"&&this.clearUrlMode(),this.playMode=t,t==="stream"?this.initAudioContext():t==="url"&&this.initAudioElement())}clearStreamMode(){this.stop(),this.audioQueue=[],this.pendingChunks=[],this.totalDuration=0,this.estimatedDuration=0,this.scheduledCount=0,this.nextScheduleTime=0,this.processedChunkCount=0,this.decodingInProgress=!1,this.isSchedulingFromPosition=!1,this.playedBufferCount=0,this.generationComplete=!1,this.fullAudioUrl=null,this.urlReady=!1,this.preloadedAudioElement=null,this.iosUnlockAudio&&(this.iosUnlockAudio.pause(),this.iosUnlockAudio.srcObject=null,this.iosUnlockAudio=null),this.mediaStreamDestination=null,this.handleVisibilityChange&&(document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.handleVisibilityChange=null),this.audioContext&&(this.audioContext.onstatechange=null,this.audioContext.close().catch(()=>{}),this.audioContext=null),this.wasPlayingBeforeHidden=!1}clearUrlMode(){this.audioElement&&(this.audioElement.pause(),this.audioElement.src="")}setAudioUrl(t){t&&(this.setPlayMode("url"),this.audioElement.src=t,this.audioElement.load())}async ensureAudioContextRunning(){if(!this.audioContext)throw new Error("AudioContext not initialized");if(Y("[ensureAudioContextRunning] 当前状态:",this.audioContext.state),this.audioContext.state==="suspended")try{await this.audioContext.resume(),Y("[ensureAudioContextRunning] resume 成功,新状态:",this.audioContext.state),/iPhone|iPad|iPod/i.test(navigator.userAgent)&&await this.playUnlockSound()}catch(t){throw console.error("[ensureAudioContextRunning] resume 失败:",t),new Error("无法激活音频上下文")}else if(this.audioContext.state==="interrupted")try{await this.audioContext.resume(),Y("[ensureAudioContextRunning] 从 interrupted 状态恢复")}catch(t){throw console.error("[ensureAudioContextRunning] 从 interrupted 恢复失败:",t),new Error("无法恢复音频上下文")}}async playUnlockSound(){if(this.audioContext)try{const t=this.audioContext.createBuffer(1,1,this.audioContext.sampleRate),r=this.audioContext.createBufferSource();r.buffer=t,r.connect(this.getAudioDestination()),r.start(0),Y("[playUnlockSound] 播放解锁音频完成")}catch(t){Y("[playUnlockSound] 播放解锁音频失败(可忽略):",t)}}addBase64ChunkLazy(t,r=1){if(!t)return;this.setPlayMode("stream"),this.pendingChunks.push(t);const n=(t.length*.75/1024).toFixed(2);Y(`[addBase64ChunkLazy] 添加第 ${this.pendingChunks.length+this.processedChunkCount} 个chunk`,{chunkSize:`${n} KB`,pendingChunks:this.pendingChunks.length,processedChunkCount:this.processedChunkCount,audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,isPlaying:this.isPlaying,totalDuration:this.totalDuration.toFixed(2),estimatedDuration:this.estimatedDuration.toFixed(2)}),this.estimatedDuration+=r,this.onDurationChangeCallback&&this.onDurationChangeCallback(this.getDisplayDuration()),this.autoPlayCheckWaitTime>0&&(Y("[addBase64ChunkLazy] 重置等待超时时间"),this.autoPlayCheckWaitTime=0),this.isPlaying?(Y("[addBase64ChunkLazy] 正在播放,触发 decodeAhead"),this.decodeAhead()):Y("[addBase64ChunkLazy] 未在播放状态,不触发解码")}async addBase64Chunk(t){t&&this.addBase64ChunkLazy(t)}getDisplayDuration(){return Math.floor(this.totalDuration+this.estimatedDuration)}async decodeAhead(){let t=0;if(this.audioQueue.forEach(i=>{t+=i.duration}),Y("[decodeAhead] 开始",{decodingInProgress:this.decodingInProgress,pendingChunks:this.pendingChunks.length,audioQueueLength:this.audioQueue.length,currentQueueDuration:t.toFixed(2),scheduledCount:this.scheduledCount,isPlaying:this.isPlaying,generationComplete:this.generationComplete,totalDuration:this.totalDuration.toFixed(2)}),this.decodingInProgress){Y("[decodeAhead] 已在解码中,跳过");return}if(this.pendingChunks.length===0){Y("[decodeAhead] 没有待解码的 chunk,跳过");return}const r=this.audioQueue.length-this.scheduledCount;if(Y("[decodeAhead] 未调度数量检查",{unscheduledCount:r,decodeAheadCount:this.decodeAheadCount,needMoreDecode:r<this.decodeAheadCount}),r>=this.decodeAheadCount&&this.pendingChunks.length>0){Y("[decodeAhead] 已有足够预解码 buffer,100ms 后再检查"),setTimeout(()=>this.decodeAhead(),100);return}this.decodingInProgress=!0;const n=this.processedChunkCount+1;try{const i=this.pendingChunks.shift(),a=(i.length*.75/1024).toFixed(2);Y(`[decodeAhead] 开始解码第 ${n} 个chunk`,{size:`${a} KB`});const o=window.atob(i),s=new Uint8Array(o.length);for(let l=0;l<o.length;l++)s[l]=o.charCodeAt(l);const u=s.buffer;await this.addAudioChunkInternal(u),Y(`[decodeAhead] 第 ${n} 个chunk 解码完成`,{audioQueueLength:this.audioQueue.length,totalDuration:this.totalDuration.toFixed(2),durationFromUrlSet:this.durationFromUrlSet}),this.durationFromUrlSet||(this.estimatedDuration>0&&(this.estimatedDuration=Math.max(0,this.estimatedDuration-1)),this.onDurationChangeCallback&&this.onDurationChangeCallback(this.getDisplayDuration()))}catch(i){console.error(`[decodeAhead] 解码第 ${n} 个chunk 失败:`,i),this.onErrorCallback&&this.onErrorCallback(i)}finally{this.decodingInProgress=!1}this.pendingChunks.length>0&&this.isPlaying?(Y("[decodeAhead] 继续解码下一个chunk"),setTimeout(()=>this.decodeAhead(),0)):Y("[decodeAhead] 解码结束",{pendingChunks:this.pendingChunks.length,isPlaying:this.isPlaying})}async processAudioDataArray(t){if(!t||!Array.isArray(t))return;const r=t.slice(this.processedChunkCount);Y("[processAudioDataArray] 处理音频数据数组",{totalLength:t.length,processedChunkCount:this.processedChunkCount,newChunksCount:r.length});for(const n of r)await this.addBase64Chunk(n),this.processedChunkCount++;Y("[processAudioDataArray] 处理完成",{processedChunkCount:this.processedChunkCount})}decodeAudioDataCompat(t){const r=(t.byteLength/1024).toFixed(2);return Y("[decodeAudioDataCompat] 开始解码",{size:`${r} KB`}),new Promise((n,i)=>{const a=this.audioContext.decodeAudioData(t,o=>{Y("[decodeAudioDataCompat] 解码成功",{duration:o.duration.toFixed(2),sampleRate:o.sampleRate,channels:o.numberOfChannels}),n(o)},o=>{console.error("[decodeAudioDataCompat] 解码失败",{error:(o==null?void 0:o.message)||o,bufferSize:`${r} KB`}),i(o||new Error("解码音频数据失败"))});a&&typeof a.then=="function"&&a.then(n).catch(o=>{console.error("[decodeAudioDataCompat] Promise 解码失败",{error:(o==null?void 0:o.message)||o,bufferSize:`${r} KB`}),i(o)})})}async addAudioChunk(t){return this.addAudioChunkInternal(t)}async addAudioChunkInternal(t){if(this.setPlayMode("stream"),!this.audioContext)throw new Error("AudioContext not initialized");try{let r;t instanceof Blob?r=await t.arrayBuffer():r=t;const n=(r.byteLength/1024).toFixed(2);Y("[addAudioChunkInternal] 开始解码 ArrayBuffer",{size:`${n} KB`});const i=r.slice(0),a=await this.decodeAudioDataCompat(i),o=this.audioQueue.length,s=this.totalDuration;this.audioQueue.push(a),this.durationFromUrlSet||(this.totalDuration+=a.duration),Y("[addAudioChunkInternal] 解码成功",{bufferDuration:a.duration.toFixed(2),sampleRate:a.sampleRate,numberOfChannels:a.numberOfChannels,length:a.length,audioQueueLength:`${o} -> ${this.audioQueue.length}`,totalDuration:`${s.toFixed(2)} -> ${this.totalDuration.toFixed(2)}`,durationFromUrlSet:this.durationFromUrlSet}),this.isPlaying&&!this.isSchedulingFromPosition?(Y("[addAudioChunkInternal] 正在播放,调用 scheduleNewChunks"),this.scheduleNewChunks()):this.isSchedulingFromPosition?Y("[addAudioChunkInternal] 正在执行 scheduleFromPosition,跳过 scheduleNewChunks"):Y("[addAudioChunkInternal] 未在播放状态,不调度"),this.onDurationChangeCallback&&!this.durationFromUrlSet&&this.onDurationChangeCallback(this.getDisplayDuration())}catch(r){console.error("[addAudioChunkInternal] 解码音频数据失败:",r),this.onErrorCallback&&this.onErrorCallback(r)}}async addPCMChunk(t,r=24e3,n=1,i=16){if(this.setPlayMode("stream"),!this.audioContext)throw new Error("AudioContext not initialized");try{const a=i/8,o=t.byteLength/(a*n),s=this.audioContext.createBuffer(n,o,r),u=new DataView(t);for(let l=0;l<n;l++){const c=s.getChannelData(l);for(let f=0;f<o;f++){let h;if(i===16)h=u.getInt16((f*n+l)*2,!0)/32768;else if(i===8)h=(u.getUint8(f*n+l)-128)/128;else if(i===32)h=u.getFloat32((f*n+l)*4,!0);else throw new Error(`Unsupported bits per sample: ${i}`);c[f]=h}}this.audioQueue.push(s),this.totalDuration+=s.duration,this.isPlaying&&this.audioContext&&this.scheduleNewChunks(),this.onDurationChangeCallback&&this.onDurationChangeCallback(this.totalDuration)}catch(a){this.onErrorCallback&&this.onErrorCallback(a)}}scheduleNewChunks(){if(!this.audioContext||!this.isPlaying){Y("[scheduleNewChunks] 跳过",{hasAudioContext:!!this.audioContext,isPlaying:this.isPlaying});return}const t=this.audioContext.currentTime,r=this.scheduledCount;this.scheduledCount>this.audioQueue.length&&(Y("[scheduleNewChunks] 警告:scheduledCount 超出 audioQueue 长度!",{scheduledCount:this.scheduledCount,audioQueueLength:this.audioQueue.length,playedBufferCount:this.playedBufferCount}),this.scheduledCount=this.audioQueue.length),Y("[scheduleNewChunks] 开始调度",{audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,toSchedule:this.audioQueue.length-this.scheduledCount,currentTime:t.toFixed(3),nextScheduleTime:this.nextScheduleTime.toFixed(3),pendingChunks:this.pendingChunks.length});for(let n=this.scheduledCount;n<this.audioQueue.length;n++){const i=this.audioQueue[n],a=this.audioContext.createBufferSource();a.buffer=i,a.connect(this.getAudioDestination());const o=Math.max(t,this.nextScheduleTime);Y(`[scheduleNewChunks] 调度第 ${n+1} 个buffer`,{bufferDuration:i.duration.toFixed(2),scheduleTime:o.toFixed(3),currentTime:t.toFixed(3)}),a.start(o,0,i.duration),this.nextScheduleTime=o+i.duration,this.scheduledCount++,this.scheduledSources.push(a),a.onended=()=>{const s=this.scheduledSources.indexOf(a);if(s===-1){Y(`[sourceNode.onended] 第 ${n+1} 个buffer 被手动停止,跳过后续逻辑`);return}if(this.scheduledSources.splice(s,1),this.playedBufferCount++,this.cleanupOldBuffers(),Y(`[sourceNode.onended] 第 ${n+1} 个buffer 播放结束`,{scheduledSourcesLength:this.scheduledSources.length,isPlaying:this.isPlaying,pendingChunks:this.pendingChunks.length,audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,generationComplete:this.generationComplete,playedBufferCount:this.playedBufferCount}),this.decodeAhead(),this.scheduledSources.length===0&&this.isPlaying){let u=0;this.audioQueue.forEach(l=>{u+=l.duration}),Y("[sourceNode.onended] 所有已调度片段播放完毕,尝试调度新片段",{audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,unscheduledCount:this.audioQueue.length-this.scheduledCount,remainingQueueDuration:u.toFixed(2),pendingChunks:this.pendingChunks.length}),this.scheduleNewChunks(),this.scheduledSources.length===0&&(Y("[sourceNode.onended] 调度后仍无片段",{pendingChunks:this.pendingChunks.length,generationComplete:this.generationComplete,audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,unscheduledBuffers:this.audioQueue.length-this.scheduledCount}),this.pendingChunks.length>0?(Y("[sourceNode.onended] 还有待解码chunk,启动 autoPlayCheck"),this.startAutoPlayCheck()):this.audioQueue.length>this.scheduledCount?(Y("[sourceNode.onended] 还有未调度的buffer,重新调度"),this.scheduleNewChunks()):this.generationComplete?(Y("[sourceNode.onended] 生成完成,结束播放"),this.handlePlaybackEnd()):(Y("[sourceNode.onended] 等待新数据,启动 autoPlayCheck"),this.startAutoPlayCheck()))}}}Y("[scheduleNewChunks] 调度完成",{scheduledCount:`${r} -> ${this.scheduledCount}`,scheduledSourcesLength:this.scheduledSources.length,nextScheduleTime:this.nextScheduleTime.toFixed(3)})}async play(){if(this.playMode==="url"&&this.audioElement){try{await this.audioElement.play()}catch(t){this.onErrorCallback&&this.onErrorCallback(t)}return}if(!this.audioContext){this.onErrorCallback&&this.onErrorCallback(new Error("AudioContext not initialized"));return}if(!this.isPlaying){try{await this.ensureAudioContextRunning(),await this.startIOSAudioElement()}catch(t){this.onErrorCallback&&this.onErrorCallback(t);return}if(this.audioQueue.length===0&&this.pendingChunks.length>0&&await this.decodeFirstChunk(),this.audioQueue.length===0){Y("[play] 没有可播放的音频数据");return}this.isPlaying=!0,this.startedAt=this.audioContext.currentTime-this.pausedAt,this.pausedAt===0&&(this.scheduledCount=0,this.nextScheduleTime=this.audioContext.currentTime),this.pausedAt===0?this.scheduleNewChunks():this.scheduleFromPosition(this.pausedAt),this.decodeAhead(),this.onPlayCallback&&this.onPlayCallback(),this.startTimeUpdate(),Y("[play] 播放开始",{audioContextState:this.audioContext.state,audioQueueLength:this.audioQueue.length,pausedAt:this.pausedAt,isIOS:/iPhone|iPad|iPod/i.test(navigator.userAgent)})}}async decodeFirstChunk(){if(this.pendingChunks.length===0)return;const t=this.pendingChunks.shift();try{const r=window.atob(t),n=new Uint8Array(r.length);for(let a=0;a<r.length;a++)n[a]=r.charCodeAt(a);const i=n.buffer;await this.addAudioChunkInternal(i),this.estimatedDuration>0&&(this.estimatedDuration=Math.max(0,this.estimatedDuration-1))}catch(r){console.error("解码首个 chunk 失败:",r)}}scheduleFromPosition(t){if(!this.audioContext)return;this.isSchedulingFromPosition=!0;let r=0;const n=this.audioContext.currentTime;let i=n,a=0;for(let o=0;o<this.audioQueue.length;o++){const s=this.audioQueue[o],u=r,l=r+s.duration;if(l>t){const c=this.audioContext.createBufferSource();c.buffer=s,c.connect(this.getAudioDestination());let f=0,h=s.duration;t>u&&(f=t-u,h=s.duration-f,i=n),c.start(i,f,h),i+=h,this.scheduledSources.push(c),a++,c.onended=()=>{const d=this.scheduledSources.indexOf(c);if(d===-1){Y("[scheduleFromPosition.onended] sourceNode 被手动停止,跳过后续逻辑");return}this.scheduledSources.splice(d,1),this.playedBufferCount++,this.cleanupOldBuffers(),this.decodeAhead(),this.scheduledSources.length===0&&this.isPlaying&&(this.scheduleNewChunks(),this.scheduledSources.length===0&&(Y("[scheduleFromPosition.onended] 调度后仍无片段",{pendingChunks:this.pendingChunks.length,generationComplete:this.generationComplete,audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,unscheduledBuffers:this.audioQueue.length-this.scheduledCount}),this.pendingChunks.length>0?(Y("[scheduleFromPosition.onended] 还有待解码chunk,启动 autoPlayCheck"),this.startAutoPlayCheck()):this.audioQueue.length>this.scheduledCount?(Y("[scheduleFromPosition.onended] 还有未调度的buffer,重新调度"),this.scheduleNewChunks()):this.generationComplete?(Y("[scheduleFromPosition.onended] 生成完成,结束播放"),this.handlePlaybackEnd()):(Y("[scheduleFromPosition.onended] 等待新数据,启动 autoPlayCheck"),this.startAutoPlayCheck())))}}r=l}this.scheduledCount=this.audioQueue.length,this.nextScheduleTime=i,this.isSchedulingFromPosition=!1,Y("[scheduleFromPosition] 调度完成",{startPosition:t.toFixed(2),scheduledInThisCall:a,scheduledCount:this.scheduledCount,nextScheduleTime:this.nextScheduleTime.toFixed(3),scheduledSourcesLength:this.scheduledSources.length})}pause(){if(this.playMode==="url"&&this.audioElement){this.audioElement.pause();return}if(!(!this.isPlaying||!this.audioContext)){this.pausedAt=this.audioContext.currentTime-this.startedAt;for(const t of this.scheduledSources)try{t.stop()}catch{}if(this.scheduledSources=[],this.iosUnlockAudio)try{this.iosUnlockAudio.pause(),Y("[pause] iOS audio 元素已暂停")}catch{}this.isPlaying=!1,this.onPauseCallback&&this.onPauseCallback(),this.stopTimeUpdate(),this.stopAutoPlayCheck()}}stop(){if(this.playMode==="url"&&this.audioElement){this.audioElement.pause(),this.audioElement.currentTime=0,this.isPlaying=!1;return}this.pause(),this.pausedAt=0,this.startedAt=0,this.scheduledCount=0,this.nextScheduleTime=0,this.stopTimeUpdate(),this.stopAutoPlayCheck()}clear(){this.stop(),this.audioQueue=[],this.pendingChunks=[],this.totalDuration=0,this.estimatedDuration=0,this.scheduledCount=0,this.nextScheduleTime=0,this.processedChunkCount=0,this.generationComplete=!1,this.decodingInProgress=!1,this.isSchedulingFromPosition=!1,this.durationFromUrlSet=!1}handlePlaybackEnd(){let t=0;if(this.audioQueue.forEach(r=>{t+=r.duration}),Y("[handlePlaybackEnd] 播放结束",{totalDuration:this.totalDuration.toFixed(2),actualDecodedDuration:t.toFixed(2),audioQueueLength:this.audioQueue.length,pendingChunks:this.pendingChunks.length,processedChunkCount:this.processedChunkCount,scheduledCount:this.scheduledCount,playedBufferCount:this.playedBufferCount,generationComplete:this.generationComplete,durationFromUrlSet:this.durationFromUrlSet}),this.isPlaying=!1,this.pausedAt=0,this.startedAt=0,this.stopTimeUpdate(),this.stopAutoPlayCheck(),this.iosUnlockAudio)try{this.iosUnlockAudio.pause(),Y("[handlePlaybackEnd] iOS audio 元素已暂停")}catch{}this.onEndCallback&&this.onEndCallback()}async markGenerationComplete(t){let r=0;this.audioQueue.forEach(n=>{r+=n.duration}),Y("[markGenerationComplete] 标记生成完成",{audioQueueLength:this.audioQueue.length,pendingChunks:this.pendingChunks.length,scheduledSourcesLength:this.scheduledSources.length,totalDuration:this.totalDuration.toFixed(2),currentDecodedDuration:r.toFixed(2),estimatedDuration:this.estimatedDuration.toFixed(2),isPlaying:this.isPlaying,hasAudioUrl:!!t,processedChunkCount:this.processedChunkCount}),this.generationComplete=!0,t&&(this.fullAudioUrl=t),this.isPlaying&&this.pendingChunks.length>0&&(Y("[markGenerationComplete] 正在播放,触发按需解码"),this.decodeAhead()),this.autoPlayCheckInterval&&this.scheduledSources.length===0&&this.pendingChunks.length===0&&(Y("[markGenerationComplete] 正在等待且无剩余片段,立即结束"),this.handlePlaybackEnd()),t?this.getDurationFromUrl(t):this.onDurationChangeCallback&&this.onDurationChangeCallback(this.getDisplayDuration())}getDurationFromUrl(t){Y("[getDurationFromUrl] 开始从 URL 获取时长并预加载",{audioUrl:t}),this.preloadedAudioElement=new Audio,this.preloadedAudioElement.preload="auto";const r=this.preloadedAudioElement;let n=!1;const i=()=>{if(n)return;n=!0;const s=r.duration;Y("[getDurationFromUrl] 获取时长成功",{duration:s.toFixed(2)}),this.totalDuration=s,this.estimatedDuration=0,this.durationFromUrlSet=!0,this.onDurationChangeCallback&&this.onDurationChangeCallback(Math.floor(s))},a=()=>{Y("[getDurationFromUrl] URL 预加载完成,可以 seek"),this.urlReady=!0,this.onUrlReadyCallback&&this.onUrlReadyCallback()},o=s=>{Y("[getDurationFromUrl] 获取时长/预加载失败",s),this.urlReady=!0,this.preloadedAudioElement=null,this.onDurationChangeCallback&&!n&&this.onDurationChangeCallback(this.getDisplayDuration()),this.onUrlReadyCallback&&this.onUrlReadyCallback()};r.addEventListener("loadedmetadata",i),r.addEventListener("canplay",a),r.addEventListener("canplaythrough",a),r.addEventListener("error",o),r.src=t,r.load()}async decodeAllPendingChunks(){for(Y("[decodeAllPendingChunks] 开始解码所有待解码 chunk",{pendingChunks:this.pendingChunks.length});this.pendingChunks.length>0;){const t=this.pendingChunks.shift(),r=this.processedChunkCount+1;try{const n=(t.length*.75/1024).toFixed(2);Y(`[decodeAllPendingChunks] 解码第 ${r} 个chunk`,{size:`${n} KB`});const i=window.atob(t),a=new Uint8Array(i.length);for(let s=0;s<i.length;s++)a[s]=i.charCodeAt(s);const o=a.buffer;await this.addAudioChunkInternal(o),this.processedChunkCount++,Y(`[decodeAllPendingChunks] 第 ${r} 个chunk 解码完成`,{totalDuration:this.totalDuration.toFixed(2)})}catch(n){console.error(`[decodeAllPendingChunks] 解码第 ${r} 个chunk 失败:`,n)}}Y("[decodeAllPendingChunks] 所有 chunk 解码完成",{audioQueueLength:this.audioQueue.length,totalDuration:this.totalDuration.toFixed(2)})}cleanupOldBuffers(){const t=this.audioQueue.length;if(Y("[cleanupOldBuffers] 检查",{currentQueueLength:t,maxDecodedBuffers:this.maxDecodedBuffers,playedBufferCount:this.playedBufferCount,scheduledCount:this.scheduledCount,pendingChunks:this.pendingChunks.length,totalDuration:this.totalDuration.toFixed(2)}),t>this.maxDecodedBuffers&&this.playedBufferCount>0){const r=Math.min(t-this.maxDecodedBuffers,this.playedBufferCount);if(r>0){let n=0;for(let o=0;o<r;o++)n+=this.audioQueue[o].duration;const i=this.audioQueue.splice(0,r);this.scheduledCount=Math.max(0,this.scheduledCount-r),this.playedBufferCount=Math.max(0,this.playedBufferCount-r);let a=0;i.forEach(o=>{a+=o.length*o.numberOfChannels*4/1024}),Y("[cleanupOldBuffers] 内存回收",{cleanedCount:r,cleanedDuration:n.toFixed(2),freedMemoryKB:a.toFixed(2),remainingQueueLength:this.audioQueue.length,newScheduledCount:this.scheduledCount,newPlayedBufferCount:this.playedBufferCount,isMobile:this.isMobileDevice()})}}}startAutoPlayCheck(){if(this.autoPlayCheckInterval){Y("[startAutoPlayCheck] 已有检查定时器,跳过");return}Y("[startAutoPlayCheck] 启动等待新数据检查"),this.autoPlayCheckWaitTime=0;const t=180*1e3;this.autoPlayCheckInterval=window.setInterval(()=>{this.autoPlayCheckWaitTime+=200,Y("[autoPlayCheck] 检查",{waitTime:this.autoPlayCheckWaitTime,scheduledCount:this.scheduledCount,audioQueueLength:this.audioQueue.length,pendingChunks:this.pendingChunks.length,generationComplete:this.generationComplete,scheduledSourcesLength:this.scheduledSources.length}),this.scheduledCount<this.audioQueue.length?(Y("[autoPlayCheck] 发现新片段,调度"),this.scheduleNewChunks(),this.scheduledSources.length>0&&(Y("[autoPlayCheck] 调度成功,停止检查"),this.stopAutoPlayCheck())):this.scheduledSources.length>0?(Y("[autoPlayCheck] 还有片段在播放中,停止检查"),this.stopAutoPlayCheck()):this.pendingChunks.length>0?(Y("[autoPlayCheck] 还有待解码chunk,触发解码"),this.decodeAhead()):this.generationComplete?(Y("[autoPlayCheck] 生成完成且无播放片段和待解码chunk,结束播放"),this.handlePlaybackEnd()):this.autoPlayCheckWaitTime>=t&&(Y("[autoPlayCheck] 等待超时,结束播放"),this.handlePlaybackEnd())},200)}stopAutoPlayCheck(){this.autoPlayCheckInterval&&(clearInterval(this.autoPlayCheckInterval),this.autoPlayCheckInterval=null)}startTimeUpdate(){this.timeUpdateInterval||(this.timeUpdateInterval=window.setInterval(()=>{if(this.isPlaying&&this.audioContext){const t=this.audioContext.currentTime-this.startedAt;this.onTimeUpdateCallback&&this.onTimeUpdateCallback(t,this.totalDuration)}},100))}stopTimeUpdate(){this.timeUpdateInterval&&(clearInterval(this.timeUpdateInterval),this.timeUpdateInterval=null)}seek(t){if(Y("[seek] 开始",{time:t,playMode:this.playMode,generationComplete:this.generationComplete,urlReady:this.urlReady,hasPreloadedAudio:!!this.preloadedAudioElement,isPlaying:this.isPlaying}),this.playMode==="url"&&this.audioElement){this.audioElement.currentTime=Math.max(0,Math.min(t,this.audioElement.duration||0));return}if(this.playMode==="stream"){if(this.generationComplete&&this.urlReady&&this.preloadedAudioElement){Y("[seek] 切换到 URL 模式(使用预加载的 audio 元素)");const n=this.isPlaying;this.stopTimeUpdate();for(const i of this.scheduledSources)try{i.stop()}catch{}this.scheduledSources=[],this.isPlaying=!1,this.audioElement=this.preloadedAudioElement,this.preloadedAudioElement=null,this.playMode="url",this.bindAudioElementEvents(),this.audioElement.currentTime=Math.max(0,Math.min(t,this.audioElement.duration||0)),n&&this.audioElement.play().catch(i=>{Y("[seek] 播放失败:",i)});return}const r=this.isPlaying;r&&this.pause(),this.pausedAt=Math.max(0,Math.min(t,this.totalDuration)),r&&this.play()}}bindAudioElementEvents(){this.audioElement&&(this.audioElement.addEventListener("play",()=>{this.isPlaying=!0,this.onPlayCallback&&this.onPlayCallback()}),this.audioElement.addEventListener("pause",()=>{this.isPlaying=!1,this.onPauseCallback&&this.onPauseCallback()}),this.audioElement.addEventListener("ended",()=>{this.isPlaying=!1,this.onEndCallback&&this.onEndCallback()}),this.audioElement.addEventListener("timeupdate",()=>{this.onTimeUpdateCallback&&this.onTimeUpdateCallback(this.audioElement.currentTime,this.audioElement.duration||0)}),this.audioElement.addEventListener("error",t=>{this.onErrorCallback&&this.onErrorCallback(new Error("音频加载失败: "+(t.message||"未知错误")))}))}getPlayState(){return this.isPlaying}getDuration(){return this.playMode==="url"&&this.audioElement?this.audioElement.duration||0:this.getDisplayDuration()}getCurrentTime(){return this.playMode==="url"&&this.audioElement?this.audioElement.currentTime||0:this.isPlaying&&this.audioContext?this.audioContext.currentTime-this.startedAt:this.pausedAt}getAudioQueue(){return[...this.audioQueue]}async getAudioData(){const t=[];for(const r of this.audioQueue){const n=r.numberOfChannels,i=r.length,a=new ArrayBuffer(i*n*2),o=new DataView(a);for(let s=0;s<n;s++){const u=r.getChannelData(s);for(let l=0;l<i;l++){const c=Math.max(-1,Math.min(1,u[l])),f=c<0?c*32768:c*32767;o.setInt16((l*n+s)*2,f,!0)}}t.push(a)}return t}onPlay(t){this.onPlayCallback=t}onPause(t){this.onPauseCallback=t}onEnd(t){this.onEndCallback=t}onError(t){this.onErrorCallback=t}onTimeUpdate(t){this.onTimeUpdateCallback=t}onDurationChange(t){this.onDurationChangeCallback=t}onUrlReady(t){this.onUrlReadyCallback=t}isUrlReady(){return this.urlReady}destroy(){this.stop(),this.stopTimeUpdate(),this.stopAutoPlayCheck(),this.handleVisibilityChange&&(document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.handleVisibilityChange=null),this.audioContext&&(this.audioContext.onstatechange=null,this.audioContext.close(),this.audioContext=null),this.audioQueue=[],this.iosUnlockAudio&&(this.iosUnlockAudio.pause(),this.iosUnlockAudio.srcObject=null,this.iosUnlockAudio=null),this.mediaStreamDestination=null,this.audioElement&&(this.audioElement.pause(),this.audioElement.src="",this.audioElement=null),this.playMode=null}},of="https://cdn.xiaowei.qq.com/adp/assets/static/iconfont-XzKaDZdEa7j2GPL-1201.js",zu={};function sO(e){const t={};return e.props.size&&(t.width=`${e.props.size}px`,t.height=`${e.props.size}px`),e.props.valign&&(t.verticalAlign=`${e.props.valign}px`),e.props.rotate&&(t.transform=`rotate(${e.props.rotate}deg)`),t}function uO(e){const t=e.props;return{"v-icon":!0,"is-horizontal":t.flip==="horizontal","is-vertical":t.flip==="vertical","v-icon--stroke":t.useStroke,"v-icon--fill":!t.useStroke}}function Wb(e){let t=document.createElement("script");t.type="text/javascript",t.src=e,document.getElementsByTagName("head")[0].appendChild(t)}const lO=e=>{let t=!1,r=Object.keys(zu);r.forEach(n=>{zu[n]===e&&(t=!0)}),t||(zu[r.length]=e,Wb(e))},cO={name:"VIcon",functional:!0,props:{name:{type:String,required:!0},remote:{type:Boolean,default:!1},remoteSrc:{type:String,default:""},remotePrefix:{type:String,default:"v-"},loadDefaultRemoteIcons:{type:Boolean,default:!0},label:String,rotate:[Number,String],size:[Number,String],valign:[Number,String],flip:String,useStroke:Boolean,clazz:String,scoped:String},render(e,t){const r=sO(t);if(t.data.style)for(let n in t.data.style)r[n]=t.data.style[n];return!zu.defaultRemoteSrc&&of&&t.props.loadDefaultRemoteIcons&&(zu.defaultRemoteSrc=of,Wb(of)),t.props.remoteSrc&&lO(t.props.remoteSrc),e("svg",{class:uO(t),style:r,attrs:{role:t.props.label?"img":"presentation","aria-label":t.props.label},on:t.data.nativeOn},[e("use",{attrs:{"xlink:href":"#"+t.props.remotePrefix+t.props.name,class:t.props.clazz},style:{pointerEvents:"none"}})])}},fO=cO,hO=null,dO=null;var pO=pr(fO,hO,dO,!1,null,null,null,null);const t2=pO.exports;const vO={name:"StreamAudioPlayer",components:{VIcon:t2},props:{audioData:{type:Object,required:!0}},data(){return{player:null,internalStatus:"pending",currentTime:0,duration:0,isDragging:!1,isHoveringProgress:!1,lastProcessedChunkCount:0,playModeDecided:!1,lastKnownIsComplete:!1,urlReady:!1,dragCleanup:null}},computed:{isGenerating(){return!this.audioData.isComplete},hasPlayableContent(){const e=!!this.audioData.audio_url,t=this.audioData.audio_data&&this.audioData.audio_data.length>0;return e||t},isDisabled(){return!this.hasPlayableContent},canSeek(){return!this.isGenerating&&this.urlReady},displayFileName(){return this.audioData.title?this.audioData.title:this.isGenerating?"音频生成中...":"音频文件"},statusText(){if(this.isDisabled)return"暂无音频";if(this.isGenerating&&this.duration===0)return"生成中...";const e=this.formatTime(this.currentTime),t=this.isGenerating?"生成中":this.formatTime(this.duration);return`${e} / ${t}`},statusClass(){return{generating:this.isGenerating,completed:this.internalStatus==="completed",playing:this.internalStatus==="playing",paused:this.internalStatus==="paused",disabled:this.isDisabled}},cardClass(){return{generating:this.isGenerating,completed:this.internalStatus==="completed",playing:this.internalStatus==="playing",paused:this.internalStatus==="paused",disabled:this.isDisabled,hoverable:!this.isDisabled&&!this.isGenerating}},progressPercentage(){return this.duration===0?0:this.currentTime/this.duration*100},showHandle(){return(this.isHoveringProgress||this.isDragging)&&!this.isDisabled&&!this.isGenerating},canPlay(){return!(this.isDisabled||this.isGenerating&&this.duration===0)},canDownload(){return!!this.audioData.audio_url},playButtonTitle(){return this.isDisabled?"暂无音频":this.isGenerating&&this.duration===0?"等待音频生成":this.internalStatus==="playing"?"暂停":"播放"},downloadButtonTitle(){return this.canDownload?"下载":this.isGenerating?"生成中,暂不可下载":"暂无可下载的音频"}},watch:{audioData:{handler(e){var r;if(!e||!this.player)return;console.log("[StreamAudioPlayer] audioData watch 触发:",{hasAudioUrl:!!e.audio_url,audioDataLength:(r=e.audio_data)==null?void 0:r.length,isComplete:e.isComplete,playModeDecided:this.playModeDecided,lastProcessedChunkCount:this.lastProcessedChunkCount,lastKnownIsComplete:this.lastKnownIsComplete,internalStatus:this.internalStatus}),!this.playModeDecided&&e.audio_url&&(console.log("[StreamAudioPlayer] 切换到 URL 模式"),this.handleAudioUrlChange(e.audio_url)),e.audio_data&&Array.isArray(e.audio_data)&&e.audio_data.length>this.lastProcessedChunkCount&&(!this.playModeDecided||this.player.playMode==="stream")&&(console.log("[StreamAudioPlayer] 处理新的音频片段"),this.handleAudioDataChange(e.audio_data)),!!e.isComplete&&!this.lastKnownIsComplete&&(this.lastKnownIsComplete=!0,this.handleGenerationComplete())},deep:!0,immediate:!1}},mounted(){this.initPlayer(),this.audioData&&(this.audioData.audio_data&&this.audioData.audio_data.length>0?this.handleAudioDataChange(this.audioData.audio_data):this.audioData.audio_url&&this.handleAudioUrlChange(this.audioData.audio_url),this.audioData.isComplete&&(this.lastKnownIsComplete=!0,this.handleGenerationComplete()))},beforeDestroy(){this.destroyPlayer()},beforeUnmount(){this.destroyPlayer()},methods:{initPlayer(){this.player=new Ub,this.player.onPlay(()=>{this.internalStatus="playing",this.$emit("play",this.audioData)}),this.player.onPause(()=>{this.internalStatus="paused",this.$emit("pause",this.audioData)}),this.player.onEnd(()=>{this.player.playMode==="url"?this.internalStatus="completed":this.isGenerating?this.internalStatus="paused":this.internalStatus="completed",this.currentTime=0,this.$emit("end",this.audioData)}),this.player.onTimeUpdate((e,t)=>{this.isDragging||(this.currentTime=e),this.duration=t,e>=t&&t>0&&!this.isGenerating&&(this.player.pause(),this.internalStatus="completed",this.currentTime=t)}),this.player.onDurationChange(e=>{this.duration=e}),this.player.onError(e=>{console.error("音频播放错误:",e),this.$emit("error",e)}),this.player.onUrlReady(()=>{console.log("[StreamAudioPlayer.vue] URL 预加载完成回调"),this.urlReady=!0}),this.checkInitialState()},checkInitialState(){this.isDisabled?this.internalStatus="disabled":this.isGenerating?this.internalStatus="generating":this.internalStatus="completed"},handleAudioUrlChange(e){!this.player||!e||this.playModeDecided&&this.player.playMode!=="url"||(this.player.setAudioUrl(e),this.playModeDecided=!0,this.internalStatus="completed")},handleAudioDataChange(e){var r,n,i,a,o;if(!this.player||!e)return;this.playModeDecided=!0;const t=e.length-this.lastProcessedChunkCount;if(console.log("[StreamAudioPlayer.vue] handleAudioDataChange",{totalChunks:e.length,lastProcessedChunkCount:this.lastProcessedChunkCount,newChunksCount:t,playerPendingChunks:(r=this.player.pendingChunks)==null?void 0:r.length,playerAudioQueueLength:(n=this.player.audioQueue)==null?void 0:n.length,playerScheduledCount:this.player.scheduledCount,playerIsPlaying:this.player.isPlaying,internalStatus:this.internalStatus}),t<=0){console.log("[StreamAudioPlayer.vue] 没有新片段,跳过");return}(this.internalStatus==="disabled"||this.internalStatus==="pending")&&(this.internalStatus="generating");for(let s=this.lastProcessedChunkCount;s<e.length;s++){const u=e[s];console.log(`[StreamAudioPlayer.vue] 添加第 ${s+1} 个chunk,大小: ${(u.length*.75/1024).toFixed(2)} KB`),this.player.addBase64Chunk(u),this.lastProcessedChunkCount++,this.$emit("chunk-added",{duration:this.duration,queueLength:((i=this.player.pendingChunks)==null?void 0:i.length)||0})}console.log("[StreamAudioPlayer.vue] handleAudioDataChange 完成",{lastProcessedChunkCount:this.lastProcessedChunkCount,playerPendingChunks:(a=this.player.pendingChunks)==null?void 0:a.length,playerAudioQueueLength:(o=this.player.audioQueue)==null?void 0:o.length})},handleGenerationComplete(){var e,t,r,n,i,a,o;console.log("[StreamAudioPlayer.vue] handleGenerationComplete",{playerAudioQueueLength:(t=(e=this.player)==null?void 0:e.audioQueue)==null?void 0:t.length,playerPendingChunks:(n=(r=this.player)==null?void 0:r.pendingChunks)==null?void 0:n.length,playerTotalDuration:(a=(i=this.player)==null?void 0:i.totalDuration)==null?void 0:a.toFixed(2),playerScheduledCount:(o=this.player)==null?void 0:o.scheduledCount,internalStatus:this.internalStatus,hasAudioUrl:!!this.audioData.audio_url}),this.player&&this.player.markGenerationComplete(this.audioData.audio_url),this.player&&(this.duration=this.player.getDuration(),console.log("[StreamAudioPlayer.vue] 最终时长:",this.duration.toFixed(2))),this.internalStatus!=="playing"&&(this.internalStatus="completed"),this.audioData.audio_url||(this.urlReady=!0)},async addAudioChunk(e){var t;if(!this.player){console.warn("播放器未初始化");return}try{typeof e=="string"?await this.player.addBase64Chunk(e):await this.player.addAudioChunk(e),this.$emit("chunk-added",{duration:this.duration,queueLength:((t=this.player.audioQueue)==null?void 0:t.length)||0})}catch(r){console.error("添加音频片段失败:",r),this.$emit("error",r)}},markGenerationComplete(){this.handleGenerationComplete()},async handlePlayPause(){if(!(!this.player||!this.canPlay))try{this.internalStatus==="playing"?this.player.pause():(this.currentTime>=this.duration&&this.duration>0&&(this.currentTime=0,this.player.pausedAt=0),await this.player.play())}catch(e){console.error("播放控制错误:",e)}},handleDownload(){if(!this.canDownload)return;const e=this.audioData.audio_url,t=this.audioData.title||"音频文件",r=document.createElement("a");r.href=e,r.download=t,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),this.$emit("audio-download",{url:e,fileName:t})},formatTime(e){if(!e||isNaN(e))return"00:00";const t=Math.floor(e/60),r=Math.floor(e%60);return`${t.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`},handleMouseEnter(){},handleMouseLeave(){},handleProgressMouseEnter(){!this.isDisabled&&!this.isGenerating&&(this.isHoveringProgress=!0)},handleProgressMouseLeave(){this.isDragging||(this.isHoveringProgress=!1)},handleProgressMouseDown(e){this.isDisabled||!this.canSeek||this.seekToPosition(e)},handleDragStart(e){if(this.isDisabled||!this.canSeek)return;this.isDragging=!0,e.preventDefault();const t=n=>{this.seekToPosition(n)},r=()=>{this.isDragging=!1,this.isHoveringProgress||(this.isHoveringProgress=!1),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r),this.dragCleanup=null};this.dragCleanup=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r)},document.addEventListener("mousemove",t),document.addEventListener("mouseup",r)},seekToPosition(e){if(!this.player||!this.$refs.progressTrack)return;const r=this.$refs.progressTrack.getBoundingClientRect(),n=e.clientX-r.left,a=Math.max(0,Math.min(1,n/r.width))*this.duration;this.currentTime=a,this.player.seek(a)},destroyPlayer(){this.dragCleanup&&(this.dragCleanup(),this.dragCleanup=null),this.player&&(this.player.destroy(),this.player=null),this.internalStatus="pending",this.currentTime=0,this.duration=0,this.lastProcessedChunkCount=0,this.playModeDecided=!1,this.urlReady=!1,this.lastKnownIsComplete=!1}}};var gO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"stream-audio-player-card",class:t.cardClass,on:{mouseenter:t.handleMouseEnter,mouseleave:t.handleMouseLeave}},[r("div",{staticClass:"audio-content"},[r("div",{staticClass:"audio-icon"},[r("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"34",viewBox:"0 0 30 34",fill:"none"}},[r("path",{staticStyle:{fill:"color(display-p3 0.9569 0.9333 0.9882)","fill-opacity":"1"},attrs:{d:"M1.55782e-06 5.33333C1.66168e-06 3.46649 1.71361e-06 2.53307 0.363313 1.82003C0.682891 1.19282 1.19283 0.682889 1.82003 0.363312C2.53307 1.40931e-07 3.46649 1.92863e-07 5.33334 2.96727e-07L21.1242 1.17527e-06C21.9395 1.22063e-06 22.3472 1.24331e-06 22.7308 0.0921015C23.0709 0.173757 23.396 0.308438 23.6943 0.491201C24.0307 0.69734 24.3189 0.985593 24.8954 1.5621L28.4379 5.10457C29.0144 5.68108 29.3027 5.96933 29.5088 6.30572C29.6916 6.60396 29.8262 6.92911 29.9079 7.26923C30 7.65285 30 8.0605 30 8.87581L30 28C30 29.8668 30 30.8003 29.6367 31.5133C29.3171 32.1405 28.8072 32.6504 28.18 32.97C27.4669 33.3333 26.5335 33.3333 24.6667 33.3333L5.33333 33.3333C3.46649 33.3333 2.53307 33.3333 1.82003 32.97C1.19282 32.6504 0.68289 32.1405 0.363312 31.5133C1.40931e-07 30.8003 1.92863e-07 29.8668 2.96727e-07 28L1.55782e-06 5.33333Z",fill:"#F4EEFC"}}),r("path",{staticStyle:{fill:"color(display-p3 0.8863 0.8353 0.9725)","fill-opacity":"1"},attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M29.1667 28L29.1667 8.87581C29.1667 8.02084 29.1613 7.72918 29.0976 7.46377C29.0364 7.20868 28.9353 6.96481 28.7983 6.74113C28.6557 6.5084 28.4532 6.29838 27.8487 5.69383L24.3062 2.15135C23.7016 1.5468 23.4916 1.34435 23.2589 1.20173C23.0352 1.06466 22.7913 0.963651 22.5362 0.90241C22.2708 0.83869 21.9792 0.833334 21.1242 0.833334L5.33334 0.833333C4.38616 0.833333 3.7259 0.833981 3.21187 0.87598C2.70756 0.917183 2.41782 0.993995 2.19836 1.10582C1.72795 1.3455 1.3455 1.72795 1.10582 2.19836C0.993997 2.41782 0.917185 2.70756 0.875981 3.21187C0.833983 3.7259 0.833335 4.38616 0.833335 5.33333L0.833334 28C0.833334 28.9472 0.833982 29.6074 0.87598 30.1215C0.917183 30.6258 0.993995 30.9155 1.10582 31.135C1.3455 31.6054 1.72795 31.9878 2.19836 32.2275C2.41782 32.3393 2.70756 32.4161 3.21187 32.4573C3.7259 32.4993 4.38616 32.5 5.33333 32.5L24.6667 32.5C25.6138 32.5 26.2741 32.4993 26.7881 32.4573C27.2924 32.4161 27.5822 32.3393 27.8016 32.2275C28.2721 31.9878 28.6545 31.6054 28.8942 31.135C29.006 30.9155 29.0828 30.6258 29.124 30.1215C29.166 29.6074 29.1667 28.9472 29.1667 28ZM0.363313 1.82003C1.71361e-06 2.53307 1.66168e-06 3.46649 1.55782e-06 5.33333L2.96727e-07 28C1.92863e-07 29.8668 1.40931e-07 30.8003 0.363312 31.5133C0.68289 32.1405 1.19282 32.6504 1.82003 32.97C2.53307 33.3333 3.46649 33.3333 5.33333 33.3333L24.6667 33.3333C26.5335 33.3333 27.4669 33.3333 28.18 32.97C28.8072 32.6504 29.3171 32.1405 29.6367 31.5133C30 30.8003 30 29.8668 30 28L30 8.87581C30 8.0605 30 7.65285 29.9079 7.26923C29.8262 6.92911 29.6916 6.60396 29.5088 6.30572C29.3027 5.96933 29.0144 5.68108 28.4379 5.10457L24.8954 1.5621C24.3189 0.985593 24.0307 0.69734 23.6943 0.491201C23.396 0.308438 23.0709 0.173757 22.7308 0.0921015C22.3472 1.24331e-06 21.9395 1.22063e-06 21.1242 1.17527e-06L5.33334 2.96727e-07C3.46649 1.92863e-07 2.53307 1.40931e-07 1.82003 0.363312C1.19283 0.682889 0.682891 1.19282 0.363313 1.82003Z",fill:"#E2D5F8"}}),r("path",{staticStyle:{fill:"color(display-p3 0.4157 0.2706 0.8980)","fill-opacity":"1"},attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M22.1277 22.689L22.129 8.92249L10.0345 10.5529L10.0335 22.0895C9.69971 21.9846 9.34054 21.9276 8.96638 21.9276C7.19825 21.9276 5.76489 23.2017 5.76489 24.7734C5.76489 26.345 7.19825 27.6191 8.96638 27.6191C10.7157 27.6191 12.1374 26.3719 12.1674 24.8233L12.1676 24.8233L12.1676 24.8123L12.1679 24.7734L12.1676 24.7347L12.168 13.7622L19.9939 12.5435L19.9935 19.9543C19.6596 19.8493 19.3001 19.7922 18.9257 19.7922C17.1576 19.7922 15.7242 21.0663 15.7242 22.6379C15.7242 24.2096 17.1576 25.4837 18.9257 25.4837C20.6746 25.4837 22.096 24.2371 22.1267 22.689L22.1277 22.689Z",fill:"#6A45E5"}})])]),r("div",{staticClass:"file-info"},[r("div",{staticClass:"file-name",attrs:{title:t.displayFileName}},[t._v(t._s(t.displayFileName))]),r("div",{staticClass:"file-status"},[r("span",{staticClass:"status-text",class:t.statusClass},[t._v(" "+t._s(t.statusText)+" ")])])]),r("div",{staticClass:"audio-controls"},[r("button",{staticClass:"control-btn download-btn",attrs:{disabled:!t.canDownload,title:t.downloadButtonTitle},on:{click:t.handleDownload}},[r("v-icon",{attrs:{name:"basic_download2_line",size:18}})],1),r("button",{staticClass:"control-btn play-btn",attrs:{disabled:!t.canPlay,title:t.playButtonTitle},on:{click:t.handlePlayPause}},[t.internalStatus==="playing"?r("v-icon",{attrs:{name:"basic_pause_line",size:18}}):r("v-icon",{attrs:{name:"basic_play_line",size:18}})],1)])]),r("div",{staticClass:"progress-container"},[r("div",{ref:"progressTrack",staticClass:"progress-track",on:{mousedown:t.handleProgressMouseDown,mouseenter:t.handleProgressMouseEnter,mouseleave:t.handleProgressMouseLeave}},[t.isGenerating?t._e():r("div",{staticClass:"progress-played",class:{"no-transition":t.isDragging},style:{width:t.progressPercentage+"%"}}),t.showHandle?r("div",{staticClass:"progress-handle",class:{"no-transition":t.isDragging},style:{left:t.progressPercentage+"%"},on:{mousedown:function(n){return n.stopPropagation(),t.handleDragStart.apply(null,arguments)}}}):t._e()])])])},mO=[],yO=pr(vO,gO,mO,!1,null,"c74077bd",null,null);const qb=yO.exports;const _O={name:"ClassifyTag",props:{title:{type:String,default:"问题澄清"},questions:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},data(){return{collapsed:!1,selectedAnswers:{},submitted:!1}},computed:{normalizedQuestions(){return!this.questions||!this.questions.length?[]:this.questions.map((e,t)=>({id:e.id||t,text:e.text||e.question||"",options:(e.options||[]).map(r=>typeof r=="string"?{label:r,description:""}:{label:r.label||r.Label||"",description:r.description||r.Description||""})}))},allAnswered(){return!this.normalizedQuestions||this.normalizedQuestions.length===0?!1:this.normalizedQuestions.every(e=>{const t=e.id;return this.selectedAnswers[t]!==void 0})}},methods:{toggleCollapse(){this.collapsed=!this.collapsed},selectOption(e,t){this.submitted||this.disabled||this.$set(this.selectedAnswers,e,t)},handleSubmit(){if(!this.allAnswered||this.submitted)return;this.submitted=!0;const e=this.normalizedQuestions.map(t=>{const r=this.selectedAnswers[t.id],n=t.options[r];return{questionId:String(t.id),questionText:t.text,selectedOption:n?n.label:"",selectedIndex:r}});this.$emit("submit",e)},handleSkip(){this.submitted||this.$emit("skip")}}};var bO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"classify-tag",class:{"classify-tag--collapsed":t.collapsed}},[r("div",{staticClass:"classify-tag__header",on:{click:t.toggleCollapse}},[r("svg",{staticClass:"classify-tag__icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15C11.866 15 8 15 8 15",stroke:"#4A70FF","stroke-width":"1.5","stroke-linecap":"round",fill:"none"}}),r("path",{attrs:{d:"M8 5V8.5",stroke:"#4A70FF","stroke-width":"1.5","stroke-linecap":"round"}}),r("circle",{attrs:{cx:"8",cy:"11",r:"0.75",fill:"#4A70FF"}}),r("path",{attrs:{d:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1Z",stroke:"#4A70FF","stroke-width":"1.5",fill:"none"}})]),r("span",{staticClass:"classify-tag__title"},[t._v(t._s(t.title))]),r("svg",{staticClass:"classify-tag__arrow",class:{"classify-tag__arrow--up":!t.collapsed},attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M4 6L8 10L12 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.collapsed,expression:"!collapsed"}],staticClass:"classify-tag__content"},t._l(t.normalizedQuestions,function(n,i){return r("div",{key:n.id||i,staticClass:"classify-tag__question-group"},[r("div",{staticClass:"classify-tag__question-text"},[t._v(" "+t._s(i+1)+"、"+t._s(n.text)+" ")]),r("div",{staticClass:"classify-tag__options"},t._l(n.options,function(a,o){return r("label",{key:o,staticClass:"classify-tag__radio",class:{"classify-tag__radio--checked":t.selectedAnswers[n.id||i]===o,"classify-tag__radio--rich":a.description},on:{click:function(s){return t.selectOption(n.id||i,o)}}},[r("span",{staticClass:"classify-tag__radio-circle"},[t.selectedAnswers[n.id||i]===o?r("span",{staticClass:"classify-tag__radio-dot"}):t._e()]),r("span",{staticClass:"classify-tag__radio-content"},[r("span",{staticClass:"classify-tag__radio-label"},[t._v(t._s(a.label))]),a.description?r("span",{staticClass:"classify-tag__radio-desc"},[t._v(t._s(a.description))]):t._e()])])}),0)])}),0),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.collapsed,expression:"!collapsed"}],staticClass:"classify-tag__footer"},[r("div",{staticClass:"classify-tag__footer-divider"}),r("div",{staticClass:"classify-tag__footer-actions"},[r("button",{staticClass:"classify-tag__btn classify-tag__btn--primary",attrs:{disabled:!t.allAnswered||t.submitted},on:{click:t.handleSubmit}},[t._v(" "+t._s(t.submitted?"已提交":"提交")+" ")]),t.submitted?t._e():r("button",{staticClass:"classify-tag__btn classify-tag__btn--secondary",on:{click:t.handleSkip}},[t._v(" 跳过 ")])])])])},xO=[],wO=pr(_O,bO,xO,!1,null,"7964546a",null,null);const r2=wO.exports;const SO={name:"PlanConfirm",props:{title:{type:String,default:"计划确认"},planText:{type:String,default:""},disabled:{type:Boolean,default:!1}},data(){return{collapsed:!1,confirmed:!1,skipped:!1}},methods:{toggleCollapse(){this.collapsed=!this.collapsed},handleConfirm(){this.confirmed||this.skipped||this.disabled||(this.confirmed=!0,this.$emit("confirm",this.planText))},handleSkip(){this.confirmed||this.skipped||this.disabled||(this.skipped=!0,this.$emit("skip",this.planText))}}};var CO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"plan-confirm",class:{"plan-confirm--collapsed":t.collapsed}},[r("div",{staticClass:"plan-confirm__header",on:{click:t.toggleCollapse}},[r("svg",{staticClass:"plan-confirm__icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M13.5 5.5L6.5 12.5L2.5 8.5",stroke:"#4A70FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}),r("rect",{attrs:{x:"1",y:"1",width:"14",height:"14",rx:"2",stroke:"#4A70FF","stroke-width":"1.5",fill:"none"}})]),r("span",{staticClass:"plan-confirm__title"},[t._v(t._s(t.title))]),r("svg",{staticClass:"plan-confirm__arrow",class:{"plan-confirm__arrow--up":!t.collapsed},attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M4 6L8 10L12 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.collapsed,expression:"!collapsed"}],staticClass:"plan-confirm__content"},[r("div",{staticClass:"plan-confirm__text"},[t._v(t._s(t.planText))])]),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.collapsed,expression:"!collapsed"}],staticClass:"plan-confirm__footer"},[r("div",{staticClass:"plan-confirm__footer-divider"}),r("div",{staticClass:"plan-confirm__footer-actions"},[!t.confirmed&&!t.skipped?r("button",{staticClass:"plan-confirm__btn plan-confirm__btn--primary",on:{click:t.handleConfirm}},[t._v(" 确定 ")]):t._e(),t.confirmed?r("button",{staticClass:"plan-confirm__btn plan-confirm__btn--primary",attrs:{disabled:""}},[t._v(" 已确定 ")]):t._e(),!t.confirmed&&!t.skipped?r("button",{staticClass:"plan-confirm__btn plan-confirm__btn--secondary",on:{click:t.handleSkip}},[t._v(" 跳过 ")]):t._e(),t.skipped?r("button",{staticClass:"plan-confirm__btn plan-confirm__btn--secondary",attrs:{disabled:""}},[t._v(" 已跳过 ")]):t._e()])])])},AO=[],TO=pr(SO,CO,AO,!1,null,"99c3033c",null,null);const DO=TO.exports;let v1;const EO=new Uint8Array(16);function kO(){if(!v1&&(v1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!v1))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return v1(EO)}const St=[];for(let e=0;e<256;++e)St.push((e+256).toString(16).slice(1));function MO(e,t=0){return St[e[t+0]]+St[e[t+1]]+St[e[t+2]]+St[e[t+3]]+"-"+St[e[t+4]]+St[e[t+5]]+"-"+St[e[t+6]]+St[e[t+7]]+"-"+St[e[t+8]]+St[e[t+9]]+"-"+St[e[t+10]]+St[e[t+11]]+St[e[t+12]]+St[e[t+13]]+St[e[t+14]]+St[e[t+15]]}const LO=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),iv={randomUUID:LO};function Zb(e,t,r){if(iv.randomUUID&&!t&&!e)return iv.randomUUID();e=e||{};const n=e.random||(e.rng||kO)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return MO(n)}const IO=["Basic","Card","ListView","ListViewItem","Badge","Box","Row","Col","Button","Caption","Chart","Checkbox","DatePicker","Divider","Form","Icon","Image","Input","Label","Markdown","RadioGroup","Select","Spacer","Text","Textarea","Title","Transition","Video","Audio","Countdown","Clickable","ImageSelect"];class PO{constructor(){this.worker=null,this.callbacks=new Map,this.initializing=!1,this.initPromise=null,this.blobUrl=null}async init(){return this.worker?Promise.resolve():this.initializing&&this.initPromise?this.initPromise:(this.initializing=!0,this.initPromise=new Promise((t,r)=>{try{const n=window.tsxToJsonWorkerSrc||"https://cdn.xiaowei.qq.com/adp/assets/static/tsxToJSON.worker.js",i=new Blob([`importScripts('${n}')`],{type:"application/javascript"});this.blobUrl=URL.createObjectURL(i),this.worker=new Worker(this.blobUrl),this.worker.onmessage=a=>{const{ok:o,out:s,error:u,nonce:l}=a.data,c=this.callbacks.get(l);c&&(this.callbacks.delete(l),o?c.resolve(s):c.reject(new Error(u||"Worker Parse error")))},this.worker.onerror=a=>{console.error("tsxToJSON Worker 错误:",a)},this.initializing=!1,t()}catch(n){this.initializing=!1,console.error("初始化 tsxToJSON Worker 失败:",n),r(n)}}),this.initPromise)}destroy(){this.worker&&(this.worker.terminate(),this.worker=null),this.blobUrl&&(URL.revokeObjectURL(this.blobUrl),this.blobUrl=null),this.callbacks.forEach(t=>{t.reject(new Error("Worker destroy"))}),this.callbacks.clear(),this.initializing=!1,this.initPromise=null}async parse({view:t,state:r,keyMap:n,componentNames:i=IO}){return await this.init(),new Promise((a,o)=>{if(!this.worker){o(new Error("Worker not init"));return}const s=Zb();this.callbacks.set(s,{resolve:a,reject:o}),this.worker.postMessage({type:"parse",view:t,state:r||{},keyMap:n,componentNames:i||[],nonce:s})})}isInitialized(){return!!this.worker}}let g1=null;async function Vh(){return g1||(g1=new PO),await g1.init(),g1}class RO{constructor(){this.worker=null,this.callbacks=new Map,this.initializing=!1,this.initPromise=null,this.blobUrl=null}async init(){return this.worker?Promise.resolve():this.initializing&&this.initPromise?this.initPromise:(this.initializing=!0,this.initPromise=new Promise((t,r)=>{try{const n=window.schemaWorkerSrc||"https://cdn.xiaowei.qq.com/adp/assets/static/schemaWorker.js",i=new Blob([`importScripts('${n}')`],{type:"application/javascript"});this.blobUrl=URL.createObjectURL(i),this.worker=new Worker(this.blobUrl),this.worker.onmessage=a=>{const{ok:o,keyMap:s,jsonSchema:u,error:l,nonce:c}=a.data,f=this.callbacks.get(c);f&&(this.callbacks.delete(c),o?f.resolve({keyMap:s,jsonSchema:u}):f.reject(new Error(l||"Worker parse failed")))},this.worker.onerror=a=>{console.error("zodSchema Worker 错误:",a)},this.initializing=!1,t()}catch(n){this.initializing=!1,console.error("初始化 zodSchema Worker 失败:",n),r(n)}}),this.initPromise)}destroy(){this.worker&&(this.worker.terminate(),this.worker=null),this.blobUrl&&(URL.revokeObjectURL(this.blobUrl),this.blobUrl=null),this.callbacks.forEach(t=>{t.reject(new Error("Worker destroyed"))}),this.callbacks.clear(),this.initializing=!1,this.initPromise=null}async zodToJsonSchema({src:t,includeJSONSchema:r=!0}){return await this.init(),new Promise((n,i)=>{if(!this.worker){i(new Error("Worker not init"));return}const a=Zb();this.callbacks.set(a,{resolve:n,reject:i}),this.worker.postMessage({type:"parse",src:t,includeJSONSchema:r,nonce:a})})}async zodToJsonSchemaAsync(t){return await this.zodToJsonSchema({src:t,includeJSONSchema:!0})}isInitialized(){return!!this.worker}}let m1=null;async function Yb(){return m1||(m1=new RO),await m1.init(),m1}async function Y0(e){const r=await(await Yb()).zodToJsonSchemaAsync(e);return{keyMap:r.keyMap,jsonSchema:JSON.stringify(r.jsonSchema,null,2)}}function NO(e,t){let r;try{r=JSON.parse(e)}catch(i){return console.warn(`unmarshal view failed, err: ${i}`),e}let n;try{n=JSON.parse(t)}catch(i){return console.warn(`unmarshal payload failed, err: ${i}`),e}$h(r,n);try{return JSON.stringify(r)}catch(i){return console.warn(`marshal view failed, err: ${i}`),e}}function $h(e,t){if(Array.isArray(e))for(let r=0;r<e.length;r++)$h(e[r],t);else if(e!==null&&typeof e=="object"){const r=e.name;if(typeof r=="string"){const n=typeof e.type=="string"?e.type:"unknown",i=OO(r,t);if(i.exists){const a=i.value;switch(n){case"DatePicker":e.defaultValue=a;break;case"Select":e.defaultValue=a;break;case"Checkbox":e.defaultChecked=a;break;case"RadioGroup":e.defaultValue=a;break;case"Input":e.defaultValue=a;break;case"Textarea":e.defaultValue=a;break;default:e.defaultValue=a}}}if(Array.isArray(e.children))for(let n=0;n<e.children.length;n++)$h(e.children[n],t)}}function OO(e,t){const r=e.split(".");let n=t;for(const i of r){if(n===null||typeof n!="object"||Array.isArray(n))return{value:null,exists:!1};if(!(i in n))return{value:null,exists:!1};n=n[i]}return typeof n=="string"||typeof n=="number"||typeof n=="boolean"?{value:n,exists:!0}:{value:String(n),exists:!0}}class n2{constructor(){this.initPromise=null,this.initialized=!1,this._preload()}_preload(){return this.initPromise?this.initPromise:(this.initPromise=Promise.all([Vh(),Yb()]).then(()=>{this.initialized=!0,console.log("WidgetHelper: Workers 预加载完成")}).catch(t=>{console.warn("WidgetHelper: Workers 预加载失败:",t.message)}),this.initPromise)}async waitForReady(){this.initPromise&&await this.initPromise}isReady(){return this.initialized}async getTemplate(t){try{return""}catch(r){return console.warn("getTemplate 执行出错:",r.message),""}}async getPreview({view:t,schema:r,defaultState:n}){try{if(await this.waitForReady(),n!=null&&n!==""){const s=typeof n=="string"?JSON.parse(n):n;if(typeof s!="object"||s===null)throw new Error("defaultState 必须是一个有效的 JSON 对象")}const{keyMap:i}=await Y0(r);return await(await Vh()).parse({view:t,state:JSON.parse(n),keyMap:i})}catch(i){return console.warn("getPreview 执行出错:",i.message),""}}async getJsonSchema(t){try{await this.waitForReady();const{jsonSchema:r}=await Y0(t);return r}catch(r){return console.warn("getJsonSchema 执行出错:",r.message),""}}genarateSnapshot(...t){return NO(...t)}decodeWidget(t){try{return JSON.parse(Buffer.from(t,"base64").toString()||"")}catch{return""}}}function BO(){return new n2}function FO(e){try{return jsxToJinja(e)}catch(t){return console.warn("getTemplate 执行出错:",t.message),""}}async function zO({view:e,schema:t,defaultState:r}){try{if(r!=null&&r!==""){const o=typeof r=="string"?JSON.parse(r):r;if(typeof o!="object"||o===null)throw new Error("defaultState 必须是一个有效的 JSON 对象")}const{keyMap:n}=await Y0(t);return await(await Vh()).parse({view:e,state:JSON.parse(r),keyMap:n})}catch(n){return console.warn("getPreview 执行出错:",n.message),""}}async function VO(e){try{const{jsonSchema:t}=await Y0(e);return t}catch(t){return console.warn("getJsonSchema 执行出错:",t.message),""}}const $O={data(){return{_widgetHelper:null}},created(){this._widgetHelper=new n2,this._widgetInstancesMap={},this._audioInstancesMap={},this._classifyTagInstancesMap={},this._planConfirmInstancesMap={},this._audioStateCache={}},methods:{_scaleWidgetIfNeeded(e,t){const r=this.widgetList&&this.widgetList.find(s=>s.widget_run_id===t),n=r&&r.scale,i=this._widgetInstancesMap[t],a=i&&i.instance&&i.instance.$el;if(!a)return;if(!n){e.style.width="",e.style.height="",a.style.transform="",a.style.transformOrigin="";return}let o;if(typeof n=="number")o=n;else if(n===!0){const s=this.$refs.containerRef&&(this.$refs.containerRef.$el||this.$refs.containerRef);if(!s)return;const u=s.clientWidth,l=a.style.transform;a.style.transform="";const c=a.scrollWidth||a.offsetWidth;if(a.style.transform=l,u<=0||c<=u){e.style.width="",e.style.height="",a.style.transform="",a.style.transformOrigin="";return}o=u/c}if(o&&o>0){a.style.transform="";const s=a.scrollWidth||a.offsetWidth,u=a.scrollHeight||a.offsetHeight;e.style.width=`${s*o}px`,e.style.height=`${u*o}px`,a.style.transform=`scale(${o})`,a.style.transformOrigin="top left"}},async _mountWidgets(e){if(!this.showWidget)return;const t=e.querySelectorAll(".widget-container");for(const r of t){if(r._widgetMounted||r._widgetMounting)continue;r._widgetMounting=!0;const n=r.getAttribute("data-widget-run-id"),i=r.getAttribute("data-widget-id"),a=r.getAttribute("data-widget-view"),o=r.getAttribute("data-widget-encoded-widget"),s=r.getAttribute("data-widget-state"),u=r.getAttribute("data-widget-payload"),l=r.getAttribute("data-widget-disable")==="true";if(!a&&!o){r._widgetMounting=!1;continue}const c=s?decodeURIComponent(escape(atob(s))):"",f=u?decodeURIComponent(escape(atob(u))):"",h=a?decodeURIComponent(escape(atob(a))):"";let d="";if(h)d=h;else try{const{view:b,schema:x}=this._widgetHelper.decodeWidget(o);d=await this._widgetHelper.getPreview({view:b,schema:x,defaultState:c}),d=JSON.stringify(d),f&&(d=this._widgetHelper.genarateSnapshot(d,f))}catch(b){console.error("[MsgContent] decodeWidget error",b),r._widgetMounting=!1;continue}const p=Ia.extend(Hb),v=new p({propsData:{output:d,disable:l,locale:this.locale}});v.$on("widget-action",b=>this.$emit("widget-action",b,n,i)),v.$on("widget-event",b=>this.$emit("widget-event",b,n,i)),v.$on("widget-rendered",b=>{this.$emit("widget-rendered",b,n,i),this.$nextTick(()=>this._scaleWidgetIfNeeded(r,n))}),v.$mount(),r.appendChild(v.$el),r._widgetMounted=!0,r._widgetMounting=!1;const g=r.getAttribute("data-widget-view")||"",m=r.getAttribute("data-widget-payload")||"",y=r.getAttribute("data-widget-state")||"",_=r.getAttribute("data-widget-encoded-widget")||"";this._widgetInstancesMap[n]={instance:v,container:r,_lastDataKey:`${g}|${m}|${y}|${_}`}}},_mountAudioPlayers(e){if(!this.audioList||this.audioList.length===0)return;e.querySelectorAll(".audio-stream-container").forEach(r=>{const n=r.getAttribute("data-audio-symbol-id");if(this._audioInstancesMap[n]){r.children.length===0&&r.appendChild(this._audioInstancesMap[n].instance.$el);return}if(r.children.length>0)return;const i=this.audioList&&this.audioList.find(a=>a.audioSymbolId===n);if(i)try{const a=Ia.extend(qb),o=new a({propsData:{audioData:i}});o.$on("play",s=>this.$emit("audio-play",s,n)),o.$on("pause",s=>this.$emit("audio-pause",s,n)),o.$on("end",s=>this.$emit("audio-end",s,n)),o.$on("audio-download",s=>this.$emit("audio-download",s,n)),o.$on("chunk-added",s=>this.$emit("audio-chunk-added",s,n)),o.$on("error",s=>this.$emit("audio-error",s,n)),o.$mount(),r.appendChild(o.$el),this._audioInstancesMap[n]={instance:o,container:r}}catch(a){console.error("[MsgContent] 创建音频播放器失败:",a)}})},_mountClassifyTags(e){if(!this.showClassifyTag)return;e.querySelectorAll(".classify-tag-container").forEach((r,n)=>{if(r._classifyTagMounted)return;const i=r.getAttribute("data-classify-tag");if(i)try{const a=decodeURIComponent(escape(atob(i))),o=JSON.parse(a),s=Ia.extend(r2),u=new s({propsData:{title:o.title||"问题澄清",questions:o.questions||[],disabled:!1}});u.$on("submit",l=>this.$emit("classify-tag-submit",l,o)),u.$on("skip",()=>this.$emit("classify-tag-skip",o)),u.$mount(),r.appendChild(u.$el),r._classifyTagMounted=!0,this._classifyTagInstancesMap[n]={instance:u,container:r}}catch(a){console.error("[MsgContent] ClassifyTag mount error:",a)}})},_mountPlanConfirms(e){if(!this.showPlanConfirm)return;e.querySelectorAll(".plan-confirm-container").forEach((r,n)=>{if(r._planConfirmMounted)return;const i=r.getAttribute("data-plan-confirm");if(i)try{const a=decodeURIComponent(escape(atob(i))),o=JSON.parse(a),s=Ia.extend(DO),u=new s({propsData:{title:o.title||"计划确认",planText:o.planText||"",disabled:!1}});u.$on("confirm",l=>this.$emit("plan-confirm",l,o)),u.$on("skip",l=>this.$emit("plan-skip",l,o)),u.$mount(),r.appendChild(u.$el),r._planConfirmMounted=!0,this._planConfirmInstancesMap[n]={instance:u,container:r}}catch(a){console.error("[MsgContent] PlanConfirm mount error:",a)}})},_mountAll(e){this.$nextTick(()=>{this._mountWidgets(e),this._mountAudioPlayers(e),this._mountClassifyTags(e),this._mountPlanConfirms(e)})},async _updateWidgets(e){if(!e)return;const t=this.$refs.containerRef,r=t&&(t.$el||t);if(!r)return;await this.$nextTick();const n=r.querySelectorAll(".widget-container");for(const i of n){const a=i.getAttribute("data-widget-run-id"),o=this._widgetInstancesMap[a];if(!a||!o)continue;const s=i.getAttribute("data-widget-view")||"",u=i.getAttribute("data-widget-payload")||"",l=i.getAttribute("data-widget-state")||"",c=i.getAttribute("data-widget-encoded-widget")||"",f=i.getAttribute("data-widget-disable")==="true",h=`${s}|${u}|${l}|${c}`;if(o._lastDataKey!==h){o._lastDataKey=h;const d=s?decodeURIComponent(escape(atob(s))):"",p=u?decodeURIComponent(escape(atob(u))):"";let v="";if(d)v=d;else if(c){const g=l?decodeURIComponent(escape(atob(l))):"";try{const{view:m,schema:y}=this._widgetHelper.decodeWidget(c);v=await this._widgetHelper.getPreview({view:m,schema:y,defaultState:g}),v=JSON.stringify(v),p&&(v=this._widgetHelper.genarateSnapshot(v,p))}catch{}}o.instance&&(o.instance.output=v)}o.instance&&(o.instance.disable=f),this._scaleWidgetIfNeeded(i,a)}},_updateAudioPlayers(e){e&&Object.keys(this._audioInstancesMap).forEach(t=>{const r=this._audioInstancesMap[t];if(!r||!r.instance)return;const n=e.find(s=>s.audioSymbolId===t);if(!n)return;const i=n.audio_data&&n.audio_data.length||0,a=!!n.isComplete,o=this._audioStateCache[t]||{length:0,isComplete:!1};(i!==o.length||a!==o.isComplete)&&(this._audioStateCache[t]={length:i,isComplete:a},r.instance.audioData=n)})},_destroyAllEmbedded(){Object.keys(this._widgetInstancesMap).forEach(e=>{try{this._widgetInstancesMap[e].instance.$destroy()}catch{}delete this._widgetInstancesMap[e]}),Object.keys(this._audioInstancesMap).forEach(e=>{try{this._audioInstancesMap[e].instance.$destroy()}catch{}delete this._audioInstancesMap[e]}),Object.keys(this._classifyTagInstancesMap).forEach(e=>{try{this._classifyTagInstancesMap[e].instance.$destroy()}catch{}delete this._classifyTagInstancesMap[e]}),Object.keys(this._planConfirmInstancesMap).forEach(e=>{try{this._planConfirmInstancesMap[e].instance.$destroy()}catch{}delete this._planConfirmInstancesMap[e]}),this._audioStateCache={}}},beforeDestroy(){this._destroyAllEmbedded()}},GO={methods:{_postrender(e){let t=e.replace(/&amp;gt;/g,"&gt;").replace(/&amp;lt;/g,"&lt;").replace("CURSOR_POINT",'<span class="cursor"></span>');const r=document.createElement("div");return r.innerHTML=t,r.querySelectorAll("img").forEach(n=>{const i=Gb(n.src,"size"),a=i&&i.split("|")||[];let o,s;if(a[1]){const u=a[1].split("*");o=u[0],u[1]&&(s=u[0]/u[1])}a[0]&&(a[0]==="min"&&(!o||o<24)?o=this.imgMinWidth||"24":a[0]==="mid"&&o>320?o=this.imgMaxWidth||"320":a[0]==="max"&&(o=this.imgMaxWidth||"320")),o&&(n.style.width=o===this.imgMaxWidth||o===this.imgMinWidth?o:`${o}px`),s&&(n.style.height=`${o/s}px`)}),r.querySelectorAll("pre code:not(.language-mermaid)").forEach((n,i,a)=>{if(Array.from(n.classList).some(s=>s.startsWith("language-"))?this.incremental||nf(n):n.classList.add("hljs"),this.isFinal){this.incremental||nv(n);const s=n.parentNode.querySelector(".cursor");s&&s.remove()}else if(this.isPrintAnimate&&!r.querySelector(".cursor")&&i===a.length-1&&!this.isFinal&&n.parentElement===r.lastElementChild){const s=document.createElement("span");s.className="cursor",n.append(s)}if(!this.incremental&&!n.parentNode.querySelector(".code-language-label")&&n.result&&n.result.language){const s=document.createElement("div");s.className="code-language-label",this.codeHeaderRender?s.innerHTML=this.codeHeaderRender(n.result.language,this.content,i):s.textContent=n.result.language,n.parentNode.insertBefore(s,n)}}),Cb(r),this.$emit("postrender",this.currentIndex,this.$refs.containerRef&&(this.$refs.containerRef.$el||this.$refs.containerRef),this.recordId),r.innerHTML.replace(/--&gt;/g,"-->")},_onImageClick(e){this.$emit("imageClick",e)},_onDownloadCardClick(e,t){this.$emit("downloadCardClick",e,t)},_onMDRendered(e){e&&(this.incremental&&e.querySelectorAll("pre code:not(.language-mermaid)").forEach((t,r,n)=>{if(Array.from(t.classList).some(a=>a.startsWith("language-"))&&!t._highlighted&&(r===n.length-1&&!this.isFinal?nf(t):(nf(t),t._highlighted=!0)),this.isFinal&&!t._lineNumbered&&(nv(t),t._lineNumbered=!0),!t.parentNode.querySelector(".code-language-label")&&t.result&&t.result.language){const a=document.createElement("div");a.className="code-language-label",this.codeHeaderRender?a.innerHTML=this.codeHeaderRender(t.result.language,this.content,r):a.textContent=t.result.language,t.parentNode.insertBefore(a,t)}}),this.isFinal?(this.incremental?e.querySelectorAll(".question-text img, .answer-md img").forEach(t=>{t._imgClickBound||(t.addEventListener("click",this._onImageClick),t._imgClickBound=!0)}):(e.querySelectorAll(".question-text img").forEach(t=>{t.removeEventListener("click",this._onImageClick),t.addEventListener("click",this._onImageClick)}),e.querySelectorAll(".answer-md img").forEach(t=>{t.removeEventListener("click",this._onImageClick),t.addEventListener("click",this._onImageClick)})),e.querySelectorAll(`.${this.clazzMd||"answer-md"} a`).forEach(t=>{t.setAttribute("target","_blank")}),e.querySelectorAll(".video-placeholder").forEach(t=>t.remove()),e.querySelectorAll("video").forEach(t=>{t.style.display="block"})):e.querySelectorAll(".video-placeholder").forEach(t=>{this.incremental&&t._videoPlaceholderSet||(t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" style="animation: video-placeholder-spin 1s linear infinite; flex-shrink: 0;"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.36131 2.32604C0.902925 3.77517 0 5.78264 0 8.00101C0 12.4193 3.58172 16.001 8 16.001C12.4183 16.001 16 12.4193 16 8.00101C16 3.58326 12.4191 0.00187492 8.00161 0.00100708L8.85183 1.6572C11.9837 2.07373 14.4 4.7552 14.4 8.00101C14.4 11.5356 11.5346 14.401 8 14.401C4.46538 14.401 1.6 11.5356 1.6 8.00101C1.6 6.40633 2.18324 4.94787 3.14803 3.82731L2.36131 2.32604Z" fill="currentColor"/></svg>视频加载中...',this.incremental&&(t._videoPlaceholderSet=!0))}),this.showTags&&e.querySelectorAll(".tags-container").forEach(t=>{this.incremental&&t._tagClickBound||(this.incremental?(t.addEventListener("click",()=>this.$emit("littleTagClick",t,this.recordId)),t._tagClickBound=!0):(t.removeEventListener("click",this._tagClickHandler),t.addEventListener("click",()=>this.$emit("littleTagClick",t,this.recordId))))}),this.showDownloadCard&&e.querySelectorAll(".download-card").forEach(t=>{this.incremental&&t._downloadClickBound||(t.addEventListener("click",r=>{const n=r.currentTarget.getAttribute("data-file-id");this._onDownloadCardClick(n,r);try{r&&r.preventDefault&&r.preventDefault()}catch{}}),this.incremental&&(t._downloadClickBound=!0))}),this.isMermaidRenderAfterOutput?this.isFinal&&setTimeout(()=>{f1.onMermaidLoaded(()=>{f1.renderAll(e)})},0):setTimeout(()=>{f1.onMermaidLoaded(()=>{f1.renderAll(e)})},0),this._mountAll(e))}}};const HO={name:"MsgContent",components:{MDRender:IP},mixins:[JN,$O,GO],props:{showDownloadCard:{type:Boolean,default:!1},showTags:{type:Boolean,default:!1},fullFiles:{type:Array,default:()=>[]},recordId:String,content:{type:String,default:""},isFinal:{type:Boolean,default:!1},loadingMessage:{type:Boolean,default:!1},isMdExpand:{type:[Boolean,void 0],default:void 0},isReplaceLinks:{type:Boolean,default:!1},isPrintAnimate:{type:Boolean,default:!1},styleObj:Object,clazzTable:String,clazzMd:String,anchorAttributes:Object,linkify:{type:Boolean,default:!1},imgMinWidth:[Number,String],imgMaxWidth:[Number,String],printCount:Number,printCountTime:Number,hideCursorPoint:Boolean,chartDataArr:Array,codeHeaderRender:Function,replaceLinksWhitelist:Array,isMermaidRenderAfterOutput:{type:Boolean,default:!1},showWidget:{type:Boolean,default:!1},widgetList:{type:Array,default:()=>[]},audioList:{type:Array,default:()=>[]},locale:{type:String,default:"zh-CN"},incremental:{type:Boolean,default:!0},showClassifyTag:{type:Boolean,default:!1},showPlanConfirm:{type:Boolean,default:!1}},data(){return{currentText:"",renderText:""}},computed:{processOptions(){return{isReplaceLinks:this.isReplaceLinks,replaceLinksWhitelist:this.replaceLinksWhitelist,isFinal:this.isFinal,showTags:this.showTags,showDownloadCard:this.showDownloadCard,fullFiles:this.fullFiles,showWidget:this.showWidget,widgetList:this.widgetList,audioList:this.audioList,showClassifyTag:this.showClassifyTag,showPlanConfirm:this.showPlanConfirm}}},watch:{content(e){this.clearTimer(),this.currentIndex=this.currentText.length,this.currentText=this._getProcessedContent(e),this.isPrintAnimate?this._startPrint():this.renderText=this.currentText},isFinal(e){e&&this.content&&(this.clearTimer(),this.currentText=this._getProcessedContent(this.content),this.renderText=this.currentText,this.currentIndex=this.currentText.length)},isMdExpand(e){e?this.currentText=af(this.content,this.processOptions):this.currentText=af((this.content||"").substr(0,3e3),this.processOptions),this.renderText=this.currentText,this.clearTimer(),this.currentIndex=this.currentText.length},widgetList:{handler(e){this._updateWidgets(e)},deep:!0},audioList:{handler(e){this._updateAudioPlayers(e)},deep:!0}},created(){this._init()},mounted(){bN()},beforeDestroy(){this.clearTimer(),this._destroyAllEmbedded()},methods:{_getProcessedContent(e){if(!e)return"";const t=this.isMdExpand===void 0||this.isMdExpand?1e6:1e4;return af(e.substr(0,t),this.processOptions)},_startPrint(){this.startCurrentTimer({printCount:this.printCount||1,printCountTime:this.printCountTime||16,hideCursorPoint:this.hideCursorPoint,isFinal:this.isFinal})},_init(){const e=this._getProcessedContent(this.content||"");this.currentText=e,!this.isPrintAnimate||this.isFinal?(this.renderText=e,this.currentIndex=e.length,this.clearTimer()):this._startPrint()}}};var UO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"msg-content"},[t.loadingMessage?t._e():[r("MDRender",{ref:"containerRef",class:t.clazzMd||"answer-md",style:t.styleObj,attrs:{highlight:!0,"table-class":t.clazzTable||(t.isFinal?"table-style":"table"),source:t.renderText,"anchor-attributes":t.anchorAttributes||{target:"_blank"},linkify:t.linkify,incremental:t.incremental,postrender:t._postrender},on:{rendered:t._onMDRendered}})]],2)},WO=[],qO=pr(HO,UO,WO,!1,null,null,null,null);const Xb=qO.exports,Z4=An(Xb);const ZO={name:"MsgThought",components:{VIcon:t2},props:{titleRender:{type:[Object,Function],default:null},isMobile:Boolean,content:String,title:String,titleIcon:String,nodeName:String,status:String,elapsed:{type:Number,default:0},detailVisible:{type:Boolean,default:!0}},data(){return{THOUGHT_STATUS:vP,innerDetailVisible:this.detailVisible,renderedContent:"",xssHandler:new Un.FilterXSS(pP)}},computed:{elapsedSeconds(){return this.elapsed?(this.elapsed/1e3).toFixed(1):0}},watch:{content:{immediate:!0,handler(e){const t=(e||"").replace(/^\n+/,"").replace(/\n/g,"<br>");this.renderedContent=this.xssHandler.process(t)}},detailVisible(e){this.innerDetailVisible=e}},methods:{onTitleClick(){const e=!this.innerDetailVisible;this.innerDetailVisible=e,this.$emit("update:detailVisible",e)}}};var YO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"thought-clps-content"},[t.titleRender?r(t.titleRender,{tag:"component"}):t._e(),t.titleRender?t._e():r("div",{staticClass:"thought-title",on:{click:t.onTitleClick}},[r("div",{staticClass:"thought-title-container"},[r("img",{staticClass:"thought-title-icon",attrs:{src:t.titleIcon}}),r("span",{staticClass:"thought-title-name"},[t._v(" "+t._s(t.title)+" "),t.nodeName?r("span",{staticClass:"thought-clps-modellabel"},[t._v(" -"+t._s(t.nodeName)+" ")]):t._e()]),t.status===t.THOUGHT_STATUS.failed?r("v-icon",{style:{color:"#FF8345"},attrs:{name:"basic_warning_line",size:"16"}}):t._e(),t.status===t.THOUGHT_STATUS.success?r("v-icon",{style:{color:"#0FB87F"},attrs:{name:"basic_finish_line",size:"16"}}):t._e(),t.status===t.THOUGHT_STATUS.stop?r("v-icon",{style:{color:"rgba(1,11,50,0.41)"},attrs:{name:"basic_stop_line",size:"16"}}):t._e()],1),r("div",{staticClass:"thought-title-container thought-title-elapsed"},[r("span",[t._v(t._s(t.elapsedSeconds)+"s")]),r("v-icon",{staticClass:"thought__header__icon",attrs:{name:"arrow_down_small_line",rotate:t.innerDetailVisible?180:0,size:"12"}})],1)]),t.innerDetailVisible?r("div",{staticClass:"thought-detail"},[r("div",{staticClass:"question-text",class:{"question-text-mobile":t.isMobile},domProps:{innerHTML:t._s(t.renderedContent)}})]):t._e()],1)},XO=[],jO=pr(ZO,YO,XO,!1,null,"60c16159",null,null);const KO=jO.exports,Y4=An(KO);/*! *****************************************************************************
47
+ `))}return e=WN(e),e=UN(e),r&&(e=QN(e,n)),ZN(e)||(e=YN(e),e=jN.clean(e)),e=DN(e),e=EN(e),e=SN(e),e=kN(e),e=xN(e),e=wN(e),e=HN(e),i||(e=CN(e)),e=AN(e),a&&(e=BN(e)),o&&(e=ON(e,s)),u?e=IN(e,l):e=PN(e),c&&c.length>0?e=RN(e,c):e=NN(e),f?e=FN(e):e=zN(e),h?e=VN(e):e=$N(e),e=TN(e),e=XN.process(dE(e)),e}function QN(e,t){if(!e||Gb(window.location.hash,"from"))return e;let n=["lke.cloud.tencent.com","qidian"];t&&(n=t.concat(n));const i=GN(e);i.forEach((u,l)=>{e=e.replace(u,`IMG_URL${l}`)});const a=`${window.location.protocol}//${window.location.host}/lke#/link-info/redirect?target=`,o=n.map(u=>`(?!.*${u})`).join(""),s=new RegExp(`(\\[([^\\]]+)\\]\\((https?:\\/\\/${o}[^\\s)]+)\\))|(<a\\s+[^>]*href="(${o}[^"]+)"[^>]*>(.*?)<\\/a>)`,"gi");return e=e.replace(s,(u,l,c,f,h,d,p)=>l&&c?`[${c}](${a}${encodeURIComponent(f)})`:d&&!d.startsWith("#")?`<a href="${a}${encodeURIComponent(d)}">${p}</a>`:u),i.forEach((u,l)=>{e=e.replace(`IMG_URL${l}`,u)}),e}function af(e,t={}){return MN(e,r=>KN(r,t))}const JN={data(){return{currentTimer:null,currentIndex:0}},methods:{clearTimer(){this.currentTimer&&(clearTimeout(this.currentTimer),this.currentTimer=null)},startCurrentTimer(e={}){const{printCount:t=1,printCountTime:r=16,hideCursorPoint:n=!1,isFinal:i=!1}=e;this.clearTimer(),this.currentTimer=setTimeout(()=>{const a=t;this.currentIndex+=a,this.renderText=n?this.currentText.substring(0,this.currentIndex):this.currentText.substring(0,this.currentIndex)+"CURSOR_POINT",(this.currentIndex<this.currentText.length||!i)&&this.startCurrentTimer(e)},r)}},beforeDestroy(){this.clearTimer()}};function eO(e,t={}){const{type:r="text/javascript",crossOrigin:n}=t;return new Promise((i,a)=>{if(document.querySelector(`script[src="${e}"]`)){i();return}const o=document.createElement("script");o.src=e,o.type=r,n&&(o.crossOrigin=n),o.onload=i,o.onerror=()=>a(new Error(`Failed to load: ${e}`)),document.head.appendChild(o)})}function tO(){const e=Date.now(),t=5*60*1e3;return Math.floor(e/t)*t}async function rO(){try{window.tdWidgetSrc="/cdn-proxy/webim/assets/static/widget/release/lib/js/";const e=window.tdWidgetSrc||"https://cdn.xiaowei.qq.com/webim/assets/static/widget/release/lib/js/",t=tO();return await eO(`${e}adp-widget.js?nounce=${t}`,{type:"module"}),!0}catch(e){throw console.error("Failed to load adp-widget:",e),e}}Ia.config&&!Ia.config.ignoredElements.includes("adp-widget")&&Ia.config.ignoredElements.push("adp-widget");const nO={name:"MsgWidget",props:{output:{type:String,default:""},locale:{type:String,default:"zh-CN"},disable:{type:Boolean,default:!1}},data(){return{loaded:!1}},async mounted(){try{await rO(),this.loaded=!0}catch(e){console.error("[MsgWidget] 加载 adp-widget 失败:",e)}},methods:{handleAction(e){const{action:t}=e.detail||{};this.$emit("widget-action",t),this.$emit("widget-event",e)},handleRendered(e){const{success:t,config:r,error:n,timestamp:i}=e.detail||{};this.$emit("widget-rendered",{success:t,config:r,error:n,timestamp:i})}}};var iO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"lke__widget-container"},[t.output&&t.loaded?r("adp-widget",{ref:"widget",attrs:{locale:t.locale,"widget-json":t.output,disable:t.disable},on:{"widget-rendered":t.handleRendered,"widget-action":t.handleAction}}):t._e()],1)},aO=[],oO=pr(nO,iO,aO,!1,null,"c152fdb4",null,null);const Hb=oO.exports,Y=(...e)=>{console.log("[StreamAudioPlayer24]",...e)};let Ub=class{constructor(){this.playMode=null,this.audioContext=null,this.audioQueue=[],this.pendingChunks=[],this.isPlaying=!1,this.totalDuration=0,this.estimatedDuration=0,this.pausedAt=0,this.startedAt=0,this.timeUpdateInterval=null,this.scheduledSources=[],this.nextScheduleTime=0,this.scheduledCount=0,this.autoPlayCheckInterval=null,this.autoPlayCheckWaitTime=0,this.processedChunkCount=0,this.decodingInProgress=!1,this.isSchedulingFromPosition=!1,this.decodeAheadCount=1;const t=this.isMobileDevice();this.maxDecodedBuffers=t?8:20,this.playedBufferCount=0,this.audioElement=null,this.iosUnlockAudio=null,this.mediaStreamDestination=null,this.wasPlayingBeforeHidden=!1,this.handleVisibilityChange=null,this.onPlayCallback=null,this.onPauseCallback=null,this.onEndCallback=null,this.onErrorCallback=null,this.onTimeUpdateCallback=null,this.onDurationChangeCallback=null,this.onUrlReadyCallback=null,this.generationComplete=!1,this.durationFromUrlSet=!1,this.urlReady=!1,this.fullAudioUrl=null,this.preloadedAudioElement=null}isMobileDevice(){return typeof navigator>"u"?!1:/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}initAudioContext(){if(!this.audioContext)try{const t=window.AudioContext||window.webkitAudioContext;this.audioContext=new t,Y("[initAudioContext] AudioContext 创建成功",{state:this.audioContext.state,sampleRate:this.audioContext.sampleRate,isIOS:/iPhone|iPad|iPod/i.test(navigator.userAgent)}),this.audioContext.onstatechange=()=>{if(Y("[AudioContext.onstatechange] 状态变化:",this.audioContext.state),(this.audioContext.state==="interrupted"||this.audioContext.state==="suspended")&&this.isPlaying&&this.iosUnlockAudio)try{this.iosUnlockAudio.pause(),Y("[AudioContext.onstatechange] iOS audio 元素已暂停")}catch{}},this.handleVisibilityChange=()=>{var r,n,i,a;document.hidden?(this.wasPlayingBeforeHidden=this.isPlaying,Y("[visibilitychange] 页面隐藏,记录播放状态:",this.wasPlayingBeforeHidden)):(Y("[visibilitychange] 页面可见",{wasPlayingBeforeHidden:this.wasPlayingBeforeHidden,isPlaying:this.isPlaying,audioContextState:(r=this.audioContext)==null?void 0:r.state}),this.wasPlayingBeforeHidden&&(((n=this.audioContext)==null?void 0:n.state)==="suspended"||((i=this.audioContext)==null?void 0:i.state)==="interrupted"?this.audioContext.resume().then(()=>{Y("[visibilitychange] AudioContext 已恢复"),this.isPlaying&&this.iosUnlockAudio&&this.iosUnlockAudio.play().catch(o=>{Y("[visibilitychange] iOS audio 恢复播放失败:",o)})}).catch(o=>{Y("[visibilitychange] AudioContext 恢复失败:",o),this.isPlaying&&(this.isPlaying=!1,this.onPauseCallback&&this.onPauseCallback())}):((a=this.audioContext)==null?void 0:a.state)==="running"&&this.isPlaying&&this.iosUnlockAudio&&this.iosUnlockAudio.play().catch(o=>{Y("[visibilitychange] iOS audio 恢复播放失败:",o)})),this.wasPlayingBeforeHidden=!1)},document.addEventListener("visibilitychange",this.handleVisibilityChange),/iPhone|iPad|iPod/i.test(navigator.userAgent)&&this.setupIOSAudioRoute()}catch(t){console.error("[initAudioContext] 创建 AudioContext 失败:",t),this.onErrorCallback&&this.onErrorCallback(new Error("浏览器不支持音频播放"))}}setupIOSAudioRoute(){if(this.audioContext)try{if(typeof this.audioContext.createMediaStreamDestination!="function"){Y("[setupIOSAudioRoute] 浏览器不支持 createMediaStreamDestination");return}this.mediaStreamDestination=this.audioContext.createMediaStreamDestination(),this.iosUnlockAudio=document.createElement("audio"),this.iosUnlockAudio.srcObject=this.mediaStreamDestination.stream,this.iosUnlockAudio.setAttribute("playsinline","true"),this.iosUnlockAudio.setAttribute("webkit-playsinline","true"),this.iosUnlockAudio.onerror=t=>{Y("[setupIOSAudioRoute] iOS audio 元素错误:",t)},Y("[setupIOSAudioRoute] iOS 音频路由设置完成")}catch(t){console.error("[setupIOSAudioRoute] 设置失败:",t),this.mediaStreamDestination=null,this.iosUnlockAudio=null}}getAudioDestination(){return this.mediaStreamDestination?this.mediaStreamDestination:this.audioContext?this.audioContext.destination:null}async startIOSAudioElement(){if(this.iosUnlockAudio)try{await this.iosUnlockAudio.play(),Y("[startIOSAudioElement] iOS audio 元素播放启动成功")}catch(t){Y("[startIOSAudioElement] iOS audio 元素播放失败:",t)}}initAudioElement(){this.audioElement||(this.audioElement=new Audio,this.audioElement.preload="metadata",this.audioElement.addEventListener("play",()=>{this.isPlaying=!0,this.onPlayCallback&&this.onPlayCallback()}),this.audioElement.addEventListener("pause",()=>{this.isPlaying=!1,this.onPauseCallback&&this.onPauseCallback()}),this.audioElement.addEventListener("ended",()=>{this.isPlaying=!1,this.onEndCallback&&this.onEndCallback()}),this.audioElement.addEventListener("timeupdate",()=>{this.onTimeUpdateCallback&&this.onTimeUpdateCallback(this.audioElement.currentTime,this.audioElement.duration||0)}),this.audioElement.addEventListener("durationchange",()=>{this.totalDuration=this.audioElement.duration||0,this.onDurationChangeCallback&&this.onDurationChangeCallback(this.totalDuration)}),this.audioElement.addEventListener("error",t=>{this.onErrorCallback&&this.onErrorCallback(new Error("音频加载失败: "+(t.message||"未知错误")))}),this.audioElement.addEventListener("loadedmetadata",()=>{this.totalDuration=this.audioElement.duration||0,this.onDurationChangeCallback&&this.onDurationChangeCallback(this.totalDuration)}))}setPlayMode(t){this.playMode!==t&&(this.playMode==="stream"?this.clearStreamMode():this.playMode==="url"&&this.clearUrlMode(),this.playMode=t,t==="stream"?this.initAudioContext():t==="url"&&this.initAudioElement())}clearStreamMode(){this.stop(),this.audioQueue=[],this.pendingChunks=[],this.totalDuration=0,this.estimatedDuration=0,this.scheduledCount=0,this.nextScheduleTime=0,this.processedChunkCount=0,this.decodingInProgress=!1,this.isSchedulingFromPosition=!1,this.playedBufferCount=0,this.generationComplete=!1,this.fullAudioUrl=null,this.urlReady=!1,this.preloadedAudioElement=null,this.iosUnlockAudio&&(this.iosUnlockAudio.pause(),this.iosUnlockAudio.srcObject=null,this.iosUnlockAudio=null),this.mediaStreamDestination=null,this.handleVisibilityChange&&(document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.handleVisibilityChange=null),this.audioContext&&(this.audioContext.onstatechange=null,this.audioContext.close().catch(()=>{}),this.audioContext=null),this.wasPlayingBeforeHidden=!1}clearUrlMode(){this.audioElement&&(this.audioElement.pause(),this.audioElement.src="")}setAudioUrl(t){t&&(this.setPlayMode("url"),this.audioElement.src=t,this.audioElement.load())}async ensureAudioContextRunning(){if(!this.audioContext)throw new Error("AudioContext not initialized");if(Y("[ensureAudioContextRunning] 当前状态:",this.audioContext.state),this.audioContext.state==="suspended")try{await this.audioContext.resume(),Y("[ensureAudioContextRunning] resume 成功,新状态:",this.audioContext.state),/iPhone|iPad|iPod/i.test(navigator.userAgent)&&await this.playUnlockSound()}catch(t){throw console.error("[ensureAudioContextRunning] resume 失败:",t),new Error("无法激活音频上下文")}else if(this.audioContext.state==="interrupted")try{await this.audioContext.resume(),Y("[ensureAudioContextRunning] 从 interrupted 状态恢复")}catch(t){throw console.error("[ensureAudioContextRunning] 从 interrupted 恢复失败:",t),new Error("无法恢复音频上下文")}}async playUnlockSound(){if(this.audioContext)try{const t=this.audioContext.createBuffer(1,1,this.audioContext.sampleRate),r=this.audioContext.createBufferSource();r.buffer=t,r.connect(this.getAudioDestination()),r.start(0),Y("[playUnlockSound] 播放解锁音频完成")}catch(t){Y("[playUnlockSound] 播放解锁音频失败(可忽略):",t)}}addBase64ChunkLazy(t,r=1){if(!t)return;this.setPlayMode("stream"),this.pendingChunks.push(t);const n=(t.length*.75/1024).toFixed(2);Y(`[addBase64ChunkLazy] 添加第 ${this.pendingChunks.length+this.processedChunkCount} 个chunk`,{chunkSize:`${n} KB`,pendingChunks:this.pendingChunks.length,processedChunkCount:this.processedChunkCount,audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,isPlaying:this.isPlaying,totalDuration:this.totalDuration.toFixed(2),estimatedDuration:this.estimatedDuration.toFixed(2)}),this.estimatedDuration+=r,this.onDurationChangeCallback&&this.onDurationChangeCallback(this.getDisplayDuration()),this.autoPlayCheckWaitTime>0&&(Y("[addBase64ChunkLazy] 重置等待超时时间"),this.autoPlayCheckWaitTime=0),this.isPlaying?(Y("[addBase64ChunkLazy] 正在播放,触发 decodeAhead"),this.decodeAhead()):Y("[addBase64ChunkLazy] 未在播放状态,不触发解码")}async addBase64Chunk(t){t&&this.addBase64ChunkLazy(t)}getDisplayDuration(){return Math.floor(this.totalDuration+this.estimatedDuration)}async decodeAhead(){let t=0;if(this.audioQueue.forEach(i=>{t+=i.duration}),Y("[decodeAhead] 开始",{decodingInProgress:this.decodingInProgress,pendingChunks:this.pendingChunks.length,audioQueueLength:this.audioQueue.length,currentQueueDuration:t.toFixed(2),scheduledCount:this.scheduledCount,isPlaying:this.isPlaying,generationComplete:this.generationComplete,totalDuration:this.totalDuration.toFixed(2)}),this.decodingInProgress){Y("[decodeAhead] 已在解码中,跳过");return}if(this.pendingChunks.length===0){Y("[decodeAhead] 没有待解码的 chunk,跳过");return}const r=this.audioQueue.length-this.scheduledCount;if(Y("[decodeAhead] 未调度数量检查",{unscheduledCount:r,decodeAheadCount:this.decodeAheadCount,needMoreDecode:r<this.decodeAheadCount}),r>=this.decodeAheadCount&&this.pendingChunks.length>0){Y("[decodeAhead] 已有足够预解码 buffer,100ms 后再检查"),setTimeout(()=>this.decodeAhead(),100);return}this.decodingInProgress=!0;const n=this.processedChunkCount+1;try{const i=this.pendingChunks.shift(),a=(i.length*.75/1024).toFixed(2);Y(`[decodeAhead] 开始解码第 ${n} 个chunk`,{size:`${a} KB`});const o=window.atob(i),s=new Uint8Array(o.length);for(let l=0;l<o.length;l++)s[l]=o.charCodeAt(l);const u=s.buffer;await this.addAudioChunkInternal(u),Y(`[decodeAhead] 第 ${n} 个chunk 解码完成`,{audioQueueLength:this.audioQueue.length,totalDuration:this.totalDuration.toFixed(2),durationFromUrlSet:this.durationFromUrlSet}),this.durationFromUrlSet||(this.estimatedDuration>0&&(this.estimatedDuration=Math.max(0,this.estimatedDuration-1)),this.onDurationChangeCallback&&this.onDurationChangeCallback(this.getDisplayDuration()))}catch(i){console.error(`[decodeAhead] 解码第 ${n} 个chunk 失败:`,i),this.onErrorCallback&&this.onErrorCallback(i)}finally{this.decodingInProgress=!1}this.pendingChunks.length>0&&this.isPlaying?(Y("[decodeAhead] 继续解码下一个chunk"),setTimeout(()=>this.decodeAhead(),0)):Y("[decodeAhead] 解码结束",{pendingChunks:this.pendingChunks.length,isPlaying:this.isPlaying})}async processAudioDataArray(t){if(!t||!Array.isArray(t))return;const r=t.slice(this.processedChunkCount);Y("[processAudioDataArray] 处理音频数据数组",{totalLength:t.length,processedChunkCount:this.processedChunkCount,newChunksCount:r.length});for(const n of r)await this.addBase64Chunk(n),this.processedChunkCount++;Y("[processAudioDataArray] 处理完成",{processedChunkCount:this.processedChunkCount})}decodeAudioDataCompat(t){const r=(t.byteLength/1024).toFixed(2);return Y("[decodeAudioDataCompat] 开始解码",{size:`${r} KB`}),new Promise((n,i)=>{const a=this.audioContext.decodeAudioData(t,o=>{Y("[decodeAudioDataCompat] 解码成功",{duration:o.duration.toFixed(2),sampleRate:o.sampleRate,channels:o.numberOfChannels}),n(o)},o=>{console.error("[decodeAudioDataCompat] 解码失败",{error:(o==null?void 0:o.message)||o,bufferSize:`${r} KB`}),i(o||new Error("解码音频数据失败"))});a&&typeof a.then=="function"&&a.then(n).catch(o=>{console.error("[decodeAudioDataCompat] Promise 解码失败",{error:(o==null?void 0:o.message)||o,bufferSize:`${r} KB`}),i(o)})})}async addAudioChunk(t){return this.addAudioChunkInternal(t)}async addAudioChunkInternal(t){if(this.setPlayMode("stream"),!this.audioContext)throw new Error("AudioContext not initialized");try{let r;t instanceof Blob?r=await t.arrayBuffer():r=t;const n=(r.byteLength/1024).toFixed(2);Y("[addAudioChunkInternal] 开始解码 ArrayBuffer",{size:`${n} KB`});const i=r.slice(0),a=await this.decodeAudioDataCompat(i),o=this.audioQueue.length,s=this.totalDuration;this.audioQueue.push(a),this.durationFromUrlSet||(this.totalDuration+=a.duration),Y("[addAudioChunkInternal] 解码成功",{bufferDuration:a.duration.toFixed(2),sampleRate:a.sampleRate,numberOfChannels:a.numberOfChannels,length:a.length,audioQueueLength:`${o} -> ${this.audioQueue.length}`,totalDuration:`${s.toFixed(2)} -> ${this.totalDuration.toFixed(2)}`,durationFromUrlSet:this.durationFromUrlSet}),this.isPlaying&&!this.isSchedulingFromPosition?(Y("[addAudioChunkInternal] 正在播放,调用 scheduleNewChunks"),this.scheduleNewChunks()):this.isSchedulingFromPosition?Y("[addAudioChunkInternal] 正在执行 scheduleFromPosition,跳过 scheduleNewChunks"):Y("[addAudioChunkInternal] 未在播放状态,不调度"),this.onDurationChangeCallback&&!this.durationFromUrlSet&&this.onDurationChangeCallback(this.getDisplayDuration())}catch(r){console.error("[addAudioChunkInternal] 解码音频数据失败:",r),this.onErrorCallback&&this.onErrorCallback(r)}}async addPCMChunk(t,r=24e3,n=1,i=16){if(this.setPlayMode("stream"),!this.audioContext)throw new Error("AudioContext not initialized");try{const a=i/8,o=t.byteLength/(a*n),s=this.audioContext.createBuffer(n,o,r),u=new DataView(t);for(let l=0;l<n;l++){const c=s.getChannelData(l);for(let f=0;f<o;f++){let h;if(i===16)h=u.getInt16((f*n+l)*2,!0)/32768;else if(i===8)h=(u.getUint8(f*n+l)-128)/128;else if(i===32)h=u.getFloat32((f*n+l)*4,!0);else throw new Error(`Unsupported bits per sample: ${i}`);c[f]=h}}this.audioQueue.push(s),this.totalDuration+=s.duration,this.isPlaying&&this.audioContext&&this.scheduleNewChunks(),this.onDurationChangeCallback&&this.onDurationChangeCallback(this.totalDuration)}catch(a){this.onErrorCallback&&this.onErrorCallback(a)}}scheduleNewChunks(){if(!this.audioContext||!this.isPlaying){Y("[scheduleNewChunks] 跳过",{hasAudioContext:!!this.audioContext,isPlaying:this.isPlaying});return}const t=this.audioContext.currentTime,r=this.scheduledCount;this.scheduledCount>this.audioQueue.length&&(Y("[scheduleNewChunks] 警告:scheduledCount 超出 audioQueue 长度!",{scheduledCount:this.scheduledCount,audioQueueLength:this.audioQueue.length,playedBufferCount:this.playedBufferCount}),this.scheduledCount=this.audioQueue.length),Y("[scheduleNewChunks] 开始调度",{audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,toSchedule:this.audioQueue.length-this.scheduledCount,currentTime:t.toFixed(3),nextScheduleTime:this.nextScheduleTime.toFixed(3),pendingChunks:this.pendingChunks.length});for(let n=this.scheduledCount;n<this.audioQueue.length;n++){const i=this.audioQueue[n],a=this.audioContext.createBufferSource();a.buffer=i,a.connect(this.getAudioDestination());const o=Math.max(t,this.nextScheduleTime);Y(`[scheduleNewChunks] 调度第 ${n+1} 个buffer`,{bufferDuration:i.duration.toFixed(2),scheduleTime:o.toFixed(3),currentTime:t.toFixed(3)}),a.start(o,0,i.duration),this.nextScheduleTime=o+i.duration,this.scheduledCount++,this.scheduledSources.push(a),a.onended=()=>{const s=this.scheduledSources.indexOf(a);if(s===-1){Y(`[sourceNode.onended] 第 ${n+1} 个buffer 被手动停止,跳过后续逻辑`);return}if(this.scheduledSources.splice(s,1),this.playedBufferCount++,this.cleanupOldBuffers(),Y(`[sourceNode.onended] 第 ${n+1} 个buffer 播放结束`,{scheduledSourcesLength:this.scheduledSources.length,isPlaying:this.isPlaying,pendingChunks:this.pendingChunks.length,audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,generationComplete:this.generationComplete,playedBufferCount:this.playedBufferCount}),this.decodeAhead(),this.scheduledSources.length===0&&this.isPlaying){let u=0;this.audioQueue.forEach(l=>{u+=l.duration}),Y("[sourceNode.onended] 所有已调度片段播放完毕,尝试调度新片段",{audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,unscheduledCount:this.audioQueue.length-this.scheduledCount,remainingQueueDuration:u.toFixed(2),pendingChunks:this.pendingChunks.length}),this.scheduleNewChunks(),this.scheduledSources.length===0&&(Y("[sourceNode.onended] 调度后仍无片段",{pendingChunks:this.pendingChunks.length,generationComplete:this.generationComplete,audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,unscheduledBuffers:this.audioQueue.length-this.scheduledCount}),this.pendingChunks.length>0?(Y("[sourceNode.onended] 还有待解码chunk,启动 autoPlayCheck"),this.startAutoPlayCheck()):this.audioQueue.length>this.scheduledCount?(Y("[sourceNode.onended] 还有未调度的buffer,重新调度"),this.scheduleNewChunks()):this.generationComplete?(Y("[sourceNode.onended] 生成完成,结束播放"),this.handlePlaybackEnd()):(Y("[sourceNode.onended] 等待新数据,启动 autoPlayCheck"),this.startAutoPlayCheck()))}}}Y("[scheduleNewChunks] 调度完成",{scheduledCount:`${r} -> ${this.scheduledCount}`,scheduledSourcesLength:this.scheduledSources.length,nextScheduleTime:this.nextScheduleTime.toFixed(3)})}async play(){if(this.playMode==="url"&&this.audioElement){try{await this.audioElement.play()}catch(t){this.onErrorCallback&&this.onErrorCallback(t)}return}if(!this.audioContext){this.onErrorCallback&&this.onErrorCallback(new Error("AudioContext not initialized"));return}if(!this.isPlaying){try{await this.ensureAudioContextRunning(),await this.startIOSAudioElement()}catch(t){this.onErrorCallback&&this.onErrorCallback(t);return}if(this.audioQueue.length===0&&this.pendingChunks.length>0&&await this.decodeFirstChunk(),this.audioQueue.length===0){Y("[play] 没有可播放的音频数据");return}this.isPlaying=!0,this.startedAt=this.audioContext.currentTime-this.pausedAt,this.pausedAt===0&&(this.scheduledCount=0,this.nextScheduleTime=this.audioContext.currentTime),this.pausedAt===0?this.scheduleNewChunks():this.scheduleFromPosition(this.pausedAt),this.decodeAhead(),this.onPlayCallback&&this.onPlayCallback(),this.startTimeUpdate(),Y("[play] 播放开始",{audioContextState:this.audioContext.state,audioQueueLength:this.audioQueue.length,pausedAt:this.pausedAt,isIOS:/iPhone|iPad|iPod/i.test(navigator.userAgent)})}}async decodeFirstChunk(){if(this.pendingChunks.length===0)return;const t=this.pendingChunks.shift();try{const r=window.atob(t),n=new Uint8Array(r.length);for(let a=0;a<r.length;a++)n[a]=r.charCodeAt(a);const i=n.buffer;await this.addAudioChunkInternal(i),this.estimatedDuration>0&&(this.estimatedDuration=Math.max(0,this.estimatedDuration-1))}catch(r){console.error("解码首个 chunk 失败:",r)}}scheduleFromPosition(t){if(!this.audioContext)return;this.isSchedulingFromPosition=!0;let r=0;const n=this.audioContext.currentTime;let i=n,a=0;for(let o=0;o<this.audioQueue.length;o++){const s=this.audioQueue[o],u=r,l=r+s.duration;if(l>t){const c=this.audioContext.createBufferSource();c.buffer=s,c.connect(this.getAudioDestination());let f=0,h=s.duration;t>u&&(f=t-u,h=s.duration-f,i=n),c.start(i,f,h),i+=h,this.scheduledSources.push(c),a++,c.onended=()=>{const d=this.scheduledSources.indexOf(c);if(d===-1){Y("[scheduleFromPosition.onended] sourceNode 被手动停止,跳过后续逻辑");return}this.scheduledSources.splice(d,1),this.playedBufferCount++,this.cleanupOldBuffers(),this.decodeAhead(),this.scheduledSources.length===0&&this.isPlaying&&(this.scheduleNewChunks(),this.scheduledSources.length===0&&(Y("[scheduleFromPosition.onended] 调度后仍无片段",{pendingChunks:this.pendingChunks.length,generationComplete:this.generationComplete,audioQueueLength:this.audioQueue.length,scheduledCount:this.scheduledCount,unscheduledBuffers:this.audioQueue.length-this.scheduledCount}),this.pendingChunks.length>0?(Y("[scheduleFromPosition.onended] 还有待解码chunk,启动 autoPlayCheck"),this.startAutoPlayCheck()):this.audioQueue.length>this.scheduledCount?(Y("[scheduleFromPosition.onended] 还有未调度的buffer,重新调度"),this.scheduleNewChunks()):this.generationComplete?(Y("[scheduleFromPosition.onended] 生成完成,结束播放"),this.handlePlaybackEnd()):(Y("[scheduleFromPosition.onended] 等待新数据,启动 autoPlayCheck"),this.startAutoPlayCheck())))}}r=l}this.scheduledCount=this.audioQueue.length,this.nextScheduleTime=i,this.isSchedulingFromPosition=!1,Y("[scheduleFromPosition] 调度完成",{startPosition:t.toFixed(2),scheduledInThisCall:a,scheduledCount:this.scheduledCount,nextScheduleTime:this.nextScheduleTime.toFixed(3),scheduledSourcesLength:this.scheduledSources.length})}pause(){if(this.playMode==="url"&&this.audioElement){this.audioElement.pause();return}if(!(!this.isPlaying||!this.audioContext)){this.pausedAt=this.audioContext.currentTime-this.startedAt;for(const t of this.scheduledSources)try{t.stop()}catch{}if(this.scheduledSources=[],this.iosUnlockAudio)try{this.iosUnlockAudio.pause(),Y("[pause] iOS audio 元素已暂停")}catch{}this.isPlaying=!1,this.onPauseCallback&&this.onPauseCallback(),this.stopTimeUpdate(),this.stopAutoPlayCheck()}}stop(){if(this.playMode==="url"&&this.audioElement){this.audioElement.pause(),this.audioElement.currentTime=0,this.isPlaying=!1;return}this.pause(),this.pausedAt=0,this.startedAt=0,this.scheduledCount=0,this.nextScheduleTime=0,this.stopTimeUpdate(),this.stopAutoPlayCheck()}clear(){this.stop(),this.audioQueue=[],this.pendingChunks=[],this.totalDuration=0,this.estimatedDuration=0,this.scheduledCount=0,this.nextScheduleTime=0,this.processedChunkCount=0,this.generationComplete=!1,this.decodingInProgress=!1,this.isSchedulingFromPosition=!1,this.durationFromUrlSet=!1}handlePlaybackEnd(){let t=0;if(this.audioQueue.forEach(r=>{t+=r.duration}),Y("[handlePlaybackEnd] 播放结束",{totalDuration:this.totalDuration.toFixed(2),actualDecodedDuration:t.toFixed(2),audioQueueLength:this.audioQueue.length,pendingChunks:this.pendingChunks.length,processedChunkCount:this.processedChunkCount,scheduledCount:this.scheduledCount,playedBufferCount:this.playedBufferCount,generationComplete:this.generationComplete,durationFromUrlSet:this.durationFromUrlSet}),this.isPlaying=!1,this.pausedAt=0,this.startedAt=0,this.stopTimeUpdate(),this.stopAutoPlayCheck(),this.iosUnlockAudio)try{this.iosUnlockAudio.pause(),Y("[handlePlaybackEnd] iOS audio 元素已暂停")}catch{}this.onEndCallback&&this.onEndCallback()}async markGenerationComplete(t){let r=0;this.audioQueue.forEach(n=>{r+=n.duration}),Y("[markGenerationComplete] 标记生成完成",{audioQueueLength:this.audioQueue.length,pendingChunks:this.pendingChunks.length,scheduledSourcesLength:this.scheduledSources.length,totalDuration:this.totalDuration.toFixed(2),currentDecodedDuration:r.toFixed(2),estimatedDuration:this.estimatedDuration.toFixed(2),isPlaying:this.isPlaying,hasAudioUrl:!!t,processedChunkCount:this.processedChunkCount}),this.generationComplete=!0,t&&(this.fullAudioUrl=t),this.isPlaying&&this.pendingChunks.length>0&&(Y("[markGenerationComplete] 正在播放,触发按需解码"),this.decodeAhead()),this.autoPlayCheckInterval&&this.scheduledSources.length===0&&this.pendingChunks.length===0&&(Y("[markGenerationComplete] 正在等待且无剩余片段,立即结束"),this.handlePlaybackEnd()),t?this.getDurationFromUrl(t):this.onDurationChangeCallback&&this.onDurationChangeCallback(this.getDisplayDuration())}getDurationFromUrl(t){Y("[getDurationFromUrl] 开始从 URL 获取时长并预加载",{audioUrl:t}),this.preloadedAudioElement=new Audio,this.preloadedAudioElement.preload="auto";const r=this.preloadedAudioElement;let n=!1;const i=()=>{if(n)return;n=!0;const s=r.duration;Y("[getDurationFromUrl] 获取时长成功",{duration:s.toFixed(2)}),this.totalDuration=s,this.estimatedDuration=0,this.durationFromUrlSet=!0,this.onDurationChangeCallback&&this.onDurationChangeCallback(Math.floor(s))},a=()=>{Y("[getDurationFromUrl] URL 预加载完成,可以 seek"),this.urlReady=!0,this.onUrlReadyCallback&&this.onUrlReadyCallback()},o=s=>{Y("[getDurationFromUrl] 获取时长/预加载失败",s),this.urlReady=!0,this.preloadedAudioElement=null,this.onDurationChangeCallback&&!n&&this.onDurationChangeCallback(this.getDisplayDuration()),this.onUrlReadyCallback&&this.onUrlReadyCallback()};r.addEventListener("loadedmetadata",i),r.addEventListener("canplay",a),r.addEventListener("canplaythrough",a),r.addEventListener("error",o),r.src=t,r.load()}async decodeAllPendingChunks(){for(Y("[decodeAllPendingChunks] 开始解码所有待解码 chunk",{pendingChunks:this.pendingChunks.length});this.pendingChunks.length>0;){const t=this.pendingChunks.shift(),r=this.processedChunkCount+1;try{const n=(t.length*.75/1024).toFixed(2);Y(`[decodeAllPendingChunks] 解码第 ${r} 个chunk`,{size:`${n} KB`});const i=window.atob(t),a=new Uint8Array(i.length);for(let s=0;s<i.length;s++)a[s]=i.charCodeAt(s);const o=a.buffer;await this.addAudioChunkInternal(o),this.processedChunkCount++,Y(`[decodeAllPendingChunks] 第 ${r} 个chunk 解码完成`,{totalDuration:this.totalDuration.toFixed(2)})}catch(n){console.error(`[decodeAllPendingChunks] 解码第 ${r} 个chunk 失败:`,n)}}Y("[decodeAllPendingChunks] 所有 chunk 解码完成",{audioQueueLength:this.audioQueue.length,totalDuration:this.totalDuration.toFixed(2)})}cleanupOldBuffers(){const t=this.audioQueue.length;if(Y("[cleanupOldBuffers] 检查",{currentQueueLength:t,maxDecodedBuffers:this.maxDecodedBuffers,playedBufferCount:this.playedBufferCount,scheduledCount:this.scheduledCount,pendingChunks:this.pendingChunks.length,totalDuration:this.totalDuration.toFixed(2)}),t>this.maxDecodedBuffers&&this.playedBufferCount>0){const r=Math.min(t-this.maxDecodedBuffers,this.playedBufferCount);if(r>0){let n=0;for(let o=0;o<r;o++)n+=this.audioQueue[o].duration;const i=this.audioQueue.splice(0,r);this.scheduledCount=Math.max(0,this.scheduledCount-r),this.playedBufferCount=Math.max(0,this.playedBufferCount-r);let a=0;i.forEach(o=>{a+=o.length*o.numberOfChannels*4/1024}),Y("[cleanupOldBuffers] 内存回收",{cleanedCount:r,cleanedDuration:n.toFixed(2),freedMemoryKB:a.toFixed(2),remainingQueueLength:this.audioQueue.length,newScheduledCount:this.scheduledCount,newPlayedBufferCount:this.playedBufferCount,isMobile:this.isMobileDevice()})}}}startAutoPlayCheck(){if(this.autoPlayCheckInterval){Y("[startAutoPlayCheck] 已有检查定时器,跳过");return}Y("[startAutoPlayCheck] 启动等待新数据检查"),this.autoPlayCheckWaitTime=0;const t=180*1e3;this.autoPlayCheckInterval=window.setInterval(()=>{this.autoPlayCheckWaitTime+=200,Y("[autoPlayCheck] 检查",{waitTime:this.autoPlayCheckWaitTime,scheduledCount:this.scheduledCount,audioQueueLength:this.audioQueue.length,pendingChunks:this.pendingChunks.length,generationComplete:this.generationComplete,scheduledSourcesLength:this.scheduledSources.length}),this.scheduledCount<this.audioQueue.length?(Y("[autoPlayCheck] 发现新片段,调度"),this.scheduleNewChunks(),this.scheduledSources.length>0&&(Y("[autoPlayCheck] 调度成功,停止检查"),this.stopAutoPlayCheck())):this.scheduledSources.length>0?(Y("[autoPlayCheck] 还有片段在播放中,停止检查"),this.stopAutoPlayCheck()):this.pendingChunks.length>0?(Y("[autoPlayCheck] 还有待解码chunk,触发解码"),this.decodeAhead()):this.generationComplete?(Y("[autoPlayCheck] 生成完成且无播放片段和待解码chunk,结束播放"),this.handlePlaybackEnd()):this.autoPlayCheckWaitTime>=t&&(Y("[autoPlayCheck] 等待超时,结束播放"),this.handlePlaybackEnd())},200)}stopAutoPlayCheck(){this.autoPlayCheckInterval&&(clearInterval(this.autoPlayCheckInterval),this.autoPlayCheckInterval=null)}startTimeUpdate(){this.timeUpdateInterval||(this.timeUpdateInterval=window.setInterval(()=>{if(this.isPlaying&&this.audioContext){const t=this.audioContext.currentTime-this.startedAt;this.onTimeUpdateCallback&&this.onTimeUpdateCallback(t,this.totalDuration)}},100))}stopTimeUpdate(){this.timeUpdateInterval&&(clearInterval(this.timeUpdateInterval),this.timeUpdateInterval=null)}seek(t){if(Y("[seek] 开始",{time:t,playMode:this.playMode,generationComplete:this.generationComplete,urlReady:this.urlReady,hasPreloadedAudio:!!this.preloadedAudioElement,isPlaying:this.isPlaying}),this.playMode==="url"&&this.audioElement){this.audioElement.currentTime=Math.max(0,Math.min(t,this.audioElement.duration||0));return}if(this.playMode==="stream"){if(this.generationComplete&&this.urlReady&&this.preloadedAudioElement){Y("[seek] 切换到 URL 模式(使用预加载的 audio 元素)");const n=this.isPlaying;this.stopTimeUpdate();for(const i of this.scheduledSources)try{i.stop()}catch{}this.scheduledSources=[],this.isPlaying=!1,this.audioElement=this.preloadedAudioElement,this.preloadedAudioElement=null,this.playMode="url",this.bindAudioElementEvents(),this.audioElement.currentTime=Math.max(0,Math.min(t,this.audioElement.duration||0)),n&&this.audioElement.play().catch(i=>{Y("[seek] 播放失败:",i)});return}const r=this.isPlaying;r&&this.pause(),this.pausedAt=Math.max(0,Math.min(t,this.totalDuration)),r&&this.play()}}bindAudioElementEvents(){this.audioElement&&(this.audioElement.addEventListener("play",()=>{this.isPlaying=!0,this.onPlayCallback&&this.onPlayCallback()}),this.audioElement.addEventListener("pause",()=>{this.isPlaying=!1,this.onPauseCallback&&this.onPauseCallback()}),this.audioElement.addEventListener("ended",()=>{this.isPlaying=!1,this.onEndCallback&&this.onEndCallback()}),this.audioElement.addEventListener("timeupdate",()=>{this.onTimeUpdateCallback&&this.onTimeUpdateCallback(this.audioElement.currentTime,this.audioElement.duration||0)}),this.audioElement.addEventListener("error",t=>{this.onErrorCallback&&this.onErrorCallback(new Error("音频加载失败: "+(t.message||"未知错误")))}))}getPlayState(){return this.isPlaying}getDuration(){return this.playMode==="url"&&this.audioElement?this.audioElement.duration||0:this.getDisplayDuration()}getCurrentTime(){return this.playMode==="url"&&this.audioElement?this.audioElement.currentTime||0:this.isPlaying&&this.audioContext?this.audioContext.currentTime-this.startedAt:this.pausedAt}getAudioQueue(){return[...this.audioQueue]}async getAudioData(){const t=[];for(const r of this.audioQueue){const n=r.numberOfChannels,i=r.length,a=new ArrayBuffer(i*n*2),o=new DataView(a);for(let s=0;s<n;s++){const u=r.getChannelData(s);for(let l=0;l<i;l++){const c=Math.max(-1,Math.min(1,u[l])),f=c<0?c*32768:c*32767;o.setInt16((l*n+s)*2,f,!0)}}t.push(a)}return t}onPlay(t){this.onPlayCallback=t}onPause(t){this.onPauseCallback=t}onEnd(t){this.onEndCallback=t}onError(t){this.onErrorCallback=t}onTimeUpdate(t){this.onTimeUpdateCallback=t}onDurationChange(t){this.onDurationChangeCallback=t}onUrlReady(t){this.onUrlReadyCallback=t}isUrlReady(){return this.urlReady}destroy(){this.stop(),this.stopTimeUpdate(),this.stopAutoPlayCheck(),this.handleVisibilityChange&&(document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.handleVisibilityChange=null),this.audioContext&&(this.audioContext.onstatechange=null,this.audioContext.close(),this.audioContext=null),this.audioQueue=[],this.iosUnlockAudio&&(this.iosUnlockAudio.pause(),this.iosUnlockAudio.srcObject=null,this.iosUnlockAudio=null),this.mediaStreamDestination=null,this.audioElement&&(this.audioElement.pause(),this.audioElement.src="",this.audioElement=null),this.playMode=null}},of="https://cdn.xiaowei.qq.com/adp/assets/static/iconfont-XzKaDZdEa7j2GPL-1201.js",zu={};function sO(e){const t={};return e.props.size&&(t.width=`${e.props.size}px`,t.height=`${e.props.size}px`),e.props.valign&&(t.verticalAlign=`${e.props.valign}px`),e.props.rotate&&(t.transform=`rotate(${e.props.rotate}deg)`),t}function uO(e){const t=e.props;return{"v-icon":!0,"is-horizontal":t.flip==="horizontal","is-vertical":t.flip==="vertical","v-icon--stroke":t.useStroke,"v-icon--fill":!t.useStroke}}function Wb(e){let t=document.createElement("script");t.type="text/javascript",t.src=e,document.getElementsByTagName("head")[0].appendChild(t)}const lO=e=>{let t=!1,r=Object.keys(zu);r.forEach(n=>{zu[n]===e&&(t=!0)}),t||(zu[r.length]=e,Wb(e))},cO={name:"VIcon",functional:!0,props:{name:{type:String,required:!0},remote:{type:Boolean,default:!1},remoteSrc:{type:String,default:""},remotePrefix:{type:String,default:"v-"},loadDefaultRemoteIcons:{type:Boolean,default:!0},label:String,rotate:[Number,String],size:[Number,String],valign:[Number,String],flip:String,useStroke:Boolean,clazz:String,scoped:String},render(e,t){const r=sO(t);if(t.data.style)for(let n in t.data.style)r[n]=t.data.style[n];return!zu.defaultRemoteSrc&&of&&t.props.loadDefaultRemoteIcons&&(zu.defaultRemoteSrc=of,Wb(of)),t.props.remoteSrc&&lO(t.props.remoteSrc),e("svg",{class:uO(t),style:r,attrs:{role:t.props.label?"img":"presentation","aria-label":t.props.label},on:t.data.nativeOn},[e("use",{attrs:{"xlink:href":"#"+t.props.remotePrefix+t.props.name,class:t.props.clazz},style:{pointerEvents:"none"}})])}},fO=cO,hO=null,dO=null;var pO=pr(fO,hO,dO,!1,null,null,null,null);const t2=pO.exports;const vO={name:"StreamAudioPlayer",components:{VIcon:t2},props:{audioData:{type:Object,required:!0}},data(){return{player:null,internalStatus:"pending",currentTime:0,duration:0,isDragging:!1,isHoveringProgress:!1,lastProcessedChunkCount:0,playModeDecided:!1,lastKnownIsComplete:!1,urlReady:!1,dragCleanup:null}},computed:{isGenerating(){return!this.audioData.isComplete},hasPlayableContent(){const e=!!this.audioData.audio_url,t=this.audioData.audio_data&&this.audioData.audio_data.length>0;return e||t},isDisabled(){return!this.hasPlayableContent},canSeek(){return!this.isGenerating&&this.urlReady},displayFileName(){return this.audioData.title?this.audioData.title:this.isGenerating?"音频生成中...":"音频文件"},statusText(){if(this.isDisabled)return"暂无音频";if(this.isGenerating&&this.duration===0)return"生成中...";const e=this.formatTime(this.currentTime),t=this.isGenerating?"生成中":this.formatTime(this.duration);return`${e} / ${t}`},statusClass(){return{generating:this.isGenerating,completed:this.internalStatus==="completed",playing:this.internalStatus==="playing",paused:this.internalStatus==="paused",disabled:this.isDisabled}},cardClass(){return{generating:this.isGenerating,completed:this.internalStatus==="completed",playing:this.internalStatus==="playing",paused:this.internalStatus==="paused",disabled:this.isDisabled,hoverable:!this.isDisabled&&!this.isGenerating}},progressPercentage(){return this.duration===0?0:this.currentTime/this.duration*100},showHandle(){return(this.isHoveringProgress||this.isDragging)&&!this.isDisabled&&!this.isGenerating},canPlay(){return!(this.isDisabled||this.isGenerating&&this.duration===0)},canDownload(){return!!this.audioData.audio_url},playButtonTitle(){return this.isDisabled?"暂无音频":this.isGenerating&&this.duration===0?"等待音频生成":this.internalStatus==="playing"?"暂停":"播放"},downloadButtonTitle(){return this.canDownload?"下载":this.isGenerating?"生成中,暂不可下载":"暂无可下载的音频"}},watch:{audioData:{handler(e){var r;if(!e||!this.player)return;console.log("[StreamAudioPlayer] audioData watch 触发:",{hasAudioUrl:!!e.audio_url,audioDataLength:(r=e.audio_data)==null?void 0:r.length,isComplete:e.isComplete,playModeDecided:this.playModeDecided,lastProcessedChunkCount:this.lastProcessedChunkCount,lastKnownIsComplete:this.lastKnownIsComplete,internalStatus:this.internalStatus}),!this.playModeDecided&&e.audio_url&&(console.log("[StreamAudioPlayer] 切换到 URL 模式"),this.handleAudioUrlChange(e.audio_url)),e.audio_data&&Array.isArray(e.audio_data)&&e.audio_data.length>this.lastProcessedChunkCount&&(!this.playModeDecided||this.player.playMode==="stream")&&(console.log("[StreamAudioPlayer] 处理新的音频片段"),this.handleAudioDataChange(e.audio_data)),!!e.isComplete&&!this.lastKnownIsComplete&&(this.lastKnownIsComplete=!0,this.handleGenerationComplete())},deep:!0,immediate:!1}},mounted(){this.initPlayer(),this.audioData&&(this.audioData.audio_data&&this.audioData.audio_data.length>0?this.handleAudioDataChange(this.audioData.audio_data):this.audioData.audio_url&&this.handleAudioUrlChange(this.audioData.audio_url),this.audioData.isComplete&&(this.lastKnownIsComplete=!0,this.handleGenerationComplete()))},beforeDestroy(){this.destroyPlayer()},beforeUnmount(){this.destroyPlayer()},methods:{initPlayer(){this.player=new Ub,this.player.onPlay(()=>{this.internalStatus="playing",this.$emit("play",this.audioData)}),this.player.onPause(()=>{this.internalStatus="paused",this.$emit("pause",this.audioData)}),this.player.onEnd(()=>{this.player.playMode==="url"?this.internalStatus="completed":this.isGenerating?this.internalStatus="paused":this.internalStatus="completed",this.currentTime=0,this.$emit("end",this.audioData)}),this.player.onTimeUpdate((e,t)=>{this.isDragging||(this.currentTime=e),this.duration=t,e>=t&&t>0&&!this.isGenerating&&(this.player.pause(),this.internalStatus="completed",this.currentTime=t)}),this.player.onDurationChange(e=>{this.duration=e}),this.player.onError(e=>{console.error("音频播放错误:",e),this.$emit("error",e)}),this.player.onUrlReady(()=>{console.log("[StreamAudioPlayer.vue] URL 预加载完成回调"),this.urlReady=!0}),this.checkInitialState()},checkInitialState(){this.isDisabled?this.internalStatus="disabled":this.isGenerating?this.internalStatus="generating":this.internalStatus="completed"},handleAudioUrlChange(e){!this.player||!e||this.playModeDecided&&this.player.playMode!=="url"||(this.player.setAudioUrl(e),this.playModeDecided=!0,this.internalStatus="completed")},handleAudioDataChange(e){var r,n,i,a,o;if(!this.player||!e)return;this.playModeDecided=!0;const t=e.length-this.lastProcessedChunkCount;if(console.log("[StreamAudioPlayer.vue] handleAudioDataChange",{totalChunks:e.length,lastProcessedChunkCount:this.lastProcessedChunkCount,newChunksCount:t,playerPendingChunks:(r=this.player.pendingChunks)==null?void 0:r.length,playerAudioQueueLength:(n=this.player.audioQueue)==null?void 0:n.length,playerScheduledCount:this.player.scheduledCount,playerIsPlaying:this.player.isPlaying,internalStatus:this.internalStatus}),t<=0){console.log("[StreamAudioPlayer.vue] 没有新片段,跳过");return}(this.internalStatus==="disabled"||this.internalStatus==="pending")&&(this.internalStatus="generating");for(let s=this.lastProcessedChunkCount;s<e.length;s++){const u=e[s];console.log(`[StreamAudioPlayer.vue] 添加第 ${s+1} 个chunk,大小: ${(u.length*.75/1024).toFixed(2)} KB`),this.player.addBase64Chunk(u),this.lastProcessedChunkCount++,this.$emit("chunk-added",{duration:this.duration,queueLength:((i=this.player.pendingChunks)==null?void 0:i.length)||0})}console.log("[StreamAudioPlayer.vue] handleAudioDataChange 完成",{lastProcessedChunkCount:this.lastProcessedChunkCount,playerPendingChunks:(a=this.player.pendingChunks)==null?void 0:a.length,playerAudioQueueLength:(o=this.player.audioQueue)==null?void 0:o.length})},handleGenerationComplete(){var e,t,r,n,i,a,o;console.log("[StreamAudioPlayer.vue] handleGenerationComplete",{playerAudioQueueLength:(t=(e=this.player)==null?void 0:e.audioQueue)==null?void 0:t.length,playerPendingChunks:(n=(r=this.player)==null?void 0:r.pendingChunks)==null?void 0:n.length,playerTotalDuration:(a=(i=this.player)==null?void 0:i.totalDuration)==null?void 0:a.toFixed(2),playerScheduledCount:(o=this.player)==null?void 0:o.scheduledCount,internalStatus:this.internalStatus,hasAudioUrl:!!this.audioData.audio_url}),this.player&&this.player.markGenerationComplete(this.audioData.audio_url),this.player&&(this.duration=this.player.getDuration(),console.log("[StreamAudioPlayer.vue] 最终时长:",this.duration.toFixed(2))),this.internalStatus!=="playing"&&(this.internalStatus="completed"),this.audioData.audio_url||(this.urlReady=!0)},async addAudioChunk(e){var t;if(!this.player){console.warn("播放器未初始化");return}try{typeof e=="string"?await this.player.addBase64Chunk(e):await this.player.addAudioChunk(e),this.$emit("chunk-added",{duration:this.duration,queueLength:((t=this.player.audioQueue)==null?void 0:t.length)||0})}catch(r){console.error("添加音频片段失败:",r),this.$emit("error",r)}},markGenerationComplete(){this.handleGenerationComplete()},async handlePlayPause(){if(!(!this.player||!this.canPlay))try{this.internalStatus==="playing"?this.player.pause():(this.currentTime>=this.duration&&this.duration>0&&(this.currentTime=0,this.player.pausedAt=0),await this.player.play())}catch(e){console.error("播放控制错误:",e)}},handleDownload(){if(!this.canDownload)return;const e=this.audioData.audio_url,t=this.audioData.title||"音频文件",r=document.createElement("a");r.href=e,r.download=t,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),this.$emit("audio-download",{url:e,fileName:t})},formatTime(e){if(!e||isNaN(e))return"00:00";const t=Math.floor(e/60),r=Math.floor(e%60);return`${t.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`},handleMouseEnter(){},handleMouseLeave(){},handleProgressMouseEnter(){!this.isDisabled&&!this.isGenerating&&(this.isHoveringProgress=!0)},handleProgressMouseLeave(){this.isDragging||(this.isHoveringProgress=!1)},handleProgressMouseDown(e){this.isDisabled||!this.canSeek||this.seekToPosition(e)},handleDragStart(e){if(this.isDisabled||!this.canSeek)return;this.isDragging=!0,e.preventDefault();const t=n=>{this.seekToPosition(n)},r=()=>{this.isDragging=!1,this.isHoveringProgress||(this.isHoveringProgress=!1),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r),this.dragCleanup=null};this.dragCleanup=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r)},document.addEventListener("mousemove",t),document.addEventListener("mouseup",r)},seekToPosition(e){if(!this.player||!this.$refs.progressTrack)return;const r=this.$refs.progressTrack.getBoundingClientRect(),n=e.clientX-r.left,a=Math.max(0,Math.min(1,n/r.width))*this.duration;this.currentTime=a,this.player.seek(a)},destroyPlayer(){this.dragCleanup&&(this.dragCleanup(),this.dragCleanup=null),this.player&&(this.player.destroy(),this.player=null),this.internalStatus="pending",this.currentTime=0,this.duration=0,this.lastProcessedChunkCount=0,this.playModeDecided=!1,this.urlReady=!1,this.lastKnownIsComplete=!1}}};var gO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"stream-audio-player-card",class:t.cardClass,on:{mouseenter:t.handleMouseEnter,mouseleave:t.handleMouseLeave}},[r("div",{staticClass:"audio-content"},[r("div",{staticClass:"audio-icon"},[r("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"34",viewBox:"0 0 30 34",fill:"none"}},[r("path",{staticStyle:{fill:"color(display-p3 0.9569 0.9333 0.9882)","fill-opacity":"1"},attrs:{d:"M1.55782e-06 5.33333C1.66168e-06 3.46649 1.71361e-06 2.53307 0.363313 1.82003C0.682891 1.19282 1.19283 0.682889 1.82003 0.363312C2.53307 1.40931e-07 3.46649 1.92863e-07 5.33334 2.96727e-07L21.1242 1.17527e-06C21.9395 1.22063e-06 22.3472 1.24331e-06 22.7308 0.0921015C23.0709 0.173757 23.396 0.308438 23.6943 0.491201C24.0307 0.69734 24.3189 0.985593 24.8954 1.5621L28.4379 5.10457C29.0144 5.68108 29.3027 5.96933 29.5088 6.30572C29.6916 6.60396 29.8262 6.92911 29.9079 7.26923C30 7.65285 30 8.0605 30 8.87581L30 28C30 29.8668 30 30.8003 29.6367 31.5133C29.3171 32.1405 28.8072 32.6504 28.18 32.97C27.4669 33.3333 26.5335 33.3333 24.6667 33.3333L5.33333 33.3333C3.46649 33.3333 2.53307 33.3333 1.82003 32.97C1.19282 32.6504 0.68289 32.1405 0.363312 31.5133C1.40931e-07 30.8003 1.92863e-07 29.8668 2.96727e-07 28L1.55782e-06 5.33333Z",fill:"#F4EEFC"}}),r("path",{staticStyle:{fill:"color(display-p3 0.8863 0.8353 0.9725)","fill-opacity":"1"},attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M29.1667 28L29.1667 8.87581C29.1667 8.02084 29.1613 7.72918 29.0976 7.46377C29.0364 7.20868 28.9353 6.96481 28.7983 6.74113C28.6557 6.5084 28.4532 6.29838 27.8487 5.69383L24.3062 2.15135C23.7016 1.5468 23.4916 1.34435 23.2589 1.20173C23.0352 1.06466 22.7913 0.963651 22.5362 0.90241C22.2708 0.83869 21.9792 0.833334 21.1242 0.833334L5.33334 0.833333C4.38616 0.833333 3.7259 0.833981 3.21187 0.87598C2.70756 0.917183 2.41782 0.993995 2.19836 1.10582C1.72795 1.3455 1.3455 1.72795 1.10582 2.19836C0.993997 2.41782 0.917185 2.70756 0.875981 3.21187C0.833983 3.7259 0.833335 4.38616 0.833335 5.33333L0.833334 28C0.833334 28.9472 0.833982 29.6074 0.87598 30.1215C0.917183 30.6258 0.993995 30.9155 1.10582 31.135C1.3455 31.6054 1.72795 31.9878 2.19836 32.2275C2.41782 32.3393 2.70756 32.4161 3.21187 32.4573C3.7259 32.4993 4.38616 32.5 5.33333 32.5L24.6667 32.5C25.6138 32.5 26.2741 32.4993 26.7881 32.4573C27.2924 32.4161 27.5822 32.3393 27.8016 32.2275C28.2721 31.9878 28.6545 31.6054 28.8942 31.135C29.006 30.9155 29.0828 30.6258 29.124 30.1215C29.166 29.6074 29.1667 28.9472 29.1667 28ZM0.363313 1.82003C1.71361e-06 2.53307 1.66168e-06 3.46649 1.55782e-06 5.33333L2.96727e-07 28C1.92863e-07 29.8668 1.40931e-07 30.8003 0.363312 31.5133C0.68289 32.1405 1.19282 32.6504 1.82003 32.97C2.53307 33.3333 3.46649 33.3333 5.33333 33.3333L24.6667 33.3333C26.5335 33.3333 27.4669 33.3333 28.18 32.97C28.8072 32.6504 29.3171 32.1405 29.6367 31.5133C30 30.8003 30 29.8668 30 28L30 8.87581C30 8.0605 30 7.65285 29.9079 7.26923C29.8262 6.92911 29.6916 6.60396 29.5088 6.30572C29.3027 5.96933 29.0144 5.68108 28.4379 5.10457L24.8954 1.5621C24.3189 0.985593 24.0307 0.69734 23.6943 0.491201C23.396 0.308438 23.0709 0.173757 22.7308 0.0921015C22.3472 1.24331e-06 21.9395 1.22063e-06 21.1242 1.17527e-06L5.33334 2.96727e-07C3.46649 1.92863e-07 2.53307 1.40931e-07 1.82003 0.363312C1.19283 0.682889 0.682891 1.19282 0.363313 1.82003Z",fill:"#E2D5F8"}}),r("path",{staticStyle:{fill:"color(display-p3 0.4157 0.2706 0.8980)","fill-opacity":"1"},attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M22.1277 22.689L22.129 8.92249L10.0345 10.5529L10.0335 22.0895C9.69971 21.9846 9.34054 21.9276 8.96638 21.9276C7.19825 21.9276 5.76489 23.2017 5.76489 24.7734C5.76489 26.345 7.19825 27.6191 8.96638 27.6191C10.7157 27.6191 12.1374 26.3719 12.1674 24.8233L12.1676 24.8233L12.1676 24.8123L12.1679 24.7734L12.1676 24.7347L12.168 13.7622L19.9939 12.5435L19.9935 19.9543C19.6596 19.8493 19.3001 19.7922 18.9257 19.7922C17.1576 19.7922 15.7242 21.0663 15.7242 22.6379C15.7242 24.2096 17.1576 25.4837 18.9257 25.4837C20.6746 25.4837 22.096 24.2371 22.1267 22.689L22.1277 22.689Z",fill:"#6A45E5"}})])]),r("div",{staticClass:"file-info"},[r("div",{staticClass:"file-name",attrs:{title:t.displayFileName}},[t._v(t._s(t.displayFileName))]),r("div",{staticClass:"file-status"},[r("span",{staticClass:"status-text",class:t.statusClass},[t._v(" "+t._s(t.statusText)+" ")])])]),r("div",{staticClass:"audio-controls"},[r("button",{staticClass:"control-btn download-btn",attrs:{disabled:!t.canDownload,title:t.downloadButtonTitle},on:{click:t.handleDownload}},[r("v-icon",{attrs:{name:"basic_download2_line",size:18}})],1),r("button",{staticClass:"control-btn play-btn",attrs:{disabled:!t.canPlay,title:t.playButtonTitle},on:{click:t.handlePlayPause}},[t.internalStatus==="playing"?r("v-icon",{attrs:{name:"basic_pause_line",size:18}}):r("v-icon",{attrs:{name:"basic_play_line",size:18}})],1)])]),r("div",{staticClass:"progress-container"},[r("div",{ref:"progressTrack",staticClass:"progress-track",on:{mousedown:t.handleProgressMouseDown,mouseenter:t.handleProgressMouseEnter,mouseleave:t.handleProgressMouseLeave}},[t.isGenerating?t._e():r("div",{staticClass:"progress-played",class:{"no-transition":t.isDragging},style:{width:t.progressPercentage+"%"}}),t.showHandle?r("div",{staticClass:"progress-handle",class:{"no-transition":t.isDragging},style:{left:t.progressPercentage+"%"},on:{mousedown:function(n){return n.stopPropagation(),t.handleDragStart.apply(null,arguments)}}}):t._e()])])])},mO=[],yO=pr(vO,gO,mO,!1,null,"c74077bd",null,null);const qb=yO.exports;const _O={name:"ClassifyTag",props:{title:{type:String,default:"问题澄清"},questions:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},defaultAnswers:{type:Array,default:()=>[]}},data(){return{collapsed:!1,selectedAnswers:{},submitted:!1}},watch:{defaultAnswers:{handler(e){e&&e.length>0&&this._applyDefaultAnswers(e)},immediate:!0}},computed:{normalizedQuestions(){return!this.questions||!this.questions.length?[]:this.questions.map((e,t)=>({id:e.id!==void 0?e.id:t,text:e.text||e.question||"",options:(e.options||[]).map(r=>typeof r=="string"?{label:r,description:""}:{label:r.label||r.Label||"",description:r.description||r.Description||""})}))},allAnswered(){return!this.normalizedQuestions||this.normalizedQuestions.length===0?!1:this.normalizedQuestions.every(e=>{const t=e.id;return this.selectedAnswers[t]!==void 0})}},methods:{_applyDefaultAnswers(e){e.forEach(t=>{t.questionId!==void 0&&t.selectedIndex!==void 0&&this.$set(this.selectedAnswers,t.questionId,t.selectedIndex)}),this.submitted=!0},toggleCollapse(){this.collapsed=!this.collapsed},selectOption(e,t){this.submitted||this.disabled||this.$set(this.selectedAnswers,e,t)},handleSubmit(){if(!this.allAnswered||this.submitted)return;this.submitted=!0;const e=this.normalizedQuestions.map(t=>{const r=this.selectedAnswers[t.id],n=t.options[r];return{questionId:String(t.id),questionText:t.text,selectedOption:n?n.label:"",selectedIndex:r}});this.$emit("submit",e)},handleSkip(){this.submitted||this.$emit("skip")}}};var bO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"classify-tag",class:{"classify-tag--collapsed":t.collapsed}},[r("div",{staticClass:"classify-tag__header",on:{click:t.toggleCollapse}},[r("svg",{staticClass:"classify-tag__icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15C11.866 15 8 15 8 15",stroke:"#4A70FF","stroke-width":"1.5","stroke-linecap":"round",fill:"none"}}),r("path",{attrs:{d:"M8 5V8.5",stroke:"#4A70FF","stroke-width":"1.5","stroke-linecap":"round"}}),r("circle",{attrs:{cx:"8",cy:"11",r:"0.75",fill:"#4A70FF"}}),r("path",{attrs:{d:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1Z",stroke:"#4A70FF","stroke-width":"1.5",fill:"none"}})]),r("span",{staticClass:"classify-tag__title"},[t._v(t._s(t.title))]),r("svg",{staticClass:"classify-tag__arrow",class:{"classify-tag__arrow--up":!t.collapsed},attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M4 6L8 10L12 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.collapsed,expression:"!collapsed"}],staticClass:"classify-tag__content"},t._l(t.normalizedQuestions,function(n,i){return r("div",{key:n.id||i,staticClass:"classify-tag__question-group"},[r("div",{staticClass:"classify-tag__question-text"},[t._v(" "+t._s(i+1)+"、"+t._s(n.text)+" ")]),r("div",{staticClass:"classify-tag__options"},t._l(n.options,function(a,o){return r("label",{key:o,staticClass:"classify-tag__radio",class:{"classify-tag__radio--checked":t.selectedAnswers[n.id||i]===o,"classify-tag__radio--rich":a.description},on:{click:function(s){return t.selectOption(n.id||i,o)}}},[r("span",{staticClass:"classify-tag__radio-circle"},[t.selectedAnswers[n.id||i]===o?r("span",{staticClass:"classify-tag__radio-dot"}):t._e()]),r("span",{staticClass:"classify-tag__radio-content"},[r("span",{staticClass:"classify-tag__radio-label"},[t._v(t._s(a.label))]),a.description?r("span",{staticClass:"classify-tag__radio-desc"},[t._v(t._s(a.description))]):t._e()])])}),0)])}),0),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.collapsed,expression:"!collapsed"}],staticClass:"classify-tag__footer"},[r("div",{staticClass:"classify-tag__footer-divider"}),r("div",{staticClass:"classify-tag__footer-actions"},[r("button",{staticClass:"classify-tag__btn classify-tag__btn--primary",attrs:{disabled:!t.allAnswered||t.submitted},on:{click:t.handleSubmit}},[t._v(" "+t._s(t.submitted?"已提交":"提交")+" ")]),t.submitted?t._e():r("button",{staticClass:"classify-tag__btn classify-tag__btn--secondary",on:{click:t.handleSkip}},[t._v(" 跳过 ")])])])])},xO=[],wO=pr(_O,bO,xO,!1,null,"e1815cc5",null,null);const r2=wO.exports;const SO={name:"PlanConfirm",props:{title:{type:String,default:"计划确认"},planText:{type:String,default:""},disabled:{type:Boolean,default:!1}},data(){return{collapsed:!1,confirmed:!1,skipped:!1}},methods:{toggleCollapse(){this.collapsed=!this.collapsed},handleConfirm(){this.confirmed||this.skipped||this.disabled||(this.confirmed=!0,this.$emit("confirm",this.planText))},handleSkip(){this.confirmed||this.skipped||this.disabled||(this.skipped=!0,this.$emit("skip",this.planText))}}};var CO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"plan-confirm",class:{"plan-confirm--collapsed":t.collapsed}},[r("div",{staticClass:"plan-confirm__header",on:{click:t.toggleCollapse}},[r("svg",{staticClass:"plan-confirm__icon",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M13.5 5.5L6.5 12.5L2.5 8.5",stroke:"#4A70FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}),r("rect",{attrs:{x:"1",y:"1",width:"14",height:"14",rx:"2",stroke:"#4A70FF","stroke-width":"1.5",fill:"none"}})]),r("span",{staticClass:"plan-confirm__title"},[t._v(t._s(t.title))]),r("svg",{staticClass:"plan-confirm__arrow",class:{"plan-confirm__arrow--up":!t.collapsed},attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M4 6L8 10L12 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}})])]),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.collapsed,expression:"!collapsed"}],staticClass:"plan-confirm__content"},[r("div",{staticClass:"plan-confirm__text"},[t._v(t._s(t.planText))])]),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.collapsed,expression:"!collapsed"}],staticClass:"plan-confirm__footer"},[r("div",{staticClass:"plan-confirm__footer-divider"}),r("div",{staticClass:"plan-confirm__footer-actions"},[!t.confirmed&&!t.skipped?r("button",{staticClass:"plan-confirm__btn plan-confirm__btn--primary",on:{click:t.handleConfirm}},[t._v(" 确定 ")]):t._e(),t.confirmed?r("button",{staticClass:"plan-confirm__btn plan-confirm__btn--primary",attrs:{disabled:""}},[t._v(" 已确定 ")]):t._e(),!t.confirmed&&!t.skipped?r("button",{staticClass:"plan-confirm__btn plan-confirm__btn--secondary",on:{click:t.handleSkip}},[t._v(" 跳过 ")]):t._e(),t.skipped?r("button",{staticClass:"plan-confirm__btn plan-confirm__btn--secondary",attrs:{disabled:""}},[t._v(" 已跳过 ")]):t._e()])])])},AO=[],TO=pr(SO,CO,AO,!1,null,"99c3033c",null,null);const DO=TO.exports;let v1;const EO=new Uint8Array(16);function kO(){if(!v1&&(v1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!v1))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return v1(EO)}const St=[];for(let e=0;e<256;++e)St.push((e+256).toString(16).slice(1));function MO(e,t=0){return St[e[t+0]]+St[e[t+1]]+St[e[t+2]]+St[e[t+3]]+"-"+St[e[t+4]]+St[e[t+5]]+"-"+St[e[t+6]]+St[e[t+7]]+"-"+St[e[t+8]]+St[e[t+9]]+"-"+St[e[t+10]]+St[e[t+11]]+St[e[t+12]]+St[e[t+13]]+St[e[t+14]]+St[e[t+15]]}const LO=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),iv={randomUUID:LO};function Zb(e,t,r){if(iv.randomUUID&&!t&&!e)return iv.randomUUID();e=e||{};const n=e.random||(e.rng||kO)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return MO(n)}const IO=["Basic","Card","ListView","ListViewItem","Badge","Box","Row","Col","Button","Caption","Chart","Checkbox","DatePicker","Divider","Form","Icon","Image","Input","Label","Markdown","RadioGroup","Select","Spacer","Text","Textarea","Title","Transition","Video","Audio","Countdown","Clickable","ImageSelect"];class PO{constructor(){this.worker=null,this.callbacks=new Map,this.initializing=!1,this.initPromise=null,this.blobUrl=null}async init(){return this.worker?Promise.resolve():this.initializing&&this.initPromise?this.initPromise:(this.initializing=!0,this.initPromise=new Promise((t,r)=>{try{const n=window.tsxToJsonWorkerSrc||"https://cdn.xiaowei.qq.com/adp/assets/static/tsxToJSON.worker.js",i=new Blob([`importScripts('${n}')`],{type:"application/javascript"});this.blobUrl=URL.createObjectURL(i),this.worker=new Worker(this.blobUrl),this.worker.onmessage=a=>{const{ok:o,out:s,error:u,nonce:l}=a.data,c=this.callbacks.get(l);c&&(this.callbacks.delete(l),o?c.resolve(s):c.reject(new Error(u||"Worker Parse error")))},this.worker.onerror=a=>{console.error("tsxToJSON Worker 错误:",a)},this.initializing=!1,t()}catch(n){this.initializing=!1,console.error("初始化 tsxToJSON Worker 失败:",n),r(n)}}),this.initPromise)}destroy(){this.worker&&(this.worker.terminate(),this.worker=null),this.blobUrl&&(URL.revokeObjectURL(this.blobUrl),this.blobUrl=null),this.callbacks.forEach(t=>{t.reject(new Error("Worker destroy"))}),this.callbacks.clear(),this.initializing=!1,this.initPromise=null}async parse({view:t,state:r,keyMap:n,componentNames:i=IO}){return await this.init(),new Promise((a,o)=>{if(!this.worker){o(new Error("Worker not init"));return}const s=Zb();this.callbacks.set(s,{resolve:a,reject:o}),this.worker.postMessage({type:"parse",view:t,state:r||{},keyMap:n,componentNames:i||[],nonce:s})})}isInitialized(){return!!this.worker}}let g1=null;async function Vh(){return g1||(g1=new PO),await g1.init(),g1}class RO{constructor(){this.worker=null,this.callbacks=new Map,this.initializing=!1,this.initPromise=null,this.blobUrl=null}async init(){return this.worker?Promise.resolve():this.initializing&&this.initPromise?this.initPromise:(this.initializing=!0,this.initPromise=new Promise((t,r)=>{try{const n=window.schemaWorkerSrc||"https://cdn.xiaowei.qq.com/adp/assets/static/schemaWorker.js",i=new Blob([`importScripts('${n}')`],{type:"application/javascript"});this.blobUrl=URL.createObjectURL(i),this.worker=new Worker(this.blobUrl),this.worker.onmessage=a=>{const{ok:o,keyMap:s,jsonSchema:u,error:l,nonce:c}=a.data,f=this.callbacks.get(c);f&&(this.callbacks.delete(c),o?f.resolve({keyMap:s,jsonSchema:u}):f.reject(new Error(l||"Worker parse failed")))},this.worker.onerror=a=>{console.error("zodSchema Worker 错误:",a)},this.initializing=!1,t()}catch(n){this.initializing=!1,console.error("初始化 zodSchema Worker 失败:",n),r(n)}}),this.initPromise)}destroy(){this.worker&&(this.worker.terminate(),this.worker=null),this.blobUrl&&(URL.revokeObjectURL(this.blobUrl),this.blobUrl=null),this.callbacks.forEach(t=>{t.reject(new Error("Worker destroyed"))}),this.callbacks.clear(),this.initializing=!1,this.initPromise=null}async zodToJsonSchema({src:t,includeJSONSchema:r=!0}){return await this.init(),new Promise((n,i)=>{if(!this.worker){i(new Error("Worker not init"));return}const a=Zb();this.callbacks.set(a,{resolve:n,reject:i}),this.worker.postMessage({type:"parse",src:t,includeJSONSchema:r,nonce:a})})}async zodToJsonSchemaAsync(t){return await this.zodToJsonSchema({src:t,includeJSONSchema:!0})}isInitialized(){return!!this.worker}}let m1=null;async function Yb(){return m1||(m1=new RO),await m1.init(),m1}async function Y0(e){const r=await(await Yb()).zodToJsonSchemaAsync(e);return{keyMap:r.keyMap,jsonSchema:JSON.stringify(r.jsonSchema,null,2)}}function NO(e,t){let r;try{r=JSON.parse(e)}catch(i){return console.warn(`unmarshal view failed, err: ${i}`),e}let n;try{n=JSON.parse(t)}catch(i){return console.warn(`unmarshal payload failed, err: ${i}`),e}$h(r,n);try{return JSON.stringify(r)}catch(i){return console.warn(`marshal view failed, err: ${i}`),e}}function $h(e,t){if(Array.isArray(e))for(let r=0;r<e.length;r++)$h(e[r],t);else if(e!==null&&typeof e=="object"){const r=e.name;if(typeof r=="string"){const n=typeof e.type=="string"?e.type:"unknown",i=OO(r,t);if(i.exists){const a=i.value;switch(n){case"DatePicker":e.defaultValue=a;break;case"Select":e.defaultValue=a;break;case"Checkbox":e.defaultChecked=a;break;case"RadioGroup":e.defaultValue=a;break;case"Input":e.defaultValue=a;break;case"Textarea":e.defaultValue=a;break;default:e.defaultValue=a}}}if(Array.isArray(e.children))for(let n=0;n<e.children.length;n++)$h(e.children[n],t)}}function OO(e,t){const r=e.split(".");let n=t;for(const i of r){if(n===null||typeof n!="object"||Array.isArray(n))return{value:null,exists:!1};if(!(i in n))return{value:null,exists:!1};n=n[i]}return typeof n=="string"||typeof n=="number"||typeof n=="boolean"?{value:n,exists:!0}:{value:String(n),exists:!0}}class n2{constructor(){this.initPromise=null,this.initialized=!1,this._preload()}_preload(){return this.initPromise?this.initPromise:(this.initPromise=Promise.all([Vh(),Yb()]).then(()=>{this.initialized=!0,console.log("WidgetHelper: Workers 预加载完成")}).catch(t=>{console.warn("WidgetHelper: Workers 预加载失败:",t.message)}),this.initPromise)}async waitForReady(){this.initPromise&&await this.initPromise}isReady(){return this.initialized}async getTemplate(t){try{return""}catch(r){return console.warn("getTemplate 执行出错:",r.message),""}}async getPreview({view:t,schema:r,defaultState:n}){try{if(await this.waitForReady(),n!=null&&n!==""){const s=typeof n=="string"?JSON.parse(n):n;if(typeof s!="object"||s===null)throw new Error("defaultState 必须是一个有效的 JSON 对象")}const{keyMap:i}=await Y0(r);return await(await Vh()).parse({view:t,state:JSON.parse(n),keyMap:i})}catch(i){return console.warn("getPreview 执行出错:",i.message),""}}async getJsonSchema(t){try{await this.waitForReady();const{jsonSchema:r}=await Y0(t);return r}catch(r){return console.warn("getJsonSchema 执行出错:",r.message),""}}genarateSnapshot(...t){return NO(...t)}decodeWidget(t){try{return JSON.parse(Buffer.from(t,"base64").toString()||"")}catch{return""}}}function BO(){return new n2}function FO(e){try{return jsxToJinja(e)}catch(t){return console.warn("getTemplate 执行出错:",t.message),""}}async function zO({view:e,schema:t,defaultState:r}){try{if(r!=null&&r!==""){const o=typeof r=="string"?JSON.parse(r):r;if(typeof o!="object"||o===null)throw new Error("defaultState 必须是一个有效的 JSON 对象")}const{keyMap:n}=await Y0(t);return await(await Vh()).parse({view:e,state:JSON.parse(r),keyMap:n})}catch(n){return console.warn("getPreview 执行出错:",n.message),""}}async function VO(e){try{const{jsonSchema:t}=await Y0(e);return t}catch(t){return console.warn("getJsonSchema 执行出错:",t.message),""}}const $O={data(){return{_widgetHelper:null}},created(){this._widgetHelper=new n2,this._widgetInstancesMap={},this._audioInstancesMap={},this._classifyTagInstancesMap={},this._planConfirmInstancesMap={},this._audioStateCache={}},methods:{_scaleWidgetIfNeeded(e,t){const r=this.widgetList&&this.widgetList.find(s=>s.widget_run_id===t),n=r&&r.scale,i=this._widgetInstancesMap[t],a=i&&i.instance&&i.instance.$el;if(!a)return;if(!n){e.style.width="",e.style.height="",a.style.transform="",a.style.transformOrigin="";return}let o;if(typeof n=="number")o=n;else if(n===!0){const s=this.$refs.containerRef&&(this.$refs.containerRef.$el||this.$refs.containerRef);if(!s)return;const u=s.clientWidth,l=a.style.transform;a.style.transform="";const c=a.scrollWidth||a.offsetWidth;if(a.style.transform=l,u<=0||c<=u){e.style.width="",e.style.height="",a.style.transform="",a.style.transformOrigin="";return}o=u/c}if(o&&o>0){a.style.transform="";const s=a.scrollWidth||a.offsetWidth,u=a.scrollHeight||a.offsetHeight;e.style.width=`${s*o}px`,e.style.height=`${u*o}px`,a.style.transform=`scale(${o})`,a.style.transformOrigin="top left"}},async _mountWidgets(e){if(!this.showWidget)return;const t=e.querySelectorAll(".widget-container");for(const r of t){if(r._widgetMounted||r._widgetMounting)continue;r._widgetMounting=!0;const n=r.getAttribute("data-widget-run-id"),i=r.getAttribute("data-widget-id"),a=r.getAttribute("data-widget-view"),o=r.getAttribute("data-widget-encoded-widget"),s=r.getAttribute("data-widget-state"),u=r.getAttribute("data-widget-payload"),l=r.getAttribute("data-widget-disable")==="true";if(!a&&!o){r._widgetMounting=!1;continue}const c=s?decodeURIComponent(escape(atob(s))):"",f=u?decodeURIComponent(escape(atob(u))):"",h=a?decodeURIComponent(escape(atob(a))):"";let d="";if(h)d=h;else try{const{view:b,schema:x}=this._widgetHelper.decodeWidget(o);d=await this._widgetHelper.getPreview({view:b,schema:x,defaultState:c}),d=JSON.stringify(d),f&&(d=this._widgetHelper.genarateSnapshot(d,f))}catch(b){console.error("[MsgContent] decodeWidget error",b),r._widgetMounting=!1;continue}const p=Ia.extend(Hb),v=new p({propsData:{output:d,disable:l,locale:this.locale}});v.$on("widget-action",b=>this.$emit("widget-action",b,n,i)),v.$on("widget-event",b=>this.$emit("widget-event",b,n,i)),v.$on("widget-rendered",b=>{this.$emit("widget-rendered",b,n,i),this.$nextTick(()=>this._scaleWidgetIfNeeded(r,n))}),v.$mount(),r.appendChild(v.$el),r._widgetMounted=!0,r._widgetMounting=!1;const g=r.getAttribute("data-widget-view")||"",m=r.getAttribute("data-widget-payload")||"",y=r.getAttribute("data-widget-state")||"",_=r.getAttribute("data-widget-encoded-widget")||"";this._widgetInstancesMap[n]={instance:v,container:r,_lastDataKey:`${g}|${m}|${y}|${_}`}}},_mountAudioPlayers(e){if(!this.audioList||this.audioList.length===0)return;e.querySelectorAll(".audio-stream-container").forEach(r=>{const n=r.getAttribute("data-audio-symbol-id");if(this._audioInstancesMap[n]){r.children.length===0&&r.appendChild(this._audioInstancesMap[n].instance.$el);return}if(r.children.length>0)return;const i=this.audioList&&this.audioList.find(a=>a.audioSymbolId===n);if(i)try{const a=Ia.extend(qb),o=new a({propsData:{audioData:i}});o.$on("play",s=>this.$emit("audio-play",s,n)),o.$on("pause",s=>this.$emit("audio-pause",s,n)),o.$on("end",s=>this.$emit("audio-end",s,n)),o.$on("audio-download",s=>this.$emit("audio-download",s,n)),o.$on("chunk-added",s=>this.$emit("audio-chunk-added",s,n)),o.$on("error",s=>this.$emit("audio-error",s,n)),o.$mount(),r.appendChild(o.$el),this._audioInstancesMap[n]={instance:o,container:r}}catch(a){console.error("[MsgContent] 创建音频播放器失败:",a)}})},_mountClassifyTags(e){if(!this.showClassifyTag)return;e.querySelectorAll(".classify-tag-container").forEach((r,n)=>{if(r._classifyTagMounted)return;const i=r.getAttribute("data-classify-tag");if(i)try{const a=decodeURIComponent(escape(atob(i))),o=JSON.parse(a),s=Ia.extend(r2),u=new s({propsData:{title:o.title||"问题澄清",questions:o.questions||[],disabled:!1}});u.$on("submit",l=>this.$emit("classify-tag-submit",l,o)),u.$on("skip",()=>this.$emit("classify-tag-skip",o)),u.$mount(),r.appendChild(u.$el),r._classifyTagMounted=!0,this._classifyTagInstancesMap[n]={instance:u,container:r}}catch(a){console.error("[MsgContent] ClassifyTag mount error:",a)}})},_mountPlanConfirms(e){if(!this.showPlanConfirm)return;e.querySelectorAll(".plan-confirm-container").forEach((r,n)=>{if(r._planConfirmMounted)return;const i=r.getAttribute("data-plan-confirm");if(i)try{const a=decodeURIComponent(escape(atob(i))),o=JSON.parse(a),s=Ia.extend(DO),u=new s({propsData:{title:o.title||"计划确认",planText:o.planText||"",disabled:!1}});u.$on("confirm",l=>this.$emit("plan-confirm",l,o)),u.$on("skip",l=>this.$emit("plan-skip",l,o)),u.$mount(),r.appendChild(u.$el),r._planConfirmMounted=!0,this._planConfirmInstancesMap[n]={instance:u,container:r}}catch(a){console.error("[MsgContent] PlanConfirm mount error:",a)}})},_mountAll(e){this.$nextTick(()=>{this._mountWidgets(e),this._mountAudioPlayers(e),this._mountClassifyTags(e),this._mountPlanConfirms(e)})},async _updateWidgets(e){if(!e)return;const t=this.$refs.containerRef,r=t&&(t.$el||t);if(!r)return;await this.$nextTick();const n=r.querySelectorAll(".widget-container");for(const i of n){const a=i.getAttribute("data-widget-run-id"),o=this._widgetInstancesMap[a];if(!a||!o)continue;const s=i.getAttribute("data-widget-view")||"",u=i.getAttribute("data-widget-payload")||"",l=i.getAttribute("data-widget-state")||"",c=i.getAttribute("data-widget-encoded-widget")||"",f=i.getAttribute("data-widget-disable")==="true",h=`${s}|${u}|${l}|${c}`;if(o._lastDataKey!==h){o._lastDataKey=h;const d=s?decodeURIComponent(escape(atob(s))):"",p=u?decodeURIComponent(escape(atob(u))):"";let v="";if(d)v=d;else if(c){const g=l?decodeURIComponent(escape(atob(l))):"";try{const{view:m,schema:y}=this._widgetHelper.decodeWidget(c);v=await this._widgetHelper.getPreview({view:m,schema:y,defaultState:g}),v=JSON.stringify(v),p&&(v=this._widgetHelper.genarateSnapshot(v,p))}catch{}}o.instance&&(o.instance.output=v)}o.instance&&(o.instance.disable=f),this._scaleWidgetIfNeeded(i,a)}},_updateAudioPlayers(e){e&&Object.keys(this._audioInstancesMap).forEach(t=>{const r=this._audioInstancesMap[t];if(!r||!r.instance)return;const n=e.find(s=>s.audioSymbolId===t);if(!n)return;const i=n.audio_data&&n.audio_data.length||0,a=!!n.isComplete,o=this._audioStateCache[t]||{length:0,isComplete:!1};(i!==o.length||a!==o.isComplete)&&(this._audioStateCache[t]={length:i,isComplete:a},r.instance.audioData=n)})},_destroyAllEmbedded(){Object.keys(this._widgetInstancesMap).forEach(e=>{try{this._widgetInstancesMap[e].instance.$destroy()}catch{}delete this._widgetInstancesMap[e]}),Object.keys(this._audioInstancesMap).forEach(e=>{try{this._audioInstancesMap[e].instance.$destroy()}catch{}delete this._audioInstancesMap[e]}),Object.keys(this._classifyTagInstancesMap).forEach(e=>{try{this._classifyTagInstancesMap[e].instance.$destroy()}catch{}delete this._classifyTagInstancesMap[e]}),Object.keys(this._planConfirmInstancesMap).forEach(e=>{try{this._planConfirmInstancesMap[e].instance.$destroy()}catch{}delete this._planConfirmInstancesMap[e]}),this._audioStateCache={}}},beforeDestroy(){this._destroyAllEmbedded()}},GO={methods:{_postrender(e){let t=e.replace(/&amp;gt;/g,"&gt;").replace(/&amp;lt;/g,"&lt;").replace("CURSOR_POINT",'<span class="cursor"></span>');const r=document.createElement("div");return r.innerHTML=t,r.querySelectorAll("img").forEach(n=>{const i=Gb(n.src,"size"),a=i&&i.split("|")||[];let o,s;if(a[1]){const u=a[1].split("*");o=u[0],u[1]&&(s=u[0]/u[1])}a[0]&&(a[0]==="min"&&(!o||o<24)?o=this.imgMinWidth||"24":a[0]==="mid"&&o>320?o=this.imgMaxWidth||"320":a[0]==="max"&&(o=this.imgMaxWidth||"320")),o&&(n.style.width=o===this.imgMaxWidth||o===this.imgMinWidth?o:`${o}px`),s&&(n.style.height=`${o/s}px`)}),r.querySelectorAll("pre code:not(.language-mermaid)").forEach((n,i,a)=>{if(Array.from(n.classList).some(s=>s.startsWith("language-"))?this.incremental||nf(n):n.classList.add("hljs"),this.isFinal){this.incremental||nv(n);const s=n.parentNode.querySelector(".cursor");s&&s.remove()}else if(this.isPrintAnimate&&!r.querySelector(".cursor")&&i===a.length-1&&!this.isFinal&&n.parentElement===r.lastElementChild){const s=document.createElement("span");s.className="cursor",n.append(s)}if(!this.incremental&&!n.parentNode.querySelector(".code-language-label")&&n.result&&n.result.language){const s=document.createElement("div");s.className="code-language-label",this.codeHeaderRender?s.innerHTML=this.codeHeaderRender(n.result.language,this.content,i):s.textContent=n.result.language,n.parentNode.insertBefore(s,n)}}),Cb(r),this.$emit("postrender",this.currentIndex,this.$refs.containerRef&&(this.$refs.containerRef.$el||this.$refs.containerRef),this.recordId),r.innerHTML.replace(/--&gt;/g,"-->")},_onImageClick(e){this.$emit("imageClick",e)},_onDownloadCardClick(e,t){this.$emit("downloadCardClick",e,t)},_onMDRendered(e){e&&(this.incremental&&e.querySelectorAll("pre code:not(.language-mermaid)").forEach((t,r,n)=>{if(Array.from(t.classList).some(a=>a.startsWith("language-"))&&!t._highlighted&&(r===n.length-1&&!this.isFinal?nf(t):(nf(t),t._highlighted=!0)),this.isFinal&&!t._lineNumbered&&(nv(t),t._lineNumbered=!0),!t.parentNode.querySelector(".code-language-label")&&t.result&&t.result.language){const a=document.createElement("div");a.className="code-language-label",this.codeHeaderRender?a.innerHTML=this.codeHeaderRender(t.result.language,this.content,r):a.textContent=t.result.language,t.parentNode.insertBefore(a,t)}}),this.isFinal?(this.incremental?e.querySelectorAll(".question-text img, .answer-md img").forEach(t=>{t._imgClickBound||(t.addEventListener("click",this._onImageClick),t._imgClickBound=!0)}):(e.querySelectorAll(".question-text img").forEach(t=>{t.removeEventListener("click",this._onImageClick),t.addEventListener("click",this._onImageClick)}),e.querySelectorAll(".answer-md img").forEach(t=>{t.removeEventListener("click",this._onImageClick),t.addEventListener("click",this._onImageClick)})),e.querySelectorAll(`.${this.clazzMd||"answer-md"} a`).forEach(t=>{t.setAttribute("target","_blank")}),e.querySelectorAll(".video-placeholder").forEach(t=>t.remove()),e.querySelectorAll("video").forEach(t=>{t.style.display="block"})):e.querySelectorAll(".video-placeholder").forEach(t=>{this.incremental&&t._videoPlaceholderSet||(t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" style="animation: video-placeholder-spin 1s linear infinite; flex-shrink: 0;"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.36131 2.32604C0.902925 3.77517 0 5.78264 0 8.00101C0 12.4193 3.58172 16.001 8 16.001C12.4183 16.001 16 12.4193 16 8.00101C16 3.58326 12.4191 0.00187492 8.00161 0.00100708L8.85183 1.6572C11.9837 2.07373 14.4 4.7552 14.4 8.00101C14.4 11.5356 11.5346 14.401 8 14.401C4.46538 14.401 1.6 11.5356 1.6 8.00101C1.6 6.40633 2.18324 4.94787 3.14803 3.82731L2.36131 2.32604Z" fill="currentColor"/></svg>视频加载中...',this.incremental&&(t._videoPlaceholderSet=!0))}),this.showTags&&e.querySelectorAll(".tags-container").forEach(t=>{this.incremental&&t._tagClickBound||(this.incremental?(t.addEventListener("click",()=>this.$emit("littleTagClick",t,this.recordId)),t._tagClickBound=!0):(t.removeEventListener("click",this._tagClickHandler),t.addEventListener("click",()=>this.$emit("littleTagClick",t,this.recordId))))}),this.showDownloadCard&&e.querySelectorAll(".download-card").forEach(t=>{this.incremental&&t._downloadClickBound||(t.addEventListener("click",r=>{const n=r.currentTarget.getAttribute("data-file-id");this._onDownloadCardClick(n,r);try{r&&r.preventDefault&&r.preventDefault()}catch{}}),this.incremental&&(t._downloadClickBound=!0))}),this.isMermaidRenderAfterOutput?this.isFinal&&setTimeout(()=>{f1.onMermaidLoaded(()=>{f1.renderAll(e)})},0):setTimeout(()=>{f1.onMermaidLoaded(()=>{f1.renderAll(e)})},0),this._mountAll(e))}}};const HO={name:"MsgContent",components:{MDRender:IP},mixins:[JN,$O,GO],props:{showDownloadCard:{type:Boolean,default:!1},showTags:{type:Boolean,default:!1},fullFiles:{type:Array,default:()=>[]},recordId:String,content:{type:String,default:""},isFinal:{type:Boolean,default:!1},loadingMessage:{type:Boolean,default:!1},isMdExpand:{type:[Boolean,void 0],default:void 0},isReplaceLinks:{type:Boolean,default:!1},isPrintAnimate:{type:Boolean,default:!1},styleObj:Object,clazzTable:String,clazzMd:String,anchorAttributes:Object,linkify:{type:Boolean,default:!1},imgMinWidth:[Number,String],imgMaxWidth:[Number,String],printCount:Number,printCountTime:Number,hideCursorPoint:Boolean,chartDataArr:Array,codeHeaderRender:Function,replaceLinksWhitelist:Array,isMermaidRenderAfterOutput:{type:Boolean,default:!1},showWidget:{type:Boolean,default:!1},widgetList:{type:Array,default:()=>[]},audioList:{type:Array,default:()=>[]},locale:{type:String,default:"zh-CN"},incremental:{type:Boolean,default:!0},showClassifyTag:{type:Boolean,default:!1},showPlanConfirm:{type:Boolean,default:!1}},data(){return{currentText:"",renderText:""}},computed:{processOptions(){return{isReplaceLinks:this.isReplaceLinks,replaceLinksWhitelist:this.replaceLinksWhitelist,isFinal:this.isFinal,showTags:this.showTags,showDownloadCard:this.showDownloadCard,fullFiles:this.fullFiles,showWidget:this.showWidget,widgetList:this.widgetList,audioList:this.audioList,showClassifyTag:this.showClassifyTag,showPlanConfirm:this.showPlanConfirm}}},watch:{content(e){this.clearTimer(),this.currentIndex=this.currentText.length,this.currentText=this._getProcessedContent(e),this.isPrintAnimate?this._startPrint():this.renderText=this.currentText},isFinal(e){e&&this.content&&(this.clearTimer(),this.currentText=this._getProcessedContent(this.content),this.renderText=this.currentText,this.currentIndex=this.currentText.length)},isMdExpand(e){e?this.currentText=af(this.content,this.processOptions):this.currentText=af((this.content||"").substr(0,3e3),this.processOptions),this.renderText=this.currentText,this.clearTimer(),this.currentIndex=this.currentText.length},widgetList:{handler(e){this._updateWidgets(e)},deep:!0},audioList:{handler(e){this._updateAudioPlayers(e)},deep:!0}},created(){this._init()},mounted(){bN()},beforeDestroy(){this.clearTimer(),this._destroyAllEmbedded()},methods:{_getProcessedContent(e){if(!e)return"";const t=this.isMdExpand===void 0||this.isMdExpand?1e6:1e4;return af(e.substr(0,t),this.processOptions)},_startPrint(){this.startCurrentTimer({printCount:this.printCount||1,printCountTime:this.printCountTime||16,hideCursorPoint:this.hideCursorPoint,isFinal:this.isFinal})},_init(){const e=this._getProcessedContent(this.content||"");this.currentText=e,!this.isPrintAnimate||this.isFinal?(this.renderText=e,this.currentIndex=e.length,this.clearTimer()):this._startPrint()}}};var UO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"msg-content"},[t.loadingMessage?t._e():[r("MDRender",{ref:"containerRef",class:t.clazzMd||"answer-md",style:t.styleObj,attrs:{highlight:!0,"table-class":t.clazzTable||(t.isFinal?"table-style":"table"),source:t.renderText,"anchor-attributes":t.anchorAttributes||{target:"_blank"},linkify:t.linkify,incremental:t.incremental,postrender:t._postrender},on:{rendered:t._onMDRendered}})]],2)},WO=[],qO=pr(HO,UO,WO,!1,null,null,null,null);const Xb=qO.exports,Z4=An(Xb);const ZO={name:"MsgThought",components:{VIcon:t2},props:{titleRender:{type:[Object,Function],default:null},isMobile:Boolean,content:String,title:String,titleIcon:String,nodeName:String,status:String,elapsed:{type:Number,default:0},detailVisible:{type:Boolean,default:!0}},data(){return{THOUGHT_STATUS:vP,innerDetailVisible:this.detailVisible,renderedContent:"",xssHandler:new Un.FilterXSS(pP)}},computed:{elapsedSeconds(){return this.elapsed?(this.elapsed/1e3).toFixed(1):0}},watch:{content:{immediate:!0,handler(e){const t=(e||"").replace(/^\n+/,"").replace(/\n/g,"<br>");this.renderedContent=this.xssHandler.process(t)}},detailVisible(e){this.innerDetailVisible=e}},methods:{onTitleClick(){const e=!this.innerDetailVisible;this.innerDetailVisible=e,this.$emit("update:detailVisible",e)}}};var YO=function(){var t=this,r=t._self._c;return r("div",{staticClass:"thought-clps-content"},[t.titleRender?r(t.titleRender,{tag:"component"}):t._e(),t.titleRender?t._e():r("div",{staticClass:"thought-title",on:{click:t.onTitleClick}},[r("div",{staticClass:"thought-title-container"},[r("img",{staticClass:"thought-title-icon",attrs:{src:t.titleIcon}}),r("span",{staticClass:"thought-title-name"},[t._v(" "+t._s(t.title)+" "),t.nodeName?r("span",{staticClass:"thought-clps-modellabel"},[t._v(" -"+t._s(t.nodeName)+" ")]):t._e()]),t.status===t.THOUGHT_STATUS.failed?r("v-icon",{style:{color:"#FF8345"},attrs:{name:"basic_warning_line",size:"16"}}):t._e(),t.status===t.THOUGHT_STATUS.success?r("v-icon",{style:{color:"#0FB87F"},attrs:{name:"basic_finish_line",size:"16"}}):t._e(),t.status===t.THOUGHT_STATUS.stop?r("v-icon",{style:{color:"rgba(1,11,50,0.41)"},attrs:{name:"basic_stop_line",size:"16"}}):t._e()],1),r("div",{staticClass:"thought-title-container thought-title-elapsed"},[r("span",[t._v(t._s(t.elapsedSeconds)+"s")]),r("v-icon",{staticClass:"thought__header__icon",attrs:{name:"arrow_down_small_line",rotate:t.innerDetailVisible?180:0,size:"12"}})],1)]),t.innerDetailVisible?r("div",{staticClass:"thought-detail"},[r("div",{staticClass:"question-text",class:{"question-text-mobile":t.isMobile},domProps:{innerHTML:t._s(t.renderedContent)}})]):t._e()],1)},XO=[],jO=pr(ZO,YO,XO,!1,null,"60c16159",null,null);const KO=jO.exports,Y4=An(KO);/*! *****************************************************************************
48
48
  Copyright (c) Microsoft Corporation.
49
49
 
50
50
  Permission to use, copy, modify, and/or distribute this software for any