web.9398.8c5bc91243bdbb38.js Maven / Gradle / Ivy
"use strict";(self.webpackChunkflink=self.webpackChunkflink||[]).push([[9398],{44978:(x,_,e)=>{e.d(_,{w:()=>P});var c=e(77579),o=e(66406),D=e(17445),z=e(71884),C=e(78372),v=e(82722),u=e(94650),I=e(80711);let P=(()=>{class E{constructor(s,a){this.elementRef=s,this.nzCodeEditorComponent=a,this.destroy$=new c.x,this.hiddenMinimap=!1}ngOnInit(){this.createResizeObserver().pipe((0,z.x)((s,a)=>{const{width:g,height:f}=s,{width:h,height:p}=a;return g===h&&f===p}),(0,C.b)(50,o.Z),(0,v.R)(this.destroy$)).subscribe(()=>{this.nzCodeEditorComponent.layout()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}createResizeObserver(){const s=new c.x,a=window.ResizeObserver;if(a){const g=new a(f=>{for(const h of f)h.target===this.elementRef.nativeElement&&s.next(h.contentRect)});g.observe(this.elementRef.nativeElement),this.destroy$.subscribe(()=>g.disconnect())}else"function"==typeof this.elementRef.nativeElement?.getBoundingClientRect&&(0,D.F)(500).pipe((0,v.R)(this.destroy$)).subscribe(()=>{s.next(this.elementRef.nativeElement.getBoundingClientRect())});return s.asObservable()}}return E.\u0275fac=function(s){return new(s||E)(u.Y36(u.SBq),u.Y36(I.XZ))},E.\u0275dir=u.lG2({type:E,selectors:[["nz-code-editor","flinkAutoResize",""]],standalone:!0}),E})()},72801:(x,_,e)=>{e.d(_,{i:()=>c});const c={scrollBeyondLastLine:!1,glyphMargin:!0,language:"apex",wordWrap:"on",readOnly:!0,minimap:{enabled:!1}}},80711:(x,_,e)=>{e.d(_,{XZ:()=>w,qw:()=>N});var c=e(70655),o=e(94650),D=e(24006),z=e(4707),C=e(61135),v=e(39646),u=e(77579),I=e(39841),P=e(54968),E=e(18505),m=e(54004),s=e(82722),a=e(78372),g=e(39300),f=e(71884),h=e(88932),p=e(3187),M=e(36895),W=e(72536),K=e(83353),y=e(65681),S=e(21102);function $(i,d){1&i&&(o.TgZ(0,"div",2),o._UZ(1,"nz-spin"),o.qZA())}function b(i,d){}function j(i,d){if(1&i&&(o.TgZ(0,"div",3),o.YNc(1,b,0,0,"ng-template",4),o.qZA()),2&i){const t=o.oxw();o.xp6(1),o.Q6J("ngTemplateOutlet",t.nzToolkit)}}const R="codeEditor";function L(i){return(...d)=>{i&&i(...d)}}const T=new z.t(1);let O="unload",F=(()=>{class i{constructor(t,n){this.nzConfigService=t,this.firstEditorInitialized=!1,this.option={},this.option$=new C.X(this.option);const l=this.nzConfigService.getConfigForComponent(R);this.document=n,this.config={...l},this.config.monacoEnvironment&&(window.MonacoEnvironment={...this.config.monacoEnvironment}),this.option=this.config.defaultEditorOption||{},this.subscription=this.nzConfigService.getConfigChangeEventForComponent(R).subscribe(()=>{const r=this.nzConfigService.getConfigForComponent(R);r&&this._updateDefaultOption(r.defaultEditorOption)})}ngOnDestroy(){this.subscription.unsubscribe(),this.subscription=null}_updateDefaultOption(t){this.option={...this.option,...t},this.option$.next(this.option),"theme"in t&&t.theme&&monaco.editor.setTheme(t.theme)}requestToInit(){return"LOADED"===O?(this.onInit(),(0,v.of)(this.getLatestOption())):("unload"===O&&(this.config.useStaticLoading&&typeof monaco>"u"?(0,h.ZK)("You choose to use static loading but it seems that you forget to config webpack plugin correctly. Please refer to our official websitefor more details about static loading."):this.loadMonacoScript()),T.pipe((0,E.b)(()=>this.onInit()),(0,m.U)(()=>this.getLatestOption())))}loadMonacoScript(){if(this.config.useStaticLoading)return void Promise.resolve().then(()=>this.onLoad());if("loading"===O)return;O="loading";const t=this.config.assetsRoot,n=t?`${t}/vs`:"assets/vs",l=window,r=this.document.createElement("script");r.type="text/javascript",r.src=`${n}/loader.js`;const A=()=>{U(),l.require.config({paths:{vs:n},...this.config.extraConfig}),l.require(["vs/editor/editor.main"],()=>{this.onLoad()})},B=()=>{throw U(),new Error(`${h.Bq} cannot load assets of monaco editor from source "${n}".`)},U=()=>{r.removeEventListener("load",A),r.removeEventListener("error",B),this.document.documentElement.removeChild(r)};r.addEventListener("load",A),r.addEventListener("error",B),this.document.documentElement.appendChild(r)}onLoad(){O="LOADED",T.next(!0),T.complete(),L(this.config.onLoad)()}onInit(){this.firstEditorInitialized||(this.firstEditorInitialized=!0,L(this.config.onFirstEditorInit)()),L(this.config.onInit)()}getLatestOption(){return{...this.option}}}return i.\u0275fac=function(t){return new(t||i)(o.LFG(W.jY),o.LFG(M.K0))},i.\u0275prov=o.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})(),w=(()=>{class i{constructor(t,n,l,r){this.nzCodeEditorService=t,this.ngZone=n,this.platform=r,this.nzEditorMode="normal",this.nzOriginalText="",this.nzLoading=!1,this.nzFullControl=!1,this.nzEditorInitialized=new o.vpe,this.editorOptionCached={},this.destroy$=new u.x,this.resize$=new u.x,this.editorOption$=new C.X({}),this.editorInstance=null,this.value="",this.modelSet=!1,this.onDidChangeContentDisposable=null,this.onChange=A=>{},this.onTouch=()=>{},this.el=l.nativeElement,this.el.classList.add("ant-code-editor")}set nzEditorOption(t){this.editorOption$.next(t)}ngAfterViewInit(){!this.platform.isBrowser||this.nzCodeEditorService.requestToInit().pipe((0,s.R)(this.destroy$)).subscribe(t=>this.setup(t))}ngOnDestroy(){this.onDidChangeContentDisposable&&(this.onDidChangeContentDisposable.dispose(),this.onDidChangeContentDisposable=null),this.editorInstance&&(this.editorInstance.dispose(),this.editorInstance=null),this.destroy$.next(),this.destroy$.complete()}writeValue(t){this.value=t,this.setValue()}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouch=t}layout(){this.resize$.next()}setup(t){this.ngZone.runOutsideAngular(()=>(0,p.ov)().pipe((0,s.R)(this.destroy$)).subscribe(()=>{this.editorOptionCached=t,this.registerOptionChanges(),this.initMonacoEditorInstance(),this.registerResizeChange(),this.setValue(),this.nzFullControl||this.setValueEmitter(),this.nzEditorInitialized.observers.length&&this.ngZone.run(()=>this.nzEditorInitialized.emit(this.editorInstance))}))}registerOptionChanges(){(0,I.a)([this.editorOption$,this.nzCodeEditorService.option$]).pipe((0,s.R)(this.destroy$)).subscribe(([t,n])=>{this.editorOptionCached={...this.editorOptionCached,...n,...t},this.updateOptionToMonaco()})}initMonacoEditorInstance(){this.ngZone.runOutsideAngular(()=>{this.editorInstance="normal"===this.nzEditorMode?monaco.editor.create(this.el,{...this.editorOptionCached}):monaco.editor.createDiffEditor(this.el,{...this.editorOptionCached})})}registerResizeChange(){this.ngZone.runOutsideAngular(()=>{(0,P.R)(window,"resize").pipe((0,a.b)(300),(0,s.R)(this.destroy$)).subscribe(()=>{this.layout()}),this.resize$.pipe((0,s.R)(this.destroy$),(0,g.h)(()=>!!this.editorInstance),(0,m.U)(()=>({width:this.el.clientWidth,height:this.el.clientHeight})),(0,f.x)((t,n)=>t.width===n.width&&t.height===n.height),(0,a.b)(50)).subscribe(()=>{this.editorInstance.layout()})})}setValue(){if(this.editorInstance){if(this.nzFullControl&&this.value)return void(0,h.ZK)("should not set value when you are using full control mode! It would result in ambiguous data flow!");if("normal"===this.nzEditorMode)if(this.modelSet){const t=this.editorInstance.getModel();this.preservePositionAndSelections(()=>t.setValue(this.value))}else this.editorInstance.setModel(monaco.editor.createModel(this.value,this.editorOptionCached.language)),this.modelSet=!0;else if(this.modelSet){const t=this.editorInstance.getModel();this.preservePositionAndSelections(()=>{t.modified.setValue(this.value),t.original.setValue(this.nzOriginalText)})}else{const t=this.editorOptionCached.language;this.editorInstance.setModel({original:monaco.editor.createModel(this.nzOriginalText,t),modified:monaco.editor.createModel(this.value,t)}),this.modelSet=!0}}}preservePositionAndSelections(t){if(!this.editorInstance)return void t();const n=this.editorInstance.getPosition(),l=this.editorInstance.getSelections();t(),n&&this.editorInstance.setPosition(n),l&&this.editorInstance.setSelections(l)}setValueEmitter(){const t="normal"===this.nzEditorMode?this.editorInstance.getModel():this.editorInstance.getModel().modified;this.onDidChangeContentDisposable=t.onDidChangeContent(()=>{this.emitValue(t.getValue())})}emitValue(t){this.value!==t&&(this.value=t,this.ngZone.run(()=>{this.onChange(t)}))}updateOptionToMonaco(){this.editorInstance&&this.editorInstance.updateOptions({...this.editorOptionCached})}}return i.\u0275fac=function(t){return new(t||i)(o.Y36(F),o.Y36(o.R0b),o.Y36(o.SBq),o.Y36(K.t4))},i.\u0275cmp=o.Xpm({type:i,selectors:[["nz-code-editor"]],inputs:{nzEditorMode:"nzEditorMode",nzOriginalText:"nzOriginalText",nzLoading:"nzLoading",nzFullControl:"nzFullControl",nzToolkit:"nzToolkit",nzEditorOption:"nzEditorOption"},outputs:{nzEditorInitialized:"nzEditorInitialized"},exportAs:["nzCodeEditor"],features:[o._Bn([{provide:D.JU,useExisting:(0,o.Gpc)(()=>i),multi:!0}])],decls:2,vars:2,consts:[["class","ant-code-editor-loading",4,"ngIf"],["class","ant-code-editor-toolkit",4,"ngIf"],[1,"ant-code-editor-loading"],[1,"ant-code-editor-toolkit"],[3,"ngTemplateOutlet"]],template:function(t,n){1&t&&(o.YNc(0,$,2,0,"div",0),o.YNc(1,j,2,1,"div",1)),2&t&&(o.Q6J("ngIf",n.nzLoading),o.xp6(1),o.Q6J("ngIf",n.nzToolkit))},dependencies:[M.O5,M.tP,y.W],encapsulation:2,changeDetection:0}),(0,c.gn)([(0,p.yF)()],i.prototype,"nzLoading",void 0),(0,c.gn)([(0,p.yF)()],i.prototype,"nzFullControl",void 0),i})(),N=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=o.oAB({type:i}),i.\u0275inj=o.cJS({imports:[M.ez,S.PV,y.j]}),i})()}}]);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy