jvs-ppt-ui 0.0.19 → 0.0.20
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.
|
@@ -341,7 +341,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
341
341
|
[点击卡片在浏览器中播放]`,options:{fontSize:9,color:`60A5FA`}}],{x:k,y:A,w:j,h:M,align:`center`,valign:`middle`,hyperlink:i?{url:i,tooltip:`点击在线打开${r}`}:void 0})}}else if(e.type===`table`){let t=e.content&&(e.content.includes(`<table`)||e.content.includes(`<table`))?De(e.content,j):Oe(e,j);if(t.tableData&&t.tableData.length>0){let n={x:k,y:A,w:j,h:M,objectName:e.id};t.colW&&t.colW.length>0&&(n.colW=t.colW),c.addTable(t.tableData,n)}}},_=!!(s?.value?.masterFilesMap&&Object.keys(s.value.masterFilesMap).length>0),v=j(o,!0);if(!_&&v&&v.length>0)for(let e of v)await f(e,null);let x=(o.elements||[]).filter(e=>!(e.isMaster&&!e.isPlaceholder&&!e.placeholder&&!e.id?.startsWith(`ph-`)&&!e.id?.startsWith(`ph_`)&&!e.name?.includes(`占位符`)&&v&&v.some(t=>t.id===e.id)));for(let e of x)await f(e,null)}return await X8e(await t.write({outputType:`blob`}),u.value,y.value,b.value,g.value,{schemeFillMap:_.value,fullThemeColors:v.value,zipMeta:s.value})}catch(e){throw console.error(e),d(`导出 PPTX 失败: `+e.message),e}finally{R.value=!1}},Le=async()=>{try{let e=await Ie();e&&((0,oZ.saveAs)(e,`${i.value}.pptx`),d(`生成 PPTX 成功`))}catch{}},Re=e=>{e===`png`?fe(`png`):e===`jpeg`?fe(`jpeg`):e===`zip`?me():e===`pptx`?Le():e===`json`?a():e===`json-template`&&a({excludeImages:!0,clearContent:!0})};function ze(e){if(e=e.trim().toLowerCase(),e.startsWith(`#`)){let t=e.substring(1);return t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:parseInt(t.substring(0,2),16)||0,g:parseInt(t.substring(2,4),16)||0,b:parseInt(t.substring(4,6),16)||0}}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);return t?{r:parseInt(t[1])||0,g:parseInt(t[2])||0,b:parseInt(t[3])||0}:{r:128,g:128,b:128}}function Be(e,t,n){let r=e=>{let t=Math.round(e).toString(16);return t.length===1?`0`+t:t};return`#`+r(e)+r(t)+r(n)}let Ve=(e,t)=>{let n=parseFloat(e);if(!n)return 0;let r=n<0,i=Math.abs(n),a=0;return e.indexOf(`em`)===-1?e.indexOf(`px`)===-1?e.indexOf(`pt`)!==-1&&(a=Math.floor(i/20),a||=1):(a=Math.floor(i/24),a||=1):a=Math.floor(i),a>8&&(a=8),r?-a:a},He=(e,t)=>{let n=e.parentElement;for(;n;){if(n.tagName===`SPAN`&&n.style[t])return n;if(n.tagName===`LI`)break;n=n.parentElement}return null},Ue=(e,t)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=null,i=!1,a=n.nextNode();for(;a;){let o=a;if(o.textContent?.replace(/\s+/g,``)&&o.parentElement?.closest(`li`)===e){i=!0;let e=He(o,t);if(!e)return``;if(!r)r=e;else if(r!==e)return``}a=n.nextNode()}return i&&r?r.style[t]:``},We=e=>{if(!/<(ul|ol)\b/i.test(e)||!/font-size\s*:/i.test(e)&&!/color\s*:/i.test(e))return e;let t=new DOMParser().parseFromString(e,`text/html`);return t.body.querySelectorAll(`ul, ol`).forEach(e=>{let t=Array.from(e.children).filter(e=>e.tagName===`LI`);if(t.length){if(!e.style.fontSize){let n=``;for(let e of t){let t=Ue(e,`fontSize`);if(!t){n=``;break}if(!n)n=t;else if(n!==t){n=``;break}}n&&(e.style.fontSize=n)}if(!e.style.color){let n=``;for(let e of t){let t=Ue(e,`color`);if(!t){n=``;break}if(!n)n=t;else if(n!==t){n=``;break}}n&&(e.style.color=n)}}}),t.body.innerHTML},Ge=e=>{if(!e)return``;let t=new DOMParser().parseFromString(e,`text/html`);return t.body.querySelectorAll(`ul, ol`).forEach(e=>{let t=e.getAttribute(`style`)||``;/padding-(left|inline-start)/i.test(t)||e.setAttribute(`style`,`padding-left: 0; ${t}`.trim())}),t.body.querySelectorAll(`li`).forEach(e=>{e.removeAttribute(`data-indent`);let t=``,n=``,r=e.getAttribute(`style`);if(r){let e=r.match(/white-space\s*:\s*([^;]+);?/i);e&&(t=`white-space: ${e[1]};`);let i=r.match(/line-height\s*:\s*([^;]+);?/i);i&&(n=`line-height: ${i[1]};`)}let i=e.querySelector(`p, span, div`),a=``;if(i){i.removeAttribute(`data-indent`);let e=i.getAttribute(`style`);if(e){let t=e.match(/(padding-left|margin-left)\s*:\s*([^;]+);?/i);if(t){a=`margin-left: ${t[2]};`;let n=e.replace(/padding-left\s*:\s*[^;]+;?/gi,``).replace(/margin-left\s*:\s*[^;]+;?/gi,``).trim();n?i.setAttribute(`style`,n):i.removeAttribute(`style`)}}}let o=``;a&&(o+=a),t&&(o+=` ${t}`),n&&(o+=` ${n}`),o=o.trim(),o?e.setAttribute(`style`,o):e.removeAttribute(`style`)}),t.body.querySelectorAll(`p`).forEach(e=>{e.removeAttribute(`data-indent`);let t=e.getAttribute(`style`);if(t){let n=t.replace(/margin-(top|bottom|right)\s*:\s*[^;]+;?/gi,``).replace(/;\s*;/g,`;`).replace(/^\s*;\s*/,``).replace(/;\s*$/,`;`).trim();n?e.setAttribute(`style`,n):e.removeAttribute(`style`)}}),t.body.innerHTML},Ke=(e,t,n,r)=>{if(!e)return``;let i=G3(e).replace(/[\r\n]+/g,` `);return i=i.replace(/font-size:\s*([\d.]+)pt/g,(e,n)=>{let r=parseFloat(n)*t;return`font-size: ${Math.round(r)}px`}).replace(/font-family\s*:\s*((?:"|"|[^;"])+)/gi,(e,t)=>{let n=t.trim(),r=n.replace(/"|"/gi,`"`).replace(/['"]/g,``).trim();return r.toLowerCase()===`inherit`?`font-family: inherit`:r.toLowerCase().includes(`sans-serif`)||r.toLowerCase().includes(`serif`)?`font-family: ${n.replace(/"|"/gi,`'`)}`:r===`微软雅黑`||r===`Microsoft YaHei`?`font-family: 'Microsoft YaHei', '微软雅黑', sans-serif`:/宋|书局|明朝|楷|仿宋|serif|times|georgia|minion|garamond|cambria|bodoni|didot/i.test(r)?`font-family: '${r}', 'Source Han Serif SC', 'Songti SC', 'SimSun', 'STSong', serif`:`font-family: '${r}', 'SourceHanSansCN', sans-serif`}),i=i.replace(/-webkit-text-stroke\s*:\s*([\d.]+)(?:pt|px)?\s+([^;"]+);?/gi,(e,n,r)=>`-webkit-text-stroke: ${+(parseFloat(n)*t).toFixed(2)}px ${r};`),/text-align-last\s*:\s*justify/i.test(i)?i.includes(`text-justify`)||(i=i.replace(/(text-align-last\s*:\s*justify;?)/gi,`$1 text-justify: inter-character;`)):/text-align\s*:\s*justify/i.test(i)&&(i=i.replace(/text-justify\s*:\s*[^;"]+;?/gi,``).replace(/(text-align\s*:\s*justify;?)/gi,`$1 text-align-last: left;`)),i=i.replace(/style="([^"]*)"/g,(e,n)=>{let r=n,i=n.match(/background:\s*(linear-gradient\([^)]+\))/);if(i){let e=i[1].match(/#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|rgba?\([^)]+\)/g);if(e&&e.length){let t=e.map(e=>ze(e)),n=t.reduce((e,n)=>({r:e.r+n.r/t.length,g:e.g+n.g/t.length,b:e.b+n.b/t.length}),{r:0,g:0,b:0}),i=Be(n.r,n.g,n.b);r=r.replace(/background:\s*linear-gradient\([^)]+\)\s*;?/g,``).replace(/background-clip:\s*text\s*;?/g,``).replace(/color:\s*transparent\s*;?/g,``),r=`color: ${i}; ${r}`}}let a=r.match(/margin-left\s*:\s*([^;]+);?/i),o=``;if(a){let e=a[1].trim(),n=parseFloat(e);if(n){let r=n;e.includes(`pt`)?r=n:e.includes(`em`)&&(r=n*16);let i=Math.floor(r*t);i>0&&(o=`padding-left: ${i}px;`)}}return r=r.replace(/margin-(top|bottom|left)\s*:\s*[^;]+;?/g,``).replace(/text-shadow\s*:\s*[^;"]+;?/gi,``).replace(/text-indent\s*:\s*([^;]+);?/g,(e,n)=>{let r=Ve(n,t);return r?`text-indent: ${r}em;`:``}).replace(/;\s*;/g,`;`).replace(/^\s*;\s*/,``).replace(/;\s*$/,`;`).trim(),o&&(r=`${o} ${r}`.trim()),r?`style="${r}"`:``}),Ge(We(i))},qe=(e,t=18)=>{let n=/font-size\s*:\s*(\d+(?:\.\d+)?)\s*(pt|px)/gi,r=[],i;for(;(i=n.exec(e))!==null;){let e=parseFloat(i[1]),t=i[2].toLowerCase();e>0&&(t===`px`?r.push(e/1.33333):r.push(e))}return r.length>0?Math.max(...r):t},Je=(e,t,n=18)=>{let r=/<(div|p|li)(?![a-z0-9])[^>]*>/gi,i=[],a=[],o=0,s,c=0;for(;(s=r.exec(e))!==null;){let t=s[0];o++;let r=t.match(/\bstyle\s*=\s*(['"])(.*?)\1/i),l=``;r&&r[2]&&(l=r[2]);let u=e=>{if(!l)return null;let t=RegExp(`${e}\\s*:\\s*([^;]+)`,`i`),n=l.match(t);return n?n[1].trim():null},d=u(`margin-top`),f=u(`margin-bottom`),p=u(`line-height`),m=!!p,h=s.index,g=s[1],_=e.indexOf(`</`+g+`>`,h);_===-1&&(_=h+t.length);let v=qe(e.substring(h,_),n),y=1.2;p&&(y=p.indexOf(`pt`)===-1?p.indexOf(`px`)===-1?p.indexOf(`%`)===-1?parseFloat(p):parseFloat(p.replace(`%`,``))/100:parseFloat(p.replace(`px`,``))/1.33333/v:parseFloat(p.replace(`pt`,``))/v),y<1.1&&(y=1.2),m&&i.push(y);let b=c===0,x=s.index+t.length>=e.lastIndexOf(`</`+g+`>`);if(d&&!b){let e=0;d.indexOf(`pt`)===-1?d.indexOf(`em`)!==-1&&(e=parseFloat(d.replace(`em`,``))/100*v):e=parseFloat(d.replace(`pt`,``)),e>0&&a.push(e)}if(f&&!x){let e=0;f.indexOf(`pt`)===-1?f.indexOf(`em`)!==-1&&(e=parseFloat(f.replace(`em`,``))/100*v):e=parseFloat(f.replace(`pt`,``)),e>0&&a.push(e)}c++}let l=1.2;i.length&&i.length===o&&(l=+Math.min(...i).toFixed(2));let u=0;return a.length&&o>1&&(u=a.reduce((e,t)=>e+t,0)/(o-1)),{lineHeight:l,margin:u?+(u*t).toFixed(1):null}},Ye=(e,t)=>{let n=Array.isArray(e?.start)&&e.start.length>=2?e.start:[0,0],r=Array.isArray(e?.end)&&e.end.length>=2?e.end:[e?.width||0,e?.height||0],i=t*Math.PI/180,a=(n[0]+r[0])/2,o=(n[1]+r[1])/2,s=n[0]-a,c=n[1]-o,l=r[0]-a,u=r[1]-o,d=Math.cos(i),f=Math.sin(i),p=s*d-c*f,m=s*f+c*d,h=l*d-u*f,g=l*f+u*d,_=p+a,v=m+o,y=h+a,b=g+o,x=Math.min(n[0],r[0]),S=Math.min(n[1],r[1]),C=Math.min(_,y),w=Math.min(v,b),T=_-C,E=v-w,D=y-C,O=b-w;return{start:[T,E],end:[D,O],offset:[C-x,w-S]}};function Xe(e){if(!e||!e.type||e.type===`none`)return``;let t=e.type.toLowerCase();return t===`oval`||t===`circle`?`dot`:t===`triangle`||t===`arrow`?`arrow`:t===`open-arrow`||t===`open_arrow`||t===`openarrow`?`open-arrow`:t===`stealth`?`stealth-arrow`:t===`diamond`?`diamond`:`arrow`}function Ze(e){if(!e)return null;let t=/([ML])\s*(-?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?)\s+(-?\d+(?:\.\d+)?(?:[eE][-+]?\d+)?)/gi,n=[],r;for(;(r=t.exec(e))!==null;){let e=parseFloat(r[2]),t=parseFloat(r[3]);!isNaN(e)&&!isNaN(t)&&n.push([e,t])}return n.length>=2?n:null}function Qe(e,t,n,r,i,a,o,s){let c=t/2,l=n/2,u=(s||0)*Math.PI/180,d=Math.cos(u),f=Math.sin(u),p=e.map(([e,r])=>{let i=a?t-e:e,s=o?n-r:r;return[(i-c)*d-(s-l)*f+c,(i-c)*f+(s-l)*d+l]}),m=p.map(e=>e[0]),h=p.map(e=>e[1]),g=Math.min(...m),_=Math.min(...h),v=Math.max(...m),y=Math.max(...h),b=Math.max(v-g,1),x=Math.max(y-_,1),S=r+g,C=i+_,w=p.map(([e,t])=>[+(e-g).toFixed(2),+(t-_).toFixed(2)]);return{newLeft:+S.toFixed(2),newTop:+C.toFixed(2),newWidth:+b.toFixed(2),newHeight:+x.toFixed(2),normalizedPoints:w}}function $e(e){if(!e||typeof e!=`object`||e.type===`none`)return!1;let t=Number(e.h)||0,n=Number(e.v)||0,r=Number(e.blur)||0;return!(Math.abs(t)<.01&&Math.abs(n)<.01&&Math.abs(r)<.01||e.color===`transparent`||e.color===`rgba(0,0,0,0)`||e.color===`none`)}let et=(e,t)=>{let n=[0,0],r=[0,0],i=typeof e.width==`number`&&!isNaN(e.width)?e.width:0,a=typeof e.height==`number`&&!isNaN(e.height)?e.height:0;!e.isFlipV&&!e.isFlipH?(n=[0,0],r=[i,a]):e.isFlipV&&e.isFlipH?(n=[i,a],r=[0,0]):e.isFlipV&&!e.isFlipH?(n=[0,a],r=[i,0]):(n=[i,0],r=[0,a]);let o=``,s=``;e.borderHeadEnd!==void 0||e.borderTailEnd!==void 0?(o=Xe(e.borderHeadEnd),s=Xe(e.borderTailEnd)):(o=``,s=``);let c={type:`line`,shapType:e.shapType,id:Date.now().toString()+Math.random().toString(36).substr(2,5),name:e.name||`线条`,order:e.order===void 0?void 0:e.order,width:e.width,height:e.height,borderWidth:e.borderWidth===void 0?t:+(e.borderWidth*t).toFixed(2),left:e.left,top:e.top,start:n,end:r,lineStyle:e.borderType||`solid`,flipH:!1,flipV:!1,isFlipH:!1,isFlipV:!1,rotate:0,style:{left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,color:e.borderColor||`#475569`,strokeWidth:e.borderWidth===void 0?t:+(e.borderWidth*t).toFixed(2),lineStyle:e.borderType||`solid`,flipH:!1,flipV:!1,rotate:0},color:e.borderColor,points:[o,s]};if($e(e.shadow)){c.shadow={h:e.shadow.h*t,v:e.shadow.v*t,blur:e.shadow.blur*t,size:e.shadow.size===void 0?100:e.shadow.size,color:e.shadow.color||`rgba(0,0,0,0.5)`,type:e.shadow.type||`outer`,preset:e.shadow.preset};let n=c.shadow.color||`rgba(0,0,0,0.5)`;c.style.boxShadow=`${Math.round(c.shadow.h)}px ${Math.round(c.shadow.v)}px ${Math.round(c.shadow.blur)}px ${n}`}if(e.shapType&&/curvedConnector/.test(e.shapType)){c.shapType=e.shapType;let t=typeof e.width==`number`&&!isNaN(e.width)&&e.width>0?e.width:100,n=typeof e.height==`number`&&!isNaN(e.height)&&e.height>0?e.height:100,r=t*(e.keypoints?.adj1&&e.keypoints.adj1>0&&e.keypoints.adj1<=2?e.keypoints.adj1/2:.5),i=[];i=/curvedConnector2/.test(e.shapType)?[[0,0],[t,0],[t,n],[t,n]]:[[0,0],[r,0],[r,n],[t,n]];let a=Qe(i,t,n,e.left||0,e.top||0,!!e.isFlipH,!!e.isFlipV,e.rotate||0);c.left=a.newLeft,c.top=a.newTop,c.width=a.newWidth,c.height=a.newHeight,c.start=a.normalizedPoints[0],c.end=a.normalizedPoints[3],c.cubic=[a.normalizedPoints[1],a.normalizedPoints[2]],c.customControlPoints=!0,c.path=`M ${a.normalizedPoints[0].join(` `)} C ${a.normalizedPoints[1].join(` `)} ${a.normalizedPoints[2].join(` `)} ${a.normalizedPoints[3].join(` `)}`,c.rotate=0,c.flipH=!1,c.flipV=!1,c.isFlipH=!1,c.isFlipV=!1,c.style&&typeof c.style==`object`&&(c.style.left=`${c.left}px`,c.style.top=`${c.top}px`,c.style.width=`${c.width}px`,c.style.height=`${c.height}px`,c.style.rotate=0,c.style.flipH=!1,c.style.flipV=!1)}else if(e.shapType&&/bentConnector/.test(e.shapType)){c.shapType=e.shapType;let n=typeof e.width==`number`&&!isNaN(e.width)&&e.width>0?e.width:100,r=typeof e.height==`number`&&!isNaN(e.height)&&e.height>0?e.height:100,i=null;if(e.shapType===`bentConnector2`)i=[[0,0],[n,0],[n,r]];else{let a=Ze(e.path);i=a&&a.length>=2?a.map(([e,n])=>[e*t,n*t]):[[0,0],[n/2,0],[n/2,r],[n,r]]}let a=Qe(i,n,r,e.left||0,e.top||0,!!e.isFlipH,!!e.isFlipV,e.rotate||0);c.left=a.newLeft,c.top=a.newTop,c.width=a.newWidth,c.height=a.newHeight,c.start=a.normalizedPoints[0],c.end=a.normalizedPoints[a.normalizedPoints.length-1],c.path=a.normalizedPoints.map((e,t)=>`${t===0?`M`:`L`} ${e.join(` `)}`).join(` `),c.rotate=0,c.flipH=!1,c.flipV=!1,c.isFlipH=!1,c.isFlipV=!1,/bentConnector[345]/.test(e.shapType)||a.normalizedPoints.length>3?a.normalizedPoints.length>=4?(c.broken2=[+((a.normalizedPoints[1][0]+a.normalizedPoints[2][0])/2).toFixed(2),+((a.normalizedPoints[1][1]+a.normalizedPoints[2][1])/2).toFixed(2)],c.customControlPoints=!0):c.broken2=[+((c.start[0]+c.end[0])/2).toFixed(2),+((c.start[1]+c.end[1])/2).toFixed(2)]:a.normalizedPoints.length>=3?(c.broken=[a.normalizedPoints[1][0],a.normalizedPoints[1][1]],c.customControlPoints=!0):c.broken=[+((c.start[0]+c.end[0])/2).toFixed(2),+((c.start[1]+c.end[1])/2).toFixed(2)],c.style&&typeof c.style==`object`&&(c.style.left=`${c.left}px`,c.style.top=`${c.top}px`,c.style.width=`${c.width}px`,c.style.height=`${c.height}px`,c.style.rotate=0,c.style.flipH=!1,c.style.flipV=!1)}else{if(e.path&&typeof e.path==`string`&&e.path.trim().length>0&&e.path.trim().split(/[LlCcQqSsTt]/).length>2){c.path=e.path.trim();let t=lZ(c.path);t&&(c.start=t.start,c.end=t.end)}if(e.rotate){let{start:t,end:n,offset:r}=Ye(c,e.rotate);c.start=t,c.end=n,c.left+=r[0],c.top+=r[1],c.style&&typeof c.style==`object`&&(c.style.left=`${c.left}px`,c.style.top=`${c.top}px`)}}return e.startConnection&&(c.startConnection={id:e.startConnection.id?e.startConnection.id.toString():void 0,idx:e.startConnection.idx===void 0?0:e.startConnection.idx}),e.endConnection&&(c.endConnection={id:e.endConnection.id?e.endConnection.id.toString():void 0,idx:e.endConnection.idx===void 0?0:e.endConnection.idx}),c},tt={mid:`middle`,down:`bottom`,up:`top`,ctr:`middle`,center:`middle`,t:`top`,top:`top`,b:`bottom`,bottom:`bottom`};function nt(e,t,n){let r=parseInt(e.slice(1,3),16)/255,i=parseInt(e.slice(3,5),16)/255,a=parseInt(e.slice(5,7),16)/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=0,l=0,u=(o+s)/2;if(o!==s){let e=o-s;l=u>.5?e/(2-o-s):e/(o+s),c=o===r?(i-a)/e+(i<a?6:0):o===i?(a-r)/e+2:(r-i)/e+4,c/=6}let d=Math.min(1,Math.max(0,u*t+n)),f=d<.5?d*(1+l):d+l-d*l,p=2*d-f,m=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),h=e=>Math.round(e*255).toString(16).padStart(2,`0`);return`#${h(m(p,f,c+1/3))}${h(m(p,f,c))}${h(m(p,f,c-1/3))}`.toUpperCase()}function rt(e){let t=e.match(/<a:path\b[^>]*w="(\d+)"[^>]*h="(\d+)"/);if(!t)return null;let n=parseInt(t[1],10),r=parseInt(t[2],10);if(!n||!r)return null;let i=[],a=/<a:(moveTo|lnTo|cubicBezTo)>([\s\S]*?)<\/a:\1>/g,o,s=[0,0];for(;(o=a.exec(e))!==null;){let e=(o[2]||``).match(/<a:pt\s+x="(-?\d+)"\s+y="(-?\d+)"/g)||[];if(o[1]===`cubicBezTo`&&e.length>=3){let t=(e[0]||``).match(/<a:pt\s+x="(-?\d+)"\s+y="(-?\d+)"/),a=(e[1]||``).match(/<a:pt\s+x="(-?\d+)"\s+y="(-?\d+)"/),o=(e[2]||``).match(/<a:pt\s+x="(-?\d+)"\s+y="(-?\d+)"/);if(t&&a&&o){let e=[parseInt(t[1],10),parseInt(t[2],10)],c=[parseInt(a[1],10),parseInt(a[2],10)],l=[parseInt(o[1],10),parseInt(o[2],10)];for(let t=1;t<=4;t++){let a=t/4,o=1-a,u=o*o*o*s[0]+3*o*o*a*e[0]+3*o*a*a*c[0]+a*a*a*l[0],d=o*o*o*s[1]+3*o*o*a*e[1]+3*o*a*a*c[1]+a*a*a*l[1];i.push(`${(u/n*100).toFixed(2)}% ${(d/r*100).toFixed(2)}%`)}s=l}}else for(let t of e){let e=t.match(/<a:pt\s+x="(-?\d+)"\s+y="(-?\d+)"/);if(e){let t=parseInt(e[1],10),a=parseInt(e[2],10);s=[t,a],i.push(`${(t/n*100).toFixed(2)}% ${(a/r*100).toFixed(2)}%`)}}}return i.length>=3?i.join(`, `):null}function it(e){if(!e||typeof e!=`string`||!e.replace(/<[^>]*>/g,``).replace(/ /gi,``).trim())return null;let t=e.match(/(?:^|[^-\w])color\s*:\s*([^;'"\}]+)/i),n=t?t[1].trim():null;if(!n){let t=e.match(/<font\b[^>]*\bcolor=["']?([^"'>\s]+)/i);t&&(n=t[1].trim())}if(!n)return null;let r=n.toLowerCase();if(r===`transparent`||r===`inherit`||r===`initial`||r===`currentcolor`||r===`none`||r===`rgba(0, 0, 0, 0)`||r===`rgba(0,0,0,0)`)return null;if(r.startsWith(`#`))return r.length===4?`#${r[1]}${r[1]}${r[2]}${r[2]}${r[3]}${r[3]}`.toLowerCase():r.slice(0,7);let i=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(i){let e=Math.max(0,Math.min(255,parseInt(i[1],10))),t=Math.max(0,Math.min(255,parseInt(i[2],10))),n=Math.max(0,Math.min(255,parseInt(i[3],10)));return`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`}return n}let at=(e,t)=>{let n=96/72,r=e.size.width,a=e.size.height,o=e=>{if(!e)return``;let t=e.replace(/<\/p>/gi,`
|
|
342
342
|
`).replace(/<\/li>/gi,`
|
|
343
343
|
`).replace(/<br\s*\/?>/gi,`
|
|
344
|
-
`);return t=t.replace(/<\/?[^>]+(>|$)/g,``),t.trim()},s=r*n,c=a*n,l=m.value||`微软雅黑`,u=h.value||`#333333`,d=[g.value||`#5b9bd5`,`#ed7d31`,`#a5a5a5`,`#ffc000`,`#4472c4`,`#70ad47`],f=[];for(let e of BZ())f.push(...e.children);let p=[],_=[];for(let r=0;r<e.slides.length;r++){let i=e.slides[r],a=A(i),s={id:Date.now().toString()+Math.random().toString(36).substr(2,5)+`_`+r,title:`幻灯片 ${r+1}`,subtitle:``,elements:[],background:a.background,bgType:a.bgType,notes:o(i.note)},c=new Map,m=e=>{let t=Date.now().toString()+Math.random().toString(36).substr(2,5);return e!=null&&c.set(e.toString(),t),t},h=(e,i)=>{let a=s.elements.length,o=[...e].sort((e,t)=>(typeof e.order==`number`?e.order:parseFloat(e.order)||0)-(typeof t.order==`number`?t.order:parseFloat(t.order)||0));for(let e of o){let a=e.width||1,o=e.height||1,p=e.left,g=e.top;if(e.width*=n,e.height*=n,e.left*=n,e.top*=n,e.type===`text`)if(e.autoFit&&e.autoFit.type===`text`){let i=n*(e.autoFit.fontScale||100)/100,a=e.fontSize||18,o=Je(e.content,i,a),c={type:`shape`,id:m(e.id),order:e.order===void 0?void 0:e.order,width:e.width,height:e.height,left:e.left,top:e.top,rotate:e.rotate,flipH:!!(e.isFlipH||e.flipH||e.style?.flipH),flipV:!!(e.isFlipV||e.flipV||e.style?.flipV),isFlipH:!!(e.isFlipH||e.flipH||e.style?.flipH),isFlipV:!!(e.isFlipV||e.flipV||e.style?.flipV),viewBox:[200,200],path:`M 0 0 L 200 0 L 200 200 L 0 200 Z`,fill:e.fill?.type===`color`?e.fill.value:``,fixedRatio:!1,outline:{color:e.borderColor,width:+(e.borderWidth*n).toFixed(2),style:e.borderType},text:{content:Ke(e.content,i,e.width,e.height),defaultFontName:l,defaultColor:u,align:tt[e.vAlign]||`top`,lineHeight:1.2},textType:VQ(e),wrap:e.wrap,autoFit:e.autoFit};c.style=c.style||{},c.style.whiteSpace=e.wrap===`none`||e.wrap===!1?`nowrap`:`normal`,c.style.flipH=c.flipH,c.style.flipV=c.flipV,S3(e)&&(c.vertical=!0,c.isVertical=!0,c.style.writingMode=`vertical-rl`);let d=(t?.slideSpLstStyleAlignMap?.[r]||{})[e.id],f=FQ(e.content);d&&(!f||f===`left`)&&(f=d,c.text.content=IQ(c.text.content,d)),f&&(c.style.textAlign=f);let p=it(e.content);if(p&&(c.style.textColor=p,c.style.color=p,c.textColor=p,c.color=p),$e(e.shadow)&&(c.shadow={h:e.shadow.h*n,v:e.shadow.v*n,blur:e.shadow.blur*n,size:e.shadow.size===void 0?100:e.shadow.size,color:e.shadow.color,type:e.shadow.type,preset:e.shadow.preset}),e.textShadow){let t=+(e.textShadow.h*n).toFixed(2),r=+(e.textShadow.v*n).toFixed(2),i=+(e.textShadow.blur*n).toFixed(2),a=e.textShadow.color||`rgba(0,0,0,0.5)`;c.textShadow={h:t,v:r,blur:i,size:e.textShadow.size===void 0?100:e.textShadow.size,color:a,type:e.textShadow.type,preset:e.textShadow.preset},c.style.textShadow=`${t}px ${r}px ${i}px ${a}`}else if(e.content){let t=e.content.match(/(?:text-shadow|shadow)\s*:\s*([^;\"]+)/i);t&&(c.style.textShadow=t[1].trim())}e.reflection&&(c.reflection={enabled:e.reflection.enabled,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity},c.style.reflection={...c.reflection}),e.textReflection&&(c.textReflection={enabled:e.textReflection.enabled,distance:e.textReflection.distance===void 0?20:e.textReflection.distance*n,blur:e.textReflection.blur===void 0?0:e.textReflection.blur*n,size:e.textReflection.size===void 0?8:e.textReflection.size,opacity:e.textReflection.opacity===void 0?10:e.textReflection.opacity},c.style.textReflection={...c.textReflection}),e.link&&(c.link={type:`web`,target:e.link}),e.textInset?(c.text.inset=[+(e.textInset.t*n).toFixed(2),+(e.textInset.r*n).toFixed(2),+(e.textInset.b*n).toFixed(2),+(e.textInset.l*n).toFixed(2)],c.style.padding=`${c.text.inset[0]}px ${c.text.inset[1]}px ${c.text.inset[2]}px ${c.text.inset[3]}px`):(c.text.inset=[0,0,0,0],c.style.padding=`0px`),o.lineHeight&&(c.text.lineHeight=o.lineHeight,c.style.lineHeight=o.lineHeight),o.margin&&(c.text.paragraphSpace=o.margin),s.elements.push(c)}else{let i=e.fontSize||18,a=Je(e.content,n,i),o={type:`text`,id:m(e.id),order:e.order===void 0?void 0:e.order,width:e.width,height:e.height,left:e.left,top:e.top,rotate:e.rotate,flipH:!!(e.isFlipH||e.flipH||e.style?.flipH),flipV:!!(e.isFlipV||e.flipV||e.style?.flipV),isFlipH:!!(e.isFlipH||e.flipH||e.style?.flipH),isFlipV:!!(e.isFlipV||e.flipV||e.style?.flipV),defaultFontName:l,defaultColor:u,content:Ke(e.content,n,e.width,e.height),lineHeight:1.2,outline:{color:e.borderColor,width:+(e.borderWidth*n).toFixed(2),style:e.borderType},fill:e.fill?.type===`color`?e.fill.value:``,textType:VQ(e),vertical:S3(e),isVertical:S3(e),vAlign:e.vAlign||`mid`,wrap:e.wrap,autoFit:e.autoFit||{type:`none`,fontScale:100,lnSpcReduction:0}};o.style=o.style||{},o.style.whiteSpace=e.wrap===`none`||e.wrap===!1?`nowrap`:`normal`,o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,o.style.flipH=o.flipH,o.style.flipV=o.flipV,S3(e)&&(o.style.writingMode=`vertical-rl`),o.style.verticalAlign=tt[e.vAlign]||e.vAlign||`middle`;let c=(t?.slideSpLstStyleAlignMap?.[r]||{})[e.id],d=FQ(e.content);c&&(!d||d===`left`)&&(d=c,o.content=IQ(o.content,c)),d&&(o.style.textAlign=d);let f=it(e.content);if(f&&(o.style.textColor=f,o.style.color=f,o.textColor=f,o.color=f),e.textShadow){let t=+(e.textShadow.h*n).toFixed(2),r=+(e.textShadow.v*n).toFixed(2),i=+(e.textShadow.blur*n).toFixed(2),a=e.textShadow.color||`rgba(0,0,0,0.5)`;o.textShadow={h:t,v:r,blur:i,size:e.textShadow.size===void 0?100:e.textShadow.size,color:a,type:e.textShadow.type,preset:e.textShadow.preset},o.style.textShadow=`${t}px ${r}px ${i}px ${a}`}else if($e(e.shadow))o.shadow={h:e.shadow.h*n,v:e.shadow.v*n,blur:e.shadow.blur*n,color:e.shadow.color,type:e.shadow.type,preset:e.shadow.preset},o.style.boxShadow=`${Math.round(e.shadow.h*n)}px ${Math.round(e.shadow.v*n)}px ${Math.round(e.shadow.blur*n)}px ${e.shadow.color}`;else if(e.content){let t=e.content.match(/(?:text-shadow|shadow)\s*:\s*([^;\"]+)/i);t&&(o.style.textShadow=t[1].trim())}e.reflection&&(o.reflection={enabled:e.reflection.enabled,type:e.reflection.type,preset:e.reflection.preset,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity},o.style.reflection={...o.reflection}),e.textReflection&&(o.textReflection={enabled:e.textReflection.enabled,type:e.textReflection.type,preset:e.textReflection.preset,distance:e.textReflection.distance===void 0?20:e.textReflection.distance*n,blur:e.textReflection.blur===void 0?0:e.textReflection.blur*n,size:e.textReflection.size===void 0?8:e.textReflection.size,opacity:e.textReflection.opacity===void 0?10:e.textReflection.opacity},o.style.textReflection={...o.textReflection}),e.link&&(o.link={type:`web`,target:e.link}),e.textInset?(o.inset=[+(e.textInset.t*n).toFixed(2),+(e.textInset.r*n).toFixed(2),+(e.textInset.b*n).toFixed(2),+(e.textInset.l*n).toFixed(2)],o.style.padding=`${o.inset[0]}px ${o.inset[1]}px ${o.inset[2]}px ${o.inset[3]}px`):(o.inset=[0,0,0,0],o.style.padding=`0px`),a.lineHeight&&(o.lineHeight=a.lineHeight,o.style.lineHeight=a.lineHeight),a.margin&&(o.paragraphSpace=a.margin),s.elements.push(o)}else if(e.type===`image`){let i=``;if(e.blob&&typeof e.blob==`string`)i=e.blob;else if(e.src&&typeof e.src==`string`)i=e.src;else{let t=e.base64||e.picBase64;i=t&&typeof t==`string`?t.startsWith(`data:`)?t:`data:image/png;base64,${t}`:e.content||``}let a=!!(e.isFlipH||e.flipH||e.style?.flipH),o=!!(e.isFlipV||e.flipV||e.style?.flipV),c={type:`image`,id:m(e.id),order:e.order===void 0?void 0:e.order,src:i,content:i,width:e.width,height:e.height,left:e.left,top:e.top,fixedRatio:!0,rotate:e.rotate,flipH:a,flipV:o,isFlipH:a,isFlipV:o};c.style=c.style||{},c.style.left=`${e.left}px`,c.style.top=`${e.top}px`,c.style.width=`${e.width}px`,c.style.height=`${e.height}px`,c.style.flipH=a,c.style.flipV=o,e.borderWidth&&(c.outline={color:e.borderColor,width:+(e.borderWidth*n).toFixed(2),style:e.borderType});let l=[`rect`,`roundRect`,`ellipse`,`triangle`,`rhombus`,`diamond`,`flowChartMerge`,`pentagon`,`hexagon`,`heptagon`,`octagon`,`parallelogram`,`trapezoid`,`heart`],u=e.geom||`rect`,d,f=t?.slidePicGeomMap?.[r]?.[String(e.id)];f&&(u===`rect`||!u)&&(f.geom&&(u=f.geom),f.polygonPoints&&(d=f.polygonPoints)),u===`diamond`&&(u=`rhombus`),u.indexOf(`custom:`)!==-1&&(u=u.replace(`custom:`,``)),u!==`custom`&&!l.includes(u)&&(u=`rect`),d?c.clip={type:`polygon`,points:d,range:e.rect?[[e.rect.l||0,e.rect.t||0],[100-(e.rect.r||0),100-(e.rect.b||0)]]:[[0,0],[100,100]]}:e.rect?c.clip={shape:u,range:[[e.rect.l||0,e.rect.t||0],[100-(e.rect.r||0),100-(e.rect.b||0)]]}:u&&u!==`rect`&&(c.clip={shape:u,range:[[0,0],[100,100]]}),$e(e.shadow)&&(c.shadow={h:e.shadow.h*n,v:e.shadow.v*n,blur:e.shadow.blur*n,color:e.shadow.color,type:e.shadow.type,preset:e.shadow.preset}),e.reflection&&(c.reflection={enabled:e.reflection.enabled,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity},c.style.reflection={...c.reflection}),e.filters&&(c.filters=e.filters),e.link&&(c.link={type:`web`,target:e.link}),s.elements.push(c)}else if(e.type===`math`)s.elements.push({type:`image`,id:m(e.id),order:e.order===void 0?void 0:e.order,name:e.name||`公式`,src:e.picBlob||e.picBase64||e.picRef,width:e.width,height:e.height,left:e.left,top:e.top,fixedRatio:!0,rotate:0});else if(e.type===`audio`&&(e.blob||e.src||e.value)){let t=e.blob||e.src||e.value,n=typeof t==`string`?t:t instanceof Blob?URL.createObjectURL(t):``;s.elements.push({type:`audio`,id:m(e.id),order:e.order===void 0?void 0:e.order,name:e.name||`音频`,src:n,width:e.width,height:e.height,left:e.left,top:e.top,rotate:0,fixedRatio:!1,color:d[0],loop:!1,autoplay:!1})}else if(e.type===`video`&&(e.blob||e.src||e.value)){let t=e.blob||e.src||e.value,n=typeof t==`string`?t:t instanceof Blob?URL.createObjectURL(t):``;s.elements.push({type:`video`,id:m(e.id),order:e.order===void 0?void 0:e.order,name:e.name||`视频`,src:n,width:e.width,height:e.height,left:e.left,top:e.top,rotate:0,autoplay:!1})}else if(e.type===`shape`)if(e.shapType===`line`||/straightConnector/.test(e.shapType)||/bentConnector/.test(e.shapType)||/curvedConnector/.test(e.shapType)){let t=et(e,n);e.id&&c.set(e.id.toString(),t.id),s.elements.push(t)}else{let t=f.find(t=>{let n=(t.pptxShapeType||``).toLowerCase(),r=(t.pathFormula||``).toLowerCase(),i=String(e.shapType||``).toLowerCase();return n===i||r===i||(i===`snip1rect`||i===`cutrectsingle`)&&(n===`snip1rect`||n===`cutrectsingle`||r===`cutrectsingle`)||(i===`snip2samerect`||i===`cutrectsameside`)&&(n===`snip2samerect`||n===`cutrectsameside`||r===`cutrectsameside`)||(i===`snip2diagrect`||i===`cutrectdiagonal`)&&(n===`snip2diagrect`||n===`cutrectdiagonal`||r===`cutrectdiagonal`)||(i===`sniproundrect`||i===`cutroundrect`)&&(n===`sniproundrect`||n===`cutroundrect`||r===`cutroundrect`)||(i===`round1rect`||i===`roundrectsingle`)&&(n===`round1rect`||n===`roundrectsingle`||r===`roundrectsingle`)||(i===`round2samerect`||i===`roundrectsameside`)&&(n===`round2samerect`||n===`roundrectsameside`||r===`roundrectsameside`)||(i===`round2diagrect`||i===`roundrectdiagonal`)&&(n===`round2diagrect`||n===`roundrectdiagonal`||r===`roundrectdiagonal`)}),r=e.fill?.type===`gradient`?e.fill.value||e.fill:e.gradient||void 0,i=r?yQ(r):void 0,c=e.border?.gradient||e.outline?.gradient,d=c?yQ(c):void 0,p=e.fill?.type===`image`?e.fill.value:null,h=p?p.blob||p.base64||p.src||p.url||(typeof p==`string`?p:void 0):void 0,g=typeof e.fill==`string`?e.fill.trim()===``?`none`:e.fill:e.fill?.type===`color`?e.fill.value:e.fill?.type===`gradient`?`transparent`:e.fill?dQ(e.fill,`none`):`none`,_=e.text?.fontSize||16,v=Je(e.content,n,_),y=!!(e.isFlipH||e.flipH||e.style?.flipH),b=!!(e.isFlipV||e.flipV||e.style?.flipV),x=e.borderLineCap||e.border?.lineCap||e.lineCap||e.outline?.lineCap,S=x===`rnd`||x===`round`?`round`:x===`sq`||x===`square`?`square`:x===`flat`?`flat`:void 0,C={color:e.borderColor,width:+(e.borderWidth*n).toFixed(2),style:e.borderType,gradient:d,lineCap:S},w={type:`shape`,id:m(e.id),order:e.order===void 0?void 0:e.order,width:e.width,height:e.height,left:e.left,top:e.top,viewBox:[200,200],path:`M 0 0 L 200 0 L 200 200 L 0 200 Z`,fill:g,gradient:i,pattern:h,border:e.border?{...e.border,gradient:d}:d?{gradient:d}:void 0,fixedRatio:!1,rotate:e.rotate,outline:C,lineCap:S,borderLineCap:S,text:{content:Ke(e.content,n,e.width,e.height),defaultFontName:l,defaultColor:u,align:tt[e.vAlign]||`top`},flipH:y,flipV:b,isFlipH:y,isFlipV:b,shapType:e.shapType,wrap:e.wrap,autoFit:e.autoFit};w.style=w.style||{},w.style.whiteSpace=e.wrap===`none`||e.wrap===!1?`nowrap`:`normal`,w.style.left=`${e.left}px`,w.style.top=`${e.top}px`,w.style.width=`${e.width}px`,w.style.height=`${e.height}px`,w.style.rotate=e.rotate===void 0?0:e.rotate,w.style.flipH=y,w.style.flipV=b,w.style.fill=g,h&&(w.style.pattern=h),w.style.borderColor=e.borderColor||e.outline?.color||`transparent`,w.style.borderWidth=e.borderWidth===void 0?e.outline?.width===void 0?`0px`:`${e.outline.width}px`:`${+(e.borderWidth*n).toFixed(2)}px`,w.style.borderStyle=e.borderType||e.outline?.style||`solid`,S&&(w.style.borderLineCap=S,w.style.strokeLinecap=S===`round`?`round`:S===`square`?`square`:`butt`);let T=FQ(e.content||e.text?.content);T&&(w.style.textAlign=T);let E=it(e.content||e.text?.content);if(E&&(w.style.textColor=E,w.style.color=E,w.textColor=E,w.color=E),e.link&&(w.link={type:`web`,target:e.link}),v.lineHeight&&(w.text.lineHeight=v.lineHeight,w.style.lineHeight=v.lineHeight),v.margin&&(w.text.paragraphSpace=v.margin),e.textInset?(w.text.inset=[+(e.textInset.t*n).toFixed(2),+(e.textInset.r*n).toFixed(2),+(e.textInset.b*n).toFixed(2),+(e.textInset.l*n).toFixed(2)],w.style.padding=`${w.text.inset[0]}px ${w.text.inset[1]}px ${w.text.inset[2]}px ${w.text.inset[3]}px`):(w.text.inset=[0,0,0,0],w.style.padding=`0px`),e.textShadow){let t=+(e.textShadow.h*n).toFixed(2),r=+(e.textShadow.v*n).toFixed(2),i=+(e.textShadow.blur*n).toFixed(2),a=e.textShadow.color||`rgba(0,0,0,0.5)`;w.textShadow={h:t,v:r,blur:i,size:e.textShadow.size===void 0?100:e.textShadow.size,color:a,type:e.textShadow.type,preset:e.textShadow.preset}}if($e(e.shadow)&&(w.shadow={h:e.shadow.h*n,v:e.shadow.v*n,blur:e.shadow.blur*n,color:e.shadow.color,type:e.shadow.type,preset:e.shadow.preset}),e.reflection&&(w.reflection={enabled:e.reflection.enabled,type:e.reflection.type,preset:e.reflection.preset,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity},w.style.reflection={...w.reflection}),e.textReflection&&(w.textReflection={enabled:e.textReflection.enabled,type:e.textReflection.type,preset:e.textReflection.preset,distance:e.textReflection.distance===void 0?20:e.textReflection.distance*n,blur:e.textReflection.blur===void 0?0:e.textReflection.blur*n,size:e.textReflection.size===void 0?8:e.textReflection.size,opacity:e.textReflection.opacity===void 0?10:e.textReflection.opacity},w.style.textReflection={...w.textReflection}),t){if(w.path=t.path,w.viewBox=t.viewBox,t.pathFormula){w.pathFormula=t.pathFormula,w.viewBox=[e.width,e.height];let n=zZ()[t.pathFormula];if(n&&`editable`in n&&n.editable){let t=n.defaultValue;if(e.keypoints){let r=0;e.shapType===`roundRect`&&(r=(e.keypoints.adj===void 0?.334:e.keypoints.adj)*.5),(e.shapType===`cutRectSingle`||e.shapType===`snip1Rect`)&&(r=(e.keypoints.adj===void 0?.334:e.keypoints.adj)*.5),e.shapType===`snip2SameRect`||e.shapType,e.shapType===`snip2DiagRect`||e.shapType,e.shapType===`snipRoundRect`||e.shapType,(e.shapType===`round1Rect`||e.shapType===`roundRectSingle`)&&(r=(e.keypoints.adj===void 0?.334:e.keypoints.adj)*.5),e.shapType===`round2SameRect`||e.shapType,e.shapType===`round2DiagRect`||e.shapType,e.shapType,e.shapType,e.shapType===`triangle`&&(r=(e.keypoints.adj===void 0?1:e.keypoints.adj)*.5),e.shapType===`trapezoid`&&(r=.5-(e.keypoints.adj===void 0?1:e.keypoints.adj)*.25),e.shapType===`moon`&&(r=e.keypoints.adj===void 0?.5:e.keypoints.adj),e.shapType===`sun`&&(r=e.keypoints.adj===void 0?.25:e.keypoints.adj/2),e.shapType===`hexagon`&&(r=e.keypoints.adj===void 0?.25:e.keypoints.adj>1?e.keypoints.adj/1e5:e.keypoints.adj);let i=!1;if(e.shapType===`halfFrame`){i=!0;let r=e.keypoints.adj1===void 0?.25:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.25:e.keypoints.adj2;n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`leftArrow`||e.shapType===`rightArrow`||e.shapType===`upArrow`||e.shapType===`downArrow`||e.shapType===`upDownArrow`||e.shapType===`leftRightArrow`){i=!0;let r=e.shapType===`upDownArrow`||e.shapType===`leftRightArrow`,a=e.keypoints.adj1,o=e.keypoints.adj2,s=r?a===void 0?.3:a:o===void 0?.5:o,c=r?o===void 0?.3:o/2:a===void 0?.25:a/2;n.range&&(s=Math.max(n.range[0][0],Math.min(n.range[0][1],s)),c=Math.max(n.range[1][0],Math.min(n.range[1][1],c))),t=[s,c]}if(e.shapType===`quadArrow`||e.shapType===`tArrow`||e.shapType===`leftRightUpArrow`){i=!0;let r=e.keypoints.adj1===void 0?.4:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.1:e.keypoints.adj2/2,o=e.keypoints.adj3===void 0?.2:e.keypoints.adj3/2,s=r,c=a,l=o;n.range&&(s=Math.max(n.range[0][0],Math.min(n.range[0][1],s)),c=Math.max(n.range[1][0],Math.min(n.range[1][1],c)),l=Math.max(n.range[2][0],Math.min(n.range[2][1],l))),t=[s,c,l]}if(e.shapType===`bentArrow`){i=!0;let r=e.keypoints.adj1===void 0?.4:e.keypoints.adj1/2,a=e.keypoints.adj2===void 0?.2:e.keypoints.adj2/2,o=e.keypoints.adj3===void 0?.25:e.keypoints.adj3/2,s=e.keypoints.adj4===void 0?.4:e.keypoints.adj4/2,c=r,l=a,u=o,d=s;n.range&&(c=Math.max(n.range[0][0],Math.min(n.range[0][1],c)),l=Math.max(n.range[1][0],Math.min(n.range[1][1],l)),u=Math.max(n.range[2][0],Math.min(n.range[2][1],u)),d=Math.max(n.range[3][0],Math.min(n.range[3][1],d))),t=[c,l,u,d]}if(e.shapType===`uturnArrow`){i=!0;let r=e.keypoints.adj1===void 0?.25:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.25:e.keypoints.adj2,o=e.keypoints.adj3===void 0?.25:e.keypoints.adj3,s=e.keypoints.adj4===void 0?.4375:e.keypoints.adj4,c=e.keypoints.adj5===void 0?1:e.keypoints.adj5,l=r,u=o,d=s,f=a*2;if(l+u>.95){let e=.85/(l+u);l*=e,u*=e}f>.95&&(f=.85),n.range&&(c=Math.max(n.range[0][0],Math.min(n.range[0][1],c)),l=Math.max(n.range[1][0],Math.min(n.range[1][1],l)),u=Math.max(n.range[2][0],Math.min(n.range[2][1],u)),d=Math.max(n.range[3][0],Math.min(n.range[3][1],d)),f=Math.max(n.range[4][0],Math.min(n.range[4][1],f))),t=[c,l,u,d,f]}if(e.shapType===`snip2SameRect`){i=!0;let r=e.keypoints.adj1===void 0?.334:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.334:e.keypoints.adj2;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`snip2DiagRect`){i=!0;let r=e.keypoints.adj1===void 0?0:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.334:e.keypoints.adj2;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`snipRoundRect`){i=!0;let r=e.keypoints.adj1===void 0?.334:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.334:e.keypoints.adj2;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`round2SameRect`){i=!0;let r=e.keypoints.adj2===void 0?0:e.keypoints.adj2,a=e.keypoints.adj1===void 0?.25:e.keypoints.adj1;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`round2DiagRect`){i=!0;let r=e.keypoints.adj1===void 0?.25:e.keypoints.adj1,a=e.keypoints.adj2===void 0?0:e.keypoints.adj2;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}e.shapType===`frame`&&(r=(e.keypoints.adj1===void 0?.25:e.keypoints.adj1)*.5),e.shapType===`corner`&&(r=((e.keypoints.adj1===void 0?1:e.keypoints.adj1)+(e.keypoints.adj2===void 0?1:e.keypoints.adj2))/2*.5),e.shapType===`diagStripe`&&(r=(e.keypoints.adj===void 0?1:e.keypoints.adj)*.5),e.shapType===`donut`&&(r=e.keypoints.adj===void 0?.25:e.keypoints.adj*.5),e.shapType===`noSmoking`&&(r=e.keypoints.adj===void 0?.1875:e.keypoints.adj*.5),e.shapType===`plus`&&(r=e.keypoints.adj===void 0?.3:e.keypoints.adj*.5),e.shapType===`concaveRect`&&(r=e.keypoints.adj===void 0?.15:e.keypoints.adj*.5),e.shapType===`can`&&(r=e.keypoints.adj===void 0?.2:e.keypoints.adj*.5),e.shapType===`cube`&&(r=e.keypoints.adj===void 0?.25:e.keypoints.adj*.5),e.shapType===`bevel`&&(r=e.keypoints.adj===void 0?.15:e.keypoints.adj*.5),(e.shapType===`chevron`||e.shapType===`homePlate`)&&(r=e.keypoints.adj===void 0?.5:e.keypoints.adj/2),i||(n.range&&r<n.range[0][0]&&(r=n.range[0][0]),n.range&&r>n.range[0][1]&&(r=n.range[0][1]),t=[r])}if(n.defaultValue){let e=t?[...t]:[],r=n.defaultValue;for(let t=e.length;t<r.length;t++)e.push(r[t]);t=e}w.path=n.formula(e.width,e.height,t),w.keypoints=t,w.viewBox=[e.width,e.height]}else n&&(w.path=n.formula(e.width,e.height),w.viewBox=[e.width,e.height])}}else if(e.path&&e.path.indexOf(`NaN`)===-1&&e.shapType!==`custom`)if(e.shapType===`arc`)w.path=e.path,w.viewBox=[a,o];else if(e.shapType===`blockArc`)w.fixedRatio=!0,w.path=e.path,w.viewBox=[a,o];else{let t=TLe(e.path);w.path=t.path;let n=t.width,r=t.height;n/r>a/o?w.viewBox=[n,n*o/a]:w.viewBox=[r*a/o,r]}if(e.shapType===`custom`){let t=e.path||``;t.indexOf(`NaN`)!==-1&&(w.width===0&&(w.width=.1),w.height===0&&(w.height=.1),t=t.replace(/NaN/g,`0`)),w.path=t,w.viewBox=[a,o]}w.path&&typeof w.path==`string`&&(w.path=w.path.trim(),w.content=w.path,e.shapType===`ellipse`&&(w.content=`circle`,w.shapType=`ellipse`)),w.path&&w.viewBox[0]&&w.viewBox[1]&&s.elements.push(w)}else if(e.type===`table`){let t=e.data.length,r=e.data[0].length,i={fontname:l,color:u},a=[];for(let o=0;o<t;o++){let t=[];for(let a=0;a<r;a++){let r=e.data[o][a],s=document.createElement(`div`);s.innerHTML=r.text;let c=s.querySelector(`p`)?.style.textAlign||`left`,l=s.querySelector(`span`),u=l?.style.fontSize?parseFloat(l?.style.fontSize):14,d=e.rowHeights?.[o]||30;u>=20&&d<=35&&(u=Math.min(14,Math.max(10,Math.floor(d*.45))));let f=(u*n).toFixed(1)+`px`,p=l?.style.fontFamily||``,m=l?.style.color||r.fontColor,h=r.text?r.text.replace(/font-size:\s*[\d.]+(?:pt|px)/gi,`font-size: ${f}`):s.innerText;t.push({id:Date.now().toString()+Math.random().toString(36).substr(2,5),colspan:r.colSpan||1,rowspan:r.rowSpan||1,text:h,fillColor:r.fillColor,fontColor:r.fontColor,fontBold:r.fontBold,borders:r.borders,style:{...i,align:[`left`,`right`,`center`].includes(c)?c:`left`,fontsize:f,fontname:p,color:m,bold:r.fontBold,backcolor:r.fillColor,borders:r.borders}}),s=null}a.push(t)}let o=e.colWidths.reduce((e,t)=>e+t,0),c=e.colWidths.map(e=>e/o),d=e.data[0]?.[0],f=d?.borders?.top||d?.borders?.bottom||e.borders?.top||e.borders?.bottom||d?.borders?.left||d?.borders?.right||e.borders?.left||e.borders?.right,p=f?.borderWidth||0,h=f?.borderType||`solid`,g=f?.borderColor||`#eeece1`,_=p>0?{width:+(p*n).toFixed(2),style:h,color:g}:{width:0,style:`solid`,color:`transparent`},v=e.rowHeights?e.rowHeights.map(e=>e*n):[],y=v.reduce((e,t)=>e+t,0),b=y>(e.height||0)?y:e.height;s.elements.push({type:`table`,id:m(e.id),order:e.order===void 0?void 0:e.order,width:e.width,height:b,left:e.left,top:e.top,colWidths:c,rowHeights:v,rotate:0,data:a,borders:e.borders,outline:_,cellMinHeight:v[0]||36,style:{left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${b}px`}})}else if(e.type===`chart`){let t,n,r;if(e.chartType===`scatterChart`||e.chartType===`bubbleChart`)t=e.data&&e.data[0]?e.data[0].map((e,t)=>typeof e==`string`&&e?e:`坐标${t+1}`):[],n=[`X`,`Y`],r=e.data||[];else{let i=e.data;t=Object.values(i[0].xlabels),n=i.map(e=>e.key),r=i.map(e=>e.values.map(e=>e.y))}let i={},a=`bar`;switch(e.chartType){case`barChart`:case`bar3DChart`:a=`bar`,e.barDir===`bar`&&(a=`horizontal-bar`),(e.grouping===`stacked`||e.grouping===`percentStacked`)&&(i.stack=!0);break;case`lineChart`:case`line3DChart`:(e.grouping===`stacked`||e.grouping===`percentStacked`)&&(i.stack=!0),a=`line`;break;case`areaChart`:case`area3DChart`:(e.grouping===`stacked`||e.grouping===`percentStacked`)&&(i.stack=!0),a=`area`;break;case`scatterChart`:case`bubbleChart`:a=`scatter`;break;case`pieChart`:case`pie3DChart`:a=`pie`;break;case`radarChart`:a=`radar`;break;case`doughnutChart`:case`donut`:case`ring`:a=`donut`;break;default:a=e.chartType||`bar`}let o=n.map((e,t)=>({label:e,data:r[t]||[]})),c=(e.colors||[]).filter(e=>e&&typeof e==`string`),l=c.length?c:d;s.elements.push({type:`chart`,id:m(e.id),order:e.order===void 0?void 0:e.order,chartType:a,width:e.width,height:e.height,left:e.left,top:e.top,rotate:0,holeSize:e.holeSize,showPercent:e.showPercent,showLegend:e.showLegend===void 0?!0:e.showLegend,themeColors:l,colors:l,textColor:u,style:{left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,fill:`transparent`,chartColors:l,color:u},data:{labels:t,legends:n,series:r,datasets:o},options:i})}else if(e.type===`group`){let t=a||1,r=o||1,i=e=>{let t=e.shapType||e.pathFormula||e.shapeType||e.content;if(!t)return null;let n=String(t).toLowerCase();for(let r of BZ())for(let i of r.children){let r=(i.pptxShapeType||``).toLowerCase(),a=(i.pathFormula||``).toLowerCase();if(r===n||a===n||(n===`snip1rect`||n===`cutrectsingle`)&&(r===`snip1rect`||r===`cutrectsingle`||a===`cutrectsingle`)||(n===`snip2samerect`||n===`cutrectsameside`)&&(r===`snip2samerect`||r===`cutrectsameside`||a===`cutrectsameside`)||(n===`snip2diagrect`||n===`cutrectdiagonal`)&&(r===`snip2diagrect`||r===`cutrectdiagonal`||a===`cutrectdiagonal`)||(n===`sniproundrect`||n===`cutroundrect`)&&(r===`sniproundrect`||r===`cutroundrect`||a===`cutroundrect`)||(n===`round1rect`||n===`roundrectsingle`)&&(r===`round1rect`||r===`roundrectsingle`||a===`roundrectsingle`)||(n===`round2samerect`||n===`roundrectsameside`)&&(r===`round2samerect`||r===`roundrectsameside`||a===`roundrectsameside`)||(n===`round2diagrect`||n===`roundrectdiagonal`)&&(r===`round2diagrect`||r===`roundrectdiagonal`||a===`roundrectdiagonal`)){let r=e.width||200,a=e.height||200,o=i.pptxShapeType||t,s=i.pathFormula;if(i.pathFormula&&zZ()[i.pathFormula]){let t=zZ()[i.pathFormula],c=t.defaultValue?[...t.defaultValue]:[];return e.keypoints&&(n===`roundrect`||n===`snip1rect`||n===`cutrectsingle`||n===`round1rect`||n===`roundrectsingle`)&&(c=[(e.keypoints.adj===void 0?.334:e.keypoints.adj)*.5]),{path:t.formula(r,a,c),viewBox:[r,a],shapType:o,pathFormula:s,keypoints:c}}else if(i.path)return{path:i.path,viewBox:i.viewBox||[200,200],shapType:o,pathFormula:s}}}return null},c=(e,t)=>{if(!e)return null;let n=e.id===void 0?null:t.get(String(e.id));if(!n||!xZ(n))return null;let r=typeof n.width==`number`?n.width:0,i=typeof n.height==`number`?n.height:0,a=typeof n.left==`number`?n.left:0,o=typeof n.top==`number`?n.top:0,s=typeof e.idx==`number`?e.idx:-1;if(/ellipse|oval/i.test(String(n.shapType||``))){let e=r/2,t=i/2,n=a+e,c=o+t,l=Math.SQRT1_2;switch(s){case 0:return[n,o];case 1:return[n-e*l,c-t*l];case 2:return[a,c];case 3:return[n-e*l,c+t*l];case 4:return[n,o+i];case 5:return[n+e*l,c+t*l];case 6:return[a+r,c];case 7:return[n+e*l,c-t*l];default:return null}}switch(s){case 0:return[a+r/2,o];case 1:return[a,o+i/2];case 2:return[a+r/2,o+i];case 3:return[a+r,o+i/2];default:return null}},l=(e,t,n)=>{if(!e||typeof e!=`string`)return[t||200,n||200];let r=e.match(/[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g);if(!r||r.length<2)return[t||200,n||200];let i=r.map(Number),a=0,o=0;for(let e=0;e<i.length-1;e+=2){let t=i[e],n=i[e+1];!isNaN(t)&&isFinite(t)&&t>a&&(a=t),!isNaN(n)&&isFinite(n)&&n>o&&(o=n)}return a>0||o>0?[a>0?a:t||200,o>0?o:n||200]:[t||200,n||200]},f=(e,t,n,r)=>{if(!e||typeof e!=`string`)return null;let i=(t||0)*r,a=(n||0)*r,o=e.match(/[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g)?.map(Number)||[];if(o.length<4)return null;let s=1/0,c=-1/0,l=1/0,u=-1/0;for(let e=0;e<o.length-1;e+=2){let t=o[e],n=o[e+1];isNaN(t)||(s=Math.min(s,t),c=Math.max(c,t)),isNaN(n)||(l=Math.min(l,n),u=Math.max(u,n))}let d=c-s,f=u-l;if(a<=1&&f<=.001&&i>0)return{path:`M 0 0 L ${i.toFixed(4)} 0`,start:[0,0],end:[i,0]};if(i<=1&&d<=.001&&a>0)return{path:`M 0 0 L 0 ${a.toFixed(4)}`,start:[0,0],end:[0,a]};let p=i>0&&d>0&&(d<i*.3||d<10)?i/d:r,m=a>0&&f>0&&(f<a*.3||f<10)?a/f:r,h=0,g=e.replace(/([A-Za-z])|([-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?)/g,(e,t,n)=>{if(t)return t+` `;let r=parseFloat(n),i=h%2==0;return h++,i?(r*p).toFixed(4):(r*m).toFixed(4)}),_=lZ(g);return{path:g,start:_?_.start:[0,0],end:_?_.end:[i,a]}},p=(e,t,r,a=new Map)=>{let o=typeof e.width==`number`&&e.width>0?e.width:t,s=typeof e.height==`number`&&e.height>0?e.height:r,h=typeof e.left==`number`?e.left:0,g=typeof e.top==`number`?e.top:0,_=h/t*100,v=g/r*100,y=o/t*100,b=s/r*100,x=/^(?:rightArrow|leftArrow|upArrow|downArrow|leftRightArrow|upDownArrow|quadArrow|leftRightUpArrow|bentArrow|uturnArrow|leftUpArrow|bentUpArrow|curvedRightArrow|curvedLeftArrow|curvedUpArrow|curvedDownArrow|stripedRightArrow|notchedRightArrow|pentagon|chevron|circularArrow|swooshArrow|.*ArrowCallout)$/i.test(String(e.shapType||``)),S=!x&&(e.type===`line`||!!(e.startConnection||e.endConnection)||!!(e.borderTailEnd||e.borderHeadEnd)||/^(?:line|straightConnector\d*|bentConnector\d*|curvedConnector\d*)$/i.test(String(e.shapType||``))||/连接符/i.test(String(e.name||``))&&!x),C=S?!1:!!(e.isFlipH||e.flipH||e.style?.flipH),w=S?!1:!!(e.isFlipV||e.flipV||e.style?.flipV),T=S3(e),E=e.fontSize||e.style?.fontSize;if(!E&&(e.content||e.text)){let t=typeof e.content==`string`?e.content:typeof e.text==`string`?e.text:e.text?.content||``,r=[];for(let e of t.matchAll(/font-size\s*:\s*([\d.]+)\s*(pt|px)/gi)){let t=parseFloat(e[1]);r.push(e[2].toLowerCase()===`pt`?Math.round(t*n):Math.round(t))}r.length&&(E=Math.min(...r))}let D=null,O=typeof e.content==`string`?e.content:typeof e.text==`string`?e.text:e.text?.content||``;/<(p|div|li)[\s>]/i.test(O)&&(D=Je(O,n,E||16));let k=e.borderLineCap||e.border?.lineCap||e.lineCap,A=k===`rnd`||k===`round`?`round`:k===`sq`||k===`square`?`square`:k===`flat`?`flat`:void 0,j={...e.style||{},left:`${_.toFixed(4)}%`,top:`${v.toFixed(4)}%`,width:`${y.toFixed(4)}%`,height:`${b.toFixed(4)}%`,rotate:e.rotate===void 0?e.style?.rotate||0:e.rotate,flipH:C,flipV:w,fill:S?`none`:dQ(e.fill===void 0?e.style?.fill:e.fill,`none`),color:e.color||e.style?.color||u,borderColor:e.borderColor||e.style?.borderColor||`transparent`,borderWidth:e.borderWidth?`${(e.borderWidth*n).toFixed(1)}px`:e.style?.borderWidth||`0px`,borderStyle:e.borderType||e.style?.borderStyle||`solid`,borderLineCap:A,strokeLinecap:A===`round`?`round`:A===`square`?`square`:A?`butt`:void 0,fontSize:E?`${E}px`:void 0,whiteSpace:e.wrap===`none`||e.wrap===!1?`nowrap`:e.style?.whiteSpace||`normal`};D?.lineHeight&&(j.lineHeight=D.lineHeight),D?.margin&&(j.paragraphSpace=D.margin),e.reflection&&(j.reflection={enabled:e.reflection.enabled,type:e.reflection.type,preset:e.reflection.preset,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity}),e.textReflection&&(j.textReflection={enabled:e.textReflection.enabled,type:e.textReflection.type,preset:e.textReflection.preset,distance:e.textReflection.distance===void 0?20:e.textReflection.distance*n,blur:e.textReflection.blur===void 0?0:e.textReflection.blur*n,size:e.textReflection.size===void 0?8:e.textReflection.size,opacity:e.textReflection.opacity===void 0?10:e.textReflection.opacity}),$e(e.shadow)&&(j.boxShadow=`${Math.round((e.shadow.h||0)*n)}px ${Math.round((e.shadow.v||0)*n)}px ${Math.round((e.shadow.blur||0)*n)}px ${e.shadow.color||`rgba(0,0,0,0.5)`}`),T&&(j.writingMode=`vertical-rl`);let M=(e.content||``).trim(),N=``,P=e.viewBox,F=null,I,L,R,z=e.type===`image`||e.type===`pic`||e.type===`picture`||!!(e.src||e.base64||e.picBase64)||e.fill&&typeof e.fill==`object`&&(e.fill.type===`image`||e.fill.type===`pic`||e.fill.type===`picture`);if(e.padding===void 0?e.style?.padding!==void 0&&(j.padding=String(e.style.padding)):Array.isArray(e.padding)?j.padding=e.padding.map(e=>`${(e*n).toFixed(1)}px`).join(` `):typeof e.padding==`number`?j.padding=`${(e.padding*n).toFixed(1)}px`:j.padding=String(e.padding),z||e.type===`audio`||e.type===`video`){let t=e.src||e.base64||e.picBase64||e.content||e.blob||e.value||``;if(!t&&e.fill&&typeof e.fill==`object`){let n=e.fill.value||e.fill;typeof n==`string`?t=n:typeof n==`object`&&n&&(t=n.base64||n.picBase64||n.src||n.blob||n.url||``)}let n=typeof t==`string`?t:t.base64||t.picBase64||t.src||t.blob||``;n=n.trim(),n.length>50&&!n.startsWith(`data:`)&&!n.startsWith(`http:`)&&!n.startsWith(`https:`)&&!n.startsWith(`blob:`)&&!n.startsWith(`/`)&&(n=`data:image/png;base64,${n}`),M=n}e.margin!==void 0&&!j.padding&&(Array.isArray(e.margin)?j.padding=e.margin.map(e=>`${(e*n).toFixed(1)}px`).join(` `):typeof e.margin==`number`?j.padding=`${(e.margin*n).toFixed(1)}px`:j.padding=String(e.margin));let B=e.textInset||e.inset;B&&!j.padding&&(Array.isArray(B)?j.padding=B.map(e=>`${(e*n).toFixed(1)}px`).join(` `):typeof B==`object`&&(j.padding=`${((B.t||0)*n).toFixed(1)}px ${((B.r||0)*n).toFixed(1)}px ${((B.b||0)*n).toFixed(1)}px ${((B.l||0)*n).toFixed(1)}px`));let V=o<=120&&s<=45,ee=typeof e.content==`string`&&/white-space:\s*nowrap/i.test(e.content);j.padding||(V?(j.padding=`0px 2px`,j.whiteSpace||=`nowrap`):e.type===`text`&&(j.padding=`0px`,ee&&!j.whiteSpace&&(j.whiteSpace=`nowrap`))),ee&&!j.whiteSpace&&(j.whiteSpace=`nowrap`);let te=e.verticalAlign||e.style?.verticalAlign||e.vAlign;te?j.verticalAlign=tt[te]||te:e.type===`text`&&(j.verticalAlign=`top`);let ne=null;if(z||e.type===`audio`||e.type===`video`)(!M||M.trim().length===0)&&(M=(e.content||e.src||e.base64||e.picBase64||e.value||``).trim());else if(e.type===`shape`){if(e.path&&(!N&&M&&!M.trim().startsWith(`M`)&&!M.trim().startsWith(`m`)&&(N=M),M=e.path.trim()),ne=i(e),ne)M=ne.path,P=ne.viewBox;else if(M&&(M.trim().startsWith(`M`)||M.trim().startsWith(`m`)))if(e.shapType===`arc`||e.shapType===`blockArc`)P=[e.width||o,e.height||s];else{let t=l(M,o,s);t&&(t[0]>0||t[1]>0)?P=[t[0]>0?t[0]:o||200,t[1]>0?t[1]:s||200]:P||=e.width&&e.height?[e.width,e.height]:t}if(S){let i=typeof e.path==`string`?e.path.trim():``,l=typeof e.width==`number`?e.width:o,u=typeof e.height==`number`?e.height:s,d=/bentConnector|curvedConnector/i.test(String(e.shapType||``))||(i?i.split(/[LlCcQqSsTt]/).length>2:!1),p=c(e.startConnection,a),m=c(e.endConnection,a),_=i?f(i,l,u,n):null;if(d)if(p&&m){let t=(p[0]-h)*n,r=(p[1]-g)*n,o=(m[0]-h)*n,s=(m[1]-g)*n,c=e.startConnection?.id===void 0?null:a.get(String(e.startConnection.id)),l=e.endConnection?.id===void 0?null:a.get(String(e.endConnection.id)),u=/ellipse|oval/i.test(String(c?.shapType||``)),d=/ellipse|oval/i.test(String(l?.shapType||``)),f=e.startConnection?.idx,_=e.endConnection?.idx,v=typeof f==`number`?u?f===2||f===6:f===1||f===3:null,y=typeof _==`number`?d?_===2||_===6:_===1||_===3:null;if(v===!0&&y===!1)F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${o.toFixed(4)} ${r.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`;else if(v===!1&&y===!0)F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${t.toFixed(4)} ${s.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`;else if(v===!0&&y===!0){let e=(t+o)/2;f===_&&(!u&&f===3||u&&f===6?e=Math.max(t,o)+20*n:(!u&&f===1||u&&f===2)&&(e=Math.min(t,o)-20*n)),F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${e.toFixed(4)} ${r.toFixed(4)} L ${e.toFixed(4)} ${s.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`}else if(v===!1&&y===!1){let e=(r+s)/2;f===_&&(!u&&f===2||u&&f===4?e=Math.max(r,s)+20*n:(!u&&f===0||u&&f===0)&&(e=Math.min(r,s)-20*n)),F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${t.toFixed(4)} ${e.toFixed(4)} L ${o.toFixed(4)} ${e.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`}else{let e=!1;if(v!==null)e=!v;else if(y!==null)e=y;else if(i){let t=i.match(/[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g)?.map(Number)||[];t.length>=4&&Math.abs(t[0]-t[2])<.001?e=!0:t.length>=4&&Math.abs(t[1]-t[3])<.001&&(e=!1)}let n=e?t:o,a=e?s:r;F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${n.toFixed(4)} ${a.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`}L=[t,r],R=[o,s]}else if(_)F=_.path,L=_.start,R=_.end;else{F=cZ(i,n);let e=lZ(F);L=e?e.start:[0,0],R=e?e.end:[o*n,s*n]}else if(p&&m){let e=(p[0]-h)*n,t=(p[1]-g)*n,r=(m[0]-h)*n,i=(m[1]-g)*n;F=`M ${e.toFixed(4)} ${t.toFixed(4)} L ${r.toFixed(4)} ${i.toFixed(4)}`,L=[e,t],R=[r,i]}else{let t=l<1?0:l,r=u<1?0:u,i=(t||(typeof e.width==`number`?e.width:o))*n,a=(r||(typeof e.height==`number`?e.height:s))*n,c=!!(e.isFlipH||e.flipH||e.style?.flipH),d=!!(e.isFlipV||e.flipV||e.style?.flipV),f=0,_=0,v=i,y=a;c&&(f=i,v=0),d&&(_=a,y=0),p?(f=(p[0]-h)*n,_=(p[1]-g)*n):m&&(v=(m[0]-h)*n,y=(m[1]-g)*n),F=`M ${f.toFixed(4)} ${_.toFixed(4)} L ${v.toFixed(4)} ${y.toFixed(4)}`,L=[f,_],R=[v,y]}M=F,P=[o,s];let v=Xe(e.borderHeadEnd)||`none`,y=Xe(e.borderTailEnd);!y&&(/直接箭头连接符|箭头连接符/i.test(String(e.name||``))||/arrow/i.test(String(e.shapType||``)))&&(y=`arrow`),I=[v||`none`,y||`none`],(u<1||l<1)&&(u<1?(P[1]=24,j.height=`${(24/r*100).toFixed(4)}%`):(P[0]=24,j.width=`${(24/t*100).toFixed(4)}%`)),j.color=j.borderColor&&j.borderColor!==`none`&&j.borderColor!==`transparent`?j.borderColor:e.color?dQ(e.color,j.color):j.color,j.strokeWidth=parseFloat(j.borderWidth)||1,j.fill=`none`}N?N=Ke(N,n,o,s):e.text&&(N=Ke(e.content||e.text.content||``,n,o,s))}else if(e.type===`text`)M=Ke(e.content||``,n,o,s);else if(e.type===`chart`){let t=[],r=[],i=[];if(e.chartType===`scatterChart`||e.chartType===`bubbleChart`)t=e.data&&e.data[0]?e.data[0].map((e,t)=>typeof e==`string`&&e?e:`坐标${t+1}`):[],r=[`X`,`Y`],i=e.data||[];else if(e.data&&e.data[0]&&e.data[0].xlabels){let n=e.data;t=Object.values(n[0].xlabels),r=n.map(e=>e.key),i=n.map(e=>(e.values||[]).map(e=>e.y))}else e.data&&e.data.labels&&(t=e.data.labels,r=e.data.legends||[],i=e.data.series||[]);let a=r.map((e,t)=>({label:e,data:i[t]||[]})),c=`bar`;switch(e.chartType){case`barChart`:case`bar3DChart`:c=e.barDir===`bar`?`horizontal-bar`:`bar`;break;case`lineChart`:case`line3DChart`:c=`line`;break;case`areaChart`:case`area3DChart`:c=`area`;break;case`scatterChart`:case`bubbleChart`:c=`scatter`;break;case`pieChart`:case`pie3DChart`:c=`pie`;break;case`radarChart`:c=`radar`;break;case`doughnutChart`:case`donut`:case`ring`:c=`donut`;break;default:c=e.chartType||`bar`}let l=(e.colors||[]).filter(e=>e&&typeof e==`string`),f=l.length?l:d;return j.chartColors=f,j.fill=`transparent`,{id:m(e.id),type:`chart`,chartType:c,name:e.name||`图表`,width:o*n,height:s*n,holeSize:e.holeSize,showPercent:e.showPercent,showLegend:e.showLegend===void 0?!1:e.showLegend,themeColors:f,colors:f,textColor:u,style:j,data:{labels:t,legends:r,series:i,datasets:a}}}let re=e.type===`group`&&Array.isArray(e.elements),H;if(z){let t=[`rect`,`roundRect`,`ellipse`,`triangle`,`rhombus`,`pentagon`,`hexagon`,`heptagon`,`octagon`,`parallelogram`,`trapezoid`],n=e.geom||`rect`;n.indexOf(`custom:`)!==-1&&(n=n.replace(`custom:`,``)),t.includes(n)||(n=`rect`),e.rect?H={shape:n,range:[[e.rect.l||0,e.rect.t||0],[100-(e.rect.r||0),100-(e.rect.b||0)]]}:e.geom&&(H={shape:n,range:[[0,0],[100,100]]})}return{id:m(e.id),order:e.order===void 0?void 0:e.order,type:S?`line`:z?`image`:e.type||`shape`,vertical:T,isVertical:T,width:o,height:s,left:h,top:g,start:S?L:void 0,end:S?R:void 0,lineStyle:S?/dash/i.test(String(e.borderType||``))?`dashed`:/dot/i.test(String(e.borderType||``))?`dotted`:`solid`:void 0,shapType:e.shapType||ne?.shapType,pathFormula:e.pathFormula||ne?.pathFormula,keypoints:ne?.keypoints&&Array.isArray(ne.keypoints)?ne.keypoints:Array.isArray(e.keypoints)?e.keypoints:void 0,name:e.name||(re?`组合`:void 0),content:M,src:M,clip:H,text:N,fill:j.fill,color:j.color,borderColor:j.borderColor,borderWidth:j.borderWidth,borderStyle:j.borderStyle,gradient:e.gradient,pattern:e.pattern,style:(()=>{if(!j.textAlign){let e=FQ(N||M);e&&(j.textAlign=e)}return j})(),flipH:C,flipV:w,isFlipH:C,isFlipV:w,wrap:e.wrap,viewBox:P||ne?.viewBox||(M&&(M.trim().startsWith(`M`)||M.trim().startsWith(`m`))?l(M,o,s):[200,200]),path:ne?typeof ne.path==`string`?ne.path.trim():M.trim():F||(e.path?e.path.trim():e.type===`shape`?M.trim():void 0),shadow:$e(e.shadow)?{...e.shadow}:void 0,borderHeadEnd:e.borderHeadEnd,borderTailEnd:e.borderTailEnd,lineCap:A,borderLineCap:A,points:I,elements:re?(()=>{let t=new Map(a);for(let n of e.elements||[])n&&n.id!==void 0&&t.set(String(n.id),n);return[...e.elements||[]].sort((e,t)=>(e.order||0)-(t.order||0)).map(e=>p(e,o,s,t))})():void 0}},h=e.width,g=e.height,_=h,v=g,y=e.left,b=e.top,x=new Map;for(let t of e.elements||[])t&&t.id!==void 0&&x.set(String(t.id),t);let S=[...e.elements||[]].sort((e,t)=>(e.order||0)-(t.order||0)),C=!!(e.isFlipH||e.flipH||e.style?.flipH),w=!!(e.isFlipV||e.flipV||e.style?.flipV),T={id:m(e.id),type:`group`,order:e.order===void 0?void 0:e.order,name:e.name||`组合`,left:y,top:b,width:_,height:v,rotate:e.rotate||0,style:{left:`${y}px`,top:`${b}px`,width:`${_}px`,height:`${v}px`,rotate:e.rotate||0,flipH:C,flipV:w},flipH:C,flipV:w,isFlipH:C,isFlipV:w,elements:S.map(e=>p(e,t,r,x))};(C||w)&&GQ(T,C,w),s.elements.push(T)}else e.type===`diagram`&&h(e.elements.map(e=>({...e,left:e.left+p,top:e.top+g})),i)}if(i)for(let e=a;e<s.elements.length;e++)s.elements[e].isMaster=!0},g=e=>{if(!e||e.length<=1)return e||[];let t=JSON.parse(JSON.stringify(e)),n=[];for(let e of t){let t=e.left||0,r=e.top||0,i=e.width||0,a=e.height||0;n.some(n=>{if(e.type===`group`||n.type===`group`)return!1;let o=n.left||0,s=n.top||0,c=n.width||0,l=n.height||0,u=Math.max(t,o),d=Math.max(r,s),f=Math.min(t+i,o+c),p=Math.min(r+a,s+l);if(f>u&&p>d){let m=(f-u)*(p-d),h=Math.min(i*a,c*l);if(h>0&&m/h>.4){if(e.type===`text`&&n.type===`text`){let t=(e.content||e.text||``).replace(/<[^>]+>/g,``).trim(),r=(n.content||n.text||``).replace(/<[^>]+>/g,``).trim();return t===r||!t||!r}if(e.type===n.type)return Math.abs(t-o)<5&&Math.abs(r-s)<5&&Math.abs(i-c)<5&&Math.abs(a-l)<5}}return!1})||n.push(e)}let r=n.filter(e=>e.type===`text`&&(e.top||0)>460);if(r.length>1){let e=Math.max(...r.map(e=>e.top||0)),t=Math.min(...r.map(e=>e.height||20));r.forEach(n=>{n.top=e,n.height=t,n.vAlign=`up`,n.style&&(n.style.top=`${e}px`,n.style.height=`${t}px`,n.style.verticalAlign=`top`)})}return n},v=s.elements.length;h(g(i.layoutElements||[]),!0);let y=s.elements.length,b=s.elements.slice(v,y);_.push(b),s.elements.splice(v,y-v),h(i.elements);let x=new Map;for(let e of s.elements)x.set(String(e.id),e);for(let e of s.elements)if(e.type===`line`){if(e.startConnection&&e.startConnection.id){let t=c.get(e.startConnection.id.toString()),n=t?x.get(String(t)):null;t&&n&&xZ(n)?e.startConnection.id=t:delete e.startConnection}if(e.endConnection&&e.endConnection.id){let t=c.get(e.endConnection.id.toString()),n=t?x.get(String(t)):null;t&&n&&xZ(n)?e.endConnection.id=t:delete e.endConnection}}i.animations&&Array.isArray(i.animations)&&i.animations.length>0&&(s.animations=i.animations.map(e=>{let t=c.get(e.elId?.toString())||e.elId,n=e.duration||1e3;return n<=60&&(n*=1e3),{id:e.id||Date.now().toString()+Math.random().toString(36).substr(2,5),elId:t,type:e.type||`in`,effect:e.effect||`fadeIn`,duration:Math.round(n),trigger:e.trigger||`click`}})),p.push(s)}let v=`master_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,4)}`,y=[],b=new Map,x=[],S=[],C=new Set,w=(e,n={},r=!1)=>{if(!e)return[];let i=e,a=e.match(/<p:grpSp\b[\s\S]*?<\/p:grpSp>/g)||[];for(let e of a){let t=e.match(/<p:grpSpPr>[\s\S]*?<a:xfrm>[\s\S]*?<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),n=e.match(/<p:grpSpPr>[\s\S]*?<a:xfrm>[\s\S]*?<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/),r=e.match(/<a:chOff\s+x="(-?\d+)"\s+y="(-?\d+)"/),a=e.match(/<a:chExt\s+cx="(\d+)"\s+cy="(\d+)"/);if(t&&n&&r&&a){let o=parseInt(t[1]),s=parseInt(t[2]),c=parseInt(n[1]),l=parseInt(n[2]),u=parseInt(r[1]),d=parseInt(r[2]),f=parseInt(a[1]),p=parseInt(a[2]);if(f>0&&p>0){let t=e,n=e.match(/<p:(?:sp|pic)\b[\s\S]*?<\/p:(?:sp|pic)>/g)||[];for(let e of n){let n=e.match(/<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),r=e.match(/<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/);if(n&&r){let i=parseInt(n[1]),a=parseInt(n[2]),m=parseInt(r[1]),h=parseInt(r[2]),g=Math.round(o+(i-u)*(c/f)),_=Math.round(s+(a-d)*(l/p)),v=Math.round(c/f*m),y=Math.round(l/p*h),b=e.replace(n[0],`<a:off x="${g}" y="${_}"`);b=b.replace(r[0],`<a:ext cx="${v}" cy="${y}"`),t=t.replace(e,b)}}i=i.replace(e,t)}}}let o=i.match(/<p:(?:sp|pic)\b[\s\S]*?<\/p:(?:sp|pic)>/g)||[],s=[],c=t?.themeColors||{},l=e=>{let t=e.match(/<a:gs\b[\s\S]*?<\/a:gs>/g)||[];if(t.length===0)return null;let n=[];for(let e of t){let t=e.match(/pos="(\d+)"/),r=t?Math.round(parseInt(t[1],10)/1e3):0,i=`#FFFFFF`,a=e.match(/<a:srgbClr\s+val="([0-9A-Fa-f]{6})"/);if(a)i=`#`+a[1].toUpperCase();else{let t=e.match(/<a:schemeClr\s+val="([^"]+)"([\s\S]*?)<\/a:schemeClr>/)||e.match(/<a:schemeClr\s+val="([^"]+)"\s*\/>/);if(t){let e=t[1],n=t[2]||``,r=n.match(/<a:lumMod val="(\d+)"/),a=n.match(/<a:lumOff val="(\d+)"/),o=r?parseInt(r[1],10)/1e5:1,s=a?parseInt(a[1],10)/1e5:0,l=e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e,u=c[l]||c[e]||(l===`dk1`||l===`tx1`?`#000000`:`#FFFFFF`);i=o!==1||s!==0?nt(u,o,s):u}}n.push({pos:`${r}%`,color:i})}let r=e.match(/<a:path\b[^>]*path="([^"]+)"/i),i=r?r[1].toLowerCase():``,a=i===`shape`,o=i===`circle`||i===`radial`,s=i===`rect`;if(o||s||/<a:fillToRect/i.test(e)){let t=e.match(/<a:fillToRect\b([^>]*)\/?>/),r={l:.5,t:.5,r:.5,b:.5},i={x:.5,y:.5};if(t){let e=t[1],n=e.match(/l="(-?\d+)"/),a=e.match(/t="(-?\d+)"/),o=e.match(/r="(-?\d+)"/),s=e.match(/b="(-?\d+)"/),c=n?parseInt(n[1],10)/1e5:.5,l=a?parseInt(a[1],10)/1e5:.5,u=o?parseInt(o[1],10)/1e5:.5,d=s?parseInt(s[1],10)/1e5:.5;r={l:c,t:l,r:u,b:d},i={x:Math.round((c+(1-u))/2*1e3)/1e3,y:Math.round((l+(1-d))/2*1e3)/1e3}}let a=vQ(i);return yQ({type:s?`rect`:`radial`,path:s?`rect`:`circle`,rot:0,direction:a.key,directionName:a.name,fillToRect:r,center:i,colors:n})}if(a)return yQ({type:`path`,path:`shape`,rot:0,direction:`shape`,directionName:`沿路径`,colors:n});let l=e.match(/<a:lin\b[^>]*ang="(-?\d+)"/),u=l?Math.round(parseInt(l[1],10)/6e4):0,d=_Q(u);return yQ({type:`linear`,path:`line`,rot:u,direction:d.key,directionName:d.name,colors:n})},u=e=>{let t=e.match(/<a:gradFill\b[\s\S]*?<\/a:gradFill>/);if(t){let e=l(t[0]);if(e)return e}let n=e.match(/<a:solidFill[^>]*>([\s\S]*?)<\/a:solidFill>/);if(n){let e=n[1],t=e.match(/<a:lumMod val="(\d+)"/),r=e.match(/<a:lumOff val="(\d+)"/),i=t?parseInt(t[1],10)/1e5:1,a=r?parseInt(r[1],10)/1e5:0,o=e.match(/<a:srgbClr val="([0-9A-Fa-f]{6})"/);if(o){let e=`#`+o[1].toUpperCase();return i!==1||a!==0?nt(e,i,a):e}let s=e.match(/<a:sysClr[^>]*lastClr="([0-9A-Fa-f]{6})"/);if(s){let e=`#`+s[1].toUpperCase();return i!==1||a!==0?nt(e,i,a):e}let l=(e.match(/<a:schemeClr val="(\w+)"/)||[])[1];if(l){let e=c[l===`tx1`?`dk1`:l===`bg1`?`lt1`:l===`tx2`?`dk2`:l===`bg2`?`lt2`:l]||c[l]||``;if(e)return i!==1||a!==0?nt(e,i,a):e}}let r=e.match(/<a:fillRef[^>]*>\s*<a:schemeClr val="(\w+)"/);if(r){let e=r[1];return c[e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e]||c[e]||``}return``};for(let e=0;e<o.length;e++){let i=o[e];if(i.startsWith(`<p:pic`)){let t=(i.match(/r:embed="([^"]+)"/)||[])[1],a=t?n[t]:``;if(!a)continue;let o=i.match(/<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),c=i.match(/<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/);if(!o||!c)continue;let l=Math.round(parseInt(o[1])/9525),u=Math.round(parseInt(o[2])/9525),d=Math.round(parseInt(c[1])/9525),f=Math.round(parseInt(c[2])/9525);if(d<=0||f<=0)continue;let p=(i.match(/<p:cNvPr[^>]*name="([^"]+)"/)||[])[1]||``,m={id:`${r?`masterpic`:`layoutpic`}_${e}_`+Date.now().toString(36)+Math.random().toString(36).substr(2,4),type:`image`,name:p||(r?`母版图片 ${e+1}`:`版式图片 ${e+1}`),left:l,top:u,width:d,height:f,src:a,content:a,base64:a,isMaster:!0,style:{left:`${l}px`,top:`${u}px`,width:`${d}px`,height:`${f}px`}};/flipH="1"/.test(i)&&(m.isFlipH=!0),/flipV="1"/.test(i)&&(m.isFlipV=!0);let h=(i.match(/<a:srcRect\b([^>]*)\/?>/)||[])[1]||``,g=parseFloat((h.match(/l="(\d+)"/)||[])[1]||`0`)/1e3,_=parseFloat((h.match(/t="(\d+)"/)||[])[1]||`0`)/1e3,v=parseFloat((h.match(/r="(\d+)"/)||[])[1]||`0`)/1e3,y=parseFloat((h.match(/b="(\d+)"/)||[])[1]||`0`)/1e3;(g||_||v||y)&&(m.clip={shape:`rect`,range:[[g,_],[100-v,100-y]]}),s.push(m);continue}let a=i.match(/<p:ph\b([^>]*)\/?>/),c=!!a,d=c?(a?.[1].match(/type="([^"]+)"/)||[])[1]||`body`:``;if(c&&(d===`sldNum`||d===`ftr`||d===`dt`))continue;let f=d===`pic`||d===`picture`||d===`clipArt`||d===`media`,p=d===`title`||d===`ctrTitle`,m=d===`subTitle`,h=i.match(/<a:prstGeom\s+prst="([^"]+)"/),g=h?h[1]:`rect`,_=i.match(/<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),v=i.match(/<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/),y=_?parseInt(_[1]):0,b=_?parseInt(_[2]):0,x=v?parseInt(v[1]):0,S=v?parseInt(v[2]):0,C=Math.round(y/9525),w=Math.round(b/9525),T=Math.round(x/9525),E=Math.round(S/9525);if((T<=0||E<=0)&&c){let e=t?.masterPhXfrm||{},n=a?.[1]||``,r=(n.match(/idx="(\d+)"/)||[])[1],i=(n.match(/type="(\w+)"/)||[])[1],o=i===`ctrTitle`?`title`:i,s=(r===void 0?null:e[`idx_`+r])||(o?e[`type_`+o]:null)||(p?e.type_title:null)||(i?null:e.type_body);s&&s.width>0&&s.height>0&&(C=s.left,w=s.top,T=s.width,E=s.height)}if(T<=0||E<=0)continue;let D=(i.match(/<p:cNvPr[^>]*name="([^"]+)"/)||[])[1]||``,O=i.match(/<a:t>([^<]+)<\/a:t>/),k=O?O[1]:``,A=`${r?`master`:c?`ph`:`layout`}_${e}_`+Date.now().toString(36)+Math.random().toString(36).substr(2,4);if(c){let t=k||(f?`单击图标添加图片`:p?`单击此处编辑母版标题样式`:m?`单击此处编辑母版副标题样式`:r?`单击此处编辑母版文本样式`:`单击此处添加文本描述`),n=f?void 0:p?`title`:m?`subheadline`:d===`body`?`normalText`:`smallText`;s.push({id:A,type:f?`shape`:`text`,textType:n,name:D||(f?`图片占位符 ${e+1}`:p?r?`母版标题占位符`:`标题占位符`:m?r?`母版副标题占位符`:`副标题占位符`:r?`母版文本占位符`:`占位符 ${e+1}`),left:C,top:w,width:T,height:E,content:f?``:`<p style="font-size: ${p?`28px`:m?`20px`:`16px`}; color: #94a3b8; line-height: 1.4;">${t}</p>`,fill:`transparent`,style:{left:`${C}px`,top:`${w}px`,width:`${T}px`,height:`${E}px`,borderStyle:`dashed`,borderColor:`#cbd5e1`,borderWidth:`1.5px`,borderRadius:g===`ellipse`?`50%`:`6px`,fill:`transparent`,color:`#94a3b8`,fontSize:p?`28px`:m?`20px`:`16px`,textAlign:`left`},isMaster:!0,isPlaceholder:!0,placeholder:{type:f?`image`:p?`title`:m?`subtitle`:`body`,prompt:t}})}else{let t=(i.match(/<p:spPr[^>]*>[\s\S]*?<\/p:spPr>/)||[``])[0],n=u(t),a=n&&typeof n==`object`,o=a?`transparent`:n||`transparent`,c=a?n:void 0,d,f=`0px`,p=`transparent`,m=t.match(/<a:ln\b[^>]*>([\s\S]*?)<\/a:ln>/)||t.match(/<a:ln\b([^>]*)\/>/);if(m){let e=m[0],t=e.match(/\bw="(\d+)"/),n=t?Math.max(1,Math.round(parseInt(t[1],10)/9525)):1;f=`${n}px`;let r=e.match(/<a:gradFill\b[\s\S]*?<\/a:gradFill>/),i=r?l(r[0]):void 0,a=u(e);p=typeof a==`string`&&a?a:i?.colors?.[0]?.color||`#333333`,d={color:p,width:n,style:`solid`,gradient:i}}s.push({id:A,type:k?`text`:`shape`,name:D||(k?r?`母版文本 ${e+1}`:`版式文本 ${e+1}`:r?`母版装饰 ${e+1}`:`版式装饰 ${e+1}`),left:C,top:w,width:T,height:E,content:k?`<div>${k}</div>`:``,fill:o,gradient:c,outline:d,border:d?{...d}:void 0,style:{left:`${C}px`,top:`${w}px`,width:`${T}px`,height:`${E}px`,borderRadius:g===`ellipse`?`50%`:g===`roundRect`?`8px`:`0px`,fill:o,color:`#333333`,textAlign:`center`,borderColor:d?.gradient?`transparent`:p,borderWidth:d?f:void 0,borderStyle:d?`solid`:void 0,borderGradient:d?.gradient},isMaster:!0})}}return s},T=e=>{let n=(e.content||e.text||``).replace(/<[^>]+>/g,``).trim(),r=e.type===`text`&&n?`text_${n}`:null,i=`${e.type}_${e.name||``}_${Math.round(e.left||0)}_${Math.round(e.top||0)}_${Math.round(e.width||0)}_${Math.round(e.height||0)}`;return r&&C.has(r)||C.has(i)?!0:!t?.masterShapesInfo||t.masterShapesInfo.length===0?!1:t.masterShapesInfo.some(t=>!!(t.text&&n&&(n.includes(t.text)||t.text.includes(n))||t.isPic&&e.type===`image`&&t.name&&e.name===t.name||!t.text&&!t.isPic&&t.name&&e.name===t.name))};if(t?.primaryMasterXml){let e=w(t.primaryMasterXml,t.masterPicSrcMap||{},!0),n=e.filter(e=>!e.placeholder&&!e.isPlaceholder),r=e.filter(e=>e.placeholder||e.isPlaceholder);for(let e of n){e.isMaster=!0;let t=(e.content||e.text||``).replace(/<[^>]+>/g,``).trim(),n=e.type===`text`&&t?`text_${t}`:`${e.type}_${e.name||``}_${Math.round(e.left||0)}_${Math.round(e.top||0)}_${Math.round(e.width||0)}_${Math.round(e.height||0)}`;C.has(n)||(C.add(n),x.push(e))}S.push(...r)}else if(t?.masterShapesInfo&&t.masterShapesInfo.length>0)for(let e=0;e<p.length;e++){let t=_[e]||[];for(let e of t)if(T(e)){let t=(e.content||e.text||``).replace(/<[^>]+>/g,``).trim(),n=e.type===`text`&&t?`text_${t}`:`${e.type}_${e.name||``}_${Math.round(e.left||0)}_${Math.round(e.top||0)}_${Math.round(e.width||0)}_${Math.round(e.height||0)}`;if(!C.has(n)){C.add(n);let t=JSON.parse(JSON.stringify(e));if(t.id=`m_el_`+Date.now().toString(36)+Math.random().toString(36).substr(2,5),t.isMaster=!0,t.type===`image`){let e=t.src||t.content||t.base64||t.picBase64||``;t.src=e,t.content=e,t.base64=e,t.rect&&(t.clip={shape:`rect`,range:[[t.rect.l||0,t.rect.t||0],[100-(t.rect.r||0),100-(t.rect.b||0)]]})}if(!t.style||typeof t.style!=`object`||Array.isArray(t.style)){let e=typeof t.style==`string`?t.style:void 0;t.style={},e&&t.type===`line`&&(t.lineStyle=t.lineStyle||e)}t.left===void 0?t.style?.left&&(t.left=parseFloat(t.style.left)):t.style.left=`${t.left}px`,t.top===void 0?t.style?.top&&(t.top=parseFloat(t.style.top)):t.style.top=`${t.top}px`,t.width===void 0?t.style?.width&&(t.width=parseFloat(t.style.width)):t.style.width=`${t.width}px`,t.height===void 0?t.style?.height&&(t.height=parseFloat(t.style.height)):t.style.height=`${t.height}px`,t.style.flipH=!!(t.flipH||t.isFlipH),t.style.flipV=!!(t.flipV||t.isFlipV),x.push(t)}}}else{let e=new Map;for(let t=0;t<p.length;t++){let n=_[t]||[];for(let t of n){if(t.left===void 0&&t.top===void 0&&!t.content&&!t.text)continue;let n=(t.content||t.text||``).replace(/<[^>]+>/g,``).trim(),r=t.type===`text`&&n?`text_${n}`:`${t.type}_${t.name||``}_${Math.round(t.left||0)}_${Math.round(t.top||0)}_${Math.round(t.width||0)}_${Math.round(t.height||0)}`;e.has(r)?e.get(r).count++:e.set(r,{count:1,el:t})}}let t=p.length>1?Math.max(2,Math.floor(p.length*.3)):1;for(let[n,r]of e.entries())if(r.count>=t){C.add(n);let e=JSON.parse(JSON.stringify(r.el));if(e.id=`m_el_`+Date.now().toString(36)+Math.random().toString(36).substr(2,5),e.isMaster=!0,e.type===`image`){let t=e.src||e.content||e.base64||e.picBase64||``;e.src=t,e.content=t,e.base64=t,e.rect&&(e.clip={shape:`rect`,range:[[e.rect.l||0,e.rect.t||0],[100-(e.rect.r||0),100-(e.rect.b||0)]]})}if(!e.style||typeof e.style!=`object`||Array.isArray(e.style)){let t=typeof e.style==`string`?e.style:void 0;e.style={},t&&e.type===`line`&&(e.lineStyle=e.lineStyle||t)}e.left===void 0?e.style?.left&&(e.left=parseFloat(e.style.left)):e.style.left=`${e.left}px`,e.top===void 0?e.style?.top&&(e.top=parseFloat(e.style.top)):e.style.top=`${e.top}px`,e.width===void 0?e.style?.width&&(e.width=parseFloat(e.style.width)):e.style.width=`${e.width}px`,e.height===void 0?e.style?.height&&(e.height=parseFloat(e.style.height)):e.style.height=`${e.height}px`,e.style.flipH=!!(e.flipH||e.isFlipH),e.style.flipV=!!(e.flipV||e.isFlipV),x.push(e)}}let E=_.map(e=>e.filter(e=>!T(e)));if(t&&Array.isArray(t.allLayouts)&&t.allLayouts.length>0){for(let e of t.allLayouts){let n=w(e.xml||``,e.picSrcMap||{},!1),r=t.slideLayoutMap?t.slideLayoutMap.findIndex(t=>t&&t.file===e.file):-1,i=[];if(r>=0){let e=_[r]||[];for(let t of e)if(!T(t)){let e=JSON.parse(JSON.stringify(t));if(e.id=`l_el_`+Date.now().toString(36)+Math.random().toString(36).substr(2,5),e.isMaster=!0,e.type===`image`){let t=e.src||e.content||e.base64||e.picBase64||``;e.src=t,e.content=t,e.base64=t}if(!e.style||typeof e.style!=`object`||Array.isArray(e.style)){let t=typeof e.style==`string`?e.style:void 0;e.style={},t&&e.type===`line`&&(e.lineStyle=e.lineStyle||t)}e.left===void 0?e.style?.left&&(e.left=parseFloat(e.style.left)):e.style.left=`${e.left}px`,e.top===void 0?e.style?.top&&(e.top=parseFloat(e.style.top)):e.style.top=`${e.top}px`,e.width===void 0?e.style?.width&&(e.width=parseFloat(e.style.width)):e.style.width=`${e.width}px`,e.height===void 0?e.style?.height&&(e.height=parseFloat(e.style.height)):e.style.height=`${e.height}px`,e.style.flipH=!!(e.flipH||e.isFlipH),e.style.flipV=!!(e.flipV||e.isFlipV),i.push(e)}}let a=n.filter(e=>e.placeholder),o=[...i.length>0?i:n.filter(e=>!e.placeholder)];for(let e of a)e&&(o.some(t=>t&&(t.id===e.id||Math.abs((t.left||0)-(e.left||0))<5&&Math.abs((t.top||0)-(e.top||0))<5))||o.push(e));b.set(e.id,{id:e.id,name:e.name,type:e.type,background:e.background,elements:o,placeholders:a})}for(let e=0;e<p.length;e++){let n=p[e],r=t.slideLayoutMap?.[e],i=r?r.id:`layout-${e+1}`;n.masterId=v,n.layoutId=i,n.showMasterElements=!0,r?.background&&(!n.background||n.background===`#ffffff`||n.background===`#fff`||n.background===`white`)&&(n.background=r.background,typeof r.background==`string`&&r.background.includes(`url(`)&&(n.bgType=`image`))}y.push(...Array.from(b.values()))}else{for(let e=0;e<p.length;e++){let t=p[e],n=E[e]||[],r=n.length>0?n.map(e=>`${e.type}_${Math.round(e.left||0)}_${Math.round(e.top||0)}_${Math.round(e.width||0)}_${Math.round(e.height||0)}_${(e.content||``).substring(0,30)}`).join(`|`):`empty`;if(!b.has(r)){let t=b.size+1,i=`layout-${t}`,a=`内容版式 ${t}`,o=`content`;e===0&&n.length>0?(i=`layout-title`,a=`标题版式`,o=`title`):n.length===0&&(i=`layout-blank`,a=`空白版式`,o=`blank`);let s=n.map(e=>({...JSON.parse(JSON.stringify(e)),id:`ph_`+Date.now().toString(36)+Math.random().toString(36).substr(2,5),isMaster:!0}));b.set(r,{id:i,name:a,type:o,elements:s,placeholders:[]})}let i=b.get(r);t.masterId=v,t.layoutId=i.id,t.showMasterElements=!0}y.push(...Array.from(b.values())),y.some(e=>e.type===`blank`||e.id===`layout-blank`)||y.push({id:`layout-blank`,name:`空白版式`,type:`blank`,elements:[],placeholders:[]})}let D=t?.masterXmlBg||`#ffffff`,O=`color`;if(D===`#ffffff`){let e=p[0]?.background;e&&(typeof e==`string`?D=e:(e.color||e.type===`solid`&&e.color)&&(D=e.color))}let k=A(D);if(D=k.background,O=k.bgType||`color`,D&&D!==`#ffffff`)for(let e of y)(!e.background||e.background===`#ffffff`)&&(e.background=D,e.bgType=O);let j={id:v,name:t?.masterName||i.value||`默认母版`,background:D,bgType:O,themeColors:d,fontFamily:l,elements:x,placeholders:S,layouts:y,schemeFillMap:t?.schemeFillMap||null,fullThemeColors:t?.themeColors||null,isImported:!0};return{slides:p,width:s,height:c,title:i.value,masters:[j],themeColors:Array.isArray(e?.themeColors)&&e.themeColors.length>0?e.themeColors:t?.themeColors||null,schemeFillMap:t?.schemeFillMap||null,zipMeta:t||null}};w(at);let ot=async(e,t)=>{await VZ();let n=t?t.substring(0,t.lastIndexOf(`.`))||t:i.value||`演示文稿`;z.value=`正在导入 PPTX,请稍候...`,R.value=!0;try{let[{parse:t},{default:r}]=await Promise.all([Promise.resolve().then(()=>(n1e(),IRe)),Promise.resolve().then(()=>f(sZ(),1))]),a=await t(e,{imageMode:`blob`,videoMode:`blob`,audioMode:`blob`});console.log(a);let s=null,c=null;try{let t=await r.loadAsync(e);c=t;let i=Object.keys(t.files).filter(e=>e.startsWith(`ppt/slideLayouts/slideLayout`)&&!e.includes(`_rels`)&&!t.files[e].dir),a=(e,t)=>{let n=/(\d+)\.xml/.exec(e),r=/(\d+)\.xml/.exec(t);return(n?+n[1]:0)-(r?+r[1]:0)},o={};try{let e=Object.keys(t.files).filter(e=>/^ppt\/theme\/theme\d+\.xml$/.test(e));if(e.length>0){let n=(await t.file(e[0])?.async(`text`)||``).match(/<a:clrScheme[\s\S]*?<\/a:clrScheme>/);if(n){let e=/<a:(dk1|lt1|dk2|lt2|accent1|accent2|accent3|accent4|accent5|accent6|hlink|folHlink)>([\s\S]*?)<\/a:\1>/g,t;for(;t=e.exec(n[0]);){let e=t[2].match(/<a:srgbClr val="([0-9A-Fa-f]{6})"/)||t[2].match(/<a:sysClr[^>]*lastClr="([0-9A-Fa-f]{6})"/);e&&(o[t[1]]=`#`+e[1].toUpperCase())}}}}catch{}let l=async(e,n)=>{if(!e)return null;let r=e.match(/<a:blip\b[^>]*r:embed="([^"]+)"/);if(r){let e=r[1],i=n.replace(/(slideMasters|slideLayouts)\/([^/]+)\.xml$/,`$1/_rels/$2.xml.rels`),a=await t.file(i)?.async(`text`)||``,o=a.match(RegExp(`Id="${e}"[^>]*Target="([^"]+)"`))||a.match(RegExp(`Target="([^"]+)"[^>]*Id="${e}"`));if(o){let e=n.split(`/`).slice(0,-1);for(let t of o[1].split(`/`))t===`..`?e.pop():t&&t!==`.`&&e.push(t);let r=e.join(`/`);((r.match(/\.(\w+)$/)||[])[1]||``).toLowerCase();let i=await t.file(r)?.async(`blob`);if(i)return`#ffffff url("${URL.createObjectURL(i)}") center center / 100% 100% no-repeat`}}let i=e.match(/<a:gradFill\b[\s\S]*?<\/a:gradFill>/);if(i){let e=i[0],t=e.match(/<a:gs\b[\s\S]*?<\/a:gs>/g)||[];if(t.length>0){let n=[];for(let e of t){let t=e.match(/pos="(\d+)"/),r=t?Math.round(parseInt(t[1],10)/1e3):0,i=`#FFFFFF`,a=e.match(/<a:srgbClr\s+val="([0-9A-Fa-f]{6})"/);if(a)i=`#`+a[1].toUpperCase();else{let t=e.match(/<a:schemeClr\s+val="([^"]+)"([\s\S]*?)<\/a:schemeClr>/)||e.match(/<a:schemeClr\s+val="([^"]+)"\s*\/>/);if(t){let e=t[1],n=t[2]||``,r=n.match(/<a:lumMod val="(\d+)"/),a=n.match(/<a:lumOff val="(\d+)"/),s=r?parseInt(r[1],10)/1e5:1,c=a?parseInt(a[1],10)/1e5:0,l=e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e,u=o[l]||o[e]||(l===`dk1`||l===`tx1`?`#000000`:`#FFFFFF`);i=s!==1||c!==0?nt(u,s,c):u}}n.push(`${i} ${r}%`)}let r=e.match(/<a:path\b[^>]*path="([^"]+)"/i),i=r?r[1].toLowerCase():``,a=i===`shape`,s=i===`circle`||i===`radial`,c=i===`rect`;if(s||c||/<a:fillToRect/i.test(e)){let t=e.match(/<a:fillToRect\b([^>]*)\/?>/),r=50,i=50;if(t){let e=t[1],n=e.match(/l="(-?\d+)"/),a=e.match(/t="(-?\d+)"/),o=e.match(/r="(-?\d+)"/),s=e.match(/b="(-?\d+)"/),c=n?parseInt(n[1],10)/1e5:.5,l=a?parseInt(a[1],10)/1e5:.5,u=o?parseInt(o[1],10)/1e5:.5,d=s?parseInt(s[1],10)/1e5:.5;r=Math.round((c+(1-u))/2*100),i=Math.round((l+(1-d))/2*100)}return c?`radial-gradient(closest-side at ${r}% ${i}%, ${n.join(`, `)})`:`radial-gradient(circle farthest-corner at ${r}% ${i}%, ${n.join(`, `)})`}if(a)return`radial-gradient(ellipse farthest-corner at 50% 50%, ${n.join(`, `)})`;let l=e.match(/<a:lin\b[^>]*ang="(-?\d+)"/),u=l?parseInt(l[1],10)/6e4:0;return`linear-gradient(${(Math.round(u)+90)%360}deg, ${n.join(`, `)})`}}let a=e.match(/<a:srgbClr\s+val="([0-9A-Fa-f]{6})"/);if(a)return`#`+a[1].toUpperCase();let s=e.match(/<a:schemeClr\s+val="([^"]+)"([\s\S]*?)<\/a:schemeClr>/)||e.match(/<a:schemeClr\s+val="([^"]+)"\s*\/>/);if(s){let e=s[1],t=s[2]||``,n=t.match(/<a:lumMod val="(\d+)"/),r=t.match(/<a:lumOff val="(\d+)"/),i=n?parseInt(n[1],10)/1e5:1,a=r?parseInt(r[1],10)/1e5:0,c=e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e,l=o[c]||o[e]||(c===`dk1`||c===`tx1`?`#000000`:`#FFFFFF`);return i!==1||a!==0?nt(l,i,a):l}return null};i.sort(a);let u=[],d=new Map;for(let e=0;e<i.length;e++){let n=i[e],r=await t.file(n)?.async(`text`)||``,a={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,svg:`image/svg+xml`,tif:`image/tiff`,tiff:`image/tiff`},o=null,s=r.match(/<p:bg\b[\s\S]*?<\/p:bg>/);s&&(o=await l(s[0],n));let c={},f=r.match(/<p:pic\b[\s\S]*?<\/p:pic>/g)||[];if(f.length>0){let e=await t.file(n.replace(/(slideLayouts\/)(slideLayout\d+\.xml)$/,`$1_rels/$2.rels`))?.async(`text`)||``;for(let r of f){let i=(r.match(/r:embed="([^"]+)"/)||[])[1];if(!i||c[i])continue;let o=e.match(RegExp(`Id="${i}"[^>]*Target="([^"]+)"`))||e.match(RegExp(`Target="([^"]+)"[^>]*Id="${i}"`));if(!o)continue;let s=n.split(`/`).slice(0,-1);for(let e of o[1].split(`/`))e===`..`?s.pop():e&&e!==`.`&&s.push(e);let l=s.join(`/`),u=((l.match(/\.(\w+)$/)||[])[1]||``).toLowerCase(),d=await t.file(l)?.async(`base64`);d&&(c[i]=`data:${a[u]||`application/octet-stream`};base64,${d}`)}}let p=r.match(/<p:cSld[^>]*name="([^"]+)"/),m=r.match(/<p:sldLayout[^>]*type="([^"]+)"/),h=m&&m[1]===`title`||r.includes(`type="ctrTitle"`)||p&&(p[1].includes(`Title`)||p[1].includes(`标题`)),g=m&&m[1]===`blank`||p&&(p[1].includes(`Blank`)||p[1].includes(`空白`)),_=(r.match(/type="pic"/g)||[]).length,v={file:n,id:`layout-${e+1}`,name:p?p[1]:`版式 ${e+1}`,type:m?m[1]:h?`title`:g?`blank`:`content`,background:o||void 0,picPhCount:_,picSrcMap:c,xml:r};u.push(v),d.set(n,v);let y=n.replace(`ppt/slideLayouts/`,``);d.set(y,v),d.set(`../slideLayouts/${y}`,v)}let f=Object.keys(t.files).filter(e=>e.startsWith(`ppt/slides/_rels/slide`)&&e.endsWith(`.rels`));f.sort(a);let p=[],m=[];for(let e=0;e<f.length;e++){let n=f[e],r=await t.file(n)?.async(`text`)||``,i=r.match(/Type="[^"]*\/slideLayout"[^>]*Target="([^"]+)"/)||r.match(/Target="([^"]+)"[^>]*Type="[^"]*\/slideLayout"/),a=i?i[1]:``;m.push(a);let o=d.get(a);p.push(o||null)}let h=n,g=[],_={},v=``,y=null,b={};try{let e=Object.keys(t.files).filter(e=>e.startsWith(`ppt/slideMasters/slideMaster`)&&!e.includes(`_rels`)&&!t.files[e].dir);e.sort(a);for(let n of e){let e=await t.file(n)?.async(`text`)||``;if(v||=e,!y){let t=e.match(/<p:bg\b[\s\S]*?<\/p:bg>/);t&&(y=await l(t[0],n))}let r=e.match(/<p:pic\b[\s\S]*?<\/p:pic>/g)||[];if(r.length>0){let e=await t.file(n.replace(/(slideMasters\/)(slideMaster\d+\.xml)$/,`$1_rels/$2.rels`))?.async(`text`)||``,i={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,svg:`image/svg+xml`,tif:`image/tiff`,tiff:`image/tiff`};for(let a of r){let r=(a.match(/r:embed="([^"]+)"/)||[])[1];if(!r||b[r])continue;let o=e.match(RegExp(`Id="${r}"[^>]*Target="([^"]+)"`))||e.match(RegExp(`Target="([^"]+)"[^>]*Id="${r}"`));if(!o)continue;let s=n.split(`/`).slice(0,-1);for(let e of o[1].split(`/`))e===`..`?s.pop():e&&e!==`.`&&s.push(e);let c=s.join(`/`),l=((c.match(/\.(\w+)$/)||[])[1]||``).toLowerCase(),u=await t.file(c)?.async(`base64`);u&&(b[r]=`data:${i[l]||`application/octet-stream`};base64,${u}`)}}let i=e.match(/<p:sp\b[\s\S]*?<\/p:sp>/g)||[];for(let e of i){let t=e.match(/<p:cNvPr[^>]*name="([^"]+)"/)?.[1]||e.match(/name="([^"]+)"/)?.[1]||``,n=(e.match(/<a:t>([^<]+)<\/a:t>/g)||[]).map(e=>e.replace(/<\/?a:t>/g,``)).join(``).trim();g.push({name:t,text:n});let r=e.match(/<p:ph\b([^>]*)\/?>/);if(r){let t=r[1],n=(t.match(/idx="(\d+)"/)||[])[1],i=(t.match(/type="(\w+)"/)||[])[1],a=e.match(/<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),o=e.match(/<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/);if(a&&o){let e={left:Math.round(parseInt(a[1])/9525),top:Math.round(parseInt(a[2])/9525),width:Math.round(parseInt(o[1])/9525),height:Math.round(parseInt(o[2])/9525)};n!==void 0&&!_[`idx_`+n]&&(_[`idx_`+n]=e),i&&!_[`type_`+i]&&(_[`type_`+i]=e)}}}let a=e.match(/<p:pic\b[\s\S]*?<\/p:pic>/g)||[];for(let e of a){let t=e.match(/<p:cNvPr[^>]*name="([^"]+)"/)?.[1]||e.match(/name="([^"]+)"/)?.[1]||``;g.push({name:t,isPic:!0})}}if(e.length>0){let n=(await t.file(e[0])?.async(`text`)||``).match(/<p:cSld[^>]*name="([^"]+)"/);n&&n[1]&&(h=n[1])}if(!h||h===n){let e=Object.keys(t.files).filter(e=>e.startsWith(`ppt/theme/theme`)&&!e.includes(`_rels`)&&!t.files[e].dir);if(e.length>0){let n=(await t.file(e[0])?.async(`text`)||``).match(/<a:theme[^>]*name="([^"]+)"/);n&&n[1]&&n[1]!==`Office 主题`&&n[1]!==`Office Theme`&&(h=n[1])}}}catch{}let x=``;try{if(v){let e=v.match(/<p:titleStyle>[\s\S]*?<a:schemeClr val="([^"]+)">([\s\S]*?)<\/a:schemeClr>/),t=v.match(/<p:bodyStyle>[\s\S]*?<a:schemeClr val="([^"]+)">([\s\S]*?)<\/a:schemeClr>/)||e;if(t){let e=t[1],n=t[2].match(/<a:lumMod val="(\d+)"/),r=t[2].match(/<a:lumOff val="(\d+)"/),i=n?parseInt(n[1],10)/1e5:1,a=r?parseInt(r[1],10)/1e5:0,s=e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e,c=o[s]||o[e]||(s===`dk1`||s===`tx1`?`#000000`:`#FFFFFF`);x=i!==1||a!==0?nt(c,i,a):c}}}catch{}let S={};try{for(let[e,n]of Object.entries(t.files))if(e.endsWith(`.xml`)&&!e.includes(`_rels`)&&(e.startsWith(`ppt/slides/`)||e.startsWith(`ppt/slideMasters/`)||e.startsWith(`ppt/slideLayouts/`)||e.startsWith(`ppt/theme/`))){let e=(await n.async(`text`)).match(/<a:schemeClr\b[^>]*\/>|<a:schemeClr\b[^>]*>(?:(?!<\/a:schemeClr>)[\s\S])*<\/a:schemeClr>/g)||[];for(let t of e){let e=t.replace(/\s+/g,` `).trim(),n=e.match(/val="([^"]+)"/);if(!n)continue;let r=n[1];if(r===`phClr`)continue;let i=e.match(/<a:lumMod val="(\d+)"/),a=e.match(/<a:lumOff val="(\d+)"/),s=i?parseInt(i[1],10)/1e5:1,c=a?parseInt(a[1],10)/1e5:0,l=o[r===`tx1`?`dk1`:r===`bg1`?`lt1`:r===`tx2`?`dk2`:r===`bg2`?`lt2`:r]||o[r]||``;if(l){let t=(s!==1||c!==0?nt(l,s,c):l).replace(`#`,``).toUpperCase();S[t]=e;let n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16),a=e=>e.toString(16).padStart(2,`0`).toUpperCase();for(let t=-1;t<=1;t++)for(let o=-1;o<=1;o++){if(t===0&&o===0)continue;let s=`${a(n)}${a(Math.min(255,Math.max(0,r+t)))}${a(Math.min(255,Math.max(0,i+o)))}`;S[s]||(S[s]=e)}}}}}catch{}let C=[],w=[];try{let e=new Map;for(let t of u){let n=new Map,r=(t.xml||``).match(/<p:(?:sp|pic)\b[\s\S]*?<\/p:(?:sp|pic)>/g)||[];for(let e of r){let t=e.match(/<p:ph\b[^>]*\/?>/);if(!t)continue;let r=t[0],i=r.match(/idx="(\d+)"/),a=r.match(/type="(\w+)"/),o=e.match(/<a:prstGeom\b[^>]*prst="([^"]+)"/),s=e.match(/<a:custGeom\b[\s\S]*?<\/a:custGeom>/),c=o?o[1]:void 0,l;if(s){let e=rt(s[0]);e&&(l=e,c=`custom`)}let u={geom:c,polygonPoints:l,type:a?a[1]:void 0};i&&n.set(`idx_`+i[1],u),a&&n.set(`type_`+a[1],u)}e.set(t.file,n);let i=t.file.replace(`ppt/slideLayouts/`,``);e.set(i,n),e.set(`../slideLayouts/${i}`,n)}let n=Object.keys(t.files).filter(e=>e.startsWith(`ppt/slides/slide`)&&!e.includes(`_rels`)&&!t.files[e].dir);n.sort(a);for(let r=0;r<n.length;r++){let i=await t.file(n[r])?.async(`text`)||``,a=p[r],o=a?e.get(a.file)||e.get(a.id):null,s={},c={},l=i.match(/<p:sp\b[\s\S]*?<\/p:sp>/g)||[];for(let e of l){let t=e.match(/<p:cNvPr\b[^>]*id="(\d+)"/);if(!t)continue;let n=t[1],r=/<a:pPr\b[^>]*\balgn="/.test(e),i=e.match(/<a:lstStyle\b[\s\S]*?<\/a:lstStyle>/);if(!r&&i){let e=i[0].match(/algn="(ctr|center|r|right|l|left|just|dist)"/);if(e){let t=e[1];c[n]=t===`ctr`||t===`center`?`center`:t===`r`||t===`right`?`right`:t===`dist`?`distribute`:t===`just`?`justify`:`left`}}}w.push(c);let u=i.match(/<p:pic\b[\s\S]*?<\/p:pic>/g)||[];for(let e of u){let t=e.match(/<p:cNvPr\b[^>]*id="(\d+)"/);if(!t)continue;let n=t[1],r=e.match(/<p:ph\b[^>]*\/?>/);if(r&&o){let e=r[0],t=e.match(/idx="(\d+)"/),i=e.match(/type="(\w+)"/),a;t&&o.has(`idx_`+t[1])?a=o.get(`idx_`+t[1]):i&&o.has(`type_`+i[1])&&(a=o.get(`type_`+i[1])),a&&(s[n]=a)}}C.push(s)}}catch(e){console.warn(`提取占位符几何失败:`,e)}let T={};for(let e of Object.keys(t.files))e.startsWith(`ppt/slideMasters/`)&&(e.endsWith(`.xml`)||e.endsWith(`.rels`))&&!t.files[e].dir&&(T[e]=await t.file(e)?.async(`text`)||``);let E={};for(let e of Object.keys(t.files))e.startsWith(`ppt/slideLayouts/`)&&(e.endsWith(`.xml`)||e.endsWith(`.rels`))&&!t.files[e].dir&&(E[e]=await t.file(e)?.async(`text`)||``);let D={},O=[...Object.keys(T),...Object.keys(E)].filter(e=>e.includes(`_rels/`));for(let e of O){let n=(T[e]||E[e]||``).match(/Target="([^"]+)"/g)||[];for(let r of n){let n=r.replace(/^Target="/,``).replace(/"$/,``);if(n.includes(`media/`)||n.includes(`../media/`)){let r=e.replace(`/_rels/`,`/`).replace(/\.rels$/,``).split(`/`).slice(0,-1);for(let e of n.split(`/`))e===`..`?r.pop():e&&e!==`.`&&r.push(e);let i=r.join(`/`);if(!D[i]&&t.files[i]){let e=await t.file(i)?.async(`base64`);e&&(D[i]=e)}}}}let k={};for(let e of Object.keys(t.files))e.startsWith(`ppt/tags/`)&&e.endsWith(`.xml`)&&!t.files[e].dir&&(k[e]=await t.file(e)?.async(`text`)||``);s={allLayouts:u,slideLayoutMap:p,masterName:h||n,masterShapesInfo:g,themeColors:o,schemeFillMap:S,masterPhXfrm:_,primaryMasterXml:v,masterPicSrcMap:b,masterXmlBg:y,slidePicGeomMap:C,slideSpLstStyleAlignMap:w,masterTextColor:x,masterFilesMap:T,layoutFilesMap:E,masterMediaMap:D,tagFilesMap:k,slideLayoutTargetList:m}}catch(e){console.warn(`Failed to extract zipMeta:`,e)}let l=at(a,s),u=[];try{u=await TIe(c||e,l?.slides||[])}catch(e){console.warn(`提取 PPTX 动画失败:`,e)}for(let e=0;e<(l?.slides?.length||0);e++)(!l.slides[e].animations||!l.slides[e].animations.length)&&u&&u[e]&&u[e].length&&(l.slides[e].animations=u[e]);return l.slides.length>0?(typeof P==`function`&&P()&&(z.value=`正在上传媒体资源并导入...`,await N(l)),i.value=n,o(l),!0):(d(`导入失败:文件中未发现有效幻灯片页`),!1)}catch(e){return console.error(e),d(`导入 PPTX 失败: `+e.message),!1}finally{R.value=!1}},st=async e=>{let t=e.target,n=t.files;if(!n||n.length===0)return;let r=n[0],i=new FileReader;i.onload=async e=>{try{let t=e.target?.result;await ot(t,r.name)}finally{t.value=``}},i.readAsArrayBuffer(r)},ct=e,lt=(0,t.computed)(()=>{let e=ct.slotProps||{},t={showMenu:ct.showMenu,presentationTitle:i.value,isEditingTitle:V.value,startEditingTitle:te,stopEditingTitle:ne,zoomRatio:O.value,setZoomRatio:e=>{O.value=e},resetZoom:k,isMasterEditingView:T.value,enterMasterView:E,exitMasterView:D,startPresentation:c,startFromBeginning:le,triggerPPTXImport:U,triggerJSONImport:W};for(let n of Object.keys(e))n===`deck`||n in t||(t[n]=e[n]);return`deck`in e&&Object.defineProperty(t,`deck`,{get:()=>e.deck,enumerable:!0,configurable:!0}),t});function ut(e){let t=e.currentTarget;t&&t.scrollWidth>t.clientWidth&&Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(t.scrollLeft+=e.deltaY)}return n({generatePptxBlob:Ie,generateImagesZipBlob:pe,downloadAsPptx:Le,downloadAllSlidesAsZip:me,downloadCurrentSlide:fe,triggerPPTXImport:U,triggerJSONImport:W,importPptxArrayBuffer:ot}),(n,a)=>{let o=vH,s=yH,c=_H,l=YK;return(0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.withDirectives)((0,t.createElementVNode)(`header`,Eet,[(0,t.createElementVNode)(`div`,Det,[(0,t.renderSlot)(n.$slots,`left-prefix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0),(0,t.renderSlot)(n.$slots,`left`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),()=>[e.showMenu?((0,t.openBlock)(),(0,t.createBlock)(l,{key:0,ref_key:`menuPopoverRef`,ref:re,placement:`bottom-start`,width:320,trigger:`click`,"popper-style":`padding: 0; border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); border: 1px solid #e2e8f0; background: #fff; overflow: hidden;`},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,Oet,[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ket,[...a[11]||=[(0,t.createElementVNode)(`path`,{d:`M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z`},null,-1)]]))])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Aet,[(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,jet,[a[26]||=(0,t.createElementVNode)(`div`,{class:`menu-section-title`},`导入文件`,-1),(0,t.createElementVNode)(`div`,Met,[(0,t.createElementVNode)(`div`,{class:`import-card`,onClick:a[1]||=e=>H(U)},[...a[13]||=[(0,t.createElementVNode)(`div`,{class:`import-icon-box pptx-icon`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,t.createElementVNode)(`path`,{d:`M4 4C4 2.89543 4.89543 2 6 2H14L20 8V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V4Z`,fill:`#ea4335`}),(0,t.createElementVNode)(`path`,{d:`M14 2V8H20L14 2Z`,fill:`#c5221f`}),(0,t.createElementVNode)(`text`,{x:`7`,y:`17`,fill:`#fff`,"font-size":`9`,"font-weight":`900`,"font-family":`Arial`},`P`)])],-1),(0,t.createElementVNode)(`div`,{class:`import-label`},`PPTX`,-1),(0,t.createElementVNode)(`div`,{class:`import-subtext`},`(仅供测试)`,-1)]]),(0,t.createElementVNode)(`div`,{class:`import-card`,onClick:a[2]||=e=>H(W)},[...a[14]||=[(0,t.createElementVNode)(`div`,{class:`import-icon-box json-icon`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,t.createElementVNode)(`path`,{d:`M4 4C4 2.89543 4.89543 2 6 2H14L20 8V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V4Z`,fill:`#f2994a`}),(0,t.createElementVNode)(`path`,{d:`M14 2V8H20L14 2Z`,fill:`#e07c24`}),(0,t.createElementVNode)(`text`,{x:`7`,y:`17`,fill:`#fff`,"font-size":`9`,"font-weight":`900`,"font-family":`Arial`},`J`)])],-1),(0,t.createElementVNode)(`div`,{class:`import-label`},`JSON`,-1),(0,t.createElementVNode)(`div`,{class:`import-subtext`},`(仅供测试)`,-1)]]),(0,t.createElementVNode)(`div`,{class:`import-card`,onClick:a[3]||=e=>H(ae)},[...a[15]||=[(0,t.createElementVNode)(`div`,{class:`import-icon-box pptist-icon`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,t.createElementVNode)(`path`,{d:`M4 4C4 2.89543 4.89543 2 6 2H14L20 8V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V4Z`,fill:`#eb5757`}),(0,t.createElementVNode)(`path`,{d:`M14 2V8H20L14 2Z`,fill:`#c03930`}),(0,t.createElementVNode)(`rect`,{x:`7`,y:`12`,width:`10`,height:`2`,rx:`1`,fill:`#fff`}),(0,t.createElementVNode)(`rect`,{x:`7`,y:`16`,width:`10`,height:`2`,rx:`1`,fill:`#fff`})])],-1),(0,t.createElementVNode)(`div`,{class:`import-label`},`JVS-PPT`,-1),(0,t.createElementVNode)(`div`,{class:`import-subtext`},`(专属格式)`,-1)]])]),a[27]||=(0,t.createElementVNode)(`div`,{class:`menu-divider`},null,-1),(0,t.createElementVNode)(`div`,Net,[(0,t.createVNode)(c,{trigger:`click`,onCommand:Re,disabled:R.value,style:{width:`100%`,display:`block`,"text-align":`left`}},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)(s,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)(o,{command:`png`},{default:(0,t.withCtx)(()=>[...a[17]||=[(0,t.createTextVNode)(`下载当前页 (PNG)`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`jpeg`},{default:(0,t.withCtx)(()=>[...a[18]||=[(0,t.createTextVNode)(`下载当前页 (JPEG)`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`zip`},{default:(0,t.withCtx)(()=>[...a[19]||=[(0,t.createTextVNode)(`下载全部 (ZIP)`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`pptx`},{default:(0,t.withCtx)(()=>[...a[20]||=[(0,t.createTextVNode)(`下载为 PPTX`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`json`,divided:``},{default:(0,t.withCtx)(()=>[...a[21]||=[(0,t.createTextVNode)(`导出完整 JSON 配置`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`json-template`},{default:(0,t.withCtx)(()=>[...a[22]||=[(0,t.createTextVNode)(`导出纯版式 JSON (排除图片/清空文本)`,-1)]]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Pet,[a[16]||=(0,t.createElementVNode)(`svg`,{class:`link-icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z`,fill:`currentColor`})],-1),(0,t.createElementVNode)(`span`,Fet,(0,t.toDisplayString)(R.value?`正在导出...`:`导出文件`),1)])]),_:1},8,[`disabled`]),(0,t.unref)(F)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`menu-link-item`,onClick:a[4]||=e=>H(G)},[...a[23]||=[(0,t.createElementVNode)(`svg`,{class:`link-icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z`,fill:`currentColor`})],-1),(0,t.createElementVNode)(`span`,{class:`link-text`},`重置幻灯片`,-1)]])),(0,t.createElementVNode)(`div`,{class:`menu-link-item`,onClick:a[5]||=e=>H(oe)},[...a[24]||=[(0,t.createElementVNode)(`svg`,{class:`link-icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6h-5.6z`,fill:`currentColor`})],-1),(0,t.createElementVNode)(`span`,{class:`link-text`},`幻灯片类型标注`,-1)]]),(0,t.createElementVNode)(`div`,{class:`menu-link-item`,onClick:a[6]||=e=>H(se)},[...a[25]||=[(0,t.createElementVNode)(`svg`,{class:`link-icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M4 15h2v3H4v-3zm0-4h2v3H4v-3zm0-4h2v3H4V7zm4 8h8v3H8v-3zm0-4h8v3H8v-3zm0-4h8v3H8V7zm12 8h2v3h-2v-3zm0-4h2v3h-2v-3zm0-4h2v3h-2V7z`,fill:`currentColor`})],-1),(0,t.createElementVNode)(`span`,{class:`link-text`},`快捷操作`,-1)]])]),a[28]||=(0,t.createElementVNode)(`div`,{class:`menu-disclaimer`},` 注:本站仅作测试/演示,不提供任何形式的服务 `,-1)])])]),_:1},512)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,Iet,[!V.value||(0,t.unref)(F)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,onClick:te,class:`presentation-title-text`,style:(0,t.normalizeStyle)({fontSize:`15px`,fontWeight:600,color:`#0f172a`,cursor:(0,t.unref)(F)?`default`:`pointer`,transition:`color 0.15s ease`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,display:`inline-block`,maxWidth:`240px`}),title:(0,t.unref)(i)||`未命名演示文稿`},(0,t.toDisplayString)((0,t.unref)(i)||`未命名演示文稿`),13,Let)):(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:1,ref_key:`titleInputRef`,ref:ee,class:`presentation-title-input-edit`,"onUpdate:modelValue":a[7]||=e=>(0,t.isRef)(i)?i.value=e:null,onBlur:ne,onKeyup:(0,t.withKeys)(ne,[`enter`]),style:{"font-size":`15px`,"font-weight":`600`,color:`#0f172a`,border:`1px solid #3b82f6`,"border-radius":`6px`,padding:`4px 8px`,outline:`none`,background:`#fff`,"box-shadow":`0 0 0 2px rgba(59, 130, 246, 0.15)`,width:`200px`}},null,544)),[[t.vModelText,(0,t.unref)(i)]]),!V.value&&!(0,t.unref)(F)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{key:2,onClick:te,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{width:`14px`,height:`14px`,color:`#3b82f6`,cursor:`pointer`,"margin-left":`2px`,"flex-shrink":`0`}},[...a[29]||=[(0,t.createElementVNode)(`path`,{d:`M12 20h9`},null,-1),(0,t.createElementVNode)(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`},null,-1)]])):(0,t.createCommentVNode)(``,!0)])],!0),(0,t.renderSlot)(n.$slots,`left-suffix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0)]),(0,t.unref)(F)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`header-center-tools`,onWheelPassive:ut,style:{flex:`1`,display:`flex`,"align-items":`center`,"justify-content":`flex-start`,"overflow-x":`auto`,"overflow-y":`hidden`,"min-width":`0`,position:`relative`,"z-index":`10`,margin:`0 8px`,"scrollbar-width":`none`,"-ms-overflow-style":`none`}},[(0,t.renderSlot)(n.$slots,`center`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),()=>[(0,t.renderSlot)(n.$slots,`toolbar`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),()=>[(0,t.createElementVNode)(`div`,Ret,[(0,t.createVNode)(B8e,{"toolbar-mode":e.toolbarMode},(0,t.createSlots)({_:2},[n.$slots[`toolbar-prefix`]?{name:`prefix`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`toolbar-prefix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0)]),key:`0`}:void 0,n.$slots[`toolbar-suffix`]?{name:`suffix`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`toolbar-suffix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0)]),key:`1`}:void 0]),1032,[`toolbar-mode`])])],!0)],!0)],32)),(0,t.createElementVNode)(`div`,zet,[(0,t.renderSlot)(n.$slots,`right-prefix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0),(0,t.renderSlot)(n.$slots,`right`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0),(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0),(0,t.createVNode)(c,{trigger:`click`,placement:`bottom`,"popper-class":`zoom-dropdown-popper`,onCommand:L},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)(s,{class:`zoom-dropdown-menu`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(o,{command:`50`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===50})},{default:(0,t.withCtx)(()=>[...a[31]||=[(0,t.createTextVNode)(`50%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`75`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===75})},{default:(0,t.withCtx)(()=>[...a[32]||=[(0,t.createTextVNode)(`75%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`100`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===100})},{default:(0,t.withCtx)(()=>[...a[33]||=[(0,t.createTextVNode)(`100%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`125`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===125})},{default:(0,t.withCtx)(()=>[...a[34]||=[(0,t.createTextVNode)(`125%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`140`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===140})},{default:(0,t.withCtx)(()=>[...a[35]||=[(0,t.createTextVNode)(`140%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`150`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===150})},{default:(0,t.withCtx)(()=>[...a[36]||=[(0,t.createTextVNode)(`150%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`200`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===200})},{default:(0,t.withCtx)(()=>[...a[37]||=[(0,t.createTextVNode)(`200%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`reset`,divided:``},{default:(0,t.withCtx)(()=>[...a[38]||=[(0,t.createTextVNode)(`适合画布`,-1)]]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Bet,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(O))+`%`,1),a[30]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`},[(0,t.createElementVNode)(`path`,{d:`M6 9l6 6 6-6`})],-1)])]),_:1}),(0,t.unref)(T)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`btn-exit-master`,onClick:a[8]||=e=>(0,t.unref)(D)(),title:`退出母版`,"data-tooltip":`退出母版`},[...a[39]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`#ef4444`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M19 12H5M12 19l-7-7 7-7`})],-1),(0,t.createElementVNode)(`span`,null,`退出母版`,-1)]])):(0,t.createCommentVNode)(``,!0),!(0,t.unref)(T)&&!(0,t.unref)(F)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,class:`btn-master-toggle`,onClick:a[9]||=e=>(0,t.unref)(E)(),title:`母版`,"data-tooltip":`母版`},[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Vet,[...a[40]||=[(0,t.createElementVNode)(`use`,{"xlink:href":`#icon-muban`},null,-1)]])),a[41]||=(0,t.createElementVNode)(`span`,null,`母版`,-1)])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(T)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Het,[(0,t.createElementVNode)(`button`,{class:`presentation-main-btn`,onClick:le,title:`从头开始放映 (F5)`},[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Uet,[...a[42]||=[(0,t.createElementVNode)(`use`,{"xlink:href":`#icon-huandengpianfangying`},null,-1)]])),a[43]||=(0,t.createElementVNode)(`span`,null,`幻灯片放映`,-1)]),(0,t.createVNode)(c,{trigger:`click`,placement:`bottom-end`,"popper-class":`presentation-dropdown-popper`,onCommand:de},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)(s,{class:`presentation-dropdown-menu`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(o,{command:`beginning`},{default:(0,t.withCtx)(()=>[...a[44]||=[(0,t.createElementVNode)(`div`,{class:`presentation-menu-item-content`},[(0,t.createElementVNode)(`div`,{class:`presentation-menu-item-left`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 1024 1024`,width:`14`,height:`14`,fill:`currentColor`},[(0,t.createElementVNode)(`path`,{d:`M213.333 170.667h85.334v682.666h-85.334V170.667zm170.667 0l426.667 341.333-426.667 341.333V170.667z`})]),(0,t.createElementVNode)(`span`,null,`从头开始`)]),(0,t.createElementVNode)(`span`,{class:`presentation-menu-shortcut`},`F5`)],-1)]]),_:1}),(0,t.createVNode)(o,{command:`current`},{default:(0,t.withCtx)(()=>[...a[45]||=[(0,t.createElementVNode)(`div`,{class:`presentation-menu-item-content`},[(0,t.createElementVNode)(`div`,{class:`presentation-menu-item-left`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 1024 1024`,width:`14`,height:`14`,fill:`currentColor`},[(0,t.createElementVNode)(`path`,{d:`M298.667 170.667l512 341.333-512 341.333V170.667z`})]),(0,t.createElementVNode)(`span`,null,`从当前页开始`)]),(0,t.createElementVNode)(`span`,{class:`presentation-menu-shortcut`},`Shift+F5`)],-1)]]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[a[46]||=(0,t.createElementVNode)(`button`,{class:`presentation-arrow-btn`,title:`放映选项`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 1024 1024`,width:`9`,height:`9`,fill:`currentColor`},[(0,t.createElementVNode)(`path`,{d:`M512 682.667L170.667 341.333h682.666L512 682.667z`})])],-1)]),_:1})])),(0,t.createElementVNode)(`input`,{type:`file`,ref_key:`fileInputRef`,ref:B,accept:`.pptx`,style:{display:`none`},onChange:st},null,544),(0,t.createElementVNode)(`input`,{type:`file`,ref_key:`jsonInputRef`,ref:ie,accept:`.json`,style:{display:`none`},onChange:ce},null,544),(0,t.renderSlot)(n.$slots,`right-suffix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0)]),I.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(r),{key:1,visible:(0,t.unref)(C),"onUpdate:visible":a[10]||=e=>(0,t.isRef)(C)?C.value=e:null},null,8,[`visible`])):(0,t.createCommentVNode)(``,!0)],512),[[t.vShow,e.visible]]),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[R.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Wet,[a[47]||=(0,t.createElementVNode)(`div`,{class:`loading-spinner`},null,-1),(0,t.createElementVNode)(`div`,Get,(0,t.toDisplayString)(z.value),1)])):(0,t.createCommentVNode)(``,!0)]))],64)}}});B8();var qet=z8(Ket,[[`__scopeId`,`data-v-feebd39b`]]),Jet=c((()=>{})),q5=c((()=>{$X(),Jet()}));q5(),$X(),nZ(),Q8e();function Yet(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yet(Object(n),!0).forEach(function(t){Zet(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yet(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xet(e){"@babel/helpers - typeof";return Xet=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Xet(e)}function Zet(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y5(){return Y5=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y5.apply(this,arguments)}function Qet(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function $et(e,t){if(e==null)return{};var n=Qet(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var ett=`1.14.0`;function X5(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var Z5=X5(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Q5=X5(/Edge/i),ttt=X5(/firefox/i),$5=X5(/safari/i)&&!X5(/chrome/i)&&!X5(/android/i),ntt=X5(/iP(ad|od|hone)/i),rtt=X5(/chrome/i)&&X5(/android/i),itt={capture:!1,passive:!1};function e7(e,t,n){e.addEventListener(t,n,!Z5&&itt)}function t7(e,t,n){e.removeEventListener(t,n,!Z5&&itt)}function n7(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function att(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function r7(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&n7(e,t):n7(e,t))||r&&e===n)return e;if(e===n)break}while(e=att(e))}return null}var ott=/\s+/g;function i7(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(ott,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(ott,` `))}function a7(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function o7(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=a7(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function stt(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function s7(){return document.scrollingElement||document.documentElement}function c7(e,t,n,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==s7()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!Z5))do if(i&&i.getBoundingClientRect&&(a7(i,`transform`)!==`none`||n&&a7(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(a7(i,`border-top-width`)),s-=f.left+parseInt(a7(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=o7(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function ctt(e,t,n){for(var r=d7(e,!0),i=c7(e)[t];r;){var a=c7(r)[n],o=void 0;if(o=n===`top`||n===`left`?i>=a:i<=a,!o)return r;if(r===s7())break;r=d7(r,!1)}return!1}function l7(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==J7.ghost&&(r||o[a]!==J7.dragged)&&r7(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function ltt(e,t){for(var n=e.lastElementChild;n&&(n===J7.ghost||a7(n,`display`)===`none`||t&&!n7(n,t));)n=n.previousElementSibling;return n||null}function u7(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==J7.clone&&(!t||n7(e,t))&&n++;return n}function utt(e){var t=0,n=0,r=s7();if(e)do{var i=o7(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function dtt(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function d7(e,t){if(!e||!e.getBoundingClientRect)return s7();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=a7(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return s7();if(r||t)return n;r=!0}}while(n=n.parentNode);return s7()}function ftt(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function ptt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var f7;function mtt(e,t){return function(){if(!f7){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),f7=setTimeout(function(){f7=void 0},t)}}}function htt(){clearTimeout(f7),f7=void 0}function gtt(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function _tt(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var p7=`Sortable`+new Date().getTime();function vtt(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(!(a7(t,`display`)===`none`||t===J7.ghost)){e.push({target:t,rect:c7(t)});var n=J5({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=o7(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(dtt(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=c7(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=o7(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&ptt(c,s)&&!ptt(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=btt(u,c,l,r.options)),ptt(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){a7(e,`transition`,``),a7(e,`transform`,``);var i=o7(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,a7(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=ytt(e),a7(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),a7(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){a7(e,`transition`,``),a7(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function ytt(e){return e.offsetWidth}function btt(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}var m7=[],xtt={initializeByDefault:!0},h7={mount:function(e){for(var t in xtt)xtt.hasOwnProperty(t)&&!(t in e)&&(e[t]=xtt[t]);m7.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),m7.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;m7.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](J5({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](J5({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in m7.forEach(function(r){var i=r.pluginName;if(!(!e.options[i]&&!r.initializeByDefault)){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,Y5(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return m7.forEach(function(r){typeof r.eventProperties==`function`&&Y5(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return m7.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function Stt(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[p7],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Z5&&!Q5?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var v=J5(J5({},m),h7.getEventProperties(r,t));for(var y in v)h[y]=v[y];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}var Ctt=[`evt`],g7=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=$et(n,Ctt);h7.pluginEvent.bind(J7)(e,t,J5({dragEl:v7,parentEl:y7,ghostEl:b7,rootEl:x7,nextEl:S7,lastDownEl:C7,cloneEl:w7,cloneHidden:T7,dragStarted:L7,putSortable:j7,activeSortable:J7.active,originalEvent:r,oldIndex:E7,oldDraggableIndex:O7,newIndex:D7,newDraggableIndex:k7,hideGhostForTarget:Ltt,unhideGhostForTarget:Rtt,cloneNowHidden:function(){T7=!0},cloneNowShown:function(){T7=!1},dispatchSortableEvent:function(e){_7({sortable:t,name:e,originalEvent:r})}},i))};function _7(e){Stt(J5({putSortable:j7,cloneEl:w7,targetEl:v7,rootEl:x7,oldIndex:E7,oldDraggableIndex:O7,newIndex:D7,newDraggableIndex:k7},e))}var v7,y7,b7,x7,S7,C7,w7,T7,E7,D7,O7,k7,A7,j7,M7=!1,N7=!1,P7=[],F7,I7,wtt,Ttt,Ett,Dtt,L7,R7,z7,B7=!1,V7=!1,H7,U7,Ott=[],ktt=!1,W7=[],G7=typeof document<`u`,K7=ntt,Att=Q5||Z5?`cssFloat`:`float`,jtt=G7&&!rtt&&!ntt&&`draggable`in document.createElement(`div`),Mtt=function(){if(G7){if(Z5)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),Ntt=function(e,t){var n=a7(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=l7(e,0,t),a=l7(e,1,t),o=i&&a7(i),s=a&&a7(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+c7(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+c7(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[Att]===`none`||a&&n[Att]===`none`&&c+l>r)?`vertical`:`horizontal`},Ptt=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},Ftt=function(e,t){var n;return P7.some(function(r){var i=r[p7].options.emptyInsertThreshold;if(!(!i||ltt(r))){var a=c7(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},Itt=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||Xet(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Ltt=function(){!Mtt&&b7&&a7(b7,`display`,`none`)},Rtt=function(){!Mtt&&b7&&a7(b7,`display`,``)};G7&&document.addEventListener(`click`,function(e){if(N7)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),N7=!1,!1},!0);var q7=function(e){if(v7){e=e.touches?e.touches[0]:e;var t=Ftt(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[p7]._onDragOver(n)}}},ztt=function(e){v7&&v7.parentNode[p7]._isOutsideThisEl(e.target)};function J7(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=Y5({},t),e[p7]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ntt(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:J7.supportPointer!==!1&&`PointerEvent`in window&&!$5,emptyInsertThreshold:5};for(var r in h7.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in Itt(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:jtt,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?e7(e,`pointerdown`,this._onTapStart):(e7(e,`mousedown`,this._onTapStart),e7(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(e7(e,`dragover`,this),e7(e,`dragenter`,this)),P7.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Y5(this,vtt())}J7.prototype={constructor:J7,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(R7=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,v7):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(Jtt(n),!v7&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&$5&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=r7(s,r.draggable,n,!1),!(s&&s.animated)&&C7!==s)){if(E7=u7(s),O7=u7(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){_7({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),g7(`filter`,t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=r7(c,r.trim(),n,!1),r)return _7({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),g7(`filter`,t,{evt:e}),!0}),l)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!r7(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!v7&&n.parentNode===i){var c=c7(n);if(x7=i,v7=n,y7=v7.parentNode,S7=v7.nextSibling,C7=n,A7=a.group,J7.dragged=v7,F7={target:v7,clientX:(t||e).clientX,clientY:(t||e).clientY},Ett=F7.clientX-c.left,Dtt=F7.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,v7.style[`will-change`]=`all`,s=function(){if(g7(`delayEnded`,r,{evt:e}),J7.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!ttt&&r.nativeDraggable&&(v7.draggable=!0),r._triggerDragStart(e,t),_7({sortable:r,name:`choose`,originalEvent:e}),i7(v7,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){stt(v7,e.trim(),Vtt)}),e7(o,`dragover`,q7),e7(o,`mousemove`,q7),e7(o,`touchmove`,q7),e7(o,`mouseup`,r._onDrop),e7(o,`touchend`,r._onDrop),e7(o,`touchcancel`,r._onDrop),ttt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,v7.draggable=!0),g7(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Q5||Z5))){if(J7.eventCanceled){this._onDrop();return}e7(o,`mouseup`,r._disableDelayedDrag),e7(o,`touchend`,r._disableDelayedDrag),e7(o,`touchcancel`,r._disableDelayedDrag),e7(o,`mousemove`,r._delayedDragTouchMoveHandler),e7(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&e7(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){v7&&Vtt(v7),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;t7(e,`mouseup`,this._disableDelayedDrag),t7(e,`touchend`,this._disableDelayedDrag),t7(e,`touchcancel`,this._disableDelayedDrag),t7(e,`mousemove`,this._delayedDragTouchMoveHandler),t7(e,`touchmove`,this._delayedDragTouchMoveHandler),t7(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?e7(document,`pointermove`,this._onTouchMove):t?e7(document,`touchmove`,this._onTouchMove):e7(document,`mousemove`,this._onTouchMove):(e7(v7,`dragend`,this),e7(x7,`dragstart`,this._onDragStart));try{document.selection?X7(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(M7=!1,x7&&v7){g7(`dragStarted`,this,{evt:t}),this.nativeDraggable&&e7(document,`dragover`,ztt);var n=this.options;!e&&i7(v7,n.dragClass,!1),i7(v7,n.ghostClass,!0),J7.active=this,e&&this._appendGhost(),_7({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(I7){this._lastX=I7.clientX,this._lastY=I7.clientY,Ltt();for(var e=document.elementFromPoint(I7.clientX,I7.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(I7.clientX,I7.clientY),e!==t);)t=e;if(v7.parentNode[p7]._isOutsideThisEl(e),t)do{if(t[p7]){var n=void 0;if(n=t[p7]._onDragOver({clientX:I7.clientX,clientY:I7.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Rtt()}},_onTouchMove:function(e){if(F7){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=b7&&o7(b7,!0),o=b7&&a&&a.a,s=b7&&a&&a.d,c=K7&&U7&&utt(U7),l=(i.clientX-F7.clientX+r.x)/(o||1)+(c?c[0]-Ott[0]:0)/(o||1),u=(i.clientY-F7.clientY+r.y)/(s||1)+(c?c[1]-Ott[1]:0)/(s||1);if(!J7.active&&!M7){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(b7){a?(a.e+=l-(wtt||0),a.f+=u-(Ttt||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;a7(b7,`webkitTransform`,d),a7(b7,`mozTransform`,d),a7(b7,`msTransform`,d),a7(b7,`transform`,d),wtt=l,Ttt=u,I7=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!b7){var e=this.options.fallbackOnBody?document.body:x7,t=c7(v7,!0,K7,!0,e),n=this.options;if(K7){for(U7=e;a7(U7,`position`)===`static`&&a7(U7,`transform`)===`none`&&U7!==document;)U7=U7.parentNode;U7!==document.body&&U7!==document.documentElement?(U7===document&&(U7=s7()),t.top+=U7.scrollTop,t.left+=U7.scrollLeft):U7=s7(),Ott=utt(U7)}b7=v7.cloneNode(!0),i7(b7,n.ghostClass,!1),i7(b7,n.fallbackClass,!0),i7(b7,n.dragClass,!0),a7(b7,`transition`,``),a7(b7,`transform`,``),a7(b7,`box-sizing`,`border-box`),a7(b7,`margin`,0),a7(b7,`top`,t.top),a7(b7,`left`,t.left),a7(b7,`width`,t.width),a7(b7,`height`,t.height),a7(b7,`opacity`,`0.8`),a7(b7,`position`,K7?`absolute`:`fixed`),a7(b7,`zIndex`,`100000`),a7(b7,`pointerEvents`,`none`),J7.ghost=b7,e.appendChild(b7),a7(b7,`transform-origin`,Ett/parseInt(b7.style.width)*100+`% `+Dtt/parseInt(b7.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(g7(`dragStart`,this,{evt:e}),J7.eventCanceled){this._onDrop();return}g7(`setupClone`,this),J7.eventCanceled||(w7=_tt(v7),w7.draggable=!1,w7.style[`will-change`]=``,this._hideClone(),i7(w7,this.options.chosenClass,!1),J7.clone=w7),n.cloneId=X7(function(){g7(`clone`,n),!J7.eventCanceled&&(n.options.removeCloneOnHide||x7.insertBefore(w7,v7),n._hideClone(),_7({sortable:n,name:`clone`}))}),!t&&i7(v7,i.dragClass,!0),t?(N7=!0,n._loopId=setInterval(n._emulateDragOver,50)):(t7(document,`mouseup`,n._onDrop),t7(document,`touchend`,n._onDrop),t7(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,v7)),e7(document,`drop`,n),a7(v7,`transform`,`translateZ(0)`)),M7=!0,n._dragStartId=X7(n._dragStarted.bind(n,t,e)),e7(document,`selectstart`,n),L7=!0,$5&&a7(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=J7.active,l=A7===s,u=o.sort,d=j7||c,f,p=this,m=!1;if(ktt)return;function h(o,s){g7(o,p,J5({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return Y7(x7,t,v7,r,n,c7(n),e,i)},changed:v},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(i7(v7,j7?j7.options.ghostClass:c.options.ghostClass,!1),i7(v7,o.ghostClass,!0)),j7!==p&&p!==J7.active?j7=p:p===J7.active&&j7&&(j7=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===v7&&!v7.animated||n===t&&!n.animated)&&(R7=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(v7.parentNode[p7]._isOutsideThisEl(e.target),!r&&q7(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){D7=u7(v7),k7=u7(v7,o.draggable),_7({sortable:p,name:`change`,toEl:t,newIndex:D7,newDraggableIndex:k7,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=r7(n,o.draggable,t,!0),h(`dragOver`),J7.eventCanceled)return m;if(v7.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(N7=!1,c&&!o.disabled&&(l?u||(a=y7!==x7):j7===this||(this.lastPutMode=A7.checkPull(this,c,v7,e))&&s.checkPut(this,c,v7,e))){if(f=this._getDirection(e,n)===`vertical`,r=c7(v7),h(`dragOverValid`),J7.eventCanceled)return m;if(a)return y7=x7,g(),this._hideClone(),h(`revert`),J7.eventCanceled||(S7?x7.insertBefore(v7,S7):x7.appendChild(v7)),_(!0);var y=ltt(t,o.draggable);if(!y||Wtt(e,f,this)&&!y.animated){if(y===v7)return _(!1);if(y&&t===e.target&&(n=y),n&&(i=c7(n)),Y7(x7,t,v7,r,n,i,e,!!n)!==!1)return g(),t.appendChild(v7),y7=t,v(),_(!0)}else if(y&&Utt(e,f,this)){var b=l7(t,0,o,!0);if(b===v7)return _(!1);if(n=b,i=c7(n),Y7(x7,t,v7,r,n,i,e,!1)!==!1)return g(),t.insertBefore(v7,b),y7=t,v(),_(!0)}else if(n.parentNode===t){i=c7(n);var x=0,S,C=v7.parentNode!==t,w=!Ptt(v7.animated&&v7.toRect||r,n.animated&&n.toRect||i,f),T=f?`top`:`left`,E=ctt(n,`top`,`top`)||ctt(v7,`top`,`top`),D=E?E.scrollTop:void 0;R7!==n&&(S=i[T],B7=!1,V7=!w&&o.invertSwap||C),x=Gtt(e,n,i,f,w?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,V7,R7===n);var O;if(x!==0){var k=u7(v7);do k-=x,O=y7.children[k];while(O&&(a7(O,`display`)===`none`||O===b7))}if(x===0||O===n)return _(!1);R7=n,z7=x;var A=n.nextElementSibling,j=!1;j=x===1;var M=Y7(x7,t,v7,r,n,i,e,j);if(M!==!1)return(M===1||M===-1)&&(j=M===1),ktt=!0,setTimeout(Htt,30),g(),j&&!A?t.appendChild(v7):n.parentNode.insertBefore(v7,j?A:n),E&>t(E,0,D-E.scrollTop),y7=v7.parentNode,S!==void 0&&!V7&&(H7=Math.abs(S-c7(n)[T])),v(),_(!0)}if(t.contains(v7))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){t7(document,`mousemove`,this._onTouchMove),t7(document,`touchmove`,this._onTouchMove),t7(document,`pointermove`,this._onTouchMove),t7(document,`dragover`,q7),t7(document,`mousemove`,q7),t7(document,`touchmove`,q7)},_offUpEvents:function(){var e=this.el.ownerDocument;t7(e,`mouseup`,this._onDrop),t7(e,`touchend`,this._onDrop),t7(e,`pointerup`,this._onDrop),t7(e,`touchcancel`,this._onDrop),t7(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(D7=u7(v7),k7=u7(v7,n.draggable),g7(`drop`,this,{evt:e}),y7=v7&&v7.parentNode,D7=u7(v7),k7=u7(v7,n.draggable),J7.eventCanceled){this._nulling();return}M7=!1,V7=!1,B7=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ytt(this.cloneId),Ytt(this._dragStartId),this.nativeDraggable&&(t7(document,`drop`,this),t7(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),$5&&a7(document.body,`user-select`,``),a7(v7,`transform`,``),e&&(L7&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),b7&&b7.parentNode&&b7.parentNode.removeChild(b7),(x7===y7||j7&&j7.lastPutMode!==`clone`)&&w7&&w7.parentNode&&w7.parentNode.removeChild(w7),v7&&(this.nativeDraggable&&t7(v7,`dragend`,this),Vtt(v7),v7.style[`will-change`]=``,L7&&!M7&&i7(v7,j7?j7.options.ghostClass:this.options.ghostClass,!1),i7(v7,this.options.chosenClass,!1),_7({sortable:this,name:`unchoose`,toEl:y7,newIndex:null,newDraggableIndex:null,originalEvent:e}),x7===y7?D7!==E7&&D7>=0&&(_7({sortable:this,name:`update`,toEl:y7,originalEvent:e}),_7({sortable:this,name:`sort`,toEl:y7,originalEvent:e})):(D7>=0&&(_7({rootEl:y7,name:`add`,toEl:y7,fromEl:x7,originalEvent:e}),_7({sortable:this,name:`remove`,toEl:y7,originalEvent:e}),_7({rootEl:y7,name:`sort`,toEl:y7,fromEl:x7,originalEvent:e}),_7({sortable:this,name:`sort`,toEl:y7,originalEvent:e})),j7&&j7.save()),J7.active&&((D7==null||D7===-1)&&(D7=E7,k7=O7),_7({sortable:this,name:`end`,toEl:y7,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){g7(`nulling`,this),x7=v7=y7=b7=S7=w7=C7=T7=F7=I7=L7=D7=k7=E7=O7=R7=z7=j7=A7=J7.dragged=J7.ghost=J7.clone=J7.active=null,W7.forEach(function(e){e.checked=!0}),W7.length=wtt=Ttt=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:v7&&(this._onDragOver(e),Btt(e));break;case`selectstart`:e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],r7(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||qtt(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];r7(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return r7(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=h7.modifyOption(this,e,t);r===void 0?n[e]=t:n[e]=r,e===`group`&&Itt(n)},destroy:function(){g7(`destroy`,this);var e=this.el;e[p7]=null,t7(e,`mousedown`,this._onTapStart),t7(e,`touchstart`,this._onTapStart),t7(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(t7(e,`dragover`,this),t7(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),P7.splice(P7.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!T7){if(g7(`hideClone`,this),J7.eventCanceled)return;a7(w7,`display`,`none`),this.options.removeCloneOnHide&&w7.parentNode&&w7.parentNode.removeChild(w7),T7=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(T7){if(g7(`showClone`,this),J7.eventCanceled)return;v7.parentNode==x7&&!this.options.group.revertClone?x7.insertBefore(w7,v7):S7?x7.insertBefore(w7,S7):x7.appendChild(w7),this.options.group.revertClone&&this.animate(v7,w7),a7(w7,`display`,``),T7=!1}}};function Btt(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function Y7(e,t,n,r,i,a,o,s){var c,l=e[p7],u=l.options.onMove,d;return window.CustomEvent&&!Z5&&!Q5?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||c7(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function Vtt(e){e.draggable=!1}function Htt(){ktt=!1}function Utt(e,t,n){var r=c7(l7(n.el,0,n.options,!0)),i=10;return t?e.clientX<r.left-i||e.clientY<r.top&&e.clientX<r.right:e.clientY<r.top-i||e.clientY<r.bottom&&e.clientX<r.left}function Wtt(e,t,n){var r=c7(ltt(n.el,n.options.draggable)),i=10;return t?e.clientX>r.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}function Gtt(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&H7<l*i){if(!B7&&(z7===1?c>u+l*a/2:c<d-l*a/2)&&(B7=!0),B7)f=!0;else if(z7===1?c<u+H7:c>d-H7)return-z7}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return Ktt(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function Ktt(e){return u7(v7)<u7(e)?1:-1}function qtt(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function Jtt(e){W7.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&W7.push(r)}}function X7(e){return setTimeout(e,0)}function Ytt(e){return clearTimeout(e)}G7&&e7(document,`touchmove`,function(e){(J7.active||M7)&&e.cancelable&&e.preventDefault()}),J7.utils={on:e7,off:t7,css:a7,find:stt,is:function(e,t){return!!r7(e,t,e,!1)},extend:ftt,throttle:mtt,closest:r7,toggleClass:i7,clone:_tt,index:u7,nextTick:X7,cancelNextTick:Ytt,detectDirection:Ntt,getChild:l7},J7.get=function(e){return e[p7]},J7.mount=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(J7.utils=J5(J5({},J7.utils),e.utils)),h7.mount(e)})},J7.create=function(e,t){return new J7(e,t)},J7.version=ett;var Z7=[],Q7,Xtt,Ztt=!1,Qtt,$tt,$7,e9;function ent(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?e7(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?e7(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?e7(document,`touchmove`,this._handleFallbackAutoScroll):e7(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?t7(document,`dragover`,this._handleAutoScroll):(t7(document,`pointermove`,this._handleFallbackAutoScroll),t7(document,`touchmove`,this._handleFallbackAutoScroll),t7(document,`mousemove`,this._handleFallbackAutoScroll)),tnt(),t9(),htt()},nulling:function(){$7=Xtt=Q7=Ztt=e9=Qtt=$tt=null,Z7.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if($7=e,t||this.options.forceAutoScrollFallback||Q5||Z5||$5){nnt(e,this.options,a,t);var o=d7(a,!0);Ztt&&(!e9||r!==Qtt||i!==$tt)&&(e9&&tnt(),e9=setInterval(function(){var a=d7(document.elementFromPoint(r,i),!0);a!==o&&(o=a,t9()),nnt(e,n.options,a,t)},10),Qtt=r,$tt=i)}else{if(!this.options.bubbleScroll||d7(a,!0)===s7()){t9();return}nnt(e,this.options,d7(a,!1),!1)}}},Y5(e,{pluginName:`scroll`,initializeByDefault:!0})}function t9(){Z7.forEach(function(e){clearInterval(e.pid)}),Z7=[]}function tnt(){clearInterval(e9)}var nnt=mtt(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=s7(),l=!1,u;Xtt!==n&&(Xtt=n,t9(),Q7=t.scroll,u=t.scrollFn,Q7===!0&&(Q7=d7(n,!0)));var d=0,f=Q7;do{var p=f,m=c7(p),h=m.top,g=m.bottom,_=m.left,v=m.right,y=m.width,b=m.height,x=void 0,S=void 0,C=p.scrollWidth,w=p.scrollHeight,T=a7(p),E=p.scrollLeft,D=p.scrollTop;p===c?(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`||T.overflowX===`visible`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`||T.overflowY===`visible`)):(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`));var O=x&&(Math.abs(v-i)<=o&&E+y<C)-(Math.abs(_-i)<=o&&!!E),k=S&&(Math.abs(g-a)<=o&&D+b<w)-(Math.abs(h-a)<=o&&!!D);if(!Z7[d])for(var A=0;A<=d;A++)Z7[A]||(Z7[A]={});(Z7[d].vx!=O||Z7[d].vy!=k||Z7[d].el!==p)&&(Z7[d].el=p,Z7[d].vx=O,Z7[d].vy=k,clearInterval(Z7[d].pid),(O!=0||k!=0)&&(l=!0,Z7[d].pid=setInterval(function(){r&&this.layer===0&&J7.active._onTouchMove($7);var t=Z7[this.layer].vy?Z7[this.layer].vy*s:0,n=Z7[this.layer].vx?Z7[this.layer].vx*s:0;typeof u==`function`&&u.call(J7.dragged.parentNode[p7],n,t,e,$7,Z7[this.layer].el)!==`continue`||gtt(Z7[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=d7(f,!1)));Ztt=l}},30),rnt=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}};function int(){}int.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=l7(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:rnt},Y5(int,{pluginName:`revertOnSpill`});function ant(){}ant.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:rnt},Y5(ant,{pluginName:`removeOnSpill`}),J7.mount(new ent),J7.mount(ant,int);function ont(e){e.parentElement!==null&&e.parentElement.removeChild(e)}function snt(e,t,n){let r=n===0?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,r)}function cnt(){return typeof window<`u`?window.console:global.console}var lnt=cnt();function unt(e){let t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var dnt=/-(\w)/g,fnt=unt(e=>e.replace(dnt,(e,t)=>t.toUpperCase())),pnt=[`Start`,`Add`,`Remove`,`Update`,`End`],mnt=[`Choose`,`Unchoose`,`Sort`,`Filter`,`Clone`],hnt=[`Move`],gnt=[hnt,pnt,mnt].flatMap(e=>e).map(e=>`on${e}`),_nt={manage:hnt,manageAndEmit:pnt,emit:mnt};function vnt(e){return gnt.indexOf(e)!==-1}var ynt=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.math.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rb.rp.rt.rtc.ruby.s.samp.script.section.select.slot.small.source.span.strong.style.sub.summary.sup.svg.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function bnt(e){return ynt.includes(e)}function xnt(e){return[`transition-group`,`TransitionGroup`].includes(e)}function Snt(e){return[`id`,`class`,`role`,`style`].includes(e)||e.startsWith(`data-`)||e.startsWith(`aria-`)||e.startsWith(`on`)}function Cnt(e){return e.reduce((e,[t,n])=>(e[t]=n,e),{})}function wnt({$attrs:e,componentData:t={}}){return{...Cnt(Object.entries(e).filter(([e,t])=>Snt(e))),...t}}function Tnt({$attrs:e,callBackBuilder:t}){let n=Cnt(Ent(e));Object.entries(t).forEach(([e,t])=>{_nt[e].forEach(e=>{n[`on${e}`]=t(e)})});let r=`[data-draggable]${n.draggable||``}`;return{...n,draggable:r}}function Ent(e){return Object.entries(e).filter(([e,t])=>!Snt(e)).map(([e,t])=>[fnt(e),t]).filter(([e,t])=>!vnt(e))}var Dnt=({el:e})=>e,Ont=(e,t)=>e.__draggable_context=t,knt=e=>e.__draggable_context,Ant=class{constructor({nodes:{header:e,default:t,footer:n},root:r,realList:i}){this.defaultNodes=t,this.children=[...e,...t,...n],this.externalComponent=r.externalComponent,this.rootTransition=r.transition,this.tag=r.tag,this.realList=i}get _isRootComponent(){return this.externalComponent||this.rootTransition}render(e,t){let{tag:n,children:r,_isRootComponent:i}=this;return e(n,t,i?{default:()=>r}:r)}updated(){let{defaultNodes:e,realList:t}=this;e.forEach((e,n)=>{Ont(Dnt(e),{element:t[n],index:n})})}getUnderlyingVm(e){return knt(e)}getVmIndexFromDomIndex(e,t){let{defaultNodes:n}=this,{length:r}=n,i=t.children,a=i.item(e);if(a===null)return r;let o=knt(a);if(o)return o.index;if(r===0)return 0;let s=Dnt(n[0]);return e<[...i].findIndex(e=>e===s)?0:r}};function jnt(e,t){let n=e[t];return n?n():[]}function Mnt({$slots:e,realList:t,getKey:n}){let r=t||[],[i,a]=[`header`,`footer`].map(t=>jnt(e,t)),{item:o}=e;if(!o)throw Error(`draggable element must have an item slot`);let s=r.flatMap((e,t)=>o({element:e,index:t}).map(t=>(t.key=n(e),t.props={...t.props||{},"data-draggable":!0},t)));if(s.length!==r.length)throw Error(`Item slot must have only one child`);return{header:i,footer:a,default:s}}function Nnt(e){let n=xnt(e),r=!bnt(e)&&!n;return{transition:n,externalComponent:r,tag:r?(0,t.resolveComponent)(e):n?t.TransitionGroup:e}}function Pnt({$slots:e,tag:t,realList:n,getKey:r}){return new Ant({nodes:Mnt({$slots:e,realList:n,getKey:r}),root:Nnt(t),realList:n})}function Fnt(e,n){(0,t.nextTick)(()=>this.$emit(e.toLowerCase(),n))}function Int(e){return(t,n)=>{if(this.realList!==null)return this[`onDrag${e}`](t,n)}}function Lnt(e){let t=Int.call(this,e);return(n,r)=>{t.call(this,n,r),Fnt.call(this,e,n)}}var Rnt=null,znt=(0,t.defineComponent)({name:`draggable`,inheritAttrs:!1,props:{list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:e=>e},tag:{type:String,default:`div`},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},emits:[`update:modelValue`,`change`,...[..._nt.manageAndEmit,..._nt.emit].map(e=>e.toLowerCase())],data(){return{error:!1}},render(){try{this.error=!1;let{$slots:e,$attrs:n,tag:r,componentData:i,realList:a,getKey:o}=this,s=Pnt({$slots:e,tag:r,realList:a,getKey:o});this.componentStructure=s;let c=wnt({$attrs:n,componentData:i});return s.render(t.h,c)}catch(e){return this.error=!0,(0,t.h)(`pre`,{style:{color:`red`}},e.stack)}},created(){this.list!==null&&this.modelValue!==null&&lnt.error(`modelValue and list props are mutually exclusive! Please set one or another.`)},mounted(){if(this.error)return;let{$attrs:e,$el:t,componentStructure:n}=this;n.updated();let r=Tnt({$attrs:e,callBackBuilder:{manageAndEmit:e=>Lnt.call(this,e),emit:e=>Fnt.bind(this,e),manage:e=>Int.call(this,e)}}),i=t.nodeType===1?t:t.parentElement;this._sortable=new J7(i,r),this.targetDomElement=i,i.__draggable_component__=this},updated(){this.componentStructure.updated()},beforeUnmount(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList(){let{list:e}=this;return e||this.modelValue},getKey(){let{itemKey:e}=this;return typeof e==`function`?e:t=>t[e]}},watch:{$attrs:{handler(e){let{_sortable:t}=this;t&&Ent(e).forEach(([e,n])=>{t.option(e,n)})},deep:!0}},methods:{getUnderlyingVm(e){return this.componentStructure.getUnderlyingVm(e)||null},getUnderlyingPotencialDraggableComponent(e){return e.__draggable_component__},emitChanges(e){(0,t.nextTick)(()=>this.$emit(`change`,e))},alterList(e){if(this.list){e(this.list);return}let t=[...this.modelValue];e(t),this.$emit(`update:modelValue`,t)},spliceList(){this.alterList(e=>e.splice(...arguments))},updatePosition(e,t){this.alterList(n=>n.splice(t,0,n.splice(e,1)[0]))},getRelatedContextFromMoveEvent({to:e,related:t}){let n=this.getUnderlyingPotencialDraggableComponent(e);if(!n)return{component:n};let r=n.realList,i={list:r,component:n};return e!==t&&r?{...n.getUnderlyingVm(t)||{},...i}:i},getVmIndexFromDomIndex(e){return this.componentStructure.getVmIndexFromDomIndex(e,this.targetDomElement)},onDragStart(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),Rnt=e.item},onDragAdd(e){let t=e.item._underlying_vm_;if(t===void 0)return;ont(e.item);let n=this.getVmIndexFromDomIndex(e.newIndex);this.spliceList(n,0,t);let r={element:t,newIndex:n};this.emitChanges({added:r})},onDragRemove(e){if(snt(this.$el,e.item,e.oldIndex),e.pullMode===`clone`){ont(e.clone);return}let{index:t,element:n}=this.context;this.spliceList(t,1);let r={element:n,oldIndex:t};this.emitChanges({removed:r})},onDragUpdate(e){ont(e.item),snt(e.from,e.item,e.oldIndex);let t=this.context.index,n=this.getVmIndexFromDomIndex(e.newIndex);this.updatePosition(t,n);let r={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:r})},computeFutureIndex(e,t){if(!e.element)return 0;let n=[...t.to.children].filter(e=>e.style.display!==`none`),r=n.indexOf(t.related),i=e.component.getVmIndexFromDomIndex(r);return n.indexOf(Rnt)!==-1||!t.willInsertAfter?i:i+1},onDragMove(e,t){let{move:n,realList:r}=this;if(!n||!r)return!0;let i=this.getRelatedContextFromMoveEvent(e),a=this.computeFutureIndex(i,e),o={...this.context,futureIndex:a};return n({...e,relatedContext:i,draggedContext:o},t)},onDragEnd(){Rnt=null}}}),n9=c((()=>{$X()}));n9(),L8();function Bnt(e){if(typeof document>`u`||!document.cookie)return``;let t=e+`=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e]?.trim();if(r&&r.indexOf(t)===0)try{return decodeURIComponent(r.substring(t.length))}catch{return r.substring(t.length)}}return``}function r9(e,t){if(!e)return``;try{let n=e.getItem(t);if(!n)return``;try{let e=JSON.parse(n);if(e&&typeof e==`object`&&`content`in e)return typeof e.content==`string`?e.content.trim():``;if(typeof e==`string`)return e.trim()}catch{return n.trim()}}catch{return``}return``}function Vnt(e,t){if(!(typeof window>`u`||!window.localStorage||!e))try{let n=JSON.stringify({dataType:typeof t,content:t,datetime:Date.now()});window.localStorage.setItem(`jvs-${e}`,n),window.sessionStorage&&window.sessionStorage.setItem(`jvs-${e}`,n)}catch{}}function Hnt(e){if(!(typeof window>`u`))try{window.localStorage?.removeItem(`jvs-${e}`),window.localStorage?.removeItem(e),window.sessionStorage?.removeItem(`jvs-${e}`),window.sessionStorage?.removeItem(e)}catch{}}function i9(e){if(typeof window>`u`)return``;let t=Bnt(`jvs_session_v3`)||Bnt(`Set-Cookie`);if(t&&t.trim())return t.trim();for(let e of[`jvs_session_v3`,`jvs-jvs_session_v3`,`jvs-sessionV3`,`sessionV3`,`jvs-access_token`,`access_token`]){let t=r9(window.localStorage,e);if(t)return t;let n=r9(window.sessionStorage,e);if(n)return n}if(e){let t=e.jvs_session_v3||e.JVS_SESSION_V3||(e.Authorization?e.Authorization.replace(/^Bearer\s+/i,``):``)||(e.authorization?e.authorization.replace(/^Bearer\s+/i,``):``);if(typeof t==`string`&&t.trim())return t.trim()}return``}function Unt(e){if(e&&/^https?:\/\//i.test(e.trim()))try{return new URL(e.trim()).origin}catch{return``}return``}function Wnt(e){if(e&&e.trim()){let t=e.trim(),n=t.indexOf(`/jvs-dam`);if(n>=0)return t.slice(0,n+8)}return`/jvs-dam`}var Gnt=(0,t.ref)(`search`),a9=(0,t.ref)(``),o9=(0,t.ref)(!1),s9=null,Knt=!1;function qnt(e){Gnt.value=e}function c9(){let{materialApiUrl:e,materialHeaders:n}=e6(),r=(0,t.ref)(0),i=null,a=(0,t.computed)(()=>Wnt(e.value)),o=(0,t.computed)(()=>Unt(e.value));async function s(e=!1){if(typeof window>`u`)return!1;if((i9(n.value)||a9.value)&&!e&&Knt)return!0;if(s9)return s9;s9=(async()=>{Knt=!0;let e=o.value;try{let t=await fetch(`${e}/jvs-system/login/token`,{method:`GET`,credentials:`include`,headers:{"jvs-rule-ua":`2.4`,...n.value||{}}});if(t.ok){let n=(await t.text()).trim();if(n&&!n.startsWith(`<`)){let t=JSON.parse(n),i=t?.code??t?.data?.code,a=t?.data?.data===void 0?t?.data:t.data.data;if(i===0){let t=typeof a==`string`?a.trim():typeof a?.access_token==`string`?a.access_token.trim():``;return t?(a9.value=t,o9.value=!0,Vnt(`sessionV3`,t),Vnt(`access_token`,t),r.value++,r9(window.localStorage,`jvs-tenantId`)||fetch(`${e}/jvs-system/index/this/tenant`,{method:`GET`,credentials:`include`,headers:{"jvs-rule-ua":`2.4`,Authorization:`Bearer ${t}`}}).then(e=>e.json()).then(e=>{let t=e?.data?.data||e?.data;t?.id&&Vnt(`tenantId`,String(t.id))}).catch(()=>{}),!0):(a9.value=``,o9.value=!1,Hnt(`sessionV3`),Hnt(`access_token`),r.value++,!1)}}}}catch{}try{let e=await fetch(`${a.value}/project/my`,{method:`GET`,credentials:`include`,headers:f(!1)});if(e.ok){let t=(await e.text()).trim();if(t&&!t.startsWith(`<`)){let e=JSON.parse(t),n=e?.code??e?.data?.code;if(n===0||n===200)return o9.value=!0,r.value++,!0}}}catch{}return!!i9(n.value)})();try{return await s9}finally{s9=null}}let c=()=>{r.value++,!i9(n.value)&&!a9.value&&!o9.value&&s(!1)},l=()=>{r.value++,!i9(n.value)&&!a9.value&&!o9.value&&s(!1)};(0,t.onMounted)(()=>{window.addEventListener(`storage`,c),window.addEventListener(`focus`,l),s(!1),i=setInterval(c,3e3)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`storage`,c),window.removeEventListener(`focus`,l),i&&=(clearInterval(i),null)});let u=(0,t.computed)(()=>(r.value,a9.value||i9(n.value))),d=(0,t.computed)(()=>(r.value,!!(u.value||o9.value)));function f(e=!0){let t={"jvs-rule-ua":`2.4`,...n.value||{}};e&&(t[`Content-Type`]=`application/json;charset=utf-8`);let r=u.value||r9(window?.localStorage,`jvs-access_token`);r&&!t.Authorization&&!t.authorization&&(t.Authorization=`Bearer ${r}`);let i=r9(window?.localStorage,`jvs-tenantId`);return i&&!t[`tenant-id`]&&(t[`tenant-id`]=i),t}async function p(e,t={}){let n=a.value,r=e.startsWith(`http`)||e.startsWith(`/jvs-`)?e:`${n}${e.startsWith(`/`)?``:`/`}${e}`;if(t.params){let e=new URLSearchParams;Object.entries(t.params).forEach(([t,n])=>{n!=null&&n!==``&&(Array.isArray(n)?n.length>0&&e.append(t,n.join(`,`)):e.append(t,String(n)))});let n=e.toString();n&&(r+=(r.includes(`?`)?`&`:`?`)+n)}let i=typeof FormData<`u`&&t.body instanceof FormData,o={...f(!i),...t.headers||{}};i&&(delete o[`Content-Type`],delete o[`content-type`]);let s=await fetch(r,{...t,credentials:`include`,headers:o}),c=await s.text();if(!s.ok)throw Error(`请求异常 (${s.status})`);let l=c.trim();if(l.startsWith(`<`)||l.toLowerCase().startsWith(`<!doctype`))throw Error(`接口返回了非 JSON 格式响应`);try{return JSON.parse(c)}catch(e){throw Error(`数据解析失败: ${e.message}`)}}return{sessionV3:u,isDamLoggedIn:d,damBaseUrl:a,sharedMaterialMainTab:Gnt,setSharedMaterialMainTab:qnt,refreshSessionState:c,probeRemoteSessionV3:s,buildDamHeaders:f,damFetchJson:p}}$K(),$X(),_b(),L8();var Jnt={class:`my-assets-panel`},Ynt={class:`mine-top-search-row`},Xnt={class:`mine-search-box`},Znt=[`disabled`],Qnt={key:0,class:`mini-spin-ring`},$nt={key:1},ert={class:`mine-filter-bar`},trt=[`title`],nrt={class:`tree-projects-scroll`},rrt=[`onClick`],irt=[`onClick`],art={class:`node-name`},ort={key:0,class:`team-tag`},srt={key:0,class:`tree-folders-children`},crt=[`onClick`],lrt={class:`node-name`},urt=[`onClick`],drt={class:`node-name`},frt={key:1,class:`tree-empty-folder-tip`},prt={class:`media-type-pills`},mrt={class:`mine-sub-tabs`},hrt={key:0,class:`mine-loading-box`},grt={key:1,class:`mine-waterfall-scroll`},_rt={key:0,class:`mine-masonry-wrapper`},vrt={class:`mine-masonry-columns`},yrt=[`onClick`],brt=[`src`],xrt=[`src`,`alt`],Srt={key:2,class:`video-play-badge`},Crt={class:`mine-card-actions`},wrt=[`onClick`],Trt=[`onClick`],Ert={class:`mine-card-bottom`},Drt=[`title`],Ort={class:`mine-footer-status`},krt={key:0,class:`loading-more-row`},Art={key:2,class:`all-loaded-divider`},jrt={key:1,class:`mine-empty-state`},Mrt={class:`empty-title`},l9=20,Nrt=(0,t.defineComponent)({__name:`MyAssetsPanel`,emits:[`select`,`preview`,`use-as-ref`],setup(e,{expose:n,emit:r}){let i=r,{notify:a}=e6(),{damFetchJson:o,isDamLoggedIn:s}=c9(),c=(0,t.ref)(``),l=(0,t.ref)(`ALL`),u=(0,t.ref)(`recent`),d=(0,t.ref)([]),f=(0,t.ref)({}),p=(0,t.ref)({}),m=(0,t.ref)(``),h=(0,t.ref)(``),g=(0,t.ref)(`全部项目资产`),_=(0,t.ref)(!1),v=(0,t.ref)(null),y=(0,t.ref)(!1),b=(0,t.ref)(!1),x=(0,t.ref)(!1),S=(0,t.ref)(1),C=(0,t.ref)(!1),w=(0,t.ref)([]),T=(0,t.ref)(null),E=[`#3b82f6`,`#10b981`,`#8b5cf6`,`#f59e0b`,`#ec4899`];function D(e,t){return e.type===`PERSONAL`?`#3b82f6`:E[t%E.length]||`#10b981`}function O(e){return e?(e.name===`Personal project`||e.type===`PERSONAL`)&&e.name===`Personal project`?`个人项目`:e.name:`项目`}function k(e){if(!Array.isArray(e)||e.length===0)return[];if(e.some(e=>Array.isArray(e.children)&&e.children.length>0))return e;let t=new Map,n=[];return e.forEach(e=>{t.set(String(e.id),{id:String(e.id),projectId:String(e.projectId||``),parentId:e.parentId?String(e.parentId):`0`,name:e.name||`文件夹`,defaultFlag:e.defaultFlag,children:[]})}),t.forEach(e=>{let r=e.parentId;r&&r!==`0`&&t.has(r)?t.get(r).children.push(e):n.push(e)}),n}async function A(){if(s.value)try{let e=await o(`/project/my`),t=[];if(Array.isArray(e)?t=e:Array.isArray(e?.data?.data)?t=e.data.data:Array.isArray(e?.data)&&(t=e.data),t.length===0){let e=await o(`/project/personal`),n=e?.data?.data||e?.data||e;n&&n.id&&(t=[n])}d.value=t.map(e=>({id:String(e.id),name:e.name||`未命名项目`,type:e.type||`PERSONAL`,description:e.description}));let n=d.value[0];n&&(p.value[n.id]=!0,await j(n.id))}catch(e){console.warn(`[MyAssets] 获取项目列表失败:`,e)}}async function j(e){if(e)try{let t=await o(`/folder/tree`,{params:{projectId:e}}),n=[];Array.isArray(t)?n=t:Array.isArray(t?.data?.data)?n=t.data.data:Array.isArray(t?.data)&&(n=t.data),f.value={...f.value,[e]:k(n)}}catch(e){console.warn(`[MyAssets] 获取文件夹树失败:`,e)}}async function M(e,t){t.stopPropagation();let n=!p.value[e];p.value[e]=n,n&&!f.value[e]&&await j(e)}function N(){m.value=``,h.value=``,g.value=`全部项目资产`,_.value=!1,B()}function P(e){m.value=e.id,h.value=``,g.value=O(e),_.value=!1,f.value[e.id]||j(e.id),B()}function F(e,t){m.value=e.id,h.value=t.id,g.value=`${O(e)} / ${t.name}`,_.value=!1,B()}function I(e){if(String(e.assetType||e.mediaType||e.type||``).toUpperCase()===`VIDEO`)return!0;let t=String(e.fileUrl||e.url||e.ossUrl||e.imageUrl||``).split(`?`)[0].toLowerCase();return t.endsWith(`.mp4`)||t.endsWith(`.webm`)||t.endsWith(`.mov`)||t.endsWith(`.m4v`)}function L(e){if(!e)return null;let t=e.asset&&typeof e.asset==`object`?{...e.asset,score:e.score}:e,n=t.fileUrl||t.imageUrl||t.ossUrl||t.fileLink||t.url||t.previewUrl||t.sourceUrl||``;if(!n)return null;let r=I(t),i={};if(t.metaDataJson)try{i=typeof t.metaDataJson==`string`?JSON.parse(t.metaDataJson):t.metaDataJson}catch{i={}}let a=t.name||t.prompt||i.prompt||t.fileName||t.fileOriginalName||t.portrait?.summary||(r?`视频资产`:`图片资产`),o=String(a).replace(/\.[a-zA-Z0-9]+$/,``).replace(/_\d{10,14}$/,``),s=String(t.sourceType||``).toUpperCase(),c=`资产`;r?c=`视频`:s===`GENERATE`||u.value===`ai`||t.recordId||t.sessionId?c=`AI 生成`:(s===`UPLOAD`||u.value===`uploads`)&&(c=`已上传`);let l=Number(i.width||t.width||t.originalWidth||0),d=Number(i.height||t.height||t.originalHeight||0);return{id:String(t.id||t.fileId||t.recordId||`dam-${Math.random().toString(36).slice(2,9)}`),title:o||`我的素材`,type:r?`video`:`image`,assetType:r?`VIDEO`:`IMAGE`,sourceType:s||(u.value===`ai`?`GENERATE`:`UPLOAD`),badgeLabel:c,url:n,previewUrl:t.previewUrl||n,sourceUrl:n,originalWidth:l>0?l:void 0,originalHeight:d>0?d:void 0,projectId:t.projectId,folderId:t.folderId,model:t.model||i.model||``,createTime:t.createTime||t.uploadTime||``}}function R(e){return e?Array.isArray(e)?e:Array.isArray(e?.data?.records)?e.data.records:Array.isArray(e?.records)?e.records:Array.isArray(e?.data?.data?.records)?e.data.data.records:Array.isArray(e?.data?.data)?e.data.data:Array.isArray(e?.data?.list)?e.data.list:Array.isArray(e?.data)?e.data:[]:[]}async function z(e=1,t=!1){if(!s.value){w.value=[],C.value=!0;return}try{y.value=!t,b.value=t;let n=c.value.trim(),r=l.value===`ALL`?void 0:l.value,i=[];if(u.value===`ai`)i=R(await o(`/ai/record/page`,{params:{current:e,size:l9,mediaType:r||`IMAGE`,operationType:`GENERATE`}}));else if(u.value===`uploads`)i=R(await o(`/upload/file/list`,{params:{current:e,size:l9,projectId:m.value||void 0,folderId:h.value||void 0,name:n||void 0}}));else if(n&&!h.value)try{i=R(await o(`/asset/semantic/search`,{params:{query:n,assetType:r,projectId:m.value||void 0,current:e,size:l9}}))}catch{i=R(await o(`/asset/recent`,{params:{projectId:m.value||void 0,folderId:h.value||void 0,name:n,assetType:r,current:e,size:l9}}))}else i=m.value&&h.value?R(await o(`/asset/page`,{params:{projectId:m.value,folderId:h.value,name:n||void 0,current:e,size:l9}})):R(await o(`/asset/recent`,{params:{projectId:m.value||void 0,folderId:h.value||void 0,name:n||void 0,assetType:r,current:e,size:l9}}));let a=i.map(L).filter(e=>!!e).filter(e=>l.value===`IMAGE`?e.type!==`video`:l.value===`VIDEO`?e.type===`video`:n&&u.value===`ai`?e.title.toLowerCase().includes(n.toLowerCase()):!0);if(i.length<l9?C.value=!0:C.value=!1,t){let e=new Set(w.value.map(e=>e.id)),t=a.filter(t=>!e.has(t.id));w.value=[...w.value,...t]}else w.value=a;S.value=e}catch(e){console.warn(`[MyAssets] 加载个人资产异常:`,e),t||(w.value=[]),C.value=!0}finally{y.value=!1,b.value=!1}}function B(){S.value=1,C.value=!1,z(1,!1)}function V(){B()}function ee(){c.value=``,B()}function te(e){l.value!==e&&(l.value=e,B())}function ne(e){u.value!==e&&(u.value=e,B())}function re(){y.value||b.value||C.value||z(S.value+1,!0)}let H=(0,t.computed)(()=>{let e=[],t=[],n=0,r=0;return w.value.forEach((i,a)=>{let o=.85,s=Number(i.originalWidth||0),c=Number(i.originalHeight||0);s>0&&c>0?o=Math.max(.55,Math.min(1.6,c/s)):i.type===`video`?o=.65:a%3==1&&(o=1.1),n<=r?(e.push(i),n+=o):(t.push(i),r+=o)}),[e,t]});function U(){T.value?.click()}function ie(e){if(!e)return``;let t=e.data===void 0?e:e.data;if(typeof t==`string`)return t;let n=t?.data===void 0?t:t.data;return typeof n==`string`?n:n?.ossUrl||n?.fileLink||n?.fileUrl||n?.url||n?.link||t?.ossUrl||t?.fileLink||t?.fileUrl||t?.url||``}async function W(e){let t=e.target,n=t.files?Array.from(t.files):[];if(n.length!==0){x.value=!0;try{let e=d.value.find(e=>e.type===`PERSONAL`)||d.value[0],t=m.value||e?.id||``,r=0;for(let e of n){let n=e.type.startsWith(`video/`),i=new FormData;i.append(`file`,e),i.append(`path`,`/dam/media/`),i.append(`fileName`,e.name),i.append(`name`,e.name),i.append(`id`,String(Date.now())),t&&i.append(`projectId`,t),h.value&&i.append(`folderId`,h.value),i.append(`assetType`,n?`VIDEO`:`IMAGE`),ie(await o(`/upload/file`,{method:`POST`,body:i}))&&r++}r>0?(a(`已成功上传 ${r} 个素材到我的资产库`),B()):a(`上传未返回有效文件地址`)}catch(e){a(`上传素材失败: ${e.message||`网络异常`}`)}finally{x.value=!1,t.value=``}}}function ae(e){if(!_.value)return;let t=e.target;v.value&&!v.value.contains(t)&&(_.value=!1)}return(0,t.onMounted)(()=>{A(),z(1,!1),window.addEventListener(`click`,ae)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`click`,ae)}),(0,t.watch)(s,e=>{e?(A(),z(1,!1)):w.value=[]}),n({reloadAssets:B}),(e,n)=>{let r=wb;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,Jnt,[(0,t.createElementVNode)(`input`,{ref_key:`fileInputRef`,ref:T,type:`file`,multiple:``,accept:`image/*,video/*`,style:{display:`none`},onChange:W},null,544),(0,t.createElementVNode)(`div`,Ynt,[(0,t.createElementVNode)(`div`,Xnt,[(0,t.createVNode)(r,{class:`mine-search-icon`,onClick:V},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(sb))]),_:1}),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":n[0]||=e=>c.value=e,type:`text`,placeholder:`语义搜索我的资产/描述词...`,class:`mine-search-input`,onKeyup:(0,t.withKeys)(V,[`enter`])},null,544),[[t.vModelText,c.value]]),c.value?((0,t.openBlock)(),(0,t.createBlock)(r,{key:0,class:`mine-search-clear`,onClick:ee},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(By))]),_:1})):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`mine-upload-btn`,disabled:x.value,title:`上传本地图片或视频至我的资产库`,onClick:U},[x.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Qnt)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$nt,`+`)),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(x.value?`上传中`:`上传`),1)],8,Znt)]),(0,t.createElementVNode)(`div`,ert,[(0,t.createElementVNode)(`div`,{ref_key:`treeTriggerRef`,ref:v,class:`project-tree-selector-wrap`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`project-tree-trigger`,{active:_.value||m.value}]),onClick:n[1]||=(0,t.withModifiers)(e=>_.value=!_.value,[`stop`])},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`proj-dot`,{"is-filtered":!!m.value}])},null,2),(0,t.createElementVNode)(`span`,{class:`proj-label`,title:g.value},(0,t.toDisplayString)(g.value),9,trt),n[11]||=(0,t.createElementVNode)(`svg`,{class:`chevron-svg`,viewBox:`0 0 24 24`,width:`11`,height:`11`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`},[(0,t.createElementVNode)(`polyline`,{points:`6 9 12 15 18 9`})],-1)],2),(0,t.createVNode)(t.Transition,{name:`pop-fade`},{default:(0,t.withCtx)(()=>[_.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`project-tree-popover`,onClick:n[2]||=(0,t.withModifiers)(()=>{},[`stop`])},[n[16]||=(0,t.createElementVNode)(`div`,{class:`popover-section-header`},`选择项目或子文件夹`,-1),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tree-node-row all-node`,{active:!m.value&&!h.value}]),onClick:N},[...n[12]||=[(0,t.createElementVNode)(`span`,{class:`node-icon`},`🌐`,-1),(0,t.createElementVNode)(`span`,{class:`node-name`},`全部可访问资产`,-1)]],2),(0,t.createElementVNode)(`div`,nrt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`tree-project-block`},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tree-node-row project-node`,{active:m.value===e.id&&!h.value}]),onClick:t=>P(e)},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tree-expand-btn`,{expanded:p.value[e.id]}]),onClick:t=>M(e.id,t)},[...n[13]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`},[(0,t.createElementVNode)(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],10,irt),(0,t.createElementVNode)(`span`,{class:`project-color-sq`,style:(0,t.normalizeStyle)({backgroundColor:D(e,r)})},null,4),(0,t.createElementVNode)(`span`,art,(0,t.toDisplayString)(O(e)),1),e.type===`TEAM`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ort,`团队`)):(0,t.createCommentVNode)(``,!0)],10,rrt),p.value[e.id]?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,srt,[f.value[e.id]&&f.value[e.id].length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(f.value[e.id],r=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:r.id},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tree-node-row folder-node`,{active:h.value===r.id}]),onClick:t=>F(e,r)},[n[14]||=(0,t.createElementVNode)(`span`,{class:`folder-icon`},`📁`,-1),(0,t.createElementVNode)(`span`,lrt,(0,t.toDisplayString)(r.name),1)],10,crt),r.children&&r.children.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(r.children,r=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:r.id,class:(0,t.normalizeClass)([`tree-node-row folder-node level-2`,{active:h.value===r.id}]),onClick:t=>F(e,r)},[n[15]||=(0,t.createElementVNode)(`span`,{class:`folder-icon`},`📁`,-1),(0,t.createElementVNode)(`span`,drt,(0,t.toDisplayString)(r.name),1)],10,urt))),128)):(0,t.createCommentVNode)(``,!0)],64))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,frt,`默认目录`))])):(0,t.createCommentVNode)(``,!0)]))),128))])])):(0,t.createCommentVNode)(``,!0)]),_:1})],512),(0,t.createElementVNode)(`div`,prt,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`media-pill`,{active:l.value===`ALL`}]),onClick:n[3]||=e=>te(`ALL`)},` 全部 `,2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`media-pill`,{active:l.value===`IMAGE`}]),onClick:n[4]||=e=>te(`IMAGE`)},` 图片 `,2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`media-pill`,{active:l.value===`VIDEO`}]),onClick:n[5]||=e=>te(`VIDEO`)},` 视频 `,2)])]),(0,t.createElementVNode)(`div`,mrt,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`mine-sub-tab`,{active:u.value===`recent`}]),onClick:n[6]||=e=>ne(`recent`)},` 最近资产 `,2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`mine-sub-tab`,{active:u.value===`ai`}]),onClick:n[7]||=e=>ne(`ai`)},` AI 创作记录 `,2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`mine-sub-tab`,{active:u.value===`uploads`}]),onClick:n[8]||=e=>ne(`uploads`)},` 已上传 `,2)]),y.value&&w.value.length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,hrt,[...n[17]||=[(0,t.createElementVNode)(`div`,{class:`loading-ring-spinner`},null,-1),(0,t.createElementVNode)(`span`,{class:`loading-tip-text`},`正在加载我的资产...`,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,grt,[w.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_rt,[(0,t.createElementVNode)(`div`,vrt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(H.value,(e,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:a,class:`mine-masonry-col`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`mine-asset-card`,onClick:t=>i(`select`,e)},[e.type===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:e.url,muted:``,preload:`metadata`,playsinline:``,class:`mine-card-media`,onMouseenter:n[9]||=e=>e.target?.play?.(),onMouseleave:n[10]||=e=>e.target?.pause?.()},null,40,brt)):((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.previewUrl||e.url,alt:e.title,loading:`lazy`,class:`mine-card-media`},null,8,xrt)),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`mine-card-badge`,{"is-ai":e.badgeLabel===`AI 生成`,"is-video":e.type===`video`}])},(0,t.toDisplayString)(e.badgeLabel||`资产`),3),e.type===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Srt,[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(pb))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,Crt,[e.type===`video`?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`card-act-btn ref-btn`,title:`作为 AI 生图参考素材`,onClick:(0,t.withModifiers)(t=>i(`use-as-ref`,e),[`stop`])},[...n[18]||=[(0,t.createElementVNode)(`span`,null,`@参考`,-1)]],8,wrt)),(0,t.createElementVNode)(`button`,{type:`button`,class:`card-act-btn icon-btn`,title:`大图预览`,onClick:(0,t.withModifiers)(t=>i(`preview`,e,w.value,t),[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(mb))]),_:1})],8,Trt)]),(0,t.createElementVNode)(`div`,Ert,[(0,t.createElementVNode)(`span`,{class:`mine-card-title`,title:e.title},(0,t.toDisplayString)(e.title),9,Drt)])],8,yrt))),128))]))),128))]),(0,t.createElementVNode)(`div`,Ort,[b.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,krt,[...n[19]||=[(0,t.createElementVNode)(`span`,{class:`mini-spin-ring blue`},null,-1),(0,t.createElementVNode)(`span`,null,`正在加载更多...`,-1)]])):C.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Art,[...n[20]||=[(0,t.createElementVNode)(`span`,null,`— 已展示全部资产 —`,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`load-more-action-btn`,onClick:re},` 加载更多 `))])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,jrt,[n[21]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`38`,height:`38`,fill:`none`,stroke:`#cbd5e1`,"stroke-width":`1.3`},[(0,t.createElementVNode)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`})],-1),(0,t.createElementVNode)(`p`,Mrt,(0,t.toDisplayString)(c.value?`未找到与 "${c.value}" 匹配的资产`:`当前目录下暂无资产`),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`empty-upload-cta`,onClick:U},` + 上传本地素材 `)]))]))])}}});B8();var Prt=z8(Nrt,[[`__scopeId`,`data-v-61a463d6`]]);$K(),$X(),H8(),nZ(),q5(),n9(),_b(),L8();var Frt={class:`create-material-panel`},Irt={class:`create-sub-header`},Lrt={class:`mode-segmented-box`},Rrt={class:`create-scroll-body`},zrt={class:`control-block`},Brt={class:`model-left-info`},Vrt={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`currentColor`},Hrt={key:1,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},Urt={class:`model-name-text`},Wrt={key:0,class:`model-dropdown-menu`},Grt=[`onClick`],Krt={class:`opt-top-line`},qrt={class:`opt-code`},Jrt={key:0,class:`opt-tag`},Yrt={key:0,class:`opt-sub-desc`},Xrt=[`onClick`],Zrt={class:`opt-top-line`},Qrt={class:`opt-code`},$rt={class:`opt-tag video`},eit={class:`opt-sub-desc`},tit={key:0,class:`control-block`},nit={class:`block-header-line`},rit={class:`ref-counter`},iit={class:`ref-tiles-grid`},ait=[`title`,`onClick`],oit=[`src`,`alt`],sit={class:`thumb-tag`},cit=[`onClick`],lit={key:1,class:`control-block`},uit={class:`video-frames-grid`},dit=[`src`],fit=[`src`],pit={class:`picker-top-bar`},mit={class:`picker-title`},hit={class:`picker-quick-btns`},git=[`disabled`],_it={class:`picker-thumbs-row`},vit=[`onClick`],yit=[`src`,`alt`],bit={key:1,class:`picker-empty-tip`},xit={key:2,class:`picker-thumbs-row`},Sit=[`onClick`],Cit=[`src`,`alt`],wit={key:3,class:`picker-empty-tip`},Tit={class:`control-block`},Eit={class:`prompt-card-box`},Dit=[`placeholder`],Oit={class:`prompt-bottom-toolbar`},kit={class:`icon-pop-anchor`},Ait={key:0,class:`mini-floating-popover`},jit={class:`pop-row-between`},Mit={class:`icon-pop-anchor`},Nit={key:0,class:`mini-floating-popover tags-pop`},Pit={class:`quick-tags-wrap`},Fit=[`onClick`],Iit={class:`stepper-pill`},Lit={class:`step-num`},Rit={class:`param-pill-anchor`},zit={key:0,class:`pill-dropdown-menu`},Bit=[`onClick`],Vit={class:`muted-sub`},Hit={class:`param-pill-anchor`},Uit={key:0,class:`pill-dropdown-menu right`},Wit=[`onClick`],Git={class:`param-pill-anchor`},Kit={key:0,class:`pill-dropdown-menu`},qit=[`onClick`],Jit={class:`param-pill-anchor`},Yit={key:0,class:`pill-dropdown-menu`},Xit=[`onClick`],Zit={class:`generate-cta-wrap`},Qit=[`disabled`],$it={class:`cta-text`},eat={key:0,class:`cta-spinner`},tat={key:1,class:`sparkle-icon`,viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`},nat={key:4,class:`generated-results-section`},rat={class:`results-header`},iat={class:`results-title`},aat={class:`results-grid`},oat=[`onClick`],sat=[`src`],cat=[`src`,`alt`],lat={key:2,class:`video-badge`},uat={class:`result-overlay`},dat=[`onClick`],fat=[`onClick`],pat=(0,t.defineComponent)({__name:`CreateMaterialPanel`,emits:[`select`,`preview`,`generated`],setup(e,{expose:n,emit:r}){let i=[{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义千问`,model:`qwen-image-3.0`,displayName:`通义千问生图 3.0`,description:`新一代真实感高画质生图模型,擅长版面布局与极清文字渲染`,size:`1328*1328`,recommendedSizes:[`1328*1328`,`1024*1024`,`1280*720`,`720*1280`],supportsRefImage:!0,isDefault:!0},{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义千问`,model:`qwen-image-3.0-pro`,displayName:`通义千问生图 3.0 Pro`,description:`专业级画质生图大模型,提供摄影级光影与高保真质感`,size:`1328*1328`,recommendedSizes:[`1328*1328`,`1024*1024`,`1280*720`,`720*1280`],supportsRefImage:!0,isDefault:!1},{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义千问`,model:`qwen-image-max`,displayName:`通义千问生图 Max`,description:`旗舰级多模态文生图模型,色彩绚丽生动,适合商业海报与插画`,size:`1328*1328`,recommendedSizes:[`1328*1328`,`1024*1024`,`1280*720`,`720*1280`],supportsRefImage:!0,isDefault:!1},{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义万相`,model:`wan2.7-image`,displayName:`通义万相 2.7 图像生成`,description:`万相 2.7 旗舰文生图模型,构图与光影细节极佳`,size:`1024*1024`,recommendedSizes:[`1024*1024`,`1280*720`,`720*1280`,`1024*768`,`768*1024`],supportsRefImage:!1,isDefault:!1},{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义万相`,model:`wanx2.1-t2i-turbo`,displayName:`通义万相 2.1 Turbo`,description:`极速出图模型,适合高频概念预览与灵感探索`,size:`1024*1024`,recommendedSizes:[`1024*1024`,`1280*720`,`720*1280`],supportsRefImage:!1,isDefault:!1}],a=[{model:`wanx2.1-i2v-plus`,displayName:`通义万相 2.1 视频增强版`,vendor:`通义万相`},{model:`Wan 3.0`,displayName:`通义万相 Wan 3.0 视频生成`,vendor:`通义万相`},{model:`Seedance 2.5`,displayName:`Seedance 2.5 动态视频`,vendor:`ByteDance`},{model:`Kling 3.0`,displayName:`可灵 Kling 3.0 高清视频`,vendor:`Kling`},{model:`MiniMax H3`,displayName:`海螺 MiniMax H3 视频`,vendor:`MiniMax`}],o=[`电影级光影`,`3D 磨砂玻璃`,`极简留白构图`,`赛博朋克霓虹`,`柔和体积光`,`扁平矢量插画`,`8K 超清细节`,`等轴测微缩景观`],s=[{id:`style-3d`,name:`3D 玻璃质感`,url:`https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=400&auto=format&fit=crop&q=80`},{id:`style-cyber`,name:`流光科技感`,url:`https://images.unsplash.com/photo-1550745165-9bc0b252726f?w=400&auto=format&fit=crop&q=80`},{id:`style-minimal`,name:`极简建筑光影`,url:`https://images.unsplash.com/photo-1513694203232-719a280e022f?w=400&auto=format&fit=crop&q=80`},{id:`style-art`,name:`暖调商业插画`,url:`https://images.unsplash.com/photo-1579783902614-a3fb3927b675?w=400&auto=format&fit=crop&q=80`}],c=r,{notify:l,activeSlide:u,selectedElementId:d,placeholderMaterialTargetId:f,resolveActivePlaceholderTargetId:p}=e6(),m=(0,t.computed)(()=>d?.value&&u?.value?.elements?.find(e=>e.id===d.value)||null),h=(0,t.computed)(()=>!!(p&&p()||f?.value||typeof window<`u`&&window.__jvsPlaceholderTargetId)),{damFetchJson:g,isDamLoggedIn:_}=c9(),v=(0,t.ref)(`image`),y=(0,t.ref)([...i]),b=(0,t.ref)(`qwen-image-3.0`),x=(0,t.ref)(`wanx2.1-i2v-plus`),S=(0,t.ref)(!1),C=(0,t.ref)(!1),w=(0,t.ref)([]),T=(0,t.ref)(null),E=(0,t.ref)(null),D=(0,t.ref)(!1),O=(0,t.ref)(`add`),k=(0,t.ref)([]),A=(0,t.ref)(!1),j=(0,t.ref)(null),M=(0,t.ref)(!1),N=(0,t.ref)(``),P=(0,t.ref)(!0),F=(0,t.ref)(!1),I=(0,t.ref)(!1),L=(0,t.ref)(!1),R=(0,t.ref)(!1),z=(0,t.ref)(``),B=(0,t.ref)(1),V=(0,t.ref)(`1:1`),ee=(0,t.ref)(`1K · High`),te=(0,t.ref)(!1),ne=(0,t.ref)(!1),re=(0,t.ref)(`5-6"`),H=(0,t.ref)(`16:9`),U=(0,t.ref)(!0),ie=(0,t.ref)(!1),W=(0,t.ref)(!1),ae=(0,t.ref)(!1),G=(0,t.ref)(void 0),oe=(0,t.ref)([]),se=(0,t.computed)(()=>y.value.find(e=>e.model===b.value)||y.value[0]||i[0]),ce=(0,t.computed)(()=>b.value.toLowerCase().includes(`wan`)),le=(0,t.computed)(()=>{let e=m.value;return e&&e.type===`image`&&(e.src||e.url)?String(e.src||e.url):``});function ue(e,t){let n=t.startsWith(`2K`);switch(e){case`1:1`:return n?`1440*1440`:b.value.startsWith(`qwen`)?`1328*1328`:`1024*1024`;case`16:9`:return n?`1920*1080`:`1280*720`;case`9:16`:return n?`1080*1920`:`720*1280`;case`4:3`:return n?`1440*1080`:`1024*768`;case`3:4`:return n?`1080*1440`:`768*1024`;default:return`1024*1024`}}async function de(){if(_.value)try{let e=await g(`/image/generate/models`),t=[];if(Array.isArray(e)?t=e:Array.isArray(e?.data?.data)?t=e.data.data:Array.isArray(e?.data)&&(t=e.data),t.length>0&&(y.value=t,!t.some(e=>e.model===b.value))){let e=t.find(e=>e.isDefault)||t[0];e&&(b.value=e.model)}}catch{}}function fe(){S.value=!1,C.value=!1,I.value=!1,L.value=!1,te.value=!1,ne.value=!1,ie.value=!1,W.value=!1}function pe(e){v.value===`image`?b.value=e:x.value=e,S.value=!1}function me(e){let t=N.value.trim();N.value=t?`${t},${e}`:e,L.value=!1}function he(){z.value=N.value,R.value=!0}function ge(){N.value=z.value,R.value=!1}async function _e(e){if(fe(),O.value=e,D.value=!0,k.value.length===0&&_.value){A.value=!0;try{let e=await g(`/asset/recent`,{params:{current:1,size:12,assetType:`IMAGE`}});k.value=(Array.isArray(e?.data?.records)?e.data.records:Array.isArray(e?.data)?e.data:[]).map(e=>{let t=e.fileUrl||e.imageUrl||e.url||e.previewUrl||``;return t?{id:String(e.id||Math.random()),title:e.name||`我的资产`,url:t,previewUrl:t}:null}).filter(e=>!!e)}catch{k.value=[]}finally{A.value=!1}}}function ve(e){if(!e.url)return;if(O.value===`video-start`&&D.value){T.value={id:e.id||`vstart-${Date.now()}`,name:e.name||`起始帧`,url:e.url,type:`add`,assetId:e.assetId},D.value=!1;return}if(O.value===`video-end`&&D.value){E.value={id:e.id||`vend-${Date.now()}`,name:e.name||`结束帧`,url:e.url,type:`add`,assetId:e.assetId},D.value=!1;return}if(w.value.length>=8){l(`参考素材最多支持添加 8 张`);return}if(w.value.some(t=>t.url===e.url)){l(`该参考图已在列表中`),D.value=!1;return}let t=e.type||(O.value===`style`||O.value===`character`?O.value:`add`),n=w.value.length+1;w.value.push({id:e.id||`ref-${Date.now()}-${n}`,name:e.name||(t===`style`?`风格参考-${n}`:t===`character`?`角色参考-${n}`:`参考图-${n}`),url:e.url,type:t,assetId:e.assetId||e.id,assetType:`IMAGE`,sourceType:e.sourceType||(t===`style`?`REFERENCE`:`UPLOAD`)}),D.value=!1}function ye(e){w.value=w.value.filter(t=>t.id!==e)}function be(e){let t=`@img${e+1} `;N.value.includes(`@img${e+1}`)||(N.value=(N.value?N.value+` `:``)+t)}async function xe(e){let t=e.target,n=t.files?.[0];if(t.value=``,n){M.value=!0;try{let e=new FormData;e.append(`file`,n),e.append(`path`,`/dam/media/`),e.append(`fileName`,n.name),e.append(`id`,String(Date.now())),e.append(`assetType`,`IMAGE`);let t=await g(`/upload/file`,{method:`POST`,body:e}),r=t?.data===void 0?t:t.data,i=r?.data===void 0?r:r.data,a=i?.ossUrl||i?.fileLink||i?.fileUrl||i?.url||r?.ossUrl||r?.fileLink||r?.fileUrl||r?.url||``;a?(ve({name:n.name,url:a,sourceType:`UPLOAD`}),l(`参考图上传成功`)):l(`上传未返回有效图片地址`)}catch(e){l(`上传参考图失败: ${e.message||`网络异常`}`)}finally{M.value=!1}}}async function Se(){let e=N.value.trim();if(!e){l(v.value===`image`?`请输入您想要生成的画面描述提示词`:`请输入视频画面与运镜描述提示词`);return}if(v.value===`image`){let t=se.value;if(w.value.length>0&&t&&t.supportsRefImage===!1){l(`当前模型【${b.value}】不支持参考图,请切换为 qwen-image-3.0 或移除参考素材`);return}ae.value=!0;try{let n=ue(V.value,ee.value),[r,i]=n.split(`*`),a=P.value?`${e},高细节,大师级构图,光影质感极佳`:e,o=w.value.map((e,t)=>({assetId:e.assetId||e.id||`ref_${Date.now()}_${t}`,url:e.url,assetType:`IMAGE`,sourceType:e.sourceType||`UPLOAD`})),s={sessionId:G.value,prompt:a,size:n,model:b.value,provider:t?.provider||`DASHSCOPE`,refStrength:.65,...o.length>0?{refImages:o,refImageUrls:o.map(e=>e.url)}:{}},u=await g(`/image/generate`,{method:`POST`,body:JSON.stringify(s)}),d=u?.data?.data||u?.data||u,f=u?.code??u?.data?.code??0;if((f===0||f===200)&&d){d.sessionId&&(G.value=d.sessionId);let t=Array.isArray(d.imageUrls)&&d.imageUrls.length>0?d.imageUrls:d.imageUrl?[d.imageUrl]:[];if(t.length>0)t.forEach((t,n)=>{let a={id:d.recordId?`${d.recordId}_${n}`:`gen-${Date.now()}-${n}`,title:e,type:`image`,assetType:`IMAGE`,sourceType:`GENERATE`,badgeLabel:`AI 生成`,url:t,previewUrl:t,sourceUrl:t,originalWidth:Number(r)||1024,originalHeight:Number(i)||1024,model:d.model||b.value};oe.value.unshift(a),c(`generated`,a)}),l(`图片生成成功!点击下方卡片即可插入画布`);else throw Error(u?.msg||`未返回有效图片地址`)}else throw Error(u?.msg||`生成图片失败`)}catch(e){l(`图片生成失败: ${e.message||`请检查网络或服务配置`}`)}finally{ae.value=!1}}else{ae.value=!0;try{let t={prompt:U.value?`${e},电影级平滑运镜`:e,model:x.value,aspectRatio:H.value,duration:re.value===`10"`?10:5,startImageUrl:T.value?.url||void 0,endImageUrl:E.value?.url||void 0},n=await g(`/video/generate`,{method:`POST`,body:JSON.stringify(t)}),r=n?.data?.data||n?.data||n,i=r?.videoUrl||r?.fileUrl||r?.url||``;if(i){let t={id:r?.recordId||`vid-${Date.now()}`,title:e,type:`video`,assetType:`VIDEO`,sourceType:`GENERATE`,badgeLabel:`AI 视频`,url:i,previewUrl:i,sourceUrl:i,originalWidth:H.value===`9:16`?720:1280,originalHeight:H.value===`9:16`?1280:720,model:x.value};oe.value.unshift(t),c(`generated`,t),l(`视频生成成功!点击卡片即可插入画布`)}else throw Error(n?.msg||`视频生成任务已提交或暂未返回直链,请稍后在「我的素材 - AI创作记录」中查看`)}catch(e){l(e.message||`视频生成服务暂未就绪`)}finally{ae.value=!1}}}return(0,t.onMounted)(()=>{de(),window.addEventListener(`click`,fe)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`click`,fe)}),n({addReferenceItem:ve,switchCreateMode:e=>{e!==`video`&&(v.value=e)}}),(e,n)=>{let r=wb,i=rw,l=UE,u=XB;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,Frt,[(0,t.createElementVNode)(`input`,{ref_key:`refFileInputRef`,ref:j,type:`file`,accept:`image/*`,style:{display:`none`},onChange:xe},null,544),(0,t.createElementVNode)(`div`,Irt,[(0,t.createElementVNode)(`div`,Lrt,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`mode-seg-btn`,{active:v.value===`image`}]),onClick:n[0]||=e=>v.value=`image`},[...n[35]||=[(0,t.createElementVNode)(`span`,null,`图片生成器`,-1)]],2),n[36]||=(0,t.createElementVNode)(`button`,{type:`button`,class:`mode-seg-btn is-disabled`,disabled:``,title:`视频生成功能暂未开放`},[(0,t.createElementVNode)(`span`,null,`视频生成`)],-1)])]),(0,t.createElementVNode)(`div`,Rrt,[(0,t.createElementVNode)(`div`,zrt,[n[40]||=(0,t.createElementVNode)(`label`,{class:`block-label`},`模型选择`,-1),(0,t.createElementVNode)(`div`,{class:`model-select-wrap`,onClick:n[2]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`button`,{type:`button`,class:`model-dropdown-trigger`,onClick:n[1]||=e=>S.value=!S.value},[(0,t.createElementVNode)(`div`,Brt,[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`model-brand-cube`,{"is-video":v.value===`video`,"is-wanx":v.value===`image`&&ce.value}])},[v.value===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Vrt,[...n[37]||=[(0,t.createElementVNode)(`polygon`,{points:`6 4 20 12 6 20 6 4`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Hrt,[...n[38]||=[(0,t.createElementVNode)(`path`,{d:`M12 2L3 7v10l9 5 9-5V7l-9-5z`},null,-1)]]))],2),(0,t.createElementVNode)(`span`,Urt,(0,t.toDisplayString)(v.value===`image`?b.value:x.value),1)]),n[39]||=(0,t.createElementVNode)(`svg`,{class:`chevron-icon`,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,t.createElementVNode)(`polyline`,{points:`6 9 12 15 18 9`})],-1)]),(0,t.createVNode)(t.Transition,{name:`pop-fade`},{default:(0,t.withCtx)(()=>[S.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Wrt,[v.value===`image`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(y.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.model,class:(0,t.normalizeClass)([`model-option-item`,{active:e.model===b.value}]),onClick:t=>pe(e.model)},[(0,t.createElementVNode)(`div`,Krt,[(0,t.createElementVNode)(`span`,qrt,(0,t.toDisplayString)(e.model),1),e.supportsRefImage?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Jrt,`支持参考图`)):(0,t.createCommentVNode)(``,!0)]),e.displayName||e.description?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Yrt,(0,t.toDisplayString)(e.displayName||e.description),1)):(0,t.createCommentVNode)(``,!0)],10,Grt))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(a,e=>(0,t.createElementVNode)(`div`,{key:e.model,class:(0,t.normalizeClass)([`model-option-item`,{active:e.model===x.value}]),onClick:t=>pe(e.model)},[(0,t.createElementVNode)(`div`,Zrt,[(0,t.createElementVNode)(`span`,Qrt,(0,t.toDisplayString)(e.model),1),(0,t.createElementVNode)(`span`,$rt,(0,t.toDisplayString)(e.vendor),1)]),(0,t.createElementVNode)(`div`,eit,(0,t.toDisplayString)(e.displayName),1)],10,Xrt)),64))])):(0,t.createCommentVNode)(``,!0)]),_:1})])]),v.value===`image`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,tit,[(0,t.createElementVNode)(`div`,nit,[n[41]||=(0,t.createElementVNode)(`label`,{class:`block-label`},`参考素材`,-1),(0,t.createElementVNode)(`span`,rit,(0,t.toDisplayString)(w.value.length)+`/8`,1)]),(0,t.createElementVNode)(`div`,iit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`ref-action-tile`,onClick:n[3]||=(0,t.withModifiers)(e=>_e(`style`),[`stop`])},[...n[42]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`17`,height:`17`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})],-1),(0,t.createElementVNode)(`span`,{class:`tile-label`},`风格参考`,-1)]]),(0,t.createElementVNode)(`button`,{type:`button`,class:`ref-action-tile`,onClick:n[4]||=(0,t.withModifiers)(e=>_e(`character`),[`stop`])},[...n[43]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`17`,height:`17`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2`}),(0,t.createElementVNode)(`circle`,{cx:`12`,cy:`7`,r:`4`})],-1),(0,t.createElementVNode)(`span`,{class:`tile-label`},`角色参考`,-1)]]),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(w.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`ref-added-thumb`,title:`点击在提示词中引用 @img${n+1}`,onClick:e=>be(n)},[(0,t.createElementVNode)(`img`,{src:e.url,alt:e.name,class:`thumb-img`},null,8,oit),(0,t.createElementVNode)(`span`,sit,[e.type===`style`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createTextVNode)(`★`)],64)):(0,t.createCommentVNode)(``,!0),(0,t.createTextVNode)(` @img`+(0,t.toDisplayString)(n+1),1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`thumb-remove-btn`,title:`移除参考图`,onClick:(0,t.withModifiers)(t=>ye(e.id),[`stop`])},` × `,8,cit)],8,ait))),128)),w.value.length<8?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`ref-action-tile`,onClick:n[5]||=(0,t.withModifiers)(e=>_e(`add`),[`stop`])},[...n[44]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`17`,height:`17`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,t.createElementVNode)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1),(0,t.createElementVNode)(`span`,{class:`tile-label`},`添加素材`,-1)]])):(0,t.createCommentVNode)(``,!0)])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lit,[n[51]||=(0,t.createElementVNode)(`div`,{class:`block-header-line`},[(0,t.createElementVNode)(`label`,{class:`block-label`},`参考素材 (首尾帧)`)],-1),(0,t.createElementVNode)(`div`,uit,[(0,t.createElementVNode)(`div`,{class:`video-frame-slot`,onClick:n[7]||=(0,t.withModifiers)(e=>_e(`video-start`),[`stop`])},[T.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`img`,{src:T.value.url,class:`slot-preview-img`},null,8,dit),n[45]||=(0,t.createElementVNode)(`span`,{class:`slot-tag`},`起始帧`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`slot-clear-btn`,onClick:n[6]||=(0,t.withModifiers)(e=>T.value=null,[`stop`])},`×`)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[n[46]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[(0,t.createElementVNode)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),(0,t.createElementVNode)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,t.createElementVNode)(`polyline`,{points:`21 15 16 10 5 21`})],-1),n[47]||=(0,t.createElementVNode)(`span`,null,`起始帧 (可选)`,-1)],64))]),(0,t.createElementVNode)(`div`,{class:`video-frame-slot`,onClick:n[9]||=(0,t.withModifiers)(e=>_e(`video-end`),[`stop`])},[E.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`img`,{src:E.value.url,class:`slot-preview-img`},null,8,fit),n[48]||=(0,t.createElementVNode)(`span`,{class:`slot-tag`},`结束帧`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`slot-clear-btn`,onClick:n[8]||=(0,t.withModifiers)(e=>E.value=null,[`stop`])},`×`)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[n[49]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[(0,t.createElementVNode)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),(0,t.createElementVNode)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,t.createElementVNode)(`polyline`,{points:`21 15 16 10 5 21`})],-1),n[50]||=(0,t.createElementVNode)(`span`,null,`结束帧 (可选)`,-1)],64))])])])),(0,t.createVNode)(t.Transition,{name:`pop-fade`},{default:(0,t.withCtx)(()=>[D.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`ref-picker-drawer-card`,onClick:n[13]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,pit,[(0,t.createElementVNode)(`span`,mit,(0,t.toDisplayString)(O.value===`style`?`选择风格参考`:O.value===`character`?`选择角色参考`:`添加参考素材`),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`picker-close`,onClick:n[10]||=e=>D.value=!1},`×`)]),(0,t.createElementVNode)(`div`,hit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`picker-action-btn primary`,disabled:M.value,onClick:n[11]||=e=>j.value?.click()},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(M.value?`上传中...`:`+ 本地上传图片`),1)],8,git),le.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`picker-action-btn canvas-pick`,onClick:n[12]||=e=>ve({name:`画布选中图`,url:le.value,sourceType:`REFERENCE`})},[...n[52]||=[(0,t.createElementVNode)(`span`,null,`拾取画布选中图`,-1)]])):(0,t.createCommentVNode)(``,!0)]),O.value===`style`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[n[53]||=(0,t.createElementVNode)(`div`,{class:`picker-sub-label`},`预设视觉风格`,-1),(0,t.createElementVNode)(`div`,_it,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s,e=>(0,t.createElementVNode)(`div`,{key:e.id,class:`picker-mini-card`,onClick:t=>ve({id:e.id,name:e.name,url:e.url,type:`style`,sourceType:`REFERENCE`})},[(0,t.createElementVNode)(`img`,{src:e.url,alt:e.name},null,8,yit),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.name),1)],8,vit)),64))])],64)):(0,t.createCommentVNode)(``,!0),n[54]||=(0,t.createElementVNode)(`div`,{class:`picker-sub-label`},`从我的资产选择`,-1),A.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bit,`正在加载最近资产...`)):k.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xit,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(k.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`picker-mini-card`,onClick:t=>ve({id:String(e.id),name:e.title,url:e.url||``,assetId:String(e.id)})},[(0,t.createElementVNode)(`img`,{src:e.previewUrl||e.url,alt:e.title},null,8,Cit),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)],8,Sit))),128))])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wit,`暂无历史图片,请点击上方「本地上传图片」`))])):(0,t.createCommentVNode)(``,!0)]),_:1}),(0,t.createElementVNode)(`div`,Tit,[n[64]||=(0,t.createElementVNode)(`label`,{class:`block-label`},`提示词描述`,-1),(0,t.createElementVNode)(`div`,Eit,[(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":n[14]||=e=>N.value=e,rows:`4`,class:`prompt-textarea`,placeholder:v.value===`image`?`描述您想要生成的画面—可输入 @ 引入参考图`:`描述您想要生成的视频画面与镜头运动...`},null,8,Dit),[[t.vModelText,N.value]]),(0,t.createElementVNode)(`div`,Oit,[(0,t.createElementVNode)(`div`,{class:`ai-enhance-switch`,onClick:n[15]||=e=>v.value===`image`?P.value=!P.value:U.value=!U.value},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`switch-track`,{"is-on":v.value===`image`?P.value:U.value}])},[...n[55]||=[(0,t.createElementVNode)(`span`,{class:`switch-thumb`},null,-1)]],2),n[56]||=(0,t.createElementVNode)(`span`,{class:`switch-label`},`AI 提示词增强`,-1)]),(0,t.createElementVNode)(`div`,{class:`prompt-right-icons`,onClick:n[20]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,kit,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tool-icon-btn`,{active:F.value||I.value}]),title:`固定随机种子`,onClick:n[16]||=e=>{I.value=!I.value,L.value=!1}},[...n[57]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.9`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M12 22v-8`}),(0,t.createElementVNode)(`path`,{d:`M12 14c-4 0-7-3-7-7 0 0 3 0 7 3`}),(0,t.createElementVNode)(`path`,{d:`M12 14c4 0 7-3 7-7 0 0-3 0-7 3`})],-1)]],2),I.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ait,[(0,t.createElementVNode)(`div`,jit,[n[58]||=(0,t.createElementVNode)(`span`,null,`固定随机种子 (Seed)`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":n[17]||=e=>F.value=e,type:`checkbox`},null,512),[[t.vModelCheckbox,F.value]])]),n[59]||=(0,t.createElementVNode)(`p`,{class:`pop-muted-tip`},`开启后保持多次生成构图一致`,-1)])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,Mit,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tool-icon-btn`,{active:L.value}]),title:`插入常用修饰词`,onClick:n[18]||=e=>{L.value=!L.value,I.value=!1}},[...n[60]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.9`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z`}),(0,t.createElementVNode)(`line`,{x1:`7`,y1:`7`,x2:`7.01`,y2:`7`})],-1)]],2),L.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Nit,[n[61]||=(0,t.createElementVNode)(`div`,{class:`pop-card-title`},`点击追加风格词`,-1),(0,t.createElementVNode)(`div`,Pit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o,e=>(0,t.createElementVNode)(`span`,{key:e,class:`quick-tag-chip`,onClick:t=>me(e)},` + `+(0,t.toDisplayString)(e),9,Fit)),64))])])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`tool-icon-btn`,title:`展开编辑提示词`,onClick:he},[...n[62]||=[(0,t.createStaticVNode)(`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" data-v-e93b0081><polyline points="15 3 21 3 21 9" data-v-e93b0081></polyline><polyline points="9 21 3 21 3 15" data-v-e93b0081></polyline><line x1="21" y1="3" x2="14" y2="10" data-v-e93b0081></line><line x1="3" y1="21" x2="10" y2="14" data-v-e93b0081></line></svg>`,1)]]),(0,t.createElementVNode)(`button`,{type:`button`,class:`tool-icon-btn`,title:`清空提示词`,onClick:n[19]||=e=>N.value=``},[...n[63]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.9`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,t.createElementVNode)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]])])])])]),v.value===`image`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`params-pills-row`,onClick:n[25]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,Iit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`step-btn`,onClick:n[21]||=e=>B.value=Math.max(1,B.value-1)},`-`),(0,t.createElementVNode)(`span`,Lit,(0,t.toDisplayString)(B.value),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`step-btn`,onClick:n[22]||=e=>B.value=Math.min(4,B.value+1)},`+`)]),(0,t.createElementVNode)(`div`,Rit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`param-select-pill`,onClick:n[23]||=e=>{te.value=!te.value,ne.value=!1}},[n[65]||=(0,t.createElementVNode)(`span`,{class:`ratio-rect-icon`},null,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(V.value),1)]),te.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,zit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([`1:1`,`16:9`,`9:16`,`4:3`,`3:4`],e=>(0,t.createElementVNode)(`div`,{key:e,class:(0,t.normalizeClass)([`pill-menu-item`,{active:V.value===e}]),onClick:t=>{V.value=e,te.value=!1}},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e),1),(0,t.createElementVNode)(`span`,Vit,(0,t.toDisplayString)(ue(e,ee.value)),1)],10,Bit)),64))])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,Hit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`param-select-pill`,onClick:n[24]||=e=>{ne.value=!ne.value,te.value=!1}},[n[66]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,t.createElementVNode)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,t.createElementVNode)(`path`,{d:`M16 2v4M8 2v4`})],-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(ee.value),1)]),ne.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Uit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([`1K · High`,`1K · Fast`,`2K · HD`],e=>(0,t.createElementVNode)(`div`,{key:e,class:(0,t.normalizeClass)([`pill-menu-item`,{active:ee.value===e}]),onClick:t=>{ee.value=e,ne.value=!1}},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e),1)],10,Wit)),64))])):(0,t.createCommentVNode)(``,!0)])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`params-pills-row`,onClick:n[29]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,Git,[(0,t.createElementVNode)(`button`,{type:`button`,class:`param-select-pill`,onClick:n[26]||=e=>{ie.value=!ie.value,W.value=!1}},[n[67]||=(0,t.createElementVNode)(`span`,null,`⏱`,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(re.value),1)]),ie.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Kit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([`5-6"`,`10"`],e=>(0,t.createElementVNode)(`div`,{key:e,class:(0,t.normalizeClass)([`pill-menu-item`,{active:re.value===e}]),onClick:t=>{re.value=e,ie.value=!1}},[(0,t.createElementVNode)(`span`,null,`时长 `+(0,t.toDisplayString)(e),1)],10,qit)),64))])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,Jit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`param-select-pill`,onClick:n[27]||=e=>{W.value=!W.value,ie.value=!1}},[n[68]||=(0,t.createElementVNode)(`span`,{class:`ratio-rect-icon wide`},null,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(H.value),1)]),W.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Yit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([`16:9`,`9:16`,`1:1`],e=>(0,t.createElementVNode)(`div`,{key:e,class:(0,t.normalizeClass)([`pill-menu-item`,{active:H.value===e}]),onClick:t=>{H.value=e,W.value=!1}},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e),1)],10,Xit)),64))])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`param-select-pill`,{"is-active-blue":U.value}]),onClick:n[28]||=e=>U.value=!U.value},[n[69]||=(0,t.createElementVNode)(`span`,null,`⚡`,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(U.value?`运镜 ON`:`运镜 OFF`),1)],2)])),(0,t.createElementVNode)(`div`,Zit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`start-generate-btn`,disabled:ae.value,onClick:Se},[(0,t.createElementVNode)(`span`,$it,(0,t.toDisplayString)(ae.value?`正在生成中...`:`开始生成`),1),ae.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,eat)):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,tat,[...n[70]||=[(0,t.createElementVNode)(`path`,{d:`M19 2.5C19 4.7 20.3 6.5 22.5 6.5C20.3 6.5 19 8.3 19 10.5C19 8.3 17.7 6.5 15.5 6.5C17.7 6.5 19 4.7 19 2.5Z`},null,-1),(0,t.createElementVNode)(`path`,{d:`M11.5 12C11.5 13.3 12.7 14.5 14 14.5C12.7 14.5 11.5 15.7 11.5 17C11.5 15.7 10.3 14.5 9 14.5C10.3 14.5 11.5 13.3 11.5 12Z`},null,-1)]]))],8,Qit)]),oe.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nat,[(0,t.createElementVNode)(`div`,rat,[(0,t.createElementVNode)(`span`,iat,`本次生成结果 (`+(0,t.toDisplayString)(oe.value.length)+`)`,1),n[71]||=(0,t.createElementVNode)(`span`,{class:`results-sub`},`已同步至「我的素材」`,-1)]),(0,t.createElementVNode)(`div`,aat,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(oe.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`result-card`,onClick:t=>c(`select`,e)},[e.type===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:e.url,muted:``,playsinline:``,class:`result-media`,onMouseenter:n[30]||=e=>e.target?.play?.(),onMouseleave:n[31]||=e=>e.target?.pause?.()},null,40,sat)):((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.url,alt:e.title,class:`result-media`},null,8,cat)),e.type===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,lat,[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(pb))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,uat,[(0,t.createElementVNode)(`button`,{type:`button`,class:`res-act-btn insert`,onClick:(0,t.withModifiers)(t=>c(`select`,e),[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(nb))]),_:1}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(h.value?`插入占位符`:`插入画布`),1)],8,dat),(0,t.createElementVNode)(`button`,{type:`button`,class:`res-act-btn preview`,title:`大图预览`,onClick:(0,t.withModifiers)(t=>c(`preview`,e,oe.value,t),[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(mb))]),_:1})],8,fat)])],8,oat))),128))])])):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(u,{modelValue:R.value,"onUpdate:modelValue":n[34]||=e=>R.value=e,title:`编辑提示词描述`,width:`460px`,"append-to-body":``,"align-center":``},{footer:(0,t.withCtx)(()=>[(0,t.createVNode)(l,{size:`small`,onClick:n[33]||=e=>R.value=!1},{default:(0,t.withCtx)(()=>[...n[72]||=[(0,t.createTextVNode)(`取消`,-1)]]),_:1}),(0,t.createVNode)(l,{type:`primary`,size:`small`,onClick:ge},{default:(0,t.withCtx)(()=>[...n[73]||=[(0,t.createTextVNode)(`应用提示词`,-1)]]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(i,{modelValue:z.value,"onUpdate:modelValue":n[32]||=e=>z.value=e,type:`textarea`,rows:6,placeholder:`详细描述画面主体、光影氛围、构图风格与细节...`},null,8,[`modelValue`])]),_:1},8,[`modelValue`])])}}});B8();var mat=z8(pat,[[`__scopeId`,`data-v-e93b0081`]]);$K(),$X(),n9(),_b(),L8(),RQ();var hat={class:`material-drawer-container`},gat={key:0,class:`guest-auth-toast`},_at={class:`material-drawer-header`},vat={key:0,class:`drawer-header-left`},yat={class:`drawer-header-title`},bat={key:0,class:`material-top-tabs-wrap`},xat={class:`material-top-segmented`},Sat=[`title`],Cat={key:0,class:`tab-lock-svg`,viewBox:`0 0 24 24`,width:`11`,height:`11`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`},wat=[`title`],Tat={key:0,class:`tab-ai-spark`},Eat={key:1,class:`tab-lock-svg`,viewBox:`0 0 24 24`,width:`11`,height:`11`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`},Dat={key:0,class:`material-overview-body`},Oat={class:`overview-search-wrap`},kat={class:`overview-search-box`},Aat={class:`overview-sections-scroll`},jat={class:`section-header-row`},Mat={class:`section-cat-title`},Nat=[`onClick`],Pat={class:`section-carousel-container`},Fat=[`onScroll`],Iat=[`onClick`],Lat=[`src`,`onLoadeddata`],Rat=[`src`,`alt`,`onLoad`],zat={key:2,class:`video-badge-icon`},Bat=[`onClick`],Vat=[`onClick`],Hat=[`onClick`],Uat=[`onClick`],Wat={key:1,class:`material-detail-body`},Gat={class:`detail-tags-bar-wrap`},Kat=[`onClick`],qat={key:0,class:`gallery-loading-box`},Jat={class:`loading-tip-text`},Yat={key:1,class:`detail-waterfall-scroll`},Xat={key:0,class:`detail-masonry-wrapper`},Zat={class:`detail-masonry-columns`},Qat=[`onClick`],$at=[`src`],eot=[`src`,`alt`],tot={key:2,class:`detail-card-placeholder`},not={key:3,class:`video-badge-icon`},rot=[`onClick`],iot=[`onClick`],aot={class:`waterfall-footer-status`},oot={key:0,class:`loading-more-row`},sot={key:1,class:`load-failed-row`},cot={key:3,class:`all-loaded-divider`},lot={key:1,class:`gallery-empty-state`},uot={class:`empty-title`},dot={class:`preview-header-bar`},fot={class:`preview-title-wrap`},pot={class:`preview-format-pill`},mot={class:`preview-title-text`},hot=[`src`],got=[`src`,`alt`],_ot={class:`preview-footer-bar`},vot={key:0,class:`preview-page-indicator`},yot=24,bot=(0,t.defineComponent)({__name:`TemplateGallery`,setup(e){let{addElement:n,notify:r,materialApiUrl:i,materialTreeApiUrl:a,materialPageApiUrl:o,materialHeaders:s,activeTab:c,materialPopoverVisible:l,activeSlide:u,selectedElementId:d,placeholderMaterialTargetId:f,resolveActivePlaceholderTargetId:p,replacePlaceholderElement:m}=e6(),h=[{key:`Vectors`,label:`矢量图`,subType:`Vectors`,tags:[`风景`,`商务`,`科技`,`插画`,`几何`,`背景`,`图标`]},{key:`Photos`,label:`照片`,subType:`Photos`,tags:[`风景`,`商务`,`科技`,`人物`,`自然`,`建筑`,`美食`,`办公`]},{key:`Illustrations`,label:`插画`,subType:`Illustrations`,tags:[`风景`,`商务`,`科技`,`人物`,`自然`,`创意`,`手绘`,`扁平`]},{key:`Videos`,label:`高清视频`,subType:`Videos`,tags:[`风景`,`商务`,`科技`,`自然`,`城市`,`航拍`,`办公`]}],g={Vectors:`矢量图`,Photos:`照片`,Illustrations:`插画`,Videos:`高清视频`},{isDamLoggedIn:_,sharedMaterialMainTab:v,refreshSessionState:y,probeRemoteSessionV3:b}=c9(),x=(0,t.ref)(null),S=(0,t.ref)(null),C=(0,t.ref)(!1),w=(0,t.ref)(`请先登录后使用该功能`),T=null;function E(e){w.value=e===`我的素材`?`请先登录后查看「我的素材」`:`请先登录后使用「创建素材」`,C.value=!0,T&&clearTimeout(T),T=setTimeout(()=>{C.value=!1},2200)}async function D(e){if(y(),e!==`search`&&!_.value&&!await b(!0)&&!_.value){E(e===`mine`?`我的素材`:`创建素材`);return}v.value=e}(0,t.watch)(_,e=>{!e&&v.value!==`search`&&(v.value=`search`)});let O=(0,t.ref)(`overview`),k=(0,t.ref)(``),A=(0,t.ref)(`素材库`),j=(0,t.ref)(``),M=(0,t.ref)(``),N=(0,t.reactive)({query:``,activeSubType:`Vectors`}),P=(0,t.computed)(()=>M.value?M.value:j.value?j.value:A.value||g[N.activeSubType]||`素材库`),F=(0,t.computed)(()=>{let e=h.find(e=>e.subType===N.activeSubType);return e?e.tags:[`风景`,`商务`,`科技`,`人物`,`自然`,`建筑`,`办公`]});function I(e){if(!e)return!1;let t=e.split(`?`)[0].toLowerCase();return t.endsWith(`.mp4`)||t.endsWith(`.webm`)||t.endsWith(`.mov`)||t.endsWith(`.m4v`)||t.endsWith(`.ogg`)}function L(e){return e.type===`video`||e.assetType===`VIDEO`||e.assetSubType===`Videos`||e.subType===`Videos`||I(e.sourceUrl||e.url||e.downloadUrl)}function R(e){return e.previewUrl||e.image||e.coverUrl||e.thumbnail||e.url||e.sourceUrl||e.downloadUrl||``}function z(e){if(e.format)return e.format.toUpperCase();let t=(e.sourceUrl||e.url||e.previewUrl||e.fileName||``).toLowerCase();return t.includes(`.mp4`)?`MP4`:t.includes(`.mov`)||t.includes(`.webm`)?`VIDEO`:t.includes(`.svg`)?`SVG`:t.includes(`.png`)?`PNG`:t.includes(`.gif`)?`GIF`:e.assetSubType===`Videos`||e.type===`video`?`MP4`:e.assetSubType===`Vectors`||e.type===`svg`?`SVG`:`JPG`}let B=(0,t.ref)(!1),V=(0,t.ref)([]),ee=(0,t.ref)(0),te=(0,t.ref)(!1),ne=(0,t.computed)(()=>V.value.length===0?null:V.value[ee.value]||null);function re(e,t){t&&(t.stopPropagation(),t.preventDefault());let n=L(e)&&(e.sourceUrl||e.url||e.downloadUrl)||R(e);if(!n){r(`该素材暂无可用预览地址`);return}let i=e.assetSubType||e.subType||N.activeSubType,a=O.value===`detail`?Re.value:fe[i]||[],o=[];a.forEach(e=>{let t=L(e),n=t&&(e.sourceUrl||e.url||e.downloadUrl)||R(e);n&&o.push({url:n,isVideo:t&&I(n),title:e.title||`素材预览`,format:z(e),meta:e})});let s=o.findIndex(e=>e.url===n);s>=0?ee.value=s:(o.unshift({url:n,isVideo:L(e)&&I(n),title:e.title||`素材预览`,format:z(e),meta:e}),ee.value=0),V.value=o,l&&l.value?(te.value=!0,l.value=!1):te.value=!1,B.value=!0}function H(e,t,n){n&&(n.stopPropagation(),n.preventDefault());let i=L(e)&&(e.sourceUrl||e.url||e.downloadUrl)||R(e);if(!i){r(`该素材暂无可用预览地址`);return}let a=Array.isArray(t)&&t.length>0?t:[e],o=[];a.forEach(e=>{let t=L(e),n=t&&(e.sourceUrl||e.url||e.downloadUrl)||R(e);n&&o.push({url:n,isVideo:t&&I(n),title:e.title||`素材预览`,format:z(e),meta:e})});let s=o.findIndex(e=>e.url===i);s>=0?ee.value=s:(o.unshift({url:i,isVideo:L(e)&&I(i),title:e.title||`素材预览`,format:z(e),meta:e}),ee.value=0),V.value=o,l&&l.value?(te.value=!0,l.value=!1):te.value=!1,B.value=!0}async function U(e,n){if(n&&(n.stopPropagation(),n.preventDefault()),y(),!_.value&&!await b(!0)&&!_.value){E(`创建素材`);return}let i=R(e);if(!i){r(`该素材暂无可用参考图地址`);return}v.value=`create`,(0,t.nextTick)(()=>{S.value?.addReferenceItem({url:i,name:e.title||`参考图`})})}function ie(){x.value?.reloadAssets?.()}function W(){B.value=!1,te.value&&l&&(te.value=!1,setTimeout(()=>{l.value=!0},60))}function ae(){V.value.length<=1||(ee.value=(ee.value-1+V.value.length)%V.value.length)}function G(){V.value.length<=1||(ee.value=(ee.value+1)%V.value.length)}function oe(){ne.value&&(We(ne.value.meta),te.value=!1,B.value=!1)}function se(e){B.value&&(e.key===`Escape`||e.key===`Esc`?(e.preventDefault(),e.stopPropagation(),W()):e.key===`ArrowLeft`?ae():e.key===`ArrowRight`&&G())}async function ce(e,t={}){let n=await fetch(e,t),r=await n.text();if(!n.ok)throw Error(`请求接口异常 (${n.status} ${n.statusText})`);let i=r.trim();if(i.startsWith(`<`)||i.toLowerCase().startsWith(`<!doctype`))throw Error(`接口地址返回了 HTML 网页而非有效 JSON 数据`);try{return JSON.parse(r)}catch(e){throw Error(`JSON 解析失败: ${e.message}`)}}function le(){let e=o?.value&&o.value.trim()||i?.value&&i.value.trim()||`/jvs-dam/stock/search`;return(e.includes(`/api/dam/material/tree`)||e.includes(`/api/dam/material/page`))&&(e=S2e),e}function ue(e,t=`Photos`){let n=e.assetSubType||e.subType||t,r=e.type||``;r||=n===`Videos`||e.assetType===`VIDEO`?`video`:n===`Vectors`?`svg`:`image`;let i=e.previewUrl||e.image||e.coverUrl||e.thumbnail||e.url||e.downloadUrl||e.sourceUrl||``,a=e.sourceUrl||e.downloadUrl||e.url||i,o=a||i,s=e.sourcePlatform||(e.id&&typeof e.id==`string`&&e.id.includes(`_`)?e.id.split(`_`)[0].toUpperCase():``),c=e.format||z({...e,url:o,previewUrl:i,sourceUrl:a,type:r,assetSubType:n}),l=e.aspectRatio?String(e.aspectRatio).replace(`:`,`/`):void 0;return!l&&e.width&&e.height&&(l=`${e.width} / ${e.height}`),{...e,id:e.id||`stock-${Math.random().toString(36).slice(2,9)}`,title:e.title||`${s?`${s} `:``}${g[n]||`素材`}`,type:r,assetSubType:n,subType:n,sourcePlatform:s,format:c,category:e.category||g[n]||`素材`,previewUrl:i,url:o,sourceUrl:a,color:e.color||e.primaryColor||``,primaryColor:e.primaryColor||e.color||``,aspectRatio:l||`4 / 3`,originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,tags:Array.isArray(e.tags)?e.tags:[]}}function de(e,t=`Photos`){if(!e)return[];let n=[];if(Array.isArray(e))n=e;else if(Array.isArray(e?.data?.records))n=e.data.records;else if(Array.isArray(e?.records))n=e.records;else if(Array.isArray(e?.data?.list))n=e.data.list;else if(Array.isArray(e?.list))n=e.list;else if(Array.isArray(e?.data)){if(e.data.length>0&&Array.isArray(e.data[0]?.items))return e.data.flatMap(e=>(e.items||[]).map(e=>ue(e,t)));n=e.data}return n.map(e=>ue(e,t))}let fe=(0,t.reactive)({Vectors:[],Photos:[],Illustrations:[],Videos:[]}),pe=(0,t.reactive)({Vectors:!1,Photos:!1,Illustrations:!1,Videos:!1}),me=(0,t.reactive)({}),he=(0,t.reactive)({Vectors:{canLeft:!1,canRight:!1},Photos:{canLeft:!1,canRight:!1},Illustrations:{canLeft:!1,canRight:!1},Videos:{canLeft:!1,canRight:!1}});function ge(e,t){me[e]=t}function _e(e){let t=me[e];t&&(he[e]={canLeft:t.scrollLeft>4,canRight:t.scrollWidth-t.clientWidth-t.scrollLeft>4})}function ve(e,t){let n=me[e];if(!n)return;let r=t===`left`?-180:180;n.scrollBy({left:r,behavior:`smooth`}),setTimeout(()=>_e(e),260)}async function ye(e,n=``){pe[e.key]=!0;try{let t=le();if(!t){fe[e.key]=[];return}let r=new URLSearchParams;r.append(`current`,`1`),r.append(`size`,`12`),r.append(`subType`,e.subType);let i=n.trim();i&&r.append(`keyword`,i);let a=await ce(`${t}${t.includes(`?`)?`&`:`?`}${r.toString()}`,{headers:{...s.value||{}}});if(a&&a.code!==void 0&&a.code!==0&&a.code!==200){fe[e.key]=[];return}let o=de(a,e.subType);fe[e.key]=o.slice(0,12)}catch{fe[e.key]=[]}finally{pe[e.key]=!1,(0,t.nextTick)(()=>{_e(e.key),setTimeout(()=>_e(e.key),300)})}}function be(e=k.value){h.forEach(t=>{ye(t,e)})}let xe=(0,t.ref)(null),Se=(0,t.reactive)({canLeft:!1,canRight:!1});function Ce(){let e=xe.value;e&&(Se.canLeft=e.scrollLeft>4,Se.canRight=e.scrollWidth-e.clientWidth-e.scrollLeft>4)}function we(e){let t=xe.value;if(!t)return;let n=e===`left`?-140:140;t.scrollBy({left:n,behavior:`smooth`}),setTimeout(()=>Ce(),250)}async function Te(e){let n=h.find(t=>t.subType===e);N.activeSubType=e;let r=k.value.trim();A.value=n?n.label:g[e],j.value=r,M.value=``,N.query=r,O.value=`detail`,Me.value=1,je.value=[],Ie.value=!1,Pe.value=!1,await(0,t.nextTick)(),Ce(),await Le(1,!1)}function Ee(){be(k.value)}function De(){k.value=``,be(``)}function Oe(){O.value=`overview`,(0,t.nextTick)(()=>{h.forEach(e=>_e(e.key))})}async function ke(e){M.value=e,N.query=e||j.value,Me.value=1,je.value=[],Ie.value=!1,Pe.value=!1,await Le(1,!1)}let Ae=(0,t.ref)(!1),je=(0,t.ref)([]),Me=(0,t.ref)(1),Ne=(0,t.ref)(!1),Pe=(0,t.ref)(!1),Fe=(0,t.ref)(``),Ie=(0,t.ref)(!1);async function Le(e=1,t=!1){let n=le();if(!n){t||(je.value=[]),Ie.value=!0;return}try{Ae.value=!t,Ne.value=t,Pe.value=!1,Fe.value=``;let r=new URLSearchParams;r.append(`current`,String(e)),r.append(`size`,String(yot)),r.append(`subType`,N.activeSubType);let i=N.query.trim();i&&r.append(`keyword`,i);let a=await ce(`${n}${n.includes(`?`)?`&`:`?`}${r.toString()}`,{headers:{...s.value||{}}});if(a&&a.code!==void 0&&a.code!==0&&a.code!==200){t||(je.value=[]),Ie.value=!0;return}let o=de(a,N.activeSubType);if(o.length<yot?Ie.value=!0:Ie.value=!1,t){let e=new Set(je.value.map(e=>e.id)),t=o.filter(t=>!e.has(t.id));je.value=[...je.value,...t]}else je.value=o;Me.value=e}catch(e){console.warn(`[Stock Search] 加载公网素材出错:`,e),t?(Pe.value=!0,Fe.value=e.message||`网络连接或接口异常`):(je.value=[],Ie.value=!0)}finally{Ae.value=!1,Ne.value=!1}}let Re=(0,t.computed)(()=>je.value),ze=(0,t.computed)(()=>{let e=[],t=[],n=0,r=0;return Re.value.forEach((i,a)=>{let o=.75,s=Number(i.originalWidth||i.width),c=Number(i.originalHeight||i.height);s>0&&c>0?o=Math.max(.45,Math.min(1.8,c/s)):a%3==1?o=1.25:a%4==2&&(o=.65),n<=r?(e.push(i),n+=o):(t.push(i),r+=o)}),[e,t]}),Be=(0,t.computed)(()=>!Ie.value&&!Pe.value);async function Ve(){Ae.value||Ne.value||!Be.value||Pe.value||Ie.value||await Le(Me.value+1,!0)}async function He(){Pe.value=!1,Fe.value=``,await Le(Me.value+1,!0)}function Ue(e,t=`素材`,n=12){let r=(e||``).trim();return r?r.length>n?`${r.slice(0,n)}...`:r:t}function We(e){let t=L(e),i=e.sourceUrl||e.url||e.downloadUrl||e.previewUrl;if(!i){r(`该素材暂无可用的资源地址`);return}let a=e.originalWidth||e.width,o=e.originalHeight||e.height,s=d?.value?u?.value?.elements?.find(e=>e.id===d.value):null,c=f?.value||(typeof window<`u`?window.__jvsPlaceholderTargetId:null),l=(p?p():null)||(c&&(!s||s.id===c)?c:s&&NQ(s)?s.id:null);if(l&&m&&m(l,i,{isVideo:t,width:Number(a)||void 0,height:Number(o)||void 0,notifyMessage:t?`已使用视频 "${Ue(e.title,`高清视频`,12)}" 替换占位符`:`已使用素材 "${Ue(e.title,`图片`,12)}" 替换占位符图片`}))return;let h;if(a&&o&&a>0&&o>0){let e=Math.min(480/a,360/o,1);h={width:Math.round(a*e),height:Math.round(o*e)}}t?(n(`video`,i,void 0,void 0,void 0,h),r(`已成功添加视频 "${Ue(e.title,`高清视频`,12)}" 到画布`)):(n(`image`,i,void 0,void 0,void 0,h),r(`已成功添加素材 "${Ue(e.title,`图片`,12)}" 到画布`))}function Ge(){c.value=null}return(0,t.onMounted)(()=>{be(),window.addEventListener(`keydown`,se)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`keydown`,se)}),(0,t.watch)([()=>i?.value,()=>o?.value,()=>a?.value],()=>{be(),O.value===`detail`&&Le(1,!1)}),(e,n)=>{let r=wb;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,hat,[(0,t.createVNode)(t.Transition,{name:`guest-toast-fade`},{default:(0,t.withCtx)(()=>[C.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,gat,[n[12]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`#d97706`,"stroke-width":`2.2`},[(0,t.createElementVNode)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,t.createElementVNode)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,t.createElementVNode)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})],-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(w.value),1)])):(0,t.createCommentVNode)(``,!0)]),_:1}),(0,t.createElementVNode)(`div`,_at,[(0,t.unref)(v)!==`search`||O.value===`overview`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,vat,[...n[13]||=[(0,t.createElementVNode)(`span`,{class:`drawer-header-title`},`素材库`,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`drawer-back-btn`,onClick:Oe},[n[14]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),(0,t.createElementVNode)(`polyline`,{points:`12 19 5 12 12 5`})],-1),(0,t.createElementVNode)(`span`,yat,(0,t.toDisplayString)(P.value),1)])),(0,t.createElementVNode)(`button`,{type:`button`,class:`drawer-close-btn`,title:`关闭面板`,onClick:Ge},[...n[15]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,t.createElementVNode)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]])]),(0,t.unref)(v)!==`search`||O.value===`overview`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bat,[(0,t.createElementVNode)(`div`,xat,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`material-main-tab-btn`,{active:(0,t.unref)(v)===`search`}]),onClick:n[0]||=e=>D(`search`)},[...n[16]||=[(0,t.createElementVNode)(`span`,null,`检索`,-1)]],2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`material-main-tab-btn`,{active:(0,t.unref)(v)===`mine`,"is-disabled":!(0,t.unref)(_)}]),title:(0,t.unref)(_)?`查看我的项目与个人素材`:`请先登录后查看我的素材`,onClick:n[1]||=e=>D(`mine`)},[n[18]||=(0,t.createElementVNode)(`span`,null,`我的素材`,-1),(0,t.unref)(_)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Cat,[...n[17]||=[(0,t.createElementVNode)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`},null,-1),(0,t.createElementVNode)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`},null,-1)]]))],10,Sat),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`material-main-tab-btn`,{active:(0,t.unref)(v)===`create`,"is-disabled":!(0,t.unref)(_)}]),title:(0,t.unref)(_)?`AI 生成图片或视频素材`:`请先登录后使用创建素材`,onClick:n[2]||=e=>D(`create`)},[n[20]||=(0,t.createElementVNode)(`span`,null,`创建素材`,-1),(0,t.unref)(_)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Tat,`✦`)):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Eat,[...n[19]||=[(0,t.createElementVNode)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`},null,-1),(0,t.createElementVNode)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`},null,-1)]]))],10,wat)])])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(v)===`search`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[O.value===`overview`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Dat,[(0,t.createElementVNode)(`div`,Oat,[(0,t.createElementVNode)(`div`,kat,[(0,t.createVNode)(r,{class:`overview-search-icon`,onClick:Ee},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(sb))]),_:1}),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":n[3]||=e=>k.value=e,type:`text`,placeholder:`搜索`,class:`overview-search-input`,onKeyup:(0,t.withKeys)(Ee,[`enter`])},null,544),[[t.vModelText,k.value]]),k.value?((0,t.openBlock)(),(0,t.createBlock)(r,{key:0,class:`overview-search-clear`,onClick:De},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(By))]),_:1})):(0,t.createCommentVNode)(``,!0)])]),(0,t.createElementVNode)(`div`,Aat,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(h,e=>(0,t.createElementVNode)(`div`,{key:e.key,class:`overview-category-section`},[(0,t.createElementVNode)(`div`,jat,[(0,t.createElementVNode)(`span`,Mat,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`section-view-all-btn`,onClick:t=>Te(e.subType)},` 查看全部 `,8,Nat)]),(0,t.createElementVNode)(`div`,Pat,[(0,t.createElementVNode)(`div`,{ref_for:!0,ref:t=>ge(e.key,t),class:`section-carousel-track`,onScroll:t=>_e(e.key)},[pe[e.key]&&(!fe[e.key]||fe[e.key].length===0)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(3,e=>(0,t.createElementVNode)(`div`,{key:e,class:`overview-skeleton-card`})),64)):fe[e.key]&&fe[e.key].length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(fe[e.key],(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i.id||a,class:`overview-thumb-card`,onClick:e=>We(i)},[I(R(i))?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:R(i),muted:``,preload:`metadata`,playsinline:``,class:`overview-thumb-img`,onLoadeddata:t=>_e(e.key),onMouseenter:n[4]||=e=>e.target?.play?.(),onMouseleave:n[5]||=e=>e.target?.pause?.()},null,40,Lat)):R(i)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:R(i),alt:i.title||e.label,loading:`lazy`,class:`overview-thumb-img`,onLoad:t=>_e(e.key)},null,40,Rat)):(0,t.createCommentVNode)(``,!0),e.subType===`Videos`||L(i)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,zat,[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(pb))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(_)&&e.subType!==`Videos`&&!L(i)&&R(i)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,class:`overview-card-ref-btn`,title:`作为参考图发送到「创建素材」`,onClick:(0,t.withModifiers)(e=>U(i,e),[`stop`,`prevent`])},` @参考 `,8,Bat)):(0,t.createCommentVNode)(``,!0)],8,Iat))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`overview-empty-row`,onClick:t=>Te(e.subType)},[(0,t.createElementVNode)(`span`,null,`暂无`+(0,t.toDisplayString)(e.label)+`数据`,1)],8,Vat))],40,Fat),he[e.key]?.canLeft?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`carousel-edge-mask left-mask`,onClick:(0,t.withModifiers)(t=>ve(e.key,`left`),[`stop`])},[...n[21]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polyline`,{points:`15 18 9 12 15 6`})],-1)]],8,Hat)):(0,t.createCommentVNode)(``,!0),he[e.key]?.canRight?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`carousel-edge-mask right-mask`,onClick:(0,t.withModifiers)(t=>ve(e.key,`right`),[`stop`])},[...n[22]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],8,Uat)):(0,t.createCommentVNode)(``,!0)])])),64))])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Wat,[(0,t.createElementVNode)(`div`,Gat,[(0,t.createElementVNode)(`div`,{ref_key:`tagTrackRef`,ref:xe,class:`detail-tags-track`,onScroll:Ce},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`detail-tag-pill`,{active:M.value===``}]),onClick:n[6]||=e=>ke(``)},` 全部 `,2),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(F.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,class:(0,t.normalizeClass)([`detail-tag-pill`,{active:M.value===e}]),onClick:t=>ke(e)},(0,t.toDisplayString)(e),11,Kat))),128))],544),Se.canLeft?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`tags-edge-arrow left-arrow`,onClick:n[7]||=(0,t.withModifiers)(e=>we(`left`),[`stop`])},[...n[23]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polyline`,{points:`15 18 9 12 15 6`})],-1)]])):(0,t.createCommentVNode)(``,!0),Se.canRight?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`tags-edge-arrow right-arrow`,onClick:n[8]||=(0,t.withModifiers)(e=>we(`right`),[`stop`])},[...n[24]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polyline`,{points:`9 18 15 12 9 6`})],-1)]])):(0,t.createCommentVNode)(``,!0)]),Ae.value&&Re.value.length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,qat,[n[25]||=(0,t.createElementVNode)(`div`,{class:`loading-ring-spinner`},null,-1),(0,t.createElementVNode)(`span`,Jat,`正在加载`+(0,t.toDisplayString)(g[N.activeSubType])+`...`,1)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Yat,[Re.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Xat,[(0,t.createElementVNode)(`div`,Zat,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ze.value,(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i,class:`detail-masonry-col`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e,(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id||i,class:`detail-masonry-card`,onClick:t=>We(e)},[I(R(e))?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:R(e),muted:``,preload:`metadata`,playsinline:``,class:`detail-card-img`,onMouseenter:n[9]||=e=>e.target?.play?.(),onMouseleave:n[10]||=e=>e.target?.pause?.()},null,40,$at)):R(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:R(e),alt:e.title||`素材`,loading:`lazy`,class:`detail-card-img`},null,8,eot)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,tot,[...n[26]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`24`,height:`24`,fill:`none`,stroke:`#94a3b8`,"stroke-width":`1.5`},[(0,t.createElementVNode)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,t.createElementVNode)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,t.createElementVNode)(`polyline`,{points:`21 15 16 10 5 21`})],-1)]])),N.activeSubType===`Videos`||L(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,not,[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(pb))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(_)&&N.activeSubType!==`Videos`&&!L(e)&&R(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:4,type:`button`,class:`detail-card-ref-btn`,title:`作为参考图发送到「创建素材」`,onClick:(0,t.withModifiers)(t=>U(e,t),[`stop`,`prevent`])},` @参考 `,8,rot)):(0,t.createCommentVNode)(``,!0),R(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:5,type:`button`,class:`detail-card-preview-btn`,title:`大图预览`,onClick:(0,t.withModifiers)(t=>re(e,t),[`stop`,`prevent`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(mb))]),_:1})],8,iot)):(0,t.createCommentVNode)(``,!0)],8,Qat))),128))]))),128))]),(0,t.createElementVNode)(`div`,aot,[Ne.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,oot,[...n[27]||=[(0,t.createElementVNode)(`span`,{class:`btn-spinner-ring dark`},null,-1),(0,t.createElementVNode)(`span`,null,`正在加载更多...`,-1)]])):Pe.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sot,[n[28]||=(0,t.createElementVNode)(`span`,{class:`load-error-text`},`加载失败`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`retry-load-btn`,onClick:He},` 重试 `)])):Be.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,type:`button`,class:`load-more-action-btn`,onClick:Ve},` 加载更多 `)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cot,[...n[29]||=[(0,t.createElementVNode)(`span`,null,`— 已加载全部 —`,-1)]]))])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lot,[n[30]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`40`,height:`40`,fill:`none`,stroke:`#cbd5e1`,"stroke-width":`1.2`},[(0,t.createElementVNode)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,t.createElementVNode)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})],-1),(0,t.createElementVNode)(`p`,uot,(0,t.toDisplayString)(N.query?`未找到与 "${N.query}" 相关的素材`:`暂无相关素材`),1)]))]))]))],64)):(0,t.unref)(v)===`mine`&&(0,t.unref)(_)?((0,t.openBlock)(),(0,t.createBlock)(Prt,{key:2,ref_key:`myAssetsRef`,ref:x,onSelect:We,onPreview:H,onUseAsRef:n[11]||=e=>U(e)},null,512)):(0,t.unref)(v)===`create`&&(0,t.unref)(_)?((0,t.openBlock)(),(0,t.createBlock)(mat,{key:3,ref_key:`createPanelRef`,ref:S,onSelect:We,onPreview:H,onGenerated:ie},null,512)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createVNode)(t.Transition,{name:`preview-backdrop-fade`},{default:(0,t.withCtx)(()=>[B.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`custom-fullscreen-preview-modal`,onClick:(0,t.withModifiers)(W,[`self`])},[(0,t.createElementVNode)(`div`,dot,[(0,t.createElementVNode)(`div`,fot,[(0,t.createElementVNode)(`span`,pot,(0,t.toDisplayString)(ne.value?.format||`IMG`),1),(0,t.createElementVNode)(`span`,mot,(0,t.toDisplayString)(ne.value?.title||`素材大图预览`),1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`preview-close-cross-btn`,title:`关闭预览 (Esc)`,onClick:W},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Uy))]),_:1})])]),V.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`preview-arrow-btn prev-arrow`,title:`上一张 (←)`,onClick:(0,t.withModifiers)(ae,[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Ay))]),_:1})])):(0,t.createCommentVNode)(``,!0),V.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`preview-arrow-btn next-arrow`,title:`下一张 (→)`,onClick:(0,t.withModifiers)(G,[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(jy))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:`preview-stage-viewport`,onClick:(0,t.withModifiers)(W,[`self`])},[ne.value?.isVideo&&ne.value?.url?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:ne.value.url,controls:``,autoplay:``,playsinline:``,class:`preview-stage-img`},null,8,hot)):ne.value?.url?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:ne.value.url,alt:ne.value.title,class:`preview-stage-img`},null,8,got)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,_ot,[V.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,vot,(0,t.toDisplayString)(ee.value+1)+` / `+(0,t.toDisplayString)(V.value.length),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:`preview-quick-insert-btn`,onClick:oe},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(nb))]),_:1}),n[31]||=(0,t.createElementVNode)(`span`,null,`插入此素材到画布`,-1)])])])):(0,t.createCommentVNode)(``,!0)]),_:1})]))])}}});B8();var xot=z8(bot,[[`__scopeId`,`data-v-af2f6258`]]);L8(),RQ(),TZ();var Sot=[`viewBox`],Cot=[`id`,`cx`,`cy`,`r`,`fx`,`fy`],wot=[`offset`,`stop-color`,`stop-opacity`],Tot=[`id`,`x1`,`y1`,`x2`,`y2`],Eot=[`offset`,`stop-color`,`stop-opacity`],Dot=[`id`,`cx`,`cy`,`r`,`fx`,`fy`],Oot=[`offset`,`stop-color`,`stop-opacity`],kot=[`id`,`x1`,`y1`,`x2`,`y2`],Aot=[`offset`,`stop-color`,`stop-opacity`],jot=[`transform`],Mot=[`x`,`y`,`width`,`height`,`viewBox`],Not=[`href`],Pot=[`transform`],Fot=[`x`,`y`,`width`,`height`],Iot=[`x`,`y`],Lot=[`transform`],Rot=[`x`,`y`,`width`,`height`,`viewBox`],zot=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-linecap`],Bot=[`transform`],Vot=[`cx`,`cy`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`],Hot=[`transform`],Uot=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`],Wot=[`transform`],Got=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-dasharray`,`stroke-width`],Kot=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-weight`],qot=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-weight`],Jot=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Yot=[`x1`,`y1`,`x2`,`y2`,`stroke`],Xot=[`x1`,`y1`,`x2`,`y2`,`stroke`],Zot=[`transform`],Qot=[`transform`],$ot=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],est=[`x`,`y`,`width`,`height`],tst=(0,t.defineComponent)({__name:`LayoutThumbSvg`,props:{elements:{},background:{}},setup(e){let n=e,{logicalWidth:r,logicalHeight:i}=e6(),a=R8.flatMap(e=>e.children),o=(0,t.computed)(()=>{let e=r?.value||1280;return+((i?.value||720)/e*100).toFixed(2)});function s(e,t=`none`){if(!e)return t;if(typeof e==`string`)return e||t;if(typeof e==`object`){if(e.value!==void 0){if(typeof e.value==`string`)return e.value||t;if(typeof e.value==`object`&&e.value.colors&&Array.isArray(e.value.colors)&&e.value.colors.length>0)return e.value.colors[0].color||t}if(e.color)return e.color}return t}function c(e){if(!e)return``;let t=e.src||e.content||e.base64||e.picBase64||e.blob||e.url;if(!t&&e.value&&(typeof e.value==`string`?t=e.value:typeof e.value==`object`&&e.value!==null&&(t=e.value.src||e.value.base64||e.value.picBase64||e.value.blob||e.value.url)),!t&&e.fill&&typeof e.fill==`object`&&e.fill!==null){let n=e.fill.value||e.fill;typeof n==`string`?t=n:typeof n==`object`&&n&&(t=n.src||n.base64||n.picBase64||n.blob||n.url)}if(typeof t==`string`&&t.length>0){let e=t.trim();return e.startsWith(`data:`)||e.startsWith(`http:`)||e.startsWith(`https:`)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`blob:`)?e:e.length>50&&!e.includes(`<`)&&!e.includes(` `)?`data:image/png;base64,${e}`:/\.(png|jpe?g|gif|webp|svg|bmp|avif)([?#].*)?$/i.test(e)?e:``}return``}function l(e){if(!e||e.length===0)return[];let t=r!==void 0&&r.value?r.value:1280,n=i!==void 0&&i.value?i.value:720,o=+(n/t*100).toFixed(2),l=(e,t,n=0)=>{if(e==null||e===``||e===`auto`)return n;let r=String(e).trim();if(r.endsWith(`%`))return parseFloat(r)||n;let i=parseFloat(r);return isNaN(i)?n:i/t*100},u=[],d=(e,r=0,i=0,a=100,o=100)=>{(e||[]).forEach(e=>{if(e)if(e.type===`group`&&Array.isArray(e.elements)&&e.elements.length>0){let s=l(e.style?.left??e.left,t),c=l(e.style?.top??e.top,n),u=l(e.style?.width??e.width??100,t),f=l(e.style?.height??e.height??50,n);d(e.elements,r+s*a/100,i+c*o/100,a/100*u,o/100*f)}else u.push({el:e,parentLeftPct:r,parentTopPct:i,parentWidthPct:a,parentHeightPct:o})})};return d(e),u.map(({el:e,parentLeftPct:r,parentTopPct:i,parentWidthPct:u,parentHeightPct:d})=>{let f=!!(e.id===`ph-image`||e.placeholderType===`pic`||e.placeholder?.type===`image`||typeof e.name==`string`&&e.name.includes(`图片占位符`)),p=!!(e.type!==`shape`&&e.type!==`image`&&e.type!==`line`&&(e.isPlaceholder||e.placeholder||typeof e.name==`string`&&e.name.includes(`占位符`)||typeof e.id==`string`&&(e.id.startsWith(`ph_title`)||e.id.startsWith(`ph_body`)||e.id.startsWith(`ph_subtitle`)||e.id.startsWith(`ph_0_`)||e.id.startsWith(`ph_1_`)||e.id.startsWith(`ph-`)))),m=typeof e.content==`string`?e.content.replace(/<[^>]*>/g,``).replace(/ /gi,` `).trim():``,h=typeof e.text==`string`?e.text.trim():e.text?.content?String(e.text.content).replace(/<[^>]*>/g,``).trim():``,g=e.placeholder?.prompt||(e.placeholder?.type===`title`?`单击此处编辑母版标题样式`:e.placeholder?.type===`subtitle`?`单击此处编辑母版副标题样式`:e.placeholder?.type===`image`?`单击图标添加图片`:`单击此处添加文本描述`),_=m?e.content:h?typeof e.text==`string`?e.text:e.text.content:p?g:typeof e.content==`string`?e.content:``,v=!!((e.style?.writingMode||e.writingMode||``).includes(`vertical`)||e.vertical===!0||_.includes(`writing-mode: vertical`)||_.includes(`writing-mode:vertical`)),y=v?60/t*100:0,b=l(e.style?.left??e.left,t),x=l(e.style?.top??e.top,n),S=l(e.style?.width??e.width,t,y),C=l(e.style?.height??e.height??50,n),w=r+b*u/100,T=i+x*d/100,E=u/100*S,D=d/100*C,O=+w.toFixed(2),k=+(T/100*o).toFixed(2),A=+Math.max(.5,E).toFixed(2),j=+Math.max(.5,D/100*o).toFixed(2),M=e.type===`text`?!1:!!(e.flipH||e.isFlipH||e.style?.flipH),N=e.type===`text`?!1:!!(e.flipV||e.isFlipV||e.style?.flipV),P=e.type===`text`&&!e.style?.rotate&&!e.rotate?0:parseFloat(e.style?.rotate||e.rotate)||0,F=+(O+A/2).toFixed(2),I=+(k+j/2).toFixed(2),L=P!==0||M||N?`translate(${F}, ${I}) rotate(${P}) scale(${M?-1:1}, ${N?-1:1}) translate(${-F}, ${-I})`:void 0,R=parseFloat(e.style?.fontSize||e.fontSize||(p&&e.placeholder?.type===`title`?`28`:`16`))||16,z=100/t*R,B=+Math.max(1.8,Math.min(4.5,z*1.15)).toFixed(2),V=[];if(_){let e=_.replace(/<br\s*\/?>/gi,`
|
|
344
|
+
`);return t=t.replace(/<\/?[^>]+(>|$)/g,``),t.trim()},s=r*n,c=a*n,l=m.value||`微软雅黑`,u=h.value||`#333333`,d=[g.value||`#5b9bd5`,`#ed7d31`,`#a5a5a5`,`#ffc000`,`#4472c4`,`#70ad47`],f=[];for(let e of BZ())f.push(...e.children);let p=[],_=[];for(let r=0;r<e.slides.length;r++){let i=e.slides[r],a=A(i),s={id:Date.now().toString()+Math.random().toString(36).substr(2,5)+`_`+r,title:`幻灯片 ${r+1}`,subtitle:``,elements:[],background:a.background,bgType:a.bgType,notes:o(i.note)},c=new Map,m=e=>{let t=Date.now().toString()+Math.random().toString(36).substr(2,5);return e!=null&&c.set(e.toString(),t),t},h=(e,i)=>{let a=s.elements.length,o=[...e].sort((e,t)=>(typeof e.order==`number`?e.order:parseFloat(e.order)||0)-(typeof t.order==`number`?t.order:parseFloat(t.order)||0));for(let e of o){let a=e.width||1,o=e.height||1,p=e.left,g=e.top;if(e.width*=n,e.height*=n,e.left*=n,e.top*=n,e.type===`text`)if(e.autoFit&&e.autoFit.type===`text`){let i=n*(e.autoFit.fontScale||100)/100,a=e.fontSize||18,o=Je(e.content,i,a),c={type:`shape`,id:m(e.id),order:e.order===void 0?void 0:e.order,width:e.width,height:e.height,left:e.left,top:e.top,rotate:e.rotate,flipH:!!(e.isFlipH||e.flipH||e.style?.flipH),flipV:!!(e.isFlipV||e.flipV||e.style?.flipV),isFlipH:!!(e.isFlipH||e.flipH||e.style?.flipH),isFlipV:!!(e.isFlipV||e.flipV||e.style?.flipV),viewBox:[200,200],path:`M 0 0 L 200 0 L 200 200 L 0 200 Z`,fill:e.fill?.type===`color`?e.fill.value:``,fixedRatio:!1,outline:{color:e.borderColor,width:+(e.borderWidth*n).toFixed(2),style:e.borderType},text:{content:Ke(e.content,i,e.width,e.height),defaultFontName:l,defaultColor:u,align:tt[e.vAlign]||`top`,lineHeight:1.2},textType:VQ(e),wrap:e.wrap,autoFit:e.autoFit};c.style=c.style||{},c.style.whiteSpace=e.wrap===`none`||e.wrap===!1?`nowrap`:`normal`,c.style.flipH=c.flipH,c.style.flipV=c.flipV,S3(e)&&(c.vertical=!0,c.isVertical=!0,c.style.writingMode=`vertical-rl`);let d=(t?.slideSpLstStyleAlignMap?.[r]||{})[e.id],f=FQ(e.content);d&&(!f||f===`left`)&&(f=d,c.text.content=IQ(c.text.content,d)),f&&(c.style.textAlign=f);let p=it(e.content);if(p&&(c.style.textColor=p,c.style.color=p,c.textColor=p,c.color=p),$e(e.shadow)&&(c.shadow={h:e.shadow.h*n,v:e.shadow.v*n,blur:e.shadow.blur*n,size:e.shadow.size===void 0?100:e.shadow.size,color:e.shadow.color,type:e.shadow.type,preset:e.shadow.preset}),e.textShadow){let t=+(e.textShadow.h*n).toFixed(2),r=+(e.textShadow.v*n).toFixed(2),i=+(e.textShadow.blur*n).toFixed(2),a=e.textShadow.color||`rgba(0,0,0,0.5)`;c.textShadow={h:t,v:r,blur:i,size:e.textShadow.size===void 0?100:e.textShadow.size,color:a,type:e.textShadow.type,preset:e.textShadow.preset},c.style.textShadow=`${t}px ${r}px ${i}px ${a}`}else if(e.content){let t=e.content.match(/(?:text-shadow|shadow)\s*:\s*([^;\"]+)/i);t&&(c.style.textShadow=t[1].trim())}e.reflection&&(c.reflection={enabled:e.reflection.enabled,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity},c.style.reflection={...c.reflection}),e.textReflection&&(c.textReflection={enabled:e.textReflection.enabled,distance:e.textReflection.distance===void 0?20:e.textReflection.distance*n,blur:e.textReflection.blur===void 0?0:e.textReflection.blur*n,size:e.textReflection.size===void 0?8:e.textReflection.size,opacity:e.textReflection.opacity===void 0?10:e.textReflection.opacity},c.style.textReflection={...c.textReflection}),e.link&&(c.link={type:`web`,target:e.link}),e.textInset?(c.text.inset=[+(e.textInset.t*n).toFixed(2),+(e.textInset.r*n).toFixed(2),+(e.textInset.b*n).toFixed(2),+(e.textInset.l*n).toFixed(2)],c.style.padding=`${c.text.inset[0]}px ${c.text.inset[1]}px ${c.text.inset[2]}px ${c.text.inset[3]}px`):(c.text.inset=[0,0,0,0],c.style.padding=`0px`),o.lineHeight&&(c.text.lineHeight=o.lineHeight,c.style.lineHeight=o.lineHeight),o.margin&&(c.text.paragraphSpace=o.margin),s.elements.push(c)}else{let i=e.fontSize||18,a=Je(e.content,n,i),o={type:`text`,id:m(e.id),order:e.order===void 0?void 0:e.order,width:e.width,height:e.height,left:e.left,top:e.top,rotate:e.rotate,flipH:!!(e.isFlipH||e.flipH||e.style?.flipH),flipV:!!(e.isFlipV||e.flipV||e.style?.flipV),isFlipH:!!(e.isFlipH||e.flipH||e.style?.flipH),isFlipV:!!(e.isFlipV||e.flipV||e.style?.flipV),defaultFontName:l,defaultColor:u,content:Ke(e.content,n,e.width,e.height),lineHeight:1.2,outline:{color:e.borderColor,width:+(e.borderWidth*n).toFixed(2),style:e.borderType},fill:e.fill?.type===`color`?e.fill.value:``,textType:VQ(e),vertical:S3(e),isVertical:S3(e),vAlign:e.vAlign||`mid`,wrap:e.wrap,autoFit:e.autoFit||{type:`none`,fontScale:100,lnSpcReduction:0}};o.style=o.style||{},o.style.whiteSpace=e.wrap===`none`||e.wrap===!1?`nowrap`:`normal`,o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,o.style.flipH=o.flipH,o.style.flipV=o.flipV,S3(e)&&(o.style.writingMode=`vertical-rl`),o.style.verticalAlign=tt[e.vAlign]||e.vAlign||`middle`;let c=(t?.slideSpLstStyleAlignMap?.[r]||{})[e.id],d=FQ(e.content);c&&(!d||d===`left`)&&(d=c,o.content=IQ(o.content,c)),d&&(o.style.textAlign=d);let f=it(e.content);if(f&&(o.style.textColor=f,o.style.color=f,o.textColor=f,o.color=f),e.textShadow){let t=+(e.textShadow.h*n).toFixed(2),r=+(e.textShadow.v*n).toFixed(2),i=+(e.textShadow.blur*n).toFixed(2),a=e.textShadow.color||`rgba(0,0,0,0.5)`;o.textShadow={h:t,v:r,blur:i,size:e.textShadow.size===void 0?100:e.textShadow.size,color:a,type:e.textShadow.type,preset:e.textShadow.preset},o.style.textShadow=`${t}px ${r}px ${i}px ${a}`}else if($e(e.shadow))o.shadow={h:e.shadow.h*n,v:e.shadow.v*n,blur:e.shadow.blur*n,color:e.shadow.color,type:e.shadow.type,preset:e.shadow.preset},o.style.boxShadow=`${Math.round(e.shadow.h*n)}px ${Math.round(e.shadow.v*n)}px ${Math.round(e.shadow.blur*n)}px ${e.shadow.color}`;else if(e.content){let t=e.content.match(/(?:text-shadow|shadow)\s*:\s*([^;\"]+)/i);t&&(o.style.textShadow=t[1].trim())}e.reflection&&(o.reflection={enabled:e.reflection.enabled,type:e.reflection.type,preset:e.reflection.preset,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity},o.style.reflection={...o.reflection}),e.textReflection&&(o.textReflection={enabled:e.textReflection.enabled,type:e.textReflection.type,preset:e.textReflection.preset,distance:e.textReflection.distance===void 0?20:e.textReflection.distance*n,blur:e.textReflection.blur===void 0?0:e.textReflection.blur*n,size:e.textReflection.size===void 0?8:e.textReflection.size,opacity:e.textReflection.opacity===void 0?10:e.textReflection.opacity},o.style.textReflection={...o.textReflection}),e.link&&(o.link={type:`web`,target:e.link}),e.textInset?(o.inset=[+(e.textInset.t*n).toFixed(2),+(e.textInset.r*n).toFixed(2),+(e.textInset.b*n).toFixed(2),+(e.textInset.l*n).toFixed(2)],o.style.padding=`${o.inset[0]}px ${o.inset[1]}px ${o.inset[2]}px ${o.inset[3]}px`):(o.inset=[0,0,0,0],o.style.padding=`0px`),a.lineHeight&&(o.lineHeight=a.lineHeight,o.style.lineHeight=a.lineHeight),a.margin&&(o.paragraphSpace=a.margin),s.elements.push(o)}else if(e.type===`image`){let i=``;if(e.blob&&typeof e.blob==`string`)i=e.blob;else if(e.src&&typeof e.src==`string`)i=e.src;else{let t=e.base64||e.picBase64;i=t&&typeof t==`string`?t.startsWith(`data:`)?t:`data:image/png;base64,${t}`:e.content||``}let a=!!(e.isFlipH||e.flipH||e.style?.flipH),o=!!(e.isFlipV||e.flipV||e.style?.flipV),c={type:`image`,id:m(e.id),order:e.order===void 0?void 0:e.order,src:i,content:i,width:e.width,height:e.height,left:e.left,top:e.top,fixedRatio:!0,rotate:e.rotate,flipH:a,flipV:o,isFlipH:a,isFlipV:o};c.style=c.style||{},c.style.left=`${e.left}px`,c.style.top=`${e.top}px`,c.style.width=`${e.width}px`,c.style.height=`${e.height}px`,c.style.flipH=a,c.style.flipV=o,e.borderWidth&&(c.outline={color:e.borderColor,width:+(e.borderWidth*n).toFixed(2),style:e.borderType});let l=[`rect`,`roundRect`,`ellipse`,`triangle`,`rhombus`,`diamond`,`flowChartMerge`,`pentagon`,`hexagon`,`heptagon`,`octagon`,`parallelogram`,`trapezoid`,`heart`],u=e.geom||`rect`,d,f=t?.slidePicGeomMap?.[r]?.[String(e.id)];f&&(u===`rect`||!u)&&(f.geom&&(u=f.geom),f.polygonPoints&&(d=f.polygonPoints)),u===`diamond`&&(u=`rhombus`),u.indexOf(`custom:`)!==-1&&(u=u.replace(`custom:`,``)),u!==`custom`&&!l.includes(u)&&(u=`rect`),d?c.clip={type:`polygon`,points:d,range:e.rect?[[e.rect.l||0,e.rect.t||0],[100-(e.rect.r||0),100-(e.rect.b||0)]]:[[0,0],[100,100]]}:e.rect?c.clip={shape:u,range:[[e.rect.l||0,e.rect.t||0],[100-(e.rect.r||0),100-(e.rect.b||0)]]}:u&&u!==`rect`&&(c.clip={shape:u,range:[[0,0],[100,100]]}),$e(e.shadow)&&(c.shadow={h:e.shadow.h*n,v:e.shadow.v*n,blur:e.shadow.blur*n,color:e.shadow.color,type:e.shadow.type,preset:e.shadow.preset}),e.reflection&&(c.reflection={enabled:e.reflection.enabled,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity},c.style.reflection={...c.reflection}),e.filters&&(c.filters=e.filters),e.link&&(c.link={type:`web`,target:e.link}),s.elements.push(c)}else if(e.type===`math`)s.elements.push({type:`image`,id:m(e.id),order:e.order===void 0?void 0:e.order,name:e.name||`公式`,src:e.picBlob||e.picBase64||e.picRef,width:e.width,height:e.height,left:e.left,top:e.top,fixedRatio:!0,rotate:0});else if(e.type===`audio`&&(e.blob||e.src||e.value)){let t=e.blob||e.src||e.value,n=typeof t==`string`?t:t instanceof Blob?URL.createObjectURL(t):``;s.elements.push({type:`audio`,id:m(e.id),order:e.order===void 0?void 0:e.order,name:e.name||`音频`,src:n,width:e.width,height:e.height,left:e.left,top:e.top,rotate:0,fixedRatio:!1,color:d[0],loop:!1,autoplay:!1})}else if(e.type===`video`&&(e.blob||e.src||e.value)){let t=e.blob||e.src||e.value,n=typeof t==`string`?t:t instanceof Blob?URL.createObjectURL(t):``;s.elements.push({type:`video`,id:m(e.id),order:e.order===void 0?void 0:e.order,name:e.name||`视频`,src:n,width:e.width,height:e.height,left:e.left,top:e.top,rotate:0,autoplay:!1})}else if(e.type===`shape`)if(e.shapType===`line`||/straightConnector/.test(e.shapType)||/bentConnector/.test(e.shapType)||/curvedConnector/.test(e.shapType)){let t=et(e,n);e.id&&c.set(e.id.toString(),t.id),s.elements.push(t)}else{let t=f.find(t=>{let n=(t.pptxShapeType||``).toLowerCase(),r=(t.pathFormula||``).toLowerCase(),i=String(e.shapType||``).toLowerCase();return n===i||r===i||(i===`snip1rect`||i===`cutrectsingle`)&&(n===`snip1rect`||n===`cutrectsingle`||r===`cutrectsingle`)||(i===`snip2samerect`||i===`cutrectsameside`)&&(n===`snip2samerect`||n===`cutrectsameside`||r===`cutrectsameside`)||(i===`snip2diagrect`||i===`cutrectdiagonal`)&&(n===`snip2diagrect`||n===`cutrectdiagonal`||r===`cutrectdiagonal`)||(i===`sniproundrect`||i===`cutroundrect`)&&(n===`sniproundrect`||n===`cutroundrect`||r===`cutroundrect`)||(i===`round1rect`||i===`roundrectsingle`)&&(n===`round1rect`||n===`roundrectsingle`||r===`roundrectsingle`)||(i===`round2samerect`||i===`roundrectsameside`)&&(n===`round2samerect`||n===`roundrectsameside`||r===`roundrectsameside`)||(i===`round2diagrect`||i===`roundrectdiagonal`)&&(n===`round2diagrect`||n===`roundrectdiagonal`||r===`roundrectdiagonal`)}),r=e.fill?.type===`gradient`?e.fill.value||e.fill:e.gradient||void 0,i=r?yQ(r):void 0,c=e.border?.gradient||e.outline?.gradient,d=c?yQ(c):void 0,p=e.fill?.type===`image`?e.fill.value:null,h=p?p.blob||p.base64||p.src||p.url||(typeof p==`string`?p:void 0):void 0,g=typeof e.fill==`string`?e.fill.trim()===``?`none`:e.fill:e.fill?.type===`color`?e.fill.value:e.fill?.type===`gradient`?`transparent`:e.fill?dQ(e.fill,`none`):`none`,_=e.text?.fontSize||16,v=Je(e.content,n,_),y=!!(e.isFlipH||e.flipH||e.style?.flipH),b=!!(e.isFlipV||e.flipV||e.style?.flipV),x=e.borderLineCap||e.border?.lineCap||e.lineCap||e.outline?.lineCap,S=x===`rnd`||x===`round`?`round`:x===`sq`||x===`square`?`square`:x===`flat`?`flat`:void 0,C={color:e.borderColor,width:+(e.borderWidth*n).toFixed(2),style:e.borderType,gradient:d,lineCap:S},w={type:`shape`,id:m(e.id),order:e.order===void 0?void 0:e.order,width:e.width,height:e.height,left:e.left,top:e.top,viewBox:[200,200],path:`M 0 0 L 200 0 L 200 200 L 0 200 Z`,fill:g,gradient:i,pattern:h,border:e.border?{...e.border,gradient:d}:d?{gradient:d}:void 0,fixedRatio:!1,rotate:e.rotate,outline:C,lineCap:S,borderLineCap:S,text:{content:Ke(e.content,n,e.width,e.height),defaultFontName:l,defaultColor:u,align:tt[e.vAlign]||`top`},flipH:y,flipV:b,isFlipH:y,isFlipV:b,shapType:e.shapType,wrap:e.wrap,autoFit:e.autoFit};w.style=w.style||{},w.style.whiteSpace=e.wrap===`none`||e.wrap===!1?`nowrap`:`normal`,w.style.left=`${e.left}px`,w.style.top=`${e.top}px`,w.style.width=`${e.width}px`,w.style.height=`${e.height}px`,w.style.rotate=e.rotate===void 0?0:e.rotate,w.style.flipH=y,w.style.flipV=b,w.style.fill=g,h&&(w.style.pattern=h),w.style.borderColor=e.borderColor||e.outline?.color||`transparent`,w.style.borderWidth=e.borderWidth===void 0?e.outline?.width===void 0?`0px`:`${e.outline.width}px`:`${+(e.borderWidth*n).toFixed(2)}px`,w.style.borderStyle=e.borderType||e.outline?.style||`solid`,S&&(w.style.borderLineCap=S,w.style.strokeLinecap=S===`round`?`round`:S===`square`?`square`:`butt`);let T=FQ(e.content||e.text?.content);T&&(w.style.textAlign=T);let E=it(e.content||e.text?.content);if(E&&(w.style.textColor=E,w.style.color=E,w.textColor=E,w.color=E),e.link&&(w.link={type:`web`,target:e.link}),v.lineHeight&&(w.text.lineHeight=v.lineHeight,w.style.lineHeight=v.lineHeight),v.margin&&(w.text.paragraphSpace=v.margin),e.textInset?(w.text.inset=[+(e.textInset.t*n).toFixed(2),+(e.textInset.r*n).toFixed(2),+(e.textInset.b*n).toFixed(2),+(e.textInset.l*n).toFixed(2)],w.style.padding=`${w.text.inset[0]}px ${w.text.inset[1]}px ${w.text.inset[2]}px ${w.text.inset[3]}px`):(w.text.inset=[0,0,0,0],w.style.padding=`0px`),e.textShadow){let t=+(e.textShadow.h*n).toFixed(2),r=+(e.textShadow.v*n).toFixed(2),i=+(e.textShadow.blur*n).toFixed(2),a=e.textShadow.color||`rgba(0,0,0,0.5)`;w.textShadow={h:t,v:r,blur:i,size:e.textShadow.size===void 0?100:e.textShadow.size,color:a,type:e.textShadow.type,preset:e.textShadow.preset}}if($e(e.shadow)&&(w.shadow={h:e.shadow.h*n,v:e.shadow.v*n,blur:e.shadow.blur*n,color:e.shadow.color,type:e.shadow.type,preset:e.shadow.preset}),e.reflection&&(w.reflection={enabled:e.reflection.enabled,type:e.reflection.type,preset:e.reflection.preset,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity},w.style.reflection={...w.reflection}),e.textReflection&&(w.textReflection={enabled:e.textReflection.enabled,type:e.textReflection.type,preset:e.textReflection.preset,distance:e.textReflection.distance===void 0?20:e.textReflection.distance*n,blur:e.textReflection.blur===void 0?0:e.textReflection.blur*n,size:e.textReflection.size===void 0?8:e.textReflection.size,opacity:e.textReflection.opacity===void 0?10:e.textReflection.opacity},w.style.textReflection={...w.textReflection}),t){if(w.path=t.path,w.viewBox=t.viewBox,t.pathFormula){w.pathFormula=t.pathFormula,w.viewBox=[e.width,e.height];let n=zZ()[t.pathFormula];if(n&&`editable`in n&&n.editable){let t=n.defaultValue;if(e.keypoints){let r=0;e.shapType===`roundRect`&&(r=(e.keypoints.adj===void 0?.334:e.keypoints.adj)*.5),(e.shapType===`cutRectSingle`||e.shapType===`snip1Rect`)&&(r=(e.keypoints.adj===void 0?.334:e.keypoints.adj)*.5),e.shapType===`snip2SameRect`||e.shapType,e.shapType===`snip2DiagRect`||e.shapType,e.shapType===`snipRoundRect`||e.shapType,(e.shapType===`round1Rect`||e.shapType===`roundRectSingle`)&&(r=(e.keypoints.adj===void 0?.334:e.keypoints.adj)*.5),e.shapType===`round2SameRect`||e.shapType,e.shapType===`round2DiagRect`||e.shapType,e.shapType,e.shapType,e.shapType===`triangle`&&(r=(e.keypoints.adj===void 0?1:e.keypoints.adj)*.5),e.shapType===`trapezoid`&&(r=.5-(e.keypoints.adj===void 0?1:e.keypoints.adj)*.25),e.shapType===`moon`&&(r=e.keypoints.adj===void 0?.5:e.keypoints.adj),e.shapType===`sun`&&(r=e.keypoints.adj===void 0?.25:e.keypoints.adj/2),e.shapType===`hexagon`&&(r=e.keypoints.adj===void 0?.25:e.keypoints.adj>1?e.keypoints.adj/1e5:e.keypoints.adj);let i=!1;if(e.shapType===`halfFrame`){i=!0;let r=e.keypoints.adj1===void 0?.25:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.25:e.keypoints.adj2;n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`leftArrow`||e.shapType===`rightArrow`||e.shapType===`upArrow`||e.shapType===`downArrow`||e.shapType===`upDownArrow`||e.shapType===`leftRightArrow`){i=!0;let r=e.shapType===`upDownArrow`||e.shapType===`leftRightArrow`,a=e.keypoints.adj1,o=e.keypoints.adj2,s=r?a===void 0?.3:a:o===void 0?.5:o,c=r?o===void 0?.3:o/2:a===void 0?.25:a/2;n.range&&(s=Math.max(n.range[0][0],Math.min(n.range[0][1],s)),c=Math.max(n.range[1][0],Math.min(n.range[1][1],c))),t=[s,c]}if(e.shapType===`quadArrow`||e.shapType===`tArrow`||e.shapType===`leftRightUpArrow`){i=!0;let r=e.keypoints.adj1===void 0?.4:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.1:e.keypoints.adj2/2,o=e.keypoints.adj3===void 0?.2:e.keypoints.adj3/2,s=r,c=a,l=o;n.range&&(s=Math.max(n.range[0][0],Math.min(n.range[0][1],s)),c=Math.max(n.range[1][0],Math.min(n.range[1][1],c)),l=Math.max(n.range[2][0],Math.min(n.range[2][1],l))),t=[s,c,l]}if(e.shapType===`bentArrow`){i=!0;let r=e.keypoints.adj1===void 0?.4:e.keypoints.adj1/2,a=e.keypoints.adj2===void 0?.2:e.keypoints.adj2/2,o=e.keypoints.adj3===void 0?.25:e.keypoints.adj3/2,s=e.keypoints.adj4===void 0?.4:e.keypoints.adj4/2,c=r,l=a,u=o,d=s;n.range&&(c=Math.max(n.range[0][0],Math.min(n.range[0][1],c)),l=Math.max(n.range[1][0],Math.min(n.range[1][1],l)),u=Math.max(n.range[2][0],Math.min(n.range[2][1],u)),d=Math.max(n.range[3][0],Math.min(n.range[3][1],d))),t=[c,l,u,d]}if(e.shapType===`uturnArrow`){i=!0;let r=e.keypoints.adj1===void 0?.25:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.25:e.keypoints.adj2,o=e.keypoints.adj3===void 0?.25:e.keypoints.adj3,s=e.keypoints.adj4===void 0?.4375:e.keypoints.adj4,c=e.keypoints.adj5===void 0?1:e.keypoints.adj5,l=r,u=o,d=s,f=a*2;if(l+u>.95){let e=.85/(l+u);l*=e,u*=e}f>.95&&(f=.85),n.range&&(c=Math.max(n.range[0][0],Math.min(n.range[0][1],c)),l=Math.max(n.range[1][0],Math.min(n.range[1][1],l)),u=Math.max(n.range[2][0],Math.min(n.range[2][1],u)),d=Math.max(n.range[3][0],Math.min(n.range[3][1],d)),f=Math.max(n.range[4][0],Math.min(n.range[4][1],f))),t=[c,l,u,d,f]}if(e.shapType===`snip2SameRect`){i=!0;let r=e.keypoints.adj1===void 0?.334:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.334:e.keypoints.adj2;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`snip2DiagRect`){i=!0;let r=e.keypoints.adj1===void 0?0:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.334:e.keypoints.adj2;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`snipRoundRect`){i=!0;let r=e.keypoints.adj1===void 0?.334:e.keypoints.adj1,a=e.keypoints.adj2===void 0?.334:e.keypoints.adj2;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`round2SameRect`){i=!0;let r=e.keypoints.adj2===void 0?0:e.keypoints.adj2,a=e.keypoints.adj1===void 0?.25:e.keypoints.adj1;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}if(e.shapType===`round2DiagRect`){i=!0;let r=e.keypoints.adj1===void 0?.25:e.keypoints.adj1,a=e.keypoints.adj2===void 0?0:e.keypoints.adj2;r*=.5,a*=.5,n.range&&(r=Math.max(n.range[0][0],Math.min(n.range[0][1],r)),a=Math.max(n.range[1][0],Math.min(n.range[1][1],a))),t=[r,a]}e.shapType===`frame`&&(r=(e.keypoints.adj1===void 0?.25:e.keypoints.adj1)*.5),e.shapType===`corner`&&(r=((e.keypoints.adj1===void 0?1:e.keypoints.adj1)+(e.keypoints.adj2===void 0?1:e.keypoints.adj2))/2*.5),e.shapType===`diagStripe`&&(r=(e.keypoints.adj===void 0?1:e.keypoints.adj)*.5),e.shapType===`donut`&&(r=e.keypoints.adj===void 0?.25:e.keypoints.adj*.5),e.shapType===`noSmoking`&&(r=e.keypoints.adj===void 0?.1875:e.keypoints.adj*.5),e.shapType===`plus`&&(r=e.keypoints.adj===void 0?.3:e.keypoints.adj*.5),e.shapType===`concaveRect`&&(r=e.keypoints.adj===void 0?.15:e.keypoints.adj*.5),e.shapType===`can`&&(r=e.keypoints.adj===void 0?.2:e.keypoints.adj*.5),e.shapType===`cube`&&(r=e.keypoints.adj===void 0?.25:e.keypoints.adj*.5),e.shapType===`bevel`&&(r=e.keypoints.adj===void 0?.15:e.keypoints.adj*.5),(e.shapType===`chevron`||e.shapType===`homePlate`)&&(r=e.keypoints.adj===void 0?.5:e.keypoints.adj/2),i||(n.range&&r<n.range[0][0]&&(r=n.range[0][0]),n.range&&r>n.range[0][1]&&(r=n.range[0][1]),t=[r])}if(n.defaultValue){let e=t?[...t]:[],r=n.defaultValue;for(let t=e.length;t<r.length;t++)e.push(r[t]);t=e}w.path=n.formula(e.width,e.height,t),w.keypoints=t,w.viewBox=[e.width,e.height]}else n&&(w.path=n.formula(e.width,e.height),w.viewBox=[e.width,e.height])}}else if(e.path&&e.path.indexOf(`NaN`)===-1&&e.shapType!==`custom`)if(e.shapType===`arc`)w.path=e.path,w.viewBox=[a,o];else if(e.shapType===`blockArc`)w.fixedRatio=!0,w.path=e.path,w.viewBox=[a,o];else{let t=TLe(e.path);w.path=t.path;let n=t.width,r=t.height;n/r>a/o?w.viewBox=[n,n*o/a]:w.viewBox=[r*a/o,r]}if(e.shapType===`custom`){let t=e.path||``;t.indexOf(`NaN`)!==-1&&(w.width===0&&(w.width=.1),w.height===0&&(w.height=.1),t=t.replace(/NaN/g,`0`)),w.path=t,w.viewBox=[a,o]}w.path&&typeof w.path==`string`&&(w.path=w.path.trim(),w.content=w.path,e.shapType===`ellipse`&&(w.content=`circle`,w.shapType=`ellipse`)),w.path&&w.viewBox[0]&&w.viewBox[1]&&s.elements.push(w)}else if(e.type===`table`){let t=e.data.length,r=e.data[0].length,i={fontname:l,color:u},a=[];for(let o=0;o<t;o++){let t=[];for(let a=0;a<r;a++){let r=e.data[o][a],s=document.createElement(`div`);s.innerHTML=r.text;let c=s.querySelector(`p`)?.style.textAlign||`left`,l=s.querySelector(`span`),u=l?.style.fontSize?parseFloat(l?.style.fontSize):14,d=e.rowHeights?.[o]||30;u>=20&&d<=35&&(u=Math.min(14,Math.max(10,Math.floor(d*.45))));let f=(u*n).toFixed(1)+`px`,p=l?.style.fontFamily||``,m=l?.style.color||r.fontColor,h=r.text?r.text.replace(/font-size:\s*[\d.]+(?:pt|px)/gi,`font-size: ${f}`):s.innerText;t.push({id:Date.now().toString()+Math.random().toString(36).substr(2,5),colspan:r.colSpan||1,rowspan:r.rowSpan||1,text:h,fillColor:r.fillColor,fontColor:r.fontColor,fontBold:r.fontBold,borders:r.borders,style:{...i,align:[`left`,`right`,`center`].includes(c)?c:`left`,fontsize:f,fontname:p,color:m,bold:r.fontBold,backcolor:r.fillColor,borders:r.borders}}),s=null}a.push(t)}let o=e.colWidths.reduce((e,t)=>e+t,0),c=e.colWidths.map(e=>e/o),d=e.data[0]?.[0],f=d?.borders?.top||d?.borders?.bottom||e.borders?.top||e.borders?.bottom||d?.borders?.left||d?.borders?.right||e.borders?.left||e.borders?.right,p=f?.borderWidth||0,h=f?.borderType||`solid`,g=f?.borderColor||`#eeece1`,_=p>0?{width:+(p*n).toFixed(2),style:h,color:g}:{width:0,style:`solid`,color:`transparent`},v=e.rowHeights?e.rowHeights.map(e=>e*n):[],y=v.reduce((e,t)=>e+t,0),b=y>(e.height||0)?y:e.height;s.elements.push({type:`table`,id:m(e.id),order:e.order===void 0?void 0:e.order,width:e.width,height:b,left:e.left,top:e.top,colWidths:c,rowHeights:v,rotate:0,data:a,borders:e.borders,outline:_,cellMinHeight:v[0]||36,style:{left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${b}px`}})}else if(e.type===`chart`){let t,n,r;if(e.chartType===`scatterChart`||e.chartType===`bubbleChart`)t=e.data&&e.data[0]?e.data[0].map((e,t)=>typeof e==`string`&&e?e:`坐标${t+1}`):[],n=[`X`,`Y`],r=e.data||[];else{let i=e.data;t=Object.values(i[0].xlabels),n=i.map(e=>e.key),r=i.map(e=>e.values.map(e=>e.y))}let i={},a=`bar`;switch(e.chartType){case`barChart`:case`bar3DChart`:a=`bar`,e.barDir===`bar`&&(a=`horizontal-bar`),(e.grouping===`stacked`||e.grouping===`percentStacked`)&&(i.stack=!0);break;case`lineChart`:case`line3DChart`:(e.grouping===`stacked`||e.grouping===`percentStacked`)&&(i.stack=!0),a=`line`;break;case`areaChart`:case`area3DChart`:(e.grouping===`stacked`||e.grouping===`percentStacked`)&&(i.stack=!0),a=`area`;break;case`scatterChart`:case`bubbleChart`:a=`scatter`;break;case`pieChart`:case`pie3DChart`:a=`pie`;break;case`radarChart`:a=`radar`;break;case`doughnutChart`:case`donut`:case`ring`:a=`donut`;break;default:a=e.chartType||`bar`}let o=n.map((e,t)=>({label:e,data:r[t]||[]})),c=(e.colors||[]).filter(e=>e&&typeof e==`string`),l=c.length?c:d;s.elements.push({type:`chart`,id:m(e.id),order:e.order===void 0?void 0:e.order,chartType:a,width:e.width,height:e.height,left:e.left,top:e.top,rotate:0,holeSize:e.holeSize,showPercent:e.showPercent,showLegend:e.showLegend===void 0?!0:e.showLegend,themeColors:l,colors:l,textColor:u,style:{left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`,fill:`transparent`,chartColors:l,color:u},data:{labels:t,legends:n,series:r,datasets:o},options:i})}else if(e.type===`group`){let t=a||1,r=o||1,i=e=>{let t=e.shapType||e.pathFormula||e.shapeType||e.content;if(!t)return null;let n=String(t).toLowerCase();for(let r of BZ())for(let i of r.children){let r=(i.pptxShapeType||``).toLowerCase(),a=(i.pathFormula||``).toLowerCase();if(r===n||a===n||(n===`snip1rect`||n===`cutrectsingle`)&&(r===`snip1rect`||r===`cutrectsingle`||a===`cutrectsingle`)||(n===`snip2samerect`||n===`cutrectsameside`)&&(r===`snip2samerect`||r===`cutrectsameside`||a===`cutrectsameside`)||(n===`snip2diagrect`||n===`cutrectdiagonal`)&&(r===`snip2diagrect`||r===`cutrectdiagonal`||a===`cutrectdiagonal`)||(n===`sniproundrect`||n===`cutroundrect`)&&(r===`sniproundrect`||r===`cutroundrect`||a===`cutroundrect`)||(n===`round1rect`||n===`roundrectsingle`)&&(r===`round1rect`||r===`roundrectsingle`||a===`roundrectsingle`)||(n===`round2samerect`||n===`roundrectsameside`)&&(r===`round2samerect`||r===`roundrectsameside`||a===`roundrectsameside`)||(n===`round2diagrect`||n===`roundrectdiagonal`)&&(r===`round2diagrect`||r===`roundrectdiagonal`||a===`roundrectdiagonal`)){let r=e.width||200,a=e.height||200,o=i.pptxShapeType||t,s=i.pathFormula;if(i.pathFormula&&zZ()[i.pathFormula]){let t=zZ()[i.pathFormula],c=t.defaultValue?[...t.defaultValue]:[];return e.keypoints&&(n===`roundrect`||n===`snip1rect`||n===`cutrectsingle`||n===`round1rect`||n===`roundrectsingle`)&&(c=[(e.keypoints.adj===void 0?.334:e.keypoints.adj)*.5]),{path:t.formula(r,a,c),viewBox:[r,a],shapType:o,pathFormula:s,keypoints:c}}else if(i.path)return{path:i.path,viewBox:i.viewBox||[200,200],shapType:o,pathFormula:s}}}return null},c=(e,t)=>{if(!e)return null;let n=e.id===void 0?null:t.get(String(e.id));if(!n||!xZ(n))return null;let r=typeof n.width==`number`?n.width:0,i=typeof n.height==`number`?n.height:0,a=typeof n.left==`number`?n.left:0,o=typeof n.top==`number`?n.top:0,s=typeof e.idx==`number`?e.idx:-1;if(/ellipse|oval/i.test(String(n.shapType||``))){let e=r/2,t=i/2,n=a+e,c=o+t,l=Math.SQRT1_2;switch(s){case 0:return[n,o];case 1:return[n-e*l,c-t*l];case 2:return[a,c];case 3:return[n-e*l,c+t*l];case 4:return[n,o+i];case 5:return[n+e*l,c+t*l];case 6:return[a+r,c];case 7:return[n+e*l,c-t*l];default:return null}}switch(s){case 0:return[a+r/2,o];case 1:return[a,o+i/2];case 2:return[a+r/2,o+i];case 3:return[a+r,o+i/2];default:return null}},l=(e,t,n)=>{if(!e||typeof e!=`string`)return[t||200,n||200];let r=e.match(/[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g);if(!r||r.length<2)return[t||200,n||200];let i=r.map(Number),a=0,o=0;for(let e=0;e<i.length-1;e+=2){let t=i[e],n=i[e+1];!isNaN(t)&&isFinite(t)&&t>a&&(a=t),!isNaN(n)&&isFinite(n)&&n>o&&(o=n)}return a>0||o>0?[a>0?a:t||200,o>0?o:n||200]:[t||200,n||200]},f=(e,t,n,r)=>{if(!e||typeof e!=`string`)return null;let i=(t||0)*r,a=(n||0)*r,o=e.match(/[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g)?.map(Number)||[];if(o.length<4)return null;let s=1/0,c=-1/0,l=1/0,u=-1/0;for(let e=0;e<o.length-1;e+=2){let t=o[e],n=o[e+1];isNaN(t)||(s=Math.min(s,t),c=Math.max(c,t)),isNaN(n)||(l=Math.min(l,n),u=Math.max(u,n))}let d=c-s,f=u-l;if(a<=1&&f<=.001&&i>0)return{path:`M 0 0 L ${i.toFixed(4)} 0`,start:[0,0],end:[i,0]};if(i<=1&&d<=.001&&a>0)return{path:`M 0 0 L 0 ${a.toFixed(4)}`,start:[0,0],end:[0,a]};let p=i>0&&d>0&&(d<i*.3||d<10)?i/d:r,m=a>0&&f>0&&(f<a*.3||f<10)?a/f:r,h=0,g=e.replace(/([A-Za-z])|([-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?)/g,(e,t,n)=>{if(t)return t+` `;let r=parseFloat(n),i=h%2==0;return h++,i?(r*p).toFixed(4):(r*m).toFixed(4)}),_=lZ(g);return{path:g,start:_?_.start:[0,0],end:_?_.end:[i,a]}},p=(e,t,r,a=new Map)=>{let o=typeof e.width==`number`&&e.width>0?e.width:t,s=typeof e.height==`number`&&e.height>0?e.height:r,h=typeof e.left==`number`?e.left:0,g=typeof e.top==`number`?e.top:0,_=h/t*100,v=g/r*100,y=o/t*100,b=s/r*100,x=/^(?:rightArrow|leftArrow|upArrow|downArrow|leftRightArrow|upDownArrow|quadArrow|leftRightUpArrow|bentArrow|uturnArrow|leftUpArrow|bentUpArrow|curvedRightArrow|curvedLeftArrow|curvedUpArrow|curvedDownArrow|stripedRightArrow|notchedRightArrow|pentagon|chevron|circularArrow|swooshArrow|.*ArrowCallout)$/i.test(String(e.shapType||``)),S=!x&&(e.type===`line`||!!(e.startConnection||e.endConnection)||!!(e.borderTailEnd||e.borderHeadEnd)||/^(?:line|straightConnector\d*|bentConnector\d*|curvedConnector\d*)$/i.test(String(e.shapType||``))||/连接符/i.test(String(e.name||``))&&!x),C=S?!1:!!(e.isFlipH||e.flipH||e.style?.flipH),w=S?!1:!!(e.isFlipV||e.flipV||e.style?.flipV),T=S3(e),E=e.fontSize||e.style?.fontSize;if(!E&&(e.content||e.text)){let t=typeof e.content==`string`?e.content:typeof e.text==`string`?e.text:e.text?.content||``,r=[];for(let e of t.matchAll(/font-size\s*:\s*([\d.]+)\s*(pt|px)/gi)){let t=parseFloat(e[1]);r.push(e[2].toLowerCase()===`pt`?Math.round(t*n):Math.round(t))}r.length&&(E=Math.min(...r))}let D=null,O=typeof e.content==`string`?e.content:typeof e.text==`string`?e.text:e.text?.content||``;/<(p|div|li)[\s>]/i.test(O)&&(D=Je(O,n,E||16));let k=e.borderLineCap||e.border?.lineCap||e.lineCap,A=k===`rnd`||k===`round`?`round`:k===`sq`||k===`square`?`square`:k===`flat`?`flat`:void 0,j={...e.style||{},left:`${_.toFixed(4)}%`,top:`${v.toFixed(4)}%`,width:`${y.toFixed(4)}%`,height:`${b.toFixed(4)}%`,rotate:e.rotate===void 0?e.style?.rotate||0:e.rotate,flipH:C,flipV:w,fill:S?`none`:dQ(e.fill===void 0?e.style?.fill:e.fill,`none`),color:e.color||e.style?.color||u,borderColor:e.borderColor||e.style?.borderColor||`transparent`,borderWidth:e.borderWidth?`${(e.borderWidth*n).toFixed(1)}px`:e.style?.borderWidth||`0px`,borderStyle:e.borderType||e.style?.borderStyle||`solid`,borderLineCap:A,strokeLinecap:A===`round`?`round`:A===`square`?`square`:A?`butt`:void 0,fontSize:E?`${E}px`:void 0,whiteSpace:e.wrap===`none`||e.wrap===!1?`nowrap`:e.style?.whiteSpace||`normal`};D?.lineHeight&&(j.lineHeight=D.lineHeight),D?.margin&&(j.paragraphSpace=D.margin),e.reflection&&(j.reflection={enabled:e.reflection.enabled,type:e.reflection.type,preset:e.reflection.preset,distance:e.reflection.distance===void 0?20:e.reflection.distance*n,blur:e.reflection.blur===void 0?0:e.reflection.blur*n,size:e.reflection.size===void 0?8:e.reflection.size,opacity:e.reflection.opacity===void 0?10:e.reflection.opacity}),e.textReflection&&(j.textReflection={enabled:e.textReflection.enabled,type:e.textReflection.type,preset:e.textReflection.preset,distance:e.textReflection.distance===void 0?20:e.textReflection.distance*n,blur:e.textReflection.blur===void 0?0:e.textReflection.blur*n,size:e.textReflection.size===void 0?8:e.textReflection.size,opacity:e.textReflection.opacity===void 0?10:e.textReflection.opacity}),$e(e.shadow)&&(j.boxShadow=`${Math.round((e.shadow.h||0)*n)}px ${Math.round((e.shadow.v||0)*n)}px ${Math.round((e.shadow.blur||0)*n)}px ${e.shadow.color||`rgba(0,0,0,0.5)`}`),T&&(j.writingMode=`vertical-rl`);let M=(e.content||``).trim(),N=``,P=e.viewBox,F=null,I,L,R,z=e.type===`image`||e.type===`pic`||e.type===`picture`||!!(e.src||e.base64||e.picBase64)||e.fill&&typeof e.fill==`object`&&(e.fill.type===`image`||e.fill.type===`pic`||e.fill.type===`picture`);if(e.padding===void 0?e.style?.padding!==void 0&&(j.padding=String(e.style.padding)):Array.isArray(e.padding)?j.padding=e.padding.map(e=>`${(e*n).toFixed(1)}px`).join(` `):typeof e.padding==`number`?j.padding=`${(e.padding*n).toFixed(1)}px`:j.padding=String(e.padding),z||e.type===`audio`||e.type===`video`){let t=e.src||e.base64||e.picBase64||e.content||e.blob||e.value||``;if(!t&&e.fill&&typeof e.fill==`object`){let n=e.fill.value||e.fill;typeof n==`string`?t=n:typeof n==`object`&&n&&(t=n.base64||n.picBase64||n.src||n.blob||n.url||``)}let n=typeof t==`string`?t:t.base64||t.picBase64||t.src||t.blob||``;n=n.trim(),n.length>50&&!n.startsWith(`data:`)&&!n.startsWith(`http:`)&&!n.startsWith(`https:`)&&!n.startsWith(`blob:`)&&!n.startsWith(`/`)&&(n=`data:image/png;base64,${n}`),M=n}e.margin!==void 0&&!j.padding&&(Array.isArray(e.margin)?j.padding=e.margin.map(e=>`${(e*n).toFixed(1)}px`).join(` `):typeof e.margin==`number`?j.padding=`${(e.margin*n).toFixed(1)}px`:j.padding=String(e.margin));let B=e.textInset||e.inset;B&&!j.padding&&(Array.isArray(B)?j.padding=B.map(e=>`${(e*n).toFixed(1)}px`).join(` `):typeof B==`object`&&(j.padding=`${((B.t||0)*n).toFixed(1)}px ${((B.r||0)*n).toFixed(1)}px ${((B.b||0)*n).toFixed(1)}px ${((B.l||0)*n).toFixed(1)}px`));let V=o<=120&&s<=45,ee=typeof e.content==`string`&&/white-space:\s*nowrap/i.test(e.content);j.padding||(V?(j.padding=`0px 2px`,j.whiteSpace||=`nowrap`):e.type===`text`&&(j.padding=`0px`,ee&&!j.whiteSpace&&(j.whiteSpace=`nowrap`))),ee&&!j.whiteSpace&&(j.whiteSpace=`nowrap`);let te=e.verticalAlign||e.style?.verticalAlign||e.vAlign;te?j.verticalAlign=tt[te]||te:e.type===`text`&&(j.verticalAlign=`top`);let ne=null;if(z||e.type===`audio`||e.type===`video`)(!M||M.trim().length===0)&&(M=(e.content||e.src||e.base64||e.picBase64||e.value||``).trim());else if(e.type===`shape`){if(e.path&&(!N&&M&&!M.trim().startsWith(`M`)&&!M.trim().startsWith(`m`)&&(N=M),M=e.path.trim()),ne=i(e),ne)M=ne.path,P=ne.viewBox;else if(M&&(M.trim().startsWith(`M`)||M.trim().startsWith(`m`)))if(e.shapType===`arc`||e.shapType===`blockArc`)P=[e.width||o,e.height||s];else{let t=l(M,o,s);t&&(t[0]>0||t[1]>0)?P=[t[0]>0?t[0]:o||200,t[1]>0?t[1]:s||200]:P||=e.width&&e.height?[e.width,e.height]:t}if(S){let i=typeof e.path==`string`?e.path.trim():``,l=typeof e.width==`number`?e.width:o,u=typeof e.height==`number`?e.height:s,d=/bentConnector|curvedConnector/i.test(String(e.shapType||``))||(i?i.split(/[LlCcQqSsTt]/).length>2:!1),p=c(e.startConnection,a),m=c(e.endConnection,a),_=i?f(i,l,u,n):null;if(d)if(p&&m){let t=(p[0]-h)*n,r=(p[1]-g)*n,o=(m[0]-h)*n,s=(m[1]-g)*n,c=e.startConnection?.id===void 0?null:a.get(String(e.startConnection.id)),l=e.endConnection?.id===void 0?null:a.get(String(e.endConnection.id)),u=/ellipse|oval/i.test(String(c?.shapType||``)),d=/ellipse|oval/i.test(String(l?.shapType||``)),f=e.startConnection?.idx,_=e.endConnection?.idx,v=typeof f==`number`?u?f===2||f===6:f===1||f===3:null,y=typeof _==`number`?d?_===2||_===6:_===1||_===3:null;if(v===!0&&y===!1)F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${o.toFixed(4)} ${r.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`;else if(v===!1&&y===!0)F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${t.toFixed(4)} ${s.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`;else if(v===!0&&y===!0){let e=(t+o)/2;f===_&&(!u&&f===3||u&&f===6?e=Math.max(t,o)+20*n:(!u&&f===1||u&&f===2)&&(e=Math.min(t,o)-20*n)),F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${e.toFixed(4)} ${r.toFixed(4)} L ${e.toFixed(4)} ${s.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`}else if(v===!1&&y===!1){let e=(r+s)/2;f===_&&(!u&&f===2||u&&f===4?e=Math.max(r,s)+20*n:(!u&&f===0||u&&f===0)&&(e=Math.min(r,s)-20*n)),F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${t.toFixed(4)} ${e.toFixed(4)} L ${o.toFixed(4)} ${e.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`}else{let e=!1;if(v!==null)e=!v;else if(y!==null)e=y;else if(i){let t=i.match(/[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g)?.map(Number)||[];t.length>=4&&Math.abs(t[0]-t[2])<.001?e=!0:t.length>=4&&Math.abs(t[1]-t[3])<.001&&(e=!1)}let n=e?t:o,a=e?s:r;F=`M ${t.toFixed(4)} ${r.toFixed(4)} L ${n.toFixed(4)} ${a.toFixed(4)} L ${o.toFixed(4)} ${s.toFixed(4)}`}L=[t,r],R=[o,s]}else if(_)F=_.path,L=_.start,R=_.end;else{F=cZ(i,n);let e=lZ(F);L=e?e.start:[0,0],R=e?e.end:[o*n,s*n]}else if(p&&m){let e=(p[0]-h)*n,t=(p[1]-g)*n,r=(m[0]-h)*n,i=(m[1]-g)*n;F=`M ${e.toFixed(4)} ${t.toFixed(4)} L ${r.toFixed(4)} ${i.toFixed(4)}`,L=[e,t],R=[r,i]}else{let t=l<1?0:l,r=u<1?0:u,i=(t||(typeof e.width==`number`?e.width:o))*n,a=(r||(typeof e.height==`number`?e.height:s))*n,c=!!(e.isFlipH||e.flipH||e.style?.flipH),d=!!(e.isFlipV||e.flipV||e.style?.flipV),f=0,_=0,v=i,y=a;c&&(f=i,v=0),d&&(_=a,y=0),p?(f=(p[0]-h)*n,_=(p[1]-g)*n):m&&(v=(m[0]-h)*n,y=(m[1]-g)*n),F=`M ${f.toFixed(4)} ${_.toFixed(4)} L ${v.toFixed(4)} ${y.toFixed(4)}`,L=[f,_],R=[v,y]}M=F,P=[o,s];let v=Xe(e.borderHeadEnd)||`none`,y=Xe(e.borderTailEnd);!y&&(/直接箭头连接符|箭头连接符/i.test(String(e.name||``))||/arrow/i.test(String(e.shapType||``)))&&(y=`arrow`),I=[v||`none`,y||`none`],(u<1||l<1)&&(u<1?(P[1]=24,j.height=`${(24/r*100).toFixed(4)}%`):(P[0]=24,j.width=`${(24/t*100).toFixed(4)}%`)),j.color=j.borderColor&&j.borderColor!==`none`&&j.borderColor!==`transparent`?j.borderColor:e.color?dQ(e.color,j.color):j.color,j.strokeWidth=parseFloat(j.borderWidth)||1,j.fill=`none`}N?N=Ke(N,n,o,s):e.text&&(N=Ke(e.content||e.text.content||``,n,o,s))}else if(e.type===`text`)M=Ke(e.content||``,n,o,s);else if(e.type===`chart`){let t=[],r=[],i=[];if(e.chartType===`scatterChart`||e.chartType===`bubbleChart`)t=e.data&&e.data[0]?e.data[0].map((e,t)=>typeof e==`string`&&e?e:`坐标${t+1}`):[],r=[`X`,`Y`],i=e.data||[];else if(e.data&&e.data[0]&&e.data[0].xlabels){let n=e.data;t=Object.values(n[0].xlabels),r=n.map(e=>e.key),i=n.map(e=>(e.values||[]).map(e=>e.y))}else e.data&&e.data.labels&&(t=e.data.labels,r=e.data.legends||[],i=e.data.series||[]);let a=r.map((e,t)=>({label:e,data:i[t]||[]})),c=`bar`;switch(e.chartType){case`barChart`:case`bar3DChart`:c=e.barDir===`bar`?`horizontal-bar`:`bar`;break;case`lineChart`:case`line3DChart`:c=`line`;break;case`areaChart`:case`area3DChart`:c=`area`;break;case`scatterChart`:case`bubbleChart`:c=`scatter`;break;case`pieChart`:case`pie3DChart`:c=`pie`;break;case`radarChart`:c=`radar`;break;case`doughnutChart`:case`donut`:case`ring`:c=`donut`;break;default:c=e.chartType||`bar`}let l=(e.colors||[]).filter(e=>e&&typeof e==`string`),f=l.length?l:d;return j.chartColors=f,j.fill=`transparent`,{id:m(e.id),type:`chart`,chartType:c,name:e.name||`图表`,width:o*n,height:s*n,holeSize:e.holeSize,showPercent:e.showPercent,showLegend:e.showLegend===void 0?!1:e.showLegend,themeColors:f,colors:f,textColor:u,style:j,data:{labels:t,legends:r,series:i,datasets:a}}}let re=e.type===`group`&&Array.isArray(e.elements),H;if(z){let t=[`rect`,`roundRect`,`ellipse`,`triangle`,`rhombus`,`pentagon`,`hexagon`,`heptagon`,`octagon`,`parallelogram`,`trapezoid`],n=e.geom||`rect`;n.indexOf(`custom:`)!==-1&&(n=n.replace(`custom:`,``)),t.includes(n)||(n=`rect`),e.rect?H={shape:n,range:[[e.rect.l||0,e.rect.t||0],[100-(e.rect.r||0),100-(e.rect.b||0)]]}:e.geom&&(H={shape:n,range:[[0,0],[100,100]]})}return{id:m(e.id),order:e.order===void 0?void 0:e.order,type:S?`line`:z?`image`:e.type||`shape`,vertical:T,isVertical:T,width:o,height:s,left:h,top:g,start:S?L:void 0,end:S?R:void 0,lineStyle:S?/dash/i.test(String(e.borderType||``))?`dashed`:/dot/i.test(String(e.borderType||``))?`dotted`:`solid`:void 0,shapType:e.shapType||ne?.shapType,pathFormula:e.pathFormula||ne?.pathFormula,keypoints:ne?.keypoints&&Array.isArray(ne.keypoints)?ne.keypoints:Array.isArray(e.keypoints)?e.keypoints:void 0,name:e.name||(re?`组合`:void 0),content:M,src:M,clip:H,text:N,fill:j.fill,color:j.color,borderColor:j.borderColor,borderWidth:j.borderWidth,borderStyle:j.borderStyle,gradient:e.gradient,pattern:e.pattern,style:(()=>{if(!j.textAlign){let e=FQ(N||M);e&&(j.textAlign=e)}return j})(),flipH:C,flipV:w,isFlipH:C,isFlipV:w,wrap:e.wrap,viewBox:P||ne?.viewBox||(M&&(M.trim().startsWith(`M`)||M.trim().startsWith(`m`))?l(M,o,s):[200,200]),path:ne?typeof ne.path==`string`?ne.path.trim():M.trim():F||(e.path?e.path.trim():e.type===`shape`?M.trim():void 0),shadow:$e(e.shadow)?{...e.shadow}:void 0,borderHeadEnd:e.borderHeadEnd,borderTailEnd:e.borderTailEnd,lineCap:A,borderLineCap:A,points:I,elements:re?(()=>{let t=new Map(a);for(let n of e.elements||[])n&&n.id!==void 0&&t.set(String(n.id),n);return[...e.elements||[]].sort((e,t)=>(e.order||0)-(t.order||0)).map(e=>p(e,o,s,t))})():void 0}},h=e.width,g=e.height,_=h,v=g,y=e.left,b=e.top,x=new Map;for(let t of e.elements||[])t&&t.id!==void 0&&x.set(String(t.id),t);let S=[...e.elements||[]].sort((e,t)=>(e.order||0)-(t.order||0)),C=!!(e.isFlipH||e.flipH||e.style?.flipH),w=!!(e.isFlipV||e.flipV||e.style?.flipV),T={id:m(e.id),type:`group`,order:e.order===void 0?void 0:e.order,name:e.name||`组合`,left:y,top:b,width:_,height:v,rotate:e.rotate||0,style:{left:`${y}px`,top:`${b}px`,width:`${_}px`,height:`${v}px`,rotate:e.rotate||0,flipH:C,flipV:w},flipH:C,flipV:w,isFlipH:C,isFlipV:w,elements:S.map(e=>p(e,t,r,x))};(C||w)&&GQ(T,C,w),s.elements.push(T)}else e.type===`diagram`&&h(e.elements.map(e=>({...e,left:e.left+p,top:e.top+g})),i)}if(i)for(let e=a;e<s.elements.length;e++)s.elements[e].isMaster=!0},g=e=>{if(!e||e.length<=1)return e||[];let t=JSON.parse(JSON.stringify(e)),n=[];for(let e of t){let t=e.left||0,r=e.top||0,i=e.width||0,a=e.height||0;n.some(n=>{if(e.type===`group`||n.type===`group`)return!1;let o=n.left||0,s=n.top||0,c=n.width||0,l=n.height||0,u=Math.max(t,o),d=Math.max(r,s),f=Math.min(t+i,o+c),p=Math.min(r+a,s+l);if(f>u&&p>d){let m=(f-u)*(p-d),h=Math.min(i*a,c*l);if(h>0&&m/h>.4){if(e.type===`text`&&n.type===`text`){let t=(e.content||e.text||``).replace(/<[^>]+>/g,``).trim(),r=(n.content||n.text||``).replace(/<[^>]+>/g,``).trim();return t===r||!t||!r}if(e.type===n.type)return Math.abs(t-o)<5&&Math.abs(r-s)<5&&Math.abs(i-c)<5&&Math.abs(a-l)<5}}return!1})||n.push(e)}let r=n.filter(e=>e.type===`text`&&(e.top||0)>460);if(r.length>1){let e=Math.max(...r.map(e=>e.top||0)),t=Math.min(...r.map(e=>e.height||20));r.forEach(n=>{n.top=e,n.height=t,n.vAlign=`up`,n.style&&(n.style.top=`${e}px`,n.style.height=`${t}px`,n.style.verticalAlign=`top`)})}return n},v=s.elements.length;h(g(i.layoutElements||[]),!0);let y=s.elements.length,b=s.elements.slice(v,y);_.push(b),s.elements.splice(v,y-v),h(i.elements);let x=new Map;for(let e of s.elements)x.set(String(e.id),e);for(let e of s.elements)if(e.type===`line`){if(e.startConnection&&e.startConnection.id){let t=c.get(e.startConnection.id.toString()),n=t?x.get(String(t)):null;t&&n&&xZ(n)?e.startConnection.id=t:delete e.startConnection}if(e.endConnection&&e.endConnection.id){let t=c.get(e.endConnection.id.toString()),n=t?x.get(String(t)):null;t&&n&&xZ(n)?e.endConnection.id=t:delete e.endConnection}}i.animations&&Array.isArray(i.animations)&&i.animations.length>0&&(s.animations=i.animations.map(e=>{let t=c.get(e.elId?.toString())||e.elId,n=e.duration||1e3;return n<=60&&(n*=1e3),{id:e.id||Date.now().toString()+Math.random().toString(36).substr(2,5),elId:t,type:e.type||`in`,effect:e.effect||`fadeIn`,duration:Math.round(n),trigger:e.trigger||`click`}})),p.push(s)}let v=`master_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,4)}`,y=[],b=new Map,x=[],S=[],C=new Set,w=(e,n={},r=!1)=>{if(!e)return[];let i=e,a=e.match(/<p:grpSp\b[\s\S]*?<\/p:grpSp>/g)||[];for(let e of a){let t=e.match(/<p:grpSpPr>[\s\S]*?<a:xfrm>[\s\S]*?<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),n=e.match(/<p:grpSpPr>[\s\S]*?<a:xfrm>[\s\S]*?<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/),r=e.match(/<a:chOff\s+x="(-?\d+)"\s+y="(-?\d+)"/),a=e.match(/<a:chExt\s+cx="(\d+)"\s+cy="(\d+)"/);if(t&&n&&r&&a){let o=parseInt(t[1]),s=parseInt(t[2]),c=parseInt(n[1]),l=parseInt(n[2]),u=parseInt(r[1]),d=parseInt(r[2]),f=parseInt(a[1]),p=parseInt(a[2]);if(f>0&&p>0){let t=e,n=e.match(/<p:(?:sp|pic)\b[\s\S]*?<\/p:(?:sp|pic)>/g)||[];for(let e of n){let n=e.match(/<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),r=e.match(/<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/);if(n&&r){let i=parseInt(n[1]),a=parseInt(n[2]),m=parseInt(r[1]),h=parseInt(r[2]),g=Math.round(o+(i-u)*(c/f)),_=Math.round(s+(a-d)*(l/p)),v=Math.round(c/f*m),y=Math.round(l/p*h),b=e.replace(n[0],`<a:off x="${g}" y="${_}"`);b=b.replace(r[0],`<a:ext cx="${v}" cy="${y}"`),t=t.replace(e,b)}}i=i.replace(e,t)}}}let o=i.match(/<p:(?:sp|pic)\b[\s\S]*?<\/p:(?:sp|pic)>/g)||[],s=[],c=t?.themeColors||{},l=e=>{let t=e.match(/<a:gs\b[\s\S]*?<\/a:gs>/g)||[];if(t.length===0)return null;let n=[];for(let e of t){let t=e.match(/pos="(\d+)"/),r=t?Math.round(parseInt(t[1],10)/1e3):0,i=`#FFFFFF`,a=e.match(/<a:srgbClr\s+val="([0-9A-Fa-f]{6})"/);if(a)i=`#`+a[1].toUpperCase();else{let t=e.match(/<a:schemeClr\s+val="([^"]+)"([\s\S]*?)<\/a:schemeClr>/)||e.match(/<a:schemeClr\s+val="([^"]+)"\s*\/>/);if(t){let e=t[1],n=t[2]||``,r=n.match(/<a:lumMod val="(\d+)"/),a=n.match(/<a:lumOff val="(\d+)"/),o=r?parseInt(r[1],10)/1e5:1,s=a?parseInt(a[1],10)/1e5:0,l=e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e,u=c[l]||c[e]||(l===`dk1`||l===`tx1`?`#000000`:`#FFFFFF`);i=o!==1||s!==0?nt(u,o,s):u}}n.push({pos:`${r}%`,color:i})}let r=e.match(/<a:path\b[^>]*path="([^"]+)"/i),i=r?r[1].toLowerCase():``,a=i===`shape`,o=i===`circle`||i===`radial`,s=i===`rect`;if(o||s||/<a:fillToRect/i.test(e)){let t=e.match(/<a:fillToRect\b([^>]*)\/?>/),r={l:.5,t:.5,r:.5,b:.5},i={x:.5,y:.5};if(t){let e=t[1],n=e.match(/l="(-?\d+)"/),a=e.match(/t="(-?\d+)"/),o=e.match(/r="(-?\d+)"/),s=e.match(/b="(-?\d+)"/),c=n?parseInt(n[1],10)/1e5:.5,l=a?parseInt(a[1],10)/1e5:.5,u=o?parseInt(o[1],10)/1e5:.5,d=s?parseInt(s[1],10)/1e5:.5;r={l:c,t:l,r:u,b:d},i={x:Math.round((c+(1-u))/2*1e3)/1e3,y:Math.round((l+(1-d))/2*1e3)/1e3}}let a=vQ(i);return yQ({type:s?`rect`:`radial`,path:s?`rect`:`circle`,rot:0,direction:a.key,directionName:a.name,fillToRect:r,center:i,colors:n})}if(a)return yQ({type:`path`,path:`shape`,rot:0,direction:`shape`,directionName:`沿路径`,colors:n});let l=e.match(/<a:lin\b[^>]*ang="(-?\d+)"/),u=l?Math.round(parseInt(l[1],10)/6e4):0,d=_Q(u);return yQ({type:`linear`,path:`line`,rot:u,direction:d.key,directionName:d.name,colors:n})},u=e=>{let t=e.match(/<a:gradFill\b[\s\S]*?<\/a:gradFill>/);if(t){let e=l(t[0]);if(e)return e}let n=e.match(/<a:solidFill[^>]*>([\s\S]*?)<\/a:solidFill>/);if(n){let e=n[1],t=e.match(/<a:lumMod val="(\d+)"/),r=e.match(/<a:lumOff val="(\d+)"/),i=t?parseInt(t[1],10)/1e5:1,a=r?parseInt(r[1],10)/1e5:0,o=e.match(/<a:srgbClr val="([0-9A-Fa-f]{6})"/);if(o){let e=`#`+o[1].toUpperCase();return i!==1||a!==0?nt(e,i,a):e}let s=e.match(/<a:sysClr[^>]*lastClr="([0-9A-Fa-f]{6})"/);if(s){let e=`#`+s[1].toUpperCase();return i!==1||a!==0?nt(e,i,a):e}let l=(e.match(/<a:schemeClr val="(\w+)"/)||[])[1];if(l){let e=c[l===`tx1`?`dk1`:l===`bg1`?`lt1`:l===`tx2`?`dk2`:l===`bg2`?`lt2`:l]||c[l]||``;if(e)return i!==1||a!==0?nt(e,i,a):e}}let r=e.match(/<a:fillRef[^>]*>\s*<a:schemeClr val="(\w+)"/);if(r){let e=r[1];return c[e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e]||c[e]||``}return``};for(let e=0;e<o.length;e++){let i=o[e];if(i.startsWith(`<p:pic`)){let t=(i.match(/r:embed="([^"]+)"/)||[])[1],a=t?n[t]:``;if(!a)continue;let o=i.match(/<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),c=i.match(/<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/);if(!o||!c)continue;let l=Math.round(parseInt(o[1])/9525),u=Math.round(parseInt(o[2])/9525),d=Math.round(parseInt(c[1])/9525),f=Math.round(parseInt(c[2])/9525);if(d<=0||f<=0)continue;let p=(i.match(/<p:cNvPr[^>]*name="([^"]+)"/)||[])[1]||``,m={id:`${r?`masterpic`:`layoutpic`}_${e}_`+Date.now().toString(36)+Math.random().toString(36).substr(2,4),type:`image`,name:p||(r?`母版图片 ${e+1}`:`版式图片 ${e+1}`),left:l,top:u,width:d,height:f,src:a,content:a,base64:a,isMaster:!0,style:{left:`${l}px`,top:`${u}px`,width:`${d}px`,height:`${f}px`}};/flipH="1"/.test(i)&&(m.isFlipH=!0),/flipV="1"/.test(i)&&(m.isFlipV=!0);let h=(i.match(/<a:srcRect\b([^>]*)\/?>/)||[])[1]||``,g=parseFloat((h.match(/l="(\d+)"/)||[])[1]||`0`)/1e3,_=parseFloat((h.match(/t="(\d+)"/)||[])[1]||`0`)/1e3,v=parseFloat((h.match(/r="(\d+)"/)||[])[1]||`0`)/1e3,y=parseFloat((h.match(/b="(\d+)"/)||[])[1]||`0`)/1e3;(g||_||v||y)&&(m.clip={shape:`rect`,range:[[g,_],[100-v,100-y]]}),s.push(m);continue}let a=i.match(/<p:ph\b([^>]*)\/?>/),c=!!a,d=c?(a?.[1].match(/type="([^"]+)"/)||[])[1]||`body`:``;if(c&&(d===`sldNum`||d===`ftr`||d===`dt`))continue;let f=d===`pic`||d===`picture`||d===`clipArt`||d===`media`,p=d===`title`||d===`ctrTitle`,m=d===`subTitle`,h=i.match(/<a:prstGeom\s+prst="([^"]+)"/),g=h?h[1]:`rect`,_=i.match(/<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),v=i.match(/<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/),y=_?parseInt(_[1]):0,b=_?parseInt(_[2]):0,x=v?parseInt(v[1]):0,S=v?parseInt(v[2]):0,C=Math.round(y/9525),w=Math.round(b/9525),T=Math.round(x/9525),E=Math.round(S/9525);if((T<=0||E<=0)&&c){let e=t?.masterPhXfrm||{},n=a?.[1]||``,r=(n.match(/idx="(\d+)"/)||[])[1],i=(n.match(/type="(\w+)"/)||[])[1],o=i===`ctrTitle`?`title`:i,s=(r===void 0?null:e[`idx_`+r])||(o?e[`type_`+o]:null)||(p?e.type_title:null)||(i?null:e.type_body);s&&s.width>0&&s.height>0&&(C=s.left,w=s.top,T=s.width,E=s.height)}if(T<=0||E<=0)continue;let D=(i.match(/<p:cNvPr[^>]*name="([^"]+)"/)||[])[1]||``,O=i.match(/<a:t>([^<]+)<\/a:t>/),k=O?O[1]:``,A=`${r?`master`:c?`ph`:`layout`}_${e}_`+Date.now().toString(36)+Math.random().toString(36).substr(2,4);if(c){let t=k||(f?`单击图标添加图片`:p?`单击此处编辑母版标题样式`:m?`单击此处编辑母版副标题样式`:r?`单击此处编辑母版文本样式`:`单击此处添加文本描述`),n=f?void 0:p?`title`:m?`subheadline`:d===`body`?`normalText`:`smallText`;s.push({id:A,type:f?`shape`:`text`,textType:n,name:D||(f?`图片占位符 ${e+1}`:p?r?`母版标题占位符`:`标题占位符`:m?r?`母版副标题占位符`:`副标题占位符`:r?`母版文本占位符`:`占位符 ${e+1}`),left:C,top:w,width:T,height:E,content:f?``:`<p style="font-size: ${p?`28px`:m?`20px`:`16px`}; color: #94a3b8; line-height: 1.4;">${t}</p>`,fill:`transparent`,style:{left:`${C}px`,top:`${w}px`,width:`${T}px`,height:`${E}px`,borderStyle:`dashed`,borderColor:`#cbd5e1`,borderWidth:`1.5px`,borderRadius:g===`ellipse`?`50%`:`6px`,fill:`transparent`,color:`#94a3b8`,fontSize:p?`28px`:m?`20px`:`16px`,textAlign:`left`},isMaster:!0,isPlaceholder:!0,placeholder:{type:f?`image`:p?`title`:m?`subtitle`:`body`,prompt:t}})}else{let t=(i.match(/<p:spPr[^>]*>[\s\S]*?<\/p:spPr>/)||[``])[0],n=u(t),a=n&&typeof n==`object`,o=a?`transparent`:n||`transparent`,c=a?n:void 0,d,f=`0px`,p=`transparent`,m=t.match(/<a:ln\b[^>]*>([\s\S]*?)<\/a:ln>/)||t.match(/<a:ln\b([^>]*)\/>/);if(m){let e=m[0],t=e.match(/\bw="(\d+)"/),n=t?Math.max(1,Math.round(parseInt(t[1],10)/9525)):1;f=`${n}px`;let r=e.match(/<a:gradFill\b[\s\S]*?<\/a:gradFill>/),i=r?l(r[0]):void 0,a=u(e);p=typeof a==`string`&&a?a:i?.colors?.[0]?.color||`#333333`,d={color:p,width:n,style:`solid`,gradient:i}}s.push({id:A,type:k?`text`:`shape`,name:D||(k?r?`母版文本 ${e+1}`:`版式文本 ${e+1}`:r?`母版装饰 ${e+1}`:`版式装饰 ${e+1}`),left:C,top:w,width:T,height:E,content:k?`<div>${k}</div>`:``,fill:o,gradient:c,outline:d,border:d?{...d}:void 0,style:{left:`${C}px`,top:`${w}px`,width:`${T}px`,height:`${E}px`,borderRadius:g===`ellipse`?`50%`:g===`roundRect`?`8px`:`0px`,fill:o,color:`#333333`,textAlign:`center`,borderColor:d?.gradient?`transparent`:p,borderWidth:d?f:void 0,borderStyle:d?`solid`:void 0,borderGradient:d?.gradient},isMaster:!0})}}return s},T=e=>{let n=(e.content||e.text||``).replace(/<[^>]+>/g,``).trim(),r=e.type===`text`&&n?`text_${n}`:null,i=`${e.type}_${e.name||``}_${Math.round(e.left||0)}_${Math.round(e.top||0)}_${Math.round(e.width||0)}_${Math.round(e.height||0)}`;return r&&C.has(r)||C.has(i)?!0:!t?.masterShapesInfo||t.masterShapesInfo.length===0?!1:t.masterShapesInfo.some(t=>!!(t.text&&n&&(n.includes(t.text)||t.text.includes(n))||t.isPic&&e.type===`image`&&t.name&&e.name===t.name||!t.text&&!t.isPic&&t.name&&e.name===t.name))};if(t?.primaryMasterXml){let e=w(t.primaryMasterXml,t.masterPicSrcMap||{},!0),n=e.filter(e=>!e.placeholder&&!e.isPlaceholder),r=e.filter(e=>e.placeholder||e.isPlaceholder);for(let e of n){e.isMaster=!0;let t=(e.content||e.text||``).replace(/<[^>]+>/g,``).trim(),n=e.type===`text`&&t?`text_${t}`:`${e.type}_${e.name||``}_${Math.round(e.left||0)}_${Math.round(e.top||0)}_${Math.round(e.width||0)}_${Math.round(e.height||0)}`;C.has(n)||(C.add(n),x.push(e))}S.push(...r)}else if(t?.masterShapesInfo&&t.masterShapesInfo.length>0)for(let e=0;e<p.length;e++){let t=_[e]||[];for(let e of t)if(T(e)){let t=(e.content||e.text||``).replace(/<[^>]+>/g,``).trim(),n=e.type===`text`&&t?`text_${t}`:`${e.type}_${e.name||``}_${Math.round(e.left||0)}_${Math.round(e.top||0)}_${Math.round(e.width||0)}_${Math.round(e.height||0)}`;if(!C.has(n)){C.add(n);let t=JSON.parse(JSON.stringify(e));if(t.id=`m_el_`+Date.now().toString(36)+Math.random().toString(36).substr(2,5),t.isMaster=!0,t.type===`image`){let e=t.src||t.content||t.base64||t.picBase64||``;t.src=e,t.content=e,t.base64=e,t.rect&&(t.clip={shape:`rect`,range:[[t.rect.l||0,t.rect.t||0],[100-(t.rect.r||0),100-(t.rect.b||0)]]})}if(!t.style||typeof t.style!=`object`||Array.isArray(t.style)){let e=typeof t.style==`string`?t.style:void 0;t.style={},e&&t.type===`line`&&(t.lineStyle=t.lineStyle||e)}t.left===void 0?t.style?.left&&(t.left=parseFloat(t.style.left)):t.style.left=`${t.left}px`,t.top===void 0?t.style?.top&&(t.top=parseFloat(t.style.top)):t.style.top=`${t.top}px`,t.width===void 0?t.style?.width&&(t.width=parseFloat(t.style.width)):t.style.width=`${t.width}px`,t.height===void 0?t.style?.height&&(t.height=parseFloat(t.style.height)):t.style.height=`${t.height}px`,t.style.flipH=!!(t.flipH||t.isFlipH),t.style.flipV=!!(t.flipV||t.isFlipV),x.push(t)}}}else{let e=new Map;for(let t=0;t<p.length;t++){let n=_[t]||[];for(let t of n){if(t.left===void 0&&t.top===void 0&&!t.content&&!t.text)continue;let n=(t.content||t.text||``).replace(/<[^>]+>/g,``).trim(),r=t.type===`text`&&n?`text_${n}`:`${t.type}_${t.name||``}_${Math.round(t.left||0)}_${Math.round(t.top||0)}_${Math.round(t.width||0)}_${Math.round(t.height||0)}`;e.has(r)?e.get(r).count++:e.set(r,{count:1,el:t})}}let t=p.length>1?Math.max(2,Math.floor(p.length*.3)):1;for(let[n,r]of e.entries())if(r.count>=t){C.add(n);let e=JSON.parse(JSON.stringify(r.el));if(e.id=`m_el_`+Date.now().toString(36)+Math.random().toString(36).substr(2,5),e.isMaster=!0,e.type===`image`){let t=e.src||e.content||e.base64||e.picBase64||``;e.src=t,e.content=t,e.base64=t,e.rect&&(e.clip={shape:`rect`,range:[[e.rect.l||0,e.rect.t||0],[100-(e.rect.r||0),100-(e.rect.b||0)]]})}if(!e.style||typeof e.style!=`object`||Array.isArray(e.style)){let t=typeof e.style==`string`?e.style:void 0;e.style={},t&&e.type===`line`&&(e.lineStyle=e.lineStyle||t)}e.left===void 0?e.style?.left&&(e.left=parseFloat(e.style.left)):e.style.left=`${e.left}px`,e.top===void 0?e.style?.top&&(e.top=parseFloat(e.style.top)):e.style.top=`${e.top}px`,e.width===void 0?e.style?.width&&(e.width=parseFloat(e.style.width)):e.style.width=`${e.width}px`,e.height===void 0?e.style?.height&&(e.height=parseFloat(e.style.height)):e.style.height=`${e.height}px`,e.style.flipH=!!(e.flipH||e.isFlipH),e.style.flipV=!!(e.flipV||e.isFlipV),x.push(e)}}let E=_.map(e=>e.filter(e=>!T(e)));if(t&&Array.isArray(t.allLayouts)&&t.allLayouts.length>0){for(let e of t.allLayouts){let n=w(e.xml||``,e.picSrcMap||{},!1),r=t.slideLayoutMap?t.slideLayoutMap.findIndex(t=>t&&t.file===e.file):-1,i=[];if(r>=0){let e=_[r]||[];for(let t of e)if(!T(t)){let e=JSON.parse(JSON.stringify(t));if(e.id=`l_el_`+Date.now().toString(36)+Math.random().toString(36).substr(2,5),e.isMaster=!0,e.type===`image`){let t=e.src||e.content||e.base64||e.picBase64||``;e.src=t,e.content=t,e.base64=t}if(!e.style||typeof e.style!=`object`||Array.isArray(e.style)){let t=typeof e.style==`string`?e.style:void 0;e.style={},t&&e.type===`line`&&(e.lineStyle=e.lineStyle||t)}e.left===void 0?e.style?.left&&(e.left=parseFloat(e.style.left)):e.style.left=`${e.left}px`,e.top===void 0?e.style?.top&&(e.top=parseFloat(e.style.top)):e.style.top=`${e.top}px`,e.width===void 0?e.style?.width&&(e.width=parseFloat(e.style.width)):e.style.width=`${e.width}px`,e.height===void 0?e.style?.height&&(e.height=parseFloat(e.style.height)):e.style.height=`${e.height}px`,e.style.flipH=!!(e.flipH||e.isFlipH),e.style.flipV=!!(e.flipV||e.isFlipV),i.push(e)}}let a=n.filter(e=>e.placeholder),o=[...i.length>0?i:n.filter(e=>!e.placeholder)];for(let e of a)e&&(o.some(t=>t&&(t.id===e.id||Math.abs((t.left||0)-(e.left||0))<5&&Math.abs((t.top||0)-(e.top||0))<5))||o.push(e));b.set(e.id,{id:e.id,name:e.name,type:e.type,background:e.background,elements:o,placeholders:a})}for(let e=0;e<p.length;e++){let n=p[e],r=t.slideLayoutMap?.[e],i=r?r.id:`layout-${e+1}`;n.masterId=v,n.layoutId=i,n.showMasterElements=!0,r?.background&&(!n.background||n.background===`#ffffff`||n.background===`#fff`||n.background===`white`)&&(n.background=r.background,typeof r.background==`string`&&r.background.includes(`url(`)&&(n.bgType=`image`))}y.push(...Array.from(b.values()))}else{for(let e=0;e<p.length;e++){let t=p[e],n=E[e]||[],r=n.length>0?n.map(e=>`${e.type}_${Math.round(e.left||0)}_${Math.round(e.top||0)}_${Math.round(e.width||0)}_${Math.round(e.height||0)}_${(e.content||``).substring(0,30)}`).join(`|`):`empty`;if(!b.has(r)){let t=b.size+1,i=`layout-${t}`,a=`内容版式 ${t}`,o=`content`;e===0&&n.length>0?(i=`layout-title`,a=`标题版式`,o=`title`):n.length===0&&(i=`layout-blank`,a=`空白版式`,o=`blank`);let s=n.map(e=>({...JSON.parse(JSON.stringify(e)),id:`ph_`+Date.now().toString(36)+Math.random().toString(36).substr(2,5),isMaster:!0}));b.set(r,{id:i,name:a,type:o,elements:s,placeholders:[]})}let i=b.get(r);t.masterId=v,t.layoutId=i.id,t.showMasterElements=!0}y.push(...Array.from(b.values())),y.some(e=>e.type===`blank`||e.id===`layout-blank`)||y.push({id:`layout-blank`,name:`空白版式`,type:`blank`,elements:[],placeholders:[]})}let D=t?.masterXmlBg||`#ffffff`,O=`color`;if(D===`#ffffff`){let e=p[0]?.background;e&&(typeof e==`string`?D=e:(e.color||e.type===`solid`&&e.color)&&(D=e.color))}let k=A(D);if(D=k.background,O=k.bgType||`color`,D&&D!==`#ffffff`)for(let e of y)(!e.background||e.background===`#ffffff`)&&(e.background=D,e.bgType=O);let j={id:v,name:t?.masterName||i.value||`默认母版`,background:D,bgType:O,themeColors:d,fontFamily:l,elements:x,placeholders:S,layouts:y,schemeFillMap:t?.schemeFillMap||null,fullThemeColors:t?.themeColors||null,isImported:!0};return{slides:p,width:s,height:c,title:i.value,masters:[j],themeColors:Array.isArray(e?.themeColors)&&e.themeColors.length>0?e.themeColors:t?.themeColors||null,schemeFillMap:t?.schemeFillMap||null,zipMeta:t||null}};w(at);let ot=async(e,t)=>{await VZ();let n=t?t.substring(0,t.lastIndexOf(`.`))||t:i.value||`演示文稿`;z.value=`正在导入 PPTX,请稍候...`,R.value=!0;try{let[{parse:t},{default:r}]=await Promise.all([Promise.resolve().then(()=>(n1e(),IRe)),Promise.resolve().then(()=>f(sZ(),1))]),a=await t(e,{imageMode:`blob`,videoMode:`blob`,audioMode:`blob`});console.log(a);let s=null,c=null;try{let t=await r.loadAsync(e);c=t;let i=Object.keys(t.files).filter(e=>e.startsWith(`ppt/slideLayouts/slideLayout`)&&!e.includes(`_rels`)&&!t.files[e].dir),a=(e,t)=>{let n=/(\d+)\.xml/.exec(e),r=/(\d+)\.xml/.exec(t);return(n?+n[1]:0)-(r?+r[1]:0)},o={};try{let e=Object.keys(t.files).filter(e=>/^ppt\/theme\/theme\d+\.xml$/.test(e));if(e.length>0){let n=(await t.file(e[0])?.async(`text`)||``).match(/<a:clrScheme[\s\S]*?<\/a:clrScheme>/);if(n){let e=/<a:(dk1|lt1|dk2|lt2|accent1|accent2|accent3|accent4|accent5|accent6|hlink|folHlink)>([\s\S]*?)<\/a:\1>/g,t;for(;t=e.exec(n[0]);){let e=t[2].match(/<a:srgbClr val="([0-9A-Fa-f]{6})"/)||t[2].match(/<a:sysClr[^>]*lastClr="([0-9A-Fa-f]{6})"/);e&&(o[t[1]]=`#`+e[1].toUpperCase())}}}}catch{}let l=async(e,n)=>{if(!e)return null;let r=e.match(/<a:blip\b[^>]*r:embed="([^"]+)"/);if(r){let e=r[1],i=n.replace(/(slideMasters|slideLayouts)\/([^/]+)\.xml$/,`$1/_rels/$2.xml.rels`),a=await t.file(i)?.async(`text`)||``,o=a.match(RegExp(`Id="${e}"[^>]*Target="([^"]+)"`))||a.match(RegExp(`Target="([^"]+)"[^>]*Id="${e}"`));if(o){let e=n.split(`/`).slice(0,-1);for(let t of o[1].split(`/`))t===`..`?e.pop():t&&t!==`.`&&e.push(t);let r=e.join(`/`);((r.match(/\.(\w+)$/)||[])[1]||``).toLowerCase();let i=await t.file(r)?.async(`blob`);if(i)return`#ffffff url("${URL.createObjectURL(i)}") center center / 100% 100% no-repeat`}}let i=e.match(/<a:gradFill\b[\s\S]*?<\/a:gradFill>/);if(i){let e=i[0],t=e.match(/<a:gs\b[\s\S]*?<\/a:gs>/g)||[];if(t.length>0){let n=[];for(let e of t){let t=e.match(/pos="(\d+)"/),r=t?Math.round(parseInt(t[1],10)/1e3):0,i=`#FFFFFF`,a=e.match(/<a:srgbClr\s+val="([0-9A-Fa-f]{6})"/);if(a)i=`#`+a[1].toUpperCase();else{let t=e.match(/<a:schemeClr\s+val="([^"]+)"([\s\S]*?)<\/a:schemeClr>/)||e.match(/<a:schemeClr\s+val="([^"]+)"\s*\/>/);if(t){let e=t[1],n=t[2]||``,r=n.match(/<a:lumMod val="(\d+)"/),a=n.match(/<a:lumOff val="(\d+)"/),s=r?parseInt(r[1],10)/1e5:1,c=a?parseInt(a[1],10)/1e5:0,l=e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e,u=o[l]||o[e]||(l===`dk1`||l===`tx1`?`#000000`:`#FFFFFF`);i=s!==1||c!==0?nt(u,s,c):u}}n.push(`${i} ${r}%`)}let r=e.match(/<a:path\b[^>]*path="([^"]+)"/i),i=r?r[1].toLowerCase():``,a=i===`shape`,s=i===`circle`||i===`radial`,c=i===`rect`;if(s||c||/<a:fillToRect/i.test(e)){let t=e.match(/<a:fillToRect\b([^>]*)\/?>/),r=50,i=50;if(t){let e=t[1],n=e.match(/l="(-?\d+)"/),a=e.match(/t="(-?\d+)"/),o=e.match(/r="(-?\d+)"/),s=e.match(/b="(-?\d+)"/),c=n?parseInt(n[1],10)/1e5:.5,l=a?parseInt(a[1],10)/1e5:.5,u=o?parseInt(o[1],10)/1e5:.5,d=s?parseInt(s[1],10)/1e5:.5;r=Math.round((c+(1-u))/2*100),i=Math.round((l+(1-d))/2*100)}return c?`radial-gradient(closest-side at ${r}% ${i}%, ${n.join(`, `)})`:`radial-gradient(circle farthest-corner at ${r}% ${i}%, ${n.join(`, `)})`}if(a)return`radial-gradient(ellipse farthest-corner at 50% 50%, ${n.join(`, `)})`;let l=e.match(/<a:lin\b[^>]*ang="(-?\d+)"/),u=l?parseInt(l[1],10)/6e4:0;return`linear-gradient(${(Math.round(u)+90)%360}deg, ${n.join(`, `)})`}}let a=e.match(/<a:srgbClr\s+val="([0-9A-Fa-f]{6})"/);if(a)return`#`+a[1].toUpperCase();let s=e.match(/<a:schemeClr\s+val="([^"]+)"([\s\S]*?)<\/a:schemeClr>/)||e.match(/<a:schemeClr\s+val="([^"]+)"\s*\/>/);if(s){let e=s[1],t=s[2]||``,n=t.match(/<a:lumMod val="(\d+)"/),r=t.match(/<a:lumOff val="(\d+)"/),i=n?parseInt(n[1],10)/1e5:1,a=r?parseInt(r[1],10)/1e5:0,c=e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e,l=o[c]||o[e]||(c===`dk1`||c===`tx1`?`#000000`:`#FFFFFF`);return i!==1||a!==0?nt(l,i,a):l}return null};i.sort(a);let u=[],d=new Map;for(let e=0;e<i.length;e++){let n=i[e],r=await t.file(n)?.async(`text`)||``,a={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,svg:`image/svg+xml`,tif:`image/tiff`,tiff:`image/tiff`},o=null,s=r.match(/<p:bg\b[\s\S]*?<\/p:bg>/);s&&(o=await l(s[0],n));let c={},f=r.match(/<p:pic\b[\s\S]*?<\/p:pic>/g)||[];if(f.length>0){let e=await t.file(n.replace(/(slideLayouts\/)(slideLayout\d+\.xml)$/,`$1_rels/$2.rels`))?.async(`text`)||``;for(let r of f){let i=(r.match(/r:embed="([^"]+)"/)||[])[1];if(!i||c[i])continue;let o=e.match(RegExp(`Id="${i}"[^>]*Target="([^"]+)"`))||e.match(RegExp(`Target="([^"]+)"[^>]*Id="${i}"`));if(!o)continue;let s=n.split(`/`).slice(0,-1);for(let e of o[1].split(`/`))e===`..`?s.pop():e&&e!==`.`&&s.push(e);let l=s.join(`/`),u=((l.match(/\.(\w+)$/)||[])[1]||``).toLowerCase(),d=await t.file(l)?.async(`base64`);d&&(c[i]=`data:${a[u]||`application/octet-stream`};base64,${d}`)}}let p=r.match(/<p:cSld[^>]*name="([^"]+)"/),m=r.match(/<p:sldLayout[^>]*type="([^"]+)"/),h=m&&m[1]===`title`||r.includes(`type="ctrTitle"`)||p&&(p[1].includes(`Title`)||p[1].includes(`标题`)),g=m&&m[1]===`blank`||p&&(p[1].includes(`Blank`)||p[1].includes(`空白`)),_=(r.match(/type="pic"/g)||[]).length,v={file:n,id:`layout-${e+1}`,name:p?p[1]:`版式 ${e+1}`,type:m?m[1]:h?`title`:g?`blank`:`content`,background:o||void 0,picPhCount:_,picSrcMap:c,xml:r};u.push(v),d.set(n,v);let y=n.replace(`ppt/slideLayouts/`,``);d.set(y,v),d.set(`../slideLayouts/${y}`,v)}let f=Object.keys(t.files).filter(e=>e.startsWith(`ppt/slides/_rels/slide`)&&e.endsWith(`.rels`));f.sort(a);let p=[],m=[];for(let e=0;e<f.length;e++){let n=f[e],r=await t.file(n)?.async(`text`)||``,i=r.match(/Type="[^"]*\/slideLayout"[^>]*Target="([^"]+)"/)||r.match(/Target="([^"]+)"[^>]*Type="[^"]*\/slideLayout"/),a=i?i[1]:``;m.push(a);let o=d.get(a);p.push(o||null)}let h=n,g=[],_={},v=``,y=null,b={};try{let e=Object.keys(t.files).filter(e=>e.startsWith(`ppt/slideMasters/slideMaster`)&&!e.includes(`_rels`)&&!t.files[e].dir);e.sort(a);for(let n of e){let e=await t.file(n)?.async(`text`)||``;if(v||=e,!y){let t=e.match(/<p:bg\b[\s\S]*?<\/p:bg>/);t&&(y=await l(t[0],n))}let r=e.match(/<p:pic\b[\s\S]*?<\/p:pic>/g)||[];if(r.length>0){let e=await t.file(n.replace(/(slideMasters\/)(slideMaster\d+\.xml)$/,`$1_rels/$2.rels`))?.async(`text`)||``,i={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,bmp:`image/bmp`,svg:`image/svg+xml`,tif:`image/tiff`,tiff:`image/tiff`};for(let a of r){let r=(a.match(/r:embed="([^"]+)"/)||[])[1];if(!r||b[r])continue;let o=e.match(RegExp(`Id="${r}"[^>]*Target="([^"]+)"`))||e.match(RegExp(`Target="([^"]+)"[^>]*Id="${r}"`));if(!o)continue;let s=n.split(`/`).slice(0,-1);for(let e of o[1].split(`/`))e===`..`?s.pop():e&&e!==`.`&&s.push(e);let c=s.join(`/`),l=((c.match(/\.(\w+)$/)||[])[1]||``).toLowerCase(),u=await t.file(c)?.async(`base64`);u&&(b[r]=`data:${i[l]||`application/octet-stream`};base64,${u}`)}}let i=e.match(/<p:sp\b[\s\S]*?<\/p:sp>/g)||[];for(let e of i){let t=e.match(/<p:cNvPr[^>]*name="([^"]+)"/)?.[1]||e.match(/name="([^"]+)"/)?.[1]||``,n=(e.match(/<a:t>([^<]+)<\/a:t>/g)||[]).map(e=>e.replace(/<\/?a:t>/g,``)).join(``).trim();g.push({name:t,text:n});let r=e.match(/<p:ph\b([^>]*)\/?>/);if(r){let t=r[1],n=(t.match(/idx="(\d+)"/)||[])[1],i=(t.match(/type="(\w+)"/)||[])[1],a=e.match(/<a:off\s+x="(-?\d+)"\s+y="(-?\d+)"/),o=e.match(/<a:ext\s+cx="(\d+)"\s+cy="(\d+)"/);if(a&&o){let e={left:Math.round(parseInt(a[1])/9525),top:Math.round(parseInt(a[2])/9525),width:Math.round(parseInt(o[1])/9525),height:Math.round(parseInt(o[2])/9525)};n!==void 0&&!_[`idx_`+n]&&(_[`idx_`+n]=e),i&&!_[`type_`+i]&&(_[`type_`+i]=e)}}}let a=e.match(/<p:pic\b[\s\S]*?<\/p:pic>/g)||[];for(let e of a){let t=e.match(/<p:cNvPr[^>]*name="([^"]+)"/)?.[1]||e.match(/name="([^"]+)"/)?.[1]||``;g.push({name:t,isPic:!0})}}if(e.length>0){let n=(await t.file(e[0])?.async(`text`)||``).match(/<p:cSld[^>]*name="([^"]+)"/);n&&n[1]&&(h=n[1])}if(!h||h===n){let e=Object.keys(t.files).filter(e=>e.startsWith(`ppt/theme/theme`)&&!e.includes(`_rels`)&&!t.files[e].dir);if(e.length>0){let n=(await t.file(e[0])?.async(`text`)||``).match(/<a:theme[^>]*name="([^"]+)"/);n&&n[1]&&n[1]!==`Office 主题`&&n[1]!==`Office Theme`&&(h=n[1])}}}catch{}let x=``;try{if(v){let e=v.match(/<p:titleStyle>[\s\S]*?<a:schemeClr val="([^"]+)">([\s\S]*?)<\/a:schemeClr>/),t=v.match(/<p:bodyStyle>[\s\S]*?<a:schemeClr val="([^"]+)">([\s\S]*?)<\/a:schemeClr>/)||e;if(t){let e=t[1],n=t[2].match(/<a:lumMod val="(\d+)"/),r=t[2].match(/<a:lumOff val="(\d+)"/),i=n?parseInt(n[1],10)/1e5:1,a=r?parseInt(r[1],10)/1e5:0,s=e===`tx1`?`dk1`:e===`bg1`?`lt1`:e===`tx2`?`dk2`:e===`bg2`?`lt2`:e,c=o[s]||o[e]||(s===`dk1`||s===`tx1`?`#000000`:`#FFFFFF`);x=i!==1||a!==0?nt(c,i,a):c}}}catch{}let S={};try{for(let[e,n]of Object.entries(t.files))if(e.endsWith(`.xml`)&&!e.includes(`_rels`)&&(e.startsWith(`ppt/slides/`)||e.startsWith(`ppt/slideMasters/`)||e.startsWith(`ppt/slideLayouts/`)||e.startsWith(`ppt/theme/`))){let e=(await n.async(`text`)).match(/<a:schemeClr\b[^>]*\/>|<a:schemeClr\b[^>]*>(?:(?!<\/a:schemeClr>)[\s\S])*<\/a:schemeClr>/g)||[];for(let t of e){let e=t.replace(/\s+/g,` `).trim(),n=e.match(/val="([^"]+)"/);if(!n)continue;let r=n[1];if(r===`phClr`)continue;let i=e.match(/<a:lumMod val="(\d+)"/),a=e.match(/<a:lumOff val="(\d+)"/),s=i?parseInt(i[1],10)/1e5:1,c=a?parseInt(a[1],10)/1e5:0,l=o[r===`tx1`?`dk1`:r===`bg1`?`lt1`:r===`tx2`?`dk2`:r===`bg2`?`lt2`:r]||o[r]||``;if(l){let t=(s!==1||c!==0?nt(l,s,c):l).replace(`#`,``).toUpperCase();S[t]=e;let n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16),a=e=>e.toString(16).padStart(2,`0`).toUpperCase();for(let t=-1;t<=1;t++)for(let o=-1;o<=1;o++){if(t===0&&o===0)continue;let s=`${a(n)}${a(Math.min(255,Math.max(0,r+t)))}${a(Math.min(255,Math.max(0,i+o)))}`;S[s]||(S[s]=e)}}}}}catch{}let C=[],w=[];try{let e=new Map;for(let t of u){let n=new Map,r=(t.xml||``).match(/<p:(?:sp|pic)\b[\s\S]*?<\/p:(?:sp|pic)>/g)||[];for(let e of r){let t=e.match(/<p:ph\b[^>]*\/?>/);if(!t)continue;let r=t[0],i=r.match(/idx="(\d+)"/),a=r.match(/type="(\w+)"/),o=e.match(/<a:prstGeom\b[^>]*prst="([^"]+)"/),s=e.match(/<a:custGeom\b[\s\S]*?<\/a:custGeom>/),c=o?o[1]:void 0,l;if(s){let e=rt(s[0]);e&&(l=e,c=`custom`)}let u={geom:c,polygonPoints:l,type:a?a[1]:void 0};i&&n.set(`idx_`+i[1],u),a&&n.set(`type_`+a[1],u)}e.set(t.file,n);let i=t.file.replace(`ppt/slideLayouts/`,``);e.set(i,n),e.set(`../slideLayouts/${i}`,n)}let n=Object.keys(t.files).filter(e=>e.startsWith(`ppt/slides/slide`)&&!e.includes(`_rels`)&&!t.files[e].dir);n.sort(a);for(let r=0;r<n.length;r++){let i=await t.file(n[r])?.async(`text`)||``,a=p[r],o=a?e.get(a.file)||e.get(a.id):null,s={},c={},l=i.match(/<p:sp\b[\s\S]*?<\/p:sp>/g)||[];for(let e of l){let t=e.match(/<p:cNvPr\b[^>]*id="(\d+)"/);if(!t)continue;let n=t[1],r=/<a:pPr\b[^>]*\balgn="/.test(e),i=e.match(/<a:lstStyle\b[\s\S]*?<\/a:lstStyle>/);if(!r&&i){let e=i[0].match(/algn="(ctr|center|r|right|l|left|just|dist)"/);if(e){let t=e[1];c[n]=t===`ctr`||t===`center`?`center`:t===`r`||t===`right`?`right`:t===`dist`?`distribute`:t===`just`?`justify`:`left`}}}w.push(c);let u=i.match(/<p:pic\b[\s\S]*?<\/p:pic>/g)||[];for(let e of u){let t=e.match(/<p:cNvPr\b[^>]*id="(\d+)"/);if(!t)continue;let n=t[1],r=e.match(/<p:ph\b[^>]*\/?>/);if(r&&o){let e=r[0],t=e.match(/idx="(\d+)"/),i=e.match(/type="(\w+)"/),a;t&&o.has(`idx_`+t[1])?a=o.get(`idx_`+t[1]):i&&o.has(`type_`+i[1])&&(a=o.get(`type_`+i[1])),a&&(s[n]=a)}}C.push(s)}}catch(e){console.warn(`提取占位符几何失败:`,e)}let T={};for(let e of Object.keys(t.files))e.startsWith(`ppt/slideMasters/`)&&(e.endsWith(`.xml`)||e.endsWith(`.rels`))&&!t.files[e].dir&&(T[e]=await t.file(e)?.async(`text`)||``);let E={};for(let e of Object.keys(t.files))e.startsWith(`ppt/slideLayouts/`)&&(e.endsWith(`.xml`)||e.endsWith(`.rels`))&&!t.files[e].dir&&(E[e]=await t.file(e)?.async(`text`)||``);let D={},O=[...Object.keys(T),...Object.keys(E)].filter(e=>e.includes(`_rels/`));for(let e of O){let n=(T[e]||E[e]||``).match(/Target="([^"]+)"/g)||[];for(let r of n){let n=r.replace(/^Target="/,``).replace(/"$/,``);if(n.includes(`media/`)||n.includes(`../media/`)){let r=e.replace(`/_rels/`,`/`).replace(/\.rels$/,``).split(`/`).slice(0,-1);for(let e of n.split(`/`))e===`..`?r.pop():e&&e!==`.`&&r.push(e);let i=r.join(`/`);if(!D[i]&&t.files[i]){let e=await t.file(i)?.async(`base64`);e&&(D[i]=e)}}}}let k={};for(let e of Object.keys(t.files))e.startsWith(`ppt/tags/`)&&e.endsWith(`.xml`)&&!t.files[e].dir&&(k[e]=await t.file(e)?.async(`text`)||``);s={allLayouts:u,slideLayoutMap:p,masterName:h||n,masterShapesInfo:g,themeColors:o,schemeFillMap:S,masterPhXfrm:_,primaryMasterXml:v,masterPicSrcMap:b,masterXmlBg:y,slidePicGeomMap:C,slideSpLstStyleAlignMap:w,masterTextColor:x,masterFilesMap:T,layoutFilesMap:E,masterMediaMap:D,tagFilesMap:k,slideLayoutTargetList:m}}catch(e){console.warn(`Failed to extract zipMeta:`,e)}let l=at(a,s),u=[];try{u=await TIe(c||e,l?.slides||[])}catch(e){console.warn(`提取 PPTX 动画失败:`,e)}for(let e=0;e<(l?.slides?.length||0);e++)(!l.slides[e].animations||!l.slides[e].animations.length)&&u&&u[e]&&u[e].length&&(l.slides[e].animations=u[e]);return l.slides.length>0?(typeof P==`function`&&P()&&(z.value=`正在上传媒体资源并导入...`,await N(l)),i.value=n,o(l),!0):(d(`导入失败:文件中未发现有效幻灯片页`),!1)}catch(e){return console.error(e),d(`导入 PPTX 失败: `+e.message),!1}finally{R.value=!1}},st=async e=>{let t=e.target,n=t.files;if(!n||n.length===0)return;let r=n[0],i=new FileReader;i.onload=async e=>{try{let t=e.target?.result;await ot(t,r.name)}finally{t.value=``}},i.readAsArrayBuffer(r)},ct=e,lt=(0,t.computed)(()=>{let e=ct.slotProps||{},t={showMenu:ct.showMenu,presentationTitle:i.value,isEditingTitle:V.value,startEditingTitle:te,stopEditingTitle:ne,zoomRatio:O.value,setZoomRatio:e=>{O.value=e},resetZoom:k,isMasterEditingView:T.value,enterMasterView:E,exitMasterView:D,startPresentation:c,startFromBeginning:le,triggerPPTXImport:U,triggerJSONImport:W};for(let n of Object.keys(e))n===`deck`||n in t||(t[n]=e[n]);return`deck`in e&&Object.defineProperty(t,`deck`,{get:()=>e.deck,enumerable:!0,configurable:!0}),t});function ut(e){let t=e.currentTarget;t&&t.scrollWidth>t.clientWidth&&Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(t.scrollLeft+=e.deltaY)}return n({generatePptxBlob:Ie,generateImagesZipBlob:pe,downloadAsPptx:Le,downloadAllSlidesAsZip:me,downloadCurrentSlide:fe,triggerPPTXImport:U,triggerJSONImport:W,importPptxArrayBuffer:ot}),(n,a)=>{let o=vH,s=yH,c=_H,l=YK;return(0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.withDirectives)((0,t.createElementVNode)(`header`,Eet,[(0,t.createElementVNode)(`div`,Det,[(0,t.renderSlot)(n.$slots,`left-prefix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0),(0,t.renderSlot)(n.$slots,`left`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),()=>[e.showMenu?((0,t.openBlock)(),(0,t.createBlock)(l,{key:0,ref_key:`menuPopoverRef`,ref:re,placement:`bottom-start`,width:320,trigger:`click`,"popper-style":`padding: 0; border-radius: 12px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); border: 1px solid #e2e8f0; background: #fff; overflow: hidden;`},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,Oet,[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,ket,[...a[11]||=[(0,t.createElementVNode)(`path`,{d:`M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z`},null,-1)]]))])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Aet,[(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,jet,[a[26]||=(0,t.createElementVNode)(`div`,{class:`menu-section-title`},`导入文件`,-1),(0,t.createElementVNode)(`div`,Met,[(0,t.createElementVNode)(`div`,{class:`import-card`,onClick:a[1]||=e=>H(U)},[...a[13]||=[(0,t.createElementVNode)(`div`,{class:`import-icon-box pptx-icon`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,t.createElementVNode)(`path`,{d:`M4 4C4 2.89543 4.89543 2 6 2H14L20 8V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V4Z`,fill:`#ea4335`}),(0,t.createElementVNode)(`path`,{d:`M14 2V8H20L14 2Z`,fill:`#c5221f`}),(0,t.createElementVNode)(`text`,{x:`7`,y:`17`,fill:`#fff`,"font-size":`9`,"font-weight":`900`,"font-family":`Arial`},`P`)])],-1),(0,t.createElementVNode)(`div`,{class:`import-label`},`PPTX`,-1),(0,t.createElementVNode)(`div`,{class:`import-subtext`},`(仅供测试)`,-1)]]),(0,t.createElementVNode)(`div`,{class:`import-card`,onClick:a[2]||=e=>H(W)},[...a[14]||=[(0,t.createElementVNode)(`div`,{class:`import-icon-box json-icon`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,t.createElementVNode)(`path`,{d:`M4 4C4 2.89543 4.89543 2 6 2H14L20 8V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V4Z`,fill:`#f2994a`}),(0,t.createElementVNode)(`path`,{d:`M14 2V8H20L14 2Z`,fill:`#e07c24`}),(0,t.createElementVNode)(`text`,{x:`7`,y:`17`,fill:`#fff`,"font-size":`9`,"font-weight":`900`,"font-family":`Arial`},`J`)])],-1),(0,t.createElementVNode)(`div`,{class:`import-label`},`JSON`,-1),(0,t.createElementVNode)(`div`,{class:`import-subtext`},`(仅供测试)`,-1)]]),(0,t.createElementVNode)(`div`,{class:`import-card`,onClick:a[3]||=e=>H(ae)},[...a[15]||=[(0,t.createElementVNode)(`div`,{class:`import-icon-box pptist-icon`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,t.createElementVNode)(`path`,{d:`M4 4C4 2.89543 4.89543 2 6 2H14L20 8V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V4Z`,fill:`#eb5757`}),(0,t.createElementVNode)(`path`,{d:`M14 2V8H20L14 2Z`,fill:`#c03930`}),(0,t.createElementVNode)(`rect`,{x:`7`,y:`12`,width:`10`,height:`2`,rx:`1`,fill:`#fff`}),(0,t.createElementVNode)(`rect`,{x:`7`,y:`16`,width:`10`,height:`2`,rx:`1`,fill:`#fff`})])],-1),(0,t.createElementVNode)(`div`,{class:`import-label`},`JVS-PPT`,-1),(0,t.createElementVNode)(`div`,{class:`import-subtext`},`(专属格式)`,-1)]])]),a[27]||=(0,t.createElementVNode)(`div`,{class:`menu-divider`},null,-1),(0,t.createElementVNode)(`div`,Net,[(0,t.createVNode)(c,{trigger:`click`,onCommand:Re,disabled:R.value,style:{width:`100%`,display:`block`,"text-align":`left`}},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)(s,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)(o,{command:`png`},{default:(0,t.withCtx)(()=>[...a[17]||=[(0,t.createTextVNode)(`下载当前页 (PNG)`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`jpeg`},{default:(0,t.withCtx)(()=>[...a[18]||=[(0,t.createTextVNode)(`下载当前页 (JPEG)`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`zip`},{default:(0,t.withCtx)(()=>[...a[19]||=[(0,t.createTextVNode)(`下载全部 (ZIP)`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`pptx`},{default:(0,t.withCtx)(()=>[...a[20]||=[(0,t.createTextVNode)(`下载为 PPTX`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`json`,divided:``},{default:(0,t.withCtx)(()=>[...a[21]||=[(0,t.createTextVNode)(`导出完整 JSON 配置`,-1)]]),_:1}),(0,t.createVNode)(o,{command:`json-template`},{default:(0,t.withCtx)(()=>[...a[22]||=[(0,t.createTextVNode)(`导出纯版式 JSON (排除图片/清空文本)`,-1)]]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Pet,[a[16]||=(0,t.createElementVNode)(`svg`,{class:`link-icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z`,fill:`currentColor`})],-1),(0,t.createElementVNode)(`span`,Fet,(0,t.toDisplayString)(R.value?`正在导出...`:`导出文件`),1)])]),_:1},8,[`disabled`]),(0,t.unref)(F)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`menu-link-item`,onClick:a[4]||=e=>H(G)},[...a[23]||=[(0,t.createElementVNode)(`svg`,{class:`link-icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z`,fill:`currentColor`})],-1),(0,t.createElementVNode)(`span`,{class:`link-text`},`重置幻灯片`,-1)]])),(0,t.createElementVNode)(`div`,{class:`menu-link-item`,onClick:a[5]||=e=>H(oe)},[...a[24]||=[(0,t.createElementVNode)(`svg`,{class:`link-icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6h-5.6z`,fill:`currentColor`})],-1),(0,t.createElementVNode)(`span`,{class:`link-text`},`幻灯片类型标注`,-1)]]),(0,t.createElementVNode)(`div`,{class:`menu-link-item`,onClick:a[6]||=e=>H(se)},[...a[25]||=[(0,t.createElementVNode)(`svg`,{class:`link-icon`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{d:`M4 15h2v3H4v-3zm0-4h2v3H4v-3zm0-4h2v3H4V7zm4 8h8v3H8v-3zm0-4h8v3H8v-3zm0-4h8v3H8V7zm12 8h2v3h-2v-3zm0-4h2v3h-2v-3zm0-4h2v3h-2V7z`,fill:`currentColor`})],-1),(0,t.createElementVNode)(`span`,{class:`link-text`},`快捷操作`,-1)]])]),a[28]||=(0,t.createElementVNode)(`div`,{class:`menu-disclaimer`},` 注:本站仅作测试/演示,不提供任何形式的服务 `,-1)])])]),_:1},512)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,Iet,[!V.value||(0,t.unref)(F)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,onClick:te,class:`presentation-title-text`,style:(0,t.normalizeStyle)({fontSize:`15px`,fontWeight:600,color:`#0f172a`,cursor:(0,t.unref)(F)?`default`:`pointer`,transition:`color 0.15s ease`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,display:`inline-block`,maxWidth:`240px`}),title:(0,t.unref)(i)||`未命名演示文稿`},(0,t.toDisplayString)((0,t.unref)(i)||`未命名演示文稿`),13,Let)):(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:1,ref_key:`titleInputRef`,ref:ee,class:`presentation-title-input-edit`,"onUpdate:modelValue":a[7]||=e=>(0,t.isRef)(i)?i.value=e:null,onBlur:ne,onKeyup:(0,t.withKeys)(ne,[`enter`]),style:{"font-size":`15px`,"font-weight":`600`,color:`#0f172a`,border:`1px solid #3b82f6`,"border-radius":`6px`,padding:`4px 8px`,outline:`none`,background:`#fff`,"box-shadow":`0 0 0 2px rgba(59, 130, 246, 0.15)`,width:`200px`}},null,544)),[[t.vModelText,(0,t.unref)(i)]]),!V.value&&!(0,t.unref)(F)?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{key:2,onClick:te,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{width:`14px`,height:`14px`,color:`#3b82f6`,cursor:`pointer`,"margin-left":`2px`,"flex-shrink":`0`}},[...a[29]||=[(0,t.createElementVNode)(`path`,{d:`M12 20h9`},null,-1),(0,t.createElementVNode)(`path`,{d:`M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z`},null,-1)]])):(0,t.createCommentVNode)(``,!0)])],!0),(0,t.renderSlot)(n.$slots,`left-suffix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0)]),(0,t.unref)(F)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`header-center-tools`,onWheelPassive:ut,style:{flex:`1`,display:`flex`,"align-items":`center`,"justify-content":`flex-start`,"overflow-x":`auto`,"overflow-y":`hidden`,"min-width":`0`,position:`relative`,"z-index":`10`,margin:`0 8px`,"scrollbar-width":`none`,"-ms-overflow-style":`none`}},[(0,t.renderSlot)(n.$slots,`center`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),()=>[(0,t.renderSlot)(n.$slots,`toolbar`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),()=>[(0,t.createElementVNode)(`div`,Ret,[(0,t.createVNode)(B8e,{"toolbar-mode":e.toolbarMode},(0,t.createSlots)({_:2},[n.$slots[`toolbar-prefix`]?{name:`prefix`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`toolbar-prefix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0)]),key:`0`}:void 0,n.$slots[`toolbar-suffix`]?{name:`suffix`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`toolbar-suffix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0)]),key:`1`}:void 0]),1032,[`toolbar-mode`])])],!0)],!0)],32)),(0,t.createElementVNode)(`div`,zet,[(0,t.renderSlot)(n.$slots,`right-prefix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0),(0,t.renderSlot)(n.$slots,`right`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0),(0,t.renderSlot)(n.$slots,`default`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0),(0,t.createVNode)(c,{trigger:`click`,placement:`bottom`,"popper-class":`zoom-dropdown-popper`,onCommand:L},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)(s,{class:`zoom-dropdown-menu`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(o,{command:`50`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===50})},{default:(0,t.withCtx)(()=>[...a[31]||=[(0,t.createTextVNode)(`50%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`75`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===75})},{default:(0,t.withCtx)(()=>[...a[32]||=[(0,t.createTextVNode)(`75%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`100`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===100})},{default:(0,t.withCtx)(()=>[...a[33]||=[(0,t.createTextVNode)(`100%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`125`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===125})},{default:(0,t.withCtx)(()=>[...a[34]||=[(0,t.createTextVNode)(`125%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`140`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===140})},{default:(0,t.withCtx)(()=>[...a[35]||=[(0,t.createTextVNode)(`140%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`150`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===150})},{default:(0,t.withCtx)(()=>[...a[36]||=[(0,t.createTextVNode)(`150%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`200`,class:(0,t.normalizeClass)({"is-active":(0,t.unref)(O)===200})},{default:(0,t.withCtx)(()=>[...a[37]||=[(0,t.createTextVNode)(`200%`,-1)]]),_:1},8,[`class`]),(0,t.createVNode)(o,{command:`reset`,divided:``},{default:(0,t.withCtx)(()=>[...a[38]||=[(0,t.createTextVNode)(`适合画布`,-1)]]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Bet,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(O))+`%`,1),a[30]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`},[(0,t.createElementVNode)(`path`,{d:`M6 9l6 6 6-6`})],-1)])]),_:1}),(0,t.unref)(T)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`btn-exit-master`,onClick:a[8]||=e=>(0,t.unref)(D)(),title:`退出母版`,"data-tooltip":`退出母版`},[...a[39]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`#ef4444`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M19 12H5M12 19l-7-7 7-7`})],-1),(0,t.createElementVNode)(`span`,null,`退出母版`,-1)]])):(0,t.createCommentVNode)(``,!0),!(0,t.unref)(T)&&!(0,t.unref)(F)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,class:`btn-master-toggle`,onClick:a[9]||=e=>(0,t.unref)(E)(),title:`母版`,"data-tooltip":`母版`},[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Vet,[...a[40]||=[(0,t.createElementVNode)(`use`,{"xlink:href":`#icon-muban`},null,-1)]])),a[41]||=(0,t.createElementVNode)(`span`,null,`母版`,-1)])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(T)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Het,[(0,t.createElementVNode)(`button`,{class:`presentation-main-btn`,onClick:le,title:`从头开始放映 (F5)`},[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Uet,[...a[42]||=[(0,t.createElementVNode)(`use`,{"xlink:href":`#icon-huandengpianfangying`},null,-1)]])),a[43]||=(0,t.createElementVNode)(`span`,null,`幻灯片放映`,-1)]),(0,t.createVNode)(c,{trigger:`click`,placement:`bottom-end`,"popper-class":`presentation-dropdown-popper`,onCommand:de},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)(s,{class:`presentation-dropdown-menu`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(o,{command:`beginning`},{default:(0,t.withCtx)(()=>[...a[44]||=[(0,t.createElementVNode)(`div`,{class:`presentation-menu-item-content`},[(0,t.createElementVNode)(`div`,{class:`presentation-menu-item-left`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 1024 1024`,width:`14`,height:`14`,fill:`currentColor`},[(0,t.createElementVNode)(`path`,{d:`M213.333 170.667h85.334v682.666h-85.334V170.667zm170.667 0l426.667 341.333-426.667 341.333V170.667z`})]),(0,t.createElementVNode)(`span`,null,`从头开始`)]),(0,t.createElementVNode)(`span`,{class:`presentation-menu-shortcut`},`F5`)],-1)]]),_:1}),(0,t.createVNode)(o,{command:`current`},{default:(0,t.withCtx)(()=>[...a[45]||=[(0,t.createElementVNode)(`div`,{class:`presentation-menu-item-content`},[(0,t.createElementVNode)(`div`,{class:`presentation-menu-item-left`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 1024 1024`,width:`14`,height:`14`,fill:`currentColor`},[(0,t.createElementVNode)(`path`,{d:`M298.667 170.667l512 341.333-512 341.333V170.667z`})]),(0,t.createElementVNode)(`span`,null,`从当前页开始`)]),(0,t.createElementVNode)(`span`,{class:`presentation-menu-shortcut`},`Shift+F5`)],-1)]]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[a[46]||=(0,t.createElementVNode)(`button`,{class:`presentation-arrow-btn`,title:`放映选项`},[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 1024 1024`,width:`9`,height:`9`,fill:`currentColor`},[(0,t.createElementVNode)(`path`,{d:`M512 682.667L170.667 341.333h682.666L512 682.667z`})])],-1)]),_:1})])),(0,t.createElementVNode)(`input`,{type:`file`,ref_key:`fileInputRef`,ref:B,accept:`.pptx`,style:{display:`none`},onChange:st},null,544),(0,t.createElementVNode)(`input`,{type:`file`,ref_key:`jsonInputRef`,ref:ie,accept:`.json`,style:{display:`none`},onChange:ce},null,544),(0,t.renderSlot)(n.$slots,`right-suffix`,(0,t.normalizeProps)((0,t.guardReactiveProps)(lt.value)),void 0,!0)]),I.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(r),{key:1,visible:(0,t.unref)(C),"onUpdate:visible":a[10]||=e=>(0,t.isRef)(C)?C.value=e:null},null,8,[`visible`])):(0,t.createCommentVNode)(``,!0)],512),[[t.vShow,e.visible]]),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[R.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Wet,[a[47]||=(0,t.createElementVNode)(`div`,{class:`loading-spinner`},null,-1),(0,t.createElementVNode)(`div`,Get,(0,t.toDisplayString)(z.value),1)])):(0,t.createCommentVNode)(``,!0)]))],64)}}});B8();var qet=z8(Ket,[[`__scopeId`,`data-v-feebd39b`]]),Jet=c((()=>{})),q5=c((()=>{$X(),Jet()}));q5(),$X(),nZ(),Q8e();function Yet(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yet(Object(n),!0).forEach(function(t){Zet(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yet(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xet(e){"@babel/helpers - typeof";return Xet=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Xet(e)}function Zet(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y5(){return Y5=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y5.apply(this,arguments)}function Qet(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function $et(e,t){if(e==null)return{};var n=Qet(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var ett=`1.14.0`;function X5(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var Z5=X5(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Q5=X5(/Edge/i),ttt=X5(/firefox/i),$5=X5(/safari/i)&&!X5(/chrome/i)&&!X5(/android/i),ntt=X5(/iP(ad|od|hone)/i),rtt=X5(/chrome/i)&&X5(/android/i),itt={capture:!1,passive:!1};function e7(e,t,n){e.addEventListener(t,n,!Z5&&itt)}function t7(e,t,n){e.removeEventListener(t,n,!Z5&&itt)}function n7(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function att(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function r7(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&n7(e,t):n7(e,t))||r&&e===n)return e;if(e===n)break}while(e=att(e))}return null}var ott=/\s+/g;function i7(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(ott,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(ott,` `))}function a7(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function o7(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=a7(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function stt(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function s7(){return document.scrollingElement||document.documentElement}function c7(e,t,n,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==s7()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!Z5))do if(i&&i.getBoundingClientRect&&(a7(i,`transform`)!==`none`||n&&a7(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(a7(i,`border-top-width`)),s-=f.left+parseInt(a7(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=o7(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function ctt(e,t,n){for(var r=d7(e,!0),i=c7(e)[t];r;){var a=c7(r)[n],o=void 0;if(o=n===`top`||n===`left`?i>=a:i<=a,!o)return r;if(r===s7())break;r=d7(r,!1)}return!1}function l7(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==J7.ghost&&(r||o[a]!==J7.dragged)&&r7(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function ltt(e,t){for(var n=e.lastElementChild;n&&(n===J7.ghost||a7(n,`display`)===`none`||t&&!n7(n,t));)n=n.previousElementSibling;return n||null}function u7(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==J7.clone&&(!t||n7(e,t))&&n++;return n}function utt(e){var t=0,n=0,r=s7();if(e)do{var i=o7(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function dtt(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function d7(e,t){if(!e||!e.getBoundingClientRect)return s7();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=a7(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return s7();if(r||t)return n;r=!0}}while(n=n.parentNode);return s7()}function ftt(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function ptt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var f7;function mtt(e,t){return function(){if(!f7){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),f7=setTimeout(function(){f7=void 0},t)}}}function htt(){clearTimeout(f7),f7=void 0}function gtt(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function _tt(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var p7=`Sortable`+new Date().getTime();function vtt(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(!(a7(t,`display`)===`none`||t===J7.ghost)){e.push({target:t,rect:c7(t)});var n=J5({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=o7(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(dtt(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=c7(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=o7(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&ptt(c,s)&&!ptt(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=btt(u,c,l,r.options)),ptt(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){a7(e,`transition`,``),a7(e,`transform`,``);var i=o7(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,a7(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=ytt(e),a7(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),a7(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){a7(e,`transition`,``),a7(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function ytt(e){return e.offsetWidth}function btt(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}var m7=[],xtt={initializeByDefault:!0},h7={mount:function(e){for(var t in xtt)xtt.hasOwnProperty(t)&&!(t in e)&&(e[t]=xtt[t]);m7.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),m7.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;m7.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](J5({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](J5({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in m7.forEach(function(r){var i=r.pluginName;if(!(!e.options[i]&&!r.initializeByDefault)){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,Y5(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return m7.forEach(function(r){typeof r.eventProperties==`function`&&Y5(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return m7.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function Stt(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[p7],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Z5&&!Q5?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var v=J5(J5({},m),h7.getEventProperties(r,t));for(var y in v)h[y]=v[y];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}var Ctt=[`evt`],g7=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=$et(n,Ctt);h7.pluginEvent.bind(J7)(e,t,J5({dragEl:v7,parentEl:y7,ghostEl:b7,rootEl:x7,nextEl:S7,lastDownEl:C7,cloneEl:w7,cloneHidden:T7,dragStarted:L7,putSortable:j7,activeSortable:J7.active,originalEvent:r,oldIndex:E7,oldDraggableIndex:O7,newIndex:D7,newDraggableIndex:k7,hideGhostForTarget:Ltt,unhideGhostForTarget:Rtt,cloneNowHidden:function(){T7=!0},cloneNowShown:function(){T7=!1},dispatchSortableEvent:function(e){_7({sortable:t,name:e,originalEvent:r})}},i))};function _7(e){Stt(J5({putSortable:j7,cloneEl:w7,targetEl:v7,rootEl:x7,oldIndex:E7,oldDraggableIndex:O7,newIndex:D7,newDraggableIndex:k7},e))}var v7,y7,b7,x7,S7,C7,w7,T7,E7,D7,O7,k7,A7,j7,M7=!1,N7=!1,P7=[],F7,I7,wtt,Ttt,Ett,Dtt,L7,R7,z7,B7=!1,V7=!1,H7,U7,Ott=[],ktt=!1,W7=[],G7=typeof document<`u`,K7=ntt,Att=Q5||Z5?`cssFloat`:`float`,jtt=G7&&!rtt&&!ntt&&`draggable`in document.createElement(`div`),Mtt=function(){if(G7){if(Z5)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),Ntt=function(e,t){var n=a7(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=l7(e,0,t),a=l7(e,1,t),o=i&&a7(i),s=a&&a7(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+c7(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+c7(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[Att]===`none`||a&&n[Att]===`none`&&c+l>r)?`vertical`:`horizontal`},Ptt=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},Ftt=function(e,t){var n;return P7.some(function(r){var i=r[p7].options.emptyInsertThreshold;if(!(!i||ltt(r))){var a=c7(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},Itt=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||Xet(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Ltt=function(){!Mtt&&b7&&a7(b7,`display`,`none`)},Rtt=function(){!Mtt&&b7&&a7(b7,`display`,``)};G7&&document.addEventListener(`click`,function(e){if(N7)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),N7=!1,!1},!0);var q7=function(e){if(v7){e=e.touches?e.touches[0]:e;var t=Ftt(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[p7]._onDragOver(n)}}},ztt=function(e){v7&&v7.parentNode[p7]._isOutsideThisEl(e.target)};function J7(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=Y5({},t),e[p7]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ntt(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:J7.supportPointer!==!1&&`PointerEvent`in window&&!$5,emptyInsertThreshold:5};for(var r in h7.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in Itt(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:jtt,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?e7(e,`pointerdown`,this._onTapStart):(e7(e,`mousedown`,this._onTapStart),e7(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(e7(e,`dragover`,this),e7(e,`dragenter`,this)),P7.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Y5(this,vtt())}J7.prototype={constructor:J7,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(R7=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,v7):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(Jtt(n),!v7&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&$5&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=r7(s,r.draggable,n,!1),!(s&&s.animated)&&C7!==s)){if(E7=u7(s),O7=u7(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){_7({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),g7(`filter`,t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=r7(c,r.trim(),n,!1),r)return _7({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),g7(`filter`,t,{evt:e}),!0}),l)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!r7(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!v7&&n.parentNode===i){var c=c7(n);if(x7=i,v7=n,y7=v7.parentNode,S7=v7.nextSibling,C7=n,A7=a.group,J7.dragged=v7,F7={target:v7,clientX:(t||e).clientX,clientY:(t||e).clientY},Ett=F7.clientX-c.left,Dtt=F7.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,v7.style[`will-change`]=`all`,s=function(){if(g7(`delayEnded`,r,{evt:e}),J7.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!ttt&&r.nativeDraggable&&(v7.draggable=!0),r._triggerDragStart(e,t),_7({sortable:r,name:`choose`,originalEvent:e}),i7(v7,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){stt(v7,e.trim(),Vtt)}),e7(o,`dragover`,q7),e7(o,`mousemove`,q7),e7(o,`touchmove`,q7),e7(o,`mouseup`,r._onDrop),e7(o,`touchend`,r._onDrop),e7(o,`touchcancel`,r._onDrop),ttt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,v7.draggable=!0),g7(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Q5||Z5))){if(J7.eventCanceled){this._onDrop();return}e7(o,`mouseup`,r._disableDelayedDrag),e7(o,`touchend`,r._disableDelayedDrag),e7(o,`touchcancel`,r._disableDelayedDrag),e7(o,`mousemove`,r._delayedDragTouchMoveHandler),e7(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&e7(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){v7&&Vtt(v7),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;t7(e,`mouseup`,this._disableDelayedDrag),t7(e,`touchend`,this._disableDelayedDrag),t7(e,`touchcancel`,this._disableDelayedDrag),t7(e,`mousemove`,this._delayedDragTouchMoveHandler),t7(e,`touchmove`,this._delayedDragTouchMoveHandler),t7(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?e7(document,`pointermove`,this._onTouchMove):t?e7(document,`touchmove`,this._onTouchMove):e7(document,`mousemove`,this._onTouchMove):(e7(v7,`dragend`,this),e7(x7,`dragstart`,this._onDragStart));try{document.selection?X7(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(M7=!1,x7&&v7){g7(`dragStarted`,this,{evt:t}),this.nativeDraggable&&e7(document,`dragover`,ztt);var n=this.options;!e&&i7(v7,n.dragClass,!1),i7(v7,n.ghostClass,!0),J7.active=this,e&&this._appendGhost(),_7({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(I7){this._lastX=I7.clientX,this._lastY=I7.clientY,Ltt();for(var e=document.elementFromPoint(I7.clientX,I7.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(I7.clientX,I7.clientY),e!==t);)t=e;if(v7.parentNode[p7]._isOutsideThisEl(e),t)do{if(t[p7]){var n=void 0;if(n=t[p7]._onDragOver({clientX:I7.clientX,clientY:I7.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Rtt()}},_onTouchMove:function(e){if(F7){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=b7&&o7(b7,!0),o=b7&&a&&a.a,s=b7&&a&&a.d,c=K7&&U7&&utt(U7),l=(i.clientX-F7.clientX+r.x)/(o||1)+(c?c[0]-Ott[0]:0)/(o||1),u=(i.clientY-F7.clientY+r.y)/(s||1)+(c?c[1]-Ott[1]:0)/(s||1);if(!J7.active&&!M7){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(b7){a?(a.e+=l-(wtt||0),a.f+=u-(Ttt||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;a7(b7,`webkitTransform`,d),a7(b7,`mozTransform`,d),a7(b7,`msTransform`,d),a7(b7,`transform`,d),wtt=l,Ttt=u,I7=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!b7){var e=this.options.fallbackOnBody?document.body:x7,t=c7(v7,!0,K7,!0,e),n=this.options;if(K7){for(U7=e;a7(U7,`position`)===`static`&&a7(U7,`transform`)===`none`&&U7!==document;)U7=U7.parentNode;U7!==document.body&&U7!==document.documentElement?(U7===document&&(U7=s7()),t.top+=U7.scrollTop,t.left+=U7.scrollLeft):U7=s7(),Ott=utt(U7)}b7=v7.cloneNode(!0),i7(b7,n.ghostClass,!1),i7(b7,n.fallbackClass,!0),i7(b7,n.dragClass,!0),a7(b7,`transition`,``),a7(b7,`transform`,``),a7(b7,`box-sizing`,`border-box`),a7(b7,`margin`,0),a7(b7,`top`,t.top),a7(b7,`left`,t.left),a7(b7,`width`,t.width),a7(b7,`height`,t.height),a7(b7,`opacity`,`0.8`),a7(b7,`position`,K7?`absolute`:`fixed`),a7(b7,`zIndex`,`100000`),a7(b7,`pointerEvents`,`none`),J7.ghost=b7,e.appendChild(b7),a7(b7,`transform-origin`,Ett/parseInt(b7.style.width)*100+`% `+Dtt/parseInt(b7.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(g7(`dragStart`,this,{evt:e}),J7.eventCanceled){this._onDrop();return}g7(`setupClone`,this),J7.eventCanceled||(w7=_tt(v7),w7.draggable=!1,w7.style[`will-change`]=``,this._hideClone(),i7(w7,this.options.chosenClass,!1),J7.clone=w7),n.cloneId=X7(function(){g7(`clone`,n),!J7.eventCanceled&&(n.options.removeCloneOnHide||x7.insertBefore(w7,v7),n._hideClone(),_7({sortable:n,name:`clone`}))}),!t&&i7(v7,i.dragClass,!0),t?(N7=!0,n._loopId=setInterval(n._emulateDragOver,50)):(t7(document,`mouseup`,n._onDrop),t7(document,`touchend`,n._onDrop),t7(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,v7)),e7(document,`drop`,n),a7(v7,`transform`,`translateZ(0)`)),M7=!0,n._dragStartId=X7(n._dragStarted.bind(n,t,e)),e7(document,`selectstart`,n),L7=!0,$5&&a7(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=J7.active,l=A7===s,u=o.sort,d=j7||c,f,p=this,m=!1;if(ktt)return;function h(o,s){g7(o,p,J5({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return Y7(x7,t,v7,r,n,c7(n),e,i)},changed:v},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(i7(v7,j7?j7.options.ghostClass:c.options.ghostClass,!1),i7(v7,o.ghostClass,!0)),j7!==p&&p!==J7.active?j7=p:p===J7.active&&j7&&(j7=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===v7&&!v7.animated||n===t&&!n.animated)&&(R7=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(v7.parentNode[p7]._isOutsideThisEl(e.target),!r&&q7(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){D7=u7(v7),k7=u7(v7,o.draggable),_7({sortable:p,name:`change`,toEl:t,newIndex:D7,newDraggableIndex:k7,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=r7(n,o.draggable,t,!0),h(`dragOver`),J7.eventCanceled)return m;if(v7.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(N7=!1,c&&!o.disabled&&(l?u||(a=y7!==x7):j7===this||(this.lastPutMode=A7.checkPull(this,c,v7,e))&&s.checkPut(this,c,v7,e))){if(f=this._getDirection(e,n)===`vertical`,r=c7(v7),h(`dragOverValid`),J7.eventCanceled)return m;if(a)return y7=x7,g(),this._hideClone(),h(`revert`),J7.eventCanceled||(S7?x7.insertBefore(v7,S7):x7.appendChild(v7)),_(!0);var y=ltt(t,o.draggable);if(!y||Wtt(e,f,this)&&!y.animated){if(y===v7)return _(!1);if(y&&t===e.target&&(n=y),n&&(i=c7(n)),Y7(x7,t,v7,r,n,i,e,!!n)!==!1)return g(),t.appendChild(v7),y7=t,v(),_(!0)}else if(y&&Utt(e,f,this)){var b=l7(t,0,o,!0);if(b===v7)return _(!1);if(n=b,i=c7(n),Y7(x7,t,v7,r,n,i,e,!1)!==!1)return g(),t.insertBefore(v7,b),y7=t,v(),_(!0)}else if(n.parentNode===t){i=c7(n);var x=0,S,C=v7.parentNode!==t,w=!Ptt(v7.animated&&v7.toRect||r,n.animated&&n.toRect||i,f),T=f?`top`:`left`,E=ctt(n,`top`,`top`)||ctt(v7,`top`,`top`),D=E?E.scrollTop:void 0;R7!==n&&(S=i[T],B7=!1,V7=!w&&o.invertSwap||C),x=Gtt(e,n,i,f,w?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,V7,R7===n);var O;if(x!==0){var k=u7(v7);do k-=x,O=y7.children[k];while(O&&(a7(O,`display`)===`none`||O===b7))}if(x===0||O===n)return _(!1);R7=n,z7=x;var A=n.nextElementSibling,j=!1;j=x===1;var M=Y7(x7,t,v7,r,n,i,e,j);if(M!==!1)return(M===1||M===-1)&&(j=M===1),ktt=!0,setTimeout(Htt,30),g(),j&&!A?t.appendChild(v7):n.parentNode.insertBefore(v7,j?A:n),E&>t(E,0,D-E.scrollTop),y7=v7.parentNode,S!==void 0&&!V7&&(H7=Math.abs(S-c7(n)[T])),v(),_(!0)}if(t.contains(v7))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){t7(document,`mousemove`,this._onTouchMove),t7(document,`touchmove`,this._onTouchMove),t7(document,`pointermove`,this._onTouchMove),t7(document,`dragover`,q7),t7(document,`mousemove`,q7),t7(document,`touchmove`,q7)},_offUpEvents:function(){var e=this.el.ownerDocument;t7(e,`mouseup`,this._onDrop),t7(e,`touchend`,this._onDrop),t7(e,`pointerup`,this._onDrop),t7(e,`touchcancel`,this._onDrop),t7(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(D7=u7(v7),k7=u7(v7,n.draggable),g7(`drop`,this,{evt:e}),y7=v7&&v7.parentNode,D7=u7(v7),k7=u7(v7,n.draggable),J7.eventCanceled){this._nulling();return}M7=!1,V7=!1,B7=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ytt(this.cloneId),Ytt(this._dragStartId),this.nativeDraggable&&(t7(document,`drop`,this),t7(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),$5&&a7(document.body,`user-select`,``),a7(v7,`transform`,``),e&&(L7&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),b7&&b7.parentNode&&b7.parentNode.removeChild(b7),(x7===y7||j7&&j7.lastPutMode!==`clone`)&&w7&&w7.parentNode&&w7.parentNode.removeChild(w7),v7&&(this.nativeDraggable&&t7(v7,`dragend`,this),Vtt(v7),v7.style[`will-change`]=``,L7&&!M7&&i7(v7,j7?j7.options.ghostClass:this.options.ghostClass,!1),i7(v7,this.options.chosenClass,!1),_7({sortable:this,name:`unchoose`,toEl:y7,newIndex:null,newDraggableIndex:null,originalEvent:e}),x7===y7?D7!==E7&&D7>=0&&(_7({sortable:this,name:`update`,toEl:y7,originalEvent:e}),_7({sortable:this,name:`sort`,toEl:y7,originalEvent:e})):(D7>=0&&(_7({rootEl:y7,name:`add`,toEl:y7,fromEl:x7,originalEvent:e}),_7({sortable:this,name:`remove`,toEl:y7,originalEvent:e}),_7({rootEl:y7,name:`sort`,toEl:y7,fromEl:x7,originalEvent:e}),_7({sortable:this,name:`sort`,toEl:y7,originalEvent:e})),j7&&j7.save()),J7.active&&((D7==null||D7===-1)&&(D7=E7,k7=O7),_7({sortable:this,name:`end`,toEl:y7,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){g7(`nulling`,this),x7=v7=y7=b7=S7=w7=C7=T7=F7=I7=L7=D7=k7=E7=O7=R7=z7=j7=A7=J7.dragged=J7.ghost=J7.clone=J7.active=null,W7.forEach(function(e){e.checked=!0}),W7.length=wtt=Ttt=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:v7&&(this._onDragOver(e),Btt(e));break;case`selectstart`:e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],r7(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||qtt(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];r7(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return r7(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=h7.modifyOption(this,e,t);r===void 0?n[e]=t:n[e]=r,e===`group`&&Itt(n)},destroy:function(){g7(`destroy`,this);var e=this.el;e[p7]=null,t7(e,`mousedown`,this._onTapStart),t7(e,`touchstart`,this._onTapStart),t7(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(t7(e,`dragover`,this),t7(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),P7.splice(P7.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!T7){if(g7(`hideClone`,this),J7.eventCanceled)return;a7(w7,`display`,`none`),this.options.removeCloneOnHide&&w7.parentNode&&w7.parentNode.removeChild(w7),T7=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(T7){if(g7(`showClone`,this),J7.eventCanceled)return;v7.parentNode==x7&&!this.options.group.revertClone?x7.insertBefore(w7,v7):S7?x7.insertBefore(w7,S7):x7.appendChild(w7),this.options.group.revertClone&&this.animate(v7,w7),a7(w7,`display`,``),T7=!1}}};function Btt(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function Y7(e,t,n,r,i,a,o,s){var c,l=e[p7],u=l.options.onMove,d;return window.CustomEvent&&!Z5&&!Q5?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||c7(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function Vtt(e){e.draggable=!1}function Htt(){ktt=!1}function Utt(e,t,n){var r=c7(l7(n.el,0,n.options,!0)),i=10;return t?e.clientX<r.left-i||e.clientY<r.top&&e.clientX<r.right:e.clientY<r.top-i||e.clientY<r.bottom&&e.clientX<r.left}function Wtt(e,t,n){var r=c7(ltt(n.el,n.options.draggable)),i=10;return t?e.clientX>r.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}function Gtt(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&H7<l*i){if(!B7&&(z7===1?c>u+l*a/2:c<d-l*a/2)&&(B7=!0),B7)f=!0;else if(z7===1?c<u+H7:c>d-H7)return-z7}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return Ktt(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function Ktt(e){return u7(v7)<u7(e)?1:-1}function qtt(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function Jtt(e){W7.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&W7.push(r)}}function X7(e){return setTimeout(e,0)}function Ytt(e){return clearTimeout(e)}G7&&e7(document,`touchmove`,function(e){(J7.active||M7)&&e.cancelable&&e.preventDefault()}),J7.utils={on:e7,off:t7,css:a7,find:stt,is:function(e,t){return!!r7(e,t,e,!1)},extend:ftt,throttle:mtt,closest:r7,toggleClass:i7,clone:_tt,index:u7,nextTick:X7,cancelNextTick:Ytt,detectDirection:Ntt,getChild:l7},J7.get=function(e){return e[p7]},J7.mount=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(J7.utils=J5(J5({},J7.utils),e.utils)),h7.mount(e)})},J7.create=function(e,t){return new J7(e,t)},J7.version=ett;var Z7=[],Q7,Xtt,Ztt=!1,Qtt,$tt,$7,e9;function ent(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?e7(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?e7(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?e7(document,`touchmove`,this._handleFallbackAutoScroll):e7(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?t7(document,`dragover`,this._handleAutoScroll):(t7(document,`pointermove`,this._handleFallbackAutoScroll),t7(document,`touchmove`,this._handleFallbackAutoScroll),t7(document,`mousemove`,this._handleFallbackAutoScroll)),tnt(),t9(),htt()},nulling:function(){$7=Xtt=Q7=Ztt=e9=Qtt=$tt=null,Z7.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if($7=e,t||this.options.forceAutoScrollFallback||Q5||Z5||$5){nnt(e,this.options,a,t);var o=d7(a,!0);Ztt&&(!e9||r!==Qtt||i!==$tt)&&(e9&&tnt(),e9=setInterval(function(){var a=d7(document.elementFromPoint(r,i),!0);a!==o&&(o=a,t9()),nnt(e,n.options,a,t)},10),Qtt=r,$tt=i)}else{if(!this.options.bubbleScroll||d7(a,!0)===s7()){t9();return}nnt(e,this.options,d7(a,!1),!1)}}},Y5(e,{pluginName:`scroll`,initializeByDefault:!0})}function t9(){Z7.forEach(function(e){clearInterval(e.pid)}),Z7=[]}function tnt(){clearInterval(e9)}var nnt=mtt(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=s7(),l=!1,u;Xtt!==n&&(Xtt=n,t9(),Q7=t.scroll,u=t.scrollFn,Q7===!0&&(Q7=d7(n,!0)));var d=0,f=Q7;do{var p=f,m=c7(p),h=m.top,g=m.bottom,_=m.left,v=m.right,y=m.width,b=m.height,x=void 0,S=void 0,C=p.scrollWidth,w=p.scrollHeight,T=a7(p),E=p.scrollLeft,D=p.scrollTop;p===c?(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`||T.overflowX===`visible`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`||T.overflowY===`visible`)):(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`));var O=x&&(Math.abs(v-i)<=o&&E+y<C)-(Math.abs(_-i)<=o&&!!E),k=S&&(Math.abs(g-a)<=o&&D+b<w)-(Math.abs(h-a)<=o&&!!D);if(!Z7[d])for(var A=0;A<=d;A++)Z7[A]||(Z7[A]={});(Z7[d].vx!=O||Z7[d].vy!=k||Z7[d].el!==p)&&(Z7[d].el=p,Z7[d].vx=O,Z7[d].vy=k,clearInterval(Z7[d].pid),(O!=0||k!=0)&&(l=!0,Z7[d].pid=setInterval(function(){r&&this.layer===0&&J7.active._onTouchMove($7);var t=Z7[this.layer].vy?Z7[this.layer].vy*s:0,n=Z7[this.layer].vx?Z7[this.layer].vx*s:0;typeof u==`function`&&u.call(J7.dragged.parentNode[p7],n,t,e,$7,Z7[this.layer].el)!==`continue`||gtt(Z7[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=d7(f,!1)));Ztt=l}},30),rnt=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}};function int(){}int.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=l7(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:rnt},Y5(int,{pluginName:`revertOnSpill`});function ant(){}ant.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:rnt},Y5(ant,{pluginName:`removeOnSpill`}),J7.mount(new ent),J7.mount(ant,int);function ont(e){e.parentElement!==null&&e.parentElement.removeChild(e)}function snt(e,t,n){let r=n===0?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,r)}function cnt(){return typeof window<`u`?window.console:global.console}var lnt=cnt();function unt(e){let t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var dnt=/-(\w)/g,fnt=unt(e=>e.replace(dnt,(e,t)=>t.toUpperCase())),pnt=[`Start`,`Add`,`Remove`,`Update`,`End`],mnt=[`Choose`,`Unchoose`,`Sort`,`Filter`,`Clone`],hnt=[`Move`],gnt=[hnt,pnt,mnt].flatMap(e=>e).map(e=>`on${e}`),_nt={manage:hnt,manageAndEmit:pnt,emit:mnt};function vnt(e){return gnt.indexOf(e)!==-1}var ynt=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.math.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rb.rp.rt.rtc.ruby.s.samp.script.section.select.slot.small.source.span.strong.style.sub.summary.sup.svg.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function bnt(e){return ynt.includes(e)}function xnt(e){return[`transition-group`,`TransitionGroup`].includes(e)}function Snt(e){return[`id`,`class`,`role`,`style`].includes(e)||e.startsWith(`data-`)||e.startsWith(`aria-`)||e.startsWith(`on`)}function Cnt(e){return e.reduce((e,[t,n])=>(e[t]=n,e),{})}function wnt({$attrs:e,componentData:t={}}){return{...Cnt(Object.entries(e).filter(([e,t])=>Snt(e))),...t}}function Tnt({$attrs:e,callBackBuilder:t}){let n=Cnt(Ent(e));Object.entries(t).forEach(([e,t])=>{_nt[e].forEach(e=>{n[`on${e}`]=t(e)})});let r=`[data-draggable]${n.draggable||``}`;return{...n,draggable:r}}function Ent(e){return Object.entries(e).filter(([e,t])=>!Snt(e)).map(([e,t])=>[fnt(e),t]).filter(([e,t])=>!vnt(e))}var Dnt=({el:e})=>e,Ont=(e,t)=>e.__draggable_context=t,knt=e=>e.__draggable_context,Ant=class{constructor({nodes:{header:e,default:t,footer:n},root:r,realList:i}){this.defaultNodes=t,this.children=[...e,...t,...n],this.externalComponent=r.externalComponent,this.rootTransition=r.transition,this.tag=r.tag,this.realList=i}get _isRootComponent(){return this.externalComponent||this.rootTransition}render(e,t){let{tag:n,children:r,_isRootComponent:i}=this;return e(n,t,i?{default:()=>r}:r)}updated(){let{defaultNodes:e,realList:t}=this;e.forEach((e,n)=>{Ont(Dnt(e),{element:t[n],index:n})})}getUnderlyingVm(e){return knt(e)}getVmIndexFromDomIndex(e,t){let{defaultNodes:n}=this,{length:r}=n,i=t.children,a=i.item(e);if(a===null)return r;let o=knt(a);if(o)return o.index;if(r===0)return 0;let s=Dnt(n[0]);return e<[...i].findIndex(e=>e===s)?0:r}};function jnt(e,t){let n=e[t];return n?n():[]}function Mnt({$slots:e,realList:t,getKey:n}){let r=t||[],[i,a]=[`header`,`footer`].map(t=>jnt(e,t)),{item:o}=e;if(!o)throw Error(`draggable element must have an item slot`);let s=r.flatMap((e,t)=>o({element:e,index:t}).map(t=>(t.key=n(e),t.props={...t.props||{},"data-draggable":!0},t)));if(s.length!==r.length)throw Error(`Item slot must have only one child`);return{header:i,footer:a,default:s}}function Nnt(e){let n=xnt(e),r=!bnt(e)&&!n;return{transition:n,externalComponent:r,tag:r?(0,t.resolveComponent)(e):n?t.TransitionGroup:e}}function Pnt({$slots:e,tag:t,realList:n,getKey:r}){return new Ant({nodes:Mnt({$slots:e,realList:n,getKey:r}),root:Nnt(t),realList:n})}function Fnt(e,n){(0,t.nextTick)(()=>this.$emit(e.toLowerCase(),n))}function Int(e){return(t,n)=>{if(this.realList!==null)return this[`onDrag${e}`](t,n)}}function Lnt(e){let t=Int.call(this,e);return(n,r)=>{t.call(this,n,r),Fnt.call(this,e,n)}}var Rnt=null,znt=(0,t.defineComponent)({name:`draggable`,inheritAttrs:!1,props:{list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:e=>e},tag:{type:String,default:`div`},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},emits:[`update:modelValue`,`change`,...[..._nt.manageAndEmit,..._nt.emit].map(e=>e.toLowerCase())],data(){return{error:!1}},render(){try{this.error=!1;let{$slots:e,$attrs:n,tag:r,componentData:i,realList:a,getKey:o}=this,s=Pnt({$slots:e,tag:r,realList:a,getKey:o});this.componentStructure=s;let c=wnt({$attrs:n,componentData:i});return s.render(t.h,c)}catch(e){return this.error=!0,(0,t.h)(`pre`,{style:{color:`red`}},e.stack)}},created(){this.list!==null&&this.modelValue!==null&&lnt.error(`modelValue and list props are mutually exclusive! Please set one or another.`)},mounted(){if(this.error)return;let{$attrs:e,$el:t,componentStructure:n}=this;n.updated();let r=Tnt({$attrs:e,callBackBuilder:{manageAndEmit:e=>Lnt.call(this,e),emit:e=>Fnt.bind(this,e),manage:e=>Int.call(this,e)}}),i=t.nodeType===1?t:t.parentElement;this._sortable=new J7(i,r),this.targetDomElement=i,i.__draggable_component__=this},updated(){this.componentStructure.updated()},beforeUnmount(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList(){let{list:e}=this;return e||this.modelValue},getKey(){let{itemKey:e}=this;return typeof e==`function`?e:t=>t[e]}},watch:{$attrs:{handler(e){let{_sortable:t}=this;t&&Ent(e).forEach(([e,n])=>{t.option(e,n)})},deep:!0}},methods:{getUnderlyingVm(e){return this.componentStructure.getUnderlyingVm(e)||null},getUnderlyingPotencialDraggableComponent(e){return e.__draggable_component__},emitChanges(e){(0,t.nextTick)(()=>this.$emit(`change`,e))},alterList(e){if(this.list){e(this.list);return}let t=[...this.modelValue];e(t),this.$emit(`update:modelValue`,t)},spliceList(){this.alterList(e=>e.splice(...arguments))},updatePosition(e,t){this.alterList(n=>n.splice(t,0,n.splice(e,1)[0]))},getRelatedContextFromMoveEvent({to:e,related:t}){let n=this.getUnderlyingPotencialDraggableComponent(e);if(!n)return{component:n};let r=n.realList,i={list:r,component:n};return e!==t&&r?{...n.getUnderlyingVm(t)||{},...i}:i},getVmIndexFromDomIndex(e){return this.componentStructure.getVmIndexFromDomIndex(e,this.targetDomElement)},onDragStart(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),Rnt=e.item},onDragAdd(e){let t=e.item._underlying_vm_;if(t===void 0)return;ont(e.item);let n=this.getVmIndexFromDomIndex(e.newIndex);this.spliceList(n,0,t);let r={element:t,newIndex:n};this.emitChanges({added:r})},onDragRemove(e){if(snt(this.$el,e.item,e.oldIndex),e.pullMode===`clone`){ont(e.clone);return}let{index:t,element:n}=this.context;this.spliceList(t,1);let r={element:n,oldIndex:t};this.emitChanges({removed:r})},onDragUpdate(e){ont(e.item),snt(e.from,e.item,e.oldIndex);let t=this.context.index,n=this.getVmIndexFromDomIndex(e.newIndex);this.updatePosition(t,n);let r={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:r})},computeFutureIndex(e,t){if(!e.element)return 0;let n=[...t.to.children].filter(e=>e.style.display!==`none`),r=n.indexOf(t.related),i=e.component.getVmIndexFromDomIndex(r);return n.indexOf(Rnt)!==-1||!t.willInsertAfter?i:i+1},onDragMove(e,t){let{move:n,realList:r}=this;if(!n||!r)return!0;let i=this.getRelatedContextFromMoveEvent(e),a=this.computeFutureIndex(i,e),o={...this.context,futureIndex:a};return n({...e,relatedContext:i,draggedContext:o},t)},onDragEnd(){Rnt=null}}}),n9=c((()=>{$X()}));n9(),L8();function Bnt(e){if(typeof document>`u`||!document.cookie)return``;let t=e+`=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e]?.trim();if(r&&r.indexOf(t)===0)try{return decodeURIComponent(r.substring(t.length))}catch{return r.substring(t.length)}}return``}function r9(e,t){if(!e)return``;try{let n=e.getItem(t);if(!n)return``;try{let e=JSON.parse(n);if(e&&typeof e==`object`&&`content`in e)return typeof e.content==`string`?e.content.trim():``;if(typeof e==`string`)return e.trim()}catch{return n.trim()}}catch{return``}return``}function Vnt(e,t){if(!(typeof window>`u`||!window.localStorage||!e))try{let n=JSON.stringify({dataType:typeof t,content:t,datetime:Date.now()});window.localStorage.setItem(`jvs-${e}`,n),window.sessionStorage&&window.sessionStorage.setItem(`jvs-${e}`,n)}catch{}}function Hnt(e){if(!(typeof window>`u`))try{window.localStorage?.removeItem(`jvs-${e}`),window.localStorage?.removeItem(e),window.sessionStorage?.removeItem(`jvs-${e}`),window.sessionStorage?.removeItem(e)}catch{}}function i9(e){if(typeof window>`u`)return``;let t=Bnt(`jvs_session_v3`)||Bnt(`Set-Cookie`);if(t&&t.trim())return t.trim();for(let e of[`jvs_session_v3`,`jvs-jvs_session_v3`,`jvs-sessionV3`,`sessionV3`,`jvs-access_token`,`access_token`]){let t=r9(window.localStorage,e);if(t)return t;let n=r9(window.sessionStorage,e);if(n)return n}if(e){let t=e.jvs_session_v3||e.JVS_SESSION_V3||(e.Authorization?e.Authorization.replace(/^Bearer\s+/i,``):``)||(e.authorization?e.authorization.replace(/^Bearer\s+/i,``):``);if(typeof t==`string`&&t.trim())return t.trim()}return``}function Unt(e){if(e&&/^https?:\/\//i.test(e.trim()))try{return new URL(e.trim()).origin}catch{return``}return``}function Wnt(e){if(e&&e.trim()){let t=e.trim(),n=t.indexOf(`/jvs-dam`);if(n>=0)return t.slice(0,n+8)}return`/jvs-dam`}var Gnt=(0,t.ref)(`search`),a9=(0,t.ref)(``),o9=(0,t.ref)(!1),s9=null,Knt=!1;function qnt(e){Gnt.value=e}function c9(){let{materialApiUrl:e,materialHeaders:n}=e6(),r=(0,t.ref)(0),i=null,a=(0,t.computed)(()=>Wnt(e.value)),o=(0,t.computed)(()=>Unt(e.value));async function s(e=!1){if(typeof window>`u`)return!1;if((i9(n.value)||a9.value)&&!e&&Knt)return!0;if(s9)return s9;s9=(async()=>{Knt=!0;let e=o.value;try{let t=await fetch(`${e}/jvs-system/login/token`,{method:`GET`,credentials:`include`,headers:{"jvs-rule-ua":`2.4`,...n.value||{}}});if(t.ok){let n=(await t.text()).trim();if(n&&!n.startsWith(`<`)){let t=JSON.parse(n),i=t?.code??t?.data?.code,a=t?.data?.data===void 0?t?.data:t.data.data;if(i===0){let t=typeof a==`string`?a.trim():typeof a?.access_token==`string`?a.access_token.trim():``;return t?(a9.value=t,o9.value=!0,Vnt(`sessionV3`,t),Vnt(`access_token`,t),r.value++,r9(window.localStorage,`jvs-tenantId`)||fetch(`${e}/jvs-system/index/this/tenant`,{method:`GET`,credentials:`include`,headers:{"jvs-rule-ua":`2.4`,Authorization:`Bearer ${t}`}}).then(e=>e.json()).then(e=>{let t=e?.data?.data||e?.data;t?.id&&Vnt(`tenantId`,String(t.id))}).catch(()=>{}),!0):(a9.value=``,o9.value=!1,Hnt(`sessionV3`),Hnt(`access_token`),r.value++,!1)}}}}catch{}try{let e=await fetch(`${a.value}/project/my`,{method:`GET`,credentials:`include`,headers:f(!1)});if(e.ok){let t=(await e.text()).trim();if(t&&!t.startsWith(`<`)){let e=JSON.parse(t),n=e?.code??e?.data?.code;if(n===0||n===200)return o9.value=!0,r.value++,!0}}}catch{}return!!i9(n.value)})();try{return await s9}finally{s9=null}}let c=()=>{r.value++,!i9(n.value)&&!a9.value&&!o9.value&&s(!1)},l=()=>{r.value++,!i9(n.value)&&!a9.value&&!o9.value&&s(!1)};(0,t.onMounted)(()=>{window.addEventListener(`storage`,c),window.addEventListener(`focus`,l),s(!1),i=setInterval(c,3e3)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`storage`,c),window.removeEventListener(`focus`,l),i&&=(clearInterval(i),null)});let u=(0,t.computed)(()=>(r.value,a9.value||i9(n.value))),d=(0,t.computed)(()=>(r.value,!!(u.value||o9.value)));function f(e=!0){let t={"jvs-rule-ua":`2.4`,...n.value||{}};e&&(t[`Content-Type`]=`application/json;charset=utf-8`);let r=u.value||r9(window?.localStorage,`jvs-access_token`);r&&!t.Authorization&&!t.authorization&&(t.Authorization=`Bearer ${r}`);let i=r9(window?.localStorage,`jvs-tenantId`);return i&&!t[`tenant-id`]&&(t[`tenant-id`]=i),t}async function p(e,t={}){let n=a.value,r=e.startsWith(`http`)||e.startsWith(`/jvs-`)?e:`${n}${e.startsWith(`/`)?``:`/`}${e}`;if(t.params){let e=new URLSearchParams;Object.entries(t.params).forEach(([t,n])=>{n!=null&&n!==``&&(Array.isArray(n)?n.length>0&&e.append(t,n.join(`,`)):e.append(t,String(n)))});let n=e.toString();n&&(r+=(r.includes(`?`)?`&`:`?`)+n)}let i=typeof FormData<`u`&&t.body instanceof FormData,o={...f(!i),...t.headers||{}};i&&(delete o[`Content-Type`],delete o[`content-type`]);let s=await fetch(r,{...t,credentials:`include`,headers:o}),c=await s.text();if(!s.ok)throw Error(`请求异常 (${s.status})`);let l=c.trim();if(l.startsWith(`<`)||l.toLowerCase().startsWith(`<!doctype`))throw Error(`接口返回了非 JSON 格式响应`);try{return JSON.parse(c)}catch(e){throw Error(`数据解析失败: ${e.message}`)}}return{sessionV3:u,isDamLoggedIn:d,damBaseUrl:a,sharedMaterialMainTab:Gnt,setSharedMaterialMainTab:qnt,refreshSessionState:c,probeRemoteSessionV3:s,buildDamHeaders:f,damFetchJson:p}}$K(),$X(),_b(),L8();var Jnt={class:`my-assets-panel`},Ynt={class:`mine-top-search-row`},Xnt={class:`mine-search-box`},Znt=[`disabled`],Qnt={key:0,class:`mini-spin-ring`},$nt={key:1},ert={class:`mine-filter-bar`},trt=[`title`],nrt={class:`tree-projects-scroll`},rrt=[`onClick`],irt=[`onClick`],art={class:`node-name`},ort={key:0,class:`team-tag`},srt={key:0,class:`tree-folders-children`},crt=[`onClick`],lrt={class:`node-name`},urt=[`onClick`],drt={class:`node-name`},frt={key:1,class:`tree-empty-folder-tip`},prt={class:`media-type-pills`},mrt={class:`mine-sub-tabs`},hrt={key:0,class:`mine-loading-box`},grt={key:1,class:`mine-waterfall-scroll`},_rt={key:0,class:`mine-masonry-wrapper`},vrt={class:`mine-masonry-columns`},yrt=[`onClick`],brt=[`src`],xrt=[`src`,`alt`],Srt={key:2,class:`video-play-badge`},Crt={class:`mine-card-actions`},wrt=[`onClick`],Trt=[`onClick`],Ert={class:`mine-card-bottom`},Drt=[`title`],Ort={class:`mine-footer-status`},krt={key:0,class:`loading-more-row`},Art={key:2,class:`all-loaded-divider`},jrt={key:1,class:`mine-empty-state`},Mrt={class:`empty-title`},l9=20,Nrt=(0,t.defineComponent)({__name:`MyAssetsPanel`,emits:[`select`,`preview`,`use-as-ref`],setup(e,{expose:n,emit:r}){let i=r,{notify:a}=e6(),{damFetchJson:o,isDamLoggedIn:s}=c9(),c=(0,t.ref)(``),l=(0,t.ref)(`ALL`),u=(0,t.ref)(`recent`),d=(0,t.ref)([]),f=(0,t.ref)({}),p=(0,t.ref)({}),m=(0,t.ref)(``),h=(0,t.ref)(``),g=(0,t.ref)(`全部项目资产`),_=(0,t.ref)(!1),v=(0,t.ref)(null),y=(0,t.ref)(!1),b=(0,t.ref)(!1),x=(0,t.ref)(!1),S=(0,t.ref)(1),C=(0,t.ref)(!1),w=(0,t.ref)([]),T=(0,t.ref)(null),E=[`#3b82f6`,`#10b981`,`#8b5cf6`,`#f59e0b`,`#ec4899`];function D(e,t){return e.type===`PERSONAL`?`#3b82f6`:E[t%E.length]||`#10b981`}function O(e){return e?(e.name===`Personal project`||e.type===`PERSONAL`)&&e.name===`Personal project`?`个人项目`:e.name:`项目`}function k(e){if(!Array.isArray(e)||e.length===0)return[];if(e.some(e=>Array.isArray(e.children)&&e.children.length>0))return e;let t=new Map,n=[];return e.forEach(e=>{t.set(String(e.id),{id:String(e.id),projectId:String(e.projectId||``),parentId:e.parentId?String(e.parentId):`0`,name:e.name||`文件夹`,defaultFlag:e.defaultFlag,children:[]})}),t.forEach(e=>{let r=e.parentId;r&&r!==`0`&&t.has(r)?t.get(r).children.push(e):n.push(e)}),n}async function A(){if(s.value)try{let e=await o(`/project/my`),t=[];if(Array.isArray(e)?t=e:Array.isArray(e?.data?.data)?t=e.data.data:Array.isArray(e?.data)&&(t=e.data),t.length===0){let e=await o(`/project/personal`),n=e?.data?.data||e?.data||e;n&&n.id&&(t=[n])}d.value=t.map(e=>({id:String(e.id),name:e.name||`未命名项目`,type:e.type||`PERSONAL`,description:e.description}));let n=d.value[0];n&&(p.value[n.id]=!0,await j(n.id))}catch(e){console.warn(`[MyAssets] 获取项目列表失败:`,e)}}async function j(e){if(e)try{let t=await o(`/folder/tree`,{params:{projectId:e}}),n=[];Array.isArray(t)?n=t:Array.isArray(t?.data?.data)?n=t.data.data:Array.isArray(t?.data)&&(n=t.data),f.value={...f.value,[e]:k(n)}}catch(e){console.warn(`[MyAssets] 获取文件夹树失败:`,e)}}async function M(e,t){t.stopPropagation();let n=!p.value[e];p.value[e]=n,n&&!f.value[e]&&await j(e)}function N(){m.value=``,h.value=``,g.value=`全部项目资产`,_.value=!1,B()}function P(e){m.value=e.id,h.value=``,g.value=O(e),_.value=!1,f.value[e.id]||j(e.id),B()}function F(e,t){m.value=e.id,h.value=t.id,g.value=`${O(e)} / ${t.name}`,_.value=!1,B()}function I(e){if(String(e.assetType||e.mediaType||e.type||``).toUpperCase()===`VIDEO`)return!0;let t=String(e.fileUrl||e.url||e.ossUrl||e.imageUrl||``).split(`?`)[0].toLowerCase();return t.endsWith(`.mp4`)||t.endsWith(`.webm`)||t.endsWith(`.mov`)||t.endsWith(`.m4v`)}function L(e){if(!e)return null;let t=e.asset&&typeof e.asset==`object`?{...e.asset,score:e.score}:e,n=t.fileUrl||t.imageUrl||t.ossUrl||t.fileLink||t.url||t.previewUrl||t.sourceUrl||``;if(!n)return null;let r=I(t),i={};if(t.metaDataJson)try{i=typeof t.metaDataJson==`string`?JSON.parse(t.metaDataJson):t.metaDataJson}catch{i={}}let a=t.name||t.prompt||i.prompt||t.fileName||t.fileOriginalName||t.portrait?.summary||(r?`视频资产`:`图片资产`),o=String(a).replace(/\.[a-zA-Z0-9]+$/,``).replace(/_\d{10,14}$/,``),s=String(t.sourceType||``).toUpperCase(),c=`资产`;r?c=`视频`:s===`GENERATE`||u.value===`ai`||t.recordId||t.sessionId?c=`AI 生成`:(s===`UPLOAD`||u.value===`uploads`)&&(c=`已上传`);let l=Number(i.width||t.width||t.originalWidth||0),d=Number(i.height||t.height||t.originalHeight||0);return{id:String(t.id||t.fileId||t.recordId||`dam-${Math.random().toString(36).slice(2,9)}`),title:o||`我的素材`,type:r?`video`:`image`,assetType:r?`VIDEO`:`IMAGE`,sourceType:s||(u.value===`ai`?`GENERATE`:`UPLOAD`),badgeLabel:c,url:n,previewUrl:t.previewUrl||n,sourceUrl:n,originalWidth:l>0?l:void 0,originalHeight:d>0?d:void 0,projectId:t.projectId,folderId:t.folderId,model:t.model||i.model||``,createTime:t.createTime||t.uploadTime||``}}function R(e){return e?Array.isArray(e)?e:Array.isArray(e?.data?.records)?e.data.records:Array.isArray(e?.records)?e.records:Array.isArray(e?.data?.data?.records)?e.data.data.records:Array.isArray(e?.data?.data)?e.data.data:Array.isArray(e?.data?.list)?e.data.list:Array.isArray(e?.data)?e.data:[]:[]}async function z(e=1,t=!1){if(!s.value){w.value=[],C.value=!0;return}try{y.value=!t,b.value=t;let n=c.value.trim(),r=l.value===`ALL`?void 0:l.value,i=[];if(u.value===`ai`)i=R(await o(`/ai/record/page`,{params:{current:e,size:l9,mediaType:r||`IMAGE`,operationType:`GENERATE`}}));else if(u.value===`uploads`)i=R(await o(`/upload/file/list`,{params:{current:e,size:l9,projectId:m.value||void 0,folderId:h.value||void 0,name:n||void 0}}));else if(n&&!h.value)try{i=R(await o(`/asset/semantic/search`,{params:{query:n,assetType:r,projectId:m.value||void 0,current:e,size:l9}}))}catch{i=R(await o(`/asset/recent`,{params:{projectId:m.value||void 0,folderId:h.value||void 0,name:n,assetType:r,current:e,size:l9}}))}else i=m.value&&h.value?R(await o(`/asset/page`,{params:{projectId:m.value,folderId:h.value,name:n||void 0,current:e,size:l9}})):R(await o(`/asset/recent`,{params:{projectId:m.value||void 0,folderId:h.value||void 0,name:n||void 0,assetType:r,current:e,size:l9}}));let a=i.map(L).filter(e=>!!e).filter(e=>l.value===`IMAGE`?e.type!==`video`:l.value===`VIDEO`?e.type===`video`:n&&u.value===`ai`?e.title.toLowerCase().includes(n.toLowerCase()):!0);if(i.length<l9?C.value=!0:C.value=!1,t){let e=new Set(w.value.map(e=>e.id)),t=a.filter(t=>!e.has(t.id));w.value=[...w.value,...t]}else w.value=a;S.value=e}catch(e){console.warn(`[MyAssets] 加载个人资产异常:`,e),t||(w.value=[]),C.value=!0}finally{y.value=!1,b.value=!1}}function B(){S.value=1,C.value=!1,z(1,!1)}function V(){B()}function ee(){c.value=``,B()}function te(e){l.value!==e&&(l.value=e,B())}function ne(e){u.value!==e&&(u.value=e,B())}function re(){y.value||b.value||C.value||z(S.value+1,!0)}let H=(0,t.computed)(()=>{let e=[],t=[],n=0,r=0;return w.value.forEach((i,a)=>{let o=.85,s=Number(i.originalWidth||0),c=Number(i.originalHeight||0);s>0&&c>0?o=Math.max(.55,Math.min(1.6,c/s)):i.type===`video`?o=.65:a%3==1&&(o=1.1),n<=r?(e.push(i),n+=o):(t.push(i),r+=o)}),[e,t]});function U(){T.value?.click()}function ie(e){if(!e)return``;let t=e.data===void 0?e:e.data;if(typeof t==`string`)return t;let n=t?.data===void 0?t:t.data;return typeof n==`string`?n:n?.ossUrl||n?.fileLink||n?.fileUrl||n?.url||n?.link||t?.ossUrl||t?.fileLink||t?.fileUrl||t?.url||``}async function W(e){let t=e.target,n=t.files?Array.from(t.files):[];if(n.length!==0){x.value=!0;try{let e=d.value.find(e=>e.type===`PERSONAL`)||d.value[0],t=m.value||e?.id||``,r=0;for(let e of n){let n=e.type.startsWith(`video/`),i=new FormData;i.append(`file`,e),i.append(`path`,`/dam/media/`),i.append(`fileName`,e.name),i.append(`name`,e.name),i.append(`id`,String(Date.now())),t&&i.append(`projectId`,t),h.value&&i.append(`folderId`,h.value),i.append(`assetType`,n?`VIDEO`:`IMAGE`),ie(await o(`/upload/file`,{method:`POST`,body:i}))&&r++}r>0?(a(`已成功上传 ${r} 个素材到我的资产库`),B()):a(`上传未返回有效文件地址`)}catch(e){a(`上传素材失败: ${e.message||`网络异常`}`)}finally{x.value=!1,t.value=``}}}function ae(e){if(!_.value)return;let t=e.target;v.value&&!v.value.contains(t)&&(_.value=!1)}return(0,t.onMounted)(()=>{A(),z(1,!1),window.addEventListener(`click`,ae)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`click`,ae)}),(0,t.watch)(s,e=>{e?(A(),z(1,!1)):w.value=[]}),n({reloadAssets:B}),(e,n)=>{let r=wb;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,Jnt,[(0,t.createElementVNode)(`input`,{ref_key:`fileInputRef`,ref:T,type:`file`,multiple:``,accept:`image/*,video/*`,style:{display:`none`},onChange:W},null,544),(0,t.createElementVNode)(`div`,Ynt,[(0,t.createElementVNode)(`div`,Xnt,[(0,t.createVNode)(r,{class:`mine-search-icon`,onClick:V},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(sb))]),_:1}),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":n[0]||=e=>c.value=e,type:`text`,placeholder:`语义搜索我的资产/描述词...`,class:`mine-search-input`,onKeyup:(0,t.withKeys)(V,[`enter`])},null,544),[[t.vModelText,c.value]]),c.value?((0,t.openBlock)(),(0,t.createBlock)(r,{key:0,class:`mine-search-clear`,onClick:ee},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(By))]),_:1})):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`mine-upload-btn`,disabled:x.value,title:`上传本地图片或视频至我的资产库`,onClick:U},[x.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Qnt)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$nt,`+`)),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(x.value?`上传中`:`上传`),1)],8,Znt)]),(0,t.createElementVNode)(`div`,ert,[(0,t.createElementVNode)(`div`,{ref_key:`treeTriggerRef`,ref:v,class:`project-tree-selector-wrap`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`project-tree-trigger`,{active:_.value||m.value}]),onClick:n[1]||=(0,t.withModifiers)(e=>_.value=!_.value,[`stop`])},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`proj-dot`,{"is-filtered":!!m.value}])},null,2),(0,t.createElementVNode)(`span`,{class:`proj-label`,title:g.value},(0,t.toDisplayString)(g.value),9,trt),n[11]||=(0,t.createElementVNode)(`svg`,{class:`chevron-svg`,viewBox:`0 0 24 24`,width:`11`,height:`11`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`},[(0,t.createElementVNode)(`polyline`,{points:`6 9 12 15 18 9`})],-1)],2),(0,t.createVNode)(t.Transition,{name:`pop-fade`},{default:(0,t.withCtx)(()=>[_.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`project-tree-popover`,onClick:n[2]||=(0,t.withModifiers)(()=>{},[`stop`])},[n[16]||=(0,t.createElementVNode)(`div`,{class:`popover-section-header`},`选择项目或子文件夹`,-1),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tree-node-row all-node`,{active:!m.value&&!h.value}]),onClick:N},[...n[12]||=[(0,t.createElementVNode)(`span`,{class:`node-icon`},`🌐`,-1),(0,t.createElementVNode)(`span`,{class:`node-name`},`全部可访问资产`,-1)]],2),(0,t.createElementVNode)(`div`,nrt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d.value,(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`tree-project-block`},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tree-node-row project-node`,{active:m.value===e.id&&!h.value}]),onClick:t=>P(e)},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tree-expand-btn`,{expanded:p.value[e.id]}]),onClick:t=>M(e.id,t)},[...n[13]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`},[(0,t.createElementVNode)(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],10,irt),(0,t.createElementVNode)(`span`,{class:`project-color-sq`,style:(0,t.normalizeStyle)({backgroundColor:D(e,r)})},null,4),(0,t.createElementVNode)(`span`,art,(0,t.toDisplayString)(O(e)),1),e.type===`TEAM`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ort,`团队`)):(0,t.createCommentVNode)(``,!0)],10,rrt),p.value[e.id]?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,srt,[f.value[e.id]&&f.value[e.id].length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(f.value[e.id],r=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:r.id},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tree-node-row folder-node`,{active:h.value===r.id}]),onClick:t=>F(e,r)},[n[14]||=(0,t.createElementVNode)(`span`,{class:`folder-icon`},`📁`,-1),(0,t.createElementVNode)(`span`,lrt,(0,t.toDisplayString)(r.name),1)],10,crt),r.children&&r.children.length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(r.children,r=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:r.id,class:(0,t.normalizeClass)([`tree-node-row folder-node level-2`,{active:h.value===r.id}]),onClick:t=>F(e,r)},[n[15]||=(0,t.createElementVNode)(`span`,{class:`folder-icon`},`📁`,-1),(0,t.createElementVNode)(`span`,drt,(0,t.toDisplayString)(r.name),1)],10,urt))),128)):(0,t.createCommentVNode)(``,!0)],64))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,frt,`默认目录`))])):(0,t.createCommentVNode)(``,!0)]))),128))])])):(0,t.createCommentVNode)(``,!0)]),_:1})],512),(0,t.createElementVNode)(`div`,prt,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`media-pill`,{active:l.value===`ALL`}]),onClick:n[3]||=e=>te(`ALL`)},` 全部 `,2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`media-pill`,{active:l.value===`IMAGE`}]),onClick:n[4]||=e=>te(`IMAGE`)},` 图片 `,2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`media-pill`,{active:l.value===`VIDEO`}]),onClick:n[5]||=e=>te(`VIDEO`)},` 视频 `,2)])]),(0,t.createElementVNode)(`div`,mrt,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`mine-sub-tab`,{active:u.value===`recent`}]),onClick:n[6]||=e=>ne(`recent`)},` 最近资产 `,2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`mine-sub-tab`,{active:u.value===`ai`}]),onClick:n[7]||=e=>ne(`ai`)},` AI 创作记录 `,2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`mine-sub-tab`,{active:u.value===`uploads`}]),onClick:n[8]||=e=>ne(`uploads`)},` 已上传 `,2)]),y.value&&w.value.length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,hrt,[...n[17]||=[(0,t.createElementVNode)(`div`,{class:`loading-ring-spinner`},null,-1),(0,t.createElementVNode)(`span`,{class:`loading-tip-text`},`正在加载我的资产...`,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,grt,[w.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_rt,[(0,t.createElementVNode)(`div`,vrt,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(H.value,(e,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:a,class:`mine-masonry-col`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`mine-asset-card`,onClick:t=>i(`select`,e)},[e.type===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:e.url,muted:``,preload:`metadata`,playsinline:``,class:`mine-card-media`,onMouseenter:n[9]||=e=>e.target?.play?.(),onMouseleave:n[10]||=e=>e.target?.pause?.()},null,40,brt)):((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.previewUrl||e.url,alt:e.title,loading:`lazy`,class:`mine-card-media`},null,8,xrt)),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`mine-card-badge`,{"is-ai":e.badgeLabel===`AI 生成`,"is-video":e.type===`video`}])},(0,t.toDisplayString)(e.badgeLabel||`资产`),3),e.type===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Srt,[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(pb))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,Crt,[e.type===`video`?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`card-act-btn ref-btn`,title:`作为 AI 生图参考素材`,onClick:(0,t.withModifiers)(t=>i(`use-as-ref`,e),[`stop`])},[...n[18]||=[(0,t.createElementVNode)(`span`,null,`@参考`,-1)]],8,wrt)),(0,t.createElementVNode)(`button`,{type:`button`,class:`card-act-btn icon-btn`,title:`大图预览`,onClick:(0,t.withModifiers)(t=>i(`preview`,e,w.value,t),[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(mb))]),_:1})],8,Trt)]),(0,t.createElementVNode)(`div`,Ert,[(0,t.createElementVNode)(`span`,{class:`mine-card-title`,title:e.title},(0,t.toDisplayString)(e.title),9,Drt)])],8,yrt))),128))]))),128))]),(0,t.createElementVNode)(`div`,Ort,[b.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,krt,[...n[19]||=[(0,t.createElementVNode)(`span`,{class:`mini-spin-ring blue`},null,-1),(0,t.createElementVNode)(`span`,null,`正在加载更多...`,-1)]])):C.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Art,[...n[20]||=[(0,t.createElementVNode)(`span`,null,`— 已展示全部资产 —`,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`load-more-action-btn`,onClick:re},` 加载更多 `))])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,jrt,[n[21]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`38`,height:`38`,fill:`none`,stroke:`#cbd5e1`,"stroke-width":`1.3`},[(0,t.createElementVNode)(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`})],-1),(0,t.createElementVNode)(`p`,Mrt,(0,t.toDisplayString)(c.value?`未找到与 "${c.value}" 匹配的资产`:`当前目录下暂无资产`),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`empty-upload-cta`,onClick:U},` + 上传本地素材 `)]))]))])}}});B8();var Prt=z8(Nrt,[[`__scopeId`,`data-v-61a463d6`]]);$K(),$X(),H8(),nZ(),q5(),n9(),_b(),L8();var Frt={class:`create-material-panel`},Irt={class:`create-sub-header`},Lrt={class:`mode-segmented-box`},Rrt={class:`create-scroll-body`},zrt={class:`control-block`},Brt={class:`model-left-info`},Vrt={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`currentColor`},Hrt={key:1,viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},Urt={class:`model-name-text`},Wrt={key:0,class:`model-dropdown-menu`},Grt=[`onClick`],Krt={class:`opt-top-line`},qrt={class:`opt-code`},Jrt={key:0,class:`opt-tag`},Yrt={key:0,class:`opt-sub-desc`},Xrt=[`onClick`],Zrt={class:`opt-top-line`},Qrt={class:`opt-code`},$rt={class:`opt-tag video`},eit={class:`opt-sub-desc`},tit={key:0,class:`control-block`},nit={class:`block-header-line`},rit={class:`ref-counter`},iit={class:`ref-tiles-grid`},ait=[`title`,`onClick`],oit=[`src`,`alt`],sit={class:`thumb-tag`},cit=[`onClick`],lit={key:1,class:`control-block`},uit={class:`video-frames-grid`},dit=[`src`],fit=[`src`],pit={class:`picker-top-bar`},mit={class:`picker-title`},hit={class:`picker-quick-btns`},git=[`disabled`],_it={class:`picker-thumbs-row`},vit=[`onClick`],yit=[`src`,`alt`],bit={key:1,class:`picker-empty-tip`},xit={key:2,class:`picker-thumbs-row`},Sit=[`onClick`],Cit=[`src`,`alt`],wit={key:3,class:`picker-empty-tip`},Tit={class:`control-block`},Eit={class:`prompt-card-box`},Dit=[`placeholder`],Oit={class:`prompt-bottom-toolbar`},kit={class:`icon-pop-anchor`},Ait={key:0,class:`mini-floating-popover`},jit={class:`pop-row-between`},Mit={class:`icon-pop-anchor`},Nit={key:0,class:`mini-floating-popover tags-pop`},Pit={class:`quick-tags-wrap`},Fit=[`onClick`],Iit={class:`stepper-pill`},Lit={class:`step-num`},Rit={class:`param-pill-anchor`},zit={key:0,class:`pill-dropdown-menu`},Bit=[`onClick`],Vit={class:`muted-sub`},Hit={class:`param-pill-anchor`},Uit={key:0,class:`pill-dropdown-menu right`},Wit=[`onClick`],Git={class:`param-pill-anchor`},Kit={key:0,class:`pill-dropdown-menu`},qit=[`onClick`],Jit={class:`param-pill-anchor`},Yit={key:0,class:`pill-dropdown-menu`},Xit=[`onClick`],Zit={class:`generate-cta-wrap`},Qit=[`disabled`],$it={class:`cta-text`},eat={key:0,class:`cta-spinner`},tat={key:1,class:`sparkle-icon`,viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`},nat={key:4,class:`generated-results-section`},rat={class:`results-header`},iat={class:`results-title`},aat={class:`results-grid`},oat=[`onClick`],sat=[`src`],cat=[`src`,`alt`],lat={key:2,class:`video-badge`},uat={class:`result-overlay`},dat=[`onClick`],fat=[`onClick`],pat=(0,t.defineComponent)({__name:`CreateMaterialPanel`,emits:[`select`,`preview`,`generated`],setup(e,{expose:n,emit:r}){let i=[{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义千问`,model:`qwen-image-3.0`,displayName:`通义千问生图 3.0`,description:`新一代真实感高画质生图模型,擅长版面布局与极清文字渲染`,size:`1328*1328`,recommendedSizes:[`1328*1328`,`1024*1024`,`1280*720`,`720*1280`],supportsRefImage:!0,isDefault:!0},{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义千问`,model:`qwen-image-3.0-pro`,displayName:`通义千问生图 3.0 Pro`,description:`专业级画质生图大模型,提供摄影级光影与高保真质感`,size:`1328*1328`,recommendedSizes:[`1328*1328`,`1024*1024`,`1280*720`,`720*1280`],supportsRefImage:!0,isDefault:!1},{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义千问`,model:`qwen-image-max`,displayName:`通义千问生图 Max`,description:`旗舰级多模态文生图模型,色彩绚丽生动,适合商业海报与插画`,size:`1328*1328`,recommendedSizes:[`1328*1328`,`1024*1024`,`1280*720`,`720*1280`],supportsRefImage:!0,isDefault:!1},{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义万相`,model:`wan2.7-image`,displayName:`通义万相 2.7 图像生成`,description:`万相 2.7 旗舰文生图模型,构图与光影细节极佳`,size:`1024*1024`,recommendedSizes:[`1024*1024`,`1280*720`,`720*1280`,`1024*768`,`768*1024`],supportsRefImage:!1,isDefault:!1},{provider:`DASHSCOPE`,providerName:`阿里百炼`,vendor:`通义万相`,model:`wanx2.1-t2i-turbo`,displayName:`通义万相 2.1 Turbo`,description:`极速出图模型,适合高频概念预览与灵感探索`,size:`1024*1024`,recommendedSizes:[`1024*1024`,`1280*720`,`720*1280`],supportsRefImage:!1,isDefault:!1}],a=[{model:`wanx2.1-i2v-plus`,displayName:`通义万相 2.1 视频增强版`,vendor:`通义万相`},{model:`Wan 3.0`,displayName:`通义万相 Wan 3.0 视频生成`,vendor:`通义万相`},{model:`Seedance 2.5`,displayName:`Seedance 2.5 动态视频`,vendor:`ByteDance`},{model:`Kling 3.0`,displayName:`可灵 Kling 3.0 高清视频`,vendor:`Kling`},{model:`MiniMax H3`,displayName:`海螺 MiniMax H3 视频`,vendor:`MiniMax`}],o=[`电影级光影`,`3D 磨砂玻璃`,`极简留白构图`,`赛博朋克霓虹`,`柔和体积光`,`扁平矢量插画`,`8K 超清细节`,`等轴测微缩景观`],s=[{id:`style-3d`,name:`3D 玻璃质感`,url:`https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=400&auto=format&fit=crop&q=80`},{id:`style-cyber`,name:`流光科技感`,url:`https://images.unsplash.com/photo-1550745165-9bc0b252726f?w=400&auto=format&fit=crop&q=80`},{id:`style-minimal`,name:`极简建筑光影`,url:`https://images.unsplash.com/photo-1513694203232-719a280e022f?w=400&auto=format&fit=crop&q=80`},{id:`style-art`,name:`暖调商业插画`,url:`https://images.unsplash.com/photo-1579783902614-a3fb3927b675?w=400&auto=format&fit=crop&q=80`}],c=r,{notify:l,activeSlide:u,selectedElementId:d,placeholderMaterialTargetId:f,resolveActivePlaceholderTargetId:p}=e6(),m=(0,t.computed)(()=>d?.value&&u?.value?.elements?.find(e=>e.id===d.value)||null),h=(0,t.computed)(()=>!!(p&&p()||f?.value||typeof window<`u`&&window.__jvsPlaceholderTargetId)),{damFetchJson:g,isDamLoggedIn:_}=c9(),v=(0,t.ref)(`image`),y=(0,t.ref)([...i]),b=(0,t.ref)(`qwen-image-3.0`),x=(0,t.ref)(`wanx2.1-i2v-plus`),S=(0,t.ref)(!1),C=(0,t.ref)(!1),w=(0,t.ref)([]),T=(0,t.ref)(null),E=(0,t.ref)(null),D=(0,t.ref)(!1),O=(0,t.ref)(`add`),k=(0,t.ref)([]),A=(0,t.ref)(!1),j=(0,t.ref)(null),M=(0,t.ref)(!1),N=(0,t.ref)(``),P=(0,t.ref)(!0),F=(0,t.ref)(!1),I=(0,t.ref)(!1),L=(0,t.ref)(!1),R=(0,t.ref)(!1),z=(0,t.ref)(``),B=(0,t.ref)(1),V=(0,t.ref)(`1:1`),ee=(0,t.ref)(`1K · High`),te=(0,t.ref)(!1),ne=(0,t.ref)(!1),re=(0,t.ref)(`5-6"`),H=(0,t.ref)(`16:9`),U=(0,t.ref)(!0),ie=(0,t.ref)(!1),W=(0,t.ref)(!1),ae=(0,t.ref)(!1),G=(0,t.ref)(void 0),oe=(0,t.ref)([]),se=(0,t.computed)(()=>y.value.find(e=>e.model===b.value)||y.value[0]||i[0]),ce=(0,t.computed)(()=>b.value.toLowerCase().includes(`wan`)),le=(0,t.computed)(()=>{let e=m.value;return e&&e.type===`image`&&(e.src||e.url)?String(e.src||e.url):``});function ue(e,t){let n=t.startsWith(`2K`);switch(e){case`1:1`:return n?`1440*1440`:b.value.startsWith(`qwen`)?`1328*1328`:`1024*1024`;case`16:9`:return n?`1920*1080`:`1280*720`;case`9:16`:return n?`1080*1920`:`720*1280`;case`4:3`:return n?`1440*1080`:`1024*768`;case`3:4`:return n?`1080*1440`:`768*1024`;default:return`1024*1024`}}async function de(){if(_.value)try{let e=await g(`/image/generate/models`),t=[];if(Array.isArray(e)?t=e:Array.isArray(e?.data?.data)?t=e.data.data:Array.isArray(e?.data)&&(t=e.data),t.length>0&&(y.value=t,!t.some(e=>e.model===b.value))){let e=t.find(e=>e.isDefault)||t[0];e&&(b.value=e.model)}}catch{}}function fe(){S.value=!1,C.value=!1,I.value=!1,L.value=!1,te.value=!1,ne.value=!1,ie.value=!1,W.value=!1}function pe(e){v.value===`image`?b.value=e:x.value=e,S.value=!1}function me(e){let t=N.value.trim();N.value=t?`${t},${e}`:e,L.value=!1}function he(){z.value=N.value,R.value=!0}function ge(){N.value=z.value,R.value=!1}async function _e(e){if(fe(),O.value=e,D.value=!0,k.value.length===0&&_.value){A.value=!0;try{let e=await g(`/asset/recent`,{params:{current:1,size:12,assetType:`IMAGE`}});k.value=(Array.isArray(e?.data?.records)?e.data.records:Array.isArray(e?.data)?e.data:[]).map(e=>{let t=e.fileUrl||e.imageUrl||e.url||e.previewUrl||``;return t?{id:String(e.id||Math.random()),title:e.name||`我的资产`,url:t,previewUrl:t}:null}).filter(e=>!!e)}catch{k.value=[]}finally{A.value=!1}}}function ve(e){if(!e.url)return;if(O.value===`video-start`&&D.value){T.value={id:e.id||`vstart-${Date.now()}`,name:e.name||`起始帧`,url:e.url,type:`add`,assetId:e.assetId},D.value=!1;return}if(O.value===`video-end`&&D.value){E.value={id:e.id||`vend-${Date.now()}`,name:e.name||`结束帧`,url:e.url,type:`add`,assetId:e.assetId},D.value=!1;return}if(w.value.length>=8){l(`参考素材最多支持添加 8 张`);return}if(w.value.some(t=>t.url===e.url)){l(`该参考图已在列表中`),D.value=!1;return}let t=e.type||(O.value===`style`||O.value===`character`?O.value:`add`),n=w.value.length+1;w.value.push({id:e.id||`ref-${Date.now()}-${n}`,name:e.name||(t===`style`?`风格参考-${n}`:t===`character`?`角色参考-${n}`:`参考图-${n}`),url:e.url,type:t,assetId:e.assetId||e.id,assetType:`IMAGE`,sourceType:e.sourceType||(t===`style`?`REFERENCE`:`UPLOAD`)}),D.value=!1}function ye(e){w.value=w.value.filter(t=>t.id!==e)}function be(e){let t=`@img${e+1} `;N.value.includes(`@img${e+1}`)||(N.value=(N.value?N.value+` `:``)+t)}async function xe(e){let t=e.target,n=t.files?.[0];if(t.value=``,n){M.value=!0;try{let e=new FormData;e.append(`file`,n),e.append(`path`,`/dam/media/`),e.append(`fileName`,n.name),e.append(`id`,String(Date.now())),e.append(`assetType`,`IMAGE`);let t=await g(`/upload/file`,{method:`POST`,body:e}),r=t?.data===void 0?t:t.data,i=r?.data===void 0?r:r.data,a=i?.ossUrl||i?.fileLink||i?.fileUrl||i?.url||r?.ossUrl||r?.fileLink||r?.fileUrl||r?.url||``;a?(ve({name:n.name,url:a,sourceType:`UPLOAD`}),l(`参考图上传成功`)):l(`上传未返回有效图片地址`)}catch(e){l(`上传参考图失败: ${e.message||`网络异常`}`)}finally{M.value=!1}}}async function Se(){let e=N.value.trim();if(!e){l(v.value===`image`?`请输入您想要生成的画面描述提示词`:`请输入视频画面与运镜描述提示词`);return}if(v.value===`image`){let t=se.value;if(w.value.length>0&&t&&t.supportsRefImage===!1){l(`当前模型【${b.value}】不支持参考图,请切换为 qwen-image-3.0 或移除参考素材`);return}ae.value=!0;try{let n=ue(V.value,ee.value),[r,i]=n.split(`*`),a=P.value?`${e},高细节,大师级构图,光影质感极佳`:e,o=w.value.map((e,t)=>({assetId:e.assetId||e.id||`ref_${Date.now()}_${t}`,url:e.url,assetType:`IMAGE`,sourceType:e.sourceType||`UPLOAD`})),s={sessionId:G.value,prompt:a,size:n,model:b.value,provider:t?.provider||`DASHSCOPE`,refStrength:.65,...o.length>0?{refImages:o,refImageUrls:o.map(e=>e.url)}:{}},u=await g(`/image/generate`,{method:`POST`,body:JSON.stringify(s)}),d=u?.data?.data||u?.data||u,f=u?.code??u?.data?.code??0;if((f===0||f===200)&&d){d.sessionId&&(G.value=d.sessionId);let t=Array.isArray(d.imageUrls)&&d.imageUrls.length>0?d.imageUrls:d.imageUrl?[d.imageUrl]:[];if(t.length>0)t.forEach((t,n)=>{let a={id:d.recordId?`${d.recordId}_${n}`:`gen-${Date.now()}-${n}`,title:e,type:`image`,assetType:`IMAGE`,sourceType:`GENERATE`,badgeLabel:`AI 生成`,url:t,previewUrl:t,sourceUrl:t,originalWidth:Number(r)||1024,originalHeight:Number(i)||1024,model:d.model||b.value};oe.value.unshift(a),c(`generated`,a)}),l(`图片生成成功!点击下方卡片即可插入画布`);else throw Error(u?.msg||`未返回有效图片地址`)}else throw Error(u?.msg||`生成图片失败`)}catch(e){l(`图片生成失败: ${e.message||`请检查网络或服务配置`}`)}finally{ae.value=!1}}else{ae.value=!0;try{let t={prompt:U.value?`${e},电影级平滑运镜`:e,model:x.value,aspectRatio:H.value,duration:re.value===`10"`?10:5,startImageUrl:T.value?.url||void 0,endImageUrl:E.value?.url||void 0},n=await g(`/video/generate`,{method:`POST`,body:JSON.stringify(t)}),r=n?.data?.data||n?.data||n,i=r?.videoUrl||r?.fileUrl||r?.url||``;if(i){let t={id:r?.recordId||`vid-${Date.now()}`,title:e,type:`video`,assetType:`VIDEO`,sourceType:`GENERATE`,badgeLabel:`AI 视频`,url:i,previewUrl:i,sourceUrl:i,originalWidth:H.value===`9:16`?720:1280,originalHeight:H.value===`9:16`?1280:720,model:x.value};oe.value.unshift(t),c(`generated`,t),l(`视频生成成功!点击卡片即可插入画布`)}else throw Error(n?.msg||`视频生成任务已提交或暂未返回直链,请稍后在「我的素材 - AI创作记录」中查看`)}catch(e){l(e.message||`视频生成服务暂未就绪`)}finally{ae.value=!1}}}return(0,t.onMounted)(()=>{de(),window.addEventListener(`click`,fe)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`click`,fe)}),n({addReferenceItem:ve,switchCreateMode:e=>{e!==`video`&&(v.value=e)}}),(e,n)=>{let r=wb,i=rw,l=UE,u=XB;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,Frt,[(0,t.createElementVNode)(`input`,{ref_key:`refFileInputRef`,ref:j,type:`file`,accept:`image/*`,style:{display:`none`},onChange:xe},null,544),(0,t.createElementVNode)(`div`,Irt,[(0,t.createElementVNode)(`div`,Lrt,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`mode-seg-btn`,{active:v.value===`image`}]),onClick:n[0]||=e=>v.value=`image`},[...n[35]||=[(0,t.createElementVNode)(`span`,null,`图片生成器`,-1)]],2),n[36]||=(0,t.createElementVNode)(`button`,{type:`button`,class:`mode-seg-btn is-disabled`,disabled:``,title:`视频生成功能暂未开放`},[(0,t.createElementVNode)(`span`,null,`视频生成`)],-1)])]),(0,t.createElementVNode)(`div`,Rrt,[(0,t.createElementVNode)(`div`,zrt,[n[40]||=(0,t.createElementVNode)(`label`,{class:`block-label`},`模型选择`,-1),(0,t.createElementVNode)(`div`,{class:`model-select-wrap`,onClick:n[2]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`button`,{type:`button`,class:`model-dropdown-trigger`,onClick:n[1]||=e=>S.value=!S.value},[(0,t.createElementVNode)(`div`,Brt,[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`model-brand-cube`,{"is-video":v.value===`video`,"is-wanx":v.value===`image`&&ce.value}])},[v.value===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Vrt,[...n[37]||=[(0,t.createElementVNode)(`polygon`,{points:`6 4 20 12 6 20 6 4`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Hrt,[...n[38]||=[(0,t.createElementVNode)(`path`,{d:`M12 2L3 7v10l9 5 9-5V7l-9-5z`},null,-1)]]))],2),(0,t.createElementVNode)(`span`,Urt,(0,t.toDisplayString)(v.value===`image`?b.value:x.value),1)]),n[39]||=(0,t.createElementVNode)(`svg`,{class:`chevron-icon`,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,t.createElementVNode)(`polyline`,{points:`6 9 12 15 18 9`})],-1)]),(0,t.createVNode)(t.Transition,{name:`pop-fade`},{default:(0,t.withCtx)(()=>[S.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Wrt,[v.value===`image`?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(y.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.model,class:(0,t.normalizeClass)([`model-option-item`,{active:e.model===b.value}]),onClick:t=>pe(e.model)},[(0,t.createElementVNode)(`div`,Krt,[(0,t.createElementVNode)(`span`,qrt,(0,t.toDisplayString)(e.model),1),e.supportsRefImage?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Jrt,`支持参考图`)):(0,t.createCommentVNode)(``,!0)]),e.displayName||e.description?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Yrt,(0,t.toDisplayString)(e.displayName||e.description),1)):(0,t.createCommentVNode)(``,!0)],10,Grt))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(a,e=>(0,t.createElementVNode)(`div`,{key:e.model,class:(0,t.normalizeClass)([`model-option-item`,{active:e.model===x.value}]),onClick:t=>pe(e.model)},[(0,t.createElementVNode)(`div`,Zrt,[(0,t.createElementVNode)(`span`,Qrt,(0,t.toDisplayString)(e.model),1),(0,t.createElementVNode)(`span`,$rt,(0,t.toDisplayString)(e.vendor),1)]),(0,t.createElementVNode)(`div`,eit,(0,t.toDisplayString)(e.displayName),1)],10,Xrt)),64))])):(0,t.createCommentVNode)(``,!0)]),_:1})])]),v.value===`image`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,tit,[(0,t.createElementVNode)(`div`,nit,[n[41]||=(0,t.createElementVNode)(`label`,{class:`block-label`},`参考素材`,-1),(0,t.createElementVNode)(`span`,rit,(0,t.toDisplayString)(w.value.length)+`/8`,1)]),(0,t.createElementVNode)(`div`,iit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`ref-action-tile`,onClick:n[3]||=(0,t.withModifiers)(e=>_e(`style`),[`stop`])},[...n[42]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`17`,height:`17`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})],-1),(0,t.createElementVNode)(`span`,{class:`tile-label`},`风格参考`,-1)]]),(0,t.createElementVNode)(`button`,{type:`button`,class:`ref-action-tile`,onClick:n[4]||=(0,t.withModifiers)(e=>_e(`character`),[`stop`])},[...n[43]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`17`,height:`17`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2`}),(0,t.createElementVNode)(`circle`,{cx:`12`,cy:`7`,r:`4`})],-1),(0,t.createElementVNode)(`span`,{class:`tile-label`},`角色参考`,-1)]]),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(w.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`ref-added-thumb`,title:`点击在提示词中引用 @img${n+1}`,onClick:e=>be(n)},[(0,t.createElementVNode)(`img`,{src:e.url,alt:e.name,class:`thumb-img`},null,8,oit),(0,t.createElementVNode)(`span`,sit,[e.type===`style`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createTextVNode)(`★`)],64)):(0,t.createCommentVNode)(``,!0),(0,t.createTextVNode)(` @img`+(0,t.toDisplayString)(n+1),1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`thumb-remove-btn`,title:`移除参考图`,onClick:(0,t.withModifiers)(t=>ye(e.id),[`stop`])},` × `,8,cit)],8,ait))),128)),w.value.length<8?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`ref-action-tile`,onClick:n[5]||=(0,t.withModifiers)(e=>_e(`add`),[`stop`])},[...n[44]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`17`,height:`17`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,t.createElementVNode)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1),(0,t.createElementVNode)(`span`,{class:`tile-label`},`添加素材`,-1)]])):(0,t.createCommentVNode)(``,!0)])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lit,[n[51]||=(0,t.createElementVNode)(`div`,{class:`block-header-line`},[(0,t.createElementVNode)(`label`,{class:`block-label`},`参考素材 (首尾帧)`)],-1),(0,t.createElementVNode)(`div`,uit,[(0,t.createElementVNode)(`div`,{class:`video-frame-slot`,onClick:n[7]||=(0,t.withModifiers)(e=>_e(`video-start`),[`stop`])},[T.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`img`,{src:T.value.url,class:`slot-preview-img`},null,8,dit),n[45]||=(0,t.createElementVNode)(`span`,{class:`slot-tag`},`起始帧`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`slot-clear-btn`,onClick:n[6]||=(0,t.withModifiers)(e=>T.value=null,[`stop`])},`×`)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[n[46]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[(0,t.createElementVNode)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),(0,t.createElementVNode)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,t.createElementVNode)(`polyline`,{points:`21 15 16 10 5 21`})],-1),n[47]||=(0,t.createElementVNode)(`span`,null,`起始帧 (可选)`,-1)],64))]),(0,t.createElementVNode)(`div`,{class:`video-frame-slot`,onClick:n[9]||=(0,t.withModifiers)(e=>_e(`video-end`),[`stop`])},[E.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`img`,{src:E.value.url,class:`slot-preview-img`},null,8,fit),n[48]||=(0,t.createElementVNode)(`span`,{class:`slot-tag`},`结束帧`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`slot-clear-btn`,onClick:n[8]||=(0,t.withModifiers)(e=>E.value=null,[`stop`])},`×`)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[n[49]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[(0,t.createElementVNode)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),(0,t.createElementVNode)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,t.createElementVNode)(`polyline`,{points:`21 15 16 10 5 21`})],-1),n[50]||=(0,t.createElementVNode)(`span`,null,`结束帧 (可选)`,-1)],64))])])])),(0,t.createVNode)(t.Transition,{name:`pop-fade`},{default:(0,t.withCtx)(()=>[D.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`ref-picker-drawer-card`,onClick:n[13]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,pit,[(0,t.createElementVNode)(`span`,mit,(0,t.toDisplayString)(O.value===`style`?`选择风格参考`:O.value===`character`?`选择角色参考`:`添加参考素材`),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`picker-close`,onClick:n[10]||=e=>D.value=!1},`×`)]),(0,t.createElementVNode)(`div`,hit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`picker-action-btn primary`,disabled:M.value,onClick:n[11]||=e=>j.value?.click()},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(M.value?`上传中...`:`+ 本地上传图片`),1)],8,git),le.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`picker-action-btn canvas-pick`,onClick:n[12]||=e=>ve({name:`画布选中图`,url:le.value,sourceType:`REFERENCE`})},[...n[52]||=[(0,t.createElementVNode)(`span`,null,`拾取画布选中图`,-1)]])):(0,t.createCommentVNode)(``,!0)]),O.value===`style`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[n[53]||=(0,t.createElementVNode)(`div`,{class:`picker-sub-label`},`预设视觉风格`,-1),(0,t.createElementVNode)(`div`,_it,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s,e=>(0,t.createElementVNode)(`div`,{key:e.id,class:`picker-mini-card`,onClick:t=>ve({id:e.id,name:e.name,url:e.url,type:`style`,sourceType:`REFERENCE`})},[(0,t.createElementVNode)(`img`,{src:e.url,alt:e.name},null,8,yit),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.name),1)],8,vit)),64))])],64)):(0,t.createCommentVNode)(``,!0),n[54]||=(0,t.createElementVNode)(`div`,{class:`picker-sub-label`},`从我的资产选择`,-1),A.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bit,`正在加载最近资产...`)):k.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xit,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(k.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`picker-mini-card`,onClick:t=>ve({id:String(e.id),name:e.title,url:e.url||``,assetId:String(e.id)})},[(0,t.createElementVNode)(`img`,{src:e.previewUrl||e.url,alt:e.title},null,8,Cit),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)],8,Sit))),128))])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wit,`暂无历史图片,请点击上方「本地上传图片」`))])):(0,t.createCommentVNode)(``,!0)]),_:1}),(0,t.createElementVNode)(`div`,Tit,[n[64]||=(0,t.createElementVNode)(`label`,{class:`block-label`},`提示词描述`,-1),(0,t.createElementVNode)(`div`,Eit,[(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":n[14]||=e=>N.value=e,rows:`4`,class:`prompt-textarea`,placeholder:v.value===`image`?`描述您想要生成的画面—可输入 @ 引入参考图`:`描述您想要生成的视频画面与镜头运动...`},null,8,Dit),[[t.vModelText,N.value]]),(0,t.createElementVNode)(`div`,Oit,[(0,t.createElementVNode)(`div`,{class:`ai-enhance-switch`,onClick:n[15]||=e=>v.value===`image`?P.value=!P.value:U.value=!U.value},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`switch-track`,{"is-on":v.value===`image`?P.value:U.value}])},[...n[55]||=[(0,t.createElementVNode)(`span`,{class:`switch-thumb`},null,-1)]],2),n[56]||=(0,t.createElementVNode)(`span`,{class:`switch-label`},`AI 提示词增强`,-1)]),(0,t.createElementVNode)(`div`,{class:`prompt-right-icons`,onClick:n[20]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,kit,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tool-icon-btn`,{active:F.value||I.value}]),title:`固定随机种子`,onClick:n[16]||=e=>{I.value=!I.value,L.value=!1}},[...n[57]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.9`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M12 22v-8`}),(0,t.createElementVNode)(`path`,{d:`M12 14c-4 0-7-3-7-7 0 0 3 0 7 3`}),(0,t.createElementVNode)(`path`,{d:`M12 14c4 0 7-3 7-7 0 0-3 0-7 3`})],-1)]],2),I.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ait,[(0,t.createElementVNode)(`div`,jit,[n[58]||=(0,t.createElementVNode)(`span`,null,`固定随机种子 (Seed)`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":n[17]||=e=>F.value=e,type:`checkbox`},null,512),[[t.vModelCheckbox,F.value]])]),n[59]||=(0,t.createElementVNode)(`p`,{class:`pop-muted-tip`},`开启后保持多次生成构图一致`,-1)])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,Mit,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tool-icon-btn`,{active:L.value}]),title:`插入常用修饰词`,onClick:n[18]||=e=>{L.value=!L.value,I.value=!1}},[...n[60]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.9`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z`}),(0,t.createElementVNode)(`line`,{x1:`7`,y1:`7`,x2:`7.01`,y2:`7`})],-1)]],2),L.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Nit,[n[61]||=(0,t.createElementVNode)(`div`,{class:`pop-card-title`},`点击追加风格词`,-1),(0,t.createElementVNode)(`div`,Pit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o,e=>(0,t.createElementVNode)(`span`,{key:e,class:`quick-tag-chip`,onClick:t=>me(e)},` + `+(0,t.toDisplayString)(e),9,Fit)),64))])])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`tool-icon-btn`,title:`展开编辑提示词`,onClick:he},[...n[62]||=[(0,t.createStaticVNode)(`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" data-v-e93b0081><polyline points="15 3 21 3 21 9" data-v-e93b0081></polyline><polyline points="9 21 3 21 3 15" data-v-e93b0081></polyline><line x1="21" y1="3" x2="14" y2="10" data-v-e93b0081></line><line x1="3" y1="21" x2="10" y2="14" data-v-e93b0081></line></svg>`,1)]]),(0,t.createElementVNode)(`button`,{type:`button`,class:`tool-icon-btn`,title:`清空提示词`,onClick:n[19]||=e=>N.value=``},[...n[63]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.9`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,t.createElementVNode)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]])])])])]),v.value===`image`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`params-pills-row`,onClick:n[25]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,Iit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`step-btn`,onClick:n[21]||=e=>B.value=Math.max(1,B.value-1)},`-`),(0,t.createElementVNode)(`span`,Lit,(0,t.toDisplayString)(B.value),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`step-btn`,onClick:n[22]||=e=>B.value=Math.min(4,B.value+1)},`+`)]),(0,t.createElementVNode)(`div`,Rit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`param-select-pill`,onClick:n[23]||=e=>{te.value=!te.value,ne.value=!1}},[n[65]||=(0,t.createElementVNode)(`span`,{class:`ratio-rect-icon`},null,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(V.value),1)]),te.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,zit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([`1:1`,`16:9`,`9:16`,`4:3`,`3:4`],e=>(0,t.createElementVNode)(`div`,{key:e,class:(0,t.normalizeClass)([`pill-menu-item`,{active:V.value===e}]),onClick:t=>{V.value=e,te.value=!1}},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e),1),(0,t.createElementVNode)(`span`,Vit,(0,t.toDisplayString)(ue(e,ee.value)),1)],10,Bit)),64))])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,Hit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`param-select-pill`,onClick:n[24]||=e=>{ne.value=!ne.value,te.value=!1}},[n[66]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,t.createElementVNode)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,t.createElementVNode)(`path`,{d:`M16 2v4M8 2v4`})],-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(ee.value),1)]),ne.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Uit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([`1K · High`,`1K · Fast`,`2K · HD`],e=>(0,t.createElementVNode)(`div`,{key:e,class:(0,t.normalizeClass)([`pill-menu-item`,{active:ee.value===e}]),onClick:t=>{ee.value=e,ne.value=!1}},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e),1)],10,Wit)),64))])):(0,t.createCommentVNode)(``,!0)])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:`params-pills-row`,onClick:n[29]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,Git,[(0,t.createElementVNode)(`button`,{type:`button`,class:`param-select-pill`,onClick:n[26]||=e=>{ie.value=!ie.value,W.value=!1}},[n[67]||=(0,t.createElementVNode)(`span`,null,`⏱`,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(re.value),1)]),ie.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Kit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([`5-6"`,`10"`],e=>(0,t.createElementVNode)(`div`,{key:e,class:(0,t.normalizeClass)([`pill-menu-item`,{active:re.value===e}]),onClick:t=>{re.value=e,ie.value=!1}},[(0,t.createElementVNode)(`span`,null,`时长 `+(0,t.toDisplayString)(e),1)],10,qit)),64))])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,Jit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`param-select-pill`,onClick:n[27]||=e=>{W.value=!W.value,ie.value=!1}},[n[68]||=(0,t.createElementVNode)(`span`,{class:`ratio-rect-icon wide`},null,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(H.value),1)]),W.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Yit,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)([`16:9`,`9:16`,`1:1`],e=>(0,t.createElementVNode)(`div`,{key:e,class:(0,t.normalizeClass)([`pill-menu-item`,{active:H.value===e}]),onClick:t=>{H.value=e,W.value=!1}},[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e),1)],10,Xit)),64))])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`param-select-pill`,{"is-active-blue":U.value}]),onClick:n[28]||=e=>U.value=!U.value},[n[69]||=(0,t.createElementVNode)(`span`,null,`⚡`,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(U.value?`运镜 ON`:`运镜 OFF`),1)],2)])),(0,t.createElementVNode)(`div`,Zit,[(0,t.createElementVNode)(`button`,{type:`button`,class:`start-generate-btn`,disabled:ae.value,onClick:Se},[(0,t.createElementVNode)(`span`,$it,(0,t.toDisplayString)(ae.value?`正在生成中...`:`开始生成`),1),ae.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,eat)):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,tat,[...n[70]||=[(0,t.createElementVNode)(`path`,{d:`M19 2.5C19 4.7 20.3 6.5 22.5 6.5C20.3 6.5 19 8.3 19 10.5C19 8.3 17.7 6.5 15.5 6.5C17.7 6.5 19 4.7 19 2.5Z`},null,-1),(0,t.createElementVNode)(`path`,{d:`M11.5 12C11.5 13.3 12.7 14.5 14 14.5C12.7 14.5 11.5 15.7 11.5 17C11.5 15.7 10.3 14.5 9 14.5C10.3 14.5 11.5 13.3 11.5 12Z`},null,-1)]]))],8,Qit)]),oe.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nat,[(0,t.createElementVNode)(`div`,rat,[(0,t.createElementVNode)(`span`,iat,`本次生成结果 (`+(0,t.toDisplayString)(oe.value.length)+`)`,1),n[71]||=(0,t.createElementVNode)(`span`,{class:`results-sub`},`已同步至「我的素材」`,-1)]),(0,t.createElementVNode)(`div`,aat,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(oe.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`result-card`,onClick:t=>c(`select`,e)},[e.type===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:e.url,muted:``,playsinline:``,class:`result-media`,onMouseenter:n[30]||=e=>e.target?.play?.(),onMouseleave:n[31]||=e=>e.target?.pause?.()},null,40,sat)):((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.url,alt:e.title,class:`result-media`},null,8,cat)),e.type===`video`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,lat,[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(pb))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,uat,[(0,t.createElementVNode)(`button`,{type:`button`,class:`res-act-btn insert`,onClick:(0,t.withModifiers)(t=>c(`select`,e),[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(nb))]),_:1}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(h.value?`插入占位符`:`插入画布`),1)],8,dat),(0,t.createElementVNode)(`button`,{type:`button`,class:`res-act-btn preview`,title:`大图预览`,onClick:(0,t.withModifiers)(t=>c(`preview`,e,oe.value,t),[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(mb))]),_:1})],8,fat)])],8,oat))),128))])])):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(u,{modelValue:R.value,"onUpdate:modelValue":n[34]||=e=>R.value=e,title:`编辑提示词描述`,width:`460px`,"append-to-body":``,"align-center":``},{footer:(0,t.withCtx)(()=>[(0,t.createVNode)(l,{size:`small`,onClick:n[33]||=e=>R.value=!1},{default:(0,t.withCtx)(()=>[...n[72]||=[(0,t.createTextVNode)(`取消`,-1)]]),_:1}),(0,t.createVNode)(l,{type:`primary`,size:`small`,onClick:ge},{default:(0,t.withCtx)(()=>[...n[73]||=[(0,t.createTextVNode)(`应用提示词`,-1)]]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createVNode)(i,{modelValue:z.value,"onUpdate:modelValue":n[32]||=e=>z.value=e,type:`textarea`,rows:6,placeholder:`详细描述画面主体、光影氛围、构图风格与细节...`},null,8,[`modelValue`])]),_:1},8,[`modelValue`])])}}});B8();var mat=z8(pat,[[`__scopeId`,`data-v-e93b0081`]]);$K(),$X(),n9(),_b(),L8(),RQ();var hat={class:`material-drawer-container`},gat={key:0,class:`guest-auth-toast`},_at={class:`material-drawer-header`},vat={key:0,class:`drawer-header-left`},yat={class:`drawer-header-title`},bat={key:0,class:`material-top-tabs-wrap`},xat={class:`material-top-segmented`},Sat=[`title`],Cat={key:0,class:`tab-ai-spark`},wat={key:1,class:`tab-lock-svg`,viewBox:`0 0 24 24`,width:`11`,height:`11`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`},Tat=[`title`],Eat={key:0,class:`tab-lock-svg`,viewBox:`0 0 24 24`,width:`11`,height:`11`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`},Dat={key:0,class:`material-overview-body`},Oat={class:`overview-search-wrap`},kat={class:`overview-search-box`},Aat={class:`overview-sections-scroll`},jat={class:`section-header-row`},Mat={class:`section-cat-title`},Nat=[`onClick`],Pat={class:`section-carousel-container`},Fat=[`onScroll`],Iat=[`onClick`],Lat=[`src`,`onLoadeddata`],Rat=[`src`,`alt`,`onLoad`],zat={key:2,class:`video-badge-icon`},Bat=[`onClick`],Vat=[`onClick`],Hat=[`onClick`],Uat=[`onClick`],Wat={key:1,class:`material-detail-body`},Gat={class:`detail-tags-bar-wrap`},Kat=[`onClick`],qat={key:0,class:`gallery-loading-box`},Jat={class:`loading-tip-text`},Yat={key:1,class:`detail-waterfall-scroll`},Xat={key:0,class:`detail-masonry-wrapper`},Zat={class:`detail-masonry-columns`},Qat=[`onClick`],$at=[`src`],eot=[`src`,`alt`],tot={key:2,class:`detail-card-placeholder`},not={key:3,class:`video-badge-icon`},rot=[`onClick`],iot=[`onClick`],aot={class:`waterfall-footer-status`},oot={key:0,class:`loading-more-row`},sot={key:1,class:`load-failed-row`},cot={key:3,class:`all-loaded-divider`},lot={key:1,class:`gallery-empty-state`},uot={class:`empty-title`},dot={class:`preview-header-bar`},fot={class:`preview-title-wrap`},pot={class:`preview-format-pill`},mot={class:`preview-title-text`},hot=[`src`],got=[`src`,`alt`],_ot={class:`preview-footer-bar`},vot={key:0,class:`preview-page-indicator`},yot=24,bot=(0,t.defineComponent)({__name:`TemplateGallery`,setup(e){let{addElement:n,notify:r,materialApiUrl:i,materialTreeApiUrl:a,materialPageApiUrl:o,materialHeaders:s,activeTab:c,materialPopoverVisible:l,activeSlide:u,selectedElementId:d,placeholderMaterialTargetId:f,resolveActivePlaceholderTargetId:p,replacePlaceholderElement:m}=e6(),h=[{key:`Vectors`,label:`矢量图`,subType:`Vectors`,tags:[`风景`,`商务`,`科技`,`插画`,`几何`,`背景`,`图标`]},{key:`Photos`,label:`照片`,subType:`Photos`,tags:[`风景`,`商务`,`科技`,`人物`,`自然`,`建筑`,`美食`,`办公`]},{key:`Illustrations`,label:`插画`,subType:`Illustrations`,tags:[`风景`,`商务`,`科技`,`人物`,`自然`,`创意`,`手绘`,`扁平`]},{key:`Videos`,label:`高清视频`,subType:`Videos`,tags:[`风景`,`商务`,`科技`,`自然`,`城市`,`航拍`,`办公`]}],g={Vectors:`矢量图`,Photos:`照片`,Illustrations:`插画`,Videos:`高清视频`},{isDamLoggedIn:_,sharedMaterialMainTab:v,refreshSessionState:y,probeRemoteSessionV3:b}=c9(),x=(0,t.ref)(null),S=(0,t.ref)(null),C=(0,t.ref)(!1),w=(0,t.ref)(`请先登录后使用该功能`),T=null;function E(e){w.value=e===`我的空间`?`请先登录后查看「我的空间」`:`请先登录后使用「AI生成」`,C.value=!0,T&&clearTimeout(T),T=setTimeout(()=>{C.value=!1},2200)}async function D(e){if(y(),e!==`search`&&!_.value&&!await b(!0)&&!_.value){E(e===`mine`?`我的空间`:`AI生成`);return}v.value=e}(0,t.watch)(_,e=>{!e&&v.value!==`search`&&(v.value=`search`)});let O=(0,t.ref)(`overview`),k=(0,t.ref)(``),A=(0,t.ref)(`素材库`),j=(0,t.ref)(``),M=(0,t.ref)(``),N=(0,t.reactive)({query:``,activeSubType:`Vectors`}),P=(0,t.computed)(()=>M.value?M.value:j.value?j.value:A.value||g[N.activeSubType]||`素材库`),F=(0,t.computed)(()=>{let e=h.find(e=>e.subType===N.activeSubType);return e?e.tags:[`风景`,`商务`,`科技`,`人物`,`自然`,`建筑`,`办公`]});function I(e){if(!e)return!1;let t=e.split(`?`)[0].toLowerCase();return t.endsWith(`.mp4`)||t.endsWith(`.webm`)||t.endsWith(`.mov`)||t.endsWith(`.m4v`)||t.endsWith(`.ogg`)}function L(e){return e.type===`video`||e.assetType===`VIDEO`||e.assetSubType===`Videos`||e.subType===`Videos`||I(e.sourceUrl||e.url||e.downloadUrl)}function R(e){return e.previewUrl||e.image||e.coverUrl||e.thumbnail||e.url||e.sourceUrl||e.downloadUrl||``}function z(e){if(e.format)return e.format.toUpperCase();let t=(e.sourceUrl||e.url||e.previewUrl||e.fileName||``).toLowerCase();return t.includes(`.mp4`)?`MP4`:t.includes(`.mov`)||t.includes(`.webm`)?`VIDEO`:t.includes(`.svg`)?`SVG`:t.includes(`.png`)?`PNG`:t.includes(`.gif`)?`GIF`:e.assetSubType===`Videos`||e.type===`video`?`MP4`:e.assetSubType===`Vectors`||e.type===`svg`?`SVG`:`JPG`}let B=(0,t.ref)(!1),V=(0,t.ref)([]),ee=(0,t.ref)(0),te=(0,t.ref)(!1),ne=(0,t.computed)(()=>V.value.length===0?null:V.value[ee.value]||null);function re(e,t){t&&(t.stopPropagation(),t.preventDefault());let n=L(e)&&(e.sourceUrl||e.url||e.downloadUrl)||R(e);if(!n){r(`该素材暂无可用预览地址`);return}let i=e.assetSubType||e.subType||N.activeSubType,a=O.value===`detail`?Re.value:fe[i]||[],o=[];a.forEach(e=>{let t=L(e),n=t&&(e.sourceUrl||e.url||e.downloadUrl)||R(e);n&&o.push({url:n,isVideo:t&&I(n),title:e.title||`素材预览`,format:z(e),meta:e})});let s=o.findIndex(e=>e.url===n);s>=0?ee.value=s:(o.unshift({url:n,isVideo:L(e)&&I(n),title:e.title||`素材预览`,format:z(e),meta:e}),ee.value=0),V.value=o,l&&l.value?(te.value=!0,l.value=!1):te.value=!1,B.value=!0}function H(e,t,n){n&&(n.stopPropagation(),n.preventDefault());let i=L(e)&&(e.sourceUrl||e.url||e.downloadUrl)||R(e);if(!i){r(`该素材暂无可用预览地址`);return}let a=Array.isArray(t)&&t.length>0?t:[e],o=[];a.forEach(e=>{let t=L(e),n=t&&(e.sourceUrl||e.url||e.downloadUrl)||R(e);n&&o.push({url:n,isVideo:t&&I(n),title:e.title||`素材预览`,format:z(e),meta:e})});let s=o.findIndex(e=>e.url===i);s>=0?ee.value=s:(o.unshift({url:i,isVideo:L(e)&&I(i),title:e.title||`素材预览`,format:z(e),meta:e}),ee.value=0),V.value=o,l&&l.value?(te.value=!0,l.value=!1):te.value=!1,B.value=!0}async function U(e,n){if(n&&(n.stopPropagation(),n.preventDefault()),y(),!_.value&&!await b(!0)&&!_.value){E(`AI生成`);return}let i=R(e);if(!i){r(`该素材暂无可用参考图地址`);return}v.value=`create`,(0,t.nextTick)(()=>{S.value?.addReferenceItem({url:i,name:e.title||`参考图`})})}function ie(){x.value?.reloadAssets?.()}function W(){B.value=!1,te.value&&l&&(te.value=!1,setTimeout(()=>{l.value=!0},60))}function ae(){V.value.length<=1||(ee.value=(ee.value-1+V.value.length)%V.value.length)}function G(){V.value.length<=1||(ee.value=(ee.value+1)%V.value.length)}function oe(){ne.value&&(We(ne.value.meta),te.value=!1,B.value=!1)}function se(e){B.value&&(e.key===`Escape`||e.key===`Esc`?(e.preventDefault(),e.stopPropagation(),W()):e.key===`ArrowLeft`?ae():e.key===`ArrowRight`&&G())}async function ce(e,t={}){let n=await fetch(e,t),r=await n.text();if(!n.ok)throw Error(`请求接口异常 (${n.status} ${n.statusText})`);let i=r.trim();if(i.startsWith(`<`)||i.toLowerCase().startsWith(`<!doctype`))throw Error(`接口地址返回了 HTML 网页而非有效 JSON 数据`);try{return JSON.parse(r)}catch(e){throw Error(`JSON 解析失败: ${e.message}`)}}function le(){let e=o?.value&&o.value.trim()||i?.value&&i.value.trim()||`/jvs-dam/stock/search`;return(e.includes(`/api/dam/material/tree`)||e.includes(`/api/dam/material/page`))&&(e=S2e),e}function ue(e,t=`Photos`){let n=e.assetSubType||e.subType||t,r=e.type||``;r||=n===`Videos`||e.assetType===`VIDEO`?`video`:n===`Vectors`?`svg`:`image`;let i=e.previewUrl||e.image||e.coverUrl||e.thumbnail||e.url||e.downloadUrl||e.sourceUrl||``,a=e.sourceUrl||e.downloadUrl||e.url||i,o=a||i,s=e.sourcePlatform||(e.id&&typeof e.id==`string`&&e.id.includes(`_`)?e.id.split(`_`)[0].toUpperCase():``),c=e.format||z({...e,url:o,previewUrl:i,sourceUrl:a,type:r,assetSubType:n}),l=e.aspectRatio?String(e.aspectRatio).replace(`:`,`/`):void 0;return!l&&e.width&&e.height&&(l=`${e.width} / ${e.height}`),{...e,id:e.id||`stock-${Math.random().toString(36).slice(2,9)}`,title:e.title||`${s?`${s} `:``}${g[n]||`素材`}`,type:r,assetSubType:n,subType:n,sourcePlatform:s,format:c,category:e.category||g[n]||`素材`,previewUrl:i,url:o,sourceUrl:a,color:e.color||e.primaryColor||``,primaryColor:e.primaryColor||e.color||``,aspectRatio:l||`4 / 3`,originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,tags:Array.isArray(e.tags)?e.tags:[]}}function de(e,t=`Photos`){if(!e)return[];let n=[];if(Array.isArray(e))n=e;else if(Array.isArray(e?.data?.records))n=e.data.records;else if(Array.isArray(e?.records))n=e.records;else if(Array.isArray(e?.data?.list))n=e.data.list;else if(Array.isArray(e?.list))n=e.list;else if(Array.isArray(e?.data)){if(e.data.length>0&&Array.isArray(e.data[0]?.items))return e.data.flatMap(e=>(e.items||[]).map(e=>ue(e,t)));n=e.data}return n.map(e=>ue(e,t))}let fe=(0,t.reactive)({Vectors:[],Photos:[],Illustrations:[],Videos:[]}),pe=(0,t.reactive)({Vectors:!1,Photos:!1,Illustrations:!1,Videos:!1}),me=(0,t.reactive)({}),he=(0,t.reactive)({Vectors:{canLeft:!1,canRight:!1},Photos:{canLeft:!1,canRight:!1},Illustrations:{canLeft:!1,canRight:!1},Videos:{canLeft:!1,canRight:!1}});function ge(e,t){me[e]=t}function _e(e){let t=me[e];t&&(he[e]={canLeft:t.scrollLeft>4,canRight:t.scrollWidth-t.clientWidth-t.scrollLeft>4})}function ve(e,t){let n=me[e];if(!n)return;let r=t===`left`?-180:180;n.scrollBy({left:r,behavior:`smooth`}),setTimeout(()=>_e(e),260)}async function ye(e,n=``){pe[e.key]=!0;try{let t=le();if(!t){fe[e.key]=[];return}let r=new URLSearchParams;r.append(`current`,`1`),r.append(`size`,`12`),r.append(`subType`,e.subType);let i=n.trim();i&&r.append(`keyword`,i);let a=await ce(`${t}${t.includes(`?`)?`&`:`?`}${r.toString()}`,{headers:{...s.value||{}}});if(a&&a.code!==void 0&&a.code!==0&&a.code!==200){fe[e.key]=[];return}let o=de(a,e.subType);fe[e.key]=o.slice(0,12)}catch{fe[e.key]=[]}finally{pe[e.key]=!1,(0,t.nextTick)(()=>{_e(e.key),setTimeout(()=>_e(e.key),300)})}}function be(e=k.value){h.forEach(t=>{ye(t,e)})}let xe=(0,t.ref)(null),Se=(0,t.reactive)({canLeft:!1,canRight:!1});function Ce(){let e=xe.value;e&&(Se.canLeft=e.scrollLeft>4,Se.canRight=e.scrollWidth-e.clientWidth-e.scrollLeft>4)}function we(e){let t=xe.value;if(!t)return;let n=e===`left`?-140:140;t.scrollBy({left:n,behavior:`smooth`}),setTimeout(()=>Ce(),250)}async function Te(e){let n=h.find(t=>t.subType===e);N.activeSubType=e;let r=k.value.trim();A.value=n?n.label:g[e],j.value=r,M.value=``,N.query=r,O.value=`detail`,Me.value=1,je.value=[],Ie.value=!1,Pe.value=!1,await(0,t.nextTick)(),Ce(),await Le(1,!1)}function Ee(){be(k.value)}function De(){k.value=``,be(``)}function Oe(){O.value=`overview`,(0,t.nextTick)(()=>{h.forEach(e=>_e(e.key))})}async function ke(e){M.value=e,N.query=e||j.value,Me.value=1,je.value=[],Ie.value=!1,Pe.value=!1,await Le(1,!1)}let Ae=(0,t.ref)(!1),je=(0,t.ref)([]),Me=(0,t.ref)(1),Ne=(0,t.ref)(!1),Pe=(0,t.ref)(!1),Fe=(0,t.ref)(``),Ie=(0,t.ref)(!1);async function Le(e=1,t=!1){let n=le();if(!n){t||(je.value=[]),Ie.value=!0;return}try{Ae.value=!t,Ne.value=t,Pe.value=!1,Fe.value=``;let r=new URLSearchParams;r.append(`current`,String(e)),r.append(`size`,String(yot)),r.append(`subType`,N.activeSubType);let i=N.query.trim();i&&r.append(`keyword`,i);let a=await ce(`${n}${n.includes(`?`)?`&`:`?`}${r.toString()}`,{headers:{...s.value||{}}});if(a&&a.code!==void 0&&a.code!==0&&a.code!==200){t||(je.value=[]),Ie.value=!0;return}let o=de(a,N.activeSubType);if(o.length<yot?Ie.value=!0:Ie.value=!1,t){let e=new Set(je.value.map(e=>e.id)),t=o.filter(t=>!e.has(t.id));je.value=[...je.value,...t]}else je.value=o;Me.value=e}catch(e){console.warn(`[Stock Search] 加载公网素材出错:`,e),t?(Pe.value=!0,Fe.value=e.message||`网络连接或接口异常`):(je.value=[],Ie.value=!0)}finally{Ae.value=!1,Ne.value=!1}}let Re=(0,t.computed)(()=>je.value),ze=(0,t.computed)(()=>{let e=[],t=[],n=0,r=0;return Re.value.forEach((i,a)=>{let o=.75,s=Number(i.originalWidth||i.width),c=Number(i.originalHeight||i.height);s>0&&c>0?o=Math.max(.45,Math.min(1.8,c/s)):a%3==1?o=1.25:a%4==2&&(o=.65),n<=r?(e.push(i),n+=o):(t.push(i),r+=o)}),[e,t]}),Be=(0,t.computed)(()=>!Ie.value&&!Pe.value);async function Ve(){Ae.value||Ne.value||!Be.value||Pe.value||Ie.value||await Le(Me.value+1,!0)}async function He(){Pe.value=!1,Fe.value=``,await Le(Me.value+1,!0)}function Ue(e,t=`素材`,n=12){let r=(e||``).trim();return r?r.length>n?`${r.slice(0,n)}...`:r:t}function We(e){let t=L(e),i=e.sourceUrl||e.url||e.downloadUrl||e.previewUrl;if(!i){r(`该素材暂无可用的资源地址`);return}let a=e.originalWidth||e.width,o=e.originalHeight||e.height,s=d?.value?u?.value?.elements?.find(e=>e.id===d.value):null,c=f?.value||(typeof window<`u`?window.__jvsPlaceholderTargetId:null),l=(p?p():null)||(c&&(!s||s.id===c)?c:s&&NQ(s)?s.id:null);if(l&&m&&m(l,i,{isVideo:t,width:Number(a)||void 0,height:Number(o)||void 0,notifyMessage:t?`已使用视频 "${Ue(e.title,`高清视频`,12)}" 替换占位符`:`已使用素材 "${Ue(e.title,`图片`,12)}" 替换占位符图片`}))return;let h;if(a&&o&&a>0&&o>0){let e=Math.min(480/a,360/o,1);h={width:Math.round(a*e),height:Math.round(o*e)}}t?(n(`video`,i,void 0,void 0,void 0,h),r(`已成功添加视频 "${Ue(e.title,`高清视频`,12)}" 到画布`)):(n(`image`,i,void 0,void 0,void 0,h),r(`已成功添加素材 "${Ue(e.title,`图片`,12)}" 到画布`))}function Ge(){c.value=null}return(0,t.onMounted)(()=>{be(),window.addEventListener(`keydown`,se)}),(0,t.onUnmounted)(()=>{window.removeEventListener(`keydown`,se)}),(0,t.watch)([()=>i?.value,()=>o?.value,()=>a?.value],()=>{be(),O.value===`detail`&&Le(1,!1)}),(e,n)=>{let r=wb;return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,hat,[(0,t.createVNode)(t.Transition,{name:`guest-toast-fade`},{default:(0,t.withCtx)(()=>[C.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,gat,[n[12]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`#d97706`,"stroke-width":`2.2`},[(0,t.createElementVNode)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,t.createElementVNode)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`12`}),(0,t.createElementVNode)(`line`,{x1:`12`,y1:`16`,x2:`12.01`,y2:`16`})],-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(w.value),1)])):(0,t.createCommentVNode)(``,!0)]),_:1}),(0,t.createElementVNode)(`div`,_at,[(0,t.unref)(v)!==`search`||O.value===`overview`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,vat,[...n[13]||=[(0,t.createElementVNode)(`span`,{class:`drawer-header-title`},`素材库`,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`drawer-back-btn`,onClick:Oe},[n[14]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),(0,t.createElementVNode)(`polyline`,{points:`12 19 5 12 12 5`})],-1),(0,t.createElementVNode)(`span`,yat,(0,t.toDisplayString)(P.value),1)])),(0,t.createElementVNode)(`button`,{type:`button`,class:`drawer-close-btn`,title:`关闭面板`,onClick:Ge},[...n[15]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,t.createElementVNode)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]])]),(0,t.unref)(v)!==`search`||O.value===`overview`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bat,[(0,t.createElementVNode)(`div`,xat,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`material-main-tab-btn`,{active:(0,t.unref)(v)===`search`}]),onClick:n[0]||=e=>D(`search`)},[...n[16]||=[(0,t.createElementVNode)(`span`,null,`联网搜索`,-1)]],2),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`material-main-tab-btn`,{active:(0,t.unref)(v)===`create`,"is-disabled":!(0,t.unref)(_)}]),title:(0,t.unref)(_)?`AI 生成图片或视频素材`:`请先登录后使用AI生成`,onClick:n[1]||=e=>D(`create`)},[n[18]||=(0,t.createElementVNode)(`span`,null,`AI生成`,-1),(0,t.unref)(_)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Cat,`✦`)):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,wat,[...n[17]||=[(0,t.createElementVNode)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`},null,-1),(0,t.createElementVNode)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`},null,-1)]]))],10,Sat),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`material-main-tab-btn`,{active:(0,t.unref)(v)===`mine`,"is-disabled":!(0,t.unref)(_)}]),title:(0,t.unref)(_)?`查看我的项目与个人素材`:`请先登录后查看我的空间`,onClick:n[2]||=e=>D(`mine`)},[n[20]||=(0,t.createElementVNode)(`span`,null,`我的空间`,-1),(0,t.unref)(_)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Eat,[...n[19]||=[(0,t.createElementVNode)(`rect`,{x:`3`,y:`11`,width:`18`,height:`11`,rx:`2`,ry:`2`},null,-1),(0,t.createElementVNode)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`},null,-1)]]))],10,Tat)])])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(v)===`search`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[O.value===`overview`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Dat,[(0,t.createElementVNode)(`div`,Oat,[(0,t.createElementVNode)(`div`,kat,[(0,t.createVNode)(r,{class:`overview-search-icon`,onClick:Ee},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(sb))]),_:1}),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":n[3]||=e=>k.value=e,type:`text`,placeholder:`搜索`,class:`overview-search-input`,onKeyup:(0,t.withKeys)(Ee,[`enter`])},null,544),[[t.vModelText,k.value]]),k.value?((0,t.openBlock)(),(0,t.createBlock)(r,{key:0,class:`overview-search-clear`,onClick:De},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(By))]),_:1})):(0,t.createCommentVNode)(``,!0)])]),(0,t.createElementVNode)(`div`,Aat,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(h,e=>(0,t.createElementVNode)(`div`,{key:e.key,class:`overview-category-section`},[(0,t.createElementVNode)(`div`,jat,[(0,t.createElementVNode)(`span`,Mat,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`section-view-all-btn`,onClick:t=>Te(e.subType)},` 查看全部 `,8,Nat)]),(0,t.createElementVNode)(`div`,Pat,[(0,t.createElementVNode)(`div`,{ref_for:!0,ref:t=>ge(e.key,t),class:`section-carousel-track`,onScroll:t=>_e(e.key)},[pe[e.key]&&(!fe[e.key]||fe[e.key].length===0)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},(0,t.renderList)(3,e=>(0,t.createElementVNode)(`div`,{key:e,class:`overview-skeleton-card`})),64)):fe[e.key]&&fe[e.key].length>0?((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(fe[e.key],(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i.id||a,class:`overview-thumb-card`,onClick:e=>We(i)},[I(R(i))?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:R(i),muted:``,preload:`metadata`,playsinline:``,class:`overview-thumb-img`,onLoadeddata:t=>_e(e.key),onMouseenter:n[4]||=e=>e.target?.play?.(),onMouseleave:n[5]||=e=>e.target?.pause?.()},null,40,Lat)):R(i)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:R(i),alt:i.title||e.label,loading:`lazy`,class:`overview-thumb-img`,onLoad:t=>_e(e.key)},null,40,Rat)):(0,t.createCommentVNode)(``,!0),e.subType===`Videos`||L(i)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,zat,[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(pb))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(_)&&e.subType!==`Videos`&&!L(i)&&R(i)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,class:`overview-card-ref-btn`,title:`作为参考图发送到「AI生成」`,onClick:(0,t.withModifiers)(e=>U(i,e),[`stop`,`prevent`])},` @参考 `,8,Bat)):(0,t.createCommentVNode)(``,!0)],8,Iat))),128)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:`overview-empty-row`,onClick:t=>Te(e.subType)},[(0,t.createElementVNode)(`span`,null,`暂无`+(0,t.toDisplayString)(e.label)+`数据`,1)],8,Vat))],40,Fat),he[e.key]?.canLeft?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`carousel-edge-mask left-mask`,onClick:(0,t.withModifiers)(t=>ve(e.key,`left`),[`stop`])},[...n[21]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polyline`,{points:`15 18 9 12 15 6`})],-1)]],8,Hat)):(0,t.createCommentVNode)(``,!0),he[e.key]?.canRight?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`carousel-edge-mask right-mask`,onClick:(0,t.withModifiers)(t=>ve(e.key,`right`),[`stop`])},[...n[22]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],8,Uat)):(0,t.createCommentVNode)(``,!0)])])),64))])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Wat,[(0,t.createElementVNode)(`div`,Gat,[(0,t.createElementVNode)(`div`,{ref_key:`tagTrackRef`,ref:xe,class:`detail-tags-track`,onScroll:Ce},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`detail-tag-pill`,{active:M.value===``}]),onClick:n[6]||=e=>ke(``)},` 全部 `,2),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(F.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,class:(0,t.normalizeClass)([`detail-tag-pill`,{active:M.value===e}]),onClick:t=>ke(e)},(0,t.toDisplayString)(e),11,Kat))),128))],544),Se.canLeft?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`tags-edge-arrow left-arrow`,onClick:n[7]||=(0,t.withModifiers)(e=>we(`left`),[`stop`])},[...n[23]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polyline`,{points:`15 18 9 12 15 6`})],-1)]])):(0,t.createCommentVNode)(``,!0),Se.canRight?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`tags-edge-arrow right-arrow`,onClick:n[8]||=(0,t.withModifiers)(e=>we(`right`),[`stop`])},[...n[24]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`polyline`,{points:`9 18 15 12 9 6`})],-1)]])):(0,t.createCommentVNode)(``,!0)]),Ae.value&&Re.value.length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,qat,[n[25]||=(0,t.createElementVNode)(`div`,{class:`loading-ring-spinner`},null,-1),(0,t.createElementVNode)(`span`,Jat,`正在加载`+(0,t.toDisplayString)(g[N.activeSubType])+`...`,1)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Yat,[Re.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Xat,[(0,t.createElementVNode)(`div`,Zat,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(ze.value,(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:i,class:`detail-masonry-col`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e,(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id||i,class:`detail-masonry-card`,onClick:t=>We(e)},[I(R(e))?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:R(e),muted:``,preload:`metadata`,playsinline:``,class:`detail-card-img`,onMouseenter:n[9]||=e=>e.target?.play?.(),onMouseleave:n[10]||=e=>e.target?.pause?.()},null,40,$at)):R(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:R(e),alt:e.title||`素材`,loading:`lazy`,class:`detail-card-img`},null,8,eot)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,tot,[...n[26]||=[(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`24`,height:`24`,fill:`none`,stroke:`#94a3b8`,"stroke-width":`1.5`},[(0,t.createElementVNode)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,t.createElementVNode)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,t.createElementVNode)(`polyline`,{points:`21 15 16 10 5 21`})],-1)]])),N.activeSubType===`Videos`||L(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,not,[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(pb))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(_)&&N.activeSubType!==`Videos`&&!L(e)&&R(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:4,type:`button`,class:`detail-card-ref-btn`,title:`作为参考图发送到「AI生成」`,onClick:(0,t.withModifiers)(t=>U(e,t),[`stop`,`prevent`])},` @参考 `,8,rot)):(0,t.createCommentVNode)(``,!0),R(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:5,type:`button`,class:`detail-card-preview-btn`,title:`大图预览`,onClick:(0,t.withModifiers)(t=>re(e,t),[`stop`,`prevent`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(mb))]),_:1})],8,iot)):(0,t.createCommentVNode)(``,!0)],8,Qat))),128))]))),128))]),(0,t.createElementVNode)(`div`,aot,[Ne.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,oot,[...n[27]||=[(0,t.createElementVNode)(`span`,{class:`btn-spinner-ring dark`},null,-1),(0,t.createElementVNode)(`span`,null,`正在加载更多...`,-1)]])):Pe.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sot,[n[28]||=(0,t.createElementVNode)(`span`,{class:`load-error-text`},`加载失败`,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:`retry-load-btn`,onClick:He},` 重试 `)])):Be.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,type:`button`,class:`load-more-action-btn`,onClick:Ve},` 加载更多 `)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cot,[...n[29]||=[(0,t.createElementVNode)(`span`,null,`— 已加载全部 —`,-1)]]))])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lot,[n[30]||=(0,t.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`40`,height:`40`,fill:`none`,stroke:`#cbd5e1`,"stroke-width":`1.2`},[(0,t.createElementVNode)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,t.createElementVNode)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})],-1),(0,t.createElementVNode)(`p`,uot,(0,t.toDisplayString)(N.query?`未找到与 "${N.query}" 相关的素材`:`暂无相关素材`),1)]))]))]))],64)):(0,t.unref)(v)===`mine`&&(0,t.unref)(_)?((0,t.openBlock)(),(0,t.createBlock)(Prt,{key:2,ref_key:`myAssetsRef`,ref:x,onSelect:We,onPreview:H,onUseAsRef:n[11]||=e=>U(e)},null,512)):(0,t.unref)(v)===`create`&&(0,t.unref)(_)?((0,t.openBlock)(),(0,t.createBlock)(mat,{key:3,ref_key:`createPanelRef`,ref:S,onSelect:We,onPreview:H,onGenerated:ie},null,512)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createVNode)(t.Transition,{name:`preview-backdrop-fade`},{default:(0,t.withCtx)(()=>[B.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`custom-fullscreen-preview-modal`,onClick:(0,t.withModifiers)(W,[`self`])},[(0,t.createElementVNode)(`div`,dot,[(0,t.createElementVNode)(`div`,fot,[(0,t.createElementVNode)(`span`,pot,(0,t.toDisplayString)(ne.value?.format||`IMG`),1),(0,t.createElementVNode)(`span`,mot,(0,t.toDisplayString)(ne.value?.title||`素材大图预览`),1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:`preview-close-cross-btn`,title:`关闭预览 (Esc)`,onClick:W},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Uy))]),_:1})])]),V.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`preview-arrow-btn prev-arrow`,title:`上一张 (←)`,onClick:(0,t.withModifiers)(ae,[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Ay))]),_:1})])):(0,t.createCommentVNode)(``,!0),V.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`preview-arrow-btn next-arrow`,title:`下一张 (→)`,onClick:(0,t.withModifiers)(G,[`stop`])},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(jy))]),_:1})])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{class:`preview-stage-viewport`,onClick:(0,t.withModifiers)(W,[`self`])},[ne.value?.isVideo&&ne.value?.url?((0,t.openBlock)(),(0,t.createElementBlock)(`video`,{key:0,src:ne.value.url,controls:``,autoplay:``,playsinline:``,class:`preview-stage-img`},null,8,hot)):ne.value?.url?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:ne.value.url,alt:ne.value.title,class:`preview-stage-img`},null,8,got)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,_ot,[V.value.length>1?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,vot,(0,t.toDisplayString)(ee.value+1)+` / `+(0,t.toDisplayString)(V.value.length),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{type:`button`,class:`preview-quick-insert-btn`,onClick:oe},[(0,t.createVNode)(r,null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(nb))]),_:1}),n[31]||=(0,t.createElementVNode)(`span`,null,`插入此素材到画布`,-1)])])])):(0,t.createCommentVNode)(``,!0)]),_:1})]))])}}});B8();var xot=z8(bot,[[`__scopeId`,`data-v-7f0f8138`]]);L8(),RQ(),TZ();var Sot=[`viewBox`],Cot=[`id`,`cx`,`cy`,`r`,`fx`,`fy`],wot=[`offset`,`stop-color`,`stop-opacity`],Tot=[`id`,`x1`,`y1`,`x2`,`y2`],Eot=[`offset`,`stop-color`,`stop-opacity`],Dot=[`id`,`cx`,`cy`,`r`,`fx`,`fy`],Oot=[`offset`,`stop-color`,`stop-opacity`],kot=[`id`,`x1`,`y1`,`x2`,`y2`],Aot=[`offset`,`stop-color`,`stop-opacity`],jot=[`transform`],Mot=[`x`,`y`,`width`,`height`,`viewBox`],Not=[`href`],Pot=[`transform`],Fot=[`x`,`y`,`width`,`height`],Iot=[`x`,`y`],Lot=[`transform`],Rot=[`x`,`y`,`width`,`height`,`viewBox`],zot=[`d`,`fill`,`stroke`,`stroke-width`,`stroke-linecap`],Bot=[`transform`],Vot=[`cx`,`cy`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`],Hot=[`transform`],Uot=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`],Wot=[`transform`],Got=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-dasharray`,`stroke-width`],Kot=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-weight`],qot=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-weight`],Jot=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Yot=[`x1`,`y1`,`x2`,`y2`,`stroke`],Xot=[`x1`,`y1`,`x2`,`y2`,`stroke`],Zot=[`transform`],Qot=[`transform`],$ot=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],est=[`x`,`y`,`width`,`height`],tst=(0,t.defineComponent)({__name:`LayoutThumbSvg`,props:{elements:{},background:{}},setup(e){let n=e,{logicalWidth:r,logicalHeight:i}=e6(),a=R8.flatMap(e=>e.children),o=(0,t.computed)(()=>{let e=r?.value||1280;return+((i?.value||720)/e*100).toFixed(2)});function s(e,t=`none`){if(!e)return t;if(typeof e==`string`)return e||t;if(typeof e==`object`){if(e.value!==void 0){if(typeof e.value==`string`)return e.value||t;if(typeof e.value==`object`&&e.value.colors&&Array.isArray(e.value.colors)&&e.value.colors.length>0)return e.value.colors[0].color||t}if(e.color)return e.color}return t}function c(e){if(!e)return``;let t=e.src||e.content||e.base64||e.picBase64||e.blob||e.url;if(!t&&e.value&&(typeof e.value==`string`?t=e.value:typeof e.value==`object`&&e.value!==null&&(t=e.value.src||e.value.base64||e.value.picBase64||e.value.blob||e.value.url)),!t&&e.fill&&typeof e.fill==`object`&&e.fill!==null){let n=e.fill.value||e.fill;typeof n==`string`?t=n:typeof n==`object`&&n&&(t=n.src||n.base64||n.picBase64||n.blob||n.url)}if(typeof t==`string`&&t.length>0){let e=t.trim();return e.startsWith(`data:`)||e.startsWith(`http:`)||e.startsWith(`https:`)||e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`blob:`)?e:e.length>50&&!e.includes(`<`)&&!e.includes(` `)?`data:image/png;base64,${e}`:/\.(png|jpe?g|gif|webp|svg|bmp|avif)([?#].*)?$/i.test(e)?e:``}return``}function l(e){if(!e||e.length===0)return[];let t=r!==void 0&&r.value?r.value:1280,n=i!==void 0&&i.value?i.value:720,o=+(n/t*100).toFixed(2),l=(e,t,n=0)=>{if(e==null||e===``||e===`auto`)return n;let r=String(e).trim();if(r.endsWith(`%`))return parseFloat(r)||n;let i=parseFloat(r);return isNaN(i)?n:i/t*100},u=[],d=(e,r=0,i=0,a=100,o=100)=>{(e||[]).forEach(e=>{if(e)if(e.type===`group`&&Array.isArray(e.elements)&&e.elements.length>0){let s=l(e.style?.left??e.left,t),c=l(e.style?.top??e.top,n),u=l(e.style?.width??e.width??100,t),f=l(e.style?.height??e.height??50,n);d(e.elements,r+s*a/100,i+c*o/100,a/100*u,o/100*f)}else u.push({el:e,parentLeftPct:r,parentTopPct:i,parentWidthPct:a,parentHeightPct:o})})};return d(e),u.map(({el:e,parentLeftPct:r,parentTopPct:i,parentWidthPct:u,parentHeightPct:d})=>{let f=!!(e.id===`ph-image`||e.placeholderType===`pic`||e.placeholder?.type===`image`||typeof e.name==`string`&&e.name.includes(`图片占位符`)),p=!!(e.type!==`shape`&&e.type!==`image`&&e.type!==`line`&&(e.isPlaceholder||e.placeholder||typeof e.name==`string`&&e.name.includes(`占位符`)||typeof e.id==`string`&&(e.id.startsWith(`ph_title`)||e.id.startsWith(`ph_body`)||e.id.startsWith(`ph_subtitle`)||e.id.startsWith(`ph_0_`)||e.id.startsWith(`ph_1_`)||e.id.startsWith(`ph-`)))),m=typeof e.content==`string`?e.content.replace(/<[^>]*>/g,``).replace(/ /gi,` `).trim():``,h=typeof e.text==`string`?e.text.trim():e.text?.content?String(e.text.content).replace(/<[^>]*>/g,``).trim():``,g=e.placeholder?.prompt||(e.placeholder?.type===`title`?`单击此处编辑母版标题样式`:e.placeholder?.type===`subtitle`?`单击此处编辑母版副标题样式`:e.placeholder?.type===`image`?`单击图标添加图片`:`单击此处添加文本描述`),_=m?e.content:h?typeof e.text==`string`?e.text:e.text.content:p?g:typeof e.content==`string`?e.content:``,v=!!((e.style?.writingMode||e.writingMode||``).includes(`vertical`)||e.vertical===!0||_.includes(`writing-mode: vertical`)||_.includes(`writing-mode:vertical`)),y=v?60/t*100:0,b=l(e.style?.left??e.left,t),x=l(e.style?.top??e.top,n),S=l(e.style?.width??e.width,t,y),C=l(e.style?.height??e.height??50,n),w=r+b*u/100,T=i+x*d/100,E=u/100*S,D=d/100*C,O=+w.toFixed(2),k=+(T/100*o).toFixed(2),A=+Math.max(.5,E).toFixed(2),j=+Math.max(.5,D/100*o).toFixed(2),M=e.type===`text`?!1:!!(e.flipH||e.isFlipH||e.style?.flipH),N=e.type===`text`?!1:!!(e.flipV||e.isFlipV||e.style?.flipV),P=e.type===`text`&&!e.style?.rotate&&!e.rotate?0:parseFloat(e.style?.rotate||e.rotate)||0,F=+(O+A/2).toFixed(2),I=+(k+j/2).toFixed(2),L=P!==0||M||N?`translate(${F}, ${I}) rotate(${P}) scale(${M?-1:1}, ${N?-1:1}) translate(${-F}, ${-I})`:void 0,R=parseFloat(e.style?.fontSize||e.fontSize||(p&&e.placeholder?.type===`title`?`28`:`16`))||16,z=100/t*R,B=+Math.max(1.8,Math.min(4.5,z*1.15)).toFixed(2),V=[];if(_){let e=_.replace(/<br\s*\/?>/gi,`
|
|
345
345
|
`).replace(/<\/div>/gi,`
|
|
346
346
|
`).replace(/<\/p>/gi,`
|
|
347
347
|
`).replace(/<\/li>/gi,`
|