@univerjs/slides-ui 0.10.3 → 0.10.4-nightly.202508220605

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/umd/index.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(h,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/slides"),require("@univerjs/drawing"),require("@univerjs/ui"),require("react/jsx-runtime"),require("@univerjs/design"),require("react"),require("@univerjs/docs-ui"),require("rxjs"),require("@univerjs/docs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/slides","@univerjs/drawing","@univerjs/ui","react/jsx-runtime","@univerjs/design","react","@univerjs/docs-ui","rxjs","@univerjs/docs"],a):(h=typeof globalThis<"u"?globalThis:h||self,a(h.UniverSlidesUi={},h.UniverCore,h.UniverEngineRender,h.UniverSlides,h.UniverDrawing,h.UniverUi,h.React,h.UniverDesign,h.React,h.UniverDocsUi,h.rxjs,h.UniverDocs))})(this,function(h,a,I,W,fe,f,u,x,E,M,N,ee){"use strict";var cn=Object.defineProperty;var on=(h,a,I)=>a in h?cn(h,a,{enumerable:!0,configurable:!0,writable:!0,value:I}):h[a]=I;var O=(h,a,I)=>on(h,typeof a!="symbol"?a+"":a,I);var he;var tt=Object.getOwnPropertyDescriptor,nt=(r,e,t,n)=>{for(var i=n>1?void 0:n?tt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},pe=(r,e)=>(t,n)=>e(t,n,r);let q=class extends a.RxDisposable{constructor(e,t,n,i){super();O(this,"_objectProvider",null);O(this,"_refreshThumb",a.debounce(()=>{this.createThumbs()},300));this._renderContext=e,this._injector=t,this._univerInstanceService=n,this._renderManagerService=i,this._objectProvider=this._injector.createInstance(W.ObjectProvider),this._addNewRender()}_addNewRender(){const{unitId:e,engine:t,scene:n}=this._renderContext,i=this._getCurrUnitModel();if(!i)return;const s=t.onTransformChange$.subscribeEvent(()=>{this._scrollToCenter(),s==null||s.unsubscribe()});t.onTransformChange$.subscribeEvent(()=>{setTimeout(()=>{this.createThumbs()},300)});const c=new I.Viewport(W.SLIDE_KEY.VIEW,n,{left:0,top:0,bottom:0,right:0,explicitViewportWidthSet:!1,explicitViewportHeightSet:!1,isWheelPreventDefaultX:!0});n.attachControl(),n.onMouseWheel$.subscribeEvent((l,g)=>{const d=l;if(d.ctrlKey){const v=Math.abs(d.deltaX);let _=v<40?.2:v<80?.4:.2;_*=d.deltaY>0?-1:1,n.scaleX<1&&(_/=2),n.scaleX+_>4?n.scale(4,4):n.scaleX+_<.1?n.scale(.1,.1):(d.deltaY>0,d.preventDefault())}else c.onMouseWheel(d,g)}),n.onFileLoaded$.subscribeEvent(()=>{this._refreshThumb()}),I.ScrollBar.attachTo(c);const o=this._createSlide(n);this._renderContext.mainComponent=o,this._createSlidePages(i,o),this.createThumbs(),t.runRenderLoop(()=>{n.render()})}_scrollToCenter(){var l;const e=(l=this._currentRender())==null?void 0:l.scene,t=e==null?void 0:e.getViewport(W.SLIDE_KEY.VIEW),n=this._getCenterPositionViewPort(e);if(!t||!n)return;const{left:i,top:s}=n,{x:c,y:o}=t.transViewportScroll2ScrollValue(i,s);t.scrollToBarPos({x:c,y:o})}_currentRender(){return I.getCurrentTypeOfRenderer(a.UniverInstanceType.UNIVER_SLIDE,this._univerInstanceService,this._renderManagerService)}_createSlide(e){const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE),{width:n,height:i}=e,s=t.getPageSize(),{width:c=100,height:o=100}=s,l=new I.Slide(W.SLIDE_KEY.COMPONENT,{left:(n-c)/2,top:(i-o)/2,width:c,height:o,zIndex:10});return l.enableSelectedClipElement(),e.addObject(l),l}_addBackgroundRect(e,t){const i=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE).getPageSize(),{width:s=0,height:c=0}=i,o=new I.Rect("canvas",{left:0,top:0,width:s,height:c,strokeWidth:1,stroke:"rgba(198,198,198,1)",fill:a.getColorStyle(t)||"rgba(255,255,255,1)",zIndex:0,evented:!1});e.addObject(o,0)}_getCenterPositionViewPort(e){if(!e)return{left:0,top:0};const{width:t,height:n}=e,i=e.getEngine(),s=(i==null?void 0:i.width)||0,c=(i==null?void 0:i.height)||0;return{left:(t-s)/2,top:(n-c)/2}}_thumbSceneRender(e,t){const n=this._renderManagerService.getRenderById(e);if(n==null)return;const{engine:i}=n;if(i==null)return;const{width:s,height:c}=t,{width:o=s,height:l=c}=i,g=i.getCanvas().getContext();t.renderToThumb(g,e,o/s,l/c)}_createSlidePages(e,t){const n=e.getPages(),i=e.getPageOrder();if(!(!n||!i)&&i.length!==0){for(let s=0,c=i.length;s<c;s++){const o=i[s];this.createPageScene(o,n[o]),this._createThumb(o)}t.activeFirstPage()}}_createThumb(e){this._renderManagerService.createRender(e)}_getCurrUnitModel(){return this._renderContext.unit}activePage(e){let t=e;const n=this._getCurrUnitModel();let i;if(t)i=n.getPage(t);else{const l=n.getPages(),g=n.getPageOrder();if(g==null||l==null)return;i=l[g[0]],t=i.id}const s=this._currentRender();if(i==null||s==null||s.mainComponent==null)return;const{id:c}=i,o=s.mainComponent;if(n.setActivePage(i),o!=null&&o.hasPage(c)){o.changePage(c);return}this.createPageScene(c,i)}createThumbs(){const t=this._getCurrUnitModel().getPageOrder(),n=this._currentRender();if(!(!t||!n)&&t.length!==0)for(let i=0,s=t.length;i<s;i++){const c=t[i];this._thumbSceneRender(c,n.mainComponent)}}createPageScene(e,t){const n=this._renderContext;if(!n||!this._objectProvider)return;const{scene:i,mainComponent:s}=n,c=s,{width:o,height:l}=c,g=new I.Scene(e,c,{width:o,height:l});new I.Viewport(`PageViewer_${e}`,g,{left:0,top:0,bottom:0,right:0,explicitViewportWidthSet:!1,explicitViewportHeightSet:!1}).closeClip();const{pageElements:v,pageBackgroundFill:_}=t,C=this._objectProvider.convertToRenderObjects(v,i);if(!C||!c)return;this._addBackgroundRect(g,_),g.addObjects(C),g.initTransformer(),C.forEach(m=>{g.attachTransformerTo(m)});const S=g.getTransformer();return S==null||S.changeEnd$.subscribe(()=>{this._thumbSceneRender(e,c)}),S==null||S.clearControl$.subscribe(()=>{this._thumbSceneRender(e,c)}),c.addPageScene(g),g}getPageRenderUnit(e){const n=this._renderContext.mainComponent.getSubScenes().get(e),{engine:i,unit:s}=this._renderContext;return{scene:n,engine:i,unit:s}}createObjectToPage(e,t){const{scene:n}=this.getPageRenderUnit(t);if(!n||!this._objectProvider)return;const i=this._objectProvider.convertToRenderObject(e,n);if(i)return n.addObject(i),n.attachTransformerTo(i),n.getLayer().makeDirty(),i}setObjectActiveByPage(e,t){const{scene:n}=this.getPageRenderUnit(t);if(!n)return;const i=n.getTransformer();i==null||i.activeAnObject(e)}removeObjectById(e,t){const{scene:n}=this.getPageRenderUnit(t);if(!n)return;n.removeObject(e);const i=n.getTransformer();i==null||i.clearControls()}appendPage(){const e=this._getCurrUnitModel(),t=e.getBlankPage(),n=this._currentRender();if(t==null||n==null||n.mainComponent==null)return;const{id:i}=t,s=n.mainComponent,c=this.createPageScene(i,t);s&&c&&s.addPageScene(c),e.appendPage(t),e.setActivePage(t)}};q=nt([pe(1,a.Inject(a.Injector)),pe(2,a.IUniverInstanceService),pe(3,I.IRenderManagerService)],q);var it=Object.getOwnPropertyDescriptor,rt=(r,e,t,n)=>{for(var i=n>1?void 0:n?it(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},st=(r,e)=>(t,n)=>e(t,n,r);h.CanvasView=class extends a.RxDisposable{constructor(e){super(),this._renderManagerService=e}_getSlideRenderControllerFromRenderUnit(e){return this._renderManagerService.getRenderById(e).with(q)}createThumbs(e){this._getSlideRenderControllerFromRenderUnit(e).createThumbs()}activePage(e,t){this._getSlideRenderControllerFromRenderUnit(t).activePage(e)}getRenderUnitByPageId(e,t){return this._getSlideRenderControllerFromRenderUnit(t).getPageRenderUnit(e)}createObjectToPage(e,t,n){return this._getSlideRenderControllerFromRenderUnit(n).createObjectToPage(e,t)}setObjectActiveByPage(e,t,n){return this._getSlideRenderControllerFromRenderUnit(n).setObjectActiveByPage(e,t)}removeObjectById(e,t,n){this._getSlideRenderControllerFromRenderUnit(n).removeObjectById(e,t)}appendPage(e){this._getSlideRenderControllerFromRenderUnit(e).appendPage()}},h.CanvasView=rt([st(0,I.IRenderManagerService)],h.CanvasView);const _e={id:"slide.operation.activate-slide",type:a.CommandType.OPERATION,handler:(r,e)=>{var g,d;const t=e.unitId,n=r.get(h.CanvasView),s=r.get(a.IUniverInstanceService).getUnit(t),c=(g=s==null?void 0:s.getActivePage())==null?void 0:g.id;if(!c)return!1;const o=n.getRenderUnitByPageId(c,t);if(!o)return!1;const l=(d=o.scene)==null?void 0:d.getTransformer();return l&&l.clearControls(),n.activePage(e.id,t),!0}},Ie={id:"slide.operation.append-slide",type:a.CommandType.OPERATION,handler:(r,e)=>{const t=e.unitId;return r.get(a.IUniverInstanceService).getUnit(t)?(r.get(h.CanvasView).appendPage(t),!0):!1}},Se={id:"slide.operation.delete-element",type:a.CommandType.OPERATION,handler:(r,e)=>{if(!(e!=null&&e.id))return!1;const t=e.unitId,i=r.get(a.IUniverInstanceService).getUnit(t);if(!i)return!1;const s=i.getActivePage();return delete s.pageElements[e.id],i.updatePage(s.id,s),r.get(h.CanvasView).removeObjectById(e.id,s.id,t),!0}},te={id:"slide.command.insert-float-image",type:a.CommandType.COMMAND,handler:async(r,e)=>{var A;const t=r.get(a.IUniverInstanceService),n=(A=t.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE))==null?void 0:A.getUnitId();if(!n)return!1;const s=await r.get(f.ILocalFileService).openFile({multiple:!0,accept:fe.DRAWING_IMAGE_ALLOW_IMAGE_LIST.map(D=>`.${D.replace("image/","")}`).join(",")});if(s.length!==1)return!1;const o=await r.get(fe.IImageIoService).saveImage(s[0]);if(!o)return!1;const{imageId:l,imageSourceType:g,source:d,base64Cache:v}=o,{width:_,height:C,image:S}=await fe.getImageSize(v||""),m=t.getUnit(n);if(!m)return!1;const p=m.getActivePage(),b=Object.values(p.pageElements),w=b!=null&&b.length?Math.max(...b.map(D=>D.zIndex)):20,T={id:l,zIndex:w+1,left:0,top:0,width:_,height:C,title:"",description:"",type:a.PageElementType.IMAGE,image:{imageProperties:{contentUrl:v,imageSourceType:g,source:d,base64Cache:v,image:S}}};p.pageElements[l]=T,m.updatePage(p.id,p);const U=r.get(h.CanvasView),P=U.createObjectToPage(T,p.id,n);return P&&U.setObjectActiveByPage(P,p.id,n),!0}};var R=function(){return R=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},R.apply(this,arguments)},at=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},L=E.forwardRef(function(r,e){var t=r.icon,n=r.id,i=r.className,s=r.extend,c=at(r,["icon","id","className","extend"]),o="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),l=E.useRef("_".concat(lt()));return Ve(t,"".concat(n),{defIds:t.defIds,idSuffix:l.current},R({ref:e,className:o},c),s)});function Ve(r,e,t,n,i){return E.createElement(r.tag,R(R({key:e},ct(r,t,i)),n),(ot(r,t).children||[]).map(function(s,c){return Ve(s,"".concat(e,"-").concat(r.tag,"-").concat(c),t,void 0,i)}))}function ct(r,e,t){var n=R({},r.attrs);t!=null&&t.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=t.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(function(s){var c=s[0],o=s[1];c==="mask"&&typeof o=="string"&&(n[c]=o.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var i=e.defIds;return!i||i.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(s){var c=s[0],o=s[1];typeof o=="string"&&(n[c]=o.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function ot(r,e){var t,n=e.defIds;return!n||n.length===0?r:r.tag==="defs"&&(!((t=r.children)===null||t===void 0)&&t.length)?R(R({},r),{children:r.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.includes(i.attrs.id)?R(R({},i),{attrs:R(R({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):r}function lt(){return Math.random().toString(36).substring(2,8)}L.displayName="UniverIcon";var dt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"colorChannel1",d:"M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365ZM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365ZM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635ZM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ae=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"autofill-double-icon",ref:e,icon:dt}))});Ae.displayName="AutofillDoubleIcon";var ut={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334C15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334C2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045ZM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334C3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999C15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999C2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544ZM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999C3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421C6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641C9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421C11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946C8.64077 14.6502 8.70566 14.6923 8.77482 14.7209C8.84557 14.7502 8.92314 14.7664 9.00449 14.7664C9.08585 14.7664 9.16342 14.7502 9.23416 14.7209C9.30332 14.6923 9.36821 14.6502 9.42482 14.5946"}}]},Le=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"bottom-icon",ref:e,icon:ut}))});Le.displayName="BottomIcon";var vt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{clipPath:"url(#graph-icon_clip0_1293_28)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M6.29541 11.1896C3.83208 10.7489 1.9624 8.59552 1.9624 6.00544C1.9624 3.09673 4.32036 0.73877 7.22907 0.73877C9.93483 0.73877 12.164 2.77918 12.4619 5.40527H13.5621C14.998 5.40527 16.1621 6.56933 16.1621 8.00527V12.6719C16.1621 14.1079 14.998 15.2719 13.5621 15.2719H8.89541C7.45947 15.2719 6.29541 14.1079 6.29541 12.6719V11.1896ZM3.1624 6.00544C3.1624 3.75947 4.98311 1.93877 7.22907 1.93877C9.27112 1.93877 10.9616 3.44388 11.2518 5.40527H8.89541C7.45947 5.40527 6.29541 6.56933 6.29541 8.00527V9.96442C4.49946 9.5425 3.1624 7.93012 3.1624 6.00544ZM7.49541 8.00527C7.49541 7.23207 8.12221 6.60527 8.89541 6.60527H13.5621C14.3353 6.60527 14.9621 7.23207 14.9621 8.00527V12.6719C14.9621 13.4451 14.3353 14.0719 13.5621 14.0719H8.89541C8.12221 14.0719 7.49541 13.4451 7.49541 12.6719V8.00527Z",fillRule:"evenodd",clipRule:"evenodd"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"graph-icon_clip0_1293_28"},children:[{tag:"path",attrs:{fill:"white",d:"M0 0H16V16H0z",transform:"translate(.9)"}}]}]}],defIds:["graph-icon_clip0_1293_28"]},Be=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"graph-icon",ref:e,icon:vt}))});Be.displayName="GraphIcon";var ht={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},me=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"more-down-icon",ref:e,icon:ht}))});me.displayName="MoreDownIcon";var gt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.57564 11.6118C5.80995 11.3774 6.18985 11.3774 6.42417 11.6118L7.3999 12.5875V6.36951C7.3999 6.03814 7.66853 5.76951 7.9999 5.76951C8.33127 5.76951 8.5999 6.03814 8.5999 6.36951V12.5875L9.57564 11.6118C9.80995 11.3774 10.1899 11.3774 10.4242 11.6118C10.6585 11.8461 10.6585 12.226 10.4242 12.4603L8.4324 14.452C8.32324 14.5655 8.16982 14.6362 7.9999 14.6362C7.82998 14.6362 7.67655 14.5655 7.56739 14.452L5.57564 12.4603C5.34132 12.226 5.34132 11.8461 5.57564 11.6118Z"}}]},$e=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"move-down-icon",ref:e,icon:gt}))});$e.displayName="MoveDownIcon";var ft={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.57564 4.38825C5.80995 4.62256 6.18985 4.62256 6.42417 4.38825L7.3999 3.41251V9.63049C7.3999 9.96186 7.66853 10.2305 7.9999 10.2305C8.33127 10.2305 8.5999 9.96186 8.5999 9.63049V3.41251L9.57564 4.38825C9.80995 4.62256 10.1899 4.62256 10.4242 4.38825C10.6585 4.15393 10.6585 3.77403 10.4242 3.53972L8.4324 1.54796C8.32324 1.43445 8.16982 1.36382 7.9999 1.36382C7.82998 1.36382 7.67655 1.43446 7.56739 1.54797L5.57564 3.53972C5.34132 3.77403 5.34132 4.15393 5.57564 4.38825Z"}}]},Fe=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"move-up-icon",ref:e,icon:ft}))});Fe.displayName="MoveUpIcon";var pt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z"}},{tag:"path",attrs:{fill:"colorChannel1",d:"M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z"}}]},He=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"paint-bucket-double-icon",ref:e,icon:pt}))});He.displayName="PaintBucketDoubleIcon";var _t={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#text-icon_clip0_1293_26)"},children:[{tag:"path",attrs:{d:"M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z"}},{tag:"path",attrs:{d:"M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"text-icon_clip0_1293_26"},children:[{tag:"path",attrs:{fill:"white",d:"M0 0H16V16H0z",transform:"translate(.9)"}}]}]}],defIds:["text-icon_clip0_1293_26"]},We=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"text-icon",ref:e,icon:_t}))});We.displayName="TextIcon";var It={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9C15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9ZM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9C2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9C13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665C15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665ZM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665C2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665C13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ke=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"topmost-icon",ref:e,icon:It}))});ke.displayName="TopmostIcon";const j={id:"slide.operation.update-element",type:a.CommandType.OPERATION,handler:(r,e)=>{const{oKey:t,props:n}=e,i=r.get(a.IUniverInstanceService),s=e==null?void 0:e.unitId,c=i.getUnit(s);if(!c)return!1;const o=c.getActivePage();return o.pageElements[t]=a.merge(o.pageElements[t],n),c.updatePage(o.id,o),!0}};function St(r){const{pageId:e,unitId:t}=r,n=f.useDependency(a.LocaleService),i=f.useDependency(h.CanvasView),s=f.useDependency(a.ICommandService),c=i.getRenderUnitByPageId(e,t),o=c==null?void 0:c.scene;if(!o)return null;const l=o.getTransformer();if(!l)return null;const d=l.getSelectedObjectMap().values().next().value;if(!d)return null;const v=_=>{const C=o.getAllObjects(),[S,m]=C.reduce(([b,w],T)=>{const U=T.zIndex,P=U<b?U:b,A=U>w?U:w;return[P,A]},[0,0]);let p=d.zIndex;_===3?p=S-1:_===2?p=m+1:_===0?p=d.zIndex+1:_===1&&(p=d.zIndex-1),d.setProps({zIndex:p}),s.executeCommand(j.id,{unitId:t,oKey:d==null?void 0:d.oKey,props:{zIndex:p}})};return u.jsxs("div",{className:"univer-relative univer-w-full",children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full univer-text-left univer-text-gray-600 dark:!univer-text-gray-200",children:u.jsx("div",{children:n.t("image-panel.arrange.title")})})}),u.jsxs("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:[u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Button,{onClick:()=>{v(0)},children:u.jsxs("span",{className:"univer-flex univer-items-center univer-gap-1",children:[u.jsx(Fe,{}),n.t("image-panel.arrange.forward")]})})}),u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Button,{onClick:()=>{v(1)},children:u.jsxs("span",{className:"univer-flex univer-items-center univer-gap-1",children:[u.jsx($e,{}),n.t("image-panel.arrange.backward")]})})})]}),u.jsxs("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:[u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Button,{onClick:()=>{v(2)},children:u.jsxs("span",{className:"univer-flex univer-items-center univer-gap-1",children:[u.jsx(ke,{}),n.t("image-panel.arrange.front")]})})}),u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Button,{onClick:()=>{v(3)},children:u.jsxs("span",{className:"univer-flex univer-items-center univer-gap-1",children:[u.jsx(Le,{}),n.t("image-panel.arrange.back")]})})})]})]})}function mt(r){var S,m;const{pageId:e,unitId:t}=r,n=f.useDependency(a.LocaleService),i=f.useDependency(h.CanvasView),s=f.useDependency(a.ICommandService),c=i.getRenderUnitByPageId(e,t),o=c==null?void 0:c.scene;if(!o)return null;const l=o.getTransformer();if(!l)return null;const d=l.getSelectedObjectMap().values().next().value;if(!d)return null;const[v,_]=E.useState((m=(S=d.fill)==null?void 0:S.toString())!=null?m:"");function C(p){d==null||d.setProps({fill:p}),s.executeCommand(j.id,{unitId:t,oKey:d==null?void 0:d.oKey,props:{shape:{shapeProperties:{shapeBackgroundFill:{rgb:p}}}}}),_(p)}return u.jsx("div",{className:x.clsx("univer-relative univer-bottom-0 univer-mt-5 univer-w-full",x.borderTopClassName),children:u.jsxs("div",{className:"univer-relative univer-w-full",children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full univer-text-left univer-text-gray-600 dark:!univer-text-gray-200",children:u.jsx("div",{children:n.t("slide.panel.fill.title")})})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Dropdown,{overlay:u.jsx("div",{className:"univer-rounded-lg univer-p-4",children:u.jsx(x.ColorPicker,{value:"#fff",onChange:C})}),children:u.jsxs("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-gap-1",children:[u.jsx(He,{className:"univer-fill-primary-600"}),u.jsx(me,{})]})})})})]})})}function Ct(r){const{pageId:e,unitId:t}=r,n=f.useDependency(a.LocaleService),i=f.useDependency(h.CanvasView),s=f.useDependency(a.ICommandService),c=i.getRenderUnitByPageId(e,t),o=c==null?void 0:c.scene;if(!o)return null;const l=o.getTransformer();if(!l)return null;const d=l.getSelectedObjectMap().values().next().value;if(!d)return null;const{width:v=0,height:_=0,left:C=0,top:S=0,angle:m=0}=d,[p,b]=E.useState(v),[w,T]=E.useState(_),[U,P]=E.useState(C),[A,D]=E.useState(S),[Z,$]=E.useState(m),H=y=>{const{objects:J}=y,Q=J.values().next().value,{width:tn=0,height:nn=0,left:rn=0,top:sn=0,angle:an=0}=Q;b(tn),T(nn),P(rn),D(sn),$(an)};E.useEffect(()=>{const y=l.changeStart$.subscribe(Q=>{H(Q)}),J=l.changing$.subscribe(Q=>{H(Q)});return()=>{J.unsubscribe(),y.unsubscribe()}},[]);function B(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{width:y}}),d==null||d.resize(y,d.height),b(y),l==null||l.refreshControls())}function G(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{height:y}}),d==null||d.resize(d.width,y),T(y),l==null||l.refreshControls())}function Y(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{left:y}}),d==null||d.translate(y,d.top),P(y),l==null||l.refreshControls())}function K(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{right:y}}),d==null||d.translate(d.left,y),D(y),l==null||l.refreshControls())}function ge(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{angle:y}}),d==null||d.transformByState({angle:y}),$(y),l==null||l.refreshControls())}return u.jsxs("div",{className:x.clsx("univer-relative univer-bottom-0 univer-mt-5 univer-w-full",x.borderTopClassName),children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full univer-text-left univer-text-gray-600 dark:!univer-text-gray-200",children:u.jsx("div",{children:n.t("image-panel.transform.title")})})}),u.jsxs("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:[u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.width")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",min:1,value:p,onChange:y=>{B(y)}})})})]})}),u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.height")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",min:1,value:w,onChange:y=>{G(y)}})})})]})})]}),u.jsxs("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:[u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.x")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",precision:1,min:0,value:U,onChange:y=>{Y(y)}})})})]})}),u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.y")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",precision:1,min:0,value:A,onChange:y=>{K(y)}})})})]})}),u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.rotate")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",precision:1,value:Z,onChange:ge})})})]})})]})]})}const ne="COMPONENT_SLIDE_SIDEBAR";function bt(){var g,d,v;const r=f.useDependency(a.IUniverInstanceService),e=f.useDependency(h.CanvasView),t=r.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE),n=(g=t==null?void 0:t.getActivePage())==null?void 0:g.id;if(!n)return null;const s=(d=e.getRenderUnitByPageId(n,n).scene)==null?void 0:d.getTransformer();if(!s)return null;const o=s.getSelectedObjectMap().values().next().value;if(!o)return null;const l=((v=r.getFocusedUnit())==null?void 0:v.getUnitId())||"";return u.jsxs("section",{className:"univer-p-2 univer-text-center univer-text-sm",children:[u.jsx(St,{pageId:n,unitId:l}),u.jsx(Ct,{pageId:n,unitId:l}),o.objectType===I.ObjectType.RECT&&u.jsx(mt,{pageId:n,unitId:l})]})}const ie={id:"slide.command.insert-float-shape.rectangle",type:a.CommandType.COMMAND,handler:async r=>{var i;const e=r.get(a.ICommandService),n=(i=r.get(a.IUniverInstanceService).getFocusedUnit())==null?void 0:i.getUnitId();return e.executeCommand(Ce.id,{unitId:n})}},Ce={id:"slide.operation.insert-float-shape.rectangle",type:a.CommandType.OPERATION,handler:async(r,e)=>{const t=a.generateRandomId(6),n=r.get(a.IUniverInstanceService),i=e.unitId,s=n.getUnit(i);if(!s)return!1;const c=s.getActivePage(),o=Object.values(c.pageElements),l=o!=null&&o.length?Math.max(...o.map(_=>_.zIndex)):20,g={id:t,zIndex:l+1,left:378,top:142,width:250,height:250,title:t,description:"",type:a.PageElementType.SHAPE,shape:{shapeType:a.BasicShapes.Rect,text:"",shapeProperties:{shapeBackgroundFill:{rgb:"rgb(0,0,255)"}}}};c.pageElements[t]=g,s.updatePage(c.id,c);const d=r.get(h.CanvasView),v=d.createObjectToPage(g,c.id,i);return v&&d.setObjectActiveByPage(v,c.id,i),!0}},be={id:"sidebar.operation.slide-shape",type:a.CommandType.COMMAND,handler:async(r,e)=>{const{visible:t,objectType:n}=e,i=r.get(f.ISidebarService),s=r.get(a.LocaleService);let c="",o="";return n===I.ObjectType.RECT?(c="slide.sidebar.shape",o=ne):n===I.ObjectType.IMAGE?(c="slide.sidebar.image",o=ne):n===I.ObjectType.RICH_TEXT&&(c="slide.sidebar.text",o=ne),t?i.open({header:{title:s.t(c)},children:{label:o},onClose:()=>{},width:360}):i.close(),!0}},re={id:"slide.command.insert-float-shape.ellipse",type:a.CommandType.COMMAND,handler:async r=>{var i;const e=r.get(a.ICommandService),n=(i=r.get(a.IUniverInstanceService).getFocusedUnit())==null?void 0:i.getUnitId();return e.executeCommand(Ee.id,{unitId:n})}},Ee={id:"slide.operation.insert-float-shape.ellipse",type:a.CommandType.OPERATION,handler:async(r,e)=>{const t=a.generateRandomId(6),n=r.get(a.IUniverInstanceService),i=e.unitId,s=n.getUnit(i);if(!s)return!1;const c=s.getActivePage(),o=Object.values(c.pageElements),l=o!=null&&o.length?Math.max(...o.map(_=>_.zIndex)):20,g={id:t,zIndex:l+1,left:378,top:142,width:250,height:250,title:t,description:"",type:a.PageElementType.SHAPE,shape:{shapeType:a.BasicShapes.Ellipse,text:"",shapeProperties:{radius:100,shapeBackgroundFill:{rgb:"rgb(0,0,255)"}}}};c.pageElements[t]=g,s.updatePage(c.id,c);const d=r.get(h.CanvasView),v=d.createObjectToPage(g,c.id,i);return v&&d.setObjectActiveByPage(v,c.id,i),!0}},se={id:"slide.command.add-text",type:a.CommandType.COMMAND,handler:async r=>{var i;const e=r.get(a.ICommandService),n=(i=r.get(a.IUniverInstanceService).getFocusedUnit())==null?void 0:i.getUnitId();return await e.executeCommand(ye.id,{unitId:n})}},ye={id:"slide.operation.add-text",type:a.CommandType.OPERATION,handler:async(r,e)=>{const t=e.unitId,n=a.generateRandomId(6),i=220,s=40,c=230,o=142,l=(e==null?void 0:e.text)||"A New Text",d=r.get(a.IUniverInstanceService).getUnit(t);if(!d)return!1;const v=d.getActivePage(),_=Object.values(v.pageElements),C=_!=null&&_.length?Math.max(..._.map(b=>b.zIndex)):21,S={id:n,zIndex:C+1,left:c,top:o,width:i,height:s,title:"text",description:"",type:a.PageElementType.TEXT,richText:{text:l,fs:30,cl:{rgb:"rgb(51, 51, 51)"},bl:1}};v.pageElements[n]=S,d.updatePage(v.id,v);const m=r.get(h.CanvasView),p=m.createObjectToPage(S,v.id,t);return p&&m.setObjectActiveByPage(p,v.id,t),!0}},Oe={id:"slide.operation.set-slide-page-thumb",type:a.CommandType.OPERATION,handler:(r,e)=>(r.get(h.CanvasView).createThumbs(e.unitId),!0)};function Ke(){var S,m;const r=f.useDependency(a.IUniverInstanceService),e=f.useDependency(a.ICommandService),t=f.useDependency(I.IRenderManagerService),n=f.useDependency(a.LocaleService),i=E.useRef(null),s=r.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE),c=s==null?void 0:s.getPages(),o=s==null?void 0:s.getPageOrder();if(!c||!o)return null;const l=o.map(p=>c[p]),[g,d]=E.useState((m=(S=s==null?void 0:s.getActivePage())==null?void 0:S.id)!=null?m:null),v=E.useMemo(()=>l.map(()=>E.createRef()),[l]);E.useEffect(()=>{const p=s==null?void 0:s.activePage$.subscribe(b=>{var T;const w=(T=b==null?void 0:b.id)!=null?T:null;w&&d(w)});return()=>{p==null||p.unsubscribe()}},[]),E.useEffect(()=>{v.forEach((p,b)=>{var w;if(p.current){const T=l[b];(w=t.getRenderById(T.id))==null||w.engine.setContainer(p.current)}}),v.length>0&&e.syncExecuteCommand(Oe.id,{unitId:s==null?void 0:s.getUnitId()})},[v,l,t,e,s]);const _=E.useCallback(p=>{e.syncExecuteCommand(_e.id,{id:p,unitId:s==null?void 0:s.getUnitId()})},[e,s]),C=E.useCallback(()=>{e.syncExecuteCommand(Ie.id,{unitId:s==null?void 0:s.getUnitId()})},[e,s]);return u.jsx("aside",{ref:i,className:x.clsx("univer-flex univer-h-full univer-w-64 univer-flex-col univer-overflow-y-auto univer-overflow-x-hidden",x.scrollbarClassName),children:u.jsxs("div",{className:"univer-px-4",children:[u.jsx("header",{className:"univer-flex univer-justify-center univer-pt-4",children:u.jsx("a",{className:x.clsx("univer-box-border univer-block univer-h-8 univer-w-full univer-cursor-pointer univer-rounded-md univer-bg-white univer-text-center univer-text-sm univer-leading-8 univer-transition-colors",x.borderClassName),onClick:C,children:n.t("slide.append")})}),l.map((p,b)=>u.jsxs("div",{className:x.clsx("univer-my-4 univer-flex univer-gap-2",{"[&>div]:univer-border-primary-600 [&>span]:univer-text-primary-600":p.id===g}),onClick:()=>_(p.id),children:[u.jsx("span",{children:b+1}),u.jsx("div",{ref:v[b],className:x.clsx("univer-relative univer-box-border univer-h-32 univer-w-52 univer-bg-white hover:univer-border-primary-600",x.borderClassName)})]},p.id))]})})}const z=a.createInternalEditorID("SLIDE_EDITOR"),Te="slide.menu.image";function Et(r){return{id:Te,type:f.MenuItemType.SUBITEMS,icon:"AddImageIcon",tooltip:"slide.image.insert.title",hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}function yt(r){return{id:te.id,title:"slide.image.insert.float",type:f.MenuItemType.BUTTON,hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}const we="slide.menu.shape";function Ot(r){return{id:we,type:f.MenuItemType.SUBITEMS,icon:"GraphIcon",tooltip:"slide.shape.insert.title",hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}function Tt(r){return{id:ie.id,title:"slide.shape.insert.rectangle",type:f.MenuItemType.BUTTON,hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}function wt(r){return{id:re.id,title:"slide.shape.insert.ellipse",type:f.MenuItemType.BUTTON,hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}function xt(r){return{id:se.id,type:f.MenuItemType.BUTTON,icon:"TextIcon",tooltip:"slide.text.insert.title",hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}const ze={[f.RibbonStartGroup.FORMAT]:{[se.id]:{order:0,menuItemFactory:xt},[Te]:{order:0,menuItemFactory:Et,[te.id]:{order:0,menuItemFactory:yt}},[we]:{order:0,menuItemFactory:Ot,[ie.id]:{order:0,menuItemFactory:Tt},[re.id]:{order:0,menuItemFactory:wt}}}},ae={id:"slide.operation.edit-arrow",type:a.CommandType.OPERATION,handler:()=>!0},Xe="COMPONENT_SLIDE_IMAGE_POPUP_MENU";function Dt(r){var S,m;const e=(m=(S=r.popup)==null?void 0:S.extraProps)==null?void 0:m.menuItems;if(!e)return null;const t=f.useDependency(a.ICommandService),n=f.useDependency(a.LocaleService),[i,s]=E.useState(!1),[c,o]=E.useState(!1),l=()=>{o(!0)},g=()=>{o(!1)},d=p=>{s(p)},v=p=>{t.executeCommand(p.commandId,p.commandParams),s(!1)},_=i||c,C=e.filter(p=>!p.disable);return u.jsx("div",{onMouseEnter:l,onMouseLeave:g,children:u.jsx(x.Dropdown,{align:"start",overlay:u.jsx("ul",{className:x.clsx("univer-m-0 univer-box-border univer-grid univer-list-none univer-items-center univer-gap-1 univer-rounded-lg univer-bg-white univer-p-1.5 univer-text-sm univer-shadow-lg",x.borderClassName),children:C.map(p=>u.jsx("li",{className:"univer-relative univer-box-border univer-flex univer-h-8 univer-cursor-pointer univer-items-center univer-rounded univer-text-sm univer-transition-colors hover:univer-bg-gray-100",onClick:()=>v(p),children:u.jsx("span",{className:"univer-px-2 univer-py-1.5 univer-align-middle",children:n.t(p.label)})},p.index))}),open:i,onOpenChange:d,children:u.jsxs("div",{className:x.clsx("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800",x.borderClassName,{"univer-bg-gray-100 dark:!univer-bg-gray-800":i,"univer-bg-white dark:!univer-bg-gray-900":!i}),children:[u.jsx(Ae,{className:"univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-white"}),_&&u.jsx(me,{className:"dark:!univer-text-white"})]})})})}class Pt{constructor(){O(this,"_state",null);O(this,"_rect",null);O(this,"_state$",new N.BehaviorSubject(null));O(this,"state$",this._state$.asObservable());O(this,"_rect$",new N.BehaviorSubject(null));O(this,"rect$",this._rect$.asObservable());O(this,"_focus",!1);O(this,"_focus$",new N.BehaviorSubject(this._focus));O(this,"focus$",this._focus$.asObservable())}dispose(){this._state$.complete(),this._state=null,this._rect$.complete(),this._rect=null}setState(e){this._state=e,this._refresh(e)}getRect(){return this._rect}setRect(e){this._rect=e,this._rect$.next(e)}getState(){return this._state}setFocus(e=!1){this._focus=e,this._focus$.next(e)}_refresh(e){this._state$.next(e)}}const xe=a.createIdentifier("univer.slide-editor-manager.service"),ce=-1e3,Ze={width:0,height:0,top:ce,left:ce};function Ge(){const[r,e]=E.useState({...Ze}),t=f.useDependency(xe),n=f.useDependency(M.IEditorService),i=f.useDependency(a.IContextService),s=f.useObservable(()=>i.subscribeContextValue$(f.DISABLE_AUTO_FOCUS_KEY),!1,void 0,[i,f.DISABLE_AUTO_FOCUS_KEY]);return a.DocumentFlavor.UNSPECIFIED,E.useEffect(()=>{t.state$.subscribe(c=>{if(c==null)return;const{startX:o=ce,startY:l=ce,endX:g=0,endY:d=0,show:v=!1}=c;if(!v)e({...Ze});else{e({width:g-o-I.FIX_ONE_PIXEL_BLUR_OFFSET+2,height:d-l-I.FIX_ONE_PIXEL_BLUR_OFFSET+2,left:o+I.FIX_ONE_PIXEL_BLUR_OFFSET,top:l+I.FIX_ONE_PIXEL_BLUR_OFFSET});const _=n.getEditor(z);if(_==null)return;const{left:C,top:S,width:m,height:p}=_.getBoundingClientRect();t.setRect({left:C,top:S,width:m,height:p})}})},[]),E.useEffect(()=>{s||t.setFocus(!0)},[s,r]),u.jsx("div",{className:x.clsx("univer-absolute univer-z-10 univer-box-border univer-flex",x.borderClassName),style:{left:r.left,top:r.top,width:r.width,height:r.height}})}function De(r){return r.getContextValue(a.FOCUSING_UNIVER_EDITOR)&&r.getContextValue(a.EDITOR_ACTIVATED)}function Ut(r){return r.getContextValue(a.FORMULA_EDITOR_ACTIVATED)&&r.getContextValue(a.FOCUSING_UNIVER_EDITOR)}const Ye=[f.KeyCode.ARROW_DOWN,f.KeyCode.ARROW_UP,f.KeyCode.ARROW_LEFT,f.KeyCode.ARROW_RIGHT];[f.KeyCode.ENTER,f.KeyCode.TAB,...Ye];function Mt(){const r=[];for(const e of Ye)r.push({id:ae.id,binding:e,preconditions:t=>De(t),staticParameters:{visible:!1,eventType:I.DeviceInputEventType.Keyboard,keycode:e,isShift:!1}}),r.push({id:ae.id,binding:e|f.MetaKeys.SHIFT,preconditions:t=>De(t),staticParameters:{visible:!1,eventType:I.DeviceInputEventType.Keyboard,keycode:e,isShift:!0}});return r}const Nt={id:M.DeleteLeftCommand.id,preconditions:r=>De(r)||Ut(r),binding:f.KeyCode.BACKSPACE};var Rt=Object.getOwnPropertyDescriptor,jt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Rt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},X=(r,e)=>(t,n)=>e(t,n,r);h.SlidesUIController=class extends a.Disposable{constructor(e,t,n,i,s,c){super(),this._injector=e,this._menuManagerService=t,this._componentManager=n,this._uiPartsService=i,this._commandService=s,this._shortcutService=c,this._initCommands(),this._initCustomComponents(),this._initUIComponents(),this._initMenus(),this._initShortcuts()}_initMenus(){this._menuManagerService.mergeMenu(ze)}_initCustomComponents(){const e=this._componentManager;this.disposeWithMe(e.register("TextIcon",We)),this.disposeWithMe(e.register("GraphIcon",Be)),this.disposeWithMe(e.register(Xe,Dt)),this.disposeWithMe(e.register(ne,bt))}_initCommands(){[Ie,_e,Oe,te,ye,se,re,Ee,Ce,ie,be,Se,j,ae].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_initUIComponents(){this.disposeWithMe(this._uiPartsService.registerComponent(f.BuiltInUIPart.LEFT_SIDEBAR,()=>f.connectInjector(Ke,this._injector))),this.disposeWithMe(this._uiPartsService.registerComponent(f.BuiltInUIPart.CONTENT,()=>f.connectInjector(Ge,this._injector)))}_initShortcuts(){[Nt,...Mt()].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}},h.SlidesUIController=jt([X(0,a.Inject(a.Injector)),X(1,f.IMenuManagerService),X(2,a.Inject(f.ComponentManager)),X(3,f.IUIPartsService),X(4,a.ICommandService),X(5,f.IShortcutService)],h.SlidesUIController);const Vt="slides-ui.config",qe={};var At=Object.getOwnPropertyDescriptor,Lt=(r,e,t,n)=>{for(var i=n>1?void 0:n?At(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},oe=(r,e)=>(t,n)=>e(t,n,r);function Bt(r,e){const t=Je(r.left,r.top,e),n=Je(r.right,r.bottom,e);return{left:t.x,top:t.y,right:n.x,bottom:n.y}}function Je(r,e,t){const{scaleX:n,scaleY:i}=t.getAncestorScale(),s=t.getViewport(W.SLIDE_KEY.VIEW);if(!s)return{x:r,y:e};const{viewportScrollX:c,viewportScrollY:o}=s,l=(r-c)*n,g=(e-o)*i;return{x:l,y:g}}h.SlideCanvasPopMangerService=class extends a.Disposable{constructor(e,t,n,i){super(),this._globalPopupManagerService=e,this._renderManagerService=t,this._univerInstanceService=n,this._commandService=i}_createObjectPositionObserver(e,t){const i=(()=>{var B,G,Y,K;const{scene:o,engine:l}=t,{left:g,top:d,width:v,height:_}=e,C=(o.width-((G=(B=t.mainComponent)==null?void 0:B.width)!=null?G:0))/2,S=(o.height-((K=(Y=t.mainComponent)==null?void 0:Y.height)!=null?K:0))/2,m={left:g,right:g+v,top:d,bottom:d+_},p=l.getCanvasElement(),b=p.getBoundingClientRect(),w=I.pxToNum(p.style.width),{scaleX:T,scaleY:U}=o.getAncestorScale(),P=Bt(m,o),{top:A,left:D,width:Z}=b,$=Z/w;return{left:P.left*$*T+D+C,right:P.right*$*T+D+C,top:P.top*$*U+A+S,bottom:P.bottom*$*U+A+S}})(),s=new N.BehaviorSubject(i),c=new a.DisposableCollection;return{position:i,position$:s,disposable:c}}attachPopupToObject(e,t){const i=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE).getUnitId(),s=this._renderManagerService.getRenderById(i);if(!s)return{dispose:()=>{}};const{position:c,position$:o,disposable:l}=this._createObjectPositionObserver(e,s),g=this._globalPopupManagerService.addPopup({...t,unitId:i,subUnitId:"default",anchorRect:c,anchorRect$:o,canvasElement:s.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(g),o.complete(),l.dispose()}}}},h.SlideCanvasPopMangerService=Lt([oe(0,a.Inject(f.ICanvasPopupService)),oe(1,I.IRenderManagerService),oe(2,a.IUniverInstanceService),oe(3,a.ICommandService)],h.SlideCanvasPopMangerService);var $t=Object.getOwnPropertyDescriptor,Ft=(r,e,t,n)=>{for(var i=n>1?void 0:n?$t(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},k=(r,e)=>(t,n)=>e(t,n,r);let le=class extends a.RxDisposable{constructor(e,t,n,i,s,c,o){super();O(this,"_initImagePopupMenu",new Set);this._canvasPopManagerService=e,this._renderManagerService=t,this._univerInstanceService=n,this._contextService=i,this._canvasView=s,this._sidebarService=c,this._commandService=o,this._init()}_init(){this._univerInstanceService.getAllUnitsForType(a.UniverInstanceType.UNIVER_SLIDE).forEach(e=>this._create(e))}_create(e){if(!e)return;const t=e.getUnitId();this._renderManagerService.has(t)&&!this._initImagePopupMenu.has(t)&&(this._popupMenuListener(t),this._initImagePopupMenu.add(t))}_hasCropObject(e){}_popupMenuListener(e){var i;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE),n=(i=t==null?void 0:t.getPages())!=null?i:{};Object.keys(n).forEach(s=>{var g;const o=(g=this._canvasView.getRenderUnitByPageId(s,e).scene)==null?void 0:g.getTransformer();if(!o)return;let l;this.disposeWithMe(a.toDisposable(o.createControl$.subscribe(()=>{const d=o.getSelectedObjectMap();if(d.size>1){l==null||l.dispose();return}const v=d.values().next().value;if(!v)return;const _=v.oKey;l==null||l.dispose(),l=this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(v,{componentKey:Xe,direction:"horizontal",offset:[2,0],extraProps:{menuItems:this._getMenuItemsByObjectType(v.objectType,_,e)}})),this._sidebarService.visible&&this._commandService.executeCommand(be.id,{visible:!0,objectType:v.objectType})}))),this.disposeWithMe(o.clearControl$.subscribe(()=>{l==null||l.dispose(),this._contextService.setContextValue(a.FOCUSING_COMMON_DRAWINGS,!1)})),this.disposeWithMe(o.changing$.subscribe(()=>{l==null||l.dispose();const d=o.getSelectedObjectMap();if(d.size>1){l==null||l.dispose();return}const v=d.values().next().value;v&&this._commandService.executeCommand(j.id,{unitId:e,oKey:v.oKey,props:{width:v.width,height:v.height,left:v.left,top:v.top}})}))})}_getMenuItemsByObjectType(e,t,n){return[{label:"slide.popup.edit",index:0,commandId:be.id,commandParams:{visible:!0,objectType:e},disable:!1},{label:"slide.popup.delete",index:5,commandId:Se.id,commandParams:{id:t,unitId:n},disable:!1}]}};le=Ft([k(0,a.Inject(h.SlideCanvasPopMangerService)),k(1,I.IRenderManagerService),k(2,a.IUniverInstanceService),k(3,a.IContextService),k(4,a.Inject(h.CanvasView)),k(5,f.ISidebarService),k(6,a.ICommandService)],le);var Ht=Object.getOwnPropertyDescriptor,Wt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Ht(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},Pe=(r,e)=>(t,n)=>e(t,n,r);const de=a.createIdentifier("univer.slide-editor-bridge.service");let Ue=class extends a.Disposable{constructor(e,t,n){super();O(this,"_editorUnitId",z);O(this,"_isForceKeepVisible",!1);O(this,"_editorIsDirty",!1);O(this,"_currentEditRectState",null);O(this,"_currentEditRectState$",new N.BehaviorSubject(null));O(this,"currentEditRectState$",this._currentEditRectState$.asObservable());O(this,"_visibleParam",{visible:!1,eventType:I.DeviceInputEventType.Dblclick,unitId:""});O(this,"_visible$",new N.BehaviorSubject(this._visibleParam));O(this,"visible$",this._visible$.asObservable());O(this,"_afterVisible$",new N.BehaviorSubject(this._visibleParam));O(this,"afterVisible$",this._afterVisible$.asObservable());O(this,"endEditing$",new N.Subject);O(this,"_currentEditRectInfo");this._editorService=e,this._contextService=t,this._renderManagerService=n}dispose(){super.dispose()}getEditorRect(){return this._currentEditRectInfo}setEditorRect(e){this._currentEditRectInfo=e,this._editorService.getFocusEditor()||(this._editorService.focus(z),this._contextService.setContextValue(a.EDITOR_ACTIVATED,!1),this._contextService.setContextValue(a.FOCUSING_EDITOR_STANDALONE,!1),this._contextService.setContextValue(a.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE,!1));const t=this.getEditRectState();this._currentEditRectState=t,this._currentEditRectState$.next(t)}changeVisible(e){this._visibleParam=e,e.visible&&(this._editorIsDirty=!1),this._visible$.next(this._visibleParam),this._afterVisible$.next(this._visibleParam)}getEditRectState(){const e=z,t=this._currentEditRectInfo,n=t.unitId,i=t.richTextObj.documentData;i.id=e,i.documentStyle={...i.documentStyle,pageSize:{width:t.richTextObj.width,height:1/0}};const c={documentModel:new a.DocumentDataModel(i),fontString:"document",textRotation:{a:0,v:0},wrapStrategy:0,verticalAlign:a.VerticalAlign.TOP,horizontalAlign:a.HorizontalAlign.LEFT,paddingData:{t:0,b:1,l:2,r:2}},o=t.richTextObj.width,l=t.richTextObj.height,g=t.richTextObj.left,d=t.richTextObj.top,v={left:0,top:0},_=this._renderManagerService.getRenderById(n),C=_==null?void 0:_.scene,S=C==null?void 0:C.getViewport(W.SLIDE_KEY.VIEW),m=C==null?void 0:C.getObject(W.SLIDE_KEY.COMPONENT),p={x:(m==null?void 0:m.left)||0,y:(m==null?void 0:m.top)||0},b=(S==null?void 0:S.viewportScrollX)||0,w=(S==null?void 0:S.viewportScrollY)||0;return v.left=p.x-b,v.top=p.y-w,{position:{startX:g,startY:d,endX:g+o,endY:d+l},scaleX:1,scaleY:1,slideCardOffset:v,unitId:n,editorUnitId:e,documentLayoutObject:c}}changeEditorDirty(e){this._editorIsDirty=e}isVisible(){return this._visibleParam.visible}getEditorDirty(){return this._editorIsDirty}getCurrentEditorId(){return this._editorUnitId}genDocData(e){const t=this.getCurrentEditorId(),n=e.text,i=e.fs;return{id:t,body:{dataStream:`${n}\r
2
- `,textRuns:[{st:0,ed:n.length}],paragraphs:[{paragraphStyle:{},startIndex:n.length+1}],sectionBreaks:[{startIndex:n.length+2}]},documentStyle:{marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,pageSize:{width:1/0,height:1/0},textStyle:{fs:i},renderConfig:{verticalAlign:a.VerticalAlign.MIDDLE,centerAngle:0,vertexAngle:0,wrapStrategy:0}},drawings:{},drawingsOrder:[],settings:{zoomRatio:1}}}};Ue=Wt([Pe(0,M.IEditorService),Pe(1,a.IContextService),Pe(2,I.IRenderManagerService)],Ue);var F=(r=>(r[r.InitialState=0]="InitialState",r[r.StartEditor=1]="StartEditor",r[r.CursorChange=2]="CursorChange",r))(F||{}),kt=Object.getOwnPropertyDescriptor,Kt=(r,e,t,n)=>{for(var i=n>1?void 0:n?kt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},V=(r,e)=>(t,n)=>e(t,n,r);const Qe=-1e3,et=5,zt=2;let Me=class extends a.Disposable{constructor(e,t,n,i,s,c,o,l,g,d,v,_){super();O(this,"_cursorChange",F.InitialState);O(this,"_isUnitEditing",!1);O(this,"_d");this._renderContext=e,this._layoutService=t,this._undoRedoService=n,this._contextService=i,this._instanceSrv=s,this._renderManagerService=c,this._editorBridgeService=o,this._cellEditorManagerService=l,this._textSelectionManagerService=g,this._commandService=d,this._localService=v,this._editorService=_,this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_SLIDE).subscribe(C=>{C&&C.getUnitId()===this._renderContext.unitId?this._d=this._init():(this._disposeCurrent(),this._isUnitEditing&&(this._handleEditorInvisible({visible:!1,eventType:I.DeviceInputEventType.Keyboard,keycode:f.KeyCode.ESC,unitId:this._renderContext.unitId}),this._isUnitEditing=!1))})),this._initEditorVisibilityListener()}dispose(){super.dispose(),this._disposeCurrent()}_disposeCurrent(){var e;(e=this._d)==null||e.dispose(),this._d=null}_init(){const e=new a.DisposableCollection;return this._subscribeToCurrentCell(e),this._initialKeyboardListener(e),this._initialCursorSync(e),this._listenEditorFocus(e),this._commandExecutedListener(e),setTimeout(()=>{this._cursorStateListener(e)},1e3),e}_initEditorVisibilityListener(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(e=>{e.visible?(this._isUnitEditing=!0,this._handleEditorVisible(e)):this._isUnitEditing&&(this._handleEditorInvisible(e),this._isUnitEditing=!1)}))}_listenEditorFocus(e){const t=this._getEditorObject();t&&e.add(t.document.onPointerDown$.subscribeEvent(()=>{}))}_getEditorSkeleton(e){var t;return(t=this._renderManagerService.getRenderById(e))==null?void 0:t.with(ee.DocSkeletonManagerService).getSkeleton()}_getEditorViewModel(e){var t;return(t=this._renderManagerService.getRenderById(e))==null?void 0:t.with(ee.DocSkeletonManagerService).getViewModel()}_initialCursorSync(e){e.add(this._cellEditorManagerService.focus$.pipe(N.filter(t=>!!t)).subscribe(()=>{var t;(t=I.getCurrentTypeOfRenderer(a.UniverInstanceType.UNIVER_DOC,this._instanceSrv,this._renderManagerService))==null||t.with(M.DocSelectionRenderService).sync()}))}_subscribeToCurrentCell(e){e.add(this._editorBridgeService.currentEditRectState$.subscribe(t=>{var v;if(t==null||this._contextService.getContextValue(a.FOCUSING_EDITOR_STANDALONE)||this._contextService.getContextValue(a.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE))return;const{position:{startX:n,endX:i},documentLayoutObject:{textRotation:s,wrapStrategy:c,documentModel:o},scaleX:l,editorUnitId:g}=t,{vertexAngle:d}=I.convertTextRotation(s);o.updateDocumentId(g),c===a.WrapStrategy.WRAP&&d===0&&o.updateDocumentDataPageSize((i-n)/l),this._instanceSrv.changeDoc(g,o),this._contextService.setContextValue(a.FOCUSING_EDITOR_BUT_HIDDEN,!0),this._textSelectionManagerService.replaceTextRanges([{startOffset:0,endOffset:0}]),(v=I.getCurrentTypeOfRenderer(a.UniverInstanceType.UNIVER_DOC,this._instanceSrv,this._renderManagerService))==null||v.with(M.DocSelectionRenderService).activate(Qe,Qe)}))}_fitTextSize(e,t,n,i,s=1,c=1){const{startX:o,startY:l,endX:g,endY:d}=e,v=i.documentModel;if(v==null)return;const{actualWidth:_,actualHeight:C}=this._predictingSize(e,t,n,i,s,c),{verticalAlign:S,paddingData:m,fill:p}=i;let b=g-o,w=d-l;if(b<_&&(b=_),w<C)w=C,v.updateDocumentDataMargin(m);else{let T=0;S===a.VerticalAlign.MIDDLE?T=(w-C)/2/c:S===a.VerticalAlign.TOP?T=m.t||0:T=(w-C)/c-(m.b||0),T=T<(m.t||0)?m.t||0:T,v.updateDocumentDataMargin({t:T})}n.calculate(),this._editAreaProcessing(b,w,e,t,p,s,c)}_predictingSize(e,t,n,i,s=1,c=1){const{startX:o,endX:l}=e,{textRotation:g,wrapStrategy:d}=i,v=i.documentModel,{vertexAngle:_}=I.convertTextRotation(g),C=document.body.clientWidth;if(d===a.WrapStrategy.WRAP&&_===0){const{actualWidth:p,actualHeight:b}=n.getActualSize();return{actualWidth:p*s,actualHeight:b*c}}v==null||v.updateDocumentDataPageSize((C-o-t.left)/s),n.calculate();const S=n.getActualSize();let m=l-o;return m<S.actualWidth*s+et*s&&(m=S.actualWidth*s+et*s),v==null||v.updateDocumentDataPageSize(m/s),v==null||v.updateDocumentRenderConfig({horizontalAlign:a.HorizontalAlign.UNSPECIFIED,cellValueType:void 0}),{actualWidth:m,actualHeight:S.actualHeight*c}}_editAreaProcessing(e,t,n,i,s,c=1,o=1){var y;const l=this._getEditorObject();if(l==null)return;function g(J){return Number.parseInt(J.replace("px",""))}const v=this._renderContext.engine.getCanvasElement(),_=v.getBoundingClientRect(),C=g(v.style.width),{top:S,left:m,width:p}=_,b=p/C;let{startX:w,startY:T}=n;w+=i.left,T+=i.top;const{document:U,scene:P,engine:A}=l,D=P.getViewport(M.VIEWPORT_KEY.VIEW_MAIN),Z=document.body.clientHeight-T-i.top-zt*2,$=document.body.clientWidth-w-i.left;let H=t,B=D==null?void 0:D.getScrollBar();H>Z?(H=Z,B==null?D&&new I.ScrollBar(D,{enableHorizontal:!1,barSize:8}):D==null||D.resetCanvasSizeAndUpdateScroll()):(B=null,(y=D==null?void 0:D.getScrollBar())==null||y.dispose()),e+=(B==null?void 0:B.barSize)||0,e=Math.min(e,$),w-=I.FIX_ONE_PIXEL_BLUR_OFFSET,T-=I.FIX_ONE_PIXEL_BLUR_OFFSET,this._addBackground(P,e/c,t/o,s);const{scaleX:G,scaleY:Y}=P.getPrecisionScale();P.transformByState({width:e*b/c,height:t*b/o,scaleX:c*b,scaleY:o*b}),U.resize(e/c,t/o),setTimeout(()=>{A.resizeBySize(I.fixLineWidthByScale(e,G),I.fixLineWidthByScale(H,Y))},0);const K=this._layoutService.getContentElement().getBoundingClientRect(),ge=v.getBoundingClientRect();w=w*b+(ge.left-K.left),T=T*b+(ge.top-K.top),this._cellEditorManagerService.setState({startX:w,startY:T,endX:e*b+w,endY:H*b+T,show:!0})}_addBackground(e,t,n,i){const s="_backgroundRectHelperColor_",c=e.getObject(s);c==null&&i==null||(c==null?e.addObjects([new I.Rect(s,{width:t,height:n,fill:i,evented:!1})],M.DOCS_COMPONENT_MAIN_LAYER_INDEX):i==null?c.dispose():(c.setProps({fill:i}),c.transformByState({width:t,height:n})))}_handleEditorVisible(e){var p,b;const{eventType:t}=e;this._cursorChange=[I.DeviceInputEventType.PointerDown,I.DeviceInputEventType.Dblclick].includes(t)?F.CursorChange:F.StartEditor;const n=this._editorBridgeService.getEditRectState();if(n==null)return;const{position:i,documentLayoutObject:s,slideCardOffset:c,scaleX:o,scaleY:l,editorUnitId:g,unitId:d}=n,v=this._getEditorObject();if(v==null)return;const{scene:_}=v;this._contextService.setContextValue(a.EDITOR_ACTIVATED,!0);const{documentModel:C}=s,S=this._getEditorSkeleton(g);if(!S||!C)return;this._fitTextSize(i,c,S,s,o,l);const m=C.getBody().dataStream.length-2||0;(p=_.getViewport(M.VIEWPORT_KEY.VIEW_MAIN))==null||p.scrollToViewportPos({viewportScrollX:Number.POSITIVE_INFINITY}),this._textSelectionManagerService.replaceTextRanges([{startOffset:m,endOffset:m}]),(b=this._renderManagerService.getRenderById(d))==null||b.scene.resetCursor()}_resetBodyStyle(e,t=!1){e.dataStream=a.DEFAULT_EMPTY_DOCUMENT_VALUE,e.textRuns!=null&&(e.textRuns.length===1&&!t?(e.textRuns[0].st=0,e.textRuns[0].ed=1):e.textRuns=void 0),e.paragraphs!=null&&(e.paragraphs.length===1?e.paragraphs[0].startIndex=0:e.paragraphs=[{startIndex:0}]),e.sectionBreaks!=null&&(e.sectionBreaks=void 0),e.tables!=null&&(e.tables=void 0),e.customRanges!=null&&(e.customRanges=void 0),e.customBlocks!=null&&(e.customBlocks=void 0)}_initialKeyboardListener(e){}_showEditorByKeyboard(e){}_commandExecutedListener(e){const t=[ae.id],n=[ee.RichTextEditingMutation.id];e.add(this._commandService.onCommandExecuted(i=>{this._editorService.getFocusId()===z&&(t.includes(i.id)&&this._moveCursorCmdHandler(i),n.includes(i.id)&&this._editorBridgeService.isVisible()&&this._editingChangedHandler())}))}_moveCursorCmdHandler(e){const t=e.params,{keycode:n,isShift:i}=t;n!=null&&this._cursorChange===F.CursorChange?this._moveInEditor(n,i):this._editorBridgeService.changeVisible(t)}_editingChangedHandler(){const e=this._editorBridgeService.getEditorRect();if(!e)return;const t=e.richTextObj;t.refreshDocumentByDocData(),t.resizeToContentSize();const{unitId:n}=this._renderContext;this._handleEditorVisible({visible:!0,eventType:3,unitId:n})}_getEditorObject(){return Xt(this._editorBridgeService.getCurrentEditorId(),this._renderManagerService)}async _handleEditorInvisible(e){const{keycode:t}=e;if(this._cursorChange=F.InitialState,this._exitInput(e),this._editorBridgeService.getEditRectState()==null)return;if(this._editorBridgeService.getEditorDirty()===!1){this._moveCursor(t);return}this._moveCursor(t)}_exitInput(e){this._contextService.setContextValue(a.EDITOR_ACTIVATED,!1),this._cellEditorManagerService.setState({show:e.visible});const t=this._editorBridgeService.getCurrentEditorId();t!=null&&this._undoRedoService.clearUndoRedo(t)}_moveCursor(e){if(e!=null)switch(a.Direction.LEFT,e){case f.KeyCode.ENTER:a.Direction.DOWN;break;case f.KeyCode.TAB:a.Direction.RIGHT;break;case f.KeyCode.ARROW_DOWN:a.Direction.DOWN;break;case f.KeyCode.ARROW_UP:a.Direction.UP;break;case f.KeyCode.ARROW_LEFT:a.Direction.LEFT;break;case f.KeyCode.ARROW_RIGHT:a.Direction.RIGHT;break}}_cursorStateListener(e){const t=this._getEditorObject();if(!t)return;const{document:n}=t;e.add(a.toDisposable(n.onPointerDown$.subscribeEvent(()=>{this._cursorChange===F.StartEditor&&(this._cursorChange=F.CursorChange)})))}_moveInEditor(e,t){let n=a.Direction.LEFT;e===f.KeyCode.ARROW_DOWN?n=a.Direction.DOWN:e===f.KeyCode.ARROW_UP?n=a.Direction.UP:e===f.KeyCode.ARROW_RIGHT&&(n=a.Direction.RIGHT),t?this._commandService.executeCommand(M.MoveSelectionOperation.id,{direction:n}):this._commandService.executeCommand(M.MoveCursorOperation.id,{direction:n})}};Me=Kt([V(1,f.ILayoutService),V(2,a.IUndoRedoService),V(3,a.IContextService),V(4,a.IUniverInstanceService),V(5,I.IRenderManagerService),V(6,de),V(7,xe),V(8,a.Inject(ee.DocSelectionManagerService)),V(9,a.ICommandService),V(10,a.Inject(a.LocaleService)),V(11,M.IEditorService)],Me);function Xt(r,e){if(r==null)return;const t=e.getRenderById(r);if(t==null)return;const{mainComponent:n,scene:i,engine:s,components:c}=t,o=n,l=c.get(M.DOCS_VIEW_KEY.BACKGROUND);return{document:o,docBackground:l,scene:i,engine:s}}var Zt=Object.getOwnPropertyDescriptor,Gt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Zt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},Ne=(r,e)=>(t,n)=>e(t,n,r);let Re=class extends a.RxDisposable{constructor(e,t,n,i){super();O(this,"setSlideTextEditor$",new N.Subject);O(this,"_curRichText",null);O(this,"_d");this._renderContext=e,this._instanceSrv=t,this._commandService=n,this._editorBridgeService=i,this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_SLIDE).subscribe(s=>{s&&s.getUnitId()===this._renderContext.unitId?this._d=this._init():this._disposeCurrent()}))}_init(){const e=new a.DisposableCollection;return this._initEventListener(e),e}_disposeCurrent(){var e;(e=this._d)==null||e.dispose(),this._d=null}_setEditorRect(e,t){this._curRichText=t;const{scene:n,engine:i}=this._renderContext,s=this._renderContext.unitId,c={scene:n,engine:i,unitId:s,pageId:e,richTextObj:t};this._editorBridgeService.setEditorRect(c)}_initEventListener(e){const t=c=>{const o=c.getTransformer();o&&(e.add(o.clearControl$.subscribe(()=>{this.setEditorVisible(!1),this.pickOtherObjects()})),e.add(o.createControl$.subscribe(()=>{this.setEditorVisible(!1)})),e.add(c.onDblclick$.subscribeEvent(()=>{o.clearControls();const g=o.getSelectedObjectMap().values().next().value;g&&(g.objectType!==I.ObjectType.RICH_TEXT?this.pickOtherObjects():this.startEditing(c.sceneKey,g))})),e.add(this._instanceSrv.focused$.subscribe(l=>{this.endEditing()})))},{mainComponent:n}=this._renderContext;n.subSceneChanged$.subscribeEvent(c=>{t(c)});const s=Array.from(n.getSubScenes().values());for(let c=0;c<s.length;c++){const o=s[c];t(o)}}pickOtherObjects(){this.endEditing()}endEditing(){var s;if(!this._curRichText)return;this.setEditorVisible(!1);const e=this._curRichText;if(!this._instanceSrv.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE))return!1;e.refreshDocumentByDocData(),e.resizeToContentSize(),this._editorBridgeService.endEditing$.next(e);const n={bl:1,fs:e.fs,text:e.text},i=(s=e.documentData.body)==null?void 0:s.textRuns;if(i&&i.length){const o=i[0].ts;n.cl=o==null?void 0:o.cl}this._commandService.executeCommand(j.id,{unitId:this._renderContext.unitId,oKey:e==null?void 0:e.oKey,props:{richText:n}}),this._curRichText=null}startEditing(e,t){this._setEditorRect(e,t),this.setEditorVisible(!0)}setEditorVisible(e){var n,i;e?(n=this._curRichText)==null||n.hide():(i=this._curRichText)==null||i.show();const{unitId:t}=this._renderContext;this._editorBridgeService.changeVisible({visible:e,eventType:I.DeviceInputEventType.PointerDown,unitId:t})}};Re=Gt([Ne(1,a.IUniverInstanceService),Ne(2,a.ICommandService),Ne(3,de)],Re);var Yt=Object.getOwnPropertyDescriptor,qt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Yt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},je=(r,e)=>(t,n)=>e(t,n,r);let ue=class extends a.RxDisposable{constructor(r,e,t){super(),this._contextService=r,this._instanceSrv=e,this._renderManagerService=t,Promise.resolve().then(()=>this._init())}_init(){this._initSlideDataListener(),this._initContextListener()}_initSlideDataListener(){this._instanceSrv.getTypeOfUnitAdded$(a.UniverInstanceType.UNIVER_SLIDE).pipe(N.takeUntil(this.dispose$)).subscribe(r=>{this._createRenderer(r==null?void 0:r.getUnitId())}),this._instanceSrv.getAllUnitsForType(a.UniverInstanceType.UNIVER_SLIDE).forEach(r=>{this._createRenderer(r.getUnitId())}),this._instanceSrv.getTypeOfUnitDisposed$(a.UniverInstanceType.UNIVER_SLIDE).pipe(N.takeUntil(this.dispose$)).subscribe(r=>this._disposeRenderer(r))}_createRenderer(r){r==null||this._instanceSrv.getUnit(r,a.UniverInstanceType.UNIVER_SLIDE)==null||this._renderManagerService.createRender(r)}_disposeRenderer(r){const e=r.getUnitId();this._renderManagerService.removeRender(e)}_initContextListener(){}};ue=qt([je(0,a.IContextService),je(1,a.IUniverInstanceService),je(2,I.IRenderManagerService)],ue);var Jt=Object.getOwnPropertyDescriptor,Qt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Jt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},ve=(r,e)=>(t,n)=>e(t,n,r);const en="SLIDE_UI";h.UniverSlidesUIPlugin=(he=class extends a.Plugin{constructor(e=qe,t,n,i,s){super(),this._config=e,this._injector=t,this._renderManagerService=n,this._univerInstanceService=i,this._configService=s;const{menu:c,...o}=a.merge({},qe,this._config);c&&this._configService.setConfig("menu",c,{merge:!0}),this._configService.setConfig(Vt,o)}onStarting(){a.mergeOverrideWithDependencies([[ue],[de,{useClass:Ue}],[xe,{useClass:Pt}],[h.SlideCanvasPopMangerService]],this._config.override).forEach(e=>this._injector.add(e))}onReady(){[[q]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(a.UniverInstanceType.UNIVER_SLIDE,e))}),a.mergeOverrideWithDependencies([[h.CanvasView],[h.SlidesUIController],[q],[le]],this._config.override).forEach(e=>{this._injector.add(e)}),this._injector.get(h.CanvasView),this._injector.get(ue)}onRendered(){[[Re],[Me]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(a.UniverInstanceType.UNIVER_SLIDE,e))}),this._markSlideAsFocused(),this._injector.get(h.SlidesUIController)}onSteady(){this._injector.get(le)}_markSlideAsFocused(){const e=this._univerInstanceService;try{const t=e.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE);e.focusUnit(t.getUnitId())}catch{}}},O(he,"pluginName",en),O(he,"type",a.UniverInstanceType.UNIVER_SLIDE),he),h.UniverSlidesUIPlugin=Qt([ve(1,a.Inject(a.Injector)),ve(2,I.IRenderManagerService),ve(3,a.IUniverInstanceService),ve(4,a.IConfigService)],h.UniverSlidesUIPlugin),h.ActivateSlidePageOperation=_e,h.AppendSlideOperation=Ie,h.DeleteSlideElementOperation=Se,h.ISlideEditorBridgeService=de,h.InsertSlideFloatImageCommand=te,h.InsertSlideShapeEllipseCommand=re,h.InsertSlideShapeEllipseOperation=Ee,h.InsertSlideShapeRectangleCommand=ie,h.InsertSlideShapeRectangleOperation=Ce,h.SHAPE_MENU_ID=we,h.SLIDES_IMAGE_MENU_ID=Te,h.SLIDE_EDITOR_ID=z,h.SetSlidePageThumbOperation=Oe,h.SlideAddTextCommand=se,h.SlideAddTextOperation=ye,h.SlideEditorContainer=Ge,h.SlideSideBar=Ke,h.SlidesUIMenuSchema=ze,h.UpdateSlideElementOperation=j,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
1
+ (function(h,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/slides"),require("@univerjs/drawing"),require("@univerjs/ui"),require("react/jsx-runtime"),require("@univerjs/design"),require("react"),require("@univerjs/docs-ui"),require("rxjs"),require("@univerjs/docs")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/slides","@univerjs/drawing","@univerjs/ui","react/jsx-runtime","@univerjs/design","react","@univerjs/docs-ui","rxjs","@univerjs/docs"],a):(h=typeof globalThis<"u"?globalThis:h||self,a(h.UniverSlidesUi={},h.UniverCore,h.UniverEngineRender,h.UniverSlides,h.UniverDrawing,h.UniverUi,h.React,h.UniverDesign,h.React,h.UniverDocsUi,h.rxjs,h.UniverDocs))})(this,(function(h,a,I,W,fe,f,u,x,E,M,N,ee){"use strict";var cn=Object.defineProperty;var on=(h,a,I)=>a in h?cn(h,a,{enumerable:!0,configurable:!0,writable:!0,value:I}):h[a]=I;var O=(h,a,I)=>on(h,typeof a!="symbol"?a+"":a,I);var he;var tt=Object.getOwnPropertyDescriptor,nt=(r,e,t,n)=>{for(var i=n>1?void 0:n?tt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},pe=(r,e)=>(t,n)=>e(t,n,r);let q=class extends a.RxDisposable{constructor(e,t,n,i){super();O(this,"_objectProvider",null);O(this,"_refreshThumb",a.debounce(()=>{this.createThumbs()},300));this._renderContext=e,this._injector=t,this._univerInstanceService=n,this._renderManagerService=i,this._objectProvider=this._injector.createInstance(W.ObjectProvider),this._addNewRender()}_addNewRender(){const{unitId:e,engine:t,scene:n}=this._renderContext,i=this._getCurrUnitModel();if(!i)return;const s=t.onTransformChange$.subscribeEvent(()=>{this._scrollToCenter(),s==null||s.unsubscribe()});t.onTransformChange$.subscribeEvent(()=>{setTimeout(()=>{this.createThumbs()},300)});const c=new I.Viewport(W.SLIDE_KEY.VIEW,n,{left:0,top:0,bottom:0,right:0,explicitViewportWidthSet:!1,explicitViewportHeightSet:!1,isWheelPreventDefaultX:!0});n.attachControl(),n.onMouseWheel$.subscribeEvent((l,g)=>{const d=l;if(d.ctrlKey){const v=Math.abs(d.deltaX);let _=v<40?.2:v<80?.4:.2;_*=d.deltaY>0?-1:1,n.scaleX<1&&(_/=2),n.scaleX+_>4?n.scale(4,4):n.scaleX+_<.1?n.scale(.1,.1):(d.deltaY>0,d.preventDefault())}else c.onMouseWheel(d,g)}),n.onFileLoaded$.subscribeEvent(()=>{this._refreshThumb()}),I.ScrollBar.attachTo(c);const o=this._createSlide(n);this._renderContext.mainComponent=o,this._createSlidePages(i,o),this.createThumbs(),t.runRenderLoop(()=>{n.render()})}_scrollToCenter(){var l;const e=(l=this._currentRender())==null?void 0:l.scene,t=e==null?void 0:e.getViewport(W.SLIDE_KEY.VIEW),n=this._getCenterPositionViewPort(e);if(!t||!n)return;const{left:i,top:s}=n,{x:c,y:o}=t.transViewportScroll2ScrollValue(i,s);t.scrollToBarPos({x:c,y:o})}_currentRender(){return I.getCurrentTypeOfRenderer(a.UniverInstanceType.UNIVER_SLIDE,this._univerInstanceService,this._renderManagerService)}_createSlide(e){const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE),{width:n,height:i}=e,s=t.getPageSize(),{width:c=100,height:o=100}=s,l=new I.Slide(W.SLIDE_KEY.COMPONENT,{left:(n-c)/2,top:(i-o)/2,width:c,height:o,zIndex:10});return l.enableSelectedClipElement(),e.addObject(l),l}_addBackgroundRect(e,t){const i=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE).getPageSize(),{width:s=0,height:c=0}=i,o=new I.Rect("canvas",{left:0,top:0,width:s,height:c,strokeWidth:1,stroke:"rgba(198,198,198,1)",fill:a.getColorStyle(t)||"rgba(255,255,255,1)",zIndex:0,evented:!1});e.addObject(o,0)}_getCenterPositionViewPort(e){if(!e)return{left:0,top:0};const{width:t,height:n}=e,i=e.getEngine(),s=(i==null?void 0:i.width)||0,c=(i==null?void 0:i.height)||0;return{left:(t-s)/2,top:(n-c)/2}}_thumbSceneRender(e,t){const n=this._renderManagerService.getRenderById(e);if(n==null)return;const{engine:i}=n;if(i==null)return;const{width:s,height:c}=t,{width:o=s,height:l=c}=i,g=i.getCanvas().getContext();t.renderToThumb(g,e,o/s,l/c)}_createSlidePages(e,t){const n=e.getPages(),i=e.getPageOrder();if(!(!n||!i)&&i.length!==0){for(let s=0,c=i.length;s<c;s++){const o=i[s];this.createPageScene(o,n[o]),this._createThumb(o)}t.activeFirstPage()}}_createThumb(e){this._renderManagerService.createRender(e)}_getCurrUnitModel(){return this._renderContext.unit}activePage(e){let t=e;const n=this._getCurrUnitModel();let i;if(t)i=n.getPage(t);else{const l=n.getPages(),g=n.getPageOrder();if(g==null||l==null)return;i=l[g[0]],t=i.id}const s=this._currentRender();if(i==null||s==null||s.mainComponent==null)return;const{id:c}=i,o=s.mainComponent;if(n.setActivePage(i),o!=null&&o.hasPage(c)){o.changePage(c);return}this.createPageScene(c,i)}createThumbs(){const t=this._getCurrUnitModel().getPageOrder(),n=this._currentRender();if(!(!t||!n)&&t.length!==0)for(let i=0,s=t.length;i<s;i++){const c=t[i];this._thumbSceneRender(c,n.mainComponent)}}createPageScene(e,t){const n=this._renderContext;if(!n||!this._objectProvider)return;const{scene:i,mainComponent:s}=n,c=s,{width:o,height:l}=c,g=new I.Scene(e,c,{width:o,height:l});new I.Viewport(`PageViewer_${e}`,g,{left:0,top:0,bottom:0,right:0,explicitViewportWidthSet:!1,explicitViewportHeightSet:!1}).closeClip();const{pageElements:v,pageBackgroundFill:_}=t,C=this._objectProvider.convertToRenderObjects(v,i);if(!C||!c)return;this._addBackgroundRect(g,_),g.addObjects(C),g.initTransformer(),C.forEach(m=>{g.attachTransformerTo(m)});const S=g.getTransformer();return S==null||S.changeEnd$.subscribe(()=>{this._thumbSceneRender(e,c)}),S==null||S.clearControl$.subscribe(()=>{this._thumbSceneRender(e,c)}),c.addPageScene(g),g}getPageRenderUnit(e){const n=this._renderContext.mainComponent.getSubScenes().get(e),{engine:i,unit:s}=this._renderContext;return{scene:n,engine:i,unit:s}}createObjectToPage(e,t){const{scene:n}=this.getPageRenderUnit(t);if(!n||!this._objectProvider)return;const i=this._objectProvider.convertToRenderObject(e,n);if(i)return n.addObject(i),n.attachTransformerTo(i),n.getLayer().makeDirty(),i}setObjectActiveByPage(e,t){const{scene:n}=this.getPageRenderUnit(t);if(!n)return;const i=n.getTransformer();i==null||i.activeAnObject(e)}removeObjectById(e,t){const{scene:n}=this.getPageRenderUnit(t);if(!n)return;n.removeObject(e);const i=n.getTransformer();i==null||i.clearControls()}appendPage(){const e=this._getCurrUnitModel(),t=e.getBlankPage(),n=this._currentRender();if(t==null||n==null||n.mainComponent==null)return;const{id:i}=t,s=n.mainComponent,c=this.createPageScene(i,t);s&&c&&s.addPageScene(c),e.appendPage(t),e.setActivePage(t)}};q=nt([pe(1,a.Inject(a.Injector)),pe(2,a.IUniverInstanceService),pe(3,I.IRenderManagerService)],q);var it=Object.getOwnPropertyDescriptor,rt=(r,e,t,n)=>{for(var i=n>1?void 0:n?it(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},st=(r,e)=>(t,n)=>e(t,n,r);h.CanvasView=class extends a.RxDisposable{constructor(e){super(),this._renderManagerService=e}_getSlideRenderControllerFromRenderUnit(e){return this._renderManagerService.getRenderById(e).with(q)}createThumbs(e){this._getSlideRenderControllerFromRenderUnit(e).createThumbs()}activePage(e,t){this._getSlideRenderControllerFromRenderUnit(t).activePage(e)}getRenderUnitByPageId(e,t){return this._getSlideRenderControllerFromRenderUnit(t).getPageRenderUnit(e)}createObjectToPage(e,t,n){return this._getSlideRenderControllerFromRenderUnit(n).createObjectToPage(e,t)}setObjectActiveByPage(e,t,n){return this._getSlideRenderControllerFromRenderUnit(n).setObjectActiveByPage(e,t)}removeObjectById(e,t,n){this._getSlideRenderControllerFromRenderUnit(n).removeObjectById(e,t)}appendPage(e){this._getSlideRenderControllerFromRenderUnit(e).appendPage()}},h.CanvasView=rt([st(0,I.IRenderManagerService)],h.CanvasView);const _e={id:"slide.operation.activate-slide",type:a.CommandType.OPERATION,handler:(r,e)=>{var g,d;const t=e.unitId,n=r.get(h.CanvasView),s=r.get(a.IUniverInstanceService).getUnit(t),c=(g=s==null?void 0:s.getActivePage())==null?void 0:g.id;if(!c)return!1;const o=n.getRenderUnitByPageId(c,t);if(!o)return!1;const l=(d=o.scene)==null?void 0:d.getTransformer();return l&&l.clearControls(),n.activePage(e.id,t),!0}},Ie={id:"slide.operation.append-slide",type:a.CommandType.OPERATION,handler:(r,e)=>{const t=e.unitId;return r.get(a.IUniverInstanceService).getUnit(t)?(r.get(h.CanvasView).appendPage(t),!0):!1}},Se={id:"slide.operation.delete-element",type:a.CommandType.OPERATION,handler:(r,e)=>{if(!(e!=null&&e.id))return!1;const t=e.unitId,i=r.get(a.IUniverInstanceService).getUnit(t);if(!i)return!1;const s=i.getActivePage();return delete s.pageElements[e.id],i.updatePage(s.id,s),r.get(h.CanvasView).removeObjectById(e.id,s.id,t),!0}},te={id:"slide.command.insert-float-image",type:a.CommandType.COMMAND,handler:async(r,e)=>{var A;const t=r.get(a.IUniverInstanceService),n=(A=t.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE))==null?void 0:A.getUnitId();if(!n)return!1;const s=await r.get(f.ILocalFileService).openFile({multiple:!0,accept:fe.DRAWING_IMAGE_ALLOW_IMAGE_LIST.map(D=>`.${D.replace("image/","")}`).join(",")});if(s.length!==1)return!1;const o=await r.get(fe.IImageIoService).saveImage(s[0]);if(!o)return!1;const{imageId:l,imageSourceType:g,source:d,base64Cache:v}=o,{width:_,height:C,image:S}=await fe.getImageSize(v||""),m=t.getUnit(n);if(!m)return!1;const p=m.getActivePage(),b=Object.values(p.pageElements),w=b!=null&&b.length?Math.max(...b.map(D=>D.zIndex)):20,T={id:l,zIndex:w+1,left:0,top:0,width:_,height:C,title:"",description:"",type:a.PageElementType.IMAGE,image:{imageProperties:{contentUrl:v,imageSourceType:g,source:d,base64Cache:v,image:S}}};p.pageElements[l]=T,m.updatePage(p.id,p);const U=r.get(h.CanvasView),P=U.createObjectToPage(T,p.id,n);return P&&U.setObjectActiveByPage(P,p.id,n),!0}};var R=function(){return R=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},R.apply(this,arguments)},at=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},L=E.forwardRef(function(r,e){var t=r.icon,n=r.id,i=r.className,s=r.extend,c=at(r,["icon","id","className","extend"]),o="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),l=E.useRef("_".concat(lt()));return Ve(t,"".concat(n),{defIds:t.defIds,idSuffix:l.current},R({ref:e,className:o},c),s)});function Ve(r,e,t,n,i){return E.createElement(r.tag,R(R({key:e},ct(r,t,i)),n),(ot(r,t).children||[]).map(function(s,c){return Ve(s,"".concat(e,"-").concat(r.tag,"-").concat(c),t,void 0,i)}))}function ct(r,e,t){var n=R({},r.attrs);t!=null&&t.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=t.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(function(s){var c=s[0],o=s[1];c==="mask"&&typeof o=="string"&&(n[c]=o.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var i=e.defIds;return!i||i.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(s){var c=s[0],o=s[1];typeof o=="string"&&(n[c]=o.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function ot(r,e){var t,n=e.defIds;return!n||n.length===0?r:r.tag==="defs"&&(!((t=r.children)===null||t===void 0)&&t.length)?R(R({},r),{children:r.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.includes(i.attrs.id)?R(R({},i),{attrs:R(R({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):r}function lt(){return Math.random().toString(36).substring(2,8)}L.displayName="UniverIcon";var dt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"colorChannel1",d:"M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365ZM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365ZM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635ZM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ae=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"autofill-double-icon",ref:e,icon:dt}))});Ae.displayName="AutofillDoubleIcon";var ut={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334C15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334C2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045ZM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334C3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999C15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999C2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544ZM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999C3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421C6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641C9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421C11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902"}},{tag:"path",attrs:{fill:"currentColor",d:"M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946C8.64077 14.6502 8.70566 14.6923 8.77482 14.7209C8.84557 14.7502 8.92314 14.7664 9.00449 14.7664C9.08585 14.7664 9.16342 14.7502 9.23416 14.7209C9.30332 14.6923 9.36821 14.6502 9.42482 14.5946"}}]},Le=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"bottom-icon",ref:e,icon:ut}))});Le.displayName="BottomIcon";var vt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{clipPath:"url(#graph-icon_clip0_1293_28)"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M6.29541 11.1896C3.83208 10.7489 1.9624 8.59552 1.9624 6.00544C1.9624 3.09673 4.32036 0.73877 7.22907 0.73877C9.93483 0.73877 12.164 2.77918 12.4619 5.40527H13.5621C14.998 5.40527 16.1621 6.56933 16.1621 8.00527V12.6719C16.1621 14.1079 14.998 15.2719 13.5621 15.2719H8.89541C7.45947 15.2719 6.29541 14.1079 6.29541 12.6719V11.1896ZM3.1624 6.00544C3.1624 3.75947 4.98311 1.93877 7.22907 1.93877C9.27112 1.93877 10.9616 3.44388 11.2518 5.40527H8.89541C7.45947 5.40527 6.29541 6.56933 6.29541 8.00527V9.96442C4.49946 9.5425 3.1624 7.93012 3.1624 6.00544ZM7.49541 8.00527C7.49541 7.23207 8.12221 6.60527 8.89541 6.60527H13.5621C14.3353 6.60527 14.9621 7.23207 14.9621 8.00527V12.6719C14.9621 13.4451 14.3353 14.0719 13.5621 14.0719H8.89541C8.12221 14.0719 7.49541 13.4451 7.49541 12.6719V8.00527Z",fillRule:"evenodd",clipRule:"evenodd"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"graph-icon_clip0_1293_28"},children:[{tag:"path",attrs:{fill:"white",d:"M0 0H16V16H0z",transform:"translate(.9)"}}]}]}],defIds:["graph-icon_clip0_1293_28"]},Be=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"graph-icon",ref:e,icon:vt}))});Be.displayName="GraphIcon";var ht={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},me=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"more-down-icon",ref:e,icon:ht}))});me.displayName="MoreDownIcon";var gt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.57564 11.6118C5.80995 11.3774 6.18985 11.3774 6.42417 11.6118L7.3999 12.5875V6.36951C7.3999 6.03814 7.66853 5.76951 7.9999 5.76951C8.33127 5.76951 8.5999 6.03814 8.5999 6.36951V12.5875L9.57564 11.6118C9.80995 11.3774 10.1899 11.3774 10.4242 11.6118C10.6585 11.8461 10.6585 12.226 10.4242 12.4603L8.4324 14.452C8.32324 14.5655 8.16982 14.6362 7.9999 14.6362C7.82998 14.6362 7.67655 14.5655 7.56739 14.452L5.57564 12.4603C5.34132 12.226 5.34132 11.8461 5.57564 11.6118Z"}}]},$e=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"move-down-icon",ref:e,icon:gt}))});$e.displayName="MoveDownIcon";var ft={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.57564 4.38825C5.80995 4.62256 6.18985 4.62256 6.42417 4.38825L7.3999 3.41251V9.63049C7.3999 9.96186 7.66853 10.2305 7.9999 10.2305C8.33127 10.2305 8.5999 9.96186 8.5999 9.63049V3.41251L9.57564 4.38825C9.80995 4.62256 10.1899 4.62256 10.4242 4.38825C10.6585 4.15393 10.6585 3.77403 10.4242 3.53972L8.4324 1.54796C8.32324 1.43445 8.16982 1.36382 7.9999 1.36382C7.82998 1.36382 7.67655 1.43446 7.56739 1.54797L5.57564 3.53972C5.34132 3.77403 5.34132 4.15393 5.57564 4.38825Z"}}]},Fe=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"move-up-icon",ref:e,icon:ft}))});Fe.displayName="MoveUpIcon";var pt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z"}},{tag:"path",attrs:{fill:"colorChannel1",d:"M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z"}}]},He=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"paint-bucket-double-icon",ref:e,icon:pt}))});He.displayName="PaintBucketDoubleIcon";var _t={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"g",attrs:{fill:"currentColor",clipPath:"url(#text-icon_clip0_1293_26)"},children:[{tag:"path",attrs:{d:"M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z"}},{tag:"path",attrs:{d:"M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z"}}]},{tag:"defs",attrs:{},children:[{tag:"clipPath",attrs:{id:"text-icon_clip0_1293_26"},children:[{tag:"path",attrs:{fill:"white",d:"M0 0H16V16H0z",transform:"translate(.9)"}}]}]}],defIds:["text-icon_clip0_1293_26"]},We=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"text-icon",ref:e,icon:_t}))});We.displayName="TextIcon";var It={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9C15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9ZM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9C2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9C13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665C15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665ZM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665C2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665C13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ke=E.forwardRef(function(r,e){return E.createElement(L,Object.assign({},r,{id:"topmost-icon",ref:e,icon:It}))});ke.displayName="TopmostIcon";const j={id:"slide.operation.update-element",type:a.CommandType.OPERATION,handler:(r,e)=>{const{oKey:t,props:n}=e,i=r.get(a.IUniverInstanceService),s=e==null?void 0:e.unitId,c=i.getUnit(s);if(!c)return!1;const o=c.getActivePage();return o.pageElements[t]=a.merge(o.pageElements[t],n),c.updatePage(o.id,o),!0}};function St(r){const{pageId:e,unitId:t}=r,n=f.useDependency(a.LocaleService),i=f.useDependency(h.CanvasView),s=f.useDependency(a.ICommandService),c=i.getRenderUnitByPageId(e,t),o=c==null?void 0:c.scene;if(!o)return null;const l=o.getTransformer();if(!l)return null;const d=l.getSelectedObjectMap().values().next().value;if(!d)return null;const v=_=>{const C=o.getAllObjects(),[S,m]=C.reduce(([b,w],T)=>{const U=T.zIndex,P=U<b?U:b,A=U>w?U:w;return[P,A]},[0,0]);let p=d.zIndex;_===3?p=S-1:_===2?p=m+1:_===0?p=d.zIndex+1:_===1&&(p=d.zIndex-1),d.setProps({zIndex:p}),s.executeCommand(j.id,{unitId:t,oKey:d==null?void 0:d.oKey,props:{zIndex:p}})};return u.jsxs("div",{className:"univer-relative univer-w-full",children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full univer-text-left univer-text-gray-600 dark:!univer-text-gray-200",children:u.jsx("div",{children:n.t("image-panel.arrange.title")})})}),u.jsxs("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:[u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Button,{onClick:()=>{v(0)},children:u.jsxs("span",{className:"univer-flex univer-items-center univer-gap-1",children:[u.jsx(Fe,{}),n.t("image-panel.arrange.forward")]})})}),u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Button,{onClick:()=>{v(1)},children:u.jsxs("span",{className:"univer-flex univer-items-center univer-gap-1",children:[u.jsx($e,{}),n.t("image-panel.arrange.backward")]})})})]}),u.jsxs("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:[u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Button,{onClick:()=>{v(2)},children:u.jsxs("span",{className:"univer-flex univer-items-center univer-gap-1",children:[u.jsx(ke,{}),n.t("image-panel.arrange.front")]})})}),u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Button,{onClick:()=>{v(3)},children:u.jsxs("span",{className:"univer-flex univer-items-center univer-gap-1",children:[u.jsx(Le,{}),n.t("image-panel.arrange.back")]})})})]})]})}function mt(r){var S,m;const{pageId:e,unitId:t}=r,n=f.useDependency(a.LocaleService),i=f.useDependency(h.CanvasView),s=f.useDependency(a.ICommandService),c=i.getRenderUnitByPageId(e,t),o=c==null?void 0:c.scene;if(!o)return null;const l=o.getTransformer();if(!l)return null;const d=l.getSelectedObjectMap().values().next().value;if(!d)return null;const[v,_]=E.useState((m=(S=d.fill)==null?void 0:S.toString())!=null?m:"");function C(p){d==null||d.setProps({fill:p}),s.executeCommand(j.id,{unitId:t,oKey:d==null?void 0:d.oKey,props:{shape:{shapeProperties:{shapeBackgroundFill:{rgb:p}}}}}),_(p)}return u.jsx("div",{className:x.clsx("univer-relative univer-bottom-0 univer-mt-5 univer-w-full",x.borderTopClassName),children:u.jsxs("div",{className:"univer-relative univer-w-full",children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full univer-text-left univer-text-gray-600 dark:!univer-text-gray-200",children:u.jsx("div",{children:n.t("slide.panel.fill.title")})})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-1/2",children:u.jsx(x.Dropdown,{overlay:u.jsx("div",{className:"univer-rounded-lg univer-p-4",children:u.jsx(x.ColorPicker,{value:"#fff",onChange:C})}),children:u.jsxs("a",{className:"univer-flex univer-cursor-pointer univer-items-center univer-gap-1",children:[u.jsx(He,{className:"univer-fill-primary-600"}),u.jsx(me,{})]})})})})]})})}function Ct(r){const{pageId:e,unitId:t}=r,n=f.useDependency(a.LocaleService),i=f.useDependency(h.CanvasView),s=f.useDependency(a.ICommandService),c=i.getRenderUnitByPageId(e,t),o=c==null?void 0:c.scene;if(!o)return null;const l=o.getTransformer();if(!l)return null;const d=l.getSelectedObjectMap().values().next().value;if(!d)return null;const{width:v=0,height:_=0,left:C=0,top:S=0,angle:m=0}=d,[p,b]=E.useState(v),[w,T]=E.useState(_),[U,P]=E.useState(C),[A,D]=E.useState(S),[Z,$]=E.useState(m),H=y=>{const{objects:J}=y,Q=J.values().next().value,{width:tn=0,height:nn=0,left:rn=0,top:sn=0,angle:an=0}=Q;b(tn),T(nn),P(rn),D(sn),$(an)};E.useEffect(()=>{const y=l.changeStart$.subscribe(Q=>{H(Q)}),J=l.changing$.subscribe(Q=>{H(Q)});return()=>{J.unsubscribe(),y.unsubscribe()}},[]);function B(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{width:y}}),d==null||d.resize(y,d.height),b(y),l==null||l.refreshControls())}function G(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{height:y}}),d==null||d.resize(d.width,y),T(y),l==null||l.refreshControls())}function Y(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{left:y}}),d==null||d.translate(y,d.top),P(y),l==null||l.refreshControls())}function K(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{right:y}}),d==null||d.translate(d.left,y),D(y),l==null||l.refreshControls())}function ge(y){!y||!d||(s.executeCommand(j.id,{pageId:e,oKey:d.oKey,props:{angle:y}}),d==null||d.transformByState({angle:y}),$(y),l==null||l.refreshControls())}return u.jsxs("div",{className:x.clsx("univer-relative univer-bottom-0 univer-mt-5 univer-w-full",x.borderTopClassName),children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full univer-text-left univer-text-gray-600 dark:!univer-text-gray-200",children:u.jsx("div",{children:n.t("image-panel.transform.title")})})}),u.jsxs("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:[u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.width")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",min:1,value:p,onChange:y=>{B(y)}})})})]})}),u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.height")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",min:1,value:w,onChange:y=>{G(y)}})})})]})})]}),u.jsxs("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:[u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.x")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",precision:1,min:0,value:U,onChange:y=>{Y(y)}})})})]})}),u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.y")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",precision:1,min:0,value:A,onChange:y=>{K(y)}})})})]})}),u.jsx("div",{className:"univer-w-1/3",children:u.jsxs("label",{children:[u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:n.t("image-panel.transform.rotate")})}),u.jsx("div",{className:"univer-relative univer-mt-2.5 univer-flex univer-h-full",children:u.jsx("div",{className:"univer-w-full",children:u.jsx(x.InputNumber,{className:"univer-w-11/12",precision:1,value:Z,onChange:ge})})})]})})]})]})}const ne="COMPONENT_SLIDE_SIDEBAR";function bt(){var g,d,v;const r=f.useDependency(a.IUniverInstanceService),e=f.useDependency(h.CanvasView),t=r.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE),n=(g=t==null?void 0:t.getActivePage())==null?void 0:g.id;if(!n)return null;const s=(d=e.getRenderUnitByPageId(n,n).scene)==null?void 0:d.getTransformer();if(!s)return null;const o=s.getSelectedObjectMap().values().next().value;if(!o)return null;const l=((v=r.getFocusedUnit())==null?void 0:v.getUnitId())||"";return u.jsxs("section",{className:"univer-p-2 univer-text-center univer-text-sm",children:[u.jsx(St,{pageId:n,unitId:l}),u.jsx(Ct,{pageId:n,unitId:l}),o.objectType===I.ObjectType.RECT&&u.jsx(mt,{pageId:n,unitId:l})]})}const ie={id:"slide.command.insert-float-shape.rectangle",type:a.CommandType.COMMAND,handler:async r=>{var i;const e=r.get(a.ICommandService),n=(i=r.get(a.IUniverInstanceService).getFocusedUnit())==null?void 0:i.getUnitId();return e.executeCommand(Ce.id,{unitId:n})}},Ce={id:"slide.operation.insert-float-shape.rectangle",type:a.CommandType.OPERATION,handler:async(r,e)=>{const t=a.generateRandomId(6),n=r.get(a.IUniverInstanceService),i=e.unitId,s=n.getUnit(i);if(!s)return!1;const c=s.getActivePage(),o=Object.values(c.pageElements),l=o!=null&&o.length?Math.max(...o.map(_=>_.zIndex)):20,g={id:t,zIndex:l+1,left:378,top:142,width:250,height:250,title:t,description:"",type:a.PageElementType.SHAPE,shape:{shapeType:a.BasicShapes.Rect,text:"",shapeProperties:{shapeBackgroundFill:{rgb:"rgb(0,0,255)"}}}};c.pageElements[t]=g,s.updatePage(c.id,c);const d=r.get(h.CanvasView),v=d.createObjectToPage(g,c.id,i);return v&&d.setObjectActiveByPage(v,c.id,i),!0}},be={id:"sidebar.operation.slide-shape",type:a.CommandType.COMMAND,handler:async(r,e)=>{const{visible:t,objectType:n}=e,i=r.get(f.ISidebarService),s=r.get(a.LocaleService);let c="",o="";return n===I.ObjectType.RECT?(c="slide.sidebar.shape",o=ne):n===I.ObjectType.IMAGE?(c="slide.sidebar.image",o=ne):n===I.ObjectType.RICH_TEXT&&(c="slide.sidebar.text",o=ne),t?i.open({header:{title:s.t(c)},children:{label:o},onClose:()=>{},width:360}):i.close(),!0}},re={id:"slide.command.insert-float-shape.ellipse",type:a.CommandType.COMMAND,handler:async r=>{var i;const e=r.get(a.ICommandService),n=(i=r.get(a.IUniverInstanceService).getFocusedUnit())==null?void 0:i.getUnitId();return e.executeCommand(Ee.id,{unitId:n})}},Ee={id:"slide.operation.insert-float-shape.ellipse",type:a.CommandType.OPERATION,handler:async(r,e)=>{const t=a.generateRandomId(6),n=r.get(a.IUniverInstanceService),i=e.unitId,s=n.getUnit(i);if(!s)return!1;const c=s.getActivePage(),o=Object.values(c.pageElements),l=o!=null&&o.length?Math.max(...o.map(_=>_.zIndex)):20,g={id:t,zIndex:l+1,left:378,top:142,width:250,height:250,title:t,description:"",type:a.PageElementType.SHAPE,shape:{shapeType:a.BasicShapes.Ellipse,text:"",shapeProperties:{radius:100,shapeBackgroundFill:{rgb:"rgb(0,0,255)"}}}};c.pageElements[t]=g,s.updatePage(c.id,c);const d=r.get(h.CanvasView),v=d.createObjectToPage(g,c.id,i);return v&&d.setObjectActiveByPage(v,c.id,i),!0}},se={id:"slide.command.add-text",type:a.CommandType.COMMAND,handler:async r=>{var i;const e=r.get(a.ICommandService),n=(i=r.get(a.IUniverInstanceService).getFocusedUnit())==null?void 0:i.getUnitId();return await e.executeCommand(ye.id,{unitId:n})}},ye={id:"slide.operation.add-text",type:a.CommandType.OPERATION,handler:async(r,e)=>{const t=e.unitId,n=a.generateRandomId(6),i=220,s=40,c=230,o=142,l=(e==null?void 0:e.text)||"A New Text",d=r.get(a.IUniverInstanceService).getUnit(t);if(!d)return!1;const v=d.getActivePage(),_=Object.values(v.pageElements),C=_!=null&&_.length?Math.max(..._.map(b=>b.zIndex)):21,S={id:n,zIndex:C+1,left:c,top:o,width:i,height:s,title:"text",description:"",type:a.PageElementType.TEXT,richText:{text:l,fs:30,cl:{rgb:"rgb(51, 51, 51)"},bl:1}};v.pageElements[n]=S,d.updatePage(v.id,v);const m=r.get(h.CanvasView),p=m.createObjectToPage(S,v.id,t);return p&&m.setObjectActiveByPage(p,v.id,t),!0}},Oe={id:"slide.operation.set-slide-page-thumb",type:a.CommandType.OPERATION,handler:(r,e)=>(r.get(h.CanvasView).createThumbs(e.unitId),!0)};function Ke(){var S,m;const r=f.useDependency(a.IUniverInstanceService),e=f.useDependency(a.ICommandService),t=f.useDependency(I.IRenderManagerService),n=f.useDependency(a.LocaleService),i=E.useRef(null),s=r.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE),c=s==null?void 0:s.getPages(),o=s==null?void 0:s.getPageOrder();if(!c||!o)return null;const l=o.map(p=>c[p]),[g,d]=E.useState((m=(S=s==null?void 0:s.getActivePage())==null?void 0:S.id)!=null?m:null),v=E.useMemo(()=>l.map(()=>E.createRef()),[l]);E.useEffect(()=>{const p=s==null?void 0:s.activePage$.subscribe(b=>{var T;const w=(T=b==null?void 0:b.id)!=null?T:null;w&&d(w)});return()=>{p==null||p.unsubscribe()}},[]),E.useEffect(()=>{v.forEach((p,b)=>{var w;if(p.current){const T=l[b];(w=t.getRenderById(T.id))==null||w.engine.setContainer(p.current)}}),v.length>0&&e.syncExecuteCommand(Oe.id,{unitId:s==null?void 0:s.getUnitId()})},[v,l,t,e,s]);const _=E.useCallback(p=>{e.syncExecuteCommand(_e.id,{id:p,unitId:s==null?void 0:s.getUnitId()})},[e,s]),C=E.useCallback(()=>{e.syncExecuteCommand(Ie.id,{unitId:s==null?void 0:s.getUnitId()})},[e,s]);return u.jsx("aside",{ref:i,className:x.clsx("univer-flex univer-h-full univer-w-64 univer-flex-col univer-overflow-y-auto univer-overflow-x-hidden",x.scrollbarClassName),children:u.jsxs("div",{className:"univer-px-4",children:[u.jsx("header",{className:"univer-flex univer-justify-center univer-pt-4",children:u.jsx("a",{className:x.clsx("univer-box-border univer-block univer-h-8 univer-w-full univer-cursor-pointer univer-rounded-md univer-bg-white univer-text-center univer-text-sm univer-leading-8 univer-transition-colors",x.borderClassName),onClick:C,children:n.t("slide.append")})}),l.map((p,b)=>u.jsxs("div",{className:x.clsx("univer-my-4 univer-flex univer-gap-2",{"[&>div]:univer-border-primary-600 [&>span]:univer-text-primary-600":p.id===g}),onClick:()=>_(p.id),children:[u.jsx("span",{children:b+1}),u.jsx("div",{ref:v[b],className:x.clsx("univer-relative univer-box-border univer-h-32 univer-w-52 univer-bg-white hover:univer-border-primary-600",x.borderClassName)})]},p.id))]})})}const z=a.createInternalEditorID("SLIDE_EDITOR"),Te="slide.menu.image";function Et(r){return{id:Te,type:f.MenuItemType.SUBITEMS,icon:"AddImageIcon",tooltip:"slide.image.insert.title",hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}function yt(r){return{id:te.id,title:"slide.image.insert.float",type:f.MenuItemType.BUTTON,hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}const we="slide.menu.shape";function Ot(r){return{id:we,type:f.MenuItemType.SUBITEMS,icon:"GraphIcon",tooltip:"slide.shape.insert.title",hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}function Tt(r){return{id:ie.id,title:"slide.shape.insert.rectangle",type:f.MenuItemType.BUTTON,hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}function wt(r){return{id:re.id,title:"slide.shape.insert.ellipse",type:f.MenuItemType.BUTTON,hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}function xt(r){return{id:se.id,type:f.MenuItemType.BUTTON,icon:"TextIcon",tooltip:"slide.text.insert.title",hidden$:f.getMenuHiddenObservable(r,a.UniverInstanceType.UNIVER_SLIDE)}}const ze={[f.RibbonStartGroup.FORMAT]:{[se.id]:{order:0,menuItemFactory:xt},[Te]:{order:0,menuItemFactory:Et,[te.id]:{order:0,menuItemFactory:yt}},[we]:{order:0,menuItemFactory:Ot,[ie.id]:{order:0,menuItemFactory:Tt},[re.id]:{order:0,menuItemFactory:wt}}}},ae={id:"slide.operation.edit-arrow",type:a.CommandType.OPERATION,handler:()=>!0},Xe="COMPONENT_SLIDE_IMAGE_POPUP_MENU";function Dt(r){var S,m;const e=(m=(S=r.popup)==null?void 0:S.extraProps)==null?void 0:m.menuItems;if(!e)return null;const t=f.useDependency(a.ICommandService),n=f.useDependency(a.LocaleService),[i,s]=E.useState(!1),[c,o]=E.useState(!1),l=()=>{o(!0)},g=()=>{o(!1)},d=p=>{s(p)},v=p=>{t.executeCommand(p.commandId,p.commandParams),s(!1)},_=i||c,C=e.filter(p=>!p.disable);return u.jsx("div",{onMouseEnter:l,onMouseLeave:g,children:u.jsx(x.Dropdown,{align:"start",overlay:u.jsx("ul",{className:x.clsx("univer-m-0 univer-box-border univer-grid univer-list-none univer-items-center univer-gap-1 univer-rounded-lg univer-bg-white univer-p-1.5 univer-text-sm univer-shadow-lg",x.borderClassName),children:C.map(p=>u.jsx("li",{className:"univer-relative univer-box-border univer-flex univer-h-8 univer-cursor-pointer univer-items-center univer-rounded univer-text-sm univer-transition-colors hover:univer-bg-gray-100",onClick:()=>v(p),children:u.jsx("span",{className:"univer-px-2 univer-py-1.5 univer-align-middle",children:n.t(p.label)})},p.index))}),open:i,onOpenChange:d,children:u.jsxs("div",{className:x.clsx("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800",x.borderClassName,{"univer-bg-gray-100 dark:!univer-bg-gray-800":i,"univer-bg-white dark:!univer-bg-gray-900":!i}),children:[u.jsx(Ae,{className:"univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-white"}),_&&u.jsx(me,{className:"dark:!univer-text-white"})]})})})}class Pt{constructor(){O(this,"_state",null);O(this,"_rect",null);O(this,"_state$",new N.BehaviorSubject(null));O(this,"state$",this._state$.asObservable());O(this,"_rect$",new N.BehaviorSubject(null));O(this,"rect$",this._rect$.asObservable());O(this,"_focus",!1);O(this,"_focus$",new N.BehaviorSubject(this._focus));O(this,"focus$",this._focus$.asObservable())}dispose(){this._state$.complete(),this._state=null,this._rect$.complete(),this._rect=null}setState(e){this._state=e,this._refresh(e)}getRect(){return this._rect}setRect(e){this._rect=e,this._rect$.next(e)}getState(){return this._state}setFocus(e=!1){this._focus=e,this._focus$.next(e)}_refresh(e){this._state$.next(e)}}const xe=a.createIdentifier("univer.slide-editor-manager.service"),ce=-1e3,Ze={width:0,height:0,top:ce,left:ce};function Ge(){const[r,e]=E.useState({...Ze}),t=f.useDependency(xe),n=f.useDependency(M.IEditorService),i=f.useDependency(a.IContextService),s=f.useObservable(()=>i.subscribeContextValue$(f.DISABLE_AUTO_FOCUS_KEY),!1,void 0,[i,f.DISABLE_AUTO_FOCUS_KEY]);return a.DocumentFlavor.UNSPECIFIED,E.useEffect(()=>{t.state$.subscribe(c=>{if(c==null)return;const{startX:o=ce,startY:l=ce,endX:g=0,endY:d=0,show:v=!1}=c;if(!v)e({...Ze});else{e({width:g-o-I.FIX_ONE_PIXEL_BLUR_OFFSET+2,height:d-l-I.FIX_ONE_PIXEL_BLUR_OFFSET+2,left:o+I.FIX_ONE_PIXEL_BLUR_OFFSET,top:l+I.FIX_ONE_PIXEL_BLUR_OFFSET});const _=n.getEditor(z);if(_==null)return;const{left:C,top:S,width:m,height:p}=_.getBoundingClientRect();t.setRect({left:C,top:S,width:m,height:p})}})},[]),E.useEffect(()=>{s||t.setFocus(!0)},[s,r]),u.jsx("div",{className:x.clsx("univer-absolute univer-z-10 univer-box-border univer-flex",x.borderClassName),style:{left:r.left,top:r.top,width:r.width,height:r.height}})}function De(r){return r.getContextValue(a.FOCUSING_UNIVER_EDITOR)&&r.getContextValue(a.EDITOR_ACTIVATED)}function Ut(r){return r.getContextValue(a.FORMULA_EDITOR_ACTIVATED)&&r.getContextValue(a.FOCUSING_UNIVER_EDITOR)}const Ye=[f.KeyCode.ARROW_DOWN,f.KeyCode.ARROW_UP,f.KeyCode.ARROW_LEFT,f.KeyCode.ARROW_RIGHT];[f.KeyCode.ENTER,f.KeyCode.TAB,...Ye];function Mt(){const r=[];for(const e of Ye)r.push({id:ae.id,binding:e,preconditions:t=>De(t),staticParameters:{visible:!1,eventType:I.DeviceInputEventType.Keyboard,keycode:e,isShift:!1}}),r.push({id:ae.id,binding:e|f.MetaKeys.SHIFT,preconditions:t=>De(t),staticParameters:{visible:!1,eventType:I.DeviceInputEventType.Keyboard,keycode:e,isShift:!0}});return r}const Nt={id:M.DeleteLeftCommand.id,preconditions:r=>De(r)||Ut(r),binding:f.KeyCode.BACKSPACE};var Rt=Object.getOwnPropertyDescriptor,jt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Rt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},X=(r,e)=>(t,n)=>e(t,n,r);h.SlidesUIController=class extends a.Disposable{constructor(e,t,n,i,s,c){super(),this._injector=e,this._menuManagerService=t,this._componentManager=n,this._uiPartsService=i,this._commandService=s,this._shortcutService=c,this._initCommands(),this._initCustomComponents(),this._initUIComponents(),this._initMenus(),this._initShortcuts()}_initMenus(){this._menuManagerService.mergeMenu(ze)}_initCustomComponents(){const e=this._componentManager;this.disposeWithMe(e.register("TextIcon",We)),this.disposeWithMe(e.register("GraphIcon",Be)),this.disposeWithMe(e.register(Xe,Dt)),this.disposeWithMe(e.register(ne,bt))}_initCommands(){[Ie,_e,Oe,te,ye,se,re,Ee,Ce,ie,be,Se,j,ae].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_initUIComponents(){this.disposeWithMe(this._uiPartsService.registerComponent(f.BuiltInUIPart.LEFT_SIDEBAR,()=>f.connectInjector(Ke,this._injector))),this.disposeWithMe(this._uiPartsService.registerComponent(f.BuiltInUIPart.CONTENT,()=>f.connectInjector(Ge,this._injector)))}_initShortcuts(){[Nt,...Mt()].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}},h.SlidesUIController=jt([X(0,a.Inject(a.Injector)),X(1,f.IMenuManagerService),X(2,a.Inject(f.ComponentManager)),X(3,f.IUIPartsService),X(4,a.ICommandService),X(5,f.IShortcutService)],h.SlidesUIController);const Vt="slides-ui.config",qe={};var At=Object.getOwnPropertyDescriptor,Lt=(r,e,t,n)=>{for(var i=n>1?void 0:n?At(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},oe=(r,e)=>(t,n)=>e(t,n,r);function Bt(r,e){const t=Je(r.left,r.top,e),n=Je(r.right,r.bottom,e);return{left:t.x,top:t.y,right:n.x,bottom:n.y}}function Je(r,e,t){const{scaleX:n,scaleY:i}=t.getAncestorScale(),s=t.getViewport(W.SLIDE_KEY.VIEW);if(!s)return{x:r,y:e};const{viewportScrollX:c,viewportScrollY:o}=s,l=(r-c)*n,g=(e-o)*i;return{x:l,y:g}}h.SlideCanvasPopMangerService=class extends a.Disposable{constructor(e,t,n,i){super(),this._globalPopupManagerService=e,this._renderManagerService=t,this._univerInstanceService=n,this._commandService=i}_createObjectPositionObserver(e,t){const i=(()=>{var B,G,Y,K;const{scene:o,engine:l}=t,{left:g,top:d,width:v,height:_}=e,C=(o.width-((G=(B=t.mainComponent)==null?void 0:B.width)!=null?G:0))/2,S=(o.height-((K=(Y=t.mainComponent)==null?void 0:Y.height)!=null?K:0))/2,m={left:g,right:g+v,top:d,bottom:d+_},p=l.getCanvasElement(),b=p.getBoundingClientRect(),w=I.pxToNum(p.style.width),{scaleX:T,scaleY:U}=o.getAncestorScale(),P=Bt(m,o),{top:A,left:D,width:Z}=b,$=Z/w;return{left:P.left*$*T+D+C,right:P.right*$*T+D+C,top:P.top*$*U+A+S,bottom:P.bottom*$*U+A+S}})(),s=new N.BehaviorSubject(i),c=new a.DisposableCollection;return{position:i,position$:s,disposable:c}}attachPopupToObject(e,t){const i=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE).getUnitId(),s=this._renderManagerService.getRenderById(i);if(!s)return{dispose:()=>{}};const{position:c,position$:o,disposable:l}=this._createObjectPositionObserver(e,s),g=this._globalPopupManagerService.addPopup({...t,unitId:i,subUnitId:"default",anchorRect:c,anchorRect$:o,canvasElement:s.engine.getCanvasElement()});return{dispose:()=>{this._globalPopupManagerService.removePopup(g),o.complete(),l.dispose()}}}},h.SlideCanvasPopMangerService=Lt([oe(0,a.Inject(f.ICanvasPopupService)),oe(1,I.IRenderManagerService),oe(2,a.IUniverInstanceService),oe(3,a.ICommandService)],h.SlideCanvasPopMangerService);var $t=Object.getOwnPropertyDescriptor,Ft=(r,e,t,n)=>{for(var i=n>1?void 0:n?$t(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},k=(r,e)=>(t,n)=>e(t,n,r);let le=class extends a.RxDisposable{constructor(e,t,n,i,s,c,o){super();O(this,"_initImagePopupMenu",new Set);this._canvasPopManagerService=e,this._renderManagerService=t,this._univerInstanceService=n,this._contextService=i,this._canvasView=s,this._sidebarService=c,this._commandService=o,this._init()}_init(){this._univerInstanceService.getAllUnitsForType(a.UniverInstanceType.UNIVER_SLIDE).forEach(e=>this._create(e))}_create(e){if(!e)return;const t=e.getUnitId();this._renderManagerService.has(t)&&!this._initImagePopupMenu.has(t)&&(this._popupMenuListener(t),this._initImagePopupMenu.add(t))}_hasCropObject(e){}_popupMenuListener(e){var i;const t=this._univerInstanceService.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE),n=(i=t==null?void 0:t.getPages())!=null?i:{};Object.keys(n).forEach(s=>{var g;const o=(g=this._canvasView.getRenderUnitByPageId(s,e).scene)==null?void 0:g.getTransformer();if(!o)return;let l;this.disposeWithMe(a.toDisposable(o.createControl$.subscribe(()=>{const d=o.getSelectedObjectMap();if(d.size>1){l==null||l.dispose();return}const v=d.values().next().value;if(!v)return;const _=v.oKey;l==null||l.dispose(),l=this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(v,{componentKey:Xe,direction:"horizontal",offset:[2,0],extraProps:{menuItems:this._getMenuItemsByObjectType(v.objectType,_,e)}})),this._sidebarService.visible&&this._commandService.executeCommand(be.id,{visible:!0,objectType:v.objectType})}))),this.disposeWithMe(o.clearControl$.subscribe(()=>{l==null||l.dispose(),this._contextService.setContextValue(a.FOCUSING_COMMON_DRAWINGS,!1)})),this.disposeWithMe(o.changing$.subscribe(()=>{l==null||l.dispose();const d=o.getSelectedObjectMap();if(d.size>1){l==null||l.dispose();return}const v=d.values().next().value;v&&this._commandService.executeCommand(j.id,{unitId:e,oKey:v.oKey,props:{width:v.width,height:v.height,left:v.left,top:v.top}})}))})}_getMenuItemsByObjectType(e,t,n){return[{label:"slide.popup.edit",index:0,commandId:be.id,commandParams:{visible:!0,objectType:e},disable:!1},{label:"slide.popup.delete",index:5,commandId:Se.id,commandParams:{id:t,unitId:n},disable:!1}]}};le=Ft([k(0,a.Inject(h.SlideCanvasPopMangerService)),k(1,I.IRenderManagerService),k(2,a.IUniverInstanceService),k(3,a.IContextService),k(4,a.Inject(h.CanvasView)),k(5,f.ISidebarService),k(6,a.ICommandService)],le);var Ht=Object.getOwnPropertyDescriptor,Wt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Ht(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},Pe=(r,e)=>(t,n)=>e(t,n,r);const de=a.createIdentifier("univer.slide-editor-bridge.service");let Ue=class extends a.Disposable{constructor(e,t,n){super();O(this,"_editorUnitId",z);O(this,"_isForceKeepVisible",!1);O(this,"_editorIsDirty",!1);O(this,"_currentEditRectState",null);O(this,"_currentEditRectState$",new N.BehaviorSubject(null));O(this,"currentEditRectState$",this._currentEditRectState$.asObservable());O(this,"_visibleParam",{visible:!1,eventType:I.DeviceInputEventType.Dblclick,unitId:""});O(this,"_visible$",new N.BehaviorSubject(this._visibleParam));O(this,"visible$",this._visible$.asObservable());O(this,"_afterVisible$",new N.BehaviorSubject(this._visibleParam));O(this,"afterVisible$",this._afterVisible$.asObservable());O(this,"endEditing$",new N.Subject);O(this,"_currentEditRectInfo");this._editorService=e,this._contextService=t,this._renderManagerService=n}dispose(){super.dispose()}getEditorRect(){return this._currentEditRectInfo}setEditorRect(e){this._currentEditRectInfo=e,this._editorService.getFocusEditor()||(this._editorService.focus(z),this._contextService.setContextValue(a.EDITOR_ACTIVATED,!1),this._contextService.setContextValue(a.FOCUSING_EDITOR_STANDALONE,!1),this._contextService.setContextValue(a.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE,!1));const t=this.getEditRectState();this._currentEditRectState=t,this._currentEditRectState$.next(t)}changeVisible(e){this._visibleParam=e,e.visible&&(this._editorIsDirty=!1),this._visible$.next(this._visibleParam),this._afterVisible$.next(this._visibleParam)}getEditRectState(){const e=z,t=this._currentEditRectInfo,n=t.unitId,i=t.richTextObj.documentData;i.id=e,i.documentStyle={...i.documentStyle,pageSize:{width:t.richTextObj.width,height:1/0}};const c={documentModel:new a.DocumentDataModel(i),fontString:"document",textRotation:{a:0,v:0},wrapStrategy:0,verticalAlign:a.VerticalAlign.TOP,horizontalAlign:a.HorizontalAlign.LEFT,paddingData:{t:0,b:1,l:2,r:2}},o=t.richTextObj.width,l=t.richTextObj.height,g=t.richTextObj.left,d=t.richTextObj.top,v={left:0,top:0},_=this._renderManagerService.getRenderById(n),C=_==null?void 0:_.scene,S=C==null?void 0:C.getViewport(W.SLIDE_KEY.VIEW),m=C==null?void 0:C.getObject(W.SLIDE_KEY.COMPONENT),p={x:(m==null?void 0:m.left)||0,y:(m==null?void 0:m.top)||0},b=(S==null?void 0:S.viewportScrollX)||0,w=(S==null?void 0:S.viewportScrollY)||0;return v.left=p.x-b,v.top=p.y-w,{position:{startX:g,startY:d,endX:g+o,endY:d+l},scaleX:1,scaleY:1,slideCardOffset:v,unitId:n,editorUnitId:e,documentLayoutObject:c}}changeEditorDirty(e){this._editorIsDirty=e}isVisible(){return this._visibleParam.visible}getEditorDirty(){return this._editorIsDirty}getCurrentEditorId(){return this._editorUnitId}genDocData(e){const t=this.getCurrentEditorId(),n=e.text,i=e.fs;return{id:t,body:{dataStream:`${n}\r
2
+ `,textRuns:[{st:0,ed:n.length}],paragraphs:[{paragraphStyle:{},startIndex:n.length+1}],sectionBreaks:[{startIndex:n.length+2}]},documentStyle:{marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,pageSize:{width:1/0,height:1/0},textStyle:{fs:i},renderConfig:{verticalAlign:a.VerticalAlign.MIDDLE,centerAngle:0,vertexAngle:0,wrapStrategy:0}},drawings:{},drawingsOrder:[],settings:{zoomRatio:1}}}};Ue=Wt([Pe(0,M.IEditorService),Pe(1,a.IContextService),Pe(2,I.IRenderManagerService)],Ue);var F=(r=>(r[r.InitialState=0]="InitialState",r[r.StartEditor=1]="StartEditor",r[r.CursorChange=2]="CursorChange",r))(F||{}),kt=Object.getOwnPropertyDescriptor,Kt=(r,e,t,n)=>{for(var i=n>1?void 0:n?kt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},V=(r,e)=>(t,n)=>e(t,n,r);const Qe=-1e3,et=5,zt=2;let Me=class extends a.Disposable{constructor(e,t,n,i,s,c,o,l,g,d,v,_){super();O(this,"_cursorChange",F.InitialState);O(this,"_isUnitEditing",!1);O(this,"_d");this._renderContext=e,this._layoutService=t,this._undoRedoService=n,this._contextService=i,this._instanceSrv=s,this._renderManagerService=c,this._editorBridgeService=o,this._cellEditorManagerService=l,this._textSelectionManagerService=g,this._commandService=d,this._localService=v,this._editorService=_,this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_SLIDE).subscribe(C=>{C&&C.getUnitId()===this._renderContext.unitId?this._d=this._init():(this._disposeCurrent(),this._isUnitEditing&&(this._handleEditorInvisible({visible:!1,eventType:I.DeviceInputEventType.Keyboard,keycode:f.KeyCode.ESC,unitId:this._renderContext.unitId}),this._isUnitEditing=!1))})),this._initEditorVisibilityListener()}dispose(){super.dispose(),this._disposeCurrent()}_disposeCurrent(){var e;(e=this._d)==null||e.dispose(),this._d=null}_init(){const e=new a.DisposableCollection;return this._subscribeToCurrentCell(e),this._initialKeyboardListener(e),this._initialCursorSync(e),this._listenEditorFocus(e),this._commandExecutedListener(e),setTimeout(()=>{this._cursorStateListener(e)},1e3),e}_initEditorVisibilityListener(){this.disposeWithMe(this._editorBridgeService.visible$.subscribe(e=>{e.visible?(this._isUnitEditing=!0,this._handleEditorVisible(e)):this._isUnitEditing&&(this._handleEditorInvisible(e),this._isUnitEditing=!1)}))}_listenEditorFocus(e){const t=this._getEditorObject();t&&e.add(t.document.onPointerDown$.subscribeEvent(()=>{}))}_getEditorSkeleton(e){var t;return(t=this._renderManagerService.getRenderById(e))==null?void 0:t.with(ee.DocSkeletonManagerService).getSkeleton()}_getEditorViewModel(e){var t;return(t=this._renderManagerService.getRenderById(e))==null?void 0:t.with(ee.DocSkeletonManagerService).getViewModel()}_initialCursorSync(e){e.add(this._cellEditorManagerService.focus$.pipe(N.filter(t=>!!t)).subscribe(()=>{var t;(t=I.getCurrentTypeOfRenderer(a.UniverInstanceType.UNIVER_DOC,this._instanceSrv,this._renderManagerService))==null||t.with(M.DocSelectionRenderService).sync()}))}_subscribeToCurrentCell(e){e.add(this._editorBridgeService.currentEditRectState$.subscribe(t=>{var v;if(t==null||this._contextService.getContextValue(a.FOCUSING_EDITOR_STANDALONE)||this._contextService.getContextValue(a.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE))return;const{position:{startX:n,endX:i},documentLayoutObject:{textRotation:s,wrapStrategy:c,documentModel:o},scaleX:l,editorUnitId:g}=t,{vertexAngle:d}=I.convertTextRotation(s);o.updateDocumentId(g),c===a.WrapStrategy.WRAP&&d===0&&o.updateDocumentDataPageSize((i-n)/l),this._instanceSrv.changeDoc(g,o),this._contextService.setContextValue(a.FOCUSING_EDITOR_BUT_HIDDEN,!0),this._textSelectionManagerService.replaceTextRanges([{startOffset:0,endOffset:0}]),(v=I.getCurrentTypeOfRenderer(a.UniverInstanceType.UNIVER_DOC,this._instanceSrv,this._renderManagerService))==null||v.with(M.DocSelectionRenderService).activate(Qe,Qe)}))}_fitTextSize(e,t,n,i,s=1,c=1){const{startX:o,startY:l,endX:g,endY:d}=e,v=i.documentModel;if(v==null)return;const{actualWidth:_,actualHeight:C}=this._predictingSize(e,t,n,i,s,c),{verticalAlign:S,paddingData:m,fill:p}=i;let b=g-o,w=d-l;if(b<_&&(b=_),w<C)w=C,v.updateDocumentDataMargin(m);else{let T=0;S===a.VerticalAlign.MIDDLE?T=(w-C)/2/c:S===a.VerticalAlign.TOP?T=m.t||0:T=(w-C)/c-(m.b||0),T=T<(m.t||0)?m.t||0:T,v.updateDocumentDataMargin({t:T})}n.calculate(),this._editAreaProcessing(b,w,e,t,p,s,c)}_predictingSize(e,t,n,i,s=1,c=1){const{startX:o,endX:l}=e,{textRotation:g,wrapStrategy:d}=i,v=i.documentModel,{vertexAngle:_}=I.convertTextRotation(g),C=document.body.clientWidth;if(d===a.WrapStrategy.WRAP&&_===0){const{actualWidth:p,actualHeight:b}=n.getActualSize();return{actualWidth:p*s,actualHeight:b*c}}v==null||v.updateDocumentDataPageSize((C-o-t.left)/s),n.calculate();const S=n.getActualSize();let m=l-o;return m<S.actualWidth*s+et*s&&(m=S.actualWidth*s+et*s),v==null||v.updateDocumentDataPageSize(m/s),v==null||v.updateDocumentRenderConfig({horizontalAlign:a.HorizontalAlign.UNSPECIFIED,cellValueType:void 0}),{actualWidth:m,actualHeight:S.actualHeight*c}}_editAreaProcessing(e,t,n,i,s,c=1,o=1){var y;const l=this._getEditorObject();if(l==null)return;function g(J){return Number.parseInt(J.replace("px",""))}const v=this._renderContext.engine.getCanvasElement(),_=v.getBoundingClientRect(),C=g(v.style.width),{top:S,left:m,width:p}=_,b=p/C;let{startX:w,startY:T}=n;w+=i.left,T+=i.top;const{document:U,scene:P,engine:A}=l,D=P.getViewport(M.VIEWPORT_KEY.VIEW_MAIN),Z=document.body.clientHeight-T-i.top-zt*2,$=document.body.clientWidth-w-i.left;let H=t,B=D==null?void 0:D.getScrollBar();H>Z?(H=Z,B==null?D&&new I.ScrollBar(D,{enableHorizontal:!1,barSize:8}):D==null||D.resetCanvasSizeAndUpdateScroll()):(B=null,(y=D==null?void 0:D.getScrollBar())==null||y.dispose()),e+=(B==null?void 0:B.barSize)||0,e=Math.min(e,$),w-=I.FIX_ONE_PIXEL_BLUR_OFFSET,T-=I.FIX_ONE_PIXEL_BLUR_OFFSET,this._addBackground(P,e/c,t/o,s);const{scaleX:G,scaleY:Y}=P.getPrecisionScale();P.transformByState({width:e*b/c,height:t*b/o,scaleX:c*b,scaleY:o*b}),U.resize(e/c,t/o),setTimeout(()=>{A.resizeBySize(I.fixLineWidthByScale(e,G),I.fixLineWidthByScale(H,Y))},0);const K=this._layoutService.getContentElement().getBoundingClientRect(),ge=v.getBoundingClientRect();w=w*b+(ge.left-K.left),T=T*b+(ge.top-K.top),this._cellEditorManagerService.setState({startX:w,startY:T,endX:e*b+w,endY:H*b+T,show:!0})}_addBackground(e,t,n,i){const s="_backgroundRectHelperColor_",c=e.getObject(s);c==null&&i==null||(c==null?e.addObjects([new I.Rect(s,{width:t,height:n,fill:i,evented:!1})],M.DOCS_COMPONENT_MAIN_LAYER_INDEX):i==null?c.dispose():(c.setProps({fill:i}),c.transformByState({width:t,height:n})))}_handleEditorVisible(e){var p,b;const{eventType:t}=e;this._cursorChange=[I.DeviceInputEventType.PointerDown,I.DeviceInputEventType.Dblclick].includes(t)?F.CursorChange:F.StartEditor;const n=this._editorBridgeService.getEditRectState();if(n==null)return;const{position:i,documentLayoutObject:s,slideCardOffset:c,scaleX:o,scaleY:l,editorUnitId:g,unitId:d}=n,v=this._getEditorObject();if(v==null)return;const{scene:_}=v;this._contextService.setContextValue(a.EDITOR_ACTIVATED,!0);const{documentModel:C}=s,S=this._getEditorSkeleton(g);if(!S||!C)return;this._fitTextSize(i,c,S,s,o,l);const m=C.getBody().dataStream.length-2||0;(p=_.getViewport(M.VIEWPORT_KEY.VIEW_MAIN))==null||p.scrollToViewportPos({viewportScrollX:Number.POSITIVE_INFINITY}),this._textSelectionManagerService.replaceTextRanges([{startOffset:m,endOffset:m}]),(b=this._renderManagerService.getRenderById(d))==null||b.scene.resetCursor()}_resetBodyStyle(e,t=!1){e.dataStream=a.DEFAULT_EMPTY_DOCUMENT_VALUE,e.textRuns!=null&&(e.textRuns.length===1&&!t?(e.textRuns[0].st=0,e.textRuns[0].ed=1):e.textRuns=void 0),e.paragraphs!=null&&(e.paragraphs.length===1?e.paragraphs[0].startIndex=0:e.paragraphs=[{startIndex:0}]),e.sectionBreaks!=null&&(e.sectionBreaks=void 0),e.tables!=null&&(e.tables=void 0),e.customRanges!=null&&(e.customRanges=void 0),e.customBlocks!=null&&(e.customBlocks=void 0)}_initialKeyboardListener(e){}_showEditorByKeyboard(e){}_commandExecutedListener(e){const t=[ae.id],n=[ee.RichTextEditingMutation.id];e.add(this._commandService.onCommandExecuted(i=>{this._editorService.getFocusId()===z&&(t.includes(i.id)&&this._moveCursorCmdHandler(i),n.includes(i.id)&&this._editorBridgeService.isVisible()&&this._editingChangedHandler())}))}_moveCursorCmdHandler(e){const t=e.params,{keycode:n,isShift:i}=t;n!=null&&this._cursorChange===F.CursorChange?this._moveInEditor(n,i):this._editorBridgeService.changeVisible(t)}_editingChangedHandler(){const e=this._editorBridgeService.getEditorRect();if(!e)return;const t=e.richTextObj;t.refreshDocumentByDocData(),t.resizeToContentSize();const{unitId:n}=this._renderContext;this._handleEditorVisible({visible:!0,eventType:3,unitId:n})}_getEditorObject(){return Xt(this._editorBridgeService.getCurrentEditorId(),this._renderManagerService)}async _handleEditorInvisible(e){const{keycode:t}=e;if(this._cursorChange=F.InitialState,this._exitInput(e),this._editorBridgeService.getEditRectState()==null)return;if(this._editorBridgeService.getEditorDirty()===!1){this._moveCursor(t);return}this._moveCursor(t)}_exitInput(e){this._contextService.setContextValue(a.EDITOR_ACTIVATED,!1),this._cellEditorManagerService.setState({show:e.visible});const t=this._editorBridgeService.getCurrentEditorId();t!=null&&this._undoRedoService.clearUndoRedo(t)}_moveCursor(e){if(e!=null)switch(a.Direction.LEFT,e){case f.KeyCode.ENTER:a.Direction.DOWN;break;case f.KeyCode.TAB:a.Direction.RIGHT;break;case f.KeyCode.ARROW_DOWN:a.Direction.DOWN;break;case f.KeyCode.ARROW_UP:a.Direction.UP;break;case f.KeyCode.ARROW_LEFT:a.Direction.LEFT;break;case f.KeyCode.ARROW_RIGHT:a.Direction.RIGHT;break}}_cursorStateListener(e){const t=this._getEditorObject();if(!t)return;const{document:n}=t;e.add(a.toDisposable(n.onPointerDown$.subscribeEvent(()=>{this._cursorChange===F.StartEditor&&(this._cursorChange=F.CursorChange)})))}_moveInEditor(e,t){let n=a.Direction.LEFT;e===f.KeyCode.ARROW_DOWN?n=a.Direction.DOWN:e===f.KeyCode.ARROW_UP?n=a.Direction.UP:e===f.KeyCode.ARROW_RIGHT&&(n=a.Direction.RIGHT),t?this._commandService.executeCommand(M.MoveSelectionOperation.id,{direction:n}):this._commandService.executeCommand(M.MoveCursorOperation.id,{direction:n})}};Me=Kt([V(1,f.ILayoutService),V(2,a.IUndoRedoService),V(3,a.IContextService),V(4,a.IUniverInstanceService),V(5,I.IRenderManagerService),V(6,de),V(7,xe),V(8,a.Inject(ee.DocSelectionManagerService)),V(9,a.ICommandService),V(10,a.Inject(a.LocaleService)),V(11,M.IEditorService)],Me);function Xt(r,e){if(r==null)return;const t=e.getRenderById(r);if(t==null)return;const{mainComponent:n,scene:i,engine:s,components:c}=t,o=n,l=c.get(M.DOCS_VIEW_KEY.BACKGROUND);return{document:o,docBackground:l,scene:i,engine:s}}var Zt=Object.getOwnPropertyDescriptor,Gt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Zt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},Ne=(r,e)=>(t,n)=>e(t,n,r);let Re=class extends a.RxDisposable{constructor(e,t,n,i){super();O(this,"setSlideTextEditor$",new N.Subject);O(this,"_curRichText",null);O(this,"_d");this._renderContext=e,this._instanceSrv=t,this._commandService=n,this._editorBridgeService=i,this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(a.UniverInstanceType.UNIVER_SLIDE).subscribe(s=>{s&&s.getUnitId()===this._renderContext.unitId?this._d=this._init():this._disposeCurrent()}))}_init(){const e=new a.DisposableCollection;return this._initEventListener(e),e}_disposeCurrent(){var e;(e=this._d)==null||e.dispose(),this._d=null}_setEditorRect(e,t){this._curRichText=t;const{scene:n,engine:i}=this._renderContext,s=this._renderContext.unitId,c={scene:n,engine:i,unitId:s,pageId:e,richTextObj:t};this._editorBridgeService.setEditorRect(c)}_initEventListener(e){const t=c=>{const o=c.getTransformer();o&&(e.add(o.clearControl$.subscribe(()=>{this.setEditorVisible(!1),this.pickOtherObjects()})),e.add(o.createControl$.subscribe(()=>{this.setEditorVisible(!1)})),e.add(c.onDblclick$.subscribeEvent(()=>{o.clearControls();const g=o.getSelectedObjectMap().values().next().value;g&&(g.objectType!==I.ObjectType.RICH_TEXT?this.pickOtherObjects():this.startEditing(c.sceneKey,g))})),e.add(this._instanceSrv.focused$.subscribe(l=>{this.endEditing()})))},{mainComponent:n}=this._renderContext;n.subSceneChanged$.subscribeEvent(c=>{t(c)});const s=Array.from(n.getSubScenes().values());for(let c=0;c<s.length;c++){const o=s[c];t(o)}}pickOtherObjects(){this.endEditing()}endEditing(){var s;if(!this._curRichText)return;this.setEditorVisible(!1);const e=this._curRichText;if(!this._instanceSrv.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE))return!1;e.refreshDocumentByDocData(),e.resizeToContentSize(),this._editorBridgeService.endEditing$.next(e);const n={bl:1,fs:e.fs,text:e.text},i=(s=e.documentData.body)==null?void 0:s.textRuns;if(i&&i.length){const o=i[0].ts;n.cl=o==null?void 0:o.cl}this._commandService.executeCommand(j.id,{unitId:this._renderContext.unitId,oKey:e==null?void 0:e.oKey,props:{richText:n}}),this._curRichText=null}startEditing(e,t){this._setEditorRect(e,t),this.setEditorVisible(!0)}setEditorVisible(e){var n,i;e?(n=this._curRichText)==null||n.hide():(i=this._curRichText)==null||i.show();const{unitId:t}=this._renderContext;this._editorBridgeService.changeVisible({visible:e,eventType:I.DeviceInputEventType.PointerDown,unitId:t})}};Re=Gt([Ne(1,a.IUniverInstanceService),Ne(2,a.ICommandService),Ne(3,de)],Re);var Yt=Object.getOwnPropertyDescriptor,qt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Yt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},je=(r,e)=>(t,n)=>e(t,n,r);let ue=class extends a.RxDisposable{constructor(r,e,t){super(),this._contextService=r,this._instanceSrv=e,this._renderManagerService=t,Promise.resolve().then(()=>this._init())}_init(){this._initSlideDataListener(),this._initContextListener()}_initSlideDataListener(){this._instanceSrv.getTypeOfUnitAdded$(a.UniverInstanceType.UNIVER_SLIDE).pipe(N.takeUntil(this.dispose$)).subscribe(r=>{this._createRenderer(r==null?void 0:r.getUnitId())}),this._instanceSrv.getAllUnitsForType(a.UniverInstanceType.UNIVER_SLIDE).forEach(r=>{this._createRenderer(r.getUnitId())}),this._instanceSrv.getTypeOfUnitDisposed$(a.UniverInstanceType.UNIVER_SLIDE).pipe(N.takeUntil(this.dispose$)).subscribe(r=>this._disposeRenderer(r))}_createRenderer(r){r==null||this._instanceSrv.getUnit(r,a.UniverInstanceType.UNIVER_SLIDE)==null||this._renderManagerService.createRender(r)}_disposeRenderer(r){const e=r.getUnitId();this._renderManagerService.removeRender(e)}_initContextListener(){}};ue=qt([je(0,a.IContextService),je(1,a.IUniverInstanceService),je(2,I.IRenderManagerService)],ue);var Jt=Object.getOwnPropertyDescriptor,Qt=(r,e,t,n)=>{for(var i=n>1?void 0:n?Jt(e,t):e,s=r.length-1,c;s>=0;s--)(c=r[s])&&(i=c(i)||i);return i},ve=(r,e)=>(t,n)=>e(t,n,r);const en="SLIDE_UI";h.UniverSlidesUIPlugin=(he=class extends a.Plugin{constructor(e=qe,t,n,i,s){super(),this._config=e,this._injector=t,this._renderManagerService=n,this._univerInstanceService=i,this._configService=s;const{menu:c,...o}=a.merge({},qe,this._config);c&&this._configService.setConfig("menu",c,{merge:!0}),this._configService.setConfig(Vt,o)}onStarting(){a.mergeOverrideWithDependencies([[ue],[de,{useClass:Ue}],[xe,{useClass:Pt}],[h.SlideCanvasPopMangerService]],this._config.override).forEach(e=>this._injector.add(e))}onReady(){[[q]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(a.UniverInstanceType.UNIVER_SLIDE,e))}),a.mergeOverrideWithDependencies([[h.CanvasView],[h.SlidesUIController],[q],[le]],this._config.override).forEach(e=>{this._injector.add(e)}),this._injector.get(h.CanvasView),this._injector.get(ue)}onRendered(){[[Re],[Me]].forEach(e=>{this.disposeWithMe(this._renderManagerService.registerRenderModule(a.UniverInstanceType.UNIVER_SLIDE,e))}),this._markSlideAsFocused(),this._injector.get(h.SlidesUIController)}onSteady(){this._injector.get(le)}_markSlideAsFocused(){const e=this._univerInstanceService;try{const t=e.getCurrentUnitForType(a.UniverInstanceType.UNIVER_SLIDE);e.focusUnit(t.getUnitId())}catch{}}},O(he,"pluginName",en),O(he,"type",a.UniverInstanceType.UNIVER_SLIDE),he),h.UniverSlidesUIPlugin=Qt([ve(1,a.Inject(a.Injector)),ve(2,I.IRenderManagerService),ve(3,a.IUniverInstanceService),ve(4,a.IConfigService)],h.UniverSlidesUIPlugin),h.ActivateSlidePageOperation=_e,h.AppendSlideOperation=Ie,h.DeleteSlideElementOperation=Se,h.ISlideEditorBridgeService=de,h.InsertSlideFloatImageCommand=te,h.InsertSlideShapeEllipseCommand=re,h.InsertSlideShapeEllipseOperation=Ee,h.InsertSlideShapeRectangleCommand=ie,h.InsertSlideShapeRectangleOperation=Ce,h.SHAPE_MENU_ID=we,h.SLIDES_IMAGE_MENU_ID=Te,h.SLIDE_EDITOR_ID=z,h.SetSlidePageThumbOperation=Oe,h.SlideAddTextCommand=se,h.SlideAddTextOperation=ye,h.SlideEditorContainer=Ge,h.SlideSideBar=Ke,h.SlidesUIMenuSchema=ze,h.UpdateSlideElementOperation=j,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
@@ -1 +1 @@
1
- (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiCaES=i())})(this,function(){"use strict";return{slide:{append:"Afegeix diapositiva",text:{insert:{title:"Insereix text"}},shape:{insert:{title:"Insereix forma",rectangle:"Insereix rectangle",ellipse:"Insereix el·lipse"}},image:{insert:{title:"Insereix imatge",float:"Insereix imatge flotant"}},popup:{edit:"Edita",delete:"Elimina"},sidebar:{text:"Edita text",shape:"Edita forma",image:"Edita imatge"},panel:{fill:{title:"Color de farciment"}}}}});
1
+ (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i():typeof define=="function"&&define.amd?define(i):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiCaES=i())})(this,(function(){"use strict";return{slide:{append:"Afegeix diapositiva",text:{insert:{title:"Insereix text"}},shape:{insert:{title:"Insereix forma",rectangle:"Insereix rectangle",ellipse:"Insereix el·lipse"}},image:{insert:{title:"Insereix imatge",float:"Insereix imatge flotant"}},popup:{edit:"Edita",delete:"Elimina"},sidebar:{text:"Edita text",shape:"Edita forma",image:"Edita imatge"},panel:{fill:{title:"Color de farciment"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiEnUS=t())})(this,function(){"use strict";return{slide:{append:"Append Slide",text:{insert:{title:"Insert Text"}},shape:{insert:{title:"Insert Shape",rectangle:"Insert Rectangle",ellipse:"Insert Ellipse"}},image:{insert:{title:"Insert Image",float:"Insert Float Image"}},popup:{edit:"Edit",delete:"Delete"},sidebar:{text:"Edit Text",shape:"Edit Shape",image:"Edit Image"},panel:{fill:{title:"Fill Color"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiEnUS=t())})(this,(function(){"use strict";return{slide:{append:"Append Slide",text:{insert:{title:"Insert Text"}},shape:{insert:{title:"Insert Shape",rectangle:"Insert Rectangle",ellipse:"Insert Ellipse"}},image:{insert:{title:"Insert Image",float:"Insert Float Image"}},popup:{edit:"Edit",delete:"Delete"},sidebar:{text:"Edit Text",shape:"Edit Shape",image:"Edit Image"},panel:{fill:{title:"Fill Color"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiEsES=t())})(this,function(){"use strict";return{slide:{append:"Añadir diapositiva",text:{insert:{title:"Insertar texto"}},shape:{insert:{title:"Insertar forma",rectangle:"Insertar rectángulo",ellipse:"Insertar elipse"}},image:{insert:{title:"Insertar imagen",float:"Insertar imagen flotante"}},popup:{edit:"Editar",delete:"Eliminar"},sidebar:{text:"Editar texto",shape:"Editar forma",image:"Editar imagen"},panel:{fill:{title:"Color de relleno"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiEsES=t())})(this,(function(){"use strict";return{slide:{append:"Añadir diapositiva",text:{insert:{title:"Insertar texto"}},shape:{insert:{title:"Insertar forma",rectangle:"Insertar rectángulo",ellipse:"Insertar elipse"}},image:{insert:{title:"Insertar imagen",float:"Insertar imagen flotante"}},popup:{edit:"Editar",delete:"Eliminar"},sidebar:{text:"Editar texto",shape:"Editar forma",image:"Editar imagen"},panel:{fill:{title:"Color de relleno"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiFaIR=t())})(this,function(){"use strict";return{slide:{append:"اضافه کردن اسلاید",text:{insert:{title:"درج متن"}},shape:{insert:{title:"درج شکل",rectangle:"درج مستطیل",ellipse:"بیضی را درج کنید"}},image:{insert:{title:"درج تصویر",float:"درج تصویر شناور"}},popup:{edit:"ویرایش",delete:"حذف"},sidebar:{text:"ویرایش متن",shape:"ویرایش شکل",image:"ویرایش تصویر"},panel:{fill:{title:"رنگ پر کردن"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiFaIR=t())})(this,(function(){"use strict";return{slide:{append:"اضافه کردن اسلاید",text:{insert:{title:"درج متن"}},shape:{insert:{title:"درج شکل",rectangle:"درج مستطیل",ellipse:"بیضی را درج کنید"}},image:{insert:{title:"درج تصویر",float:"درج تصویر شناور"}},popup:{edit:"ویرایش",delete:"حذف"},sidebar:{text:"ویرایش متن",shape:"ویرایش شکل",image:"ویرایش تصویر"},panel:{fill:{title:"رنگ پر کردن"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiFrFR=t())})(this,function(){"use strict";return{slide:{append:"Ajouter une diapositive",text:{insert:{title:"Insérer du texte"}},shape:{insert:{title:"Insérer une forme",rectangle:"Insérer un rectangle",ellipse:"Insérer une ellipse"}},image:{insert:{title:"Insérer une image",float:"Insérer une image flottante"}},popup:{edit:"Éditer",delete:"Supprimer"},sidebar:{text:"Éditer le texte",shape:"Éditer la forme",image:"Éditer l'image"},panel:{fill:{title:"Couleur de remplissage"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiFrFR=t())})(this,(function(){"use strict";return{slide:{append:"Ajouter une diapositive",text:{insert:{title:"Insérer du texte"}},shape:{insert:{title:"Insérer une forme",rectangle:"Insérer un rectangle",ellipse:"Insérer une ellipse"}},image:{insert:{title:"Insérer une image",float:"Insérer une image flottante"}},popup:{edit:"Éditer",delete:"Supprimer"},sidebar:{text:"Éditer le texte",shape:"Éditer la forme",image:"Éditer l'image"},panel:{fill:{title:"Couleur de remplissage"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiKoKR=t())})(this,function(){"use strict";return{slide:{append:"슬라이드 추가",text:{insert:{title:"텍스트 삽입"}},shape:{insert:{title:"도형 삽입",rectangle:"사각형 삽입",ellipse:"타원 삽입"}},image:{insert:{title:"이미지 삽입",float:"플로팅 이미지 삽입"}},popup:{edit:"편집",delete:"삭제"},sidebar:{text:"텍스트 편집",shape:"도형 편집",image:"이미지 편집"},panel:{fill:{title:"채우기 색상"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiKoKR=t())})(this,(function(){"use strict";return{slide:{append:"슬라이드 추가",text:{insert:{title:"텍스트 삽입"}},shape:{insert:{title:"도형 삽입",rectangle:"사각형 삽입",ellipse:"타원 삽입"}},image:{insert:{title:"이미지 삽입",float:"플로팅 이미지 삽입"}},popup:{edit:"편집",delete:"삭제"},sidebar:{text:"텍스트 편집",shape:"도형 편집",image:"이미지 편집"},panel:{fill:{title:"채우기 색상"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiRuRU=t())})(this,function(){"use strict";return{slide:{append:"Append Slide",text:{insert:{title:"Insert Text"}},shape:{insert:{title:"Insert Shape",rectangle:"Insert Rectangle",ellipse:"Insert Ellipse"}},image:{insert:{title:"Insert Image",float:"Insert Float Image"}},popup:{edit:"Edit",delete:"Delete"},sidebar:{text:"Edit Text",shape:"Edit Shape",image:"Edit Image"},panel:{fill:{title:"Fill Color"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiRuRU=t())})(this,(function(){"use strict";return{slide:{append:"Append Slide",text:{insert:{title:"Insert Text"}},shape:{insert:{title:"Insert Shape",rectangle:"Insert Rectangle",ellipse:"Insert Ellipse"}},image:{insert:{title:"Insert Image",float:"Insert Float Image"}},popup:{edit:"Edit",delete:"Delete"},sidebar:{text:"Edit Text",shape:"Edit Shape",image:"Edit Image"},panel:{fill:{title:"Fill Color"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiViVN=t())})(this,function(){"use strict";return{slide:{append:"Append Slide",text:{insert:{title:"Insert Text"}},shape:{insert:{title:"Insert Shape",rectangle:"Insert Rectangle",ellipse:"Insert Ellipse"}},image:{insert:{title:"Insert Image",float:"Insert Float Image"}},popup:{edit:"Edit",delete:"Delete"},sidebar:{text:"Edit Text",shape:"Edit Shape",image:"Edit Image"},panel:{fill:{title:"Fill Color"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiViVN=t())})(this,(function(){"use strict";return{slide:{append:"Append Slide",text:{insert:{title:"Insert Text"}},shape:{insert:{title:"Insert Shape",rectangle:"Insert Rectangle",ellipse:"Insert Ellipse"}},image:{insert:{title:"Insert Image",float:"Insert Float Image"}},popup:{edit:"Edit",delete:"Delete"},sidebar:{text:"Edit Text",shape:"Edit Shape",image:"Edit Image"},panel:{fill:{title:"Fill Color"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiZhCN=t())})(this,function(){"use strict";return{slide:{append:"新增幻灯片",text:{insert:{title:"插入文本"}},shape:{insert:{title:"插入图形",rectangle:"插入矩形",ellipse:"插入椭圆"}},image:{insert:{title:"插入图片",float:"插入浮动图片"}},popup:{edit:"编辑",delete:"删除"},sidebar:{text:"编辑文本",shape:"编辑图形",image:"编辑图片"},panel:{fill:{title:"填充"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiZhCN=t())})(this,(function(){"use strict";return{slide:{append:"新增幻灯片",text:{insert:{title:"插入文本"}},shape:{insert:{title:"插入图形",rectangle:"插入矩形",ellipse:"插入椭圆"}},image:{insert:{title:"插入图片",float:"插入浮动图片"}},popup:{edit:"编辑",delete:"删除"},sidebar:{text:"编辑文本",shape:"编辑图形",image:"编辑图片"},panel:{fill:{title:"填充"}}}}}));
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiZhTW=t())})(this,function(){"use strict";return{slide:{append:"Append Slide",text:{insert:{title:"Insert Text"}},shape:{insert:{title:"Insert Shape",rectangle:"Insert Rectangle",ellipse:"Insert Ellipse"}},image:{insert:{title:"Insert Image",float:"Insert Float Image"}},popup:{edit:"Edit",delete:"Delete"},sidebar:{text:"Edit Text",shape:"Edit Shape",image:"Edit Image"},panel:{fill:{title:"Fill Color"}}}}});
1
+ (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.UniverSlidesUiZhTW=t())})(this,(function(){"use strict";return{slide:{append:"Append Slide",text:{insert:{title:"Insert Text"}},shape:{insert:{title:"Insert Shape",rectangle:"Insert Rectangle",ellipse:"Insert Ellipse"}},image:{insert:{title:"Insert Image",float:"Insert Float Image"}},popup:{edit:"Edit",delete:"Delete"},sidebar:{text:"Edit Text",shape:"Edit Shape",image:"Edit Image"},panel:{fill:{title:"Fill Color"}}}}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/slides-ui",
3
- "version": "0.10.3",
3
+ "version": "0.10.4-nightly.202508220605",
4
4
  "private": false,
5
5
  "description": "Univer normal ui-plugin-slides",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -55,24 +55,24 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@univerjs/icons": "^0.4.6",
58
- "@univerjs/design": "0.10.3",
59
- "@univerjs/docs": "0.10.3",
60
- "@univerjs/docs-ui": "0.10.3",
61
- "@univerjs/core": "0.10.3",
62
- "@univerjs/drawing": "0.10.3",
63
- "@univerjs/engine-render": "0.10.3",
64
- "@univerjs/ui": "0.10.3",
65
- "@univerjs/slides": "0.10.3"
58
+ "@univerjs/core": "0.10.4-nightly.202508220605",
59
+ "@univerjs/design": "0.10.4-nightly.202508220605",
60
+ "@univerjs/docs": "0.10.4-nightly.202508220605",
61
+ "@univerjs/docs-ui": "0.10.4-nightly.202508220605",
62
+ "@univerjs/drawing": "0.10.4-nightly.202508220605",
63
+ "@univerjs/slides": "0.10.4-nightly.202508220605",
64
+ "@univerjs/engine-render": "0.10.4-nightly.202508220605",
65
+ "@univerjs/ui": "0.10.4-nightly.202508220605"
66
66
  },
67
67
  "devDependencies": {
68
68
  "postcss": "^8.5.6",
69
69
  "react": "18.3.1",
70
70
  "rxjs": "^7.8.2",
71
71
  "tailwindcss": "3.4.17",
72
- "typescript": "^5.8.3",
73
- "vite": "^7.0.6",
72
+ "typescript": "^5.9.2",
73
+ "vite": "^7.1.3",
74
74
  "vitest": "^3.2.4",
75
- "@univerjs-infra/shared": "0.10.3"
75
+ "@univerjs-infra/shared": "0.10.4"
76
76
  },
77
77
  "scripts": {
78
78
  "test": "vitest run",
package/LICENSE DELETED
@@ -1,176 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS