@eclipse-scout/core
Version:
Eclipse Scout runtime
70 lines • 1.85 MB
JavaScript
(()=>{var Xm={268:(et,ii,Ci)=>{var h;(function(Le){(function(Wt){var Ke=typeof globalThis=="object"?globalThis:typeof Ci.g=="object"?Ci.g:typeof self=="object"?self:typeof this=="object"?this:Jn(),mt=ws(Le);typeof Ke.Reflect<"u"&&(mt=ws(Ke.Reflect,mt)),Wt(mt,Ke),typeof Ke.Reflect>"u"&&(Ke.Reflect=Le);function ws(tn,u){return function(qe,ot){Object.defineProperty(tn,qe,{configurable:!0,writable:!0,value:ot}),u&&u(qe,ot)}}function Jn(){throw new ReferenceError("globalThis could not be found. Please polyfill globalThis before loading this module.")}})(function(Wt,Ke){var mt=typeof Symbol=="function",ws=mt&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:S("Symbol.toPrimitive not found."),Jn=mt&&typeof Symbol.iterator<"u"?Symbol.iterator:S("Symbol.iterator not found."),tn=Object.getPrototypeOf(Function),u=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:S("A valid Map constructor could not be found."),qe=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:S("A valid Set constructor could not be found."),ot=typeof WeakMap=="function"?WeakMap:S("A valid WeakMap constructor could not be found."),zt=mt?Symbol.for("@reflect-metadata:registry"):void 0,Ui=sl(),si=Ve(Ui);function Xo(w,R,M,O){if(re(M)){if(!oi(w))throw new TypeError;if(!Fe(R))throw new TypeError;return Zo(w,R)}else{if(!oi(w))throw new TypeError;if(!K(R))throw new TypeError;if(!K(O)&&!re(O)&&!Ti(O))throw new TypeError;return Ti(O)&&(O=void 0),M=Gi(M),sn(w,R,M,O)}}Wt("decorate",Xo);function Vs(w,R){function M(O,z){if(!K(O))throw new TypeError;if(!re(z)&&!to(z))throw new TypeError;Ut(w,R,O,z)}return M}Wt("metadata",Vs);function Qn(w,R,M,O){if(!K(M))throw new TypeError;return re(O)||(O=Gi(O)),Ut(w,R,M,O)}Wt("defineMetadata",Qn);function Zn(w,R,M){if(!K(R))throw new TypeError;return re(M)||(M=Gi(M)),el(w,R,M)}Wt("hasMetadata",Zn);function G(w,R,M){if(!K(R))throw new TypeError;return re(M)||(M=Gi(M)),eo(w,R,M)}Wt("hasOwnMetadata",G);function Ha(w,R,M){if(!K(R))throw new TypeError;return re(M)||(M=Gi(M)),Z(w,R,M)}Wt("getMetadata",Ha);function ri(w,R,M){if(!K(R))throw new TypeError;return re(M)||(M=Gi(M)),pr(w,R,M)}Wt("getOwnMetadata",ri);function Jo(w,R){if(!K(w))throw new TypeError;return re(R)||(R=Gi(R)),rn(w,R)}Wt("getMetadataKeys",Jo);function Qo(w,R){if(!K(w))throw new TypeError;return re(R)||(R=Gi(R)),ye(w,R)}Wt("getOwnMetadataKeys",Qo);function ni(w,R,M){if(!K(R))throw new TypeError;re(M)||(M=Gi(M));var O=Ts(R,M,!1);return re(O)?!1:O.OrdinaryDeleteMetadata(w,R,M)}Wt("deleteMetadata",ni);function Zo(w,R){for(var M=w.length-1;M>=0;--M){var O=w[M],z=O(R);if(!re(z)&&!Ti(z)){if(!Fe(z))throw new TypeError;R=z}}return R}function sn(w,R,M,O){for(var z=w.length-1;z>=0;--z){var ct=w[z],Re=ct(R,M,O);if(!re(Re)&&!Ti(Re)){if(!K(Re))throw new TypeError;O=Re}}return O}function el(w,R,M){var O=eo(w,R,M);if(O)return!0;var z=dt(R);return Ti(z)?!1:el(w,z,M)}function eo(w,R,M){var O=Ts(R,M,!1);return re(O)?!1:il(O.OrdinaryHasOwnMetadata(w,R,M))}function Z(w,R,M){var O=eo(w,R,M);if(O)return pr(w,R,M);var z=dt(R);if(!Ti(z))return Z(w,z,M)}function pr(w,R,M){var O=Ts(R,M,!1);if(!re(O))return O.OrdinaryGetOwnMetadata(w,R,M)}function Ut(w,R,M,O){var z=Ts(M,O,!0);z.OrdinaryDefineOwnMetadata(w,R,M,O)}function rn(w,R){var M=ye(w,R),O=dt(w);if(O===null)return M;var z=rn(O,R);if(z.length<=0)return M;if(M.length<=0)return z;for(var ct=new qe,Re=[],q=0,yt=M;q<yt.length;q++){var ee=yt[q],De=ct.has(ee);De||(ct.add(ee),Re.push(ee))}for(var W=0,ie=z;W<ie.length;W++){var ee=ie[W],De=ct.has(ee);De||(ct.add(ee),Re.push(ee))}return Re}function ye(w,R){var M=Ts(w,R,!1);return M?M.OrdinaryOwnMetadataKeys(w,R):[]}function B(w){if(w===null)return 1;switch(typeof w){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return w===null?1:6;default:return 6}}function re(w){return w===void 0}function Ti(w){return w===null}function Na(w){return typeof w=="symbol"}function K(w){return typeof w=="object"?w!==null:typeof w=="function"}function tl(w,R){switch(B(w)){case 0:return w;case 1:return w;case 2:return w;case 3:return w;case 4:return w;case 5:return w}var M=R===3?"string":R===5?"number":"default",O=Cs(w,ws);if(O!==void 0){var z=O.call(w,M);if(K(z))throw new TypeError;return z}return Va(w,M==="default"?"number":M)}function Va(w,R){if(R==="string"){var M=w.toString;if(I(M)){var O=M.call(w);if(!K(O))return O}var z=w.valueOf;if(I(z)){var O=z.call(w);if(!K(O))return O}}else{var z=w.valueOf;if(I(z)){var O=z.call(w);if(!K(O))return O}var ct=w.toString;if(I(ct)){var O=ct.call(w);if(!K(O))return O}}throw new TypeError}function il(w){return!!w}function Wa(w){return""+w}function Gi(w){var R=tl(w,3);return Na(R)?R:Wa(R)}function oi(w){return Array.isArray?Array.isArray(w):w instanceof Object?w instanceof Array:Object.prototype.toString.call(w)==="[object Array]"}function I(w){return typeof w=="function"}function Fe(w){return typeof w=="function"}function to(w){switch(B(w)){case 3:return!0;case 4:return!0;default:return!1}}function Cs(w,R){var M=w[R];if(M!=null){if(!I(M))throw new TypeError;return M}}function io(w){var R=Cs(w,Jn);if(!I(R))throw new TypeError;var M=R.call(w);if(!K(M))throw new TypeError;return M}function p(w){return w.value}function Ws(w){var R=w.next();return R.done?!1:R}function li(w){var R=w.return;R&&R.call(w)}function dt(w){var R=Object.getPrototypeOf(w);if(typeof w!="function"||w===tn||R!==tn)return R;var M=w.prototype,O=M&&Object.getPrototypeOf(M);if(O==null||O===Object.prototype)return R;var z=O.constructor;return typeof z!="function"||z===w?R:z}function S(w){throw w}function Be(){var w;!re(zt)&&typeof Ke.Reflect<"u"&&!(zt in Ke.Reflect)&&typeof Ke.Reflect.defineMetadata=="function"&&(w=Gt(Ke.Reflect));var R,M,O,z=new ot,ct={registerProvider:Re,getProvider:yt,setProvider:De};return ct;function Re(W){if(!Object.isExtensible(ct))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case w===W:break;case re(R):R=W;break;case R===W:break;case re(M):M=W;break;case M===W:break;default:O===void 0&&(O=new qe),O.add(W);break}}function q(W,ie){if(!re(R)){if(R.isProviderFor(W,ie))return R;if(!re(M)){if(M.isProviderFor(W,ie))return R;if(!re(O))for(var He=io(O);;){var Ye=Ws(He);if(!Ye)return;var ai=p(Ye);if(ai.isProviderFor(W,ie))return li(He),ai}}}if(!re(w)&&w.isProviderFor(W,ie))return w}function yt(W,ie){var He=z.get(W),Ye;return re(He)||(Ye=He.get(ie)),re(Ye)&&(Ye=q(W,ie),re(Ye)||(re(He)&&(He=new u,z.set(W,He)),He.set(ie,Ye))),Ye}function ee(W){if(re(W))throw new TypeError;return R===W||M===W||!re(O)&&O.has(W)}function De(W,ie,He){if(!ee(He))throw new Error("Metadata provider not registered.");var Ye=yt(W,ie);if(Ye!==He){if(!re(Ye))return!1;var ai=z.get(W);re(ai)&&(ai=new u,z.set(W,ai)),ai.set(ie,He)}return!0}}function sl(){var w;return!re(zt)&&K(Ke.Reflect)&&Object.isExtensible(Ke.Reflect)&&(w=Ke.Reflect[zt]),re(w)&&(w=Be()),!re(zt)&&K(Ke.Reflect)&&Object.isExtensible(Ke.Reflect)&&Object.defineProperty(Ke.Reflect,zt,{enumerable:!1,configurable:!1,writable:!1,value:w}),w}function Ve(w){var R=new ot,M={isProviderFor:function(ee,De){var W=R.get(ee);return re(W)?!1:W.has(De)},OrdinaryDefineOwnMetadata:Re,OrdinaryHasOwnMetadata:z,OrdinaryGetOwnMetadata:ct,OrdinaryOwnMetadataKeys:q,OrdinaryDeleteMetadata:yt};return Ui.registerProvider(M),M;function O(ee,De,W){var ie=R.get(ee),He=!1;if(re(ie)){if(!W)return;ie=new u,R.set(ee,ie),He=!0}var Ye=ie.get(De);if(re(Ye)){if(!W)return;if(Ye=new u,ie.set(De,Ye),!w.setProvider(ee,De,M))throw ie.delete(De),He&&R.delete(ee),new Error("Wrong provider for target.")}return Ye}function z(ee,De,W){var ie=O(De,W,!1);return re(ie)?!1:il(ie.has(ee))}function ct(ee,De,W){var ie=O(De,W,!1);if(!re(ie))return ie.get(ee)}function Re(ee,De,W,ie){var He=O(W,ie,!0);He.set(ee,De)}function q(ee,De){var W=[],ie=O(ee,De,!1);if(re(ie))return W;for(var He=ie.keys(),Ye=io(He),ai=0;;){var so=Ws(Ye);if(!so)return W.length=ai,W;var Xe=p(so);try{W[ai]=Xe}catch(za){try{li(Ye)}finally{throw za}}ai++}}function yt(ee,De,W){var ie=O(De,W,!1);if(re(ie)||!ie.delete(ee))return!1;if(ie.size===0){var He=R.get(De);re(He)||(He.delete(W),He.size===0&&R.delete(He))}return!0}}function Gt(w){var R=w.defineMetadata,M=w.hasOwnMetadata,O=w.getOwnMetadata,z=w.getOwnMetadataKeys,ct=w.deleteMetadata,Re=new ot,q={isProviderFor:function(yt,ee){var De=Re.get(yt);return!re(De)&&De.has(ee)?!0:z(yt,ee).length?(re(De)&&(De=new qe,Re.set(yt,De)),De.add(ee),!0):!1},OrdinaryDefineOwnMetadata:R,OrdinaryHasOwnMetadata:M,OrdinaryGetOwnMetadata:O,OrdinaryOwnMetadataKeys:z,OrdinaryDeleteMetadata:ct};return q}function Ts(w,R,M){var O=Ui.getProvider(w,R);if(!re(O))return O;if(M){if(Ui.setProvider(w,R,si))return si;throw new Error("Illegal state.")}}})})(h||(h={}))}},pf={};function Vt(et){var ii=pf[et];if(ii!==void 0)return ii.exports;var Ci=pf[et]={exports:{}};return Xm[et](Ci,Ci.exports,Vt),Ci.exports}Vt.n=et=>{var ii=et&&et.__esModule?()=>et.default:()=>et;return Vt.d(ii,{a:ii}),ii},Vt.d=(et,ii)=>{for(var Ci in ii)Vt.o(ii,Ci)&&!Vt.o(et,Ci)&&Object.defineProperty(et,Ci,{enumerable:!0,get:ii[Ci]})},Vt.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),Vt.o=(et,ii)=>Object.prototype.hasOwnProperty.call(et,ii),Vt.r=et=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(et,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(et,"__esModule",{value:!0})};var ff={};(()=>{"use strict";Vt.r(ff),Vt.d(ff,{AbortKeyStroke:()=>gl,AbstractCompactTreeControlKeyStroke:()=>En,AbstractGrid:()=>un,AbstractLayout:()=>ne,AbstractTableAccessibilityRenderer:()=>Vl,AbstractTableNavigationKeyStroke:()=>us,AbstractTreeNavigationKeyStroke:()=>ks,AcceptInputKeyStroke:()=>Vu,AccessControl:()=>uh,Accordion:()=>Dh,AccordionAdapter:()=>Eh,AccordionField:()=>Sg,AccordionFieldAdapter:()=>xg,AccordionLayout:()=>ml,Action:()=>ce,ActionAdapter:()=>er,ActionExecKeyStroke:()=>yl,ActionKeyStroke:()=>Rr,AggregateTableControl:()=>$s,AggregateTableControlAdapter:()=>Yd,AjaxCall:()=>Gs,AjaxError:()=>Mi,AlphanumericSortingStringColumn:()=>ng,App:()=>G,AppLinkKeyStroke:()=>Fn,AriaLabelledByInsertPosition:()=>wi,ArrayDoNodeSerializer:()=>Ya,AutoLeafPageWithNodes:()=>Up,BackgroundJobPollingStatus:()=>it,BackgroundJobPollingSupport:()=>ch,BaseDoEntity:()=>se,BasicField:()=>Ro,BasicFieldAdapter:()=>Zl,BeanColumn:()=>og,BeanField:()=>Pg,BeanFieldAdapter:()=>Dg,BeanTile:()=>wm,BeanTileAdapter:()=>Cm,BenchColumn:()=>gs,BenchColumnLayoutData:()=>Vr,BenchRowLayoutData:()=>Tp,BookmarkDo:()=>ts,BookmarkDoBuilder:()=>Qt,BookmarkForm:()=>hf,BookmarkStore:()=>_s,BookmarkSupport:()=>gt,BookmarkTableRowIdentifierBooleanComponentDo:()=>Jr,BookmarkTableRowIdentifierDateComponentDo:()=>Xr,BookmarkTableRowIdentifierDo:()=>qr,BookmarkTableRowIdentifierDoFactory:()=>df,BookmarkTableRowIdentifierIntegerComponentDo:()=>jn,BookmarkTableRowIdentifierLongComponentDo:()=>Zr,BookmarkTableRowIdentifierObjectComponentDo:()=>Yr,BookmarkTableRowIdentifierStringComponentDo:()=>Qr,BookmarksTable:()=>Km,BooleanColumn:()=>nr,BooleanColumnUserFilterStateDo:()=>en,Box:()=>wl,BoxButtons:()=>po,BreadcrumbBar:()=>Hm,BreadcrumbBarAdapter:()=>Nm,BreadcrumbBarField:()=>Vm,BreadcrumbBarFieldAdapter:()=>Wm,BreadcrumbBarLayout:()=>of,BreadcrumbItem:()=>nf,BreadcrumbItemAdapter:()=>Om,BrowserField:()=>$n,BrowserFieldAdapter:()=>Eg,BrowserFieldLayout:()=>Gu,BusyIndicator:()=>ph,BusySupport:()=>fh,Button:()=>Oe,ButtonAdapter:()=>Ku,ButtonAdapterMenu:()=>mn,ButtonKeyStroke:()=>Mn,ButtonLayout:()=>ta,ButtonTile:()=>fp,CachedElement:()=>rl,Calculator:()=>ic,Calendar:()=>ze,CalendarAdapter:()=>If,CalendarComponent:()=>rr,CalendarComponentAdapter:()=>Lf,CalendarField:()=>Fg,CalendarFieldAdapter:()=>Rg,CalendarLayout:()=>ud,CalendarListComponent:()=>dd,CalendarModeMenu:()=>_n,CalendarModesMenu:()=>cd,CalendarResourceLookupCall:()=>Nu,CalendarSidebar:()=>Bu,CalendarSidebarLayout:()=>Ou,CalendarSidebarSplitter:()=>Hu,Call:()=>Ws,CancelMenu:()=>wn,Carousel:()=>Pf,CarouselField:()=>Ag,CarouselLayout:()=>Fh,Cell:()=>_t,CellEditorCancelEditKeyStroke:()=>eu,CellEditorCompleteEditKeyStroke:()=>tu,CellEditorPopup:()=>Qd,CellEditorPopupLayout:()=>Zd,CellEditorTabKeyStroke:()=>iu,ChartTableControlConfigHelper:()=>La,CheckBoxField:()=>cs,CheckBoxFieldAdapter:()=>$g,CheckBoxToggleKeyStroke:()=>ia,ClickActiveElementKeyStroke:()=>co,ClipboardField:()=>Mo,ClipboardFieldAdapter:()=>Mg,CloseKeyStroke:()=>fn,CloseMenu:()=>Uf,Code:()=>yr,CodeDo:()=>Je,CodeLookupCall:()=>ro,CodeType:()=>ln,CodeTypeCache:()=>ah,CodeTypeDo:()=>ci,CodeTypeRequest:()=>wr,CodeTypeUpdateMessageDo:()=>qs,CollapseHandle:()=>Yi,ColorField:()=>kg,ColorFieldAdapter:()=>Ig,Column:()=>le,ColumnLayout:()=>cl,ColumnOptimalWidthMeasurer:()=>zd,ColumnUserFilter:()=>Oi,ColumnUserFilterStateDo:()=>Ns,ColumnUserFilterStateMapper:()=>bu,ColumnsTable:()=>pg,ColumnsTable0:()=>cg,ComboMenu:()=>Qh,ComboMenuAdapter:()=>$f,CompactBean:()=>Gd,CompactColumn:()=>Ud,CompactLine:()=>Kd,CompactLineBlock:()=>Eo,CompactTree:()=>mg,CompactTreeDownKeyStroke:()=>ku,CompactTreeLeftKeyStroke:()=>Iu,CompactTreeNode:()=>$u,CompactTreeRightKeyStroke:()=>Lu,CompactTreeUpKeyStroke:()=>Mu,Composite:()=>to,CompositeField:()=>ar,CompositeFieldAdapter:()=>Rn,CompositeTile:()=>tp,ConfigPropertyCache:()=>dh,ConfigPropertyDo:()=>Tr,ContextMenuKeyStroke:()=>pl,ContextMenuPopup:()=>bt,ContextMenuPopupLayout:()=>Zh,CopyKeyStroke:()=>Uu,DataObjectDeserializer:()=>Ja,DataObjectInventory:()=>mt,DataObjectSerializer:()=>Qa,DateColumn:()=>jd,DateColumnUserFilter:()=>yu,DateColumnUserFilterStateDo:()=>ss,DateColumnUserFilterStateMapper:()=>wu,DateDoNodeSerializer:()=>qa,DateField:()=>Ht,DateFieldAdapter:()=>ko,DateFormat:()=>St,DateFormatPatternDefinition:()=>Ge,DateFormatPatternType:()=>Ue,DatePicker:()=>xl,DatePickerPopup:()=>Pl,DatePickerPopupLayout:()=>Vh,DatePickerTouchPopup:()=>Wh,DatePickerTouchPopupLayout:()=>zh,DatePredictionFailedStatus:()=>sa,DateRange:()=>Ne,DateTimeCompositeLayout:()=>ju,DecimalFormat:()=>Ps,DefaultDoTypeResolver:()=>eh,DefaultStatus:()=>fr,DefaultTableAccessibilityRenderer:()=>Wl,DeferredGlassPaneTarget:()=>Er,Desktop:()=>Ie,DesktopAdapter:()=>Uo,DesktopBench:()=>Xt,DesktopFormController:()=>Zp,DesktopHeader:()=>Pa,DesktopHeaderLayout:()=>xp,DesktopLayout:()=>mp,DesktopLogo:()=>gp,DesktopNavigation:()=>Jt,DesktopNavigationHandle:()=>Ea,DesktopNavigationLayout:()=>Fp,DesktopNotification:()=>_i,DesktopNotificationAdapter:()=>Fm,DesktopResponsiveHandler:()=>qf,DesktopTab:()=>_p,DesktopTabArea:()=>Sa,DesktopTabAreaLayout:()=>bp,DesktopTabBoxController:()=>xa,DesktopTabSelectKeyStroke:()=>yp,DesktopToolBox:()=>Go,DetailTableTreeFilter:()=>jp,Device:()=>w,DialogLayout:()=>Qi,Dimension:()=>F,DisableBrowserF5ReloadKeyStroke:()=>wp,DisableBrowserTabSwitchingKeyStroke:()=>vp,DisplayChildController:()=>bo,DisposeWidgetsHybridActionDo:()=>Nn,DoSerializerCycleDetector:()=>Za,DoubleClickSupport:()=>R,DragAndDropHandler:()=>M,DropType:()=>O,EllipsisMenu:()=>yo,EllipsisTabMenu:()=>Ec,EmptyBody:()=>Uh,EnlargeNavigationKeyStroke:()=>Ap,ErrorHandler:()=>ri,Event:()=>qe,EventDelegator:()=>si,EventEmitter:()=>ot,EventSupport:()=>Ui,Extension:()=>Qo,FieldStatus:()=>Jl,FileChooser:()=>Bf,FileChooserAdapter:()=>Of,FileChooserButton:()=>Lg,FileChooserButtonAdapter:()=>Bg,FileChooserController:()=>So,FileChooserField:()=>Og,FileChooserFieldAdapter:()=>Hg,FileChooserFieldBrowseKeyStroke:()=>qu,FileChooserFieldDeleteKeyStroke:()=>Yu,FileInput:()=>Ei,FilterFieldsGroupBox:()=>ef,FilterSupport:()=>Ti,FlexboxLayout:()=>Qs,FlexboxLayoutData:()=>Zs,FocusAdjacentElementKeyStroke:()=>fl,FocusContext:()=>_l,FocusFilterFieldKeyStroke:()=>re,FocusManager:()=>Rh,FocusRule:()=>Et,Form:()=>j,FormAdapter:()=>Ar,FormController:()=>Ao,FormField:()=>A,FormFieldAdapter:()=>at,FormFieldLayout:()=>Kt,FormFieldMenu:()=>Mf,FormFieldMenuAdapter:()=>kf,FormFieldTile:()=>Ai,FormFieldTileAdapter:()=>Sm,FormFieldValidationResultProvider:()=>Ql,FormGrid:()=>Sd,FormLayout:()=>xo,FormLifecycle:()=>Pd,FormLifecycleMenu:()=>$r,FormMenu:()=>Ji,FormMenuActionKeyStroke:()=>xd,FormMenuAdapter:()=>zf,FormTableControl:()=>Xd,FormTableControlAdapter:()=>hg,FormTableControlLayout:()=>Jd,GeoLocationDo:()=>dr,GeoLocationUiCallbackHandler:()=>Gm,GlassPane:()=>Ah,GlassPaneRenderer:()=>Fr,GridData:()=>ke,Group:()=>Pi,GroupAdapter:()=>Af,GroupBox:()=>ae,GroupBoxAdapter:()=>Ju,GroupBoxGridConfig:()=>Xu,GroupBoxLayout:()=>ra,GroupBoxMenuItemsOrder:()=>Is,GroupBoxResponsiveHandler:()=>Po,GroupLayout:()=>Gh,GroupToggleCollapseKeyStroke:()=>Kh,HAlign:()=>ut,HeaderTabBoxController:()=>Sp,HierarchicalLookupResultBuilder:()=>lh,HierarchicalTableAccessibilityRenderer:()=>zl,HorizontalGrid:()=>Pr,HorizontalGridMatrix:()=>vh,HtmlComponent:()=>x,HtmlEncoder:()=>Ga,HtmlEnvironment:()=>we,HtmlField:()=>Qu,HtmlFieldAdapter:()=>Ng,HtmlTile:()=>ip,HtmlTileAdapter:()=>ym,HybridActionContextElement:()=>Wr,HybridActionContextElementConverter:()=>zr,HybridActionContextElementConverters:()=>mi,HybridActionContextElements:()=>Pp,HybridManager:()=>Da,HybridManagerAdapter:()=>Em,HybridUtil:()=>Dp,IFrame:()=>$h,IFrameKeyStrokeContext:()=>Mh,Icon:()=>Es,IconColumn:()=>kl,IconDesc:()=>Di,Image:()=>Dl,ImageField:()=>Lr,ImageFieldAdapter:()=>Vg,ImageFieldLayout:()=>Zu,ImageLayout:()=>jh,InputFieldKeyStrokeContext:()=>qi,Insets:()=>We,IntegerField:()=>Lo,JsFormAdapter:()=>Xf,Key:()=>ao,KeyStroke:()=>B,KeyStrokeContext:()=>Ee,KeyStrokeManager:()=>Ph,KeyTableFilter:()=>fg,Label:()=>Cl,LabelAdapter:()=>Ef,LabelField:()=>na,LabelFieldAdapter:()=>Wg,LayoutConstants:()=>fi,LayoutValidator:()=>yh,LazyNodeFilter:()=>Eu,Lifecycle:()=>pd,LimitedResultTableStatus:()=>Do,ListBox:()=>Io,ListBoxAdapter:()=>zg,ListBoxLayout:()=>ec,ListBoxTableAccessibilityRenderer:()=>Fo,LoadingSupport:()=>Ut,LocalBookmarkStore:()=>uf,LocalUiPreferencesStore:()=>Nh,Locale:()=>Dt,LogLevel:()=>W,LogicalGrid:()=>dl,LogicalGridConfig:()=>Js,LogicalGridData:()=>Sr,LogicalGridLayout:()=>xr,LogicalGridLayoutConfig:()=>kt,LogicalGridLayoutInfo:()=>Ch,LogicalGridLayoutSpy:()=>wh,LogicalGridMatrix:()=>ul,LogicalGridMatrixCell:()=>cn,LogicalGridMatrixCursor:()=>Li,LoginApp:()=>Lm,LoginBox:()=>Yo,LogoutApp:()=>Bm,LogoutBox:()=>rf,LookupBox:()=>An,LookupBoxLayout:()=>ea,LookupCall:()=>Pt,LookupCallColumn:()=>Il,LookupColumn:()=>ag,LookupEditor:()=>Ln,LookupEditorTreeLayout:()=>Wc,LookupFieldAdapter:()=>oa,LookupRow:()=>ls,ManageBookmarksForm:()=>jm,MapDoNodeSerializer:()=>os,MaxLengthHandler:()=>De,MaxRowCountContributionDo:()=>ds,Menu:()=>J,MenuAdapter:()=>wo,MenuBar:()=>Ce,MenuBarBox:()=>vo,MenuBarBoxLayout:()=>hd,MenuBarLayout:()=>Fs,MenuBarLeftKeyStroke:()=>od,MenuBarPopup:()=>ad,MenuBarRightKeyStroke:()=>ld,MenuBox:()=>rd,MenuBoxLayout:()=>nd,MenuDestinations:()=>Ft,MenuExecByNumberKeyStroke:()=>ed,MenuExecKeyStroke:()=>Jh,MenuItemsOrder:()=>gn,MenuKeyStroke:()=>Xh,MenuNavigationDownKeyStroke:()=>td,MenuNavigationExecKeyStroke:()=>To,MenuNavigationKeyStroke:()=>Co,MenuNavigationUpKeyStroke:()=>id,MessageBox:()=>jt,MessageBoxAdapter:()=>vg,MessageBoxController:()=>$o,MessageBoxLayout:()=>zu,MessageBoxes:()=>Ri,MobilePopup:()=>Oh,MobilePopupAdapter:()=>Rf,MobilePopupLayout:()=>Hh,Mode:()=>Vf,ModeAdapter:()=>Wf,ModeSelector:()=>wd,ModeSelectorField:()=>Ug,ModeSelectorFieldAdapter:()=>Gg,ModeSelectorLayout:()=>Cd,ModeSelectorLeftOrUpKeyStroke:()=>Td,ModeSelectorRightOrDownKeyStroke:()=>vd,ModelAdapter:()=>K,MoveSupport:()=>ct,MoveTableRowMenuHelper:()=>Ml,NavigateButton:()=>Gn,NavigateDownButton:()=>$a,NavigateUpButton:()=>Ma,NodeBookmarkPageDo:()=>Os,Notification:()=>qh,NotificationAdapter:()=>Yh,NotificationBadgeStatus:()=>ns,NullLayout:()=>pn,NullLogger:()=>He,NullWidget:()=>Cs,NullWidgetAdapter:()=>io,NumberColumn:()=>Bt,NumberColumnUserFilter:()=>Cu,NumberColumnUserFilterStateDo:()=>rs,NumberColumnUserFilterStateMapper:()=>Tu,NumberDoNodeSerializer:()=>Xa,NumberField:()=>ps,NumberFieldAdapter:()=>tc,ObjectFactory:()=>Le,ObjectIdProvider:()=>Z,OfflineDesktopNotification:()=>$p,OkMenu:()=>Cn,OpenUriHandler:()=>Cp,Outline:()=>bi,OutlineAdapter:()=>$i,OutlineBookmarkDefinitionDo:()=>zi,OutlineKeyStrokeContext:()=>Jp,OutlineLayout:()=>Aa,OutlineMediator:()=>qp,OutlineNavigateToTopKeyStroke:()=>Qp,OutlineOverview:()=>ka,OutlineTileField:()=>$m,OutlineTileFieldAdapter:()=>Mm,OutlineViewButton:()=>jo,OutlineViewButtonAdapter:()=>Am,Page:()=>ht,PageBookmarkDefinitionDo:()=>jr,PageDetailMenuContributor:()=>Gp,PageIdDummyPageParamDo:()=>Bs,PageLayout:()=>Yp,PageParamDo:()=>Ko,PageParamDoTypeResolver:()=>Vp,PageResolver:()=>Un,PageTileButton:()=>Wp,PageTileGrid:()=>Ra,PageTileGridSelectKeyStroke:()=>zp,PageWithNodes:()=>Kr,PageWithTable:()=>zn,ParentTablePageMenuContributor:()=>Kp,ParsingFailedStatus:()=>di,Permission:()=>tt,PermissionCollection:()=>Xs,PermissionCollectionDo:()=>vr,PermissionCollectionType:()=>pi,PermissionDo:()=>Ys,PermissionUpdateMessageDo:()=>hn,PlaceholderField:()=>la,PlaceholderFieldAdapter:()=>Kg,PlaceholderTile:()=>Yt,PlainTextEncoder:()=>Ua,Planner:()=>Te,PlannerAdapter:()=>bn,PlannerField:()=>jg,PlannerFieldAdapter:()=>qg,PlannerHeader:()=>fd,PlannerLayout:()=>gd,PlannerMenuItemsOrder:()=>md,Point:()=>X,Popup:()=>_e,PopupAdapter:()=>Ih,PopupBlockerDesktopNotification:()=>Mp,PopupBlockerHandler:()=>Wn,PopupLayout:()=>xi,PopupManager:()=>Tl,PopupManagerAdapter:()=>Ff,PopupWindow:()=>Nr,PrepopulatedLookupCall:()=>vf,ProfilesTable:()=>ug,PromiseCreator:()=>bf,PropertyChangeEventFilter:()=>gh,PropertyEventEmitter:()=>zt,ProposalChooser:()=>da,ProposalChooserLayout:()=>fc,ProposalField:()=>cc,ProposalFieldAdapter:()=>sm,ProposalTreeNode:()=>pc,QueryBy:()=>me,RadioButton:()=>Bo,RadioButtonAdapter:()=>Yg,RadioButtonGroup:()=>Or,RadioButtonGroupAdapter:()=>Xg,RadioButtonGroupGridConfig:()=>rc,RadioButtonGroupLeftOrUpKeyStroke:()=>nc,RadioButtonGroupRightOrDownKeyStroke:()=>oc,RadioButtonKeyStroke:()=>Oo,RadioButtonLayout:()=>sc,Range:()=>U,RangeKeyStroke:()=>uo,Reconnector:()=>mh,Rectangle:()=>te,RemoteApp:()=>Jo,RemoteEvent:()=>al,RemoteLookupCall:()=>ll,RemoteLookupRequest:()=>vs,RemoteTableOrganizer:()=>_u,RemoteTileFilter:()=>Ca,ResetMenu:()=>Gf,Resizable:()=>Me,ResourcePanel:()=>zc,ResourcePanelTreeNode:()=>_g,ResponseQueue:()=>dn,ResponsiveHandler:()=>Rl,ResponsiveManager:()=>pe,RestLookupCall:()=>Tf,RoundingMode:()=>hi,Route:()=>Hf,RouteChangeEvent:()=>_d,RowLayout:()=>Si,SaveMenu:()=>Kf,Scrollbar:()=>fo,SearchFormTableControl:()=>Bl,SearchMenu:()=>jf,SearchOutline:()=>km,SearchOutlineAdapter:()=>Im,SearchOutlineLayout:()=>Xp,SelectAllTextInFieldKeyStroke:()=>Xl,SequenceBox:()=>kn,SequenceBoxAdapter:()=>Jg,SequenceBoxGridConfig:()=>lc,Session:()=>vt,SessionAdapter:()=>xf,SetDoNodeSerializer:()=>on,ShowInvisibleColumnsForm:()=>Sn,ShrinkNavigationKeyStroke:()=>Rp,SimpleLoadingSupport:()=>rn,SimpleTab:()=>Ta,SimpleTabArea:()=>Vi,SimpleTabAreaLayout:()=>va,SimpleTabBox:()=>lo,SimpleTabBoxController:()=>Dr,SimpleTabBoxLayout:()=>Sh,SimpleTabViewContentLayout:()=>xh,SingleLayout:()=>ji,Slider:()=>yn,SliderAdapter:()=>Nf,SliderField:()=>Qg,SliderFieldLayout:()=>ac,SliderLayout:()=>bd,SliderNavigationKeyStroke:()=>Fl,SliderShiftNavigationKeyStroke:()=>yd,SmartColumn:()=>lg,SmartField:()=>Pe,SmartFieldAdapter:()=>aa,SmartFieldCancelKeyStroke:()=>hc,SmartFieldLayout:()=>ha,SmartFieldMultiline:()=>tm,SmartFieldMultilineAdapter:()=>im,SmartFieldMultilineLayout:()=>uc,SmartFieldPopup:()=>Ho,SmartFieldPopupLayout:()=>dc,SmartFieldTouchPopup:()=>em,SplitBox:()=>be,SplitBoxAdapter:()=>om,SplitBoxCollapseKeyStroke:()=>_c,SplitBoxFirstCollapseKeyStroke:()=>bc,SplitBoxLayout:()=>wc,SplitBoxSecondCollapseKeyStroke:()=>yc,Splitter:()=>hs,StaticLookupCall:()=>Ss,Status:()=>E,StatusMenuMapping:()=>yg,StatusMenuMappingAdapter:()=>wg,StringField:()=>Ni,StringFieldAdapter:()=>lm,StringFieldCtrlEnterKeyStroke:()=>vc,StringFieldEnterKeyStroke:()=>Tc,StringFieldLayout:()=>Cc,SubCloseKeyStroke:()=>sd,Switch:()=>Bn,SwitchAdapter:()=>bm,SwitchNavigationKeyStroke:()=>Uc,SwitchToggleKeyStroke:()=>Gc,System:()=>Wi,Tab:()=>fa,TabArea:()=>es,TabAreaLayout:()=>Dc,TabAreaLeftKeyStroke:()=>Sc,TabAreaRightKeyStroke:()=>xc,TabBox:()=>In,TabBoxAdapter:()=>am,TabBoxHeader:()=>pa,TabBoxHeaderLayout:()=>Pc,TabBoxLayout:()=>Fc,TabItem:()=>ga,TabItemAdapter:()=>hm,TabItemKeyStroke:()=>Ac,TabItemLayout:()=>Rc,Table:()=>H,TableAdapter:()=>Rs,TableBookmarkPageDo:()=>xt,TableClientUiPreferenceProfileDo:()=>Hs,TableClientUiPreferencesDo:()=>is,TableColumnClientUiPreferenceDo:()=>Zt,TableColumnContextElementConverter:()=>Ur,TableCompactHandler:()=>Ed,TableControl:()=>As,TableControlActionKeyStroke:()=>qd,TableControlAdapter:()=>Ll,TableControlAdapterMenu:()=>kr,TableControlCloseKeyStroke:()=>su,TableCopyKeyStroke:()=>ru,TableCustomizer:()=>dg,TableField:()=>fs,TableFieldAdapter:()=>dm,TableFieldValidationResultProvider:()=>$c,TableFooter:()=>Ad,TableFooterLayout:()=>$d,TableHeader:()=>Md,TableHeaderMenu:()=>Bi,TableHeaderMenuButton:()=>st,TableHeaderMenuGroup:()=>Zi,TableHeaderMenuLayout:()=>vn,TableInfoFilterTooltip:()=>Qf,TableInfoLoadTooltip:()=>Zf,TableInfoSelectionTooltip:()=>eg,TableLayout:()=>kd,TableLayoutResetter:()=>ua,TableMatrix:()=>Lt,TableMaxResultsHelper:()=>Tn,TableNavigationCollapseKeyStroke:()=>Ol,TableNavigationDownKeyStroke:()=>du,TableNavigationEndKeyStroke:()=>cu,TableNavigationExpandKeyStroke:()=>Hl,TableNavigationHomeKeyStroke:()=>uu,TableNavigationPageDownKeyStroke:()=>fu,TableNavigationPageUpKeyStroke:()=>pu,TableNavigationUpKeyStroke:()=>hu,TableOrganizer:()=>Nl,TableOrganizerForm:()=>gu,TableOrganizerMenu:()=>mu,TableProposalChooser:()=>rm,TableRefreshKeyStroke:()=>lu,TableRow:()=>Rt,TableRowContextElementConverter:()=>Gr,TableRowDetail:()=>$l,TableRowTileMapping:()=>ig,TableRowTileMappingAdapter:()=>sg,TableSelectAllKeyStroke:()=>nu,TableSelectionHandler:()=>Id,TableStartCellEditKeyStroke:()=>ou,TableTextUserFilter:()=>Hi,TableTextUserFilterStateDo:()=>ur,TableTextUserFilterStateMapper:()=>xu,TableTileGridMediator:()=>Mr,TableTileGridMediatorAdapter:()=>Ld,TableToggleRowKeyStroke:()=>au,TableTooltip:()=>Bd,TableUiPreferences:()=>gi,TableUpdateBuffer:()=>Od,TableUserFilter:()=>ft,TagBar:()=>qt,TagBarLayout:()=>Kc,TagBarOverflowPopup:()=>Vo,TagBarOverflowPopupLayout:()=>jc,TagChooserPopup:()=>Mc,TagChooserPopupLayout:()=>kc,TagField:()=>ma,TagFieldAdapter:()=>um,TagFieldContainerLayout:()=>No,TagFieldDeleteKeyStroke:()=>_a,TagFieldEnterKeyStroke:()=>Ic,TagFieldLayout:()=>Bc,TagFieldNavigationKeyStroke:()=>ba,TagFieldOpenPopupKeyStroke:()=>Lc,TextColumnUserFilter:()=>vu,TextColumnUserFilterStateDo:()=>ys,TextColumnUserFilterStateMapper:()=>Su,TextMap:()=>Ds,TextTableFilter:()=>gg,Tile:()=>$t,TileAccordion:()=>sp,TileAccordionAdapter:()=>Tm,TileAccordionLayout:()=>rp,TileAccordionSelectionHandler:()=>np,TileAdapter:()=>On,TileButton:()=>zo,TileField:()=>cm,TileFieldAdapter:()=>pm,TileGrid:()=>hr,TileGridAdapter:()=>Xc,TileGridGridConfig:()=>Jc,TileGridLayout:()=>Qc,TileGridLayoutConfig:()=>Nt,TileGridMoveSupport:()=>Zc,TileGridSelectAllKeyStroke:()=>op,TileGridSelectDownKeyStroke:()=>hp,TileGridSelectFirstKeyStroke:()=>up,TileGridSelectKeyStroke:()=>Ls,TileGridSelectLastKeyStroke:()=>cp,TileGridSelectLeftKeyStroke:()=>lp,TileGridSelectRightKeyStroke:()=>ap,TileGridSelectUpKeyStroke:()=>dp,TileGridSelectionHandler:()=>wa,TileHtmlField:()=>xm,TileMoveHandler:()=>qc,TileOutlineOverview:()=>qo,TileOverviewForm:()=>Al,TileOverviewFormAdapter:()=>Yf,TileResizeHandler:()=>ep,TileTableField:()=>Pm,TileTableHeaderBox:()=>sf,TileTableHeaderGroupByLookupCall:()=>Hd,TileTableHeaderSortByLookupCall:()=>Nd,TileTableHierarchyFilter:()=>Pu,TileTextFilter:()=>Hn,TimePicker:()=>Ul,TimePickerPopup:()=>Gl,TimePickerPopupLayout:()=>Du,TimePickerTouchPopup:()=>Kl,Tooltip:()=>Xi,TooltipSupport:()=>bl,TopicDo:()=>Ks,TouchPopup:()=>go,TouchPopupLayout:()=>vl,Tree:()=>fe,TreeAdapter:()=>or,TreeBox:()=>ya,TreeBoxAdapter:()=>fm,TreeBoxLayout:()=>Oc,TreeBreadcrumbFilter:()=>Fu,TreeCheckNodesResult:()=>Ir,TreeCollapseAllKeyStroke:()=>Au,TreeCollapseOrDrillUpKeyStroke:()=>Pn,TreeExpandOrDrillDownKeyStroke:()=>Dn,TreeField:()=>Hc,TreeFieldAdapter:()=>Nc,TreeLayout:()=>xn,TreeLayoutResetter:()=>mc,TreeNavigationDownKeyStroke:()=>ql,TreeNavigationEndKeyStroke:()=>Yl,TreeNavigationUpKeyStroke:()=>jl,TreeNode:()=>Fi,TreeNodeContextElementConverter:()=>Ep,TreeProposalChooser:()=>gc,TreeSet:()=>nl,TreeSpaceKeyStroke:()=>Ru,TreeVisitResult:()=>ye,TypeDescriptor:()=>ni,URL:()=>wt,UiCallbackErrorDo:()=>ms,UiCallbackResult:()=>Ia,UiCallbacks:()=>zm,UiCallbacksAdapter:()=>Um,UiNotificationDo:()=>ki,UiNotificationEventSupport:()=>oh,UiNotificationPoller:()=>vi,UiNotificationRequest:()=>br,UiNotificationResponse:()=>_r,UiNotificationSystem:()=>nh,UiNotifications:()=>sh,UiPreferences:()=>ir,UiPreferencesDo:()=>cr,UiPreferencesStore:()=>Sl,UiPreferencesUpdateDo:()=>qn,UnsavedFormChangesForm:()=>Kn,UnsavedFormsLookupCall:()=>tf,UserAgent:()=>_h,UserFilterStateMapper:()=>Ms,UserFilterStateMappers:()=>Ot,UuidPool:()=>yi,UuidPoolAdapter:()=>qm,ValidationFailedStatus:()=>nn,ValueField:()=>ge,ValueFieldAdapter:()=>At,VerticalGridMatrix:()=>oo,VerticalSmartGrid:()=>Th,ViewButton:()=>Ip,ViewButtonActionKeyStroke:()=>kp,ViewButtonAdapter:()=>Lp,ViewButtonBox:()=>Fa,ViewMenuOpenKeyStroke:()=>Bp,ViewMenuPopup:()=>Op,ViewMenuPopupEnterKeyStroke:()=>Hp,ViewMenuTab:()=>Np,ViewportScroller:()=>gr,VirtualKeyStrokeEvent:()=>ho,VirtualScrolling:()=>kh,Widget:()=>I,WidgetEventTypeFilter:()=>bh,WidgetField:()=>Cg,WidgetFieldAdapter:()=>Tg,WidgetFieldLayout:()=>Wu,WidgetPopup:()=>tr,WidgetPopupAdapter:()=>Lh,WidgetPopupLayout:()=>Bh,WidgetSupport:()=>pr,WidgetTile:()=>pp,WidgetTileAdapter:()=>vm,WidgetTooltip:()=>Df,WizardProgressField:()=>gm,WizardProgressFieldAdapter:()=>mm,WizardProgressFieldLayout:()=>Vc,WrappedFormField:()=>Hr,WrappedFormFieldAdapter:()=>_m,YearPanel:()=>El,access:()=>no,aggregation:()=>Ct,ajax:()=>lt,aria:()=>T,arrays:()=>p,clipboard:()=>li,codes:()=>Cr,colorSchemes:()=>dt,comparators:()=>rt,config:()=>Ki,cookies:()=>ol,dataObjects:()=>xe,dates:()=>S,default:()=>Ym,defaultValues:()=>Be,doValueMetaData:()=>Tt,dragAndDrop:()=>z,events:()=>Ve,fields:()=>oe,files:()=>Gt,filters:()=>Us,focusUtils:()=>Qe,fonts:()=>Re,graphics:()=>C,hybridUtil:()=>Vn,icons:()=>q,idCodec:()=>ui,inspector:()=>yt,isPropertyChangeEvent:()=>Xo,keyStrokeModifier:()=>Ae,keys:()=>m,locales:()=>ee,logging:()=>ie,lookupField:()=>Br,menuNavigationKeyStrokes:()=>sr,menus:()=>$e,mimeTypes:()=>Xe,models:()=>zs,numbers:()=>Se,objectFactoryHints:()=>Ke,objects:()=>b,promises:()=>yf,router:()=>It,scout:()=>u,scrollbars:()=>P,strings:()=>_,styles:()=>L,systems:()=>bs,tableUiPreferences:()=>je,texts:()=>de,tileUtil:()=>Wo,tooltips:()=>Y,typeName:()=>ue,uiNotifications:()=>js,uiPreferences:()=>_o,webstorage:()=>he,widgets:()=>Fe});var et={};Vt.r(et),Vt.d(et,{AbortKeyStroke:()=>gl,AbstractCompactTreeControlKeyStroke:()=>En,AbstractGrid:()=>un,AbstractLayout:()=>ne,AbstractTableAccessibilityRenderer:()=>Vl,AbstractTableNavigationKeyStroke:()=>us,AbstractTreeNavigationKeyStroke:()=>ks,AcceptInputKeyStroke:()=>Vu,AccessControl:()=>uh,Accordion:()=>Dh,AccordionAdapter:()=>Eh,AccordionField:()=>Sg,AccordionFieldAdapter:()=>xg,AccordionLayout:()=>ml,Action:()=>ce,ActionAdapter:()=>er,ActionExecKeyStroke:()=>yl,ActionKeyStroke:()=>Rr,AggregateTableControl:()=>$s,AggregateTableControlAdapter:()=>Yd,AjaxCall:()=>Gs,AjaxError:()=>Mi,AlphanumericSortingStringColumn:()=>ng,App:()=>G,AppLinkKeyStroke:()=>Fn,AriaLabelledByInsertPosition:()=>wi,ArrayDoNodeSerializer:()=>Ya,AutoLeafPageWithNodes:()=>Up,BackgroundJobPollingStatus:()=>it,BackgroundJobPollingSupport:()=>ch,BaseDoEntity:()=>se,BasicField:()=>Ro,BasicFieldAdapter:()=>Zl,BeanColumn:()=>og,BeanField:()=>Pg,BeanFieldAdapter:()=>Dg,BeanTile:()=>wm,BeanTileAdapter:()=>Cm,BenchColumn:()=>gs,BenchColumnLayoutData:()=>Vr,BenchRowLayoutData:()=>Tp,BookmarkDo:()=>ts,BookmarkDoBuilder:()=>Qt,BookmarkForm:()=>hf,BookmarkStore:()=>_s,BookmarkSupport:()=>gt,BookmarkTableRowIdentifierBooleanComponentDo:()=>Jr,BookmarkTableRowIdentifierDateComponentDo:()=>Xr,BookmarkTableRowIdentifierDo:()=>qr,BookmarkTableRowIdentifierDoFactory:()=>df,BookmarkTableRowIdentifierIntegerComponentDo:()=>jn,BookmarkTableRowIdentifierLongComponentDo:()=>Zr,BookmarkTableRowIdentifierObjectComponentDo:()=>Yr,BookmarkTableRowIdentifierStringComponentDo:()=>Qr,BookmarksTable:()=>Km,BooleanColumn:()=>nr,BooleanColumnUserFilterStateDo:()=>en,Box:()=>wl,BoxButtons:()=>po,BreadcrumbBar:()=>Hm,BreadcrumbBarAdapter:()=>Nm,BreadcrumbBarField:()=>Vm,BreadcrumbBarFieldAdapter:()=>Wm,BreadcrumbBarLayout:()=>of,BreadcrumbItem:()=>nf,BreadcrumbItemAdapter:()=>Om,BrowserField:()=>$n,BrowserFieldAdapter:()=>Eg,BrowserFieldLayout:()=>Gu,BusyIndicator:()=>ph,BusySupport:()=>fh,Button:()=>Oe,ButtonAdapter:()=>Ku,ButtonAdapterMenu:()=>mn,ButtonKeyStroke:()=>Mn,ButtonLayout:()=>ta,ButtonTile:()=>fp,CachedElement:()=>rl,Calculator:()=>ic,Calendar:()=>ze,CalendarAdapter:()=>If,CalendarComponent:()=>rr,CalendarComponentAdapter:()=>Lf,CalendarField:()=>Fg,CalendarFieldAdapter:()=>Rg,CalendarLayout:()=>ud,CalendarListComponent:()=>dd,CalendarModeMenu:()=>_n,CalendarModesMenu:()=>cd,CalendarResourceLookupCall:()=>Nu,CalendarSidebar:()=>Bu,CalendarSidebarLayout:()=>Ou,CalendarSidebarSplitter:()=>Hu,Call:()=>Ws,CancelMenu:()=>wn,Carousel:()=>Pf,CarouselField:()=>Ag,CarouselLayout:()=>Fh,Cell:()=>_t,CellEditorCancelEditKeyStroke:()=>eu,CellEditorCompleteEditKeyStroke:()=>tu,CellEditorPopup:()=>Qd,CellEditorPopupLayout:()=>Zd,CellEditorTabKeyStroke:()=>iu,ChartTableControlConfigHelper:()=>La,CheckBoxField:()=>cs,CheckBoxFieldAdapter:()=>$g,CheckBoxToggleKeyStroke:()=>ia,ClickActiveElementKeyStroke:()=>co,ClipboardField:()=>Mo,ClipboardFieldAdapter:()=>Mg,CloseKeyStroke:()=>fn,CloseMenu:()=>Uf,Code:()=>yr,CodeDo:()=>Je,CodeLookupCall:()=>ro,CodeType:()=>ln,CodeTypeCache:()=>ah,CodeTypeDo:()=>ci,CodeTypeRequest:()=>wr,CodeTypeUpdateMessageDo:()=>qs,CollapseHandle:()=>Yi,ColorField:()=>kg,ColorFieldAdapter:()=>Ig,Column:()=>le,ColumnLayout:()=>cl,ColumnOptimalWidthMeasurer:()=>zd,ColumnUserFilter:()=>Oi,ColumnUserFilterStateDo:()=>Ns,ColumnUserFilterStateMapper:()=>bu,ColumnsTable:()=>pg,ColumnsTable0:()=>cg,ComboMenu:()=>Qh,ComboMenuAdapter:()=>$f,CompactBean:()=>Gd,CompactColumn:()=>Ud,CompactLine:()=>Kd,CompactLineBlock:()=>Eo,CompactTree:()=>mg,CompactTreeDownKeyStroke:()=>ku,CompactTreeLeftKeyStroke:()=>Iu,CompactTreeNode:()=>$u,CompactTreeRightKeyStroke:()=>Lu,CompactTreeUpKeyStroke:()=>Mu,Composite:()=>to,CompositeField:()=>ar,CompositeFieldAdapter:()=>Rn,CompositeTile:()=>tp,ConfigPropertyCache:()=>dh,ConfigPropertyDo:()=>Tr,ContextMenuKeyStroke:()=>pl,ContextMenuPopup:()=>bt,ContextMenuPopupLayout:()=>Zh,CopyKeyStroke:()=>Uu,DataObjectDeserializer:()=>Ja,DataObjectInventory:()=>mt,DataObjectSerializer:()=>Qa,DateColumn:()=>jd,DateColumnUserFilter:()=>yu,DateColumnUserFilterStateDo:()=>ss,DateColumnUserFilterStateMapper:()=>wu,DateDoNodeSerializer:()=>qa,DateField:()=>Ht,DateFieldAdapter:()=>ko,DateFormat:()=>St,DateFormatPatternDefinition:()=>Ge,DateFormatPatternType:()=>Ue,DatePicker:()=>xl,DatePickerPopup:()=>Pl,DatePickerPopupLayout:()=>Vh,DatePickerTouchPopup:()=>Wh,DatePickerTouchPopupLayout:()=>zh,DatePredictionFailedStatus:()=>sa,DateRange:()=>Ne,DateTimeCompositeLayout:()=>ju,DecimalFormat:()=>Ps,DefaultDoTypeResolver:()=>eh,DefaultStatus:()=>fr,DefaultTableAccessibilityRenderer:()=>Wl,DeferredGlassPaneTarget:()=>Er,Desktop:()=>Ie,DesktopAdapter:()=>Uo,DesktopBench:()=>Xt,DesktopFormController:()=>Zp,DesktopHeader:()=>Pa,DesktopHeaderLayout:()=>xp,DesktopLayout:()=>mp,DesktopLogo:()=>gp,DesktopNavigation:()=>Jt,DesktopNavigationHandle:()=>Ea,DesktopNavigationLayout:()=>Fp,DesktopNotification:()=>_i,DesktopNotificationAdapter:()=>Fm,DesktopResponsiveHandler:()=>qf,DesktopTab:()=>_p,DesktopTabArea:()=>Sa,DesktopTabAreaLayout:()=>bp,DesktopTabBoxController:()=>xa,DesktopTabSelectKeyStroke:()=>yp,DesktopToolBox:()=>Go,DetailTableTreeFilter:()=>jp,Device:()=>w,DialogLayout:()=>Qi,Dimension:()=>F,DisableBrowserF5ReloadKeyStroke:()=>wp,DisableBrowserTabSwitchingKeyStroke:()=>vp,DisplayChildController:()=>bo,DisposeWidgetsHybridActionDo:()=>Nn,DoSerializerCycleDetector:()=>Za,DoubleClickSupport:()=>R,DragAndDropHandler:()=>M,DropType:()=>O,EllipsisMenu:()=>yo,EllipsisTabMenu:()=>Ec,EmptyBody:()=>Uh,EnlargeNavigationKeyStroke:()=>Ap,ErrorHandler:()=>ri,Event:()=>qe,EventDelegator:()=>si,EventEmitter:()=>ot,EventSupport:()=>Ui,Extension:()=>Qo,FieldStatus:()=>Jl,FileChooser:()=>Bf,FileChooserAdapter:()=>Of,FileChooserButton:()=>Lg,FileChooserButtonAdapter:()=>Bg,FileChooserController:()=>So,FileChooserField:()=>Og,FileChooserFieldAdapter:()=>Hg,FileChooserFieldBrowseKeyStroke:()=>qu,FileChooserFieldDeleteKeyStroke:()=>Yu,FileInput:()=>Ei,FilterFieldsGroupBox:()=>ef,FilterSupport:()=>Ti,FlexboxLayout:()=>Qs,FlexboxLayoutData:()=>Zs,FocusAdjacentElementKeyStroke:()=>fl,FocusContext:()=>_l,FocusFilterFieldKeyStroke:()=>re,FocusManager:()=>Rh,FocusRule:()=>Et,Form:()=>j,FormAdapter:()=>Ar,FormController:()=>Ao,FormField:()=>A,FormFieldAdapter:()=>at,FormFieldLayout:()=>Kt,FormFieldMenu:()=>Mf,FormFieldMenuAdapter:()=>kf,FormFieldTile:()=>Ai,FormFieldTileAdapter:()=>Sm,FormFieldValidationResultProvider:()=>Ql,FormGrid:()=>Sd,FormLayout:()=>xo,FormLifecycle:()=>Pd,FormLifecycleMenu:()=>$r,FormMenu:()=>Ji,FormMenuActionKeyStroke:()=>xd,FormMenuAdapter:()=>zf,FormTableControl:()=>Xd,FormTableControlAdapter:()=>hg,FormTableControlLayout:()=>Jd,GeoLocationDo:()=>dr,GeoLocationUiCallbackHandler:()=>Gm,GlassPane:()=>Ah,GlassPaneRenderer:()=>Fr,GridData:()=>ke,Group:()=>Pi,GroupAdapter:()=>Af,GroupBox:()=>ae,GroupBoxAdapter:()=>Ju,GroupBoxGridConfig:()=>Xu,GroupBoxLayout:()=>ra,GroupBoxMenuItemsOrder:()=>Is,GroupBoxResponsiveHandler:()=>Po,GroupLayout:()=>Gh,GroupToggleCollapseKeyStroke:()=>Kh,HAlign:()=>ut,HeaderTabBoxController:()=>Sp,HierarchicalLookupResultBuilder:()=>lh,HierarchicalTableAccessibilityRenderer:()=>zl,HorizontalGrid:()=>Pr,HorizontalGridMatrix:()=>vh,HtmlComponent:()=>x,HtmlEncoder:()=>Ga,HtmlEnvironment:()=>we,HtmlField:()=>Qu,HtmlFieldAdapter:()=>Ng,HtmlTile:()=>ip,HtmlTileAdapter:()=>ym,HybridActionContextElement:()=>Wr,HybridActionContextElementConverter:()=>zr,HybridActionContextElementConverters:()=>mi,HybridActionContextElements:()=>Pp,HybridManager:()=>Da,HybridManagerAdapter:()=>Em,HybridUtil:()=>Dp,IFrame:()=>$h,IFrameKeyStrokeContext:()=>Mh,Icon:()=>Es,IconColumn:()=>kl,IconDesc:()=>Di,Image:()=>Dl,ImageField:()=>Lr,ImageFieldAdapter:()=>Vg,ImageFieldLayout:()=>Zu,ImageLayout:()=>jh,InputFieldKeyStrokeContext:()=>qi,Insets:()=>We,IntegerField:()=>Lo,JsFormAdapter:()=>Xf,Key:()=>ao,KeyStroke:()=>B,KeyStrokeContext:()=>Ee,KeyStrokeManager:()=>Ph,KeyTableFilter:()=>fg,Label:()=>Cl,LabelAdapter:()=>Ef,LabelField:()=>na,LabelFieldAdapter:()=>Wg,LayoutConstants:()=>fi,LayoutValidator:()=>yh,LazyNodeFilter:()=>Eu,Lifecycle:()=>pd,LimitedResultTableStatus:()=>Do,ListBox:()=>Io,ListBoxAdapter:()=>zg,ListBoxLayout:()=>ec,ListBoxTableAccessibilityRenderer:()=>Fo,LoadingSupport:()=>Ut,LocalBookmarkStore:()=>uf,LocalUiPreferencesStore:()=>Nh,Locale:()=>Dt,LogLevel:()=>W,LogicalGrid:()=>dl,LogicalGridConfig:()=>Js,LogicalGridData:()=>Sr,LogicalGridLayout:()=>xr,LogicalGridLayoutConfig:()=>kt,LogicalGridLayoutInfo:()=>Ch,LogicalGridLayoutSpy:()=>wh,LogicalGridMatrix:()=>ul,LogicalGridMatrixCell:()=>cn,LogicalGridMatrixCursor:()=>Li,LoginApp:()=>Lm,LoginBox:()=>Yo,LogoutApp:()=>Bm,LogoutBox:()=>rf,LookupBox:()=>An,LookupBoxLayout:()=>ea,LookupCall:()=>Pt,LookupCallColumn:()=>Il,LookupColumn:()=>ag,LookupEditor:()=>Ln,LookupEditorTreeLayout:()=>Wc,LookupFieldAdapter:()=>oa,LookupRow:()=>ls,ManageBookmarksForm:()=>jm,MapDoNodeSerializer:()=>os,MaxLengthHandler:()=>De,MaxRowCountContributionDo:()=>ds,Menu:()=>J,MenuAdapter:()=>wo,MenuBar:()=>Ce,MenuBarBox:()=>vo,MenuBarBoxLayout:()=>hd,MenuBarLayout:()=>Fs,MenuBarLeftKeyStroke:()=>od,MenuBarPopup:()=>ad,MenuBarRightKeyStroke:()=>ld,MenuBox:()=>rd,MenuBoxLayout:()=>nd,MenuDestinations:()=>Ft,MenuExecByNumberKeyStroke:()=>ed,MenuExecKeyStroke:()=>Jh,MenuItemsOrder:()=>gn,MenuKeyStroke:()=>Xh,MenuNavigationDownKeyStroke:()=>td,MenuNavigationExecKeyStroke:()=>To,MenuNavigationKeyStroke:()=>Co,MenuNavigationUpKeyStroke:()=>id,MessageBox:()=>jt,MessageBoxAdapter:()=>vg,MessageBoxController:()=>$o,MessageBoxLayout:()=>zu,MessageBoxes:()=>Ri,MobilePopup:()=>Oh,MobilePopupAdapter:()=>Rf,MobilePopupLayout:()=>Hh,Mode:()=>Vf,ModeAdapter:()=>Wf,ModeSelector:()=>wd,ModeSelectorField:()=>Ug,ModeSelectorFieldAdapter:()=>Gg,ModeSelectorLayout:()=>Cd,ModeSelectorLeftOrUpKeyStroke:()=>Td,ModeSelectorRightOrDownKeyStroke:()=>vd,ModelAdapter:()=>K,MoveSupport:()=>ct,MoveTableRowMenuHelper:()=>Ml,NavigateButton:()=>Gn,NavigateDownButton:()=>$a,NavigateUpButton:()=>Ma,NodeBookmarkPageDo:()=>Os,Notification:()=>qh,NotificationAdapter:()=>Yh,NotificationBadgeStatus:()=>ns,NullLayout:()=>pn,NullLogger:()=>He,NullWidget:()=>Cs,NullWidgetAdapter:()=>io,NumberColumn:()=>Bt,NumberColumnUserFilter:()=>Cu,NumberColumnUserFilterStateDo:()=>rs,NumberColumnUserFilterStateMapper:()=>Tu,NumberDoNodeSerializer:()=>Xa,NumberField:()=>ps,NumberFieldAdapter:()=>tc,ObjectFactory:()=>Le,ObjectIdProvider:()=>Z,OfflineDesktopNotification:()=>$p,OkMenu:()=>Cn,OpenUriHandler:()=>Cp,Outline:()=>bi,OutlineAdapter:()=>$i,OutlineBookmarkDefinitionDo:()=>zi,OutlineKeyStrokeContext:()=>Jp,OutlineLayout:()=>Aa,OutlineMediator:()=>qp,OutlineNavigateToTopKeyStroke:()=>Qp,OutlineOverview:()=>ka,OutlineTileField:()=>$m,OutlineTileFieldAdapter:()=>Mm,OutlineViewButton:()=>jo,OutlineViewButtonAdapter:()=>Am,Page:()=>ht,PageBookmarkDefinitionDo:()=>jr,PageDetailMenuContributor:()=>Gp,PageIdDummyPageParamDo:()=>Bs,PageLayout:()=>Yp,PageParamDo:()=>Ko,PageParamDoTypeResolver:()=>Vp,PageResolver:()=>Un,PageTileButton:()=>Wp,PageTileGrid:()=>Ra,PageTileGridSelectKeyStroke:()=>zp,PageWithNodes:()=>Kr,PageWithTable:()=>zn,ParentTablePageMenuContributor:()=>Kp,ParsingFailedStatus:()=>di,Permission:()=>tt,PermissionCollection:()=>Xs,PermissionCollectionDo:()=>vr,PermissionCollectionType:()=>pi,PermissionDo:()=>Ys,PermissionUpdateMessageDo:()=>hn,PlaceholderField:()=>la,PlaceholderFieldAdapter:()=>Kg,PlaceholderTile:()=>Yt,PlainTextEncoder:()=>Ua,Planner:()=>Te,PlannerAdapter:()=>bn,PlannerField:()=>jg,PlannerFieldAdapter:()=>qg,PlannerHeader:()=>fd,PlannerLayout:()=>gd,PlannerMenuItemsOrder:()=>md,Point:()=>X,Popup:()=>_e,PopupAdapter:()=>Ih,PopupBlockerDesktopNotification:()=>Mp,PopupBlockerHandler:()=>Wn,PopupLayout:()=>xi,PopupManager:()=>Tl,PopupManagerAdapter:()=>Ff,PopupWindow:()=>Nr,PrepopulatedLookupCall:()=>vf,ProfilesTable:()=>ug,PromiseCreator:()=>bf,PropertyChangeEventFilter:()=>gh,PropertyEventEmitter:()=>zt,ProposalChooser:()=>da,ProposalChooserLayout:()=>fc,ProposalField:()=>cc,ProposalFieldAdapter:()=>sm,ProposalTreeNode:()=>pc,QueryBy:()=>me,RadioButton:()=>Bo,RadioButtonAdapter:()=>Yg,RadioButtonGroup:()=>Or,RadioButtonGroupAdapter:()=>Xg,RadioButtonGroupGridConfig:()=>rc,RadioButtonGroupLeftOrUpKeyStroke:()=>nc,RadioButtonGroupRightOrDownKeyStroke:()=>oc,RadioButtonKeyStroke:()=>Oo,RadioButtonLayout:()=>sc,Range:()=>U,RangeKeyStroke:()=>uo,Reconnector:()=>mh,Rectangle:()=>te,RemoteApp:()=>Jo,RemoteEvent:()=>al,RemoteLookupCall:()=>ll,RemoteLookupRequest:()=>vs,RemoteTableOrganizer:()=>_u,RemoteTileFilter:()=>Ca,ResetMenu:()=>Gf,Resizable:()=>Me,ResourcePanel:()=>zc,ResourcePanelTreeNode:()=>_g,ResponseQueue:()=>dn,ResponsiveHandler:()=>Rl,ResponsiveManager:()=>pe,RestLookupCall:()=>Tf,RoundingMode:()=>hi,Route:()=>Hf,RouteChangeEvent:()=>_d,RowLayout:()=>Si,SaveMenu:()=>Kf,Scrollbar:()=>fo,SearchFormTableControl:()=>Bl,SearchMenu:()=>jf,SearchOutline:()=>km,SearchOutlineAdapter:()=>Im,SearchOutlineLayout:()=>Xp,SelectAllTextInFieldKeyStroke:()=>Xl,SequenceBox:()=>kn,SequenceBoxAdapter:()=>Jg,SequenceBoxGridConfig:()=>lc,Session:()=>vt,SessionAdapter:()=>xf,SetDoNodeSerializer:()=>on,ShowInvisibleColumnsForm:()=>Sn,ShrinkNavigationKeyStroke:()=>Rp,SimpleLoadingSupport:()=>rn,SimpleTab:()=>Ta,SimpleTabArea:()=>Vi,SimpleTabAreaLayout:()=>va,SimpleTabBox:()=>lo,SimpleTabBoxController:()=>Dr,SimpleTabBoxLayout:()=>Sh,SimpleTabViewContentLayout:()=>xh,SingleLayout:()=>ji,Slider:()=>yn,SliderAdapter:()=>Nf,SliderField:()=>Qg,SliderFieldLayout:()=>ac,SliderLayout:()=>bd,SliderNavigationKeyStroke:()=>Fl,SliderShiftNavigationKeyStroke:()=>yd,SmartColumn:()=>lg,SmartField:()=>Pe,SmartFieldAdapter:()=>aa,SmartFieldCancelKeyStroke:()=>hc,SmartFieldLayout:()=>ha,SmartFieldMultiline:()=>tm,SmartFieldMultilineAdapter:()=>im,SmartFieldMultilineLayout:()=>uc,SmartFieldPopup:()=>Ho,SmartFieldPopupLayout:()=>dc,SmartFieldTouchPopup:()=>em,SplitBox:()=>be,SplitBoxAdapter:()=>om,SplitBoxCollapseKeyStroke:()=>_c,SplitBoxFirstCollapseKeyStroke:()=>bc,SplitBoxLayout:()=>wc,SplitBoxSecondCollapseKeyStroke:()=>yc,Splitter:()=>hs,StaticLookupCall:()=>Ss,Status:()=>E,StatusMenuMapping:()=>yg,StatusMenuMappingAdapter:()=>wg,StringField:()=>Ni,StringFieldAdapter:()=>lm,StringFieldCtrlEnterKeyStroke:()=>vc,StringFieldEnterKeyStroke:()=>Tc,StringFieldLayout:()=>Cc,SubCloseKeyStroke:()=>sd,Switch:()=>Bn,SwitchAdapter:()=>bm,SwitchNavigationKeyStroke:()=>Uc,SwitchToggleKeyStroke:()=>Gc,System:()=>Wi,Tab:()=>fa,TabArea:()=>es,TabAreaLayout:()=>Dc,TabAreaLeftKeyStroke:()=>Sc,TabAreaRightKeyStroke:()=>xc,TabBox:()=>In,TabBoxAdapter:()=>am,TabBoxHeader:()=>pa,TabBoxHeaderLayout:()=>Pc,TabBoxLayout:()=>Fc,TabItem:()=>ga,TabItemAdapter:()=>hm,TabItemKeyStroke:()=>Ac,TabItemLayout:()=>Rc,Table:()=>H,TableAdapter:()=>Rs,TableBookmarkPageDo:()=>xt,TableClientUiPreferenceProfileDo:()=>Hs,TableClientUiPreferencesDo:()=>is,TableColumnClientUiPreferenceDo:()=>Zt,TableColumnContextElementConverter:()=>Ur,TableCompactHandler:()=>Ed,TableControl:()=>As,TableControlActionKeyStroke:()=>qd,TableControlAdapter:()=>Ll,TableControlAdapterMenu:()=>kr,TableControlCloseKeyStroke:()=>su,TableCopyKeyStroke:()=>ru,TableCustomizer:()=>dg,TableField:()=>fs,TableFieldAdapter:()=>dm,TableFieldValidationResultProvider:()=>$c,TableFooter:()=>Ad,TableFooterLayout:()=>$d,TableHeader:()=>Md,TableHeaderMenu:()=>Bi,TableHeaderMenuButton:()=>st,TableHeaderMenuGroup:()=>Zi,TableHeaderMenuLayout:()=>vn,TableInfoFilterTooltip:()=>Qf,TableInfoLoadTooltip:()=>Zf,TableInfoSelectionTooltip:()=>eg,TableLayout:()=>kd,TableLayoutResetter:()=>ua,TableMatrix:()=>Lt,TableMaxResultsHelper:()=>Tn,TableNavigationCollapseKeyStroke:()=>Ol,TableNavigationDownKeyStroke:()=>du,TableNavigationEndKeyStroke:()=>cu,TableNavigationExpandKeyStroke:()=>Hl,TableNavigationHomeKeyStroke:()=>uu,TableNavigationPageDownKeyStroke:()=>fu,TableNavigationPageUpKeyStroke:()=>pu,TableNavigationUpKeyStroke:()=>hu,TableOrganizer:()=>Nl,TableOrganizerForm:()=>gu,TableOrganizerMenu:()=>mu,TableProposalChooser:()=>rm,TableRefreshKeyStroke:()=>lu,TableRow:()=>Rt,TableRowContextElementConverter:()=>Gr,TableRowDetail:()=>$l,TableRowTileMapping:()=>ig,TableRowTileMappingAdapter:()=>sg,TableSelectAllKeyStroke:()=>nu,TableSelectionHandler:()=>Id,TableStartCellEditKeyStroke:()=>ou,TableTextUserFilter:()=>Hi,TableTextUserFilterStateDo:()=>ur,TableTextUserFilterStateMapper:()=>xu,TableTileGridMediator:()=>Mr,TableTileGridMediatorAdapter:()=>Ld,TableToggleRowKeyStroke:()=>au,TableTooltip:()=>Bd,TableUiPreferences:()=>gi,TableUpdateBuffer:()=>Od,TableUserFilter:()=>ft,TagBar:()=>qt,TagBarLayout:()=>Kc,TagBarOverflowPopup:()=>Vo,TagBarOverflowPopupLayout:()=>jc,TagChooserPopup:()=>Mc,TagChooserPopupLayout:()=>kc,TagField:()=>ma,TagFieldAdapter:()=>um,TagFieldContainerLayout:()=>No,TagFieldDeleteKeyStroke:()=>_a,TagFieldEnterKeyStroke:()=>Ic,TagFieldLayout:()=>Bc,TagFieldNavigationKeyStroke:()=>ba,TagFieldOpenPopupKeyStroke:()=>Lc,TextColumnUserFilter:()=>vu,TextColumnUserFilterStateDo:()=>ys,TextColumnUserFilterStateMapper:()=>Su,TextMap:()=>Ds,TextTableFilter:()=>gg,Tile:()=>$t,TileAccordion:()=>sp,TileAccordionAdapter:()=>Tm,TileAccordionLayout:()=>rp,TileAccordionSelectionHandler:()=>np,TileAdapter:()=>On,TileButton:()=>zo,TileField:()=>cm,TileFieldAdapter:()=>pm,TileGrid:()=>hr,TileGridAdapter:()=>Xc,TileGridGridConfig:()=>Jc,TileGridLayout:()=>Qc,TileGridLayoutConfig:()=>Nt,TileGridMoveSupport:()=>Zc,TileGridSelectAllKeyStroke:()=>op,TileGridSelectDownKeyStroke:()=>hp,TileGridSelectFirstKeyStroke:()=>up,TileGridSelectKeyStroke:()=>Ls,TileGridSelectLastKeyStroke:()=>cp,TileGridSelectLeftKeyStroke:()=>lp,TileGridSelectRightKeyStroke:()=>ap,TileGridSelectUpKeyStroke:()=>dp,TileGridSelectionHandler:()=>wa,TileHtmlField:()=>xm,TileMoveHandler:()=>qc,TileOutlineOverview:()=>qo,TileOverviewForm:()=>Al,TileOverviewFormAdapter:()=>Yf,TileResizeHandler:()=>ep,TileTableField:()=>Pm,TileTableHeaderBox:()=>sf,TileTableHeaderGroupByLookupCall:()=>Hd,TileTableHeaderSortByLookupCall:()=>Nd,TileTableHierarchyFilter:()=>Pu,TileTextFilter:()=>Hn,TimePicker:()=>Ul,TimePickerPopup:()=>Gl,TimePickerPopupLayout:()=>Du,TimePickerTouchPopup:()=>Kl,Tooltip:()=>Xi,TooltipSupport:()=>bl,TopicDo:()=>Ks,TouchPopup:()=>go,TouchPopupLayout:()=>vl,Tree:()=>fe,TreeAdapter:()=>or,TreeBox:()=>ya,TreeBoxAdapter:()=>fm,TreeBoxLayout:()=>Oc,TreeBreadcrumbFilter:()=>Fu,TreeCheckNodesResult:()=>Ir,TreeCollapseAllKeyStroke:()=>Au,TreeCollapseOrDrillUpKeyStroke:()=>Pn,TreeExpandOrDrillDownKeyStroke:()=>Dn,TreeField:()=>Hc,TreeFieldAdapter:()=>Nc,TreeLayout:()=>xn,TreeLayoutResetter:()=>mc,TreeNavigationDownKeyStroke:()=>ql,TreeNavigationEndKeyStroke:()=>Yl,TreeNavigationUpKeyStroke:()=>jl,TreeNode:()=>Fi,TreeNodeContextElementConverter:()=>Ep,TreeProposalChooser:()=>gc,TreeSet:()=>nl,TreeSpaceKeyStroke:()=>Ru,TreeVisitResult:()=>ye,TypeDescriptor:()=>ni,URL:()=>wt,UiCallbackErrorDo:()=>ms,UiCallbackResult:()=>Ia,UiCallbacks:()=>zm,UiCallbacksAdapter:()=>Um,UiNotificationDo:()=>ki,UiNotificationEventSupport:()=>oh,UiNotificationPoller:()=>vi,UiNotificationRequest:()=>br,UiNotificationResponse:()=>_r,UiNotificationSystem:()=>nh,UiNotifications:()=>sh,UiPreferences:()=>ir,UiPreferencesDo:()=>cr,UiPreferencesStore:()=>Sl,UiPreferencesUpdateDo:()=>qn,UnsavedFormChangesForm:()=>Kn,UnsavedFormsLookupCall:()=>tf,UserAgent:()=>_h,UserFilterStateMapper:()=>Ms,UserFilterStateMappers:()=>Ot,UuidPool:()=>yi,UuidPoolAdapter:()=>qm,ValidationFailedStatus:()=>nn,ValueField:()=>ge,ValueFieldAdapter:()=>At,VerticalGridMatrix:()=>oo,VerticalSmartGrid:()=>Th,ViewButton:()=>Ip,ViewButtonActionKeyStroke:()=>kp,ViewButtonAdapter:()=>Lp,ViewButtonBox:()=>Fa,ViewMenuOpenKeyStroke:()=>Bp,ViewMenuPopup:()=>Op,ViewMenuPopupEnterKeyStroke:()=>Hp,ViewMenuTab:()=>Np,ViewportScroller:()=>gr,VirtualKeyStrokeEvent:()=>ho,VirtualScrolling:()=>kh,Widget:()=>I,WidgetEventTypeFilter:()=>bh,WidgetField:()=>Cg,WidgetFieldAdapter:()=>Tg,WidgetFieldLayout:()=>Wu,WidgetPopup:()=>tr,WidgetPopupAdapter:()=>Lh,WidgetPopupLayout:()=>Bh,WidgetSupport:()=>pr,WidgetTile:()=>pp,WidgetTileAdapter:()=>vm,WidgetTooltip:()=>Df,WizardProgressField:()=>gm,WizardProgressFieldAdapter:()=>mm,WizardProgressFieldLayout:()=>Vc,WrappedFormField:()=>Hr,WrappedFormFieldAdapter:()=>_m,YearPanel:()=>El,access:()=>no,aggregation:()=>Ct,ajax:()=>lt,aria:()=>T,arrays:()=>p,clipboard:()=>li,codes:()=>Cr,colorSchemes:()=>dt,comparators:()=>rt,config:()=>Ki,cookies:()=>ol,dataObjects:()=>xe,dates:()=>S,default:()=>Ym,defaultValues:()=>Be,doValueMetaData:()=>Tt,dragAndDrop:()=>z,events:()=>Ve,fields:()=>oe,files:()=>Gt,filters:()=>Us,focusUtils:()=>Qe,fonts:()=>Re,graphics:()=>C,hybridUtil:()=>Vn,icons:()=>q,idCodec:()=>ui,inspector:()=>yt,isPropertyChangeEvent:()=>Xo,keyStrokeModifier:()=>Ae,keys:()=>m,locales:()=>ee,logging:()=>ie,lookupField:()=>Br,menuNavigationKeyStrokes:()=>sr,menus:()=>$e,mimeTypes:()=>Xe,models:()=>zs,numbers:()=>Se,objectFactoryHints:()=>Ke,objects:()=>b,promises:()=>yf,router:()=>It,scout:()=>u,scrollbars:()=>P,strings:()=>_,styles:()=>L,systems:()=>bs,tableUiPreferences:()=>je,texts:()=>de,tileUtil:()=>Wo,tooltips:()=>Y,typeName:()=>ue,uiNotifications:()=>js,uiPreferences:()=>_o,webstorage:()=>he,widgets:()=>Fe});var ii=Vt(268);const Ci=jQuery;var h=Vt.n(Ci);class Le{initialized;_registry;_objectTypeMap;constructor(){this.initialized=!1,this._registry=new Map,this._objectTypeMap=new Map}static NAMESPACE_SEPARATOR=".";static MODEL_VARIANT_SEPARATOR=":";static HINTS_META_DATA_KEY=Symbol("scout.objectFactoryHints");_createObjectByType(e,t){if(typeof e!="string"&&typeof e!="function")throw new Error("missing or invalid object type");t=t||{};let i=null,s=null;if(typeof e=="string")s=ni.parse(e),i=s.resolve(t);else if(typeof e=="function")i=e;else throw new Error("Invalid objectType "+e);let r=this.get(i||e);if(r){let o=r(t.model);if(!o)throw new Error('Failed to create object for objectType "'+e+'": Factory function did not return a valid object');return o}if(!i&&s)throw s.notFoundError();return new i(t.model)}create(e,t,i){let s,r;if(typeof e=="string"||typeof e=="function")i=i||{},r=t,s=e;else if(b.isObject(e)){if(i=t||{},r=e,!r.objectType)throw new Error('Missing mandatory property "objectType" on model');s=r.objectType}else throw new Error("Invalid arguments");i.model=r;const o=this._createObjectByType(s,i),l=this._ensureUniqueId(o,i),a=this._ensureObjectType(o);return b.isFunction(o.init)&&(r&&(r.id===void 0&&l&&(r.id=Z.get().createUiSeqId()),a&&(r.objectType=this.getObjectType(s))),o.init(r)),o.id===void 0&&l&&(o.id=Z.get().createUiSeqId()),o.objectType===void 0&&a&&(o.objectType=this.getObjectType(s)),o}_ensureObjectType(e){let t=Reflect.getMetadata(Le.HINTS_META_DATA_KEY,e);return u.nvl(t?.ensureObjectType,!0)}_ensureUniqueId(e,t){let i=Reflect.getMetadata(Le.HINTS_META_DATA_KEY,e);return u.nvl(t?.ensureUniqueId,u.nvl(i?.ensureId,!1))}createUniqueId(){return Z.get().createUiSeqId()}resolveTypedObjectType(e){if(typeof e!="string")return e;let t=ni.resolveType(e);return t||e}register(e,t){e=this.resolveTypedObjectType(e),this._registry.set(e,t),h().log.isDebugEnabled()&&h().log.debug("(ObjectFactory) registered create-function for objectType "+this._objectTypeToDebugStr(e))}unregister(e){e=this.resolveTypedObjectType(e),this._registry.delete(e),h().log.isDebugEnabled()&&h().log.debug("(ObjectFactory) unregistered objectType "+this._objectTypeToDebugStr(e))}_objectTypeToDebugStr(e){return typeof e=="string"?e:e.name}get(e){return e=this.resolveTypedObjectType(e),this._registry.get(e)}getObjectType(e){return typeof e=="string"?e:this._objectTypeMap.get(e)}getSubClassesOf(e){const t=[];if(!e)return t;for(let i of this._objectTypeMap.keys())e.isPrototypeOf(i)&&t.push(i);return t}init(){for(let[e,t]of u.objectFactories)this.register(e,t);this.initialized=!0}registerNamespace(e,t,i){i=h().extend({allowedReplacements:[]},i),window[e]=window[e]||{};let s=e==="scout"?"":e+".";for(let[r,o]of Object.entries(t)){if(r==="default"||!o)continue;let l=window[e][r];if(l&&l!==o&&!i.allowedReplacements.includes(r))throw new Error(`${r} is already registered on namespace ${e||"scout"}. Use objectFactories if you want to replace the existing obj.`);window[e][r]=o,!(!o.prototype||r[0].toUpperCase()!==r[0])&&this._objectTypeMap.set(o,s+r)}}removeFromNamespace(e){for(const t of e){let i=this.getObjectType(t);if(i){let[s,r]=i.split(".");window[s]&&(delete window[s][r],Object.keys(window[s]).length===0&&delete window[s])}this._objectTypeMap.delete(t)}}static get(){return Wt}static _set(e){Wt=e}}let Wt=new Le;function Ke(n){return e=>(Reflect.defineMetadata(Le.HINTS_META_DATA_KEY,n,e.prototype),e)}class mt{static _INSTANCE=null;_constructorByTypeName=new Map;_typeNameByObjectType=new Map;_objectTypeByTypeName=new Map;constructor(){}add(e,t,i){if(!e||(t=t||this._readTypeName(e),!t))return!1;if(this._constructorByTypeName.has(t))throw new Error(`There is already a constructor registered for type name '${t}'.`);return this._constructorByTypeName.set(t,e),i=i||Le.get().getObjectType(e),i?(i=_.removePrefix(i,"scout."),this._typeNameByObjectType.set(i,t),this._objectTypeByTypeName.set(t,i),!0):!1}remove(e){typeof e=="string"?this._removeByTypeName(e):this._removeByClass(e)}_removeByClass(e){if(e)for(const[t,i]of this._constructorByTypeName)i===e&&this._removeByTypeName(t)}_removeByTypeName(e){if(!e)return;this._constructorByTypeName.delete(e);const t=this._objectTypeByTypeName.get(e);t&&this._typeNameByObjectType.delete(t),this._objectTypeByTypeName.delete(e)}_readTypeName(e){return new e()._type}getKnownDataObjectClasses(){return this._constructorByTypeName.values()}toConstructor(e){return this._constructorByTypeName.get(e)||this._constructorByTypeName.get(this.toTypeName(e))}toTypeName(e){return e=_.removePrefix(e,"scout."),this._typeNameByObjectType.get(e)}toObjectType(e){return this._objectTypeByTypeName.get(e)}static get(){return mt._INSTANCE||(mt._INSTANCE=new mt),mt._INSTANCE}}window.scout=window.scout||{},window.scout.DataObjectInventory=mt;let ws=null;function Jn(n,e,t){return Le.get().create(n,e,t)}function tn(n,e){if(b.isNullOrUndefined(n))return null;let t=n;if(typeof n=="string"||typeof n=="number"){let i=typeof e=="string"?e:null,s=u.getSession(i);if(s){let r=_.asString(n);return s.root.widget(r)}}return Fe.get(t)}const u={objectFactories:new Map,nvl(){let n;for(let e=0;e<arguments.length&&(n=e<0||arguments.length<=e?void 0:arguments[e],n==null);e++);return n},assertParameter(n,e,t){if(b.isNullOrUndefined(e))throw new Error("Missing required parameter '"+n+"'");if(t&&!(e instanceof t))throw new Error("Parameter '"+n+"' has wrong type");return e},assertProperty(n,e,t){let i=n[e];if(b.isNullOrUndefined(i))throw new Error("Missing required property '"+e+"'");if(t&&!(i instanceof t))throw new Error("Property '"+e+"' has wrong type");return i},assertValue(n,e){if(b.isNullOrUndefined(n))throw new Error(e||"Missing value");return n},assertInstance(n,e,t){if(!(n instanceof e))throw new Error(t||"Value has wrong type");return n},isOneOf(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];if(t.length===0)return!1;let s=t;return t.length===1&&Array.isArray(t[0])&&(s=t[0]),s.indexOf(n)!==-1},create:Jn,ensure(n,e){return typeof n=="string"||typeof n=="function"?u.create(n,e):n},prepareDOM(n){if(n=n||document,h()("noscript",n).remove(),h()("scout-text",n).remove(),h()("scout-version",n).remove(),h()("body",n).addDeviceClass(),u.setDocumentLocale(ee.getNavigatorLocale()),w.get().browser===w.Browser.CHROME){let e='<meta name="google" content="notranslate" />',t=h()("head > title",n);t.length===0?h()("head",n).append(e):t.after(e)}},installGlobalMouseDownInterceptor(n){n.addEventListener("mousedown",e=>{ge.invokeValueFieldAboutToBlurByMouseDown(e.target)},!0)},installSyntheticActiveStateHandler(n){w.get().requiresSyntheticActiveState()&&(ws=[],h()(n).on("mousedown",e=>{let t=h()(e.target);for(;t.length;)ws.push(t.addClass("active")),t=t.parent()}).on("mouseup",()=>{ws.forEach(e=>{e.removeClass("active")}),ws=[]}))},setDocumentLocale(n){b.isNullOrUndefined(n)||(document.documentElement.lang=n.languageTag)},widget:tn,adapter(n,e){if(b.isNullOrUndefined(n))return null;let t=u.getSession(e);return t&&t.modelAdapterRegistry?t.modelAdapterRegistry[n]:null},getSession(n){let e=G.get().sessions;if(!e)return null;if(b.isNullOrUndefined(n))return e[0];for(let t=0;t<e.length;t++){let i=e[t];if(i.partId==n)return i}return null},exportAdapter(n,e){let t=u.getSession(e);if(t&&t.modelAdapterRegistry){let r=t.getModelAdapter(n);if(!r)return null;let o=i(n);return s(r,o),o.type="model",o}function i(r){let o=t.getAdapterData(r);return o=h().extend(!0,{},o),o}function s(r,o){let l,a;r.widget.widgetProperties.forEach(d=>{let c=o[d];if(c)if(Array.isArray(c)){let f=[];c.forEach(g=>{l=t.getModelAdapter(g),a=i(g),s(l,a),f.push(a)}),o[d]=f}else l=t.getModelAdapter(c),a=i(c),s(l,a),o[d]=a}),o=r.exportAdapterData(o)}return null},reloadPage(n){n=n||{},n.schedule?setTimeout(e):e();function e(){u.nvl(n.clearBody,!0)&&h()("body").html(""),n.redirectUrl?window.location.href=n.redirectUrl:window.location.reload()}},addObjectFactories(n){for(let[e,t]of Object.entries(n))u.addObjectFactory(e,t)},addObjectFactory(n,e){u.objectFactories.set(n,e)},cloneShallow(n,e,t){u.assertParameter("template",n);let i=Object.create(Object.getPrototypeOf(n));if(Object.getOwnPropertyNames(n).forEach(s=>{i[s]=n[s]}),e)for(let s in e)i[s]=e[s];return u.nvl(t,!0)&&(i.id=Z.get().createUiSeqId()),i.cloneOf===void 0&&(i.cloneOf=n),i},setLogicalGridSpyEnabled(n,e){let t,i=u.widget(n);if(i instanceof ae?(t=i.htmlBody.layout,i.htmlBody.invalidateLayoutTree(!1)):(t=i.htmlComp.layout,i.htmlComp.invalidateLayoutTree(!1)),!(t instanceof xr))throw new Error("Layout needs to be a LogicalGridLayout");t.setSpyEnabled(e)}};class qe{source;defaultPrevented;type;constructor(e){this.defaultPrevented=!1,h().extend(this,e)}preventDefault(){this.defaultPrevented=!0}}class ot{events;constructor(){this.events=this._createEventSupport()}_createEventSupport(){return new Ui}trigger(e,t){let i;return t instanceof qe?i=t:i=new qe(t),i.source=this,this.events.trigger(e,i),i}one(e,t){this.events.one(e,t)}on(e,t){return this.events.on(e,t)}off(e,t){this.events.off(e,t)}when(e){return this.events.when(e)}addListener(e){this.events.addListener(e)}removeListener(e){this.events.removeListener(e)}}class zt extends ot{initialized;propertyDecorations;_propertyDimensions;_propertyDimensionDefaults;_propertyDimensionAliases;constructor(){super(),this.events.registerSubTypePredicate("propertyChange",(e,t)=>e.propertyName===t),this.propertyDecorations={computed:new Set},this._propertyDimensions={},this._propertyDimensionDefaults={},this._propertyDimensionAliases={},this.initialized=!1}init(e){e=e||{},this._init(e),this.initialized=!0}_init(e){for(const[t,i]of Object.entries(e))this._initProperty(t,i);this._initMultiDimensionalProperties(e)}_initProperty(e,t){t===void 0||this.isPropertyDimensionAlias(e)||this._writeProperty(e,t)}setProperty(e,t){if(this.isMultiDimensionalProperty(e))return this.setMultiDimensionalProperty(e,t);let[i,s]=this.extractPropertyDimension(e);return i&&s?this.setPropertyDimension(i,s,t):this.setPropertyInternal(e,t)}setPropertyInternal(e,t){return b.equals(this.getProperty(e),t)?!1:(this._callSetProperty(e,t),!0)}adaptPropertyName(e){return this.isComputedProperty(e)?"_"+e:e}getProperty(e){return this._readProperty(e)}_readProperty(e){e=this.adaptPropertyName(e);let[t,i]=this.extractPropertyDimension(e);return t&&i?this._readPropertyDimension(t,i):this[e]}_writeProperty(e,t){e=this.adaptPropertyName(e);let[i,s]=this.extractPropertyDimension(e);if(i&&s){this._writePropertyDimension(i,s,t),s==="default"&&!this.initialized&&(this[i]=t);return}this[e]=t}_callSetProperty(e,t){let i="_set"+_.toUpperCaseFirstLetter(e);this[i]?this[i](t):this._setProperty(e,t)}_setProperty(e,t){u.assertParameter("propertyName",e);let i=this._readProperty(e);return b.equals(i,t)?!1:(this._writeProperty(e,t),this.triggerPropertyChange(e,i,t).defaultPrevented?(this._writeProperty(e,i),!1):!0)}triggerPropertyChange(e,t,i){return u.assertParameter("propertyName",e),this.trigger("propertyChange",{propertyName:e,oldValue:t,newValue:i})}callSetter(e,t){let i="set"+_.toUpperCaseFirstLetter(e);this[i]?this[i](t):this.setProperty(e,t)}_addComputedProperties(e){this._decorateProperties("computed",e)}isComputedProperty(e){return this.isPropertyDecorated("computed",e)}get computedProperties(){return this.propertyDecorations.computed}_decorateProperties(e,t){t=p.ensure(t);for(const i of t)this.propertyDecorations[e].add(i)}_undecorateProperties(e,t){t=p.ensure(t);for(const i of t)this.propertyDecorations[e].delete(i)}isPropertyDecorated(e,t){return this.propertyDecorations[e].has(t)}_addMultiDimensionalProperty(e,t){this._propertyDimensionDefaults[e]=t,this.getProperty(e)===void 0&&this.setProperty(e,this.computeMultiDimensionalProperty(e))}get multiDimensionalProperties(){return Object.keys(this._propertyDimensionDefaults)}isMultiDimensionalProperty(e){return e in this._propertyDimensionDefaults}setMultiDimensionalProperty(e,t){return!b.isNullOrUndefined(t)&&typeof t=="object"&&Object.values(t).every(i=>typeof i=="boolean")?this.setPropertyDimensions(e,t):this.setPropertyDimension(e,"default",!!t)}_initMultiDimensionalProperties(e){for(const t of this.multiDimensionalProperties)this._initMultiDimensionalProperty(t,this[t]);for(const[t,i]of Object.entries(this._propertyDimensionAliases))e[t]!==void 0&&this._writePropertyDimension(i.propertyName,i.dimension,e[t]);this._updateMultiDimensionalProperties()}_initMultiDimensionalProperty(e,t){typeof t=="object"?this._writePropertyDimensions(e,t):this._writePropertyDimension(e,"default",t)}_updateMultiDimensionalProperties(){for(const e of this.multiDimensionalProperties)this._updateMultiDimensionalProperty(e)}_updateMultiDimensionalProperty(e){return this.setPropertyInternal(e,this.computeMultiDimensionalProperty(e))}computeMultiDimensionalProperty(e,t){let i=this.getPropertyDimensionDefault(e);for(const s of Object.keys(this.getPropertyDimensions(e)))if(!(t&&t.includes(s)))return!i;return i}setPropertyDimension(e,t,i){let s=h().extend({},this._propertyDimensions[e],{[t]:i});return this.setPropertyDimensions(e,s)}setPropertyDimensions(e,t){t=h().extend({},t);for(const s of Object.keys(this._propertyDimensions[e]||{}))t[s]=u.nvl(t[s],this.getPropertyDimensionDefault(e,s));let i=!1;for(const[s,r]of Object.entries(t)){let o=e+"-"+s,l=this.getAliasForPropertyDimension(e,s);l&&(o=l),this.setPropertyInternal(o,r)&&(i=!0)}return!i&&this.getProperty(e)!==void 0?!1:this._updateMultiDimensionalProperty(e)}getPropertyDimension(e,t){return this._readPropertyDimension(e,t)}getPropertyDimensions(e){return h().extend({},this._propertyDimensions[e])}extendPropertyDimensions(e,t,i){return h().extend(this.getPropertyDimensions(e),{[t]:i})}_addPropertyDimensionAlias(e,t,i){i=h().extend({inverted:!1,dimension:t},i),this._propertyDimensionAliases[t]={propertyName:e,...i}}isPropertyDimensionAlias(e){return!!this._propertyDimensionAliases[e]}getAliasForPropertyDimension(e,t){for(const[i,s]of Object.entries(this._propertyDimensionAliases))if(s.propertyName===e&&s.dimension===t)return i;return null}getPropertyDimensionForAlias(e){let t=this._propertyDimensionAliases[e];return t?[t.propertyName,t.dimension]:[null,null]}getPropertyDimensionDefault(e,t){let i=this._propertyDimensionDefaults[e];return this._propertyDimensionAliases[t]?.inverted?!i:i}_readPropertyDimension(e,t){let i=this._propertyDimensions[e]||{};return u.nvl(i[t],this.getPropertyDimensionDefault(e,t))}_writePropertyDimension(e,t,i){let s=this._propertyDimensions[e]||{};i===this.getPropertyDimensionDefault(e,t)?delete s[t]:s[t]=i,this._propertyDimensions[e]=s}_writePropertyDimensions(e,t){for(const[i,s]of Object.entries(t||{}))this._writePropertyDimension(e,i,s)}extractPropertyDimension(e){let[t,i]=this.getPropertyDimensionForAlias(e);return t&&i?[t,i]:e.includes("-")?([t,i]=e.split("-"),this.isMultiDimensionalProperty(t)?[t,i]:[null,null]):[null,null]}}class Ui{_eventListeners;_subTypePredicates;constructor(){this._eventListeners=[],this._subTypePredicates=b.createMap()}_assertFunc(e){if(!e)throw new Error("Missing callback function")}on(e,t,i){this._assertFunc(t);let s={type:e,func:t,origFunc:i};return this.addListener(s),s}one(e,t){this._assertFunc(t);let i=s=>{this.off(e,i),t(s)};return this.on(e,i,t)}off(e,t){if(!(!e&&!t))for(let i=this._eventListeners.length-1;i>=0;i--){let s=this._eventListeners[i],r=t===s.func||t===s.origFunc,o=e===s.type,l=!1;t&&e?l=r&&o:t?l=r:l=o,l&&this._eventListeners.splice(i,1)}}when(e){let t=h().Deferred();return this.one(e,t.resolve.bind(t)),t.promise()}addListener(e){this._eventListeners.push(e)}removeListener(e){p.remove(this._eventListeners,e)}count(e,t){let i=0;return this._eventListeners.forEach(s=>{e&&e!==s.type||t&&t!==s.func||i++}),i}types(){let e=new Set;for(const t of this._eventListeners)t.type&&e.add(t.type);return Array.from(e)}trigger(e,t){t=t||{},t.type=e;let i=this._eventListeners.slice();for(let s=0;s<i.length;s++){let r=i[s];(!r.type||this._typeMatches(t,r.type))&&r.func(t)}}_typeMatches(e,t){let i=e.type,s=t.split(" ");for(let r=0;r<s.length;r++)if(i===s[r]||this._subTypeMatches(e,s[r]))return!0;return!1}_subTypeMatches(e,t){if(t.indexOf(":")<0)return!1;let i=t.split(":"),s=i[0],r=i[1];if(s!==e.type)return!1;let o=this._subTypePredicates[s];if(o)return o(e,r)}registerSubTypePredicate(e,t){u.assertParameter("type",e),u.assertParameter("predicate",t),this._subTypePredicates[e]=t}}class si{source;target;callSetter;delegateProperties;excludeProperties;delegateEvents;delegateAllProperties;delegateAllEvents;_mirrorListener;_destroyHandler;constructor(e,t,i){i=i||{},this.source=e,this.target=t,this.callSetter=u.nvl(i.callSetter,!0),this.delegateProperties=i.delegateProperties||[],this.excludeProperties=i.excludeProperties||[],this.delegateEvents=i.delegateEvents||[],this.delegateAllProperties=!!i.delegateAllProperties,this.delegateAllEvents=!!i.delegateAllEvents,this._mirrorListener=null,this._destroyHandler=null,this._installSourceListener()}destroy(){this._uninstallSourceListener()}_installSourceListener(){if(this._mirrorListener)throw new Error("source listeners already installed.");this._mirrorListener={func:this._onSourceEvent.bind(this)},this.source.events.addListener(this._mirrorListener),this._destroyHandler=this._uninstallSourceListener.bind(this),this.source.on("destroy",this._destroyHandler),this.target.on("destroy",this._destroyHandler)}_uninstallSourceListener(){this._mirrorListener&&(this.source.events.removeListener(this._mirrorListener),this._mirrorListener=null),this._destroyHandler&&(this.source.off("destroy",this._destroyHandler),this.target.off("destroy",this._destroyHandler),this._destroyHandler=null)}_onSourceEvent(e){e.type==="propertyChange"?this._onSourcePropertyChange(e):(this.delegateAllEvents||this.delegateEvents.indexOf(e.type)>-1)&&this.target.trigger(e.type,e)}_onSourcePropertyChange(e){if(!(this.excludeProperties.indexOf(e.propertyName)>-1)&&(this.delegateAllProperties||this.delegateProperties.indexOf(e.propertyName)>-1)){let t=e.newValue;if(this.source instanceof zt&&this.source.isMultiDimensionalProperty(e.propertyName)&&(t=this.source.getPropertyDimensions(e.propertyName)),si.equalsProperty(e.propertyName,this.target,t))return;this.callSetter?this.target.callSetter(e.propertyName,t):this.target.trigger(e.type,e)}}static equalsProperty(e,t,i){let s=t[e];return Array.isArray(i)&&Array.isArray(s)?p.equals(i,s):b.equals(s,i)}static create(e,t,i){return i.delegateProperties&&i.delegateProperties.length>0||i.delegateEvents&&i.delegateEvents.length>0||i.delegateAllProperties||i.delegateAllEvents?new si(e,t,i):null}}function Xo(n){return n instanceof qe&&!!n.propertyName}let Vs=null,Qn=[],Zn=[];class G extends ot{static addListener(e,t){let i={type:e,func:t};return Vs?Vs.events.addListener(i):Qn.push(i),i}static addBootstrapper(e){if(Zn.indexOf(e)>-1)throw new Error("Bootstrapper is already registered.");Zn.push(e)}static handleJsonError(e,t){if(t?.error)throw{error:t.error,url:e};return t}static get(){return Vs}static _set(e){Vs&&h().log.isWarnEnabled()&&h().log.warn('Overwriting already existing App "'+Vs+'" with "'+e+'".'),Vs=e}remote;initialized;sessions;errorHandler;version;bootstrappers;_loadingTimeoutId;constructor(){super(),this.remote=!1,this.initialized=!1,this.sessions=[],this.bootstrappers=[],this._loadingTimeoutId=null,Qn.forEach(e=>{this.addListener(e)}),Qn=[],G._set(this),this.errorHandler=this._createErrorHandler()}init(e){return e=e||{},this._prepare(e).then(this._bootstrap.bind(this,e.bootstrap)).then(this._init.bind(this,e)).then(this._initDone.bind(this,e)).catch(this._fail.bind(this,e))}_prepare(e){return this._prepareLogging(e).done(()=>{this._prepareEssentials(e),this._prepareDone(e)})}_prepareEssentials(e){Le.get().init()}_prepareDone(e){this.trigger("prepare",{options:e}),h().log.isDebugEnabled()&&h().log.debug("App prepared")}_prepareLogging(e){return ie.bootstrap()}_bootstrap(e){return e=e||{},e.bootstrappers=e.bootstrappers||[],this.bootstrappers=[...this._defaultBootstrappers(e),...e.bootstrappers,...this.bootstrappers,...Zn].filter(t=>!!t),h().promiseAll(this._doBootstrap()).catch(this._bootstrapFail.bind(this,e)).then(this._bootstrapDone.bind(this,e))}_defaultBootstrappers(e){return[w.get().bootstrap.bind(w.get()),Re.bootstrap.bind(Re,e.fonts),ee.bootstrap.bind(ee,e.localesUrl),de.bootstrap.bind(de,e.textsUrl),Cr.bootstrap.bind(Cr,e.codesUrl),no.bootstrap.bind(no,e.permissionsUrl),Ki.bootstrap.bind(Ki,e.configUrl),_o.bootstrap.bind(_o)]}_doBootstrap(){return this.bootstrappers.map(e=>e())}_bootstrapDone(e){he.removeItemFromSessionStorage("scout:bootstrapErrorPageReload"),this.trigger("bootstrap",{options:e}),h().log.isDebugEnabled()&&h().log.debug("App bootstrapped")}_bootstrapFail(e,t,i,s,r){h().log.isInfoEnabled()&&h().log.info("App bootstrap failed");let{url:o,message:l}=this._analyzeBootstrapError(t,i,s,r);if(h().log.isInfoEnabled()&&h().log.info(`Error for resource ${o}. Reloading page...`),he.getItemFromSessionStorage("scout:bootstrapErrorPageReload"))throw h().log.isWarnEnabled()&&h().log.warn("Prevented automatic reload, startup will likely fail."),he.removeItemFromSessionStorage("scout:bootstrapErrorPageReload"),new Error(`Bootstrap resource ${o} could not be loaded: ${l}`);he.setItemToSessionStorage("scout:bootstrapErrorPageReload","true"),u.reloadPage();let a=b.argumentsToArray(arguments).slice(1);return h().rejectedPromise(...a)}_analyzeBootstrapError(e,t,i,s){let r,o;e instanceof Mi?r=e:h().isJqXHR(e)?r=new Mi({jqXHR:e,textStatus:t,errorThrown:i,requestOptions:s}):b.isObject(e)&&e.error&&(o=e);let l,a;if(r){l=r.requestOptions?.url||"",a=`${r.errorDo?.message||""}`;let d=`${this.errorHandler.formatAjaxStatus(r.jqXHR,r.errorThrown)}`;a.includes(d)||(a=`${a} [${this.errorHandler.formatAjaxStatus(r.jqXHR,r.errorThrown)}]`.trim())}else o&&(l=o.url,a=`${o.error.message} [Code ${o.error.code}]`);return{url:l,message:a}}_init(e){e=e||{},this.setLoading(!0);let t=this._checkBrowserCompatibility(e);return t?(this.setLoading(!1),t.then(i=>this._init(i))):(this._initVersion(e),this._prepareDOM(),this._installErrorHandler(),this._installGlobalMouseDownInterceptor(),this._installSyntheticActiveStateHandler(),this._ajaxSetup(),this._installExtensions(),this._triggerInstallExtensions(),this._load(e).then(this._loadSessions.bind(this,e.session)))}_load(e){return h().resolvedPromise()}_checkBrowserCompatibility(e){let t=w.get();if(h().log.isInfoEnabled()&&h().log.info("Detected browser "+t.browser+" version "+t.browserVersion),!u.nvl(e.checkBrowserCompatibility,!0)||t.isSupportedBrowser())return;let i=h().Deferred(),s=b.valueCopy(e);return s.checkBrowserCompatibility=!1,h()(".scout").each(function(){let o=h()(this).appendDiv();o.load("unsupported-browser.html",()=>{o.find("button").on("click",()=>{o.remove(),i.resolve(s)})})}),i.promise()}setLoading(e){e?this._loadingTimeoutId=setTimeout(()=>{this.sessions.some(t=>t.desktop&&t.desktop.rendered)||this._renderLoading()},200):(clearTimeout(this._loadingTimeoutId),this._loadingTimeoutId=null,this._removeLoading())}_renderLoading(){let e=h()("body"),t=e.children(".application-loading-root");t.length||(t=e.appendDiv("application-loading-root").addClass("application-loading-root").fadeIn()),T.role(t,"alert"),T.screenReaderOnly(t.appendDiv("text").attr("lang","en-US").text("Loading")),this._renderLoadingElement(t,"application-loading01"),this._renderLoadingElement(t,"application-loading02"),this._renderLoadingElement(t,"application-loading03")}_renderLoadingElement(e,t){e.children("."+t).length||e.appendDiv(t).hide().fadeIn()}_removeLoading(){let e=h()("body").children(".application-loading-root");e.css("opacity",e.css("opacity")),e.oneAnimationEnd(()=>e.remove()),e.css("opacity")==="1"?e.addClass("fadeout and-more"):e.addClass("fadeout"),w.get().supportsCssAnimation()||e.remove()}_initVersion(e){this.version=u.nvl(this.version,e.version,h()("scout-version").data("value"))}_prepareDOM(){u.prepareDOM(document)}_installGlobalMouseDownInterceptor(){u.installGlobalMouseDownInterceptor(document)}_installSyntheticActiveStateHandler(){u.installSyntheticActiveStateHandler(document)}_installErrorHandler(){window.onerror=this.errorHandler.windowErrorHandler}_createErrorHandler(e){return e=h().extend({},e),u.create(ri,e)}_ajaxSetup(){let e=this._ajaxDefaults();e&&h().ajaxSetup(e)}_ajaxDefaults(){return{beforeSend:this._beforeAjaxCall.bind(this)}}_beforeAjaxCall(e,t){e.setRequestHeader("X-Scout-Correlation-Id",Se.correlationId()),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),this.sessions[0]&&this.sessions[0].ready&&e.setRequestHeader("Accept-Language",this.sessions[0].locale.languageTag)}_loadSessions(e){e=e||{};let t=[];return h()(".scout").each((i,s)=>{let r=h()(s);e.portletPartId=e.portletPartId||r.data("partid")||"0";let o=this._loadSession(r,e);t.push(o)}),h().promiseAll(t)}_loadSession(e,t){let i={$entryPoint:e},s=h().extend({},t,i);s.locale=s.locale||this._loadLocale();let r=this._createSession(s);this.sessions.push(r);let o=this._createDesktop(r.root);return this._triggerDesktopReady(o),r.render(()=>{r._renderDesktop(),r.layoutValidator.validate(),r.focusManager.validateFocus(),r.ready=!0,this._triggerSessionReady(r),h().log.isInfoEnabled()&&h().log.info("Session initialized. Detected "+w.get())}),h().resolvedPromise()}_triggerDesktopReady(e){this.trigger("desktopReady",{desktop:e})}_triggerSessionReady(e){this.trigger("sessionReady",{session:e})}_createSession(e){return u.create(vt,e)}_createDesktop(e){return u.create(Ie,{parent:e})}_loadLocale(){return ee.getNavigatorLocale()}_initDone(e){this.initialized=!0,this.setLoading(!1),this.trigger("init",{options:e}),h().log.isInfoEnabled()&&h().log.info("App initialized")}_fail(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];h().log.error("App initialization failed."),this.setLoading(!1);let o=[];return he.getItemFromSessionStorage("scout:bootstrapErrorPageReload")||(this.sessions.length===0?o.push(this.errorHandler.handle(t,...s).then(l=>{this._appendStartupError(h()("body"),l)})):this.sessions.filter(l=>!l.ready&&!l.isFatalMessageShown()).forEach(l=>{l.$entryPoint.empty();const a=this._createErrorHandler({session:l}),d=a.analyzeError(t).then(c=>(c.showAsFatalError=!0,a.handleErrorInfo(c)));o.push(d)})),this.trigger("fail",{error:t}),h().promiseAll(o).then(l=>h().rejectedPromise(t,...s))}_appendStartupError(e,t){let i=e.appendDiv("startup-error");i.appendDiv("startup-error-title").text("The application could not be started");let s=t.message;t?.httpStatus&&(s=this.errorHandler.getMessageBodyForHttpStatus(t?.httpStatus)),s&&i.appendDiv("startup-error-message").text(s)}_installExtensions(){}_triggerInstallExtensions(){this.trigger("installExtensions")}}const Ha=sourceMappedStackTrace;class ri{objectType;logError;displayError;sendError;session;windowErrorHandler;constructor(){this.logError=!0,this.displayError=!0,this.sendError=!1,this.windowErrorHandler=this._onWindowError.bind(this),this.session=null}static CONSOLE_OUTPUT=!0;init(e){h().extend(this,e)}_onWindowError(e,t,i,s,r){try{if(this._isIgnorableScriptError(e,t,i,s,r)){this.handleErrorInfo({log:`Ignoring error. Message: ${e}`,showAsFatalError:!0,level:W.INFO});return}if(r instanceof Error){this.analyzeError(r).then(a=>(a.showAsFatalError=!0,this.handleErrorInfo(a))).catch(a=>console.error("Error in global JavaScript error handler",a));return}let o="J00",l=e+" at "+t+":"+i+`
(Code `+o+")";this.handleErrorInfo({message:e,showAsFatalError:!0,code:o,log:l})}catch(o){throw new Error("Error in global JavaScript error handler: "+o.message+" (original error: "+e+" at "+t+":"+i+")")}}_isIgnorableScriptError(e,t,i,s,r){return e&&e.toLowerCase().indexOf("script error")>-1&&!t&&!i&&!s&&!r}handle(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];let r=e;return e&&i.length===0&&(String(e)==="[object Arguments]"?(r=e[0],i=[...e].slice(1)):Array.isArray(e)&&(r=e[0],i=e.slice(1))),this.analyzeError(r,...i).then(this.handleErrorInfo.bind(this))}analyzeError(e){let t={error:e,message:null,code:null,httpStatus:null,errorDo:null,stack:null,mappedStack:null,mappingError:null,log:null,debugInfo:null};for(var i=arguments.length,s=new Array(i>1?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];return this._analyzeError(t,...s)}_analyzeError(e){let t=e.error;if(t instanceof Error)return this.mapStack(t.stack).catch(o=>(e.mappingError=o.message+`
`+o.error.message+`
`+o.error.stack,null)).then(o=>(e.mappedStack=o,this._analyzeRegularError(e),e));if(h().isJqXHR(t)||Array.isArray(t)&&h().isJqXHR(t[0])||t instanceof Mi){for(var i=arguments.length,s=new Array(i>1?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];return this._analyzeAjaxError(e,...s),h().resolvedPromise(e)}return t?(this._analyzeOtherError(e),h().resolvedPromise(e)):(this._analyzeNoError(e),h().resolvedPromise(e))}_analyzeRegularError(e){let t=e.error;e.code=this.getJsErrorCode(t),e.showAsFatalError=!0,e.message=String(t.message||t),t.stack&&(e.stack=String(t.stack)),t.debugInfo&&(e.debugInfo=t.debugInfo);let i=e.mappedStack||e.stack,s=[];(!i||i.indexOf(e.message)===-1)&&s.push(e.message),i&&s.push(i),e.mappingError&&s.push(e.mappingError),e.debugInfo&&s.push(`----- Additional debug information: -----
`+e.debugInfo),e.log=p.format(s,`
`)}_analyzeAjaxError(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];let r=e.error,o,l,a,d=null;if(r instanceof Mi)o=r.jqXHR,l=r.errorThrown,a=r.requestOptions,d=r.errorDo;else{i=p.ensure(r).concat(i),o=i[0],l=i[2],a=i[3];let v=o?.responseJSON?.error;Mi.isErrorDo(v)&&(d=v)}let c=this.formatAjaxRequest(a),f=this.formatAjaxStatus(o,l);e.httpStatus=o.status||0,e.code="X"+e.httpStatus,e.errorDo=d,d&&(e.message=d.message,e.level=this._severityToLogLevel(d.severity));let g="AJAX call"+_.box(' "',c,'"')+" failed"+_.box(" [",f,"]"),y=[];e.message?y.push(e.message):e.message=g,y.push(g),o.responseText&&(e.debugInfo=`Response text:
`+o.responseText,y.push(e.debugInfo)),e.log=p.format(y,`
`)}formatAjaxStatus(e,t){return e.status?_.join(" ",e.status+"",t):"Connection error"}formatAjaxRequest(e){return e?_.join(" ",e.method,e.url):""}_severityToLogLevel(e){switch(e){case"ok":return W.DEBUG;case"info":return W.INFO;case"warning":return W.WARN;default:return W.ERROR}}_analyzeOtherError(e){let t=e.error,i=typeof t=="string"||typeof t=="number"?String(t):null;if(e.code="P4",e.message=i||"Unexpected error",!i)try{i=JSON.stringify(t)}catch{i=String(t)}e.log="Unexpected error: "+i}_analyzeNoError(e){e.code="P3",e.message="Unknown error",e.log="Unexpected error (no reason provided)"}mapStack(e){let t=h().Deferred();try{Ha.mapStackTrace(e,i=>{t.resolve(p.format(i,`
`))})}catch(i){return h().rejectedPromise({message:"stacktrace mapping failed",error:i})}return t.promise()}handleErrorInfo(e){e.level=u.nvl(e.level,W.ERROR),this.logError&&e.log&&this._logErrorInfo(e);let t=this.session||G.get().sessions[0];if(t&&(this.sendError&&this._sendErrorMessage(t,e.log,e.level),this.displayError))if(e.showAsFatalError){if(e.level===W.ERROR)return this._showInternalUiErrorMessageBox(t,e.message,e.code,e.log).then(()=>e)}else return this._showErrorMessageBox(t,e).then(()=>e);return h().resolvedPromise(e)}_logErrorInfo(e){switch(e.level){case W.TRACE:h().log.trace(e.log);break;case W.DEBUG:h().log.debug(e.log);break;case W.INFO:h().log.info(e.log);break;case W.WARN:h().log.warn(e.log);break;default:h().log.error(e.log)}let t=ri.CONSOLE_OUTPUT;h().log instanceof He&&(t=!1),t&&window&&window.console&&(e.level===W.ERROR&&window.console.error?window.console.error(e.log):e.level===W.WARN&&window.console.warn?window.console.warn(e.log):window.console.log&&window.console.log(e.log))}getJsErrorCode(e){if(e){if(e.name==="EvalError")return"E1";if(e.name==="InternalError")return"I2";if(e.name==="RangeError")return"A3";if(e.name==="ReferenceError")return"R4";if(e.name==="SyntaxError")return"S5";if(e.name==="TypeError")return"T6";if(e.name==="URIError")return"U7"}return"J0"}_showErrorMessageBox(e,t){const s={parent:e.desktop||new Cs,session:e,...this._buildErrorMessageBoxModel(e,t)},r=u.create(jt,s);return r.on("action",o=>r.close()),r.render(e.$entryPoint),r.when("action")}_buildErrorMessageBoxModel(e,t){const i=this.errorInfoToStatus(e,t);let s=null;t.error instanceof E&&t.error.code!==0&&(s=t.error.code+""),t?.errorDo?.errorCode&&t.errorDo.errorCode!=="0"&&(s=t.errorDo.errorCode);let r=i.message||e.optText("ui.UnexpectedProblem","Unexpected problem");s&&(r+=" ("+e.optText("ui.ErrorCodeX","Code "+s,s)+").");let o=null;if(t?.errorDo?.correlationId){let l=e.desktop?.$container||e.$entryPoint,a=e.optText("CorrelationId","Correlation ID");o=l.makeDiv("error-popup-correlation-id",a+": "+t.errorDo.correlationId)[0].outerHTML}return{header:t.errorDo?.title,body:r,html:o,iconId:i.iconId,severity:i.severity,hiddenText:t.log,yesButtonText:e.optText("Ok","Ok")}}_showInternalUiErrorMessageBox(e,t,i,s){let r={header:e.optText("ui.UnexpectedProblem","Internal UI Error"),body:_.join(`
`,e.optText("ui.InternalUiErrorMsg",t," ("+e.optText("ui.ErrorCodeX","Code "+i,i)+")"),e.optText("ui.UiInconsistentMsg","")),yesButtonText:e.optText("ui.Reload","Reload"),yesButtonAction:u.reloadPage,noButtonText:void 0,hiddenText:s,iconId:q.SLIPPERY};return e.inDevelopmentMode&&(r.noButtonText=e.optText("ui.Ignore","Ignore")),e.showFatalMessage(r,i)}_sendErrorMessage(e,t,i){e.sendLogRequest(t,i)}errorInfoToStatus(e,t){return t.error instanceof E?t.error:E.ensure({message:this._errorInfoToStatusMessage(e,t),severity:this._errorInfoToStatusSeverity(t),code:this._errorInfoToStatusCode(t)})}_errorInfoToStatusCode(e){let t=e?.errorDo?.errorCode;return t&&t!=="0"&&b.isNumber(t)?Se.ensure(t):e.httpStatus}_errorInfoToStatusSeverity(e){switch(e?.errorDo?.severity){case"ok":return E.Severity.OK;case"info":return E.Severity.INFO;case"warning":return E.Severity.WARNING;default:return E.Severity.ERROR}}_errorInfoToStatusMessage(e,t){if(typeof t.error=="string")return t.error;const i=t.errorDo;if(i){let s=i.message;if(s&&s!=="undefined")return s}return t.error?.message?t.error.message:t.message?t.message:this.getMessageBodyForHttpStatus(t?.httpStatus,e)}getMessageBodyForHttpStatus(e,t){let i,s=t?t.textMap:de.get("default");switch(e){case 404:i=s.optGet("TheRequestedResourceCouldNotBeFound","The requested resource could not be found.");break;case 502:case 503:case 504:i=s.optGet("NetSystemsNotAvailable","The system is partially unavailable at the moment.")+`
`+s.optGet("PleaseTryAgainLater","Please try again later.");break;case 403:i=s.optGet("YouAreNotAuthorizedToPerformThisAction","You are not authorized to perform this action.");break;default:i=s.optGet("ui.UnexpectedProblem","Unexpected problem")}return i}}class Jo extends G{constructor(){super(),this.remote=!0}_defaultBootstrappers(e){return super._defaultBootstrappers(e).concat(this._defaultValuesBootstrapper(),this._configPropertiesBootstrapper(e))}_configPropertiesBootstrapper(e){return e.configUrl?null:Ki.bootstrapSystem.bind(Ki)}_defaultValuesBootstrapper(){return Be.bootstrap.bind(Be)}_createErrorHandler(e){return e=h().extend({sendError:!0},e),super._createErrorHandler(e)}_loadSession(e,t){let i=t||{};i.$entryPoint=e;let s=this._createSession(i);return this.sessions.push(s),s.start()}}class Qo{extended;next;extend(e,t){let i=e[t],s=this;e[t]=function(){return s.extended=this,s.next=i.bind(this),s[t](...arguments)}}static install(e){p.ensure(e).forEach(t=>{u.create(t)})}}class ni{typeDescriptor;objectType;modelVariant;className;namespaces;constructor(e,t,i){this.typeDescriptor=e,this.objectType=t,this.modelVariant=i,this.modelVariant?(this.className=this.modelVariant.name+this.objectType.name,this.namespaces=this.modelVariant.namespaces):(this.className=this.objectType.name,this.namespaces=this.objectType.namespaces)}resolve(e){let t=window.scout;if(e=e||{},this.namespaces.length){t=window;for(let i=0;i<this.namespaces.length;i++)if(t=t[this.namespaces[i]],!t)throw this.error('Could not resolve namespace "'+this.namespaces[i]+'"')}return t[this.className]?t[this.className]:e.variantLenient&&this.modelVariant?new ni(this.typeDescriptor,this.objectType,null).resolve(e):null}error(e){return new Error('Failed to create object for objectType "'+this.typeDescriptor+'": '+e)}notFoundError(){return this.error('Could not find "'+this.className+'" in namespace "'+this.namespaces.join(".")+'"')}static resolveType(e,t){return e?typeof e=="function"?e:ni.parse(e).resolve(t):null}static parse(e){let t=null,i=null;if(_.contains(e,Le.MODEL_VARIANT_SEPARATOR)){let o=e.split(Le.MODEL_VARIANT_SEPARATOR);t=r(o[0]),i=r(o[1]),p.empty(i.namespaces)&&!p.empty(t.namespaces)&&(i.namespaces=t.namespaces)}else t=r(e);return new ni(e,t,i);function s(o,l){return{name:o,namespaces:u.nvl(l,[]),toString:()=>{let a=l.slice();return a.push(o),_.join(Le.NAMESPACE_SEPARATOR,...a)}}}function r(o){let l=[];if(_.contains(o,Le.NAMESPACE_SEPARATOR)){let a=o.split(Le.NAMESPACE_SEPARATOR);l=a.slice(0,a.length-1),o=p.last(a)}return s(o,l)}}}u.addObjectFactories({KeyStroke:()=>new ce,KeyStrokeAdapter:()=>new er,ComposerField:()=>new Hc,ComposerFieldAdapter:()=>new Nc,BookmarkStore:()=>new uf,UiPreferencesStore:()=>new Nh});var Zo;function sn(n,e,t){return(e=el(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function el(n){var e=eo(n,"string");return typeof e=="symbol"?e:e+""}function eo(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Z{objectType;_uiSeqNo=0;static UI_SEQ_ID_PREFIX="_ui_";static UUID_PATH_DELIMITER="|";static DEPENDENT_UUID_DELIMITER=(Zo=()=>{sn(this,"_UI_SEQ_ID_PATTERN",new RegExp("^"+Z.UI_SEQ_ID_PREFIX+"\\d+$")),sn(this,"_INSTANCE",void 0),sn(this,"uuidPathSkipWidgets",new Set),sn(this,"uuidPathAlwaysSkipRules",[])},"@");uuidPath(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this._buildUuid(e,t.useFallback);if(!i&&u.nvl(t.abortIfNoUuidFound,!0))return null;let s=t.parent||e.uuidParent||e.parent;if(!s||!!e.classId)return i;let o=this._computeConsiderSkipWidgets(t,e);return s instanceof I&&(s=this._findUuidPathParent(s,o)),t.considerSkipWidgets=o,t.abortIfNoUuidFound=u.nvl(t.abortIfNoUuidFound,!1),t.parent=null,_.join(Z.UUID_PATH_DELIMITER,i,s?.buildUuidPath(t))}_computeConsiderSkipWidgets(e,t){return b.isNullOrUndefined(e.considerSkipWidgets)||e.considerSkipWidgets==="dynamicFalse"?t.uuid||t.classId||this._considerId(t)?"dynamicTrue":"dynamicFalse":e.considerSkipWidgets}_findUuidPathParent(e,t){return e?this._isPathRelevantParent(e,t)?e:e.findParent(i=>this._isPathRelevantParent(i,t)):null}_isPathRelevantParent(e,t){return!this._skipParent(e,u.isOneOf(t,!0,"dynamicTrue"))}_buildUuid(e,t){return e.buildUuid?e.buildUuid(t):this.uuid(e,t)}uuid(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e)return null;if(e.classId)return e.classId;if(e.uuid)return e.uuid;if(!t)return null;if(this._considerId(e))return e.id;let i;if(typeof e.objectType=="string")i=e.objectType;else{const s=Le.get();i=s.getObjectType(e.constructor)||s.getObjectType(e.objectType)}return i||null}_considerId(e){let t=e.id;return!(_.empty(t)||this.isUiSeqId(t)||Se.isNumber(parseInt(t)))}_skipParent(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return!e||t&&Z.uuidPathSkipWidgets.has(e.constructor)?!0:Z.uuidPathAlwaysSkipRules.some(s=>s(e))}createDependentUuid(e,t){const i=this._buildUuid(t);return i?_.join(Z.DEPENDENT_UUID_DELIMITER,e,i):null}setDependentUuid(e,t,i){if(i.uuid||i.classId)return;const s=this.createDependentUuid(e,t);if(s)return i.setUuid(s)}isUiSeqId(e){return Z._UI_SEQ_ID_PATTERN.test(e)}createUiSeqId(){return Z.UI_SEQ_ID_PREFIX+(++this._uiSeqNo).toString()}get uiSeqNo(){return this._uiSeqNo}static get(){return Z._INSTANCE||(Z._INSTANCE=u.create(Z)),Z._INSTANCE}}Zo();class pr{options$Container;widget;$container;constructor(e){u.assertParameter("widget",e.widget),this.widget=e.widget,this.options$Container=e.$container}_ensure$Container(){typeof this.options$Container=="function"?this.$container=this.options$Container():this.options$Container?this.$container=this.options$Container:this.$container=this.widget.$container}}class Ut extends pr{loadingIndicatorDelay;withGlassPane;_$loadingIndicator;_loadingIndicatorTimeoutId;_glassPane;_containerScrollHandler;constructor(e){super(e),this.loadingIndicatorDelay=u.nvl(e.loadingIndicatorDelay,250),this.withGlassPane=u.nvl(e.withGlassPane,!1),this._$loadingIndicator=null,this._loadingIndicatorTimeoutId=null,this._containerScrollHandler=this._onContainerScroll.bind(this)}setLoadingIndicatorDelay(e){this.loadingIndicatorDelay=e}_ensure$Container(){typeof this.options$Container=="function"?this.$container=this.options$Container():this.options$Container?this.$container=this.options$Container:this.$container=this.widget.$container}renderLoading(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;clearTimeout(this._loadingIndicatorTimeoutId),this._ensure$Container(),this.widget.isLoading()?!e&&this.loadingIndicatorDelay&&!this.widget.rendering?this._loadingIndicatorTimeoutId=setTimeout(this._renderLoadingIndicator.bind(this),this.loadingIndicatorDelay):this._renderLoadingIndicator():this._removeLoadingIndicator()}_renderLoadingIndicator(){if(this._$loadingIndicator||!this.widget.rendered&&!this.widget.rendering)return;this.$container.addClass("loading"),this.withGlassPane&&(this._glassPane=u.create(Ah,{parent:this.widget,cssClass:"loading-glasspane"}),this._glassPane.render(this.$container),this.$container.data("scrollable")&&(this._updateGlassPanePosition(),this.$container.on("scroll",this._containerScrollHandler)));let e=this._glassPane?this._glassPane.$container:this.$container;this._$loadingIndicator=e.appendDiv("loading-indicator")}_removeLoadingIndicator(){this._$loadingIndicator&&(this._glassPane?.deactivate(),this._$loadingIndicator.css("opacity",this._$loadingIndicator.css("opacity")),this._$loadingIndicator.addClass("animate-remove"),this._$loadingIndicator.oneAnimationEnd(()=>{this.remove(),this.widget.rendered&&(this.$container.removeClass("loading"),this.widget.invalidateLayoutTree())}))}remove(){this._$loadingIndicator&&(this._$loadingIndicator.remove(),this._$loadingIndicator=null),this.$container?.off("scroll",this._containerScrollHandler),this._glassPane?.destroy()}_onContainerScroll(e){this._updateGlassPanePosition()}_updateGlassPanePosition(){!this._glassPane?.rendered||!this.$container||this._glassPane.$container.cssTop(this.$container.scrollTop()).cssLeft(this.$container.scrollLeft())}}class rn extends Ut{_renderLoadingIndicator(){(this.widget.rendered||this.widget.rendering)&&this.$container.addClass("loading")}_removeLoadingIndicator(){(this.widget.rendered||this.widget.rendering)&&this.$container.removeClass("loading")}}var ye;(function(n){n.CONTINUE="continue",n.TERMINATE="terminate",n.SKIP_SUBTREE="skip_subtree"})(ye||(ye={}));class B{field;which;ctrl;inheritAccessibility;alt;shift;preventDefault;stopPropagation;stopImmediatePropagation;keyStrokeMode;repeatable;keyStrokeFirePolicy;enabledByFilter;renderingHints;invokeAcceptInputOnActiveValueField;preventInvokeAcceptInputOnActiveValueField;_handleExecuted;constructor(){this.field=null,this.which=[],this.ctrl=!1,this.inheritAccessibility=!0,this.alt=!1,this.shift=!1,this.preventDefault=!0,this.stopPropagation=!1,this.stopImmediatePropagation=!1,this.keyStrokeMode=B.Mode.DOWN,this.repeatable=!1,this._handleExecuted=!1,this.keyStrokeFirePolicy=ce.KeyStrokeFirePolicy.ACCESSIBLE_ONLY,this.enabledByFilter=!0,this.renderingHints={render:()=>this.field&&this.field.rendered!==void 0?this.field.rendered:!0,gap:4,offset:4,hAlign:ut.LEFT,text:null,$drawingArea:(e,t)=>e},this.invokeAcceptInputOnActiveValueField=!1,this.preventInvokeAcceptInputOnActiveValueField=!1}parseAndSetKeyStroke(e){this.alt=!1,this.ctrl=!1,this.shift=!1,this.which=[],e&&h().extend(this,B.parseKeyStroke(e))}accept(e){return!this._isEnabled()||!this._accept(e)?!1:(this._applyPropagationFlags(e),e.type===this.keyStrokeMode)}handle(e){throw new Error("keystroke event not handled: "+e)}invokeHandle(e){if(this.repeatable){this.handle(e);return}if(!this._handleExecuted&&(this.handle(e),e.type===B.Mode.DOWN)){this._handleExecuted=!0;let i=h()(e.target).window(),s=this,r={handleEvent:function(o){s._handleExecuted=!1,i[0].removeEventListener("keyup",this,!0)}};i[0].addEventListener("keyup",r,!0)}}_isEnabled(){return this.field?this.field.isRemovalPending()||!this.field.visible?!1:this.inheritAccessibility?this.field.enabledComputed:!0:!0}_accept(e){return B.acceptEvent(this,e)}_applyPropagationFlags(e){this.stopPropagation&&e.stopPropagation(),this.stopImmediatePropagation&&e.stopImmediatePropagation(),this.preventDefault&&e.preventDefault()}keys(){return this.which.map(e=>new ao(this,e))}renderKeyBox(e,t){if(e=this.renderingHints.$drawingArea(e,t),!e||!e.length)return null;let i=this._renderKeyBox(e,t.which);return this._postRenderKeyBox(e,i),e}_renderKeyBox(e,t){let i=h()(".key-box",e),s=this.renderingHints.text||m.codesToKeys[m.fromBrowser(t)],r=this.renderingHints.hAlign===ut.RIGHT?"right":"left",o=this.renderingHints.offset;if(i=i.filter(function(){return r==="right"?h()(this).hasClass("right"):!h()(this).hasClass("right")}),i.length>0){let c=i.first();this.renderingHints.hAlign===ut.RIGHT?o=e.outerWidth()-c.position().left+this.renderingHints.gap:o=c.position().left+this.renderingHints.gap+c.outerWidth()}this.shift&&(s="Shift "+s),this.alt&&(s="Alt "+s),this.ctrl&&(s="Ctrl "+s);let l=e.css("position");if(l==="absolute"||l==="relative"||l==="static"&&i.length>0)return d.call(this,o);let a=e.position();if(a)return d.call(this,a.left+o);h().log.warn("(keys#drawSingleKeyBoxItem) pos is undefined. $parent="+e);function d(c){return e.prependDiv("key-box",s).css(r,c+"px").toggleClass("disabled",!this.enabledByFilter).addClass(r)}}_postRenderKeyBox(e,t){}removeKeyBox(e){e&&(h()(".key-box",e).remove(),h()(".key-box-additional",e).remove())}static Mode={UP:"keyup",DOWN:"keydown"};static parseKeyStroke(e){if(!e)return null;let t={alt:!1,ctrl:!1,shift:!1,which:[]};return e.split("-").forEach(i=>{if(i==="alternate"||i==="alt")t.alt=!0;else if(i==="control"||i==="ctrl")t.ctrl=!0;else if(i==="shift")t.shift=!0;else{let s=m[i.toUpperCase()];t.which=s&&[s]}}),t}static acceptEvent(e,t){return e?B.acceptModifiers(e,t)&&u.isOneOf(t.which,e.which):!1}static acceptModifiers(e,t){return B._acceptModifier(e.ctrl,t.ctrlKey||t.metaKey)&&B._acceptModifier(e.alt,t.altKey)&&B._acceptModifier(e.shift,t.shiftKey)}static _acceptModifier(e,t){return e===void 0||t===void 0||e===t}}class re extends B{virtualKeyStrokeWhich;constructor(e){super(),this.field=e,this.renderingHints.$drawingArea=(t,i)=>i._$filterInput,this.virtualKeyStrokeWhich="a-Z;a-z;0-9",this.preventDefault=!1,this.keyStrokeMode=B.Mode.DOWN,this.stopPropagation=!0,this.inheritAccessibility=!1}_accept(e){if(!this._isKeyStrokeInRange(e))return!1;let t=this.field.$container.data("filter-field");return!t||!t.length||!t.is(":focusable")?!1:this.field.$container.activeElement()[0]!==t[0]?(e._$filterInput=t,this._isKeyStrokeInRange(e),!0):!1}handle(e){let t=e._$filterInput;if(this.field.session.focusManager.requestFocus(t)){t.focus();let i=u.nvl(t.val(),"").length;t[0].setSelectionRange(i,i)}}keys(){return[new ao(this,this.virtualKeyStrokeWhich)]}renderKeyBox(e,t){let i=t._$filterInput,r=i.position().left+i.cssMarginLeft()+4;return i.beforeDiv("key-box char","a - z").toggleClass("disabled",!this.enabledByFilter).cssLeft(r),i.parent()}_isKeyStrokeInRange(e){return e.which===this.virtualKeyStrokeWhich?!0:e.altKey||e.ctrlKey?!1:e.which>=m.A&&e.which<=m.Z||e.which>=m[0]&&e.which<=m[9]||e.which>=m.NUMPAD_0&&e.which<=m.NUMPAD_9}}class Ti extends pr{_cancelFilterFieldKeyStroke;_createTextFilter;_exitFilterFieldKeyStroke;_filterElements;_filterField;_filterFieldDisplayTextChangedHandler;_focusFilterFieldKeyStroke;_focusInHandler;_focusOutHandler;_getElementText;_getElementsForFiltering;_textFilter;_updateTextFilterText;constructor(e){super(e),e.filterElements?this._filterElements=e.filterElements:(this._filterElements=this._filter.bind(this),u.assertParameter("getElementsForFiltering",e.getElementsForFiltering),this._getElementsForFiltering=e.getElementsForFiltering),this._getElementText=e.getElementText||(t=>$(t).text()),e.createTextFilter?(u.assertParameter("updateTextFilterText",e.updateTextFilterText),this._createTextFilter=e.createTextFilter,this._updateTextFilterText=e.updateTextFilterText):(this._createTextFilter=this._createDefaultTextFilter.bind(this),this._updateTextFilterText=this._updateDefaultTextFilterText.bind(this)),this._filterField=null,this._filterFieldDisplayTextChangedHandler=this._onFilterFieldDisplayTextChanged.bind(this),this._focusInHandler=this._onFocusIn.bind(this),this._focusOutHandler=this._onFocusOut.bind(this),this._focusFilterFieldKeyStroke=null,this._cancelFilterFieldKeyStroke=null,this._exitFilterFieldKeyStroke=null,this._textFilter=null}_createDefaultTextFilter(){return{acceptedText:null,accept:e=>{if(_.empty(this._textFilter.acceptedText)||!this.widget.isTextFilterFieldVisible())return!0;let t=this._getElementText(e);return _.empty(t)?!1:_.contains(t.toLowerCase(),this._textFilter.acceptedText.toLowerCase())}}}_updateDefaultTextFilterText(e,t){return b.equals(e.acceptedText,t)?!1:(e.acceptedText=t,!0)}renderFilterField(){this.widget.isTextFilterFieldVisible()?this._renderFilterField():this._removeFilterField()}_renderFilterField(){this._ensure$Container(),this._filterField=u.create(Ni,{parent:this.widget,label:this.widget.session.text("ui.Filter"),labelVisible:!1,inheritAccessibility:!1,cssClass:"filter-field empty",fieldStyle:A.FieldStyle.CLASSIC,statusVisible:!1,clearable:ge.Clearable.ALWAYS,updateDisplayTextOnModify:!0,preventInitialFocus:!0,checkSaveNeeded:!1}),this._filterField.render(this.$container),this._filterField.$field.attr("tabindex",-1),this.widget.rendered?this._updateFilterFieldBackgroundColor():this.widget.one("render",e=>this._updateFilterFieldBackgroundColor()),this._textFilter=this._createTextFilter(),this._textFilter.synthetic=!0,this.addFilter(this._textFilter),this._filterField.on("propertyChange:displayText",this._filterFieldDisplayTextChangedHandler),this.widget.$container.on("focusin",this._focusInHandler),this.widget.$container.on("focusout",this._focusOutHandler),this.widget.$container.data("filter-field",this._filterField.$field),this._focusFilterFieldKeyStroke=new re(this.widget),this.widget.keyStrokeContext.registerKeyStroke(this._focusFilterFieldKeyStroke),this._cancelFilterFieldKeyStroke=new B,this._cancelFilterFieldKeyStroke.field=this._filterField,this._cancelFilterFieldKeyStroke.which=[m.ESC],this._cancelFilterFieldKeyStroke.stopPropagation=!0,this._cancelFilterFieldKeyStroke.renderingHints.hAlign=ut.RIGHT,this._cancelFilterFieldKeyStroke.handle=this._cancelFilterField.bind(this),this._filterField.keyStrokeContext.registerKeyStroke(this._cancelFilterFieldKeyStroke),this._exitFilterFieldKeyStroke=new B,this._exitFilterFieldKeyStroke.field=this._filterField,this._exitFilterFieldKeyStroke.which=[m.ENTER],this._exitFilterFieldKeyStroke.stopPropagation=!0,this._exitFilterFieldKeyStroke.renderingHints.hAlign=ut.RIGHT,this._exitFilterFieldKeyStroke.handle=this._exitFilterField.bind(this),this._filterField.keyStrokeContext.registerKeyStroke(this._exitFilterFieldKeyStroke)}_updateFilterFieldBackgroundColor(){if(!this._filterField||!this._filterField.rendered)return;let e=L.getFirstOpaqueBackgroundColor(this._filterField.$container),t=$.extend(!0,{red:0,green:0,blue:0,alpha:1},L.rgb(e)),i="rgba("+t.red+", "+t.green+", "+t.blue+", "+.5+")",s="rgba("+t.red+", "+t.green+", "+t.blue+", "+.8+")";this._filterField.$container.css("--filter-field-background-color",e),this._filterField.$container.css("--filter-field-transparent-50-background-color",i),this._filterField.$container.css("--filter-field-transparent-80-background-color",s)}_onFilterFieldDisplayTextChanged(e){this._filterField&&this._filterField.rendered&&this._filterField.$container.toggleClass("empty",!e.newValue),this._updateTextFilterText(this._textFilter,e.newValue)&&this.filter()}_onFocusIn(e){this._updateFocusInsideWidget(e.target)}_onFocusOut(e){this._updateFocusInsideWidget(e.relatedTarget)}_updateFocusInsideWidget(e){let t=this.widget.$container.isOrHas(e);return this._filterField&&this._filterField.rendered&&this._filterField.$container.toggleClass("focus-inside-widget",t),t}_exitFilterField(){this.widget.focus()}_cancelFilterField(){this._resetFilterField(),this._exitFilterField()}_resetFilterField(){this._filterField&&this._filterField.setValue(null)}_removeFilterField(){this._filterField&&(this.widget.$container.off("focusin",this._focusInHandler),this.widget.$container.off("focusout",this._focusOutHandler),this.widget.keyStrokeContext.unregisterKeyStroke(this._focusFilterFieldKeyStroke),this._focusFilterFieldKeyStroke=null,this._resetFilterField(),this._filterField.destroy(),this._filterField=null,this.removeFilter(this._textFilter),this._textFilter=null)}remove(){this._removeFilterField()}addFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=p.ensure(e),s=this._getFilters().slice(),r=s.slice();if(i.forEach(l=>{this._hasFilter(s,l)||s.push(l)}),s.length===this._getFilters().length)return[];this._setFilters(s,t);let o=this._getFilters().slice();return p.removeAll(o,r),o}removeFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=p.ensure(e),s=this._getFilters().slice(),r=s.slice(),o=!1;if(i.forEach(a=>{a=this._findFilter(s,a),o=p.remove(s,a)||o}),!o)return[];this._setFilters(s,t);let l=this._getFilters().slice();return p.removeAll(r,l),r}setFilters(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e=p.ensure(e),this._addSyntheticFilters(e),this._getFilters().length===e.length&&e.every(o=>this._hasFilter(this._getFilters(),o)))return{filtersAdded:[],filtersRemoved:[]};let i=this._getFilters().slice();this._setFilters(e,t);let s=this._getFilters().filter(o=>!this._findFilter(i,o)),r=i.filter(o=>!this._findFilter(this._getFilters(),o));return{filtersAdded:s,filtersRemoved:r}}_setFilters(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.widget.setProperty("filters",e.map(i=>b.isFunction(i)?this._createFilterByFunction(i):i)),t&&this.filter()}_addSyntheticFilters(e){this._getFilters().filter(t=>t.synthetic).forEach(t=>this._addSyntheticFilter(e,t)),this._addSyntheticFilter(e,this._textFilter)}_addSyntheticFilter(e,t){!t||this._hasFilter(e,t)||e.push(t)}_getFilters(){return this.widget.filters}_findFilter(e,t){return b.isFunction(t)?this._getFilterCreatedByFunction(e,t):p.find(e,i=>b.equals(i,t))}_getFilterCreatedByFunction(e,t){return p.find(e,i=>typeof i!="function"&&i.createdByFunction&&i.accept===t)}_hasFilter(e,t){return!!this._findFilter(e,t)}_createFilterByFunction(e){return{createdByFunction:!0,accept:e}}filter(){let e=this._filterElements();if(e&&(p.ensure(e.newlyHidden).length||p.ensure(e.newlyShown).length)){this.widget.filteredElementsDirty=!0;let i={};this._filterField&&(i.textFilterText=this._filterField.displayText),this.widget.updateFilteredElements(e,i)}return e}_filter(){return this.applyFilters(this._getElementsForFiltering(),!0)}applyFilters(e,t){if(this._getFilters().length===0&&!u.nvl(t,!1))return;let i=[],s=[];return e.forEach(r=>{this.applyFiltersForElement(r)&&(r.filterAccepted?i.push(r):s.push(r))}),{newlyHidden:s,newlyShown:i}}applyFiltersForElement(e){if(this.elementAcceptedByFilters(e)){if(!e.filterAccepted)return e.setFilterAccepted(!0),!0}else if(e.filterAccepted)return e.setFilterAccepted(!1),!0;return!1}elementAcceptedByFilters(e){return this._getFilters().every(t=>t.accept(e))}}var Na=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let K=class extends ot{id;objectType;initialized;attached;destroyed;widget;session;_enabledBeforeOffline;_remoteProperties;_orderedProperties;_widgetListener;_propertyChangeEventFilter;_widgetEventTypeFilter;constructor(){super(),this.id=null,this.objectType=null,this.initialized=!1,this.attached=!1,this.destroyed=!1,this.widget=null,this._enabledBeforeOffline=!0,this._remoteProperties=[],this._orderedProperties=[],this._widgetListener=null,this._propertyChangeEventFilter=new gh,this._widgetEventTypeFilter=new bh,this.session=null}init(e){this._init(e),this.initialized=!0}_init(e){u.assertParameter("id",e.id),u.assertParameter("session",e.session),h().extend(this,e),this.session.registerModelAdapter(this)}destroy(){this._detachWidget(),this.widget.destroy(),this.widget=null,this.session.unregisterModelAdapter(this),this.destroyed=!0}createWidget(e,t){let i=this._initModel(e,t);return this.widget=this._createWidget(i),this._attachWidget(),this._postCreateWidget(),this.widget}_postCreateWidget(){}_initModel(e,t){let i=this.session.adapterExportEnabled,s=h().extend(i,{},e);return Be.applyTo(s),s.parent=t,s.owner=t,s.modelAdapter=this,s.global&&(s.owner=this.session.getModelAdapter("1").widget),this._initProperties(s),s}_initProperties(e){}_createWidget(e){let t=u.create(e);return t._addCloneProperties(["modelClass","classId"]),t}_attachWidget(){this._widgetListener||(this._widgetListener={func:this._onWidgetEventInternal.bind(this)},this.widget.addListener(this._widgetListener),this.attached=!0,this.trigger("attach"))}_detachWidget(){this._widgetListener&&(this.widget.removeListener(this._widgetListener),this._widgetListener=null,this.attached=!1,this.trigger("detach"))}goOffline(){this.widget.visitChildren(e=>{e.modelAdapter&&e.modelAdapter._goOffline()})}_goOffline(){}goOnline(){this.widget.visitChildren(e=>{e.modelAdapter&&e.modelAdapter._goOnline()})}_goOnline(){}isRemoteProperty(e){return this._remoteProperties.indexOf(e)>-1}_addRemoteProperties(e){this._addProperties("_remoteProperties",e)}_removeRemoteProperties(e){this._removeProperties("_remoteProperties",e)}_addOrderedProperties(e){this._addProperties("_orderedProperties",e)}_addProperties(e,t){Array.isArray(t)?this[e]=this[e].concat(t):this[e].push(t)}_removeProperties(e,t){t=p.ensure(t),p.removeAll(this[e],t)}_send(e,t,i){let s={};arguments.length>2&&(i!==null&&typeof i=="object"?s=i:(s.delay=arguments[2],s.coalesce=arguments[3],s.showBusyIndicator=arguments[4])),i=s;let r=new al(this.id,e,t);i.coalesce!==void 0&&(r.coalesce=i.coalesce),i.showBusyIndicator!==void 0&&(r.showBusyIndicator=i.showBusyIndicator),i.newRequest!==void 0&&(r.newRequest=i.newRequest),this.session.sendEvent(r,i.delay)}_sendProperty(e,t){let i={};i[e]=t,this._send("property",i)}addFilterForWidgetEvent(e){this._widgetEventTypeFilter.addFilter(e)}addFilterForWidgetEventType(e){this._widgetEventTypeFilter.addFilterForEventType(e)}addFilterForProperties(e){this._propertyChangeEventFilter.addFilterForProperties(e)}addFilterForPropertyName(e){this._propertyChangeEventFilter.addFilterForPropertyName(e)}_isPropertyChangeEventFiltered(e,t){return t instanceof I&&(t=t.id),this._propertyChangeEventFilter.filter(e,t)}_isWidgetEventFiltered(e){return this._widgetEventTypeFilter.filter(e)}resetEventFilters(){this._propertyChangeEventFilter.reset(),this._widgetEventTypeFilter.reset()}_onWidgetPropertyChange(e){let t=e.propertyName,i=e.newValue;this._isPropertyChangeEventFiltered(t,i)||this.isRemoteProperty(t)&&(i=this._prepareRemoteProperty(t,i),this._callSendProperty(t,i))}_prepareRemoteProperty(e,t){return!t||!this.widget.isWidgetProperty(e)?t:Array.isArray(t)?t.map(i=>i.modelAdapter.id):t.modelAdapter.id}_callSendProperty(e,t){let i="_send"+_.toUpperCaseFirstLetter(e);this[i]?this[i](t):this._sendProperty(e,t)}_onWidgetDestroy(e){this.destroy()}_onWidgetEventInternal(e){this._isWidgetEventFiltered(e)||this._onWidgetEvent(e)}_onWidgetEvent(e){e.type==="destroy"?this._onWidgetDestroy(e):e.type==="propertyChange"&&this._onWidgetPropertyChange(e)}_syncPropertiesOnPropertyChange(e){this._orderPropertyNamesOnSync(e).forEach(i=>{let s=e[i],r="_sync"+_.toUpperCaseFirstLetter(i);this[r]?this[r](s):this._writeProperty(i,s)})}_writeProperty(e,t){this.widget.callSetter(e,t)}_orderPropertyNamesOnSync(e){let t=Object.keys(e);return this._orderedProperties.length>0&&(t=t.sort(this._createPropertySortFunc(this._orderedProperties))),t}_createPropertySortFunc(e){return(t,i)=>{let s=e.indexOf(t),r=e.indexOf(i);return s>-1&&r>-1?s-r:s>-1?-1:r>-1?1:rt.TEXT.compare(t,i)}}onModelEvent(e){e&&(e.type==="property"?this.onModelPropertyChange(e):this.onModelAction(e))}onModelPropertyChange(e){this.addFilterForProperties(e.properties),this._syncPropertiesOnPropertyChange(e.properties)}onModelAction(e){e.type==="scrollToTop"?this.widget.scrollToTop({animate:e.animate}):e.type==="reveal"?this.widget.reveal({animate:e.animate}):h().log.warn('Model action "'+e.type+'" is not supported by model-adapter '+this.objectType)}toString(){return"ModelAdapter[objectType="+this.objectType+" id="+this.id+"]"}exportAdapterData(e){let t=e.modelClass;if(t){let i=Math.max(0,t.lastIndexOf("$")+1,t.lastIndexOf(".")+1);e.id=t.substring(i)}return delete e.owner,delete e.classId,delete e.modelClass,e}static getModelAdapterForWidget(e,t){if(e?.modelAdapter)return e.modelAdapter;if(t)return e?.__hybridModelAdapter}static modifyWidgetPrototype(e){G.get().remote&&b.replacePrototypeFunction(I,"_createChild",function(t){return t instanceof I?t:this.modelAdapter&&typeof t=="string"?this.session.getOrCreateWidget(t,this):this._createChildOrig(t)},!0)}};K=Na([Ke({ensureId:!0})],K),G.addListener("bootstrap",K.modifyWidgetPrototype);var tl;function Va(n,e,t){return(e=il(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function il(n){var e=Wa(n,"string");return typeof e=="symbol"?e:e+""}function Wa(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Gi=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},oi;let I=(class extends zt{animateRemoval;animateRemovalClass;attached;children;cloneOf;cssClass;destroyed;destroying;disabledStyle;enabled;enabledComputed;eventDelegators;focused;htmlComp;id;inheritAccessibility;keyStrokeContext;loading;loadingSupport;logicalGrid;objectType;owner;parent;removalPending;removing;rendering;scrollLeft;scrollTop;session;trackFocus;uuid;uuidParent;visible;modelAdapter;$container;$parent;modelClass;classId;_rendered;_$lastFocusedElement;_focusInListener;_glassPaneContributions;_parentDestroyHandler;_parentRemovingWhileAnimatingHandler;_postRenderActions;_scrollHandler;_storedFocusedWidget;constructor(){super(),this.id=null,this.uuid=null,this.objectType=null,this.session=null,this.modelClass=null,this.classId=null,this.owner=null,this.parent=null,this.children=[],this.cloneOf=null,this.rendering=!1,this.removing=!1,this.removalPending=!1,this._rendered=!1,this.attached=!1,this.destroyed=!1,this.destroying=!1,this.enabled=!0,this.enabledComputed=!0,this.inheritAccessibility=!0,this.disabledStyle=oi.DisabledStyle.DEFAULT,this.visible=!0,this.focused=!1,this.loading=!1,this.cssClass=null,this.scrollTop=null,this.scrollLeft=null,this.$parent=null,this.$container=null,this.htmlComp=null,this.animateRemoval=!1,this.animateRemovalClass="animate-remove",this.propertyDecorations=h().extend(this.propertyDecorations,{clone:new Set,widget:new Set,preserveOnPropertyChange:new Set}),this.eventDelegators=[],this._postRenderActions=[],this._focusInListener=this._onFocusIn.bind(this),this._parentDestroyHandler=this._onParentDestroy.bind(this),this._parentRemovingWhileAnimatingHandler=this._onParentRemovingWhileAnimating.bind(this),this._scrollHandler=this._onScroll.bind(this),this.loadingSupport=this._createLoadingSupport(),this.keyStrokeContext=this._createKeyStrokeContext(),this.logicalGrid=null,this.trackFocus=!1,this._$lastFocusedElement=null,this._storedFocusedWidget=null,this._glassPaneContributions=[],this._addCloneProperties(["visible","enabled","inheritAccessibility","cssClass"]),this._addMultiDimensionalProperty("enabled",!0),this._addMultiDimensionalProperty("visible",!0),this._addPropertyDimensionAlias("enabled","enabledGranted",{dimension:"granted"}),this._addPropertyDimensionAlias("visible","visibleGranted",{dimension:"granted"})}init(e){let t=this._jsonModel();t&&(e=h().extend({},t,e)),e=e||{},e=this._prepareModel(e),this._init(e),this._initKeyStrokeContext(),this.recomputeEnabled(),this.initialized=!0,this.trigger("init")}_prepareModel(e){return e}buildUuid(e){return Z.get().uuid(this,e)}buildUuidPath(e){return Z.get().uuidPath(this,e)}setUuid(e){this.setProperty("uuid",e)}_init(e){if(!e.parent)throw new Error("Parent expected: "+this);if(this.setOwner(e.owner||e.parent),this.setParent(e.parent),this.session=e.session||this.parent.session,!this.session)throw new Error("Session expected: "+this);this._eachProperty(e,(t,i,s)=>{i!==void 0&&(s&&(i=this._prepareWidgetProperty(t,i)),this._initProperty(t,i))}),this._initMultiDimensionalProperties(e),this._setCssClass(this.cssClass),this._setLogicalGrid(this.logicalGrid),this._setEnabled(this.enabled)}_jsonModel(){return null}_createChildren(e){if(!e)return null;if(!Array.isArray(e))return this._createChild(e);let t=[];return e.forEach((i,s)=>{t[s]=this._createChild(i)}),t}_createChild(e){if(e instanceof oi)return e;if(typeof e=="string"){let i=this.widget(e);if(!i)throw new Error("Referenced widget not found: "+e);return i}let t=e;return t.parent=this,u.create(t)}_initKeyStrokeContext(){this.keyStrokeContext&&(this.keyStrokeContext.$scopeTarget=()=>this.$container,this.keyStrokeContext.$bindTarget=()=>this.$container)}destroy(){if(!this.destroyed){if(this.destroying=!0,this._rendered&&(this.animateRemoval||this._isRemovalPrevented())){this.one("remove",()=>{this.destroy()}),this.remove();return}this._destroyChildren(this.children.slice().reverse()),this.remove(),this._destroy(),this.owner._removeChild(this),this.owner=null,this.parent._removeChild(this),this.parent.off("destroy",this._parentDestroyHandler),this.parent=null,this.destroying=!1,this.destroyed=!0,this.trigger("destroy")}}_destroy(){}_destroyChildren(e){e&&(e=p.ensure(e),e.forEach(t=>this._destroyChild(t)))}_destroyChild(e){e.owner===this&&e.destroy()}_destroyOrUnlinkChildren(e){e&&(e=p.ensure(e),e.forEach(t=>{!(t instanceof oi)||t.destroyed||(t.owner===this?this._destroyChild(t):t.setParent(t.owner))}))}render(e){if(h().log.isTraceEnabled()&&h().log.trace("Rendering widget: "+this),!this.initialized)throw new Error("Not initialized: "+this);if(this._rendered)throw new Error("Already rendered: "+this);if(this.destroyed)throw new Error("Widget is destroyed: "+this);this.rendering=!0,this.$parent=e||this.parent.$container,this._render(),this._renderProperties(),this._renderInspectorInfo(),this._linkWithDOM(),this.session.keyStrokeManager.installKeyStrokeContext(this.keyStrokeContext),this.rendering=!1,this.rendered=!0,this.attached=!0,this.trigger("render"),this.restoreFocus(),this._postRender()}_render(){}get rendered(){return this._rendered&&!this.isRemovalPending()}set rendered(e){this._rendered=e}_renderProperties(){this._renderCssClass(),this._renderEnabled(),this._renderVisible(),this._renderTrackFocus(),this._renderFocused(),this._renderLoading(),this._renderScrollTop(),this._renderScrollLeft()}_postRender(){let e=this._postRenderActions;this._postRenderActions=[],e.forEach(t=>{t()})}remove(){!this._rendered||this._isRemovalPrevented()||(this.animateRemoval?this._removeAnimated():this._removeInternal())}removeImmediately(){this._removeInternal()}_isRemovalPrevented(){return this.isRemovalPending()}isRemovalPending(){if(this.removalPending)return!0;let e=this.parent;if(!e||e.removing||e.rendering)return!1;for(;e;){if(e.removalPending)return!0;e=e.parent}return!1}_removeInternal(){this._rendered&&(h().log.isTraceEnabled()&&h().log.trace("Removing widget: "+this),this.removing=!0,this.removalPending=!1,this.trigger("removing"),this.$container&&this.$container.off("focusin",this._focusInListener),this._$lastFocusedElement&&(this._storedFocusedWidget=u.widget(this._$lastFocusedElement),this._$lastFocusedElement=null),this.children.slice().reverse().forEach(e=>{e.parent===this&&e.remove()}),this._rendered&&(this._cleanup(),this._remove(),this.$parent=null,this.rendered=!1,this.attached=!1,this.removing=!1,this.trigger("remove")))}_removeAnimated(){let e=this._animateRemovalWhileRemovingParent();if(this.parent.removing&&!e||!w.get().supportsCssAnimation()||!this.$container||this.$container.isDisplayNone()){this._removeInternal();return}this.session.desktop.removePopupsFor(this),this.removalPending=!0,setTimeout(()=>{if(this._rendered){if(!this.$container.isVisible()||!this.$container.isEveryParentVisible()||!this.$container.isAttached()){this._removeInternal();return}this._removeAnimatedImpl()}}),e||this.parent.one("removing",this._parentRemovingWhileAnimatingHandler)}_removeAnimatedImpl(){if(!this.animateRemovalClass)throw new Error("Missing animate removal class. Cannot remove animated.");this.$container.addClass(this.animateRemovalClass),this.$container.oneAnimationEnd(()=>{this._removeInternal()})}_animateRemovalWhileRemovingParent(){return!1}_onParentRemovingWhileAnimating(){this._removeInternal()}_renderInspectorInfo(){yt.applyInfo(this)}_linkWithDOM(){this.$container&&this.$container.data("widget",this)}_cleanup(){this.parent.off("removing",this._parentRemovingWhileAnimatingHandler),this.session.keyStrokeManager.uninstallKeyStrokeContext(this.keyStrokeContext),this.loadingSupport&&this.loadingSupport.remove(),this._uninstallScrollbars(),this.$container&&this.session.layoutValidator.cleanupInvalidComponents(this.$container)}_remove(){this.$container&&(this.$container.remove(),this.$container=null)}setOwner(e){u.assertParameter("owner",e),e!==this.owner&&(this.owner&&this.owner!==this.parent&&this.owner._removeChild(this),this.owner=e,this.owner._addChild(this))}setParent(e){if(u.assertParameter("parent",e),e===this.parent)return;if(this.rendered&&!e.rendered&&(h().log.isInfoEnabled()&&h().log.info("rendered child "+this+" is added to not rendered parent "+e+". Removing child.",new Error("origin")),this.remove()),this.parent){if(this.parent.isRemovalPending()){this.parent.one("remove",()=>{this.setParent(e)});return}this.parent.off("destroy",this._parentDestroyHandler),this.parent.off("removing",this._parentRemovingWhileAnimatingHandler),this.parent!==this.owner&&this.parent._removeChild(this)}let t=this.parent;this.parent=e,this.parent._addChild(this),this.trigger("hierarchyChange",{oldParent:t,parent:e}),this.initialized&&this.recomputeEnabled(this.parent.enabledComputed),this.parent.one("destroy",this._parentDestroyHandler)}_addChild(e){h().log.isTraceEnabled()&&h().log.trace("addChild("+e+") to "+this),p.pushSet(this.children,e)}_removeChild(e){h().log.isTraceEnabled()&&h().log.trace("removeChild("+e+") from "+this),p.remove(this.children,e)}ancestors(){let e=[],t=this.parent;for(;t;)e.push(t),t=t.parent;return e}isOrHas(e){return e===this?!0:this.has(e)}has(e){for(;e;){if(e.parent===this)return!0;e=e.parent}return!1}getForm(){return j.findForm(this)}findNonWrappedForm(){return j.findNonWrappedForm(this)}findDesktop(){return this.session.desktop?this.session.desktop:this.findParent(Ie)}setEnabled(e,t,i){this.setProperty("enabled",e),e&&t&&this.parent&&this.parent.setEnabled(!0,!0),i&&this.visitChildren(s=>{s.setEnabled(e)})}_setEnabled(e){this._setProperty("enabled",e),this.initialized&&this.recomputeEnabled()}setEnabledGranted(e){this.setProperty("enabledGranted",e)}get enabledGranted(){return this.getProperty("enabledGranted")}recomputeEnabled(e){e===void 0&&(e=!0,this.parent&&this.parent.initialized&&this.parent.enabledComputed!==void 0&&(e=this.parent.enabledComputed));let t=this._computeEnabled(this.inheritAccessibility,e);this._updateEnabledComputed(t)}_updateEnabledComputed(e,t){if(this.enabledComputed===e&&t===void 0)return;this.setProperty("enabledComputed",e),this.rendered&&this._renderEnabled();let i=u.nvl(t,e);this._childrenForEnabledComputed().forEach(s=>{s.inheritAccessibility&&s.recomputeEnabled(i)})}_childrenForEnabledComputed(){return this.children}_computeEnabled(e,t){return this.enabled&&(e?t:!0)}_renderEnabled(){this.$container&&(this.$container.setEnabled(this.enabledComputed),this._renderDisabledStyle())}setInheritAccessibility(e){this.setProperty("inheritAccessibility",e)}_setInheritAccessibility(e){this._setProperty("inheritAccessibility",e),this.initialized&&this.recomputeEnabled()}setDisabledStyle(e){this.setProperty("disabledStyle",e),this.children.forEach(t=>{t.setDisabledStyle(e)})}_renderDisabledStyle(){this._renderDisabledStyleInternal(this.$container)}_renderDisabledStyleInternal(e){e&&(this.enabledComputed?e.removeClass("read-only"):e.toggleClass("read-only",this.disabledStyle===oi.DisabledStyle.READ_ONLY))}setVisible(e){this.setProperty("visible",e)}setVisibleGranted(e){this.setProperty("visibleGranted",e)}get visibleGranted(){return this.getProperty("visibleGranted")}isVisible(){return this.visible}_renderVisible(){this.$container&&(this.$container.setVisible(this.visible),this.invalidateParentLogicalGrid())}isEveryParentVisible(){let e=this.parent;for(;e;){if(!e.visible)return!1;e=e.parent}return!0}setFocused(e){this.setProperty("focused",e)}_renderFocused(){this.$container&&this.$container.toggleClass("focused",this.focused)}_setCssClass(e){this.rendered&&this._removeCssClass(),this._setProperty("cssClass",e)}_removeCssClass(){this.$container&&this.$container.removeClass(this.cssClass)}_renderCssClass(){this.$container&&(this.$container.addClass(this.cssClass),this.htmlComp&&this.invalidateLayoutTree())}setCssClass(e){this.setProperty("cssClass",e)}addCssClass(e){let t=this.cssClassAsArray();oi.cssClassAsArray(e).forEach(s=>{t.indexOf(s)>=0||t.push(s)}),this.setProperty("cssClass",p.format(t," "))}removeCssClass(e){let t=this.cssClassAsArray(),i=oi.cssClassAsArray(e);p.removeAll(t,i)&&this.setProperty("cssClass",p.format(t," "))}toggleCssClass(e,t){t?this.addCssClass(e):this.removeCssClass(e)}hasCssClass(e){return this.cssClassAsArray().includes(e)}cssClassAsArray(){return oi.cssClassAsArray(this.cssClass)}_createLoadingSupport(){return null}setLoading(e){this.setProperty("loading",e)}isLoading(){return this.loading}_renderLoading(){this.loadingSupport&&this.loadingSupport.renderLoading()}pack(){if(!(!this.rendered||this.removing)){if(!this.htmlComp)throw new Error("Function expects a htmlComp property");this.htmlComp.pack()}}invalidateLayout(){if(!(!this.rendered||this.removing)){if(!this.htmlComp)throw new Error("Function expects a htmlComp property");this.htmlComp.invalidateLayout()}}validateLayout(){if(!(!this.rendered||this.removing)){if(!this.htmlComp)throw new Error("Function expects a htmlComp property");this.htmlComp.validateLayout()}}revalidateLayout(){if(!(!this.rendered||this.removing)){if(!this.htmlComp)throw new Error("Function expects a htmlComp property");this.htmlComp.revalidateLayout()}}invalidateLayoutTree(e){if(!(!this.rendered||this.removing)){if(!this.htmlComp)throw new Error("Function expects a htmlComp property");this.htmlComp.invalidateLayoutTree(e)}}validateLayoutTree(){if(!(!this.rendered||this.removing)){if(!this.htmlComp)throw new Error("Function expects a htmlComp property");this.htmlComp.validateLayoutTree()}}revalidateLayoutTree(e){if(!(!this.rendered||this.removing)){if(!this.htmlComp)throw new Error("Function expects a htmlComp property");this.htmlComp.revalidateLayoutTree(e)}}setLayoutData(e){if(this.rendered){if(!this.htmlComp)throw new Error("Function expects a htmlComp property");this.htmlComp.layoutData=e}}validateLogicalGrid(){this.logicalGrid&&this.logicalGrid.validate(this)}invalidateLogicalGrid(e){this.initialized&&this.logicalGrid&&(this.logicalGrid.setDirty(!0),u.nvl(e,!0)&&this.invalidateLayoutTree())}invalidateParentLogicalGrid(e){if(this.parent.invalidateLogicalGrid(!1),!(!this.rendered||!this.htmlComp)&&u.nvl(e,!0)){let t=this.htmlComp.getParent();t&&t.invalidateLayoutTree()}}revalidateLogicalGrid(e){this.invalidateLogicalGrid(e),this.validateLogicalGrid()}setLogicalGrid(e){this.setProperty("logicalGrid",e)}_setLogicalGrid(e){e=u.ensure(e),this._setProperty("logicalGrid",e),this.invalidateLogicalGrid()}entryPoint(){let e=u.nvl(this.$container,this.parent.$container);if(!e||!e.length)throw new Error("Cannot resolve entryPoint, $element.length is 0 or undefined");return e.entryPoint()}window(e){let t=this.$container||this.$parent;return t?t.window(e):e?null:h()()}document(e){let t=this.$container||this.$parent;return t?t.document(e):e?null:h()()}attach(){this.attached||!this.rendered||(this._attach(),this._installFocusContext(),this.restoreFocus(),this.attached=!0,this._postAttach(),this._onAttach(),this._triggerChildrenOnAttach(this))}_attach(){}_postAttach(){}_triggerChildrenOnAttach(e){this.children.forEach(t=>{t._onAttach(),t._triggerChildrenOnAttach(e)})}_onAttach(){this.rendered&&this._renderOnAttach()}_renderOnAttach(){this._renderScrollTop(),this._renderScrollLeft()}detach(){this.rendering&&this._postRenderActions.push(this.detach.bind(this)),!(!this.attached||!this.rendered)&&(this._beforeDetach(),this._onDetach(),this._triggerChildrenOnDetach(),this._detach(),this.attached=!1)}_beforeDetach(){if(!this.$container)return;let e=this.$container.document(!0).activeElement,t=this.$container.isOrHas(e),i=this.session.focusManager;i.isFocusContextInstalled(this.$container)?this._uninstallFocusContext():t&&i.validateFocus(Us.outsideFilter(this.$container))}_triggerChildrenOnDetach(){this.children.forEach(e=>{e._onDetach(),e._triggerChildrenOnDetach()})}_onDetach(){this.rendered&&this._renderOnDetach()}_renderOnDetach(){}_detach(){}_uninstallFocusContext(){}_installFocusContext(){}_createKeyStrokeContext(){return null}updateKeyStrokes(e,t){this.unregisterKeyStrokes(t),this.registerKeyStrokes(e)}registerKeyStrokes(e){this.keyStrokeContext.registerKeyStrokes(e)}unregisterKeyStrokes(e){this.keyStrokeContext.unregisterKeyStrokes(e)}setPropertyInternal(e,t){return b.equals(this.getProperty(e),t)?!1:(t=this._prepareProperty(e,t),this.rendered&&this._callRemoveProperty(e),this._callSetProperty(e,t),this.rendered&&this._callRenderProperty(e),!0)}_prepareProperty(e,t){return this.isWidgetProperty(e)?this._prepareWidgetProperty(e,t):t}_prepareWidgetProperty(e,t){let i=this._createChildren(t);if(!this.isPreserveOnPropertyChangeProperty(e)){let s=this.getProperty(e);s&&Array.isArray(i)&&(s=p.diff(s,i)),this._destroyOrUnlinkChildren(s),this.link(i)}return i}_callRemoveProperty(e){if(!this.isWidgetProperty(e)||this.isPreserveOnPropertyChangeProperty(e))return;let t=this.getProperty(e);if(!t)return;let i="_remove"+_.toUpperCaseFirstLetter(e);this[i]?this[i]():this._internalRemoveWidgets(t)}_internalRemoveWidgets(e){e=p.ensure(e),e.forEach(t=>{t.remove()})}_callRenderProperty(e){let t="_render"+_.toUpperCaseFirstLetter(e);this[t]&&this[t]()}link(e){e&&(e=p.ensure(e),e.forEach(t=>t.setParent(this)))}glassPaneTargets(e){let t=i=>p.flatMap(this._glassPaneContributions,r=>{let o=r(i);return o?p.ensure(o):[]}).concat(this._glassPaneTargets(i));return this.rendered?t(e):Er.createFor(this,t.bind(this,e))}_glassPaneTargets(e){return[this.$container].concat(this.session.desktop.getPopupsFor(this).filter(t=>!e.has(t)).reduce((t,i)=>t.concat(i.glassPaneTargets()),[]))}addGlassPaneContribution(e){this._glassPaneContributions.push(e),this.trigger("glassPaneContributionAdded",{contribution:e})}removeGlassPaneContribution(e){p.remove(this._glassPaneContributions,e),this.trigger("glassPaneContributionRemoved",{contribution:e})}toString(){let e="";return e+="id="+this.id,e+=" objectType="+this.objectType,e+=" rendered="+this.rendered,this.$container&&(e+=" $container="+C.debugOutput(this.$container)),"Widget["+e.trim()+"]"}ancestorsToString(e){let t="",i=this.ancestors();return e=u.nvl(e,-1),i.some((s,r)=>e>-1&&r>=e?!0:(r>0&&r<i.length-1&&(t+=`
`),t+=s.toString(),!1)),t}resolveTextKeys(e){de.resolveTextProperties(this,e)}resolveIconIds(e){q.resolveIconProperties(this,e)}resolveConsts(e){b.resolveConstProperties(this,e)}_addWidgetProperties(e){this._decorateProperties("widget",e)}_removeWidgetProperties(e){this._undecorateProperties("widget",e)}isWidgetProperty(e){return this.isPropertyDecorated("widget",e)}get widgetProperties(){return this.propertyDecorations.widget}_addCloneProperties(e){this._decorateProperties("clone",e)}isCloneProperty(e){return this.isPropertyDecorated("clone",e)}get cloneProperties(){return this.propertyDecorations.clone}_addPreserveOnPropertyChangeProperties(e){this._decorateProperties("preserveOnPropertyChange",e)}isPreserveOnPropertyChangeProperty(e){return this.isPropertyDecorated("preserveOnPropertyChange",e)}get preserveOnPropertyChangeProperties(){return this.propertyDecorations.preserveOnPropertyChange}_eachProperty(e,t){for(const i in e){if(this.isWidgetProperty(i))continue;const s=e[i];t(i,s)}for(const i of this.widgetProperties){const s=e[i];s!==void 0&&t(i,s,!0)}}cloneAndMirror(e){return this.clone(e,{delegateAllPropertiesToClone:!0})}original(){let e=this;for(;e.cloneOf;)e=e.cloneOf;return e}clone(e,t){e=e||{},t=t||{};let i={};for(let r of this.cloneProperties){let o;this.isMultiDimensionalProperty(r)?o=this.getPropertyDimensions(r):o=this.getProperty(r),i[r]=o}let s=u.create(this.objectType,h().extend(i,e));return s.cloneOf=this,this._mirror(s,t),this.logicalGrid?s.setLogicalGrid(this.logicalGrid.objectType):s.setLogicalGrid(null),s}_deepCloneProperties(e,t,i){if(!t)return e;t=p.ensure(t),t.forEach(s=>{s=this.adaptPropertyName(s);let r=this[s],o=null;if(r===void 0)throw new Error("Property '"+s+"' is undefined. Deep copy not possible.");this.isWidgetProperty(s)?Array.isArray(r)?o=r.map(l=>l.clone({parent:e},i)):o=r.clone({parent:e},i):Array.isArray(r)?o=r.map(l=>l):o=r,e[s]=o})}mirror(e,t){if(t=t||this.cloneOf,!t)throw new Error("No target for mirroring.");this._mirror(t,e)}_mirror(e,t){let i=p.find(this.eventDelegators,s=>s.clone===e);if(i)throw new Error("_mirror can only be called on not mirrored widgets. call unmirror first.");t=t||{},i={clone:e,originalToClone:si.create(this,e,{delegateProperties:t.delegatePropertiesToClone,delegateAllProperties:t.delegateAllPropertiesToClone,excludeProperties:t.excludePropertiesToClone}),cloneToOriginal:si.create(e,this,{delegateProperties:t.delegatePropertiesToOriginal,delegateAllProperties:t.delegateAllPropertiesToOriginal,excludeProperties:t.excludePropertiesToOriginal,delegateEvents:t.delegateEventsToOriginal})},this.eventDelegators.push(i),e.one("destroy",()=>{this._unmirror(e)})}unmirror(e){if(e=e||this.cloneOf,!e)throw new Error("No target for unmirroring.");this._unmirror(e)}_unmirror(e){let t=p.findIndex(this.eventDelegators,s=>s.clone===e),i=t>-1?this.eventDelegators.splice(t,1)[0]:null;i&&(i.originalToClone&&i.originalToClone.destroy(),i.cloneToOriginal&&i.cloneToOriginal.destroy())}_onParentDestroy(){this.destroyed||this.setParent(this.owner)}widget(e,t){if(i(this))return this;return this.findChild(i);function i(s){return s.id===e}}nearestWidget(e,t){if(this.id===e)return this;let i=this.children.slice();for(;i.length;){let s=i.shift();if(s.id===e)return s;if(t)for(let r=0;r<s.children.length;r++){let o=s.children[r];o.parent===s&&i.push(o)}}return null}findParent(e){let t;b.isSameOrExtendsClass(e,oi)?t=s=>s instanceof e:t=e;let i=this.parent;for(;i;){if(t(i))return i;i=i.parent}return i}findChild(e){let t;b.isSameOrExtendsClass(e,oi)?t=s=>s instanceof e:t=e;let i=null;return this.visitChildren(s=>{if(t(s))return i=s,!0}),i}setTrackFocus(e){this.setProperty("trackFocus",e)}_renderTrackFocus(){this.$container&&(this.trackFocus?this.$container.on("focusin",this._focusInListener):this.$container.off("focusin",this._focusInListener))}restoreFocus(){this._$lastFocusedElement?this.session.focusManager.requestFocus(this._$lastFocusedElement):this._storedFocusedWidget&&(this._storedFocusedWidget.focus(),this._storedFocusedWidget=null)}_onFocusIn(e){this.rendering||this.$container.has(e.target)&&(this._$lastFocusedElement=h()(e.target))}focus(e){return this.rendered?this.session.focusManager.requestFocus(this.getFocusableElement(),null,e):(this.session.layoutValidator.schedulePostValidateFunction(this.focus.bind(this,e)),!1)}focusAndPreventDefault(e){return this.focus()?(e.preventDefault(),!0):!1}isFocused(){return this.rendered&&Qe.isActiveElement(this.getFocusableElement())}isFocusable(e){if(!this.rendered||!this.visible)return!1;let t=this.getFocusableElement();if(!t)return!1;let i=h().ensure(t);return!i.is(":focusable")||this.session.focusManager.isElementCovertByGlassPane(i)?!1:u.nvl(e,!0)?i.is(":tabbable"):!0}getFocusableElement(){return this.rendered&&this.$container?this.$container[0]:null}_installScrollbars(e){let t=this.get$Scrollable();if(!t)throw new Error("Scrollable is not defined, cannot install scrollbars");if(t.data("scrollable"))return;e=e||{parent:this};let i={parent:this},s=h().extend({},i,e);P.install(t,s),t.on("scroll",this._scrollHandler)}_uninstallScrollbars(){let e=this.get$Scrollable();!e||!e.data("scrollable")||(P.uninstall(e,this.session),e.off("scroll",this._scrollHandler),this.removing||(e[0].scrollTop===0&&(this.scrollTop=null),e[0].scrollLeft===0&&(this.scrollLeft=null)))}_onScroll(e){let t=this.get$Scrollable();this._setScrollTop(t[0].scrollTop),this._setScrollLeft(t[0].scrollLeft)}setScrollTop(e){if(this.getDelegateScrollable()){this.getDelegateScrollable().setScrollTop(e);return}this.setProperty("scrollTop",e)}_setScrollTop(e){this._setProperty("scrollTop",e)}_renderScrollTop(){let e=this.get$Scrollable();if(!(!e||this.scrollTop===null)){if(this.rendering||this.htmlComp&&!this.htmlComp.layouted&&!this.htmlComp.layouting){this.session.layoutValidator.schedulePostValidateFunction(this._renderScrollTop.bind(this));return}P.scrollTop(e,this.scrollTop)}}setScrollLeft(e){if(this.getDelegateScrollable()){this.getDelegateScrollable().setScrollLeft(e);return}this.setProperty("scrollLeft",e)}_setScrollLeft(e){this._setProperty("scrollLeft",e)}_renderScrollLeft(){let e=this.get$Scrollable();if(!(!e||this.scrollLeft===null)){if(this.rendering||this.htmlComp&&!this.htmlComp.layouted&&!this.htmlComp.layouting){this.session.layoutValidator.schedulePostValidateFunction(this._renderScrollLeft.bind(this));return}P.scrollLeft(e,this.scrollLeft)}}get$Scrollable(){return this.$container}hasScrollShadow(e){return P.hasScrollShadow(this.get$Scrollable(),e)}getDelegateScrollable(){return null}scrollToTop(e){if(this.getDelegateScrollable()){this.getDelegateScrollable().scrollToTop();return}let t=this.get$Scrollable();if(t){if(!this.rendered){this.session.layoutValidator.schedulePostValidateFunction(this.scrollToTop.bind(this));return}P.scrollTop(t,0,e)}}scrollToBottom(e){if(this.getDelegateScrollable()){this.getDelegateScrollable().scrollToBottom();return}let t=this.get$Scrollable();if(t){if(!this.rendered){this.session.layoutValidator.schedulePostValidateFunction(this.scrollToBottom.bind(this));return}P.scrollToBottom(t,e)}}reveal(e){if(!this.rendered)return;let t=this.$container.scrollParent();t.length!==0&&P.scrollTo(t,this.$container,e)}visitChildren(e){for(const t of this.children){if(t.parent!==this)continue;let i=e(t);if(i===!0||i===ye.TERMINATE||i!==ye.SKIP_SUBTREE&&(i=t.visitChildren(e),i===!0||i===ye.TERMINATE))return ye.TERMINATE}}visit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i;if(u.nvl(t.visitSelf,!0)&&(i=e(this)),u.isOneOf(i,!0,ye.TERMINATE,ye.SKIP_SUBTREE))return s(i);return s(this.visitChildren(e));function s(r){return r?r===!0?ye.TERMINATE:r:ye.CONTINUE}}isAttachedAndRendered(){return(this.rendered||this.rendering)&&this.$container.isAttached()}static cssClassAsArray(e){let t=[],i=e||"";return i=i.trim(),i.length>0&&(t=i.split(" ")),t}static#e=tl=()=>(oi=this,Va(this,"DisabledStyle",{DEFAULT:0,READ_ONLY:1}),this)},tl());I=oi=Gi([Ke({ensureId:!0})],I);const Fe={get(n){for(n=h().ensure(n);n&&n.length>0;){let e=n.data("widget");if(e)return e;n=n.parent()}return null},createUniqueId(n){return Z.get().createUiSeqId()},updateFirstLastMarker(n){n.filter((e,t,i)=>e.rendered&&e.visible).forEach((e,t,i)=>{e.$container.toggleClass("first",t===0),e.$container.toggleClass("last",t===i.length-1)})},findFirstFocusableWidget(n,e,t){return e&&(!e.rendered||!e.visible)?null:p.find(n,i=>i.isFocusable(t))},preserveAndSetProperty(n,e,t,i){t[i]===null&&(t[i]=e()),n()},resetProperty(n,e,t){e[t]!=null&&(n(e[t]),e[t]=null)}};class to extends I{widgets;constructor(){super(),this.widgets=[],this._addWidgetProperties(["widgets"])}_render(){this.$container=this.$parent.appendDiv(),this.htmlComp=x.install(this.$container,this.session)}_renderProperties(){super._renderProperties(),this._renderWidgets()}setWidgets(e){this.setProperty("widgets",e)}_renderWidgets(){this.widgets.forEach(e=>e.render()),this.invalidateLayoutTree()}}Z.uuidPathSkipWidgets.add(to);class Cs extends I{childWidget;constructor(){super(),this.childWidget=null,this._addWidgetProperties(["childWidget"])}setChildWidget(e){this.setProperty("childWidget",e)}}Z.uuidPathAlwaysSkipRules.push(n=>n instanceof Cs);class io extends K{}const p={ensure(n){return n==null?[]:Array.isArray(n)?n:[n]},init(n,e){let t=[];for(let i=0;i<n;i++)t[i]=e;return t},remove(n,e){if(n){let t=n.indexOf(e);if(t!==-1)return n.splice(t,1),!0}return!1},removeByPredicate(n,e,t){let i=p.findIndex(n,e,t);return i!==-1?(n.splice(i,1),!0):!1},removeAll(n,e){let t=!1;if(!e||e.length===0)return!1;for(let i=n.length-1;i>=0;i--)e.indexOf(n[i])>-1&&(n.splice(i,1),t=!0);return t},replace(n,e,t){let i=n.indexOf(e);return i!==-1&&(n[i]=t),i},insert(n,e,t){p.insertAll(n,[e],t)},insertAll(n,e,t){let i=p.ensure(e);n.splice(t,0,...i)},insertSorted(n,e,t){let i=0,s=n.length-1;for(;i<=s;){let r=i+Math.floor((s-i)/2),o=t(n[r],e);if(o<0)i=r+1;else if(o>0)s=r-1;else{for(i=r+1;i<n.length&&t(n[i],e)===0;)i++;break}}n.splice(i,0,e)},insertBefore(n,e,t,i){let s=p.findIndex(n,t,i);s===-1?n.unshift(e):p.insert(n,e,s)},insertAfter(n,e,t){let i=p.findIndex(n,t);i===-1?n.push(e):p.insert(n,e,i+1)},move(n,e,t){let i=n.splice(e,1)[0];p.insert(n,i,t)},moveBefore(n,e,t){let i=[];for(let s of n)s!==e&&(s===t&&i.push(e),i.push(s));return i},moveAfter(n,e,t){let i=[];for(let s of n)s!==e&&(i.push(s),s===t&&i.push(e));return i},moveTo(n,e,t){let i=[];if(n=p.ensure(n),n.length===0)return i;for(let s=0;s<n.length;s++)s===t&&i.push(e),n[s]!==e&&i.push(n[s]);return t>=n.length&&i.push(e),i},contains(n,e){return n=p.ensure(n),n.indexOf(e)!==-1},containsAny(n,e){let t=p.ensure(n);return p.ensure(e).some(s=>t.indexOf(s)>=0)},containsAll(n,e){let t=p.ensure(n);return p.ensure(e).every(s=>t.indexOf(s)>=0)},first(n){return Array.isArray(n)?n[0]:n},last(n){return Array.isArray(n)?n[n.length-1]:n},hasElements(n){return!p.empty(n)},empty(n){return Array.isArray(n)?n.length===0:!0},length(n){return Array.isArray(n)?n.length:0},pushAll(n,e){let t=p.ensure(e);n.push(...t)},union(n,e){let t=[],i={};return n=p.ensure(n),e=p.ensure(e),n.forEach(s=>{let r=s;typeof s=="object"&&(r=s.id),i[r]=s,t.push(s)}),e.forEach(s=>{let r=s;typeof s=="object"&&(r=s.id),r in i||t.push(s)}),t},equalsIgnoreOrder(n,e){return n===e||(!n||n.length===0)&&(!e||e.length===0)?!0:!n||!e||n.length!==e.length?!1:p.containsAll(n,e)},equals(n,e){if(n===e||(!n||n.length===0)&&(!e||e.length===0))return!0;if(!n||!e||n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0},greater(n,e){let t=0,i=0;return n&&(t=n.length),e&&(i=e.length),t>i},eachSibling(n,e,t){if(!(!n||!t))for(let i=0;i<n.length;i++){let s=n[i];s!==e&&t(s,i)}},findIndex(n,e,t){if(!n||!e)return-1;for(let i=0;i<n.length;i++)if(e.call(t,n[i],i,n))return i;return-1},find(n,e,t){let i=p.findIndex(n,e,t);return i===-1?null:n[i]},findFrom(n,e,t,i){return i?p.findFromReverse(n,e,t):p.findFromForward(n,e,t)},findIndexFrom(n,e,t,i){return i?p.findIndexFromReverse(n,e,t):p.findIndexFromForward(n,e,t)},findFromForward(n,e,t){let i=p.findIndexFromForward(n,e,t);return i===-1?null:n[i]},findIndexFromForward(n,e,t){if(!n||!t||e>=n.length)return-1;e<0&&(e=0);for(let i=e;i<n.length;i++){let s=n[i];if(t(s,i))return i}return-1},findFromReverse(n,e,t){let i=p.findIndexFromReverse(n,e,t);return i===-1?null:n[i]},findIndexFromReverse(n,e,t){if(!n||!t||e<0)return-1;e>=n.length&&(e=n.length-1);for(let i=e;i>=0;i--){let s=n[i];if(t(s,i))return i}return-1},pushIfDefined(n){if(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];p.pushAll(n,t.filter(s=>s!=null))}},pushSet(n,e){e&&n.indexOf(e)===-1&&n.push(e)},format(n,e,t){if(!n||n.length===0)return"";let i="";for(let s=0;s<n.length;s++){let r=n[s];e&&s>0&&s<n.length&&(i+=e),t&&(r=_.encode(r)),i+=r}return i},formatEncoded(n,e){return p.format(n,e,!0)},max(n){if(n==null)return Math.max(n);let e=n.filter(b.isNumber);return Math.max(...e)},min(n){if(n==null)return Math.min(n);let e=n.filter(b.isNumber);return Math.min(...e)},diff(n,e){let t=n.slice();return p.removeAll(t,e),t},flatMap(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i=>i,t=[];return p.ensure(n).forEach(i=>p.pushAll(t,e(i))),t},flattenRec(n,e){return p.ensure(n).reduce((t,i)=>(t.push(i),i&&e&&(t=t.concat(p.flattenRec(e(i),e))),t),[])},$indexOf(n,e){for(let t=0;t<n.length;t++)if(n[t][0]===e[0])return t;return-1},$remove(n,e){let t=p.$indexOf(n,e);return t>=0?(n.splice(t,1),!0):!1},randomElement(n){if(n){if(!Array.isArray(n))return n;if(n.length)return n[Math.floor(Math.random()*n.length)]}},toMap(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i=>i+"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:i=>i;return b.createMap(p.ensure(n).reduce((i,s)=>(i[e(s)]=t(s),i),{}))},nullIfEmpty(n){return p.empty(n)?null:n},clear(n){return Array.isArray(n)?n.splice(0,n.length):[]},swap(n,e,t){if(!n)return;let i=n.indexOf(e),s=n.indexOf(t);i>-1&&s>-1&&(n[i]=t,n[s]=e)},sortBy(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"asc";if(!n)return[];if(!e)return n;let i=new Map;return n=n.sort((s,r)=>{let o=b.getOrSetIfAbsent(i,s,a=>e.indexOf(a)),l=b.getOrSetIfAbsent(i,r,a=>e.indexOf(a));return t==="asc"?o-l:l-o}),n}};class Ws{objectType;minCallDuration;callCounter;retryIntervals;maxRetries;defaultRetryInterval;deferred;aborted;initialized;pendingCall;callTimeoutId;callStartTimestamp;type;name;uniqueName;logPrefix;result;constructor(){this.initialized=!1,this.retryIntervals=[],this.maxRetries=null,this.minCallDuration=500,this.defaultRetryInterval=300,this.callCounter=0,this.deferred=h().Deferred(),this.aborted=!1,this.pendingCall=null,this.callTimeoutId=null,this.callStartTimestamp=null,this.type=null,this.name=null,this.uniqueName=null,this.logPrefix="",this.result=null}static GLOBAL_SEQ=0;init(e){h().extend(this,e),this.retryIntervals=this.retryIntervals?this.retryIntervals.slice():[],b.isNullOrUndefined(this.maxRetries)&&(this.maxRetries=this.retryIntervals.length),this.uniqueName=u.nvl(this.type,"call")+"-"+Ws.GLOBAL_SEQ+++_.box(" ",this.name,""),this.initialized=!0}_checkInitialized(){if(!this.initialized)throw new Error("Not initialized")}_updateLogPrefix(){this.logPrefix=this.callCounter+"/"+(this.maxRetries+1)+" ["+this.uniqueName+"] "}_resolve(){h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"[RESOLVE]"),this.deferred.resolve(...p.ensure(this.result))}_reject(){h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"[REJECT]"),this.deferred.reject(...p.ensure(this.result))}_setResult(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.result=t}call(){return this._checkInitialized(),this._call(),this.deferred.promise()}abort(){this._checkInitialized(),this._abort()}_call(){if(this.aborted)throw new Error("Call is aborted");this.callTimeoutId=null,this.callStartTimestamp=Date.now(),this.callCounter++,this._updateLogPrefix(),this.pendingCall=this._callImpl().always(()=>{this.pendingCall=null}).done(this._setResultDone.bind(this)).done(this._onCallDone.bind(this)).fail(this._setResultFail.bind(this)).fail(this._onCallFail.bind(this))}_setResultDone(){this._setResult(...arguments)}_setResultFail(){this._setResult(...arguments)}_onCallDone(){this._resolve()}_onCallFail(){if(this.aborted){h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"Call aborted"),this._reject();return}let e=this._nextRetryImpl(...arguments);if(typeof e!="number"){h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"No retries remaining"),this._reject();return}let t=Date.now()-this.callStartTimestamp,i=Math.max(this.minCallDuration-t,0),s=e+i;h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"Try again in "+s+" ms..."),this.callTimeoutId=setTimeout(this._call.bind(this),s)}_nextRetryImpl(){if(this.maxRetries>=0&&this.callCounter>this.maxRetries)return!1;if(this.retryIntervals.length){let e=this.retryIntervals.shift();return this.defaultRetryInterval=e,e}return this.defaultRetryInterval}_abort(){if(this.aborted=!0,this.callTimeoutId){h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"Cancelled scheduled retry"),clearTimeout(this.callTimeoutId),this.callTimeoutId=null,this._reject();return}this._abortImpl()}_abortImpl(){}}const li={copyText(n){u.assertParameter("options",n),n.parent&&!n.session&&(n.session=n.parent.session),u.assertProperty(n,"session");let e=li._copyText(n);return n.parent&&u.nvl(n.showNotification,!0)?(li._showNotification(n,e),null):e},_copyText(n){let e=h().Deferred(),t=n?.parent?.window(!0)||window;if(t.navigator.clipboard)return t.navigator.clipboard.writeText(n.text).then(function(){return e.resolve(...arguments)}).catch(function(){return e.reject(...arguments)}),e.promise();let i=n?.parent?.document(!0)||document,s=i.createElement("textarea");s.style.position="fixed",s.style.opacity="0.0",s.value=n.text,i.body.appendChild(s);let r=h()(s);n.session.focusManager.installFocusContext(r,Et.AUTO),s.select();try{i.execCommand("copy")?e.resolve():e.reject()}catch(o){e.reject(o)}finally{n.session.focusManager.uninstallFocusContext(r),i.body.removeChild(s)}return e.promise()},_showNotification(n,e){let t=li._successStatus(n.parent.session);e.catch(()=>{t=li._failedStatus(n.parent.session)}).then(()=>{li.showNotification(n.parent,t)})},_successStatus(n){return new E({message:n.text("ui.CopyToClipboardSuccessStatus"),severity:E.Severity.INFO})},_failedStatus(n){return new E({message:n.text("ui.CopyToClipboardFailedStatus"),severity:E.Severity.WARNING})},showNotification(n,e){u.assertParameter("parent",n),e=e||li._successStatus(n.session),u.create(_i,{parent:n,closable:!1,duration:e.isValid()?1234:3456,status:e}).show()}},dt={ColorSchemeId:{DEFAULT:"default",ALTERNATIVE:"alternative",RAINBOW:"rainbow"},ensureColorScheme(n,e){let t={};return n&&typeof n=="object"?t=n:typeof n=="string"&&(_.startsWith(n,dt.ColorSchemeId.DEFAULT)?t.scheme=dt.ColorSchemeId.DEFAULT:_.startsWith(n,dt.ColorSchemeId.ALTERNATIVE)?t.scheme=dt.ColorSchemeId.ALTERNATIVE:_.startsWith(n,dt.ColorSchemeId.RAINBOW)?t.scheme=dt.ColorSchemeId.RAINBOW:t.scheme=_.removeSuffix(n,"-inverted"),t.inverted=_.endsWith(n,"-inverted")),b.isNullOrUndefined(e)||(t.tile=e),t},toggleColorSchemeClasses(n,e){if(!n||!e)return;let t=dt.ensureColorScheme(e);n.toggleClass("color-alternative",t.scheme===dt.ColorSchemeId.ALTERNATIVE),n.toggleClass("color-rainbow",t.scheme===dt.ColorSchemeId.RAINBOW),n.toggleClass("inverted",!!t.inverted),n.toggleClass("tile",!!t.tile)},getCssClasses(n){let e=[];if(!n)return e;let t=dt.ensureColorScheme(n);return t.scheme===dt.ColorSchemeId.ALTERNATIVE?e.push("color-alternative"):t.scheme===dt.ColorSchemeId.RAINBOW?e.push("color-rainbow"):t.scheme&&e.push(t.scheme),t.inverted&&e.push("inverted"),t.tile&&e.push("tile"),e}},S={shift(n,e,t,i){let s=new Date(n.getTime());return e&&(s.setFullYear(n.getFullYear()+e),S.compareMonths(s,n)!==e*12&&s.setDate(0)),t&&(s.setMonth(n.getMonth()+t),S.compareMonths(s,n)!==t+e*12&&s.setDate(0)),i&&s.setDate(n.getDate()+i),s},shiftTime(n,e,t,i,s){let r=new Date(n.getTime());return e&&r.setHours(n.getHours()+e),t&&r.setMinutes(n.getMinutes()+t),i&&r.setSeconds(n.getSeconds()+i),s&&r.setMilliseconds(n.getMilliseconds()+s),r},shiftToNextDayOfType(n,e){let t=e-n.getDay();return t<=0&&(t+=7),S.shift(n,0,0,t)},shiftToNextDayAndDate(n,e,t){let i=new Date(n.getTime());for(t<i.getDate()&&i.setMonth(i.getMonth()+1),i.setDate(t);i.getDay()!==e||i.getDate()!==t;)i=S.shift(i,0,1,0),i.setDate(t);return i},shiftToPreviousDayOfType(n,e){let t=e-n.getDay();return t>=0&&(t-=7),S.shift(n,0,0,t)},shiftToNextOrPrevDayOfType(n,e,t){return t>0?S.shiftToNextDayOfType(n,e):S.shiftToPreviousDayOfType(n,e)},shiftToNextOrPrevMonday(n,e){return S.shiftToNextOrPrevDayOfType(n,1,e)},ensure(n){return b.isNullOrUndefined(n)||n instanceof Date?n:S.parseJsonDate(n)},ensureMonday(n,e){return n.getDay()===1?n:S.shiftToNextOrPrevMonday(n,e)},isSameTime(n,e){return!n||!e?!1:n.getHours()===e.getHours()&&n.getMinutes()===e.getMinutes()&&n.getSeconds()===e.getSeconds()},isSameDay(n,e){return!n||!e?!1:n.getFullYear()===e.getFullYear()&&n.getMonth()===e.getMonth()&&n.getDate()===e.getDate()},isSameMonth(n,e){return!n||!e?!1:S.compareMonths(n,e)===0},compareMonths(n,e){let t=n.getMonth(),i=e.getMonth(),s=n.getFullYear(),r=e.getFullYear(),o=t-i;return s===r?o:(s-r)*12+o},compareDays(n,e){return(S.trunc(n).getTime()-S.trunc(e).getTime()-(n.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/(36e5*24)},orderWeekdays(n,e){let t=[];for(let i=0;i<7;i++)t[i]=n[(i+e)%7];return t},weekInYear(n,e){if(!n)return;let t=1;e instanceof St?t=e.symbols.firstDayOfWeek:e instanceof Dt?t=e.dateFormatSymbols.firstDayOfWeek:typeof e=="number"&&(t=e);let i=S._thursdayOfWeek(n,t),s=new Date(i.getFullYear(),0,4),r=S.firstDayOfWeek(s,t);n.getTime()<r.getTime()&&(s=new Date(i.getFullYear()-1,0,4));let o=S._thursdayOfWeek(s,t),l=(i.getTime()-o.getTime())/864e5;return 1+Math.round(l/7)},_thursdayOfWeek(n,e){if(!n||typeof e!="number")return;let t=new Date(n.valueOf());return t.getDay()!==4&&(t.getDay()<e&&t.setDate(t.getDate()-7),t.setDate(t.getDate()-t.getDay()+4)),t},firstDayOfWeek(n,e){if(!n||typeof e!="number")return;let t=new Date(n.valueOf());return t.getDay()!==e&&t.setDate(t.getDate()-(t.getDay()+7-e)%7),t},parseJsonDate(n){if(!n)return null;let e=1970,t=1,i=1,s=0,r=0,o=0,l=0,a=!1,d=/^\+?(\d{4,5})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})\.(\d{3})(Z?)$/.exec(n);if(d!==null)e=parseInt(d[1],10),t=parseInt(d[2],10),i=parseInt(d[3],10),s=parseInt(d[4],10),r=parseInt(d[5],10),o=parseInt(d[6],10),l=parseInt(d[7],10),a=d[8]==="Z";else if(d=/^\+?(\d{4,5})-(\d{2})-(\d{2})(Z?)$/.exec(n),d!==null)e=parseInt(d[1],10),t=parseInt(d[2],10),i=parseInt(d[3],10),a=d[4]==="Z";else if(d=/^(\d{2}):(\d{2}):(\d{2})\.(\d{3})(Z?)$/.exec(n),d!==null)s=parseInt(d[1],10),r=parseInt(d[2],10),o=parseInt(d[3],10),l=parseInt(d[4],10),a=d[5]==="Z";else throw new Error("Unparseable date: "+n);let c;return a?(c=new Date(Date.UTC(e,t-1,i,s,r,o,l)),e<100&&c.setUTCFullYear(e)):(c=new Date(e,t-1,i,s,r,o,l),e<100&&c.setFullYear(e)),c},toJsonDate(n,e,t,i){if(!n)return null;t===void 0&&(t=!0),i===void 0&&(i=!0);let s,r,o;e?(s=a(n)+"-"+_.padZeroLeft(n.getUTCMonth()+1,2)+"-"+_.padZeroLeft(n.getUTCDate(),2),r=_.padZeroLeft(n.getUTCHours(),2)+":"+_.padZeroLeft(n.getUTCMinutes(),2)+":"+_.padZeroLeft(n.getUTCSeconds(),2)+"."+_.padZeroLeft(n.getUTCMilliseconds(),3),o="Z"):(s=a(n)+"-"+_.padZeroLeft(n.getMonth()+1,2)+"-"+_.padZeroLeft(n.getDate(),2),r=_.padZeroLeft(n.getHours(),2)+":"+_.padZeroLeft(n.getMinutes(),2)+":"+_.padZeroLeft(n.getSeconds(),2)+"."+_.padZeroLeft(n.getMilliseconds(),3),o="");let l="";return t&&(l+=s,i&&(l+=" ")),i&&(l+=r),l+=o,l;function a(d){let c=d.getFullYear();return c>9999?"+"+c:_.padZeroLeft(c,4)}},toJsonDateRange(n){return{from:S.toJsonDate(n.from),to:S.toJsonDate(n.to)}},create(n){if(n){let e=/^(\d{4,5})(?:-(\d{2})(?:-(\d{2})(?: (\d{2})(?::(\d{2})(?::(\d{2})(?:\.(\d{3}))?(Z?))?)?)?)?)?/.exec(n);if(e===null)throw new Error("Unparsable date: "+n);let t;return e[8]==="Z"?t=new Date(Date.UTC(parseInt(e[1],10),(parseInt(e[2],10)||1)-1,parseInt(e[3],10)||1,parseInt(e[4],10)||0,parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0)):t=new Date(parseInt(e[1],10),(parseInt(e[2],10)||1)-1,parseInt(e[3],10)||1,parseInt(e[4],10)||0,parseInt(e[5],10)||0,parseInt(e[6],10)||0,parseInt(e[7],10)||0),t}},newDate(){return new Date},format(n,e,t){return new St(e,t).format(n)},formatDateTime(n,e){return new St(e,e.dateFormatPatternDefault+" "+e.timeFormatPatternDefault).format(n)},formatDuration(n,e,t){if(n==null)return null;n<0&&(n=0);let i=n,s=i%1e3;i=Math.floor(i/1e3);let r=i%60;i=Math.floor(i/60);let o=i%60;i=Math.floor(i/60);let l=i%24,a=Math.floor(i/24),d=a>0,c=d||l>0,f=c||o>0,g="";if(d&&(g=a+" "+(a>1?de.resolveText("${textKey:ui.DaysUnit}",t.languageTag):de.resolveText("${textKey:ui.DayUnit}",t.languageTag))+" "),c&&(g+=l+"h "),f&&(g+=(c?_.padZeroLeft(o,2):o)+"m "),g+=f?_.padZeroLeft(r,2):r,e){let y=t.decimalFormatSymbols.decimalSeparator;g+=y+_.padZeroLeft(s,3)}return g+="s",g},compare(n,e){if(!n&&!e)return 0;if(!n)return-1;if(!e)return 1;let t=n.getTime()-e.getTime();return t<-1?-1:t>1?1:t},equals(n,e){return S.compare(n,e)===0},combineDateTime(n,e){let t=new Date;return t.setHours(0,0,0,0),t.setFullYear(1970,0,1),n&&t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e&&(t.setHours(u.nvl(e.getHours(),0)),t.setMinutes(u.nvl(e.getMinutes(),0)),t.setSeconds(u.nvl(e.getSeconds(),0)),t.setMilliseconds(u.nvl(e.getMilliseconds(),0))),t},isLeapYear(n){return n==null?!1:new Date(n,1,29).getDate()===29},trunc(n,e){return n&&(u.nvl(e,!0)&&(n=new Date(n.getTime())),n.setHours(0,0,0,0)),n},ceil(n,e,t){let i,s,r=u.nvl(e,30);return n&&(u.nvl(t,!0)&&(n=new Date(n.getTime())),n.setSeconds(0,0),s=(n.getMinutes()+r)/r*r,i=n.getHours(),s>=60&&(i++,s=0),i>23&&(i=0,n.setDate(n.getDate()+1)),n.setHours(i,s)),n}},Be={_defaults:{},_objectTypeHierarchyFlat:{},bootstrap(n){n=n||{};let e={url:"defaultValues"};return n=h().extend({},e,n),h().ajaxJson(n.url).then(t=>G.handleJsonError(n.url,t)).then(Be.init.bind(this))},init(n){Be._objectTypeHierarchyFlat={},Be._defaults=n.defaults||{};let e=n.objectTypeHierarchy||{};Be._generateObjectTypeHierarchyRec(e,void 0,Be._objectTypeHierarchyFlat),Object.keys(Be._defaults).forEach(t=>{Be._objectTypeHierarchyFlat[t]||(Be._objectTypeHierarchyFlat[t]=[t])})},_generateObjectTypeHierarchyRec(n,e,t){if(n){if(!t)throw new Error("Argument 'targetMap' must not be null");Object.keys(n).forEach(i=>{let s=[i];if(e&&(s=s.concat(e)),typeof n[i]=="object"&&Be._generateObjectTypeHierarchyRec(n[i],s,t),t[i])throw new Error("Object type '"+i+"' has ambiguous parent object types.");t[i]=s},this)}},applyTo(n,e){if(Array.isArray(n))for(let t=0;t<n.length;t++)Be.applyTo(n[t],e);else if(typeof n=="object"&&(e=e||n.objectType,e)){if(typeof e!="string"){let t=(e+"").substring(0,80);throw new Error("objectType has to be a string but is a "+typeof e+" ObjectType: "+t)}Be._applyToInternal(n,e)}},_applyToInternal(n,e){let t=Be._objectTypeHierarchyFlat[e];if(t||(e=ni.parse(e).objectType.toString(),t=Be._objectTypeHierarchyFlat[e]),!!t)for(let i=0;i<t.length;i++){let s=t[i],r=Be._defaults[s];Be._extendWithDefaults(n,r)}},_extendWithDefaults(n,e){n===void 0||e===void 0||Object.keys(e).forEach(t=>{let i=t;if(_.startsWith(t,"~")&&(i=t.substring(1)),n[i]===void 0)n[i]=b.valueCopy(e[i]);else if(b.isObject(n[i])&&b.isObject(e[t]))Be._extendWithDefaults(n[i],e[t]);else if(Array.isArray(n[i])&&b.isObject(e[t])){let s=n[i];for(let r=0;r<s.length;r++)b.isObject(s[r])&&Be._extendWithDefaults(s[r],e[t])}})}};function sl(n){return n&&_.startsWith(n.type,"touch")}const Ve={pageX(n){return b.isNullOrUndefined(n.pageX)?n.originalEvent.touches[0].pageX:n.pageX},pageY(n){return b.isNullOrUndefined(n.pageY)?n.originalEvent.touches[0].pageY:n.pageY},touchdown(n,e){return Ve.touchOrMouse(n,"touchstart","mousedown",e)},touchmove(n,e){return Ve.touchOrMouse(n,"touchmove","mousemove",e)},touchendcancel(n,e){return Ve.touchOrMouse(n,"touchend touchcancel","mouseup",e)},touchOrMouse(n,e,t,i){return i=i||"",i&&(i="."+i),n?e+i:t+i},isTouchEvent:sl,fixTouchEvent(n){if(sl(n)){let e=n.touches||(n.originalEvent?n.originalEvent.touches:null),t=e?e[0]:null;t&&(n.pageX=Math.round(t.pageX),n.pageY=Math.round(t.pageY))}},passiveOptions(){let n=!1;return w.get().supportsPassiveEventListener()&&(n={passive:!0}),n},onScrollStartEndDuringTouch(n,e,t){let i,s=!1,r=!1,o=c=>{s||(e(),s=!0),clearTimeout(i),a()},l=c=>{r=!0,a()};function a(){clearTimeout(i),i=setTimeout(()=>{r&&(d(),t())},50)}function d(){n.off("scroll",o),n.document(!1).off("touchend touchcancel",l)}n.on("scroll",o),n.document(!1).one("touchend touchcancel",l)},propagateEvent(n,e){if(typeof Event!="function")return;let t=new e.constructor(e.type,e);t.sourceEvent=e,n.dispatchEvent(t)||e.preventDefault()},addPropagationListener(n,e,t,i){t=p.ensure(t),t.forEach(s=>{n.addEventListener(s,r=>{i&&!i(r)||Ve.propagateEvent(e,r)})})},onSwipe(n,e,t,i,s){let r=n.window(!1),o=w.get().supportsOnlyTouch();n.on("touchmove",l=>l.preventDefault()),n.on("remove",l=>r.off("."+e)),n.on(Ve.touchdown(o),l=>{let a=n.position().left;if(!(!t||!!t({originalEvent:l,originalLeft:a,deltaX:0,newLeft:a,direction:0})))return;let c=!0,f=Ve.pageX(l),g=a,y=0;r.on(Ve.touchmove(o,e),v=>{let k=Ve.pageX(v)-f,V=a+k;if(V!==g&&(y=Math.sign(V-g)),i){let Q=i({originalEvent:v,originalLeft:a,deltaX:k,newLeft:V,direction:y});g=typeof Q=="number"?Q:V}else g=V}),r.on(Ve.touchendcancel(o,e),v=>{c&&(c=!1,r.off("."+e),s&&s({originalEvent:v,originalLeft:a,deltaX:g-a,newLeft:g,direction:y}))})})}},Gt={validateMaximumUploadSize(n,e){return n=p.ensure(n),n.length===0||e==null?!0:n.reduce((i,s)=>i+s.size,0)<=e},fileListToArray(n){let e=[];for(let t=0;t<n.length;t++)e.push(n[t]);return e},getErrorMessageMaximumUploadSizeExceeded(n,e){if(e<1024)return n.text("ui.FileSizeLimit",e,n.text("ui.Bytes"));let t=e/1024;if(t<1024)return n.text("ui.FileSizeLimit",Se.round(t,hi.HALF_UP,2),"KB");let i=t/1024;return i<1024?n.text("ui.FileSizeLimit",Se.round(i,hi.HALF_UP,2),"MB"):n.text("ui.FileSizeLimit",Se.round(i/1024,hi.HALF_UP,2),"GB")}};let Ts;class w{objectType;userAgent;features;system;type;browser;browserVersion;systemVersion;scrollbarWidth;constructor(e){this.userAgent=e.userAgent,this.features={},this.system=w.System.UNKNOWN,this.type=w.Type.DESKTOP,this.browser=w.Browser.UNKNOWN,this.browserVersion=0,this.scrollbarWidth=0,this.userAgent&&(this._parseSystem(),this._parseSystemVersion(),this._parseBrowser(),this._parseBrowserVersion())}static VENDOR_PREFIXES=["Webkit","Moz","O","ms","Khtml"];static Browser={UNKNOWN:"Unknown",FIREFOX:"Firefox",CHROME:"Chrome",INTERNET_EXPLORER:"InternetExplorer",EDGE:"Edge",SAFARI:"Safari"};static System={UNKNOWN:"Unknown",IOS:"IOS",ANDROID:"ANDROID",WINDOWS:"WINDOWS"};static Type={DESKTOP:"DESKTOP",TABLET:"TABLET",MOBILE:"MOBILE"};bootstrap(){return this.scrollbarWidth=this._detectScrollbarWidth(),this.type=this._detectType(this.userAgent),this.isIos()&&this._installActiveHandler(),this._needsIPhoneRotationHack()&&this._fixIPhoneRotationBug(),h().resolvedPromise()}_installActiveHandler(){document.addEventListener("touchstart",()=>{},!1)}_needsIPhoneRotationHack(){return h().log.isDebugEnabled()&&h().log.debug("Activating iPhone rotation workaround."),this.isIphone()&&!this.isStandalone()&&h()(document.body).css("overflow")==="hidden"}_fixIPhoneRotationBug(){h().log.isDebugEnabled()&&h().log.debug("Enabling iPhone rotation workaround.");let e=this.orientation(),t=0,i=document.documentElement;window.addEventListener("resize",r=>{let o=w.get().orientation();e!==o&&(e=o,t=0,s())});function s(){setTimeout(()=>{i.scrollTop=0,++t<8&&s()},50)}}orientation(){return window.innerHeight>window.innerWidth?"portrait":"landscape"}hasOnScreenKeyboard(){return this.supportsFeature("_onScreenKeyboard",()=>this.isIos()||this.isAndroid()||this.isWindowsTabletMode())}isScrollWidthIncludingPadding(){return this.isInternetExplorer()||this.isFirefox()||this.isEdge()}isCustomEllipsisTooltipPossible(){return this.browser!==w.Browser.SAFARI}isIos(){return w.System.IOS===this.system}isEdge(){return w.Browser.EDGE===this.browser}cssClassForEdge(){return this.isEdge()?"ms-edge":""}cssClassForIphone(){return this.isIphone()?"iphone":""}isIphone(){return this.userAgent.indexOf("iPhone")>-1}isInternetExplorer(){return w.Browser.INTERNET_EXPLORER===this.browser}isFirefox(){return w.Browser.FIREFOX===this.browser}isChrome(){return w.Browser.CHROME===this.browser}isIosPlatform(){return/iPad|iPhone|iPod/.test(navigator.platform)}isAndroid(){return w.System.ANDROID===this.system}isWindowsTabletMode(){return w.System.WINDOWS===this.system&&this.systemVersion>=10&&window.matchMedia("(pointer: coarse)").matches}isStandalone(){return!!window.navigator.standalone}isSupportedBrowser(e,t){e=u.nvl(e,this.browser),t=u.nvl(t,this.browserVersion);let i=w.Browser;return e===i.CHROME&&t>=93||e===i.FIREFOX&&t>=92||e===i.SAFARI&&t>=15.4}_detectType(e){return w.System.ANDROID===this.system?e.indexOf("Mobile")>-1?w.Type.MOBILE:w.Type.TABLET:w.System.IOS===this.system?e.indexOf("iPad")>-1?w.Type.TABLET:w.Type.MOBILE:this.isWindowsTabletMode()?w.Type.TABLET:w.Type.DESKTOP}_parseSystem(){let e=this.userAgent;e.indexOf("iPhone")>-1||e.indexOf("iPad")>-1?this.system=w.System.IOS:e.indexOf("Android")>-1?this.system=w.System.ANDROID:e.indexOf("Windows")>-1&&(this.system=w.System.WINDOWS)}_parseSystemVersion(){let e,t=w.System,i=this.userAgent;this.system===t.IOS?(e=/ OS ([0-9]+\.?[0-9]*)/,i=i.replace(/_/g,".")):this.system===t.WINDOWS&&(e=/Windows NT ([0-9]+\.?[0-9]*)/),e&&(this.systemVersion=this._parseVersion(i,e))}_parseBrowser(){let e=this.userAgent;e.indexOf("Firefox")>-1?this.browser=w.Browser.FIREFOX:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1?this.browser=w.Browser.INTERNET_EXPLORER:e.indexOf("Edge")>-1?this.browser=w.Browser.EDGE:e.indexOf("Chrome")>-1?this.browser=w.Browser.CHROME:e.indexOf("Safari")>-1&&(this.browser=w.Browser.SAFARI)}_parseBrowserVersion(){let e,t=w.Browser,i=this.userAgent;if(this.browser===t.INTERNET_EXPLORER)i.indexOf("MSIE")>-1?e=/MSIE ([0-9]+\.?[0-9]*)/:e=/rv:([0-9]+\.?[0-9]*)/;else if(this.browser===t.EDGE)e=/Edge\/([0-9]+\.?[0-9]*)/;else if(this.browser===t.SAFARI){if(this.isIos()&&i.indexOf("Version/")<0){this.browserVersion=this.systemVersion;return}e=/Version\/([0-9]+\.?[0-9]*)/}else this.browser===t.FIREFOX?e=/Firefox\/([0-9]+\.?[0-9]*)/:this.browser===t.CHROME&&(e=/Chrome\/([0-9]+\.?[0-9]*)/);e&&(this.browserVersion=this._parseVersion(i,e))}_parseVersion(e,t){let i=t.exec(e);if(Array.isArray(i)&&i.length===2)return parseFloat(i[1])}supportsFeature(e,t){return this.features[e]===void 0&&(this.features[e]=t(e)),this.features[e]}supportsOnlyTouch(){return this.supportsFeature("_onlyTouch",this.hasOnScreenKeyboard.bind(this))}supportsTouch(){return this.supportsFeature("_touch",e=>"ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof window.DocumentTouch)}supportsFile(){return!!window.File}supportsFileConstructor(){return typeof File=="function"}supportsCssAnimation(){return this.supportsCssProperty("animation")}supportsHistoryApi(){return!!(window.history&&window.history.pushState)}supportsCssGradient(){return this.supportsFeature("gradient",this.checkCssValue.bind(this,"backgroundImage","linear-gradient(to left, #000 0%, #000 50%, transparent 50%, transparent 100% )",t=>(t+"").indexOf("gradient")>0))}supportsInternationalization(){return window.Intl&&typeof window.Intl=="object"}supportsDownloadInSameWindow(){return w.Browser.FIREFOX!==this.browser}supportsWebcam(){return this.supportsFeature("_webcam",e=>{let t=b.optProperty(navigator,"mediaDevices","getUserMedia");return b.isFunction(t)})}supportsMicrotask(){return typeof queueMicrotask=="function"}supportsIntersectionObserver(){return typeof IntersectionObserver=="function"}hasPrettyScrollbars(){return this.supportsFeature("_prettyScrollbars",e=>this.scrollbarWidth===0)}canHideScrollbars(){return this.supportsFeature("_canHideScrollbars",e=>this._detectScrollbarWidth("hybrid-scrollable")===0)}loosesFocusIfPseudoElementIsRemoved(){return w.Browser.FIREFOX===this.browser}supportsCssProperty(e){return this.supportsFeature(e,t=>{if(document.body.style[t]!==void 0)return!0;t=t.charAt(0).toUpperCase()+t.slice(1);for(let i=0;i<w.VENDOR_PREFIXES.length;i++)if(document.body.style[w.VENDOR_PREFIXES[i]+t]!==void 0)return!0;return!1})}supportsGeolocation(){return!!navigator.geolocation}requiresSyntheticActiveState(){return this.isFirefox()}supportsPassiveEventListener(){return this.supportsFeature("_passiveEventListener",e=>{let t=!1;try{let i=Object.defineProperty({},"passive",{get:()=>(t=!0,!1)});window.addEventListener("test",i,i),window.removeEventListener("test",i,i)}catch{t=!1}return t})}checkCssValue(e,t,i){if(document.body.style[e]===void 0)return!1;let s=document.createElement("div");if(s.style[e]=t,i(s.style[e]))return!0;e=e.charAt(0).toUpperCase()+e.slice(1);for(let r=0;r<w.VENDOR_PREFIXES.length;r++){let o=w.VENDOR_PREFIXES[r]+e;if(document.body.style[o]!==void 0&&(s.style[o]=t,i(s.style[o])))return!0}return!1}hasTableCellZoomBug(){return this.browser===w.Browser.CHROME}_detectScrollbarWidth(e){let t=h()("body").appendDiv(e).attr("id","MeasureScrollbar").css("width",50).css("height",50).css("overflow-y","scroll"),i=t[0],s=i.offsetWidth-i.clientWidth;return t.remove(),s}toString(){return"scout.Device[system="+this.system+" browser="+this.browser+" browserVersion="+this.browserVersion+" type="+this.type+" scrollbarWidth="+this.scrollbarWidth+" features="+JSON.stringify(this.features)+"]"}static get(){return Ts}}G.addListener("prepare",()=>{Ts||(Ts=u.create(w,{userAgent:navigator.userAgent}))});class R{_lastPosX;_lastPosY;_lastTimestamp;_maxDoubleClickInterval;_maxDoubleClickDistance;_doubleClicked;constructor(e){e=e||{},this._lastPosX=null,this._lastPosY=null,this._lastTimestamp=null,this._maxDoubleClickInterval=e.maxDoubleClickInterval||500,this._maxDoubleClickDistance=e.maxDoubleClickDistance||10,this._doubleClicked=!1}mousedown(e){if(e&&e.type==="mousedown"){let t=u.nvl(e.pageX,0),i=u.nvl(e.pageY,0),s=Date.now(),r=!1;this._lastTimestamp!==void 0&&s-this._lastTimestamp<=this._maxDoubleClickInterval&&Math.max(Math.abs(t-this._lastPosX),Math.abs(i-this._lastPosY))<=this._maxDoubleClickDistance&&(r=!0),this._lastPosX=t,this._lastPosY=i,this._lastTimestamp=s,this._doubleClicked=r}}doubleClicked(){return this._doubleClicked}}class M{additionalDropProperties;allowedTypes;dropType;dropMaximumSize;target;onDrop;validateFiles;supportedScoutTypes;$element;selector;_onDragEnterHandler;_onDragOverHandler;_onDropHandler;constructor(e){e=e||{},this.additionalDropProperties=null,this.allowedTypes=null,this.dropType=null,this.dropMaximumSize=null,this.target=null,this.onDrop=null,this.validateFiles=null,this.selector=null,this.$element=null,h().extend(this,e),this.supportedScoutTypes=p.ensure(e.supportedScoutTypes),this._onDragEnterHandler=this._onDragEnter.bind(this),this._onDragOverHandler=this._onDragOver.bind(this),this._onDropHandler=this._onDrop.bind(this)}install(e,t){if(this.$element)throw new Error("Already installed.");this.selector=t,this.$element=e,this.$element.on("dragenter",this.selector,this._onDragEnterHandler).on("dragover",this.selector,this._onDragOverHandler).on("drop",this.selector,this._onDropHandler)}uninstall(){this.$element.off("dragenter",this.selector,this._onDragEnterHandler).off("dragover",this.selector,this._onDragOverHandler).off("drop",this.selector,this._onDropHandler),this.$element=null,this.selector=null}_onDragEnter(e){this._onDragEnterOrOver(e)}_onDragOver(e){this._onDragEnterOrOver(e)}_onDragEnterOrOver(e){e.originalEvent.dataTransfer.dropEffect="copy",z.verifyDataTransferTypesScoutTypes(e,this.supportedScoutTypes,this.dropType())}_onDrop(e){if(this.supportedScoutTypes.indexOf(O.FILE_TRANSFER)>=0&&(this.dropType()&O.FILE_TRANSFER)===O.FILE_TRANSFER&&z.dataTransferTypesContainsScoutTypes(e.originalEvent.dataTransfer,O.FILE_TRANSFER)){if(!this.onDrop||!(e.originalEvent.dataTransfer.files instanceof FileList))return;let t=Gt.fileListToArray(e.originalEvent.dataTransfer.files);if(p.empty(t))return;try{this.validateFiles(t,this._validateFiles.bind(this))}catch(i){this._validationFailed(i);return}e.stopPropagation(),e.preventDefault(),this.onDrop({originalEvent:e,files:t})}}_validateFiles(e){if(!this.dropMaximumSize)return;let t=this.dropMaximumSize();if(!Gt.validateMaximumUploadSize(e,t))throw{title:this.target.session.text("ui.FileSizeLimitTitle"),message:Gt.getErrorMessageMaximumUploadSizeExceeded(this.target.session,t)}}_validationFailed(e){h().log.isDebugEnabled()&&h().log.debug("File validation failed",e);let t="",i="Invalid files";return e&&(t=e.title||t,i=e.message||i),Ri.createOk(this.target).withSeverity(E.Severity.ERROR).withHeader(t).withBody(i).buildAndOpen()}uploadFiles(e){e&&e.originalEvent&&e.files.length>=1&&this.target.session.uploadFiles(this.target,e.files,this.additionalDropProperties?this.additionalDropProperties(e.originalEvent):void 0,this.dropMaximumSize?this.dropMaximumSize():void 0,this.allowedTypes?this.allowedTypes():void 0)}}var O;(function(n){n[n.NONE=0]="NONE",n[n.FILE_TRANSFER=1]="FILE_TRANSFER"})(O||(O={}));const z={DEFAULT_DROP_MAXIMUM_SIZE:50*1024*1024,scoutTypeToDragTypeMapping(n){n=p.ensure(n);let e=[];return n.indexOf(O.FILE_TRANSFER)>=0&&e.push("Files"),e},verifyDataTransferTypesScoutTypes(n,e,t){e=p.ensure(e);let i=[];t!==void 0?e.forEach(s=>{(t&s)===s&&p.pushAll(i,z.scoutTypeToDragTypeMapping(e))}):i=z.scoutTypeToDragTypeMapping(e),Array.isArray(i)&&i.length>0&&z.verifyDataTransferTypes(n,i)},verifyDataTransferTypes(n,e){let t=n.originalEvent.dataTransfer;return z.dataTransferTypesContains(t,e)?(n.stopPropagation(),n.preventDefault(),!0):!1},dataTransferTypesContainsScoutTypes(n,e){e=p.ensure(e);let t=z.scoutTypeToDragTypeMapping(e);return z.dataTransferTypesContains(n,t)},dataTransferTypesContains(n,e){if(e=p.ensure(e),n&&n.types){if(Array.isArray(n.types)&&p.containsAny(n.types,e))return!0;if(n.types.contains)return e.some(t=>n.types.contains(t))}return!1},handler(n){return!n||!n.target?null:u.create(M,n)},installOrUninstallDragAndDropHandler(n){n.target&&(n=$.extend({},z._createDragAndDropHandlerOptions(n.target),n),n.doInstall()?z._installDragAndDropHandler(n):z.uninstallDragAndDropHandler(n.target))},_installDragAndDropHandler(n){if(n.target.dragAndDropHandler||(n.target.dragAndDropHandler=z.handler(n),!n.target.dragAndDropHandler))return;let e=n.container();e&&n.target.dragAndDropHandler.install(e,n.selector)},_createDragAndDropHandlerOptions(n){return{target:n,supportedScoutTypes:O.FILE_TRANSFER,validateFiles:(e,t)=>t(e),onDrop:e=>{},dropType:()=>O.FILE_TRANSFER,dropMaximumSize:()=>n.dropMaximumSize,doInstall:()=>n.enabledComputed,container:()=>n.$container,additionalDropProperties:e=>{}}},uninstallDragAndDropHandler(n){!n||!n.dragAndDropHandler||(n.dragAndDropHandler.uninstall(),n.dragAndDropHandler=null)}};class ct extends ot{mouseMoveThreshold;maxCloneSize;widget;_moveData;_animationDurationFactor;_mouseMoveHandler;_mouseUpHandler;_keyDownHandler;_releasingScrollHandler;constructor(e){super(),this.maxCloneSize=200,this.mouseMoveThreshold=7,this.widget=e,this._moveData=null,this._animationDurationFactor=1,this._mouseMoveHandler=this._onMouseMove.bind(this),this._mouseUpHandler=this._onMouseUp.bind(this),this._keyDownHandler=this._onKeyDown.bind(this),this._releasingScrollHandler=this._onReleasingScroll.bind(this)}start(e,t,i){if(this._moveData||i.$container.hasClass("dragged")||!e||!t||!i||!t.includes(i)||!i.$container||e.which!==1)return;Ve.fixTouchEvent(e),this._initMoveData(e,t,i),h()("iframe").addClass("dragging-in-progress");let s=()=>this.cancel();return this.widget.one("remove",s),this.one("cancel end",()=>{this.widget.off("remove",s)}),!0}_initMoveData(e,t,i){let s=i.$container.window(),r=i.$container.parent();this._moveData={},this._moveData.session=i.session,this._moveData.$window=s,this._moveData.$container=r,this._moveData.containerBounds=C.offsetBounds(r,{includeMargin:!0}),this._moveData.elements=t,this._moveData.elementInfos=this._createElementInfos(t,i),this._moveData.startCursorPosition=new X(e.pageX-this._moveData.containerBounds.x,e.pageY-this._moveData.containerBounds.y),this._moveData.currentCursorPosition=this._moveData.startCursorPosition;let o=this._moveData.draggedElementInfo;this._moveData.cursorDistance=new We(e.pageY-o.bounds.y,o.bounds.x+o.bounds.width-e.pageX,o.bounds.y+this._moveData.draggedElementInfo.bounds.height-e.pageY,e.pageX-o.bounds.x),this._moveData.$window.off("mousemove touchmove",this._mouseMoveHandler).off("mouseup touchend touchcancel",this._mouseUpHandler).on("mousemove touchmove",this._mouseMoveHandler).on("mouseup touchend touchcancel",this._mouseUpHandler),this._moveData.$window[0].removeEventListener("keydown",this._keyDownHandler,!0),this._moveData.$window[0].addEventListener("keydown",this._keyDownHandler,!0)}_createElementInfos(e,t){return e.filter(i=>!!i.$container).map((i,s)=>{let r=i.$container,o={element:i,$element:r};return this._updateElementInfo(o),i===t&&(this._moveData.draggedElementInfo=o,this._moveData.$draggedElement=r),o})}_updateElementInfo(e){let t=e.$element,i=C.offsetBounds(t),s=new X(i.x-this._moveData.containerBounds.x,i.y-this._moveData.containerBounds.y);h().extend(e,{position:s,bounds:i})}_updateElementInfos(){this._moveData.elementInfos.forEach(e=>this._updateElementInfo(e))}cancel(){this._moveData&&(this._cleanup(),this._restoreStyles(),this._moveData=null,this._cancel())}_restoreStyles(){this._moveData.$clone&&this._moveData.$clone.remove(),this._moveData.$draggedElement.removeClass("dragged releasing"),this._moveData.$container.removeClass("dragging-element")}_onMouseMove(e){Ve.fixTouchEvent(e),this._updateOffsets(),this._moveData.currentCursorPosition=new X(e.pageX-this._moveData.containerBounds.x,e.pageY-this._moveData.containerBounds.y);let t=this._moveData.currentCursorPosition.subtract(this._moveData.startCursorPosition);if(!this._moveData.moving){if(Math.abs(t.x)<this.mouseMoveThreshold&&Math.abs(t.y)<this.mouseMoveThreshold)return;this._moveData.moving=!0,this._onFirstMouseMove()}this._moveData.$clone||(this._moveData.cloneBounds=C.offsetBounds(this._moveData.$draggedElement),this._moveData.cloneStartOffset=this._moveData.cloneBounds.point(),this._append$Clone(),this._moveData.$draggedElement.addClass("dragged")),this._moveData.cloneBounds=this._moveData.cloneBounds.moveTo(this._moveData.cloneStartOffset.add(t));let i=this._calculateScale();this._moveData.$clone.css({top:this._moveData.cloneBounds.y,left:this._moveData.cloneBounds.x,"--dragging-scale":i,"transform-origin":this._moveData.cursorDistance.left+"px "+this._moveData.cursorDistance.top+"px"}),this._moveData.containerBounds.intersects(this._moveData.cloneBounds)&&this._drag(e)}_calculateScale(){let e=1;return this._moveData.cloneBounds.width>this.maxCloneSize&&(e=this.maxCloneSize/this._moveData.cloneBounds.width),this._moveData.cloneBounds.height>this.maxCloneSize&&(e=Math.min(this.maxCloneSize/this._moveData.cloneBounds.height,e)),e}_updateOffsets(){let e=C.offset(this._moveData.$container);if(!e.equals(this._moveData.containerBounds.point())){let t=e.subtract(this._moveData.containerBounds.point());this._moveData.containerBounds=this._moveData.containerBounds.translate(t),this._moveData.cloneStartOffset&&(this._moveData.cloneStartOffset=this._moveData.cloneStartOffset.add(t)),this._moveData.elementInfos.forEach(i=>{i.bounds=i.bounds.translate(t)})}}_drag(e){this.trigger("drag")}_onFirstMouseMove(){this._moveData.$container.addClass("dragging-element")}_append$Clone(){let e=this._moveData.$draggedElement.clone().addClass("dragged-clone").removeAttr("data-id").css("position","fixed").appendTo(this._moveData.session.$entryPoint);e.on("wheel",i=>this._moveData.$container.trigger(i));let t=this._moveData.$draggedElement.find("canvas:visible");e.find("canvas:visible").each((i,s)=>{try{s.getContext("2d").drawImage(t.get(i),0,0)}catch(r){h().log.isWarnEnabled()&&h().log.warn("Unable to clone canvas. Reason: ",r)}}),this._moveData.$clone=e,this._moveData.$cloneShadow=this._moveData.$clone.prependDiv("shadow").animate({opacity:1},{duration:250*this._animationDurationFactor})}_onMouseUp(e){Ve.fixTouchEvent(e),this._updateOffsets(),this._cleanup(),this._dragEnd(e).then(t=>this._moveToTarget(t).then(()=>t)).then(t=>{this._restoreStyles(),t.equals(this._moveData.draggedElementInfo.bounds)||this._moveEnd(),this._moveData=null,this._end()})}_onKeyDown(e){e.which===m.ESC&&(this.cancel(),e.stopPropagation())}_cleanup(){this._moveData.$window.off("mousemove touchmove",this._mouseMoveHandler).off("mouseup touchend touchcancel",this._mouseUpHandler),this._moveData.$window[0].removeEventListener("keydown",this._keyDownHandler,!0),h()("iframe").removeClass("dragging-in-progress")}_moveToTarget(e){if(!this._moveData.$clone)return h().resolvedPromise();let t=this._moveData.$draggedElement.scrollParents();t.on("scroll",this._releasingScrollHandler);let i=[];return this._moveData.$clone.addClass("releasing"),this._moveData.$draggedElement.addClass("releasing"),i.push(this._moveData.$clone.css("pointer-events","none").css("--dragging-scale","1").animate({top:e.y,left:e.x,width:e.width,height:e.height},{easing:"easeOutQuart",duration:500*this._animationDurationFactor}).promise()),i.push(this._moveData.$cloneShadow.stop(!0).animate({opacity:0},{duration:500*this._animationDurationFactor}).promise()),h().promiseAll(i).then(()=>{t.off("scroll",this._releasingScrollHandler)})}_onReleasingScroll(e){this._moveData.elementInfos.forEach(t=>t.$element.stop(!0,!0)),this._moveData.$cloneShadow.stop(!0,!0),this._moveData.$clone.stop(!0,!0)}_dragEnd(e){let t=this._moveData.draggedElementInfo;return h().resolvedPromise(new te(t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height))}_moveEnd(){this.trigger("moveEnd")}_end(){this.trigger("end")}_cancel(){this.trigger("cancel")}}const Re={_deferred:h().Deferred(),loadingComplete:!0,bootstrap(n){return n=n||Re.autoDetectFonts(),n.length===0?(Re.loadingComplete=!0,h().resolvedPromise()):(Re.loadingComplete=!1,Re.preload({fonts:n,onComplete:(e,t)=>{!e&&t&&t.length&&h().log.warn(`Timeout occurred while pre-loading the following fonts:
- `+t.join(`
- `)+`
Rendering will now continue, but font measurements may be inaccurate. To prevent unnecessary startup delays and layout problems, check the @font-face definitions and the referenced "src" URLs or programmatically add additional font-specific characters to TEST_STRING before calling app.init().`),Re.loadingComplete=!0,Re._deferred.resolve()}}),h().resolvedPromise())},preloader(){return Re._deferred.promise()},TEST_FONTS:"monospace",TEST_STRING:"ABC abc 123 .,_ LlIi1 oO0 !#@ ",TEST_TIMEOUT:12*1e3,preload(n){n=n||{fonts:null};let e=p.ensure(n.fonts);if(!n.onComplete)return;let t=[];if(e.forEach(d=>{if(typeof d=="string"){let y=_.splitMax(d,"|",3).map(v=>v.trim());d={family:y[0],style:y[1],testString:y[2]}}d.family=d.family||"",d.style=d.style||"",d.testString=d.testString||n.testString||Re.TEST_STRING;let c=d.testFonts||n.testFonts||Re.TEST_FONTS,f=h()("body").appendDiv("font-preloader").text(d.testString).css("display","block").css("visibility","hidden").css("position","absolute").css("top",0).css("left",0).css("width","auto").css("height","auto").css("margin",0).css("padding",0).css("white-space","nowrap").css("line-height","normal").css("font-variant","normal").css("font-size","20em").css("font-family",c),g=Re.measureSize(f);if(f.data("original-size",g),f.data("font-family",d.family),f.css("font-family","'"+d.family+"',"+c),d.style){let y=(f.attr("style")||"").trim(),v=(y.substr(-1)===";"?"":";")+(y?" ":"");f.attr("style",y+v+d.style)}Re.measureSize(f)!==g?f.remove():t.push(f)}),t.length===0){a(!0);return}let i=a,s=u.nvl(n.timeout,Re.TEST_TIMEOUT),r,o;s&&s>=0&&(o=setTimeout(()=>{clearTimeout(r),a(!1)},s),i=()=>{clearTimeout(o),a(!0)}),l(50,i);function l(d,c){let f=t.length;for(;f--;){let g=t[f];Re.measureSize(g)!==g.data("original-size")&&(t.splice(f,1),g.remove())}if(t.length===0){c(!0);return}r=setTimeout(()=>{d<1e3&&(d=d*1.2),l(d,c)},d)}function a(d){n.onComplete(d,t.map(c=>c.data("font-family")))}},measureSize(n){let e=C.size(n,{exact:!0});return e.width+"x"+e.height},autoDetectFonts(){let n=[],e=document.styleSheets;for(let t=0;t<e.length;t++){let i=e[t],s;try{s=i.cssRules}catch{h().log.info("Skipped automatic font detection for style sheet "+i.href+' (access blocked by browser). Use the bootstrap argument "fonts" to manually list fonts to pre-load.');continue}for(let r=0;r<i.cssRules.length;r++){let o=i.cssRules[r];if(o.type===window.CSSRule.FONT_FACE_RULE){let l=o.style,a=l.getPropertyValue("font-family"),d=l.getPropertyValue("font-weight"),c=l.getPropertyValue("font-style"),f=l.getPropertyValue("font-variant"),g=l.getPropertyValue("font-stretch");if(a){a=a.replace(/^["']|["']$/g,"");let y=[];d&&d!=="normal"&&y.push("font-weight:"+d),c&&c!=="normal"&&y.push("font-style:"+c),f&&f!=="normal"&&y.push("font-variant:"+f),g&&g!=="normal"&&y.push("font-stretch:"+g);let v={family:a};y.length&&(v.style=y.join(";")),n.push(v)}}}}return n}},q={TABLE_SORT_ASC:"font:↑",TABLE_SORT_DESC:"font:↓",EXCLAMATION_MARK_BOLD:"font:",EXCLAMATION_MARK_CIRCLE:"font:",INFO:"font:",CALENDAR:"font:",FILE:"font:",CLOCK:"font:",CHECKED_BOLD:"font:",GROUP:"font:",GROUP_PLUS:"font:",ANGLE_DOUBLE_LEFT:"font:",ANGLE_DOUBLE_RIGHT:"font:",ANGLE_LEFT:"font:",ANGLE_RIGHT:"font:",ANGLE_DOWN:"font:",ANGLE_UP:"font:",LONG_ARROW_DOWN:"font:",LONG_ARROW_UP:"font:",LONG_ARROW_DOWN_PLUS:"font:",LONG_ARROW_UP_PLUS:"font:",MINUS:"font:",PLUS:"font:",LIST:"font:",TARGET:"font:",WORLD:"font:",CHART:"font:",GEAR:"font:",STAR:"font:",STAR_MARKED:"font:",STAR_BOLD:"font:",STAR_SOLID:"font:",PERSON_SOLID:"font:",SEARCH:"font:",FOLDER:"font:",SUM:"font:",AVG:"font:",MAX:"font:",MAX_BOLD:"font:",MIN:"font:",MIN_BOLD:"font:",EXPAND_ALL:"font:",COLLAPSE_ALL:"font:",COLLAPSE:"font:",ELLIPSIS_V:"font:",SLIPPERY:"font:",REMOVE:"font:",REMOVE_BOLD:"font:",PENCIL:"font:",PENCIL_UNDERLINE_SOLID:"font:",ROTATE_LEFT:"font:",ROTATE_RIGHT:"font:",HOURGLASS:"font:",DIAGRAM_AREA:"font:",DIAGRAM_BAR:"font:",DIAGRAM_BARS_HORIZONTAL:"font:",DIAGRAM_BARS_VERTICAL:"font:",DIAGRAM_DOUGHNUT:"font:",DIAGRAM_LINE:"font:",DIAGRAM_LINE_ANGULAR:"font:",DIAGRAM_LINE_SMOOTH:"font:",DIAGRAM_PIE:"font:",DIAGRAM_RADAR:"font:",DIAGRAM_SCATTER:"font:",OPTIMIZE_WIDTH:"font:",OPTIMIZE_WIDTHS:"font:",CHEVRON_LEFT_BOLD:"font:",CHEVRON_RIGHT_BOLD:"font:",CHEVRON_UP_BOLD:"font:",CHEVRON_DOWN_BOLD:"font:",ARROW_RIGHT_BOLD:"font:",PLUS_BOLD:"font:",MINUS_BOLD:"font:",SQUARE_BOLD:"font:",CARET_DOWN:"font:",CARET_UP:"font:",CARET_LEFT:"font:",CARET_RIGHT:"font:",ANGLE_LEFT_BOLD:"font:",ANGLE_RIGHT_BOLD:"font:",ANGLE_UP_BOLD:"font:",ANGLE_DOWN_BOLD:"font:",CIRCLE_BOLD:"font:",LONG_ARROW_DOWN_BOLD:"font:",LONG_ARROW_UP_BOLD:"font:",LONG_ARROW_LEFT_BOLD:"font:",LONG_ARROW_RIGHT_BOLD:"font:",ICON_ID_REGEX:/^\${iconId:([^}]+)}$/,parseIconId(n){let e=new Di;if(_.startsWith(n,"font:"))if(e.iconType=Di.IconType.FONT_ICON,n=n.substring(5),_.countCodePoints(n)===1)e.font=Di.DEFAULT_FONT,e.iconCharacter=n;else{let t=n.split(" ");e.font=t[0],e.iconCharacter=t[1]}else e.iconType=Di.IconType.BITMAP,e.iconUrl=n;return e},resolveIconId(n){let e=q.ICON_ID_REGEX.exec(n);if(e){let i=e[1].split(".");i.length===1?n=q[i[0]]:i.length===2?n=window[i[0]]?.icons?.[i[1]]:h().log.warn("Invalid iconId: "+n)}return n},resolveIconProperty(n,e){e=e||"iconId";let t=n[e],i=q.resolveIconId(t);i!==t&&(n[e]=i)},resolveIconProperties(n,e){p.ensure(e).forEach(t=>{q.resolveIconProperty(n,t)})}},yt={applyInfo(n,e,t){if(!n||(e=e||n.$container,!e)||(t=t||n.session,!t?.inspector))return;let i=n.modelClass;!i&&typeof n.objectType=="string"&&(i=n.objectType);let s=null;n.buildUuidPath?s=n.buildUuidPath():s=n.classId||n.uuid,e.toggleAttr("data-modelclass",!!i,i),e.toggleAttr("data-uuid",!!s,s),e.toggleAttr("data-id",!!n.id,n.id)}},ee={localesMap:{},bootstrap(n){return(n?h().ajaxJson(n):h().resolvedPromise([])).then(ee._handleBootstrapResponse.bind(this,n))},_handleBootstrapResponse(n,e){G.handleJsonError(n,e),ee.init(e)},init(n){n.forEach(e=>{ee.localesMap[e.languageTag]=new Dt(e)})},_get(n){return ee.localesMap[n]},has(n,e){return e=u.nvl(e,!1),e?!!ee._get(n):!!ee.get(n)},get(n){let e;return de.createOrderedLanguageTags(n).some(i=>(e=ee._get(i),!!e),this),e||null},getNavigatorLanguage(){return navigator.language||navigator.userLanguage},getNavigatorLocale(){let n=ee.getNavigatorLanguage();if(!n)return h().log.warn("Browser returned no language. Using default locale."),new Dt;let e=ee.get(n);if(e)return e;h().log.isInfoEnabled()&&h().log.info("Locale for languageTag "+n+" not found. Trying to load best match.");let t=ee.splitLanguageTag(n)[0];return e=ee.findFirstForLanguage(t),e||(h().log.isInfoEnabled()&&h().log.info("Still no matching locale for languageTag "+n+" found. Using default locale."),new Dt)},getAll(){return b.values(ee.localesMap)},getAllLanguageTags(){return Object.keys(ee.localesMap)},findFirstForLanguage(n){return u.assertParameter("language",n),p.find(ee.getAll(),e=>e.language===n,this)},splitLanguageTag(n){return n?n.split("-"):[]}};class De{objectType;onInputFieldPaste;target;$textInputField;constructor(e){e=e||{},u.assertValue(e.target,"target is mandatory"),this.$textInputField=null,this.onInputFieldPaste=this._onInputFieldPaste.bind(this),this.target=null,h().extend(this,e)}install(e){this.uninstall(),!(!e||!e.is("input:text")&&!e.is("textarea"))&&e&&(this.$textInputField=e,this.$textInputField.on("paste",this.onInputFieldPaste))}uninstall(){this.$textInputField&&this.$textInputField.off("paste",this.onInputFieldPaste)}render(){if(!this.$textInputField||b.isNullOrUndefined(this.target.maxLength))return;this.$textInputField.attr("maxlength",this.target.maxLength);let e=this.$textInputField.val();e.length>this.target.maxLength&&this.$textInputField.val(e.slice(0,this.target.maxLength)),this.target.rendering||this.target.parseAndSetValue(this.target._readDisplayText())}_onInputFieldPaste(e){if(!this.$textInputField||b.isNullOrUndefined(this.target.maxLength))return;let i=this.$textInputField.val().length-this._getSelectionSize();this._getClipboardData(e,s=>{s&&i+s.length>this.target.maxLength&&this._showNotification("ui.PastedTextTooLong")})}_getSelectionSize(){let e=u.nvl(this.$textInputField[0].selectionStart,null),t=u.nvl(this.$textInputField[0].selectionEnd,null);return e===null||t===null?0:t-e}_getClipboardData(e,t){let i=e.originalEvent.clipboardData||this.target.$container.window(!0).clipboardData;if(i){if(i.items&&i.items.length){let s=p.find(i.items,r=>r.type==="text/plain");s&&s.getAsString(t);return}i.getData&&t(i.getData("Text"))}}_showNotification(e){u.create(_i,{parent:this.target,severity:E.Severity.WARNING,message:this.target.session.text(e)}).show()}}var W;(function(n){n.TRACE="trace",n.DEBUG="debug",n.INFO="info",n.WARN="warn",n.ERROR="error",n.FATAL="fatal"})(W||(W={}));const ie={_appendersToAdd:[],DEFAULT_LEVEL:W.TRACE,initialized:!1,showStackTraces:!0,bootstrap(n){let e=new wt,t=e.getParameter("logging"),i=e.getParameter("logLevel");n=u.nvl(n,{});let s=!!(n.enabled||t),r=!!(n.showPopup||t),o=_.nvl(n.resourceUrl);return h().log=new He,s?window.log4javascript?(ie.initLog4Javascript(i,r),h().resolvedPromise()):h().injectScript(o+"log4javascript-1.4.9/log4javascript.js").done(ie.initLog4Javascript.bind(this,i,r)):h().resolvedPromise()},initLog4Javascript(n,e){n=u.nvl(n,ie.DEFAULT_LEVEL),log4javascript.setShowStackTraces(ie.showStackTraces);let t=log4javascript.getDefaultLogger();t.setLevel(ie.parseLevel(n)),h().log=t,ie.initialized=!0,e?t.getEffectiveAppenders().forEach(i=>{i.setUseDocumentWrite(!1)}):t.removeAllAppenders(),ie._appendersToAdd.forEach(i=>{ie.addAppender(i.factoryName,i.options)}),ie._appendersToAdd=[]},parseLevel(n){if(n)switch(n=n.toLowerCase(),n){case W.TRACE:return log4javascript.Level.TRACE;case W.DEBUG:return log4javascript.Level.DEBUG;case W.INFO:return log4javascript.Level.INFO;case W.WARN:return log4javascript.Level.WARN;case W.ERROR:return log4javascript.Level.ERROR;case W.FATAL:return log4javascript.Level.FATAL}},addAppender(n,e){if(!ie.initialized){ie._appendersToAdd.push({factoryName:n,options:e});return}let t=u.create(n,e);h().log.addAppender(t.create())}};class He{trace(){}debug(){}info(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._log(W.INFO,t)}warn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._log(W.WARN,t)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._log(W.ERROR,t)}fatal(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._log(W.FATAL,t)}isEnabledFor(){return!1}isTraceEnabled(){return!1}isDebugEnabled(){return!1}isInfoEnabled(){return!1}isWarnEnabled(){return!1}isErrorEnabled(){return!1}isFatalEnabled(){return!1}_log(e,t){let i=b.optProperty(window,"console");if(!i)return;let s;W.FATAL===e?s="error":s=e;let r=i[s];if(r){t.length>0&&(t[0]=this._formatTime()+" ["+e.toUpperCase()+"] "+t[0]);try{r.apply(i,t)}catch{}}}_formatTime(){let e=new Date;return _.padZeroLeft(e.getHours(),2)+":"+_.padZeroLeft(e.getMinutes(),2)+":"+_.padZeroLeft(e.getSeconds(),2)+"."+_.padZeroLeft(e.getMilliseconds(),3)}}const Ye="application/json",ai="application/javascript",so="application/zip",Xe={TEXT_PLAIN:"text/plain",TEXT_HTML:"text/html",TEXT_CSS:"text/css",TEXT_JAVASCRIPT:"text/javascript",IMAGE_PNG:"image/png",IMAGE_JPG:"image/jpg",IMAGE_JPEG:"image/jpeg",IMAGE_GIF:"image/gif",APPLICATION_JSON:Ye,APPLICATION_JAVASCRIPT:ai,APPLICATION_ZIP:so,JSON:Ye,JAVASCRIPT:ai,ZIP:so,isTextMimeType(n){return u.isOneOf(n,Xe.TEXT_PLAIN,Xe.TEXT_HTML,Xe.TEXT_CSS,Xe.TEXT_JAVASCRIPT,Xe.APPLICATION_JAVASCRIPT,Xe.APPLICATION_JSON)},isJavaScript(n){return u.isOneOf(n,Xe.TEXT_JAVASCRIPT,Xe.APPLICATION_JAVASCRIPT)}};function za(n,e){let t=n();return e&&(t.parent=e),t}const zs={modelMap:{},init(n){zs.modelMap=n},get:za,getExtension(n){return zs._get(n,"extension")},_get(n,e){let t=zs.modelMap[n];if(!t)throw new Error("No model map entry found for id '"+n+"'");if(u.nvl(t.type,"model")!==e)throw new Error("Model '"+n+"' is not of type '"+e+"'");return h().extend(!0,{},t)},extend(n,e){let t;return typeof n=="string"?t=zs.getExtension(n):typeof n=="function"?t=n():t=n,u.assertParameter("extensions",t.extensions),t.extensions.forEach(i=>{let s=u.assertParameter("operation",i.operation),r=u.assertParameter("target",i.target),o;if(r.root?o=e:o=b.findChildObjectByKey(e,"id",r.id),!o)throw new Error("Extension target not found: [extension: "+t.id+", target: "+r.id+"]");if(s==="appendTo")h().extend(o,i.extension);else if(s==="insert"){let l=r;o[l.property]=o[l.property]||[];let a=o[l.property],d=p.ensure(i.extension);zs._bindExtensionsToBeforeOrAfter(l,d);let c=zs._findExtensionIndex(l,a);p.insertAll(a,d,c)}}),e},_findExtensionIndex(n,e){let t=e.length;return n.before?(t=p.findIndex(e,i=>i.id===n.before||i.groupedWith===n.before),t===-1&&(t=e.length)):n.after&&(t=p.findIndex(e,i=>i.id===n.after||i.groupedWith===n.after),t===-1?t=e.length:t++),Se.isNumber(n.index)&&(t=n.index),t},_bindExtensionsToBeforeOrAfter(n,e){let t=n.before||n.after;t&&n.groupWithTarget&&e.forEach(i=>{i.groupedWith=t})}},Se={toBase62(n){if(n===void 0)return;let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(""),t=62,i="",s;for(;n>=1;)s=Math.floor(n/t),i=e[n-t*s]+i,n=s;return i},randomId(n){n=n||8;let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t="";for(let i=0;i<n;i++)t+=e[Math.floor(Math.random()*e.length)];return t},randomInt(n){return n=n||Number.MAX_SAFE_INTEGER,Math.floor(Math.random()*n)},_correlationCounter:1,correlationId(n){n=n||11;let e="abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ",t="23456789",i="";for(let s=0;s<n;s++)(s+1)%3===0?i+=t[Math.floor(Math.random()*t.length)]:i+=e[Math.floor(Math.random()*e.length)];return i+"/"+Se._correlationCounter++},round(n,e,t){if(n==null)return n;switch(t=t||0,n=Se.shiftDecimalPoint(n,t),e){case hi.UP:n<0?n=-Math.ceil(Math.abs(n)):n=Math.ceil(n);break;case hi.DOWN:n<0?n=-Math.floor(Math.abs(n)):n=Math.floor(n);break;case hi.CEILING:n=Math.ceil(n);break;case hi.FLOOR:n=Math.floor(n);break;case hi.HALF_DOWN:n<0?n=Math.round(n):n=-Math.round(-n);break;default:n<0?n=-Math.round(Math.abs(n)):n=Math.round(n)}return Se.shiftDecimalPoint(n,-t)},shiftDecimalPoint(n,e){if(n==null||!e)return n;let t=n?n<0?-1:1:0,i=Math.abs(e);n=Math.abs(n);let s=_.asString(n);s.indexOf("e")!==-1&&(s=n.toFixed(20));let r;return e<0?(s=_.repeat("0",i)+s,r=s.split(".",2),r.length===1?s=s.substr(0,s.length-i)+"."+s.substr(s.length-i):s=r[0].substr(0,r[0].length-i)+"."+r[0].substr(r[0].length-i)+r[1]):e>0&&(s+=_.repeat("0",i),r=s.split(".",2),r.length===2&&(s=r[0]+r[1].substr(0,i)+"."+r[1].substr(i))),s=s.replace(/^0*(\d)/g,"$1"),Number(s)*t},ensure(n){return b.isNullOrUndefined(n)?n:Number(n)},isNumber(n){return typeof n=="number"&&!isNaN(n)},isInteger(n){return Se.isNumber(n)&&isFinite(n)&&Math.floor(n)===n},_setCorrelationCounter(n){Se._correlationCounter=n}};var hi;(function(n){n.UP="UP",n.DOWN="DOWN",n.CEILING="CEILING",n.FLOOR="FLOOR",n.HALF_UP="HALF_UP",n.HALF_DOWN="HALF_DOWN",n.HALF_EVEN="HALF_EVEN",n.UNNECESSARY="UNNECESSARY"})(hi||(hi={}));const Jm=/\${const:([^}]*)}/,b={createMap(n){let e=Object.create(null);return n&&h().extend(e,n),e},copyProperties(n,e,t){let i;t=p.ensure(t);for(i in n)(t.length===0||t.indexOf(i)!==-1)&&(e[i]=n[i]);return e},createSingletonProxy(n){return new Proxy({},{get(e,t,i){if(!e.instance){if(t==="prototype")return;if(!Le.get()?.initialized)throw Error("Singleton cannot be created yet as the ObjectFactory is not initialized.");e.instance=u.create(n)}let s=e.instance[t];return typeof s=="function"?s.bind(e.instance):Reflect.get(e.instance,t,e.instance)},set(e,t,i){return Reflect.set(e.instance,t,i,e.instance)}})},copyOwnProperties(n,e,t){let i;t=p.ensure(t);for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t.length===0||t.indexOf(i)!==-1)&&(e[i]=n[i]);return e},countOwnProperties(n){if(!Object.getPrototypeOf(n))return Object.keys(n).length;let e=0;for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e},extractProperties(n,e,t){return t.forEach(i=>{e[i]===void 0&&(e[i]=n[i])}),e},someOwnProperties(n,e){return p.ensure(e).some(i=>Object.prototype.hasOwnProperty.call(n,i))},someProperties(n,e){return p.ensure(e).some(i=>i in n)},sortProperties(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t(n,e,new Map);function t(i,s,r){if(r.has(i))return r.get(i);if(b.isArray(i)){let o=[];return r.set(i,o),i.reduce((l,a)=>(s?l.push(t(a,s,r)):l.push(a),l),o)}if(b.isObject(i)){let o={};return r.set(i,o),Object.keys(i).sort((l,a)=>l.localeCompare(a)).reduce((l,a)=>(s?l[a]=t(i[a],s,r):l[a]=i[a],l),o)}return i}},valueCopy(n){if(b.isPojo(n)){const e={};for(const[t,i]of Object.entries(n))e[t]=b.valueCopy(i);return e}return Qm(n)},findChildObjectByKey(n,e,t){if(n==null||typeof n!="object")return null;if(n[e]===t)return n;let i;if(Array.isArray(n)){for(let s=0;s<n.length;s++)if(i=b.findChildObjectByKey(n[s],e,t),i)return i}for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)&&(i=b.findChildObjectByKey(n[s],e,t),i))return i;return null},getByPath(n,e){u.assertParameter("object",n,Object),u.assertParameter("path",e);const t="(\\w+)(?:\\[((?:\\w|\\.|-)+)\\])?";if(!new RegExp("^"+t+"(?:\\."+t+")*$").test(e))throw new Error('Malformed path expression "'+e+'"');const s=new RegExp(t);let r="",o=n;return e.split(/\.(?![^[]*])/).forEach(l=>{if(b.isNullOrUndefined(o))throw new Error('Value selected by matched path "'+r+'" is null or undefined. Further traversal not possible.');let a=s.exec(l),d=a[1],c=a[2],f=r.length===0?"root level of the provided object.":'matched path "'+r+'".';if(!o.hasOwnProperty(d))throw new Error('Property "'+d+'" does not exist at the '+f);let g=o[d];if(c){if(!Array.isArray(g))throw new Error('Path element "'+l+'" contains array filter but property "'+d+'" does not contain an array at the '+f);let y=g.filter(v=>v.id===c);if(y.length===0)throw new Error('No object found with id property "'+c+'" in array property "'+d+'" at the '+f);if(y.length>1)throw new Error('More than one object found with id property "'+c+'" in array property "'+d+'" at the '+f);o=y[0]}else o=g;r&&(r+="."),r+=l}),o},isPlainObject(n){return b.isObject(n)},isObject(n){return typeof n=="object"&&!b.isNullOrUndefined(n)&&!Array.isArray(n)},isPojo(n){if(!b.isObject(n))return!1;let e=Object.getPrototypeOf(n);return e===Object.prototype||e===null},optProperty(n){if(!n)return null;for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];let s=t.length;if(s===0)return n;if(s===1)return n[t[0]];for(let r=0;r<s-1;r++)if(n=n[t[r]],!n)return null;return n[t[s-1]]},isNumber(n){return n!==null&&!isNaN(n)&&isFinite(n)&&!isNaN(parseFloat(n))},isString(n){return typeof n=="string"||n instanceof String},isNullOrUndefined(n){return n==null},isFunction(n){return h().isFunction(n)},isNullOrUndefinedOrEmpty(n){return b.isNullOrUndefined(n)?!0:b.isEmpty(n)},isArray(n){return Array.isArray(n)},isPromise(n){return!!n&&typeof n=="object"&&typeof n.then=="function"},values(n,e){let t=[];if(n){typeof n.hasOwnProperty!="function"&&(e=!0);for(let i in n)(e||n.hasOwnProperty(i))&&t.push(n[i])}return t},keyByValue(n,e){return Object.keys(n)[b.values(n).indexOf(e)]},equals(n,e){return!!gf(n,e)},equalsRecursive(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=gf(n,e,!t);if(i!==null)return i;if(n instanceof Map&&e instanceof Map)return b.equalsMap(n,e);if(n instanceof Set&&e instanceof Set)return b.equalsSet(n,e,!0);if(b.isObject(n)&&b.isObject(e)){const s=Object.keys(n),r=Object.keys(e);if(!p.equalsIgnoreOrder(s,r))return!1;for(const o of s)if(!b.equalsRecursive(n[o],e[o]))return!1;return!0}if(b.isArray(n)&&b.isArray(e)){if(n.length!==e.length)return!1;for(let s=0;s<n.length;s++)if(!b.equalsRecursive(n[s],e[s]))return!1;return!0}return!1},propertiesEquals(n,e,t){let i,s;for(i=0;i<t.length;i++)if(s=t[i],!b.equals(n[s],e[s]))return!1;return!0},mandatoryFunction(n,e){let t=n[e];if(!t||typeof t!="function")throw new Error("Function '"+e+"' does not exist on object. Check if it has been renamed or moved. Object: "+n);return t},replacePrototypeFunction(n,e,t,i){let s=n.prototype,r;typeof e=="string"?r=e:r=e.name,b.mandatoryFunction(s,r),i&&(s[r+"Orig"]=s[r]),s[r]=t},argumentsToArray(n){return n?Array.prototype.slice.call(n):[]},forEachArgument(n,e){return b.argumentsToArray(n).forEach(e)},resolveConst(n,e){if(!b.isString(n))return n;let t=Jm.exec(n);if(t&&t.length===2){let i=t[1].split("."),s=e||window;for(let r=0;r<i.length;r++)if(s=s[i[r]],s===void 0)return window.console.log("Failed to resolve constant '"+t[1]+"', object is undefined"),n;return s}return n},resolveConstProperty(n,e){u.assertProperty(e,"property"),u.assertProperty(e,"constType");let t=n[e.property],i=b.resolveConst(t,e.constType);t!==i&&(n[e.property]=i)},resolveConstProperties(n,e){p.ensure(e).forEach(t=>{b.resolveConstProperty(n,t)})},removeEmptyProperties(n){if(b.isNullOrUndefined(n))return n;if(!b.isObject(n))throw new Error("Not an object: "+n);const e=n instanceof se?t=>{n[t]=void 0}:t=>delete n[t];return Object.keys(n).forEach(t=>{b.isNullOrUndefinedOrEmpty(n[t])&&e(t)}),n},isEmpty(n){if(b.isNullOrUndefined(n))return!0;if(b.isArray(n))return p.empty(n);if(b.isObject(n))return n instanceof Date?!1:n instanceof Map||n instanceof Set?n.size===0:Object.keys(n).length===0},isSameOrExtendsClass(n,e){return typeof n!="function"||typeof e!="function"?!1:n===e||e.isPrototypeOf(n)},ensureValidKey(n){return n===void 0?"undefined":b.isString(n)?n:JSON.stringify(n)},getOrSetIfAbsent(n,e,t){let i=n.get(e);return b.isNullOrUndefined(i)&&(i=t(e),b.isNullOrUndefined(i)||n.set(e,i)),i},equalsSet(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return n===e?!0:!n||!e||n.size!==e.size?!1:_f(n,e,t?b.equalsRecursive:b.equals)},equalsMap(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(n===e)return!0;if(!n||!e||n.size!==e.size)return!1;const i=t?e_:Zm;return _f(n.entries(),e.entries(),i)}};function Qm(n){if(!n)return n;if(b.isArray(n))return n.map(e=>b.valueCopy(e));if(n instanceof Date)return new Date(n.getTime());if(n instanceof Map){const e=new Map;for(const[t,i]of n)e.set(b.valueCopy(t),b.valueCopy(i));return e}if(n instanceof Set){const e=new Set;for(const t of n)e.add(b.valueCopy(t));return e}if(!(n instanceof I)){const e=n.clone;if(b.isFunction(e))return e.call(n)}return n}function gf(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n===e?!0:mf(n)!==mf(e)?!1:n instanceof Date?S.equals(n,e):b.isArray(n)&&!n.length&&!e.length||(n instanceof Map||n instanceof Set)&&!n.size&&!e.size?!0:t&&b.isFunction(n?.equals)&&b.isFunction(e?.equals)?n.equals(e):null}function Zm(n,e){const t=n[0],i=n[1],s=e[0],r=e[1];return b.equals(t,s)&&b.equals(i,r)}function e_(n,e){const t=n[0],i=n[1],s=e[0],r=e[1];return b.equalsRecursive(t,s)&&b.equalsRecursive(i,r)}function mf(n){return b.isNullOrUndefined(n)?null:Object.getPrototypeOf(n)}function _f(n,e,t){const i=Array.from(e);for(const s of n){const r=p.findIndex(i,o=>t(s,o));if(r<0)return!1;i.splice(r,1)}return!0}class bf{results;error;items;currentItem;aborted;constructor(e){this.results=[],this.error=null,this.items=e,this.currentItem=0,this.aborted=!1}hasNext(){return this.error||this.aborted?!1:this.currentItem<this.items.length}next(){var e=this;let t=this.currentItem;return this.createPromise().done(function(){for(var i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];e._addResults.apply(e,[t,s])}).fail((function(){this.error=arguments.length>0?arguments:new Error("Promise execution failed")}).bind(this))}createPromise(){if(this.currentItem>=this.items.length)throw new Error("items out of bounds");let e=this._createPromise();return this.currentItem++,e}_createPromise(){return this.items[this.currentItem]()}_addResults(e,t){t.length===0?t=void 0:t.length===1&&(t=t[0]),this.results[e]=t}abort(){this.aborted=!0}}const yf={oneByOne(n){let e=h().Deferred();return s(n),e.promise();function t(){setTimeout(s.bind(this,n))}function i(){e.reject.apply(e,n.error)}function s(r){r.hasNext()?r.next().done(t).fail(i):e.resolve.apply(e,r.results)}},groupwise(n,e){let t=h().Deferred();return r(e),t.promise();function i(){setTimeout(r.bind(this,e))}function s(){t.reject.apply(t,e.error)}function r(o){if(o.hasNext()){let l=[];for(;l.length<n&&o.hasNext();)l.push(o.next());h().promiseAll(l,!0).done(i).fail(s)}else t.resolve.apply(t,o.results)}},parallel(n,e,t){t=t||0;let i=h().Deferred(),s=0;return l(e),i.promise();function r(){s--,setTimeout(l.bind(this,e),t)}function o(){i.reject.apply(i,e.error)}function l(a){if(i.state()==="pending"){for(;a.hasNext()&&s<n;)s++,a.next().done(r).fail(o);s===0&&i.resolve.apply(i,[a.results])}}}};class U{from;to;constructor(e,t){this.from=e,this.to=t}equals(e){return this.from===e.from&&this.to===e.to}subtract(e){if(e.size()===0)return[new U(this.from,this.to)];if(this.from>=e.from&&this.to<=e.to)return[new U(0,0)];if(e.from>=this.from&&e.to<=this.to){let t=new U(this.from,e.from),i=new U(e.to,this.to);return t.size()===0?[i]:i.size()===0?[t]:[t,i]}return e.from>this.from&&e.from<this.to?[new U(this.from,e.from)]:this.from>e.from&&this.from<e.to?[new U(e.to,this.to)]:[new U(this.from,this.to)]}subtractAll(e){let t=e.shift(),i=[this],s=[];for(;t;)i.forEach(r.bind(t)),i=s,s=[],t=e.shift();i=i.filter(o=>o.size()>0),i.length===0&&i.push(new U(0,0));function r(o){p.pushAll(s,o.subtract(t))}return i}shrink(e){return e.size()===0?new U(this.from,this.to):this.from>=e.from&&this.to<=e.to?new U(0,0):e.from>=this.from&&e.to<=this.to?new U(this.from,e.to):e.from>=this.from&&e.from<this.to?new U(this.from,e.from):this.from>e.from&&this.from<e.to?new U(e.to,this.to):e.to<this.from?new U(this.from-e.size()-1,this.to-e.size()-1):new U(this.from,this.to)}union(e){if(this.to<e.from||e.to<this.from){let t=new U(this.from,this.to),i=new U(e.from,e.to);return t.size()===0?[i]:i.size()===0?[t]:[t,i]}return[new U(Math.min(this.from,e.from),Math.max(this.to,e.to))]}add(e){if(this.to<e.from||e.to<this.from){let t=new U(this.from,this.to),i=new U(e.from,e.to);if(t.size()===0)return i;if(i.size()===0)return t;throw new Error("Range to add has to border on the existing range. "+this+", "+e)}return new U(Math.min(this.from,e.from),Math.max(this.to,e.to))}intersect(e){return this.to<=e.from||e.to<=this.from?new U(0,0):new U(Math.max(this.from,e.from),Math.min(this.to,e.to))}size(){return this.to-this.from}contains(e){return this.from<=e&&e<this.to}toString(){return`Range {from: ${this.from}, to: ${this.to}}`}}class Me{objectType;modes;boundaries;useOverlay;$container;$window;$resizableS;$resizableE;$resizableSE;$resizableW;$resizableSW;$resizableN;$resizableNW;$resizableNE;$resizingOverlay;_context;_mouseDownHandler;_mouseUpHandler;_mouseMoveHandler;_keyDownHandler;_resizeHandler;constructor(){this._mouseDownHandler=this._onMouseDown.bind(this),this._mouseUpHandler=this._onMouseUp.bind(this),this._mouseMoveHandler=this._onMouseMove.bind(this),this._keyDownHandler=this._onKeyDown.bind(this),this._resizeHandler=this._resize.bind(this)}static MODES={SOUTH:"s",EAST:"e",WEST:"w",NORTH:"n"};init(e){u.assertParameter("model",e),u.assertParameter("$container",e.$container),this.$container=e.$container,this.$window=e.$container.window(),this.useOverlay=u.nvl(e.useOverlay,!1),this.$container.addClass("resizable"),this._appendResizeHandles(),this.setModes(e.modes),this.setBoundaries(e.boundaries),this._installRemoveHandler()}setModes(e){let t=e||[Me.MODES.SOUTH,Me.MODES.EAST,Me.MODES.WEST,Me.MODES.NORTH];p.equals(t,this.modes)||(this.modes=t,this._calculateResizeHandlersVisibility())}setBoundaries(e){this.boundaries=h().extend(new We,e),this._boundaryValueSet(this.boundaries.left)&&(this.boundaries.left-=this.$container.cssMarginLeft()),this._boundaryValueSet(this.boundaries.right)&&(this.boundaries.right-=this.$container.cssMarginRight()),this._boundaryValueSet(this.boundaries.top)&&(this.boundaries.top-=this.$container.cssMarginTop()),this._boundaryValueSet(this.boundaries.bottom)&&(this.boundaries.bottom-=this.$container.cssMarginBottom())}_appendResizeHandles(){this.$resizableS=this._appendResizeHandle("s"),this.$resizableE=this._appendResizeHandle("e"),this.$resizableSE=this._appendResizeHandle("se"),this.$resizableW=this._appendResizeHandle("w"),this.$resizableSW=this._appendResizeHandle("sw"),this.$resizableN=this._appendResizeHandle("n"),this.$resizableNW=this._appendResizeHandle("nw"),this.$resizableNE=this._appendResizeHandle("ne")}_appendResizeHandle(e){return this.$container.appendDiv(`resizable-handle resizable-${e}`).data("edge",e).on("mousedown",this._mouseDownHandler)}_calculateResizeHandlersVisibility(){this.$resizableS.setVisible(this._hasMode(Me.MODES.SOUTH)),this.$resizableE.setVisible(this._hasMode(Me.MODES.EAST)),this.$resizableSE.setVisible(this._hasMode(Me.MODES.SOUTH)&&this._hasMode(Me.MODES.EAST)),this.$resizableW.setVisible(this._hasMode(Me.MODES.WEST)),this.$resizableSW.setVisible(this._hasMode(Me.MODES.SOUTH)&&this._hasMode(Me.MODES.WEST)),this.$resizableN.setVisible(this._hasMode(Me.MODES.NORTH)),this.$resizableNW.setVisible(this._hasMode(Me.MODES.NORTH)&&this._hasMode(Me.MODES.WEST)),this.$resizableNE.setVisible(this._hasMode(Me.MODES.NORTH)&&this._hasMode(Me.MODES.EAST))}_hasMode(e){return this.modes.some(t=>t===e)}_installRemoveHandler(){this.$container.on("remove",this.destroy.bind(this))}destroy(){this.$resizableS.remove(),this.$resizableE.remove(),this.$resizableSE.remove(),this.$resizableW.remove(),this.$resizableSW.remove(),this.$resizableN.remove(),this.$resizableNW.remove(),this.$resizableNE.remove(),this._cleanup()}_onMouseDown(e){if(e.which!==1||this._context)return;let t=this.$container,i=t.window(),s=h()(e.target),r=t.cssMinWidth(),o=t.cssMinHeight(),l=t.cssMaxWidth(),a=t.cssMaxHeight(),d=t.offsetParent(),c=C.bounds(t,{exact:!0}).translate(new X(d[0].scrollLeft,d[0].scrollTop));this._context={initialBounds:c,currentBounds:c.clone(),minBounds:new te(c.right()-r,c.bottom()-o,r,o),maxBounds:new te(Math.max(-t.cssMarginLeft(),c.right()-l),Math.max(-t.cssMarginTop(),c.bottom()-a),Math.min(i.width()-t[0].offsetLeft,l),Math.min(i.height()-t[0].offsetTop,a)),distance:[0,0],edge:s.data("edge"),mousedownEvent:e},this.useOverlay&&(this.$resizingOverlay=t.parent().appendDiv("resizing-overlay"),this.$resizingOverlay.css("border-radius",t.css("border-radius")),this.$resizingOverlay.css("border-color",t.css("--resizable-color")),C.setBounds(this.$resizingOverlay,c)),t.addClass("resizing"),this.$window.off("mouseup",this._mouseUpHandler).off("mousemove",this._mouseMoveHandler).on("mouseup",this._mouseUpHandler).on("mousemove",this._mouseMoveHandler).body().addClass(`${this._context.edge}-resize`),this.$window[0].removeEventListener("keydown",this._keyDownHandler,!0),this.$window[0].addEventListener("keydown",this._keyDownHandler,!0),h()("iframe").addClass("dragging-in-progress")}_onMouseUp(e){this.finish()}finish(){this._cleanup(),this._resizeEnd(),this._context=null}cancel(){this._context&&(this._context.currentBounds=this._context.initialBounds,this.finish())}_onKeyDown(e){e.which===m.ESC&&(this.cancel(),e.stopPropagation())}_cleanup(){this.$container.removeClass("resizing"),this.$resizingOverlay&&(this.$resizingOverlay.remove(),this.$resizingOverlay=null),this.$window.off("mouseup",this._mouseUpHandler).off("mousemove",this._mouseMoveHandler),this.$window[0].removeEventListener("keydown",this._keyDownHandler,!0),this._context&&this.$window.body().removeClass(`${this._context.edge}-resize`),h()("iframe").removeClass("dragging-in-progress")}_onMouseMove(e){let t=this._computeBounds(e);t&&this._resizeHandler(t)}_computeBounds(e){let t=this._context,i=t.initialBounds.clone(),s=this._calcDistance(t.mousedownEvent,e);return u.isOneOf(t.edge,"ne","e","se")?i.width=Math.max(t.minBounds.width,Math.min(t.maxBounds.width,t.initialBounds.width+s[0])):u.isOneOf(t.edge,"nw","w","sw")&&(i.x=Math.min(t.minBounds.x,Math.max(t.maxBounds.x,t.initialBounds.x+s[0])),i.width+=t.initialBounds.x-i.x),u.isOneOf(t.edge,"sw","s","se")?i.height=Math.max(t.minBounds.height,Math.min(t.maxBounds.height,t.initialBounds.height+s[1])):u.isOneOf(t.edge,"nw","n","ne")&&(i.y=Math.min(t.minBounds.y,Math.max(t.maxBounds.y,t.initialBounds.y+s[1])),i.height+=t.initialBounds.y-i.y),i}_resize(e){this._cropToBoundaries(e),!this._context.currentBounds.equals(e)&&(this._context.currentBounds=e,this.useOverlay?C.setBounds(this.$resizingOverlay,e):C.setBounds(this.$container,e),this.$container.trigger("resizeStep",{newBounds:e,initialBounds:this._context.initialBounds}))}_resizeEnd(){this._context.currentBounds.equals(this._context.initialBounds)||this.$container.trigger("resizeEnd",{newBounds:this._context.currentBounds,initialBounds:this._context.initialBounds})}_cropToBoundaries(e){this._boundaryValueSet(this.boundaries.left)&&e.x>this.boundaries.left&&(e.width-=this.boundaries.left-e.x,e.x=this.boundaries.left),this._boundaryValueSet(this.boundaries.right)&&e.x+e.width<this.boundaries.right&&(e.width=this.boundaries.right-e.x),this._boundaryValueSet(this.boundaries.top)&&e.y>this.boundaries.top&&(e.height-=this.boundaries.top-e.y,e.y=this.boundaries.top),this._boundaryValueSet(this.boundaries.bottom)&&e.y+e.height<this.boundaries.bottom&&(e.height=this.boundaries.bottom-e.y)}_boundaryValueSet(e){return e>0}_calcDistance(e,t){let i=t.pageX-e.pageX,s=t.pageY-e.pageY;return[i,s]}}class E{objectType;message;severity;iconId;code;children;deletable;uiState;constructor(e){if(this.message=null,this.severity=E.Severity.ERROR,this.iconId=null,this.code=0,this.children=null,this.deletable=!0,h().extend(this,e),typeof this.severity=="string"){let t=this.severity;this.severity=E.Severity[t.toUpperCase()]}e&&e.children&&Array.isArray(e.children)&&(this.children=e.children.map(t=>E.ensure(t)))}static Severity={OK:1,INFO:256,WARNING:65536,ERROR:16777216};static SEVERITY_CSS_CLASSES="error warning info ok";cssClass(){return E.cssClassForSeverity(this.severity)}isValid(){return this.severity===E.Severity.OK||this.severity===E.Severity.INFO}isError(){return this.severity===E.Severity.ERROR}isWarning(){return this.severity===E.Severity.WARNING}isInfo(){return this.severity===E.Severity.INFO}isOk(){return this.severity===E.Severity.OK}asFlatList(){return E.asFlatList(this)}clone(){let e=h().extend({},this);return new E(e)}equals(e){return!(e instanceof E)||!b.equalsRecursive(this.children,e.children)?!1:b.propertiesEquals(this,e,["severity","message","invalidDate","invalidTime"])}containsStatus(e){return this.containsStatusByPredicate(t=>t instanceof e)}containsStatusByPredicate(e){return this.asFlatList().some(e)}addStatus(e){this.hasChildren()?this.children.push(e):this.children=[e],this._updateProperties()}removeAllStatus(e){this.removeAllStatusByPredicate(t=>t instanceof e)}removeAllStatusByPredicate(e){this.hasChildren()&&(this.children.forEach(t=>{t.removeAllStatusByPredicate(e)}),this.children=this.children.filter(t=>t.deletable?!e(t):!0),this._updateProperties())}_updateProperties(){if(!this.hasChildren()){this.message=null,this.severity=E.Severity.OK,this.code=0;return}let e=this.asFlatList().sort((t,i)=>{return s(i)-s(t);function s(r){let o=1;return r instanceof di?o=4:r instanceof nn&&(o=2),o*r.severity}})[0];this.message=e.message,this.severity=e.severity,this.code=e.code}hasChildren(){return!!(this.children&&this.children.length>0)}ensureChildren(){if(b.isArray(this.children))return this.clone();let e=this,t=this.clone();return t.children=[e],t._updateProperties(),t}static clone(e){return e?e.clone():null}static cssClassForSeverity(e){let t,i=E.Severity;switch(e){case i.OK:t="ok";break;case i.INFO:t="info";break;case i.WARNING:t="warning";break;case i.ERROR:t="error";break}return t}static animateStatusMessage(e,t){if(_.endsWith(t,"...")){let i=e.makeSpan("ellipsis");for(let s=0;s<3;s++)i.append(e.makeSpan("animate-dot delay-"+s,"."));t=t.substring(0,t.length-3),e.empty().text(t).append(i)}else e.text(t)}static ok(e){return new E(E.ensureModel(e,E.Severity.OK))}static info(e){return new E(E.ensureModel(e,E.Severity.INFO))}static warning(e){return new E(E.ensureModel(e,E.Severity.WARNING))}static error(e){return new E(E.ensureModel(e,E.Severity.ERROR))}static ensureModel(e,t){return typeof e=="string"?e={message:e}:e=e||{},h().extend({},e,{severity:t})}static asFlatList(e){if(!e)return[];let t=[];return e.hasChildren()?(e.children.forEach(i=>{p.pushAll(t,E.asFlatList(i))}),t.sort((i,s)=>i instanceof ns?s instanceof ns?0:-1:s instanceof ns?1:0)):t.push(e),t}static classForName(e){return{Status:E,DefaultStatus:fr,NotificationBadgeStatus:ns,ParsingFailedStatus:di,ValidationFailedStatus:nn}[e]}static ensure(e){return!e||e instanceof E?e:(e.objectType||(e.objectType=E),u.create(e))}}class fr extends E{constructor(e){super(e)}static error(e){return new fr(E.ensureModel(e,E.Severity.ERROR))}static warning(e){return new fr(E.ensureModel(e,E.Severity.WARNING))}static info(e){return new fr(E.ensureModel(e,E.Severity.INFO))}}class ns extends E{constructor(e){super(h().extend(!0,{severity:E.Severity.INFO},e))}cssClass(){return _.join(" ",E.cssClassForSeverity(this.severity),"notification-badge")}clone(){let e=h().extend({},this);return new ns(e)}equals(e){return e instanceof ns?super.equals(e):!1}}class di extends E{constructor(e){super(e)}static error(e){return new di(E.ensureModel(e,E.Severity.ERROR))}}class nn extends E{constructor(e){super(e)}}class rl{tagName;cachedElement;constructor(e){this.tagName=e,this.cachedElement=null}get(){return this.cachedElement||(this.cachedElement=document.createElement(this.tagName)),this.cachedElement}}class Ua{cache;constructor(){this.cache=new rl("textarea")}encode(e,t){if(t=t||{},!e)return e;e=_.asString(e),e=e.replace(/<!--.*?--!?>/gs,""),t.removeFontIcons&&(e=e.replace(/<span\s[^>]*class="[^"]*font-icon[^"]*"[^>]*>[^<]*<\/span>/gmi,"")),e=this.removeAttributeValues(e),e=e.replace(/<br>|<br\/>|<\/p>|<p\/>|<\/div>|<\/li>|<\/tr>/gi,`
`),e=e.replace(/<\/td>/gi," "),e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),e=e.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,""),e=e.replace(/<[^\s>][^>]*>/gi,""),e=e.replace("‍",""),e=e.replace(/&#(\\d+);/gi,(s,r)=>String.fromCharCode(r)),e=e.replace(/^[ ]+/gm,""),e=e.replace(/[ ]+$/gm,""),t.compact&&(e=e.replace(/\n{3,}/gm,`
`)),t.trim&&(e=e.trim());let i=this.cache.get();return i.innerHTML=e,i.value}removeAttributeValues(e){let t=null,i=!1,s="";for(let r=0;r<e.length;r++){let o=e[r];if(t)if(o===t)t=null;else continue;else i&&(o==="'"||o==='"')?t=o:o==="<"&&e.length>r+1&&!/\s/.test(e[r+1])?i=!0:o===">"&&(i=!1);s+=o}return s}}class Ga{cache;constructor(){this.cache=new rl("div")}encode(e){if(!e)return e;let t=this.cache.get();return t.textContent=e,t.innerHTML}}let Ka=null,ja=null,t_=/\n/g,i_=/\r/g,s_=/^\s*$/;const _={nl2br(n,e){return n&&(n=_.asString(n),e=u.nvl(e,!0),e&&(n=_.encode(n)),n.replace(t_,"<br>").replace(i_,""))},insertAt(n,e,t){return n&&(n=_.asString(n),e=_.asString(e),e&&(typeof t=="number"||t instanceof Number)&&t>=0?n.substring(0,t)+e+n.substring(t):n)},hasText(n){return n==null||(n=_.asString(n),typeof n!="string"||n.length===0)?!1:!s_.test(n)},empty(n){return!_.hasText(n)},repeat(n,e){if(n==null)return n;if(typeof e!="number"||e<1)return"";let t="";for(let i=0;i<e;i++)t+=n;return t},padZeroLeft(n,e){let t=_.asString(n);return t==null||typeof e!="number"||e<1||t.length>=e?t:(_.repeat("0",e)+t).slice(-e)},contains(n,e){return n?n.indexOf(e)>-1:!1},startsWith(n,e){return b.isNullOrUndefined(n)||b.isNullOrUndefined(e)?!1:(n=_.asString(n),e=_.asString(e),n.startsWith(e))},endsWith(n,e){return b.isNullOrUndefined(n)||b.isNullOrUndefined(e)?!1:(n=_.asString(n),e=_.asString(e),n.endsWith(e))},count(n,e){return!n||e===void 0||e===null?0:(n=_.asString(n),e=_.asString(e),n.split(e).length-1)},encode(n){return Ka||(Ka=new Ga),Ka.encode(n)},plainText(n,e){return ja||(ja=new Ua),ja.encode(n,e)},join(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];let s=t;t[0]&&b.isArray(t[0])&&(s=t[0]),n=_.asString(n);let r="";for(let o=0;o<s.length;o++){let l=_.asString(s[o]);l&&(r&&n&&(r+=n),r+=l)}return r},box(n,e,t){n=_.asString(n),e=_.asString(e),t=_.asString(t);let i="";return _.hasText(e)&&(n&&(i+=n),i+=e,t&&(i+=t)),i},quote(n){return n==null?n:(n=_.asString(n),n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))},asString(n){return n==null||typeof n=="string"||n instanceof String?n:String(n)},nvl(n){if(arguments.length>1)throw new Error("strings.nvl only accepts one argument. Use scout.nvl if you need to handle multiple arguments");return u.nvl(n,"")},length(n){return n=_.asString(n),n?n.length:0},trim(n){return n=_.asString(n),n&&n.trim()},toUpperCase(n){return n=_.asString(n),n&&n.toUpperCase()},toLowerCase(n){return n=_.asString(n),n&&n.toLowerCase()},toUpperCaseFirstLetter(n){return n=_.asString(n),n&&n.substring(0,1).toUpperCase()+n.substring(1)},toLowerCaseFirstLetter(n){return n=_.asString(n),n&&n.substring(0,1).toLowerCase()+n.substring(1)},countCodePoints(n){return n.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},splitMax(n,e,t){if(n==null)return[];n=_.asString(n),e=_.asString(e),t=Number(t);let i=n.split(e);if(isNaN(t)||t<=0||t>=i.length)return i;let s=i.slice(0,t-1),r=i.slice(t-1).join(e);return s.push(r),s},nullIfEmpty(n){return _.empty(n)?null:n},equals(n,e,t){return n=_.nullIfEmpty(n),e=_.nullIfEmpty(e),!n&&!e?!0:!n||!e?!1:t?n.toLowerCase()===e.toLowerCase():n===e},equalsIgnoreCase(n,e){return _.equals(n,e,!0)},addPrefix(n,e){return n&&e?e+n:n},addSuffix(n,e){return n&&e?n+e:n},removePrefix(n,e){return _.startsWith(n,e)?n.substring(e.length):n},removeSuffix(n,e){return _.endsWith(n,e)?n.substring(0,n.length-e.length):n},truncateText(n,e,t){if(!n||!e||e<=0||(t||(t=o=>({width:(o||"").length})),n=_.asString(n).trim(),t(n).width<=e))return n;let s=n.length,r=0;for(;r+1<s;){let o=Math.round((s+r)/2);t(n.slice(0,o)+"...").width>e?s=o:r=o}return n.slice(0,r).trim()+"..."},parseBoolean(n){if(n=n?.toLowerCase(),n==="true")return!0;if(n==="false")return!1}},L={styleMap:{},element:null,get(n,e,t){let i=L.element;i||(i=window.document.createElement("div"),i.style.display="none",window.document.body.appendChild(i),L.element=i);let s=i.style.cssText;t=h().extend(!0,{},t,{display:""}),Object.keys(t).sort().forEach(y=>{i.style[y]=t[y]});let r=i.style.cssText;i.style.display="none";let o=i.style.cssText;i.style.cssText=s;let l=p.ensure(n),a=r?[...l,r]:l,d=L.styleMap[a.toString()];e=p.ensure(e);let c=e.map(y=>({name:y,nameCamelCase:y.replace(/-(.)/g,(v,D)=>D.toUpperCase())}));d||(d={},L.put(a.toString(),d));let f=c.filter(y=>!(y.nameCamelCase in d));if(f.length===0)return d;i.className=l[0];for(let y=1;y<l.length;y++){let v=i.children[0];v||(v=window.document.createElement("div"),v.style.display="none",i.appendChild(v)),i=v,i.className=l[y]}i.style.cssText=o;let g=window.getComputedStyle(i);f.forEach(y=>{d[y.nameCamelCase]=g[y.name]}),i.style.cssText=s,i=L.element;do i.className="",i=i.children[0];while(i);return d},getFirstOpaqueBackgroundColor(n){if(!n)return;let e=n.document(!0);for(;n&&n.length&&e!==n[0];){let t=n.css("background-color"),i=L.rgb(t);if(i&&i.alpha===1)return t;n=n.parent()}},getSize(n,e,t,i){let s=L.get(n,e)[t];return s==="auto"?i:h().pxToNumber(s)},put(n,e){L.styleMap[n]=e},clearCache(){L.styleMap={}},getCssColor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"backgroundColor",t=L.get(n,e)[e];return t==="unset"?null:t},RGB_BLACK:{red:0,green:0,blue:0},RGB_WHITE:{red:255,green:255,blue:255},rgb(n){if(!n)return;let e=n.replace(/\s/g,"").match(/^rgba?\((\d+),(\d+),(\d+),?(\d+(\.\d+)?)?/i);if(e!==null)return{red:parseInt(e[1],10),green:parseInt(e[2],10),blue:parseInt(e[3],10),alpha:parseFloat(u.nvl(e[4],1))}},hexToRgb(n){if(!n)return;let e=0,t=0,i=0,s=255;return(n.length===4||n.length===5)&&(e=parseInt("0x"+n[1]+n[1]),t=parseInt("0x"+n[2]+n[2]),i=parseInt("0x"+n[3]+n[3]),n.length===5&&(s=parseInt("0x"+n[4]+n[4]))),(n.length===7||n.length===9)&&(e=parseInt("0x"+n[1]+n[2]),t=parseInt("0x"+n[3]+n[4]),i=parseInt("0x"+n[5]+n[6]),n.length===9&&(s=parseInt("0x"+n[7]+n[8]))),s=+(s/255).toFixed(3),"rgba("+ +e+","+ +t+","+ +i+","+s+")"},rgbToHex(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!n)return null;const t=n.replace(/^rgba?\(|\s+|\)$/g,"").split(","),i=[];for(let s=0;s<t.length;s++){if(e&&s===3)continue;let r=parseFloat(t[s]);s===3&&(r=Math.round(r*255));let o=r.toString(16);o.length===1&&(o="0"+o),i[s]=o}return"#"+i.join("")},darkerColor(n,e){let t=L.rgb(n);if(t)return e=u.nvl(e,.2),L.mergeRgbColors(L.RGB_BLACK,e,t,1-e)},lighterColor(n,e){let t=L.rgb(n);if(t)return e=u.nvl(e,.2),L.mergeRgbColors(L.RGB_WHITE,e,t,1-e)},mergeRgbColors(n,e,t,i){let s,r;if(typeof n=="string"?s=L.rgb(n):s=n,typeof t=="string"?r=L.rgb(t):r=t,!(!s&&!r))return e=u.nvl(e,0),i=u.nvl(i,0),s||(s=L.RGB_BLACK,e=0),r||(r=L.RGB_BLACK,i=0),e===0&&i===0?"rgb(0,0,0)":"rgb("+Se.round((e*s.red+i*r.red)/(e+i))+","+Se.round((e*s.green+i*r.green)/(e+i))+","+Se.round((e*s.blue+i*r.blue)/(e+i))+")"},parseFontSpec(n){let e={};if(_.hasText(n)){let t=n.split(/[-_,/.;]/);for(let i=0;i<t.length;i++){let s=t[i].toUpperCase();s==="NULL"||s==="0"||s==="PLAIN"||(s==="BOLD"?e.bold=!0:s==="ITALIC"?e.italic=!0:/^\d+$/.test(s)?e.size=parseInt(s):s!=="NULL"&&(e.name=t[i]))}}return e},modelToCssColor(n){if(!n)return"";let e="";return/^[A-Fa-f0-9]{3}([A-Fa-f0-9]{3})?$/.test(n)?e="#"+n:/^[A-Za-z0-9().,%-]+$/.test(n)&&(e=n),e},legacyStyle(n,e,t){let i="";return i+=L.legacyForegroundColor(n,e,t),i+=L.legacyBackgroundColor(n,e,t),i+=L.legacyFont(n,e,t),i},legacyForegroundColor(n,e,t){t=t||"";let i="";if(n){let r=_.toLowerCaseFirstLetter(t+"ForegroundColor");i=L.modelToCssColor(n[r])}e&&e.css("color",i);let s="";return i&&(s+="color: "+i+"; "),s},legacyBackgroundColor(n,e,t){t=t||"";let i="";if(n){let r=_.toLowerCaseFirstLetter(t+"BackgroundColor");i=L.modelToCssColor(n[r])}e&&e.css("background-color",i);let s="";return i&&(s+="background-color: "+i+"; "),s},legacyFont(n,e,t){t=t||"";let i="",s="",r="",o="";if(n){let a=_.toLowerCaseFirstLetter(t+"Font"),d=L.parseFontSpec(n[a]);d.bold&&(i="bold"),d.italic&&(s="italic"),d.size&&(r=d.size+"pt"),d.name&&(o=d.name)}e&&e.css("font-weight",i).css("font-style",s).css("font-size",r).css("font-family",o);let l="";return i&&(l+="font-weight: "+i+"; "),s&&(l+="font-style: "+s+"; "),r&&(l+="font-size: "+r+"; "),o&&(l+="font-family: "+o+"; "),l},_getElement(){return L.element}};class nl{array;properties;comparator;constructor(){this.array=[],this.properties=b.createMap(),this.comparator=rt.ALPHANUMERIC}add(e){this.contains(e)||(this.array.push(e),this.array.sort((t,i)=>this.comparator.compare(t,i)),this.properties[e]=!0)}size(){return this.array.length}contains(e){return e in this.properties}last(){return this.array[this.array.length-1]}}class wt{baseUrlRaw;queryPartRaw;hashPartRaw;parameterMap;constructor(e){e===void 0&&(e=window.location.href);let t=/^([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/.exec(e||"");this.baseUrlRaw=t[1],this.queryPartRaw=t[2],this.hashPartRaw=t[3],this.parameterMap=wt._parse(this.queryPartRaw)}hasParameter(e){return this.parameterMap.hasOwnProperty(e)}getParameter(e){if(typeof e!="string")throw new Error("Illegal argument type: "+e);let t=this.parameterMap[e];return Array.isArray(t)?t.sort(wt._sorter):t}removeParameter(e){if(typeof e!="string")throw new Error("Illegal argument type: "+e);return delete this.parameterMap[e],this}setParameter(e,t){if(typeof e!="string")throw new Error("Illegal argument type: "+e);if(e!=="")return this.parameterMap[e]=t,this}addParameter(e,t){if(typeof e!="string")throw new Error("Illegal argument type: "+e);if(e!=="")return wt._addToMap(this.parameterMap,e,t),this}toString(e){let t=this.baseUrlRaw;if(Object.keys(this.parameterMap).length){e=e||{};let i=e.sorter||wt._sorter;if(e.alwaysFirst||e.alwaysLast){e.alwaysFirst=p.ensure(e.alwaysFirst),e.alwaysLast=p.ensure(e.alwaysLast);let r=i;i=(o,l)=>{let a=e.alwaysFirst.indexOf(o),d=e.alwaysFirst.indexOf(l),c=e.alwaysLast.indexOf(o),f=e.alwaysLast.indexOf(l);return a!==-1?d===-1?-1:a-d:d!==-1?1:c!==-1?f===-1?1:c-f:f!==-1?-1:r(o,l)}}let s=Object.keys(this.parameterMap).sort(i).map(r=>{let o=this.getParameter(r);return Array.isArray(o)?o.map((l,a)=>wt._formatQueryParam(r,o[a])).join("&"):wt._formatQueryParam(r,o)}).join("&");t+="?"+s}return this.hashPartRaw&&(t+="#"+this.hashPartRaw),t}clone(){return new wt(this.toString())}static _sorter(e,t){return e===null?-1:t===null?1:e.toString().localeCompare(t)}static _formatQueryParam(e,t){let i=encodeURIComponent(e);return t!=null&&(i+="="+encodeURIComponent(t)),i}static _addToMap(e,t,i){if(e===void 0)throw new Error("Argument 'map' must not be null");if(t===void 0)throw new Error("Argument 'key' must not be null");if(t in e){let s=e[t];Array.isArray(s)?s.push(i):e[t]=[s,i]}else e[t]=i}static _parse(e){let t=(e||"").replace(/\+/g," "),i=/([^&=]+)(=?)([^&]*)/g,s={},r,o,l;for(;r=i.exec(t);)o=decodeURIComponent(r[1]),l=decodeURIComponent(r[3]),l===""&&r[2]!=="="&&(l=null),wt._addToMap(s,o,l);return s}}const Us={returnTrue(){return!0},returnFalse(){return!1},outsideFilter(n){let e=n instanceof h()?n[0]:n;return function(){return this!==e&&!h().contains(e,this)}},notSameFilter(n){let e=n instanceof h()?n[0]:n;return function(){return this!==e}}};var ut;(function(n){n.LEFT="left",n.RIGHT="right",n.CENTER="center"})(ut||(ut={}));const Ct={sumSymbol:q.SUM,minSymbol:q.MIN_BOLD,avgSymbol:q.AVG,maxSymbol:q.MAX_BOLD,sumStart(){return null},sumStep(n,e){return e?(n||0)+e:n},sumFinish(n){return n},avgStart(){return{sum:0,count:0}},avgStep(n,e){return b.isNullOrUndefined(e)||(n.sum+=e,n.count+=1),n},avgFinish(n){return n.count?n.sum/n.count:null},minStart(){return null},minStep(n,e){return b.isNullOrUndefined(e)||(b.isNullOrUndefined(n)||e<n)&&(n=e),n},minFinish(n){return n},maxStart(){return null},maxStep(n,e){return b.isNullOrUndefined(e)||(b.isNullOrUndefined(n)||e>n)&&(n=e),n},maxFinish(n){return n}},he={getItem(n,e){if(n)try{return n.getItem(e)}catch(t){h().log.error('Error while reading "'+e+'" from web storage: '+t)}},getItemFromSessionStorage(n){try{return he.getItem(sessionStorage,n)}catch(e){h().log.error('Error while reading "'+n+'" from session storage: '+e)}},getItemFromLocalStorage(n){try{return he.getItem(localStorage,n)}catch(e){h().log.error('Error while reading "'+n+'" from local storage: '+e)}},setItem(n,e,t){if(n)try{return n.setItem(e,t)}catch(i){h().log.error('Error while storing "'+e+'" in web storage: '+i)}},setItemToSessionStorage(n,e){try{return he.setItem(sessionStorage,n,e)}catch(t){h().log.error('Error while storing "'+n+'" in session storage: '+t)}},setItemToLocalStorage(n,e){try{return he.setItem(localStorage,n,e)}catch(t){h().log.error('Error while storing "'+n+'" in local storage: '+t)}},removeItem(n,e){if(n)try{return n.removeItem(e)}catch(t){h().log.error('Error while removing "'+e+'" from web storage: '+t)}},removeItemFromSessionStorage(n){try{return he.removeItem(sessionStorage,n)}catch(e){h().log.error('Error while removing "'+n+'" from session storage: '+e)}},removeItemFromLocalStorage(n){try{return he.removeItem(localStorage,n)}catch(e){h().log.error('Error while removing "'+n+'" from local storage: '+e)}},clear(n){if(n)try{return n.clear()}catch(e){h().log.error("Error while clearing web storage: "+e)}},clearSessionStorage(){try{return he.clear(sessionStorage)}catch(n){h().log.error("Error while clearing session storage: "+n)}},clearLocalStorage(){try{return he.clear(localStorage)}catch(n){h().log.error("Error while clearing local storage: "+n)}}},ol={get(n,e){e=e||document;let t=n+"=",i=e.cookie.split(";");for(let s=0;s<i.length;s++){let r=i[s].trim();if(r.indexOf(t)===0)return r.substring(t.length)}return null},set(n,e,t,i){e=u.nvl(e,""),t=u.nvl(t,-1);let s=n+"="+e;if(t>-1){let r=new Date;r.setTime(r.getTime()+t*1e3),s+=";max-age="+t+";expires="+r}i&&(s+=";path="+i),document.cookie=s}};class gr{objectType;static SPEED_FACTOR_SLOW=1/20;static SPEED_FACTOR_MEDIUM=1/10;static SPEED_FACTOR_FAST=1/5;viewportWidth;viewportHeight;e;f;initialDelay;active;scroll;dx;dy;started;moved;_timeoutId;constructor(e){this.viewportWidth=0,this.viewportHeight=0,this.e=30,this.f=-30,this.initialDelay=500,this.active=()=>!0,this.scroll=(t,i)=>{},$.extend(this,e),this.dx=0,this.dy=0,this.started=!1,this.moved=!1,this._timeoutId=null}_tick(){if(!this.active())return;this.started&&(this.dx||this.dy)&&(this.scroll(this.dx,this.dy),this.moved=!0);let e=this.moved?16:this.initialDelay;this._timeoutId=setTimeout(()=>this._tick(),e)}start(){clearTimeout(this._timeoutId),this._tick(),this.started=!0}stop(){clearTimeout(this._timeoutId),this._timeoutId=null,this.started=!1,this.moved=!1,this.dx=0,this.dy=0}update(e){let t=this.e,i=this.f,s=Math.floor((t+i)/2),r=t,o=this.viewportWidth-t,l=t,a=this.viewportHeight-t;const d=gr.SPEED_FACTOR_SLOW,c=gr.SPEED_FACTOR_MEDIUM,f=gr.SPEED_FACTOR_FAST;let g=0,y=0,v=0,D=0;e.x<r?(v=-(r-e.x),g=e.x>s?d:e.x>i?c:f):e.x>o&&(v=e.x-o,g=e.x>this.viewportWidth-i?f:e.x>this.viewportWidth-s?c:d),e.y<l?(D=-(l-e.y),y=e.y>s?d:e.y>i?c:f):e.y>a&&(D=e.y-a,y=e.y>this.viewportHeight-i?f:e.y>this.viewportHeight-s?c:d);let k=Math.abs(v),V=Math.abs(D),Q=Math.max(k,V);if(Q===0){this.stop();return}let ve=1+Math.floor(k*g),Ze=1+Math.floor(V*y);this.dx=Math.sign(v)*ve,this.dy=Math.sign(D)*Ze,this.started||this.start(),!this.moved&&Q>t&&this.start()}}const ui={TYPE_NAME_DELIMITER:":",COMPONENT_DELIMITER:";",SIGNATURE_DELIMITER:"_-~SIG~-_",parse(n,e){if(_.empty(n))return null;if(_.contains(n,ui.TYPE_NAME_DELIMITER))return ui.fromQualified(n);const i=e?e():null;return ui.fromUnqualified(n,i)},fromUnqualified(n,e){if(_.empty(n))return null;const{id:t,signature:i}=n_(n),s=t.split(ui.COMPONENT_DELIMITER);return{typeName:e,value:t,elements:s,signature:i}},fromQualified(n){if(_.empty(n))return null;const{id:e,typeName:t}=r_(n);return ui.fromUnqualified(e,t)},toUnqualified(n){if(!n)return null;const e=n.value;return n.signature?e+ui.SIGNATURE_DELIMITER+n.signature:e},toQualified(n){if(!n)return null;const e=ui.toUnqualified(n);return n.typeName?n.typeName+ui.TYPE_NAME_DELIMITER+e:e}};function r_(n){if(!n)return{typeName:null,id:null};let e=n.indexOf(ui.TYPE_NAME_DELIMITER);return e<0?{typeName:null,id:n}:{typeName:n.substring(0,e),id:n.substring(e+ui.TYPE_NAME_DELIMITER.length)}}function n_(n){let e=n.lastIndexOf(ui.SIGNATURE_DELIMITER);return e<0?{id:n,signature:null}:{id:n.substring(0,e),signature:n.substring(e+ui.SIGNATURE_DELIMITER.length)}}function ue(n){return e=>class extends e{constructor(){super(...arguments),Reflect.set(this,"_type",n)}}}const Tt={TYPE_META_DATA_KEY:"scout.m.t",getFieldMetaData(n,e){if(!n||!e)return null;const t=Reflect.getMetadata(Tt.TYPE_META_DATA_KEY,n,e);return Tt.resolveFieldMetaData(t)},resolveFieldMetaData(n){return n?typeof n=="string"||typeof n=="function"?{...Tt.getObjectTypeInfo(n),args:[]}:{...Tt.getObjectTypeInfo(n.objectType),args:n.typeArgs.map(e=>Tt.resolveFieldMetaData(e))}:null},getObjectTypeInfo(n){if(typeof n=="string")return{type:Tt.resolveToConstructor(n),typeName:n};const e=Le.get().getObjectType(n);return{type:n,typeName:e}},resolveToConstructor(n){if(typeof n=="string"){const e=mt.get().toConstructor(n);if(e)return e}return ni.resolveType(n,{variantLenient:!0})},getArrayValueType(n){return n?.args?.[0]},chooseDataObjectType(n,e){const t=Tt.detectDataObjectClass(n),i=e?.type;return i&&t?(Tt.assertTypesCompatible(t,i),t):t||i},detectDataObjectClass(n){if(n instanceof se)return n.constructor;const e=n._type;if(typeof e=="string"){const t=mt.get().toConstructor(e);if(t)return t}return Tt.resolveToConstructor(n.objectType)},assertTypesCompatible(n,e){if(n&&e&&n!==e&&!e.isPrototypeOf(n)){const t=Le.get().getObjectType(n)||n,i=Le.get().getObjectType(e)||e;throw new Error(`Incompatible types: actual type '${t}' is not assignable to declared type '${i}'.`)}}};class qa{canSerialize(e,t){return e instanceof Date}serialize(e,t,i){return S.toJsonDate(e)}canDeserialize(e,t){return Date===t?.type&&typeof e=="string"}deserialize(e,t,i){return S.parseJsonDate(e)}}class os{canSerialize(e,t){return e instanceof Map}serialize(e,t,i){const s={},r=os.getMapKeyType(t),o=os.getMapValueType(t);for(const[l,a]of e.entries()){const d=this._throwIfInvalidKey(i.serialize(l,r));s[d]=i.serialize(a,o)}return s}canDeserialize(e,t){return t?.typeName==="Record"||Map===t?.type&&(!e||b.isPojo(e))}deserialize(e,t,i){const s=os.getMapKeyType(t),r=os.getMapValueType(t);return t?.typeName==="Record"?this._deserializeRecord(e,s,r,i):this._deserializeMap(e,s,r,i)}_throwIfInvalidKey(e){if(this._isValidKey(e))return e;throw new Error(`'${e}' is no valid map key.`)}_isValidKey(e){const t=typeof e;return t==="string"||t==="number"||t==="symbol"}_deserializeMap(e,t,i,s){if(!e)return e;const r=new Map;for(const[o,l]of Object.entries(e)){const a=s.deserialize(o,t);r.set(a,s.deserialize(l,i))}return r}_deserializeRecord(e,t,i,s){if(!e)return e;const r={};for(const[o,l]of Object.entries(e)){const a=s.deserialize(o,t);r[a]=s.deserialize(l,i)}return r}static getMapKeyType(e){return os._getMapType(e,0)}static getMapValueType(e){return os._getMapType(e,1)}static _getMapType(e,t){return e?.args?.length>1?e.args[t]:null}}class Ya{canSerialize(e,t){return b.isArray(e)}serialize(e,t,i){const s=Tt.getArrayValueType(t);return e.map(r=>i.serialize(r,s))}canDeserialize(e,t){return b.isArray(e)}deserialize(e,t,i){const s=Tt.getArrayValueType(t);return e.map(r=>i.deserialize(r,s))}}class Xa{canSerialize(e,t){return!1}serialize(e,t,i){throw new Error("Unsupported operation")}canDeserialize(e,t){return typeof e=="string"&&Number===t?.type}deserialize(e,t,i){return Se.ensure(e)}}class on{canSerialize(e,t){return e instanceof Set}serialize(e,t,i){const s=[],r=on.getSetValueType(t);return e.forEach(o=>s.push(i.serialize(o,r))),s}canDeserialize(e,t){return Set===t?.type&&(!e||b.isArray(e))}deserialize(e,t,i){const s=on.getSetValueType(t),r=new Set;return e&&e.forEach(o=>r.add(i.deserialize(o,s))),r}static getSetValueType(e){return e?.args?.length?e.args[0]:null}}class Ja{id;objectType;createPojoIfDoIsUnknown;retainTypeVersion;constructor(e){if(this.createPojoIfDoIsUnknown=!!e?.createPojoIfDoIsUnknown,this.retainTypeVersion=u.nvl(e?.retainTypeVersion,t=>!(t instanceof se)),!b.isFunction(this.retainTypeVersion)){const t=!!this.retainTypeVersion;this.retainTypeVersion=()=>t}}deserialize(e,t){const i=xe.serializers.find(s=>s.canDeserialize(e,t));return i?i.deserialize(e,t,this):b.isNullOrUndefined(e)?e:b.isPojo(e)?this._deserializeObject(e,t):e}_deserializeObject(e,t){const i=this._resolveDataObjectType(e,t),s=this._createResultObject(i),r=Object.getPrototypeOf(i).prototype;return Object.keys(e).filter(o=>o!=="_typeVersion").forEach(o=>{s[o]=this._convertFieldValue(r,e,o,e[o])}),e.hasOwnProperty("_typeVersion")&&this.retainTypeVersion(s)&&(s._typeVersion=this._convertFieldValue(r,e,"_typeVersion",e._typeVersion)),s}_resolveDataObjectType(e,t){for(const i of xe.doTypeResolvers){const s=i.resolve(e,t);if(s)return s}return se}_createResultObject(e){return this.createPojoIfDoIsUnknown&&e===se?{}:u.create(e,null)}_convertFieldValue(e,t,i,s){const r=Tt.getFieldMetaData(e,i);return this.deserialize(s,r)}}class Qa{id;objectType;_cycleDetector=new Za;serialize(e,t){this._cycleDetector.push(e);try{const i=xe.serializers.find(s=>s.canSerialize(e,t));return i?i.serialize(e,t,this):b.isNullOrUndefined(e)?e:b.isObject(e)?this._serializeObject(e,t):e}finally{this._cycleDetector.pop(e)}}_serializeObject(e,t){const i=Tt.chooseDataObjectType(e,t),s={},r=i?Object.getPrototypeOf(i).prototype:null;return Object.keys(e).filter(o=>o!=="objectType").forEach(o=>{const l=this._convertFieldValue(r,o,e[o]);l!==void 0&&(s[o]=l)}),this._writeJsonType(s,i),s}_convertFieldValue(e,t,i){this._cycleDetector.pushAttributeName(t);const s=Tt.getFieldMetaData(e,t),r=this.serialize(i,s);return this._cycleDetector.popAttributeName(t),r}_writeJsonType(e,t){if(e._type)return;const s=Le.get().getObjectType(t);if(s){const r=mt.get().toTypeName(s);r&&(e._type=r)}}}class Za{_stack=[];_attributeNames=[];push(e){if(this._canHaveChildren(e)){if(this.contains(e)){const t="["+this._attributeNames.join(",")+"]";throw new Error(`Unable to serialize object. Reference cycle detected. Attribute path: ${t}`)}this._stack.push(e)}}pop(e){if(!this._canHaveChildren(e))return;const t=this._stack.pop();if(t!==e)throw new Error(`Asymmetric use of cycle detector. Expected pop for '${t}' but was '${e}'.`)}contains(e){return this._stack.indexOf(e)>=0}pushAttributeName(e){this._attributeNames.push(e)}popAttributeName(e){const t=this._attributeNames.pop();if(t!==e)throw new Error(`Asymmetric use of cycle detector. Expected pop for '${t}' but was '${e}'.`)}_canHaveChildren(e){return b.isObject(e)||b.isArray(e)}}class eh{resolve(e,t){return Tt.chooseDataObjectType(e,t)}}const xe={serializers:[new qa,new os,new on,new Xa,new Ya],doTypeResolvers:[new eh],stringify(n){return JSON.stringify(xe.serialize(n))},serialize(n){return n&&u.create(Qa).serialize(n)},parse:(n,e,t)=>{if(b.isNullOrUndefined(n))return n;if(!n)return null;const i=JSON.parse(n);return xe.deserialize(i,e,t)},deserialize:(n,e,t)=>{if(b.isNullOrUndefined(n))return n;if(!n)return null;const i=Tt.resolveFieldMetaData(e);return u.create(Ja,t).deserialize(n,i)},getContribution(n,e){return e?._contributions?.length?(u.assertParameter("contributionClassOrType",n),e._contributions.find(wf(n))):null},addContribution(n,e){e&&(u.assertParameter("contribution",n),b.isPojo(n)?(u.assertProperty(n,"_type"),xe.removeContribution(n._type,e)):xe.removeContribution(n.constructor,e),e._contributions=p.ensure(e._contributions),e._contributions.push(n))},removeContribution(n,e){if(!e)return;u.assertParameter("contributionClassOrType",n);const t=p.removeByPredicate(e._contributions,wf(n));return e._contributions?.length===0&&(e instanceof se?e._contributions=void 0:delete e._contributions),t}};function wf(n){return typeof n=="string"?e=>e._type===n:e=>e.constructor===n}var o_=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},th;let se=th=class{_type;_contributions;init(e){if(b.isPojo(e)){const t=xe.deserialize(e,this.constructor);h().extend(this,t)}}getContribution(e){return xe.getContribution(e,this)}addContribution(e){xe.addContribution(e,this)}removeContribution(e){return xe.removeContribution(e,this)}toPojo(){return xe.serialize(this)}clone(e){const t=e instanceof th?e.toPojo():e,i=this.toPojo();return xe.deserialize(h().extend(i,t))}equals(e){return b.equalsRecursive(this,e,!0)}};se=th=o_([Ke({ensureObjectType:!1})],se);const lt={get(n,e,t){let i=h().extend({},{url:n,method:"GET"},e);return lt.call(i,t)},post(n,e,t,i){let s=h().extend({},{url:n,method:"POST",data:e},t);return lt.call(s,i)},put(n,e,t,i){let s=h().extend({},{url:n,method:"PUT",data:e},t);return lt.call(s,i)},remove(n,e,t){let i=h().extend({},{url:n,method:"DELETE"},e);return lt.call(i,t)},call(n,e){return lt.createCall(n,e).call()},createCall(n,e){const t=h().extend({},{cache:!1},n),i=h().extend(!0,{},{ajaxOptions:t},e);return u.create(Gs,i)},getJson(n,e,t){let i=h().extend({},{url:n,method:"GET"},e);return lt.callJson(i,t)},postJson(n,e,t,i){!b.isNullOrUndefined(e)&&typeof e!="string"&&(e=JSON.stringify(e));let s=h().extend({},{url:n,method:"POST",data:e},t);return lt.callJson(s,i)},putJson(n,e,t,i){!b.isNullOrUndefined(e)&&typeof e!="string"&&(e=JSON.stringify(e));let s=h().extend({},{url:n,method:"PUT",data:e},t);return lt.callJson(s,i)},removeJson(n,e,t){let i=h().extend({},{url:n,method:"DELETE"},e);return lt.callJson(i,t)},callJson(n,e){return lt.createCallJson(n,e).call()},createCallJson(n,e){let t=h().extend({},{method:"POST",dataType:"json",contentType:"application/json; charset=UTF-8"},n);return lt.createCall(t,e)},getDataObject(n,e,t){const i=h().extend({},{url:n,method:"GET"},e);return lt.callDataObject(i,null,t)},postDataObject(n,e,t,i){const s=h().extend({},{url:n,method:"POST"},t);return lt.callDataObject(s,e,i)},putDataObject(n,e,t,i){const s=h().extend({},{url:n,method:"PUT"},t);return lt.callDataObject(s,e,i)},removeDataObject(n,e,t,i){const s=h().extend({},{url:n,method:"DELETE"},t);return lt.callDataObject(s,e,i)},callDataObject(n,e,t){return lt.createCallDataObject(n,e,t).call()},createCallDataObject(n,e,t){const i=e&&xe.stringify(e),s=h().extend({},{converters:{"text json":r=>xe.parse(r)},data:i||void 0},n);return this.createCallJson(s,t)}};class Gs extends Ws{ajaxOptions;constructor(){super(),this.type="ajax",this.ajaxOptions=null}init(e){if(!e)throw new Error('Missing argument "model"');if(!e.ajaxOptions)throw new Error('Missing model property "ajaxOptions"');e.name||(e.name=e.ajaxOptions.url),super.init(e)}_callImpl(){return this.callCounter!==1&&(this.ajaxOptions.url=new wt(this.ajaxOptions.url).setParameter("retry",this.callCounter-1+"").toString({alwaysLast:["retry"]})),h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+(this.callCounter===1?"--- ":"")+this.ajaxOptions.method+' "'+this.ajaxOptions.url+'"'+(this.callCounter===1?" ---":"")),h().ajax(this.ajaxOptions)}_setResultFail(e,t,i){this._setResult(new Mi({jqXHR:e,textStatus:t,errorThrown:i,requestOptions:this.ajaxOptions}))}_onCallDone(e,t,i){h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"AJAX success"),super._onCallDone(e,t,i)}_onCallFail(e,t,i){h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"AJAX fail: type="+t+", httpStatus="+e.status+(i?' "'+i+'"':"")),super._onCallFail(e,t,i)}_nextRetryImpl(e,t,i){return Gs.isOfflineError(e,t,i)?super._nextRetryImpl():(h().log.isTraceEnabled()&&h().log.trace(this.logPrefix+"Unexpected HTTP error"),!1)}static isOfflineError(e,t,i){return!e.status||e.status>=12e3||e.status===502||e.status===503||e.status===504}_abortImpl(){this.pendingCall&&typeof this.pendingCall.abort=="function"&&this.pendingCall.abort()}}class Mi{jqXHR;textStatus;errorDo;errorThrown;requestOptions;constructor(e){this.jqXHR=null,this.textStatus=null,this.errorThrown=null,this.requestOptions=null,h().extend(this,e);const t=this.jqXHR?.responseJSON?.error;Mi.isErrorDo(t)&&(this.errorDo=t)}static isErrorDo(e){return e?._type==="scout.Error"||b.isNumber(e?.severityAsInt)}static extractErrorDo(e){return e instanceof Mi?e.errorDo:null}}var ih=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let Ks=class extends se{name;lastNotifications};ih([Reflect.metadata("scout.m.t",String)],Ks.prototype,"name",void 0),ih([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["UiNotificationDo"]})],Ks.prototype,"lastNotifications",void 0),Ks=ih([ue("scout.Topic")],Ks),window.scout.DataObjectInventory.get().add(Ks,"scout.Topic","TopicDo");class sh{systems=new Map;subscribe(e,t,i){return this._getOrInitSystem(i).subscribe(e,t)}subscribeOne(e,t,i){return this._getOrInitSystem(i).subscribeOne(e,t)}unsubscribe(e,t,i){this._getOrInitSystem(i).unsubscribe(e,t)}unregisterSystem(e){let t=this.systems.get(e);t&&(t.destroy(),this.systems.delete(e))}computeReloadDelay(e){return e=u.nvl(e,0),e<3?0:Math.ceil(Math.random()*1e3*e)}tearDown(){this.systems.forEach(e=>e.destroy()),this.systems.clear()}_getOrInitSystem(e){e=e||Wi.MAIN_SYSTEM,e!==Wi.MAIN_SYSTEM&&!bs.exists(e)&&(e=Wi.MAIN_SYSTEM);let t=this.systems.get(e);return t||(t=u.create(nh,{name:e}),this.systems.set(e,t)),t}}const js=b.createSingletonProxy(sh);G.addListener("fail",n=>{js.tearDown()});var mr=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let ki=class extends se{id;topic;nodeId;creationTime;message;subscriptionStart};mr([Reflect.metadata("scout.m.t",String)],ki.prototype,"id",void 0),mr([Reflect.metadata("scout.m.t",String)],ki.prototype,"topic",void 0),mr([Reflect.metadata("scout.m.t",String)],ki.prototype,"nodeId",void 0),mr([Reflect.metadata("scout.m.t",Date)],ki.prototype,"creationTime",void 0),mr([Reflect.metadata("scout.m.t","DoEntity")],ki.prototype,"message",void 0),mr([Reflect.metadata("scout.m.t",Boolean)],ki.prototype,"subscriptionStart",void 0),ki=mr([ue("scout.UiNotification")],ki),window.scout.DataObjectInventory.get().add(ki,"scout.UiNotification","UiNotificationDo");var rh=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let _r=class extends se{notifications;error};rh([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["UiNotificationDo"]})],_r.prototype,"notifications",void 0),rh([Reflect.metadata("scout.m.t","JsonErrorResponse")],_r.prototype,"error",void 0),_r=rh([ue("scout.UiNotificationResponse")],_r),window.scout.DataObjectInventory.get().add(_r,"scout.UiNotificationResponse","UiNotificationResponse");var Cf=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let br=class extends se{topics};Cf([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["TopicDo"]})],br.prototype,"topics",void 0),br=Cf([ue("scout.UiNotificationRequest")],br),window.scout.DataObjectInventory.get().add(br,"scout.UiNotificationRequest","UiNotificationRequest");class nh{poller;name;events;objectType;constructor(){this.events=new oh(this)}init(e){this.name=e?.name}subscribe(e,t){return u.assertParameter("topic",e),u.assertParameter("handler",t),this.events.on(e,t),this.whenSubscriptionStart(e).catch(i=>{throw this.unsubscribe(e,t),i})}subscribeOne(e,t){return u.assertParameter("topic",e),u.assertParameter("handler",t),this.events.one(e,t),this.whenSubscriptionStart(e).catch(i=>{throw this.unsubscribe(e,t),i})}unsubscribe(e,t){u.assertParameter("topic",e),this.events.off(e,t)}whenSubscriptionStart(e){if(this.poller.notifications.get(e)?.size)return $.resolvedPromise(e);let t=$.Deferred(),i=r=>{r.notification.topic===e&&(t.resolve(e),this.poller.off("subscriptionStart",i),this.poller.off("error",s))},s=r=>{t.reject(r.error),this.poller?.off("subscriptionStart",i),this.poller?.off("error",s)};return this.poller.on("subscriptionStart",i),this.poller.on("error",s),t.promise()}_dispatch(e){for(const t of e){if(!this.events.count(t.topic)){$.log.isInfoEnabled()&&$.log.info("Notification received but no handler registered");return}this._trigger(t.topic,t)}}_trigger(e,t){let i=new qe({id:t.id,topic:t.topic,creationTime:t.creationTime,message:t.message});i.source=this,this.events.trigger(e,i)}updatePoller(){let e=this.events.types(),t=this.poller;if(e.length>0&&!t){let i=bs.getOrCreate(this.name).getEndpointUrl("ui-notifications","ui-notifications");t=u.create(vi,{system:this,url:i}),t.on("notifications",s=>this._dispatch(s.notifications)),this.poller=t}t&&(t.setTopics(e),t.topics.length===0?(t.stop(),this.poller=null):t.restart())}destroy(){this.poller?.stop(),this.poller=null}}class oh extends Ui{system;constructor(e){super(),this.system=e}on(e,t,i){let s=super.on(e,t,i);return this.system.updatePoller(),s}off(e,t){super.off(e,t),this.system.updatePoller()}}class vi extends zt{static RESPONSE_ERROR_RETRY_INTERVAL=3e4;static CONNECTION_ERROR_RETRY_INTERVALS=[300,500,1e3,5e3];static HISTORY_COUNT=10;static DEFAULT_BACKEND_TIMEOUT=6e4;static BACKEND_TIMEOUT_OFFSET=15e3;requestTimeout;status;notifications;url;system;_call;constructor(){super(),this.requestTimeout=vi.DEFAULT_BACKEND_TIMEOUT+vi.BACKEND_TIMEOUT_OFFSET,this.status=it.STOPPED,this.notifications=new Map}_init(e){super._init(e);let t="scout.uinotification.waitTimeout",i=this.system.name,s=u.nvl(Ki.get(t,i)?.value,Ki.get(t)?.value,vi.DEFAULT_BACKEND_TIMEOUT);this.requestTimeout=s+vi.BACKEND_TIMEOUT_OFFSET}setTopics(e){this.notifications=new Map(e.map(t=>[t,this.notifications.get(t)||new Map]))}get topics(){return Array.from(this.notifications.keys())}get topicsWithLastNotifications(){return Array.from(this.notifications.entries()).map(e=>{let[t,i]=e;const s=Array.from(i.values()).map(r=>{const o=p.last(r);return u.create(ki,{id:o.id,creationTime:o.creationTime,nodeId:o.nodeId})});return u.create(Ks,{name:t,lastNotifications:s.length===0?void 0:s})})}restart(){this.stop(),this.start()}start(){this.status!==it.RUNNING&&this.poll()}stop(){this.status!==it.STOPPED&&(this._call?.abort(),this.setStatus(it.STOPPED))}poll(){this._poll(),this.setStatus(it.RUNNING)}_schedulePoll(e){this.status!==it.STOPPED&&setTimeout(()=>{this.status!==it.STOPPED&&this.poll()},u.nvl(e,0))}_poll(){this._call?.abort();const e={url:this.url,timeout:this.requestTimeout},t=u.create(br,{topics:this.topicsWithLastNotifications});this._call=lt.createCallDataObject(e,t,{maxRetries:-1,retryIntervals:vi.CONNECTION_ERROR_RETRY_INTERVALS}),this._call.call().then(i=>this._onSuccess(i)).catch(i=>this._onError(i))}_onSuccess(e){if(e.error){this._onSuccessError(e.error);return}if(this.status===it.STOPPED)return;let t=e.notifications||[];h().log.isInfoEnabled()&&h().log.info(`${t.length} UI notification(s) received.`),t=t.filter(i=>{let{topic:s,id:r,nodeId:o}=i;if(!this.notifications.has(s))return!1;let l=this.notifications.get(s),a=b.getOrSetIfAbsent(l,o,()=>[]);return a.some(d=>d.id===r)?(h().log.isInfoEnabled()&&h().log.info(`UI notification with id '${r}' is already known, dropping it.`),!1):(a.push(i),a=a.sort((d,c)=>d.creationTime.getTime()-c.creationTime.getTime()),a.length>vi.HISTORY_COUNT&&a.splice(0,1),i.subscriptionStart?(h().log.isInfoEnabled()&&h().log.info(`UI notification with id ${r} marks subscription start.`),this.trigger("subscriptionStart",{notification:i}),!1):!0)}),t.length&&(h().log.isInfoEnabled()&&h().log.info(`Dispatching UI notifications with ids ${t.map(i=>i.id)}.`),this.trigger("notifications",{notifications:t})),this._schedulePoll()}_onSuccessError(e){e.code===vt.JsonResponseError.SESSION_TIMEOUT?(h().log.isInfoEnabled()&&h().log.info("Stopping ui notification poller due to session timeout"),this.stop()):u.create(ri,{displayError:!1}).handle(e)}_onError(e){if(!(this._call.pendingCall||this._call.callTimeoutId)){if(e.textStatus==="abort"||this._call.aborted){if(this.status===it.STOPPED)return;this.setStatus(it.FAILURE),this._schedulePoll(vi.RESPONSE_ERROR_RETRY_INTERVAL);return}if(this.setStatus(it.FAILURE),u.isOneOf(e.jqXHR.status,401,403)){h().log.isInfoEnabled()&&h().log.info(`Stopping ui notification poller because operation is not permitted (${e.jqXHR.status})`),this.trigger("error",{error:e}),this.stop();return}this.trigger("error",{error:e}),G.get().errorHandler.analyzeError(e).then(t=>{u.getSession()?.sendLogRequest(`UI notification poller failed, call will be retried in ${vi.RESPONSE_ERROR_RETRY_INTERVAL} ms.
Error message:
${t.log}
()`,W.INFO)}),this._schedulePoll(vi.RESPONSE_ERROR_RETRY_INTERVAL)}}setStatus(e){this.setProperty("status",e)&&h().log.isInfoEnabled()&&h().log.info("UI notification poller status changed: "+e)}}class Pt{objectType;session;hierarchical;loadIncremental;batch;queryBy;searchText;key;keys;parentKey;active;maxRowCount;constructor(){this.session=null,this.hierarchical=!1,this.loadIncremental=!1,this.batch=!1,this.queryBy=null,this.searchText=null,this.key=null,this.keys=null,this.parentKey=null,this.active=null,this.maxRowCount=100}init(e){u.assertParameter("session",e.session),this._init(e)}_init(e){h().extend(this,e)}setLoadIncremental(e){this.loadIncremental=e}setHierarchical(e){this.hierarchical=e}setBatch(e){this.batch=e}setMaxRowCount(e){this.maxRowCount=e}textByKey(e){return b.isNullOrUndefined(e)?h().resolvedPromise(""):this._textByKey(e)}_textByKey(e){return this.cloneForKey(e).execute().then(t=>{let i=Pt.firstLookupRow(t);return i?i.text:""})}textsByKeys(e){return p.empty(e)?h().resolvedPromise({}):this._textsByKeys(e)}_textsByKeys(e){return this.cloneForKeys(e).execute().then(t=>{if(!t||!b.isArray(t.lookupRows))return{};const i={};return t.lookupRows.forEach(s=>{i[b.ensureValidKey(s.key)]=s.text}),i})}getAll(){return this.queryBy=me.ALL,this._getAll()}_getAll(){throw new Error("_getAll() not implemented")}getByText(e){return this.queryBy=me.TEXT,this.searchText=e,this._getByText(e)}_getByText(e){throw new Error("_getByText() not implemented")}getByKey(e){return this.queryBy=me.KEY,this.key=e,this._getByKey(e)}_getByKey(e){throw new Error("getByKey() not implemented")}getByKeys(e){return this.queryBy=me.KEYS,this.keys=e,this._getByKeys(e)}_getByKeys(e){throw new Error("_getByKeys() not implemented")}getByRec(e){return this.queryBy=me.REC,this.parentKey=e,b.isNullOrUndefined(e)?this._emptyRecResult(e):this._getByRec(e)}_emptyRecResult(e){return h().resolvedPromise({queryBy:me.REC,rec:e,lookupRows:[]})}_getByRec(e){throw new Error("_getByRec() not implemented")}execute(){if(me.KEY===this.queryBy)return this._getByKey(this.key);if(me.ALL===this.queryBy)return this._getAll();if(me.KEYS===this.queryBy)return this._getByKeys(this.keys);if(me.TEXT===this.queryBy)return this._getByText(this.searchText);if(me.REC===this.queryBy)return b.isNullOrUndefined(this.parentKey)?this._emptyRecResult(this.parentKey):this._getByRec(this.parentKey);throw new Error("cannot execute a non-clone LookupCall. Use one of the cloneFor*-methods before executing.")}clone(e){return u.cloneShallow(this,e,!0)}cloneForAll(){return this.clone({queryBy:me.ALL})}cloneForText(e){return this.clone({queryBy:me.TEXT,searchText:e})}cloneForKey(e){return this.clone({queryBy:me.KEY,key:e})}cloneForKeys(e){return this.clone({queryBy:me.KEYS,keys:e})}cloneForRec(e){return this.clone({queryBy:me.REC,parentKey:e})}abort(){}_createLookupResult(e,t){return{queryBy:this.queryBy,text:this.searchText,key:this.key,lookupRows:e,exception:t}}static ensure(e,t){return!e||e instanceof Pt?e:typeof e=="string"||typeof e=="function"?u.create(e,{session:t}):(e.session=t,u.create(e))}static firstLookupRow(e){return!e||!b.isArray(e.lookupRows)||e.lookupRows.length===0?null:e.lookupRows[0]}}class ls{key;text;parentKey;enabled;active;additionalTableRowData;cssClass;iconId;tooltipText;backgroundColor;foregroundColor;font;constructor(){this.key=null,this.text=null,this.parentKey=null,this.enabled=!0,this.active=!0,this.additionalTableRowData=null,this.cssClass=null,this.iconId=null,this.tooltipText=null,this.backgroundColor=null,this.foregroundColor=null,this.font=null}init(e){h().extend(this,e)}setKey(e){this.key=e}setText(e){this.text=e}setParentKey(e){this.parentKey=e}setEnabled(e){this.enabled=e}setCssClass(e){this.cssClass=e}setAdditionalTableRowData(e){this.additionalTableRowData=e}setIconId(e){this.iconId=e}setTooltipText(e){this.tooltipText=e}setBackgroundColor(e){this.backgroundColor=e}setForegroundColor(e){this.foregroundColor=e}setFont(e){this.font=e}equals(e){return b.propertiesEquals(this,e,Object.keys(this))}toString(){return"scout.LookupRow[key="+this.key+" text="+this.text+"]"}}class Tf extends Pt{resourceUrl;maxTextLength;restriction;_restriction;_ajaxCall;_deferred;constructor(){super(),this.resourceUrl=null,this.maxTextLength=null,this.restriction=null,this._restriction=null,this._ajaxCall=null,this._deferred=null,this.batch=!0}addRestriction(e,t){this._restriction||(this._restriction={}),this._restriction[e]=t}_addRestrictionIfAbsent(e,t){(!this.restriction||b.isNullOrUndefined(this.restriction[e]))&&this.addRestriction(e,t)}_getAll(){return this._call()}_getByText(e){return this.addRestriction("text",e),this._call()}_getByKey(e){return this.addRestriction("ids",p.ensure(e)),this._call()}_getByKeys(e){return this.addRestriction("ids",p.ensure(e)),this._call()}cloneForAll(){let e=super.cloneForAll();return e._addRestrictionIfAbsent("active",!0),e._addRestrictionIfAbsent("maxRowCount",this.maxRowCount),e}cloneForText(e){let t=super.cloneForText(e);return t._addRestrictionIfAbsent("active",!0),t._addRestrictionIfAbsent("maxRowCount",this.maxRowCount),t}cloneForRec(e){let t=super.cloneForRec(e);return t._addRestrictionIfAbsent("active",!0),t._addRestrictionIfAbsent("maxRowCount",this.maxRowCount),t}_acceptLookupRow(e){return!0}_createLookupRowFromDo(e){let t=h().extend({},e);if(t.key=t.id,delete t.id,t.parentKey=t.parentId,delete t.parentId,delete t._type,this.maxTextLength){let i=t.text;i.length>this.maxTextLength&&(t.text=i.substr(0,this.maxTextLength)+"...",t.tooltipText=i)}return u.create(ls,t)}_call(){return this._deferred=h().Deferred(),this._ajaxCall=this._createAjaxCall(),this._ajaxCall.call().then((e,t,i)=>{let s=p.ensure(e?e.rows:null).filter(this._acceptLookupRow.bind(this)).map(this._createLookupRowFromDo.bind(this));this._deferred.resolve(this._createLookupResult(s))}).catch(e=>{this._deferred.resolve(this._createLookupResult([],this.session.text("ErrorWhileLoadingData")))}),this._deferred.promise()}abort(){this._deferred?.reject({abort:!0}),this._ajaxCall?.abort(),super.abort()}_getCallUrl(){return this.resourceUrl}_getRestrictionForAjaxCall(){if(!this.restriction&&!this._restriction)return null;let e=s=>typeof s=="function"?s(this):s,t={},i=h().extend({},this.restriction,this._restriction);return Object.keys(i).forEach(s=>{let r=i[s],o;Array.isArray(r)?(o=p.flatMap(r,e).filter(Boolean),o=o.length?o:null):o=e(r),b.isNullOrUndefined(o)||(t[s]=o)}),t}_createAjaxCall(){let e=this._getCallUrl(),t=this._getRestrictionForAjaxCall(),s={method:"POST",data:t?JSON.stringify(t):null,dataType:"json",contentType:"application/json; charset=UTF-8",cache:!1,url:e,timeout:0};return u.create(Gs,{ajaxOptions:s,name:"RestLookupCall",retryIntervals:[100,500,500,500]})}}class ll extends Pt{adapter;deferred;constructor(e){super(),this.adapter=e,this.deferred=null}_getAll(){return this._newDeferred(new vs(me.ALL)),this.adapter.sendLookup(me.ALL),this.deferred.promise()}_getByText(e){return this._newDeferred(new vs(me.TEXT,e)),this.adapter.sendLookup(me.TEXT,e),this.deferred.promise()}_getByKey(e){return this._newDeferred(new vs(me.KEY,e)),this.adapter.sendLookup(me.KEY,e),this.deferred.promise()}_getByRec(e){return this._newDeferred(new vs(me.REC,e)),this.adapter.sendLookup(me.REC,e),this.deferred.promise()}resolveLookup(e){if(!this._belongsToLatestRequest(e)){h().log.isTraceEnabled()&&h().log.trace("(RemoteLookupCall#resolveLookup) ignore lookupResult. Does not belong to latest request",b.optProperty(this.deferred,"requestParameter"));return}e.lookupRows=p.ensure(e.lookupRows).map(t=>u.create(ls,t)),this.deferred.resolve(e)}_belongsToLatestRequest(e){if(!this.deferred)return!1;let t=e.queryBy.toLowerCase(),i=e[t],s=new vs(e.queryBy,i);return this.deferred.requestParameter.equals(s)}_newDeferred(e){this.deferred&&this.deferred.reject({abort:!0}),this.deferred=h().Deferred(),this.deferred.requestParameter=e}}class vs{requestType;requestData;constructor(e,t){if(!me.hasOwnProperty(e))throw new Error("Invalid enum value");this.requestType=e,this.requestData=t}equals(e){return!e||!(e instanceof vs)?!1:b.propertiesEquals(this,e,["requestType","requestData"])}}var me;(function(n){n.ALL="ALL",n.TEXT="TEXT",n.KEY="KEY",n.KEYS="KEYS",n.REC="REC"})(me||(me={}));class Ss extends Pt{delay;data;_deferred;constructor(){super(),this._deferred=null,this.delay=0,this.data=null,this.active=!0}_init(e){super._init(e),this.data||(this.data=this._data())}refreshData(e){e===void 0?this.data=this._data():this.data=e}abort(){this._deferred?.reject({abort:!0}),super.abort()}_getAll(){return this._deferred=h().Deferred(),setTimeout(this._queryByAll.bind(this),this.delay),this._deferred.promise()}_queryByAll(){this._deferred.resolve({queryBy:me.ALL,lookupRows:this._lookupRowsByAll()})}_lookupRowsByAll(){let e=this._limitMaxRows(this.data);return this._mapAndFilterData(e)}_limitMaxRows(e){return p.ensure(e).slice(0,this.maxRowCount)}_mapAndFilterData(e){return e.map(this._dataToLookupRow,this).filter(this._filterActiveLookupRow,this)}_filterActiveLookupRow(e){return b.isNullOrUndefined(this.active)?!0:this.active===u.nvl(e.active,!0)}_getByText(e){return this._deferred=h().Deferred(),setTimeout(this._queryByText.bind(this,e),this.delay),this._deferred.promise()}_queryByText(e){let t=this._lookupRowsByText(e);this.hierarchical||this._deferred.resolve({queryBy:me.TEXT,text:e,lookupRows:t});let i,s=new lh(this);this.loadIncremental?i=h().resolvedPromise(t):i=s.addChildLookupRows(t),i.then(r=>s.addParentLookupRows(r)).done(r=>{this._deferred.resolve({queryBy:me.TEXT,text:e,lookupRows:r})}).fail(r=>{throw r})}_lookupRowsByText(e){let t=this._createSearchPattern(e),i=this.data.filter(s=>t.test(s[1].toLowerCase()));return this._mapAndFilterData(i)}_createSearchPattern(e){const t="*",i="@wildcard@";e=_.nvl(e),e=e.toLowerCase(),e=e.replace(new RegExp(_.quote(t),"g"),i),e=_.quote(e);let s=i+i;for(;_.contains(e,s);)e=e.replace(s,i);return _.endsWith(e,i)||(e+=i),e=e.replace(new RegExp(_.quote(i),"g"),".*"),new RegExp("^"+e+"$","s")}_getByKey(e){return this._deferred=h().Deferred(),setTimeout(this._queryByKey.bind(this,e),this.delay),this._deferred.promise()}_queryByKey(e){let t=this._lookupRowByKey(e);t?this._deferred.resolve({queryBy:me.KEY,lookupRows:[t]}):this._deferred.reject()}_getByKeys(e){return this._deferred=h().Deferred(),setTimeout(()=>this._queryByKeys(e),this.delay),this._deferred.promise()}_queryByKeys(e){const t=p.ensure(e).map(i=>this._lookupRowByKey(i)).filter(i=>!!i);t.length?this._deferred.resolve({queryBy:me.KEY,lookupRows:t}):this._deferred.reject()}_lookupRowByKey(e){let t=p.find(this.data,i=>i[0]===e);return t?this._dataToLookupRow(t):null}_getByRec(e){return this._deferred=h().Deferred(),setTimeout(this._queryByRec.bind(this,e),this.delay),this._deferred.promise()}_queryByRec(e){this._deferred.resolve({queryBy:me.REC,rec:e,lookupRows:this._lookupRowsByRec(e)})}_lookupRowsByRec(e){return this.data.reduce((t,i)=>(i[2]===e&&t.push(this._dataToLookupRow(i)),t),[]).filter(this._filterActiveLookupRow,this)}setDelay(e){this.delay=e}_dataToLookupRow(e,t){return u.create(ls,{key:e[0],text:e[1],parentKey:e[2]})}_data(){return[]}}class vf extends Pt{lookupRows;_deferred;constructor(){super(),this.lookupRows=[],this._deferred=null}abort(){this._deferred?.reject({abort:!0}),super.abort()}setLookupRows(e){this.lookupRows=p.ensure(e)}_filterActiveLookupRow(e){return!!u.nvl(e.active,!0)}_getAll(){return this._deferred=h().Deferred(),setTimeout(this._queryByAll.bind(this)),this._deferred.promise()}_queryByAll(){this._deferred.resolve({queryBy:me.ALL,lookupRows:this._lookupRowsByAll()})}_lookupRowsByAll(){return this.lookupRows.filter(this._filterActiveLookupRow,this).slice(0,this.maxRowCount)}_getByText(e){return this._deferred=h().Deferred(),setTimeout(this._queryByText.bind(this,e)),this._deferred.promise()}_queryByText(e){this._deferred.resolve({queryBy:me.TEXT,text:e,lookupRows:this._lookupRowsByText(e)})}_lookupRowsByText(e){let t=String(u.nvl(e,"")).trim().toLowerCase();return this.lookupRows.filter(i=>_.startsWith(u.nvl(i.text,"").toLowerCase(),t)).filter(this._filterActiveLookupRow,this).slice(0,this.maxRowCount)}_getByKey(e){return this._deferred=h().Deferred(),setTimeout(this._queryByKey.bind(this,e)),this._deferred.promise()}_queryByKey(e){let t=this._lookupRowByKey(e);t?this._deferred.resolve({queryBy:me.KEY,lookupRows:[t]}):this._deferred.reject()}_lookupRowByKey(e){return p.find(this.lookupRows,t=>t.key===e)}_getByRec(e){return this._deferred=h().Deferred(),setTimeout(this._queryByRec.bind(this,e)),this._deferred.promise()}_queryByRec(e){this._deferred.resolve({queryBy:me.REC,rec:e,lookupRows:this._lookupRowsByRec(e)})}_lookupRowsByRec(e){return this.lookupRows.reduce((t,i)=>(i.parentKey===e&&t.push(i),t),[]).filter(this._filterActiveLookupRow,this).slice(0,this.maxRowCount)}}class lh{lookupCall;_lookupRowMap;constructor(e){u.assertParameter("lookupCall",e),this.lookupCall=e,this._lookupRowMap={}}addParentLookupRows(e){this._fillMap(e);let t=e.map(this._addParent.bind(this));return h().promiseAll(t).then(()=>b.values(this._lookupRowMap))}_addParent(e){let t=e.parentKey;return t?this._lookupRowMap.hasOwnProperty(t+"")?(e=this._lookupRowMap[t+""],this._addParent(e)):this.lookupCall.cloneForKey(t).execute().then(i=>{let s=Pt.firstLookupRow(i);return this._lookupRowMap[s.key+""]=s,this._addParent(s)}):h().resolvedPromise()}_fillMap(e){e.forEach(t=>{this._lookupRowMap[t.key+""]=t})}addChildLookupRows(e){this._fillMap(e);let t=e.map(this._addChildren.bind(this));return h().promiseAll(t).then(()=>b.values(this._lookupRowMap))}_addChildren(e){return this.lookupCall.cloneForRec(e.key).execute().then(t=>{if(t.lookupRows.length)return this.addChildLookupRows(t.lookupRows)})}}class yr{id;objectType;modelClass;active;enabled;iconId;tooltipText;backgroundColor;foregroundColor;font;cssClass;extKey;value;partitionId;sortCode;children;parent;codeType;_text;constructor(){this.active=!0,this.enabled=!0,this.partitionId=0,this.sortCode=-1,this.children=[],this.codeType=null}init(e){if(u.assertParameter("id",e.id),this.id=e.id,this.modelClass=e.modelClass,this.active=u.nvl(e.active,this.active),this.enabled=u.nvl(e.enabled,this.enabled),this.iconId=e.iconId,this.tooltipText=e.tooltipText,this.backgroundColor=e.backgroundColor,this.foregroundColor=e.foregroundColor,this.font=e.font,this.cssClass=e.cssClass,this.extKey=e.extKey,this.value=e.value,this.partitionId=u.nvl(e.partitionId,this.partitionId),this.sortCode=u.nvl(e.sortCode,this.sortCode),this.codeType=e.codeType,this._text=e.text,e.texts){if(this._text)throw new Error("Either set texts or text property, not both.");let i="__code."+u.nvl(this.codeType?.id,"")+"."+this.id;de.registerTexts(i,e.texts),this._text=de.buildKey(i)}if(e.children)for(let t=0;t<e.children.length;t++){let i=e.children[t];i.codeType=this.codeType;let s=yr.ensure(i);s&&(s.parent=this,this.children.push(s))}this._initCodeTypeField(this.codeType,e.fieldName)}_initCodeTypeField(e,t){if(!e||!t||!e.hasOwnProperty(t))return;e[t]||(e[t]=this)}text(e){let t;return typeof e=="object"?t=e.languageTag:t=e,de.resolveText(this._text,t)}visitChildren(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t?this.children.filter(s=>s.active):this.children;for(let s=0;s<i.length;s++){let r=i[s],o=e(r);if(o===!0||o===ye.TERMINATE||o!==ye.SKIP_SUBTREE&&(o=r.visitChildren(e,t),o===!0||o===ye.TERMINATE))return ye.TERMINATE}}static ensure(e){if(!e)return null;if(e instanceof yr)return e;e.objectType||(e.objectType=yr);let t=e;return u.create(t)}}var pt=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let Je=class extends se{id;objectType;modelClass;active;enabled;iconId;tooltipText;backgroundColor;foregroundColor;font;cssClass;extKey;value;partitionId;sortCode;fieldName;text;texts;children};pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"id",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"objectType",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"modelClass",void 0),pt([Reflect.metadata("scout.m.t",Boolean)],Je.prototype,"active",void 0),pt([Reflect.metadata("scout.m.t",Boolean)],Je.prototype,"enabled",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"iconId",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"tooltipText",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"backgroundColor",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"foregroundColor",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"font",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"cssClass",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"extKey",void 0),pt([Reflect.metadata("scout.m.t",Number)],Je.prototype,"value",void 0),pt([Reflect.metadata("scout.m.t",Number)],Je.prototype,"partitionId",void 0),pt([Reflect.metadata("scout.m.t",Number)],Je.prototype,"sortCode",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"fieldName",void 0),pt([Reflect.metadata("scout.m.t",String)],Je.prototype,"text",void 0),pt([Reflect.metadata("scout.m.t",{objectType:"Record",typeArgs:[String,String]})],Je.prototype,"texts",void 0),pt([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["CodeDo"]})],Je.prototype,"children",void 0),Je=pt([ue("scout.Code")],Je),window.scout.DataObjectInventory.get().add(Je,"scout.Code","CodeDo");class ln{id;objectType;modelClass;iconId;hierarchical;maxLevel;codeMap;_textKey;_textKeyPlural;constructor(){this.maxLevel=2147483647,this.hierarchical=!1,this.codeMap=new Map}init(e){if(u.assertParameter("id",e.id),this.id=e.id,this.modelClass=e.modelClass,this.iconId=e.iconId,this.hierarchical=!!e.hierarchical,e.maxLevel&&(this.maxLevel=e.maxLevel),this._textKey=this._registerTexts("texts",e.texts),this._textKeyPlural=this._registerTexts("textsPlural",e.textsPlural),e.codes)for(let t=0;t<e.codes.length;t++){let i=e.codes[t];i.codeType=this;let s=yr.ensure(i);s&&this._add(s)}this._validateCodeFields()}_getPublicNonCodeProperties(){return new Set(["id","objectType","modelClass","iconId","hierarchical","maxLevel","codeMap"])}_validateCodeFields(){let e=this._getPublicNonCodeProperties();Object.keys(this).filter(t=>!t.startsWith("_")).filter(t=>!e.has(t)).forEach(t=>this._ensureCodeAvailable(t))}_ensureCodeAvailable(e){if(!this[e])throw new Error(`The field '${e}' in CodeType with id '${this.id}' could not be initialized with a Code instance. If this field should not hold a Code after CodeType init, override _getPublicNonCodeProperties and add '${e}' to the resulting set. If this field points to a Code, ensure the name of the field matches the 'fieldName' property of the corresponding Code model.`)}_add(e){this.codeMap.set(e.id,e),e.visitChildren(t=>{this.codeMap.set(t.id,t)},!1)}_registerTexts(e,t){if(!t)return;let i="__codeType."+this.id+"."+e;return de.registerTexts(i,t),de.buildKey(i)}text(e){return this._text(this._textKey,e)}textPlural(e){return this._text(this._textKeyPlural,e)}_text(e,t){let i;return typeof t=="object"?i=t.languageTag:i=t,de.resolveText(e,i)}codes(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};typeof e=="boolean"&&(e={rootOnly:e});let t=[...this.codeMap.values()];return e.rootOnly&&(t=t.filter(i=>!i.parent)),u.nvl(e.activeOnly,!0)&&(t=t.filter(i=>i.active)),t}get(e){return this.codeMap.get(e)}visitChildren(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.codes({rootOnly:!0,activeOnly:t});for(let s=0;s<i.length;s++){let r=i[s],o=e(r);if(o===!0||o===ye.TERMINATE||o!==ye.SKIP_SUBTREE&&(o=r.visitChildren(e,t),o===!0||o===ye.TERMINATE))return ye.TERMINATE}}static ensure(e){if(!e?.id)return null;if(e instanceof ln)return e;e.objectType||(e.objectType=ln);let t=e;return u.create(t)}}var as=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let ci=class extends se{id;objectType;modelClass;iconId;hierarchical;maxLevel;texts;textsPlural;codes};as([Reflect.metadata("scout.m.t",String)],ci.prototype,"id",void 0),as([Reflect.metadata("scout.m.t",String)],ci.prototype,"objectType",void 0),as([Reflect.metadata("scout.m.t",String)],ci.prototype,"modelClass",void 0),as([Reflect.metadata("scout.m.t",String)],ci.prototype,"iconId",void 0),as([Reflect.metadata("scout.m.t",Boolean)],ci.prototype,"hierarchical",void 0),as([Reflect.metadata("scout.m.t",Number)],ci.prototype,"maxLevel",void 0),as([Reflect.metadata("scout.m.t",{objectType:"Record",typeArgs:[String,String]})],ci.prototype,"texts",void 0),as([Reflect.metadata("scout.m.t",{objectType:"Record",typeArgs:[String,String]})],ci.prototype,"textsPlural",void 0),as([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["CodeDo"]})],ci.prototype,"codes",void 0),ci=as([ue("scout.CodeType")],ci),window.scout.DataObjectInventory.get().add(ci,"scout.CodeType","CodeTypeDo");var an=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class ah extends ot{objectType;registry;url;_call;_reloadTimeoutId;_idsToUpdate;constructor(){super(),this.events.registerSubTypePredicate("codeTypeChange",(e,t)=>e.codeType.id===t),this.events.registerSubTypePredicate("codeTypeRemove",(e,t)=>e.id===t),this.registry=new Map,this._reloadTimeoutId=-1,this._idsToUpdate=[],this.url=null}bootstrapSystem(){const e=bs.getOrCreate().getEndpointUrl("codes","codes");return this.bootstrap(e)}bootstrap(e){return e?(this.url=e,js.subscribe("codeTypeUpdate",t=>this._onCodeTypeUpdateNotify(t)).then(()=>this.loadCodeTypes().then(t=>{}))):h().resolvedPromise()}loadCodeTypes(e){if(!this.url)return h().resolvedPromise([]);const t=e?.length?u.create(wr,{codeTypeIds:e}):null;return this._call?.abort(),this._call=lt.createCallDataObject({url:this.url,method:"PUT"},t,{maxRetries:-1,retryIntervals:[300,500,1e3,5e3]}),this._call.call().always(()=>{this._call=null}).then(this._handleCodesResponse.bind(this))}_handleCodesResponse(e){return this.add(G.handleJsonError(this.url,e))}_onCodeTypeUpdateNotify(e){let t=e.message,i=t.codeTypes;if(i?.length)this.add(i).forEach(s=>h().log.info(`CodeType with id '${s.id}' updated.`));else if(t.codeTypeIds?.length){const s=js.computeReloadDelay(t.reloadDelayWindow);this._scheduleCodeTypeUpdate(t.codeTypeIds,s)}}_scheduleCodeTypeUpdate(e,t){this._idsToUpdate=[...new Set([...this._idsToUpdate,...e])],this._reloadTimeoutId>0&&clearTimeout(this._reloadTimeoutId),h().log.info(`About to refresh CodeTypes with ids '${this._idsToUpdate}' after ${t}ms.`),this._reloadTimeoutId=setTimeout(()=>{this._reloadTimeoutId=-1;const i=this._idsToUpdate;this._idsToUpdate=[],this.loadCodeTypes(i).then(s=>s.forEach(r=>h().log.info(`CodeType with id '${r.id}' updated.`)))},t)}_triggerCodeTypeChange(e){this.trigger("codeTypeChange",{codeType:e})}_triggerCodeTypeRemove(e){this.trigger("codeTypeRemove",{id:e})}add(e){let t=[];return p.ensure(e).forEach(i=>{let s=ln.ensure(i);s&&s.id&&(this.registry.set(s.id,s),t.push(s))}),t.forEach(i=>this._triggerCodeTypeChange(i)),t}remove(e){const t=p.ensure(e).map(i=>typeof i=="string"?i:i.id);t.forEach(i=>this.registry.delete(i)),t.forEach(i=>this._triggerCodeTypeRemove(i))}get(e){if(typeof e=="string")return this.registry.get(e);for(let t of this.registry.values())if(t instanceof e)return t}}let qs=class extends se{codeTypes;codeTypeIds;reloadDelayWindow};an([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["CodeTypeDo"]})],qs.prototype,"codeTypes",void 0),an([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:[String]})],qs.prototype,"codeTypeIds",void 0),an([Reflect.metadata("scout.m.t",Number)],qs.prototype,"reloadDelayWindow",void 0),qs=an([ue("scout.CodeTypeUpdateMessage")],qs);let wr=class extends se{codeTypeIds};an([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:[String]})],wr.prototype,"codeTypeIds",void 0),wr=an([ue("scout.CodeTypeRequest")],wr);const Cr=b.createSingletonProxy(ah);window.scout.DataObjectInventory.get().add(qs,"scout.CodeTypeUpdateMessage","CodeTypeUpdateMessageDo"),window.scout.DataObjectInventory.get().add(wr,"scout.CodeTypeRequest","CodeTypeRequest");class ro extends Ss{codeType;constructor(){super(),this.codeType=null}_lookupRowByKey(e){let t=Cr.get(this.codeType);return t?this._createLookupRow(t.get(e)):null}_lookupRowsByAll(){return this._collectLookupRows()}_lookupRowsByText(e){return this._collectLookupRows(t=>{let i=t.text||"";return _.startsWith(i.toLowerCase(),e.toLowerCase())})}_lookupRowsByRec(e){return this._collectLookupRows(t=>t.parentKey===e)}_collectLookupRows(e){let t=Cr.get(this.codeType);if(!t)return[];let i=[];return t.visitChildren(s=>{let r=this._createLookupRow(s);(!e||e(r))&&i.push(r)},!1),i}_createLookupRow(e){return e?u.create(ls,{key:e.id,foregroundColor:e.foregroundColor,backgroundColor:e.backgroundColor,active:e.active,enabled:e.enabled,cssClass:e.cssClass,font:e.font,iconId:e.iconId,tooltipText:e.tooltipText,text:e.text(this.session.locale),parentKey:e.parent&&e.parent.id}):null}}var hh=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class dh{objectType;configMap;constructor(){this.configMap=new Map}bootstrapSystem(e){const t=bs.getOrCreate(e).getConfigEndpointUrls();return this.bootstrap(t,e)}bootstrap(e,t){let i=p.ensure(e).map(s=>lt.getDataObject(s).then(r=>G.handleJsonError(s,r)).then(r=>this._handleBootstrapResponse(r,t)));return h().promiseAll(i)}_handleBootstrapResponse(e,t){p.ensure(e).forEach(i=>this._handleBootstrapProperty(i,t))}_handleBootstrapProperty(e,t){if(!e?.key)return;let i=this._getSystemMap(t)?.get(e.key);i&&!b.equalsRecursive(i.value,e.value)&&h().log.info(`Already existing config property '${i.key}' with existing value ${JSON.stringify(i.value)} is overwritten with new value ${JSON.stringify(e.value)}.`),this.set(e.key,e.value,t)}_getSystemMap(e){return this.configMap.get(e||Wi.MAIN_SYSTEM)}get(e,t){return this._getSystemMap(t)?.get(e)}set(e,t,i){let s=this._getSystemMap(i);s||(s=new Map,this.configMap.set(i||Wi.MAIN_SYSTEM,s));let r={key:e,value:t};return s.set(r.key,r),r}load(e,t){return this.bootstrapSystem(t).then(()=>this.get(e,t))}}let Tr=class extends se{key;value};hh([Reflect.metadata("scout.m.t",String)],Tr.prototype,"key",void 0),hh([Reflect.metadata("scout.m.t",Object)],Tr.prototype,"value",void 0),Tr=hh([ue("scout.ConfigProperty")],Tr);const Ki=b.createSingletonProxy(dh);window.scout.DataObjectInventory.get().add(Tr,"scout.ConfigProperty","ConfigPropertyDo");let Ii=null;const no={bootstrap(n){return n?(Ii||(Ii=u.create(uh,{permissionsUrl:n})),Ii.bootstrap()):h().resolvedPromise()},bootstrapSystem(){const n=bs.getOrCreate().getEndpointUrl("permissions","permissions");return no.bootstrap(n)},tearDown(){Ii&&(Ii.destroy(),Ii=null)},quickCheck(n){return Sf(n,!0)},check(n){return Sf(n)},getGrantedPermissionLevel(n){return Ii?(n instanceof tt||(n=tt.quick(n)),Ii.getGrantedPermissionLevel(n)):tt.Level.UNDEFINED},getPermissionsUrl(){return Ii&&Ii.permissionsUrl}};function Sf(n,e){return Ii?(n instanceof tt||(n=tt.quick(n)),Ii.check(n,e)):e?!1:h().resolvedPromise(!1)}var xs=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class uh extends zt{permissionsUrl;_permissionCollection;_permissionUpdateEventHandler;_reloadTimeoutId;_call;constructor(){super(),this.permissionsUrl=null,this._call=null,this._reloadTimeoutId=-1,this._permissionCollection=Xs.ensure({type:pi.NONE}),this._permissionUpdateEventHandler=this._onPermissionUpdateNotify.bind(this)}init(e){this.permissionsUrl=u.assertParameter("permissionsUrl",e.permissionsUrl)}bootstrap(){return this._subscribeForNotifications().then(()=>this._load())}destroy(){this._unsubscribeFromNotifications()}_subscribeForNotifications(){return js.subscribe("permissionsUpdate",this._permissionUpdateEventHandler)}_unsubscribeFromNotifications(){js.unsubscribe("permissionsUpdate",this._permissionUpdateEventHandler)}_onPermissionUpdateNotify(e){const t=e.message,i=js.computeReloadDelay(t.reloadDelayWindow);h().log.info(`About to refresh permission cache with a delay of ${i}ms.`),this._reloadTimeoutId>0&&clearTimeout(this._reloadTimeoutId),this._reloadTimeoutId=setTimeout(()=>{this._reloadTimeoutId=-1,this._load().catch(s=>{u.create(ri,{displayError:!1}).handle(s)})},i)}_load(){return this._loadPermissionCollection().always(()=>{this._call=null}).then(e=>{this._permissionCollection=Xs.ensure(e)})}_loadPermissionCollection(){return this._call?.abort(),this._call=lt.createCallDataObject({url:this.permissionsUrl,method:"GET",cache:!0},null,{maxRetries:-1,retryIntervals:[300,500,1e3,5e3]}),this._call.call()}check(e,t){return this._permissionCollection?this._permissionCollection.implies(e,t):t?!1:h().resolvedPromise(!1)}getGrantedPermissionLevel(e){return this._permissionCollection?this._permissionCollection.getGrantedPermissionLevel(e):tt.Level.UNDEFINED}}let hn=class extends se{reloadDelayWindow};xs([Reflect.metadata("scout.m.t",Number)],hn.prototype,"reloadDelayWindow",void 0),hn=xs([ue("scout.PermissionUpdateMessage")],hn);let Ys=class extends se{id;objectType;level};xs([Reflect.metadata("scout.m.t",String)],Ys.prototype,"id",void 0),xs([Reflect.metadata("scout.m.t",String)],Ys.prototype,"objectType",void 0),xs([Reflect.metadata("scout.m.t","PermissionLevel")],Ys.prototype,"level",void 0),Ys=xs([ue("scout.Permission")],Ys);let vr=class extends se{permissions;type};xs([Reflect.metadata("scout.m.t",{objectType:"Record",typeArgs:[String,{objectType:Array,typeArgs:["PermissionDo"]}]})],vr.prototype,"permissions",void 0),xs([Reflect.metadata("scout.m.t","PermissionCollectionType")],vr.prototype,"type",void 0),vr=xs([ue("scout.PermissionCollection")],vr),window.scout.DataObjectInventory.get().add(hn,"scout.PermissionUpdateMessage","PermissionUpdateMessageDo"),window.scout.DataObjectInventory.get().add(Ys,"scout.Permission","PermissionDo"),window.scout.DataObjectInventory.get().add(vr,"scout.PermissionCollection","PermissionCollectionDo");class tt{id;level;constructor(){this.id=null,this.level=tt.Level.UNDEFINED}static Level={UNDEFINED:-1,NONE:0,ALL:100};init(e){e=e||{},this.id=u.assertParameter("id",_.nullIfEmpty(e.id)),this.level=u.nvl(e.level,this.level)}implies(e,t){return this.matches(e)&&this.level!==tt.Level.NONE?t?this._evalPermissionQuick(e):this._evalPermission(e):t?!1:$.resolvedPromise(!1)}matches(e){return e instanceof tt&&this.id===e.id}_evalPermissionQuick(e){return!0}_evalPermission(e){return $.resolvedPromise(this._evalPermissionQuick(e))}static quick(e){return e?tt.ensure({id:e}):null}static ensure(e){return!e||e instanceof tt?e:(e.objectType||(e.objectType=tt),u.create(e))}}class Xs extends zt{permissions;type;constructor(){super(),this.permissions=new Map,this.type=pi.DEFAULT}init(e){e=e||{},this.permissions=u.nvl(e.permissions,this.permissions),this.type=u.nvl(e.type,this.type),this._setPermissions(this.permissions),this._setType(this.type)}setPermissions(e){this.setProperty("permissions",e)}_setPermissions(e){e=Xs._ensurePermissionMap(e),this._setProperty("permissions",e)}setType(e){this.setProperty("type",e)}_setType(e){Object.values(pi).includes(e)||(e=pi.DEFAULT),this._setProperty("type",e)}implies(e,t){if(!e)return t?!1:$.resolvedPromise(!1);switch(this.type){case pi.DEFAULT:{const i=this.permissions.get(e.id);if(!i||!i.size)return t?!1:$.resolvedPromise(!1);if(t){for(const o of i)if(o.implies(e,t))return!0;return!1}const s=$.Deferred(),r=[];for(const o of i)r.push(o.implies(e,!1).then(l=>{l&&s.resolve(!0)}));return $.promiseAll(r).then(o=>s.resolve(!1)),s.promise()}case pi.ALL:return t?!0:$.resolvedPromise(!0);case pi.NONE:return t?!1:$.resolvedPromise(!1)}}getGrantedPermissionLevel(e){if(!e||!(e instanceof tt))return tt.Level.UNDEFINED;switch(this.type){case pi.DEFAULT:{const t=this.permissions.get(e.id);if(!t||!t.size)return tt.Level.NONE;const i=new Set;for(const s of t)s.matches(e)&&i.add(s.level);switch(i.size){case 0:return tt.Level.NONE;case 1:return i.values().next().value;default:return tt.Level.UNDEFINED}}case pi.ALL:return tt.Level.ALL;case pi.NONE:return tt.Level.NONE}}static ensure(e){return!e||e instanceof Xs?e:(e.objectType||(e.objectType=Xs),u.create(e))}static _ensurePermissionMap(e){if(b.isPojo(e)&&(e=new Map(Object.entries(e))),!(e instanceof Map))return new Map;const t=new Map;for(const[i,s]of e){if(!i||!s||Array.isArray(s)&&!s.length||s instanceof Set&&!s.size)continue;const r=new Set;for(const o of s){const l=tt.ensure(o);l&&r.add(l)}r.size&&t.set(i,r)}return t}}var pi;(function(n){n.DEFAULT="DEFAULT",n.ALL="ALL",n.NONE="NONE"})(pi||(pi={}));class vt extends ot{objectType;partId;url;userAgent;locale;textMap;ready;unloading;unloaded;loggedOut;inspector;persistent;offline;inDevelopmentMode;desktop;layoutValidator;focusManager;keyStrokeManager;modelAdapter;uiSessionId;clientSessionId;forceNewClientSession;remoteUrl;unloadUrl;modelAdapterRegistry;sharedVariableMap;ajaxCalls;asyncEvents;currentEvent;responseQueue;requestsPendingCounter;suppressErrors;requestTimeoutCancel;requestTimeoutPoll;requestTimeoutPing;backgroundJobPollingSupport;reconnector;processingEvents;adapterExportEnabled;requestSequenceNo;ajaxCallOptions;rootAdapter;root;widget;$entryPoint;_adapterDataCache;_deferredEventTypes;_deferred;_fatalMessagesOnScreen;_retryRequest;_queuedRequest;_asyncDelay;_sendTimeoutId;_cancellationHandler;constructor(){super(),this.$entryPoint=null,this.partId="0",this.url=new wt,this.userAgent=new _h({deviceType:w.get().type,touch:w.get().supportsOnlyTouch(),standalone:w.get().isStandalone()}),this.locale=new Dt,this.textMap=new Ds,this.ready=!1,this.unloading=!1,this.unloaded=!1,this.loggedOut=!1,this.inspector=!1,this.persistent=!1,this.offline=!1,this.inDevelopmentMode=!1,this.desktop=null,this.layoutValidator=new yh,this.focusManager=null,this.keyStrokeManager=null,this.uiSessionId=null,this.clientSessionId=this._getClientSessionIdFromStorage(),this.forceNewClientSession=!1,this.remoteUrl="json",this.unloadUrl="unload",this.modelAdapterRegistry={},this.ajaxCalls=[],this.asyncEvents=[],this.currentEvent=null,this.responseQueue=new dn(this),this.requestsPendingCounter=0,this.suppressErrors=!1,this.requestTimeoutCancel=5e3,this.requestTimeoutPoll=75e3,this.requestTimeoutPing=5e3,this.backgroundJobPollingSupport=new ch(!0),this.reconnector=new mh(this),this.processingEvents=!1,this.adapterExportEnabled=!1,this.sharedVariableMap={},this._adapterDataCache={},this._deferred=null,this._fatalMessagesOnScreen={},this._retryRequest=null,this._queuedRequest=null,this.requestSequenceNo=0,this.rootAdapter=new K,this.ajaxCallOptions=null,this.rootAdapter.init({session:this,id:"1",objectType:"RootAdapter"});let e=new Cs;e.session=this,e.initialized=!0,this.root=this.rootAdapter.createWidget({session:this,id:"1",objectType:"NullWidget"},e),this.widget=this.root,this._cancellationHandler=t=>this._sendCancelRequest()}static JsonResponseError={STARTUP_FAILED:5,SESSION_TIMEOUT:10,UI_PROCESSING:20,UNSAFE_UPLOAD:30,REJECTED_UPLOAD:31,VERSION_MISMATCH:40};static EMPTY_UPLOAD_FILENAME="*empty*";static POLLING_GRACE_PERIOD=15;init(e){let t=e||{};if(!t.$entryPoint)throw new Error("$entryPoint is not defined");this.$entryPoint=t.$entryPoint,this.partId=u.nvl(t.portletPartId,this.partId),this.forceNewClientSession=u.nvl(this.url.getParameter("forceNewClientSession"),t.forceNewClientSession),this.forceNewClientSession?this.clientSessionId=null:this.clientSessionId=u.nvl(t.clientSessionId,this.clientSessionId),this.userAgent=u.nvl(t.userAgent,this.userAgent),this.suppressErrors=u.nvl(t.suppressErrors,this.suppressErrors),t.locale&&this._setLocaleAndTexts(Dt.ensure(t.locale)),t.backgroundJobPollingEnabled===!1&&(this.backgroundJobPollingSupport.enabled=!1),h().extend(this.reconnector,t.reconnectorOptions),this.ajaxCallOptions=t.ajaxCallOptions,this._initInspector(),this.url.getParameter("adapterExportEnabled")==="true"&&(this.adapterExportEnabled=!0),this.focusManager=new Rh({session:this,active:t.focusManagerActive}),this.keyStrokeManager=u.create(Ph,{session:this})}_initInspector(){let e=Ki.get("scout.devMode")?.value,t=_.parseBoolean(this.url.getParameter("debug")),i=_.parseBoolean(this.url.getParameter("inspector"));this.inspector=u.nvl(i,t,e,!1)}_throwError(e){if(!this.suppressErrors)throw new Error(e)}getSharedVariable(e){return this.sharedVariableMap[e]}unregisterModelAdapter(e){delete this.modelAdapterRegistry[e.id]}registerModelAdapter(e){if(e.id===void 0)throw new Error("modelAdapter.id must be defined");this.modelAdapterRegistry[e.id]=e}getModelAdapter(e){return this.modelAdapterRegistry[e]}getWidget(e){if(!e)return null;if(typeof e!="string")throw new Error("typeof adapterId must be string");let t=this.getModelAdapter(e);return t?t.widget:null}getOrCreateWidget(e,t,i){if(!e)return null;if(typeof e!="string")throw new Error("typeof adapterId must be string");let s=this.getWidget(e);if(s)return s;let r=this._getAdapterData(e);if(!r){if(u.nvl(i,!0))throw new Error("no adapterData found for adapterId="+e);return null}return this.createModelAdapter(r).createWidget(r,t)}createModelAdapter(e){let t=e.objectType,i={},s=ni.parse(t);s.modelVariant?(t=s.objectType.toString()+"Adapter"+Le.MODEL_VARIANT_SEPARATOR+s.modelVariant.toString(),i.variantLenient=!0):t=s.objectType.toString()+"Adapter";let r={id:e.id,session:this},o=u.create(t,r,i);return h().log.isTraceEnabled()&&h().log.trace("created new adapter "+o),o}sendEvent(e,t){t=t||0,this.asyncEvents=this._coalesceEvents(this.asyncEvents,e),this.asyncEvents.push(e),this._asyncDelay=Math.min(t,u.nvl(this._asyncDelay,t)),clearTimeout(this._sendTimeoutId),this._sendTimeoutId=setTimeout(()=>{this._sendTimeoutId=null,this._asyncDelay=null,!this.areRequestsPending()&&this._sendNow()},this._asyncDelay)}_sendStartupRequest(){let e=this._newRequest({startup:!0});this.partId&&(e.partId=this.partId),this.clientSessionId&&(e.clientSessionId=this.clientSessionId),G.get().version&&(e.version=G.get().version),e.userAgent=this.userAgent,e.sessionStartupParams=this._createSessionStartupParams();let t=this.defaultAjaxOptions(e);return h().ajax(t).catch(s.bind(this)).then(i.bind(this));function i(r){return this._processStartupResponse(r).then(()=>r.error?h().rejectedPromise(r):r)}function s(r,o,l){this._processErrorResponse(r,o,l,e);for(var a=arguments.length,d=new Array(a>3?a-3:0),c=3;c<a;c++)d[c-3]=arguments[c];return h().rejectedPromise(r,o,l,...d)}}_createSessionStartupParams(){let e={url:this.url.baseUrlRaw,geolocationServiceAvailable:w.get().supportsGeolocation()},t=this.url.parameterMap;for(let i in t)e[i]=t[i];return e}_processStartupResponse(e){if(e.error&&this._processErrorJsonResponse(e.error))return h().resolvedPromise();if(he.removeItemFromSessionStorage("scout:versionMismatch"),!e.startupData)throw new Error("Missing startupData");if(this.persistent=e.startupData.persistent,this.inDevelopmentMode=!!Ki.get("scout.devMode")?.value,this.clientSessionId=e.startupData.clientSessionId,this._storeClientSessionIdInStorage(this.clientSessionId),this.uiSessionId=e.startupData.uiSessionId,h()(window).on("beforeunload."+this.uiSessionId,this._onWindowBeforeUnload.bind(this)).on("unload."+this.uiSessionId,this._onWindowUnload.bind(this)),e.startupData.reloadPage)return u.reloadPage(),h().resolvedPromise();e.startupData.inspector&&(this.inspector=!0),this.requestTimeoutPoll=(u.nvl(Ki.get("scout.ui.backgroundPollingMaxWaitTime")?.value,60)+vt.POLLING_GRACE_PERIOD)*1e3,this.modelAdapterRegistry[this.uiSessionId]=this,e.adapterData&&this._copyAdapterData(e.adapterData),this._setLocaleAndTexts(Dt.ensure(e.startupData.locale),e.startupData.textMap);let t=this._getAdapterData(e.startupData.clientSession);this.modelAdapter=this.createModelAdapter(t),this.modelAdapter._initProperties(t),this.desktop=this.getOrCreateWidget(t.desktop,this.rootAdapter.widget),G.get()._triggerDesktopReady(this.desktop);const i=h().Deferred();return this.render(()=>this._renderDesktopImpl(e)).then(()=>this.onRequestsDone(()=>i.resolve())),i.promise()}_renderDesktopImpl(e){if(this._renderDesktop(),e.events){this.processingEvents=!0;try{this._processEvents(e.events)}finally{this.processingEvents=!1}}this.layoutValidator.validate(),this.focusManager.validateFocus(),this._resumeBackgroundJobPolling(),this.ready=!0,G.get()._triggerSessionReady(this),h().log.isInfoEnabled()&&h().log.info("Session initialized. Detected "+w.get()),h().log.isDebugEnabled()&&(h().log.isDebugEnabled()&&h().log.debug("size of _adapterDataCache after session has been initialized: "+b.countOwnProperties(this._adapterDataCache)),h().log.isDebugEnabled()&&h().log.debug("size of modelAdapterRegistry after session has been initialized: "+b.countOwnProperties(this.modelAdapterRegistry)))}_storeClientSessionIdInStorage(e){let t="scout:clientSessionId";he.removeItemFromSessionStorage(t),he.removeItemFromLocalStorage(t),this.persistent?he.setItemToLocalStorage(t,e):he.setItemToSessionStorage(t,e)}_getClientSessionIdFromStorage(){let e="scout:clientSessionId",t=he.getItemFromSessionStorage(e);return t||(t=he.getItemFromLocalStorage(e)),t}render(e){return Re.loadingComplete?(e(),h().resolvedPromise()):Re.preloader().then(e)}_sendUnloadRequest(){let e=this._newRequest({unload:!0,showBusyIndicator:!1});this._sendRequest(e)}_sendNow(){if(this.asyncEvents.length===0)return;let e=[];this.asyncEvents.some((i,s)=>i.newRequest&&e.length>0?!0:(e.push(i),!1));let t=this._newRequest({events:e});t.showBusyIndicator=t.events.some(i=>u.nvl(i.showBusyIndicator,!0)),this.responseQueue.prepareRequest(t),this._sendRequest(t),this.asyncEvents=this.asyncEvents.slice(e.length)}_coalesceEvents(e,t){if(!t.coalesce)return e;let i=h().negate(t.coalesce).bind(t);return e.filter(i)}_sendRequest(e){if(!e||this.loggedOut)return;if(this.offline&&!e.unload){this._handleSendWhenOffline(e);return}if(e.unload&&navigator.sendBeacon){navigator.sendBeacon(this.unloadUrl+"/"+this.uiSessionId,"");return}let t=this.defaultAjaxOptions(e),i=u.nvl(e.showBusyIndicator,!0);e.unload&&(t.async=!1),this._performUserAjaxRequest(t,i,e)}_handleSendWhenOffline(e){e.events&&(this._queuedRequest?this._queuedRequest.events?(e.events.forEach(t=>{this._queuedRequest.events=this._coalesceEvents(this._queuedRequest.events,t)}),this._queuedRequest.events=this._queuedRequest.events.concat(e.events)):this._queuedRequest.events=e.events:this._queuedRequest=e,this.layoutValidator.validate())}defaultAjaxOptions(e){e=e||this._newRequest();let i={method:"POST",dataType:"json",contentType:"application/json; charset=UTF-8",cache:!1,url:this._decorateUrl(this.remoteUrl,e),data:this._requestToJson(e)};return i.timeout=0,e.cancel&&(i.timeout=this.requestTimeoutCancel),e.ping&&(i.timeout=this.requestTimeoutPing),e.pollForBackgroundJobs&&(i.timeout=this.requestTimeoutPoll),i}_decorateUrl(e,t){let i=null;return t.unload?i="unload":t.pollForBackgroundJobs?i="poll":t.ping?i="ping":t.cancel?i="cancel":t.log?i="log":t.syncResponseQueue&&(i="sync"),i&&(e=new wt(e).addParameter(i).toString()),e}_getRequestName(e,t){if(e){if(e.unload)return"unload";if(e.pollForBackgroundJobs)return"pollForBackgroundJobs";if(e.ping)return"ping";if(e.cancel)return"cancel";if(e.log)return"log";if(e.syncResponseQueue)return"syncResponseQueue"}return t}_requestToJson(e){return JSON.stringify(e,function(t,i){return this===e&&t==="showBusyIndicator"||this instanceof al&&u.isOneOf(t,"showBusyIndicator","coalesce","newRequest")?void 0:i})}_callAjax(e){let t={retryIntervals:[100,500,500,500]},i=u.create(Gs,h().extend(t,e,this.ajaxCallOptions));return this.registerAjaxCall(i),i.call().always(this.unregisterAjaxCall.bind(this,i))}_performUserAjaxRequest(e,t,i){t&&this._setBusy(!0),this.setRequestPending(!0);let s=null,r=!1;this._callAjax({ajaxOptions:e,name:this._getRequestName(i,"user request")}).done(o.bind(this)).fail(l.bind(this)).always(a.bind(this));function o(d){try{t&&!this.areBusyIndicatedEventsQueued()&&this._setBusy(!1),r=this.responseQueue.process(d)}catch(c){s=s||c}}function l(d){try{t&&this._setBusy(!1),this._processErrorResponse(d.jqXHR,d.textStatus,d.errorThrown,i)}catch(c){s=s||c}}function a(d,c,f){if(this.setRequestPending(!1),r){if(this._resumeBackgroundJobPolling(),this._fireRequestFinished(d),this._retryRequest){let g=this._retryRequest;this._retryRequest=null,this.responseQueue.prepareRequest(g),this._sendRequest(g)}else if(this._queuedRequest){let g=this._queuedRequest;this._queuedRequest=null,this.responseQueue.prepareRequest(g),this._sendRequest(g)}this._sendTimeoutId||this._sendNow()}else this._setBusy(!1);if(this.layoutValidator.validate(),s)throw s}}_setBusy(e){this.desktop?.setBusy({busy:e,force:!0,renderDelay:500,busyIndicatorModel:{cancellable:!0},onCancel:this._cancellationHandler})}registerAjaxCall(e){this.ajaxCalls.push(e)}unregisterAjaxCall(e){p.remove(this.ajaxCalls,e)}interruptAllAjaxCalls(){this.ajaxCalls.slice().forEach(e=>e.pendingCall&&e.pendingCall.abort())}abortAllAjaxCalls(){this.ajaxCalls.slice().forEach(e=>e.abort())}_resumeBackgroundJobPolling(){this.backgroundJobPollingSupport.enabled&&this.backgroundJobPollingSupport.status!==it.RUNNING&&(h().log.isInfoEnabled()&&h().log.info("Resume background jobs polling request, status was="+this.backgroundJobPollingSupport.status),this._pollForBackgroundJobs())}_pollForBackgroundJobs(){this.backgroundJobPollingSupport.setRunning();let e=this._newRequest({pollForBackgroundJobs:!0});this.responseQueue.prepareRequest(e);let t=this.defaultAjaxOptions(e);this._callAjax({ajaxOptions:t,name:this._getRequestName(e,"request")}).done(i.bind(this)).fail(s.bind(this));function i(r){if(r.error)r.error.code===vt.JsonResponseError.SESSION_TIMEOUT?(h().log.info("Session timeout, stopped polling for background jobs"),this.backgroundJobPollingSupport.setStopped()):(h().log.warn("Polling request failed. Interrupt polling until the next user-initiated request succeeds"),this.backgroundJobPollingSupport.setFailed()),this.areRequestsPending()?this.responseQueue.add(r):this.responseQueue.process(r);else if(r.sessionTerminated)h().log.info("Session terminated, stopped polling for background jobs"),this.backgroundJobPollingSupport.setStopped(),!this.loggedOut&&r.redirectUrl&&this.logout(r.redirectUrl);else try{this.areRequestsPending()?this.responseQueue.add(r):(this.responseQueue.process(r),this.layoutValidator.validate()),setTimeout(this._pollForBackgroundJobs.bind(this))}catch(o){throw this.backgroundJobPollingSupport.setFailed(),o}}function s(r){this.backgroundJobPollingSupport.setFailed(),this._processErrorResponse(r.jqXHR,r.textStatus,r.errorThrown,e)}}processJsonResponseInternal(e){let t=!0;return e.error&&(t=!this._processErrorJsonResponse(e.error)),t&&this._processSuccessResponse(e),t}_processSuccessResponse(e){if(e.adapterData&&this._copyAdapterData(e.adapterData),e.events){this.processingEvents=!0;try{this._processEvents(e.events)}finally{this.processingEvents=!1}}if(h().log.isDebugEnabled()){let t=b.countOwnProperties(this._adapterDataCache);h().log.trace("size of _adapterDataCache after response has been processed: "+t),t=b.countOwnProperties(this.modelAdapterRegistry),h().log.trace("size of modelAdapterRegistry after response has been processed: "+t)}}_copyAdapterData(e){let t=0,i;for(i in e)this._adapterDataCache[i]=e[i],t++;t>0&&h().log.isTraceEnabled()&&h().log.trace("Stored "+t+" properties in adapterDataCache")}_processErrorResponse(e,t,i,s){if(h().log.error("errorResponse: status="+e.status+", textStatus="+t+", errorThrown="+i),Gs.isOfflineError(e,t,i)){if(this.ready){this.goOffline(),s&&!s.pollForBackgroundJobs&&!this._retryRequest&&(this._retryRequest=s);return}i=i||this.optText("ui.ConnectionInterrupted","Connection interrupted")}let o={header:this.optText("ui.NetworkError","Network error"),body:_.join(" ",e.status+""||"",i),yesButtonText:this.optText("ui.Reload","Reload"),yesButtonAction:()=>u.reloadPage(),iconId:q.SLIPPERY};this.showFatalMessage(o,e.status+".net")}_processErrorJsonResponse(e){let t=!0;if(e.code===vt.JsonResponseError.VERSION_MISMATCH){if(!he.getItemFromSessionStorage("scout:versionMismatch"))return he.setItemToSessionStorage("scout:versionMismatch","yes"),u.reloadPage(),t;he.removeItemFromSessionStorage("scout:versionMismatch")}if(this.loggedOut)return t;let i={header:this.optText("ui.ServerError","Server error")+" ("+this.optText("ui.ErrorCodeX","Code "+e.code,e.code+"")+")",body:e.message,yesButtonText:this.optText("ui.Reload","Reload"),yesButtonAction:()=>{u.reloadPage()}};return e.code===vt.JsonResponseError.STARTUP_FAILED?(i.header=e.message,i.body=null,i.yesButtonText="Retry",i.iconId=q.SLIPPERY):e.code===vt.JsonResponseError.SESSION_TIMEOUT?(i.header=this.optText("ui.SessionTimeout",i.header),i.body=this.optText("ui.SessionExpiredMsg",i.body),i.iconId=q.HOURGLASS):e.code===vt.JsonResponseError.UI_PROCESSING?(i.header=this.optText("ui.UnexpectedProblem",i.header),i.body=_.join(`
`,this.optText("ui.InternalProcessingErrorMsg",i.body," ("+this.optText("ui.ErrorCodeX","Code 20","20")+")"),this.optText("ui.UiInconsistentMsg","")),i.iconId=q.SLIPPERY,this.inDevelopmentMode&&(i.noButtonText=this.optText("ui.Ignore","Ignore"))):e.code===vt.JsonResponseError.UNSAFE_UPLOAD?(i.header=this.optText("ui.UnsafeUpload",i.header),i.body=this.optText("ui.UnsafeUploadMsg",i.body),i.yesButtonText=this.optText("ui.Ok","Ok"),i.yesButtonAction=null,t=!1):e.code===vt.JsonResponseError.REJECTED_UPLOAD&&(i.header=this.optText("ui.RejectedUpload",i.header),i.body=this.optText("ui.RejectedUploadMsg",i.body),i.yesButtonText=this.optText("ui.Ok","Ok"),i.yesButtonAction=null,t=!1),this.showFatalMessage(i,e.code+""),t}_fireRequestFinished(e){if(this._deferred){if(e.events)for(let t=0;t<e.events.length;t++)this._deferredEventTypes.push(e.events[t].type);this.requestsPendingCounter===0&&(this._deferred.resolve(this._deferredEventTypes),this._deferred=null,this._deferredEventTypes=null)}}showFatalMessage(e,t){if(t||(t=G.get().errorHandler.getJsErrorCode()),this._fatalMessagesOnScreen[t])return h().resolvedPromise();this._fatalMessagesOnScreen[t]=!0,e=e||{};let i={session:this,parent:this.desktop||new Cs,iconId:e.iconId,severity:u.nvl(e.severity,E.Severity.ERROR),header:e.header,body:e.body,hiddenText:e.hiddenText,yesButtonText:e.yesButtonText,noButtonText:e.noButtonText,cancelButtonText:e.cancelButtonText},s=u.create(jt,i),r=e.entryPoint||this.$entryPoint;return s.on("action",o=>{delete this._fatalMessagesOnScreen[t],s.destroy();let l=o.option;l===jt.Buttons.YES&&e.yesButtonAction?e.yesButtonAction.apply(this):l===jt.Buttons.NO&&e.noButtonAction?e.noButtonAction.apply(this):l===jt.Buttons.CANCEL&&e.cancelButtonAction&&e.cancelButtonAction.apply(this)}),s.render(r),s.when("action").then(()=>{})}isFatalMessageShown(){return Object.keys(this._fatalMessagesOnScreen).length>0}uploadFiles(e,t,i,s,r){let o=new FormData,l=[];if(i&&h().each(i,(c,f)=>{o.append(c,f)}),h().each(t,(c,f)=>{if(!r||r.length===0||u.isOneOf(f.type,r)){let g=u.nvl(f.scoutName,f.name,vt.EMPTY_UPLOAD_FILENAME);o.append("files",f,g),l.push(f)}}),s=u.nvl(s,Ei.DEFAULT_MAXIMUM_UPLOAD_SIZE),!Gt.validateMaximumUploadSize(l,s)){let c={header:this.text("ui.FileSizeLimitTitle"),body:Gt.getErrorMessageMaximumUploadSizeExceeded(this,s),yesButtonText:this.optText("Ok","Ok")};return this.showFatalMessage(c),!1}let a={method:"POST",url:"upload/"+this.uiSessionId+"/"+e.id,cache:!1,processData:!1,contentType:!1,data:o};this.responseQueue.prepareHttpRequest(a);let d=!this.areRequestsPending();return this._performUserAjaxRequest(a,d),!0}goOffline(){this.offline||(this.offline=!0,this.abortAllAjaxCalls(),setTimeout(()=>{this.unloading||this.unloaded||(this.rootAdapter.goOffline(),this.reconnector.start())},100))}goOnline(){this.offline=!1,this.rootAdapter.goOnline();let e=this._newRequest({syncResponseQueue:!0});this.responseQueue.prepareRequest(e),this._sendRequest(e)}onReconnecting(){this.desktop&&this.desktop.onReconnecting()}onReconnectingSucceeded(){this.desktop&&this.desktop.onReconnectingSucceeded(),this.goOnline()}onReconnectingFailed(){this.desktop&&this.desktop.onReconnectingFailed()}listen(){return this._deferred||(this._deferred=h().Deferred(),this._deferredEventTypes=[]),this._deferred}onRequestsDone(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];this.areRequestsPending()||this.areEventsQueued()?this.listen().done(r):e.apply(this,i);function r(){e.apply(this,i)}}onEventsProcessed(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];this.processingEvents?this.one("eventsProcessed",r):r();function r(){e.apply(this,i)}}areEventsQueued(){return this.asyncEvents.length>0}areBusyIndicatedEventsQueued(){return this.asyncEvents.some(e=>u.nvl(e.showBusyIndicator,!0))}areResponsesQueued(){return this.responseQueue.size()>0}areRequestsPending(){return this.requestsPendingCounter>0}setRequestPending(e){e?this.requestsPendingCounter++:this.requestsPendingCounter--,this.inspector&&this.$entryPoint.toggleAttr("data-request-pending",e,"true")}_sendCancelRequest(){let e=this._newRequest({cancel:!0,showBusyIndicator:!1});this._sendRequest(e)}sendLogRequest(e,t){let i=this._newRequest({log:!0,message:e,level:u.nvl(t,W.ERROR)});this.currentEvent&&(i.event={target:this.currentEvent.target,type:this.currentEvent.type}),h().ajax(this.defaultAjaxOptions(i))}_newRequest(e){let t=h().extend({uiSessionId:this.uiSessionId},e);return!t.log&&!t.syncResponseQueue&&(t["#"]=this.requestSequenceNo++),t}_processEvents(e){let t=0;for(;t<e.length;){let i=e[t];this.currentEvent=i;let s=this.getModelAdapter(i.target);if(!s){h().log.isDebugEnabled()&&h().log.debug("Postponing '"+i.type+"' for adapter with ID "+i.target),t++;continue}e.splice(t,1),t=0,h().log.isDebugEnabled()&&h().log.debug("Processing event '"+i.type+"' for adapter with ID "+i.target),s.onModelEvent(i),s.resetEventFilters()}if(this.currentEvent=null,e.length)throw new Error("Could not resolve event targets: ["+e.map(i=>{let s="target: "+i.target+", type: "+i.type;return i.properties&&(s+=", properties: "+Object.keys(i.properties)),'"'+s+'"'},this).join(", ")+"]");this.trigger("eventsProcessed")}start(){return h().log.isInfoEnabled()&&h().log.info("Session starting..."),this._sendStartupRequest()}onModelEvent(e){e.type==="localeChanged"?this._onLocaleChanged(e):e.type==="logout"?this._onLogout(e):e.type==="disposeAdapter"?this._onDisposeAdapter(e):e.type==="reloadPage"?this._onReloadPage(e):h().log.warn('Model action "'+e.type+'" is not supported by UI session')}resetEventFilters(){}destroy(){}exportAdapterData(e){return e}_onLocaleChanged(e){let t=Dt.ensure(e.locale),i=new Ds(e.textMap);this.switchLocale(t,i)}switchLocale(e,t){u.assertParameter("locale",e,Dt),this._setLocaleAndTexts(e,t),this.trigger("localeSwitch",{locale:this.locale})}_setLocaleAndTexts(e,t){this.locale=e,this.textMap=de.get(e.languageTag),this.textMap.addAll(t),u.setDocumentLocale(e)}_renderDesktop(){this.desktop.render(this.$entryPoint),this.desktop.invalidateLayoutTree(!1)}_onLogout(e){this.logout(e.redirectUrl)}logout(e){if(this.loggedOut=!0,this.forceNewClientSession)this.desktop.$container.window(!0).close();else{let t=new wt;t.removeParameter("dl"),t.removeParameter("i"),he.setItemToSessionStorage("scout:loginUrl",t.toString()),setTimeout(()=>{u.reloadPage({redirectUrl:e})})}}_onDisposeAdapter(e){let t=this.getModelAdapter(e.adapter);t&&t.destroy()}_onReloadPage(e){u.reloadPage({clearBody:!1})}_onWindowBeforeUnload(e){h().log.isInfoEnabled()&&h().log.info("Session before unloading..."),this.unloading=!0,setTimeout(()=>{this.unloading=!1},200)}_onWindowUnload(){h().log.isInfoEnabled()&&h().log.info("Session unloading..."),this.unloaded=!0,this.desktop&&this.desktop.formController&&this.desktop.formController.closePopupWindows(),this.loggedOut||this._sendUnloadRequest(),this.loggedOut&&this.persistent&&he.removeItemFromLocalStorage("scout:clientSessionId")}_getAdapterData(e){let t=this._adapterDataCache[e];return!this.adapterExportEnabled&&delete this._adapterDataCache[e],t}getAdapterData(e){return this._adapterDataCache[e]}text(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return this.textMap.get(e,...i)}optText(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return this.textMap.optGet(e,t,...s)}textExists(e){return this.textMap.exists(e)}}class xf extends K{_initProperties(e){super._initProperties(e),this.session.sharedVariableMap=e.sharedVariableMap||{}}_writeProperty(e,t){this.session[e]=t}}var it;(function(n){n.STOPPED="stopped",n.RUNNING="running",n.FAILURE="failure"})(it||(it={}));class ch{enabled;status;constructor(e){this.enabled=!!e,this.status=it.STOPPED}setFailed(){this.status=it.FAILURE}setRunning(){this.status=it.RUNNING}setStopped(){this.status=it.STOPPED}isFailed(){return this.status===it.FAILURE}isRunning(){return this.status===it.RUNNING}isStopped(){return this.status===it.STOPPED}}class ph extends I{cancellable;showTimeout;label;details;cancelButton;boxButtons;_glassPaneRenderer;$content;$buttons;$label;$details;_busyIndicatorTimeoutId;constructor(){super(),this.cancellable=!0,this.showTimeout=2500,this.label=null,this.details=null,this.cancelButton=null,this.boxButtons=null,this._glassPaneRenderer=null,this.inheritAccessibility=!1,this.$content=null,this.$buttons=null,this.$label=null,this.$details=null,this._busyIndicatorTimeoutId=0,this._addWidgetProperties(["boxButtons","cancelButton"])}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new co(this,[m.SPACE,m.ENTER]),new fn(this,()=>this.cancelButton?this.cancelButton.$container:null)])}_init(e){super._init(e),this.label=u.nvl(this.label,this.session.text("ui.PleaseWait_")),this.cancellable&&(this.boxButtons=u.create(po,{parent:this}),this.cancelButton=this.boxButtons.addButton({text:this.session.text("Cancel")}),this.cancelButton.one("action",t=>this._onCancelClick(t)))}render(e){e=e||this.entryPoint(),super.render(e)}_render(){this.$container=this.$parent.appendDiv("busyindicator invisible"),T.role(this.$container,"alertdialog");let e=this.$container.appendDiv("drag-handle");this.$container.draggable(e),this.$content=this.$container.appendDiv("busyindicator-content"),this.$label=this.$content.appendDiv("busyindicator-label"),this.$details=this.$content.appendDiv("busyindicator-details"),this.cancellable?(this.boxButtons.render(),this.$buttons=this.boxButtons.$container,this.$buttons.addClass("busyindicator-buttons")):this.$content.addClass("no-buttons"),this._renderLabel(),this._renderDetails(),T.linkElementWithLabel(this.$container,this.$label),T.linkElementWithDescription(this.$container,this.$details),this.$container.addClass("calc-helper"),this.$container.css("min-width",this.$container.width()),this.$container.removeClass("calc-helper"),this._position(),this._busyIndicatorTimeoutId=setTimeout(()=>{this.$container.removeClass("invisible").addClassForAnimation("animate-open"),this.session.focusManager.validateFocus()},this.showTimeout),this._glassPaneRenderer=new Fr(this),this._glassPaneRenderer.renderGlassPanes(),this._glassPaneRenderer.eachGlassPane(t=>t.addClass("busy"))}_postRender(){super._postRender(),this.session.focusManager.installFocusContext(this.$container,Et.AUTO)}_remove(){clearTimeout(this._busyIndicatorTimeoutId),this._glassPaneRenderer.eachGlassPane(e=>e.removeClass("busy")),this._glassPaneRenderer.removeGlassPanes(),this.session.focusManager.uninstallFocusContext(this.$container),super._remove()}setLabel(e){this.setProperty("label",e)}_renderLabel(){this.$label.text(this.label||"")}setDetails(e){this.setProperty("details",e)}_renderDetails(){this.$details.html(_.nl2br(this.details)).setVisible(!!this.details)}_position(){this.$container.cssMarginLeft(-this.$container.outerWidth()/2)}close(){this.cancelButton&&this.cancelButton.$container&&this.session.focusManager.requestFocus(this.cancelButton.$container)&&(this.cancelButton.$container.focus(),this.cancelButton.doAction())}_onCancelClick(e){this.trigger("cancel",e)}cancelled(){this.rendered&&(this.$label.addClass("cancelled"),this.$buttons&&this.$buttons.remove(),this.$content.addClass("no-buttons"))}}class fh{objectType;defaultBusyIndicatorModel;defaultRenderDelay;busyIndicator;_busyCounter;_busyIndicatorTimeoutId;_cancellationCallbacks;constructor(){this.objectType=null,this.defaultBusyIndicatorModel=null,this.defaultRenderDelay=50,this.busyIndicator=null,this._busyCounter=0,this._busyIndicatorTimeoutId=null,this._cancellationCallbacks=[]}init(e){u.assertParameter("model",e);const t=u.assertParameter("parent",e.parent);this.defaultBusyIndicatorModel=h().extend({cancellable:!1,parent:t},e.busyIndicatorModel),this.defaultRenderDelay=u.nvl(e.renderDelay,this.defaultRenderDelay)}setDefaultRenderDelay(e){this.defaultRenderDelay=e}setDefaultBusyIndicatorModel(e){this.defaultBusyIndicatorModel=e}isBusy(){return this._busyCounter>0}setBusy(e){let t;b.isObject(e)?t=e:t={busy:!!e},t.renderDelay=u.nvl(t.renderDelay,this.defaultRenderDelay),t.busy?(this._busyCounter++,t.onCancel&&!p.contains(this._cancellationCallbacks,t.onCancel)&&this._cancellationCallbacks.push(t.onCancel),this._busyCounter===1&&this._startBusy(t)):(this._busyCounter>0&&(t.force?this._busyCounter=0:this._busyCounter--),this._busyCounter===0&&(this._cancellationCallbacks=[],this._stopBusy()))}_startBusy(e){if(this.busyIndicator)return;const t=h().extend({},this.defaultBusyIndicatorModel,e.busyIndicatorModel,{parent:e.parent});this.busyIndicator=u.create(ph,t),this.busyIndicator.one("cancel",this._onBusyIndicatorCancel.bind(this)),e.renderDelay>0?this._busyIndicatorTimeoutId=setTimeout(()=>{this._busyIndicatorTimeoutId=null,this._renderBusy()},e.renderDelay):this._renderBusy()}_renderBusy(){this.busyIndicator?.parent?.rendered&&this.busyIndicator.render()}_stopBusy(){this.busyIndicator&&(this.busyIndicator.destroy(),this.busyIndicator=null),this._busyIndicatorTimeoutId&&(clearTimeout(this._busyIndicatorTimeoutId),this._busyIndicatorTimeoutId=null)}_onBusyIndicatorCancel(e){setTimeout(()=>this.busyIndicator?.cancelled(),100),this._cancellationCallbacks.forEach(t=>t(e))}}class al{target;type;showBusyIndicator;coalesce;newRequest;properties;constructor(e,t,i){u.assertParameter("target",e),u.assertParameter("type",t),h().extend(this,i),this.target=e,this.type=t}}class Dt{languageTag;language;country;displayLanguage;displayCountry;decimalFormatPatternDefault;decimalFormatSymbols;decimalFormat;dateFormatPatternDefault;dateFormatSymbols;timeFormatPatternDefault;dateFormat;constructor(e){e=u.nvl(e,Dt.DEFAULT),this.languageTag=e.languageTag;let t=ee.splitLanguageTag(this.languageTag);this.language=t[0],this.country=t[1],this.displayLanguage=e.displayLanguage,this.displayCountry=e.displayCountry,this.decimalFormatPatternDefault=e.decimalFormatPatternDefault,this.decimalFormatSymbols=e.decimalFormatSymbols,this.decimalFormatPatternDefault&&this.decimalFormatSymbols&&(this.decimalFormat=new Ps(this,this.decimalFormatPatternDefault)),this.dateFormatPatternDefault=e.dateFormatPatternDefault,this.dateFormatSymbols=e.dateFormatSymbols,this.timeFormatPatternDefault=e.timeFormatPatternDefault,this.dateFormatPatternDefault&&this.dateFormatSymbols&&(this.dateFormat=new St(this,this.dateFormatPatternDefault))}static ensure(e){return e?e instanceof Dt?e:new Dt(e):new Dt(Dt.DEFAULT)}static DEFAULT={languageTag:"en-US",decimalFormatPatternDefault:"#,##0.###",dateFormatPatternDefault:"MM/dd/yyyy",timeFormatPatternDefault:"h:mm a",decimalFormatSymbols:{decimalSeparator:".",groupingSeparator:",",minusSign:"-"},dateFormatSymbols:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],am:"AM",pm:"PM"}}}class gh{filters;_filterProperties;_defaultFilter;constructor(){this._filterProperties={},this._defaultFilter=this._propertiesFilter.bind(this),this.filters=[this._defaultFilter]}addFilterForProperties(e){b.copyProperties(e,this._filterProperties)}addFilter(e){this.filters.push(e)}filter(e,t){return this.filters.some(i=>i(e,t))}addFilterForPropertyName(e){this.filters.push((t,i)=>t===e)}_propertiesFilter(e,t){if(!this._filterProperties.hasOwnProperty(e))return!1;let i=this._filterProperties[e];return b.equals(i,t)}reset(){this._filterProperties={},this.filters=[this._defaultFilter]}}class mh{session;started;initialDelay;interval;minPingDuration;pingStartTimestamp;constructor(e){this.session=e,this.started=!1,this.initialDelay=1e3,this.interval=3e3,this.minPingDuration=1e3}start(){this.started||(h().log.isTraceEnabled()&&h().log.trace("[ajax reconnector] start"),this.started=!0,this._schedulePing(this.initialDelay))}stop(){this.started=!1}_schedulePing(e){h().log.isTraceEnabled()&&h().log.trace("[ajax reconnector] schedule ping() in "+e+" ms"),setTimeout(this._ping.bind(this),e)}_ping(){this.session.onReconnecting();let e=this.session.defaultAjaxOptions(this.session._newRequest({ping:!0}));h().log.isTraceEnabled()&&h().log.trace("[ajax reconnector] "+e.method+' "'+e.url+'"'),this.pingStartTimestamp=Date.now(),h().ajax(e).done(this._onPingDone.bind(this)).fail(this._onPingFail.bind(this))}_onPingDone(e,t,i){h().log.isTraceEnabled()&&h().log.trace("[ajax reconnector] ping success -> connection re-established!"),this.session.onReconnectingSucceeded(),this.stop()}_onPingFail(e,t,i){let s=(function(){h().log.isTraceEnabled()&&h().log.trace("[ajax reconnector] ping failed"),this.session.onReconnectingFailed(),this._schedulePing(this.interval)}).bind(this),r=Date.now()-this.pingStartTimestamp;r<this.minPingDuration?setTimeout(s,this.minPingDuration-r):s()}}class dn{session;queue;lastProcessedSequenceNo;nextExpectedSequenceNo;force;forceTimeoutId;constructor(e){this.session=e,this.queue=[],this.lastProcessedSequenceNo=0,this.nextExpectedSequenceNo=1,this.force=!1,this.forceTimeoutId=null}static FORCE_TIMEOUT=(vt.POLLING_GRACE_PERIOD+5)*1e3;add(e){let t=e&&e["#"];if(!(t&&t<=this.lastProcessedSequenceNo))if(t&&e.combined&&(this.lastProcessedSequenceNo=Math.max(t-1,this.lastProcessedSequenceNo),this.nextExpectedSequenceNo=Math.max(t,this.nextExpectedSequenceNo)),!t||this.queue.length===0)this.queue.push(e);else{let i=[],s=e;for(let r=0;r<this.queue.length;r++){let o=this.queue[r];o["#"]&&(s&&o["#"]>t&&(i.push(e),s=null),o["#"]<=this.lastProcessedSequenceNo)||i.push(o)}s&&i.push(s),this.queue=i}}process(e){e&&this.add(e);let t=!0,i=!1,s=[];for(let r=0;r<this.queue.length;r++){let o=this.queue[r],l=o["#"];if(l&&(this.nextExpectedSequenceNo&&!this.force&&!i&&(i=this._checkMissingResponse(l)),i)){s.push(o);continue}let a=this._handleResponse(o);e&&o===e&&(t=a),l&&(this.lastProcessedSequenceNo=l,this.nextExpectedSequenceNo=l+1)}return this.queue=s,this._checkTimeout(),t}size(){return this.queue.length}_handleResponse(e){return this.session.processJsonResponseInternal(e)}_checkMissingResponse(e){return this.nextExpectedSequenceNo!==e}_checkTimeout(){this.queue.length===0?(clearTimeout(this.forceTimeoutId),this.forceTimeoutId=null):this.forceTimeoutId||(this.forceTimeoutId=setTimeout(()=>{try{this._logTimeout()}catch{}this.force=!0;try{this.process()}finally{this.force=!1,this.forceTimeoutId=null}},dn.FORCE_TIMEOUT))}_logTimeout(){this.session.sendLogRequest("Expected response #"+this.nextExpectedSequenceNo+" still missing after "+dn.FORCE_TIMEOUT+" ms. Forcing response queue to process "+this.size()+" elements: "+this.queueToString())}prepareRequest(e){e["#ACK"]=this.lastProcessedSequenceNo}prepareHttpRequest(e){e.headers=e.headers||{},e.headers["X-Scout-#ACK"]=this.lastProcessedSequenceNo+""}queueToString(){return"["+this.queue.map(e=>"#"+e["#"]).join(", ")+"]"}}class _h{deviceType;touch;standalone;constructor(e){if(e=e||{},!e.deviceType)throw new Error("deviceType needs to be defined");this.deviceType=e.deviceType,this.touch=u.nvl(e.touch,!1),this.standalone=u.nvl(e.standalone,!1)}}class bh{filters;constructor(){this.filters=[]}addFilter(e){this.filters.push(e)}addFilterForEventType(e){this.filters.push(t=>t.type===e)}filter(e){return this.filters.some(t=>t(e))}reset(){this.filters=[]}}class F{width;height;constructor(e,t){e instanceof F?(this.width=e.width,this.height=e.height):(this.width=e||0,this.height=t||0)}toString(){return"Dimension[width="+this.width+" height="+this.height+"]"}equals(e){return e?this.width===e.width&&this.height===e.height:!1}clone(){return new F(this.width,this.height)}subtract(e){return new F(this.width-e.horizontal(),this.height-e.vertical())}add(e){return new F(this.width+e.horizontal(),this.height+e.vertical())}floor(){return new F(Math.floor(this.width),Math.floor(this.height))}ceil(){return new F(Math.ceil(this.width),Math.ceil(this.height))}}class We{top;right;bottom;left;constructor(e,t,i,s){e instanceof We?(this.top=e.top,this.right=e.right,this.bottom=e.bottom,this.left=e.left):(this.top=e||0,this.right=t||0,this.bottom=i||0,this.left=s||0)}toString(){return"Insets[top="+this.top+" right="+this.right+" bottom="+this.bottom+" left="+this.left+"]"}equals(e){return this.top===e.top&&this.right===e.right&&this.bottom===e.bottom&&this.left===e.left}clone(){return new We(this.top,this.right,this.bottom,this.left)}horizontal(){return this.right+this.left}vertical(){return this.top+this.bottom}floor(){return new We(Math.floor(this.top),Math.floor(this.right),Math.floor(this.bottom),Math.floor(this.left))}ceil(){return new We(Math.ceil(this.top),Math.ceil(this.right),Math.ceil(this.bottom),Math.ceil(this.left))}}class X{x;y;constructor(e,t){e instanceof X?(this.x=e.x,this.y=e.y):(this.x=e||0,this.y=t||0)}toString(){return"Point[x="+this.x+" y="+this.y+"]"}equals(e){return e?this.x===e.x&&this.y===e.y:!1}clone(){return new X(this.x,this.y)}add(e){return new X(this.x+e.x,this.y+e.y)}subtract(e){return new X(this.x-e.x,this.y-e.y)}floor(){return new X(Math.floor(this.x),Math.floor(this.y))}ceil(){return new X(Math.ceil(this.x),Math.ceil(this.y))}}class te{x;y;width;height;constructor(e,t,i,s){e instanceof te?(this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height):(this.x=e||0,this.y=t||0,this.width=i||0,this.height=s||0)}toString(){return"Rectangle[x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"}equals(e){return e?this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height:!1}clone(){return new te(this.x,this.y,this.width,this.height)}center(){return new X(this.x+this.width/2,this.y+this.height/2)}right(){return this.x+this.width}bottom(){return this.y+this.height}contains(e,t){let i=new X(e,t);return i.y>=this.y&&i.y<this.bottom()&&i.x>=this.x&&i.x<this.right()}intersects(e){return e?e.width>0&&e.height>0&&this.width>0&&this.height>0&&e.x<this.right()&&e.right()>this.x&&e.y<this.bottom()&&e.bottom()>this.y:!1}intersect(e){if(!this.intersects(e))return new te;let t=new te(Math.max(this.x,e.x),Math.max(this.y,e.y));return t.width=Math.min(this.right(),e.right())-t.x,t.height=Math.min(this.bottom(),e.bottom())-t.y,t}subtract(e){return new te(this.x+e.left,this.y+e.top,this.width-e.horizontal(),this.height-e.vertical())}subtractFromDimension(e){return new te(this.x,this.y,this.width-e.horizontal(),this.height-e.vertical())}add(e){return new te(this.x-e.left,this.y-e.top,this.width+e.horizontal(),this.height+e.vertical())}translate(e,t){let i=this.point().add(new X(e,t));return this.moveTo(i)}moveTo(e,t){let i=new X(e,t);return new te(i.x,i.y,this.width,this.height)}point(){return new X(this.x,this.y)}dimension(){return new F(this.width,this.height)}union(e){let t=this.width,i=this.height;if(t<0||i<0)return new te(e.x,e.y,e.width,e.height);let s=e.width,r=e.height;if(s<0||r<0)return new te(this.x,this.y,this.width,this.height);let o=this.x,l=this.y;t+=o,i+=l;let a=e.x,d=e.y;return s+=a,r+=d,o>a&&(o=a),l>d&&(l=d),t<s&&(t=s),i<r&&(i=r),t-=o,i-=l,t>Number.MAX_VALUE&&(t=Number.MAX_VALUE),i>Number.MAX_VALUE&&(i=Number.MAX_VALUE),new te(o,l,t,i)}floor(){return new te(Math.floor(this.x),Math.floor(this.y),Math.floor(this.width),Math.floor(this.height))}ceil(){return new te(Math.ceil(this.x),Math.ceil(this.y),Math.ceil(this.width),Math.ceil(this.height))}}function l_(n,e,t,i,s){let r=e instanceof te?e:new te(e,t,i,s);n.cssLeft(r.x).cssTop(r.y).cssWidth(r.width).cssHeight(r.height)}function a_(n,e,t){let i=e instanceof F?e:new F(e,t);n.cssWidth(i.width).cssHeight(i.height)}function h_(n,e,t){let i=e instanceof X?e:new X(e,t);n.cssLeft(i.x).cssTop(i.y)}const C={prefSize(n,e){if(!n[0]||n.isDisplayNone())return new F(0,0);typeof e=="boolean"?e={includeMargin:e}:e=e||{};let t={includeMargin:!1,useCssSize:!1,widthHint:void 0,heightHint:void 0,restoreScrollPositions:!0};if(e=h().extend({},t,e),e.animateClasses&&e.animateClasses.length>0)return C.prefSizeWithoutAnimation(n,e);let i=n.attr("style"),s=n.attr("class"),r=n.scrollLeft(),o=n.scrollTop();e.restoreScrollPositions&&P.storeScrollPositions(n);let l=e.useCssSize?"":u.nvl(e.widthHint,"auto"),a=e.useCssSize?"":u.nvl(e.heightHint,"auto"),d={width:l,height:a};u.nvl(e.enforceSizeHints,!1)&&(b.isNumber(l)&&(d["max-width"]=l,d["min-width"]=l),b.isNumber(a)&&(d["max-height"]=a,d["min-height"]=a)),n.addClass("measure"),n.css(d);let c=n[0].getBoundingClientRect(),f=new F(c.width,c.height);return e.includeMargin&&(f.width+=n.cssMarginX(),f.height+=n.cssMarginY()),n.attrOrRemove("style",i),n.attrOrRemove("class",s),n.scrollLeft(r),n.scrollTop(o),e.restoreScrollPositions&&P.restoreScrollPositions(n),C.exactPrefSize(f,e)},exactPrefSize(n,e){return u.nvl(e.exact,!1)||(n.width=Math.ceil(n.width),n.height=Math.ceil(n.height)),n},prefSizeWithoutAnimation(n,e){let t=p.ensure(e.animateClasses);if(t=t.filter(o=>n.hasClass(o)),e=h().extend({},e),e.animateClasses=null,t.length===0)return C.prefSize(n,e);let i=p.format(t," "),s=n.clone().removeClass(i).appendTo(n.parent()),r=C.prefSize(s,e);return s.remove(),r},size(n,e){if(!n[0]||n.isDisplayNone())return new F(0,0);typeof e=="boolean"?e={includeMargin:e}:e=e||{};let t=n[0].getBoundingClientRect(),i=new F(t.width,t.height);return u.nvl(e.includeMargin,!1)&&(i.width+=n.cssMarginX(),i.height+=n.cssMarginY()),u.nvl(e.exact,!1)||(i.width=Math.ceil(i.width),i.height=Math.ceil(i.height)),i},cssSize(n){return new F(n.cssWidth(),n.cssHeight())},cssMaxSize(n){return new F(n.cssMaxWidth(),n.cssMaxHeight())},cssMinSize(n){return new F(n.cssMinWidth(),n.cssMinHeight())},setSize:a_,insets(n,e){let t;typeof e=="boolean"?t={includeMargin:e}:t=e||{};let i,s=["top","right","bottom","left"],r=[0,0,0,0],o=u.nvl(t.includeMargin,!1),l=u.nvl(t.includePadding,!0),a=u.nvl(t.includeBorder,!0);for(i=0;i<s.length;i++)o&&(r[i]+=n.cssPxValue("margin-"+s[i])),l&&(r[i]+=n.cssPxValue("padding-"+s[i])),a&&(r[i]+=n.cssPxValue("border-"+s[i]+"-width"));return new We(r[0],r[1],r[2],r[3])},margins(n){return C.insets(n,{includeMargin:!0,includePadding:!1,includeBorder:!1})},setMargins(n,e){n.css({marginLeft:e.left,marginRight:e.right,marginTop:e.top,marginBottom:e.bottom})},paddings(n){return C.insets(n,{includeMargin:!1,includePadding:!0,includeBorder:!1})},borders(n){return C.insets(n,{includeMargin:!1,includePadding:!1,includeBorder:!0})},setLocation:h_,location(n){return new X(n.cssLeft(),n.cssTop())},bounds(n,e){return C._bounds(n,n.position(),e)},position(n){let e=n.position();return new X(e.left,e.top)},offsetBounds(n,e){return C._bounds(n,n.offset(),e)},offset(n){let e=n.offset();return new X(e.left,e.top)},_bounds(n,e,t){let i=C.size(n,t);return new te(e.left,e.top,i.width,i.height)},setBounds:l_,cssBounds(n){return new te(n.cssLeft(),n.cssTop(),n.cssWidth(),n.cssHeight())},debugOutput(n){if(!n)return"$comp is undefined";if(n=h().ensure(n),n.length===0)return"$comp doesn't match any elements";let e="";if(n.attr("id")&&(e+="id="+n.attr("id")),n.attr("class")&&(e+=" class="+n.attr("class")),n.attr("data-modelclass")&&(e+=" data-modelclass="+n.attr("data-modelclass")),e.length===0){let t=u.nvl(n.html(),"");t.length>30&&(t=t.substring(0,30)+"..."),e=t}return n.isAttached()||(e+=" attached=false"),"Element["+e.trim()+"]"}};let hl;class we extends ot{formRowHeight;formRowGap;formColumnWidth;formColumnGap;smallColumnGap;fieldLabelWidth;fieldMandatoryIndicatorWidth;fieldStatusWidth;constructor(){super(),this.formRowHeight=30,this.formRowGap=10,this.formColumnWidth=420,this.formColumnGap=32,this.smallColumnGap=4,this.fieldLabelWidth=140,this.fieldMandatoryIndicatorWidth=8,this.fieldStatusWidth=20}init(e){e=e?" "+e:"",this.formRowHeight=L.getSize("html-env-logical-grid-row"+e,"height","height",this.formRowHeight),this.formRowGap=L.getSize("html-env-logical-grid-row"+e,"margin-bottom","marginBottom",this.formRowGap),this.formColumnWidth=L.getSize("html-env-logical-grid-column"+e,"width","width",this.formColumnWidth),this.formColumnGap=L.getSize("html-env-logical-grid-column"+e,"margin-right","marginRight",this.formColumnGap),this.smallColumnGap=L.getSize("html-env-logical-grid-column"+e,"margin-left","marginLeft",this.smallColumnGap),this.fieldLabelWidth=L.getSize("html-env-field-label"+e,"width","width",this.fieldLabelWidth),this.fieldMandatoryIndicatorWidth=L.getSize("html-env-field-mandatory-indicator"+e,"width","width",this.fieldMandatoryIndicatorWidth),this.fieldStatusWidth=L.getSize("html-env-field-status"+e,"width","width",this.fieldStatusWidth),this.trigger("propertyChange")}static get(){return hl}}G.addListener("prepare",()=>{hl||(hl=u.create(we),hl.init())});class ne{animateClasses;cssClass;constructor(){this.animateClasses=[]}invalidate(e){}layout(e){}_revertSizeHintsAdjustments(e,t){let i=x.get(e);t.widthHint&&(t.widthHint+=i.insets().horizontal()),t.heightHint&&(t.heightHint+=i.insets().vertical())}preferredLayoutSize(e,t){return t=h().extend({},t),this.animateClasses.length>0&&(t.animateClasses=this.animateClasses),this._revertSizeHintsAdjustments(e,t),C.prefSize(e,t)}}class x{$comp;layout;layoutData;layouted;layouting;pixelBasedSizing;prefSizeCached;scrollable;session;sizeCached;suppressInvalidate;suppressValidate;valid;validateRoot;constructor(e,t){if(!t)throw new Error("session must be defined for "+this.debug());this.$comp=e,this.layout=new pn,this.layoutData=null,this.valid=!1,this.validateRoot=!1,this.layouted=!1,this.layouting=!1,this.suppressInvalidate=!1,this.suppressValidate=!1,this.pixelBasedSizing=!0,this.sizeCached=null,this.prefSizeCached={},this.session=t,this.scrollable=!1}getParent(){let e=this.$comp.parent();return e.length===0?null:x.optGet(e)}isDescendantOf(e){let t=this.$comp.parent();for(;t.length>0;){if(x.optGet(t)===e)return!0;t=t.parent()}return!1}availableSize(e){e=e||{};let t=this.size({exact:e.exact});if(this.scrollable){let i=this.prefSize({widthHint:t.width,removeMarginFromHints:!1});i.height>t.height&&(t.height=i.height)}return t}invalidateLayout(e){this.valid=!1,this.prefSizeCached={},this.layout&&this.layout.invalidate(e)}validateLayout(){if(!this.layout)throw new Error("Called layout() but component has no layout");return this.valid?!0:this.suppressValidate||this.layouting||!this._checkValidationPossible()?!1:(this.layouting=!0,this.layout.layout(this.$comp),this.layouting=!1,this.layouted=!0,this.sizeCached=this.size({exact:!0}),this.valid=!0,!0)}_checkValidationPossible(){if(!this.isAttachedAndVisible())return!1;if(this.$comp.hasAnimationClass())return this._validateLayoutAfterAnimation(this.$comp),!1;let e=this.$comp.data("animate-promise");if(e)return this._validateLayoutAfterPromise(e),!1;let t=this.getParent();if(!t||!t.layouting){let i=!0,s=null;if(this.$comp.parents().each(function(){let r=h()(this);if(!r.isVisible())return i=!1,!1;if(r.hasAnimationClass())return s=r,!1;if(e=r.data("animate-promise"),e)return!1}),!i)return!1;if(s)return this._validateLayoutAfterAnimation(s),!1;if(e)return this._validateLayoutAfterPromise(e),!1}return!0}_validateLayoutAfterAnimation(e){e.oneAnimationEnd(this.validateLayout.bind(this))}_validateLayoutAfterPromise(e){e.always(this.validateLayout.bind(this))}revalidateLayout(){this.invalidateLayout(),this.validateLayout()}invalidateLayoutTree(e){this.suppressInvalidate||(u.nvl(e,!0)?this.session.layoutValidator.invalidateTree(this):(this.invalidateLayout(),this.session.layoutValidator.invalidate(this)))}validateLayoutTree(){this.suppressValidate||this.session.layoutValidator.validate()}revalidateLayoutTree(e){this.suppressInvalidate||(this.invalidateLayoutTree(e),this.validateLayoutTree())}isValidateRoot(){return this.validateRoot?!0:!this.layoutData||!this.layoutData.isValidateRoot?!1:this.layoutData.isValidateRoot()}setLayout(e){this.layout=e,e.cssClass&&this.$comp.addClass(e.cssClass)}prefSize(e){if(!this.isVisible())return new F(0,0);typeof e=="boolean"?e={includeMargin:e}:e=h().extend({},e);let t=u.nvl(e.includeMargin,!1);if(e.includeMargin=null,!this.layout)throw new Error("Called prefSize() but component has no layout");let i=this.computePrefSizeKey(e),s=this.prefSizeCached[i];if(!h().isEmptyObject(s))return h().log.isTraceEnabled()&&h().log.trace("(HtmlComponent#prefSize) "+this.debug()+" widthHint="+e.widthHint+" heightHint="+e.heightHint+" prefSizeCached="+s),t&&(s=s.add(this.margins())),s.clone();let r=this.cssMinSize(),o=this.cssMaxSize();(e.widthHint||e.heightHint)&&this._adjustSizeHintsForPrefSize(e,r,o);let l=this.layout.preferredLayoutSize(this.$comp,e);return this._adjustPrefSizeWithMinMaxSize(l,r,o),this.prefSizeCached[i]=l,h().log.isTraceEnabled()&&h().log.trace("(HtmlComponent#prefSize) "+this.debug()+" widthHint="+e.widthHint+" heightHint="+e.heightHint+" prefSize="+l),t&&(l=l.add(this.margins())),l.clone()}computePrefSizeKey(e){return"wHint"+u.nvl(e.widthHint,"-1")+"hHint"+u.nvl(e.heightHint,"-1")+"wOnly"+u.nvl(e.widthOnly,"-1")}_adjustSizeHintsForPrefSize(e,t,i){let s=u.nvl(e.removeMarginFromHints,!0),r=u.nvl(e.removeInsetsFromHints,!0);if(e.removeMarginFromHints=null,e.removeInsetsFromHints=null,!e.widthHint&&!e.heightHint)return;let o=s?this.margins():new We,l=r?this.insets():new We;e.widthHint&&(e.widthHint-=o.horizontal(),e.widthHint=Math.max(e.widthHint,t.width),e.widthHint=Math.min(e.widthHint,i.width),e.widthHint-=l.horizontal()),e.heightHint&&(e.heightHint-=o.vertical(),e.heightHint=Math.max(e.heightHint,t.height),e.heightHint=Math.min(e.heightHint,i.height),e.heightHint-=l.vertical())}_adjustPrefSizeWithMinMaxSize(e,t,i){t=t||this.cssMinSize(),i=i||this.cssMaxSize(),e.height=Math.max(e.height,t.height),e.height=Math.min(e.height,i.height),e.width=Math.max(e.width,t.width),e.width=Math.min(e.width,i.width)}insets(e){return C.insets(this.$comp,e)}margins(){return C.margins(this.$comp)}borders(){return C.borders(this.$comp)}cssMinSize(){return C.cssMinSize(this.$comp)}cssMaxSize(){return C.cssMaxSize(this.$comp)}size(e){return C.size(this.$comp,e)}setSize(e){if(!this.isAttachedAndVisible())return;let t=this.sizeCached;e.equals(t)||this.invalidateLayout(),this.pixelBasedSizing&&C.setSize(this.$comp,e),this.validateLayout()}bounds(e){return C.bounds(this.$comp,e)}position(){return C.position(this.$comp)}offsetBounds(e){return C.offsetBounds(this.$comp,e)}offset(){return C.offset(this.$comp)}setLocation(e){C.setLocation(this.$comp,e)}location(){return C.location(this.$comp)}setBounds(e){if(!this.isAttachedAndVisible())return;let t=this.sizeCached;e.dimension().equals(t)||this.invalidateLayout(),this.pixelBasedSizing&&C.setBounds(this.$comp,e),this.validateLayout()}pack(){let e=this.prefSize();this.setSize(e)}isAttached(){return this.$comp.isAttached()&&!!this.$comp.window(!0)}isVisible(){return this.$comp.isVisible()}isAttachedAndVisible(){return this.isAttached()&&this.isVisible()}debug(){return C.debugOutput(this.$comp)}static install(e,t){if(!e)throw new Error('Missing argument "$comp"');if(!t)throw new Error('Missing argument "session"');let i=new x(e,t);return e.data("htmlComponent",i),i}static get(e){let t=this.optGet(e);if(!t){let i="";throw e&&(i=`
Class: `+e.attr("class"),i+=`
Id: `+e.attr("id"),i+=`
Attached: `+e.isAttached()),new Error('data "htmlComponent" is undefined.'+i)}return t}static optGet(e){return e&&e.data("htmlComponent")}}const fi={MIN:0,PREF:1,MAX:2,EPS:1e-6};class yh{_invalidComponents;_validateTimeoutId;_postValidateFunctions;_suppressValidate;constructor(){this._invalidComponents=[],this._validateTimeoutId=null,this._postValidateFunctions=[],this._suppressValidate=!1}invalidateTree(e){let t,i=e,s=e;for(;i;){if(e=i,e.invalidateLayout(s),e.isValidateRoot()){t=e;break}i=e.getParent()}i||(t=e),this.invalidate(t)}invalidate(e){let t=0;if(this._invalidComponents.indexOf(e)>=0){this._scheduleValidation();return}this._invalidComponents.forEach((i,s)=>{i.isDescendantOf(e)||t++},this),p.insert(this._invalidComponents,e,t),this._scheduleValidation()}_scheduleValidation(){this._validateTimeoutId===null&&(w.get().supportsMicrotask()?(this._validateTimeoutId=!0,queueMicrotask(()=>{if(this._validateTimeoutId)try{this.validate()}catch(e){G.get().errorHandler.handle(e)}})):this._validateTimeoutId=setTimeout(()=>this.validate()))}validate(){w.get().supportsMicrotask()||clearTimeout(this._validateTimeoutId),this._validateTimeoutId=null,!this._suppressValidate&&(this._invalidComponents.slice().forEach(e=>{e.validateLayout()&&p.remove(this._invalidComponents,e)}),this._postValidateFunctions.splice(0).forEach(e=>e()))}suppressValidate(){this._suppressValidate=!0}unsuppressValidate(){this._suppressValidate=!1,this._scheduleValidation()}cleanupInvalidComponents(e){this._invalidComponents.slice().forEach(t=>{t.$comp.closest(e).length>0&&p.remove(this._invalidComponents,t)})}schedulePostValidateFunction(e){e&&this._postValidateFunctions.push(e)}removePostValidateFunction(e){e&&p.remove(this._postValidateFunctions,e)}}class ke{x;y;w;h;weightX;weightY;useUiWidth;useUiHeight;horizontalAlignment;verticalAlignment;fillHorizontal;fillVertical;widthInPixel;maxWidthInPixel;heightInPixel;maxHeightInPixel;constructor(e){e=e||{},this.x=-1,this.y=-1,this.w=1,this.h=1,this.weightX=-1,this.weightY=-1,this.useUiWidth=!1,this.useUiHeight=!1,this.horizontalAlignment=-1,this.verticalAlignment=-1,this.fillHorizontal=!0,this.fillVertical=!0,this.widthInPixel=0,this.maxWidthInPixel=0,this.heightInPixel=0,this.maxHeightInPixel=0,h().extend(this,e)}clone(e){return new ke(h().extend({},this,e))}equals(e){return!e||!(e instanceof ke)?!1:b.propertiesEquals(this,e,Object.keys(this))}toRectangle(){return new te(this.x,this.y,this.w,this.h)}static createFromHints(e,t){let i=new ke(e.gridDataHints);return i.w===A.FULL_WIDTH&&(i.w=t),i}static ensure(e){return!e||e instanceof ke?e:new ke(e)}}class dl{dirty;gridConfig;objectType;constructor(e){e=u.nvl(e,{}),this.dirty=!0,this._setGridConfig(e.gridConfig||null)}setDirty(e){this.dirty=e}setGridConfig(e){this._setGridConfig(e)}_setGridConfig(e){e&&!(e instanceof Js)&&(e=u.create(Js,e)),this.gridConfig=e}validate(e){this.dirty&&(this._validate(e),this.setDirty(!1))}}class Js{widget;constructor(){this.widget=null}setWidget(e){this.widget=e}getGridColumnCount(){return this.widget.gridColumnCount}getGridWidgets(){return this.widget.widgets}}function d_(n){return n instanceof I}class Sr{fillHorizontal;fillVertical;gridh;gridw;gridx;gridy;heightHint;maxHeight;horizontalAlignment;logicalRowHeightAddition;useUiHeight;useUiWidth;verticalAlignment;weightx;weighty;widget;widthHint;maxWidth;constructor(e){this.gridx=0,this.gridy=0,this.gridw=1,this.gridh=1,this.weightx=0,this.weighty=0,this.useUiWidth=!1,this.useUiHeight=!1,this.widthHint=0,this.maxWidth=10240,this.heightHint=0,this.maxHeight=10240,this.horizontalAlignment=-1,this.verticalAlignment=-1,this.fillHorizontal=!0,this.fillVertical=!0,d_(e)?this.widget=e:$.extend(this,e)}validate(){if(!this.widget)return;let e=this.widget.gridData;this.gridx=e.x,this.gridy=e.y,this.gridw=e.w,this.gridh=e.h,this.weightx=e.weightX,this.weighty=e.weightY,this.weightx<0&&(this.weightx=Math.max(1,this.gridw)),this.weighty<0&&(this.weighty=this._inheritWeightY()),this.useUiWidth=e.useUiWidth,this.useUiHeight=e.useUiHeight,this.horizontalAlignment=e.horizontalAlignment,this.verticalAlignment=e.verticalAlignment,this.fillHorizontal=e.fillHorizontal,this.fillVertical=e.fillVertical,this.widthHint=e.widthInPixel,this.maxWidth=e.maxWidthInPixel>0?e.maxWidthInPixel:10240,this.heightHint=e.heightInPixel,this.maxHeight=e.maxHeightInPixel>0?e.maxHeightInPixel:10240,this.widget.labelVisible&&this.widget.$label&&this.widget.labelPosition===A.LabelPosition.TOP?this.logicalRowHeightAddition=C.prefSize(this.widget.$label,!0).height:this.logicalRowHeightAddition=0}_inheritWeightY(){let e=this._inheritWeightYRec(this.widget);if(e===null){let t=this.widget.gridData;t.weightY>=0?e=t.weightY:e=t.h>=2?t.h:0}return e}_inheritWeightYRec(e){let t=!1,i=0;if(e.validateLogicalGrid(),e instanceof ar){let s,r,o,l=e.getFields();for(s=0;s<l.length;s++)if(o=l[s],o.visible){let a=o.gridData;a.weightY<0?(r=this._inheritWeightYRec(o),r!==null&&(t=!0,i+=r)):(t=!0,i+=a.weightY)}}else i=e.gridData.h>=2?e.gridData.h:0,t=!0;return t?i:null}isValidateRoot(){return!this.useUiHeight&&!this.useUiWidth&&this.fillVertical&&this.fillHorizontal}toRectangle(){return new te(this.gridx,this.gridy,this.gridw,this.gridh)}}class xr extends ne{validityBasedOnContainerSize;valid;widget;info;layoutConfig;htmlPropertyChangeHandler;hgap;vgap;columnWidth;rowHeight;minWidth;spyEnabled;_spy;constructor(e,t){super(),this.cssClass="logical-grid-layout",this.validityBasedOnContainerSize=new F,this.valid=!1,this.widget=e,this.info=null,this.spyEnabled=!1,this.layoutConfig=kt.ensure(t||{}),this.layoutConfig.applyToLayout(this)}validateLayout(e,t){let i=[],s=[];this.widget.logicalGrid?(this.widget.validateLogicalGrid(),this.widget.logicalGrid.gridConfig.getGridWidgets().forEach(o=>{if(o.rendered){if(!o.htmlComp){h().log.isWarnEnabled()&&h().log.warn("(LogicalGridLayout#validateLayout) no htmlComp found, widget cannot be layouted. Widget: "+o);return}r.call(this,o.htmlComp)}})):e.children().each((o,l)=>{let a=h()(l),d=x.optGet(a);d&&r.call(this,d)});function r(o){this._validateGridData(o)&&(i.push(o.$comp),s.push(o.layoutData))}this.info=new Ch({$components:i,cons:s,hgap:this.hgap,vgap:this.vgap,rowHeight:this.rowHeight,columnWidth:this.columnWidth,widthHint:t.widthHint,widthOnly:t.widthOnly}),h().log.isTraceEnabled()&&h().log.trace("(LogicalGridLayout#validateLayout) $container="+x.get(e).debug())}_validateGridData(e){let t=e.$comp,i=t.data("widget");if(i?i.visible:t.isVisible())return e.layoutData.validate(),!0}layout(e){this._layout(e)}_layout(e){let t=x.get(e),i=t.availableSize(),s=t.insets();this.validateLayout(e,{widthHint:i.width-s.horizontal(),heightHint:i.height-s.vertical()}),this.minWidth>0&&i.width<this.minWidth&&(i.width=this.minWidth),h().log.isTraceEnabled()&&h().log.trace("(LogicalGridLayout#layout) container "+t.debug()+" size="+i+" insets="+s);let r=this._layoutCellBounds(i,s);this._spy?.drawCellBounds(e,r);let o,l,a,d,c,f,g,y,v,D;for(f=0;f<this.info.$components.length;f++)c=this.info.$components[f],g=x.get(c),y=this.info.gridDatas[f],o=r[y.gridy][y.gridx],l=r[y.gridy+y.gridh-1][y.gridx+y.gridw-1],a=o.union(l),D=g.margins(),a.width-=D.horizontal(),a.height-=D.vertical(),y.fillHorizontal&&y.fillVertical||(d=this.info.compSize[f],!y.fillHorizontal&&d.width<a.width&&(v=a.width-d.width,a.width=d.width,y.horizontalAlignment===0?a.x+=Math.ceil(v/2):y.horizontalAlignment>0&&(a.x+=v)),!y.fillVertical&&d.height<a.height&&(v=a.height-d.height,y.heightHint===0?a.height=d.height:a.height=y.heightHint,y.verticalAlignment===0?a.y+=Math.ceil(v/2):y.verticalAlignment>0&&(a.y+=v))),h().log.isTraceEnabled()&&h().log.trace("(LogicalGridLayout#layout) comp="+g.debug()+" bounds="+a),g.setBounds(a)}_layoutCellBounds(e,t){return this.info.layoutCellBounds(e,t)}preferredLayoutSize(e,t){this.validateLayout(e,t);let i=fi.PREF,s=new F,r,o,l,a=0;for(r=0;r<this.info.cols;r++)o=this.info.width[r][i],a>0&&(s.width+=this.hgap),s.width+=o,a++;for(a=0,r=0;r<this.info.rows;r++)l=this.info.height[r][i],a>0&&(s.height+=this.vgap),s.height+=l,a++;let d=x.get(e).insets();return s.width+=d.horizontal(),s.height+=d.vertical(),s}setSpyEnabled(e){this.spyEnabled!==e&&(this.spyEnabled=e,this.spyEnabled?this._spy=new wh:(this._spy?.dispose(),this._spy=null))}}class wh{canvas;drawCellBounds(e,t){this._prepareCanvas(e);for(let i of t)for(let s of i)this._drawGridCell(s)}dispose(){this.canvas?.remove(),this.canvas=null}_prepareCanvas(e){if(this.canvas)this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height);else{let t=e.appendElement("<canvas>","logical-grid-layout-spy");this.canvas=t[0]}h()(this.canvas).attr({width:e.outerWidth(),height:e.outerHeight()})}_drawGridCell(e){this._drawCellLabel(e);const t=this.canvas.getContext("2d");t.beginPath(),t.setLineDash([10,2]),t.strokeStyle="#FF00FF",t.rect(e.x,e.y,e.width,e.height),t.stroke(),t.closePath()}_drawCellLabel(e){const t=this.canvas.getContext("2d");let i=`x: ${e.x}, y: ${e.y}, w: ${e.width}, h: ${e.height}`,s=t.measureText(i).width,r=[i],o=12,l=12;e.height>e.width&&(r=i.split(", "),o*=r.length,s=r.map(a=>t.measureText(a).width).reduce((a,d)=>Math.max(a,d),0)),t.beginPath(),t.fillStyle="#FFF",t.fillRect(e.x,e.y,s+2,o);for(let a=0;a<r.length;a++)t.fillStyle="#000",t.fillText(r[a],e.x+2,e.y+10+a*l)}}class kt{hgap;vgap;columnWidth;rowHeight;minWidth;_defaults;_options;constructor(e,t){this._options=this._prepareOptions(e||{}),this.withDefaults(t)}_prepareOptions(e){let t=$.extend({},e);return t.hgap=e.hgap>-1?e.hgap:void 0,t.vgap=e.vgap>-1?e.vgap:void 0,t.columnWidth=e.columnWidth>-1?e.columnWidth:void 0,t.rowHeight=e.rowHeight>-1?e.rowHeight:void 0,t.minWidth=e.minWidth>-1?e.minWidth:void 0,t}withDefaults(e){return this._defaults=$.extend({},e),this._init(),this}withSmallHgapDefaults(){return this.withDefaults({hgap:we.get().smallColumnGap})}_init(){$.extend(this,this._readEnvDefaults(),this._defaults,this._options)}_readEnvDefaults(){let e=we.get();return{hgap:e.formColumnGap,vgap:e.formRowGap,columnWidth:e.formColumnWidth,rowHeight:e.formRowHeight,minWidth:0}}clone(e){return new kt($.extend({},this._options,e),this._defaults)}applyToLayout(e){e.layoutConfig=this,this.hgap!==null&&this.hgap!==void 0&&(e.hgap=this.hgap),this.vgap!==null&&this.vgap!==void 0&&(e.vgap=this.vgap),this.columnWidth!==null&&this.columnWidth!==void 0&&(e.columnWidth=this.columnWidth),this.rowHeight!==null&&this.rowHeight!==void 0&&(e.rowHeight=this.rowHeight),this.minWidth!==null&&this.minWidth!==void 0&&(e.minWidth=this.minWidth)}static ensure(e){return e?e instanceof kt?e:new kt(e):null}static initHtmlEnvChangeHandler(e,t,i){if(e.initialized)return;let s=()=>{i(t()?.clone())};we.get().on("propertyChange",s),e.one("destroy",()=>{we.get().off("propertyChange",s)})}}class Ch{gridDatas;cons;cols;compSize;rows;width;widthHints;height;weightX;weightY;hgap;vgap;rowHeight;columnWidth;cellBounds;widthHint;widthOnly;$components;constructor(e){this.gridDatas=[],this.$components=null,this.cols=0,this.compSize=[],this.rows=0,this.width=[],this.widthHints=[],this.height=[],this.weightX=[],this.weightY=[],this.hgap=0,this.vgap=0,this.rowHeight=0,this.columnWidth=0,this.cellBounds=[],this.widthHint=null,this.widthOnly=!1,h().extend(this,e);let t,i,s,r;for(t=0;t<this.cons.length;t++)this.gridDatas[t]=new Sr(this.cons[t]);if(this.$components.length===0)return;let o=new nl,l=new nl;for(t=0;t<this.gridDatas.length;t++){for(i=this.gridDatas[t],i.gridx<0&&(i.gridx=0),i.gridy<0&&(i.gridy=0),i.gridw<1&&(i.gridw=1),i.gridh<1&&(i.gridh=1),s=i.gridx;s<i.gridx+i.gridw;s++)o.add(s);for(r=i.gridy;r<i.gridy+i.gridh;r++)l.add(r)}let a=o.last();for(s=a;s>=0;s--)if(!o.contains(s))for(t=0;t<this.gridDatas.length;t++)i=this.gridDatas[t],i.gridx>s&&i.gridx--;let d=l.last();for(r=d;r>=0;r--)if(!l.contains(r))for(t=0;t<this.gridDatas.length;t++)i=this.gridDatas[t],i.gridy>r&&i.gridy--;this.cols=o.size(),this.rows=l.size(),h().log.isTraceEnabled()&&h().log.trace("(LogicalGridLayoutInfo#CTOR) $components.length="+this.$components.length+" usedCols="+this.cols+" usedRows="+this.rows),this._initializeInfo()}_initializeInfo(){let e=this.$components.length,t=[];for(let i=0;i<e;i++){let s=this.$components[i],r=this.gridDatas[i];r.gridx<0&&(r.gridx=0),r.gridy<0&&(r.gridy=0),r.gridw<1&&(r.gridw=1),r.gridh<1&&(r.gridh=1),r.gridx>=this.cols&&(r.gridx=this.cols-1),r.gridy>=this.rows&&(r.gridy=this.rows-1),r.gridx+r.gridw-1>=this.cols&&(r.gridw=this.cols-r.gridx),r.gridy+r.gridh>=this.rows&&(r.gridh=this.rows-r.gridy);let o=new F(0,0);r.widthHint>0?o.width=r.widthHint:(r.useUiWidth||!r.fillHorizontal)&&(o=this.uiSizeInPixel(s)),r.heightHint>0?o.height=r.heightHint:(r.useUiHeight||!r.fillVertical)&&t.push({cons:r,$comp:s,index:i}),this.compSize[i]=o}if(this._initializeColumns(),this.widthOnly){this.height=p.init(this.rows,[0,0,0]);return}if(this.widthHint&&t.length>0){let i=Math.max(0,(this.cols-1)*this.hgap);this.widthHints=this.layoutSizes(this.widthHint-i,this.width,this.weightX)}t.forEach(i=>{let s=i.$comp,r=i.cons,o=this.widthHintForGridData(r);r.fillHorizontal||(o=Math.min(o,this.compSize[i.index].width)),this.compSize[i.index]=this.uiSizeInPixel(s,{widthHint:o})}),this._initializeRows()}_initializeColumns(){let e=this.compSize,t=e.length,i=p.init(this.cols,0),s=p.init(this.cols,10240),r=p.init(this.cols,!1);for(let a=0;a<t;a++){let d=this.gridDatas[a];if(d.gridw===1){let c;d.widthHint>0?c=d.widthHint:d.useUiWidth?c=e[a].width:c=this.logicalWidthInPixel(d),c=Math.floor(c);let f=d.gridx;f<this.cols&&(i[f]=Math.max(i[f],c),s[f]=Math.min(s[f],d.maxWidth),d.weightx===0&&(r[f]=!0))}}const o=fi;for(let a=0;a<t;a++){let d=this.gridDatas[a];if(d.gridw>1){let c=d.gridw,f=0,g;for(let v=d.gridx;v<d.gridx+d.gridw&&v<this.cols;v++)r[v]||(f+=i[v]);d.widthHint>0?g=d.widthHint:d.useUiWidth?g=e[a].width:g=this.logicalWidthInPixel(d);let y=(c-1)*this.hgap;g-=y,g>f&&this._distributeWidth(d,g,i,r,Math.max.bind(Math)),this._distributeWidth(d,d.maxWidth-y,s,r,Math.min.bind(Math))}}for(let a=0;a<this.cols;a++)this.width[a]=[],r[a]?(this.width[a][o.MIN]=i[a],this.width[a][o.PREF]=i[a],this.width[a][o.MAX]=Math.min(i[a],s[a])):(this.width[a][o.MIN]=0,this.width[a][o.PREF]=i[a],this.width[a][o.MAX]=s[a]);for(let a=0;a<this.cols;a++)if(r[a])this.weightX[a]=0;else{let d=0,c=0;for(let f=0;f<t;f++){let g=this.gridDatas[f];g.weightx>0&&g.gridx<=a&&a<=g.gridx+g.gridw-1&&(d+=g.weightx/g.gridw,c++)}this.weightX[a]=c>0?d/c:0}let l=0;for(let a=0;a<this.cols;a++)l+=this.weightX[a];if(l>=1e-6){let a=1/l;for(let d=0;d<this.cols;d++)this.weightX[d]=this.weightX[d]*a}}_distributeWidth(e,t,i,s,r){let o=e.gridw,l=Math.floor(t/o),a=t%o,d=-1;for(let c=e.gridx;c<e.gridx+e.gridw&&c<this.cols;c++)d=c,s[c]||(i[c]=r(l,i[c])),e.weightx===0&&(s[c]=!0);d>-1&&(i[d]+=a)}_distributeHeight(e,t,i,s,r){let o=e.gridh,l=Math.floor(t/o),a=t%o,d=-1;for(let c=e.gridy;c<e.gridy+e.gridh&&c<this.rows;c++)d=c,s[c]||(i[c]=r(l,i[c])),e.weighty===0&&(s[c]=!0);d>-1&&(i[d]+=a)}_initializeRows(){let e=this.compSize,t=e.length,i=p.init(this.rows,0),s=p.init(this.rows,10240),r=p.init(this.rows,!1);for(let a=0;a<t;a++){let d=this.gridDatas[a];if(d.gridh===1){let c;d.heightHint>0?c=d.heightHint:d.useUiHeight?c=e[a].height:c=this.logicalHeightInPixel(d),c=Math.floor(c);let f=d.gridy;f<this.rows&&(i[f]=Math.max(i[f],c),s[f]=Math.min(s[f],d.maxHeight),d.weighty===0&&(r[f]=!0))}}const o=fi;for(let a=0;a<t;a++){let d=this.gridDatas[a];if(d.gridh>1){let c=d.gridh,f=0,g;for(let v=d.gridy;v<d.gridy+d.gridh&&v<this.rows;v++)r[v]||(f+=i[v]);let y=(c-1)*this.vgap;d.heightHint>0?g=d.heightHint:d.useUiHeight?g=e[a].height:g=this.logicalHeightInPixel(d),g-=y,g>f&&this._distributeHeight(d,g,i,r,Math.max.bind(this)),this._distributeHeight(d,d.maxHeight-y,s,r,Math.min.bind(this))}}for(let a=0;a<this.rows;a++)this.height[a]=[],r[a]?(this.height[a][o.MIN]=i[a],this.height[a][o.PREF]=i[a],this.height[a][o.MAX]=Math.min(i[a],s[a])):(this.height[a][o.MIN]=0,this.height[a][o.PREF]=i[a],this.height[a][o.MAX]=s[a]);for(let a=0;a<this.rows;a++)if(r[a])this.weightY[a]=0;else{let d=0,c=0;for(let f=0;f<t;f++){let g=this.gridDatas[f];g.weighty>0&&g.gridy<=a&&a<=g.gridy+g.gridh-1&&(d+=g.weighty/g.gridh,c++)}this.weightY[a]=c>0?d/c:0}let l=0;for(let a=0;a<this.rows;a++)l+=this.weightY[a];if(l>=1e-6){let a=1/l;for(let d=0;d<this.rows;d++)this.weightY[d]=this.weightY[d]*a}}layoutCellBounds(e,t){let i=this.layoutSizes(e.width-t.horizontal()-Math.max(0,(this.cols-1)*this.hgap),this.width,this.weightX),s=this.layoutSizes(e.height-t.vertical()-Math.max(0,(this.rows-1)*this.vgap),this.height,this.weightY);this.cellBounds=p.init(this.rows,null);let r=t.top;for(let o=0;o<this.rows;o++){let l=t.left;this.cellBounds[o]=p.init(this.cols,null);for(let a=0;a<this.cols;a++)this.cellBounds[o][a]=new te(l,r,i[a],s[o]),l+=i[a],l+=this.hgap;r+=s[o],r+=this.vgap}return this.cellBounds}layoutSizes(e,t,i){let s=p.init(t.length,0);if(e<=0){for(let d=0;d<t.length;d++)s[d]=t[d][fi.MIN];return s}let r=0,o=p.init(i.length,0),l=0;for(let d=0;d<t.length;d++)s[d]=Math.min(Math.max(t[d][fi.PREF],t[d][fi.MIN]),t[d][fi.MAX]),r+=s[d],o[d]=i[d],o[d]<fi.EPS&&(t[d][fi.MAX]>t[d][fi.MIN]?o[d]=1:o[d]=0),l+=o[d];if(l>0)for(let d=0;d<o.length;d++)o[d]=o[d]/l;let a=e-r;if(Math.abs(a)>0){let d=p.init(o.length,0),c;if(a>0)for(c=!0;a>0&&c;){c=!1;for(let f=0;f<s.length&&a>0;f++)o[f]>0&&s[f]<t[f][fi.MAX]&&(c=!0,d[f]+=o[f],d[f]>0&&(d[f]-=1,s[f]+=1,a-=1))}else for(c=!0;a<0&&c;){c=!1;for(let f=0;f<s.length&&a<0;f++)o[f]>0&&s[f]>t[f][fi.MIN]&&(c=!0,d[f]+=o[f],d[f]>0&&(d[f]-=1,s[f]-=1,a+=1))}}return s}logicalWidthInPixel(e){let t=e.gridw;return this.columnWidth*t+this.hgap*Math.max(0,t-1)}logicalHeightInPixel(e){let t=e.gridh,i=e.logicalRowHeightAddition||0;return this.rowHeight*t+this.vgap*Math.max(0,t-1)+i}uiSizeInPixel(e,t){let i=x.get(e);return i.prefSize(t).add(i.margins())}widthHintForGridData(e){if(this.widthHints.length===0)return null;let t=(e.gridw-1)*this.hgap;for(let i=e.gridx;i<e.gridx+e.gridw;i++)t+=this.widthHints[i];return t}}class un extends dl{gridRows;gridColumns;constructor(e){super(e),this.gridRows=0,this.gridColumns=0}_validate(e){this.gridRows=0,this.gridConfig.setWidget(e),this.gridColumns=this.gridConfig.getGridColumnCount();let t=0,i=0,s=[];this.gridConfig.getGridWidgets().forEach(r=>{if(r.visible){s.push(r);let o=r.gridDataHints;o&&o.x>=0&&o.y>=0?t++:i++}else r._setGridData(ke.createFromHints(r,1))}),t>0&&i===0?this.layoutAllStatic(s):this.layoutAllDynamic(s)}layoutAllStatic(e){let t=[];e.forEach(r=>{t.push(ke.createFromHints(r,1))});let i=t.reduce((r,o)=>{let l=o.x+o.w;return l>r?l:r},1),s=t.reduce((r,o)=>{let l=o.y+o.h;return l>r?l:r},0);e.forEach(r=>{r._setGridData(ke.createFromHints(r,i))}),this.gridRows=s,this.gridColumns=i}layoutAllDynamic(e){}getGridColumnCount(){return this.gridColumns}getGridRowCount(){return this.gridRows}static getGridDataFromHints(e,t){let i=ke.createFromHints(e,t);return i.w=Math.min(t,i.w),i}}class Pr extends un{layoutAllDynamic(e){let t=new vh(this.getGridColumnCount());t.computeGridData(e),this.gridRows=t.getRowCount()}}class Th extends un{layoutAllDynamic(e){let t=0;e.forEach(r=>{let o=un.getGridDataFromHints(r,this.getGridColumnCount());t+=o.w*o.h});let i=Math.floor((t+this.getGridColumnCount()-1)/this.getGridColumnCount()),s=new oo(this.getGridColumnCount(),i);for(;!s.computeGridData(e);)s.resetAll(this.getGridColumnCount(),++i);e.forEach(r=>{r._setGridData(s.getGridData(r))}),this.gridRows=s.getRowCount()}}class ul{_cursor;_assignedCells;constructor(e){this._cursor=e,this._assignedCells=[]}getColumnCount(){return this._cursor.columnCount}getRowCount(){return this._cursor.rowCount}_setAssignedCell(e,t){this._assignedCells[e.x]||(this._assignedCells[e.x]=[]),this._assignedCells[e.x][e.y]=t}_getAssignedCell(e){return this._assignedCells[e.x]?this._assignedCells[e.x][e.y]:null}_nextFree(e,t){if(!this._cursor.increment())return!1;let i=this._cursor.currentIndex();return this._isAllCellFree(i.x,i.y,e,t)?!0:(this._getAssignedCell(i)||this._setAssignedCell(i,new cn),this._nextFree(e,t))}_isAllCellFree(e,t,i,s){return e+i>this._cursor.startX+this._cursor.columnCount||t+s>this._cursor.startY+this._cursor.rowCount?!1:this._assignedCells.slice(e,e+i).every(r=>(r||[]).slice(t,t+s).every(o=>!o))}toString(){let e="----Group Box Grid Matrix [orientation="+this._cursor.orientation+", columnCount="+this.getColumnCount()+", rowCount="+this.getRowCount()+`]--------------
`,t=new Li(0,0,this.getColumnCount(),this.getRowCount(),this._cursor.orientation);for(;t.increment();){let i=this._getAssignedCell(t.currentIndex());e+="cell["+t.currentIndex().x+", "+t.currentIndex().y+"] ",i?i.widget?e+=i.widget+(i.widget?", ["+i.widget.label+"]":""):e+="Placeholder":e+="NULL",e+=`
`}return e}}class cn{widget;data;constructor(e,t){this.widget=e,this.data=t}isEmpty(){return!this.widget}}class Li{startX;startY;columnCount;rowCount;orientation;_currentIndex;constructor(e,t,i,s,r){this.startX=e,this.startY=t,this.columnCount=i,this.rowCount=s,this.orientation=r,this.reset()}static Orientation={HORIZONTAL:0,VERTICAL:1};reset(){this._currentIndex=new X(-1,-1)}currentIndex(){return new X(this._currentIndex.x,this._currentIndex.y)}increment(){return this._currentIndex.x<0||this._currentIndex.y<0?(this._currentIndex.x=this.startX,this._currentIndex.y=this.startY):this.orientation===Li.Orientation.HORIZONTAL?(this._currentIndex.x++,this._currentIndex.x>=this.startX+this.columnCount&&(this._currentIndex.x=this.startX,this._currentIndex.y++)):(this._currentIndex.y++,this._currentIndex.y>=this.startY+this.rowCount&&(this._currentIndex.y=this.startY,this._currentIndex.x++)),!(this._currentIndex.x>=this.startX+this.columnCount||this._currentIndex.y>=this.startY+this.rowCount)}decrement(){return!(this._currentIndex.x<0||this._currentIndex.y<0||(this._currentIndex.x>=this.startX+this.columnCount||this._currentIndex.y>=this.startY+this.rowCount?(this._currentIndex.x=this.startX+this.columnCount-1,this._currentIndex.y=this.startY+this.rowCount-1):this.orientation===Li.Orientation.HORIZONTAL?(this._currentIndex.x--,this._currentIndex.x<this.startX&&(this._currentIndex.x=this.startX+this.columnCount-1,this._currentIndex.y--)):(this._currentIndex.y--,this._currentIndex.y<this.startY&&(this._currentIndex.y=this.startY+this.rowCount-1,this._currentIndex.x--)),this._currentIndex.x<this.startX||this._currentIndex.y<this.startY))}toString(){let e=[];return e.push("MatrixCursor ["),e.push("orientation="+this.orientation),e.push(", startX="+this.startX),e.push(", startY="+this.startY),e.push(", columnCount="+this.columnCount),e.push(", currentIndex="+this._currentIndex.x+", "+this._currentIndex.y),e.push("]"),e.join("")}}class vh extends ul{rowCount;constructor(e){super(new Li(0,0,e,Number.MAX_SAFE_INTEGER,Li.Orientation.HORIZONTAL)),this.rowCount=0}computeGridData(e){return e.forEach(t=>{let i=ke.createFromHints(t,this.getColumnCount()),s=new ke(i);s.w=Math.min(i.w,this.getColumnCount()),this._add(t,i,s),t._setGridData(s)}),this._cursor.rowCount=this.rowCount,!0}_add(e,t,i){this._nextFree(i.w,i.h);let s=this._cursor.currentIndex();if(i.w<=this.getColumnCount()-s.x){i.x=s.x,i.y=s.y;for(let r=s.x;r<s.x+i.w;r++)for(let o=s.y;o<s.y+i.h;o++)this._setAssignedCell(new X(r,o),new cn(e,i));this.rowCount=s.y+i.h}else this._setAssignedCell(this._cursor.currentIndex(),new cn),this._add(e,t,i)}}class oo extends ul{_widgets;_widgetGridDatas;_widgetIndexes;constructor(e,t,i,s){super(new Li(i||0,s||0,e,t,Li.Orientation.VERTICAL)),this._widgets=[],this._widgetGridDatas=[],this._widgetIndexes=[]}resetAll(e,t){this._widgetGridDatas=[],this._assignedCells=[],this._widgetIndexes=[],this._cursor=new Li(this._cursor.startX,this._cursor.startY,e,t,Li.Orientation.VERTICAL)}computeGridData(e){return this._widgets=e,e.every((t,i)=>(this._widgetGridDatas[i]=un.getGridDataFromHints(t,this._cursor.columnCount),this._add(t,this._widgetGridDatas[i])))}getGridData(e){return this._widgetGridDatas[this._widgets.indexOf(e)]}_addAssignedCells(e){e.forEach((t,i)=>{t&&t.forEach((s,r)=>{s&&this._setAssignedCell(new X(i,r),s)})})}_getAssignedCells(){return this._assignedCells}_add(e,t){let i=this._cursor.currentIndex();if(t.w>1){let s=i.x,r=i.y;for(;s+t.w>this._cursor.startX+this._cursor.columnCount;)s--,r=this._cursor.rowCount-1;this._reorganizeGridAbove(s,r,t.w)}if(!this._nextFree(t.w,t.h))return!1;i=this._cursor.currentIndex(),t.x=i.x,t.y=i.y;for(let s=i.x;s<i.x+t.w;s++)for(let r=i.y;r<i.y+t.h;r++)this._setAssignedCell(new X(s,r),new cn(e,t));return!0}_reorganizeGridAbove(e,t,i){let s=[],r=y=>{s.indexOf(y)===-1&&s.push(y)},o=[],l=(y,v,D)=>{o[y]||(o[y]=[]),o[y][v]=D},a={x:e,y:0,w:i,h:t+1},d=t,c=0,f=!0;for(let y=t;y>=0&&f;y--)for(let v=e;v<e+i&&f;v++){let D=new X(v,y),k=this._getAssignedCell(D);if(k&&!k.isEmpty()){let V=k.data;this._horizontalMatchesOrOverlaps(a,V)?f=!1:this._horizontalOverlapsOnSide(a,V)?(l(D.x,D.y,k),c++,d=Math.min(D.y,d)):(this._setAssignedCell(D,null),r(k.widget),c++,d=Math.min(D.y,d))}}if(s.length===0)return;s.sort((y,v)=>this._widgets.indexOf(y)<this._widgets.indexOf(v)?-1:1),a.y=d;let g=new oo(a.w,Math.floor((c+a.w-1)/a.w),a.x,a.y);for(g._addAssignedCells(o);!g.computeGridData(s);)g.resetAll(g.getColumnCount(),g.getRowCount()+1);this._cursor.reset(),this._addAssignedCells(g._getAssignedCells()),g._widgetGridDatas.forEach((y,v)=>{this._widgetGridDatas[this._widgets.indexOf(g._widgets[v])]=y})}_horizontalMatchesOrOverlaps(e,t){return e.x>=t.x&&e.x+e.w<=t.x+t.w}_horizontalOverlapsOnSide(e,t){return e.x>t.x||e.x+e.w<t.x+t.w}}class cl extends ne{stretch;useCssWidth;constructor(e){super(),e=e||{},this.stretch=u.nvl(e.stretch,!0),this.useCssWidth=u.nvl(e.useCssWidth,!1)}_getChildren(e){return e.children()}layout(e){let t=x.get(e),i=t.availableSize().subtract(t.insets());this._getChildren(e).each((s,r)=>{let o=h()(r),l=x.optGet(o);if(!l||!o.isVisible())return;let a=l.prefSize({useCssSize:!0});this.stretch&&(a.height=i.height-l.margins().vertical()),l.layoutData&&l.layoutData.widthHint&&(a.width=l.layoutData.widthHint),this.useCssWidth?(l.$comp.cssHeight(a.height),l.revalidateLayout()):l.setSize(a)})}preferredLayoutSize(e,t){let i=new F,s=x.get(e),r={useCssSize:!0};return this._getChildren(e).each((o,l)=>{let a=h()(l),d=x.optGet(a);if(!d||!a.isVisible())return;let c=d.prefSize(r);d.layoutData&&d.layoutData.widthHint&&(c.width=d.layoutData.widthHint),c=c.add(d.margins()),i.width=i.width+c.width,i.height=Math.max(i.height,c.height)}),i=i.add(s.insets()),i}}class pn extends ne{layout(e){e.children().each(function(){let t=x.optGet(h()(this));t&&t.revalidateLayout()})}}class Si extends ne{stretch;pixelBasedSizing;constructor(e){super(),e=e||{},this.pixelBasedSizing=u.nvl(e.pixelBasedSizing,!0),this.stretch=u.nvl(e.stretch,!0)}_getChildren(e){return e.children()}layout(e){let t=x.get(e),i=t.availableSize().subtract(t.insets());this._getChildren(e).each((s,r)=>{let o=h()(r),l=x.optGet(o);if(!l||!o.isVisible())return;if(!this.pixelBasedSizing){l.validateLayout();return}let a=l.prefSize({widthHint:i.width});this.stretch&&(a.width=i.width-l.margins().horizontal()),l.setSize(a)})}preferredLayoutSize(e,t){let i=new F,s=x.get(e),r=0;return this._getChildren(e).each((o,l)=>{let a=h()(l),d=x.optGet(a);if(!d||!a.isVisible())return;let c=d.prefSize(t).add(d.margins());r=Math.max(c.width,r),i.height+=c.height,i.width=r}),i=i.add(s.insets()),i}}class ji extends ne{exact;_htmlChild;constructor(e,t){super(),this._htmlChild=e,t=t||{},this.exact=u.nvl(t.exact,!1)}layout(e){let t=x.get(e),i=t.availableSize({exact:this.exact}).subtract(t.insets()),s=this._htmlChild;s||(s=this._getHtmlSingleChild(e)),s&&s.setSize(i)}preferredLayoutSize(e,t){let i=this._htmlChild;return i||(i=this._getHtmlSingleChild(e)),i?i.prefSize(t).add(C.insets(e)):new F(1,1)}_getHtmlSingleChild(e){let t=null;return e.children().each((i,s)=>{let r=x.optGet(h()(s));if(r)return t=r,!1}),t}}class Qs extends ne{childrenLayoutDatas;cacheKey;_getDimensionValue;_layoutFromLayoutData;constructor(e,t){super(),this.childrenLayoutDatas=[],this.cacheKey=null,this.setCacheKey(t),e===Qs.Direction.ROW?(this.preferredLayoutSize=this.preferredLayoutSizeRow,this._getDimensionValue=this._getWidth,this._layoutFromLayoutData=this._layoutFromLayoutDataRow):(this.preferredLayoutSize=this.preferredLayoutSizeColumn,this._getDimensionValue=this._getHeight,this._layoutFromLayoutData=this._layoutFromLayoutDataColumn)}static Direction={COLUMN:0,ROW:1};setCacheKey(e){this.cacheKey=e,this.cacheKey&&this.cacheKey.length>0&&this.cacheKey.unshift("scout.flexboxLayout")}_readCache(e){if(!this.cacheKey||this.cacheKey.length===0||e<2)return;let t=this.cacheKey.slice(),i=he.getItemFromLocalStorage(t[0]),s=1,r;for(t.push(""+e),i&&(r=JSON.parse(i));r&&s<t.length;)r=r[t[s]],s++;return r}_writeCache(e,t){if(!this.cacheKey||this.cacheKey.length===0||e<2)return;let i=this.cacheKey.slice(),s=he.getItemFromLocalStorage(i[0]),r=1,o,l;for(i.push(""+e),s?o=JSON.parse(s):o={},l=o;r<i.length-1;)l[i[r]]||(l[i[r]]={}),l=l[i[r]],r++;l[i[r]]=t,he.setItemToLocalStorage(i[0],JSON.stringify(o))}_computeCacheKey(e){if(!(!this.cacheKey||e<2))return this.cacheKey+"-"+e}layout(e){let t=this._getChildren(e),i=x.get(e),s=i.availableSize({exact:!0}),r;s=s.subtract(i.insets()),r=t.filter(o=>o.layoutData.diff)[0],r?this._layoutDelta(t,r,s):this._layoutComponents(t,s)}_getChildren(e){let t=[];return e.children().each(function(){let i=x.optGet(h()(this));i&&t.push(i)}),t=t.sort((i,s)=>(i.layoutData.order||0)-(s.layoutData.order||0)),t}reset(){this.childrenLayoutDatas.forEach(e=>{e.sizePx=0,e.initialPx=0,e.diff=null}),this.childrenLayoutDatas=[]}_layoutDelta(e,t,i){this.ensureInitialValues(e,i);let s=t.layoutData.diff,r=e.slice(0,e.indexOf(t)).reverse(),o=e.slice(e.indexOf(t)+1),l,a;l=d(r,s,!1),a=-d(o,-s,!1),s=Math.sign(s)*Math.min(Math.abs(s-l),Math.abs(s-a)),s!==0&&(d(r,s,!0),d(o,-s,!0)),this._layoutFromLayoutDataWithCache(e,i);function d(c,f,g){return c.reduce((y,v)=>(y!==0&&(y=v.layoutData.acceptDelta(y,g)),y),f)}}_layoutComponents(e,t){let i=this.ensureInitialValues(e,t);i<0?this._adjust(e,i,s=>s.shrink):i>0&&this._adjust(e,i,s=>s.grow),this._layoutFromLayoutDataWithCache(e,t)}_adjust(e,t,i){let s,r,o=e.map(l=>l.layoutData).filter(l=>l.acceptDelta(Math.sign(t))===0);o.length<1||(s=o.reduce((l,a)=>l+i(a),0),r=t/s,t=o.reduce((l,a)=>a.acceptDelta(r*i(a),!0),t),Math.abs(t)>.2&&this._adjust(e,t,i))}_getPreferredSize(e){return e.prefSize({useCssSize:!0}).add(e.margins())}ensureInitialValues(e,t){let i=this._getDimensionValue(t),s=0,r=0,o=e.map(d=>d.layoutData),l=this._readCache(e.length)||[];e.forEach((d,c)=>{let f=d.layoutData;f.sizePx?s+=f.sizePx:f.initial<0?(f.initialPx=this._getDimensionValue(this._getPreferredSize(d)),s+=f.initialPx):f.relative?r+=f.initial:(f.initialPx=f.initial,s+=f.initialPx)});let a=(i-s)/r;return o.filter(d=>d.relative&&d.initial>-1&&!d.sizePx).reduce((d,c)=>(c.initialPx=Math.max(30,a*c.initial),d-c.initialPx),i-s),o.reduce((d,c,f)=>(c.sizePx||(l[f]?c.sizePx=c.validate(Math.round(i*l[f])):c.sizePx=c.initialPx),this.childrenLayoutDatas.push(c),d-c.sizePx),i)}_layoutFromLayoutDataWithCache(e,t){this._cacheSizes(e,t),this._layoutFromLayoutData(e,t)}_cacheSizes(e,t){let i=this._getDimensionValue(t),s=e.map(r=>r.layoutData.sizePx/i);this._writeCache(e.length,s)}preferredLayoutSizeColumn(e,t){return this._getChildren(e).reduce((i,s)=>{let r=this._getPreferredSize(s);return i.width=Math.max(r.width,i.width),i.height+=r.height,i},new F(0,0))}preferredLayoutSizeRow(e,t){return this._getChildren(e).reduce((i,s)=>{let r=this._getPreferredSize(s);return i.height=Math.max(r.height,i.height),i.width+=r.width,i},new F(0,0))}_getWidth(e){return e.width}_getHeight(e){return e.height}_layoutFromLayoutDataRow(e,t){e.reduce((i,s)=>{let r=s.margins(),o=s.insets(),l=s.layoutData.sizePx,a=new te(i-o.left-r.left,0,l+o.left+o.right,t.height);return s.setBounds(a),i+l},0)}_layoutFromLayoutDataColumn(e,t){e.reduce((i,s)=>{let r=s.margins(),o=s.insets(),l=s.layoutData.sizePx,a=new te(0,i-o.top-r.top,t.width,l+o.top+o.bottom);return s.setBounds(a),i+l},0)}}class Zs{grow;initial;order;relative;shrink;sizePx;initialPx;diff;constructor(e){this.relative=!0,this.grow=1,this.shrink=1,this.initial=1,this.order=0,h().extend(this,e),this.sizePx=null,this.initialPx=null,this.diff=null}withOrder(e){return this.order=e,this}acceptDelta(e,t){return e>0?this._grow(e,t):this._shrink(e,t)}validate(e){return this.grow===0&&(e=Math.min(this.initialPx,e)),this.shrink===0&&(e=Math.max(this.initialPx,e)),e}_grow(e,t){let i=0,s=0;return this.grow>0?i=e:this.initialPx>this.sizePx&&(i=this.initialPx-this.sizePx),s=Math.min(e,i),t&&(this.sizePx=this.sizePx+s),e-s}_shrink(e,t){let i=0,s=0;return this.shrink>0?i=-this.sizePx+20:this.initialPx<this.sizePx&&(i=this.initialPx-this.sizePx),s=Math.max(e,i),t&&(this.sizePx=this.sizePx+s),e-s}static fixed(e){let t=new Zs;return t.relative=!1,t.initial=e||-1,t.grow=0,t.shrink=0,t}}class Dr{tabBox;tabArea;_viewAddHandler;_viewRemoveHandler;_viewActivateHandler;_viewDeactivateHandler;_viewTabSelectHandler;constructor(){this.tabBox=null,this._viewAddHandler=this._onViewAdd.bind(this),this._viewRemoveHandler=this._onViewRemove.bind(this),this._viewActivateHandler=this._onViewActivate.bind(this),this._viewDeactivateHandler=this._onViewDeactivate.bind(this),this.tabArea=null,this._viewTabSelectHandler=this._onViewTabSelect.bind(this)}init(e){h().extend(this,e)}install(e,t){this.uninstall(),this.tabBox=u.assertParameter("tabBox",e),this.tabArea=u.nvl(t,this.tabBox.tabArea),this.tabArea||(this.tabArea=this.createTabArea()),this._installListeners()}uninstall(){this._uninstallListeners()}_installListeners(){this.tabBox.on("viewAdd",this._viewAddHandler),this.tabBox.on("viewRemove",this._viewRemoveHandler),this.tabBox.on("viewActivate",this._viewActivateHandler),this.tabBox.on("viewDeactivate",this._viewDeactivateHandler),this.tabArea.on("tabSelect",this._viewTabSelectHandler)}_uninstallListeners(){this.tabBox&&(this.tabBox.off("viewAdd",this._viewAddHandler),this.tabBox.off("viewRemove",this._viewRemoveHandler),this.tabBox.off("viewActivate",this._viewActivateHandler),this.tabBox.off("viewDeactivate",this._viewDeactivateHandler)),this.tabArea&&this.tabArea.off("tabSelect",this._viewTabSelectHandler)}createTabArea(){return u.create(Vi,{parent:this.tabBox})}_onViewAdd(e){let t=e.view;if(!Dr.hasViewTab(t))return;let i=this.getTab(t);if(!i&&this._shouldCreateTabForView(t)){let s=e.siblingView,r=this.getTab(s);i=this._createTab(t),this.tabArea.addTab(i,r)}}_shouldCreateTabForView(e){return!0}_onViewRemove(e){let t=e.view;if(!t)return;let i=this.getTab(t);i&&this.tabArea.destroyTab(i)}_onViewActivate(e){let t=this.getTab(e.view);this.tabArea.selectTab(t)}_onViewDeactivate(e){let t=this.getTab(e.view);this.tabArea.deselectTab(t)}_onViewTabSelect(e){if(!e.viewTab)return;let t=e.viewTab.view;this.tabBox.activateView(t)}_createTab(e){return u.create(Ta,{parent:this.tabArea,view:e})}getTab(e){if(!e)return;let t=null;return this.tabArea.getTabs().some(i=>i.view===e?(t=i,!0):!1),t}getTabs(){return this.tabArea.getTabs()}static hasViewTab(e){return e&&(!b.isNullOrUndefined(e.title)||!b.isNullOrUndefined(e.subTitle)||!b.isNullOrUndefined(e.iconId))}}class lo extends I{tabArea;viewStack;currentView;controller;layoutData;viewContent;$viewContent;$tabArea;_removeViewInProgress;_viewDestroyedHandler;constructor(){super(),this._addWidgetProperties(["tabArea"]),this.tabArea=null,this.viewStack=[],this.currentView=null,this.controller=null,this._removeViewInProgress=0}_init(e){super._init(e),this.cssClass=e.cssClass,this.controller||(this.controller=u.create(Dr)),this.controller.install(this,this.tabArea),this.tabArea=this.controller.tabArea,this._viewDestroyedHandler=this._onViewDestroyed.bind(this)}_render(){this.$container=this.$parent.appendDiv("simple-tab-box"),this.cssClass&&this.$container.addClass(this.cssClass),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Sh(this)),this.htmlComp.layoutData=this.layoutData,this.$viewContent=this.$container.appendDiv("tab-content"),this.viewContent=x.install(this.$viewContent,this.session),this.viewContent.setLayout(new xh(this))}_renderProperties(){super._renderProperties(),this._renderTabArea(),this._renderView(this.currentView)}_renderTabArea(){this.tabArea.render(),this.$tabArea=this.tabArea.$container,this.$tabArea.insertBefore(this.$viewContent)}_renderView(e){e&&(e.rendered||(e.render(this.$viewContent),e.$container.addClass("view")))}postRender(){this.viewStack.length>0&&!this.currentView&&this.activateView(this.viewStack[this.viewStack.length-1])}activateView(e){e!==this.currentView&&(this.currentView&&(this.currentView.detach(),this.trigger("viewDeactivate",{view:this.currentView}),this.currentView=null),this.rendered&&this._renderView(e),e&&!e.attached&&e.attach(),this.currentView=e,this.trigger("viewActivate",{view:e}),this.rendered&&this.viewContent.invalidateLayoutTree())}setLayoutData(e){super.setLayoutData(e),this.layoutData=e}getLayoutData(){return this.layoutData}addView(e,t){let i=u.nvl(t,!0),s=this._addToViewStack(e,i);e.setTrackFocus(!0),e.setParent(this),this.trigger("viewAdd",{view:e,siblingView:s}),i&&this.activateView(e)}_addToViewStack(e,t){let i,s=this.viewStack.indexOf(e);if(s>-1)return this.viewStack[s-1];if(!Dr.hasViewTab(e))return this.viewStack.unshift(e),this._addDestroyListener(e),i;if(!this.currentView||!t)return i=this.viewStack[this.viewStack.length-1],this.viewStack.push(e),this._addDestroyListener(e),i;let r=this.viewStack.indexOf(this.currentView);return i=this.viewStack[r],this.viewStack.splice(r+1,0,e),i}_addDestroyListener(e){e.one("destroy",this._viewDestroyedHandler)}_removeDestroyListener(e){e.off("destroy",this._viewDestroyedHandler)}_onViewDestroyed(e){let t=e.source;p.remove(this.viewStack,t),this.currentView===t&&(this.rendered&&t.remove(),this.currentView=null)}removeView(e,t){if(!e)return;e.setTrackFocus(!1),t=u.nvl(t,!0);let i=this.viewStack.indexOf(e),s;this.currentView===e?this.currentView=null:t=!1,i>-1&&(t&&(i-1>=0?s=this.viewStack[i-1]:i+1<this.viewStack.length&&(s=this.viewStack[i+1])),this.viewStack.splice(i,1),e.rendered&&(this._removeViewInProgress++,e.remove(),this._removeViewInProgress--),this.trigger("viewRemove",{view:e}),this._removeViewInProgress===0&&(s&&this.activateView(s),this.rendered&&this.viewContent.invalidateLayoutTree()))}getController(){return this.controller}viewCount(){return this.viewStack.length}hasViews(){return this.viewStack.length>0}hasView(e){return this.viewStack.filter(t=>t===e).length>0}getViews(e){return this.viewStack.filter(t=>e?e===t.displayViewId:!0)}}Z.uuidPathSkipWidgets.add(lo);class Sh extends ne{tabBox;constructor(e){super(),this.tabBox=e}layout(e){let t=x.get(e),i=x.get(this.tabBox.$viewContent),s=t.availableSize({exact:!0}).subtract(t.insets()),r=this._layoutTabArea(s),o=s.subtract(i.margins());o.height-=r.height,i.setSize(o)}_layoutTabArea(e){if(!this.tabBox.rendered)return new F(0,0);let t=x.get(this.tabBox.$tabArea),i=t.prefSize(),s=t.margins(),r=new F(e.width,i.height+s.top+s.bottom);return t.setSize(r),r}preferredLayoutSize(e,t){t=t||{};let i=x.get(e),s=x.get(this.tabBox.$viewContent),r=x.get(this.tabBox.$tabArea),o=new F,l=new F;return t.heightHint=null,r.isVisible()&&(o=r.prefSize().add(r.margins())),l=s.prefSize(t).add(i.insets()).add(s.margins()),new F(Math.max(o.width,l.width),l.height+o.height)}}class xh extends ne{tabBox;constructor(e){super(),this.tabBox=e}layout(e){let t=this.tabBox.currentView;if(!t||!t.rendered||!t.htmlComp)return;let i=x.get(e),s=i.availableSize({exact:!0}).subtract(i.insets()).subtract(t.htmlComp.margins());t.htmlComp.setSize(s)}preferredLayoutSize(e,t){let i=this.tabBox.currentView;if(!i||!i.rendered||!i.htmlComp)return new F;let s=x.get(e);return i.htmlComp.prefSize().add(s.insets()).add(i.htmlComp.margins())}}const m={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,ESCAPE:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACE:32,PRINT_SCREEN:44,INSERT:45,DELETE:46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,WIN_LEFT:91,WIN_RIGHT:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,MULTIPLY:106,ADD:107,SUBTRACT:109,DECIMAL_POINT:110,DIVIDE:111,NUM_LOCK:144,SCROLL_LOCK:145,SEMICOLON:186,DASH:189,COMMA:188,POINT:190,FORWARD_SLASH:191,OPEN_BRACKET:219,BACK_SLASH:220,CLOSE_BRACKET:221,SINGLE_QUOTE:222,ANGULAR_BRACKET:226,codesToKeys:{8:"Backspace",9:"Tab",13:"Enter",16:"SHIFT",17:"CTRL",18:"ALT",19:"PAUSE",20:"Caps lock",27:"Esc",33:"Page up",34:"Page down",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",32:"Space",44:"Print screen",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"WIN_LEFT",92:"WIN_RIGHT",93:"SELECT",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",96:"NUMPAD_0",97:"NUMPAD_1",98:"NUMPAD_2",99:"NUMPAD_3",100:"NUMPAD_4",101:"NUMPAD_5",102:"NUMPAD_6",103:"NUMPAD_7",104:"NUMPAD_8",105:"NUMPAD_9",106:"MULTIPLY",107:"+",109:"SUBTRACT",110:"DECIMAL_POINT",111:"/",144:"Num lock",145:"Scroll lock",186:"ü",189:"-",188:",",190:".",191:"§",219:"'",220:"ä",221:"^",222:"ö",226:"<"},browserMap:{[w.Browser.FIREFOX]:{226:60},[w.Browser.SAFARI]:{226:188,ctrl:{226:192}}},browserMapReverse:{},forBrowser:(n,e)=>m.mapKey(m.browserMap,n,e),fromBrowser:n=>m.mapKey(m.browserMapReverse,n),mapKey:(n,e,t)=>{let i=n[w.get().browser];return i&&t&&(i=i[t]),i&&i.hasOwnProperty(e)?i[e]:e}};for(let n in m.browserMap){let e={},t=m.browserMap[n];for(let i in t){let s=t[i];e[s]=parseInt(i,10)}m.browserMapReverse[n]=e}class ao{keyStroke;which;ctrl;alt;shift;keyStrokeMode;$drawingArea;constructor(e,t){this.keyStroke=e,this.which=t,this.ctrl=e.ctrl,this.alt=e.alt,this.shift=e.shift,this.keyStrokeMode=e.keyStrokeMode}render(e,t){return this.$drawingArea=this.keyStroke.renderKeyBox(e,t),!!this.$drawingArea}remove(){this.keyStroke.removeKeyBox(this.$drawingArea),this.$drawingArea=null}toKeyStrokeString(){let e="";this.ctrl&&(e+="Ctrl-"),this.alt&&(e+="Alt-"),this.shift&&(e+="Shift-");let t=m.codesToKeys[this.which];return t===void 0&&(t=this.which),e+=t,e}}const Ae={NONE:0,CTRL:1,CTRL_UNDEFINED:2,SHIFT:4,SHIFT_UNDEFINED:8,ALT:16,ALT_UNDEFINED:32,isCtrl(n){return Ae._eval(n,Ae.CTRL,Ae.CTRL_UNDEFINED)},isShift(n){return Ae._eval(n,Ae.SHIFT,Ae.SHIFT_UNDEFINED)},isAlt(n){return Ae._eval(n,Ae.ALT,Ae.ALT_UNDEFINED)},_eval(n,e,t){if(!((t&n)>0))return(e&n)>0},toModifierBitMask(n){let e=0;return e|=n.ctrlKey?Ae.CTRL:0,e|=n.altKey?Ae.ALT:0,e|=n.shiftKey?Ae.SHIFT:0,e}};class ho{which;ctrlKey;metaKey;altKey;shiftKey;target;type;originalEvent;_propagationStopped;_immediatePropagationStopped;_defaultPrevented;constructor(e,t,i,s,r,o){this.which=e,this.ctrlKey=t,this.metaKey=!1,this.altKey=i,this.shiftKey=s,o instanceof HTMLElement?this.target=o:(this.target=o.target,this.originalEvent=o.originalEvent),this.type=r,this._propagationStopped=!1,this._immediatePropagationStopped=!1,this._defaultPrevented=!1}stopPropagation(){this._propagationStopped=!0}stopImmediatePropagation(){this._immediatePropagationStopped=!0}preventDefault(){this._defaultPrevented=!0}isPropagationStopped(){return this._propagationStopped}isImmediatePropagationStopped(){return this._immediatePropagationStopped}isDefaultPrevented(){return this._defaultPrevented}isAnyPropagationStopped(){return this._propagationStopped||this._immediatePropagationStopped}}class Ph extends ot{session;helpKeyStroke;swallowF1;filters;_helpRendered;_renderedKeys;constructor(){super(),this.session=null,this.helpKeyStroke=B.parseKeyStroke("F1"),this.swallowF1=!0,this._helpRendered=!1,this._renderedKeys=[],this.filters=[]}init(e){this.session=e.session,this.installTopLevelKeyStrokeHandlers(this.session.$entryPoint)}installTopLevelKeyStrokeHandlers(e){let t=e.window(!0),i=r=>r.which!==m.F1,s=r=>r.which!==m.BACKSPACE;this.swallowF1&&e.keydown(i).keyup(i),e.keydown(s).keyup(s),"onhelp"in t&&(t.onhelp=Us.returnFalse)}installKeyStrokeContext(e){if(!e)return;let t=e._handler;if(!t){if(!e.$getBindTarget())throw new Error("missing bind-target for KeyStrokeContext: "+e);t=this._onKeyEvent.bind(this,e),t.$target=e.$getBindTarget(),t.$target.on("keydown",t),t.$target.on("keyup",t),e._handler=t}}uninstallKeyStrokeContext(e){if(!e)return;let t=e._handler;t&&(t.$target.off("keydown",t),t.$target.off("keyup",t),t.$target=null,e._handler=null)}_renderKeys(e,t){let i=t.originalEvent.keyStrokeContexts||[],s=[];e.keyStrokes.filter(r=>{let o=r.renderingHints.render;return typeof o=="function"?o.call(r):o}).forEach(r=>{r.enabledByFilter=this._filter(r);let o=(r.field?r.field.$container:null)||e.$getScopeTarget();r.keys().forEach(a=>{let d=new ho(a.which,a.ctrl,a.alt,a.shift,a.keyStrokeMode,t);s.indexOf(a.toKeyStrokeString())<0&&e.accept(d)&&r.accept(d)&&!this._isPreventedByDescendantContext(a,t,i)&&(a.render(o,d)&&this._renderedKeys.push(a),d.isImmediatePropagationStopped()&&s.push(a.toKeyStrokeString()))})}),i.push(e),t.originalEvent.keyStrokeContexts=i}_isPreventedByDescendantContext(e,t,i){let s=new ho(e.which,e.ctrl,e.alt,e.shift,e.keyStrokeMode,t);return i.some(r=>(r.accept(s),s.isAnyPropagationStopped()?!0:r.keyStrokes.some(o=>(o.accept(s),s.isAnyPropagationStopped()))))}_handleKeyStrokeEvent(e,t){if(!e.accept(t)||e.keyStrokes.length<1)return;t.which>=96&&t.which<=105&&(t.which=t.which-48),e.keyStrokes.slice().some(s=>s.accept(t)?(this.invokeAcceptInputOnActiveValueField(s,e)&&ge.invokeValueFieldAcceptInput(t.target),this._filter(s)?(this.trigger("keyStroke",{keyStroke:s,keyStrokeContext:e}),s.invokeHandle(t),t.isImmediatePropagationStopped()):!0):!1)}_filter(e){for(let t=0;t<this.filters.length;t++)if(!this.filters[t].filter(e))return!1;return!0}invokeAcceptInputOnActiveValueField(e,t){return!e.preventInvokeAcceptInputOnActiveValueField&&(e.invokeAcceptInputOnActiveValueField||t.invokeAcceptInputOnActiveValueField)}_isHelpKeyStroke(e){return B.acceptEvent(this.helpKeyStroke,e)}_installHelpDisposeListener(e){let t,i=h()(e.currentTarget),s=i.window(),r=i.entryPoint();return t=(function(){r.off("keyup",t),s.off("blur",t),this._helpRendered=!1,this._renderedKeys.forEach(o=>o.remove()),this._renderedKeys=[]}).bind(this),r.on("keyup",t),s.on("blur",t),!1}_onKeyEvent(e,t){if(this.session.focusManager.isElementCovertByGlassPane(e.$getScopeTarget())){let i=h().grep(e.keyStrokes,s=>s.keyStrokeFirePolicy===ce.KeyStrokeFirePolicy.ALWAYS);if(i.length===0)return;e=e.clone(),e.keyStrokes=i}this._isHelpKeyStroke(t)?(t.originalEvent.renderingHelp||!this._helpRendered)&&(t.originalEvent.renderingHelp=!0,this._helpRendered=!0,this._installHelpDisposeListener(t),this._renderKeys(e,t)):this._handleKeyStrokeEvent(e,t)}addFilter(e){p.pushSet(this.filters,e)}removeFilter(e){p.remove(this.filters,e)}}class Ee{invokeAcceptInputOnActiveValueField;keyStrokes;stopPropagationInterceptors;$bindTarget;$scopeTarget;_handler;_stopPropagationKeys;constructor(e){this.$bindTarget=null,this.$scopeTarget=null,this.keyStrokes=[],this.stopPropagationInterceptors=[],this._stopPropagationKeys={},this.invokeAcceptInputOnActiveValueField=!1,e=e||{},h().extend(this,e)}registerStopPropagationKeys(e,t){this._stopPropagationKeys[e]=this._stopPropagationKeys[e]||[],p.pushAll(this._stopPropagationKeys[e],t)}unregisterStopPropagationKeys(e,t){this._stopPropagationKeys[e]&&p.removeAll(this._stopPropagationKeys[e],t)}toggleStopPropagationKeys(e,t,i){i?this.registerStopPropagationKeys(e,t):this.unregisterStopPropagationKeys(e,t)}registerStopPropagationInterceptor(e){this.stopPropagationInterceptors.push(e)}accept(e){return this._accept(e)?(this._applyPropagationFlags(e),!0):!1}_applyPropagationFlags(e){let t=Ae.toModifierBitMask(e),i=this._stopPropagationKeys[t];i&&u.isOneOf(e.which,i)&&e.stopPropagation(),this.stopPropagationInterceptors.forEach(s=>s(e))}_accept(e){return!0}registerKeyStroke(e){this.registerKeyStrokes(e)}registerKeyStrokes(e){p.ensure(e).map(this._resolveKeyStroke,this).filter(t=>this.keyStrokes.indexOf(t)===-1).forEach(t=>{this.keyStrokes.push(t);let i;i=t,i.field&&!i.destroyListener&&(i.destroyListener=s=>{this.unregisterKeyStroke(i),i.destroyListener=null},i.field.one("destroy",i.destroyListener))})}unregisterKeyStroke(e){this.unregisterKeyStrokes(e)}unregisterKeyStrokes(e){p.ensure(e).map(this._resolveKeyStroke,this).forEach(t=>{let i;i=t,p.remove(this.keyStrokes,i)&&i.field&&i.destroyListener&&(i.field.off("destroy",i.destroyListener),i.destroyListener=null)})}_resolveKeyStroke(e){if(e instanceof B)return e;if(e instanceof ce)return e.actionKeyStroke;throw new Error("unsupported keystroke: "+e)}$getBindTarget(){return typeof this.$bindTarget=="function"?this.$bindTarget():this.$bindTarget}$getScopeTarget(){return typeof this.$scopeTarget=="function"?this.$scopeTarget():this.$scopeTarget}clone(){return new Ee(h().extend({},this))}}class qi extends Ee{constructor(e){super(),this.invokeAcceptInputOnActiveValueField=!0;let t=[m.RIGHT,m.LEFT,m.HOME,m.END];this.registerStopPropagationKeys(Ae.CTRL,[m.A,m.C,m.Y,m.V,m.Z,m.BACKSPACE].concat(t)),this.registerStopPropagationKeys(Ae.CTRL|Ae.SHIFT,t),this.registerStopPropagationKeys(Ae.SHIFT,t),this.registerStopPropagationKeys(Ae.NONE,[m.SEMICOLON,m.DASH,m.COMMA,m.POINT,m.FORWARD_SLASH,m.OPEN_BRACKET,m.BACK_SLASH,m.CLOSE_BRACKET,m.SINGLE_QUOTE,m.MULTIPLY,m.ADD,m.SUBTRACT,m.DECIMAL_POINT,m.DIVIDE,m.NUMPAD_0,m.NUMPAD_1,m.NUMPAD_2,m.NUMPAD_3,m.NUMPAD_4,m.NUMPAD_5,m.NUMPAD_6,m.NUMPAD_7,m.NUMPAD_8,m.NUMPAD_9,m.MULTIPLY,m.BACKSPACE,m.DELETE,m.SPACE].concat(t)),this.setMultiline(e)}setMultiline(e){let t=[m.UP,m.DOWN];this.toggleStopPropagationKeys(Ae.CTRL,t,e),this.toggleStopPropagationKeys(Ae.CTRL|Ae.SHIFT,t,e),this.toggleStopPropagationKeys(Ae.SHIFT,t,e),this.toggleStopPropagationKeys(Ae.NONE,t,e)}_applyPropagationFlags(e){super._applyPropagationFlags(e),!e.isPropagationStopped()&&this._isInputEvent(e)&&e.stopPropagation()}_isInputEvent(e){return this.isInput(e.target)?!!(this._isLetterKeyStroke(e)||this._isNumberKeyStroke(e)):!1}isInput(e){let t=h().ensure(e);return t.length?t[0].isContentEditable||t.is("textarea")||t.is("input")&&!this.isButton(t):!1}isButton(e){let t=h().ensure(e);return["button","input[type=button]","input[type=checkbox","input[type=color]","input[type=file]","input[type=image]","input[type=radio]","input[type=reset]","input[type=submit]"].some(s=>t.is(s))}_isNumberKeyStroke(e){return!e.ctrlKey&&e.which>=m[0]&&e.which<=m[9]}_isLetterKeyStroke(e){return!e.ctrlKey&&e.which>=m.A&&e.which<=m.Z}}class uo extends B{ranges;constructor(){super(),this.ranges=[]}registerRange(e,t){this.ranges.push({from:e,to:t})}_accept(e){return(e.ctrlKey||e.metaKey)!==this.ctrl||e.altKey!==this.alt||e.shiftKey!==this.shift?!1:this.ranges.some(t=>e.which>=this._getRangeFrom(t)&&e.which<=this._getRangeTo(t))}keys(){let e=[];return this.ranges.forEach(t=>{let i=this._getRangeFrom(t),s=this._getRangeTo(t);for(let r=i;r<=s;r++)e.push(new ao(this,r))}),e}_getRangeFrom(e){return typeof e.from=="function"?e.from():e.from}_getRangeTo(e){return typeof e.to=="function"?e.to():e.to}}class pl extends B{_contextFunction;_bindObject;constructor(e,t,i){super(),this._contextFunction=t,this._bindObject=i||this,this.field=e,this.renderingHints.render=!1,this.which=[m.SELECT],this.ctrl=!1,this.shift=!1,this.stopPropagation=!0,this.inheritAccessibility=!1}handle(e){this._contextFunction.call(this._bindObject,e)}}class co extends B{constructor(e,t){super(),this.field=e,this.which=t,this.stopPropagation=!0,this.renderingHints.render=!0,this.renderingHints.$drawingArea=(i,s)=>s._$activeElement}_accept(e){return super._accept(e)?(e._$activeElement=this.field.$container.activeElement(),!0):!1}handle(e){e._$activeElement.trigger($.Event("click",{which:1}))}}class fl extends B{session;constructor(e,t){super(),this.session=e,this.field=t,this.which=[m.LEFT,m.RIGHT],this.renderingHints.render=!1,this.stopPropagation=!0,this.keyStrokeMode=B.Mode.DOWN}handle(e){let t=this.field.$container.activeElement(!0),i=this.field.$container.find(":focusable");switch(e.which){case m.RIGHT:this._handleNext(t,i);break;case m.LEFT:this._handlePrevious(t,i);break}}_handleNext(e,t){let i;e===t.last()[0]?i=t.first():i=$(t[t.index(e)+1]),this.session.focusManager.requestFocus(i),i.addClass("keyboard-navigation")}_handlePrevious(e,t){let i;e===t.first()[0]?i=t.last():i=$(t[t.index(e)-1]),this.session.focusManager.requestFocus(i),i.addClass("keyboard-navigation")}}class fn extends B{constructor(e,t){super(),this.field=e,this.which=[m.ESC],this.stopPropagation=!0,this.renderingHints={render:!!t,$drawingArea:t},this.inheritAccessibility=!1}handle(e){this.field.close()}}class gl extends fn{constructor(e,t){super(e,t)}handle(e){this.field.abort()}}class Dh extends I{comparator;collapseStyle;exclusiveExpand;groups;scrollable;_groupPropertyChangeHandler;constructor(){super(),this.comparator=null,this.collapseStyle=null,this.exclusiveExpand=!0,this.groups=[],this.scrollable=!0,this.$container=null,this.htmlComp=null,this._addWidgetProperties(["groups"]),this._groupPropertyChangeHandler=this._onGroupPropertyChange.bind(this)}_init(e){super._init(e),this._initGroups(this.groups),this._setExclusiveExpand(this.exclusiveExpand)}_createLoadingSupport(){return new Ut({widget:this,withGlassPane:!0})}_render(){this.$container=this.$parent.appendDiv("accordion"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout())}_createLayout(){return new ml}_renderProperties(){super._renderProperties(),this._renderScrollable(),this._renderGroups()}insertGroup(e){this.insertGroups([e])}insertGroups(e){let t=p.ensure(e),i=this.groups;this.setGroups(i.concat(t))}deleteGroup(e){this.deleteGroups([e])}deleteGroups(e){e=p.ensure(e);let t=this.groups.slice();p.removeAll(t,e),this.setGroups(t)}deleteAllGroups(){this.setGroups([])}_initGroups(e){this.groups.forEach(t=>{this._initGroup(t)})}setGroups(e){let t=p.ensure(e);if(b.equals(this.groups,e))return;let i=this._createChildren(t),s=p.diff(this.groups,i),r=p.diff(i,this.groups);this._deleteGroups(s),this._insertGroups(r),this._sort(i),this._updateGroupOrder(i),this._setProperty("groups",i),r.length>0&&this._updateExclusiveExpand(),this.rendered&&(this._updateFirstLastMarker(),this.invalidateLayoutTree())}_insertGroups(e){e.forEach(t=>{this._insertGroup(t)})}_insertGroup(e){this._initGroup(e),this.rendered&&this._renderGroup(e)}_initGroup(e){e.setParent(this),e.on("propertyChange",this._groupPropertyChangeHandler),this.collapseStyle!==null&&e.setCollapseStyle(this.collapseStyle),this.setProperty("collapseStyle",e.collapseStyle)}_renderGroup(e){e.render()}_deleteGroups(e){e.forEach(t=>{this._deleteGroup(t)})}_deleteGroup(e){e.off("propertyChange",this._groupPropertyChangeHandler),e.owner===this?e.destroy():this.rendered&&e.remove()}_renderGroups(){this.groups.forEach(e=>{this._renderGroup(e)}),this._updateFirstLastMarker(),this.invalidateLayoutTree()}setComparator(e){this.comparator!==e&&(this.comparator=e)}sort(){let e=this.groups.slice();this._sort(e),this._updateGroupOrder(e),this._setProperty("groups",e)}_sort(e){this.comparator!==null&&e.sort(this.comparator)}_updateGroupOrder(e){if(!this.rendered)return;let t=!1;e.forEach((i,s)=>{(this.groups[s]!==i||t)&&(t=!0,i.$container.appendTo(this.$container))})}_updateFirstLastMarker(){Fe.updateFirstLastMarker(this.groups)}setScrollable(e){this.setProperty("scrollable",e)}_renderScrollable(){this.scrollable?this._installScrollbars({axis:"y"}):this._uninstallScrollbars(),this.$container.toggleClass("scrollable",this.scrollable),this.invalidateLayoutTree()}getFocusableElement(){let e=Fe.findFirstFocusableWidget(this.groups,this);return e?e.getFocusableElement():null}setExclusiveExpand(e){this.setProperty("exclusiveExpand",e)}_setExclusiveExpand(e){this._setProperty("exclusiveExpand",e),this._updateExclusiveExpand()}_updateExclusiveExpand(){if(!this.exclusiveExpand)return;let e=p.find(this.groups,t=>t.visible&&!t.collapsed);this._collapseOthers(e)}setCollapseStyle(e){this.groups.forEach(t=>{t.setCollapseStyle(e)}),this.setProperty("collapseStyle",e)}_collapseOthers(e){!e||!e.collapsible||this.groups.forEach(t=>{t!==e&&t.collapsible&&t.setCollapsed(!0)})}_onGroupPropertyChange(e){e.propertyName==="collapsed"?this._onGroupCollapsedChange(e):e.propertyName==="visible"&&this._updateFirstLastMarker()}_onGroupCollapsedChange(e){!e.newValue&&this.exclusiveExpand&&this._collapseOthers(e.source)}}class Eh extends K{}class ml extends Si{_getChildren(e){return e.children(".group")}layout(e){super.layout(e),P.update(e,!0)}}class po extends I{buttons;defaultButtonIndex;constructor(){super(),this._addWidgetProperties(["buttons"]),this._addPreserveOnPropertyChangeProperties(["defaultButtonIndex"]),this.$container=null,this.buttons=[],this.defaultButtonIndex=0}_render(){this.$container=this.$parent.appendDiv("box-buttons")}_renderProperties(){super._renderProperties(),this._renderButtons(),this._renderDefaultButtonIndex()}_renderButtons(){this.buttons.filter(e=>!e.rendered).forEach(e=>{e.render(),e.$container.unfocusable().addClass("button box-button")})}_renderDefaultButtonIndex(){for(let e=0;e<this.buttons.length;e++){let t=this.buttons[e];t.$container.toggleClass("default",t.visible&&t.enabledComputed&&this.isDefaultButtonIndex(e))}}isDefaultButtonIndex(e){return e===this.defaultButtonIndex}addButton(e,t){e=e||{},e.parent=this,e.tabbable=!0,e.actionStyle=ce.ActionStyle.BUTTON,e.preventDoubleClick=!0;let i=u.create(ce,e,t);return this.buttons.push(i),i}setDefaultButtonIndex(e){this.setProperty("defaultButtonIndex",e)}buttonCount(){return this.buttons.length}}class Pf extends I{statusEnabled;gridData;moveThreshold;widgets;currentItem;positionX;$carouselItems;$carouselStatusItems;$carouselFilmstrip;$carouselStatus;htmlCompFilmstrip;htmlCompStatus;constructor(){super(),this.statusEnabled=!0,this.currentItem=0,this.moveThreshold=.25,this.widgets=[],this.$carouselItems=[],this.$carouselStatusItems=[],this.positionX=0,this._addWidgetProperties(["widgets"])}_init(e){super._init(e),this._setGridData(this.gridData),this.widgets=p.ensure(this.widgets)}_setGridData(e){this._setProperty("gridData",new ke(e))}_render(){this.$container=this.$parent.appendDiv("carousel").data("pseudo-scrollable",!0),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Fh(this)),this.$carouselFilmstrip=this.$container.appendDiv("carousel-filmstrip"),this._registerCarouselFilmstripEventListeners(),this.htmlCompFilmstrip=x.install(this.$carouselFilmstrip,this.session)}_remove(){this._removeStatus(),super._remove()}_renderProperties(){super._renderProperties(),this._renderWidgets(),this._renderCurrentItem(),this._renderStatusEnabled()}setStatusEnabled(e){this.setProperty("statusEnabled",e)}_renderStatusEnabled(){this.statusEnabled?(this._renderStatus(),this._renderStatusItems(),this._renderCurrentStatusItem()):this._removeStatus(),this.invalidateLayoutTree()}_renderStatus(){this.$carouselStatus||(this.$carouselStatus=this.$container.appendDiv("carousel-status"),this.htmlCompStatus=x.install(this.$carouselStatus,this.session)),this.$carouselStatus.toggleClass("touch",w.get().supportsOnlyTouch())}_removeStatus(){this.$carouselStatus&&(this.$carouselStatus.remove(),this.$carouselStatus=null)}_renderStatusItems(){if(!this.$carouselStatus)return;this.$carouselStatusItems=[],this.$carouselStatus.empty();const e=w.get().supportsOnlyTouch();this.$carouselItems.forEach((t,i)=>{let s=this.$carouselStatus.appendDiv("status-item");this.$carouselStatusItems.push(s),e||s.on("mousedown",()=>this.setCurrentItem(i))})}_renderCurrentStatusItem(){this.$carouselStatus&&this.$carouselStatusItems.forEach((e,t)=>{e.toggleClass("current-item",t===this.currentItem)})}recalcTransformation(){this.positionX=this.currentItem*this.$container.width()*-1,this.$carouselFilmstrip.css({transform:"translateX("+this.positionX+"px)"}),this.$carouselFilmstrip.one("transitionend",()=>this.session.desktop.repositionTooltips())}setCurrentItem(e){this.setProperty("currentItem",e)}_renderCurrentItem(){this._renderItemsInternal(this.currentItem,!1),this._renderCurrentStatusItem(),this.invalidateLayoutTree()}_renderItemsInternal(e,t){e=e||this.currentItem,t||this.widgets.forEach((i,s)=>{i.rendered&&(s<e-1||s>e+1)&&i.remove()});for(let i=Math.max(e-1,0);i<Math.min(e+2,this.widgets.length);i++){let s=this.widgets[i];s.rendered||(s.render(this.$carouselItems[i]),s.invalidateLayoutTree())}}setWidgets(e){this.setProperty("widgets",e)}_renderWidgets(){this.$carouselFilmstrip.empty(),this.$carouselItems=this.widgets.map((e,t)=>{let i=this.$carouselFilmstrip.appendDiv("carousel-item");return x.install(i,this.session).setLayout(new ji),t!==0&&i.addClass("prevent-initial-focus"),i.on("focusin",o=>{this.currentItem!==t&&queueMicrotask(()=>{o.relatedTarget instanceof HTMLElement&&o.relatedTarget.focus(),this.$container[0].scrollLeft=0})}),e.cssClassAsArray().forEach(o=>i.addClass(o+"-carousel-item")),i}),this._renderStatusItems(),this.setCurrentItem(0)}_registerCarouselFilmstripEventListeners(){let e=this.$carouselFilmstrip.window();this.$carouselFilmstrip.on("mousedown touchstart",t=>{let i=Ve.pageX(t),s=this.positionX,r=this.$container.width()-this.$carouselFilmstrip.width(),o=this.$container.width();e.on("mousemove.carouselDrag touchmove.carouselDrag",l=>{let d=Ve.pageX(l)-i,c=s+d;if(c!==this.positionX&&c<=0&&c>=r){this.$carouselFilmstrip.css({transform:"translateX("+c+"px)"}),this.positionX=c;let f=c/o*-1;this._renderItemsInternal(c<s?Math.floor(f):Math.ceil(f),!0)}}),e.on("mouseup.carouselDrag touchend.carouselDrag touchcancel.carouselDrag",l=>{e.off(".carouselDrag");let a=this.positionX%o,d=this.currentItem;this.positionX<s&&a/o<0-this.moveThreshold?d=Math.ceil(this.positionX/o*-1):this.positionX>s&&a/o>=this.moveThreshold-1&&(d=Math.floor(this.positionX/o*-1)),this.setCurrentItem(d),a!==0&&(this.positionX=d*o*-1,this.recalcTransformation())})})}}class Fh extends ne{carousel;constructor(e){super(),this.carousel=e}layout(e){this.carousel.recalcTransformation();let t=this.carousel.htmlComp.availableSize().subtract(this.carousel.htmlComp.insets()).subtract(this.carousel.htmlCompFilmstrip.margins()),i=this.carousel.htmlComp.availableSize().subtract(this.carousel.htmlComp.insets()).subtract(this.carousel.htmlCompFilmstrip.margins());if(this.carousel.statusEnabled&&this.carousel.htmlCompStatus){let r=this.carousel.htmlCompStatus.size().add(this.carousel.htmlCompStatus.margins());t.height-=r.height,i.height-=r.height}let s=this.carousel.$carouselItems;t.width=s.length*t.width,this.carousel.htmlCompFilmstrip.setSize(t),s.forEach(r=>{x.get(r).setSize(i)})}preferredLayoutSize(e,t){let i=this.carousel.currentItem,s=new F(1,1);return i<this.carousel.$carouselItems.length&&i>=0&&(s=x.get(this.carousel.$carouselItems[i]).prefSize()),s.height+=this.carousel.htmlCompStatus.size().height,s}}class _t{cssClass;editable;errorStatus;horizontalAlignment;htmlEnabled;iconId;mandatory;text;flowsLeft;empty;value;tooltipText;foregroundColor;backgroundColor;font;sortCode;field;_cachedEncodedText;constructor(){this.cssClass=null,this.editable=null,this.errorStatus=null,this.horizontalAlignment=null,this.htmlEnabled=null,this.iconId=null,this.mandatory=null,this._cachedEncodedText=null,this.text=null,this.value=null,this.tooltipText=null,this.sortCode=null}init(e){this._init(e)}_init(e){h().extend(this,e)}update(e){this.setText(e.text),h().extend(this,e)}setEditable(e){this.editable=e}setMandatory(e){this.mandatory=e}setHorizontalAlignment(e){this.horizontalAlignment=e}setHtmlEnabled(e){this.htmlEnabled=e}setValue(e){this.value=e}setErrorStatus(e){this.errorStatus=e}setText(e){let t=this.text;this.text=e,t!==this.text&&(this._cachedEncodedText=null)}setIconId(e){this.iconId=e}encodedText(){return this._cachedEncodedText||(this._cachedEncodedText=_.encode(this.text)),this._cachedEncodedText}setCssClass(e){this.cssClass=e}setSortCode(e){this.sortCode=e}setTooltipText(e){this.tooltipText=e}setBackgroundColor(e){this.backgroundColor=e}setForegroundColor(e){this.foregroundColor=e}setFont(e){this.font=e}}class Yi extends I{leftVisible;rightVisible;horizontalAlignment;$left;$right;constructor(){super(),this.leftVisible=!0,this.rightVisible=!0,this.horizontalAlignment=Yi.HorizontalAlignment.LEFT,this.$left=null,this.$right=null}static HorizontalAlignment={LEFT:"left",RIGHT:"right"};_render(){this.$container=this.$parent.appendDiv("collapse-handle"),this.$container.on("mousedown",this._onMouseDown.bind(this)),T.role(this.$container,"none"),this.$left=this.$container.appendDiv("collapse-handle-body left"),T.role(this.$left,"button"),T.label(this.$left,this.session.text("ui.Collapse")),this.$right=this.$container.appendDiv("collapse-handle-body right"),T.role(this.$right,"button"),T.label(this.$right,this.session.text("ui.Expand"))}_renderProperties(){super._renderProperties(),this._renderLeftVisible(),this._renderRightVisible(),this._renderHorizontalAlignment()}setHorizontalAlignment(e){this.setProperty("horizontalAlignment",e)}_renderHorizontalAlignment(){this.$container.removeClass("left-aligned right-aligned"),this.horizontalAlignment===Yi.HorizontalAlignment.LEFT?this.$container.addClass("left-aligned"):this.horizontalAlignment===Yi.HorizontalAlignment.RIGHT&&this.$container.addClass("right-aligned")}setLeftVisible(e){this.setProperty("leftVisible",e)}_renderLeftVisible(){this.$left.setVisible(this.leftVisible),this._updateVisibilityClasses()}setRightVisible(e){this.setProperty("rightVisible",e)}_renderRightVisible(){this.$right.setVisible(this.rightVisible),this._updateVisibilityClasses()}_updateVisibilityClasses(){let e=this.leftVisible&&this.rightVisible;this.$container.toggleClass("both-visible",e),this.$left.toggleClass("both-visible",e),this.$right.toggleClass("both-visible",e),this.$container.toggleClass("one-visible",(this.leftVisible||this.rightVisible)&&!e),T.hidden(this.$left,!this.leftVisible||null),T.hidden(this.$right,!this.rightVisible||null)}_onMouseDown(e){let t=e.target;if(this.$left.isOrHas(t)){this.trigger("action",{left:!0});return}if(this.$right.isOrHas(t)){this.trigger("action",{right:!0});return}this.$container.hasClass("one-visible")&&this.trigger("action",{left:this.leftVisible,right:this.rightVisible})}}class Rh{session;active;restrictedFocusGain;_glassPaneDisplayParents;_glassPaneTargets;_focusContexts;_glassPaneRenderers;constructor(e){let t={active:!w.get().supportsOnlyTouch(),restrictedFocusGain:!w.get().supportsOnlyTouch(),session:null};if(h().extend(this,t,e),!this.session)throw new Error("Session expected");this._focusContexts=[],this._glassPaneTargets=[],this._glassPaneDisplayParents=[],this._glassPaneRenderers=[];let i=this.session.$entryPoint,s=i.data("partid")||"0";i.attr("tabindex",s),this.restrictedFocusGain&&this.installTopLevelMouseHandlers(i),this.installFocusContext(i,Et.AUTO)}installTopLevelMouseHandlers(e){e.on("mousedown",t=>(this._acceptFocusChangeOnMouseDown(h()(t.target))||t.preventDefault(),!0))}activate(e){this.active!==e&&(this.active=e,h().log.isDebugEnabled()&&h().log.isDebugEnabled()&&h().log.debug("Focus manager active: "+this.active),this.active&&this.validateFocus())}installFocusContext(e,t){let i=this.evaluateFocusRule(e,t),s=new _l(e,this);return Et.PREPARE!==t&&s.ready(),this._pushIfAbsentElseMoveTop(s),i&&s.validateAndSetFocus(i),s}evaluateFocusRule(e,t){let i;return!t||t===Et.AUTO||t===Et.PREPARE?i=this.findFirstFocusableElement(e):t===Et.NONE?i=null:i=t,i}uninstallFocusContext(e,t){t=h().extend({},{preventScroll:!0},t);let i=this.getFocusContext(e);if(!i)return;let s=Us.outsideFilter(i.$container);p.remove(this._focusContexts,i),i.dispose();let r=this._findActiveContext();r&&r.validateAndSetFocus(r.lastValidFocusedElement,s,t)}isFocusContextInstalled(e){return!!this.getFocusContext(e)}activateFocusContext(e){let t;e instanceof _l?t=e:t=this.getFocusContext(e),!(!t||this.isElementCovertByGlassPane(t.$container))&&(this._pushIfAbsentElseMoveTop(t),this.validateFocus())}isElementCovertByGlassPane(e,t){let i=this._glassPaneTargets;return t&&(i=this._glassPaneTargets.filter(t)),i.length?this._glassPaneDisplayParents.indexOf(u.widget(e))>=0?!0:i.some(s=>h()(e).closest(s).length!==0):!1}registerGlassPaneTarget(e){this._glassPaneTargets.push(e),this.validateFocus()}unregisterGlassPaneTarget(e){p.$remove(this._glassPaneTargets,e),this.validateFocus()}registerGlassPaneDisplayParent(e){this._glassPaneDisplayParents.push(e)}unregisterGlassPaneDisplayParent(e){p.remove(this._glassPaneDisplayParents,e)}registerGlassPaneRenderer(e){this._glassPaneRenderers.push(e)}unregisterGlassPaneRenderer(e){p.remove(this._glassPaneRenderers,e)}rerenderGlassPanes(){this._glassPaneRenderers.slice().forEach(t=>{t.removeGlassPanes(),t.renderGlassPanes()})}validateFocus(e){let t=this._findActiveContext();t&&t.validateFocus(e)}requestFocusIfReady(e,t){return this.requestFocus(e,t,{onlyIfReady:!0})}requestFocus(e,t,i){i=i||{};let s=e instanceof h()?e[0]:e;if(!s)return!1;let r=this._findFocusContextFor(s);if(r){if(u.nvl(i.onlyIfReady,!1)&&!r.prepared)return!1;r.validateAndSetFocus(s,t,i)}return Qe.isActiveElement(s)}findFirstFocusableElement(e,t){let i,s,r,o,l,a,d,c,f,g=e.entryPoint(),y=e.find(":focusable").addBack(":focusable").not(g).filter(t||Us.returnTrue);for(o=0;o<y.length;o++)if(l=y[o],a=h()(l),!this.isElementCovertByGlassPane(l)&&!(a.is(".prevent-initial-focus")||a.closest(".prevent-initial-focus").length>0)){if(!i&&!(a.hasClass("button")||a.hasClass("menu-item"))&&(i=l),!s&&a.is(".default")&&(s=l),d=a.parents(".menubar"),c=a.parents(".tab-box-header"),f=a.parents(".box-buttons"),(d.length>0||c.length>0||f.length>0)&&!r&&(a.hasClass("button")||a.hasClass("menu-item")))r=l;else if(!d.length&&!c.length&&!f.length&&typeof l.focus=="function")return l}if(s)return s;if(r){if(r!==i&&i){let v=h()(r).parents(".tab-box-header"),D=h()(i);if(h()(i).parents(".tab-box-header").length>0&&v.length>0&&D.is(".tab-item"))return i}return r}return i}_findActiveContext(){return p.last(this._focusContexts)}getFocusContext(e){return p.find(this._focusContexts,t=>t.$container===e)}focusNextTabbable(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._findFocusContextFor(e);i&&i.focusNextTabbable(t)}_findFocusContextFor(e){let t=h().ensure(e),i=null,s=Number.MAX_VALUE;return this._focusContexts.forEach(r=>{if(!r.$container.isOrHas(t))return;t.parentsUntil(r.$container).length<s&&(i=r)}),i}_acceptFocusChangeOnMouseDown(e){if(e.hasClass("glasspane")||this.isElementCovertByGlassPane(e)||!Qe.isFocusableByMouse(e))return!1;if(e.is(":focusable")||Qe.isSelectableText(e))return!0;let t=e.entryPoint(),i=Qe.closestFocusableByMouse(e,t,!0),s=h()();return Qe.isFocusPrevented(i)&&(s=Qe.closestFocusableByMouse(i.parent(),t)),Qe.isDraggable(e)?(s.length?Qe.focusLater(s,{preventScroll:!0}):Qe.restoreFocusLater(t,{preventScroll:!0}),!0):s.length?(s.is(e.activeElement())||Qe.focusLater(s,{preventScroll:!0}),!1):!!Qe.containsParentFocusableByMouse(e,t)}_pushIfAbsentElseMoveTop(e){p.remove(this._focusContexts,e),this._focusContexts.push(e)}}class _l{focusManager;lastValidFocusedElement;focusedElement;prepared;$container;_keyDownListener;_focusInListener;_focusOutListener;_unfocusableListener;_removeListener;constructor(e,t){this.$container=e,this.focusManager=t,this.lastValidFocusedElement=null,this.focusedElement=null,this.prepared=!1,this._keyDownListener=this._onKeyDown.bind(this),this._focusInListener=this._onFocusIn.bind(this),this._focusOutListener=this._onFocusOut.bind(this),this._unfocusableListener=this._onUnfocusable.bind(this),this._removeListener=this._onRemove.bind(this)}ready(){this.prepared||(this.$container.on("keydown",this._keyDownListener).on("focusin",this._focusInListener).on("focusout",this._focusOutListener).on("hide disable",this._unfocusableListener),this.prepared=!0,this.lastValidFocusedElement&&this.restoreFocus())}dispose(){this.prepared&&(this.$container.off("keydown",this._keyDownListener).off("focusin",this._focusInListener).off("focusout",this._focusOutListener).off("hide disable",this._unfocusableListener),h()(this.focusedElement).off("remove",this._removeListener))}_onKeyDown(e){e.which===m.TAB&&this.focusNextTabbable(!e.shiftKey,e)}focusNextTabbable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1?arguments[1]:void 0,i=this.$container.find(":tabbable"),s=i.filter((v,D)=>!this.focusManager.isElementCovertByGlassPane(D));if(s.length===0)return;let r=this.$container.activeElement(!0),o=s.index(r),l=s.first()[0],a=s.last()[0],d=null,c=!1;if(e?r===a||r===this.$container[0]?(d=l,c=!0):o<s.length-1&&(d=s.get(o+1),c=i.get(i.index(r)+1)!==d):r===l||r===this.$container[0]?(d=a,c=!0):o>0&&(d=s.get(o-1),c=i.get(i.index(r)-1)!==d),!d)return;t&&!c||(this.validateAndSetFocus(d,null,{selectText:d.tagName==="INPUT"}),h().suppressEvent(t));let f=h()(d);f.addClass("keyboard-navigation");let g=C.offsetBounds(f),y=f.scrollParent();P.isLocationInView(new X(g.x,g.y),y)||P.scrollTo(y,f)}_onFocusIn(e){let t=h()(e.target);t.on("remove",this._removeListener);let i=t[0];this.focusedElement=i,i!==this.$container.entryPoint(!0)&&(this.focusManager._pushIfAbsentElseMoveTop(this),this.validateAndSetFocus(i),e.stopPropagation())}_onFocusOut(e){h()(e.target).off("remove",this._removeListener),h()(this.focusedElement).removeClass("keyboard-navigation"),this.focusedElement=null,e.stopPropagation()}_onRemove(e){this.validateAndSetFocus(null,Us.notSameFilter(e.target)),e.stopPropagation()}_onUnfocusable(e){h()(e.target).isOrHas(this.lastValidFocusedElement)&&(this.validateAndSetFocus(null,Us.notSameFilter(e.target)),e.stopPropagation())}validateAndSetFocus(e,t,i){e&&!h().contains(this.$container[0],e)&&(e=null);let s=null;e?!t||t.call(e)?s=e:s=this.focusManager.findFirstFocusableElement(this.$container,t):s=this.focusManager.findFirstFocusableElement(this.$container,t),this.lastValidFocusedElement=s,this._focus(s,i)}validateFocus(e){this.validateAndSetFocus(this.lastValidFocusedElement,e)}restoreFocus(){this.lastValidFocusedElement&&this._focus(this.lastValidFocusedElement)}_focus(e,t){if(t=t||{},!!this.focusManager.active&&this.prepared){if(this.focusManager.isElementCovertByGlassPane(e)){let i=this.$container.activeElement(!0);if(e&&(!i||!this.focusManager.isElementCovertByGlassPane(i)))return;e=null}e=e||this.$container.entryPoint(!0),e.focus||(e=this.$container.entryPoint(!0)),!Qe.isActiveElement(e)&&(e.focus({preventScroll:u.nvl(t.preventScroll,!1)}),t.selectText&&"select"in e&&b.isFunction(e.select)&&e.select(),h().log.isDebugEnabled()&&h().log.debug("Focus set to "+C.debugOutput(e)))}}}const Qe={isFocusableByMouse(n){return h().ensure(n).closest(".unfocusable").length===0},isFocusPrevented(n){return Number(h().ensure(n).attr("tabindex"))===-2},getParentsFocusableByMouse(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return h().ensure(n).parentsUntil(".focus-boundary",t?":focusable-native":":focusable").not(e).filter((i,s)=>Qe.isFocusableByMouse(s))},closestFocusableByMouse(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=h().ensure(n);return i.is(t?":focusable-native":":focusable")&&Qe.isFocusableByMouse(i)?i:Qe.getParentsFocusableByMouse(i,e,t).first()},containsParentFocusableByMouse(n,e){return Qe.getParentsFocusableByMouse(n,e).length>0},isSelectableText(n){let e=h()(n),t=e;for(;t.css("user-select")==="auto";)if(t=t.parent(),t.is("body"))return!1;return t.css("user-select")==="none"?!1:e.is("input[disabled][type=text], textarea[disabled]")?!0:e.text().trim().length>0},isDraggable(n){return h().ensure(n).closest('[draggable="true"]').length>0},isActiveElement(n){if(!n)return!1;let e;if(n instanceof h())e=n.activeElement(!0),n=n[0];else{let t=n;e=(t instanceof Document?t:t.ownerDocument).activeElement}return e===n},restoreFocusLater(n,e){if(n=h().ensure(n),!n.length)return;let t=n.document(!0),i=t.activeElement;requestAnimationFrame(()=>{let s=t.activeElement;(s===n[0]||Qe.isFocusPrevented(s))&&i.focus(e)})},focusLater(n,e){let t=h().ensure(n);if(!t.length)return;let i=t.document(!0),s=i.activeElement;requestAnimationFrame(()=>{let r=i.activeElement;(r===s||Qe.isFocusPrevented(r))&&t[0].focus(e)})}};var Et;(function(n){n.AUTO="auto",n.NONE="none",n.PREPARE="prepare"})(Et||(Et={}));class Ah extends I{_active;_render(){this.$container=this.$parent.appendDiv("glasspane"),this.$parent.css("position")==="static"&&this.$parent.css("position","relative"),this.activate()}_remove(){this.deactivate(),super._remove()}activate(){this._active||(this.$parent.addClass("glasspane-parent"),this.session.focusManager.registerGlassPaneTarget(this.$parent),this.$container.removeClass("deactivated"),this._active=!0)}deactivate(){this._active&&(this.$parent.removeClass("glasspane-parent"),this.session.focusManager.unregisterGlassPaneTarget(this.$parent),this.removing||this.$container.addClass("deactivated"),this._active=!1)}}class Er{glassPaneRenderer;$glassPaneTargets;constructor(){this.$glassPaneTargets=null,this.glassPaneRenderer=null}ready(e){this.$glassPaneTargets=e,this.renderWhenReady()}rendererReady(e){this.glassPaneRenderer=e,this.renderWhenReady()}removeGlassPaneRenderer(e){this.glassPaneRenderer===e&&(this.glassPaneRenderer=null)}renderWhenReady(){this.glassPaneRenderer&&this.$glassPaneTargets&&this.$glassPaneTargets.length>0&&this.$glassPaneTargets.forEach(e=>this.glassPaneRenderer.renderGlassPane(e))}static createFor(e,t){if(e.rendered)throw new Error("Don't call this function if widget is already rendered.");let i=new Er,s=r=>{let o=t();i.ready(o)};return e.one("render",s),e.one("destroy",()=>{e.off("render",s)}),[i]}}class Fr{session;_widget;_enabled;_$glassPanes;_deferredGlassPanes;_resolvedDisplayParent;_registeredDisplayParent;_displayParentRenderHandler;_glassPaneRemoveHandler;_glassPaneRendererRegistered;constructor(e,t){this._widget=e,this.session=e.session,this._enabled=u.nvl(t,!0),this._$glassPanes=[],this._deferredGlassPanes=[],this._resolvedDisplayParent=null,this._registeredDisplayParent=null,this._displayParentRenderHandler=this._onDisplayParentRender.bind(this),this._glassPaneRemoveHandler=this._onGlassPaneRemove.bind(this),this._glassPaneRendererRegistered=!1}renderGlassPanes(){this.findGlassPaneTargets().forEach(e=>this.renderGlassPane(e)),this._glassPaneRendererRegistered||(this.session.focusManager.registerGlassPaneRenderer(this),this._glassPaneRendererRegistered=!0)}renderGlassPane(e){if(e instanceof Er){e.rendererReady(this),this._deferredGlassPanes.push(e);return}let t=h().ensure(e);if(this._widget.$container&&this._widget.$container[0]===t[0]||this._$glassPanes.some(o=>o.parent()[0]===t[0]))return;let s=t.appendDiv("glasspane").on("mousedown",this._onMouseDown.bind(this));this._adjustGlassPaneSize(s,t);let r=s.window(!0);r&&r[Nr.PROP_POPUP_WINDOW]&&s.addClass("dark"),this._$glassPanes.push(s),this.session.focusManager.registerGlassPaneTarget(t),s.one("remove",this._glassPaneRemoveHandler),this._registerDisplayParent()}_adjustGlassPaneSize(e,t){let i=-t.cssBorderTopWidth(),s=-t.cssBorderBottomWidth(),r=-t.cssBorderLeftWidth(),o=-t.cssBorderRightWidth();t.children().each((l,a)=>{let d=h()(a);i=Math.min(i,(d.cssTop()||0)+(d.cssMarginTop()||0)),s=Math.min(s,(d.cssBottom()||0)+(d.cssMarginBottom()||0)),r=Math.min(r,(d.cssLeft()||0)+(d.cssMarginLeft()||0)),o=Math.min(o,(d.cssRight()||0)+(d.cssMarginRight()||0))}),e.cssTop(i).cssBottom(s).cssLeft(r).cssRight(o)}removeGlassPanes(){this._$glassPanes.slice().forEach(e=>this._removeGlassPane(e)),this._deferredGlassPanes.forEach(e=>e.removeGlassPaneRenderer(this)),this._deferredGlassPanes=[],this._unregisterDisplayParent(),this.session.focusManager.unregisterGlassPaneRenderer(this),this._glassPaneRendererRegistered=!1}_removeGlassPane(e){let t=e.parent();e.off("remove",this._glassPaneRemoveHandler),e.remove(),p.$remove(this._$glassPanes,e),t.removeClass("glasspane-parent"),this.session.focusManager.unregisterGlassPaneTarget(t)}eachGlassPane(e){this._$glassPanes.forEach(t=>e(t))}findGlassPaneTargets(){if(!this._enabled)return[];let e=this._resolveDisplayParent();return!e||!e.glassPaneTargets?[]:e.glassPaneTargets(this._widget)}_resolveDisplayParent(){return this._resolvedDisplayParent||(this._resolvedDisplayParent=this._widget.displayParent||this.session.desktop),this._resolvedDisplayParent}_registerDisplayParent(){this._resolvedDisplayParent||this._resolveDisplayParent(),this._resolvedDisplayParent&&(this._registeredDisplayParent||(this.session.focusManager.registerGlassPaneDisplayParent(this._resolvedDisplayParent),this._registeredDisplayParent=this._resolvedDisplayParent,this._registeredDisplayParent.on("render",this._displayParentRenderHandler)))}_unregisterDisplayParent(){this._registeredDisplayParent&&(this.session.focusManager.unregisterGlassPaneDisplayParent(this._registeredDisplayParent),this._registeredDisplayParent.off("render",this._displayParentRenderHandler),this._registeredDisplayParent=null)}_onMouseDown(e){let t=null,i=this._resolveDisplayParent();if(i.onGlassPaneMouseDown&&i.onGlassPaneMouseDown(this._widget,h()(e.target)),this._widget instanceof j&&this._widget.isView()){let s=this.session.desktop.bench.getViewTab(this._widget);s&&(t=s.$container,t.isVisible()||(t=t.siblings(".overflow-tab-item")))}else this._widget.$container&&(t=this._widget.$container);if(t){let s=this._widget.$container.children(".glasspane");s.length?s.trigger("mousedown"):t.addClassForAnimation("animate-modality-highlight",{classesToRemove:"animate-modality-highlight animate-open"})}h().suppressEvent(e)}_onDisplayParentRender(e){this.renderGlassPanes()}_onGlassPaneRemove(e){let t=h()(e.target);this._removeGlassPane(t)}}class $h extends I{location;sandboxEnabled;sandboxPermissions;scrollBarEnabled;trackLocation;wrapIframe;$iframe;constructor(){super(),this.location=null,this.sandboxEnabled=!0,this.sandboxPermissions=null,this.scrollBarEnabled=!0,this.trackLocation=!1,this.wrapIframe=w.get().isIosPlatform(),this.$iframe=null}_createKeyStrokeContext(){return new Mh}_render(){let e="iframe "+w.get().cssClassForIphone();this.session.layoutValidator.suppressValidate(),this.wrapIframe?(this.$container=this.$parent.appendDiv("iframe-wrapper"),this.$iframe=this.$container.appendElement("<iframe>",e)):(this.$iframe=this.$parent.appendElement("<iframe>",e),this.$container=this.$iframe),this.session.layoutValidator.unsuppressValidate(),this.htmlComp=x.install(this.$container,this.session),this.$iframe.on("load",this._onLoad.bind(this))}_renderProperties(){super._renderProperties(),this._renderScrollBarEnabled(),this._renderSandboxEnabled(),this._renderLocation()}setLocation(e){this.setProperty("location",e)}_renderLocation(){let e=this.location||"about:blank";this.$iframe.attr("src",e)}setTrackLocation(e){this.setProperty("trackLocation",e)}_contentDocument(){return this.$iframe&&this.$iframe[0]?this.$iframe[0].contentDocument:null}_onLoad(e){this.rendered&&(this.trackLocation&&this._updateLocation(),this._propagateKeyEvents())}_updateLocation(){let e=this._contentDocument();if(!e)return;let t=e.location.href;t==="about:blank"&&(t=null),this._setProperty("location",t)}_propagateKeyEvents(){let e=this._contentDocument();if(!e)return;let t=this.$iframe[0];t&&Ve.addPropagationListener(e,t,["keydown","keyup","keypress"])}setScrollBarEnabled(e){this.setProperty("scrollBarEnabled",e)}_renderScrollBarEnabled(){this.$container.toggleClass("no-scrolling",!this.scrollBarEnabled),this.$iframe.attr("scrolling",this.scrollBarEnabled?"yes":"no"),this.rendered&&this._renderLocation()}setSandboxEnabled(e){this.setProperty("sandboxEnabled",e)}_renderSandboxEnabled(){this.sandboxEnabled?this._renderSandboxPermissions():(this.$iframe.removeAttr("sandbox"),this.$iframe.removeAttr("security")),this.rendered&&this._renderLocation()}setSandboxPermissions(e){this.setProperty("sandboxPermissions",e)}_renderSandboxPermissions(){this.sandboxEnabled&&(this.$iframe.attr("sandbox",u.nvl(this.sandboxPermissions,"")),this.rendered&&this._renderLocation())}postMessage(e,t,i){this.rendered&&this.$iframe[0].contentWindow.postMessage(e,t,i)}}class Mh extends Ee{_applyPropagationFlags(e){if(e.which===m.TAB){e.stopPropagation();return}let t=h()(this._resolveTarget(e)),i=new qi;if(i.isButton(t)){Ae.toModifierBitMask(e)===Ae.NONE&&u.isOneOf(e.which,[m.ENTER,m.SPACE])&&e.stopPropagation();return}if(i.isInput(t)){let s=new ho(e.which,e.ctrlKey,e.altKey,e.shiftKey,e.type,t[0]);i.setMultiline(t.is("textarea")),i.toggleStopPropagationKeys(Ae.NONE,[m.ENTER,m.SPACE],t.is("textarea")),i.accept(s),s.isPropagationStopped()&&e.stopPropagation()}}_resolveTarget(e){return e.originalEvent?.sourceEvent?.target}}class fo extends I{axis;borderless;mouseWheelNeedsShift;$thumb;$thumbHandle;_scrollSize;_offsetSize;_dim;_dir;_dirReverse;_scrollDir;_thumbClipping;_onScrollHandler;_onScrollWheelHandler;_onScrollbarMouseDownHandler;_onTouchStartHandler;_onThumbMouseDownHandler;_onDocumentMousemoveHandler;_onDocumentMouseUpHandler;_onAncestorScrollOrResizeHandler;_fixScrollbarHandler;_unfixScrollbarHandler;_$thumb;_$thumbHandle;_$ancestors;constructor(){super(),this.$container=null,this.$thumb=null,this.$thumbHandle=null,this.axis="y",this.borderless=!1,this.mouseWheelNeedsShift=!1,this._scrollSize=null,this._offsetSize=null,this._dim="Height",this._dir="top",this._dirReverse="bottom",this._scrollDir="scrollTop",this._thumbClipping=new We(0,0,0,0),this._onScrollHandler=this._onScroll.bind(this),this._onScrollWheelHandler=this._onScrollWheel.bind(this),this._onScrollbarMouseDownHandler=this._onScrollbarMouseDown.bind(this),this._onTouchStartHandler=this._onTouchStart.bind(this),this._onThumbMouseDownHandler=this._onThumbMouseDown.bind(this),this._onDocumentMousemoveHandler=this._onDocumentMousemove.bind(this),this._onDocumentMouseUpHandler=this._onDocumentMouseUp.bind(this),this._onAncestorScrollOrResizeHandler=this.update.bind(this),this._fixScrollbarHandler=this._fixScrollbar.bind(this),this._unfixScrollbarHandler=this._unfixScrollbar.bind(this)}_render(){this._ensureParentPosition(),this.$container=this.$parent.appendDiv("scrollbar").addClass(this.axis+"-axis"),this._$thumb=this.$container.appendDiv("scrollbar-thumb").addClass(this.axis+"-axis"),this._$thumbHandle=this._$thumb.appendDiv("scrollbar-thumb-handle").addClass(this.axis+"-axis"),this.borderless&&this.$container.addClass("borderless"),this._dim=this.axis==="x"?"Width":"Height",this._dir=this.axis==="x"?"left":"top",this._dirReverse=this.axis==="x"?"right":"bottom",this._scrollDir=this.axis==="x"?"scrollLeft":"scrollTop";let e=this.$parent.data("scrollbars");if(!e)throw new Error('Data "scrollbars" missing in '+C.debugOutput(this.$parent)+`
Ancestors: `+this.ancestorsToString(1));this.$parent.on("wheel",this._onScrollWheelHandler).on("scroll",this._onScrollHandler).onPassive("touchstart",this._onTouchStartHandler),e.forEach(t=>{t.on("scrollStart",this._fixScrollbarHandler),t.on("scrollEnd",this._unfixScrollbarHandler)}),this.$container.on("mousedown",this._onScrollbarMouseDownHandler),this._$thumb.on("mousedown",this._onThumbMouseDownHandler),this._$ancestors=this.$container.parents("div").on("scroll resize",this._onAncestorScrollOrResizeHandler)}_remove(){this.$parent.off("wheel",this._onScrollWheelHandler).off("scroll",this._onScrollHandler).offPassive("touchstart",this._onTouchStartHandler);let e=this.$parent.data("scrollbars");e&&e.forEach(t=>{t.off("scrollStart",this._fixScrollbarHandler),t.off("scrollEnd",this._unfixScrollbarHandler)}),this.$container.off("mousedown",this._onScrollbarMouseDownHandler),this._$thumb.off("mousedown","",this._onThumbMouseDownHandler),this._$ancestors.off("scroll resize",this._onAncestorScrollOrResizeHandler),this._$ancestors=null,super._remove()}_renderOnAttach(){super._renderOnAttach(),this._ensureParentPosition()}_ensureParentPosition(){if(this.$parent&&this.$parent.isAttached()){let e=this.$parent.css("position");u.isOneOf(e,"relative","absolute")||this.$parent.css("position","relative")}}scroll(e){let t=Math.max(0,this.$parent[this._scrollDir]());this._scrollToAbsolutePoint(t+e)}_scrollToAbsolutePoint(e){let t=Math.min(this._scrollSize-this._offsetSize+1,Math.max(0,Math.round(e)));this.$parent[this._scrollDir](t)}update(){if(!this.rendered)return;let e=this.$container["cssMargin"+this.axis.toUpperCase()](),t=this.$parent["cssBorderWidth"+this.axis.toUpperCase()](),i=this.$parent[this._scrollDir](),s=this.$parent.scrollLeft(),r=this.$parent.scrollTop();this.reset(),this._offsetSize=this.$parent[0]["offset"+this._dim]-t,this._scrollSize=this.$parent[0]["scroll"+this._dim]-t;let o=Math.max(this._offsetSize*this._offsetSize/this._scrollSize-e,25),l=this._offsetSize-o-e;this._$thumb.css(this._dim.toLowerCase(),o);let a=i/(this._scrollSize-this._offsetSize)*l;this._$thumb.css(this._dir,a),this._offsetSize+1>=this._scrollSize?this.$container.css("display","none"):(this.$container.css("display",""),this._isContainerTooSmallForThumb()?this._$thumb.addClass("container-too-small-for-thumb"):this._$thumb.removeClass("container-too-small-for-thumb")),this._clipWhenOverlappingAncestor(),this.$container.cssRight(-1*s),this.$container.cssBottom(-1*r)}_resetClipping(){this.axis==="y"?this._$thumb.css("width","").css("left",""):this._$thumb.css("height","").css("top",""),this._$thumb.removeClass("clipped-left clipped-right clipped-top clipped-bottom"),this._thumbClipping=new We(0,0,0,0)}_clipWhenOverlappingAncestor(){if(this._resetClipping(),this.$container.css("position")==="fixed"){let e=C.offsetBounds(this._$thumb),t=e.width,i=e.height,s=e.x+e.width,r=e.y+e.height,o=0,l=0,a=s,d=r;this.$container.parents("div").each(function(){let v=h()(this),D=C.offsetBounds(v);if(v.css("overflow-x")!=="visible"){D.x>o&&(o=D.x);let k=D.x+D.width;k<a&&(a=k)}if(v.css("overflow-y")!=="visible"){D.y>l&&(l=D.y);let k=D.y+D.height;k<d&&(d=k)}});let c=0,f=0,g=0,y=0;o>e.x&&(c=o-e.x,t-=c,this._$thumb.css("width",t).css("left",C.bounds(this._$thumb).x+c).addClass("clipped-left")),l>e.y&&(g=l-e.y,i-=g,this._$thumb.css("height",i).css("top",C.bounds(this._$thumb).y+g).addClass("clipped-top")),s>a&&(f=s-a,this._$thumb.css("width",t-f).addClass("clipped-right")),r>d&&(y=r-d,this._$thumb.css("height",i-y).addClass("clipped-bottom")),this._thumbClipping=new We(g,f,y,c)}}reset(){this._$thumb.css(this._dim.toLowerCase(),0),this.$container.cssRight(0),this.$container.cssBottom(0)}_onScroll(e){this.update()}_onTouchStart(e){Ve.onScrollStartEndDuringTouch(this.$parent,()=>{this.rendered&&this.$container.css("opacity",0)},()=>{this.rendered&&this.$container.css("opacity","")})}_onScrollWheel(e){if(!this.$container.isVisible()||e.ctrlKey||this.mouseWheelNeedsShift!==e.shiftKey)return!0;let t=e.originalEvent,i=0;return this.axis==="y"?i=t.deltaY:this.axis==="x"&&(i=t.deltaX|t.deltaY),this.notifyBeforeScroll(),this.scroll(i),this.notifyAfterScroll(),!1}_onScrollbarMouseDown(e){this.notifyBeforeScroll();let t=this.$container[this._dim.toLowerCase()](),i=this.$container.offset()[this._dir],s=(this.axis==="x"?e.pageX:e.pageY)-i,r;if(this._isContainerTooSmallForThumb())r=Math.min(1,Math.max(0,s/t)),this._scrollToAbsolutePoint(r*this._scrollSize-Math.round(this._offsetSize/2));else{let o=this._$thumb["outer"+this._dim](!0),l=Math.round(o/2),a=t-Math.round(o/2),d=(s-l)*(1/(a-l));r=Math.min(1,Math.max(0,d)),this._scrollToAbsolutePoint(r*(this._scrollSize-this._offsetSize))}this.notifyAfterScroll()}_onThumbMouseDown(e){if(this._isContainerTooSmallForThumb())return!0;this.notifyBeforeScroll();let i=(this.axis==="x"?this._thumbClipping.horizontal():this._thumbClipping.vertical())+this._$thumb["outer"+this._dim](!0),s=this.axis==="x"?this._thumbClipping.left:this._thumbClipping.top,r=this._$thumb.offset()[this._dir]+Math.floor(i/2)-s,o=Math.round((this.axis==="x"?e.pageX:e.pageY)-r);return this._$thumb.addClass("scrollbar-thumb-move"),this._$thumb.document().on("mousemove",{thumbCenterOffset:o},this._onDocumentMousemoveHandler).one("mouseup",this._onDocumentMouseUpHandler),!1}_onDocumentMousemove(e){if(!this.rendered)return;let t=e.data.thumbCenterOffset,s=(this.axis==="x"?this._thumbClipping.horizontal():this._thumbClipping.vertical())+this._$thumb["outer"+this._dim](!0),r=this.$container[this._dim.toLowerCase()]()-s,o=this.$container.offset()[this._dir]+s/2,l=Math.min(r,Math.max(0,(this.axis==="x"?e.pageX:e.pageY)-o-t)),d=Math.min(1,Math.max(0,l/r))*(this._scrollSize-this._offsetSize);this._scrollToAbsolutePoint(d)}_onDocumentMouseUp(e){return h()(e.currentTarget).off("mousemove",this._onDocumentMousemoveHandler),this.rendered&&this._$thumb.removeClass("scrollbar-thumb-move"),this.notifyAfterScroll(),!1}notifyBeforeScroll(){this.trigger("scrollStart")}notifyAfterScroll(){this.trigger("scrollEnd")}_fixScrollbar(){P.fix(this.$container),this.update()}_unfixScrollbar(){P.unfix(this.$container,null,!0),this.update()}_isContainerTooSmallForThumb(){let e=this._$thumb["outer"+this._dim](!0),t=this.$container[this._dim.toLowerCase()]();return e>=t}}const P={_$scrollables:{},intersectionObserver:null,getScrollables(n){if(n)return P._$scrollables[n+""]||[];let e=[];return b.values(P._$scrollables).forEach(t=>{p.pushAll(e,t)}),e},pushScrollable(n,e){let t=n+"";if(P._$scrollables[t]){if(P._$scrollables[t].indexOf(e)>-1)return;P._$scrollables[t].push(e)}else P._$scrollables[t]=[e];h().log.isTraceEnabled()&&h().log.trace("Scrollable added: "+e.attr("class")+". New length: "+P._$scrollables[t].length)},removeScrollable(n,e){let t=0,i=n+"";if(P._$scrollables[i]){if(t=P._$scrollables[i].length,p.$remove(P._$scrollables[i],e),h().log.isTraceEnabled()&&h().log.trace("Scrollable removed: "+e.attr("class")+". New length: "+P._$scrollables[i].length),t===P._$scrollables[i].length)throw new Error("scrollable could not be removed. Potential memory leak. "+e.attr("class"))}else throw new Error("scrollable could not be removed. Potential memory leak. "+e.attr("class"))},install(n,e){e=e||{},e.axis=e.axis||"both",e.scrollShadow=e.scrollShadow||"auto";let t=u.nvl(e.nativeScrollbars,w.get().hasPrettyScrollbars()),i=u.nvl(e.hybridScrollbars,w.get().canHideScrollbars());t?P._installNative(n,e):i?(n.addClass("hybrid-scrollable"),P._installNative(n,e),P._installJs(n,e)):(n.css("overflow","hidden"),P._installJs(n,e));let s=x.optGet(n);s&&(s.scrollable=!0),n.data("scrollable",!0),n.data("scroll-axis",e.axis);let r=e.session||e.parent.session;return P.pushScrollable(r,n),e.scrollShadow&&P.installScrollShadow(n,e),n},_installNative(n,e){w.get().isIos()?setTimeout(P._installNativeInternal.bind(this,n,e)):P._installNativeInternal(n,e)},_installNativeInternal(n,e){h().log.isTraceEnabled()&&h().log.trace("use native scrollbars for container "+C.debugOutput(n)),e.axis==="x"?n.css("overflow-x","auto").css("overflow-y","hidden"):e.axis==="y"?n.css("overflow-x","hidden").css("overflow-y","auto"):n.css("overflow","auto"),n.css("-webkit-overflow-scrolling","touch"),n.attr("tabindex")===void 0&&n.attr("tabindex","-2")},installScrollShadow(n,e){if(!w.get().supportsIntersectionObserver())return;let t=P._computeScrollShadowStyle(e);if(t.length===0)return;let i=n.afterDiv("scroll-shadow");i.toggleClass("large",t.indexOf("large")>-1),i.toggleClass("gradient",t.indexOf("gradient")>-1),i.data("scroll-shadow-parent",n),n.data("scroll-shadow",i),n.data("scroll-shadow-style",t),n.data("scroll-shadow-customizer",e.scrollShadowCustomizer);let s=()=>P.updateScrollShadowWhileScrolling(n);n.data("scroll-shadow-handler",s),n.on("scroll",s),P.updateScrollShadow(n),P._installMutationObserver(n.entryPoint()),P._installIntersectionObserver(),P.intersectionObserver.observe(n[0]);let r=n[0],o=l=>{l.target===r&&P._onScrollableVisibleChange(r,l.type==="show")};n.data("scroll-shadow-visible-listener",o),n.on("hide show",o)},uninstallScrollShadow(n,e){let t=n.data("scroll-shadow");t&&(t.remove(),n.removeData("scroll-shadow")),n.removeData("scroll-shadow-style"),n.removeData("scroll-shadow-customizer");let i=n.data("scroll-shadow-handler");i&&(n.off("scroll",i),n.removeData("scroll-shadow-handler")),P.intersectionObserver&&P.intersectionObserver.unobserve(n[0]);let s=n.data("scroll-shadow-visible-listener");s&&n.off("hide show",s),P._hasScrollShadow(e,n.entryPoint(!0))||P._uninstallMutationObserver(n.entryPoint()),P._hasScrollShadow(e)||P._uninstallIntersectionObserver()},_hasScrollShadow(n,e){const t=P._$scrollables[n+""];return t&&t.some(i=>i.data("scroll-shadow")&&(!e||i.entryPoint(!0)===e))},_computeScrollShadowStyle(n){let e=n.scrollShadow;return e?(typeof e=="string"&&(e=e.split(" ")),e=e.slice(),e.indexOf("none")>-1?[]:(p.containsAny(e,["y","x","top","right","bottom","left"])||((n.axis==="both"||n.axis==="y")&&e.push("y"),(n.axis==="both"||n.axis==="x")&&e.push("x")),e.indexOf("y")>-1&&(e.push("top"),e.push("bottom")),e.indexOf("x")>-1&&(e.push("left"),e.push("right")),p.removeAll(e,["all","y","x","auto","none"]),e)):[]},updateScrollShadowWhileScrolling(n){let e=n.findUp(t=>t.hasAnimationClass());if(e.length>0){e.oneAnimationEnd(()=>P.updateScrollShadow(n));return}P.updateScrollShadow(n)},updateScrollShadow(n){let e=n.data("scroll-shadow");if(!e)return;let t=n[0].scrollTop,i=n[0].scrollLeft,s=c(t),r=f(t,n[0].scrollHeight,n[0].offsetHeight),o=c(i),l=f(i,n[0].scrollWidth,n[0].offsetWidth),a=n.data("scroll-shadow-style");e.toggleClass("top",!s&&a.indexOf("top")>-1),e.toggleClass("bottom",!r&&a.indexOf("bottom")>-1),e.toggleClass("left",!o&&a.indexOf("left")>-1),e.toggleClass("right",!l&&a.indexOf("right")>-1),C.setBounds(e,C.bounds(n,{exact:!0}).subtract(g(e))),C.setMargins(e,C.margins(n)),e.css("border-radius",n.css("border-radius"));let d=n.data("scroll-shadow-customizer");d&&d(n,e);function c(y){return y===0}function f(y,v,D){return y+1>=v-D}function g(y){return new We(y.cssPxValue("--scroll-shadow-inset-top"),y.cssPxValue("--scroll-shadow-inset-right"),y.cssPxValue("--scroll-shadow-inset-bottom"),y.cssPxValue("--scroll-shadow-inset-left"))}},_installMutationObserver(n){if(!n||!n[0]||n.data("mutation-observer"))return;const e=new MutationObserver(P._onDomMutation);n.data("mutation-observer",e),e.observe(n[0],{subtree:!0,childList:!0})},_onDomMutation(n,e){n.forEach(P._processDomMutation)},_processDomMutation(n){for(let e=0;e<n.addedNodes.length;e++){let t=n.addedNodes[e],i=h()(t);if(i.data("scrollable")){let s=i.data("scroll-shadow");s&&s.insertAfter(i)}}},_uninstallMutationObserver(n){!n||!n.data("mutation-observer")||(n.data("mutation-observer").disconnect(),n.removeData("mutation-observer"))},_installIntersectionObserver(){P.intersectionObserver||(P.intersectionObserver=new IntersectionObserver((n,e)=>{n.forEach(t=>P._onScrollableVisibleChange(t.target,t.intersectionRatio>0))}))},_uninstallIntersectionObserver(){P.intersectionObserver&&(P.intersectionObserver.disconnect(),P.intersectionObserver=null)},_onScrollableVisibleChange(n,e){let t=h()(n),i=t.data("scroll-shadow");i&&i.setVisible(t.isVisible())},hasScrollShadow(n,e){if(!n)return!1;let t=n.data("scroll-shadow");return t?e?t.hasClass(e):!0:!1},isHybridScrolling(n){return n.hasClass("hybrid-scrollable")},isNativeScrolling(n){return u.isOneOf("auto",n.css("overflow"),n.css("overflow-x"),n.css("overflow-y"))},isJsScrolling(n){return!!n.data("scrollbars")},getScrollAxis(n){return n.data("scroll-axis")},_installJs(n,e){h().log.isTraceEnabled()&&h().log.trace("installing JS-scrollbars for container "+C.debugOutput(n));let t=p.ensure(n.data("scrollbars"));t.forEach(s=>{s.destroy()}),t=[];let i;if(e.axis==="both"){let s=h().extend({},e,{axis:"y"});i=u.create(fo,s),t.push(i),s=h().extend({},s,{axis:"x",mouseWheelNeedsShift:!0}),i=u.create(fo,s),t.push(i)}else{let s=h().extend({},e,{axis:e.axis});i=u.create(fo,s),t.push(i)}n.data("scrollbars",t),t.forEach(s=>{s.render(n),s.update()})},uninstall(n,e){if(!n.data("scrollable"))return;let t=n.data("scrollbars");t&&t.forEach(s=>{s.destroy()}),P.removeScrollable(e,n),n.removeData("scrollable"),n.removeData("scroll-axis"),n.css("overflow",""),n.removeClass("hybrid-scrollable"),n.removeData("scrollbars");let i=x.optGet(n);i&&(i.scrollable=!1),P.uninstallScrollShadow(n,e)},update(n,e){if(!n||!n.data("scrollable"))return;P.updateScrollShadow(n);let t=n.data("scrollbars");if(!t){w.get().isIos()&&P._handleIosPaintBug(n);return}if(e){P._update(t);return}n.data("scrollbarUpdatePending")||(setTimeout(()=>{P._update(t),n.removeData("scrollbarUpdatePending")},0),n.data("scrollbarUpdatePending",!0))},_update(n){n.forEach(e=>{e.rendered&&e.reset()}),n.forEach(e=>{e.rendered&&e.update()})},_handleIosPaintBug(n){if(n.data("scrollbarUpdatePending"))return;setTimeout(()=>{e(),n.removeData("scrollbarUpdatePending")}),n.data("scrollbarUpdatePending",!0);function e(){let t=C.size(n).subtract(C.insets(n,{includePadding:!1,includeBorder:!0}));n[0].scrollHeight===t.height&&n[0].scrollWidth===t.width?n.css("-webkit-overflow-scrolling",""):n.css("-webkit-overflow-scrolling","touch")}},reset(n){let e=n.data("scrollbars");e&&e.forEach(t=>t.reset())},scrollTo(n,e,t){let i;typeof t=="string"?i={align:t}:i=P._createDefaultScrollToOptions(t);let s=i.align?i.align.toLowerCase():void 0,r,o=u.nvl(i.scrollOffsetUp,s==="center"?0:4),l=u.nvl(i.scrollOffsetDown,s==="center"?0:8),a=n.height(),d=C.offsetBounds(e),c=C.offsetBounds(n),f=d.y-c.y,g=d.height,y=f-o,v=f+g+l;if(s||(s=y<0?"top":v>a?"bottom":void 0),s==="center")r=n.scrollTop()+y-Math.max(0,(a-g)/2);else if(s==="top")r=n.scrollTop()+y;else if(s==="bottom"){r=Math.ceil(n.scrollTop()+v-a);let D=y-(r-n.scrollTop());D<0&&(r=r+D)}r!==void 0&&P.scrollTop(n,r,i)},_createDefaultScrollToOptions(n){let e={animate:!1,stop:!0};return h().extend({},e,n)},scrollHorizontalTo(n,e,t){let i,s=n.width(),r=C.bounds(e,!0),o=r.x,l=r.width;o<0?P.scrollLeft(n,n.scrollLeft()+o,t):o+l>s&&(i=Math.ceil(n.scrollLeft()+o+l-s),P.scrollLeft(n,i,t))},scrollTop(n,e,t){t=P._createDefaultScrollToOptions(t);let i=P.scrollbar(n,"y");if(i&&i.notifyBeforeScroll(),t.stop&&n.stop("scroll"),!t.animate){n.scrollTop(e),i&&i.notifyAfterScroll();return}P.animateScrollTop(n,e),n.promise("scroll").always(()=>{i&&i.notifyAfterScroll()})},scrollLeft(n,e,t){t=P._createDefaultScrollToOptions(t);let i=P.scrollbar(n,"x");if(i&&i.notifyBeforeScroll(),t.stop&&n.stop("scroll"),!t.animate){n.scrollLeft(e),i&&i.notifyAfterScroll();return}P.animateScrollLeft(n,e),n.promise("scroll").always(()=>{i&&i.notifyAfterScroll()})},animateScrollTop(n,e){n.animate({scrollTop:e},{queue:"scroll"}).dequeue("scroll")},animateScrollLeft(n,e){n.animate({scrollLeft:e},{queue:"scroll"}).dequeue("scroll")},scrollbar(n,e){let t=n.data("scrollbars")||[];return p.find(t,i=>i.axis===e)},scrollToBottom(n,e){P.scrollTop(n,n[0].scrollHeight-n[0].offsetHeight,e)},isLocationInView(n,e){return!e||e.length===0?!0:e.toArray().every(t=>C.offsetBounds(h()(t)).contains(n.x,n.y))},intersectViewport(n,e){return!e||e.length===0?n:e.toArray().reduce((t,i)=>{let s=C.offsetBounds(h()(i));return t.intersect(s)},n)},onScroll(n,e){e.$scrollParents=[],n.scrollParents().each(function(){let t=h()(this);t.on("scroll",e),e.$scrollParents.push(t)})},offScroll(n){let e=n.$scrollParents;if(!e)throw new Error("$scrollParents are not defined");for(let t=0;t<e.length;t++)e[t].off("scroll",n)},fix(n){if(!n.isVisible()||n.css("position")==="fixed")return;let e=n[0].getBoundingClientRect();n.css("position","fixed").cssLeft(e.left-n.cssMarginLeft()).cssTop(e.top-n.cssMarginTop()).cssWidth(e.width).cssHeight(e.height)},unfix(n,e,t){if(clearTimeout(e),t){P._unfix(n);return}return setTimeout(()=>{P._unfix(n)},50)},_unfix(n){n.css({position:"absolute",left:"",top:"",width:"",height:""})},storeScrollPositions(n,e){let t=P.getScrollables(e);if(!t)return;let i,s;t.forEach(r=>{n.isOrHas(r[0])&&(i=r.scrollTop(),r.data("scrollTop",i),s=r.scrollLeft(),r.data("scrollLeft",r.scrollLeft()),h().log.isTraceEnabled()&&h().log.trace("Stored scroll position for "+r.attr("class")+". Top: "+i+". Left: "+s))})},restoreScrollPositions(n,e){let t=P.getScrollables(e);if(!t)return;let i,s;t.forEach(r=>{n.isOrHas(r[0])&&(i=r.data("scrollTop"),i&&(r.scrollTop(i),r.removeData("scrollTop")),s=r.data("scrollLeft"),s&&(r.scrollLeft(s),r.removeData("scrollLeft")),P.update(r),h().log.isTraceEnabled()&&h().log.trace("Restored scroll position for "+r.attr("class")+". Top: "+i+". Left: "+s))})},setVisible(n,e){if(!n||!n.data("scrollable"))return;let t=n.data("scrollbars");t&&t.forEach(i=>{i.rendered&&i.$container.setVisible(e)})},opacity(n,e){if(!n||!n.data("scrollable"))return;let t=n.data("scrollbars");t&&t.forEach(i=>{i.rendered&&i.$container.css("opacity",e)})},_getCompleteChildRowsHeightRecursive(n,e,t,i){let s=0;return n.forEach(r=>{r.height?s+=r.height:s+=i,t(r)&&e(r).length>0&&(s+=P._getCompleteChildRowsHeightRecursive(e(r),e,t,i))}),s},ensureExpansionVisible(n){let e=n.isExpanded(n.element),t=n.getChildren(n.element),i=n.$element.position().top,s=n.element.height,r=n.$scrollable.scrollTop(),o=P.getScrollAxis(n.$scrollable),l=u.isOneOf(o,"y","both"),a=u.isOneOf(o,"x","both");if(l){if(e){let d=n.$scrollable.height(),c=0;t.length>0&&(c=P._getCompleteChildRowsHeightRecursive(t,n.getChildren,n.isExpanded,n.defaultChildHeight));let f=c+1.5*s,g=i+f,y=r+Math.min(g-d,i-s);y>r&&P.scrollTop(n.$scrollable,y,{animate:!0,stop:!1})}else if(i<s){let d=Math.max(r-(s-i),0);P.scrollTop(n.$scrollable,d,{animate:!0})}}if(a){let d=Math.max(n.element.level-3,0)*n.nodePaddingLevel;P.scrollLeft(n.$scrollable,d,{animate:!0,stop:!1})}}};class kh{enabled;minRowHeight;viewRangeSize;widget;$scrollable;constructor(e){this.enabled=!0,this.minRowHeight=0,this.viewRangeSize=0,this.widget=null,this.$scrollable=null,h().extend(this,e)}setEnabled(e){this.enabled=e}set$Scrollable(e){this.$scrollable!==e&&(this.$scrollable=e)}setMinRowHeight(e){if(this.minRowHeight!==e){if(!Se.isNumber(e))throw new Error("minRowHeight is not a number: "+e);this.minRowHeight=e,this.widget.rendered&&this.setViewRangeSize(this.calculateViewRangeSize())}}setViewRangeSize(e,t){this.viewRangeSize!==e&&(this.viewRangeSize=e,this.widget.rendered&&u.nvl(t,!0)&&this.renderViewPort())}calculateViewRangeSize(){if(!this.enabled||this.$scrollable.length===0)return this.rowCount();if(this.minRowHeight===0)throw new Error("Cannot calculate view range with rowHeight = 0");return Math.ceil(this.$scrollable.height()/this.minRowHeight)*2}calculateCurrentViewRange(){if(!this.enabled)return this.maxViewRange();if(this.viewRangeSize===0)return new U(0,0);let e;if(this.$scrollable.length===0)return this.maxViewRange();let t=this.$scrollable[0].scrollTop,i=this.$scrollable[0].scrollHeight-this.$scrollable[0].clientHeight,s=this.widget.$container[0].getBoundingClientRect(),r=this.$scrollable[0].getBoundingClientRect();return s.height>0&&(s.bottom<r.top||s.top>r.bottom)?new U(0,0):(i===0?e=0:e=this._rowIndexAtScrollTop(t),this.calculateViewRangeForRowIndex(e))}maxViewRange(){return new U(0,this.rowCount())}calculateViewRangeForRowIndex(e){if(!this.enabled)return this.maxViewRange();let t=new U,i=Math.floor(this.viewRangeSize/4),s;return t.from=Math.max(e-i,0),t.to=Math.min(t.from+this.viewRangeSize,this.rowCount()),s=this.viewRangeSize-t.size(),s>0&&(t.from=Math.max(t.to-this.viewRangeSize,0)),t}_rowIndexAtScrollTop(e){let t=0,i=this.rowCount(),s=i-1;this.widget.$container[0]!==this.$scrollable[0]&&(t=e+(this.widget.$container.offset().top-this.$scrollable.offset().top));for(let r=0;r<i;r++)if(t+=this.rowHeight(r),e<t){s=r;break}return s}rowHeight(e){throw new Error("Function has to be provided by widget")}rowCount(){throw new Error("Function has to be provided by widget")}renderViewPort(){let e=this.calculateCurrentViewRange();this._renderViewRange(e)}renderViewRangeForRowIndex(e){let t=this.calculateViewRangeForRowIndex(e);this._renderViewRange(t)}_renderViewRange(e){throw new Error("Function has to be provided by widget")}}class hs extends I{splitHorizontal;position;orientation;layoutData;$anchor;$root;_cursorOffset;_mouseDownHandler;_$window;_$body;constructor(){super(),this.splitHorizontal=!0,this.$anchor=null,this.$root=null,this.position=null,this.orientation="top",this.layoutData=null,this._cursorOffset=null,this._mouseDownHandler=this._onMouseDown.bind(this),this._$window=null,this._$body=null}_init(e){super._init(e),this.setPosition(this.position)}_render(){this.$container=this.$parent.appendDiv("splitter").addClass(this.splitHorizontal?"x-axis":"y-axis"),this.htmlComp=x.install(this.$container,this.session),this._$window=this.$parent.window(),this._$body=this.$parent.body()}_renderProperties(){super._renderProperties(),this._renderPosition()}_renderEnabled(){super._renderEnabled(),this.enabledComputed?this.$container.on("mousedown",this._mouseDownHandler):this.$container.off("mousedown",this._mouseDownHandler)}_renderVisible(){super._renderVisible(),this.initialized&&this._renderPosition()}setLayoutData(e){super.setLayoutData(e),this.layoutData=e}getLayoutData(){return this.layoutData}setPosition(e){return Se.isNumber(e)||(e=this._derivePositionFromAnchor()),e!==this.position&&this._setPosition(e),e}_derivePositionFromAnchor(){if(!this.$anchor)return null;let e=C.offsetBounds(this.$anchor,{exact:!0});return this.splitHorizontal?e.x+e.width:e.y+e.height}_setPosition(e){Se.isNumber(e)&&e!==this.position&&(this.position=e,this.trigger("positionChange",{position:e}),this.rendered&&this._renderPosition())}_renderPosition(){if(this.position===null||!this.visible)return;let e=C.size(this.$container,!0);if(this.splitHorizontal){let t=this.position-e.width/2;this.orientation==="right"?this.$container.cssRight(t):this.$container.cssLeft(t)}else{let t=this.position-e.height/2;this.orientation==="bottom"?this.$container.cssBottom(t):this.$container.cssTop(t)}}_onMouseDown(e){let t=C.margins(this.$container),i=C.offsetBounds(this.$container);i.x-=t.left,i.y-=t.top,i.width+=t.horizontal(),i.height+=t.vertical();let s=i.center();this._$window.on("mousemove.splitter",this._onMouseMove.bind(this)).one("mouseup",this._onMouseUp.bind(this)),this._$body.addClass(this.splitHorizontal?"col-resize":"row-resize"),h()("iframe").addClass("dragging-in-progress"),this._cursorOffset={left:s.x-e.pageX,top:s.y-e.pageY},this.trigger("moveStart",{position:this._getSplitterPosition(e)}),e.preventDefault()}_getSplitterPosition(e){let t=C.offsetBounds(this.$root||this.$parent);if(this.splitHorizontal){let s=e.pageX+this._cursorOffset.left-t.x;return this.orientation==="right"?t.width-s:s}let i=e.pageY+this._cursorOffset.top-t.y;return this.orientation==="bottom"?t.height-i:i}_onMouseMove(e){let t=this._getSplitterPosition(e),i=this.trigger("move",{position:t});i.defaultPrevented||this._setPosition(i.position)}_onMouseUp(e){this._$window.off("mousemove.splitter"),this._$body.removeClass(this.splitHorizontal?"col-resize":"row-resize"),h()("iframe").removeClass("dragging-in-progress"),this.trigger("moveEnd",{position:this.position})}}const Ue={YEAR:"year",MONTH:"month",WEEK_IN_YEAR:"week_in_year",DAY_IN_MONTH:"day_in_month",WEEKDAY:"weekday",HOUR_24:"hour_24",HOUR_12:"hour_12",AM_PM:"am_pm",MINUTE:"minute",SECOND:"second",MILLISECOND:"millisecond",TIMEZONE:"timezone"};class Ge{type;terms;dateFormat;formatFunction;parseRegExp;applyMatchFunction;parseFunction;constructor(e){e=e||{},this.type=e.type,this.terms=e.terms,this.dateFormat=e.dateFormat,this.formatFunction=e.formatFunction&&e.formatFunction.bind(this),this.parseRegExp=e.parseRegExp,this.applyMatchFunction=e.applyMatchFunction&&e.applyMatchFunction.bind(this),this.parseFunction=e.parseFunction&&e.parseFunction.bind(this)}createFormatFunction(e){return(function(t){if(this.formatFunction){let i=this.formatFunction(t,e);i!==void 0&&(t.formattedString+=i)}}).bind(this)}createParseFunction(e){return(function(t){let i,s,r,o=!1;return this.parseRegExp&&(i=this.parseRegExp.exec(t.inputString),i&&(this.applyMatchFunction&&this.applyMatchFunction(t,i[1],e),r=i[1],t.inputString=i[2],o=!0)),!o&&this.parseFunction&&(r=this.parseFunction(t,e),r!==null&&(o=!0)),o&&(s=this.terms[0],this.terms.length>1&&this.terms.some(l=>l.length===r.length?(s=l,!0):!1),t.parsedPattern+=s),o}).bind(this)}accept(e){if(e){for(let t=0;t<this.terms.length;t++)if(e===this.terms[t])return this.terms[t]}return null}}class St{locale;pattern;symbols;lenient;_terms;_formatFunctions;_parseFunctions;_analyzeFunctions;_patternDefinitions;_patternLibrary;constructor(e,t,i){i=i||{},this.locale=e,u.assertParameter("locale",this.locale),this.pattern=t||e.dateFormatPatternDefault,u.assertParameter("pattern",this.pattern),this.symbols=e.dateFormatSymbols,this.symbols.firstDayOfWeek=1,this.symbols.weekdaysOrdered=S.orderWeekdays(this.symbols.weekdays,this.symbols.firstDayOfWeek),this.symbols.weekdaysShortOrdered=S.orderWeekdays(this.symbols.weekdaysShort,this.symbols.firstDayOfWeek),this.lenient=u.nvl(i.lenient,!0),this._terms=[],this._formatFunctions=[],this._parseFunctions=[],this._analyzeFunctions=[],this._patternDefinitions=[new Ge({type:Ue.YEAR,terms:["yyyy"],dateFormat:this,formatFunction:(s,r)=>{let o=s.inputDate.getFullYear(),l=Math.max(4,o.toString().length);return _.padZeroLeft(o,l).slice(-l)},parseRegExp:/^(\d{4})(.*)$/,applyMatchFunction:(s,r,o)=>{s.matchInfo.year=r,s.dateInfo.year=Number(r)}}),new Ge({type:Ue.YEAR,terms:["yyy","yy","y"],dateFormat:this,formatFunction:(s,r)=>{let o=s.inputDate.getFullYear();if(s.analyzeInfo?.matchInfo?.year){let l=s.analyzeInfo.matchInfo.year.length;return _.padZeroLeft(o,l).slice(-l)}if(r.length===2){let l=r.length;return _.padZeroLeft(o,l).slice(-l)}return _.padZeroLeft(o,r.length)},parseRegExp:/^(\d{1,4})(.*)$/,applyMatchFunction:(s,r,o)=>{if(r.length>2){s.dateInfo.year=Number(r),s.matchInfo.year=r;return}let l=(s.startDate||new Date).getFullYear(),a=Number(_.padZeroLeft(l,4).substring(0,2)+_.padZeroLeft(r,2)),d=a-l;d<=-80?a+=100:d>20&&(a-=100),s.dateInfo.year=a,s.matchInfo.year=r}}),new Ge({type:Ue.MONTH,terms:["MMMM"],dateFormat:this,formatFunction:function(s,r){return this.dateFormat.symbols.months[s.inputDate.getMonth()]},parseFunction:function(s,r){for(let o=0;o<this.dateFormat.symbols.months.length;o++){let l=this.dateFormat.symbols.months[o];if(!l)continue;let d=new RegExp("^("+_.quote(l)+")(.*)$","i").exec(s.inputString);if(d)return s.dateInfo.month=o,s.matchInfo.month=d[1],s.inputString=d[2],d[1]}if(s.analyze)for(let o=0;o<this.dateFormat.symbols.months.length;o++){let l=this.dateFormat.symbols.months[o],d=new RegExp("^("+_.quote(s.inputString)+")(.*)$","i").exec(l);if(d)return s.dateInfo.month=o,s.matchInfo.month=l,s.inputString="",d[1]}return null}}),new Ge({type:Ue.MONTH,terms:["MMM"],dateFormat:this,formatFunction:function(s,r){return this.dateFormat.symbols.monthsShort[s.inputDate.getMonth()]},parseFunction:function(s,r){for(let o=0;o<this.dateFormat.symbols.monthsShort.length;o++){let l=this.dateFormat.symbols.monthsShort[o];if(!l)continue;let d=new RegExp("^("+_.quote(l)+")(.*)$","i").exec(s.inputString);if(d)return s.dateInfo.month=o,s.matchInfo.month=d[1],s.inputString=d[2],d[1]}if(s.analyze)for(let o=0;o<this.dateFormat.symbols.monthsShort.length;o++){let l=this.dateFormat.symbols.monthsShort[o],d=new RegExp("^("+_.quote(s.inputString)+")(.*)$","i").exec(l);if(d)return s.dateInfo.month=o,s.matchInfo.month=l,s.inputString="",d[1]}return null}}),new Ge({type:Ue.MONTH,terms:["MM"],dateFormat:this,formatFunction:(s,r)=>_.padZeroLeft(s.inputDate.getMonth()+1,2),parseRegExp:/^(\d{2})(.*)$/,applyMatchFunction:(s,r,o)=>{let l=Number(r);s.dateInfo.month=l-1,s.matchInfo.month=r},parseFunction:function(s,r){if(s.analyze&&s.inputString==="0"){let o=this.dateFormat._dateInfoToDate(s.dateInfo);if(!o)return null;let l=o.getMonth();return l>=9&&(l=0,s.dateInfo.year===void 0?s.dateInfo.year=Number(o.getFullYear())+1:s.dateInfo.year=s.dateInfo.year+1),s.dateInfo.month=l,s.matchInfo.month=_.padZeroLeft(String(l+1),2),s.inputString="","0"}return null}}),new Ge({type:Ue.MONTH,terms:["M"],dateFormat:this,formatFunction:(s,r)=>String(s.inputDate.getMonth()+1),parseRegExp:/^(\d{1,2})(.*)$/,applyMatchFunction:(s,r,o)=>{let l=Number(r);s.dateInfo.month=l-1,s.matchInfo.month=r}}),new Ge({type:Ue.WEEK_IN_YEAR,terms:["ww"],dateFormat:this,formatFunction:(s,r)=>_.padZeroLeft(S.weekInYear(s.inputDate),2),parseRegExp:/^(\d{2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.matchInfo.week=r,s.hints.weekInYear=Number(r)}}),new Ge({type:Ue.WEEK_IN_YEAR,terms:["w"],dateFormat:this,formatFunction:(s,r)=>String(S.weekInYear(s.inputDate)),parseRegExp:/^(\d{1,2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.matchInfo.week=r,s.hints.weekInYear=Number(r)}}),new Ge({type:Ue.DAY_IN_MONTH,terms:["dd"],dateFormat:this,formatFunction:(s,r)=>_.padZeroLeft(s.inputDate.getDate(),2),parseRegExp:/^(\d{2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.day=Number(r),s.matchInfo.day=r},parseFunction:(s,r)=>s.analyze&&s.inputString==="0"?(s.dateInfo.day=1,s.matchInfo.day="01",s.inputString="","0"):null}),new Ge({type:Ue.DAY_IN_MONTH,terms:["d"],dateFormat:this,formatFunction:(s,r)=>String(s.inputDate.getDate()),parseRegExp:/^(\d{1,2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.day=Number(r),s.matchInfo.day=r}}),new Ge({type:Ue.WEEKDAY,terms:["EEEE"],dateFormat:this,formatFunction:function(s,r){return this.dateFormat.symbols.weekdays[s.inputDate.getDay()]},parseFunction:function(s,r){for(let o=0;o<this.dateFormat.symbols.weekdays.length;o++){let l=this.dateFormat.symbols.weekdays[o];if(!l)continue;let d=new RegExp("^("+_.quote(l)+")(.*)$","i").exec(s.inputString);if(d)return s.matchInfo.weekday=Number(d[1]),s.hints.weekday=o,s.inputString=d[2],d[1]}if(s.analyze)for(let o=0;o<this.dateFormat.symbols.weekdays.length;o++){let l=this.dateFormat.symbols.weekdays[o],d=new RegExp("^("+_.quote(s.inputString)+")(.*)$","i").exec(l);if(d)return s.matchInfo.weekday=l,s.hints.weekday=o,s.inputString="",d[1]}return null}}),new Ge({type:Ue.WEEKDAY,terms:["EEE","EE","E"],dateFormat:this,formatFunction:function(s,r){return this.dateFormat.symbols.weekdaysShort[s.inputDate.getDay()]},parseFunction:function(s,r){for(let o=0;o<this.dateFormat.symbols.weekdaysShort.length;o++){let l=this.dateFormat.symbols.weekdaysShort[o];if(!l)continue;let d=new RegExp("^("+_.quote(l)+")(.*)$","i").exec(s.inputString);if(d)return s.matchInfo.weekday=Number(d[1]),s.hints.weekday=o,s.inputString=d[2],d[1]}if(s.analyze)for(let o=0;o<this.dateFormat.symbols.weekdaysShort.length;o++){let l=this.dateFormat.symbols.weekdaysShort[o],d=new RegExp("^("+_.quote(s.inputString)+")(.*)$","i").exec(l);if(d)return s.matchInfo.weekday=l,s.hints.weekday=o,s.inputString="",d[1]}return null}}),new Ge({type:Ue.HOUR_24,terms:["HH"],dateFormat:this,formatFunction:(s,r)=>_.padZeroLeft(s.inputDate.getHours(),2),parseRegExp:/^(\d{2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.hours=Number(r),s.matchInfo.hours=r}}),new Ge({type:Ue.HOUR_24,terms:["H"],dateFormat:this,formatFunction:(s,r)=>String(s.inputDate.getHours()),parseRegExp:/^(\d{1,2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.hours=Number(r),s.matchInfo.hours=r}}),new Ge({type:Ue.HOUR_12,terms:["hh"],dateFormat:this,formatFunction:(s,r)=>s.inputDate.getHours()%12===0?"12":_.padZeroLeft(s.inputDate.getHours()%12,2),parseRegExp:/^(10|11|12|0[1-9])(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.hours=Number(r)+(s.hints.pm?12:0),s.matchInfo.hours=r},parseFunction:(s,r)=>s.analyze&&s.inputString==="0"?(s.dateInfo.hours=1,s.matchInfo.hours="01",s.inputString="",s.inputString):null}),new Ge({type:Ue.HOUR_12,terms:["h"],dateFormat:this,formatFunction:(s,r)=>s.inputDate.getHours()%12===0?"12":String(s.inputDate.getHours()%12),parseRegExp:/^(10|11|12|0?[1-9])(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.hours=Number(r)+(s.hints.pm?12:0),s.matchInfo.hours=r}}),new Ge({type:Ue.AM_PM,terms:["a"],dateFormat:this,formatFunction:function(s,r){return s.inputDate.getHours()<12?this.dateFormat.symbols.am:this.dateFormat.symbols.pm},parseFunction:function(s,r){let o=new RegExp("^("+_.quote(this.dateFormat.symbols.am)+")(.*)$","i"),l=o.exec(s.inputString);if(s.matchInfo.ampm=null,l)return s.matchInfo.ampm=l[1],s.inputString=l[2],s.hints.am=!0,s.dateInfo.hours=s.dateInfo.hours%12,l[1];if(o=new RegExp("^("+_.quote(this.dateFormat.symbols.pm)+")(.*)$","i"),l=o.exec(s.inputString),l)return s.matchInfo.ampm=l[1],s.inputString=l[2],s.hints.pm=!0,s.dateInfo.hours=s.dateInfo.hours%12+12,l[1];if(s.analyze){if(o=new RegExp("^("+_.quote(s.inputString)+")(.*)$","i"),l=o.exec(this.dateFormat.symbols.am),l)return s.matchInfo.ampm=this.dateFormat.symbols.am,s.inputString="",s.hints.am=!0,s.dateInfo.hours=s.dateInfo.hours%12,l[1];if(l=o.exec(this.dateFormat.symbols.pm),l)return s.matchInfo.ampm=this.dateFormat.symbols.pm,s.inputString="",s.hints.pm=!0,s.dateInfo.hours=s.dateInfo.hours%12+12,l[1]}return null}}),new Ge({type:Ue.MINUTE,terms:["mm"],dateFormat:this,formatFunction:(s,r)=>_.padZeroLeft(s.inputDate.getMinutes(),2),parseRegExp:/^(\d{2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.minutes=Number(r),s.matchInfo.minutes=r},parseFunction:(s,r)=>{if(s.analyze&&u.isOneOf(s.inputString,"0","1","2","3","4","5")){let o=s.inputString+"0";return s.dateInfo.minutes=Number(o),s.matchInfo.minutes=o,s.inputString="",s.inputString}return null}}),new Ge({type:Ue.MINUTE,terms:["m"],dateFormat:this,formatFunction:(s,r)=>String(s.inputDate.getMinutes()),parseRegExp:/^(\d{1,2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.minutes=Number(r),s.matchInfo.minutes=r}}),new Ge({type:Ue.SECOND,terms:["ss"],dateFormat:this,formatFunction:(s,r)=>_.padZeroLeft(s.inputDate.getSeconds(),2),parseRegExp:/^(\d{2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.seconds=Number(r),s.matchInfo.seconds=r}}),new Ge({type:Ue.SECOND,terms:["s"],dateFormat:this,formatFunction:(s,r)=>String(s.inputDate.getSeconds()),parseRegExp:/^(\d{1,2})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.seconds=Number(r),s.matchInfo.seconds=r}}),new Ge({type:Ue.MILLISECOND,terms:["SSS"],dateFormat:this,formatFunction:(s,r)=>_.padZeroLeft(s.inputDate.getMilliseconds(),3),parseRegExp:/^(\d{3})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.milliseconds=Number(r),s.matchInfo.milliseconds=r}}),new Ge({type:Ue.MILLISECOND,terms:["S"],dateFormat:this,formatFunction:(s,r)=>String(s.inputDate.getMilliseconds()),parseRegExp:/^(\d{1,3})(.*)$/,applyMatchFunction:(s,r,o)=>{s.dateInfo.milliseconds=Number(r),s.matchInfo.milliseconds=r}}),new Ge({type:Ue.TIMEZONE,terms:["Z"],dateFormat:this,formatFunction:(s,r)=>{let o=Math.abs(s.inputDate.getTimezoneOffset());return(o!==s.inputDate.getTimezoneOffset()?"-":"+")+_.padZeroLeft(Math.floor(o/60),2)+_.padZeroLeft(o%60,2)},parseRegExp:/^([+|-]\d{4})(.*)$/,applyMatchFunction:(s,r,o)=>{let l=Number(r.substring(1,3))*60+Number(r.substring(3,5));r.charAt(0)==="-"&&(l*=-1),s.dateInfo.timezone=l,s.matchInfo.timezone=r}})],this._patternLibrary={};for(let s=0;s<this._patternDefinitions.length;s++){let r=this._patternDefinitions[s],o=r.type;o&&(this._patternLibrary[o]||(this._patternLibrary[o]=[]),this._patternLibrary[o].push(r))}this._compile()}_compile(){let e=/(.)\1*/g,t;for(;t=e.exec(this.pattern);){let i=t[0];this._terms.push(i);let s=!1;for(let r=0;r<this._patternDefinitions.length;r++){let o=this._patternDefinitions[r],l=o.accept(i);if(l){this._formatFunctions.push(o.createFormatFunction(l)),this._parseFunctions.push(o.createParseFunction(l));let a=[o.createParseFunction(l)];if(this.lenient){let d=this._patternLibrary[o.type];for(let c=0;c<d.length;c++)d[c]!==o&&a.push(d[c].createParseFunction(l))}this._analyzeFunctions.push(a),s=!0;break}}if(!s){this._formatFunctions.push(this._createConstantStringFormatFunction(i));let r=this._createConstantStringParseFunction(i);this._parseFunctions.push(r),this._analyzeFunctions.push([r])}}}_createConstantStringFormatFunction(e){return t=>{t.formattedString+=e}}_createConstantStringParseFunction(e){return t=>_.startsWith(t.inputString,e)?(t.inputString=t.inputString.substring(e.length),t.parsedPattern+=e,!0):t.analyze}format(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e)return"";let i=this._createFormatContext(e,t.analyzeInfo);for(let s=0;s<this._formatFunctions.length;s++){let r=this._formatFunctions[s];r(i)}return i.formattedString}analyze(e,t){let i=this._createAnalyzeInfo(e);if(!e)return i;let s=this._createParseContext(e);s.analyze=!0,s.startDate=t;let r="";for(let d=0;d<this._terms.length;d++)if(s.inputString.length>0){let c=this._analyzeFunctions[d],f=!1;for(let g=0;g<c.length;g++){let y=c[g];if(y(s)){f=!0;break}}if(!f)return i.error=!0,i;r=s.parsedPattern}else s.parsedPattern+=this._terms[d];if(s.inputString.length>0)return i.error=!0,i;t=this._prepareStartDate(t);let o=s.hints.weekday,l=s.dateInfo.day;o!==void 0&&(l!==void 0&&l<=31?t=S.shiftToNextDayAndDate(t,o,l):t=S.shiftToNextDayOfType(t,o));let a=this._dateInfoToDate(s.dateInfo,t,s.hints);return i.dateInfo=s.dateInfo,i.matchInfo=s.matchInfo,i.hints=s.hints,i.parsedPattern=s.parsedPattern,i.matchedPattern=r,i.predictedDate=a,i.error=!a,i}parse(e,t){if(!e)return null;let i=this._createParseContext(e);i.startDate=t;for(let r=0;r<this._parseFunctions.length;r++){let o=this._parseFunctions[r];if(!o(i))return null;if(i.inputString.length===0)break}if(i.inputString.length>0)return null;let s=this._dateInfoToDate(i.dateInfo,t);return!s||i.hints.weekday!==void 0&&s.getDay()!==i.hints.weekday?null:s}_dateInfoToDate(e,t,i){if(!e)return null;t=this._prepareStartDate(t);let s=new Date(1970,0,1),r=u.nvl(e.day,t.getDate()),o=u.nvl(e.month,t.getMonth()),l=u.nvl(e.year,t.getFullYear());if(e.day&&!Se.isNumber(e.month))if(e.day===31){let d=[0,2,4,6,7,9,11];u.isOneOf(o,d)||(o=o+1)}else e.day>=29&&o===1&&(e.day>29||!S.isLeapYear(l))&&(o=o+1);if(!e.day&&(Se.isNumber(e.month)||e.year)){let d=S.shift(new Date(l,o+1,1),0,0,-1);r=Math.min(d.getDate(),t.getDate())}if(s.setFullYear(l,o,r),s.setHours(u.nvl(e.hours,t.getHours()),u.nvl(e.minutes,t.getMinutes()),u.nvl(e.seconds,t.getSeconds()),u.nvl(e.milliseconds,t.getMilliseconds())),!a(s.getFullYear(),e.year)||!a(s.getMonth(),e.month)||!a(s.getDate(),e.day)||!a(s.getHours(),e.hours)||!a(s.getMinutes(),e.minutes)||!a(s.getSeconds(),e.seconds)||!a(s.getMilliseconds(),e.milliseconds)||!a(s.getDay(),i?.weekday))return null;return Se.isNumber(e.timezone)&&s.setMinutes(s.getMinutes()-s.getTimezoneOffset()+e.timezone),s;function a(d,c){return b.isNullOrUndefined(c)||c===d}}_prepareStartDate(e){return e?new Date(e.getTime()):S.trunc(new Date)}_createFormatContext(e,t){return{inputDate:e,analyzeInfo:t,formattedString:""}}_createParseContext(e){return{inputString:e,dateInfo:{},matchInfo:{},hints:{},parsedPattern:"",analyze:!1,startDate:null}}_createAnalyzeInfo(e){return{inputString:e,dateInfo:{},matchInfo:{},hints:{},parsedPattern:"",matchedPattern:"",predictedDate:null,error:!1}}static ensure(e,t){return!t||t instanceof St?t:new St(e,t)}}class Ps{positivePrefix;positiveSuffix;negativePrefix;negativeSuffix;groupingChar;lenientGroupingChars;groupLength;decimalSeparatorChar;zeroBefore;zeroAfter;allAfter;pattern;multiplier;roundingMode;constructor(e,t){this.positivePrefix="",this.positiveSuffix="",this.negativePrefix=e.decimalFormatSymbols.minusSign,this.negativeSuffix="",this.groupingChar=e.decimalFormatSymbols.groupingSeparator,this.lenientGroupingChars="'´`’· ",this.groupLength=0,this.decimalSeparatorChar=e.decimalFormatSymbols.decimalSeparator,this.zeroBefore=1,this.zeroAfter=0,this.allAfter=0,typeof t=="string"?(this.pattern=t,this.multiplier=1,this.roundingMode=hi.HALF_UP):(t=t||{pattern:null},this.pattern=this.pattern||t.pattern||e.decimalFormatPatternDefault,this.multiplier=t.multiplier||1,this.roundingMode=t.roundingMode||hi.HALF_UP);let i=Ps.PATTERN_SYMBOLS,s=this.pattern.split(i.patternSeparator),r=a(s[0]);if(this.positivePrefix=r.prefix,this.positiveSuffix=r.suffix,s.length>1){let d=a(s[1]);this.negativePrefix=d.prefix,this.negativeSuffix=d.suffix,this.pattern=s[0]}else this.positivePrefix.indexOf(i.minusSign)!==-1||this.positiveSuffix.indexOf(i.minusSign)!==-1?(this.negativePrefix=this.positivePrefix.replace(i.minusSign,e.decimalFormatSymbols.minusSign),this.negativeSuffix=this.positiveSuffix.replace(i.minusSign,e.decimalFormatSymbols.minusSign),this.positivePrefix=this.positivePrefix.replace(i.minusSign,""),this.positiveSuffix=this.positiveSuffix.replace(i.minusSign,"")):(this.negativePrefix=this.positivePrefix+this.negativePrefix,this.negativeSuffix=this.negativeSuffix+this.positiveSuffix);let o=this.pattern.indexOf(i.decimalSeparator);o===-1&&(o=this.pattern.length);let l=this.pattern.lastIndexOf(i.groupingSeparator,o);l>0&&(this.groupLength=o-l-1),this.pattern=this.pattern.replace(new RegExp("["+i.groupingSeparator+"]","g"),""),s=this.pattern.split(i.decimalSeparator),this.zeroBefore=_.count(s[0],i.zeroDigit),s.length>1&&(this.zeroAfter=_.count(s[1],i.zeroDigit),this.allAfter=this.zeroAfter+_.count(s[1],i.digit));function a(d){let c={prefix:"",suffix:""},f=i.digit+i.zeroDigit+i.decimalSeparator+i.groupingSeparator,g=new RegExp("^(.*?)["+f+"].*$"),y=g.exec(d);return y!==null&&(c.prefix=y[1].replace(new RegExp("'([^']+)'","g"),"$1")),g=new RegExp("^.*["+f+"](.*?)$"),y=g.exec(d),y!==null&&(c.suffix=y[1].replace(new RegExp("'([^']+)'","g"),"$1")),c}}parse(e,t){if(_.empty(e))return null;let i=this.normalize(e);t=t||Number;let s=t(i);if(isNaN(s))throw new Error(e+" is not a number (NaN)");return this.multiplier!==1&&(s/=this.multiplier),s}format(e,t){if(e==null)return null;let i=this.positivePrefix,s=this.positiveSuffix;t=u.nvl(t,!0),t&&this.multiplier!==1&&(e*=this.multiplier),e=this.round(e);let r="";if(this.allAfter){r=e.toFixed(this.allAfter).split(".")[1];for(let a=r.length-1;a>this.zeroAfter-1&&r[a]==="0";a--)r=r.slice(0,-1);r&&(r=this.decimalSeparatorChar+r)}e<0&&(i=this.negativePrefix,s=this.negativeSuffix,e=-e);let o=Math.floor(e),l=o===0?"":String(o);if(l=_.padZeroLeft(l,this.zeroBefore),this.groupLength)for(let a=l.length-this.groupLength;a>0;a-=this.groupLength)l=l.substr(0,a)+this.groupingChar+l.substr(a);return i+l+r+s}round(e,t){return t=u.nvl(t,!0),e==null?null:(t&&this.multiplier!==1&&(e*=this.multiplier),e=Se.round(e,this.roundingMode,this.allAfter),t&&this.multiplier!==1&&(e/=this.multiplier),e)}normalize(e){if(!e)return e;let t=e.replace(new RegExp("["+this.groupingChar+this.lenientGroupingChars+"]","g"),"").replace(new RegExp("["+this.decimalSeparatorChar+"]","g"),".");return _.hasText(this.positivePrefix)&&(t=t.replace(new RegExp(this.positivePrefix,"g"),"+")),_.hasText(this.positiveSuffix)&&(t=t.replace(new RegExp(this.positiveSuffix,"g"),"")),_.hasText(this.negativePrefix)&&(t=t.replace(new RegExp(this.negativePrefix,"g"),"-")),_.hasText(this.negativeSuffix)&&(t=t.replace(new RegExp(this.negativeSuffix,"g"),"")),t.replace(/\s/g,"")}static PATTERN_SYMBOLS={digit:"#",zeroDigit:"0",decimalSeparator:".",groupingSeparator:",",minusSign:"-",patternSeparator:";"};static ensure(e,t){return!t||t instanceof Ps?t:new Ps(e,t)}}class Ds{map;parent;constructor(e){this.map=e||{}}get(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];if(!this._exists(e))return this.parent?this.parent.get(e,...i):"[undefined text: "+e+"]";let r=i.length,o=this.map[e];if(r===0)return o;for(let l=0;l<r;l++)o=o.replace(new RegExp("\\{"+l+"\\}","g"),i[l]);return o}optGet(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return this._exists(e)?this.get(e,...s):this.parent?this.parent.optGet(e,t,...s):t}exists(e){return this._exists(e)?!0:this.parent?this.parent.exists(e):!1}_exists(e){return this.map.hasOwnProperty(e)}add(e,t){this.map[e]=t}addAll(e){e&&(e instanceof Ds&&(e=e.map),b.copyOwnProperties(e,this.map))}setParent(e){this.parent=e}remove(e){delete this.map[e]}}const de={defaultLanguage:"en",TEXT_KEY_REGEX:/^\${textKey:([^}]+)}$/,textsByLocale:{},bootstrap(n){if(!n)return h().resolvedPromise({});let e=[];return p.ensure(n).forEach(i=>e.push(h().ajaxJson(i).then(de._handleBootstrapResponse.bind(this,i)))),h().promiseAll(e)},_setTextsByLocale(n){de.textsByLocale=n},_handleBootstrapResponse(n,e){G.handleJsonError(n,e),de.init(e)},init(n){Object.keys(n).forEach(e=>{let t=n[e];de.get(e).addAll(t)})},link(n){let e=de.createOrderedLanguageTags(n),t;e.forEach(i=>{let s=de._get(i);s||(s=new Ds,de._put(i,s)),t&&t.setParent(s),t=s})},createOrderedLanguageTags(n){let e=[n],t=n.lastIndexOf("-");for(;t>=0;)n=n.substring(0,t),e.push(n),t=n.lastIndexOf("-");return n!=="default"&&e.push("default"),e},get(n){let e=de._get(n);if(e)return e;if(de.link(n),e=de._get(n),!e)throw new Error("Texts missing for the language tag "+n);return e},_get(n){return de.textsByLocale[n]},_put(n,e){de.textsByLocale[n]=e},readFromDOM(){let n={};return h()("scout-text").each(function(){let e=h()(this).data("key"),t=h()(this).data("value");n[e]=t}),n},buildKey(n){return"${textKey:"+n+"}"},resolveKey(n){let e=de.TEXT_KEY_REGEX.exec(n);return e?e[1]:n},resolveText(n,e){let t=de.resolveKey(n);return t!==n?de.get(e).get(t):n},resolveTextProperty(n,e,t){e=e||"text",t=n.session||t;let i=n[e],s=de.resolveText(i,t.locale.languageTag);s!==i&&(n[e]=s)},resolveTextProperties(n,e,t){p.ensure(e).forEach(i=>{de.resolveTextProperty(n,i,t)})},registerTexts(n,e){de.get("default").remove(n);for(let t in e){let i=e[t];t&&t===de.defaultLanguage&&(t="default"),de.get(t).add(n,i)}}};class Xi extends I{text;severity;arrowPosition;arrowPositionUnit;clipOrigin;windowPaddingX;windowPaddingY;origin;originRelativeToParent;originProducer;offsetProducer;autoRemove;tooltipPosition;tooltipDirection;scrollType;htmlEnabled;menus;$anchor;$arrow;$content;$menus;_popup;_openLater;_mouseDownHandler;_keydownHandler;_anchorScrollHandler;_moveHandler;constructor(){super(),this.text=null,this.severity=E.Severity.INFO,this.arrowPosition=16,this.arrowPositionUnit="px",this.clipOrigin=!1,this.windowPaddingX=10,this.windowPaddingY=5,this.origin=null,this.originRelativeToParent=!1,this.originProducer=null,this.offsetProducer=null,this.autoRemove=!0,this.tooltipPosition="top",this.tooltipDirection="right",this.scrollType="position",this.htmlEnabled=!1,this.menus=[],this.$anchor=null,this.$arrow=null,this.$content=null,this._addWidgetProperties(["menus"]),this._popup=null,this._openLater=!1}_init(e){super._init(e),this.resolveTextKeys(["text"])}render(e){let t=e||this.entryPoint();if(!t||!t.length||!t.isAttached()){this._openLater=!0,this.$parent=t;return}super.render(t)}_render(){this.$container=this.$parent.appendDiv("tooltip").data("tooltip",this),this.cssClass&&this.$container.addClass(this.cssClass),this.$arrow=this.$container.appendDiv("tooltip-arrow"),this.$content=this.$container.appendDiv("tooltip-content"),this._renderText(),this._renderSeverity(),this._renderMenus(),this.autoRemove&&(this._mouseDownHandler=this._onDocumentMouseDown.bind(this),this.$container.document(!0).addEventListener("mousedown",this._mouseDownHandler,!0),this._keydownHandler=this._onDocumentKeyDown.bind(this),this.$container.document().on("keydown",this._keydownHandler)),this.$anchor&&this.scrollType&&(this._anchorScrollHandler=this._onAnchorScroll.bind(this),P.onScroll(this.$anchor,this._anchorScrollHandler)),this._popup=this.findParent(tr),this._popup||(this._popup=this.findParent(e=>e instanceof j&&e.isDialog())),this._popup&&(this._moveHandler=this.position.bind(this),this._popup.on("move",this._moveHandler)),this.findDesktopIf$Parent()?.tooltipRendered(this)}_postRender(){super._postRender(),this.position()}_remove(){this._mouseDownHandler&&(this.$container.document(!0).removeEventListener("mousedown",this._mouseDownHandler,!0),this._mouseDownHandler=null),this._keydownHandler&&(this.$container.document().off("keydown",this._keydownHandler),this._keydownHandler=null),this._anchorScrollHandler&&(P.offScroll(this._anchorScrollHandler),this._anchorScrollHandler=null),this._moveHandler&&(this._popup&&this._popup.off("move",this._moveHandler),this._moveHandler=null),this._popup=null,this.$menus=null,super._remove(),this.findDesktopIf$Parent()?.tooltipRemoved(this)}findDesktopIf$Parent(){if(!this.$parent)return null;const e=super.findDesktop();return e?.$container[0]===this.$parent[0]?e:null}_destroy(){super._destroy(),this.menus.forEach(e=>{e.popup&&e.popup.close()})}_onAttach(){super._onAttach(),this._openLater&&!this.rendered&&(this._openLater=!1,this.render())}_renderOnDetach(){this._openLater=!0,this.remove(),super._onDetach()}_isRemovalPrevented(){return this.removalPending}setText(e){this.setProperty("text",e)}_renderText(){let e=this.text||"";this.htmlEnabled?this.$content.html(e):this.$content.html(_.nl2br(e)),this.$content.setVisible(!!e),this.$container.toggleClass("no-text",!e),this.rendering||this.position()}setHtmlEnabled(e){this.setProperty("htmlEnabled",e)}_renderHtmlEnabled(){this._renderText()}setSeverity(e){this.setProperty("severity",e)}_renderSeverity(){this.$container.removeClass(E.SEVERITY_CSS_CLASSES),this.$container.addClass(E.cssClassForSeverity(this.severity))}setMenus(e){e=p.ensure(e),this.setProperty("menus",e)}_renderMenus(){let e=0,t=this.menus;t.length>0&&!this.$menus?this.$menus=this.$container.appendDiv("tooltip-menus"):t.length===0&&this.$menus&&(this.$menus.remove(),this.$menus=null),t.forEach(i=>{let s=0;i.render(this.$menus),i.iconId&&(s=i.get$Icon().outerWidth(!0),e=Math.max(s,e))}),e>0&&t.forEach(i=>{i.iconId?i.$text.cssPaddingLeft(e-i.get$Icon().outerWidth(!0)):i.$text.cssPaddingLeft(e)}),this.$container.toggleClass("has-menus",t.length>0),this.rendering||(this.$container.cssLeft("").cssTop(""),this.position())}set$Anchor(e){e?.[0]!==this.$anchor?.[0]&&this.setProperty("$anchor",e)}_render$anchor(){this.position()}position(){let e=this.$anchor?.scrollParents(!0),t=this._getOrigin();e&&this.clipOrigin&&(t=P.intersectViewport(t,e));let i=this._getOffset(t),s=t.point().add(i);if(e){let v=P.isLocationInView(s,e);this.$container.setVisible(v)}if(!this.originRelativeToParent){let v=this.$parent.offset();s.x-=v.left,s.y-=v.top}let r=7,o=4,l=this.$container.outerHeight(),a=this.$container.outerWidth(),d=this.arrowPosition;this.arrowPositionUnit==="%"&&(d=a*this.arrowPosition/100),this.tooltipDirection==="left"&&(d=a-d);let c=s.y-l-o,f=s.x-d,g=f+a+this.windowPaddingX-this.$parent.width(),y=c-this.windowPaddingY;g>0&&(f-=g,d=s.x-f),f<this.windowPaddingX&&(f=this.windowPaddingX,d=s.x-this.windowPaddingX),this.$arrow.removeClass("arrow-top arrow-bottom"),this.tooltipPosition==="bottom"||y<0?(this.$arrow.addClass("arrow-top"),c=s.y+t.height+o):this.$arrow.addClass("arrow-bottom"),d=Math.min(d,this.$container.outerWidth()-r),d=Math.max(d,r),this.$arrow.cssLeft(d-this.$arrow.cssBorderLeftWidth()),this.$container.cssLeft(f).cssTop(c),this.menus.forEach(v=>{v.popup&&v.popup.position()})}_getOrigin(){if(this.originProducer){const e=this.originProducer(this.$anchor);if(e)return e}return this.origin?this.origin:C.offsetBounds(this.$anchor)}_getOffset(e){if(this.offsetProducer){const t=this.offsetProducer(e);if(t)return t}return this.origin?new X(0,0):new X(e.width/2,0)}_onAnchorScroll(e){this.rendered&&(this.scrollType==="position"?this.position():this.scrollType==="remove"&&this.destroy())}_onDocumentMouseDown(e){if(!this.rendered)return!1;this._isMouseDownOutside(e)&&this._onMouseDownOutside(e)}_isMouseDownOutside(e){let t=e.target,i=h()(t),s=u.widget(i);return!this.isOrHas(s)&&this.$anchor&&!this.$anchor.isOrHas(i[0])&&!this.session.focusManager.isElementCovertByGlassPane(this.$container[0])}_onMouseDownOutside(e){this.destroy()}_onDocumentKeyDown(e){u.isOneOf(e.which,m.CTRL,m.SHIFT,m.ALT,m.NUM_LOCK,m.CAPS_LOCK,m.SCROLL_LOCK,m.WIN_LEFT,m.WIN_RIGHT,m.SELECT,m.PAUSE,m.PRINT_SCREEN)||this.destroy()}}class bl{_options;_mouseEnterHandler;_mouseLeaveHandler;_tooltip;_tooltipTimeoutId;constructor(e){let t={selector:null,delay:Y.DEFAULT_TOOLTIP_DELAY,text:void 0,nativeTooltip:!1};e=h().extend({},t,e),this._options=e,this._mouseEnterHandler=this._onMouseEnter.bind(this),this._mouseLeaveHandler=this._onMouseLeave.bind(this),this._tooltip=null,this._tooltipTimeoutId=null}install(e){e.data("tooltipSupport")||e.on("mouseenter",this._options.selector,this._mouseEnterHandler).on("mouseleave",this._options.selector,this._mouseLeaveHandler).data("tooltipSupport",this)}uninstall(e){e.removeData("tooltipSupport").off("mouseleave",this._options.selector,this._mouseLeaveHandler).off("mouseenter",this._options.selector,this._mouseEnterHandler),this._destroyTooltip()}update(e,t){h().extend(this._options,t),this._tooltip&&this._showTooltip(e)}cancel(e){clearTimeout(this._tooltipTimeoutId)}close(){this._destroyTooltip()}get tooltip(){return this._tooltip}_onMouseEnter(e){let t=h()(e.currentTarget);if(this._options.nativeTooltip){let i=this._text(t);t.attr("title",i)}else clearTimeout(this._tooltipTimeoutId),this._tooltipTimeoutId=setTimeout(this._showTooltip.bind(this,t),this._options.delay)}_onMouseLeave(e){this._destroyTooltip()}_destroyTooltip(){clearTimeout(this._tooltipTimeoutId),this._tooltip&&(this._tooltip.destroy(),this._tooltip=null)}_text(e){let t=this._options.text||e.data("tooltipText");return h().isFunction(t)&&(t=t(e)),t}_htmlEnabled(e){let t=this._options.htmlEnabled||e.data("htmlEnabled");return h().isFunction(t)&&(t=t(e)),u.nvl(t,!1)}_showTooltip(e){if(!e||!e.isAttached())return;let t=this._text(e);if(!t){this._destroyTooltip();return}let i=this._options.$anchor||e,s=this._htmlEnabled(e);if(this._tooltip&&this._tooltip.rendered)this._tooltip.set$Anchor(i),this._tooltip.setHtmlEnabled(s),this._tooltip.setText(t),this._tooltip.setSeverity(this._options.severity),this._tooltip.setMenus(this._options.menus);else{let r=h().extend({},this._options,{$anchor:i,text:t,htmlEnabled:s});this._tooltip=u.create(Xi,r),this._tooltip.render()}}}const Y={DEFAULT_TOOLTIP_DELAY:600,LONG_TOOLTIP_DELAY:1e3,install(n,e){let t=n.data("tooltipSupport");t?t.update(n,e):(t=new bl(e),t.install(n))},uninstall(n){let e=n.data("tooltipSupport");e&&e.uninstall(n)},update(n,e){let t=n.data("tooltipSupport");t&&t.update(n,e)},close(n){let e=n.data("tooltipSupport");e&&e.close()},cancel(n){let e=n.data("tooltipSupport");e&&e.cancel(n)},installForEllipsis(n,e){let t={text:i=>{if(i.isContentTruncated())return i.text()},nativeTooltip:!w.get().isCustomEllipsisTooltipPossible()};e=h().extend({},t,e),Y.install(n,e)},find(n){let e,t,i,s=[];for(e=h()(".tooltip",n.document(!0)),t=0;t<e.length;t++)i=e.eq(t).data("tooltip"),n.has(i.$anchor).length>0&&s.push(i);return s}};class Df extends Xi{keyStrokeStopPropagationInterceptor;withFocusContext;initialFocus;focusableContainer;content;$widgetContainer;constructor(){super(),this.$widgetContainer=null,this.content=null,this._addWidgetProperties(["content"]),this.keyStrokeStopPropagationInterceptor=e=>{u.isOneOf(e.which,m.ESC,m.ENTER)||e.stopPropagation()},this.withFocusContext=!0,this.initialFocus=()=>Et.AUTO,this.focusableContainer=!1}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeStopPropagationInterceptor&&this.keyStrokeContext.registerStopPropagationInterceptor(this.keyStrokeStopPropagationInterceptor)}_render(){super._render(),this.$container.addClass("widget-tooltip"),this.$widgetContainer=this.$container.appendDiv("tooltip-widget-container")}_renderProperties(){super._renderProperties(),this._renderContent()}_remove(){this._removeContent(),super._remove()}setContent(e){this.setProperty("content",e)}_renderContent(){this.content&&(this.content.render(this.$widgetContainer),this.content.$container.addClass("widget"),this.content.pack()),this.$widgetContainer.setVisible(!!this.content),this.rendering||this.position(),this.withFocusContext&&this.content&&this.session.focusManager.installFocusContext(this.$widgetContainer,this.initialFocus())}_removeContent(){this.content&&(this.session.focusManager.uninstallFocusContext(this.$widgetContainer),this.content.remove())}}class ce extends I{actionStyle;compact;iconId;horizontalAlignment;keyStroke;keyStrokeFirePolicy;selected;preventDoubleClick;tabbable;actionKeyStroke;text;textPosition;htmlEnabled;overflown;textVisible;toggleAction;tooltipText;showTooltipWhenSelected;tooltipPosition;icon;$text;_doubleClickSupport;_compactOrig;_textVisibleOrig;constructor(){super(),this.actionStyle=ce.ActionStyle.DEFAULT,this.compact=!1,this.iconId=null,this.horizontalAlignment=-1,this.keyStroke=null,this.keyStrokeFirePolicy=ce.KeyStrokeFirePolicy.ACCESSIBLE_ONLY,this.selected=!1,this.preventDoubleClick=!1,this.tabbable=!1,this.text=null,this.textPosition=ce.TextPosition.DEFAULT,this.htmlEnabled=!1,this.overflown=!1,this.textVisible=!0,this.toggleAction=!1,this.tooltipText=null,this.showTooltipWhenSelected=!0,this._doubleClickSupport=new R,this._addCloneProperties(["actionStyle","horizontalAlignment","iconId","selected","preventDoubleClick","tabbable","text","textPosition","htmlEnabled","tooltipText","toggleAction"])}static ActionStyle={DEFAULT:0,BUTTON:1};static TextPosition={DEFAULT:"default",BOTTOM:"bottom"};static KeyStrokeFirePolicy={ACCESSIBLE_ONLY:0,ALWAYS:1};_createKeyStrokeContext(){return new Ee}_createLoadingSupport(){return new Ut({widget:this})}_init(e){super._init(e),this.actionKeyStroke=this._createActionKeyStroke(),this.resolveConsts([{property:"actionStyle",constType:ce.ActionStyle},{property:"textPosition",constType:ce.TextPosition},{property:"keyStrokeFirePolicy",constType:ce.KeyStrokeFirePolicy}]),this.resolveTextKeys(["text","tooltipText"]),this.resolveIconIds(["iconId"]),this._setKeyStroke(this.keyStroke)}_render(){this.$container=this.$parent.appendDiv("action").on("mousedown",e=>this._doubleClickSupport.mousedown(e)).on("click",this._onClick.bind(this)),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout())}_createLayout(){return new pn}_renderProperties(){super._renderProperties(),this._renderText(),this._renderTextPosition(),this._renderIconId(),this._renderTooltipText(),this._renderKeyStroke(),this._renderSelected(),this._renderTabbable(),this._renderCompact(),this._renderActionStyle(),this._renderOverflown()}_remove(){this._removeText(),this._removeIconId(),super._remove()}setActionStyle(e){this.setProperty("actionStyle",e)}setText(e){this.setProperty("text",e)}_renderText(){let e=this.text||"";e&&this.textVisible?(this.$text||(this.$text=this.$container.appendSpan("content text"),x.install(this.$text,this.session)),this.htmlEnabled?this.$text.html(e):this.$text.text(e),T.label(this.$container,null)):(T.label(this.$container,e),this._removeText())}_removeText(){this.$text&&(this.$text.remove(),this.$text=null)}setTextPosition(e){this.setProperty("textPosition",e)}_renderTextPosition(){this.$container.toggleClass("bottom-text",this.textPosition===ce.TextPosition.BOTTOM),this.invalidateLayoutTree()}setHtmlEnabled(e){this.setProperty("htmlEnabled",e)}_renderHtmlEnabled(){this._renderText()}setIconId(e){this.setProperty("iconId",e)}_renderIconId(){let e=this.iconId||"";if(!e){this._removeIconId();return}if(this.icon){this.icon.setIconDesc(e);return}this.icon=u.create(Es,{parent:this,iconDesc:e,prepend:!0}),this.icon.one("destroy",()=>{this.icon=null}),this.icon.render()}get$Icon(){return this.icon?this.icon.$container:h()()}_removeIconId(){this.icon&&this.icon.destroy()}_renderEnabled(){super._renderEnabled(),this.rendered&&(this._updateTooltip(),this._renderTabbable())}setTooltipText(e){this.setProperty("tooltipText",e)}_renderTooltipText(){this._updateTooltip()}_computeTooltipText(){return this.tooltipText}_updateTooltip(){this._shouldInstallTooltip()?Y.install(this.$container,this._configureTooltip()):Y.uninstall(this.$container),T.description(this.$container,this.tooltipText)}_shouldInstallTooltip(){return this.selected&&!this.showTooltipWhenSelected?!1:!!this._computeTooltipText()}setTabbable(e){this.setProperty("tabbable",e)}_renderTabbable(){this.$container.setTabbable(this.tabbable&&this.enabledComputed&&!w.get().supportsOnlyTouch())}setCompact(e){this.compact!==e&&(this.compact=e,this.rendered&&this._renderCompact())}_renderCompact(){this.$container.toggleClass("compact",this.compact),this.invalidateLayoutTree()}_renderActionStyle(){T.role(this.$container,"button")}setTooltipPosition(e){this.setProperty("tooltipPosition",e)}_configureTooltip(){return{parent:this,text:this._computeTooltipText(),$anchor:this.$container,arrowPosition:50,arrowPositionUnit:"%",tooltipPosition:this.tooltipPosition}}doAction(){return this.prepareDoAction()?(this.isToggleAction()&&this.setSelected(!this.selected),this._doAction(),!0):!1}toggle(){this.isToggleAction()&&this.setSelected(!this.selected)}setToggleAction(e){this.setProperty("toggleAction",e)}isToggleAction(){return this.toggleAction}_renderToggleAction(){T.pressed(this.$container,this.isToggleAction()?this.selected:null)}prepareDoAction(){return!(!this.enabledComputed||!this.visible)}_doAction(){this.trigger("action")}setSelected(e){this.setProperty("selected",e)}_renderSelected(){this.$container.toggleClass("selected",this.selected),T.pressed(this.$container,this.isToggleAction()?this.selected:null),this.rendered&&this._updateTooltip()}setKeyStroke(e){this.setProperty("keyStroke",e)}_setKeyStroke(e){this.actionKeyStroke.parseAndSetKeyStroke(e),this._setProperty("keyStroke",e)}_renderKeyStroke(){let e=this.keyStroke;e===void 0?this.$container.removeAttr("data-shortcut"):this.$container.attr("data-shortcut",e)}setTextVisible(e){this.setProperty("textVisible",e)}_renderTextVisible(){this._renderText()}setHorizontalAlignment(e){this.setProperty("horizontalAlignment",e)}_createActionKeyStroke(){return new Rr(this)}setPreventDoubleClick(e){this.setProperty("preventDoubleClick",e)}_setOverflown(e){this.overflown!==e&&(this._setProperty("overflown",e),this.rendered&&this._renderOverflown())}_renderOverflown(){this.$container.toggleClass("overflown",this.overflown)}_allowMouseEvent(e){return!(e.which!==1||e.type==="click"&&this.preventDoubleClick&&this._doubleClickSupport.doubleClicked())}_onClick(e){this._allowMouseEvent(e)&&(Y.cancel(this.$container),this.doAction())}makeCompact(){this._compactOrig===void 0&&(this._compactOrig=this.compact,this.setCompact(!0))}undoMakeCompact(){this._compactOrig!==void 0&&(this.setCompact(this._compactOrig),this._compactOrig=void 0)}shrink(){this.iconId&&this._textVisibleOrig===void 0&&(this._textVisibleOrig=this.textVisible,this.setTextVisible(!1))}undoShrink(){this._textVisibleOrig!==void 0&&(this.setTextVisible(this._textVisibleOrig),this._textVisibleOrig=void 0)}}class er extends K{constructor(){super(),this._addRemoteProperties(["selected"])}_goOffline(){this._enabledBeforeOffline=this.widget.enabled,this.widget.setEnabled(!1)}_goOnline(){this.widget.setEnabled(this._enabledBeforeOffline)}_onWidgetAction(e){this.widget.isToggleAction()||this._send("action")}_onWidgetEvent(e){e.type==="action"?this._onWidgetAction(e):super._onWidgetEvent(e)}}class yl extends B{constructor(e){super(),this.field=e,this.which=[m.SPACE,m.ENTER],this.stopPropagation=!0}handle(e){this.field.doAction()}}class Rr extends B{constructor(e){super(),this.field=e,this.parseAndSetKeyStroke(e.keyStroke),this.keyStrokeFirePolicy=e.keyStrokeFirePolicy,this.stopPropagation=!0,this.stopImmediatePropagation=!0}_isEnabled(){return this.which.length?super._isEnabled():!1}handle(e){this.field.doAction()}}class wl{rendered;logoUrl;$parent;$container;$backgroundElements;$wrapper;$content;$header;$logo;constructor(){this.rendered=!1,this.logoUrl=null,this.$parent=null,this.$container=null,this.$backgroundElements=null,this.$wrapper=null,this.$content=null,this.$header=null,this.$logo=null}render(e){this.$parent=e,this._render(),this.rendered=!0}remove(){this.$container.remove(),this.$container=null,this.rendered=!1}_render(){this.$backgroundElements=h()("<div>").addClass("box-background-elements").appendTo(this.$parent),h()("<div>").addClass("box-background-element-1").appendTo(this.$backgroundElements),h()("<div>").addClass("box-background-element-2").appendTo(this.$backgroundElements),h()("<div>").addClass("box-background-element-3").appendTo(this.$backgroundElements),this.$container=h()("<div>").addClass("box").appendTo(this.$parent),this.$wrapper=h()("<div>").addClass("wrapper").appendTo(this.$container),this.$content=h()("<div>").addClass("box-content").appendTo(this.$wrapper),this.logoUrl&&(this.$header=this.$content.appendDiv("header"),this.$logo=h()("<img>").addClass("logo").attr("src",this.logoUrl).attr("alt","").appendTo(this.$header))}}class Cl extends I{value;htmlEnabled;scrollable;constructor(){super(),this.value=null,this.htmlEnabled=!1,this.scrollable=!1}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new Fn(this,this._onAppLinkAction))}_init(e){super._init(e),this.resolveTextKeys(["value"])}_render(){this.$container=this.$parent.appendDiv(),this.htmlComp=x.install(this.$container,this.session)}_renderProperties(){super._renderProperties(),this._renderValue(),this._renderScrollable()}setValue(e){this.setProperty("value",e)}_renderValue(){let e=this.value||"";this.htmlEnabled?(this.$container.html(e),this.$container.find(".app-link").on("click",this._onAppLinkAction.bind(this)),this.$container.find("img").on("load",this._onImageLoad.bind(this)).on("error",this._onImageError.bind(this))):this.$container.html(_.nl2br(e)),this.rendered&&(this._uninstallScrollbars(),this._renderScrollable()),this.invalidateLayoutTree()}setHtmlEnabled(e){this.setProperty("htmlEnabled",e)}_renderHtmlEnabled(){this._renderValue()}setScrollable(e){this.setProperty("scrollable",e)}_renderScrollable(){this.scrollable?this._installScrollbars():this._uninstallScrollbars()}_onAppLinkAction(e){let i=h()(e.delegateTarget).data("ref");this.triggerAppLinkAction(i)}triggerAppLinkAction(e){this.trigger("appLinkAction",{ref:e})}_onImageLoad(e){this.invalidateLayoutTree()}_onImageError(e){this.invalidateLayoutTree()}}class Ef extends K{_onWidgetAppLinkAction(e){this._send("appLinkAction",{ref:e.ref})}_onWidgetEvent(e){e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):super._onWidgetEvent(e)}}class _e extends I{anchorBounds;animateOpening;animateResize;anchor;windowPaddingX;windowPaddingY;withGlassPane;withFocusContext;initialFocus;focusableContainer;horizontalAlignment;verticalAlignment;calculatedHorizontalAlignment;calculatedVerticalAlignment;horizontalSwitch;verticalSwitch;trimWidth;trimHeight;scrollType;windowResizeType;boundToAnchor;withArrow;closeOnAnchorMouseDown;closeOnMouseDownOutside;closeOnOtherPopupOpen;modal;$anchor;$arrow;$arrowOverlay;_documentMouseDownHandler;_anchorScrollHandler;_anchorLocationChangeHandler;_popupOpenHandler;_glassPaneRenderer;_openLater;_windowResizeHandler;_anchorRenderHandler;_withGlassPane;_closeOnAnchorMouseDown;_closeOnMouseDownOutside;_closeOnOtherPopupOpen;constructor(){super(),this._documentMouseDownHandler=null,this._anchorScrollHandler=null,this._anchorLocationChangeHandler=null,this._popupOpenHandler=null,this._glassPaneRenderer=null,this.anchorBounds=null,this.animateOpening=!1,this.animateResize=!1,this.anchor=null,this.$anchor=null,this.windowPaddingX=10,this.windowPaddingY=5,this.withGlassPane=!1,this._withGlassPane=null,this.withFocusContext=!0,this.initialFocus=()=>Et.AUTO,this.focusableContainer=!1,this.horizontalAlignment=_e.Alignment.LEFTEDGE,this.verticalAlignment=_e.Alignment.BOTTOM,this.calculatedHorizontalAlignment=this.horizontalAlignment,this.calculatedVerticalAlignment=this.verticalAlignment,this.horizontalSwitch=!1,this.verticalSwitch=!0,this.trimWidth=!1,this.trimHeight=!0,this.scrollType="remove",this.windowResizeType=null,this.boundToAnchor=!0,this.withArrow=!1,this.closeOnAnchorMouseDown=!0,this._closeOnAnchorMouseDown=null,this.closeOnMouseDownOutside=!0,this._closeOnMouseDownOutside=null,this.closeOnOtherPopupOpen=!0,this._closeOnOtherPopupOpen=null,this.modal=!1,this._openLater=!1,this.$arrow=null,this.$arrowOverlay=null,this._windowResizeHandler=this._onWindowResize.bind(this),this._anchorRenderHandler=this._onAnchorRender.bind(this),this._addWidgetProperties(["anchor"]),this._addPreserveOnPropertyChangeProperties(["anchor"])}static Alignment={LEFT:"left",LEFTEDGE:"leftedge",TOP:"top",TOPEDGE:"topedge",CENTER:"center",RIGHT:"right",RIGHTEDGE:"rightedge",BOTTOM:"bottom",BOTTOMEDGE:"bottomedge"};static SwitchRule={};_init(e){super._init(e),e.location&&(this.anchorBounds=new te(e.location.x,e.location.y,0,0)),this._setAnchor(this.anchor),this._setModal(this.modal)}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(this._createCloseKeyStroke())}_createCloseKeyStroke(){return new fn(this)}_createLayout(){return new xi(this)}_openWithoutParent(){if(!this.parent.destroyed){if(this.parent.rendered||this.parent.rendering){this.open(this._getDefaultOpen$Parent());return}this.parent.one("render",()=>{this.session.layoutValidator.schedulePostValidateFunction(()=>{this.destroyed||this.rendered||this.open()})})}}_getDefaultOpen$Parent(){return this.parent.entryPoint()}open(e){if(!e){this._openWithoutParent();return}if(this._triggerPopupOpenEvent(),this._open(e),!this._openLater){if(!this.animateOpening){this.validateFocus();return}this.$container.addClass("before-animate-open"),setTimeout(()=>{!this.rendered||this.removing||(this.$container.removeClass("before-animate-open"),this.validateFocus(),this.rendered&&(this.$container.addClassForAnimation("animate-open"),this.$container.oneAnimationEnd(()=>this.findDesktop().repositionTooltips())))})}}validateFocus(){if(!this.withFocusContext)return;let e=this.session.focusManager.getFocusContext(this.$container);e.ready(),e.lastValidFocusedElement||this._requestInitialFocus()}_requestInitialFocus(){let e=this.session.focusManager.evaluateFocusRule(this.$container,this.initialFocus());e&&this.session.focusManager.requestFocus(e)}_open(e){this.render(e),!this._openLater&&(this.revalidateLayout(),this.position())}render(e){let t=e||this.entryPoint();if(!t||!t.length||!t.isAttached()){this._openLater=!0;return}super.render(t)}_render(){this.$container=this.$parent.appendDiv("popup"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.validateRoot=!0,this.htmlComp.setLayout(this._createLayout()),this.$container.window().on("resize",this._windowResizeHandler)}_renderProperties(){super._renderProperties(),this._renderAnchor(),this._renderWithArrow(),this._renderWithFocusContext(),this._renderWithGlassPane(),this._renderModal()}_postRender(){super._postRender(),this._attachCloseHandlers(),this._attachAnchorHandlers(),this._handleGlassPanes()}_onAttach(){if(super._onAttach(),this._openLater&&!this.rendered){this._openLater=!1;let e=this.animateOpening;this.animateOpening=!1,this.open(this.$parent),this.animateOpening=e}}_renderOnDetach(){this._openLater=!0;const e=this.$parent;super.removeImmediately(),this.$parent=e,super._renderOnDetach()}remove(){let e=this.animateRemoval;this.boundToAnchor&&this.$anchor&&!this._isAnchorInView()&&(this.animateRemoval=!1),super.remove(),this.animateRemoval=e}_remove(){this.$container.window().off("resize",this._windowResizeHandler),this._glassPaneRenderer&&this._glassPaneRenderer.removeGlassPanes(),this.withFocusContext&&this.session.focusManager.uninstallFocusContext(this.$container),this.$arrow&&(this.$arrow.remove(),this.$arrow=null),this.anchor&&this.anchor.one("render",this._anchorRenderHandler),this._detachAnchorHandlers(),this._detachCloseHandlers(),super._remove()}_destroy(){this.anchor&&this.anchor.off("render",this._anchorRenderHandler),super._destroy()}_renderWithFocusContext(){this.withFocusContext&&(this.focusableContainer&&this.$container.attr("tabindex",-1),this.session.focusManager.installFocusContext(this.$container,Et.PREPARE))}setModal(e){this.setProperty("modal",e)}_setModal(e){this._setProperty("modal",e),e?(Fe.preserveAndSetProperty(()=>this.setProperty("withGlassPane",!0),()=>this.withGlassPane,this,"_withGlassPane"),Fe.preserveAndSetProperty(()=>this.setProperty("closeOnAnchorMouseDown",!1),()=>this.closeOnAnchorMouseDown,this,"_closeOnAnchorMouseDown"),Fe.preserveAndSetProperty(()=>this.setProperty("closeOnMouseDownOutside",!1),()=>this.closeOnMouseDownOutside,this,"_closeOnMouseDownOutside"),Fe.preserveAndSetProperty(()=>this.setProperty("closeOnOtherPopupOpen",!1),()=>this.closeOnOtherPopupOpen,this,"_closeOnOtherPopupOpen")):(Fe.resetProperty(t=>this.setWithGlassPane(t),this,"_withGlassPane"),Fe.resetProperty(t=>this.setCloseOnAnchorMouseDown(t),this,"_closeOnAnchorMouseDown"),Fe.resetProperty(t=>this.setCloseOnMouseDownOutside(t),this,"_closeOnMouseDownOutside"),Fe.resetProperty(t=>this.setCloseOnOtherPopupOpen(t),this,"_closeOnOtherPopupOpen"))}_renderModal(){this.$container.toggleClass("modal",this.modal)}setWithGlassPane(e){this.modal?this._withGlassPane=e:this.setProperty("withGlassPane",e)}_renderWithGlassPane(){this.withGlassPane&&!this._glassPaneRenderer?(this._glassPaneRenderer=new Fr(this),this._glassPaneRenderer.renderGlassPanes()):!this.withGlassPane&&this._glassPaneRenderer&&(this._glassPaneRenderer.removeGlassPanes(),this._glassPaneRenderer=null)}setCloseOnMouseDownOutside(e){this.modal?this._closeOnMouseDownOutside=e:this.setProperty("closeOnMouseDownOutside",e)}_renderCloseOnMouseDownOutside(){this.closeOnMouseDownOutside&&!this._documentMouseDownHandler?(this._documentMouseDownHandler=this._onDocumentMouseDown.bind(this),this.$container.document(!0).addEventListener("mousedown",this._documentMouseDownHandler,!0)):!this.closeOnMouseDownOutside&&this._documentMouseDownHandler&&(this.$container.document(!0).removeEventListener("mousedown",this._documentMouseDownHandler,!0),this._documentMouseDownHandler=null)}setCloseOnAnchorMouseDown(e){this.modal?this._closeOnAnchorMouseDown=e:this.setProperty("closeOnAnchorMouseDown",e)}setCloseOnOtherPopupOpen(e){this.modal?this._closeOnOtherPopupOpen=e:this.setProperty("closeOnOtherPopupOpen",e)}_renderCloseOnOtherPopupOpen(){this.closeOnOtherPopupOpen&&!this._popupOpenHandler?(this._popupOpenHandler=this._onPopupOpen.bind(this),this.session.desktop.on("popupOpen",this._popupOpenHandler)):!this.closeOnOtherPopupOpen&&this._popupOpenHandler&&(this.session.desktop.off("popupOpen",this._popupOpenHandler),this._popupOpenHandler=null)}setWithArrow(e){this.setProperty("withArrow",e)}_renderWithArrow(){this.$arrow&&(this.$arrow.remove(),this.$arrow=null),this.$arrowOverlay&&(this.$arrowOverlay.remove(),this.$arrowOverlay=null),this.withArrow&&(this.$arrowOverlay=this.$container.prependDiv("popup-arrow-overlay"),this.$arrow=this.$container.prependDiv("popup-arrow"),this._updateArrowClass()),this.$container.toggleClass("with-arrow",this.withArrow),this.invalidateLayoutTree()}_updateArrowClass(e,t){this.$arrow&&(this.$arrow.removeClass(this._alignClasses()),this.$arrow.addClass(this._computeArrowPositionClass(e,t)))}_computeArrowPositionClass(e,t){let i=_e.Alignment,s="";switch(t=t||this.horizontalAlignment,e=e||this.verticalAlignment,t){case i.LEFT:s=i.RIGHT;break;case i.RIGHT:s=i.LEFT;break;default:s=t;break}switch(e){case i.BOTTOM:s+=" "+i.TOP;break;case i.TOP:s+=" "+i.BOTTOM;break;default:s+=" "+e;break}return s}_animateRemovalWhileRemovingParent(){return this.$anchor?Fe.get(this.$anchor)!==this.parent:!0}_isRemovalPrevented(){return this.removalPending}close(){if(this.destroyed||this.destroying)return;this.trigger("close").defaultPrevented||this.destroy()}_attachCloseHandlers(){this._renderCloseOnMouseDownOutside(),this._renderCloseOnOtherPopupOpen()}_attachAnchorHandlers(){if(!this.$anchor||!this.boundToAnchor||!this.scrollType)return;this._anchorScrollHandler=this._onAnchorScroll.bind(this),P.onScroll(this.$anchor,this._anchorScrollHandler);let e=u.widget(this.$anchor);e&&(this._anchorLocationChangeHandler=this._onAnchorLocationChange.bind(this),e.on("locationChange",this._anchorLocationChangeHandler))}_detachAnchorHandlers(){if(this._anchorScrollHandler&&(P.offScroll(this._anchorScrollHandler),this._anchorScrollHandler=null),this._anchorLocationChangeHandler){let e=u.widget(this.$anchor);e&&(e.off("locationChange",this._anchorLocationChangeHandler),this._anchorLocationChangeHandler=null)}}_detachCloseHandlers(){this._popupOpenHandler&&(this.session.desktop.off("popupOpen",this._popupOpenHandler),this._popupOpenHandler=null),this._documentMouseDownHandler&&(this.$container.document(!0).removeEventListener("mousedown",this._documentMouseDownHandler,!0),this._documentMouseDownHandler=null)}_onDocumentMouseDown(e){this._rendered&&this._isMouseDownOutside(e)&&this._onMouseDownOutside(e)}_isMouseDownOutside(e){let t=e.target,i=h()(t),s;return!this.closeOnAnchorMouseDown&&this._isMouseDownOnAnchor(e)?!1:(s=u.widget(i),!this.isOrHas(s)&&!this.session.focusManager.isElementCovertByGlassPane(this.$container[0]))}_isMouseDownOnAnchor(e){let t=e.target;return!!this.$anchor&&this.$anchor.isOrHas(t)}_onMouseDownOutside(e){this.close()}_onAnchorScroll(e){this.rendered&&this._handleAnchorPositionChange(e)}_handleAnchorPositionChange(e){u.isOneOf(this.scrollType,"position","layoutAndPosition")&&this.isOpeningAnimationRunning()||(this.scrollType==="position"?this.position():this.scrollType==="layoutAndPosition"?(this.revalidateLayout(),this.position()):this.scrollType==="remove"&&this.close())}isOpeningAnimationRunning(){return this.rendered&&this.animateOpening&&this.$container.hasClass("animate-open")}_onAnchorLocationChange(e){this._handleAnchorPositionChange(e)}_onPopupOpen(e){let t=!this.isOrHas(e.popup)&&!e.popup.isOrHas(this);this.rendered&&(t=t&&!this.session.focusManager.isElementCovertByGlassPane(this.$container[0])),t&&this.close()}setHorizontalAlignment(e){this.setProperty("horizontalAlignment",e)}_renderHorizontalAlignment(){this._updateArrowClass(),this.invalidateLayoutTree()}setVerticalAlignment(e){this.setProperty("verticalAlignment",e)}_renderVerticalAlignment(){this._updateArrowClass(),this.invalidateLayoutTree()}setHorizontalSwitch(e){this.setProperty("horizontalSwitch",e)}_renderHorizontalSwitch(){this.invalidateLayoutTree()}setVerticalSwitch(e){this.setProperty("verticalSwitch",e)}_renderVerticalSwitch(){this.invalidateLayoutTree()}setTrimWidth(e){this.setProperty("trimWidth",e)}_renderTrimWidth(){this.invalidateLayoutTree()}setTrimHeight(e){this.setProperty("trimHeight",e)}_renderTrimHeight(){this.invalidateLayoutTree()}prefLocation(e,t){return!this.boundToAnchor||!this.anchorBounds&&!this.$anchor?this._prefLocationWithoutAnchor():this._prefLocationWithAnchor(e,t)}_prefLocationWithoutAnchor(){return Qi.positionContainerInWindow(this.$container)}_prefLocationWithAnchor(e,t){let i=this.$container;t=t||this.horizontalAlignment,e=e||this.verticalAlignment;let s=this.getAnchorBounds(),r=C.size(i,{exact:!0}),o=C.margins(i),l=_e.Alignment,a=null;this.$arrow&&(this._updateArrowClass(e,t),C.setMargins(this.$arrow,new We),a=C.bounds(this.$arrow)),i.removeClass(this._alignClasses()),i.addClass(e+" "+t);let d=r.width+o.horizontal(),c=r.width,f=s.x;t===l.LEFT?f-=d:t===l.LEFTEDGE?this.withArrow?f+=s.width/2-a.center().x-o.left:f=s.x-o.left:t===l.CENTER?f+=s.width/2-c/2-o.left:t===l.RIGHT?f+=s.width:t===l.RIGHTEDGE&&(this.withArrow?f+=s.width/2-a.center().x-o.left:f=s.x+s.width-c-o.left);let g=r.height+o.vertical(),y=r.height,v=s.y;e===l.TOP?v-=g:e===l.TOPEDGE?this.withArrow?v+=s.height/2-a.center().y-o.top:v=s.y-o.top:e===l.CENTER?v+=s.height/2-y/2-o.top:e===l.BOTTOM?v+=s.height:e===l.BOTTOMEDGE&&(this.withArrow?v+=s.height/2-a.center().y-o.top:v=s.y+s.height-y-o.top);let D=this.$parent.offset();return f-=D.left,v-=D.top,new X(f,v)}_alignClasses(){let e=_e.Alignment;return _.join(" ",e.LEFT,e.LEFTEDGE,e.CENTER,e.RIGHT,e.RIGHTEDGE,e.TOP,e.TOPEDGE,e.CENTER,e.BOTTOM,e.BOTTOMEDGE)}getAnchorBounds(){let e=this.anchorBounds;if(!this.$anchor)return e;let t=C.offsetBounds(this.$anchor,{exact:!0});return e?(e.x||(e.x=t.x,e.width=t.width),e.y||(e.y=t.y,e.height=t.height)):e=t,e}getWindowSize(){let e=this.$parent.window();return new F(e.width(),e.height())}overlap(e,t){let i=this.$container;if(!i||!e)return null;t=u.nvl(t,!0);let s=C.size(i,{exact:!0,includeMargin:t}),r=s.width,o=s.height,l=new te(e.x,e.y,r,o),a=C.offsetBounds(i.entryPoint(),!0),d=l.right()+this.windowPaddingX-a.width;d<0&&(d=Math.min(l.x-this.windowPaddingX-a.x,0));let c=l.bottom()+this.windowPaddingY-a.height;return c<0&&(c=Math.min(l.y-this.windowPaddingY-a.y,0)),new X(d,c)}adjustLocation(e,t){this.calculatedVerticalAlignment=this.verticalAlignment,this.calculatedHorizontalAlignment=this.horizontalAlignment;let i=this.overlap(e);return this.$arrow&&(this._updateArrowClass(this.calculatedVerticalAlignment,this.calculatedHorizontalAlignment),C.setMargins(this.$arrow,new We)),e=e.clone(),Math.abs(i.y)>=1&&(u.nvl(t,this.verticalSwitch)?(this.calculatedVerticalAlignment=_e.SwitchRule[this.calculatedVerticalAlignment],e.y=this.prefLocation(this.calculatedVerticalAlignment).y):e.y-=i.y),Math.abs(i.x)>=1&&(u.nvl(t,this.horizontalSwitch)?(this.calculatedHorizontalAlignment=_e.SwitchRule[this.calculatedHorizontalAlignment],e.x=this.prefLocation(this.calculatedVerticalAlignment,this.calculatedHorizontalAlignment).x):e.x-=i.x),this.$arrow&&(i.y!==0&&(this.$arrow.hasClass(_e.Alignment.LEFT)||this.$arrow.hasClass(_e.Alignment.RIGHT))&&(i.y>0?this.$arrow.cssMarginTop(i.y):this.$arrow.cssMarginBottom(-i.y)),i.x!==0&&(this.$arrow.hasClass(_e.Alignment.TOP)||this.$arrow.hasClass(_e.Alignment.BOTTOM))&&(i.x>0?this.$arrow.cssMarginLeft(i.x):this.$arrow.cssMarginRight(-i.x))),e}position(e){this.rendered&&(this._validateVisibility(),this._position(e))}_position(e){let t=this.prefLocation();t&&(t=this.adjustLocation(t,e),this.setLocation(t))}setLocation(e){this.rendered&&(this.$container.css("left",e.x).css("top",e.y),this._triggerLocationChange())}_validateVisibility(){if(!this.boundToAnchor||!this.$anchor)return;let e=this._isAnchorInView(),t=this.$container.hasClass("invisible")===e&&e;if(this.$container.toggleClass("invisible",!e),t){let i=this.animateResize;this.animateResize=!1,this.revalidateLayout(),this.animateResize=i,this.withFocusContext&&this.session.focusManager.validateFocus()}}_isAnchorInView(){if(!this.boundToAnchor||!this.$anchor)return;let e=this.getAnchorBounds();return P.isLocationInView(e.center(),this.$anchor.scrollParents())}_triggerLocationChange(){this.trigger("locationChange")}_triggerPopupOpenEvent(){this.session.desktop.trigger("popupOpen",{popup:this})}belongsTo(e){return this.$anchor[0]===e[0]}set$Anchor(e){this.$anchor&&this._detachAnchorHandlers(),this.setProperty("$anchor",e),this.rendered&&(this._attachAnchorHandlers(),this.revalidateLayout(),this.animateResize||this.position())}isOpen(){return this.rendered}ensureOpen(){this.isOpen()||this.open()}setAnchor(e){this.setProperty("anchor",e)}_setAnchor(e){e&&this.setParent(e),this._setProperty("anchor",e)}_onAnchorRender(e){this.session.layoutValidator.schedulePostValidateFunction(()=>{if(this.rendered||this.destroyed)return;if(this.anchor&&!this.anchor.rendered){this.anchor.one("render",this._anchorRenderHandler);return}let t=this.animateOpening;this.animateOpening=!1,this.open(),this.animateOpening=t})}_renderAnchor(){this.anchor&&this.set$Anchor(this.anchor.$container)}_onWindowResize(e){this.rendered&&(this.windowResizeType==="position"?this.position():this.windowResizeType==="layoutAndPosition"?(this.revalidateLayoutTree(!1),this.position()):this.windowResizeType==="remove"&&this.close())}_handleGlassPanes(){this.session.focusManager.isElementCovertByGlassPane(this.parent.$container)&&this.session.focusManager.rerenderGlassPanes()}}(()=>{let n=_e.SwitchRule,e=_e.Alignment;n[e.LEFT]=e.RIGHT,n[e.LEFTEDGE]=e.RIGHTEDGE,n[e.TOP]=e.BOTTOM,n[e.TOPEDGE]=e.BOTTOMEDGE,n[e.CENTER]=e.CENTER,n[e.RIGHT]=e.LEFT,n[e.RIGHTEDGE]=e.LEFTEDGE,n[e.BOTTOM]=e.TOP,n[e.BOTTOMEDGE]=e.TOPEDGE})();class Ih extends K{_onWidgetClose(e){e.preventDefault(),this._send("close")}_onWidgetEvent(e){e.type==="close"?this._onWidgetClose(e):super._onWidgetEvent(e)}}class xi extends ne{popup;doubleCalcPrefSize;autoPosition;autoSize;resizeAnimationRunning;resizeAnimationDuration;_autoPositionOrig;constructor(e){super(),this.popup=e,this.doubleCalcPrefSize=!0,this.autoPosition=!0,this.autoSize=!0,this.resizeAnimationRunning=!1,this.resizeAnimationDuration=null,this._autoPositionOrig=null}layout(e){if(this.popup.isOpeningAnimationRunning()){this.popup.$container.oneAnimationEnd(this.layout.bind(this,e));return}if(this.popup.removalPending||this.popup.removing||!this.popup.rendered)return;if(!this.autoSize){this._setSize(this.popup.htmlComp.size({exact:!0}));return}let t=this.popup.htmlComp,i=C.bounds(t.$comp),s=this.preferredLayoutSize(e,{exact:!0,widthOnly:this.doubleCalcPrefSize});s=this.adjustSize(s),this.doubleCalcPrefSize&&(s=this.preferredLayoutSize(e,{exact:!0,widthHint:s.width-t.insets().horizontal()}),s=this.adjustSize(s)),this._setSize(s),t.layouted&&this.popup.animateResize&&this._resizeAnimated(i,s)}_resizeAnimated(e,t){this._position();let i=this.popup.htmlComp,s=i.$comp.position(),r=new te(s.left,s.top,Math.ceil(t.width),Math.ceil(t.height));e.equals(r)||(this.resizeAnimationRunning=!0,i.$comp.stop(!0).cssHeight(e.height).cssWidth(e.width).cssLeft(e.x).cssTop(e.y).animate({height:t.height,width:t.width,left:s.left,top:s.top},{duration:this.resizeAnimationDuration,complete:()=>{this.resizeAnimationRunning=!1,this.popup.rendered&&this._position()}}))}_position(e){this.autoPosition&&this.popup.position(e)}_setSize(e){C.setSize(this.popup.htmlComp.$comp,e)}adjustSize(e){return this.popup.htmlComp._adjustPrefSizeWithMinMaxSize(e),this.popup.boundToAnchor&&(this.popup.anchorBounds||this.popup.$anchor)?this._adjustSizeWithAnchor(e):this._adjustSize(e)}_adjustSize(e){let t=new F,i=this._calcMaxSize();return t.width=Math.min(i.width,e.width),t.height=Math.min(i.height,e.height),t}_calcMaxSize(){let e,t,i=this.popup.htmlComp,s=this.popup.windowPaddingX,r=this.popup.windowPaddingY,o=i.margins(),l=this.popup.getWindowSize();return e=l.width-o.horizontal()-s,t=l.height-o.vertical()-r,new F(e,t)}_adjustSizeWithAnchor(e){let t=new F,i=this._calcMaxSizeAroundAnchor(),s=this._calcMaxSize(),r=_e.Alignment,o=this.popup.horizontalAlignment,l=this.popup.verticalAlignment;return t.width=e.width,this.popup.trimWidth&&(this.popup.horizontalSwitch?e.width>i.right&&e.width>i.left&&(t.width=Math.max(i.right,i.left)):o===r.RIGHT?t.width=Math.min(t.width,i.right):o===r.LEFT?t.width=Math.min(t.width,i.left):t.width=Math.min(t.width,s.width)),t.height=e.height,this.popup.trimHeight&&(this.popup.verticalSwitch?e.height>i.bottom&&e.height>i.top&&(t.height=Math.max(i.bottom,i.top)):l===r.BOTTOM?t.height=Math.min(t.height,i.bottom):l===r.TOP?t.height=Math.min(t.height,i.top):t.height=Math.min(t.height,s.height)),(l===r.CENTER||o===r.CENTER)&&(o===r.CENTER&&(t.width=Math.min(s.width,e.width)),l===r.CENTER&&(t.height=Math.min(s.height,e.height))),t}_calcMaxSizeAroundAnchor(){let e,t,i,s,r=this.popup.htmlComp,o=this.popup.windowPaddingX,l=this.popup.windowPaddingY,a=r.margins(),d=this.popup.getAnchorBounds(),c=this.popup.getWindowSize(),f=this.popup.horizontalAlignment,g=this.popup.verticalAlignment,y=_e.Alignment;return u.isOneOf(f,y.LEFTEDGE,y.RIGHTEDGE)?(t=c.width-d.x-a.horizontal()-o,e=d.right()-a.horizontal()-o):(t=c.width-d.right()-a.horizontal()-o,e=d.x-a.horizontal()-o),u.isOneOf(g,y.BOTTOMEDGE,y.TOPEDGE)?(i=c.height-d.y-a.vertical()-l,s=d.bottom()-a.vertical()-l):(i=c.height-d.bottom()-a.vertical()-l,s=d.y-a.vertical()-l),new We(s,t,i,e)}disableAutoPosition(){this._autoPositionOrig===null&&(this._autoPositionOrig=this.autoPosition,this.autoPosition=!1)}resetAutoPosition(){this.autoPosition=this._autoPositionOrig,this._autoPositionOrig=null}}class Tl extends I{popups;constructor(){super(),this.popups=[],this._addWidgetProperties(["popups"]),this._addPreserveOnPropertyChangeProperties(["popups"])}_init(e){super._init(e),this.session.layoutValidator.schedulePostValidateFunction(()=>{this._openPopups(this.popups)})}setPopups(e){this.setProperty("popups",e)}_setPopups(e){this._openPopups(p.diff(e,this.popups)),this._destroyPopups(p.diff(this.popups,e)),this._setProperty("popups",e),this.popups.forEach(t=>{t.parent instanceof Tl&&t.setParent(this.session.desktop)})}_openPopups(e){e.forEach(t=>{t.open()})}_destroyPopups(e){e.forEach(t=>t.destroy())}}class Ff extends K{_syncPopups(e){this.session.onEventsProcessed(()=>this.widget.setPopups(e))}}class go extends _e{doneAction;htmlBody;$body;_field;_touchField;_touchFieldTooltip;_widget;_$widgetContainer;_$header;_widgetContainerHtmlComp;_touchFieldPropertyChangeListener;constructor(){super(),this._touchField=null,this._touchFieldTooltip=null,this._field=null,this._widget=null,this._$widgetContainer=null,this._widgetContainerHtmlComp=null,this.windowPaddingX=0,this.windowPaddingY=0,this.withGlassPane=!0,this._touchFieldPropertyChangeListener=this._onTouchFieldPropertyChange.bind(this)}_init(e){super._init(e),this._touchField=e.field;let t=this._touchField.tooltip();t&&t.rendered&&(this._touchFieldTooltip=t,this._touchFieldTooltip.remove()),this._field=this._touchField.clone(this._fieldOverrides(),{delegateEventsToOriginal:this._initDelegatedEvents()}),this._touchField.on("propertyChange",this._touchFieldPropertyChangeListener),this._initWidget(e),this.doneAction=u.create(J,{parent:this,text:this.session.text("ui.Done")}),this.doneAction.on("action",this._onCloseIconClick.bind(this))}_destroy(){this._touchField.off("propertyChange",this._touchFieldPropertyChangeListener),this._touchFieldTooltip&&!this._touchFieldTooltip.destroyed&&this._touchFieldTooltip.render(this._touchField._$tooltipParent()),super._destroy()}_fieldOverrides(){return{parent:this,labelVisible:!1,fieldStyle:A.FieldStyle.CLASSIC,popup:this,statusVisible:!1,menusVisible:!1,embedded:!0,touchMode:!1,clearable:ge.Clearable.ALWAYS}}_initDelegatedEvents(){return[]}_initWidget(e){}_createLayout(){return new vl(this)}prefLocation(e,t){let i=this.htmlComp.prefSize(),s=this.$container.window().width(),r=Math.max(this.windowPaddingX,(s-i.width)/2);return new X(r,0)}_render(){this.$container=this.$parent.appendDiv("popup touch-popup"),this.$body=this.$container.appendDiv("body"),this.htmlBody=x.install(this.$body,this.session),this.htmlBody.setLayout(new Si),this._$header=this.$body.appendDiv("touch-popup-header"),x.install(this._$header,this.session),this._$header.appendDiv("touch-popup-title").textOrNbsp(this._touchField.label,"empty"),this.doneAction.render(this._$header),this._$widgetContainer=this.$body.appendDiv("touch-popup-widget-container"),this._widgetContainerHtmlComp=x.install(this._$widgetContainer,this.session),this._widgetContainerHtmlComp.setLayout(new ji),this._field.render(),this._field.$container.insertBefore(this._$widgetContainer),this._field.$container.addClass("touch-popup-field"),this._widget&&this._widget.render(this._$widgetContainer),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.validateRoot=!0,this.htmlComp.setLayout(this._createLayout())}_handleGlassPanes(){super._handleGlassPanes(),this._glassPaneRenderer&&this._glassPaneRenderer.eachGlassPane(e=>e.addClass("dark"))}_onTouchFieldPropertyChange(e){e.propertyName==="errorStatus"?this._field.setErrorStatus(e.newValue):e.propertyName==="lookupRow"&&this._field instanceof Pe&&this._field.setLookupRow(e.newValue)}_acceptInput(){let e=this._field.acceptInput();e?e.always(this.close.bind(this)):this.close()}_onCloseIconClick(e){this._acceptInput()}}class vl extends xi{constructor(e){super(e),this.doubleCalcPrefSize=!1}_setSize(e){super._setSize(e);let t=this.popup.htmlComp,i=this.popup.htmlBody,s=e.subtract(t.insets());i.setSize(s.subtract(i.margins()))}preferredLayoutSize(e,t){let i=this.popup.htmlComp,s=this.popup.htmlBody,r=s.prefSize(t).add(i.insets());return r.width=we.get().formColumnWidth,r.add(s.margins())}}class tr extends _e{closable;closeAction;movable;resizable;resizeModes;$dragHandle;content;$actions;_moveHandler;_resizeHandler;_autoPositionOrig;constructor(){super(),this.animateOpening=!0,this.animateResize=!0,this.animateRemoval=!0,this.closable=!1,this.closeAction=null,this.movable=!1,this.resizable=!1,this.resizeModes=null,this.content=null,this.windowPaddingX=0,this.windowPaddingY=0,this.windowResizeType="layoutAndPosition",this.$dragHandle=null,this.$actions=null,this._moveHandler=this._onMove.bind(this),this._resizeHandler=this._onResize.bind(this),this._autoPositionOrig=null,this._addWidgetProperties(["content"])}_createLayout(){return new Bh(this)}_init(e){super._init(e),this._setClosable(this.closable)}_render(){super._render(),this.$container.addClass("widget-popup"),T.role(this.$container,"none")}_renderProperties(){super._renderProperties(),this._renderContent(),this._renderClosable(),this._renderMovable(),this._renderResizable()}_remove(){this.$dragHandle=null,this.$actions=null,super._remove()}setContent(e){this.setProperty("content",e)}_renderContent(){this.content&&(this.content.render(),this.content.$container.addClass("popup-widget"),this.invalidateLayoutTree())}setClosable(e){this.setProperty("closable",e)}_setClosable(e){if(this._setProperty("closable",e),this.closable){if(this.closeAction)return;this.closeAction=this._createCloseAction(),this.closeAction.on("action",this._onCloseAction.bind(this))}else{if(!this.closeAction)return;this.closeAction.destroy(),this.closeAction=null}}_createCloseAction(){return u.create(ce,{parent:this,cssClass:"close-action menu-item",iconId:q.REMOVE,text:this.session.text("ui.Close"),textVisible:!1})}_renderClosable(){this.closeAction?(this.$actions||(this.$actions=this.$container.appendDiv("actions")),this.closeAction.render(this.$actions)):this.$actions&&this.$actions.children().length===0&&(this.$actions.remove(),this.$actions=null)}_onCloseAction(e){this.close()}setResizable(e){this.setProperty("resizable",e)}_renderResizable(){this.resizable?this.$container.resizable({modes:this._determineResizeModes(),$container:this.$container,boundaries:this._calculateResizeBoundaries()}).on("resizeStep",this._resizeHandler):(this.$container.unresizable().off("resizeStep",this._resizeHandler),this.invalidateLayoutTree())}_calculateResizeBoundaries(){let e=new We;if(!this.$arrow)return e;let t=this._getAnchorMiddlePoint();if(!t)return e;let i=C.size(this.$arrow);return this._isVerticallyAligned()?(e.top=t.y-i.height,e.bottom=t.y+i.height):(e.left=t.x-i.width,e.right=t.x+i.width),e}_determineResizeModes(){return!this.$arrow||this.resizeModes?this.resizeModes:this.calculatedVerticalAlignment===_e.Alignment.TOP?[Me.MODES.WEST,Me.MODES.EAST,Me.MODES.NORTH]:this.calculatedVerticalAlignment===_e.Alignment.BOTTOM?[Me.MODES.WEST,Me.MODES.EAST,Me.MODES.SOUTH]:this.calculatedHorizontalAlignment===_e.Alignment.LEFT?[Me.MODES.NORTH,Me.MODES.SOUTH,Me.MODES.WEST]:this.calculatedHorizontalAlignment===_e.Alignment.RIGHT?[Me.MODES.NORTH,Me.MODES.SOUTH,Me.MODES.EAST]:this.resizeModes}_onResize(e){let t=this.htmlComp.layout,i=t.autoSize;return t.autoSize=!1,this.htmlComp.revalidateLayoutTree(!1),t.autoSize=i,this._updateArrowPosition(),!1}position(e){if(this.rendered&&(super.position(e),this.resizable)){let t=this.$container.data("resizable");t.setBoundaries(this._calculateResizeBoundaries()),t.setModes(this._determineResizeModes()),this._updateArrowPosition()}}_updateArrowClass(e,t){super._updateArrowClass(e,t),this.$arrow&&(this.$arrow.cssLeft(null),this.$arrow.cssTop(null))}_updateArrowPosition(){if(!this.$arrow)return;let e=this._getAnchorMiddlePoint();if(!e)return;this.$arrow.removeClass("leftedge rightedge topedge bottomedge");let t=C.size(this.$arrow),i=C.margins(this.$arrow);if(this._isVerticallyAligned()){let s=i.top+i.bottom;this.$arrow.cssTop(e.y-(s+this.$container.position().top+t.height/2))}else{let s=i.left+i.right;this.$arrow.cssLeft(e.x-(s+this.$container.position().left+t.width/2))}}_getAnchorMiddlePoint(){let e=this.getAnchorBounds();return e?e.center():null}_isVerticallyAligned(){return u.isOneOf(this.calculatedHorizontalAlignment,_e.Alignment.LEFT,_e.Alignment.RIGHT)}setMovable(e){this.setProperty("movable",e)}_renderMovable(){if(this.movable){if(this.$dragHandle)return;this.$dragHandle=this.$container.prependDiv("drag-handle"),this.$container.draggable(this.$dragHandle,h().throttle(this._moveHandler,1e3/60))}else{if(!this.$dragHandle)return;this.$container.undraggable(this.$dragHandle),this.$dragHandle.remove(),this.$dragHandle=null;let e=this.htmlComp.layout;e.autoPosition=this._autoPositionOrig,this._autoPositionOrig=null,this.invalidateLayoutTree()}}_onMove(e){if(this._autoPositionOrig===null){let t=this.htmlComp.layout;this._autoPositionOrig=t.autoPosition,t.autoPosition=!1}this.trigger("move",e)}set$Anchor(e){if(this._autoPositionOrig&&e&&this.$anchor!==e){let t=this.htmlComp.layout;t.autoPosition=this._autoPositionOrig,this._autoPositionOrig=null}super.set$Anchor(e)}}class Lh extends Ih{}class Bh extends xi{constructor(e){super(e)}_setSize(e){super._setSize(e);let t=this.popup.htmlComp,i=this.popup.content.htmlComp,s=e.subtract(t.insets());i.setSize(s.subtract(i.margins()))}preferredLayoutSize(e,t){let i=this.popup.htmlComp,s=this.popup.content.htmlComp;return s.prefSize(t).add(i.insets()).add(s.margins())}}class Oh extends tr{title;$header;$title;constructor(){super(),this.boundToAnchor=!1,this.closable=!0,this.title=null,this.withGlassPane=!0}_createLayout(){return new Hh(this)}_createCloseAction(){return u.create(ce,{parent:this,cssClass:"closer",iconId:q.REMOVE_BOLD})}prefLocation(e,t){let i=this.htmlComp.prefSize(),s=this.$container.window().height(),r=Math.max(s-i.height,0);return new X(0,r)}_render(){this.$container=this.$parent.appendDiv("popup mobile-popup"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.validateRoot=!0,this.htmlComp.setLayout(this._createLayout()),this.$header=this.$container.appendDiv("mobile-popup-header"),this.$title=this.$header.appendDiv("title")}_renderProperties(){super._renderProperties(),this._renderTitle()}_renderContent(){super._renderContent(),this.content&&this.content.$container.addClass("mobile-popup-widget")}_renderClosable(){this.closeAction&&this.closeAction.render(this.$header),this.$header.setVisible(!!this.title||this.closable)}_renderTitle(){this.$title.textOrNbsp(this.title),this.$header.setVisible(!!this.title||this.closable)}}class Rf extends Lh{}class Hh extends xi{constructor(e){super(e),this.doubleCalcPrefSize=!1}layout(e){super.layout(e);let t=this.popup.htmlComp,i=t.size(),s=this.popup.content.htmlComp,r,o=this.popup.$header,l;i=i.subtract(t.insets()),l=C.prefSize(o,!0),C.setLocation(o,new X(0,0)),r=i.clone(),r.height-=l.height,s.setLocation(new X(0,l.height)),s.setSize(r.subtract(s.margins()))}preferredLayoutSize(e,t){let i=this.popup.$container.window();return new F(i.width(),i.height())}}let mo=new Map;class ir{static registerHandler(e,t){if(u.assertParameter("handlerId",e),u.assertParameter("handler",t),mo.has(e))throw new Error("Already registered");mo.set(e,t)}static unregisterHandler(e){return mo.delete(e)}static getHandlers(){return[...mo.values()]}static getHandler(e){return mo.get(e)??null}objectType;_store;_storeTimeoutId=0;_modifiedHandlers=new Set;_preferences;constructor(){this._initStore()}_initStore(){this.replaceStore(u.create(Sl))}replaceStore(e){let t=this._store;return this._store=u.assertParameter("store",e),this._initPreferences(null),t}bootstrap(){return h().resolvedPromise().then(()=>this._subscribeForUpdates()).then(()=>this.load())}load(){return this._store.load().then(e=>this._initPreferences(e))}store(){return this._processModifiedHandlers(),this._store.store(this._preferences)}scheduleStore(e){this._markHandlerAsModified(e),clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{this.store().catch(t=>{u.create(ri,{displayError:!1,sendError:!0}).handle(t)})})}_markHandlerAsModified(e){if(e){let t=ir.getHandler(e);t&&this._modifiedHandlers.add(t)}else ir.getHandlers().forEach(t=>this._modifiedHandlers.add(t))}_processModifiedHandlers(){this._modifiedHandlers.forEach(e=>e.exportPreferences(this._preferences)),this._modifiedHandlers.clear()}_subscribeForUpdates(){return this._store.subscribeForUpdates(e=>this._onPreferencesUpdate(e))}_onPreferencesUpdate(e){this._initPreferences(e?.preferences)}_initPreferences(e){this._preferences=e||u.create(cr),ir.getHandlers().forEach(t=>t.importPreferences(this._preferences))}}const _o=b.createSingletonProxy(ir);class Sl{load(){return $.when(this._load())}store(e){return $.when(this._store(e))}subscribeForUpdates(e){return $.when(this._subscribeForUpdates(e))}async _load(){throw new Error("Not implemented")}async _store(e){throw new Error("Not implemented")}async _subscribeForUpdates(e){}}class Nh extends Sl{get _storeId(){return`scout:uiPreferences:${window.location.pathname}`}async _load(){let e=he.getItemFromLocalStorage(this._storeId);return xe.parse(e,cr)}async _store(e){if(e){let t=xe.stringify(e);he.setItemToLocalStorage(this._storeId,t)}else he.removeItemFromLocalStorage(this._storeId)}}class gi{static PROFILE_ID_GLOBAL="global-a134390b-bfef-4b9e-a14e-425df161e768";static PROFILE_ID_BOOKMARK="bookmark-aebcacd2-ddb6-4b7f-8673-d1585701d388";objectType;_tablePreferencesMap=new Map;_ignoreTableEventsCounter=0;_columResizeTimeoutId;_tableColumnListener=this._onTableColumnEvent.bind(this);_tableTileModeListener=this._onTableTileModeChange.bind(this);_importTablePreferences(e){this._tablePreferencesMap.clear(),e?.forEach(t=>{let i=t.tableId,s=t.userPreferenceContext,r=this._computeTablePreferencesKey(i,s);this._tablePreferencesMap.set(r,t)})}_exportTablePreferences(){return[...this._tablePreferencesMap.values()]}_getOrCreateTablePreferences(e){u.assertParameter("table",e,H);let t=e.buildUuidPath(),i=e.userPreferenceContext,s=this._computeTablePreferencesKey(t,i),r=this._tablePreferencesMap.get(s);return r||(r=this.create(e),this._tablePreferencesMap.set(s,r),this._scheduleStore()),r}_computeTablePreferencesKey(e,t){return _.join("#",e,t)}_scheduleStore(){_o.scheduleStore(gi)}updateUiPreferencesEnabled(e){if(u.assertParameter("table",e,H),e.uiPreferencesEnabled){e.setInitialUiPreferences(this.createProfile(e));let t=this.get(e);this.apply(e,t,gi.PROFILE_ID_GLOBAL),this._installTableListener(e)}else this._uninstallTableListener(e)}_installTableListener(e){this._uninstallTableListener(e),e.on("columnMoved columnResized columnStructureChanged group sort aggregationFunctionChanged columnBackgroundEffectChanged",this._tableColumnListener),e.on("propertyChange:tileMode",this._tableTileModeListener)}_uninstallTableListener(e){e.off("columnMoved columnResized columnStructureChanged group sort aggregationFunctionChanged columnBackgroundEffectChanged",this._tableColumnListener),e.off("propertyChange:tileMode",this._tableTileModeListener)}get _ignoreTableEvents(){return this._ignoreTableEventsCounter>0}set _ignoreTableEvents(e){e?this._ignoreTableEventsCounter++:this._ignoreTableEventsCounter=Math.max(0,this._ignoreTableEventsCounter-1)}_onTableColumnEvent(e){this._ignoreTableEvents||(clearTimeout(this._columResizeTimeoutId),e.type==="columnResized"?this._columResizeTimeoutId=setTimeout(()=>{this.storeGlobalProfile(e.source)},750):this.storeGlobalProfile(e.source))}_onTableTileModeChange(e){this._ignoreTableEvents||this.store(e.source)}get(e){u.assertParameter("table",e,H);let t=e.buildUuidPath(),i=e.userPreferenceContext,s=this._computeTablePreferencesKey(t,i);return this._tablePreferencesMap.get(s)}getProfile(e,t){return e?.tablePreferenceProfiles?.get(t)}create(e){return u.assertParameter("table",e,H),u.create(is,{tableId:e.buildUuidPath(),userPreferenceContext:e.userPreferenceContext,tileMode:e.tileMode})}createProfile(e,t){let i=this.createColumnPreferences(e),s=t?.includeUserFilters?this.createUserFilterStates(e):null,r=this.createCustomizerData(e);return u.create(Hs,{columns:p.nullIfEmpty(i)||void 0,userFilters:p.nullIfEmpty(s)||void 0,tableCustomizerData:r||void 0})}createColumnPreferences(e){return u.assertParameter("table",e,H),e.columns.filter(t=>!t.guiOnly).map((t,i)=>u.create(Zt,{columnId:t.buildUuid(),viewIndex:i,visible:t.visibleIgnoreCompacted,width:t.width,sortOrder:t.sortIndex,sortAscending:t.sortAscending,groupingActive:t.grouped,aggregationFunctionId:t instanceof Bt?t.aggregationFunction:void 0,backgroundEffectId:t instanceof Bt?t.backgroundEffect:void 0}))}createUserFilterStates(e){return u.assertParameter("table",e,H),e.filters.filter(t=>t instanceof ft).map(t=>{for(let i of Ot.all()){let s=i.tryToDo(e,t);if(s)return s}return u.create(ri,{displayError:!1,sendError:!0}).handle(`Unable to map filter to data object [table=${e.id}, filterType=${t?.filterType}, filterLabel=${t?.createLabel()}`),null}).filter(Boolean)}createCustomizerData(e){return u.assertParameter("table",e,H),e.isCustomizable()?e.customizer.getCustomizerData():null}storeProfile(e,t,i){if(!t||!i)return;let s=this._getOrCreateTablePreferences(e),r=this.getProfile(s,t);if(r){if(i.equals(r))return}else if(t===gi.PROFILE_ID_GLOBAL&&i.equals(e.initialUiPreferences))return;s.tablePreferenceProfiles=s.tablePreferenceProfiles||new Map,s.tablePreferenceProfiles.set(t,i),this._scheduleStore()}renameProfile(e,t,i){if(!t||!i||t===i)return;let s=this.get(e),r=s?.tablePreferenceProfiles?.get(t);r&&(s.tablePreferenceProfiles.set(i,r),s.tablePreferenceProfiles.delete(t),this._scheduleStore())}removeProfile(e,t){if(!t)return;let i=this.get(e);i?.tablePreferenceProfiles?.get(t)&&(i.tablePreferenceProfiles.delete(t),this._scheduleStore())}store(e){let t=this._getOrCreateTablePreferences(e);this._storeTableTileMode(e,t)&&this._scheduleStore()}_storeTableTileMode(e,t){return t.tileMode!==e.tileMode?(t.tileMode=e.tileMode,!0):!1}storeGlobalProfile(e){this.storeProfile(e,gi.PROFILE_ID_GLOBAL,this.createProfile(e))}clearGlobalProfile(e){this.removeProfile(e,gi.PROFILE_ID_GLOBAL)}apply(e,t,i,s){if(t){u.assertParameter("table",e,H),this._ignoreTableEvents=!0;try{this._applyTablePreferencesInternal(e,t,s);let r=this.getProfile(t,i);r&&this._applyTablePreferenceProfileInternal(e,r,s)}finally{this._ignoreTableEvents=!1}}}applyProfile(e,t,i){if(t){u.assertParameter("table",e,H),this._ignoreTableEvents=!0;try{this._applyTablePreferenceProfileInternal(e,t,i)}finally{this._ignoreTableEvents=!1}}}_applyTablePreferencesInternal(e,t,i){e.setTileMode(t.tileMode)}_applyTablePreferenceProfileInternal(e,t,i){this._applyCustomizerData(e,t.tableCustomizerData,i),this._applyColumnPreferences(e,t.columns,i),this._applyUserFilterStates(e,t.userFilters,i)}_applyCustomizerData(e,t,i){e.isCustomizable()&&e.customizer.setCustomizerData(t)}_applyColumnPreferences(e,t,i){let s=new Map(p.ensure(t).map(o=>[o.columnId,o])),r=e.columns.filter(o=>!o.guiOnly).sort((o,l)=>{let a=s.get(o.buildUuid())?.viewIndex??1/0,d=s.get(l.buildUuid())?.viewIndex??1/0;return a-d});r.forEach(o=>this._applyColumnPreferencesToColumn(o,s.get(o.buildUuid()))),e.setColumns(r)}_applyColumnPreferencesToColumn(e,t){t&&(e.setVisible(t.visible,!1),e.width=t.width,e.sortIndex=t.sortOrder,e.sortAscending=t.sortAscending,e.sortActive=e.sortIndex>=0,e.grouped=t.groupingActive,e instanceof Bt&&(e.setAggregationFunction(t.aggregationFunctionId),e.setBackgroundEffect(t.backgroundEffectId)))}_applyUserFilterStates(e,t,i){i?.applyUserFilters&&e.applyUserFilterStates(t)}}const je=b.createSingletonProxy(gi);ir.registerHandler(gi,{importPreferences:n=>{je._importTablePreferences(n.tablePreferences)},exportPreferences:n=>{n.tablePreferences=je._exportTablePreferences()}});class xl extends I{preselectedDate;selectedDate;dateFormat;viewDate;allowedDates;touch;currentMonth;months;$scrollable;swiped;_showWeekendSeparator;_boxWidth;_$header;constructor(){super(),this.preselectedDate=null,this.selectedDate=null,this.dateFormat=null,this.viewDate=null,this.allowedDates=[],this.currentMonth=null,this.$scrollable=null,this.months=[],this._showWeekendSeparator=!0}_init(e){super._init(e),this._setDateFormat(this.dateFormat),this._showWeekendSeparator=this.dateFormat.symbols.firstDayOfWeek===1}_render(){this.$container=this.$parent.appendDiv("date-picker").toggleClass("touch-only",w.get().supportsOnlyTouch()),this.htmlComp=x.install(this.$container,this.session),this._$header=this._append$Header(),this._$header.find(".date-picker-left-y, .date-picker-left-m, .date-picker-right-m, .date-picker-right-y").on("mousedown",this._onNavigationMouseDown.bind(this)),this.$container.appendDiv("date-picker-separator"),this.$scrollable=this.$container.appendDiv("date-picker-scrollable"),this._registerSwipeHandlers()}_setDateFormat(e){e||(e=this.session.locale.dateFormatPatternDefault),e=St.ensure(this.session.locale,e),this._setProperty("dateFormat",e)}prependMonth(e){let t=this.months.slice();p.insert(t,e,0),this.setMonths(t)}appendMonth(e){let t=this.months.slice();t.push(e),this.setMonths(t)}resetMonths(e){e=e||this.viewDate;let t=S.shift(e,0,-1,0),i=S.shift(e,0,1,0);this.setMonths([t,e,i])}setMonths(e){e=p.ensure(e);let t=e.map(i=>{let s;i instanceof Date?s=i:s=i.viewDate;let r=this._findMonthByViewDate(s);return r||{rendered:!1,viewDate:s,$container:void 0}});this.rendered&&this.months.forEach(i=>{t.indexOf(i)<0&&i.rendered&&i.$container.remove()}),this.setProperty("months",t)}_renderMonths(){this.months.forEach(t=>{t.rendered?this._layoutWeekendSeparator(t):(this._renderMonth(t),this.currentMonth&&S.compare(t.viewDate,this.currentMonth.viewDate)<0&&t.$container.insertBefore(this.currentMonth.$container))});let e=this.months.length*this._boxWidth;this.$scrollable.width(e),this.currentMonth&&this.$scrollable.cssLeft(this._scrollableLeftForMonth(this.currentMonth))}_findMonthByViewDate(e){return p.find(this.months,t=>S.compareMonths(t.viewDate,e)===0)}_scrollableLeftForMonth(e){let t=C.insets(this.$scrollable),i=C.margins(e.$container);return-1*(e.$container.position().left-i.left-t.left)}_renderMonth(e){if(e.rendered)return;let t=this.$parent.makeDiv("date-picker-month-box");this._showWeekendSeparator&&(e.$weekendSeparator=t.appendDiv("date-picker-weekend-separator")),this._build$DateBox(e.viewDate).appendTo(t),t.on("wheel",this._onMouseWheel.bind(this)).appendTo(this.$scrollable),this._boxWidth||(this._boxWidth=t.width()),t.width(this._boxWidth),e.$container=t,e.rendered=!0}setViewDate(e,t){b.equals(this.viewDate,e)||(this._setProperty("viewDate",e),this.rendered&&this._renderViewDate(t))}_renderViewDate(e){let t=this._findMonthByViewDate(this.viewDate),i=this._scrollableLeftForMonth(t);this.currentMonth||this.revalidateLayoutTree(),this.currentMonth=t,this._updateHeader(this.viewDate),e=u.nvl(e,!0),e?this.$scrollable.stop(!0).animate({left:i},300,()=>{this.resetMonths()}):(this.$scrollable.cssLeft(i),this.resetMonths())}_layoutWeekendSeparators(){this.months.forEach(e=>this._layoutWeekendSeparator(e))}_layoutWeekendSeparator(e){if(!e.$weekendSeparator)return;let t=this.$container.find(".date-picker-weekdays").first().children();if(t.length<6)return;let i=t.eq(4),s=t.eq(5),r=C.position(i).x+C.size(i,{includeMargin:!0}).width,l=C.position(s).x-r,a=e.$weekendSeparator.cssBorderWidthX(),d=Math.floor(r+l/2-a);e.$weekendSeparator.cssLeft(d)}preselectDate(e,t){this.showDate(e,t),e&&this.setSelectedDate(null),this.setPreselectedDate(e)}setPreselectedDate(e){this.setProperty("preselectedDate",e)}_renderPreselectedDate(){if(!this.currentMonth)return;this.currentMonth.$container.find(".date-picker-day").each((t,i)=>{let s=h()(i);s.removeClass("preselected"),S.isSameDay(this.preselectedDate,s.data("date"))&&s.addClass("preselected")})}selectDate(e,t){this.showDate(e,t),e&&this.setPreselectedDate(null),this.setSelectedDate(e)}setSelectedDate(e){this.setProperty("selectedDate",e)}_renderSelectedDate(){if(!this.currentMonth)return;this.currentMonth.$container.find(".date-picker-day").each((t,i)=>{let s=h()(i);s.removeClass("selected"),S.isSameDay(this.selectedDate,s.data("date"))&&s.addClass("selected")})}showDate(e,t){let i=0;this.viewDate&&(i=S.compareMonths(e,this.viewDate)),this.currentMonth&&i?i<0?this.prependMonth(e):this.appendMonth(e):this.currentMonth?this.resetMonths(e):this.setMonths([e]),this.setViewDate(e,t)}shiftViewDate(e,t,i){let s=this.viewDate;s=S.shift(s,e,t,i),this.showDate(s)}shiftSelectedDate(e,t,i){let s=this.preselectedDate;this.selectedDate&&(this.allowedDates.length>0?s=this._findNextAllowedDate(e,t,i):s=S.shift(this.selectedDate,e,t,i)),s&&this.selectDate(s,!0)}_findNextAllowedDate(e,t,i){let s,r,o=e+t+i,l=o>0?1:-1,a=this.selectedDate||S.trunc(new Date);if(e!==0?a=S.shift(a,e,0,0):t!==0&&(a=S.shift(a,0,t,0)),l===1){for(s=0;s<this.allowedDates.length;s++)if(r=this.allowedDates[s],S.compare(a,r)<0)return r}else if(l===-1){for(s=this.allowedDates.length-1;s>=0;s--)if(r=this.allowedDates[s],S.compare(a,r)>0)return r}return null}_isDateAllowed(e){if(this.allowedDates.length===0)return!0;let t=S.trunc(e).getTime();return this.allowedDates.some(i=>i.getTime()===t)}_build$DateBox(e){let t,i,s,r,o,l,a=new Date,d=new Date(e),c=this.$container.makeDiv("date-picker-month").data("viewDate",e),f=c.appendDiv("date-picker-weekdays");this.dateFormat.symbols.weekdaysShortOrdered.map(y=>y.length>2?y.substr(0,2):y).forEach(y=>f.appendDiv("date-picker-weekday",y.toUpperCase()));let g;for(let y=0;y<42;y++){d.setDate(d.getDate()-1);let v=new Date(d.getFullYear(),e.getMonth(),0).getDate()-d.getDate();if(d.getDay()===0&&d.getMonth()!==e.getMonth()&&v>1)break}for(i=0;i<42;i++)i%7===0&&(g=c.appendDiv("date-picker-week")),d.setDate(d.getDate()+1),o=d.getDate(),d.getDay()===6||d.getDay()===0?(t=d.getMonth()!==e.getMonth()?" date-picker-out-weekend":" date-picker-weekend",this._showWeekendSeparator&&d.getDay()===6&&(t+=" date-picker-day-weekend-separator")):t=d.getMonth()!==e.getMonth()?" date-picker-out":"",S.isSameDay(d,a)&&(t+=" date-picker-now"),S.isSameDay(this.selectedDate,d)&&(t+=" selected"),S.isSameDay(this.preselectedDate,d)&&(t+=" preselected"),o>9&&o<20&&(t+=" ten"),r=this._isDateAllowed(d),r||(t+=" disabled"),s=o<=9?"0"+o:o,l=g.appendDiv("date-picker-day"+t).data("dayInMonth",o).data("date",new Date(d)),l.appendSpan("text",s),r&&l.on("click",this._onDayClick.bind(this));return c}_append$Header(){return this.$container.appendElement('<div class="date-picker-header"> <div class="date-picker-left-y" data-shift="-12"></div> <div class="date-picker-left-m" data-shift="-1"></div> <div class="date-picker-right-y" data-shift="12"></div> <div class="date-picker-right-m" data-shift="1"></div> <div class="date-picker-header-month"> </div></div>').toggleClass("touch",this.touch)}_updateHeader(e){this._$header.find(".date-picker-header-month").text(this._createHeaderText(e))}_createHeaderText(e){return this.dateFormat.symbols.months[e.getMonth()]+" "+e.getFullYear()}_registerSwipeHandlers(){let e,t,i=o=>(this.$scrollable.stop(!0),e=S.shift(this.viewDate,0,-1,0),t=S.shift(this.viewDate,0,1,0),this.setMonths([e,this.viewDate,t]),this.swiped=!1,!0),s=o=>{let l=this.$container.width()-this.$scrollable.outerWidth(),a=Math.max(Math.min(o.newLeft,0),l);return a!==o.originalLeft&&this.$scrollable.cssLeft(a),a},r=o=>{let l=5,a=this.viewDate;o.deltaX<-l?a=t:o.deltaX>l&&(a=e),this.viewDate!==a&&(this.swiped=!0,this.setViewDate(a))};Ve.onSwipe(this.$scrollable,"datepickerDrag",i,s,r)}_onNavigationMouseDown(e){let i=h()(e.currentTarget).data("shift");this.shiftViewDate(0,i,0)}_onDayClick(e){if(this.swiped)return;let i=h()(e.currentTarget).data("date");this.selectDate(i),this.trigger("dateSelect",{date:i})}_onMouseWheel(e){let t=e.originalEvent,s=(t.deltaY|t.deltaX)<0?-1:1;this.shiftViewDate(0,s,0),t.preventDefault()}}class Pl extends _e{field;picker;constructor(){super(),this.windowPaddingX=0,this.windowPaddingY=0}_init(e){e.scrollType=e.scrollType||"layoutAndPosition",e.withFocusContext=!1,super._init(e),this.picker=u.create(xl,{parent:this,dateFormat:e.dateFormat,allowedDates:e.allowedDates})}_createLayout(){return new Vh(this)}_render(){this.$container=this.$parent.appendDiv("popup date-picker-popup"),this.$container.toggleClass("alternative",this.field.fieldStyle===A.FieldStyle.ALTERNATIVE),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout()),this.htmlComp.validateRoot=!0,this.findDesktop().adjustOverlayOrder(this),this.picker.render()}getDatePicker(){return this.picker}_isMouseDownOnAnchor(e){let t=e.target;return this.field.$dateField.isOrHas(t)||this.field.$dateFieldIcon.isOrHas(t)||this.field.$dateClearIcon&&this.field.$dateClearIcon.isOrHas(t)}}class Vh extends xi{constructor(e){super(e),this.doubleCalcPrefSize=!1}layout(e){let t,i=this.popup.htmlComp,s=this.popup.picker.htmlComp;super.layout(e),t=i.size().subtract(i.insets()).subtract(s.margins()),s.setSize(t),this.popup.htmlComp.layouted&&this.popup.position(),this.popup.getDatePicker()._layoutWeekendSeparators()}preferredLayoutSize(e,t){let i,s=this.popup.htmlComp,r=this.popup.picker.htmlComp;return i=r.prefSize().add(s.insets()).add(r.margins()),i}}class Wh extends go{_init(e){super._init(e),this._field.on("acceptInput",this._onFieldAcceptInput.bind(this)),this.addCssClass("date-picker-touch-popup")}_initWidget(e){this._widget=u.create(xl,{parent:this,dateFormat:e.dateFormat,allowedDates:e.allowedDates})}_render(){super._render(),this._field.$container.addClass("date")}_onMouseDownOutside(e){this._acceptInput()}getDatePicker(){return this._widget}_createLayout(){return new zh(this)}_onFieldAcceptInput(e){this._touchField.setDisplayText(e.displayText),this._touchField.setErrorStatus(e.errorStatus),(e.errorStatus?e.errorStatus.containsStatus(di):!1)||this._touchField.setValue(e.value),this._touchField._triggerAcceptInput(e.whileTyping)}_acceptInput(){this._field.acceptDate(),this.close()}}class zh extends vl{constructor(e){super(e)}layout(e){super.layout(e),this.popup.getDatePicker()._layoutWeekendSeparators()}}class bo{objectType;displayParent;session;constructor(e){this.displayParent=e.displayParent,this.session=e.session}registerAndRender(e){u.assertProperty(e,"displayParent"),this._render(e,!0)}unregisterAndRemove(e){e&&(this._unregister(e),this._remove(e))}_render(e,t){if(e.displayParent||e._setProperty("displayParent",this.displayParent),e.rendered)return;if(t&&this._register(e),this.displayParent.acceptView){if(!this.displayParent.acceptView(e))return}else if(!this.acceptView(e))return;let i;this.displayParent instanceof j&&this.displayParent.isPopupWindow()?i=this.displayParent.popupWindow.$container:i=this.session.desktop.$container,e.setTrackFocus(!0),e.render(i),this.displayParent.inFront()||e.detach()}_remove(e){e.remove()}acceptView(e){return this.displayParent.rendered}_register(e){}_unregister(e){}_registerChild(e,t,i){const s=p.ensure(this.displayParent[t]);if(s.includes(e))return;e.one("destroy",o=>this._unregisterChild(e,t));let r;i!==void 0?(r=[...s],p.insert(r,e,i)):r=[...s,e],this.displayParent._setProperty(t,r)}_unregisterChild(e,t){const i=this.displayParent[t];if(!i?.length)return;let s=i.filter(r=>r!==e);p.equals(i,s)||this.displayParent._setProperty(t,s)}}class Pi extends I{bodyAnimating;collapsed;collapsible;title;titleHtmlEnabled;titleSuffix;header;headerFocusable;headerVisible;body;collapseStyle;htmlHeader;htmlFooter;iconId;icon;$header;$footer;$collapseIcon;$collapseBorderLeft;$collapseBorderRight;$title;$titleSuffix;constructor(){super(),this.bodyAnimating=!1,this.collapsed=!1,this.collapsible=!0,this.title=null,this.titleHtmlEnabled=!1,this.titleSuffix=null,this.header=null,this.headerFocusable=!1,this.headerVisible=!0,this.body=null,this.$container=null,this.$header=null,this.$footer=null,this.$collapseIcon=null,this.$collapseBorderLeft=null,this.$collapseBorderRight=null,this.collapseStyle=Pi.CollapseStyle.LEFT,this.htmlComp=null,this.htmlHeader=null,this.htmlFooter=null,this.iconId=null,this.icon=null,this._addWidgetProperties(["header","body"])}static CollapseStyle={LEFT:"left",RIGHT:"right",BOTTOM:"bottom"};_init(e){super._init(e),this.resolveTextKeys(["title","titleSuffix"]),this.resolveIconIds(["iconId"]),this._setBody(this.body),this._setHeader(this.header)}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.$bindTarget=()=>this.$header,this.keyStrokeContext.registerKeyStrokes([new Kh(this)])}_render(){this.$container=this.$parent.appendDiv("group"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Gh(this)),this._renderHeader(),this.$collapseIcon=this.$header.appendDiv("group-collapse-icon"),this.$footer=this.$container.appendDiv("group-footer"),this.$collapseBorderLeft=this.$footer.appendDiv("group-collapse-border"),this.$collapseBorderRight=this.$footer.appendDiv("group-collapse-border"),this.htmlFooter=x.install(this.$footer,this.session),this.$footer.on("mousedown",this._onFooterMouseDown.bind(this)),this._addAriaFieldDescription()}_addAriaFieldDescription(){T.addHiddenDescriptionAndLinkToElement(this.$header,this.id+"-func-desc",this.session.text("ui.AriaGroupDescription"))}_renderProperties(){super._renderProperties(),this._renderIconId(),this._renderTitle(),this._renderTitleSuffix(),this._renderHeaderVisible(),this._renderHeaderFocusable(),this._renderCollapsed(),this._renderCollapseStyle(),this._renderCollapsible()}_remove(){this.$header=null,this.$title=null,this.$titleSuffix=null,this.$footer=null,this.$collapseIcon=null,this.$collapseBorderLeft=null,this.$collapseBorderRight=null,this._removeIconId(),super._remove()}_renderEnabled(){super._renderEnabled(),this.$header.setTabbable(this.enabledComputed)}setIconId(e){this.setProperty("iconId",e)}_renderIconId(){let e=this.iconId||"";if(!e){this._removeIconId(),this._updateIconStyle();return}if(this.icon){this.icon.setIconDesc(e),this._updateIconStyle();return}this.icon=u.create(Es,{parent:this,iconDesc:e,prepend:!0}),this.icon.one("destroy",()=>{this.icon=null}),this.icon.render(this.$header),this._updateIconStyle()}_updateIconStyle(){let e=!!this.title;this.get$Icon().toggleClass("with-title",e),this.get$Icon().addClass("group-icon"),this._renderCollapseStyle()}get$Icon(){return this.icon?this.icon.$container:h()()}_removeIconId(){this.icon&&this.icon.destroy()}setHeader(e){this.setProperty("header",e)}_setHeader(e){this._setProperty("header",e)}setHeaderFocusable(e){this.setProperty("headerFocusable",e)}_renderHeaderFocusable(){this.$header.toggleClass("unfocusable",!this.headerFocusable)}setTitle(e){this.setProperty("title",e)}_renderTitle(){this.$title&&(this.titleHtmlEnabled?this.$title.htmlOrNbsp(this.title):this.$title.textOrNbsp(this.title),this._updateIconStyle())}setTitleSuffix(e){this.setProperty("titleSuffix",e)}_renderTitleSuffix(){this.$titleSuffix&&this.$titleSuffix.text(this.titleSuffix||"")}setHeaderVisible(e){this.setProperty("headerVisible",e)}_renderHeaderVisible(){this.$header.setVisible(this.headerVisible),this._renderCollapsible(),this.invalidateLayoutTree()}setBody(e){this.setProperty("body",e)}_setBody(e){e||(e=u.create(Uh,{parent:this})),this._setProperty("body",e)}_createLoadingSupport(){return new Ut({widget:this,$container:()=>this.$header})}_renderHeader(){this.$header&&(this.$header.remove(),this._removeIconId()),this.header?(this.header.render(),this.$header=this.header.$container.addClass("group-header").addClass("custom-header-widget").prependTo(this.$container),this.htmlHeader=this.header.htmlComp):(this.$header=this.$container.prependDiv("group-header").unfocusable().addClass("prevent-initial-focus"),this.$title=this.$header.appendDiv("group-title"),this.$titleSuffix=this.$header.appendDiv("group-title-suffix"),Y.installForEllipsis(this.$title,{parent:this}),this.htmlHeader=x.install(this.$header,this.session),this.rendering||(this._renderIconId(),this._renderTitle(),this._renderTitleSuffix())),T.role(this.$header,"button"),T.linkElementWithLabel(this.$header,this.$title),this.$header.on("mousedown",this._onHeaderMouseDown.bind(this)),this.invalidateLayoutTree()}_renderBody(){this.body.render(),this.body.$container.insertAfter(this.$header),this.body.$container.addClass("group-body"),T.linkElementWithLabel(this.body.$container,this.$title),T.linkElementWithControls(this.$header,this.body.$container),this.body.invalidateLayoutTree()}getFocusableElement(){return this.rendered?this.$header:null}toggleCollapse(){this.setCollapsed(!this.collapsed&&this.collapsible)}setCollapsed(e){this.setProperty("collapsed",e)}_renderCollapsed(){this.$container.toggleClass("collapsed",this.collapsed),this.$collapseIcon.toggleClass("collapsed",this.collapsed),T.expanded(this.$header,!this.collapsed),!this.collapsed&&!this.bodyAnimating&&this._renderBody(),this.rendered?this.resizeBody():this.collapsed&&this.body.remove(),this.invalidateLayoutTree()}setCollapsible(e){this.setProperty("collapsible",e)}_renderCollapsible(){this.$container.toggleClass("collapsible",this.collapsible),this.$header.toggleClass("disabled",!this.collapsible),T.disabled(this.$header,!this.collapsible||null),this.$footer.setVisible(this.collapseStyle===Pi.CollapseStyle.BOTTOM&&(this.headerVisible||this.collapsible)),this.$collapseIcon.setVisible(this.collapsible),this.invalidateLayoutTree()}setCollapseStyle(e){this.setProperty("collapseStyle",e)}_renderCollapseStyle(){if(this.$header.toggleClass("collapse-right",this.collapseStyle===Pi.CollapseStyle.RIGHT),this.$container.toggleClass("collapse-bottom",this.collapseStyle===Pi.CollapseStyle.BOTTOM),this.collapseStyle===Pi.CollapseStyle.RIGHT)this.$collapseIcon.appendTo(this.$header);else if(this.collapseStyle===Pi.CollapseStyle.LEFT)this.$collapseIcon.prependTo(this.$header);else if(this.collapseStyle===Pi.CollapseStyle.BOTTOM){let e=this.body.$container?this.body.$container:this.$header;this.$footer.insertAfter(e),this.$collapseIcon.insertAfter(this.$collapseBorderLeft)}this._renderCollapsible(),this.invalidateLayoutTree()}_onHeaderMouseDown(e){this.collapsible&&(!this.header||this.collapseStyle!==Pi.CollapseStyle.BOTTOM)&&this.setCollapsed(!this.collapsed&&this.collapsible)}_onFooterMouseDown(e){this.collapsible&&this.setCollapsed(!this.collapsed&&this.collapsible)}resizeBody(){this.animateToggleCollapse().done(()=>{this.bodyAnimating||(this.collapsed&&this.body.remove(),this.invalidateLayoutTree())})}animateToggleCollapse(){let e=C.cssSize(this.body.$container),t=C.margins(this.body.$container),i=C.paddings(this.body.$container),s,r,o;return this.collapsed?(s=0,r=new We,o=new We):(s=this.body.htmlComp.prefSize({widthHint:e.width}).height,this.body.htmlComp.setSize(new F(this.body.$container.outerWidth(),s)),this.bodyAnimating?(this.body.$container.cssMarginY("").cssPaddingY(""),r=C.margins(this.body.$container),o=C.paddings(this.body.$container)):(e.height=0,t=new We,i=new We,r=C.margins(this.body.$container),o=C.paddings(this.body.$container))),this.bodyAnimating=!0,this.collapsed&&this.$container.addClass("collapsing"),this.body.$container.stop(!0).cssHeight(e.height).cssMarginTop(t.top).cssMarginBottom(t.bottom).cssPaddingTop(i.top).cssPaddingBottom(i.bottom).animate({height:s,marginTop:r.top,marginBottom:r.bottom,paddingTop:o.top,paddingBottom:o.bottom},{duration:350,progress:()=>{this.trigger("bodyHeightChange"),this.revalidateLayoutTree()},complete:()=>{this.bodyAnimating=!1,this.body.rendered&&(this.body.$container.cssMarginY(""),this.body.$container.cssPaddingY("")),this.rendered&&this.$container.removeClass("collapsing"),this.trigger("bodyHeightChangeDone")}}).promise()}}class Uh extends I{_render(){this.$container=this.$parent.appendDiv("group"),this.htmlComp=x.install(this.$container,this.session)}}class Af extends K{constructor(){super(),this._addRemoteProperties(["collapsed"])}}class Gh extends ne{group;constructor(e){super(),this.group=e}layout(e){let t=this.group.htmlComp,i=t.availableSize().subtract(t.insets()),s=this.group.htmlHeader,r=s.prefSize({widthHint:i.width});r.width=i.width,r=r.subtract(s.margins()),s.setSize(r);let o=this.group.htmlFooter;if(o.isVisible()){let d=o.prefSize({includeMargin:!1,useCssSize:!0});d.width=i.width,o.setSize(d.subtract(o.margins()))}if(this.group.collapsed||this.group.bodyAnimating||!this.group.body.rendered||!this.group.body.visible)return;let l=this.group.body.htmlComp,a=i.subtract(l.margins());a.height-=r.height,o.isVisible()&&(a.height-=o.prefSize(!0).height),l.setSize(a)}invalidate(e){this.group.body.htmlComp&&this.group.bodyAnimating&&e&&e.isDescendantOf(this.group.htmlComp)&&(this.group.body.$container.stop(),this.group.resizeBody())}preferredLayoutSize(e,t){t=t||{};let i,s=this.group.htmlComp,r=this.group.htmlHeader,o=this.group.body.htmlComp,l=this.group.htmlFooter;return t.heightHint=null,this.group.bodyAnimating?i=o.size(!0):this.group.collapsed||!this.group.body.rendered||!this.group.body.visible?i=new F(0,0):i=o.prefSize(t).add(o.margins()),i=i.add(s.insets({includeMargin:!0})),i.height+=r.prefSize(t).add(r.margins()).height,l.isVisible()&&(i.height+=l.prefSize({includeMargin:!0,useCssSize:!0}).height),i}}class Kh extends B{constructor(e){super(),this.field=e,this.which=[m.SPACE]}handle(e){this.field.toggleCollapse()}}class Es extends I{autoFit;iconDesc;image;prepend;constructor(){super(),this.autoFit=!1,this.iconDesc=null,this.image=null,this.prepend=!1}_init(e){super._init(e),this._setIconDesc(this.iconDesc)}_render(){this._renderIconDesc()}setIconDesc(e){this.setProperty("iconDesc",e)}_setIconDesc(e){e=Di.ensure(e),this._setProperty("iconDesc",e)}_renderIconDesc(){this._removeFontIcon(),this._removeImageIcon(),!this.iconDesc||this.iconDesc.isFontIcon()?this._renderFontIcon():this._renderImageIcon(),this.rendering||this._renderProperties(),this.invalidateLayoutTree()}_renderFontIcon(){this.$container=this.$parent.appendIcon(this.iconDesc),this.prepend&&this.$container.prependTo(this.$parent),this.htmlComp=x.install(this.$container,this.session)}_removeFontIcon(){this.$container&&(this.$container.remove(),this.$container=null)}_renderImageIcon(){this.image||(this.image=u.create(Dl,{parent:this,imageUrl:this.iconDesc.iconUrl,cssClass:"icon image-icon",autoFit:this.autoFit,prepend:this.prepend}),this.image.render(this.$parent),this.image.one("destroy",()=>{this.image=null}),this.image.on("load error",e=>{this.trigger(e.type,e)}),this.$container=this.image.$container,this.htmlComp=this.image.htmlComp)}_removeImageIcon(){this.image&&(this.image.destroy(),this.image=null)}setAutoFit(e){this.setProperty("autoFit",e),this.image&&this.image.setAutoFit(e)}}class Di{iconType;font;iconCharacter;iconUrl;altText;constructor(){this.iconType=null,this.font=null,this.iconCharacter=null,this.iconUrl=null,this.altText=""}static IconType={FONT_ICON:0,BITMAP:1};static DEFAULT_FONT="scoutIcons";cssClass(){return this.isFontIcon()&&this.font!==Di.DEFAULT_FONT?"font-"+this.font:""}appendCssClass(e){let t=this.cssClass();return t.length>0?e+" "+t:e}isFontIcon(){return this.iconType===Di.IconType.FONT_ICON}isBitmap(){return this.iconType===Di.IconType.BITMAP}static ensure(e){return!e||e instanceof Di?e:q.parseIconId(e)}}class Dl extends I{autoFit;imageUrl;prepend;altText;constructor(){super(),this.autoFit=!1,this.imageUrl=null,this.prepend=!1,this.altText=""}_render(){this.$container=this.$parent.makeElement("<img>","image").attr("alt",this.altText).addDeviceClass().on("load",this._onImageLoad.bind(this)).on("error",this._onImageError.bind(this)),this.prepend?this.$container.prependTo(this.$parent):this.$container.appendTo(this.$parent),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new jh(this)),this.htmlComp.pixelBasedSizing=!1}_renderProperties(){super._renderProperties(),this._renderImageUrl(),this._renderAutoFit()}_remove(){super._remove(),this.htmlComp=null}setImageUrl(e){this.setProperty("imageUrl",e)}setAltText(e){this.setProperty("altText",e)}_renderImageUrl(){this.$container.attr("src",this.imageUrl),this.imageUrl||this.$container.addClass("empty").removeClass("broken")}setAutoFit(e){this.setProperty("autoFit",e)}_renderAutoFit(){this.$container.toggleClass("autofit",this.autoFit)}_onImageLoad(e){this.rendered&&(this._ensureImageLayout(),this.$container.removeClass("empty broken"),this.invalidateLayoutTree(),this.trigger("load"))}_ensureImageLayout(){w.get().isChrome()&&(this.$container.addClass("chrome-fix"),setTimeout(()=>{this.rendered&&this.$container.removeClass("chrome-fix")}))}_onImageError(e){this.rendered&&(this.$container.addClass("empty broken"),this.invalidateLayoutTree(),this.trigger("error"))}}class jh extends ne{image;constructor(e){super(),this.image=e}preferredLayoutSize(e,t){let i=e[0];if(i&&i.complete&&i.naturalWidth>0&&i.naturalHeight>0){let s=i.naturalHeight,r=i.naturalWidth;return t.widthHint>0&&t.widthHint<i.naturalWidth?(s=t.widthHint/i.naturalWidth*i.naturalHeight,r=t.widthHint):t.heightHint>0&&t.heightHint<i.naturalHeight&&(s=t.heightHint,r=t.heightHint/i.naturalHeight*i.naturalWidth),new F(r,s)}return super.preferredLayoutSize(e,t)}}class qh extends I{status;closable;htmlEnabled;$content;$messageText;$closer;_icon;constructor(){super(),this.status=E.info(),this.closable=!1,this.htmlEnabled=!1,this._icon=null}_init(e){super._init(e),(e.severity||e.message||e.iconId)&&(this.status=new E({severity:u.nvl(e.severity,this.status.severity),message:u.nvl(e.message,this.status.message),iconId:u.nvl(e.iconId,this.status.iconId)})),this._resolveStatusTextKeys(["message"]),this._resolveStatusIconIds(["iconId"]),this._setStatus(this.status)}_resolveStatusTextKeys(e){de.resolveTextProperties(this.status,e,this.session)}_resolveStatusIconIds(e){q.resolveIconProperties(this.status,e)}_render(){this.$container=this.$parent.appendDiv("notification alternative"),this.$content=this.$container.appendDiv("notification-content"),this.$messageText=this.$content.appendDiv("notification-message"),this.htmlComp=x.install(this.$container,this.session)}_remove(){super._remove(),this._removeCloser(),this._removeIcon()}_renderProperties(){super._renderProperties(),this._renderStatus(),this._renderClosable()}setStatus(e){this.setProperty("status",e)}_setStatus(e){this.rendered&&this._removeStatus(),e=E.ensure(e)||E.info(),this._setProperty("status",e)}_removeStatus(){this.status&&this.$container.removeClass(this.status.cssClass())}_renderStatus(){this.status&&(this.$container.addClass(this.status.cssClass()),this._renderIconId()),this._renderMessage()}_renderMessage(){let e=this.status.message||"";this.htmlEnabled?(this.$messageText.html(e),this.$messageText.find(".app-link").on("click",this._onAppLinkAction.bind(this))):this.$messageText.html(_.nl2br(e)),this.invalidateLayoutTree()}setIconId(e){this.status||(this.status=E.info()),this.status.iconId=e,this.rendered&&this._renderStatus()}_renderIconId(){let e=this.status&&!!this.status.iconId;this.$container.toggleClass("has-icon",e),this.$container.toggleClass("no-icon",!e),e?this._renderIcon():this._removeIcon()}_renderIcon(){if(this._icon){this._icon.setIconDesc(this.status.iconId);return}this._icon=u.create(Es,{parent:this,iconDesc:this.status.iconId,prepend:!0}),this._icon.one("destroy",()=>{this._icon=null}),this._icon.render(),this._icon.$container.addClass("notification-icon")}_removeIcon(){this._icon&&this._icon.destroy()}setClosable(e){this.setProperty("closable",e)}_renderClosable(){this.$container.toggleClass("closable",this.closable),this.$content.toggleClass("closable",this.closable),this.closable?this._renderCloser():this._removeCloser()}_removeCloser(){this.$closer&&(this.$closer.remove(),this.$closer=null)}_renderCloser(){this.$closer||(this.$closer=this.$content.appendDiv("closer").on("click",this._onCloseIconClick.bind(this)),T.role(this.$closer,"button"),T.label(this.$closer,this.session.text("ui.Close")))}_onCloseIconClick(e){this.removing||this.trigger("close")}_onAppLinkAction(e){let i=h()(e.delegateTarget).data("ref");this.triggerAppLinkAction(i)}triggerAppLinkAction(e){this.trigger("appLinkAction",{ref:e})}}class Yh extends K{_onWidgetClose(e){this._send("close")}_onWidgetAppLinkAction(e){this._send("appLinkAction",{ref:e.ref})}_onWidgetEvent(e){e.type==="close"?this._onWidgetClose(e):e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):super._onWidgetEvent(e)}}const $e={filterAccordingToSelection(n,e,t,i,s){let r=[],{notAllowedTypes:o}=s||{};i===Ft.MENU_BAR?r=[n+".EmptySpace",n+".SingleSelection",n+".MultiSelection"]:i===Ft.CONTEXT_MENU?r=[n+".SingleSelection",n+".MultiSelection"]:i===Ft.HEADER&&(r=[n+".Header"]),r.indexOf(n+".SingleSelection")>-1&&e!==1&&p.remove(r,n+".SingleSelection"),r.indexOf(n+".MultiSelection")>-1&&e<=1&&p.remove(r,n+".MultiSelection"),o=p.ensure(o);let l=[];return n=n+".",o.forEach(a=>{a.slice(0,n.length)!==n&&(a=n+a),l.push(a)}),$e.filter(t,r,h().extend({},s,{notAllowedTypes:l}))},filter(n,e,t){if(!n)return;e=p.ensure(e);let{onlyVisible:i,enableDisableKeyStrokes:s,notAllowedTypes:r,defaultMenuTypes:o}=t||{};r=p.ensure(r),o=p.ensure(o);let l=[],a=0;return n.forEach(d=>{let c=d.childActions;if(c.length>0){if(c=$e.filter(c,e,t),c.length===0){$e._enableDisableMenuKeyStroke(d,s,!0);return}}else if(!$e._checkType(d,e,o)||r.length!==0&&$e._checkType(d,r,o)){$e._enableDisableMenuKeyStroke(d,s,!0);return}if(i&&!d.visible){$e._enableDisableMenuKeyStroke(d,s,!0);return}d.separator&&a++,$e._enableDisableMenuKeyStroke(d,s,!1),l.push(d)}),a===l.length?[]:l},updateSeparatorVisibility(n){if(n=p.ensure(n),n=n.filter(i=>i.visible||i.separator),n.length===0)return;let e=!1,t=!1;n.forEach((i,s)=>{if(!i.ellipsis){if(!i.separator){e=!0;return}t=n[s+1]&&!n[s+1].separator&&!n[s+1].ellipsis,!e||!t?i.visibleOrig===void 0&&(i.visibleOrig=i.visible,i.setVisible(!1)):i.visibleOrig!==void 0&&(i.setVisible(i.visibleOrig),i.visibleOrig=void 0)}})},checkType(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return e=p.ensure(e),n.childActions.length>0?$e.filter(n.childActions,e,{defaultMenuTypes:t}).length>0:$e._checkType(n,e,t)},_enableDisableMenuKeyStroke(n,e,t){e&&(n.excludedByFilter=t)},_checkType(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(!e||e.length===0)return!1;let i=p.ensure(n.menuTypes);t=p.ensure(t),i.length===0&&(i=t);for(let s=0;s<e.length;s++)if(i.indexOf(e[s])>-1)return!0;return!1},createEllipsisMenu(n){return u.create(yo,n)},moveMenuIntoEllipsis(n,e){n.remove(),n._setOverflown(!0),n.overflowMenu=e;let t=e.childActions.slice();t.unshift(n),e.setChildActions(t)},removeMenuFromEllipsis(n,e){n._setOverflown(!1),n.overflowMenu=null,n.rendered||n.render(e)},flatTopLevelActions(n){return p.flatMap(n,e=>e instanceof Qh?e.childActions:[e])},insertMenus(n,e){if(e=p.ensure(e),e.length===0)return;let t=n.menus;n.setMenus(t.concat(e))},deleteMenus(n,e){if(e=p.ensure(e),e.length===0)return;let t=p.diff(n.menus,e);n.setMenus(t)}};var Ft;(function(n){n[n.MENU_BAR=1]="MENU_BAR",n[n.CONTEXT_MENU=2]="CONTEXT_MENU",n[n.HEADER=3]="HEADER"})(Ft||(Ft={}));class J extends ce{childActions;defaultMenu;excludedByFilter;menuTypes;menuStyle;uiCssClass;overflowMenu;parentMenu;ellipsis;rightAligned;popup;popupHorizontalAlignment;popupVerticalAlignment;stackable;separator;shrinkable;subMenuVisibility;menuFilter;createdBy;$submenuIcon;$subMenuBody;$placeHolder;constructor(){super(),this.childActions=[],this.defaultMenu=null,this.excludedByFilter=!1,this.menuTypes=[],this.menuStyle=J.MenuStyle.NONE,this.parentMenu=null,this.popup=null,this.popupHorizontalAlignment=void 0,this.popupVerticalAlignment=void 0,this.stackable=!0,this.separator=!1,this.shrinkable=!1,this.rightAligned=!1,this.subMenuVisibility=J.SubMenuVisibility.DEFAULT,this.menuFilter=null,this.$submenuIcon=null,this.$subMenuBody=null,this._addCloneProperties(["defaultMenu","menuTypes","overflow","stackable","separator","shrinkable","parentMenu","menuFilter","subMenuVisibility"]),this._addWidgetProperties("childActions")}static SUBMENU_ICON=q.ANGLE_DOWN_BOLD;static MenuStyle={NONE:0,DEFAULT:1};static SubMenuVisibility={DEFAULT:"default",TEXT_OR_ICON:"textOrIcon",ALWAYS:"always",NEVER:"never"};_init(e){super._init(e),this._setChildActions(this.childActions)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new Jh(this))}_render(){this.separator?this._renderSeparator():this._renderItem(),this.$container.unfocusable(),this.htmlComp=x.install(this.$container,this.session)}_renderProperties(){super._renderProperties(),this._renderMenuStyle(),this._renderActionStyle(),this._updateIconAndTextStyle()}_remove(){super._remove(),this.$submenuIcon=null,this.$subMenuBody=null}_renderSeparator(){this.$container=this.$parent.appendDiv("menu-separator")}_renderItem(){this.$container=this.$parent.appendDiv("menu-item"),this.uiCssClass&&this.$container.addClass(this.uiCssClass);let e=this._onMouseEvent.bind(this);this.$container.on("mousedown",e).on("contextmenu",e).on("click",e),this._renderSubMenuIcon()}_renderActionStyle(){this.$container.toggleClass("menu-button",this.isButton()&&!this.overflown),this.updateAriaRole()}_renderToggleAction(){this.updateAriaRole()}updateAriaRole(){if(this.separator){T.role(this.$container,"separator");return}let e=this._doActionTogglesSubMenu()||this._doActionTogglesPopup();T.role(this.$container,this.isToggleAction()&&!e?"menuitemcheckbox":"menuitem")}_renderSelected(){this._doActionTogglesSubMenu()||(super._renderSelected(),this.parent instanceof bt&&this.parent.updateNextToSelected());let e=this._doActionTogglesSubMenu()||this._doActionTogglesPopup();this.selected?(this._doActionTogglesSubMenu()?this._renderSubMenuItems(this,this.childActions):this._doActionTogglesPopup()&&this._openPopup(),T.expanded(this.$container,e?!0:null)):(this._doActionTogglesSubMenu()&&this.rendered?this._removeSubMenuItems(this):(this._closePopup(),this._closeSubMenus()),T.expanded(this.$container,e?!1:null)),this.$container.toggleClass("has-popup",e),T.hasPopup(this.$container,e?"menu":null),T.pressed(this.$container,null),T.checked(this.$container,this.isToggleAction()&&!e?this.selected:null)}_closeSubMenus(){this.childActions.forEach(e=>{e._doActionTogglesPopup()&&(e._closeSubMenus(),e.setSelected(!1))})}_removeSubMenuItems(e){this.parent instanceof bt?this.parent.removeSubMenuItems(e,!0):this.parent instanceof J&&this.parent._removeSubMenuItems(e)}_renderSubMenuItems(e,t){let i=this.parent;if(i instanceof bt){i.renderSubMenuItems(e,t,!0);let s=o=>e.setSelected(!1),r=o=>{o.newValue===!1&&(i.off("destroy",s),e.off("propertyChange:selected",r))};i.one("destroy",s),e.on("propertyChange:selected",r)}else i instanceof J&&i._renderSubMenuItems(e,t)}_togglesSubMenu(){return!0}_doActionTogglesSubMenu(){return this.childActions.length?this.parent instanceof bt?!0:this.parent instanceof J?this.parent._togglesSubMenu():!1:!1}_onMouseEvent(e){e.type==="mousedown"&&this._doubleClickSupport.mousedown(e),this._allowMouseEvent(e)&&(Y.cancel(this.$container),e.type==="mousedown"&&this.isToggleAction()?this.doAction():(e.type==="click"||e.type==="contextmenu")&&!this.isToggleAction()&&this.doAction())}_doActionTogglesPopup(){return this.childActions.length>0}_renderChildActions(){this.rendering||this._renderSubMenuIcon()}setSubMenuVisibility(e){this.setProperty("subMenuVisibility",e)}_renderSubMenuVisibility(){this._renderSubMenuIcon()}_renderSubMenuIcon(){let e=!1;if(this.childActions.length>0)switch(this.subMenuVisibility){case J.SubMenuVisibility.DEFAULT:e=this._hasText();break;case J.SubMenuVisibility.TEXT_OR_ICON:e=this._hasText()||!!this.iconId;break;case J.SubMenuVisibility.ALWAYS:e=!0;break;case J.SubMenuVisibility.NEVER:e=!1;break}if(e){if(!this.$submenuIcon){let t=q.parseIconId(J.SUBMENU_ICON);this.$submenuIcon=this.$container.appendSpan("submenu-icon").text(t.iconCharacter),T.hidden(this.$submenuIcon,!0),this.invalidateLayoutTree()}}else this.$submenuIcon&&(this.$submenuIcon.remove(),this.$submenuIcon=null,this.invalidateLayoutTree());this.rendering||(this._renderTextPosition(),this._updateIconAndTextStyle())}_renderText(){super._renderText(),this.$container.toggleClass("has-text",_.hasText(this.text)&&this.textVisible),this.rendering||(this._renderSubMenuIcon(),this._updateTooltip()),this.invalidateLayoutTree()}_renderTextPosition(){super._renderTextPosition();let e=this.$container;this.textPosition===ce.TextPosition.BOTTOM&&this.$text&&this.iconId&&(e=this.$text),this.$submenuIcon&&this.$submenuIcon.appendTo(e)}_renderIconId(){super._renderIconId(),this.$container.toggleClass("has-icon",!!this.iconId),this.rendering||this._renderSubMenuIcon(),this.invalidateLayoutTree()}isTabTarget(){return this.enabledComputed&&this.visible&&!this.overflown&&(this.isButton()||!this.separator)&&(!this.parentMenu||this.parentMenu.visible&&!this.parentMenu.overflown)}recomputeEnabled(e){e===void 0&&(e=this._getInheritedAccessibility());let t,i;this.enabled&&this.inheritAccessibility&&!e&&this.childActions.length>0?(t=this._hasAccessibleChildMenu(),t?i=e:i=!1):(t=this._computeEnabled(this.inheritAccessibility,e),i=t),this._updateEnabledComputed(t,i)}_getInheritedAccessibility(){let e=this,t=e;for(;e;){if(!e.inheritAccessibility)return e.enabled;t=e,e=e.parentMenu}let i=t.parent;return i&&i.initialized&&i.enabledComputed!==void 0?i.enabledComputed:!0}_findRootMenu(){let e=this,t;for(;e;)t=e,e=e.parentMenu;return t}_hasAccessibleChildMenu(){let e=!1;return this.visitChildMenus(t=>!t.inheritAccessibility&&t.enabled&&t.visible?(e=!0,ye.TERMINATE):ye.CONTINUE),e}visitChildMenus(e){for(let t=0;t<this.childActions.length;t++){let i=this.childActions[t];if(i instanceof J){let s=e(i);if(s===!0||s===ye.TERMINATE)return ye.TERMINATE;if(s!==ye.SKIP_SUBTREE&&(s=i.visitChildMenus(e),s===ye.TERMINATE))return ye.TERMINATE}}}_hasText(){return _.hasText(this.text)&&this.textVisible}_updateIconAndTextStyle(){let e=this._hasText(),t=!!(e&&this.iconId),i=!!this.iconId,s=!!this.$submenuIcon,r=i&&!s||!i&&s;this.$container.toggleClass("menu-textandicon",t),this.$container.toggleClass("menu-icononly",!e&&r)}_closePopup(){this.popup&&!this.popup.isRemovalPending()&&this.popup.close()}_canOpenPopup(){return this.popup&&this.popup.isRemovalPending()&&this.popup.removeImmediately(),!(this.popup||!this._doActionTogglesPopup())}_openPopup(){this._canOpenPopup()&&(this.popup=this._createPopup(),this.popup.open(),T.linkElementWithControls(this.$container,this.popup.$container),this.popup.one("destroy",e=>{this.popup=null,T.removeControls(this.$container)}),this.popup.on("close",e=>{this.setSelected(!1)}),this.uiCssClass&&this.popup.$container.addClass(this.uiCssClass))}_createPopup(){return u.create(ad,{parent:this,menu:this,menuFilter:this.menuFilter,horizontalAlignment:this.popupHorizontalAlignment,verticalAlignment:this.popupVerticalAlignment})}_createActionKeyStroke(){return new Xh(this)}isToggleAction(){return this.childActions.length>0||this.toggleAction}isButton(){return ce.ActionStyle.BUTTON===this.actionStyle}insertChildAction(e){this.insertChildActions([e])}insertChildActions(e){if(e=p.ensure(e),e.length===0)return;let t=this.childActions;this.setChildActions(t.concat(e))}deleteChildAction(e){this.deleteChildActions([e])}deleteChildActions(e){if(e=p.ensure(e),e.length===0)return;let t=this.childActions.slice();p.removeAll(t,e),this.setChildActions(t)}setChildActions(e){this.setProperty("childActions",e)}_setChildActions(e){this.childActions.forEach(t=>{t.parentMenu=null}),this._setProperty("childActions",e),this.childActions.forEach(t=>{t.parentMenu=this}),this.initialized&&this.recomputeEnabled()}_setInheritAccessibility(e){this._setProperty("inheritAccessibility",e)&&this._recomputeEnabledInMenuHierarchy()}_setEnabled(e){this._setProperty("enabled",e)&&this._recomputeEnabledInMenuHierarchy()}_setVisible(e){this._setProperty("visible",e)&&this._recomputeEnabledInMenuHierarchy()}_recomputeEnabledInMenuHierarchy(){if(!this.initialized)return;let e=this._findRootMenu();e.recomputeEnabled(),e!==this&&this.recomputeEnabled()}setSelected(e){e!==this.selected&&(super.setSelected(e),!(!this._doActionTogglesSubMenu()&&!this._doActionTogglesPopup())&&this.overflowMenu&&!this.overflowMenu.selected&&this._handleSelectedInEllipsis())}_handleSelectedInEllipsis(){this.selected&&this.overflowMenu.setSelected(!0)}setStackable(e){this.setProperty("stackable",e)}_renderStackable(){this.invalidateLayoutTree()}setShrinkable(e){this.setProperty("shrinkable",e)}_renderShrinkable(){this.invalidateLayoutTree()}shrink(){this.shrinkable&&super.shrink()}_renderOverflown(){super._renderOverflown(),this._renderActionStyle()}setMenuTypes(e){this.setProperty("menuTypes",e)}setMenuStyle(e){this.setProperty("menuStyle",e)}_renderMenuStyle(){this.$container.toggleClass("default",this.menuStyle===J.MenuStyle.DEFAULT)}setDefaultMenu(e){this.setProperty("defaultMenu",e)}setMenuFilter(e){this.setProperty("menuFilter",e),this.childActions.forEach(t=>t.setMenuFilter(e))}clone(e,t){let i=super.clone(e,t);return this._deepCloneProperties(i,"childActions",t),i._setChildActions(i.childActions),i}focus(){return this.trigger("focus").defaultPrevented?!1:super.focus()}_computeTooltipText(){return this._showTextAsTooltip()?_.join(`
`,this.text,this.tooltipText):super._computeTooltipText()}_showTextAsTooltip(){return this.text&&!this.textVisible&&this._textVisibleOrig}}class yo extends J{hidden;constructor(){super(),this.hidden=!0,this.ellipsis=!0,this.stackable=!1,this.horizontalAlignment=1,this.iconId=q.ELLIPSIS_V,this.tabbable=!1,this._addPreserveOnPropertyChangeProperties(["childActions"])}_render(){super._render(),this.$container.addClass("ellipsis")}setChildActions(e){super.setChildActions(e),e&&e.forEach(t=>t.setSelected(!1))}_renderProperties(){super._renderProperties(),this._renderHidden()}_renderSelected(){super._renderSelected(),T.hasPopup(this.$container,"menu"),T.expanded(this.$container,this.selected)}setHidden(e){this.setProperty("hidden",e)}_renderHidden(){this.$container.setVisible(!this.hidden)}isTabTarget(){return super.isTabTarget()&&!this.hidden}_childrenForEnabledComputed(){return this.childActions}}class wo extends er{}class Xh extends Rr{constructor(e){super(e)}_isEnabled(){return this.field.excludedByFilter?!1:super._isEnabled()}}class Jh extends yl{constructor(e){super(e),this.renderingHints.offset=16}}class gn{session;objectType;emptySpaceTypes;selectionTypes;menuBar;defaultMenuTypes;constructor(e,t,i){this.session=e,this.objectType=t,this.defaultMenuTypes=i,this.emptySpaceTypes=["EmptySpace"],this.selectionTypes=["SingleSelection","MultiSelection"]}order(e){let t=[],i=[],s=[],r=[],o=!1,l=!1;return e.forEach(a=>{a.createdBy!==this&&(a.isButton()?t.push(a):a.horizontalAlignment===1?r.push(a):$e.checkType(a,this._menuTypes(this.emptySpaceTypes),this.defaultMenuTypes)?(a.visible&&(o=!0),i.push(a)):$e.checkType(a,this._menuTypes(this.selectionTypes),this.defaultMenuTypes)&&(a.visible&&(l=!0),s.push(a)))}),o&&l&&i.push(this._createSeparator()),{left:t.concat(i,s),right:r,all:t.concat(i,s).concat(r)}}_menuTypes(e){let t=[];e=e||[];for(let i=0;i<e.length;i++)t.push(this.objectType+"."+e[i]);return t}_createSeparator(){let e=u.create(J,{parent:this.menuBar,separator:!0});return e.createdBy=this,e}}class Qh extends J{_childVisibleChangeHandler;constructor(){super(),this._childVisibleChangeHandler=this._onChildVisibleChange.bind(this)}_render(){this.$container=this.$parent.appendDiv("menu-item combo-menu"),this.uiCssClass&&this.$container.addClass(this.uiCssClass),this.$container.unfocusable(),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new cl)}_renderProperties(){super._renderProperties(),this._renderChildActions()}_setChildActions(e){this.childActions.forEach(t=>t.off("propertyChange:visible",this._childVisibleChangeHandler)),super._setChildActions(e),this.childActions.forEach(t=>t.on("propertyChange:visible",this._childVisibleChangeHandler))}_renderChildActions(){super._renderChildActions(),this.childActions.forEach(e=>{e.addCssClass("combo-menu-child"),e.render()}),Fe.updateFirstLastMarker(this.childActions)}_togglesSubMenu(){return!1}_onChildVisibleChange(e){this.rendered&&Fe.updateFirstLastMarker(this.childActions)}_doActionTogglesPopup(){return!1}isToggleAction(){return!1}isTabTarget(){return!1}}class $f extends wo{}class bt extends _e{menuItems;cloneMenuItems;bodyAnimating;animationDuration;$body;initialSubMenusToRender;menuFilter;_toggleSubMenuQueue;constructor(){super(),this.animateOpening=!0,this.animateRemoval=!0,this.menuItems=[],this.cloneMenuItems=!0,this.bodyAnimating=!1,this._toggleSubMenuQueue=[],this.animationDuration=300}_init(e){e.focusableContainer=!0,e.cloneMenuItems===!1&&this._addWidgetProperties("menuItems"),super._init(e)}_initKeyStrokeContext(){super._initKeyStrokeContext(),sr.registerKeyStrokes(this.keyStrokeContext,this,"menu-item")}_createLayout(){return new Zh(this)}_createBodyLayout(){return new Si({pixelBasedSizing:!1})}_render(){super._render(),this.$container.addClass("context-menu-popup"),T.role(this.$container,"menu"),this._renderBody(),this._installScrollbars(),this._renderMenuItems()}_remove(){this._toggleSubMenuQueue=[],super._remove()}_renderBody(){this.$body=this.$container.appendDiv("context-menu"),x.install(this.$body,this.session).setLayout(this._createBodyLayout())}_installScrollbars(e){super._installScrollbars({axis:"y",scrollShadow:"none"})}_checkRemoveSubMenuItemsPossible(e,t){if(!this.rendered&&!this.rendering)return!1;let i=this.isOpeningAnimationRunning(),r=this.htmlComp.layout.resizeAnimationRunning;return this.bodyAnimating||i||r?(this._toggleSubMenuQueue.push(this.removeSubMenuItems.bind(this,e,t)),i&&this.$container.oneAnimationEnd(()=>this._processSubMenuQueue()),!1):!0}removeSubMenuItems(e,t){let i=e;if(!this._checkRemoveSubMenuItemsPossible(i,t))return;this.$body=i.__originalParent.$subMenuBody,this.$body.insertBefore(i.$subMenuBody),i.__originalParent._doActionTogglesSubMenu&&i.__originalParent._doActionTogglesSubMenu();let s=this.htmlComp.bounds();this._adjustTextAlignment(),x.get(this.$body).invalidateLayoutTree(),this.validateLayoutTree(),this.position(),t&&this._animateRemoveSubmenuItems(i,s)}_animateRemoveSubmenuItems(e,t){let i=e.$placeHolder.position(),s=this.htmlComp.insets(),r=this.htmlComp.bounds(),o=x.get(e.$subMenuBody).bounds(),l=x.get(this.$body).bounds(),a=new te(0,s.top,o.width,o.height),d=new te(0,s.top+i.top,l.width,e.$container.cssHeight());this.bodyAnimating=!0,this.$container.addClass("animating"),this.htmlComp.layout.disableAutoPosition(),this._animateResizePopup(this.htmlComp.$comp,t,r),this._animateTextOffset(e.$subMenuBody,e.$subMenuBody.data("text-offset")),e.$subMenuBody.cssWidthAnimated(a.width,d.width,{duration:this.animationDuration,progress:this.revalidateLayout.bind(this),complete:()=>this._completeAnimateRemoveSubMenuItems(e),queue:!1}).cssHeightAnimated(a.height,d.height,{duration:this.animationDuration,queue:!1}).cssTopAnimated(a.y,d.y,{duration:this.animationDuration,queue:!1}),this.$body.cssWidthAnimated(o.width,l.width,{duration:this.animationDuration,queue:!1}).cssHeightAnimated(o.height,l.height,{duration:this.animationDuration,queue:!1})}_completeAnimateRemoveSubMenuItems(e){this.bodyAnimating=!1,!(!this.rendered||!e.$container)&&(this.$container.removeClass("animating"),e.$placeHolder.replaceWith(e.$container),e.$container.toggleClass("expanded",!1),this._updateFirstLastClass(),this.updateNextToSelected("menu-item",e.$container),e.$subMenuBody.detach(),this._processSubMenuQueue())}_processSubMenuQueue(){let e=this._toggleSubMenuQueue.shift();e&&e()}_checkRenderSubMenuItemsPossible(e,t,i,s){if(!this.session.desktop.rendered&&!s)return this.initialSubMenusToRender={parentMenu:e,menus:t},!1;if(!this.rendered&&!this.rendering)return!1;let r=this.isOpeningAnimationRunning(),l=this.htmlComp.layout.resizeAnimationRunning;return this.bodyAnimating||r||l?(this._toggleSubMenuQueue.push(this.renderSubMenuItems.bind(this,e,t,i,s)),r&&this.$container.oneAnimationEnd(()=>this._processSubMenuQueue()),!1):!0}renderSubMenuItems(e,t,i,s){let r=e;if(!this._checkRenderSubMenuItemsPossible(r,t,i,s))return!1;let o=this.htmlComp.bounds(),l=this.$body;r.__originalParent.$subMenuBody=l,this.$body.find(".menu-item").removeClass("next-to-selected"),r.$subMenuBody?this.$body=r.$subMenuBody:(this._renderBody(),r.$subMenuBody=this.$body,this._renderMenuItems(t,s));let d=r.$container.prev(),c=r.$container.position();r.$placeHolder=r.$container.clone(),x.install(r.$placeHolder,this.session),d.length?r.$placeHolder.insertAfter(d):l.prepend(r.$placeHolder),this.$body.insertAfter(l),this.$body.prepend(r.$container),r.$container.toggleClass("expanded"),this._adjustTextAlignment(),x.get(this.$body).invalidateLayoutTree(),this.validateLayoutTree(),this.position(),this.updateNextToSelected(),i?this._animateRenderSubMenuItems(r,o,c):(l.detach(),this._updateFirstLastClass())}_animateRenderSubMenuItems(e,t,i){let s=e,r=s.__originalParent.$subMenuBody,o=this.htmlComp.bounds(),l=this.htmlComp.insets(),a=C.bounds(r),d=x.get(this.$body).bounds(),c=new te(0,l.top+i.top,a.width,s.$container.cssHeight()),f=new te(0,l.top,d.width,d.height);this.bodyAnimating=!0,this.$container.addClass("animating"),this.htmlComp.layout.disableAutoPosition(),this._animateResizePopup(this.htmlComp.$comp,t,o),this._animateTextOffset(this.$body,r.data("text-offset")),this.$body.cssWidthAnimated(c.width,f.width,{duration:this.animationDuration,progress:this.revalidateLayout.bind(this),complete:()=>this._completeAnimateRenderSubMenuItems(r),queue:!1}).cssHeightAnimated(c.height,f.height,{duration:this.animationDuration,queue:!1}).cssTopAnimated(c.y,f.y,{duration:this.animationDuration,queue:!1}),r.cssWidthAnimated(a.width,f.width,{duration:this.animationDuration,queue:!1}).cssHeightAnimated(a.height,f.height,{duration:this.animationDuration,queue:!1})}_completeAnimateRenderSubMenuItems(e){if(this.bodyAnimating=!1,!this.rendered)return;this.$container.removeClass("animating"),e&&(e.detach(),this.$body.cssTop(""),this._updateFirstLastClass()),this.htmlComp.layout.resetAutoPosition(),this._processSubMenuQueue()}_animateResizePopup(e,t,i){let s={duration:this.animationDuration,queue:!1};e.cssTopAnimated(t.y,i.y,s).cssLeftAnimated(t.x,i.x,s).cssWidthAnimated(t.width,i.width,s).cssHeightAnimated(t.height,i.height,s)}_animateTextOffset(e,t,i){i=u.nvl(i,this.$body.data("text-offset")),this.$visibleMenuItems(e).each((r,o)=>{let l=h()(o),a=l.children(".text"),d=this._calcTextPaddingLeft(l,t),c=this._calcTextPaddingLeft(l,i);a.cssAnimated({paddingLeft:d},{paddingLeft:c},{duration:this.animationDuration})})}_renderMenuItems(e,t){e=e||this._getMenuItems(),this.menuFilter&&(e=this.menuFilter(e,Ft.CONTEXT_MENU)),!(!e||e.length===0)&&(e.forEach(i=>{if(i.separator)return;let s=i.parent;(this.cloneMenuItems&&!i.cloneOf||!this.has(i))&&(i=i.clone({parent:this,textPosition:ce.TextPosition.DEFAULT,uuid:Z.get().createDependentUuid("cmi",i)},{delegateEventsToOriginal:["acceptInput","action","click"],delegateAllPropertiesToClone:!0,delegateAllPropertiesToOriginal:!0,excludePropertiesToClone:["uuid"],excludePropertiesToOriginal:["selected","logicalGrid","tabbable"]}),i.setTabbable(!1),this._attachCloneMenuListeners(i)),i.__originalParent||(i.__originalParent=s),i.render(this.$body),i.$container.removeClass("menu-button"),this._attachMenuListeners(i)}),this._handleInitialSubMenus(t),this._updateFirstLastClass(),this._adjustTextAlignment())}_attachCloneMenuListeners(e){e.on("propertyChange",this._onCloneMenuPropertyChange.bind(this)),e.childActions.forEach(this._attachCloneMenuListeners.bind(this))}_onCloneMenuPropertyChange(e){e.propertyName==="selected"&&e.source.cloneOf.triggerPropertyChange("selected",e.oldValue,e.newValue)}_handleInitialSubMenus(e){if(e)return;let t;for(;this.initialSubMenusToRender;)t=this.initialSubMenusToRender,this.initialSubMenusToRender=void 0,this.renderSubMenuItems(t.parentMenu,t.menus,!1,!0)}_attachMenuListeners(e){let t=this._onMenuItemAction.bind(this),i=this._onMenuItemPropertyChange.bind(this);e.on("action",t),e.on("propertyChange",i),this.one("remove",()=>{e.off("action",t),e.off("propertyChange",i)})}updateMenuItems(e){e=p.ensure(e),p.equals(this.menuItems,e)||this.close()}_getMenuItems(){return this.menuItems}$menuItems(){return this.$body.children(".menu-item")}$visibleMenuItems(e){return e=e||this.$body,e.children(".menu-item:visible")}_updateFirstLastClass(){let e,t;this.$body.children(".menu-item").each(function(){let i=h()(this);i.removeClass("first last"),i.isVisible()&&(e||(e=i),t=i)}),e&&e.addClass("first"),t&&t.addClass("last")}updateNextToSelected(e,t){e=e||"menu-item";let i=this.$body.find("."+e);t=t||this.$body.find("."+e+".selected"),T.linkElementWithActiveDescendant(this.$container,t),i.removeClass("next-to-selected"),t.hasClass("selected")&&t.nextAll(":visible").first().addClass("next-to-selected")}_onMenuItemAction(e){e.source.isToggleAction()||e.defaultPrevented||this.close()}_onMenuItemPropertyChange(e){this.rendered&&(e.propertyName==="visible"?this._updateFirstLastClass():e.propertyName==="selected"?this._deselectSiblings(e.source):e.propertyName==="iconId"&&this.rendered&&queueMicrotask(()=>{this.rendered&&this._adjustTextAlignment()}),this.position())}_deselectSiblings(e){e.$container.siblings(".menu-item").each((t,i)=>{h()(i).select(!1)})}_adjustTextAlignment(e){e=e||this.$body;let t=this.$visibleMenuItems(e),i=this._calcTextOffset(t);e.data("text-offset",i),this._updateTextOffset(i,t)}_calcTextOffset(e){let t=0;return e=e||this.$visibleMenuItems(),e.each((i,s)=>{let o=h()(s).children(".icon"),l=0;o.length>0&&(l=o.outerWidth(!0)),t=Math.max(t,l)}),t}_updateTextOffset(e,t){t=t||this.$visibleMenuItems(),t.each((i,s)=>{let r=h()(s);r.children(".text").css("padding-left",this._calcTextPaddingLeft(r,e));let l=x.optGet(r);l&&l.invalidateLayout()})}_calcTextPaddingLeft(e,t){let i=e.children(".icon"),s=0;return i.length>0&&(s=i.outerWidth(!0)),t-s}}class Zh extends xi{constructor(e){super(e)}_setSize(e){if(this.popup.bodyAnimating){P.update(this.popup.get$Scrollable());return}super._setSize(e),P.update(this.popup.get$Scrollable()),x.get(this.popup.$body).pack()}invalidate(e){this.popup.bodyAnimating&&e&&e.isDescendantOf(this.popup.htmlComp)&&this.popup._toggleSubMenuQueue.unshift(()=>{if(!this.popup.rendered)return;let t=this.popup.$body.data("text-offset");this.popup._adjustTextAlignment(),this.popup.animateResize=!0,this.resizeAnimationDuration=this.popup.animationDuration,this.popup.revalidateLayoutTree(),this.popup.animateResize=!1,this.popup._animateTextOffset(this.popup.$body,t),this.popup.$container.promise().done(()=>this.popup._processSubMenuQueue())})}preferredLayoutSize(e,t){let i=this.popup.htmlComp,s=x.get(this.popup.$body),r;if(this.popup.bodyAnimating)r=C.size(this.popup.$body,t);else{let o=this.popup.$container.attr("style"),l=this.popup.$body.siblings(".context-menu");l.addClass("hidden"),this.popup.$body.css({width:"auto",height:"auto"}),s=x.get(this.popup.$body),r=s.prefSize(t),l.removeClass("hidden"),this.popup.$container.attr("style",o)}return r.add(i.insets()).add(s.margins())}}class Co extends B{_menuItemClass;constructor(e){super(),this.field=e,this.inheritAccessibility=!1}_accept(e){let t=super._accept(e);return!t||this.field.bodyAnimating?!1:t}_changeSelection(e,t){t.length!==0&&(t.select(!0).focus(),this.field.updateNextToSelected&&this.field.updateNextToSelected(this._menuItemClass,t),e.length>0&&e.select(!1))}}class To extends Co{constructor(e,t){super(e),this._menuItemClass=t,this.stopImmediatePropagation=!0,this.which=[m.ENTER,m.SPACE],this.renderingHints.render=!1}handle(e){let t=sr._findMenuItems(this.field,this._menuItemClass).$selected;t.length>0&&t.data("widget").doAction()}}class ed extends To{constructor(e,t){super(e,t),this._menuItemClass=t,this.which=[m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9]],this.renderingHints.render=!0,this.renderingHints.hAlign=ut.RIGHT,this.renderingHints.$drawingArea=(i,s)=>s.$menuItem}_accept(e){if(!super._accept(e))return!1;let i=sr._findMenuItems(this.field,this._menuItemClass),s=m.codesToKeys[e.which];return e.$menuItem=i.$allVisible.eq(s-1),e.$menuItem.length>0}handle(e){e.$menuItem.data("widget").doAction()}}class td extends Co{constructor(e,t){super(e),this._menuItemClass=t,this.which=[m.DOWN],this.renderingHints.render=!1}handle(e){let t=sr._findMenuItems(this.field,this._menuItemClass);t.$selected.length>0?this._changeSelection(t.$selected,t.$selected.nextAll(":visible").first()):this._changeSelection(t.$selected,t.$allVisible.first())}}class id extends Co{constructor(e,t){super(e),this._menuItemClass=t,this.which=[m.UP],this.renderingHints.render=!1}handle(e){let t=sr._findMenuItems(this.field,this._menuItemClass);t.$selected.length>0?this._changeSelection(t.$selected,t.$selected.prevAll(":visible").first()):this._changeSelection(t.$selected,t.$allVisible.last())}}class sd extends To{constructor(e,t){super(e,t),this._menuItemClass=t,this.which=[m.BACKSPACE],this.renderingHints.render=!0,this.renderingHints.$drawingArea=(i,s)=>s.$menuItem}_accept(e){if(!super._accept(e))return!1;let i=sr._findMenuItems(this.field,this._menuItemClass+".expanded");return i.$all.length>0?(e.$menuItem=i.$all,!0):!1}handle(e){e.$menuItem.data("widget").doAction()}}const sr={registerKeyStrokes(n,e,t){n.registerKeyStrokes([new id(e,t),new td(e,t),new To(e,t),new ed(e,t),new sd(e,t)])},_findMenuItems(n,e){return{$all:n.$body.find("."+e),$allVisible:n.$body.find("."+e+":visible"),$selected:n.$body.find("."+e+".selected")}}};class mn extends J{button;menubar;_buttonPropertyChangeHandler;_buttonDestroyHandler;constructor(){super(),this._removeWidgetProperties("childActions"),this._buttonPropertyChangeHandler=this._onButtonPropertyChange.bind(this),this._buttonDestroyHandler=this._onButtonDestroy.bind(this),this._addCloneProperties(["button"]),this.button=null,this.menubar=null}_init(e){if(super._init(e),!this.button)throw new Error("Cannot adapt to undefined button");this.button.adaptedBy=this,this._installListeners()}_destroy(){super._destroy(),delete this.button.adaptedBy}_installListeners(){this.button.on("propertyChange",this._buttonPropertyChangeHandler),this.button.on("destroy",this._buttonDestroyHandler)}_uninstallListeners(){this.button.off("propertyChange",this._buttonPropertyChangeHandler),this.button.off("destroy",this._buttonDestroyHandler)}_render(){super._render(),this.$container.attr("data-buttonadapter",this.button.id)}_onButtonPropertyChange(e){let t={};t[e.propertyName]=e.newValue,t=mn.adaptButtonProperties(t);for(let i in t)this.setProperty(i,t[i])}_onButtonDestroy(e){this.destroy(),this._uninstallListeners()}doAction(){if(this.childActions.length>0)return super.doAction();let e=this.button.doAction();return e&&(this.isToggleAction()&&this.setSelected(!this.selected),this._doAction()),e}focus(){return this.rendered?(this.menubar.setTabbableMenu(this),this.session.focusManager.requestFocus(this.getFocusableElement())):(this.session.layoutValidator.schedulePostValidateFunction(this.focus.bind(this)),!1)}static adaptButtonProperties(e,t){t=t||{},["visible","selected","tooltipText","keyStroke","keyStrokes","cssClass","modelClass","classId","iconId","preventDoubleClick","enabled","inheritAccessibility","stackable","shrinkable"].forEach(r=>{t[r]=e[r]}),t.text=e.label,t.textPosition=s(e.labelPosition),t.horizontalAlignment=e.gridData?e.gridData.horizontalAlignment:void 0,t.actionStyle=i(e.displayStyle),t.toggleAction=e.displayStyle===Oe.DisplayStyle.TOGGLE,t.childActions=e.menus,t.defaultMenu===void 0&&(t.defaultMenu=e.defaultButton);for(let r in t)t[r]===void 0&&delete t[r];return t;function i(r){if(r!==void 0)return r===Oe.DisplayStyle.LINK?ce.ActionStyle.DEFAULT:ce.ActionStyle.BUTTON}function s(r){if(r!==void 0)return r===Oe.LabelPosition.BOTTOM?ce.TextPosition.BOTTOM:ce.TextPosition.DEFAULT}}}class Mf extends J{field;constructor(){super(),this._addWidgetProperties("field")}_render(){this.$container=this.$parent.appendDiv("menu-item"),this.$container.addClass("form-field-menu"),this.uiCssClass&&this.$container.addClass(this.uiCssClass),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new cl({stretch:!1}))}_renderProperties(){super._renderProperties(),this._renderField()}_renderText(){super._renderText(),this.field&&this.field.rendered&&this.$text&&this.field.$container.insertAfter(this.$text)}setField(e){this.setProperty("field",e)}_renderField(){this.field&&(this.field.gridData=ke.createFromHints(this.field,1),this.field.render(this.$container),this.field.setLayoutData({widthHint:this.field.gridData.widthInPixel}),this.field.$container.addClass("content"))}_removeField(){this.field&&this.field.remove()}clone(e,t){let i=super.clone(e,t);return this._deepCloneProperties(i,["field"],t),i}isTabTarget(){return!1}_renderOverflown(){super._renderOverflown(),this.field&&this.field._hideStatusMessage()}}class kf extends wo{_postCreateWidget(){super._postCreateWidget(),this.widget.field&&(this.widget.field.gridDataHints=new ke(this.widget.field.gridData))}}class rd extends I{compact;menus;uiMenuCssClass;_compactOrig;constructor(){super(),this.compact=!1,this.menus=[],this.uiMenuCssClass="menu-box-item",this._addWidgetProperties("menus")}_init(e){super._init(e),this._initMenus(this.menus)}_initMenus(e){e.forEach(this._initMenu.bind(this))}_initMenu(e){e.uiCssClass=this.uiMenuCssClass}_render(){this.$container=this.$parent.appendDiv("menu-box"),T.role(this.$container,"menubar"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new nd(this))}_renderProperties(){super._renderProperties(),this._renderMenus(),this._renderCompact()}setMenus(e){this.setProperty("menus",e)}_renderMenus(){this.menus.forEach(e=>e.render()),this.invalidateLayoutTree()}_removeMenus(){this.menus.forEach(e=>e.remove()),this.invalidateLayoutTree()}setCompact(e){this.setProperty("compact",e)}_renderCompact(){this.$container.toggleClass("compact",this.compact),this.invalidateLayoutTree()}makeCompact(){this._compactOrig===void 0&&(this._compactOrig=this.compact,this.setCompact(!0))}undoMakeCompact(){this._compactOrig!==void 0&&(this.setCompact(this._compactOrig),this._compactOrig=void 0)}}class nd extends ne{menuBox;firstMenu;lastMenu;_ellipsis;constructor(e){super(),this.menuBox=e,this.firstMenu=null,this.lastMenu=null}layout(e){let t=this.menuBox.htmlComp,i=t.size(),s=this.visibleMenus(),r=0;this.menuBox.session.layoutValidator.schedulePostValidateFunction(()=>{s.forEach(o=>{o.popup&&o.popup.position()})}),this.updateFirstAndLastMenuMarker(s),this.undoCollapse(s),this.undoCompact(s),this.undoShrink(s),r=this.actualPrefSize(s).width,!(r<=i.width)&&(this.compact(s),r=this.actualPrefSize(s).width,!(r<=i.width)&&(this.shrink(s),r=this.actualPrefSize(s).width,!(r<=i.width)&&this.collapse(i,r)))}preferredLayoutSize(e,t){let i=this.visibleMenus();return this.updateFirstAndLastMenuMarker(i),this.undoCollapse(i),this.undoCompact(i),this.undoShrink(i),this.actualPrefSize()}compact(e){this.menuBox.htmlComp.suppressInvalidate=!0,this.menuBox.makeCompact(),this.menuBox.htmlComp.suppressInvalidate=!1,this.compactMenus(e)}undoCompact(e){this.menuBox.htmlComp.suppressInvalidate=!0,this.menuBox.undoMakeCompact(),this.menuBox.htmlComp.suppressInvalidate=!1,this.undoCompactMenus(e)}compactMenus(e){e=e||this.visibleMenus(),e.forEach(t=>{t.htmlComp.suppressInvalidate=!0,t.makeCompact(),t.htmlComp.suppressInvalidate=!1}),this._ellipsis&&this._ellipsis.setCompact(!0)}undoCompactMenus(e){e=e||this.visibleMenus(),e.forEach(t=>{t.htmlComp.suppressInvalidate=!0,t.undoMakeCompact(),t.htmlComp.suppressInvalidate=!1}),this._ellipsis&&this._ellipsis.setCompact(!1)}shrink(e){this.shrinkMenus(e)}shrinkMenus(e){e=e||this.visibleMenus(),e.forEach(t=>{t.htmlComp.suppressInvalidate=!0,t.shrink(),t.htmlComp.suppressInvalidate=!1})}undoShrink(e){this.undoShrinkMenus(e)}undoShrinkMenus(e){e=e||this.visibleMenus(),e.forEach(t=>{t.htmlComp.suppressInvalidate=!0,t.undoShrink(),t.htmlComp.suppressInvalidate=!1})}collapse(e,t){this._createAndRenderEllipsis(this.menuBox.$container);let i=this._moveOverflowMenusIntoEllipsis(e,t);this.updateFirstAndLastMenuMarker(i)}undoCollapse(e){e=e||this.visibleMenus(),this._destroyEllipsis(),this._removeMenusFromEllipsis(e)}_createAndRenderEllipsis(e){let t=$e.createEllipsisMenu({parent:this.menuBox,hidden:!1,compact:this.menuBox.compact});t.uiCssClass=this.menuBox.uiMenuCssClass,t.render(e),this._ellipsis=t}_destroyEllipsis(){this._ellipsis&&(this._ellipsis.destroy(),this._ellipsis=null)}_moveOverflowMenusIntoEllipsis(e,t){let i=[this._ellipsis],s=C.size(this._ellipsis.$container,!0);return t+=s.width,this.visibleMenus().slice().reverse().forEach(r=>{if(t>e.width){let o=C.size(r.$container,!0);t-=o.width,$e.moveMenuIntoEllipsis(r,this._ellipsis)}else i.unshift(r)}),i}_removeMenusFromEllipsis(e){e=e||this.visibleMenus(),e.forEach(t=>$e.removeMenuFromEllipsis(t,this.menuBox.$container))}actualPrefSize(e){e=e||this.visibleMenus();let t=this._menusWidth(e),i=C.prefSize(this.menuBox.$container);return i.width=t+this.menuBox.htmlComp.insets().horizontal(),i.ceil()}_menusWidth(e){let t=0,i=s=>C.size(s.htmlComp.$comp,{includeMargin:!0,exact:!0});return e=e||this.visibleMenus(),e.forEach(s=>{s.rendered&&(t+=i(s).width)}),this._ellipsis&&(t+=i(this._ellipsis).width),t}compactPrefSize(e){return e=e||this.visibleMenus(),this.updateFirstAndLastMenuMarker(e),this.undoCollapse(e),this.undoShrink(e),this.compact(e),this.actualPrefSize()}shrinkPrefSize(e){return e=e||this.visibleMenus(),this.updateFirstAndLastMenuMarker(e),this.undoCollapse(e),this.compact(e),this.shrink(e),this.actualPrefSize()}visibleMenus(){return this.menuBox.menus.filter(e=>e.visible)}updateFirstAndLastMenuMarker(e){let t=null,i=null;(e||[]).forEach(s=>{s.rendered&&(t||(t=s),i=s)}),(t!==this.firstMenu||i!==this.lastMenu)&&(this.firstMenu&&this.firstMenu.rendered&&this.firstMenu.$container.removeClass("first"),this.lastMenu&&this.lastMenu.rendered&&this.lastMenu.$container.removeClass("last"),this.firstMenu=t,this.lastMenu=i,this.firstMenu&&this.firstMenu.$container.addClass("first"),this.lastMenu&&this.lastMenu.$container.addClass("last"))}}class Ce extends I{menuSorter;menuFilter;position;tabbable;menuboxLeft;menuboxRight;menuItems;orderedMenuItems;defaultMenu;ellipsisPosition;hiddenByUi;tabbableMenu;_menuItemPropertyChangeHandler;_focusHandler;_ellipsis;constructor(){super(),this.menuSorter=null,this.menuFilter=null,this.position=Ce.Position.TOP,this.tabbable=!0,this.menuboxLeft=null,this.menuboxRight=null,this.menuItems=[],this.orderedMenuItems={left:[],right:[],all:[]},this.defaultMenu=null,this.ellipsisPosition=Ce.EllipsisPosition.RIGHT,this._menuItemPropertyChangeHandler=this._onMenuItemPropertyChange.bind(this),this._focusHandler=this._onMenuItemFocus.bind(this),this.hiddenByUi=!1,this._addWidgetProperties("menuItems")}static EllipsisPosition={LEFT:"left",RIGHT:"right"};static Position={TOP:"top",BOTTOM:"bottom"};_init(e){super._init(e),this.menuSorter=e.menuOrder||new Is,this.menuSorter.menuBar=this,e.menuFilter&&(this.menuFilter=(t,i)=>e.menuFilter(t,Ft.MENU_BAR)),this.menuboxLeft=u.create(vo,{parent:this,cssClass:"left",tooltipPosition:this._oppositePosition()}),this.menuboxRight=u.create(vo,{parent:this,cssClass:"right",tooltipPosition:this._oppositePosition()}),this._setMenuItems(p.ensure(this.menuItems)),this.updateVisibility()}_destroy(){super._destroy(),this._detachMenuHandlers()}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new od(this),new ld(this)])}_render(){this.$container=this.$parent.appendDiv("menubar"),T.role(this.$container,"menubar"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Fs(this)),this.menuboxLeft.render(this.$container),this.menuboxRight.render(this.$container)}_renderProperties(){super._renderProperties(),this._renderMenuItems(),this._renderPosition()}setPosition(e){this.setProperty("position",e)}_setPosition(e){this._setProperty("position",e),this.menuboxLeft.setTooltipPosition(this._oppositePosition()),this.menuboxRight.setTooltipPosition(this._oppositePosition())}_renderPosition(){this.$container.toggleClass("bottom",this.position===Ce.Position.BOTTOM)}_oppositePosition(){return this.position===Ce.Position.TOP?Ce.Position.BOTTOM:Ce.Position.TOP}setEllipsisPosition(e){this.setProperty("ellipsisPosition",e)}_setChildMenuFilters(){this.orderedMenuItems.all.forEach(e=>e.setMenuFilter(this.menuFilter))}_attachMenuHandlers(){this.orderedMenuItems.all.forEach(e=>{e.events.count("propertyChange",this._menuItemPropertyChangeHandler)===0&&e.on("propertyChange",this._menuItemPropertyChangeHandler),e.events.count("focus",this._focusHandler)===0&&e.on("focus",this._focusHandler)})}_detachMenuHandlers(){this.orderedMenuItems.all.forEach(e=>{e.off("propertyChange",this._menuItemPropertyChangeHandler),e.off("focus",this._focusHandler)})}setMenuItems(e){let t=p.ensure(e);if(p.equals(this.menuItems,t)){this.menuboxRight.link(this.menuboxRight.menuItems),this.menuboxLeft.link(this.menuboxLeft.menuItems);return}this.setProperty("menuItems",t)}_setMenuItems(e,t){this._detachMenuHandlers(),this.orderedMenuItems=this._createOrderedMenus(e),t?(this.menuboxRight.setMenuItems(this.orderedMenuItems.right),this.menuboxLeft.setMenuItems(this.orderedMenuItems.left)):(this.menuboxLeft.setMenuItems(this.orderedMenuItems.left),this.menuboxRight.setMenuItems(this.orderedMenuItems.right)),this._setChildMenuFilters(),this._attachMenuHandlers(),this.updateVisibility(),this.updateDefaultMenu(),this._setProperty("menuItems",e)}_renderMenuItems(){Fe.updateFirstLastMarker(this.menuItems),this.updateLeftOfButtonMarker(),this.invalidateLayoutTree()}_removeMenuItems(){}_createOrderedMenus(e){let t=this.menuSorter.order(e),i=-1,s;if(t.right.forEach(r=>{r.rightAligned=!0}),t.all.length>0){if(this._ellipsis&&(this._ellipsis.setChildActions([]),this._ellipsis.destroy()),s=u.create(yo,{parent:this,cssClass:"overflow-menu-item"}),this._ellipsis=s,this.ellipsisPosition===Ce.EllipsisPosition.RIGHT){let r=this._getFirstStackableIndexPosition(t.right.slice().reverse());r>-1?(i=t.right.length-r,s.rightAligned=!0,t.right.splice(i,0,s)):(r=this._getFirstStackableIndexPosition(t.left.slice().reverse()),r>-1&&(i=t.left.length-r,t.left.splice(i,0,s)))}else i=this._getFirstStackableIndexPosition(t.left),i>-1?t.left.splice(i,0,s):(i=this._getFirstStackableIndexPosition(t.right),i>-1&&(s.rightAligned=!0,t.right.splice(i,0,s)));t.all=t.left.concat(t.right)}return t}_getFirstStackableIndexPosition(e){let t=-1;return e.some((i,s)=>i.stackable&&i.visible?(t=s,!0):!1),t}_updateTabbableMenu(){this.tabbable&&(this.defaultMenu&&this.defaultMenu.isTabTarget()?this.setTabbableMenu(this.defaultMenu):this.setTabbableMenu(this.allMenusAsFlatList().find(e=>e.isTabTarget())))}setTabbableMenu(e){!this.tabbable||e===this.tabbableMenu||(this.tabbableMenu&&this.tabbableMenu.setTabbable(!1),this.tabbableMenu=e,e&&e.setTabbable(!0))}setHiddenByUi(e){this.setProperty("hiddenByUi",e)}updateVisibility(){$e.updateSeparatorVisibility(this.orderedMenuItems.left),$e.updateSeparatorVisibility(this.orderedMenuItems.right),this.setVisible(!this.hiddenByUi&&this.orderedMenuItems.all.some(e=>e.visible&&!e.ellipsis))}updateDefaultMenu(e){let t=null;for(let i=0;i<this.orderedMenuItems.all.length;i++){let s=this.orderedMenuItems.all[i];if(!(!s.visible||!s.enabled||s.defaultMenu===!1)){if(s.defaultMenu){t=s;break}!t&&this._isDefaultKeyStroke(s.actionKeyStroke)&&(t=s)}}this.setDefaultMenu(t),u.nvl(e,!0)&&this._updateTabbableMenu()}_isDefaultKeyStroke(e){return u.isOneOf(m.ENTER,e.which)&&!e.ctrl&&!e.alt&&!e.shift}setDefaultMenu(e){this.setProperty("defaultMenu",e)}_setDefaultMenu(e){this.defaultMenu&&this.defaultMenu.setMenuStyle(J.MenuStyle.NONE),e&&e.setMenuStyle(J.MenuStyle.DEFAULT),this._setProperty("defaultMenu",e)}updateLeftOfButtonMarker(){this._updateLeftOfButtonMarker(this.orderedMenuItems.left),this._updateLeftOfButtonMarker(this.orderedMenuItems.right)}_updateLeftOfButtonMarker(e){let t,i;e=e.filter(s=>s.visible&&s.rendered);for(let s=0;s<e.length;s++)t=e[s],t.$container.removeClass("left-of-button"),s>0&&t.isButton()&&(i=e[s-1],i.$container.addClass("left-of-button"))}_onMenuItemPropertyChange(e){let t=e.source;if((e.propertyName==="overflown"||e.propertyName==="enabledComputed"||e.propertyName==="visible"||e.propertyName==="hidden")&&(!this.tabbableMenu||t===this.tabbableMenu)&&this._updateTabbableMenu(),(e.propertyName==="overflown"||e.propertyName==="hidden")&&(!this.defaultMenu||t===this.defaultMenu)&&this.updateDefaultMenu(),e.propertyName==="horizontalAlignment"&&this.reorderMenus(e.newValue<=0),e.propertyName==="visible"){let i=this.visible;this.updateVisibility(),!i&&this.visible&&this.revalidateLayout(),t.separator||this.reorderMenus()}(e.propertyName==="keyStroke"||e.propertyName==="enabledComputed"||e.propertyName==="defaultMenu"||e.propertyName==="visible")&&this.updateDefaultMenu()}_onMenuItemFocus(e){this.setTabbableMenu(e.source)}reorderMenus(e){let t=this.menuItems;this._setMenuItems(t,e),this.rendered&&this.updateLeftOfButtonMarker()}allMenusAsFlatList(){return $e.flatTopLevelActions(this.orderedMenuItems.all)}}Z.uuidPathSkipWidgets.add(Ce);class Fs extends ne{collapsed;_menuBar;_overflowMenuItems;constructor(e){super(),this._menuBar=e,this._overflowMenuItems=[],this.collapsed=!1}layout(e){let t=this._menuBar.orderedMenuItems.left.concat(this._menuBar.orderedMenuItems.right),i=this.visibleMenuItems(),s=x.get(e),r=p.find(t,o=>o.ellipsis);this._setFirstLastMenuMarker(i),this.preferredLayoutSize(e,{widthHint:s.availableSize().width,undo:!1}),r&&this._overflowMenuItems.length>0&&r.setHidden(!1),i.forEach(o=>o._setOverflown(!1)),this._overflowMenuItems.forEach(o=>o._setOverflown(!0)),r&&this._overflowMenuItems.length===0&&r.setHidden(!0),this._overflowMenuItems=this._overflowMenuItems.filter(o=>!o.separator),r&&(r._closePopup(),r.setChildActions(this._overflowMenuItems)),i.forEach(o=>o.validateLayout()),i.forEach(o=>{o.popup&&o.popup.position()})}preferredLayoutSize(e,t){if(this._overflowMenuItems=[],!this._menuBar.visible)return new F(0,0);let i=this.visibleMenuItems(),s=i.filter(c=>{let f=c.overflown;return c._setOverflown(!1),f}),r=i.filter(c=>{let f=!c.textVisible;return this.undoShrink([c]),f}),o=[...i],l=x.get(e),a=new F(0,0),d=Number.MAX_VALUE;return(t.widthHint===0||t.widthHint)&&(d=t.widthHint-l.insets().horizontal()),d<=0?a=this._minSize(i):(a=this._prefSize(i),a.width>d&&this.shrink(i),a=this._prefSizeWithOverflow(i,d)),u.nvl(t.undo,!0)&&(this.undoOverflow(s),this.undoShrink(o),this.shrink(r)),a.add(l.insets())}_prefSizeWithOverflow(e,t){let i=[];e.forEach((o,l)=>{o.stackable&&i.push(l)});let s=-1;this._setFirstLastMenuMarker(e);let r=this._prefSize(e);for(;r.width>t&&i.length>0;)this._menuBar.ellipsisPosition===Ce.EllipsisPosition.RIGHT?s=i.splice(-1)[0]:s=i.splice(0,1)[0]-this._overflowMenuItems.length,this._overflowMenuItems.splice(0,0,e[s]),e.splice(s,1),this._setFirstLastMenuMarker(e),r=this._prefSize(e);return r}_minSize(e){let t=e.filter(i=>!i.stackable);return this.shrink(e),this._setFirstLastMenuMarker(t,!0),this._prefSize(t,!0)}_prefSize(e,t){let i=new F(0,0);return t=u.nvl(t,this._overflowMenuItems.length>0),this._setFirstLastMenuMarker(e,t),e.forEach(s=>{let r=new F(0,0);s.ellipsis?t&&(r=this._menuItemSize(s)):r=this._menuItemSize(s),i.height=Math.max(i.height,r.height),i.width+=r.width}),i}_menuItemSize(e){let t=e.$container.attr("class");e.$container.removeClass("overflown"),e.$container.removeClass("hidden"),e.htmlComp.invalidateLayout();let i=e.htmlComp.prefSize({useCssSize:!0,exact:!0}).add(C.margins(e.$container));return e.$container.attrOrRemove("class",t),i}_setFirstLastMenuMarker(e,t){let i=e;t=u.nvl(t,this._overflowMenuItems.length>0),this._menuBar.orderedMenuItems.all.forEach(s=>s.$container.removeClass("first last")),t||(i=i.filter(s=>!s.ellipsis)),i.length>0&&(i[0].$container.addClass("first"),i[i.length-1].$container.addClass("last"))}undoOverflow(e){e.forEach(t=>t._setOverflown(!0))}shrink(e){e.forEach(t=>{t.htmlComp.suppressInvalidate=!0,t.shrink(),t.htmlComp.suppressInvalidate=!1})}undoShrink(e){e.forEach(t=>{t.htmlComp.suppressInvalidate=!0,t.undoShrink(),t.htmlComp.suppressInvalidate=!1})}visibleMenuItems(){return this._menuBar.orderedMenuItems.all.filter(e=>e.visible)}static size(e,t){let i=e.prefSize({widthHint:t.width});return i.width=t.width,i=i.subtract(e.margins()),i}}class od extends B{constructor(e){super(),this.field=e,this.which=[m.LEFT],this.renderingHints.render=!1,this.stopPropagation=!0,this.keyStrokeMode=B.Mode.DOWN,this.inheritAccessibility=!1}handle(e){let t=this.field.allMenusAsFlatList(),i=this.field.$container.find(":focus"),s,r,o;for(s=0;s<t.length;s++){if(r=t[s],i[0]===r.$container[0]){o&&(this.field.setTabbableMenu(o),o.focus());break}r.isTabTarget()&&(o=r)}}}class ld extends B{constructor(e){super(),this.field=e,this.which=[m.RIGHT],this.renderingHints.render=!1,this.stopPropagation=!0,this.keyStrokeMode=B.Mode.DOWN,this.inheritAccessibility=!1}handle(e){let t=this.field.allMenusAsFlatList(),i=this.field.$container.find(":focus"),s,r,o=!1;for(s=0;s<t.length;s++){if(r=t[s],o&&r.isTabTarget()){this.field.setTabbableMenu(r),r.focus();break}i[0]===r.$container[0]&&(o=!0)}}}class ad extends bt{menu;constructor(){super(),this.menu=null,this.windowPaddingX=0,this.windowPaddingY=0}_init(e){e.anchor=e.menu,e.closeOnAnchorMouseDown=!1,super._init(e)}_render(){super._render(),this.$container.addClass("menu-bar-popup")}_getMenuItems(){return this.menu.childActions}}class vo extends I{menuItems;tooltipPosition;constructor(){super(),this.menuItems=[],this.tooltipPosition="top",this._addWidgetProperties("menuItems")}_render(){this.$container=this.$parent.appendDiv("menubar-box"),T.role(this.$container,"none"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new hd(this))}_renderProperties(){super._renderProperties(),this._renderMenuItems()}_remove(){this._removeMenuItems(),super._remove()}setMenuItems(e){let t=p.ensure(e);p.equals(this.menuItems,t)||this.setProperty("menuItems",t)}_setMenuItems(e){this._setProperty("menuItems",e),this._updateTooltipPosition()}_removeMenuItems(){this.menuItems.forEach(e=>e.remove())}_renderMenuItems(){this.menuItems.forEach(e=>{e.render(this.$container),e.$container.addClass("menubar-item")}),this.rendering||this.invalidateLayoutTree()}_renderVisible(){super._renderVisible(),this.revalidateLayout()}setTooltipPosition(e){this.setProperty("tooltipPosition",e)}_setTooltipPosition(e){this._setProperty("tooltipPosition",e),this._updateTooltipPosition()}_updateTooltipPosition(){this.menuItems.forEach(e=>e.setTooltipPosition(this.tooltipPosition))}}Z.uuidPathSkipWidgets.add(vo);class hd extends ne{menubox;constructor(e){super(),this.menubox=e}layout(e){}preferredLayoutSize(e,t){let i=null;return this.menubox.menuItems.filter(s=>!s.overflown&&s.visible).reduce((s,r)=>(i=r.htmlComp.prefSize({useCssSize:!0,includeMargin:!0}),s.height=Math.max(s.height,i.height),s.width=Math.max(s.width,i.width),s),new F)}}class ze extends I{monthViewNumberOfWeeks;numberOfHourDivisions;widthPerDivision;heightPerDivision;startHour;heightPerHour;heightPerDay;spaceBeforeScrollTop;workDayIndices;displayCondensed;displayMode;components;selectedComponent;loadInProgress;selectedDate;selectorStart;selectorEnd;showDisplayModeSelection;rangeSelectionAllowed;resources;selectedResource;defaultResource;title;useOverflowCells;viewRange;calendarToggleListWidth;calendarToggleYearWidth;menuInjectionTarget;modesMenu;menus;calendarSidebar;yearPanel;resourcePanel;selectedRange;needsScrollToStartHour;defaultMenuTypes;showCalendarSidebar;showResourcePanel;showListPanel;$header;$range;$commands;$grids;$grid;$topGrid;$list;$listContainer;$listTitle;$progress;$headerRow1;$headerRow2;$title;$select;$window;_exactRange;_listComponents;_menuInjectionTargetMenusChangedHandler;_leafResources;_moveData;_rangeSelectionStarted;_mouseMoveHandler;_mouseUpHandler;_mouseMoveRangeSelectionHandler;_mouseUpRangeSelectionHandler;constructor(){super(),this.monthViewNumberOfWeeks=6,this.numberOfHourDivisions=2,this.heightPerDivision=30,this.startHour=6,this.heightPerHour=this.numberOfHourDivisions*this.heightPerDivision,this.heightPerDay=24*this.heightPerHour,this.spaceBeforeScrollTop=15,this.workDayIndices=[1,2,3,4,5],this.components=[],this.displayCondensed=!1,this.displayMode=ze.DisplayMode.MONTH,this.loadInProgress=!1,this.selectedDate=new Date,this.showDisplayModeSelection=!0,this.rangeSelectionAllowed=!1,this.defaultResource=this._createDefaultResource(),this.resources=[],this.selectedResource=this.defaultResource,this.title=null,this.useOverflowCells=!0,this.viewRange=null,this.calendarToggleListWidth=270,this.calendarToggleYearWidth=215,this.defaultMenuTypes=[ze.MenuType.EmptySpace],this.$container=null,this.$header=null,this.$range=null,this.$commands=null,this.$grids=null,this.$grid=null,this.$topGrid=null,this.$list=null,this.$progress=null,this.showCalendarSidebar=!1,this.showListPanel=!1,this.showResourcePanel=!1,this._exactRange=null,this._listComponents=[],this.menuInjectionTarget=null,this._menuInjectionTargetMenusChangedHandler=null,this._moveData=null,this._mouseMoveHandler=this._onMouseMove.bind(this),this._mouseUpHandler=this._onMouseUp.bind(this),this._mouseMoveRangeSelectionHandler=this._onMouseMoveRangeSelection.bind(this),this._mouseUpRangeSelectionHandler=this._onMouseUpRangeSelection.bind(this),this.selectedRange=null,this._addWidgetProperties(["components","menus","selectedComponent","calendarSidebar"]),this._addPreserveOnPropertyChangeProperties(["selectedComponent"])}static DisplayMode={DAY:1,WEEK:2,MONTH:3,WORK_WEEK:4};static Direction={BACKWARD:-1,FORWARD:1};static MenuType={EmptySpace:"Calendar.EmptySpace",CalendarComponent:"Calendar.CalendarComponent"};isDay(){return this.displayMode===ze.DisplayMode.DAY}isWeek(){return this.displayMode===ze.DisplayMode.WEEK}isMonth(){return this.displayMode===ze.DisplayMode.MONTH}isWorkWeek(){return this.displayMode===ze.DisplayMode.WORK_WEEK}_createKeyStrokeContext(){return new Ee}_createDefaultResource(){return{resourceId:yi.ZERO_UUID,selectable:!0,visible:!0}}_init(e){super._init(e),this.calendarSidebar=u.create(Bu,{parent:this}),this.yearPanel=this.calendarSidebar.yearPanel,this.resourcePanel=this.calendarSidebar.resoucePanel,this.resourcePanel.treeBox.on("propertyChange:value",this._onResourceVisibilityChanged.bind(this)),this.yearPanel.on("dateSelect",this._onYearPanelDateSelect.bind(this)),this.modesMenu=u.create(cd,{parent:this,visible:!1,displayMode:this.displayMode}),this._setSelectedDate(this.selectedDate),this._setDisplayMode(this.displayMode),this._setMenuInjectionTarget(this.menuInjectionTarget),this._setResources(this.resources),this._exactRange=this._calcExactRange(),this.yearPanel.setViewRange(this._exactRange),this.viewRange=this._calcViewRange()}_updateResourcePanelDisplayable(){this.calendarSidebar.setResourcePanelDisplayable(this.resources.length>1)}setSelectedDate(e){this.setProperty("selectedDate",e)}_setSelectedDate(e){e=S.ensure(e),u.assertParameter("selectedDate",e,Date),this._setProperty("selectedDate",e),this.yearPanel.selectDate(this.selectedDate)}_renderSelectedDate(){this._updateModel(!1)}setDisplayMode(e){if(b.equals(this.displayMode,e))return;let t=this.displayMode;this._setDisplayMode(e),this.rendered&&this._renderDisplayMode(t)}_setDisplayMode(e){if(this._setProperty("displayMode",e),this.yearPanel.setDisplayMode(this.displayMode),this.modesMenu.setDisplayMode(e),this.isWorkWeek()){let t=this._dateParts(this.selectedDate,!0);t.day>4&&this.setSelectedDate(new Date(t.year,t.month,t.date-t.day+4))}this.selectedRange=null,this.selectedResource=this.defaultResource,this.trigger("selectedRangeChange"),this.trigger("selectedResourceChange",{resourceId:null})}_renderDisplayMode(e){if(this.rendering)return;this._updateModel(!0),p.containsAny([this.displayMode,e],[ze.DisplayMode.DAY,ze.DisplayMode.MONTH])&&(this._renderComponents(),this.needsScrollToStartHour=!0)}_setViewRange(e){e=Ne.ensure(e),this._setProperty("viewRange",e)}_setRangeSelectionAllowed(e){this.rangeSelectionAllowed=e,this.rangeSelectionAllowed||this.setSelectedRange(null)}setSelectedRange(e){let t=Ne.ensure(e);t&&t.from&&t.to?(this.selectorStart=new Date(t.from),this.selectorStart.setHours(0,this._getHours(this.selectorStart)*60),this.selectorEnd=new Date(t.to),this.selectorEnd.setHours(0,this._getHours(this.selectorEnd)*60-30),this._setRangeSelection()):(this.selectorStart=null,this.selectorEnd=null,this._removeRangeSelection()),this._updateSelectedRange()}_setMenus(e){if(this._checkMenuInjectionTarget(this.menuInjectionTarget)){let t=this._removeInjectedMenus(this.menuInjectionTarget,this.menus);this.menuInjectionTarget.setMenus(e.concat(t))}this._setProperty("menus",e)}_setMenuInjectionTarget(e){if(b.isString(e)&&(e=u.widget(e)),this._checkMenuInjectionTarget(this.menuInjectionTarget)){e.off("propertyChange:menus",this._menuInjectionTargetMenusChangedHandler);let t=this._removeInjectedMenus(this.menuInjectionTarget,this.menus);this.menuInjectionTarget.setMenus(t)}this._checkMenuInjectionTarget(e)&&(e.setMenus(this.menus.concat(e.menus)),this._menuInjectionTargetMenusChangedHandler=t=>{this.menuInjectionTarget.menus.some(i=>this.menus.includes(i))||this.menuInjectionTarget.setMenus(this.menus.concat(this.menuInjectionTarget.menus))},e.on("propertyChange:menus",this._menuInjectionTargetMenusChangedHandler)),this._setProperty("menuInjectionTarget",e)}_checkMenuInjectionTarget(e){return e instanceof ae}_removeInjectedMenus(e,t){return e.menus.filter(i=>!t.includes(i))}setShowCalendarSidebar(e){this.setProperty("showCalendarSidebar",e)}setShowResourcePanel(e){this.setProperty("showResourcePanel",e)}setShowListPanel(e){this.setProperty("showListPanel",e)}_render(){this.$container=this.$parent.appendDiv("calendar");let e=new ud(this);this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(e);let t=w.get().type===w.Type.MOBILE;this.$header=this.$container.appendDiv("calendar-header"),this.$header.toggleClass("mobile",t),this.$headerRow1=this.$header.appendDiv("calendar-header-row first"),this.$headerRow2=this.$header.appendDiv("calendar-header-row last"),this.calendarSidebar.render(),this.$grids=this.$container.appendDiv("calendar-grids"),this.$topGrid=this.$grids.appendDiv("calendar-top-grid"),this.$topGrid.toggleClass("mobile",t),this.$grid=this.$grids.appendDiv("calendar-grid"),this.$grid.toggleClass("mobile",t),this.$listContainer=this.$container.appendDiv("calendar-list-container"),this.$list=this.$listContainer.appendDiv("calendar-list calendar-scrollable-components"),this.$listTitle=this.$list.appendDiv("calendar-list-title"),this.$range=this.$headerRow1.appendDiv("calendar-range"),this.$range.appendDiv("calendar-previous").on("click",this._onPreviousClick.bind(this)),this.$range.appendDiv("calendar-today",this.session.text("ui.CalendarToday")).on("click",this._onTodayClick.bind(this)),this.$range.appendDiv("calendar-next").on("click",this._onNextClick.bind(this)),this.$title=this.$headerRow1.appendDiv("calendar-title"),this.$select=this.$title.appendDiv("calendar-select"),this.$progress=this.$title.appendDiv("busyindicator-label"),this.$commands=this.$headerRow1.appendDiv("calendar-commands"),this.$commands.appendDiv("calendar-mode first",this.session.text("ui.CalendarDay")).attr("data-mode",ze.DisplayMode.DAY).on("click",this._onDisplayModeClick.bind(this)),this.$commands.appendDiv("calendar-mode",this.session.text("ui.CalendarWorkWeek")).attr("data-mode",ze.DisplayMode.WORK_WEEK).on("click",this._onDisplayModeClick.bind(this)),this.$commands.appendDiv("calendar-mode",this.session.text("ui.CalendarWeek")).attr("data-mode",ze.DisplayMode.WEEK).on("click",this._onDisplayModeClick.bind(this)),this.$commands.appendDiv("calendar-mode last",this.session.text("ui.CalendarMonth")).attr("data-mode",ze.DisplayMode.MONTH).on("click",this._onDisplayModeClick.bind(this)),this.modesMenu.render(this.$commands),this.$commands.appendDiv("calendar-toggle-sidebar").on("click",this._onCalendarSidebarClick.bind(this)),this._updateResourcePanelDisplayable(),this.$commands.appendDiv("calendar-toggle-list").on("click",this._onListClick.bind(this));let i=this.$topGrid.appendDiv("calendar-week-header");i.appendDiv("calendar-week-name");for(let o=0;o<7;o++)i.appendDiv("calendar-day-name").data("day",o);let s=this.$topGrid.appendDiv("calendar-week-allday-container");s.appendDiv("calendar-week-name");let r=this._onDayContextMenu.bind(this);for(let o=0;o<7;o++)s.appendDiv("calendar-day").data("day",o).on("contextmenu",r);for(let o=1;o<7;o++){let l=this.$grid.appendDiv("calendar-week");for(let a=0;a<8;a++){let d=l.appendDiv();o>0&&a===0?d.addClass("calendar-week-name"):o>0&&a>0&&d.addClass("calendar-day").data("day",a).data("week",o).on("contextmenu",r)}}this.$window=this.$container.window(),this.$container.on("mousedown touchstart",this._onMouseDown.bind(this)),this._updateScreen(!1,!1)}_renderProperties(){super._renderProperties(),this._renderResources(),this._renderComponents(),this._renderSelectedComponent(),this._renderLoadInProgress(),this._renderDisplayMode()}setResources(e){this.setProperty("resources",e)}_setResources(e){this._setProperty("resources",e),this._updateLeafResources(),this._updateResourcePanelDisplayable(),this._updateResourcePanel(),this._validateSelectedResource()}_renderResources(){let e=this.$topGrid.find(".calendar-week-header > .calendar-day-name"),t=this.$topGrid.find(".calendar-week-allday-container > .calendar-day"),i=this.$grid.find(".calendar-week > .calendar-day");e.find(".resource-column").remove(),t.find(".resource-column").remove(),i.find(".resource-column").remove(),e.appendDiv("resource-column").data("resourceId",this.defaultResource.resourceId),t.appendDiv("resource-column").data("resourceId",this.defaultResource.resourceId).addClass("calendar-scrollable-components"),i.appendDiv("resource-column").data("resourceId",this.defaultResource.resourceId),this._leafResources.forEach(o=>{e.appendDiv("resource-column").data("resourceId",o.resourceId).attr("data-resource-name",o.name),t.appendDiv("resource-column").data("resourceId",o.resourceId).addClass("calendar-scrollable-components"),i.appendDiv("resource-column").data("resourceId",o.resourceId)});let s=this._onDayColumnMouseDown.bind(this,!0);this.$grid.find(".resource-column").on("mousedown",s);let r=this._onDayColumnMouseDown.bind(this,!1);this.$topGrid.find(".resource-column").on("mousedown",r),this.rendering||this._renderComponents()}_updateResourcePanel(){this.resourcePanel.treeBox.lookupCall.setResources(this.resources),this.resourcePanel.treeBox.refreshLookup();let e=this.resources.filter(t=>t.visible).map(t=>t.resourceId);this.resourcePanel.treeBox.setValue(e)}_validateSelectedResource(){p.contains(this.resources,this.selectedResource)||(this.selectedResource=this.defaultResource,this.trigger("selectedResourceChange",{resourceId:this.selectedResource.resourceId}))}setComponents(e){this.setProperty("components",e)}_setComponents(e){let t=!1;this.isDay()&&(t=this._defaultResourceVisible()!==this._defaultResourceVisible(e)),this._setProperty("components",e),this.rendered&&t&&this.layoutSize(!0)}addComponents(e){this.setComponents([...this.components,...e])}_renderComponents(){this.components.sort(this._sortFromTo),this._updateFullDayIndices(),this.components.forEach(e=>e.remove()),this.components.forEach(e=>e.render()),P.update(this.$grid),this._arrangeComponents(),this._updateListPanel()}_renderSelectedComponent(){this.selectedComponent&&this.selectedComponent.setSelected(!0)}_renderLoadInProgress(){this.$progress.setVisible(this.loadInProgress)}updateScrollPosition(e){this.rendered?this._updateScrollPosition(!0,e):this.session.layoutValidator.schedulePostValidateFunction(this._updateScrollPosition.bind(this,!0,e))}_updateScrollPosition(e,t){if(this.isMonth())this._scrollToSelectedComponent(t);else if(this.selectedComponent)if(this.selectedComponent.fullDay)this._scrollToSelectedComponent(t),e&&this._scrollToInitialTime(t);else{let i=S.parseJsonDate(this.selectedComponent.fromDate),s=this._dayPosition(i.getHours(),i.getMinutes())/100,r=this.heightPerDay*s;P.scrollTop(this.$grid,r-this.spaceBeforeScrollTop,{animate:t})}else e&&this._scrollToInitialTime(t)}_updateScrollShadow(){P.updateScrollShadow(this.$grid)}_scrollToSelectedComponent(e){this.selectedComponent&&this.selectedComponent._$parts[0]&&this.selectedComponent._$parts[0].parent()&&this.selectedComponent._$parts[0].isVisible()&&P.scrollTo(this.selectedComponent._$parts[0].parent(),this.selectedComponent._$parts[0],{animate:e})}_scrollToInitialTime(e){if(this.needsScrollToStartHour=!1,!this.isMonth())if(this.selectedComponent&&!this.selectedComponent.fullDay){let t=S.parseJsonDate(this.selectedComponent.fromDate),i=this._dayPosition(t.getHours(),t.getMinutes())/100,s=this.heightPerDay*i;P.scrollTop(this.$grid,s-this.spaceBeforeScrollTop,{animate:e})}else{let t=this.heightPerHour*this.startHour;P.scrollTop(this.$grid,t-this.spaceBeforeScrollTop,{animate:e})}}_onPreviousClick(){this._navigateDate(ze.Direction.BACKWARD)}_onNextClick(){this._navigateDate(ze.Direction.FORWARD)}_dateParts(e,t){let i={year:e.getFullYear(),month:e.getMonth(),date:e.getDate(),day:e.getDay()};return t&&(i.day=(e.getDay()+6)%7),i}_navigateDate(e){this.selectedDate=this._calcSelectedDate(e),this._updateModel(!1)}_calcSelectedDate(e){let t=this._dateParts(this.selectedDate),i=e,s=e*7,r=e;if(this.isDay())return new Date(t.year,t.month,t.date+i);if(this.isWeek()||this.isWorkWeek())return new Date(t.year,t.month,t.date+s);if(this.isMonth())return S.shift(this.selectedDate,0,r,0)}_updateModel(e){this._exactRange=this._calcExactRange(),this.yearPanel.setViewRange(this._exactRange),this.viewRange=this._calcViewRange(),this.trigger("modelChange"),this._updateScreen(!0,e)}_calcExactRange(){let e,t,i=this._dateParts(this.selectedDate,!0);if(this.isDay())e=new Date(i.year,i.month,i.date),t=new Date(i.year,i.month,i.date);else if(this.isWeek())e=new Date(i.year,i.month,i.date-i.day),t=new Date(i.year,i.month,i.date-i.day+6);else if(this.isMonth())e=new Date(i.year,i.month,1),t=new Date(i.year,i.month+1,0);else if(this.isWorkWeek())e=new Date(i.year,i.month,i.date-i.day),t=new Date(i.year,i.month,i.date-i.day+4);else throw new Error("invalid value for displayMode");return new Ne(e,t)}_calcViewRange(){let e=i(this._exactRange.from),t=s(e);return new Ne(e,t);function i(r){let o,l=new Date(r.valueOf());for(o=0;o<42;o++)if(l.setDate(l.getDate()-1),l.getDay()===1&&l.getMonth()!==r.getMonth())return l;throw new Error("failed to calc viewFrom date")}function s(r){let o,l=new Date(r.valueOf());for(o=0;o<42;o++)l.setDate(l.getDate()+1);return l}}_onTodayClick(e){this.selectedDate=new Date,this._updateModel(!1)}_onDisplayModeClick(e){let t=h()(e.target).data("mode");this.setDisplayMode(t)}_onCalendarSidebarClick(e){this.setShowCalendarSidebar(!this.showCalendarSidebar),this._updateScreen(!0,!0)}_onListClick(e){this.setShowListPanel(!this.showListPanel),this._updateScreen(!1,!0)}_onDayColumnMouseDown(e,t){let i=h()(t.delegateTarget),s=new Date(i.parent().data("date")),r=!1,o=i.data("resourceId"),l=o!==this.selectedResource.resourceId;if(this._get$CalendarComponent(h()(t.target)).length>0)return;let a=document.elementsFromPoint(t.pageX,t.pageY).find(c=>c.classList.contains("calendar-component"));if(t.button===0&&a){let c=h()(a),f=c.data("component");if(f){f.applySelection(c,!0,t.originalEvent.clientY);return}}if(!s.valueOf())return;let d=e&&(this.isDay()||this.isWeek()||this.isWorkWeek());if(d){let c=this._getSelectedSeconds(t);c<60*60*24&&(s.setSeconds(c),r=!0)}this._setSelection(s,o,null,!1,r),d&&this._startRangeSelection(t,l)}_getSelectedDate(e){let t=null,i=h()(e.target);return i.hasClass("calendar-day")?t=i.data("date"):i.hasClass("resource-column")?t=i.parent().data("date"):(i.hasClass("calendar-component")||i.parents(".calendar-component").length>0||i.hasClass("calendar-range-selector"))&&(t=i.closest(".calendar-day").data("date")),t?new Date(t):null}_getSelectedSeconds(e){let t=e.originalEvent.layerY,i=h()(e.target),s=this._get$CalendarComponent(i);return s.length>0?t+=s.position().top:i.hasClass("calendar-range-selector")&&(t+=i.position().top),Math.floor(t/this.heightPerDivision)/this.numberOfHourDivisions*60*60}_getSelectedDateTime(e){let t=this._getSelectedDate(e);if(t&&(this.isDay()||this.isWeek()||this.isWorkWeek())){let i=this._getSelectedSeconds(e);i<60*60*24&&t.setSeconds(i)}return t}_setSelection(e,t,i,s,r){let o=!1,l=S.compareDays(this.selectedDate,e)!==0;(l||r)&&(o=!0,l&&h()(".calendar-day",this.$container).each((d,c)=>{let f=h()(c),g=f.data("date");!g||S.compareDays(g,this.selectedDate)===0?f.select(!1):S.compareDays(g,e)===0&&f.select(!0)}),this.selectedDate=e);let a=this.selectedResource;b.isString(t)?a=this.findResourceForId(t):t&&(a=t),a!==this.selectedResource&&a.selectable&&(o=!0,this.selectedResource=a,this.trigger("selectedResourceChange",{resourceId:a.resourceId})),this.selectedComponent!==i&&(o=!0,this.selectedComponent&&this.selectedComponent.setSelected(!1),i&&i.setSelected(!0),this.selectedComponent=i),o&&(this.trigger("selectionChange"),l&&this._updateListPanel(),s&&this._updateScrollPosition(!1,!0)),this.showCalendarSidebar&&this.yearPanel.selectDate(this.selectedDate)}_get$CalendarComponent(e){return e.closest(".calendar-component")}_updateScreen(e,t){h().log.isInfoEnabled()&&h().log.info("(Calendar#_updateScreen)"),h()(".calendar-mode",this.$commands).select(!1),h()('[data-mode="'+this.displayMode+'"]',this.$commands).select(!0),h()(".selected",this.$grid).select(!1),this.layoutLabel(),this.layoutSize(t),this.layoutAxis(),this.showCalendarSidebar&&this.yearPanel.selectDate(this.selectedDate),this._updateListPanel(),this._updateScrollbars(this.$grid,t),e&&!this.isMonth()&&this._updateTopGrid(),this.setSelectedRange(this.selectedRange)}layoutSize(e){h()("div",this.$container).removeData(["new-width","new-height"]),this.$grids.toggleClass("calendar-grids-month",this.isMonth());let t=h()(".selected",this.$grid),i=h()(".selected",this.$topGrid),s=this.$container.width(),r=this.$grid.height(),o=this.$grid.innerWidth()-this.$grid.width(),l=s-o;this.showCalendarSidebar?(this.calendarSidebar.$container.data("new-width",this.calendarToggleYearWidth),l-=this.calendarToggleYearWidth,s-=this.calendarToggleYearWidth):this.calendarSidebar.$container.data("new-width",0),this.calendarSidebar.setResourcePanelExpanded(this.showResourcePanel),h()(".calendar-toggle-list",this.$commands).select(this.showListPanel),this.showListPanel?(this.$list.parent().data("new-width",this.calendarToggleListWidth),l-=this.calendarToggleListWidth,s-=this.calendarToggleListWidth):this.$list.parent().data("new-width",0),this.$grids.data("new-width",s);let a=h()(),d=h()(".calendar-week",this.$grid);if(this.isDay()||this.isWeek()||this.isWorkWeek()){d.removeClass("calendar-week-noborder");let g=t.parent();a=d.not(g),a.data("new-height",0),a.removeClass("invisible"),g.data("new-height",this.heightPerDay),g.addClass("calendar-week-noborder"),g.removeClass("hidden invisible"),h()(".calendar-day",g).data("new-height",this.heightPerDay),h()(".calendar-week-name",this.$grid).addClass("invisible"),h()(".calendar-week-allday-container",this.$topGrid).removeClass("hidden"),h()(".calendar-week-task",this.$topGrid).removeClass("hidden")}else{let g=r/this.monthViewNumberOfWeeks;d.removeClass("calendar-week-noborder invisible hidden"),d.eq(0).addClass("calendar-week-noborder"),d.data("new-height",g),h()(".calendar-day",this.$grid).data("new-height",g);let y=h()(".calendar-week-name",this.$grid);y.removeClass("hidden invisible"),y.data("new-height",g),h()(".calendar-week-allday-container",this.$topGrid).addClass("hidden"),h()(".calendar-week-task",this.$topGrid).addClass("hidden")}let c=l-45;if(this.isDay())h()(".calendar-day-name, .calendar-day",this.$topGrid).data("new-width",0),h()(".calendar-day",this.$grid).data("new-width",0),h()(".calendar-day-name:nth-child("+(i.index()+1)+")",this.$topGrid).data("new-width",c),h()(".calendar-day:nth-child("+(i.index()+1)+")",this.$topGrid).data("new-width",c),h()(".calendar-day:nth-child("+(t.index()+1)+")",this.$grid).data("new-width",c),this.widthPerDivision=c;else if(this.isWorkWeek()){this.$topGrid.find(".calendar-day-name").data("new-width",0),this.$grids.find(".calendar-day").data("new-width",0);let g=Math.round(c/this.workDayIndices.length);this.$topGrid.find(".calendar-day-name").slice(0,5).data("new-width",g),this.$topGrid.find(".calendar-day").slice(0,5).data("new-width",g),h()(".calendar-day:nth-child(-n+6)",this.$grid).data("new-width",g),this.widthPerDivision=g}else if(this.isMonth()||this.isWeek()){let g=Math.round(c/7);this.$grids.find(".calendar-day").data("new-width",g),this.$topGrid.find(".calendar-day-name").data("new-width",g),this.widthPerDivision=g}let f=0;this.isDay()?f=Math.round(c/(this._leafResources.filter(g=>g.visible).length+(this._defaultResourceVisible()?1:0))):this.isWorkWeek()?f=Math.round(c/this.workDayIndices.length):f=Math.round(c/7),this.isDay()?(h()(".resource-column",this.$grids).data("new-width",0),h()(".calendar-day-name:nth-child("+(i.index()+1)+")",this.$topGrid).add(h()(".calendar-day:nth-child("+(i.index()+1)+")",this.$grids)).find(".resource-column").filter((g,y)=>{let v=h()(y).data("resourceId");if(v===this.defaultResource.resourceId)return this._defaultResourceVisible();let D=this.findResourceForId(v);return D?D.visible:!1}).data("new-width",f)):(h()(".resource-column",this.$grids).data("new-width",0),h()(".resource-column",this.$grids).filter((g,y)=>h()(y).data("resourceId")===this.defaultResource.resourceId).data("new-width",f)),this.isMonth()&&h()(".component-month",this.$grid).each(function(){let g=h()(this),y=g.closest(".calendar-day");g.toggleClass("compact",y.data("new-width")<rr.MONTH_COMPACT_THRESHOLD)}),h()("div",this.$container).each((g,y)=>{let v=h()(y),D=v.data("new-width"),k=v.data("new-height");if(v.stop(!1,!0),D!==void 0&&D!==v.outerWidth())if(e){let V={complete:()=>this._afterLayout(v,e)};v[0]===this.$grids[0]&&(V.progress=()=>this._afterLayout(v,e)),v.animate({width:D},V)}else v.css("width",D),this._afterLayout(v,e);k!==void 0&&k!==v.outerHeight()&&(k>0&&v.removeClass("hidden"),e?v.animateAVCSD("height",k,()=>{k===0&&v.addClass("hidden"),this._afterLayout(v,e)},()=>{this._afterLayout(v,e)}):(v.css("height",k),k===0&&v.addClass("hidden"),this._afterLayout(v,e)))})}_afterLayout(e,t){this.calendarSidebar.invalidateLayoutTree(!1),this._updateScrollbars(e,t),this._updateWeekdayNames()}_defaultResourceVisible(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.components).filter(t=>t.coveredDaysRange.covers(this.selectedDate,!0)).map(t=>t.item).map(t=>t?t.resourceId:this.defaultResource.resourceId).map(t=>this.isLeafResource(t)?t:this.defaultResource.resourceId).filter(t=>t===this.defaultResource.resourceId).length>0}isLeafResource(e){return!!this._leafResources.find(t=>t.resourceId===e)}findResourceForComponent(e){return this.findResourceForId(e.getResourceId())}findResourceForId(e){if(!e||e===this.defaultResource.resourceId)return this.defaultResource;let t=this.resources.find(i=>i.resourceId===e);return t||this.defaultResource}_updateWeekdayNames(){let e=this.$topGrid.width(),t;this.isDay()?e/=1:this.isWorkWeek()?e/=this.workDayIndices.length:(this.isWeek()||this.isMonth())&&(e/=7),e>90?t=this.session.locale.dateFormat.symbols.weekdaysOrdered:t=this.session.locale.dateFormat.symbols.weekdaysShortOrdered,h()(".calendar-day-name > .resource-column",this.$topGrid).filter((i,s)=>h()(s).data("resourceId")===this.defaultResource.resourceId).each((i,s)=>{h()(s).attr("data-resource-name",t[i])})}_updateScrollbars(e,t){h()(".calendar-scrollable-components",e).each((s,r)=>{P.update(h()(r),!0)}),this.updateScrollPosition(t),this._updateScrollShadow()}_uninstallComponentScrollbars(e){e.find(".calendar-scrollable-components").each((t,i)=>{P.uninstall(h()(i),this.session)})}_updateTopGrid(){h()(".calendar-component",this.$topGrid).each((t,i)=>{let s=h()(i).data("component");s&&s.remove()});const e=this.components.filter(t=>t.fullDay);this._updateFullDayIndices(e),e.forEach(t=>t.remove()),e.forEach(t=>t.render()),this._updateScrollbars(this.$topGrid,!1),P.update(this.$grid)}_updateFullDayIndices(e){e||(e=this.components.filter(o=>o.fullDay)),e.sort(this._sortFromTo);const{from:t,to:i}=this._exactRange,s=new Map;let r=0;for(const o of e){if(o.fullDayIndex=-1,o.coveredDaysRange.to<t||o.coveredDaysRange.from>i)continue;let l=o.coveredDaysRange.from;l<t&&(l=t);let a=this._calculateFullDayIndexKey(o,l),d=p.ensure(s.get(a));const c=d.length?p.max(d):0,f=p.init(c+2,null).map((y,v)=>v);p.removeAll(f,d);const g=p.min(f);for(o.fullDayIndex=g;l<=o.coveredDaysRange.to&&l<=i;)d.push(g),s.set(a,d),l=S.shift(l,0,0,1),a=this._calculateFullDayIndexKey(o,l),d=p.ensure(s.get(a));r=Math.max(g+1,r)}this.$grids.css("--full-day-components",r)}_calculateFullDayIndexKey(e,t){let i="";return this.isDay()&&(i=e.getResourceId()),i+t.valueOf()}layoutYearPanel(){this.showCalendarSidebar&&(P.update(this.yearPanel.$yearList),this.yearPanel._scrollYear())}layoutLabel(){let e,t,i,s=this._exactRange.from,r=this._exactRange.to;if(this.isDay())e=this._format(s,"EEEE, d. MMMM yyyy");else if(this.isWorkWeek()||this.isWeek()){let f=this.session.text("ui.to");s.getMonth()===r.getMonth()?e=_.join(" ",this._format(s,"d."),f,this._format(r,"d. MMMM yyyy")):s.getFullYear()===r.getFullYear()?e=_.join(" ",this._format(s,"d. MMMM"),f,this._format(r,"d. MMMM yyyy")):e=_.join(" ",this._format(s,"d. MMMM yyyy"),f,this._format(r,"d. MMMM yyyy"))}else this.isMonth()&&(e=this._format(s,"MMMM yyyy"));this.$select.text(e),t=h()(".calendar-day",this.$grid);let o,l,a,d=this._exactRange.from.getMonth(),c=new Date(this.viewRange.from.valueOf());for(o=0;o<this.monthViewNumberOfWeeks;o++)for(l=0;l<7;l++)a="",this.workDayIndices.indexOf(c.getDay())===-1?a=c.getMonth()!==d?" weekend-out":" weekend":a=c.getMonth()!==d?" out":"",S.isSameDay(c,new Date)&&(a+=" now"),S.isSameDay(c,this.selectedDate)&&(a+=" selected"),this.isMonth()||(a+=" calendar-no-label"),c.getDate()>9&&c.getDate()<20&&(a+=" center-nice"),e=this._format(c,"dd"),t.eq(o*7+l).removeClass("weekend-out weekend out selected now calendar-no-label").addClass(a).attr("data-day-name",e).data("date",new Date(c.valueOf())),c.setDate(c.getDate()+1);if(!this.isMonth()){i=h()(".calendar-day",this.$topGrid);let f=new Date(this._exactRange.from.valueOf());for(c=S.firstDayOfWeek(f,1),l=0;l<7;l++)a="",this.workDayIndices.indexOf(c.getDay())===-1?a=c.getMonth()!==d?" weekend-out":" weekend":a=c.getMonth()!==d?" out":"",S.isSameDay(c,new Date)&&(a+=" now"),S.isSameDay(c,this.selectedDate)&&(a+=" selected"),e=this._format(c,"dd"),i.eq(l).removeClass("weekend-out weekend out selected now").addClass(a).attr("data-day-name",e).data("date",new Date(c.valueOf())),c.setDate(c.getDate()+1)}}layoutAxis(){let e;h()(".calendar-week-axis, .calendar-week-task",this.$grid).remove();let t=this.session;if(h()(".calendar-week-name",this.$container).each(function(i){i>0&&(e=h()(this),e.text(t.text("ui.CW",S.weekInYear(e.next().data("date"))+"")))}),!this.isMonth()){let i=h()(".calendar-week",this.$grid);for(let s=0;s<24;s++){let r=("00"+s).slice(-2),o=s*this.heightPerHour;i.appendDiv("calendar-week-axis hour"+(s===0?" first":"")).attr("data-axis-name",r+":00").css("top",o+"px");for(let l=1;l<this.numberOfHourDivisions;l++)o+=this.heightPerDivision,i.appendDiv("calendar-week-axis").attr("data-axis-name","").css("top",o+"px")}}}_onYearPanelDateSelect(e){this.selectedDate=e.date,this._updateModel(!1)}_updateListPanel(){this.showListPanel&&(P.uninstall(this.$list,this.session),this._listComponents.forEach(e=>e.remove()),this._listComponents=[],this._renderListPanel(),P.install(this.$list,{parent:this,session:this.session,axis:"y"}))}_remove(){this._uninstallComponentScrollbars(this.$grid),this._uninstallComponentScrollbars(this.$topGrid),P.uninstall(this.$list,this.session),this.$window.off("mousemove touchmove",this._mouseMoveHandler).off("mouseup touchend touchcancel",this._mouseUpHandler),this._moveData=null,super._remove()}_renderListPanel(){this.$listTitle.text(this._format(this.selectedDate,"d. MMMM yyyy")),this.components.filter(e=>this._filterCurrentDate(e)).filter(e=>this._filterVisibleComponents(e)).forEach(e=>{let t=new dd(this.selectedDate,e);t.render(this.$list),this._listComponents.push(t)})}_filterCurrentDate(e){let t=S.trunc(this.selectedDate);return S.compare(t,e.coveredDaysRange.from)>=0&&S.compare(t,e.coveredDaysRange.to)<=0}_filterVisibleComponents(e){return this.findResourceForComponent(e).visible}_selectedComponentChanged(e,t,i,s){this._setSelection(i,t,e,s,!1)}_onDayContextMenu(e){this._showContextMenu(e,ze.MenuType.EmptySpace)}_showContextMenu(e,t){e.preventDefault(),e.stopPropagation();let i=(function(r,o){if(!this.rendered||!this.attached||!this._calculateContextMenuVisible(r))return;let l=$e.filter(this.menus,[o],{onlyVisible:!0,defaultMenuTypes:this.defaultMenuTypes}),a=h()(r.currentTarget);if(l.length===0)return;u.create(bt,{parent:this,menuItems:l,location:{x:r.pageX,y:r.pageY},$anchor:a}).open()}).bind(this);this.session.onRequestsDone(i,e,t)}_calculateContextMenuVisible(e){let t=h()(e.currentTarget),i=this.defaultResource.resourceId;return t.hasClass("calendar-component")&&this.selectedComponent?i=this.selectedComponent.getResourceId():i=h()(e.target).closest(".resource-column").data("resourceId"),this.findResourceForId(i).selectable}_onResourceVisibilityChanged(e){let t=e.newValue,i=this.resources.map(s=>s.resourceId).map(s=>[s,t.includes(s)]);this._updateResourceVisibility(i)}_updateResourceVisibility(e){this.initialized&&(e.forEach(t=>{this._updateResourcesVisibleProperty(t[0],t[1])}),this.rendered&&(this.isDay()?this._updateListPanel():this._renderComponents(),this.layoutSize(!0)))}_updateResourcesVisibleProperty(e,t){if(!e)return;let i=this.findResourceForId(e);!i||i.visible===t||(i.visible=t,this.trigger("resourceVisibilityChange",{resourceId:e,visible:t}))}_arrangeComponents(){let e,t,i,s,r,o,l,a,d,c,f,g=h()(".calendar-day",this.$grid);for(e=0;e<g.length;e++){if(s=g.eq(e),f=s.data("date"),r=s.children(".resource-column"),l=s.find(".calendar-component"),o=r.filter((y,v)=>h()(v).data("resourceId")===this.defaultResource.resourceId),d=o.children(".calendar-scrollable-components"),d.length>0&&(P.uninstall(d,this.session),d.remove()),this.isMonth()&&l.length>0){for(d=o.appendDiv("calendar-scrollable-components"),i=0;i<l.length;i++){let y=l.eq(i);!this.isMonth()&&!y.hasClass("component-task")||d.append(y)}P.install(d,{parent:this,session:this.session,axis:"y"})}for(t=0;t<r.length;t++)a=r.eq(t).children(".calendar-component:not(.component-task)"),this.isMonth()&&a.length>2?s.addClass("many-items"):!this.isMonth()&&a.length>1&&(c=this._getComponents(a),this._arrange(c,f),this._arrangeComponentSetPlacement(a,f))}this.isMonth()?(this._uninstallScrollbars(),this._uninstallComponentScrollbars(this.$topGrid),this.$grid.removeClass("calendar-scrollable-components")):(this.$grid.addClass("calendar-scrollable-components"),this._installScrollbars({parent:this,session:this.session,axis:"y"}),this.$topGrid.find(".calendar-scrollable-components").each((y,v)=>{let D=h()(v);if(D.data("scrollable")){P.update(D);return}P.install(D,{parent:this,session:this.session,axis:"y",scrollShadow:"none"})}))}_getComponents(e){let t,i,s=[];for(t=0;t<e.length;t++)i=e.eq(t),s.push(i.data("component"));return s}_sort(e){e.sort(this._sortFromTo)}_arrange(e,t){let i=[],s=t+"";this._sort(e);for(let r=0;r<e.length;r++){let o=e[r];o.stack||(o.stack={}),o.stack[this._calculateStackKey(t,o.getResourceId())]={}}for(let r=0;r<e.length;r++){let o=e[r],l=o.getPartDayPosition(t);s=this._calculateStackKey(t,o.getResourceId()),i.length>0&&this._allEndBefore(i,l.from,t)&&(i=[]);let a=this._findReplaceableColumn(i,l.from,t);a>=0?(i[a]=o,o.stack[s].x=a):(i.push(o),o.stack[s].x=i.length-1);for(let d=0;d<i.length;d++)i[d].stack[s].w=i.length}}_allEndBefore(e,t,i){let s;for(s=0;s<e.length;s++)if(!this._endsBefore(e[s],t,i))return!1;return!0}_findReplaceableColumn(e,t,i){let s;for(s=0;s<e.length;s++)if(this._endsBefore(e[s],t,i))return s;return-1}_endsBefore(e,t,i){return e.getPartDayPosition(i).to<=t}_arrangeComponentSetPlacement(e,t){let i,s,r,o;for(i=0;i<e.length;i++)s=e.eq(i),r=s.data("component"),o=r.stack[this._calculateStackKey(t,r.getResourceId())],s.css("width",100/o.w+"%").css("left",o.x*100/o.w+"%")}_calculateStackKey(e,t){let i=this.defaultResource.resourceId;return this.isDay()&&t&&(i=this.findResourceForId(t).resourceId),i}get$Scrollable(){return this.$grid}_onMouseDown(e){if(this._moveData)return;let t=this._getCalendarComponentForMouseEvent(e);!t||!t.draggable||!this.isMonth()&&t.fullDay||t._$parts.length>1||e.which!==3&&(this.$window.off("mousemove touchmove",this._mouseMoveHandler).off("mouseup touchend touchcancel",this._mouseUpHandler).on("mousemove touchmove",this._mouseMoveHandler).on("mouseup touchend touchcancel",this._mouseUpHandler),this._moveData=this._newMoveData(e),this._onComponentMouseDown(e,t),this._moveData.onMove=this._onComponentMouseMove.bind(this),this._moveData.onUp=this._onComponentMouseUp.bind(this))}_onMouseMove(e){Ve.fixTouchEvent(e),this._moveData.event=e,this._moveData.currentCursorPosition=new X(e.pageX-this._moveData.containerOffset.left+this._moveData.containerScrollPosition.x,e.pageY-this._moveData.containerOffset.top+this._moveData.containerScrollPosition.y),this._scrollViewportWhileDragging(e),this._moveData.onMove&&!this._moveData.cancelled&&this._moveData.onMove(e)}_scrollViewportWhileDragging(e){if(!this._moveData||this._moveData.mode==="pan"||this._moveData.cancelled)return;this._moveData.viewportScroller||(this._moveData.viewportScroller=u.create(gr,h().extend({viewportWidth:this.$grid.width(),viewportHeight:this.$grid.height(),active:()=>!!this._moveData,scroll:(i,s)=>{let r=this.get$Scrollable().scrollTop()+s;P.scrollTop(this.get$Scrollable(),r),this._moveData.containerScrollPosition=new X(this.get$Scrollable().scrollLeft(),this.get$Scrollable().scrollTop())}})));let t=this._moveData.currentCursorPosition.subtract(this._moveData.containerScrollPosition);this._moveData.viewportScroller.update(t)}_onMouseUp(e){this.$window.off("mousemove touchmove",this._mouseMoveHandler).off("mouseup touchend touchcancel",this._mouseUpHandler),Ve.fixTouchEvent(e),this._moveData.event=e,this._moveData.onUp&&!this._moveData.cancelled&&this._moveData.onUp(e),this._moveData=null}_onComponentMouseDown(e,t){this._moveData.component=t;let i=t._$parts[0];this._moveData.logicalX=i.closest(".calendar-day").data().day,this._moveData.logicalY=Math.round(i.position().top)/this.heightPerDivision,this.isMonth()&&(this._moveData.logicalY=i.closest(".calendar-day").data().week),e.preventDefault()}_onComponentMouseMove(e){this._moveData.rafId||(this._moveData.rafId=requestAnimationFrame(this._whileComponentMove.bind(this)))}_onComponentMouseUp(e){this._endComponentMove()}_whileComponentMove(){this._moveData.rafId=null;let e=new X(this._moveData.currentCursorPosition.x-this._moveData.startCursorPosition.x,this._moveData.currentCursorPosition.y-this._moveData.startCursorPosition.y);if(!this._moveData.moving){if(Math.abs(e.x)<7&&Math.abs(e.y)<7)return;this._moveData.moving=!0}let t=this.toLogicalPosition(e),i=1,s=this.isMonth()?1:0,r=this.isWorkWeek()?this.workDayIndices.length:7,o=this.isMonth()?this.monthViewNumberOfWeeks:24*this.numberOfHourDivisions-Math.ceil(this._moveData.component.getLengthInHoursDecimal()*this.numberOfHourDivisions);function l(d){let c=d.x,f=d.y;c<i?t.x-=c-i:c>r&&(t.x-=c-r),f<s?t.y-=f-s:f>o&&(t.y-=f-o)}l(new X(this._moveData.logicalX,this._moveData.logicalY).add(t)),this._moveData.distance=t;let a=new X(this._moveData.logicalX,this._moveData.logicalY).add(this._moveData.distance);this._setComponentLogicalPosition(this._moveData.component,a)}_endComponentMove(){this._moveData.rafId&&(cancelAnimationFrame(this._moveData.rafId),this._moveData.rafId=null);let e=this._moveData.component;if(this._moveData.distance){let t=!1,i=new X(this._moveData.logicalX,this._moveData.logicalY).add(this._moveData.distance),s=i.x-this._moveData.logicalX,r=i.y-this._moveData.logicalY;if(t=t||!!s||!!r,t){let o=S.parseJsonDate(e.toDate),l=S.parseJsonDate(e.fromDate),a=s;if(this.isMonth())a+=r*7;else{let d=this._hourMinuteByDivision(r);l=S.shiftTime(l,d.hour,d.minute),o=S.shiftTime(o,d.hour,d.minute)}l=S.shift(l,0,0,a),o=S.shift(o,0,0,a),e.fromDate=this._format(l,"yyyy-MM-dd HH:mm:ss.SSS"),e.toDate=this._format(o,"yyyy-MM-dd HH:mm:ss.SSS"),e.coveredDaysRange=new Ne(S.trunc(l),S.trunc(o)),this._renderComponents(),this.trigger("componentMove",{component:e})}}}_setComponentLogicalPosition(e,t){let i=e._$parts[0],s=i.closest(".calendar-day").data("day"),r=i.closest(".calendar-day").data("week");if(e.rendered)if(this.isMonth()){if(s!==t.x||r!==t.y){let o=h()(".calendar-week:not(.hidden) > .calendar-day").filter(function(){return h()(this).data("day")===t.x&&h()(this).data("week")===t.y}),l=o.find(".calendar-scrollable-components");o=l.length>0?l:o,i.detach().appendTo(o)}}else{s!==t.x&&i.detach().appendTo(h()(".calendar-week:not(.hidden) > .calendar-day").filter(function(){return h()(this).data("day")===t.x}));let o=this._dayPositionByDivision(t.y)+"%";i.css("top",o)}}_getCalendarComponentForMouseEvent(e){let t=h()(e.target);for(t=h().ensure(t);t&&t.length>0;){let i=t.data("component");if(i)return i;t=t.parent()}return null}_updateLeafResources(){this._leafResources=this.resources.filter(e=>!this.resources.find(t=>t.parentId===e.resourceId))}_newMoveData(e){let t={};return t.event=e,t.cancel=()=>{t.cancelled=!0},t.unitX=this.widthPerDivision,t.unitY=this.heightPerDivision,this.isMonth()&&(t.unitY=h()(e.target).closest(".calendar-day").height()),t.containerOffset=this.$grid.offset(),t.containerScrollPosition=new X(this.get$Scrollable().scrollLeft(),this.get$Scrollable().scrollTop()),t.startCursorPosition=new X(e.pageX-t.containerOffset.left+t.containerScrollPosition.x,e.pageY-t.containerOffset.top+t.containerScrollPosition.y),t.currentCursorPosition=t.startCursorPosition,t}toLogicalPosition(e,t,i){let s;return e instanceof X?(s=e,i=t):s=new X(e,t),this.isDay()&&(s.x=0),new X(Se.round(s.x/this._moveData.unitX,i),Se.round(s.y/this._moveData.unitY,i))}_hourMinuteByDivision(e){e/=this.numberOfHourDivisions;let t=Math.floor(e),i=e-t,s=1/60;i=s*Math.round(i/s);let r=Math.floor(i*60);return{hour:t,minute:r}}_dayPositionByDivision(e){let t=this._hourMinuteByDivision(e);return this._dayPosition(t.hour,t.minute)}_dayPosition(e,t){let i;return e<0?i=0:i=100/(24*60)*(e*60+t),Math.round(i*100)/100}_format(e,t){return S.format(e,this.session.locale,t)}_sortFromTo(e,t){let i=S.parseJsonDate(e.fromDate),s=S.parseJsonDate(t.fromDate),r=S.compare(i,s);if(r!==0)return r;let o=S.parseJsonDate(e.toDate),l=S.parseJsonDate(t.toDate),a=S.compare(o,l);if(a!==0)return a;let d=e.item&&e.item.subject?e.item.subject:"",c=t.item&&t.item.subject?t.item.subject:"";return d.localeCompare(c)}_startRangeSelection(e,t){if(!this.rangeSelectionAllowed||this._rangeSelectionStarted||w.get().type===w.Type.MOBILE)return;let i=h()(e.delegateTarget).data("resourceId");if(!this.findResourceForId(i).selectable)return;let r=this._getSelectedDateTime(e);e.which===3&&this.selectedRange&&r&&S.compare(r,this.selectedRange.from)>=0&&S.compare(r,this.selectedRange.to)<0&&!t||!h()(e.target).hasClass("calendar-range-selector")&&!h()(e.target).hasClass("resource-column")||(this.selectorStart=this._getSelectedDateTime(e),this.selectorStart&&(this.selectorEnd=new Date(this.selectorStart),!(!this.selectorStart||!this.selectorEnd)&&(this.$window.off("mousemove",this._mouseMoveRangeSelectionHandler).off("mouseup",this._mouseUpRangeSelectionHandler).on("mousemove",this._mouseMoveRangeSelectionHandler).on("mouseup",this._mouseUpRangeSelectionHandler),this._setRangeSelection(),this._rangeSelectionStarted=!0)))}_findDayInCalendar(e){let t=null;return h()(".calendar-day",this.$container).each((i,s)=>{let r=h()(s),o=r.data("date");S.compareDays(o,e)===0&&(t=r)}),t}_findSelectedResourceColumn(e){let t=this._findDayInCalendar(e);return!t||!this.selectedResource?null:t.find(".resource-column").filter((i,s)=>h()(s).data("resourceId")===this.selectedResource.resourceId)}_setRangeSelection(){let e,t;if(!this.selectorStart||!this.selectorEnd)return;this._removeRangeSelection(),S.compare(this.selectorStart,this.selectorEnd)>0?(e=this.selectorEnd,t=this.selectorStart):(e=this.selectorStart,t=this.selectorEnd);let i=S.compareDays(t,e)+1;if(i===1)this._appendCalendarRangeSelection(e,e,t);else if(i>1){this._appendCalendarRangeSelection(e,e,null);for(let s=1;s<i-1;s++){let r=new Date(e);r.setDate(r.getDate()+s),this._appendCalendarRangeSelection(r,null,null)}this._appendCalendarRangeSelection(t,null,t)}}_removeRangeSelection(){h()(".calendar-range-selector").remove()}_appendCalendarRangeSelection(e,t,i){let s=this._findSelectedResourceColumn(e);if(!s)return;let r=t?this._dayPosition(this._getHours(t),0):0,o=i?this._dayPosition(this._getHours(i)+1/this.numberOfHourDivisions,0):100;s.appendDiv("calendar-range-selector").css("top",r+"%").css("height",o-r+"%")}_getHours(e){return Math.round((e.getHours()+e.getMinutes()/60)*this.numberOfHourDivisions)/this.numberOfHourDivisions}_onMouseMoveRangeSelection(e){let t=this._getSelectedDateTime(e);t&&(this.selectorEnd=t),this._setRangeSelection()}_onMouseUpRangeSelection(e){this._mouseMoveRangeSelectionHandler&&this.$window.off("mousemove",this._mouseMoveRangeSelectionHandler),this._mouseUpRangeSelectionHandler&&this.$window.off("mouseup",this._mouseUpRangeSelectionHandler),this._rangeSelectionStarted&&(this._rangeSelectionStarted=!1,this.rendered&&(this._setRangeSelection(),this._updateSelectedRange()))}_updateSelectedRange(){let e,t;this.selectorStart&&this.selectorEnd?(S.compare(this.selectorStart,this.selectorEnd)>0?(e=new Date(this.selectorEnd),t=new Date(this.selectorStart)):(e=new Date(this.selectorStart),t=new Date(this.selectorEnd)),e.setHours(0,this._getHours(e)*60),t.setHours(0,this._getHours(t)*60+60/this.numberOfHourDivisions),this.selectedRange=new Ne(e,t)):this.selectedRange=null,this.trigger("selectedRangeChange")}}class If extends K{constructor(){super(),this._addRemoteProperties(["showCalendarSidebar","showResourcePanel","showListPanel"])}_postCreateWidget(){this._sendViewRangeChange()}_onWidgetEvent(e){e.type==="viewRangeChange"?this._sendViewRangeChange():e.type==="modelChange"?this._sendModelChange():e.type==="selectionChange"?this._sendSelectionChange():e.type==="componentMove"?this._sendComponentMove(e):e.type==="selectedRangeChange"?this._sendSelectedRangeChange():e.type==="resourceVisibilityChange"?this._sendResourceVisibilityChange(e):e.type==="selectedResourceChange"?this._sendSelectedResourceChange(e):super._onWidgetEvent(e)}_jsonViewRange(){return S.toJsonDateRange(this.widget.viewRange)}_jsonSelectedRange(){return this.widget.selectedRange?S.toJsonDateRange(this.widget.selectedRange):null}_jsonSelectedDate(){return S.toJsonDate(this.widget.selectedDate)}_sendViewRangeChange(){this._send("viewRangeChange",{viewRange:this._jsonViewRange()})}_sendSelectedRangeChange(){this._send("selectedRangeChange",{selectedRange:this._jsonSelectedRange()})}_sendModelChange(){let e={viewRange:this._jsonViewRange(),selectedDate:this._jsonSelectedDate(),displayMode:this.widget.displayMode};this._send("modelChange",e)}_sendSelectionChange(){let e=this.widget.selectedComponent?this.widget.selectedComponent.id:null;this._send("selectionChange",{date:this._jsonSelectedDate(),componentId:e})}_sendComponentMove(e){this._send("componentMove",{componentId:e.component.id,fromDate:e.component.fromDate,toDate:e.component.toDate})}_sendResourceVisibilityChange(e){this._send("resourceVisibilityChange",{resourceId:e.resourceId,visible:e.visible})}_sendSelectedResourceChange(e){let t=e.resourceId;e.resourceId===this.widget.defaultResource.resourceId&&(t=null),this._send("selectedResourceChange",{resourceId:t})}}class rr extends I{fromDate;toDate;selected;fullDay;fullDayIndex;draggable;item;stack;coveredDaysRange;_$parts;constructor(){super(),this.selected=!1,this.fullDay=!1,this.fullDayIndex=-1,this.item=null,this._$parts=[]}static MONTH_COMPACT_THRESHOLD=100;static DAY_OF_MONTH_HEIGHT=30;static COMPONENT_HEIGHT=24;static COMPONENT_VGAP=2;_init(e){super._init(e),this._syncCoveredDaysRange(e.coveredDaysRange)}_syncCoveredDaysRange(e){e&&(this.coveredDaysRange=new Ne(S.parseJsonDate(e.from),S.parseJsonDate(e.to)))}_remove(){this._$parts.forEach(e=>e.remove()),this._$parts=[],super._remove()}_startLoopDay(){return S.compare(this.coveredDaysRange.from,this.parent.viewRange.from)>0?this.coveredDaysRange.from:this.parent.viewRange.from}_render(){let e,t,i;if(!this.coveredDaysRange)return;let s=this.parent.findResourceForComponent(this);if(this.setVisible(s.visible),!this.visible)return;let r=this._startLoopDay(),o=this.item||{},l=S.parseJsonDate(this.toDate),a=S.parseJsonDate(this.fromDate),d=this.coveredDaysRange.to,c=s?s.cssClass:null;if(!this.fullDay){let g=S.trunc(l);!S.isSameDay(a,l)&&S.compare(l,g)===0&&(l=S.shiftTime(l,0,0,0,-1),d=S.shift(d,0,0,-1))}l=S.toJsonDate(l);let f=S.shift(d,0,0,1);if(!(S.compare(r,f)>0))for(;!S.isSameDay(r,f)&&(e=r,r=S.shift(r,0,0,1),!(S.compare(e,this.parent.viewRange.to)>0));){if(this.fullDay&&!this.parent.isMonth()?t=this._findDayInGrid(e,this.parent.$topGrid):t=this._findDayInGrid(e,this.parent.$grid),!t)continue;let g=this._findResourceColumnInDay(t,s.resourceId);if(!g)continue;i=g.appendDiv("calendar-component"),i.addClass(o.cssClass).addClass(c).data("component",this).data("partDay",e).on("mouseenter",this._onMouseEnter.bind(this)).on("mouseleave",this._onMouseLeave.bind(this)).on("mousedown",this._onMouseDown.bind(this)).on("contextmenu",this._onContextMenu.bind(this)),i.appendDiv("calendar-component-leftcolorborder");let y=i.appendDiv("content");if(o.subjectIconId&&y.appendIcon(this.item.subjectIconId),y.appendSpan("subject",o.subject),this._$parts.push(i),this.parent.isMonth()){let v=t.data("new-width")||t.width();i.addClass("component-month").toggleClass("compact",v<rr.MONTH_COMPACT_THRESHOLD)}else if(this.fullDay)this._arrangeTask(rr.DAY_OF_MONTH_HEIGHT+(rr.COMPONENT_HEIGHT+rr.COMPONENT_VGAP)*Math.max(this.fullDayIndex,0)),i.addClass("component-task");else{let v=S.parseJsonDate(this.fromDate),D=S.parseJsonDate(l),k=this._getHours(this.fromDate),V=this._getHours(l);i.addClass("component-day"),S.isSameDay(S.trunc(this.coveredDaysRange.from),S.trunc(d))?this._partPosition(i,k,V):S.isSameDay(e,v)?this._partPosition(i,k,25).addClass("component-open-bottom"):S.isSameDay(e,D)?this._partPosition(i,0,V).addClass("component-open-top"):this._partPosition(i,0,25).addClass("component-open-top").addClass("component-open-bottom")}}}_getHours(e){let t=S.parseJsonDate(e);return t.getHours()+t.getMinutes()/60}getLengthInHoursDecimal(){let e=S.parseJsonDate(this.toDate),t=S.parseJsonDate(this.fromDate);return(e.getTime()-t.getTime())/(1e3*60*60)}getResourceId(){return!this.item||!this.parent.isLeafResource(this.item.resourceId)?this.parent.defaultResource.resourceId:this.item.resourceId}_findDayInGrid(e,t){return t.find(".calendar-day").filter(function(i,s){return S.isSameDay(h()(this).data("date"),e)}).eq(0)}_findResourceColumnInDay(e,t){return this.parent.isDay()||(t=this.parent.defaultResource.resourceId),t=this.parent.findResourceForId(t).resourceId,e.find(".resource-column").filter((i,s)=>h()(s).data("resourceId")===t)}_isTask(){return!this.parent.isMonth()&&this.fullDay}_arrangeTask(e){this._$parts.forEach(t=>t.css("top",e+"px"))}_isDayPart(){return!this.parent.isMonth()&&!this.fullDay}_getHourRange(e){let t=new U(this._getHours(this.fromDate),this._getHours(this.toDate)),i=new Ne(S.parseJsonDate(this.fromDate),S.parseJsonDate(this.toDate));return S.isSameDay(e,i.from)&&S.isSameDay(e,i.to)?new U(t.from,t.to):S.isSameDay(e,i.from)?new U(t.from,24):S.isSameDay(e,i.to)?new U(0,t.to):new U(0,24)}getPartDayPosition(e){return this._getDisplayDayPosition(this._getHourRange(e))}_getDisplayDayPosition(e){let t=new U(this.parent._dayPosition(e.from,0),this.parent._dayPosition(e.to,0)),i=Math.round(100*100/24/this.parent.numberOfHourDivisions)/100;return t.size()<i?new U(t.from,t.from+i):t}_partPosition(e,t,i){let s=i===25?23:0;i=Math.min(24,i);let r=new U(t,i),o=this._getDisplayDayPosition(r);return s=Math.round(100*(100/1920*s))/100,e.css("top",o.from+"%").css("height",o.to-o.from-s+"%")}_renderProperties(){super._renderProperties(),this._renderSelected()}_renderSelected(){this._$parts.forEach(e=>e.toggleClass("comp-selected",this.selected))}setSelected(e){this.setProperty("selected",e)}updateSelectedComponent(e,t){this.parent._selectedComponentChanged(this,this.getResourceId(),e.data("partDay"),t)}_onMouseEnter(e){this._$parts.forEach(t=>t.addClass("hover"))}_onMouseLeave(e){this._$parts.forEach(t=>t.removeClass("hover"))}_onMouseDown(e){this.applySelection(h()(e.delegateTarget),e.button===0,e.originalEvent.clientY)}applySelection(e,t,i){if(!(this.parent._moveData&&this.parent._moveData.moving)&&!this.parent._rangeSelectionStarted&&(this.updateSelectedComponent(e,!1),this.parent.setSelectedRange(null),t)){let s=u.create(tr,{parent:this.parent,$anchor:e,closeOnAnchorMouseDown:!0,closeOnMouseDownOutside:!0,closeOnOtherPopupOpen:!0,horizontalAlignment:_e.Alignment.LEFT,verticalAlignment:_e.Alignment.CENTER,trimWidth:!1,trimHeight:!0,horizontalSwitch:!0,verticalSwitch:!1,withArrow:!0,cssClass:"popup",scrollType:"remove",location:{y:i},content:{objectType:Cl,htmlEnabled:!0,scrollable:!0,cssClass:"calendar-component-tooltip-content tooltip-content",value:this.description(!0)}});s.open(),s.$container.find(".app-link").on("click",this._onAppLinkAction.bind(this))}}_onContextMenu(e){this.parent._showContextMenu(e,ze.MenuType.CalendarComponent)}_format(e,t){return S.format(e,this.session.locale,t)}description(e){let t=null,i=h()("<div>"),s=S.parseJsonDate(this.fromDate),r=S.parseJsonDate(this.toDate),o=_.hasText(this.item.description)||this.item.descriptionElements,l=i.appendDiv("calendar-component-header");if(o&&l.addClass("with-description"),_.hasText(this.item.subject)){_.hasText(this.item.subjectLabel)&&l.appendDiv("calendar-component-title-label",this.item.subjectLabel);let a=l.appendDiv("calendar-component-title",this.item.subject);e&&_.hasText(this.item.subjectAppLink)&&(a.addClass("app-link").attr("data-ref",this.item.subjectAppLink),T.role(a,"link"))}if(this.fullDay||(S.isSameDay(s,r)?t=this.session.text("ui.FromXToY",this._format(s,"HH:mm"),this._format(r,"HH:mm")):t=this.session.text("ui.FromXToY",this._format(s,"EEEE HH:mm "),this._format(r,"EEEE HH:mm"))),_.hasText(t)){let a=l.appendDiv("calendar-component-intro");a.appendIcon(q.CLOCK),a.appendSpan("",t)}if(o){let a=i.appendDiv("calendar-component-description-container");if(_.hasText(this.item.description)&&a.appendSpan("calendar-component-description").html(_.nl2br(this.item.description)),this.item.descriptionElements){let d=!1;for(let c=0;c<this.item.descriptionElements.length;c++)if(this.item.descriptionElements[c].iconId){d=!0;break}for(let c=0;c<this.item.descriptionElements.length;c++){let f=this.item.descriptionElements[c],g=a.appendDiv("calendar-component-description-element");c===0&&g.addClass("first"),c===this.item.descriptionElements.length-1&&g.addClass("last"),(_.hasText(f.iconId)||d)&&g.appendIcon(f.iconId);let y=g.appendDiv("text").html(_.nl2br(f.text));e&&_.hasText(f.appLink)&&(y.addClass(" app-link").attr("data-ref",f.appLink),T.role(y,"link"))}}}return i[0].innerHTML}triggerAppLinkAction(e){this.trigger("appLinkAction",{ref:e})}_onAppLinkAction(e){let i=h()(e.delegateTarget).data("ref");this.triggerAppLinkAction(i)}}class Lf extends K{_onWidgetAppLinkAction(e){this._send("appLinkAction",{ref:e.ref})}_onWidgetEvent(e){e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):super._onWidgetEvent(e)}}class dd{partDay;source;$container;_selectedListener;_removeListener;constructor(e,t){this.partDay=e,this.source=t,this.$container=null,this._selectedListener=t.on("propertyChange:selected",i=>{this.$container.toggleClass("comp-selected",i.newValue)}),this._removeListener=t.on("remove",this.remove.bind(this))}render(e){let t=this.source,i=t.parent.findResourceForComponent(t);this.$container=e.appendDiv("calendar-component").data("partDay",this.partDay).addClass(t.item.cssClass).addClass(i?i.cssClass:null).toggleClass("comp-selected",t.selected).on("mousedown",this._onMouseDown.bind(this,t)).on("contextmenu",t._onContextMenu.bind(t)),this.$container.appendDiv("calendar-component-leftcolorborder"),this.$container.appendDiv("content").html(t.description(!1))}_onMouseDown(e,t){t.preventDefault();let i=$(t.delegateTarget);e.updateSelectedComponent(i,!0)}remove(){this.source.removeListener(this._selectedListener),this.source.removeListener(this._removeListener),this.$container.remove()}}class ud extends ne{calendar;stacked;compacted;compactWidth;constructor(e){super(),this.calendar=e,this.stacked=!1,this.compacted=!1,this.compactWidth=550}layout(e){let t=0,i=0,s=this.calendar.calendarSidebar.$container,r=this.calendar.$grids,o=this.calendar.$listContainer,l=this.calendar.$header;t+=e.cssMarginTop()+e.cssMarginBottom(),e.css("height","calc(100% - "+t+"px)"),this.undoCompact(),this.undoStack(),l[0].scrollWidth>e.width()&&this.stack(),(e.width()<this.compactWidth||l[0].scrollWidth>e.width())&&this.compact(),i=l.outerHeight(!0),s.css("height","calc(100% - "+(i+s.cssMarginY())+"px)"),r.css("height","calc(100% - "+(i+r.cssMarginY())+"px)"),o.css("height","calc(100% - "+(i+o.cssMarginY())+"px)"),this.calendar.layoutSize(),this.calendar.layoutYearPanel()}compact(){if(this.compacted)return;let e=this.calendar.$headerRow2;this.calendar.$title.appendTo(this.calendar.$headerRow2),e.show(),this.compacted=!0}undoCompact(){if(!this.compacted)return;let e=this.calendar.$headerRow2;this.calendar.$title.insertBefore(this.calendar.$commands),e.hide(),this.compacted=!1}stack(){this.stacked||(this.calendar.$commands.children(".calendar-mode").hide(),this.calendar.modesMenu.setVisible(!0),this.stacked=!0)}undoStack(){this.stacked&&(this.calendar.$commands.children(".calendar-mode").show(),this.calendar.modesMenu.setVisible(!1),this.stacked=!1)}}class _n extends J{displayMode;doAction(){return this.prepareDoAction()?(this.setSelected(!0),this.parentMenu.setSelected(!1),!0):!1}}class cd extends J{calendar;displayMode;constructor(){super(),this.cssClass="calendar-mode-menu"}_init(e){super._init(e),this.calendar=this.parent;let t=[];t.push(u.create(_n,{parent:this,displayMode:ze.DisplayMode.DAY,text:this.session.text("ui.CalendarDay")})),t.push(u.create(_n,{parent:this,displayMode:ze.DisplayMode.WORK_WEEK,text:this.session.text("ui.CalendarWorkWeek")})),t.push(u.create(_n,{parent:this,displayMode:ze.DisplayMode.WEEK,text:this.session.text("ui.CalendarWeek")})),t.push(u.create(_n,{parent:this,displayMode:ze.DisplayMode.MONTH,text:this.session.text("ui.CalendarMonth")})),this.insertChildActions(t),this.childActions.forEach(i=>i.on("propertyChange",this._onMenuPropertyChange.bind(this))),this._setDisplayMode(this.displayMode)}setDisplayMode(e){this.setProperty("displayMode",e)}_setDisplayMode(e){this._setProperty("displayMode",e);let t=this.getMenuForMode(this.displayMode);t.setSelected(!0),this.setText(t.text)}getMenuForMode(e){return p.find(this.childActions,t=>t.displayMode===e)}_onMenuPropertyChange(e){if(e.propertyName==="selected"){let t=e;if(t.newValue){let s=t.source,r=s.displayMode;this.setDisplayMode(r),this.calendar.setDisplayMode(r),this.childActions.forEach(o=>{o!==s&&o.setSelected(!1)})}}}}class Ne{from;to;constructor(e,t){this.from=e,this.to=t}covers(e,t){let i=this.from,s=this.to,r=e;return t&&(i=S.trunc(i),s=S.trunc(s),r=S.trunc(r)),r>=i&&r<=s}equals(e){return e?S.equals(this.from,e.from)&&S.equals(this.to,e.to):!1}toString(){return`DateRange {from: ${this.from}, to: ${this.to}}`}static ensure(e){return!e||e instanceof Ne?e:new Ne(S.ensure(e.from),S.ensure(e.to))}}class El extends I{$yearTitle;$yearList;selectedDate;displayMode;alwaysSelectFirstDay;yearRendered;viewRange;_init(e){super._init(e),this.alwaysSelectFirstDay=e.alwaysSelectFirstDay}_render(){this.$container=this.$parent.appendDiv("year-panel-container"),this.htmlComp=x.install(this.$container,this.session),this.$yearTitle=this.$container.appendDiv("year-panel-title"),this.$yearList=this.$container.appendDiv("year-panel-list")}renderContent(){this.removeContent(),this._drawYear(),this._installScrollbars({axis:"y",nativeScrollbars:!1,hybridScrollbars:!1}),this.yearRendered=!0,this._colorYear()}get$Scrollable(){return this.$yearList}removeContent(){this._uninstallScrollbars(),this.$yearList.empty(),this.yearRendered=!1}_remove(){this.removeContent(),super._remove()}_drawYear(){let e,t,i,s,r,o=this.selectedDate.getFullYear();for(this.$yearTitle.data("year",o).empty(),this.$yearTitle.appendDiv("year-title-item",o-1+"").data("year-diff",-1).on("click",this._onYearClick.bind(this)),this.$yearTitle.appendDiv("year-title-item selected",o+""),this.$yearTitle.appendDiv("year-title-item",o+1+"").data("year-diff",1).on("click",this._onYearClick.bind(this)),t=0;t<12;t++){e=new Date(o,t,1),i=this.$yearList.appendDiv("year-month").attr("data-title",this._format(e,"MMMM"));for(let l=1;l<=31&&(s=new Date(o,t,l),s.getMonth()===t);l++)r=i.appendDiv("year-day",l+"").data("date",s),(s.getDay()===0||s.getDay()===6)&&r.addClass("weekend"),l===1&&r.css("margin-left",(s.getDay()+6)%7*r.outerWidth())}h()(".year-day",this.$yearList).on("click",this._onYearDayClick.bind(this)).on("mouseenter",this._onYearHoverIn.bind(this)).on("mouseleave",this._onYearHoverOut.bind(this)),P.update(this.$yearList)}_colorYear(){if(!this.yearRendered)return;h()(".year-day.year-range, .year-day.year-range-day",this.$yearList).removeClass("year-range year-range-day");let e=this,t,i;h()(".year-day",this.$yearList).each(function(){t=h()(this),i=t.data("date"),e.displayMode!==ze.DisplayMode.DAY&&i>=e.viewRange.from&&i<e.viewRange.to&&t.addClass("year-range"),S.isSameDay(i,e.selectedDate)&&t.addClass("year-range-day")}),this._scrollYear()}_scrollYear(){let e,t,i,s=h()(".year-range-day",this.$yearList),r=s.parent(),o=s.parent().parent();r[0]&&(e=r[0].offsetTop,t=r.outerHeight()/2,i=o.outerHeight()/2,this.$yearList.animateAVCSD("scrollTop",e+t-i,()=>P.update(this.$yearList)))}_format(e,t){return S.format(e,this.session.locale,t)}selectDate(e){this.selectedDate=e,this.rendered&&((!e||e.getFullYear()!==this.$yearTitle.data("year"))&&this.renderContent(),this._colorYear())}setDisplayMode(e){e!==this.displayMode&&(this._setProperty("displayMode",e),this.rendered&&this._colorYear())}setViewRange(e){e!==this.viewRange&&(this._setProperty("viewRange",e),this.rendered&&this._colorYear())}_onYearClick(e){let t=Te.DisplayMode,i=h()(e.target).data("year-diff"),s=this.selectedDate.getFullYear(),r=this.selectedDate.getMonth(),o=this.selectedDate.getDate(),l=new Date(s+i,r,o),a,d,c;this.alwaysSelectFirstDay&&(u.isOneOf(this.displayMode,t.WEEK,t.WORK_WEEK,t.CALENDAR_WEEK)?(a=S.weekInYear(this.selectedDate),d=S.weekInYear(l),c=a-d,l=S.shift(l,0,0,c*7),l=S.shiftToNextOrPrevMonday(l,0)):u.isOneOf(this.displayMode,t.MONTH,t.YEAR)&&(l=new Date(s+i,r,1))),this.selectedDate=l,this.trigger("dateSelect",{date:this.selectedDate})}_onYearDayClick(e){this.selectedDate=h()(".year-hover-day",this.$yearList).data("date"),this.selectedDate&&this.trigger("dateSelect",{date:this.selectedDate})}_onYearHoverIn(e){let t=h()(e.target),i=t.data("date"),s=i.getFullYear(),r=i.getMonth(),o=i.getDate(),l=(i.getDay()+6)%7,a,d,c,f;this.displayMode===ze.DisplayMode.DAY?(a=new Date(s,r,o),d=new Date(s,r,o)):this.displayMode===ze.DisplayMode.WEEK?(a=new Date(s,r,o-l),d=new Date(s,r,o-l+6)):this.displayMode===ze.DisplayMode.WORK_WEEK?(a=new Date(s,r,o-l),d=new Date(s,r,o-l+4),i>d&&(i=d)):this.displayMode===ze.DisplayMode.MONTH?(a=new Date(s,r,1),d=new Date(s,r+1,0)):this.displayMode===Te.DisplayMode.YEAR?(a=new Date(s,r,1),d=a):(a=new Date(s,r,o-l),d=a),this.alwaysSelectFirstDay&&(i=a),h()(".year-day",this.$yearList).each(function(){c=h()(this),f=c.data("date"),f>=a&&f<=d?c.addClass("year-hover"):c.removeClass("year-hover"),S.isSameDay(i,f)&&c.addClass("year-hover-day")})}_onYearHoverOut(e){h()(".year-day.year-hover, .year-day.year-hover-day",this.$yearList).removeClass("year-hover year-hover-day")}}class pd extends ot{objectType;widget;emptyMandatoryElementsTextKey;emptyMandatoryElementsText;invalidElementsErrorTextKey;invalidElementsErrorText;invalidElementsWarningTextKey;invalidElementsWarningText;saveChangesQuestionTextKey;askIfNeedSave;askIfNeedSaveText;handlers;constructor(){super(),this.widget=null,this.emptyMandatoryElementsTextKey=null,this.emptyMandatoryElementsText=null,this.invalidElementsErrorTextKey=null,this.invalidElementsErrorText=null,this.invalidElementsWarningTextKey=null,this.invalidElementsWarningText=null,this.saveChangesQuestionTextKey=null,this.askIfNeedSave=!0,this.askIfNeedSaveText=null,this.handlers={load:this._defaultLoad.bind(this),save:this._defaultSave.bind(this)}}init(e){u.assertParameter("widget",e.widget),h().extend(this,e),b.isNullOrUndefined(this.emptyMandatoryElementsText)&&(this.emptyMandatoryElementsText=this.session().text(this.emptyMandatoryElementsTextKey)),b.isNullOrUndefined(this.invalidElementsErrorText)&&(this.invalidElementsErrorText=this.session().text(this.invalidElementsErrorTextKey)),b.isNullOrUndefined(this.invalidElementsWarningText)&&(this.invalidElementsWarningText=this.session().text(this.invalidElementsWarningTextKey)),b.isNullOrUndefined(this.askIfNeedSaveText)&&(this.askIfNeedSaveText=this.session().text(this.saveChangesQuestionTextKey))}load(){return this._load().then(()=>{this.markAsSaved(),this.trigger("postLoad")})}_load(){return this.handlers.load().then(()=>{this.trigger("load")})}_defaultLoad(){return h().resolvedPromise()}ok(){return this._validateAndHandle().then(e=>{if(e.isValid())return this.saveNeeded()?this._save().then(()=>(this.markAsSaved(),this.close())):this.close()})}cancel(){return this.saveNeeded()&&this.askIfNeedSave?this._showYesNoCancelMessageBox(this.askIfNeedSaveText,this.ok.bind(this),this.close.bind(this)):this.close()}_showYesNoCancelMessageBox(e,t,i){return Ri.createYesNoCancel(this.widget).withHeader(e).buildAndOpen().then(s=>s===jt.Buttons.YES?t():s===jt.Buttons.NO?i():h().resolvedPromise())}reset(){return this._reset(),this.load().then(()=>{this.trigger("reset")})}close(){return this._close()}_close(){return this.trigger("close"),h().resolvedPromise()}save(){return this._validateAndHandle().then(e=>{if(!(!e.isValid()||!this.saveNeeded()))return this._save().then(()=>this.markAsSaved())})}_reset(){}_save(){return this.handlers.save().then(()=>{this.trigger("save")})}_defaultSave(){return h().resolvedPromise()}markAsSaved(){}saveNeeded(){return!1}setAskIfNeedSave(e){this.askIfNeedSave=e}_validateAndHandle(){return this._validate().then(e=>this.trigger("validate",{status:e}).status).then(e=>!e||e.isValid()?h().resolvedPromise(e||E.ok()):this._handleInvalid(e)).catch(e=>{const t=G.get().errorHandler;return t.analyzeError(e).then(i=>t.errorInfoToStatus(this.session(),i)).then(i=>this._handleInvalid(i))})}_handleInvalid(e){return h().resolvedPromise(e)}validate(){return this._validateAndHandle()}_validate(){let e=this._validateElements();if(!e.isValid())return h().resolvedPromise(e);let t=this._validateWidget();return b.isPromise(t)?t:h().resolvedPromise(t)}_validateElements(){let e=this.invalidElements();if(e.missingElements.length===0&&e.invalidElements.length===0)return E.ok();const t=e.missingElements.length?E.Severity.ERROR:p.max(e.invalidElements.map(s=>s.errorStatus?s.errorStatus.severity:0)),i=this._createInvalidElementsMessageHtml(e.missingElements,e.invalidElements);return this._revealInvalidElement(p.first(e.missingElements)||p.first(e.invalidElements)),E.ensure({severity:t,message:i})}_revealInvalidElement(e){}_validateWidget(){return E.ok()}invalidElements(){return{missingElements:[],invalidElements:[]}}_createInvalidElementsMessageHtml(e,t){const i=h()("<div>"),s=e.length>0,r=[],o=[];t.forEach(f=>{f.errorStatus&&(f.errorStatus.isError()?r.push(f):f.errorStatus.isWarning()&&o.push(f))});const l=r.length>0,a=o.length>0;let d=!1;return s&&(c.call(this,i,this.emptyMandatoryElementsText,e,this._missingElementText),d=!0),l&&(d&&i.appendElement("<br>"),c.call(this,i,this.invalidElementsErrorText,r,this._invalidElementErrorText),d=!0),a&&(d&&i.appendElement("<br>"),c.call(this,i,this.invalidElementsWarningText,o,this._invalidElementWarningText),d=!0),i.html();function c(f,g,y,v){f.appendDiv().text(g);let D=f.appendElement("<ul>");y.forEach(k=>{D.appendElement("<li>").text(v.call(this,k))})}}_invalidElementText(e){return""}_invalidElementErrorText(e){return this._invalidElementText(e)}_invalidElementWarningText(e){return this._invalidElementText(e)}_missingElementText(e){return""}session(){return this.widget.session}handle(e,t){if(["load","save"].indexOf(e)===-1)throw new Error("Cannot register handler for unsupported type '"+e+"'");this.handlers[e]=t}}class Te extends I{activityMap;activitySelectable;availableDisplayModes;displayMode;displayModeOptions;headerVisible;label;resources;resourceMap;multiSelect;rangeSelectable;selectionRange;selectedResources;viewRange;startRange;lastRange;beginScale;endScale;selectedActivity;menus;startRow;lastRow;menuBar;header;yearPanel;defaultMenuTypes;transformLeft;transformWidth;yearPanelVisible;$range;$modes;$selectors;$grid;$highlight;$timeline;$timelineLarge;$timelineSmall;$scaleTitle;$scale;_resourceTitleWidth;_rangeSelectionStarted;_resourceSelectionMode;_tooltipSupport;_$body;_gridScrollHandler;_cellMousemoveHandler;_resizeMousemoveHandler;_resourceTitleMousemoveHandler;constructor(){super(),this.activityMap={},this.activitySelectable=!1,this.availableDisplayModes=[],this.displayMode=null,this.displayModeOptions={},this.headerVisible=!0,this.multiSelect=!0,this.label=null,this.resources=[],this.resourceMap={},this.rangeSelectable=!0,this.selectionRange=new Ne,this.selectedResources=[],this.viewRange=new Ne,this.selectedActivity=null,this.startRow=null,this.lastRow=null,this.defaultMenuTypes=[Te.MenuType.EmptySpace],this._resourceTitleWidth=20,this._rangeSelectionStarted=!1,this._resourceSelectionMode=Te.ResourceSelectionMode.DEFAULT,this.$container=null,this.$range=null,this.$modes=null,this.$grid=null,this.transformLeft=e=>e,this.transformWidth=(e,t)=>t-e,this.yearPanelVisible=!1,this._addWidgetProperties(["menus"])}static Direction={BACKWARD:-1,FORWARD:1};static DisplayMode={DAY:1,WEEK:2,MONTH:3,WORK_WEEK:4,CALENDAR_WEEK:5,YEAR:6};static RANGE_SELECTION_MOVE_THRESHOLD=10;static MenuType={Activity:"Planner.Activity",EmptySpace:"Planner.EmptySpace",Range:"Planner.Range",Resource:"Planner.Resource"};static ResourceSelectionMode={DEFAULT:0,DESELECT:1,ADD:2};_createKeyStrokeContext(){return new Ee}_init(e){super._init(e),this.yearPanel=u.create(El,{parent:this,alwaysSelectFirstDay:!0}),this.yearPanel.on("dateSelect",this._onYearPanelDateSelect.bind(this)),this.header=u.create(fd,{parent:this}),this.header.on("todayClick",this._onTodayClick.bind(this)),this.header.on("yearClick",this._onYearClick.bind(this)),this.header.on("previousClick",this._onPreviousClick.bind(this)),this.header.on("nextClick",this._onNextClick.bind(this)),this.header.on("displayModeClick",this._onDisplayModeClick.bind(this)),this.menuBar=u.create(Ce,{parent:this,position:Ce.Position.BOTTOM,menuOrder:new md(this.session,"Planner",this.defaultMenuTypes),cssClass:"bounded"});for(let t=0;t<this.resources.length;t++)this._initResource(this.resources[t]);this._setDisplayMode(this.displayMode),this._setAvailableDisplayModes(this.availableDisplayModes),this._setViewRange(this.viewRange),this._setSelectedResources(this.selectedResources),this._setSelectedActivity(this.selectedActivity),this._setSelectionRange(this.selectionRange),this._setMenus(this.menus),this._setDisplayModeOptions(this.displayModeOptions),this._tooltipSupport=new bl({parent:this,arrowPosition:50})}_initResource(e){e.activities.forEach(i=>this._initActivity(i));let t=e;return this.resourceMap[e.id]=t,t}_initActivity(e){let t=e;typeof e.beginTime=="string"&&(t.beginTime=S.parseJsonDate(e.beginTime)),typeof e.endTime=="string"&&(t.endTime=S.parseJsonDate(e.endTime)),this.activityMap[t.id]=t}_render(){this.$container=this.$parent.appendDiv("planner");let e=new gd(this);this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(e),this._$body=this.$container.body(),this.header.render(),this.yearPanel.render(),this.$grid=this.$container.appendDiv("planner-grid").on("mousedown",".resource-cells",this._onCellMouseDown.bind(this)).on("mousedown",".resource-title",this._onResourceTitleMouseDown.bind(this)).on("contextmenu",".resource-title",this._onResourceTitleContextMenu.bind(this)).on("contextmenu",".planner-activity",this._onActivityContextMenu.bind(this)),this.$scale=this.$container.appendDiv("planner-scale"),this.menuBar.render(),Y.install(this.$grid,{parent:this,selector:".planner-activity",text:(function(t){let i=this.activityById(t.attr("data-id"));if(i)return i.tooltipText}).bind(this)}),this._installScrollbars(),this._gridScrollHandler=this._onGridScroll.bind(this),this.$grid.on("scroll",this._gridScrollHandler)}_renderProperties(){super._renderProperties(),this._renderViewRange(),this._renderHeaderVisible(),this._renderYearPanelVisible(!1),this._renderResources(),this._renderSelectedActivity(),this._renderSelectedResources(),setTimeout(this._renderSelectionRange.bind(this))}_remove(){this._removeMouseMoveHandlers(),super._remove()}get$Scrollable(){return this.$grid}_onPreviousClick(e){this._navigateDate(Te.Direction.BACKWARD)}_onNextClick(e){this._navigateDate(Te.Direction.FORWARD)}_navigateDate(e){let t=new Ne(this.viewRange.from,this.viewRange.to),i=Te.DisplayMode,s=S.compareDays(this.viewRange.to,this.viewRange.from);this.displayMode===i.DAY?(t.from=S.shift(this.viewRange.from,0,0,e),t.to=S.shift(this.viewRange.to,0,0,e)):u.isOneOf(this.displayMode,i.WEEK,i.WORK_WEEK)?(t.from=S.shift(this.viewRange.from,0,0,e*7),t.from=S.ensureMonday(t.from,-1*e),t.to=S.shift(t.from,0,0,s)):u.isOneOf(this.displayMode,i.MONTH,i.CALENDAR_WEEK)?(t.from=S.shift(this.viewRange.from,0,e,0),t.from=S.ensureMonday(t.from,-1*e),t.to=S.shift(t.from,0,0,s)):this.displayMode===i.YEAR&&(t.from=S.shift(this.viewRange.from,0,3*e,0),t.to=S.shift(this.viewRange.to,0,3*e,0)),this.setViewRange(t)}_onTodayClick(e){let t=this._today(),i=t.getFullYear(),s=t.getMonth(),r=t.getDate(),o=(t.getDay()+6)%7,l=Te.DisplayMode;this.displayMode===l.DAY?t=new Date(i,s,r):this.displayMode===l.YEAR?t=new Date(i,s,1):t=new Date(i,s,r-o),this.setViewRangeFrom(t)}_today(){return new Date}_onDisplayModeClick(e){let t=e.displayMode;this.setDisplayMode(t)}_onYearClick(e){this.setYearPanelVisible(!this.yearPanelVisible)}_onYearPanelDateSelect(e){this.setViewRangeFrom(e.date)}_onResourceTitleMouseDown(e){let t=h()(e.target).parent(),i=t.data("resource");t.isSelected()&&e.which===3||(e.which===1&&e.ctrlKey&&(t.isSelected()?this._resourceSelectionMode=Te.ResourceSelectionMode.DESELECT:this.multiSelect&&(this._resourceSelectionMode=Te.ResourceSelectionMode.ADD)),this.startRow=i,this.lastRow=this.startRow,this._select(),this._removeMouseMoveHandlers(),this.multiSelect&&(this._resourceTitleMousemoveHandler=this._onResourceTitleMousemove.bind(this),this._$body.document().on("mousemove",this._resourceTitleMousemoveHandler).one("mouseup",this._onDocumentMouseUp.bind(this))))}_onResourceTitleMousemove(e){let t=this._findRow(e.pageY);t&&(this.lastRow=t),this._select()}_onResourceTitleContextMenu(e){this._showContextMenu(e,Te.MenuType.Resource)}_onRangeSelectorContextMenu(e){this._showContextMenu(e,Te.MenuType.Range)}_onActivityContextMenu(e){this._showContextMenu(e,Te.MenuType.Activity)}_showContextMenu(e,t){e.preventDefault(),e.stopPropagation();let i=(function(r,o){if(!this.rendered||!this.attached)return;let l=this._filterMenus([o],!0),a=h()(r.currentTarget);if(l.length===0)return;u.create(bt,{parent:this,menuItems:l,location:{x:r.pageX,y:r.pageY},$anchor:a}).open()}).bind(this);this.session.onRequestsDone(i,e,t)}_onGridScroll(e){this._reconcileScrollPos()}_reconcileScrollPos(){let e=this.$grid.scrollLeft();this.$scale.scrollLeft(e)}_renderRange(){if(!this.viewRange.from||!this.viewRange.to)return;let e,t=new Date(this.viewRange.to.valueOf()-1),i=this.session.text("ui.to"),s=Te.DisplayMode;S.isSameDay(this.viewRange.from,t)?e=this._dateFormat(this.viewRange.from,"d. MMMM yyyy"):this.viewRange.from.getMonth()===t.getMonth()&&this.viewRange.from.getFullYear()===t.getFullYear()?e=_.join(" ",this._dateFormat(this.viewRange.from,"d."),i,this._dateFormat(t,"d. MMMM yyyy")):this.viewRange.from.getFullYear()===t.getFullYear()?this.displayMode===s.YEAR?e=_.join(" ",this._dateFormat(this.viewRange.from,"MMMM"),i,this._dateFormat(t,"MMMM yyyy")):e=_.join(" ",this._dateFormat(this.viewRange.from,"d. MMMM"),i,this._dateFormat(t,"d. MMMM yyyy")):this.displayMode===s.YEAR?e=_.join(" ",this._dateFormat(this.viewRange.from,"MMMM yyyy"),i,this._dateFormat(t,"MMMM yyyy")):e=_.join(" ",this._dateFormat(this.viewRange.from,"d. MMMM yyyy"),i,this._dateFormat(t,"d. MMMM yyyy")),h()(".planner-select",this.header.$range).text(e)}_renderScale(){if(!this.viewRange.from||!this.viewRange.to||!this.displayMode)return;let e=this,t=Te.DisplayMode;this.$scale.empty(),this.$grid.children(".planner-small-scale-item-line").remove(),this.$grid.children(".planner-large-scale-item-line").remove(),this.$scaleTitle=this.$scale.appendDiv("planner-scale-title"),this._renderLabel(),this.$timeline=this.$scale.appendDiv("timeline"),this.$timelineLarge=this.$timeline.appendDiv("timeline-large"),this.$timelineSmall=this.$timeline.appendDiv("timeline-small"),this.displayMode===t.DAY?this._renderDayScale():u.isOneOf(this.displayMode,t.WORK_WEEK,t.WEEK)?this._renderWeekScale():this.displayMode===t.MONTH?this._renderMonthScale():this.displayMode===t.CALENDAR_WEEK?this._renderCalendarWeekScale():this.displayMode===t.YEAR&&this._renderYearScale();let i=this.$timelineSmall.children(".scale-item"),s=this.$timelineLarge.children(".scale-item"),r=100/i.length;s.each(function(){let a=h()(this),d=e.$grid.prependDiv("planner-large-scale-item-line");a.css("width",a.data("count")*r+"%").data("scale-item-line",d),a.prependDiv("planner-large-scale-item-line").css("left",0)}),i.each(function(a){let d=h()(this);if(d.css("width",r+"%"),!d.data("first")){let c=e.$grid.prependDiv("planner-small-scale-item-line");d.data("scale-item-line",c),d.prependDiv("planner-small-scale-item-line").css("left",0)}});let o=this.$timelineSmall.children().first().data("date-from");this.beginScale=o.valueOf();let l=this.$timelineSmall.children().last().data("date-to");if(this.endScale=l.valueOf(),u.isOneOf(this.displayMode,t.WORK_WEEK,t.WEEK)){let a=this.displayModeOptions[this.displayMode],d=a.interval,c=a.firstHourOfDay,f=a.lastHourOfDay;this.transformLeft=((g,y,v,D,k)=>V=>{let Q=new Date(V);g=new Date(g),y=new Date(y);let ve=y.valueOf()-g.valueOf(),Ze=S.compareDays(Q,g),nt=S.compareDays(y,g),ei=Ze*36e5*24,Mt=24/(D-v+1),ti=Ze/nt;return Q.getHours()<v?(Mt/ve+ti)*100:Q.getHours()>D?(ti=(Ze+1)/nt,(Mt/ve+ti)*100):((Q.valueOf()-(g.valueOf()+v*36e5)-ei)*Mt/ve+ti)*100})(this.viewRange.from,this.viewRange.to,c,f,d),this.transformWidth=((g,y,v,D,k)=>function(V,Q){let ve=y.valueOf()-g.valueOf(),Ze=new U(V,Q),nt=this._findHiddenRangesInWeekMode(),ei=Ze.subtractAll(nt).reduce((ti,Yn)=>ti+Yn.size(),0),Mt=24/(D-v+1);return ei*Mt/ve*100})(this.viewRange.from,this.viewRange.to,c,f,d)}else this.transformLeft=((a,d)=>c=>(c-a)/(d-a)*100)(this.beginScale,this.endScale),this.transformWidth=((a,d)=>(c,f)=>(f-c)/(d-a)*100)(this.beginScale,this.endScale)}_findHiddenRangesInWeekMode(){if(!u.isOneOf(this.displayMode,Te.DisplayMode.WORK_WEEK,Te.DisplayMode.WEEK))return[];let e=[],t=this.displayModeOptions[this.displayMode],i=t.firstHourOfDay,s=t.lastHourOfDay,r=new Date(this.viewRange.from.valueOf());for(;r<this.viewRange.to;){let o=new U(new Date(r.valueOf()).valueOf(),S.shiftTime(r,i).valueOf());o.size()>0&&e.push(o),o=new U(S.shiftTime(r,s+1).valueOf(),S.shiftTime(r,24).valueOf()),o.size()>0&&e.push(o),r.setHours(0),r.setMinutes(0),r.setDate(r.getDate()+1)}return e}_renderDayScale(){let e,t,i,s=!0,r=new Date(this.viewRange.from.valueOf()),o=this.displayModeOptions[this.displayMode],l=o.interval,a=o.labelPeriod,d=o.firstHourOfDay,c=o.lastHourOfDay;for(l=Math.min(l,60*(c-d+1));r<this.viewRange.to;)r.getHours()>=d&&r.getHours()<=c?(e=!1,(r.getMinutes()===0||s)&&(t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"HH")).data("count",0),e=!0),i=this.$timelineSmall.appendDiv("scale-item",this._dateFormat(r,":mm")).data("date-from",new Date(r.valueOf())),r.getMinutes()%(l*a)!==0&&i.addClass("label-invisible"),r=S.shiftTime(r,0,l,0),this._incrementTimelineScaleItems(t,i,r,e),s=!1):r=S.shiftTime(r,0,l,0)}_renderWeekScale(){let e,t,i,s=!0,r=new Date(this.viewRange.from.valueOf()),o=this.displayModeOptions[this.displayMode],l=o.interval,a=o.labelPeriod,d=o.firstHourOfDay,c=o.lastHourOfDay;for(l=Math.min(l,60*(c-d+1));r<this.viewRange.to;)e=!1,r.getHours()<d&&r.setHours(d),(r.getHours()===d&&r.getMinutes()===0||s)&&(r.getMonth()===0||s?t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"d. MMMM yyyy")).data("count",0):r.getDate()===1?t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"d. MMMM")).data("count",0):t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"d.")).data("count",0),e=!0),i=this.$timelineSmall.appendDiv("scale-item",this._dateFormat(r,"HH:mm")).data("date-from",new Date(r.valueOf())),((r.getHours()-d)*60+r.getMinutes())%(l*a)!==0&&i.addClass("label-invisible"),r=S.shiftTime(r,0,l,0,0),this._incrementTimelineScaleItems(t,i,r,e),s=!1,r.getHours()>c&&(r.setHours(0),r.setMinutes(0),r.setDate(r.getDate()+1))}_renderMonthScale(){let e,t,i,s=!0,r=new Date(this.viewRange.from.valueOf()),l=this.displayModeOptions[this.displayMode].labelPeriod;for(;r<this.viewRange.to;)e=!1,(r.getDate()===1||s)&&(r.getMonth()===0||s?t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"MMMM yyyy")).data("count",0):t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"MMMM")).data("count",0),e=!0),i=this.$timelineSmall.appendDiv("scale-item",this._dateFormat(r,"dd")).data("date-from",new Date(r.valueOf())),r.getDate()%l!==0&&i.addClass("label-invisible"),r=S.shift(r,0,0,1),this._incrementTimelineScaleItems(t,i,r,e),s=!1}_renderCalendarWeekScale(){let e,t,i,s=!0,r=new Date(this.viewRange.from.valueOf()),l=this.displayModeOptions[this.displayMode].labelPeriod;for(;r<this.viewRange.to;)e=!1,(r.getDate()<8||s===!0)&&(r.getMonth()===0||s===!0?r.getDate()>11?(t=this.$timelineLarge.appendDiv("scale-item").html(" ").data("count",0),s=2):(t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"MMMM yyyy")).data("count",0),s=!1):s===2?(t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"MMMM yyyy")).data("count",0),s=!1):t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"MMMM")).data("count",0),e=!0),i=this.$timelineSmall.appendDiv("scale-item",S.weekInYear(r)+"").data("date-from",new Date(r.valueOf())).data("tooltipText",this._scaleTooltipText.bind(this)),this._tooltipSupport.install(i),S.weekInYear(r)%l!==0&&i.addClass("label-invisible"),r.setDate(r.getDate()+7),this._incrementTimelineScaleItems(t,i,r,e)}_renderYearScale(){let e,t,i,s=!0,r=new Date(this.viewRange.from.valueOf()),l=this.displayModeOptions[this.displayMode].labelPeriod;for(;r<this.viewRange.to;)e=!1,(r.getMonth()===0||s)&&(t=this.$timelineLarge.appendDiv("scale-item",this._dateFormat(r,"yyyy")).data("count",0),e=!0),i=this.$timelineSmall.appendDiv("scale-item",this._dateFormat(r,"MMMM")).data("date-from",new Date(r.valueOf())),r.getMonth()%l!==0&&i.addClass("label-invisible"),r=S.shift(r,0,1,0),this._incrementTimelineScaleItems(t,i,r,e),s=!1}_incrementTimelineScaleItems(e,t,i,s){e.data("count",e.data("count")+1),t.data("date-to",new Date(i.valueOf())).data("first",s)}_scaleTooltipText(e){let t=" "+this.session.text("ui.to")+" ",i=new Date(e.data("date-from").valueOf()),s=new Date(e.data("date-to").valueOf()-1);return i.getMonth()===s.getMonth()?this._dateFormat(i,"d.")+t+this._dateFormat(s,"d. MMMM yyyy"):i.getFullYear()===s.getFullYear()?this._dateFormat(i,"d. MMMM")+t+this._dateFormat(s,"d. MMMM yyyy"):this._dateFormat(i,"d. MMMM yyyy")+t+this._dateFormat(s,"d. MMMM yyyy")}_removeAllResources(){this.resources.forEach(e=>e.$resource.remove())}_renderResources(e){let t,i="";e=e||this.resources;for(let s=0;s<e.length;s++)t=e[s],i+=this._buildResourceHtml(t);h()(i).appendTo(this.$grid),this.$grid.children(".planner-resource").each((s,r)=>{let o=h()(r);t=this.resourceById(o.attr("data-id")),this._linkResource(o,t),this._linkActivitiesForResource(t)})}_linkResource(e,t){e.data("resource",t),t.$resource=e,t.$cells=e.children(".resource-cells")}_linkActivity(e,t){e.data("activity",t),t.$activity=e}_rerenderActivities(e){e=e||this.resources,e.forEach(t=>{this._removeActivitiesForResource(t),this._renderActivitiesForResource(t)})}_buildResourceHtml(e){let t='<div class="planner-resource" data-id="'+e.id+'">';return t+='<div class="resource-title">'+_.encode(e.resourceCell.text||"")+"</div>",t+='<div class="resource-cells">'+this._buildActivitiesHtml(e)+"</div>",t+="</div>",t}_renderActivitiesForResource(e){e.$cells.html(this._buildActivitiesHtml(e)),this._linkActivitiesForResource(e)}_linkActivitiesForResource(e){e.$cells.children(".planner-activity").each((t,i)=>{let s=h()(i),r=this.activityById(s.attr("data-id"));this._linkActivity(s,r)})}_buildActivitiesHtml(e){let t="";return e.activities.forEach(i=>{i.beginTime.valueOf()>=this.endScale||i.endTime.valueOf()<=this.beginScale||(t+=this._buildActivityHtml(i))}),t}_removeActivitiesForResource(e){e.activities.forEach(t=>{t.$activity&&(t.$activity.remove(),t.$activity=null)})}_buildActivityHtml(e){let t=100-Math.min(e.level*100,100),i=L.modelToCssColor(e.backgroundColor),s=L.modelToCssColor(e.foregroundColor),r=L.modelToCssColor(e.levelColor),o=e.beginTime,l=e.endTime,a=o.valueOf(),d=l.valueOf();a=Math.max(a,this.beginScale),d=Math.min(d,this.endScale);let c="planner-activity"+(e.cssClass?" "+e.cssClass:""),f="left: calc("+this.transformLeft(a)+"% + 2px);";f+=" width: calc("+this.transformWidth(a,d)+"% - 4px);",r&&(f+=" background-color: "+r+";",f+=" border-color: "+r+";"),!r&&i&&(f+=" background-color: "+i+";",f+=" border-color: "+i+";"),s&&(f+=" color: "+s+";");let g="planner-activity-level"+(e.cssClass?" "+e.cssClass:""),y=L.get(g,"background-color").backgroundColor;f+=" background-image: linear-gradient(to bottom, "+y+" 0%, "+y+" "+t+"%, transparent "+t+"%, transparent 100% );";let v="<div";return v+=' class="'+c+'"',v+=' style="'+f+'"',v+=' data-id="'+e.id+'"',v+=">"+_.encode(e.text||"")+"</div>",v}_onCellMouseDown(e){let t,i,s=h()(e.target),r=e.which===3||e.which===1&&e.ctrlKey;if(this.activitySelectable?(!r&&this.$selectors&&this.$selectors.forEach(o=>o.hide()),t=this.$grid.elementFromPoint(e.pageX,e.pageY),!r&&this.$selectors&&this.$selectors.forEach(o=>o.show()),t.hasClass("planner-activity")?(i=t.parent().parent(),this.selectResources([i.data("resource")]),this.selectActivity(t.data("activity")),this.selectRange(new Ne)):this.selectActivity(null)):this.selectActivity(null),!!this.rangeSelectable){if(s.hasClass("selector")){if(r)return}else e.which===1&&e.ctrlKey&&this.multiSelect&&(this._resourceSelectionMode=Te.ResourceSelectionMode.ADD);this.selectedActivity||this._startRangeSelection(e.pageX,e.pageY),this._removeMouseMoveHandlers(),this._cellMousemoveHandler=this._onCellMousemove.bind(this,e),this._$body.document().on("mousemove",this._cellMousemoveHandler).one("mouseup",this._onDocumentMouseUp.bind(this))}}_startRangeSelection(e,t){this.startRow=this._findRow(t),this.lastRow=this.startRow,this.startRange=this._findScale(e),this.lastRange=this.startRange,this._select(),this._rangeSelectionStarted=!0}_prepareRangeSelectionByMousemove(e,t){let i=e.pageX-t.pageX,s=e.pageY-t.pageY,r=Te.RANGE_SELECTION_MOVE_THRESHOLD;if(Math.abs(i)>=r)return!0;let o=this._findRow(e.pageY),l=this._findRow(t.pageY);return Math.abs(s)>=r&&this.multiSelect&&o!==l}_onCellMousemove(e,t){if(this.selectedActivity&&!this._rangeSelectionStarted){if(!this._prepareRangeSelectionByMousemove(e,t))return;this._startRangeSelection(e.pageX,e.pageY)}let i=this._findRow(t.pageY);i&&(this.lastRow=i);let s=this._findScale(t.pageX);s&&(this.lastRange=s),this._select()}_onResizeMouseDown(e){let t,i=h()(e.target);return this.startRow=this.selectedResources[0],this.lastRow=this.selectedResources[this.selectedResources.length-1],this.startRange=u.nvl(this._findScaleByFromDate(this.selectionRange.from),new U(this.selectionRange.from.getTime(),this.selectionRange.from.getTime())),this.lastRange=u.nvl(this._findScaleByToDate(this.selectionRange.to),new U(this.selectionRange.to.getTime(),this.selectionRange.to.getTime())),i.hasClass("selector-resize-left")&&(t=this.startRange,this.startRange=this.lastRange,this.lastRange=t),this._$body.addClass("col-resize"),this._removeMouseMoveHandlers(),this._resizeMousemoveHandler=this._onResizeMousemove.bind(this),this._$body.document().on("mousemove",this._resizeMousemoveHandler).one("mouseup",this._onDocumentMouseUp.bind(this)),!1}_onResizeMousemove(e){if(!this.rendered)return;let t=this._findScale(e.pageX);t&&(this.lastRange=t),this._select(!1)}_onDocumentMouseUp(e){this._$body.removeClass("col-resize"),this._removeMouseMoveHandlers(),this._resourceSelectionMode=Te.ResourceSelectionMode.DEFAULT,this._rangeSelectionStarted&&(this._rangeSelectionStarted=!1,this.rendered&&this._select(!1))}_removeMouseMoveHandlers(){this._cellMousemoveHandler&&(this._$body.document().off("mousemove",this._cellMousemoveHandler),this._cellMousemoveHandler=null),this._resourceTitleMousemoveHandler&&(this._$body.document().off("mousemove",this._resourceTitleMousemoveHandler),this._resourceTitleMousemoveHandler=null),this._resizeMousemoveHandler&&(this._$body.document().off("mousemove",this._resizeMousemoveHandler),this._resizeMousemoveHandler=null)}_select(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(e&&(!this.startRow||!this.lastRow))return;let t=!!(this.startRange&&this.lastRange);if(e){let i=this.startRow.$resource,s=this.lastRow.$resource;this.multiSelect||(this.lastRow=this.startRow,s=this.startRow.$resource);let r=i[0].offsetTop<=s[0].offsetTop?i:s,o=i[0].offsetTop>s[0].offsetTop?i:s,l=h()(".planner-resource",this.$grid).toArray(),a=r[0].offsetTop,d=o[0].offsetTop;for(let f=l.length-1;f>=0;f--){let g=l[f];(g.offsetTop<a&&g.offsetTop<d||g.offsetTop>a&&g.offsetTop>d)&&l.splice(f,1)}let c=l.map(f=>h()(f).data("resource"));this._resourceSelectionMode===Te.ResourceSelectionMode.ADD?(c=c.concat(this.selectedResources).sort((f,g)=>rt.NUMERIC.compare(f.$resource.index(),g.$resource.index())),this.selectResources(c)):this._resourceSelectionMode===Te.ResourceSelectionMode.DESELECT?this.deselectResources(c):this.selectResources(c)}if(this.selectActivity(null),t){let i=Math.min(this.lastRange.from.valueOf(),this.startRange.from.valueOf()),s=Math.max(this.lastRange.to.valueOf(),this.startRange.to.valueOf()),r=new Ne(new Date(i),new Date(s));r=this._adjustSelectionRange(r),this.selectRange(r)}}_adjustSelectionRange(e){let t=e.from.getTime(),i=e.to.getTime(),s=0,r=this.displayModeOptions[this.displayMode];r.interval>0&&r.minSelectionIntervalCount>0&&(s=r.minSelectionIntervalCount*r.interval*6e4);let o=r.lastHourOfDay,l=S.shiftTime(S.trunc(e.from),o+1),a=this._visibleViewRange();return this.lastRange.from<this.startRange.from?i-s>=a.from.getTime()?t=Math.min(t,i-s):(t=a.from.getTime(),i=Math.max(i,Math.min(t+s,a.to.getTime()))):t+s<=a.to.getTime()?(i=Math.max(i,Math.max(t+s,a.from.getTime())),i>=l.getTime()&&new U(t,i).size()===s&&(i=l.getTime(),t=Math.min(t,i-s))):(i=a.to.getTime(),t=Math.min(t,i-s)),new Ne(new Date(t),new Date(i))}_findRow(e){let t,i=C.offsetBounds(this.$grid),s=i.x+10;return e=Math.min(Math.max(e,0),i.y+i.height-1),t=this.$container.elementFromPoint(s,e,".planner-resource"),t.length>0?t.data("resource"):null}_findScale(e){let t,i=C.offsetBounds(this.$grid),s=this.$scale.offset().top+this.$scale.height()*.75;return e=Math.min(Math.max(e,0),i.x+i.width-1),t=this.$container.elementFromPoint(e,s,".scale-item"),t.length>0?new Ne(t.data("date-from").valueOf(),t.data("date-to").valueOf()):null}_findScaleByFromDate(e){return this._findScaleByFunction((t,i)=>{if(h()(i).data("date-from").getTime()===e.getTime())return!0})}_findScaleByToDate(e){return this._findScaleByFunction((t,i)=>{if(h()(i).data("date-to").getTime()===e.getTime())return!0})}_findScaleByFunction(e){let t=this.$timelineSmall.children(".scale-item").filter(e);return t.length?new Ne(t.data("date-from").valueOf(),t.data("date-to").valueOf()):null}_visibleViewRange(){let e=this.$timelineSmall.children(".scale-item");return new Ne(e.first().data("date-from"),e.last().data("date-to"))}_dateFormat(e,t){let i=new Date(e.valueOf());return new St(this.session.locale,t).format(i)}_renderViewRange(){this._renderRange(),this._renderScale(),this.invalidateLayoutTree()}_renderHeaderVisible(){this.header.setVisible(this.headerVisible),this.invalidateLayoutTree()}_renderYearPanelVisible(e){let t;this.yearPanelVisible&&this.yearPanel.renderContent(),h()(".calendar-toggle-year",this.$modes).select(this.yearPanelVisible),this.yearPanelVisible?t=210:t=0,this.yearPanel.$container.animate({width:t},{duration:e?500:0,progress:this._onYearPanelWidthChange.bind(this),complete:this._afterYearPanelWidthChange.bind(this)})}_onYearPanelWidthChange(){if(!this.yearPanel.$container)return;let e=this.yearPanel.$container.outerWidth();this.$grid.css("width","calc(100% - "+e+"px)"),this.$scale.css("width","calc(100% - "+e+"px)"),this.revalidateLayout()}_afterYearPanelWidthChange(){this.yearPanelVisible||this.yearPanel.removeContent()}_setMenus(e){this.updateKeyStrokes(e,this.menus),this._setProperty("menus",e),this._updateMenuBar()}_removeMenus(){}_updateMenuBar(){let e=this._filterMenus([Te.MenuType.EmptySpace,Te.MenuType.Resource,Te.MenuType.Activity,Te.MenuType.Range],!1,!0);this.menuBar.setMenuItems(e)}_filterMenus(e,t,i){return e=e||[],e.indexOf(Te.MenuType.Resource)>-1&&this.selectedResources.length===0&&p.remove(e,Te.MenuType.Resource),e.indexOf(Te.MenuType.Activity)>-1&&!this.selectedActivity&&p.remove(e,Te.MenuType.Activity),e.indexOf(Te.MenuType.Range)>-1&&(this.selectedResources.length===0||!this.selectionRange.from||!this.selectionRange.to)&&p.remove(e,Te.MenuType.Range),$e.filter(this.menus,e,{onlyVisible:t,enableDisableKeyStrokes:i,defaultMenuTypes:this.defaultMenuTypes})}setDisplayModeOptions(e){this.setProperty("displayModeOptions",e)}_setDisplayModeOptions(e){e&&this._adjustHours(e),this.displayModeOptions=e}_adjustHours(e){b.values(e).forEach(i=>{i.firstHourOfDay&&(i.firstHourOfDay=t(i.firstHourOfDay)),i.lastHourOfDay&&(i.lastHourOfDay=t(i.lastHourOfDay))});function t(i){return i<0?0:i>23?23:i}}_renderDisplayModeOptions(){this._renderRange(),this._renderScale(),this._rerenderActivities(),this._select(!1),this.invalidateLayoutTree()}_renderAvailableDisplayModes(){}_renderDisplayMode(){}_setViewRange(e){if(e=Ne.ensure(e)||new Ne,e.from&&e.from.valueOf()>=e.to?.valueOf())throw new Error("Invalid viewRange provided: "+e);this._setProperty("viewRange",e),this.yearPanel.setViewRange(this.viewRange),this.yearPanel.selectDate(this.viewRange.from)}_setDisplayMode(e){this._setProperty("displayMode",e),this.yearPanel.setDisplayMode(this.displayMode),this.header.setDisplayMode(this.displayMode)}_setAvailableDisplayModes(e){this._setProperty("availableDisplayModes",e),this.header.setAvailableDisplayModes(this.availableDisplayModes)}_setSelectionRange(e){e=Ne.ensure(e),this._setProperty("selectionRange",e),this.session.onRequestsDone(this._updateMenuBar.bind(this))}_setSelectedResources(e){typeof e[0]=="string"&&(e=this.resourcesByIds(e)),this.rendered&&this._removeSelectedResources(),this._setProperty("selectedResources",e),this.session.onRequestsDone(this._updateMenuBar.bind(this))}_removeSelectedResources(){this.selectedResources.forEach(e=>e.$resource.select(!1))}_renderSelectedResources(){this.selectedResources.forEach(e=>e.$resource.select(!0))}_renderActivitySelectable(){this.selectedActivity&&this.selectedActivity.$activity&&this.selectedActivity.$activity.toggleClass("selected",this.activitySelectable)}_renderRangeSelectable(){this.rangeSelectable?this._renderSelectionRange():this._removeSelectors()}_renderMultiSelect(){!this.multiSelect&&p.length(this.selectedResources)>1&&this.selectResources(this.selectedResources[0])}_removeSelectors(){this.$selectors&&this.$selectors.forEach(e=>e.remove()),this.$highlight&&this.$highlight.remove()}_renderSelectionRange(){if(this._removeSelectors(),!this.rangeSelectable||this.selectedResources.length===0||!this.selectionRange.from||!this.selectionRange.to)return;this.$selectors=[];let e=this.selectedResources[0].$resource,t=e,i;for(let s=0;s<this.selectedResources.length;s++){let r=this.selectedResources[s].$resource,o=r.index();i&&i+1<o&&(this._renderSelectionRangeInternal(e,t,!1),e=r),i=o,t=r}this._renderSelectionRangeInternal(e,t,!0)}_renderSelectionRangeInternal(e,t,i){let s=this.selectionRange.from,r=this.selectionRange.to,o=Math.max(s.valueOf(),this.beginScale),l=Math.min(r.valueOf(),this.endScale),d=(e[0].offsetTop<=t[0].offsetTop?e:t).children(".resource-cells").appendDiv("selector");d.cssHeight(e.outerHeight()+Math.abs(t[0].offsetTop-e[0].offsetTop));let c=d.appendDiv("selector-resize-left").on("mousedown",this._onResizeMouseDown.bind(this)),f=d.appendDiv("selector-resize-right").on("mousedown",this._onResizeMouseDown.bind(this));if(d.css("left","calc("+this.transformLeft(o)+"% - "+c.cssWidth()+"px)").css("width","calc("+this.transformWidth(o,l)+"% + "+(c.cssWidth()+f.cssWidth())+"px)").on("contextmenu",this._onRangeSelectorContextMenu.bind(this)),this.$selectors.push(d),i){this.$highlight=this.$timelineSmall.prependDiv("highlight");let g=this.$selectors[0].cssLeft()+c.cssWidth()+this.$scaleTitle.cssWidth(),y=this.$selectors[0].cssWidth()-(c.cssWidth()+f.cssWidth());this.$highlight.cssLeft(g).cssWidth(y)}}_setSelectedActivity(e){typeof e=="string"&&(e=this.activityById(e)),this.rendered&&this._removeSelectedActivity(),this._setProperty("selectedActivity",e),this.session.onRequestsDone(this._updateMenuBar.bind(this))}_removeSelectedActivity(){this.selectedActivity&&this.selectedActivity.$activity&&this.selectedActivity.$activity.removeClass("selected")}_renderSelectedActivity(){this.selectedActivity&&this.selectedActivity.$activity&&this.selectedActivity.$activity.addClass("selected")}_renderLabel(){let e=this.label||"";this.$scaleTitle&&this.$scaleTitle.text(e)}resourcesByIds(e){return e.map(this.resourceById.bind(this))}activityById(e){return this.activityMap[e]}resourceById(e){return this.resourceMap[e]}setDisplayMode(e){this.setProperty("displayMode",e),this.startRange=null,this.lastRange=null}layoutYearPanel(){this.yearPanelVisible&&(P.update(this.yearPanel.$yearList),this.yearPanel._scrollYear())}setYearPanelVisible(e){this.yearPanelVisible!==e&&(this._setProperty("yearPanelVisible",e),this.rendered&&this._renderYearPanelVisible(!0))}setViewRangeFrom(e){let t=S.compareDays(this.viewRange.to,this.viewRange.from),i=new Ne(this.viewRange.from,this.viewRange.to);i.from=e,i.to=S.shift(e,0,0,t),this.setViewRange(i)}setViewRange(e){this.viewRange!==e&&(this._setViewRange(e),this.rendered&&(this._renderViewRange(),this._rerenderActivities(),this._renderSelectedActivity(),this.validateLayoutTree(),this._reconcileScrollPos()))}selectRange(e){e&&e.equals(this.selectionRange)||this.setProperty("selectionRange",e)}selectActivity(e){this.setProperty("selectedActivity",e)}selectResources(e){let t=p.ensure(e);p.equals(t,this.selectedResources)||(t=t.slice(),this.setProperty("selectedResources",t),this.trigger("resourcesSelected",{resources:t}),this.rendered&&this._renderSelectionRange())}deselectResources(e){let t=!1;e=p.ensure(e);let i=this.selectedResources.slice();return p.removeAll(i,e)&&(this.selectResources(i),t=!0),t}insertResources(e){let t=[];e.forEach(i=>{let s=this._initResource(i);t.push(s),this.resources.push(s)}),this.rendered&&(this._renderResources(t),this.invalidateLayoutTree())}deleteResources(e){this.deselectResources(e)&&this.selectRange(new Ne),e.forEach(t=>{p.remove(this.resources,t),delete this.resourceMap[t.id],t.activities.forEach(i=>delete this.activityMap[i.id]),this.rendered&&(t.$resource.remove(),delete t.$resource)}),this.invalidateLayoutTree()}deleteAllResources(){this.rendered&&(this._removeAllResources(),this.invalidateLayoutTree()),this.resources=[],this.resourceMap={},this.activityMap={},this.selectResources([]),this.selectRange(new Ne)}updateResources(e){e.forEach(t=>{let i=this.resourceMap[t.id];if(!i)throw new Error("Update event received for non existing resource. ResourceId: "+t.id);this._initResource(t);let s=t;if(p.replace(this.resources,i,s),p.replace(this.selectedResources,i,s),this.rendered&&i.$resource){let r=h()(this._buildResourceHtml(s));i.$resource.replaceWith(r),r.css("min-width",i.$resource.css("min-width")),this._linkResource(r,s),this._linkActivitiesForResource(s)}})}}class bn extends K{constructor(){super(),this._addRemoteProperties(["displayMode","viewRange","selectionRange","selectedActivity"]),this._addOrderedProperties(["displayMode","viewRange"])}_sendViewRange(e){this._send("property",{viewRange:S.toJsonDateRange(e)})}_sendSelectedActivity(){let e=null;this.widget.selectedActivity&&(e=this.widget.selectedActivity.id),this._send("property",{selectedActivity:e})}_sendSelectionRange(){let e=S.toJsonDateRange(this.widget.selectionRange);this._send("property",{selectionRange:e})}_onWidgetResourcesSelected(e){this._sendResourcesSelected()}_sendResourcesSelected(){let e=this.widget.selectedResources.map(t=>t.id);this._send("resourcesSelected",{resourceIds:e})}_onWidgetEvent(e){e.type==="resourcesSelected"?this._onWidgetResourcesSelected(e):super._onWidgetEvent(e)}_onResourcesInserted(e){this.widget.insertResources(e)}_onResourcesDeleted(e){let t=this.widget.resourcesByIds(e);this.addFilterForWidgetEventType("resourcesSelected"),this.addFilterForProperties({selectionRange:new Ne}),this.widget.deleteResources(t)}_onAllResourcesDeleted(){this.addFilterForWidgetEventType("resourcesSelected"),this.addFilterForProperties({selectionRange:new Ne}),this.widget.deleteAllResources()}_onResourcesSelected(e){let t=this.widget.resourcesByIds(e);this.addFilterForWidgetEventType("resourcesSelected"),this.widget.selectResources(t)}_onResourcesUpdated(e){this.widget.updateResources(e)}onModelAction(e){e.type==="resourcesInserted"?this._onResourcesInserted(e.resources):e.type==="resourcesDeleted"?this._onResourcesDeleted(e.resourceIds):e.type==="allResourcesDeleted"?this._onAllResourcesDeleted():e.type==="resourcesSelected"?this._onResourcesSelected(e.resourceIds):e.type==="resourcesUpdated"?this._onResourcesUpdated(e.resources):super.onModelAction(e)}static _initResourceRemote(e){return this.modelAdapter&&Be.applyTo(e,"Resource"),this._initResourceOrig(e)}static _initActivityRemote(e){return this.modelAdapter&&Be.applyTo(e,"Activity"),this._initActivityOrig(e)}static modifyPlannerPrototype(){G.get().remote&&(b.replacePrototypeFunction(Te,"_initResource",bn._initResourceRemote,!0),b.replacePrototypeFunction(Te,"_initActivity",bn._initActivityRemote,!0))}}G.addListener("bootstrap",bn.modifyPlannerPrototype);class fd extends I{$range;$commands;availableDisplayModes;displayMode;constructor(){super(),this.availableDisplayModes=[]}_render(){this.$container=this.$parent.appendDiv("planner-header"),this.$range=this.$container.appendDiv("planner-range"),this.$range.appendDiv("planner-previous").on("click",this._onPreviousClick.bind(this)),this.$range.appendDiv("planner-today",this.session.text("ui.CalendarToday")).on("click",this._onTodayClick.bind(this)),this.$range.appendDiv("planner-next").on("click",this._onNextClick.bind(this)),this.$range.appendDiv("planner-select"),this.$commands=this.$container.appendDiv("planner-commands"),this._renderAvailableDisplayModes(),this._renderDisplayMode()}setAvailableDisplayModes(e){this.setProperty("availableDisplayModes",e)}_renderAvailableDisplayModes(){let e=Te.DisplayMode;this.$commands.empty(),this.availableDisplayModes.length>1&&(this.availableDisplayModes.indexOf(e.DAY)>-1&&this.$commands.appendDiv("planner-mode",this.session.text("ui.CalendarDay")).attr("data-mode",e.DAY).on("click",this._onDisplayModeClick.bind(this)),this.availableDisplayModes.indexOf(e.WORK_WEEK)>-1&&this.$commands.appendDiv("planner-mode",this.session.text("ui.CalendarWorkWeek")).attr("data-mode",e.WORK_WEEK).on("click",this._onDisplayModeClick.bind(this)),this.availableDisplayModes.indexOf(e.WEEK)>-1&&this.$commands.appendDiv("planner-mode",this.session.text("ui.CalendarWeek")).attr("data-mode",e.WEEK).on("click",this._onDisplayModeClick.bind(this)),this.availableDisplayModes.indexOf(e.MONTH)>-1&&this.$commands.appendDiv("planner-mode",this.session.text("ui.CalendarMonth")).attr("data-mode",e.MONTH).on("click",this._onDisplayModeClick.bind(this)),this.availableDisplayModes.indexOf(e.CALENDAR_WEEK)>-1&&this.$commands.appendDiv("planner-mode",this.session.text("ui.CalendarCalendarWeek")).attr("data-mode",e.CALENDAR_WEEK).on("click",this._onDisplayModeClick.bind(this)),this.availableDisplayModes.indexOf(e.YEAR)>-1&&this.$commands.appendDiv("planner-mode",this.session.text("ui.CalendarYear")).attr("data-mode",e.YEAR).on("click",this._onDisplayModeClick.bind(this)));let t=this.$commands.children(".planner-mode");t.first().addClass("first"),t.last().addClass("last"),t.length===1&&(t.first().addClass("disabled"),t.off("click")),this.$commands.appendDiv("planner-toggle-year").on("click",this._onYearClick.bind(this))}setDisplayMode(e){this.setProperty("displayMode",e)}_renderDisplayMode(){h()(".planner-mode",this.$commands).select(!1),h()('[data-mode="'+this.displayMode+'"]',this.$commands).select(!0)}_onTodayClick(e){this.trigger("todayClick")}_onNextClick(e){this.trigger("nextClick")}_onPreviousClick(e){this.trigger("previousClick")}_onYearClick(e){this.trigger("yearClick")}_onDisplayModeClick(e){let t=h()(e.target).data("mode");this.setDisplayMode(t),this.trigger("displayModeClick",{displayMode:this.displayMode})}}class gd extends ne{planner;constructor(e){super(),this.planner=e}layout(e){let t,i=this.planner.header.$container,s=this.planner.$scale,r=this.planner.$grid,o=this.planner.menuBar,l=this.planner.yearPanel.$container,a=0,d=0,c=0,f=0,g=0,y=x.get(o.$container),v=this.planner.htmlComp,D=v.availableSize().subtract(v.insets());o.$container.isVisible()&&(t=Fs.size(y,D),y.setSize(t),a=t.height,o.position==="top"&&(g+=a)),i.isVisible()&&(g+=C.size(i).height),s.css("top",g),f+=g+C.size(s).height,r.css("top",f),c=g+l.cssMarginY(),d=f+r.cssMarginY(),o.$container.isVisible()&&o.position==="bottom"&&(c+=a,d+=a),l.css("height","calc(100% - "+c+"px)"),r.css("height","calc(100% - "+d+"px)"),this._updateMinWidth(),this._layoutScaleLines(),P.update(this.planner.$grid,!0),this.planner._reconcileScrollPos(),this.planner.layoutYearPanel()}_updateMinWidth(){let e=this._minWidth(),t=this.planner.$scaleTitle,i=this.planner.$timeline;i&&(i.css("min-width",e),e+=t.outerWidth(!0),this.planner.resources.forEach(s=>s.$resource.css("min-width",e)))}_layoutScaleLines(){let e=this.planner.$timelineSmall;if(!e)return;let t=this.planner.$timelineLarge,i=e.children(".scale-item"),s=t.children(".scale-item");s.each(function(){h()(this).data("scale-item-line").cssHeight(0)}),i.each(function(){let l=h()(this).data("scale-item-line");l&&l.cssHeight(0)}),P.reset(this.planner.$grid);let r=this.planner.$grid[0].scrollHeight,o=this.planner.$scale[0].scrollLeft;s.each(function(){let l=h()(this);l.data("scale-item-line").cssLeft(o+l.position().left).cssHeight(r)}),i.each(function(){let l=h()(this),a=l.data("scale-item-line");a&&a.cssLeft(o+l.position().left).cssHeight(r)})}_minWidth(){let e=this.planner.$timelineLarge.children(".scale-item"),t=this.planner.$timelineSmall.children(".scale-item"),i=e.length,s=t.length,r=Te.DisplayMode,o=C.insets(t,{includeBorder:!1}),l=s*o.horizontal();if(this.planner.displayMode===r.DAY)return Math.max(l,i*52);if(u.isOneOf(this.planner.displayMode,r.WORK_WEEK,r.WEEK))return Math.max(l,i*160);if(this.planner.displayMode===r.MONTH||this.planner.displayMode===r.CALENDAR_WEEK)return Math.max(l,s*23);if(this.planner.displayMode===r.YEAR)return Math.max(l,s*90)}}class md extends gn{constructor(e,t,i){super(e,t,i),this.selectionTypes=["Resource","Activity","Range"]}}class Bf extends I{maximumUploadSize;acceptTypes;multiSelect;displayParent;files;boxButtons;uploadButton;cancelButton;fileInput;$content;$title;$files;dragAndDropHandler;_glassPaneRenderer;constructor(){super(),this.displayParent=null,this.files=[],this._glassPaneRenderer=null,this.maximumUploadSize=Ei.DEFAULT_MAXIMUM_UPLOAD_SIZE,this.boxButtons=null,this.uploadButton=null,this.cancelButton=null,this.inheritAccessibility=!1,this._addWidgetProperties(["boxButtons","uploadButton","cancelButton"])}_init(e){super._init(e),this._setDisplayParent(this.displayParent),this._glassPaneRenderer=new Fr(this),this.fileInput=u.create(Ei,{parent:this,acceptTypes:this.acceptTypes,maximumUploadSize:this.maximumUploadSize,multiSelect:this.multiSelect,visible:!w.get().supportsFile()}),this.fileInput.on("change",this._onFileChange.bind(this)),this.boxButtons=u.create(po,{parent:this}),this.boxButtons.addButton({text:this.session.text("ui.Browse")}).on("action",i=>this._onAddFileButtonClicked(i)),this.uploadButton=this.boxButtons.addButton({text:this.session.text("ui.Upload"),enabled:!1}),this.uploadButton.on("action",i=>this._onUploadButtonClicked(i)),this.cancelButton=this.boxButtons.addButton({text:this.session.text("Cancel")}),this.cancelButton.on("action",i=>this._onCancelButtonClicked(i))}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new fl(this.session,this),new co(this,[m.SPACE,m.ENTER]),new fn(this,()=>this.cancelButton?this.cancelButton.$container:null)])}_render(){this.$container=this.$parent.appendDiv("file-chooser").on("mousedown",this._onMouseDown.bind(this));let e=this.$container.appendDiv("drag-handle");this.$container.draggable(e),this.$content=this.$container.appendDiv("file-chooser-content"),this.$title=this.$content.appendDiv("file-chooser-title").text(this.session.text(this.multiSelect?"ui.ChooseFiles":"ui.ChooseFile")),this.fileInput.render(this.$content),this.$content.appendDiv("file-chooser-label").text(this.session.text("ui.FileChooserHint")),this.$files=this.$content.appendElement("<ul>","file-chooser-files"),this._installScrollbars(),this.boxButtons.render(),this.boxButtons.$container.addClass("file-chooser-buttons"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new xo(this)),this.$container.addClassForAnimation("animate-open"),this.$container.addClass("calc-helper");let t=this.$container.windowSize(),i=Math.min(this.$container.width(),t.width);this.$container.css("min-width",i),this.$container.css("max-width",i),this.$container.removeClass("calc-helper"),this._glassPaneRenderer.renderGlassPanes(),this._position()}_renderProperties(){super._renderProperties(),this._renderFiles()}_renderEnabled(){super._renderEnabled(),this._installOrUninstallDragAndDropHandler()}_postRender(){super._postRender(),this._installFocusContext()}_remove(){this._glassPaneRenderer.removeGlassPanes(),z.uninstallDragAndDropHandler(this),this._uninstallFocusContext(),super._remove()}_installFocusContext(){this.session.focusManager.installFocusContext(this.$container,Et.AUTO)}_uninstallFocusContext(){this.session.focusManager.uninstallFocusContext(this.$container)}get$Scrollable(){return this.$files}_position(){this.$container.cssMarginLeft(-this.$container.outerWidth()/2)}setDisplayParent(e){this.setProperty("displayParent",e)}_setDisplayParent(e){this._setProperty("displayParent",e),e&&this.setParent(this.findDesktop().computeParentForDisplayParent(e))}setMaximumUploadSize(e){this.setProperty("maximumUploadSize",e),this.fileInput.setMaximumUploadSize(e)}open(){this.setDisplayParent(this.displayParent||this.session.desktop),this.displayParent.fileChooserController.registerAndRender(this)}close(){if(!this.rendered){this.cancel();return}this.cancelButton&&this.cancelButton.$container&&this.session.focusManager.requestFocus(this.cancelButton.$container)&&this.cancelButton.doAction()}cancel(){this.trigger("cancel").defaultPrevented||this._close()}_close(){this.displayParent&&this.displayParent.fileChooserController.unregisterAndRemove(this),this.destroy()}_installOrUninstallDragAndDropHandler(){z.installOrUninstallDragAndDropHandler({target:this,onDrop:e=>this.addFiles(e.files),dropMaximumSize:()=>this.maximumUploadSize,validateFiles:(e,t)=>{}})}browse(){this.fileInput.browse()}setAcceptTypes(e){this.setProperty("acceptTypes",e),this.fileInput.setAcceptTypes(e)}setMultiSelect(e){this.setProperty("multiSelect",e),this.fileInput.setMultiSelect(e)}addFiles(e){e instanceof FileList&&(e=Gt.fileListToArray(e)),e=p.ensure(e),e.length!==0&&(this.multiSelect?(e=e.slice(),p.insertAll(e,this.files,0),this.setFiles(e)):this.setFiles([e[0]]))}removeFile(e){let t=this.files.slice();p.remove(t,e),this.setFiles(t),this.fileInput.clear()}setFiles(e){e instanceof FileList&&(e=Gt.fileListToArray(e)),e=p.ensure(e);try{this.fileInput.validateMaximumUploadSize(e)}catch{Ri.createOk(this).withHeader(this.session.text("ui.FileSizeLimitTitle")).withBody(Gt.getErrorMessageMaximumUploadSizeExceeded(this.session,this.fileInput.maximumUploadSize)).withSeverity(E.Severity.ERROR).buildAndOpen();return}this.setProperty("files",e)}_renderFiles(){let e=this.files;this.$files.empty(),e.forEach(t=>{let i=this.$files.appendElement("<li>","file",t.name);i.append(" ");let s=i.appendSpan("remove").on("click",this.removeFile.bind(this,t)),r=i.makeElement("<a>","remove-link",this.session.text("Remove"));s.append(r)}),P.update(this.$files),this.uploadButton.setEnabled(e.length>0)}_onUploadButtonClicked(e){this.trigger("upload")}_onCancelButtonClicked(e){this.cancel()}_onAddFileButtonClicked(e){this.browse()}_onFileChange(e){this.addFiles(e.files)}_onMouseDown(e){let t=this.findParent(i=>i instanceof j&&i.isDialog());t&&t.activate()}_attach(){this.$parent.append(this.$container),super._attach()}_detach(){this.$container.detach(),super._detach()}}class Of extends K{_onWidgetCancel(e){e.preventDefault(),this._send("cancel")}_onWidgetEvent(e){e.type==="cancel"?this._onWidgetCancel(e):e.type==="upload"?this._onUpload(e):super._onWidgetEvent(e)}_onUpload(e){this.widget.rendered&&this.widget.uploadButton.setEnabled(!1),this.widget.files.length!==0&&(this.session.uploadFiles(this,this.widget.files,void 0,this.widget.maximumUploadSize),this.session.listen().done(()=>{this.widget&&this.widget.rendered&&this.widget.uploadButton.setEnabled(!0)}))}}class So extends bo{remove(){this.displayParent.fileChoosers.forEach(this._remove.bind(this))}render(){this.displayParent.fileChoosers.forEach(e=>{e.setDisplayParent(this.displayParent),this._render(e)})}attach(){this.displayParent.fileChoosers.forEach(e=>e.attach())}detach(){this.displayParent.fileChoosers.forEach(e=>e.detach())}_register(e){this._registerChild(e,"fileChoosers")}_unregister(e){this._unregisterChild(e,"fileChoosers")}}class Ei extends I{acceptTypes;maximumUploadSize;multiSelect;text;uploadController;files;$fileInput;$text;dragAndDropHandler;constructor(){super(),this.acceptTypes=null,this.maximumUploadSize=Ei.DEFAULT_MAXIMUM_UPLOAD_SIZE,this.multiSelect=!1,this.files=[],this.text=null}static DEFAULT_MAXIMUM_UPLOAD_SIZE=50*1024*1024;_init(e){super._init(e),this.uploadController=e.uploadController||e.parent}_render(){this.$fileInput=this.$parent.makeElement("<input>").attr("type","file").on("change",this._onFileChange.bind(this)),this.$container=this.$parent.appendDiv("file-input input-field"),this.$fileInput.appendTo(this.$container),this.$container.on("mousedown",this._onMouseDown.bind(this)),this.$text=this.$container.appendDiv("file-input-text")}_renderProperties(){super._renderProperties(),this._renderText(),this._renderAcceptTypes(),this._renderMultiSelect()}_renderEnabled(){super._renderEnabled(),this._installOrUninstallDragAndDropHandler(),this.$container.setTabbable(this.enabledComputed)}setText(e){this.setProperty("text",e)}_renderText(){let e=this.text||"";this.$text.text(e)}setAcceptTypes(e){this.setProperty("acceptTypes",e)}_renderAcceptTypes(){let e=this.acceptTypes||"";this.$fileInput.attr("accept",e)}setMultiSelect(e){this.setProperty("multiSelect",e)}_renderMultiSelect(){this.$fileInput.prop("multiple",this.multiSelect)}setMaximumUploadSize(e){this.setProperty("maximumUploadSize",e)}_remove(){z.uninstallDragAndDropHandler(this),super._remove()}_installOrUninstallDragAndDropHandler(){z.installOrUninstallDragAndDropHandler({target:this,onDrop:e=>{e.files.length>=1&&this.setFiles(e.files)},dropMaximumSize:()=>this.maximumUploadSize,validateFiles:(e,t)=>{}})}clear(){this.setFiles([]),this.setText(null),this.rendered&&this.$fileInput.val(null)}setFiles(e){let t;if(e instanceof FileList?t=Gt.fileListToArray(e):t=p.ensure(e),p.equals(this.files,t))return;let i="";t.length>0&&(i=t[0].name),this.files=t,this.setText(i),this.trigger("change",{files:t})}upload(){return this.files.length===0?!0:this.session.uploadFiles(this.uploadController,this.files,void 0,this.maximumUploadSize)}browse(){this.$fileInput.trigger("click")}_onFileChange(e){let t=this.$fileInput[0].files;t.length&&this.setFiles(t)}_onMouseDown(e){this.enabled&&this.browse()}validateMaximumUploadSize(e){if(!Gt.validateMaximumUploadSize(e,this.maximumUploadSize))throw Gt.getErrorMessageMaximumUploadSizeExceeded(this.session,this.maximumUploadSize)}}class Hf{location;constructor(){this.location=null}matches(e){return!1}activate(e){this.location=e}deactivate(){}}const It={routes:[],events:new Ui,currentRoute:null,defaultLocation:null,setDefaultLocation(n){It.defaultLocation="#"+n},prepare(n,e){_.startsWith(e,"#")||(e="#"+e),n.attr("href",e).on("mousedown",t=>(It.activate(e),!1))},activate(n){n||(n=new RegExp("[^/]*$").exec(document.location.href)[0]),(_.empty(n)||n==="/")&&(n=It.defaultLocation);for(let e=0;e<It.routes.length;e++){let t=It.routes[e];if(t.matches(n)){if(t===It.currentRoute&&t.location===n){h().log.isDebugEnabled()&&h().log.debug("Route has not changed - do not activate route");return}It.currentRoute&&It.currentRoute.deactivate(),It.currentRoute=t,It.currentRoute.activate(n),window.location.replace(n),h().log.isInfoEnabled()&&h().log.info("router: activated route for location ",n),It.events.trigger("routeChange",new _d(t));return}}h().log.isInfoEnabled()&&h().log.info("router: no route registered for location "+n)},register(n){It.routes.push(n)},on(n,e){It.events.on(n,e)},updateLocation(n){let e="#"+n;window.location.replace(e)}};class _d extends qe{route;constructor(e){super({route:e})}}window.addEventListener("popstate",n=>(It.activate(null),!1));class yn extends I{static FLOATING_POINT_ERROR_CORRECTION=1e8;value;minValue;maxValue;step;tabbable;_mouseMoveHandler=this._onMouseMove.bind(this);_mouseUpHandler=this._onMouseUp.bind(this);$window;$track;$thumb;constructor(){super(),this.value=null,this.minValue=null,this.maxValue=null,this.step=null,this.tabbable=!0,this.$track=null,this.$thumb=null}_init(e){super._init(e),this.value=e.value,this.minValue=e.minValue,this.maxValue=e.maxValue,this.step=e.step}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.registerKeyStrokes([new Fl(this),new yd(this)])}_render(){this.$container=this.$parent.appendDiv("slider").on("blur",this._onBlur.bind(this)).on("focus",this._onFocus.bind(this)),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new bd(this)),this.$track=this.$container.appendDiv("slider-track"),this.$thumb=this.$container.appendDiv("slider-thumb"),this.$window=this.$container.window(),this.$container.on("mousedown touchstart",this._onMouseDown.bind(this)),T.role(this.$container,"slider")}_renderProperties(){super._renderProperties(),this._renderValue(),this._renderMinValue(),this._renderMaxValue(),this._renderStep(),this._renderTabbable()}_remove(){this.$track=null,this.$thumb=null,this.$window.off("mousemove touchmove",this._mouseMoveHandler).off("mouseup touchend touchcancel",this._mouseUpHandler),super._remove()}_onFocus(e){this.setFocused(!0)}_onBlur(e){this.setFocused(!1)}setValue(e){this.setProperty("value",e)}_renderValue(){this._setThumbPosition(this._valueToLocalPosition(this._limitValue(this.value))),this.$container.attr("aria-valuenow",this.value)}setMinValue(e){this.setProperty("minValue",e)}_renderMinValue(){this._update(),this.$container.attr("aria-valuemin",this.minValue)}setMaxValue(e){this.setProperty("maxValue",e)}_renderMaxValue(){this._update(),this.$container.attr("aria-valuemax",this.maxValue)}setStep(e){this.setProperty("step",e)}_renderStep(){this._update()}setTabbable(e){this.setProperty("tabbable",e)}_renderTabbable(){this.$container.setTabbable(this.tabbable&&this.enabledComputed&&!w.get().supportsOnlyTouch())}_renderEnabled(){super._renderEnabled(),this.rendered&&this._renderTabbable()}_onMouseDown(e){if(!this.enabledComputed)return null;Ve.fixTouchEvent(e),this.$window.off("mousemove touchmove",this._mouseMoveHandler).off("mouseup touchend touchcancel",this._mouseUpHandler).on("mousemove touchmove",this._mouseMoveHandler).on("mouseup touchend touchcancel",this._mouseUpHandler),h()("iframe").addClass("dragging-in-progress"),this._moveThumbTo(e.pageX)}_onMouseMove(e){Ve.fixTouchEvent(e),this._moveThumbTo(e.pageX)}_onMouseUp(e){this.$window.off("mousemove touchmove",this._mouseMoveHandler).off("mouseup touchend touchcancel",this._mouseUpHandler),h()("iframe").removeClass("dragging-in-progress")}_moveThumbTo(e){const t=this._normalizeValue(this._localPositionToValue(e-this.$container.offset().left));this._setThumbPosition(this._valueToLocalPosition(t)),this.setValue(t)}_setThumbPosition(e){const t=C.borders(this.$container).left;this.$thumb.cssLeft(e-t),this.$track.cssWidth(e-t)}move(e){this.setValue(this._normalizeValue(this.value+e))}_update(){this.rendered&&this._setThumbPosition(this._valueToLocalPosition(this.value))}_valueToLocalPosition(e){if(this.maxValue===this.minValue)return this.$container.cssWidth()/2;const t=this.$thumb.cssWidth()/2,i=t,s=this.$container.cssWidth()-t;let r=(e-this.minValue)/(this.maxValue-this.minValue)*(this.$container.cssWidth()-this.$thumb.cssWidth())+t;return Math.round(Math.max(i,Math.min(s,r)))}_localPositionToValue(e){const t=this.$thumb.cssWidth()/2,i=t,s=this.$container.cssWidth()-t;return e<=i?this.minValue:e>=s?this.maxValue:(e-t)/(this.$container.cssWidth()-this.$thumb.cssWidth())*(this.maxValue-this.minValue)+this.minValue}_normalizeValue(e){return this._limitValue(this._calculateSteppedValue(e))}_limitValue(e){return Math.min(Math.max(e,this.minValue),this.maxValue)}_calculateSteppedValue(e){if(!this.step)return e;const i=Math.round((e-this.minValue)/this.step)*this.step+this.minValue;return Math.round(i*yn.FLOATING_POINT_ERROR_CORRECTION)/yn.FLOATING_POINT_ERROR_CORRECTION}}class Nf extends K{constructor(){super(),this._addRemoteProperties(["value"])}}class bd extends ne{slider;constructor(e){super(),this.slider=e}layout(e){this.slider._update()}}class Fl extends B{constructor(e){super(),this.field=e,this.which=[m.LEFT,m.RIGHT,m.PAGE_DOWN,m.PAGE_UP,m.HOME,m.END],this.stopPropagation=!0,this.stopImmediatePropagation=!0,this.renderingHints.render=!1,this.repeatable=!0}handle(e){switch(e.which){case m.LEFT:this.field.move(-Math.abs(this.field.step));break;case m.RIGHT:this.field.move(Math.abs(this.field.step));break;case m.PAGE_DOWN:this.field.move(-this._calculatePageMoveUnits(this.field));break;case m.PAGE_UP:this.field.move(this._calculatePageMoveUnits(this.field));break;case m.HOME:this.field.move(this.field.minValue-this.field.maxValue);break;case m.END:this.field.move(this.field.maxValue-this.field.minValue);break}}_calculatePageMoveUnits(e){return(e.maxValue-e.minValue)/10}}class yd extends Fl{constructor(e){super(e),this.which=[m.LEFT,m.RIGHT],this.shift=!0}handle(e){switch(e.which){case m.LEFT:this.field.move(-this._calculatePageMoveUnits(this.field));break;case m.RIGHT:this.field.move(this._calculatePageMoveUnits(this.field));break}}}class Vf extends ce{ref;constructor(){super(),this.selected=!1,this.ref=null}_init(e){e.owner=e.parent,super._init(e)}_render(){super._render(),this.$container.addClass("button mode").data("mode",this)}_renderProperties(){super._renderProperties(),this._renderSelected()}_renderSelected(){this.$container.select(this.selected),T.checked(this.$container,this.selected)}_renderTabbable(){this.$container.setTabbable(this.tabbable&&!w.get().supportsOnlyTouch())}doAction(){return this.prepareDoAction()?(this.selected||(this.setSelected(!0),this.focus()),!0):!1}toggle(){this.selected||this.setSelected(!0)}_renderIconId(){super._renderIconId(),this._updateLabelAndIconStyle(),this.invalidateLayoutTree()}_renderText(){super._renderText(),this._updateLabelAndIconStyle(),this.invalidateLayoutTree()}_updateLabelAndIconStyle(){let e=!!this.text;this.get$Icon().toggleClass("with-label",e)}_renderActionStyle(){T.role(this.$container,"radio")}}class Wf extends er{}class wd extends I{modes;selectedMode;$slider;_isModeChanging;_modePropertyChangeHandler;constructor(){super(),this._addWidgetProperties(["modes","selectedMode"]),this._addPreserveOnPropertyChangeProperties(["selectedMode"]),this.modes=[],this.selectedMode=null,this.$slider=null,this._isModeChanging=!1,this._modePropertyChangeHandler=this._onModePropertyChange.bind(this)}_init(e){super._init(e),this._setModes(this.modes),this._setSelectedMode(this.selectedMode)}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new Td(this),new vd(this)])}_render(){this.$container=this.$parent.appendDiv("mode-selector"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Cd(this))}_renderProperties(){super._renderProperties(),this._renderSlider(),this._renderModes()}recomputeEnabled(e){super.recomputeEnabled(e),this._provideTabIndex()}_provideTabIndex(){let e;this.modes.forEach(t=>{t.enabledComputed&&!e?(t.setTabbable(!0),e=t):e&&this.enabledComputed&&t.enabledComputed&&t.selected?(e.setTabbable(!1),t.setTabbable(!0),e=t):t.setTabbable(!1)},this)}getTabbableMode(){return p.find(this.modes,e=>e.visible&&e.tabbable)}getFocusableElement(){return this.session.focusManager.findFirstFocusableElement(this.$container)}setModes(e){this.setProperty("modes",e)}_setModes(e){this.modes.forEach(t=>t.off("propertyChange",this._modePropertyChangeHandler)),this._setProperty("modes",p.ensure(e)),this.modes.forEach(t=>{t.on("propertyChange",this._modePropertyChangeHandler),t.selected&&this.setSelectedMode(t)})}_renderSlider(){this.$slider=this.$container.appendDiv("mode-slider"),T.role(this.$slider,"radiogroup")}_renderModes(){this.modes.forEach(e=>{e.render(),this._registerDragHandlers(e.$container)}),this._updateMarkers()}setSelectedMode(e){this.setProperty("selectedMode",e)}_setSelectedMode(e){if(this._isModeChanging=!0,this.selectedMode&&this.selectedMode!==e&&this.selectedMode.setSelected(!1),e){e.selected||e.setSelected(!0);let t=this.getTabbableMode(),i=!1;t&&(i=t.isFocused()),e.setTabbable(!0),i&&e.focus(),t&&t!==e&&t.setTabbable(!1)}this._setProperty("selectedMode",e),this._isModeChanging=!1,this._updateMarkers()}_onModePropertyChange(e){e.propertyName==="selected"&&!this._isModeChanging?this.setSelectedMode(e.newValue?e.source:null):e.propertyName==="visible"?this._updateMarkers():e.propertyName==="enabled"&&this._updateSlider()}_updateMarkers(){let e=[],t=-1;this.modes.forEach(i=>{i.rendered&&(i.$container.removeClass("first last after-selected"),i.visible&&(e.push(i),i.selected&&(t=e.length-1)))}),e.length&&(e[0].$container.addClass("first"),e[e.length-1].$container.addClass("last"),t>=0&&t<e.length-1&&e[t+1].$container.addClass("after-selected")),this._updateSlider()}_updateSlider(){if(!this.$slider)return;let e=0,t=0;this.selectedMode&&this.selectedMode.$container&&(e=C.position(this.selectedMode.$container).x,t=C.size(this.selectedMode.$container,{exact:!0}).width),this.$slider.cssLeft(e),this.$slider.cssWidth(t),this.$slider.setVisible(this.selectedMode&&this.selectedMode.$container&&this.selectedMode.enabled)}_registerDragHandlers(e){let t="mode-selector-dragging",i=o=>this.enabledComputed&&this.selectedMode&&this.selectedMode.$container===e&&this.modes.filter(l=>l.isVisible()&&l.enabled).length>1,s=o=>{let l=this.$container.width()-e.outerWidth(),d=Math.max(Math.min(o.newLeft,l),0);return this.$container.children().addClass(t),d!==o.originalLeft&&this.$slider.cssLeft(d),d},r=o=>{this.$container.children().removeClass(t);let l=this._computeNewSelectedMode(o);!l||l===this.selectedMode||!l.enabled?this._updateSlider():this.setSelectedMode(l)};Ve.onSwipe(e,t,i,s,r)}_computeNewSelectedMode(e){return e.direction===0||Math.abs(e.deltaX)<=5?this.selectedMode:e.direction<0?this._findModeByPos(e.newLeft):this._findModeByPos(e.newLeft+this.$slider.width())}_findModeByPos(e){let t=this.modes.filter(i=>i.visible);for(let i=t.length-1;i>=0;i--){let s=t[i],r=Math.floor(C.position(s.$container).x);if(e>=r){let o=C.size(s.$container).width,l=r+o;if(e<=l)return s}}return null}findModeById(e){return p.find(this.modes,t=>t.id===e)}findModeByRef(e){return p.find(this.modes,t=>t.ref===e)}selectModeById(e){this.setSelectedMode(this.findModeById(e))}selectModeByRef(e){this.setSelectedMode(this.findModeByRef(e))}}class Cd extends ne{modeSelector;constructor(e){super(),this.modeSelector=e}layout(e){super.layout(e),this.modeSelector.$slider&&this.modeSelector.$slider.setVisible(!1),this.modeSelector._updateSlider()}preferredLayoutSize(e,t){let i=super.preferredLayoutSize(e,t),s=this.modeSelector.$container.attr("style");this.modeSelector.$container.css({width:"auto",height:"auto"});let r=0;return this.modeSelector.modes.filter(o=>o.rendered).forEach(o=>{let l=o.$container.attr("style");o.$container.css("flex","none");let a=o.htmlComp.prefSize({includeMargin:!0}).width;a>r&&(r=a),o.$container.attrOrRemove("style",l)}),this.modeSelector.$container.attrOrRemove("style",s),i.width=r*this.modeSelector.modes.length+this.modeSelector.htmlComp.insets().horizontal(),i}}class Td extends B{constructor(e){super(),this.field=e,this.which=[m.LEFT,m.UP],this.renderingHints.render=!1}handle(e){let t,i=h()(e.target).data("mode");this.field.modes.some(s=>t&&s===i?(t.setSelected(!0),t.focus(),t.$container.addClass("keyboard-navigation"),!0):(s.enabledComputed&&s.visible&&(t=s),!1))}}class vd extends B{constructor(e){super(),this.field=e,this.which=[m.RIGHT,m.DOWN],this.renderingHints.render=!1}handle(e){let t,i=h()(e.target).data("mode");this.field.modes.some(s=>t&&s.enabledComputed&&s.visible?(s.setSelected(!0),s.focus(),s.$container.addClass("keyboard-navigation"),!0):(s===i&&(t=s),!1),this)}}class j extends I{animateOpening;askIfNeedSave;validationFailedText;emptyMandatoryElementsText;invalidElementsErrorText;invalidElementsWarningText;askIfNeedSaveText;data;exclusiveKey;displayViewId;displayHint;maximized;headerVisible;displayParent;dialogs;views;messageBoxes;fileChoosers;focusedElement;closable;cacheBounds;cacheBoundsKey;resizable;movable;rootGroupBox;saveNeeded;saveNeededVisible;formController;messageBoxController;fileChooserController;closeKeyStroke;showOnOpen;initialFocus;renderInitialFocusEnabled;formLoading;formLoaded;formSaved;popupWindow;title;subTitle;iconId;status;uiCssClass;lifecycle;detailForm;blockRendering;validators;_defaultValidator;$statusIcons;$header;$statusContainer;$close;$saveNeeded;$icon;$title;$subTitle;$dragHandle;_modal;_glassPaneRenderer;_preMaximizedBounds;_resizeHandler;_windowResizeHandler;_mainBoxSaveNeededChangeHandler;constructor(){super(),this._addWidgetProperties(["rootGroupBox","views","dialogs","initialFocus","messageBoxes","fileChoosers"]),this._addPreserveOnPropertyChangeProperties(["initialFocus"]),this._addComputedProperties(["modal"]),this.animateOpening=!0,this.askIfNeedSave=!0,this.validationFailedText="${textKey:FormValidationFailedTitle}",this.emptyMandatoryElementsText=null,this.invalidElementsErrorText=null,this.invalidElementsWarningText=null,this.askIfNeedSaveText=null,this.data={},this.exclusiveKey=null,this.displayViewId=null,this.displayHint=j.DisplayHint.DIALOG,this.displayParent=null,this.maximized=!1,this.headerVisible=null,this._modal=null,this.logicalGrid=u.create(Sd),this.dialogs=[],this.views=[],this.messageBoxes=[],this.fileChoosers=[],this.focusedElement=null,this.closable=!0,this.cacheBounds=!1,this.cacheBoundsKey=null,this.resizable=!0,this.movable=!0,this.rootGroupBox=null,this.saveNeeded=!1,this.formSaved=!1,this.saveNeededVisible=!0,this.formController=null,this.messageBoxController=null,this.fileChooserController=null,this.closeKeyStroke=null,this.showOnOpen=!0,this.initialFocus=null,this.renderInitialFocusEnabled=!0,this.popupWindow=null,this.title=null,this.subTitle=null,this.iconId=null,this.formLoading=!1,this.formLoaded=!1,this.validators=[],this._defaultValidator=this._validate.bind(this),this.$statusIcons=[],this.$header=null,this.$statusContainer=null,this.$close=null,this.$saveNeeded=null,this.$icon=null,this.$title=null,this.$subTitle=null,this.$dragHandle=null,this._glassPaneRenderer=null,this._preMaximizedBounds=null,this._resizeHandler=this._onResize.bind(this),this._windowResizeHandler=this._onWindowResize.bind(this),this._mainBoxSaveNeededChangeHandler=()=>this.updateSaveNeeded()}static DisplayHint={DIALOG:"dialog",POPUP_WINDOW:"popupWindow",VIEW:"view"};static _NOTIFICATION_BADGE_STATUS_CODE=197821;_init(e){super._init(e),this.resolveTextKeys(["title","validationFailedText","emptyMandatoryElementsText","invalidElementsErrorText","invalidElementsWarningText","askIfNeedSaveText"]),this.resolveIconIds(["iconId"]),this._setDisplayParent(this.displayParent),this._setViews(this.views),this.formController=u.create(Ao,{displayParent:this,session:this.session}),this.messageBoxController=u.create($o,{displayParent:this,session:this.session}),this.fileChooserController=u.create(So,{displayParent:this,session:this.session}),this._setRootGroupBox(this.rootGroupBox),this._setStatus(this.status),this.cacheBoundsKey=u.nvl(e.cacheBoundsKey,this.objectType),this._installLifecycle(),this._setClosable(this.closable),this._setExclusiveKey(this.exclusiveKey),this._setValidators(this.validators)}_createKeyStrokeContext(){return new Ee}_render(){this.$container=this.$parent.appendDiv("form").data("model",this),this.parent instanceof Hr||T.role(this.$container,this.isDialog()||this.isPopupWindow()?"dialog":"form"),this.uiCssClass&&this.$container.addClass(this.uiCssClass),this.htmlComp=x.install(this.$container,this.session);let e;this.isDialog()?(this.$container.addClass("dialog"),e=new Qi(this),this.htmlComp.validateRoot=!0,this.$container[0].addEventListener("mousedown",this._onDialogMouseDown.bind(this),!0)):(this.isPopupWindow()&&this.$container.addClass("popup-window"),e=new xo(this)),this.htmlComp.setLayout(e),this._renderRootGroupBox()}_renderProperties(){super._renderProperties(),this._renderMaximized(),this._renderMovable(),this._renderResizable(),this._renderHeaderVisible(),this._renderCssClass(),this._renderModal(),this._installFocusContext(),this.renderInitialFocusEnabled&&this.renderInitialFocus()}_postRender(){super._postRender(),this.formController.render(),this.messageBoxController.render(),this.fileChooserController.render(),this._glassPaneRenderer&&this._glassPaneRenderer.renderGlassPanes()}_destroy(){super._destroy(),this._glassPaneRenderer&&(this._glassPaneRenderer=null)}_remove(){this.formController.remove(),this.messageBoxController.remove(),this.fileChooserController.remove(),this._glassPaneRenderer&&(this._glassPaneRenderer.removeGlassPanes(),this._glassPaneRenderer=null),this._uninstallFocusContext(),this._removeHeader(),this.$dragHandle=null,super._remove()}setModal(e){this.setProperty("modal",e)}get modal(){return this._modal===null?this.isDialog():this._modal}_renderModal(){if(this.parent instanceof Hr)return;let e=this.modal;T.modal(this.$container,e||null),e&&!this._glassPaneRenderer?(this._glassPaneRenderer=new Fr(this),this._glassPaneRenderer.renderGlassPanes()):!e&&this._glassPaneRenderer&&(this._glassPaneRenderer.removeGlassPanes(),this._glassPaneRenderer=null)}_installLifecycle(){this.lifecycle=this._createLifecycle(),this.lifecycle.handle("load",this._onLifecycleLoad.bind(this)),this.lifecycle.handle("save",this._onLifecycleSave.bind(this)),this.lifecycle.on("postLoad",this._onLifecyclePostLoad.bind(this)),this.lifecycle.on("reset",this._onLifecycleReset.bind(this)),this.lifecycle.on("close",this._onLifecycleClose.bind(this))}_createLifecycle(){return u.create(Pd,{widget:this,askIfNeedSave:this.askIfNeedSave,emptyMandatoryElementsText:this.emptyMandatoryElementsText,invalidElementsErrorText:this.invalidElementsErrorText,invalidElementsWarningText:this.invalidElementsWarningText,askIfNeedSaveText:this.askIfNeedSaveText})}setExclusiveKey(e){this.setProperty("exclusiveKey",e)}_setExclusiveKey(e){let t=e;e?typeof e!="function"&&(t=()=>e):t=()=>null,this._setProperty("exclusiveKey",t)}open(){return this.load(!1).then(()=>{this.destroyed||(this.isShown()?this.activate():this.showOnOpen&&this.show())})}load(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(this.formLoading)return this.whenLoad().then(()=>{});if(!e&&this.formLoaded)return h().resolvedPromise();try{return this.withBusyHandling(()=>this.lifecycle.load()).catch(t=>this._handleLoadErrorInternal(t))}catch(t){return this._handleLoadErrorInternal(t)}}withBusyHandling(e){this.setBusy(!0);try{return e().always(()=>this.setBusy(!1))}catch(t){throw this.setBusy(!1),t}}_withBusyHandling(e){return this.withBusyHandling(e)}whenLoad(){return this.when("load")}_onLifecycleLoad(){try{return this._setFormLoading(!0),this._load().then(e=>{this.destroyed||(this.setData(e),this.importData(),this._setFormLoading(!1),this.formLoaded=!0,this.trigger("load"))}).always(()=>this._setFormLoading(!1))}catch(e){throw this._setFormLoading(!1),e}}_setFormLoading(e){this._setProperty("formLoading",e)}_handleLoadErrorInternal(e){return this._handleErrorInternal(e,"load",t=>this._handleLoadError(t))}_handleLoadError(e){return this.close(),this._handleError(e)}_load(){return h().resolvedPromise().then(()=>this.data)}whenPostLoad(){return this.when("postLoad")}_onLifecyclePostLoad(){try{return this._postLoad().then(()=>this.trigger("postLoad")).catch(e=>this._handlePostLoadErrorInternal(e))}catch(e){return this._handlePostLoadErrorInternal(e)}}_handlePostLoadErrorInternal(e){return this._handleErrorInternal(e,"postLoad",t=>this._handlePostLoadError(t))}_handlePostLoadError(e){return this._handleError(e)}_postLoad(){return h().resolvedPromise()}setData(e){this.setProperty("data",e)}importData(){}exportData(){return null}ok(){return this.lifecycle.ok()}save(){return this.lifecycle.save()}whenSave(){return this.when("save")}_onLifecycleSave(){try{return this.withBusyHandling(()=>{let e=this.exportData();return this._save(e).then(()=>{this.formSaved=!0,this.setData(e),this.trigger("save")})}).catch(e=>this._handleSaveErrorInternal(e))}catch(e){return this._handleSaveErrorInternal(e)}}_handleSaveErrorInternal(e){return this._handleErrorInternal(e,"save",t=>this._handleSaveError(t))}_handleSaveError(e){return this._handleError(e)}_handleErrorInternal(e,t,i){const s=this.trigger("error",{phase:t,error:e});let r;return s.defaultPrevented?r=h().resolvedPromise():r=i(e).catch(o=>{h().log.error('Error in error handler while trying to handle error "'+e+'".',o)}),r.then(()=>{throw e})}_handleError(e){return G.get().errorHandler.handle(e).then(i=>{})}validate(){return this.lifecycle.validate()}_validate(){return E.ok()}_lifecycleValidate(){const e=r=>{const o=E.ok();return r.forEach(l=>o.addStatus(l)),o},t=[],i=[];for(const r of this.validators.map(o=>o(this))){if(b.isPromise(r)){i.push(r);continue}t.push(r)}const s=e(t);return i.length?h().promiseAll([h().resolvedPromise(s),...i]).then(function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return e(o)}):s}addValidator(e){let t=this.validators.slice();t.push(e),this.setValidators(t)}removeValidator(e){let t=this.validators.slice();p.remove(t,e),this.setValidators(t)}setValidators(e){this.setProperty("validators",e)}_setValidators(e){e=p.ensure(e).slice(),p.pushSet(e,this._defaultValidator),this._setProperty("validators",e)}_handleInvalid(e){const t=this.trigger("invalid",{status:e});return t.defaultPrevented?h().resolvedPromise(t.status):this._showFormInvalidMessageBox(t.status)}_showFormInvalidMessageBox(e){return!e||e.isValid()?h().resolvedPromise(e):this._createStatusMessageBox(e).buildAndOpen().then(t=>!e.isError()&&t===jt.Buttons.YES?h().resolvedPromise(E.ok(e.message)):h().resolvedPromise(e))}_createStatusMessageBox(e){let t=Ri.createOk(this).withSeverity(e.severity).withHeader(this.validationFailedText).withBody(e.message,!0);return e.isError()||(t=t.withYes(this.session.text("ProceedAnyway")).withNo(this.session.text("Cancel"))),t}_save(e){return h().resolvedPromise()}reset(){return this.lifecycle.reset()}whenReset(){return this.when("reset")}_onLifecycleReset(){this.trigger("reset")}cancel(){return this.lifecycle.cancel()}close(){return this.lifecycle.close()}whenClose(){return this.when("close")}_onLifecycleClose(){this.trigger("close").defaultPrevented||this._close()}_close(){this.hide(),this.destroy()}abort(){let e=new qe;this.trigger("abort",e),e.defaultPrevented||this._abort()}whenAbort(){return this.when("abort")}_abort(){let e=this.rootGroupBox?.controls||[];e=e.concat(this.rootGroupBox?.menus||[]),e.filter(i=>{let s=i.enabled;return i.enabledComputed!==void 0&&(s=i.enabledComputed),i.visible&&s&&i.systemType}).some(i=>i.systemType===Oe.SystemType.CLOSE)?this.close():this.cancel(),this._afterAbort()}_afterAbort(){!this.destroyed&&this.isShown()&&this.activate()}revealInvalidField(e){e&&this._revealInvalidField(e)}_revealInvalidField(e){let t=this._createRevealInvalidFieldEvent(e);this.trigger("revealInvalidField",t),!t.defaultPrevented&&e.reveal()}_createRevealInvalidFieldEvent(e){return new qe({validationResult:e})}_createCloseKeyStroke(){return new gl(this,()=>this.$close)}_setClosable(e){this._setProperty("closable",e),this.closable?(this.closeKeyStroke=this._createCloseKeyStroke(),this.keyStrokeContext.registerKeyStroke(this.closeKeyStroke)):this.keyStrokeContext.unregisterKeyStroke(this.closeKeyStroke)}setClosable(e){this.setProperty("closable",e)}_renderClosable(){if(this.$header)if(this.$container.toggleClass("closable"),this.closable){if(this.$close)return;this.$close=this.$statusContainer.appendDiv("status closer").on("click",this._onCloseIconClick.bind(this)),T.role(this.$close,"button"),T.label(this.$close,this.session.text("ui.Close"))}else{if(!this.$close)return;this.$close.remove(),this.$close=null}}_onCloseIconClick(){this.abort()}setResizable(e){this.setProperty("resizable",e)}_renderResizable(){this.resizable&&this.isDialog()&&!this.maximized?this.$container.resizable().on("resizeStep",this._resizeHandler):this.$container.unresizable().off("resizeStep",this._resizeHandler)}_onResize(e){let t=this.htmlComp.layout,i=t.autoSize;return t.autoSize=!1,this.htmlComp.revalidateLayoutTree(!1),t.autoSize=i,this.updateCacheBounds(),!1}setMovable(e){this.setProperty("movable",e)}_renderMovable(){if(this.movable&&this.isDialog()&&!this.maximized){if(this.$dragHandle)return;this.$dragHandle=this.$container.prependDiv("drag-handle"),this.$container.draggable(this.$dragHandle,h().throttle(this._onMove.bind(this),1e3/60))}else{if(!this.$dragHandle)return;this.$container.undraggable(this.$dragHandle),this.$dragHandle.remove(),this.$dragHandle=null}}_onDialogMouseDown(){this.activate()}activate(){this.session.desktop.activateForm(this)}show(){this.session.desktop.showForm(this)}hide(){this.session.desktop.hideForm(this)}isShown(){return this.session.desktop.isFormShown(this)}_renderHeader(){this.$header=this.$container.prependDiv("header"),this.$statusContainer=this.$header.appendDiv("status-container"),this.$icon=this.$header.appendDiv("icon-container"),this.$title=this.$header.appendDiv("title"),Y.installForEllipsis(this.$title,{parent:this}),this.$subTitle=this.$header.appendDiv("sub-title"),Y.installForEllipsis(this.$subTitle,{parent:this}),T.linkElementWithLabel(this.$container,this.$title),T.linkElementWithLabel(this.$container,this.$subTitle,wi.BACK),this._renderTitle(),this._renderSubTitle(),this._renderIconId(),this._renderStatus(),this._renderClosable(),this._renderSaveNeeded()}_removeHeader(){this.$title&&Y.uninstall(this.$title),this.$subTitle&&Y.uninstall(this.$subTitle),this.$header&&(this.$header.remove(),this.$header=null),this.$title=null,this.$subTitle=null,this.$statusContainer=null,this.$icon=null,this.$close=null,this.$saveNeeded=null}setRootGroupBox(e){this.setProperty("rootGroupBox",e)}_setRootGroupBox(e){this.initialized&&this.rootGroupBox&&(this.rootGroupBox.setMainBox(!1),this.rootGroupBox.off("propertyChange:saveNeeded",this._mainBoxSaveNeededChangeHandler)),this._setProperty("rootGroupBox",e),this.rootGroupBox&&(this.rootGroupBox.setMainBox(!0),this.rootGroupBox.on("propertyChange:saveNeeded",this._mainBoxSaveNeededChangeHandler)),this.updateSaveNeeded()}_renderRootGroupBox(){this.rootGroupBox?.render(),this.invalidateLayoutTree()}updateSaveNeeded(){!this.initialized||this.destroying||this.setSaveNeeded(this.rootGroupBox?.saveNeeded||this._computeSaveNeeded())}_computeSaveNeeded(){return!1}markAsSaved(){this.rootGroupBox?.markAsSaved(),this.updateSaveNeeded()}setSaveNeeded(e){this.setProperty("saveNeeded",e)}_renderSaveNeeded(){if(this.$header){if(this.saveNeeded&&this.saveNeededVisible){if(this.$container.addClass("save-needed"),this.$saveNeeded)return;this.$close?this.$saveNeeded=this.$close.beforeDiv("status save-needer"):this.$saveNeeded=this.$statusContainer.appendDiv("status save-needer")}else{if(this.$container.removeClass("save-needed"),!this.$saveNeeded)return;this.$saveNeeded.remove(),this.$saveNeeded=null}this.invalidateLayoutTree()}}setAskIfNeedSave(e){this.setProperty("askIfNeedSave",e),this.lifecycle&&this.lifecycle.setAskIfNeedSave(e)}setDisplayViewId(e){this.setProperty("displayViewId",e)}setDisplayHint(e){this.setProperty("displayHint",e)}setSaveNeededVisible(e){this.setProperty("saveNeededVisible",e)}_renderSaveNeededVisible(){this._renderSaveNeeded()}_renderCssClass(e,t){e=e||this.cssClass,this.$container.removeClass(t),this.$container.addClass(e),this.invalidateLayoutTree()}setStatus(e){this.setProperty("status",e)}_setStatus(e){e=E.ensure(e),this._setProperty("status",e)}_renderStatus(){if(this.$header){if(this.$statusIcons.forEach(e=>{e.remove()}),this.$statusIcons=[],this.status){let e=this.status.asFlatList(),t;e.forEach(i=>{t=this._renderSingleStatus(i,t),t&&this.$statusIcons.push(t)})}this.invalidateLayoutTree()}}_renderSingleStatus(e,t){if(e&&e.iconId){let i=this.$statusContainer.appendIcon(e.iconId,"status");return e.cssClass()&&i.addClass(e.cssClass()),i.prependTo(this.$statusContainer),i}return t}addStatus(e){if(!e)return;const t=this.status&&this.status.children,i=new E({children:t});i.addStatus(e),this.setStatus(i)}removeStatus(e){if(!(!this.status||!e)){if(this.status.equals(e)){this.setStatus(null);return}if(this.status.containsStatusByPredicate(t=>e.equals(t))){const t=this.status.clone();t.removeAllStatusByPredicate(i=>e.equals(i)),this.setStatus(t)}}}getNotificationBadgeText(){const e=this._getNotificationBadgeStatus();if(e)return e.message}setNotificationBadgeText(e){this.removeStatus(this._getNotificationBadgeStatus()),e&&this.addStatus(new ns({message:e,code:j._NOTIFICATION_BADGE_STATUS_CODE}))}_getNotificationBadgeStatus(){if(this.status)return this.status.asFlatList().find(e=>j._NOTIFICATION_BADGE_STATUS_CODE===e.code)}setShowOnOpen(e){this.setProperty("showOnOpen",e)}_updateTitleForDom(){let e=this.title;if(!e&&this.closable&&(e=_.plainText(" ")),e||this.subTitle){let s=t(this.$container,"title-box");e?t(s,"title").text(e).icon(this.iconId):i(s,"title"),_.hasText(e)?t(s,"sub-title").text(this.subTitle):i(s,"sub-title")}else i(this.$container,"title-box");function t(s,r){let o=s.children("."+r);return o.length===0&&(o=this.$parent.appendDiv(r)),o}function i(s,r){s.children("."+r).remove()}}isDialog(){return this.displayHint===j.DisplayHint.DIALOG}isPopupWindow(){return this.displayHint===j.DisplayHint.POPUP_WINDOW}isView(){return this.displayHint===j.DisplayHint.VIEW}_onMove(e){this.trigger("move",e),this.updateCacheBounds()}moveTo(e){this.$container.cssPosition(e),this.trigger("move",{left:e.x,top:e.y}),this.updateCacheBounds()}position(){let e,t=this.prefBounds();if(t){e=t.point();let i=this.$container.windowSize(),s=this.htmlComp.margins(),r=0,o=0,l=i.width-t.width-s.horizontal(),a=i.height-t.height-s.vertical();e.x=Math.max(r,Math.min(l,e.x)),e.y=Math.max(o,Math.min(a,e.y))}else e=Qi.positionContainerInWindow(this.$container);this.moveTo(e)}updateCacheBounds(){this.cacheBounds&&!this.maximized&&this.storeCacheBounds(this.htmlComp.bounds())}appendTo(e){this.$container.appendTo(e)}setHeaderVisible(e){this.setProperty("headerVisible",e)}_renderHeaderVisible(){let e=this.headerVisible===null?this.isDialog():this.headerVisible;e&&!this.$header?this._renderHeader():!e&&this.$header&&this._removeHeader();let t=this.$header&&this.$header.hasClass("no-title");this.$container.toggleClass("header-visible",e&&!t);let i=_.join(" ",this.title,this.subTitle);T.label(this.$container,!e&&!t?i:null),this.invalidateLayoutTree()}setTitle(e){this.setProperty("title",e)}_renderTitle(){this.$header&&(this.$title.text(this.title),this.$header.toggleClass("no-title",!this.title&&!this.subTitle)),this.invalidateLayoutTree()}setSubTitle(e){this.setProperty("subTitle",e)}_renderSubTitle(){this.$header&&(this.$subTitle.text(this.subTitle),this.$header.toggleClass("no-title",!this.title&&!this.subTitle)),this.invalidateLayoutTree()}setIconId(e){this.setProperty("iconId",e)}_renderIconId(){this.$header&&(this.$icon.icon(this.iconId),this.invalidateLayoutTree())}_setViews(e){e&&e.forEach(t=>{t.setDisplayParent(this)}),this._setProperty("views",e)}setDisabledStyle(e){this.rootGroupBox?.setDisabledStyle(e)}setDisplayParent(e){this.setProperty("displayParent",e)}_setDisplayParent(e){e instanceof j&&e.parent instanceof Hr&&e.isView()&&(e=j.findNonWrappedForm(e)),this._setProperty("displayParent",e),e&&this.setParent(this.findDesktop().computeParentForDisplayParent(e))}setMaximized(e){this.setProperty("maximized",e)}_renderMaximized(){this.isDialog()&&(this.maximized&&this.htmlComp.layouted&&(this._preMaximizedBounds=this.htmlComp.bounds()),this._maximize(),this.maximized||(this._preMaximizedBounds=null),this.maximized?this.$container.window().on("resize",this._windowResizeHandler):this.$container.window().off("resize",this._windowResizeHandler),this.rendered&&(this._renderMovable(),this._renderResizable()))}_onWindowResize(){this.maximized&&this._maximize()}_maximize(){if(!this.rendered)return;let e=this.htmlComp.layout,t=e.shrinkEnabled;e.shrinkEnabled=!0,this.revalidateLayoutTree(),this.position(),e.shrinkEnabled=t}prefBounds(){return this.maximized?null:this._preMaximizedBounds?this._preMaximizedBounds:this.cacheBounds?this.readCacheBounds():null}_attach(){this.$parent.append(this.$container),this.isView()&&this.invalidateLayoutTree(!1),(this.isView()||this.isDialog())&&!this.detailForm&&this.session.desktop._setFormActivated(this),super._attach()}_postAttach(){this.formController.attachDialogs(),this.messageBoxController.attach(),this.fileChooserController.attach(),super._attach()}_detach(){this.formController.detachDialogs(),this.messageBoxController.detach(),this.fileChooserController.detach(),this.$container.detach(),super._detach()}renderInitialFocus(){let e=!1;if(this.initialFocus)e=this.initialFocus.focus();else if(!this.$container.isOrHas(this.$container.activeElement())){let t=this.session.focusManager;e=t.requestFocusIfReady(t.findFirstFocusableElement(this.$container))}if(e){let t=this.$container.activeElement().scrollParent();t.scrollTop(0),t.scrollLeft(0)}}_initialFocusElement(){let e;return this.initialFocus&&(e=this.initialFocus.getFocusableElement()),e||(e=this.session.focusManager.findFirstFocusableElement(this.$container)),e}_installFocusContext(){(this.isDialog()||this.isPopupWindow())&&this.session.focusManager.installFocusContext(this.$container,Et.NONE)}_uninstallFocusContext(){(this.isDialog()||this.isPopupWindow())&&this.session.focusManager.uninstallFocusContext(this.$container)}touch(){this.rootGroupBox?.touch()}inFront(){return this.rendered&&this.attached}visitFields(e){this.rootGroupBox?.visitFields(e)}visitDisplayChildren(e,t){t||(t=s=>!0);let i=s=>{e(s),s instanceof j&&s.visitDisplayChildren(e,t)};this.dialogs.filter(t).forEach(i,this),this.messageBoxes.filter(t).forEach(i,this),this.fileChoosers.filter(t).forEach(i,this)}storeCacheBounds(e){this.cacheBounds&&he.setItemToLocalStorage(this._getCacheBoundsStorageKey(),JSON.stringify(e))}readCacheBounds(){if(!this.cacheBounds)return null;let e=he.getItemFromLocalStorage(this._getCacheBoundsStorageKey());if(!e)return null;let t=JSON.parse(e);return new te(t.x,t.y,t.width,t.height)}_getCacheBoundsStorageKey(){return"scout:formBounds:"+this.cacheBoundsKey}setBusy(e){this.session.desktop.setBusy(e)}static findForm(e){let t=e.parent;for(;t&&!(t instanceof j);)t=t.parent;return t}static findNonWrappedForm(e){if(!e)return null;let t=null;return e.findParent(i=>{if(i instanceof j)return t=i,!(t.parent instanceof Hr)}),t}}class Ar extends K{_initModel(e,t){let i=super._initModel(e,t);return i.logicalGrid=null,i}_onWidgetEvent(e){e.type==="abort"?this._onWidgetAbort(e):e.type==="close"?this._onWidgetClose(e):super._onWidgetEvent(e)}_onWidgetAbort(e){e.preventDefault(),this._send("formClosing"),this.session.onRequestsDone(()=>{this.widget&&this.widget._afterAbort()})}_onWidgetClose(e){e.preventDefault(),this._send("close")}onModelAction(e){e.type==="requestFocus"?this._onRequestFocus(e):e.type==="requestInput"?this._onRequestInput(e):super.onModelAction(e)}_onRequestFocus(e){this.session.getOrCreateWidget(e.formField,this.widget).focus()}_onRequestInput(e){this.session.getOrCreateWidget(e.formField,this.widget).requestInput()}static modifyFormPrototype(){G.get().remote&&b.replacePrototypeFunction(j,j.prototype.updateSaveNeeded,Ar.updateSaveNeeded,!0)}static updateSaveNeeded(){if(!this.modelAdapter)return this.updateSaveNeededOrig()}}G.addListener("bootstrap",Ar.modifyFormPrototype);class Sd extends dl{_validate(e){e.rootGroupBox&&e.rootGroupBox._setGridData(ke.createFromHints(e.rootGroupBox))}}class xo extends ne{form;constructor(e){super(),this.form=e}layout(e){this.form.validateLogicalGrid();let t=this._htmlRootGroupBox();if(!t)return;let i=x.get(e),s=i.availableSize().subtract(i.insets()).subtract(t.margins());s.height-=this._headerHeight(),h().log.isTraceEnabled()&&h().log.trace("(FormLayout#layout) rootGbSize="+s),t.setSize(s)}preferredLayoutSize(e,t){t=t||{},this.form.validateLogicalGrid();let i=this._headerHeight();t.heightHint&&(t.heightHint-=i);let s=x.get(e),r,o=this._htmlRootGroupBox();return o?r=o.prefSize(t).add(s.insets()).add(o.margins()):r=new F().add(s.insets()),r.height+=i,r}_htmlRootGroupBox(){let e=this.form.$container.children(".root-group-box");return x.optGet(e)}_headerHeight(){let e=this.form.$header;return e&&e.css("position")!=="absolute"?C.prefSize(e,!0).height:0}}class xd extends Rr{constructor(e){super(e)}handle(e){this.field.toggle()}_postRenderKeyBox(e,t){if(this.field.iconId){let i=e.find(".icon").width(),s=e.find(".key-box").outerWidth(),r=e.cssPaddingLeft(),o=i/2-s/2+r;e.find(".key-box").cssLeft(o)}}}class Ji extends J{form;popupStyle;popupClosable;popupMovable;popupResizable;_formDestroyHandler;constructor(){super(),this.form=null,this.toggleAction=!0,this.popupStyle=null,this.popupClosable=!1,this.popupMovable=!1,this.popupResizable=!1,this._addWidgetProperties("form"),this._formDestroyHandler=this._onFormDestroy.bind(this)}static PopupStyle={DEFAULT:"default",MOBILE:"mobile"};_init(e){super._init(e),this.popupStyle||(this.session.userAgent.deviceType===w.Type.MOBILE?this.popupStyle=Ji.PopupStyle.MOBILE:this.popupStyle=Ji.PopupStyle.DEFAULT),this._setSelected(this.selected),this._setForm(this.form)}_renderForm(){this.rendered&&this._renderSelected()}clone(e,t){return e=e||{},e.form=this.form,super.clone(e,t)}setForm(e){this.setProperty("form",e)}_setForm(e){this.form&&this.form.off("destroy",this._formDestroyHandler),this._setProperty("form",e),this.form&&(this._adaptForm(this.form),this.form.one("destroy",this._formDestroyHandler))}_adaptForm(e){e.setShowOnOpen(!1),e.setDisplayHint(j.DisplayHint.VIEW),e.setModal(!1),e.setClosable(!1)}_onFormDestroy(e){(!this.popup||!this.popup.destroying)&&this.setSelected(!1),this.setForm(null);let t=this.findParent(bt);t&&!(t.destroying||t.removing)&&t.close()}_setSelected(e){this._setProperty("selected",e),this.popupStyle===Ji.PopupStyle.MOBILE&&this._doActionTogglesPopup()&&(this.selected?this._openPopup():this._closePopup())}_renderSelected(){super._renderSelected(),this.$container.addClass("has-popup"),T.hasPopup(this.$container,"dialog")}_canOpenPopup(){return this._closeOtherPopupsForSameMenu(),super._canOpenPopup()}_closeOtherPopupsForSameMenu(){this._findOtherPopupsForSameMenu().forEach(e=>{if(e.isRemovalPending()){e.removeImmediately();return}if(e._rendered){let t=e.animateRemoval;e.animateRemoval=!1,e.close(),e.animateRemoval=t}})}_findOtherPopupsForSameMenu(){return this.session.desktop.getPopups().filter(e=>e===this.popup||e.has(this)?!1:this._popupBelongsToMenu(e))}_popupBelongsToMenu(e){return!!(e.parent.original()===this.original()||e.findChild(t=>t.original()===this.original()))}_createPopup(){return this.form.rootGroupBox?.setMenuBarPosition(ae.MenuBarPosition.BOTTOM),this.popupStyle===Ji.PopupStyle.MOBILE?u.create(Oh,{parent:this.session.desktop,content:this.form,title:this.form.title}):u.create(tr,{parent:this,content:this.form,anchor:this,closeOnAnchorMouseDown:!1,cssClass:"form-menu-popup",horizontalAlignment:this.popupHorizontalAlignment,verticalAlignment:this.popupVerticalAlignment,closable:this.popupClosable,movable:this.popupMovable,resizable:this.popupResizable})}_doActionTogglesPopup(){return!!this.form}updateAriaRole(){T.role(this.$container,"menuitem")}_handleSelectedInEllipsis(){this.popupStyle!==Ji.PopupStyle.MOBILE&&super._handleSelectedInEllipsis()}_createActionKeyStroke(){return new xd(this)}setPopupClosable(e){this.setProperty("popupClosable",e)&&this.popup&&this.popup.setClosable(e)}setPopupMovable(e){this.setProperty("popupMovable",e)&&this.popup&&this.popup.setMovable(e)}setPopupResizable(e){this.setProperty("popupResizable",e)&&this.popup&&this.popup.setResizable(e)}}class zf extends wo{}class Pd extends pd{constructor(){super(),this.emptyMandatoryElementsTextKey="FormEmptyMandatoryFieldsMessage",this.invalidElementsErrorTextKey="FormInvalidFieldsMessage",this.invalidElementsWarningTextKey="FormInvalidFieldsWarningMessage",this.saveChangesQuestionTextKey="FormSaveChangesQuestion"}init(e){u.assertParameter("widget",e.widget,j),super.init(e)}_reset(){this.widget.visitFields(e=>{if(e instanceof ge&&e.resetValue(),e.lifecycleBoundary)return ye.SKIP_SUBTREE})}invalidElements(){const e=[],t=[];return this.widget.visitFields(i=>{let s=i.getValidationResult();return s.valid||(s.errorStatus&&s.errorStatus.isError()?t.push(s):s.validByMandatory?s.errorStatus&&!s.errorStatus.isValid()&&t.push(s):e.push(s)),i.lifecycleBoundary?ye.SKIP_SUBTREE:s.visitResult}),{missingElements:e,invalidElements:t}}_invalidElementText(e){const t=_.plainText(e.label),i=e.errorStatus&&_.box("'",_.plainText(e.errorStatus.message),"'");return _.join(": ",t,i)}_missingElementText(e){return _.plainText(e.label)}_validateWidget(){return this.widget._lifecycleValidate()}_handleInvalid(e){return this.widget._handleInvalid(e)}_revealInvalidElement(e){this.widget.revealInvalidField(e)}markAsSaved(){this.widget.markAsSaved()}saveNeeded(){return this.widget.saveNeeded}}class $r extends J{systemType;constructor(){super(),this.systemType=null}}class wn extends $r{constructor(){super(),this.actionStyle=ce.ActionStyle.BUTTON,this.keyStroke="esc",this.systemType=Oe.SystemType.CANCEL,this.inheritAccessibility=!1,this.preventDoubleClick=!0}_init(e){super._init(e),this.text=u.nvl(this.text,this.session.text("CancelButton"))}_doAction(){let e=this.getForm(),t=new qe;this.trigger("action",t),t.defaultPrevented||e.cancel()}}class Uf extends $r{constructor(){super(),this.actionStyle=ce.ActionStyle.BUTTON,this.keyStroke="esc",this.systemType=Oe.SystemType.CLOSE,this.inheritAccessibility=!1,this.preventDoubleClick=!0}_init(e){super._init(e),this.text=u.nvl(this.text,this.session.text("CloseButton"))}_doAction(){let e=this.getForm(),t=new qe;this.trigger("action",t),t.defaultPrevented||e.close()}}class Cn extends $r{constructor(){super(),this.actionStyle=ce.ActionStyle.BUTTON,this.keyStroke="enter",this.systemType=Oe.SystemType.OK,this.preventDoubleClick=!0}_init(e){super._init(e),this.text=u.nvl(this.text,this.session.text("OkButton"))}_doAction(){let e=this.getForm(),t=new qe;this.trigger("action",t),t.defaultPrevented||e.ok()}}class Gf extends $r{constructor(){super(),this.actionStyle=ce.ActionStyle.BUTTON,this.systemType=Oe.SystemType.RESET,this.preventDoubleClick=!0}_init(e){super._init(e),this.text=u.nvl(this.text,this.session.text("ResetButton"))}_doAction(){let e=this.getForm(),t=new qe;this.trigger("action",t),t.defaultPrevented||e.reset()}}class Kf extends $r{constructor(){super(),this.actionStyle=ce.ActionStyle.BUTTON,this.keyStroke="enter",this.systemType=Oe.SystemType.SAVE,this.preventDoubleClick=!0}_init(e){super._init(e),this.text=u.nvl(this.text,this.session.text("SaveButton"))}_doAction(){let e=this.getForm(),t=new qe;this.trigger("action",t),t.defaultPrevented||e.save()}}class jf extends J{constructor(){super(),this.actionStyle=ce.ActionStyle.BUTTON,this.keyStroke="enter",this.preventDoubleClick=!0}_init(e){super._init(e),this.text=u.nvl(this.text,this.session.text("SearchButton"))}_doAction(){const e=new qe;if(this.trigger("action",e),e.defaultPrevented)return;const t=this.getForm();t.validate().then(i=>{i.isValid()&&t.trigger("search")})}}class Qi extends xo{autoSize;shrinkEnabled;constructor(e){super(e),this.autoSize=!0,this.shrinkEnabled=!1}layout(e){if(!this.autoSize){super.layout(e);return}let t,i=this.form.htmlComp,s=this.form.prefBounds(),r=i.margins(),o=e.windowSize();s?t=s:t=i.bounds();let l=this._calcSize(e,t,s);e.toggleClass("full-width",this.form.maximized||t.x===0&&r.horizontal()===0&&o.width===l.width).toggleClass("full-height",this.form.maximized||t.y===0&&r.vertical()===0&&o.height===l.height),i.layouted&&!this.shrinkEnabled&&(l.width=Math.max(l.width,t.width),l.height=Math.max(l.height,t.height)),C.setSize(e,l),super.layout(e)}_calcSize(e,t,i){let s,r=this.form.htmlComp,o=r.margins(),l=e.windowSize();return this.form.maximized?l:i?(s=i.dimension(),s=Qi.fitContainerInWindow(l,new X,s,o),s):(s=this.preferredLayoutSize(e,{widthOnly:!0}),s=Qi.fitContainerInWindow(l,t.point(),s,o),s=this.preferredLayoutSize(e,{widthHint:s.width}).ceil(),s=Qi.fitContainerInWindow(l,t.point(),s,o),s)}static fitContainerInWindow(e,t,i,s){let r=e.width-s.horizontal()-t.x,o=e.height-s.vertical()-t.y,l=new F;return l.width=Math.min(r,i.width),l.height=Math.min(o,i.height),l}static positionContainerInWindow(e){let t=e.windowSize(),i=x.get(e).size(!0),s=(t.width-i.width)/2,r=(t.height-i.height)/2,o=r/5;return r-=o,s=Math.floor(s),r=Math.floor(r),new X(s,r)}}let Dd;class pe{active;globalState;_responsiveHandlers;constructor(){this.active=!0,this.globalState=null,this._responsiveHandlers=[]}static ResponsiveState={NORMAL:"normal",CONDENSED:"condensed",COMPACT:"compact"};init(){}destroy(){this._responsiveHandlers.forEach(e=>{e.destroy()})}setActive(e){this.active=e}setGlobalState(e){this.globalState=e}handleResponsive(e,t){if(!this.active||!e.responsiveHandler||!e.responsiveHandler.active())return!1;let i,s=e.responsiveHandler.state;return this.globalState?i=this.globalState:t<e.responsiveHandler.getCompactThreshold()&&e.responsiveHandler.acceptState(pe.ResponsiveState.COMPACT)?i=pe.ResponsiveState.COMPACT:(s===pe.ResponsiveState.COMPACT&&e.responsiveHandler.transform(pe.ResponsiveState.CONDENSED),t<e.responsiveHandler.getCondensedThreshold()&&e.responsiveHandler.acceptState(pe.ResponsiveState.CONDENSED)?i=pe.ResponsiveState.CONDENSED:i=pe.ResponsiveState.NORMAL),e.responsiveHandler.transform(i)}reset(e,t){this.active&&((!e.responsiveHandler||!e.responsiveHandler.active())&&!t||e.responsiveHandler.transform(pe.ResponsiveState.NORMAL,t))}registerHandler(e,t){e.responsiveHandler&&e.responsiveHandler.destroy(),e.responsiveHandler=t}unregisterHandler(e){e.responsiveHandler&&(e.responsiveHandler.destroy(),e.responsiveHandler=null)}static get(){return Dd}}G.addListener("prepare",()=>{Dd||(Dd=u.create(pe))});class Rl{objectType;widget;compactThreshold;condensedThreshold;oldState;state;allowedStates;transformations;enabledTransformations;_transformationsToApply;_transformationsToReset;_destroyHandler;constructor(){this.widget=null,this.compactThreshold=-1,this.condensedThreshold=-1,this.oldState=pe.ResponsiveState.NORMAL,this.state=pe.ResponsiveState.NORMAL,this.allowedStates=[pe.ResponsiveState.NORMAL,pe.ResponsiveState.COMPACT],this.transformations=b.createMap(),this.enabledTransformations=b.createMap(),this._destroyHandler=this._onDestroy.bind(this)}init(e){h().extend(this,e),this.widget.one("destroy",this._destroyHandler)}destroy(){this.widget.off("destroy",this._destroyHandler)}getCompactThreshold(){return this.compactThreshold}getCondensedThreshold(){return this.condensedThreshold}active(){return!0}setAllowedStates(e){this.allowedStates=e}acceptState(e){return p.contains(this.allowedStates,e)}_registerTransformation(e,t){this.transformations[e]=t.bind(this)}_enableTransformation(e,t){let i=this.enabledTransformations[e];i||(i=[],this.enabledTransformations[e]=i),i.push(t)}_disableTransformation(e,t){p.remove(this.enabledTransformations[e],t)}_storeFieldProperty(e,t,i){e._setProperty("responsive-"+t,i)}_hasFieldProperty(e,t){return e.hasOwnProperty("responsive-"+t)}_getFieldProperty(e,t){return e["responsive-"+t]}transform(e,t){if(this.state===e&&!t)return!1;this.oldState=this.state,this.state=e;let i,s;return this.oldState!==this.state?(i=this.enabledTransformations[this.oldState]||[],s=this.enabledTransformations[this.state]||[]):(i=[],this.state!==pe.ResponsiveState.NORMAL&&p.pushAll(i,this.enabledTransformations[pe.ResponsiveState.NORMAL]),this.state!==pe.ResponsiveState.CONDENSED&&p.pushAll(i,this.enabledTransformations[pe.ResponsiveState.CONDENSED]),this.state!==pe.ResponsiveState.COMPACT&&p.pushAll(i,this.enabledTransformations[pe.ResponsiveState.COMPACT]),s=this.enabledTransformations[this.state]||[]),this._transformationsToApply=p.diff(s,i),this._transformationsToReset=p.diff(i,s),this._transform(),!0}_transform(){this._transformWidget(this.widget)}_transformWidget(e){this._transformationsToApply.forEach(t=>{this.transformations[t](e,!0)}),this._transformationsToReset.forEach(t=>{this.transformations[t](e,!1)})}_onDestroy(e){this.destroy()}}class Po extends Rl{_compositeFields;_formFieldAddedHandler;_htmlPropertyChangeHandler;constructor(){super(),this._initDefaults(),this.allowedStates=[pe.ResponsiveState.NORMAL,pe.ResponsiveState.CONDENSED,pe.ResponsiveState.COMPACT],this._formFieldAddedHandler=this._onFormFieldAdded.bind(this),this._compositeFields=[],this._htmlPropertyChangeHandler=this._onHtmlEnvironmentPropertyChange.bind(this)}static TransformationType={LABEL_POSITION_ON_FIELD:"labelPositionOnField",LABEL_POSITION_ON_TOP:"labelPositionOnTop",LABEL_VISIBILITY:"labelVisibility",STATUS_POSITION_ON_TOP:"statusPositionOnTop",STATUS_VISIBILITY:"statusVisibility",VERTICAL_ALIGNMENT:"verticalAlignment",GRID_COLUMN_COUNT:"gridColumnCount",HIDE_PLACE_HOLDER_FIELD:"hidePlaceHolderField",FIELD_SCALABLE:"fieldScalable",RADIO_BUTTON_GROUP_USE_UI_HEIGHT:"radioButtonGroupUseUiHeight"};_initDefaults(){this.compactThreshold=we.get().formColumnWidth}_onHtmlEnvironmentPropertyChange(){this._initDefaults()}init(e){super.init(e);let t=Po.TransformationType,i=pe.ResponsiveState;this._registerTransformation(t.LABEL_POSITION_ON_FIELD,this._transformLabelPositionOnField),this._registerTransformation(t.LABEL_POSITION_ON_TOP,this._transformLabelPositionOnTop),this._registerTransformation(t.LABEL_VISIBILITY,this._transformLabelVisibility),this._registerTransformation(t.STATUS_POSITION_ON_TOP,this._transformStatusPosition),this._registerTransformation(t.STATUS_VISIBILITY,this._transformStatusVisibility),this._registerTransformation(t.VERTICAL_ALIGNMENT,this._transformVerticalAlignment),this._registerTransformation(t.GRID_COLUMN_COUNT,this._transformGridColumnCount),this._registerTransformation(t.HIDE_PLACE_HOLDER_FIELD,this._transformHidePlaceHolderField),this._registerTransformation(t.FIELD_SCALABLE,this._transformFieldScalable),this._registerTransformation(t.RADIO_BUTTON_GROUP_USE_UI_HEIGHT,this._transformRadioButtonGroupUseUiHeight),this._enableTransformation(i.CONDENSED,t.LABEL_POSITION_ON_TOP),this._enableTransformation(i.CONDENSED,t.LABEL_VISIBILITY),this._enableTransformation(i.CONDENSED,t.VERTICAL_ALIGNMENT),this._enableTransformation(i.CONDENSED,t.RADIO_BUTTON_GROUP_USE_UI_HEIGHT),this._enableTransformation(i.COMPACT,t.LABEL_POSITION_ON_TOP),this._enableTransformation(i.COMPACT,t.LABEL_VISIBILITY),this._enableTransformation(i.COMPACT,t.STATUS_POSITION_ON_TOP),this._enableTransformation(i.COMPACT,t.STATUS_VISIBILITY),this._enableTransformation(i.COMPACT,t.VERTICAL_ALIGNMENT),this._enableTransformation(i.COMPACT,t.GRID_COLUMN_COUNT),this._enableTransformation(i.COMPACT,t.HIDE_PLACE_HOLDER_FIELD),this._enableTransformation(i.COMPACT,t.FIELD_SCALABLE),this._enableTransformation(i.COMPACT,t.RADIO_BUTTON_GROUP_USE_UI_HEIGHT),we.get().on("propertyChange",this._htmlPropertyChangeHandler),this.widget.visitFields(s=>{s instanceof ar&&(s.on("propertyChange",this._formFieldAddedHandler),this._compositeFields.push(s))},{limitToSameFieldTree:!0})}destroy(){super.destroy(),this._compositeFields.forEach(e=>e.off("propertyChange",this._formFieldAddedHandler)),we.get().off("propertyChange",this._htmlPropertyChangeHandler)}active(){return this.widget.responsive}getCondensedThreshold(){return this.condensedThreshold>0?this.condensedThreshold:this.widget.htmlComp.prefSize({widthOnly:!0}).width}_transform(){this.widget.visitFields(this._transformWidget.bind(this),{limitToSameFieldTree:!0})}_transformWidget(e){if(e!==this.widget&&e instanceof ae&&e.responsive!==null)return ye.SKIP_SUBTREE;if(!(e instanceof A))return;let t;e.htmlComp&&(e.htmlComp.suppressValidate=!0,t=e.htmlComp.getParent(),t&&(t.suppressValidate=!0)),super._transformWidget(e),e.htmlComp&&(e.htmlComp.suppressValidate=!1),t&&(t.suppressValidate=!1)}_transformLabelPositionOnField(e,t){e.parent instanceof kn||e instanceof cs||e instanceof na||(t?(this._storeFieldProperty(e,"labelPosition",e.labelPosition),e.setLabelPosition(A.LabelPosition.ON_FIELD)):this._hasFieldProperty(e,"labelPosition")&&e.setLabelPosition(this._getFieldProperty(e,"labelPosition")))}_transformLabelPositionOnTop(e,t){e.parent instanceof kn||e instanceof cs||e instanceof na||e.labelPosition===A.LabelPosition.ON_FIELD||(t?(this._storeFieldProperty(e,"labelPosition",e.labelPosition),e.setLabelPosition(A.LabelPosition.TOP)):this._hasFieldProperty(e,"labelPosition")&&e.setLabelPosition(this._getFieldProperty(e,"labelPosition")))}_transformLabelVisibility(e,t){e instanceof cs&&(t?(this._storeFieldProperty(e,"labelVisible",e.labelVisible),e.setLabelVisible(!1)):this._hasFieldProperty(e,"labelVisible")&&e.setLabelVisible(this._getFieldProperty(e,"labelVisible")))}getGridData(e){return new ke(e.gridDataHints)}setGridData(e,t){e.setGridDataHints(t)}_transformStatusPosition(e,t){t?(this._storeFieldProperty(e,"statusPosition",e.statusPosition),e.setStatusPosition(A.StatusPosition.TOP)):this._hasFieldProperty(e,"statusPosition")&&e.setStatusPosition(this._getFieldProperty(e,"statusPosition"))}_transformStatusVisibility(e,t){t?(this._storeFieldProperty(e,"statusVisible",e.statusVisible),e.setStatusVisible(!1)):this._hasFieldProperty(e,"statusVisible")&&e.setStatusVisible(this._getFieldProperty(e,"statusVisible"))}_transformVerticalAlignment(e,t){let i=e instanceof Oe&&e.displayStyle===Oe.DisplayStyle.DEFAULT,s=e instanceof cs,r=this.getGridData(e),o=e.labelPosition===A.LabelPosition.ON_FIELD&&r.h===1;!(i||s||o)||!e.gridData||(t?(this._storeFieldProperty(e,"fillVertical",r.fillVertical),this._storeFieldProperty(e,"verticalAlignment",r.verticalAlignment),r.fillVertical=!1,r.verticalAlignment=1):(this._hasFieldProperty(e,"fillVertical")&&(r.fillVertical=this._getFieldProperty(e,"fillVertical")),this._hasFieldProperty(e,"verticalAlignment")&&(r.verticalAlignment=this._getFieldProperty(e,"verticalAlignment"))),this.setGridData(e,r))}_transformGridColumnCount(e,t){e instanceof ae&&(t?(this._storeFieldProperty(e,"gridColumnCount",e.gridColumnCount),e.setGridColumnCount(1)):this._hasFieldProperty(e,"gridColumnCount")&&e.setGridColumnCount(this._getFieldProperty(e,"gridColumnCount")))}_transformHidePlaceHolderField(e,t){e instanceof la&&(t?(this._storeFieldProperty(e,"visible",e.visible),e.setVisible(!1)):this._hasFieldProperty(e,"visible")&&e.setVisible(this._getFieldProperty(e,"visible")))}_transformFieldScalable(e,t){if(e.parent instanceof kn)return;let i=this.getGridData(e);t&&i.weightX===0?(this._storeFieldProperty(e,"weightX",i.weightX),i.weightX=1):t||this._hasFieldProperty(e,"weightX")&&(i.weightX=this._getFieldProperty(e,"weightX")),this.setGridData(e,i)}_transformRadioButtonGroupUseUiHeight(e,t){if(!(e instanceof Or))return;let i=this.getGridData(e);t&&!i.useUiHeight?(this._storeFieldProperty(e,"useUiHeight",i.useUiHeight),i.useUiHeight=!0):t||this._hasFieldProperty(e,"useUiHeight")&&(i.useUiHeight=this._getFieldProperty(e,"useUiHeight")),this.setGridData(e,i)}_onFormFieldAdded(e){this.state!==pe.ResponsiveState.NORMAL&&(e.propertyName==="fields"||e.propertyName==="tabItems")&&p.diff(e.newValue,e.oldValue).forEach(i=>i.visitFields(this._transformWidget.bind(this),{limitToSameFieldTree:!0}))}}class qf extends Rl{constructor(){super(),this.compactThreshold=500,this.allowedStates=[pe.ResponsiveState.NORMAL,pe.ResponsiveState.COMPACT]}init(e){super.init(e),this._registerTransformation("navigationVisible",this._transformNavigationVisible),this._enableTransformation(pe.ResponsiveState.COMPACT,"navigationVisible")}_transformNavigationVisible(e,t){t?(this._storeFieldProperty(e,"navigationVisible",e.navigationVisible),e.setNavigationVisible(!1)):this._hasFieldProperty(e,"navigationVisible")&&e.setNavigationVisible(this._getFieldProperty(e,"navigationVisible"))}}class Al extends j{outline;nodes;tileOverviewTitle;scrollable;pageTileGrid;contentHtmlComp;$content;_desktopNavigationVisibilityChangeHandler;constructor(){super(),this.outline=null,this.nodes=null,this.tileOverviewTitle=null,this.scrollable=!0,this._addWidgetProperties(["pageTileGrid"]),this.$content=null,this.$title=null,this._desktopNavigationVisibilityChangeHandler=this._onDesktopNavigationVisibilityChange.bind(this)}_init(e){super._init(e),this.pageTileGrid||(this.pageTileGrid=this._createPageTileGrid()),this.addCssClass("dimmed-background")}_render(){super._render(),this.htmlComp.setLayout(new Si),this.$content=this.$container.appendDiv("tile-overview-content"),this.contentHtmlComp=x.install(this.$content,this.session),this.contentHtmlComp.setLayout(new Si({stretch:this.outline.compact})),this.$title=this.$content.appendDiv("tile-overview-title").text(this.tileOverviewTitle),x.install(this.$title,this.session),this.$title.cssMaxHeight(this.$title.cssHeight()),this._updateTitle(!1),this.findDesktop().on("propertyChange:navigationVisible",this._desktopNavigationVisibilityChangeHandler)}_remove(){this.$content=null,this.$title=null,this.findDesktop().off("propertyChange:navigationVisible",this._desktopNavigationVisibilityChangeHandler),super._remove()}_renderProperties(){super._renderProperties(),this.pageTileGrid.rendered&&(this.pageTileGrid=this._createPageTileGrid()),this._renderPageTileGrid(),this._renderScrollable()}_renderPageTileGrid(){this.pageTileGrid.render(this.$content)}_createPageTileGrid(){return u.create(Ra,{parent:this,outline:this.outline,nodes:this.nodes})}setScrollable(e){this.setProperty("scrollable",e)}_renderScrollable(){this.scrollable?this._installScrollbars({axis:"y"}):this._uninstallScrollbars()}setPage(e){this.outline=e.outline,this.nodes=e.childNodes,this.tileOverviewTitle=e.text,this.setScrollable(!this.outline.compact),this.pageTileGrid.setCompact(this.outline.compact),this.pageTileGrid.setOutline(this.outline),this.pageTileGrid.setPage(e),this.pageTileGrid.setNodes(this.nodes)}_updateTitle(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.$title&&(this.$title.toggleClass("animated",e),this.$title.toggleClass("removed",this.findDesktop().navigationVisible),T.hidden(this.$title,this.findDesktop().navigationVisible?!0:null))}_onDesktopNavigationVisibilityChange(e){this._updateTitle()}}class Yf extends Ar{}class Xf extends Ar{_initModel(e,t){let i=super._initModel(e,t);if(!i.jsFormObjectType)throw new Error("jsFormObjectType not set");let s={parent:i.parent,owner:i.owner,objectType:i.jsFormObjectType,displayParent:i.displayParent,displayHint:i.displayHint,data:xe.deserialize(i.inputData,null,{createPojoIfDoIsUnknown:!0}),__hybridModelAdapter:this};if(i.jsFormModel){let r=xe.deserialize(i.jsFormModel,null,{createPojoIfDoIsUnknown:!0});delete r._type,s=$.extend({},r,s)}return s}_createWidget(e){let t;return e.exclusiveKey?(t=this.session.desktop.createFormExclusive(()=>super._createWidget(e),e.exclusiveKey),t.exclusiveAdapterKey?t.exclusiveAdapterKey!==this.id&&(t=super._createWidget(e)):(t.exclusiveAdapterKey=this.id,t.__hybridModelAdapter=this)):t=super._createWidget(e),t.showOnOpen?(t.blockRendering=!0,t.open(),t.whenPostLoad().then(()=>{t.blockRendering=!1,!(t.destroyed||!t.showOnOpen)&&t.show()})):t.open(),t}_onWidgetEvent(e){e.type==="save"?this._onWidgetSave(e):e.type==="search"?this._onWidgetSearch(e):e.type==="reset"?this._onWidgetReset(e):super._onWidgetEvent(e)}_onWidgetSave(e){this._sendOutputData("save",this.widget.data)}_onWidgetSearch(e){this._sendOutputData("search",this.widget.exportData())}_onWidgetReset(e){this._sendOutputData("reset",this.widget.exportData())}_sendOutputData(e,t){this._send(e,{outputData:xe.serialize(t)})}_onWidgetAbort(e){}}class H extends I{autoResizeColumns;columnAddable;columnLayoutDirty;columns;contextColumn;checkable;displayViewId;checkableStyle;cellEditorPopup;compact;openFieldPopupOnCellEdit;compactHandler;compactColumn;dropType;dropMaximumSize;dragAndDropHandler;groupingStyle;header;tableStatus;rowBorders;headerEnabled;headerVisible;headerMenusEnabled;hasReloadHandler;hierarchical;hierarchicalStyle;keyStrokes;menus;menuBar;menuBarVisible;contextMenu;multiCheck;multiSelect;multilineText;scrollToSelection;selectedRows;sortEnabled;tableControls;tableStatusVisible;tableTileGridMediator;tileMode;tileTableHeader;tileProducer;footer;footerVisible;filters;rows;rootRows;visibleRows;estimatedRowCount;maxRowCount;aggregateRowHeight;truncatedCellTooltipEnabled;checkableColumn;rowIconColumn;uiCssClass;visibleRowsMap;rowLevelPadding;rowsMap;rowHeight;rowWidth;rowInsets;rowMargins;rowIconVisible;rowIconColumnWidth;staticMenus;selectionHandler;tooltips;tableNodeColumn;updateBuffer;viewRangeSize;viewRangeDirty;viewRangeRendered;virtual;textFilterEnabled;filterSupport;filteredElementsDirty;defaultMenuTypes;accessibilityRenderer;organizer;customizer;defaultRowAction;userPreferenceContext;uiPreferencesEnabled;$data;$emptyData;$fillBefore;$fillAfter;_renderViewportBlocked;_filterMenusHandler;_aggregateRows;_filteredRows;_maxLevel;_animationRowLimit;_blockLoadThreshold;_doubleClickSupport;_permanentHeadSortColumns;_permanentTailSortColumns;_popupOpenHandler;_rerenderViewPortAfterAttach;_renderViewPortAfterAttach;_triggerRowsSelectedPending;_animateAggregateRows;_postAttachActions;_desktopPropertyChangeHandler;_menuInheritAccessibilityChangeHandler;_imageLoadListener;_insertedRows;_$mouseDownRow;_mouseDownRowId;_mouseDownColumn;_initialUiPreferences;constructor(){super(),this.autoResizeColumns=!1,this.columnAddable=!0,this.columnLayoutDirty=!1,this.columns=[],this.contextColumn=null,this.checkable=!1,this.checkableStyle=H.CheckableStyle.CHECKBOX,this.cellEditorPopup=null,this.compact=!1,this.compactHandler=u.create(Ed,{table:this}),this.compactColumn=null,this.dropType=O.NONE,this.dropMaximumSize=z.DEFAULT_DROP_MAXIMUM_SIZE,this.groupingStyle=H.GroupingStyle.TOP,this.header=null,this.headerEnabled=!0,this.headerVisible=!0,this.headerMenusEnabled=!0,this.hasReloadHandler=!1,this.hierarchical=!1,this.hierarchicalStyle=H.HierarchicalStyle.DEFAULT,this.keyStrokes=[],this.menus=[],this.menuBar=null,this.menuBarVisible=!0,this.contextMenu=null,this.multiCheck=!0,this.multiSelect=!0,this.multilineText=!1,this.scrollToSelection=!1,this.scrollTop=0,this.selectedRows=[],this.sortEnabled=!0,this.tableControls=[],this.tableStatusVisible=!1,this.tableTileGridMediator=null,this.tileMode=!1,this.tileTableHeader=null,this.tileProducer=null,this.footer=null,this.footerVisible=!1,this.filters=[],this.rows=[],this.rootRows=[],this.visibleRows=[],this.estimatedRowCount=0,this.maxRowCount=0,this.truncatedCellTooltipEnabled=null,this.visibleRowsMap={},this.rowLevelPadding=0,this.rowsMap={},this.rowHeight=0,this.rowWidth=0,this.rowInsets=new We,this.rowMargins=new We,this.rowIconVisible=!1,this.rowIconColumnWidth=le.NARROW_MIN_WIDTH,this.staticMenus=[],this.selectionHandler=new Id(this),this.tooltips=[],this._filteredRows=[],this.tableNodeColumn=null,this._maxLevel=0,this._aggregateRows=[],this._animationRowLimit=25,this._blockLoadThreshold=25,this.updateBuffer=new Od(this),this.viewRangeSize=10,this.viewRangeDirty=!1,this.viewRangeRendered=new U(0,0),this.virtual=!0,this.textFilterEnabled=!0,this.filterSupport=this._createFilterSupport(),this.filteredElementsDirty=!1,this.defaultMenuTypes=[H.MenuType.EmptySpace],this.accessibilityRenderer=new Wl,this.organizer=null,this.customizer=null,this._doubleClickSupport=new R,this._permanentHeadSortColumns=[],this._permanentTailSortColumns=[],this._filterMenusHandler=this._filterMenus.bind(this),this._popupOpenHandler=this._onDesktopPopupOpen.bind(this),this._rerenderViewPortAfterAttach=!1,this._renderViewPortAfterAttach=!1,this._postAttachActions=[],this._desktopPropertyChangeHandler=this._onDesktopPropertyChange.bind(this),this._menuInheritAccessibilityChangeHandler=this._updateMenusEnabled.bind(this),this._addWidgetProperties(["tableControls","menus","keyStrokes","staticMenus","tileTableHeader","tableTileGridMediator","defaultRowAction"]),this._addPreserveOnPropertyChangeProperties(["defaultRowAction"]),this.$data=null,this.$emptyData=null,this.$fillBefore=null,this.$fillAfter=null}static MenuType={EmptySpace:"Table.EmptySpace",SingleSelection:"Table.SingleSelection",MultiSelection:"Table.MultiSelection",Header:"Table.Header"};static HierarchicalStyle={DEFAULT:"default",STRUCTURED:"structured"};static GroupingStyle={TOP:"top",BOTTOM:"bottom"};static CheckableStyle={CHECKBOX:"checkbox",TABLE_ROW:"tableRow",CHECKBOX_TABLE_ROW:"checkbox_table_row"};static ReloadReason={UNSPECIFIED:"unspecified",SEARCH:"search",OVERRIDE_ROW_LIMIT:"overrideRowLimit",RESET_ROW_LIMIT:"resetRowLimit",ORGANIZE_COLUMNS:"organizeColumns",DATA_CHANGED_TRIGGER:"dataChangedTrigger"};static SELECTION_CLASSES="select-middle select-top select-bottom select-single selected";_init(e){super._init(e),this.resolveConsts([{property:"hierarchicalStyle",constType:H.HierarchicalStyle},{property:"checkableStyle",constType:H.CheckableStyle},{property:"groupingStyle",constType:H.GroupingStyle}]),this._initOrganizer(e.organizer===void 0),this._initCustomizer(),this._initColumns(),this.rows.forEach((t,i)=>{this.rows[i]=this._initRow(t)}),this.setFilters(this.filters),this._updateRowStructure({updateTree:!0}),this.menuBar=this._createMenuBar(),this.menuBar.on("propertyChange:visible",()=>this._refreshMenuBarClasses()),this._setSelectedRows(this.selectedRows),this._setKeyStrokes(this.keyStrokes),this._setMenus(this.menus),this._setDefaultRowAction(this.defaultRowAction),this._setTableControls(this.tableControls),this._setTableStatus(this.tableStatus),this._calculateValuesForBackgroundEffect(),this._setTileMode(this.tileMode),this._setTileTableHeader(this.tileTableHeader),this._sortWhileInit(),this._updateMenusEnabled(),this._initTablePreferences()}_initTablePreferences(){this.one("init",e=>{this._setUiPreferencesEnabled(this.uiPreferencesEnabled)})}_initRow(e){let t;return e instanceof Rt?t=e:t=this._createRow(e),this.rowsMap[t.id]=t,this.trigger("rowInit",{row:t}),t}_createRow(e){let t=e||{};return t.objectType=u.nvl(t.objectType,Rt),t.parent=this,u.create(t)}_initColumns(){let e=this.columns;this.columns=e.map((t,i)=>{const s=this._ensureColumn(t);return s.index<0&&(s.index=i),s}),this.rowIconVisible&&this._insertRowIconColumn(),this._setCompact(this.compact),this._calculateCheckableTableNodeAndSortColumns(),this.columnLayoutDirty=!0}_calculateCheckableTableNodeAndSortColumns(){this._calculateCheckableColumn(),this._setCheckable(this.checkable),this._calculateTableNodeColumn(),this._setHeadAndTailSortColumns()}_destroy(){this._destroyOrganizer(),this._destroyCustomizer(),this._destroyColumns(),super._destroy()}_destroyColumns(){this.columns.forEach(e=>e.destroy()),this.checkableColumn=null,this.compactColumn=null,this.rowIconColumn=null,this.columns=[]}_calculateTableNodeColumn(){let e=this.visibleColumns().filter(i=>i.nodeColumnCandidate),t=p.first(e);this.tableNodeColumn&&this.tableNodeColumn!==t&&(this.tableNodeColumn.minWidth=this.tableNodeColumn.__initialMinWidth),this.tableNodeColumn=t,this.tableNodeColumn&&(this.tableNodeColumn.__initialMinWidth=this.tableNodeColumn.minWidth,this.tableNodeColumn.minWidth=this.rowLevelPadding*this._maxLevel+this.tableNodeColumn.tableNodeLevel0CellPadding+8,this.tableNodeColumn.minWidth>this.tableNodeColumn.width&&(this._isDataRendered()?this.resizeColumn(this.tableNodeColumn,this.tableNodeColumn.minWidth):this.tableNodeColumn.width=this.tableNodeColumn.minWidth))}_createLoadingSupport(){return new Ut({widget:this,withGlassPane:!0,$container:()=>this.tileMode?this.tableTileGridMediator.tileAccordion.$container:this.$data})}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this._initTableKeyStrokeContext()}_initTableKeyStrokeContext(){this.keyStrokeContext.registerKeyStrokes([new hu(this),new du(this),new pu(this),new fu(this),new uu(this),new cu(this),new Ol(this,m.LEFT,"←"),new Ol(this,m.SUBTRACT,"-"),new Hl(this,m.RIGHT,"→"),new Hl(this,m.ADD,"+"),new ou(this),new nu(this),new lu(this),new au(this),new ru(this),new pl(this,this.showContextMenu,this),new Fn(this,this.handleAppLinkAction)])}_insertBooleanColumn(){if(this.checkableStyle===H.CheckableStyle.TABLE_ROW)return;let e=u.create(nr,{parent:this,fixedWidth:!0,fixedPosition:!0,guiOnly:!0,nodeColumnCandidate:!1,headerMenuEnabled:!1,showSeparator:!1,width:le.NARROW_MIN_WIDTH});p.insert(this.columns,e,0),this.checkableColumn=e}_insertRowIconColumn(){let e=0,t=u.create(kl,{parent:this,fixedWidth:!0,fixedPosition:!0,guiOnly:!0,nodeColumnCandidate:!1,headerMenuEnabled:!1,showSeparator:!1,width:this.rowIconColumnWidth});this.columns[0]===this.checkableColumn&&(e=1),p.insert(this.columns,t,e),this.rowIconColumn=t}handleAppLinkAction(e){let t=h()(e.target),i=this._columnAtX(t.offset().left),s=t.findUp(r=>r.hasClass("table-row"),this.$container).data("row");this._triggerAppLinkAction(i,s,t.data("ref"),t)}_isDataRendered(){return this.rendered&&this.$data!==null}_render(){this.$container=this.$parent.appendDiv("table").addDeviceClass(),this.accessibilityRenderer.renderTable(this.$container),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new kd(this)),this.uiCssClass&&this.$container.addClass(this.uiCssClass),this.tileMode?this._renderTileMode():this._renderData(),this.session.desktop.on("popupOpen",this._popupOpenHandler),this.session.desktop.on("propertyChange",this._desktopPropertyChangeHandler)}_renderData(){this.$data=this.$container.appendDiv("table-data"),this.accessibilityRenderer.renderRowGroup(this.$data),this.$data.on("mousedown",".table-row",this._onRowMouseDown.bind(this)).on("mouseup",".table-row",this._onRowMouseUp.bind(this)).on("dblclick",".table-row",this._onRowDoubleClick.bind(this)).on("contextmenu",e=>e.preventDefault()),this._installScrollbars({axis:"both"}),this._installImageListeners(),this._installCellTooltipSupport(),this._calculateRowInsets(),this._updateRowWidth(),this._updateRowHeight(),this._renderViewport(),this.scrollToSelection&&this.revealSelection()}_renderProperties(){super._renderProperties(),this._renderTableHeader(),this._renderMenuBarVisible(),this._renderFooterVisible(),this._renderCheckableStyle(),this._renderHierarchicalStyle(),this._renderTextFilterEnabled(),this._renderMultiSelect(),this._renderMultiCheck()}_setCssClass(e){super._setCssClass(e);let t=["table-row-level-padding"];this.cssClass&&t.push(this.cssClass);let i=t.reduce((s,r)=>s+" "+r,"");this.setRowLevelPadding(L.getSize(i,"width","width",15))}_removeData(){this._removeAggregateRows(),this._uninstallImageListeners(),this._uninstallCellTooltipSupport(),this._uninstallScrollbars(),this._removeRows(),this.$fillBefore=null,this.$fillAfter=null,this.$data.remove(),this.$data=null,this.$emptyData=null}_remove(){this.session.desktop.off("propertyChange",this._desktopPropertyChangeHandler),this.session.desktop.off("popupOpen",this._popupOpenHandler),z.uninstallDragAndDropHandler(this),this.header=null,this.$data&&this._removeData(),this.filterSupport.remove(),super._remove()}setRowLevelPadding(e){this.setProperty("rowLevelPadding",e)}_renderRowLevelPadding(){this._rerenderViewport()}setTableControls(e){this.setProperty("tableControls",e)}_renderTableControls(){this.footer&&this.footer._renderControls()}_setTableControls(e){let t;for(t=0;t<this.tableControls.length;t++)this.keyStrokeContext.unregisterKeyStroke(this.tableControls[t]);for(this._setProperty("tableControls",e),t=0;t<this.tableControls.length;t++)this.keyStrokeContext.registerKeyStroke(this.tableControls[t]);this._updateFooterVisibility(),this.tableControls.forEach(i=>{i.tableFooter=this.footer})}_onImageLoadOrError(e){let t=h()(e.target);if(t.data("measure")==="in-progress")return;t.toggleClass("broken",e.type==="error");let i=t.closest(".table-row"),s=i.data("row");if(!s)return;let r=s.height;s.height=this._measureRowHeight(i),r!==s.height&&this.invalidateLayoutTree()}_onRowMouseDown(e){this._doubleClickSupport.mousedown(e),this._$mouseDownRow=h()(e.currentTarget),this._mouseDownRowId=this._$mouseDownRow.data("row").id,this._mouseDownColumn=this._columnAtX(e.pageX),this._$mouseDownRow.window().one("mouseup",()=>{this._$mouseDownRow=null,this._mouseDownRowId=null,this._mouseDownColumn=null}),this.setContextColumn(this._columnAtX(e.pageX));let t=this._$mouseDownRow.data("row");this.selectionHandler.onMouseDown(e),this._$mouseDownRow=t.$row;let i=e.which===3,s=h()(e.target);this._isRowControl(s)&&(t.expanded?this.collapseRow(t):this.expandRow(t)),u.isOneOf(this.checkableStyle,H.CheckableStyle.TABLE_ROW,H.CheckableStyle.CHECKBOX_TABLE_ROW)&&(!i||!t.checked)&&!h()(e.target).is(".table-row-control")&&!(s.hasClass("checkable")||s.parent().hasClass("checkable"))&&this.checkRow(t,!t.checked),i&&(e.preventDefault(),this.showContextMenu({pageX:e.pageX,pageY:e.pageY})),T.linkElementWithActiveDescendant(this.$container,t.$row)}_isRowControl(e){return e.hasClass("table-row-control")||e.parent().hasClass("table-row-control")}_onRowMouseUp(e){let t,i=e.which;if(this._doubleClickSupport.doubleClicked())return;let s=h()(e.currentTarget);if(this.selectionHandler.onMouseUp(e),!this._$mouseDownRow||this._mouseDownRowId!==s.data("row").id)return;let r=s,o=this._columnAtX(e.pageX);if(o!==this._mouseDownColumn)return;let l=h()(e.target);if(this._isRowControl(l))return;let a=r.data("row");i===1&&(o.onMouseUp(e,r),t=this._find$AppLink(e)),t?this._triggerAppLinkAction(o,a,t.data("ref"),t):this._triggerRowClick(e,a,i,o)}_onRowDoubleClick(e){let t=h()(e.currentTarget),i=this._columnAtX(e.pageX);this.doRowAction(t.data("row"),i)}showContextMenu(e){this.session.onRequestsDone(this._showContextMenu.bind(this,e))}_showContextMenu(e){if(e=e||{},!this._isDataRendered()||!this.attached||this.selectedRows.length===0)return;let t=this._filterMenusForContextMenu();if(t.length===0)return;let i=u.nvl(e.pageX,null),s=u.nvl(e.pageY,null);if(i===null||s===null){let r=this.isRowSelectedAndVisible(this.selectionHandler.lastActionRow)?this.selectionHandler.lastActionRow:this.getLastSelectedAndVisibleRow();if(r!==null){let o=r.$row,l=o.offset(),a=C.offsetBounds(this.$data);l.left+=this.$data.scrollLeft(),i=l.left+10,s=l.top+o.outerHeight()/2,s=Math.min(Math.max(s,a.y+1),a.bottom()-1)}else i=this.$data.offset().left+10,s=this.$data.offset().top+10}this.contextMenu&&this.contextMenu.close(),this.contextMenu=u.create(bt,{parent:this,menuItems:t,location:{x:i,y:s},$anchor:this.$data,menuFilter:this._filterMenusHandler}),this.contextMenu.open()}isRowSelectedAndVisible(e){return!this.isRowSelected(e)||!e.$row?!1:C.offsetBounds(e.$row).intersects(C.offsetBounds(this.$data))}getLastSelectedAndVisibleRow(){for(let e=this.viewRangeRendered.to;e>=this.viewRangeRendered.from;e--)if(this.isRowSelectedAndVisible(this.rows[e]))return this.rows[e];return null}onColumnVisibilityChanged(){this.columnLayoutDirty=!0,this._calculateTableNodeColumn(),this._triggerColumnStructureChanged(this.columns,this.columns),this._group(!1),this._isDataRendered()&&(this._updateRowWidth(),this.redraw())}_onScroll(e){let t=this.$data[0].scrollTop,i=this.$data[0].scrollLeft;this.scrollTop!==t&&this._renderViewport(),this.scrollTop=t,this.scrollLeft=i}_renderTableStatus(){this.trigger("statusChanged")}setContextColumn(e){this.setProperty("contextColumn",e)}_hasVisibleTableControls(){return this.tableControls.some(e=>e.visible)}hasAggregateTableControl(){return!!this.findTableControl($s)}findTableControl(e,t){for(let i of this.tableControls)if(i instanceof e&&(!t||t(i)))return i;return null}_createHeader(){return u.create(Md,{parent:this,table:this,enabled:this.headerEnabled,headerMenusEnabled:this.headerMenusEnabled})}_createFooter(){return u.create(Ad,{parent:this,table:this})}_initOrganizer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=this.organizer||(e?this._createOrganizer():null);this._setOrganizer(t)}_createOrganizer(){return u.create(Nl)}_destroyOrganizer(){this.setOrganizer(null)}setOrganizer(e){this.setProperty("organizer",e)}_setOrganizer(e){this.organizer&&this.organizer.uninstall(),this._setProperty("organizer",e),this.organizer&&this.organizer.install(this)}_initCustomizer(){this._setCustomizer(this.customizer)}_destroyCustomizer(){this.setCustomizer(null)}setCustomizer(e){this.setProperty("customizer",e)}_setCustomizer(e){if(e&&e.table!==this)throw new Error(`Unexpected table in customizer (${e.table.id} instead of ${this.id}`);this._setProperty("customizer",e)}setDefaultRowAction(e){this.setProperty("defaultRowAction",e)}_setDefaultRowAction(e){this._setProperty("defaultRowAction",e)}_installCellTooltipSupport(){Y.install(this.$data,{parent:this,selector:".table-cell",text:this._cellTooltipText.bind(this),htmlEnabled:this._isCellTooltipHtmlEnabled.bind(this),arrowPosition:50,arrowPositionUnit:"%",clipOrigin:!0,nativeTooltip:!w.get().isCustomEllipsisTooltipPossible()})}_uninstallCellTooltipSupport(){Y.uninstall(this.$data)}_cellTooltipText(e){let t,i=e.parent(),s=this.columnFor$Cell(e,i),r=i.data("row");if(r&&(t=this.cell(s,r).tooltipText),t)return t;if(this._isAggregatedTooltip(e)&&e.text().trim()){let o=e.children(".text"),l=e.children(".table-cell-icon"),a=l.length&&!l.isVisible();if(o.length&&o.isContentTruncated()||a){let d=e.clone();if(d.children(".table-cell-icon").setVisible(!0),e.css("direction")==="rtl"){let c=d.children().get().map(f=>f.outerHTML).reverse();return _.join("",...c)}return d.html()}}if(this._isTruncatedCellTooltipEnabled(s)&&e.isContentTruncated())return _.plainText(e.html(),{trim:!0,removeFontIcons:!0})}setTruncatedCellTooltipEnabled(e){this.setProperty("truncatedCellTooltipEnabled",e)}_isTruncatedCellTooltipEnabled(e){return this.truncatedCellTooltipEnabled===null?!this.headerVisible||!this.headerEnabled||e.fixedWidth:this.truncatedCellTooltipEnabled}_isAggregatedTooltip(e){let t=e.parent();return t.data("aggregateRow")||t.hasClass("table-aggregate")}_isCellTooltipHtmlEnabled(e){return this._isAggregatedTooltip(e)}reload(e){this.hasReloadHandler&&(this._removeRows(),this._isDataRendered()&&(this._removeAggregateRows(),this._renderFiller()),this._triggerReload(e))}setLoading(e){!e&&this.updateBuffer.isBuffering()||super.setLoading(e)}exportToClipboard(){this._triggerClipboardExport()}_exportToClipboard(){li.copyText({parent:this,text:this._selectedRowsToText()})}_selectedRowsToText(){let e=this.visibleColumns();return this.selectedRows.map(t=>e.map(i=>{let s=i.cell(t),r;return i instanceof nr?r=s.value?"X":"":s.htmlEnabled?r=_.plainText(s.text):r=s.text,this._unwrapText(r)}).join(" ")).join(`
`)}_unwrapText(e){return _.nvl(e).split(/[\n\r]/).map(t=>t.replace(/\t/g," ")).map(t=>t.trim()).filter(t=>!!t.length).join(" ")}setMultiSelect(e){this.setProperty("multiSelect",e)}toggleSelection(){this.selectedRows.length===this.visibleRows.length?this.deselectAll():this.selectAll()}selectAll(){this.selectRows(this.visibleRows)}deselectAll(){this.selectRows([])}checkAll(e,t){let i=h().extend(t,{checked:e});this.checkRows(this.visibleRows,i)}uncheckAll(e){this.checkAll(!1,e)}updateScrollbars(){P.update(this.$data)}_sort(e){if(!this.rows.length)return!0;let t=this._sortColumns();return this._isSortingPossible(t)?(this.clearAggregateRows(e),t.length&&(t=p.union(t,this.columns),this._sortImpl(t),this._triggerRowOrderChanged(),this._isDataRendered()&&this._renderRowOrderChanges(),this._group(e)),!0):!1}_isSortingPossible(e){return e.every(t=>t.isSortingPossible())}_sortColumns(){let e=[];for(let t=0;t<this.columns.length;t++){let i=this.columns[t],s=i.sortIndex;s>=0&&(e[s]=i)}return e}_sortImpl(e){let t=(i,s)=>{for(let r=0;r<e.length;r++){let o=e[r],l=o.compare(i,s);if(o.sortActive&&!o.sortAscending&&(l=-l),l!==0)return l}return 0};if(this.hierarchical){this._sortHierarchical(t);let i=[];this.visitRows(s=>i.push(s)),this.rows=i}else this.rows.sort(t),this.rootRows=this.rows;this._updateRowStructure({filteredRows:!0,applyFilters:!1,visibleRows:!0})}visitRows(e,t,i){i=u.nvl(i,0),t=t||this.rootRows,t.forEach(s=>{e(s,i),this.visitRows(e,s.childRows,i+1)})}_sortHierarchical(e,t){t=t||this.rootRows,t.sort(e),t.forEach(i=>this._sortHierarchical(e,i.childRows))}_renderRowOrderChanges(){let e,t=this.$rows(),i={};t.length===this.visibleRows.length&&t.each((s,r)=>{let o=!1,l=h()(r),a=l.data("row");if(this._insertedRows){for(let d=0;d<this._insertedRows.length;d++)if(this._insertedRows[d].id===a.id){o=!0;break}}o||(e=!0,i[a.id]=l.offset().top)}),this._rerenderViewport(),this._order$AggregateRows(),this.scrollToSelection&&this.revealSelection(),e&&(t=this.$rows(),t.each((s,r)=>{let o=h()(r),l=o.data("row"),a=i[l.id];a!==void 0&&o.css("top",a-o.offset().top).animate({top:0},{progress:()=>{this._triggerRowOrderChangeAnimation(l),this.updateScrollbars()}})}))}setSortEnabled(e){this.setProperty("sortEnabled",e)}addSortColumn(e,t){this.sort(e,t,!0)}removeSortColumn(e){this.sort(e,null,!0,!0)}removeAllSortColumns(){this.columns.filter(e=>e.sortActive).forEach(this.removeSortColumn.bind(this))}visibleSortColumnsCount(){return this.visibleColumns().filter(e=>e.sortActive).length}sort(e,t,i,s){i=u.nvl(i,!1),s=u.nvl(s,!1);let r=!i;s?this._removeSortColumn(e):this._addSortColumn(e,t,i),this.header&&this.header.onSortingChanged();let o=this._sort(r),l={column:e,sortAscending:e.sortAscending};s&&(l.sortingRemoved=!0),i&&(l.multiSort=!0),o||(l.sortingRequested=!0,this._animateAggregateRows=r),this.trigger("sort",l)}_addSortColumn(e,t,i){if(t=u.nvl(t,e.sortAscending?"asc":"desc"),i=u.nvl(i,!0),this._updateSortIndexForColumn(e,i),!i){let s=this._groupedColumns().length;this._sortColumns().length===1&&s===1||(e.grouped=!1)}e.sortAscending=t==="asc",e.sortActive=!0}_updateSortIndexForColumn(e,t){let i=-1;if(t)(!e.sortActive||e.sortIndex===-1)&&(i=Math.max(-1,p.max(this.columns.map(s=>s.sortIndex===void 0||s.initialAlwaysIncludeSortAtEnd?-1:s.sortIndex))),e.sortIndex=i+1,this._permanentTailSortColumns.forEach(s=>{s.sortIndex++}));else{e.initialAlwaysIncludeSortAtBegin||e.initialAlwaysIncludeSortAtEnd||(e.sortIndex=this._permanentHeadSortColumns.length),p.eachSibling(this.columns,e,r=>{r.sortActive&&this._removeSortColumnInternal(r)});let s=e.initialAlwaysIncludeSortAtBegin||e.initialAlwaysIncludeSortAtEnd?0:1;this._permanentTailSortColumns.forEach((r,o)=>{r.sortIndex=this._permanentHeadSortColumns.length+s+o})}}_removeSortColumn(e){e.initialAlwaysIncludeSortAtBegin||e.initialAlwaysIncludeSortAtEnd||(p.eachSibling(this.columns,e,t=>{t.sortIndex>e.sortIndex&&(t.sortIndex=t.sortIndex-1)}),this._removeSortColumnInternal(e))}_removeSortColumnInternal(e){e.initialAlwaysIncludeSortAtBegin||e.initialAlwaysIncludeSortAtEnd||(e.sortActive=!1,e.grouped=!1,e.sortIndex=-1)}isGroupingPossible(e){let t=!0;return this.hierarchical||!this.sortEnabled?!1:this._permanentHeadSortColumns&&this._permanentHeadSortColumns.length===0?!0:e.initialAlwaysIncludeSortAtBegin?(t=!0,p.eachSibling(this._permanentHeadSortColumns,e,i=>{i.sortIndex<e.sortIndex&&(t=t&&i.grouped)}),t):e.initialAlwaysIncludeSortAtEnd?!1:(this._permanentHeadSortColumns.forEach(i=>{t=t&&i.grouped}),t)}isAggregationPossible(e){return!(e instanceof Bt)||e.grouped||!e.allowedAggregationFunctions||e.allowedAggregationFunctions.length<=1?!1:this.isGrouped()||this.hasAggregateTableControl()}changeAggregation(e,t){this.changeAggregations([e],[t])}changeAggregations(e,t){e.forEach((i,s)=>{let r=t[s];i.aggregationFunction!==r&&(i.setAggregationFunction(r),this._triggerAggregationFunctionChanged(i))}),this._group()}_addGroupColumn(e,t,i){let s=-1;this.isGroupingPossible(e)&&(t=u.nvl(t,e.sortAscending?"asc":"desc"),i=u.nvl(i,!0),e.initialAlwaysIncludeSortAtBegin||e.initialAlwaysIncludeSortAtEnd?e.initialAlwaysIncludeSortAtBegin&&(e.grouped=!0):(i?(s=Math.max(-1,p.max(this.columns.map(r=>r.sortIndex===void 0||r.initialAlwaysIncludeSortAtEnd||!r.grouped?-1:r.sortIndex))),e.sortActive?(p.eachSibling(this.columns,e,r=>{r.sortActive&&!(r.initialAlwaysIncludeSortAtBegin||r.initialAlwaysIncludeSortAtEnd)&&r.sortIndex>s&&r.sortIndex<e.sortIndex&&r.sortIndex++}),e.sortIndex=s+1):(e.sortIndex=s+1,p.eachSibling(this.columns,e,r=>{r.sortActive&&!(r.initialAlwaysIncludeSortAtBegin||r.initialAlwaysIncludeSortAtEnd)&&r.sortIndex>s&&r.sortIndex++}),this._permanentTailSortColumns.forEach(r=>{r.sortIndex++}))):(s=this._permanentHeadSortColumns.length,e.sortActive?(p.eachSibling(this.columns,e,r=>{r.sortActive&&!(r.initialAlwaysIncludeSortAtBegin||r.initialAlwaysIncludeSortAtEnd)&&r.sortIndex>=s&&r.sortIndex<e.sortIndex&&r.sortIndex++}),e.sortIndex=s):(p.eachSibling(this.columns,e,r=>{r.sortActive&&!(r.initialAlwaysIncludeSortAtBegin||r.initialAlwaysIncludeSortAtEnd)&&r.sortIndex>=s&&r.sortIndex++}),e.sortIndex=s,this._permanentTailSortColumns.forEach(r=>{r.sortIndex++})),p.eachSibling(this.columns,e,r=>{r.sortActive&&!(r.initialAlwaysIncludeSortAtBegin||r.initialAlwaysIncludeSortAtEnd)&&r.sortIndex>=s&&(r.grouped=!1)})),e.sortAscending=t==="asc",e.sortActive=!0),e.grouped=!0)}_removeGroupColumn(e){e.grouped=!1,e.initialAlwaysIncludeSortAtBegin&&this.columns.forEach(t=>{t.sortIndex>=e.sortIndex&&(t.grouped=!1)}),this._removeSortColumn(e)}_buildRowDiv(e){let t=this.rowWidth,i="table-row";e.cssClass&&(i+=" "+e.cssClass),e.enabled||(i+=" disabled"),e.checked&&this.checkableStyle===H.CheckableStyle.TABLE_ROW&&(i+=" checked"),e.filterAccepted||(i+=" filter-not-accepted"),this.hierarchical&&p.empty(e.childRows)&&(i+=" leaf");let s="";if(_.hasText(this.accessibilityRenderer.rowRole)){let o=this.isRowSelected(e)===!0,l=String(e.checked===!0),a=!e.enabled;if(s=' role="'+this.accessibilityRenderer.rowRole+'"',o&&(s+=' aria-selected="true"'),a&&(s+=' aria-disabled = "true"'),this.checkable&&(s+=' aria-checked="'+l+'"'),this.hierarchical&&e.expandable){let d=e.expanded;s+=' aria-expanded="'+d+'"'}}let r="<div"+s+' class="'+i+'" style="width: '+t+'px">';for(let o=0;o<this.columns.length;o++){let l=this.columns[o];l.visible&&(r+=l.buildCellForRow(e))}return r+="</div>",r}_calculateRowInsets(){let e=this.$data.appendDiv("table-row");this.rowMargins=C.margins(e),this.rowBorders=C.borders(e),e.remove()}_updateRowWidth(){this.rowWidth=this.visibleColumns().reduce((e,t)=>this.autoResizeColumns?e+t.width:e+t.realWidthIfAvailable(),this.rowBorders.horizontal())}_updateRealColumnWidths(e){if(!w.get().hasTableCellZoomBug())return!1;let t=!1;return e=e||this.$rows().eq(0),this.visibleColumns().forEach((i,s)=>{this._updateRealColumnWidth(i,s,e)&&(t=!0)}),t}_updateRealColumnWidth(e,t,i){if(!w.get().hasTableCellZoomBug())return!1;i=i||this.$rows().eq(0);let s=this.$cell(u.nvl(t,e),i);if(s.length===0&&e._realWidth!==null)return e._realWidth=null,!0;let r=C.size(s,{exact:!0}).width;return r!==e._realWidth?(e._realWidth=r,!0):!1}_updateRowHeight(){let e=this.$data.appendDiv("table-row"),t=this._build$AggregateRow().appendTo(this.$data);e.appendDiv("table-cell").html(" "),t.appendDiv("table-cell table-aggregate-cell").appendSpan("text").html(" "),this.rowHeight=this._measureRowHeight(e),this.aggregateRowHeight=this._measureRowHeight(t),e.remove(),t.remove()}_updateRowHeights(){this.rows.forEach(e=>{e.$row?e.height=this._measureRowHeight(e.$row):e.height=null}),this._aggregateRows.forEach(e=>{e.$row?e.height=this._measureRowHeight(e.$row):e.height=null})}_renderRowsInRange(e){let t="",i=0,s=!1,r=this.visibleRows;if(r.length===0)return;if(e=new U(0,this.rows.length).intersect(e),this.viewRangeRendered.size()>0&&!e.intersect(this.viewRangeRendered).equals(new U(0,0)))throw new Error("New range must not intersect with existing.");e.to<=this.viewRangeRendered.from&&(s=!0);let l=this.viewRangeRendered.union(e);if(l.length===2)throw new Error("Can only prepend or append rows to the existing range. Existing: "+this.viewRangeRendered+". New: "+l);this.viewRangeRendered=l[0],this._removeEmptyData();for(let d=e.from;d<e.to;d++){let c=r[d];t+=this._buildRowDiv(c),i++}let a=this.$data.makeElement(t);s?this.$fillBefore?a=a.insertAfter(this.$fillBefore):a=a.prependTo(this.$data):this.$fillAfter?a=a.insertBefore(this.$fillAfter):a=a.appendTo(this.$data),a.each((d,c)=>{let f=h()(c);this.viewRangeRendered.size()===i&&this._updateRealColumnWidths(f)&&(this._updateRowWidth(),this.header&&this.header.rendered&&this.header.resizeHeaderItems()),f.cssWidth(this.rowWidth);let g=r[e.from+d];H.linkRowToDiv(g,f),this._installRow(g)}),h().log.isTraceEnabled()&&(h().log.trace(i+" new rows rendered from "+e),h().log.trace(this._rowsRenderedInfo()))}_rowsRenderedInfo(){let e=this.$rows().length,t="("+this.viewRangeRendered+")";return e+" rows rendered "+t}moveRowToTop(e){let t=this.rows.indexOf(e);return t<0?!1:this.moveRow(t,0)}moveRowToBottom(e){let t=this.rows.indexOf(e);return t<0?!1:this.moveRow(t,this.rows.length-1)}moveRowUp(e){return this.moveRowUpOrDown(e,"up")}moveRowDown(e){return this.moveRowUpOrDown(e,"down")}moveVisibleRowUp(e){return this.moveVisibleRowUpOrDown(e,"up")}moveVisibleRowDown(e){return this.moveVisibleRowUpOrDown(e,"down")}moveRowsUpOrDown(e,t){if(!e)return[];e=e.slice();let i=[];return p.sortBy(e,this.rows,t==="up"?"asc":"desc"),e.some(s=>this.moveRowUpOrDown(s,t)?(t==="up"?i.push(s):i.unshift(s),!1):!0),i}moveRowUpOrDown(e,t){const i=this.rows.indexOf(e);if(i<0)return!1;let r=i+(t==="up"?-1:1);if(this.hierarchical){const o=this._findSiblingWithSameParent(e,t);if(!o)return!1;r=this.rows.indexOf(o)}return this.moveRow(i,r)}moveVisibleRowUpOrDown(e,t){const i=this.rows.indexOf(e);if(i<0)return!1;let s,r;if(this.hierarchical)r=this._findSiblingWithSameParent(e,t,this.visibleRows);else{const o=t==="up"?-1:1,l=this.visibleRows.indexOf(e);r=this.visibleRows[l+o]}return r?(s=this.rows.indexOf(r),this.moveRow(i,s)):!1}_findSiblingWithSameParent(e,t,i){i=i||this.rows;const s=i.filter(l=>e.parentRow===l.parentRow),r=s.indexOf(e);return s[r+(t==="up"?-1:1)]}moveRow(e,t){let i=this.rows.length;return e=Math.max(e,0),e=Math.min(e,i-1),t=Math.max(t,0),t=Math.min(t,i-1),e===t?!1:(p.move(this.rows,e,t),this.updateRowOrder(this.rows),!0)}_removeRowsInRange(e){let t=0,i=this.visibleRows;e=new U(0,i.length).intersect(e);let r=this.viewRangeRendered.subtract(e);if(r.length===2)throw new Error("Can only remove rows at the beginning or end of the existing range. "+this.viewRangeRendered+". New: "+r);this.viewRangeRendered=r[0];for(let o=e.from;o<e.to;o++){let l=i[o];this._removeRow(l),t++}h().log.isTraceEnabled()&&(h().log.trace(t+" rows removed from "+e+"."),h().log.trace(this._rowsRenderedInfo()))}removeAllRows(){this._removeAllRows()}_removeAllRows(){this._isDataRendered()&&this.$rows().each((e,t)=>{let i=h()(t);if(i.hasClass("hiding"))return;let s=i.data("row");this._removeRow(s)}),this.viewRangeRendered=new U(0,0)}_removeRows(e){if(!e){this._removeAllRows();return}let t=this.isAttachedAndRendered();e=p.ensure(e),e.forEach(i=>{let s=this.visibleRows.indexOf(i);if(s===-1)return;let r=!!i.$row,o=this.viewRangeRendered.contains(s);if(t){if(!r&&o)throw new Error("Inconsistency found while removing row. Row is undefined but inside rendered view range. RowIndex: "+s);if(r&&!o)throw new Error("Inconsistency found while removing row. Row is rendered but not inside rendered view range. RowIndex: "+s)}this._removeRow(i),(o||s<this.viewRangeRendered.from)&&(s<this.viewRangeRendered.from?(this.viewRangeRendered.from--,this.viewRangeRendered.to--):s<=this.viewRangeRendered.to&&this.viewRangeRendered.to--)})}_removeRow(e){let t=e.$row;if(!t)return;let i=this.$data.data("tooltipSupport");t.isOrHas(i?.tooltip?.$anchor)&&i.close(),this._destroyTooltipsForRow(e),this._destroyCellEditorForRow(e),t.hasClass("hiding")||(t.remove(),e.$row=null)}_showRow(e){let t=e.$row;t&&(t.is(".showing")||(t.hide(),t.addClass("showing"),t.removeClass("hiding"),t.stop().slideDown({duration:250,complete:()=>{t.removeClass("showing"),this.updateScrollbars()}})))}_hideRow(e){let t=e.$row;t&&(t.is(".hiding")||(t.addClass("hiding"),t.removeClass("showing"),t.stop().slideUp({duration:250,complete:()=>{e.$row&&(t.remove(),t[0]===e.$row[0]&&(e.$row=null),this.updateScrollbars())}})))}_installRow(e){if(e.height=this._measureRowHeight(e.$row),e.hasError&&this._showCellErrorForRow(e),this.cellEditorPopup&&!this.cellEditorPopup.rendered&&this.cellEditorPopup.row.id===e.id){let t=this.cellEditorPopup.cell.field;this.startCellEdit(this.cellEditorPopup.column,e,t)}}_calcRowLevelPadding(e){return e?this._calcRowLevelPadding(e.parentRow)+this.rowLevelPadding:-this.rowLevelPadding}_showCellErrorForRow(e){for(let t of this.visibleColumns()){let i=this.cell(t,e);i.errorStatus&&this._showCellError(e,this.$cell(t,e.$row),i.errorStatus)}}_showCellError(e,t,i){let s=i.message,r=u.create(Bd,{parent:this,text:s,autoRemove:!1,$anchor:t,table:this});r.render(),r.row=e,this.tooltips.push(r)}_columnAtX(e){let t=0,i=this.$data.offset().left+C.insets(this.$data).left+this.rowBorders.left+this.rowMargins.left,s=this.$data.scrollLeft();if(e<i)return this.columns[0];i-=s;let r=this.visibleColumns(),o=p.find(r,l=>{if(t=i+l.width,e>=i&&e<t)return!0;i=t});return o||(o=r[r.length-1]),o}_find$AppLink(e){let t=h()(e.target),i=h()(e.delegateTarget),s=t.findUp(r=>r.hasClass("app-link"),i);return s.length>0?s:null}_filterMenus(e,t,i,s,r){return $e.filterAccordingToSelection("Table",this.selectedRows.length,e,t,{onlyVisible:i,enableDisableKeyStrokes:s,notAllowedTypes:r,defaultMenuTypes:this.defaultMenuTypes})}_filterMenusForContextMenu(){return this._filterMenus(this.menus,Ft.CONTEXT_MENU,!0,!1,["Header"])}setStaticMenus(e){this.setProperty("staticMenus",e),this._updateMenuBar()}_removeMenus(){}notifyRowSelectionFinished(){this._triggerRowsSelectedPending&&(this._triggerRowsSelected(),this._triggerRowsSelectedPending=!1),this.session.onRequestsDone(()=>{this._updateMenuBar(),this._updateMenusEnabled()})}_triggerRowClick(e,t,i,s){this.trigger("rowClick",{originalEvent:e,row:t,mouseButton:i,column:s})}focusCell(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=this.cell(e,t);this.enabledComputed&&t.enabled&&s.editable&&this.prepareCellEdit(e,t,i)}prepareCellEdit(e,t,i){let s=h().resolvedPromise();return this.cellEditorPopup&&(s=this.cellEditorPopup.waitForCompleteCellEdit()),s.then(this.prepareCellEditInternal.bind(this,e,t,i))}prepareCellEditInternal(e,t,i){if(this.openFieldPopupOnCellEdit=u.nvl(i,!1),!this.trigger("prepareCellEdit",{column:e,row:t}).defaultPrevented){this.selectRow(t);let r=e.createEditor(t);this.startCellEdit(e,t,r)}}cell(e,t){return!e||!t?null:e===this.rowIconColumn?u.create(_t,{iconId:t.iconId,cssClass:_.join(" ","row-icon-cell",t.cssClass)}):e===this.checkableColumn?u.create(_t,{value:t.checked,editable:!0,cssClass:t.cssClass}):e===this.compactColumn?u.create(_t,{text:t.compactValue,htmlEnabled:!0}):t.cells[e.index]}cellByCellIndex(e,t){return this.cell(this.columns[e],t)}cellValue(e,t){let i=this.cell(e,t);return i&&(i.value!==void 0?i.value:null)}cellText(e,t){let i=this.cell(e,t);return i&&i.text||""}nextEditableCellPos(e,t,i){let s=this.columns.indexOf(e),r=s+1;i&&(r=s-1);let o=this.nextEditableCellPosForRow(r,t,i);if(o)return o;let l=c=>{if(!c.$row)return!1;if(r=0,i&&(r=this.columns.length-1),o=this.nextEditableCellPosForRow(r,c,i),o)return!0},a=this.rows.indexOf(t),d=a+1;return i&&(d=a-1),p.findFrom(this.rows,d,l,i),o}nextEditableCellPosForRow(e,t,i){let s=o=>{if(!o.visible||o.guiOnly)return!1;let l=this.cell(o,t);return this.enabledComputed&&t.enabled&&l.editable},r=p.findFrom(this.columns,e,s,i);if(r)return{column:r,row:t}}clearAggregateRows(e){this._aggregateRows.forEach(t=>{t.prevRow&&(t.prevRow.aggregateRowAfter=null),t.nextRow&&(t.nextRow.aggregateRowBefore=null)}),this._isDataRendered()&&(this._removeAggregateRows(e),this._renderSelection()),this._aggregateRows=[]}_forEachVisibleColumn(e,t,i){let s;this.visibleColumns().forEach((r,o)=>{r[e]?(i&&(s=r.cellValueOrTextForCalculation(i)),t[o]=r[e](t[o],s)):t[o]=void 0})}_group(e){let t,i,s=this._groupedColumns(),r=this.groupingStyle===H.GroupingStyle.TOP,o=[];if(this.clearAggregateRows(),!s.length)return;let l=this.visibleRows;this._forEachVisibleColumn("aggrStart",o),l.forEach((a,d)=>{t||(t=a),this._forEachVisibleColumn("aggrStep",o,a);let c=l[d+1];(d===l.length-1||this._isNewGroup(s,a,c))&&(this._forEachVisibleColumn("aggrFinish",o),this._addAggregateRow(o,r?i:a,r?t:c),this._forEachVisibleColumn("aggrStart",o),t=null,i=a)}),this._isDataRendered()&&(this._renderAggregateRows(e),this._renderSelection())}_isNewGroup(e,t,i){let s=!1;if(!i)return!0;for(let r=0;r<e.length;r++){let o=e[r],l=o&&o.cellTextForGrouping&&typeof o.cellTextForGrouping=="function";if(s=s||l&&o.cellTextForGrouping(t)!==o.cellTextForGrouping(i),s=s||!l&&this.cellText(o,t)!==this.cellText(o,i),s)return!0}return!1}_groupedColumns(){return this.columns.filter(e=>e.grouped)}_addAggregateRow(e,t,i){let s={contents:e.slice(),prevRow:t,nextRow:i};this._aggregateRows.push(s),t&&(t.aggregateRowAfter=s),i&&(i.aggregateRowBefore=s)}_removeAggregateRows(e){this._aggregateRows.length!==0&&(e=u.nvl(e,!1),e?this._aggregateRows.forEach(t=>this._hideRow(t)):(this._aggregateRows.forEach(t=>this._removeRow(t)),this.updateScrollbars()))}_renderAggregateRows(e){let t=this.groupingStyle===H.GroupingStyle.TOP,i=t?"insertBefore":"insertAfter";e=u.nvl(e,!1),this._aggregateRows.forEach(s=>{let r=t?s.nextRow:s.prevRow;if(!r||!r.$row){s.$row&&this._removeRow(s);return}if(s.$row)return;let o=this._build$AggregateRow(s);o[i](r.$row).width(this.rowWidth),this.visibleColumns().map(l=>h()(l.buildCellForAggregateRow(s)).appendTo(o)).forEach(l=>this._resizeAggregateCell(l)),s.height=this._measureRowHeight(o),s.$row=o,e&&this._showRow(s)})}_build$AggregateRow(e){let t=this.groupingStyle===H.GroupingStyle.TOP,i=this.$container.makeDiv("table-aggregate-row").data("aggregateRow",e);return this.accessibilityRenderer.renderRow(i),T.description(i,this.session.text("ui.Aggregation")),i.toggleClass("grouping-style-top",t),i.toggleClass("grouping-style-bottom",!t),i}addGroupColumn(e,t){this.group(e,t,!0)}removeGroupColumn(e){this.group(e,null,!0,!0)}removeAllGroupColumns(){this.columns.filter(e=>e.grouped).forEach(this.removeGroupColumn.bind(this))}visibleGroupColumnsCount(){return this.visibleColumns().filter(e=>e.grouped).length}groupColumn(e,t,i,s){this.group(e,i,t)}group(e,t,i,s){if(i=u.nvl(i,!1),s=u.nvl(s,!1),s&&this._removeGroupColumn(e),!this.isGroupingPossible(e))return;s||this._addGroupColumn(e,t,i),this.header&&this.header.onSortingChanged();let r=this._sort(!0),o={column:e,groupAscending:e.sortAscending};s&&(o.groupingRemoved=!0),i&&(o.multiGroup=!0),r||(o.groupingRequested=!0,this._animateAggregateRows=!0),this.trigger("group",o)}removeColumnGrouping(e){this.removeGroupColumn(e)}removeAllColumnGroupings(){this.removeAllGroupColumns()}isGrouped(){return this.columns.some(e=>e.grouped)}setColumnBackgroundEffect(e,t){e.setBackgroundEffect(t)}_updateBackgroundEffect(){this.columns.forEach(e=>{e.backgroundEffect&&e.updateBackgroundEffect()})}_calculateValuesForBackgroundEffect(){this.columns.forEach(e=>{e.backgroundEffect&&e.calculateMinMaxValues()})}_markAutoOptimizeWidthColumnsAsDirty(){this.columns.forEach(e=>{e.autoOptimizeWidthRequired=!0})}_markAutoOptimizeWidthColumnsAsDirtyIfNeeded(e,t,i){let s=!1;for(let r=e.length-1;r>=0;r--){let o=e[r];this.cellValue(o,t)!==this.cellValue(o,i)&&(o.autoOptimizeWidthRequired=!0,e.splice(r,1),s=!0)}return s}setMultiCheck(e){this.setProperty("multiCheck",e)}checkedRow(){return this.rows.find(e=>e.checked)}checkedRows(){return this.rows.filter(e=>e.checked)}checkRow(e,t,i){let s=h().extend(i,{checked:t});this.checkRows([e],s)}checkRows(e,t){let i=h().extend({checked:!0,checkOnlyEnabled:!0},t),s=[];!this.checkable||!this.enabledComputed&&i.checkOnlyEnabled||(e=p.ensure(e),e.forEach(r=>{if(!(!r.enabled&&i.checkOnlyEnabled||r.checked===i.checked)){if(!this.multiCheck&&i.checked)for(let o=0;o<this.rows.length;o++)this.rows[o].checked&&(this.rows[o].checked=!1,s.push(this.rows[o]));r.checked=i.checked,s.push(r)}}),this._isDataRendered()&&s.forEach(r=>this._renderRowChecked(r)),this._triggerRowsChecked(s))}uncheckRow(e,t){this.uncheckRows([e],t)}uncheckRows(e,t){let i=h().extend({checked:!1},t);this.checkRows(e,i)}isTableNodeColumn(e){return this.hierarchical&&this.tableNodeColumn===e}collapseRow(e){this.collapseRows(p.ensure(e))}collapseAll(){this.expandRowsInternal(this.rootRows,!1,!0)}expandAll(){this.expandRowsInternal(this.rootRows,!0,!0)}collapseRows(e,t){this.expandRowsInternal(e,!1,t)}expandRow(e,t){this.expandRows(p.ensure(e),t)}expandRows(e,t){this.expandRowsInternal(e,!0,t)}expandRowsInternal(e,t,i){let s=[],r=[];e=e||this.rootRows,t=u.nvl(t,!0),i=u.nvl(i,!1),i?this.visitRows(o=>{o.expanded!==t&&(o.expanded=t,s.push(o),o.$row&&r.push(o))},e):s=e.filter(o=>{let l=o.expanded!==t;return l&&o.$row&&r.push(o),o.expanded=t,l}),s.length!==0&&(this._updateRowStructure({visibleRows:!0}),this._triggerRowsExpanded(s),this._isDataRendered()&&(this._renderRowDelta(),r.forEach(o=>o.animateExpansion()),e[0].$row&&P.ensureExpansionVisible({element:e[0],$element:e[0].$row,$scrollable:this.get$Scrollable(),isExpanded:o=>o.expanded,getChildren:o=>o.childRows.filter(l=>l.filterAccepted),defaultChildHeight:this.rowHeight})))}doRowAction(e,t){if(this.selectedRows.length!==1||this.selectedRows[0]!==e||(t=t||this.columns[0],!e||!t))return;!this.trigger("rowAction",{column:t,row:e}).defaultPrevented&&this.defaultRowAction&&this.defaultRowAction.doAction()}insertRow(e){this.insertRows([e])}insertRows(e){let t=p.ensure(e);if(t.length===0)return;let i=this.rows.length===0;t.forEach((r,o)=>{let l=this._initRow(r);l.status=Rt.Status.INSERTED,t[o]=l,this.rows.push(l)});let s=t;this.filterSupport.applyFilters(s),this._updateRowStructure({updateTree:!0,filteredRows:!0,applyFilters:!1,visibleRows:!0}),this.filterCount()>0&&s.some(r=>r.filterAccepted)&&this._triggerFilter(),this._calculateValuesForBackgroundEffect(),this._markAutoOptimizeWidthColumnsAsDirty(),this._triggerRowsInserted(s),this._sortAfterInsert(i),this._isDataRendered()&&(this.hierarchical&&this._renderRowOrderChanges(),this._insertedRows?p.pushAll(this._insertedRows,s):(this._insertedRows=s,setTimeout(()=>{this._insertedRows=null},0)),this.viewRangeDirty=!0,this._renderViewport(),this.invalidateLayoutTree())}_sortAfterInsert(e){this._sort()}_sortWhileInit(){this._sort()}replaceRows(e){const t=this.getSelectedKeys(),i=this.scrollTop;this.deleteAllRows(),this.insertRows(e),this.restoreSelection(t),this._restoreScrollTop(i)}_restoreScrollTop(e){if(this.updateBuffer.isBuffering()){this.updateBuffer.one("complete",()=>this._restoreScrollTop(e));return}this._setScrollTop(e),this.rendered&&this._renderScrollTop()}deleteRow(e){this.deleteRows([e])}deleteRows(e){if(e=p.ensure(e),e.length===0)return;let t,i,s=[];this.visitRows(r=>{this.rowsMap[r.id]&&(s.push(r),this._isDataRendered()&&(this.cellEditorPopup&&this.cellEditorPopup.row.id===r.id&&this.cellEditorPopup.cancelEdit(),this._removeRows(r),t=!0),p.remove(this.rows,r),p.remove(this.visibleRows,r),this.filterCount()>0&&p.remove(this._filteredRows,r)&&(i=!0),delete this.rowsMap[r.id],this.selectionHandler.lastActionRow===r&&this.selectionHandler.clearLastSelectedRowMarker())},e),this.deselectRows(s),this._updateRowStructure({updateTree:!0,filteredRows:!0,applyFilters:!1,visibleRows:!0}),i&&this._triggerFilter(),this._group(),this._updateBackgroundEffect(),this._markAutoOptimizeWidthColumnsAsDirty(),this._triggerRowsDeleted(e),t&&(this._renderViewport(),this._renderRangeMarkers(),this._renderFiller(),this._renderEmptyData(),this.invalidateLayoutTree())}deleteAllRows(){let e=this.filterCount()>0&&this._filteredRows.length>0,t=this.rows;this._isDataRendered()&&(this.cellEditorPopup&&this.cellEditorPopup.cancelEdit(),this.selectionHandler.clearLastSelectedRowMarker(),this._removeRows()),this.rows=[],this.rowsMap={},this._filteredRows=[],this.deselectAll(),this._updateRowStructure({updateTree:!0,filteredRows:!0,applyFilters:!1,visibleRows:!0}),e&&this._triggerFilter(),this._markAutoOptimizeWidthColumnsAsDirty(),this._group(),this._updateBackgroundEffect(),this._triggerAllRowsDeleted(t),this._isDataRendered()&&(this._renderFiller(),this._renderViewport(),this._renderEmptyData(),this.invalidateLayoutTree())}updateRow(e){this.updateRows([e])}updateRows(e){if(e=p.ensure(e),e.length===0)return;if(this.updateBuffer.isBuffering()){this.updateBuffer.buffer(e);return}let t,i,s,r=this.columns.filter(c=>c.autoOptimizeWidth&&!c.autoOptimizeWidthRequired),o={};this.rows.forEach((c,f)=>{o[c.id]=f});let l={},a=!1,d=e.map(c=>{let f=c.parentRow,g=this.rowsMap[c.id];if(!g)throw new Error("Update event received for non existing row. RowId: "+c.id);l[c.id]=g,c.parentRow&&(typeof c.parentRow=="string"?f=c.parentRow:b.isNullOrUndefined(c.parentRow.id)||(f=c.parentRow.id)),a=a||u.nvl(g._parentRowId,null)!==u.nvl(f,null),i=i||g.expanded!==u.nvl(c.expanded,!1);let y=this._initRow(c);return y.status===Rt.Status.NON_CHANGED&&y.cells.some((v,D)=>{let k=g.cells[D];return!k||k.value!==v.value?(y.status=Rt.Status.UPDATED,!0):!1}),this.selectionHandler.lastActionRow===g&&(this.selectionHandler.lastActionRow=y),p.replace(this.selectedRows,g,y),this.rows[o[y.id]]=y,y.filterAccepted=g.filterAccepted,this.filterCount()>0&&(t=this._applyFiltersForRow(y)||t),s=this._markAutoOptimizeWidthColumnsAsDirtyIfNeeded(r,g,y),y});this._updateRowStructure({updateTree:!0,filteredRows:!0,applyFilters:!1,visibleRows:!0}),this._updateMenusEnabled(),this._triggerRowsUpdated(d),this._isDataRendered()&&(this._renderUpdateRows(d,l),a&&this._renderRowOrderChanges()),t&&this._triggerFilter(),(t||i)&&this._renderRowDelta(),this._sortAfterUpdate(),this._updateBackgroundEffect(),this.invalidateLayoutTree()}_renderUpdateRows(e,t){let i=this.$data.data("tooltipSupport");e.forEach(s=>{let r=t[s.id];if(!r.$row||r.$row.hasClass("hiding"))return;let o=h()(this._buildRowDiv(s));o.copyCssClasses(r.$row,H.SELECTION_CLASSES+" first last");let l=null;if(i?.tooltip){let d=r.$row.children(".table-cell").index(i.tooltip.$anchor);d!==-1&&(l=o.children(".table-cell").eq(d))}r.$row.replaceWith(o),H.linkRowToDiv(s,o),this._destroyTooltipsForRow(s),this._destroyCellEditorForRow(s),this._installRow(s),l?.length&&i.update(l),r.$row.hasClass("showing")&&r.$row.outerHeight()<s.$row.outerHeight()/3&&this._showRow(s)})}_sortAfterUpdate(){this._sort()}isHierarchical(){return this.hierarchical}_setHierarchical(e){this.hierarchical!==e&&(e&&this.removeAllGroupColumns(),e&&!(this.accessibilityRenderer instanceof zl)&&(this.accessibilityRenderer=new zl),this._setProperty("hierarchical",e))}updateRowOrder(e){if(e=p.ensure(e),e.length!==this.rows.length)throw new Error("Row order may not be updated because lengths of the arrays differ.");this.rows=e.slice(),this._updateRowStructure({updateTree:!0,filteredRows:!0,applyFilters:!1,visibleRows:!0}),this.clearAggregateRows(this._animateAggregateRows),this._triggerRowOrderChanged(),this._isDataRendered()&&this._renderRowOrderChanges(),this._group(this._animateAggregateRows),this._animateAggregateRows=!1}_destroyTooltipsForRow(e){for(let t=this.tooltips.length-1;t>=0;t--)this.tooltips[t].row.id===e.id&&(this.tooltips[t].destroy(),this.tooltips.splice(t,1))}_destroyCellEditorForRow(e){this.cellEditorPopup&&this.cellEditorPopup.rendered&&this.cellEditorPopup.row.id===e.id&&this.cellEditorPopup.destroy()}startCellEdit(e,t,i){if(i.destroyed)return;if(!this._isDataRendered()){this._postRenderActions.push(this.startCellEdit.bind(this,e,t,i));return}if(!this.$container.isAttached()){this._postAttachActions.push(this.startCellEdit.bind(this,e,t,i));return}if(this.updateBuffer.isBuffering()){this.updateBuffer.one("complete",()=>this.startCellEdit(e,t,i));return}this.trigger("startCellEdit",{column:e,row:t,field:i}),this.ensureRowRendered(t);let s=e.startCellEdit(t,i);return this.cellEditorPopup=s,this.$container.toggleClass("has-cell-editor-popup",!!s),s.rendered||this.cancelCellEdit(),s}endCellEdit(e,t){if(!this.cellEditorPopup){e.destroy();return}this._destroyCellEditorPopup(this._updateCellFromEditor.bind(this,this.cellEditorPopup,e,t))}_updateCellFromEditor(e,t,i){i=u.nvl(i,!1),i&&e.column.updateCellFromEditor(e.row,t),t.destroy()}completeCellEdit(){if(!this.cellEditorPopup)return;let e=this.cellEditorPopup.cell.field;this.trigger("completeCellEdit",{field:e,row:this.cellEditorPopup.row,column:this.cellEditorPopup.column,cell:this.cellEditorPopup.cell}).defaultPrevented||this.endCellEdit(e,!0)}cancelCellEdit(){if(!this.cellEditorPopup)return;let e=this.cellEditorPopup.cell.field;this.trigger("cancelCellEdit",{field:e,row:this.cellEditorPopup.row,column:this.cellEditorPopup.column,cell:this.cellEditorPopup.cell}).defaultPrevented||this.endCellEdit(e)}scrollTo(e,t){this.viewRangeRendered.size()!==0&&(this.ensureRowRendered(e),e.$row&&P.scrollTo(this.$data,e.$row,t))}scrollPageUp(){let e=Math.max(0,this.$data[0].scrollTop-this.$data.height());this.setScrollTop(e)}scrollPageDown(){let e=Math.min(this.$data[0].scrollHeight,this.$data[0].scrollTop+this.$data.height());this.setScrollTop(e)}setScrollTop(e){this.setProperty("scrollTop",e),this._isDataRendered()&&this._renderViewport()}_renderScrollTop(){this.rendering||P.scrollTop(this.get$Scrollable(),this.scrollTop)}get$Scrollable(){return this.$data?this.$data:this.$container}setScrollToSelection(e){this.setProperty("scrollToSelection",e)}revealSelection(){if(!this._isDataRendered()){this.session.layoutValidator.schedulePostValidateFunction(this.revealSelection.bind(this));return}this.selectedRows.length>0&&this.scrollTo(this.selectedRows[0])}revealChecked(){let e=p.find(this.rows,t=>t.checked);e&&this.scrollTo(e)}rowById(e){return this.rowsMap[e]}rowsByIds(e){return e.map(this.rowById.bind(this))}rowsToIds(e){return e.map(t=>t.id)}hasRow(e){return!!this.rowsMap[e?.id]}_renderSelection(e){e=p.ensure(e||this.selectedRows);let t=(i,s,r)=>{let o=i.hasClass(r);return s&&!o?(i.addClass(r),1):!s&&o?(i.removeClass(r),1):0};this._renderNoRowsSelectedMarker();for(let i=0;i<e.length;i++){let s=e[i];if(!s.$row)continue;let r=this.selectedRows.indexOf(s)!==-1,o=this.visibleRows,l=o.indexOf(s)-1,a=l>=0&&this.selectedRows.indexOf(o[l])!==-1,d=o.indexOf(s)+1,c=d<o.length&&this.selectedRows.indexOf(o[d])!==-1;r&&a&&s.aggregateRowBefore&&(a=!1),r&&c&&s.aggregateRowAfter&&(c=!1),T.selected(s.$row,r||null);let f=t(s.$row,r,"selected")+t(s.$row,r&&!a&&c,"select-top")+t(s.$row,r&&a&&!c,"select-bottom")+t(s.$row,r&&!a&&!c,"select-single")+t(s.$row,r&&a&&c,"select-middle");f>0&&a&&e.indexOf(o[l])===-1&&e.push(o[l]),f>0&&c&&e.indexOf(o[d])===-1&&e.push(o[d])}this.cellEditorPopup&&this.cellEditorPopup.rendered&&this.selectedRows.indexOf(this.cellEditorPopup.row)>-1&&(this.cellEditorPopup.position(),this.cellEditorPopup.pack())}_removeSelection(){this.$container.addClass("no-rows-selected"),this.selectedRows.forEach(e=>{e.$row&&(e.$row.select(!1),e.$row.toggleClass(H.SELECTION_CLASSES,!1),T.selected(e.$row,null))})}_renderNoRowsSelectedMarker(){this.$container.toggleClass("no-rows-selected",this.selectedRows.length===0)}addRowToSelection(e,t){this.selectedRows.indexOf(e)>-1||(t=t!==void 0?t:!0,this.selectedRows.push(e),e.$row&&this._isDataRendered()&&(e.$row.select(!0),this._renderSelection(e),this.scrollToSelection&&this.revealSelection()),this._triggerRowsSelectedPending=!0,t||this.notifyRowSelectionFinished())}removeRowFromSelection(e,t){t=t!==void 0?t:!0,p.remove(this.selectedRows,e)&&(this._isDataRendered()&&this._renderSelection(e),t?this._triggerRowsSelectedPending=!0:this._triggerRowsSelected())}selectRow(e,t){this.selectRows(e,t)}selectRows(e,t){e=p.ensure(e).filter(s=>!!this.visibleRowsMap[s.id]),!p.equalsIgnoreOrder(e,this.selectedRows)&&(this._isDataRendered()&&this._removeSelection(),!this.multiSelect&&e.length>1&&(e=[e[0]]),this.selectedRows=e,this._triggerRowsSelected(t),this._updateMenusEnabled(),this._updateMenuBar(),this._isDataRendered()&&(this._renderSelection(),this.scrollToSelection&&this.revealSelection()))}deselectRow(e){this.deselectRows(e)}deselectRows(e){e=p.ensure(e);let t=this.selectedRows.slice();p.removeAll(t,e)&&this.selectRows(t)}isRowSelected(e){return this.selectedRows.indexOf(e)>-1}restoreSelection(e){const t=this.getRowsByKey(e);this.expandParentRows(t),this.selectRows(t)}expandParentRows(e){if(!this.hierarchical||p.empty(e))return;const t=new Set,i=new Set(e);for(const s of i){const r=s.parentRow;r&&(t.add(r),i.add(r))}this.expandRows([...t])}getSelectedKeys(){return this.selectedRows?.length?this.selectedRows.map(e=>e.getKeyValues()):[]}getRowsByKey(e){if(!e?.length)return[];e=[...e];const t=[];for(const i of this.rows){let s=-1;try{s=e.findIndex(r=>b.equalsRecursive(r,i.getKeyValues()))}catch(r){h().log.warn("Unable to find row.",r)}if(s!==-1&&(e.splice(s,1),t.push(i),!e.length))break}return t}getRowByKey(e){return e?this.getRowsByKey([e])[0]:null}filterCount(){return this.filters.length}filteredRows(){return this._filteredRows}$rows(e){let t=".table-row";return e&&(t+=", .table-aggregate-row"),this.$data.find(t)}$aggregateRows(){return this.$data.find(".table-aggregate-row")}selectedRow(){return this.selectedRows.length>0?this.selectedRows[0]:null}selectedRowsSorted(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"asc";return p.sortBy(this.selectedRows.slice(),this.rows,e)}$selectedRows(){return this.$data?this.$data.find(".selected"):h()()}$cellsForColIndex(e,t){let i=".table-row > div:nth-of-type("+e+")";return t&&(i+=", .table-aggregate-row > div:nth-of-type("+e+")"),this.$data.find(i)}$cellsForRow(e){return e.children(".table-cell")}$cell(e,t){let i;return typeof e!="number"?i=this.visibleColumns().indexOf(e):i=e,t.children(".table-cell").eq(i)}columnById(e,t){return p.find(this.columns,i=>i.id===e)}columnByUuid(e,t){return p.find(this.columns,i=>i.buildUuid()===e)}columnFor$Cell(e,t){t=t||e.parent();let i=this.$cellsForRow(t).index(e);return this.visibleColumns()[i]}columnsByIds(e){return e.map(t=>this.columnById(t))}getVisibleRows(){return this.visibleRows}_updateRowStructure(e){let t=u.nvl(e.updateTree,!1),i=u.nvl(e.filteredRows,t),s=u.nvl(e.applyFilters,i),r=u.nvl(e.filtersChanged,!1),o=u.nvl(e.visibleRows,i);t&&this._rebuildTreeStructure(),i&&this._updateFilteredRows(s,r),o&&this._updateVisibleRows()}_rebuildTreeStructure(){let e=!1;if(this.rows.forEach(t=>{t.childRows=[],e=e||!b.isNullOrUndefined(t.parentRow)}),!e){this.rootRows=this.rows,this._setHierarchical(e);return}this._setHierarchical(e),this.rootRows=[],this.rows.forEach(t=>{let i;if(b.isNullOrUndefined(t.parentRow)){t.parentRow=null,t._parentRowId=null,this.rootRows.push(t);return}if(!b.isNullOrUndefined(t.parentRow.id))i=this.rowsMap[t.parentRow.id];else{let s=t.parentRow;i=this.rowsMap[s]}if(i)t.parentRow=i,t._parentRowId=i.id,i.childRows.push(t);else throw new Error("Parent row "+t.parentRow+" of row "+t.id+" cannot be resolved.")}),this._maxLevel=0,this.rows=[],this.visitRows((t,i)=>{t.hierarchyLevel=i,this._maxLevel=Math.max(i,this._maxLevel),this.rows.push(t)}),this._calculateTableNodeColumn()}_updateFilteredRows(e,t){t=!!t,e=u.nvl(e,!0),this._filteredRows=this.rows.filter(i=>(e&&(t=this._applyFiltersForRow(i)||t),i.filterAccepted)),t&&this._triggerFilter()}_updateVisibleRows(){if(this.visibleRows=this._computeVisibleRows(),this.visibleRowsMap=this.visibleRows.reduce((e,t)=>(e[t.id]=t,e),{}),this.initialized){let e=this.selectedRows.filter(t=>!this.visibleRowsMap[t.id]);this.deselectRows(e)}}_computeVisibleRows(e){let t=[];return e=e||this.rootRows,e.forEach(i=>{let s=this._computeVisibleRows(i.childRows);(i.filterAccepted||s.length>0)&&t.push(i),i.expandable=s.length>0,i.expanded&&(t=t.concat(s))}),t}visibleChildRows(e){return e.childRows.filter(t=>!!this.visibleRowsMap[t.id])}_renderRowDelta(){if(!this._isDataRendered())return;let e=[],t=[];this.$rows().each((i,s)=>{let r=h()(s),o=r.data("row");this.visibleRows.indexOf(o)<0?(o.$row.detach(),t.push(o)):r.hasClass("hiding")?r.stop(!1,!0):e.push(o)}),this._rerenderViewport(),t.forEach(i=>i.$row.insertAfter(this.$fillBefore)),this._order$Rows().insertAfter(this.$fillBefore),this._order$AggregateRows(),t.forEach(i=>this._hideRow(i)),this.$rows().each((i,s)=>{let r=h()(s),o=r.data("row");r.hasClass("hiding")||e.indexOf(o)<0&&this._showRow(o)}),this._renderScrollTop(),this._renderEmptyData()}_order$Rows(e){return e=e||this.$rows(),e.sort((t,i)=>{let s=h()(t),r=h()(i),o=s.data("row"),l=r.data("row");return this.rows.indexOf(o)-this.rows.indexOf(l)})}_order$AggregateRows(e){e=e||this.$aggregateRows(),e.each((t,i)=>{let s=h()(i),r=s.data("aggregateRow");!r||!r.prevRow||s.insertAfter(r.prevRow.$row)})}_applyFiltersForRow(e){return this.filterSupport.applyFiltersForElement(e)}filteredBy(){let e=[];return this.filters.forEach(t=>{t instanceof ft&&e.push(t.createLabel())}),e}resetUserFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=this.filters.filter(i=>!(i instanceof ft));this.setFilters(t,e)}hasUserFilter(){return this.filters.filter(e=>e instanceof ft).length>0}applyUserFilterStates(e){let t=this.filters.filter(i=>!(i instanceof ft));p.ensure(e).forEach(i=>{for(let s of Ot.all()){let r=s.tryFromDo(this,i);if(r){t.push(r);return}}u.create(ri,{displayError:!1,logError:!0}).handle(`No mapper found for user filter state: ${xe.stringify(i)}`)}),this.setFilters(t)}resizeToFit(e,t){if(e.fixedWidth)return;let i=e.calculateOptimalWidth();b.isObject(i)?i.always(this._resizeToFit.bind(this,e,t)):this._resizeToFit(e,t,i)}_resizeToFit(e,t,i){i!==-1&&(t&&t>0&&i>t&&(i=t),e.width!==i&&this.resizeColumn(e,i),e.autoOptimizeWidthRequired=!1,this._triggerColumnResizedToFit(e))}addFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e instanceof ft){let s=this.getFilter(e.createKey());this.filterSupport.removeFilter(s,!1)}let i=this.filterSupport.addFilter(e,t);i&&i.length&&this.trigger("filterAdded",{filter:i[0]})}removeFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.filterSupport.removeFilter(e,t);i&&i.length&&this.trigger("filterRemoved",{filter:i[0]})}removeFilterByKey(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.removeFilter(this.getFilter(e),t)}getFilter(e){return p.find(this.filters,t=>t instanceof ft?b.equals(t.createKey(),e):!1)}setFilters(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=e.map(r=>this._ensureFilter(r)),s=this.filterSupport.setFilters(i,t);s.filtersAdded.forEach(r=>this.trigger("filterAdded",{filter:r})),s.filtersRemoved.forEach(r=>this.trigger("filterRemoved",{filter:r}))}_ensureFilter(e){if(e instanceof ft||!e.objectType)return e;let t=e;return t.column&&(t.column=this.columnById(t.column)),t.table=this,t.session=this.session,u.create(t)}filter(){this.filterSupport.filter()}_filter(e){this._updateRowStructure(h().extend({},e,{filteredRows:!0})),this._renderRowDelta(),this._group(),this.revealSelection()}_createFilterSupport(){return new Ti({widget:this,$container:()=>this.$container,getElementsForFiltering:()=>this.rows,createTextFilter:()=>u.create(Hi,{session:this.session,table:this}),updateTextFilterText:(e,t)=>b.equals(e.text,t)?!1:(e.text=t,!0)})}setTextFilterEnabled(e){this.setProperty("textFilterEnabled",e)}isTextFilterFieldVisible(){return this.textFilterEnabled&&!this.footerVisible}_renderTextFilterEnabled(){this.filterSupport.renderFilterField()}_renderMultiSelect(){T.multiselectable(this.$container,this.multiSelect||this.multiCheck?!0:null)}_renderMultiCheck(){T.multiselectable(this.$container,this.multiSelect||this.multiCheck?!0:null)}updateFilteredElements(e,t){this.filteredElementsDirty&&(this._filter({filteredRows:!0,applyFilters:!1,filtersChanged:!0}),this.filteredElementsDirty=!1)}resizeColumn(e,t){e.fixedWidth||!e.table||(t=Math.floor(t),e.setWidth(t),this._isDataRendered()&&this._renderResizeColumn(e,t),this._triggerColumnResized(e))}_renderResizeColumn(e,t){let i=this.visibleColumns().indexOf(e);if(i!==-1){let s=i+1;this.$cellsForColIndex(s,!0).css("min-width",t).css("max-width",t),this._updateRealColumnWidth(e),this._updateRowWidth(),this.$rows(!0).css("width",this.rowWidth),this._updateRowHeights(),this._renderFiller(),this._renderViewport(),this.updateScrollbars(),this._renderEmptyData()}this._aggregateRows.forEach(s=>{s.$row&&this._resizeAggregateCell(this.$cell(e,s.$row))}),this.findDesktop().repositionTooltips()}_resizeAggregateCell(e){let t=this._getAggrCellRange(e);this._updateAggrCell(t[0]),t.length>1&&this._updateAggrCell(t[t.length-1])}_getAggrCellRange(e){let t=[],i=e.parent(),s=this.visibleColumns(),r=e,o,l=d=>!d.hasClass("empty");if(l(e))o=e.hasClass("halign-right")?-1:1;else{o=1;let d=s.indexOf(this.columnFor$Cell(e));for(let c=d-1;c>=0&&(r=this.$cell(s[c],i),!l(r));c--);}t.push(r);let a=s.indexOf(this.columnFor$Cell(r));for(let d=a+o;d>=0&&d<s.length;d+=o){let c=this.$cell(s[d],i);if(t.push(c),l(c))break}return t}_updateAggrCell(e){let t=e.children(".text");if(!t||!t.length||e.hasClass("empty"))return;let i=e.children(".table-cell-icon").first(),s=this._getAggrCellWidth(e,i);s=this._updateAggrIconVisibility(i,t,s),t.cssMaxWidth(s)}_getWidthWithMarginCached(e){if(!e||!e.length)return 0;let t="widthWithMargin",i=e.data(t);if(i)return i;let s=e.isVisible();s||e.setVisible(!0);let r=C.size(e,{includeMargin:!0}).width;return s||e.setVisible(!1),e.data(t,r),r}_getAggrCellWidth(e,t){let i=e.cssMaxWidth()-e.cssPaddingX();t&&t.length&&t.isVisible()&&(i-=this._getWidthWithMarginCached(t));let s=this._getAggrCellRange(e);for(let r=1;r<s.length;r++){let o=s[r];if(o.hasClass("empty"))i+=o.cssMaxWidth();else{if(e.hasClass("halign-right")!==o.hasClass("halign-right")){let d=o.cssMaxWidth(),c=o.children().toArray().map(g=>h()(g)).filter(g=>g.isVisible()).map(g=>C.size(g,{includeMargin:!0}).width).reduce((g,y)=>g+y,0)+e.cssPaddingLeft(),f=d-c;o.hasClass("halign-center")&&(f/=2),i+=f}break}}return Math.max(0,i)}_updateAggrIconVisibility(e,t,i){if(!e||!e.length)return i;let s=e.isVisible(),r=this._getWidthWithMarginCached(e),o=this._getWidthWithMarginCached(t),a=i-o+(s?r:0)>r;return a===s?i:(e.setVisible(a),i+(a?-r:r))}moveColumn(e,t){let i=this.visibleColumns(),s=i.indexOf(e);return t=this._moveColumn(e,i,s,t),t===null?!1:(i=this.visibleColumns(),t=i.indexOf(e),this._calculateTableNodeColumn(),this._triggerColumnMoved(e,s,t),this._aggregateRows.forEach(r=>p.move(r.contents,s,t)),this._isDataRendered()&&this._rerenderViewport(),!0)}_moveColumn(e,t,i,s){let r=new U(0,t.length);if(!r.contains(i)||!r.contains(s)||(s=this.considerFixedPositionColumns(i,s),s===i))return null;let o=t[s],l=this.columns.indexOf(o);return p.remove(this.columns,e),p.insert(this.columns,e,l),s}considerFixedPositionColumns(e,t){if(t===e)return t;let i=-1;return t>e?(i=p.findIndexFrom(this.visibleColumns(),e,s=>s.fixedPosition),i>-1&&(t=Math.min(t,i-1))):(i=p.findIndexFromReverse(this.visibleColumns(),e,s=>s.fixedPosition),i>-1&&(t=Math.max(t,i+1))),t}_renderColumnOrderChanges(e){let t,i=this;this.header&&this.header.onOrderChanged(e),this.$rows(!0).each(function(){let s=h()(this),r=h()(),o=s.children();for(let l=0;l<i.columns.length;l++){let a=i.columns[l];for(let d=0;d<e.length;d++)if(e[d]===a){t=o[d];break}r.push(t)}s.prepend(r)})}_triggerRowsInserted(e){this.trigger("rowsInserted",{rows:e})}_triggerRowsDeleted(e){this.trigger("rowsDeleted",{rows:e})}_triggerRowsUpdated(e){this.trigger("rowsUpdated",{rows:e})}_triggerAllRowsDeleted(e){this.trigger("allRowsDeleted",{rows:e})}_triggerRowsSelected(e){this.trigger("rowsSelected",{debounce:e})}_triggerRowsChecked(e){this.trigger("rowsChecked",{rows:e})}_triggerRowsExpanded(e){this.trigger("rowsExpanded",{rows:e})}_triggerFilter(){this.trigger("filter")}_triggerAppLinkAction(e,t,i,s){this.trigger("appLinkAction",{column:e,row:t,ref:i,$appLink:s})}_triggerReload(e){this.trigger("reload",{reloadReason:e})}_triggerClipboardExport(){this.trigger("clipboardExport").defaultPrevented||this._exportToClipboard()}_triggerRowOrderChanged(){this.trigger("rowOrderChanged")}_triggerRowOrderChangeAnimation(e){let t={row:e};this.trigger("rowOrderChangeAnimation",t)}_triggerColumnResized(e){let t={column:e};this.trigger("columnResized",t)}_triggerColumnResizedToFit(e){let t={column:e};this.trigger("columnResizedToFit",t)}_triggerColumnMoved(e,t,i){let s={column:e,oldPos:t,newPos:i};this.trigger("columnMoved",s)}_triggerAggregationFunctionChanged(e){let t={column:e};this.trigger("aggregationFunctionChanged",t)}setHeaderVisible(e){this.setProperty("headerVisible",e)}_renderHeaderVisible(){this._renderTableHeader()}setHeaderEnabled(e){this.setProperty("headerEnabled",e)}_renderHeaderEnabled(){this._removeTableHeader(),this._renderTableHeader()}setHeaderMenusEnabled(e){this.setProperty("headerMenusEnabled",e),this.header&&this.header.setHeaderMenusEnabled(this.headerMenusEnabled)}hasPermanentHeadOrTailSortColumns(){return this._permanentHeadSortColumns.length!==0||this._permanentTailSortColumns.length!==0}_setHeadAndTailSortColumns(){let e=this.columns.filter(t=>t.sortIndex>=0);e.sort((t,i)=>t.sortIndex-i.sortIndex),this._permanentHeadSortColumns=[],this._permanentTailSortColumns=[],e.forEach(t=>{t.initialAlwaysIncludeSortAtBegin?this._permanentHeadSortColumns.push(t):t.initialAlwaysIncludeSortAtEnd&&this._permanentTailSortColumns.push(t)})}setTileMode(e){this.setProperty("tileMode",e)}_setTileMode(e){e&&(this._ensureMediator(),this.tileTableHeader||this._setTileTableHeader(this._createTileTableHeader()),this.tableTileGridMediator.loadTiles(),this.tableTileGridMediator.activate()),this._setProperty("tileMode",e),!e&&this.tableTileGridMediator&&this.tableTileGridMediator.deactivate()}_ensureMediator(){this.tableTileGridMediator||(this.tableTileGridMediator=u.create(Mr,{parent:this,gridColumnCount:6}))}_renderTileMode(){this.tableTileGridMediator&&this.tableTileGridMediator.renderTileMode()}createTiles(e){return e.map(t=>{let i=this.createTileForRow(t);return this._adaptTile(i),i.rowId=t.id,i})}_adaptTile(e){e.setGridDataHints({weightX:0})}createTileForRow(e){if(this.tileProducer)return this.tileProducer(e);throw new Error("Cannot create a tile without a producer.")}setTileProducer(e){this.setProperty("tileProducer",e)}_setTileTableHeader(e){e&&e.addCssClass("tile-table-header"),this._setProperty("tileTableHeader",e)}_createTileTableHeader(){return u.create(sf,{parent:this})}setRowIconVisible(e){this.setProperty("rowIconVisible",e)}_setRowIconVisible(e){this._setProperty("rowIconVisible",e);let t=this.rowIconColumn;const i=[...this.columns];this.rowIconVisible&&!t?(this._insertRowIconColumn(),this._calculateTableNodeColumn(),this._triggerColumnStructureChanged(i,this.columns)):!this.rowIconVisible&&t&&(t.destroy(),p.remove(this.columns,t),this.rowIconColumn=null,this._calculateTableNodeColumn(),this._triggerColumnStructureChanged(i,this.columns))}_renderRowIconVisible(){this.columnLayoutDirty=!0,this._updateRowWidth(),this.redraw()}_renderRowIconColumnWidth(){this.rowIconVisible&&this._renderRowIconVisible()}setRowIconColumnWidth(e){this.setProperty("rowIconColumnWidth",e)}_setRowIconColumnWidth(e){this._setProperty("rowIconColumnWidth",e);let t=this.rowIconColumn;t&&(t.width=e)}_setSelectedRows(e){typeof e[0]=="string"&&(e=this.rowsByIds(e)),this._setProperty("selectedRows",e)}insertMenus(e){$e.insertMenus(this,e)}deleteMenus(e){$e.deleteMenus(this,e)}setMenus(e){this.setProperty("menus",e)}_setMenus(e){this.updateKeyStrokes(e,this.menus),this.menus.forEach(t=>t.off("propertyChange:inheritAccessibility",this._menuInheritAccessibilityChangeHandler)),this._setProperty("menus",e),this._updateMenuBar(),this._updateMenusEnabled(),this.menus.forEach(t=>t.on("propertyChange:inheritAccessibility",this._menuInheritAccessibilityChangeHandler)),this.header&&this.header.updateMenuBar()}setMenuBarVisible(e){this.setProperty("menuBarVisible",e)}_setMenuBarVisible(e){this._setProperty("menuBarVisible",e),this._updateMenuBar()}_renderMenuBarVisible(){this.menuBarVisible?(this.menuBar.render(),this._refreshMenuBarPosition()):this.menuBar.remove(),this._updateMenuBar(),this.invalidateLayoutTree()}_refreshMenuBarPosition(){this.$container.removeClass("menubar-top"),this.$container.removeClass("menubar-bottom"),this.menuBarVisible&&this.menuBar.rendered&&(this.menuBar.position===Ce.Position.TOP?(this.menuBar.$container.prependTo(this.$container),this.$container.addClass("menubar-top")):(this.menuBar.$container.appendTo(this.$container),this.$container.addClass("menubar-bottom")))}_createMenuBar(){return u.create(Ce,{parent:this,position:Ce.Position.BOTTOM,menuOrder:new gn(this.session,"Table",this.defaultMenuTypes),menuFilter:this._filterMenusHandler,cssClass:"bounded"})}_updateMenuBar(){if(this.menuBarVisible){let e=["Header"],t=this._filterMenus(this.menus,Ft.MENU_BAR,!1,!0,e);t=this.staticMenus.concat(t),this.menuBar.setMenuItems(t)}else this.menuBar.setMenuItems([]);if(this._refreshMenuBarClasses(),this.contextMenu){let e=this._filterMenus(this.menus,Ft.CONTEXT_MENU,!0,!1,["Header"]);this.contextMenu.updateMenuItems(e)}}_refreshMenuBarClasses(){this.$container&&(this.$container.toggleClass("has-menubar",this.menuBar&&this.menuBar.visible),this.$container.toggleClass("menubar-top",this.menuBar&&this.menuBar.position===Ce.Position.TOP),this.$container.toggleClass("menubar-bottom",this.menuBar&&this.menuBar.position!==Ce.Position.TOP))}_updateMenusEnabled(){const e=this._filterMenusForContextMenu();let t=this.selectedRows.every(i=>i.enabled);for(const i of e)i.setPropertyDimension("enabled","dependent",!i.inheritAccessibility||t)}_setKeyStrokes(e){this.updateKeyStrokes(e,this.keyStrokes),this._setProperty("keyStrokes",e)}setTableStatus(e){this.setProperty("tableStatus",e)}setLimitedResultTableStatus(e){if(!e){this.setTableStatus(null);return}const t=this.estimatedRowCount,i=this.rows.length,s=this.session.locale.decimalFormat,r=s.format(i);let o;if(w.get().type===w.Type.MOBILE)if(t>0){const l=s.format(t);o=this.session.text("MaxOutlineRowWarningMobileWithEstimatedRowCount",r,l)}else o=this.session.text("MaxOutlineRowWarningMobile",r);else if(t>0){const l=s.format(t);o=this.session.text("MaxOutlineRowWarningWithEstimatedRowCount",r,l)}else o=this.session.text("MaxOutlineRowWarning",r);this.setTableStatus(Do.info(o))}_setTableStatus(e){e=E.ensure(e),this._setProperty("tableStatus",e)}setTableStatusVisible(e){this.setProperty("tableStatusVisible",e),this._updateFooterVisibility()}_updateFooterVisibility(){this.setFooterVisible(this.tableStatusVisible||this._hasVisibleTableControls())}setHierarchicalStyle(e){this.setProperty("hierarchicalStyle",e)}_renderHierarchicalStyle(){this.$container.toggleClass("structured",H.HierarchicalStyle.STRUCTURED===this.hierarchicalStyle)}setFooterVisible(e){this._setProperty("footerVisible",e),e&&!this.footer&&(this.footer=this._createFooter()),this.tableControls.forEach(t=>{t.tableFooter=this.footer}),this.rendered&&this._renderFooterVisible(),!e&&this.footer&&(this.footer.destroy(),this.footer=null)}_renderBackgroundEffect(){this.columns.forEach(e=>{e.backgroundEffect&&e._renderBackgroundEffect()})}_renderRowChecked(e){if(!this.checkable||!e.$row)return;let t;if(this.checkableStyle===H.CheckableStyle.TABLE_ROW)t=e.$row;else{if(!this.checkableColumn)throw new Error("checkableColumn not set");t=this.checkableColumn.$checkBox(e.$row),T.checked(e.$row,e.checked)}t.toggleClass("checked",e.checked),T.checked(t,e.checked)}setCheckable(e){this.setProperty("checkable",e)}_setCheckable(e){this._setProperty("checkable",e),this._updateCheckableColumn()}_calculateCheckableColumn(){const e=this.checkableColumn;this.checkableColumn=[...this.columns].reverse().find(t=>t.checkable),this.checkableColumn!==e&&e?.guiOnly&&(e.destroy(),p.remove(this.columns,e))}_updateCheckableColumn(){let e=this.checkableColumn,t=this.checkable&&u.isOneOf(this.checkableStyle,H.CheckableStyle.CHECKBOX,H.CheckableStyle.CHECKBOX_TABLE_ROW);const i=[...this.columns];t&&!e?(this._insertBooleanColumn(),this._calculateTableNodeColumn(),this._triggerColumnStructureChanged(i,this.columns)):!t&&e&&e.guiOnly&&(e.destroy(),p.remove(this.columns,e),this.checkableColumn=null,this._calculateTableNodeColumn(),this._triggerColumnStructureChanged(i,this.columns))}_renderCheckable(){this.columnLayoutDirty=!0,this._updateRowWidth(),this.redraw()}setCheckableStyle(e){this.setProperty("checkableStyle",e)}_setCheckableStyle(e){this._setProperty("checkableStyle",e),this._updateCheckableColumn()}_renderCheckableStyle(){this.$container.toggleClass("checkable",u.isOneOf(this.checkableStyle,H.CheckableStyle.TABLE_ROW,H.CheckableStyle.CHECKBOX_TABLE_ROW)),this.$container.toggleClass("table-row-check",this.checkableStyle===H.CheckableStyle.TABLE_ROW),this._isDataRendered()&&(this._updateRowWidth(),this.redraw())}setCompact(e){this.setProperty("compact",e)}_setCompact(e){this._setProperty("compact",e),this._updateCompactColumn(),this.compactHandler&&this.compactHandler.handle(this.compact)}_updateCompactColumn(){let e=this.compactColumn;return this.compact&&!e?(this._insertCompactColumn(),!0):!this.compact&&e?(e.destroy(),p.remove(this.columns,e),this.compactColumn=null,!0):!1}_insertCompactColumn(){let e=u.create(Ud,{parent:this,guiOnly:!0,headerMenuEnabled:!1});this.columns.push(e),this.compactColumn=e}_renderCompact(){this.columnLayoutDirty=!0,this._updateRowWidth(),this.redraw()}setGroupingStyle(e){this.setProperty("groupingStyle",e)}_setGroupingStyle(e){this._setProperty("groupingStyle",e),this._group()}_renderGroupingStyle(){this._rerenderViewport()}redraw(){this._isDataRendered()&&(this._rerenderHeaderColumns(),this._rerenderViewport(),this.invalidateLayoutTree())}_rerenderHeaderColumns(){this.header&&(this.header.rerenderColumns(),this.invalidateLayoutTree())}_renderTableHeader(){if(this.tileMode)return;let e=!1;this.headerVisible&&!this.header?(this.header=this._createHeader(),this.header.render(),this._renderEmptyData(),e=!0):!this.headerVisible&&this.header&&(this._removeTableHeader(),this._removeEmptyData(),e=!0),this.$container.toggleClass("header-invisible",!this.header),e&&this.invalidateLayoutTree()}_removeTableHeader(){this.header&&(this.header.destroy(),this.header=null)}_renderEmptyData(){!this.header||this.visibleRows.length>0||(this.$emptyData||(this.$emptyData=this.$data.appendDiv().html(" ")),this.$emptyData.css("min-width",this.rowWidth).css("max-width",this.rowWidth),this.updateScrollbars())}_removeEmptyData(){this.header&&this.visibleRows.length===0||this.$emptyData&&(this.$emptyData.remove(),this.$emptyData=null,this.updateScrollbars())}_renderFooterVisible(){this.footer&&(this.footerVisible?this._renderFooter():this._removeFooter(),this.invalidateLayoutTree(),this.filterSupport.renderFilterField())}_renderFooter(){this.footer.rendered||this.footer.render()}_removeFooter(){this.footer.rendered&&this.footer.remove()}_renderEnabled(){super._renderEnabled(),this._installOrUninstallDragAndDropHandler();let e=this.enabledComputed;this.tileMode||this.$data.setEnabled(e),this.$container.setTabbableOrFocusable(e)}_renderDisabledStyle(){super._renderDisabledStyle(),this._renderDisabledStyleInternal(this.$data)}setAutoResizeColumns(e){this.setProperty("autoResizeColumns",e)}_renderAutoResizeColumns(){!this.autoResizeColumns&&w.get().hasTableCellZoomBug()&&this.visibleColumns().forEach((e,t)=>{e._realWidth=null}),this.columnLayoutDirty=!0,this.invalidateLayoutTree()}setMultilineText(e){this.setProperty("multilineText",e)}_renderMultilineText(){this._markAutoOptimizeWidthColumnsAsDirty(),this.redraw()}setDropType(e){this.setProperty("dropType",e)}setMaxRowCount(e){this.setProperty("maxRowCount",e)}setEstimatedRowCount(e){this.setProperty("estimatedRowCount",e)}_renderDropType(){this._installOrUninstallDragAndDropHandler()}setDropMaximumSize(e){this.setProperty("dropMaximumSize",e)}_installOrUninstallDragAndDropHandler(){z.installOrUninstallDragAndDropHandler({target:this,doInstall:()=>this.dropType&&this.enabledComputed,selector:".table-data,.table-row",onDrop:e=>this.trigger("drop",e),dropType:()=>this.dropType,additionalDropProperties:e=>{let t=h()(e.currentTarget),i={rowId:""};if(t.hasClass("table-row")){let s=t.data("row");i.rowId=s.id}return i}})}_installImageListeners(){this._imageLoadListener=this._onImageLoadOrError.bind(this),this.$data[0].addEventListener("load",this._imageLoadListener,!0),this.$data[0].addEventListener("error",this._imageLoadListener,!0)}_uninstallImageListeners(){this.$data[0].removeEventListener("load",this._imageLoadListener,!0),this.$data[0].removeEventListener("error",this._imageLoadListener,!0)}calculateViewRangeSize(){if(this._updateRowHeight(),this.rowHeight===0)throw new Error("Cannot calculate view range with rowHeight = 0");return Math.ceil(this.$data.outerHeight()/this.rowHeight)*2}setViewRangeSize(e){this.viewRangeSize!==e&&(this._setProperty("viewRangeSize",e),this._isDataRendered()&&this._renderViewport())}_calculateCurrentViewRange(){let e,t=this.$data[0].scrollTop;return this.$data[0].scrollHeight-this.$data[0].clientHeight===0?e=0:e=this._rowIndexAtScrollTop(t),this._calculateViewRangeForRowIndex(e)}_rowIndexAtScrollTop(e){let t=0,i=-1;return this.visibleRows.some((s,r)=>(t+=this._heightForRow(s),e<t?(i=r,!0):!1)),i}_heightForRow(e){let t=0,i=e.aggregateRowBefore;return this.groupingStyle===H.GroupingStyle.BOTTOM&&(i=e.aggregateRowAfter),e.height?t=e.height:t=this.rowHeight,i&&(i.height?t+=i.height:t+=this.aggregateRowHeight),t}_measureRowHeight(e){return C.size(e,{includeMargin:!0,exact:!0}).height}_calculateViewRangeForRowIndex(e){if(!this.virtual)return new U(0,this.visibleRows.length);let t=new U,i=Math.floor(this.viewRangeSize/4);return t.from=Math.max(e-i,0),t.to=Math.min(t.from+this.viewRangeSize,this.visibleRows.length),this.viewRangeSize-t.size()>0&&(t.from=Math.max(t.to-this.viewRangeSize,0)),t}_renderViewport(){if(!this.isAttachedAndRendered()){this._renderViewPortAfterAttach=!0;return}if(this._renderViewportBlocked||this.visibleColumns().length===0)return;if(!this.$container.isEveryParentVisible()){this.invalidateLayoutTree();return}let e=this._calculateCurrentViewRange();this._renderViewRange(e),this._renderLastRowAtBottomMarker(),this._renderNoRowsSelectedMarker()}_rerenderViewport(){if(!this.isAttachedAndRendered()){this._rerenderViewPortAfterAttach=!0;return}this._removeRows(),this._removeAggregateRows(),this._renderFiller(),this._renderViewport()}_renderViewRangeForRowIndex(e){let t=this._calculateViewRangeForRowIndex(e);this._renderViewRange(t)}_renderViewRange(e){if(e.from===this.viewRangeRendered.from&&e.to===this.viewRangeRendered.to&&!this.viewRangeDirty)return;this._removeRangeMarkers();let t=e.subtract(this.viewRangeRendered);if(this.viewRangeRendered.subtract(e).forEach(s=>this._removeRowsInRange(s)),t.forEach(s=>this._renderRowsInRange(s)),this.viewRangeRendered.size()>0){let s=this.visibleRows,r=s[this.viewRangeRendered.from],o=s[this.viewRangeRendered.to-1];if(!r.$row||!o.$row)throw new Error("Rows not rendered as expected. "+this.viewRangeRendered+". First: "+C.debugOutput(r.$row)+". Last: "+C.debugOutput(o.$row)+". Length: visibleRows="+this.visibleRows.length+" rows="+this.rows.length)}this._renderRangeMarkers(),this._renderAggregateRows(),this._renderFiller(),this._renderEmptyData(),this._renderBackgroundEffect(),this._renderSelection(),this.viewRangeDirty=!1}_renderLastRowAtBottomMarker(){if(this.$rows().is(":animated"))return;let e=this._lastVisibleRow();e&&e.$row?this.$data.toggleClass("last-row-at-bottom",Math.ceil(C.offsetBounds(e.$row).bottom())>=C.offsetBounds(this.$data).bottom()):this.$data.removeClass("last-row-at-bottom")}_lastVisibleRow(){return this.visibleRows[this.visibleRows.length-1]}_removeRangeMarkers(){this._modifyRangeMarkers("removeClass")}_renderRangeMarkers(){this._modifyRangeMarkers("addClass")}_modifyRangeMarkers(e){if(this.viewRangeRendered.size()===0)return;let t=this.visibleRows;i(t[this.viewRangeRendered.from],"first"),i(t[this.viewRangeRendered.to-1],"last");function i(s,r){s&&s.$row&&s.$row[e](r)}}ensureRowRendered(e){if(e.$row)return;let t=this.visibleRows.indexOf(e);t<0||this._renderViewRangeForRowIndex(t)}_renderFiller(){this.$fillBefore||(this.$fillBefore=this.$data.prependDiv("table-data-fill"),this._applyFillerStyle(this.$fillBefore));let e=this._calculateFillerHeight(new U(0,this.viewRangeRendered.from));this.$fillBefore.cssHeight(e),this.$fillBefore.cssWidth(this.rowWidth),h().log.isTraceEnabled()&&h().log.trace("FillBefore height: "+e),this.$fillAfter||(this.$fillAfter=this.$data.appendDiv("table-data-fill"),this._applyFillerStyle(this.$fillAfter));let t=this._calculateFillerHeight(new U(this.viewRangeRendered.to,this.visibleRows.length));this.$fillAfter.cssHeight(t),this.$fillAfter.cssWidth(this.rowWidth),h().log.isTraceEnabled()&&h().log.trace("FillAfter height: "+t)}_applyFillerStyle(e){let t=e.css("background-color"),i=((1-1/this.rowHeight)*100).toFixed(2)+"%";e.css({background:"linear-gradient(to bottom, transparent, transparent "+i+", "+t+" "+i+", "+t+")",backgroundSize:"100% "+this.rowHeight+"px",backgroundColor:"transparent"})}_calculateFillerHeight(e){let t=0;for(let i=e.from;i<e.to;i++){let s=this.visibleRows[i];t+=this._heightForRow(s)}return t}containsAggregatedNumberColumn(){return this.initialized?this.visibleColumns().some(e=>e instanceof Bt&&e.aggregationFunction!=="none"):!1}setColumns(e,t){this.columns!==e&&(this._setColumns(e,t),this._isDataRendered()&&this._renderColumns())}_setColumns(e,t){for(const c of this.columns)u.assertInstance(c,le,"Table.columns are not initialized yet.");if(t===void 0&&(t=null),!b.isFunction(t)){const c=t;t=(f,g)=>c}const i=this.filterColumns(c=>c.guiOnly);p.removeAll(e,i),e=[...i,...e];const s=e.map(c=>this._ensureColumn(c)).filter(c=>!!c),r=[...this.columns],o=p.diff(this.columns,s),l=p.diff(s,this.columns),a=[...this.columns];let d;for(const c of o){if(c.index>=0){for(const f of a)f.index>c.index&&f.index--;this.rows.forEach(f=>f.cells.splice(c.index,1))}this.removeFilterByKey(c.id,!1),c.destroy(),p.remove(a,c)}for(const c of l){c.index<0&&(c.index=Math.max(-1,...a.map(f=>f.index))+1);for(const f of a)f.index>=c.index&&f.index++;d||(d=h().Deferred(),this.updateBuffer.pushPromise(d.promise())),this.rows.forEach(f=>{c.index>f.cells.length+1?f.cells[c.index]=c.initCell(t(c,f),f):p.insert(f.cells,c.initCell(t(c,f),f),c.index)}),a.push(c)}this._setProperty("columns",s),this._calculateCheckableTableNodeAndSortColumns(),this._sort(),this._calculateValuesForBackgroundEffect(),this._updateRowStructure({filteredRows:!0}),d?.resolve(),this._triggerColumnStructureChanged(r,this.columns)}_renderColumns(){this.columnLayoutDirty=!0,this._updateRowWidth(),this.redraw()}_triggerColumnStructureChanged(e,t){e=[...e],t=[...t],this.trigger("columnStructureChanged",{oldColumns:e,newColumns:t})}insertColumn(e,t,i){this.insertColumns([e],t,i)}insertColumns(e,t,i){if(!e?.length)return;let s;if(b.isNumber(t))s=t;else if(t instanceof le){const o=this.columns.indexOf(t);o>-1&&(s=o+1)}b.isNumber(s)||(s=this.columns.length),p.removeAll(e,this.columns);const r=[...this.columns];p.insertAll(r,e,s),this.setColumns(r,i)}deleteColumn(e){this.deleteColumns([e])}deleteColumns(e){if(!e?.length)return;const t=[...this.columns];p.removeAll(t,e),this.setColumns(t)}_ensureColumn(e){return e instanceof le?(e._setParent(this),e):u.create({...e,parent:this})}updateColumnStructure(e){this._destroyColumns();const t=[...this.columns];this.columns=e,this._initColumns(),this._triggerColumnStructureChanged(t,this.columns),this._isDataRendered()&&(this._updateRowWidth(),this.$rows(!0).css("width",this.rowWidth),this._rerenderHeaderColumns(),this._renderEmptyData())}updateColumnOrder(e){if(e.length!==this.columns.length)throw new Error("Column order may not be updated because lengths of the arrays differ.");let t=this.columns.slice();for(let i=0;i<e.length;i++){let s=e[i],r=p.findIndex(this.columns,o=>o.id===s.id);if(r<0)throw new Error("Column with id "+s.id+"not found.");r!==i&&p.move(this.columns,r,i)}this._isDataRendered()&&this._renderColumnOrderChanges(t)}updateColumnHeaders(e){let t;for(let i=0;i<e.length;i++){let s=this.columnById(e[i].id);t=h().extend(t,s),s.text=e[i].text,s.headerTooltipText=e[i].headerTooltipText,s.headerTooltipHtmlEnabled=e[i].headerTooltipHtmlEnabled,s.headerCssClass=e[i].headerCssClass,s.headerHtmlEnabled=e[i].headerHtmlEnabled,s.headerBackgroundColor=e[i].headerBackgroundColor,s.headerForegroundColor=e[i].headerForegroundColor,s.headerFont=e[i].headerFont,s.headerIconId=e[i].headerIconId,s.sortActive=e[i].sortActive,s.sortAscending=e[i].sortAscending,s.grouped&&!e[i].grouped&&this._removeGroupColumn(s),s.grouped=e[i].grouped,!s.sortActive&&s.sortIndex!==-1?this._removeSortColumn(s):s.grouped&&s.sortActive&&s.sortIndex===-1?this._addGroupColumn(s):s.sortActive&&s.sortIndex===-1?this._addSortColumn(s):s.sortIndex=e[i].sortIndex,this._isDataRendered()&&this.header&&this.header.updateHeader(s,t)}}_attach(){this.$parent.append(this.$container),super._attach()}_postAttach(){this._rerenderViewportAfterAttach();let e=this.htmlComp.getParent();this.htmlComp.setSize(e.size()),super._postAttach()}_renderOnAttach(){super._renderOnAttach(),this._rerenderViewportAfterAttach(),this._renderViewportAfterAttach();let e=this._postAttachActions;this._postAttachActions=[],e.forEach(t=>t())}_rerenderViewportAfterAttach(){this._rerenderViewPortAfterAttach&&(this._rerenderViewport(),this._rerenderViewPortAfterAttach=!1,this._renderViewPortAfterAttach=!1)}_renderViewportAfterAttach(){this._renderViewPortAfterAttach&&(this._renderViewport(),this._renderViewPortAfterAttach=!1)}_detach(){this.$container.detach(),super._detach()}_destroyCellEditorPopup(e){if(!this.cellEditorPopup)return;let t=()=>{this.cellEditorPopup.destroy(),this.cellEditorPopup=null,this.$container&&this.$container.removeClass("has-cell-editor-popup"),e&&e()},i=this.cellEditorPopup.waitForCompleteCellEdit();i.state()==="resolved"?t():i.then(t)}setVirtual(e){this._setProperty("virtual",e)}setCellValue(e,t,i){e.setCellValue(t,i)}setCellText(e,t,i){e.setCellText(t,i)}setCellErrorStatus(e,t,i){e.setCellErrorStatus(t,i)}visibleColumns(e,t){return this.filterColumns(i=>u.nvl(t,!1)?i.visibleIgnoreCompacted:i.visible,e)}displayableColumns(e){return this.filterColumns(t=>t.displayable,e)}primaryKeyColumns(){return this.filterColumns(e=>e.primaryKey)}summaryColumns(){return this.filterColumns(e=>e.summary)}filterColumns(e,t){return t=u.nvl(t,!0),this.columns.filter(i=>e(i)&&(t||!i.guiOnly))}_onDesktopPopupOpen(e){let t=e.popup;this.isFocusable(!1)&&this.has(t)&&t instanceof bt&&(this.$container.addClass("focused"),t.one("destroy",()=>{this._isDataRendered()&&this.$container.removeClass("focused")}))}_onDesktopPropertyChange(e){e.propertyName==="dense"&&this.menuBar.invalidateLayoutTree()}markRowsAsNonChanged(e){p.ensure(e||this.rows).forEach(t=>{t.status=Rt.Status.NON_CHANGED})}isColumnAddable(){return this.organizer?this.organizer.isColumnAddable():!1}isColumnRemovable(e){return this.organizer?this.organizer.isColumnRemovable(e):!1}isColumnModifiable(e){return this.organizer?this.organizer.isColumnModifiable(e):!1}isCustomizable(){return!!this.customizer}setUiPreferencesEnabled(e){this.setProperty("uiPreferencesEnabled",!!e)}_setUiPreferencesEnabled(e){this._setProperty("uiPreferencesEnabled",e),je.updateUiPreferencesEnabled(this)}setInitialUiPreferences(e){this._initialUiPreferences=e}get initialUiPreferences(){return this._initialUiPreferences}resetToInitialUiPreferences(){this._initialUiPreferences&&(je.applyProfile(this,this._initialUiPreferences,{applyUserFilters:!0}),this.uiPreferencesEnabled&&je.clearGlobalProfile(this))}static parseHorizontalAlignment(e){return e>0?"right":e===0?"center":"left"}static linkRowToDiv(e,t){e&&(e.$row=t),t&&t.data("row",e)}}class Rs extends K{_rebuildingTable;constructor(){super(),this._addRemoteProperties(["contextColumn"])}_initProperties(e){super._initProperties(e),e.compactHandler=null,e.organizer=u.create(_u)}_postCreateWidget(){this.widget.hasUserFilter()&&this._onWidgetFilter()}_sendRowsSelected(e,t){let i={rowIds:e};this._send("rowsSelected",i,{delay:t?250:0,coalesce:function(s){return this.target===s.target&&this.type===s.type}})}_sendRowClick(e,t,i){let s={rowId:e,columnId:i,mouseButton:t};this._send("rowClick",s)}_onWidgetRowsSelected(e){let t=this.widget.rowsToIds(this.widget.selectedRows);this._sendRowsSelected(t,e.debounce)}_onWidgetRowClick(e){let t;e.column!==void 0&&(t=e.column.id),this._sendRowClick(e.row.id,e.mouseButton,t)}_onWidgetFilterAdded(e){let t=e.filter;!(t instanceof ft)||t instanceof Oi&&t.column.guiOnly||this._send("filterAdded",t.createFilterAddedEventData())}_onWidgetFilterRemoved(e){let t=e.filter;!(t instanceof ft)||t instanceof Oi&&t.column.guiOnly||this._send("filterRemoved",t.createFilterRemovedEventData())}_onWidgetColumnResized(e){this._sendColumnResized(e.column)}_sendColumnResized(e){if(e.fixedWidth||e.guiOnly||this.widget.autoResizeColumns)return;let t={columnId:e.id,width:e.width};this._send("columnResized",t,{delay:750,coalesce:function(i){return this.target===i.target&&this.type===i.type&&this.columnId===i.columnId},showBusyIndicator:!1})}_onWidgetAggregationFunctionChanged(e){this._sendAggregationFunctionChanged(e.column)}_sendAggregationFunctionChanged(e){if(e.guiOnly)return;let t={columnId:e.id,aggregationFunction:e.aggregationFunction};this._send("aggregationFunctionChanged",t)}_onWidgetColumnBackgroundEffectChanged(e){this._sendColumnBackgroundEffectChanged(e.column)}_sendColumnBackgroundEffectChanged(e){if(e.guiOnly)return;let t={columnId:e.id,backgroundEffect:e.backgroundEffect};this._send("columnBackgroundEffectChanged",t)}sendColumnOrganizeAction(e,t){this._send("columnOrganizeAction",{action:t,columnId:e.id})}_onWidgetColumnMoved(e){let t=e.newPos;this.widget.columns.forEach((i,s)=>{i.guiOnly&&t--}),this._sendColumnMoved(e.column,t)}_sendColumnMoved(e,t){if(e.guiOnly)return;let i={columnId:e.id,index:t};this._send("columnMoved",i)}_onWidgetPrepareCellEdit(e){e.preventDefault(),this._sendPrepareCellEdit(e.row,e.column)}_sendPrepareCellEdit(e,t){if(t.guiOnly)return;let i={rowId:e.id,columnId:t.id};this._send("prepareCellEdit",i)}_onWidgetCompleteCellEdit(e){e.preventDefault(),this._sendCompleteCellEdit()}_sendCompleteCellEdit(){this._send("completeCellEdit")}_onWidgetCancelCellEdit(e){e.preventDefault(),this._sendCancelCellEdit()}_sendCancelCellEdit(){this._send("cancelCellEdit")}_onWidgetRowsChecked(e){this._sendRowsChecked(e.rows)}_sendRowsChecked(e){let t={rows:[]};for(let i=0;i<e.length;i++)t.rows.push({rowId:e[i].id,checked:e[i].checked});this._send("rowsChecked",t)}_onWidgetRowsExpanded(e){this._sendRowsExpanded(e.rows)}_sendRowsExpanded(e){let t={rows:e.map(i=>({rowId:i.id,expanded:i.expanded}))};this._send("rowsExpanded",t)}_onWidgetFilter(){let e=this.widget.rowsToIds(this.widget.filteredRows());this._sendFilter(e)}_sendFilter(e){let t={};e.length===this.widget.rows.length?t.remove=!0:t.rowIds=e,this._send("filter",t,{delay:250,coalesce:function(i){return this.target===i.target&&this.type===i.type&&this.remove===i.remove},showBusyIndicator:!1})}_onWidgetSort(e){e.column.guiOnly||this._send("sort",{columnId:e.column.id,sortAscending:e.sortAscending,sortingRemoved:e.sortingRemoved,multiSort:e.multiSort,sortingRequested:e.sortingRequested})}_onWidgetGroup(e){e.column.guiOnly||this._send("group",{columnId:e.column.id,groupAscending:e.groupAscending,groupingRemoved:e.groupingRemoved,multiGroup:e.multiGroup,groupingRequested:e.groupingRequested})}_onWidgetRowAction(e){this._sendRowAction(e.row,e.column)}_sendRowAction(e,t){t.guiOnly&&(t=p.find(this.widget.columns,s=>!s.guiOnly));let i=t?t.id:null;this._send("rowAction",{rowId:e.id,columnId:i})}_onWidgetAppLinkAction(e){this._sendAppLinkAction(e.column,e.ref)}_sendAppLinkAction(e,t){this._send("appLinkAction",{columnId:e.id,ref:t})}_sendContextColumn(e){e.guiOnly&&(e=null,this.widget.contextColumn=null);let t=null;e&&(t=e.id),this._send("property",{contextColumn:t})}_onWidgetReload(e){let t={reloadReason:e.reloadReason};this._send("reload",t)}_onWidgetExportToClipboard(e){this._send("clipboardExport"),e.preventDefault()}_onWidgetEvent(e){e.type==="rowsSelected"?this._onWidgetRowsSelected(e):e.type==="rowsChecked"?this._onWidgetRowsChecked(e):e.type==="rowsExpanded"?this._onWidgetRowsExpanded(e):e.type==="filter"?this._onWidgetFilter():e.type==="sort"?this._onWidgetSort(e):e.type==="group"?this._onWidgetGroup(e):e.type==="rowClick"?this._onWidgetRowClick(e):e.type==="rowAction"?this._onWidgetRowAction(e):e.type==="prepareCellEdit"?this._onWidgetPrepareCellEdit(e):e.type==="completeCellEdit"?this._onWidgetCompleteCellEdit(e):e.type==="cancelCellEdit"?this._onWidgetCancelCellEdit(e):e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):e.type==="clipboardExport"?this._onWidgetExportToClipboard(e):e.type==="reload"?this._onWidgetReload(e):e.type==="filterAdded"?this._onWidgetFilterAdded(e):e.type==="filterRemoved"?this._onWidgetFilterRemoved(e):e.type==="columnResized"?this._onWidgetColumnResized(e):e.type==="columnMoved"?this._onWidgetColumnMoved(e):e.type==="columnBackgroundEffectChanged"?this._onWidgetColumnBackgroundEffectChanged(e):e.type==="aggregationFunctionChanged"?this._onWidgetAggregationFunctionChanged(e):e.type==="drop"&&this.widget.dragAndDropHandler?this.widget.dragAndDropHandler.uploadFiles(e):super._onWidgetEvent(e)}_onRowsInserted(e){this.widget.insertRows(e),this._rebuildingTable=!1}_onRowsDeleted(e){let t=this.widget.rowsByIds(e);this.addFilterForWidgetEventType("rowsSelected"),this.widget.deleteRows(t)}_onAllRowsDeleted(){this.addFilterForWidgetEventType("rowsSelected"),this.widget.deleteAllRows()}_onRowsUpdated(e){this.widget.updateRows(e)}_onRowsSelected(e){let t=this.widget.rowsByIds(e);this.addFilterForWidgetEventType("rowsSelected"),this.widget.selectRows(t),this.widget.selectionHandler.clearLastSelectedRowMarker()}_onRowsChecked(e){let t=[],i=[];e.forEach(s=>{let r=this.widget.rowById(s.id);s.checked?t.push(r):i.push(r)}),this.addFilterForWidgetEventType("rowsChecked"),this.widget.checkRows(t,{checked:!0,checkOnlyEnabled:!1}),this.widget.uncheckRows(i,{checkOnlyEnabled:!1})}_onRowsExpanded(e){let t=[],i=[];e.forEach(s=>{let r=this.widget.rowById(s.id);s.expanded?t.push(r):i.push(r)}),this.addFilterForWidgetEventType("rowsExpanded"),this.widget.expandRows(t),this.widget.collapseRows(i)}_onRowOrderChanged(e){let t=this.widget.rowsByIds(e);this.widget.updateRowOrder(t)}_onColumnStructureChanged(e){this._rebuildingTable=!0,this.widget.updateColumnStructure(e)}_onColumnOrderChanged(e){let t=this.widget.columnsByIds(e);this.widget.updateColumnOrder(t)}_onColumnHeadersUpdated(e){e.forEach(t=>Be.applyTo(t)),this.widget.updateColumnHeaders(e),this.widget.tileMode&&this.widget.tableTileGridMediator&&(this.widget.tableTileGridMediator._onTableGroup(),this.widget.updateRowOrder(this.widget.rows))}_onStartCellEdit(e,t,i){let s=this.widget.columnById(e),r=this.widget.rowById(t),o=this.session.getOrCreateWidget(i,this.widget);this.widget.startCellEdit(s,r,o)}_onEndCellEdit(e){let t=this.session.getModelAdapter(e);if(!t)throw new Error("Field adapter could not be resolved. Id: "+e);this.widget.endCellEdit(t.widget)}_onRequestFocus(){this.widget.focus()}_onScrollToSelection(){this.widget.revealSelection()}_onColumnBackgroundEffectChanged(e){e.eventParts.forEach(function(t){let i=this.widget.columnById(t.columnId),s=t.backgroundEffect;this.addFilterForWidgetEvent(r=>r.type==="columnBackgroundEffectChanged"&&r.column.id===i.id&&r.column.backgroundEffect===s),i.setBackgroundEffect(s)},this)}_onRequestFocusInCell(e){let t=this.widget.rowById(e.rowId),i=this.widget.columnById(e.columnId);this.widget.focusCell(i,t)}_onAggregationFunctionChanged(e){let t=[],i=[];e.eventParts.forEach(function(s){let r=s.aggregationFunction,o=this.widget.columnById(s.columnId);this.addFilterForWidgetEvent(l=>l.type==="aggregationFunctionChanged"&&l.column.id===o.id&&l.column.aggregationFunction===r),t.push(o),i.push(r)},this),this.widget.changeAggregations(t,i)}_onFiltersChanged(e){this.addFilterForWidgetEventType("filterAdded"),this.addFilterForWidgetEventType("filterRemoved"),this.widget.setFilters(e),this._rebuildingTable||this.widget.filter()}onModelAction(e){e.type==="rowsInserted"?this._onRowsInserted(e.rows):e.type==="rowsDeleted"?this._onRowsDeleted(e.rowIds):e.type==="allRowsDeleted"?this._onAllRowsDeleted():e.type==="rowsSelected"?this._onRowsSelected(e.rowIds):e.type==="rowOrderChanged"?this._onRowOrderChanged(e.rowIds):e.type==="rowsUpdated"?this._onRowsUpdated(e.rows):e.type==="filtersChanged"?this._onFiltersChanged(e.filters):e.type==="rowsChecked"?this._onRowsChecked(e.rows):e.type==="rowsExpanded"?this._onRowsExpanded(e.rows):e.type==="columnStructureChanged"?this._onColumnStructureChanged(e.columns):e.type==="columnOrderChanged"?this._onColumnOrderChanged(e.columnIds):e.type==="columnHeadersUpdated"?this._onColumnHeadersUpdated(e.columns):e.type==="startCellEdit"?this._onStartCellEdit(e.columnId,e.rowId,e.fieldId):e.type==="endCellEdit"?this._onEndCellEdit(e.fieldId):e.type==="requestFocus"?this._onRequestFocus():e.type==="scrollToSelection"?this._onScrollToSelection():e.type==="aggregationFunctionChanged"?this._onAggregationFunctionChanged(e):e.type==="columnBackgroundEffectChanged"?this._onColumnBackgroundEffectChanged(e):e.type==="requestFocusInCell"?this._onRequestFocusInCell(e):super.onModelAction(e)}exportAdapterData(e){return e=super.exportAdapterData(e),delete e.selectedRows,e.rows=[],e.columns.forEach(t=>{delete t.classId,delete t.modelClass}),e}_initRowModel(e){let t=e||{};return t.objectType=u.nvl(t.objectType,"TableRow"),Be.applyTo(t),t}static _createRowRemote(e){return this.modelAdapter&&(e=this.modelAdapter._initRowModel(e)),this._createRowOrig(e)}static modifyTablePrototype(){G.get().remote&&(b.replacePrototypeFunction(H,"_createRow",Rs._createRowRemote,!0),b.replacePrototypeFunction(H,"_sortWhileInit",function(){this.modelAdapter?this._group():this._sortWhileInitOrig()},!0),b.replacePrototypeFunction(H,"_sortAfterInsert",function(e){this.modelAdapter?e&&this._group():this._sortAfterInsertOrig(e)},!0),b.replacePrototypeFunction(H,"_sortAfterUpdate",function(){this.modelAdapter?this._group():this._sortAfterUpdateOrig()},!0),b.replacePrototypeFunction(H,"_isSortingPossible",function(e){return this.modelAdapter?u.nvl(this.uiSortPossible,!0)&&this._isSortingPossibleOrig(e):this._isSortingPossibleOrig(e)},!0),b.replacePrototypeFunction(H,"sort",function(e,t,i,s){this.modelAdapter&&e.guiOnly||this.sortOrig(e,t,i,s)},!0),b.replacePrototypeFunction(H,"_createTileTableHeader",function(){return this.modelAdapter?null:this._createTileTableHeaderOrig()},!0),b.replacePrototypeFunction(H,"createTiles",function(e){return this.modelAdapter?null:this.createTilesOrig(e)},!0))}static modifyColumnPrototype(){G.get().remote&&(b.replacePrototypeFunction(le,"init",function(e){e.parent&&e.parent.modelAdapter&&!e.guiOnly&&(e=h().extend({},e),Be.applyTo(e)),this.initOrig(e)},!0),b.replacePrototypeFunction(le,"_ensureCell",function(e){if(this.table.modelAdapter){let t;return b.isObject(e)?(t=e,t.value=this._ensureValue(t.value),t.text&&t.value===void 0&&!t.errorStatus&&(t.value=this._ensureValue(t.text)),t.value===void 0&&(t.value=null)):t={value:this._ensureValue(e)},Be.applyTo(t,"Cell"),u.create(_t,t)}return this._ensureCellOrig(e)},!0),b.replacePrototypeFunction(le,"isSortingPossible",function(){return this.table.modelAdapter?u.nvl(this.uiSortPossible,!0)&&this.installComparator():this.isSortingPossibleOrig()},!0))}static modifyBooleanColumnPrototype(){G.get().remote&&b.replacePrototypeFunction(nr,"_toggleCellValue",function(e,t){this.table.modelAdapter||this._toggleCellValueOrig(e,t)},!0)}}G.addListener("bootstrap",Rs.modifyTablePrototype),G.addListener("bootstrap",Rs.modifyColumnPrototype),G.addListener("bootstrap",Rs.modifyBooleanColumnPrototype);class Ed{objectType;table;useOnlyVisibleColumns;maxContentLines;moreLinkAvailable;lineCustomizer;_oldStates;_updateHandler;constructor(){this.table=null,this.useOnlyVisibleColumns=!0,this.maxContentLines=3,this.moreLinkAvailable=!0,this.lineCustomizer=null,this._oldStates=b.createMap(),this._updateHandler=null}init(e){$.extend(this,e)}setUseOnlyVisibleColumns(e){this.useOnlyVisibleColumns=e}setMaxContentLines(e){this.maxContentLines=e}setMoreLinkAvailable(e){this.moreLinkAvailable=e}setLineCustomizer(e){this.lineCustomizer=e}handle(e){e?(this._compactColumns(!0),this._attachTableHandler()):(this._detachTableHandler(),this._compactColumns(!1)),this._adjustTable(e),e&&this.updateValues(this.table.rows)}_adjustTable(e){e?(this._cacheAndSetProperty("headerVisible",()=>this.table.headerVisible,()=>this.table.setHeaderVisible(!1)),this._cacheAndSetProperty("autoResizeColumns",()=>this.table.autoResizeColumns,()=>this.table.setAutoResizeColumns(!0))):(this._resetProperty("headerVisible",t=>this.table.setHeaderVisible(t)),this._resetProperty("autoResizeColumns",t=>this.table.setAutoResizeColumns(t)))}_cacheAndSetProperty(e,t,i){b.isNullOrUndefined(this._oldStates[e])&&(this._oldStates[e]=t()),i()}_resetProperty(e,t){let i=this._oldStates[e];b.isNullOrUndefined(i)||(t(i),delete this._oldStates[e])}_compactColumns(e){this.table.displayableColumns(!1).forEach(t=>t.setCompacted(e,!1)),this.table.onColumnVisibilityChanged()}_attachTableHandler(){this._updateHandler==null&&(this._updateHandler=this._onTableEvent.bind(this),this.table.on("rowsInserted rowsUpdated columnStructureChanged",this._updateHandler))}_detachTableHandler(){this._updateHandler!=null&&(this.table.off("rowsInserted rowsUpdated columnStructureChanged",this._updateHandler),this._updateHandler=null)}updateValues(e){if(e.length===0)return;let t=this.getColumns();e.forEach(i=>this._updateValue(t,i))}_updateValue(e,t){t.setCompactValue(this.buildValue(e,t))}buildValue(e,t){return this._buildValue(this._createBean(e,t))}_createBean(e,t){let i=new Gd;return this._processColumns(e,t,i),this._postProcessBean(i),i}_processColumns(e,t,i){e.forEach((s,r)=>this._processColumn(s,r,t,i))}getColumns(){return this.table.filterColumns(e=>this._acceptColumn(e))}_acceptColumn(e){return!e.guiOnly&&(!this.useOnlyVisibleColumns||e.visibleIgnoreCompacted)}_processColumn(e,t,i,s){this._updateBean(s,e,t,i)}_updateBean(e,t,i,s){this._acceptColumnForTitle(t,i)?e.setTitleLine(this._createCompactLine(t,i,s)):this._acceptColumnForTitleSuffix(t,i)?e.setTitleSuffixLine(this._createCompactLine(t,i,s)):this._acceptColumnForSubtitle(t,i)?e.setSubtitleLine(this._createCompactLine(t,i,s)):e.addContentLine(this._createCompactLine(t,i,s))}_acceptColumnForTitle(e,t){return t===0}_acceptColumnForSubtitle(e,t){return t===1}_acceptColumnForTitleSuffix(e,t){return!1}_createCompactLine(e,t,i){let s;this._showLabel(e,t,i)&&(s=e.headerCell());let r=e.cell(i),o=new Kd(s,r);return this._adaptCompactLine(o,e,s,r),o}_showLabel(e,t,i){return!this._acceptColumnForTitle(e,t)&&!this._acceptColumnForSubtitle(e,t)&&!this._acceptColumnForTitleSuffix(e,t)}_adaptCompactLine(e,t,i,s){if(t instanceof nr){let r="",o=s.value;o?r="X":o===null&&(r="?"),e.textBlock.setText(r)}this.lineCustomizer?.(e)}_postProcessBean(e){e.transform({maxContentLines:this.maxContentLines,moreLinkAvailable:this.moreLinkAvailable}),e.title&&!e.subtitle&&!e.titleSuffix&&!e.content&&(e.setContent(e.title),e.setTitle(""))}_buildValue(e){let t=e.title+e.titleSuffix+e.subtitle?" has-header":"",i=this.moreLinkAvailable&&e.moreContent?`<div class="compact-cell-more"><span class="more-link link">${this.table.session.text("More")}</span></div>`:"";return`
<div class="compact-cell-header">
<div class="compact-cell-title">
<span class="left">${e.title}</span>
<span class="right">${e.titleSuffix}</span>
</div>
<div class="compact-cell-subtitle">${e.subtitle}</div>
</div>
<div class="compact-cell-content${t}">${e.content}</div>
<div class="compact-cell-more-content hidden${t}">${e.moreContent}</div>
${i}`}_onTableEvent(e){let t;e.type==="columnStructureChanged"?t=this.table.rows:t=e.rows,this.updateValues(t)}}var Jf;function u_(n,e,t){return(e=c_(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c_(n){var e=p_(n,"string");return typeof e=="symbol"?e:e+""}function p_(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var f_=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},Fd;let Rt=(class{objectType;cells;checked;compactValue;enabled;filterAccepted;height;hasError;id;initialized;iconId;parentRow;parent;childRows;expanded;status;nodeId;hierarchyLevel;cssClass;aggregateRowAfter;aggregateRowBefore;lookupRow;$row;page;expandable;constructor(){this.$row=null,this.aggregateRowAfter=null,this.cells=[],this.checked=!1,this.compactValue=null,this.enabled=!0,this.filterAccepted=!0,this.height=null,this.hasError=!1,this.id=null,this.initialized=!1,this.parentRow=null,this.parent=null,this.childRows=[],this.expanded=!1,this.status=Fd.Status.NON_CHANGED,this.hierarchyLevel=0}init(e){this._init(e),this.initialized=!0}_init(e){if(!e.parent)throw new Error("missing property 'parent'");h().extend(this,e),this._initCells()}_initCells(){this.getTable().columns.forEach(e=>{if(!e.guiOnly){let t=this.cells[e.index];t=e.initCell(t,this),this.cells[e.index]=t}})}animateExpansion(){let e=this.$row;if(!e)return;let t=e.find(".table-row-control");this.expanded?t.addClassForAnimation("expand-rotate"):t.addClassForAnimation("collapse-rotate")}hasFilterAcceptedChildren(){return this.childRows.some(e=>e.filterAccepted||e.hasFilterAcceptedChildren())}getTable(){return this.parent}get table(){return this.parent}setCompactValue(e){this.compactValue=e}setFilterAccepted(e){this.filterAccepted=e}setEnabled(e){this.enabled=e}getKeyValues(){if(!this.cells?.length)return[];let e=this.table.primaryKeyColumns();return e.length||(e=this.table.columns),e.map(t=>this.table.cellValue(t,this))}static#e=Jf=()=>(Fd=this,u_(this,"Status",{NON_CHANGED:"nonChanged",INSERTED:"inserted",UPDATED:"updated"}),this)},Jf());Rt=Fd=f_([Ke({ensureId:!0})],Rt);var Rd=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class Tn{isLoadMoreDataPossible(e,t,i){return t>0&&i>0&&e<t&&e<i}withMaxRowCountContribution(e,t){const i=this.buildMaxRowCountContribution(t);return i?(e=e||{},xe.addContribution(i,e)):xe.removeContribution(ds,e),e}buildMaxRowCountContribution(e){const t=this.getMaxTableRowCount(e);return t>0?u.create(ds,{hint:t}):null}getMaxTableRowCount(e){return e.maxRowCount}}let ds=class extends se{override;hint};Rd([Reflect.metadata("scout.m.t",Number)],ds.prototype,"override",void 0),Rd([Reflect.metadata("scout.m.t",Number)],ds.prototype,"hint",void 0),ds=Rd([ue("scout.MaxRowCountContribution")],ds),window.scout.DataObjectInventory.get().add(ds,"scout.MaxRowCountContribution","MaxRowCountContributionDo");class Lt{session;locale;_allData;_allAxis;_rows;_table;constructor(e,t){this.session=t,this.locale=t.locale,this._allData=[],this._allAxis=[],this._rows=e.rows,this._table=e}static DateGroup={NONE:0,YEAR:256,MONTH:257,WEEKDAY:258,DATE:259};static NumberGroup={COUNT:-1,SUM:1,AVG:2};addData(e,t){let i={},s=this.locale;return this._allData.push(i),i.column=e,i.format=r=>s.decimalFormat.format(r),t===Lt.NumberGroup.COUNT?(i.norm=r=>1,i.group=r=>r.length):t===Lt.NumberGroup.SUM?(i.norm=r=>isNaN(r)||r===null||r===""?null:parseFloat(r),i.group=r=>r.reduce((o,l)=>o+l)):t===Lt.NumberGroup.AVG&&(i.norm=r=>isNaN(r)||r===null||r===""?null:parseFloat(r),i.group=r=>{let o=r.reduce((a,d)=>a+d),l=r.reduce((a,d)=>d===null?a:a+1,0);return l===0?null:o/l}),i}addAxis(e,t){let i=[],s=this.locale,r=this.session,o=this.session.text.bind(this.session),l=o("ui.EmptyCell");return this._allAxis.push(i),i.column=e,i.normTable=[],i.sortCodeMap={},i.add=a=>{i.indexOf(a)===-1&&i.push(a)},i.reorder=()=>{i.sort((a,d)=>{if(a===null)return 1;if(d===null)return-1;let c=i.sortCodeMap[a],f=i.sortCodeMap[d];return!b.isNullOrUndefined(c)||!b.isNullOrUndefined(f)?rt.NUMERIC.compare(c,f):a-d})},i.norm=a=>{if(a===null||a==="")return null;let d=i.normTable.indexOf(a);return d===-1?i.normTable.push(a)-1:d},i.format=a=>a===null?l:i.normTable[a],i.deterministicKeyToKey=a=>i.norm(a),i.keyToDeterministicKey=a=>a===null?null:i.format(a),i.normDeterministic=a=>i.keyToDeterministicKey(i.norm(a)),e instanceof jd?(t===Lt.DateGroup.NONE?(i.norm=a=>a===null||a===""?null:a.getTime(),i.format=a=>{if(a===null)return null;let d=e.format;return d?d=St.ensure(s,d):d=s.dateFormat,d.format(new Date(a))}):t===Lt.DateGroup.YEAR?(i.norm=a=>a===null||a===""?null:a.getFullYear(),i.format=a=>a===null?l:String(a)):t===Lt.DateGroup.MONTH?(i.norm=a=>a===null||a===""?null:a.getMonth(),i.format=a=>a===null?l:s.dateFormatSymbols.months[a]):t===Lt.DateGroup.WEEKDAY?(i.norm=a=>a===null||a===""?null:(a.getDay()+7-s.dateFormatSymbols.firstDayOfWeek)%7,i.format=a=>a===null?l:s.dateFormatSymbols.weekdaysOrdered[a]):t===Lt.DateGroup.DATE&&(i.norm=a=>a===null||a===""?null:S.trunc(a).getTime(),i.format=a=>a===null?l:S.format(new Date(a),s,s.dateFormatPatternDefault)),i.deterministicKeyToKey=a=>a,i.keyToDeterministicKey=a=>a,i.normDeterministic=a=>i.norm(a)):e instanceof Bt?(i.norm=a=>isNaN(a)||a===null||a===""?null:parseFloat(a),i.format=a=>isNaN(a)||a===null?l:e.decimalFormat.format(a),i.deterministicKeyToKey=a=>a,i.keyToDeterministicKey=a=>a,i.normDeterministic=a=>i.norm(a)):e instanceof nr?(i.norm=a=>e.triStateEnabled&&a===null?-1:a===!0?1:0,i.format=a=>{if(a===-1)return o("ui.BooleanColumnGroupingMixed");if(a===0)return o("ui.BooleanColumnGroupingFalse");if(a===1)return o("ui.BooleanColumnGroupingTrue")},i.deterministicKeyToKey=a=>a,i.keyToDeterministicKey=a=>a,i.normDeterministic=a=>i.norm(a)):e instanceof kl?i.isIcon=!0:i.reorder=()=>{let a=rt.TEXT;a.install(r),i.sort((d,c)=>{if(d===null)return 1;if(c===null)return-1;let f=i.sortCodeMap[d],g=i.sortCodeMap[c];return!b.isNullOrUndefined(f)||!b.isNullOrUndefined(g)?rt.NUMERIC.compare(f,g):a.compare(i.format(d),i.format(c))})},i}calculate(){let e={},t=0;for(let i=0;i<this._rows.length;i++){let s=this._rows[i],r=[];for(let a=0;a<this._allAxis.length;a++){let d=this._allAxis[a].column,c=d.cellValueOrTextForCalculation(s),f=this._allAxis[a].norm(c);if(f!==void 0){this._allAxis[a].add(f);let g=d.cell(s);g.sortCode!==null&&(this._allAxis[a].sortCodeMap[f]=g.sortCode),r.push(f)}}let o=JSON.stringify(r),l=[];for(let a=0;a<this._allData.length;a++){let d=this._table.cellValue(this._allData[a].column,s),c=this._allData[a].norm(d);c!==void 0&&l.push(c)}e[o]?e[o].push(l):(e[o]=[l],t++)}for(let i=0;i<this._allData.length;i++){let s=this._allData[i];s.total=0,s.min=null,s.max=null;for(let o in e)if(e.hasOwnProperty(o)){let l=e[o],a=[];for(let c=0;c<l.length;c++)a.push(l[c][i]);let d=this._allData[i].group(a);if(e[o][i]=d,s.total+=d,d===null)continue;(d<s.min||s.min===null)&&(s.min=d),(d>s.max||s.min===null)&&(s.max=d)}u.nvl(s.max,0)===0&&(s.max=.1);let r=Math.ceil(Math.log(s.max)/Math.LN10)-1;s.max=Math.ceil(s.max/Math.pow(10,r))*Math.pow(10,r),s.max=Math.ceil(s.max/4)*4}for(let i=0;i<this._allAxis.length;i++){let s=this._allAxis[i];s.min=p.min(s),s.max=p.max(s),s.indexOf(null)!==-1&&(s.max=s.max+1),s.reorder()}return e.getValue=i=>{let s=JSON.stringify(i);return e.hasOwnProperty(s)?e[s]:null},e.length=t,e}columnCount(e){let t=this.columns(e),i=[],s=0;for(let r=0;r<t.length;r++){let o=t[r];i.push([o,[]]);let l=i[s][1];for(let a=0;a<this._rows.length;a++){let d=this._rows[a],c=o.cellValueOrTextForCalculation(d);l.indexOf(c)===-1&&l.push(c)}i[s][1]=l.length,s++}return i}isEmpty(){return this._rows.length===0||this.columns().length===0}columns(e){return e=u.nvl(e,!0),this._table.visibleColumns(!1,!0).filter(t=>!(e&&t instanceof Bt))}isMatrixValid(){return this._table.rows.length===0||this._table.filterColumns(()=>!0,!1).length===this._table.rows[0].cells.length}}class Ad extends I{table;filterText;animating;open;resizing;selectedControl;searchFieldKeyStrokeContext;$controlContent;$controlContainer;$resizer;$clearIcon;_$controls;_$info;_compactStyle;_tableInfoTooltip;_tableStatusTooltip;_$infoLoad;_$infoSelection;_tableRowsChangedHandler;_tableFilterHandler;_tableFilterAddedHandler;_tableFilterRemovedHandler;_tableRowsSelectedHandler;_tableStatusChangedHandler;_tablePropertyChangeHandler;_focusFilterFieldKeyStroke;_autoHideTableStatusTooltipTimeoutId;_$window;_$body;_$infoFilter;_$infoTableStatus;_$infoTableStatusIcon;_$textFilter;constructor(){super(),this._compactStyle=!1,this.animating=!1,this.open=!1,this.resizing=!1,this.table=null,this._tableRowsChangedHandler=this._onTableRowsChanged.bind(this),this._tableFilterHandler=this._onTableFilter.bind(this),this._tableFilterAddedHandler=this._onTableFilterAdded.bind(this),this._tableFilterRemovedHandler=this._onTableFilterRemoved.bind(this),this._tableRowsSelectedHandler=this._onTableRowsSelected.bind(this),this._tableStatusChangedHandler=this._onTableStatusChanged.bind(this),this._tablePropertyChangeHandler=this._onTablePropertyChange.bind(this)}_init(e){super._init(e),this.searchFieldKeyStrokeContext=new qi,this.searchFieldKeyStrokeContext.$bindTarget=()=>this._$textFilter,this.searchFieldKeyStrokeContext.$scopeTarget=()=>this._$textFilter,this._focusFilterFieldKeyStroke=null}_render(){let e,t;this.$container=this.$parent.appendDiv("table-footer"),this._$window=this.$parent.window(),this._$body=this.$parent.body(),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new $d(this)),this.$controlContainer=this.$container.appendDiv("table-control-container").hide(),this.$controlContent=this.$controlContainer.appendDiv("table-control-content focus-boundary"),this._$controls=this.$container.appendDiv("table-controls"),this._$info=this.$container.appendDiv("table-info"),t=this._$info.appendDiv("table-filter"),this._$textFilter=oe.makeTextField(this.$container,"table-text-filter").appendTo(t).on("input","",this._createOnFilterFieldInputFunction().bind(this)).placeholder(this.session.text("ui.FilterBy_")),this.table.$container.data("filter-field",this._$textFilter),this._focusFilterFieldKeyStroke=new re(this.table),this.table.keyStrokeContext.registerKeyStroke(this._focusFilterFieldKeyStroke),e=this.table.getFilter(Hi.TYPE),e&&this._$textFilter.val(e.text),this.$clearIcon=t.appendSpan("clear-icon unfocusable action text-field-icon").on("mousedown",this._onDeleteFilterMouseDown.bind(this)),this._$infoLoad=this._$info.appendDiv("table-info-item table-info-load").on("click","",this._onInfoLoadClick.bind(this)),T.role(this._$infoLoad,"status"),this._$infoFilter=this._$info.appendDiv("table-info-item table-info-filter").on("click","",this._onInfoFilterClick.bind(this)),T.role(this._$infoFilter,"status"),this._$infoSelection=this._$info.appendDiv("table-info-item table-info-selection").on("click","",this._onInfoSelectionClick.bind(this)),T.role(this._$infoSelection,"status"),this._$infoTableStatus=this._$info.appendDiv("table-info-item table-info-status").on("mousedown",this._onStatusMouseDown.bind(this)),this._$infoTableStatusIcon=this._$infoTableStatus.appendSpan("icon font-icon"),this._renderControls(),this._renderInfo(),this._updateInfoVisibility(),this.table.on("rowsInserted",this._tableRowsChangedHandler),this.table.on("rowsDeleted",this._tableRowsChangedHandler),this.table.on("allRowsDeleted",this._tableRowsChangedHandler),this.table.on("filter",this._tableFilterHandler),this.table.on("filterAdded",this._tableFilterAddedHandler),this.table.on("filterRemoved",this._tableFilterRemovedHandler),this.table.on("rowsSelected",this._tableRowsSelectedHandler),this.table.on("statusChanged",this._tableStatusChangedHandler),this.table.on("propertyChange",this._tablePropertyChangeHandler),this.session.keyStrokeManager.installKeyStrokeContext(this.searchFieldKeyStrokeContext)}getFocusableElement(){return this._$textFilter}_renderProperties(){this._updateHasFilterText()}_remove(){this.session.keyStrokeManager.uninstallKeyStrokeContext(this.searchFieldKeyStrokeContext),this._hideTableStatusTooltip(),this.$resizer=null,this.$controlContainer.stop(!1,!0),this.animating=!1,this.open=!1,this.table.keyStrokeContext.unregisterKeyStroke(this._focusFilterFieldKeyStroke),this._focusFilterFieldKeyStroke=null,this.table.off("rowsInserted",this._tableRowsChangedHandler),this.table.off("rowsDeleted",this._tableRowsChangedHandler),this.table.off("allRowsDeleted",this._tableRowsChangedHandler),this.table.off("filter",this._tableFilterHandler),this.table.off("filterAdded",this._tableFilterAddedHandler),this.table.off("filterRemoved",this._tableFilterRemovedHandler),this.table.off("rowsSelected",this._tableRowsSelectedHandler),this.table.off("statusChanged",this._tableStatusChangedHandler),this.table.off("propertyChange",this._tablePropertyChangeHandler),super._remove()}_renderResizerVisible(){this.selectedControl.resizerVisible?(this._renderResizer(),this.$controlContainer.addClass("has-resizer")):this.$resizer&&(this.$resizer.remove(),this.$resizer=null,this.$controlContainer.removeClass("has-resizer"))}_renderResizer(){if(this.$resizer)return;this.$resizer=this.$controlContainer.prependDiv("table-control-resize").on("mousedown","",e.bind(this));function e(t){let i=this.$controlContainer.height(),s=Math.floor(t.pageY);this._$window.on("mousemove.tablefooter",r.bind(this)).one("mouseup",o.bind(this)),this._$body.addClass("row-resize"),this.resizing=!0;function r(l){if(!this.rendered)return;let d=Math.floor(l.pageY)-s,c=this.table.$container.height()-this.table.footer.$container.height(),f=Math.min(i-d,c);this.$controlContainer.height(f);let g=C.insets(this.$controlContainer);this.$controlContent.outerHeight(f-g.vertical()),this._revalidateTableLayout()}function o(){this.selectedControl&&this.rendered&&this.$controlContainer.height()<100&&this.selectedControl.setSelected(!1),this._$window.off("mousemove.tablefooter"),this._$body.removeClass("row-resize"),this.resizing=!1}return!1}}_renderControls(){let e=this.table.tableControls;e?e.forEach(t=>{t.setParent(this),t.render(this._$controls)}):this._$controls.empty()}_renderInfo(){this._renderInfoLoad(),this._renderInfoTableStatus(),this._renderInfoFilter(),this._renderInfoSelection()}_renderInfoLoad(){let e=this._$infoLoad,t=this.table.rows.length,i=this.table.estimatedRowCount,s=this.table.maxRowCount;e.empty();let r;this._compactStyle?(t<=1?e.appendSpan().text(this.session.text("ui.NumRowLoadedMin")):e.appendSpan().text(this.session.text("ui.NumRowsLoadedMin")),r=e.appendSpan("table-info-button").text(this.computeCountInfo(t))):(t<=1?e.appendSpan().text(this.session.text("ui.NumRowLoaded",this.computeCountInfo(t))):i&&i>t?e.appendSpan().text(this.session.text("ui.NumRowsLoaded",this.computeCountInfo(t,i))):e.appendSpan().text(this.session.text("ui.NumRowsLoaded",this.computeCountInfo(t))),this.table.hasReloadHandler&&(u.create(Tn).isLoadMoreDataPossible(t,i,s)?i<s?r=e.appendSpan("table-info-button").text(this.session.text("ui.LoadAllData")).appendTo(e):r=e.appendSpan("table-info-button").text(this.session.text("ui.LoadNData",this.computeCountInfo(s))).appendTo(e):r=e.appendSpan("table-info-button").text(this.session.text("ui.ReloadData")).appendTo(e))),e.setEnabled(this.table.hasReloadHandler),r&&T.hidden(r,!0),this.htmlComp.layouting||this.invalidateLayoutTree(!1)}_renderInfoFilter(){let e=this._$infoFilter,t=this.table.filteredRows().length,i=this.table.filteredBy().join(", ");e.empty();let s;this._compactStyle?(t<=1?e.appendSpan().text(this.session.text("ui.NumRowFilteredMin")):e.appendSpan().text(this.session.text("ui.NumRowsFilteredMin")),s=e.appendSpan("table-info-button").text(this.computeCountInfo(t))):(i?t<=1?e.appendSpan().text(this.session.text("ui.NumRowFilteredBy",this.computeCountInfo(t),i)):e.appendSpan().text(this.session.text("ui.NumRowsFilteredBy",this.computeCountInfo(t),i)):t<=1?e.appendSpan().text(this.session.text("ui.NumRowFiltered",this.computeCountInfo(t))):e.appendSpan().text(this.session.text("ui.NumRowsFiltered",this.computeCountInfo(t))),this.table.hasUserFilter()&&(s=e.appendSpan("table-info-button").text(this.session.text("ui.RemoveFilter")).appendTo(e))),s&&T.hidden(s,!0),this.htmlComp.layouting||this.invalidateLayoutTree(!1)}_renderInfoSelection(){let e=this._$infoSelection,t=this.table.filteredRows().length,i=this.table.selectedRows.length,s=t>0&&t===i;e.empty();let r;this._compactStyle?(i<=1?e.appendSpan().text(this.session.text("ui.NumRowSelectedMin")):e.appendSpan().text(this.session.text("ui.NumRowsSelectedMin")),r=e.appendSpan("table-info-button").text(this.computeCountInfo(i))):(i<=1?e.appendSpan().text(this.session.text("ui.NumRowSelected",this.computeCountInfo(i))):e.appendSpan().text(this.session.text("ui.NumRowsSelected",this.computeCountInfo(i))),r=e.appendSpan("table-info-button").text(this.session.text(s?"ui.SelectNone":"ui.SelectAll")).appendTo(e)),r&&T.hidden(r,!0),this.htmlComp.layouting||this.invalidateLayoutTree(!1)}_renderInfoTableStatus(){let e=this._$infoTableStatus,t=this.table.tableStatus;e.removeClass(E.SEVERITY_CSS_CLASSES),t&&e.addClass(t.cssClass()),this.htmlComp.layouting||this.invalidateLayoutTree(!1)}_updateInfoVisibility(){this._updateInfoFilterVisibility(),this._updateInfoSelectionVisibility(),this._updateInfoTableStatusVisibility()}_updateInfoFilterVisibility(){let e=this.table.filteredBy().length>0;this._setInfoVisible(this._$infoFilter,e)}_updateInfoSelectionVisibility(){let e=this.table.multiSelect;this._setInfoVisible(this._$infoSelection,e)}_updateInfoTableStatusVisibility(){if(this.table.tableStatus){let t=null;u.isOneOf(this.table.tableStatus.uiState,"user-hidden","auto-hidden")||(this._$infoTableStatus.addClass("tooltip-active"),t=(function(){this.table.tableStatus&&!u.isOneOf(this.table.tableStatus.uiState,"user-hidden","auto-hidden")&&this._showTableStatusTooltip()}).bind(this)),this._setInfoVisible(this._$infoTableStatus,!0,t)}else this._hideTableStatusTooltip(),this._setInfoVisible(this._$infoTableStatus,!1)}_setInfoVisible(e,t,i){if(e.isVisible()===t&&!(t&&e.hasClass("hiding"))){i&&i();return}if(!this.rendered){e.setVisible(t);return}if(t){let r={progress:this.revalidateLayout.bind(this),complete:()=>{i&&i()}};e.data("animationComplete",r.complete),e[0].style.width===""&&e.cssWidth(0),e.stop().removeClass("hiding").setVisible(!0).cssWidthToContentAnimated(r)}else e.addClass("hiding"),e.stop().animate({width:0},{progress:this.revalidateLayout.bind(this),complete:()=>{e.removeClass("hiding"),e.setVisible(!1)}})}_toggleTableInfoTooltip(e,t){this._tableInfoTooltip?this._tableInfoTooltip.destroy():(this._tableInfoTooltip=u.create(t,{parent:this,tableFooter:this,arrowPosition:50,arrowPositionUnit:"%",$anchor:e}),this._tableInfoTooltip.one("destroy",()=>{this._tableInfoTooltip=null}),this._tableInfoTooltip.render())}computeCountInfo(e,t){return e=u.nvl(e,0),t?this.session.text("ui.TableRowCount",this.session.text("ui.CountOfApproxTotal",this.session.locale.decimalFormat.format(e),this.session.locale.decimalFormat.format(t))):e===0?this._compactStyle?this.session.text("ui.TableRowCount",this.session.locale.decimalFormat.format(0)):this.session.text("ui.TableRowCount0"):e===1?this.session.text("ui.TableRowCount1"):this.session.text("ui.TableRowCount",this.session.locale.decimalFormat.format(e))}_revalidateTableLayout(){this.table.htmlComp.revalidateLayoutTree()}openControlContainer(e){this.open;let t=this.$controlContent.data("control");this.animating&&t!==e&&t.onControlContainerClosed(),this.animating=!0,this.open=!0;let i=this.computeControlContainerHeight(this.table,e),s=C.insets(this.$controlContainer);this.$controlContent.outerHeight(i-s.vertical()),this.$controlContainer[0].style.height===""&&this.$controlContainer.outerHeight(0),this.$controlContainer.outerHeight()>i&&this.table.invalidateLayoutTree(),this.$controlContainer.stop(!0).show().delay(1).animate({height:i},{duration:this.rendered?e.animateDuration:0,complete:(function(){this.animating=!1,e.onControlContainerOpened(),this.table.invalidateLayoutTree()}).bind(this)})}closeControlContainer(e,t){if(!this.open)return;t=h().extend({},{animate:!0},t),this.open=!1,this.animating=!0,this.table.invalidateLayoutTree();let i=(function(){this.animating=!1,this.$controlContainer.hide(),e.onControlContainerClosed()}).bind(this);t.animate?this.$controlContainer.stop(!0).show().animate({height:0},{duration:e.animateDuration,complete:i}):i()}computeControlContainerHeight(e,t,i){let s=0,r=0,o=C.size(e.$container).height,l=0,a=C.margins(u.nvl(e.$data,e.$container)),d=a.top+a.bottom,c=e.menuBar,f=e.footer,g=e.htmlComp,y=g.availableSize().subtract(g.insets());if(f){if(e.menuBarVisible&&c.visible){let v=x.get(c.$container);s=Fs.size(v,y).height}if(r=C.size(f.$container).height,f.open&&(f.animating?l=u.nvl(t&&t.height,l):(l=C.size(f.$controlContainer).height,!f.resizing&&i&&(l=Math.max(t&&t.height,l)))),this.table.htmlComp.layouted){let v=o-(d+s+r);l=Math.min(l,v)}return l}}_hideTableStatusTooltip(){clearTimeout(this._autoHideTableStatusTooltipTimeoutId),this._tableStatusTooltip&&this._tableStatusTooltip.destroy()}_showTableStatusTooltip(){if(this._tableStatusTooltip&&(this._tableStatusTooltip.destroy(),this._tableStatusTooltip=null),!this.rendered&&!this.rendering)return;let e=this.table.tableStatus,t=e?e.message:null;_.empty(t)||(this._tableStatusTooltip=u.create(Xi,{parent:this,text:t,severity:e.severity,autoRemove:!e.isError(),$anchor:this._$infoTableStatusIcon}),this._tableStatusTooltip.one("destroy",()=>{this._tableStatusTooltip=null}),this._tableStatusTooltip.render(),T.role(this._tableStatusTooltip.$content,"alert"),this._$infoTableStatus.addClass("tooltip-active"),this._tableStatusTooltip.on("remove",()=>{this._$infoTableStatus.removeClass("tooltip-active"),clearTimeout(this._autoHideTableStatusTooltipTimeoutId),this.table.tableStatus&&!this.table.tableStatus.isError()&&(this.table.tableStatus.uiState="auto-hidden")}),clearTimeout(this._autoHideTableStatusTooltipTimeoutId),!e.isError()&&!e.isWarning()&&!e.uiState&&(this.table.tableStatus.uiState="auto-hidden",this._autoHideTableStatusTooltipTimeoutId=setTimeout(()=>this._hideTableStatusTooltip(),5e3)))}_updateHasFilterText(){this._$textFilter.toggleClass("has-text",!!this._$textFilter.val())}onControlSelected(e){let t=this.selectedControl;this.selectedControl=e,e&&(this._renderResizerVisible(),t&&t.height!==e.height&&this.openControlContainer(e))}_onStatusMouseDown(e){this._tableStatusTooltip?(this._hideTableStatusTooltip(),this.table.tableStatus.uiState="user-hidden"):(this._showTableStatusTooltip(),this._tableStatusTooltip.rendered&&(this.table.tableStatus.uiState="user-shown"))}_createOnFilterFieldInputFunction(){let e=h().debounce(this._applyFilter.bind(this));return function(t){this._updateHasFilterText(),e()}}_onDeleteFilterMouseDown(e){this._$textFilter.val(""),this._updateHasFilterText(),this._applyFilter(),e.preventDefault()}_applyFilter(){let e=this._$textFilter.val();if(this.filterText!==e)if(this.filterText=e,e){let t=u.create(Hi,{session:this.session,table:this.table});t.text=e,this.table.addFilter(t)}else this.table.removeFilterByKey(Hi.TYPE)}_onInfoLoadClick(){if(this._$infoLoad.isEnabled())if(this._compactStyle)this._toggleTableInfoTooltip(this._$infoLoad,"TableInfoLoadTooltip");else{let e=this.table.rows.length,t=this.table.estimatedRowCount,i=this.table.maxRowCount;u.create(Tn).isLoadMoreDataPossible(e,t,i)?this.table.reload(H.ReloadReason.OVERRIDE_ROW_LIMIT):this.table.reload()}}_onInfoFilterClick(){this._compactStyle?this._toggleTableInfoTooltip(this._$infoFilter,"TableInfoFilterTooltip"):this.table.resetUserFilter()}_onInfoSelectionClick(){this._compactStyle?this._toggleTableInfoTooltip(this._$infoSelection,"TableInfoSelectionTooltip"):this.table.toggleSelection()}_onTableRowsChanged(e){this._renderInfoLoad()}_onTableFilter(e){this._renderInfoFilter(),this._updateInfoFilterVisibility(),this._renderInfoSelection()}_onTableFilterAdded(e){if(this._renderInfoFilter(),this._updateInfoFilterVisibility(),e.filter instanceof ft&&e.filter.filterType===Hi.TYPE){let t=e.filter;this._$textFilter.val()!==t.text&&(this._$textFilter.val(t.text),this._updateHasFilterText(),this._applyFilter())}}_onTableFilterRemoved(e){this._renderInfoFilter(),this._updateInfoFilterVisibility(),e.filter instanceof ft&&e.filter.filterType===Hi.TYPE&&(this._$textFilter.val(""),this._updateHasFilterText(),this._applyFilter())}_onTableRowsSelected(e){this._renderInfoSelection()}_onTableStatusChanged(e){this._renderInfoTableStatus(),this._updateInfoTableStatusVisibility()}_onTablePropertyChange(e){e.propertyName==="multiSelect"&&this._updateInfoSelectionVisibility()}}class $d extends ne{_tableFooter;constructor(e){super(),this._tableFooter=e}layout(e){let t,i=this._tableFooter._$controls,s=this._tableFooter._$info,r=s.find(".table-info-item"),o=C.size(e).width,l=C.size(i,!0).width,a=C.size(s,!0).width;r.each(function(){let c=h()(this);c.isVisible()&&!c.hasClass("hiding")&&(c.data("oldWidth",c.outerWidth()),c.css("width","auto"))}),s.css("max-width",""),this._tableFooter._compactStyle&&(this._tableFooter._compactStyle=!1,this._tableFooter._renderInfo()),a=C.size(s,!0).width,l+a<=o&&(this._tableFooter._tableInfoTooltip&&this._tableFooter._tableInfoTooltip.destroy(),t=!0),t||(this._tableFooter._compactStyle=!0,this._tableFooter._renderInfo(),a=C.size(s,!0).width,l+a<=o&&(t=!0),s.css("max-width",Math.max(o-l-s.cssMarginX(),0)));let d=this._tableFooter.htmlComp.layouted;this._setInfoItemsSize(r,d),this._tableFooter.table.tableControls.forEach(c=>c.revalidateLayout())}_setInfoItemsSize(e,t){e.each(function(){let i=h()(this);if(i.isVisible()&&!i.hasClass("hiding")){let s=i.data("animationComplete");t?(i.stop().cssWidthAnimated(i.data("oldWidth"),i.outerWidth(),{complete:s}),i.removeData("oldWidth")):i.cssWidth(i.outerWidth())}})}}class Qf extends Xi{tableFooter;_init(e){super._init(e),this.tableFooter=e.tableFooter;let t=u.create(J,{parent:this,text:this.session.text("ui.RemoveFilter")});t.on("action",this._onRemoveFilterClick.bind(this)),this.setMenus(t)}_renderText(){let e=this.tableFooter.table,t=e.filteredRows().length,i=e.filteredBy().join(", ");this.$content.appendSpan().text(this.session.text("ui.NumRowsFilteredBy",this.tableFooter.computeCountInfo(t),i))}_onRemoveFilterClick(){this.tableFooter.table.resetUserFilter(),this.destroy()}}class Zf extends Xi{tableFooter;_init(e){super._init(e),this.tableFooter=e.tableFooter;let t=u.create(J,{parent:this,text:this.session.text("ui.ReloadData")});t.on("action",this._onReloadClick.bind(this)),this.setMenus(t)}_renderText(){let e=this.tableFooter.table,t=e.rows.length;this.$content.text(this.session.text("ui.NumRowsLoaded",this.tableFooter.computeCountInfo(t)))}_onReloadClick(){this.tableFooter.table.reload(),this.destroy()}}class eg extends Xi{tableFooter;_init(e){super._init(e),this.tableFooter=e.tableFooter;let t=u.create(J,{parent:this,text:this.session.text("ui.SelectNone")});t.on("action",this._onSelectNoneClick.bind(this));let i=u.create(J,{parent:this,text:this.session.text("ui.SelectAll")});i.on("action",this._onSelectAllClick.bind(this)),this.setMenus([t,i])}_renderText(){let e=this.tableFooter.table,t=e.selectedRows.length;this.$content.text(this.session.text("ui.NumRowsSelected",this.tableFooter.computeCountInfo(t)))}_onSelectNoneClick(){this.tableFooter.table.deselectAll(),this.destroy()}_onSelectAllClick(){this.tableFooter.table.selectAll(),this.destroy()}}class Md extends I{headerMenusEnabled;table;dragging;columnMoved;menuBar;tableHeaderMenu;headerLabelId;$menuBarContainer;$filler;_tableDataScrollHandler;_tableAddFilterRemovedHandler;_tableColumnResizedHandler;_tableColumnMovedHandler;_renderedColumns;_$window;_$body;_fixTimeout;constructor(){super(),this.dragging=!1,this.headerMenusEnabled=!0,this.table=null,this.headerLabelId=null,this._tableDataScrollHandler=this._onTableDataScroll.bind(this),this._tableAddFilterRemovedHandler=this._onTableAddFilterRemoved.bind(this),this._tableColumnResizedHandler=this._onTableColumnResized.bind(this),this._tableColumnMovedHandler=this._onTableColumnMoved.bind(this),this._renderedColumns=[]}_init(e){super._init(e),this.menuBar=u.create(Ce,{parent:this,tabbable:!1,position:Ce.Position.BOTTOM,menuOrder:new Is}),this.menuBar.on("propertyChange",this._onMenuBarPropertyChange.bind(this)),this.updateMenuBar()}_render(){this.$container=this.table.$data.beforeDiv("table-header").cssBorderLeftWidth(this.table.rowBorders.left||""),T.role(this.$container,"row"),this.$filler=this.$container.appendDiv("table-header-item filler").css("visibility","hidden"),this.$menuBarContainer=this.$container.appendDiv("menubar-container").setVisible(this.menuBar.visible),this.menuBar.render(this.$menuBarContainer),this._$window=this.$container.window(),this._$body=this.$container.body(),this._renderColumns(),this.table.$data.on("scroll",this._tableDataScrollHandler),this.table.on("filterAdded",this._tableAddFilterRemovedHandler),this.table.on("filterRemoved",this._tableAddFilterRemovedHandler),this.table.on("columnResized",this._tableColumnResizedHandler),this.table.on("columnMoved",this._tableColumnMovedHandler)}_remove(){this.table.$data.off("scroll",this._tableDataScrollHandler),this.table.off("filterAdded",this._tableAddFilterRemovedHandler),this.table.off("filterRemoved",this._tableAddFilterRemovedHandler),this.table.off("columnResized",this._tableColumnResizedHandler),this.table.off("columnMoved",this._tableColumnMovedHandler),this._removeColumns(),super._remove()}rerenderColumns(){this._removeColumns(),this._renderColumns()}_renderColumns(){let e=this._visibleColumns();e.forEach(this._renderColumn,this),e.length===0&&this.$filler.css("visibility","visible").html(" ").addClass("empty"),this._reconcileScrollPos()}_renderColumn(e,t){let i=e.realWidthIfAvailable(),s=this._visibleColumns(),r=t===0,o=t===s.length-1,l=this.$filler.beforeDiv("table-header-item").setEnabled(this.enabled).data("column",e);T.role(l,"columnheader");let a=C.margins(l);i-=a.horizontal(),l.cssMinWidth(i).cssMaxWidth(i),this.headerLabelId=Z.get().createUiSeqId(),l.appendSpan("table-header-item-text").attr("id",this.headerLabelId),this.enabled&&l.on("click",this._onHeaderItemClick.bind(this)).on("mousedown",this._onHeaderItemMouseDown.bind(this)),yt.applyInfo(e,l),r&&l.addClass("first"),o&&l.addClass("last"),e.$header=l,this._installHeaderItemTooltip(e),this._decorateHeader(e);let d=e.showSeparator;if(o&&!this.enabled&&(d=!1),d){let c=this.$filler.beforeDiv("table-header-resize");T.role(c,"none"),e.fixedWidth||!this.enabled?c.setEnabled(!1):c.on("mousedown","",this._onSeparatorMouseDown.bind(this)).on("dblclick",this._onSeparatorDblclick.bind(this)),e.$separator=c}this._renderedColumns.push(e)}_removeColumns(){this._renderedColumns.slice().forEach(this._removeColumn,this)}_removeColumn(e){e.$header&&(e.$header.remove(),e.$header=null),e.$separator&&(e.$separator.remove(),e.$separator=null),p.remove(this._renderedColumns,e)}resizeHeaderItem(e){if(!e||!e.$header)return;let t=e.$header,i=e.realWidthIfAvailable(),s=C.margins(t),r=this.menuBar.visible?this.$menuBarContainer.outerWidth(!0):0,o=this._visibleColumns(),l=o.indexOf(e),a=l===o.length-1;if(i-=s.horizontal(),a&&r>0){let d=this.$container.width()-this.table.rowWidth+C.insets(this.$container).right;if(d<r){let c=r;e.$separator&&(c+=e.$separator.width()),d>0&&(c-=d);let f=i;i=Math.max(i-c,e.minWidth),this.$filler.cssWidth(f-i)}}t.cssMinWidth(i).cssMaxWidth(i)}resizeHeaderItems(){this._visibleColumns().forEach(this.resizeHeaderItem.bind(this))}_reconcileScrollPos(){let e=this.table.get$Scrollable().scrollLeft(),t=this._lastVisibleColumn();this.resizeHeaderItem(t),this.$container.scrollLeft(e),this.$menuBarContainer.cssRight(-1*e)}_arrangeHeaderItems(e){let t=this;e.each(function(){const i=h()(this),s=i.data("old-left")-i.offset().left;i.cssLeftAnimated(s,0,{progress:function(r,o,l){const a=h()(this);a.isSelected()&&(P.scrollHorizontalTo(t.table.$data,a),t.tableHeaderMenu&&t.tableHeaderMenu.rendered&&t.tableHeaderMenu.position())}})})}_installHeaderItemTooltip(e){Y.install(e.$header,{parent:this,text:this._headerItemTooltipText.bind(this),arrowPosition:50,arrowPositionUnit:"%",originProducer:this._headerItemTooltipOrigin.bind(this),nativeTooltip:!w.get().isCustomEllipsisTooltipPossible(),htmlEnabled:this._headerItemTooltipHtmlEnabled.bind(this)})}_installHeaderItemTooltips(){this._visibleColumns().forEach(this._installHeaderItemTooltip,this)}_uninstallHeaderItemTooltip(e){Y.uninstall(e.$header)}_uninstallHeaderItemTooltips(){this._visibleColumns().forEach(this._uninstallHeaderItemTooltip,this)}_headerItemTooltipText(e){let t=e.data("column");if(t&&_.hasText(t.headerTooltipText))return t.headerTooltipText;let i=e.children(".table-header-item-text");if(i.isContentTruncated()||!this._textInView(i)){let s=_.plainText(i.html(),{trim:!0});if(_.hasText(s))return s}return null}_textInView(e){let t=C.offsetBounds(e),i=this._offsetBoundsWithoutMenuBar();return t.right()<=i.right()&&t.x>=i.x}_headerItemTooltipOrigin(e){let t=C.offsetBounds(e);return this._offsetBoundsWithoutMenuBar().intersect(t)}_offsetBoundsWithoutMenuBar(){let e=C.offsetBounds(this.$container);return e.width-=C.size(this.$menuBarContainer).width,e}_headerItemTooltipHtmlEnabled(e){return e.data("column").headerTooltipHtmlEnabled}setHeaderMenusEnabled(e){this.setProperty("headerMenusEnabled",e)}_renderHeaderMenusEnabled(){this._visibleColumns().forEach(e=>this._decorateHeader(e))}openHeaderMenu(e){this.tableHeaderMenu&&this.closeHeaderMenu(),this.tableHeaderMenu=e.createTableHeaderMenu(this),this.tableHeaderMenu.open(),e.trigger("headerMenuOpen",{menu:this.tableHeaderMenu}),this.tableHeaderMenu.one("destroy",()=>{e.trigger("headerMenuClose",{menu:this.tableHeaderMenu})})}closeHeaderMenu(){this.tableHeaderMenu.destroy(),this.tableHeaderMenu=null}findHeaderItems(){return this.$container.find(".table-header-item:not(.filler)")}updateHeader(e,t){e.visible&&this._decorateHeader(e,t)}_decorateHeader(e,t){this._renderColumnCssClass(e,t),this._renderColumnText(e),this._renderColumnIconId(e),this._renderColumnState(e),this._renderColumnLegacyStyle(e),this._renderColumnHeaderMenuEnabled(e),this._renderColumnHorizontalAlignment(e),this._renderColumnTooltipText(e)}_renderColumnCssClass(e,t){let i=e.$header;t&&i.removeClass(t.headerCssClass),i.addClass(e.headerCssClass)}_renderColumnText(e){let t=e.text,i=e.$header,s=i.children(".table-header-item-text");e.headerHtmlEnabled||(t=_.nl2br(t)),s.htmlOrNbsp(t,"empty"),this._updateColumnIconAndTextStyle(e)}_renderColumnTooltipText(e){if(e.$header&&_.hasText(e.headerTooltipText)){let t=e.$header.appendDiv().addClass("text").text(e.headerTooltipText);T.screenReaderOnly(t)}}_renderColumnIconId(e){e.$header.icon(e.headerIconId),this._updateColumnIconAndTextStyle(e)}_renderColumnHorizontalAlignment(e){e.$header.removeClass("halign-left halign-center halign-right"),e.$header.addClass("halign-"+H.parseHorizontalAlignment(e.horizontalAlignment))}_updateColumnIconAndTextStyle(e){let t=e.$header.data("$icon"),i=e.$header.children(".table-header-item-text");t&&t.toggleClass("with-text",!!e.text),i.setVisible(!(t&&i.html()===" ")),e.$header.toggleClass("table-header-item-icon-only",!!(e.headerIconId&&!e.text))}_renderColumnLegacyStyle(e){L.legacyStyle(e,e.$header,"header")}_renderColumnHeaderMenuEnabled(e){e.$header.toggleClass("disabled",!this._isHeaderMenuEnabled(e)||!this.enabled)}_renderColumnState(e){let t=e.$header,i=e.filtered;t.children(".table-header-item-state").remove();let s=t.appendSpan("table-header-item-state");s.empty(),t.removeClass("sort-asc sort-desc sorted group-asc group-desc grouped filtered"),s.removeClass("sort-asc sort-desc sorted group-asc group-desc grouped filtered");let r="";if(e.sortActive){let a=e.sortAscending?"asc":"desc";r+=this.session.text("ui.Sorting")+" "+(e.sortAscending?this.session.text("ui.ascending"):this.session.text("ui.descending")),e.grouped&&t.addClass("group-"+a),t.addClass("sorted sort-"+a),s.addClass("sorted sort-"+a)}if(e.grouped||i){let a=s.appendDiv("left");if(e.grouped){t.addClass("grouped"),s.addClass("grouped");let d=a.appendDiv().text("G");T.hidden(d,!0),r+=" "+this.session.text("ui.Grouping")}if(i){t.addClass("filtered"),s.addClass("filtered");let d=a.appendDiv().text("F");T.hidden(d,!0),r+=" "+this.session.text("ui.Filter")}}let o=s.appendDiv().addClass("text").text(r);T.screenReaderOnly(o);let l=s.appendDiv("right");T.hidden(l,!0),this._adjustColumnMinWidth(e)}_adjustColumnMinWidth(e){e.sortActive||e.grouped||e.filtered?(e.minWidth<le.DEFAULT_MIN_WIDTH&&(e.__minWidthWithoutState=e.minWidth,e.__widthWithoutState=e.width,e.minWidth=le.DEFAULT_MIN_WIDTH),e.width<e.minWidth&&this.table.resizeColumn(e,e.minWidth)):b.isNullOrUndefined(e.__minWidthWithoutState)||(e.minWidth=e.__minWidthWithoutState,e.width===le.DEFAULT_MIN_WIDTH&&this.table.resizeColumn(e,e.__widthWithoutState),e.__minWidthWithoutState=null,e.__widthWithoutState=null)}updateMenuBar(){let e=this.table._filterMenus(this.table.menus,Ft.HEADER);this.menuBar.setHiddenByUi(!this.enabled),this.menuBar.setMenuItems(e)}_onTableColumnResized(e){let t=e.column,i=this._lastVisibleColumn();this.resizeHeaderItem(t),i!==t&&this.resizeHeaderItem(i)}onSortingChanged(){this._visibleColumns().forEach(this._renderColumnState,this)}_onTableColumnMoved(e){const t=this.findHeaderItems();t.each(function(){h()(this).data("old-left",h()(this).offset().left)});const i=e.oldPos,s=e.newPos,r=t.eq(i),o=t.eq(s),l=r.next(".table-header-resize");s<i?o.before(r):(o.after(r),r.before(r.next(".table-header-resize"))),r.after(l),t.length>0&&(t.eq(0).removeClass("first"),t.eq(t.length-1).removeClass("last"));const a=this._visibleColumns(),d=a.length-1;a.length>0&&(a[0].$header.addClass("first"),a[d].$header.addClass("last")),(i===d||s===d)&&a.forEach(c=>this.resizeHeaderItem(c)),this.dragging||this._arrangeHeaderItems(h()([r[0],o[0]]))}_visibleColumns(){return this.table.visibleColumns()}_lastVisibleColumn(){return p.last(this._visibleColumns())}onOrderChanged(e){let t=this.findHeaderItems();t.each(function(){h()(this).data("old-left",h()(this).offset().left)}),this._visibleColumns().forEach(i=>{let s=i.$header,r=s.next(".table-header-resize");this.$container.append(s),this.$container.append(r)}),this.$container.append(this.$filler),this._arrangeHeaderItems(t)}_isHeaderMenuEnabled(e){return!!(e.headerMenuEnabled&&this.headerMenusEnabled)}_onHeaderItemClick(e){let t=h()(e.currentTarget),i=t.data("column");return this.dragging||this.columnMoved?(this.dragging=!1,this.columnMoved=!1):this.table.sortEnabled&&(e.shiftKey||e.ctrlKey||!this._isHeaderMenuEnabled(i))?this.table.sort(i,t.hasClass("sort-asc")?"desc":"asc",e.shiftKey):this.tableHeaderMenu&&this.tableHeaderMenu.isOpenFor(t)?this.closeHeaderMenu():this._isHeaderMenuEnabled(i)&&this.openHeaderMenu(i),!1}_onHeaderItemMouseDown(e){if(e.button>0)return;let t=0,i=this,s=Math.floor(e.pageX),r=h()(e.currentTarget),o=r.data("column"),l=this._visibleColumns().indexOf(o),a=l,d=r.outerWidth(),c=r.siblings(".table-header-item:not(.filler)");if(o.fixedPosition)return;this.dragging=!1,this.columnMoved=!1,this._$window.on("mousemove.tableheader","",f).one("mouseup","",v);function f(D){if(t=Math.floor(D.pageX)-s,-2<t&&t<2)return;i.dragging=!0,r.addClass("moving"),i.$container&&i.$container.addClass("moving"),r.css("left",t);let k=y(r);c.each(function(V){let Q=h()(this),ve=y(Q);k<ve&&V<l?Q.css("left",d):k>ve&&V>=l?Q.css("left",-d):Q.css("left",0)}),i.tableHeaderMenu&&(i.tableHeaderMenu.destroy(),i.tableHeaderMenu=null),i.rendered&&i._uninstallHeaderItemTooltips()}function g(D){let k=D.html(),V=D.html("<span>"+k+"</span>").find("span:first").width();return D.html(k),V}function y(D){return D.hasClass("halign-right")?D.offset().left+D.outerWidth()-g(D)/2:D.offset().left+g(D)/2}function v(D){if(i._$window&&i._$window.off("mousemove.tableheader"),!i.dragging)return!0;(t<0?c:h()(c.get().reverse())).each(function(ve){if(h()(this).css("left")!=="0px")return a=i._visibleColumns().indexOf(h()(this).data("column")),!1});const V=r.offset().left;if(i.table.moveColumn(r.data("column"),a)){const ve=r.cssLeft()+V-r.offset().left;r.css("left",ve).addClass("releasing").animateAVCSD("left",0,()=>r.removeClass("releasing")),i.dragging=!1,i.columnMoved=!0}else r.addClass("releasing"),r.animateAVCSD("left","",()=>{i.dragging=!1,r.removeClass("releasing")});c.each(function(){h()(this).css("left","")}),r.removeClass("moving"),i.$container&&i.$container.removeClass("moving"),i.rendered&&i._installHeaderItemTooltips()}}_onSeparatorDblclick(e){if(!(e.button>0))if(e.shiftKey)this._visibleColumns().forEach(t=>{this.table.resizeToFit(t)});else{let i=h()(e.target).prev().data("column");this.table.resizeToFit(i)}}_onSeparatorMouseDown(e){if(e.button>0)return;let t=Math.floor(e.pageX),i=h()(e.target).prev(),s=i.data("column"),r=this,o=s.width,l=this.$container.appendDiv("table-column-resize-helper").css("width",this.table.rowWidth+this.table.rowBorders.horizontal()),a=this.table.$data.appendDiv("table-column-resize-helper").css("width",this.table.rowWidth);this._$window.on("mousemove.tableheader",d).one("mouseup",c),this._$body.addClass("col-resize"),e.preventDefault();function d(f){let g=Math.floor(f.pageX)-t,y=o+g;y=Math.max(y,s.minWidth),r.rendered&&y!==s.width&&r.table.resizeColumn(s,y)}function c(f){l.remove(),a.remove(),r._$window&&r._$window.off("mousemove.tableheader"),r._$body&&r._$body.removeClass("col-resize"),r.table.rendered&&s.width!==o&&r.table.resizeColumn(s,s.width)}}_onTableDataScroll(){P.fix(this.$menuBarContainer),this._reconcileScrollPos(),this._fixTimeout=P.unfix(this.$menuBarContainer,this._fixTimeout)}_onMenuBarPropertyChange(e){this.rendered&&e.propertyName==="visible"&&this.$menuBarContainer.setVisible(e.newValue)}_onTableAddFilterRemoved(e){if(!(e.filter instanceof Oi))return;let t=e.filter.column;e.filter.filterType===Oi.TYPE&&t.$header&&this._renderColumnState(t)}}class Bi extends _e{column;tableHeader;compact;table;filterTable;filter;filterCheckedMode;filterSortMode;hasFilterTable;hasFilterFields;leftGroups;moveGroup;hierarchyGroup;toBeginButton;forwardButton;backwardButton;toEndButton;sortingGroup;sortAscButton;sortDescButton;sortAscAddButton;sortDescAddButton;columnActionsGroup;addColumnButton;removeColumnButton;modifyColumnButton;groupButton;groupAddButton;barChartButton;colorGradient1Button;colorGradient2Button;collapseAllButton;expandAllButton;sumButton;averageButton;minimumButton;maximumButton;filterFieldsGroupBox;$rightGroups;$headerItem;$columnActions;$columnFilters;$filterTableGroup;$filterToggleChecked;$filterTableGroupTitle;$filterSortOrder;$filterFieldsGroup;$body;_onColumnMovedHandler;_tableFilterHandler;_tableHeaderScrollHandler;_filterTableRowsCheckedHandler;constructor(){super(),this.column=null,this.tableHeader=null,this.table=null,this.filter=null,this.filterCheckedMode=Bi.CheckedMode.ALL,this.filterSortMode=Bi.SortMode.ALPHABETICALLY,this.hasFilterTable=!1,this.hasFilterFields=!1,this.animateOpening=!0,this.animateRemoval=!0,this.focusableContainer=!0,this.leftGroups=[],this.moveGroup=null,this.toBeginButton=null,this.forwardButton=null,this.backwardButton=null,this.toEndButton=null,this.sortingGroup=null,this.sortDescButton=null,this.sortAscAddButton=null,this.sortDescAddButton=null,this.columnActionsGroup=null,this.addColumnButton=null,this.removeColumnButton=null,this.modifyColumnButton=null,this.groupButton=null,this.groupAddButton=null,this.barChartButton=null,this.colorGradient1Button=null,this.colorGradient2Button=null,this.collapseAllButton=null,this.expandAllButton=null,this.sumButton=null,this.averageButton=null,this.minimumButton=null,this.maximumButton=null,this.$rightGroups=[],this.$headerItem=null,this.$columnActions=null,this.$columnFilters=null,this.$filterTableGroup=null,this.$filterToggleChecked=null,this.$filterTableGroupTitle=null,this.$filterSortOrder=null,this.$filterFieldsGroup=null,this._onColumnMovedHandler=this._onColumnMoved.bind(this),this._tableHeaderScrollHandler=this._onAnchorScroll.bind(this),this.inheritAccessibility=!1}static CheckedMode={ALL:{checkAll:!0,text:"ui.SelectAllFilter"},NONE:{checkAll:!1,text:"ui.SelectNoneFilter"}};static SortMode={ALPHABETICALLY:{text:"ui.SortAlphabeticallyFilter",cssClass:"table-header-menu-toggle-sort-order-alphabetically"},AMOUNT:{text:"ui.SortByAmountFilter",cssClass:"table-header-menu-toggle-sort-order-amount"}};_init(e){e.scrollType=e.scrollType||"none",super._init(e),this.tableHeader=e.tableHeader,this.column=e.column,this.table=this.tableHeader.table,this.$headerItem=this.$anchor,this.table.on("columnMoved",this._onColumnMovedHandler),this.filter=this.table.getFilter(this.column.id),this.filter||(this.filter=this.column.createFilter()),this.filter.calculate(),this.filter.on("filterFieldsChanged",this._updateFilterTable.bind(this)),this._updateFilterTableCheckedMode(),this.hasFilterTable=this.filter.availableValues.length>0,this.hasFilterFields=this.filter.hasFilterFields,this.hasFilterTable&&(this._tableFilterHandler=this._onFilterTableChanged.bind(this),this.table.on("filterAdded",this._tableFilterHandler),this.table.on("filterRemoved",this._tableFilterHandler),this._filterTableRowsCheckedHandler=this._onFilterTableRowsChecked.bind(this))}_createLayout(){return new vn(this)}_render(){this.leftGroups=[],this.$rightGroups=[],this.$headerItem.select(!0),this.$container=this.$parent.appendDiv("popup table-header-menu"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout()),this.$body=this.$container.appendDiv("table-header-menu-body"),x.install(this.$body,this.session),this._installScrollbars({axis:"y",scrollShadow:"none"}),this.$columnActions=this.$body.appendDiv("table-header-menu-actions"),x.install(this.$columnActions,this.session),(this.hasFilterTable||this.hasFilterFields)&&(this.$columnFilters=this.$body.appendDiv("table-header-menu-filters"),x.install(this.$columnFilters,this.session).setLayout(new Si)),this.tableHeader.$container.on("scroll",this._tableHeaderScrollHandler),this.table.visibleColumns().filter(t=>!t.fixedPosition).length>1&&!this.column.fixedPosition&&this.leftGroups.push(this._renderMovingGroup()),this.table.sortEnabled&&this.leftGroups.push(this._renderSortingGroup()),this._isColumnActionsGroupVisible()&&this.leftGroups.push(this._renderColumnActionsGroup()),(this.table.isGroupingPossible(this.column)||this.column.grouped)&&this.leftGroups.push(this._renderGroupingGroup()),this.leftGroups.push(this._renderHierarchyGroup()),this.column.fixedWidth||this.leftGroups.push(this._renderWidthGroup()),this.table.isAggregationPossible(this.column)&&this.leftGroups.push(this._renderAggregationGroup()),this.column instanceof Bt&&this.leftGroups.push(this._renderColoringGroup()),this.hasFilterTable&&this.$rightGroups.push(this._renderFilterTable()),this.hasFilterFields&&this.$rightGroups.push(this._renderFilterFields()),this._onColumnMoved(),this.table.enabled&&this.table.$container.addClass("focused")}validateFocus(){this.filterFieldsGroupBox&&this.filterFieldsGroupBox.focus(),super.validateFocus()}get$Scrollable(){return this.$body}_updateFirstLast(){e(this.leftGroups.filter(i=>i.visible)),e(this.$rightGroups);function e(i){i.forEach((s,r,o)=>{t(s,"first",r===0),t(s,"last",r===o.length-1)})}function t(i,s,r){(i instanceof Zi?i.$container:i).toggleClass(s,r)}}_remove(){this.filterTable&&this.filterTable.off("rowsChecked",this._filterTableRowsCheckedHandler),this.tableHeader.rendered&&this.tableHeader.$container.off("scroll",this._tableHeaderScrollHandler),this.$headerItem.select(!1),this.table.off("columnMoved",this._onColumnMovedHandler),this.table.off("filterAdded",this._tableFilterHandler),this.table.off("filterRemoved",this._tableFilterHandler),super._remove(),this.table.rendered&&this.table.$container.removeClass("focused")}_renderMovingGroup(){let e=this.table,t=this.column;return this.moveGroup=u.create(Zi,{parent:this,textKey:"ui.Move",cssClass:"first"}),this.toBeginButton=u.create(st,{parent:this.moveGroup,text:"${textKey:ui.toBegin}",cssClass:"move move-top"}),this.toBeginButton.on("action",()=>{e.moveColumn(t,0)}),this.forwardButton=u.create(st,{parent:this.moveGroup,text:"${textKey:ui.forward}",cssClass:"move move-up"}),this.forwardButton.on("action",()=>{let i=e.visibleColumns().indexOf(t);e.moveColumn(t,Math.max(i-1,0))}),this.backwardButton=u.create(st,{parent:this.moveGroup,text:"${textKey:ui.backward}",cssClass:"move move-down"}),this.backwardButton.on("action",()=>{let i=e.visibleColumns().indexOf(t);e.moveColumn(t,Math.min(i+1,e.header.findHeaderItems().length-1))}),this.toEndButton=u.create(st,{parent:this.moveGroup,text:"${textKey:ui.toEnd}",cssClass:"move move-bottom"}),this.toEndButton.on("action",()=>{e.moveColumn(t,e.header.findHeaderItems().length-1)}),this.moveGroup.render(this.$columnActions),this.moveGroup}_onColumnMoved(){let e=this.column;if(this.moveGroup){let t=this.table.organizer.isColumnMovableToLeft(e),i=this.table.organizer.isColumnMovableToRight(e);this.toBeginButton.setEnabled(t),this.forwardButton.setEnabled(t),this.backwardButton.setEnabled(i),this.toEndButton.setEnabled(i)}this.hierarchyGroup.setVisible(this.table.isTableNodeColumn(e)),this._updateFirstLast()}_isColumnActionsGroupVisible(){return this.table.isColumnAddable()||this.table.isColumnRemovable(this.column)||this.table.isColumnModifiable(this.column)}_renderColumnActionsGroup(){return this.columnActionsGroup=u.create(Zi,{parent:this,textKey:"ui.Column"}),this.addColumnButton=u.create(st,{parent:this.columnActionsGroup,text:"${textKey:ui.addColumn}",cssClass:"add-column",visible:this.table.isColumnAddable()}),this.addColumnButton.on("action",()=>{this.close(),this.table.organizer.addColumn(this.column)}),this.removeColumnButton=u.create(st,{parent:this.columnActionsGroup,text:"${textKey:ui.removeColumn}",cssClass:"remove-column",visible:this.table.isColumnRemovable(this.column)}),this.removeColumnButton.on("action",()=>{this.close(),this.table.organizer.removeColumns([this.column])}),this.modifyColumnButton=u.create(st,{parent:this.columnActionsGroup,text:"${textKey:ui.changeColumn}",cssClass:"change-column",visible:this.table.isColumnModifiable(this.column)}),this.modifyColumnButton.on("action",()=>{this.close(),this.table.organizer.modifyColumn(this.column)}),this.columnActionsGroup.render(this.$columnActions),this.columnActionsGroup}_renderSortingGroup(){let e=this.table,t=this.column,i=this;return this.sortingGroup=u.create(Zi,{parent:this,textKey:"ColumnSorting"}),e.hasPermanentHeadOrTailSortColumns()||(this.sortAscButton=u.create(st,{parent:this.sortingGroup,text:"${textKey:ui.ascending}",cssClass:"sort sort-asc",direction:"asc",toggleAction:!0}),this.sortAscButton.on("action",s.bind(this.sortAscButton)),this.sortDescButton=u.create(st,{parent:this.sortingGroup,text:"${textKey:ui.descending}",cssClass:"sort sort-desc",direction:"desc",toggleAction:!0}),this.sortDescButton.on("action",s.bind(this.sortDescButton))),this.sortAscAddButton=u.create(st,{parent:this.sortingGroup,text:"${textKey:ui.ascendingAdditionally}",cssClass:"sort sort-asc-add",direction:"asc",toggleAction:!0}),this.sortAscAddButton.on("action",r.bind(this.sortAscAddButton)),this.sortDescAddButton=u.create(st,{parent:this.sortingGroup,text:"${textKey:ui.descendingAdditionally}",cssClass:"sort sort-desc-add",direction:"desc",toggleAction:!0}),this.sortDescAddButton.on("action",r.bind(this.sortDescAddButton)),this._updateSortingSelectedState(),this.sortingGroup.render(this.$columnActions),this.sortingGroup;function s(){i.close(),o(this.direction,!1,!this.selected)}function r(){i.close(),o(this.direction,!0,!this.selected)}function o(l,a,d){e.sort(t,l,a,d),i._updateSortingSelectedState()}}_updateSortingSelectedState(){if(!this.table.sortEnabled)return;let e=!1,t=this._sortColumnCount();if(this.sortingGroup.children.forEach(i=>i.setSelected(!1)),t===1&&!this.table.hasPermanentHeadOrTailSortColumns())this.column.sortActive?this.column.sortAscending?this.sortAscButton.setSelected(!0):this.sortDescButton.setSelected(!0):e=!0;else if((t>1||this.table.hasPermanentHeadOrTailSortColumns())&&(e=!0,this.column.sortActive)){this.column.sortAscending?this.sortAscAddButton.setSelected(!0):this.sortDescAddButton.setSelected(!0);let i=this.column.sortIndex+1+"";this.sortAscAddButton.setIconId(i),this.sortDescAddButton.setIconId(i)}this.sortAscAddButton.setVisible(e),this.sortDescAddButton.setVisible(e)}_renderGroupingGroup(){let e=this,t=this.table,i=this.column,s=this._groupColumnCount(),r=u.create(Zi,{parent:this,textKey:"ui.Grouping"});return this.groupButton=u.create(st,{parent:r,text:"${textKey:ui.groupingApply}",cssClass:"group",additional:!1,toggleAction:!0}),this.groupButton.on("action",o.bind(this.groupButton)),this.groupAddButton=u.create(st,{parent:r,text:"${textKey:ui.additionally}",cssClass:"group-add",additional:!0,toggleAction:!0}),this.groupAddButton.on("action",o.bind(this.groupAddButton)),s===0?this.groupAddButton.setVisible(!1):s===1&&this.column.grouped?(this.groupButton.setSelected(!0),this.groupAddButton.setVisible(!1)):s>1&&this.groupAddButton.setVisible(!0),t.hasPermanentHeadOrTailSortColumns()&&s>0&&(this.groupButton.setVisible(!1),this.groupAddButton.setVisible(!0)),this.column.grouped&&(s===1?this.groupAddButton.setSelected(!0):s>1&&(this.groupAddButton.setSelected(!0),this.groupAddButton.setIconId(this.column.sortIndex+1+""))),r.render(this.$columnActions),r;function o(){let l=i.sortIndex>=0&&!i.sortAscending?"desc":"asc";e.close(),t.group(i,l,this.additional,!this.selected)}}_renderHierarchyGroup(){let e=this.table,t=this;return this.hierarchyGroup=u.create(Zi,{parent:this,textKey:"ui.Hierarchy",visible:this.table.isTableNodeColumn(this.column)}),this.collapseAllButton=u.create(st,{parent:this.hierarchyGroup,text:"${textKey:ui.CollapseAll}",cssClass:"hierarchy-collapse-all",enabled:!!p.find(e.rows,i=>i.expanded&&!p.empty(i.childRows))}),this.collapseAllButton.on("action",()=>{t.close(),e.collapseAll()}),this.expandAllButton=u.create(st,{parent:this.hierarchyGroup,text:"${textKey:ui.ExpandAll}",cssClass:"hierarchy-expand-all",enabled:!!p.find(e.rows,i=>!i.expanded&&!p.empty(i.childRows))}),this.expandAllButton.on("action",()=>{t.close(),e.expandAll()}),this.hierarchyGroup.render(this.$columnActions),this.hierarchyGroup}_renderWidthGroup(){let e=u.create(Zi,{parent:this,textKey:"Width"});u.create(st,{parent:e,text:"${textKey:ui.optimizeWidth}",cssClass:"optimize-width"}).on("action",()=>{this.table.resizeToFit(this.column),this.close()}),u.create(st,{parent:e,text:"${textKey:ui.optimizeWidthAll}",cssClass:"optimize-widths"}).on("action",()=>{this.table.visibleColumns().forEach(r=>this.table.resizeToFit(r)),this.close()});let s=u.create(ps,{parent:e,cssClass:"table-header-menu-command width no-mandatory-indicator",label:"${textKey:Width}",labelVisible:!1,clearable:ge.Clearable.NEVER,value:this.column.width,minValue:this.column.minWidth,gridData:{horizontalAlignment:0}});return s.on("propertyChange:value",()=>{this.table.resizeColumn(this.column,s.value)}),s.computeGroupSuffix=()=>this.session.text("ui.adjust"),e.render(this.$columnActions),x.install(e.$container,this.session),e}_renderAggregationGroup(){let e=this.table,t=this.column,i=t.aggregationFunction,s=this,r=u.create(Zi,{parent:this,textKey:"ui.Aggregation"}),o=p.ensure(t.allowedAggregationFunctions),l=o.indexOf("none")!==-1;return this.sumButton=a("${textKey:ui.Sum}","sum"),this.averageButton=a("${textKey:ui.Average}","avg"),this.minimumButton=a("${textKey:ui.Minimum}","min"),this.maximumButton=a("${textKey:ui.Maximum}","max"),r.children.forEach(c=>c.setSelected(c.aggregation===i)),r.render(this.$columnActions),r;function a(c,f){if(o.indexOf(f)!==-1){let g=u.create(st,{parent:r,text:c,cssClass:"aggregation-function "+f,aggregation:f,toggleAction:l});return g.on("action",d.bind(g)),g}return null}function d(){s.close(),e.changeAggregation(t,this.aggregation===i?"none":this.aggregation)}}_renderColoringGroup(){let e=this.table,t=this.column,i=this,s=t.backgroundEffect,r=u.create(Zi,{parent:this,textKey:"ui.Coloring"});return this.colorGradient1Button=u.create(st,{parent:r,text:"${textKey:ui.fromRedToGreen}",cssClass:"color color-gradient1",backgroundEffect:"colorGradient1",toggleAction:!0}),this.colorGradient1Button.on("action",o.bind(this.colorGradient1Button)),this.colorGradient2Button=u.create(st,{parent:r,text:"${textKey:ui.fromGreenToRed}",cssClass:"color color-gradient2",backgroundEffect:"colorGradient2",toggleAction:!0}),this.colorGradient2Button.on("action",o.bind(this.colorGradient2Button)),w.get().supportsCssGradient()&&(this.barChartButton=u.create(st,{parent:r,text:"${textKey:ui.withBarChart}",cssClass:"color color-bar-chart",backgroundEffect:"barChart",toggleAction:!0}),this.barChartButton.on("action",o.bind(this.barChartButton))),r.children.forEach(l=>l.setSelected(l.backgroundEffect===s)),r.render(this.$columnActions),r;function o(){i.close(),e.setColumnBackgroundEffect(t,this.selected?this.backgroundEffect:null)}}_renderFilterTable(){this.$filterTableGroup=this.$columnFilters.appendDiv("table-header-menu-group first"),x.install(this.$filterTableGroup,this.session).setLayout(new Si);let t=this.$filterTableGroup.appendDiv("table-header-menu-filter-actions");this.$filterSortOrder=t.appendDiv("link table-header-menu-toggle-sort-order").on("click",this._onSortModeClick.bind(this)).addClass(this.filterSortMode.cssClass),this.$filterToggleChecked=t.appendDiv("link table-header-menu-filter-toggle-checked").text(this.session.text(this.filterCheckedMode.text)).on("click",this._onFilterCheckedModeClick.bind(this)),this.$filterTableGroupTitle=this.$filterTableGroup.appendDiv("table-header-menu-group-text").text(this._filterByText()),x.install(this.$filterTableGroupTitle,this.session),this.filterTable=this._createFilterTable(),this.filterTable.accessibilityRenderer=new Fo,this.filterTable.on("rowsChecked",this._filterTableRowsCheckedHandler);let i=[];return this.filter.availableValues.forEach(s=>{let r={cells:[u.create(_t,{text:this.filter.column instanceof Bt?s.text:null,value:this.filter.column instanceof Bt?s.key:s.text,iconId:s.iconId,htmlEnabled:s.htmlEnabled,cssClass:s.cssClass}),s.count,s.key===null?1:0],checked:this.filter.selectedValues.indexOf(s.key)>-1,dataMap:{filterValue:s}};i.push(r)}),this.filterTable.insertRows(i),this.filterTable.render(this.$filterTableGroup),T.linkElementWithLabel(this.filterTable.$container,this.$filterTableGroupTitle),setTimeout(this.filterTable.revealChecked.bind(this.filterTable)),this.$filterTableGroup}_createFilterTable(){let e=le;return this.column instanceof Bt&&(e=Bt),u.create(H,{parent:this,headerVisible:!1,multiSelect:!1,autoResizeColumns:!0,checkable:!0,cssClass:"table-header-menu-filter-table",checkableStyle:H.CheckableStyle.TABLE_ROW,columns:[{objectType:e,text:"filter-value",width:120,sortIndex:1,horizontalAlignment:-1},{objectType:Bt,text:"aggregate-count",cssClass:"table-header-menu-filter-number-column",width:50,minWidth:32,autoOptimizeWidth:!0},{objectType:Bt,displayable:!1,sortIndex:0}]})}_filterByText(){let e=this.session.text("ui.Filter"),t=this.filter.selectedValues.length,i=this.filter.availableValues.length;return t&&i?e+=" "+this.session.text("ui.FilterInfoXOfY",t+"",i+""):i&&(e+=" "+this.session.text("ui.FilterInfoCount",i+"")),e}_onFilterCheckedModeClick(){let e=Bi.CheckedMode,t=this.filterCheckedMode.checkAll;this.filter.selectedValues=[],this.filterCheckedMode===e.ALL?(this.filterCheckedMode=e.NONE,this.filter.availableValues.forEach(i=>this.filter.selectedValues.push(i.key))):this.filterCheckedMode=e.ALL,this.filterTable.checkAll(t),this._updateFilterTableActions()}_onSortModeClick(){let e=Bi.SortMode;this.filterSortMode===e.ALPHABETICALLY?(this.filterTable.sort(this.filterTable.columns[1],"desc"),this.filterSortMode=e.AMOUNT):(this.filterTable.sort(this.filterTable.columns[2],"asc"),this.filterTable.sort(this.filterTable.columns[0],"asc",!0),this.filterSortMode=e.ALPHABETICALLY),this._updateFilterTableActions()}_updateFilterTable(){this.filter.filterActive()?this.table.addFilter(this.filter):this.table.removeFilterByKey(this.column.id)}_updateFilterTableActions(){this.$filterToggleChecked.text(this.session.text(this.filterCheckedMode.text));let e=Bi.SortMode,t=this.filterSortMode===Bi.SortMode.ALPHABETICALLY;this.$filterSortOrder.toggleClass(e.ALPHABETICALLY.cssClass,t),this.$filterSortOrder.toggleClass(e.AMOUNT.cssClass,!t)}_renderFilterFields(){this.filterFieldsGroupBox=u.create(ef,{parent:this,filter:this.filter}),this.$filterFieldsGroup=this.$columnFilters.appendDiv("table-header-menu-group");let e=x.install(this.$filterFieldsGroup,this.session);e.setLayout(new Si);let t=this.$filterFieldsGroup.appendDiv("table-header-menu-group-text").text(this.filter.filterFieldsTitle());return e=x.install(t,this.session),this.filterFieldsGroupBox.render(this.$filterFieldsGroup),this.filterFieldsGroupBox.linkFieldsWithTitle(t),this.$filterFieldsGroup}isOpenFor(e){return this.rendered&&this.belongsTo(e)}_sortColumnCount(){return this.table.visibleSortColumnsCount()}_groupColumnCount(){return this.table.visibleGroupColumnsCount()}_renderCompact(){this.$body.toggleClass("compact",this.compact),this.invalidateLayoutTree()}setCompact(e){this.setProperty("compact",e)}_position(e){let t=C.offsetBounds(this.$headerItem),i=C.offsetBounds(this.tableHeader.$container),s=t.x<i.right()&&t.right()>i.x;this.$container.setVisible(s),super._position(e)}_onAnchorScroll(e){this.position()}_onFilterTableRowsChecked(e){this.filter.selectedValues=[],this.filterTable.rows.forEach(t=>{t.checked&&this.filter.selectedValues.push(t.dataMap.filterValue.key)}),this._updateFilterTable()}_onFilterTableChanged(){this.$filterTableGroupTitle.text(this._filterByText()),this._updateFilterTableCheckedMode(),this._updateFilterTableActions()}_updateFilterTableCheckedMode(){this.filter.selectedValues.length===0?this.filterCheckedMode=Bi.CheckedMode.ALL:this.filterCheckedMode=Bi.CheckedMode.NONE}_onMouseDownOutside(e){this.$headerItem.isOrHas(e.target)||this.close()}}class vn extends xi{constructor(e){super(e),this.doubleCalcPrefSize=!1}static TABLE_MAX_HEIGHT=330;layout(e){if(super.layout(e),!this.popup.hasFilterFields&&!this.popup.hasFilterTable)return;let t,i=this.popup.$columnFilters,s=C.insets(i),r=C.margins(i),o=new F;if(this.popup.$body.hasClass("compact")?t=x.get(i).prefSize():(t=this.preferredLayoutSize(e).subtract(C.insets(e)),t=t.subtract(r)),t.width=i.cssWidth(),i.cssHeight(t.height),this.popup.hasFilterFields){let d=this.popup.$filterFieldsGroup;x.get(d.find(".form-field")).setSize(new F(t.width-s.horizontal(),this._filterFieldsGroupBoxHeight())),o=C.size(d,!0)}if(this.popup.hasFilterTable){let d=this.popup.$filterTableGroup,c=C.insets(d),f=this.popup.filterTable.htmlComp,g=t.height-s.vertical();g-=o.height,g-=this._groupTitleHeight(d),g-=c.vertical(),g=Math.min(g,vn.TABLE_MAX_HEIGHT),f.setSize(new F(t.width-s.horizontal(),g))}this._setMaxWidth();let l=x.get(this.popup.$columnActions),a=l.size();this._setMaxWidth(a.width),l.validateLayout()}_adjustSizeWithAnchor(e){let t=this.popup.htmlComp,i=this.popup.windowPaddingX,s=t.margins(),r=t.offsetBounds(),a=this.popup.$container.window().width()-s.horizontal()-r.x-i;return r.width>a&&(this.popup.$body.addClass("compact"),e=this.preferredLayoutSize(this.popup.$container)),super._adjustSizeWithAnchor(e)}_groupTitleHeight(e){return C.size(e.find(".table-header-menu-group-text"),!0).height}_filterFieldsGroupBoxHeight(){return this.popup.filterFieldsGroupBox.htmlComp.prefSize().height}preferredLayoutSize(e,t){let i=0,s=0,r=C.insets(e),o=this._getMaxWidth();if(this._setMaxWidth(),s=C.size(this.popup.$columnActions,!0).height,this.popup.hasFilterTable){let a=this.popup.$filterTableGroup,d=this.popup.filterTable.htmlComp.size(!0).height,c=C.insets(a);d=Math.min(d,vn.TABLE_MAX_HEIGHT);let f=d;f+=this._groupTitleHeight(a),f+=c.vertical(),i+=f}if(this.popup.hasFilterFields){let a=this.popup.$filterFieldsGroup,d=C.insets(a),c=this._filterFieldsGroupBoxHeight();c+=this._groupTitleHeight(a),c+=d.vertical(),i+=c}if(this.popup.hasFilterFields||this.popup.hasFilterTable){let a=C.margins(this.popup.$columnFilters),d=C.insets(this.popup.$columnFilters);i+=a.vertical(),i+=d.vertical()}let l=C.prefSize(e);return this.popup.$body.hasClass("compact")?l.height=s+i+r.vertical():l.height=Math.max(s,i)+r.vertical(),this._setMaxWidth(o),l}_getMaxWidth(){return parseInt(this.popup.$columnActions.css("max-width"),10)}_setMaxWidth(e){this.popup.$columnActions.css("max-width",e||"")}}class Zi extends I{text;textKey;last;$text;constructor(){super(),this.text=null,this.textKey=null,this.last=!1}_init(e){super._init(e),this.text=u.nvl(this.text,this.session.text(this.textKey))}_render(){this.$container=this.$parent.appendDiv("table-header-menu-group buttons"),this.$text=this.$container.appendDiv("table-header-menu-group-text"),this.cssClass&&this.$container.addClass(this.cssClass),this._renderText(),this.children.forEach(e=>{e.render(),tg(e)&&this._installGroupItem(e)}),Fe.updateFirstLastMarker(this.children)}appendText(e){this.text=this.session.text(this.textKey)+" "+e,this.rendered&&this._renderText()}resetText(){let e=this._getFocusedGroupItem();e?this.appendText(e.computeGroupSuffix()):this.setText(this.session.text(this.textKey))}setText(e){this.text=e,this.rendered&&this._renderText()}_renderText(){this.$text.text(this.text)}_getFocusedGroupItem(){if(!this.rendered)return null;let e=u.widget(this.$container.activeElement());return this.has(e)&&tg(e)?e:null}setLast(e){this.setProperty("last",e)}_renderLast(){this.$container.toggleClass("last",this.last)}_installGroupItem(e){T.label(e.$container,null),T.linkElementWithLabel($(e.getFocusableElement()),this.$text,wi.FRONT,!0),e.$container.on("focusin mouseenter",()=>this.appendText(e.computeGroupSuffix())).on("focusout mouseleave",()=>{e.isFocused()||this.resetText()})}}function tg(n){return Reflect.has(n,"computeGroupSuffix")}class st extends ce{aggregation;backgroundEffect;direction;additional;$icon;constructor(){super(),this.textVisible=!1,this.tabbable=!0,this.actionStyle=ce.ActionStyle.BUTTON}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new yl(this))}_render(){super._render(),this.$container=this.$container.addClass("table-header-menu-command button").unfocusable(),this.$icon=this.$container.appendSpan("icon font-icon")}_renderProperties(){super._renderProperties(),this._renderToggleAction()}_renderToggleAction(){super._renderToggleAction(),this.$container.toggleClass("togglable",this.toggleAction)}computeGroupSuffix(){return this.selected?this.session.text("ui.remove"):this.text}_renderIconId(){this.iconId?this.$icon.attr("data-icon",this.iconId):this.$icon.removeAttr("data-icon")}}class kd extends ne{table;_dataHeightPositive;constructor(e){super(),this.table=e,this._dataHeightPositive=!1}layout(e){let t=0,i=0,s=0,r=0,o=0,l=this.table.tableTileGridMediator?this.table.tableTileGridMediator.tileAccordion:null,a=this.table.$data,d=C.margins(u.nvl(a,this.table.$container)),c=d.top+d.bottom,f=this.table.menuBar,g=this.table.footer,y=this.table.header,v=this.table.tileTableHeader,D=this.table.visibleColumns(),k=D[D.length-1],V=this.table.htmlComp,Q=V.availableSize({exact:!0}).subtract(V.insets());if(this.table.menuBarVisible&&f.visible){let nt=x.get(f.$container),ei=Fs.size(nt,Q);nt.setSize(ei),t=ei.height}if(e.css("--menubar-height",t+"px"),y&&(s=C.size(y.$container).height,y.menuBar&&y.menuBar.validateLayout()),g){i=C.size(g.$container).height,o=g.computeControlContainerHeight(this.table,g.selectedControl,!this._dataHeightPositive);let nt=C.insets(g.$controlContainer);g.animating||(g.$controlContainer.cssHeight(o),g.$controlContent.outerHeight(o-nt.vertical()),g.revalidateLayout())}if(v&&v.visible){let nt=v.htmlComp.prefSize({widthHint:Q.width});nt.width=Q.width,nt=nt.subtract(v.htmlComp.margins()),v.htmlComp.setSize(nt),r=nt.height}let ve=c+t+o+i+s+r,Ze=Q.height-ve;e.css("--controls-height",ve+"px"),a?(a.css("height","calc(100% - "+ve+"px)"),this._dataHeightPositive=a.height()>0):l&&l.htmlComp&&(l.htmlComp.setSize(new F(Q.width,Ze)),P.update(l.$container),this._dataHeightPositive=Ze>0),this.table.tileMode||(this._layoutColumns(),y&&y.resizeHeaderItem(k),this.table.setViewRangeSize(this.table.calculateViewRangeSize()),V.layouted||this.table._renderScrollTop(),this.table._renderViewport(),V.layouted||this.table._renderScrollTop(),this.table.cellEditorPopup&&this.table.cellEditorPopup.rendered&&(this.table.cellEditorPopup.position(),this.table.cellEditorPopup.pack()),this.table.updateScrollbars())}_layoutColumns(e){this._autoOptimizeColumnsWidths();let t=this.table.htmlComp,i=this.table.columnLayoutDirty||!t.sizeCached;if(!i){let s=e||t.size().width;i=t.sizeCached.width!==s}i&&(this.table.autoResizeColumns&&this._autoResizeColumns(e),this._updateRealColumnWidths(),this.table.columnLayoutDirty=!1)}_updateRealColumnWidths(){this.table._updateRealColumnWidths()&&(this.table._updateRowWidth(),this.table.header&&this.table.header.rendered&&this.table.header.resizeHeaderItems(),this.table.$rows(!0).css("width",this.table.rowWidth))}_autoOptimizeColumnsWidths(){this.table.visibleColumns().forEach(e=>{e.autoOptimizeWidth&&e.autoOptimizeWidthRequired&&this.table.resizeToFit(e,e.autoOptimizeMaxWidth)})}_autoResizeColumns(e){let t,i,s=[],r=0,o=0,l=e||this.table.$data.width(),a=Math.floor(l-(this.table.rowBorders.horizontal()+this.table.rowMargins.horizontal()));if(this.table.visibleColumns().forEach(f=>{f.fixedWidth||f.autoOptimizeWidth?a-=f.width:(s.push(f),r+=f.width,o+=f.initialWidth)}),a===r)return;let d=a,c=s.filter(f=>{let g=Math.max(f.minWidth,f.initialWidth);return o===0?i=1/s.length:i=f.initialWidth/o,t=Math.floor(i*d),t<g?(t=g,d=Math.max(d-t,0),!0):!1});c.forEach((f,g)=>{let y=Math.max(f.minWidth,f.initialWidth);p.remove(s,f),t=y,o-=f.initialWidth,g===c.length-1&&d>0&&s.length===0&&(t+=d,d=0),t!==f.width&&this.table.resizeColumn(f,t)}),a=d,s.forEach((f,g)=>{o===0?i=1/s.length:i=f.initialWidth/o,t=Math.floor(i*a),d-=t,g===s.length-1&&d>0&&(t+=d,d=0),t!==f.width&&this.table.resizeColumn(f,t)})}preferredLayoutSize(e,t){return this.table.tileMode?new Si().preferredLayoutSize(e,t):(this._layoutColumns(t.widthHint),this.table._renderViewport(),super.preferredLayoutSize(e,t))}}class Id{table;mouseMoveSelectionEnabled;lastActionRow;mouseOverHandler;select;counterDebug;fromIndex;toIndex;_mouseDown;_prevSelectedRowIndex;_maxSelectedRowIndex;constructor(e){this.table=e,this.mouseMoveSelectionEnabled=!0,this._mouseDown=!1,this.lastActionRow=null,this.mouseOverHandler=null,this.select=!0,this.counterDebug=0,this.fromIndex=-1,this.toIndex=-1,this._prevSelectedRowIndex=-1,this._maxSelectedRowIndex=-1}clearLastSelectedRowMarker(){this.lastActionRow=null}onMouseDown(e){let t=h()(e.currentTarget),i=t.data("row"),s=t.isSelected(),r=this.table.visibleRows;if(this._mouseDown=!0,this.select=!0,this.table.multiSelect&&e.shiftKey){if(this.table.selectedRows.indexOf(i)>-1)return;if(this.table.selectedRows.length===0&&(this.lastActionRow=i),!this.lastActionRow){let o=r.indexOf(i),l=this.table.selectedRows[0],a=this.table.selectedRows[this.table.selectedRows.length-1];o<=(r.indexOf(l)+r.indexOf(a))/2?this.lastActionRow=l:this.lastActionRow=a,this._maxSelectedRowIndex=r.indexOf(a),this._prevSelectedRowIndex=r.indexOf(this.lastActionRow)}this.fromIndex=r.indexOf(this.lastActionRow)}else e.ctrlKey?this.select=!s:(!s||this.table.selectedRows.length>1&&e.which!==3)&&(this.table._removeSelection(),this.table.selectedRows=[]);this.fromIndex<0&&(this.fromIndex=r.indexOf(i)),(e.which!==3||!s)&&(this.toIndex=r.indexOf(i),this.handleSelection(e),this.table.notifyRowSelectionFinished()),this.mouseMoveSelectionEnabled&&e.which!==3&&(this.table.$data.off("mouseover",this.mouseOverHandler),this.mouseOverHandler=this.onMouseOver.bind(this),this.table.$data.on("mouseover",".table-row",this.mouseOverHandler)),t.window().one("mouseup.selectionHandler",this.onMouseUp.bind(this)),this.lastActionRow=i}onMouseOver(e){let i=h()(e.currentTarget).data("row"),s=this.table.visibleRows;this.toIndex=s.indexOf(i),this.handleSelection(e),this.lastActionRow=i}handleSelection(e){let t,i=this.table.visibleRows;if(this.table.multiSelect){let s=this.toIndex,r=s<this._prevSelectedRowIndex,o=s>this._prevSelectedRowIndex,l=this._prevSelectedRowIndex<this.fromIndex,a=this._prevSelectedRowIndex>this.fromIndex;if(!e.ctrlKey){if(r&&a?t=i.slice(s+1,this._maxSelectedRowIndex+1):o&&l&&(t=i.slice(this._maxSelectedRowIndex,s)),t&&e.shiftKey){let d=this.getMinMaxSelectionIndizes();t=t.reduce((c,f)=>{let g=i.indexOf(f);return u.isOneOf(g,d[0],d[1])&&c.push(f),c},[])}t&&t.forEach(d=>this.table.removeRowFromSelection(d,!0))}this._maxSelectedRowIndex=r?Math.min(this._maxSelectedRowIndex,s):o?Math.max(this._maxSelectedRowIndex,s):s,this._prevSelectedRowIndex=s}else this.select&&(this.table._removeSelection(),this.table.selectedRows=[]),this.fromIndex=this.toIndex;this._selectRange(this.fromIndex,this.toIndex,this.select)}_selectRange(e,t,i){let s=this.table.visibleRows,r=Math.min(e,t),o=Math.max(e,t)+1,l=s.slice(r,o);i?l.forEach(a=>this.table.addRowToSelection(a,!0)):l.forEach(a=>this.table.removeRowFromSelection(a,!0))}getMinMaxSelectionIndizes(){let e=this.table.selectedRows,t=this.table.visibleRows;if(!e||e.length===0)return[-1,-1];let i=-1,s=-1;return e.forEach(r=>{let o=t.indexOf(r);(i===-1||o<i)&&(i=o),(s===-1||o>s)&&(s=o)}),[i,s]}onMouseUp(e){this._mouseDown&&this.table.rendered&&(this._mouseDown=!1,this.table.$data.off("mouseover",this.mouseOverHandler),this.fromIndex=-1,this.toIndex=-1,this.select=!0,this.table.notifyRowSelectionFinished())}}class Mr extends I{table;tileAccordion;tiles;tileMappings;tilesMap;groupForTileMap;tableState;exclusiveExpand;gridColumnCount;tileGridLayoutConfig;withPlaceholders;_isUpdatingTiles;_tableHierarchyFilter;_tileFilters;_destroyHandler;_tileAccordionPropertyChangeHandler;_tileAccordionActionHandler;_tileAccordionClickHandler;_tableFilterAddedHandler;_tableFilterRemovedHandler;_tableFilterHandler;_tableGroupHandler;_tableRowsSelectedHandler;_tableRowsInsertedHandler;_tableRowsDeletedHandler;_tableAllRowsDeletedHandler;_tableRowOrderChangedHandler;_tablePropertyChangeHandler;constructor(){super(),this.table=null,this.tileAccordion=null,this.tiles=[],this.tileMappings=[],this.tilesMap={},this.groupForTileMap={},this.tableState={},this.exclusiveExpand=!1,this.gridColumnCount=null,this.tileGridLayoutConfig=null,this.withPlaceholders=null,this._isUpdatingTiles=!1,this._tableHierarchyFilter=null,this._tileFilters=[],this._destroyHandler=this._uninstallListeners.bind(this),this._tileAccordionPropertyChangeHandler=this._onTileAccordionPropertyChange.bind(this),this._tileAccordionActionHandler=this._onTileAccordionAction.bind(this),this._tileAccordionClickHandler=this._onTileAccordionClick.bind(this),this._tableFilterAddedHandler=this._onTableFilterAdded.bind(this),this._tableFilterRemovedHandler=this._onTableFilterRemoved.bind(this),this._tableFilterHandler=this._onTableFilter.bind(this),this._tableGroupHandler=this._onTableGroup.bind(this),this._tableRowsSelectedHandler=this._onTableRowsSelected.bind(this),this._tableRowsInsertedHandler=this._onTableRowsInserted.bind(this),this._tableRowsDeletedHandler=this._onTableRowsDeleted.bind(this),this._tableAllRowsDeletedHandler=this._onTableAllRowsDeleted.bind(this),this._tableRowOrderChangedHandler=this._onTableRowOrderChangedHandler.bind(this),this._tablePropertyChangeHandler=this._onTablePropertyChange.bind(this),this._addWidgetProperties(["tileAccordion","tiles","tileMappings"])}init(e){super._init(e),this.table=this.parent,this._setTileGridLayoutConfig(this.tileGridLayoutConfig),this.tileAccordion||(this.tileAccordion=this._createTileAccordion(),this._installListeners()),this.tableState.headerVisible=this.table.headerVisible,this._setTiles(this.tiles),this._setTileMappings(this.tileMappings)}_installListeners(){this.tileAccordion.on("propertyChange",this._tileAccordionPropertyChangeHandler),this.tileAccordion.on("tileAction",this._tileAccordionActionHandler),this.tileAccordion.on("tileClick",this._tileAccordionClickHandler),this.table.on("filterAdded",this._tableFilterAddedHandler),this.table.on("filterRemoved",this._tableFilterRemovedHandler),this.table.on("filter",this._tableFilterHandler),this.table.on("group",this._tableGroupHandler),this.table.on("rowsSelected",this._tableRowsSelectedHandler),this.table.on("rowsInserted",this._tableRowsInsertedHandler),this.table.on("rowsDeleted",this._tableRowsDeletedHandler),this.table.on("allRowsDeleted",this._tableAllRowsDeletedHandler),this.table.on("rowOrderChanged",this._tableRowOrderChangedHandler),this.table.on("propertyChange",this._tablePropertyChangeHandler),this.tileAccordion.on("destroy",this._destroyHandler),this.table.on("destroy",this._destroyHandler)}_uninstallListeners(){this.tileAccordion.off("propertyChange",this._tileAccordionPropertyChangeHandler),this.tileAccordion.off("tileAction",this._tileAccordionActionHandler),this.tileAccordion.off("tileClick",this._tileAccordionClickHandler),this.table.off("filterAdded",this._tableFilterAddedHandler),this.table.off("filterRemoved",this._tableFilterRemovedHandler),this.table.off("filter",this._tableFilterHandler),this.table.off("group",this._tableGroupHandler),this.table.off("rowsSelected",this._tableRowsSelectedHandler),this.table.off("rowsInserted",this._tableRowsInsertedHandler),this.table.off("rowsDeleted",this._tableRowsDeletedHandler),this.table.off("allRowsDeleted",this._tableAllRowsDeletedHandler),this.table.off("rowOrderChanged",this._tableRowOrderChangedHandler),this.table.off("propertyChange",this._tablePropertyChangeHandler),this.tileAccordion.off("destroy",this._destroyHandler),this.table.off("destroy",this._destroyHandler)}setGridColumnCount(e){this.setProperty("gridColumnCount",e),this.tileAccordion&&this.tileAccordion.setGridColumnCount(e)}setTileGridLayoutConfig(e){this.setProperty("tileGridLayoutConfig",e)}_setTileGridLayoutConfig(e){e=Nt.ensure(e),this._setProperty("tileGridLayoutConfig",e),this.tileAccordion&&this.tileAccordion.setTileGridLayoutConfig(e)}setWithPlaceholders(e){this.setProperty("withPlaceholders",e),this.tileAccordion&&this.tileAccordion.setWithPlaceholders(e)}_setTileMappings(e){if(this._setProperty("tileMappings",e),!e)return;let t=e.map(this.resolveMapping,this);this._setTiles(t)}setTiles(e){this.setProperty("tiles",e)}_setTiles(e){this._isUpdatingTiles=!0,p.removeAll(this.tiles,e),this.reset(),this._setTilesInternal(e),this._isUpdatingTiles=!1}_setTilesInternal(e){if(e.some(i=>this.table.rowsMap[i.rowId]===void 0)){this.table.initialized?this.table.one("rowsInserted",this._setTilesInternal.bind(this,e)):this.table.one("init",this._setTilesInternal.bind(this,e));return}this._refreshTilesMap(e),this._initGroups(e),this._setProperty("tiles",e),this.tileAccordion.setTiles(this.tiles),this._updateGroupVisibility(),this._syncSelectionFromTableToTile()}loadTiles(){let e=this.table.rows.filter(i=>!i.parentRow),t=this.table.createTiles(e);t&&this.setTiles(t)}resolveMapping(e){let t=e.tile;return t.rowId=e.tableRow,t.setParent(this),t.setOwner(this),t}_refreshTilesMap(e){e||(e=this.tiles,this.tilesMap={}),e.forEach(t=>{this.tilesMap[t.rowId]=t})}getTilesForRows(e){return e.map(t=>this.tilesMap[t.id]).filter(t=>!!t)}_initGroups(e){let t=p.find(this.table.columns,i=>i.grouped&&i.sortIndex===0);e.forEach(i=>{let s=this.table.rowsMap[i.rowId],r=t?t.cellTextForGrouping(s):"default";r=u.nvl(r,""),this.groupForTileMap[s.id]=r;let o=this.tileAccordion.getGroupById(r);o||(o=this._createTileGroup(r,t,s),this._adaptTileGrid(o.body),this.tileAccordion.insertGroup(o)),i.parent=o})}_adaptTileGrid(e){b.mandatoryFunction(e,"_showContextMenu");let t=e._showContextMenu;e._showContextMenu=i=>{b.mandatoryFunction(this.table,"_filterMenusForContextMenu"),i.menuItems=this.table._filterMenusForContextMenu(),u.assertProperty(this.table,"_filterMenusHandler"),i.menuFilter=this.table._filterMenusHandler,t.call(e,i)},e.keyStrokeContext.$bindTarget=this.table.keyStrokeContext.$bindTarget,e.keyStrokeContext.keyStrokes.forEach(i=>{i.stopPropagation=!0,i.stopImmediatePropagation=!0})}_createTileAccordion(){return u.create(sp,{parent:this.table,virtual:!0,selectable:!0,multiSelect:this.table.multiSelect,exclusiveExpand:this.exclusiveExpand,gridColumnCount:this.gridColumnCount,tileGridLayoutConfig:this.tileGridLayoutConfig,withPlaceholders:this.withPlaceholders})}_createTileGroup(e,t,i){let s,r,o;if(t){s=t.htmlEnabled;let l=t.createAggrGroupCell(i);r=l.text,o=l.iconId}return u.create(Pi,{parent:this.tileAccordion,id:e,headerVisible:e!=="default",title:r,titleHtmlEnabled:s,iconId:o,body:{objectType:hr,scrollable:!1}})}activate(){this.tableState.headerVisible=this.table.headerVisible,this.table.setHeaderVisible(!1),this.table.tileTableHeader&&this.table.tileTableHeader.setVisible(!0),this.table.tableControls.forEach(t=>{t instanceof $s&&(this.tableState.aggregateTableControlSelected=t.selected,t.setSelected(!1,{closeWhenUnselected:!0,animate:!1}),t.setVisible(!1))}),p.find(this.table.rows,t=>!!t.parentRow)!==null&&(this._tableHierarchyFilter=u.create(Pu,{table:this.table}),this.table.addFilter(this._tableHierarchyFilter)),this._syncFiltersFromTableToTile(),this._syncScrollTopFromTableToTile()}deactivate(){this.table.tableControls.forEach(e=>{e instanceof $s&&e.setVisible(!0)}),this.table._setProperty("headerVisible",this.tableState.headerVisible),this.table.tileTableHeader&&this.table.tileTableHeader.setVisible(!1),this._tableHierarchyFilter&&(this.table.removeFilter(this._tableHierarchyFilter),this._tableHierarchyFilter=null),this._syncScrollTopFromTileGridToTable(),this.reset()}reset(){this.tilesMap={},this.groupForTileMap={},this.tileAccordion.deleteAllTiles(),this.tileAccordion.deleteAllGroups(),this.tiles.forEach(e=>e.destroy())}renderTileMode(){this.table.tileMode?(this.table.$data&&this.table._removeData(),this._renderTileTableHeader(),this._renderTileAccordion()):(this._removeTileTableHeader(),this._removeTileAccordion(),this.table._renderData(),this.table._renderTableHeader(),this.tableState.aggregateTableControlSelected&&p.find(this.table.tableControls,e=>e instanceof $s).setSelected(!0)),this.table._refreshMenuBarPosition(),this.table.loadingSupport.remove(),this.table.loadingSupport.renderLoading(!0)}destroy(){this.tiles.forEach(e=>e.destroy()),this.tileAccordion.destroy(),this.tileAccordion=null}insertTiles(e){e=p.ensure(e),e.length!==0&&this.setTiles(this.tiles.concat(e))}deleteTiles(e){e||(e=this.tiles.slice()),p.removeAll(this.tiles,e),e.forEach(t=>{delete this.tilesMap[t.rowId],delete this.groupForTileMap[t.rowId];let i=this.tileAccordion.getGroupByTile(t);i&&i.body.tiles.length===1&&this.tileAccordion.deleteGroup(i),t.destroy()}),this.tileAccordion.deleteTiles(e)}_onTileAccordionPropertyChange(e){this.table.tileMode&&(e.propertyName==="selectedTiles"?(this._syncSelectionFromTileGridToTable(e.source.getSelectedTiles()),this.tileAccordion.rendered&&this.tileAccordion.$container.document(!0).getSelection().removeAllRanges()):e.propertyName==="filteredTiles"&&this._updateGroupVisibility())}_onTileAccordionAction(e){this.table.tileMode&&this.table.doRowAction(this.table.rowsMap[e.tile.rowId])}_onTileAccordionClick(e){this.table.tileMode&&this.table._triggerRowClick(e.originalEvent,this.table.rowsMap[e.tile.rowId],e.mouseButton)}_onTableRowsSelected(e){this.table.tileMode&&this._syncSelectionFromTableToTile()}_onTableRowsInserted(e){this.table.tileMode&&this.insertTiles(this.table.createTiles(e.rows))}_onTableRowsDeleted(e){this.table.tileMode&&this.deleteTiles(this.getTilesForRows(e.rows))}_onTableAllRowsDeleted(e){this.table.tileMode&&this.deleteTiles()}_onTableRowOrderChangedHandler(e){!this.table.tileMode||h().isEmptyObject(this.tilesMap)||(this.tiles=this.table.rows.map(t=>this.tilesMap[t.id]),this.tileAccordion.setTiles(this.tiles))}_onTableGroup(e){this.table.tileMode&&(this.tileAccordion.deleteAllGroups(),this._initGroups(this.tiles),this.tileAccordion.setTiles(this.tiles))}_onTableFilterAdded(e){this.table.tileMode&&this._addFilter(e.filter)}_onTableFilterRemoved(e){this.table.tileMode&&this._removeFilterByPredicate(t=>t.tableFilter===e.filter)}_addFilter(e){let t={tableFilter:e,table:this.table,accept:i=>{let s=this.table.rowsMap[i.rowId];return s?e.accept(s):!1}};if(this._removeFilterByPredicate(i=>i.tableFilter===e,!1),e instanceof ft){let i=e.createKey();this._removeFilterByPredicate(s=>s.tableFilter instanceof ft&&b.equals(s.tableFilter.createKey(),i),!1)}this._tileFilters.push(t),this.tileAccordion.addFilter(t)}_removeFilterByPredicate(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._tileFilters.find(e);i&&(this.tileAccordion.removeFilter(i,t),p.remove(this._tileFilters,i))}_onTableFilter(e){this.table.tileMode&&this.tileAccordion.filter()}_syncSelectionFromTableToTile(){this.tileAccordion&&this.tileAccordion.selectTiles(this.getTilesForRows(this.table.selectedRows))}_syncSelectionFromTileGridToTable(e){if(!this._isUpdatingTiles){let t=e.map(i=>this.table.rowsMap[i.rowId]).filter(i=>!!i);this.table.selectRows(t)}}_updateGroupVisibility(){this.tileAccordion.groups.forEach(e=>{let t=e.body,i=t.filters.length>0&&t.filteredTiles.length===0;e.setVisible(!i),e.setTitleSuffix(t.filteredTiles.length+"")})}_syncScrollTopFromTableToTile(){let e=this.table._rowIndexAtScrollTop(this.table.scrollTop);if(e<=0)return;let t=this.tilesMap[this.table.rows[e].id];if(!t)return;this.tileAccordion.scrollTop=null;let i={align:"top"};if(!t.rendered){this.table.session.layoutValidator.schedulePostValidateFunction(t.reveal.bind(t,i));return}t.reveal(i)}_syncScrollTopFromTileGridToTable(){let e=this.tileAccordion.tileAtScrollTop(this.tileAccordion.scrollTop);if(e){let t={align:"top"};this.table._isDataRendered()?this.table.scrollTo(this.table.rowsMap[e.rowId],t):this.table.session.layoutValidator.schedulePostValidateFunction(this.table.scrollTo.bind(this.table,this.table.rowsMap[e.rowId],t))}}_syncFiltersFromTableToTile(){this.tileAccordion&&(this.tileAccordion.setFilters([]),this.table.filters.forEach(e=>this._addFilter(e)))}_onTablePropertyChange(e){e.propertyName==="multiSelect"&&this.tileAccordion.setMultiSelect(e.newValue)}_renderTileTableHeader(){this.table.tileTableHeader&&this.table.tileTableHeader.render()}_removeTileTableHeader(){this.table.tileTableHeader&&this.table.tileTableHeader.remove()}_renderTileAccordion(){this.tileAccordion.rendered||this.tileAccordion.render()}_removeTileAccordion(){this.tileAccordion.rendered&&this.tileAccordion.remove()}}class Ld extends K{static modifyTableTileGridMediator(){G.get().remote&&(b.replacePrototypeFunction(Mr,"loadTiles",function(){if(!this.modelAdapter)return this.loadTilesOrig()},!0),b.replacePrototypeFunction(Mr,"_onTableRowsInserted",function(e){if(!this.modelAdapter)return this._onTableRowsInsertedOrig(e)},!0),b.replacePrototypeFunction(Mr,"_onTableRowsDeleted",function(e){if(!this.modelAdapter)return this._onTableRowsDeletedOrig(e)},!0),b.replacePrototypeFunction(Mr,"_onTableAllRowsDeleted",function(e){if(!this.modelAdapter)return this._onTableAllRowsDeletedOrig(e)},!0))}}G.addListener("bootstrap",Ld.modifyTableTileGridMediator);class $l extends I{table;page;row;_tableRowsUpdatedHandler;_tableRowsInsertedHandler;constructor(){super(),this.table=null,this.page=null,this.row=null,this._tableRowsUpdatedHandler=this._onTableRowsUpdated.bind(this),this._tableRowsInsertedHandler=this._onTableRowsInserted.bind(this)}_init(e){super._init(e),this.row=this.page.row,this.table.on("rowsUpdated",this._tableRowsUpdatedHandler),this.table.on("rowsInserted",this._tableRowsInsertedHandler)}_destroy(){this.table.off("rowsUpdated",this._tableRowsUpdatedHandler),this.table.off("rowsInserted",this._tableRowsInsertedHandler),super._destroy()}_render(){this.$container=this.$parent.appendDiv("table-row-detail"),this.htmlComp=x.install(this.$container,this.session),this._renderRow()}_renderRow(){let e=[];this.table.compactHandler?e=this.table.compactHandler.getColumns():e=this.table.visibleColumns(!1,!0),e.forEach(this._renderCell.bind(this)),this.invalidateLayoutTree()}_renderCell(e){let t=this.table.cell(e,this.row);if(_.empty(t.text)&&!t.iconId)return;let i;e.headerHtmlEnabled?i=_.plainText(e.text):i=e.text,_.empty(i)&&(e.headerTooltipHtmlEnabled?i=_.plainText(e.headerTooltipText):i=e.headerTooltipText);let s=e.cellTextForRowDetail(this.row),r=this.$container.appendDiv("table-row-detail-field");_.empty(i)||r.appendSpan("table-row-detail-name").text(i+": ");let o=t.iconId,l=!_.empty(s);o&&r.appendIcon(o,"table-row-detail-icon").toggleClass("with-text",l),l&&r.appendSpan("table-row-detail-value").html(s)}_refreshRow(){this.$container.empty(),this._renderRow()}_onTableRowsUpdated(e){if(!this.rendered)return;let t=e.rows,i=p.find(t,s=>s.id===this.row.id);i&&(this.row=i,this._refreshRow())}_onTableRowsInserted(e){this.rendered&&(e.source.rows.indexOf(this.page.row)<0||(this.row=this.page.row,this._refreshRow()))}}class ig extends I{tableRow;tile;constructor(){super(),this.tableRow=null,this.tile=null,this._addWidgetProperties(["tile"])}}class sg extends K{}class Bd extends Xi{table;row;_rowOrderChangedHandler;_init(e){super._init(e),this.table=e.table}_render(){super._render(),this._rowOrderChangedHandler=e=>{e.type==="rowOrderChangeAnimation"?e.row===this.row&&this.position():this.position()},this.table.on("rowOrderChanged rowOrderChangeAnimation",this._rowOrderChangedHandler)}_remove(){super._remove(),this.table.off("rowOrderChanged rowOrderChangeAnimation",this._rowOrderChangedHandler)}}class Do extends E{constructor(e){super(e)}static info(e){return new Do(E.ensureModel(e,E.Severity.INFO))}}class Ml extends ot{table;moveRowUpMenu;moveRowDownMenu;alwaysShowMenus=!1;rowFilter;_actionHandler;_tableHandler;_moving=!1;install(e){this.table||(this.table=u.assertInstance(e.table,H),this.moveRowUpMenu=u.assertInstance(e.moveRowUpMenu,J),this.moveRowDownMenu=u.assertInstance(e.moveRowDownMenu,J),this.alwaysShowMenus=u.nvl(e.alwaysShowMenus,this.alwaysShowMenus),this.rowFilter=e.rowFilter,this._actionHandler=this._onMoveRowMenuAction.bind(this),this._tableHandler=this._onTableEvent.bind(this),this.moveRowUpMenu.on("action",this._actionHandler),this.moveRowDownMenu.on("action",this._actionHandler),this.table.on("rowsSelected rowsInserted rowsUpdated rowsDeleted rowOrderChanged",this._tableHandler),this._updateMenus())}uninstall(){this.table&&(this.moveRowUpMenu.off("action",this._actionHandler),this.moveRowDownMenu.off("action",this._actionHandler),this.table.off("rowsSelected rowsInserted rowsUpdated rowsDeleted rowOrderChanged",this._tableHandler))}_updateMenus(){if(this._moving)return!1;let e=p.first(this.table.rows),t=p.last(this.table.rows),i=this.table.selectedRows.length&&this.table.rows.length>1,s=this.rowFilter||Boolean,r=i&&this.table.selectedRows.every(l=>l!==e&&s(l,"up")),o=i&&this.table.selectedRows.every(l=>l!==t&&s(l,"down"));this.moveRowUpMenu.setPropertyDimension("visible","helper",i||this.alwaysShowMenus),this.moveRowUpMenu.setPropertyDimension("enabled","helper",r),this.moveRowDownMenu.setPropertyDimension("visible","helper",i||this.alwaysShowMenus),this.moveRowDownMenu.setPropertyDimension("enabled","helper",o)}_onTableEvent(e){this._updateMenus()}_onMoveRowMenuAction(e){let t=e.source===this.moveRowUpMenu?"up":"down",i=this._selectedRows(t);this._moving=!0;let s=[];try{s=this.table.moveRowsUpOrDown(i,t)}finally{this._moving=!1}s.length&&this._updateMenus()}_selectedRows(e){let t=this.table.selectedRows;return this.rowFilter&&!t.every(i=>this.rowFilter(i,e))&&(t=[]),t}}class Od extends ot{promises;table;_rowMap;constructor(e){super(),this._rowMap={},this.promises=[],this.table=e}pushPromise(e){this.promises.push(e),this.table._renderViewportBlocked=!0,this.table.setLoading(!0);let t=()=>{p.remove(this.promises,e),this.promises.length===0&&this.process()};e.then(t,t)}isBuffering(){return this.promises.length>0}buffer(e){e=p.ensure(e),e.forEach(t=>{this._rowMap[t.id]=t})}process(){if(!this.table.destroyed){try{let e=b.values(this._rowMap).filter(t=>this.table.hasRow(t));this.table.updateRows(e)}catch(e){throw G.get().errorHandler.handle(e),e}finally{this._rowMap={},this.table.setLoading(!1),this.table._renderViewportBlocked=!1}this.table._isDataRendered()&&this.table._renderViewport(),this.trigger("complete")}}}class Hd extends Ss{table;constructor(){super(),this.table=null}_init(e){super._init(e)}_data(){let e=[];return e.push([null,this.session.text("NoGrouping"),"BOLD"]),this.table.visibleColumns(!1,!0).forEach(t=>{this.table.isGroupingPossible(t)&&e.push([t,u.nvl(t.text,t.headerTooltipText)])}),e}_dataToLookupRow(e){return u.create(ls,{key:e[0],text:e[1],font:e[2]})}}class Nd extends Ss{table;constructor(){super(),this.table=null}_data(){let e=[];return this.table.visibleColumns(!1,!0).forEach(t=>{t.isSortingPossible()&&(e.push([{column:t,asc:!0},u.nvl(t.text,t.headerTooltipText)+" ("+this.session.text("ui.ascending")+")",q.LONG_ARROW_UP_BOLD]),e.push([{column:t,asc:!1},u.nvl(t.text,t.headerTooltipText)+" ("+this.session.text("ui.descending")+")",q.LONG_ARROW_DOWN_BOLD]))}),e}_dataToLookupRow(e){return u.create(ls,{key:e[0],text:e[1],iconId:e[2]})}}const rt={TEXT:{collator:null,installed:!1,install(n){return this.installed?!!this.collator:(w.get().supportsInternationalization()?(this.collator=new window.Intl.Collator(n.locale.languageTag),h().log.isInfoEnabled()&&h().log.info("(comparators.TEXT#install) Browser supports i18n - installed Intl.Collator, can sort in Browser")):h().log.isInfoEnabled()&&h().log.info("(comparators.TEXT#install) Browser doesn't support i18n. Must sort on server"),this.installed=!0,!!this.collator)},compare(n,e){return!n&&!e?0:n?e?this.collator?this.collator.compare(n,e):n<e?-1:n>e?1:0:1:-1},compareIgnoreCase(n,e){return n||(n=null),e||(e=null),n===e?0:n===null?-1:e===null?1:this.compare(n.toLowerCase(),e.toLowerCase())}},NUMERIC:{install(n){return!0},compare(n,e){return b.isNullOrUndefined(n)&&b.isNullOrUndefined(e)?0:b.isNullOrUndefined(n)?-1:b.isNullOrUndefined(e)?1:n<e?-1:n>e?1:0}},ALPHANUMERIC:{collator:null,installed:!1,install(n){return rt.TEXT.install(n),this.collator=rt.TEXT.collator,!!this.collator&&rt.NUMERIC.install(n)},compare(n,e){return this._compare(n,e,!1)},compareIgnoreCase(n,e){return this._compare(n,e,!0)},_compare(n,e,t){if(!n&&!e)return 0;if(!n)return-1;if(!e)return 1;let i="(([0-9]+)|([^0-9]+))",s=new RegExp(i,"g"),r=new RegExp(i,"g"),o=s.exec(n+""),l=r.exec(e+"");for(;o&&l;){let a=parseInt(o[1],0),d=parseInt(l[1],0);if(!isNaN(a)&&!isNaN(d)){let c=rt.NUMERIC.compare(a,d);if(c!==0)return c}else{let c=t?rt.TEXT.compareIgnoreCase(o[1],l[1]):rt.TEXT.compare(o[1],l[1]);if(c!==0)return c}o=s.exec(n+""),l=r.exec(e+"")}return!o&&!l?0:o?1:-1}},compare(n){let e=0;for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return i.some(r=>{if(r.length!==2)throw new Error("The pair must have exactly 2 elements");return e=n(r[0],r[1]),e!==0}),e}};var rg;function Vd(n,e,t){return(e=g_(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function g_(n){var e=m_(n,"string");return typeof e=="symbol"?e:e+""}function m_(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var __=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},Wd;let le=(class extends zt{objectType;id;uuid;autoOptimizeWidth;autoOptimizeWidthRequired;session;autoOptimizeMaxWidth;cssClass;editable;removable;modifiable;fixedWidth;fixedPosition;grouped;headerCssClass;headerIconId;headerHtmlEnabled;headerTooltipText;headerBackgroundColor;headerForegroundColor;headerFont;headerTooltipHtmlEnabled;horizontalAlignment;htmlEnabled;initialAlwaysIncludeSortAtBegin;initialAlwaysIncludeSortAtEnd;index;primaryKey;guiOnly;mandatory;optimalWidthMeasurer;sortActive;checkable;sortAscending;sortIndex;summary;type;width;initialWidth;minWidth;showSeparator;parent;tableNodeColumn;maxLength;text;textWrap;filterType;comparator;visible;textBased;headerMenuEnabled;tableNodeLevel0CellPadding;expandableIconLevel0CellPadding;nodeColumnCandidate;modelClass;classId;$header;$separator;_realWidth;_tableColumnsChangedHandler;constructor(){super(),this.id=null,this.uuid=null,this.autoOptimizeWidth=!1,this.autoOptimizeWidthRequired=!1,this.autoOptimizeMaxWidth=-1,this.removable=!0,this.cssClass=null,this.editable=!1,this.modifiable=!0,this.fixedWidth=!1,this.fixedPosition=!1,this.grouped=!1,this.headerCssClass=null,this.headerIconId=null,this.headerHtmlEnabled=!1,this.headerTooltipText=null,this.headerTooltipHtmlEnabled=!1,this.horizontalAlignment=-1,this.htmlEnabled=!1,this.index=-1,this.primaryKey=!1,this.mandatory=!1,this.optimalWidthMeasurer=new zd(this),this.sortActive=null,this.sortAscending=!0,this.sortIndex=-1,this.summary=!1,this.type="text",this.width=60,this.initialWidth=void 0,this.minWidth=Wd.DEFAULT_MIN_WIDTH,this.parent=null,this.showSeparator=!0,this.tableNodeColumn=!1,this.maxLength=4e3,this.text=null,this.textWrap=!1,this.filterType="TextColumnUserFilter",this.comparator=rt.TEXT,this.visible=!0,this.textBased=!0,this.headerMenuEnabled=!0,this.tableNodeLevel0CellPadding=28,this.expandableIconLevel0CellPadding=13,this.nodeColumnCandidate=!0,this.modelClass=null,this.classId=null,this._tableColumnsChangedHandler=this._onTableColumnsChanged.bind(this),this._realWidth=null,this.$header=null,this.$separator=null,this._addMultiDimensionalProperty("visible",!0),this._addPropertyDimensionAlias("visible","visibleGranted",{dimension:"granted"}),this._addPropertyDimensionAlias("visible","displayable"),this._addPropertyDimensionAlias("visible","compacted",{inverted:!0})}_init(e){e.parent=e.parent||e.table,delete e.table,super._init(e),this._setParent(this.parent),this.session=u.assertInstance(e.session||this.parent?.session,vt),this.initialWidth===void 0&&(this.initialWidth=u.nvl(this.width,0)),this._resolveTextKeys(["text","headerTooltipText"]),this._resolveIconIds(["headerIconId"]),this._setAutoOptimizeWidth(this.autoOptimizeWidth),this.sortActive=u.nvl(this.sortActive,this.sortIndex>=0)}destroy(){this._destroy(),this._setParent(null)}_destroy(){}buildUuid(e){return Z.get().uuid(this,e)}buildUuidPath(e){return Z.get().uuidPath(this,h().extend({parent:this.table},e))}setUuid(e){this.setProperty("uuid",e)}_setParent(e){this.parent!==e&&(this.parent&&this.parent.off("columnMoved columnStructureChanged",this._tableColumnsChangedHandler),this.parent=e,this.parent&&this.parent.on("columnMoved columnStructureChanged",this._tableColumnsChangedHandler))}get table(){return this.parent}_resolveTextKeys(e){de.resolveTextProperties(this,e)}_resolveIconIds(e){q.resolveIconProperties(this,e)}initCell(e,t){let i=this._ensureCell(e);return this._initCell(i),b.isNullOrUndefined(i.text)&&this._updateCellText(t,i),i}_ensureCell(e){let t;if(e instanceof _t)t=e,t.value=this._ensureValue(t.value);else{let i=_t;t=u.create(i,{value:this._ensureValue(e)})}return t}_ensureValue(e){return e}_updateCellText(e,t){let i=t.value;if(!e)return;let s=this._formatValue(i,e);b.isPromise(s)?this.setCellTextDeferred(s,e,t):this.setCellText(e,s,t)}_formatValue(e,t){return u.nvl(e,"")}_initCell(e){return e.cssClass=u.nvl(e.cssClass,this.cssClass),e.editable=u.nvl(e.editable,this.editable),e.horizontalAlignment=u.nvl(e.horizontalAlignment,this.horizontalAlignment),e.htmlEnabled=u.nvl(e.htmlEnabled,this.htmlEnabled),e.mandatory=u.nvl(e.mandatory,this.mandatory),e}buildCellForRow(e){let t=this.cell(e);return this.buildCell(t,e)}buildCellForAggregateRow(e){let t;if(this.grouped){let i=this.table.groupingStyle===H.GroupingStyle.TOP?e.nextRow:e.prevRow;t=this.createAggrGroupCell(i)}else{let i=e.contents[this.table.visibleColumns().indexOf(this)];t=this.createAggrValueCell(i)}return this.buildCell(t,{})}buildCell(e,t){u.assertParameter("cell",e,_t);let i=this.table.isTableNodeColumn(this),s=0;i&&(s=this.table._calcRowLevelPadding(t));let r=this._text(e),o=this._icon(e.iconId,!!r)||"",l=this._cellCssClass(e,i),a=this._cellStyle(e,i,s);e.errorStatus&&(t.hasError=!0);let d;return!r&&!o?(d=" ",l=_.join(" ",l,"empty")):e.flowsLeft?d=r+o:d=o+r,i&&t.expandable&&(this.tableNodeColumn=!0,d=this._expandIcon(t.expanded,s)+d,t.expanded&&(l+=" expanded")),this._buildCell(e,d,a,l)}_buildCell(e,t,i,s){let r="";if(this.table.accessibilityRenderer&&_.hasText(this.table.accessibilityRenderer.cellRole)&&(r=' role="'+this.table.accessibilityRenderer.cellRole+'"'),this.table.header&&_.hasText(this.table.header.headerLabelId)){let o=Z.get().createUiSeqId();r+=' aria-labelledBy="'+this.table.header.headerLabelId+" "+o+'" id="'+o+'"'}return"<div"+r+' class="'+s+'" style="'+i+'">'+t+"</div>"}_expandIcon(e,t){let i="padding-left: "+(t+this.expandableIconLevel0CellPadding)+"px",s="table-row-control";return e&&(s+=" expanded"),'<div aria-hidden="true" class="'+s+'" style="'+i+'"></div>'}_icon(e,t){let i,s;if(e)return i="table-cell-icon",t&&(i+=" with-text"),s=q.parseIconId(e),s.isFontIcon()?(i+=" font-icon",'<span aria-hidden="true" class="'+s.appendCssClass(i)+'">'+s.iconCharacter+"</span>"):(i+=" image-icon",'<img alt="" class="'+i+'" src="'+s.iconUrl+'">')}_text(e){let t=e.text||"";return e.htmlEnabled||(t=e.encodedText()||"",this.table.multilineText&&(t=_.nl2br(t,!1)),t&&(t='<span class="text">'+t+"</span>")),t}_cellCssClass(e,t){let i="table-cell";e.mandatory&&(i+=" mandatory"),(!this.table.multilineText||!this.textWrap)&&(i+=" white-space-nowrap"),e.editable&&(i+=" editable"),e.errorStatus&&(i+=" has-error"),e.iconId&&!e.text&&(i+=" icon-only"),i+=" halign-"+H.parseHorizontalAlignment(e.horizontalAlignment);let s=this.table.visibleColumns(),r=s.indexOf(this);return r===0&&(i+=" first"),r===s.length-1&&(i+=" last"),t&&(i+=" table-node"),e.cssClass&&(i+=" "+e.cssClass),i}_cellStyle(e,t,i){let s,r=this.width;return r===0?"display: none;":(s="min-width: "+r+"px; max-width: "+r+"px; ",t&&(s+=" padding-left: "+(this.tableNodeLevel0CellPadding+i)+"px; "),s+=L.legacyStyle(e),s)}onMouseUp(e,t){let i=t.data("row"),s=this.cell(i);this.isCellEditable(i,s,e)&&this.table.prepareCellEdit(this,i,!0)}isCellEditable(e,t,i){return this.table.enabledComputed&&e.enabled&&t.editable&&!i.ctrlKey&&!i.shiftKey}startCellEdit(e,t){let i=this.cell(e);i.field=t,i.field.activateCellEditorMode({column:this,row:e});let s=this._createEditorPopup(e,i);if(!e.$row||e.$row.hasClass("hiding"))return s;let r=this.table.$cell(this,e.$row);return r&&(s.$anchor=r,s.open(this.table.$data)),s}_createEditorPopup(e,t){let i=Qd;return u.create(i,{parent:this.table,column:this,row:e,cell:t})}cell(e){return this.table.cell(this,e)}cells(){return this.table.rows.map(e=>this.cell(e))}headerCell(){let e=_t;return u.create(e,{value:this.text,text:this.text,iconId:this.headerIconId,cssClass:this.headerCssClass,tooltipText:this.headerTooltipText,htmlEnabled:this.headerHtmlEnabled})}selectedCell(){let e=this.table.selectedRow();return this.table.cell(this,e)}selectedCells(){return this.table.selectedRowsSorted().map(e=>this.cell(e))}selectedCellValue(){let e=this.table.selectedRow();return this.table.cellValue(this,e)}selectedCellValues(){return this.table.selectedRowsSorted().map(e=>this.cellValue(e))}checkedCellValue(){let e=this.table.checkedRow();return this.cellValue(e)}checkedCellValues(){return this.table.checkedRows().map(e=>this.cellValue(e))}cellValueOrText(e){return this.textBased?this.table.cellText(this,e):this.table.cellValue(this,e)}cellValue(e){return this.table.cellValue(this,e)}cellValues(){return this.table.rows.map(e=>this.cellValue(e))}cellText(e){return this.table.cellText(this,e)}cellValueOrTextForCalculation(e){let t=this.cell(e),i=this.cellValueOrText(e);return b.isNullOrUndefined(i)?null:this._preprocessValueOrTextForCalculation(i,t)}_preprocessValueOrTextForCalculation(e,t){return typeof e=="string"?this._preprocessTextForCalculation(e,t?.htmlEnabled):e}_preprocessTextForCalculation(e,t){return this._preprocessText(e,{removeHtmlTags:t,removeNewlines:!0,trim:!0})}cellTextForGrouping(e){let t=this.cell(e);return this._preprocessTextForGrouping(t.text,t.htmlEnabled)}_preprocessTextForGrouping(e,t){return this._preprocessText(e,{removeHtmlTags:t,trim:!0})}cellTextForTextFilter(e){let t=this.cell(e);return this._preprocessTextForTextFilter(t.text,t.htmlEnabled)}_preprocessTextForTextFilter(e,t){return this._preprocessText(e,{removeHtmlTags:t})}cellTextForRowDetail(e){let t=this.cell(e);return this._preprocessText(this._text(t),{removeHtmlTags:t.htmlEnabled})}_preprocessText(e,t){return e==null||(t=t||{},t.removeHtmlTags&&(e=_.plainText(e)),t.removeNewlines&&(e=e.replace(`
`," ")),t.trim&&(e=e.trim())),e}setCellValue(e,t){let i=this.cell(e);this._setCellValue(e,t,i),this._updateCellText(e,i)}_setCellValue(e,t,i){t=this._ensureValue(t),i.value!==t&&e.status===Rt.Status.NON_CHANGED&&(e.status=Rt.Status.UPDATED),i.setValue(t)}setCellTextDeferred(e,t,i){e.done(s=>this.setCellText(t,s,i)).fail(s=>{this.setCellText(t,"",i),h().log.error("Could not resolve cell text for value "+i.value,s)}),this.table.updateBuffer.pushPromise(e)}setCellText(e,t,i){i||(i=this.cell(e)),i.text!==t&&(i.setText(t),e.initialized&&this.table?.hasRow(e)&&this.table.updateRow(e))}setCellErrorStatus(e,t,i){i||(i=this.cell(e)),i.setErrorStatus(t)}setCellIconId(e,t){let i=this.cell(e);i.iconId!==t&&(i.setIconId(t),e.initialized&&this.table.updateRow(e))}setHorizontalAlignment(e){this.setProperty("horizontalAlignment",e)&&(this.table.rows.forEach(i=>this.cell(i).setHorizontalAlignment(e)),this.table.updateRows(this.table.rows),this.table.header&&this.table.header.updateHeader(this))}setEditable(e){this.setProperty("editable",e)&&(this.table.rows.forEach(i=>this.cell(i).setEditable(e)),this.table.updateRows(this.table.rows))}setMandatory(e){this.setProperty("mandatory",e)&&(this.table.rows.forEach(i=>this.cell(i).setMandatory(e)),this.table.updateRows(this.table.rows))}setCssClass(e){this.setProperty("cssClass",e)&&(this.table.rows.forEach(i=>this.cell(i).setCssClass(e)),this.table.updateRows(this.table.rows))}setSummary(e){this.setProperty("summary",e)&&this.table.updateRows(this.table.rows)}setWidth(e){this.setProperty("width",e)&&this.table.resizeColumn(this,e)}setFixedPosition(e){this.setProperty("fixedPosition",e)}setFixedWidth(e){this.setProperty("fixedWidth",e)&&this.table.invalidateLayoutTree(e)}setModifiable(e){this.setProperty("modifiable",e)}setRemovable(e){this.setProperty("removable",e)}createAggrGroupCell(e){let t=this.cell(e),i=_t;return this.initCell(u.create(i,{value:t.value,text:this.cellTextForGrouping(e),iconId:t.iconId,horizontalAlignment:this.horizontalAlignment,htmlEnabled:!1,cssClass:"table-aggregate-cell"+(t.cssClass?" "+t.cssClass:""),backgroundColor:"inherit",flowsLeft:this.horizontalAlignment>0}))}createAggrValueCell(e){return this.createAggrEmptyCell()}createAggrEmptyCell(){let e=_t;return this.initCell(u.create(e,{empty:!0,cssClass:"table-aggregate-cell"}))}calculateOptimalWidth(){return this.optimalWidthMeasurer.measure()}createFilter(){return u.create(this.filterType,{session:this.session,table:this.table,column:this})}get filtered(){return!!this.table.getFilter(this.id)}createTableHeaderMenu(e){let t=this.$header;return u.create(Bi,{parent:e,column:t.data("column"),tableHeader:e,$anchor:t})}createEditor(e){let t=this._createEditor(e),i=this.cell(e);this._initEditorField(t,i),t.setLabelVisible(!1),t.setFieldStyle(A.FieldStyle.CLASSIC);let s=new ke(t.gridDataHints);return s.horizontalAlignment=i.horizontalAlignment,t.setGridDataHints(s),t}_initEditorField(e,t){t.errorStatus?this._updateEditorFromInvalidCell(e,t):this._updateEditorFromValidCell(e,t)}_updateEditorFromValidCell(e,t){e.setValue(t.value)}_updateEditorFromInvalidCell(e,t){e.setErrorStatus(t.errorStatus),e.setDisplayText(t.text)}_createEditor(e){return u.create(Ni,{parent:this.table,maxLength:this.maxLength,multilineText:this.table.multilineText,wrapText:this.textWrap})}updateCellFromEditor(e,t){t.errorStatus?this._updateCellFromInvalidEditor(e,t):this._updateCellFromValidEditor(e,t)}_updateCellFromInvalidEditor(e,t){this.setCellErrorStatus(e,t.errorStatus),this.setCellText(e,t.displayText)}_updateCellFromValidEditor(e,t){this.setCellErrorStatus(e,null),this.setCellValue(e,t.value)}installComparator(){return this.comparator.install(this.session)}isSortingPossible(){return this.installComparator(),!0}compare(e,t){let i=this.table.cell(this,e),s=this.table.cell(this,t);if(i.sortCode!==null||s.sortCode!==null)return rt.NUMERIC.compare(i.sortCode,s.sortCode);let r=this.cellValueOrText(e),o=this.cellValueOrText(t);return this.comparator.compare(r,o)}isVisible(){return this.visible}get visibleIgnoreCompacted(){return this.computeMultiDimensionalProperty("visible",["compacted"])}setVisible(e,t){(this.setProperty("visible",e)||this.compacted)&&u.nvl(t,this.initialized)&&this.table.onColumnVisibilityChanged()}setVisibleGranted(e,t){this.setVisible(this.extendPropertyDimensions("visible","granted",e),t)}get visibleGranted(){return this.getProperty("visibleGranted")}setDisplayable(e,t){this.setVisible(this.extendPropertyDimensions("visible","displayable",e),t)}get displayable(){return this.getProperty("displayable")}setCompacted(e,t){this.setVisible(this.extendPropertyDimensions("visible","compacted",e),t)}get compacted(){return this.getProperty("compacted")}setAutoOptimizeWidth(e){this.setProperty("autoOptimizeWidth",e)}_setAutoOptimizeWidth(e){this._setProperty("autoOptimizeWidth",e),this.autoOptimizeWidthRequired=e,this.initialized&&(this.table.columnLayoutDirty=!0,this.table.invalidateLayoutTree())}setMaxLength(e){this.setProperty("maxLength",e)}setText(e){this.setProperty("text",e)&&this.table.header&&this.table.header.updateHeader(this)}setHeaderIconId(e){this.setProperty("headerIconId",e)&&this.table.header&&this.table.header.updateHeader(this)}setHeaderCssClass(e){let t=h().extend({},this);this.setProperty("headerCssClass",e)&&this.table.header&&this.table.header.updateHeader(this,t)}setHeaderHtmlEnabled(e){this.setProperty("headerHtmlEnabled",e)&&this.table.header&&this.table.header.updateHeader(this)}setHeaderMenuEnabled(e){this.setProperty("headerMenuEnabled",e)}setHeaderTooltipText(e){this.setProperty("headerTooltipText",e)&&this.table.header&&this.table.header.updateHeader(this)}setHeaderTooltipHtmlEnabled(e){this.setProperty("headerTooltipHtmlEnabled",e)}setTextWrap(e){this.setProperty("textWrap",e)&&this.table.rendered&&this.table.multilineText&&(this.autoOptimizeWidthRequired=!0,this.table.redraw())}isContentValid(e){const t=this.cell(e),i=!t.errorStatus||t.errorStatus.isValid(),s=!t.mandatory||this._hasCellValue(t);return{valid:i&&s,validByMandatory:s,errorStatus:t.errorStatus}}_hasCellValue(e){return!!e.value}_onTableColumnsChanged(e){this.table.visibleColumns().indexOf(this)===0?(this.tableNodeLevel0CellPadding=28,this.expandableIconLevel0CellPadding=13):(this.tableNodeLevel0CellPadding=23,this.expandableIconLevel0CellPadding=8)}realWidthIfAvailable(){return this._realWidth||this.width}static#e=rg=()=>(Wd=this,Vd(this,"DEFAULT_MIN_WIDTH",60),Vd(this,"SMALL_MIN_WIDTH",38),Vd(this,"NARROW_MIN_WIDTH",34),this)},rg());le=Wd=__([Ke({ensureId:!0})],le);class zd{column;table;deferred;imageCount;completeImageCount;$measurement;_imageLoadOrErrorHandler;_columnCellContents;constructor(e){this.column=e,this.table=null,this.$measurement=null,this.deferred=null,this.imageCount=0,this.completeImageCount=0,this._imageLoadOrErrorHandler=this._onImageLoadOrError.bind(this),this._columnCellContents={}}measure(){if(h().log.isDebugEnabled()&&h().log.debug("Optimal width measuring started for column "+this.column.id),this.table=this.column.table,this.$measurement&&(h().log.isDebugEnabled()&&h().log.debug("Optimal width measuring aborted for column "+this.column.id),this._resolve(-1)),this.$measurement=this.table.$data.makeDiv("hidden"),this.imageCount=0,this.completeImageCount=0,this._appendElements(),this.table.$data.append(this.$measurement),this.completeImageCount>=this.imageCount){let e=this._measure();return h().log.isDebugEnabled()&&h().log.debug("Optimal width measuring done (sync) for column "+this.column.id+": "+e),this.remove(),e}return h().log.isDebugEnabled()&&h().log.debug("Not all images loaded, deferring measurement for column "+this.column.id+". Images complete: "+this.completeImageCount+"/"+this.imageCount),this.$measurement[0].addEventListener("load",this._imageLoadOrErrorHandler,!0),this.$measurement[0].addEventListener("error",this._imageLoadOrErrorHandler,!0),this.deferred=h().Deferred(),this.deferred.promise()}remove(){this.$measurement&&(this.$measurement[0].removeEventListener("load",this._imageLoadOrErrorHandler,!0),this.$measurement[0].removeEventListener("error",this._imageLoadOrErrorHandler,!0),this.$measurement.remove(),this.$measurement=null)}_measure(){let e=this.column.minWidth,t=0;return this.$measurement.addClass("invisible").removeClass("hidden").children().each(function(){this.dataset.overlap&&(t=Math.max(t,parseInt(this.dataset.overlap,10))),e=Math.max(e,C.size(h()(this),!0).width)}),e+t}_resolve(e){this.remove(),this.deferred&&(this.deferred.resolve(e),this.deferred=null)}_appendElements(){this._appendHeader(),this._appendRows(),this._appendAggregateRows()}_appendHeader(){this.column.$header&&this._appendToMeasurement(this.column.$header.clone())}_appendRows(){this.table.rows.forEach(this._appendRow.bind(this)),this._columnCellContents={}}_appendRow(e){let t=this.column.buildCellForRow(e);this._columnCellContents[t]||(this._columnCellContents[t]=!0,this._appendToMeasurement(h()(t)))}_appendAggregateRows(){this.table._aggregateRows.forEach(this._appendAggregateRow.bind(this))}_appendAggregateRow(e){this._appendToMeasurement(this._build$CellForAggregateRow(e))}_build$CellForAggregateRow(e){let t=this.table.visibleColumns(),i=t.indexOf(this.column),s=this.table._build$AggregateRow(e);s.appendTo(this.table.$data),t.map(l=>l.buildCellForAggregateRow(e)).forEach(l=>h()(l).appendTo(s));let r=s.children().eq(i),o=this._getAggregateOverlap(r);return o>0&&(r[0].dataset.overlap=o+""),s.detach(),r}_getAggregateOverlap(e){if(!e||!e.length||e.hasClass("empty"))return 0;let t=this.table._getAggrCellRange(e);if(t.length<2)return 0;let i=t[t.length-1];if(i.hasClass("empty")||e.hasClass("halign-right")===i.hasClass("halign-right"))return 0;let s=i.children(".text");if(!s||!s.length)return 0;let r=C.size(s).width-i.cssMaxWidth()+i.cssPaddingLeft();if(r<=0)return 0;for(let o=t.length-1;o>0;o--){let l=t[o];l.hasClass("empty")&&(r-=l.cssMaxWidth())}return Math.max(0,r)}_appendToMeasurement(e){e.find("img").each((i,s)=>{let r=h()(s);r.data("measure","in-progress"),s.complete&&(r.data("complete",s.complete),this.completeImageCount++),this.imageCount++}),e.css({minWidth:"",maxWidth:""}).appendTo(this.$measurement)}_onImageLoadOrError(e){if(!h()(e.target).data("complete")&&(this.completeImageCount++,h().log.isTraceEnabled()&&h().log.trace("Images complete (async) "+this.completeImageCount+"/"+this.imageCount,e.target.src),this.completeImageCount>=this.imageCount)){let i=this._measure();h().log.isDebugEnabled()&&h().log.debug("Optimal width measuring done (async) for column "+this.column.id+": "+i),this._resolve(i)}}}class ng extends le{constructor(){super(),this.comparator=rt.ALPHANUMERIC}}class og extends le{buildCellForRow(e){let t=this.cell(e),i=this._cellCssClass(t),s=this._cellStyle(t),r=h()(super._buildCell(t,"",s,i)),o=this.table.cellValue(this,e);return t.errorStatus&&(e.hasError=!0),this._renderValue(r,o),r[0].outerHTML}_renderValue(e,t){}_plainTextForRow(e){let t=this.table.cell(this,e);if(!t.plainText){let i=this.buildCellForRow(e);t.plainText=_.plainText(i)}return t.plainText}cellValueOrTextForCalculation(e){let t=this._plainTextForRow(e);return this._preprocessTextForCalculation(t)}cellTextForGrouping(e){let t=this._plainTextForRow(e);return this._preprocessTextForGrouping(t)}cellTextForTextFilter(e){let t=this._plainTextForRow(e);return this._preprocessTextForTextFilter(t)}compare(e,t){let i=this._plainTextForRow(e),s=this._plainTextForRow(t);return this.comparator.compareIgnoreCase(i,s)}}class nr extends le{triStateEnabled;constructor(){super(),this.comparator=rt.NUMERIC,this.filterType="ColumnUserFilter",this.horizontalAlignment=0,this.minWidth=le.SMALL_MIN_WIDTH,this.triStateEnabled=!1,this.textBased=!1}_formatValue(e,t){return this.triStateEnabled&&e===null?"?":e?"X":""}buildCell(e,t){let i="",s=t.enabled,r=this.table.isTableNodeColumn(this),o=0;if(r&&(o=this.table._calcRowLevelPadding(t)),e.empty)return super.buildCell(e,t);s=s&&e.editable;let l=this._cellCssClass(e,r),a=this._cellStyle(e,r,o);s||(l+=" disabled");let d="check-box",c="";return e.value===!0&&(d+=" checked",c='aria-checked="true"'),e.value===!1&&(c='aria-checked="false"'),this.triStateEnabled&&e.value!==!0&&e.value!==!1&&(d+=" undefined",c='aria-checked="mixed"'),s||(d+=" disabled"),r&&t.expandable&&(this.tableNodeColumn=!0,i=this._expandIcon(t.expanded,o)+i,t.expanded&&(l+=" expanded")),i=i+'<div aria-label=" " role="checkbox" '+c+' class="'+d+'"></div>',this._buildCell(e,i,a,l)}$checkBox(e){return this.table.$cell(this,e).children(".check-box")}_cellCssClass(e,t){let i=super._cellCssClass(e);return i=i.replace(" editable",""),i+=" checkable",t&&(i+=" table-node"),i}onMouseUp(e,t){let i=t.data("row"),s=this.cell(i);this.table.checkableColumn===this?this.table.checkRow(i,!i.checked):this.isCellEditable(i,s,e)&&this._toggleCellValue(i,s)}_toggleCellValue(e,t){if(this.table.trigger("prepareCellEdit",{column:this,row:e}).defaultPrevented)return;let s=t.value,r=!s;this.triStateEnabled&&(s===!1?r=!0:s===!0?r=null:s===null&&(r=!1));let o=u.create(cs,{parent:this.table,value:r});this.table.trigger("completeCellEdit",{field:o,row:e,column:this,cell:t}).defaultPrevented||this.setCellValue(e,r),o.destroy()}_createEditor(e){return u.create(cs,{parent:this.table,triStateEnabled:this.triStateEnabled})}cellTextForGrouping(e){let t=this.cell(e);return this.triStateEnabled&&t.value===null?this.session.text("ui.BooleanColumnGroupingMixed"):t.value===!0?this.session.text("ui.BooleanColumnGroupingTrue"):this.session.text("ui.BooleanColumnGroupingFalse")}setTriStateEnabled(e){this.triStateEnabled!==e&&(this.triStateEnabled=e,this.table.rows.forEach(t=>this._updateCellText(t,this.cell(t))))}}class Ud extends le{constructor(){super(),this.cssClass="compact-cell",this.htmlEnabled=!0,this.width=120,this.textWrap=!0}_onMoreLinkAction(e,t){let s=this.table.$cell(this,e).find(".compact-cell-more-content"),r=!s.isVisible();s.setVisible(r),t.setVisible(!r),this.table.invalidateLayoutTree()}onMouseUp(e,t){let i=$(e.target),s=$(e.delegateTarget),r=i.findUp(o=>o.hasClass("more-link"),s);r.length>0&&this._onMoreLinkAction(t,r)}}class Gd{title;titleLine;titleSuffix;titleSuffixLine;subtitle;subtitleLine;contentLines;content;moreContent;constructor(){this.title="",this.titleSuffix="",this.subtitle="",this.content="",this.moreContent="",this.contentLines=[]}setTitle(e){this.title=u.nvl(e,"")}setTitleLine(e){this.titleLine=e}setTitleSuffix(e){this.titleSuffix=u.nvl(e,"")}setTitleSuffixLine(e){this.titleSuffixLine=e}setSubtitle(e){this.subtitle=u.nvl(e,"")}setSubtitleLine(e){this.subtitleLine=e}addContentLine(e){this.contentLines.push(e)}setContent(e){this.content=u.nvl(e,"")}setMoreContent(e){this.moreContent=u.nvl(e,"")}transform(e){let t=u.nvl(e.removeEmptyContentLines,!0),i=u.nvl(e.maxContentLines,1e3);const s=e.moreLinkAvailable;this.titleLine&&this.setTitle(this.titleLine.build()),this.titleSuffixLine&&this.setTitleSuffix(this.titleSuffixLine.build()),this.subtitleLine&&this.setSubtitle(this.subtitleLine.build());let r=[];t&&(r=this.contentLines.filter(a=>!!a.build())),s&&i+1===r.length&&i++;let o=Math.min(r.length,i),l=_.join(`
`,...r.slice(0,o).map(a=>a.build()));if(l&&this.setContent(l),o<r.length){let a=_.join(`
`,...r.slice(o,r.length).map(d=>d.build()));this.setMoreContent(a)}}}class Kd{labelBlock;textBlock;constructor(e,t){this.labelBlock=null,this.textBlock=null,e instanceof _t?this.setLabelBlock(this.convertHeaderCellToBlock(e)):this.setLabelBlock(new Eo(e)),t instanceof _t?this.setTextBlock(this.convertCellToBlock(t)):this.setTextBlock(new Eo(t))}convertHeaderCellToBlock(e){return this.convertCellToBlock(e)}convertCellToBlock(e){let t=new Eo;return e!=null&&(t.setText(e.text),t.setIcon(e.iconId),t.setEncodeHtmlEnabled(!e.htmlEnabled)),t}setLabelBlock(e){u.assertParameter("block",e),this.labelBlock=e}setTextBlock(e){u.assertParameter("block",e),this.textBlock=e}build(){let e=this.labelBlock.build();e&&(e+=": ");let t=this.textBlock.build();return t?`
<div class="compact-cell-line">
<span class="compact-cell-line-label">${e}</span>
<span class="compact-cell-line-value">${t}</span>
</div>`:""}}class Eo{text;icon;encodeHtmlEnabled;nlToBrEnabled;htmlToPlainTextEnabled;_processedText;constructor(e,t){this.text="",this.icon="",this._processedText=null,this.encodeHtmlEnabled=!0,this.nlToBrEnabled=!1,this.htmlToPlainTextEnabled=!1,this.setText(e),this.setIcon(t)}setText(e){this.text=u.nvl(e,"")}processedText(){return this._processedText==null&&(this._processedText=this.processText()),this._processedText}setIcon(e){this.icon=u.nvl(e,"")}setEncodeHtmlEnabled(e){this.encodeHtmlEnabled!==e&&(this._processedText=null),this.encodeHtmlEnabled=e}setNlToBrEnabled(e){this.nlToBrEnabled!==e&&(this._processedText=null),this.nlToBrEnabled=e}setHtmlToPlainTextEnabled(e){this.htmlToPlainTextEnabled!==e&&(this._processedText=null),this.htmlToPlainTextEnabled=e}processText(){let e=this.text;return this.htmlToPlainTextEnabled?(this.nlToBrEnabled&&(e=_.nl2br(e,!1)),e=_.plainText(e)):this.encodeHtmlEnabled&&(e=_.encode(e)),this.nlToBrEnabled&&(e=_.nl2br(e,!1)),e}build(){return this.icon?$("<div>").appendIcon(this.icon).addClass(this.processedText()?" with-text":"").parent()[0].innerHTML+this.processedText():this.processedText()}}class jd extends le{format;groupFormat;hasDate;hasTime;constructor(){super(),this.format=null,this.groupFormat="yyyy",this.hasDate=!0,this.hasTime=!1,this.filterType="DateColumnUserFilter",this.comparator=rt.NUMERIC,this.textBased=!1}_init(e){super._init(e),this._setFormat(this.format),this._setGroupFormat(this.groupFormat)}setFormat(e){this.setProperty("format",e)}_setFormat(e){e||(e=this._getDefaultFormat(this.session.locale));let t=St.ensure(this.session.locale,e);this._setProperty("format",t),this.initialized&&this.table.rows.forEach(i=>this._updateCellText(i,this.cell(i)))}setGroupFormat(e){this.setProperty("groupFormat",e)}_setGroupFormat(e){e||(e=this._getDefaultFormat(this.session.locale));let t=St.ensure(this.session.locale,e);this._setProperty("groupFormat",t),this.initialized&&this.table._group()}_formatValue(e,t){return this.format.format(e)}_ensureValue(e){return S.ensure(e)}_getDefaultFormat(e){return this.hasDate&&this.hasTime?e.dateFormatPatternDefault+" "+e.timeFormatPatternDefault:this.hasDate?e.dateFormatPatternDefault:e.timeFormatPatternDefault}cellTextForGrouping(e){let t=this.table.cellValue(this,e);return this.groupFormat.format(t)}_createEditor(e){return u.create(Ht,{parent:this.table,hasDate:this.hasDate,hasTime:this.hasTime})}}class kl extends le{constructor(){super(),this.minWidth=le.NARROW_MIN_WIDTH,this.filterType="ColumnUserFilter",this.textBased=!1}_initCell(e){return super._initCell(e),e.text=null,e.iconId=e.value||e.iconId,e}_formatValue(e,t){return null}setCellValue(e,t){super.setCellValue(e,t),this.setCellIconId(e,this.cell(e).value)}cellTextForGrouping(e){return this.table.cell(this,e).value}createAggrGroupCell(e){let t=super.createAggrGroupCell(e);return t.text=null,t}}class Bt extends le{aggregationFunction;backgroundEffect;decimalFormat;fractionDigits;minValue;maxValue;calcMinValue;calcMaxValue;allowedAggregationFunctions;aggrStart;aggrStep;aggrFinish;aggrSymbol;backgroundEffectFunc;constructor(){super(),this.aggregationFunction="sum",this.backgroundEffect=null,this.decimalFormat=null,this.fractionDigits=null,this.minValue=null,this.maxValue=null,this.calcMinValue=null,this.calcMaxValue=null,this.horizontalAlignment=1,this.filterType="NumberColumnUserFilter",this.comparator=rt.NUMERIC,this.textBased=!1,this.allowedAggregationFunctions=["sum","avg","min","max","none"]}_init(e){super._init(e),this._setDecimalFormat(this.decimalFormat),this._setFractionDigits(this.fractionDigits),this._setAggregationFunction(this.aggregationFunction)}setDecimalFormat(e){this.setProperty("decimalFormat",e)}_setDecimalFormat(e){e||(e=this._getDefaultFormat(this.session.locale));let t=Ps.ensure(this.session.locale,e);this._setProperty("decimalFormat",t),this.initialized&&this.table.rows.forEach(i=>this._updateCellText(i,this.cell(i)))}_getDefaultFormat(e){return e.decimalFormatPatternDefault}_formatValue(e,t){return this.decimalFormat.format(e)}setFractionDigits(e){this.setProperty("fractionDigits",e)}_setFractionDigits(e){this._setProperty("fractionDigits",e)}_ensureValue(e){return Se.ensure(e)}setAggregationFunction(e){this.setProperty("aggregationFunction",e)}_setAggregationFunction(e){if(this._setProperty("aggregationFunction",e),e==="sum")this.aggrStart=Ct.sumStart,this.aggrStep=Ct.sumStep,this.aggrFinish=Ct.sumFinish,this.aggrSymbol=Ct.sumSymbol;else if(e==="avg")this.aggrStart=Ct.avgStart,this.aggrStep=Ct.avgStep,this.aggrFinish=Ct.avgFinish,this.aggrSymbol=Ct.avgSymbol;else if(e==="min")this.aggrStart=Ct.minStart,this.aggrStep=Ct.minStep,this.aggrFinish=Ct.minFinish,this.aggrSymbol=Ct.minSymbol;else if(e==="max")this.aggrStart=Ct.maxStart,this.aggrStep=Ct.maxStep,this.aggrFinish=Ct.maxFinish,this.aggrSymbol=Ct.maxSymbol;else if(e==="none"){let t=()=>{};this.aggrStart=t,this.aggrStep=t,this.aggrFinish=t,this.aggrSymbol=void 0}}createAggrValueCell(e){let t=this._formatValue(e),i=_t;return u.create(i,{text:t,iconId:t?this.aggrSymbol:null,horizontalAlignment:this.horizontalAlignment,cssClass:"table-aggregate-cell "+this.aggregationFunction,flowsLeft:this.horizontalAlignment>0})}_cellStyle(e,t,i){let s=super._cellStyle(e,t,i);if(!this.backgroundEffect||e.value===void 0||_.contains(e.cssClass,"table-aggregate-cell"))return s;this.backgroundEffectFunc||(this.backgroundEffectFunc=this._resolveBackgroundEffectFunc());let r=this.backgroundEffectFunc(this._preprocessValueOrTextForCalculation(e.value));return r.backgroundColor&&(s+="background-color: "+r.backgroundColor+";"),r.backgroundImage&&(s+="background-image: "+r.backgroundImage+";"),s}_preprocessValueOrTextForCalculation(e,t){return this.decimalFormat.round(e)}setBackgroundEffect(e){this.setProperty("backgroundEffect",e)&&(this.backgroundEffectFunc=this._resolveBackgroundEffectFunc(),this.table.trigger("columnBackgroundEffectChanged",{column:this}),this.backgroundEffect&&(this.calcMinValue===null||this.calcMaxValue===null)&&this.calculateMinMaxValues(),this.backgroundEffect||(this.calcMinValue=null,this.calcMaxValue=null),this.table.rendered&&this._renderBackgroundEffect())}updateBackgroundEffect(){this.calculateMinMaxValues(),this.table.rendered&&this._renderBackgroundEffect()}_resolveBackgroundEffectFunc(){let e=this.backgroundEffect;if(e==="colorGradient1")return this._colorGradient1.bind(this);if(e==="colorGradient2")return this._colorGradient2.bind(this);if(e==="barChart")return this._barChart.bind(this);if(e!==null)return h().log.warn("Unsupported backgroundEffect: "+e),()=>({})}_renderBackgroundEffect(){this.visible&&this.table.visibleRows.forEach(e=>{if(!e.$row)return;let t=this.cell(e),i=this.table.$cell(this,e.$row);t.value!==void 0&&(i[0].style.cssText=this._cellStyle(t))})}calculateMinMaxValues(){let e,t,i=this.table.rows;for(let s=0;s<i.length;s++){let r=i[s],o=this.cellValueOrTextForCalculation(r);(o<e||e===void 0)&&(e=o),(o>t||t===void 0)&&(t=o)}this.calcMinValue=u.nvl(e,null),this.calcMaxValue=u.nvl(t,null)}_colorGradient1(e){let t=L.get("column-background-effect-gradient1-start","backgroundColor"),i=L.get("column-background-effect-gradient1-end","backgroundColor"),s=L.rgb(t.backgroundColor),r=L.rgb(i.backgroundColor);return this._colorGradient(e,s,r)}_colorGradient2(e){let t=L.get("column-background-effect-gradient2-start","backgroundColor"),i=L.get("column-background-effect-gradient2-end","backgroundColor"),s=L.rgb(t.backgroundColor),r=L.rgb(i.backgroundColor);return this._colorGradient(e,s,r)}_colorGradient(e,t,i){let s=(e-this.calcMinValue)/(this.calcMaxValue-this.calcMinValue),r=Math.ceil(t.red-s*(t.red-i.red)),o=Math.ceil(t.green-s*(t.green-i.green)),l=Math.ceil(t.blue-s*(t.blue-i.blue));return{backgroundColor:"rgb("+r+", "+o+", "+l+")"}}_barChart(e){let t=Math.ceil((e-this.calcMinValue)/(this.calcMaxValue-this.calcMinValue)*100)+"",i=L.get("column-background-effect-bar-chart","backgroundColor").backgroundColor;return{backgroundImage:"linear-gradient(to left, "+i+" 0%, "+i+" "+t+"%, transparent "+t+"%, transparent 100% )"}}_createEditor(e){return u.create(ps,{parent:this.table,maxValue:this.maxValue,minValue:this.minValue,decimalFormat:this.decimalFormat,fractionDigits:this.fractionDigits})}_hasCellValue(e){return!b.isNullOrUndefined(e.value)}}class Il extends le{lookupCall=null;codeType=null;browseHierarchy=!1;browseMaxRowCount=Pe.DEFAULT_BROWSE_MAX_COUNT;_init(e){super._init(e),this._setLookupCall(this.lookupCall),this._setCodeType(this.codeType)}setLookupCall(e){this.setProperty("lookupCall",e)}_setLookupCall(e){let t=Pt.ensure(e,this.session);this._setProperty("lookupCall",t)}setCodeType(e){this.setProperty("codeType",e)}_setCodeType(e){this._setProperty("codeType",e),e&&(this.lookupCall=u.create(ro,{session:this.session,codeType:e}))}setBrowseHierarchy(e){this.setProperty("browseHierarchy",e)}setBrowseMaxRowCount(e){this.setProperty("browseMaxRowCount",e)}_updateCellFromValidEditor(e,t){this.setCellErrorStatus(e,null);let i=this.cell(e),s=i.text,r=t.displayText;i.setText(r),this._setCellValue(e,t.value,i),e.initialized&&s!==r&&i.text===r&&this.table.updateRow(e),this._updateCellText(e,i)}}class lg extends Il{browseAutoExpandAll;browseLoadIncremental;activeFilterEnabled;_lookupCallBatchContext;constructor(){super(),this.browseAutoExpandAll=!0,this.browseLoadIncremental=!1,this.activeFilterEnabled=!1,this._lookupCallBatchContext=null}_initCell(e){return super._initCell(e),e.sortCode=this._calculateCellSortCode(e),e}_calculateCellSortCode(e){if(!this.codeType)return e.sortCode;let t=Cr.get(this.codeType);if(!t)return null;let i=t.get(e.value);return i?i.sortCode:null}_updateAllCellSortCodes(){this.table.rows.map(e=>this.cell(e)).forEach(e=>e.setSortCode(this._calculateCellSortCode(e)))}_setLookupCall(e){super._setLookupCall(e),this.initialized&&this._updateAllCellSortCodes()}_setCodeType(e){super._setCodeType(e),this.initialized&&this._updateAllCellSortCodes()}setBrowseAutoExpandAll(e){this.setProperty("browseAutoExpandAll",e)}setBrowseLoadIncremental(e){this.setProperty("browseLoadIncremental",e)}setActiveFilterEnabled(e){this.setProperty("activeFilterEnabled",e)}_formatValue(e,t){if(!this.lookupCall)return u.nvl(e,"");if(this.lookupCall.batch)return this._batchFormatValue(e);let i=this.lookupCall.clone();return this.trigger("prepareLookupCall",{lookupCall:i,row:t}),i.textByKey(e)}_batchFormatValue(e){if(b.isNullOrUndefined(e))return $.resolvedPromise("");let t=this._lookupCallBatchContext;if(!t){const i=$.Deferred();t={keySet:new Set,result:i.promise()},this._lookupCallBatchContext=t,setTimeout(()=>{this._lookupCallBatchContext=null;let s=this.lookupCall.clone();this.trigger("prepareLookupCall",{lookupCall:s}),s.textsByKeys([...t.keySet]).then(r=>i.resolve(r)).catch(r=>i.reject(r))})}return t.keySet.add(e),t.result.then(i=>i[b.ensureValidKey(e)]||"")}_updateEditorFromValidCell(e,t){if(b.isNullOrUndefined(t.value)){e.setValue(null);return}let i=new ls;i.key=t.value,i.text=t.text,e.setLookupRow(i)}_createEditor(e){let t=u.create(Pe,{parent:this.table,codeType:this.codeType,lookupCall:this.lookupCall?this.lookupCall.clone():null,browseHierarchy:this.browseHierarchy,browseMaxRowCount:this.browseMaxRowCount,browseAutoExpandAll:this.browseAutoExpandAll,browseLoadIncremental:this.browseLoadIncremental,activeFilterEnabled:this.activeFilterEnabled});return t.on("prepareLookupCall",i=>{this.trigger("prepareLookupCall",{lookupCall:i.lookupCall,row:e})}),t.on("lookupCallDone",i=>{this.trigger("lookupCallDone",{result:i.result})}),t}_hasCellValue(e){let t=e.value;return b.isNumber(t)?!b.isNullOrUndefined(t):!!t}_setCellValue(e,t,i){super._setCellValue(e,t,i),i.setSortCode(this._calculateCellSortCode(i))}}class ag extends Il{distinct=!1;setDistinct(e){this.setProperty("distinct",e)}_createEditor(e){const t=u.create(Ln,{parent:this.table,lookupCall:this.lookupCall,codeType:this.codeType,browseHierarchy:this.browseHierarchy,browseMaxRowCount:this.browseMaxRowCount});return t.on("lookupCallDone",i=>{if(!this.distinct)return;const s=[];this.table.rows.forEach(r=>{r!==e&&s.push(...p.ensure(this.cellValue(r)))}),p.removeAll(s,this.cellValue(e)),i.result.lookupRows.forEach(r=>{u.isOneOf(r.key,s)&&r.setEnabled(!1)})}),t.on("prepareLookupCall",i=>this.trigger("prepareLookupCall",{lookupCall:i.lookupCall,row:e})),t.on("lookupCallDone",i=>this.trigger("lookupCallDone",{result:i.result})),t}_updateEditorFromValidCell(e,t){super._updateEditorFromValidCell(e,t),e.setDisplayText(t.text)}isContentValid(e){const t=super.isContentValid(e);if(!this.distinct)return t;const i=this.cell(e);if(!this.table.rows.find(o=>o!==e&&p.containsAny(i.value,this.cellValue(o))))return t;const s=E.error(this.session.text("ui.LookupColumnDistinctErrorMessage")),r=t.errorStatus?E.error({children:[s,t.errorStatus]}):s;return{...t,valid:r.isValid(),errorStatus:r}}_formatValue(e,t){return Ln.formatValues(e,this.lookupCall,i=>this.trigger("prepareLookupCall",{lookupCall:i,row:t}))}}class qd extends Rr{constructor(e){super(e),this.renderingHints.offset=6}handle(e){this.field.toggle()}_postRenderKeyBox(e,t){if(this.field.iconId){let i=e.find(".icon").width(),s=e.find(".key-box").outerWidth(),r=e.cssPaddingLeft(),o=i/2-s/2+r;e.find(".key-box").cssLeft(o)}}}class As extends ce{tableFooter;table;contentRendered;height;animateDuration;resizerVisible;denseClass;tableControlKeyStrokeContext;$contentContainer;constructor(){super(),this.tableFooter=null,this.contentRendered=!1,this.height=null,this.animateDuration=null,this.resizerVisible=!0,this.toggleAction=!0,this.showTooltipWhenSelected=!1}static CONTAINER_SIZE=345;static CONTAINER_ANIMATE_DURATION=350;_init(e){this.parent=e.parent,this.table=this.getTable(),super._init(e),this.denseClass=this.session.desktop.dense?" dense":"",As.CONTAINER_SIZE=L.getSize("table-control-container"+this.denseClass,"height","height",As.CONTAINER_SIZE),this.height=As.CONTAINER_SIZE,this.animateDuration=As.CONTAINER_ANIMATE_DURATION,this._setSelected(this.selected)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.tableControlKeyStrokeContext=this._createKeyStrokeContextForTableControl()}_createKeyStrokeContextForTableControl(){let e=new Ee;return e.$scopeTarget=()=>this.tableFooter.$controlContent,e.$bindTarget=()=>this.tableFooter.$controlContent,e.registerKeyStroke(new su(this)),e}_createLayout(){return new pn}_render(){let e="table-control ";this.cssClass&&(e+=this.cssClass+"-table-control"),this.$container=this.$parent.appendDiv(e).on("mousedown",this._onMouseDown.bind(this)).data("control",this),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout())}remove(){this.removeContent(),super.remove()}_renderContent(e){}_removeContent(){}removeContent(){this.contentRendered&&(this._removeContent(),this.cssClass&&(this.tableFooter.$controlContainer.removeClass(this.cssClass+"-table-control-container"),this.tableFooter.$controlContent.removeClass(this.cssClass+"-table-control-content")),this.session.keyStrokeManager.uninstallKeyStrokeContext(this.tableControlKeyStrokeContext),this.contentRendered=!1)}renderContent(){!this.contentRendered&&!this.isContentAvailable()||this.selected&&(this.tableFooter.open||this.tableFooter.openControlContainer(this),this.contentRendered||(this.cssClass&&(this.tableFooter.$controlContainer.addClass(this.cssClass+"-table-control-container"),this.tableFooter.$controlContent.addClass(this.cssClass+"-table-control-content")),this.tableFooter.$controlContent.data("control",this),this._renderContent(this.tableFooter.$controlContent),this.session.keyStrokeManager.installKeyStrokeContext(this.tableControlKeyStrokeContext),this.htmlComp&&this.htmlComp.invalidateLayoutTree(!1),this.contentRendered=!0))}get$Scrollable(){return this.$contentContainer}_renderSelected(e,t){e=u.nvl(e,this.selected),t=$.extend({},{closeWhenUnselected:!0},t),this.$container.select(e),e?(this.tableFooter.onControlSelected(this),this.renderContent()):this.rendered&&(t.closeWhenUnselected&&this===this.tableFooter.selectedControl?(this.tableFooter.onControlSelected(null),this.tableFooter.closeControlContainer(this,t)):this.removeContent()),this._updateTooltip()}isContentAvailable(){return!0}toggle(){this.enabledComputed&&(this.tableFooter.selectedControl===this?this.setSelected(!1):this.setSelected(!0))}setSelected(e,t){e&&!this.visible||e!==this.selected&&(this.tableFooter&&this.tableFooter.selectedControl&&this.tableFooter.selectedControl!==this&&this.tableFooter.selectedControl.setSelected(!1,{closeWhenUnselected:!1}),this._setSelected(e),t=$.extend({},{closeWhenUnselected:!0},t),this.rendered?this._renderSelected(e,t):t.closeWhenUnselected&&this.tableFooter&&this===this.tableFooter.selectedControl&&!e&&this.tableFooter.onControlSelected(null))}_setSelected(e){this._setProperty("selected",e)}_configureTooltip(){let e=super._configureTooltip();return e.cssClass="table-control-tooltip",e}_onMouseDown(e){this.toggle()}onControlContainerOpened(){}onControlContainerClosed(){this.removeContent()}_createActionKeyStroke(){return new qd(this)}getTable(){let e=this.parent;for(;e;){if(e instanceof H)return e;e=e.parent}return null}}class Ll extends er{_goOffline(){this.widget.isContentAvailable()||(this._enabledBeforeOffline=this.widget.enabled,this.widget.setEnabled(!1))}_goOnline(){this.widget.isContentAvailable()||this.widget.setEnabled(this._enabledBeforeOffline)}}class kr extends Ji{tableControl;_tableControlPropertyChangeHandler;_tableControlDestroyHandler;constructor(){super(),this.tableControl=null,this._tableControlPropertyChangeHandler=this._onTableControlPropertyChange.bind(this),this._tableControlDestroyHandler=this._onTableControlDestroy.bind(this),this._addCloneProperties(["tableControl"])}_init(e){if(super._init(e),!this.tableControl)throw new Error("Cannot adapt to undefined tableControl");this._installListeners()}_destroy(){this._uninstallListeners(),super._destroy()}_installListeners(){this.tableControl.on("propertyChange",this._tableControlPropertyChangeHandler),this.tableControl.on("destroy",this._tableControlDestroyHandler)}_uninstallListeners(){this.tableControl.off("propertyChange",this._tableControlPropertyChangeHandler),this.tableControl.off("destroy",this._tableControlDestroyHandler)}_render(){super._render(),this.$container.attr("data-tableControlAdapter",this.tableControl.id)}_onTableControlPropertyChange(e){let t={};t[e.propertyName]=e.newValue,t=kr.adaptTableControlProperties(t);for(let i in t)this.setProperty(i,t[i])}_onTableControlDestroy(e){this.destroy(),this._uninstallListeners()}doAction(){return this.tableControl.doAction()}setSelected(e){this.tableControl.setSelected(e)}static adaptTableControlProperties(e,t){t=t||{},["text","iconId","enabled","visible","selected","tooltipText","keyStroke","keyStrokes","modelClass","classId","form"].forEach(i=>{t[i]=e[i]});for(let i in t)t[i]===void 0&&delete t[i];return t}}class $s extends As{aggregateRow;_tableDataScrollHandler;_tableColumnResizedHandler;_tableColumnMovedHandler;_tableColumnStructureChangedHandler;_tableChangedHandler;_aggregationFunctionChangedHandler;constructor(){super(),this._tableDataScrollHandler=this._onTableDataScroll.bind(this),this._tableColumnResizedHandler=this._onTableColumnResized.bind(this),this._tableColumnMovedHandler=this._onTableColumnMoved.bind(this),this._tableColumnStructureChangedHandler=this._onTableColumnStructureChanged.bind(this),this._tableChangedHandler=this._onTableChanged.bind(this),this._aggregationFunctionChangedHandler=this._onAggregationFunctionChanged.bind(this),this.animateDuration=$s.CONTAINER_ANIMATE_DURATION,this.aggregateRow=[],this.cssClass="aggregate",this.height=0,this.iconId=q.SUM,this.tooltipText="${textKey:ui.Total}",this.resizerVisible=!1}static CONTAINER_ANIMATE_DURATION=200;_init(e){super._init(e),this.table.on("columnStructureChanged",this._tableColumnStructureChangedHandler),this.table.on("aggregationFunctionChanged",this._aggregationFunctionChangedHandler)}_destroy(){super._destroy(),this.table.off("columnStructureChanged",this._tableColumnStructureChangedHandler),this.table.off("aggregationFunctionChanged",this._aggregationFunctionChangedHandler)}_render(){super._render(),this._updateEnabledAndSelectedState(),this.height=this.table.rowHeight+C.insets(this.table.footer.$controlContainer).vertical()}_renderContent(e){this.$contentContainer=e.appendDiv("table-aggregate"),this._aggregate(),this._renderAggregate(),this._reconcileScrollPos(),this.table.$data.on("scroll",this._tableDataScrollHandler),this.table.on("columnResized",this._tableColumnResizedHandler),this.table.on("columnMoved",this._tableColumnMovedHandler),this.table.on("rowsSelected rowsInserted rowsUpdated rowsDeleted filter group allRowsDeleted",this._tableChangedHandler)}_removeContent(){this.$contentContainer.remove(),this.table.$data.off("scroll",this._tableDataScrollHandler),this.table.off("columnResized",this._tableColumnResizedHandler),this.table.off("columnMoved",this._tableColumnMovedHandler),this.table.off("rowsSelected rowsInserted rowsUpdated rowsDeleted filter group allRowsDeleted",this._tableChangedHandler)}_renderAggregate(){let e=[];this.table.visibleColumns().forEach((t,i)=>{let s,r,o;s=this.aggregateRow[i];let l=s==null||t.grouped;l?r=t.createAggrEmptyCell():r=t.createAggrValueCell(s),o=h()(t.buildCell(r,{})),l||e.push(o),this._installCellTooltip(o),this.aggregateRow.selection&&o.addClass("selection"),o.appendTo(this.$contentContainer)}),this.aggregateRow.selection&&this.$contentContainer.addClass("selection"),e.forEach(t=>this.table._resizeAggregateCell(t))}_rerenderAggregate(){this.$contentContainer.empty(),this._renderAggregate(),this._reconcileScrollPos()}_installCellTooltip(e){Y.install(e,{parent:this,text:this.table._cellTooltipText.bind(this.table),htmlEnabled:!0,arrowPosition:50,arrowPositionUnit:"%",nativeTooltip:!w.get().isCustomEllipsisTooltipPossible()})}_aggregate(){let e,t=[],i=this.table.selectedRows;i.length>1?(e=i,t.selection=!0):e=this.table.filteredRows(),this.table._forEachVisibleColumn("aggrStart",t),e.forEach(s=>this.table._forEachVisibleColumn("aggrStep",t,s)),this.table._forEachVisibleColumn("aggrFinish",t),this.aggregateRow=t,this.contentRendered&&this.selected&&this._rerenderAggregate()}_reconcileScrollPos(){let e=this.table.$data.scrollLeft();this.$contentContainer.scrollLeft(e)}_updateEnabledAndSelectedState(e){if(!this.initialized)return;let t=this.table.containsAggregatedNumberColumn();t?e&&!this.table.isGrouped()&&this.setSelected(!0):this.selected&&this.setSelected(!1),this.setEnabled(t)}_setEnabled(e){super._setEnabled(e),this._updateEnabledAndSelectedState()}_setSelected(e){this._setProperty("selected",e),this._updateEnabledAndSelectedState()}_onTableDataScroll(){this._reconcileScrollPos()}_onTableChanged(){this._aggregate()}_onAggregationFunctionChanged(){this._updateEnabledAndSelectedState(!0),this.contentRendered&&this.selected&&this._aggregate()}_onTableColumnResized(){this._rerenderAggregate()}_onTableColumnMoved(e){p.move(this.aggregateRow,e.oldPos,e.newPos),this._rerenderAggregate()}_onTableColumnStructureChanged(){this._updateEnabledAndSelectedState(),this.contentRendered&&this.selected&&this._aggregate()}}class Yd extends Ll{static modifyAggregateTableControlPrototype(){G.get().remote&&b.replacePrototypeFunction($s,"_onTableColumnStructureChanged",function(e){this.modelAdapter?this._updateEnabledAndSelectedState():this._onTableColumnStructureChangedOrig()},!0)}}G.addListener("bootstrap",Yd.modifyAggregateTableControlPrototype);class Xd extends As{form;_formDestroyedHandler;constructor(){super(),this._addWidgetProperties("form"),this._formDestroyedHandler=this._onFormDestroyed.bind(this)}_init(e){super._init(e),this._setForm(this.form)}_createLayout(){return new Jd(this)}_renderContent(e){this.form.renderInitialFocusEnabled=!1,this.form.render(e);let t=this.form.rootGroupBox;t&&t.controls[0]instanceof In&&t.controls[0].$container.addClass("in-table-control"),this.form.$container.height(e.height()),this.form.$container.width(e.width()),this.form.htmlComp.validateRoot=!0,this.form.htmlComp.validateLayout()}_removeContent(){this.form&&this.form.remove()}_removeForm(){this.removeContent()}_renderForm(e){this.renderContent()}isContentAvailable(){return!!this.form}setForm(e){this.setProperty("form",e)}_setForm(e){this.form&&this.form.off("destroy",this._formDestroyedHandler),e&&(e.on("destroy",this._formDestroyedHandler),this._adaptForm(e)),this._setProperty("form",e)}_adaptForm(e){e.setShowOnOpen(!1),e.setDisplayHint(j.DisplayHint.VIEW),e.setModal(!1),e.setClosable(!1),e.setAskIfNeedSave(!1),e.rootGroupBox?.setMenuBarPosition(ae.MenuBarPosition.BOTTOM)}onControlContainerOpened(){!this.form||!this.form.rendered||this.form.renderInitialFocus()}_onFormDestroyed(e){this._removeForm(),this._setForm(null)}}class hg extends Ll{}class Jd extends ne{control;constructor(e){super(),this.control=e}layout(e){if(!this.control.contentRendered||!this.control.form)return;let t=this.control.form,i=t.htmlComp,s=C.size(this.control.tableFooter.$controlContent),r=s.subtract(i.margins());if(i.setSize(r),t.rootGroupBox.controls[0]instanceof In){let l=t.rootGroupBox.controls[0].selectedTab,a=document.activeElement;l&&l.scrollable&&a&&l.$body.has(a)&&P.scrollTo(l.$body,h()(a))}}}class Bl extends Xd{_formSearchHandler=this._onFormSearch.bind(this);_formResetHandler=this._onFormReset.bind(this);constructor(){super(),this.iconId=q.SEARCH,this.tooltipText="${textKey:Search}",this.enabled=!1,this.keyStroke="ctrl-shift-f"}_onFormSearch(e){this.trigger("search")}_onFormReset(e){this.trigger("reset")}_setForm(e){this.form?.off("search",this._formSearchHandler),this.form?.off("reset",this._formResetHandler),e?.on("search",this._formSearchHandler),e?.on("reset",this._formResetHandler),super._setForm(e),this.setEnabled(!!e)}}class dg{objectType;parent;init(e){u.assertParameter("parent",e.parent),$.extend(this,e)}get table(){return this.parent}get session(){return this.parent.session}}class Qd extends _e{table;column;row;cell;_pendingCompleteCellEdit;_rowOrderChangedHandler;_keyStrokeHandler;constructor(){super(),this.table=null,this.column=null,this.row=null,this.cell=null,this._pendingCompleteCellEdit=null,this._keyStrokeHandler=this._onKeyStroke.bind(this)}_init(e){e.scrollType=e.scrollType||"position",super._init(e),this.table=e.column.table,this.link(this.cell.field)}_createLayout(){return new Zd(this)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new tu(this),new iu(this)])}_createCloseKeyStroke(){return new eu(this)}_open(e){this.render(e),this.position(),this.pack()}_getDefaultOpen$Parent(){return this.table.$data}_render(){super._render();let e="",t=this.table.visibleColumns(),i=t.indexOf(this.column);i===0?e="first":i===t.length-1&&(e="last"),this.$container.addClass("cell-editor-popup "+e).data("popup",this);let s=this.cell.field;s.render(),s.prepareForCellEdit({cssClass:e}),this.$anchor.css("visibility","hidden"),this._rowOrderChangedHandler=r=>{r.type==="rowOrderChangeAnimation"?r.row===this.row&&this.position():this.position()},this.table.on("rowOrderChanged rowOrderChangeAnimation",this._rowOrderChangedHandler),this.table.enabled&&this.table.$container.addClass("focused"),this.session.keyStrokeManager.on("keyStroke",this._keyStrokeHandler)}_alignWithSelection(){let e=this._rowSelectionBounds().y;e<0&&(this.$container.cssMarginTop(e),this.$container.addClass("overflow-top"))}_rowSelectionBounds(){let e=new te,t=getComputedStyle(this.row.$row[0],":after");return t&&(e=new te(h().pxToNumber(t.left),h().pxToNumber(t.top),h().pxToNumber(t.width),h().pxToNumber(t.height))),e}_postRender(){super._postRender();let e=this.cell.field;e.onCellEditorRendered&&e.onCellEditorRendered({openFieldPopup:this.table.openFieldPopupOnCellEdit,cellEditorPopup:this})}_remove(){super._remove(),this.session.keyStrokeManager.off("keyStroke",this._keyStrokeHandler),this.table.off("rowOrderChanged rowOrderChangeAnimation",this._rowOrderChangedHandler),this.table.rendered&&this.table.$container.removeClass("focused"),this.$anchor.css("visibility","")}position(e){if(!this.rendered)return;this._alignWithSelection();let t=this.$anchor,i=C.bounds(t),s=this.row.$row,r=C.bounds(s),o=this.table.$data,l=o.cssPaddingLeft()+s.cssMarginLeft()+s.cssBorderLeftWidth();this.setLocation(new X(l+i.x,o.scrollTop()+r.y))}completeEdit(e){if(this._pendingCompleteCellEdit)return this._pendingCompleteCellEdit;let i=this.cell.field.acceptInput();return!i||!u.nvl(e,!0)?(this._pendingCompleteCellEdit=h().resolvedPromise(),this.table.completeCellEdit()):this._pendingCompleteCellEdit=i.then(()=>this.table.completeCellEdit()),this._pendingCompleteCellEdit.then(()=>{this._pendingCompleteCellEdit=h().resolvedPromise()}),this._pendingCompleteCellEdit}isCompleteCellEditRequested(){return!!this._pendingCompleteCellEdit}cancelEdit(){this.table.cancelCellEdit(),this.remove()}_onMouseDownOutside(e){let t=h()(e.target).closest(".table-row",this.table.$container[0]);this.completeEdit(),t.length>0&&!t.isAttached()&&this._propagateMouseDownToTableRow(e)}_propagateMouseDownToTableRow(e){let i=this.table.$container.document(!0).elementFromPoint(e.pageX,e.pageY),s=h()(i);s.closest(".table-row",this.table.$container[0]).length!==0&&Ve.propagateEvent(s[0],e)}_onKeyStroke(e){this._invokeCompleteEditBeforeKeyStroke(e)&&this.completeEdit(!1)}_invokeCompleteEditBeforeKeyStroke(e){if(!this.session.keyStrokeManager.invokeAcceptInputOnActiveValueField(e.keyStroke,e.keyStrokeContext))return!1;let t=e.keyStrokeContext.$getScopeTarget();if(this.$container.isOrHas(t))return!1;let i=Fe.get(t);return!this.cell.field.isOrHas(i)}waitForCompleteCellEdit(){return this._pendingCompleteCellEdit?this._pendingCompleteCellEdit.promise():h().resolvedPromise()}}class Zd extends ne{cellEditorPopup;_field;_htmlContainer;constructor(e){super(),this.cellEditorPopup=e,this._field=e.cell.field,this._htmlContainer=e.htmlComp}layout(e){let t=this._field.htmlComp,i=this._htmlContainer.availableSize({exact:!0}).subtract(this._htmlContainer.insets()).subtract(t.margins());t.setSize(i)}preferredLayoutSize(e,t){let i=this.cellEditorPopup.row.$row,s=this.cellEditorPopup.$anchor,r=C.bounds(s,{exact:!0}),o=C.bounds(i,{exact:!0}),l=this.cellEditorPopup.$container.cssMarginLeft();l<0&&(r.width=r.width+-l);let a=this.cellEditorPopup._rowSelectionBounds().height;return a&&(this._htmlContainer.$comp.toggleClass("overflow-bottom",a>o.height&&this._htmlContainer.$comp.cssMarginTop()===0),o.height=a),new F(r.width,o.height)}}class eu extends B{constructor(e){super(),this.field=e,this.which=[m.ESC],this.stopPropagation=!0}handle(e){this.field.cancelEdit()}}class tu extends B{constructor(e){super(),this.field=e,this.which=[m.ENTER],this.stopPropagation=!0}handle(e){this.field.completeEdit()}}class iu extends B{constructor(e){super(),this.field=e,this.which=[m.TAB],this.shift=void 0}_accept(e){return super._accept(e)&&!this.field.isCompleteCellEditRequested()}handle(e){let t=e.shiftKey,i=this.field.table,s=this.field.column,r=this.field.row;this.field.completeEdit().then(()=>{let o=i.nextEditableCellPos(s,r,t);o&&i.prepareCellEdit(o.column,o.row)})}}class us extends B{constructor(e){super(),this.repeatable=!0,this.field=e,this.shift=e.multiSelect?void 0:!1,this.stopPropagation=!0,this.keyStrokeMode=B.Mode.DOWN,this.inheritAccessibility=!1}_accept(e){if(!super._accept(e))return!1;if(!this.field.visibleRows.length)return this._applyPropagationFlags(e),!1;if(e.shiftKey&&this.field.footer?.$controlContainer?.has(e.target).length)return!1;let i=this.field.$container.activeElement(),s=i[0].tagName.toLowerCase(),r=this.field.$container.data("filter-field");return(!r||i[0]!==r[0])&&(s==="textarea"||s==="input")&&(!e.originalEvent||e.originalEvent&&!e.originalEvent.smartFieldEvent)?!1:(this.field.$container.addClass("keyboard-navigation"),!0)}_viewportInfo(){let e=this.field,t={},i=e.visibleRows;if(i.length===0)return t;let s=C.offsetBounds(e.$data),r=C.insets(e.$data),o=e.$data.cssMarginTop();s=s.subtract(r),o<0&&(s.y-=Math.abs(o),s.height+=Math.abs(o));let l=this._findFirstRowInViewport(e,s),a=this._findLastRowInViewport(e,i.indexOf(l),s);return t.firstRow=l,t.lastRow=a,t}firstRowAfterSelection(){let e=this.field.$selectedRows();if(!e.length)return;let t=this.field.visibleRows,i=e.last().data("row"),s=this.field.filteredRows().indexOf(i);return t[s+1]}firstRowBeforeSelection(){let e=this.field.$selectedRows();if(!e.length)return;let t=this.field.visibleRows,i=e.first().data("row"),s=this.field.visibleRows.indexOf(i);return t[s-1]}_findLastSelectedRowBefore(e,t){let i=e.visibleRows;if(t===0)return i[t];let s=p.findFromReverse(i,t,(r,o)=>{let l=i[o-1];return l?!e.isRowSelected(l):!1});return s||(s=i[0]),s}_findLastSelectedRowAfter(e,t){let i=e.visibleRows;if(t===i.length-1)return i[t];let s=p.findFrom(i,t,(r,o)=>{let l=i[o+1];return l?!e.isRowSelected(l):!1});return s||(s=i[i.length-1]),s}_findFirstRowInViewport(e,t){let i=e.visibleRows;return p.find(i,(s,r)=>{let o=s.$row;if(!o)return!1;let l=o.offset(),a=s.$row.cssMarginTop();return a<0&&(l.top+=Math.abs(a)),t.contains(l.left,l.top)})}_findLastRowInViewport(e,t,i){let s=e.visibleRows;return t===s.length-1?s[t]:p.findFromForward(s,t,(r,o)=>{let l=s[o+1];if(!l)return!0;let a=l.$row;if(!a)return!0;let d=C.offsetBounds(a);return!i.contains(d.x,d.y+d.height-1)})}_isEnabled(){return!this.field.tileMode&&super._isEnabled()}}class su extends B{constructor(e){super(),this.field=e,this.which=[m.ESC],this.stopPropagation=!0,this.renderingHints.render=!1}handle(e){this.field.toggle()}}class ru extends B{constructor(e){super(),this.field=e,this.which=[m.C],this.ctrl=!0,this.renderingHints.render=!1,this.inheritAccessibility=!1}_accept(e){return this.field.footer?.$controlContainer?.has(e.target).length?!1:super._accept(e)}handle(e){this.field.exportToClipboard()}}class Ol extends us{constructor(e,t,i){super(e),this.which=[t],this.renderingHints.text=i,this.renderingHints.$drawingArea=(s,r)=>{let o=this.field.selectedRows[0];if(o)return o.$row}}_accept(e){if(!super._accept(e))return!1;let i=this.field.selectedRows[0];return i?i.expanded&&i.expandable?!0:!!i.parentRow:!1}handle(e){let t=this.field.selectedRows[0];if(!t)return;let i=this.field,s=!1;t.expanded&&t.expandable?(i.collapseRow(t),s=!0):t.parentRow&&(i.selectRow(t.parentRow),i.selectionHandler.lastActionRow=t.parentRow,s=!0),s&&!i.isFocused()&&i.focus()}}class Hl extends us{constructor(e,t,i){super(e),this.which=[t],this.renderingHints.text=i,this.renderingHints.$drawingArea=(s,r)=>{let o=this.field.selectedRows[0];if(o)return o.$row}}_accept(e){if(!super._accept(e))return!1;let i=this.field.selectedRows[0];return i?i.expandable:!1}handle(e){let t=this.field,i=t.selectedRows[0];if(i&&i.expandable){if(i.expanded){let s=t.visibleChildRows(i);t.selectRow(s[0]),t.selectionHandler.lastActionRow=s[0]}else t.expandRow(i);t.isFocused()||t.focus()}}}class nu extends B{constructor(e){super(),this.field=e,this.ctrl=!0,this.which=[m.A],this.renderingHints.offset=14,this.renderingHints.$drawingArea=(t,i)=>this.field.footer?this.field.footer._$infoSelection.find(".table-info-button"):null,this.inheritAccessibility=!1}_accept(e){return this.field.footer?.$controlContainer?.has(e.target).length?!1:super._accept(e)}handle(e){let t=this.field;t.toggleSelection(),t.selectionHandler.lastActionRow=null}}class ou extends B{constructor(e){super(),this.field=e,this.ctrl=!0,this.which=[m.ENTER],this.stopPropagation=!0,this.renderingHints.$drawingArea=(t,i)=>{let s=i._editPosition,r=this.field.visibleColumns().indexOf(s.column);return r===0?s.row.$row:this.field.$cell(r,s.row.$row)}}_accept(e){if(!super._accept(e)||this.field.cellEditorPopup)return!1;let i=this.field.selectedRows;if(!i.length)return!1;let s=this.field.nextEditableCellPosForRow(0,i[0]);return s?(e._editPosition=s,!0):!1}handle(e){let t=e._editPosition;this.field.prepareCellEdit(t.column,t.row,!0)}}class lu extends B{constructor(e){super(),this.field=e,this.which=[m.F5],this.renderingHints.offset=14,this.renderingHints.$drawingArea=(t,i)=>this.field.footer?this.field.footer._$infoLoad.find(".table-info-button"):null}_accept(e){return super._accept(e)&&this.field.hasReloadHandler}handle(e){this.field.reload()}}class au extends B{constructor(e){super(),this.field=e,this.which=[m.SPACE],this.stopPropagation=!0,this.renderingHints.render=!1}_accept(e){return super._accept(e)&&this.field.checkable&&this.field.selectedRows.length>0}handle(e){let t=this.field.selectedRows.filter(s=>s.enabled),i=t.some(s=>!s.checked);t.forEach(s=>this.field.checkRow(s,i))}}class hu extends us{constructor(e){super(e),this.which=[m.UP],this.renderingHints.text="↑",this.renderingHints.$drawingArea=(t,i)=>{let s=this.firstRowBeforeSelection();if(s)return s.$row}}handle(e){let t=this.field,i=t.visibleRows,s=t.selectedRows,r=t.selectionHandler.lastActionRow,o=-1,l=-1,a,d;if(r&&(o=i.indexOf(r)),i.length>1&&(s.length>0||o>-1)){if(o<0&&(i.length===s.length?r=p.last(i):r=p.first(s),o=i.indexOf(r)),o===0)return;if(l=o-1,d=i[l],a=[d],e.shiftKey)if(t.isRowSelected(d)){a=[],p.pushAll(a,s);let c=t.selectionHandler.getMinMaxSelectionIndizes();u.isOneOf(o,c[0],c[1])&&p.remove(a,r)}else a=p.union(a,s),d=this._findLastSelectedRowBefore(t,l)}else a=[p.last(i)],d=a[0];t.selectionHandler.lastActionRow=d,t.selectRows(a,!0),t.scrollTo(d),t.isFocused()||t.focus(),T.linkElementWithActiveDescendant(this.field.$container,d.$row)}}class du extends us{constructor(e){super(e),this.which=[m.DOWN],this.renderingHints.text="↓",this.renderingHints.$drawingArea=(t,i)=>{let s=this.firstRowAfterSelection();if(s)return s.$row}}handle(e){let t=this.field,i=t.visibleRows,s=t.selectedRows,r=t.selectionHandler.lastActionRow,o=-1,l=-1,a,d;if(r&&(o=i.indexOf(r)),i.length>1&&(s.length>0||o>-1)){if(o<0&&(i.length===s.length?r=p.first(i):r=p.last(s),o=i.indexOf(r)),o===i.length-1)return;if(l=o+1,a=i[l],d=[a],e.shiftKey)if(t.isRowSelected(a)){d=[],p.pushAll(d,s);let c=t.selectionHandler.getMinMaxSelectionIndizes();u.isOneOf(o,c[0],c[1])&&p.remove(d,r)}else d=p.union(s,d),a=this._findLastSelectedRowAfter(t,l)}else d=[p.first(i)],a=d[0];t.selectionHandler.lastActionRow=a,t.selectRows(d,!0),t.scrollTo(a),t.isFocused()||t.focus(),T.linkElementWithActiveDescendant(this.field.$container,a.$row)}}class uu extends us{constructor(e){super(e),this.which=[m.HOME],this.renderingHints.text="Home",this.renderingHints.$drawingArea=(t,i)=>{let s=this._viewportInfo();if(s.firstRow)return s.firstRow.$row}}handle(e){let t=this.field,i=t.visibleRows,s=p.first(i),r=t.selectedRows,o=[],l=t.selectionHandler.lastActionRow,a=-1;e.shiftKey&&r.length>0?(l&&(a=i.indexOf(l)),a<0&&(l=p.first(r),a=i.indexOf(l)),o=i.slice(0,a),o=p.union(o,r)):o=[s],t.selectionHandler.lastActionRow=s,t.selectRows(o),t.scrollTo(s),t.isFocused()||t.focus(),T.linkElementWithActiveDescendant(this.field.$container,s.$row)}}class cu extends us{constructor(e){super(e),this.which=[m.END],this.renderingHints.text="End",this.renderingHints.$drawingArea=(t,i)=>{let s=this._viewportInfo();if(s.lastRow)return s.lastRow.$row}}handle(e){let t=this.field,i=t.visibleRows,s=p.last(i),r=t.selectedRows,o=[],l=t.selectionHandler.lastActionRow,a=-1;e.shiftKey&&r.length>0?(l&&(a=i.indexOf(l)),a<0&&(l=p.last(r),a=i.indexOf(l)),o=i.slice(a+1,i.length),o=p.union(r,o)):o=[s],t.selectionHandler.lastActionRow=s,t.selectRows(o),t.scrollTo(s),t.isFocused()||t.focus(),T.linkElementWithActiveDescendant(this.field.$container,s.$row)}}class pu extends us{constructor(e){super(e),this.which=[m.PAGE_UP],this.renderingHints.text="PgUp",this.renderingHints.$drawingArea=(t,i)=>{let s=this._viewportInfo();if(s.firstRow)return s.firstRow.$row}}handle(e){let t=this.field,i=this._viewportInfo(),s=t.visibleRows,r=t.selectedRows,o=p.first(r),l=t.selectionHandler.lastActionRow,a=-1,d;!i.firstRow&&(t.scrollPageUp(),i=this._viewportInfo(),!i.firstRow)||(l&&(a=s.indexOf(l)),a<0&&(l=o,a=s.indexOf(l)),!(r.length>0&&l===i.firstRow&&!(r.length>1&&!e.shiftKey)&&(t.scrollPageUp(),i=this._viewportInfo(),!i.firstRow))&&(e.shiftKey&&r.length>0?(d=s.slice(s.indexOf(i.firstRow),a),d=p.union(r,d)):d=[i.firstRow],t.selectionHandler.lastActionRow=i.firstRow,t.selectRows(d,!0),t.isFocused()||t.focus(),T.linkElementWithActiveDescendant(this.field.$container,i.firstRow.$row)))}}class fu extends us{constructor(e){super(e),this.which=[m.PAGE_DOWN],this.renderingHints.text="PgDn",this.renderingHints.$drawingArea=(t,i)=>{let s=this._viewportInfo();if(s.lastRow)return s.lastRow.$row}}handle(e){let t=this.field,i=this._viewportInfo(),s=t.visibleRows,r=t.selectedRows,o=p.last(r),l=t.selectionHandler.lastActionRow,a=-1,d;!i.lastRow&&(t.scrollPageDown(),i=this._viewportInfo(),!i.lastRow)||(l&&(a=s.indexOf(l)),a<0&&(l=o,a=s.indexOf(l)),!(r.length>0&&l===i.lastRow&&!(r.length>1&&!e.shiftKey)&&(t.scrollPageDown(),i=this._viewportInfo(),!i.lastRow))&&(e.shiftKey&&r.length>0?(d=s.slice(a+1,s.indexOf(i.lastRow)+1),d=p.union(r,d)):d=[i.lastRow],t.selectionHandler.lastActionRow=i.lastRow,t.selectRows(d,!0),t.isFocused()||t.focus(),T.linkElementWithActiveDescendant(this.field.$container,i.lastRow.$row)))}}class Nl{objectType;table;constructor(){this.table=null}install(e){if(this.table)throw new Error("Already installed");this.table=u.assertInstance(e,H)}uninstall(){this.table=null}getInvisibleColumns(){if(!this.table)return[];let e=this.table.displayableColumns(),t=this.table.visibleColumns();return p.diff(e,t)}showColumns(e,t){this.table&&(e=p.ensure(e).filter(i=>this.table.columns.includes(i)),e.length&&(e.forEach(i=>i.setVisible(!0,!1)),t&&t.visible&&this.table.columns.includes(t)&&this._moveColumns(e,t),this.table.onColumnVisibilityChanged()))}_moveColumns(e,t){for(const i of e.reverse()){let s=this.table.visibleColumns(),r=s.indexOf(i),o=s.indexOf(t);this.table._moveColumn(i,s,r,o)}}hideColumns(e){if(this.table&&(e=p.ensure(e).filter(Boolean),!!e.length)){for(let t of e)t.setVisible(!1,!1),t.grouped&&this.table.removeGroupColumn(t),t.sortActive&&this.table.removeSortColumn(t),this.table.removeFilterByKey(t.id);this.table.onColumnVisibilityChanged()}}moveColumns(e){let t=this.table.filterColumns(i=>i.guiOnly);for(const i of t.reverse())e.includes(i)||(e=[i,...e]);for(let i=0;i<e.length;i++){const s=e[i];this.table.moveColumn(s,i)}}isColumnAddable(){if(!this.table||!this.table.columnAddable)return!1;if(this.table.isCustomizable())return!0;let e=this.getInvisibleColumns();return p.hasElements(e)}addColumn(e){return this.table.isCustomizable()?this.table.customizer.addColumn(e):this._showInvisibleColumnsForm(e)}isColumnRemovable(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.table||!e.removable||e.fixedPosition?!1:this.table.isCustomizable()&&this.table.customizer.isCustomizable(e)?!0:this.table.visibleColumns(!1).length>(t?0:1)}removeColumns(e){if(this.table.isCustomizable()){let t=e.filter(s=>this.table.customizer.isCustomizable(s)),i=e.filter(s=>!this.table.customizer.isCustomizable(s));this.table.customizer.removeColumns(t),this.hideColumns(i)}else this.hideColumns(e)}isColumnModifiable(e){return!this.table||!e.modifiable?!1:!!(this.table.isCustomizable()&&this.table.customizer.isCustomizable(e))}modifyColumn(e){return this.table.isCustomizable()&&this.table.customizer.isCustomizable(e)?this.table.customizer.modifyColumn(e):$.resolvedPromise()}isColumnMovableToLeft(e){if(!e.visible)return!1;let t=this.table.visibleColumns().indexOf(e),i=t-1;return i=this.table.considerFixedPositionColumns(t,i),i>=0&&i<t}isColumnMovableToRight(e){if(!e.visible)return!1;let t=this.table.visibleColumns(),i=t.indexOf(e),s=i+1;return s=this.table.considerFixedPositionColumns(i,s),s<t.length&&s>i}_showInvisibleColumnsForm(e){let t=u.create(Sn,{parent:this.table,data:{columns:this.getInvisibleColumns()}});return t.open(),t.whenSave().then(()=>{this.showColumns(t.data.columns,e)})}}const b_=()=>({objectType:j,title:"${textKey:TableOrganize}",headerVisible:!0,saveNeededVisible:!1,rootGroupBox:{objectType:ae,gridDataHints:{widthInPixel:750,heightInPixel:350},fields:[{id:"ProfilesBox",objectType:ae,label:"${textKey:SavedSettings}",labelVisible:!1,statusVisible:!1,gridColumnCount:1,gridDataHints:{w:1},fields:[{id:"ProfilesTableField",objectType:fs,labelVisible:!1,statusVisible:!1,gridDataHints:{useUiHeight:w.get().type===w.Type.MOBILE},table:{id:"ProfilesTable",objectType:H,headerEnabled:!1,autoResizeColumns:!0,defaultRowAction:"LoadConfigMenu",cssClass:"table-organizer-profiles-table",columns:[{id:"ConfigNameColumn",objectType:le,text:"${textKey:SavedSettings}",sortIndex:1,comparator:rt.ALPHANUMERIC},{id:"DefaultConfigColumn",objectType:le,displayable:!1,sortIndex:0,sortAscending:!1}],menus:[{id:"NewConfigMenu",objectType:J,text:"${textKey:New}"},{id:"LoadConfigMenu",objectType:J,text:"${textKey:Load}",menuTypes:[H.MenuType.SingleSelection],keyStroke:"enter"},{id:"UpdateConfigMenu",objectType:J,text:"${textKey:Update}",menuTypes:[H.MenuType.SingleSelection]},{id:"DeleteConfigMenu",objectType:J,text:"${textKey:DeleteMenu}",menuTypes:[H.MenuType.SingleSelection,H.MenuType.MultiSelection],keyStroke:"delete"},{id:"RenameConfigMenu",objectType:J,text:"${textKey:Rename}",menuTypes:[H.MenuType.SingleSelection],keyStroke:"ctrl-enter"}]}}]},{id:"ColumnsBox",objectType:ae,label:"${textKey:Columns}",labelVisible:!1,statusVisible:!1,menuBarPosition:ae.MenuBarPosition.TITLE,gridColumnCount:1,gridDataHints:{w:1},fields:[{id:"ColumnsTableField",objectType:fs,labelVisible:!1,statusVisible:!1,table:{id:"ColumnsTable",objectType:H,cssClass:"no-menubar-separators",headerEnabled:!1,autoResizeColumns:!0,scrollToSelection:!0,defaultRowAction:"ModifyColumnMenu",textFilterEnabled:!1,columns:[{id:"KeyColumn",objectType:le,displayable:!1},{id:"TitleColumn",objectType:le,text:"${textKey:Column}",width:120},{id:"StatusColumn",objectType:le,text:"${textKey:Status}",htmlEnabled:!0,width:70,fixedWidth:!0,cssClass:"table-organizer-column-status-cell"},{id:"WidthColumn",objectType:le,text:"${textKey:Width}",autoOptimizeWidth:!0,autoOptimizeMaxWidth:85,horizontalAlignment:1}],menus:[{id:"AddColumnMenu",objectType:J,iconId:q.PLUS,tooltipText:"${textKey:AddColumn}"},{id:"RemoveColumnMenu",objectType:J,iconId:q.MINUS,keyStroke:"delete",tooltipText:"${textKey:RemoveColumn}"},{id:"ModifyColumnMenu",objectType:J,iconId:q.PENCIL,tooltipText:"${textKey:ModifyColumn}"},{id:"MoveColumnUpMenu",objectType:J,iconId:q.ANGLE_UP,keyStroke:"alt-up",horizontalAlignment:1,tooltipText:"${textKey:MoveColumnForward}"},{id:"MoveColumnDownMenu",objectType:J,iconId:q.ANGLE_DOWN,keyStroke:"alt-down",horizontalAlignment:1,tooltipText:"${textKey:MoveColumnBackward}"}]}}]}]}});class ug extends H{}class cg extends H{}class gu extends j{table;profilesTable;columnsTable;keyColumn;_jsonModel(){return b_()}_init(e){super._init(e),this.table=this.findParent(H),this.profilesTable=this.widget("ProfilesTable"),this.columnsTable=this.widget("ColumnsTable"),this.keyColumn=this.columnsTable.columnById("KeyColumn"),this.widget("NewConfigMenu").on("action",t=>this._addNewConfig()),this.widget("LoadConfigMenu").on("action",t=>this._loadConfig()),this.widget("UpdateConfigMenu").on("action",t=>this._updateConfig()),this.widget("DeleteConfigMenu").on("action",t=>this._deleteConfigs()),this.widget("RenameConfigMenu").on("action",t=>this._renameConfig()),this.profilesTable.on("rowsSelected",t=>this._onProfilesTableRowsSelected(t)),this.profilesTable.on("startCellEdit",t=>this._onProfilesTableStartCellEdit(t)),this.profilesTable.on("completeCellEdit",t=>this._onProfilesTableCompleteCellEdit(t)),this.widget("AddColumnMenu").on("action",t=>this._onAddColumnMenuAction(t)),this.widget("ModifyColumnMenu").on("action",t=>this._onModifyColumnMenuAction(t)),this.widget("RemoveColumnMenu").on("action",t=>this._onRemoveColumnMenuAction(t)),this.columnsTable.on("rowsSelected",t=>this._onColumnsTableRowsSelected(t)),this.columnsTable.columnById("WidthColumn").setVisible(!this.table.autoResizeColumns),this._installColumnUpDownMenus(),_.startsWith(this.table.userPreferenceContext,`${gi.PROFILE_ID_BOOKMARK}:`)&&this.widget("NewConfigMenu").setEnabled(!1)}_load(){return this._reloadProfilesTable(),this._reloadColumnsTable(),this._updateColumnMenus(),super._load()}_reloadProfilesTable(){const e=[{cells:[this.session.text("DefaultSettings"),!0]}];let t=je.get(this.table);t?.tablePreferenceProfiles&&[...t.tablePreferenceProfiles.keys()].filter(i=>i!==gi.PROFILE_ID_GLOBAL).forEach(i=>e.push({cells:[i]})),this.profilesTable.replaceRows(e)}_onProfilesTableRowsSelected(e){this._updateProfileMenus(),this.profilesTable.selectedRows.length&&this.columnsTable.deselectAll()}_onProfilesTableStartCellEdit(e){e.field.selectAll()}_onProfilesTableCompleteCellEdit(e){e.cell.setEditable(!1),this.profilesTable.updateRow(e.row);let t=this.profilesTable.columnById("ConfigNameColumn").cellValue(e.row),i=e.field.value;je.renameProfile(this.table,t,i)}_updateProfileMenus(){const e=this.profilesTable.columnById("DefaultConfigColumn").selectedCellValues().includes(!0);this.widget("UpdateConfigMenu").setVisible(!e),this.widget("DeleteConfigMenu").setVisible(!e),this.widget("RenameConfigMenu").setVisible(!e)}_addNewConfig(){let e=this._newConfigName(),t=je.createProfile(this.table,{includeUserFilters:!0});je.storeProfile(this.table,e,t);let i=u.create(Rt,{parent:this.profilesTable});this.profilesTable.columnById("ConfigNameColumn").setCellValue(i,e),this.profilesTable.columnById("DefaultConfigColumn").setCellValue(i,!1),this.profilesTable.insertRow(i),this._renameConfig(i)}_newConfigName(){let e=1;const t=this.session.text("New"),i=this.profilesTable.columnById("ConfigNameColumn").cellValues();for(;i.includes(`${t} ${e}`);)e++;return`${t} ${e}`}_loadConfig(e){e=u.nvl(e,this.profilesTable.selectedRow());let t=this.profilesTable.columnById("ConfigNameColumn").cellValue(e);if(this.profilesTable.columnById("DefaultConfigColumn").cellValue(e))this.table.resetToInitialUiPreferences();else{let s=je.get(this.table),r=je.getProfile(s,t);je.applyProfile(this.table,r),je.storeGlobalProfile(this.table)}this._reloadColumnsTable()}_updateConfig(e){if(e=u.nvl(e,this.profilesTable.selectedRow()),this.profilesTable.columnById("DefaultConfigColumn").cellValue(e))return;let t=this.profilesTable.columnById("ConfigNameColumn").cellValue(e),i=je.createProfile(this.table);je.storeProfile(this.table,t,i)}_renameConfig(e){e=u.nvl(e,this.profilesTable.selectedRow());const t=this.profilesTable.columnById("ConfigNameColumn");t.cell(e).setEditable(!0),this.profilesTable.updateRow(e),this.profilesTable.focusCell(t,e)}_deleteConfigs(e){e=u.nvl(e,this.profilesTable.selectedRows);const t=this.profilesTable.columnById("ConfigNameColumn"),i=this.profilesTable.columnById("DefaultConfigColumn");e=e.filter(s=>!i.cellValue(s)),e.forEach(s=>{let r=t.cellValue(s);je.removeProfile(this.table,r)}),this.profilesTable.deleteRows(e)}_reloadColumnsTable(){const t=this.table.visibleColumns(!1).map(i=>({cells:[i,Sn.createColumnTitleCell(i),u.create(_t,{value:this._computeColumnStatus(i),tooltipText:this._computeColumnStatusTooltip(i)}),i.width]}));this.columnsTable.replaceRows(t)}_computeColumnStatus(e){let t=e.filtered,i="G",s="F",r=e.sortAscending?"↑":"↓",o=e.sortIndex+1,l=this.table.visibleSortColumnsCount(),a=$("<div>"),d=a.appendDiv("status"),c=d.appendSpan("group-filter");return c.appendDiv().text(i).toggleClass("hidden",!e.grouped),c.appendDiv().text(s).toggleClass("hidden",!t),!e.grouped&&!t&&c.children().removeClass("hidden").addClass("invisible"),d.appendSpan("sort-direction").text(r).toggleClass("invisible",!e.sortActive),d.appendSpan("sort-index").text(o).toggleClass("invisible",!e.sortActive||l<=1),a.html()}_computeColumnStatusTooltip(e){let t=[];return e.grouped&&t.push(this.session.text("Grouped")),e.filtered&&t.push(this.session.text("Filtered")),e.sortActive&&t.push(this.session.text("Sorted")),t.join(`
`)}_updateColumnMenus(){let e=this.keyColumn.selectedCellValues(),t=this.table.organizer.isColumnAddable(),i=!1,s=!1;for(const r of e)this.table.organizer.isColumnModifiable(r)&&(s=!0),this._isColumnRemovable(r)&&(i=!0);this.widget("AddColumnMenu").setVisible(t),this.widget("ModifyColumnMenu").setVisible(s),this.widget("RemoveColumnMenu").setVisible(i)}_isColumnRemovable(e){return this.table.organizer.isColumnRemovable(e,!0)}async _onAddColumnMenuAction(e){let t=this.table.visibleColumns();await this.table.organizer.addColumn(p.last(this.keyColumn.selectedCellValues())),this._reloadColumnsTable();let i=p.diff(this.table.visibleColumns(),t);this.columnsTable.selectRows(this.columnsTable.rows.filter(s=>i.includes(this.keyColumn.cellValue(s)))),this.columnsTable.focus()}async _onModifyColumnMenuAction(e){await this.table.organizer.modifyColumn(this.keyColumn.selectedCellValue()),this._reloadColumnsTable()}_onRemoveColumnMenuAction(e){this.table.organizer.removeColumns(this.keyColumn.selectedCellValues().filter(t=>this._isColumnRemovable(t))),this._reloadColumnsTable()}_onColumnsTableRowsSelected(e){this._updateColumnMenus(),this.columnsTable.selectedRows.length&&this.profilesTable.deselectAll()}_installColumnUpDownMenus(){const e=this.widget("MoveColumnUpMenu"),t=this.widget("MoveColumnDownMenu");u.create(Ml).install({table:this.columnsTable,moveRowUpMenu:e,moveRowDownMenu:t,alwaysShowMenus:!0,rowFilter:(i,s)=>{let r=this.keyColumn.cellValue(i);return s==="up"?this.table.organizer.isColumnMovableToLeft(r):this.table.organizer.isColumnMovableToRight(r)}}),this.columnsTable.on("rowOrderChanged",i=>{let s=this.keyColumn.cellValues();this.table.organizer.moveColumns(s),this._updateColumnMenus()})}}const y_=()=>({objectType:Ji,iconId:q.GEAR,tooltipText:"${textKey:TableOrganize}",menuTypes:[H.MenuType.Header],inheritAccessibility:!1,popupResizable:!0,popupMovable:!0});class mu extends Ji{_jsonModel(){return y_()}init(e){super.init(e),this._updateForm(),this.on("propertyChange:selected",t=>this._updateForm())}_updateForm(){if(!this.selected){this.form?.destroy();return}this.form||this.setForm(u.create(gu,{parent:this})),this.form.load()}_createPopup(){const e=super._createPopup();return e.addCssClass("table-organizer-menu-popup"),e}}class _u extends Nl{isColumnAddable(e){return this.table?this.table.columnAddable:!1}addColumn(e){return this.table.modelAdapter.sendColumnOrganizeAction(e,"add"),$.resolvedPromise()}isColumnRemovable(e){return this.table?e.removable:!1}removeColumns(e){for(const t of e)this.table.modelAdapter.sendColumnOrganizeAction(t,"remove")}isColumnModifiable(e){return this.table?e.modifiable:!1}modifyColumn(e){return this.table.modelAdapter.sendColumnOrganizeAction(e,"modify"),$.resolvedPromise()}}const w_=()=>({objectType:j,title:"${textKey:ShowColumns}",saveNeededVisible:!1,rootGroupBox:{id:"MainBox",objectType:ae,mainBox:!0,gridColumnCount:1,menus:[{id:"OkMenu",objectType:Cn},{id:"CancelMenu",objectType:wn}],fields:[{id:"GroupBox",objectType:ae,statusVisible:!1,fields:[{id:"ColumnsTableField",objectType:fs,labelVisible:!1,statusVisible:!1,gridDataHints:{h:6},table:{id:"ColumnsTable",objectType:H,cssClass:"table-organizer-show-invisible-columns-form-table",checkable:!0,checkableStyle:H.CheckableStyle.CHECKBOX_TABLE_ROW,headerVisible:!1,autoResizeColumns:!0,columns:[{id:"KeyColumn",objectType:le,primaryKey:!0,displayable:!1},{id:"CheckedColumn",objectType:nr,checkable:!0,width:28,minWidth:28,fixedWidth:!0,nodeColumnCandidate:!1},{id:"TitleColumn",objectType:le}]}}]}]}});class pg extends H{}class Sn extends j{_jsonModel(){return w_()}importData(){let t=p.ensure(this.data?.columns).map(i=>({cells:[i,!1,Sn.createColumnTitleCell(i)]}));this.widget("ColumnsTable").insertRows(t)}exportData(){let e=this.widget("ColumnsTable"),t=e.columnById("KeyColumn");return{columns:e.checkedRows().map(s=>t.cellValue(s))}}static createColumnTitleCell(e){let t=e.text,i=e.headerHtmlEnabled,s=null;_.empty(t)&&(t=e.headerTooltipText,i=e.headerTooltipHtmlEnabled,s="italic");let r=i?_.plainText(t):t;return u.create(_t,{value:r,font:s})}}class ft extends ot{objectType;session;table;filterType;constructor(){super(),this.session=null}init(e){if(this.session=e.session,!this.session)throw new Error("Session expected: "+this);this._init(e)}_init(e){h().extend(this,e)}createFilterAddedEventData(){return{filterType:this.filterType}}createFilterRemovedEventData(){return{filterType:this.filterType}}createKey(){return this.filterType}equals(e){return e instanceof ft?b.equals(this.createKey(),e.createKey()):!1}}class Ms{tryToDo(e,t){return this._acceptFilter(t)?this._toDo(e,t):null}tryFromDo(e,t){return this._acceptFilterState(t)?this._fromDo(e,t):null}}class Ot{static DEFAULT_ORDER=5e3;static _INSTANCE=null;_registry=[];register(e){let i={order:arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ot.DEFAULT_ORDER,mapper:e instanceof Ms?e:null,mapperConstructor:e instanceof Ms?null:e};return p.insertSorted(this._registry,i,(s,r)=>s.order-r.order),i}unregister(e){return p.remove(this._registry,e)}all(){return this._registry.map(e=>(e.mapper=e.mapper||u.create(e.mapperConstructor),e.mapper))}static get(){return Ot._INSTANCE||(Ot._INSTANCE=u.create(Ot)),Ot._INSTANCE}static all(){return Ot.get().all()}}class Oi extends ft{column;hasFilterFields;availableValues;selectedValues;matrix;xAxis;constructor(){super(),this.filterType=Oi.TYPE,this.hasFilterFields=!1,this.availableValues=[],this.selectedValues=[]}static TYPE="column";axisGroup(){return Lt.NumberGroup.COUNT}calculate(){let e,t;this.matrix=new Lt(this.table,this.session),this.matrix.addData(this.column,Lt.NumberGroup.COUNT),this.xAxis=this.matrix.addAxis(this.column,this.axisGroup());let i=this.matrix.calculate();this.selectedValues.forEach(s=>{e=!1,this.xAxis.some(r=>this.xAxis.keyToDeterministicKey(r)===s?(e=!0,!0):!1),e||(this.xAxis.push(this.xAxis.deterministicKeyToKey(s)),t=!0)}),t&&this.xAxis.reorder(),this.availableValues=[],this.xAxis.forEach(s=>{let r=this.xAxis.keyToDeterministicKey(s),o=this.formatText(s),l=null;s!==null&&this.xAxis.isIcon&&(l=o,o=null);let a=i.getValue([s]);this.availableValues.push({key:r,text:o,iconId:l,htmlEnabled:!1,cssClass:null,count:a?a[0]:0})})}createFilterAddedEventData(){let e=super.createFilterAddedEventData();return e.columnId=this.column.id,e.selectedValues=this.selectedValues,e}createFilterRemovedEventData(){let e=super.createFilterRemovedEventData();return e.columnId=this.column.id,e}createLabel(){return this.column.headerHtmlEnabled?_.plainText(this.column.text).replace(/\n/g," "):this.column.text||""}createKey(){return this.column.id}accept(e){this.xAxis||this.calculate();let t=!0,i=!0,s=this.column.cellValueOrTextForCalculation(e),r=this.xAxis.normDeterministic(s);return this.tableFilterActive()&&(t=this.selectedValues.indexOf(r)>-1),this.fieldsFilterActive()&&(i=this.acceptByFields(s,r,e)),t&&i}filterActive(){return this.tableFilterActive()||this.fieldsFilterActive()}tableFilterActive(){return this.selectedValues.length>0}triggerFilterFieldsChanged(){this.trigger("filterFieldsChanged")}acceptByFields(e,t,i){return!0}fieldsFilterActive(){return!1}addFilterFields(e){}modifyFilterFields(){}filterFieldsTitle(){return null}createComparator(){return rt.NUMERIC}formatText(e){return this.xAxis.format(e)}linkFieldsWithTitle(e){}}class bu extends Ms{_acceptFilter(e){return e instanceof Oi}_acceptFilterState(e){return e instanceof Ns}_toDo(e,t){return u.create(Ns,{columnId:t.column.buildUuid(),selectedValues:new Set(t.selectedValues)})}_fromDo(e,t){const i=e.session,s=e.columnByUuid(t.columnId);return u.create(s.filterType,{session:i,table:e,column:s,selectedValues:[...t.selectedValues]})}}Ot.get().register(bu,6e3);class yu extends Oi{dateFrom;dateTo;dateFromField;dateToField;constructor(){super(),this.dateFrom=null,this.dateFromField=null,this.dateTo=null,this.dateToField=null,this.hasFilterFields=!0}_init(e){super._init(e),this.dateFrom=typeof e.dateFrom=="string"?S.parseJsonDate(e.dateFrom):e.dateFrom,this.dateTo=typeof e.dateTo=="string"?S.parseJsonDate(e.dateTo):e.dateTo}axisGroup(){return this.column.hasDate?Lt.DateGroup.YEAR:Lt.DateGroup.NONE}createFilterAddedEventData(){let e=super.createFilterAddedEventData();return e.dateFrom=S.toJsonDate(this.dateFrom),e.dateTo=S.toJsonDate(this.dateTo),e}fieldsFilterActive(){return!!this.dateFrom||!!this.dateTo}acceptByFields(e,t,i){if(!e)return!1;let s=e.valueOf(),r=this.dateFrom?this.dateFrom.valueOf():null,o=this.dateTo?S.shift(this.dateTo,0,0,1).valueOf()-1:null;if(r&&o)return s>=r&&s<=o;if(r)return s>=r;if(o)return s<=o;throw new Error("illegal state")}filterFieldsTitle(){return this.session.text("ui.DateRange")}addFilterFields(e){this.dateFromField=e.addFilterField(Ht,"ui.from"),this.dateFromField.setValue(this.dateFrom),this.dateFromField.on("propertyChange",this._onPropertyChange.bind(this)),this.dateToField=e.addFilterField(Ht,"ui.to"),this.dateToField.setValue(this.dateTo),this.dateToField.on("propertyChange",this._onPropertyChange.bind(this))}_onPropertyChange(e){e.propertyName==="value"&&(this.dateFrom=this.dateFromField.value,this.dateTo=this.dateToField.value,h().log.isDebugEnabled()&&h().log.debug("(DateColumnUserFilter#_onAcceptInput) dateFrom="+this.dateFrom+" dateTo="+this.dateTo),this.triggerFilterFieldsChanged())}modifyFilterFields(){this.dateFromField.$field.on("input","",h().debounce(this._onInput.bind(this))),this.dateToField.$field.on("input","",h().debounce(this._onInput.bind(this)))}linkFieldsWithTitle(e){T.linkElementWithLabel(this.dateFromField.$dateField,e),T.linkElementWithLabel(this.dateToField.$dateField,e)}_onInput(e){this.dateFromField.rendered&&(this.dateFrom=this.dateFromField.value,this.dateTo=this.dateToField.value,this.triggerFilterFieldsChanged())}}class wu extends Ms{_acceptFilter(e){return e instanceof yu}_acceptFilterState(e){return e instanceof ss}_toDo(e,t){return u.create(ss,{columnId:t.column.buildUuid(),selectedValues:new Set(t.selectedValues),dateFrom:t.dateFrom,dateTo:t.dateTo})}_fromDo(e,t){const i=e.session,s=e.columnByUuid(t.columnId);return u.create(s.filterType,{session:i,table:e,column:s,selectedValues:[...t.selectedValues],dateFrom:S.toJsonDate(t.dateFrom),dateTo:S.toJsonDate(t.dateTo)})}}Ot.get().register(wu);class Cu extends Oi{numberFrom;numberTo;numberFromField;numberToField;constructor(){super(),this.numberFrom=null,this.numberFromField=null,this.numberTo=null,this.numberToField=null,this.hasFilterFields=!0}createFilterAddedEventData(){let e=super.createFilterAddedEventData();return e.numberFrom=this.numberFrom,e.numberTo=this.numberTo,e}fieldsFilterActive(){return b.isNumber(this.numberFrom)||b.isNumber(this.numberTo)}acceptByFields(e,t,i){let s=b.isNumber(this.numberFrom),r=b.isNumber(this.numberTo);if(s&&r)return t>=this.numberFrom&&t<=this.numberTo;if(s)return t>=this.numberFrom;if(r)return t<=this.numberTo}filterFieldsTitle(){return this.session.text("ui.NumberRange")}addFilterFields(e){this.numberFromField=e.addFilterField(ps,"ui.from"),this.numberFromField.decimalFormat=this.column.decimalFormat,this.numberFromField.setValue(this.numberFrom),this.numberFromField.on("propertyChange",this._onPropertyChange.bind(this)),this.numberToField=e.addFilterField(ps,"ui.to"),this.numberToField.decimalFormat=this.column.decimalFormat,this.numberToField.setValue(this.numberTo),this.numberToField.on("propertyChange",this._onPropertyChange.bind(this))}_onPropertyChange(e){e.propertyName==="value"&&(this.numberFrom=this.numberFromField.value,this.numberTo=this.numberToField.value,h().log.isDebugEnabled()&&h().log.debug("(NumberColumnUserFilter#_onPropertyChange) numberFrom="+this.numberFrom+" numberTo="+this.numberTo),this.triggerFilterFieldsChanged())}linkFieldsWithTitle(e){T.linkElementWithLabel(this.numberFromField.$field,e),T.linkElementWithLabel(this.numberToField.$field,e)}}class Tu extends Ms{_acceptFilter(e){return e instanceof Cu}_acceptFilterState(e){return e instanceof rs}_toDo(e,t){return u.create(rs,{columnId:t.column.buildUuid(),selectedValues:new Set(t.selectedValues),numberFrom:t.numberFrom,numberTo:t.numberTo})}_fromDo(e,t){const i=e.session,s=e.columnByUuid(t.columnId);return u.create(s.filterType,{session:i,table:e,column:s,selectedValues:[...t.selectedValues],numberFrom:t.numberFrom,numberTo:t.numberTo})}}Ot.get().register(Tu);class vu extends Oi{freeText;freeTextField;constructor(){super(),this.freeText=null,this.freeTextField=null,this.hasFilterFields=!0}createFilterAddedEventData(){let e=super.createFilterAddedEventData();return e.freeText=this.freeText,e}fieldsFilterActive(){return _.hasText(this.freeText)}acceptByFields(e,t,i){let s=_.nvl(this.freeText).toLowerCase();return _.nvl(this.column.cellTextForTextFilter(i)).toLowerCase().indexOf(s)>-1}filterFieldsTitle(){return this.session.text("ui.FreeText")}addFilterFields(e){this.freeTextField=u.create(Ni,{parent:e,labelVisible:!1,statusVisible:!1,maxLength:100,displayText:this.freeText,updateDisplayTextOnModify:!0}),this.freeTextField.on("acceptInput",this._onAcceptInput.bind(this)),e.addField0(this.freeTextField)}_onAcceptInput(e){let t=this.freeTextField.$field.val();this.freeText=t.trim(),h().log.isDebugEnabled()&&h().log.debug("(TextColumnUserFilter#_onAcceptInput) freeText="+this.freeText),this.triggerFilterFieldsChanged()}modifyFilterFields(){this.freeTextField.removeMandatoryIndicator()}}class Su extends Ms{_acceptFilter(e){return e instanceof vu}_acceptFilterState(e){return e instanceof ys}_toDo(e,t){return u.create(ys,{columnId:t.column.buildUuid(),selectedValues:new Set(t.selectedValues),textFilter:t.freeText})}_fromDo(e,t){const i=e.session,s=e.columnByUuid(t.columnId);return u.create(s.filterType,{session:i,table:e,column:s,selectedValues:[...t.selectedValues],freeText:t.textFilter})}}Ot.get().register(Su);class Hi extends ft{text;_cachedText;_cachedTextLowerCase;constructor(){super(),this.filterType=Hi.TYPE}static TYPE="text";createFilterAddedEventData(){let e=super.createFilterAddedEventData();return e.text=this.text,e}createLabel(){return this.text}accept(e){let t=this.table.visibleColumns().reduce((s,r)=>s+r.cellTextForTextFilter(e)+" ",""),i=u.nvl(this.text,"");return i!==this._cachedText&&(this._cachedText=i,this._cachedTextLowerCase=i.toLowerCase()),t=t.trim().toLowerCase(),t.indexOf(this._cachedTextLowerCase)>-1}}class xu extends Ms{_acceptFilter(e){return e instanceof Hi}_acceptFilterState(e){return e instanceof ur}_toDo(e,t){return u.create(ur,{text:t.text})}_fromDo(e,t){const i=e.session;return u.create(Hi,{session:i,table:e,text:t.text})}}Ot.get().register(xu);class Pu{table;init(e){h().extend(this,e)}accept(e){return!e.parentRow}createLabel(){return this.table.session.text("ui.TileView")}}class fg{acceptedKeys;keySupplier;active;alwaysAcceptedRowIds;constructor(e){this.acceptedKeys=[],this.keySupplier=e||(t=>t.lookupRow&&t.lookupRow.key),this.active=!0,this.alwaysAcceptedRowIds=[]}accept(e){if(!this.active||p.empty(this.acceptedKeys)||this.alwaysAcceptedRowIds.indexOf(e.id)!==-1)return!0;let t=this.keySupplier(e);return this.acceptedKeys.indexOf(t)!==-1}setAcceptedKeys(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.acceptedKeys=p.ensure(t)}setActive(e){this.active=e}setAlwaysAcceptedRowIds(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.alwaysAcceptedRowIds=t}}class gg{acceptedText;textSupplier;active;alwaysAcceptedRowIds;constructor(e){this.acceptedText=null,this.textSupplier=e||(t=>t.lookupRow&&t.lookupRow.text),this.active=!0,this.alwaysAcceptedRowIds=[]}accept(e){if(!this.active||_.empty(this.acceptedText)||this.alwaysAcceptedRowIds.indexOf(e.id)!==-1)return!0;let t=this.textSupplier(e);return _.empty(t)?!1:_.contains(t.toLowerCase(),this.acceptedText.toLowerCase())}setAcceptedText(e){this.acceptedText=e}setActive(e){this.active=e}setAlwaysAcceptedRowIds(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this.alwaysAcceptedRowIds=t}}class Vl{rowRole;cellRole;renderTable;renderRow;renderRowGroup;renderCell;constructor(){this.renderTable=null,this.renderRow=null,this.renderRowGroup=null,this.renderCell=null,this.rowRole=null,this.cellRole=null}}class Wl extends Vl{constructor(){super(),this.renderTable=e=>T.role(e,"grid"),this.renderRow=e=>T.role(e,"row"),this.renderRowGroup=e=>T.role(e,"rowgroup"),this.renderCell=e=>T.role(e,"gridcell"),this.rowRole="row",this.cellRole="gridcell"}}class zl extends Wl{constructor(){super(),this.renderTable=e=>T.role(e,"treegrid")}}class Fo extends Vl{constructor(){super(),this.renderTable=e=>T.role(e,"listbox"),this.renderRow=e=>T.role(e,"option"),this.renderRowGroup=e=>T.role(e,"group"),this.renderCell=e=>T.role(e,null),this.rowRole="option"}}class Ul extends I{preselectedTime;selectedTime;viewDate;resolution;constructor(){super(),this.preselectedTime=null,this.selectedTime=null,this.resolution=null}_init(e){super._init(e),this.resolution=e.timeResolution}_render(){this.$container=this.$parent.appendDiv("time-picker").toggleClass("touch-only",w.get().supportsOnlyTouch()),this.$parent.appendDiv("time-picker-separator"),this.htmlComp=x.install(this.$container,this.session),this._renderTimeSelection(),this._installScrollbars()}_renderTimeSelection(){let e,t=S.trunc(new Date),i=S.ceil(new Date,this.resolution),s=0,r,o,l=this.$parent.makeDiv("day-table");for(e=0;e<24;e++){t.setMinutes(0),s=t.getHours(),r=l.appendDiv("hour-row");let a=r.appendDiv("cell hours").data("time",new Date(t)).on("click",this._onTimeClick.bind(this));for(i.getHours()===t.getHours()&&a.addClass("now"),a.appendSpan("text").text(S.format(t,this.session.locale,"HH"));s===t.getHours();)o=r.appendDiv("cell minutes").data("time",new Date(t)).on("click",this._onTimeClick.bind(this)),o.appendSpan("text").text(S.format(t,this.session.locale,"mm")),S.isSameTime(i,t)&&o.addClass("now"),t.setMinutes(t.getMinutes()+this.resolution)}return l.appendTo(this.$container),l}_installScrollbars(e){this._uninstallScrollbars(),super._installScrollbars({axis:"y"})}_scrollTo(e){e&&(this.parent instanceof Kl?setTimeout(()=>{this.rendered&&P.scrollTo(this.$container,e,"center")}):P.scrollTo(this.$container,e,"center"))}preselectTime(e){e&&this.setSelectedTime(null),this.setPreselectedTime(e)}setPreselectedTime(e){this.setProperty("preselectedTime",e)}_renderPreselectedTime(){let e;this.$container.find(".cell").each((t,i)=>{let s=h()(i),r=s.data("time");s.removeClass("preselected"),this.preselectedTime&&(s.hasClass("hours")&&this.preselectedTime.getHours()===r.getHours()||s.hasClass("minutes")&&S.isSameTime(this.preselectedTime,r))&&(s.addClass("preselected"),e=s)}),this._scrollTo(e)}selectTime(e){e&&this.setPreselectedTime(null),this.setSelectedTime(e)}setSelectedTime(e){this.setProperty("selectedTime",e)}_renderSelectedTime(){let e;this.$container.find(".cell").each((t,i)=>{let s=h()(i),r=s.data("time");s.removeClass("selected"),this.selectedTime&&(s.hasClass("hours")&&this.selectedTime.getHours()===r.getHours()||s.hasClass("minutes")&&S.isSameTime(this.selectedTime,r))&&(s.addClass("selected"),e=s)}),this._scrollTo(e)}shiftSelectedTime(e,t,i){let s=this.preselectedTime;this.selectedTime&&(s=S.shiftTime(this.selectedTime,e,t*this.resolution,i)),s&&this.selectTime(this._snapToTimeGrid(s))}_snapToTimeGrid(e){if(!e)return e;let t=e.getMinutes();return t=parseInt(t/this.resolution+"")*this.resolution,e.setMinutes(t),e}_onTimeClick(e){let t=h()(e.currentTarget),i=new Date(t.data("time"));this.selectTime(i),this.trigger("timeSelect",{time:i})}}class Gl extends _e{picker;field;constructor(){super(),this.windowPaddingX=0,this.windowPaddingY=0,this.picker=null}_init(e){e.scrollType=e.scrollType||"layoutAndPosition",e.withFocusContext=!1,super._init(e),this.picker=u.create(Ul,{parent:this,timeResolution:e.timeResolution})}_createLayout(){return new Du(this)}_render(){this.$container=this.$parent.appendDiv("popup time-picker-popup"),this.$container.toggleClass("alternative",this.field.fieldStyle===A.FieldStyle.ALTERNATIVE),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout()),this.htmlComp.validateRoot=!0,this.findDesktop().adjustOverlayOrder(this),this.picker.render()}getTimePicker(){return this.picker}_isMouseDownOnAnchor(e){let t=e.target;return this.field.$timeField.isOrHas(t)||this.field.$timeFieldIcon.isOrHas(t)||this.field.$timeClearIcon&&this.field.$timeClearIcon.isOrHas(t)}}class Du extends xi{constructor(e){super(e),this.doubleCalcPrefSize=!1}layout(e){let t,i=this.popup.htmlComp,s=this.popup.picker.htmlComp;super.layout(e),t=i.size().subtract(i.insets()).subtract(s.margins()),s.setSize(t),this.popup.htmlComp.layouted&&this.popup.position()}preferredLayoutSize(e,t){let i,s=this.popup.htmlComp,r=this.popup.picker.htmlComp;return i=r.prefSize().add(s.insets()).add(r.margins()),i}}class Kl extends go{_init(e){super._init(e),this._field.on("acceptInput",this._onFieldAcceptInput.bind(this)),this.addCssClass("time-picker-touch-popup")}_initWidget(e){this._widget=u.create(Ul,{parent:this,timeResolution:e.timeResolution})}_render(){super._render(),this._field.$container.addClass("time")}getTimePicker(){return this._widget}_onFieldAcceptInput(e){this._touchField.setDisplayText(e.displayText),this._touchField.setErrorStatus(e.errorStatus),(e.errorStatus?e.errorStatus.containsStatus(di):!1)||this._touchField.setValue(e.value),this._touchField._triggerAcceptInput(e.whileTyping)}_acceptInput(){this._field.acceptTime(),this.close()}}class fe extends I{toggleBreadcrumbStyleEnabled;breadcrumbTogglingThreshold;autoCheckChildren;checkable;checkableStyle;displayStyle;dropType;dropMaximumSize;lazyExpandingEnabled;menus;contextMenu;menuBar;keyStrokes;multiCheck;nodes;nodesMap;nodePaddingLevelCheckable;nodePaddingLevelNotCheckable;nodePaddingLevelDiffParentHasIcon;nodePaddingLeft;nodeCheckBoxPaddingLeft;nodeControlPaddingLeft;nodePaddingLevel;scrollToSelection;scrollTopHistory;selectedNodes;prevSelectedNode;filters;textFilterEnabled;filterSupport;filteredElementsDirty;filterAnimated;rebuildSuppressed;breadcrumbFilter;dragAndDropHandler;checkedNodes;groupedNodes;visibleNodesFlat;visibleNodesMap;viewRangeRendered;viewRangeDirty;viewRangeSize;startAnimationFunc;runningAnimations;runningAnimationsFinishFunc;nodeHeight;nodeWidth;maxNodeWidth;nodeWidthDirty;requestFocusOnNodeControlMouseDown;initialTraversing;defaultMenuTypes;$data;$fillBefore;$fillAfter;_additionalContainerClasses;_renderViewportBlocked;_doubleClickSupport;_$animationWrapper;_$expandAnimationWrappers;_filterMenusHandler;_popupOpenHandler;_inSelectionPathList;_scrollDirections;_changeNodeTaskScheduled;_$mouseDownNode;constructor(){super(),this.toggleBreadcrumbStyleEnabled=!1,this.breadcrumbTogglingThreshold=null,this.autoCheckChildren=!1,this.checkable=!1,this.checkableStyle=fe.CheckableStyle.CHECKBOX_TREE_NODE,this.displayStyle=fe.DisplayStyle.DEFAULT,this.dropType=O.NONE,this.dropMaximumSize=z.DEFAULT_DROP_MAXIMUM_SIZE,this.lazyExpandingEnabled=!0,this.menus=[],this.contextMenu=null,this.menuBar=null,this.keyStrokes=[],this.multiCheck=!0,this.nodes=[],this.nodesMap={},this.nodePaddingLevelCheckable=23,this.nodePaddingLevelNotCheckable=18,this.nodePaddingLevelDiffParentHasIcon=null,this.nodePaddingLeft=null,this.nodeCheckBoxPaddingLeft=29,this.nodeControlPaddingLeft=null,this.nodePaddingLevel=this.nodePaddingLevelNotCheckable,this.scrollToSelection=!1,this.scrollTop=0,this.scrollTopHistory=[],this.selectedNodes=[],this.prevSelectedNode=null,this.filters=[],this.textFilterEnabled=!0,this.filterSupport=this._createFilterSupport(),this.filteredElementsDirty=!1,this.filterAnimated=!0,this.checkedNodes=[],this.groupedNodes={},this.visibleNodesFlat=[],this.visibleNodesMap={},this._addWidgetProperties(["menus","keyStrokes"]),this._additionalContainerClasses="",this._doubleClickSupport=new R,this._$animationWrapper=null,this._$expandAnimationWrappers=[],this._filterMenusHandler=this._filterMenus.bind(this),this._popupOpenHandler=this._onDesktopPopupOpen.bind(this),this._inSelectionPathList={},this._changeNodeTaskScheduled=!1,this.viewRangeRendered=new U(0,0),this.viewRangeSize=20,this.startAnimationFunc=(function(){this.runningAnimations++}).bind(this),this.runningAnimations=0,this.runningAnimationsFinishFunc=(function(){this.runningAnimations--,this.runningAnimations<=0&&(this.runningAnimations=0,this._renderViewportBlocked=!1,this.invalidateLayoutTree())}).bind(this),this.nodeHeight=0,this.nodeWidth=0,this.maxNodeWidth=0,this.nodeWidthDirty=!1,this.$data=null,this._scrollDirections="both",this.requestFocusOnNodeControlMouseDown=!0,this.defaultMenuTypes=[fe.MenuType.EmptySpace],this._$mouseDownNode=null}static DisplayStyle={DEFAULT:"default",BREADCRUMB:"breadcrumb"};static CheckableStyle={CHECKBOX:"checkbox",CHECKBOX_TREE_NODE:"checkbox_tree_node"};static MenuType={EmptySpace:"Tree.EmptySpace",SingleSelection:"Tree.SingleSelection",MultiSelection:"Tree.MultiSelection",Header:"Tree.Header"};static VIEW_RANGE_DIVISOR=4;_init(e){super._init(e),this.setFilters(this.filters,!1),this.addFilter(new Eu(this),!1),this.breadcrumbFilter=new Fu(this),this.displayStyle===fe.DisplayStyle.BREADCRUMB&&this.addFilter(this.breadcrumbFilter,!1),this.initialTraversing=!0,this._setCheckable(this.checkable),this.ensureTreeNodes(this.nodes),this._initNodes(this.nodes),this.initialTraversing=!1,this.menuBar=u.create(Ce,{parent:this,position:Ce.Position.BOTTOM,menuOrder:new gn(this.session,"Tree",this.defaultMenuTypes),menuFilter:this._filterMenusHandler,cssClass:"bounded"}),this._updateItemPath(!0),this._setDisplayStyle(this.displayStyle),this._setKeyStrokes(this.keyStrokes),this._setMenus(this.menus)}_initNodes(e,t){e||(e=this.nodes),fe.visitNodes(this._initTreeNode.bind(this),e,t),typeof this.selectedNodes[0]=="string"&&(this.selectedNodes=this.nodesByIds(this.selectedNodes)),this._updateSelectionPath(),e.forEach(i=>this.applyFiltersForNode(i)),fe.visitNodes((i,s)=>this._addToVisibleFlatList(i,!1),e,t)}ensureTreeNodes(e,t){if(e.length===0)return;let i=0;if(this.initialized){let s=t?t.childNodes:this.nodes;s.length>0&&(i=u.nvl(s[s.length-1].childNodeIndex,-1)+1)}for(let s=0;s<e.length;s++){let r=e[s];r.childNodeIndex=u.nvl(r.childNodeIndex,i+s),!(r instanceof Fi)&&(e[s]=this._createTreeNode(r))}}_createTreeNode(e){return e=e||{},e.objectType=u.nvl(e.objectType,Fi),e.parent=this,u.create(e)}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this._initTreeKeyStrokeContext()}_initTreeKeyStrokeContext(){let e=Ae.NONE;this.keyStrokeContext.registerKeyStrokes([new Ru(this),new jl(this,e),new ql(this,e),new Au(this,e),new Pn(this,e,m.LEFT,"←"),new Pn(this,e,m.SUBTRACT,"-"),new Yl(this,e),new Dn(this,e,m.RIGHT,"→"),new Dn(this,e,m.ADD,"+")])}setAutoCheckChildren(e){this.setProperty("autoCheckChildren",e)}_setAutoCheckChildren(e){this._setProperty("autoCheckChildren",e)}setMenus(e){this.setProperty("menus",e)}_setMenus(e){this.updateKeyStrokes(e,this.menus),this._setProperty("menus",e),this._updateMenuBar()}_updateMenuBar(){let e=this._filterMenus(this.menus,Ft.MENU_BAR,!1,!0);this.menuBar.setMenuItems(e);let t=this._filterMenus(this.menus,Ft.CONTEXT_MENU,!0);this.contextMenu&&this.contextMenu.updateMenuItems(t)}_setKeyStrokes(e){this.updateKeyStrokes(e,this.keyStrokes),this._setProperty("keyStrokes",e)}_resetTreeNode(e,t){e.reset()}isSelectedNode(e){return this.selectedNodes.indexOf(e)>-1}_updateSelectionPath(){let e=this.selectedNodes[0];if(!e)return;this._inSelectionPathList[e.id]=!0,e.childNodes.forEach(i=>{this._inSelectionPathList[i.id]=!0});let t=e.parentNode;for(;t;)this._inSelectionPathList[t.id]=!0,t=t.parentNode}_initTreeNode(e,t){this.nodesMap[e.id]=e,t&&(e.parentNode=t,e.level=e.parentNode.level+1),e.checked&&this.checkedNodes.push(e),this._initTreeNodeInternal(e,t),this._updateMarkChildrenChecked(e),e.initialized=!0}_initTreeNodeInternal(e,t){}_destroy(){super._destroy(),this.visitNodes(this._destroyTreeNode.bind(this)),this.nodes=[]}_destroyTreeNode(e){this._checkNode(e,!1,!1),delete this.nodesMap[e.id],this._removeFromFlatList(e,!1),e.destroy(),this._onNodeDeleted&&this._onNodeDeleted(e)}_onNodeDeleted(e){}visitNodes(e,t){return fe.visitNodes(e,this.nodes,t)}_render(){this.$container=this.$parent.appendDiv("tree"),T.role(this.$container,"tree"),this._additionalContainerClasses&&this.$container.addClass(this._additionalContainerClasses);let e=new xn(this);this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(e),this._renderData(),this.menuBar.render(),this.session.desktop.on("popupOpen",this._popupOpenHandler),this._renderCheckableStyle()}_renderData(){this.$data=this.$container.appendDiv("tree-data").on("contextmenu",this._onContextMenu.bind(this)).on("mousedown",".tree-node",this._onNodeMouseDown.bind(this)).on("mouseup",".tree-node",this._onNodeMouseUp.bind(this)).on("dblclick",".tree-node",this._onNodeDoubleClick.bind(this)).on("mousedown",".tree-node-control",this._onNodeControlMouseDown.bind(this)).on("mouseup",".tree-node-control",this._onNodeControlMouseUp.bind(this)).on("dblclick",".tree-node-control",this._onNodeControlDoubleClick.bind(this)),x.install(this.$data,this.session),this.isHorizontalScrollingEnabled()&&this.$data.toggleClass("scrollable-tree",!0),this._installScrollbars({axis:this._scrollDirections}),this._installNodeTooltipSupport(),this._updateNodeDimensions(),this._renderDisplayStyle(),this._renderViewport()}_renderProperties(){super._renderProperties(),this._renderTextFilterEnabled(),this._renderMultiCheck()}_postRender(){super._postRender(),this._renderSelection()}_remove(){this.session.desktop.off("popupOpen",this._popupOpenHandler),this.filterSupport.remove(),this._$animationWrapper&&this._$animationWrapper.stop(!1,!0),this.visitNodes(this._resetTreeNode.bind(this)),z.uninstallDragAndDropHandler(this),this._uninstallNodeTooltipSupport(),this.$fillBefore=null,this.$fillAfter=null,this.$data=null,this.viewRangeRendered=new U(0,0),super._remove()}isHorizontalScrollingEnabled(){return this._scrollDirections==="both"||this._scrollDirections==="x"}isTreeNodeCheckEnabled(){return this.checkableStyle===fe.CheckableStyle.CHECKBOX_TREE_NODE}_onScroll(e){let t=this.scrollToSelection;this.scrollToSelection=!1;let i=this.$data[0].scrollTop,s=this.$data[0].scrollLeft;this.scrollTop!==i&&this.rendered&&this._renderViewport(),this.scrollTop=i,this.scrollLeft=s,this.scrollToSelection=t}setScrollTop(e){this.setProperty("scrollTop",e),this.rendered&&(this._renderViewport(),this._renderScrollTop())}_renderScrollTop(){this.rendering||P.scrollTop(this.$data,this.scrollTop)}get$Scrollable(){return this.$data}_renderViewport(){if(this.runningAnimations>0||this._renderViewportBlocked||!this.$container.isEveryParentVisible())return;let e=this._calculateCurrentViewRange();this._renderViewRange(e)}_calculateCurrentViewRange(){let e,t=this.$data[0].scrollTop;return this.$data[0].scrollHeight-this.$data[0].clientHeight===0&&this.visibleNodesFlat.length>0?e=this.visibleNodesFlat[0]:e=this._nodeAtScrollTop(t),this._calculateViewRangeForNode(e)}_rerenderViewport(){this._renderViewportBlocked||(this._removeRenderedNodes(),this._renderFiller(),this._updateDomNodeWidth(),this._renderViewport())}_removeRenderedNodes(){this.$data.find(".tree-node").each((t,i)=>{let s=h()(i),r=s.data("node");s.hasClass("hiding")||this._removeNode(r)}),this.viewRangeRendered=new U(0,0)}_renderViewRangeForNode(e){let t=this._calculateViewRangeForNode(e);this._renderViewRange(t)}_renderNodesInRange(e){let t=!1,i=this.visibleNodesFlat;if(i.length===0)return;if(e=new U(0,i.length).intersect(e),this.viewRangeRendered.size()>0&&!e.intersect(this.viewRangeRendered).equals(new U(0,0)))throw new Error("New range must not intersect with existing.");e.to<=this.viewRangeRendered.from&&(t=!0);let r=this.viewRangeRendered.union(e);if(r.length===2)throw new Error("Can only prepend or append rows to the existing range. Existing: "+this.viewRangeRendered+". New: "+r);this.viewRangeRendered=r[0];let o=this.ensureRangeVisible(e);h().log.isTraceEnabled()&&h().log.trace(o+" new nodes rendered from "+e)}ensureRangeVisible(e){let t=this.visibleNodesFlat,i=[];for(let s=e.from;s<e.to;s++){let r=t[s];r.attached||i.push(r)}return this._insertNodesInDOM(i),i.length}_renderFiller(){this.$fillBefore||(this.$fillBefore=this.$data.prependDiv("tree-data-fill"));let e=this._calculateFillerDimension(new U(0,this.viewRangeRendered.from));this.$fillBefore.cssHeight(e.height),this.isHorizontalScrollingEnabled()&&(this.$fillBefore.cssWidth(e.width),this.maxNodeWidth=Math.max(e.width,this.maxNodeWidth)),h().log.isTraceEnabled()&&h().log.trace("FillBefore height: "+e.height),this.$fillAfter||(this.$fillAfter=this.$data.appendDiv("tree-data-fill"));let t={height:0,width:0};t=this._calculateFillerDimension(new U(this.viewRangeRendered.to,this.visibleNodesFlat.length)),this.$fillAfter.cssHeight(t.height),this.isHorizontalScrollingEnabled()&&(this.$fillAfter.cssWidth(t.width),this.maxNodeWidth=Math.max(t.width,this.maxNodeWidth)),h().log.isTraceEnabled()&&h().log.trace("FillAfter height: "+t.height)}_calculateFillerDimension(e){let t=0;this.rendered&&(t=this.$data.width());let i={height:0,width:Math.max(t,this.maxNodeWidth)};for(let s=e.from;s<e.to;s++){let r=this.visibleNodesFlat[s];i.height+=this._heightForNode(r),i.width=Math.max(i.width,this._widthForNode(r))}return i}_removeNodesInRange(e){let t,i=0,s=this.visibleNodesFlat;e=new U(0,s.length).intersect(e);let o=this.viewRangeRendered.subtract(e);if(o.length===2)throw new Error("Can only remove nodes at the beginning or end of the existing range. "+this.viewRangeRendered+". New: "+o);this.viewRangeRendered=o[0];for(let l=e.from;l<e.to;l++)t=s[l],this._removeNode(t),i++;h().log.isTraceEnabled()&&h().log.trace(i+" nodes removed from "+e+".")}_removeNode(e){let t=e.$node;t&&(t.hasClass("hiding")||(t.detach(),e.attached=!1))}_renderViewRange(e){if(e.from===this.viewRangeRendered.from&&e.to===this.viewRangeRendered.to&&!this.viewRangeDirty){this.nodeWidthDirty&&(this._renderFiller(),this._updateDomNodeWidth());return}if(this.viewRangeDirty)this.viewRangeRendered=e,this.ensureRangeVisible(e);else{let t=e.subtract(this.viewRangeRendered),i=this.viewRangeRendered.subtract(e),s=new U(0,this.visibleNodesFlat.length);i.forEach(r=>{this._removeNodesInRange(r),s.to<r.to&&(this.viewRangeRendered=e)}),t.forEach(r=>{this._renderNodesInRange(r)})}if(this.viewRangeRendered.size()>0){let t=this.visibleNodesFlat,i=t[this.viewRangeRendered.from],s=t[this.viewRangeRendered.to-1];if(this.viewRangeDirty){let r=i.$node.prevAll(".tree-node"),o=s.$node.nextAll(".tree-node");this._cleanupNodes(r),this._cleanupNodes(o)}if(!i.attached||!s.attached)throw new Error("Nodes not rendered as expected. "+this.viewRangeRendered+". First: "+C.debugOutput(i.$node)+". Last: "+C.debugOutput(s.$node)+". Length: visibleNodesFlat="+this.visibleNodesFlat.length+" nodes="+this.nodes.length+" nodesMap="+Object.keys(this.nodesMap).length)}this._postRenderViewRange(),this.viewRangeDirty=!1}_postRenderViewRange(){this._renderFiller(),this._updateDomNodeWidth(),this._renderSelection()}_visibleNodesInViewRange(){return this.visibleNodesFlat.slice(this.viewRangeRendered.from,this.viewRangeRendered.to)}_updateDomNodeWidth(){if(!this.isHorizontalScrollingEnabled()||!this.rendered||!this.nodeWidthDirty)return;let e=this._visibleNodesInViewRange(),t=this.maxNodeWidth;t=e.reduce((i,s)=>Math.max(s.width,i),u.nvl(t,0)),e.forEach(i=>i.$node.cssWidth(t)),this.nodeWidthDirty=!1}_cleanupNodes(e){for(let t=0;t<e.length;t++)this._removeNode(e.eq(t).data("node"))}_nodeAtScrollTop(e){let t=0,i;this.visibleNodesFlat.some((r,o)=>(t+=this._heightForNode(r),e<t?(i=r,!0):!1));let s=this.visibleNodesFlat.length;return!i&&s>0&&(i=this.visibleNodesFlat[s-1]),i}_heightForNode(e){let t=0;return e.height?t=e.height:t=this.nodeHeight,t}_widthForNode(e){let t=0;return e.width?t=e.width:t=this.nodeWidth,t}_calculateViewRangeForNode(e){let t=new U,i=Math.floor(this.viewRangeSize/fe.VIEW_RANGE_DIVISOR),s,r=this.visibleNodesFlat.indexOf(e);return t.from=Math.max(r-i,0),t.to=Math.min(t.from+this.viewRangeSize,this.visibleNodesFlat.length),!e||r===-1||(s=this.viewRangeSize-t.size(),s>0&&(t.from=Math.max(t.to-this.viewRangeSize,0))),t}calculateViewRangeSize(){if(this._updateNodeDimensions(),this.nodeHeight===0)throw new Error("Cannot calculate view range with nodeHeight = 0");let e=fe.VIEW_RANGE_DIVISOR/2,t=Math.ceil(this.$data.outerHeight()/this.nodeHeight)*e;return Math.max(fe.VIEW_RANGE_DIVISOR,t)}setViewRangeSize(e){this.viewRangeSize!==e&&(this._setProperty("viewRangeSize",e),this.rendered&&this._renderViewport())}_updateNodeDimensions(){let e=this._createTreeNode(),t=this._renderNode(e).appendTo(this.$data);if(this.nodeHeight=t.outerHeight(!0),this.isHorizontalScrollingEnabled()){let i=this.nodeWidth;this.nodeWidth=t.outerWidth(!0),i!==this.nodeWidth&&(this.viewRangeDirty=!0)}e.reset()}updateNodeHeights(){this.visibleNodesFlat.forEach(e=>{e.attached?e.height=e.$node.outerHeight(!0):e.height=null})}removeAllNodes(){this._removeNodes(this.nodes)}_removeNodes(e,t){e.length!==0&&(e.forEach(i=>{this._removeFromFlatList(i,!0),i.childNodes.length>0&&this._removeNodes(i.childNodes,i),i.$node&&(this._$animationWrapper&&this._$animationWrapper.find(i.$node).length>0&&this._$animationWrapper.stop(!1,!0),i.reset())}),p.ensure(t).forEach(i=>{i&&i.$node&&i.childNodes.length===0&&(i.$node.removeClass("expanded lazy"),T.expanded(i.$node,null))}),this.rendered&&(this.viewRangeDirty=!0,this.invalidateLayoutTree()))}_renderNode(e){let t=this._computeNodePaddingLeft(e);return e.render(this.$container,t),e.$node}_removeMenus(){}_filterMenus(e,t,i,s){return $e.filterAccordingToSelection("Tree",this.selectedNodes.length,e,t,{onlyVisible:i,enableDisableKeyStrokes:s,defaultMenuTypes:this.defaultMenuTypes})}_renderEnabled(){super._renderEnabled(),this._installOrUninstallDragAndDropHandler();let e=this.enabledComputed;this.$data.setEnabled(e),this.$container.setTabbableOrFocusable(e)}_renderDisabledStyle(){super._renderDisabledStyle(),this._renderDisabledStyleInternal(this.$data)}setCheckable(e){this.setProperty("checkable",e)}_setCheckable(e){this._setProperty("checkable",e),this._updateNodePaddingLevel()}_updateNodePaddingLevel(){this.isBreadcrumbStyleActive()?this.nodePaddingLevel=0:this.checkable?this.nodePaddingLevel=this.nodePaddingLevelCheckable:this.nodePaddingLevel=this.nodePaddingLevelNotCheckable}setCheckableStyle(e){this.setProperty("checkableStyle",e)}_renderCheckable(){let e=i=>!!i.$node,t=i=>{let s=i.$node,r=s.children(".tree-node-control"),o=s.children(".tree-node-checkbox");i._updateControl(r),this.checkable?o.length===0&&i._renderCheckbox():o.remove(),s.cssPaddingLeft(this._computeNodePaddingLeft(i)),i.childNodes&&i.childNodes.filter(e).forEach(t)};this.nodes.filter(e).forEach(t)}_renderDisplayStyle(){this.$container.toggleClass("breadcrumb",this.isBreadcrumbStyleActive()),this.nodePaddingLeft=null,this.nodeControlPaddingLeft=null;let e=b.values(this.nodesMap).filter(t=>!!t.$node).map(t=>t.$node.get(0));this._updateNodePaddingsLeft(h()(e)),this.invalidateLayoutTree()}_renderExpansion(e,t){let i={expandLazyChanged:!1,expansionChanged:!1};h().extend(i,t);let s=e.$node,r=e.expanded;!s||s.length===0||e.childNodes.length!==0&&(s.toggleClass("lazy",r&&e.expandedLazy),!(!i.expansionChanged&&!i.expandLazyChanged)&&(r?(s.addClass("expanded"),T.expanded(s,!0)):(s.removeClass("expanded"),T.expanded(s,!1))))}_renderSelection(){this.selectedNodes.length===0&&this.nodes.forEach(e=>{e.rendered&&e.$node.addClass("child-of-selected")}),this.$container.toggleClass("no-nodes-selected",this.selectedNodes.length===0),this.selectedNodes.forEach(e=>{if(!this.visibleNodesMap[e.id])return;let t=e.parentNode;for(t&&t.rendered&&t.$node.addClass("parent-of-selected");t;)t.rendered&&t.$node.addClass("ancestor-of-selected"),t=t.parentNode;e.expanded&&e.childNodes.forEach(i=>{i.rendered&&i.$node.addClass("child-of-selected")}),e.rendered&&(e.$node.select(!0),T.selected(e.$node,!0))});for(let e=this.viewRangeRendered.from;e<this.viewRangeRendered.to&&!(e>=this.visibleNodesFlat.length);e++){let t=this.visibleNodesFlat[e];t&&t.rendered&&t.$node.toggleClass("group",!!this.groupedNodes[t.id])}this._updateNodePaddingsLeft(),this._highlightPrevSelectedNode(),this.scrollToSelection&&this.revealSelection()}_renderCheckableStyle(){this.$data.toggleClass("checkable",this.isTreeNodeCheckEnabled())}_highlightPrevSelectedNode(){this.isBreadcrumbStyleActive()&&(!this.prevSelectedNode||!this.prevSelectedNode.rendered||this.prevSelectedNode.prevSelectionAnimationDone||this.prevSelectedNode.$node.hasClass("animate-prev-selected")||this.prevSelectedNode.$node.addClassForAnimation("animate-prev-selected").oneAnimationEnd(()=>{this.prevSelectedNode.prevSelectionAnimationDone=!0}))}_removeSelection(){this.selectedNodes.length===0&&this.nodes.forEach(e=>{e.rendered&&e.$node.removeClass("child-of-selected")}),this.prevSelectedNode&&this.prevSelectedNode.rendered&&this.prevSelectedNode.$node.removeClass("animate-prev-selected"),this.selectedNodes.forEach(this._removeNodeSelection,this)}_removeNodeSelection(e){e.rendered&&(e.$node.select(!1),T.selected(e.$node,null));let t=e.parentNode;for(t&&t.rendered&&t.$node.removeClass("parent-of-selected");t&&t.rendered;)t.$node.removeClass("ancestor-of-selected"),t=t.parentNode;e.expanded&&e.childNodes.forEach(i=>{i.rendered&&i.$node.removeClass("child-of-selected")})}setDropType(e){this.setProperty("dropType",e)}_renderDropType(){this._installOrUninstallDragAndDropHandler()}setDropMaximumSize(e){this.setProperty("dropMaximumSize",e)}_installOrUninstallDragAndDropHandler(){z.installOrUninstallDragAndDropHandler({target:this,doInstall:()=>this.dropType&&this.enabledComputed,selector:".tree-data,.tree-node",onDrop:e=>this.trigger("drop",e),dropType:()=>this.dropType,additionalDropProperties:e=>{let t=h()(e.currentTarget),i={nodeId:""};if(t.hasClass("tree-node")){let s=t.data("node");i.nodeId=s.id}return i}})}_updateMarkChildrenChecked(e){let t=this._checkParentsRecursive(e);e.initialized||t.removeNode(e),this._processTreeCheckNodesResult(t)}_processTreeCheckNodesResult(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.rendered&&e.getNodesForRendering().forEach(s=>{s._renderChecked(),s._renderChildrenChecked()});let i=e.getNodesForEventTrigger();this.checkable&&t&&i.length&&this.trigger("nodesChecked",{nodes:i})}_installNodeTooltipSupport(){Y.install(this.$data,{parent:this,selector:".tree-node",text:this._nodeTooltipText.bind(this),arrowPosition:50,arrowPositionUnit:"%",nativeTooltip:!w.get().isCustomEllipsisTooltipPossible(),originProducer:this._treeNodeTooltipOrigin.bind(this)})}_treeNodeTooltipOrigin(e){let t=C.offsetBounds(e),i=e.children(".text"),s=C.offset(i),r=C.prefSize(i);if(_.hasText(i.text()))t.x=s.x,t.width=r.width;else{let o=e.children(".icon");if(o.length){let l=C.offset(o),a=C.size(o),d=C.insets(o);t.x=l.x+d.left,t.width=a.width-d.horizontal()}else t.x=s.x,t.width=10}return t=P.intersectViewport(t,e.scrollParents()),t}_uninstallNodeTooltipSupport(){Y.uninstall(this.$data)}_nodeTooltipText(e){let t=e.data("node");if(t.tooltipText)return t.tooltipText;if(this._isTruncatedNodeTooltipEnabled()&&t.$text.isContentTruncated())return t.$text.text()}_isTruncatedNodeTooltipEnabled(){return!0}setDisplayStyle(e){this.displayStyle!==e&&(this._renderViewportBlocked=!0,this._setDisplayStyle(e),this.rendered&&this._renderDisplayStyle(),this._renderViewportBlocked=!1)}_setDisplayStyle(e){if(this._setProperty("displayStyle",e),this.displayStyle===fe.DisplayStyle.BREADCRUMB){if(this.selectedNodes.length>0){let t=this.selectedNodes[0];t.expanded||this.expandNode(t)}this.filterAnimated=!1,this.addFilter(this.breadcrumbFilter,!1),this.filterVisibleNodes()}else this.removeFilter(this.breadcrumbFilter),this.filterAnimated=!0;this._updateNodePaddingLevel()}_updateNodePaddingsLeft(e){(e||this.$nodes()).each((i,s)=>{let r=h()(s),o=r.data("node"),l=this._computeNodePaddingLeft(o);r.cssPaddingLeft(b.isNullOrUndefined(l)?"":l),o._updateControl(r.children(".tree-node-control"))})}setBreadcrumbStyleActive(e){e?this.setDisplayStyle(fe.DisplayStyle.BREADCRUMB):this.setDisplayStyle(fe.DisplayStyle.DEFAULT)}isNodeInBreadcrumbVisible(e){return this._inSelectionPathList[e.id]===void 0?!1:this._inSelectionPathList[e.id]}isBreadcrumbStyleActive(){return this.displayStyle===fe.DisplayStyle.BREADCRUMB}setToggleBreadcrumbStyleEnabled(e){this.setProperty("toggleBreadcrumbStyleEnabled",e)}setBreadcrumbTogglingThreshold(e){this.setProperty("breadcrumbTogglingThreshold",e)}expandNode(e,t){this.setNodeExpanded(e,!0,t)}collapseNode(e,t){this.setNodeExpanded(e,!1,t)}collapseAll(){this.rebuildSuppressed=!0,this.visitNodes(e=>this.collapseNode(e)),this.rendered&&this._rerenderViewport(),this.rebuildSuppressed=!1}setNodeExpanded(e,t,i){i=i||{};let s=i.lazy;b.isNullOrUndefined(s)&&(e.expanded===t?s=e.expandedLazy:t?s=e.lazyExpandingEnabled:s=!1);let r=u.nvl(i.renderAnimated,!0);if(this.lazyExpandingEnabled||(s=!1),this.isBreadcrumbStyleActive()&&!t&&this.selectedNodes.indexOf(e)>-1){this.setNodeExpanded(e,!0,i);return}if(i.collapseChildNodes){let l=b.valueCopy(i);l.renderExpansion=!1,e.childNodes.forEach(a=>{a.expanded&&this.collapseNode(a,l)})}let o={expansionChanged:!1,expandLazyChanged:!1};(e.expanded!==t||e.expandedLazy!==s)&&(o.expansionChanged=e.expanded!==t,o.expandLazyChanged=e.expandedLazy!==s,e.expanded=t,e.expandedLazy=s,o.expansionChanged?e.parentNode?this._rebuildParent(e.parentNode,i):e.filterAccepted?this._addToVisibleFlatList(e,!1):this._removeFromFlatList(e,!1):o.expandLazyChanged&&this.applyFiltersForNode(e,!1,r),this.groupedNodes[e.id]&&this._updateItemPath(!1,e),e.expanded?e.ensureLoadChildren().done(this._addChildrenToFlatList.bind(this,e,null,r,null,!0)):this._removeChildrenFromFlatList(e,r),this.trigger("nodeExpanded",{node:e,expanded:t,expandedLazy:s}),this.viewRangeDirty=!0),this.rendered&&u.nvl(i.renderExpansion,!0)&&this._renderExpansion(e,o),this.rendered&&this.ensureExpansionVisible(e)}setNodeExpandedRecursive(e,t,i){fe.visitNodes(s=>this.setNodeExpanded(s,t,i),e)}_rebuildParent(e,t){if(!this.rebuildSuppressed&&(e.expanded||e.expandedLazy?this._addChildrenToFlatList(e,null,!0,null,!0):this._removeChildrenFromFlatList(e,!1),this.rendered&&u.nvl(t.renderExpansion,!0))){let i={expansionChanged:!0};this._renderExpansion(e,i)}}_removeChildrenFromFlatList(e,t){if(this.visibleNodesMap[e.id]){let s=this.visibleNodesFlat.indexOf(e),r=0,o=e.level,l=[];t=t&&this.rendered,this._$animationWrapper&&this._$animationWrapper.stop(!1,!0),this._$expandAnimationWrappers.forEach(a=>a.stop(!1,!0));for(let a=s+1;a<this.visibleNodesFlat.length&&this.visibleNodesFlat[a].level>o;a++){let d=this.visibleNodesFlat[a];this.isHorizontalScrollingEnabled()&&d.width===this.maxNodeWidth&&(this.maxNodeWidth=0,this.nodeWidthDirty=!0),delete this.visibleNodesMap[this.visibleNodesFlat[a].id],d.attached&&t?(this._$animationWrapper||(this._$animationWrapper=h()('<div class="animation-wrapper">').insertBefore(d.$node),this._$animationWrapper.data("parentNode",e)),d.isDescendantOf(this._$animationWrapper.data("parentNode"))&&this._$animationWrapper.append(d.$node),d.attached=!1,d.displayBackup=d.$node.css("display"),l.push(d)):d.attached&&!t&&this.hideNode(d,!1,!1),r++}return this.visibleNodesFlat.splice(s+1,r),t&&(this._renderViewportBlocked=!0,l.length>0?this._$animationWrapper.animate({height:0},{start:this.startAnimationFunc,complete:i.bind(this,l),step:()=>this.revalidateLayoutTree(),duration:200,queue:!1}):this._$animationWrapper?(this._$animationWrapper.remove(),this._$animationWrapper=null,i.call(this,l)):this._renderViewportBlocked=!1),l}return[];function i(s){s.forEach(r=>{r.$node.detach(),r.$node.css("display",r.displayBackup),r.displayBackup=null}),this._$animationWrapper&&(this._$animationWrapper.remove(),this._$animationWrapper=null),this.runningAnimationsFinishFunc()}}_removeFromFlatList(e,t){if(this.visibleNodesMap[e.id]){let i=this.visibleNodesFlat.indexOf(e);this._removeChildrenFromFlatList(e,!1),this.isHorizontalScrollingEnabled()&&e.width===this.maxNodeWidth&&(this.maxNodeWidth=0,this.nodeWidthDirty=!0),this.visibleNodesFlat.splice(i,1),delete this.visibleNodesMap[e.id],this.hideNode(e,t)}}_addToVisibleFlatList(e,t){if(!this.visibleNodesMap[e.id]&&e.filterAccepted&&(!e.parentNode||e.parentNode.expanded&&this.visibleNodesMap[e.parentNode.id]))if(this.initialTraversing)this._addToVisibleFlatListNoCheck(e,this.visibleNodesFlat.length,t);else{let i=this._findInsertPositionInFlatList(e);this._addToVisibleFlatListNoCheck(e,i,t)}}_addChildrenToFlatList(e,t,i,s,r){if(!this.visibleNodesMap[e.id])return 0;let o=!!s;return t=t||this.visibleNodesFlat.indexOf(e),i=i&&this.rendered,this._$animationWrapper&&!o&&this._$animationWrapper.stop(!1,!0),s?s.setInsertAt(t):s=this.newInsertBatch(t+1),e.childNodes.forEach((l,a)=>{if(!l.initialized||((l.filterDirty||r)&&this.applyFiltersForNode(l,!1).newlyHidden.forEach(g=>this._removeFromFlatList(g,!1)),!l.filterAccepted))return;let d;this.visibleNodesMap[l.id]?(this.insertBatchInVisibleNodes(s,this._showNodes(s),i),this.checkAndHandleBatchAnimationWrapper(e,!1,s),s=this.newInsertBatch(s.nextBatchInsertIndex()),s=this._addChildrenToFlatListIfExpanded(1,l,d,i,s,r)):(s.insertNodes.push(l),this.visibleNodesMap[l.id]=!0,s=this.checkAndHandleBatch(s,e,i),s=this._addChildrenToFlatListIfExpanded(0,l,d,i,s,r))}),o||(this.insertBatchInVisibleNodes(s,this._showNodes(s),i),this.invalidateLayoutTree()),s}_addChildrenToFlatListIfExpanded(e,t,i,s,r,o){return t.expanded&&t.childNodes.length&&(r.containsNode(t.parentNode)||r.length()>1?i=r.insertAt():i=this._findInsertPositionInFlatList(t),i+=e,r=this._addChildrenToFlatList(t,i,s,r,o)),r}_showNodes(e){return this.viewRangeRendered.from+this.viewRangeSize>=e.lastBatchInsertIndex()&&this.viewRangeRendered.from<=e.lastBatchInsertIndex()}_findInsertPositionInFlatList(e){let t,i=e.parentNode;i?t=i.childNodes:t=this.nodes;let s=e,r=t.filter(f=>!!this.visibleNodesMap[f.id]||f===s);if(r.length===0)return this._findPositionInFlatList(i)+1;let o=r.indexOf(e);if(o===0)return this._findPositionInFlatList(i)+1;let l=r[o-1],a=this._findPositionInFlatList(l);if(a===-1)return this._findPositionInFlatList(i)+1;let d,c;for(d=a;d<this.visibleNodesFlat.length;d++)if(c=this.visibleNodesFlat[d],!this._isInSameSubTree(l,c))return d;return this.visibleNodesFlat.length}_findPositionInFlatList(e){return this.visibleNodesFlat.indexOf(e)}_isInSameSubTree(e,t){do{if(t===e||t.parentNode===e)return!0;t=t.parentNode}while(t);return!1}isChildOfSelectedNodes(e){for(;e;){if(this.selectedNodes.indexOf(e.parentNode)>-1)return!0;e=e.parentNode}return!1}newInsertBatch(e){return{insertNodes:[e,0],$animationWrapper:null,lastBatchInsertIndex:function(){return this.isEmpty()?this.insertAt():this.insertAt()+this.insertNodes.length-3},nextBatchInsertIndex:function(){return this.lastBatchInsertIndex()+(this.isEmpty()?1:2)},isEmpty:function(){return this.insertNodes.length===2},length:function(){return this.insertNodes.length-2},insertAt:function(){return this.insertNodes[0]},setInsertAt:function(t){this.insertNodes[0]=t},containsNode:function(t){return this.insertNodes.indexOf(t)!==-1}}}checkAndHandleBatchAnimationWrapper(e,t,i){if(t&&this.viewRangeRendered.from<=i.lastBatchInsertIndex()&&this.viewRangeRendered.to>=i.lastBatchInsertIndex()&&!i.$animationWrapper){let r=i.lastBatchInsertIndex()-1,o=this.viewRangeRendered.from===i.lastBatchInsertIndex()?null:this.visibleNodesFlat[r];if(o&&r>=this.viewRangeRendered.from&&r<this.viewRangeRendered.to&&!o.attached&&this.showNode(o,!1,r),o&&o.attached)i.$animationWrapper=h()('<div class="animation-wrapper">').insertAfter(o.$node);else if(e.attached)i.$animationWrapper=h()('<div class="animation-wrapper">').insertAfter(e.$node);else if(this.$fillBefore)i.$animationWrapper=h()('<div class="animation-wrapper">').insertAfter(this.$fillBefore);else{let l=this.visibleNodesFlat[i.lastBatchInsertIndex()];i.$animationWrapper=h()('<div class="animation-wrapper">').insertBefore(l.$node)}i.animationCompleteFunc=s,this._$expandAnimationWrappers.push(i.$animationWrapper)}function s(){i.$animationWrapper.replaceWith(i.$animationWrapper.contents()),p.remove(this._$expandAnimationWrappers,i.$animationWrapper),i.$animationWrapper=null,this.runningAnimationsFinishFunc()}}checkAndHandleBatch(e,t,i){return this.viewRangeRendered.from-1===e.lastBatchInsertIndex()&&(this.insertBatchInVisibleNodes(e,!1,!1),e=this.newInsertBatch(e.lastBatchInsertIndex()+1)),this.checkAndHandleBatchAnimationWrapper(t,i,e),this.viewRangeRendered.from+this.viewRangeSize-1===e.lastBatchInsertIndex()&&(this.insertBatchInVisibleNodes(e,!0,i),e=this.newInsertBatch(e.lastBatchInsertIndex()+1)),e}insertBatchInVisibleNodes(e,t,i){if(!e.isEmpty())if(this.visibleNodesFlat.splice(...e.insertNodes),t){let s=e.insertAt();for(let r=2;r<e.insertNodes.length;r++){let o=e.insertNodes[r];this.showNode(o,!1,s),e.$animationWrapper&&e.$animationWrapper.append(o.$node),s++}if(e.$animationWrapper){let r=e.$animationWrapper.outerHeight();e.$animationWrapper.css("height",0).animate({height:r},{start:this.startAnimationFunc,complete:e.animationCompleteFunc.bind(this),step:()=>this.revalidateLayoutTree(),duration:200,queue:!1})}}else e.$animationWrapper&&e.animationCompleteFunc&&e.animationCompleteFunc.call(this)}_addToVisibleFlatListNoCheck(e,t,i){p.insert(this.visibleNodesFlat,e,t),this.visibleNodesMap[e.id]=!0,this.showNode(e,i,t)}scrollTo(e,t){this.viewRangeRendered.size()!==0&&(e.attached||this._renderViewRangeForNode(e),e.attached&&P.scrollTo(this.$data,e.$node,t))}revealSelection(){if(!this.rendered){this.session.layoutValidator.schedulePostValidateFunction(this.revealSelection.bind(this));return}this.selectedNodes.length>0&&(this.visibleNodesMap[this.selectedNodes[0].id]||this._expandAllParentNodes(this.selectedNodes[0]),this.scrollTo(this.selectedNodes[0]),this.ensureExpansionVisible(this.selectedNodes[0]))}ensureExpansionVisible(e){!e||!e.$node||this.selectedNodes[0]!==e||P.ensureExpansionVisible({element:e,$element:e.$node,$scrollable:this.get$Scrollable(),isExpanded:t=>t.expanded,getChildren:t=>t.childNodes.filter(i=>i.filterAccepted),nodePaddingLevel:this.nodePaddingLevel,defaultChildHeight:this.nodeHeight})}deselectAll(){this.selectNodes([])}selectNode(e,t){this.selectNodes(e,t)}selectNodes(e,t){e=p.ensure(e),!p.equalsIgnoreOrder(e,this.selectedNodes)&&(this.rendered&&(this._rememberScrollTopBeforeSelection(),this._removeSelection()),this.prevSelectedNode&&(this.prevSelectedNode.prevSelectionAnimationDone=!1),this.prevSelectedNode=this.selectedNodes[0],this._setSelectedNodes(e,t),this.rendered&&(this._renderSelection(),this._updateScrollTopAfterSelection()))}_rememberScrollTopBeforeSelection(){this.isBreadcrumbStyleActive()?this.selectedNodes.length>0&&(this.scrollTopHistory[this.selectedNodes[0].level]=this.$data[0].scrollTop):this.scrollTopHistory=[]}_updateScrollTopAfterSelection(){if(!this.isBreadcrumbStyleActive())return;let e=-1;this.selectedNodes.length>0&&(e=this.selectedNodes[0].level),this.scrollTopHistory.splice(e+1);let t=this.scrollTopHistory[e];t>=0&&this.setScrollTop(t)}_setSelectedNodes(e,t){this.selectedNodes=e.slice(),this._nodesSelectedInternal(e),this._triggerNodesSelected(t);let i=this.selectedNode();i&&(T.linkElementWithActiveDescendant(this.$container,i.$node),this.visibleNodesMap[i.id]||(this._expandAllParentNodes(i),!this.visibleNodesMap[i.id]&&!this.isBreadcrumbStyleActive()&&this.applyFiltersForNode(i))),this._updateItemPath(!0),this.isBreadcrumbStyleActive()&&(i&&!i.expanded&&(this.expandNode(i),i.filterDirty=!0),this.filter()),this.session.onRequestsDone(this._updateMenuBar.bind(this))}_nodesSelectedInternal(e){}deselectNode(e){this.deselectNodes(e)}deselectNodes(e,t){e=p.ensure(e),t=t||{},t.collectChildren&&(e=e.concat(this._collectNodesIfDescendants(e,this.selectedNodes)));let i=this.selectedNodes.slice();p.removeAll(i,e)&&this.selectNodes(i)}isNodeSelected(e){return this.selectedNodes.indexOf(e)>-1}_computeNodePaddingLeft(e){if(this._computeNodePaddings(),this.isBreadcrumbStyleActive())return this.nodePaddingLeft;let t=this.nodePaddingLeft+this._computeNodePaddingLeftForLevel(e);return this.checkable&&(t+=this.nodeCheckBoxPaddingLeft),t}_computeNodeControlPaddingLeft(e){return this.nodeControlPaddingLeft+this._computeNodePaddingLeftForLevel(e)}_computeNodePaddingLeftForLevel(e){if(this.checkable||!this.nodePaddingLevelDiffParentHasIcon)return e.level*this.nodePaddingLevel;let t=0,i=e.parentNode;for(;i;)t+=this.nodePaddingLevel,i.iconId&&!i.childNodes[0].iconId&&(t+=this.nodePaddingLevelDiffParentHasIcon),i=i.parentNode;return t}_computeNodePaddings(){if(this.nodePaddingLeft!==null&&this.nodeControlPaddingLeft!==null&&this.nodePaddingLevelDiffParentHasIcon!==null)return;let e=this.$data.appendDiv("tree-node"),t=e.appendDiv("tree-node-control");this.nodePaddingLeft===null&&(this.nodePaddingLeft=e.cssPaddingLeft()),this.nodeControlPaddingLeft===null&&(this.nodeControlPaddingLeft=t.cssPaddingLeft()),this.nodePaddingLevelDiffParentHasIcon===null&&(this.nodePaddingLevelDiffParentHasIcon=this.$container.cssPxValue("--node-padding-level-diff-parent-has-icon")),e.remove()}_expandAllParentNodes(e){let t=e,i=[];t=e;let s=[];for(;t.parentNode;)i.push(t.parentNode),this.visibleNodesMap[t.id]||s.push(t),t=t.parentNode;for(let r=i.length-1;r>=0;r--)s.indexOf(i[r])!==-1&&this._addToVisibleFlatList(i[r],!1),i[r].expanded||this.expandNode(i[r],{renderExpansion:!1,renderAnimated:!1});this.rendered&&s.length>0&&(this._rerenderViewport(),this.invalidateLayoutTree())}_updateChildNodeIndex(e,t){if(!(!e||!e.length))for(let i=u.nvl(t,0);i<e.length;i++)e[i].childNodeIndex=i}insertNode(e,t,i){this.insertNodes([e],t,i)}insertNodes(e,t,i){let s=p.ensure(e).slice();if(s.length===0)return;b.isNullOrUndefined(i)||s.forEach(o=>{o.childNodeIndex=i++}),this.ensureTreeNodes(s,t);let r=s;if(t&&!(t instanceof Fi))throw new Error("parent has to be a tree node: "+t);if(r.sort((o,l)=>o.childNodeIndex-l.childNodeIndex),t){if(t.childNodes.length>0?(r.forEach(o=>{t.childNodes.indexOf(o)<0&&p.insert(t.childNodes,o,o.childNodeIndex)}),this._updateChildNodeIndex(t.childNodes,r[0].childNodeIndex)):r.forEach(o=>t.childNodes.push(o)),this._initNodes(r,t),this.groupedNodes[t.id]&&this._updateItemPath(!1,t),this.rendered){let o={expansionChanged:!0};this._renderExpansion(t,o),this.ensureExpansionVisible(t)}}else this.nodes.length>0?(r.forEach(o=>{this.nodes.indexOf(o)<0&&p.insert(this.nodes,o,o.childNodeIndex)}),this._updateChildNodeIndex(this.nodes,r[0].childNodeIndex)):p.pushAll(this.nodes,r),this._initNodes(r,t);this.rendered&&(this.viewRangeDirty=!0,this.invalidateLayoutTree()),this.trigger("nodesInserted",{nodes:r,parentNode:t})}updateNode(e){this.updateNodes([e])}updateNodes(e){if(e=p.ensure(e),e.length===0)return;let t=[];e.forEach(i=>{let s,r=this.nodesMap[i.id];i===r?s=!0:s=this._applyUpdatedNodeProperties(r,i),s&&(this.applyFiltersForNode(r),this._updateItemPath(!1,r.parentNode),this.rendered&&r._decorate()),t.push(r)}),this.trigger("nodesUpdated",{nodes:t})}_applyUpdatedNodeProperties(e,t){let i=!1;return e.leaf!==t.leaf&&(e.leaf=t.leaf,i=!0),e.enabled!==t.enabled&&(e.enabled=t.enabled,i=!0),e.lazyExpandingEnabled!==t.lazyExpandingEnabled&&(e.lazyExpandingEnabled=t.lazyExpandingEnabled,(!t.lazyExpandingEnabled||!this.lazyExpandingEnabled)&&(e.expandedLazy=!1),i=!0),i}deleteNode(e,t){this.deleteNodes([e],t)}deleteAllNodes(){this.deleteAllChildNodes()}deleteNodes(e,t){let i=[],s=[],r=[];e=p.ensure(e).slice(),e.length!==0&&(e.forEach(o=>{let l=t||o.parentNode;if(l){if(o.parentNode!==l)throw new Error("Unexpected parent. Node.parent: "+o.parentNode+", parentNode: "+t);p.remove(l.childNodes,o),s.indexOf(l)===-1&&s.push(l)}else p.remove(this.nodes,o),r=this.nodes;this._destroyTreeNode(o),i.push(o),this._updateMarkChildrenChecked(o),fe.visitNodes(this._destroyTreeNode.bind(this),o.childNodes)}),s.forEach(o=>this._updateChildNodeIndex(o.childNodes)),this._updateChildNodeIndex(r),this.deselectNodes(i,{collectChildren:!0}),this.uncheckNodes(i,{collectChildren:!0}),this.rendered&&this._removeNodes(i,t||s),this.trigger("nodesDeleted",{nodes:e,parentNode:t}))}_collectNodesIfDescendants(e,t){let i=[];return t.forEach(s=>{e.some(r=>r.isAncestorOf(s))&&i.push(s)}),i}deleteAllChildNodes(e){let t;e?(t=e.childNodes,e.childNodes=[]):(t=this.nodes,this.nodes=[]),fe.visitNodes(i.bind(this),t),this.deselectNodes(t,{collectChildren:!0}),this.uncheckNodes(t,{collectChildren:!0}),this.rendered&&this._removeNodes(t,e),this.trigger("allChildNodesDeleted",{parentNode:e});function i(s){this._destroyTreeNode(s),this._updateMarkChildrenChecked(s)}}updateNodeOrder(e,t){if(e=p.ensure(e),this._updateChildNodeIndex(e),t){if(t.childNodes.length!==e.length)throw new Error("Node order may not be updated because lengths of the arrays differ.");t.childNodes=e.slice(),this._removeChildrenFromFlatList(t,!1),t.expanded&&this._addChildrenToFlatList(t,null,!1)}else{if(this.nodes.length!==e.length)throw new Error("Node order may not be updated because lengths of the arrays differ.");this.nodes=e.slice(),this.nodes.forEach(i=>{this._removeFromFlatList(i,!1),this._addToVisibleFlatList(i,!1),i.expanded&&this._addChildrenToFlatList(i,null,!1)})}this.trigger("childNodeOrderChanged",{parentNode:t})}checkNode(e,t,i){let s=h().extend(i,{checked:t});this.checkNodes([e],s)}checkNodes(e,t){if(e=p.ensure(e).filter(r=>!!r),!e.length)return;let i={checked:!0,checkOnlyEnabled:!0,checkChildren:this.autoCheckChildren,triggerNodesChecked:!0};if(h().extend(i,t),!this.checkable||!this.enabledComputed&&i.checkOnlyEnabled)return;let s=new Ir;if(e=p.ensure(e).filter(r=>!!r),!this.multiCheck){let r=this._uncheckAll();s.add(r),i.checkChildren&&(e=[])}e.forEach(r=>{let o=this._checkNode(r,i.checked,i.checkOnlyEnabled);if(s.add(o),i.checkChildren&&this.multiCheck){let a=this._checkChildrenRecursive(r,i);s.add(a)}let l=this._checkParentsRecursive(r,!0);s.add(l)}),this._processTreeCheckNodesResult(s,i.triggerNodesChecked)}_checkChildrenRecursive(e,t){let i=new Ir,s=!this._isNodeEditable(e,t.checkOnlyEnabled);if(e.childNodes.forEach(r=>{let o=this._checkNode(r,t.checked,t.checkOnlyEnabled);i.add(o);let l=this._isNodeEditable(r,t.checkOnlyEnabled);r.childrenChecked&&l&&(r.childrenChecked=!1,i.addNodeForRendering(r)),i.add(this._checkChildrenRecursive(r,t)),l||(s=!0)}),s){let r=this._checkParentsRecursive(e);i.add(r)}return i}_checkParentsRecursive(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=new Ir,s=this.autoCheckChildren,r=e.childNodes,o=r.length,l=r.filter(d=>d.checked||d.childrenChecked).length,a=r.filter(d=>d.checked&&!d.childrenChecked).length;if(o===0)return e.parentNode?this._checkParentsRecursive(e.parentNode):i;if(l===0&&e.childrenChecked&&(e.childrenChecked=!1,i.addNodeForRendering(e)),s&&l===0){let d=this._checkNode(e,!1,!1);i.add(d)}if(l>0&&!e.childrenChecked&&!(s&&a===o)&&(e.childrenChecked=!0,i.addNodeForRendering(e),s)){let d=this._checkNode(e,!1,!1);i.add(d)}if(a===o&&s){let d=this._checkNode(e,!0,!1);i.add(d),e.childrenChecked&&(e.childrenChecked=!1,i.addNodeForRendering(e))}if((i.getNodesForRendering().length>0||t)&&e.parentNode){let d=this._checkParentsRecursive(e.parentNode);i.add(d)}return i}_checkNode(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=new Ir;return e.checked===t||!this._isNodeEditable(e,i)||(e.checked=t,s.addNodeForRenderingAndEventTrigger(e),t?this.checkedNodes.push(e):p.remove(this.checkedNodes,e)),s}_uncheckAll(){let e=new Ir,t=[...this.checkedNodes];for(let i=0;i<t.length;i++){let s=t[i];s.checked=!1,s.childrenChecked=!1,e.add(this._checkParentsRecursive(s)),e.addNodeForRenderingAndEventTrigger(s)}return this.checkedNodes=[],e}_isNodeEditable(e){return((arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?e.enabled:!0)&&e.filterAccepted}uncheckNode(e,t){let i=h().extend({checkOnlyEnabled:!0},t);this.uncheckNodes([e],i)}uncheckNodes(e,t){let i={checked:!1,collectChildren:!1};h().extend(i,t),i.collectChildren&&(e=e.concat(this._collectNodesIfDescendants(e,this.checkedNodes))),this.checkNodes(e,i)}_triggerNodesSelected(e){this.trigger("nodesSelected",{debounce:e})}_showContextMenu(e){let t=function(i){if(!this.rendered)return;let s=this._filterMenus(this.menus,Ft.CONTEXT_MENU,!0),r=h()(i.currentTarget);s.length!==0&&(this.contextMenu&&this.contextMenu.close(),this.contextMenu=u.create(bt,{parent:this,menuItems:s,location:{x:i.pageX,y:i.pageY},$anchor:r,menuFilter:this._filterMenusHandler}),this.contextMenu.open())};this.session.onRequestsDone(t.bind(this),e)}_onNodeMouseDown(e){if(this._doubleClickSupport.mousedown(e),this._doubleClickSupport.doubleClicked())return!1;let t=h()(e.currentTarget),i=t.data("node");if(this.hasNode(i))return this._$mouseDownNode=t,t.window().one("mouseup",()=>{this._$mouseDownNode=null}),this.selectNodes(i),this.checkable&&i.enabled&&this._isCheckboxClicked(e)&&(w.get().loosesFocusIfPseudoElementIsRemoved()&&this.focusAndPreventDefault(e),this.checkNode(i,!i.checked)),!0}_onNodeMouseUp(e){if(this._doubleClickSupport.doubleClicked())return!1;let t=h()(e.currentTarget),i=t.data("node");if(!(!this._$mouseDownNode||this._$mouseDownNode[0]!==t[0]))return this.trigger("nodeClick",{node:i}),!0}_isCheckboxClicked(e){return this.isTreeNodeCheckEnabled()?!0:h()(e.target).is(".check-box")}_updateItemPath(e,t){let i,s,r;if(e&&(this.groupedNodes={},this._inSelectionPathList={}),!t){if(i=this.selectedNodes,i.length===0)return;for(s=i[0],e&&(this._inSelectionPathList[s.id]=!0,s.childNodes&&s.childNodes.forEach(l=>{this._inSelectionPathList[l.id]=!0})),r=s.level;s.parentNode;){let l=s.parentNode;if(this._isGroupingEnd(l)&&!t&&(t=s,!e))break;e&&(this._inSelectionPathList[l.id]=!0),s=l}t=t||i[0],this.groupedNodes[t.id]=!0}s=t,s&&s.expanded&&this.groupedNodes[s.id]&&o.call(this,s.childNodes);function o(l){l.forEach(a=>{this.groupedNodes[a.id]=!0,a._decorate(),a.filterDirty&&this.applyFiltersForNode(a),a.expanded&&a.filterAccepted&&o.call(this,a.childNodes)})}}_isGroupingEnd(e){return!1}selectedNode(){return this.selectedNodes.length===0?null:this.selectedNodes[0]}$selectedNodes(){return this.$data.find(".selected")}$nodes(){return this.$data.find(".tree-node")}addFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.addFilter(e,t)}removeFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.removeFilter(e,t)}setFilters(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.setFilters(e,t)}filter(){this.filterSupport.filter()}_filter(){let e=[],t=[];return this.nodes.forEach(i=>{let s=this.applyFiltersForNode(i,!1,this.filterAnimated);e.push(...s.newlyHidden),t.push(...s.newlyShown)}),{newlyHidden:e,newlyShown:t}}updateFilteredElements(e,t){this.filteredElementsDirty&&(t.textFilterText&&this.nodesByIds(Object.keys(this.nodesMap)).filter(i=>i.filterAccepted).forEach(i=>this._expandAllParentNodes(i)),e.newlyShown.forEach(i=>this._addToVisibleFlatList(i,this.filterAnimated)),e.newlyHidden.forEach(i=>this._removeFromFlatList(i,this.filterAnimated)),this.filteredElementsDirty=!1)}filterVisibleNodes(e){let t=[];for(let i=this.visibleNodesFlat.length-1;i>=0;i--){let s=this.visibleNodesFlat[i],r=this._applyFiltersForNodeRec(s,!0,e);r.newlyHidden.length&&(s.filterAccepted||t.push(...r.newlyHidden),this.viewRangeDirty=!0)}t.forEach(i=>this._removeFromFlatList(i,e)),this._nodesFiltered(t)}_nodesFiltered(e){this.deselectNodes(e)}applyFiltersForNode(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=this._applyFiltersForNodeRec(e,!0,i),r=e.parentNode;for(;r;){let o=this._applyFiltersForNodeRec(r,!1,i);s.newlyHidden.unshift(...o.newlyHidden),s.newlyShown.unshift(...o.newlyShown),r=r.parentNode}return this._nodesFiltered(s.newlyHidden),t&&(s.newlyShown.forEach(o=>this._addToVisibleFlatList(o,i)),s.newlyHidden.forEach(o=>this._removeFromFlatList(o,i))),s}_applyFiltersForNodeRec(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=[],r=[];i=i&&this.filterAnimated;let o=this._applyFiltersForNode(e),l=!1;return e.level<32&&(t?e.childNodes.forEach(a=>{let d=this._applyFiltersForNodeRec(a,!0,i);s.push(...d.newlyHidden),r.push(...d.newlyShown),l=l||a.filterAccepted}):e.filterAccepted||(l=e.childNodes.some(a=>a.filterAccepted))),!e.filterAccepted&&l&&(e.setFilterAccepted(!0),o=!o),o&&((e.filterAccepted?r:s).unshift(e),this.rendered&&(this.viewRangeDirty=!0)),{newlyHidden:s,newlyShown:r}}_applyFiltersForNode(e){let t=this.filterSupport.applyFiltersForElement(e);return(t||e.filterDirty)&&(e.filterDirty=!1,e.childNodes.forEach(i=>{i.filterDirty=!0})),t}_createFilterSupport(){return new Ti({widget:this,$container:()=>this.$container,filterElements:this._filter.bind(this),getElementText:e=>e.text})}setTextFilterEnabled(e){this.setProperty("textFilterEnabled",e)}isTextFilterFieldVisible(){return this.textFilterEnabled}_renderTextFilterEnabled(){this.filterSupport.renderFilterField()}_renderMultiCheck(){T.multiselectable(this.$container,this.multiCheck||null)}_insertNodesInDOM(e,t){!this.rendered&&!this.rendering||(e=e.filter(i=>{let s=t===void 0?this.visibleNodesFlat.indexOf(i):t;return s===-1||!(this.viewRangeRendered.from+this.viewRangeSize>=s&&this.viewRangeRendered.from<=s&&this.viewRangeSize>0)||i.attached?!1:(i.rendered||this._renderNode(i),i._decorate(),this._insertNodeInDOMAtPlace(i,s),this.prevSelectedNode===i&&this._highlightPrevSelectedNode(),i.rendered=!0,i.attached=!0,!0)}),this._installNodes(e))}_installNodes(e){this.isHorizontalScrollingEnabled()&&e.forEach(t=>{t.$node.css("width","auto"),t.$node.css("display","inline-block")}),e.forEach(t=>{if(t.height=t.$node.outerHeight(!0),!this.isHorizontalScrollingEnabled())return;let i=t.$node.outerWidth(),s=t.width?t.width:0;s===this.maxNodeWidth&&i<this.maxNodeWidth?(this.maxNodeWidth=0,this.nodeWidthDirty=!0):i>this.maxNodeWidth?(this.maxNodeWidth=i,this.nodeWidthDirty=!0):i===s&&i===0&&(this.nodeWidthDirty=!0),t.width=i}),this.isHorizontalScrollingEnabled()&&e.forEach(t=>{this.nodeWidthDirty||t.$node.css("width",this.maxNodeWidth),t.$node.css("display","")})}_ensureNodeInDOM(e,t,i){e&&!e.attached&&e===this.visibleNodesFlat[i]&&i>=this.viewRangeRendered.from&&i<this.viewRangeRendered.to&&this.showNode(e,t,i)}_insertNodeInDOMAtPlace(e,t){let i=e.$node;if(t===0){this.$fillBefore?i.insertAfter(this.$fillBefore):this.$data.prepend(i);return}let s=this.visibleNodesFlat[t-1];if(this._ensureNodeInDOM(s,!1,t-1),s.attached){i.insertAfter(s.$node);return}if(t+1<this.visibleNodesFlat.length){let r=this.visibleNodesFlat[t+1];if(r.attached){i.insertBefore(r.$node);return}}this.$fillBefore?i.insertAfter(this.$fillBefore):this.$data.prepend(i)}showNode(e,t,i){if(!this.rendered||e.attached&&!e.$node.hasClass("hiding")||(e.attached||(this._ensureNodeInDOM(e.parentNode,t,i-1),this._insertNodesInDOM([e],i)),!e.rendered))return;let s=e.$node;if(s.is(".showing"))return;s.removeClass("hiding");let r=this;t&&(s.addClass("showing"),s.hide(),s.stop(!1,!0).slideDown({duration:250,start:r.startAnimationFunc,complete:()=>{r.runningAnimationsFinishFunc(),s.removeClass("showing")}}))}hideNode(e,t,i){if(!this.rendered||!e.attached)return;this.viewRangeDirty=!0;let s=this,r=e.$node;r&&(r.is(".hiding")||(r.removeClass("showing"),t?(r.addClass("hiding"),this._renderViewportBlocked=!0,r.stop(!1,!0).slideUp({duration:250,start:s.startAnimationFunc,complete:()=>{s.runningAnimationsFinishFunc(),r.removeClass("hiding"),r.hasClass("showing")||(r.css("display",""),r.detach(),e.attached=!1)}})):i||(r.detach(),e.attached=!1,s.invalidateLayoutTree())))}nodesToIds(e){return e.map(t=>t.id)}nodesByIds(e){return e.map(t=>this.nodesMap[t])}nodeById(e){return this.nodesMap[e]}hasNode(e){return!!this.nodeById(e.id)}_onNodeDoubleClick(e){if(this.isBreadcrumbStyleActive())return;let t=h()(e.currentTarget),i=t.data("node"),s=!t.hasClass("expanded");this.doNodeAction(i,s)}doNodeAction(e,t){this.trigger("nodeAction",{node:e}),this.checkable===!0&&this.isTreeNodeCheckEnabled()&&e.enabled||this.setNodeExpanded(e,t,{lazy:!1})}_onNodeControlMouseDown(e){if(this._doubleClickSupport.mousedown(e),this._doubleClickSupport.doubleClicked())return!1;let t=h()(e.currentTarget).parent(),i=t.data("node"),s=!t.hasClass("expanded"),r={lazy:!1};if(t.hasClass("lazy"))if(e.ctrlKey||e.shiftKey)s=!1,r.collapseChildNodes=!0;else return this.expandNode(i,r),!1;return this.requestFocusOnNodeControlMouseDown&&this.focus(),this.selectNodes(i),this.setNodeExpanded(i,s,r),h().suppressEvent(e),!0}_onNodeControlMouseUp(e){return!1}_onNodeControlDoubleClick(e){return!1}_onContextMenu(e){e.preventDefault(),this._showContextMenu(e)}changeNode(e){this.applyFiltersForNode(e),this.rendered&&(e._decorate(),this.nodePaddingLevelDiffParentHasIcon&&this.visibleNodesMap[e.id]&&(e.expanded||e.parentNode)&&!this._changeNodeTaskScheduled&&(queueMicrotask(()=>{this._changeNodeTaskScheduled=!1,this.rendered&&this._updateNodePaddingsLeft()}),this._changeNodeTaskScheduled=!0)),this.trigger("nodeChanged",{node:e})}_onDesktopPopupOpen(e){let t=e.popup;this.isFocusable(!1)&&this.has(t)&&t instanceof bt&&(this.$container.addClass("focused"),t.one("destroy",()=>{this.rendered&&this.$container.removeClass("focused")}))}updateScrollbars(){P.update(this.$data)}static collectSubtree(e,t){if(!e)return h()();let i=parseFloat(e.attr("data-level")),s=e.next();for(;s.length>0;){let o=parseFloat(s.attr("data-level"));if(isNaN(o)||o<=i)break;s=s.next()}let r=e.nextUntil(s);return(t===void 0||t)&&(r=r.add(e)),r}static visitNodes(e,t,i){let s,r;if(t)for(s=0;s<t.length;s++)r=t[s],!e(r,i)&&r.childNodes.length>0&&fe.visitNodes(e,r.childNodes,r)}}class or extends K{constructor(){super(),this._addRemoteProperties(["displayStyle"])}_postCreateWidget(){super._postCreateWidget(),this._autoCheckChildNodes()}_autoCheckChildNodes(){this.widget.autoCheckChildren&&fe.visitNodes((e,t)=>{if(e.checked)return this.widget.checkNodes(e,{checked:!0}),!0},this.widget.nodes,null)}_sendNodesSelected(e,t){let i={nodeIds:e};this._send("nodesSelected",i,{delay:t?250:0,coalesce:function(s){return this.target===s.target&&this.type===s.type}})}_onWidgetNodeClick(e){this._send("nodeClick",{nodeId:e.node.id})}_onWidgetNodeAction(e){this._send("nodeAction",{nodeId:e.node.id})}_onWidgetNodesSelected(e){let t=this.widget.nodesToIds(this.widget.selectedNodes);this._sendNodesSelected(t,e.debounce)}_onWidgetNodeExpanded(e){this._send("nodeExpanded",{nodeId:e.node.id,expanded:e.expanded,expandedLazy:e.expandedLazy})}_onWidgetNodesChecked(e){this._sendNodesChecked(e.nodes)}_sendNodesChecked(e){let t={nodes:[]};for(let i=0;i<e.length;i++)t.nodes.push({nodeId:e[i].id,checked:e[i].checked});this._send("nodesChecked",t)}_onWidgetEvent(e){e.type==="nodesSelected"?this._onWidgetNodesSelected(e):e.type==="nodeClick"?this._onWidgetNodeClick(e):e.type==="nodeAction"?this._onWidgetNodeAction(e):e.type==="nodeExpanded"?this._onWidgetNodeExpanded(e):e.type==="nodesChecked"?this._onWidgetNodesChecked(e):e.type==="drop"&&this.widget.dragAndDropHandler?this.widget.dragAndDropHandler.uploadFiles(e):super._onWidgetEvent(e)}onModelAction(e){e.type==="nodesInserted"?this._onNodesInserted(e.nodes,e.commonParentNodeId):e.type==="nodesUpdated"?this._onNodesUpdated(e.nodes):e.type==="nodesDeleted"?this._onNodesDeleted(e.nodeIds,e.commonParentNodeId):e.type==="allChildNodesDeleted"?this._onAllChildNodesDeleted(e.commonParentNodeId):e.type==="nodesSelected"?this._onNodesSelected(e.nodeIds):e.type==="nodeExpanded"?this._onNodeExpanded(e.nodeId,e):e.type==="nodeChanged"?this._onNodeChanged(e.nodeId,e):e.type==="nodesChecked"?this._onNodesChecked(e.nodes):e.type==="childNodeOrderChanged"?this._onChildNodeOrderChanged(e.childNodeIds,e.parentNodeId):e.type==="requestFocus"?this._onRequestFocus():e.type==="scrollToSelection"?this._onScrollToSelection():super.onModelAction(e)}_onNodesInserted(e,t){let i;if(t!=null&&(i=this.widget.nodesMap[t],!i))throw new Error("Parent node could not be found. Id: "+t);this.widget.insertNodes(e,i)}_onNodesUpdated(e){this.widget.updateNodes(e)}_onNodesDeleted(e,t){let i;if(t!=null&&(i=this.widget.nodesMap[t],!i))throw new Error("Parent node could not be found. Id: "+t);this.addFilterForWidgetEventType("nodesSelected"),this.addFilterForWidgetEventType("nodesChecked");let s=this.widget.nodesByIds(e);this.widget.deleteNodes(s,i)}_onAllChildNodesDeleted(e){let t;if(e!=null&&(t=this.widget.nodesMap[e],!t))throw new Error("Parent node could not be found. Id: "+e);this.addFilterForWidgetEventType("nodesSelected"),this.addFilterForWidgetEventType("nodesChecked"),this.widget.deleteAllChildNodes(t)}_onNodesSelected(e){this.addFilterForWidgetEvent(i=>i.type==="nodesSelected"&&p.equals(e,this.widget.nodesToIds(this.widget.selectedNodes)));let t=this.widget.nodesByIds(e);this.widget.selectNodes(t)}_onNodeExpanded(e,t){let i=this.widget.nodesMap[e],s={lazy:t.expandedLazy},r=b.createMap();r[e]=!0,t.recursive&&fe.visitNodes(o=>{r[o.id]=!0},i.childNodes),this.addFilterForWidgetEvent(o=>o.type==="nodeExpanded"&&r[o.node.id]&&t.expanded===o.expanded&&t.expandedLazy===o.expandedLazy),this.widget.setNodeExpanded(i,t.expanded,s),t.recursive&&this.widget.setNodeExpandedRecursive(i.childNodes,t.expanded,s)}_onNodeChanged(e,t){let i=this.widget.nodesMap[e];Be.applyTo(t,"TreeNode"),i.text=t.text,i.cssClass=t.cssClass,i.iconId=t.iconId,i.tooltipText=t.tooltipText,i.foregroundColor=t.foregroundColor,i.backgroundColor=t.backgroundColor,i.font=t.font,i.htmlEnabled=t.htmlEnabled,this.widget.changeNode(i)}_onNodesChecked(e){let t=[],i=[];e.forEach(s=>{let r=this.widget.nodeById(s.id);s.checked?t.push(r):i.push(r)}),this.widget.checkNodes(t,{checked:!0,checkOnlyEnabled:!1}),this.widget.uncheckNodes(i,{checkOnlyEnabled:!1})}_onChildNodeOrderChanged(e,t){let i=this.widget.nodeById(t),s=this.widget.nodesByIds(e);this.widget.updateNodeOrder(s,i)}_onRequestFocus(){this.widget.focus()}_onScrollToSelection(){this.widget.revealSelection()}_initNodeModel(e){return e=e||{},e.objectType=u.nvl(e.objectType,this._getDefaultNodeObjectType()),Be.applyTo(e),e}_getDefaultNodeObjectType(){return"TreeNode"}static _updateMarkChildrenCheckedRemote(e){if(!(this.modelAdapter&&this.autoCheckChildren&&!this.initialized))return this._updateMarkChildrenCheckedOrig(e)}static _createTreeNodeRemote(e){return this.modelAdapter&&(e=this.modelAdapter._initNodeModel(e)),this._createTreeNodeOrig(e)}static modifyTreePrototype(){G.get().remote&&(b.replacePrototypeFunction(fe,"_createTreeNode",or._createTreeNodeRemote,!0),b.replacePrototypeFunction(fe,"_updateMarkChildrenChecked",or._updateMarkChildrenCheckedRemote,!0))}}G.addListener("bootstrap",or.modifyTreePrototype);var C_=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let Fi=class{objectType;checked;childNodes;cssClass;enabled;expanded;expandedLazy;htmlEnabled;iconId;id;initialExpanded;lazyExpandingEnabled;leaf;level;parent;parentNode;session;text;tooltipText;foregroundColor;backgroundColor;font;initialized;rendered;attached;destroyed;filterAccepted;filterDirty;childrenLoaded;childrenChecked;height;width;displayBackup;prevSelectionAnimationDone;$node;$text;childNodeIndex;_loadChildrenPromise;constructor(){this.$node=null,this.$text=null,this.attached=!1,this.checked=!1,this.childNodes=[],this.childrenLoaded=!1,this.childrenChecked=!1,this.cssClass=null,this.destroyed=!1,this.enabled=!0,this.expanded=!1,this.expandedLazy=!1,this.filterAccepted=!0,this.filterDirty=!1,this.htmlEnabled=!1,this.iconId=null,this.id=null,this.initialized=!1,this.initialExpanded=!1,this.lazyExpandingEnabled=!1,this.leaf=!1,this.level=0,this.parent=null,this.parentNode=void 0,this.prevSelectionAnimationDone=!1,this.rendered=!1,this.session=null,this.text=null,this._loadChildrenPromise=null}init(e){let t=this._jsonModel();t&&(e=h().extend({},t,e)),this._init(e),e.initialExpanded===void 0&&(this.initialExpanded=this.expanded)}destroy(){this.destroyed||(this._destroy(),this.destroyed=!0)}_destroy(){}getTree(){return this.tree}get tree(){return this.parent}_init(e){u.assertParameter("parent",e.parent,fe),this.session=e.session||e.parent.session,h().extend(this,e),this._resolveTextKeys(["text"]),this._resolveIconIds(["iconId"]),this.hasChildNodes()&&this.tree.ensureTreeNodes(this.childNodes,this)}_resolveTextKeys(e){de.resolveTextProperties(this,e)}_resolveIconIds(e){q.resolveIconProperties(this,e)}_jsonModel(){return null}reset(){this.$node&&(this.$node.remove(),this.$node=null),this.rendered=!1,this.attached=!1}hasChildNodes(){return this.childNodes.length>0}isAncestorOf(e){for(;e;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}isDescendantOf(e){return e===this.parentNode?!0:this.parentNode?this.parentNode.isDescendantOf(e):!1}setFilterAccepted(e){this.filterAccepted=e}loadChildren(){return h().resolvedPromise()}ensureLoadChildren(){if(this.childrenLoaded)return h().resolvedPromise();if(this._loadChildrenPromise)return this._loadChildrenPromise;let e=this.loadChildren();return e.state()==="resolved"?(this._loadChildrenPromise=null,e):(this._loadChildrenPromise=e,e.then(this._onLoadChildrenDone.bind(this)),e)}_onLoadChildrenDone(){this._loadChildrenPromise=null}render(e,t){this.$node=e.makeDiv("tree-node").data("node",this).attr("data-nodeid",this.id).attr("data-level",this.level),T.role(this.$node,"treeitem"),T.level(this.$node,this.level+1),b.isNullOrUndefined(t)||this.$node.cssPaddingLeft(t),this.$text=this.$node.appendSpan("text"),this._renderControl(),this.tree.checkable&&this._renderCheckbox(),this._renderText(),this._renderIcon()}setText(e){this.text=e}_renderText(){this.htmlEnabled?this.$text.html(this.text):this.$text.textOrNbsp(this.text)}setChecked(e){this.checked=e}_renderChecked(){this.rendered&&(this.$node.children(".tree-node-checkbox").children(".check-box").toggleClass("checked",this.checked),T.checked(this.$node,this.checked))}setIconId(e){this.iconId=e}_renderIcon(){this.$node.toggleClass("has-icon",!!this.iconId),this.$node.icon(this.iconId,e=>e.insertBefore(this.$text))}$icon(){return this.$node.children(".icon")}_renderControl(){let e=this.$node.prependDiv("tree-node-control");this._updateControl(e)}_updateControl(e){let t=this.tree;e.toggleClass("checkable",t.checkable),e.cssPaddingLeft(t._computeNodeControlPaddingLeft(this)),e.setVisible(!this.leaf)}_renderCheckbox(){let t=this.$node.prependDiv("tree-node-checkbox").appendDiv("check-box").toggleClass("checked",this.checked).toggleClass("disabled",!this.enabled);T.role(t,"checkbox"),T.checked(t,this.checked),T.checked(this.$node,this.checked),t.toggleClass("children-checked",!!this.childrenChecked),this._renderChildrenChecked()}_renderChildrenChecked(){this.$node&&this.$node.children(".tree-node-checkbox").children(".check-box").toggleClass("children-checked",!!this.childrenChecked)}_decorate(){if(!this.$node)return;let e=this.$node,t=this.tree;e.attr("class",this._preserveCssClasses(e)),e.addClass(this.cssClass),e.toggleClass("leaf",!!this.leaf),e.toggleClass("expanded",!!this.expanded&&this.childNodes.length>0),e.toggleClass("lazy",e.hasClass("expanded")&&this.expandedLazy),e.toggleClass("group",!!t.groupedNodes[this.id]),e.setEnabled(!!this.enabled),e.children(".tree-node-control").setVisible(!this.leaf),e.children(".tree-node-checkbox").children(".check-box").toggleClass("disabled",!this.enabled),T.disabled(e,e.hasClass("disabled")||null),T.expanded(e,e.hasClass("leaf")?null:e.hasClass("expanded")),(!this.parentNode&&t.selectedNodes.length===0||t.isChildOfSelectedNodes(this))&&e.addClass("child-of-selected"),this.parentNode&&(T.posinset(e,this.childNodeIndex+1),T.setsize(e,this.parentNode.childNodes.length)),this._renderText(),this._renderIcon(),L.legacyStyle(this._getStyles(),e),this.parentNode&&this.parentNode.expandedLazy&&!this.parentNode.childNodes.some(s=>!!t.visibleNodesMap[s.id])&&this.parentNode.$node&&this.parentNode.$node.removeClass("lazy")}_getStyles(){return this}_preserveCssClasses(e){let t="tree-node";return e.isSelected()&&(t+=" selected"),e.hasClass("ancestor-of-selected")&&(t+=" ancestor-of-selected"),e.hasClass("parent-of-selected")&&(t+=" parent-of-selected"),t}setCssClass(e){this.cssClass=e}setEnabled(e){this.enabled=e}setExpanded(e){this.expanded=e}setExpandedLazy(e){this.expandedLazy=e}setLazyExpandingEnabled(e){this.lazyExpandingEnabled=e}setInitialExpanded(e){this.initialExpanded=e}setLeaf(e){this.leaf=e}setLevel(e){this.level=e}setHtmlEnabled(e){this.htmlEnabled=e}setParentNode(e){this.parentNode=e}setTooltipText(e){this.tooltipText=e}setBackgroundColor(e){this.backgroundColor=e}setForegroundColor(e){this.foregroundColor=e}setFont(e){this.font=e}};Fi=C_([Ke({ensureId:!0})],Fi);class Ir{_requireRenderTreeNodes;_requireTriggerEventNodes;constructor(){this._requireRenderTreeNodes=[],this._requireTriggerEventNodes=[]}addNodeForRendering(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];p.removeAll(t,this._requireRenderTreeNodes),this._requireRenderTreeNodes.push(...t)}addNodeForEventTrigger(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];p.removeAll(t,this._requireTriggerEventNodes),this._requireTriggerEventNodes.push(...t)}addNodeForRenderingAndEventTrigger(){this.addNodeForRendering(...arguments),this.addNodeForEventTrigger(...arguments)}getNodesForRendering(){return this._requireRenderTreeNodes}getNodesForEventTrigger(){return this._requireTriggerEventNodes}removeNode(e){p.remove(this._requireRenderTreeNodes,e),p.remove(this._requireTriggerEventNodes,e)}add(e){this.addNodeForRendering(...e.getNodesForRendering()),this.addNodeForEventTrigger(...e.getNodesForEventTrigger())}}class xn extends ne{tree;nodeDimensionsDirty;constructor(e){super(),this.tree=e,this.nodeDimensionsDirty=!1}layout(e){this._layout(e),P.update(this.tree.$data)}_layout(e){let t=this.tree.menuBar,i=t.htmlComp,s=this.tree.htmlComp,r=s.availableSize({exact:!0}).subtract(s.insets());this.tree.toggleBreadcrumbStyleEnabled&&this._sizeChanged(s)&&this.tree.setBreadcrumbStyleActive(Math.floor(r.width)<=this.tree.breadcrumbTogglingThreshold);let o=0,l;t.$container.isVisible()&&(l=Fs.size(i,r),i.setSize(l),o+=l.height),e.css("--menubar-height",((l||{}).height||0)+"px"),this._setDataHeight(o),this.tree.setViewRangeSize(this.tree.calculateViewRangeSize()),this.nodeDimensionsDirty=this.nodeDimensionsDirty||this._sizeChanged(s),this.nodeDimensionsDirty&&(this.nodeDimensionsDirty=!1,this.tree.isHorizontalScrollingEnabled()?(this.tree.nodeWidthDirty=!0,this.tree.maxNodeWidth=0):(this.tree.updateNodeHeights(),this.tree._renderViewport(),this.tree._renderFiller())),s.layouted||this.tree._renderScrollTop(),this.tree._renderViewport(),s.layouted||this.tree._renderScrollTop()}_sizeChanged(e){return e.sizeCached&&Math.ceil(e.sizeCached.width)!==Math.ceil(e.size().width)}_setDataHeight(e){let t=this.tree.$data;e+=t.cssMarginTop()+t.cssMarginBottom(),t.css("height",e===0?"100%":"calc(100% - "+e+"px)")}preferredLayoutSize(e,t){return this.tree._renderViewport(),this.tree.htmlComp.layouted||(this.nodeDimensionsDirty=!0),C.prefSize(e,t)}}class Eu{tree;constructor(e){this.tree=e}accept(e){if(e.expanded||(e.childNodes.forEach(t=>{t._lazyNodeFilterAccepted=!1}),!e.parentNode||!e.parentNode.expandedLazy||!e.parentNode.lazyExpandingEnabled||!this.tree.lazyExpandingEnabled))return!0;for(let t=0;t<this.tree.selectedNodes.length;t++){let i=this.tree.selectedNodes[t];if(typeof i=="string")break;if(i===e)return e._lazyNodeFilterAccepted=!0,!0}return!!e._lazyNodeFilterAccepted}}class Fu{tree;constructor(e){this.tree=e}accept(e){return this.tree.selectedNodes.length===0?e.parentNode===void 0:this.tree.isNodeInBreadcrumbVisible(e)}}class ks extends B{constructor(e,t){super(),this.field=e,this.repeatable=!0,this.stopPropagation=!0,this.renderingHints.hAlign=ut.RIGHT,this.ctrl=Ae.isCtrl(t),this.shift=Ae.isShift(t),this.alt=Ae.isAlt(t),this.keyStrokeMode=B.Mode.DOWN,this.inheritAccessibility=!1}_accept(e){return super._accept(e)?(this.field.selectedNodes.length>0&&(e._treeCurrentNode=this.field.selectedNodes[0],e._$treeCurrentNode=e._treeCurrentNode.$node),this.field.$container.addClass("keyboard-navigation"),!0):!1}handle(e){let t=this._computeNewSelection(e._treeCurrentNode);t&&this.selectNodesAndReveal(t,!0)}_computeNewSelection(e){return[]}selectNodesAndReveal(e,t){this.field.selectNodes(e,t),this.field.revealSelection(),this.field.isFocused()||this.field.focus()}}class Ru extends B{constructor(e){super(),this.field=e,this.which=[m.SPACE],this.renderingHints.render=!1}_accept(e){return super._accept(e)&&this.field.checkable&&this.field.selectedNodes.length>0}handle(e){let t=this.field.selectedNodes.filter(s=>s.enabled),i=t.some(s=>!s.checked);t.forEach(s=>this.field.checkNode(s,i))}}class jl extends ks{constructor(e,t){super(e,t),this.which=[m.UP],this.renderingHints.text="↑",this.renderingHints.$drawingArea=(i,s)=>{let r=this._computeNewSelection(s._treeCurrentNode);if(r)return r.$node}}_computeNewSelection(e){let t=this.field.visibleNodesFlat;if(t.length!==0)return e?t[t.indexOf(e)-1]:p.last(t)}}class ql extends ks{constructor(e,t){super(e,t),this.which=[m.DOWN],this.renderingHints.text="↓",this.renderingHints.$drawingArea=(i,s)=>{let r=this._computeNewSelection(s._treeCurrentNode);if(r)return r.$node}}_computeNewSelection(e){let t=this.field.visibleNodesFlat;if(t.length!==0)return e?t[t.indexOf(e)+1]:t[0]}}class Yl extends ks{constructor(e,t){super(e,t),this.which=[m.END],this.renderingHints.$drawingArea=(i,s)=>{let r=this._computeNewSelection(s._treeCurrentNode);if(r)return r.$node}}handle(e){let t=this._computeNewSelection(e._treeCurrentNode);t&&this.selectNodesAndReveal(t)}_computeNewSelection(e){let t=this.field.visibleNodesFlat;if(t.length!==0)return p.last(t)}}class Au extends ks{constructor(e,t){super(e,t),this.which=[m.HOME],this.renderingHints.hAlign=ut.RIGHT,this.renderingHints.$drawingArea=(i,s)=>{if(this.field.visibleNodesFlat.length>0)return this.field.visibleNodesFlat[0].$node}}handle(e){this.field.collapseAll(),this.field.visibleNodesFlat.length>0&&this.selectNodesAndReveal(this.field.visibleNodesFlat[0])}}class Pn extends ks{constructor(e,t,i,s){super(e,t),this.which=[i],this.renderingHints.text=s,this.renderingHints.$drawingArea=(r,o)=>{let l=o._treeCurrentNode;if(l.expanded)return l.$node;if(l.parentNode)return l.parentNode.$node}}_accept(e){let t=super._accept(e),i=e._treeCurrentNode;return t&&!!i&&(i.expanded||!!i.parentNode)}handle(e){let t=e._treeCurrentNode;t.expanded&&t.childNodes.length?this.field.collapseNode(t):t.parentNode&&this.selectNodesAndReveal(t.parentNode,!0)}}class Dn extends ks{constructor(e,t,i,s){super(e,t),this.which=[i],this.renderingHints.text=s,this.renderingHints.$drawingArea=(r,o)=>{let l=o._treeCurrentNode;if(this.isNodeExpandable(l))return l.$node;if(l.childNodes.length>0)return l.childNodes[0].$node}}_accept(e){let t=super._accept(e),i=e._treeCurrentNode;return t&&i&&(this.isNodeExpandable(i)||i.childNodes.length>0)}isNodeExpandable(e){return!e.expanded&&!e.leaf}handle(e){let t=e._treeCurrentNode;if(this.isNodeExpandable(t))this.field.expandNode(t,{lazy:!1});else{let i=t.childNodes.filter(function(s){return this.field.visibleNodesFlat.indexOf(s)>-1},this);i.length>0&&this.selectNodesAndReveal(i[0],!0)}}}class mg extends fe{$nodesContainer;constructor(){super(),this._scrollDirections="y"}_initTreeKeyStrokeContext(){this.keyStrokeContext.registerKeyStrokes([new Mu(this),new ku(this),new Iu(this),new Lu(this)])}_createTreeNode(e){return e=u.nvl(e,{}),e.parent=this,u.create($u,e)}_render(){this.$container=this.$parent.appendDiv("compact-tree");let e=new xn(this);this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(e),this.$data=this.$container.appendDiv("tree-data"),this._installScrollbars({borderless:!0}),this.menuBar=u.create(Ce,{parent:this,menuOrder:new gn(this.session,"Tree",this.defaultMenuTypes)}),this.menuBar.render(),this.$nodesContainer=this.$data.appendDiv("nodes"),this._updateNodeDimensions(),this._renderViewport(),this.invalidateLayoutTree()}_calculateCurrentViewRange(){return this.viewRangeSize=this.visibleNodesFlat.length,new U(0,Math.max(this.visibleNodesFlat.length,0))}calculateViewRangeSize(){return this.visibleNodesFlat.length}_insertNodeInDOMAtPlace(e,t){let i=this.visibleNodesFlat[t-1],s;if(!i)e.$node.prependTo(this.$nodesContainer);else if(i.level<e.level)e.$node.insertAfter(i.$node.children()[0]);else{s=i.$node;for(let r=0;r<i.level-e.level;r++)s=s.parent();e.$node.insertAfter(s)}}selectNodes(e,t){let i=[];e=p.ensure(e),e.forEach(s=>{s.isSection()?s.childNodes.length>0&&i.push(s.childNodes[0]):i.push(s)}),super.selectNodes(i,t)}_renderExpansion(e,t){}_updateItemPath(e,t){}}class $u extends Fi{render(e,t){let i=this.tree;if(this.isSection()){let s=i.$container.makeDiv("section expanded").data("node",this);s.appendDiv("title").text(this.text),this.$node=s}else{let s=this.parentNode.$node;this.$node=s.makeDiv("section-node").data("node",this).on("mousedown",i._onNodeMouseDown.bind(i)).on("mouseup",i._onNodeMouseUp.bind(i))}}_decorate(){if(!this.$node)return;let e,t=this.$node;t.hasClass("section")?(t=t.children("title"),e="title"):(e="section-node",t.isSelected()&&(e+=" selected")),t.removeClass(),t.addClass(e),t.addClass(this.cssClass),t.text(this.text),L.legacyStyle(this,t),_.hasText(this.tooltipText)&&t.attr("title",this.tooltipText)}isSection(){return this.level===0}}class En extends B{constructor(e){super(),this.repeatable=!0,this.field=e,this.keyStrokeMode=B.Mode.DOWN}_accept(e){if(!super._accept(e)||!this.field.nodes||!this.field.nodes.length)return!1;let i=this.field.$nodesContainer.find(".section-node.selected"),s=i.data("node"),r=this._findNextNode(i,s);return r?(e._nextNode=r,!0):!1}handle(e){this.field.selectNodes(e._nextNode),this.field.checkNode(e._nextNode,!0),this.field.revealSelection()}_findNextNode(e,t){throw new Error("method must be overwritten by subclass")}}class Mu extends En{constructor(e){super(e),this.which=[m.UP],this.renderingHints.text="↑"}_findNextNode(e,t){return t?e.prev(".section-node").data("node")||e.parent().prev(".section").children(".section-node").last().data("node"):p.last(p.last(this.field.nodes).childNodes)}}class ku extends En{constructor(e){super(e),this.which=[m.DOWN],this.renderingHints.text="↓"}_findNextNode(e,t){return t?e.next(".section-node").data("node")||e.parent().next(".section").children(".section-node").first().data("node"):p.first(p.first(this.field.nodes).childNodes)}}class Iu extends En{constructor(e){super(e),this.renderingHints.text="←",this.which=[m.LEFT]}_findNextNode(e,t){return e.parent().prev(".section").children(".section-node").first().data("node")}}class Lu extends En{constructor(e){super(e),this.renderingHints.text="→",this.which=[m.RIGHT]}_findNextNode(e,t){return e.parent().next(".section").children(".section-node").first().data("node")}}class Bu extends I{yearPanel;splitter;resoucePanel;resourcePanelDisplayable;_animationEnabled;constructor(){super(),this.yearPanel=null,this.splitter=null,this.resoucePanel=null,this.resourcePanelDisplayable=!1,this._animationEnabled=!1,this._addWidgetProperties(["yearPanel","resourcePanel"])}init(e){super.init(e),this.yearPanel=u.create(El,{parent:this}),this.splitter=u.create(Hu,{parent:this,splitHorizontal:!1,collapsedLabel:this.session.text("ui.CalendarSelection")}),this.resoucePanel=u.create(zc,{parent:this,checkable:!0}),this.splitter.on("positionChange",this._onSplitterPositionChange.bind(this)),this.splitter.on("splitterClick",this._onSplitterClick.bind(this))}_render(){this.$container=this.$parent.appendDiv("calendar-sidebar"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Ou(this)),this.yearPanel.render(),this.splitter.render(),this.resoucePanel.render()}_onSplitterPositionChange(e){this.invalidateLayoutTree(!1)}_onSplitterClick(e){this.setResourcePanelExpanded(this.splitter.collapsed,!0)}setResourcePanelExpanded(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.splitter.collapsed!==void 0&&this.splitter.collapsed!==e||(this.htmlComp.layout.setNewSplitterPositionPercentage(e?62:100,t),this.invalidateLayoutTree(!1))}setResourcePanelDisplayable(e){this.setProperty("resourcePanelDisplayable",e)}_setResourcePanelDisplayable(e){this._setProperty("resourcePanelDisplayable",e),this.invalidateLayoutTree(!1)}}class Ou extends ne{calendarSidebar;yearPanel;resourcePanel;splitter;minSplitterPosition;_relativeSplitterPosition;_availableHeight;_newSplitterPosition;_newRelativeSplitterPosition;_animateNewSplitterPosition;constructor(e){super(),this.calendarSidebar=e,this.minSplitterPosition=200,this.yearPanel=this.calendarSidebar.yearPanel,this.splitter=this.calendarSidebar.splitter,this.resourcePanel=this.calendarSidebar.resoucePanel,this._availableHeight=null,this._newSplitterPosition=null,this._newRelativeSplitterPosition=null,this._animateNewSplitterPosition=!1}layout(e){let t=x.get(e),i=t.insets(),s=t.availableSize().subtract(i);if(this._validateSplitterPosition(t,this.splitter,s),this._newSplitterPosition!==null){let a=this._newSplitterPosition;this._newSplitterPosition=null,this._setSplitterPosition(a,this._animateNewSplitterPosition),this._validateSplitterPosition(t,this.splitter,s)}if(this._newRelativeSplitterPosition!==null){let a=this._availableHeight/100*this._newRelativeSplitterPosition;this._newRelativeSplitterPosition=null,this._setSplitterPosition(a,this._animateNewSplitterPosition),this._validateSplitterPosition(t,this.splitter,s)}let r=this.splitter.position-8,o=(this.splitter.collapsed?this._calculateCollapsedLabelHeight():0)+20,l=s.height-r-o;this.splitter.$container.toggleClass("hidden",!this.calendarSidebar.resourcePanelDisplayable),this.yearPanel.htmlComp.setBounds(new te(i.left,i.top,s.width,r)),this.resourcePanel.htmlComp.setBounds(new te(i.left,i.top+o,s.width,l)),this.calendarSidebar.yearPanel._scrollYear()}_validateSplitterPosition(e,t,i){let s=i.height-this._calculateCollapsedLabelHeight();i.height!==this._availableHeight&&this._silentUpdateSpliterPosition(e,t,this._relativeSplitterPosition*s),this.calendarSidebar.resourcePanelDisplayable?t.position<this.minSplitterPosition?this._silentUpdateSpliterPosition(e,t,Math.max(this.minSplitterPosition,0)):t.position>s&&this._silentUpdateSpliterPosition(e,t,Math.max(s,0)):this._silentUpdateSpliterPosition(e,t,Math.max(i.height,0));let r=t.position>=s;this.splitter.setCollapsed(r),this.calendarSidebar.parent.setShowResourcePanel(!r),this._availableHeight=i.height,this._relativeSplitterPosition=t.position/s}_setSplitterPosition(e,t){if(!t)this.splitter.setPosition(e);else{let i={progress:()=>{this.splitter.setPosition(this.splitter.$container.cssTop())}};this.splitter.$container.animate({top:e},i)}}_silentUpdateSpliterPosition(e,t,i){e.suppressInvalidate=!0;try{t.setPosition(i)}finally{e.suppressInvalidate=!1}}_calculateCollapsedLabelHeight(){if(!this.splitter.rendered)return 40;let e=this.splitter.$collapsedLabel.outerHeight(),t=this.splitter.$splitterBox.outerHeight();return e+t}setNewSplitterPosition(e,t){this._newSplitterPosition=e,this._animateNewSplitterPosition=t}setNewSplitterPositionPercentage(e,t){this._newRelativeSplitterPosition=e,this._animateNewSplitterPosition=t}}class Hu extends hs{collapsed;collapsedLabel;$splitterBox;$collapsedLabel;$collapseIcon;$collapseBorderLeft;$collapseBorderRight;_splitterMoveStartPosition;_init(e){super._init(e),this.on("moveStart",this._onSplitterMoveStart.bind(this)),this.on("moveEnd",this._onSplitterMoveEnd.bind(this))}_render(){super._render(),this.$container.addClass("calendar-sidebar-splitter"),this.$splitterBox=this.$container.appendDiv("splitter-box"),this.$collapsedLabel=this.$container.appendDiv("collapsed-label"),this.$collapseBorderLeft=this.$splitterBox.appendDiv("group-collapse-border"),this.$collapseIcon=this.$splitterBox.appendDiv("group-collapse-icon"),this.$collapseBorderRight=this.$splitterBox.appendDiv("group-collapse-border")}_renderProperties(){super._renderProperties(),this._renderCollapsed(),this._renderCollapsedLabel()}setCollapsed(e){this.setProperty("collapsed",e)}_renderCollapsed(){this.$container.toggleClass("collapsed",this.collapsed)}setCollapsedLabel(e){this.setProperty("collapsedLabel",e)}_renderCollapsedLabel(){this.$collapsedLabel.text(this.collapsedLabel)}_onSplitterMoveStart(e){this._splitterMoveStartPosition=e.position}_onSplitterMoveEnd(e){if(!this._splitterMoveStartPosition)return;let t=e.position;Math.abs(this._splitterMoveStartPosition-t)<2&&this.trigger("splitterClick"),this._splitterMoveStartPosition=null}}class Nu extends Ss{resources;constructor(){super(),this.resources=[]}setResources(e){this.resources=e,this.refreshData()}_data(){return this.resources.map(e=>[e.resourceId,e.name,e.parentId,e.cssClass])}_dataToLookupRow(e,t){let i=super._dataToLookupRow(e,t);return i.cssClass=e[3],i}}class _g extends Fi{resourceId;parentId;constructor(){super(),this.resourceId=null,this.parentId=null}}function T_(n,e){let t=n.is("div");if(arguments.length===2)t?n.text(e):n.val(e);else return t?n.text():n.val()}const oe={makeTextField(n,e){return n.makeElement("<input>",e).attr("type","text").attr("autocomplete","NoAutocomplete").disableSpellcheck()},appendIcon(n,e){let t=n.appendSpan("icon unfocusable text-field-icon");return e&&t.addClass(e),t},initTouch(n,e){n.embedded=u.nvl(e.embedded,!1),n.touchMode=u.nvl(e.touchMode,w.get().supportsOnlyTouch())},valOrText:T_,makeInputOrDiv(n,e){return n.touchMode?oe.makeInputDiv(n,e):oe.makeTextField(n.$container,e)},makeInputDiv(n,e){return n.$container.makeDiv(_.join(" ","input-field",e))},handleOnClick(n){return n.enabledComputed&&!n.embedded&&!n.popup},activateFirstField(n,e){let t=Fe.findFirstFocusableWidget(e,n);t&&t.activate()},eventOutsideProposalField(n,e){let t=r(n.$field,e)||r(n.$icon,e)||r(n.$clearIcon,e),i=o(n.popup,e),s=o(n.tooltip(),e);return!t&&!i&&!s;function r(l,a){return l&&l.isOrHas(a)}function o(l,a){return l&&l.rendered&&l.$container.isOrHas(a)}},selectAllParentTabsOf(n){!n||!(n instanceof A)||n.visitParentFields(oe.selectIfIsTab)},selectIfIsTab(n){!n||!(n instanceof ga)||n.select()},adjustStatusPositionForScrollShadow(n,e){n.htmlComp&&(n.htmlComp.suppressInvalidate=!0),e()?Fe.preserveAndSetProperty(()=>n.setStatusPosition(A.StatusPosition.TOP),()=>n.statusPosition,n,"_statusPositionOrig"):Fe.resetProperty(t=>n.setStatusPosition(t),n,"_statusPositionOrig"),n.htmlComp&&(n.htmlComp.suppressInvalidate=!1)},focusAndInsertText(n,e){n[0].focus(),n.document(!0).execCommand("insertText",!1,e)}};class Fn extends B{appLinkTriggerFunction;constructor(e,t){super(),this.field=e,this.appLinkTriggerFunction=t,this.which=[m.SPACE,m.ENTER],this.renderingHints.render=!1,this.inheritAccessibility=!1}_accept(e){return super._accept(e)&&h()(e.target).hasClass("app-link")}handle(e){this.appLinkTriggerFunction.call(this.field,e)}}class Xl extends B{constructor(e){super(),this.field=e,this.ctrl=!0,this.which=[m.A],this.stopPropagation=!0}handle(e){let t=this.field,i=t.$container.window(!0).getSelection();if(i.rangeCount!==1)return;let o=i.getRangeAt(0).commonAncestorContainer;t.$label.isOrHas(o)?t.$label.selectAllText():t.$field.isOrHas(o)?t.$field.selectAllText():t.$container.selectAllText()}}class Jl extends I{autoRemove;status;position;menus;tooltip;contextMenu;updating;_parents;_parentPropertyChangeListener;_parentHierarchyChangeListener;constructor(){super(),this.tooltip=null,this.contextMenu=null,this.status=null,this.updating=!1,this.autoRemove=!0,this.position=A.StatusPosition.DEFAULT,this._parents=[],this._parentPropertyChangeListener=this._onParentPropertyChange.bind(this),this._parentHierarchyChangeListener=this._onParentHierarchyChange.bind(this)}_render(){this.$container=this.$parent.appendSpan("status").on("mousedown",this._onStatusMouseDown.bind(this)),this.htmlComp=x.install(this.$container,this.session)}_remove(){super._remove(),this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),this.contextMenu&&(this.contextMenu.destroy(),this.contextMenu=null),this._removeParentListeners()}_renderProperties(){super._renderProperties(),this._renderPosition()}update(e,t,i,s){this.updating=!0,this.setStatus(e),this.setMenus(t),this.setAutoRemove(i),this.updating=!1,this._updatePopup(s)}clearStatus(){this.setStatus(null)}setStatus(e){this.setProperty("status",e)}_setStatus(e){e=E.ensure(e),this._setProperty("status",e)}_renderStatus(){this.updating||this._updatePopup()}setPosition(e){this.setProperty("position",e)}_renderPosition(){this.$container.toggleClass("top",this.position===A.StatusPosition.TOP),this.invalidateLayoutTree()}_renderVisible(){super._renderVisible(),this.visible||this.hidePopup()}setMenus(e){this.setProperty("menus",p.ensure(e))}_renderMenus(){this.updating||this._updatePopup()}setAutoRemove(e){this.setProperty("autoRemove",e)}_renderAutoRemove(){this.updating||this._updatePopup()}hideTooltip(){this.tooltip&&(this.trigger("hideTooltip").defaultPrevented||(this.tooltip.destroy(),this._removeParentListeners()))}_updatePopup(e){this._requiresTooltip()||this.hideTooltip(),p.empty(this.menus)&&this.hideContextMenu(),e===!0?this.showTooltip():e===!1&&this.hideTooltip()}_requiresTooltip(){return!(!this.status||!this.rendered||p.empty(this.menus)&&!_.hasText(this.status.message))}showTooltip(){!this._requiresTooltip()||this.trigger("showTooltip").defaultPrevented||(this._updateParentListeners(),this.hideContextMenu(),this.tooltip&&this.tooltip.autoRemove!==this.autoRemove&&this.hideTooltip(),this.tooltip?(this.tooltip.setText(this.status.message),this.tooltip.setSeverity(this.status.severity),this.tooltip.setMenus(this.menus)):(this.tooltip=u.create(Xi,{parent:this,$anchor:this.$container,text:this.status.message,severity:this.status.severity,autoRemove:this.autoRemove,menus:this.menus}),this.tooltip.render(),T.role(this.tooltip.$content,"alert"),this.$container.addClass("selected"),this.tooltip.one("destroy",()=>{this.tooltip=null,this.$container&&this.$container.removeClass("selected")})))}hideContextMenu(){this.contextMenu&&this.contextMenu.close()}showContextMenu(){p.empty(this.menus)||(this.hidePopup(),this.contextMenu&&this.contextMenu.isRemovalPending()&&this.contextMenu.removeImmediately(),this.contextMenu=u.create(bt,{parent:this,$anchor:this.$container,menuItems:this.menus,cloneMenuItems:!1,closeOnAnchorMouseDown:!1}),this.contextMenu.open(),this.$container.addClass("selected"),this.contextMenu.one("destroy",()=>{this.contextMenu=null,this.$container&&this.$container.removeClass("selected")}))}hidePopup(){this.hideTooltip(),this.hideContextMenu()}togglePopup(){if(this.status){this.hideContextMenu(),this.toggleTooltip();return}p.empty(this.menus)?this.hidePopup():(this.hideTooltip(),this.session.onRequestsDone(()=>{this.rendered&&this.toggleContextMenu()}))}toggleTooltip(){this.tooltip?this.hideTooltip():this.showTooltip()}toggleContextMenu(){this.contextMenu?this.hideContextMenu():this.showContextMenu()}_onStatusMouseDown(e){this.trigger("statusMouseDown",e).defaultPrevented||this.togglePopup()}_updateTooltipVisibility(e){this.isEveryParentVisible()?setTimeout(()=>{!this.rendered||!this.isEveryParentVisible()||this.tooltip&&!this.tooltip.rendered&&this.tooltip.render()}):this.tooltip&&this.tooltip.rendered&&this.tooltip.remove()}_onParentHierarchyChange(e){this._updateParentListeners()}_onParentPropertyChange(e){e.propertyName==="visible"&&this._updateTooltipVisibility(e.source)}_removeParentListeners(){this._parents.forEach(e=>{e.off("hierarchyChange",this._parentHierarchyChangeListener),e.off("propertyChange",this._parentPropertyChangeListener)}),this._parents=[]}_updateParentListeners(){this._removeParentListeners();let e=this.parent;for(;e;)e.on("hierarchyChange",this._parentHierarchyChangeListener),e.on("propertyChange",this._parentPropertyChangeListener),this._parents.push(e),e=e.parent}}var bg;function lr(n,e,t){return(e=v_(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function v_(n){var e=S_(n,"string");return typeof e=="symbol"?e:e+""}function S_(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class A extends I{dropType;dropMaximumSize;empty;errorStatus;fieldStyle;gridData;gridDataHints;mode;fieldStatus;keyStrokes;displayText;label;labelVisible;labelPosition;labelWidthInPixel;labelUseUiWidth;labelHtmlEnabled;mandatory;statusMenuMappings;menus;menusVisible;defaultMenuTypes;preventInitialFocus;saveNeeded;checkSaveNeeded;lifecycleBoundary;statusPosition;statusVisible;suppressStatus;touched;tooltipText;font;foregroundColor;backgroundColor;labelFont;labelForegroundColor;labelBackgroundColor;tooltipAnchor;onFieldTooltipOptionsCreator;dragAndDropHandler;validationResultProvider;$label;$field;$clearIcon;$fieldContainer;$icon;$pseudoStatus;$status;$mandatory;_menuPropertyChangeHandler;_hierarchyChangeHandler;constructor(){super(),this.dropType=O.NONE,this.dropMaximumSize=z.DEFAULT_DROP_MAXIMUM_SIZE,this.empty=!0,this.errorStatus=null,this.fieldStyle=A.DEFAULT_FIELD_STYLE,this.gridData=null,this.gridDataHints=new ke,this.mode=A.Mode.DEFAULT,this.keyStrokes=[],this.label=null,this.labelVisible=!0,this.labelPosition=A.LabelPosition.DEFAULT,this.labelWidthInPixel=0,this.labelUseUiWidth=!1,this.labelHtmlEnabled=!1,this.mandatory=!1,this.statusMenuMappings=[],this.menus=[],this.menusVisible=!0,this.defaultMenuTypes=[],this.preventInitialFocus=!1,this.saveNeeded=!1,this.checkSaveNeeded=!0,this.lifecycleBoundary=!1,this.statusPosition=A.StatusPosition.DEFAULT,this.statusVisible=!0,this.suppressStatus=null,this.touched=!1,this.tooltipText=null,this.tooltipAnchor=A.TooltipAnchor.DEFAULT,this.onFieldTooltipOptionsCreator=null,this.validationResultProvider=this._createValidationResultProvider(),this.$label=null,this.$field=null,this.$fieldContainer=null,this.$icon=null,this.$status=null,this._addWidgetProperties(["keyStrokes","menus","statusMenuMappings"]),this._addCloneProperties(["dropType","dropMaximumSize","errorStatus","fieldStyle","gridDataHints","gridData","label","labelVisible","labelPosition","labelWidthInPixel","labelUseUiWidth","mandatory","mode","preventInitialFocus","saveNeeded","touched","statusVisible","statusPosition","statusMenuMappings","tooltipText","tooltipAnchor"]),this._menuPropertyChangeHandler=this._onMenuPropertyChange.bind(this),this._hierarchyChangeHandler=this._onHierarchyChange.bind(this)}static FieldStyle={CLASSIC:"classic",ALTERNATIVE:"alternative"};static SuppressStatus=(bg=()=>{lr(this,"DEFAULT_FIELD_STYLE",A.FieldStyle.ALTERNATIVE),lr(this,"StatusPosition",{DEFAULT:"default",TOP:"top"}),lr(this,"LabelPosition",{DEFAULT:0,LEFT:1,ON_FIELD:2,RIGHT:3,TOP:4,BOTTOM:5}),lr(this,"TooltipAnchor",{DEFAULT:"default",ON_FIELD:"onField"}),lr(this,"LabelWidth",{DEFAULT:0,UI:-1}),lr(this,"FULL_WIDTH",0),lr(this,"Mode",{DEFAULT:"default",CELLEDITOR:"celleditor"}),lr(this,"SEVERITY_CSS_CLASSES","has-error has-warning has-info has-ok")},{ALL:"all",ICON:"icon",FIELD:"field"});_createKeyStrokeContext(){return new Ee}_createLoadingSupport(){return new Ut({widget:this})}_init(e){super._init(e),this.resolveConsts([{property:"labelPosition",constType:A.LabelPosition}]),this.resolveTextKeys(["label","tooltipText"]),this._setValidationResultProvider(this.validationResultProvider),this._setKeyStrokes(this.keyStrokes),this._setMenus(this.menus),this._setErrorStatus(this.errorStatus),this._setGridDataHints(this.gridDataHints),this._setGridData(this.gridData),this._updateEmpty(),this._watchFieldHierarchy()}_destroy(){this._unwatchFieldHierarchy(),super._destroy()}_initProperty(e,t){e==="gridDataHints"?this._initGridDataHints(t):super._initProperty(e,t)}_initGridDataHints(e){e instanceof ke?this.gridDataHints=e:b.isObject(e)?h().extend(this.gridDataHints,e):this.gridDataHints=e}_render(){this.addContainer(this.$parent),this.addLabel(),this.addField(this.$parent.makeDiv()),this.addMandatoryIndicator(),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderMandatory(),this._renderTooltipText(),this._renderErrorStatus(),this._renderMenus(),this._renderLabel(),this._renderLabelVisible(),this._renderStatusVisible(),this._renderStatusPosition(),this._renderFont(),this._renderForegroundColor(),this._renderBackgroundColor(),this._renderLabelFont(),this._renderLabelForegroundColor(),this._renderLabelBackgroundColor(),this._renderGridData(),this._renderPreventInitialFocus(),this._renderFieldStyle()}_remove(){super._remove(),this._removeField(),this._removeStatus(),this._removeLabel(),this._removeIcon(),this.removeMandatoryIndicator(),z.uninstallDragAndDropHandler(this)}setFieldStyle(e){this.setProperty("fieldStyle",e)}_renderFieldStyle(){if(this._renderFieldStyleInternal(this.$container),this._renderFieldStyleInternal(this.$fieldContainer),this._renderFieldStyleInternal(this.$field),this.rendered){let e=this.htmlComp.getParent();e&&e.invalidateLayoutTree(),this.invalidateLayoutTree()}}_renderFieldStyleInternal(e){e&&e.toggleClass("alternative",this.fieldStyle===A.FieldStyle.ALTERNATIVE)}setMandatory(e){this.setProperty("mandatory",e)}_renderMandatory(){this.$container.toggleClass("mandatory",this.mandatory),T.required(this.$field,this.mandatory||null)}_errorStatus(){return this.errorStatus}setErrorStatus(e){this.setProperty("errorStatus",e)}_setErrorStatus(e){e=E.ensure(e),this._setProperty("errorStatus",e)}addErrorStatus(e){if(typeof e=="string"&&(e=this._createErrorStatus(e)),!(e instanceof E))throw new Error("errorStatus is not a Status");let t=this._errorStatus();t?t=t.ensureChildren():t=E.ok("Root"),t.addStatus(e),this.setErrorStatus(t)}_createErrorStatus(e){return E.error(e)}containsStatus(e){return this.errorStatus?this.errorStatus.containsStatus(e):!1}setSuppressStatus(e){this.setProperty("suppressStatus",e)}_renderSuppressStatus(){this._renderErrorStatus()}_isSuppressStatusIcon(){return u.isOneOf(this.suppressStatus,A.SuppressStatus.ALL,A.SuppressStatus.ICON)}_isSuppressStatusField(){return u.isOneOf(this.suppressStatus,A.SuppressStatus.ALL,A.SuppressStatus.FIELD)}removeErrorStatus(e){this.removeErrorStatusByPredicate(t=>t instanceof e)}removeErrorStatusByPredicate(e){let t=this._errorStatus();if(t&&t.containsStatusByPredicate(e)){let i=t.clone();i.removeAllStatusByPredicate(e),i.hasChildren()?this.setErrorStatus(i):this.clearErrorStatus()}}clearErrorStatus(){this.setErrorStatus(null)}_renderErrorStatus(){let e=this._errorStatus(),t=!!e,i=t&&!this._isSuppressStatusField()?"has-"+e.cssClass():"";this._updateErrorStatusClasses(i,t),this._updateFieldStatus()}_updateErrorStatusClasses(e,t){this._updateErrorStatusClassesOnElement(this.$container,e,t),this._updateErrorStatusClassesOnElement(this.$field,e,t)}_updateErrorStatusClassesOnElement(e,t,i){e&&e.removeClass(A.SEVERITY_CSS_CLASSES).addClass(t)}setTooltipText(e){this.setProperty("tooltipText",e)}_renderTooltipText(){this._updateTooltip()}setTooltipAnchor(e){this.setProperty("tooltipAnchor",e)}_renderTooltipAnchor(){this._updateTooltip()}_updateTooltip(){let e=this.hasStatusTooltip();if(this.$container.toggleClass("has-tooltip",e),this.$field&&this.$field.toggleClass("has-tooltip",e),this._updateFieldStatus(),T.description(this.$field,this.tooltipText),this.$fieldContainer)if(this.hasOnFieldTooltip()){let t=this.onFieldTooltipOptionsCreator||this._createOnFieldTooltipOptions;Y.install(this.$fieldContainer,t.call(this))}else Y.uninstall(this.$fieldContainer)}hasStatusTooltip(){return this.tooltipAnchor===A.TooltipAnchor.DEFAULT&&_.hasText(this.tooltipText)}hasOnFieldTooltip(){return this.tooltipAnchor===A.TooltipAnchor.ON_FIELD&&_.hasText(this.tooltipText)}setOnFieldTooltipOptionsCreator(e){this.onFieldTooltipOptionsCreator=e}_createOnFieldTooltipOptions(){return{parent:this,text:this.tooltipText,arrowPosition:50}}_renderVisible(){super._renderVisible(),this.rendered&&this._renderErrorStatus()}setLabel(e){this.setProperty("label",e)}_renderLabel(){let e=this.label;this.labelPosition===A.LabelPosition.ON_FIELD?(this._renderPlaceholder(),this.$label&&this.$label.text(""),T.label(this.$field,this.label)):this.$label&&(this._removePlaceholder(),this.$label.contentOrNbsp(this.labelHtmlEnabled,e,"empty").toggleClass("top",this.labelPosition===A.LabelPosition.TOP),(this.labelUseUiWidth||this.labelWidthInPixel===A.LabelWidth.UI)&&this.invalidateLayoutTree())}_renderEmptyLabel(){this.$label.html(" ").toggleClass("top",this.labelPosition===A.LabelPosition.TOP)}_renderPlaceholder(e){e=u.nvl(e,this.$field),e&&e.placeholder(this.label)}_removePlaceholder(e){e=u.nvl(e,this.$field),e&&e.placeholder("")}setLabelVisible(e){this.setProperty("labelVisible",e)}_renderLabelVisible(){let e=this.labelVisible;if(this._renderChildVisible(this.$label,e),this.$container.toggleClass("label-hidden",!e),this.rendered&&this.labelPosition===A.LabelPosition.TOP){let t=this.htmlComp.getParent();t&&t.invalidateLayoutTree()}}setLabelWidthInPixel(e){this.setProperty("labelWidthInPixel",e)}_renderLabelWidthInPixel(){this.invalidateLayoutTree()}setLabelUseUiWidth(e){this.setProperty("labelUseUiWidth",e)}_renderLabelUseUiWidth(){this.invalidateLayoutTree()}setStatusVisible(e){this.setProperty("statusVisible",e)}_renderStatusVisible(){this._updateFieldStatus()}setStatusPosition(e){this.setProperty("statusPosition",e)}_renderStatusPosition(){this._updateFieldStatus()}tooltip(){return this.fieldStatus?this.fieldStatus.tooltip:null}_updateFieldStatus(){if(!this.fieldStatus)return;let e,t=this._errorStatus(),i=null,s=this._computeStatusVisible(),r=!0;if(this.fieldStatus.setPosition(this.statusPosition),this.fieldStatus.setVisible(s),!!s){if(t){if(this.mode===A.Mode.CELLEDITOR)return;i=t,r=!i.isError(),e=this._getMenusForStatus(t)}else this.hasStatusTooltip()?(i=u.create(E,{message:this.tooltipText,severity:E.Severity.INFO}),e=this.getContextMenuItems()):e=this.getContextMenuItems();this.fieldStatus.update(i,e,r,this._isInitialShowStatus())}}_isInitialShowStatus(){return!!this._errorStatus()}_computeStatusVisible(){let e=this._errorStatus(),t=this.statusVisible,i=!!e,s=this.hasStatusTooltip();return!this._isSuppressStatusIcon()&&this.visible&&(t||i||s||this._hasMenus()&&this.menusVisible)}_renderChildVisible(e,t){if(e&&e.isVisible()!==t)return e.setVisible(t),this.invalidateLayoutTree(),!0}setLabelPosition(e){this.setProperty("labelPosition",e)}_renderLabelPosition(){if(this._renderLabel(),this.rendered){let e=this.htmlComp.getParent();e&&e.invalidateLayoutTree(),this.invalidateLayoutTree()}}setLabelHtmlEnabled(e){this.setProperty("labelHtmlEnabled",e)}_renderLabelHtmlEnabled(){this._renderLabel()}_renderEnabled(){super._renderEnabled(),this.$field&&this.$field.setEnabled(this.enabledComputed),this._installOrUninstallDragAndDropHandler()}_renderDisabledStyle(){this._renderDisabledStyleInternal(this.$container),this._renderDisabledStyleInternal(this.$fieldContainer),this._renderDisabledStyleInternal(this.$field),this._renderDisabledStyleInternal(this.$mandatory)}setFont(e){this.setProperty("font",e)}_renderFont(){L.legacyFont(this,this.$field)}setForegroundColor(e){this.setProperty("foregroundColor",e)}_renderForegroundColor(){L.legacyForegroundColor(this,this.$field)}setBackgroundColor(e){this.setProperty("backgroundColor",e)}_renderBackgroundColor(){L.legacyBackgroundColor(this,this.$field)}setLabelFont(e){this.setProperty("labelFont",e)}_renderLabelFont(){L.legacyFont(this,this.$label,"label")}setLabelForegroundColor(e){this.setProperty("labelForegroundColor",e)}_renderLabelForegroundColor(){L.legacyForegroundColor(this,this.$label,"label")}setLabelBackgroundColor(e){this.setProperty("labelBackgroundColor",e)}_renderLabelBackgroundColor(){L.legacyBackgroundColor(this,this.$label,"label")}setGridDataHints(e){this.setProperty("gridDataHints",e)}_setGridDataHints(e){this._setProperty("gridDataHints",ke.ensure(e||new ke))}_renderGridDataHints(){this.parent.invalidateLogicalGrid()}_setGridData(e){this._setProperty("gridData",ke.ensure(e||new ke))}_renderGridData(){if(this.rendered){let e=this.htmlComp.getParent();e&&e.invalidateLayoutTree()}}setMenus(e){this.setProperty("menus",e)}_setMenus(e){e=p.ensure(e),this.menus.forEach(t=>t.off("propertyChange",this._menuPropertyChangeHandler)),this.updateKeyStrokes(e,this.menus),this._setProperty("menus",e),this.menus.forEach(t=>t.on("propertyChange",this._menuPropertyChangeHandler))}insertMenu(e){this.insertMenus([e])}insertMenus(e){$e.insertMenus(this,e)}deleteMenu(e){this.deleteMenus([e])}deleteMenus(e){$e.deleteMenus(this,e)}_onMenuPropertyChange(e){e.propertyName==="visible"&&this.rendered&&this._updateMenus()}getContextMenuItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=this.getCurrentMenuTypes();return t.length?$e.filter(this.menus,t,{onlyVisible:e,defaultMenuTypes:this.defaultMenuTypes}):e?this.menus.filter(i=>i.visible):this.menus}_getMenusForStatus(e){return this.statusMenuMappings.filter(t=>!t.menu||!t.menu.visible?!1:(t.codes.length===0||t.codes.indexOf(e.code)>-1)&&(t.severities.length===0||t.severities.indexOf(e.severity)>-1)).map(t=>t.menu)}_hasMenus(){return!!(this.menus&&this.getContextMenuItems().length>0)}_updateMenus(){!this.rendered&&!this.rendering||(this.$container.toggleClass("has-menus",this._hasMenus()&&this.menusVisible),this._updateFieldStatus())}_renderMenus(){this._updateMenus()}_renderStatusMenuMappings(){this._updateMenus()}setMenusVisible(e){this.setProperty("menusVisible",e)}_setMenusVisible(e){this._setProperty("menusVisible",e)}_renderMenusVisible(){this._updateMenus()}getCurrentMenuTypes(){return this._getCurrentMenuTypes()}_getCurrentMenuTypes(){return[]}_setKeyStrokes(e){this.updateKeyStrokes(e,this.keyStrokes),this._setProperty("keyStrokes",e)}_$tooltipParent(){}_hideStatusMessage(){this.fieldStatus&&this.fieldStatus.hideTooltip()}_renderPreventInitialFocus(){this.$container.toggleClass("prevent-initial-focus",!!this.preventInitialFocus)}focus(){if(!this.rendered)return this.session.layoutValidator.schedulePostValidateFunction(this.focus.bind(this)),!1;if(!this.enabledComputed)return!1;let e=this.getFocusableElement();return e?this.session.focusManager.requestFocus(e):!1}getFocusableElement(){return this.rendered&&this.$field?this.$field[0]:null}_onFieldFocus(e){this.setFocused(!0)}_onFieldBlur(e){this.setFocused(!1)}activate(){if(!this.enabledComputed||!this.rendered)return;let e=this.getFocusableElement();e&&h().ensure(e).focus()}get$Scrollable(){return this.$field}getParentGroupBox(){return this.findParent(ae)}getParentField(){return this.findParent(A)}addLabel(){this.$label=this.$container.appendElement("<label>"),Y.installForEllipsis(this.$label,{parent:this}),this.$label.on("click",this._onLabelClick.bind(this))}_onLabelClick(e){_.hasText(this.label)&&this.activate()}_removeLabel(){this.$label&&(Y.uninstall(this.$label),this.$label.remove(),this.$label=null)}_linkWithLabel(e){_.empty(this.label)||this.labelPosition!==A.LabelPosition.ON_FIELD&&T.linkElementWithLabel(e,this.$label)}_removeIcon(){this.$icon&&(this.$icon.remove(),this.$icon=null)}addField(e){this.$fieldContainer||this.addFieldContainer(e),this.$field=e,this._linkWithLabel(e),this.$field.on("blur",this._onFieldBlur.bind(this)).on("focus",this._onFieldFocus.bind(this))}addFieldContainer(e){this.$fieldContainer=e.addClass("field"),(this.$container.has(e[0]).length===0||e.next().length>0)&&e.appendTo(this.$container)}_removeField(){this.$field&&(this.$field.remove(),this.$field=null),this.$fieldContainer&&(this.$fieldContainer.remove(),this.$fieldContainer=null)}addStatus(){this.fieldStatus||(this.fieldStatus=u.create(Jl,{parent:this,position:this.statusPosition,visible:this._computeStatusVisible()}),this.fieldStatus.render(),this.$status=this.fieldStatus.$container,this._updateFieldStatus())}_removeStatus(){this.fieldStatus&&(this.fieldStatus.destroy(),this.$status=null,this.fieldStatus=null)}addPseudoStatus(){this.$pseudoStatus=this.$container.appendSpan("status")}addMandatoryIndicator(){this.$mandatory=this.$container.appendSpan("mandatory-indicator")}removeMandatoryIndicator(){this.$mandatory&&(this.$mandatory.remove(),this.$mandatory=null)}addIcon(e){e||(e=this.$container),this.$icon=oe.appendIcon(e).on("mousedown",this._onIconMouseDown.bind(this)),T.hidden(this.$icon,!0)}_onIconMouseDown(e){this.enabledComputed&&this.$field.focus()}addContainer(e,t,i){this.$container=e.appendDiv("form-field"),t&&this.$container.addClass(t);let s=x.install(this.$container,this.session);s.setLayout(i||this._createLayout()),this.htmlComp=s}_createLayout(){return new Kt(this)}updateInnerAlignment(e){e=e||{};let t=e.$fieldContainer||this.$fieldContainer;this._updateElementInnerAlignment(e,t),t!==this.$container&&this._updateElementInnerAlignment(e,this.$container)}_updateElementInnerAlignment(e,t){e=e||{};let i=u.nvl(e.useHorizontalAlignment,!0),s=u.nvl(e.useVerticalAlignment,!0);if(t&&(t.removeClass("has-inner-alignment halign-left halign-center halign-right valign-top valign-middle valign-bottom"),i||s)){t.addClass("has-inner-alignment");let r=this.gridData;if(this.parent.logicalGrid&&(r=this.gridDataHints),i){let o=r.horizontalAlignment;t.addClass(o<0?"halign-left":o>0?"halign-right":"halign-center")}if(s){let o=r.verticalAlignment;t.addClass(o<0?"valign-top":o>0?"valign-bottom":"valign-middle")}this.invalidateLayout()}}addCellEditorFieldCssClasses(e,t){e.addClass("cell-editor-field").addClass(w.get().cssClassForEdge()),t.cssClass&&e.addClass(t.cssClass)}prepareForCellEdit(e){e=e||{},this.$mandatory&&this.removeMandatoryIndicator(),this.$status&&(this.$status.remove(),this.$status=null),this.$container&&this.$container.addClass("cell-editor-form-field"),this.$field&&this.addCellEditorFieldCssClasses(this.$field,e)}activateCellEditorMode(e){if(this.mode=A.Mode.CELLEDITOR,e?.column&&e?.row){let t=e.column.cell(e.row);this.gridData.horizontalAlignment=t.horizontalAlignment}}setDropType(e){this.setProperty("dropType",e)}_renderDropType(){this._installOrUninstallDragAndDropHandler()}setDropMaximumSize(e){this.setProperty("dropMaximumSize",e)}_installOrUninstallDragAndDropHandler(){z.installOrUninstallDragAndDropHandler(this._getDragAndDropHandlerOptions())}_getDragAndDropHandlerOptions(){return{target:this,doInstall:()=>this.dropType&&this.enabledComputed,container:()=>this.$field||this.$container,dropType:()=>this.dropType,onDrop:e=>this.trigger("drop",e)}}visitFields(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.visit(i=>{if(i instanceof A){let s=e(i);return u.nvl(t.firstLevelFieldsOnly,!1)&&this!==i?ye.SKIP_SUBTREE:s}return u.nvl(t.limitToSameFieldTree,!1)?ye.SKIP_SUBTREE:ye.CONTINUE},{visitSelf:t.visitSelf})}visitFirstChildFields(e){this.visitFields(t=>e(t),{firstLevelFieldsOnly:!0,visitSelf:!1})}visitParentFields(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.parent;for(;i;){if(i instanceof A)e(i);else if(u.nvl(t.limitToSameFieldTree,!1))return;i=i.parent}}markAsSaved(){this.visitFirstChildFields(e=>{e.markAsSaved()}),this._markAsSaved(),this.updateSaveNeeded()}_markAsSaved(){this.setProperty("touched",!1)}touch(){this.setProperty("touched",!0),this.updateSaveNeeded()}updateSaveNeeded(e){!this.initialized||this.destroying||this._setSaveNeeded(this.touched||this.checkSaveNeeded&&(e?.saveNeeded||this.computeSaveNeeded()))}_setSaveNeeded(e){this._setProperty("saveNeeded",e)&&this.getParentField()?.updateSaveNeeded(this)}setCheckSaveNeeded(e){this.setProperty("checkSaveNeeded",e)&&this.updateSaveNeeded()}computeSaveNeeded(){let e=!1;return this.visitFirstChildFields(t=>{if(!t.destroying&&t.saveNeeded)return e=!0,!0}),e}getValidationResult(){return this.validationResultProvider.provide(this._errorStatus())}_createValidationResultProvider(){return u.create(Ql,{field:this})}setValidationResultProvider(e){this.setProperty("validationResultProvider",e)}_setValidationResultProvider(e){u.assertParameter("provider",e),e=u.ensure(e,{field:this}),this._setProperty("validationResultProvider",e)}_updateEmpty(){this.setProperty("empty",this._computeEmpty())}_computeEmpty(){return!0}requestInput(){this.enabledComputed&&this.rendered&&this.focus()}clone(e,t){let i=super.clone(e,t);return this._deepCloneProperties(i,"menus",t),i}exportToClipboard(){if(!this.displayText)return;let e=this.trigger("clipboardExport",{text:this.displayText});e.defaultPrevented||this._exportToClipboard(e.text)}_exportToClipboard(e){li.copyText({parent:this,text:e})}_watchFieldHierarchy(e){this.initialized||this.on("hierarchyChange",this._hierarchyChangeHandler),e=u.nvl(e,this.parent),this._visitParentsUntilField(e,i=>i.on("hierarchyChange",this._hierarchyChangeHandler))?.updateSaveNeeded(this)}_unwatchFieldHierarchy(e){e=u.nvl(e,this.parent),this._visitParentsUntilField(e,i=>i.off("hierarchyChange",this._hierarchyChangeHandler))?.updateSaveNeeded()}_onHierarchyChange(e){this._unwatchFieldHierarchy(e.oldParent),this._watchFieldHierarchy(e.parent)}_visitParentsUntilField(e,t){for(;e;){if(e instanceof A)return e;t(e),e=e.parent}}}bg();class at extends K{enabledWhenOffline;_currentMenuTypes;constructor(){super(),this.enabledWhenOffline=!1,this._currentMenuTypes=[]}_initProperties(e){super._initProperties(e),this._currentMenuTypes=p.ensure(e.currentMenuTypes),delete e.currentMenuTypes}_syncCurrentMenuTypes(e){this._currentMenuTypes=p.ensure(e),this.widget._updateMenus()}_goOffline(){this.enabledWhenOffline||(this._enabledBeforeOffline=this.widget.enabled,this.widget.setEnabled(!1))}_goOnline(){this.enabledWhenOffline||this.widget.setEnabled(this._enabledBeforeOffline)}_onWidgetEvent(e){e.type==="drop"&&this.widget.dragAndDropHandler?this.widget.dragAndDropHandler.uploadFiles(e):super._onWidgetEvent(e)}static modifyFormFieldPrototype(){G.get().remote&&b.replacePrototypeFunction(A,A.prototype.getCurrentMenuTypes,at.getCurrentMenuTypes,!0)}static getCurrentMenuTypes(){let e=this.modelAdapter;return e?e._currentMenuTypes:this.getCurrentMenuTypesOrig()}}G.addListener("bootstrap",at.modifyFormFieldPrototype);class Kt extends ne{formField;mandatoryIndicatorWidth;statusWidth;rowHeight;compactFieldWidth;htmlPropertyChangeHandler;constructor(e){super(),this.formField=e,this._initDefaults(),this.htmlPropertyChangeHandler=this._onHtmlEnvironmentPropertyChange.bind(this),we.get().on("propertyChange",this.htmlPropertyChangeHandler),this.formField.one("remove",()=>{we.get().off("propertyChange",this.htmlPropertyChangeHandler)})}static COMPACT_FIELD_WIDTH=61;_initDefaults(){this.mandatoryIndicatorWidth=we.get().fieldMandatoryIndicatorWidth,this.statusWidth=we.get().fieldStatusWidth,this.rowHeight=we.get().formRowHeight,this.compactFieldWidth=Kt.COMPACT_FIELD_WIDTH}_onHtmlEnvironmentPropertyChange(){this._initDefaults(),this.formField.invalidateLayoutTree()}layout(e){let t,i,s=x.get(e),r=this.formField,o=this.labelWidth(),l=this.statusWidth,a=s.insets({includeBorder:!1}),d=a.top,c=a.right,f=a.bottom,g=a.left;if(this._isLabelVisible()){if((r.labelWidthInPixel===A.LabelWidth.UI||r.labelUseUiWidth)&&(r.$label.hasClass("empty")?o=0:o=C.prefSize(r.$label).width),u.isOneOf(r.labelPosition,A.LabelPosition.DEFAULT,A.LabelPosition.LEFT))C.setBounds(r.$label,g,d,o,this.rowHeight),g+=o+r.$label.cssMarginX();else if(r.labelPosition===A.LabelPosition.TOP){let y=C.prefSize(r.$label).height;r.$label.cssHeight(y),d+=y+r.$label.cssMarginY(),t=!0}}if(r.$mandatory&&r.$mandatory.isVisible()&&(r.$mandatory.cssTop(d).cssLeft(g).cssWidth(this.mandatoryIndicatorWidth),g+=r.$mandatory.outerWidth(!0)),this._isStatusVisible())if(r.$status.cssWidth(l),r.statusPosition===A.StatusPosition.TOP&&t){let y=C.prefSize(r.$status,{useCssSize:!0}).height,v=a.top+r.$label.cssPaddingTop()+r.$label.height()/2-y/2;r.$status.cssTop(v).cssRight(c+r.$label.cssMarginRight()).cssHeight(y);let D=C.size(r.$status,!0).width;r.$label.cssPaddingRight(D)}else r.$status.cssTop(d).cssRight(c).cssHeight(this.rowHeight),c+=l+r.$status.cssMarginX();if(r.$fieldContainer){let y=new We(d-a.top,c-a.right,f-a.bottom,g-a.left),v=C.margins(r.$fieldContainer),D=s.availableSize({exact:!0}).subtract(s.insets()).subtract(y).subtract(v);i=new te(g,d,D.width,D.height),r.$fieldContainer.css("position")!=="absolute"&&(i.x=0,i.y=0);let k=x.optGet(r.$fieldContainer);if(k?k.setBounds(i):C.setBounds(r.$fieldContainer,i),this.compactFieldWidth>-1&&(r.$field.toggleClass("compact",i.width<=this.compactFieldWidth),r.$container.toggleClass("compact",i.width<=this.compactFieldWidth)),t){let V=D.add(v).width-r.$label.cssMarginX();r.$mandatory&&r.$mandatory.isVisible()&&(V+=r.$mandatory.outerWidth(!0)),r.$label.cssWidth(V)}}if(r.$fieldContainer){let y=this._$elementForIconLayout(),v=C.borders(y),D=C.offsetBounds(y);d+=v.top,c+=v.right,i.x+=v.left,i.y+=v.top,i.height=D.height-v.top-v.bottom,i.width=D.width-v.left-v.right,r.$icon&&this._layoutIcon(r,i,c,d),r.$clearIcon&&this._layoutClearIcon(r,i,c,d)}r.$field&&P.update(r.$field,!0)}_isLabelVisible(){return!!this.formField.$label&&this.formField.labelVisible}_isStatusVisible(){return!!this.formField.$status&&(this.formField.statusVisible||this.formField.$status.isVisible())}preferredLayoutSize(e,t){let i=x.get(this.formField.$container),s=this.formField,r=new F,o=new F,l=new F,a=new F,d=u.nvl(t.widthHint,0),c=u.nvl(t.heightHint,0),f=s.statusPosition===A.StatusPosition.TOP&&this._isLabelVisible()&&s.labelPosition===A.LabelPosition.TOP;if(s.$mandatory&&s.$mandatory.isVisible()&&(o.width=this.mandatoryIndicatorWidth+s.$mandatory.cssMarginX(),d-=o.width),this._isLabelVisible()&&(r.width=this.labelWidth()+s.$label.cssMarginX(),r.height=this.rowHeight,s.labelPosition===A.LabelPosition.TOP?(r.width=0,r.height=C.prefSize(s.$label,!0).height):(s.labelWidthInPixel===A.LabelWidth.UI||s.labelUseUiWidth)&&(s.$label.hasClass("empty")?r.width=0:r=C.prefSize(s.$label,!0)),u.isOneOf(s.labelPosition,A.LabelPosition.DEFAULT,A.LabelPosition.LEFT)?d-=r.width:s.labelPosition===A.LabelPosition.TOP&&(c-=r.height)),this._isStatusVisible()&&(l.width=this.statusWidth+s.$status.cssMarginX(),f||(l.height=this.rowHeight,d-=l.width)),s.$fieldContainer){let y=C.margins(s.$fieldContainer),v=x.optGet(s.$fieldContainer);v||(d-=y.horizontal(),c-=y.vertical()),t.widthHint&&(t.widthHint=d),t.heightHint&&(t.heightHint=c),v?a=v.prefSize(t).add(y):a=C.prefSize(s.$fieldContainer,t).add(y)}let g=new F;return g.width=a.width,g.height=a.height,g.width+=o.width,g.height=Math.max(g.height,o.height),u.isOneOf(s.labelPosition,A.LabelPosition.DEFAULT,A.LabelPosition.LEFT)?(g.width+=r.width,g.height=Math.max(g.height,r.height)):s.labelPosition===A.LabelPosition.TOP&&(g.width=Math.max(g.width,r.width),g.height+=r.height),f||(g.width+=l.width,g.height=Math.max(g.height,l.height)),g=g.add(i.insets()),g}_$elementForIconLayout(){return this.formField.$field}_layoutIcon(e,t,i,s){let r=this.rowHeight;t&&(r=t.height),e.$icon.cssRight(i).cssTop(t.y).cssHeight(r)}_layoutClearIcon(e,t,i,s){let r=this.rowHeight;t&&(r=t.height),e instanceof Ro&&e.gridData.horizontalAlignment>0?e.$clearIcon.cssLeft(t.x).cssRight("").cssTop(t.y).cssHeight(r):e.$clearIcon.cssLeft("").cssRight(i).cssTop(t.y).cssHeight(r)}labelWidth(){return A.LabelWidth.DEFAULT===this.formField.labelWidthInPixel?we.get().fieldLabelWidth:this.formField.labelWidthInPixel}}class Ql{field;objectType;init(e){u.assertProperty(e,"field"),$.extend(this,e)}provide(e){const t=!e||e.isValid(),i=!this.field.mandatory||!this.field.empty;return{valid:t&&i,validByMandatory:i,errorStatus:e,field:this.field,label:this.field.label,reveal:()=>{oe.selectAllParentTabsOf(this.field),this.field.focus()}}}}class yg extends I{codes;severities;menu;constructor(){super(),this.codes=[],this.severities=[],this.menu=null,this._addWidgetProperties(["menu"])}_createChild(e){if(typeof e=="string"){let t=this.parent.widget(e);if(!t)throw new Error("Referenced widget not found: "+e);return t}return super._createChild(e)}}class wg extends K{}class ar extends A{setFieldStyle(e){this.getFields().forEach(t=>t.setFieldStyle(e)),super.setFieldStyle(e)}activate(){oe.activateFirstField(this,this.getFields())}getFocusableElement(){let e=Fe.findFirstFocusableWidget(this.getFields(),this);return e?e.getFocusableElement():null}}class Rn extends at{constructor(){super(),this.enabledWhenOffline=!0}}class ge extends A{clearable;formatter;hasText;initialValue;invalidValueMessageKey;parser;value;validators;_updateDisplayTextPending;constructor(){super(),this.defaultMenuTypes=[...this.defaultMenuTypes,ge.MenuType.NotNull,ge.MenuType.Null],this.clearable=ge.Clearable.FOCUSED,this.displayText=null,this.formatter=this._formatValue.bind(this),this.hasText=!1,this.initialValue=null,this.invalidValueMessageKey="InvalidValueMessageX",this.parser=this._parseValue.bind(this),this.value=null,this.validators=[],this.validators.push(this._validateValue.bind(this)),this._updateDisplayTextPending=!1,this.$clearIcon=null,this._addCloneProperties(["value","displayText","clearable"])}static Clearable={ALWAYS:"always",FOCUSED:"focused",NEVER:"never"};static MenuType={Null:"ValueField.Null",NotNull:"ValueField.NotNull"};_init(e){super._init(e),e.validator&&(this.setValidator(e.validator),delete e.validator),this._initValue(this.value),this.initialValue=this.value}_initValue(e){this.value=null,this._setValue(e),this._updateEmpty()}_renderProperties(){super._renderProperties(),this._renderDisplayText(),this._renderClearable(),this._renderHasText()}_remove(){super._remove(),this.$clearIcon=null}_renderDisplayText(){this._updateHasText()}_readDisplayText(){return u.nvl(this.displayText,"")}_onClearIconMouseDown(e){this.clear(),e.preventDefault()}_onFieldBlur(e){super._onFieldBlur(e),this.acceptInput(!1)}acceptInput(e){e=!!e;let t=u.nvl(this._readDisplayText(),"");this._checkDisplayTextChanged(t,e)&&(this._setProperty("displayText",t),e||this.parseAndSetValue(t),this._triggerAcceptInput(e))}parseAndSetValue(e){this.removeErrorStatus(di);try{if(!this.trigger("parse",{displayText:e}).defaultPrevented){let i=this.parseValue(e);this.setValue(i)}}catch(t){this._parsingFailed(e,t)}}_parsingFailed(e,t){h().log.isDebugEnabled()&&h().log.debug("Parsing failed for field with id "+this.id,t),this.trigger("parseError",{displayText:e,error:t}).defaultPrevented||this._addParsingFailedErrorStatus(e,t)}_addParsingFailedErrorStatus(e,t){let i=this._createParsingFailedStatus(e,t);this.addErrorStatus(i)}_createParsingFailedStatus(e,t){return this._createInvalidValueStatus("ParsingFailedStatus",e,t)}setParser(e){this.setProperty("parser",e),this.initialized&&this.parseAndSetValue(this.displayText)}_setParser(e){e||(e=this._parseValue.bind(this)),this._setProperty("parser",e)}parseValue(e){let t=this._parseValue.bind(this);return this.parser(e,t)}_parseValue(e){return e}_checkDisplayTextChanged(e,t){let i=u.nvl(this.displayText,"");return e!==i}aboutToBlurByMouseDown(e){this.isFocusOnField(e)||this.acceptInput()}isFocused(){return this.rendered&&Qe.isActiveElement(this.$field)}isFocusOnField(e){return this.$field.isOrHas(e)||this.$clearIcon&&this.$clearIcon.isOrHas(e)}_triggerAcceptInput(e){let t={displayText:this.displayText,whileTyping:!!e};this.trigger("acceptInput",t)}setDisplayText(e){this.setProperty("displayText",e)}_updateHasText(){this.setHasText(_.hasText(this._readDisplayText()))}setHasText(e){this.setProperty("hasText",e)}_renderHasText(){this.$field&&this.$field.toggleClass("has-text",this.hasText),this.$container.toggleClass("has-text",this.hasText)}setClearable(e){this.setProperty("clearable",e)}_renderClearable(){this.isClearable()?this.$clearIcon||this.addClearIcon():this.$clearIcon&&(this.$clearIcon.remove(),this.$clearIcon=null),this.invalidateLayoutTree(!1),this._updateClearableStyles()}_updateClearableStyles(){this.$container.removeClass("clearable-always clearable-focused"),this.isClearable()&&(this.clearable===ge.Clearable.ALWAYS?this.$container.addClass("clearable-always"):this.clearable===ge.Clearable.FOCUSED&&this.$container.addClass("clearable-focused"))}isClearable(){return this.clearable===ge.Clearable.ALWAYS||this.clearable===ge.Clearable.FOCUSED}clear(){this._clear(),this._updateHasText(),this.acceptInput(),this._triggerClear()}_clear(){}_triggerClear(){this.trigger("clear")}setValue(e){e=this._prepareProperty("value",e),this.rendered&&this._callRemoveProperty("value"),this._callSetProperty("value",e),this.rendered&&this._callRenderProperty("value")}resetValue(){this.setValue(this.initialValue)}_ensureValue(e){return e}_setValue(e){this.initialized&&(this.removeErrorStatus(di),this.removeErrorStatus(nn));let t=this.value,i=null;try{i=this._ensureValue(e)}catch(s){this._ensureValueFailed(e,s);return}try{this.value=this.validateValue(i)}catch(s){this._validationFailed(i,s);return}this._updateDisplayText(),!this._valueEquals(t,this.value)&&(this._valueChanged(),this._updateMenus(),this._updateEmpty(),this.updateSaveNeeded(),this.triggerPropertyChange("value",t,this.value))}_valueEquals(e,t){return Array.isArray(e)&&Array.isArray(t)?p.equals(e,t):b.equals(e,t)}_valueChanged(){}_getCurrentMenuTypes(){return b.isNullOrUndefined(this.value)?[...super._getCurrentMenuTypes(),ge.MenuType.Null]:[...super._getCurrentMenuTypes(),ge.MenuType.NotNull]}validate(){this._setValue(this.value)}addValidator(e,t){let i=this.validators.slice();i.push(e),this.setValidators(i,t)}removeValidator(e,t){let i=this.validators.slice();p.remove(i,e),this.setValidators(i,t)}setValidator(e,t){e||(e=this._validateValue.bind(this));let i=[];e&&(i=[e]),this.setValidators(i,t)}setValidators(e,t){this.setProperty("validators",e),this.initialized&&u.nvl(t,!0)&&this.validate()}validateValue(e){let t=this._validateValue.bind(this);return this.validators.forEach(i=>{e=i(e,t)}),e=u.nvl(e,null),e}_validateValue(e){return typeof e=="string"&&e===""&&(e=null),e}_validationFailed(e,t){h().log.isDebugEnabled()&&h().log.debug("Validation failed for field with id "+this.id,t);let i=this._createValidationFailedStatus(e,t);this.addErrorStatus(i),this._updateDisplayText(e)}_ensureValueFailed(e,t){h().log.isDebugEnabled()&&h().log.debug("EnsureValue failed for field with id "+this.id,t);let i=this._createValidationFailedStatus(e,t);this.addErrorStatus(i),this.setDisplayText(this._formatRawValue(e))}_formatRawValue(e){return e+""}_createValidationFailedStatus(e,t){return this._createInvalidValueStatus("ValidationFailedStatus",e,t)}_createInvalidValueStatus(e,t,i){let s=E.classForName(e);if(i instanceof s)return i;let r,o=E.Severity.ERROR;return i instanceof E?(r=i.message,o=i.severity):typeof i=="string"?r=i:r=this.session.text(this.invalidValueMessageKey,t),u.create(e,{message:r,severity:o})}_updateDisplayText(e){if(!this.initialized&&!b.isNullOrUndefined(this.displayText))return;e=u.nvl(e,this.value);let t=this.formatValue(e);b.isPromise(t)?(this._updateDisplayTextPending=!0,t.done(i=>this.setDisplayText(i)).fail(()=>{this._updateDisplayTextPending&&this.setDisplayText(""),h().log.isInfoEnabled()&&h().log.info("Could not resolve display text for value: "+e)}).always(()=>{this._updateDisplayTextPending=!1})):(this.setDisplayText(t),this._updateDisplayTextPending=!1)}setFormatter(e){this.setProperty("formatter",e),this.initialized&&this.validate()}_setFormatter(e){e||(e=this._formatValue.bind(this)),this._setProperty("formatter",e)}formatValue(e){let t=this._formatValue.bind(this);return this.formatter(e,t)}_formatValue(e){return u.nvl(e,"")+""}computeSaveNeeded(){return this._hasValueChanged()?!0:super.computeSaveNeeded()}_hasValueChanged(){return!this._valueEquals(this.value,this.initialValue)}addClearIcon(e){e||(e=this.$container),this.$clearIcon=e.appendSpan("clear-icon unfocusable text-field-icon action").on("mousedown",this._onClearIconMouseDown.bind(this)),T.role(this.$clearIcon,"button"),T.label(this.$clearIcon,this.session.text("ui.ClearField"))}addContainer(e,t,i){super.addContainer(e,t,i),this.$container.addClass("value-field")}addField(e){super.addField(e),this.$field.data("valuefield",this)}_markAsSaved(){super._markAsSaved(),this.initialValue=this.value}_computeEmpty(){return this.value===null||this.value===void 0||Array.isArray(this.value)&&p.empty(this.value)}static invokeValueFieldAboutToBlurByMouseDown(e){let t=this._getActiveValueField(e);t&&t.aboutToBlurByMouseDown(e)}static invokeValueFieldAcceptInput(e){let t=this._getActiveValueField(e);t&&t.acceptInput()}static _getActiveValueField(e){let t=h()(e).activeElement(),i=u.widget(t);if(i instanceof ge)return i.enabledComputed?i:null;const s=i&&i.findParent(r=>r instanceof ge);return s&&s.enabledComputed?s:null}}class At extends at{_onWidgetAcceptInput(e){this._send("acceptInput",{displayText:e.displayText,whileTyping:e.whileTyping},{showBusyIndicator:!e.whileTyping,coalesce:function(t){return this.target===t.target&&this.type===t.type&&this.whileTyping===t.whileTyping}})}_onWidgetEvent(e){e.type==="acceptInput"?this._onWidgetAcceptInput(e):super._onWidgetEvent(e)}exportAdapterData(e){return e=super.exportAdapterData(e),delete e.displayText,e}_syncDisplayText(e){this.widget.setDisplayText(e),this.widget.parseAndSetValue(e)}}class Vu extends B{constructor(e){super(),this.field=e,this.which=[m.ENTER],this.renderingHints.render=!1,this.preventDefault=!1,this.preventInvokeAcceptInputOnActiveValueField=!0}handle(e){this.field.acceptInput()}}class Ro extends ge{updateDisplayTextOnModify;updateDisplayTextOnModifyDelay;_displayTextModifiedTimeoutId;_displayTextChangedWhileTyping;constructor(){super(),this._displayTextModifiedTimeoutId=null,this.updateDisplayTextOnModify=!1,this.updateDisplayTextOnModifyDelay=250}addField(e){super.addField(e),e&&e.on("input",this._onFieldInput.bind(this))}setUpdateDisplayTextOnModify(e){this._displayTextModifiedTimeoutId!==null&&(clearTimeout(this._displayTextModifiedTimeoutId),this._acceptInputWhileTyping()),this.setProperty("updateDisplayTextOnModify",e)}setUpdateDisplayTextOnModifyDelay(e){this.setProperty("updateDisplayTextOnModifyDelay",e)}_clear(){this.$field&&this.$field.val("")}_onFieldInput(){this._updateHasText(),this.updateDisplayTextOnModify&&this._onDisplayTextModified()}_onDisplayTextModified(){clearTimeout(this._displayTextModifiedTimeoutId),this.updateDisplayTextOnModifyDelay?this._displayTextModifiedTimeoutId=setTimeout(this._acceptInputWhileTyping.bind(this),this.updateDisplayTextOnModifyDelay):this._acceptInputWhileTyping()}_acceptInputWhileTyping(){this._displayTextModifiedTimeoutId=null,this.rendered&&this.acceptInput(!0)}acceptInput(e){this._displayTextModifiedTimeoutId!==null&&(clearTimeout(this._displayTextModifiedTimeoutId),this._displayTextModifiedTimeoutId=null),super.acceptInput(e)}_renderDisplayText(){this.$field.val(this.displayText),super._renderDisplayText()}_readDisplayText(){return this.$field?this.$field.val():""}_checkDisplayTextChanged(e,t){let i=super._checkDisplayTextChanged(e,t);return t?this.updateDisplayTextOnModify&&i&&(this._displayTextChangedWhileTyping=!0):(this._displayTextChangedWhileTyping&&(i=!0),this._displayTextChangedWhileTyping=!1),i}}class Zl extends At{constructor(){super(),this.enabledWhenOffline=!0}}class Cg extends A{scrollable;fieldWidget;constructor(){super(),this.scrollable=!0,this.fieldWidget=null,this._addWidgetProperties(["fieldWidget"])}_init(e){super._init(e)}_render(){this.addContainer(this.$parent,"widget-field",new Wu(this)),this.addLabel(),this.addMandatoryIndicator(),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderFieldWidget(),this._renderScrollable()}setFieldWidget(e){this.setProperty("fieldWidget",e)}_renderFieldWidget(){this.fieldWidget&&(this.fieldWidget.render(),this.addField(this.fieldWidget.$container),this.invalidateLayoutTree())}_removeFieldWidget(){this.fieldWidget&&(this.fieldWidget.remove(),this._removeField(),this.invalidateLayoutTree())}setScrollable(e){this.setProperty("scrollable",e)}_renderScrollable(){this._uninstallScrollbars(),this.scrollable&&this._installScrollbars()}get$Scrollable(){return this.$fieldContainer}}class Tg extends at{}class Wu extends Kt{constructor(e){super(e)}layout(e){super.layout(e),P.update(this.formField.$fieldContainer)}}class An extends ge{filterBox;lookupCall;codeType;lookupStatus;_currentLookupCall;_lookupExecuted;_valueSyncing;constructor(){super(),this.filterBox=null,this.gridDataHints.weightY=1,this.gridDataHints.h=2,this.value=[],this.clearable=ge.Clearable.NEVER,this.lookupCall=null,this._currentLookupCall=null,this._lookupExecuted=!1,this._valueSyncing=!1,this._addCloneProperties(["lookupCall"])}static ErrorCode={NO_DATA:1};_init(e){super._init(e),this.filterBox&&(this.filterBox.enabledComputed=!0,this.filterBox.recomputeEnabled(!0),this.filterBox.on("propertyChange",this._onFilterBoxPropertyChange.bind(this)))}_initValue(e){this.lookupCall&&this._setLookupCall(this.lookupCall),this._setCodeType(this.codeType),this._initStructure(e),super._initValue(e)}_render(){this.addContainer(this.$parent,"lookup-box"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this.addFieldContainer(this.$parent.makeDiv()),x.install(this.$fieldContainer,this.session).setLayout(this._createFieldContainerLayout()),this._ensureLookupCallExecuted(),this._renderStructure(),this.$field.addDeviceClass(),this.$field.addClass("structure"),this._renderFilterBox(),this.$container.css("--inactive-lookup-row-suffix-text",`'${this.session.text("InactiveState")}'`)}_renderFilterBox(){!this.filterBox||!this.filterBox.visible||this.filterBox.render(this.$fieldContainer)}_ensureValue(e){return p.ensure(e)}_lookupByAll(){if(!this.lookupCall)return;let e=h().Deferred();return this._executeLookup(this.lookupCall.cloneForAll(),!0).done(t=>{this._lookupByAllDone(t),e.resolve(t)}),e.promise()}_executeLookup(e,t){return this.setLoading(!0),t&&this._currentLookupCall&&this._currentLookupCall.abort(),this._currentLookupCall=e,this.trigger("prepareLookupCall",{lookupCall:e}),e.execute().always(()=>{this._currentLookupCall=null,this._lookupExecuted=!0,this.setLoading(!1),this._clearLookupStatus()})}_lookupByAllDone(e){try{e.exception&&this.setLookupStatus(E.warning({message:e.exception}))}finally{this.trigger("lookupCallDone",{result:e})}}_errorStatus(){return this.lookupStatus||this.errorStatus}setLookupStatus(e){this.setProperty("lookupStatus",e),this.rendered&&this._renderErrorStatus()}clearErrorStatus(){this.setErrorStatus(null),this._clearLookupStatus()}_clearLookupStatus(){this.setLookupStatus(null)}setLookupCall(e){this.setProperty("lookupCall",e)}_setLookupCall(e){this._setProperty("lookupCall",Pt.ensure(e,this.session)),this._lookupExecuted=!1,this.rendered&&this._ensureLookupCallExecuted()}setCodeType(e){this.setProperty("codeType",e)}_setCodeType(e){if(this._setProperty("codeType",e),!e)return;let t=u.create(ro,{session:this.session,codeType:e});this.setLookupCall(t)}refreshLookup(){this._lookupExecuted=!1,this._ensureLookupCallExecuted()}_ensureLookupCallExecuted(){return this._lookupExecuted?!1:(this._lookupByAll(),!0)}_formatValue(e){return b.isNullOrUndefined(e)?"":this._formatLookupRows(this.getCheckedLookupRows())}_formatLookupRows(e){if(e=p.ensure(e),e.length===0)return"";let t=[];return e.forEach(i=>t.push(i.text)),_.join(", ",...t)}_clear(){this.setValue(null)}_onFilterBoxPropertyChange(e){if(e.propertyName==="visible"){if(!this.rendered)return;this.filterBox.visible?this._renderFilterBox():this.filterBox.remove()}}}class ea extends ne{box;structure;filterBox;constructor(e,t,i){super(),this.box=e,this.structure=t,this.filterBox=i}layout(e){let t=x.get(e),i=t.size(),s=i.height,r;this.filterBox&&this.filterBox.rendered&&(r=x.get(this.filterBox.$container).prefSize().height,s-=r),s=Math.max(s,20),x.get(this.structure.$container).setSize(new F(i.width,s)),this.filterBox&&this.filterBox.rendered&&x.get(this.filterBox.$container).setSize(new F(i.width,r))}preferredLayoutSize(e,t){t=t||{};let i,s=0,r=x.get(e),o=we.get().formRowHeight,l=this.box;t.heightHint=null,l.$label&&l.labelVisible&&(s+=we.get().fieldLabelWidth),l.$mandatory&&l.$mandatory.isVisible()&&(s+=l.$mandatory.outerWidth(!0)),l.$status&&l.statusVisible&&(s+=l.$status.outerWidth(!0));let a=x.optGet(this.structure.$container);a?i=a.prefSize(t).add(r.insets()).add(a.margins()):i=this.naturalSize(l);let d=new F(0,0);if(this.filterBox){let c=x.optGet(this.filterBox.$container);c&&(d=c.prefSize(t).add(r.insets()).add(c.margins()))}return s+=Math.max(i.width,d.width),o=Math.max(o,i.height+d.height),new F(s,o)}naturalSize(e){return new F(e.$fieldContainer.width(),e.$fieldContainer.height())}}class Ao extends bo{registerAndRender(e,t,i){u.assertProperty(e,"displayParent"),e.isPopupWindow()?this._renderPopupWindow(e):e.isView()?this._renderView(e,!0,t,i):this._renderDialog(e,!0)}isFormShown(e){return e.isView()?this.displayParent.views.includes(e):this.displayParent.dialogs.includes(e)}_renderPopupWindow(e,t){throw new Error("popup window only supported by DesktopFormController")}unregisterAndRemove(e){e&&(e.isPopupWindow()?this._removePopupWindow(e):e.isView()?this._removeView(e):this._removeDialog(e))}_removePopupWindow(e){throw new Error("popup window only supported by DesktopFormController")}render(){this._renderViews(),this._renderDialogs()}_renderViews(){this.displayParent.views.forEach((e,t)=>{e.setDisplayParent(this.displayParent),this._renderView(e,!1,t,!1)})}_renderDialogs(){this.displayParent.dialogs.forEach(e=>{e.setDisplayParent(this.displayParent),this._renderDialog(e,!1)})}remove(){this.displayParent.dialogs.forEach(e=>{this._removeDialog(e,!1)}),this.displayParent.views.forEach((e,t)=>{this._removeView(e,!1,!1)})}activateForm(e){if(!e){this.session.desktop._setFormActivated(null);return}let t=!1;if(e.dialogs.forEach(s=>{s.modal&&(this.activateForm(s),t=!0)}),t)return;let i=this.displayParent;for(;i;){if(i instanceof bi){this.session.desktop.setOutline(i);break}i=i instanceof j?i.displayParent:null}this._activateForm(e)}_activateForm(e){e.displayHint===j.DisplayHint.VIEW?this._activateView(e):this._activateDialog(e),this.session.desktop._setFormActivated(e)}_renderView(e,t,i,s){if(e.rendered||e.blockRendering)return;if(t&&this._registerView(e,i),this.displayParent.acceptView){if(!this.displayParent.acceptView(e))return}else if(!this.acceptView(e))return;let r=this.session.desktop;if(r.displayStyle===Ie.DisplayStyle.COMPACT&&!r.bench)r.sendOutlineToBack(),r.switchToBench(!e.headerVisible);else if(r.bench.removalPending){setTimeout(this._renderView.bind(this,e,t,i,s));return}r.bench.addView(e,s)}acceptDialog(e){return this.displayParent.rendered}_renderDialog(e,t){if(e.rendered||e.blockRendering)return;if(t&&this._registerDialog(e),this.displayParent.acceptDialog){if(!this.displayParent.acceptDialog(e))return}else if(!this.acceptDialog(e))return;let i=this.session.desktop;e.on("remove",s=>{let r=this._findFormToActivateAfterDialogRemove(s.source);r?i._setFormActivated(r):i._setOutlineActivated()}),e.isPopupWindow()?this._renderPopupWindow(e):(e.setTrackFocus(!0),e.render(i.$container),this._layoutDialog(e),i._setFormActivated(e),this.displayParent.inFront()||e.detach())}_findFormToActivateAfterDialogRemove(e){const t=this.displayParent.dialogs.filter(s=>s!==e);if(t.length>0)return t[t.length-1];if(this.displayParent instanceof j&&!this.displayParent.detailForm)return this.displayParent;let i=this.session.desktop;if(i.bench){let s=i.bench.activeViews()[0];if(s instanceof j&&!s.detailForm)return s}}_removeView(e,t,i){t=u.nvl(t,!0),t&&this._unregisterView(e),this.session.desktop.bench&&this.session.desktop.bench.removeView(e,i)}_removeDialog(e,t){t=u.nvl(t,!0),t&&this._unregisterDialog(e),e.rendered&&e.remove()}_activateView(e){let t=this.session.desktop.bench;t&&t.activateView(e)}_activateDialog(e){if(e.displayParent instanceof j&&(e.displayParent.displayHint===j.DisplayHint.VIEW||e.displayParent.displayHint===j.DisplayHint.DIALOG&&e.modal)&&this._activateForm(e.displayParent),!e.rendered)return;let t=e.$container.nextAll().toArray(),i=t.filter(function(r){let o=u.widget(r);return o instanceof j&&(!o.modal||!e.has(o)&&o.displayParent!==this.session.desktop)},this),s=t.filter(r=>p.find(i,o=>{let l=u.widget(r);return!(l instanceof j)&&u.widget(o).has(l)}));i=i.concat(s),this.session.desktop.moveOverlaysBehindAndFocus(i,e.$container)}attachDialogs(){this.displayParent.dialogs.forEach(e=>{e.attach()})}detachDialogs(){this.displayParent.dialogs.forEach(e=>{e.detach()})}_layoutDialog(e){e.htmlComp.validateLayout(),e.position(),this.session.focusManager.validateFocus(),e.animateOpening&&e.$container.addClassForAnimation("animate-open")}_registerDialog(e){this._registerChild(e,"dialogs")}_unregisterDialog(e){this._unregisterChild(e,"dialogs")}_registerView(e,t){this._registerChild(e,"views",t)}_unregisterView(e){this._unregisterChild(e,"views")}}class jt extends I{severity;body;iconId;header;hiddenText;html;yesButtonText;noButtonText;cancelButtonText;buttons;boxButtons;yesButton;noButton;cancelButton;displayParent;abortButton;$content;$header;$body;$html;$hiddenText;$buttons;_icon;_glassPaneRenderer;constructor(){super(),this.severity=E.Severity.INFO,this.body=null,this.iconId=null,this.header=null,this.hiddenText=null,this.html=null,this.yesButtonText=null,this.noButtonText=null,this.cancelButtonText=null,this.displayParent=null,this.buttons=[],this.boxButtons=null,this.yesButton=null,this.noButton=null,this.cancelButton=null,this.abortButton=null,this.inheritAccessibility=!1,this.$content=null,this.$header=null,this.$body=null,this.$hiddenText=null,this.$buttons=null,this.$html=null,this._icon=null,this._addWidgetProperties(["buttons","boxButtons","yesButton","noButton","cancelButton","abortButton"])}static Buttons={YES:"yes",NO:"no",CANCEL:"cancel"};_init(e){super._init(e),this._setDisplayParent(this.displayParent),this._setIconId(this.iconId),this.boxButtons=u.create(po,{parent:this}),this.yesButton=this._createMessageBoxButton(this.yesButtonText,jt.Buttons.YES),this.noButton=this._createMessageBoxButton(this.noButtonText,jt.Buttons.NO),this.cancelButton=this._createMessageBoxButton(this.cancelButtonText,jt.Buttons.CANCEL)}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new Uu(this),new fl(this.session,this),new co(this,[m.SPACE,m.ENTER]),new gl(this,()=>this.abortButton?this.abortButton.$container:null)])}_createMessageBoxButton(e,t){if(!e)return null;let i=this.boxButtons.addButton({text:e});return i.one("action",s=>this._onButtonClick(s,t)),this.buttons.push(i),this.abortButton=i,i}_render(){this.$container=this.$parent.appendDiv("messagebox").on("mousedown",this._onMouseDown.bind(this)).on("copy",this._onCopy.bind(this)),T.role(this.$container,"alertdialog");let e=this.$container.appendDiv("drag-handle");this.$container.draggable(e),this.$content=this.$container.appendDiv("messagebox-content"),this.$header=this.$content.appendDiv("messagebox-label messagebox-header"),this.$body=this.$content.appendDiv("messagebox-label messagebox-body"),this.$html=this.$content.appendDiv("messagebox-label messagebox-html prevent-initial-focus"),this.boxButtons.render(),this.$buttons=this.boxButtons.$container,this.$buttons.addClass("messagebox-buttons"),this.$buttons.on("copy",this._onCopy.bind(this)),this._installScrollbars({axis:"y",scrollShadow:"none"}),this._renderSeverity(),this._renderHeader(),this._renderIconId(),this._renderBody(),this._renderHtml(),this._renderHiddenText(),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new zu(this)),this.htmlComp.validateLayout(),this.$container.addClassForAnimation("animate-open"),this._glassPaneRenderer=new Fr(this),this._glassPaneRenderer.renderGlassPanes()}get$Scrollable(){return this.$content}_postRender(){super._postRender(),this._installFocusContext()}_remove(){this._glassPaneRenderer.removeGlassPanes(),this._uninstallFocusContext(),super._remove()}_installFocusContext(){this.session.focusManager.installFocusContext(this.$container,Et.AUTO)}_uninstallFocusContext(){this.session.focusManager.uninstallFocusContext(this.$container)}_renderIconId(){let e=!!this._icon;this.$container.toggleClass("has-icon",e),this.$container.toggleClass("no-icon",!e),e&&(this._icon.render(this.$header),this._icon.$container.addClass("messagebox-icon"))}_renderSeverity(){this.$container.removeClass(E.SEVERITY_CSS_CLASSES),this.$container.addClass(E.cssClassForSeverity(this.severity))}_renderHeader(){this.$header.html(_.nl2br(this.header)),this.$header.setVisible(!!this.header||!!this.iconId),this.$header.toggleClass("has-text",_.hasText(this.header)),_.hasText(this.header)&&T.linkElementWithLabel(this.$container,this.$header)}_renderBody(){this.$body.html(_.nl2br(this.body)),this.$body.setVisible(!!this.body),this.$content.toggleClass("has-body",!!this.body),_.hasText(this.body)&&T.linkElementWithDescription(this.$container,this.$body)}_renderHtml(){this.$html.html(this.html),this.$html.setVisible(!!this.html),this.$html.find("a, .app-link").attr("tabindex","0").unfocusable(),_.hasText(this.html)&&T.linkElementWithDescription(this.$container,this.$html)}_renderHiddenText(){this.$hiddenText&&this.$hiddenText.remove(),this.hiddenText&&(this.$hiddenText=this.$content.appendElement(`<!--
`+this.hiddenText.replace(/<!--|-->/g,"")+`
-->`))}_onMouseDown(){let e=this.findParent(t=>t instanceof j&&t.isDialog());e&&e.activate()}_setCopyable(e){this.$header.toggleClass("copyable",e),this.$body.toggleClass("copyable",e),this.$html.toggleClass("copyable",e)}copy(){this._setCopyable(!0);let e=this.$container.document(!0),t=e.createRange();t.selectNodeContents(this.$content[0]);let i=this.$container.window(!0).getSelection();i.removeAllRanges(),i.addRange(t),e.execCommand("copy")}_onCopy(e){let t=b.optProperty(e,"originalEvent","clipboardData");if(t){let i=_.join("<br/>",this.$header[0].outerHTML,this.$body[0].outerHTML,this.$html[0].outerHTML,this.hiddenText);t.setData("text/html",i);let s=_.join(`
`,this.header,this.body,_.plainText(this.$html[0].outerHTML,{compact:!0,trim:!0}),this.hiddenText);t.setData("text/plain",s),this.$container.window(!0).getSelection().removeAllRanges(),this._setCopyable(!1),li.showNotification(this),e.preventDefault()}}_onButtonClick(e,t){this.trigger("action",{option:t})}setDisplayParent(e){this.setProperty("displayParent",e)}_setDisplayParent(e){this._setProperty("displayParent",e),e&&this.setParent(this.findDesktop().computeParentForDisplayParent(e))}setIconId(e){this.setProperty("iconId",e)}_setIconId(e){this._setProperty("iconId",e),e?this._icon?this._icon.setIconDesc(e):(this._icon=u.create(Es,{parent:this,iconDesc:e,prepend:!0}),this._icon.one("destroy",()=>{this._icon=null})):this._icon&&this._icon.destroy()}open(){this.setDisplayParent(this.displayParent||this.session.desktop),this.displayParent.messageBoxController.registerAndRender(this)}close(){this.displayParent&&this.displayParent.messageBoxController.unregisterAndRemove(this),this.destroy()}abort(){this.abortButton&&this.abortButton.$container&&this.session.focusManager.requestFocus(this.abortButton.$container)&&this.abortButton.doAction()}_attach(){this.$parent.append(this.$container),super._attach()}_detach(){this.$container.detach(),super._detach()}}class vg extends K{_onWidgetAction(e){this._send("action",{option:e.option})}_onWidgetEvent(e){e.type==="action"?this._onWidgetAction(e):super._onWidgetEvent(e)}}class $o extends bo{remove(){this.displayParent.messageBoxes.forEach(this._remove.bind(this))}render(){this.displayParent.messageBoxes.forEach(e=>{e.setDisplayParent(this.displayParent),this._render(e)})}attach(){this.displayParent.messageBoxes.forEach(e=>e.attach())}detach(){this.displayParent.messageBoxes.forEach(e=>e.detach())}_register(e){this._registerChild(e,"messageBoxes")}_unregister(e){this._unregisterChild(e,"messageBoxes")}}class Ri{objectType;parent;yesText;noText;cancelText;bodyText;severity;headerText;iconId;closeOnClick;html;constructor(){this.parent=null,this.yesText=null,this.noText=null,this.cancelText=null,this.bodyText=null,this.severity=E.Severity.INFO,this.headerText=null,this.iconId=null,this.closeOnClick=!0,this.html=!1}init(e){u.assertParameter("parent",e.parent),h().extend(this,e)}withHeader(e){return this.headerText=e,this}withBody(e,t){return this.bodyText=e,this.html=u.nvl(t,!1),this}withIconId(e){return this.iconId=e,this}withSeverity(e){return this.severity=u.nvl(e,E.Severity.INFO),this}withYes(e){return this.yesText=u.nvl(e,this.parent.session.text("Yes")),this}withNo(e){return this.noText=u.nvl(e,this.parent.session.text("No")),this}withCancel(e){return this.cancelText=u.nvl(e,this.parent.session.text("Cancel")),this}build(){let e={parent:this.parent,header:this.headerText,body:this.bodyText,severity:this.severity};return _.hasText(this.iconId)&&(e.iconId=this.iconId),_.hasText(this.yesText)&&(e.yesButtonText=this.yesText),_.hasText(this.noText)&&(e.noButtonText=this.noText),_.hasText(this.cancelText)&&(e.cancelButtonText=this.cancelText),this.html&&(e.html=e.body,delete e.body),u.create(jt,e)}buildAndOpen(){let e=h().Deferred(),t=this.build();return t.on("action",i=>{this.closeOnClick&&t.close(),e.resolve(i.option)}),t.open(),e.promise()}static create(e){return u.create(Ri,{parent:e})}static createOk(e){return this.create(e).withYes(e.session.text("Ok"))}static createYesNo(e){return this.create(e).withYes().withNo()}static createYesNoCancel(e){return this.create(e).withYes().withNo().withCancel()}static openOk(e,t,i){return this.createOk(e).withBody(t).withSeverity(i).buildAndOpen()}static openYesNo(e,t,i){return this.createYesNo(e).withBody(t).withSeverity(i).buildAndOpen()}}class zu extends ne{messageBox;constructor(e){super(),this.messageBox=e}layout(e){let t=x.get(e),i=e.windowSize(),s=t.offsetBounds(!0),r=t.size(),o=t.margins();r=Qi.fitContainerInWindow(i,s.point(),r,o),e.toggleClass("full-width",s.x===0&&o.horizontal()===0&&i.width===r.width).toggleClass("full-height",s.y===0&&o.vertical()===0&&i.height===r.height),C.setSize(e,r);let l=C.size(this.messageBox.$buttons,{exact:!0});this.messageBox.$content.css("height","calc(100% - "+l.height+"px)"),P.update(this.messageBox.$content),e.cssPosition(Qi.positionContainerInWindow(e))}}class Uu extends B{constructor(e){super(),this.field=e,this.which=[m.C],this.ctrl=!0,this.preventDefault=!1,this.renderingHints.render=!0,this.renderingHints.$drawingArea=(t,i)=>e.$container}handle(e){this.field.copy()}}class Sg extends A{accordion;eventDelegator;constructor(){super(),this.accordion=null,this.eventDelegator=null,this._addWidgetProperties(["accordion"])}_init(e){super._init(e),this._setAccordion(this.accordion)}_createLoadingSupport(){return null}_render(){this.addContainer(this.$parent,"accordion-field"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this.accordion&&this._renderAccordion()}_renderProperties(){super._renderProperties(),this._renderDropType()}setAccordion(e){this.setProperty("accordion",e)}_setAccordion(e){this.accordion&&this.eventDelegator&&(this.eventDelegator.destroy(),this.eventDelegator=null),this._setProperty("accordion",e),e&&(this.eventDelegator=si.create(this,e,{delegateProperties:["loading"]}),e.setLoading(this.loading),e.setScrollTop(this.scrollTop))}_renderAccordion(){this.accordion&&(this.accordion.render(),this.addField(this.accordion.$container),this.invalidateLayoutTree())}_removeAccordion(){this.accordion&&(this.accordion.remove(),this._removeField(),this.invalidateLayoutTree())}getFocusableElement(){return this.accordion?this.accordion.getFocusableElement():null}getDelegateScrollable(){return this.accordion}}class xg extends at{}class Pg extends ge{constructor(){super(),this.preventInitialFocus=!0}_render(){this.addContainer(this.$parent,"bean-field"),this.addLabel(),this.addField(this.$parent.makeDiv()),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderValue()}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new Fn(this,this._onAppLinkAction))}_formatValue(e){return this.displayText}_parseValue(e){return this.value}_renderDisplayText(){}_renderValue(){}triggerAppLinkAction(e){this.trigger("appLinkAction",{ref:e})}_onAppLinkAction(e){let i=h()(e.delegateTarget).data("ref");this.triggerAppLinkAction(i)}}class Dg extends At{_onWidgetAppLinkAction(e){this._send("appLinkAction",{ref:e.ref})}_onWidgetEvent(e){e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):super._onWidgetEvent(e)}}class $n extends A{autoCloseExternalWindow;externalWindowButtonText;externalWindowFieldText;location;trackLocation;sandboxEnabled;sandboxPermissions;trustedMessageOrigins;scrollBarEnabled;showInExternalWindow;iframe;myWindow;_messageListener;_popupWindow;_externalWindowTextField;_externalWindowButton;constructor(){super(),this.autoCloseExternalWindow=!1,this.externalWindowButtonText=null,this.externalWindowFieldText=null,this.location=null,this.trackLocation=!1,this.sandboxEnabled=!0,this.sandboxPermissions=null,this.trustedMessageOrigins=[],this.scrollBarEnabled=!0,this.showInExternalWindow=!1,this._messageListener=null,this._popupWindow=null,this._externalWindowTextField=null,this._externalWindowButton=null}static WindowStates={WINDOW_OPEN:"true",WINDOW_CLOSED:"false"};_init(e){super._init(e),this.iframe=u.create($h,{parent:this,location:this.location,sandboxEnabled:this.sandboxEnabled,sandboxPermissions:this.sandboxPermissions,scrollBarEnabled:this.scrollBarEnabled,trackLocation:this.trackLocation}),this.iframe.on("propertyChange",this._onIFramePropertyChange.bind(this))}_render(){this.addContainer(this.$parent,"browser-field",new Gu(this)),this.addLabel(),this.addStatus(),this.showInExternalWindow?(this.addField(this.$parent.makeDiv()),this._externalWindowTextField=this.$field.appendDiv().addClass("alt"),this._externalWindowButton=this.$field.appendDiv().addClass("button").on("click",e=>this._openPopupWindow(!0))):(this.iframe.render(),this.addFieldContainer(this.iframe.$container),this.addField(this.iframe.$iframe),this.$field.on("load",this._onLoad.bind(this))),this.myWindow=this.$parent.window(!0),this._messageListener=this._onMessage.bind(this),this.myWindow.addEventListener("message",this._messageListener),this.enabledComputed&&setTimeout(this._openPopupWindow.bind(this,!0),20)}_renderProperties(){super._renderProperties(),this._renderExternalWindowButtonText(),this._renderExternalWindowFieldText()}_remove(){super._remove(),this.myWindow.removeEventListener("message",this._messageListener),this._messageListener=null,this.showInExternalWindow&&this.autoCloseExternalWindow&&this._popupWindow&&!this._popupWindow.closed&&this._popupWindow.close()}setLocation(e){this.setProperty("location",e),this.iframe.setLocation(e)}_renderLocation(){let e=this.location||"about:blank";this.showInExternalWindow&&this._popupWindow&&!this._popupWindow.closed&&(this._popupWindow.location=e)}setAutoCloseExternalWindow(e){this.setProperty("autoCloseExternalWindow",e)}setExternalWindowButtonText(e){this.setProperty("externalWindowButtonText",e)}_renderExternalWindowButtonText(){this.showInExternalWindow&&this._externalWindowButton.text(this.externalWindowButtonText||"")}setExternalWindowFieldText(e){this.setProperty("externalWindowFieldText",e)}_renderExternalWindowFieldText(){this.showInExternalWindow&&this._externalWindowTextField.text(this.externalWindowFieldText||"")}_calcPopupBounds(){let e=this.$container.window(!0),s=30+8,r=55,o=new te(e.screenX,e.screenY,h()(e).width(),h()(e).height()+r),l=new te(this.$field.offset().left,this.$field.offset().top,this.$field.width(),this.$field.height()),a=o.x+l.x,d=o.y+l.y+r,c=l.width,f=l.height+s,g=d+f,y=o.y+o.height;return g>y&&(f-=g-y+s),new te(Se.round(a),Se.round(d),Se.round(c),Se.round(f))}_openPopupWindow(e){if(e=u.nvl(e,!0),!!this.showInExternalWindow)if(!this._popupWindow||e&&this._popupWindow.closed){let t=u.create(Wn,{session:this.session}),i=this._calcPopupBounds(),s=_.join(",","directories=no","location=no","menubar=no","resizable=yes","status=no","scrollbars="+(this.scrollBarEnabled?"yes":"no"),"toolbar=no","dependent=yes","left="+i.x,"top="+i.y,"width="+i.width,"height="+i.height),r=this.location||"about:blank";t.openWindow(r,void 0,s,this._popupWindowOpen.bind(this))}else e&&this._popupWindow.focus()}_popupWindowOpen(e){if(this._popupWindow=e,this._popupWindow&&!this._popupWindow.closed){this.trigger("externalWindowStateChange",{windowState:$n.WindowStates.WINDOW_OPEN});let t=window.setInterval(()=>{let i=!1;try{i=this._popupWindow===null||this._popupWindow.closed}catch{h().log.isInfoEnabled()&&h().log.info("Reading the property popupWindow.closed threw an error (Retry in 500ms)");return}i&&(window.clearInterval(t),this.trigger("externalWindowStateChange",{windowState:$n.WindowStates.WINDOW_CLOSED}))},500)}}_onMessage(e){if(this._isValidMessageSource(e.source)){if(this.trustedMessageOrigins&&this.trustedMessageOrigins.length&&!this.trustedMessageOrigins.some(t=>t===e.origin)){h().log.warn("blocked message from untrusted origin "+e.origin);return}h().log.isDebugEnabled()&&h().log.debug("received post-message: data="+e.data+", origin="+e.origin),this.trigger("message",{data:e.data,origin:e.origin})}}_isValidMessageSource(e){let t=this.$field[0].contentWindow;if(e===t)return!0;let i=e;for(;i&&i!==i.parent;)if(i=i.parent,i===t)return!0;return!1}postMessage(e,t){h().log.isDebugEnabled()&&h().log.debug("send post-message: message="+e+", targetOrigin="+t),this.iframe&&this.iframe.postMessage(e,t)}setTrackLocation(e){this.setProperty("trackLocation",e),this.iframe.setTrackLocation(e)}_onIFramePropertyChange(e){this.trackLocation&&e.propertyName==="location"&&this._setProperty("location",e.newValue)}_onLoad(e){this.rendered&&this.invalidateLayoutTree()}setSandboxEnabled(e){this.setProperty("sandboxEnabled",e),this.iframe.setSandboxEnabled(e)}setSandboxPermissions(e){this.setProperty("sandboxPermissions",e),this.iframe.setSandboxPermissions(e)}setScrollBarEnabled(e){this.setProperty("scrollBarEnabled",e),this.iframe.setScrollBarEnabled(e)}}class Eg extends at{constructor(){super(),this._addRemoteProperties(["location"])}_onWidgetMessage(e){this._send("postMessage",{data:e.data,origin:e.origin})}_onWidgetExternalWindowStateChange(e){this._send("externalWindowStateChange",{windowState:e.windowState})}_onWidgetEvent(e){e.type==="message"?this._onWidgetMessage(e):e.type==="externalWindowStateChange"?this._onWidgetExternalWindowStateChange(e):super._onWidgetEvent(e)}_onModelPostMessage(e){this.widget.postMessage(e.message,e.targetOrigin)}onModelAction(e){e.type==="postMessage"?this._onModelPostMessage(e):super.onModelAction(e)}_orderPropertyNamesOnSync(e){return Object.keys(e).sort(this._createPropertySortFunc(["scrollBarEnabled","location"]))}}class Gu extends Kt{browserField;constructor(e){super(e),this.browserField=e}preferredLayoutSize(e,t){let i=super.preferredLayoutSize(e,t);return this._isIFrameReadable()&&(i.height=this.browserField.$field.contents().height()+this.browserField.iframe.htmlComp.insets().vertical()+this.browserField.htmlComp.insets().vertical()),i}_isIFrameReadable(){let e=this.browserField,t=e.sandboxPermissions;if(e.sandboxEnabled&&t&&t.indexOf("allow-same-origin")===-1)return h().log.isWarnEnabled()&&h().log.warn('Access to IFrame denied, cannot read height. Reason: sandbox is enabled or "allow-same-origin" is not set'),!1;try{e.$field[0].contentWindow.document}catch{return h().log.isWarnEnabled()&&h().log.warn("Access to IFrame denied, cannot read height. Reason: denied by browser"),!1}return e.$field.contents().attr("readyState")==="loading"?(h().log.isWarnEnabled()&&h().log.warn('Access to IFrame denied, cannot read height. Reason: readyState == "loading"'),!1):!0}}class Oe extends A{defaultButton;displayStyle;iconId;keyStroke;keyStrokeScope;processButton;selected;systemType;preventDoubleClick;stackable;shrinkable;adaptedBy;buttonKeyStroke;formKeyStrokeContext;popup;$buttonLabel;$submenuIcon;_doubleClickSupport;constructor(){super(),this.adaptedBy=null,this.defaultButton=!1,this.displayStyle=Oe.DisplayStyle.DEFAULT,this.gridDataHints.fillHorizontal=!1,this.iconId=null,this.keyStroke=null,this.keyStrokeScope=null,this.processButton=!0,this.selected=!1,this.statusVisible=!1,this.systemType=Oe.SystemType.NONE,this.preventDoubleClick=!1,this.stackable=!0,this.shrinkable=!1,this.$buttonLabel=null,this.buttonKeyStroke=new Mn(this,null),this._doubleClickSupport=new R,this._addCloneProperties(["defaultButton","displayStyle","iconId","keyStroke","processButton","selected","systemType","preventDoubleClick","stackable","shrinkable"])}static SystemType={NONE:0,CANCEL:1,CLOSE:2,OK:3,RESET:4,SAVE:5};static DisplayStyle={DEFAULT:0,TOGGLE:1,RADIO:2,LINK:3,BORDERLESS:4};static SUBMENU_ICON=q.ANGLE_DOWN_BOLD;_init(e){super._init(e),this.resolveIconIds(["iconId"]),this._setKeyStroke(this.keyStroke),this._setKeyStrokeScope(this.keyStrokeScope),this._setInheritAccessibility(this.inheritAccessibility&&!this._isIgnoreAccessibilityFlags())}getContextMenuItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return[]}_initKeyStrokeContext(){super._initKeyStrokeContext(),this._initDefaultKeyStrokes(),this.formKeyStrokeContext=new Ee,this.formKeyStrokeContext.invokeAcceptInputOnActiveValueField=!0,this.formKeyStrokeContext.registerKeyStroke(this.buttonKeyStroke),this.formKeyStrokeContext.$bindTarget=()=>{if(this.keyStrokeScope)return this.keyStrokeScope.$container;let e=this.getForm();return e?e.$container:this.session.desktop.$container}}_isIgnoreAccessibilityFlags(){return this.systemType===Oe.SystemType.CANCEL||this.systemType===Oe.SystemType.CLOSE}_initDefaultKeyStrokes(){this.keyStrokeContext.registerKeyStrokes([new Mn(this,"ENTER"),new Mn(this,"SPACE")])}_createLoadingSupport(){return new Ut({widget:this,$container:()=>this.$field})}_render(){let e;this.displayStyle===Oe.DisplayStyle.LINK?(e=this.$parent.makeDiv("link-button menu-item"),T.role(e,"link"),this.$buttonLabel=e.appendSpan("button-label text")):(e=this.$parent.makeElement("<button>").addClass("button"),this.displayStyle===Oe.DisplayStyle.BORDERLESS&&e.addClass("borderless"),this.$buttonLabel=e.appendSpan("button-label text"),w.get().supportsOnlyTouch()&&e.setTabbable(!1)),this.addContainer(this.$parent,"button-field",new ta(this)),this.addField(e),this.addStatus(),e.on("mousedown",t=>this._doubleClickSupport.mousedown(t)).on("click",this._onClick.bind(this)).unfocusable(),this.session.keyStrokeManager.installKeyStrokeContext(this.formKeyStrokeContext),Y.installForEllipsis(this.$buttonLabel,{parent:this})}_remove(){super._remove(),Y.uninstall(this.$buttonLabel),this.session.keyStrokeManager.uninstallKeyStrokeContext(this.formKeyStrokeContext),this.$submenuIcon=null}_renderProperties(){super._renderProperties(),this._renderIconId(),this._renderSelected(),this._renderDefaultButton(),this._updateLabelAndIconStyle()}_renderForegroundColor(){super._renderForegroundColor(),L.legacyForegroundColor(this,this.$buttonLabel),L.legacyForegroundColor(this,this.get$Icon()),L.legacyForegroundColor(this,this.$submenuIcon)}_renderBackgroundColor(){super._renderBackgroundColor(),L.legacyBackgroundColor(this,this.$fieldContainer)}_renderFont(){super._renderFont(),L.legacyFont(this,this.$buttonLabel),this.invalidateLayoutTree()}_updateMenus(){super._updateMenus();let e=this.menus.length>0;T.hasPopup(this.$field,e?"menu":null),T.expanded(this.$field,e?!b.isNullOrUndefined(this.popup):null),this._renderSubmenuIcon()}_renderSubmenuIcon(){if(this.menus?.length>0&&(this.label||!this.iconId)){if(!this.$submenuIcon){let t=q.parseIconId(Oe.SUBMENU_ICON);this.$submenuIcon=this.$field.appendSpan("submenu-icon").text(t.iconCharacter),T.hidden(this.$submenuIcon,!0),this.invalidateLayoutTree()}}else this.$submenuIcon&&(this.$submenuIcon.remove(),this.$submenuIcon=null,this.invalidateLayoutTree());this.rendering||this._updateLabelAndIconStyle()}doAction(){return!this.enabledComputed||!this.visible?!1:(this.displayStyle===Oe.DisplayStyle.TOGGLE?this.setSelected(!this.selected):this.menus.length>0&&this.togglePopup(),this._doAction(),!0)}_doAction(){this.trigger("click")}togglePopup(){this.popup?this.popup.close():(this.popup=this._openPopup(),this.popup.one("destroy",e=>{this.popup=null,T.expanded(this.$field,!1)}),T.expanded(this.$field,!0))}_openPopup(){let e=u.create(bt,{parent:this,menuItems:this.menus,cloneMenuItems:!1,closeOnAnchorMouseDown:!1,$anchor:this.$field});return e.open(),e}_doActionTogglesSubMenu(){return!1}setDefaultButton(e){this.setProperty("defaultButton",e)}_renderDefaultButton(){this.$field.toggleClass("default",this.defaultButton)}_renderEnabled(){super._renderEnabled(),this.displayStyle===Oe.DisplayStyle.LINK&&this.$field.setTabbable(this.enabledComputed&&!w.get().supportsOnlyTouch())}setSelected(e){this.setProperty("selected",e)}_renderSelected(){this.displayStyle===Oe.DisplayStyle.TOGGLE&&this.$field.toggleClass("selected",this.selected),T.pressed(this.$field,this.displayStyle===Oe.DisplayStyle.TOGGLE?this.selected:null)}_renderLabel(){this.$buttonLabel.contentOrNbsp(this.labelHtmlEnabled,this.label,"empty"),this.rendering||this._renderSubmenuIcon(),this.invalidateLayoutTree()}setIconId(e){this.setProperty("iconId",e)}_renderIconId(){let e=this.$fieldContainer;e.icon(this.iconId);let t=e.data("$icon");t&&(t.removeClass("loading broken"),t.is("img")&&(t.addClass("loading"),t.off("load error").on("load",i.bind(this,!0)).on("error",i.bind(this,!1))),this.rendered||L.legacyForegroundColor(this,t)),this.rendering||this._renderSubmenuIcon(),this.invalidateLayoutTree();function i(s){t.removeClass("loading"),t.toggleClass("broken",!s),this.invalidateLayoutTree()}}get$Icon(){return this.$fieldContainer.children(".icon")}_updateLabelAndIconStyle(){let e=!!this.label,t=!!this.iconId,i=!!this.$submenuIcon,s=t||i;this.$buttonLabel.setVisible(e||!s),this.$submenuIcon?.toggleClass("with-label",e),this.get$Icon().toggleClass("with-label",e)}setKeyStroke(e){this.setProperty("keyStroke",e)}_setKeyStroke(e){this._setProperty("keyStroke",e),this.buttonKeyStroke.parseAndSetKeyStroke(this.keyStroke)}_setKeyStrokeScope(e){typeof e=="string"&&(e=this._resolveKeyStrokeScope(e),!e)||this._setProperty("keyStrokeScope",e)}_resolveKeyStrokeScope(e){let t=this.findNonWrappedForm();if(!t)throw new Error("Could not resolve keyStrokeScope "+e+" because no form has been found.");if(!t.initialized){t.one("init",this._setKeyStrokeScope.bind(this,e));return}let i=t.widget(e);if(!i)throw new Error("Could not resolve keyStrokeScope "+e+" using form "+t);return i}_onClick(e){e.which===1&&(this.preventDoubleClick&&this._doubleClickSupport.doubleClicked()||(Y.cancel(this.$buttonLabel),Y.cancel(this.$fieldContainer),this.enabledComputed&&this.doAction()))}setStackable(e){this.setProperty("stackable",e)}setShrinkable(e){this.setProperty("shrinkable",e)}setPreventDoubleClick(e){this.setProperty("preventDoubleClick",e)}_linkWithLabel(e){super._linkWithLabel(e),T.linkElementWithLabel(e,this.$buttonLabel)}getFocusableElement(){return this.adaptedBy?this.adaptedBy.getFocusableElement():super.getFocusableElement()}isFocusable(e){return this.adaptedBy?this.adaptedBy.isFocusable():super.isFocusable()}focus(){return this.adaptedBy?this.adaptedBy.focus():super.focus()}}class ta extends Kt{constructor(e){super(e)}layout(e){super.layout(e);let t=this.formField.get$Icon(),i=this.formField.$submenuIcon,s=this.formField.$buttonLabel,r=this.formField.$fieldContainer;s.css("max-width","");let o=i?C.size(i,{includeMargin:!0,exact:!0}).width:0,l=t.length?C.size(t,{includeMargin:!0,exact:!0}).width:0,a=Math.ceil(r.width()-(o+l));s.css("max-width",a)}preferredLayoutSize(e,t){let i=this.formField.$buttonLabel,s=i.css("max-width");i.css("max-width","");let r=super.preferredLayoutSize(e,t);return i.css("max-width",s),r}}class Ku extends at{constructor(){super(),this._addRemoteProperties(["selected"])}_onWidgetClick(e){this.widget.displayStyle===Oe.DisplayStyle.TOGGLE||this.widget.menus.length>0||this._send("click")}_onWidgetEvent(e){e.type==="click"?this._onWidgetClick(e):super._onWidgetEvent(e)}}class Mn extends B{constructor(e,t){super(),this.field=e,this.parseAndSetKeyStroke(t),this.stopPropagation=!0,this.stopImmediatePropagation=!0,this.renderingHints.hAlign=ut.RIGHT}_accept(e){return super._accept(e)&&this.field.$field.isAttached()}handle(e){this.field.doAction()}}class Fg extends A{calendar;constructor(){super(),this.gridDataHints.weightY=1,this._addWidgetProperties(["calendar"])}_render(){this.addContainer(this.$parent,"calendar-field"),this.$container.toggleClass("mobile",w.get().type===w.Type.MOBILE),this.addLabel(),this.addStatus(),this.calendar&&(this.calendar.render(),this.addField(this.calendar.$container))}}class Rg extends at{}class Ag extends A{carousel;constructor(){super(),this.gridDataHints.weightY=1,this._addWidgetProperties(["carousel"])}_render(){this.addContainer(this.$parent,"carousel-field"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this.carousel&&this._renderCarousel()}_renderCarousel(){this.carousel.render(),this.addField(this.carousel.$container)}_removeCarousel(){this.carousel&&this.carousel.remove(),this._removeField()}}class cs extends ge{triStateEnabled;wrapText;keyStroke;checkBoxKeyStroke;formKeyStrokeContext;$checkBox;$checkBoxLabel;constructor(){super(),this.triStateEnabled=!1,this.wrapText=!1,this.keyStroke=null,this.checkBoxKeyStroke=new ia(this),this.$checkBox=null,this.$checkBoxLabel=null}_init(e){super._init(e),this._setKeyStroke(this.keyStroke)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new ia(this)),this.formKeyStrokeContext=new Ee,this.formKeyStrokeContext.invokeAcceptInputOnActiveValueField=!0,this.formKeyStrokeContext.registerKeyStroke(this.checkBoxKeyStroke),this.formKeyStrokeContext.$bindTarget=()=>{let e=this.getForm();return e?e.$container:this.session.desktop.$container}}_render(){this.addContainer(this.$parent,"check-box-field"),this.addLabel(),this.addMandatoryIndicator(),this.addFieldContainer(this.$parent.makeDiv()),this.$checkBox=this.$fieldContainer.appendDiv("check-box").on("mousedown",this._onMouseDown.bind(this)).data("valuefield",this),T.role(this.$checkBox,"checkbox"),this.addField(this.$checkBox),this.$checkBoxLabel=this.$fieldContainer.appendDiv("label").on("mousedown",this._onMouseDown.bind(this)),T.linkElementWithLabel(this.$checkBox,this.$checkBoxLabel),Y.installForEllipsis(this.$checkBoxLabel,{parent:this}),this.addStatus(),this.session.keyStrokeManager.installKeyStrokeContext(this.formKeyStrokeContext)}_renderProperties(){super._renderProperties(),this._renderValue(),this._renderWrapText()}_remove(){Y.uninstall(this.$checkBoxLabel),this.session.keyStrokeManager.uninstallKeyStrokeContext(this.formKeyStrokeContext),super._remove()}_renderDisplayText(){}setValue(e){this.setProperty("value",e)}_ensureValue(e){return!this.triStateEnabled&&b.isNullOrUndefined(e)?!1:super._ensureValue(e)}_renderValue(){this.$fieldContainer.toggleClass("checked",this.value===!0),this.$checkBox.toggleClass("checked",this.value===!0),this.$checkBox.toggleClass("undefined",this.triStateEnabled&&this.value!==!0&&this.value!==!1),T.checked(this.$checkBox,this.value,this.triStateEnabled)}_renderEnabled(){super._renderEnabled(),this.$checkBox.setTabbable(this.enabledComputed&&!w.get().supportsOnlyTouch()).setEnabled(this.enabledComputed)}setTriStateEnabled(e){this.setProperty("triStateEnabled",e)&&this.setValue(this._ensureValue(this.value))}_renderLabel(){this.$checkBoxLabel.contentOrNbsp(this.labelHtmlEnabled,this.label,"empty"),this._renderEmptyLabel()}_renderFont(){L.legacyFont(this,this.$fieldContainer),this.invalidateLayoutTree()}_renderForegroundColor(){L.legacyForegroundColor(this,this.$fieldContainer)}_renderBackgroundColor(){L.legacyBackgroundColor(this,this.$fieldContainer)}_renderGridData(){super._renderGridData(),this.updateInnerAlignment({useHorizontalAlignment:!0})}_renderGridDataHints(){super._renderGridDataHints(),this.updateInnerAlignment({useHorizontalAlignment:!0})}setKeyStroke(e){this.setProperty("keyStroke",e)}_setKeyStroke(e){this._setProperty("keyStroke",e),this.checkBoxKeyStroke.parseAndSetKeyStroke(this.keyStroke)}setWrapText(e){this.setProperty("wrapText",e)}_renderWrapText(){this.$checkBoxLabel.toggleClass("white-space-nowrap",!this.wrapText),this.invalidateLayoutTree()}acceptInput(e){}toggleChecked(){this.enabledComputed&&(this.triStateEnabled?this.value===!1?this.setValue(!0):this.value===!0?this.setValue(null):this.setValue(!1):this.setValue(!this.value))}prepareForCellEdit(e){super.prepareForCellEdit(e),this.$checkBoxLabel.hide()}_onMouseDown(e){if(!this.enabledComputed)return;this.toggleChecked();let t=this.$checkBox.is(e.currentTarget),i=this.$checkBoxLabel.isOrHas(e.currentTarget);(t||i)&&this.focusAndPreventDefault(e)}}class $g extends At{constructor(){super(),this._addRemoteProperties(["value"])}}class ia extends B{constructor(e){super(),this.field=e,this.which=[m.SPACE],this.stopPropagation=!0,this.stopImmediatePropagation=!0,this.renderingHints.hAlign=ut.LEFT,this.renderingHints.$drawingArea=(t,i)=>this.field.$fieldContainer}handle(e){this.field.toggleChecked()}}class Mo extends ge{allowedMimeTypes;maximumSize;readOnly;_fileUploadWaitRetryCountTimeout;_fullSelectionLength;constructor(){super(),this.allowedMimeTypes=null,this.maximumSize=null,this._fileUploadWaitRetryCountTimeout=99,this._fullSelectionLength=0}static NON_DESTRUCTIVE_KEYS=[m.ESC,m.ENTER,m.TAB,m.PAGE_UP,m.PAGE_DOWN,m.END,m.HOME,m.LEFT,m.UP,m.RIGHT,m.DOWN,m.F1,m.F2,m.F3,m.F4,m.F5,m.F6,m.F7,m.F8,m.F9,m.F10,m.F11,m.F12];static ALWAYS_DESTRUCTIVE_KEYS=[m.BACKSPACE,m.DELETE];_createKeyStrokeContext(){return new qi}_render(){this.addContainer(this.$parent,"clipboard-field"),this.addLabel(),this.addField(this.$parent.makeElement("<div>").addClass("input-field")),this.addStatus(),this.$field.disableSpellcheck().attr("contenteditable","true").attr("tabindex","0").on("keydown",this._onKeyDown.bind(this)).on("input",this._onInput.bind(this)).on("paste",this._onPaste.bind(this)).on("copy",this._onCopy.bind(this)).on("cut",this._onCopy.bind(this))}_getDragAndDropHandlerOptions(){let e=super._getDragAndDropHandlerOptions();return e.allowedTypes=()=>this.allowedMimeTypes,e.dropMaximumSize=()=>Math.min(u.nvl(this.dropMaximumSize,Number.MAX_VALUE),u.nvl(this.maximumSize,Number.MAX_VALUE)),e}_renderDisplayText(){let e=this.displayText,t;this.$field.children().each((i,s)=>{!t&&s.nodeName==="IMG"&&(t=s)}),_.hasText(e)?(this.$field.html(_.nl2br(e,!0)),this._installScrollbars(),setTimeout(()=>{this.$field.selectAllText();let i=this._getSelection();this._fullSelectionLength=i?i.toString().length:0})):this.$field.empty(),t&&this.$field.prepend(t)}_getSelection(){let e,t=this.$container.window(!0);return t.getSelection?e=t.getSelection():document.getSelection&&(e=document.getSelection()),!e||e.toString().length===0?null:e}_onKeyDown(e){if(u.isOneOf(e.which,Mo.ALWAYS_DESTRUCTIVE_KEYS))return!1;if(!(e.ctrlKey||e.altKey||e.metaKey||u.isOneOf(e.which,Mo.NON_DESTRUCTIVE_KEYS)))return!1}_onInput(e){return this._renderDisplayText(),!1}_onCopy(e){if(w.get().isIos()&&this._onIosCopy(e)===!1)return;let t,i,s=this.$container.window(!0);try{let o=e.originalEvent;o.clipboardData?i=o.clipboardData:s.clipboardData&&(i=s.clipboardData)}catch(o){h().log.error('Error while reading "clipboardData"',o)}if(!i)return h().log.error("Unable to access clipboard data."),!1;this._uninstallScrollbars();let r=this._getSelection();if(r){r.toString().length===this._fullSelectionLength?t=this.displayText:t=r.toString();try{i.setData("text/plain",t)}catch{i.setData("Text",t)}return this._installScrollbars(),!1}}_onIosCopy(e){let t=this.$field.attr("style");return this.$field.css({color:"#000","background-color":"transparent"}),setTimeout(()=>{this.$field.attrOrRemove("style",t)}),!1}_onPaste(e){if(this.readOnly)return!1;let t=Date.now(),i,s=this.$container.window(!0);this.$field.selectAllText();let r=e.originalEvent;if(r.clipboardData)i=r.clipboardData;else if(s.clipboardData)i=s.clipboardData;else throw new Error("Unable to access clipboard data.");let o=[],l={},a=0,d=0,c=i.getData("Text");c&&(window.Blob?(o.push(new Blob([c],{type:Xe.TEXT_PLAIN})),d++):(l["textTransferObject"+a++]=c,d++)),d===0&&i.items&&(Array.prototype.forEach.call(i.items,D=>{if(D.type===Xe.TEXT_PLAIN)D.getAsString(k=>{o.push(new Blob([k],{type:Xe.TEXT_PLAIN})),d++});else if(u.isOneOf(D.type,[Xe.IMAGE_PNG,Xe.IMAGE_JPG,Xe.IMAGE_JPEG,Xe.IMAGE_GIF])){let k=D.getAsFile();k&&(t-k.lastModified<1e3&&(k.scoutName=vt.EMPTY_UPLOAD_FILENAME),o.push(k),d++)}}),this._cleanupFiles(o));let f=0;d===0&&i.files&&Array.prototype.forEach.call(i.files,D=>{let k=new FileReader;k.onload=V=>{let Q=new Blob([V.target.result],{type:D.type});Q.name=D.name,o.push(Q),f--},k.onerror=V=>{f--,h().log.error("Error while reading file "+D.name+" / "+V.target.error.code)},f++,d++,k.readAsArrayBuffer(D)});let g=0,y=()=>{if(f!==0&&g++!==this._fileUploadWaitRetryCountTimeout){setTimeout(y,150);return}if(g>=this._fileUploadWaitRetryCountTimeout){let D={entryPoint:this.$container.entryPoint(),header:this.session.text("ui.ClipboardTimeoutTitle"),body:this.session.text("ui.ClipboardTimeout"),yesButtonText:this.session.text("Ok")};this.session.showFatalMessage(D);return}(o.length>0||Object.keys(l).length>0)&&this.session.uploadFiles(this,o,l,this.maximumSize,this.allowedMimeTypes)},v=()=>{this._uninstallScrollbars();let D=this.$field.html();this.$field.html("");let k=()=>{this.$field.html(D),this._installScrollbars()};setTimeout(()=>{let V=!1;if(this.$field.children().each((Q,ve)=>{if(ve.nodeName==="IMG"){let Ze=h()(ve).attr("src"),nt=/^data:(.*);base64,(.*)/.exec(Ze),ei=nt&&nt[1];if(u.isOneOf(ei,Xe.IMAGE_PNG,Xe.IMAGE_JPG,Xe.IMAGE_JPEG,Xe.IMAGE_GIF)){let Mt=window.atob(nt[2]),ti=[];for(let Oa=0;Oa<Mt.length;Oa++)ti[Oa]=Mt.charCodeAt(Oa);let Yn=new Uint8Array(ti),Xn=new Blob([Yn],{type:ei});Xn.name="",o.push(Xn),V=!0}}}),V)k();else{let Q=this.$field.text();_.hasText(Q)?(this.setDisplayText(Q),o.push(new Blob([Q],{type:Xe.TEXT_PLAIN}))):k()}y()},0)};return d>0?(y(),!1):(v(),!0)}_cleanupFiles(e){if(e.length!==2)return;let t,i;e.forEach(s=>{s.name==="image.png"&&s.scoutName?t=s:s.name==="image.jpeg"&&s.scoutName&&(i=s)}),t&&i&&p.remove(e,i)}}class Mg extends At{}class kg extends ge{_render(){this.addContainer(this.$parent,"color-field"),this.addLabel(),this.addField(this.$parent.makeDiv("not-implemented").text("not implemented yet")),this.addMandatoryIndicator(),this.addStatus()}}class Ig extends At{}class sa extends E{}class Ht extends ge{popup;autoDate;dateDisplayText;dateHasText;dateFocused;dateFormatPattern;hasDate;touchMode;embedded;hasTime;hasTimePopup;timeDisplayText;timeHasText;timePickerResolution;timeFormatPattern;timeFocused;isolatedDateFormat;isolatedTimeFormat;allowedDates;htmlDateTimeComposite;$dateField;$timeField;$dateFieldIcon;$timeFieldIcon;$dateClearIcon;$timeClearIcon;_$predictDateField;_$predictTimeField;_tempTimeDate;_cellEditorPopup;constructor(){super(),this.allowedDates=[],this.popup=null,this.autoDate=null,this.dateDisplayText=null,this.dateHasText=!1,this.dateFocused=!1,this.dateFormatPattern=null,this.hasDate=!0,this.touchMode=!1,this.embedded=!1,this.hasTime=!1,this.hasTimePopup=!0,this.timeDisplayText=null,this.timeHasText=!1,this.timeDisplayText=null,this.timePickerResolution=30,this.timeFormatPattern=null,this.timeFocused=!1,this.$dateField=null,this.$timeField=null,this.$dateFieldIcon=null,this.$timeFieldIcon=null,this.$dateClearIcon=null,this.$timeClearIcon=null,this._$predictDateField=null,this._$predictTimeField=null,this._tempTimeDate=null,this.invalidValueMessageKey="ui.InvalidDate",this._addCloneProperties(["hasDate","hasTime","dateFormatPattern","timeFormatPattern","allowedDates","autoDate"])}static ErrorCode={PARSE_ERROR:-1};static PARSE_ERROR_PREDICATE=e=>e.code===Ht.ErrorCode.PARSE_ERROR;_createKeyStrokeContext(){return new qi}_init(e){super._init(e),oe.initTouch(this,e),this.popup=e.popup,this._setAutoDate(this.autoDate),this._setDisplayText(this.displayText),this._setAllowedDates(this.allowedDates),this._setTimePickerResolution(this.timePickerResolution)}_initValue(e){this._setDateFormatPattern(this.dateFormatPattern),this._setTimeFormatPattern(this.timeFormatPattern),super._initValue(e)}createDatePopup(){let e=this.touchMode?Wh:Pl;return u.create(e,{parent:this,$anchor:this.$field,boundToAnchor:!this.touchMode,cssClass:this._errorStatusClass(),closeOnAnchorMouseDown:!1,field:this,allowedDates:this.allowedDates,dateFormat:this.isolatedDateFormat})}createTimePopup(){let e=this.touchMode?Kl:Gl;return u.create(e,{parent:this,$anchor:this.$timeField,boundToAnchor:!this.touchMode,cssClass:this._errorStatusClass(),closeOnAnchorMouseDown:!1,field:this,timeResolution:this.timePickerResolution})}_render(){this.addContainer(this.$parent,"date-field"),this.addLabel(),this.addField(this.$parent.makeDiv("date-time-composite")),this.addStatus(),this.embedded||this.addMandatoryIndicator(),this.htmlDateTimeComposite=x.install(this.$field,this.session),this.htmlDateTimeComposite.setLayout(new ju(this))}_renderProperties(){this._renderHasDate(),this._renderHasTime(),super._renderProperties(),this._renderDateHasText(),this._renderTimeHasText()}_remove(){super._remove(),this.$dateField=null,this.$timeField=null,this.$dateFieldIcon=null,this.$timeFieldIcon=null,this.$dateClearIcon=null,this.$timeClearIcon=null,this._$predictDateField=null,this._$predictTimeField=null,this.popup=null}_renderMandatory(){super._renderMandatory(),T.required(this.$field,null),T.required(this.$dateField,this.mandatory||null),T.required(this.$timeField,this.mandatory||null)}setHasDate(e){this.setProperty("hasDate",e)}_setHasDate(e){this._setProperty("hasDate",e),this.initialized&&this._updateDisplayTextProperty()}_renderHasDate(){this.hasDate&&!this.$dateField?(this.$dateField=oe.makeInputOrDiv(this,"date").on("mousedown",this._onDateFieldMouseDown.bind(this)).appendTo(this.$field),this._linkWithLabel(this.$dateField),T.addHiddenDescriptionAndLinkToElement(this.$dateField,this.id+"-date-func-desc",this.session.text("ui.AriaDateFieldDescription",this.dateFormatPattern)),this.$timeField&&this.$dateField.insertBefore(this.$timeField),this.touchMode||this.$dateField.on("keydown",this._onDateFieldKeyDown.bind(this)).on("input",this._onDateFieldInput.bind(this)).on("blur",this._onDateFieldBlur.bind(this)).on("focus",this._onDateFieldFocus.bind(this)),x.install(this.$dateField,this.session),this.$dateFieldIcon=oe.appendIcon(this.$field,"date").on("mousedown",this._onDateIconMouseDown.bind(this)),T.hidden(this.$dateFieldIcon,!0)):!this.hasDate&&this.$dateField&&(this.$dateField.remove(),this.$dateField=null,this.$dateFieldIcon.remove(),this.$dateFieldIcon=null),this.rendering||(this._renderDisplayText(),this._renderFieldStyle(),this._renderEnabled(),this.htmlDateTimeComposite.invalidateLayoutTree()),this._renderDateClearable(),this.$container.toggleClass("has-date",this.hasDate)}setHasTime(e){this.setProperty("hasTime",e)}_setHasTime(e){this._setProperty("hasTime",e),this.initialized&&this._updateDisplayTextProperty()}_renderHasTime(){this.hasTime&&!this.$timeField?(this.$timeField=oe.makeInputOrDiv(this,"time").on("mousedown",this._onTimeFieldMouseDown.bind(this)).appendTo(this.$field),this._linkWithLabel(this.$timeField),T.addHiddenDescriptionAndLinkToElement(this.$timeField,this.id+"-time-func-desc",this.session.text("ui.AriaTimeFieldDescription",this.timeFormatPattern)),this.$dateField&&this.$timeField.insertAfter(this.$dateField),(!this.touchMode||!this.hasTimePopup)&&this.$timeField.on("keydown",this._onTimeFieldKeyDown.bind(this)).on("input",this._onTimeFieldInput.bind(this)).on("blur",this._onTimeFieldBlur.bind(this)).on("focus",this._onTimeFieldFocus.bind(this)),x.install(this.$timeField,this.session),this.$timeFieldIcon=oe.appendIcon(this.$field,"time").on("mousedown",this._onTimeIconMouseDown.bind(this)),T.hidden(this.$timeFieldIcon,!0)):!this.hasTime&&this.$timeField&&(this.$timeField.remove(),this.$timeField=null,this.$timeFieldIcon.remove(),this.$timeFieldIcon=null),this.rendering||(this._renderDisplayText(),this._renderFieldStyle(),this._renderEnabled(),this.htmlDateTimeComposite.invalidateLayoutTree()),this._renderTimeClearable(),this.$container.toggleClass("has-time",this.hasTime)}setTimePickerResolution(e){this.setProperty("timePickerResolution",e)}_setTimePickerResolution(e){e<1?(e=10,this.hasTimePopup=!1):this.hasTimePopup=!0,this._setProperty("timePickerResolution",e)}_renderPlaceholder(e){super._renderPlaceholder(this._fieldForPlaceholder())}_removePlaceholder(e){super._removePlaceholder(this._fieldForPlaceholder())}_fieldForPlaceholder(){return this.hasDate?this.$dateField:this.hasTime?this.$timeField:null}setDateFormatPattern(e){this.setProperty("dateFormatPattern",e)}_setDateFormatPattern(e){e||(e=this.session.locale.dateFormatPatternDefault),this._setProperty("dateFormatPattern",e),this.isolatedDateFormat=new St(this.session.locale,this.dateFormatPattern),this.initialized&&this._updateDisplayText()}setTimeFormatPattern(e){this.setProperty("timeFormatPattern",e)}_setTimeFormatPattern(e){e||(e=this.session.locale.timeFormatPatternDefault),this._setProperty("timeFormatPattern",e),this.isolatedTimeFormat=new St(this.session.locale,this.timeFormatPattern),this.initialized&&this._updateDisplayText()}_renderEnabled(){super._renderEnabled(),this.$container.setEnabled(this.enabledComputed),this.$dateField&&this.$dateField.setEnabled(this.enabledComputed),this.$timeField&&this.$timeField.setEnabled(this.enabledComputed)}_renderDisplayText(){this.hasDate&&this._renderDateDisplayText(),this.hasTime&&this._renderTimeDisplayText(),this._removePredictionFields()}_readDisplayText(){let e,t;return this.hasDate&&(e=this._readDateDisplayText()),this.hasTime&&(t=this._readTimeDisplayText()),this._computeDisplayText(e,t)}_renderDateDisplayText(){oe.valOrText(this.$dateField,this.dateDisplayText),this._updateDateHasText()}_readDateDisplayText(){return this._$predictDateField?oe.valOrText(this._$predictDateField):oe.valOrText(this.$dateField)}_renderTimeDisplayText(){oe.valOrText(this.$timeField,this.timeDisplayText),this._updateTimeHasText()}_readTimeDisplayText(){return this._$predictTimeField?oe.valOrText(this._$predictTimeField):oe.valOrText(this.$timeField)}setDisplayText(e){this._setDisplayText(e),this.rendered&&this._renderDisplayText()}_setDisplayText(e){this._setProperty("displayText",e);let t=this._splitDisplayText(e);this.hasDate&&(this.dateDisplayText=t.dateText),this.hasTime&&(this.timeDisplayText=t.timeText)}_ensureValue(e){return S.ensure(e)}_validateValue(e){if(b.isNullOrUndefined(e))return e;if(!(e instanceof Date))throw this.session.text(this.invalidValueMessageKey);if(!this.isDateAllowed(e))throw this.session.text("DateIsNotAllowed");return!this.hasDate&&!this.value&&(e=S.combineDateTime(null,e)),e}isDateAllowed(e){if(!e||this.allowedDates.length===0||this.embedded)return!0;let t=S.trunc(e).getTime();return this.allowedDates.some(i=>i.getTime()===t)}_valueEquals(e,t){return S.equals(e,t)}setAutoDate(e){this.setProperty("autoDate",e)}_setAutoDate(e){e=S.ensure(e),this._setProperty("autoDate",e)}setAllowedDates(e){this.setProperty("allowedDates",e)}_setAllowedDates(e){let t=[];p.ensure(e).forEach(i=>{i&&t.push(S.trunc(S.ensure(i)))}),t=t.sort(S.compare),this._setProperty("allowedDates",t)}_renderErrorStatus(){super._renderErrorStatus();let e=!!this.errorStatus,t=this._errorStatusClass();this.$dateField&&(this._updateErrorStatusClassesOnElement(this.$dateField,t,e),this._updateErrorStatusClassesOnElement(this._$predictDateField,t,e)),this.$timeField&&(this._updateErrorStatusClassesOnElement(this.$timeField,t,e),this._updateErrorStatusClassesOnElement(this._$predictTimeField,t,e)),this.popup&&this._updateErrorStatusClassesOnElement(this.popup.$container,t,e)}_errorStatusClass(){return this.errorStatus&&!this._isSuppressStatusField()?"has-"+this.errorStatus.cssClass():""}_renderFont(){this.$dateField&&L.legacyFont(this,this.$dateField),this.$timeField&&L.legacyFont(this,this.$timeField)}_renderForegroundColor(){this.$dateField&&L.legacyForegroundColor(this,this.$dateField),this.$timeField&&L.legacyForegroundColor(this,this.$timeField)}_renderBackgroundColor(){this.$dateField&&L.legacyBackgroundColor(this,this.$dateField),this.$timeField&&L.legacyBackgroundColor(this,this.$timeField)}activate(){!this.enabledComputed||!this.rendered||(this.$dateField?(this.$dateField.focus(),this._onDateFieldMouseDown()):this.$timeField&&(this.$timeField.focus(),this._onTimeFieldMouseDown()))}getFocusableElement(){return this.$dateField?this.$dateField:this.$timeField?this.$timeField:null}_onDateFieldMouseDown(){oe.handleOnClick(this)&&this.openDatePopupAndSelect(this.value)}_onTimeFieldMouseDown(){oe.handleOnClick(this)&&this.openTimePopupAndSelect(this.value)}setDateFocused(e){this.setProperty("dateFocused",e)}_renderDateFocused(){this.$container.toggleClass("date-focused",this.dateFocused)}_updateTimeHasText(){this.setTimeHasText(_.hasText(this._readTimeDisplayText()))}setTimeHasText(e){this.setProperty("timeHasText",e)}_renderTimeHasText(){this.$timeField&&this.$timeField.toggleClass("has-text",this.timeHasText),this.$container.toggleClass("time-has-text",this.timeHasText)}_updateDateHasText(){this.setDateHasText(_.hasText(this._readDateDisplayText()))}setDateHasText(e){this.setProperty("dateHasText",e)}_renderDateHasText(){this.$dateField&&this.$dateField.toggleClass("has-text",this.dateHasText),this.$container.toggleClass("date-has-text",this.dateHasText)}clear(){if(!(this.hasDate&&this.hasTime)){super.clear();return}this._clear(),!this.dateFocused&&!this.timeFocused&&this.acceptInput(),this._triggerClear()}_clear(){this._removePredictionFields(),this.hasDate&&!this.timeFocused&&(oe.valOrText(this.$dateField,""),this._setDateValid(!0),this._updateDateHasText()),this.hasTime&&!this.dateFocused&&(oe.valOrText(this.$timeField,""),this._setTimeValid(!0),this._updateTimeHasText())}_onDateClearIconMouseDown(e){this.enabledComputed&&(this.$dateField.focus(),this.clear(),this.value?this.selectDate(this.value,!1):this.preselectDate(this._referenceDate(),!1),e.preventDefault())}_onDateIconMouseDown(e){this.enabledComputed&&(this.$dateField.focus(),this.embedded||this.openDatePopupAndSelect(this.value))}setTimeFocused(e){this.setProperty("timeFocused",e)}_renderTimeFocused(){this.$container.toggleClass("time-focused",this.timeFocused)}_renderClearable(){this._renderDateClearable(),this._renderTimeClearable(),this._updateClearableStyles()}_renderDateClearable(){this.hasDate&&this.isClearable()?this.$dateClearIcon||(this.$dateClearIcon=this.$field.appendSpan("icon date-clear unfocusable text-field-icon action").on("mousedown",this._onDateClearIconMouseDown.bind(this)),T.role(this.$dateClearIcon,"button"),T.label(this.$dateClearIcon,this.session.text("ui.ClearField"),!0)):this.$dateClearIcon&&(this.$dateClearIcon.remove(),this.$dateClearIcon=null)}_renderTimeClearable(){this.hasTime&&this.isClearable()?this.$timeClearIcon||(this.$timeClearIcon=this.$field.appendSpan("icon time-clear unfocusable text-field-icon action").on("mousedown",this._onTimeClearIconMouseDown.bind(this)),T.role(this.$timeClearIcon,"button"),T.label(this.$timeClearIcon,this.session.text("ui.ClearField"),!0)):this.$timeClearIcon&&(this.$timeClearIcon.remove(),this.$timeClearIcon=null)}_onTimeClearIconMouseDown(e){this.enabledComputed&&(this.$timeField.focus(),this.clear(),this.value?this.selectTime(this.value):this.preselectTime(this._referenceDate()),e.preventDefault())}_onTimeIconMouseDown(e){this.enabledComputed&&(this.$timeField.focus(),this.embedded||this.openTimePopupAndSelect(this.value))}_onDateFieldBlur(e){this.setFocused(!1),this.setDateFocused(!1),!this.embedded&&(this.popup instanceof Pl&&this.closePopup(),this.setDateFocused(!1),this.acceptDate(),this._removePredictionFields())}_onDateFieldFocus(e){this.setFocused(!0),this.setDateFocused(!0)}_onTimeFieldBlur(e){this._tempTimeDate=null,this.setFocused(!1),this.setTimeFocused(!1),!this.embedded&&(this.popup instanceof Gl&&this.closePopup(),this._tempTimeDate=null,this.setTimeFocused(!1),this.acceptTime(),this._removePredictionFields())}_onTimeFieldFocus(){this.setFocused(!0),this.setTimeFocused(!0)}_onDateFieldKeyDown(e){let t=0,i=0,s=0,r=0,o=this.$dateField[0].selectionStart,l=oe.valOrText(this.$dateField),a=this._$predictDateField&&oe.valOrText(this._$predictDateField),d=(e.ctrlKey?1:0)+(e.shiftKey?1:0)+(e.altKey?1:0)+(e.metaKey?1:0),c=this.value||this._referenceDate(),f=!0,g=e.which;if(this.hasTime&&this.mode===A.Mode.CELLEDITOR&&g===m.TAB&&d===0){e.stopPropagation();return}if(!(g===m.TAB||g===m.SHIFT||g===m.HOME||g===m.END||g===m.CTRL||g===m.ALT)){if(g===m.ENTER){(this.popup||this._$predictDateField)&&(this.acceptDate(),this.closePopup(),h().suppressEvent(e));return}if(g===m.ESC){this.popup&&(this.closePopup(),h().suppressEvent(e));return}if(g===m.RIGHT&&o===l.length){a&&this._setDateDisplayText(a.substring(0,l.length+1));return}if((g===m.UP||g===m.DOWN||g===m.PAGE_UP||g===m.PAGE_DOWN)&&l&&!this._isDateValid()){let y=this.isolatedDateFormat.parse(l,c);y&&(c=y,this._setDateValid(!0))}if(g===m.PAGE_UP||g===m.PAGE_DOWN){!l||!this._isDateValid()?(c=this._referenceDate(),this.hasTime&&(c=S.combineDateTime(c,this.value||this._referenceDate())),this.openDatePopupAndSelect(c),this._updateDisplayText(c),this._setDateValid(!0),f=!1):this.popup||this.openDatePopupAndSelect(c),f&&(s=g===m.PAGE_UP?-1:1,this.shiftSelectedDate(0,s,0),this._updateDisplayText(this.getDatePicker().selectedDate)),h().suppressEvent(e);return}if(g===m.UP||g===m.DOWN){if(t=g===m.UP?-1:1,(e.ctrlKey||e.metaKey)&&d===1)i=t;else if(e.shiftKey&&d===1)s=t;else if(d===0)r=t;else{h().suppressEvent(e);return}!l||!this._isDateValid()?(c=this._referenceDate(),this.hasTime&&(c=S.combineDateTime(c,this.value||this._referenceDate())),this.openDatePopupAndSelect(c),this._updateDisplayText(c),this._setDateValid(!0),f=!1):this.popup||this.openDatePopupAndSelect(c),f&&(this.shiftSelectedDate(i,s,r),this._updateDisplayText(this.getDatePicker().selectedDate)),h().suppressEvent(e)}}}_onDateFieldInput(e){let t=oe.valOrText(this.$dateField);if(this.$dateField[0]!==this.$dateField.activeElement(!0))return;this._$predictDateField||(this._$predictDateField=this._createPredictionField(this.$dateField)),this._removePredictErrorStatus();let i=this._predictDate(t);i?(oe.valOrText(this._$predictDateField,i.text),this.openDatePopupAndSelect(i.date)):this._removePredictionFields(),this._updateDateHasText(),setTimeout(()=>{this._$predictDateField&&this._$predictDateField.setVisible(this.$dateField.scrollLeft()===0)},50)}acceptInput(e){let t=u.nvl(this._readDisplayText(),""),i=this._checkDisplayTextChanged(t);if(i)this.parseAndSetValue(t);else{let s=this.value;this.parseAndSetValue(t),S.equals(this.value,s)||(i=!0)}i&&this._triggerAcceptInput(e)}acceptDate(){let e=this.containsStatus(di);this.hasTime&&!e&&_.empty(this.$dateField.val())&&this.$timeField.val(""),this.acceptInput()}acceptTime(){let e=this.containsStatus(di);this.hasDate&&!e&&_.empty(this.$timeField.val())&&this.$dateField.val(""),this.acceptInput()}acceptDateTime(e,t){e?this.acceptDate():t&&this.acceptTime()}_onTimeFieldKeyDown(e){let t=0,i=0,s=0,r=0,o=this.$timeField[0].selectionStart,l=this.$timeField.val(),a=this._$predictTimeField&&this._$predictTimeField.val(),d=(e.ctrlKey?1:0)+(e.shiftKey?1:0)+(e.altKey?1:0)+(e.metaKey?1:0),c=this.value||this._referenceDate(),f=!0,g=e.which;if(this.hasDate&&this.mode===A.Mode.CELLEDITOR&&g===m.TAB&&e.shiftKey&&d===1){e.stopPropagation();return}if(!(g===m.TAB||g===m.SHIFT||g===m.HOME||g===m.END||g===m.CTRL||g===m.ALT)){if(g===m.ENTER){(this.popup||this._$predictDateField)&&(this._tempTimeDate=null,this.acceptTime(),this.closePopup(),h().suppressEvent(e));return}if(g===m.ESC){this.popup&&(this.closePopup(),h().suppressEvent(e));return}if(g===m.RIGHT&&o===l.length){a&&this._setTimeDisplayText(a.substring(0,l.length+1));return}if(g===m.UP||g===m.DOWN){if(t=g===m.UP?-1:1,e.ctrlKey&&d===1)r=t;else if(e.shiftKey&&d===1)i=t;else if(d===0)s=t;else{h().suppressEvent(e);return}if(this.hasTimePopup)!l||!this._isTimeValid()?(c=this._referenceDate(),this.openTimePopupAndSelect(c),this._updateDisplayText(c),this._setTimeValid(!0),f=!1):this.popup||this.openTimePopupAndSelect(c),f&&(this.shiftSelectedTime(i,s,r),this._updateDisplayText(this.getTimePicker().selectedTime)),h().suppressEvent(e);else{if(!this._tempTimeDate){let y=this._predictTime(l);y&&y.date?this._tempTimeDate=y.date:(this._tempTimeDate=this._referenceDate(),f=!1)}f&&(this._tempTimeDate=S.shiftTime(this._tempTimeDate,i,s,r)),this.hasDate&&(this._tempTimeDate=S.combineDateTime(this.value||this._referenceDate(),this._tempTimeDate)),this._updateDisplayText(this._tempTimeDate),this._setTimeValid(!0),h().suppressEvent(e)}}}}_onTimeFieldInput(e){let t=this.$timeField.val();if(this.$timeField[0]!==this.$timeField.activeElement(!0))return;this._$predictTimeField||(this._$predictTimeField=this._createPredictionField(this.$timeField));let i=this._predictTime(t);i?(this._$predictTimeField.val(i.text),this.openTimePopupAndSelect(i.date)):(this._tempTimeDate=null,this._removePredictionFields()),this._updateTimeHasText(),setTimeout(()=>{this._$predictTimeField&&this._$predictTimeField.setVisible(this.$timeField.scrollLeft()===0)},50)}_onDatePickerDateSelect(e){this._setNewDateTimeValue(this._newTimestampAsDate(e.date,this.value))}_onTimePickerTimeSelect(e){this._setNewDateTimeValue(this._newTimestampAsDate(this.value,e.time))}_setNewDateTimeValue(e){this._setDateValid(!0),this._setTimeValid(!0),this.setValue(e),this._triggerAcceptInput(!1),this.closePopup()}_createPredictionField(e){this.setSuppressStatus(A.SuppressStatus.ALL);let t=e.clone().addClass("predict").attr("tabindex","-2").insertBefore(e);return e.hasClass("has-error")&&t.addClass("has-error"),t}_removePredictionFields(){this.setSuppressStatus(null),this._$predictDateField&&(this._$predictDateField.remove(),this._$predictDateField=null),this._$predictTimeField&&(this._$predictTimeField.remove(),this._$predictTimeField=null)}_setDateDisplayText(e){this.dateDisplayText=e,this._updateDisplayTextProperty(),this.rendered&&this._renderDateDisplayText()}_setTimeDisplayText(e){this.timeDisplayText=e,this._updateDisplayTextProperty(),this.rendered&&this._renderTimeDisplayText()}_computeDisplayText(e,t){let i=e||"",s=t||"",r=(this.hasDate?i:"")+(this.hasDate&&this.hasTime?`
`:"")+(this.hasTime?s:"");return r===`
`&&(r=""),r}_splitDisplayText(e){let t="",i="";if(_.hasText(e)){let s=e.split(`
`);t=this.hasDate?s[0]:"",i=this.hasTime?this.hasDate?s[1]:s[0]:""}return{dateText:t,timeText:i}}_updateDisplayTextProperty(){this._setProperty("displayText",this._computeDisplayText(this.dateDisplayText,this.timeDisplayText))}aboutToBlurByMouseDown(e){let t=this.$dateField?this.$dateField.isOrHas(e)||this.$dateFieldIcon.isOrHas(e)||this.$dateClearIcon&&this.$dateClearIcon.isOrHas(e):!1,i=this.$timeField?this.$timeField.isOrHas(e)||this.$timeFieldIcon.isOrHas(e)||this.$timeClearIcon&&this.$timeClearIcon.isOrHas(e):!1,s=this.popup&&this.popup.$container.isOrHas(e),r=this.fieldStatus&&this.fieldStatus.$container.isOrHas(e),o=this.getDatePicker(),l=this.getTimePicker();if(!t&&!i&&!s&&!r){let a=Qe.isActiveElement(this.$dateField),d=Qe.isActiveElement(this.$timeField);this.acceptDateTime(a,d);return}if(this.embedded){let a=o&&o.$container.isOrHas(e),d=l&&l.$container.isOrHas(e);a&&d&&this.acceptTime()}}_newTimestampAsDate(e,t){let i=null;return(e||t)&&(i=this.value||this._referenceDate(),e&&(i=S.combineDateTime(e,i)),t&&(i=S.combineDateTime(i,t))),i}_referenceDate(){let e=this.autoDate||S.ceil(S.newDate(),this.timePickerResolution);return this.autoDate?e=this.autoDate:this.hasTime?e=S.ceil(S.newDate(),this.timePickerResolution):e=S.trunc(S.newDate()),this.allowedDates&&(e=this._findAllowedReferenceDate(e)),e}_findAllowedReferenceDate(e){for(let t=0;t<this.allowedDates.length;t++){let i=this.allowedDates[t];if(S.compare(i,e)>=0)return i}for(let t=this.allowedDates.length-1;t>=0;t--){let i=this.allowedDates[t];if(S.compare(i,e)<=0)return i}return e}openDatePopup(){this.popup||(this.popup=this.createDatePopup(),this.popup.open(),this.$dateField.addClass("focused"),this.popup.one("destroy",e=>{this.$dateField.removeClass("focused"),this._onPopupDestroy(e),this.popup=null}),this.getDatePicker().on("dateSelect",this._onDatePickerDateSelect.bind(this)))}closePopup(){this.popup&&this.popup.close()}toggleDatePopup(){h().log.isInfoEnabled()&&h().log.info("(DateField#toggleDatePopup) popupOpen=",!!this.popup),this.popup?this.closePopup():this.openDatePopupAndSelect(this.value)}openTimePopup(){!this.hasTimePopup||this.popup||(this.popup=this.createTimePopup(),this.popup.open(),this.$timeField.addClass("focused"),this.popup.one("destroy",e=>{this.$timeField.removeClass("focused"),this._onPopupDestroy(e),this.popup=null}),this.getTimePicker().on("timeSelect",this._onTimePickerTimeSelect.bind(this)))}toggleTimePopup(){h().log.isInfoEnabled()&&h().log.info("(DateField#toggleTimePopup) popupOpen=",!!this.popup),this.popup?this.closePopup():this.openTimePopupAndSelect(this.value)}_parseValue(e){let t=this._splitDisplayText(e),i=t.dateText,s={},r=t.timeText,o={},l=!0;if(this._removePredictErrorStatus(),this.hasDate&&(s=this._predictDate(i),s||(l=!1),this._setDateDisplayText(i)),this.hasTime&&(o=this._predictTime(r),o||(l=!1),this._setTimeDisplayText(r)),!l)throw new sa;return s.date||o.date?this._newTimestampAsDate(s.date,o.date):null}_addParsingFailedErrorStatus(e,t){t instanceof sa||super._addParsingFailedErrorStatus(e,t)}_predictDate(e){e=e||"";let t=e.match(/^([+-])(\d*)$/);if(t){let l=S.newDate(),a=Number(t[1]+(t[2]||"0"));return l.setDate(l.getDate()+a),isNaN(l.valueOf())||l.getDate()<0?(this._setDateValid(!1),null):(this._setDateValid(!0),{date:l,text:e})}let i=this._analyzeInputAsDate(e,this.value||this._referenceDate());if(i.error)return this._setDateValid(!1),null;if(!i.predictedDate)return this._setDateValid(!0),{date:null,text:""};let s=i.predictedDate,o=new St(this.isolatedDateFormat.locale,i.parsedPattern).format(s,{analyzeInfo:i});return t=o.match(new RegExp("^"+_.quote(e)+"(.*)$","i")),t&&(o=e+t[1]),o.startsWith(e)||(o=e),this._setDateValid(!0),{date:s,text:o}}_predictTime(e){e=e||"";let t=this._analyzeInputAsTime(e,this.value||this._referenceDate());if(t.error)return this._setTimeValid(!1),null;if(!t.predictedDate)return this._setTimeValid(!0),{date:null,text:""};let i=t.predictedDate,r=new St(this.isolatedTimeFormat.locale,t.parsedPattern).format(i,{analyzeInfo:t}),o=r.match(new RegExp("^"+_.quote(e)+"(.*)$","i"));return o&&(r=e+o[1]),r.startsWith(e)||(r=e),this._setTimeValid(!0),{date:i,text:r}}_analyzeInputAsDate(e,t){return this.isolatedDateFormat.analyze(e,t)}_analyzeInputAsTime(e,t){return this.isolatedTimeFormat.analyze(e,t)}_setErrorStatusPart(e,t){let i=null,s=null;this.errorStatus&&(s=p.find(this.errorStatus.asFlatList(),Ht.PARSE_ERROR_PREDICATE)),s?i=s:i=new di({message:this.session.text("ui.InvalidDate"),severity:E.Severity.ERROR,code:Ht.ErrorCode.PARSE_ERROR}),t?delete i[e]:i[e]=!0,!i.hasOwnProperty("invalidDate")&&!i.hasOwnProperty("invalidTime")&&(i=null),i&&!s?this.addErrorStatus(i):!i&&s&&this._removePredictErrorStatus()}_removePredictErrorStatus(){this.removeErrorStatusByPredicate(Ht.PARSE_ERROR_PREDICATE)}_createInvalidValueStatus(e,t,i){let s=super._createInvalidValueStatus(e,t,i);return s.invalidDate=!0,s.invalidTime=!0,s.code=Ht.ErrorCode.PARSE_ERROR,s}_setDateValid(e){this._setErrorStatusPart("invalidDate",e)}_setTimeValid(e){this._setErrorStatusPart("invalidTime",e)}_isErrorStatusPartValid(e){return this.errorStatus?!this.errorStatus.asFlatList().some(t=>!!t[e]):!0}_isDateValid(){return this._isErrorStatusPartValid("invalidDate")}_isTimeValid(){return this._isErrorStatusPartValid("invalidTime")}onCellEditorRendered(e){e.openFieldPopup&&(this.hasDate&&!this.hasTime?this.openDatePopupAndSelect(this.value):!this.hasDate&&this.hasTime?this.openTimePopupAndSelect(this.value):w.get().supportsOnlyTouch()||this.openDatePopupAndSelect(this.value)),this.touchMode&&(this._cellEditorPopup=e.cellEditorPopup)}_onPopupDestroy(e){!this.touchMode||!this._cellEditorPopup||this.hasDate&&this.hasTime||(this._cellEditorPopup.completeEdit(),this._cellEditorPopup=null)}prepareForCellEdit(e){e=e||{},super.prepareForCellEdit(e),this.$field.removeClass("cell-editor-field first last"),this.$dateField&&this.addCellEditorFieldCssClasses(this.$dateField,e),this.$timeField&&(this.$dateField||(e.cssClass=""),this.addCellEditorFieldCssClasses(this.$timeField,e))}getDatePicker(){if(this.popup&&this.popup.getDatePicker)return this.popup.getDatePicker()}openDatePopupAndSelect(e){this.openDatePopup(),e?this.selectDate(e,!1):this.preselectDate(this._referenceDate(),!1)}preselectDate(e,t){let i=this.getDatePicker();i&&i.preselectDate(e,t)}selectDate(e,t){let i=this.getDatePicker();i&&i.selectDate(e,t)}getTimePicker(){if(this.popup&&this.popup.getTimePicker)return this.popup.getTimePicker()}openTimePopupAndSelect(e){this.hasTimePopup&&(this.openTimePopup(),e?this.selectTime(e):this.preselectTime(this._referenceDate()))}preselectTime(e){let t=this.getTimePicker();t&&t.preselectTime(e)}selectTime(e){let t=this.getTimePicker();t&&t.selectTime(e)}shiftSelectedDate(e,t,i){this.openDatePopup(),this.getDatePicker().shiftSelectedDate(e,t,i)}shiftSelectedTime(e,t,i){this.openTimePopup(),this.getTimePicker().shiftSelectedTime(e,t,i)}_formatValue(e){let t="",i="";return this.hasDate&&(e&&(t=this.isolatedDateFormat.format(e)),this.dateDisplayText=t),this.hasTime&&(e&&(i=this.isolatedTimeFormat.format(e)),this.timeDisplayText=i),this._computeDisplayText(this.dateDisplayText,this.timeDisplayText)}_renderFieldStyle(){super._renderFieldStyle(),this._renderFieldStyleInternal(this.$dateField),this._renderFieldStyleInternal(this.$timeField)}_renderDisabledStyle(){super._renderDisabledStyle(),this._renderDisabledStyleInternal(this.$dateField),this._renderDisabledStyleInternal(this.$timeField)}_triggerAcceptInput(e){let t={displayText:this.displayText,errorStatus:this.errorStatus,value:this.value,whileTyping:!!e};this.trigger("acceptInput",t)}}class ko extends At{constructor(){super(),this._addOrderedProperties(["hasTime","hasDate"])}_onWidgetAcceptInput(e){let t=null,i=this.widget.errorStatus;i&&i.hasChildren()&&(t=p.find(i.asFlatList(),r=>r instanceof di));let s={displayText:this.widget.displayText,errorStatus:t};t||(s.value=S.toJsonDate(this.widget.value)),this._send("acceptInput",s,{showBusyIndicator:!e.whileTyping,coalesce:function(r){return this.target===r.target&&this.type===r.type}})}static isDateAllowedRemote(e){return this.modelAdapter?!0:this.isDateAllowedOrig(e)}static modifyPrototype(){G.get().remote&&b.replacePrototypeFunction(Ht,Ht.prototype.isDateAllowed,ko.isDateAllowedRemote,!0)}}G.addListener("bootstrap",ko.modifyPrototype);class ju extends ne{MIN_DATE_FIELD_WIDTH;PREF_DATE_FIELD_WIDTH;MIN_TIME_FIELD_WIDTH;PREF_TIME_FIELD_WIDTH;htmlPropertyChangeHandler;hgap;_dateField;constructor(e){super(),this._dateField=e,this.MIN_DATE_FIELD_WIDTH=90,this.PREF_DATE_FIELD_WIDTH=110,this.MIN_TIME_FIELD_WIDTH=60,this.PREF_TIME_FIELD_WIDTH=90,this._initDefaults(),this.htmlPropertyChangeHandler=this._onHtmlEnvironmentPropertyChange.bind(this),we.get().on("propertyChange",this.htmlPropertyChangeHandler),this._dateField.one("remove",()=>we.get().off("propertyChange",this.htmlPropertyChangeHandler))}_initDefaults(){this.hgap=we.get().smallColumnGap}_onHtmlEnvironmentPropertyChange(){this._initDefaults(),this._dateField.invalidateLayoutTree()}layout(e){let t=x.get(e),i=this._dateField.$dateField,s=this._dateField.$timeField,r=this._dateField.$dateFieldIcon,o=this._dateField.$timeFieldIcon,l=this._dateField.$dateClearIcon,a=this._dateField.$timeClearIcon,d=this._dateField._$predictDateField,c=this._dateField._$predictTimeField,f=i?x.get(i):null,g=s?x.get(s):null,y=i?!i.isDisplayNone():!1,v=s?!s.isDisplayNone():!1,D=t.availableSize({exact:!0}).subtract(t.insets()),k,V;if(y&&v){let ve=f.margins(),Ze=g.margins(),nt=new We(Math.max(ve.top,Ze.top),Math.max(ve.right,Ze.right),Math.max(ve.bottom,Ze.bottom),Math.max(ve.left,Ze.left)),ei=D.subtract(nt),Mt=this._hgap(),ti=ei.width-Mt,Yn=ti*.6,Xn=ti-Yn;k=new F(Yn,ei.height),V=new F(Xn,ei.height),f.setSize(k),g.setSize(V),s.cssRight(0),r.cssTop(i.cssBorderTopWidth()).cssRight(Xn+Mt).cssHeight(k.height-i.cssBorderWidthY()),l&&l.cssTop(i.cssBorderTopWidth()).cssRight(Xn+Mt+i.cssBorderRightWidth()).cssHeight(k.height-i.cssBorderWidthY()),o.cssTop(s.cssBorderTopWidth()).cssRight(0).cssHeight(V.height-s.cssBorderWidthY()),a&&a.cssTop(s.cssBorderTopWidth()).cssRight(s.cssBorderRightWidth()).cssHeight(V.height-s.cssBorderWidthY()),i.toggleClass("compact",k.width<this.MIN_DATE_FIELD_WIDTH),s.toggleClass("compact",V.width<this.MIN_TIME_FIELD_WIDTH),this._dateField.$container.toggleClass("compact-date",k.width<this.MIN_DATE_FIELD_WIDTH),this._dateField.$container.toggleClass("compact-time",V.width<this.MIN_TIME_FIELD_WIDTH),d&&C.setSize(d,k),c&&(C.setSize(c,V),c.cssRight(0))}else y?(k=D.subtract(f.margins()),f.setSize(k),r.cssTop(i.cssBorderTopWidth()).cssRight(0).cssHeight(k.height-i.cssBorderWidthY()),l&&l.cssTop(i.cssBorderTopWidth()).cssRight(i.cssBorderRightWidth()).cssHeight(k.height-i.cssBorderWidthY()),i.toggleClass("compact",k.width<this.MIN_DATE_FIELD_WIDTH),this._dateField.$container.toggleClass("compact-date",k.width<this.MIN_DATE_FIELD_WIDTH),d&&C.setSize(d,k)):v&&(V=D.subtract(g.margins()),g.setSize(V),o.cssTop(s.cssBorderTopWidth()).cssRight(0).cssHeight(V.height-s.cssBorderWidthY()),a&&a.cssTop(s.cssBorderTopWidth()).cssRight(s.cssBorderRightWidth()).cssHeight(V.height-s.cssBorderWidthY()),s.toggleClass("compact",V.width<this.MIN_TIME_FIELD_WIDTH),this._dateField.$container.toggleClass("compact-time",V.width<this.MIN_TIME_FIELD_WIDTH),c&&C.setSize(c,V));let Q=this._dateField.popup;Q&&Q.rendered&&Q.position()}_hgap(){return this.hgap}preferredLayoutSize(e,t){let i=new F,s=this._dateField.$dateField,r=this._dateField.$timeField,o=s?!s.isDisplayNone():!1,l=r?!r.isDisplayNone():!1;return o&&l?(i=C.prefSize(this._dateField.$dateField),i.width=this.PREF_DATE_FIELD_WIDTH+this._hgap()+this.PREF_TIME_FIELD_WIDTH):o?(i=C.prefSize(this._dateField.$dateField),i.width=this.PREF_DATE_FIELD_WIDTH):l&&(i=C.prefSize(this._dateField.$timeField),i.width=this.PREF_TIME_FIELD_WIDTH),i}}class Lg extends ge{button;fileInput;acceptTypes;maximumUploadSize;iconId;fileExtensions;constructor(){super(),this.button=null,this.fileInput=null,this.acceptTypes=null,this.maximumUploadSize=Ei.DEFAULT_MAXIMUM_UPLOAD_SIZE}_init(e){super._init(e),this.button=u.create(Oe,{parent:this,label:this._buttonLabel(),iconId:this.iconId,labelHtmlEnabled:this.labelHtmlEnabled}),this.button.on("click",this._onButtonClick.bind(this)),this.fileInput.on("change",this._onFileChange.bind(this)),this.on("propertyChange",t=>{t.propertyName==="enabledComputed"&&(this.button.setEnabled(t.newValue),this.fileInput.setEnabled(t.newValue))})}_initValue(e){this.fileInput=u.create(Ei,{parent:this,acceptTypes:this.acceptTypes,text:this.displayText,enabled:this.enabledComputed,maximumUploadSize:this.maximumUploadSize,visible:!w.get().supportsFile()}),super._initValue(e)}_buttonLabel(){return this.label}_render(){this.addContainer(this.$parent,"file-chooser-button has-icon"),this.addLabel();let e=this.$parent.makeDiv(),t=x.install(e,this.session);this.button.render(e),t.setLayout(new ji(this.button.htmlComp)),this.fileInput.render(e),this.addField(e),e.setTabbable(!1),this.addStatus()}setDisplayText(e){super.setDisplayText(e),this.fileInput.setText(e),e||this.fileInput.clear()}_readDisplayText(){return this.fileInput.text}_renderLabel(){this._renderEmptyLabel()}_onButtonClick(e){this.fileInput.browse()}setLabel(e){super.setLabel(e),this.button.setLabel(this._buttonLabel())}setIconId(e){this.setProperty("iconId",e),this.button.setIconId(e)}setAcceptTypes(e){this.setProperty("acceptTypes",e),this.fileInput.setAcceptTypes(e)}setFileExtensions(e){this.setProperty("fileExtensions",e);let t=p.ensure(e);t=t.map(i=>i.indexOf(".")===0?i:"."+i),this.setAcceptTypes(_.join(",",...t)),this.fileInput.acceptTypes=this.acceptTypes}setMaximumUploadSize(e){this.setProperty("maximumUploadSize",e),this.fileInput.setMaximumUploadSize(e)}_onFileChange(e){this.setValue(p.first(e.files))}_validateValue(e){return this.fileInput.validateMaximumUploadSize(e),e}_formatValue(e){return e?e.name:""}getFocusableElement(){return this.button.getFocusableElement()}}class Bg extends At{_onWidgetPropertyChange(e){super._onWidgetPropertyChange(e),e.propertyName==="value"&&this._onValueChange(e)}_onValueChange(e){this.widget.fileInput.upload()||this.widget.fileInput.clear()}_syncDisplayText(e){this.widget.setDisplayText(e)}}class Og extends ge{fileInput;acceptTypes;maximumUploadSize;constructor(){super(),this.fileInput=null,this.acceptTypes=null,this.maximumUploadSize=Ei.DEFAULT_MAXIMUM_UPLOAD_SIZE}_init(e){super._init(e),this.fileInput.on("change",this._onFileChange.bind(this)),this.on("propertyChange",t=>{t.propertyName==="enabledComputed"&&this.fileInput.setEnabled(t.newValue)})}_initValue(e){this.fileInput=u.create(Ei,{parent:this,acceptTypes:this.acceptTypes,text:this.displayText,enabled:this.enabledComputed,maximumUploadSize:this.maximumUploadSize}),super._initValue(e)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new qu(this)),this.keyStrokeContext.registerKeyStroke(new Yu(this))}_render(){this.addContainer(this.$parent,"file-chooser-field has-icon"),this.addLabel(),this.addMandatoryIndicator(),this._renderFileInput(),this.addIcon(),this.addStatus(),this._addAriaFieldDescription()}_renderFileInput(){this.fileInput.render(),this.addField(this.fileInput.$container)}setDisplayText(e){super.setDisplayText(e),this.fileInput.setText(e),e||this.fileInput.clear()}_readDisplayText(){return this.fileInput.text}setAcceptTypes(e){this.setProperty("acceptTypes",e),this.fileInput.setAcceptTypes(e)}_renderEnabled(){super._renderEnabled(),this.$field.setTabbable(this.enabledComputed)}_renderPlaceholder(){let e=this.fileInput.$text;e&&e.placeholder(this.label)}_removePlaceholder(){let e=this.fileInput.$text;e&&e.placeholder("")}setMaximumUploadSize(e){this.setProperty("maximumUploadSize",e),this.fileInput.setMaximumUploadSize(e)}_clear(){this.fileInput.clear()}_onIconMouseDown(e){super._onIconMouseDown(e),this.activate()}_onFileChange(e){let t=p.first(e.files);b.isNullOrUndefined(t)&&this.acceptInput(!1),this.setValue(t)}activate(){!this.enabledComputed||!this.rendered||(this.$field.focus(),this.fileInput.browse())}_validateValue(e){return this.fileInput.validateMaximumUploadSize(e),e}_formatValue(e){return e?e.name:""}_parseValue(e){if(!e)return null;let t=this.fileInput.files;return t&&t.length?t[0]:null}_addAriaFieldDescription(){T.addHiddenDescriptionAndLinkToElement(this.fileInput.$fileInput,this.id+"-func-desc",this.session.text("ui.AriaFileChooserFieldDescription"))}}class Hg extends At{constructor(){super(),this._addOrderedProperties(["value","displayText"])}_onWidgetPropertyChange(e){super._onWidgetPropertyChange(e),e.propertyName==="value"&&this._onValueChange(e)}_onValueChange(e){this.widget.fileInput.upload()||this.widget.fileInput.clear()}_syncDisplayText(e){this.widget.setDisplayText(e)}}class qu extends B{constructor(e){super(),this.field=e,this.which=[m.SPACE],this.stopPropagation=!0,this.renderingHints.hAlign=ut.LEFT,this.renderingHints.$drawingArea=(t,i)=>this.field.$fieldContainer}handle(e){this.field.fileInput.browse()}}class Yu extends B{constructor(e){super(),this.field=e,this.which=[m.DELETE],this.stopPropagation=!0,this.renderingHints.offset=25,this.renderingHints.hAlign=ut.RIGHT,this.renderingHints.$drawingArea=(t,i)=>this.field.$fieldContainer}handle(e){this.field.clear()}}class ae extends ar{fields;menuBarVisible;menuBarPosition;menuBarEllipsisPosition;notification;bodyLayoutConfig;borderDecoration;borderVisible;mainBox;menuBar;subLabel;scrollable;expandable;expanded;gridColumnCount;controls;systemButtons;customButtons;processButtons;processMenus;staticMenus;responsive;responsiveHandler;htmlBody;$header;$body;$title;$borderBottom;$subLabel;_statusPositionOrig;_collapsedWeightY;constructor(){super(),this._addWidgetProperties(["fields","notification","staticMenus"]),this._addCloneProperties(["menuBarVisible","bodyLayoutConfig","borderDecoration","borderVisible","expandable","expanded","gridColumnCount","scrollable","subLabel"]),this.fields=[],this.menuBarVisible=!0,this.menuBarPosition=ae.MenuBarPosition.AUTO,this.menuBarEllipsisPosition=Ce.EllipsisPosition.RIGHT,this.notification=null,this.bodyLayoutConfig=null,this.borderDecoration=ae.BorderDecoration.AUTO,this.borderVisible=!0,this.mainBox=!1,this.scrollable=null,this.expandable=!1,this.expanded=!0,this.logicalGrid=u.create(Th),this.gridColumnCount=2,this.gridDataHints.useUiHeight=!0,this.gridDataHints.w=A.FULL_WIDTH,this.controls=[],this.systemButtons=[],this.customButtons=[],this.processButtons=[],this.processMenus=[],this.staticMenus=[],this.responsive=null,this.$header=null,this.$body=null,this.$title=null,this.$subLabel=null,this._statusPositionOrig=null}static BorderDecoration={AUTO:"auto",EMPTY:"empty",LINE:"line"};static MenuBarPosition={AUTO:"auto",TOP:"top",BOTTOM:"bottom",TITLE:"title"};_init(e){super._init(e),this.resolveConsts([{property:"menuBarPosition",constType:ae.MenuBarPosition}]),this.resolveTextKeys(["subLabel"]),this._setBodyLayoutConfig(this.bodyLayoutConfig),this.menuBar=u.create(Ce,{parent:this,menuOrder:new Is,ellipsisPosition:this.menuBarEllipsisPosition}),this.menuBar.on("propertyChange:visible",()=>this._updateMenuBarStyle()),this._setFields(this.fields),this._setMainBox(this.mainBox),this._updateMenuBar(),pe.get().registerHandler(this,u.create(Po,{widget:this})),this._setResponsive(this.responsive)}_destroy(){pe.get().unregisterHandler(this),super._destroy()}getFields(){return this.fields}insertField(e,t){let i=this.fields.slice();t=u.nvl(t,this.fields.length),i.splice(t,0,e),this.setFields(i)}insertFieldBefore(e,t){u.assertParameter("sibling",t);let i=this.fields.indexOf(t);this.insertField(e,i)}insertFieldAfter(e,t){u.assertParameter("sibling",t);let i=this.fields.indexOf(t)+1;this.insertField(e,i)}deleteField(e){let t=this.fields.indexOf(e);if(t<0)return;let i=this.fields.slice();i.splice(t,1),this.setFields(i)}setFields(e){this.setProperty("fields",e)}_setFields(e){this._setProperty("fields",e),this._prepareFields()}_renderFields(e){this._renderExpanded(),this.invalidateLogicalGrid(!0)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.invokeAcceptInputOnActiveValueField=!0,this.keyStrokeContext.$bindTarget=this._keyStrokeBindTarget.bind(this)}_setKeyStrokes(e){e=p.ensure(e);let t={render:()=>!0,offset:0,hAlign:ut.RIGHT,$drawingArea:(i,s)=>this.$header&&this.$header.isVisible()?this.$header:this.$body};e.forEach(i=>{i.actionKeyStroke.renderingHints=h().extend({},i.actionKeyStroke.renderingHints,t)}),super._setKeyStrokes(e)}_keyStrokeBindTarget(){let e=this.getForm();return e?e.$container:this.$container}_render(){this.addContainer(this.$parent,this.mainBox?"root-group-box":"group-box"),this.$header=this.$container.appendDiv("group-box-header"),x.install(this.$header,this.session),this.$title=this.$header.appendDiv("title"),this.$borderBottom=this.$header.appendDiv("bottom-border"),this.addLabel(),this.addSubLabel(),this.addStatus(),this.$body=this.$container.appendDiv("group-box-body"),T.role(this.$body,"group"),this.htmlBody=x.install(this.$body,this.session),this.htmlBody.setLayout(this._createBodyLayout())}_remove(){this._removeSubLabel(),super._remove()}_renderProperties(){this._renderScrollable(),this._renderExpanded(),super._renderProperties(),this._renderBodyLayoutConfig(),this._renderNotification(),this._renderBorderVisible(),this._renderExpandable(),this._renderMenuBarPosition(),this._renderMenuBarEllipsisPosition(),this._renderMenuBarVisible(),this._renderSubLabel()}_createLayout(){return new ra(this)}_createBodyLayout(){return new xr(this,this.bodyLayoutConfig)}setBodyLayoutConfig(e){this.setProperty("bodyLayoutConfig",e)}_setBodyLayoutConfig(e){this._setProperty("bodyLayoutConfig",kt.ensure(e||{})),kt.initHtmlEnvChangeHandler(this,()=>this.bodyLayoutConfig,t=>this.setBodyLayoutConfig(t))}_renderBodyLayoutConfig(){let e=this.htmlBody.layout,t=e.minWidth;this.bodyLayoutConfig.applyToLayout(e),t!==this.bodyLayoutConfig.minWidth&&this._renderScrollable(),this.rendered&&this.htmlBody.invalidateLayoutTree()}rerenderControls(){this._removeControls(),this._renderControls(),this.htmlBody.invalidateLayoutTree()}_removeControls(){this.controls.forEach(e=>e.remove())}_renderControls(){this.controls.forEach(e=>{e.rendered||(e.render(this.$body),e.setLayoutData(new Sr(e)))})}addSubLabel(){this.$subLabel||(this.$subLabel=this.$title.appendDiv("sub-label"),Y.installForEllipsis(this.$subLabel,{parent:this}))}_removeSubLabel(){this.$subLabel&&(Y.uninstall(this.$subLabel),this.$subLabel.remove(),this.$subLabel=null)}setSubLabel(e){this.setProperty("subLabel",e)}_renderSubLabel(){this.$subLabel.setVisible(_.hasText(this.subLabel)),this.$subLabel.textOrNbsp(this.subLabel),this.$container.toggleClass("has-sub-label",this.$subLabel.isVisible()),this.invalidateLayoutTree()}setScrollable(e){this.setProperty("scrollable",e)}_renderScrollable(){this._uninstallScrollbars(),this.scrollable?this._installScrollbars({axis:this.bodyLayoutConfig.minWidth>0?"both":"y"}):this.bodyLayoutConfig.minWidth>0&&this._installScrollbars({axis:"x"})}get$Scrollable(){return this.$body}_onScroll(e){super._onScroll(e),this._updateScrollShadow()}_updateScrollShadow(){if(this.mainBox||!this.rendered)return;let e=this.hasScrollShadow("top"),t=this.hasScrollShadow("bottom"),i=this.$container.hasClass("has-scroll-shadow-top"),s=this.$container.hasClass("has-scroll-shadow-bottom"),r=this.$container.hasClass("menubar-position-top"),o=this.$container.hasClass("menubar-position-bottom"),l=this.$header.isVisible();this.$container.toggleClass("has-scroll-shadow-top",e),this.$container.toggleClass("has-scroll-shadow-bottom",t),((l||r)&&i!==e||o&&s!==t)&&this.invalidateLayoutTree(!1),oe.adjustStatusPositionForScrollShadow(this,()=>e&&l&&!r)}setMainBox(e){this.setProperty("mainBox",e)}_setMainBox(e){this._setProperty("mainBox",e),this.mainBox&&(this.menuBar.setCssClass("main-menubar"),this.scrollable===null&&this.setScrollable(!0),this.responsive===null&&this.setResponsive(!0))}addLabel(){this.$label||(this.$label=this.$title.appendDiv("label"),this._computeTitleVisible()&&T.linkElementWithHeader(this.$container,this.$label),Y.installForEllipsis(this.$label,{parent:this}))}_renderLabel(){this.$label.textOrNbsp(this.label),this._computeTitleVisible()&&T.linkElementWithLabel(this.$body,this.$label),this.rendered&&this._renderLabelVisible()}addStatus(){super.addStatus(),this._updateStatusPosition()}_renderStatusPosition(){this._updateStatusPosition()}_updateStatusPosition(){this.fieldStatus&&(this.statusPosition===A.StatusPosition.TOP?this.$status.appendTo(this.$header):this.$status.appendTo(this.$container),this.invalidateLayoutTree())}setNotification(e){this.setProperty("notification",e)}_renderNotification(){if(!this.notification){this.invalidateLayoutTree();return}this.notification.render(),this.notification.$container.insertBefore(this.$body),this.invalidateLayoutTree()}_prepareFields(){this.processButtons.forEach(this._unregisterButtonKeyStrokes.bind(this)),this.controls=[],this.systemButtons=[],this.customButtons=[],this.processButtons=[],this.processMenus=[];for(let e=0;e<this.fields.length;e++){let t=this.fields[e];if(t instanceof Oe)t.processButton?(this.processButtons.push(t),t.systemType!==Oe.SystemType.NONE?this.systemButtons.push(t):this.customButtons.push(t)):(this.controls.push(t),this._registerButtonKeyStrokes(t));else if(t instanceof In){this.controls.push(t);for(let i=0;i<t.tabItems.length;i++)t.tabItems[i].selectionKeystroke&&this.keyStrokeContext.registerKeyStroke(new Ac(t.tabItems[i].selectionKeystroke,t.tabItems[i]))}else this.controls.push(t)}this.processMenus=this.processButtons.map(e=>{let t=mn.adaptButtonProperties(e,{parent:this,menubar:this.menuBar,button:e,defaultMenu:e.defaultButton?!0:null});return u.create(mn,t)}),this.registerKeyStrokes(this.processMenus)}_unregisterButtonKeyStrokes(e){e.keyStrokes&&e.keyStrokes.forEach(t=>this.keyStrokeContext.unregisterKeyStroke(t))}_registerButtonKeyStrokes(e){e.keyStrokes&&e.keyStrokes.forEach(t=>this.keyStrokeContext.registerKeyStroke(t))}setBorderVisible(e){this.setProperty("borderVisible",e)}_renderBorderVisible(){let e=this.borderVisible;this.borderDecoration===ae.BorderDecoration.AUTO&&(e=this._computeBorderVisible(e)),this.$body.toggleClass("y-padding-invisible",!e),this.invalidateLayoutTree()}setBorderDecoration(e){this.setProperty("borderDecoration",e)}_renderBorderDecoration(){this._renderBorderVisible()}getContextMenuItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this.menuBarVisible?[]:super.getContextMenuItems(e)}setMenuBarVisible(e){this.setProperty("menuBarVisible",e)}_setMenuBarVisible(e){this._setProperty("menuBarVisible",e),this._updateMenuBar()}_renderMenuBarVisible(){this.menuBarVisible?this._renderMenuBar():this.menuBar.remove(),this._updateMenus(),this.invalidateLayoutTree()}_renderMenuBar(){if(this.menuBar.render(),this.menuBarPosition===ae.MenuBarPosition.TITLE){let e=this.$header.children(".group-box-control");e.length>0?this.menuBar.$container.insertAfter(e):this.menuBar.$container.insertAfter(this.$title)}else this.menuBar.position===Ce.Position.TOP&&this.menuBar.$container.insertAfter(this.$header)}setMenuBarPosition(e){this.setProperty("menuBarPosition",e)}_renderMenuBarPosition(){let e=this.menuBarPosition;if(e===ae.MenuBarPosition.AUTO&&(e=ae.MenuBarPosition.TOP,this.mainBox)){let t=this.getForm();t&&t.isDialog()&&(e=ae.MenuBarPosition.BOTTOM)}e===ae.MenuBarPosition.BOTTOM?this.menuBar.setPosition(Ce.Position.BOTTOM):this.menuBar.setPosition(Ce.Position.TOP),this._renderMenuBarStyle(),this.rendered&&(this.menuBar.remove(),this._renderMenuBarVisible())}setMenuBarEllipsisPosition(e){this.setProperty("menuBarEllipsisPosition",e),this.menuBar.setEllipsisPosition(e)}_renderMenuBarEllipsisPosition(){this.menuBar.reorderMenus(),this.rendered&&(this.menuBar.remove(),this._renderMenuBarVisible())}_updateMenuBarStyle(){this.rendered&&this._renderMenuBarStyle()}_renderMenuBarStyle(){let e=this.menuBar.visible,t=this.menuBarPosition===ae.MenuBarPosition.TITLE;this.$header.toggleClass("has-menubar",e&&t),this.$container.toggleClass("menubar-position-top",e&&!t&&this.menuBar.position===Ce.Position.TOP),this.$container.toggleClass("menubar-position-bottom",e&&!t&&this.menuBar.position===Ce.Position.BOTTOM)}_computeBorderVisible(e){return(this.mainBox||this.parent instanceof ae&&this.parent.parent instanceof j&&this.parent.parent.parent instanceof Hr&&this.parent.parent.parent.parent instanceof be&&this.parent.getFields().length===1)&&(e=!1),e}setExpandable(e){this.setProperty("expandable",e)}_renderExpandable(){let e=this.expandable,t=this.$header.children(".group-box-control");e?(t.length===0&&this.$container.makeDiv("group-box-control").on("click",this._onControlClick.bind(this)).insertAfter(this.$title),this.$header.addClass("expandable").on("click.group-box-control",this._onControlClick.bind(this))):(t.remove(),this.$header.removeClass("expandable").off(".group-box-control")),this.invalidateLayoutTree()}setExpanded(e){this.setProperty("expanded",e)}_renderExpanded(){this.$container.toggleClass("collapsed",!this.expanded),this.expanded?(this._collapsedWeightY!==void 0&&(this.gridData.weightY=this._collapsedWeightY,delete this._collapsedWeightY),this.invalidateLayout(),this._renderControls()):this.gridData.weightY!==0&&(this._collapsedWeightY=this.gridData.weightY,this.gridData.weightY=0),this.invalidateLayoutTree()}setGridColumnCount(e){this.setProperty("gridColumnCount",e),this.invalidateLogicalGrid()}invalidateLogicalGrid(e){super.invalidateLogicalGrid(!1),u.nvl(e,!0)&&this.rendered&&this.htmlBody.invalidateLayoutTree()}_setLogicalGrid(e){super._setLogicalGrid(e),this.logicalGrid&&this.logicalGrid.setGridConfig(new Xu)}_renderLabelVisible(){this.$header.setVisible(this._computeTitleVisible()),this._updateFieldStatus(),this.menuBarPosition===ae.MenuBarPosition.TITLE&&this.invalidateLayoutTree()}_computeTitleVisible(e){return e=u.nvl(e,this.labelVisible),!!(e&&this.label&&!this.mainBox)}_computeStatusVisible(){return super._computeStatusVisible()&&this._computeTitleVisible()}_setMenus(e){super._setMenus(e),this.menuBar&&this._updateMenuBar()}_updateMenuBar(){if(!this.menuBarVisible){this.menuBar.setMenuItems([]);return}let e=this.staticMenus.concat(this.processMenus).concat(this.menus);this.menuBar.setMenuItems(e)}_removeMenus(){}setStaticMenus(e){this.setProperty("staticMenus",e),this._updateMenuBar()}_onControlClick(e){if(!this.expandable)return;const t=u.widget(e.target);this.menuBarPosition===ae.MenuBarPosition.TITLE&&this.menuBar.has(t)||(this.setExpanded(!this.expanded),h().suppressEvent(e))}setResponsive(e){this.setProperty("responsive",e)}_setResponsive(e){if(this._setProperty("responsive",e),!!this.initialized){if(this.responsive)pe.get().reset(this,!0);else if(pe.get().reset(this,!0),this.responsive===null){let t=this.findParent(i=>i instanceof ae&&i.responsive);pe.get().reset(t,!0)}this.invalidateLayoutTree()}}clone(e,t){let i=super.clone(e);return this._deepCloneProperties(i,["fields"],t),i._prepareFields(),i}}Z.uuidPathSkipWidgets.add(ae);class Xu extends Js{getGridWidgets(){return this.widget.controls}getGridColumnCount(){let e=-1,t=this.widget;do e=u.nvl(t.gridColumnCount,e);while(e<0&&t.getParentGroupBox&&(t=t.getParentGroupBox()));return e<0?2:e}}class Ju extends Rn{constructor(){super(),this._addRemoteProperties(["expanded"])}_initModel(e,t){let i=super._initModel(e,t);return i.logicalGrid=null,i}_postCreateWidget(){super._postCreateWidget(),this.widget.responsiveHandler&&(this.widget.responsiveHandler.setAllowedStates([pe.ResponsiveState.NORMAL,pe.ResponsiveState.CONDENSED]),this.widget.responsiveHandler.getGridData=this._getGridData,this.widget.responsiveHandler.setGridData=this._setGridData)}_getGridData(e){return new ke(e.gridData)}_setGridData(e,t){e._setGridData(t)}}class ra extends ne{groupBox;_htmlPropertyChangeHandler;_fieldStatusWidth;constructor(e){super(),this.groupBox=e,this._initDefaults(),this._htmlPropertyChangeHandler=this._onHtmlEnvironmentPropertyChange.bind(this),we.get().on("propertyChange",this._htmlPropertyChangeHandler),this.groupBox.one("remove",()=>{we.get().off("propertyChange",this._htmlPropertyChangeHandler)})}_initDefaults(){this._fieldStatusWidth=we.get().fieldStatusWidth}_onHtmlEnvironmentPropertyChange(){this._initDefaults(),this.groupBox.invalidateLayoutTree()}layout(e){let t,i=0,s=0,r=this.groupBox.statusPosition,o=this.groupBox.htmlComp,l=this._htmlGbBody(),a=this._htmlMenuBar(),d=this.groupBox.$header,c=this.groupBox.$title,f=o.availableSize().subtract(o.insets());this.groupBox.responsive&&pe.get().handleResponsive(this.groupBox,f.width),s=this._statusWidth(),a?(this.groupBox.menuBarPosition===ae.MenuBarPosition.TITLE?t=this._updateHeaderMenuBar(a,d,c,s):(t=this._updateMenuBar(a,f,s),i=t.height,v(c)),a.setSize(t)):v(c),r!==A.StatusPosition.TOP?v(d,s):v(d);let g=0;if(this.groupBox.notification){let D=this.groupBox.notification.htmlComp.margins(),k=this.groupBox.notification.htmlComp.prefSize({widthHint:f.width-s});this.groupBox.notification.htmlComp.setSize(k),g=k.height+D.vertical()}let y=f.subtract(l.margins());y.height-=this._headerHeight(),y.height-=g,y.height-=i,h().log.isTraceEnabled()&&h().log.trace("(GroupBoxLayout#layout) gbBodySize="+y),l.setSize(y),(l.scrollable||this.groupBox.bodyLayoutConfig.minWidth>0)&&P.update(l.$comp);function v(D,k){if(k){let V=D.cssMarginX()+k;D.cssWidth("calc(100% - "+V+"px)")}else D.cssWidth("")}}_updateMenuBar(e,t,i){let s=this.groupBox.$container,r=e.$comp;if(!this.groupBox.mainBox&&s.hasClass("menubar-position-top")&&s.hasClass("has-scroll-shadow-top")||s.hasClass("menubar-position-bottom")&&s.hasClass("has-scroll-shadow-bottom")){let o=C.margins(r);o.left>0&&(r.cssPaddingLeft(o.left),r.cssMarginLeft(0)),i>0&&(r.cssPaddingRight(i),i=0)}else r.cssPaddingLeft(""),r.cssMarginLeft(""),r.cssPaddingRight("");return this._menuBarSize(e,t,i)}_menuBarSize(e,t,i){let s=Fs.size(e,t);return this.groupBox.mainBox||(s.width-=i),s}_updateHeaderMenuBar(e,t,i,s){let r=e.prefSize({exact:!0}),l=C.prefSize(t).subtract(C.insets(t)).width-s,a=t.children(".group-box-control");a.length>0&&(l-=C.size(a,!0).width);let d=Math.ceil(C.prefSize(i,!0).width)+1,c=r.width;if(d+c<l)c=Math.floor(l-d),r.width=c,i.cssWidth("");else{let f=(d+c)/l,g=d/l/f,y=c/l/f;g<y?(g=Math.max(.33,g),y=1-g):(y=Math.max(.33,y),g=1-y),d=g*l,c=y*l,r.width=Math.floor(c),i.cssWidth(Math.floor(d))}return r}_$status(){return this.groupBox.$status}_layoutStatus(){let e=this.groupBox.htmlComp,t=e.insets({includeBorder:!1}),i=t.top,s=t.right,r=this.groupBox.$header,o=r.innerHeight(),l=this._$status(),a=C.margins(l),d=this.groupBox.statusPosition;l.cssWidth(this._fieldStatusWidth),d===A.StatusPosition.DEFAULT&&(i+=r.cssMarginTop()),l.cssTop(i).cssRight(s).cssHeight(o-a.vertical())}preferredLayoutSize(e,t){t=t||{};let i=this.groupBox.htmlComp,s=this._htmlGbBody(),r,o=0,l=0,a=this.groupBox.gridData,d=!1;if(this.groupBox.responsive&&t.widthHint&&(d=pe.get().handleResponsive(this.groupBox,t.widthHint)),a&&(o=a.widthInPixel,l=a.heightInPixel),o&&l)return r=new F(o,l).add(i.insets()),r;if(!t.widthHint&&o&&(t.widthHint=o),t.heightHint=null,this.groupBox.expanded){r=s.prefSize(t).add(s.margins());let c=this._htmlMenuBar();if(c&&this.groupBox.menuBarPosition!==ae.MenuBarPosition.TITLE&&(r.height+=c.prefSize(t).height),this.groupBox.notification){let f=this.groupBox.notification.htmlComp.prefSize({widthHint:u.nvl(t.widthHint,r.width)-this._statusWidth(),includeMargin:!0});r.height+=f.height}}else r=new F(0,0);return r=r.add(i.insets()),r.height+=this._headerHeight(),o&&(r.width=o),l&&(r.height=l),d&&pe.get().reset(this.groupBox),r}_headerHeight(){return C.prefSize(this.groupBox.$header,!0).height}_statusWidth(){let e=0,t=this._$status();return t&&t.isVisible()&&(this._layoutStatus(),e=t.outerWidth(!0)),e}_htmlMenuBar(){if(this.groupBox.menuBar&&this.groupBox.menuBarVisible){let e=x.optGet(this.groupBox.menuBar.$container);if(e&&e.isVisible())return e}return null}_htmlGbBody(){return x.get(this.groupBox.$body)}}class Is{order(e){let t=[],i=[],s=[],r=[];return e.forEach(o=>{o.isButton()?o.horizontalAlignment===1?s.push(o):t.push(o):o.horizontalAlignment===1?r.push(o):i.push(o)}),{left:t.concat(i),right:r.concat(s),all:t.concat(i).concat(r).concat(s)}}}class Qu extends ge{scrollBarEnabled;selectable;scrollToAnchor;constructor(){super(),this.scrollBarEnabled=!1,this.scrollToAnchor=null,this.preventInitialFocus=!0,this.selectable=!0}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new Fn(this,this._onAppLinkAction)),this.keyStrokeContext.registerKeyStroke(new Xl(this))}_render(){this.addContainer(this.$parent,"html-field"),this.addLabel(),this.addField(this.$parent.makeDiv()),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderScrollBarEnabled(),this._renderScrollToAnchor(),this._renderSelectable(),this._renderEmpty()}_renderDisplayText(){if(!this.displayText){this.$field.empty();return}this.$field.html(this.displayText),this.$field.find(".app-link").on("click",this._onAppLinkAction.bind(this)),this.$field.find("a, .app-link").attr("tabindex","0").unfocusable(),this.$field.find("img").on("load",this._onImageLoad.bind(this)).on("error",this._onImageError.bind(this)),this.rendered&&(this._uninstallScrollbars(),this._renderScrollBarEnabled()),this.invalidateLayoutTree()}_renderFocused(){}_renderEmpty(){this.$field.toggleClass("empty",this.empty)}setScrollBarEnabled(e){this.setProperty("scrollBarEnabled",e)}_renderScrollBarEnabled(){this.scrollBarEnabled?this._installScrollbars():this._uninstallScrollbars()}_renderScrollToAnchor(){if(!this.rendered){this.session.layoutValidator.schedulePostValidateFunction(this._renderScrollToAnchor.bind(this));return}if(this.scrollBarEnabled&&this.scrollToAnchor){let e=this.$field.find("#".concat(this.scrollToAnchor));e&&e.length>0&&P.scrollTo(this.$field,e)}}setSelectable(e){this.setProperty("selectable",e)}_renderSelectable(){this.$container.toggleClass("selectable",!!this.selectable),this.$field.toggleAttr("tabindex",!!this.selectable,"-1")}_onAppLinkAction(e){let i=h()(e.delegateTarget).data("ref");this.triggerAppLinkAction(i)}triggerAppLinkAction(e){this.trigger("appLinkAction",{ref:e})}_onImageLoad(e){this.invalidateLayoutTree()}_onImageError(e){this.invalidateLayoutTree()}}class Ng extends At{_initProperties(e){super._initProperties(e),e.scrollToEnd!==void 0&&delete e.scrollToEnd}_syncScrollToEnd(){this.widget.scrollToBottom()}_onWidgetAppLinkAction(e){this._send("appLinkAction",{ref:e.ref})}_onWidgetEvent(e){e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):super._onWidgetEvent(e)}}class Lr extends A{autoFit;imageUrl;scrollBarEnabled;uploadEnabled;acceptTypes;maximumUploadSize;icon;fileInput;_clickHandler;constructor(){super(),this.defaultMenuTypes=[...this.defaultMenuTypes,Lr.MenuType.ImageUrl,Lr.MenuType.Null],this.autoFit=!1,this.imageUrl=null,this.scrollBarEnabled=!1,this.uploadEnabled=!1,this.acceptTypes=null,this.maximumUploadSize=Ei.DEFAULT_MAXIMUM_UPLOAD_SIZE,this._clickHandler=null}static MenuType={Null:"ImageField.Null",ImageUrl:"ImageField.ImageUrl"};_init(e){super._init(e),this.resolveIconIds(["imageUrl"]),this.icon=u.create(Es,{parent:this,iconDesc:this.imageUrl,autoFit:this.autoFit,prepend:!0}),this.icon.on("load",this._onImageLoad.bind(this)),this.icon.on("error",this._onImageError.bind(this))}_render(){this.addContainer(this.$parent,"image-field",new Zu(this)),this.addFieldContainer(this.$parent.makeDiv()),x.install(this.$fieldContainer,this.session).setLayout(new ji),this.icon.render(this.$fieldContainer),this.addLabel(),this.addField(this.icon.$container),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderScrollBarEnabled(),this._renderImageUrl(),this._renderUploadEnabled()}_remove(){super._remove(),this._clickHandler=null,this.fileInput&&(this.fileInput.destroy(),this.fileInput=null)}_getDragAndDropHandlerOptions(){let e=super._getDragAndDropHandlerOptions();return e.container=()=>this.$fieldContainer,e}setImageUrl(e){this.setProperty("imageUrl",e)}_setImageUrl(e){this._setProperty("imageUrl",e),this.icon.setIconDesc(e),this._updateMenus()}_renderImageUrl(){let e=!!this.imageUrl;this.$fieldContainer.toggleClass("has-image",e),this.$container.toggleClass("has-image",e),P.update(this.$fieldContainer)}setAutoFit(e){this.setProperty("autoFit",e)}_setAutoFit(e){this._setProperty("autoFit",e),this.icon.setAutoFit(e)}_renderAutoFit(){P.update(this.$fieldContainer)}setScrollBarEnabled(e){this.setProperty("scrollBarEnabled",e)}_renderScrollBarEnabled(){this._updateInnerAlignment(),this.scrollBarEnabled?this._installScrollbars():this._uninstallScrollbars()}get$Scrollable(){return this.$fieldContainer}_renderGridData(){super._renderGridData(),this._updateInnerAlignment()}_renderGridDataHints(){super._renderGridDataHints(),this._updateInnerAlignment()}_updateInnerAlignment(){this.updateInnerAlignment({useHorizontalAlignment:!this.scrollBarEnabled,useVerticalAlignment:!this.scrollBarEnabled})}_renderEnabled(){super._renderEnabled(),this._updateUploadEnabled()}setUploadEnabled(e){this.setProperty("uploadEnabled",e)}_renderUploadEnabled(){this._updateUploadEnabled()}_updateUploadEnabled(){let e=this.enabledComputed&&this.uploadEnabled;this.$fieldContainer.toggleClass("clickable",e),e?(this._clickHandler||(this._clickHandler=this._onClickUpload.bind(this),this.$fieldContainer.on("click",this._clickHandler)),this.fileInput||(this.fileInput=u.create(Ei,{parent:this,acceptTypes:this.acceptTypes,text:this.displayText,enabled:this.enabledComputed,maximumUploadSize:this.maximumUploadSize,visible:!w.get().supportsFile()}),this.fileInput.render(this.$fieldContainer),this.fileInput.on("change",this._onFileChange.bind(this)))):(this.$fieldContainer.off("click",this._clickHandler),this._clickHandler=null,this.fileInput&&(this.fileInput.destroy(),this.fileInput=null))}_getCurrentMenuTypes(){return this.imageUrl?[...super._getCurrentMenuTypes(),Lr.MenuType.ImageUrl]:[...super._getCurrentMenuTypes(),Lr.MenuType.Null]}_onClickUpload(e){h()(e.target).isOrHas(this.$field)&&this.fileInput.browse()}_onFileChange(e){this.trigger("fileUpload",{file:p.first(e.files)})}_onImageLoad(e){this._onIconUpdated()}_onImageError(e){this._onIconUpdated()}_onIconUpdated(){P.update(this.$fieldContainer),this.$field=this.icon.$container}}class Vg extends at{_onWidgetEvent(e){e.type==="fileUpload"?this._onFileUpload(e):super._onWidgetEvent(e)}_onFileUpload(e){this.widget.fileInput.upload()||this.widget.fileInput.clear()}}class Zu extends Kt{constructor(e){super(e)}layout(e){super.layout(e),P.update(this.formField.$fieldContainer)}}class na extends ge{htmlEnabled;selectable;wrapText;constructor(){super(),this.htmlEnabled=!1,this.selectable=!0,this.wrapText=!1,this.preventInitialFocus=!0}_initValue(e){e=de.resolveText(e,this.session.locale.languageTag),super._initValue(e)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new Xl(this))}_render(){this.addContainer(this.$parent,"label-field"),this.addLabel(),this.addField(this.$parent.makeDiv()),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderWrapText(),this._renderSelectable()}_renderFocused(){}acceptInput(e){}setHtmlEnabled(e){this.setProperty("htmlEnabled",e)}_renderHtmlEnabled(){this._renderDisplayText()}_renderDisplayText(){let e=this.displayText||"";this.htmlEnabled?(this.$field.html(e),this.$field.find(".app-link").on("click",this._onAppLinkAction.bind(this))):this.$field.html(_.nl2br(e)),this.invalidateLayoutTree()}setWrapText(e){this.setProperty("wrapText",e)}_renderWrapText(){this.$field.toggleClass("white-space-nowrap",!this.wrapText),this.invalidateLayoutTree()}setSelectable(e){this.setProperty("selectable",e)}_renderSelectable(){this.$container.toggleClass("selectable",!!this.selectable),this.$field.toggleAttr("tabindex",!!this.selectable,"-1")}_renderGridData(){super._renderGridData(),this.updateInnerAlignment({useHorizontalAlignment:!0})}_renderGridDataHints(){super._renderGridDataHints(),this.updateInnerAlignment({useHorizontalAlignment:!0})}_onAppLinkAction(e){let i=$(e.delegateTarget).data("ref");this.triggerAppLinkAction(i)}triggerAppLinkAction(e){this.trigger("appLinkAction",{ref:e})}addField(e){super.addField(e),this.$field.off("blur").off("focus")}}class Wg extends At{_onWidgetAppLinkAction(e){this._send("appLinkAction",{ref:e.ref})}_onWidgetEvent(e){e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):super._onWidgetEvent(e)}}class Io extends An{table;constructor(){super(),this.table=null,this._addWidgetProperties(["table","filterBox"])}_init(e){super._init(e),this.table.on("rowsChecked",this._onTableRowsChecked.bind(this)),this.table.setScrollTop(this.scrollTop)}_initStructure(e){this.table||(this.table=this._createDefaultListBoxTable()),this.table.accessibilityRenderer=new Fo,this.table.checkableColumn&&(this.table.checkableColumn.minWidth=28,this.table.checkableColumn.width=this.table.checkableColumn.minWidth)}_render(){super._render(),this.$container.addClass("list-box")}_createFieldContainerLayout(){return new ec(this,this.table,this.filterBox)}_renderStructure(){this.table.render(this.$fieldContainer),this.addField(this.table.$container)}_onTableRowsChecked(e){this._syncTableToValue()}_syncTableToValue(){if(!this.lookupCall||this._valueSyncing)return;this._valueSyncing=!0;let e=[];this.table.rows.forEach(t=>{t.checked&&e.push(t.lookupRow.key)}),this.setValue(e),this._valueSyncing=!1}_valueChanged(){super._valueChanged(),this._syncValueToTable(this.value)}_syncValueToTable(e){if(!this.lookupCall||this._valueSyncing||!this.initialized)return;this._valueSyncing=!0;let t={checkOnlyEnabled:!1};try{if(p.empty(e))this.table.uncheckRows(this.table.rows,t);else{if(this._ensureLookupCallExecuted())return;let s=[];this.table.uncheckRows(this.table.rows,t),this.table.rows.forEach(r=>{p.containsAny(e,r.lookupRow.key)&&s.push(r)},this),this.table.checkRows(s,t)}this._updateDisplayText()}finally{this._valueSyncing=!1}}_lookupByAllDone(e){super._lookupByAllDone(e),this._populateTable(e)}_populateTable(e){let t=[];e.lookupRows.forEach(s=>{t.push(this._createTableRow(s))}),this.table.deleteAllRows(),this.table.insertRows(t),this._syncValueToTable(this.value)}getCheckedLookupRows(){return this.value===null||p.empty(this.value)||this.table.rows.length===0?[]:this.table.rows.filter(e=>e.checked).map(e=>e.lookupRow)}_createTableRow(e){let i={cells:[Br.createTableCell(e)],lookupRow:e};return e.enabled===!1&&(i.enabled=!1),e.cssClass&&(i.cssClass=e.cssClass),e.active===!1&&(i.active=!1,i.cssClass=(i.cssClass?i.cssClass+" ":"")+"inactive"),i}_prepareWidgetProperty(e,t){return e==="table"&&b.isPojo(t)&&(t=h().extend(this._createDefaultListBoxTableModel(),t)),super._prepareWidgetProperty(e,t)}_createDefaultListBoxTable(){return u.create(H,{parent:this,...this._createDefaultListBoxTableModel()})}_createDefaultListBoxTableModel(){return{autoResizeColumns:!0,checkable:!0,checkableStyle:H.CheckableStyle.CHECKBOX_TABLE_ROW,headerVisible:!1,footerVisible:!1,columns:[{objectType:le}]}}getDelegateScrollable(){return this.table}}class zg extends At{}class ec extends ea{constructor(e,t,i){super(e,t,i)}}const Br={createTableRow(n,e){e=u.nvl(e,!1);let t=[],i={cells:t,lookupRow:n};return n.enabled===!1&&(i.enabled=!1),n.cssClass&&(i.cssClass=n.cssClass),n.active===!1&&(i.cssClass=(i.cssClass?i.cssClass+" ":"")+"inactive"),e||t.push(Br.createTableCell(n,null,null)),i},createTableCell(n,e,t){let i=u.create(_t);return e&&e.propertyName?i.setValue(t[e.propertyName]):(i.setText(n.text),n.iconId&&i.setIconId(n.iconId),n.tooltipText&&i.setTooltipText(n.tooltipText),n.backgroundColor&&i.setBackgroundColor(n.backgroundColor),n.foregroundColor&&i.setForegroundColor(n.foregroundColor),n.font&&i.setFont(n.font)),i}};class oa extends At{sendLookup(e,t){let i=e.toLowerCase(),s="lookupBy"+_.toUpperCaseFirstLetter(i),r={showBusyIndicator:!1};b.isNullOrUndefined(t)||(r[i]=t),this._send(s,r)}}class Ug extends ge{modeSelector;modes;_selectedModeChangeHandler;constructor(){super(),this._addWidgetProperties(["modeSelector","modes"]),this._selectedModeChangeHandler=this._onSelectedModeChange.bind(this)}_render(){this.addContainer(this.$parent,"mode-selector-field"),this.addLabel(),this.addStatus(),this.modeSelector&&(this._renderModeSelector(),this.modeSelector.on("propertyChange:selectedMode",this._selectedModeChangeHandler))}_renderModeSelector(){this.modeSelector.render(),this.addField(this.modeSelector.$container)}_removeModeSelector(){this.modeSelector.remove(),this._removeField()}_onSelectedModeChange(e){e.newValue?this.setValue(e.newValue.ref):this.modeSelector.selectedMode&&this.modeSelector.selectedMode.id?this.setValue(this.modeSelector.selectedMode.id):this.setValue(null)}}class Gg extends At{_createWidget(e){return this._addModeSelector(e),super._createWidget(e)}_addModeSelector(e){e.modeSelector={objectType:wd}}_postCreateWidget(){this.widget.modeSelector.setModes(this.widget.modes),delete this.widget.modes}}class ps extends Ro{calc;minValue;maxValue;decimalFormat;fractionDigits;constructor(){super(),this.calc=new ic,this.minValue=null,this.maxValue=null,this.decimalFormat=null,this.fractionDigits=null,this.invalidValueMessageKey="InvalidNumberMessageX",this.gridDataHints.horizontalAlignment=1}_init(e){super._init(e),this._setMinValue(this.minValue),this._setMaxValue(this.maxValue)}_initValue(e){this._setDecimalFormat(this.decimalFormat),this._setFractionDigits(this.fractionDigits),super._initValue(e)}_createKeyStrokeContext(){return new qi}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new Vu(this))}_render(){this.addContainer(this.$parent,"number-field"),this.addLabel(),this.addMandatoryIndicator();let e=oe.makeTextField(this.$parent);this.addField(e),this.addStatus(),this._addAriaFieldDescription()}_renderGridData(){super._renderGridData(),this.updateInnerAlignment({useHorizontalAlignment:!0})}_renderGridDataHints(){super._renderGridDataHints(),this.updateInnerAlignment({useHorizontalAlignment:!0})}_getDefaultFormat(e){return e.decimalFormatPatternDefault}setDecimalFormat(e){this.setProperty("decimalFormat",e)}_setDecimalFormat(e){e||(e=this._getDefaultFormat(this.session.locale)),e=Ps.ensure(this.session.locale,e),this._setProperty("decimalFormat",e),this.initialized&&this.setValue(this.value)}setFractionDigits(e){this.setProperty("fractionDigits",e)}_setFractionDigits(e){this._setProperty("fractionDigits",e),this.initialized&&this.setValue(this.value)}_parseValue(e){return e?this.decimalFormat.parse(e,this._evaluateNumber.bind(this)):null}_evaluateNumber(e){if(this.calc.isFormula(e)){let t=this.calc.evalFormula(e);if(isNaN(t))throw new Error(e+" is not a valid expression");return t}return Number(e)}_ensureValue(e){let t=Se.ensure(e);if(b.isNullOrUndefined(t))return t;if(!Se.isNumber(t))throw this.session.text(this.invalidValueMessageKey,e);return Se.isNumber(this.fractionDigits)&&(t=Se.round(t,this.decimalFormat.roundingMode,this.fractionDigits)),t}_validateValue(e){return b.isNullOrUndefined(e)||(!b.isNullOrUndefined(this.minValue)&&e<this.minValue&&this._onNumberTooSmall(),!b.isNullOrUndefined(this.maxValue)&&e>this.maxValue&&this._onNumberTooLarge()),e}_onNumberTooLarge(){throw b.isNullOrUndefined(this.minValue)?this.session.text("NumberTooLargeMessageX",this._formatValue(this.maxValue)):this.session.text("NumberTooLargeMessageXY",this._formatValue(this.minValue),this._formatValue(this.maxValue))}_onNumberTooSmall(){throw b.isNullOrUndefined(this.maxValue)?this.session.text("NumberTooSmallMessageX",this._formatValue(this.minValue)):this.session.text("NumberTooSmallMessageXY",this._formatValue(this.minValue),this._formatValue(this.maxValue))}_formatValue(e){return b.isNullOrUndefined(e)?"":typeof e!="number"?e+"":this.decimalFormat.format(e,!0)}setMinValue(e){this.minValue!==e&&(this._setMinValue(e),this.validate())}_setMinValue(e){this._setProperty("minValue",e),!b.isNullOrUndefined(this.maxValue)&&!b.isNullOrUndefined(this.minValue)&&e>this.maxValue&&this._setMaxValue(e)}setMaxValue(e){this.maxValue!==e&&(this._setMaxValue(e),this.validate())}_setMaxValue(e){this._setProperty("maxValue",e),!b.isNullOrUndefined(this.maxValue)&&!b.isNullOrUndefined(this.minValue)&&e<this.minValue&&this._setMinValue(e)}_addAriaFieldDescription(){T.addHiddenDescriptionAndLinkToElement(this.$field,this.id+"-func-desc",this.session.text("ui.AriaNumberFieldDescription"))}}class tc extends Zl{_onWidgetParseError(e){e.preventDefault()}_onWidgetEvent(e){e.type==="parseError"?this._onWidgetParseError(e):super._onWidgetEvent(e)}static modifyPrototype(){G.get().remote&&b.replacePrototypeFunction(ps,ps.prototype.clearErrorStatus,function(){if(!this.modelAdapter)return this.clearErrorStatusOrig()},!0)}}G.addListener("bootstrap",tc.modifyPrototype);class ic{_tokens;constructor(){this._tokens=[]}isFormula(e){return e.match(/^[\d()+\-*/.]+$/)}evalFormula(e){return this._tokens=e.split(/([\d.]+|\(|\)|[+\-*/])/).filter(t=>t.length!==0),this._expr()}_next(){if(this._tokens.length!==0)return this._tokens[0]}_consumeNext(){let e=this._tokens[0];return this._tokens=this._tokens.slice(1,this._tokens.length),e}_expr(){return this._sum()}_sum(){let e=this._prod();for(;this._next()==="+"||this._next()==="-";)switch(this._consumeNext()){case"+":e=e+this._prod();break;case"-":e=e-this._prod();break}return e}_prod(){let e=this._unary();for(;this._next()==="*"||this._next()==="/";)switch(this._consumeNext()){case"*":e=e*this._unary();break;case"/":e=e/this._unary();break}return e}_unary(){let e=1;this._next()==="+"?this._consumeNext():this._next()==="-"&&(this._consumeNext(),e=-1);let t;return(t=this._group())!==void 0||(t=this._consumeNext()),e*t}_group(){if(this._next()==="("){this._consumeNext();let e=this._expr();if(this._next()!==")")throw"missing closing bracket";return this._consumeNext(),e}}}class Lo extends ps{static MIN_VALUE=Number.MIN_SAFE_INTEGER;static MAX_VALUE=Number.MAX_SAFE_INTEGER;constructor(){super(),this.minValue=Lo.MIN_VALUE,this.maxValue=Lo.MAX_VALUE,this.fractionDigits=0}_getDefaultFormat(e){return"#,##0"}_setFractionDigits(e){super._setFractionDigits(0)}_addAriaFieldDescription(){T.addHiddenDescriptionAndLinkToElement(this.$field,this.id+"-func-desc",this.session.text("ui.AriaIntegerFieldDescription"))}}class la extends A{_render(){this.addContainer(this.$parent,"placeholder-field"),this.addLabel()}_renderLabel(){this._renderEmptyLabel()}}class Kg extends at{}class jg extends A{planner;constructor(){super(),this._addWidgetProperties(["planner"]),this.gridDataHints.weightY=1}_render(){this.addContainer(this.$parent,"planner-field"),this.addLabel(),this.addStatus(),this.planner&&this._renderPlanner()}_renderPlanner(){this.planner.render(),this.addField(this.planner.$container)}_removePlanner(){this.planner.remove(),this._removeField()}}class qg extends at{}class Bo extends Oe{focusWhenSelected;wrapText;radioValue;$radioButton;lookupRow;constructor(){super(),this.gridDataHints.fillHorizontal=!0,this.focusWhenSelected=!0,this.wrapText=!1,this.buttonKeyStroke=new Oo(this,null),this.radioValue=null}_initDefaultKeyStrokes(){this.keyStrokeContext.registerKeyStrokes([new Oo(this,"ENTER"),new Oo(this,"SPACE")])}_render(){this.addContainer(this.$parent,"radio-button",new sc(this)),this.addFieldContainer(this.$parent.makeDiv()),this.$radioButton=this.$fieldContainer.appendDiv("radio-button-circle").data("radiobutton",this),this.$buttonLabel=this.$fieldContainer.appendDiv("label"),T.role(this.$radioButton,"radio"),this.addField(this.$radioButton),this.$fieldContainer.on("mousedown",this._onMouseDown.bind(this)),Y.installForEllipsis(this.$buttonLabel,{parent:this}),this.addStatus(),this.session.keyStrokeManager.installKeyStrokeContext(this.formKeyStrokeContext)}_remove(){Y.uninstall(this.$buttonLabel),this.session.keyStrokeManager.uninstallKeyStrokeContext(this.formKeyStrokeContext),super._remove()}_renderProperties(){super._renderProperties(),this._renderWrapText(),this._renderSelected()}setWrapText(e){this.setProperty("wrapText",e)}_renderWrapText(){this.$buttonLabel.toggleClass("white-space-nowrap",!this.wrapText),this.invalidateLayoutTree()}select(){this.setSelected(!0)}_renderSelected(){this.$fieldContainer.toggleClass("checked",this.selected),this.$field.toggleClass("checked",this.selected),T.checked(this.$radioButton,this.selected)}setTabbable(e){this.rendered&&this.$field.setTabbable(e&&!w.get().supportsOnlyTouch())}isTabbable(){return this.rendered&&this.$field.isTabbable()}_renderIconId(){super._renderIconId();let e=this.get$Icon();e.length>0&&e.insertAfter(this.$radioButton)}_renderSubmenuIcon(){}doAction(){return!this.enabledComputed||!this.visible?!1:(this.select(),!0)}_onMouseDown(e){if(!this.enabledComputed)return;let t=this.get$Icon().is(e.target),i=this.$radioButton.is(e.target),s=this.$buttonLabel.isOrHas(e.target);!i&&!s&&!t||(this.select(),this.focusWhenSelected&&(s||t)&&this.focusAndPreventDefault(e))}}class sc extends ta{radioButton;constructor(e){super(e),this.radioButton=e}layout(e){super.layout(e);let t=this.radioButton.get$Icon(),i=this.radioButton.$radioButton,s=this.radioButton.$buttonLabel,o=this.radioButton.$fieldContainer.width()-(i.outerWidth(!0)+(t.length?t.outerWidth(!0):0));s.css("max-width",o)}}class Yg extends Ku{}class Or extends ge{layoutConfig;fields;radioButtons;gridColumnCount;selectedButton;lookupStatus;lookupCall;htmlBody;$body;_lookupExecuted;_selectButtonLocked;_lookupInProgress;_currentLookupCall;_buttonPropertyChangeHandler;constructor(){super(),this.logicalGrid=u.create(Pr),this.layoutConfig=null,this.fields=[],this.radioButtons=[],this.gridColumnCount=Or.DEFAULT_GRID_COLUMN_COUNT,this.selectedButton=null,this.$body=null,this.lookupStatus=null,this.lookupCall=null,this._lookupExecuted=!1,this._selectButtonLocked=!1,this._lookupInProgress=!1,this._currentLookupCall=null,this._addWidgetProperties(["fields"]),this._addCloneProperties(["lookupCall","layoutConfig","gridColumnCount"]),this._buttonPropertyChangeHandler=this._onButtonPropertyChange.bind(this)}static DEFAULT_GRID_COLUMN_COUNT=-1;static ErrorCode={NO_DATA:1};_init(e){super._init(e),this._setLayoutConfig(this.layoutConfig),this._setGridColumnCount(this.gridColumnCount)}_initValue(e){this.lookupCall&&this._setLookupCall(this.lookupCall),this._setFields(this.fields),super._initValue(e)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new nc(this),new oc(this)])}_initButtons(){this.radioButtons=this.fields.filter(e=>e instanceof Bo),this.radioButtons.forEach(this._initButton.bind(this))}_initButton(e){e.events.count("propertyChange",this._buttonPropertyChangeHandler)===0&&e.on("propertyChange",this._buttonPropertyChangeHandler),e.selected&&(this.setValue(e.radioValue),this.selectButton(e),e.focused&&this.setFocused(!0))}_render(){this.addContainer(this.$parent,"radiobutton-group"),this.addLabel(),this.addMandatoryIndicator(),this.$body=this.$container.appendDiv("radiobutton-group-body"),T.role(this.$body,"radiogroup"),this.htmlBody=x.install(this.$body,this.session),this.htmlBody.setLayout(this._createBodyLayout()),this.addField(this.$body),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderFields(),this._renderLayoutConfig()}_createBodyLayout(){return new xr(this,this.layoutConfig)}_setLogicalGrid(e){super._setLogicalGrid(e),this.logicalGrid&&this.logicalGrid.setGridConfig(new rc)}invalidateLogicalGrid(e){super.invalidateLogicalGrid(!1),u.nvl(e,!0)&&this.rendered&&this.htmlBody.invalidateLayoutTree()}setLayoutConfig(e){this.setProperty("layoutConfig",e)}_setLayoutConfig(e){this._setProperty("layoutConfig",kt.ensure(e||{}).withSmallHgapDefaults()),kt.initHtmlEnvChangeHandler(this,()=>this.layoutConfig,t=>this.setLayoutConfig(t))}_renderLayoutConfig(){this.layoutConfig.applyToLayout(this.htmlBody.layout),this.rendered&&this.htmlBody.invalidateLayoutTree()}isClearable(){return!1}getFields(){return this.fields}getFocusableElement(){return this.session.focusManager.findFirstFocusableElement(this.$container)}setFields(e){this.setProperty("fields",e)}_setFields(e){this._setProperty("fields",e),this._initButtons()}_renderFields(){this._ensureLookupCallExecuted(),this.fields.forEach(function(e){e.render(this.$body),e.setLayoutData(new Sr(e)),this._linkWithLabel(e.$field)},this),this._provideTabIndex(),this.invalidateLogicalGrid()}_renderEnabled(){super._renderEnabled(),this._provideTabIndex()}_provideTabIndex(){let e;this.radioButtons.forEach(function(t){t.enabledComputed&&this.enabledComputed&&!e?(t.setTabbable(!0),e=t):e&&this.enabledComputed&&t.enabledComputed&&t.selected?(e.setTabbable(!1),t.setTabbable(!0),e=t):t.setTabbable(!1)},this)}setGridColumnCount(e){this.setProperty("gridColumnCount",e)}_setGridColumnCount(e){return e<0&&(e=this._calcDefaultGridColumnCount()),e===this.gridColumnCount?!1:(this._setProperty("gridColumnCount",e),this.invalidateLogicalGrid(),!0)}_calcDefaultGridColumnCount(){let e=1,t=this.gridDataHints;return t&&t.h>1&&(e=t.h),Math.ceil(this.fields.length/e)}getButtonForRadioValue(e){return e===null?null:p.find(this.radioButtons,t=>b.equals(t.radioValue,e))}_validateValue(e){if(super._validateValue(e),!this.initialized&&this.lookupCall||this._ensureLookupCallExecuted())return e;if(!this.getButtonForRadioValue(e)&&e!==null&&e!==void 0&&!this._lookupInProgress)throw this.session.text("InvalidValueMessageX",e);return e}_valueChanged(){super._valueChanged(),(this.value!==null||this.initialized)&&this.selectButton(this.getButtonForRadioValue(this.value))}selectFirstButton(){this.selectButtonByIndex(0)}selectLastButton(){this.selectButtonByIndex(this.radioButtons.length-1)}selectButtonByIndex(e){this.radioButtons.length&&e>=0&&e<this.radioButtons.length&&this.selectButton(this.radioButtons[e])}selectButton(e){if(this.selectedButton!==e&&!this._selectButtonLocked){if(this._selectButtonLocked=!0,this.selectedButton&&this.selectedButton.setSelected(!1),e){let t=this.getTabbableButton(),i=!1;t&&(i=t.isFocused()),e.setSelected(!0),e.setTabbable(!0),i&&e.focus(),t&&t!==e&&t.setTabbable(!1)}this._selectButtonLocked=!1,this.setProperty("selectedButton",e)}}getTabbableButton(){return p.find(this.radioButtons,e=>e.visible&&e.isTabbable())}insertButton(e){let t=this.fields.slice();t.push(e),this.setFields(t)}_onButtonPropertyChange(e){e.propertyName==="selected"?e.newValue?(this.setValue(e.source.radioValue),this.selectButton(e.source)):e.source===this.selectedButton&&this.selectButton(null):e.propertyName==="focused"&&this.setFocused(e.newValue)}setLookupCall(e){this.setProperty("lookupCall",e)}_setLookupCall(e){this._setProperty("lookupCall",Pt.ensure(e,this.session)),this._lookupExecuted=!1,this.rendered&&this._ensureLookupCallExecuted()}_ensureLookupCallExecuted(){return!this.lookupCall||this._lookupExecuted?!1:(this._lookupByAll(),!0)}_createLoadingSupport(){return new Ut({widget:this,$container:()=>this.$body})}_lookupByAll(){if(!this.lookupCall)return;let e=h().Deferred();return this._executeLookup(this.lookupCall.cloneForAll(),!0).done(t=>{this._lookupByAllDone(t),e.resolve(t)}),e.promise()}_executeLookup(e,t){return t&&this._currentLookupCall&&this._currentLookupCall.abort(),this._lookupInProgress=!0,this.setLoading(!0),this._currentLookupCall=e,this.trigger("prepareLookupCall",{lookupCall:e}),e.execute().always(()=>{this._lookupInProgress=!1,this._lookupExecuted=!0,this._currentLookupCall=null,this.setLoading(!1),this._clearLookupStatus()})}_lookupByAllDone(e){try{if(e.exception){this.setLookupStatus(E.warning({message:e.exception}));return}this._populateRadioButtonGroup(e)}finally{this.trigger("lookupCallDone",{result:e})}}_populateRadioButtonGroup(e){let t=e.lookupRows,i=this.fields.slice();t.forEach(s=>{i.push(this._createLookupRowRadioButton(s))}),this.setFields(i),this.setValue(this.value),this.selectButton(this.getButtonForRadioValue(this.value))}_clearLookupStatus(){this.setLookupStatus(null)}setLookupStatus(e){this.setProperty("lookupStatus",e),this.rendered&&this._renderErrorStatus()}_errorStatus(){return this.lookupStatus||this.errorStatus}_createLookupRowRadioButton(e){let t={parent:this,label:e.text,radioValue:e.key};e.iconId&&(t.iconId=e.iconId),e.tooltipText&&(t.tooltipText=e.tooltipText),e.backgroundColor&&(t.backgroundColor=e.backgroundColor),e.foregroundColor&&(t.foregroundColor=e.foregroundColor),e.font&&(t.font=e.font),e.enabled===!1&&(t.enabled=!1),e.active===!1&&(t.visible=!1),e.cssClass&&(t.cssClass=e.cssClass);let i=u.create(Bo,t);return i.lookupRow=e,i}clone(e,t){let i=super.clone(e,t);return this._deepCloneProperties(i,"fields",t),i._initButtons(),i}}Z.uuidPathSkipWidgets.add(Or);class Xg extends At{_initModel(e,t){let i=super._initModel(e,t);return i.logicalGrid=null,i}}class rc extends Js{getGridWidgets(){return this.widget.fields}}class nc extends B{constructor(e){super(),this.field=e,this.which=[m.LEFT,m.UP],this.renderingHints.render=!1}handle(e){let t,i=h()(e.target).data("radiobutton");this.field.radioButtons.some(s=>t&&s===i?(t.select(),t.focus(),!0):(s.enabledComputed&&s.visible&&(t=s),!1),this)}}class oc extends B{constructor(e){super(),this.field=e,this.which=[m.RIGHT,m.DOWN],this.renderingHints.render=!1}handle(e){let t,i=h()(e.target).data("radiobutton");this.field.radioButtons.some(s=>t&&s.enabledComputed&&s.visible?(s.select(),s.focus(),!0):(s===i&&(t=s),!1),this)}}class Oo extends Mn{constructor(e,t){super(e,t),this.renderingHints.hAlign=ut.LEFT}_accept(e){return super._accept(e)&&!this.field.selected}}class kn extends ar{layoutConfig;fields;htmlBody;boxErrorStatus;boxTooltipText;boxMenus;boxMenusVisible;_lastVisibleField;_isOverwritingStatusFromField;_isErrorStatusOverwritten;_isTooltipTextOverwritten;_isMenusOverwritten;_fieldPropertyChangeHandler;_lastVisibleFieldSuppressStatusHandler;constructor(){super(),this._addWidgetProperties("fields"),this._addCloneProperties(["layoutConfig"]),this.logicalGrid=u.create(Pr),this.layoutConfig=null,this.fields=[],this._fieldPropertyChangeHandler=this._onFieldPropertyChange.bind(this),this._lastVisibleFieldSuppressStatusHandler=this._onLastVisibleFieldSuppressStatusChange.bind(this)}_init(e){super._init(e),this._setLayoutConfig(this.layoutConfig),this._initDateFields(),this.setErrorStatus(this.errorStatus),this.setTooltipText(this.tooltipText),this.setMenus(this.menus),this.setMenusVisible(this.menusVisible)}_initDateFields(){let e=this._getDateFields(),t=null;for(let i=0;i<e.length;i++){let s=e[i];s.autoDate&&(s.hasModelAutoDateSet=!0),s.hasModelAutoDateSet||s.setAutoDate(t),t=this._getAutoDateProposal(s)}}_render(){this.addContainer(this.$parent,"sequence-box"),this.addLabel(),this.addField(this.$parent.makeDiv()),this.addStatus(),this._handleStatus(),this.htmlBody=x.install(this.$field,this.session),this.htmlBody.setLayout(this._createBodyLayout());for(let e=0;e<this.fields.length;e++){let t=this.fields[e];t.labelUseUiWidth=!0,t.on("propertyChange",this._fieldPropertyChangeHandler),t.render(this.$field),this._modifyLabel(t),t.setLayoutData(new Sr(t))}}_renderProperties(){super._renderProperties(),this._renderLayoutConfig()}_createBodyLayout(){return new xr(this,this.layoutConfig)}_remove(){this.fields.forEach(e=>e.off("propertyChange",this._fieldPropertyChangeHandler)),this._lastVisibleField&&this._lastVisibleField.off("propertyChange:suppressStatus",this._lastVisibleFieldSuppressStatusHandler),super._remove()}invalidateLogicalGrid(e){super.invalidateLogicalGrid(!1),u.nvl(e,!0)&&this.rendered&&this.htmlBody.invalidateLayoutTree()}_setLogicalGrid(e){super._setLogicalGrid(e),this.logicalGrid&&this.logicalGrid.setGridConfig(new lc)}setLayoutConfig(e){this.setProperty("layoutConfig",e)}_setLayoutConfig(e){this._setProperty("layoutConfig",kt.ensure(e||{}).withSmallHgapDefaults()),kt.initHtmlEnvChangeHandler(this,()=>this.layoutConfig,t=>this.setLayoutConfig(t))}_renderLayoutConfig(){this.layoutConfig.applyToLayout(this.htmlBody.layout),this.rendered&&this.htmlBody.invalidateLayoutTree()}_onFieldPropertyChange(e){let t=e.propertyName==="visible";u.isOneOf(e.propertyName,["errorStatus","tooltipText","visible","menus","menusVisible"])?this._handleStatus(t):e.propertyName==="value"?this._onFieldValueChange(e):e.propertyName==="focused"&&this._updateFocusedFromField(e.source)}_handleStatus(e){if(e&&this._lastVisibleField&&(this._lastVisibleField.off("propertyChange:suppressStatus",this._lastVisibleFieldSuppressStatusHandler),this._lastVisibleField.setSuppressStatus(null),this._lastVisibleField.rendered&&(this._lastVisibleField._renderErrorStatus(),this._lastVisibleField._renderTooltipText(),this._lastVisibleField._renderMenus())),this._lastVisibleField=this._getLastVisibleField(),!this._lastVisibleField)return;this._isOverwritingStatusFromField=!0,this._lastVisibleField.errorStatus?(this.setErrorStatus(this._lastVisibleField.errorStatus),this._isErrorStatusOverwritten=!0):(this.setErrorStatus(this.boxErrorStatus),this._isErrorStatusOverwritten=!1),this._lastVisibleField.hasStatusTooltip()?(this.setTooltipText(this._lastVisibleField.tooltipText),this._isTooltipTextOverwritten=!0):(this.setTooltipText(this.boxTooltipText),this._isTooltipTextOverwritten=!1);let t=this._lastVisibleField.getContextMenuItems(!1);t&&t.length>0?(this._updateBoxMenuOwner(this.fieldStatus),this.setMenus(t),this.setMenusVisible(this._lastVisibleField.menusVisible),this._isMenusOverwritten=!0):(this._updateBoxMenuOwner(this),this.setMenus(this.boxMenus),this.setMenusVisible(this.boxMenusVisible),this._isMenusOverwritten=!1),this._isOverwritingStatusFromField=!1,this._lastVisibleField.setSuppressStatus(A.SuppressStatus.ICON),this._lastVisibleField.on("propertyChange:suppressStatus",this._lastVisibleFieldSuppressStatusHandler),e&&this._lastVisibleField.rendered&&(this._lastVisibleField._renderErrorStatus(),this._lastVisibleField._renderTooltipText(),this._lastVisibleField._renderMenus())}_updateFocusedFromField(e){e.visible&&e.focused?this.setFocused(this._computeSequenceBoxFocused(e)):this.setFocused(!1)}_computeSequenceBoxFocused(e){if(this.hasCssClass("consider-inner-focus"))return!0;if(this.hasCssClass("never-consider-inner-focus"))return!1;for(let i of this.fields.filter(s=>s.visible)){if(t(i))return!1;if(i===e)return!0}return!1;function t(i){return i.hasCssClass("consider-for-outer-focus")?!1:i.hasCssClass("never-consider-for-outer-focus")||i instanceof Oe||i instanceof cs?!0:!i.labelVisible||i.labelPosition===A.LabelPosition.ON_FIELD?!1:_.hasText(i.label)&&!new RegExp("^\\s*\\p{Punctuation}?\\s*$","u").test(i.label)}}_onLastVisibleFieldSuppressStatusChange(e){e.preventDefault()}setErrorStatus(e){this._isOverwritingStatusFromField&&!this._isErrorStatusOverwritten?this.boxErrorStatus=this.errorStatus:this._isOverwritingStatusFromField||(this.boxErrorStatus=e),(this._isOverwritingStatusFromField||!this._isErrorStatusOverwritten)&&super.setErrorStatus(e)}setTooltipText(e){this._isOverwritingStatusFromField&&!this._isTooltipTextOverwritten?this.boxTooltipText=this.tooltipText:this._isOverwritingStatusFromField||(this.boxTooltipText=e),(this._isOverwritingStatusFromField||!this._isTooltipTextOverwritten)&&super.setTooltipText(e)}setMenus(e){let t=this._createChildren(e);this._isOverwritingStatusFromField&&!this._isMenusOverwritten?this.boxMenus=this.menus:this._isOverwritingStatusFromField||(this.boxMenus=t),(this._isOverwritingStatusFromField||!this._isMenusOverwritten)&&super.setMenus(t)}_updateBoxMenuOwner(e){this.boxMenus.forEach(t=>t.setOwner(e))}setMenusVisible(e){this._isOverwritingStatusFromField&&!this._isMenusOverwritten?this.boxMenusVisible=this.menusVisible:this._isOverwritingStatusFromField||(this.boxMenusVisible=e),(this._isOverwritingStatusFromField||!this._isMenusOverwritten)&&super.setMenusVisible(e)}_getLastVisibleField(){let e=this.fields.filter(t=>t.visible);if(e.length!==0)return e[e.length-1]}_onFieldValueChange(e){e.source instanceof Ht&&this._onDateFieldValueChange(e)}_onDateFieldValueChange(e){let t=e.source,i=this._getDateFields(),s=this._getAutoDateProposal(t);for(let r=i.indexOf(t)+1;r<i.length;r++){let o=i[r];if(o.hasModelAutoDateSet||o.setAutoDate(s),o.value)break}}_getDateFields(){return this.fields.filter(e=>e instanceof Ht)}_getAutoDateProposal(e){let t=null;return e&&e.value&&(!e.hasDate&&e.hasTime?t=S.shiftTime(e.value,1,0,0):t=S.shift(e.value,0,0,1)),t}_modifyLabel(e){e instanceof cs&&(e.labelVisible=!1),e instanceof Ht?(e.$dateField&&this._linkWithLabel(e.$dateField),e.$timeField&&this._linkWithLabel(e.$timeField)):e.$field&&this._linkWithLabel(e.$field)}setFields(e){if(this.rendered)throw new Error("Setting fields is not supported if sequence box is already rendered.");this.setProperty("fields",e)}getFields(){return this.fields}clone(e,t){let i=super.clone(e,t);return this._deepCloneProperties(i,"fields",t),i}}Z.uuidPathSkipWidgets.add(kn);class lc extends Js{getGridColumnCount(){return this.widget.fields.length}getGridWidgets(){return this.widget.fields}}class Jg extends Rn{_initModel(e,t){let i=super._initModel(e,t);return i.logicalGrid=null,i}}class Qg extends ps{step;valueEditable;sliderTabbable;slider;$valueLabel;fieldHtmlComp;_syncingValue=!1;constructor(){super(),this.fieldHtmlComp=null,this.$valueLabel=null,this.fieldStyle=A.FieldStyle.CLASSIC,this.clearable=ge.Clearable.NEVER,this.gridDataHints.horizontalAlignment=-1,this.updateDisplayTextOnModify=!0,this.minValue=0,this.maxValue=100,this.step=1,this.valueEditable=!0,this.sliderTabbable=!0}_init(e){super._init(e),this.slider=u.create(yn,{parent:this,minValue:this.minValue,maxValue:this.maxValue,value:this.value,step:this.step,tabbable:this.sliderTabbable,valueEditable:this.valueEditable}),this.slider.on("propertyChange",this._onSliderPropertyChange.bind(this)),this.on("propertyChange:displayText",t=>this._syncDisplayTextToSlider(t.newValue))}_render(){this.addContainer(this.$parent,"slider-field",new ac(this)),this.addLabel(),this.addMandatoryIndicator();let e=this.$container.appendDiv();this.fieldHtmlComp=x.install(e,this.session),this.slider.render(e),T.linkElementWithLabel(this.slider.$container,this.$label);let t=oe.makeTextField(e,"field");e.append(t),this.$valueLabel=e.appendDiv("slider-value"),this._updateValueLabel(),this.addFieldContainer(e),this.addField(t),this.addStatus()}_remove(){super._remove(),this.$valueLabel=null,this.fieldHtmlComp=null}_renderProperties(){super._renderProperties(),this._renderValueEditable()}_renderClearable(){}setStep(e){this.setProperty("step",e)}_setStep(e){this._setProperty("step",e),b.isNullOrUndefined(e)||this.slider.setStep(e)}setValueEditable(e){this.setProperty("valueEditable",e)}_renderValueEditable(){this.$fieldContainer.toggleClass("value-editable",!!this.valueEditable),this.$field.setVisible(this.valueEditable),this.$valueLabel.setVisible(!this.valueEditable),this.fieldHtmlComp.invalidateLayoutTree(!1)}setSliderTabbable(e){this.setProperty("sliderTabbable",e)}_setSliderTabbable(e){this._setProperty("sliderTabbable",e),this.slider.setTabbable(e)}_setMinValue(e){super._setMinValue(e),this.slider&&this.slider.setMinValue(e)}_setMaxValue(e){super._setMaxValue(e),this.slider&&this.slider.setMaxValue(e)}_validateValue(e){return super._validateValue(u.nvl(e,this.minValue))}_onSliderPropertyChange(e){e.propertyName==="value"&&!this._syncingValue?this.setValue(e.newValue):e.propertyName==="focused"&&(!e.newValue||this.slider.$container?.hasClass("keyboard-navigation"))&&this.setFocused(e.newValue)}_syncDisplayTextToSlider(e){try{this._syncingValue=!0,this.slider.setValue(this.parseValue(e)),this._updateValueLabel()}catch{}finally{this._syncingValue=!1}}_updateValueLabel(){this.$valueLabel?.text(this.displayText)}}class ac extends Kt{sliderField;constructor(e){super(e),this.sliderField=e}layout(e){super.layout(e);let t=this.sliderField.$fieldContainer;if(t.removeClass("compact"),t[0].clientWidth<t[0].scrollWidth){if(this.sliderField.valueEditable){let i=t.activeElement();i.is(this.sliderField.slider.$container)&&this.sliderField.session.focusManager.focusNextTabbable(i)}t.addClass("compact")}}}var Zg;function x_(n,e,t){return(e=P_(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function P_(n){var e=D_(n,"string");return typeof e=="symbol"?e:e+""}function D_(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Pe extends ge{popup;lookupCall;codeType;lookupRow;browseHierarchy;browseMaxRowCount;browseAutoExpandAll;browseLoadIncremental;searchRequired;activeFilterEnabled;activeFilter;activeFilterLabels;columnDescriptors;displayStyle;touchMode;embedded;lookupStatus;lookupSeqNo;initActiveFilter;maxLength;maxLengthHandler;_currentLookupCall;_pendingLookup;_pendingOpenPopup;_tabPrevented;_userWasTyping;_acceptInputEnabled;_acceptInputDeferred;_notUnique;_lastSearchText;_cellEditorPopup;_lockLookupRow;$screenReaderStatus;constructor(){super(),this.popup=null,this.lookupCall=null,this.codeType=null,this._pendingLookup=null,this._pendingOpenPopup=!1,this._tabPrevented=null,this.lookupRow=null,this.browseHierarchy=!1,this.browseMaxRowCount=Pe.DEFAULT_BROWSE_MAX_COUNT,this.browseAutoExpandAll=!0,this.browseLoadIncremental=!1,this.searchRequired=!1,this.activeFilterEnabled=!1,this.activeFilter=null,this.activeFilterLabels=[],this.columnDescriptors=null,this.displayStyle=Pe.DisplayStyle.DEFAULT,this.touchMode=!1,this.embedded=!1,this._userWasTyping=!1,this._acceptInputEnabled=!0,this._acceptInputDeferred=h().Deferred(),this._notUnique=!1,this._lastSearchText=null,this.lookupStatus=null,this._currentLookupCall=null,this.lookupSeqNo=0,this.initActiveFilter=null,this.maxLength=500,this.maxLengthHandler=u.create(De,{target:this}),this._addCloneProperties(["lookupRow","codeType","lookupCall","activeFilter","activeFilterEnabled","activeFilterLabels","browseHierarchy","browseMaxRowCount","browseAutoExpandAll","browseLoadIncremental","searchRequired","columnDescriptors","displayStyle"]),this.$screenReaderStatus=null}static DisplayStyle={DEFAULT:"default",DROPDOWN:"dropdown"};static ErrorCode={NOT_UNIQUE:1,NO_RESULTS:2,NO_DATA:3,SEARCH_REQUIRED:4};static DEBOUNCE_DELAY=200;static DEFAULT_BROWSE_MAX_COUNT=100;static ActiveFilter=(Zg=()=>x_(this,"ACTIVE_FILTER_VALUES",[Pe.ActiveFilter.UNDEFINED,Pe.ActiveFilter.FALSE,Pe.ActiveFilter.TRUE]),{UNDEFINED:"UNDEFINED",FALSE:"FALSE",TRUE:"TRUE"});_init(e){super._init(e),this.activeFilterLabels.length===0&&(this.activeFilterLabels=[this.session.text("ui.All"),this.session.text("ui.Inactive"),this.session.text("ui.Active")]),oe.initTouch(this,e),this.on("lookupCallDone",t=>this._renderScreenReaderStatus(t.result))}_initValue(e){this._setLookupCall(this.lookupCall),this._setCodeType(this.codeType),this._setLookupRow(this.lookupRow),super._initValue(e)}_markAsSaved(){super._markAsSaved(),this.setInitActiveFilter(this.activeFilter)}resetValue(){super.resetValue(),this.setActiveFilter(this.initActiveFilter)}_createKeyStrokeContext(){return new qi}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new hc(this))}_render(){this.addContainer(this.$parent,"has-icon "+this.cssClassName(),new ha(this)),this.addLabel();let t=(this.isDropdown()?oe.makeInputDiv:oe.makeInputOrDiv).call(oe,this).on("mousedown",this._onFieldMouseDown.bind(this));this.touchMode||t.keyup(this._onFieldKeyUp.bind(this)).keydown(this._onFieldKeyDown.bind(this)).on("input",this._onFieldInput.bind(this)),this.addField(t),this.maxLengthHandler.install(t),T.role(t,"combobox"),T.expanded(t,!1),this._addScreenReaderStatus(),this.embedded||this.addMandatoryIndicator(),this.addIcon(),this.addStatus(),this._addAriaFieldDescription()}_addScreenReaderStatus(){this.$screenReaderStatus=this.$container.appendDiv(),T.role(this.$screenReaderStatus,"status"),T.screenReaderOnly(this.$screenReaderStatus)}_addAriaFieldDescription(){T.addHiddenDescriptionAndLinkToElement(this.$field,this.id+"-func-desc",this.session.text("ui.AriaSmartFieldDescription"))}_renderProperties(){super._renderProperties(),this._renderMaxLength()}_renderGridData(){super._renderGridData(),this.updateInnerAlignment({useHorizontalAlignment:!this.browseHierarchy})}_renderGridDataHints(){super._renderGridDataHints(),this.updateInnerAlignment({useHorizontalAlignment:!this.browseHierarchy})}_renderScreenReaderStatus(e){e&&this.$screenReaderStatus&&(this._clearScreenReaderStatus(),e.numLookupRows?this.$screenReaderStatus.appendSpan().addClass("sr-lookup-row-count").text(this.session.text("ui.NumProposals",e.numLookupRows)):this.$screenReaderStatus.appendSpan().addClass("sr-lookup-row-count").text(this.session.text("ui.NoProposals")))}_clearScreenReaderStatus(){this.$screenReaderStatus&&this.$screenReaderStatus.children(".sr-lookup-row-count").remove()}cssClassName(){let e=this.displayStyle;return this.displayStyle===Pe.DisplayStyle.DEFAULT&&(e="smart"),e+"-field"}_readSearchText(){let e=this._readDisplayText(),t=u.nvl(this.displayText,""),i=t.split(`
`);return i.length===1||_.empty(e)?e:(i.shift(),p.insert(i,e,0),_.join(`
`,i))}_readDisplayText(){return oe.valOrText(this.$field)}_renderDisplayText(){let e=this._prepareDisplayText();oe.valOrText(this.$field,e),super._renderDisplayText()}_prepareDisplayText(){let e=u.nvl(this.displayText,""),t=e.split(`
`);return t.length&&(e=t[0]),e}acceptInput(e){if(!this._acceptInputEnabled)return h().log.isTraceEnabled()&&h().log.trace("(SmartField#acceptInput) Skipped acceptInput because _acceptInputEnabled=false"),this._acceptInputDeferred.promise();this._acceptInputEnabled=!1,setTimeout(()=>{this._acceptInputEnabled=!0});let t=this._readSearchText(),i=_.empty(t),s=this._checkSearchTextChanged(t),r=this._getSelectedLookupRow(s);return this._setProperty("displayText",t),this._acceptInputDeferred=h().Deferred(),this._flushLookupStatus(),this._clearPendingLookup(),this._acceptInput(e,t,i,s,r)}_getSelectedLookupRow(e){return!this.isPopupOpen()||e&&this._userWasTyping?null:this.lookupSeqNo===this.popup.lookupResult.seqNo?this.popup.getSelectedLookupRow():null}_checkSearchTextChanged(e){return this.isDropdown()||!this._userWasTyping?!1:!this._searchTextEquals(e,this._lastSearchText)}_searchTextEquals(e,t){let i=_.nullIfEmpty(this._firstTextLine(e)),s=_.nullIfEmpty(t);return _.equalsIgnoreCase(i,s)}_clearPendingLookup(){this._pendingLookup&&(clearTimeout(this._pendingLookup),this._pendingLookup=null)}_acceptInput(e,t,i,s,r){if(this.touchMode){h().log.isDebugEnabled()&&h().log.debug("(SmartField#_acceptInput) Always send acceptInput for touch field"),this._inputAccepted();return}let o=!1;if(this.removing?o=!0:!r&&this.lookupRow&&(o=_.nvl(this.lookupRow.text)===t),o){h().log.isDebugEnabled()&&h().log.debug("(SmartField#_acceptInput) unchanged: widget is removing or searchText is equals. Close popup"),this._clearLookupStatus(),this._inputAccepted(!1);return}if(this._notUnique&&!i&&this._setNotUniqueError(t),!r&&!this.lookupRow&&i){h().log.isDebugEnabled()&&h().log.debug("(SmartField#_acceptInput) unchanged: text is empty. Close popup"),this._clearLookupStatus(),this.errorStatus&&this.errorStatus.code===Pe.ErrorCode.NO_RESULTS&&this.clearErrorStatus(),this._inputAccepted(s||this._userWasTyping);return}if(!r&&i){h().log.isDebugEnabled()&&h().log.debug("(SmartField#_acceptInput) empty. Set lookup-row to null, close popup"),this._clearLookupStatus(),this.setLookupRow(null),this._inputAccepted();return}if(r){h().log.isDebugEnabled()&&h().log.debug("(SmartField#_acceptInput) lookup-row selected. Set lookup-row, close popup lookupRow=",r.toString()),this._clearLookupStatus(),this.setLookupRow(r),this._inputAccepted();return}return s||this._userWasTyping?this._acceptByText(e,this._firstTextLine(t)):this._hasUiError()?this._hasNotUniqueError()&&this.popup?this.popup.selectFirstLookupRow():this._acceptInputDeferred.resolve():this._inputAccepted(!1),this._acceptInputDeferred.promise()}_firstTextLine(e){return _.empty(e)?e:e.split(`
`)[0]}_acceptByText(e,t){e=u.nvl(e,!1),h().log.isDebugEnabled()&&h().log.debug("(SmartField#_acceptByText) sync="+e+" searchText=",t),e?this._acceptByTextSync(t):this._acceptByTextAsync(t)}_acceptByTextSync(e){this._lastSearchText=null,this._inputAccepted(),this._hasUiError()||this.resetDisplayText()}_acceptByTextAsync(e){this._lastSearchText=e,this._executeLookup(this.lookupCall.cloneForText(e),!0).done(this._acceptByTextDone.bind(this)).done(this._triggerLookupCallDone.bind(this)),this._triggerAcceptByText(e)}_inputAccepted(e,t){e=u.nvl(e,!0),t=u.nvl(t,!0),this.embedded||this.closePopup(),this._userWasTyping=!1,e&&this._triggerAcceptInput(t),this._focusNextTabbable(),this._acceptInputDeferred.resolve()}_focusNextTabbable(){this._tabPrevented&&(this.session.focusManager.focusNextTabbable(this.$container.activeElement(),!this._tabPrevented.shiftKey),this._tabPrevented=null)}_acceptByTextDone(e){if(this._userWasTyping=!1,this._extendResult(e),this._notUnique=e.numLookupRows>1,e.uniqueMatch){let t=e.uniqueMatch;this._isLookupRowActive(t)?(this.setLookupRow(t),this._inputAccepted()):this.setErrorStatus(E.error({message:this.session.text("SmartFieldInactiveRow",e.text)}));return}this._acceptInputFail(e)}_extendResult(e){e.seqNo=this.lookupSeqNo,e.uniqueMatch=null;let t="by"+_.toUpperCaseFirstLetter(e.queryBy.toLowerCase());if(e[t]=!0,this.browseHierarchy){let i=u.create(gc,{parent:this,smartField:this});i.setLookupResult(e);let s=i.findLeafs();e.numLookupRows=s.length,e.numLookupRows===1&&(e.uniqueMatch=s[0].lookupRow)}else e.numLookupRows=e.lookupRows.length,e.numLookupRows===1&&(e.uniqueMatch=e.lookupRows[0])}_acceptInputFail(e){let t=e.text;e.numLookupRows||(this.embedded||this.closePopup(),this.setValue(null),this.setDisplayText(t),this.setErrorStatus(E.error({message:this.session.text("SmartFieldCannotComplete",t),code:Pe.ErrorCode.NO_RESULTS}))),e.numLookupRows>1&&(this.setValue(null),this.setDisplayText(t),this._setNotUniqueError(t),this.isPopupOpen()?this.popup.setLookupResult(e):this._lookupByTextOrAllDone(e),this.isPopupOpen()&&this.popup.selectFirstLookupRow()),this._acceptInputDeferred.resolve(),this._triggerAcceptInputFail()}lookupByRec(e){return h().log.isDebugEnabled()&&h().log.debug("(SmartField#lookupByRec) rec=",e),this._lastSearchText=null,this._executeLookup(this.lookupCall.cloneForRec(e)).then(t=>(t.appendResult=!0,t.rec=e,this.isPopupOpen()&&this.popup.setLookupResult(t),t)).then(this._triggerLookupCallDone.bind(this))}_isLookupRowActive(e){return e.enabled?this.activeFilterEnabled?this.activeFilter==="TRUE"?e.active:this.activeFilter==="FALSE"?!e.active:!0:!0:!1}_renderEnabled(){super._renderEnabled(),this.$field.setTabbable(this.enabledComputed)}setMaxLength(e){this.setProperty("maxLength",e)}_renderMaxLength(){this.maxLengthHandler.render()}setLookupCall(e){this.setProperty("lookupCall",e)}_setLookupCall(e){this._setProperty("lookupCall",Pt.ensure(e,this.session)),this._syncBrowseMaxRowCountWithLookupCall()}setCodeType(e){this.setProperty("codeType",e)}_setCodeType(e){if(this._setProperty("codeType",e),!e)return;let t=u.create(ro,{session:this.session,codeType:e});this.setLookupCall(t)}_formatValue(e){return b.isNullOrUndefined(e)?"":this.lookupRow?this._formatLookupRow(this.lookupRow):(this._lastSearchText=null,this._executeLookup(this.lookupCall.cloneForKey(e),!0).then(t=>({formattedValue:this._lookupByKeyDone(t),result:t})).then(t=>{let{formattedValue:i,result:s}=t;return this._triggerLookupCallDone(s),i}).catch(t=>{if(h().log.isDebugEnabled()&&h().log.debug("FormatValue failed for SmartField with id "+this.id,t),!this._updateDisplayTextPending)throw t;return t&&t.abort||t instanceof Mi&&t.textStatus==="abort"?"":this._invalidKeyLookup(e)}))}_lookupByKeyDone(e){this._notUnique=!1;let t=Pt.firstLookupRow(e);return t?(this.setLookupRow(t),this._formatLookupRow(t)):this._invalidKeyLookup(e.key)}_invalidKeyLookup(e){let t=this.session.text("ui.InvalidValue");return this.setLookupRow(u.create(ls,{key:e,text:t})),this.setErrorStatus(u.create(nn,{message:this.session.text("ui.ResolvingValueFailed"),severity:E.Severity.WARNING})),t}_formatLookupRow(e){return e?e.text:""}openPopup(e){let t=this._readDisplayText(),i=this.searchRequired?!0:null;return h().log.isInfoEnabled()&&h().log.info("SmartField#openPopup browse="+e+" searchText="+t+" popup="+this.popup+" pendingOpenPopup="+this._pendingOpenPopup),this._tabPrevented=null,this._pendingOpenPopup=!0,_.empty(t)?e=!0:this.errorStatus&&(this._hasNotUniqueError()?(i=!0,e=!1):this.searchRequired||(e=!0)),this._lookupByTextOrAll(e,t,i)}_hasUiError(e){let t=this._errorStatus();if(!t)return!1;e?e=p.ensure(e):e=[Pe.ErrorCode.NO_RESULTS,Pe.ErrorCode.NOT_UNIQUE];let s=E.asFlatList(t).reduce((r,o)=>(o.code&&r.indexOf(o.code)===-1&&r.push(o.code),r),[]);return e.some(r=>s.indexOf(r)>-1)}_lookupByTextOrAll(e,t,i){if(t=u.nvl(t,this._readDisplayText()),e=u.nvl(e,_.empty(t)),i=u.nvl(i,!1),this.isDropdown()&&(e=!0),!e&&!i){let o=null;if(this._lastSearchText?o=this._lastSearchText:o=this._getLastSearchText(),this._searchTextEquals(t,o)){this._pendingOpenPopup=!1,h().log.debug("(SmartField#_lookupByTextOrAll) searchText is equals -> skip lookup");return}}this._clearPendingLookup();let s=h().Deferred(),r=(function(o){this._lookupByTextOrAllDone(o),s.resolve(o)}).bind(this);return e?(h().log.isDebugEnabled()&&h().log.debug("(SmartField#_lookupByTextOrAll) lookup byAll (searchText empty)"),this._lastSearchText=null,this.searchRequired?(r({queryBy:me.TEXT,lookupRows:[]}),this.setLookupStatus(E.warning({message:this.session.text("TooManyRows"),code:Pe.ErrorCode.SEARCH_REQUIRED}))):this._executeLookup(this.lookupCall.cloneForAll(),!0).done(r).done(this._triggerLookupCallDone.bind(this))):this._pendingLookup=setTimeout(()=>{h().log.isDebugEnabled()&&h().log.debug("(SmartField#_lookupByTextOrAll) lookup byText searchText="+t),this._lastSearchText=t,this._executeLookup(this.lookupCall.cloneForText(t),!0).done(r).done(this._triggerLookupCallDone.bind(this))},Pe.DEBOUNCE_DELAY),s.promise()}_getLastSearchText(){return b.optProperty(this.lookupRow,"text")}_lookupByTextOrAllDone(e){if(this._extendResult(e),this._notUnique=!e.byAll&&e.numLookupRows>1,this._handleException(e))return;if(!this.rendered||!this.isFocused()&&!this.isTouchable()){this.closePopup();return}let t=!e.numLookupRows;if(t&&e.byAll){this.activeFilterEnabled?this._ensurePopup(e):this.closePopup(),this.setLookupStatus(E.warning({message:this.session.text("SmartFieldNoDataFound"),code:Pe.ErrorCode.NO_DATA}));return}if(t){this._handleEmptyResult(),this.setLookupStatus(E.warning({message:this.session.text("SmartFieldCannotComplete",e.text),code:Pe.ErrorCode.NO_RESULTS}));return}let i=null;e.numLookupRows>this.browseMaxRowCount&&(e.lookupRows=e.lookupRows.slice(0,this.browseMaxRowCount),i=E.info({message:this.session.text("SmartFieldMoreThanXRows",this.browseMaxRowCount)})),this._ensurePopup(e,i)}_ensurePopup(e,t){this.popup?(this.popup.setLookupResult(e),this.popup.setStatus(t)):this._renderPopup(e,t)}_handleException(e){return e.exception?(this.setErrorStatus(E.error({message:e.exception})),this.closePopup(),!0):!1}_handleEmptyResult(){if(this.touchMode||this.activeFilterEnabled){let e={lookupRows:[]};this._ensurePopup(e)}else this.embedded?this.popup.clearLookupRows():this.closePopup()}_renderPopup(e,t){this.$field.addClass("focused"),T.expanded(this.$field,!0),this.$container.addClass("popup-open");let i=this.touchMode&&!this.isDropdown(),s=i?"SmartFieldTouchPopup":"SmartFieldPopup";this._pendingOpenPopup=!1,this.popup=u.create(s,{parent:this,$anchor:this.$field,boundToAnchor:!i,closeOnAnchorMouseDown:!1,field:this,lookupResult:e,status:t}),this.popup.open(),T.linkElementWithControls(this.$field,this.popup.$container),this.popup.$container.css("--inactive-lookup-row-suffix-text",`'${this.session.text("InactiveState")}'`);let r=i?this.popup._field:this;this.popup.on("lookupRowSelected",r._onLookupRowSelected.bind(r)),this.popup.on("activeFilterSelected",this._onActiveFilterSelected.bind(this)),this.popup.one("remove",()=>{this.popup=null,this.rendered&&(this.$container.removeClass("popup-open"),this.$field.removeClass("focused"),this._resetPopupAriaProperties(),this._renderErrorStatus())})}closePopup(){this._pendingOpenPopup=!1,this.popup&&this.popup.close()}_resetPopupAriaProperties(){T.expanded(this.$field,!1),T.removeActiveDescendant(this.$field),this._clearScreenReaderStatus(),T.removeControls(this.$field)}aboutToBlurByMouseDown(e){this.touchMode||oe.eventOutsideProposalField(this,e)&&this.acceptInput(!0)}_onFieldMouseDown(e){h().log.isDebugEnabled()&&h().log.debug("(SmartField#_onFieldMouseDown)"),this.activate(!0)}activate(e){if(!(!this.enabledComputed||!this.rendered)){if(!this.isDropdown()&&!oe.handleOnClick(this)){this.popup&&this.popup.removalPending&&this.popup.one("remove",()=>{this.rendered&&this.activate(e)});return}(!e||w.get().supportsOnlyTouch())&&this.$field.focus(),this.togglePopup()}}_onIconMouseDown(e){h().log.isDebugEnabled()&&h().log.debug("(SmartField#_onIconMouseDown)"),this.enabledComputed&&(e.preventDefault(),this.$field.focus(),this.embedded||(this.isDropdown()?this.togglePopup():this.popup||this.openPopup(!this.searchRequired)))}_onClearIconMouseDown(e){h().log.isDebugEnabled()&&h().log.debug("(SmartField#_onClearIconMouseDown)"),this.enabledComputed&&(e.preventDefault(),this.$field.focus(),this.clear())}_clear(){this._tabPrevented=null,this._lastSearchText=this._readDisplayText(),this._userWasTyping=!0,oe.valOrText(this.$field,""),this.touchMode&&this.setValue(null),this.isPopupOpen()&&setTimeout(this._lookupByTextOrAll.bind(this,!0)),this._updateHasText()}togglePopup(){h().log.isInfoEnabled()&&h().log.info("(SmartField#togglePopup) popupOpen=",this.isPopupOpen()),this.isPopupOpen()?this.closePopup():this.openPopup(!this.searchRequired)}_onFieldBlur(e){this.setFocused(!1),this.setLoading(!1),!this.isTouchable()&&(this.acceptInput(!1),this.closePopup())}isTouchable(){return this.embedded||this.touchMode}_onFieldKeyUp(e){if(e.which===m.ESC)return;let t=e.which,i=(e.ctrlKey||e.metaKey)&&t===m.V||e.shiftKey&&t===m.INSERT,s=(e.ctrlKey||e.metaKey)&&t===m.X||e.shiftKey&&t===m.DELETE;!((i||s)&&!this.isDropdown())&&(e.ctrlKey||e.altKey||e.metaKey||t===m.ENTER||t===m.TAB||t===m.SHIFT||t===m.CTRL||t===m.ALT||t===m.HOME||t===m.END||t===m.LEFT||t===m.RIGHT||t===m.WIN_LEFT||t===m.WIN_RIGHT||t===m.SELECT||t===m.NUM_LOCK||t===m.CAPS_LOCK||t===m.SCROLL_LOCK||t===m.PAUSE||t===m.PRINT_SCREEN||this._isNavigationKey(e)||this._isFunctionKey(e))||this._handleInput()}_handleInput(){this._pendingOpenPopup||this.isPopupOpen()?this.isDropdown()||this._lookupByTextOrAll():this._pendingOpenPopup||this.openPopup()}isPopupOpen(){return!!(this.popup&&!this.popup.removalPending)}_onFieldKeyDown(e){if(this._updateUserWasTyping(e),e.which===m.TAB){this.mode===A.Mode.DEFAULT&&(e.preventDefault(),e.stopPropagation(),h().log.isDebugEnabled()&&h().log.debug("(SmartField#_onFieldKeyDown) set _tabPrevented"),this._tabPrevented={shiftKey:e.shiftKey}),this.acceptInput();return}if(e.which===m.ENTER){this._handleEnterKey(e);return}let t=e.which;this.isDropdown()&&(e.ctrlKey||e.altKey||e.metaKey||t===m.ESC||t===m.SHIFT||t===m.CTRL||t===m.ALT||t===m.WIN_LEFT||t===m.WIN_RIGHT||t===m.SELECT||t===m.NUM_LOCK||t===m.CAPS_LOCK||t===m.SCROLL_LOCK||t===m.PAUSE||t===m.PRINT_SCREEN||this._isFunctionKey(e))||(this._isNavigationKey(e)||this.isDropdown())&&(this.isPopupOpen()?this.popup.delegateKeyEvent(e):this._pendingOpenPopup||this.openPopup(!this.searchRequired),e.stopPropagation(),e.preventDefault())}_onFieldInput(){this._updateHasText(),this._userWasTyping||(this.isFocused()||this.focus(),this._handleInput())}_updateUserWasTyping(e){let t=e.which,i=(e.ctrlKey||e.metaKey)&&t===m.V||e.shiftKey&&t===m.INSERT,s=(e.ctrlKey||e.metaKey)&&t===m.X||e.shiftKey&&t===m.DELETE;!((i||s)&&!this.isDropdown())&&(e.ctrlKey||e.altKey||e.metaKey||t===m.ESC||t===m.TAB||t===m.SHIFT||t===m.CTRL||t===m.ALT||t===m.HOME||t===m.END||t===m.LEFT||t===m.RIGHT||t===m.WIN_LEFT||t===m.WIN_RIGHT||t===m.SELECT||t===m.NUM_LOCK||t===m.CAPS_LOCK||t===m.SCROLL_LOCK||t===m.PAUSE||t===m.PRINT_SCREEN||this._isFunctionKey(e))||(this._userWasTyping=!(this._isNavigationKey(e)||t===m.ENTER))}_isNavigationKey(e){let t=[m.PAGE_UP,m.PAGE_DOWN,m.UP,m.DOWN];return this.isDropdown()&&(t.push(m.HOME),t.push(m.END)),u.isOneOf(e.which,t)}_handleEnterKey(e){this.isPopupOpen()&&(this.popup.selectLookupRow(),e.stopPropagation())}_isFunctionKey(e){return e.which>=m.F1&&e.which<=m.F12}_onLookupRowSelected(e){this._clearPendingLookup();let t=this.original()._currentLookupCall;t&&(t.abort(),this.original()._currentLookupCall=null,this.setLoading(!1)),this.setLookupRow(e.lookupRow),this._inputAccepted(),this.closePopup()}_onActiveFilterSelected(e){this.setActiveFilter(e.activeFilter);let t=!this.searchRequired,i=this._readSearchText();this.lookupRow?this.lookupRow.text!==i&&(t=!1):_.hasText(i)&&(t=!1),this._lookupByTextOrAll(t,i,!0)}setBrowseMaxRowCount(e){this.setProperty("browseMaxRowCount",e),this._syncBrowseMaxRowCountWithLookupCall()}_syncBrowseMaxRowCountWithLookupCall(){this.lookupCall&&this.lookupCall.setMaxRowCount(this.browseMaxRowCount+1)}setBrowseAutoExpandAll(e){this.setProperty("browseAutoExpandAll",e)}setBrowseLoadIncremental(e){this.setProperty("browseLoadIncremental",e),this.lookupCall&&this.lookupCall.setLoadIncremental(e)}setActiveFilter(e){this.setProperty("activeFilter",this.activeFilterEnabled?e:null)}setActiveFilterEnabled(e){this.setProperty("activeFilterEnabled",e)}setInitActiveFilter(e){this.setProperty("initActiveFilter",e)}setSearchRequired(e){this.setProperty("searchRequired",e)}_executeLookup(e,t){this.lookupSeqNo++,this.setLoading(!0);let i=this.original()._currentLookupCall;return t&&i&&i.abort(),this.original()._currentLookupCall=e,this.trigger("prepareLookupCall",{lookupCall:e}),e.execute().always(()=>{this.original()._currentLookupCall=null,this.setLoading(!1),this._clearLookupStatus(),this._clearNoResultsErrorStatus()})}_clearNoResultsErrorStatus(){this.isTouchable()||this._userWasTyping&&this.errorStatus&&this.errorStatus.code===Pe.ErrorCode.NO_RESULTS&&this.setErrorStatus(null)}virtual(){return this.browseMaxRowCount>Pe.DEFAULT_BROWSE_MAX_COUNT}isDropdown(){return this.displayStyle===Pe.DisplayStyle.DROPDOWN}_setLookupRow(e){this.lookupRow?.cssClass&&this.removeCssClass(this.lookupRow.cssClass),this._setProperty("lookupRow",e),e?.cssClass&&this.addCssClass(e.cssClass)}setLookupRow(e){this.lookupRow!==e&&(this._notUnique=!1,this.clearErrorStatus(),this._setLookupRow(e),this._lockLookupRow=!0,e?this.setValue(this._getValueFromLookupRow(e)):this.setValue(null),this._lockLookupRow=!1,this.resetDisplayText())}updateLookupRow(){this._setLookupRow(null),this.setValue(this.value)}setDisplayText(e){super.setDisplayText(e),this._userWasTyping=!1}resetDisplayText(){let e=this.formatValue(this.value);e&&h().isFunction(e.promise)?e.done(this._setAndRenderDisplayText.bind(this)).fail(()=>{h().log.isInfoEnabled()&&h().log.info("Could not resolve display text for value: "+this.value)}):this._setAndRenderDisplayText(e)}_setAndRenderDisplayText(e){this._setProperty("displayText",e),this.rendered&&this._renderDisplayText()}_getValueFromLookupRow(e){return e.key}_setValue(e){this._lockLookupRow||(b.isNullOrUndefined(e)?this._setLookupRow(null):this._checkResetLookupRow(e)&&this._setLookupRow(null)),this.original()._currentLookupCall?.abort(),this.original()._currentLookupCall=null,super._setValue(e),this._notUnique=!1}_checkResetLookupRow(e){return this.lookupRow&&this.lookupRow.key!==e}getValueForSelection(){return this._showSelection()?this.value:null}_showSelection(){if(b.isNullOrUndefined(this.value)||b.isNullOrUndefined(this.lookupRow))return!1;let e;if(this.rendered){e=this._readDisplayText();let t=this.additionalLines();t&&(e=[e].concat(t).join(`
`))}else e=this.displayText;return e===this.lookupRow.text}isClearable(){return super.isClearable()&&!this.isDropdown()&&!this.touchMode}_triggerLookupCallDone(e){return this.trigger("lookupCallDone",{result:e}),e}_triggerAcceptInputFail(){this._triggerAcceptInput(!1,!0)}_triggerAcceptInput(e,t){this.trigger("acceptInput",{displayText:this.displayText,errorStatus:this.errorStatus,value:this.value,lookupRow:this.lookupRow,acceptByLookupRow:u.nvl(e,!0),failure:u.nvl(t,!1)})}_triggerAcceptByText(e){this.trigger("acceptByText",{searchText:e,errorStatus:this.errorStatus})}onCellEditorRendered(e){e.openFieldPopup&&(this._cellEditorPopup=e.cellEditorPopup,this.openPopup(!this.searchRequired))}additionalLines(){let e=u.nvl(this.displayText,""),t=e.split(`
`);return t.length>1?(t.shift(),t):null}_createLoadingSupport(){return new rn({widget:this,loadingIndicatorDelay:400})}_isInitialShowStatus(){return this.touchMode&&(this._pendingOpenPopup||this.isPopupOpen())?!1:super._isInitialShowStatus()}acceptInputFromField(e){this._copyValuesFromField(e),this._cellEditorPopup?(this._cellEditorPopup.completeEdit(),this._cellEditorPopup=null):this.acceptInput()}_copyValuesFromField(e){this.lookupRow!==e.lookupRow&&this.setLookupRow(e.lookupRow),this.setErrorStatus(e.errorStatus),this.setDisplayText(e.displayText)}_setNotUniqueError(e){this.setErrorStatus(E.error({message:this.session.text("SmartFieldNotUnique",e),code:Pe.ErrorCode.NOT_UNIQUE}))}_hasNotUniqueError(){return this._notUnique||this._hasUiError(Pe.ErrorCode.NOT_UNIQUE)}_errorStatus(){return this.lookupStatus||this.errorStatus}setLookupStatus(e){this.setProperty("lookupStatus",e)&&this.rendered&&this._renderErrorStatus()}clearErrorStatus(){this.setErrorStatus(null),this._clearLookupStatus()}_clearLookupStatus(){this.setLookupStatus(null)}_flushLookupStatus(){if(this.lookupStatus){if(this.lookupStatus.code===Pe.ErrorCode.NO_RESULTS||this.lookupStatus.code===Pe.ErrorCode.NOT_UNIQUE){let e=this.lookupStatus.clone();e.severity=E.Severity.ERROR,this.setErrorStatus(e)}this._clearLookupStatus()}}requestInput(){this.enabledComputed&&this.rendered&&(this.focus(),this.openPopup(!this.searchRequired))}}Zg();class aa extends oa{constructor(){super(),this._addRemoteProperties(["activeFilter"]),this._orderedProperties=["lookupRow","value","errorStatus","displayText"]}_postCreateWidget(){super._postCreateWidget(),this.widget.lookupCall=u.create(ll,this)}_syncResult(e){let t=this.widget._currentLookupCall;!t&&this.widget.touchMode&&this.widget.popup&&this.widget.popup._field&&(t=this.widget.popup._field._currentLookupCall),t&&t.resolveLookup(e)}_syncDisplayText(e){this.widget.setDisplayText(e)}_onWidgetEvent(e){e.type==="acceptByText"?this._onWidgetAcceptByText(e):super._onWidgetEvent(e)}_onWidgetAcceptByText(e){this._sendProperty("errorStatus",e.errorStatus)}_onWidgetAcceptInput(e){let t={displayText:e.displayText,errorStatus:e.errorStatus};e.errorStatus?_.empty(e.displayText)&&(t.value=null):(t.value=e.value,e.acceptByLookupRow&&(t.lookupRow=e.lookupRow)),this._send("acceptInput",t,{showBusyIndicator:!e.whileTyping,coalesce:function(i){return this.target===i.target&&this.type===i.type&&this.whileTyping===i.whileTyping}})}}class ha extends Kt{_smartField;constructor(e){super(e),this._smartField=e}layout(e){if(super.layout(e),this._smartField.embedded)return;let t=this._smartField.popup;t&&t.rendered&&(t.position(),t.validateLayout())}}class hc extends B{constructor(e){super(),this.field=e,this.which=[m.ESC],this.stopPropagation=!0,this.preventInvokeAcceptInputOnActiveValueField=!0,this.renderingHints.$drawingArea=(function(t,i){return this.field.$fieldContainer}).bind(this)}_accept(e){return!(!super._accept(e)||!this.field.popup)}handle(e){this.field.closePopup(),this.field.resetDisplayText()}}class Ho extends _e{field;lookupResult;smartField;proposalChooser;constructor(){super(),this.animateRemoval=Ho.hasPopupAnimation(),this.windowPaddingX=0,this.windowPaddingY=0}_init(e){e.withFocusContext=!1,super._init(e),this.smartField=this.parent,this.proposalChooser=this._createProposalChooser(),this.proposalChooser.on("lookupRowSelected",this._triggerEvent.bind(this)),this.proposalChooser.on("activeFilterSelected",this._triggerEvent.bind(this)),this.smartField.on("remove",this._onRemoveSmartField.bind(this)),this.setLookupResult(e.lookupResult),this.setStatus(e.status)}_createProposalChooser(){let e=this.smartField.browseHierarchy?"TreeProposalChooser":"TableProposalChooser";return u.create(e,{parent:this})}_createLayout(){return new dc(this)}_render(){let e=this.smartField.cssClassName()+"-popup";super._render(),this.$container.addClass(e).on("mousedown",this._onContainerMouseDown.bind(this)),this.$container.toggleClass("alternative",this.smartField.fieldStyle===A.FieldStyle.ALTERNATIVE),this.findDesktop().adjustOverlayOrder(this),this.proposalChooser.render()}setLookupResult(e){this._setProperty("lookupResult",e),this.proposalChooser.setLookupResult(e)}getSelectedLookupRow(){let e=this.proposalChooser.getSelectedLookupRow();return e&&e.enabled?e:null}setStatus(e){this.proposalChooser.setStatus(e)}selectFirstLookupRow(){this.proposalChooser.selectFirstLookupRow()}selectLookupRow(){this.proposalChooser.triggerLookupRowSelected()}delegateKeyEvent(e){e.originalEvent.smartFieldEvent=!0,this.proposalChooser.delegateKeyEvent(e)}_triggerEvent(e){this.trigger(e.type,e)}_onContainerMouseDown(e){return!1}_onRemoveSmartField(e){this.animateRemoval=!1,this.remove()}_isMouseDownOnAnchor(e){let t=e.target;return this.field.$field.isOrHas(t)||this.field.$icon.isOrHas(t)||this.field.$clearIcon&&this.field.$clearIcon.isOrHas(t)}_onAnimationEnd(){this.proposalChooser.updateScrollbars()}static hasPopupAnimation(){return w.get().supportsCssAnimation()}}class em extends go{field;lookupResult;smartField;_initialFieldState;constructor(){super(),this._initialFieldState=null}_init(e){e.withFocusContext=!1,e.smartField=e.parent,super._init(e),this._initialFieldState=this._getFieldState(),this.setLookupResult(e.lookupResult),this.setStatus(e.status),this.one("close",this._beforeClosePopup.bind(this)),this.smartField.on("propertyChange",this._onPropertyChange.bind(this)),this.addCssClass("smart-field-touch-popup")}_initDelegatedEvents(){return["prepareLookupCall","lookupCallDone"]}_initWidget(e){this._widget=this._createProposalChooser(),this._widget.on("lookupRowSelected",this._triggerEvent.bind(this)),this._widget.on("activeFilterSelected",this._triggerEvent.bind(this))}_getFieldState(){const{value:e,displayText:t,errorStatus:i,lookupRow:s}=this._field;return h().extend(!0,{},{value:e,displayText:t,errorStatus:i,lookupRow:s})}_createProposalChooser(){let e=this.parent.browseHierarchy?"TreeProposalChooser":"TableProposalChooser";return u.create(e,{parent:this,touch:!0,smartField:this._field})}_fieldOverrides(){let e=super._fieldOverrides();return e.proposalChooser=null,e}_onMouseDownOutside(){this._acceptInput()}delegateKeyEvent(e){e.originalEvent.smartFieldEvent=!0,this._widget.delegateKeyEvent(e)}getSelectedLookupRow(){return this._widget.getSelectedLookupRow()}_triggerEvent(e){this.trigger(e.type,e)}setLookupResult(e){this._widget.setLookupResult(e)}setStatus(e){this._widget.setStatus(e)}clearLookupRows(){this._widget.clearLookupRows()}selectFirstLookupRow(){this._widget.selectFirstLookupRow()}selectLookupRow(){this._widget.triggerLookupRowSelected()}_onPropertyChange(e){e.propertyName==="lookupStatus"&&this._field.setLookupStatus(e.newValue)}_beforeClosePopup(e){b.equalsRecursive(this._initialFieldState,this._getFieldState())||this.smartField.acceptInputFromField(this._field)}}class dc extends xi{animating;constructor(e){super(e),this.animating=!1,this.doubleCalcPrefSize=!1}layout(e){let t,i,s=this._htmlProposalChooser();if(this.animating){this.popup.htmlComp.$comp.oneAnimationEnd(()=>{this.popup.revalidateLayout()});return}super.layout(e),i=this.popup.htmlComp.size(),t=i.subtract(this.popup.htmlComp.insets()),s.setSize(t),this.popup.htmlComp.layouted?this.popup.position():Ho.hasPopupAnimation()&&(this.animating=!0,this.popup.htmlComp.$comp.css("visibility","hidden"),this.popup.session.layoutValidator.schedulePostValidateFunction(()=>{this.popup.htmlComp.$comp.css("visibility",""),this.popup.htmlComp.$comp.addClassForAnimation("animate-open"),this.popup.htmlComp.$comp.oneAnimationEnd(()=>{this.animating=!1,this.popup._onAnimationEnd()})}))}preferredLayoutSize(e,t){let i,s=this._htmlProposalChooser(),r=C.offsetBounds(this.popup.smartField.$field);return s?(i=s.prefSize(t),i=i.add(this.popup.htmlComp.insets())):i=new F(we.get().formColumnWidth,we.get().formRowHeight*2),i.width=Math.max(r.width,i.width),i.height=Math.max(15,Math.min(350,i.height)),i.width>this._maxWindowSize()&&(i.width=this._maxWindowSize()),i}_htmlProposalChooser(){let e=this.popup.proposalChooser;return e?e.htmlComp:null}_maxWindowSize(){return this.popup.$container.window().width()-2*this.popup.windowPaddingX}}class tm extends Pe{_$multilineLines;constructor(){super(),this._$multilineLines=null}_render(){let e,t;this.addContainer(this.$parent,"smart-field has-icon",new ha(this)),this.addLabel(),this.addFieldContainer(this.$parent.makeDiv("multiline")),t=x.install(this.$fieldContainer,this.session),t.setLayout(new uc(this)),e=oe.makeInputOrDiv(this,"multiline-input").on("mousedown",this._onFieldMouseDown.bind(this)).appendTo(this.$fieldContainer),this.touchMode||e.keyup(this._onFieldKeyUp.bind(this)).keydown(this._onFieldKeyDown.bind(this)).on("input",this._onFieldInput.bind(this)),this.addField(e),T.role(e,"combobox"),T.expanded(e,!1),this._addScreenReaderStatus(),this._$multilineLines=this.$fieldContainer.appendDiv("multiline-lines").on("click",this._onMultilineLinesClick.bind(this)),this.embedded||this.addMandatoryIndicator(),this.addIcon(),this.addStatus(),this._addAriaFieldDescription()}_renderEnabled(){super._renderEnabled(),this._$multilineLines.setEnabled(this.enabledComputed)}_onMultilineLinesClick(e){this.enabledComputed&&(this.$field.window(!0).getSelection().toString()||this.$field.focus())}_renderDisplayText(){super._renderDisplayText();let e=this.additionalLines();e?this._$multilineLines.html(p.formatEncoded(e,"<br/>")):this._$multilineLines.empty()}_getInputBounds(){let e=C.offsetBounds(this.$fieldContainer),t=C.offsetBounds(this.$field);return e.height=t.height,e}_renderFocused(){super._renderFocused(),this._$multilineLines.toggleClass("focused",this.focused)}_updateErrorStatusClasses(e,t){super._updateErrorStatusClasses(e,t),this._updateErrorStatusClassesOnElement(this._$multilineLines,e,t)}}class im extends aa{}class uc extends ne{smartField;htmlPropertyChangeHandler;rowHeight;constructor(e){super(),this.smartField=e,this._initDefaults(),this.htmlPropertyChangeHandler=this._onHtmlEnvironmentPropertyChange.bind(this),we.get().on("propertyChange",this.htmlPropertyChangeHandler),this.smartField.one("remove",()=>{we.get().off("propertyChange",this.htmlPropertyChangeHandler)})}_initDefaults(){this.rowHeight=we.get().formRowHeight}_onHtmlEnvironmentPropertyChange(){this._initDefaults(),this.smartField.invalidateLayoutTree()}layout(e){let t=x.get(e),i=e.children(".multiline-input"),s=e.children(".multiline-lines"),r=t.availableSize().subtract(t.insets());i.cssHeight(this.rowHeight),s.cssHeight(r.height-this.rowHeight)}}class cc extends Pe{trimText;lookupOnAcceptByText;constructor(){super(),this.maxLength=4e3,this.trimText=!0,this.lookupOnAcceptByText=!1}_getValueFromLookupRow(e){return e.text}_getLastSearchText(){return this.value}cssClassName(){return"proposal-field"}_addAriaFieldDescription(){T.addHiddenDescriptionAndLinkToElement(this.$field,this.id+"-func-desc",this.session.text("ui.AriaProposalFieldDescription"))}_handleEnterKey(e){let t=!!this.popup;this.acceptInput(),this.popup&&this.closePopup(),t&&e.stopPropagation()}_lookupByTextOrAllDone(e){if(!super._handleException(e)){if(e.lookupRows.length===0){this.setLoading(!1),this._handleEmptyResult();return}super._lookupByTextOrAllDone(e)}}_formatValue(e){return b.isNullOrUndefined(e)?"":this.lookupRow?this._formatLookupRow(this.lookupRow):e}_validateValue(e){if(b.isNullOrUndefined(e))return e;let t=_.asString(e);return this.trimText&&(t=t.trim()),t===""&&(t=null),t}_ensureValue(e){return _.asString(e)}_acceptByText(e,t){h().log.isDebugEnabled()&&h().log.debug("(ProposalField#_acceptByText) searchText=",t),!e&&this.lookupOnAcceptByText&&_.hasText(t)?super._acceptByTextAsync(t):this._customTextAccepted(t)}_acceptByTextDone(e){if(this._userWasTyping=!1,this._extendResult(e),e.uniqueMatch){let t=e.uniqueMatch;if(this._isLookupRowActive(t)){this.setLookupRow(t),this._inputAccepted();return}}this._customTextAccepted(e.text)}_checkResetLookupRow(e){return this.lookupRow&&this.lookupRow.text!==e}_checkSearchTextChanged(e){return this._checkDisplayTextChanged(e)}_customTextAccepted(e){this._setLookupRow(null),this._setValue(e),this._inputAccepted(!0,!1)}getValueForSelection(){return this._showSelection()?this.lookupRow.key:null}_copyValuesFromField(e){this.lookupRow!==e.lookupRow&&this._setLookupRow(e.lookupRow),this.setErrorStatus(e.errorStatus),this.setDisplayText(e.displayText),this.setValue(e.value)}_acceptInput(e,t,i,s,r){if(this.touchMode){h().log.isDebugEnabled()&&h().log.debug("(ProposalField#_acceptInput) Always send acceptInput for touch field"),this._inputAccepted(!0,!!r);return}if(!s&&!r&&this.lookupRow&&this.lookupRow.text===t){h().log.isDebugEnabled()&&h().log.debug("(ProposalField#_acceptInput) unchanged: text is equals. Close popup"),this._inputAccepted(!1);return}if(r){h().log.isDebugEnabled()&&h().log.debug("(ProposalField#_acceptInput) lookup-row selected. Set lookup-row, close popup lookupRow=",r.toString()),this.clearErrorStatus(),this.setLookupRow(r),this._inputAccepted();return}return s?(this.clearErrorStatus(),this._acceptByText(e,t)):this._hasUiError()?this._acceptInputDeferred.resolve():this._inputAccepted(!1),this._acceptInputDeferred.promise()}setTrimText(e){this.setProperty("trimText",e)}_computeEmpty(){return _.empty(this.value)}}class sm extends aa{constructor(){super(),this._addRemoteProperties(["lookupRows"])}}class pc extends Fi{lookupRow;parentId;proposalChooser;_renderText(){this.htmlEnabled?this.$text.html(this.text):this.$text.textOrNbsp(this.text)}_getStyles(){return this.lookupRow}_decorate(){this.$node&&(super._decorate(),this.$node.toggleClass("inactive",!this.lookupRow.active))}isBrowseLoadIncremental(){return this.proposalChooser.isBrowseLoadIncremental()}loadChildren(){if(this.isBrowseLoadIncremental()){let e=this.lookupRow.key;return this.proposalChooser.smartField.lookupByRec(e)}return h().resolvedPromise()}hasChildNodes(){return this.isBrowseLoadIncremental()&&!this.childrenLoaded?!0:super.hasChildNodes()}}class da extends I{smartField;activeFilterGroup;status;statusVisible;touch;content;$status;_updateStatusTimeout;constructor(){super(),this.activeFilterGroup=null,this.status=null,this.statusVisible=!0,this.touch=!1,this.$status=null,this._updateStatusTimeout=null}_init(e){super._init(e),e.smartField||(this.smartField=this.parent.smartField),this.content=this._createContent()}triggerLookupRowSelected(e){e=e||this.selectedRow(),!(!e||!e.enabled)&&this.trigger("lookupRowSelected",{lookupRow:e.lookupRow})}_render(){this.$container=this.$parent.appendDiv("proposal-chooser").toggleClass("touch",this.touch),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new fc(this,this._createLayoutResetter())),this._renderContent(),this.$status=this.$container.appendDiv("status").setVisible(!1),this.smartField.activeFilterEnabled&&(this.activeFilterGroup=u.create(Or,{parent:this,labelVisible:!1,statusVisible:!1,gridColumnCount:Pe.ACTIVE_FILTER_VALUES.length}),Pe.ACTIVE_FILTER_VALUES.forEach(function(e,t){this._insertActiveFilterButton(e,t)},this),this.activeFilterGroup.render(),this.activeFilterGroup.$container.addClass("active-filter"),this.activeFilterGroup.removeMandatoryIndicator())}_renderContent(){this.content.render(),this.content.$container.setTabbable(!1),this.content.$container.addClass("focused")}_renderProperties(){super._renderProperties(),this._updateStatus()}delegateEvent(e){e.originalEvent.smartFieldEvent=!0,this.content.$container.trigger(e)}delegateKeyEvent(e){this.content.$container.trigger(e)}_renderStatus(){this._updateStatus()}_renderStatusVisible(){this._updateStatus()}_computeStatusVisible(){return!!(this.statusVisible&&this.status)}_updateStatus(){clearTimeout(this._updateStatusTimeout),b.optProperty(this.status,"severity")===E.Severity.OK?this._updateStatusTimeout=setTimeout(this._updateStatusImpl.bind(this),250):this._updateStatusImpl()}_updateStatusImpl(){if(!this.rendered&&!this.rendering)return;let e=this.$status.isVisible(),t=this.$status.text(),i=this._computeStatusVisible();e===i&&t===b.optProperty(this.status,"message")||(h().log.isDebugEnabled()&&h().log.debug("(ProposalChooser#_updateStatusImpl) $status.visible="+i),this.$status.setVisible(i),this.status?(this._setStatusMessage(this.status.message),this.smartField.$screenReaderStatus?.appendSpan().addClass("text").addClass("sr-proposal-chooser-status").text(this.status.message)):(this.$status.text(""),this.smartField.$screenReaderStatus?.children(".sr-proposal-chooser-status").remove()),this.htmlComp.invalidateLayoutTree())}_setStatusMessage(e){E.animateStatusMessage(this.$status,e)}_insertActiveFilterButton(e,t){let i=u.create(Bo,{parent:this.activeFilterGroup,label:this._activeFilterLabel(t),radioValue:Pe.ACTIVE_FILTER_VALUES[t],selected:this.smartField.activeFilter===e,focusWhenSelected:!1,gridDataHints:{useUiWidth:!0}});i.on("propertyChange",s=>{s.propertyName==="selected"&&s.newValue===!0&&this.trigger("activeFilterSelected",{activeFilter:s.source.radioValue})}),this.activeFilterGroup.insertButton(i)}setVirtual(e){this.content instanceof H&&this.content.setVirtual(e)}setStatus(e){this.setProperty("status",e)}setBusy(e){this.content.setProperty("loading",e),this.content.setProperty("enabled",!e)}_activeFilterLabel(e){return this.smartField.activeFilterLabels[e]}updateScrollbars(){this.content.updateScrollbars()}_isProposal(){return this.smartField instanceof cc}_selectProposal(e,t){this._isProposal()||(e.byAll?this.trySelectCurrentValue():t.length===1&&this.selectFirstLookupRow())}}class fc extends ne{_proposalChooser;_layoutResetter;constructor(e,t){super(),this._proposalChooser=e,this._layoutResetter=t}layout(e){let t,i=x.get(e),s=x.get(e.children(this._layoutResetter.cssSelector)),r=i.size().subtract(i.insets()),o=this._proposalChooser.$status,l=o&&o.isVisible(),a=this._proposalChooser.activeFilterGroup;l&&(r.height-=C.size(o).height),a&&(t=a.htmlComp.prefSize(),r.height-=t.height),s.setSize(r),a&&a.htmlComp.setSize(new F(r.width,t.height))}preferredLayoutSize(e,t){let i,s,r,o,l,a,d,c=this._proposalChooser.htmlComp,f=this._proposalChooser.$status,g=this._proposalChooser.activeFilterGroup,y=e.parent();return r=this._proposalChooser.content.htmlComp.prefSize(t),s=r,P.storeScrollPositions(e,this._proposalChooser.session),a=e.css("width"),d=e.css("height"),e.detach(),this._layoutResetter.modifyDom(),e.css("display","inline-block").css("width","auto").css("height","auto"),y.append(e),r.width=C.prefSize(e,{restoreScrollPositions:!1}).width,e.detach(),this._layoutResetter.restoreDom(),e.css("display","block").css("width",a).css("height",d),y.append(e),P.restoreScrollPositions(e,this._proposalChooser.session),f&&f.isVisible()&&(i=f.css("display"),f.css("display","inline-block"),o=C.prefSize(f,{includeMargin:!0,useCssSize:!0}),f.css("display",i),s=new F(Math.max(s.width,o.width),s.height+o.height)),g&&(l=g.htmlComp.prefSize(),s=new F(Math.max(s.width,l.width),s.height+l.height)),e.toggleClass("empty",r.height===0),s.add(c.insets())}}class rm extends da{_createContent(){let e=!1,t=[],i=this.smartField.columnDescriptors;i?i.forEach((r,o)=>{e=e||!!r.text,t.push(this._createColumnForDescriptor(r))}):t.push(this._createColumn());let s=this._createTable(t,e);return s.accessibilityRenderer=new Fo,s.on("rowClick",this._onRowClick.bind(this)),s.on("rowsSelected",this._onRowsSelected.bind(this)),s}_createLayoutResetter(){return u.create(ua,this.content)}_createColumn(){return{objectType:le,width:le.NARROW_MIN_WIDTH,horizontalAlignment:this.smartField.gridData.horizontalAlignment}}_createColumnForDescriptor(e){let t=le.NARROW_MIN_WIDTH;return e.width&&e.width>0&&(t=e.width),u.create(u.nvl(e.objectType,le),{session:this.session,text:e.text,cssClass:u.nvl(e.cssClass,null),width:t,autoOptimizeWidth:u.nvl(e.autoOptimizeWidth,!1),fixedWidth:u.nvl(e.fixedWidth,!1),fixedPosition:u.nvl(e.fixedPosition,!1),horizontalAlignment:u.nvl(e.horizontalAlignment,this.smartField.gridData.horizontalAlignment),visible:u.nvl(e.visible,!0),htmlEnabled:u.nvl(e.htmlEnabled,!1),headerIconId:u.nvl(e.headerIconId,null)})}_createTable(e,t){const i=u.create(H,{parent:this,headerVisible:t,autoResizeColumns:!0,multiSelect:!1,multilineText:!0,scrollToSelection:!0,columns:e,headerMenusEnabled:!1,textFilterEnabled:!1});return i.selectionHandler.mouseMoveSelectionEnabled=!1,i}_onRowClick(e){let t=e.row;!t||!t.enabled||(this.setBusy(!0),this.triggerLookupRowSelected(t))}_postRender(){super._postRender();let e=this.content.selectedRow();this._renderSelectedRow(e),T.hasPopup(this.smartField.$field,"grid")}_onRowsSelected(e){let t=this.content.selectedRow();this._renderSelectedRow(t)}_renderSelectedRow(e){e&&e.$row?T.linkElementWithActiveDescendant(this.smartField.$field,e.$row):T.removeActiveDescendant(this.smartField.$field)}selectedRow(){return this.content.selectedRow()}setLookupResult(e){let t=[],i=e.lookupRows,s=!!this.smartField.columnDescriptors;this.content.deleteAllRows(),i.forEach(r=>{t.push(this._createTableRow(r,s))}),this.content.insertRows(t),this._selectProposal(e,t)}trySelectCurrentValue(){let e=this.smartField.getValueForSelection();if(b.isNullOrUndefined(e))return;let t=p.find(this.content.rows,i=>i.lookupRow.key===e);t&&this.content.selectRow(t)}selectFirstLookupRow(){this.content.rows.length&&this.content.selectRow(this.content.rows[0])}clearSelection(){this.content.deselectAll()}clearLookupRows(){this.content.deleteAllRows()}_createTableRow(e,t){let i=Br.createTableRow(e,t);return t&&p.pushAll(i.cells,this._transformTableRowData(e,e.additionalTableRowData)),i}_renderContent(){this.content.setVirtual(this.smartField.virtual()),super._renderContent(),this.content.$data.addClass("top-border-on-first-row")}getSelectedLookupRow(){let e=this.content.selectedRow();return e?e.lookupRow:null}_transformTableRowData(e,t){let i=this.smartField.columnDescriptors,s=[];return i.forEach(r=>{s.push(Br.createTableCell(e,r,t))}),s}}class ua{cssSelector;_table;_fillerWidth;constructor(e){this._table=e,this._fillerWidth=null,this.cssSelector=".table"}modifyDom(){this._table.$container.css("display","inline-block").css("width","auto").css("height","auto"),this._table.$data.css("display","inline-block"),this._modifyFiller(this._table.$fillBefore),this._modifyFiller(this._table.$fillAfter),this._modifyTableData(this._cssBackup)}restoreDom(){this._table.$container.css("display","block").css("width","100%").css("height","100%"),this._table.$data.css("display","block"),this._restoreFiller(this._table.$fillBefore),this._restoreFiller(this._table.$fillAfter),this._modifyTableData(this._cssRestore)}_cssBackup(e,t){let i=e.css(t);e.css(t,"").data("backup"+t,i)}_cssRestore(e,t){let i="backup"+t,s=e.data(i);e.css(t,s).removeData(i)}_modifyTableData(e){let t=this;this._table.$rows().each(function(){let i=h()(this);e(i,"width"),t._table.$cellsForRow(i).each(function(){let s=h()(this);e(s,"min-width"),e(s,"max-width")})})}_modifyFiller(e){e&&(this._fillerWidth=e.css("width"),e.css("width",""))}_restoreFiller(e){e&&e.css("width",this._fillerWidth)}}class gc extends da{_createContent(){let e=u.create(fe,{parent:this,requestFocusOnNodeControlMouseDown:!1,scrollToSelection:!0,textFilterEnabled:!1});return e.on("nodeClick",this._onNodeClick.bind(this)),e.on("nodesSelected",this._onNodeSelected.bind(this)),e}_postRender(){super._postRender();let e=this.content.selectedNode();this._renderSelectedNode(e),T.hasPopup(this.smartField.$field,"tree")}_onNodeSelected(e){let t=this.content.selectedNode();this._renderSelectedNode(t)}_renderSelectedNode(e){e&&e.$node?T.linkElementWithActiveDescendant(this.smartField.$field,e.$node):T.removeActiveDescendant(this.smartField.$field)}_createLayoutResetter(){return u.create(mc,this.content)}_onNodeClick(e){this.triggerLookupRowSelected(e.node)}selectedRow(){return this.content.selectedNode()}isBrowseLoadIncremental(){return this.smartField.browseLoadIncremental}getSelectedLookupRow(){let e=this.content.selectedNode();return e?e.lookupRow:null}selectFirstLookupRow(){this.content.nodes.length&&this.content.selectNode(this.content.nodes[0])}clearSelection(){this.content.deselectAll()}setLookupResult(e){let t,i,s=e.lookupRows;if(u.nvl(e.appendResult,!1))if(i=this._lookupRowsToFlatList(s),t=this._flatListToSubTree(i),t.length){let o=null;t.forEach(l=>{o=this.content.nodesMap[l.parentId],this._appendChildNode(o,l)}),o&&this.content.insertNodes(t,o)}else{let o=this.content.nodesMap[this._createNodeId(e.rec)];o.leaf=!0,o.childrenLoaded=!0,this.content.updateNode(o)}else this.content.deleteAllChildNodes(),i=this._lookupRowsToFlatList(s),t=this._flatListToSubTree(i),e.byText&&this._expandAllParentNodes(i),this.content.insertNodes(t);this._selectProposal(e,i)}_expandAllParentNodes(e){e.reduce((s,r)=>((r.leaf||!r.childrenLoaded&&r.childNodes.length===0)&&s.push(r),s),[]).forEach(i.bind(this));function i(s){if(!(!s.parentNode||s.parentNode.expanded))for(s=s.parentNode;s;)this.content.setNodeExpanded(s,!0),s=s.parentNode}}trySelectCurrentValue(){let e=this.smartField.getValueForSelection();if(b.isNullOrUndefined(e))return;let t=b.values(this.content.nodesMap),i=p.find(t,s=>s.lookupRow.key===e);i&&this.content.selectNode(i)}_createTreeNode(e){let t=!0,i=this.smartField.browseAutoExpandAll;return this.isBrowseLoadIncremental()&&(i=!1,t=!1),u.create(pc,{parent:this.content,proposalChooser:this,enabled:e.enabled,htmlEnabled:!1,iconId:e.iconId,id:this._createNodeId(e.key),parentId:this._createNodeId(e.parentKey),expanded:i,initialExpanded:i,text:e.text,lookupRow:e,leaf:t,tooltipText:e.tooltipText})}_createNodeId(e){return b.isNullOrUndefined(e)||typeof e=="string"?e:JSON.stringify(e)}findLeafs(){let e=[];return fe.visitNodes((t,i)=>{(t.leaf||!t.childNodes.length)&&e.push(t)},this.content.nodes),e}_lookupRowsToFlatList(e){let t=new Set;return e.map(this._createTreeNode.bind(this)).filter(i=>t.has(i.id)?!1:t.add(i.id))}_flatListToSubTree(e){let t={};e.forEach(s=>{b.isNullOrUndefined(s.id)||(t[s.id]=s)});let i=[];return e.forEach(s=>{let r=t[s.parentId];if(r===s)throw new Error("Cannot link a node to itself. Id: "+s.parentId);r?this._appendChildNode(r,s):(s.parentNode=null,i.push(s))}),i}_appendChildNode(e,t){e.childNodes||(e.childNodes=[]),t.parentNode=e,e.childNodes.push(t),e.leaf=!1,e.childrenLoaded=!0}clearLookupRows(){this.content.deleteAllNodes()}}class mc{cssSelector;_tree;constructor(e){this._tree=e,this.cssSelector=".tree"}modifyDom(){this._ensureFirstLast(),this._tree.$container.css("display","inline-block").css("width","auto").css("height","auto"),this._tree.$data.css("display","inline-block")}restoreDom(){this._tree.$container.css("display","block").css("width","100%").css("height","100%"),this._tree.$data.css("display","block")}_ensureFirstLast(){let e=this._tree.$data.children(".tree-node").removeClass("first last");e.first().addClass("first"),e.last().addClass("last")}}var nm;function ca(n,e,t){return(e=E_(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function E_(n){var e=F_(n,"string");return typeof e=="symbol"?e:e+""}function F_(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class be extends ar{firstField;secondField;collapsibleField;fieldCollapsed;toggleCollapseKeyStroke;firstCollapseKeyStroke;secondCollapseKeyStroke;splitHorizontal;splitterEnabled;splitterPosition;minSplitterPosition;splitterPositionType;fieldMinimized;minimizeEnabled;htmlSplitArea;collapseHandle;_oldSplitterPositionType;_$splitArea;_$splitter;_$window;_$body;constructor(){super(),this._addWidgetProperties(["firstField","secondField","collapsibleField"]),this._addPreserveOnPropertyChangeProperties(["collapsibleField"]),this.firstField=null,this.secondField=null,this.collapsibleField=null,this.fieldCollapsed=!1,this.toggleCollapseKeyStroke=null,this.firstCollapseKeyStroke=null,this.secondCollapseKeyStroke=null,this.splitHorizontal=!0,this.splitterEnabled=!0,this.splitterPosition=.5,this.minSplitterPosition=0,this.splitterPositionType=be.SplitterPositionType.RELATIVE_FIRST,this.fieldMinimized=!1,this.minimizeEnabled=!0,this._$splitArea=null,this._$splitter=null}static SplitterPositionType=(nm=()=>{ca(this,"SPLITTER_POSITION_TYPE_RELATIVE_FIRST",be.SplitterPositionType.RELATIVE_FIRST),ca(this,"SPLITTER_POSITION_TYPE_RELATIVE_SECOND",be.SplitterPositionType.RELATIVE_SECOND),ca(this,"SPLITTER_POSITION_TYPE_ABSOLUTE_FIRST",be.SplitterPositionType.ABSOLUTE_FIRST),ca(this,"SPLITTER_POSITION_TYPE_ABSOLUTE_SECOND",be.SplitterPositionType.ABSOLUTE_SECOND)},{RELATIVE_FIRST:"relativeFirst",RELATIVE_SECOND:"relativeSecond",ABSOLUTE_FIRST:"absoluteFirst",ABSOLUTE_SECOND:"absoluteSecond"});_init(e){super._init(e),this._setToggleCollapseKeyStroke(e.toggleCollapseKeyStroke),this._setFirstCollapseKeyStroke(e.firstCollapseKeyStroke),this._setSecondCollapseKeyStroke(e.secondCollapseKeyStroke),this._updateCollapseHandle(),this._initResponsive()}_initResponsive(){this.getFields().forEach(e=>{e instanceof ae&&e.responsive===null&&e.setResponsive(!0)})}_render(){this.addContainer(this.$parent,"split-box"),this._$splitArea=this.$parent.makeDiv("split-area"),this.addField(this._$splitArea),this.htmlSplitArea=x.install(this._$splitArea,this.session),this.htmlSplitArea.setLayout(new wc(this)),this._$window=this.$parent.window(),this._$body=this.$parent.body(),this.firstField&&(this.firstField.render(this._$splitArea),this.firstField.$container.addClass("first-field").addClass(this.splitHorizontal?"x-axis":"y-axis"),this.firstField.on("propertyChange",t.bind(this)),this.secondField&&(this.secondField.render(this._$splitArea),this.secondField.$container.addClass("second-field").addClass(this.splitHorizontal?"x-axis":"y-axis"),this.secondField.on("propertyChange",t.bind(this)),this._$splitter=this._$splitArea.appendDiv("splitter").addClass(this.splitHorizontal?"x-axis":"y-axis").on("mousedown",e.bind(this)))),this._updateFieldVisibilityClasses();function e(i){if(i.which!==1)return;let s,r,o,l,a,d;this.splitterEnabled&&(s={x:i.pageX,y:i.pageY},this._$window.on("mousemove.splitbox",g.bind(this)).on("mouseup.splitbox",y.bind(this)),this._$body.addClass(this.splitHorizontal?"col-resize":"row-resize"),h()("iframe").addClass("dragging-in-progress"),r=this._$splitArea.offset(),o=C.size(this._$splitArea,!0),a=this._$splitter.offset(),l=C.size(this._$splitter,!0),d=this._$splitArea.appendDiv("temp-splitter").addClass(this.splitHorizontal?"x-axis":"y-axis"),this.splitHorizontal?d.cssLeft(a.left-r.left):d.cssTop(a.top-r.top),this._$splitter.addClass("dragging"));let c=this.splitterPosition,f=10;function g(v){if(!(v.pageX===s.x&&v.pageY===s.y))if(s={x:v.pageX,y:v.pageY},this.splitHorizontal){let D=v.pageX-r.left,k,V,Q=Math.floor((l.width+we.get().fieldMandatoryIndicatorWidth)/2);this.splitterPositionType===be.SplitterPositionType.ABSOLUTE_FIRST?(k=u.nvl(this.minSplitterPosition,0),V=o.width-l.width+Q):this.splitterPositionType===be.SplitterPositionType.RELATIVE_FIRST?(k=(o.width-l.width)*u.nvl(this.minSplitterPosition,0),V=o.width-l.width+Q):this.splitterPositionType===be.SplitterPositionType.ABSOLUTE_SECOND?(k=0,V=o.width-l.width+Q-u.nvl(this.minSplitterPosition,0)):this.splitterPositionType===be.SplitterPositionType.RELATIVE_SECOND&&(k=0,V=o.width-l.width+Q-Math.floor(u.nvl(this.minSplitterPosition,0)*(o.width-l.width)));let ve=Q;D<k+Q+f?(D=k,ve=0):D>V-f&&(D=V),d.cssLeft(D-ve),c=D-ve,this.splitterPositionType===be.SplitterPositionType.RELATIVE_FIRST?c=c/(o.width-l.width):this.splitterPositionType===be.SplitterPositionType.RELATIVE_SECOND?c=1-c/(o.width-l.width):this.splitterPositionType===be.SplitterPositionType.ABSOLUTE_SECOND&&(c=o.width-l.width-c)}else{let D=v.pageY-r.top,k=Math.floor(l.height/2);D<f?(D=0,k=0):o.height-D<f&&(D=o.height,k=l.height),d.cssTop(D-k),c=D-k,this.splitterPositionType===be.SplitterPositionType.RELATIVE_FIRST?c=c/(o.height-l.height):this.splitterPositionType===be.SplitterPositionType.RELATIVE_SECOND?c=1-c/(o.height-l.height):this.splitterPositionType===be.SplitterPositionType.ABSOLUTE_SECOND&&(c=o.height-c-l.height)}}function y(v){v.which===1&&(this._$window.off("mousemove.splitbox").off("mouseup.splitbox"),d&&(this._$body.removeClass(this.splitHorizontal?"col-resize":"row-resize"),h()("iframe").removeClass("dragging-in-progress"),d.remove(),this._$splitter.removeClass("dragging"),this.newSplitterPosition(c,!0)))}return!1}function t(i){i.propertyName==="visible"&&(this._updateFieldVisibilityClasses(),this.htmlSplitArea.invalidateLayoutTree(!1))}}_renderProperties(){super._renderProperties(),this._renderSplitterPosition(),this._renderSplitterEnabled(),this._renderCollapsibleField(),this._renderCollapseHandle(),this._renderFieldMinimized()}_remove(){this._$splitArea=null,this._$splitter=null,super._remove()}_setSplitterPosition(e){this._setProperty("splitterPosition",e),this._oldSplitterPositionType=null}_renderSplitterPosition(){this.newSplitterPosition(this.splitterPosition,!1)}_setSplitterPositionType(e){this.rendered&&!this._oldSplitterPositionType&&(this._oldSplitterPositionType=this.splitterPositionType),this._setProperty("splitterPositionType",e)}_renderSplitterPositionType(){if(this._oldSplitterPositionType){let e=this.htmlSplitArea.size(),t=this.splitterPosition,i=C.size(this._$splitter,!0),s=this.minSplitterPosition,r=0;this.splitHorizontal?r=e.width-i.width:r=e.height-i.height;let o=this._isSplitterPositionTypeRelative(this._oldSplitterPositionType),l=this._isSplitterPositionTypeRelative(this.splitterPositionType),a=!o,d=!l;o&&d?(this._oldSplitterPositionType===be.SplitterPositionType.RELATIVE_FIRST&&this.splitterPositionType===be.SplitterPositionType.ABSOLUTE_SECOND||this._oldSplitterPositionType===be.SplitterPositionType.RELATIVE_SECOND&&this.splitterPositionType===be.SplitterPositionType.ABSOLUTE_FIRST?t=r-r*t:t=r*t,s&&(s=r*s)):a&&l?(this._oldSplitterPositionType===be.SplitterPositionType.ABSOLUTE_FIRST&&this.splitterPositionType===be.SplitterPositionType.RELATIVE_SECOND||this._oldSplitterPositionType===be.SplitterPositionType.ABSOLUTE_SECOND&&this.splitterPositionType===be.SplitterPositionType.RELATIVE_FIRST?t=(r-t)/r:t=t/r,s&&(s=s/r)):a&&d?t=r-t:t=1-t,this.setMinSplitterPosition(s),this._oldSplitterPositionType=null,this.newSplitterPosition(t,!0)}}_isSplitterPositionTypeRelative(e){return e===be.SplitterPositionType.RELATIVE_FIRST||e===be.SplitterPositionType.RELATIVE_SECOND}_renderSplitterEnabled(){this._$splitter&&this._$splitter.setEnabled(this.splitterEnabled)}setFieldCollapsed(e){this.setProperty("fieldCollapsed",e),this._updateCollapseHandleButtons()}_renderFieldCollapsed(){this._renderCollapsibleField()}setCollapsibleField(e){this.setProperty("collapsibleField",e),this._updateCollapseHandle()}_updateCollapseHandle(){if(this.toggleCollapseKeyStroke&&this.unregisterKeyStrokes(this.toggleCollapseKeyStroke),this.firstCollapseKeyStroke&&this.unregisterKeyStrokes(this.firstCollapseKeyStroke),this.secondCollapseKeyStroke&&this.unregisterKeyStrokes(this.secondCollapseKeyStroke),this.collapsibleField){let e=Yi.HorizontalAlignment.LEFT;this.collapsibleField!==this.firstField&&(e=Yi.HorizontalAlignment.RIGHT),this.collapseHandle?this.collapseHandle.setHorizontalAlignment(e):(this.collapseHandle=u.create(Yi,{parent:this,horizontalAlignment:e}),this.collapseHandle.on("action",this.collapseHandleButtonPressed.bind(this)),this.toggleCollapseKeyStroke&&this.registerKeyStrokes(this.toggleCollapseKeyStroke),this.firstCollapseKeyStroke&&this.registerKeyStrokes(this.firstCollapseKeyStroke),this.secondCollapseKeyStroke&&this.registerKeyStrokes(this.secondCollapseKeyStroke),this.rendered&&this._renderCollapseHandle()),this._updateCollapseHandleButtons()}else this.collapseHandle&&(this.collapseHandle.destroy(),this.collapseHandle=null)}_updateCollapseHandleButtons(){if(!this.collapseHandle)return;let e,t,i=this.fieldCollapsed,s=this.fieldMinimized,r=this._isMinimizable(),o=this.splitterPositionType===be.SplitterPositionType.RELATIVE_FIRST||this.splitterPositionType===be.SplitterPositionType.ABSOLUTE_FIRST,l=o&&this.collapsibleField===this.secondField||!o&&this.collapsibleField===this.firstField;o?l?(e=!s&&r||i,t=!i):(e=!i,t=i||s&&r):l?(e=!i,t=!s&&r||i):(e=i||s&&r,t=!i),this.collapseHandle.setLeftVisible(e),this.collapseHandle.setRightVisible(t),this.firstCollapseKeyStroke&&(e?this.registerKeyStrokes(this.firstCollapseKeyStroke):this.unregisterKeyStrokes(this.firstCollapseKeyStroke)),this.secondCollapseKeyStroke&&(t?this.registerKeyStrokes(this.secondCollapseKeyStroke):this.unregisterKeyStrokes(this.secondCollapseKeyStroke))}getEffectiveSplitterPosition(){return this._isMinimizable()&&this.fieldMinimized?this.minSplitterPosition:this.splitterPosition}setMinSplitterPosition(e){this.setProperty("minSplitterPosition",e),this._updateCollapseHandleButtons()}_renderMinSplitterPosition(){this.rendered&&this.htmlSplitArea.invalidateLayoutTree(!1)}setFieldMinimized(e){this.setProperty("fieldMinimized",e),this._updateCollapseHandleButtons()}_renderFieldMinimized(){this.$container.removeClass("first-field-minimized second-field-minimized"),this.firstField&&this.firstField.$container.removeClass("minimized"),this.secondField&&this.secondField.$container.removeClass("minimized"),this.collapsibleField&&this.fieldMinimized&&(this.collapsibleField.$container.addClass("minimized"),this.$container.toggleClass("first-field-minimized",this.firstField===this.collapsibleField),this.$container.toggleClass("second-field-minimized",this.secondField===this.collapsibleField)),this.rendered&&this.htmlSplitArea.invalidateLayoutTree(!1)}setMinimizeEnabled(e){this.setProperty("minimizeEnabled",e),this._isMinimizable()&&this._isSplitterPositionInMinimalRange(this.splitterPosition)&&this.setFieldMinimized(!0),this._updateCollapseHandleButtons()}_renderMinimizeEnabled(){this.rendered&&this.htmlSplitArea.invalidateLayoutTree(!1)}_isMinimizable(){return!!this.minSplitterPosition&&this.minimizeEnabled}_renderCollapsibleField(){this.$container.removeClass("first-field-collapsed second-field-collapsed"),this.firstField&&this.firstField.$container.removeClass("collapsed"),this.secondField&&this.secondField.$container.removeClass("collapsed"),this.collapsibleField&&this.fieldCollapsed&&(this.collapsibleField.$container.addClass("collapsed"),this.$container.toggleClass("first-field-collapsed",this.firstField===this.collapsibleField),this.$container.toggleClass("second-field-collapsed",this.secondField===this.collapsibleField)),this.rendered&&this.htmlSplitArea.invalidateLayoutTree(!1)}_setToggleCollapseKeyStroke(e){e&&(this.toggleCollapseKeyStroke instanceof B&&this.unregisterKeyStrokes(this.toggleCollapseKeyStroke),this.toggleCollapseKeyStroke=new _c(this,e),this.collapseHandle&&this.registerKeyStrokes(this.toggleCollapseKeyStroke))}_setFirstCollapseKeyStroke(e){e&&(this.firstCollapseKeyStroke instanceof B&&this.unregisterKeyStrokes(this.firstCollapseKeyStroke),this.firstCollapseKeyStroke=new bc(this,e),this.collapseHandle&&this.registerKeyStrokes(this.firstCollapseKeyStroke))}_setSecondCollapseKeyStroke(e){e&&(this.secondCollapseKeyStroke instanceof B&&this.unregisterKeyStrokes(this.secondCollapseKeyStroke),this.secondCollapseKeyStroke=new yc(this,e),this.collapseHandle&&this.registerKeyStrokes(this.secondCollapseKeyStroke))}_renderCollapseHandle(){this.collapseHandle&&this.collapseHandle.render()}newSplitterPosition(e,t){if(this._isSplitterPositionTypeRelative(this.splitterPositionType)?e=Math.max(0,Math.min(1,e)):e=Math.max(0,e),this._isMinimizable()&&this._isSplitterPositionInMinimalRange(e)){this.setFieldMinimized(!0);return}let i=this.splitterPosition!==e;this.splitterPosition=e,i&&(this.trigger("positionChange",{position:e}),t&&this._updateFieldMinimized()),this._updateCollapseHandleButtons(),this.htmlSplitArea.invalidateLayoutTree(!1)}_updateFieldMinimized(){this._isMinimizable()?this.setFieldMinimized(this._isSplitterPositionInMinimalRange(this.splitterPosition)):this.setFieldMinimized(!1)}_isSplitterPositionInMinimalRange(e){return this._isMinimizable()?e<=this.minSplitterPosition:!1}toggleFieldCollapsed(){this.setFieldCollapsed(!this.fieldCollapsed)}collapseHandleButtonPressed(e){let t=this.fieldCollapsed,i=this.fieldMinimized,s=this._isMinimizable(),r=this.splitterPositionType===be.SplitterPositionType.RELATIVE_FIRST||this.splitterPositionType===be.SplitterPositionType.ABSOLUTE_FIRST,o=!!e.left&&!r||!!e.right&&r;r&&this.collapsibleField===this.secondField||!r&&this.collapsibleField===this.firstField?o?t||(i&&s?this.setFieldMinimized(!1):this.setFieldCollapsed(!0)):t?this.setFieldCollapsed(!1):i||s&&this.setFieldMinimized(!0):o?t?this.setFieldCollapsed(!1):i&&this.setFieldMinimized(!1):t||(i||!s?this.setFieldCollapsed(!0):this.setFieldMinimized(!0))}getFields(){let e=[];return this.firstField&&e.push(this.firstField),this.secondField&&e.push(this.secondField),e}_updateFieldVisibilityClasses(){if(!this.rendered&&!this.rendering)return;let e=this.firstField&&this.firstField.visible,t=this.secondField&&this.secondField.visible,s=!(e&&t)&&(e||t);this.$container.toggleClass("single-field",s)}}nm(),Z.uuidPathSkipWidgets.add(be);class om extends Rn{constructor(){super(),this._addRemoteProperties(["collapsibleField","fieldCollapsed","minSplitterPosition","fieldMinimized"])}_onWidgetPositionChange(e){this._send("setSplitterPosition",{splitterPosition:e.position})}_onWidgetEvent(e){e.type==="positionChange"?this._onWidgetPositionChange(e):super._onWidgetEvent(e)}}class _c extends B{constructor(e,t){super(),this.field=e,this.parseAndSetKeyStroke(t),this.inheritAccessibility=!1}handle(e){this.field.toggleFieldCollapsed()}_postRenderKeyBox(e,t){let i=this.field.collapseHandle.$container;t.addClass("split-box-collapse-key-box");let s=i.offsetTo(this.field.$container);t.cssLeft(s.left-t.outerWidth()).cssTop(s.top)}}class bc extends B{constructor(e,t){super(),this.field=e,this.parseAndSetKeyStroke(t),this.inheritAccessibility=!1}handle(e){this.field.collapseHandleButtonPressed({left:!0})}_postRenderKeyBox(e,t){let i=this.field.collapseHandle.$container;t.addClass("split-box-collapse-key-box left");let s=i.offsetTo(this.field.$container);t.cssLeft(s.left-t.outerWidth()).cssTop(s.top)}}class yc extends B{constructor(e,t){super(),this.field=e,this.parseAndSetKeyStroke(t),this.inheritAccessibility=!1}handle(e){this.field.collapseHandleButtonPressed({right:!0})}_postRenderKeyBox(e,t){let i=this.field.collapseHandle.$container;t.addClass("split-box-collapse-key-box right");let s=i.offsetTo(this.field.$container);t.cssLeft(s.left+i.width()-t.outerWidth()).cssTop(s.top-t.outerHeight())}}class wc extends ne{splitBox;constructor(e){super(),this.splitBox=e}layout(e){let t=x.get(e),i=e.children(".splitter"),s=e.children(".form-field"),r=x.optGet(s.eq(0)),o=x.optGet(s.eq(1)),l=this.splitBox.splitHorizontal;i.removeClass("hidden");let a,d=t.availableSize().subtract(t.insets()),c=r&&r.isVisible(),f=o&&o.isVisible(),g=c&&f,y=!g&&(c||f),v=this.splitBox.getEffectiveSplitterPosition(),D=new F(d);if(g&&(l?D.width-=r.margins().right:D.height-=r.margins().bottom),g){let V=new F(D),Q=new F(D);this.computeInnerFieldsDimensions(l,V,Q,v),a=new te(0,0,V.width,V.height);let ve=new te(0,0,Q.width,Q.height);l?(i.cssLeft(a.width),ve.x=a.width+r.margins().right):(i.cssTop(a.height),ve.y=a.height+r.margins().bottom),r.setBounds(a),o.setBounds(ve)}else{if(y){let V=c?r:o,Q=d.subtract(V.margins());V.setBounds(new te(0,0,Q.width,Q.height))}i.addClass("hidden")}let k=this.splitBox.collapseHandle;if(k){let V=k.$container,Q=this.splitBox.firstField&&this.splitBox.firstField.visible&&this.splitBox.secondField&&this.splitBox.secondField.visible;V.setVisible(Q);let ve=null;if(g&&this.splitBox.collapsibleField===this.splitBox.firstField){let Ze=C.size(V);ve=a.width-Ze.width}V.cssLeft(ve)}}preferredLayoutSize(e,t){let i=x.get(e),s=e.children(".form-field"),r=x.optGet(s.eq(0)),o=x.optGet(s.eq(1)),l=this.splitBox.splitHorizontal,a=this.splitBox.getEffectiveSplitterPosition(),d=h().extend({},t),c=h().extend({},t);if(t.widthHint){let v=new F(t.widthHint,0),D=new F(t.widthHint,0);this.computeInnerFieldsDimensions(l,v,D,a),d.widthHint=v.width,c.widthHint=D.width}let f=new F(0,0);r&&(f=r.prefSize(d).add(r.margins()));let g=new F(0,0);o&&(g=o.prefSize(c).add(o.margins()));let y;return l?y=new F(f.width+g.width,Math.max(f.height,g.height)):y=new F(Math.max(f.width,g.width),f.height+g.height),y=y.add(i.insets()),y}computeInnerFieldsDimensions(e,t,i,s){e?this.splitBox.splitterPositionType===be.SplitterPositionType.RELATIVE_FIRST?(t.width=Math.floor(t.width*s),i.width-=t.width):this.splitBox.splitterPositionType===be.SplitterPositionType.RELATIVE_SECOND?(i.width=Math.floor(i.width*s),t.width-=i.width):(s=Math.min(s,t.width),this.splitBox.splitterPositionType===be.SplitterPositionType.ABSOLUTE_SECOND?(t.width=t.width-s,i.width=s):(t.width=s,i.width=i.width-s)):this.splitBox.splitterPositionType===be.SplitterPositionType.RELATIVE_FIRST?(t.height=Math.floor(t.height*s),i.height-=t.height):this.splitBox.splitterPositionType===be.SplitterPositionType.RELATIVE_SECOND?(i.height=Math.floor(i.height*s),t.height-=i.height):(s=Math.min(s,t.height),this.splitBox.splitterPositionType===be.SplitterPositionType.ABSOLUTE_SECOND?(t.height=t.height-s,i.height=s):(t.height=s,i.height=i.height-s))}}class Ni extends Ro{format;hasAction;inputMasked;inputObfuscated;maxLength;maxLengthHandler;multilineText;selectionStart;selectionEnd;selectionTrackingEnabled;spellCheckEnabled;trimText;wrapText;mouseClicked;_selectionChangingActionHandler;constructor(){super(),this.format=null,this.hasAction=!1,this.inputMasked=!1,this.inputObfuscated=!1,this.maxLength=4e3,this.maxLengthHandler=u.create(De,{target:this}),this.multilineText=!1,this.selectionStart=-1,this.selectionEnd=-1,this.selectionTrackingEnabled=!1,this.spellCheckEnabled=!1,this.trimText=!0,this.wrapText=!1,this._selectionChangingActionHandler=this._onSelectionChangingAction.bind(this)}static Format={LOWER:"a",UPPER:"A"};static TRIM_REGEXP=new RegExp("^(\\s*)(.*?)(\\s*)$");_initValue(e){e=de.resolveText(e,this.session.locale.languageTag),super._initValue(e)}_readDisplayText(){return this.$field?this.$field.val():""}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new Tc(this),new vc(this)])}_createKeyStrokeContext(){return new qi}_init(e){super._init(e),this._setMultilineText(this.multilineText)}_render(){this.addContainer(this.$parent,"string-field",new Cc(this)),this.addLabel(),this.addMandatoryIndicator();let e;this.multilineText?(e=this._makeMultilineField(),this.$container.addClass("multiline")):e=oe.makeTextField(this.$parent),e.on("select",this._selectionChangingActionHandler).on("mousedown",this._selectionChangingActionHandler).on("keydown",this._selectionChangingActionHandler).on("input",this._selectionChangingActionHandler),this.addField(e),this.maxLengthHandler.install(e),this.addStatus()}_makeMultilineField(){let e=this.$parent.makeElement("<textarea>").on("wheel",this._onMouseWheel.bind(this)).addDeviceClass();return this._addRestoreSelectionFocusHandler(e),e}_addRestoreSelectionFocusHandler(e){e.on("focus",t=>{this.$field.hasClass("keyboard-navigation")&&setTimeout(()=>{!this.rendered||this.session.focusManager.isElementCovertByGlassPane(this.$field)||(this._renderSelectionStart(),this._renderSelectionEnd())})})}_onFieldBlur(e){super._onFieldBlur(e),this.inputObfuscated&&this.$field.val(this.displayText)}_onMouseWheel(e){let t=e.originalEvent,i=t.deltaY,s=this.$field[0].scrollTop;if(i<0&&s===0)return;let r=this.$field[0].scrollHeight-this.$field[0].clientHeight;if(i>0&&s>=r-1){this.$field[0].scrollTop=r;return}t.stopPropagation()}_renderProperties(){super._renderProperties(),this._renderInputMasked(),this._renderWrapText(),this._renderFormat(),this._renderSpellCheckEnabled(),this._renderHasAction(),this._renderMaxLength(),this._renderSelectionStart(),this._renderSelectionEnd(),this._renderDropType()}addIcon(e){this.$icon=oe.appendIcon(this.$container).on("click",this._onIconClick.bind(this)),T.role(this.$icon,"button"),T.label(this.$icon,"",!0)}isClearable(){return super.isClearable()&&!this.multilineText}selectAll(){this.setSelectionStart(0),this.setSelectionEnd(this.displayText.length)}setCursorAtEnd(){this.setSelectionStart(this.displayText.length),this.setSelectionEnd(this.displayText.length)}setSelectionStart(e){this.setProperty("selectionStart",e)}_renderSelectionStart(){this.selectionStart>=0&&(this.$field[0].selectionStart=this.selectionStart)}setSelectionEnd(e){this.setProperty("selectionEnd",e)}_renderSelectionEnd(){this.selectionEnd>=0&&(this.$field[0].selectionEnd=this.selectionEnd)}setSelectionTrackingEnabled(e){this.setProperty("selectionTrackingEnabled",e)}setInputMasked(e){this.setProperty("inputMasked",e)}_renderInputMasked(){this.multilineText||this.$field.attr("type",this.inputMasked?"password":"text")}_renderInputObfuscated(){this.inputObfuscated&&this.focused&&this.$field.val("")}setHasAction(e){this.setProperty("hasAction",e)}_renderHasAction(){this.hasAction?(this.$icon||(this.addIcon(),this.$icon.addClass("action")),this.$container.addClass("has-icon")):(this._removeIcon(),this.$container.removeClass("has-icon")),this.revalidateLayout()}_renderEnabled(){super._renderEnabled(),this.revalidateLayout()}setFormatUpper(e){e?this.setFormat(Ni.Format.UPPER):this.setFormat(null)}setFormatLower(e){e?this.setFormat(Ni.Format.LOWER):this.setFormat(null)}setFormat(e){this.setProperty("format",e)}_renderFormat(){this.format===Ni.Format.LOWER?this.$field.css("text-transform","lowercase"):this.format===Ni.Format.UPPER?this.$field.css("text-transform","uppercase"):this.$field.css("text-transform","")}setSpellCheckEnabled(e){this.setProperty("spellCheckEnabled",e)}_renderSpellCheckEnabled(){this.spellCheckEnabled?this.$field.attr("spellcheck","true"):this.$field.attr("spellcheck","false")}_renderDisplayText(){if(this.inputObfuscated&&this.focused){this.$field.val("");return}let e=_.nvl(this.displayText),t=_.nvl(this.$field.val()),i=this._getSelection();if(super._renderDisplayText(),this.trimText&&t!==e){let s=t.match(Ni.TRIM_REGEXP);s&&s[2]===e&&this._setSelection({start:Math.max(i.start-s[1].length,0),end:Math.min(i.end-s[1].length,e.length)})}}insertText(e){if(!this.rendered){this._postRenderActions.push(this.insertText.bind(this,e));return}this._insertText(e)}_insertText(e){if(!e)return;this.inputObfuscated&&this.selectAll();let t=this._getSelection();if(this._applyTextToSelection(this.$field.val(),e,t).length>this.maxLength){this._showNotification("ui.CannotInsertTextTooLong");return}let s=this.$field.activeElement(!0);oe.focusAndInsertText(this.$field,e),s.focus(),this._setSelection(t.start+e.length),this.updateDisplayTextOnModify&&this.acceptInput(!0),this.acceptInput()}_applyTextToSelection(e,t,i){return e.slice(0,i.start)+t+e.slice(i.end)}setWrapText(e){this.setProperty("wrapText",e)}_renderWrapText(){this.$field.attr("wrap",this.wrapText?"soft":"off")}setTrimText(e){this.setProperty("trimText",e)}_renderTrimText(){}setMultilineText(e){this.setProperty("multilineText",e)}_setMultilineText(e){this._setProperty("multilineText",e),this.keyStrokeContext.setMultiline(this.multilineText)}_renderGridData(){super._renderGridData(),this.updateInnerAlignment({useHorizontalAlignment:!this.multilineText})}_renderGridDataHints(){super._renderGridDataHints(),this.updateInnerAlignment({useHorizontalAlignment:!0})}setMaxLength(e){this.setProperty("maxLength",e)}_renderMaxLength(){this.maxLengthHandler.render()}_onIconClick(){this.acceptInput(),this.$field.focus(),this.trigger("action")}_onSelectionChangingAction(e){e.type==="mousedown"?this.$field.window().one("mouseup.stringfield",()=>{setTimeout(this._updateSelection.bind(this))}):e.type==="keydown"?setTimeout(this._updateSelection.bind(this)):this._updateSelection()}_getSelection(){let e=this.$field[0],t=u.nvl(e.selectionStart,null),i=u.nvl(e.selectionEnd,null);return(t===null||i===null)&&(t=0,i=0),{start:t,end:i}}_setSelection(e,t){typeof e=="number"?t=u.nvl(t,e):typeof e=="object"&&(t=e.end,e=e.start);let i=this.$field[0];i.selectionStart=e,i.selectionEnd=t,this._updateSelection()}_updateSelection(){if(!this.rendered)return;let e=this.selectionStart,t=this.selectionEnd,i=this.$field[0],s=this.selectionTrackingEnabled;!this.multilineText&&!this.selectionTrackingEnabled?(this.selectionStart=-1,this.selectionEnd=-1,s=!0):(this.selectionStart=i.selectionStart,this.selectionEnd=i.selectionEnd),s&&(this.selectionStart!==e||this.selectionEnd!==t)&&this.triggerSelectionChange()}triggerSelectionChange(){this.trigger("selectionChange",{selectionStart:this.selectionStart,selectionEnd:this.selectionEnd})}_validateValue(e){return b.isNullOrUndefined(e)?e:(e=_.asString(e),this.trimText&&(e=e.trim()),super._validateValue(e))}_clear(){super._clear(),this.inputObfuscated=!1}_computeEmpty(){return _.empty(this.value)}acceptInput(e){let t=u.nvl(this._readDisplayText(),"");this.inputObfuscated&&t!==""&&(this.inputObfuscated=!1),super.acceptInput(e)}_onFieldFocus(e){super._onFieldFocus(e),this.inputObfuscated&&(this.$field.val(""),setTimeout(()=>{if(!this.rendered)return;let t=this.$field[0];t.selectionStart=0,t.selectionEnd=0}))}_showNotification(e){u.create(_i,{parent:this,severity:E.Severity.WARNING,message:this.session.text(e)}).show()}_checkDisplayTextChanged(e,t){let i=super._checkDisplayTextChanged(e,t);return i&&this.inputObfuscated&&e===""?!1:i}}class Cc extends Kt{constructor(e){super(e)}_layoutClearIcon(e,t,i,s){e.$icon&&e.$icon.isVisible()&&(i+=C.prefSize(e.$icon,!0).width),super._layoutClearIcon(e,t,i,s)}}class lm extends Zl{_initProperties(e){super._initProperties(e),e.insertText!==void 0&&delete e.insertText}_syncInsertText(e){this.widget.insertText(e)}_onWidgetSelectionChange(e){this._send("selectionChange",{selectionStart:e.selectionStart,selectionEnd:e.selectionEnd},{showBusyIndicator:!1,delay:500,coalesce:function(t){return this.target===t.target&&this.type===t.type}})}_onWidgetAction(e){this._send("action")}_onWidgetEvent(e){e.type==="selectionChange"?this._onWidgetSelectionChange(e):e.type==="action"?this._onWidgetAction(e):super._onWidgetEvent(e)}}class Tc extends B{constructor(e){super(),this.field=e,this.which=[m.ENTER],this.renderingHints.render=!1,this.preventDefault=!1}_applyPropagationFlags(e){super._applyPropagationFlags(e);let t=this.field.$container.activeElement(!0);this.preventInvokeAcceptInputOnActiveValueField=!e.isPropagationStopped()&&t.tagName.toLowerCase()==="textarea",this.preventInvokeAcceptInputOnActiveValueField&&e.stopPropagation()}handle(e){}}class vc extends B{constructor(e){super(),this.field=e,this.which=[m.ENTER],this.ctrl=!0}_accept(e){return super._accept(e)&&this.field.hasAction}handle(e){this.field._onIconClick()}}class In extends ar{selectedTab;header;tabItems;tabAreaStyle;_$tabContent;_statusPositionOrig;_tabBoxHeaderPropertyChangeHandler;constructor(){super(),this.gridDataHints.useUiHeight=!0,this.gridDataHints.w=A.FULL_WIDTH,this.header=null,this.selectedTab=null,this.tabItems=[],this.tabAreaStyle=es.DisplayStyle.DEFAULT,this._$tabContent=null,this._statusPositionOrig=null,this._addWidgetProperties(["tabItems","selectedTab"]),this._addPreserveOnPropertyChangeProperties(["selectedTab"]),this._tabBoxHeaderPropertyChangeHandler=this._onTabBoxHeaderPropertyChange.bind(this)}static MenuType={Header:"TabBox.Header"};_init(e){super._init(e),this.header=u.create(pa,{parent:this,tabBox:this}),this._initProperties(e),this.header.on("propertyChange",this._tabBoxHeaderPropertyChangeHandler)}_initProperties(e){this._setTabItems(this.tabItems),this._setSelectedTab(this.selectedTab),this._setTabAreaStyle(this.tabAreaStyle)}_destroy(){super._destroy(),this.header.off("propertyChange",this._tabBoxHeaderPropertyChangeHandler)}_render(){this.addContainer(this.$parent,"tab-box",new Fc(this)),T.role(this.$container,"tablist"),this.header.render(this.$container),this.addStatus(),this._$tabContent=this.$container.appendDiv("tab-content"),T.role(this._$tabContent,"tabpanel"),x.install(this._$tabContent,this.session).setLayout(new ji)}_renderProperties(){super._renderProperties(),this._renderSelectedTab()}_remove(){super._remove(),this._removeSelectedTab()}getContextMenuItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return[]}_removeMenus(){}deleteTabItem(e){let t=this.tabItems.indexOf(e),i=this.tabItems.slice();t>=0&&(i.splice(t,1),this.setTabItems(i))}insertTabItem(e,t){if(!e)return;t=u.nvl(t,this.tabItems.length);let i=this.tabItems.slice();i.splice(t,0,e),this.setTabItems(i)}setTabItems(e){this.setProperty("tabItems",e)}_setTabItems(e){e=e||[],(this.tabItems||[]).filter(i=>e.indexOf(i)<0).forEach(i=>{i.remove()}),this._setProperty("tabItems",e),this.header.setTabItems(this.tabItems),this.tabItems.indexOf(this.selectedTab)<0&&this.setSelectedTab(this.tabItems[0])}_renderTabItems(e){}_removeTabItems(e){}_removeTabContent(){this.tabItems.forEach(e=>{e.remove()})}setSelectedTab(e){this.setProperty("selectedTab",e)}_setSelectedTab(e){h().log.isDebugEnabled()&&h().log.debug("(TabBox#_selectTab) tab="+e),this.selectedTab&&this.selectedTab.rendered&&this.selectedTab.remove(),this._setProperty("selectedTab",e),this.header.setSelectedTabItem(this.selectedTab)}_renderSelectedTab(){this.selectedTab&&(this.selectedTab.render(this._$tabContent),this.selectedTab.get$Scrollable().data("scroll-shadow-customizer",this._updateScrollShadow.bind(this))),this.rendered&&(this._updateScrollShadow(),x.get(this._$tabContent).invalidateLayoutTree())}_removeSelectedTab(){this.selectedTab&&(this.selectedTab.get$Scrollable().removeData("scroll-shadow-customizer"),this.selectedTab.remove())}_updateScrollShadow(){if(!this.rendered)return;let e=this.selectedTab&&this.selectedTab.hasScrollShadow("top"),t=this.$container.hasClass("has-scroll-shadow-top");this.$container.toggleClass("has-scroll-shadow-top",e),t!==e&&this.invalidateLayoutTree(!1),oe.adjustStatusPositionForScrollShadow(this,()=>e&&this.labelVisible)}setTabAreaStyle(e){this.setProperty("tabAreaStyle",e)}_setTabAreaStyle(e){this.tabAreaStyle=e,this.header&&this.header.tabArea&&this.header.tabArea.setDisplayStyle(e)}_renderStatusPosition(){super._renderStatusPosition(),this.fieldStatus&&(this.statusPosition===A.StatusPosition.TOP?this.$status.appendTo(this.header.$container):this.$status.appendTo(this.$container),this.invalidateLayoutTree())}_updateFieldStatus(){super._updateFieldStatus(),this.selectedTab&&this.selectedTab.notification&&this.selectedTab.invalidateLayoutTree()}_renderLabelVisible(){super._renderLabelVisible(),this._updateScrollShadow()}getFields(){return this.tabItems}getTabItem(e){return p.find(this.tabItems,t=>t.id===e)}focus(){if(!this.rendered)return this.session.layoutValidator.schedulePostValidateFunction(this.focus.bind(this)),!1;if(this.selectedTab)return this.selectedTab.focus()}getFocusableElement(){return this.selectedTab?this.selectedTab.getFocusableElement():null}isTabItemFocused(e){return this.header.isTabItemFocused(e)}focusTabItem(e){return this.header.focusTabItem(e)}getTabForItem(e){return this.header.getTabForItem(e)}_onTabBoxHeaderPropertyChange(e){e.propertyName==="selectedTabItem"&&this.setSelectedTab(e.newValue)}}Z.uuidPathSkipWidgets.add(In);class Sc extends B{constructor(e){super(),this.field=e,this.which=[m.LEFT],this.renderingHints.render=!1,this.stopPropagation=!0,this.keyStrokeMode=B.Mode.DOWN,this.inheritAccessibility=!1}handle(e){this.field.selectPreviousTab(!0),this.field.selectedTab.$container.addClass("keyboard-navigation")}}class xc extends B{constructor(e){super(),this.field=e,this.which=[m.RIGHT],this.renderingHints.render=!1,this.stopPropagation=!0,this.keyStrokeMode=B.Mode.DOWN,this.inheritAccessibility=!1}handle(e){this.field.selectNextTab(!0),this.field.selectedTab.$container.addClass("keyboard-navigation")}}class am extends Rn{constructor(){super(),this._addRemoteProperties(["selectedTab"]),this._addOrderedProperties(["tabItems","selectedTab"])}exportAdapterData(e){return e=super.exportAdapterData(e),delete e.selectedTab,e}}class Pc extends ne{tabBoxHeader;htmlPropertyChangeHandler;fieldStatusWidth;constructor(e){super(),this.tabBoxHeader=e,this.fieldStatusWidth=null,this._initDefaults(),this.htmlPropertyChangeHandler=this._onHtmlEnvironmentPropertyChange.bind(this),we.get().on("propertyChange",this.htmlPropertyChangeHandler),this.tabBoxHeader.one("remove",()=>{we.get().off("propertyChange",this.htmlPropertyChangeHandler)})}_initDefaults(){this.fieldStatusWidth=we.get().fieldStatusWidth}_onHtmlEnvironmentPropertyChange(){this._initDefaults(),this.tabBoxHeader.invalidateLayoutTree()}layout(e){let t=x.get(e),i=this.tabBoxHeader.tabArea,s=i.htmlComp.margins(),r,o=this.tabBoxHeader.menuBar,l=o.htmlComp.margins(),a,d=this.tabBoxHeader.tabBox.$status,c=new F,f=t.insets(),g=t.availableSize({exact:!0}).subtract(t.insets());a=o.htmlComp.prefSize({widthHint:0}),this.tabBoxHeader.tabBox.statusPosition===A.StatusPosition.TOP&&d&&d.isVisible()&&(c.height=d.outerHeight(!0),c.width=this.fieldStatusWidth+C.margins(d).horizontal()),r=i.htmlComp.prefSize({widthHint:g.width-a.width-l.horizontal()-c.width,exact:!1}),i.htmlComp.setSize(new F(r.width,g.height-s.vertical())),o.htmlComp.layout.collapsed=i.htmlComp.layout.overflowTabs.length>0,o.htmlComp.setBounds(new te(f.left+r.width+s.horizontal(),f.top,g.width-r.width-s.horizontal()-l.horizontal()-c.width,g.height-l.vertical())),this.tabBoxHeader.tabBox.statusPosition===A.StatusPosition.TOP&&d&&d.isVisible()&&d.cssWidth(this.fieldStatusWidth).cssRight(f.right).cssHeight(g.height-C.margins(d).vertical())}preferredLayoutSize(e,t){let i=x.get(e),s=i.insets(),r=(t.widthHint||i.availableSize().width)-i.insets().horizontal(),o=new F,l=this.tabBoxHeader.tabBox.$status,a=new F,d=this.tabBoxHeader.tabArea,c=d.htmlComp.margins(),f=this.tabBoxHeader.menuBar,g=f.htmlComp.margins(),y=f.htmlComp.prefSize({widthHint:0});this.tabBoxHeader.tabBox.statusPosition===A.StatusPosition.TOP&&l&&l.isVisible()&&(a.height=l.outerHeight(!0),a.width=this.fieldStatusWidth+C.margins(l).horizontal(),o.width+=a.width,o.height=Math.max(o.height,a.height));let v=d.htmlComp.prefSize({widthHint:r-y.width-g.horizontal()-c.horizontal()-a.width});o.width+=v.width+c.horizontal(),o.height=Math.max(o.height,v.height+c.vertical());let D=f.htmlComp.prefSize({widthHint:r-v.width-c.horizontal()-g.horizontal()-a.width});return o.width+=D.width+g.horizontal(),o.height=Math.max(o.height,D.height+g.vertical()),o.add(s)}}class pa extends I{tabBox;tabArea;menuBar;$borderBottom;_tabBoxPropertyChangeHandler;_tabAreaPropertyChangeHandler;constructor(){super(),this.tabBox=null,this.tabArea=null,this.menuBar=null,this.$borderBottom=null,this._tabBoxPropertyChangeHandler=this._onTabBoxPropertyChange.bind(this),this._tabAreaPropertyChangeHandler=this._onTabAreaPropertyChange.bind(this)}_init(e){super._init(e),this.tabArea=u.create(es,{parent:this,tabBox:this.tabBox}),this.tabArea.on("propertyChange",this._tabAreaPropertyChangeHandler),this.menuBar=u.create(Ce,{parent:this,menuOrder:new Is}),this.tabBox.on("propertyChange",this._tabBoxPropertyChangeHandler),this.menuBar.setMenuItems(this.tabBox.menus),this.setVisible(this.tabBox.labelVisible)}_render(){this.$container=this.$parent.appendDiv("tab-box-header"),this.$borderBottom=this.$container.appendDiv("bottom-border"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Pc(this)),this.tabArea.render(this.$container),this.menuBar.render(this.$container),this.$container.append(this.menuBar.$container)}_destroy(){this.tabBox.off("propertyChange",this._tabBoxPropertyChangeHandler),this.tabArea.off("propertyChange",this._tabAreaPropertyChangeHandler),super._destroy()}setTabItems(e){this.tabArea.setTabItems(e)}_setSelectedTab(e){e?this.setSelectedTabItem(e.tabItem):this.setSelectedTabItem(null)}setSelectedTabItem(e){this.setProperty("selectedTabItem",e)}_setSelectedTabItem(e){this._setProperty("selectedTabItem",e),this.tabArea.setSelectedTabItem(e)}isTabItemFocused(e){return this.tabArea.isTabItemFocused(e)}focusTabItem(e){return this.tabArea.focusTabItem(e)}getTabForItem(e){return this.tabArea.getTabForItem(e)}_onTabBoxPropertyChange(e){e.propertyName==="menus"?this.menuBar.setMenuItems(this.tabBox.menus):e.propertyName==="labelVisible"&&this.setVisible(this.tabBox.labelVisible)}_onTabAreaPropertyChange(e){e.propertyName==="selectedTab"&&this._setSelectedTab(e.newValue)}}Z.uuidPathSkipWidgets.add(pa);class fa extends I{label;subLabel;selected;overflown;marked;errorStatus;tooltipText;fieldStatus;tabItem;tabbable;$title;$label;$subLabel;_preventTabSelection;_tabPropertyChangeHandler;_statusMouseDownHandler;_desktopPropertyChangeHandler;constructor(){super(),this.label=null,this.subLabel=null,this.selected=!1,this.overflown=!1,this.marked=!1,this.errorStatus=null,this.tooltipText=null,this.fieldStatus=null,this.tabItem=null,this.tabbable=!1,this.$label=null,this.$subLabel=null,this.$title=null,this._preventTabSelection=!1,this._tabPropertyChangeHandler=this._onTabPropertyChange.bind(this),this._statusMouseDownHandler=this._onStatusMouseDown.bind(this),this._desktopPropertyChangeHandler=this._onDesktopPropertyChange.bind(this)}_init(e){super._init(e),this.setVisible(this.tabItem.visible),this.setLabel(this.tabItem.label),this.setSubLabel(this.tabItem.subLabel),this.setCssClass(this.tabItem.cssClass),this.setMarked(this.tabItem.marked),this.setErrorStatus(this.tabItem.errorStatus),this.setTooltipText(this.tabItem.tooltipText),Z.get().setDependentUuid("tab",this.tabItem,this),this.fieldStatus=u.create(Jl,{parent:this,visible:!1}),this.fieldStatus.on("statusMouseDown",this._statusMouseDownHandler),this.tabItem.on("propertyChange",this._tabPropertyChangeHandler)}_destroy(){super._destroy(),this.tabItem.off("propertyChange",this._tabPropertyChangeHandler),this.fieldStatus.off("statusMouseDown",this._statusMouseDownHandler)}_render(){this.$container=this.$parent.appendDiv("tab-item"),T.role(this.$container,"tab"),this.htmlComp=x.install(this.$container,this.session),this.$title=this.$container.appendDiv("title"),this.$label=this.$title.appendDiv("label"),Y.installForEllipsis(this.$label,{parent:this}),this.$subLabel=this.$title.appendDiv("sub-label"),Y.installForEllipsis(this.$subLabel,{parent:this}),T.linkElementWithLabel(this.$container,this.$subLabel),T.linkElementWithLabel(this.$container,this.$label),this.fieldStatus.render(),this.fieldStatus.$container.cssWidth(we.get().fieldStatusWidth),this.$container.on("mousedown",this._onTabMouseDown.bind(this)),this.session.desktop.on("propertyChange",this._desktopPropertyChangeHandler)}_remove(){this.session.desktop.off("propertyChange",this._desktopPropertyChangeHandler),super._remove()}_renderProperties(){super._renderProperties(),this._renderVisible(),this._renderLabel(),this._renderSubLabel(),this._renderTabbable(),this._renderSelected(),this._renderMarked(),this._renderOverflown(),this._renderTooltipText(),this._renderErrorStatus()}_renderVisible(){super._renderVisible(),this._updateStatus()}setLabel(e){this.setProperty("label",e)}_renderLabel(){this.$label.textOrNbsp(this.label),this.$label.attr("data-text",this.label),this.invalidateLayoutTree()}setSubLabel(e){this.setProperty("subLabel",e)}_renderSubLabel(){this.$subLabel.textOrNbsp(this.subLabel),this.invalidateLayoutTree()}setTooltipText(e){this.setProperty("tooltipText",e)}_renderTooltipText(){this.$container.toggleClass("has-tooltip",_.hasText(this.tooltipText)),this._updateStatus()}setErrorStatus(e){this.setProperty("errorStatus",e)}_renderErrorStatus(){let e=!!this.errorStatus,t=e?"has-"+this.errorStatus.cssClass():"";this._updateErrorStatusClasses(t),this._updateStatus()}_updateErrorStatusClasses(e){this.$container.removeClass(A.SEVERITY_CSS_CLASSES),e&&this.$container.addClass(e)}_updateStatus(){let e=this._computeVisible(),t=null,i=!0,s=!1;this.fieldStatus.setVisible(e),e&&(this.errorStatus?(t=this.errorStatus,i=!t.isError(),s=!0):t=u.create(E,{message:this.tooltipText,severity:E.Severity.INFO}),this.fieldStatus.update(t,null,i,s))}_computeVisible(){return this.visible&&!this.overflown&&(!!this.errorStatus||_.hasText(this.tooltipText))}setTabbable(e){this.setProperty("tabbable",e)}_renderTabbable(){this.$container.setTabbable(this.tabbable&&!w.get().supportsOnlyTouch())}select(){this.setSelected(!0)}setSelected(e){this.setProperty("selected",e)}_renderSelected(){this.$container.select(this.selected),this.$container.setTabbable(this.selected&&!w.get().supportsOnlyTouch()),T.selected(this.$container,this.selected||null)}setMarked(e){this.setProperty("marked",e)}_renderMarked(){this.$container.toggleClass("marked",this.marked)}setOverflown(e){this.setProperty("overflown",e)}_renderOverflown(){this.$container.toggleClass("overflown",this.overflown),this._updateStatus()}_onDesktopPropertyChange(e){e.propertyName==="dense"&&this.invalidateLayout()}_onTabMouseDown(e){if(this._preventTabSelection){this._preventTabSelection=!1;return}this.setTabbable(!0),this.$container.focus(),this.select(),this.$label&&(Y.cancel(this.$label),Y.close(this.$label)),this.$subLabel&&(Y.cancel(this.$subLabel),Y.close(this.$subLabel))}_onStatusMouseDown(e){this._preventTabSelection=!0,e.preventDefault()}_onTabPropertyChange(e){e.propertyName==="visible"?this.setVisible(e.newValue):e.propertyName==="label"?this.setLabel(this.tabItem.label):e.propertyName==="subLabel"?this.setSubLabel(this.tabItem.subLabel):e.propertyName==="cssClass"?this.setCssClass(this.tabItem.cssClass):e.propertyName==="marked"?this.setMarked(this.tabItem.marked):e.propertyName==="errorStatus"?this.setErrorStatus(e.newValue):e.propertyName==="tooltipText"&&this.setTooltipText(e.newValue)}}class es extends I{tabBox;tabs;displayStyle;hasSubLabel;selectedTab;ellipsis;$selectionMarker;_tabItemPropertyChangeHandler;_tabPropertyChangeHandler;constructor(){super(),this.tabBox=null,this.tabs=[],this.displayStyle=es.DisplayStyle.DEFAULT,this.hasSubLabel=!1,this.selectedTab=null,this._tabItemPropertyChangeHandler=this._onTabItemPropertyChange.bind(this),this._tabPropertyChangeHandler=this._onTabPropertyChange.bind(this),this.ellipsis=null,this.$selectionMarker=null}static DisplayStyle={DEFAULT:"default",SPREAD_EVEN:"spreadEven"};_init(e){super._init(e),this.tabBox=e.tabBox,this.ellipsis=u.create(yo,{parent:this,cssClass:"overflow-tab-item unfocusable",iconId:null,inheritAccessibility:!1,text:"0"})}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new Sc(this),new xc(this)])}_render(){this.$container=this.$parent.appendDiv("tab-area"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Dc(this)),this.ellipsis.render(this.$container),this.$selectionMarker=this.$container.appendDiv("selection-marker")}_renderProperties(){super._renderProperties(),this._renderTabs(),this._renderSelectedTab(),this._renderHasSubLabel(),this._renderDisplayStyle()}_remove(){super._remove(),this._removeTabs()}setSelectedTabItem(e){this.setSelectedTab(this.getTabForItem(e))}getTabForItem(e){return p.find(this.tabs,t=>t.tabItem===e)}setSelectedTab(e){this.setProperty("selectedTab",e)}_setSelectedTab(e){this.selectedTab&&this.selectedTab.setSelected(!1),e&&e.setSelected(!0),this._setProperty("selectedTab",e),this._setTabbableItem(e)}_renderSelectedTab(){this.selectedTab&&this.selectedTab.overflown&&this.invalidateLayoutTree()}isTabItemFocused(e){return this.getTabForItem(e).isFocused()}focusTabItem(e){return this.focusTab(this.getTabForItem(e))}focusTab(e){return e.focus()}setTabItems(e){this.setProperty("tabs",e),this._updateHasSubLabel(),this.invalidateLayoutTree()}_setTabs(e){let t=this.tabs.slice(),i=e.map(s=>{let r=this.getTabForItem(s);return r?p.remove(t,r):(r=u.create(fa,{parent:this,tabItem:s}),s.on("propertyChange",this._tabItemPropertyChangeHandler),r.on("propertyChange",this._tabPropertyChangeHandler)),r});t.forEach(s=>{s.tabItem.off("propertyChange",this._tabItemPropertyChangeHandler)}),this._removeTabs(t),this._setProperty("tabs",i)}_renderTabs(){this.tabs.slice().reverse().forEach((e,t,i)=>{e.rendered||e.render(),e.$container.on("blur",this._onTabItemBlur.bind(this)).on("focus",this._onTabItemFocus.bind(this)),e.$container.prependTo(this.$container),e.$container.on("blur",this._onTabItemBlur.bind(this)).on("focus",this._onTabItemFocus.bind(this))})}_removeTabs(e){e=e||this.tabs,e.forEach(t=>{t.remove()})}setDisplayStyle(e){this.setProperty("displayStyle",e)}_renderDisplayStyle(){this.$container.toggleClass("spread-even",this.displayStyle===es.DisplayStyle.SPREAD_EVEN),this.invalidateLayoutTree()}_onTabItemFocus(){this.setFocused(!0)}_onTabItemBlur(){this.setFocused(!1)}_updateHasSubLabel(){let e=this.visibleTabs();this._setHasSubLabel(e.some(t=>_.hasText(t.subLabel)))}visibleTabs(){return this.tabs.filter(e=>e.visible)}_setHasSubLabel(e){this.hasSubLabel!==e&&(this._setProperty("hasSubLabel",e),this.rendered&&this._renderHasSubLabel())}_renderHasSubLabel(){this.$container.toggleClass("has-sub-label",this.hasSubLabel),this.visibleTabs().forEach(e=>e.invalidateLayout()),this.invalidateLayoutTree()}selectNextTab(e){this._moveSelectionHorizontal(!0,e)}selectPreviousTab(e){this._moveSelectionHorizontal(!1,e)}_moveSelectionHorizontal(e,t){let i=this.tabs.slice(),s=this.$container.activeElement(),r=!1;e||(i.reverse(),r=s[0]===this.ellipsis.$container[0]),i.forEach(function(o,l){if(r&&o.visible&&!o.overflown){this.setSelectedTab(o),this._setTabbableItem(o),t&&o.focus(),r=!1;return}s[0]===o.$container[0]&&(r=!0)},this),e&&r&&this.ellipsis.isTabTarget()&&(this._setTabbableItem(this.ellipsis),t&&this.ellipsis.focus())}_setTabbableItem(e){let t=this.tabs;e&&(this.ellipsis.setTabbable(!1),t.forEach(i=>{i.setTabbable(!1)}),e.setTabbable(!0))}_onTabPropertyChange(e){e.propertyName==="selected"&&this.setSelectedTab(e.source)}_onTabItemPropertyChange(e){e.propertyName==="visible"&&(this._updateHasSubLabel(),this.invalidateLayoutTree()),e.propertyName==="subLabel"&&this._updateHasSubLabel()}}Z.uuidPathSkipWidgets.add(es);class Dc extends ne{tabArea;overflowTabs;visibleTabs;_tabAreaPropertyChangeHandler;constructor(e){super(),this.tabArea=e,this.overflowTabs=[],this.visibleTabs=[],this._tabAreaPropertyChangeHandler=this._onTabAreaPropertyChange.bind(this),this.tabArea.on("propertyChange",this._tabAreaPropertyChangeHandler),this.tabArea.one("remove",()=>{this.tabArea.off("propertyChange",this._tabAreaPropertyChangeHandler)})}layout(e){let t=x.get(e),i=t.availableSize().subtract(t.insets());this.preferredLayoutSize(e,{widthHint:i.width}),this._layoutSelectionMarker()}_layoutSelectionMarker(){let e=this.tabArea.$selectionMarker,t=this.tabArea.selectedTab,i;t?(e.setVisible(!0),i=C.bounds(t.$container),e.cssLeft(i.x),e.cssWidth(i.width)):e.setVisible(!1)}_updateEllipsis(){let e=this.tabArea.ellipsis;e.setHidden(this.overflowTabs.length<1),e.setText(this.overflowTabs.length+""),this.visibleTabs.forEach(t=>t.setOverflown(!1)),this.overflowTabs.forEach(t=>t.setOverflown(!0)),e.childActions.forEach(t=>t.destroy()),e.setChildActions(this.overflowTabs.map(t=>{let i=u.create(Ec,{parent:e,tab:t,text:t.label,visible:t.visible});return i.on("action",s=>{h().log.isDebugEnabled()&&h().log.debug("(TabAreaLayout#_onClickEllipsis) tab="+t),e.popup.close(),t.select(),t.focus()}),i}))}preferredLayoutSize(e,t){let i=x.get(e),s=new F(0,0),r=Number.MAX_VALUE;this.visibleTabs=this.tabArea.visibleTabs();let o=this.visibleTabs.map((l,a)=>l.selected?-1:a).filter(l=>l>=0);if(this.overflowTabs=[],(t.widthHint===0||t.widthHint)&&(r=t.widthHint-i.insets().horizontal()),r<=0)return this._minSize(this.visibleTabs).add(i.insets());for(this._setFirstLastMarker(this.visibleTabs),this._updateEllipsis(),s=this._prefSize(this.visibleTabs);s.width>r&&o.length>0;){let l=o.splice(-1)[0];this.overflowTabs.splice(0,0,this.visibleTabs[l]),this.visibleTabs.splice(l,1),this._setFirstLastMarker(this.visibleTabs),this._updateEllipsis(),s=this._prefSize(this.visibleTabs)}return this.tabArea.displayStyle===es.DisplayStyle.SPREAD_EVEN?C.prefSize(e,t):C.exactPrefSize(s.add(i.insets()),t)}_minSize(e){let t=[];return this.overflowTabs=e.filter(i=>i.selected?(t.push(i),!1):!0),this.visibleTabs=t,this._setFirstLastMarker(t),this._prefSize(t)}_prefSize(e,t){let i=e.map(s=>this._tabSize(s)).reduce((s,r)=>(s.height=Math.max(s.height,r.height),s.width+=r.width,s),new F(0,0));if(t=u.nvl(t,this.overflowTabs.length>0),t){let s=this._tabSize(this.tabArea.ellipsis);i.height=Math.max(i.height,s.height),i.width+=s.width}return i}_setFirstLastMarker(e,t){t=u.nvl(t,this.overflowTabs.length>0),this.tabArea.tabs.forEach(i=>{i.htmlComp.$comp.removeClass("first last")}),this.tabArea.ellipsis.$container.removeClass("first last"),e.length>0&&(e[0].$container.addClass("first"),t?this.tabArea.ellipsis.$container.addClass("last"):e[e.length-1].$container.addClass("last"))}_tabSize(e){let t=e.htmlComp,i,s=t.$comp.attr("class");if(this.tabArea.displayStyle===es.DisplayStyle.SPREAD_EVEN&&this.tabArea.$container.removeClass("spread-even"),t.$comp.removeClass("overflown"),t.$comp.removeClass("hidden"),i=t.prefSize({exact:!0}).add(C.margins(t.$comp)),e instanceof fa&&e.fieldStatus&&e.fieldStatus.htmlComp){let r=e.overflown&&!e.fieldStatus.visible;r&&e.fieldStatus.setVisible(!0);let o=e.fieldStatus.htmlComp.prefSize({includeMargin:!0}).width;r&&e.fieldStatus.setVisible(!1),i.width+=o}return t.$comp.attrOrRemove("class",s),this.tabArea.displayStyle===es.DisplayStyle.SPREAD_EVEN&&this.tabArea.$container.addClass("spread-even"),i}_onTabAreaPropertyChange(e){e.propertyName==="selectedTab"&&this._layoutSelectionMarker()}}class Ec extends J{tab}class Fc extends ne{htmlPropertyChangeHandler;_tabBox;_statusWidth;constructor(e){super(),this._tabBox=e,this._statusWidth=null,this._initDefaults(),this.htmlPropertyChangeHandler=this._onHtmlEnvironmentPropertyChange.bind(this),we.get().on("propertyChange",this.htmlPropertyChangeHandler),this._tabBox.one("remove",()=>{we.get().off("propertyChange",this.htmlPropertyChangeHandler)})}_initDefaults(){this._statusWidth=we.get().fieldStatusWidth}_onHtmlEnvironmentPropertyChange(){this._initDefaults(),this._tabBox.invalidateLayoutTree()}layout(e){let t,i,s,r,o=x.get(e),l=x.get(this._tabBox._$tabContent),a=x.get(this._tabBox.header.$container),d=0,c=new F,f=this._tabBox.$status,g=this._tabBox.statusPosition;t=o.availableSize().subtract(o.insets()),a.isVisible()&&(s=a.margins(),d=t.subtract(s).width,f&&f.isVisible()&&(this._layoutStatus(),g===A.StatusPosition.DEFAULT&&(d-=this._statusWidth+C.margins(f).horizontal())),r=a.prefSize({widthHint:d}),f&&f.isVisible()&&this._layoutStatus(r.height),r.width=d,a.setSize(r),c=r.add(s)),i=t.subtract(l.margins()),i.height-=c.height,l.setSize(i)}_layoutStatus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=this._tabBox.htmlComp,i=t.insets({includeBorder:!1}),s=i.top,r=i.right,o=this._tabBox.header.$container,l=this._tabBox.$status,a=C.margins(l),d=s,c=this._tabBox.statusPosition,f=e-a.vertical();c===A.StatusPosition.DEFAULT?d+=o.cssMarginTop():f-=l.cssBorderWidthY(),l.cssWidth(this._statusWidth).cssTop(d).cssRight(r).cssHeight(f)}preferredLayoutSize(e,t){t=t||{};let i=x.get(e),s=x.get(this._tabBox._$tabContent),r=x.get(this._tabBox.header.$container),o=new F,l=new F,a=this._tabBox.$status,d=this._tabBox.statusPosition,c=i.availableSize().subtract(i.insets()).width;return t.heightHint=null,r.isVisible()&&(a&&a.isVisible()&&d===A.StatusPosition.DEFAULT&&(c-=a.outerWidth(!0)),o=r.prefSize({widthHint:c}).add(r.margins())),l=s.prefSize(t).add(i.insets()).add(s.margins()),new F(Math.max(o.width,l.width),l.height+o.height)}}class ga extends ae{selectionKeystroke;marked;constructor(){super(),this.selectionKeystroke=null,this.marked=!1}_createLayout(){return new Rc(this)}_computeTitleVisible(e){return!1}addStatus(){}_computeStatusVisible(){return!1}setMarked(e){this.setProperty("marked",e)}getContextMenuItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return[]}focus(){return this.select(),this.parent.focusTabItem(this)}isFocused(){return this.parent.isTabItemFocused(this)}select(){this.parent.selectedTab!==this&&this.parent.setSelectedTab(this)}getTab(){return this.parent.getTabForItem(this)}}Z.uuidPathSkipWidgets.add(ga);class hm extends Ju{}class Rc extends ra{constructor(e){super(e)}_$status(){return this.groupBox.parent.$status}_layoutStatus(){}_menuBarSize(e,t,i){let s=Fs.size(e,t),r=this.groupBox.parent;return s.width=r.header.$container.outerWidth(),s}_headerHeight(){return 0}}class Ac extends B{constructor(e,t){super(),this.field=t,this.parseAndSetKeyStroke(e),this.renderingHints.offset=16,this.renderingHints.hAlign=ut.RIGHT,this.renderingHints.render=()=>{let i=this.field.getTab();return i&&i.rendered},this.renderingHints.$drawingArea=(i,s)=>this.field.getTab().$container,this.inheritAccessibility=!1}handle(e){this.field.select()}}class fs extends A{table;eventDelegator;_tableChangedHandler;_deletedRows;_insertedRows;_updatedRows;_checkedRows;constructor(){super(),this.gridDataHints.weightY=1,this.gridDataHints.h=3,this.eventDelegator=null,this._tableChangedHandler=this._onTableChanged.bind(this),this._deletedRows=b.createMap(),this._insertedRows=b.createMap(),this._updatedRows=b.createMap(),this._checkedRows=b.createMap(),this.table=null,this._addWidgetProperties(["table"])}static TABLE_CHANGE_EVENTS="rowsInserted rowsDeleted allRowsDeleted rowsUpdated rowsChecked";_init(e){super._init(e),this._setTable(this.table)}_createValidationResultProvider(){return u.create($c,{field:this})}_render(){this.addContainer(this.$parent,"table-field"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this._renderTable()}setTable(e){this.setProperty("table",e)}_setTable(e){this.table&&(this.table.off(fs.TABLE_CHANGE_EVENTS,this._tableChangedHandler),this.eventDelegator&&(this.eventDelegator.destroy(),this.eventDelegator=null)),this._setProperty("table",e),e&&(e.on(fs.TABLE_CHANGE_EVENTS,this._tableChangedHandler),this.eventDelegator=si.create(this,e,{delegateProperties:["enabled","disabledStyle","loading"]}),e.setDisabledStyle(this.disabledStyle),e.setLoading(this.loading),e.setScrollTop(this.scrollTop))}_renderTable(){this.table&&(this.table.render(),this.addField(this.table.$container),this.$field.addDeviceClass(),this.invalidateLayoutTree())}_removeTable(){this.table&&(this.table.remove(),this._removeField(),this.invalidateLayoutTree())}computeSaveNeeded(){return Object.keys(this._deletedRows).length>0||Object.keys(this._insertedRows).length>0||Object.keys(this._updatedRows).length>0||Object.keys(this._checkedRows).length>0}_computeEmpty(){return!this.table||this.table.rows.length===0}_onTableChanged(e){u.isOneOf(e.type,"rowsDeleted","allRowsDeleted")?this._updateDeletedRows(e.rows):e.type==="rowsInserted"?this._updateInsertedRows(e.rows):e.type==="rowsUpdated"?this._updateUpdatedRows(e.rows):e.type==="rowsChecked"&&this._updateCheckedRows(e.rows)}_updateDeletedRows(e){e.forEach(t=>{if(t.id in this._insertedRows){delete this._insertedRows[t.id],delete this._updatedRows[t.id],delete this._checkedRows[t.id];return}this._deletedRows[t.id]=t}),this.updateSaveNeeded(),this._updateEmpty()}_updateInsertedRows(e){e.forEach(t=>{this._insertedRows[t.id]=t}),this.updateSaveNeeded(),this._updateEmpty()}_updateUpdatedRows(e){e.forEach(t=>{t.status!==Rt.Status.NON_CHANGED&&(this._updatedRows[t.id]=t)}),this.updateSaveNeeded()}_updateCheckedRows(e){e.forEach(t=>{t.id in this._checkedRows?delete this._checkedRows[t.id]:this._checkedRows[t.id]=t}),this.updateSaveNeeded()}_markAsSaved(){super._markAsSaved(),this._deletedRows=b.createMap(),this._insertedRows=b.createMap(),this._updatedRows=b.createMap(),this._checkedRows=b.createMap(),this.table?.markRowsAsNonChanged()}getDelegateScrollable(){return this.table}}class dm extends at{}class $c extends Ql{provide(e){let t=super.provide(e);if(t&&!t.valid)return t;let i=this._getCellResult(t),s=this.field.label||"";s&&i.label&&(s+=": "),s+=i.label,i.errorStatus&&(e=i.errorStatus);let r=i.reveal||(()=>{}),o=(!this.field.mandatory||!this.field.empty)&&i.validByMandatory;return{valid:(!e||e.isValid())&&o,validByMandatory:o,errorStatus:e,field:this.field,label:s,reveal:r}}_getCellResult(e){let t=p.ensure(this.field.table?.rows),i=p.ensure(this.field.table?.columns),s=new Set,r=new Set,o,l=!0,a;for(let c of t)for(let f of i){let g=f.isContentValid(c);if(g.valid)continue;a||(a=()=>{e.reveal(),this.field.table.focusCell(f,c)});let y=this._getCellLabel(f,c);y&&s.add(y),g.errorStatus?.message&&r.add(g.errorStatus.message),o?g.errorStatus?.severity>o.severity&&(o=g.errorStatus):o=g.errorStatus,l=l&&g.validByMandatory}let d=p.format(Array.from(s.values()),", ");return o&&(r.size>1||!l)&&(o=u.create(E,$.extend({},o,{message:""}))),{label:d,errorStatus:o,validByMandatory:l,reveal:a}}_getCellLabel(e,t){return e.text}}class Mc extends _e{table;field;constructor(){super(),this.table=null,this.windowPaddingX=0,this.windowPaddingY=0}_init(e){super._init(e),this.table=u.create(H,{parent:this,headerVisible:!1,autoResizeColumns:!0,multiSelect:!1,scrollToSelection:!0,columns:[{objectType:le,text:"Tag",autoOptimizeWidth:!1}],headerMenusEnabled:!1,textFilterEnabled:!1}),this.table.on("rowClick",this._onRowClick.bind(this))}_createLayout(){return new kc(this)}_render(){super._render(),this.$container.addClass("tag-chooser-popup").on("mousedown",this._onContainerMouseDown.bind(this)),this.findDesktop().adjustOverlayOrder(this),this._renderTable()}_renderTable(){this.table.setVirtual(!1),this.table.render(),this.table.$container.setTabbable(!1).addClass("focused")}setLookupResult(e){let t=e.lookupRows;this.table.deleteAllRows();let i=t.map(s=>Br.createTableRow(s));this.table.insertRows(i)}_onRowClick(e){this.triggerLookupRowSelected()}_onContainerMouseDown(e){return!1}_isMouseDownOnAnchor(e){return this.field.$field.isOrHas(e.target)}delegateKeyEvent(e){e.originalEvent.smartFieldEvent=!0,this.table.$container.trigger(e)}triggerLookupRowSelected(e){e=e||this.selectedRow(),!(!e||!e.enabled)&&this.trigger("lookupRowSelected",{lookupRow:e.lookupRow})}selectedRow(){return this.table.selectedRow()}}class kc extends xi{constructor(e){super(e),this.doubleCalcPrefSize=!1}layout(e){super.layout(e);let t=this.popup.htmlComp,i=t.size().subtract(t.insets());this.popup.table.htmlComp.setSize(i),this.popup.position()}preferredLayoutSize(e,t){let i=u.create(ua,this.popup.table);i.modifyDom();let s=super.preferredLayoutSize(e);return i.restoreDom(),s}}class ma extends ge{lookupCall;maxLength;fieldHtmlComp;popup;tagBar;maxLengthHandler;_currentLookupCall;constructor(){super(),this.$field=null,this.fieldHtmlComp=null,this.popup=null,this.lookupCall=null,this._currentLookupCall=null,this.tagBar=null,this.maxLength=500,this.maxLengthHandler=u.create(De,{target:this})}_init(e){super._init(e),this.tagBar=u.create(qt,{parent:this,tags:this.value,clickable:e.clickable}),this.tagBar.on("tagRemove",this._onTagRemove.bind(this)),this.on("propertyChange",this._onValueChange.bind(this)),this._setLookupCall(this.lookupCall)}_onTagRemove(e){this.removeTag(e.tag)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new Ic(this),new ba(this._createFieldAdapter()),new _a(this._createFieldAdapter()),new Lc(this)])}_createKeyStrokeContext(){return new qi}_render(){this.addContainer(this.$parent,"tag-field",new Bc(this)),this.addLabel(),this.addMandatoryIndicator();let e=this.$container.appendDiv();this.fieldHtmlComp=x.install(e,this.session),this.fieldHtmlComp.setLayout(new No(this)),this.tagBar.render(e);let t=e.appendElement("<input>","field").attr("type","text").on("keydown",this._onInputKeydown.bind(this)).on("keyup",this._onInputKeyup.bind(this)).on("input",this._onFieldInput.bind(this));this.addFieldContainer(e),this.addField(t),this.maxLengthHandler.install(t),this.addStatus(),this._addAriaFieldDescription()}_addAriaFieldDescription(){T.addHiddenDescriptionAndLinkToElement(this.$field,this.id+"-func-desc",this.session.text("ui.AriaTagFieldDescription"))}_renderProperties(){super._renderProperties(),this._renderValue(),this._renderMaxLength()}_renderValue(){this.tagBar.updateTags()}_setValue(e){super._setValue(e),this.tagBar&&this.tagBar.setTags(this.value)}_setLookupCall(e){this._setProperty("lookupCall",Pt.ensure(e,this.session))}formatValue(e){return""}_validateValue(e){let t=p.ensure(e),i=[];return t.forEach(s=>{_.empty(s)||(s=s.toLowerCase(),i.indexOf(s)<0&&i.push(s))}),i}_parseValue(e){let t=p.ensure(this.value);return t=t.slice(),t.push(e),t}_renderDisplayText(){this.$field.val(this.displayText),super._renderDisplayText(),this._updateInputVisible()}_renderEnabled(){super._renderEnabled(),this._updateInputVisible()}_renderFieldStyle(){super._renderFieldStyle(),this.rendered&&this.fieldHtmlComp.invalidateLayoutTree()}setMaxLength(e){this.setProperty("maxLength",e)}_renderMaxLength(){this.maxLengthHandler.render()}_updateInputVisible(){let e,t=!this.$field.isVisible();this.enabledComputed?e=!0:e=_.hasText(this.displayText),this.$field.setVisible(e),e!==t&&this._renderValue()}_readDisplayText(){return this.$field.val()}_clear(){this.$field.val("")}acceptInput(e){if(this.popup){this.popup.selectedRow()?this.popup.triggerLookupRowSelected():this.closePopup();return}super.acceptInput(!1)}_triggerAcceptInput(e){this.trigger("acceptInput",{displayText:this.displayText,whileTyping:e,value:this.value})}aboutToBlurByMouseDown(e){oe.eventOutsideProposalField(this,e)&&this.acceptInput(!0)}_onFieldBlur(e){this.closePopup(),super._onFieldBlur(e),this.rendered&&!this.removing&&this.tagBar.blur()}_onFieldFocus(e){super._onFieldFocus(e),this.rendered&&!this.removing&&this.tagBar.focus()}_onFieldInput(){this._updateHasText()}addTag(e){let t=this._parseValue(e);this.setValue(t),this._triggerAcceptInput()}removeTag(e){if(_.empty(e))return;e=e.toLowerCase();let t=p.ensure(this.value);t.indexOf(e)!==-1&&(t=t.slice(),p.remove(t,e),this.setValue(t),this._triggerAcceptInput(),this.focus())}_onInputKeydown(e){this._isNavigationKey(e)&&this.popup?this.popup.delegateKeyEvent(e):e.which===m.ESC&&this.closePopup()}_isNavigationKey(e){return u.isOneOf(e.which,[m.PAGE_UP,m.PAGE_DOWN,m.UP,m.DOWN])}_onInputKeyup(e){e.which!==m.ESC&&(this._isNavigationKey(e)||this._lookupByText(this.$field.val()))}_lookupByText(e){if(this.lookupCall){if(_.empty(e)||e.length<2){this.closePopup();return}this._currentLookupCall=this.lookupCall.cloneForText(e),this.trigger("prepareLookupCall",{lookupCall:this._currentLookupCall}),this._currentLookupCall.execute().always(()=>{this._currentLookupCall=null}).done(this._onLookupDone.bind(this))}}_onLookupDone(e){try{if(!this.rendered||!this.isFocused()||e.lookupRows.length===0){this.closePopup();return}this.openPopup(),this.popup.setLookupResult(e)}finally{this.trigger("lookupCallDone",{result:e})}}openPopup(){this.popup||(this.popup=u.create(Mc,{parent:this,$anchor:this.$field,boundToAnchor:!0,closeOnAnchorMouseDown:!1,field:this}),this.popup.on("lookupRowSelected",this._onLookupRowSelected.bind(this)),this.popup.one("close",this._onPopupClose.bind(this)),this.popup.open())}closePopup(){this.popup&&!this.popup.destroying&&this.popup.close()}_onLookupRowSelected(e){this._clear(),this._updateHasText(),this.addTag(e.lookupRow.key),this.closePopup()}_onPopupClose(e){this.popup=null}isInputFocused(){let e=this.$fieldContainer.activeElement();return this.$field.is(e)}_onValueChange(e){e.propertyName==="value"&&this._renderLabel()}_renderPlaceholder(e){let t=!!p.ensure(this.value).length;e=u.nvl(e,this.$field),e&&e.placeholder(t?"":this.label)}_createFieldAdapter(){return ma.createFieldAdapter(this)}static createFieldAdapter(e){return{$container:()=>e.$fieldContainer,enabled:()=>_.empty(e._readDisplayText()),focus:()=>e.$field.focus(),removeTag:t=>e.removeTag(t)}}}class um extends oa{_initProperties(e){super._initProperties(e),e.insertText!==void 0&&delete e.insertText}_postCreateWidget(){super._postCreateWidget();let e=ll;this.widget.lookupCall=u.create(e,this)}_syncResult(e){let t=this.widget._currentLookupCall;t&&t.resolveLookup(e)}_onWidgetAcceptInput(e){this._send("acceptInput",{displayText:e.displayText,value:e.value})}}class Ic extends B{constructor(e){super(),this.field=e,this.which=[m.ENTER],this.renderingHints.render=!1,this.preventDefault=!1,this.stopPropagation=!0}_accept(e){return super._accept(e)?(this.stopPropagation=_.hasText(this.field._readDisplayText()),this.field.isInputFocused()):!1}handle(e){this.field.acceptInput()}}class _a extends B{fieldAdapter;constructor(e){super(),this.fieldAdapter=e,this.which=[m.DELETE],this.renderingHints.render=!1,this.preventDefault=!1}_accept(e){return super._accept(e)?this._$focusedTag().length>0:!1}handle(e){let t=this._$focusedTag(),i=qt.getTagData(t);this.fieldAdapter.removeTag(i)}_$focusedTag(){return qt.findFocusedTagElement(this.fieldAdapter.$container())}}class ba extends B{fieldAdapter;constructor(e){super(),this.fieldAdapter=e,this.which=[m.LEFT,m.RIGHT],this.preventDefault=!1,this.preventInvokeAcceptInputOnActiveValueField=!0}_accept(e){return super._accept(e)?this.fieldAdapter.enabled():!1}handle(e){e.which===m.LEFT?this._focusTagElement(-1):e.which===m.RIGHT&&this._focusTagElement(1)}_focusTagElement(e){let t=-1,i=-2,s=qt.findFocusableTagElements(this.fieldAdapter.$container()),r=s.length;if(r===0)return;let o=t;if(s.each(function(l){h()(this).hasClass("focused")&&(o=l)}),o===t)e===-1&&(o=r-1);else{let l=o+e;l>=r?o=i:l<0?o=t:(qt.unfocusTagElement(s.eq(o)),o=l)}o===t||(o===i?this.fieldAdapter.focus():qt.focusTagElement(s.eq(o)))}}class Lc extends B{constructor(e){super(),this.field=e,this.which=[m.ENTER,m.SPACE],this.renderingHints.render=!1,this.preventDefault=!1}_accept(e){return super._accept(e)?this.field.tagBar&&this.field.tagBar.isOverflowIconFocused():!1}handle(e){this.field.tagBar.openOverflowPopup()}}class Bc extends Kt{constructor(e){super(e)}_$elementForIconLayout(){return this.formField.$fieldContainer}}class No extends ne{tagField;constructor(e){super(),this.tagField=e}static MIN_INPUT_TAG_RATIO=.33;layout(e){let t=x.get(e),i=this.tagField.value&&this.tagField.value.length>0,s=this.tagField.$field,r=this.tagField.tagBar.htmlComp;if(this.tagField.tagBar.setVisible(i),i){s.removeClass("fullwidth");let o=t.availableSize().subtract(t.insets()),l=o.width;s.isVisible()&&(l=o.width*(1-No.MIN_INPUT_TAG_RATIO));let a=r.prefSize(!0),d=Math.min(l,a.width);r.setSize(new F(d,a.height).subtract(r.margins()));let c=o.width-d;s.cssWidth(c)}else s.addClass("fullwidth").removeAttr("style")}}class cm extends A{tileGrid;eventDelegator;constructor(){super(),this.eventDelegator=null,this._addWidgetProperties(["tileGrid"])}_init(e){super._init(e),this._setTileGrid(this.tileGrid)}_createLoadingSupport(){return null}_render(){this.addContainer(this.$parent,"tile-field"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this.tileGrid&&this._renderTileGrid()}_renderProperties(){super._renderProperties(),this._renderDropType()}setTileGrid(e){this.setProperty("tileGrid",e)}_setTileGrid(e){this.tileGrid&&this.eventDelegator&&(this.eventDelegator.destroy(),this.eventDelegator=null),this._setProperty("tileGrid",e),e&&(this.eventDelegator=si.create(this,e,{delegateProperties:["loading"]}),e.setLoading(this.loading),e.setScrollTop(this.scrollTop))}_renderTileGrid(){this.tileGrid&&(this.tileGrid.render(),this.addField(this.tileGrid.$container),this.invalidateLayoutTree())}_removeTileGrid(){this.tileGrid&&(this.tileGrid.remove(),this._removeField(),this.invalidateLayoutTree())}getDelegateScrollable(){return this.tileGrid}}class pm extends at{}class ya extends An{tree;_populating;constructor(){super(),this.tree=null,this._populating=!1,this._addWidgetProperties(["tree","filterBox"])}_init(e){super._init(e),this.tree.on("nodesChecked",this._onTreeNodesChecked.bind(this)),this.tree.setScrollTop(this.scrollTop)}_initStructure(e){this.tree||(this.tree=this._createDefaultTreeBoxTree())}_render(){super._render(),this.$container.addClass("tree-box")}_createFieldContainerLayout(){return new Oc(this,this.tree,this.filterBox)}_renderStructure(){this.tree.render(this.$fieldContainer),this.addField(this.tree.$container)}_onTreeNodesChecked(e){this._populating||this._syncTreeToValue()}_syncTreeToValue(){if(!this.lookupCall||this._valueSyncing)return;this._valueSyncing=!0;let e=b.values(this.tree.nodesMap).filter(t=>t.checked).map(t=>t.lookupRow.key);this.setValue(e),this._valueSyncing=!1}_valueChanged(){super._valueChanged(),this._syncValueToTree(this.value)}_syncValueToTree(e){if(!this.lookupCall||this._valueSyncing||!this.initialized)return;this._valueSyncing=!0;let t={checkOnlyEnabled:!1};try{if(p.empty(e))this.uncheckAll(t);else{if(this._ensureLookupCallExecuted())return;this.uncheckAll(t),b.values(this.tree.nodesMap).forEach(s=>{p.contains(e,s.lookupRow.key)&&this.tree.checkNode(s,!0,t)},this)}this._updateDisplayText()}finally{this._valueSyncing=!1}this.tree.autoCheckChildren&&this._syncTreeToValue()}uncheckAll(e){for(let t in this.tree.nodesMap)this.tree.nodesMap.hasOwnProperty(t)&&this.tree.uncheckNode(this.tree.nodesMap[t],e)}_lookupByAllDone(e){super._lookupByAllDone(e),this._populateTree(e)}_populateTree(e){let t=[];this._populating=!0,this._populateTreeRecursive(null,t,e.lookupRows),this.tree.deleteAllNodes(),this.tree.insertNodes(t),this._populating=!1,this._syncValueToTree(this.value)}_populateTreeRecursive(e,t,i){let s;i.forEach(function(r){r.parentKey===e&&(s=this._createNode(r),this._populateTreeRecursive(s.lookupRow.key,s.childNodes,i),s.leaf=!s.childNodes.length,t.push(s))},this)}getCheckedLookupRows(){return this.value===null||p.empty(this.value)||this.tree.nodes.length===0?[]:b.values(this.tree.nodesMap).filter(e=>e.checked).map(e=>e.lookupRow)}_createNode(e){let t=u.create(Fi,{parent:this.tree,text:e.text,lookupRow:e});return e.iconId&&(t.iconId=e.iconId),e.tooltipText&&(t.tooltipText=e.tooltipText),e.backgroundColor&&(t.backgroundColor=e.backgroundColor),e.foregroundColor&&(t.foregroundColor=e.foregroundColor),e.font&&(t.font=e.font),e.enabled===!1&&(t.enabled=!1),e.cssClass&&(t.cssClass=e.cssClass),e.active===!1&&(t.active=!1,t.cssClass=(t.cssClass?t.cssClass+" ":"")+"inactive"),t}_prepareWidgetProperty(e,t){return e==="tree"&&b.isPojo(t)&&(t=h().extend(this._createDefaultTreeBoxTreeModel(),t)),super._prepareWidgetProperty(e,t)}_createDefaultTreeBoxTree(){return u.create(fe,{parent:this,...this._createDefaultTreeBoxTreeModel()})}_createDefaultTreeBoxTreeModel(){return{checkable:!0}}getDelegateScrollable(){return this.tree}}class fm extends At{}class Oc extends ea{constructor(e,t,i){super(e,t,i)}}class Hc extends A{tree;constructor(){super(),this.gridDataHints.weightY=1,this.gridDataHints.h=3,this._addWidgetProperties(["tree"])}_render(){this.addContainer(this.$parent,"tree-field"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this.tree&&this._renderTree()}setTree(e){this.setProperty("tree",e)}_setTree(e){this._setProperty("tree",e),e&&e.setScrollTop(this.scrollTop)}_renderTree(){this.tree&&(this.tree.render(),this.addField(this.tree.$container),this.$field.addDeviceClass(),this.invalidateLayoutTree())}_removeTree(){this.tree&&(this.tree.remove(),this._removeField(),this.invalidateLayoutTree())}getDelegateScrollable(){return this.tree}}class Nc extends at{}class gm extends A{activeStepIndex;steps;previousActiveStepIndex;stepsMap;keepActiveStepAtLeftBorder;animateScrolling;$wizardStepsBody;$screenReaderStatus;constructor(){super(),this.activeStepIndex=-1,this.steps=[],this.previousActiveStepIndex=-1,this.stepsMap={},this.$wizardStepsBody=null,this.keepActiveStepAtLeftBorder=w.get().type===w.Type.MOBILE,this.animateScrolling=w.get().type===w.Type.MOBILE,this.$screenReaderStatus=null}_init(e){super._init(e),this._updateStepsMap()}_render(){this.addContainer(this.$parent,"wizard-progress-field",new Vc(this)),this.addField(this.$parent.makeDiv("wizard-steps")),this.addStatus(),this.addLabel(),this.$field.toggleClass("compact",w.get().type===w.Type.MOBILE);let e=this.htmlComp.layout;e.compactFieldWidth=-1,this.$wizardStepsBody=this.$field.appendDiv("wizard-steps-body"),this._addScreenReaderStatus(),this._installScrollbars({axis:"x",scrollShadow:"none"}),this.parent instanceof ae&&this.parent.controls[0]===this&&this.parent.parent instanceof j&&this.parent.parent.$container.addClass("wizard-container-form")}_addScreenReaderStatus(){this.$screenReaderStatus=this.$field.appendDiv("screen-reader-steps-description"),T.role(this.$screenReaderStatus,"status"),T.screenReaderOnly(this.$screenReaderStatus)}_renderProperties(){super._renderProperties(),this._renderSteps(),this._renderActiveStepIndex()}_setSteps(e){this._setProperty("steps",e),this._updateStepsMap()}_renderSteps(){this.$wizardStepsBody.children(".wizard-step").each(function(){Y.uninstall(h()(this))}),this.$wizardStepsBody.empty(),this.steps.forEach((e,t)=>{let i=this.$wizardStepsBody.appendDiv("wizard-step").addClass(e.cssClass).data("wizard-step",e);e.$step=i,this._updateStepClasses(e),yt.applyInfo(e,i,this.session),this.session.inspector&&i.attr("data-step-index",e.index),_.hasText(e.tooltipText)&&Y.install(i,{parent:this,text:e.tooltipText,tooltipPosition:"bottom"});let s=i.appendDiv("icon");e.iconId?s.icon(e.iconId):e.finished?s.icon(q.CHECKED_BOLD):s.text(t+1);let r=i.appendDiv("text");r.appendDiv("title").textOrNbsp(e.title).attr("data-text",e.title),e.subTitle&&r.appendDiv("sub-title").textOrNbsp(e.subTitle),t<this.steps.length-1&&this.$wizardStepsBody.appendDiv("wizard-step-separator")}),this.invalidateLayoutTree(!1)}_renderScreenReaderStatus(e){e.empty();let t=this.steps.indexOf(this.stepsMap[this.activeStepIndex]);this.steps.forEach((i,s)=>{let r=e.appendDiv("sr-step-description"),o=this.steps.indexOf(i),l="";o===t?l+=this.session.text("ui.Current"):o>t?l+=this.session.text("ui.Subsequent"):l+=this.session.text("ui.Previous"),r.appendDiv("text").text(_.join(" ",this.session.text("ui.Step"),String(s+1),l)),_.hasText(i.title)&&r.appendDiv("text").text(i.title),_.hasText(i.subTitle)&&r.appendDiv("text").text(i.subTitle),_.hasText(i.tooltipText)&&r.appendDiv("text").text(i.tooltipText)})}_setActiveStepIndex(e){this.previousActiveStepIndex=this.activeStepIndex,this._setProperty("activeStepIndex",u.nvl(e,-1))}_renderActiveStepIndex(){this.steps.forEach(this._updateStepClasses.bind(this)),this._renderScreenReaderStatus(this.$screenReaderStatus),this.invalidateLayoutTree(!1)}_updateStepClasses(e){let t=e.$step;t.removeClass("selected first last action-enabled disabled"),t.off("click.selected");let i=this.steps.indexOf(e),s=this.steps.indexOf(this.stepsMap[this.activeStepIndex]);this.enabledComputed&&e.enabled&&e.actionEnabled&&i!==this.activeStepIndex?(t.addClass("action-enabled"),t.on("click.selected",this._onStepClick.bind(this))):(!this.enabledComputed||!e.enabled)&&t.addClass("disabled"),t.toggleClass("finished",e.finished),i>=0&&s>=0&&(i===s&&t.addClass("selected"),i===0&&t.addClass("first"),i===this.steps.length-1&&t.addClass("last")),i===this.steps.length-1&&this.$wizardStepsBody.css("background-color",t.css("background-color"))}_stepIndex(e){if(e){let t=e.data("wizard-step");if(t)return t.index}return-1}_updateStepsMap(){this.stepsMap={},this.steps.forEach(e=>{this.stepsMap[e.index]=e})}_resolveStep(e){for(let t=0;t<this.steps.length;t++){let i=this.steps[t];if(i.index===e)return i}return null}_onStepClick(e){let t=h()(e.currentTarget),i=this._stepIndex(t);i>=0&&i!==this.activeStepIndex&&this.trigger("stepAction",{stepIndex:i})}scrollToActiveStep(){let e=this.stepsMap[this.activeStepIndex];if(!e)return;let t=e.$step,i=t.position().left,s=this.animateScrolling&&this.htmlComp.layouted;if(this.keepActiveStepAtLeftBorder){let r=this.steps[0].$step,o=i-r.cssPaddingLeft()+t.cssPaddingLeft();P.scrollLeft(this.$field,o,{animate:s})}else{let r=this.$field.scrollLeft(),o=t.width(),l=this.$field.width(),a=this.previousActiveStepIndex>this.activeStepIndex,d=r+Math.floor(l*(a?.25:.75)),c=i+Math.floor(o/2);(a&&c<d||!a&&c>d)&&P.scrollLeft(this.$field,r+(c-d),{animate:s})}}}class mm extends at{_onWidgetStepAction(e){this._send("doStepAction",{stepIndex:e.stepIndex})}_onWidgetEvent(e){e.type==="stepAction"?this._onWidgetStepAction(e):super._onWidgetEvent(e)}}class Vc extends Kt{constructor(e){super(e)}layout(e){super.layout(e);let t=this.formField.$field.scrollLeft(),i=this.formField.$wizardStepsBody;i.width("auto");let s=i[0].scrollWidth;i.width(s),this.formField.$field.scrollLeft(t),this.formField.scrollToActiveStep()}}class Hr extends A{innerForm;initialFocusEnabled;_formDestroyHandler;constructor(){super(),this._addWidgetProperties(["innerForm"]),this.innerForm=null,this.initialFocusEnabled=!1,this._formDestroyHandler=this._onInnerFormDestroy.bind(this)}_init(e){super._init(e),this._setInnerForm(this.innerForm)}_render(){this.addContainer(this.$parent,"wrapped-form-field"),this.addLabel(),this.addStatus()}_renderProperties(){super._renderProperties(),this._renderInnerForm()}setInnerForm(e){this.setProperty("innerForm",e)}_setInnerForm(e){this.innerForm&&this.innerForm.off("destroy",this._formDestroyHandler),e&&(e.on("destroy",this._formDestroyHandler),this._adaptForm(e)),this._setProperty("innerForm",e)}_adaptForm(e){e.setShowOnOpen(!1),e.setDisplayHint(j.DisplayHint.VIEW),e.setModal(!1),e.setClosable(!1),e.rootGroupBox?.setMenuBarPosition(ae.MenuBarPosition.BOTTOM),e.renderInitialFocusEnabled=this.initialFocusEnabled}_renderInnerForm(){this.innerForm&&(this.innerForm.render(),this.addField(this.innerForm.$container),this.innerForm.invalidateLayoutTree(),this.innerForm.renderInitialFocusEnabled&&this.innerForm.renderInitialFocus())}_removeInnerForm(){this.innerForm&&this.innerForm.remove(),this._removeField()}_onInnerFormDestroy(e){this._removeInnerForm(),this._setInnerForm(null)}setInitialFocusEnabled(e){this.setProperty("initialFocusEnabled",e),this.innerForm&&(this.innerForm.renderInitialFocusEnabled=this.initialFocusEnabled)}}class _m extends at{}class Ln extends ge{lookupCall=null;codeType=null;browseHierarchy=!1;browseMaxRowCount=Pe.DEFAULT_BROWSE_MAX_COUNT;_popup=null;_init(e){super._init(e),this.lookupCall=Pt.ensure(this.lookupCall,this.session),this.lookupCall?.setMaxRowCount(this.browseMaxRowCount),this.clearable=ge.Clearable.ALWAYS}_render(){super._render(),this.$field.addClass("input-field focused")}_formatValue(e){return this._popup?this._popup.content.displayText:Ln.formatValues(e,this.lookupCall,t=>this.trigger("prepareLookupCall",{lookupCall:t}))}static formatValues(e,t,i){return!e?.length||!t?"":(t=t.clone(),i?.(t),t.textsByKeys(e).then(s=>_.join(", ",...Object.values(s))))}_renderDisplayText(){super._renderDisplayText(),this.$field.text(this.displayText||"")}_clear(){this._popup?.widget("LookupBox",An).setValue(null)}onCellEditorRendered(e){this._openPopup(e.cellEditorPopup)}_openPopup(e){this._popup=u.create(tr,{parent:this,anchor:this,horizontalAlignment:_e.Alignment.LEFTEDGE,verticalAlignment:_e.Alignment.BOTTOM,closeOnAnchorMouseDown:!1,cssClass:"lookup-cell-editor-popup",animateResize:!1,scrollType:"layoutAndPosition",content:{...this._createLookupBoxModel(),id:"LookupBox"}});const t=this._popup.widget("LookupBox",An);if(t.on("propertyChange:lookupCall",i=>i.newValue?.setMaxRowCount(this.browseMaxRowCount)),t.on("propertyChange:value",i=>this.setValue(i.newValue)),t.on("prepareLookupCall",i=>this.trigger("prepareLookupCall",{lookupCall:i.lookupCall})),t.on("lookupCallDone",i=>this.trigger("lookupCallDone",{result:i.result})),t.one("lookupCallDone",i=>this._popup.open()),this.browseHierarchy){const i=t.tree;i.on("render",s=>i.htmlComp.setLayout(new Wc(i))),i.on("nodesInserted",s=>{i.setNodeExpandedRecursive(s.nodes,!0),i.invalidateLayoutTree()})}this._popup.on("render",i=>{if(!e.rendered)return;P.scrollTo(e.table.$data,e.$container),P.scrollHorizontalTo(e.table.$data,e.$container);const s=e.keyStrokeContext;this.session.keyStrokeManager.uninstallKeyStrokeContext(s),s.$bindTarget=this._popup.$container,this.session.keyStrokeManager.installKeyStrokeContext(s),this.session.layoutValidator.schedulePostValidateFunction(()=>{if(!this._popup)return;const r=this._popup.htmlComp.layout;r.autoSize=!1,this._popup.position()})}),t.refreshLookup()}_createLookupBoxModel(){return this.browseHierarchy?{objectType:ya,lookupCall:this.lookupCall,codeType:this.codeType,value:this.value,cssClass:"no-mandatory-indicator",labelVisible:!1,statusVisible:!1,tree:{objectType:fe,autoCheckChildren:!0}}:{objectType:Io,lookupCall:this.lookupCall,value:this.value,cssClass:"no-mandatory-indicator",labelVisible:!1,statusVisible:!1,table:{objectType:H,columns:[{objectType:le,autoOptimizeWidth:!0,autoOptimizeMaxWidth:450}]}}}}class Wc extends xn{preferredLayoutSize(e,t){const i=this.tree.$data.css("height");this.tree.$data.css("height","auto"),this.tree.setViewRangeSize(this.tree.calculateViewRangeSize());const s=super.preferredLayoutSize(e,t);return this.tree.$data.css("height",i),s}}class zc extends I{treeBox;_init(e){super._init(e),this.treeBox=u.create(R_,{parent:this,lookupCall:Nu,labelVisible:!1,statusVisible:!1,tree:{objectType:A_,cssClass:"resource-panel-tree",checkable:!0,textFilterEnabled:!1,_scrollDirections:"y",autoCheckChildren:!0}})}_render(){this.$container=this.$parent.appendDiv("resource-panel-container"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new ji),this.treeBox.render()}}class R_ extends ya{_render(){super._render(),this.removeMandatoryIndicator()}_renderFocused(){}_createNode(e){let t=super._createNode(e);return t.expanded=!0,t}_onTreeNodesChecked(e){p.hasElements(this.tree.checkedNodes)?super._onTreeNodesChecked(e):this._populating||(this._syncValueToTree(this.value),this._triggerShakeAnimation(e.nodes[0]))}_triggerShakeAnimation(e){e.$node.children(".tree-node-checkbox").addClassForAnimation("animate-unable-uncheck")}}class A_ extends fe{insertNode(e,t,i){super.insertNode(e,t,i)}}class Bn extends I{static DisplayStyle={DEFAULT:"default",SLIDER:"slider"};activated;label;labelHtmlEnabled;labelVisible;tooltipText;iconVisible;displayStyle;tabbable;$label;$button;constructor(){super(),this.activated=!1,this.label=null,this.labelHtmlEnabled=!1,this.labelVisible=null,this.tooltipText=null,this.iconVisible=!1,this.displayStyle=Bn.DisplayStyle.DEFAULT,this.tabbable=!1,this.$label=null,this.$button=null}_init(e){super._init(e),this.resolveTextKeys(["label","tooltipText"])}_render(){this.$container=this.$parent.appendDiv("switch").on("mousedown",this._onSwitchMouseDown.bind(this)),this.htmlComp=x.install(this.$container,this.session),this.$label=this.$container.appendDiv("switch-label"),this.$button=this.$container.appendDiv("switch-button")}_renderProperties(){super._renderProperties(),this._renderActivated(),this._renderLabel(),this._renderTooltipText(),this._renderIconVisible(),this._renderDisplayStyle(),this._renderTabbable()}_remove(){this.$label=null,this.$button=null,super._remove()}_renderEnabled(){super._renderEnabled(),this.rendered&&this._renderTabbable()}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.registerKeyStrokes([new Gc(this),new Uc(this)])}setActivated(e){this.setProperty("activated",e)}_renderActivated(){this.$button.toggleClass("activated",!!this.activated)}setLabel(e){this.setProperty("label",e)}_renderLabel(){this.labelHtmlEnabled?this.$label.html(this.label):this.$label.text(this.label),this._renderLabelVisible()}setLabelHtmlEnabled(e){this.setProperty("labelHtmlEnabled",e)}_renderLabelHtmlEnabled(){this._renderLabel()}setLabelVisible(e){this.setProperty("labelVisible",e)}_renderLabelVisible(){let e=b.isNullOrUndefined(this.labelVisible)?_.hasText(this.label):!!this.labelVisible;this.$label.setVisible(e),this.invalidateLayoutTree()}setTooltipText(e){this.setProperty("tooltipText",e)}_renderTooltipText(){_.hasText(this.tooltipText)?Y.install(this.$container,{parent:this,text:this.tooltipText,$anchor:this.$button}):Y.uninstall(this.$container)}setIconVisible(e){this.setProperty("iconVisible",e)}_renderIconVisible(){this.$button.toggleClass("icon-visible",!!this.iconVisible)}setDisplayStyle(e){this.setProperty("displayStyle",e)}_renderDisplayStyle(){this.$container.toggleClass("style-default",this.displayStyle===Bn.DisplayStyle.DEFAULT),this.$container.toggleClass("style-slider",this.displayStyle===Bn.DisplayStyle.SLIDER),this.invalidateLayoutTree()}setTabbable(e){this.setProperty("tabbable",e)}_renderTabbable(){let e=this.tabbable&&this.enabledComputed&&!w.get().supportsOnlyTouch();this.$container.setTabbable(e),this.$container.toggleClass("unfocusable",!!e)}_onSwitchMouseDown(e){e.button===0&&this.toggleSwitch(e)}toggleSwitch(e,t){if(!this.enabledComputed)return;let i=this.activated,s=u.nvl(t,!this.activated);this.trigger("switch",{originalEvent:e,oldValue:i,newValue:s}).defaultPrevented||this.setActivated(s),this.$container&&Y.cancel(this.$container)}}class bm extends K{constructor(){super(),this._addRemoteProperties(["activated"])}}class Uc extends B{constructor(e){super(),this.field=e,this.which=[m.LEFT,m.RIGHT],this.stopPropagation=!0,this.stopImmediatePropagation=!0,this.renderingHints.render=!1}handle(e){this.field.toggleSwitch(e,e.which!==m.LEFT)}}class Gc extends B{constructor(e){super(),this.field=e,this.which=[m.SPACE],this.stopPropagation=!0,this.stopImmediatePropagation=!0,this.renderingHints.$drawingArea=(t,i)=>this.field.$button}handle(e){this.field.toggleSwitch(e)}}class qt extends I{overflowEnabled;overflowVisible;tags;clickable;overflow;$overflowIcon;constructor(){super(),this.overflowEnabled=!0,this.$overflowIcon=null,this.overflowVisible=!1,this.overflow=null,this.tags=[],this.clickable=!1}_render(){this.$container=this.$parent.appendDiv("tag-bar"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Kc(this)),this._installTooltipSupport()}_renderProperties(){super._renderProperties(),this._renderTags(),this._renderOverflowVisible()}_remove(){this.$overflowIcon=null,this.overflowVisible=!1,this.closeOverflowPopup(),this._uninstallTooltipSupport(),super._remove()}setTags(e){this.setProperty("tags",e)}updateTags(){this.rendered&&this._renderTags()}_renderTags(){let e=p.ensure(this.tags);this.renderTags(this.$container,e),this.invalidateLayoutTree()}setClickable(e){this.setProperty("clickable",e)}_renderClickable(){this._renderTagsClickable(this.$container.children(".tag-element")),this.invalidateLayoutTree()}_onTagClick(e){let t=qt.getTagData(h()(e.currentTarget));return this._triggerTagClick(t),!1}_triggerTagClick(e){this.trigger("tagClick",{tag:e})}_renderEnabled(){super._renderEnabled(),this._renderTagsRemovable(this.$container.children(".tag-element")),this.invalidateLayoutTree()}_onTagRemoveClick(e){return this.enabledComputed&&this.removeTagByElement(h()(e.currentTarget)),!1}removeTagByElement(e){let t=qt.getTagData(e);t&&this._triggerTagRemove(t,e)}_triggerTagRemove(e,t){this.trigger("tagRemove",{tag:e,$tag:t})}_onOverflowIconMousedown(e){return this.toggleOverflowPopup(),!1}isOverflowIconFocused(){if(!this.$overflowIcon)return!1;let e=this.$container.activeElement();return this.$overflowIcon.is(e)}openOverflowPopup(){this.overflow||(this.$overflowIcon.addClass("selected"),this.overflow=this._createOverflowPopup(),this.overflow.open(),this.overflow.one("destroy",e=>{this.$overflowIcon&&this.$overflowIcon.removeClass("selected"),this.overflow=null}))}_createOverflowPopup(){return u.create(Vo,{parent:this,closeOnAnchorMouseDown:!1,focusableContainer:!0,$anchor:this.$overflowIcon,cssClass:this.cssClass})}closeOverflowPopup(){this.overflow&&this.overflow.close()}toggleOverflowPopup(){this.overflow?this.closeOverflowPopup():this.openOverflowPopup()}_installTooltipSupport(){Y.install(this.$container,{parent:this,selector:".tag-text",text:this._tagTooltipText.bind(this),arrowPosition:50,arrowPositionUnit:"%",nativeTooltip:!w.get().isCustomEllipsisTooltipPossible()})}_uninstallTooltipSupport(){Y.uninstall(this.$container)}_tagTooltipText(e){return e.isContentTruncated()?e.text():null}_removeFocusFromTagElements(){qt.findFocusableTagElements(this.$container).removeClass("focused").setTabbable(!1)}focus(e){return this.$container.addClass("focused"),this._removeFocusFromTagElements(),this.closeOverflowPopup(),!1}blur(){this.$container.removeClass("focused");let e=event.relatedTarget;this.overflow&&this.overflow.$container.has(e)||this.closeOverflowPopup()}setOverflowVisible(e){this.setProperty("overflowVisible",e)}_renderOverflowVisible(){this.overflowVisible?this.$overflowIcon||(this.$overflowIcon=this.$container.prependDiv("overflow-icon").on("mousedown",this._onOverflowIconMousedown.bind(this))):this.$overflowIcon&&(this.$overflowIcon.remove(),this.$overflowIcon=null)}visibleTags(){if(!this.rendered)return[];let e=[];return this.$container.find(".tag-element:not(.hidden)").each(function(){e.push(qt.getTagData(h()(this)))}),e}renderTags(e,t){e.find(".tag-element").remove(),t.forEach(s=>this.renderTag(e,s));let i=e.children(".tag-element");this._renderTagsClickable(i),this._renderTagsRemovable(i)}renderTag(e,t){let i=e.appendDiv("tag-element").data("tag",t);return i.appendSpan("tag-text",t),i}_renderTagsClickable(e){e.each((t,i)=>{let s=h()(i),r=s.children(".tag-text"),o=s.data("click-handler");this.clickable?o||(o=this._onTagClick.bind(this),s.data("click-handler",o),r.on("mousedown",o)):(r.off("mousedown",o),s.removeData("click-handler")),s.toggleClass("clickable",this.clickable)})}_renderTagsRemovable(e){e.each((t,i)=>{let s=h()(i),r=s.children(".tag-remove-icon"),o=s.data("remove-handler");this.enabledComputed?o||(o=this._onTagRemoveClick.bind(this),s.data("remove-handler",o),s.appendSpan("tag-remove-icon").on("click",o)):(r.off("click",o),r.remove(),s.removeData("remove-handler")),s.toggleClass("removable",this.enabledComputed)})}static findFocusedTagElement(e){return e.find(".tag-element.focused")}static findFocusableTagElements(e){return e.find(".tag-element:not(.hidden),.overflow-icon")}static focusFirstTagElement(e){this.focusTagElement(this.firstTagElement(e))}static firstTagElement(e){return e.find(".tag-element").first()}static focusTagElement(e){e.setTabbable(!0).addClass("focused").focus()}static unfocusTagElement(e){e.setTabbable(!1).removeClass("focused")}static getTagData(e){let t=e.data("tag");return t||e.parent().data("tag")}}class Kc extends ne{tagBar;constructor(e){super(),this.tagBar=e}layout(e){let t=x.get(e);if(!(this.tagBar.tags&&this.tagBar.tags.length>0))return;let r=t.availableSize().subtract(t.insets()).width,o=0,l=!1,a,d,c=e.find(".tag-element"),f=c.length,g=[];for(c.removeClass("hidden"),d=f-1;d>=0&&(a=h()(c[d]),g[d]=C.size(a,{includeMargin:!0}),l=o+g[d].width>r,!l);d--)o+=g[d].width;if(this.tagBar.setOverflowVisible(l),l)for(o=C.size(this.tagBar.$overflowIcon,{includeMargin:!0}).width,d=f-1;d>=0;d--){if(a=h()(c[d]),!g[d]){a.addClass("hidden");continue}o+g[d].width>r?a.addClass("hidden"):o+=g[d].width}}preferredLayoutSize(e,t){let i=x.get(e),s=this.tagBar.tags&&this.tagBar.tags.length>0,r=i.availableSize(),o=0,l=0;if(!s)return new F(0,r.height);let a=e.find(".tag-element");return a.removeClass("hidden"),a.each((d,c)=>{let f=C.size(h()(c),{includeMargin:!0});o+=f.width,l=Math.max(f.height,l)}),new F(o,l).add(i.insets())}}class Vo extends _e{$body;_tagBarPropertyChangeListener;constructor(){super(),this.windowPaddingX=0,this.windowPaddingY=0,this._tagBarPropertyChangeListener=null,this.initialFocus=function(){return qt.firstTagElement(this.$body).setTabbable(!0).addClass("focused")[0]}}_init(e){super._init(e),this._tagBarPropertyChangeListener=this._onTagBarPropertyChange.bind(this),this.parent.on("propertyChange",this._tagBarPropertyChangeListener)}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new ba(this._createFieldAdapter()),new _a(this._createFieldAdapter())])}_destroy(){this.parent.off("propertyChange",this._tagBarPropertyChangeListener),super._destroy()}_render(){super._render(),this.$container.addClass("tag-overflow-popup"),this.$body=this.$container.appendDiv("popup-body")}_createLayout(){return new jc(this)}_renderProperties(){super._renderProperties(),this._renderTags()}_renderTags(){let e=this.parent,t=e.visibleTags(),s=p.ensure(e.tags).filter(r=>t.indexOf(r)===-1);e.renderTags(this.$body,s),this.rendering||this.invalidateLayoutTree()}_focusFirstTagElement(){qt.focusFirstTagElement(this.$body)}_onTagBarPropertyChange(e){if(e.propertyName==="tags"){let t=p.ensure(this.parent.tags),i=this.parent.visibleTags(),s=t.length;s===0||s===i.length?this.close():(this._renderTags(),this._focusFirstTagElement())}}_createFieldAdapter(){return Vo.createFieldAdapter(this)}static createFieldAdapter(e){return{$container:()=>e.$body,enabled:()=>!0,focus:()=>{},removeTag:t=>{e.parent.parent.removeTag(t)}}}}class jc extends xi{preferredLayoutSize(e,t){let i=super.preferredLayoutSize(e,t);return i.width=C.size(this.popup.$body,{exact:!0}).width,i.width+=this.popup.htmlComp.insets().horizontal(),i}}class $t extends I{animateBoundsChange;colorScheme;displayStyle;gridData;gridDataHints;rowId;selected;selectable;movable;movableProducer;resizable;resizableProducer;plainText;constructor(){super(),this.animateBoundsChange=!0,this.displayStyle=$t.DisplayStyle.DEFAULT,this.gridData=null,this.rowId=null,this.gridDataHints=new ke,this.colorScheme=null,this.selected=!1,this.selectable=!1,this.movable=!1,this.resizable=!1,this.plainText=null,this.animateRemoval=null,this._addPropertyDimensionAlias("visible","filterAccepted")}static DisplayStyle={DEFAULT:"default",PLAIN:"plain"};_createLoadingSupport(){return new Ut({widget:this})}_init(e){super._init(e),this._setGridDataHints(this.gridDataHints),this._setColorScheme(this.colorScheme),this._setSelectable(this.selectable)}_render(){this.$container=this.$parent.appendDiv("tile"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new ji)}_renderProperties(){super._renderProperties(),this._renderColorScheme(),this._renderSelectable(),this._renderSelected(),this._renderDisplayStyle()}_renderEnabled(){super._renderEnabled(),this._renderMovable(),this._renderResizable()}_postRender(){this.$container.addClass("tile"),this.htmlComp.layout.animateClasses=["animate-visible","animate-invisible","animate-insert","animate-remove"]}_renderDisplayStyle(){this.$container.toggleClass("default-tile",this.displayStyle===$t.DisplayStyle.DEFAULT)}setGridDataHints(e){this.setProperty("gridDataHints",e)&&this.rendered&&this.parent.invalidateLogicalGrid()}_setGridDataHints(e){this._setProperty("gridDataHints",ke.ensure(e||new ke))}_setGridData(e){this._setProperty("gridData",ke.ensure(e||new ke))}setColorScheme(e){this.setProperty("colorScheme",e)}_setColorScheme(e){let t={scheme:dt.ColorSchemeId.DEFAULT,inverted:!1};e=dt.ensureColorScheme(e,!0),e=h().extend({},t,e),this._setProperty("colorScheme",e)}_renderColorScheme(){dt.toggleColorSchemeClasses(this.$container,this.colorScheme)}setSelected(e){e&&!this.selectable||this.setProperty("selected",e)}_renderSelected(){this.$container.toggleClass("selected",this.selected)}setSelectable(e){this.setProperty("selectable",e)}_setSelectable(e){this._setProperty("selectable",e),this.selectable||this.setSelected(!1)}_renderSelectable(){this.$container.toggleClass("selectable",this.selectable)}setMovableProducer(e){this.setProperty("movableProducer",e)}_renderMovableProducer(){this._removeMovable(),this._renderMovable()}setMovable(e){this.setProperty("movable",e)}_renderMovable(){let e=this.$container.data("movable");if(this.movable&&this.enabledComputed){if(e||(e=this.movableProducer&&this.movableProducer(),!e))return;this.$container.data("movable",e)}else this._removeMovable()}_removeMovable(){let e=this.$container.data("movable");e&&(e.destroy(),this.$container.removeData("movable"))}setResizableProducer(e){this.setProperty("resizableProducer",e)}_renderResizableProducer(){this._removeResizable(),this._renderResizable()}setResizable(e){this.setProperty("resizable",e)}_renderResizable(){let e=this.$container.data("resizable");if(this.resizable&&this.enabledComputed){if(e||(e=this.resizableProducer&&this.resizableProducer(),!e))return;this.$container.data("resizable",e)}else this._removeResizable()}_removeResizable(){let e=this.$container.data("resizable");e&&(e.destroy(),this.$container.removeData("resizable"))}setFilterAccepted(e){this.setProperty("filterAccepted",e)}get filterAccepted(){return this.getProperty("filterAccepted")}_renderVisible(){if(this.rendering){this.$container.setVisible(this.visible);return}this.removalPending||(this.visible?(this.$container.addClass("invisible"),this.$container.setVisible(!0),this.session.layoutValidator.schedulePostValidateFunction(()=>{!this.rendered||!this.visible||(this.$container.removeClass("invisible animate-invisible"),this.$container.addClassForAnimation("animate-visible"),this.$container.oneAnimationEnd(()=>{P.update(this.parent.get$Scrollable())}))})):(this.$container.removeClass("invisible animate-visible"),this.$container.addClassForAnimation("animate-invisible"),this.$container.oneAnimationEnd(()=>{this.$container.setVisible(this.visible),P.update(this.parent.get$Scrollable())})),this.invalidateParentLogicalGrid())}markAsActiveDescendantFor(e){T.linkElementWithActiveDescendant(e,this.$container)}}class qc{objectType;tileGrid;$container;moveSupport;_mouseDownHandler;constructor(e){u.assertParameter("model",e),u.assertParameter("$container",e.$container),this.$container=e.$container,this.tileGrid=e.tileGrid,this._mouseDownHandler=this._onMouseDown.bind(this)}init(){this.$container.addClass("movable"),this.$container.on("mousedown touchstart",this._mouseDownHandler)}destroy(){this.$container&&(this.$container.removeClass("movable"),this.$container.off("mousedown touchstart",this._mouseDownHandler))}_onMouseDown(e){if(h()(e.target).hasClass("resizable-handle"))return;let i=u.widget(h()(e.currentTarget)),s=new Zc(this.tileGrid);s.start(e,this.tileGrid.tiles,i)&&(this.moveSupport=s)}}class On extends K{}const Yc="> .tile";class hr extends I{animateTileRemoval;animateTileInsertion;comparator;contextMenu;empty;filters;filteredElementsDirty;focusedTile;gridColumnCount;prefGridColumnCount;layoutConfig;menus;multiSelect;renderAnimationEnabled;selectable;selectedTiles;selectionHandler;scrollable;startupAnimationDone;startupAnimationEnabled;tileRemovalPendingCount;viewRangeSize;viewRangeRendered;virtual;virtualScrolling;withPlaceholders;placeholderProducer;textFilterEnabled;filterSupport;createTextFilter;updateTextFilterText;defaultMenuTypes;wrappable;movableProducer;resizableProducer;$filterFieldContainer;$fillBefore;$fillAfter;_tiles;_filteredTiles;_doubleClickSupport;_filterMenusHandler;_renderViewPortAfterAttach;_scrollParentScrollHandler;constructor(){super(),this.animateTileRemoval=!0,this.animateTileInsertion=!0,this.comparator=null,this.contextMenu=null,this._doubleClickSupport=new R,this.empty=!1,this.filters=[],this._filteredTiles=[],this.filteredElementsDirty=!0,this.focusedTile=null,this.gridColumnCount=4,this.prefGridColumnCount=this.gridColumnCount,this.logicalGrid=u.create(Pr),this.layoutConfig=null,this.menus=[],this.multiSelect=!0,this.renderAnimationEnabled=!1,this.selectable=!1,this.selectedTiles=[],this.selectionHandler=new wa(this),this.scrollable=!0,this.startupAnimationDone=!1,this.startupAnimationEnabled=!1,this._tiles=[],this.tileRemovalPendingCount=0,this.viewRangeSize=0,this.viewRangeRendered=new U(0,0),this.virtual=!1,this.virtualScrolling=null,this.withPlaceholders=!1,this.placeholderProducer=null,this.wrappable=!0,this.movableProducer=this._createMovableProducer(),this.resizableProducer=this._createResizableProducer(),this.$filterFieldContainer=null,this.textFilterEnabled=!1,this.filterSupport=this._createFilterSupport(),this.createTextFilter=null,this.updateTextFilterText=null,this.defaultMenuTypes=[hr.MenuType.EmptySpace],this._filterMenusHandler=this._filterMenus.bind(this),this._renderViewPortAfterAttach=!1,this._scrollParentScrollHandler=this._onScrollParentScroll.bind(this),this._addWidgetProperties(["tiles","selectedTiles","menus"]),this._addPreserveOnPropertyChangeProperties(["selectedTiles"]),this._addComputedProperties(["tiles","filteredTiles"]),this.$fillBefore=null,this.$fillAfter=null}static MenuType={EmptySpace:"TileGrid.EmptySpace",SingleSelection:"TileGrid.SingleSelection",MultiSelection:"TileGrid.MultiSelection"};_init(e){super._init(e),this._setGridColumnCount(this.gridColumnCount),this._setLayoutConfig(this.layoutConfig),this._initVirtualScrolling(),this._initTiles(),this.setFilters(this.filters,!1),this.filter(),this._setMenus(this.menus),this._sortWhileInit(),this.updateFilteredElements()}_createKeyStrokeContext(){return new Ee}_createMovableProducer(){return e=>u.create(qc,{tileGrid:this,$container:e.$container})}setMovableProducer(e){this.setProperty("movableProducer",e)}_createResizableProducer(){return e=>u.create(ep,{tileGrid:this,$container:e.$container,useOverlay:!0})}setResizableProducer(e){this.setProperty("resizableProducer",e)}_initVirtualScrolling(){this.virtualScrolling=this._createVirtualScrolling()}_createVirtualScrolling(){return new kh({widget:this,enabled:this.virtual,viewRangeSize:this.viewRangeSize,rowHeight:this._heightForRow.bind(this),rowCount:this.rowCount.bind(this),_renderViewRange:this._renderViewRange.bind(this)})}_createLoadingSupport(){return new Ut({widget:this})}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStrokes([new op(this),new lp(this),new ap(this),new hp(this),new dp(this),new up(this),new cp(this),new pl(this,this.showContextMenu,this)])}_initTiles(){this._tiles.forEach(e=>{this._initTile(e)})}_initTile(e){e.setSelectable(this.selectable),e.setSelected(this.selectedTiles.indexOf(e)>=0),e.setMovableProducer(()=>this.movableProducer(e)),e.setResizableProducer(()=>this.resizableProducer(e)),e.setParent(this),e.setFilterAccepted(!0)}_render(){this.$container=this.$parent.appendDiv("tile-grid"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout()),this.$container.on("mousedown",Yc,this._onTileMouseDown.bind(this)).on("click",Yc,this._onTileClick.bind(this)).on("dblclick",Yc,this._onTileDoubleClick.bind(this)),this.$filterFieldContainer=this.$container.prependDiv("filter-field-container")}_createLayout(){return new Qc(this,this.layoutConfig)}_renderProperties(){super._renderProperties(),this._renderLayoutConfig(),this._renderScrollable(),this._renderVirtual(),this._renderSelectable(),this._renderEmpty(),this._renderTextFilterEnabled()}_remove(){this.$fillBefore=null,this.$fillAfter=null,this.filterSupport.remove(),this.viewRangeRendered=new U(0,0),this._updateVirtualScrollable(),super._remove()}_renderOnAttach(){super._renderOnAttach(),this._renderViewPortAfterAttach&&(this._renderViewPort(),this._renderViewPortAfterAttach=!1)}_renderEnabled(){super._renderEnabled(),this._updateTabbable()}_updateTabbable(){!this.textFilterEnabled&&!this.selectable?this.$container.setTabbable(!1):this.$container.setTabbableOrFocusable(this.enabledComputed)}insertTile(e){this.insertTiles([e])}insertTiles(e){this._insertTilesInternal(e)}_insertTilesInternal(e,t){if(e=p.ensure(e),e.length===0)return;let i=this._tiles;this._setTilesInternal(i.concat(e),t)}deleteTile(e){this.deleteTiles([e])}deleteTiles(e){this._deleteTilesInternal(e)}_deleteTilesInternal(e,t){if(e=p.ensure(e),e.length===0)return;let i=this._tiles.slice();p.removeAll(i,e),this._setTilesInternal(i,t)}deleteAllTiles(){this.setTiles([])}moveTileBefore(e,t){let i=p.moveBefore(this._tiles,e,t);this._setTilesInternal(i)}moveTileAfter(e,t){let i=p.moveAfter(this._tiles,e,t);this._setTilesInternal(i)}setTiles(e){this._setTilesInternal(e)}_setTilesInternal(e,t){let i=p.ensure(e);if(b.equals(this._tiles,e))return;let s=this._createChildren(i);this.withPlaceholders&&u.nvl(t,!0)&&this._deletePlaceholders(s);let r=p.diff(s,this._tiles);if(this._insertTiles(r),this.withPlaceholders&&u.nvl(t,!0)){let a=this.placeholders();a=a.slice(Math.min(this._filterTiles(r).length,a.length),a.length),p.pushAll(s,a)}let o=p.diff(this._tiles,s);this._deleteTiles(o),this._sort(s),this.filteredElementsDirty=this.filteredElementsDirty||o.length>0||r.length>0||!p.equals(this._tiles,s);let l=this._tiles;this._setProperty("tiles",s),this.updateFilteredElements(),this.rendered&&(this._renderTileDelta(),this._renderTileOrder(l),this._renderInsertTiles(r))}_insertTiles(e){e.length!==0&&e.forEach(t=>{this._insertTile(t)})}_insertTile(e){this._initTile(e),this._applyFilters([e]),!this.virtual&&this.rendered&&this._renderTile(e)}_renderTile(e){if(e.removalPending){e.one("remove",()=>{e.rendered||(this._renderTile(e),this._renderTileVisibleForFilter(e),this.tileRemovalPendingCount===0&&this.invalidateLayoutTree())});return}e.render(),e.setLayoutData(new Sr(e)),e.$container.addClass("newly-rendered")}_renderInsertTiles(e){this.animateTileInsertion&&this._animateInsertTiles(e),this.htmlComp.layouting||this.invalidateLayoutTree()}_animateInsertTiles(e){for(let t of e)t.rendered&&(t.$container.addClass("before-animate-insert"),this.one("layoutAnimationDone",()=>{t.rendered&&(t.$container.removeClass("before-animate-insert"),this._animateTileInsertion(t)&&t.$container.addClassForAnimation("animate-insert"))}))}_removeAllTiles(){this._tiles.forEach(e=>{e.remove()}),this.viewRangeRendered=new U(0,0)}_renderAllTiles(){this._tiles.forEach(e=>{this._renderTile(e)})}_deleteTiles(e){e.length!==0&&(e.forEach(t=>{this._deleteTile(t)}),this.deselectTiles(e),this.rendered&&!this.htmlComp.layouting&&this.invalidateLayoutTree())}_deleteTile(e){this._animateTileRemoval(e)&&(e.animateRemoval=!0),e.owner===this?e.destroy():this.rendered&&e.remove(),this._onAnimatedTileRemove(e),e.animateRemoval=!1,e===this.focusedTile&&this.setFocusedTile(null)}_animateTileRemoval(e){return this.animateTileRemoval&&e&&e.visible&&!(e instanceof Yt)&&e.animateRemoval!==!1}_animateTileInsertion(e){return this.animateTileInsertion&&e&&e.visible&&!(e instanceof Yt)}_onAnimatedTileRemove(e){e.removalPending&&(this.tileRemovalPendingCount++,e.one("remove",()=>{this.tileRemovalPendingCount--,this.rendered&&this.tileRemovalPendingCount===0&&!this.htmlComp.layouting&&this.invalidateLayoutTree()}))}setComparator(e){this.comparator!==e&&(this.comparator=e)}_sortWhileInit(){this.sort()}sort(){let e=this._tiles.slice();if(this._sort(e),p.equals(this._tiles,e))return;let t=this._tiles;this._setProperty("tiles",e),this.filteredElementsDirty=!0,this.updateFilteredElements(),this.rendered&&(this._renderTileDelta(),this._renderTileOrder(t))}_sort(e){if(this.comparator===null)return;let t=[];this.withPlaceholders&&(t=this._deletePlaceholders(e)),e.sort(this.comparator),p.pushAll(e,t)}invalidateLayoutTree(e){this.tileRemovalPendingCount>0||super.invalidateLayoutTree(e)}setGridColumnCount(e){this.setProperty("gridColumnCount",e)}_setGridColumnCount(e){this._setProperty("gridColumnCount",e),this.prefGridColumnCount=e,this.invalidateLogicalGrid()}setLayoutConfig(e){this.setProperty("layoutConfig",e)}_setLayoutConfig(e){this._setProperty("layoutConfig",Nt.ensure(e||{})),kt.initHtmlEnvChangeHandler(this,()=>this.layoutConfig,t=>this.setLayoutConfig(t))}_renderLayoutConfig(){let e=this.htmlComp.layout,t=e.minWidth;this.layoutConfig.applyToLayout(e),this.virtualScrolling&&(this.virtualScrolling.setMinRowHeight(this._minRowHeight()),this.setViewRangeSize(this.virtualScrolling.viewRangeSize,!1)),t!==e.minWidth&&this._renderScrollable(),this.invalidateLayoutTree()}_setMenus(e){this.updateKeyStrokes(e,this.menus),this._setProperty("menus",e)}_filterMenus(e,t,i,s,r){return $e.filterAccordingToSelection("TileGrid",this.selectedTiles.length,e,t,{onlyVisible:i,enableDisableKeyStrokes:s,notAllowedTypes:r,defaultMenuTypes:this.defaultMenuTypes})}showContextMenu(e){this.session.onRequestsDone(this._showContextMenu.bind(this,e))}_showContextMenu(e){if(e=e||{},!this.rendered||!this.attached||this.selectedTiles.length===0)return;let t=e.menuItems||this._filterMenus(this.menus,Ft.CONTEXT_MENU,!0,!1);if(t.length===0)return;let i=u.nvl(e.pageX,null),s=u.nvl(e.pageY,null);if(i===null||s===null){let r,o=this.$container.scrollParent();o.length===0&&(o=this.$container);let l=C.offsetBounds(o),a=this.focusedTile||p.last(this.selectedTiles);this.isTileInView(a)?r=a.$container.offset():r=this.$container.offset(),i=r.left+10,s=r.top+10,i=Math.min(Math.max(i,l.x+1),l.right()-1),s=Math.min(Math.max(s,l.y+1),l.bottom()-1)}this.contextMenu&&this.contextMenu.close(),this.contextMenu=u.create(bt,{parent:this,menuItems:t,location:{x:i,y:s},$anchor:this.$container,menuFilter:e.menuFilter||this._filterMenusHandler}),this.contextMenu.open()}setScrollable(e){this.setProperty("scrollable",e)}_renderScrollable(){this._uninstallScrollbars(),this.scrollable?this._installScrollbars({axis:this.layoutConfig.minWidth>0?"both":"y"}):this.layoutConfig.minWidth>0&&this._installScrollbars({axis:"x"}),this.$container.toggleClass("scrollable",this.scrollable),this._updateVirtualScrollable(),this.invalidateLayoutTree()}_onScroll(e){let t=this.$container[0].scrollTop,i=this.$container[0].scrollLeft;this.scrollTop!==t&&this.virtual&&this.htmlComp.layout.updateViewPort(),this.scrollTop=t,this.scrollLeft=i}_onScrollParentScroll(e){this.htmlComp.layout.updateViewPort()}setWithPlaceholders(e){this.setProperty("withPlaceholders",e)}_renderWithPlaceholders(){this.invalidateLayoutTree()}setPlaceholderProducer(e){this.setProperty("placeholderProducer",e)}fillUpWithPlaceholders(){if(!this.withPlaceholders){this._deleteAllPlaceholders();return}this._deleteObsoletePlaceholders(),this._insertMissingPlaceholders()}tilesWithoutPlaceholders(){return this.tiles}get tiles(){return this._tilesWithoutPlaceholders(this._tiles)}get filteredTiles(){return this._tilesWithoutPlaceholders(this._filteredTiles)}_tilesWithoutPlaceholders(e){return this.withPlaceholders?e.filter(t=>!(t instanceof Yt)):e}getFilteredTilesWithPlaceholders(){return this._filteredTiles}_createPlaceholders(){let e,t,i=this.gridColumnCount,s=this._filteredTiles,r=[];if(s.length>0){let o=s[s.length-1];t=o.gridData.x+o.gridData.w-1}else t=-1;if(t===i-1)return[];e=i-1-t;for(let o=0;o<e;o++)r.push(this._createPlaceholder());return r}_createPlaceholder(){let e=this.placeholderProducer&&this.placeholderProducer()||{};if(e instanceof Yt)return e;if(b.isObject(e))return u.create(h().extend(!0,{},{objectType:Yt,parent:this},e));throw new Error("Placeholder producer returned unexpected result.")}_deleteObsoletePlaceholders(){let e=[],t=!1;this.placeholders().forEach(s=>{s.gridData.x===0&&this._filteredTiles[0]!==s&&(t=!0),t&&e.push(s)}),this._deleteTilesInternal(e,!1)}_deleteAllPlaceholders(){this._deleteTilesInternal(this.placeholders(),!1)}placeholders(){let e,t=[];for(e=this._tiles.length-1;e>=0&&this._tiles[e]instanceof Yt;e--)p.insert(t,this._tiles[e],0);return t}_insertMissingPlaceholders(){let e=this._createPlaceholders();this._insertTilesInternal(e,!1)}_deletePlaceholders(e){let t,i=[];for(t=e.length-1;t>=0;t--)e[t]instanceof Yt&&(i.push(e[t]),p.remove(e,e[t]));return i.reverse()}validateLogicalGrid(){this.logicalGrid.dirty&&(this.logicalGrid.validate(this),this.fillUpWithPlaceholders(),this.logicalGrid.setDirty(!0),this.logicalGrid.validate(this))}_setLogicalGrid(e){super._setLogicalGrid(e),this.logicalGrid&&this.logicalGrid.setGridConfig(new Jc)}setFocusedTile(e){this.focusedTile===e||(this.focusedTile=e,e?e.markAsActiveDescendantFor(this.$container):T.removeActiveDescendant(this.$container),!this.rendered||!e||this.isFocused())||this.$container.scrollParents().length===0||this.focus({preventScroll:!0})}setSelectable(e){this.setProperty("selectable",e),e||this.deselectAllTiles(),this._tiles.forEach(t=>{t.setSelectable(e)})}_renderSelectable(){this.$container.toggleClass("selectable",this.selectable),this._updateTabbable(),this.invalidateLayoutTree()}setMultiSelect(e){this.setProperty("multiSelect",e)}selectTiles(e){let t=this._createChildren(p.ensure(e));if(t=this._filterTiles(this._tilesWithoutPlaceholders(t)),this.selectable||(t=[]),!this.multiSelect&&t.length>1&&(t=[t[0]]),p.equals(this.selectedTiles,t))return;let i=this.selectedTiles;p.removeAll(i,t),i.forEach(s=>{s.setSelected(!1),s===this.focusedTile&&this.setFocusedTile(null)}),t.forEach(s=>{s.setSelected(!0)}),this.setProperty("selectedTiles",t.slice())}selectTile(e){this.selectTiles([e])}selectAllTiles(){this.selectTiles(this.filteredTiles)}deselectTiles(e){e=p.ensure(e);let t=this.selectedTiles.slice();p.removeAll(t,e)&&this.selectTiles(t)}deselectTile(e){this.deselectTiles([e])}deselectAllTiles(){this.selectTiles([])}toggleSelection(){this.selectedTiles.length===this._filteredTiles.length?this.deselectAllTiles():this.selectAllTiles()}addTilesToSelection(e){e=p.ensure(e),this.selectTiles(this.selectedTiles.concat(e))}addTileToSelection(e){this.addTilesToSelection([e])}isTileSelected(e){return this.selectedTiles.includes(e)}isTileInView(e){let t=this.$container.scrollParent();return t.length===0&&(t=this.$container),!e||!e.$container||!t?!1:C.offsetBounds(e.$container).intersects(C.offsetBounds(t))}setWrappable(e){this.setProperty("wrappable",e)}_onTileMouseDown(e){if(this._doubleClickSupport.mousedown(e),this._selectTileOnMouseDown(e),e.which===3)return this.showContextMenu({pageX:e.pageX,pageY:e.pageY}),!1}_onTileClick(e){let i=h()(e.currentTarget).data("widget");if(i instanceof Yt||this._doubleClickSupport.doubleClicked())return;let s=e.which;this._triggerTileClick(i,s,e)}_triggerTileClick(e,t,i){this.trigger("tileClick",{tile:e,mouseButton:t,originalEvent:i})}_onTileDoubleClick(e){let i=h()(e.currentTarget).data("widget");i instanceof Yt||this.doTileAction(i)}doTileAction(e){e&&this._triggerTileAction(e)}_triggerTileAction(e){this.trigger("tileAction",{tile:e})}setSelectionHandler(e){this.selectionHandler=e}_selectTileOnMouseDown(e){this.selectionHandler.selectTileOnMouseDown(e)}scrollTo(e,t){this.ensureTileRendered(e),this.htmlComp.layout.updateViewPort(!0),e.reveal(t)}revealSelection(){if(!this.rendered){this.session.layoutValidator.schedulePostValidateFunction(this.revealSelection.bind(this));return}this.selectedTiles.length>0&&this.scrollTo(this.selectedTiles[0])}addFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.addFilter(e,t)}removeFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.removeFilter(e,t)}setFilters(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.setFilters(e,t)}filter(){this.filterSupport.filter()}_applyFilters(e,t){return this.filterSupport.applyFilters(this._tilesWithoutPlaceholders(e),t)}_createFilterSupport(){return new Ti({widget:this,$container:()=>this.$filterFieldContainer,getElementsForFiltering:()=>this.tiles,createTextFilter:this._createTextFilter.bind(this),updateTextFilterText:this._updateTextFilterText.bind(this)})}_createTextFilter(){return b.isFunction(this.createTextFilter)?this.createTextFilter():new Hn}_updateTextFilterText(e,t){return b.isFunction(this.updateTextFilterText)?this.updateTextFilterText(e,t):e instanceof Hn?e.setText(t):!1}setTextFilterEnabled(e){this.setProperty("textFilterEnabled",e)}isTextFilterFieldVisible(){return this.textFilterEnabled}_renderTextFilterEnabled(){this._updateTabbable(),this.filterSupport.renderFilterField()}updateFilteredElements(e,t){if(!this.filteredElementsDirty){this._updateEmpty();return}this.setProperty("filteredTiles",this._filterTiles()),this.invalidateLogicalGrid(!1),this.filteredElementsDirty=!1,e&&(e.newlyHidden.some(i=>i===this.focusedTile)&&this.setFocusedTile(null),this.deselectTiles(e.newlyHidden),this.rendered&&!this.removing&&(this._renderTileDelta(e),this._renderTileOrder(this._tiles))),this._updateEmpty()}_updateEmpty(){this.setEmpty(this._filteredTiles.length===0)}setEmpty(e){this.setProperty("empty",e)}_renderEmpty(){this.$container.toggleClass("empty",this.empty),this.invalidateLayoutTree()}_filterTiles(e){return e=u.nvl(e,this._tiles),this.filters.length===0?e.slice():e.filter(t=>t.filterAccepted)}findTileIndexAt(e,t,i,s){return i=u.nvl(i,0),p.findIndexFrom(this._filteredTiles,i,(r,o)=>r.gridData.toRectangle().contains(e,t),s)}findTilesInRange(e,t){return this._findTilesInRange(e,t,!1)}_findTilesInRange(e,t,i){if(i=u.nvl(i,!0),e.equals(this.virtualScrolling.maxViewRange()))return i?this._filteredTiles:this.filteredTiles;let s=[];for(let r=e.from;r<e.to;r++)this._eachTileInRow(r,o=>{(!t||o instanceof Yt||t(o))&&s.push(o)},i);return s}findTilesInRow(e){return this._findTilesInRow(e,!1)}_findTilesInRow(e,t){let i=[];return this._eachTileInRow(e,s=>{i.push(s)},t),i}eachTileInRow(e,t){return this._eachTileInRow(e,t,!1)}_eachTileInRow(e,t,i){let s=e*this.gridColumnCount,r=[];for(let o=s;o<s+this.gridColumnCount;o++){let l=this._filteredTiles[o];!u.nvl(i,!0)&&l instanceof Yt||this._filteredTiles[o]&&t(this._filteredTiles[o],o)}return r}setVirtual(e){this.setProperty("virtual",e)}_setVirtual(e){this._setProperty("virtual",e),this.virtualScrolling.setEnabled(this.virtual)}_renderVirtual(){this._updateVirtualScrollable(),this.rendering||this.setViewRangeSize(this.calculateViewRangeSize(),!1),this.rendered&&(this._removeAllTiles(),this.virtual&&this._renderFiller()),this.virtual||this._renderAllTiles(),this._renderViewPort(),this.invalidateLayoutTree()}_updateVirtualScrollable(){let e=this.virtualScrolling.$scrollable;if(e&&e.off("scroll",this._scrollParentScrollHandler),!this.virtual||this.removing){this.virtualScrolling.set$Scrollable(null);return}this.scrollable?this.virtualScrolling.set$Scrollable(this.$container):(this.virtualScrolling.set$Scrollable(this.$container.scrollParent()),this.virtualScrolling.$scrollable.on("scroll",this._scrollParentScrollHandler))}calculateViewRangeSize(){return this.virtualScrolling.calculateViewRangeSize()}setViewRangeSize(e,t){this.viewRangeSize!==e&&(this._setProperty("viewRangeSize",e),this.virtualScrolling.setViewRangeSize(e,t))}_heightForRow(e){let t=0,i=this.htmlComp.layout;if(t=i.rowHeight,e!==this.rowCount()-1&&(t+=i.vgap),!Se.isNumber(t))throw new Error("Calculated height is not a number: "+t);return t}_minRowHeight(){let e=this.htmlComp.layout;return e.rowHeight+e.vgap/2}rowCount(e){return e=u.nvl(e,this.gridColumnCount),Math.ceil(this._filteredTiles.length/e)}_renderViewPort(){if(!this.isAttachedAndRendered()){this._renderViewPortAfterAttach=!0;return}this.virtual&&this.virtualScrolling.renderViewPort()}_renderViewRange(e){if(e.equals(this.viewRangeRendered)){e.size()===0&&this._renderFiller();return}this.viewRangeRendered.subtract(e).filter(s=>s.size()>0).forEach(s=>{this._removeTilesInRange(s)}),e.subtract(this.viewRangeRendered).filter(s=>s.size()>0).forEach(s=>{this._renderTilesInRange(s)}),this._renderFiller()}_renderTilesInRange(e){let t=0,i=0;if(this._filteredTiles.length===0)return;e=this.virtualScrolling.maxViewRange().intersect(e);let o=this.viewRangeRendered.union(e);if(o.length===2)throw new Error("Can only prepend or append rows to the existing range. Existing: "+this.viewRangeRendered+". New: "+o);this.viewRangeRendered=o[0];for(let a=e.from;a<e.to;a++)this._eachTileInRow(a,l.bind(this)),t++;h().log.isTraceEnabled()&&(h().log.trace(t+" new rows rendered from "+e),h().log.trace(this._rowsRenderedInfo()));function l(a){a.rendered||(this._renderTile(a),i++)}}_renderTileDelta(e){if(!this.virtual)return[];let t=this.renderedTiles(!0),i=this.virtualScrolling.calculateCurrentViewRange(),s=this._findTilesInRange(i),r=p.diff(t,s),o=p.diff(s,t);return e&&e.newlyHidden.forEach(l=>{l.rendered&&this._removeTileByFilter(l)}),r.forEach(l=>{l.remove()}),o.forEach(l=>{this._renderTile(l)}),e&&(this.htmlComp.suppressInvalidate=!0,e.newlyShown.forEach(l=>{l.rendered&&this._renderTileVisibleForFilter(l)}),this.htmlComp.suppressInvalidate=!1),this.viewRangeRendered=i,this._renderFiller(),this.htmlComp.layouting||this.invalidateLayoutTree(),o}_removeTileByFilter(e){e.$container.removeClass("animate-invisible"),e.animateRemoval=!0,e.animateRemovalClass="animate-invisible",e.remove(),this._onAnimatedTileRemove(e),e.animateRemoval=!1,setTimeout(()=>{e.animateRemovalClass="animate-remove"})}_renderTileVisibleForFilter(e){!e.filterAccepted||e.$container.hasClass("animate-visible")||e.removalPending||(e.$container.setVisible(!1),e._renderVisible())}_renderTileOrder(e){let t=!1;this._tiles.forEach((i,s)=>{if(e[s]!==i||t){if(this.virtual&&!i.rendered)return;t=!0,i.$container.appendTo(this.$container)}}),t&&!this.virtual&&this.invalidateLayoutTree()}_rowsRenderedInfo(){let e=this.$container.children(".tile").length,t="("+this.viewRangeRendered+")";return e+" tiles rendered in range "+t}_removeTilesInRange(e){let t=0,i=this.viewRangeRendered.subtract(e);if(i.length===2)throw new Error("Can only remove rows at the beginning or end of the existing range. "+this.viewRangeRendered+". New: "+i);this.viewRangeRendered=i[0];for(let s=e.from;s<e.to;s++)this._removeTilesInRow(s),t++;h().log.isTraceEnabled()&&(h().log.trace(t+" rows removed from "+e+"."),h().log.trace(this._rowsRenderedInfo()))}_removeTilesInRow(e){this._findTilesInRow(e).forEach(i=>{i.remove()})}ensureTileRendered(e){if(!e.rendered){let t=e.gridData.y;this.virtualScrolling.renderViewRangeForRowIndex(t),this.invalidateLayoutTree()}}_renderFiller(){this.$fillBefore||(this.$fillBefore=this.$container.prependDiv("filler"));let e=this._calculateFillerHeight(new U(0,this.viewRangeRendered.from));this.$fillBefore.cssHeight(e),this.$fillBefore.css("width","100%"),h().log.isTraceEnabled()&&h().log.trace("FillBefore height: "+e),this.$fillAfter||(this.$fillAfter=this.$container.appendDiv("filler")),this.$fillAfter.appendTo(this.$container);let t=this._calculateFillerHeight(new U(this.viewRangeRendered.from,this.viewRangeRendered.to));this.$fillAfter.cssTop(e+t);let i=this._calculateFillerHeight(new U(this.viewRangeRendered.to,this.rowCount()));this.$fillAfter.cssHeight(i),this.$fillAfter.css("width","100%"),h().log.isTraceEnabled()&&h().log.trace("FillAfter height: "+i)}_calculateFillerHeight(e){let t=0;for(let i=e.from;i<e.to;i++)t+=this._heightForRow(i);return t}renderedTiles(e){if(!this.rendered)return[];if(e=u.nvl(e,!1),!this.virtual)return e?this._filteredTiles:this.filteredTiles;let t=[];return this.$container.children(".tile").each((i,s)=>{let r=u.widget(s);!e&&r instanceof Yt||r.removalPending||t.push(r)}),t}swapTileBounds(e,t){let i=b.extractProperties(e.gridDataHints,{},["x","y","w","h"]),s=b.extractProperties(t.gridDataHints,{},["x","y","w","h"]),r=[...this.tiles];p.swap(r,t,e),t.setGridDataHints(t.gridDataHints.clone(i)),e.setGridDataHints(e.gridDataHints.clone(s)),this.setTiles(r)}resizeTile(e,t,i){let s=this._computeGridData(e,t);this._moveOtherTiles(e,s,t,i),e.setGridDataHints(s)}_computeGridData(e,t){let i=e.gridDataHints.clone({w:t.width,h:t.height}),s=this.htmlComp?.layout?.info;if(!s)return i;let r=s.gridDatas.find(o=>o.widget===e);if(e.gridDataHints.x>=0){let o=e.gridDataHints.x-r.gridx;i.x=t.x+o}if(e.gridDataHints.y>=0){let o=e.gridDataHints.y-r.gridy;i.y=t.y+o}return i}_moveOtherTiles(e,t,i,s){if(e.gridDataHints.x>=0&&e.gridDataHints.y>=0)this._moveOtherTilesExplicitly(e,t,s);else{let r=this._findTileBefore(i.point(),o=>o!==e);if(r)r!==e&&this.moveTileAfter(e,r);else{let o=p.moveTo(this.tiles.slice(),e,0);this.setTiles(o)}}}_moveOtherTilesExplicitly(e,t,i){Wo.moveOtherTilesDown(this.tiles,e,t,i)}_findTileBefore(e,t){let i,s=Wo.buildMatrix(this.tiles);for(let r=s.y;r<s.y+s.height;r++)for(let o=s.x;o<s.x+s.width;o++){let l;if(s[o]&&s[o][r]&&(!t||t(s[o][r]))&&(l=s[o][r]),e.equals(new X(o,r))||l&&l.gridData.toRectangle().contains(e))return i;l&&(i=s[o][r])}return i}}class Xc extends K{tileFilter;constructor(){super(),this.tileFilter=null,this._addRemoteProperties(["selectedTiles"])}_syncSelectedTiles(e){this.addFilterForPropertyName("selectedTiles"),this.widget.selectTiles(e)}_syncTiles(e){this.addFilterForPropertyName("selectedTiles"),this.widget.setTiles(e)}_initProperties(e){super._initProperties(e),b.isNullOrUndefined(e.filteredTiles)||(this.tileFilter=u.create(Ca,{tileIds:e.filteredTiles}),e.filters=[this.tileFilter]),delete e.filteredTiles}_syncFilteredTiles(e){b.isNullOrUndefined(e)?(this.widget.removeFilter(this.tileFilter),this.tileFilter=null):(this.tileFilter||(this.tileFilter=u.create(Ca),this.widget.addFilter(this.tileFilter,!1)),this.tileFilter.setTileIds(e),this.widget.filter())}_onWidgetTileClick(e){let t={tile:e.tile.id,mouseButton:e.mouseButton};this._send("tileClick",t)}_onWidgetTileAction(e){let t={tile:e.tile.id};this._send("tileAction",t)}_onWidgetEvent(e){e.type==="tileClick"?this._onWidgetTileClick(e):e.type==="tileAction"?this._onWidgetTileAction(e):super._onWidgetEvent(e)}static modifyTileGridPrototype(){G.get().remote&&b.replacePrototypeFunction(hr,"_sortWhileInit",function(){this.modelAdapter||this._sortWhileInitOrig()},!0)}}G.addListener("bootstrap",Xc.modifyTileGridPrototype);class Jc extends Js{getGridWidgets(){return this.widget.getFilteredTilesWithPlaceholders()}}class Qc extends xr{containerPos;containerScrollTop;maxWidth;tiles;_calculatingPrimitivePrefSize;constructor(e,t){super(e,t),this.containerPos=null,this.containerScrollTop=null,this.tiles=[],this._calculatingPrimitivePrefSize=!1}updateViewPort(e){let t=this.widget;t.rendered&&(u.nvl(e,!1)||t._renderViewPort(),this._layout(t.$container),t.trigger("layoutAnimationDone"))}layout(e){let t=this.widget.htmlComp,i=t.layouted||this.widget.startupAnimationEnabled&&!this.widget.startupAnimationDone||this.widget.renderAnimationEnabled;this.tiles=this.widget.renderedTiles(!0),P.setVisible(e,!1),i&&this._storeBounds(this.tiles),this._updateMaxWidth(),this._resetGridColumnCount(),this.widget.invalidateLayout(),this.widget.invalidateLogicalGrid(!1);let s=!1,r=e.outerWidth();for(r=Math.max(r,this.minWidth),t.prefSize().width<=r&&(this._layout(e),s=!0);!s&&this.widget.wrappable&&this.widget.gridColumnCount>1;)this.widget.gridColumnCount--,this.widget.invalidateLayout(),this.widget.invalidateLogicalGrid(!1),t.prefSize().width<=r&&(this._layout(e),s=!0);if(s||this._layout(e),t.layouted||this.widget._renderScrollTop(),this.widget.virtual&&(!t.layouted||this._sizeChanged(t)||this.widget.withPlaceholders)){this.widget.setViewRangeSize(this.widget.calculateViewRangeSize(),!1);let l=this.widget._renderTileDelta();this._storeBounds(l),p.pushAll(this.tiles,l),this._layout(e)}this.widget.trigger("layoutDone");let o=[];i&&(o=this._animateTiles()),this.widget.startupAnimationDone=!0,o.length>0?h().promiseAll(o).done(this._onAnimationDone.bind(this)):this._onAnimationDone(),this._updateFilterFieldMaxWidth(e)}_sizeChanged(e){return e.sizeCached&&!e.sizeCached.equals(e.size())}_storeBounds(e){e.forEach((t,i)=>{if(!t.animateBoundsChange)return;let s=C.cssBounds(t.$container);t.$container.data("oldBounds",s),t.$container.data("was-layouted",t.htmlComp.layouted)})}_validateGridData(e){return e.$comp.removeClass("newly-rendered"),super._validateGridData(e)}_layoutCellBounds(e,t){return this.widget.virtual&&this.widget.$fillBefore&&(t.top+=this.widget.$fillBefore.outerHeight(!0)),super._layoutCellBounds(e,t)}_animateTiles(){let e=this.widget.htmlComp,t=e.$comp;this.containerPos=e.offset(),this.containerScrollTop=t.scrollTop(),P.setVisible(t,!0),P.opacity(t,0);let i=[];return this.tiles.forEach((s,r)=>{if(!s.animateBoundsChange||!s.rendered)return;let o=this._animateTile(s);o&&i.push(o),s.$container.removeData("oldBounds"),s.$container.removeData("was-layouted")}),i}_animateTile(e){if(e.$container.stop(),e.$container.isVisibilityHidden()||e.$container.hasClass("animate-visible"))return;let t=C.cssBounds(e.$container),i=e.$container.data("oldBounds");if(e.$container.data("was-layouted")||(i=t.clone()),!this.widget.htmlComp.layouted&&(this.widget.startupAnimationDone||!this.widget.startupAnimationEnabled)&&this.widget.renderAnimationEnabled&&(i=new te(t.x*.95,t.y*.95,t.width,t.height)),i.equals(t)||!this._inViewport(t)&&!this._inViewport(i)||!e.$container.data("was-layouted")&&!this._inViewport(t))return;let r=this._animateTileBounds(e,i,t);return e.$container.data("animate-promise",r),r.always(()=>e.$container?.removeData("animate-promise")),r}_inViewport(e){e=e.translate(this.containerPos.x,this.containerPos.y).translate(0,-this.containerScrollTop);let t=new X(e.x,e.y),i=new X(e.x+e.width,e.y+e.height),s=this.widget.$container.scrollParent();return P.isLocationInView(t,s)||P.isLocationInView(i,s)}_onAnimationDone(){this._updateScrollbar(),this.widget.trigger("layoutAnimationDone")}_animateTileBounds(e,t,i){let s=e.$container[0],r=[s.style.overflow,s.style.overflowX,s.style.overflowY],o=()=>{s.style.overflow=r[0],s.style.overflowX=r[1],s.style.overflowY=r[2]},l={left:t.x,top:t.y,width:t.width,height:t.height},a={left:i.x,top:i.y,width:i.width,height:i.height},d=e.$container.cssAnimated(l,a).promise();return d.always(o),d}_updateScrollbar(){P.setVisible(this.widget.$container,!0),P.opacity(this.widget.$container,1);let e=this.widget.htmlComp;for(;e;){if(e.scrollable){P.update(e.$comp,!0);break}e=e.getParent()}}_updateMaxWidth(){let e=this.widget.htmlComp;if(e.$comp.cssPaddingRight(null),this.maxWidth<=0)return;let t=e.$comp.cssPaddingRight(),i=e.size(),s=i.width,r=Math.min(i.width,this.maxWidth),o=s-r-e.$comp.cssPaddingLeft()-e.$comp.cssBorderWidthX();o>t&&e.$comp.cssPaddingRight(o)}_resetGridColumnCount(){this.widget.gridColumnCount=this.widget.prefGridColumnCount}preferredLayoutSize(e,t){return t=h().extend({},t),this.widget.virtual?this.virtualPrefSize(e,t):this.primitivePrefSize(e,t)}virtualPrefSize(e,t){let i,s,r=x.get(e).insets(),o=new F,l=this.columnWidth,a=this.rowHeight,d=this.hgap,c=this.vgap;if(t.widthHint){s=Math.floor(t.widthHint/(l+d));let f=s*(l+d);return t.widthHint-f>l&&s++,s=Math.max(Math.min(this.widget.prefGridColumnCount,s),1),i=this.widget.rowCount(s),o.width=t.widthHint,o.height=Math.max(i*a+(i-1)*c,0),o.width+=r.horizontal(),o.height+=r.vertical(),o}return s=this.widget.gridColumnCount,i=this.widget.rowCount(),o.width=Math.max(s*l+(s-1)*d,0),o.height=Math.max(i*a+(i-1)*c,0),o.width+=r.horizontal(),o.height+=r.vertical(),o}primitivePrefSize(e,t){if(!t.widthHint||this._calculatingPrimitivePrefSize)return super.preferredLayoutSize(e,t);this._calculatingPrimitivePrefSize=!0;let i=this._primitivePrefSize(t);return this._calculatingPrimitivePrefSize=!1,i}_primitivePrefSize(e){let t,i=this.widget.htmlComp,s=!1,r=this.widget.gridColumnCount,o=e.widthHint;for(e.removeInsetsFromHints=!1,o+=i.insets().horizontal(),this._resetGridColumnCount(),this.widget.invalidateLayout(),this.widget.invalidateLogicalGrid(!1),t=i.prefSize(e),t.width<=o&&(s=!0);!s&&this.widget.gridColumnCount>1;)this.widget.gridColumnCount--,this.widget.invalidateLayout(),this.widget.invalidateLogicalGrid(!1),t=i.prefSize(e),t.width<=o&&(s=!0);return this.widget.gridColumnCount=r,t}_updateFilterFieldMaxWidth(e){let t=x.get(e),i=t.availableSize().subtract(t.insets()).width;this.widget.$filterFieldContainer.css("--filter-field-max-width",i*.6+"px")}}class Nt extends kt{maxWidth;static _DEFAULT_CONFIG=void 0;constructor(e,t){super(e,t),this._init()}static getTileDefaultLayoutConfig(){return Nt._DEFAULT_CONFIG||(Nt._DEFAULT_CONFIG={hgap:L.getSize("tile-grid-layout-config","margin-left","marginLeft",-1),vgap:L.getSize("tile-grid-layout-config","margin-top","marginTop",-1),columnWidth:L.getSize("tile-grid-layout-config","width","width",-1),rowHeight:L.getSize("tile-grid-layout-config","height","height",-1),minWidth:0,maxWidth:-1}),Nt._DEFAULT_CONFIG}_prepareOptions(e){let t=super._prepareOptions(e);return t.maxWidth=e.maxWidth>-2?e.maxWidth:void 0,t}_readEnvDefaults(){return Nt.getTileDefaultLayoutConfig()}applyToLayout(e){super.applyToLayout(e),this.maxWidth&&(e.maxWidth=this.maxWidth)}clone(e){return new Nt($.extend({},this._options,e),this._defaults)}static ensure(e){return e?e instanceof Nt?e:new Nt(e):null}}class wa{tileGrid;constructor(e){this.tileGrid=e}selectTileOnMouseDown(e){if(!this.isSelectable())return;let i=h()(e.currentTarget).data("widget");if(i instanceof Yt||i.selected&&e.which===3)return;let s=!0;if(e.ctrlKey&&(s=!i.selected),e.ctrlKey&&this.isMultiSelect()){s?(this.addTilesToSelection(i),this._checkAndSetFocusedTile(e,i)):(this.deselectTile(i),this._checkAndSetFocusedTile(e,null));return}if(e.shiftKey&&this.isMultiSelect()){if(!this.isHorizontalGridActive())return;let r=this.getVisibleTiles(),o=this.getFocusedTile();o||(o=r[0]);let l=this.computeSelectionBetween(r.indexOf(o),r.indexOf(i),!0);l&&(this.selectTiles(l.selectedTiles),this._checkAndSetFocusedTile(e,l.focusedTile));return}s?(this.selectTile(i),this._checkAndSetFocusedTile(e,i)):(this.deselectAllTiles(),this._checkAndSetFocusedTile(e,null))}getFilteredTiles(){return this.tileGrid.filteredTiles}getFilteredTileCount(){return this.tileGrid.filteredTiles.length}getVisibleTiles(){return this.tileGrid.filteredTiles}getVisibleTileCount(){return this.tileGrid.filteredTiles.length}getGridColumnCount(){return this.tileGrid.gridColumnCount}getVisibleGridRowCount(){return this.tileGrid.logicalGrid.gridRows}getVisibleGridX(e){return e.gridData.x}getVisibleGridY(e){return e.gridData.y}getSelectedTiles(){return this.tileGrid.selectedTiles}isSelectable(){return this.tileGrid.selectable}isMultiSelect(){return this.tileGrid.multiSelect}addTilesToSelection(e){this.tileGrid.addTilesToSelection(e)}selectTile(e){this.tileGrid.selectTile(e)}selectTiles(e){this.tileGrid.selectTiles(e)}deselectTile(e){this.tileGrid.deselectTile(e)}deselectTiles(e){this.tileGrid.deselectTiles(e)}deselectAllTiles(){this.tileGrid.deselectAllTiles()}toggleSelection(){this.tileGrid.toggleSelection()}getFocusedTile(){return this.tileGrid.focusedTile}computeFocusedTile(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=this.getFocusedTile();if(t)return t;let i=this.getSelectedTiles();return i.length===0?null:e>0?p.last(i):p.first(i)}_checkAndSetFocusedTile(e,t){e.isDefaultPrevented()||t&&t.rendered&&t.$container.hasClass("unfocusable")||this.setFocusedTile(t)}setFocusedTile(e){this.tileGrid.setFocusedTile(e)}scrollTo(e){this.tileGrid.scrollTo(e)}scrollToTop(){this.tileGrid.scrollToTop()}scrollToBottom(){this.tileGrid.scrollToBottom()}findVisibleTileIndexAt(e,t,i,s){return this.tileGrid.findTileIndexAt(e,t,i,s)}getTileGridByRow(e){return e<0||e>=this.getVisibleGridRowCount()?null:this.tileGrid}isHorizontalGridActive(){return this.tileGrid.logicalGrid instanceof Pr}computeSelectionX(e,t){let i=this._computeFocusedTileOrSelection(e);if(i.selectedTiles)return i;let s=i.focusedTile,o=this.getVisibleTiles().indexOf(s),l=this.getVisibleGridY(s),a=this.getVisibleGridX(s),d=this.findVisibleTileIndexAt(a+e,l,e>0?0:o,e<0);return d<0&&(d=o+(e>0?1:-1)),this.computeSelectionBetween(o,d,t)}computeSelectionY(e,t){let i=this._computeFocusedTileOrSelection(e);if(i.selectedTiles)return i;let s=this.getVisibleGridRowCount(),r=i.focusedTile,o=this.getVisibleGridY(r),l=this.getVisibleGridX(r);if(e>0&&o===s-1||e<0&&o===0)return;let a=this.getVisibleTiles(),d=a.indexOf(r),c=this.findVisibleTileIndexAt(l,o+e,d,e<0);if(c<0){let f=this.getTileGridByRow(o+e);if(!f)return;c=a.indexOf(p.last(f.filteredTiles))}return this.computeSelectionBetween(d,c,t)}computeSelectionToFirst(e){let t=this.getVisibleTiles();if(this.getSelectedTiles().length===0){let r=p.first(t);return{selectedTiles:[r],focusedTile:r}}let s=t.indexOf(this.computeFocusedTile());return this.computeSelectionBetween(s,0,e)}computeSelectionToLast(e){let t=this.getVisibleTiles();if(this.getSelectedTiles().length===0){let r=p.last(t);return{selectedTiles:[r],focusedTile:r}}let s=t.indexOf(this.computeFocusedTile());return this.computeSelectionBetween(s,t.length-1,e)}_computeFocusedTileOrSelection(e){let t=this.getVisibleTiles();if(this.getSelectedTiles().length===0){let s;return e>0?s=p.first(t):s=p.last(t),{focusedTile:s,selectedTiles:[s]}}return{focusedTile:this.computeFocusedTile(e),selectedTiles:null}}computeSelectionBetween(e,t,i){let s=this.getVisibleTiles(),r=s[t];if(e<0||e>s.length-1||t<0||t>s.length-1||e===t)return;if(!i)return{selectedTiles:[r],focusedTile:r};let o=this.getSelectedTiles(),l=[];return r.selected?t>e?(l=o.slice(),p.removeAll(l,s.slice(e,t))):(l=o.slice(),p.removeAll(l,s.slice(t+1,e+1))):t>e?(l=p.union(o,s.slice(e,t+1)),r=this._findLastSelectedTileAfter(s,t)):(l=p.union(s.slice(t,e+1),o),r=this._findLastSelectedTileBefore(s,t)),{selectedTiles:l,focusedTile:r}}executeSelection(e){if(e){if(e.selectedTiles.length>0){this.selectTiles(e.selectedTiles),this.scrollTo(e.focusedTile);let t=this.getVisibleGridY(e.focusedTile),i=this.getVisibleGridRowCount();t===0?this.scrollToTop():t===i-1&&this.scrollToBottom()}this.setFocusedTile(e.focusedTile)}}_findLastSelectedTileBefore(e,t){if(t===0)return e[t];let i=p.findFromReverse(e,t,(s,r)=>{let o=e[r-1];return o?!o.selected:!1});return i||(i=e[0]),i}_findLastSelectedTileAfter(e,t){if(t===e.length-1)return e[t];let i=p.findFrom(e,t,(s,r)=>{let o=e[r+1];return o?!o.selected:!1});return i||(i=e[e.length-1]),i}}class Zc extends ct{constructor(e){super(e)}_drag(e){this._moveData.tileBelowCursor&&this._moveData.tileBelowCursor.$container.removeClass("dragover");let t=this._moveData.$container.elementFromPoint(e.pageX,e.pageY,".tile"),i=u.widget(t);if(!(i instanceof $t)){this._moveData.tileBelowCursor=null;return}if(this._moveData.draggedElementInfo.element===i){this._moveData.tileBelowCursor=null;return}i.$container.addClass("dragover"),this._moveData.tileBelowCursor=i}_dragEnd(e){if(!this._moveData.tileBelowCursor)return super._dragEnd(e);let t=this._moveData.tileBelowCursor;t.$container.removeClass("dragover");let i=this._moveData.draggedElementInfo.element;this.widget.swapTileBounds(i,t);let s=$.Deferred();return this.widget.one("layoutDone",()=>{i.$container.addClass("moved");let r=C.offsetBounds(i.$container);if(r.dimension().equals(this._moveData.draggedElementInfo.bounds.dimension())){s.resolve(r);return}let o=C.offsetBounds(this._moveData.$clone);this._moveData.$clone.remove(),this._append$Clone(),this._moveData.$clone.removeClass("dragged");let l=o.width/this._moveData.$clone.width();this._moveData.$clone.css({top:o.y,left:o.x,"--dragging-scale":l,"--animation-duration-factor":0,"transform-origin":"0 0"}),requestAnimationFrame(()=>{this._moveData.$clone.css("--animation-duration-factor",this._animationDurationFactor),s.resolve(r)})}),s.promise()}_restoreStyles(){super._restoreStyles(),this._moveData.tileBelowCursor?.$container?.removeClass("dragover");let e=this._moveData.$draggedElement;e.addClass("drag-done"),setTimeout(()=>{e.removeClass("drag-done")},100)}}const Wo={buildMatrix(n){let e=$.extend([],{x:Number.MAX_SAFE_INTEGER,y:Number.MAX_SAFE_INTEGER,width:0,height:0});for(let t of n){let i=t.gridDataHints;if(!((i.x<0||i.y<0)&&(i=t.gridData,!i||i.x<0||i.y<0))){e.x=Math.min(e.x,i.x),e.y=Math.min(e.y,i.y);for(let s=i.x;s<i.x+i.w;s++){e[s]||(e[s]=[],e.width=Math.max(e.width,e.length-e.x));for(let r=i.y;r<i.y+i.h;r++)e[s][r]=t,e.height=Math.max(e.height,e[s].length-e.y)}}}return e.x===Number.MAX_SAFE_INTEGER&&(e.x=0),e.y===Number.MAX_SAFE_INTEGER&&(e.y=0),e},moveOtherTilesDown(n,e,t,i){let s=Wo.buildMatrix(n),r=new Map;o();for(const[d,c]of r.entries())d.setGridDataHints(c);function o(){let d=[];l(t,d);for(let c=t.y;c<s.y+s.height;c++)for(let f=s.x;f<s.x+s.width;f++){if(!s[f])continue;let g=s[f][c];if(e===g||!g||i&&i(g)||r.has(g))continue;let y=new ke(g.gridDataHints);if(y.x<0||y.y<0)continue;let v=a(d.slice(f,f+y.w));if(!v||y.y>=v.y&&!v.toRectangle().intersects(y.toRectangle()))continue;let D=v.y+v.h;y.y>=D||(y.y=D,r.set(g,y),l(y,d))}}function l(d,c){for(let f=d.x;f<d.x+d.w;f++)(!c[f]||d.y+d.h>c[f].y+c[f].h)&&(c[f]=d)}function a(d){return d.reduce((c,f)=>f?.y>c?.y?f:c,d[0])}}};class ep extends Me{tileGrid;ignorer;init(e){super.init(e),this.tileGrid=e.tileGrid,this.ignorer=e.ignorer}get layout(){return this.tileGrid.htmlComp.layout}_computeBounds(e){let t=this._findCell(this._relativeCursorPos(this.tileGrid.$container,e));if(!t)return;let i=this._findInitialCell();return u.isOneOf(this._context.edge,"w","e")?(t.y=i.y,t.height=i.height):u.isOneOf(this._context.edge,"n","s")&&(t.x=i.x,t.width=i.width),i.union(t)}_computeLogicalBounds(e){let t,i=this.layout.info;for(let s=0;s<i.rows;s++)for(let r=0;r<i.cols;r++){let o=i.cellBounds[s][r];if(e.contains(o.point())){let l=new te(r,s,1,1);t?t=t.union(l):t=l}}return t}_findInitialCell(){let e=u.widget(this.$container),t=this.layout.info.gridDatas.find(a=>a.widget===e),i=t.gridy,s=t.gridx,r=t.gridw-1,o=t.gridh-1,l=this.layout.info.cellBounds;switch(this._context.edge){case"n":return l[i+o][s].union(l[i+o][s+r]);case"ne":return l[i+o][s];case"e":return l[i][s].union(l[i+o][s]);case"se":return l[i][s];case"s":return l[i][s].union(l[i][s+r]);case"sw":return l[i][s+r];case"w":return l[i][s+r].union(l[i+o][s+r]);case"nw":return l[i+o][s+r]}}_findCell(e){let t=this.layout.info,i=t.hgap/2,s=t.vgap/2;for(let r=0;r<t.rows;r++)for(let o=0;o<t.cols;o++){let l=r>0?s:0,a=r<t.rows-1?s:0,d=o>0?i:0,c=o<t.cols-1?i:0,f=t.cellBounds[r][o];if(f.add(new We(l,c,a,d)).contains(e))return f.clone()}return null}_relativeCursorPos(e,t){let i=new X(e[0].scrollLeft,e[0].scrollTop),s=C.offset(e);return new X(t.pageX,t.pageY).subtract(s).add(i)}_resizeEnd(){let e=this._context.currentBounds;if(e.equals(this._context.initialBounds))return;let t=u.widget(this.$container),i=this._computeLogicalBounds(e);this.tileGrid.resizeTile(t,i,this.ignorer)}}class Hn{text;_htmlTileContentChangeHandler;_tilePropertyChangeHandler;constructor(){this.text=null,this._htmlTileContentChangeHandler=this._onHtmlTileContentChange.bind(this),this._tilePropertyChangeHandler=this._onTilePropertyChange.bind(this)}setText(e){return e=e||"",e=e.toLowerCase(),b.equals(this.text,e)?!1:(this.text=e,!0)}accept(e){if(_.empty(this.text))return!0;let i=this._plainTextForTile(e).trim().toLowerCase();return _.empty(i)?!1:i.indexOf(this.text)>-1}_plainTextForTile(e){if(e.plainText)return e.plainText;if(e instanceof ip)return e.plainText=_.plainText(e.content)||"",e.one("propertyChange:content",this._htmlTileContentChangeHandler),e.plainText;if(!e.parent.rendered)return"";let t=!1;return e.rendered||(e.render(),t=!0),e.plainText=_.plainText(e.$container.html())||"",t&&e.remove(),e.on("propertyChange",this._tilePropertyChangeHandler),e.plainText}_onHtmlTileContentChange(e){delete e.source.plainText}_onTilePropertyChange(e){e.propertyName!=="filterAccepted"&&(delete e.source.plainText,e.source.off("propertyChange",this._tilePropertyChangeHandler))}}class tp extends $t{widgets;constructor(){super(),this.widgets=[],this._addWidgetProperties(["widgets"])}_render(){this.$container=this.$parent.appendDiv(),this.htmlComp=x.install(this.$container,this.session)}_renderProperties(){super._renderProperties(),this._renderWidgets()}setWidgets(e){this.setProperty("widgets",e)}_renderWidgets(){this.widgets.forEach(e=>{e.render()}),this.invalidateLayoutTree()}}class ip extends $t{content;constructor(){super(),this.content=null}_render(){this.$container=this.$parent.appendDiv("html-tile"),this.htmlComp=x.install(this.$container,this.session)}_renderProperties(){super._renderProperties(),this._renderContent()}setContent(e){this.setProperty("content",e)}_renderContent(){if(!this.content){this.$container.empty();return}this.$container.html(this.content),this.$container.find("img").on("load",this._onImageLoad.bind(this)).on("error",this._onImageError.bind(this)),this.invalidateLayoutTree()}_onImageLoad(e){this.invalidateLayoutTree()}_onImageError(e){this.invalidateLayoutTree()}}class ym extends On{}class wm extends $t{bean;constructor(){super(),this.bean=null}_render(){this.$container=this.$parent.appendDiv("bean-tile"),this.htmlComp=x.install(this.$container,this.session)}_renderProperties(){super._renderProperties(),this._renderBean()}_renderBean(){}triggerAppLinkAction(e){this.trigger("appLinkAction",{ref:e})}_onAppLinkAction(e){let i=h()(e.delegateTarget).data("ref");this.triggerAppLinkAction(i)}}class Cm extends On{_onWidgetAppLinkAction(e){this._send("appLinkAction",{ref:e.ref})}_onWidgetEvent(e){e.type==="appLinkAction"?this._onWidgetAppLinkAction(e):super._onWidgetEvent(e)}}class sp extends Dh{gridColumnCount;multiSelect;selectable;takeTileFiltersFromGroup;tileComparator;filters;tileGridLayoutConfig;tileGridSelectionHandler;withPlaceholders;virtual;textFilterEnabled;filterSupport;createTextFilter;updateTextFilterText;$filterFieldContainer;_selectionUpdateLocked;_tileGridPropertyChangeHandler;_groupBodyHeightChangeHandler;constructor(){super(),this.exclusiveExpand=!1,this.gridColumnCount=null,this.multiSelect=null,this.selectable=null,this.takeTileFiltersFromGroup=!0,this.tileComparator=null,this.filters=[],this.tileGridLayoutConfig=null,this.tileGridSelectionHandler=new np(this),this.withPlaceholders=null,this.virtual=null,this.$filterFieldContainer=null,this.textFilterEnabled=!1,this.filterSupport=this._createFilterSupport(),this.createTextFilter=null,this.updateTextFilterText=null,this._selectionUpdateLocked=!1,this._tileGridPropertyChangeHandler=this._onTileGridPropertyChange.bind(this),this._groupBodyHeightChangeHandler=this._onGroupBodyHeightChange.bind(this)}_render(){super._render(),this.$container.addClass("tile-accordion"),this.$filterFieldContainer=this.$container.prependDiv("filter-field-container")}_createLayout(){return new rp(this)}_renderProperties(){super._renderProperties(),this._renderTextFilterEnabled()}_remove(){this.filterSupport.remove(),super._remove()}_init(e){super._init(e),this.setFilters(this.filters),this._setTileGridLayoutConfig(this.tileGridLayoutConfig)}_createKeyStrokeContext(){return new Ee}_initGroup(e){super._initGroup(e),e.body.setSelectionHandler(this.tileGridSelectionHandler),this.gridColumnCount!==null&&e.body.setGridColumnCount(this.gridColumnCount),this.setProperty("gridColumnCount",e.body.gridColumnCount),this.multiSelect!==null&&e.body.setMultiSelect(this.multiSelect),this.setProperty("multiSelect",e.body.multiSelect),this.selectable!==null&&e.body.setSelectable(this.selectable),this.setProperty("selectable",e.body.selectable),this.tileGridLayoutConfig!==null&&e.body.setLayoutConfig(this.tileGridLayoutConfig),this.setProperty("tileGridLayoutConfig",e.body.layoutConfig),this.tileComparator!==null&&(e.body.setComparator(this.tileComparator),e.body.sort()),this.setProperty("tileComparator",e.body.comparator),this.filters.length>0&&e.body.addFilter(this.filters),this.takeTileFiltersFromGroup&&this.setFilters(e.body.filters),this.withPlaceholders!==null&&e.body.setWithPlaceholders(this.withPlaceholders),this.setProperty("withPlaceholders",e.body.withPlaceholders),this.virtual!==null&&e.body.setVirtual(this.virtual),this.setProperty("virtual",e.body.virtual),e.body.selectedTiles.length>0&&this._handleSelectionChanged(e.body),e.body.on("propertyChange",this._tileGridPropertyChangeHandler),this._handleCollapsed(e),e.body.__tileAccordionEventDelegator=si.create(e.body,this,{delegateEvents:["tileClick","tileAction"]})}_deleteGroup(e){e.body&&(e.body.off("propertyChange",this._tileGridPropertyChangeHandler),e.body.__tileAccordionEventDelegator.destroy(),e.body.__tileAccordionEventDelegator=null),super._deleteGroup(e)}setGroups(e){let t=this.getTileCount(),i=this.getFilteredTileCount(),s=this.getSelectedTileCount();super.setGroups(e);let r=this.getTileCount(),o=this.getFilteredTileCount(),l=this.getSelectedTileCount();r!==t&&this.triggerPropertyChange("tiles",null,null),o!==i&&this.triggerPropertyChange("filteredTiles",null,null),l!==s&&this.triggerPropertyChange("selectedTiles",null,null)}setGridColumnCount(e){this.groups.forEach(t=>{t.body.setGridColumnCount(e)}),this.setProperty("gridColumnCount",e)}setTileGridLayoutConfig(e){this.groups.forEach(t=>{t.body.setLayoutConfig(e),e=t.body.layoutConfig}),this.setProperty("tileGridLayoutConfig",e)}_setTileGridLayoutConfig(e){this._setProperty("tileGridLayoutConfig",Nt.ensure(e))}setWithPlaceholders(e){this.groups.forEach(t=>{t.body.setWithPlaceholders(e)}),this.setProperty("withPlaceholders",e)}setVirtual(e){this.groups.forEach(t=>{t.body.setVirtual(e)}),this.setProperty("virtual",e)}setSelectable(e){this.groups.forEach(t=>{t.body.setSelectable(e)}),this.setProperty("selectable",e)}setMultiSelect(e){this.groups.forEach(t=>{t.body.setMultiSelect(e)}),this.setProperty("multiSelect",e)}getGroupById(e){return p.find(this.groups,t=>t.id===e)}getGroupByTile(e){return e.findParent(Pi)}_groupTiles(e){let t={};return this.groups.forEach(i=>{t[i.id]=[]}),e.forEach(function(i){let s=this.getGroupByTile(i);if(!s)throw new Error("No group found for tile "+i.id);t[s.id]||(t[s.id]=[]),t[s.id].push(i)},this),t}deleteTile(e){this.deleteTiles([e])}deleteTiles(e){if(e=p.ensure(e),e.length===0)return;let t=this.getTiles();p.removeAll(t,e),this.setTiles(t)}deleteAllTiles(){this.setTiles([])}setTiles(e){let t=p.ensure(e);if(b.equals(this.getTiles(),t))return;let i=this._createChildren(t),s=this._groupTiles(i);for(let r in s)this.getGroupById(r).body.setTiles(s[r])}getTiles(){let e=[];return this.groups.forEach(t=>{p.pushAll(e,t.body.tiles)}),e}getTileCount(){let e=0;return this.groups.forEach(t=>{e+=t.body.tiles.length}),e}addFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.addFilter(e,t)}removeFilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.removeFilter(e,t)}setFilters(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.filterSupport.setFilters(e,t)}_setFilters(e){let t=p.ensure(e);this.groups.forEach(i=>{i.body.setFilters(t.slice(),!1)}),this._setProperty("filters",t.slice())}filter(){this.filterSupport.filter()}_filter(){return this.groups.forEach(e=>e.body.filter()),null}_createFilterSupport(){return new Ti({widget:this,$container:()=>this.$filterFieldContainer,filterElements:this._filter.bind(this),createTextFilter:this._createTextFilter.bind(this),updateTextFilterText:this._updateTextFilterText.bind(this)})}_createTextFilter(){return b.isFunction(this.createTextFilter)?this.createTextFilter():new Hn}_updateTextFilterText(e,t){return b.isFunction(this.updateTextFilterText)?this.updateTextFilterText(e,t):e instanceof Hn?e.setText(t):!1}setTextFilterEnabled(e){this.setProperty("textFilterEnabled",e)}isTextFilterFieldVisible(){return this.textFilterEnabled}_renderTextFilterEnabled(){this.filterSupport.renderFilterField()}getFilteredTiles(){let e=[];return this.groups.forEach(t=>{p.pushAll(e,t.body.filteredTiles)}),e}getFilteredTileCount(){let e=0;return this.groups.forEach(t=>{e+=t.body.filteredTiles.length}),e}getVisibleTiles(){let e=[];return this.expandedGroups().forEach(t=>{p.pushAll(e,t.body.filteredTiles)}),e}getVisibleTileCount(){let e=0;return this.expandedGroups().forEach(t=>{e+=t.body.filteredTiles.length}),e}findVisibleTileIndexAt(e,t,i,s){return i=u.nvl(i,0),p.findIndexFrom(this.getVisibleTiles(),i,(r,o)=>new te(this.getVisibleGridX(r),this.getVisibleGridY(r),r.gridData.w,r.gridData.h).contains(e,t),s)}selectTiles(e){e=p.ensure(e);let t=this._groupTiles(e);for(let i in t)this.getGroupById(i).body.selectTiles(t[i])}selectTile(e){this.selectTiles([e])}selectAllTiles(){this.selectTiles(this.getVisibleTiles())}deselectTiles(e){e=p.ensure(e);let t=this.getSelectedTiles().slice();p.removeAll(t,e)&&this.selectTiles(t)}deselectTile(e){this.deselectTiles([e])}deselectAllTiles(){this.selectTiles([])}addTilesToSelection(e){e=p.ensure(e),this.selectTiles(this.getSelectedTiles().concat(e))}addTileToSelection(e){this.addTilesToSelection([e])}getSelectedTiles(){let e=[];return this.groups.forEach(t=>{p.pushAll(e,t.body.selectedTiles)}),e}getSelectedTile(){return this.getSelectedTiles()[0]}getSelectedTileCount(){let e=0;return this.groups.forEach(t=>{e+=t.body.selectedTiles.length}),e}toggleSelection(){this.getSelectedTileCount()===this.getVisibleTileCount()?this.deselectAllTiles():this.selectAllTiles()}setTileComparator(e){this.groups.forEach(t=>{t.body.setComparator(e)}),this.setProperty("tileComparator",e)}sortTiles(){this.groups.forEach(e=>{e.body.sort()})}setFocusedTile(e){let t=null;e!==null&&(t=this.getGroupByTile(e)),this.groups.forEach(i=>{i===t?i.body.setFocusedTile(e):i.body.setFocusedTile(null)})}getFocusedTile(){let e=null;return this.groups.some(t=>t.body.focusedTile?(e=t.body.focusedTile,!0):!1),e}getVisibleGridRowCount(){return this.expandedGroups().reduce((e,t)=>e+t.body.logicalGrid.gridRows,0)}getVisibleGridX(e){return e.gridData.x}getVisibleGridY(e){let t=this.getGroupByTile(e),i=this.getVisibleRowByGroup(t);return e.gridData.y+i}getGroupByVisibleRow(e){if(e<0||e>=this.getVisibleGridRowCount())return null;let t=0;return p.find(this.expandedGroups(),i=>{let s=i.body.logicalGrid.gridRows;if(t<=e&&e<t+s)return!0;t+=s})}getVisibleRowByGroup(e){let t=0;return this.expandedGroups().some(s=>{let r=s.body.logicalGrid.gridRows;return s===e?!0:(t+=r,!1)})?t:-1}expandedGroups(){return this.groups.filter(e=>!e.collapsed)}_handleSelectionChanged(e){if(this._selectionUpdateLocked)return;let t=e.parent;if(e.selectedTiles.length>0&&t.collapsed){e.deselectAllTiles();return}!this.multiSelect&&e.selectedTiles.length>0&&(this._selectionUpdateLocked=!0,this.groups.forEach(i=>{i.body!==e&&i.body.deselectAllTiles()}),this._selectionUpdateLocked=!1)}_onTileGridPropertyChange(e){e.propertyName==="selectedTiles"?(this._handleSelectionChanged(e.source),this.triggerPropertyChange("selectedTiles",null,null)):e.propertyName==="filteredTiles"?this.triggerPropertyChange("filteredTiles",null,null):e.propertyName==="tiles"&&this.triggerPropertyChange("tiles",null,null)}_onGroupCollapsedChange(e){super._onGroupCollapsedChange(e),this._handleCollapsed(e.source)}_handleCollapsed(e){e.collapsed&&e.body.deselectAllTiles(),e.rendered&&(e.on("bodyHeightChange",this._groupBodyHeightChangeHandler),e.one("bodyHeightChangeDone",this._onGroupBodyHeightChangeDone.bind(this)))}_onGroupBodyHeightChange(e){this.groups.forEach(t=>{e.source===t||t.bodyAnimating||t.body.virtual&&t.body.htmlComp&&t.body.htmlComp.layout.updateViewPort()})}_onGroupBodyHeightChangeDone(e){e.source.off("bodyHeightChange",this._groupBodyHeightChangeHandler)}tileAtScrollTop(e){return p.find(this.getTiles().filter(t=>t.rendered),t=>t.$container.position().top>=e)}}class Tm extends Eh{_initProperties(e){super._initProperties(e),e.takeTileFiltersFromGroup=!1}}class rp extends ml{tileAccordion;constructor(e,t){super(t),this.tileAccordion=e}layout(e){let t=this.tileAccordion.groups.map(i=>i.body).map(i=>this._getTileGridHeight(i));super.layout(e),this._updateFilterFieldMaxWidth(e),this.tileAccordion.groups.map(i=>i.body).forEach((i,s)=>this._updateTileGridViewPort(i,t[s]))}_updateTileGridViewPort(e,t){if(!e.rendered||!e.htmlComp||t<=0)return;let i=this._getTileGridHeight(e);t===i&&e.virtual&&(e.setViewRangeSize(e.calculateViewRangeSize(),!1),e.htmlComp.layout.updateViewPort())}_getTileGridHeight(e){if(!e||!e.htmlComp)return 0;let i=e.htmlComp.sizeCached;return i?i.height:0}_updateFilterFieldMaxWidth(e){let t=x.get(e),i=t.availableSize().subtract(t.insets()).width;this.tileAccordion.$filterFieldContainer.css("--filter-field-max-width",i*.6+"px")}}class np extends wa{tileAccordion;constructor(e){super(e),this.tileAccordion=e}getFilteredTiles(){return this.tileAccordion.getFilteredTiles()}getFilteredTileCount(){return this.tileAccordion.getFilteredTileCount()}getVisibleTiles(){return this.tileAccordion.getVisibleTiles()}getVisibleTileCount(){return this.tileAccordion.getVisibleTileCount()}getSelectedTiles(){return this.tileAccordion.getSelectedTiles()}getFocusedTile(){return this.tileAccordion.getFocusedTile()}getVisibleGridRowCount(){return this.tileAccordion.getVisibleGridRowCount()}getVisibleGridX(e){return this.tileAccordion.getVisibleGridX(e)}getVisibleGridY(e){return this.tileAccordion.getVisibleGridY(e)}scrollTo(e){this.tileAccordion.getGroupByTile(e).body.scrollTo(e)}getTileGridByRow(e){let t=this.tileAccordion.getGroupByVisibleRow(e);return t?t.body:null}findVisibleTileIndexAt(e,t,i,s){return this.tileAccordion.findVisibleTileIndexAt(e,t,i,s)}isHorizontalGridActive(){return this.tileAccordion.groups.length===0?!1:this.tileAccordion.groups[0].body.logicalGrid instanceof Pr}}class Ls extends B{constructor(e){super(),this.field=e,this.shift=e.multiSelect?void 0:!1,this.renderingHints.$drawingArea=(t,i)=>{let s=this._computeNewSelection();if(s&&s.focusedTile)return s.focusedTile.$container},this.inheritAccessibility=!1}getSelectionHandler(){return this.field.selectionHandler}_accept(e){return!(!super._accept(e)||!this.getSelectionHandler().isSelectable()||this.getSelectionHandler().getFilteredTileCount()===0)}handle(e){this.getSelectionHandler().executeSelection(this._computeNewSelection(e.shiftKey))}_computeNewSelection(e){return null}}class op extends Ls{constructor(e){super(e),this.ctrl=!0,this.shift=!1,this.which=[m.A],this.renderingHints.$drawingArea=(t,i)=>{let s=this.getSelectionHandler().getVisibleTiles()[0];if(s)return s.$container}}_accept(e){return!(!super._accept(e)||!this.getSelectionHandler().isMultiSelect())}handle(e){this.getSelectionHandler().toggleSelection()}}class lp extends Ls{constructor(e){super(e),this.stopPropagation=!0,this.repeatable=!0,this.which=[m.LEFT],this.renderingHints.text="←"}_accept(e){return!(!super._accept(e)||!this.getSelectionHandler().isHorizontalGridActive())}_computeNewSelection(e){return this.getSelectionHandler().computeSelectionX(-1,e)}}class ap extends Ls{constructor(e){super(e),this.stopPropagation=!0,this.repeatable=!0,this.which=[m.RIGHT],this.renderingHints.text="→"}_accept(e){return!(!super._accept(e)||!this.getSelectionHandler().isHorizontalGridActive())}_computeNewSelection(e){let t=this.getSelectionHandler().computeFocusedTile();return this.getSelectionHandler().computeSelectionX(t?t.gridData.w:1,e)}}class hp extends Ls{constructor(e){super(e),this.stopPropagation=!0,this.repeatable=!0,this.which=[m.DOWN],this.renderingHints.text="↓"}_accept(e){return!(!super._accept(e)||!this.getSelectionHandler().isHorizontalGridActive())}_computeNewSelection(e){let t=this.getSelectionHandler().computeFocusedTile();return this.getSelectionHandler().computeSelectionY(t?t.gridData.h:1,e)}}class dp extends Ls{constructor(e){super(e),this.stopPropagation=!0,this.repeatable=!0,this.which=[m.UP],this.renderingHints.text="↑"}_accept(e){return!(!super._accept(e)||!this.getSelectionHandler().isHorizontalGridActive())}_computeNewSelection(e){return this.getSelectionHandler().computeSelectionY(-1,e)}}class up extends Ls{constructor(e){super(e),this.stopPropagation=!0,this.which=[m.HOME]}_accept(e){return!(!super._accept(e)||!this.getSelectionHandler().isHorizontalGridActive())}_computeNewSelection(e){return this.getSelectionHandler().computeSelectionToFirst(e)}}class cp extends Ls{constructor(e){super(e),this.stopPropagation=!0,this.which=[m.END]}_accept(e){return!(!super._accept(e)||!this.getSelectionHandler().isHorizontalGridActive())}_computeNewSelection(e){return this.getSelectionHandler().computeSelectionToLast(e)}}class Ca{synthetic;tileMap;constructor(e){e=e||{},this.synthetic=!0,this.tileMap={},e.tileIds&&this.setTileIds(e.tileIds)}setTileIds(e){this.tileMap={},e.forEach(t=>{this.tileMap[t]=t})}accept(e){return!!this.tileMap[e.id]}}class pp extends $t{tileWidget;_widgetPropertyChangeHandler;constructor(){super(),this.tileWidget=null,this._addWidgetProperties(["tileWidget"]),this._widgetPropertyChangeHandler=this._onWidgetPropertyChange.bind(this)}_init(e){super._init(e),this._setTileWidget(this.tileWidget)}_destroy(){this.tileWidget&&this.tileWidget.off("propertyChange",this._widgetPropertyChangeHandler),super._destroy()}_renderProperties(){super._renderProperties(),this._renderTileWidget()}_renderTileWidget(){this.tileWidget&&this.tileWidget.render()}_removeTileWidget(){this.tileWidget&&this.tileWidget.remove()}_onWidgetPropertyChange(e){e.propertyName==="visible"?this.setVisible(e.newValue):e.propertyName==="enabled"?this.setEnabled(e.newValue):e.propertyName==="disabledStyle"&&this.setDisabledStyle(e.newValue)}setTileWidget(e){this.setProperty("tileWidget",e)}_setTileWidget(e){this.tileWidget&&this.tileWidget.off("propertyChange",this._widgetPropertyChangeHandler),this._setProperty("tileWidget",e),e&&(this.tileWidget.visible||this.setVisible(!1),this.tileWidget.enabled||this.setEnabled(!1),this.tileWidget.disabledStyle!==I.DisabledStyle.DEFAULT&&this.setDisabledStyle(this.tileWidget.disabledStyle),this.tileWidget.on("propertyChange",this._widgetPropertyChangeHandler)),this.invalidateLayoutTree()}}class vm extends On{}class Yt extends $t{constructor(){super(),this.cssClass="placeholder-tile",this.displayStyle=$t.DisplayStyle.PLAIN}_setSelectable(e){super._setSelectable(!1)}}class Ai extends pp{constructor(){super(),this.displayStyle=Ai.DisplayStyle.DASHBOARD}static DisplayStyle={DEFAULT:$t.DisplayStyle.DEFAULT,PLAIN:$t.DisplayStyle.PLAIN,DASHBOARD:"dashboard"};_renderProperties(){super._renderProperties(),this._renderFieldLabelVisible(),this._renderCompact()}_setTileWidget(e){super._setTileWidget(e),this._setDisplayStyle(this.displayStyle)}_renderTileWidget(){super._renderTileWidget(),this.displayStyle===Ai.DisplayStyle.DASHBOARD&&this.tileWidget&&this.tileWidget.htmlComp&&this.tileWidget.htmlComp.layout instanceof Kt&&(this.tileWidget.htmlComp.layout.statusWidth=0)}_setDisplayStyle(e){this._setProperty("displayStyle",e),this.tileWidget&&this.displayStyle===Ai.DisplayStyle.DASHBOARD&&(this.tileWidget.setLabelPosition(A.LabelPosition.TOP),this.tileWidget.setMandatory(!1),this.tileWidget.setStatusVisible(!1))}_renderDisplayStyle(){super._renderDisplayStyle(),this.$container.toggleClass("dashboard",this.displayStyle===Ai.DisplayStyle.DASHBOARD)}_renderFieldLabelVisible(){this.displayStyle===Ai.DisplayStyle.DASHBOARD&&(this.tileWidget instanceof $n&&this.tileWidget.$container.toggleClass("no-padding",!this.tileWidget.labelVisible&&!this.tileWidget.errorStatus),this.tileWidget instanceof A&&this.tileWidget.labelVisible&&T.linkElementWithHeader(this.$container,this.tileWidget.$label))}_renderCompact(){this.$container.toggleClass("compact",w.get().type===w.Type.MOBILE)}_onWidgetPropertyChange(e){super._onWidgetPropertyChange(e),(e.propertyName==="labelVisible"||e.propertyName==="errorStatus")&&this.rendered&&this._renderFieldLabelVisible()}markAsActiveDescendantFor(e){this.displayStyle===Ai.DisplayStyle.DASHBOARD&&this.tileWidget instanceof A&&T.linkElementWithActiveDescendant(this.$container,this.tileWidget?.$field)}}class Sm extends On{}class fp extends Ai{_render(){super._render(),this.$container.addClass("button-tile")}}class zo extends Oe{$iconContainer;constructor(){super(),this.processButton=!1,this.$iconContainer=null}_render(){if(!this._isInDashboardTile()){super._render();return}let e=this.$parent.makeDiv();T.role(e,"button"),this.$buttonLabel=e.appendSpan("label"),this.addContainer(this.$parent,"tile-button"),this.addField(e),this.addStatus(),this.htmlComp.setLayout(new pn),this.$container.on("mousedown",t=>this._doubleClickSupport.mousedown(t)).on("click",t=>{this.fieldStatus.$container.isOrHas(t.target)||this._onClick(t)}).unfocusable(),this.session.keyStrokeManager.installKeyStrokeContext(this.formKeyStrokeContext)}_remove(){this.$iconContainer=null,super._remove()}_isInDashboardTile(){return this.parent.displayStyle===Ai.DisplayStyle.DASHBOARD}_renderIconId(){if(!this._isInDashboardTile()){super._renderIconId();return}this.$field.removeClass("with-icon without-icon"),this.iconId?(this.$iconContainer||(this.$iconContainer=this.$field.prependDiv("icon-container")),this.$iconContainer.icon(this.iconId),this.$field.addClass("with-icon")):(this.$iconContainer&&(this.$iconContainer.remove(),this.$iconContainer=null),this.$field.addClass("without-icon")),this.invalidateLayoutTree()}get$Icon(){return this.$iconContainer?this.$iconContainer.children(".icon"):super.get$Icon()}_renderSubmenuIcon(){this._isInDashboardTile()||super._renderSubmenuIcon()}_renderTooltipText(){_.hasText(this.tooltipText)?Y.install(this.$container,{parent:this,text:this.tooltipText}):Y.uninstall(this.$container)}_renderLabelVisible(){super._renderLabelVisible(),this._updateLabelAndIconStyle()}_updateLabelAndIconStyle(){if(!this._isInDashboardTile()){super._updateLabelAndIconStyle();return}this._renderChildVisible(this.$buttonLabel,this.labelVisible)}}class xm extends Qu{_render(){super._render(),this.$container.addClass("scrollbar-y-outside tile-html-field")}_installScrollbars(e){super._installScrollbars($.extend(!0,{},e,{scrollShadow:"gradient"}))}}class Pm extends fs{_tableBlurHandler;_tableFocusHandler;_menuBarPropertyChangeHandler;_documentMouseDownHandler;constructor(){super(),this._tableBlurHandler=this._onTableBlur.bind(this),this._tableFocusHandler=this._onTableFocus.bind(this),this._menuBarPropertyChangeHandler=this._onMenuBarPropertyChange.bind(this),this._documentMouseDownHandler=this._onDocumentMouseDown.bind(this)}_render(){super._render(),this.session.focusManager.restrictedFocusGain||this.$container.document(!0).addEventListener("mousedown",this._documentMouseDownHandler,!0)}_remove(){this.$container.document(!0).removeEventListener("mousedown",this._documentMouseDownHandler,!0),super._remove()}_renderTable(){super._renderTable(),this.parent.displayStyle===Ai.DisplayStyle.DASHBOARD&&this.table&&(this.table.$container.on("blur",this._tableBlurHandler).on("focus",this._tableFocusHandler),this.table.menuBar.on("propertyChange",this._menuBarPropertyChangeHandler),this._toggleHasMenuBar(),document.activeElement!==this.table.$container[0]&&this._hideMenuBar(!0))}_removeTable(){this.parent.displayStyle===Ai.DisplayStyle.DASHBOARD&&(this.table&&(this.table.$container.off("blur",this._tableBlurHandler).off("focus",this._tableFocusHandler),this.table.menuBar.off("propertyChange",this._menuBarPropertyChangeHandler)),super._removeTable())}_onTableBlur(e){let t=h()(".popup").data("widget");this.has(t)||this._hideMenuBar(!0)}_onTableFocus(e){this._hideMenuBar(!1)}_hideMenuBar(e){this.table.menuBar.hiddenByUi=e,this.table.menuBar.updateVisibility()}_onMenuBarPropertyChange(e){e.propertyName==="visible"&&this._toggleHasMenuBar()}_toggleHasMenuBar(){!this.rendered&&!this.rendering||this.$container.toggleClass("has-menubar",this.table.menuBar.visible)}_onDocumentMouseDown(e){let t=h()(".popup"),i=t.data("widget");this.table&&i&&this.table.has(i)&&t.has(e.target)&&e.preventDefault()}}class Ta extends I{view;title;subTitle;iconId;closable;saveNeeded;saveNeededVisible;status;selected;$title;$subTitle;$iconContainer;$statusContainer;$close;$titleLine;$saveNeeded;$statusIcons;_statusContainerUsageCounter;_viewPropertyChangeListener;_viewRemoveListener;_glassPaneContribution;constructor(){super(),this.view=null,this.title=null,this.subTitle=null,this.iconId=null,this.cssClass=null,this.closable=!1,this.saveNeeded=!1,this.saveNeededVisible=!1,this.status=null,this.selected=!1,this.$title=null,this.$subTitle=null,this.$iconContainer=null,this.$statusContainer=null,this.$statusIcons=[],this._statusContainerUsageCounter=0,this._viewPropertyChangeListener=this._onViewPropertyChange.bind(this),this._viewRemoveListener=this._onViewRemove.bind(this),this._glassPaneContribution=e=>this.$close?(this.$close.addClass("glasspane-parent"),this.$close):null}_init(e){super._init(e),this.view=e.view,this.title=this.view?this.view.title:e.title,this.subTitle=this.view?this.view.subTitle:e.subTitle,this.iconId=this.view?this.view.iconId:e.iconId,this.cssClass=this.view?this.view.cssClass:e.cssClass,this.closable=this.view?this.view.closable:e.closable,this.saveNeeded=this.view?this.view.saveNeeded:e.saveNeeded,this.saveNeededVisible=this.view?this.view.saveNeededVisible:e.saveNeededVisible,this.status=this.view?this.view.status:e.status,Z.get().setDependentUuid("tab",this.view,this),this.view&&(this._installViewListeners(),this.view.addGlassPaneContribution(this._glassPaneContribution))}renderAfter(e,t){this.render(e),t&&this.$container.insertAfter(t.$container)}_render(){this.$container=this.$parent.prependDiv("simple-tab"),this.$container.on("mousedown",this._onMouseDown.bind(this)),this.$titleLine=this.$container.appendDiv("title-line"),this.$iconContainer=this.$titleLine.appendDiv("icon-container"),this.$title=this.$titleLine.appendDiv("title"),Y.installForEllipsis(this.$title,{parent:this}),this.$statusContainer=this.$titleLine.appendDiv("status-container"),this.$subTitle=this.$container.appendDiv("sub-title"),Y.installForEllipsis(this.$subTitle,{parent:this})}_renderProperties(){super._renderProperties(),this._renderTitle(),this._renderSubTitle(),this._renderIconId(),this._renderCssClass(),this._renderClosable(),this._renderSaveNeeded(),this._renderStatus(),this._renderSelected()}_remove(){this.$close=null,super._remove()}setTitle(e){this.setProperty("title",e)}_renderTitle(){this.$title.textOrNbsp(this.title)}setSubTitle(e){this.setProperty("subTitle",e)}_renderSubTitle(){this.$subTitle.text(this.subTitle)}setIconId(e){this.setProperty("iconId",e)}_renderIconId(){this.$iconContainer.icon(this.iconId)}setClosable(e){this.setProperty("closable",e)}_renderClosable(){if(this.closable){if(this.$close)return;this.$container.addClass("closable"),this.$close=this.$container.appendDiv("closer").on("click",this._onClose.bind(this)),T.role(this.$close,"button"),T.label(this.$close,this.session.text("ui.Close"))}else{if(!this.$close)return;this.$container.removeClass("closable"),this.$close.remove(),this.$close=null}}setSaveNeededVisible(e){this.saveNeededVisible!==e&&(this._setProperty("saveNeededVisible",e),this.rendered&&this._renderSaveNeeded())}setSaveNeeded(e){this.saveNeeded!==e&&(this._setProperty("saveNeeded",e),this.rendered&&this._renderSaveNeeded())}_renderSaveNeeded(){if(this.saveNeeded&&this.saveNeededVisible){if(this.$container.addClass("save-needed"),this.$saveNeeded)return;this.$saveNeeded=this.$statusContainer.prependDiv("status save-needer"),this._statusContainerUsageCounter++}else{if(!this.$saveNeeded)return;this.$container.removeClass("save-needed"),this.$saveNeeded.remove(),this.$saveNeeded=null,this._statusContainerUsageCounter--}}setStatus(e){this.setProperty("status",e)}_renderStatus(){this._statusContainerUsageCounter-=this.$statusIcons.length===0?0:1,this.$statusIcons.forEach(e=>e.remove()),this.$statusIcons=[],this.status&&this.status.asFlatList().forEach(e=>{if(!(!e||!e.iconId&&!e.message)){if(e.iconId){let t=this.$statusContainer.appendIcon(e.iconId,"status");e.cssClass()&&t.addClass(e.cssClass()),this.$statusIcons.push(t)}if(e.message){let t=this.$statusContainer.appendSpan("status message");e.cssClass()&&t.addClass(e.cssClass());let i=t.appendSpan("text",e.message);Y.installForEllipsis(i,{parent:this}),this.$statusIcons.push(t)}}}),this._statusContainerUsageCounter+=this.$statusIcons.length===0?0:1,this.$container.toggleClass("has-status",this._statusContainerUsageCounter>0)}select(){this.setSelected(!0)}deselect(){this.setSelected(!1)}setSelected(e){this.setProperty("selected",e)}_renderSelected(){this.$container.toggleClass("selected",this.selected),T.role(this.$titleLine,this.selected?"heading":null),T.level(this.$titleLine,this.selected?1:null)}_onMouseDown(e){this.$close&&this.$close.isOrHas(e.target)||(this.trigger("click"),this.$title&&(Y.cancel(this.$title),Y.close(this.$title)),this.$subTitle&&(Y.cancel(this.$subTitle),Y.close(this.$subTitle)),e.preventDefault())}_onClose(e){this.view&&this.view.abort()}getMenuText(){return _.join(" – ",this.title,this.subTitle)}_installViewListeners(){this.view.on("propertyChange",this._viewPropertyChangeListener),this.view.on("remove",this._viewRemoveListener)}_uninstallViewListeners(){this.view.off("propertyChange",this._viewPropertyChangeListener),this.view.off("remove",this._viewRemoveListener)}_onViewPropertyChange(e){e.propertyName==="title"?this.setTitle(this.view.title):e.propertyName==="subTitle"?this.setSubTitle(this.view.subTitle):e.propertyName==="iconId"?this.setIconId(this.view.iconId):e.propertyName==="cssClass"?this.setCssClass(e.newValue):e.propertyName==="saveNeeded"?this.setSaveNeeded(e.newValue):e.propertyName==="saveNeededVisible"?this.setSaveNeededVisible(e.newValue):e.propertyName==="closable"?this.setClosable(e.newValue):e.propertyName==="status"&&this.setStatus(e.newValue)}_onViewRemove(e){this._uninstallViewListeners(),this.rendered?this.remove():this.trigger("remove")}}class Vi extends I{static DisplayStyle={DEFAULT:"default",SPREAD_EVEN:"spreadEven"};displayStyle;tabs;_selectedViewTab;_tabClickHandler;constructor(){super(),this.displayStyle=Vi.DisplayStyle.DEFAULT,this.tabs=[],this._selectedViewTab=null,this._addWidgetProperties(["tabs"])}_init(e){super._init(e),this._tabClickHandler=this._onTabClick.bind(this)}_render(){this.$container=this.$parent.appendDiv("simple-tab-area"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout())}_createLayout(){return new va(this)}_renderProperties(){super._renderProperties(),this._renderDisplayStyle(),this._renderTabs()}setDisplayStyle(e){this.setProperty("displayStyle",e)}_renderDisplayStyle(){this.$container.toggleClass("spread-even",this.displayStyle===Vi.DisplayStyle.SPREAD_EVEN),this.invalidateLayoutTree()}_renderTabs(){this.tabs.slice().reverse().forEach(e=>this._renderTab(e)),Fe.updateFirstLastMarker(this.tabs)}_renderTab(e){e.renderAfter(this.$container)}_renderVisible(){this.$container.setVisible(this.visible&&this.tabs.length>0),this.invalidateLayoutTree()}_onTabClick(e){this.selectTab(e.source)}getTabs(){return this.tabs}getVisibleTabs(){return this.tabs.filter(e=>e.$container?e.$container.isVisible():e.visible)}selectTab(e){this._selectedViewTab!==e&&(this.deselectTab(this._selectedViewTab),this._selectedViewTab=e,e&&e.select(),this.trigger("tabSelect",{viewTab:e}),e&&e.rendered&&!e.$container.isVisible()&&this.invalidateLayoutTree())}deselectTab(e){e&&this._selectedViewTab===e&&this._selectedViewTab.deselect()}getSelectedTab(){return this._selectedViewTab}addTab(e,t){let i=-1;t&&(i=this.tabs.indexOf(t)),this.tabs.splice(i+1,0,e),e.on("click",this._tabClickHandler),this.rendered&&(this._renderVisible(),e.renderAfter(this.$container,t),Fe.updateFirstLastMarker(this.getTabs()),this.invalidateLayoutTree())}destroyTab(e){let t=this.tabs.indexOf(e);t>-1&&(this.tabs.splice(t,1),e.destroy(),e.off("click",this._tabClickHandler),this.rendered&&(this._renderVisible(),Fe.updateFirstLastMarker(this.getTabs()),this.invalidateLayoutTree()))}}class va extends ne{tabArea;tabWidth;tabMinWidth;overflowTabItemWidth;_$overflowTab;_overflowTabsIndizes;constructor(e){super(),this.tabArea=e,this._$overflowTab=null,this._overflowTabsIndizes=[],this.tabWidth=null,this.tabMinWidth=null,this.overflowTabItemWidth=null}layout(e){let t=this.tabArea.htmlComp,i=t.size({exact:!0}),s=t.$comp.children(".simple-tab"),r=this.tabArea.getTabs().length,o=this.smallPrefSize();if(i=i.subtract(t.insets()),this._initSizes(),this._$overflowTab&&this._$overflowTab.remove(),s.setVisible(!0),this._overflowTabsIndizes=[],Fe.updateFirstLastMarker(this.tabArea.getTabs()),o.width<=i.width){e.removeClass("overflown");return}e.addClass("overflown"),i.width-=this.overflowTabItemWidth;let l=Math.floor(i.width/this.tabMinWidth),a=r-l,d=0;s.each((g,y)=>{h()(y).hasClass("selected")&&(d=g)});let c,f=d-Math.floor(l/2);f<0?(f=0,c=l-1):(c=f+l-1,c>r-1&&(c=r-1,f=c-l+1)),this._$overflowTab=t.$comp.appendDiv("simple-overflow-tab-item").on("mousedown",this._onOverflowTabItemMouseDown.bind(this)),this._$overflowTab.appendDiv("num-tabs").text(a),s.each((g,y)=>{(g<f||g>c)&&(h()(y).setVisible(!1),this._overflowTabsIndizes.push(g))}),Fe.updateFirstLastMarker(this.tabArea.getVisibleTabs())}smallPrefSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._initSizes(),e=h().extend({minTabWidth:this.tabMinWidth},e),this.preferredLayoutSize(this.tabArea.$container,e)}preferredLayoutSize(e,t){this._initSizes();let i=u.nvl(t.minTabWidth,0)||u.nvl(this.tabWidth,0),r=this.tabArea.getTabs().length*i;t=h().extend({useCssSize:!0},t);let o=C.prefSize(this.tabArea.$container,t);return t.widthHint&&this.tabArea.displayStyle===Vi.DisplayStyle.SPREAD_EVEN&&(r=Math.max(t.widthHint,r)),new F(r,o.height)}_initSizes(){if(this.tabWidth!=null&&this.tabMinWidth!=null&&this.overflowTabItemWidth!=null)return;let e=this.tabArea.$container.children(".simple-tab").eq(0);if(e.length===0)return;e=e.clone().addClass("selected");let t=this.tabArea.$container.attr("class"),i=e.attr("class");this.tabWidth===null&&(this.tabWidth=L.getSize([t,i],"width","width",0)),this.tabMinWidth===null&&(this.tabMinWidth=L.getSize([t,i],"min-width","minWidth")),this.overflowTabItemWidth===null&&(this.overflowTabItemWidth=L.getSize([t,"simple-overflow-tab-item"],"min-width","minWidth"),this.overflowTabItemWidth+=L.getSize([t,"simple-overflow-tab-item"],"margin-left","marginLeft"),this.overflowTabItemWidth+=L.getSize([t,"simple-overflow-tab-item"],"margin-right","marginRight"))}_onOverflowTabItemMouseDown(e){let t=this.tabArea,i=[],s=h()(e.currentTarget);if(s.data("popup")){s.data("popup").close();return}this._overflowTabsIndizes.forEach(o=>{let l=this.tabArea.getTabs()[o],a=u.create(J,{parent:this.tabArea,text:l.getMenuText()});a.on("action",(function(){h().log.isDebugEnabled()&&h().log.debug("(SimpleTabAreaLayout#_onMouseDownOverflow) tab="+this),t.selectTab(this)}).bind(l)),i.push(a)});let r=u.create(bt,{parent:this.tabArea,menuItems:i,cloneMenuItems:!1,$anchor:s,closeOnAnchorMouseDown:!1});s.addClass("selected"),s.data("popup",r),r.one("remove",()=>{s.removeClass("selected"),s.data("popup",null)}),r.open()}}class Ie extends I{displayStyle;title;selectViewTabsKeyStrokesEnabled;selectViewTabsKeyStrokeModifier;cacheSplitterPosition;browserHistoryEntry;logoId;logoUrl;navigationVisible;navigationHandleVisible;logoActionEnabled;benchVisible;headerVisible;geolocationServiceAvailable;benchLayoutData;nativeNotificationDefaults;menus;addOns;dialogs;views;keyStrokes;viewButtons;messageBoxes;fileChoosers;outline;activeForm;selectedViewTabs;notifications;navigation;header;bench;splitter;splitterVisible;formController;messageBoxController;fileChooserController;initialFormRendering;resizing;offline;inBackground;openUriHandler;theme;dense;animateLayoutChange;url;responsiveHandler;busySupport;$notifications;$overlaySeparator;_resizeHandler;_glassPaneTargetFilters;_offlineNotification;_selectedViewDestroyHandler;_popstateHandler;_repositionTooltipsHandler;constructor(){super(),this.title=null,this.selectViewTabsKeyStrokesEnabled=!0,this.selectViewTabsKeyStrokeModifier="control",this.cacheSplitterPosition=!0,this.browserHistoryEntry=null,this.logoId=null,this.navigationVisible=!0,this.navigationHandleVisible=!0,this.logoActionEnabled=!1,this.benchVisible=!0,this.headerVisible=!0,this.geolocationServiceAvailable=w.get().supportsGeolocation(),this.benchLayoutData=null,this.nativeNotificationDefaults=null,this.menus=[],this.addOns=[],this.dialogs=[],this.views=[],this.keyStrokes=[],this.viewButtons=[],this.messageBoxes=[],this.fileChoosers=[],this.outline=null,this.activeForm=null,this.selectedViewTabs=new Map,this.notifications=[],this.navigation=null,this.header=null,this.bench=null,this.splitter=null,this.splitterVisible=!1,this.formController=null,this.messageBoxController=null,this.fileChooserController=null,this.initialFormRendering=!1,this.offline=!1,this.inBackground=!1,this.openUriHandler=null,this.theme=null,this.dense=!1,this.url=null,this.busySupport=u.create(fh,{parent:this}),this.$notifications=null,this.$overlaySeparator=null,this._addWidgetProperties(["viewButtons","menus","views","selectedViewTabs","dialogs","outline","messageBoxes","notifications","fileChoosers","addOns","keyStrokes","activeForm","focusedElement"]),this._addPreserveOnPropertyChangeProperties(["focusedElement","selectedViewTabs"]),this._glassPaneTargetFilters=[],this._selectedViewDestroyHandler=this._onSelectedViewDestroy.bind(this),this._repositionTooltipsHandler=null}static DisplayStyle={DEFAULT:"default",BENCH:"bench",COMPACT:"compact"};static UriAction={DOWNLOAD:"download",OPEN:"open",NEW_WINDOW:"newWindow",POPUP_WINDOW:"popupWindow",SAME_WINDOW:"sameWindow"};static DEFAULT_THEME="default";_init(e){let t=e.session||e.parent.session;t.desktop=this,e.nativeNotificationDefaults=this._createNativeNotificationDefaults(e),super._init(e),this.url=new wt,this._initTheme(),this.formController=u.create(Zp,{displayParent:this,session:this.session}),this.messageBoxController=u.create($o,{displayParent:this,session:this.session}),this.fileChooserController=u.create(So,{displayParent:this,session:this.session}),this._resizeHandler=this.onResize.bind(this),this._popstateHandler=this.onPopstate.bind(this),this.updateSplitterVisibility(),this.resolveTextKeys(["title"]),this._setViews(this.views),this._setViewButtons(this.viewButtons),this._setSelectedViewTabs(this.selectedViewTabs),this._setMenus(this.menus),this._setKeyStrokes(this.keyStrokes),this._setBenchLayoutData(this.benchLayoutData),this._setDisplayStyle(this.displayStyle),this._setDense(this.dense),this.openUriHandler=u.create(Cp,{session:this.session}),this._glassPaneTargetFilters.push((i,s)=>{let r=u.widget(i);return!s.has(r)})}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.invokeAcceptInputOnActiveValueField=!0,this.keyStrokeContext.registerKeyStrokes([new wp(this),new vp(this)])}_createNativeNotificationDefaults(e){return h().extend({title:e.title,iconId:e.logoId},e.nativeNotificationDefaults)}setNativeNotificationDefaults(e){this.setProperty("nativeNotificationDefaults",e)}_render(){this.$container=this.$parent,this.$container.addClass("desktop"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout()),this.$container.window().on("resize",this._resizeHandler).on("popstate",this._popstateHandler),this.$overlaySeparator=this.$container.appendDiv("overlay-separator").setVisible(!1),this._renderDense(),this._renderNavigationVisible(),this._renderHeaderVisible(),this._renderBenchVisible(),this._renderTitle(),this._renderLogoUrl(),this._renderSplitterVisible(),this._renderInBackground(),this._renderNavigationHandleVisible(),this._renderNotifications(),this._renderBrowserHistoryEntry(),this.addOns.forEach(e=>e.render()),this._setupDragAndDrop(),this._disableContextMenu()}_remove(){this.formController.remove(),this.messageBoxController.remove(),this.fileChooserController.remove(),this.$container.window().off("resize",this._resizeHandler).off("popstate",this._popstateHandler),super._remove()}_postRender(){super._postRender(),this.initialFormRendering=!0,this._renderDisplayChildrenOfOutline(),this.formController.render(),this.messageBoxController.render(),this.fileChooserController.render(),this.initialFormRendering=!1}_setDisplayStyle(e){this._setProperty("displayStyle",e);let t=this.displayStyle===Ie.DisplayStyle.COMPACT;if(this.header){if(this.header.tabArea){const i=Vi.DisplayStyle;this.header.tabArea.setDisplayStyle(t?i.SPREAD_EVEN:i.DEFAULT)}this.header.setToolBoxVisible(!t),this.header.animateRemoval=t}this.navigation&&(this.navigation.setToolBoxVisible(t),this.navigation.htmlComp.layoutData.fullWidth=t),this.bench&&this.bench.setOutlineContentVisible(!t),this.outline&&(this.outline.setCompact(t),this.outline.setEmbedDetailContent(t))}setBusy(e){this.busySupport.setBusy(e)}get busy(){return this.busySupport.isBusy()}setDense(e){this.setProperty("dense",e)}_setDense(e){this._setProperty("dense",e),L.clearCache(),we.get().init(this.dense?"dense":null)}_renderDense(){this.$container.toggleClass("dense",this.dense)}_createLayout(){return new mp(this)}_renderDisplayChildrenOfOutline(){this.outline&&(this.outline.formController.render(),this.outline.messageBoxController.render(),this.outline.fileChooserController.render(),this.outline.selectedViewTabs.size>0?this.outline.selectedViewTabs.forEach(e=>{this.formController._activateView(e)}):this.outline.views.filter(t=>t.modal).forEach(this.formController._activateView.bind(this.formController)))}_removeDisplayChildrenOfOutline(){this.outline&&(this.outline.formController.remove(),this.outline.messageBoxController.remove(),this.outline.fileChooserController.remove())}computeParentForDisplayParent(e){let t=e;return e instanceof bi&&(t=this),t}_renderTitle(){let e=this.title;if(e==null)return;let t=h()("div.scout");t.length<=1&&(t.document(!0).title=e)}_renderActiveForm(){}_renderBench(){this.bench||(this.bench=this._createBench(),this.bench.render(),this.bench.$container.insertBefore(this.$overlaySeparator),this.invalidateLayoutTree())}_createBench(){return u.create(Xt,{parent:this,animateRemoval:!0,headerTabArea:this.header?this.header.tabArea:void 0,outlineContentVisible:this.displayStyle!==Ie.DisplayStyle.COMPACT})}_removeBench(){this.bench&&(this.bench.on("destroy",()=>{this.bench=null,this.invalidateLayoutTree()}),this.bench.destroy())}_renderBenchVisible(){this.animateLayoutChange=this.rendered,this.benchVisible?(this._renderBench(),this._renderInBackground()):this._removeBench()}_renderNavigation(){this.navigation||(this.navigation=this._createNavigation(),this.navigation.render(),this.navigation.$container.prependTo(this.$container),this.$container.removeClass("navigation-invisible"),this.invalidateLayoutTree())}_createNavigation(){return u.create(Jt,{parent:this,outline:this.outline,toolBoxVisible:this.displayStyle===Ie.DisplayStyle.COMPACT,layoutData:{fullWidth:this.displayStyle===Ie.DisplayStyle.COMPACT}})}_removeNavigation(){this.$container.addClass("navigation-invisible"),this.navigation&&(this.navigation.destroy(),this.navigation=null,this.invalidateLayoutTree())}_renderNavigationVisible(){this.animateLayoutChange=this.rendered,this.navigationVisible?this._renderNavigation():this.animateLayoutChange?this.invalidateLayoutTree():this._removeNavigation()}_renderHeader(){this.header||(this.header=this._createHeader(),this.header.render(),this.navigation&&this.navigation.rendered?this.header.$container.insertAfter(this.navigation.$container):this.header.$container.prependTo(this.$container),this.bench&&this.bench._setTabArea(this.header.tabArea),this.invalidateLayoutTree())}_createHeader(){let e=this.displayStyle===Ie.DisplayStyle.COMPACT;return u.create(Pa,{parent:this,logoUrl:this.logoUrl,animateRemoval:e,toolBoxVisible:!e,tabArea:{displayStyle:e?Vi.DisplayStyle.SPREAD_EVEN:Vi.DisplayStyle.DEFAULT}})}_removeHeader(){this.header&&(this.header.on("destroy",()=>{this.invalidateLayoutTree(),this.header=null}),this.header.destroy())}_renderHeaderVisible(){this.headerVisible?this._renderHeader():this._removeHeader()}_renderLogoUrl(){this.header&&this.header.setLogoUrl(this.logoUrl)}_renderSplitterVisible(){this.splitterVisible?this._renderSplitter():this._removeSplitter()}_renderSplitter(){this.splitter||!this.navigation||(this.splitter=u.create(hs,{parent:this,$anchor:this.navigation.$container,$root:this.$container}),this.splitter.render(),this.splitter.$container.insertBefore(this.$overlaySeparator),this.splitter.on("move",this._onSplitterMove.bind(this)),this.splitter.on("moveEnd",this._onSplitterMoveEnd.bind(this)),this.splitter.on("positionChange",this._onSplitterPositionChange.bind(this)),this.updateSplitterPosition())}_removeSplitter(){this.splitter&&(this.splitter.destroy(),this.splitter=null)}_renderInBackground(){this.$container.toggleClass("in-background",this.inBackground&&this.displayStyle!==Ie.DisplayStyle.COMPACT),this.bench&&this.bench.$container.toggleClass("drop-shadow",this.inBackground)}_renderBrowserHistoryEntry(){if(!w.get().supportsHistoryApi())return;let e=this.$container.window(!0),t=this.browserHistoryEntry;if(t){let i=this._createHistoryPath(t),s=(this.rendered?e.history.pushState:e.history.replaceState).bind(e.history),r={deepLinkPath:t.deepLinkPath};s(r,t.title,i)}}_createHistoryPath(e){if(!e.pathVisible)return"";let t=e.path,i=this.url.clone();if(i.removeParameter("dl"),i.removeParameter("i"),b.countOwnProperties(i.parameterMap)>0){let s=new wt(t);for(let r in i.parameterMap)s.addParameter(r,i.getParameter(r));t=s.toString({alwaysFirst:["dl","i"]})}return t}_setupDragAndDrop(){let e=t=>{t.stopPropagation(),t.preventDefault(),t.originalEvent.dataTransfer.dropEffect="none"};this.$container.on("dragenter",e),this.$container.on("dragover",e),this.$container.on("drop",t=>{t.stopPropagation(),t.preventDefault()})}updateSplitterVisibility(){this.setSplitterVisible(this.navigationVisible&&this.benchVisible&&this.displayStyle!==Ie.DisplayStyle.COMPACT)}setSplitterVisible(e){this.setProperty("splitterVisible",e)}updateSplitterPosition(){if(!this.splitter)return;let e=this.cacheSplitterPosition&&this._loadCachedSplitterPosition();if(e){let t=parseInt(e,10);this.splitter.setPosition(t),this.invalidateLayoutTree()}else this.splitter.setPosition(),this.invalidateLayoutTree()}_disableContextMenu(){this.$container.on("contextmenu",e=>{e.target.nodeName!=="INPUT"&&e.target.nodeName!=="TEXTAREA"&&!e.target.isContentEditable&&e.preventDefault()})}setOutline(e){if(this.outline!==e)try{this.bench&&this.bench.setChanging(!0),this.rendered&&this._removeDisplayChildrenOfOutline(),this.outline=e,this._setDisplayStyle(this.displayStyle),this._setOutlineActivated(),this.navigation&&this.navigation.setOutline(this.outline),this.trigger("outlineChange"),this.rendered&&this._renderDisplayChildrenOfOutline()}finally{this.bench&&this.bench.setChanging(!1)}}_setViews(e){e&&e.forEach(t=>t.setDisplayParent(this)),this._setProperty("views",e)}_setViewButtons(e){this.updateKeyStrokes(e,this.viewButtons),this._setProperty("viewButtons",e)}setMenus(e){this.header&&this.header.setMenus(e)}_setMenus(e){this.updateKeyStrokes(e,this.menus),this._setProperty("menus",e)}_setKeyStrokes(e){this.updateKeyStrokes(e,this.keyStrokes),this._setProperty("keyStrokes",e)}setNavigationHandleVisible(e){this.setProperty("navigationHandleVisible",e)}_renderNavigationHandleVisible(){this.$container.toggleClass("has-navigation-handle",this.navigationHandleVisible)}setNavigationVisible(e){this.setProperty("navigationVisible",e),this.updateSplitterVisibility()}setBenchVisible(e){this.setProperty("benchVisible",e),this.updateSplitterVisibility()}setHeaderVisible(e){this.setProperty("headerVisible",e)}_setBenchLayoutData(e){e=Vr.ensure(e),this._setProperty("benchLayoutData",e)}_setInBackground(e){this._setProperty("inBackground",e)}outlineDisplayStyle(){if(this.outline)return this.outline.displayStyle}shrinkNavigation(){this.outline&&this.outline.toggleBreadcrumbStyleEnabled&&this.navigationVisible&&this.outlineDisplayStyle()===fe.DisplayStyle.DEFAULT?this.outline.setDisplayStyle(fe.DisplayStyle.BREADCRUMB):this.setNavigationVisible(!1)}enlargeNavigation(){this.outline&&this.navigationVisible&&this.outlineDisplayStyle()===fe.DisplayStyle.BREADCRUMB?(this.outline.setDisplayStyle(fe.DisplayStyle.DEFAULT),this.cacheSplitterPosition&&this.splitter&&(this.validateLayoutTree(),this._storeCachedSplitterPosition(this.splitter.position))):this.setNavigationVisible(!0)}switchToBench(e){this.setHeaderVisible(u.nvl(e,!0)),this.setBenchVisible(!0),this.setNavigationVisible(!1)}switchToNavigation(){this.setNavigationVisible(!0),this.setHeaderVisible(!1),this.setBenchVisible(!1)}revalidateHeaderLayout(){this.header&&this.header.revalidateLayout()}goOffline(){this.offline||(this.offline=!0,this._removeOfflineNotification(),this._offlineNotification=u.create($p,{parent:this}),this._offlineNotification.show())}goOnline(){this._removeOfflineNotification()}_removeOfflineNotification(){this._offlineNotification&&(setTimeout(this.removeNotification.bind(this,this._offlineNotification),3e3),this._offlineNotification=null)}addNotification(e){e&&(this.notifications.push(e),this.rendered&&this._renderNotification(e))}_renderNotification(e){this.$notifications?this.$notifications.appendTo(this.$container):this.$notifications=this.$container.appendDiv("desktop-notifications"),e.fadeIn(this.$notifications),e.duration>0&&(e.removeTimeout=setTimeout(e.hide.bind(e),e.duration),e.one("remove",()=>this.removeNotification(e)))}_renderNotifications(){this.notifications.forEach(e=>this._renderNotification(e))}removeNotification(e){let t;typeof e=="string"?t=p.find(this.notifications,i=>e===i.id):t=e,t&&(t.removeTimeout&&clearTimeout(t.removeTimeout),p.remove(this.notifications,t),this.rendered&&(t.rendered&&t.one("remove",this._onNotificationRemove.bind(this)),t.fadeOut()))}getPopups(){if(!this.$container)return[];let e=[];return this.$container.children(".popup").each((t,i)=>{let s=h()(i),r=Fe.get(s);r instanceof _e&&e.push(r)}),e}getPopupsFor(e){return this.getPopups().filter(t=>e.has(t))}removePopupsFor(e){this.getPopupsFor(e).forEach(t=>t.remove())}openUri(e,t){if(!this.rendered){this._postRenderActions.push(this.openUri.bind(this,e,t));return}this.openUriHandler.openUri(e,t)}bringOutlineToFront(){if(!this.rendered){this._postRenderActions.push(this.bringOutlineToFront.bind(this));return}!this.inBackground||this.displayStyle===Ie.DisplayStyle.BENCH||(this._setInBackground(!1),this._setOutlineActivated(),this.navigationVisible&&this.navigation.bringToFront(),this.benchVisible&&this.bench.bringToFront(),this.headerVisible&&this.header.bringToFront(),this._renderInBackground())}sendOutlineToBack(){this.inBackground||(this._setInBackground(!0),this.navigationVisible&&this.navigation.sendToBack(),this.benchVisible&&this.bench.sendToBack(),this.headerVisible&&this.header.sendToBack(),this._renderInBackground())}inFront(){return!0}_glassPaneTargets(e){let t=this.$container.children().not(".splitter").not(".desktop-notifications").not(".overlay-separator");if(e){e.$container&&(t=t.not(e.$container));let s=this.$overlaySeparator.nextAll().toArray(),r=[];e.$container&&s.indexOf(e.$container[0])>-1&&(r=e.$container.nextAll().toArray());let o=null;if(s.length)for(let l=s.length-1;l>=0;l--){let a=s[l];if(this._isGlassPaneTargetFiltered(a,e)){o=a;break}}t=t.filter((l,a)=>r.indexOf(a)>-1||a===o?!1:this._isGlassPaneTargetFiltered(a,e))}let i;return e instanceof j&&e.displayHint===j.DisplayHint.VIEW?(t=t.not(".desktop-bench").not(".desktop-header"),this.header&&this.header.toolBox&&this.header.toolBox.$container&&t.push(this.header.toolBox.$container),i=h().makeArray(t),p.pushAll(i,this._getBenchGlassPaneTargetsForView(e))):i=h().makeArray(t),this._pushPopupWindowGlassPaneTargets(i,e),i}_isGlassPaneTargetFiltered(e,t){return this._glassPaneTargetFilters.every(i=>i(e,t))}addGlassPaneTargetFilter(e){this._glassPaneTargetFilters.push(e)}removeGlassPaneTargetFilter(e){p.remove(this._glassPaneTargetFilters,e)}_deferredGlassPaneTarget(e){let t=new Er;return e.one("init",()=>t.ready([e.$container])),t}_getBenchGlassPaneTargetsForView(e){let t=[];return t=t.concat(this._getTabGlassPaneTargetsForView(e,this.header)),this.bench&&this.bench.visibleTabBoxes().forEach(i=>{i.rendered&&(i.hasView(e)?t=t.concat(this._getTabGlassPaneTargetsForView(e,i)):t.push(i.$container))}),t}_getTabGlassPaneTargetsForView(e,t){let i=[];return t&&t.tabArea&&t.tabArea.tabs.forEach(s=>{s.view!==e&&(i.push(s.$container),s.$container.addClass("glasspane-parent"))}),i}_pushPopupWindowGlassPaneTargets(e,t){this.formController.popupWindows.forEach(i=>{t!==i.form&&e.push(i.initialized?i.$container[0]:this._deferredGlassPaneTarget(i))})}showForm(e,t){let i=e.displayParent||this;e.setDisplayParent(i),this._setFormActivated(e),i.formController.registerAndRender(e,t,!0)}hideForm(e){if(e.displayParent){if(this.displayStyle===Ie.DisplayStyle.COMPACT&&e.isView()&&this.benchVisible){let t=this.bench.getViews().slice();p.remove(t,e),t.length===0&&this.switchToNavigation()}e.displayParent.formController.unregisterAndRemove(e),(!this.benchVisible||this.bench.getViews().length===0)&&this.bringOutlineToFront()}}isFormShown(e){return(e.displayParent||this).formController.isFormShown(e)}getShownForms(){let e=[],t=[this,...this.getOutlines()];for(let i of t)e=e.concat(i.views).concat(i.dialogs);for(let i of e)e=e.concat(i.views).concat(i.dialogs);return e}findFormWithExclusiveKey(e,t){let i=e;typeof e=="function"&&(i=e()),u.assertValue(i,"ExclusiveKey expected");for(let s of this.getShownForms())if(!(t&&!(s instanceof t))&&b.equals(s.exclusiveKey(),i))return s;return null}createFormExclusive(e,t,i){let s,r,o;b.isSameOrExtendsClass(e,j)?(s=e,o=t):(r=e,i=t);let l=!b.isNullOrUndefined(i)&&this.findFormWithExclusiveKey(i,s);return l||(s?l=u.create(s,h().extend({},o,{exclusiveKey:i})):(l=r(),l.setExclusiveKey(i)),l)}activateForm(e){(e?.displayParent||this).formController.activateForm(e)}_setOutlineActivated(){this._setFormActivated(null),this.outline&&this.outline.activateCurrentPage()}_setFormActivated(e){!this.rendered||this.initialFormRendering||this.activeForm!==e&&(this.activeForm=e,e?e.isView()&&!e.detailForm&&this.bench&&this.bench.hasView(e)&&(this.sendOutlineToBack(),this._updateSelectedViewTabs(e)):this.bringOutlineToFront(),this.triggerFormActivate(e))}_setSelectedViewTabs(e){this.selectedViewTabs=this.prepareSelectedViewTabs(e)}prepareSelectedViewTabs(e){let t=new Map;return e.forEach(i=>{t.set(Xt.normalizeDisplayViewId(i.displayViewId),i),i.one("destroy",this._selectedViewDestroyHandler)}),t}_updateSelectedViewTabs(e){let t=Xt.normalizeDisplayViewId(e.displayViewId),i=this.selectedViewTabs;if(e.displayParent instanceof bi)i=e.displayParent.selectedViewTabs;else if(e.displayParent instanceof Ie)this.getOutlines().forEach(r=>r.selectedViewTabs.delete(t));else return;let s=i.get(t);s!==e&&(s&&s.off("destroy",this._selectedViewDestroyHandler),i.set(t,e),e.one("destroy",this._selectedViewDestroyHandler))}_onSelectedViewDestroy(e){let t=e.source,i=Xt.normalizeDisplayViewId(t.displayViewId);this.getOutlines().forEach(s=>s.selectedViewTabs.delete(i)),this.selectedViewTabs.delete(i)}getOutlines(){let e=new Set;for(let t of this.children)t instanceof bi&&e.add(t),t instanceof jo&&t.outline&&e.add(t.outline);return Array.from(e)}triggerFormActivate(e){this.trigger("formActivate",{form:e})}cancelViews(e){return this.trigger("cancelForms",{forms:e}).defaultPrevented?h().resolvedPromise():this._cancelViews(e)}_cancelViews(e){if(e=e.filter(s=>!p.find(s.views,r=>r.modal)),e.length===1){const s=e[0];return s.activate(),s.cancel()}let t=e.filter(s=>{let r=!1;return s.visitDisplayChildren(o=>{o.saveNeeded&&(r=!0)},o=>o instanceof j),s.saveNeeded||r}),i=h().resolvedPromise();if(t.length>0){let s=u.create(Kn,{parent:this,session:this.session,displayParent:this,unsavedForms:t});s.open();const r=h().Deferred();i=r.promise(),s.whenSave().then(()=>{let o=s.openFormsField.value;o.forEach(l=>{l.visitDisplayChildren(a=>{a instanceof j?a.ok():a.close()}),l.ok()}),r.resolve(o)}),s.whenClose().then(()=>r.reject())}return i.then(s=>{s&&p.removeAll(e,s),e.forEach(r=>{r.visitDisplayChildren(o=>o.close()),r.close()})})}onLayoutAnimationComplete(){this.headerVisible||this._removeHeader(),this.navigationVisible||this._removeNavigation(),this.benchVisible||this._removeBench(),this.trigger("animationEnd"),this.animateLayoutChange=!1}onLayoutAnimationStep(){this.repositionTooltips()}onResize(e){this.revalidateLayoutTree()}resetPopstateHandler(){this.setPopstateHandler(this.onPopstate.bind(this))}setPopstateHandler(e){if(this.rendered||this.rendering){let t=this.$container.window();this._popstateHandler&&t.off("popstate",this._popstateHandler),e&&t.on("popstate",e)}this._popstateHandler=e}onPopstate(e){let i=e.originalEvent.state;i&&i.deepLinkPath&&this.trigger("historyEntryActivate",i)}_onSplitterMove(e){this.resizing=!0;let t=Math.floor(this.$container.outerWidth(!0)/2);e.position>t&&(e.source.setPosition(t),e.preventDefault())}_onSplitterPositionChange(e){this.htmlComp.layouting||this.revalidateLayout()}_onSplitterMoveEnd(e){let t=e.position;this.cacheSplitterPosition&&this._storeCachedSplitterPosition(this.splitter.position),t<Jt.BREADCRUMB_STYLE_WIDTH?this.navigation.$container.animate({width:Jt.BREADCRUMB_STYLE_WIDTH},{progress:(function(){this.resizing=!0,this.splitter.setPosition(),this.revalidateLayout(),this.resizing=!1}).bind(this),complete:(function(){this.resizing=!0,this.splitter.setPosition(),this.cacheSplitterPosition&&this._storeCachedSplitterPosition(this.splitter.position),this.revalidateLayout(),this.resizing=!1}).bind(this)}):this.resizing=!1}_loadCachedSplitterPosition(){return he.getItemFromSessionStorage("scout:desktopSplitterPosition")||he.getItemFromLocalStorage("scout:desktopSplitterPosition:"+window.location.pathname)}_storeCachedSplitterPosition(e){he.setItemToSessionStorage("scout:desktopSplitterPosition",e+""),he.setItemToLocalStorage("scout:desktopSplitterPosition:"+window.location.pathname,e+"")}_onNotificationRemove(e){this.notifications.length===0&&this.$notifications&&(this.$notifications.remove(),this.$notifications=null)}onReconnecting(){this.offline&&this._offlineNotification.reconnect()}onReconnectingSucceeded(){this.offline&&(this.offline=!1,this._offlineNotification.reconnectSucceeded(),this._removeOfflineNotification())}onReconnectingFailed(){this.offline&&this._offlineNotification.reconnectFailed()}dataChange(e){this.trigger("dataChange",e)}_activeTheme(){return ol.get("scout.ui.theme")||Ie.DEFAULT_THEME}logoAction(){this.logoActionEnabled&&this.trigger("logoAction")}_initTheme(){let e=this.theme;this.url.hasParameter("theme")?e=_.nullIfEmpty(this.url.getParameter("theme"))||Ie.DEFAULT_THEME:e||(e=this._activeTheme()),this.setTheme(e)}setTheme(e){this.setProperty("theme",e),this.theme!==this._activeTheme()&&this._switchTheme(e)}_switchTheme(e){ol.set("scout.ui.theme",e,30*24*3600),h()("body").setVisible(!1);let t={clearBody:!1};this.url.hasParameter("theme")&&(this.url.removeParameter("theme"),t.redirectUrl=this.url.toString()),u.reloadPage(t)}moveOverlaysBehindAndFocus(e,t){t=h().ensure(t),t.nextAll().toArray().forEach(i=>{p.containsAll(e,[i])&&h()(i).insertBefore(t)}),t.isOrHas(t.activeElement())||this.session.focusManager.activateFocusContext(t)}adjustOverlayOrder(e){if(!this.rendered)return;let t=this.$overlaySeparator.nextAll();if(!t.is(e.$container))return;const i=t.not(e.$container),s=a=>e.findParent(c=>c.$container&&c.$container.is(a))||u.widget(a),r=a=>{let d=null;return i.toArray().reverse().some(c=>{let f=s(c);return f&&!(f instanceof Ie)&&f.has(a)?(d=f,!0):!1}),d};let o=r(e),l=i.toArray().filter(a=>{let d=s(a);return d instanceof Xi&&r(d)===o});p.hasElements(l)?e.$container.insertAfter(p.last(l)):e.$container.insertAfter(o?o.$container:this.$overlaySeparator)}tooltipRendered(e){this.adjustOverlayOrder(e),!this._repositionTooltipsHandler&&this.$container.children(".tooltip").length&&(this._repositionTooltipsHandler=()=>{this.repositionTooltips(),this.session.layoutValidator.schedulePostValidateFunction(this._repositionTooltipsHandler)},this.session.layoutValidator.schedulePostValidateFunction(this._repositionTooltipsHandler))}tooltipRemoved(e){this._repositionTooltipsHandler&&(this.$container.children(".tooltip").length||(this.session.layoutValidator.removePostValidateFunction(this._repositionTooltipsHandler),this._repositionTooltipsHandler=null))}repositionTooltips(){this.$container.children(".tooltip").each(function(){u.widget(h()(this)).position()})}_renderTrackFocus(){this.trackFocus?this.$container[0].addEventListener("focusin",this._focusInListener,!0):this.$container[0].removeEventListener("focusin",this._focusInListener,!0)}_onFocusIn(e){super._onFocusIn(e);let t=h()(e.target),i=u.widget(t);this.setProperty("focusedElement",i)}}Z.uuidPathAlwaysSkipRules.push(n=>n instanceof Ie);class Uo extends K{constructor(){super(),this._addRemoteProperties(["benchVisible","navigationVisible","navigationHandleVisible","headerVisible","geolocationServiceAvailable","inBackground","focusedElement"])}_goOffline(){this.widget.goOffline()}_goOnline(){this.widget.goOnline()}_onWidgetHistoryEntryActivate(e){this._send("historyEntryActivate",{deepLinkPath:e.deepLinkPath})}_onWidgetRender(e){this._send("desktopReady")}_onWidgetFormActivate(e){e.form&&!K.getModelAdapterForWidget(e.form,!0)||this._sendFormActivate(e.form)}_sendFormActivate(e){let t={formId:K.getModelAdapterForWidget(e,!0)?.id};this._send("formActivate",t,{coalesce:function(i){return this.target===i.target&&this.type===i.type&&!(!i.formId&&this.formId)}})}_prepareRemoteProperty(e,t){return e==="focusedElement"?t:super._prepareRemoteProperty(e,t)}_sendFocusedElement(e){for(;e&&!e.modelAdapter;)e=e.parent;this._sendProperty("focusedElement",e?e.id:null)}_logoAction(e){this._send("logoAction")}_onWidgetEvent(e){e.type==="formActivate"?this._onWidgetFormActivate(e):e.type==="historyEntryActivate"?this._onWidgetHistoryEntryActivate(e):e.type==="logoAction"?this._logoAction(e):e.type==="cancelForms"?this._onWidgetCancelAllForms(e):e.type==="render"?this._onWidgetRender(e):super._onWidgetEvent(e)}_onFormShow(e){let t=this.session.getModelAdapter(e.displayParent);if(t){let i=this.session.getOrCreateWidget(e.form,t.widget);i.setDisplayParent(t.widget),this.session.asyncEvents.some(r=>r.type==="formActivate"&&r.target===this.id)||this.addFilterForWidgetEvent(r=>r.type==="formActivate"&&r.form===i),this.widget.showForm(i,e.position)}}_onFormHide(e){if(this.session.getModelAdapter(e.displayParent)){let i=this.session.getModelAdapter(e.form);this.widget.hideForm(i.widget)}}_onFormActivate(e){let t=this.session.getWidget(e.form);this.widget.activateForm(t)}_onWidgetCancelAllForms(e){const t=[],i=[];for(const r of e.forms||[])r.modelAdapter?t.push(r.modelAdapter.id):i.push(r);if(!t.length)return;e.preventDefault();let s=h().resolvedPromise();i.length&&(s=this.widget.cancelViews(i)),t.length&&s.always(()=>this._send("cancelForms",{formIds:t}))}_onMessageBoxShow(e){let t=this.session.getModelAdapter(e.displayParent);if(t){let i=this.session.getOrCreateWidget(e.messageBox,t.widget),s=t.widget;i.setDisplayParent(s),s.messageBoxController.registerAndRender(i)}}_onMessageBoxHide(e){let t=this.session.getModelAdapter(e.displayParent);if(t){let i=this.session.getModelAdapter(e.messageBox);t.widget.messageBoxController.unregisterAndRemove(i.widget)}}_onFileChooserShow(e){let t=this.session.getModelAdapter(e.displayParent);if(t){let i=t.widget,s=this.session.getOrCreateWidget(e.fileChooser,i);s.setDisplayParent(i),i.fileChooserController.registerAndRender(s)}}_onFileChooserHide(e){let t=this.session.getModelAdapter(e.displayParent);if(t){let i=this.session.getModelAdapter(e.fileChooser);t.widget.fileChooserController.unregisterAndRemove(i.widget)}}_onOpenUri(e){this.widget.openUri(e.uri,e.action)}_onOutlineChanged(e){let t=this.session.getOrCreateWidget(e.outline,this.widget);this.widget.setOutline(t)}_onAddNotification(e){let t=this.session.getOrCreateWidget(e.notification,this.widget);this.widget.addNotification(t)}_onRemoveNotification(e){this.widget.removeNotification(e.notification)}_onOutlineContentActivate(e){this.widget.bringOutlineToFront()}onModelAction(e){e.type==="formShow"?this._onFormShow(e):e.type==="formHide"?this._onFormHide(e):e.type==="formActivate"?this._onFormActivate(e):e.type==="messageBoxShow"?this._onMessageBoxShow(e):e.type==="messageBoxHide"?this._onMessageBoxHide(e):e.type==="fileChooserShow"?this._onFileChooserShow(e):e.type==="fileChooserHide"?this._onFileChooserHide(e):e.type==="openUri"?this._onOpenUri(e):e.type==="outlineChanged"?this._onOutlineChanged(e):e.type==="outlineContentActivate"?this._onOutlineContentActivate(e):e.type==="addNotification"?this._onAddNotification(e):e.type==="removeNotification"?this._onRemoveNotification(e):super.onModelAction(e)}static modifyDesktopPrototype(){G.get().remote&&b.replacePrototypeFunction(Ie,"_initTheme",Uo._initTheme,!0)}static _initTheme(){this.modelAdapter?this.setTheme(this._activeTheme()):this._initThemeOrig()}}G.addListener("bootstrap",Uo.modifyDesktopPrototype);class gp extends I{desktop;clickable;url;image;_desktopPropertyChangeHandler;_clickHandler;constructor(){super(),this.desktop=null,this.clickable=!1,this.image=null,this._desktopPropertyChangeHandler=this._onDesktopPropertyChange.bind(this),this._clickHandler=this._onClick.bind(this)}_init(e){super._init(e),this.desktop=this.session.desktop,this.clickable=this.desktop.logoActionEnabled,this.url=e.url,this.image=u.create(Dl,{parent:this,imageUrl:this.url})}_render(){this.$container=this.$parent.appendDiv("desktop-logo"),this.htmlComp=x.install(this.$container,this.session),this.image.render(),this.desktop.on("propertyChange",this._desktopPropertyChangeHandler)}_renderProperties(){super._renderProperties(),this._renderClickable()}_remove(){this.desktop.off("propertyChange",this._desktopPropertyChangeHandler),super._remove()}_renderClickable(){this.$container.toggleClass("clickable",this.clickable),this.clickable?this.$container.on("click",this._clickHandler):this.$container.off("click",this._clickHandler)}setUrl(e){this.setProperty("url",e),this.image.setImageUrl(e)}setClickable(e){this.setProperty("clickable",e)}_onDesktopPropertyChange(e){e.propertyName==="logoActionEnabled"&&this.setClickable(e.newValue)}_onClick(e){this.desktop.logoAction()}}class mp extends ne{desktop;constructor(e){super(),this.desktop=e}layout(e){let t,i=0,s=0,r=this.desktop,o=r.navigation,l=r.header,a=r.bench,d=r.animateLayoutChange,c=this.containerSize(),f=o&&o.htmlComp.layoutData.fullWidth;if(pe.get().handleResponsive(r,e.width()),o&&(i=this.calculateNavigationWidth(c),r.splitter&&r.splitter.setPosition(i),r.navigationVisible)){let y=o.htmlComp,v=new F(i,c.height).subtract(y.margins());y.setSize(v)}if(l){let y=l.htmlComp;if(s=y.$comp.outerHeight(!0),r.headerVisible){d||l.$container.cssLeft(i);let v=new F(c.width-i,s).subtract(y.margins());(!d||f)&&y.setSize(v),d&&(t={left:c.width},g(t,y,v),this._animate(t,y))}}if(a){let y=a.htmlComp;if(r.benchVisible){a.$container.cssTop(s),d||a.$container.cssLeft(i);let v=new F(c.width-i,c.height-s).subtract(y.margins());(!d||f)&&y.setSize(v),d&&(t={left:c.width},g(t,y,v),this._animate(t,y))}}function g(y,v,D){f?v.$comp.cssLeft(c.width):(y.width=D.width,v.setSize(D)),y.left=i}}_animate(e,t){t.$comp.is(":animated")?i.call(this):setTimeout(i.bind(this));function i(){t.$comp.stop().animate(e,{complete:this.desktop.onLayoutAnimationComplete.bind(this.desktop),step:this.desktop.onLayoutAnimationStep.bind(this.desktop)})}}containerSize(){let e=this.desktop.htmlComp;return e.availableSize({exact:!0}).subtract(e.insets())}calculateNavigationWidth(e){if(!this.desktop.navigationVisible)return 0;if(this.desktop.navigation.htmlComp.layoutData.fullWidth)return e.width;let i=0;this.desktop.splitter&&(i=this.desktop.splitter.position);let s=this.desktop.outline;return!this.desktop.resizing&&s&&s.toggleBreadcrumbStyleEnabled&&(s.displayStyle===fe.DisplayStyle.BREADCRUMB?i=Jt.BREADCRUMB_STYLE_WIDTH:Math.floor(i)<=Jt.BREADCRUMB_STYLE_WIDTH&&(i=Jt.DEFAULT_STYLE_WIDTH)),Math.max(i,Jt.MIN_WIDTH)}}class _p extends Ta{_render(){super._render(),this.$container.addClass("desktop-tab"),this.$container.on("contextmenu",this._onContextMenu.bind(this)),this.$container.prependDiv("edge left"),this.$container.appendDiv("edge right")}_renderClosable(){super._renderClosable(),this.closable&&this.view.closeKeyStroke&&(this.view.closeKeyStroke.renderingHints={hAlign:ut.RIGHT,render:()=>!!this.$close,$drawingArea:()=>this.$close})}_onContextMenu(e){let t=u.create(J,{parent:this,text:this.session.text("ui.CloseAllTabs")});t.on("action",this._onCloseAll.bind(this));let i=u.create(J,{parent:this,text:this.session.text("ui.CloseOtherTabs"),enabled:this.parent.tabs.length>1});i.on("action",this._onCloseOther.bind(this)),u.create(bt,{parent:this,menuItems:[t,i],cloneMenuItems:!1,location:{x:e.pageX,y:e.pageY}}).open()}_onCloseAll(){let e=this.parent.tabs.map(t=>t.view);this.session.desktop.cancelViews(e)}_onCloseOther(){let e=this.parent.tabs.map(t=>t.view);p.remove(e,this.view),this.session.desktop.cancelViews(e)}}class Sa extends Vi{_render(){super._render(),this.$container.addClass("desktop-tab-area")}_createLayout(){return new bp(this)}updateFirstTabSelected(){let e=this.session.desktop;if(!e.rendered)return;let t=this.getVisibleTabs()[0];e.$container.toggleClass("first-tab-selected",t&&t.selected)}getTabs(){return super.getTabs()}}class bp extends va{constructor(e){super(e)}layout(e){super.layout(e),this.tabArea.updateFirstTabSelected()}}class xa extends Dr{createTabArea(){return u.create(Sa,{parent:this.tabBox})}_createTab(e){return u.create(_p,{parent:this.tabArea,view:e})}_shouldCreateTabForView(e){return!e.headerVisible}}class yp extends uo{constructor(e){super(),this.field=e,this.parseAndSetKeyStroke(e.selectViewTabsKeyStrokeModifier),this.registerRange(m[1],()=>m[Math.min(this._viewTabs().length,9)]),this.renderingHints.$drawingArea=(t,i)=>{let s=i.which-m[1];return this._viewTabs()[s].$container},this.inheritAccessibility=!1}_isEnabled(){return super._isEnabled()&&this.field.selectViewTabsKeyStrokesEnabled&&this._viewTabs().length>0}handle(e){let t=e.which-m[1],i=this._viewTabs();if(i.length&&t<i.length){let s=i[t];this.field.bench&&this.field.bench.activateView(s.view)}}_viewTabs(){return this.field.bench?this.field.bench.getTabs():[]}}class wp extends B{constructor(e){super(),this.field=e,this.which=[m.F5],this.preventDefault=!0,this.keyStrokeFirePolicy=ce.KeyStrokeFirePolicy.ALWAYS,this.renderingHints.render=!1,this.inheritAccessibility=!1}handle(e){}}class Nr extends ot{static PROP_POPUP_WINDOW="popupWindow";myWindow;form;session;initialized;resizeToPrefSize;htmlComp;$container;constructor(e,t){super(),this.myWindow=e,this.form=t,this.session=t.session,this.initialized=!1,this.$container=null,this.htmlComp=null,t.popupWindow=this,e[Nr.PROP_POPUP_WINDOW]=this,e.name="Scout popup-window "+t.modelClass}_onUnload(){h().log.isDebugEnabled()&&h().log.debug("stored form ID "+this.form.id+" to session storage"),this.form.destroyed?h().log.isDebugEnabled()&&h().log.debug("form ID "+this.form.id+" is already destroyed - don't trigger unload event"):this.trigger("popupWindowUnload",this)}_onReady(){let e=this.myWindow.document,t=h()(this.myWindow),i=h()(e);if(this.myWindow[Nr.PROP_POPUP_WINDOW]=this,u.prepareDOM(e),this.$container=h()(".scout",e),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new ji),this.$container.height(t.height()),this.form.render(this.$container),this.resizeToPrefSize){let s=this.htmlComp.prefSize(),r=new F(this.myWindow.outerWidth,this.myWindow.outerHeight),o=new F(i.width(),i.height()),l=r.width-o.width,a=r.height-o.height;this.myWindow.resizeTo(s.width+l,s.height+a),this.resizeToPrefSize=!1}this.form.htmlComp.validateLayout(),this.session.keyStrokeManager.installTopLevelKeyStrokeHandlers(this.$container),this.session.focusManager.installTopLevelMouseHandlers(this.$container),u.installGlobalMouseDownInterceptor(e),h()(this.myWindow).on("unload",this._onUnload.bind(this)).on("resize",this._onResize.bind(this)),this.myWindow.opener&&(this.myWindow.onerror=this.myWindow.opener.onerror),this._updateTitle(),this.form.on("propertyChange:title propertyChange:subTitle",s=>this._updateTitle()),this.initialized=!0,this.trigger("init")}_onResize(){let e=h()(this.myWindow),t=e.width(),i=e.height(),s=this.myWindow.screenX,r=this.myWindow.screenY;h().log.isDebugEnabled()&&h().log.debug("popup-window resize: width="+t+" height="+i+" top="+r+" left="+s),this.form.storeCacheBounds(new te(s,r,t,i));let o=new F(e.width(),e.height());this.htmlComp.setSize(o)}isClosed(){return this.myWindow.closed}close(){this.myWindow.close()}_updateTitle(){let e=_.join(" - ",this.form.title,this.form.subTitle),t=this.session.desktop.title;this.title(e||t)}title(e){this.myWindow.document.title=e}}class Cp{objectType;session;init(e){this.session=e.session}openUri(e,t){h().log.isDebugEnabled()&&h().log.debug("(OpenUriHandler#openUri) uri="+e+" action="+t),e&&(t=u.nvl(t,Ie.UriAction.OPEN),t===Ie.UriAction.DOWNLOAD?this.handleUriActionDownload(e):t===Ie.UriAction.OPEN?this.handleUriActionOpen(e):t===Ie.UriAction.NEW_WINDOW?this.handleUriActionNewWindow(e):t===Ie.UriAction.POPUP_WINDOW?this.handleUriActionPopupWindow(e):t===Ie.UriAction.SAME_WINDOW&&this.handleUriActionSameWindow(e))}handleUriActionDownload(e){w.get().isIos()?w.get().isStandalone()?this.openUriInSameWindow(e):this.openUriAsNewWindow(e):w.get().browser===w.Browser.CHROME&&this.isUriWithExternallyHandledProtocol(e)?this.openUriInSameWindow(e):this.openUriInIFrame(e)}isUriWithExternallyHandledProtocol(e){return/^(callto|facetime|fax|geo|mailto|maps|notes|sip|skype|tel|google.navigation|sms|msteams):/.test(e)}handleUriActionOpen(e){w.get().isIos()?this.openUriInSameWindow(e):this.isUriWithExternallyHandledProtocol(e)?w.get().browser===w.Browser.CHROME||w.get().isAndroid()?this.openUriInSameWindow(e):this.openUriInIFrame(e):this.openUriAsNewWindow(e)}handleUriActionNewWindow(e){this.openUriAsNewWindow(e)}handleUriActionPopupWindow(e){this.openUriAsPopupWindow(e)}handleUriActionSameWindow(e){this.openUriInSameWindow(e)}openUriInSameWindow(e){window.location.assign(e)}openUriInIFrame(e){let t=this.session.$entryPoint.appendElement("<iframe>","download-frame").attr("tabindex",-2).attr("src",e);setTimeout(()=>{t.remove()},10*1e3)}openUriAsNewWindow(e){u.create(Wn,{session:this.session}).openWindow(e)}openUriAsPopupWindow(e){u.create(Wn,{session:this.session}).openWindow(e,null,"location=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes")}}class Xt extends I{desktop;outline;outlineContent;navigationHandle;headerTabArea;columns;components;tabBoxMap;layoutData;headerTabAreaController;changingCounter;changed;outlineContentVisible;navigationHandleVisible;layoutCacheKey;desktopKeyStrokeContext;_removeViewInProgress;_updateOutlineContentTimeout;_desktopOutlineChangeHandler;_desktopPropertyChangeHandler;_desktopAnimationEndHandler;_outlineNodesSelectedHandler;_outlinePageChangedHandler;_outlinePropertyChangeHandler;_outlineContentDestroyHandler;_outlineContentCssClassChangeHandler;_viewAddHandler;_viewRemoveHandler;_viewActivateHandler;_viewDeactivateHandler;constructor(){super(),this.columns=[],this.components=null,this.tabBoxMap={},this._removeViewInProgress=0,this.changingCounter=0,this.changed=!1,this.layoutCacheKey=[],this._desktopOutlineChangeHandler=this._onDesktopOutlineChange.bind(this),this._desktopPropertyChangeHandler=this._onDesktopPropertyChange.bind(this),this._desktopAnimationEndHandler=this._onDesktopAnimationEnd.bind(this),this._outlineNodesSelectedHandler=this._onOutlineNodesSelected.bind(this),this._outlinePageChangedHandler=this._onOutlinePageChanged.bind(this),this._outlinePropertyChangeHandler=this._onOutlinePropertyChange.bind(this),this._outlineContentDestroyHandler=this._onOutlineContentDestroy.bind(this),this._outlineContentCssClassChangeHandler=this._onOutlineContentCssClassChange.bind(this),this._viewAddHandler=this._onViewAdd.bind(this),this._viewRemoveHandler=this._onViewRemove.bind(this),this._viewActivateHandler=this._onViewActivate.bind(this),this._viewDeactivateHandler=this._onViewDeactivate.bind(this)}static VIEW_MIN_HEIGHT=null;static VIEW_MIN_WIDTH=null;static VIEW_AREA_COLUMN_INDEX={LEFT:0,CENTER:1,RIGHT:2};static VIEW_AREA_COLUMN_CLASSES=["west","center","east"];_init(e){super._init(e),Xt.VIEW_MIN_HEIGHT=h().pxToNumber(L.get("view-tab-box","min-height").minHeight),Xt.VIEW_MIN_WIDTH=h().pxToNumber(L.get("view-tab-box","min-width").minWidth),this.desktop=this.session.desktop,this.setLayoutData(this.desktop.benchLayoutData),this._createColumns(),this.headerTabArea=e.headerTabArea,this.headerTabArea&&(this.headerTabAreaController=u.create(Sp),this.headerTabAreaController.install(this,this.headerTabArea)),this.outlineContentVisible=u.nvl(e.outlineContentVisible,!0),this.setOutline(this.desktop.outline),this.updateNavigationHandleVisibility()}_setTabArea(e){if(this.headerTabArea=e,this.headerTabAreaController){this.headerTabAreaController.install(this,this.headerTabArea);let t=this.getTabBox("C");t.viewStack.slice().reverse().forEach(i=>{this.headerTabAreaController._onViewAdd({view:i}),t.currentView===i&&this.headerTabAreaController._onViewActivate({view:i})}),this.headerTabAreaController._onViewsChanged()}}_createColumns(){let e=this.getLayoutData(),t=[];e&&(t=this.getLayoutData().getColumns());for(let i=0;i<3;i++){let s=this.layoutCacheKey.slice();s.length>0&&s.push("column"+i);let r=u.create(gs,{parent:this,layoutData:t[i],cacheKey:s,cssClass:Xt.VIEW_AREA_COLUMN_CLASSES[i]});r.on("viewAdd",this._viewAddHandler),r.on("viewRemove",this._viewRemoveHandler),r.on("viewActivate",this._viewActivateHandler),r.on("viewDeactivate",this._viewDeactivateHandler),this.columns.push(r)}}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.desktopKeyStrokeContext=new Ee,this.desktopKeyStrokeContext.invokeAcceptInputOnActiveValueField=!0,this.desktopKeyStrokeContext.$bindTarget=this.desktop.$container,this.desktopKeyStrokeContext.$scopeTarget=this.desktop.$container,this.desktopKeyStrokeContext.registerKeyStroke(new yp(this.desktop))}_render(){this.$container=this.$parent.appendDiv("desktop-bench"),T.role(this.$container,"main"),T.label(this.$container,this.session.text("ui.MainArea")),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout()),this.htmlComp.layoutData=this.getLayoutData(),this._renderColumns(),this._revalidateSplitters(),this._renderNavigationHandleVisible(),this.session.keyStrokeManager.installKeyStrokeContext(this.desktopKeyStrokeContext),this.desktop.on("propertyChange",this._desktopPropertyChangeHandler),this.desktop.on("outlineChange",this._desktopOutlineChangeHandler),this.desktop.on("animationEnd",this._desktopAnimationEndHandler)}_createLayout(){return new Qs(Qs.Direction.ROW,this.layoutCacheKey)}visibleColumns(){return this.columns.filter(e=>e.hasViews())}_renderColumns(){this.visibleColumns().forEach(e=>this._renderColumn(e)),this.updateFirstLastMarker()}_renderColumn(e){!e||e.rendered||e.render()}_remove(){this.desktop.off("propertyChange",this._desktopPropertyChangeHandler),this.desktop.off("outlineChange",this._desktopOutlineChangeHandler),this.desktop.off("animationEnd",this._desktopAnimationEndHandler),this.session.keyStrokeManager.uninstallKeyStrokeContext(this.desktopKeyStrokeContext),super._remove()}updateFirstLastMarker(){Fe.updateFirstLastMarker(this.visibleColumns())}_renderOutlineContent(){this.outlineContent&&(delete this.outlineContent.title,delete this.outlineContent.subTitle,delete this.outlineContent.iconId,this.addView(this.outlineContent,!this.desktop.inBackground),this.desktop.rendered&&this.session.focusManager.validateFocus())}_removeOutlineContent(){this.outlineContent&&this.removeView(this.outlineContent,!1)}_createNavigationHandle(){return u.create(Ea,{parent:this,leftVisible:!1})}_renderNavigationHandle(){this.navigationHandle||(this.navigationHandle=this._createNavigationHandle(),this.navigationHandle.render(),this.navigationHandle.addCssClass("navigation-closed"),this.navigationHandle.on("action",this._onNavigationHandleAction.bind(this)))}_removeNavigationHandle(){this.navigationHandle&&(this.navigationHandle.destroy(),this.navigationHandle=null)}_renderNavigationHandleVisible(){this.navigationHandleVisible?this._renderNavigationHandle():this._removeNavigationHandle(),this.$container.toggleClass("has-navigation-handle",this.navigationHandleVisible)}postRender(){this.columns.forEach(e=>e.postRender())}setChanging(e){e?this.changingCounter++:this.changingCounter--,this.changingCounter===0&&this.changed&&this.rendered&&(this.htmlComp.layout.reset(),this.htmlComp.invalidateLayoutTree(),this.changed=!1)}updateLayoutData(e){if(this.getLayoutData()===e)return;this.setLayoutData(e);let t=e.getColumns();if(this.columns.forEach((i,s)=>{let r;this.layoutCacheKey&&this.layoutCacheKey.length>0&&(r=this.layoutCacheKey.slice(),r.push("column"+s)),i.updateLayoutData(t[s],r)}),this.rendered){let i=this.htmlComp.layout;i.setCacheKey(this.layoutCacheKey),i.reset(),this.htmlComp.invalidateLayoutTree()}this._updateSplitterMovable()}setLayoutData(e){this.layoutData!==e&&(super.setLayoutData(e),this.layoutData=e,this.layoutCacheKey=[],e.cacheKey&&this.layoutCacheKey.push(e.cacheKey))}getLayoutData(){return this.layoutData}setNavigationHandleVisible(e){this.setProperty("navigationHandleVisible",e)}setOutline(e){this.outline&&(this.outline.off("nodesSelected",this._outlineNodesSelectedHandler),this.outline.off("pageChanged",this._outlinePageChangedHandler),this.outline.off("propertyChange",this._outlinePropertyChangeHandler)),this._setProperty("outline",e),this.outline&&(this.outline.on("nodesSelected",this._outlineNodesSelectedHandler),this.outline.on("pageChanged",this._outlinePageChangedHandler),this.outline.on("propertyChange",this._outlinePropertyChangeHandler)),this.updateOutlineContent()}setOutlineContent(e){if(this.outlineContent===e)return;let t=this.outlineContent;t&&(t.off("destroy",this._outlineContentDestroyHandler),t.off("propertyChange:cssClass",this._outlineContentCssClassChangeHandler)),this.rendered&&this._removeOutlineContent(),e&&(e.one("destroy",this._outlineContentDestroyHandler),e.on("propertyChange:cssClass",this._outlineContentCssClassChangeHandler)),this._setProperty("outlineContent",e),this.desktop.header&&this.desktop.header.onBenchOutlineContentChange(e,t),this._updateOutlineContentHasDimmedBackground(),this._renderOutlineContent()}setOutlineContentVisible(e){e!==this.outlineContentVisible&&(this._setProperty("outlineContentVisible",e),this.updateOutlineContent())}bringToFront(){this.outlineContent&&this._renderOutlineContent()}sendToBack(){}_updateOutlineContentHasDimmedBackground(){if(!this.outlineContent)return;let e=!1;this.outlineContent.cssClass&&(e=this.outlineContent.cssClass.indexOf("dimmed-background")>-1),this.toggleCssClass("outline-content-has-dimmed-background",e)}_computeOutlineContentForPage(e){u.assertParameter("page",e);let t;return e.detailForm&&e.detailFormVisible&&e.detailFormVisibleByUi?(t=e.detailForm,t.uiCssClass="detail-form"):e.detailTable&&e.detailTableVisible&&(t=e.detailTable,t.uiCssClass="detail-table perma-focus"),t}_computeOutlineContent(){let e=this.outline.selectedNode();return e?this._computeOutlineContentForPage(e):this.outline.getRootContent()}updateOutlineContent(){if(!this.outlineContentVisible||!this.outline)return;let e=this._computeOutlineContent();e&&(e instanceof H&&(e.menuBar.addCssClass("main-menubar"),e.menuBar.removeCssClass("bounded")),e.displayViewId="C"),this.setOutlineContent(e)}updateOutlineContentDebounced(){clearTimeout(this._updateOutlineContentTimeout),this._updateOutlineContentTimeout=setTimeout(()=>this.updateOutlineContent(),300)}updateNavigationHandleVisibility(){this.setNavigationHandleVisible(this.desktop.navigationHandleVisible&&!this.desktop.navigationVisible)}_onDesktopOutlineChange(e){this.setOutline(this.desktop.outline),this.updateNavigationHandleVisibility()}_onOutlineContentDestroy(e){e.source===this.outlineContent&&this.setOutlineContent(null)}_onOutlineContentCssClassChange(e){this._updateOutlineContentHasDimmedBackground()}_onOutlineNodesSelected(e){e.debounce?this.updateOutlineContentDebounced():this.updateOutlineContent()}_onOutlinePageChanged(e){let t=this.outline.selectedNode();(!e.page&&!t||e.page===t)&&this.updateOutlineContent()}_onOutlinePropertyChange(e){u.isOneOf(e.propertyName,["defaultDetailForm","outlineOverview"])&&this.updateOutlineContent()}_onDesktopNavigationVisibleChange(){this.desktop.navigationVisible&&this.updateNavigationHandleVisibility()}_onDesktopNavigationHandleVisibleChange(){this.updateNavigationHandleVisibility()}_onDesktopAnimationEnd(e){this.desktop.navigationVisible||this.updateNavigationHandleVisibility()}_onBenchLayoutDataChange(){this.updateLayoutData(this.desktop.benchLayoutData)}_onDesktopPropertyChange(e){e.propertyName==="navigationVisible"?this._onDesktopNavigationVisibleChange():e.propertyName==="navigationHandleVisible"&&this._onDesktopNavigationHandleVisibleChange(),e.propertyName==="benchLayoutData"&&this._onBenchLayoutDataChange()}_onNavigationHandleAction(e){this.desktop.enlargeNavigation()}_revalidateSplitters(){this.components&&this.components.forEach(e=>{e instanceof hs&&e.destroy()}),this.components=this.visibleColumns().reduce((e,t)=>{if(e.length>0){let i=u.create(hs,{parent:this,$anchor:e[e.length-1].$container,$root:this.$container});i.render(),i.setLayoutData(Zs.fixed().withOrder(t.getLayoutData().order-1)),i.$container.addClass("line"),e.push(i)}return e.push(t),e},[]),this.components.filter(e=>e instanceof gs).reduce((e,t,i)=>(i>0&&t.$container.insertAfter(e.$container),t),void 0),this._updateSplitterMovable()}_updateSplitterMovable(){this.components&&this.components.forEach((e,t)=>{if(e instanceof hs){let i=this.components.slice(0,t).reverse(),s=this.components.slice(t+1);if(i.filter(r=>r.getLayoutData().shrink>0).length>0&&s.filter(r=>r.getLayoutData().grow>0).length>0){e.setEnabled(!0),e.on("move",this._onSplitterMove.bind(this));return}if(i.filter(r=>r.getLayoutData().grow>0).length>0&&s.filter(r=>r.getLayoutData().shrink>0).length>0){e.setEnabled(!0),e.on("move",this._onSplitterMove.bind(this));return}e.setEnabled(!1)}})}_onSplitterMove(e){let t=e.source,i=e.position-t.htmlComp.location().x-t.htmlComp.margins().left-t.htmlComp.insets().left;t.getLayoutData().diff=i,this.revalidateLayout(),t.getLayoutData().diff=null,e.preventDefault()}_onViewAdd(e){this.trigger("viewAdd",{view:e.view})}_onViewRemove(e){this.trigger("viewRemove",{view:e.view})}_onViewActivate(e){let t=e.view;this.outlineContent===t&&this.desktop.bringOutlineToFront(),this.trigger("viewActivate",{view:t})}_onViewDeactivate(e){this.outlineContent===e.view&&this.desktop.sendOutlineToBack(),this.trigger("viewDeactivate",{view:e.view})}addView(e,t){e.displayViewId=Xt.normalizeDisplayViewId(e.displayViewId);let i=this._getColumn(e.displayViewId);this.tabBoxMap[e.id]=i,i.addView(e,t),this.rendered&&i.viewCount()===1&&(this._renderColumn(i),this._revalidateSplitters(),this.updateFirstLastMarker(),this.changingCounter>0?this.changed=!0:(this.htmlComp.layout.reset(),this.htmlComp.invalidateLayoutTree()))}activateView(e){if(!this.hasView(e))return;let t=this._getColumn(e.displayViewId);t&&t.activateView(e)}_getColumn(e){let t;switch(e){case"NW":case"W":case"SW":t=this.columns[Xt.VIEW_AREA_COLUMN_INDEX.LEFT];break;case"NE":case"E":case"SE":t=this.columns[Xt.VIEW_AREA_COLUMN_INDEX.RIGHT];break;default:t=this.columns[Xt.VIEW_AREA_COLUMN_INDEX.CENTER];break}return t}removeView(e,t){let i=this.tabBoxMap[e.id];i&&(this._removeViewInProgress++,i.removeView(e,t),this._removeViewInProgress--,delete this.tabBoxMap[e.id],this.rendered&&i.viewCount()===0&&this._removeViewInProgress===0&&(i.remove(),this._revalidateSplitters(),this.updateFirstLastMarker(),this.changingCounter>0?this.changed=!0:(this.htmlComp.layout.reset(),this.htmlComp.invalidateLayoutTree())))}getComponents(){return this.components}getTabBox(e){let t=this._getColumn(e);if(t)return t.getTabBox(e)}visibleTabBoxes(){return this.visibleColumns().reduce((e,t)=>(p.pushAll(e,t.visibleTabBoxes()),e),[])}hasView(e){return this.columns.filter(t=>t.hasView(e)).length>0}getViews(e){return this.columns.reduce((t,i)=>(p.pushAll(t,i.getViews(e)),t),[])}getViewTab(e){let t=null;return this.getTabs().some(i=>i.view===e?(t=i,!0):!1),t}getTabs(){let e=[];return e=e.concat(this._getTabsForDisplayViewId("NW")),e=e.concat(this._getTabsForDisplayViewId("W")),e=e.concat(this._getTabsForDisplayViewId("SW")),e=e.concat(this._getTabsForDisplayViewId("N")),this.headerTabAreaController?e=e.concat(this.headerTabAreaController.getTabs()):e=e.concat(this._getTabsForDisplayViewId("C")),e=e.concat(this._getTabsForDisplayViewId("S")),e=e.concat(this._getTabsForDisplayViewId("NE")),e=e.concat(this._getTabsForDisplayViewId("E")),e=e.concat(this._getTabsForDisplayViewId("SE")),e}_getTabsForDisplayViewId(e){return this.getTabBox(e).getController().getTabs()}activeViews(){let e=[];return this.visibleColumns().forEach(t=>{t.visibleTabBoxes().forEach(i=>{e.push(i.currentView)})}),e}static normalizeDisplayViewId(e){switch(e){case"NW":case"W":case"SW":case"N":case"C":case"S":case"NE":case"E":case"SE":break;default:e="C";break}return e}}Z.uuidPathSkipWidgets.add(Xt);class gs extends I{tabBoxes;layoutData;components;layoutCacheKey;_widgetToTabBox;_removeViewInProgress;_viewAddHandler;_viewRemoveHandler;_viewActivateHandler;_viewDeactivateHandler;constructor(){super(),this.tabBoxes=[],this._widgetToTabBox={},this.components=null,this._removeViewInProgress=0,this._viewAddHandler=this._onViewAdd.bind(this),this._viewRemoveHandler=this._onViewRemove.bind(this),this._viewActivateHandler=this._onViewActivate.bind(this),this._viewDeactivateHandler=this._onViewDeactivate.bind(this)}static TAB_BOX_INDEX={TOP:0,CENTER:1,BOTTOM:2};static TAB_BOX_CLASSES=["north","center","south"];_init(e){super._init(e),this.layoutData=e.layoutData,this.layoutCacheKey=e.cacheKey,this.cssClass=e.cssClass,this._createTabBoxes()}_render(){this.$container=this.$parent.appendDiv("bench-column"),this.cssClass&&this.$container.addClass(this.cssClass),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(this._createLayout()),this.htmlComp.layoutData=this.getLayoutData()}_renderProperties(){super._renderProperties(),this._renderTabBoxes(),this._revalidateSplitters()}_renderTabBoxes(){this.visibleTabBoxes().forEach(e=>this._renderTabBox(e)),this.updateFirstLastMarker()}_renderTabBox(e){e.rendered||(e.render(),e.htmlComp.validateRoot=!0)}postRender(){this.tabBoxes.forEach(e=>e.postRender())}_createLayout(){return new Qs(Qs.Direction.COLUMN,this.layoutCacheKey)}updateLayoutData(e,t){if(this.getLayoutData()===e)return;this.layoutCacheKey=t,this.setLayoutData(e);let i=this.layoutData.getRows();if(this.tabBoxes.forEach((s,r)=>s.setLayoutData(i[r])),this._updateSplitterMovable(),this.rendered){let s=this.htmlComp.layout;s.setCacheKey(this.layoutCacheKey),s.reset(),this.htmlComp.invalidateLayoutTree()}}setLayoutData(e){super.setLayoutData(e),this.layoutData=e}getLayoutData(){return this.layoutData}_onViewAdd(e){this.trigger("viewAdd",{view:e.view})}_onViewRemove(e){this.trigger("viewRemove",{view:e.view})}_onViewActivate(e){this.trigger("viewActivate",{view:e.view})}_onViewDeactivate(e){this.trigger("viewDeactivate",{view:e.view})}activateView(e){this.getTabBox(e.displayViewId).activateView(e)}_createTabBoxes(){let e=[];this.layoutData&&(e=this.layoutData.getRows());for(let t=0;t<3;t++){let i=u.create(lo,{parent:this,cssClass:_.join(" ","view-tab-box",gs.TAB_BOX_CLASSES[t]),controller:u.create(xa)});i.setLayoutData(e[t]),i.on("viewAdd",this._viewAddHandler),i.on("viewRemove",this._viewRemoveHandler),i.on("viewActivate",this._viewActivateHandler),i.on("viewDeactivate",this._viewDeactivateHandler),this.tabBoxes.push(i)}}_revalidateSplitters(){this.components&&this.components.forEach(e=>{e instanceof hs&&e.destroy()}),this.components=this.visibleTabBoxes().reduce((e,t)=>{if(e.length>0){let i=u.create(hs,{parent:this,$anchor:e[e.length-1].$container,$root:this.$container,splitHorizontal:!1});i.render(),i.setLayoutData(Zs.fixed().withOrder(this._getTabBoxLayoutData(t).order-1)),i.$container.addClass("line"),e.push(i)}return e.push(t),e},[]),this.components.filter(e=>e instanceof lo).reduce((e,t,i)=>(i>0&&t.$container.insertAfter(e.$container),t),void 0),this._updateSplitterMovable()}_getTabBoxLayoutData(e){return e.getLayoutData()}_updateSplitterMovable(){this.components&&this.components.forEach((e,t)=>{if(e instanceof hs){let i=this.components.slice(0,t).reverse(),s=this.components.slice(t+1);if(i.filter(r=>this._getTabBoxLayoutData(r).shrink>0).length>0&&s.filter(r=>this._getTabBoxLayoutData(r).grow>0).length>0){e.setEnabled(!0),e.on("move",this._onSplitterMove.bind(this));return}if(i.filter(r=>this._getTabBoxLayoutData(r).grow>0).length>0&&s.filter(r=>this._getTabBoxLayoutData(r).shrink>0).length>0){e.setEnabled(!0),e.on("move",this._onSplitterMove.bind(this));return}e.setEnabled(!1)}})}_onSplitterMove(e){let t=e.source,i=e.position-t.htmlComp.location().y-t.htmlComp.margins().top-t.htmlComp.insets().top;t.getLayoutData().diff=i,this.revalidateLayout(),t.getLayoutData().diff=null,e.preventDefault()}addView(e,t){let i=this.getTabBox(e.displayViewId);this._widgetToTabBox[e.id]=i,i.addView(e,t),this.rendered&&i.viewCount()===1&&(i.rendered||i.render(),this._revalidateSplitters(),this.updateFirstLastMarker(),this.htmlComp.layout.reset(),this.htmlComp.invalidateLayoutTree())}getTabBox(e){let t;switch(e){case"NW":case"N":case"NE":t=this.tabBoxes[gs.TAB_BOX_INDEX.TOP];break;case"SW":case"S":case"SE":t=this.tabBoxes[gs.TAB_BOX_INDEX.BOTTOM];break;default:t=this.tabBoxes[gs.TAB_BOX_INDEX.CENTER];break}return t}removeView(e,t){let i=this._widgetToTabBox[e.id];i&&(this._removeViewInProgress++,i.removeView(e,t),this._removeViewInProgress--,delete this._widgetToTabBox[e.id],this.rendered&&i.viewCount()===0&&this._removeViewInProgress===0&&(i.remove(),this._revalidateSplitters(),this.updateFirstLastMarker(),this.htmlComp.layout.reset(),this.htmlComp.invalidateLayoutTree()))}viewCount(){return this.tabBoxes.map(e=>e.viewCount()).reduce((e,t)=>e+t,0)}hasView(e){return this.tabBoxes.filter(t=>t.hasView(e)).length>0}hasViews(){return this.viewCount()>0}getViews(e){return this.tabBoxes.reduce((t,i)=>(p.pushAll(t,i.getViews(e)),t),[])}getComponents(){return this.components}visibleTabBoxes(){return this.tabBoxes.filter(e=>e.hasViews())}updateFirstLastMarker(){Fe.updateFirstLastMarker(this.visibleTabBoxes())}}Z.uuidPathSkipWidgets.add(gs);class Tp extends Zs{rows;constructor(e){super(e),e=e||{},this.rows=u.nvl(e.rows,[null,null,null]),this._ensureRows()}getRows(){return this.rows}_ensureRows(){this.rows=this.rows.map((e,t)=>new Zs(e).withOrder(t*2))}}class Vr{columns;constructor(e){this.columns=[null,null,null],h().extend(this,e),this._ensureColumns()}_ensureColumns(){this.columns=this.columns.map((e,t)=>new Tp(e).withOrder(t*2))}getColumns(){return this.columns}static ensure(e){return e?e instanceof Vr?e:new Vr(e):new Vr}}class vp extends uo{constructor(e){super(),this.field=e,this.parseAndSetKeyStroke(e.selectViewTabsKeyStrokeModifier),this.registerRange(m[1],m[9]),this.renderingHints.render=!1,this.preventDefault=!0,this.inheritAccessibility=!1}_isEnabled(){return super._isEnabled()&&this.field.selectViewTabsKeyStrokesEnabled}handle(e){}}class Pa extends I{desktop;tabArea;logoUrl;logo;toolBoxVisible;toolBox;viewButtonBoxVisible;viewButtonBox;outlineContent;_desktopPropertyChangeHandler;_desktopAnimationEndHandler;_outlineContentMenuBarVisibleChangeHandler;_outlineContentCssClassChangeHandler;_viewButtonBoxPropertyChangeHandler;constructor(){super(),this.tabArea=null,this.toolBoxVisible=!0,this.viewButtonBox=null,this.viewButtonBoxVisible=!1,this.outlineContent=null,this._desktopPropertyChangeHandler=this._onDesktopPropertyChange.bind(this),this._desktopAnimationEndHandler=this._onDesktopAnimationEnd.bind(this),this._outlineContentMenuBarVisibleChangeHandler=this._onOutlineContentMenuBarVisibleChange.bind(this),this._outlineContentCssClassChangeHandler=this._onOutlineContentCssClassChange.bind(this),this._viewButtonBoxPropertyChangeHandler=this._onViewButtonBoxPropertyChange.bind(this)}_init(e){super._init(e),this.desktop=this.session.desktop,this.updateViewButtonBoxVisibility(),this.tabArea=this._createTabArea()}_createTabArea(){return u.create(Sa,$.extend({parent:this},this.tabArea))}_render(){this.$container=this.$parent.appendDiv("desktop-header"),T.role(this.$container,"banner"),T.label(this.$container,this.session.text("ui.HeaderArea")),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new xp(this)),this.desktop.on("propertyChange",this._desktopPropertyChangeHandler),this.desktop.on("animationEnd",this._desktopAnimationEndHandler),this.desktop.bench&&this._setOutlineContent(this.desktop.bench.outlineContent)}_renderProperties(){super._renderProperties(),this._renderViewButtonBoxVisible(),this._renderViewTabs(),this._renderToolBoxVisible(),this._renderLogoUrl(),this._renderInBackground()}_remove(){this.desktop.off("propertyChange",this._desktopPropertyChangeHandler),this.desktop.off("animationEnd",this._desktopAnimationEndHandler),this._setOutlineContent(null),super._remove()}_renderViewTabs(){this.tabArea.render()}_renderToolBox(){this.toolBox||(this.toolBox=this._createToolBox(),this.toolBox.render())}_createToolBox(){return u.create(Go,{parent:this,menus:this.desktop.menus})}_removeToolBox(){this.toolBox&&(this.toolBox.destroy(),this.toolBox=null)}_renderToolBoxVisible(){this.toolBoxVisible?this._renderToolBox():this._removeToolBox(),this.invalidateLayoutTree()}_renderLogoUrl(){this.logoUrl?this._renderLogo():this._removeLogo(),this.invalidateLayoutTree()}_renderLogo(){this.desktop.displayStyle!==Ie.DisplayStyle.COMPACT&&(this.logo?this.logo.setUrl(this.logoUrl):(this.logo=this._createLogo(),this.logo.render()))}_createLogo(){return u.create(gp,{parent:this,url:this.logoUrl})}_removeLogo(){this.logo&&(this.logo.destroy(),this.logo=null)}_renderViewButtonBox(){this.viewButtonBox||(this.viewButtonBox=this._createViewButtonBox(),this.viewButtonBox.on("propertyChange",this._viewButtonBoxPropertyChangeHandler),this.viewButtonBox.render(),this.viewButtonBox.$container.prependTo(this.$container),this.updateViewButtonStyling())}_createViewButtonBox(){return u.create(Fa,{parent:this,viewButtons:this.desktop.viewButtons,selectedMenuButtonAlwaysVisible:!0})}_removeViewButtonBox(){this.viewButtonBox&&(this.viewButtonBox.off("propertyChange",this._viewButtonBoxPropertyChangeHandler),this.viewButtonBox.destroy(),this.viewButtonBox=null)}_renderViewButtonBoxVisible(){this.viewButtonBoxVisible?this._renderViewButtonBox():this._removeViewButtonBox(),this.$container.toggleClass("has-view-button-box",this.viewButtonBoxVisible),this.invalidateLayoutTree()}sendToBack(){this.rendered&&this._renderInBackground()}bringToFront(){this.rendered&&this._renderInBackground()}_renderInBackground(){this.$container.toggleClass("in-background",this.desktop.inBackground)}setLogoUrl(e){this.setProperty("logoUrl",e)}setToolBoxVisible(e){this.setProperty("toolBoxVisible",e)}setViewButtonBoxVisible(e){this.setProperty("viewButtonBoxVisible",e)}setMenus(e){this.toolBox&&this.toolBox.setMenus(e)}_setOutlineContent(e){this.outlineContent!==e&&(this._detachOutlineContentHandlers(),this._setProperty("outlineContent",e),this._attachOutlineContentHandlers(),this.updateViewButtonStyling())}updateViewButtonBoxVisibility(){this.setViewButtonBoxVisible(this.desktop.viewButtons.some(e=>e.visible)&&!this.desktop.navigationVisible&&this.desktop.displayStyle!==Ie.DisplayStyle.COMPACT)}_attachOutlineContentHandlers(){this._attachOutlineContentMenuBarHandler(),this._attachOutlineContentCssClassHandler()}_attachOutlineContentMenuBarHandler(){if(!this.outlineContent)return;let e=this._outlineContentMenuBar(this.outlineContent);e&&e.on("propertyChange:visible",this._outlineContentMenuBarVisibleChangeHandler)}_attachOutlineContentCssClassHandler(){this.outlineContent&&this.outlineContent.on("propertyChange:cssClass",this._outlineContentCssClassChangeHandler)}_detachOutlineContentHandlers(){this._detachOutlineContentMenuBarHandler(),this._detachOutlineContentCssClassHandler()}_detachOutlineContentMenuBarHandler(){if(!this.outlineContent)return;let e=this._outlineContentMenuBar(this.outlineContent);e&&e.off("propertyChange:visible",this._outlineContentMenuBarVisibleChangeHandler)}_detachOutlineContentCssClassHandler(){this.outlineContent&&this.outlineContent.off("propertyChange:cssClass",this._outlineContentCssClassChangeHandler)}_outlineContentMenuBar(e){return e instanceof j?e.rootGroupBox.menuBar:e.menuBar}updateViewButtonStyling(){this._updateOutlineContentHasMenuBar(),this._updateOutlineContentHasDimmedBackground()}_getOutlineContentForViewButtonStyling(){if(!(!this.viewButtonBoxVisible||!this.outlineContent||!this.outlineContent.visible))return this.outlineContent}_updateOutlineContentHasMenuBar(){let e=this._getOutlineContentForViewButtonStyling();if(!e)return;let t=!1;if(e instanceof j&&e.detailForm){let i=e.rootGroupBox;t=i.menuBar&&i.menuBarVisible&&i.menuBar.visible}else{let i=e;t=i.menuBar&&i.menuBar.visible}this.$container.toggleClass("outline-content-has-menubar",!!t)}_updateOutlineContentHasDimmedBackground(){let e=this._getOutlineContentForViewButtonStyling();if(!e)return;let t=!1;e.cssClass&&(t=e.cssClass.indexOf("dimmed-background")>-1),this.$container.toggleClass("outline-content-has-dimmed-background",t)}_onDesktopNavigationVisibleChange(){this.desktop.navigationVisible&&this.updateViewButtonBoxVisibility()}_onDesktopAnimationEnd(e){this.updateViewButtonBoxVisibility()}onBenchOutlineContentChange(e,t){this._setOutlineContent(e)}_onDesktopPropertyChange(e){e.propertyName==="navigationVisible"&&this._onDesktopNavigationVisibleChange()}_onOutlineContentMenuBarVisibleChange(e){this._updateOutlineContentHasMenuBar()}_onOutlineContentCssClassChange(e){this._updateOutlineContentHasDimmedBackground()}_onViewButtonBoxPropertyChange(e){(e.propertyName==="menuButtons"||e.propertyName==="tabButtons")&&this.invalidateLayoutTree()}}Z.uuidPathSkipWidgets.add(Pa);class Sp extends xa{bench;tabAreaCenter;tabAreaInHeader;_viewsChangedHandler;constructor(){super(),this.bench=null,this._viewsChangedHandler=this._onViewsChanged.bind(this),this.tabAreaCenter=null,this.tabAreaInHeader=!1}install(e,t){this.bench=u.assertParameter("bench",e);let i=this.bench.getTabBox("C");this.tabAreaCenter=i.tabArea,super.install(i,t)}_installListeners(){super._installListeners(),this.bench.on("viewAdd",this._viewsChangedHandler),this.bench.on("viewRemove",this._viewsChangedHandler)}_onViewsChanged(){this.bench.getViews().some(e=>e.displayViewId!=="C")?this._setViewTabAreaInHeader(!1):this._setViewTabAreaInHeader(!0)}_setViewTabAreaInHeader(e){this.tabAreaInHeader=e,this.tabAreaCenter.setVisible(!e),this.tabArea.setVisible(e);let t=this.tabArea.session.desktop;t.rendered&&t.$container.toggleClass("view-tab-area-in-bench",!e)}getTabs(){return this.tabAreaInHeader?this.tabArea.getTabs():this.tabAreaCenter.getTabs()}_onViewTabSelect(e){super._onViewTabSelect(e),this.tabArea.updateFirstTabSelected()}}class xp extends ne{header;desktop;constructor(e){super(),this.header=e,this.desktop=e.desktop}layout(e){let t,i,s,r,o=this.header.htmlComp,l=o.size(),a=this.header.toolBox,d=this.header.viewButtonBox,c=this.header.tabArea,f=0,g=0,y=0,v=0;if(l=l.subtract(o.insets()),this.header.logo&&(g=C.size(this.header.logo.$container,!0).width),d&&(t=d.htmlComp.prefSize(!0),y=t.width,d.htmlComp.setSize(t.subtract(d.htmlComp.margins()))),c.htmlComp.$comp.cssLeft(y),a&&(i=a.htmlComp.prefSize(!0),v=i.width,Ze(),Mt()),f=V(),r=ve(),s=c.htmlComp.prefSize({widthHint:f,includeMargin:!0}),f>=r.width){f=Math.min(s.width,f),Q();return}if(a&&(i=nt(),v=i.width,Ze(),Mt()),f=V(),f>=r.width){Q();return}a&&(i=ei(),v=i.width,Ze(),Mt()),f=V(),c.displayStyle!==Vi.DisplayStyle.SPREAD_EVEN&&(f=Math.min(r.width,f));let k=c.htmlComp.layout.overflowTabItemWidth;f=Math.max(f,c.tabs.length?k:0),Q(),a&&f<=k&&(v=l.width-f-g-y,Ze(),Mt());function V(){return l.width-v-g-y}function Q(){c.htmlComp.setSize(new F(f,s.height).subtract(c.htmlComp.margins()))}function ve(){return c.htmlComp.layout.smallPrefSize({widthHint:f}).add(c.htmlComp.margins())}function Ze(){a.htmlComp.setSize(new F(v,i.height).subtract(a.htmlComp.margins()))}function nt(){return a.htmlComp.layout.compactPrefSize().add(a.htmlComp.margins())}function ei(){return a.htmlComp.layout.shrinkPrefSize().add(a.htmlComp.margins())}function Mt(){a.htmlComp.$comp.cssLeft(l.width-v-g)}}}var Dm=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let Nn=class extends se{ids};Dm([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:[String]})],Nn.prototype,"ids",void 0),Nn=Dm([ue("scout.DisposeWidgetsHybridAction")],Nn),window.scout.DataObjectInventory.get().add(Nn,"scout.DisposeWidgetsHybridAction","DisposeWidgetsHybridActionDo");class Da extends I{widgets;constructor(){super(),this.widgets={}}static get(e,t){const i=()=>e.desktop.addOns.find(r=>r instanceof Da);if(!t)return i();if(e.desktop.initialized)return $.resolvedPromise(i());const s=$.Deferred();return e.desktop.one("init",r=>s.resolve(i())),s.promise()}_init(e){super._init(e),this._setWidgets(this.widgets)}_setWidgets(e){e=this._ensureWidgets(e);const t={};for(const[s,r]of Object.entries(this.widgets))(!e[s]||e[s]!==r)&&(t[s]=r);const i={};for(const[s,r]of Object.entries(e))(!this.widgets[s]||this.widgets[s]!==r)&&(i[s]=r);this._destroyOrUnlinkChildren(Object.values(t)),this._setProperty("widgets",e),Object.entries(i).forEach(s=>{let[r,o]=s;return this._triggerWidgetAdd(r,o)}),Object.entries(t).forEach(s=>{let[r,o]=s;return this._triggerWidgetRemove(r,o)})}_ensureWidgets(e){const t={};return Object.keys(e).forEach(i=>{t[i]=this._createChildren(e[i])}),t}_triggerWidgetAdd(e,t){this.trigger(`widgetAdd:${e}`,{widget:t})}_triggerWidgetRemove(e,t){this.trigger(`widgetRemove:${e}`,{widget:t})}onHybridEvent(e,t,i,s){this.trigger(`${t}:${e}`,{data:i,contextElements:s})}onHybridWidgetEvent(e,t,i){const s=this.widgets[e];s&&(s instanceof j?this._onHybridFormEvent(s,t,i):this._onHybridWidgetEvent(s,t,i))}_onHybridWidgetEvent(e,t,i){e.trigger(t,{data:i})}_onHybridFormEvent(e,t,i){t==="data"?e.setData(i):t==="reset"?(e.setData(i),e.trigger("reset")):t==="save"?(e.setData(i),e.trigger("save")):t==="close"?e.__closeTriggered||e.trigger("close"):this._onHybridWidgetEvent(e,t,i)}_createEventId(){return yi.take(this.session)}callAction(e,t,i){const s=this._createEventId();return this.trigger("hybridAction",{data:{id:s,actionType:e,contextElements:i,data:t}}),s}callActionAndWait(e,t,i){return this.callActionAndWaitWithContext(e,t,i).then(s=>s.data)}callActionAndWaitWithContext(e,t,i){const s=this.callAction(e,t,i);return this.when(`hybridActionEnd:${s}`).then(r=>({data:r.data,contextElements:r.contextElements}))}openForm(e,t){const i=this.callAction(`scout.openForm:${e}`,t);return this.when(`widgetAdd:${i}`).then(s=>this._onFormAdd(s.widget))}createForm(e,t){const i=this.callAction(`scout.createForm:${e}`,t);return this.when(`widgetAdd:${i}`).then(s=>this._onFormAdd(s.widget))}_onFormAdd(e){return e.one("close",()=>{e.__closeTriggered=!0}),e}one(e,t){super.one(e,t)}on(e,t){return super.on(e,t)}off(e,t){super.off(e,t)}when(e){return super.when(e)}}class Em extends K{onModelAction(e){e.type==="hybridEvent"?this._onHybridEvent(e):e.type==="hybridWidgetEvent"?this._onHybridWidgetEvent(e):super.onModelAction(e)}_onHybridEvent(e){let t=Vn.jsonToContextElements(this.session,e.contextElements),i=xe.deserialize(e.data,null,{createPojoIfDoIsUnknown:!0});this.widget.onHybridEvent(e.id,e.eventType,i,t)}_onHybridWidgetEvent(e){let t=xe.deserialize(e.data,null,{createPojoIfDoIsUnknown:!0});this.widget.onHybridWidgetEvent(e.id,e.eventType,t)}_onWidgetEvent(e){e.type==="hybridAction"?this._onWidgetHybridAction(e):super._onWidgetEvent(e)}_onWidgetHybridAction(e){let t=xe.serialize(e.data.data),i=Vn.contextElementsToJson(e.data.contextElements);this._send("hybridAction",{actionType:e.data.actionType,id:e.data.id,data:t,contextElements:i||void 0})}}class Wr{objectType;widget=null;element=null;static of(e,t){return u.create(Wr,{widget:e,element:t})}init(e){u.assertProperty(e,"widget",I),h().extend(this,e)}getWidget(e){let t=u.assertValue(this.widget);return e?u.assertInstance(t,e):u.assertInstance(t,I)}getElement(e){return u.assertValue(this.optElement(e))}optElement(e){if(!this.element)return null;let t=this.element;return e?u.assertInstance(t,e):t}}class Pp{objectType;map=new Map;isEmpty(){return this.map.size===0}getList(e){return u.assertValue(this.optList(e),`Missing context elements with key "${e}"`)}optList(e){return this.map.get(e)}getSingle(e){return u.assertValue(this.optSingle(e),`Missing context element with key "${e}"`)}optSingle(e){return p.first(this.optList(e))}withMap(e){return u.assertParameter("map",e),Object.keys(e).forEach(t=>{this.map.set(t,e[t])}),this}withElements(e,t){return u.assertParameter("key",e),u.assertParameter("contextElements",t),this.map.set(e,t),this}withElement(e,t,i){u.assertParameter("key",e);let s=t instanceof Wr?t:Wr.of(t,i);return this.map.set(e,[s]),this}}class Dp{jsonToContextElements(e,t){if(u.assertParameter("session",e),!t)return null;let i=u.create(Pp);return Object.keys(t).forEach(s=>{let r=this._jsonToContextElementList(e,t[s]);i.withElements(s,r)}),i}_jsonToContextElementList(e,t){if(!t)return null;let i=[];return t.forEach(s=>{let r=this._jsonToContextElement(e,s);i.push(r)}),i}_jsonToContextElement(e,t){if(!t)return null;let i=t.widget,s=u.assertInstance(e.getModelAdapter(i),K,`No adapter found for '${i}'`),r=u.assertInstance(s.widget,I),o=t.element,l=this._jsonToModelElement(s,o);return Wr.of(r,l)}_jsonToModelElement(e,t){if(!t)return null;for(let i of mi.all()){let s=i.tryConvertFromJson(e,t);if(s)return s}throw new Error(`Unable to convert JSON to model element [adapter=${e?.id}, jsonElement=${t}]`)}contextElementsToJson(e){if(!e)return null;let t={};for(let[i,s]of e.map)t[i]=this._contextElementListToJson(s);return t}_contextElementListToJson(e){return e?e.map(t=>this._contextElementToJson(t)):null}_contextElementToJson(e){if(!e)return null;let t=u.assertInstance(K.getModelAdapterForWidget(e.widget,!0),K,"Widget does not have a model adapter"),i=this._modelElementToJson(t,e.element);return{widget:t.id,element:i||void 0}}_modelElementToJson(e,t){if(!t)return null;for(let i of mi.all()){let s=i.tryConvertToJson(e,t);if(s)return s}throw new Error(`Unable to convert model element to JSON [adapter=${e?.id}, modelElement=${t}]`)}}const Vn=u.create(Dp);class mi{static DEFAULT_ORDER=5e3;static _INSTANCE=null;_registry=[];register(e){let i={order:arguments.length>1&&arguments[1]!==void 0?arguments[1]:mi.DEFAULT_ORDER,converter:e instanceof zr?e:null,converterConstructor:e instanceof zr?null:e};return p.insertSorted(this._registry,i,(s,r)=>s.order-r.order),i}unregister(e){return p.remove(this._registry,e)}all(){return this._registry.map(e=>(e.converter=e.converter||u.create(e.converterConstructor),e.converter))}static get(){return mi._INSTANCE||(mi._INSTANCE=u.create(mi)),mi._INSTANCE}static all(){return mi.get().all()}}class zr{tryConvertFromJson(e,t){return this._acceptAdapter(e)&&this._acceptJsonElement(t)?this._jsonToElement(e,t):null}tryConvertToJson(e,t){return this._acceptAdapter(e)&&this._acceptModelElement(t)?this._elementToJson(e,t):null}}class Ur extends zr{static JSON_ELEMENT_PREFIX="col:";_acceptAdapter(e){return e instanceof Rs}_acceptJsonElement(e){return b.isString(e)&&_.startsWith(e,Ur.JSON_ELEMENT_PREFIX)}_acceptModelElement(e){return e instanceof le}_jsonToElement(e,t){let i=e.widget,s=_.removePrefix(t,Ur.JSON_ELEMENT_PREFIX);return u.assertValue(i.columnById(s),`Unknown column with id "${s}" in table ${e.id}`)}_elementToJson(e,t){let i=t.id;return _.addPrefix(i,Ur.JSON_ELEMENT_PREFIX)}}mi.get().register(Ur);class Gr extends zr{static JSON_ELEMENT_PREFIX="row:";_acceptAdapter(e){return e instanceof Rs}_acceptJsonElement(e){return b.isString(e)&&_.startsWith(e,Gr.JSON_ELEMENT_PREFIX)}_acceptModelElement(e){return e instanceof Rt}_jsonToElement(e,t){let i=e.widget,s=_.removePrefix(t,Gr.JSON_ELEMENT_PREFIX);return u.assertValue(i.rowById(s),`Unknown row with id "${s}" in table ${e.id}`)}_elementToJson(e,t){let i=t.id;return _.addPrefix(i,Gr.JSON_ELEMENT_PREFIX)}}mi.get().register(Gr);class Ep extends zr{_acceptAdapter(e){return e instanceof or}_acceptJsonElement(e){return b.isString(e)}_acceptModelElement(e){return e instanceof Fi}_jsonToElement(e,t){let s=e.widget.nodesMap[t];return u.assertValue(s,`Unknown node with id "${t}" in tree ${e.id}`)}_elementToJson(e,t){return t.id}}mi.get().register(Ep);class Jt extends I{desktop;outline;handleVisible;handle;toolBox;toolBoxVisible;viewButtonBox;layoutData;$body;htmlCompBody;$screenReaderStatus;_outlinePropertyChangeHandler;_outlineSelectedNodesChangeHandler;_desktopPropertyChangeHandler;_viewButtonBoxPropertyChangeHandler;constructor(){super(),this.$body=null,this.layoutData={},this.toolBoxVisible=!1,this.viewButtonBox=null,this.handleVisible=!0,this.$screenReaderStatus=null,this._outlinePropertyChangeHandler=this._onOutlinePropertyChange.bind(this),this._outlineSelectedNodesChangeHandler=this._onOutlineSelectedNodesChange.bind(this),this._desktopPropertyChangeHandler=this._onDesktopPropertyChange.bind(this),this._viewButtonBoxPropertyChangeHandler=this._onViewButtonBoxPropertyChange.bind(this)}static DEFAULT_STYLE_WIDTH=null;static BREADCRUMB_STYLE_WIDTH=null;static MIN_WIDTH=null;_init(e){super._init(e),Jt.MIN_WIDTH=L.getSize("desktop-navigation","min-width","minWidth",49),Jt.DEFAULT_STYLE_WIDTH=L.getSize("desktop-navigation","width","width",290),Jt.BREADCRUMB_STYLE_WIDTH=L.getSize("desktop-navigation-breadcrumb","width","width",240),this.desktop=this.parent,this.updateHandleVisibility(),this._setOutline(e.outline),this.viewButtonBox=u.create(Fa,{parent:this,viewButtons:this.desktop.viewButtons}),this.viewButtonBox.on("propertyChange",this._viewButtonBoxPropertyChangeHandler)}_render(){this.$container=this.$parent.appendDiv("desktop-navigation"),T.role(this.$container,"navigation"),T.label(this.$container,this.session.text("ui.NavigationArea")),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Fp(this)),this.htmlComp.layoutData=this.layoutData,this.$body=this.$container.appendDiv("navigation-body").on("mousedown",this._onNavigationBodyMouseDown.bind(this)),this.htmlCompBody=x.install(this.$body,this.session),this.htmlCompBody.setLayout(new ji(null,{exact:!0})),this._addScreenReaderStatus(),this.desktop.on("propertyChange",this._desktopPropertyChangeHandler)}_addScreenReaderStatus(){this.$screenReaderStatus=this.$container.appendDiv(),T.role(this.$screenReaderStatus,"status"),T.screenReaderOnly(this.$screenReaderStatus)}_renderScreenReaderStatus(){if(!this.$screenReaderStatus||!this.outline)return;this.$screenReaderStatus.empty();let e=this.session.text("ui.NavigationX",this.outline.title),t=this.outline.selectedNode();if(t){let i=[];for(i.unshift(t);t;)t=t.parentNode,t&&i.unshift(t);i.forEach(r=>{e+=" "+_.join(" ",this.session.text("ui.LevelX",r.level+1),_.plainText(r.text))});let s=i[i.length-1];s.expanded&&(e+=" "+_.join(" ",this.session.text("ui.Expanded"),this.session.text("ui.SubItemCountX",s.childNodes?.length)))}this.$screenReaderStatus.appendSpan().addClass("sr-outline-path").text(e)}_remove(){this.desktop.off("propertyChange",this._desktopPropertyChangeHandler),super._remove()}_renderProperties(){super._renderProperties(),this._renderViewButtonBox(),this._renderViewButtonBoxVisible(),this._renderToolBoxVisible(),this._renderOutline(),this._renderHandleVisible(),this._renderInBackground()}_renderInBackground(){this.$container.toggleClass("in-background",this.desktop.inBackground&&this.desktop.displayStyle!==Ie.DisplayStyle.COMPACT)}_renderViewButtonBox(){this.viewButtonBox.render(),this.viewButtonBox.$container.insertBefore(this.$body)}_removeOutline(){this.outline&&this.outline.remove()}_renderOutline(){this.outline&&(this.outline.render(this.$body),this.outline.invalidateLayoutTree(),this.rendered&&this.outline.validateFocus(),this._renderScreenReaderStatus())}setOutline(e){this.setProperty("outline",e)}_setOutline(e){let t=this.outline;this.outline&&(this.outline.off("propertyChange",this._outlinePropertyChangeHandler),this.outline.off("nodesSelected",this._outlineSelectedNodesChangeHandler)),this.rendered&&this._removeOutline(),this.outline=e,this.outline&&(this.outline.setParent(this),this.outline.setBreadcrumbTogglingThreshold(Jt.BREADCRUMB_STYLE_WIDTH),this.outline.toggleBreadcrumbStyleEnabled&&t&&t.toggleBreadcrumbStyleEnabled&&t.displayStyle&&this.outline.setDisplayStyle(t.displayStyle),this.outline.inBackground=this.desktop.inBackground,this.outline.on("propertyChange",this._outlinePropertyChangeHandler),this.outline.on("nodesSelected",this._outlineSelectedNodesChangeHandler),this._updateHandle())}_renderViewButtonBoxVisible(){this.$container.toggleClass("view-button-box-invisible",!this.viewButtonBox.visible)}sendToBack(){this.outline&&this.outline.sendToBack(),this.rendered&&this._renderInBackground()}bringToFront(){this.outline&&this.outline.bringToFront(),this.rendered&&this._renderInBackground()}setToolBoxVisible(e){this.setProperty("toolBoxVisible",e)}setHandleVisible(e){this.setProperty("handleVisible",e)}_updateHandle(){this.handle&&this.handle.setRightVisible(this.outline&&this.outline.toggleBreadcrumbStyleEnabled&&this.desktop.outlineDisplayStyle()===fe.DisplayStyle.BREADCRUMB)}updateHandleVisibility(){this.setHandleVisible(this.desktop.navigationHandleVisible)}_renderToolBoxVisible(){this.toolBoxVisible?this._renderToolBox():this._removeToolBox()}_renderToolBox(){this.toolBox||(this.toolBox=u.create(Go,{parent:this,menus:this.desktop.menus}),this.toolBox.render())}_removeToolBox(){this.toolBox&&(this.toolBox.destroy(),this.toolBox=null)}_renderHandleVisible(){this.handleVisible?this._renderHandle():this._removeHandle()}_createHandle(){return u.create(Ea,{parent:this,rightVisible:!1,horizontalAlignment:Yi.HorizontalAlignment.RIGHT})}_renderHandle(){this.handle||(this.handle=this._createHandle(),this.handle.render(),this.handle.addCssClass("navigation-open"),this.handle.on("action",this._onHandleAction.bind(this)),this._updateHandle())}_removeHandle(){this.handle&&(this.handle.destroy(),this.handle=null)}_onNavigationBodyMouseDown(e){this.desktop.bringOutlineToFront()}_onViewButtonBoxPropertyChange(e){e.propertyName==="visible"&&this.rendered&&this._renderViewButtonBoxVisible()}_onOutlineSelectedNodesChange(){this._renderScreenReaderStatus()}_onOutlinePropertyChange(e){e.propertyName==="displayStyle"&&this._updateHandle()}_onDesktopPropertyChange(e){e.propertyName==="navigationHandleVisible"&&this.updateHandleVisibility()}_onHandleAction(e){e.left?this.desktop.shrinkNavigation():this.desktop.enlargeNavigation()}}Z.uuidPathSkipWidgets.add(Jt);class Ea extends Yi{desktopKeyStrokeContext;_initKeyStrokeContext(){super._initKeyStrokeContext(),this.desktopKeyStrokeContext=new Ee,this.desktopKeyStrokeContext.$bindTarget=this.session.desktop.$container,this.desktopKeyStrokeContext.$scopeTarget=this.session.desktop.$container,this.desktopKeyStrokeContext.registerKeyStrokes([new Rp(this),new Ap(this)])}_render(){super._render(),this.$container.addClass("desktop-navigation-handle"),this.session.keyStrokeManager.installKeyStrokeContext(this.desktopKeyStrokeContext),T.label(this.$left,this.session.text("ui.NavigationX",this.session.text("ui.Collapse"))),T.label(this.$right,this.session.text("ui.NavigationX",this.session.text("ui.Expand")))}_remove(){super._remove(),this.session.keyStrokeManager.uninstallKeyStrokeContext(this.desktopKeyStrokeContext)}}class Fp extends ne{navigation;constructor(e){super(),this.navigation=e}layout(e){let t=this.navigation.htmlComp,i=t.size({exact:!0}).subtract(t.insets()),s=this.navigation.toolBox,r=0,o=0,l=this.navigation.viewButtonBox;if(l.visible){let c=l.htmlComp.prefSize(!0);r=c.height,o=i.width,s&&(o=c.width);let f=new F(o,r).subtract(l.htmlComp.margins());l.htmlComp.setSize(f)}if(s){let c,f=this.navigation.outline;if(o===0&&f&&f.$title){let g=C.prefSize(f.$title).width;c=new F(i.width-g,0).subtract(s.htmlComp.margins())}else c=new F(i.width-o,r).subtract(s.htmlComp.margins());s.htmlComp.setSize(c)}let a=this.navigation.htmlCompBody,d=new F(i.width,i.height).subtract(a.margins());a.$comp.cssTop(r),d.height-=r,a.setSize(d)}preferredLayoutSize(e,t){let i=this.navigation.htmlCompBody,s=i.prefSize(t).add(i.margins()),r=new F(0,0),o=this.navigation.viewButtonBox;if(o){let d=o.htmlComp.prefSize(!0);r.width+=d.width,r.height=Math.max(r.height,d.height)}let l=this.navigation.toolBox;if(l){let d=l.htmlComp.prefSize(!0);r.width+=d.width,r.height=Math.max(r.height,d.height)}let a=this.navigation.htmlComp;return s.height+=r.height,s.width=Math.max(s.width,r.width),s=s.add(a.insets()),s}}class Rp extends B{desktop;constructor(e){super(),this.field=e,this.desktop=e.session.desktop,this.ctrl=!0,this.which=[m.forBrowser(m.ANGULAR_BRACKET)],this.renderingHints.$drawingArea=(t,i)=>this.desktop.$container,this.inheritAccessibility=!1}_accept(e){return super._accept(e)||B.acceptModifiers(this,e)&&u.isOneOf(e.which,m.forBrowser(m.ANGULAR_BRACKET,"ctrl"))}_isEnabled(){return super._isEnabled()&&this.field.leftVisible}handle(e){this.desktop.shrinkNavigation()}_postRenderKeyBox(e,t){t.addClass("navigation-handle-key-box left");let s=this.field.$left.offsetTo(this.desktop.$container),r=s.left-t.outerWidth(!0),o=s.top;t.cssLeft(r).cssTop(o)}}class Ap extends B{desktop;constructor(e){super(),this.field=e,this.desktop=e.session.desktop,this.ctrl=!0,this.shift=!0,this.which=[m.forBrowser(m.ANGULAR_BRACKET)],this.renderingHints.$drawingArea=(t,i)=>this.desktop.$container,this.inheritAccessibility=!1}_accept(e){return super._accept(e)||B.acceptModifiers(this,e)&&u.isOneOf(e.which,m.forBrowser(m.ANGULAR_BRACKET,"ctrl"))}_isEnabled(){return super._isEnabled()&&this.field.rightVisible}handle(e){this.desktop.enlargeNavigation()}_postRenderKeyBox(e,t){t.addClass("navigation-handle-key-box right");let i=this.field,s=i.$right.offsetTo(this.desktop.$container),r=s.left+i.$right.outerWidth(),o=s.top;t.cssLeft(r).cssTop(o)}}class _i extends qh{duration;removeTimeout;nativeOnly;nativeNotificationTitle;nativeNotificationStatus;nativeNotificationVisibility;nativeNotification;nativeNotificationShown;$loader;_removing;constructor(){super(),this.closable=!0,this.duration=5e3,this.removeTimeout=null,this._removing=!1,this.nativeOnly=!1,this.nativeNotificationTitle=null,this.nativeNotificationStatus=null,this.nativeNotificationVisibility=_i.NativeNotificationVisibility.NONE,this.nativeNotification=null,this.nativeNotificationShown=!1}static NativeNotificationVisibility={NONE:"none",BACKGROUND:"background",ALWAYS:"always"};static INFINITE=-1;_init(e){super._init(e),this.setParent(this.session.desktop),this.setOwner(this.parent);let t=this.session.desktop.nativeNotificationDefaults;t&&(this.nativeNotificationTitle=e.nativeNotificationTitle!==void 0?e.nativeNotificationTitle:t.title,this.nativeNotificationStatus?this.nativeNotificationStatus.iconId=this.nativeNotificationStatus.iconId!==void 0?this.nativeNotificationStatus.iconId:t.iconId:this.nativeNotificationStatus=new E({iconId:t.iconId}),this.nativeNotificationVisibility=u.nvl(e.nativeNotificationVisibility!==void 0?e.nativeNotificationVisibility:t.visibility,_i.NativeNotificationVisibility.NONE)),this.resolveTextKeys(["nativeNotificationTitle"])}_render(){this._initNativeNotification(),this.$container=this.$parent.prependDiv("desktop-notification"),this.$content=this.$container.appendDiv("desktop-notification-content"),this.$messageText=this.$content.appendDiv("desktop-notification-message"),this.$loader=this.$container.appendDiv("desktop-notification-loader"),T.role(this.$container,"alert"),w.get().supportsCssAnimation()&&this.$loader.addClass("animated"),this.nativeOnly&&this.setVisible(!1)}_renderLoading(){this.$container.toggleClass("loading",this.loading),this.$loader.setVisible(this.loading)}_destroy(){this.nativeNotification&&this.nativeNotification.close(),super._destroy()}_isDocumentHidden(){return document.hidden}_showNativeNotification(e){if(e==="denied"||e==="default"){this.nativeOnly&&this.hide();return}let t=u.nvl(this.nativeNotificationTitle,""),i=(this.nativeNotificationStatus||{}).message;_.empty(i)&&(i=(this.status||{}).message),i||(i=""),this.htmlEnabled&&(i=_.plainText(i,{removeFontIcons:!0}));let s=(this.nativeNotificationStatus||{}).iconId;_.empty(s)&&(s=void 0),this.nativeNotification=new Notification(t,{body:i,icon:s}),this.nativeNotification.addEventListener("show",r=>{this._setNativeNotificationShown(!0)}),this.nativeNotification.addEventListener("click",r=>{window.focus()}),this.nativeNotification.addEventListener("close",r=>{this.nativeOnly&&this.hide(),this.nativeNotification=null,this._setNativeNotificationShown(!1)})}_initNativeNotification(){if(!this.nativeNotificationShown){if(this.nativeNotificationVisibility===_i.NativeNotificationVisibility.NONE){this._hideLaterIfNativeOnly();return}if(this.nativeNotificationVisibility===_i.NativeNotificationVisibility.BACKGROUND&&!this._isDocumentHidden()){this._hideLaterIfNativeOnly();return}if(!window.Notification||Notification.permission==="denied"){this._hideLaterIfNativeOnly();return}this._checkNotificationPromise()?Notification.requestPermission().then(this._showNativeNotification.bind(this)):Notification.requestPermission(this._showNativeNotification.bind(this))}}_hideLaterIfNativeOnly(){this.nativeOnly&&setTimeout(()=>this.hide())}_checkNotificationPromise(){try{Notification.requestPermission().then()}catch{return!1}return!0}_onCloseIconClick(){this.hide()}show(){this.session.desktop.addNotification(this)}hide(){this._removing||(this.trigger("close"),this.session.desktop.removeNotification(this))}fadeIn(e){this.render(e),w.get().supportsCssAnimation()&&this.$container.addClassForAnimation("desktop-notification-slide-in")}fadeOut(){if(!(this._removing||this.destroying)){if(this._removing=!0,!w.get().supportsCssAnimation()||!this.rendered){this.destroy();return}if(!this.$container.isVisible()){this.destroy();return}this.$container.addClass("desktop-notification-fade-out"),this.$container.oneAnimationEnd(()=>{this.destroy()})}}invalidateLayoutTree(){}_setNativeNotificationShown(e){this._setProperty("nativeNotificationShown",e)}setNativeNotificationTitle(e){this.setProperty("nativeNotificationTitle",e)}setNativeNotificationStatus(e){this.setProperty("nativeNotificationStatus",e)}_setNativeNotificationStatus(e){e=E.ensure(e),this._setProperty("nativeNotificationStatus",e)}setNativeNotificationVisibility(e){this.setProperty("nativeNotificationVisibility",e)}}class Fm extends Yh{constructor(){super(),this._addRemoteProperties(["nativeNotificationShown"])}}class $p extends _i{connectFailedReset;connectionInterruptedStatus;reconnectingStatus;constructor(){super(),this.connectFailedReset=null}_init(e){super._init(e),this.closable=!1,this.duration=_i.INFINITE,this.connectionInterruptedStatus=new E({message:this.session.text("ui.ConnectionInterrupted"),severity:E.Severity.ERROR}),this.reconnectingStatus=new E({message:this.session.text("ui.Reconnecting_"),severity:E.Severity.ERROR}),this._setStatus(this.connectionInterruptedStatus)}_render(){super._render(),this.$content.addClass("offline-message"),this.$messageText.addClass("offline-message-text")}reconnect(){this.setLoading(!0),this.connectFailedReset&&clearTimeout(this.connectFailedReset),this.setStatus(this.reconnectingStatus)}reconnectFailed(){this.connectFailedReset=setTimeout(()=>{this.connectFailedReset=null,this.setLoading(!1),this.setStatus(this.connectionInterruptedStatus)},1100)}reconnectSucceeded(){this.setLoading(!1),this.connectFailedReset&&clearTimeout(this.connectFailedReset),this.setStatus({message:this.session.text("ui.ConnectionReestablished"),severity:E.Severity.OK})}}class Wn{objectType;session;preserveOpener;constructor(){this.session=null,this.preserveOpener=!1}init(e){h().extend(this,e)}openWindow(e,t,i,s){t=t||"scout_"+new Date().getTime();let r=window.open("",t,i);if(r){this.preserveOpener||(r.opener=null);try{r.window.location.href=e}catch(o){this._handleInvalidUri(e,r,o);return}s&&s(r)}else h().log.warn("Popup-blocker detected! Show link to open window manually"),this.showNotification(()=>{this.openWindow(e,t,i,s)})}showNotification(e){let t,i=this.session.desktop;typeof e=="string"&&(t=e);let s=u.create(Mp,{parent:i,linkUrl:t,preserveOpener:this.preserveOpener});!t&&h().isFunction(e)&&s.on("linkClick",e),s.show()}_handleInvalidUri(e,t,i){u.create(ri,{logError:!0,displayError:!1,sendError:!1}).handle(i),t.close(),Ri.createOk(this.session.desktop).withHeader(this.session.text("ui.UnexpectedProblem")).withBody(this.session.text("ui.InvalidUriMsg")).withSeverity(E.Severity.ERROR).buildAndOpen()}}class Mp extends _i{preserveOpener;linkUrl;linkText;$link;constructor(){super(),this.duration=_i.INFINITE,this.preserveOpener=!1}_init(e){super._init(e),this.linkText=u.nvl(this.linkText,this.session.text("ui.OpenManually")),this._setStatus({message:this.session.text("ui.PopupBlockerDetected"),severity:E.Severity.WARNING})}_render(){super._render(),this.$messageText.addClass("popup-blocked-title"),this.$link=this.$content.appendElement("<a>","popup-blocked-link").text(this.linkText).on("click",this._onLinkClick.bind(this))}_renderProperties(){super._renderProperties(),this._renderLinkUrl()}_renderLinkUrl(){this.linkUrl?(this.$link.attr("href",this.linkUrl).attr("target","_blank"),this.preserveOpener||this.$link.attr("rel","noreferrer noopener")):this.$link.removeAttr("href").removeAttr("target")}_onLinkClick(e){this.trigger("linkClick"),this.hide()}}class Go extends rd{constructor(){super(),this.uiMenuCssClass=_.join(" ",this.uiMenuCssClass,"desktop-tool-box-item")}_initMenu(e){super._initMenu(e),e.popupHorizontalAlignment=_e.Alignment.CENTER,e.setShrinkable(!0)}_render(){super._render(),this.$container.addClass("desktop-tool-box")}}Z.uuidPathSkipWidgets.add(Go);class kp extends Rr{constructor(e){super(e)}_postRenderKeyBox(e,t){let i=e.outerWidth(),s=e.find(".key-box").outerWidth(),r=i/2-s/2;e.find(".key-box").cssLeft(r)}}class Ip extends ce{displayStyle;selectedAsMenu;_desktopInBackgroundHandler;constructor(){super(),this.showTooltipWhenSelected=!1,this.displayStyle="TAB",this.selectedAsMenu=!1,this._desktopInBackgroundHandler=this._onDesktopInBackgroundChange.bind(this)}_init(e){super._init(e),this.session.desktop.on("propertyChange:inBackground",this._desktopInBackgroundHandler)}_destroy(){this.session.desktop.off("propertyChange:inBackground",this._desktopInBackgroundHandler),super._destroy()}renderAsTab(e){let t=e.appendDiv("view-tab-wrapper");this.render(t),this.$container.addClass("view-tab view-button-tab")}_render(){this.$container=this.$parent.appendDiv("view-button").on("mousedown",this._onMouseEvent.bind(this)),this.htmlComp=x.install(this.$container,this.session),this.$container.prependDiv("edge left"),this.$container.appendDiv("edge right")}_remove(){let e=this.$container.parent();e.hasClass("view-tab-wrapper")&&e.remove(),super._remove()}_renderProperties(){super._renderProperties(),this._renderInBackground()}_renderInBackground(){this.session.desktop.displayStyle!==Ie.DisplayStyle.COMPACT&&(this.rendering||(this.session.desktop.inBackground?this.$container.addClassForAnimation("animate-bring-to-back"):this.$container.addClassForAnimation("animate-bring-to-front")),this.$container.toggleClass("in-background",this.session.desktop.inBackground))}_renderText(){T.label(this.$container,this.text)}setDisplayStyle(e){this.setProperty("displayStyle",e)}_onMouseEvent(e){this.doAction()}_createActionKeyStroke(){return new kp(this)}setSelectedAsMenu(e){this.selectedAsMenu=e}_onDesktopInBackgroundChange(e){this.rendered&&this._renderInBackground()}}class Lp extends er{}class Fa extends I{desktop;viewMenuTab;viewButtons;menuButtons;tabButtons;selectedMenuButtonAlwaysVisible;_desktopOutlineChangeHandler;_viewButtonPropertyChangeHandler;constructor(){super(),this.viewMenuTab=null,this.viewButtons=[],this.menuButtons=[],this.tabButtons=[],this._desktopOutlineChangeHandler=this._onDesktopOutlineChange.bind(this),this._viewButtonPropertyChangeHandler=this._onViewButtonPropertyChange.bind(this),this.selectedMenuButtonAlwaysVisible=!1,this._addWidgetProperties(["viewButtons"])}_init(e){super._init(e),this.desktop=this.session.desktop,this.viewMenuTab=u.create(Np,{parent:this}),this._setViewButtons(this.viewButtons),this.desktop.on("outlineChange",this._desktopOutlineChangeHandler)}_render(){this.$container=this.$parent.appendDiv("view-button-box"),this.htmlComp=x.install(this.$container,this.session),this.viewMenuTab.render(),this._onDesktopOutlineChange()}_renderProperties(){super._renderProperties(),this._renderTabButtons()}_remove(){this.desktop.off("outlineChange",this._desktopOutlineChangeHandler),this.viewButtons.forEach(e=>e.off("selected",this._viewButtonPropertyChangeHandler)),super._remove()}setSelectedMenuButtonVisible(e){this.viewMenuTab.setSelectedButtonVisible(e)}setSelectedMenuButtonAlwaysVisible(e){this.setProperty("selectedMenuButtonAlwaysVisible",e)}_setSelectedMenuButtonAlwaysVisible(e){this._updateSelectedMenuButtonVisibility()}setViewButtons(e){this.setProperty("viewButtons",e)}_setViewButtons(e){this.viewButtons&&this.viewButtons.forEach(t=>t.off("propertyChange",this._viewButtonPropertyChangeHandler)),this._setProperty("viewButtons",e),this.viewButtons.forEach(t=>t.on("propertyChange",this._viewButtonPropertyChangeHandler)),this._updateViewButtons()}_setTabButtons(e){this._setProperty("tabButtons",e)}_removeTabButtons(){this.tabButtons.forEach(e=>e.remove())}_renderTabButtons(){this.tabButtons.forEach((e,t)=>e.renderAsTab(this.$container)),Fe.updateFirstLastMarker(this.tabButtons)}_updateViewButtons(){let e=this.viewButtons.filter(s=>s.visible),t=e.filter(s=>s.displayStyle==="MENU"),i=null;t.length>1?i=e.filter(s=>s.displayStyle==="TAB"):(i=e,t=[]),this._setMenuButtons(t),this.rendered&&this._removeTabButtons(),this._setTabButtons(i),this.rendered&&this._renderTabButtons(),this._updateVisibility(),this._updateSelectedMenuButtonVisibility()}_updateVisibility(){this.setVisible(this.tabButtons.length+this.menuButtons.length>1)}_setMenuButtons(e){this._setProperty("menuButtons",e),this.viewMenuTab.setViewButtons(this.menuButtons)}_updateSelectedMenuButtonVisibility(){this.setSelectedMenuButtonVisible(this.selectedMenuButtonAlwaysVisible||this.tabButtons.length>=1&&this.menuButtons.length>=1)}_onDesktopOutlineChange(){let e=this.desktop.outline;this.viewButtons.forEach(t=>{t instanceof jo&&t.onOutlineChange(e)})}_onViewButtonSelected(e){this.viewButtons.forEach(t=>{t!==e.source&&t.isToggleAction()&&t.setSelected(!1)}),this.viewMenuTab.onViewButtonSelected()}_onViewButtonPropertyChange(e){e.propertyName==="selected"?this._onViewButtonSelected(e):(e.propertyName==="visible"||e.propertyName==="displayStyle")&&this._updateViewButtons()}}class Bp extends B{constructor(e){super(),this.field=e,this.which=[m.F2],this.stopPropagation=!0,this.renderingHints.$drawingArea=(t,i)=>this.field.selected?this.field.dropdown.$container:this.field.selectedButton.$container}handle(e){this.field.selected?this.field.togglePopup():this.field.selectedButton&&this.field.selectedButton.doAction()}_postRenderKeyBox(e,t){let i=e.outerWidth(),s=e.find(".key-box").outerWidth(),r=i/2-s/2;e.find(".key-box").cssLeft(r)}}class Op extends tr{defaultIconId;viewMenus;constructor(){super(),this.cssClass="view-menu-popup",this.defaultIconId=null,this.viewMenus=[],this.trimWidth=!0}_init(e){super._init(e);let t=this._createTiles(),i=t.every(o=>!o.widgets[0].visible);this.content=u.create(hr,{parent:this,tiles:t,cssClass:i?"no-icons":"",selectable:!0,multiSelect:!1,gridColumnCount:this._computeGridColumnCount(t),layoutConfig:{columnWidth:100,rowHeight:-1,vgap:10,hgap:10}});let r=this.content.tiles.find(o=>o.viewMenu.selected);r&&this.content.selectTile(r),this.content.on("propertyChange:selectedTiles",o=>{this._renderSelectedTiles()})}_computeGridColumnCount(e){return e.length>8?4:e.length>4?3:2}_createTiles(){return this.viewMenus.map(e=>({objectType:tp,displayStyle:$t.DisplayStyle.PLAIN,cssClass:u.nvl(e.cssClass,"")+" view-menu-tile "+(e.selected?"checked ":"")+(e.iconId?"":"text-only"),modelClass:e.modelClass,classId:e.classId,viewMenu:e,enabled:e.enabled,gridDataHints:{useUiHeight:!0},widgets:[{objectType:Es,iconDesc:e.iconId,visible:!!e.iconId,prepend:!0},{objectType:Cl,value:e.text,cssClass:"label"}]}))}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.registerKeyStroke(new Hp(this))}_renderContent(){super._renderContent(),T.role(this.content.$container,"menu"),this.content.$container.on("click",".tile",e=>{let t=u.widget(e.target);t instanceof $t||(t=t.findParent($t)),this.activateTile(t)}),this._renderTiles(),this._renderSelectedTiles()}_renderTiles(){this.content.tiles.forEach(e=>{T.role(e.$container,"menuitem"),this._linkWidgetLabels(e)})}_linkWidgetLabels(e){let t=e.$container.children(".label");t.length>0&&T.linkElementWithLabel(e.$container,t.eq(0))}_renderSelectedTiles(){let e=this.content.selectedTiles;e.length===1&&T.linkElementWithActiveDescendant(this.content.$container,e[0].$container)}activateTile(e){!e||!e.viewMenu.enabledComputed||(e.viewMenu.doAction(),this.close())}}class Hp extends B{constructor(e){super(),this.field=e,this.which=[m.ENTER,m.SPACE],this.renderingHints.$drawingArea=(t,i)=>{let s=this.field.content.selectedTiles[0];if(s&&s.rendered)return s.$container},this.inheritAccessibility=!1}accept(e){return super.accept(e)&&this.field.content.selectedTiles.length===1&&this.field.content.selectedTiles[0].enabledComputed}handle(e){this.field.activateTile(this.field.content.selectedTiles[0])}}class Np extends I{selected;selectedButtonVisible;defaultIconId;viewButtons;selectedButton;dropdown;popup;desktopKeyStrokeContext;_desktopInBackgroundHandler;constructor(){super(),this.viewButtons=[],this.selected=!1,this.selectedButton=null,this.selectedButtonVisible=!0,this.defaultIconId=q.FOLDER,this._desktopInBackgroundHandler=this._onDesktopInBackgroundChange.bind(this),this._addWidgetProperties(["selectedButton"]),this._addPreserveOnPropertyChangeProperties(["selectedButton"])}_init(e){super._init(e),this.dropdown=u.create(ce,{parent:this,iconId:q.ANGLE_DOWN,tabbable:!1,cssClass:"view-menu",toggleAction:!0}),this.dropdown.on("action",this.togglePopup.bind(this)),this._setViewButtons(this.viewButtons),this.session.desktop.on("propertyChange:inBackground",this._desktopInBackgroundHandler)}_destroy(){this.session.desktop.off("propertyChange:inBackground",this._desktopInBackgroundHandler),super._destroy()}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.desktopKeyStrokeContext=new Ee,this.desktopKeyStrokeContext.invokeAcceptInputOnActiveValueField=!0,this.desktopKeyStrokeContext.$bindTarget=this.session.desktop.$container,this.desktopKeyStrokeContext.$scopeTarget=this.session.desktop.$container,this.desktopKeyStrokeContext.registerKeyStroke(new Bp(this))}_render(){this.$container=this.$parent.appendDiv("view-tab view-menu-tab"),this.htmlComp=x.install(this.$container,this.session),this.dropdown.render(this.$container),this.session.keyStrokeManager.installKeyStrokeContext(this.desktopKeyStrokeContext),this.$container.appendDiv("edge right")}_remove(){this.session.keyStrokeManager.uninstallKeyStrokeContext(this.desktopKeyStrokeContext),super._remove(),this.selectedButton&&this.selectedButton.remove()}_renderProperties(){super._renderProperties(),this._renderSelectedButtonVisible(),this._renderSelected(),this._renderInBackground()}setViewButtons(e){this.setProperty("viewButtons",e)}_setViewButtons(e){this._setProperty("viewButtons",e),this.setVisible(this.viewButtons.length>0);let t=this._findSelectedViewButton();t?this.setSelectedButton(t):this.setSelectedButton(p.find(this.viewButtons,i=>i.selectedAsMenu)||this.viewButtons[0]),this.setSelected(!!t)}setSelectedButton(e){this.selectedButton&&this.selectedButton.cloneOf===e||e&&this.setProperty("selectedButton",e)}_setSelectedButton(e){this.viewButtons.forEach(i=>i.setSelectedAsMenu(i===e));let t=this.selectedButton;t||(t=u.create(jo,{parent:this,displayStyle:"TAB"})),t.cloneOf&&t.cloneOf.unmirror(t),t.cloneOf=e,e.cloneProperties.forEach(i=>t.callSetter(i,e[i])),t.setIconId(e.iconId||this.defaultIconId),e.mirror({delegateEventsToOriginal:["acceptInput","action"],delegateAllPropertiesToClone:!0,delegateAllPropertiesToOriginal:!0,excludePropertiesToOriginal:["selected"]},t),this._setProperty("selectedButton",t)}_renderSelectedButton(){this._renderSelectedButtonVisible()}setSelectedButtonVisible(e){this.setProperty("selectedButtonVisible",e)}_renderSelectedButtonVisible(){this.$container.toggleClass("selected-button-invisible",!this.selectedButtonVisible),this.selectedButton&&(this.selectedButtonVisible?this.selectedButton.rendered||(this.selectedButton.render(),this.selectedButton.$container.prependTo(this.$container),this.invalidateLayoutTree()):this.selectedButton.rendered&&(this.selectedButton.remove(),this.invalidateLayoutTree()))}setSelected(e){this.setProperty("selected",e)}_renderSelected(){this.$container.select(this.selected)}_findSelectedViewButton(){return p.find(this.viewButtons,e=>e.selected)}togglePopup(){this.popup?this._closePopup():this._openPopup()}_openPopup(){this.popup||(this.popup=u.create(Op,{parent:this,viewMenus:this.viewButtons,defaultIconId:this.defaultIconId,$anchor:this.$parent}),this.popup.open(),this.popup.one("destroy",e=>{this.dropdown.setSelected(!1),this.popup=null}))}_closePopup(){this.popup&&this.popup.close()}_renderInBackground(){this.session.desktop.displayStyle!==Ie.DisplayStyle.COMPACT&&(this.rendering||(this.session.desktop.inBackground?this.$container.addClassForAnimation("animate-bring-to-back"):this.$container.addClassForAnimation("animate-bring-to-front")),this.$container.toggleClass("in-background",this.session.desktop.inBackground))}onViewButtonSelected(){let e=this._findSelectedViewButton();e&&this.setSelectedButton(e),this.setSelected(!!e),this._closePopup()}_onDesktopInBackgroundChange(e){this.rendered&&this._renderInBackground()}}var Rm=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class ht extends Fi{uuid;pageParam;nodeType;compactRoot;detailTable;detailTableVisible;detailForm;detailFormVisible;detailFormVisibleByUi;navigateButtonsVisible;tableStatusVisible;htmlComp;drillDownOnRowClick;overviewIconId;showTileOverview;inheritMenusFromParentTablePage;detailMenuContributors;row;tile;events;pageChanging;userPreferenceContext;modelClass;classId;_tableFilterHandler;_tableRowClickHandler;_detailTableModel;_detailFormModel;_detailMenusChangeHandler;constructor(){super(),this.uuid=null,this.pageParam=null,this.nodeType=null,this.compactRoot=!1,this.detailTable=null,this.detailTableVisible=!0,this.detailForm=null,this.detailFormVisible=!0,this.detailFormVisibleByUi=!0,this.navigateButtonsVisible=!0,this.modelClass=null,this.classId=null,this.tableStatusVisible=!0,this.drillDownOnRowClick=!1,this.overviewIconId=null,this.showTileOverview=!1,this.inheritMenusFromParentTablePage=!0,this.detailMenuContributors=[],this.events=new Ui,this.events.registerSubTypePredicate("propertyChange",(e,t)=>e.propertyName===t),this.pageChanging=0,this._tableFilterHandler=this._onTableFilter.bind(this),this._tableRowClickHandler=this._onTableRowClick.bind(this),this._detailTableModel=null,this._detailFormModel=null,this._detailMenusChangeHandler=this._onMenuOwnerMenusChange.bind(this)}static NodeType={NODES:"nodes",TABLE:"table"};_init(e){try{this.setPageChanging(!0),this._detailTableModel=ht._removePropertyIfLazyLoading(e,"detailTable"),this._detailFormModel=ht._removePropertyIfLazyLoading(e,"detailForm"),super._init(e),this._resolveIconIds(["overviewIconId"]),this._setPageParam(this.pageParam);let t=this._createDetailMenuContributors();e.detailMenuContributors&&(t=[...t,...e.detailMenuContributors]),this._setDetailMenuContributors(t),this._internalInitTable(),this._internalInitDetailForm()}finally{this.setPageChanging(!1)}}minimalInit(){let e=this._jsonModel();Object.assign(this,e),this._setPageParam(this.pageParam)}buildUuid(e){return Z.get().uuid(this,e)}buildUuidPath(e){return Z.get().uuidPath(this,e)}setUuid(e){this.uuid=e}static _removePropertyIfLazyLoading(e,t){let i=e[t];return typeof i=="string"||i instanceof I?null:(delete e[t],i)}_destroy(){this.trigger("destroying"),super._destroy(),this.detailTable instanceof H&&(this.detailTable.destroy(),this.detailTable=null),this.detailForm instanceof j&&(this.detailForm.destroy(),this.detailForm=null),this.trigger("destroy")}setOverviewIconId(e){this.overviewIconId=e}_createDetailMenuContributors(){return[Kp]}_setDetailMenuContributors(e){this.detailMenuContributors=(e||[]).map(t=>(t=u.ensure(t),t.setPage(this),t))}_internalInitTable(){let e=this.detailTable;if(e){let t=this.outline._createChild(e);this._setDetailTable(t)}}_internalInitDetailForm(){let e=this.detailForm;if(e){let t=this.outline._createChild(e);this._setDetailForm(t)}}ensureDetailTable(){this.detailTable||this.setDetailTable(this.createDetailTable())}createDetailTable(){let e=this._createDetailTable();return!e&&this._detailTableModel&&(e=this.outline._createChild(this._detailTableModel),this._detailTableModel=null),e}_createDetailTable(){return null}ensureDetailForm(){this.detailForm||this.setDetailForm(this.createDetailForm())}createDetailForm(){let e=this._createDetailForm();return!e&&this._detailFormModel&&(e=this.outline._createChild(this._detailFormModel),this._detailFormModel=null),e}_createDetailForm(){return null}_initDetailForm(e){e instanceof j&&(e.setModal(!1),e.setClosable(!1),e.setDisplayHint(j.DisplayHint.VIEW),e.setDisplayViewId("C"),e.setShowOnOpen(!1),this._updateDetailFormMenus()),e instanceof Al&&e.setPage(this)}_updateDetailMenus(){this._updateDetailFormMenus(),this._updateDetailTableMenus()}_updateDetailFormMenus(){this._updateDetailMenusForMenuOwner(this.detailForm?.rootGroupBox)}_updateDetailTableMenus(){this._updateDetailMenusForMenuOwner(this.detailTable)}_updateDetailMenusForMenuOwner(e){if(!e)return;e.off("propertyChange:menus",this._detailMenusChangeHandler);let t=e.menus.filter(s=>!s.__contributed),i=t;for(const s of this.detailMenuContributors)i=s.contribute(i,e);p.diff(i,t).forEach(s=>{s.__contributed=!0}),e.setMenus(i),e.on("propertyChange:menus",this._detailMenusChangeHandler)}_onMenuOwnerMenusChange(e){this._updateDetailMenusForMenuOwner(e.source)}isMenuInheritedFromParentTablePage(e){return this.inheritMenusFromParentTablePage}_destroyDetailForm(e){e instanceof Al&&e.setPage(null),e.owner===this.outline&&e.destroy()}_initDetailTable(e){e.uuidParent=this,e.userPreferenceContext=this.userPreferenceContext,e.menuBar.setPosition(Ce.Position.TOP),e.on("filter",this._tableFilterHandler),this.drillDownOnRowClick&&(e.on("rowClick",this._tableRowClickHandler),e.setMultiSelect(!1)),e.setTableStatusVisible(this.tableStatusVisible),this._updateDetailTableMenus()}_destroyDetailTable(e){e.off("filter",this._tableFilterHandler),e.off("rowClick",this._tableRowClickHandler),e.owner===this.outline&&e.destroy()}_decorate(){super._decorate(),this.$node&&(yt.applyInfo(this,this.$node),this.$node.toggleClass("compact-root",this.compactRoot),this.$node.toggleClass("has-tile-overview",this.showTileOverview||this.compactRoot&&this.outline.detailContent instanceof qo))}activate(){this.ensureDetailTable(),this.ensureDetailForm()}deactivate(){}getOutline(){return this.parent}get outline(){return this.parent}pagesForTableRows(e){return e.map(t=>t.page).filter(Boolean)}setDetailForm(e){e!==this.detailForm&&this._setDetailForm(e)}_setDetailForm(e){let t=this.detailForm;t!==e&&t instanceof I&&this._destroyDetailForm(t),this.detailForm=e,e&&(e.one("destroy",()=>{this.detailForm===e&&(this.detailForm=null)}),this._initDetailForm(e)),this.triggerPropertyChange("detailForm",t,e),this.outline.pageChanged(this)}setDetailTable(e){e!==this.detailTable&&this._setDetailTable(e)}_setDetailTable(e){let t=this.detailTable;t!==e&&t instanceof I&&this._destroyDetailTable(t),this.detailTable=e,e&&(e.one("destroy",()=>{this.detailTable===e&&(this.detailTable=null)}),this._initDetailTable(e)),this.triggerPropertyChange("detailTable",t,e),this.outline.pageChanged(this)}updatePagesFromTableRows(e){return e.filter(t=>!!t.page).map(t=>t.page.updatePageFromTableRow(t))}updatePageFromTableRow(e){let t=e.page;t.enabled=e.enabled;const i=t._computeSummaryColumns(e);t.text=t.computeTextForRow(e,i);const s=i[0];if(s){const r=s.cell(e);t.htmlEnabled=r.htmlEnabled,t.cssClass=r.cssClass,t.iconId=r.iconId||e.iconId}return t}computeTextForRow(e,t){return t||(t=this._computeSummaryColumns(e)),_.join(" ",...t.map(i=>i.cellText(e)))}_computeSummaryColumns(e){if(!e)return[];const t=e.table;if(this.outline.compact&&t.compactColumn)return[t.compactColumn];const i=t.summaryColumns();if(i.length)return i;const s=t.visibleColumns(!1,!0);return s.sort((r,o)=>rt.NUMERIC.compare(r.index,o.index)),s.slice(0,1)}getDisplayText(){return this.htmlEnabled?_.plainText(this.text):this.text}_pageParam(e){let t={parent:this.outline};return h().extend(t,e),t}reloadPage(){this.outline&&this.loadChildren()}linkWithRow(e){this.row=e,e.page=this,this.outline.trigger("pageRowLink",{page:this,row:e})}unlinkWithRow(e){delete this.row,delete e.page}_onTableFilter(e){this.outline.mediator.onTableFilter(e,this)}_onTableRowClick(e){this.drillDownOnRowClick&&(this.leaf||(this.outline.drillDown(e.row.page),e.source.deselectRow(e.row)))}matchesPageParam(e){return gt.get(this.session).pageParamsMatch(this.pageParam,e)}_setPageParam(e){e?u.assertInstance(e,Ko):e=this._computeDummyPageParam(),this.pageParam=e}_computeDummyPageParam(){let e=this.buildUuid();return e?u.create(Bs,{pageId:e}):null}getTableRowIdentifier(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return null}setPageChanging(e){if(e){this.pageChanging++;return}this.pageChanging&&this.pageChanging--}triggerPropertyChange(e,t,i){return u.assertParameter("propertyName",e),this.trigger("propertyChange",{propertyName:e,oldValue:t,newValue:i})}trigger(e,t){let i;return t instanceof qe?i=t:i=new qe(t),i.source=this,this.events.trigger(e,i),i}one(e,t){this.events.one(e,t)}on(e,t){return this.events.on(e,t)}off(e,t){this.events.off(e,t)}}class Ko extends se{}let Bs=class extends Ko{pageId};Rm([Reflect.metadata("scout.m.t",String)],Bs.prototype,"pageId",void 0),Bs=Rm([ue("scout.PageIdDummyPageParam")],Bs);class Vp{resolve(e){return e?._type?.endsWith("PageParam")?Ko:null}}xe.doTypeResolvers.push(new Vp),window.scout.DataObjectInventory.get().add(Bs,"scout.PageIdDummyPageParam","PageIdDummyPageParamDo");class Kr extends ht{constructor(){super(),this.nodeType=ht.NodeType.NODES,this.reloadable=Object.getPrototypeOf(this)._createChildPages!==Kr.prototype._createChildPages}_createDetailTable(){let e=u.create(H,{parent:this.parent,id:"PageWithNodesTable",autoResizeColumns:!0,headerVisible:!1,hasReloadHandler:this.reloadable,columns:[{id:"NodeColumn",objectType:le}]});return e.menuBar.setPosition(Ce.Position.TOP),e.on("rowAction",this._onDetailTableRowAction.bind(this)),e.on("reload",this._onDetailTableReload.bind(this)),e}_initDetailTable(e){super._initDetailTable(e),this.rebuildDetailTableInternal()}_onDetailTableRowAction(e){this.outline.mediator.onTableRowAction(e,this)}_onDetailTableReload(e){this.expandedLazy&&this.outline.setNodeExpanded(this,!1),this.reloadPage()}_rebuildDetailTable(e){let t=this.detailTable;if(!t)return;this._unlinkAllTableRows(t.rows),t.deleteAllRows();let i=this._createTableRowsForChildPages(e);t.insertRows(i)}rebuildDetailTableInternal(){this.childrenLoaded&&this._rebuildDetailTable(this.childNodes)}_unlinkAllTableRows(e){e.forEach(t=>{t.page&&t.page.unlinkWithRow(t)})}_createTableRowsForChildPages(e){return e.map(t=>{let i=u.create(Rt,{parent:this.detailTable,cells:[t.text]});return t.linkWithRow(i),i})}loadChildren(){return this.childrenLoaded=!1,this._createChildPages().then(e=>{this._rebuildDetailTable(e),this.outline.deleteNodes(p.diff(this.childNodes,e),this),this.outline.insertNodes(e,this),this.childrenLoaded=!0})}_createChildPages(){return h().resolvedPromise(this.childNodes)}}class zn extends ht{alwaysCreateChildPage;_tableRowDeleteHandler;_tableRowInsertHandler;_tableRowUpdateHandler;_tableRowActionHandler;_tableRowOrderChangeHandler;_tableDataLoadHandler;_tableControlsChangeHandler=this._onTableControlsChange.bind(this);_searchFormTableControlSearchHandler=this._onSearchFormTableControlSearch.bind(this);_searchFormTableControlResetHandler=this._onSearchFormTableControlReset.bind(this);constructor(){super(),this.nodeType=ht.NodeType.TABLE,this.inheritMenusFromParentTablePage=!1,this.alwaysCreateChildPage=!1,this._tableRowDeleteHandler=this._onTableRowsDeleted.bind(this),this._tableRowInsertHandler=this._onTableRowsInserted.bind(this),this._tableRowUpdateHandler=this._onTableRowsUpdated.bind(this),this._tableRowActionHandler=this._onTableRowAction.bind(this),this._tableRowOrderChangeHandler=this._onTableRowOrderChanged.bind(this),this._tableDataLoadHandler=this._onTableReload.bind(this)}_init(e){super._init(e),this.outline.compact&&(this.setAlwaysCreateChildPage(!0),this.setLeaf(!1))}setAlwaysCreateChildPage(e){this.alwaysCreateChildPage=e}_initDetailTable(e){if(super._initDetailTable(e),this.outline.compact){e.setCompact(!0),e.compactHandler.setMoreLinkAvailable(!1),e.compactHandler.setLineCustomizer(i=>i.textBlock.setHtmlToPlainTextEnabled(!0));const t=this._findSearchFormTableControl(e);for(const i of e.tableControls)i!==t&&i.setVisibleGranted(!1)}e.on("rowsDeleted allRowsDeleted",this._tableRowDeleteHandler),e.on("rowsInserted",this._tableRowInsertHandler),e.on("rowsUpdated",this._tableRowUpdateHandler),e.on("rowAction",this._tableRowActionHandler),e.on("rowOrderChanged",this._tableRowOrderChangeHandler),e.on("reload",this._tableDataLoadHandler),e.hasReloadHandler=!0,e.insertMenus([u.create(mu,{parent:e})]),e.on("propertyChange:tableControls",this._tableControlsChangeHandler),this._addSearchFormTableControlListeners(this._findSearchFormTableControl(e)),this.one("propertyChange:detailTable",t=>{t.newValue===e&&this._initDetailTableUiPreferences(e)})}_initDetailTableUiPreferences(e){e.setUiPreferencesEnabled(!0)}_destroyDetailTable(e){e.off("rowsDeleted allRowsDeleted",this._tableRowDeleteHandler),e.off("rowsInserted",this._tableRowInsertHandler),e.off("rowsUpdated",this._tableRowUpdateHandler),e.off("rowAction",this._tableRowActionHandler),e.off("rowOrderChanged",this._tableRowOrderChangeHandler),e.off("reload",this._tableDataLoadHandler),e.off("propertyChange:tableControls",this._tableControlsChangeHandler),this._removeSearchFormTableControlListeners(this._findSearchFormTableControl(e)),super._destroyDetailTable(e)}_onTableRowsDeleted(e){if(this.leaf)return;const t=p.ensure(e.rows),i=[];t.forEach(s=>{const r=s.page;r&&(r.unlinkWithRow(s),i.push(r))}),this.outline.mediator.onTableRowsDeleted(t,i,this)}_onTableRowsInserted(e){if(this.leaf)return;let t=p.ensure(e.rows),i=t.map(s=>this._createChildPageInternal(s)).filter(Boolean);this.outline.mediator.onTableRowsInserted(t,i,this)}_onTableRowsUpdated(e){this.outline.mediator.onTableRowsUpdated(e,this)}_onTableRowAction(e){this.outline.mediator.onTableRowAction(e,this)}_onTableRowOrderChanged(e){this.outline.mediator.onTableRowOrderChanged(e,this)}_onTableReload(e){this.expandedLazy&&this.outline.setNodeExpanded(this,!1),this.loadTableData(e.reloadReason)}_onTableControlsChange(e){p.ensure(e.oldValue).filter(t=>t instanceof Bl).forEach(t=>this._removeSearchFormTableControlListeners(t)),this._addSearchFormTableControlListeners(this.getSearchFormTableControl())}_addSearchFormTableControlListeners(e){e?.on("search",this._searchFormTableControlSearchHandler),e?.on("reset",this._searchFormTableControlResetHandler)}_removeSearchFormTableControlListeners(e){e?.off("search",this._searchFormTableControlSearchHandler),e?.off("reset",this._searchFormTableControlResetHandler)}_onSearchFormTableControlSearch(e){this.detailTable.reload(H.ReloadReason.SEARCH),this.outline.compact&&this.getSearchFormTableControl().setSelected(!1)}_onSearchFormTableControlReset(e){this.detailTable.reload(H.ReloadReason.SEARCH)}_createChildPageInternal(e){let t=this.createChildPage(e);return!t&&this.alwaysCreateChildPage&&(t=this.createDefaultChildPage(e)),t&&(t.linkWithRow(e),t=t.updatePageFromTableRow(e)),t}createChildPage(e){return this._createChildPage(e)}_createChildPage(e){return null}createDefaultChildPage(e){return u.create(Up,{parent:this.outline,row:e})}loadChildren(){if(this.ensureDetailTable(),!this.detailTable)return h().resolvedPromise();this.childrenLoaded=!1;const e=h().Deferred();return this.one("load error",t=>e.resolve()),this.detailTable.reload(),e.promise().then(()=>{this.childrenLoaded=!0})}_createSearchFilter(){return this.getSearchFilter()}_findSearchFormTableControl(e){return e?.findTableControl(Bl)}getSearchFormTableControl(){return this._findSearchFormTableControl(this.detailTable)}getSearchForm(){return this.getSearchFormTableControl()?.form||null}getSearchFilter(){return this.getSearchForm()?.exportData()}setSearchFilter(e,t){let i=this.getSearchForm();if(!i)return;let s=i.data;i.setData(e),i.importData(),t?i.markAsSaved():i.setData(s)}resetSearchFilter(){this.getSearchForm()?.reset()}_withMaxRowCountContribution(e){return u.create(Tn).withMaxRowCountContribution(e,this.detailTable)}loadTableData(e){this.ensureDetailTable(),this.detailTable.setLoading(!0);const t=this._getRestoreSelectionInfo();return this._loadTableData(this._createSearchFilter()).then(i=>this._onLoadTableDataDone(i,t)).catch(i=>this._onLoadTableDataFail(i,t))}_getRestoreSelectionInfo(){let e=!1,t=null;if(this.outline.selectedNode()){let i=this.outline.selectedNode();for(;i?.parentNode;){if(i.parentNode===this){e=!0,t=i.row?.getKeyValues();break}i=i.parentNode}}return{restoreSelection:e,selectedRowKey:t}}_restoreSelection(e){if(e)try{const{restoreSelection:t,selectedRowKey:i}=e;if(t&&!this.outline.selectedNode()){let s=this.detailTable.selectedRow()?.page||this.detailTable.getRowByKey(i)?.page||this;this.outline.selectNode(s)}}catch(t){h().log.warn("Unable to restore selection.",t)}}_loadTableData(e){return h().resolvedPromise()}_onLoadTableDataDone(e,t){let i=!1;try{const s=p.ensure(this._transformTableDataToTableRows(e)),r=this._getLimitedResultInfoDo(e);this._readLimitedResultInfo(s.length,r),this.detailTable.replaceRows(s),this.detailTable.setLimitedResultTableStatus(!!r?.limitedResult),i=!0}finally{this._onLoadTableDataAlways(t)}i&&this.trigger("load")}_readLimitedResultInfo(e,t){t&&(u.create(Tn).isLoadMoreDataPossible(e,t.estimatedRowCount,t.maxRowCount)&&this.detailTable.setMaxRowCount(t.maxRowCount),this.detailTable.setEstimatedRowCount(t.estimatedRowCount))}_getLimitedResultInfoDo(e){return xe.getContribution("scout.LimitedResultInfoContribution",e)}_onLoadTableDataFail(e,t){try{this.detailTable.setTableStatus(E.error({message:this.session.text("ErrorWhileLoadingData")})),h().log.error("Failed to load tableData. error=",e),this.detailTable.deleteAllRows()}finally{this._onLoadTableDataAlways(t),this.trigger("error",{error:e})}}_onLoadTableDataAlways(e){this._restoreSelection(e),this.detailTable.setLoading(!1)}_transformTableDataToTableRows(e){return e}getTableRowIdentifier(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return gt.get(this.session).createTableRowIdentifier(this,e,t)}}class Wp extends zo{page;outline;constructor(){super(),this.page=null}_init(e){super._init(e),this.label=this.page.text,this.iconId=this.page.overviewIconId,this.labelHtmlEnabled=this.page.htmlEnabled,this.on("click",t=>{this.outline.selectNode(this.page)})}notifyPageChanged(){this.setLabel(this.page.text),this.setIconId(this.page.overviewIconId),this.setLabelHtmlEnabled(this.page.htmlEnabled)}}class Ra extends hr{compact;compactLayoutConfig;outline;page;nodes;_outlineNodeChangedHandler;_outlineStructureChangedHandler;constructor(){super(),this.compact=!1,this.compactLayoutConfig=new Nt({columnWidth:120,rowHeight:100,hgap:15,vgap:15}),this.outline=null,this.page=null,this.nodes=null,this.scrollable=!1,this.renderAnimationEnabled=!0,this.startupAnimationEnabled=!0,this._outlineNodeChangedHandler=this._onOutlineNodeChanged.bind(this),this._outlineStructureChangedHandler=this._onOutlineStructureChanged.bind(this)}_init(e){super._init(e),this.nodes=this.nodes||this.page&&this.page.childNodes||this.outline&&this.outline.nodes,this._setCompact(this.compact),this.setOutline(this.outline),this.setPage(this.page),this.setNodes(this.nodes),this._setCompactLayoutConfig(this.compactLayoutConfig)}_destroy(){this.setOutline(null),this.setPage(null),this.setNodes(null),super._destroy()}_createKeyStrokeContext(){return new Ee}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.keyStrokeContext.$bindTarget=this.session.$entryPoint,this.keyStrokeContext.registerKeyStroke(new zp(this))}setOutline(e){this.outline&&(this.outline.off("nodeChanged pageChanged",this._outlineNodeChangedHandler),this.outline.off("nodesDeleted",this._outlineStructureChangedHandler),this.outline.off("nodesInserted",this._outlineStructureChangedHandler),this.outline.off("allChildNodesDeleted",this._outlineStructureChangedHandler),this.outline.off("childNodeOrderChanged",this._outlineStructureChangedHandler)),this._setProperty("outline",e),this.outline&&(this.outline.on("nodeChanged pageChanged",this._outlineNodeChangedHandler),this.outline.on("nodesDeleted",this._outlineStructureChangedHandler),this.outline.on("nodesInserted",this._outlineStructureChangedHandler),this.outline.on("allChildNodesDeleted",this._outlineStructureChangedHandler),this.outline.on("childNodeOrderChanged",this._outlineStructureChangedHandler))}setCompact(e){this.setProperty("compact",e)}_setCompact(e){this._setProperty("compact",e),this.compact?this.setLayoutConfig(this.compactLayoutConfig):this.initialized&&this.setLayoutConfig(new Nt),this.setGridColumnCount(this.compact?3:4),this.startupAnimationEnabled=!this.compact,this.initialized&&this._rebuild()}_setCompactLayoutConfig(e){this._setProperty("compactLayoutConfig",Nt.ensure(e||{}))}setPage(e){this._setProperty("page",e)}setNodes(e){this._setProperty("nodes",e),this._rebuild()}_createPageTiles(e){return(e||[]).map(t=>this._createPageTile(t))}_createPageTile(e){let t=u.create(fp,{parent:this,cssClass:this.compact?"compact":null,tileWidget:{objectType:Wp,outline:this.outline,page:e}});return e.tile=t,t}_rebuild(){this.setTiles(this._createPageTiles(this.nodes))}_onOutlineNodeChanged(e){let i=(e.node||e.page).tile;if(!i)return;i.tileWidget.notifyPageChanged()}_onOutlineStructureChanged(e){if(this.page)this.page===e.parentNode&&this.setNodes(this.page.childNodes);else{let t=e;(t.nodes&&t.nodes.some(s=>!s.parentNode)||e.type==="allChildNodesDeleted")&&this.setNodes(this.outline.nodes)}}}class zp extends uo{constructor(e){super(),this.field=e,this.registerRange(m[1],()=>m[Math.min(this._tiles().length,9)]),this.renderingHints.$drawingArea=(t,i)=>{let s=i.which-m[1],r=this._tiles();return s<r.length&&r[s].tileWidget instanceof zo?r[s].tileWidget.$fieldContainer:null}}_accept(e){if(!super._accept(e)||this.field&&this.field.outline&&this.field.outline.inBackground)return!1;let i=m.codesToKeys[e.which]-1,s=this._tiles();return!!(i<s.length&&s[i].tileWidget instanceof zo&&(e._$element=s[i].$container,e._$element))}handle(e){e._$element.data("widget").tileWidget.doAction()}_tiles(){return this.field.tiles}}class Up extends Kr{constructor(){super(),this.detailTableVisible=!1,this.detailFormVisible=!1,this.leaf=!0}_createDetailTable(){return null}_init(e){u.assertParameter("row",e.row,Rt),super._init(e),this.text=this.computeTextForRow(this.row)}}class Gp{page;objectType;setPage(e){u.assertParameter("page",e),this.page=e}_cloneMenus(e,t){return e?e.map(i=>this._cloneMenu(i,t)):null}_cloneMenu(e,t){if(!e)return null;const i=e.clone({parent:t,menuTypes:[]},{delegateEventsToOriginal:["action"],delegateAllPropertiesToClone:!0,excludePropertiesToClone:["menuTypes","childActions"]});return e.childActions?.length>0&&i.setChildActions(this._cloneMenus(e.childActions,i)),i}}class Kp extends Gp{contribute(e,t){return[...this._computeParentTablePageMenus(t),...e]}_computeParentTablePageMenus(e){if(!this.page.parentNode||this.page.outline.compact&&e instanceof H)return[];const t=this.page.parentNode.detailTable,i=this.page.row;return!t||!i||t!==i.table?[]:this._cloneMenus(t.menus,e)}_cloneMenus(e,t){return this._getRelevantParentTablePageMenus(e).filter(i=>this.page.isMenuInheritedFromParentTablePage(i)).map(i=>this._cloneMenu(i,t))}_getRelevantParentTablePageMenus(e){return $e.filter(e,H.MenuType.SingleSelection)}}class Un{session;objectType;static _INSTANCES=new Map;_objectTypeByUuid=new Map;init(e){this.session=u.assertProperty(e,"session",vt)}findObjectTypeForPageParam(e){if(!e)return null;if(e instanceof Bs)return this._findObjectTypeForDummyPageParam(e);const t=e.constructor,i=Le.get().getObjectType(t);if(i?.endsWith("PageParamDo")){const s=_.removeSuffix(i,"ParamDo");if(!!ni.resolveType(s))return s}return null}_findObjectTypeForDummyPageParam(e){return this._objectTypeByUuid.get(e.pageId)||this._initObjectTypeByUuid(),this._objectTypeByUuid.get(e.pageId)??null}_initObjectTypeByUuid(){for(const e of Le.get().getSubClassesOf(ht)){let t=this._getPageUuid(e);if(t){let i=Le.get().getObjectType(e);this._objectTypeByUuid.set(t,i)}}}_getPageUuid(e){let t=null;try{if(t=new e,t.minimalInit(),t.pageParam instanceof Bs)return t.pageParam.pageId}catch(i){let r=`Unable to create and initialize ${Le.get().getObjectType(e)}. Cannot check for PageParam. Error: ${i.message}`;$.log.error(r),this.session.sendLogRequest(r)}finally{t&&t.destroy()}}static get(e){return e=e||G.get().sessions[0],u.assertParameter("session",e),b.getOrSetIfAbsent(Un._INSTANCES,e,t=>u.create(Un,{session:t}))}}class jp{accept(e){return e.parentNode?e.parentNode.filterAccepted?!e.parentNode.detailTable||!e.row?!0:e.row.filterAccepted:!1:!0}}class bi extends fe{compact;defaultDetailForm;detailContent;embedDetailContent;inBackground;iconId;iconVisible;mediator;navigateButtonsVisible;navigateUpInProgress;icon;outlineOverview;outlineOverviewVisible;title;titleVisible;titleMenuBar;nodeMenuBar;nodeMenuBarVisible;detailMenuBar;nodePaddingLevelHierarchyRow;detailMenuBarVisible;selectedViewTabs;views;dialogs;formController;messageBoxes;messageBoxController;fileChoosers;fileChooserController;$title;$titleText;_detailContentDestroyHandler;_detailMenusNodesSelectedHandler;_detailMenusChangeHandler;_detailMenusDestroyHandler;_defaultDetailFormDestroyHandler;constructor(){super(),this.compact=!1,this.defaultDetailForm=null,this.detailContent=null,this.embedDetailContent=!1,this.inBackground=!1,this.iconId=null,this.iconVisible=!1,this.mediator=null,this.navigateButtonsVisible=!0,this.navigateUpInProgress=!1,this.outlineOverview=null,this.outlineOverviewVisible=!0,this.toggleBreadcrumbStyleEnabled=!0,this.title=null,this.titleVisible=!0,this.menus=[],this.titleMenuBar=null,this.nodeMenuBar=null,this.nodeMenuBarVisible=!1,this.detailMenuBar=null,this.detailMenuBarVisible=!1,this.dialogs=[],this.views=[],this.messageBoxes=[],this.fileChoosers=[],this.selectedViewTabs=new Map,this.formController=null,this.messageBoxController=null,this.fileChooserController=null,this.textFilterEnabled=!1,this._detailContentDestroyHandler=this._onDetailContentDestroy.bind(this),this._detailMenusNodesSelectedHandler=null,this._defaultDetailFormDestroyHandler=this._onDefaultDetailFormDestroy.bind(this),this._additionalContainerClasses+=" outline",this.nodePaddingLevelCheckable=20,this.nodePaddingLevelNotCheckable=20,this.nodePaddingLevelHierarchyRow=this.nodePaddingLevelNotCheckable,this._scrollDirections="y",this._addWidgetProperties(["defaultDetailForm","views","selectedViewTabs","dialogs","messageBoxes","fileChoosers"]),this._addPreserveOnPropertyChangeProperties(["selectedViewTabs"])}_init(e){this.compact=u.nvl(e.compact,e.parent.session.desktop.displayStyle===Ie.DisplayStyle.COMPACT),this.embedDetailContent=u.nvl(e.embedDetailContent,this.compact),this.addFilter(new jp,!1),super._init(e),this.mediator=this._createMediator(),this._installLocalTreeListener(),this.formController=u.create(Ao,{displayParent:this,session:this.session}),this.messageBoxController=u.create($o,{displayParent:this,session:this.session}),this.fileChooserController=u.create(So,{displayParent:this,session:this.session}),this.resolveTextKeys(["title"]),this.titleMenuBar=u.create(Ce,{parent:this,menuOrder:new Is}),this.nodeMenuBar=u.create(Ce,{parent:this,position:Ce.Position.BOTTOM,menuOrder:new Is}),this.detailMenuBar=u.create(Ce,{parent:this,position:Ce.Position.BOTTOM,menuOrder:new Is}),this._setDefaultDetailForm(this.defaultDetailForm),this._setOutlineOverviewVisible(this.outlineOverviewVisible),this._setOutlineOverview(this.outlineOverview),this._updateOutlineOverview(),this._setViews(this.views),this._setSelectedViewTabs(this.selectedViewTabs),this._setMenus(this.menus),this._nodesSelectedInternal(this.selectedNodes),this.updateDetailContent()}_createMediator(){return u.create(qp)}_installLocalTreeListener(){this.on("nodesSelected",i=>{this.mediator.onPageSelected(this.selectedNode())});let e=i=>{p.ensure(i).forEach(s=>this.mediator.onChildPagesChanged(s))},t=i=>{let s=p.ensure(i).map(r=>r.parentNode).filter(Boolean);return[...new Set(s)]};this.on("nodesInserted",i=>e(i.parentNode)),this.on("nodesUpdated",i=>e(t(i.nodes))),this.on("nodesDeleted",i=>e(i.parentNode||t(i.nodes))),this.on("allChildNodesDeleted",i=>e(i.parentNode)),this.on("childNodeOrderChanged",i=>e(i.parentNode))}insertNode(e,t){super.insertNode(e,t)}_createTreeNode(e){return e=e||{},e.objectType=u.nvl(e.objectType,ht),e.parent=this,u.create(e)}_createKeyStrokeContext(){return new Jp(this)}_filterMenus(e,t,i,s){return[]}_initTreeKeyStrokeContext(){let e=Ae.CTRL|Ae.SHIFT;this.keyStrokeContext.registerKeyStrokes([new jl(this,e),new ql(this,e),new Qp(this,e),new Yl(this,e),new Pn(this,e,m.LEFT,"←"),new Pn(this,e,m.SUBTRACT,"-"),new Dn(this,e,m.RIGHT,"→"),new Dn(this,e,m.ADD,"+")]),this.keyStrokeContext.$bindTarget=()=>this.session.$entryPoint}_render(){super._render(),this.htmlComp.setLayout(new Aa(this)),this._renderCompact(),this._renderEmbedDetailContent(),this._renderDetailContent(),this._renderDetailMenuBarVisible(),this._renderNodeMenuBarVisible()}_renderProperties(){super._renderProperties(),this._renderTitle(),this._updateIcon(),this._renderTitleMenuBar()}_computeNodePaddingLeft(e){return this._computeNodePaddings(),this.compact&&e.row&&e.outline.selectedNode()!==e?this.nodePaddingLeft+e.row.hierarchyLevel*this.nodePaddingLevelHierarchyRow:super._computeNodePaddingLeft(e)}_remove(){super._remove(),this._removeTitle(),this._removeIcon()}_renderTitle(){this.titleVisible&&(this.$title||(this.$title=this.$container.prependDiv("outline-title").on("mousedown",this._onTitleMouseDown.bind(this)).toggleClass("touch",w.get().supportsOnlyTouch()),this.$titleText=this.$title.prependDiv("text")),this.$titleText.text(this.title))}_removeTitle(){this.titleVisible&&(this.$title.remove(),this.$title=null)}setIconVisible(e){this.setProperty("iconVisible",e),this.rendered&&this._updateIcon()}setIconId(e){this.setProperty("iconId",e),this.rendered&&this._updateIcon()}_updateIcon(){if(this.titleVisible&&this.iconVisible&&this.iconId){if(this.icon){this.icon.setIconDesc(this.iconId);return}this.icon=u.create(Es,{parent:this,iconDesc:this.iconId,prepend:!0}),this.icon.render(this.$title)}else{if(!this.icon)return;this.icon.remove(),this.icon=null}}_removeIcon(){this.icon&&(this.icon.remove(),this.icon=null)}_renderTitleMenuBar(){this.titleVisible&&(this.titleMenuBar.render(this.$title),this.titleMenuBar.$container.addClass("prevent-initial-focus"))}_renderEnabled(){super._renderEnabled(),this.$container.setTabbable(!1)}_initTreeNodeInternal(e,t){super._initTreeNodeInternal(e,t),this._initDetailTableAndForm(e),this.trigger("pageInit",{page:e})}_initDetailTableAndForm(e){e.detailTable&&this._initDetailTable(e),e.detailForm&&this._initDetailForm(e)}_initDetailTable(e){this.navigateButtonsVisible&&e.navigateButtonsVisible&&this._appendNavigateButtonsForDetailTable(e)}_initDetailForm(e){this.navigateButtonsVisible&&e.navigateButtonsVisible&&this._appendNavigateButtonsForDetailForm(e),e.detailForm.detailForm=!0,e.detailForm.one("destroy",()=>{e.detailForm=null,this._triggerPageChanged(e)})}_createNavigateButtons(e,t){let i=p.ensure(t.staticMenus);if(!this._hasMenu(i,Ma)){let s=u.create(Ma,{parent:t,altKeyStrokeContext:t.keyStrokeContext,outline:this,node:e});i.push(s)}if(!this._hasMenu(i,$a)){let s=u.create($a,{parent:t,altKeyStrokeContext:t.keyStrokeContext,outline:this,node:e});i.push(s)}return i}_getMenu(e,t){for(let i=0;i<e.length;i++)if(e[i]instanceof t)return e[i];return null}_hasMenu(e,t){return this._getMenu(e,t)!==null}_onTitleMouseDown(e){this.titleMenuBar.rendered&&this.titleMenuBar.$container.isOrHas(e.target)||this.navigateToTop()}navigateToTop(){this.compact&&this.embedDetailContent?this.selectNodes(this.compactRootNode()||[]):this.deselectAll(),this.handleInitialExpanded(),this.setScrollTop(0)}compactRootNode(){return this.nodes[0]&&this.nodes[0].compactRoot?this.nodes[0]:null}handleInitialExpanded(){this.visitNodes(e=>{this.setNodeExpanded(e,e.initialExpanded,{renderExpansion:!0})})}_onNodeDeleted(e){e.detailTable&&(e.detailTable.destroy(),e.detailTable=null)}selectNodes(e,t){e=p.ensure(e),e.splice(1),!(e.length>0&&this.isNodeSelected(e[0]))&&(e.length===0&&this.selectedNodes.length===0||(this.navigateUpInProgress?this.navigateUpInProgress=!1:e.length===1&&this.setDetailFormVisibleByUi(e[0],!0),super.selectNodes(e,t)))}_setSelectedNodes(e,t){super._setSelectedNodes(e,t),this.updateDetailContent()}_nodesSelectedInternal(e){let t=this.activePage();t&&(t.activate(),t.ensureLoadChildren().done(this._onLoadChildrenDone.bind(this,t)))}_renderSelection(){super._renderSelection(),this.$container.toggleClass("node-selected",this.selectedNodes.length>0);let e=this.prevSelectedNode;this.embedDetailContent&&e&&e.$node&&(e.$node.cssHeight(null).cssWidth(null),e.height=e.$node.outerHeight(!0))}_removeNodeSelection(e){e.$text&&!this.isHorizontalScrollingEnabled()&&e.$text.cssWidth(null),super._removeNodeSelection(e)}setDefaultDetailForm(e){this.setProperty("defaultDetailForm",e)}_setDefaultDetailForm(e){this.defaultDetailForm&&(this.defaultDetailForm.detailForm=!1,this.defaultDetailForm.off("destroy",this._defaultDetailFormDestroyHandler)),this._setProperty("defaultDetailForm",e),this.defaultDetailForm&&(this._adaptDefaultDetailForm(this.defaultDetailForm),this.defaultDetailForm.one("destroy",this._defaultDetailFormDestroyHandler)),this.initialized&&(this._updateOutlineOverview(),this.updateDetailContent())}_adaptDefaultDetailForm(e){e.setModal(!1),e.setClosable(!1),e.setDisplayHint(j.DisplayHint.VIEW),e.setDisplayViewId("C"),e.setShowOnOpen(!1),e.detailForm=!0}_onDefaultDetailFormDestroy(e){this.setDefaultDetailForm(null)}setOutlineOverviewVisible(e){this.setProperty("outlineOverviewVisible",e),this._updateOutlineOverview()}_setOutlineOverviewVisible(e){this._setProperty("outlineOverviewVisible",e)}setOutlineOverview(e){this.setProperty("outlineOverview",e),this._updateOutlineOverview()}_setOutlineOverview(e){e&&(e=this._createChild(e)),this._setProperty("outlineOverview",e)}_updateOutlineOverview(){this.defaultDetailForm?this.outlineOverview&&(this.outlineOverview.destroy(),this._setOutlineOverview(null)):this.outlineOverviewVisible?this.outlineOverview||this._setOutlineOverview(this._createOutlineOverview()):this.outlineOverview&&(this.outlineOverview.destroy(),this._setOutlineOverview(null))}_createOutlineOverview(){return u.create(qo,{parent:this,outline:this})}setNavigateButtonsVisible(e){this.setProperty("navigateButtonsVisible",e)}_setNavigateButtonsVisible(e){this._setProperty("navigateButtonsVisible",e),this.visitNodes(this._setNavigateButtonsVisibleForNode.bind(this))}_setNavigateButtonsVisibleForNode(e,t){this.navigateButtonsVisible?(e.detailForm&&this._appendNavigateButtonsForDetailForm(e),e.detailTable&&this._appendNavigateButtonsForDetailTable(e)):(e.detailForm&&this._removeNavigateButtonsForDetailForm(e),e.detailTable&&this._removeNavigateButtonsForDetailTable(e))}_appendNavigateButtonsForDetailForm(e){if(e.detailForm.rootGroupBox){let t=this._createNavigateButtons(e,e.detailForm.rootGroupBox);e.detailForm.rootGroupBox.setStaticMenus(t)}}_appendNavigateButtonsForDetailTable(e){let t=this._createNavigateButtons(e,e.detailTable);e.detailTable.setStaticMenus(t)}_removeNavigateButtonsForDetailForm(e){if(e.detailForm.rootGroupBox){let t=e.detailForm.rootGroupBox.staticMenus.filter(i=>!(i instanceof Gn));e.detailForm.rootGroupBox.setStaticMenus(t)}}_removeNavigateButtonsForDetailTable(e){let t=e.detailTable.staticMenus.filter(i=>!(i instanceof Gn));e.detailTable.setStaticMenus(t)}selectedRow(){let e=this.selectedNode();return!e||!e.detailTable?null:e.detailTable.selectedRow()}selectedNode(){return super.selectedNode()}_isGroupingEnd(e){return e.nodeType===ht.NodeType.TABLE}_isTruncatedNodeTooltipEnabled(){return!1}setDetailFormVisibleByUi(e,t){e.detailFormVisibleByUi!==t&&(e.detailFormVisibleByUi=t,this._triggerPageChanged(e))}validateFocus(){this.session.focusManager.validateFocus()}sendToBack(){this.inBackground=!0,this._renderInBackground(),this.formController.detachDialogs(),this.messageBoxController.detach(),this.fileChooserController.detach()}bringToFront(){this.inBackground=!1,this._renderInBackground(),this.formController.attachDialogs(),this.messageBoxController.attach(),this.fileChooserController.attach()}_renderInBackground(){this.$container.toggleClass("in-background",this.inBackground&&!this.compact)}_renderCompact(){this.$container.toggleClass("compact",this.compact),this.nodePaddingLeft=null,this.nodeControlPaddingLeft=null,this._updateNodePaddingsLeft(),this.invalidateLayoutTree()}_renderEmbedDetailContent(){this.$data.toggleClass("has-detail-content",this.embedDetailContent),this.invalidateLayoutTree()}_renderDetailContent(){if(!this.detailContent||this.detailContent.rendered)return;let e=this.selectedNode();e.rendered&&(e.$text.setVisible(!!e.text),e._decorate(),this.detailContent.render(e.$node),this.detailContent.$container.addClass("detail-content"),this.detailContent.htmlComp&&(this.detailContent.htmlComp.validateRoot=!1),this._ensurePageLayout(e),this.$data.addClass("detail-content-visible"))}nodeById(e){return super.nodeById(e)}nodesByIds(e){return super.nodesByIds(e)}_ensurePageLayout(e){e.htmlComp=x.install(e.$node,this.session),e.htmlComp.setLayout(new Yp(this,e))}_removeDetailContent(){this.detailContent&&(this.detailContent.remove(),this.$data.removeClass("detail-content-visible"))}_postRenderViewRange(){super._postRenderViewRange(),this._renderDetailContent(),this._renderDetailMenuBarVisible(),this._renderNodeMenuBarVisible()}setCompact(e){this.setProperty("compact",e)}setEmbedDetailContent(e){this.setProperty("embedDetailContent",e)}_setEmbedDetailContent(e){this._setProperty("embedDetailContent",e),this.updateDetailContent()}_onDetailContentDestroy(e){this.setDetailContent(null),this.updateDetailMenus()}setDetailContent(e){this.detailContent!==e&&(this.rendered&&this._removeDetailContent(),this.detailContent&&this.detailContent.off("destroy",this._detailContentDestroyHandler),this.detailContent instanceof $l&&this.detailContent.destroy(),this._setProperty("detailContent",e),e&&e.on("destroy",this._detailContentDestroyHandler),this.rendered&&this._renderDetailContent(),this.invalidateLayoutTree())}updateDetailContent(){if(!this.embedDetailContent){this.setDetailContent(null),this.setDetailMenus([]);return}this.setDetailMenuBarVisible(!1),this.setNodeMenuBarVisible(!1),this.setDetailContent(this._computeDetailContent()),this.updateDetailMenus()}_updateScrollTopAfterSelection(){if(!this.embedDetailContent){super._updateScrollTopAfterSelection();return}if(this.validateLayoutTree(),super._updateScrollTopAfterSelection(),this.selectedNodes[0]&&this.selectedNodes[0].parentNode){if(this.prevSelectedNode&&this.prevSelectedNode.isDescendantOf(this.selectedNodes[0]))return;this.scrollTo(this.selectedNodes[0].parentNode,{align:"top",animate:!0})}}_computeDetailContent(){let e=this.selectedNode();if(!e)return null;if(e.detailForm&&e.detailFormVisible&&e.detailFormVisibleByUi)return e.detailForm;if(e===this.compactRootNode()){let t=this.getRootContent();if(t)return t}return e.row&&e.parentNode.nodeType===ht.NodeType.TABLE?u.create($l,{parent:this,table:e.parentNode.detailTable,page:e}):null}getRootContent(){return this.defaultDetailForm?this.defaultDetailForm:this.outlineOverview}updateDetailMenus(){if(!this.embedDetailContent)return;let e=this.selectedNodes,t=e[0],i=[],s=[],r=[],o,l=[];if(this.detailContent&&this.detailContent instanceof j){let d=this.detailContent.rootGroupBox;d&&(i=d.processMenus.concat(d.menus),d.setMenuBarVisible(!1),this._attachDetailMenusListener(d))}else if(t&&!(this.detailContent instanceof ka)){t.detailTable&&(o=t.detailTable,i=$e.filter(o.menus,[H.MenuType.EmptySpace],{onlyVisible:!1,enableDisableKeyStrokes:!0,defaultMenuTypes:o.defaultMenuTypes}),s=o.tableControls,o.setMenuBarVisible(!1),this._attachDetailMenusListener(o));let d=t.parentNode;d&&d.detailTable&&(o=d.detailTable,i=i.concat($e.filter(o.menus,[H.MenuType.SingleSelection],{onlyVisible:!1,enableDisableKeyStrokes:!0,defaultMenuTypes:o.defaultMenuTypes})),o.setMenuBarVisible(!1),this._attachDetailMenusListener(o))}this.nodeMenuBar.menuItems.filter(d=>d instanceof kr).forEach(d=>d.destroy()),s.forEach(d=>{let c=u.create(kr,kr.adaptTableControlProperties(d,{parent:this,tableControl:d,horizontalAlignment:1}));r.push(c)}),i.forEach(d=>{d.horizontalAlignment===1?r.push(d):l.push(d)}),this.setNodeMenus(r),this.setDetailMenus(l)}_attachDetailMenusListener(e){this._detailMenusChangeHandler||(this._detailMenusChangeHandler=t=>{(t.propertyName==="menus"||t.propertyName==="tableControls")&&this.updateDetailMenus()}),this._detailMenusDestroyHandler||(this._detailMenusDestroyHandler=t=>{e.off("propertyChange",this._detailMenusChangeHandler)}),e.off("propertyChange",this._detailMenusChangeHandler),e.on("propertyChange",this._detailMenusChangeHandler),e.off("destroy",this._detailMenusDestroyHandler),e.one("destroy",this._detailMenusDestroyHandler),this._detailMenusNodesSelectedHandler||(this._detailMenusNodesSelectedHandler={outline:this,menuContainers:[],addMenuContainer:function(t){this.menuContainers.indexOf(t)>-1||this.menuContainers.push(t)},func:function(t){t.type==="nodesSelected"&&(this.menuContainers.forEach(function(i){i.off("propertyChange",this.outline._detailMenusChangeHandler),i.off("destroy",this.outline._detailMenusDestroyHandler)},this),this.menuContainers=[])}},this.addListener(this._detailMenusNodesSelectedHandler)),this._detailMenusNodesSelectedHandler.addMenuContainer(e)}setDetailMenus(e){this.detailMenuBar.setMenuItems([]),this.detailMenuBar.setMenuItems(e),this.setDetailMenuBarVisible(this.detailMenuBar.menuItems.length>0)}_renderDetailMenuBarVisible(){this.detailMenuBarVisible?this._renderDetailMenuBar():this._removeDetailMenuBar()}_renderDetailMenuBar(){if(this.detailMenuBar.rendered)return;let e=this.selectedNode();!e||!e.rendered||(this.detailMenuBar.render(e.$node),this.detailMenuBar.$container.addClass("detail-menubar"),this.detailContent&&this.detailContent.rendered&&this.detailMenuBar.$container.insertBefore(this.detailContent.$container),this._ensurePageLayout(e),this.invalidateLayoutTree())}_removeDetailMenuBar(){this.detailMenuBar.rendered&&(this.detailMenuBar.remove(),this.invalidateLayoutTree())}setDetailMenuBarVisible(e){this.setProperty("detailMenuBarVisible",e)}setNodeMenus(e){this.nodeMenuBar.setMenuItems([]),this.nodeMenuBar.setMenuItems(e),this.setNodeMenuBarVisible(this.nodeMenuBar.menuItems.length>0)}_renderNodeMenuBarVisible(){this.nodeMenuBarVisible?this._renderNodeMenuBar():this._removeNodeMenuBar()}_renderNodeMenuBar(){if(this.nodeMenuBar.rendered)return;let e=this.selectedNode();if(!e||!e.rendered)return;let t=e.$text;this.nodeMenuBar.render(e.$node),this.nodeMenuBar.$container.addClass("node-menubar"),this.nodeMenuBar.$container.insertAfter(t),this.invalidateLayoutTree()}_removeNodeMenuBar(){this.nodeMenuBar.rendered&&(this.nodeMenuBar.remove(),this.invalidateLayoutTree())}setNodeMenuBarVisible(e){this.setProperty("nodeMenuBarVisible",e)}glassPaneTargets(e){return this._glassPaneTargets(e)}_glassPaneTargets(e){let t=this.session.desktop,i=[];return t.navigation&&i.push(t.navigation.$body),t.bench&&t.bench.outlineContent&&p.pushAll(i,t.bench.outlineContent.glassPaneTargets(e)),i}onGlassPaneMouseDown(e,t){let i=this.session.desktop;i.navigation&&t.parent()[0]===i.navigation.$body[0]&&i.bringOutlineToFront()}inFront(){return this.session.desktop.outline===this&&!this.inBackground}acceptDialog(e){return this.session.desktop.outline===this}acceptView(e){return this.session.desktop.outline===this}activateCurrentPage(){let e=this.activePage();e&&e.activate()}activePage(){return this.selectedNode()}_setViews(e){e&&e.forEach(t=>t.setDisplayParent(this)),this._setProperty("views",e)}_setSelectedViewTabs(e){this.selectedViewTabs=this.session.desktop.prepareSelectedViewTabs(e)}_setMenus(e){let t=this.menus;if(this.updateKeyStrokes(e,t),this._setProperty("menus",e),this.titleMenuBar){let i=$e.filter(this.menus,[fe.MenuType.Header],{defaultMenuTypes:this.defaultMenuTypes});this.titleMenuBar.setMenuItems(i)}}_triggerPageChanged(e){this.trigger("pageChanged",{page:e})}_onLoadChildrenDone(e){e&&this._initDetailTableAndForm(e)}pageChanged(e){if(!this.initialized||e?.pageChanging)return;e&&this._initDetailTableAndForm(e);let t=this.selectedNode();(!e&&!t||e===t)&&this.updateDetailContent(),this._triggerPageChanged(e)}drillDown(e,t){e&&(this.selectNodes(e),u.nvl(t,e.nodeType===ht.NodeType.NODES)&&this.expandNode(e))}}Z.uuidPathAlwaysSkipRules.push(n=>n instanceof bi);class $i extends or{_filterDirty;_nodeIdToRowMap;_detailTableRowInitHandler;_detailTableRowsInsertedHandler;_detailTableFilterRemoved;constructor(){super(),this._filterDirty=!1,this._nodeIdToRowMap={},this._detailTableRowInitHandler=this._onDetailTableRowInit.bind(this),this._detailTableRowsInsertedHandler=this._onDetailTableRowsInserted.bind(this),this._detailTableFilterRemoved=this._onDetailTableFilterRemoved.bind(this)}_onPageChanged(e){let t=!1,i=this.widget.nodeById(e.nodeId);try{i.setPageChanging(!0),i.overviewIconId=e.overviewIconId,i.detailFormVisible=e.detailFormVisible;let s=this.session.getOrCreateWidget(e.detailForm,this.widget);i.setDetailForm(s),i.navigateButtonsVisible=e.navigateButtonsVisible,i.detailTableVisible=e.detailTableVisible;let r=this.session.getOrCreateWidget(e.detailTable,this.widget);i.detailTable!==r&&(i.detailTable&&this._destroyDetailTable(i),i.setDetailTable(r),i.detailTable&&this._initDetailTable(i)),t=!0}finally{i.setPageChanging(!1)}t&&this.widget.pageChanged(i)}onModelAction(e){e.type==="pageChanged"?this._onPageChanged(e):super.onModelAction(e)}_initDetailTable(e){e.detailTable.rows.forEach(this._linkNodeWithRow.bind(this)),e.detailTable.on("rowInit",this._detailTableRowInitHandler),e.detailTable.on("rowsInserted",this._detailTableRowsInsertedHandler),e.detailTable.on("filterRemoved",this._detailTableFilterRemoved)}_destroyDetailTable(e){this._nodeIdToRowMap={},e.detailTable.rows.forEach(this._unlinkNodeWithRow.bind(this)),e.detailTable.off("rowInit",this._detailTableRowInitHandler),e.detailTable.off("rowsInserted",this._detailTableRowsInsertedHandler),e.detailTable.off("filterRemoved",this._detailTableFilterRemoved)}_linkNodeWithRow(e){u.assertParameter("row",e);let t=e.nodeId;if(t===void 0)return;let i=this.widget.nodesMap[t];i?i.linkWithRow(e):this._nodeIdToRowMap[t]=e}_unlinkNodeWithRow(e){let t=this.widget.nodesMap[e.nodeId];t&&t.unlinkWithRow(e)}_onDetailTableRowInit(e){this._linkNodeWithRow(e.row);let t=this.widget.nodesMap[e.row.nodeId];this.widget.isSelectedNode(t)&&!this.widget.detailContent&&this.widget.updateDetailContent()}_onDetailTableRowsInserted(e){let t=e.source;(this._filterDirty||t.filterCount()>0&&e.rows.some(i=>!i.filterAccepted))&&(this._filterDirty=!1,this.widget.filter())}_onDetailTableFilterRemoved(e){let i=e.source.modelAdapter;i&&i._rebuildingTable&&(this._filterDirty=!0)}_linkNodeWithRowLater(e){if(!e.parentNode||!e.parentNode.detailTable||!this._nodeIdToRowMap.hasOwnProperty(e.id))return;let t=this._nodeIdToRowMap[e.id];e.linkWithRow(t),delete this._nodeIdToRowMap[e.id]}_getDefaultNodeObjectType(){return"Page"}static modifyOutlinePrototype(){G.get().remote&&(b.replacePrototypeFunction(bi,"_computeDetailContent",$i._computeDetailContentRemote,!0),b.replacePrototypeFunction(bi,"updateDetailMenus",$i.updateDetailMenusRemote,!0),b.replacePrototypeFunction(bi,"_initTreeNodeInternal",$i._initTreeNodeInternalRemote,!0),b.replacePrototypeFunction(bi,"_createTreeNode",$i._createTreeNodeRemote,!0),b.replacePrototypeFunction(ht,"_updateDetailFormMenus",$i._updateDetailFormMenus,!0),b.replacePrototypeFunction(ht,"_updateDetailTableMenus",$i._updateDetailTableMenus,!0),b.replacePrototypeFunction(ht,"linkWithRow",$i.linkWithRow,!0),b.replacePrototypeFunction(ht,"unlinkWithRow",$i.unlinkWithRow,!0))}static _computeDetailContentRemote(){if(!this.modelAdapter)return this._computeDetailContentOrig();let e=this.selectedNode();if(!e)return null;if(e.detailForm||e.detailFormResolved)return e.detailFormResolved=!0,this._computeDetailContentOrig();if(!this.session.areRequestsPending()&&!this.session.areEventsQueued())return e.detailFormResolved=!0,this._computeDetailContentOrig();this.session.listen().done((function(t){t.detailFormResolved||(t.detailFormResolved=!0,this.updateDetailContent())}).bind(this,e))}static updateDetailMenusRemote(){if(!this.modelAdapter)return this.updateDetailMenusOrig();let e=this.selectedNode();if(e&&e.detailFormResolved)return this.updateDetailMenusOrig()}static _initTreeNodeInternalRemote(e,t){this._initTreeNodeInternalOrig(e,t),this.modelAdapter&&(this.modelAdapter.widget=this,e.detailTable&&this.modelAdapter._initDetailTable(e),this.modelAdapter._linkNodeWithRowLater(e))}static _createTreeNodeRemote(e){if(!this.modelAdapter||!e?.nodeType)return this._createTreeNodeOrig(e);if(e=this.modelAdapter._initNodeModel(e),e.nodeType==="jsPage")try{return this.modelAdapter._createJsPage(e,this._createTreeNodeOrig.bind(this))}catch(t){e=this.modelAdapter._createBrokenPageModel(e),u.create(ri,{displayError:!1,sendError:!0}).handle(t)}return this._createTreeNodeOrig(e)}_createJsPage(e,t){let i=e.pageParam;if(e.jsPageObjectType=e.jsPageObjectType||Un.get(this.session).findObjectTypeForPageParam(i),!e.jsPageObjectType)throw i?new Error("Could not resolve page objectType for pageParam "+JSON.stringify(i)):new Error("jsPageObjectType not set");let s=this._createJsPageModel(e,i);if(e.jsPageModel){let o=xe.deserialize(e.jsPageModel,null,{createPojoIfDoIsUnknown:!0});delete o._type,s=$.extend({},o,s)}let r=t(s);if(r.classId&&r.uuid&&r.classId!==r.uuid)throw new Error(`ClassId and uuid don't match for page ${r.objectType}. ClassId: ${r.classId}, Uuid: ${r.uuid}`);return r}_createJsPageModel(e,t){return{id:e.id,parent:e.parent,owner:e.owner,objectType:e.jsPageObjectType,pageParam:t,classId:e.classId,modelClass:e.modelClass}}_createBrokenPageModel(e){return{...this._createJsPageModel(e,null),objectType:ht,text:this.session.text("ui.CouldNotCreateElement"),iconId:q.EXCLAMATION_MARK_CIRCLE,overviewIconId:e.iconId,cssClass:"broken"}}_initNodeModel(e){const t=super._initNodeModel(e);return t.remote=!0,t.pageParam=xe.deserialize(t.pageParam),t}static _updateDetailFormMenus(){const e=this.detailForm;e&&(!e.modelAdapter||!this.remote)&&this._updateDetailFormMenusOrig()}static _updateDetailTableMenus(){const e=this.detailTable;e&&(!e.modelAdapter||!this.remote)&&this._updateDetailTableMenusOrig()}static linkWithRow(e){this.linkWithRowOrig(e),this._updateDetailMenus()}static unlinkWithRow(e){this.unlinkWithRowOrig(e),this._updateDetailMenus()}}G.addListener("bootstrap",$i.modifyOutlinePrototype);class qp{init(e){}_skipEvent(e){return e===null||e.outline===null||e.leaf}onTableRowsInserted(e,t,i){this._skipEvent(i)||i.outline.insertNodes(t,i)}onTableRowsDeleted(e,t,i){this._skipEvent(i)||i.outline.deleteNodes(t,i)}onTableRowsUpdated(e,t){if(this._skipEvent(t))return;let i=t.updatePagesFromTableRows(e.rows);t.outline.updateNodes(i)}onTableRowAction(e,t){if(this._skipEvent(t)||e.source.defaultRowAction)return;let i=e.row.page;t.outline.drillDown(i)}onTableRowOrderChanged(e,t){if(this._skipEvent(t))return;let i=e.source,s=t.pagesForTableRows(i.rows);t.outline.updateNodeOrder(s,t)}onTableFilter(e,t){this._skipEvent(t)||t.outline.filter()}onPageSelected(e){if(!e||!e.parentNode)return;const t=e.parentNode.detailTable,i=e.row;!t||!i||t!==i.table||t.selectRow(i)}onChildPagesChanged(e){e instanceof Kr&&e.rebuildDetailTableInternal()}}class Aa extends xn{outline;constructor(e){super(e),this.outline=e}_layout(e){let t=this.outline.htmlComp;super._layout(e);let i=t.availableSize({exact:!0}).subtract(t.insets());if(this.outline.embedDetailContent){let s=this.outline.selectedNodes[0];if(s&&s.rendered){let r=s.htmlComp;if(r){let o=r.prefSize({widthHint:i.width});r.setSize(new F(i.width,o.height)),s.height=o.height+r.margins().vertical()}}}this.outline.titleMenuBar.validateLayout(),this.outline.nodeMenuBar.validateLayout(),this.outline.detailMenuBar.validateLayout()}_setDataHeight(e){let t=null;this.outline.titleVisible&&(t=C.size(this.outline.$title,!0)),super._setDataHeight(e+(t===null?0:t.height))}}class jo extends Ip{outline;constructor(){super(),this.outline=null,this._addWidgetProperties("outline"),this._addPreserveOnPropertyChangeProperties(["outline"]),this._addCloneProperties(["outline"])}_init(e){super._init(e),this._setOutline(this.outline)}_setOutline(e){this._setProperty("outline",e),this.outline&&this.outline.setIconId(this.iconId)}_setIconId(e){this._setProperty("iconId",e),this.outline&&this.outline.setIconId(this.iconId)}_doAction(){super._doAction(),this.outline&&(this.session.desktop.setOutline(this.outline),this.session.desktop.bringOutlineToFront())}onOutlineChange(e){let t=!!e&&this.outline===e;this.setSelected(t)}}class Am extends Lp{_goOffline(){this.widget.outline||(this._enabledBeforeOffline=this.widget.enabled,this.widget.setEnabled(!1))}_goOnline(){this.widget.outline||this.widget.setEnabled(this._enabledBeforeOffline)}}class $m extends A{outline;tileOutlineOverview;constructor(){super(),this.outline=null,this.tileOutlineOverview=null}_render(){this._ensureTileOutlineOverview(),this.addContainer(this.$parent,"outline-tile-field"),this.tileOutlineOverview.render(this.$container),this.addField(this.tileOutlineOverview.$container)}_ensureTileOutlineOverview(){if(this.tileOutlineOverview)return;let e=this.outline?this.session.getWidget(this.outline):null;this.tileOutlineOverview=u.create(qo,{parent:this,outline:e})}}class Mm extends at{}class Yp extends ne{outline;page;constructor(e,t){super(),this.outline=e,this.page=t}layout(e){let t=this.page.htmlComp,i=this.page.$text,s=this.page.$icon(),r=0,o=0,l=this.outline.nodeMenuBar,a=this.outline.detailMenuBar,d=0,c=0,f=t.availableSize({exact:!0}).subtract(t.insets());if(c=f.width,s.length>0&&(c-=C.prefSize(s).width),l.visible){let g=l.htmlComp.prefSize();l.htmlComp.setSize(g),c-=g.add(l.htmlComp.margins()).width}if(i.cssWidth(c),a.visible){d=a.htmlComp.prefSize().height;let g=new F(f.width,d).subtract(a.htmlComp.margins());a.htmlComp.setSize(g)}if(this.outline.detailContent){s.length>0&&(o=s.outerHeight(!0)),i.isVisible()&&(r=i.outerHeight(!0)),r=Math.max(r,o);let g=this.outline.detailContent.htmlComp;g.setSize(new F(f.width,f.height-r-d-g.margins().vertical()))}}preferredLayoutSize(e,t){let i=0,s=this.page.htmlComp,r=new F,o=this.page.$text,l=this.page.$icon(),a=0,d=this.outline.detailMenuBar,c=new F,f=this.outline.nodeMenuBar,g=0;g=t.widthHint,l.length>0&&(g-=C.prefSize(l).width),f.visible&&f.rendered&&(g-=f.htmlComp.prefSize().width);let y=C.prefSize(o,{includeMargin:!0,widthHint:g,enforceSizeHints:!0,exact:!0}).height;if(l.length>0&&(i=l.outerHeight(!0)),a=Math.max(y,i),d.visible&&d.rendered&&(c=d.htmlComp.prefSize()),this.outline.detailContent){let D=this.outline.detailContent.htmlComp;t=$.extend({},t,{enforceSizeHints:!0,exact:!0}),r=D.prefSize(t).add(D.margins())}let v=new F(Math.max(r.width,c.width),a+c.height+r.height);return v=v.add(s.insets()),v}}class km extends bi{hasText;searchQuery;searchStatus;searchFieldKeyStrokeContext;$searchPanel;$clearIcon;$searchStatus;$queryField;constructor(){super(),this.hasText=!1,this.$searchPanel=null,this.$clearIcon=null,this.$searchStatus=null,this.$queryField=null}_initKeyStrokeContext(){super._initKeyStrokeContext(),this.searchFieldKeyStrokeContext=this._createKeyStrokeContextForSearchField()}_createKeyStrokeContextForSearchField(){let e=new qi;return e.$scopeTarget=()=>this.$searchPanel,e.$bindTarget=()=>this.$queryField,e.registerStopPropagationKeys(Ae.NONE,[m.ENTER,m.BACKSPACE]),e}_render(){super._render(),this.htmlComp.setLayout(new Xp(this)),this.$container.addClass("search-outline"),this.$searchPanel=this.$container.prependDiv("search-outline-panel"),this.$queryField=this.$searchPanel.appendElement("<input>","search-outline-field").on("input",this._createOnQueryFieldInputFunction().bind(this)).on("keypress",this._onQueryFieldKeyPress.bind(this)),this.$clearIcon=this.$searchPanel.appendSpan("clear-icon unfocusable action text-field-icon").on("mousedown",this._onClearIconMouseDown.bind(this)),this.$searchStatus=this.$searchPanel.appendDiv("search-outline-status").on("mousedown",this._onTitleMouseDown.bind(this)),this.session.keyStrokeManager.installKeyStrokeContext(this.searchFieldKeyStrokeContext)}_remove(){this.session.keyStrokeManager.uninstallKeyStrokeContext(this.searchFieldKeyStrokeContext),this.$searchPanel.remove(),super._remove()}_renderProperties(){super._renderProperties(),this._renderSearchQuery(),this._renderSearchStatus(),this._updateHasText()}_renderTitle(){super._renderTitle(),this.titleVisible&&(this.$title.insertBefore(this.$searchPanel),T.linkElementWithLabel(this.$queryField,this.$title))}_renderSearchQuery(){this.$queryField.val(this.searchQuery)}_renderSearchStatus(){let e=this.rendered;this.searchStatus&&!this.$searchStatus.isVisible()?e?this.$searchStatus.slideDown({duration:200,progress:this.revalidateLayout.bind(this)}):this.$searchStatus.show():!this.searchStatus&&this.$searchStatus.isVisible()&&(e?this.$searchStatus.slideUp({duration:200,progress:this.revalidateLayout.bind(this)}):this.$searchStatus.hide()),this.$searchStatus.textOrNbsp(this.searchStatus),this.$searchPanel.toggleClass("has-status",!!this.searchStatus)}focusQueryField(){this.validateFocus()}_triggerSearch(){this.trigger("search",{query:u.nvl(this.searchQuery,"")})}_createOnQueryFieldInputFunction(){let e=h().debounce(this._search.bind(this));return function(t){this._updateHasText(),e()}}_onClearIconMouseDown(e){this.$queryField.val(""),this._updateHasText(),this._search(),this.$queryField.focus(),e.preventDefault()}_onQueryFieldKeyPress(e){e.which===m.ENTER&&(this._setSearchQuery(this.$queryField.val()),this._triggerSearch())}_search(){let e=this.$queryField.val();this.searchQuery!==e&&(this._setSearchQuery(e),this._triggerSearch())}_setSearchQuery(e){this.searchQuery=e}_updateHasText(){this.$queryField.toggleClass("has-text",!!this.$queryField.val())}validateFocus(){if(!this.rendered)return;let e=this.$queryField[0];this.session.focusManager.requestFocus(e)&&e.select()}}class Im extends $i{_initProperties(e){e.requestFocusQueryField!==void 0&&delete e.requestFocusQueryField}_syncRequestFocusQueryField(){this.widget.focusQueryField()}_onWidgetSearch(e){this._send("search",{query:e.query},{showBusyIndicator:!1})}_onWidgetEvent(e){e.type==="search"?this._onWidgetSearch(e):super._onWidgetEvent(e)}}class Xp extends Aa{constructor(e){super(e)}_setDataHeight(e){let t=C.size(this.outline.$searchPanel,!0);e+=t.height,super._setDataHeight(e)}}class Gn extends J{node;outline;altKeyStrokeContext;overflow;_defaultText;_defaultIconId;constructor(){super(),this.node=null,this.outline=null,this.actionStyle=ce.ActionStyle.BUTTON,this._addCloneProperties(["node","outline","altKeyStrokeContext"]),this.inheritAccessibility=!1}_render(){this.overflow?(this.text=this.session.text(this._defaultText),this.iconId=null):(this.text=null,this.iconId=this._defaultIconId),this.updateEnabled(),super._render(),this.$container.addClass("navigate-button small"),this.altKeyStrokeContext.registerKeyStroke(this)}_renderProperties(){super._renderProperties(),T.label(this.$container,this.session.text(this._defaultText))}_remove(){super._remove(),this.altKeyStrokeContext.unregisterKeyStroke(this)}_setDetailVisible(){let e=this._toggleDetail();h().log.isDebugEnabled()&&h().log.debug("show detail-"+(e?"form":"table")),this.outline.setDetailFormVisibleByUi(this.node,e)}_hasDetailForm(){return this.node.detailFormVisible&&!!this.node.detailForm}_hasDetailTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this.node.detailTableVisible&&!!this.node.detailTable&&(this.node.detailTable.rows.length>0||!e)}_doAction(){super._doAction(),this._isDetail()?this._setDetailVisible():this._drill()}updateEnabled(){this.setEnabled(this._buttonEnabled())}}class $a extends Gn{_detailTableRowsSelectedHandler;_detailTableRowsChangedHandler;_outlinePageRowLinkHandler;_outlinePageChangedHandler;constructor(){super(),this._defaultIconId=q.ANGLE_DOWN,this._defaultText="ui.Continue",this.iconId=this._defaultIconId,this.keyStroke="enter",this._detailTableRowsSelectedHandler=this._onDetailTableRowsSelected.bind(this),this._detailTableRowsChangedHandler=this._onDetailTableRowsChanged.bind(this),this._outlinePageRowLinkHandler=this._onOutlinePageRowLink.bind(this),this._outlinePageChangedHandler=this._onOutlinePageChanged.bind(this)}_init(e){super._init(e),this.node.detailTable&&(this.node.detailTable.on("rowsSelected",this._detailTableRowsSelectedHandler),this.node.detailTable.on("rowsInserted rowsDeleted allRowsDeleted",this._detailTableRowsChangedHandler)),this.outline.on("pageRowLink",this._outlinePageRowLinkHandler),this.outline.on("pageChanged",this._outlinePageChangedHandler)}_destroy(){this.node.detailTable&&(this.node.detailTable.off("rowsSelected",this._detailTableRowsSelectedHandler),this.node.detailTable.off("rowsInserted rowsDeleted allRowsDeleted",this._detailTableRowsChangedHandler)),this.outline.off("pageRowLink",this._outlinePageRowLinkHandler),this.outline.off("pageChanged",this._outlinePageChangedHandler),super._destroy()}_render(){super._render(),this.$container.addClass("down")}_isDetail(){return this._hasDetailForm()&&this._hasDetailTable()&&this.node.detailFormVisibleByUi}_toggleDetail(){return!1}_buttonEnabled(){return this._isDetail()?!0:!!this._getDrillNode()}_getDrillNode(){if(this.node.leaf)return null;if(this._hasDetailTable(!1)){let e=this.node.detailTable.selectedRows;return e.length===1&&e[0].page?e[0].page:null}return this.node.childNodes[0]}_drill(){let e=this._getDrillNode();if(e){let t=e.parentNode;t&&t.childNodes.forEach(i=>{i.expanded&&i!==e&&this.outline.collapseNode(i,{renderAnimated:!1})}),this.outline.drillDown(e)}}_onDetailTableRowsSelected(e){this.updateEnabled()}_onDetailTableRowsChanged(e){this.updateEnabled()}_onOutlinePageRowLink(e){if(this._hasDetailTable(!1)){let t=this.node.detailTable.selectedRows;t.length===1&&t[0]===e.row&&this.updateEnabled()}}_onOutlinePageChanged(e){e.page===this.node&&this.updateEnabled()}}class Ma extends Gn{constructor(){super(),this._defaultIconId=q.ANGLE_UP,this._defaultText="ui.Up",this.iconId=this._defaultIconId,this.keyStroke="backspace"}_render(){super._render(),this.$container.addClass("up")}_isDetail(){return this._hasDetailForm()&&this._hasDetailTable()&&!this.node.detailFormVisibleByUi}_toggleDetail(){return!0}_buttonEnabled(){return!!this.node.parentNode||!!this.outline.defaultDetailForm||!!this.outline.outlineOverview}_drill(){let e=this.node.parentNode;e?(h().log.isDebugEnabled()&&h().log.debug("drill up to node "+e),this.outline.navigateUpInProgress=!0,this.outline.selectNodes(e),this.outline.collapseNode(e,{collapseChildNodes:!0})):(h().log.isDebugEnabled()&&h().log.debug("drill up to top"),this.outline.navigateToTop())}}class Jp extends Ee{_outline;constructor(e){super(),this._outline=e}accept(e){return!this._outline.inBackground&&!this.isFormMenuOpen()&&super.accept(e)}isFormMenuOpen(){return this._outline.session.desktop.menus.some(t=>t.popup&&t.popup.$container&&t.popup.$container.isAttached())}}class Qp extends ks{constructor(e,t){super(e,t),this.which=[m.HOME],this.renderingHints.hAlign=ut.RIGHT,this.renderingHints.$drawingArea=(i,s)=>this.field.$title||this.field.$data}handle(e){this.field.navigateToTop()}}class ka extends I{outline;displayViewId;$content;constructor(){super(),this.outline=null}_init(e){super._init(e),!this.outline&&this.parent instanceof bi&&(this.outline=this.parent),u.assertProperty(this,"outline",bi)}_render(){this.$container=this.$parent.appendDiv("outline-overview"),this.htmlComp=x.install(this.$container,this.session),this.$content=this.$container.appendDiv("outline-overview-content"),this.$content.appendDiv("outline-overview-icon").icon(this.outline.iconId),this.$content.appendDiv("outline-overview-title").text(this.outline.title)}_attach(){this.$parent.append(this.$container);let e=this.htmlComp.getParent();this.htmlComp.setSize(e.size()),super._attach()}_detach(){this.$container.detach(),super._detach()}}class qo extends ka{pageTileGrid;scrollable;titleVisible;contentHtmlComp;$title;_desktopNavigationVisibilityChangeHandler;_outlineNodesInsertedHandler;_outlineNodesDeletedHandler;constructor(){super(),this.pageTileGrid=null,this.scrollable=!0,this.titleVisible=!0,this._addWidgetProperties(["pageTileGrid"]),this._desktopNavigationVisibilityChangeHandler=this._onDesktopNavigationVisibilityChange.bind(this),this._outlineNodesInsertedHandler=this._onOutlineNodesInserted.bind(this),this._outlineNodesDeletedHandler=this._onOutlineNodesDeleted.bind(this)}_init(e){super._init(e),this.pageTileGrid=this._createPageTileGrid(),this.outline.compact&&(this.outline.on("nodesDeleted",this._outlineNodesDeletedHandler),this.outline.on("nodesInserted",this._outlineNodesInsertedHandler)),this.scrollable=!this.outline.compact,this.addCssClass("dimmed-background")}_destroy(){this.outline.compact&&(this.outline.off("nodesDeleted",this._outlineNodesDeletedHandler),this.outline.off("nodesInserted",this._outlineNodesInsertedHandler)),super._destroy()}_render(){this.$container=this.$parent.appendDiv("tile-overview"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new Si({stretch:this.outline.compact})),this.$content=this.$container.appendDiv("tile-overview-content"),this.contentHtmlComp=x.install(this.$content,this.session),this.contentHtmlComp.setLayout(new Si({stretch:this.outline.compact})),this.$title=this.$content.appendDiv("tile-overview-title").text(this.outline.title),x.install(this.$title,this.session),this.$title.cssMaxHeight(this.$title.cssHeight()),this._updateTitle(!1),this.findDesktop().on("propertyChange:navigationVisible",this._desktopNavigationVisibilityChangeHandler)}_remove(){super._remove(),this.findDesktop().off("propertyChange:navigationVisible",this._desktopNavigationVisibilityChangeHandler)}_renderProperties(){super._renderProperties(),this._renderPageTileGrid(),this._renderScrollable()}setPageTileGrid(e){this.setProperty("pageTileGrid",e)}_renderPageTileGrid(){this.pageTileGrid.render(this.$content)}_createPageTileGrid(){let e,t;return this.outline.compact&&(e=this.outline.compactRootNode(),e&&(t=e.childNodes)),u.create(Ra,{parent:this,outline:this.outline,compact:this.outline.compact,page:e,nodes:t})}setScrollable(e){this.setProperty("scrollable",e)}_renderScrollable(){this.scrollable?this._installScrollbars({axis:"y"}):this._uninstallScrollbars()}_updateTitle(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.$title&&(this.$title.toggleClass("animated",e),this.$title.toggleClass("removed",this.findDesktop().navigationVisible),T.hidden(this.$title,this.findDesktop().navigationVisible?!0:null))}_onDesktopNavigationVisibilityChange(e){this._updateTitle()}_onOutlineNodesInserted(e){this.pageTileGrid||this.setPageTileGrid(this._createPageTileGrid())}_onOutlineNodesDeleted(e){const t=e.nodes;this.pageTileGrid&&t.length===1&&this.pageTileGrid.page===t[0]&&this.setPageTileGrid(null)}}class Zp extends Ao{desktop;popupWindows;_documentPopupWindowReadyHandler;constructor(e){super(e),this.desktop=e.displayParent,this.popupWindows=[],this._documentPopupWindowReadyHandler=this._onDocumentPopupWindowReady.bind(this),h()(document).on("popupWindowReady",this._documentPopupWindowReadyHandler)}render(){super.render();let e=this.desktop.activeForm;e?e.activate():this.desktop.bringOutlineToFront()}_renderViews(){super._renderViews(),this.desktop.selectedViewTabs&&this.desktop.selectedViewTabs.forEach(e=>this._activateView(e)),this.desktop.bench&&this.desktop.bench.postRender()}isFormShown(e){return e.isPopupWindow()?this.popupWindows.some(t=>t.form.id===e.id):super.isFormShown(e)}_renderPopupWindow(e,t){if(e.blockRendering)return;let i,s,r=e.readCacheBounds();if(r)i="left="+r.x+",top="+r.y+",width="+r.width+",height="+r.height,s=!1;else{let a=h()(document),d=new F(a.width(),a.height());i="left=0,top=0,width="+d.width+",height="+d.height,s=!0}i+=",location=no,toolbar=no,menubar=no,resizable=yes";let o=u.create(Wn,{session:this.session,preserveOpener:!0}),l="popup-window.html?formId="+e.id;o.openWindow(l,"_blank",i,a=>{this._addPopupWindow(a,e,s)})}_addPopupWindow(e,t,i){let s=new Nr(e,t);s.resizeToPrefSize=i,s.on("popupWindowUnload",this._onPopupWindowUnload.bind(this)),this.popupWindows.push(s),h().log.isDebugEnabled()&&h().log.debug("Opened new popup window for form ID "+t.id)}_onDocumentPopupWindowReady(e,t){h().log.isDebugEnabled()&&h().log.debug("(FormController#_onDocumentPopupWindowReady) data="+t);let i;if(t.formId){let s=t.formId;h().log.isDebugEnabled()&&h().log.debug("Popup window for form ID "+s+" has been reloaded");for(let r=0;r<this.popupWindows.length&&(i=this.popupWindows[r],i.form.id!==s);r++);if(!i)throw new Error("Couldn't find popupWindow reference while popup window was reloaded")}else if(t.popupWindow)i=t.popupWindow;else throw new Error("Neither property 'formId' nor 'popupWindow' exists on data parameter");i._onReady()}_onPopupWindowUnload(e){let t=e.source,i=t.form;h().log.isDebugEnabled()&&h().log.debug("Popup window for form ID "+i.id+" is unloaded - don't know if its closed or reloaded yet"),i.remove(),setTimeout(()=>{t.isClosed()&&(h().log.isDebugEnabled()&&h().log.debug("Popup window for form ID "+i.id+" has been closed"),i.close())},250)}closePopupWindows(){this.popupWindows.forEach(e=>this._removePopupWindow(e.form)),this.popupWindows=[]}_removePopupWindow(e){let t=e.popupWindow;t&&(delete e.popupWindow,p.remove(this.popupWindows,t)),e.rendered&&(e.remove(),t?.close())}dispose(){h()(document).off("popupWindowReady",this._documentPopupWindowReadyHandler)}}class ef extends ae{filter;constructor(){super(),this.gridColumnCount=1,this.cssClass="filter-fields"}_init(e){super._init(e),this.filter.addFilterFields(this)}_renderProperties(){super._renderProperties(),this.filter.modifyFilterFields()}addFilterField(e,t){let i=u.create(e,{parent:this,label:this.session.text(t),statusVisible:!1,labelWidthInPixel:50});return this.addField0(i),i}addField0(e){this.fields.push(e),this._prepareFields()}linkFieldsWithTitle(e){this.filter.linkFieldsWithTitle(e)}}class Kn extends j{unsavedForms;openFormsField;constructor(){super(),this.unsavedForms=[]}_jsonModel(){return{id:"scout.UnsavedFormChangesForm",type:"model",title:"${textKey:SaveChangesOfSelectedItems}",askIfNeedSave:!1,rootGroupBox:{id:"MainBox",objectType:ae,menus:[{id:"OkMenu",objectType:Cn},{id:"CancelMenu",objectType:wn}],fields:[{id:"UnsavedChangesBox",objectType:ae,labelVisible:!1,gridColumnCount:1,fields:[{id:"OpenFormsField",objectType:Io,gridDataHints:{h:5},labelVisible:!1}]}]}}}_init(e){super._init(e),this.openFormsField=this.widget("OpenFormsField",Io),this.openFormsField.setLookupCall(u.create(tf,{session:this.session,unsavedForms:this.unsavedForms})),this.openFormsField.table.one("rowsInserted",s=>{s.source.checkAll(!0)});let t=u.create(J,{parent:this.openFormsField.table,id:"CheckAllMenu",text:"${textKey:CheckAll}"});t.on("action",s=>this.openFormsField.table.checkAll(!0));let i=u.create(J,{parent:this.openFormsField.table,id:"UncheckAllMenu",text:"${textKey:UncheckAll}"});i.on("action",s=>this.openFormsField.table.uncheckAll()),this.openFormsField.table.setMenus([t,i]),this.on("postLoad",s=>this.touch())}_validate(){let e=this.getInvalidForms();if(e.length>0){let t=[];return t.push("<p><b>",this.session.text("NotAllCheckedFormsCanBeSaved"),"</b></p>"),t.push(this.session.text("FormsCannotBeSaved"),"<br><br>"),e.forEach(i=>t.push("- ",Kn.getFormDisplayName(i),"<br>")),E.error({message:t.join("")})}return E.ok()}getInvalidForms(){let e=[];return this.openFormsField.value.forEach(t=>{let i=t.lifecycle.invalidElements(),s=i.missingElements.slice(),r=i.invalidElements.slice();t.visitDisplayChildren(o=>{let l=o.lifecycle.invalidElements();p.pushAll(s,l.missingElements),p.pushAll(r,l.invalidElements)},o=>o instanceof j),(s.length>0||r.length>0)&&e.push(t)}),e}static getFormDisplayName(e){return[e.title,e.subTitle].filter(Boolean).join(" - ")}}class tf extends Ss{unsavedForms;constructor(){super(),this.unsavedForms=[]}_data(){return this.unsavedForms.map(e=>{let t=Kn.getFormDisplayName(e);return[e,t]})}}class sf extends ae{table;groupByField;sortByField;isGrouping;isSorting;_tableGroupHandler;_tableSortHandler;_tableColumnStructureChangedHandler;_destroyHandler;constructor(){super(),this.table=null,this.labelVisible=!1,this.statusVisible=!1,this.gridColumnCount=7,this.bodyLayoutConfig=kt.ensure({hgap:8}),this.groupByField=null,this.sortByField=null,this._tableGroupHandler=this._onTableGroup.bind(this),this._tableSortHandler=this._onTableSort.bind(this),this._tableColumnStructureChangedHandler=this._onTableColumnStructureChanged.bind(this),this._destroyHandler=this._uninstallListeners.bind(this)}_installListeners(){this.table.on("group",this._tableGroupHandler),this.table.on("sort",this._tableSortHandler),this.table.on("columnStructureChanged",this._tableColumnStructureChangedHandler),this.table.one("destroy",this._destroyHandler)}_uninstallListeners(){this.table.off("group",this._tableGroupHandler),this.table.off("sort",this._tableSortHandler),this.table.off("columnStructureChanged",this._tableColumnStructureChangedHandler)}_init(e){super._init(e),this.table=this.parent,this._installListeners(),this.insertField(u.create(la,{id:"PlaceholderField",parent:this,gridDataHints:{w:5}})),this.groupByField=u.create(Pe,{id:"GroupByField",parent:this,label:this.session.text("GroupBy"),labelPosition:A.LabelPosition.ON_FIELD,clearable:ge.Clearable.ALWAYS,statusVisible:!1,displayStyle:Pe.DisplayStyle.DROPDOWN}),this.groupByField.setLookupCall(this._createGroupByLookupCall()),this.groupByField.setVisible(!p.empty(this.groupByField.lookupCall.data)),this.groupByField.on("propertyChange",this._onGroupingChange.bind(this)),this.insertField(this.groupByField),this.sortByField=u.create(Pe,{id:"SortByField",parent:this,label:this.session.text("SortBy"),labelPosition:A.LabelPosition.ON_FIELD,clearable:ge.Clearable.ALWAYS,statusVisible:!1,displayStyle:Pe.DisplayStyle.DROPDOWN}),this.sortByField.setLookupCall(this._createSortByLookupCall()),this.sortByField.setVisible(!p.empty(this.sortByField.lookupCall.data)),this.sortByField.on("propertyChange",this._onSortingChange.bind(this)),this.insertField(this.sortByField),this._syncSortingGroupingFields()}_findSortByLookupRowForKey(e){return this.sortByField.lookupCall.data.map(i=>i[0]).find(i=>i.column===e.column&&i.asc===e.asc)}_createGroupByLookupCall(){return u.create(Hd,{session:this.session,table:this.table})}_createSortByLookupCall(){return u.create(Nd,{session:this.session,table:this.table})}_onGroupingChange(e){if(this.table.tileMode&&e.propertyName==="value"){if(this.isGrouping=!0,e.newValue!==null){let t=e.newValue,i=t.sortIndex>=0&&!t.sortAscending?"desc":"asc";this.table.group(t,i)}else{let t=e.oldValue;this.table.removeGroupColumn(t)}this.isGrouping=!1}}_onSortingChange(e){if(this.table.tileMode&&e.propertyName==="value"){if(this.isSorting=!0,e.newValue!==null){let t=e.newValue;this.table.sort(t.column,t.asc?"asc":"desc")}else{let t=e.oldValue;this.table.removeSortColumn(t.column)}this.isSorting=!1}}_syncSortingGroupingFields(){let e=p.find(this.table.visibleColumns(),i=>i.grouped&&i.sortIndex===0);e?this.groupByField.setValue(e):this.groupByField.setValue(null);let t=p.find(this.table.visibleColumns(),i=>i.sortActive&&i.sortIndex===0);t?this.sortByField.setValue(this._findSortByLookupRowForKey({column:t,asc:t.sortAscending})):this.sortByField.setValue(null)}_onTableGroup(e){this.isGrouping||this._syncSortingGroupingFields()}_onTableSort(e){this.isSorting||this._syncSortingGroupingFields()}_onTableColumnStructureChanged(e){const t=this.groupByField.lookupCall;t instanceof Ss&&(t.refreshData(),this.groupByField.setVisible(!p.empty(t.data)));const i=this.sortByField.lookupCall;i instanceof Ss&&(i.refreshData(),this.sortByField.setVisible(!p.empty(i.data))),this._syncSortingGroupingFields()}}class Lm extends G{init(e){return super.init(e)}_prepareEssentials(e){Le.get().init()}_defaultBootstrappers(){return[]}_init(e){return e=e||{},e.texts=h().extend({},de.readFromDOM(),e.texts),this._prepareDOM(),u.create(Yo,e).render(h()("body").addClass("login-body")),h().resolvedPromise()}}class Yo extends wl{ajaxOptions;authUrl;onPostDoneFunc;redirectUrl;userDataKey;passwordDataKey;tokenDataKey;additionalData;prepareRedirectUrlFunc;messageKey;texts;$message;$form;$user;$password;$token;$button;constructor(){super(),this.ajaxOptions={method:"POST"},this.authUrl="auth",this.onPostDoneFunc=this.checkTwoFactorResponse.bind(this),this.redirectUrl=null,this.logoUrl="logo.png",this.userDataKey="user",this.passwordDataKey="password",this.tokenDataKey="token",this.additionalData={},this.prepareRedirectUrlFunc=Yo.prepareRedirectUrl,this.messageKey=null,this.texts=null,this.$message=null,this.$form=null,this.$user=null,this.$password=null,this.$token=null,this.$button=null}init(e){e=e||{};let t=h().extend({"ui.Login":"Login","ui.LoginFailed":"Login failed","ui.User":"Username","ui.Password":"Password","ui.Token":"Token"},e.texts);delete e.texts,e.ajaxOptions=h().extend(this.ajaxOptions,e.ajaxOptions),h().extend(this,e),this.texts=new Ds(t)}_render(){super._render(),this.$container.addClass("login-box"),this.$content.addClass("login-box-content "),this.$form=h()("<form>").attr("action",this.authUrl).attr("method","post").on("submit",this._onLoginFormSubmit.bind(this)).appendTo(this.$content),this.messageKey&&(this.$message=h()("<div>").attr("id","message-box").addClass("message-box").html(_.nl2br(this.texts.get(this.messageKey))).appendTo(this.$form)),this.$user=h()("<input>").attr("type","text").attr("autocapitalize","off").attr("autocorrect","off").placeholder(this.texts.get("ui.User")).appendTo(this.$form),this.$password=this._createPasswortField().appendTo(this.$form),this.$button=h()("<button>").attr("type","submit").addClass("login-button button default").text(this.texts.get("ui.Login")).appendTo(this.$form),this.$user.focus()}_createPasswortField(){return h()("<input>").attr("type","password").placeholder(this.texts.get("ui.Password"))}_resetButtonText(){this.$button.text(this.texts.get("ui.Login")).removeClass("login-error")}data(){let e={};return e[this.userDataKey]=this.$user.val(),this.$password?e[this.passwordDataKey]=this.$password.val():this.$token&&(e[this.tokenDataKey]=this.$token.val()),h().extend(e,this.additionalData),e}_onLoginFormSubmit(e){e.preventDefault();let t=this.$form.attr("action"),i=this.data();this.$button.removeClass("login-error").setEnabled(!1),this.$user.off("input.resetLoginError"),this.$password&&this.$password.off("input.resetLoginError"),w.get().supportsCssAnimation()&&this.$button.html("").append(h()("<div>").addClass("login-button-loading"));let s=h().extend({},this.ajaxOptions,{url:t,data:i});h().ajax(s).done(this._onPostDone.bind(this)).fail(this._onPostFail.bind(this))}checkTwoFactorResponse(e){e&&e.twoFactorRequired?setTimeout(this._enableTwoFactor.bind(this),300):(this.remove(),this.redirect(e))}_enableTwoFactor(){this.$button.setEnabled(!0).html("").text(this.texts.get("ui.Login")),this.$user.setEnabled(!1),this.$token=h()("<input>").attr("type","password").placeholder(this.texts.get("ui.Token")),this.$password.replaceWith(this.$token),this.$password=null,this.$token.focus()}redirect(e){this.$backgroundElements.addClass("box-background-elements-fadeout"),w.get().supportsCssAnimation()?this.$backgroundElements.oneAnimationEnd(()=>{this._redirect(e)}):this._redirect(e)}_redirect(e){let t=this.redirectUrl;t||(t=(window.location.href||"").trim(),t=this.prepareRedirectUrlFunc(t)),t?window.location.href=t:window.location.reload()}_onPostDone(e){this.onPostDoneFunc.call(this,e)}_onPostFail(e,t,i){setTimeout(this._onPostFailImpl.bind(this,e,t,i),300)}_onPostFailImpl(e,t,i){this.$token&&(this.$password=this._createPasswortField(),this.$token.replaceWith(this.$password),this.$token=null),this.$button.setEnabled(!0).html("").text(this.texts.get("ui.LoginFailed")).addClass("login-error"),this.$user.setEnabled(!0).val("").focus(),this.$password.val(""),this.$user.one("input.resetLoginError",this._resetButtonText.bind(this)),this.$password.one("input.resetLoginError",this._resetButtonText.bind(this))}static prepareRedirectUrl(e){let t=/^([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e||"");return t[1].replace(/login.html$/,"").replace(/login$/,"").replace(/logout$/,"")+(t[2]?t[2]:"")+(t[3]?t[3]:"")}}class Bm extends G{_prepareEssentials(e){Le.get().init()}_defaultBootstrappers(){return[]}_init(e){return e=e||{},e.texts=h().extend({},de.readFromDOM(),e.texts),this._prepareDOM(),u.create(rf,e).render(h()("body").addClass("logout-body")),h().resolvedPromise()}}class rf extends wl{texts;loginUrl;options;$buttonBar;constructor(){super(),this.texts=null,this.loginUrl=null,this.options=null,this.$buttonBar=null}init(e){let t={loginUrl:he.getItemFromSessionStorage("scout:loginUrl")||"./",logoUrl:"logo.png"};this.options=h().extend({},t,e);let i={"ui.LogoutSuccessful":"Good bye!","ui.LoginAgain":"Login again"};this.options.texts=h().extend({},i,e.texts),this.texts=new Ds(this.options.texts),this.loginUrl=this.options.loginUrl,this.logoUrl=this.options.logoUrl}_render(){super._render(),this.$content.addClass("small centered").appendDiv().html(_.nl2br(this.texts.get("ui.LogoutSuccessful"))),this.$buttonBar=h()("<div>").addClass("button-bar").appendTo(this.$content),h()("<button>").addClass("button").text(this.texts.get("ui.LoginAgain")).on("click",this._loginAgain.bind(this)).appendTo(this.$buttonBar)}_loginAgain(){window.location.href=this.loginUrl}}class nf extends ce{ref;constructor(){super(),this.ref=null}_render(){super._render(),this.$container.addClass("breadcrumb-item")}_renderText(){const e=this.text||"";e&&this.textVisible?(this.$text||(this.$text=this.$container.appendSpan("content text"),x.install(this.$text,this.session)),this.$text.text(e)):this._removeText()}}class Om extends er{}class Hm extends I{breadcrumbItems;ellipsisBreadcrumbItem;constructor(){super(),this.breadcrumbItems=[],this.ellipsisBreadcrumbItem=null,this._addWidgetProperties(["breadcrumbItems"])}_init(e){super._init(e),this._setBreadcrumbItems(this.breadcrumbItems)}_render(){this.$container=this.$parent.appendDiv("breadcrumb-bar"),this.htmlComp=x.install(this.$container,this.session),this.htmlComp.setLayout(new of(this))}_renderProperties(){super._renderProperties(),this._renderBreadcrumbItems()}setBreadcrumbItems(e){this.setProperty("breadcrumbItems",e)}_setBreadcrumbItems(e){this._setProperty("breadcrumbItems",p.ensure(e))}_renderBreadcrumbItems(){this.breadcrumbItems.forEach((e,t)=>{t===1&&this._renderEllipsis(),e.render()}),this._updateMarkers(),this.htmlComp.invalidateLayoutTree()}_renderEllipsis(){this.ellipsisBreadcrumbItem&&this.ellipsisBreadcrumbItem.destroy(),!(this.breadcrumbItems.length<=2)&&(this.ellipsisBreadcrumbItem=u.create(nf,{parent:this,text:"...",enabled:!1}),this.ellipsisBreadcrumbItem.render())}_updateMarkers(){const e=[];this.breadcrumbItems.forEach(t=>{t.rendered&&(t.$container.removeClass("first last"),t.visible&&e.push(t))}),e.length&&(e[0].$container.addClass("first"),e[e.length-1].$container.addClass("last"))}}class of extends ne{_breadcrumbBar;constructor(e){super(),this._breadcrumbBar=e}layout(e){this._undoCollapse();const t=this._visibleBreadcrumbItems(),s=this._breadcrumbBar.htmlComp.size();if(this._actualPrefSize(t,!1).width<=s.width){this._applyToEllipsis(o=>o.setVisible(!1));return}this._applyToEllipsis(o=>o.setVisible(!0)),this._collapse(s)}_collapse(e){let t=1;const i=this._visibleBreadcrumbItems();let s=this._actualPrefSize(i,!0);for(;s.width>e.width&&t<i.length-1;)i[t].$container.hide(),i.splice(t,1),s=this._actualPrefSize(i,!0)}_applyToEllipsis(e){this._breadcrumbBar.ellipsisBreadcrumbItem&&e(this._breadcrumbBar.ellipsisBreadcrumbItem)}_undoCollapse(){p.ensure(this._breadcrumbBar.breadcrumbItems).forEach(e=>{e.$container.show()})}preferredLayoutSize(e,t){return this._undoCollapse(),this._actualPrefSize()}_visibleBreadcrumbItems(){return this._breadcrumbBar.breadcrumbItems.filter(e=>e.visible)}_actualPrefSize(e,t){e=e||this._visibleBreadcrumbItems();const i=this._breadcrumbItemsWidth(e,t),s=C.prefSize(this._breadcrumbBar.$container,{includeMargin:!0,useCssSize:!0});return s.width=i+this._breadcrumbBar.htmlComp.insets().horizontal(),s}_breadcrumbItemsWidth(e,t){let i=0;return e=e||this._visibleBreadcrumbItems(),e.forEach(s=>{s.rendered&&(i+=s.$container.outerWidth(!0))}),t&&this._breadcrumbBar.ellipsisBreadcrumbItem&&this._breadcrumbBar.ellipsisBreadcrumbItem.rendered&&(i+=this._breadcrumbBar.ellipsisBreadcrumbItem.$container.outerWidth(!0)),i}}class Nm extends K{}class Vm extends A{breadcrumbBar;constructor(){super(),this.breadcrumbBar=null,this._addWidgetProperties(["breadcrumbBar"])}_render(){this.addContainer(this.$parent,"breadcrumb-bar-field"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this._renderBreadcrumbBar()}setBreadcrumbItems(e){this.breadcrumbBar&&this.breadcrumbBar.setBreadcrumbItems(e)}setBreadcrumbBar(e){this.setProperty("breadcrumbBar",e)}_renderBreadcrumbBar(){this.breadcrumbBar&&(this.breadcrumbBar.render(),this.addField(this.breadcrumbBar.$container),this.invalidateLayoutTree())}_removeBreadcrumbBar(){this.breadcrumbBar&&(this.breadcrumbBar.remove(),this._removeField(),this.invalidateLayoutTree())}}class Wm extends at{}var lf=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class zm extends I{onCallback(e,t,i,s,r){h().resolvedPromise().then(()=>u.create(e).handle({callbackId:t,owner:i,data:s,contextElements:r})).then(o=>this._convertResult(o)).then(o=>this._triggerCallbackEnd(t,o,null)).catch(o=>this._convertError(o).then(l=>this._triggerCallbackEnd(t,null,l)))}_convertResult(e){return e instanceof Ia?e:u.create(Ia,{data:e})}_convertError(e){return e instanceof ms?h().resolvedPromise(e):G.get().errorHandler.analyzeError(e).then(t=>u.create(ms,{message:t.message,code:t.code}))}_triggerCallbackEnd(e,t,i){this.trigger("callbackEnd",{callbackId:e,result:t,error:i})}}class Ia{objectType;data;contextElements;init(e){h().extend(this,e)}}let ms=class extends se{message;code};lf([Reflect.metadata("scout.m.t",String)],ms.prototype,"message",void 0),lf([Reflect.metadata("scout.m.t",String)],ms.prototype,"code",void 0),ms=lf([ue("scout.UiCallbackError")],ms),window.scout.DataObjectInventory.get().add(ms,"scout.UiCallbackError","UiCallbackErrorDo");class Um extends K{onModelAction(e){e.type==="callback"?this._onModelCallback(e):super.onModelAction(e)}_onModelCallback(e){let t=e.id,i=e.handlerObjectType,s=this._resolveOwner(e.owner),r=xe.deserialize(e.data),o=Vn.jsonToContextElements(this.session,e.contextElements);this.widget.onCallback(i,t,s,r,o)}_resolveOwner(e){if(!e)return null;let t=u.assertInstance(this.session.getModelAdapter(e),K,`No adapter found for '${e}'`);return u.assertInstance(t.widget,I)}_onWidgetEvent(e){e.type==="callbackEnd"?this._onWidgetCallbackEnd(e):super._onWidgetEvent(e)}_onWidgetCallbackEnd(e){let t=e.callbackId,i=e.error,s=e.result;this._send("callbackEnd",{id:t,error:xe.serialize(i)||void 0,data:xe.serialize(s?.data)||void 0,contextElements:Vn.contextElementsToJson(s?.contextElements)||void 0})}}var af=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};class Gm{handle(e){if(!navigator.geolocation)return $.rejectedPromise("Geolocation API not supported");let t=$.Deferred();return navigator.geolocation.getCurrentPosition(i=>t.resolve(this._positionSuccess(i)),i=>t.reject(this._positionError(i))),t.promise()}_positionSuccess(e){return u.create(dr,{latitude:""+e.coords.latitude,longitude:""+e.coords.longitude})}_positionError(e){return u.create(ms,{message:e.message,code:""+e.code})}}let dr=class extends se{latitude;longitude};af([Reflect.metadata("scout.m.t",String)],dr.prototype,"latitude",void 0),af([Reflect.metadata("scout.m.t",String)],dr.prototype,"longitude",void 0),dr=af([ue("scout.GeoLocation")],dr),window.scout.DataObjectInventory.get().add(dr,"scout.GeoLocation","GeoLocationDo");class Qt{static ERROR_MISSING_OUTLINE="missing-outline";static ERROR_MISSING_PAGE_PARAM="missing-page-param";static ERROR_UNSUPPORTED_NODE_TYPE="unsupported-node-type";static ERROR_PAGE_NOT_BOOKMARKABLE="page-not-bookmarkable";static ERROR_PAGE_PATH_NOT_BOOKMARKABLE="page-path-not-bookmarkable";static ERROR_MISSING_ROW_BOOKMARK_IDENTIFIER="missing-row-bookmark-identifier";objectType;desktop;page;createOutline;persistableRequired;fallbackAllowed;createTitle;createDescription;createTablePreferences;createTableRowSelections;constructor(){this.createOutline=!0,this.persistableRequired=!0,this.fallbackAllowed=!0,this.createTitle=!0,this.createDescription=!0,this.createTablePreferences=!0,this.createTableRowSelections=!0}init(e){Object.assign(this,e),u.assertValue(this.desktop)}get session(){return this.desktop.session}build(){return $.when(this._build())}async _build(){let e=await this._createBookmarkDefinition();return this._createBookmark(e)}async _createBookmarkDefinition(){let e=this.page,t=e?.outline||this.desktop.outline,i=t?.buildUuid();if(!i)throw Qt.ERROR_MISSING_OUTLINE;e===void 0&&(e=t.activePage());let s=this.createOutline,r=e?await this._pageToBookmarkPage(e,null):null,o=[];if(s&&e){let a=e.parentNode,d=e;for(;a&&!a.compactRoot;){let c=await this._pageToBookmarkPage(a,d);if(!c){if(this.fallbackAllowed){s=!1;break}throw Qt.ERROR_PAGE_PATH_NOT_BOOKMARKABLE}o.unshift(c),d=a,a=a.parentNode}}let l;return s?l=u.create(zi,{outlineId:i,bookmarkedPage:r,pagePath:o}):l=u.create(jr,{bookmarkedPage:r}),l}async _pageToBookmarkPage(e,t){if(!e.pageParam)throw Qt.ERROR_MISSING_PAGE_PARAM;if(e.nodeType===ht.NodeType.NODES)return this._pageToNodeBookmarkPage(e,t);if(e.nodeType===ht.NodeType.TABLE)return this._pageToTableBookmarkPage(e,t);throw Qt.ERROR_UNSUPPORTED_NODE_TYPE}async _pageToNodeBookmarkPage(e,t){return u.create(Os,{pageParam:e.pageParam,displayText:e.getDisplayText()})}async _pageToTableBookmarkPage(e,t){if(e instanceof zn)return this._tablePageToTableBookmarkPage(e,t);throw Qt.ERROR_PAGE_NOT_BOOKMARKABLE}async _tablePageToTableBookmarkPage(e,t){let i=this._createExpandedTableRowIdentifier(e,t),s=this._createSelectedTableRowIdentifiers(e),r=!0,o=await this._createSearchFilterForBookmark(e),l=await this._createTablePreferencesForBookmark(e),a=await this._createChartTableControlConfigForBookmark(e);if(t&&!i&&!t.pageParam)throw Qt.ERROR_MISSING_ROW_BOOKMARK_IDENTIFIER;return u.create(xt,{pageParam:e.pageParam,displayText:e.getDisplayText(),expandedChildRow:i,selectedChildRows:s,searchFilterComplete:r,searchData:o,tablePreferences:l,chartTableControlConfig:a})}_createExpandedTableRowIdentifier(e,t){return t&&t.row?e.getTableRowIdentifier(t.row,!this.persistableRequired):null}_createSelectedTableRowIdentifiers(e){return this.createTableRowSelections?e.childrenLoaded?e.detailTable.selectedRows.map(t=>e.getTableRowIdentifier(t,!this.persistableRequired)):[]:[]}async _createSearchFilterForBookmark(e){let t=e.getSearchForm();return t?this._exportSearchFormData(t):null}async _exportSearchFormData(e){return e.exportData()}async _createTablePreferencesForBookmark(e){if(!this.createTablePreferences||!e.detailTable)return null;let t=e.detailTable,i=je.create(t),s=je.createProfile(t,{includeUserFilters:!0});return i.tablePreferenceProfiles=new Map([[gi.PROFILE_ID_BOOKMARK,s]]),i}async _createChartTableControlConfigForBookmark(e){return u.create(La).exportConfig(e)}async _createBookmark(e){let t=await this._createBookmarkTitle(e),i=await this._createBookmarkDescription(e);return u.create(ts,{definition:e,title:t||void 0,description:i||void 0})}async _createBookmarkTitle(e){if(!this.createTitle)return null;let t=[];if(e instanceof zi){let i=gt.get(this.session).resolveOutline(e.outlineId);i&&t.push(i.title),e.pagePath.map(s=>s.displayText).forEach(s=>t.push(s))}return e.bookmarkedPage&&t.push(e.bookmarkedPage.displayText),t=t.filter(i=>_.hasText(i)),p.hasElements(t)?t.join(" - "):this.session.text("Bookmark")}async _createBookmarkDescription(e){if(!this.createDescription)return null;let t=[...e instanceof zi?e.pagePath:[],e.bookmarkedPage].filter(Boolean),i=[];return t.forEach((s,r)=>{let o=_.repeat(" ",r),l=s.displayText||this.session.text("Node");if(i.push(o+l),s instanceof xt&&s.searchData){let a=s.searchData instanceof se?s.searchData.toPojo():s.searchData;Object.keys(a).filter(d=>!_.startsWith(d,"_")).filter(d=>!b.isNullOrUndefinedOrEmpty(a[d])).map(d=>d+": "+JSON.stringify(a[d])).forEach(d=>i.push(o+" "+d))}}),i.join(`
`)}}const $_=()=>({objectType:j,title:"${textKey:Bookmark}",saveNeededVisible:!1,rootGroupBox:{id:"MainBox",objectType:ae,mainBox:!0,gridDataHints:{widthInPixel:600},menus:[{id:"OkMenu",objectType:Cn},{id:"CancelMenu",objectType:wn}],fields:[{id:"GroupBox",objectType:ae,statusVisible:!1,gridDataHints:{w:A.FULL_WIDTH},fields:[{id:"NameField",objectType:Ni,label:"${textKey:Name}",mandatory:!0}]}]}});class hf extends j{bookmark;bookmarkId;_jsonModel(){return $_()}_load(){return this.bookmark?$.resolvedPromise(this.bookmark):this.bookmarkId?_s.get(this.session).loadBookmark(this.bookmarkId):gt.get(this.session).createBookmark()}importData(){this.widget("NameField").setValue(this.data.title)}exportData(){return this.data.title=this.widget("NameField").value,this.data}_save(e){return this.bookmark?$.resolvedPromise():_s.get(this.session).storeBookmark(this.data).then(t=>this.setData(t))}ok(){return!this.bookmarkId&&!this.bookmark&&this.touch(),super.ok()}}class _s{static _INSTANCES=new Map;static get(e){return e=e||G.get().sessions[0],u.assertParameter("session",e),b.getOrSetIfAbsent(_s._INSTANCES,e,t=>u.create(_s))}storeBookmark(e){throw new Error("Not implemented")}loadBookmark(e){throw new Error("Not implemented")}loadAllBookmarks(){throw new Error("Not implemented")}storeAllBookmarks(e){throw new Error("Not implemented")}}class gt{static _INSTANCES=new Map;static ERROR_ALREADY_LOADING="already-loading";static ERROR_WRONG_DEFINITION_TYPE="wrong-definition-type";static ERROR_OUTLINE_NOT_FOUND="outline-not-found";static ERROR_PAGE_NOT_FOUND="page-not-found";static ERROR_PAGE_WRONG_OUTLINE="page-wrong-outline";objectType;desktop;loading;static get(e){return e=e||G.get().sessions[0],u.assertParameter("session",e),b.getOrSetIfAbsent(gt._INSTANCES,e,t=>u.create(gt,{desktop:t.desktop}))}constructor(){this.desktop=null,this.loading=!1}init(e){Object.assign(this,e),u.assertValue(this.desktop)}get session(){return this.desktop.session}setLoading(e){this.loading=e,this.desktop.setBusy(this.loading)}resolveOutline(e){return this.desktop.getOutlines().find(t=>t.buildUuid()===e)}pageParamsMatch(e,t){return!e&&!t?!0:!e||!t?!1:(e=this._normalizePageParam(e),t=this._normalizePageParam(t),e.equals(t))}_normalizePageParam(e){e=e.clone();for(const t of this._getIgnoredContributionClassesForPageParamComparison())e.removeContribution(t);return e}_getIgnoredContributionClassesForPageParamComparison(){return[ds]}createTableRowIdentifier(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return u.create(df).createTableRowIdentifier(e,t,i)}createBookmark(e,t){return u.create(Qt,h().extend({desktop:this.desktop,createTableRowSelections:!1},e)).build().catch(s=>{if(u.nvl(t?.handleErrors,!0))return this.handleCreateBookmarkError(s);throw s})}createBookmarkForRefresh(e,t){return this.createBookmark(h().extend({fallbackAllowed:!1,persistableRequired:!1,createTitle:!1,createDescription:!1,createTablePreferences:!1},e),t)}getBookmarkId(e){if(e instanceof ts)return e.id}activateBookmark(e,t){return h().when(this._activateBookmarkAsync(e,t))}async _activateBookmarkAsync(e,t){try{if(!(e?.definition instanceof zi))throw gt.ERROR_WRONG_DEFINITION_TYPE;if(this.loading)throw gt.ERROR_ALREADY_LOADING;this.setLoading(!0);try{await this._activateOutlineBookmarkDefinition(e.definition,t)}finally{this.setLoading(!1)}}catch(i){if(u.nvl(t?.handleErrors,!0))return this.handleActivateBookmarkError(i);throw i}}async _activateOutlineBookmarkDefinition(e,t){let i=this.resolveOutline(e.outlineId),s=e.pagePath||[],r=e.bookmarkedPage,o=r?[...s,r]:null;await this._activateBookmarkPath({parentOutline:i,pagePath:o},t)}activateBookmarkPath(e,t){return h().when(this._activateBookmarkPathAsync(e,t))}async _activateBookmarkPathAsync(e,t){try{if(this.loading)throw gt.ERROR_ALREADY_LOADING;this.setLoading(!0);try{await this._activateBookmarkPath(e,t)}finally{this.setLoading(!1)}}catch(i){if(u.nvl(t?.handleErrors,!0))return this.handleActivateBookmarkError(i);throw i}}async _activateBookmarkPath(e,t){let i=e.parentOutline||e.parentPage?.outline;if(!i||!i.visible||!i.enabled)throw gt.ERROR_OUTLINE_NOT_FOUND;if(u.nvl(t?.activateOutline,!0)&&(this.desktop.setOutline(i),this.desktop.bringOutlineToFront()),e.parentPage&&e.parentPage.outline!==i)throw gt.ERROR_PAGE_WRONG_OUTLINE;let s=e.parentPage,r=e.parentBookmarkPage;if(s){let l=i.selectedNode();for(;l;)l===s&&i.selectNode(s),l=l.parentNode}if(s&&r&&this._applyBookmarkPage(s,r,!1),p.empty(e.pagePath)){this._revealPage(s);return}let o=e.pagePath.slice();for(;p.hasElements(o);){let l=o[0],a=await this._resolvePage(i,s,r,l,t);if(!a)break;await this._applyBookmarkPageAndReload(a,l,!1),s=a,r=l,o.shift()}if(!s)throw gt.ERROR_PAGE_NOT_FOUND;this._revealPage(s),p.hasElements(o)&&u.nvl(t?.resetViewAndWarnOnFail,!0)&&s.detailTable.setTableStatus(E.error(this.session.text("BookmarkResolutionCanceled")))}async _resolvePage(e,t,i,s,r){if(!t)return e.nodes.find(o=>o.matchesPageParam(s.pageParam));if(await t.ensureLoadChildren(),t instanceof zn&&i instanceof xt&&i.expandedChildRow){let o=t.detailTable.rows.find(l=>{let a=t.getTableRowIdentifier(l);return b.equals(a,i.expandedChildRow)});if(o&&!o.filterAccepted&&t.detailTable.hasUserFilter()&&u.nvl(r?.resetViewAndWarnOnFail,!0)&&(t.detailTable.resetUserFilter(),t.detailTable.setTableStatus(E.warning(this.session.text("BookmarkResetColumnFilters"))),!o.filterAccepted))return null;if(o)return o.page}return t.childNodes.find(o=>o.matchesPageParam(s.pageParam))}_revealPage(e){if(!e)return;let t=e.outline,i=e.nodeType!==ht.NodeType.TABLE;this._expandPath(e,i),t.deselectAll(),t.selectNode(e),t.revealSelection()}_expandPath(e,t){let i=e.outline;t&&i.expandNode(e,{renderAnimated:!1});let s=e.parentNode;for(;s;)i.expandNode(s,{renderAnimated:!1}),s=s.parentNode}handleCreateBookmarkError(e){return u.isOneOf(e,Qt.ERROR_MISSING_OUTLINE,Qt.ERROR_MISSING_PAGE_PARAM,Qt.ERROR_PAGE_NOT_BOOKMARKABLE,Qt.ERROR_PAGE_PATH_NOT_BOOKMARKABLE,Qt.ERROR_MISSING_ROW_BOOKMARK_IDENTIFIER)?Ri.openOk(this.desktop,this.session.text("CannotCreateBookmarkAtThisLocation"),E.Severity.ERROR):G.get().errorHandler.handle(e)}handleActivateBookmarkError(e){if(e===gt.ERROR_ALREADY_LOADING){h().log.error("Another bookmark is currently loading");return}return e===gt.ERROR_WRONG_DEFINITION_TYPE?Ri.openOk(this.desktop,this.session.text("BookmarkWrongDefinitionType"),E.Severity.ERROR):e===gt.ERROR_OUTLINE_NOT_FOUND?Ri.openOk(this.desktop,this.session.text("BookmarkOutlineNotFound"),E.Severity.ERROR):e===gt.ERROR_PAGE_NOT_FOUND?Ri.openOk(this.desktop,this.session.text("BookmarkResolvingFailed"),E.Severity.ERROR):G.get().errorHandler.handle(e)}applyBookmarkToPage(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!t||!t.definition)return;let s=t.definition.bookmarkedPage;this._applyBookmarkPage(e,s,i)}applyBookmarkToPageAndReload(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return h().when(this._applyBookmarkToPageAndReloadAsync(e,t,i))}async _applyBookmarkToPageAndReloadAsync(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!t||!t.definition)return;let s=t.definition.bookmarkedPage;await this._applyBookmarkPageAndReload(e,s,i)}async _applyBookmarkPageAndReload(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this._applyBookmarkPage(e,t,i),await e.ensureLoadChildren(),e instanceof zn&&t instanceof xt&&this._restoreSelection(e,t.selectedChildRows)}_applyBookmarkPage(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;e instanceof zn&&t instanceof xt?this._applyBookmarkToTablePage(e,t,i):e instanceof Kr&&t instanceof Os&&this._applyBookmarkToNodePage(e,t)}_applyBookmarkToTablePage(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this._prepareTablePage(e,t,i)}_applyBookmarkToNodePage(e,t){}_prepareTablePage(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;e.ensureDetailTable(),this._prepareTablePreferences(e,t,i),this._prepareSearchFilter(e,t,i),this._prepareChartTableControlState(e,t)}_prepareTablePreferences(e,t,i){const s=e.detailTable,r=t.tablePreferences,o=je.getProfile(r,gi.PROFILE_ID_BOOKMARK);je.apply(s,r),je.applyProfile(s,o,{applyUserFilters:!0}),i?s.setInitialUiPreferences(o||je.createProfile(s)):je.storeGlobalProfile(s)}_prepareSearchFilter(e,t,i){e.setSearchFilter(t.searchData,i),e.childrenLoaded=!1}_prepareChartTableControlState(e,t){u.create(La).importConfig(e,t.chartTableControlConfig)}_restoreSelection(e,t){e.ensureDetailTable();let i=e.detailTable;if(!i)return;let s=[];p.hasElements(t)&&(s=i.rows.filter(r=>{if(!r.filterAccepted)return!1;let o=e.getTableRowIdentifier(r);return t.some(l=>b.equals(l,o))})),i.expandParentRows(s),i.selectRows(s)}}class df{createTableRowIdentifier(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=t.getKeyValues().map(o=>this.createTableRowIdentifierComponent(e,o,i));return r.length===0?null:u.create(qr,{keyComponents:r})}createTableRowIdentifierComponent(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(b.isNullOrUndefined(t))return null;if(t instanceof Date)return u.create(Xr,{key:t});if(typeof t=="number")return u.create(Zr,{key:t});if(typeof t=="string")return u.create(Qr,{key:t});if(typeof t=="boolean")return u.create(Jr,{key:t});if(i)return u.create(Yr,{key:t});throw new Error(`Unable to create table row identifier for key value "${t}"`)}}class La{objectType;exportConfig(e){return $.when(this._exportConfig(e))}async _exportConfig(e){return null}importConfig(e,t){return $.when(this._importConfig(e,t))}async _importConfig(e,t){}}class uf extends _s{get _storeId(){return"scout:bookmarks:"+window.location.pathname}_readFromStore(){let e=he.getItemFromLocalStorage(this._storeId);return xe.parse(e,Array)}_writeToStore(e){if(!e){he.removeItemFromLocalStorage(this._storeId);return}he.setItemToLocalStorage(this._storeId,xe.stringify(e))}storeBookmark(e){return $.resolvedPromise().then(()=>{if(!e)return e;let t=this._readFromStore()||[];e.id=e.id||yi.get().take();let i=t.findIndex(s=>s.id===e.id);return i===-1?t.push(e):t[i]=e,this._writeToStore(t),e})}loadBookmark(e){return $.resolvedPromise().then(()=>(this._readFromStore()||[]).find(i=>i.id===e)||null)}loadAllBookmarks(){return $.resolvedPromise().then(()=>this._readFromStore()||[])}storeAllBookmarks(e){return $.resolvedPromise().then(()=>{e=p.ensure(e).filter(t=>t?(t.id=t.id||yi.get().take(),!0):!1),this._writeToStore(e)})}}const M_=()=>({objectType:j,title:"${textKey:BookmarksManageMenu}",displayHint:j.DisplayHint.VIEW,rootGroupBox:{id:"MainBox",objectType:ae,mainBox:!0,gridColumnCount:1,menus:[{id:"OkMenu",objectType:Cn},{id:"CancelMenu",objectType:wn}],fields:[{id:"GroupBox",objectType:ae,statusVisible:!1,gridDataHints:{w:1},fields:[{id:"BookmarksTableField",objectType:fs,labelVisible:!1,statusVisible:!1,gridDataHints:{h:6},table:{id:"BookmarksTable",objectType:H,autoResizeColumns:!0,defaultRowAction:"EditMenu",columns:[{id:"BookmarkColumn",objectType:le,displayable:!1},{id:"NameColumn",objectType:le,text:"${textKey:Name}",width:200}],menus:[{id:"EditMenu",objectType:J,text:"Edit",iconId:q.PENCIL,keyStroke:"shift-enter",menuTypes:[H.MenuType.SingleSelection]},{id:"DeleteMenu",objectType:J,text:"Delete",iconId:q.REMOVE,keyStroke:"delete",menuTypes:[H.MenuType.SingleSelection,H.MenuType.MultiSelection]},{id:"ActivateMenu",objectType:J,text:"Activate",iconId:q.TARGET,keyStroke:"ctrl-enter",menuTypes:[H.MenuType.SingleSelection]},{id:"MoveRowUpMenu",objectType:J,iconId:q.ANGLE_UP,tooltipText:"${textKey:MoveUp}",keyStroke:"ctrl-up",stackable:!1,horizontalAlignment:1},{id:"MoveRowDownMenu",objectType:J,iconId:q.ANGLE_DOWN,tooltipText:"${textKey:MoveDown}",keyStroke:"ctrl-down",stackable:!1,horizontalAlignment:1}]}}]}]}});class Km extends H{}class jm extends j{_jsonModel(){return M_()}_init(e){super._init(e),this.widget("EditMenu").on("action",this._onEditMenuAction.bind(this)),this.widget("DeleteMenu").on("action",this._onDeleteMenuAction.bind(this)),this.widget("ActivateMenu").on("action",this._onActivateMenuAction.bind(this)),this._installUpDownMenus()}_load(){return _s.get(this.session).loadAllBookmarks()}importData(){let e=p.ensure(this.data).map(t=>{let i=t.title;return{cells:[t,i,null,null]}});this.widget("BookmarksTable").insertRows(e)}exportData(){const e=this.widget("BookmarksTable"),t=e.columnById("BookmarkColumn");return e.rows.map(i=>t.cellValue(i))}_save(e){return _s.get(this.session).storeAllBookmarks(e)}_onEditMenuAction(e){const t=this.widget("BookmarksTable"),i=t.columnById("BookmarkColumn"),s=t.columnById("NameColumn"),r=t.selectedRow();let o=u.create(hf,{parent:this,bookmark:i.cellValue(r)});o.open(),o.whenSave().then(()=>{let l=o.data,a=l.title;i.setCellValue(r,l),s.setCellValue(r,a)})}_onDeleteMenuAction(e){const t=this.widget("BookmarksTable");t.deleteRows(t.selectedRows)}_onActivateMenuAction(e){const i=this.widget("BookmarksTable").columnById("BookmarkColumn");gt.get(this.session).activateBookmark(i.selectedCellValue())}_installUpDownMenus(){const e=this.widget("BookmarksTableField"),t=this.widget("BookmarksTable"),i=t.widget("MoveRowUpMenu"),s=t.widget("MoveRowDownMenu");u.create(Ml).install({table:t,moveRowUpMenu:i,moveRowDownMenu:s}),t.on("rowOrderChanged",()=>e.touch())}}class Wi{objectType;name;baseUrl;hasUiBackend;_endpointUrls;static MAIN_SYSTEM="main";constructor(){this.name=null,this.baseUrl="api",this.hasUiBackend=!1,this._endpointUrls=new Map}init(e){if(u.assertParameter("name",e.name),this.name=e.name,this.hasUiBackend=u.nvl(e.hasUiBackend,e.name===Wi.MAIN_SYSTEM),this.baseUrl=u.nvl(e.baseUrl,this.baseUrl),e.endpointUrls)for(const[t,i]of Object.entries(e.endpointUrls))i&&this._endpointUrls.set(t,i)}setBaseUrl(e){this.baseUrl=e}setHasUiBackend(e){this.hasUiBackend=e}setEndpointUrl(e,t){e&&(t?this._endpointUrls.set(e,t):this._endpointUrls.delete(e))}getConfigEndpointUrls(){let e=[],t="config-properties";this.hasUiBackend&&(e.push("res/config-properties.json"),t=null);let i=this.getEndpointUrl("config-properties",t);return i&&e.push(i),e}getEndpointUrl(e,t){let s=this._endpointUrls.get(e)||t;return s?this._concatPath(this.baseUrl,s):null}_concatPath(e,t){return e=_.removeSuffix(e,"/"),t=_.removeSuffix(_.removePrefix(t,"/"),"/"),_.join("/",e,t)}}const bs={_systemsMap:new Map,getOrCreate(n,e){n=n||Wi.MAIN_SYSTEM;let t=bs._systemsMap.get(n);return t?(e&&t.setBaseUrl(e),t):(t=u.create(Wi,{name:n,baseUrl:e}),bs._systemsMap.set(n,t),t)},exists(n){return bs._systemsMap.has(n||Wi.MAIN_SYSTEM)}};class yi extends I{static ZERO_UUID="00000000-0000-0000-0000-000000000000";uuids;size;refillThreshold;failOnStarvation;refillInProgress;constructor(){super(),this.uuids=[],this.size=100,this.refillThreshold=25,this.failOnStarvation=!1,this.refillInProgress=!1}take(){if(!this.uuids.length){if(this.failOnStarvation)throw new Error("UUID pool exhausted");return this.generateUuid()}let e=this.uuids.shift();return this.uuids.length<=this.refillThreshold&&this.refill(),e}refill(){let e=this.size-this.uuids.length;e>0&&this.fill(e)}fill(e){this.trigger("refill",{count:e})}generateUuid(){let e=Date.now()+(performance?performance.now():0);return"zzzzzzzz-zzzz-4zzz-yzzz-zzzzzzzzzzzz".replace(/[zy]/g,t=>{let i=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==="z"?i:i&3|8).toString(16)})}static _createInstance(e){return u.create(yi,{parent:e})}static installDesktopAddOn(){G.addListener("desktopReady",e=>{let t=e.desktop;t.addOns.some(i=>i instanceof yi)||t.addOns.push(yi._createInstance(t))})}static get(e){return e=e||G.get().sessions[0],u.assertParameter("session",e),p.find(e.desktop.addOns,i=>i instanceof yi)||yi._createInstance(e.desktop)}static take(e){return yi.get(e).take()}}yi.installDesktopAddOn();class qm extends K{refillInProgress;constructor(){super(),this.refillInProgress=!1}_onWidgetEvent(e){e.type==="refill"?this._onWidgetRefill(e):super._onWidgetEvent(e)}_onWidgetRefill(e){this.refillInProgress||(this.refillInProgress=!0,this._send("refill",{count:e.count},{showBusyIndicator:!1}))}onModelAction(e){e.type==="refill"?this._onModelRefill(e):super.onModelAction(e)}_onModelRefill(e){p.pushAll(this.widget.uuids,e.uuids),this.refillInProgress=!1}}var N=function(n,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r};let ts=class extends se{definition;id;title;description};N([Reflect.metadata("scout.m.t","IBookmarkDefinitionDo")],ts.prototype,"definition",void 0),N([Reflect.metadata("scout.m.t",String)],ts.prototype,"id",void 0),N([Reflect.metadata("scout.m.t",String)],ts.prototype,"title",void 0),N([Reflect.metadata("scout.m.t",String)],ts.prototype,"description",void 0),ts=N([ue("scout.Bookmark")],ts);let zi=class extends se{bookmarkedPage;outlineId;pagePath};N([Reflect.metadata("scout.m.t","IBookmarkPageDo")],zi.prototype,"bookmarkedPage",void 0),N([Reflect.metadata("scout.m.t",String)],zi.prototype,"outlineId",void 0),N([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["IBookmarkPageDo"]})],zi.prototype,"pagePath",void 0),zi=N([ue("scout.OutlineBookmarkDefinition")],zi);let jr=class extends se{bookmarkedPage};N([Reflect.metadata("scout.m.t","IBookmarkPageDo")],jr.prototype,"bookmarkedPage",void 0),jr=N([ue("scout.PageBookmarkDefinition")],jr);let Os=class extends se{pageParam;displayText};N([Reflect.metadata("scout.m.t","PageParamDo")],Os.prototype,"pageParam",void 0),N([Reflect.metadata("scout.m.t",String)],Os.prototype,"displayText",void 0),Os=N([ue("scout.NodeBookmarkPage")],Os);let xt=class extends se{pageParam;displayText;expandedChildRow;selectedChildRows;searchFilterComplete;searchData;tablePreferences;chartTableControlConfig};N([Reflect.metadata("scout.m.t","PageParamDo")],xt.prototype,"pageParam",void 0),N([Reflect.metadata("scout.m.t",String)],xt.prototype,"displayText",void 0),N([Reflect.metadata("scout.m.t","BookmarkTableRowIdentifierDo")],xt.prototype,"expandedChildRow",void 0),N([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["BookmarkTableRowIdentifierDo"]})],xt.prototype,"selectedChildRows",void 0),N([Reflect.metadata("scout.m.t",Boolean)],xt.prototype,"searchFilterComplete",void 0),N([Reflect.metadata("scout.m.t","ISearchDo")],xt.prototype,"searchData",void 0),N([Reflect.metadata("scout.m.t","TableClientUiPreferencesDo")],xt.prototype,"tablePreferences",void 0),N([Reflect.metadata("scout.m.t","IChartTableControlConfigDo")],xt.prototype,"chartTableControlConfig",void 0),xt=N([ue("scout.TableBookmarkPage")],xt);let qr=class extends se{keyComponents};N([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["IBookmarkTableRowIdentifierComponentDo"]})],qr.prototype,"keyComponents",void 0),qr=N([ue("scout.BookmarkTableRowIdentifier")],qr);let Yr=class extends se{key};N([Reflect.metadata("scout.m.t",Object)],Yr.prototype,"key",void 0),Yr=N([ue("scout.BookmarkTableRowIdentifierObjectComponent")],Yr);let Xr=class extends se{key};N([Reflect.metadata("scout.m.t",Date)],Xr.prototype,"key",void 0),Xr=N([ue("scout.BookmarkTableRowIdentifierDateComponent")],Xr);let Jr=class extends se{key};N([Reflect.metadata("scout.m.t",Boolean)],Jr.prototype,"key",void 0),Jr=N([ue("scout.BookmarkTableRowIdentifierBooleanComponent")],Jr);let jn=class extends se{key};N([Reflect.metadata("scout.m.t",Number)],jn.prototype,"key",void 0),jn=N([ue("scout.BookmarkTableRowIdentifierIntegerComponent")],jn);let Qr=class extends se{key};N([Reflect.metadata("scout.m.t",String)],Qr.prototype,"key",void 0),Qr=N([ue("scout.BookmarkTableRowIdentifierStringComponent")],Qr);let Zr=class extends se{key};N([Reflect.metadata("scout.m.t",Number)],Zr.prototype,"key",void 0),Zr=N([ue("scout.BookmarkTableRowIdentifierLongComponent")],Zr);let is=class extends se{tableId;userPreferenceContext;tileMode;tileGlobalKey;tablePreferenceProfiles};N([Reflect.metadata("scout.m.t",String)],is.prototype,"tableId",void 0),N([Reflect.metadata("scout.m.t",String)],is.prototype,"userPreferenceContext",void 0),N([Reflect.metadata("scout.m.t",Boolean)],is.prototype,"tileMode",void 0),N([Reflect.metadata("scout.m.t",String)],is.prototype,"tileGlobalKey",void 0),N([Reflect.metadata("scout.m.t",{objectType:Map,typeArgs:[String,"TableClientUiPreferenceProfileDo"]})],is.prototype,"tablePreferenceProfiles",void 0),is=N([ue("scout.TableClientUiPreferences")],is);let Hs=class extends se{columns;userFilters;tableCustomizerData};N([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["TableColumnClientUiPreferenceDo"]})],Hs.prototype,"columns",void 0),N([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["IUserFilterStateDo"]})],Hs.prototype,"userFilters",void 0),N([Reflect.metadata("scout.m.t","ITableCustomizerDo")],Hs.prototype,"tableCustomizerData",void 0),Hs=N([ue("scout.TableClientUiPreferenceProfile")],Hs);let Zt=class extends se{columnId;viewIndex;visible;width;sortOrder;sortAscending;groupingActive;aggregationFunctionId;backgroundEffectId};N([Reflect.metadata("scout.m.t",String)],Zt.prototype,"columnId",void 0),N([Reflect.metadata("scout.m.t",Number)],Zt.prototype,"viewIndex",void 0),N([Reflect.metadata("scout.m.t",Boolean)],Zt.prototype,"visible",void 0),N([Reflect.metadata("scout.m.t",Number)],Zt.prototype,"width",void 0),N([Reflect.metadata("scout.m.t",Number)],Zt.prototype,"sortOrder",void 0),N([Reflect.metadata("scout.m.t",Boolean)],Zt.prototype,"sortAscending",void 0),N([Reflect.metadata("scout.m.t",Boolean)],Zt.prototype,"groupingActive",void 0),N([Reflect.metadata("scout.m.t",String)],Zt.prototype,"aggregationFunctionId",void 0),N([Reflect.metadata("scout.m.t",String)],Zt.prototype,"backgroundEffectId",void 0),Zt=N([ue("scout.TableColumnClientUiPreference")],Zt);let en=class extends se{columnId;selectedValues};N([Reflect.metadata("scout.m.t",String)],en.prototype,"columnId",void 0),N([Reflect.metadata("scout.m.t",{objectType:Set,typeArgs:[Boolean]})],en.prototype,"selectedValues",void 0),en=N([ue("scout.BooleanColumnUserFilterState")],en);let Ns=class extends se{columnId;selectedValues};N([Reflect.metadata("scout.m.t",String)],Ns.prototype,"columnId",void 0),N([Reflect.metadata("scout.m.t",{objectType:Set,typeArgs:[String]})],Ns.prototype,"selectedValues",void 0),Ns=N([ue("scout.ColumnUserFilterState")],Ns);let ss=class extends se{columnId;selectedValues;dateFrom;dateTo};N([Reflect.metadata("scout.m.t",String)],ss.prototype,"columnId",void 0),N([Reflect.metadata("scout.m.t",{objectType:Set,typeArgs:[Number]})],ss.prototype,"selectedValues",void 0),N([Reflect.metadata("scout.m.t",Date)],ss.prototype,"dateFrom",void 0),N([Reflect.metadata("scout.m.t",Date)],ss.prototype,"dateTo",void 0),ss=N([ue("scout.DateColumnUserFilterState")],ss);let rs=class extends se{columnId;selectedValues;numberFrom;numberTo};N([Reflect.metadata("scout.m.t",String)],rs.prototype,"columnId",void 0),N([Reflect.metadata("scout.m.t",{objectType:Set,typeArgs:[Number]})],rs.prototype,"selectedValues",void 0),N([Reflect.metadata("scout.m.t",Number)],rs.prototype,"numberFrom",void 0),N([Reflect.metadata("scout.m.t",Number)],rs.prototype,"numberTo",void 0),rs=N([ue("scout.NumberColumnUserFilterState")],rs);let ur=class extends se{text};N([Reflect.metadata("scout.m.t",String)],ur.prototype,"text",void 0),ur=N([ue("scout.TableTextUserFilterState")],ur);let ys=class extends se{columnId;selectedValues;textFilter};N([Reflect.metadata("scout.m.t",String)],ys.prototype,"columnId",void 0),N([Reflect.metadata("scout.m.t",{objectType:Set,typeArgs:[String]})],ys.prototype,"selectedValues",void 0),N([Reflect.metadata("scout.m.t",String)],ys.prototype,"textFilter",void 0),ys=N([ue("scout.TextColumnUserFilterState")],ys);let cr=class extends se{tablePreferences};N([Reflect.metadata("scout.m.t",{objectType:Array,typeArgs:["TableClientUiPreferencesDo"]})],cr.prototype,"tablePreferences",void 0),cr=N([ue("scout.UiPreferences")],cr);let qn=class extends se{preferences};N([Reflect.metadata("scout.m.t","UiPreferencesDo")],qn.prototype,"preferences",void 0),qn=N([ue("scout.UiPreferencesUpdate")],qn),window.scout.DataObjectInventory.get().add(ts,"scout.Bookmark","BookmarkDo"),window.scout.DataObjectInventory.get().add(zi,"scout.OutlineBookmarkDefinition","OutlineBookmarkDefinitionDo"),window.scout.DataObjectInventory.get().add(jr,"scout.PageBookmarkDefinition","PageBookmarkDefinitionDo"),window.scout.DataObjectInventory.get().add(Os,"scout.NodeBookmarkPage","NodeBookmarkPageDo"),window.scout.DataObjectInventory.get().add(xt,"scout.TableBookmarkPage","TableBookmarkPageDo"),window.scout.DataObjectInventory.get().add(qr,"scout.BookmarkTableRowIdentifier","BookmarkTableRowIdentifierDo"),window.scout.DataObjectInventory.get().add(Yr,"scout.BookmarkTableRowIdentifierObjectComponent","BookmarkTableRowIdentifierObjectComponentDo"),window.scout.DataObjectInventory.get().add(Xr,"scout.BookmarkTableRowIdentifierDateComponent","BookmarkTableRowIdentifierDateComponentDo"),window.scout.DataObjectInventory.get().add(Jr,"scout.BookmarkTableRowIdentifierBooleanComponent","BookmarkTableRowIdentifierBooleanComponentDo"),window.scout.DataObjectInventory.get().add(jn,"scout.BookmarkTableRowIdentifierIntegerComponent","BookmarkTableRowIdentifierIntegerComponentDo"),window.scout.DataObjectInventory.get().add(Qr,"scout.BookmarkTableRowIdentifierStringComponent","BookmarkTableRowIdentifierStringComponentDo"),window.scout.DataObjectInventory.get().add(Zr,"scout.BookmarkTableRowIdentifierLongComponent","BookmarkTableRowIdentifierLongComponentDo"),window.scout.DataObjectInventory.get().add(is,"scout.TableClientUiPreferences","TableClientUiPreferencesDo"),window.scout.DataObjectInventory.get().add(Hs,"scout.TableClientUiPreferenceProfile","TableClientUiPreferenceProfileDo"),window.scout.DataObjectInventory.get().add(Zt,"scout.TableColumnClientUiPreference","TableColumnClientUiPreferenceDo"),window.scout.DataObjectInventory.get().add(en,"scout.BooleanColumnUserFilterState","BooleanColumnUserFilterStateDo"),window.scout.DataObjectInventory.get().add(Ns,"scout.ColumnUserFilterState","ColumnUserFilterStateDo"),window.scout.DataObjectInventory.get().add(ss,"scout.DateColumnUserFilterState","DateColumnUserFilterStateDo"),window.scout.DataObjectInventory.get().add(rs,"scout.NumberColumnUserFilterState","NumberColumnUserFilterStateDo"),window.scout.DataObjectInventory.get().add(ur,"scout.TableTextUserFilterState","TableTextUserFilterStateDo"),window.scout.DataObjectInventory.get().add(ys,"scout.TextColumnUserFilterState","TextColumnUserFilterStateDo"),window.scout.DataObjectInventory.get().add(cr,"scout.UiPreferences","UiPreferencesDo"),window.scout.DataObjectInventory.get().add(qn,"scout.UiPreferencesUpdate","UiPreferencesUpdateDo");var wi;(function(n){n.FRONT="front",n.BACK="back"})(wi||(wi={}));const T={role(n,e){n&&(n.attr("role",e),e==="alert"&&!w.get().isIos()&&T.live(n,"assertive"),(e==="log"||e==="status")&&T.live(n,"polite"))},_linkElementWithTargetElement(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:wi.FRONT,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(!n||!e||_.empty(t))return;let r=e.attr("id");if(r||(r=Z.get().createUiSeqId(),e.attr("id",r)),!s){let o=n.attr(t)||"";if(o&&!_.contains(o,r))if(b.isNullOrUndefined(i)||i===wi.FRONT)r+=" "+o;else if(i===wi.BACK)r=o+" "+r;else return}n.attr(t,r)},linkElementWithLabel(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wi.FRONT,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;T._linkElementWithTargetElement(n,e,"aria-labelledby",t,i)},linkElementWithDescription(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wi.FRONT,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;T._linkElementWithTargetElement(n,e,"aria-describedby",t,i)},addHiddenDescriptionAndLinkToElement(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:wi.FRONT,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(!n||_.empty(t))return;let r=n.beforeDiv().addClass("text").attr("id","desc"+e).text(t);return T.hidden(r,!0),T.screenReaderOnly(r),T.linkElementWithDescription(n,r,i,s),r},linkElementWithHeader(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2;if(!n||!e)return;let i=T._computeHeaderLevel(n);i?i=i+1:t&&(i=t),i&&(T.role(e,"heading"),T.level(e,i),T._addHeaderLevelToElement(n,i))},_addHeaderLevelToElement(n,e){n&&n.attr("data-aria-header-level",e)},_computeHeaderLevel(n){if(!n)return null;let e=n.parents("[data-aria-header-level]");return e.length>0?parseInt(e.eq(0).attr("data-aria-header-level")):null},linkElementWithControls(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wi.FRONT,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;T._linkElementWithTargetElement(n,e,"aria-controls",t,i)},removeControls(n){n&&n.removeAttr("aria-controls")},linkElementWithActiveDescendant(n,e){T._linkElementWithTargetElement(n,e,"aria-activedescendant",wi.FRONT,!0)},removeActiveDescendant(n){n&&n.removeAttr("aria-activedescendant")},screenReaderOnly(n){n&&n.addClass("sr-only")},required(n,e){n&&n.attr("aria-required",_.asString(e))},label(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;n&&(_.hasText(e)?n.attr("aria-label",e):t?n.attr("aria-label",""):n.removeAttr("aria-label"))},description(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;n&&(_.hasText(e)?n.attr("aria-description",e):t?n.attr("aria-description",""):n.removeAttr("aria-description"))},checked(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;n&&(t&&e!==!0&&e!==!1?n.attr("aria-checked","mixed"):n.attr("aria-checked",_.asString(e)))},hasPopup(n,e){n&&n.attr("aria-haspopup",e)},expanded(n,e){n&&n.attr("aria-expanded",_.asString(e))},selected(n,e){n&&n.attr("aria-selected",_.asString(e))},pressed(n,e){n&&n.attr("aria-pressed",_.asString(e))},live(n,e){n&&n.attr("aria-live",e)},level(n,e){n&&n.attr("aria-level",e)},hidden(n,e){n&&n.attr("aria-hidden",_.asString(e))},multiselectable(n,e){n&&n.attr("aria-multiselectable",_.asString(e))},posinset(n,e){n&&n.attr("aria-posinset",e)},setsize(n,e){n&&n.attr("aria-setsize",e)},disabled(n,e){n&&n.attr("aria-disabled",_.asString(e))},modal(n,e){n&&n.attr("aria-modal",_.asString(e))}};function k_(n){if(!n||t(n.style))return!1;let e=(n instanceof Document?n:n.ownerDocument).defaultView;if(!e||t(e.getComputedStyle(n)))return!1;return!0;function t(i){return i.display==="none"}}function I_(n){let e=[];return n.forEach(t=>{t==="margin"||t==="padding"?(e.push(t+"-top"),e.push(t+"-right"),e.push(t+"-bottom"),e.push(t+"-left")):t==="border"?(e.push("border-top-style"),e.push("border-right-style"),e.push("border-bottom-style"),e.push("border-left-style"),e.push("border-top-color"),e.push("border-right-color"),e.push("border-bottom-color"),e.push("border-left-color"),e.push("border-top-width"),e.push("border-right-width"),e.push("border-bottom-width"),e.push("border-left-width")):e.push(t)}),e}function Ba(n){return b.isNumber(n)?Math.ceil(n):n}const L_=h().cleanData;h().cleanData=n=>{let e,t,i;for(i=0;t=n[i];i++)try{e=h()._data(t,"events"),e&&e.remove&&h()(t).triggerHandler("remove")}catch{}L_(n)},h().ensure=n=>n instanceof h()?n:h()(n),h().suppressEvent=n=>{n&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation())},h().debounce=(n,e)=>{typeof e=="number"&&(e={delay:e}),e=h().extend({delay:250,reschedule:!0},e);let t=null,i=function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];let l=this;t&&!e.reschedule||(t&&clearTimeout(t),t=setTimeout(()=>{t=null,n.apply(l,r)},e.delay))};return i.cancel=()=>t?(clearTimeout(t),t=null,!0):!1,i},h().throttle=(n,e)=>{e=e!==void 0?e:250;let t=null,i;return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];let l=this,a=new Date().getTime(),d=()=>{i=a,n.apply(l,r)};i&&i+e>a?(clearTimeout(t),t=setTimeout(()=>{d()},e)):d()}},h().negate=n=>function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!n.apply(this,t)},h().injectScript=(n,e)=>{e=e||{};let t=h().Deferred(),i=e.document||window.document,s=i.createElement("script");return h()(s).attr("src",n).attr("async",!0).on("load error",r=>{e.removeTag&&i.head.removeChild(s),r.type==="error"?t.reject(h()(s)):t.resolve(h()(s))}),i.head.appendChild(s),t.promise()},h().injectStyleSheet=(n,e)=>{e=e||{};let t=h().Deferred(),i=e.document||window.document,s=i.createElement("link");return h()(s).attr("rel","stylesheet").attr("type","text/css").attr("href",n).on("load error",r=>{r.type==="error"?t.reject(h()(s)):t.resolve(h()(s))}),i.head.appendChild(s),t.promise()},h().injectStyle=(n,e)=>{e=e||{};let t=e.document||window.document,i=t.createElement("style"),s=h()(i);return s.attr("type","text/css").html(n),t.head.appendChild(i),s},h().pxToNumber=n=>n?parseFloat(n):0,h().resolvedDeferred=function(){let n=h().Deferred();return n.resolve(...arguments),n},h().resolvedPromise=function(){let n=h().Deferred();return n.resolve(...arguments),n.promise()},h().rejectedPromise=function(){let n=h().Deferred();return n.reject(...arguments),n.promise()},h().promiseAll=(n,e)=>{e=u.nvl(e,!1),n=p.ensure(n);let t=h().Deferred();return h().when(...n).done(function(){for(var i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];e?t.resolve(s):t.resolve(...s)}).fail(function(){t.reject(...arguments)}),t.promise()},h().ajaxJson=n=>h().ajax({url:n,dataType:"json",contentType:"application/json; charset=UTF-8"}).catch(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.push(this),h().rejectedPromise(...t)}),h().isJqXHR=n=>typeof n=="object"&&n.hasOwnProperty("readyState")&&n.hasOwnProperty("status")&&n.hasOwnProperty("statusText"),h().fn.nvl=function(n){return this.length||!(n instanceof h())?this:n},h().fn.makeElement=function(n,e,t){let i=this.document(!0);if(i===void 0||n===void 0)throw new Error("missing arguments: document, element");let s=h()(n,i);return e&&s.addClass(e),t&&s.text(t),s},h().fn.makeDiv=function(n,e){return this.makeElement("<div>",n,e)},h().fn.makeSpan=function(n,e){return this.makeElement("<span>",n,e)},h().fn.document=function(n){let e=this.length?this[0]instanceof Document?this[0]:this[0].ownerDocument:null;return n?e:h()(e)},h().fn.window=function(n){let e=this.document(!0),t=e?e.defaultView:null;return n?t:h()(t)},h().fn.activeElement=function(n){let e=this.document(!0),t=e?e.activeElement:null;return n?t:h()(t)},h().fn.body=function(n){let e=h()("body",this.document(!0));return n?e[0]:e},h().fn.entryPoint=function(n){let e=this.closest(".scout");return n?e[0]:e},h().fn.windowSize=function(){let n=this.window();return new F(n.width(),n.height())},h().fn.elementFromPoint=function(n,e,t){let i=h()(this),s=i.document(!0),r=[],o=0,l;if(s||(s=i[0]),!s)return h()();for(;l=h()(s.elementFromPoint(n,e)),!(l.length===0||l[0]===s.documentElement||i.isOrHas(l)&&(!t||l.is(t)));)if(r.push(l),l.addClass("invisible"),o++,o>1e3){h().log.warn("Infinite loop aborted",l),l=h()();break}return l[0]===s.documentElement&&i[0]!==s&&(l=h()()),r.forEach(a=>{a.removeClass("invisible")}),l},h().fn.prependDiv=function(n,e){return this.makeDiv(n,e).prependTo(this)},h().fn.appendDiv=function(n,e){return this.makeDiv(n,e).appendTo(this)},h().fn.prependElement=function(n,e,t){return this.makeElement(n,e,t).prependTo(this)},h().fn.appendElement=function(n,e,t){return this.makeElement(n,e,t).appendTo(this)},h().fn.afterDiv=function(n,e){return this.makeDiv(n,e).insertAfter(this)},h().fn.beforeDiv=function(n,e){return this.makeDiv(n,e).insertBefore(this)},h().fn.appendSpan=function(n,e){return this.makeSpan(n,e).appendTo(this)},h().fn.appendBr=function(n){return this.makeElement("<br>",n).appendTo(this)},h().fn.appendTable=function(n){return this.appendElement("<table>",n)},h().fn.appendColgroup=function(n){return this.appendElement("<colgroup>",n)},h().fn.appendCol=function(n){return this.appendElement("<col>",n)},h().fn.appendTr=function(n){return this.appendElement("<tr>",n)},h().fn.appendTd=function(n,e){return this.appendElement("<td>",n,e)},h().fn.appendTh=function(n,e){return this.appendElement("<th>",n,e)},h().fn.appendUl=function(n){return this.appendElement("<ul>",n)},h().fn.appendLi=function(n,e){return this.appendElement("<li>",n,e)},h().fn.appendTextNode=function(n){return h()(this.document(!0).createTextNode(n)).appendTo(this)},h().fn.appendIcon=function(n,e){if(!n){let i=this.appendSpan(e).addClass("icon");return T.hidden(i,!0),i}let t;if(n instanceof Di?t=n:t=q.parseIconId(n),t.isFontIcon()){let i=this.makeSpan(e,t.iconCharacter).addClass("icon").addClass(t.appendCssClass("font-icon")).appendTo(this);return _.hasText(t.altText)?(T.role(i,"img"),T.label(i,t.altText,!0)):T.hidden(i,!0),i}return this.appendImg(t.iconUrl,e).attr("alt",t.altText).addClass("icon image-icon")},h().fn.appendImg=function(n,e){let t=this.appendElement("<img>",e);return n&&t.attr("src",n),t},h().fn.icon=function(n,e){let t,i=this.data("$icon");if(n)if(t=q.parseIconId(n),t.isFontIcon()){let o=s.call(this,i,"<span>",e).addClass("icon").addClass(t.appendCssClass("font-icon")).text(t.iconCharacter);T.hidden(o,!0)}else s.call(this,i,"<img>",e).attr("src",t.iconUrl).attr("alt","").addClass("icon image-icon");else r.call(this,i);return this;function s(o,l,a){return o&&!o.is(l.replace(/[<>]/g,""))&&(r.call(this,o),o=null),o||(o=h()(l),this.data("$icon",o),a?a.call(this,o):this.prepend(o)),o}function r(o){o&&o.remove(),this.removeData("$icon")}},h().fn.makeSVG=function(n,e,t,i){let s=this.document(!0);if(s===void 0||n===void 0)return new Error("missing arguments: document, type");let r=h()(s.createElementNS("http://www.w3.org/2000/svg",n));return e&&r.attr("class",e),t&&r.text(t),i!==void 0&&r.attr("id",i),r},h().fn.appendSVG=function(n,e,t,i){return this.makeSVG(n,e,t,i).appendTo(this)},h().fn.attrXLINK=function(n,e){return this.length===0?this:this.length===1?(this[0].setAttributeNS("http://www.w3.org/1999/xlink","xlink:"+n,e),this):this.each(function(){this.setAttributeNS("http://www.w3.org/1999/xlink","xlink:"+n,e)})},h().fn.appendAppLink=function(n,e){return this.appendSpan().appLink(n,e)},h().fn.appLink=function(n,e){return e?typeof e=="object"&&e._onAppLinkAction&&(e=e._onAppLinkAction.bind(e)):e=(function(t){let i=u.widget(this);i&&i._onAppLinkAction&&i._onAppLinkAction(t)}).bind(this),this.addClass("app-link").attr("tabindex","0").unfocusable().on("click",e),typeof n=="string"?this.attr("data-ref",n):this.text(n.name).attr("data-ref",n.ref),this},h().fn.addDeviceClass=function(){return w.get().isIos()&&this.addClass("ios"),this},h().fn.selectOne=function(){return this.siblings().removeClass("selected"),this.addClass("selected"),this},h().fn.select=function(n){return this.toggleClass("selected",!!n)},h().fn.isSelected=function(){return this.hasClass("selected")},h().fn.setEnabled=function(n){return n=!!n,this.toggleClass("disabled",!n),this.is("button, input, select, textarea, optgroup, option, fieldset")&&this.toggleAttr("disabled",!n),this.trigger(n?"enable":"disable"),this},h().fn.isEnabled=function(){return!this.hasClass("disabled")},h().fn.setVisible=function(n){return!this.hasClass("hidden")===n?this:(n?(this.removeClass("hidden"),this.trigger("show")):(this.addClass("hidden"),this.trigger("hide")),this)},h().fn.isVisible=function(){return this.hasClass("hidden")?!1:k_(this[0])},h().fn.isEveryParentVisible=function(){let n=!0;return this.parents().each(function(){if(!h()(this).isVisible())return n=!1,!1}),n},h().fn.isDisplayNone=function(){return this.css("display")==="none"},h().fn.isVisibilityHidden=function(){return this.css("visibility")==="hidden"},h().fn.setTabbable=function(n){return this.attr("tabindex",n?0:null)},h().fn.setTabbableOrFocusable=function(n){return this.attr("tabindex",n?0:-1)},h().fn.isTabbable=function(){return this.attr("tabindex")>=0},h().fn.placeholder=function(n){return this.toggleAttr("placeholder",!!n,n)},h().fn.isAttached=function(){return h().contains(this.document(!0).documentElement,this[0])},h().fn.scrollParent=function(n){let e=this;for(;e.length>0;){if(e.data("scrollable")||n&&e.data("pseudo-scrollable"))return e;e=e.parent()}return h()()},h().fn.scrollParents=function(n){let e=h()(),t=this;for(;t.length>0;)(t.data("scrollable")||n&&t.data("pseudo-scrollable"))&&e.push(t[0]),t=t.parent();return e},h().fn.findUp=function(n,e){let t=h()(this);for(;t.length>0;){if(n(t))return t;if(e&&t[0]===e[0])return h()();t=t.parent()}return h()()},h().fn.isOrHas=function(n){return n instanceof h()&&(n=n[0]),this[0]===n||this.has(n).length>0},h().fn.animateAVCSD=function(n,e,t,i,s){let r={},o={};return r[n]=e,t&&(o.complete=t),i&&(o.step=i),s&&(o.duration=s),o.queue=!1,this.animate(r,o),this},h().fn.animateSVG=function(n,e,t,i,s){return this.each(function(){let r=parseFloat(h()(this).attr(n));if(s){let o=i;i=function(){o&&o.call(this),h()(this).removeAttr("tabindex")}}h()(this).animate({tabIndex:0},{step:function(o,l){this.setAttribute(n,r+(e-r)*l.pos)},duration:t,complete:i,queue:!1})})},h().fn.addClassForAnimation=function(n,e){let t={classesToRemove:n};return e=h().extend({},t,e),this.addClass(n),this.oneAnimationEnd(i=>{this.removeClass(e.classesToRemove)}),this},h().fn.oneAnimationEnd=function(n){if(!n)return this;let e=t=>{t.target===this[0]&&(this.off("animationend webkitAnimationEnd",e),n(t))};return this.on("animationend webkitAnimationEnd",e)},h().fn.hasAnimationClass=function(){return/(^|\s)animate-/.test(this.attr("class"))},h().fn.cssWidthAnimated=function(n,e,t){return t=t||{},t.duration=u.nvl(t.duration,300),this.cssWidth(n),this.animate({width:e},t),this},h().fn.cssHeightAnimated=function(n,e,t){return t=t||{},t.duration=u.nvl(t.duration,300),this.cssHeight(n),this.animate({height:e},t),this},h().fn.cssLeftAnimated=function(n,e,t){return t=t||{},t.duration=u.nvl(t.duration,300),this.cssLeft(n),this.animate({left:e},t),this},h().fn.cssTopAnimated=function(n,e,t){return t=t||{},t.duration=u.nvl(t.duration,300),this.cssTop(n),this.animate({top:e},t),this},h().fn.cssAnimated=function(n,e,t){return t=t||{},t.duration=u.nvl(t.duration,300),this.css(n),this.animate(e,t),this},h().fn.cssWidthToContentAnimated=function(n){let e=this.outerWidth(),t=this.css("width","auto").outerWidth();return this.cssWidthAnimated(e,t,n),this},h().fn.offsetTo=function(n){let e=n.offset(),t=this.offset();return{top:t.top-e.top,left:t.left-e.left}},h().fn.cssPxValue=function(n,e){return e===void 0?h().pxToNumber(this.css(n)):(e===null&&(e=""),typeof e=="string"?this.css(n,e):this.css(n,e+"px"))},h().fn.cssLeft=function(n){return this.cssPxValue("left",n)},h().fn.cssTop=function(n){return this.cssPxValue("top",n)},h().fn.cssPosition=function(n){return this.cssLeft(n.x).cssTop(n.y)},h().fn.cssBottom=function(n){return this.cssPxValue("bottom",n)},h().fn.cssRight=function(n){return this.cssPxValue("right",n)},h().fn.cssWidth=function(n){return this.cssPxValue("width",n)},h().fn.cssMinWidth=function(n){if(n===void 0){let e=this.css("min-width");return e==="auto"||e.indexOf("%")!==-1?0:h().pxToNumber(e)}return this.cssPxValue("min-width",n)},h().fn.cssMaxWidth=function(n){if(n===void 0){let e=this.css("max-width");return e==="none"||e.indexOf("%")!==-1?Number.MAX_VALUE:h().pxToNumber(e)}return this.cssPxValue("max-width",n)},h().fn.cssHeight=function(n){return this.cssPxValue("height",n)},h().fn.cssMinHeight=function(n){if(n===void 0){let e=this.css("min-height");return e==="auto"||e.indexOf("%")!==-1?0:h().pxToNumber(e)}return this.cssPxValue("min-height",n)},h().fn.cssMaxHeight=function(n){if(n===void 0){let e=this.css("max-height");return e==="none"||e.indexOf("%")!==-1?Number.MAX_VALUE:h().pxToNumber(e)}return this.cssPxValue("max-height",n)},h().fn.cssLineHeight=function(n){return this.cssPxValue("line-height",n)},h().fn.cssMarginLeft=function(n){return this.cssPxValue("margin-left",n)},h().fn.cssMarginBottom=function(n){return this.cssPxValue("margin-bottom",n)},h().fn.cssMarginRight=function(n){return this.cssPxValue("margin-right",n)},h().fn.cssMarginTop=function(n){return this.cssPxValue("margin-top",n)},h().fn.cssMarginX=function(n){return n===void 0?this.cssMarginLeft()+this.cssMarginRight():(this.cssMarginLeft(n),this.cssMarginRight(n),this)},h().fn.cssMarginY=function(n){return n===void 0?this.cssMarginTop()+this.cssMarginBottom():(this.cssMarginTop(n),this.cssMarginBottom(n),this)},h().fn.cssPaddingTop=function(n){return this.cssPxValue("padding-top",n)},h().fn.cssPaddingRight=function(n){return this.cssPxValue("padding-right",n)},h().fn.cssPaddingBottom=function(n){return this.cssPxValue("padding-bottom",n)},h().fn.cssPaddingLeft=function(n){return this.cssPxValue("padding-left",n)},h().fn.cssPaddingX=function(n){return n===void 0?this.cssPaddingLeft()+this.cssPaddingRight():(this.cssPaddingLeft(n),this.cssPaddingRight(n),this)},h().fn.cssPaddingY=function(n){return n===void 0?this.cssPaddingTop()+this.cssPaddingBottom():(this.cssPaddingTop(n),this.cssPaddingBottom(n),this)},h().fn.cssBorderBottomWidth=function(n){return this.cssPxValue("border-bottom-width",n)},h().fn.cssBorderLeftWidth=function(n){return this.cssPxValue("border-left-width",n)},h().fn.cssBorderRightWidth=function(n){return this.cssPxValue("border-right-width",n)},h().fn.cssBorderTopWidth=function(n){return this.cssPxValue("border-top-width",n)},h().fn.cssBorderWidthY=function(n){return n===void 0?this.cssBorderTopWidth()+this.cssBorderBottomWidth():(this.cssBorderTopWidth(n),this.cssBorderBottomWidth(n))},h().fn.cssBorderWidthX=function(n){return n===void 0?this.cssBorderLeftWidth()+this.cssBorderRightWidth():(this.cssBorderLeftWidth(n),this.cssBorderRightWidth(n))},h().fn.innerBottom=function(){return this.position().top+this.outerHeight(!0)-this.cssMarginBottom()-this.cssBorderBottomWidth()},h().fn.innerRight=function(){return this.position().left+this.outerWidth(!0)-this.cssMarginRight()-this.cssBorderRightWidth()},h().fn.copyCss=function(n,e){let t=e.split(" "),i=this;return t=I_(t),t.forEach(s=>{i.css(s,n.css(s))}),i},h().fn.copyCssClasses=function(n,e){let t=e.split(" "),i=this;return t.forEach(s=>{n.hasClass(s)&&i.addClass(s)}),i},h().fn.disableSpellcheck=function(){return this.attr("spellcheck",!1)},h().fn.resizable=function(n){let e=h()(this),t=e.data("resizable");return t?this:(t=u.create(Me,h().extend(n,{$container:e})),e.data("resizable",t),this)},h().fn.unresizable=function(){let n=h()(this),e=n.data("resizable");return e&&(e.destroy(),n.removeData("resizable")),this},h().fn.draggable=function(n,e){let t=this;return n=n||t,n.on("mousedown.draggable",i=>{h()("iframe").addClass("dragging-in-progress");let s=t.offset(),r=i,o=n.width(),l=n.window().width(),a=n.window().height();n.parents().on("mousemove.dragging",d=>{let c=s.top+(d.pageY-r.pageY),f=s.left+(d.pageX-r.pageX);f=Math.max(100-o,f),f=Math.min(l-100,f),c=Math.max(0,c),c=Math.min(a-100,c);let g={top:c,left:f};t.offset(g),e&&e(g)}).on("mouseup.dragging",d=>{n.parents().off(".dragging"),h()("iframe").removeClass("dragging-in-progress")}),i.preventDefault()})},h().fn.undraggable=function(n){return n=n||this,n.off("mousedown.draggable")},h().fn.fadeOutAndRemove=function(n,e){return e===void 0&&typeof n=="function"&&(e=n,n=void 0),n=u.nvl(n,150),this.stop(!0).fadeOut(n,function(){h()(this).remove(),e&&e.call(this)})},h().fn.removeAnimated=function(n,e){e===void 0&&typeof n=="function"&&(e=n,n=void 0),this.isDisplayNone()?(this.remove(),e&&e.call(this)):w.get().supportsCssAnimation()?(this.addClass(n||"animate-remove"),this.oneAnimationEnd(function(){h()(this).remove(),e&&e.call(this)})):this.fadeOutAndRemove(e)};const B_=h().fn.hide;h().fn.hide=function(){this.trigger("hide");for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return B_.apply(this,e)};const O_=h().fn.width;h().fn.width=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return Ba(O_.apply(this,e))};const H_=h().fn.outerWidth;h().fn.outerWidth=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return Ba(H_.apply(this,e))};const N_=h().fn.height;h().fn.height=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return Ba(N_.apply(this,e))};let V_=h().fn.outerHeight;h().fn.outerHeight=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return Ba(V_.apply(this,e))},h().fn.textOrNbsp=function(n,e){return this.contentOrNbsp(!1,n,e)},h().fn.htmlOrNbsp=function(n,e){return this.contentOrNbsp(!0,n,e)},h().fn.contentOrNbsp=function(n,e,t){let i=n?this.html:this.text;return _.hasText(e)?(i.call(this,e),t&&this.removeClass(t)):(this.html(" "),t&&this.addClass(t)),this},h().fn.toggleAttr=function(n,e,t){return n?(t===void 0&&(t=n),this.each(function(){let i=h()(this);e===void 0&&(e=i.attr(n)===void 0),e?i.attr(n,t):i.removeAttr(n)})):this},h().fn.attrOrRemove=function(n,e){return e?this.attr(n,e):this.removeAttr(n),this},h().fn.unfocusable=function(){return this.addClass("unfocusable")},h().fn.selectAllText=function(){let n,e=this.document(!0),t=this.window(!0),i=this[0];return!e||!e.body||!t||!i?this:(t.getSelection&&(n=e.createRange(),n.selectNodeContents(i),t.getSelection().removeAllRanges(),t.getSelection().addRange(n)),this)},h().fn._getClientAndScrollWidthRounded=function(){let n=this[0];return w.get().isEdge()?{clientWidth:Math.ceil(n.getBoundingClientRect().width)-this.cssBorderWidthX(),scrollWidth:n.scrollWidth}:{clientWidth:n.clientWidth,scrollWidth:n.scrollWidth}},h().fn._getClientAndScrollWidthReliable=function(){let n=this._getClientAndScrollWidthRounded();if(!w.get().isScrollWidthIncludingPadding()||n.scrollWidth>n.clientWidth)return n;let e=this.cssPaddingRight(),t=this.attr("style");if(e>0&&(this.css({width:n.clientWidth-e,paddingRight:"0px"}),n=this._getClientAndScrollWidthRounded(),this.attrOrRemove("style",t),n.scrollWidth>n.clientWidth))return n;let i=this[0].getBoundingClientRect().width;this.css("width","auto"),this.css("max-width","none");let s=this[0].getBoundingClientRect().width;return this.attrOrRemove("style",t),{clientWidth:i,scrollWidth:s}},h().fn.isContentTruncated=function(){let n=this._getClientAndScrollWidthReliable();return n.scrollWidth>n.clientWidth},h().fn.onPassive=function(n,e){let t=Ve.passiveOptions();return this[0].addEventListener(n,e,t),this},h().fn.offPassive=function(n,e){let t=Ve.passiveOptions();return this[0].removeEventListener(n,e,t),this},h().fn.focus=function(){return this.length===0?this:(this[0].focus(),this)},h().extend(h().easing,{easeInQuart:n=>Math.pow(n,4),easeOutQuart:n=>1-Math.pow(1-n,4)}),h().ajaxTransport("+binary",(n,e,t)=>{if(window.FormData&&(n.dataType&&n.dataType==="binary"||n.data&&(window.ArrayBuffer&&n.data instanceof ArrayBuffer||window.Blob&&n.data instanceof Blob)))return{send:(i,s)=>{let r=new XMLHttpRequest,o=n.url,l=n.type,a=n.async||!0,d=n.responseType||"blob",c=n.data||null,f=n.username||null,g=n.password||null;r.addEventListener("load",()=>{let y={};y[n.dataType]=r.response,s(r.status,r.statusText,y,r.getAllResponseHeaders())}),r.open(l,o,a,f,g);for(let y in i)r.setRequestHeader(y,i[y]);if(n.xhrFields)for(let y in n.xhrFields)r[y]=n.xhrFields[y];r.responseType=d,r.send(c)},abort:()=>{}}}),window.$!==h()&&(window.$=h());function cf(n,e,t){let i=Number(h().attr(n,"tabindex")),s=!isNaN(i);if(i<0&&e||i===-2&&t)return!1;let r=n.nodeName.toLowerCase();return(/^(input|select|textarea|button|object)$/.test(r)?!n.disabled:s||r==="a"&&n.href)&&W_(n)}function W_(n){return h().expr.filters.visible(n)&&!h()(n).parents().addBack().filter(function(){return h().css(this,"visibility")==="hidden"}).length}h().extend(h().expr[":"],{"focusable-native":n=>cf(n,!1),focusable:n=>cf(n,!1,!0),tabbable:n=>cf(n,!0)});const Ym=et;let z_={...et,...u};Le.get().registerNamespace("scout",z_)})()})();
//# sourceMappingURL=eclipse-scout-core-5b7533af63dd362b3e71.min.js.map