@uipath/du-validation-station-wc 1.0.0-beta.1 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +27 -0
- package/{chunk-BVNZFRSJ.js → chunk-4DL5ZETN.js} +1 -1
- package/{chunk-35GSIIPT.js → chunk-4RC3DPEI.js} +1 -1
- package/{chunk-ZCYTIBW4.js → chunk-6AEFIYR5.js} +1 -1
- package/{chunk-72UVTU3K.js → chunk-7XMORYEY.js} +1 -1
- package/{chunk-FLLVJZW7.js → chunk-GUD4Q5ED.js} +1 -1
- package/{chunk-VHTAX7UN.js → chunk-MEJRHTNP.js} +1 -1
- package/{chunk-YWO5KYCW.js → chunk-OCUVVNK2.js} +1 -1
- package/{chunk-6G7NPUR4.js → chunk-YCOIYOXV.js} +1 -1
- package/index.html +1 -1
- package/main.js +18 -18
- package/package.json +2 -2
- /package/{chunk-TYL6NO3L.js → chunk-5LGMGLPM.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,44 @@ are documented in this file. The format follows
|
|
|
5
5
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the package
|
|
6
6
|
follows [Semantic Versioning](https://semver.org/).
|
|
7
7
|
|
|
8
|
+
## [1.0.0-beta.2] - 2026-05-19
|
|
9
|
+
|
|
10
|
+
Second public beta. No breaking changes since `1.0.0-beta.1` — element
|
|
11
|
+
tags, JS properties, events, and command methods are unchanged.
|
|
12
|
+
|
|
13
|
+
> ⚠️ Still a **beta** release. Public APIs are not yet stable and data
|
|
14
|
+
> contracts may change before `1.0.0`.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Translations refreshed from the localization pipeline across all
|
|
19
|
+
supported locales.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Runtime asset location is now self-resolved.** The WC locates its
|
|
24
|
+
`du-assets/` directory (PDF.js worker, cmaps, wasm, i18n) at runtime
|
|
25
|
+
via `import.meta.url`, relative to wherever the main bundle is
|
|
26
|
+
served — no more reliance on a build-time CDN path baked into the
|
|
27
|
+
bundle. Consumers must deploy `du-assets/` at the same path level as
|
|
28
|
+
the WC bundle they serve; see the **Static assets** section of the
|
|
29
|
+
README for the full deployment guidance. Without co-location, PDF
|
|
30
|
+
rendering and translations will silently 404.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- `<ui-du-validation-station-standalone-wc-persistent-element>` no
|
|
35
|
+
longer emits command-result events multiple times for a single
|
|
36
|
+
invocation.
|
|
37
|
+
- Resolved drift between `DataVersion` and `DocumentTypeDataVersion`
|
|
38
|
+
that could cause stale taxonomy / extraction-result combinations to
|
|
39
|
+
render incorrectly after a document-type change.
|
|
40
|
+
|
|
41
|
+
### Security
|
|
42
|
+
|
|
43
|
+
- Updated transitive dependencies to address 6 critical CVEs
|
|
44
|
+
(`axios`, `koa`, `lodash`, `picomatch`).
|
|
45
|
+
|
|
8
46
|
## [1.0.0-beta.1] - 2026-05-08
|
|
9
47
|
|
|
10
48
|
Initial public beta release of the Validation Station web component.
|
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ Learn more in the [UiPath Document Understanding docs](https://docs.uipath.com/a
|
|
|
33
33
|
- [React 19](#react-19)
|
|
34
34
|
- [Persistent variant](#persistent-variant)
|
|
35
35
|
- [Lazy loading](#lazy-loading)
|
|
36
|
+
- [Static assets](#static-assets)
|
|
36
37
|
- [Versioning](#versioning)
|
|
37
38
|
- [Support](#support)
|
|
38
39
|
|
|
@@ -257,6 +258,32 @@ async function showValidationStation() {
|
|
|
257
258
|
|
|
258
259
|
</div>
|
|
259
260
|
|
|
261
|
+
## Static assets
|
|
262
|
+
|
|
263
|
+
The WC loads runtime assets (PDF.js worker, cmaps, wasm, i18n) from a
|
|
264
|
+
sibling `du-assets/` directory at runtime, resolved relative to where
|
|
265
|
+
the WC's main bundle is served via `import.meta.url`.
|
|
266
|
+
|
|
267
|
+
**`du-assets/` must be deployed at the same path level as your output
|
|
268
|
+
bundle**, otherwise PDF rendering and translations will silently 404
|
|
269
|
+
in the browser (no build error).
|
|
270
|
+
|
|
271
|
+
- **If your bundler inlines the WC into your app bundle** (typical
|
|
272
|
+
npm consumers): copy
|
|
273
|
+
`node_modules/@uipath/du-validation-station-wc/du-assets/` to your
|
|
274
|
+
dist root as a post-build step. Most bundlers have an asset-copy
|
|
275
|
+
plugin (Vite `publicDir`, webpack `CopyPlugin`,
|
|
276
|
+
`rollup-plugin-copy`, Angular `assets` array).
|
|
277
|
+
- **If you load `main.js` as a separate browser bundle** (e.g.
|
|
278
|
+
`<script type="module" src="…/main.js">`): make sure your CDN or
|
|
279
|
+
static host serves the package's `du-assets/` folder alongside.
|
|
280
|
+
|
|
281
|
+
<div align="right">
|
|
282
|
+
|
|
283
|
+
[↑ Back to top](#uipath-document-understanding--validation-station-web-component)
|
|
284
|
+
|
|
285
|
+
</div>
|
|
286
|
+
|
|
260
287
|
## Versioning
|
|
261
288
|
|
|
262
289
|
This package follows semantic versioning. See `CHANGELOG.md` for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as bt,g as Ln,h as kn,i as An,j as Oo,l as Un,m as Bn,n as Hn,p as Wn,q as jn,r as qn,s as Gn,t as Kn,u as $n,v as Ro}from"./chunk-VHTAX7UN.js";import{h as Mn,j as Eo,k as Fn,l as Do,m as qt,n as Nn,o as Po}from"./chunk-ZCYTIBW4.js";import{$ as l,$a as r,$e as ji,$h as bn,$j as gt,A as wt,Ab as h,Ad as Ii,Ae as lt,Af as mt,B as Te,Bb as U,Be as te,Bf as Bt,Ca as Rt,Cb as fe,Cd as Vi,Ce as be,Dd as zi,Dj as Rn,E as Q,Ea as si,Eb as V,Ed as Fi,Ej as To,Fa as k,Fb as w,Fd as et,Ga as Be,Gb as f,Gd as Ni,H as Dt,Ha as re,Hb as Ge,Hd as tt,Ia as ci,Ib as zt,Id as it,Ie as Hi,Ja as Re,Jb as vi,Je as go,K as we,Ka as di,Kb as ze,Kc as Si,L as oi,La as H,Lb as Fe,Mb as Ne,Mf as se,N as De,Nb as Ke,Nd as nt,Nh as dn,Od as ot,Oh as Mo,P as N,Pc as Mi,Pd as at,Pe as Wi,Ph as Ht,Qa as He,Qc as Ei,Qe as xo,Qh as Wt,Qi as jt,Ra as R,Re as st,Rh as mn,Ri as En,Sb as x,Se as ct,Sh as un,Ta as E,Tb as M,Te as dt,Th as pn,U as Pt,Ub as Ft,Uh as _n,Ui as Tn,Va as T,Vb as Le,Vc as kt,Vf as Ji,Vh as Cn,Wb as $e,Wh as hn,Wi as j,X as A,Xa as mi,Xh as fn,Y as Ue,Ya as Ie,Yb as Nt,Yh as vn,Z as Ot,Za as Ve,Zb as C,Zc as ge,Zh as gn,_a as u,_b as B,_c as ho,_h as xn,_i as ht,a as ni,aa as ai,ab as d,af as bo,ai as yn,b as Tt,ba as p,bb as I,bc as Ze,bk as xt,c as G,ca as _,cc as b,ci as Sn,dc as ve,dj as ft,ea as Pe,eb as ui,ee as Li,eg as en,eh as ln,ej as wn,ek as In,fa as Oe,fb as We,fd as Xe,fe as xe,fg as So,fh as sn,gb as je,gd as At,ge as rt,gg as tn,gk as Vn,hb as It,hc as gi,ia as J,ib as y,id as fo,ig as nn,ih as ut,jc as Lt,jd as Ti,jg as on,ka as Co,ke as W,kg as an,kl as zn,lb as g,lc as z,le as $,lh as cn,ma as ee,mb as a,mg as rn,ml as wo,na as K,nb as pi,nd as wi,o as ne,ob as _i,od as Di,p as Ae,pa as ri,pd as Ye,pf as qi,qb as Ci,qc as xi,qd as Qe,qf as Gi,qh as ce,rb as hi,rd as Pi,rj as Dn,sa as s,sb as fi,se as ki,sf as yo,sh as pt,sj as Pn,tc as bi,tf as Ki,ub as Ce,uc as yi,ue as Ai,uh as _t,uj as On,v as oe,va as ae,vb as qe,vd as vo,vf as $i,vj as ie,w as Y,wa as li,wb as he,wd as Oi,wf as Zi,xd as Ri,xf as Xi,yb as le,yd as Je,ye as Ui,yf as Yi,yh as Ct,yj as vt,zb as Vt,zd as Ut,ze as Bi,zf as Qi}from"./chunk-TYL6NO3L.js";import"./chunk-ZOBGFIAP.js";import"./chunk-7LF7TUYR.js";import"./chunk-QSPXPEUM.js";import"./chunk-MHF6VH7J.js";import"./chunk-OC2CZ3QN.js";import"./chunk-S75KSQCC.js";import"./chunk-F3WKVTVT.js";import"./chunk-TX6COQKF.js";import"./chunk-B3JIB7CB.js";import"./chunk-AV2XMJZK.js";import"./chunk-TLNUV6LJ.js";import"./chunk-X3MDAFQV.js";import"./chunk-LE344D6P.js";import"./chunk-BSSTUKEO.js";import"./chunk-SLCVE5JY.js";import"./chunk-NWYS2Y26.js";import"./chunk-5ORQKHAE.js";import"./chunk-NNIW76YM.js";import"./chunk-GN4LVN6F.js";import"./chunk-Q3TZ5E3J.js";import"./chunk-THUL57GX.js";import"./chunk-7FN55G7Q.js";import"./chunk-JA4SO6QN.js";import"./chunk-DJJWZ6ME.js";import"./chunk-BME7YW2F.js";import"./chunk-ZHEQ3EZZ.js";import"./chunk-LIP7LW4Z.js";import"./chunk-OCJB2TQU.js";import"./chunk-UFSYSDPG.js";import"./chunk-NVYUSY5M.js";import"./chunk-DP4VB7EI.js";import"./chunk-FBLIPTM4.js";import"./chunk-3JRA4PLP.js";import"./chunk-RQKBBL3R.js";import"./chunk-ZTKCIUS4.js";import"./chunk-FEFKMD5S.js";import"./chunk-5ORJAWGA.js";import"./chunk-YTZYL6W2.js";import"./chunk-JBS3UN52.js";import{a as L,b as ii,f as X}from"./chunk-3ONYU5UZ.js";function ye(i,c){if(!(i instanceof Node))return null;let e=i;for(;e!=null&&!(e instanceof Element);)e=e.parentNode;return e?.closest(c)??null}var Zn=X(()=>{"use strict"});function No(i){return Number(i.match(/(\d+)px/)?.[1])}function Lo(i){return Number(i?.match(/0 0\.01 (\d+)px/)?.[1])}var Qn,Gt,Io,Xn,Vo,zo,de,me,St,Ee,yt,ue,Kt,pe,Fo,$t,Zt,ko,Jn,Er,Tr,Ao,Se,Yn,Uo,eo,to,io=X(()=>{"use strict";z();z();kt();Pt();Co();Zn();mn();ho();vo();it();Qn=".cdk-header-cell, .mat-header-cell",Gt=".cdk-header-row, .mat-header-row",Io=".mat-column-resize-overlay-thumb",Xn="cdk-column-resize-hover-or-active",Vo="cdk-column-resize-with-resized-column",zo=new Ot("CdkColumnResizeOptions"),de=(()=>{class i{_renderer=l(Rt);_eventCleanups;destroyed=new G;selectorId=l(Ei).getId("cdk-column-resize-");id;_flushPending=!1;liveResizeUpdates=l(zo,{optional:!0})?.liveResizeUpdates??!0;ngAfterViewInit(){this.elementRef.nativeElement.classList.add(this.getUniqueCssClass()),this._listenForRowHoverEvents(),this._listenForResizeActivity(),this._listenForHoverActivity()}ngOnDestroy(){this._eventCleanups?.forEach(e=>e()),this.destroyed.next(),this.destroyed.complete()}getUniqueCssClass(){return this.selectorId}getTableId(){return String(this.elementRef.nativeElement.id)}setResized(){this.elementRef.nativeElement.classList.add(Vo)}_listenForRowHoverEvents(){this.ngZone.runOutsideAngular(()=>{let e=this.elementRef.nativeElement;this._eventCleanups=[this._renderer.listen(e,"mouseover",t=>{this.eventDispatcher.headerCellHovered.next(ye(t.target,Qn))}),this._renderer.listen(e,"mouseleave",t=>{t.relatedTarget&&!t.relatedTarget.matches(Io)&&this.eventDispatcher.headerCellHovered.next(null)})]})}_listenForResizeActivity(){oe(this.eventDispatcher.overlayHandleActiveForCell.pipe(Te(void 0)),this.notifier.triggerResize.pipe(Te(void 0)),this.notifier.resizeCompleted.pipe(Te(void 0))).pipe(wt(1),N(this.destroyed)).subscribe(()=>{this.setResized()})}_listenForHoverActivity(){this.eventDispatcher.headerRowHoveredOrActiveDistinct.pipe(De(null),Dt(),N(this.destroyed)).subscribe(([e,t])=>{t&&t.classList.add(Xn),e&&e.classList.remove(Xn)})}static \u0275fac=function(t){return new(t||i)};static \u0275dir=re({type:i,inputs:{liveResizeUpdates:"liveResizeUpdates"}})}return i})(),me=(()=>{class i{resizeCanceled=new G;resizeCompleted=new G;triggerResize=new G;static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),St=(()=>{class i{_source=l(me);resizeCompleted=this._source.resizeCompleted;resize(e,t){this._source.triggerResize.next({columnId:e,size:t,completeImmediately:!0,isStickyColumn:!0})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),Ee=(()=>{class i{_ngZone=l(ae);headerCellHovered=new G;overlayHandleActiveForCell=new G;headerCellHoveredDistinct=this.headerCellHovered.pipe(Q(),we());headerRowHoveredOrActiveDistinct=Ae([this.headerCellHoveredDistinct.pipe(ne(e=>ye(e,Gt)),De(null),Q()),this.overlayHandleActiveForCell.pipe(ne(e=>ye(e,Gt)),De(null),Q())]).pipe(oi(1),ne(([e,t])=>t||e),Q(),we());_headerRowHoveredOrActiveDistinctReenterZone=this.headerRowHoveredOrActiveDistinct.pipe(this._enterZone(),we());_lastSeenRow=null;_lastSeenRowHover=null;resizeOverlayVisibleForHeaderRow(e){return e!==this._lastSeenRow&&(this._lastSeenRow=e,this._lastSeenRowHover=this._headerRowHoveredOrActiveDistinctReenterZone.pipe(ne(t=>t===e),Q(),we())),this._lastSeenRowHover}_enterZone(){return e=>new Tt(t=>e.subscribe({next:n=>this._ngZone.run(()=>t.next(n)),error:n=>t.error(n),complete:()=>t.complete()}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),yt=class{tasks=[];endTasks=[]},ue=new Ot("_COALESCED_STYLE_SCHEDULER"),Kt=(()=>{class i{_currentSchedule=null;_ngZone=l(ae);constructor(){}schedule(e){this._createScheduleIfNeeded(),this._currentSchedule.tasks.push(e)}scheduleEnd(e){this._createScheduleIfNeeded(),this._currentSchedule.endTasks.push(e)}_createScheduleIfNeeded(){this._currentSchedule||(this._currentSchedule=new yt,this._ngZone.runOutsideAngular(()=>queueMicrotask(()=>{for(;this._currentSchedule.tasks.length||this._currentSchedule.endTasks.length;){let e=this._currentSchedule;this._currentSchedule=new yt;for(let t of e.tasks)t();for(let t of e.endTasks)t()}this._currentSchedule=null})))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),pe=(()=>{class i{_tableObserved=!1;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(e=>this._updateCachedSizes(e)):null;updateTableWidthAndStickyColumns(e){this.columnResize._flushPending=!0,this.styleScheduler.scheduleEnd(()=>{this.columnResize._flushPending&&(this.columnResize._flushPending=!1,this.table.updateStickyColumnStyles())})}getElementWidth(e){return No(e.style.width)||this._elemSizeCache.get(e)?.width||e.offsetWidth}registerColumn(e){this._tableObserved||(this._tableObserved=!0,this._resizeObserver?.observe(this.columnResize.elementRef.nativeElement,{box:"border-box"})),this._resizeObserver?.observe(e,{box:"border-box"})}ngOnDestroy(){this._resizeObserver?.disconnect()}_updateCachedSizes(e){for(let t of e){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};this._elemSizeCache.set(t.target,n)}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),Fo=(()=>{class i extends pe{columnResize=l(de);styleScheduler=l(ue);table=l(Wt);applyColumnSize(e,t,n,o){let m=n-(o??this.getElementWidth(t));m!==0&&(this.styleScheduler.schedule(()=>{t.style.width=ge(n)}),this.updateTableWidthAndStickyColumns(m))}applyMinColumnSize(e,t,n){let o=this.getElementWidth(t),m=Math.max(o,n);this.applyColumnSize(e,t,m,o)}applyMaxColumnSize(e,t,n){let o=this.getElementWidth(t),m=Math.min(o,n);this.applyColumnSize(e,t,m,o)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),$t=(()=>{class i extends pe{columnResize=l(de);styleScheduler=l(ue);table=l(Wt);_nonce=l(ri,{optional:!0});_document=l(Oe);_columnIndexes=new Map;_columnProperties=new Map;_styleElement;_indexSequence=0;defaultMinSize=0;defaultMaxSize=Number.MAX_SAFE_INTEGER;applyColumnSize(e,t,n,o){let m=n-(o??(this._getAppliedWidth(e)||t.offsetWidth));if(m===0)return;let v=ge(n);this._applyProperty(e,"flex",`0 0.01 ${v}`),this.updateTableWidthAndStickyColumns(m)}applyMinColumnSize(e,t,n){let o=ge(n);this._applyProperty(e,"min-width",o,n!==this.defaultMinSize),this.updateTableWidthAndStickyColumns(0)}applyMaxColumnSize(e,t,n){let o=ge(n);this._applyProperty(e,"max-width",o,n!==this.defaultMaxSize),this.updateTableWidthAndStickyColumns(0)}getColumnCssClass(e){return`cdk-column-${e}`}ngOnDestroy(){super.ngOnDestroy(),this._styleElement?.remove(),this._styleElement=void 0}_getPropertyValue(e,t){return this._getColumnPropertiesMap(e).get(t)}_getAppliedWidth(e){return Lo(this._getPropertyValue(e,"flex"))}_applyProperty(e,t,n,o=!0){let m=this._getColumnPropertiesMap(e);this.styleScheduler.schedule(()=>{o?m.set(t,n):m.delete(t),this._applySizeCss(e)})}_getStyleSheet(){return this._styleElement||(this._styleElement=this._document.createElement("style"),this._nonce&&this._styleElement.setAttribute("nonce",this._nonce),this._styleElement.appendChild(this._document.createTextNode("")),this._document.head.appendChild(this._styleElement)),this._styleElement.sheet}_getColumnPropertiesMap(e){let t=this._columnProperties.get(e);return t===void 0&&(t=new Map,this._columnProperties.set(e,t)),t}_applySizeCss(e){let t=this._getColumnPropertiesMap(e),n=Array.from(t.keys()),o=this._columnIndexes.get(e);if(o===void 0){if(!n.length)return;o=this._indexSequence++,this._columnIndexes.set(e,o)}else this._getStyleSheet().deleteRule(o);let m=this.getColumnCssClass(e),S=`.${this.columnResize.getUniqueCssClass()} .${m}`,P=n.map(D=>`${D}:${t.get(D)}`).join(";");this._getStyleSheet().insertRule(`${S} {${P}}`,o)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})();Zt={provide:pe,useClass:Fo},ko={provide:pe,useClass:$t},Jn=[St,Ee,me,{provide:ue,useClass:Kt}],Er=[...Jn,Zt],Tr=[...Jn,ko],Ao=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),Se=class{origin;overlayRef;minWidthPx;maxWidthPx;liveUpdates;constructor(c,e,t,n,o=!0){this.origin=c,this.overlayRef=e,this.minWidthPx=t,this.maxWidthPx=n,this.liveUpdates=o}},Yn="cdk-resizable-overlay-thumb-active",Uo="cdk-resizable-resize-disabled",eo=(()=>{class i{minWidthPxInternal=0;maxWidthPxInternal=Number.MAX_SAFE_INTEGER;inlineHandle;overlayRef;destroyed=new G;columnSizeStore=l(Ao,{optional:!0});_injector=l(Pe);_viewInitialized=!1;_isDestroyed=!1;get minWidthPx(){return this.minWidthPxInternal}set minWidthPx(e){this.minWidthPxInternal=e,this.columnResize.setResized(),this.elementRef.nativeElement&&this._viewInitialized&&this._applyMinWidthPx()}get maxWidthPx(){return this.maxWidthPxInternal}set maxWidthPx(e){this.maxWidthPxInternal=e,this.columnResize.setResized(),this.elementRef.nativeElement&&this._viewInitialized&&this._applyMaxWidthPx()}ngOnInit(){this.resizeStrategy.registerColumn(this.elementRef.nativeElement)}ngAfterViewInit(){this._listenForRowHoverEvents(),this._listenForResizeEvents(),this._appendInlineHandle(),this.styleScheduler.scheduleEnd(()=>{this._isDestroyed||(this._viewInitialized=!0,this._applyMinWidthPx(),this._applyMaxWidthPx(),this.columnSizeStore?.getSize(this.columnResize.getTableId(),this.columnDef.name)?.pipe(wt(1),N(this.destroyed)).subscribe(e=>{e!=null&&this._applySize(e)}))})}ngOnDestroy(){this._isDestroyed=!0,this.destroyed.next(),this.destroyed.complete(),this.inlineHandle?.remove(),this.overlayRef?.dispose()}_createOverlayForHandle(){let e=this.directionality.value==="rtl",t=Vi(this._injector,this.elementRef.nativeElement).withFlexibleDimensions(!1).withGrowAfterOpen(!1).withPush(!1).withDefaultOffsetX(e?1:0).withPositions([{originX:e?"start":"end",originY:"top",overlayX:"center",overlayY:"top"}]);return zi(this._injector,{direction:"ltr",disposeOnNavigation:!0,positionStrategy:t,scrollStrategy:Ii(this._injector),width:"16px"})}_listenForRowHoverEvents(){let e=this.elementRef.nativeElement,t=N(this.destroyed);this.eventDispatcher.resizeOverlayVisibleForHeaderRow(ye(e,Gt)).pipe(t).subscribe(n=>{if(n){let o=this.maxWidthPxInternal<Number.MAX_SAFE_INTEGER&&e.offsetWidth>this.maxWidthPxInternal;e.classList.toggle(Uo,o),o||(this.overlayRef||(this.overlayRef=this._createOverlayForHandle()),this._showHandleOverlay())}else this.overlayRef&&this.overlayRef.detach()})}_listenForResizeEvents(){let e=N(this.destroyed);oe(this.resizeNotifier.resizeCanceled,this.resizeNotifier.triggerResize).pipe(e,Y(t=>t.columnId===this.columnDef.name)).subscribe(({size:t,previousSize:n,completeImmediately:o})=>{this.elementRef.nativeElement.classList.add(Yn),this._applySize(t,n),o&&this._completeResizeOperation()}),oe(this.resizeNotifier.resizeCanceled,this.resizeNotifier.resizeCompleted).pipe(e).subscribe(t=>{this._cleanUpAfterResize(t)}),this.resizeNotifier.resizeCompleted.pipe(Y(t=>t.columnId===this.columnDef.name),Q((t,n)=>t.size===n.size),N(this.destroyed)).subscribe(t=>{this.columnSizeStore?.setSize(this.columnResize.getTableId(),this.columnDef.name,t.size)})}_completeResizeOperation(){this.ngZone.run(()=>{this.resizeNotifier.resizeCompleted.next({columnId:this.columnDef.name,size:this.elementRef.nativeElement.offsetWidth})})}_cleanUpAfterResize(e){this.elementRef.nativeElement.classList.remove(Yn),this.overlayRef&&this.overlayRef.hasAttached()&&(this._updateOverlayHandleHeight(),this.overlayRef.updatePosition(),e.columnId===this.columnDef.name&&this.inlineHandle.focus())}_createHandlePortal(){let e=Pe.create({parent:this.injector,providers:[{provide:Se,useValue:new Se(this.elementRef,this.overlayRef,this.minWidthPx,this.maxWidthPx,this.columnResize.liveResizeUpdates)}]});return new Pi(this.getOverlayHandleComponentType(),this.viewContainerRef,e)}_showHandleOverlay(){this._updateOverlayHandleHeight(),this.overlayRef.attach(this._createHandlePortal()),this.changeDetectorRef.markForCheck()}_updateOverlayHandleHeight(){ai(this.injector,()=>{li({write:()=>{this.overlayRef.updateSize({height:this.elementRef.nativeElement.offsetHeight})}})})}_applySize(e,t){let n=Math.min(Math.max(e,this.minWidthPx,0),this.maxWidthPx);this.resizeStrategy.applyColumnSize(this.columnDef.cssClassFriendlyName,this.elementRef.nativeElement,n,t)}_applyMinWidthPx(){this.resizeStrategy.applyMinColumnSize(this.columnDef.cssClassFriendlyName,this.elementRef.nativeElement,this.minWidthPx)}_applyMaxWidthPx(){this.resizeStrategy.applyMaxColumnSize(this.columnDef.cssClassFriendlyName,this.elementRef.nativeElement,this.maxWidthPx)}_appendInlineHandle(){this.inlineHandle=this.document.createElement("div"),this.inlineHandle.className=this.getInlineHandleCssClassName(),this.elementRef.nativeElement.appendChild(this.inlineHandle)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=re({type:i})}return i})(),to=(()=>{class i{_renderer=l(Rt);destroyed=new G;_cumulativeDeltaX=0;ngAfterViewInit(){this._listenForMouseEvents()}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete()}_listenForMouseEvents(){this.ngZone.runOutsideAngular(()=>{this._observableFromEvent(this.elementRef.nativeElement,"mouseenter").pipe(Te(this.resizeRef.origin.nativeElement),N(this.destroyed)).subscribe(e=>this.eventDispatcher.headerCellHovered.next(e)),this._observableFromEvent(this.elementRef.nativeElement,"mouseleave").pipe(ne(e=>e.relatedTarget&&ye(e.relatedTarget,Qn)),N(this.destroyed)).subscribe(e=>this.eventDispatcher.headerCellHovered.next(e)),this._observableFromEvent(this.elementRef.nativeElement,"mousedown").pipe(N(this.destroyed)).subscribe(e=>{this._dragStarted(e)})})}_dragStarted(e){if(e.button!==0)return;let t=this._observableFromEvent(this.document,"mouseup"),n=this._observableFromEvent(this.document,"mousemove"),o=this._observableFromEvent(this.document,"keyup").pipe(Y(F=>F.keyCode===27)),m=e.screenX,v=this._getOriginWidth(),S=0,P=this._getOriginOffset(),D=v,O=0;this._cumulativeDeltaX=0,this.updateResizeActive(!0),t.pipe(N(oe(o,this.destroyed))).subscribe(({screenX:F})=>{this.styleScheduler.scheduleEnd(()=>{this._notifyResizeEnded(D,F!==m)})}),o.pipe(N(oe(t,this.destroyed))).subscribe(()=>{this._notifyResizeEnded(v)}),n.pipe(ne(({screenX:F})=>F),De(m),Q(),Dt(),N(oe(t,o,this.destroyed))).subscribe(([F,_e])=>{let q=_e-F;if(!this.resizeRef.liveUpdates){this._cumulativeDeltaX+=q;let Z=this._computeNewSize(D,this._cumulativeDeltaX)-D;this._updateOverlayOffset(Z);return}if(O!==0)if(O<0&&q<0||O>0&&q>0){O+=q;return}else{let Z=O+q;if(O=O>0?Math.max(Z,0):Math.min(Z,0),q=Z-O,q===0)return}this._triggerResize(D,q),this.styleScheduler.scheduleEnd(()=>{let Z=this._getOriginWidth(),ti=this._getOriginOffset(),_o=ti-P,Et=Z-D;D=Z,P=ti,O+=q+(this._isLtr()?-Et:Et),S+=_o+(this._isLtr()?Et:0),this._updateOverlayOffset(S)})})}updateResizeActive(e){this.eventDispatcher.overlayHandleActiveForCell.next(e?this.resizeRef.origin.nativeElement:null)}_triggerResize(e,t){this.resizeNotifier.triggerResize.next({columnId:this.columnDef.name,size:this._computeNewSize(e,t),previousSize:e,isStickyColumn:this.columnDef.sticky||this.columnDef.stickyEnd})}_computeNewSize(e,t){let n=e+(this._isLtr()?t:-t);return n=Math.min(Math.max(n,this.resizeRef.minWidthPx,0),this.resizeRef.maxWidthPx),n}_getOriginWidth(){return this.resizeRef.origin.nativeElement.offsetWidth}_getOriginOffset(){return this.resizeRef.origin.nativeElement.offsetLeft}_updateOverlayOffset(e){this.resizeRef.overlayRef.overlayElement.style.transform=`translateX(${ge(e)})`}_isLtr(){return this.directionality.value==="ltr"}_notifyResizeEnded(e,t=!1){this.updateResizeActive(!1),this.ngZone.run(()=>{let n={columnId:this.columnDef.name,size:this._computeNewSize(e,this._cumulativeDeltaX)};t?(this.resizeRef.liveUpdates||this._triggerResize(e,this._cumulativeDeltaX),this.resizeNotifier.resizeCompleted.next(n)):this.resizeNotifier.resizeCanceled.next(n)})}_observableFromEvent(e,t){return new Tt(n=>{let o=v=>n.next(v),m=this._renderer.listen(e,t,o);return()=>{m(),n.complete()}})}static \u0275fac=function(t){return new(t||i)};static \u0275dir=re({type:i})}return i})()});var Bo,Ho,Wo,no,jo,Br,Xt,ke,qo,Yt,oo,Go,Ko,ao,Qt=X(()=>{"use strict";io();z();z();xo();it();fo();mn();Bo=["top"],Ho=(()=>{class i extends $t{getColumnCssClass(e){return`mat-column-${e}`}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),Wo={provide:pe,useClass:Ho},no=[St,Ee,me,{provide:ue,useClass:Kt}],jo=[...no,Zt],Br=[...no,Wo],Xt=class extends de{getTableHeight(){return this.elementRef.nativeElement.offsetHeight}},ke=(()=>{class i extends Xt{columnResizeNotifier=l(St);elementRef=l(K);eventDispatcher=l(Ee);ngZone=l(ae);notifier=l(me);static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275dir=re({type:i,selectors:[["table","mat-table","","columnResize",""]],hostAttrs:[1,"mat-column-resize-table"],features:[ze([...jo,{provide:de,useExisting:i}]),Re]})}return i})(),qo=(()=>{class i extends to{columnDef=l(Ht);columnResize=l(de);directionality=l(At);elementRef=l(K);eventDispatcher=l(Ee);ngZone=l(ae);resizeNotifier=l(me);resizeRef=l(Se);styleScheduler=l(ue);document=l(Oe);topElement;updateResizeActive(e){super.updateResizeActive(e);let t=this.resizeRef.origin.nativeElement.offsetHeight;this.topElement.nativeElement.style.height=`${t}px`,this.resizeRef.overlayRef.updateSize({height:e?this.columnResize.getTableHeight():t})}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275cmp=k({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){if(t&1&&Ci(Bo,7),t&2){let o;hi(o=fi())&&(n.topElement=o.first)}},hostAttrs:[1,"mat-column-resize-overlay-thumb"],features:[Re],decls:2,vars:0,consts:[["top",""],[1,"mat-column-resize-overlay-thumb-top"]],template:function(t,n){t&1&&ui(0,"div",1,0)},encapsulation:2,changeDetection:0})}return i})(),Yt=class extends eo{minWidthPxInternal=32;getInlineHandleCssClassName(){return"mat-resizable-handle"}getOverlayHandleComponentType(){return qo}},oo=(()=>{class i extends Yt{columnDef=l(Ht);columnResize=l(de);directionality=l(At);elementRef=l(K);eventDispatcher=l(Ee);injector=l(Pe);ngZone=l(ae);resizeNotifier=l(me);resizeStrategy=l(pe);styleScheduler=l(ue);viewContainerRef=l(si);changeDetectorRef=l(gi);document=l(Oe);static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275dir=re({type:i,selectors:[["mat-header-cell","resizable",""],["th","mat-header-cell","","resizable",""]],hostAttrs:[1,"mat-resizable"],inputs:{minWidthPx:[0,"matResizableMinWidthPx","minWidthPx"],maxWidthPx:[0,"matResizableMaxWidthPx","maxWidthPx"]},features:[Re]})}return i})(),Go=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Be({type:i});static \u0275inj=Ue({})}return i})(),Ko=[Ti,tt,Go],ao=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Be({type:i});static \u0275inj=Ue({imports:[Ko]})}return i})()});function oa(i,c){if(i&1){let e=y();r(0,"ui-du-compact-crop-popover",10),g("mouseenter",function(){p(e);let n=a(2);return _(n.onCropPopoverMouseEnter())}),d()}if(i&2){let e=a(2);u("crops",e.referenceCrops()??Fe(1,ia))}}function aa(i,c){if(i&1&&H(0,oa,1,2,"ng-template",5,1,$e),i&2){let e=a();u("cdkConnectedOverlayOrigin",e.overlayOrigin)("cdkConnectedOverlayOpen",e.shouldShowCropPopover())("cdkConnectedOverlayScrollStrategy",e.cropPopoverScrollStrategy)("cdkConnectedOverlayViewportMargin",30)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayPositions",e.cropPopoverPositions())}}function ra(i,c){if(i&1){let e=y();r(0,"button",11),x(1,"translate"),x(2,"uiHotkeysComboDisplay"),x(3,"translate"),g("click",function(){p(e);let n=a();return _(n.addNewValueToField())}),r(4,"mat-icon"),h(5,"add_circle_outline"),d()()}if(i&2){let e,t=a();u("disabled",!t.canChangeValue())("matTooltip",Ke(9,na,M(1,3,t.createValueTooltip()),M(2,5,(e=t.changeValueShortcut())==null?null:e.combos)).join(" ")),R("aria-label",M(3,7,t.createValueTooltip()))}}function la(i,c){if(i&1){let e=y();r(0,"ui-compact-actions-menu",12),g("change",function(){p(e);let n=a(),o=f(1);return _(o?n.changeExtractedValue():n.addNewValueToField())})("revert",function(){p(e);let n=a();return _(n.revertToPreviousValue())})("remove",function(){p(e);let n=a();return _(n.removeExtractedValue())})("textDirectionChange",function(n){p(e);let o=a();return _(o.onTextDirectionChange(n))})("reverseWords",function(){p(e);let n=a();return _(n.reverseWords())})("stateChange",function(n){p(e);let o=a();return _(o.menuOpen.set(n==="open"))}),d()}if(i&2){let e=a(),t=f(0);u("disableChange",!e.canChangeValue())("disableRevert",!e.hasHistory())("displayRemove",t.valueIds.length>0)("displayTextDirection",e.displayRTLFeatures())("displayReverseWords",e.displayRTLFeatures())("shouldMarkAsMissingInsteadOfRemove",t.valueIds.length===1)("shouldAddInsteadOfChange",t.valueIds.length===0)("hotkeys",e.hotkeys())}}var Jo,ea,ta,ia,na,Mt,ei=X(()=>{"use strict";kt();it();Ut();z();yo();Qe();be();bo();dt();Bt();at();$();Ct();ht();vt();cn();Ji();Pt();Vn();wo();Oo();z();it();kt();at();dt();be();Qe();$();Jo=["cropPopover"],ea=["cell"],ta=["*"],ia=()=>[],na=(i,c)=>[i,c];Mt=(()=>{class i{_overlay=l(Fi);_configurationsManagerService=l(ft);_extractionManagerService=l(ie);_bridgeService=l(gt);_vsKeyboardShortcutsService=l(xt);_valuesFactoryService=l(Pn);_scrollDispatcher=l(Oi);_rootNodeService=l(ut);_hostElement=l(K).nativeElement;field=b.required();taxonomy=b.required();value=b.required();rowIndex=b.required();readonly=b(!1);allowRevertValue=b(!1);textDirection=b("auto");positionCropHorizontally=b(!1);textDirectionChange=Ze();disableChange=J(!0);menuOpen=J(!1);overlayOrigin=l(et);_cropPopoverOverlay=ve("cropPopover");_cellElement=ve.required("cell");referenceCrops=C(()=>{let e=this.value();if(e?.id)return this._extractionManagerService.cropsMap()[e.id]?.crops});shouldShowCropPopover=C(()=>this.isSelected());_cropPopoverPositionFlipped=this._extractionManagerService.cropsPositionFlipped;cropPopoverPositions=C(()=>this._cropPopoverPositionFlipped()!==(this.positionCropHorizontally()||this.menuOpen())?nn:on);createValueTooltip=C(()=>this._pdfHasValidSelectionForValue()?"VS_SIMPLE_FIELD_CHANGE_VALUE_TOOLTIP":this.taxonomy().requiresReference?"":"VS_SIMPLE_FIELD_CHANGE_EMPTY_REFERENCE_VALUE_TOOLTIP");cropPopoverScrollStrategy=this._overlay.scrollStrategies.reposition();hasHistory=C(()=>!!this._extractionManagerService.historyMap()[this._valueOrFieldId()]?.history?.length);displayRTLFeatures=C(()=>this._configurationsManagerService.globalCustomizations().isRTLFeaturesEnabled&&!this._configurationsManagerService.isTemplateManager()&&zn(this.taxonomy()));hotkeys=this._vsKeyboardShortcutsService.table;markAsValidatedShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.markAsValidated);changeValueShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.changeValue);revertShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.revert);removeShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.remove);exitEditModeShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.exitEditMode);markAsValidatedCheckboxShortcut=C(()=>this.field().valueIds.length?this.markAsValidatedShortcut():void 0);checkboxTooltipKey=C(()=>!this.field().valueIds.length?"VS_TABLE_FIELD_CONFIRM_IS_MISSING_TOOLTIP":"VS_VALUE_CONFIRM_TOOLTIP");isSelected=C(()=>this._valueOrFieldId()===this._extractionManagerService.selectedValueId());confirmed=C(()=>(this.value()??this.field()).confirmationStatus===j.Confirmed);_pdfSelectionAsPrimaryValue=this._bridgeService.pdfSelectionAsPrimaryValue;_pdfHasValidSelectionForValue=C(()=>{if(this.readonly())return!1;let e=this._pdfSelectionAsPrimaryValue();return In(e,this._fieldConfiguration().referenceEditModes)&&!Tn(e?.reference,this.value()?.reference)});_fieldConfiguration=C(()=>this._configurationsManagerService.getFieldCustomization(this.taxonomy().id));_valueOrFieldId=C(()=>this.value()?.id??this.field().id);_valueOrFieldId$=Gi(this._valueOrFieldId);canChangeValue=C(()=>{let e=this.taxonomy(),t=this._pdfSelectionAsPrimaryValue();return!e.requiresReference&&!t||this._pdfHasValidSelectionForValue()});_resizeObserver=null;constructor(){B(e=>{let t=this.cropPopoverPositions(),n=this._cropPopoverOverlay()?.overlayRef;Nt(()=>{if(t&&n){let o=setTimeout(()=>this.shouldShowCropPopover()&&n.updatePosition());e(()=>clearTimeout(o))}})}),B(e=>{let t=this.shouldShowCropPopover();Nt(()=>{t?(this._resizeObserver??=new ResizeObserver(an(()=>this._handleResize(),10)),this._resizeObserver.observe(this._cellElement().nativeElement)):this._resizeObserver?.disconnect(),e(()=>this._resizeObserver?.disconnect())})}),B(e=>{let t=this._registerHotKeys();e(()=>t?.unsubscribe())}),B(()=>{this.isSelected()&&this._bringValueIntoViewAndFocus()}),Ae([this._extractionManagerService.focusedValueId$,this._valueOrFieldId$]).pipe(Y(([e,t])=>e===t),qi()).subscribe(()=>this._bringValueIntoViewAndFocus())}_handleResize(){let e=this._cropPopoverOverlay()?.overlayRef;this.shouldShowCropPopover()&&e&&requestAnimationFrame(()=>e.updatePosition())}addNewValueToField(){let e=L(L({},this._valuesFactoryService.generatePrimaryValue(this.field().fieldId,this.field().id)),this._pdfSelectionAsPrimaryValue());this._extractionManagerService.addExtractedPrimaryValue(this.field().id,e)}changeExtractedValue(){let e=this.value();if(!this.canChangeValue()||!e||this.taxonomy().type!==ce.Field)return;let n=L(L({},e),this._pdfSelectionAsPrimaryValue());this._extractionManagerService.updateExtractedPrimaryValue(n)}revertToPreviousValue(){this._extractionManagerService.restorePreviousValue(this._valueOrFieldId())}removeExtractedValue(){let e=this.value()?.id;e&&this._extractionManagerService.removeExtractedValues(this.field().id,[e])}onTextDirectionChange(e){this.textDirectionChange.emit(e)}reverseWords(){let e=this.value();if(!e?.reference)return;let n=this._bridgeService.reverseWordsInPrimaryValue(e);this._extractionManagerService.updateExtractedPrimaryValue(n)}onFocusChange(e){se(e)&&!this.isSelected()&&e!=="mouse"&&e!=="touch"&&(this._selectValue(jt.Tab),this._focusShell())}onClick(){this.isSelected()||this._selectValue(jt.MouseClick),this._bringValueIntoViewAndFocus()}onConfirmationChange(e){this._bringValueIntoViewAndFocus(),this._extractionManagerService.changeValueConfirmation(this._valueOrFieldId(),e)}restorePreviousValue(){this._extractionManagerService.restorePreviousValue(this._valueOrFieldId())}onCropPopoverMouseEnter(){this._cropPopoverPositionFlipped.update(e=>!e)}_selectValue(e){this._extractionManagerService.setSelectedValue(this._valueOrFieldId())}_registerHotKeys(){let e=this.markAsValidatedShortcut(),t=this.changeValueShortcut(),n=this.revertShortcut(),o=this.removeShortcut(),m=this.exitEditModeShortcut(),v=[e,t,n,o,m].filter(se);return this._vsKeyboardShortcutsService.listen$(v).subscribe(S=>{if(this.isSelected())switch(S.shortcut){case e:this.onConfirmationChange(!0);break;case t:{if(!this._pdfHasValidSelectionForValue())break;this.value()?this.changeExtractedValue():this.addNewValueToField();break}case n:this.restorePreviousValue();break;case o:this._extractionManagerService.removeExtractedValues(this.field().id,[this.value()?.id??""]);break;case m:this._focusShell();break;default:break}})}_bringValueIntoViewAndFocus(){this._isFocusWithinShell()||this._focusShell()}_focusShell(){requestAnimationFrame(()=>{this._cellElement().nativeElement.focus(),this._scrollIntoViewIfNeeded()})}_scrollIntoViewIfNeeded(){let e=this._hostElement,t=this._scrollDispatcher.getAncestorScrollContainers(e)[0];if(!t)return;let n=t.getElementRef().nativeElement,o=e.getBoundingClientRect(),m=n.getBoundingClientRect(),v=n.offsetHeight-n.clientHeight,S=n.offsetWidth-n.clientWidth,P={left:5,bottom:5+v,right:95+S,top:50},D={left:o.left-m.left,top:o.top-m.top,right:m.right-o.right,bottom:m.bottom-o.bottom},O,F;D.left<P.left?O={left:t.measureScrollOffset("left")+D.left-P.left,right:void 0}:D.right<P.right&&(O={left:void 0,right:t.measureScrollOffset("right")+D.right-P.right}),D.top<P.top?F={top:t.measureScrollOffset("top")+D.top-P.top,bottom:void 0}:D.bottom<P.bottom&&(F={top:void 0,bottom:t.measureScrollOffset("bottom")+D.bottom-P.bottom}),t.scrollTo(L(L({},O),F))}_isFocusWithinShell(){let e=this._cellElement().nativeElement,t=this._rootNodeService.getRootNode(e).activeElement;return e.contains(t)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-cell-shell"]],viewQuery:function(t,n){t&1&&(Ce(n._cropPopoverOverlay,Jo,5),Ce(n._cellElement,ea,5)),t&2&&qe(2)},inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],value:[1,"value"],rowIndex:[1,"rowIndex"],readonly:[1,"readonly"],allowRevertValue:[1,"allowRevertValue"],textDirection:[1,"textDirection"],positionCropHorizontally:[1,"positionCropHorizontally"]},outputs:{textDirectionChange:"textDirectionChange"},features:[di([et])],ngContentSelectors:ta,decls:15,vars:22,consts:[["cell",""],["cropPopover","cdkConnectedOverlay"],["cdkMonitorSubtreeFocus","","tabindex","0",1,"compact-cell-shell",3,"cdkFocusChange","click"],[3,"field","taxonomy","value","valueIndex"],[1,"value-container"],["cdkConnectedOverlay","","cdkConnectedOverlayTransformOriginOn","ui-du-compact-crop-popover",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayViewportMargin","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayPositions"],["mat-icon-button","","data-testid","missing-value-create-value","type","button","color","primary",3,"disabled","matTooltip"],["data-testid","confirmation-checkbox","matTooltipPosition","above","matTooltipShowDelay","500",3,"change","matTooltip","checked","disabled","aria-label"],[1,"menu"],["direction","vert",3,"disableChange","disableRevert","displayRemove","displayTextDirection","displayReverseWords","shouldMarkAsMissingInsteadOfRemove","shouldAddInsteadOfChange","hotkeys"],["data-testid","crop-popover",3,"mouseenter","crops"],["mat-icon-button","","data-testid","missing-value-create-value","type","button","color","primary",3,"click","disabled","matTooltip"],["direction","vert",3,"change","revert","remove","textDirectionChange","reverseWords","stateChange","disableChange","disableRevert","displayRemove","displayTextDirection","displayReverseWords","shouldMarkAsMissingInsteadOfRemove","shouldAddInsteadOfChange","hotkeys"]],template:function(t,n){if(t&1){let o=y();pi(),V(0)(1),r(2,"div",2,0),g("cdkFocusChange",function(v){return p(o),_(n.onFocusChange(v))})("click",function(){return p(o),_(n.onClick())}),I(4,"ui-du-compact-value-indicators",3),r(5,"div",4),_i(6),d(),E(7,aa,2,6,null,5),E(8,ra,6,12,"button",6),V(9),x(10,"translate"),r(11,"mat-checkbox",7),x(12,"uiHotkeysComboDisplay"),g("change",function(v){return p(o),_(n.onConfirmationChange(v.checked))}),d(),r(13,"div",8),E(14,la,1,8,"ui-compact-actions-menu",9),d()()}if(t&2){let o,m,v=w(n.field());s();let S=w(n.value()),P=n.taxonomy(),D=n.confirmed();s(),le("is-selected",n.isSelected()),R("data-testid","value-shell"+(n.isSelected()?"_selected":"")),s(2),u("field",v)("taxonomy",P)("value",S)("valueIndex",n.rowIndex()),s(3),T(S&&((o=n.referenceCrops())!=null&&o.length)?7:-1),s(),T(!n.readonly()&&!S?8:-1);let O=M(10,18,n.checkboxTooltipKey());s(3),u("matTooltip",vi("",O," ",M(12,20,(m=n.markAsValidatedCheckboxShortcut())==null?null:m.combos)))("checked",D)("disabled",n.readonly()),He("aria-label",O),s(3),T(n.readonly()?-1:14)}},dependencies:[tt,Ni,Mi,Si,Je,mt,ji,ot,nt,ct,st,te,lt,Ye,Xe,W,An,Ln,kn,rt,rn],styles:[".compact-cell-shell[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;min-height:40px;cursor:pointer;margin:4px 0;padding:0 2px;border-radius:4px;outline:2px solid transparent;display:flex;align-items:center}.compact-cell-shell.is-selected[_ngcontent-%COMP%]{outline-color:var(--color-primary);--value-selected: 1}.compact-cell-shell[_ngcontent-%COMP%]:hover{--value-hovered: 1}.compact-cell-shell[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%]{opacity:calc(var(--value-hovered, 0) + var(--value-selected, 0))}.compact-cell-shell[_ngcontent-%COMP%] .value-container[_ngcontent-%COMP%]{flex:1;overflow:hidden}"],changeDetection:0})}return i})()});function sa(i,c){i&1&&(r(0,"i",2),h(1,"VS_SIMPLE_FIELD_REMOVED_MESSAGE"),d())}function ca(i,c){i&1&&(r(0,"i",2),h(1,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE"),d())}function da(i,c){if(i&1&&(r(0,"div",1),E(1,sa,2,0,"i",2)(2,ca,2,0,"i",2),d()),i&2){let e=a(),t=f(0);s(),T(t.confirmationStatus===e.ConfirmationStatus.Confirmed?1:2)}}function ma(i,c){if(i&1){let e=y();r(0,"ui-du-compact-boolean-input",10),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("validationError",e.computedValidationError())}}function ua(i,c){if(i&1){let e=y();r(0,"ui-du-compact-set-input",11),g("panelOpenChange",function(n){p(e);let o=a(2);return _(o.panelOpen.set(n))})("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))}),d()}if(i&2){let e=a(2),t=f(1),n=f(2);u("value",t.value??"")("options",n.values)("validationError",e.computedValidationError())}}function pa(i,c){if(i&1){let e=y();r(0,"ui-du-compact-number-input",12),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("valueUniqueId",t.id)("derivedParts",t.derivedParts)("validationError",e.computedValidationError())("textDirection",e.textDirection())("decimalSeparator",e.docTypeMetadata().decimalSeparator)("thousandsSeparator",e.docTypeMetadata().thousandsSeparator)}}function _a(i,c){if(i&1){let e=y();r(0,"ui-du-compact-monetary-input",13),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))})("derivedPartsChange",function(n){p(e);let o=a(2);return _(o.onDerivedPartsChange(n,!0))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("valueUniqueId",t.id)("derivedParts",t.derivedParts)("validationError",e.computedValidationError())("textDirection",e.textDirection())("decimalSeparator",e.docTypeMetadata().decimalSeparator)("thousandsSeparator",e.docTypeMetadata().thousandsSeparator)}}function Ca(i,c){if(i&1){let e=y();r(0,"ui-du-compact-date-input",14),g("panelOpenChange",function(n){p(e);let o=a(2);return _(o.panelOpen.set(n))})("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))})("derivedPartsChange",function(n){p(e);let o=a(2);return _(o.onDerivedPartsChange(n))}),d()}if(i&2){let e=a(2),t=f(0),n=f(1);u("fieldId",t.id)("value",n.value??"")("valueUniqueId",n.id)("derivedParts",n.derivedParts)("validationError",e.computedValidationError())("textDirection",e.textDirection())("displayFormat",e.docTypeMetadata().dateDisplayFormat)}}function ha(i,c){if(i&1){let e=y();r(0,"ui-du-compact-address-input",15),g("panelOpenChange",function(n){p(e);let o=a(2);return _(o.panelOpen.set(n))})("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n,!0))})("derivedPartsChange",function(n){p(e);let o=a(2);return _(o.onDerivedPartsChange(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("valueUniqueId",t.id)("derivedParts",t.derivedParts)("validationError",e.computedValidationError())("maxRows",4)("textDirection",e.textDirection())}}function fa(i,c){if(i&1){let e=y();r(0,"ui-du-compact-name-input",16),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n,!0))})("derivedPartsChange",function(n){p(e);let o=a(2);return _(o.onDerivedPartsChange(n))})("panelOpenChange",function(n){p(e);let o=a(2);return _(o.panelOpen.set(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("valueUniqueId",t.id)("derivedParts",t.derivedParts)("validationError",e.computedValidationError())("maxRows",4)("textDirection",e.textDirection())}}function va(i,c){if(i&1){let e=y();r(0,"ui-du-compact-text-input",17),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("validationError",e.computedValidationError())("maxRows",4)("textDirection",e.textDirection())}}function ga(i,c){if(i&1&&I(0,"ui-du-compact-validator-notes",9),i&2){a();let e=f(9),t=f(10);a();let n=f(0),o=f(1);u("fieldId",n.id)("valueId",o.id)("taxonomy",e)("notes",t)("appInReadonlyMode",!1)}}function xa(i,c){if(i&1&&(r(0,"div"),E(1,ma,1,2,"ui-du-compact-boolean-input",3)(2,ua,1,3,"ui-du-compact-set-input",4)(3,pa,1,7,"ui-du-compact-number-input",5)(4,_a,1,7,"ui-du-compact-monetary-input",5)(5,Ca,1,7,"ui-du-compact-date-input",6)(6,ha,1,6,"ui-du-compact-address-input",7)(7,fa,1,6,"ui-du-compact-name-input",7)(8,va,1,4,"ui-du-compact-text-input",8),d(),V(9)(10),E(11,ga,1,5,"ui-du-compact-validator-notes",9)),i&2){let e,t=a(),n=f(2);s(),T((e=n.contentType)===t.FieldType.Boolean?1:e===t.FieldType.Set?2:e===t.FieldType.Number?3:e===t.FieldType.MonetaryQuantity?4:e===t.FieldType.Date?5:e===t.FieldType.Address?6:e===t.FieldType.Name?7:8),s(8);let o=w(t.validatorNotesTaxonomy());s(),w(t.validatorNotes()),s(),T(o&&o.enabled&&o.level===t.ValidatorNotesLevel.Value?11:-1)}}var ro,lo=X(()=>{"use strict";z();$();Ct();ht();vt();Ro();Un();ei();z();$();ro=(()=>{class i{_taxonomyManagerService=l(wn);_extractionManagerService=l(ie);_derivedPartsService=l(Dn);_extractionValidationService=l(On);field=b.required();taxonomy=b.required();value=b.required();rowIndex=b.required();panelOpen=J(!1);textDirection=J("auto");docTypeMetadata=C(()=>this._extractionManagerService.documentTypeTaxonomy());computedValidationError=C(()=>this._extractionValidationService.invalidPrimaryValuesMap()[this.value()?.id??""]?.validationError??null);validatorNotesTaxonomy=C(()=>this._taxonomyManagerService.getById(this.field().fieldId)?.validatorNotes);validatorNotes=C(()=>this.validatorNotesTaxonomy()?.enabled?this.value()?.validatorNotes:void 0);ValidatorNotesLevel=_t;FieldType=pt;ConfirmationStatus=j;hasHistory=C(()=>!!this._extractionManagerService.historyMap()[this._valueOrFieldId()]?.history?.length);_valueOrFieldId=C(()=>this.value()?.id??this.field().id);onTextDirectionChange(e){this.textDirection.set(e)}onInputValueChanges(e,t=!1){let n=this.value();if(!n)return;let o=t,m=this.taxonomy(),v=L({},n);!e&&n.value!==n.unformattedValue?(v.value=n.unformattedValue,v.derivedParts=n.derivedParts.map(S=>ii(L({},S),{value:""})),o=!1):(v.value=this._derivedPartsService.convertFormattedValueToValue(m.contentType,e)??e,v.derivedParts=this._derivedPartsService.convertFormattedValueToDerivedParts(m.contentType,e),v.reference||(v.unformattedValue=e)),this._extractionManagerService.updateExtractedPrimaryValue(v,o,!0)}onDerivedPartsChange(e,t=!1){let n=this.value();if(!n)return;let o=L(L({},n),this._derivedPartsService.derivedPartsToValueUpdate(n,e));this._extractionManagerService.updateExtractedPrimaryValue(o,!1,t)}onRevertToPreviousValue(){this._extractionManagerService.restorePreviousValue(this.value()?.id??this.field().id)}onConfirmCell(){this._changeCellConfirmation(!0)}onUnconfirmCell(){this._changeCellConfirmation(!1)}onRemoveExtractedValue(){this._extractionManagerService.removeExtractedValues(this.field().id,[this.value()?.id??""])}_changeCellConfirmation(e){this._extractionManagerService.changeValueConfirmation(this._valueOrFieldId(),e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-cell"]],inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],value:[1,"value"],rowIndex:[1,"rowIndex"]},decls:6,vars:10,consts:[[3,"textDirectionChange","field","taxonomy","value","textDirection","rowIndex","positionCropHorizontally"],["data-testid","missing-cell-value",1,"missing-value"],["translate",""],[3,"value","validationError"],[3,"value","options","validationError"],[3,"value","valueUniqueId","derivedParts","validationError","textDirection","decimalSeparator","thousandsSeparator"],[3,"fieldId","value","valueUniqueId","derivedParts","validationError","textDirection","displayFormat"],[3,"value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],[3,"value","validationError","maxRows","textDirection"],["data-testid","validator-notes",1,"validator-notes",3,"fieldId","valueId","taxonomy","notes","appInReadonlyMode"],[3,"valueChange","value","validationError"],[3,"panelOpenChange","valueChange","value","options","validationError"],[3,"valueChange","value","valueUniqueId","derivedParts","validationError","textDirection","decimalSeparator","thousandsSeparator"],[3,"valueChange","derivedPartsChange","value","valueUniqueId","derivedParts","validationError","textDirection","decimalSeparator","thousandsSeparator"],[3,"panelOpenChange","valueChange","derivedPartsChange","fieldId","value","valueUniqueId","derivedParts","validationError","textDirection","displayFormat"],[3,"panelOpenChange","valueChange","derivedPartsChange","value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],[3,"valueChange","derivedPartsChange","panelOpenChange","value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],[3,"valueChange","value","validationError","maxRows","textDirection"]],template:function(t,n){if(t&1){let o=y();V(0)(1)(2),r(3,"ui-du-compact-cell-shell",0),g("textDirectionChange",function(v){return p(o),_(n.onTextDirectionChange(v))}),E(4,da,3,1,"div",1)(5,xa,12,4),d()}if(t&2){let o=w(n.field());s();let m=w(n.value());s(),w(n.taxonomy()),s(),u("field",o)("taxonomy",n.taxonomy())("value",m)("textDirection",n.textDirection())("rowIndex",n.rowIndex())("positionCropHorizontally",n.panelOpen()),s(),T(m?5:4)}},dependencies:[W,xe,Mt,Bn,Hn,Wn,jn,qn,Kn,Gn,$n,bt],styles:[".missing-value[_ngcontent-%COMP%]{display:flex;align-items:center}.missing-value[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{margin-left:auto}"],changeDetection:0})}return i})()});function ba(i,c){i&1&&(r(0,"i",2),h(1,"VS_SIMPLE_FIELD_REMOVED_MESSAGE"),d())}function ya(i,c){i&1&&(r(0,"i",2),h(1,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE"),d())}function Sa(i,c){if(i&1&&(r(0,"div",1),E(1,ba,2,0,"i",2)(2,ya,2,0,"i",2),d()),i&2){let e=a(),t=f(0);s(),T(t.confirmationStatus===e.ConfirmationStatus.Confirmed?1:2)}}function Ma(i,c){if(i&1&&I(0,"ui-du-compact-validator-notes",4),i&2){a();let e=f(2),t=f(3);a();let n=f(0),o=f(1);u("fieldId",n.id)("valueId",o.id)("taxonomy",t)("notes",e)("appInReadonlyMode",!0)}}function Ea(i,c){if(i&1&&(r(0,"div",3),h(1),d(),V(2)(3),E(4,Ma,1,5,"ui-du-compact-validator-notes",4)),i&2){let e=a();s(),fe(" ",e.stringValue()," "),s(),w(e.validatorNotes()),s();let t=w(e.validatorNotesTaxonomy());s(),T(t&&t.enabled&&t.level===e.ValidatorNotesLevel.Value?4:-1)}}var so,co=X(()=>{"use strict";z();be();$();Ct();ht();Un();ei();z();$();so=(()=>{class i{field=b.required();taxonomy=b.required();value=b.required();rowIndex=b.required();TaxonomyDefinitionType=ce;ConfirmationStatus=j;validatorNotesTaxonomy=C(()=>{let e=this.taxonomy();if(e.type===ce.Field)return e.validatorNotes});validatorNotes=C(()=>this.validatorNotesTaxonomy()?.enabled?this.value()?.validatorNotes:void 0);ValidatorNotesLevel=_t;stringValue=C(()=>{let e=this.taxonomy(),t=this.value()?.value??"";return t?e.contentType===pt.Set?e.values.find(n=>n===t)??"":t:""});isMissing=C(()=>!this.value());static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-readonly-cell"]],inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],value:[1,"value"],rowIndex:[1,"rowIndex"]},decls:5,vars:8,consts:[[3,"field","taxonomy","value","readonly","rowIndex"],[1,"missing-value"],["translate",""],[1,"display-value"],["data-testid","validator-notes",1,"validator-notes",3,"fieldId","valueId","taxonomy","notes","appInReadonlyMode"]],template:function(t,n){if(t&1&&(V(0)(1),r(2,"ui-du-compact-cell-shell",0),E(3,Sa,3,1,"div",1)(4,Ea,5,4),d()),t&2){let o=w(n.field());s();let m=w(n.value());s(),u("field",o)("taxonomy",n.taxonomy())("value",m)("readonly",!0)("rowIndex",n.rowIndex()),s(),T(m?4:3)}},dependencies:[te,W,xe,Mt,bt],encapsulation:2,changeDetection:0})}return i})()});function Pa(i,c){if(i&1&&It(0,1),i&2){let e=c.$implicit,t=c.$index;a();let n=he(6);u("ngTemplateOutlet",n)("ngTemplateOutletContext",Ke(2,Ta,e,t))}}function Oa(i,c){if(i&1&&It(0,1),i&2){a();let e=he(6);u("ngTemplateOutlet",e)("ngTemplateOutletContext",Ne(2,wa,-1))}}function Ra(i,c){if(i&1&&I(0,"ui-du-compact-readonly-cell",2),i&2){let e=a().value,t=a(),n=f(0),o=f(1);u("field",n)("taxonomy",o)("value",e)("rowIndex",t.rowIndex())}}function Ia(i,c){if(i&1&&I(0,"ui-du-compact-cell",2),i&2){let e=a().value,t=a(),n=f(0),o=f(1);u("field",n)("taxonomy",o)("value",e)("rowIndex",t.rowIndex())}}function Va(i,c){if(i&1&&E(0,Ra,1,4,"ui-du-compact-readonly-cell",2)(1,Ia,1,4,"ui-du-compact-cell",2),i&2){let e=a();T(e.isReadonly()?0:1)}}var Ta,wa,Da,mo,uo=X(()=>{"use strict";yi();z();be();$();Ct();vt();lo();co();z();yi();Ta=(i,c)=>({value:i,index:c}),wa=i=>({value:null,index:i}),Da=(i,c)=>c.id;mo=(()=>{class i{_extractionManagerService=l(ie);isReadonly=b.required();fieldId=b.required();taxonomy=b.required();field=C(()=>this._extractionManagerService.getById(this.fieldId()));rowIndex=b.required();values=C(()=>this.field().valueIds.map(e=>this._extractionManagerService.getById(e)));TaxonomyDefinitionType=ce;constructor(){B(()=>{let e=this.field();this._extractionManagerService.selectedValueId()===e.id&&e.valueIds.length&&this._extractionManagerService.setSelectedValue(e.valueIds[0])})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-cell-field"]],inputs:{isReadonly:[1,"isReadonly"],fieldId:[1,"fieldId"],taxonomy:[1,"taxonomy"],rowIndex:[1,"rowIndex"]},decls:7,vars:3,consts:[["valueTemplate",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"field","taxonomy","value","rowIndex"]],template:function(t,n){t&1&&(V(0)(1),Ie(2,Pa,1,5,"ng-container",1,Da,!1,Oa,1,4,"ng-container",1),H(5,Va,2,1,"ng-template",null,0,$e)),t&2&&(w(n.field()),s(),w(n.taxonomy()),s(),Ve(n.values()))},dependencies:[bi,xi,te,W,so,ro],encapsulation:2,changeDetection:0})}return i})()});function ka(i,c){if(i&1&&(r(0,"th",27)(1,"div",28),I(2,"ui-du-shared-field-hotkey-button",29),r(3,"span"),h(4),d()()()),i&2){let e=a(),t=e.$implicit,n=e.$index,o=f(1);Vt(zt("mat-column-",t.name.toLowerCase())),u("matResizableMinWidthPx",o),R("data-testid","header-cell_"+n),s(2),u("disabled",!0)("disableInteraction",!0)("fieldId",t.id)("color",t.color)("hotkey",""),s(2),U(t.name)}}function Aa(i,c){if(i&1&&(r(0,"td",30),I(1,"ui-du-compact-cell-field",31),x(2,"toAbsoluteRowIndex"),d()),i&2){let e,t=c.$implicit,n=c.dataIndex,o=a(),m=o.$implicit,v=o.$index,S=a();Vt(zt("mat-column-",m.contentType.toLowerCase())),le("selected",((e=S.selectedCell())==null?null:e.id)===t.id)("missing",!t.valueIds.length)("confirmed",t.confirmationStatus===S.ConfirmationStatus.Confirmed);let P=t.valueIds[v];s(),u("fieldId",P)("taxonomy",m)("isReadonly",S.readonly())("rowIndex",Le(2,14,n,S.pageIndex(),S.pageSize())),R("data-testid","table-cell_"+v)}}function Ua(i,c){if(i&1&&(r(0,"div",6),V(1),H(2,ka,5,11,"th",25)(3,Aa,3,18,"td",26),d()),i&2){let e=c.$implicit;u("matColumnDef",e.id),s(),w(e.contentType==="Set"?300:270)}}function Ba(i,c){if(i&1){let e=y();r(0,"button",37),g("click",function(){p(e);let n=a(2);return _(n.toggleEntireTableSelection())}),r(1,"mat-icon",38),h(2," photo_size_select_small"),d(),r(3,"span"),h(4),x(5,"translate"),d()()}if(i&2){let e=a(2),t=f(9);u("disabled",e.isDrawingTableSelectionCells()||t),s(),u("color",e.extractTableIconColor()),s(3),U(M(5,3,"VS_TABLE_EXTRACT_NEW_TABLE"))}}function Ha(i,c){if(i&1){let e=y();r(0,"button",39),g("click",function(){p(e);let n=a(2);return _(n.deleteAllRows())}),r(1,"mat-icon"),h(2,"delete_forever"),d(),r(3,"span"),h(4),x(5,"translate"),d()()}if(i&2){a(2);let e=f(0);u("disabled",e),s(4),U(M(5,2,"VS_TABLE_DELETE_ALL_ROWS"))}}function Wa(i,c){if(i&1){let e=y();r(0,"th",32)(1,"button",33),x(2,"translate"),r(3,"mat-icon"),h(4,"more_vert"),d()(),r(5,"mat-menu",null,1),E(7,Ba,6,5,"button",34),r(8,"button",35),g("click",function(){p(e);let n=a();return _(n.highlightTable())}),r(9,"mat-icon"),h(10,"table_chart"),d(),r(11,"span"),h(12),x(13,"translate"),d()(),E(14,Ha,6,4,"button",36),d()()}if(i&2){let e=he(6),t=a();s(),u("matMenuTriggerFor",e),R("aria-label",M(2,5,"A11Y_MORE_MENU")),s(6),T(t.readonly()?-1:7),s(5),U(M(13,7,"VS_TABLE_HIGHLIGHT_TABLE")),s(2),T(t.readonly()?-1:14)}}function ja(i,c){if(i&1){let e=y();r(0,"button",45),g("click",function(){p(e);let n=a().dataIndex,o=a();return _(o.toggleRowsSelection(n))}),r(1,"mat-icon",38),h(2," photo_size_select_small"),d(),r(3,"span"),h(4),x(5,"translate"),d()(),r(6,"button",46),g("click",function(){p(e);let n=a().dataIndex,o=a();return _(o.addNewRow(n))}),r(7,"mat-icon"),h(8,"vertical_align_top"),d(),r(9,"span"),h(10),x(11,"translate"),d()(),r(12,"button",47),g("click",function(){p(e);let n=a().dataIndex,o=a();return _(o.addNewRow(n+1))}),r(13,"mat-icon"),h(14,"vertical_align_bottom"),d(),r(15,"span"),h(16),x(17,"translate"),d()(),r(18,"button",48),g("click",function(){p(e);let n=a().$implicit,o=a();return _(o.deleteRow(n.id))}),r(19,"mat-icon"),h(20,"delete"),d(),r(21,"span"),h(22),x(23,"translate"),d()()}if(i&2){let e=a(2),t=f(9);u("disabled",e.isDrawingTableSelectionCells()||t),s(),u("color",e.extractTableIconColor()),s(3),U(M(5,6,"VS_TABLE_EXTRACT_TABLE_HERE")),s(6),U(M(11,8,"VS_TABLE_ADD_ROW_ABOVE")),s(6),U(M(17,10,"VS_TABLE_ADD_ROW_BELOW")),s(6),U(M(23,12,"VS_TABLE_DELETE_ROW"))}}function qa(i,c){if(i&1){let e=y();r(0,"td",40)(1,"div",41)(2,"button",42),x(3,"translate"),r(4,"mat-icon"),h(5,"more_vert"),d()(),r(6,"mat-menu",null,2)(8,"button",43),g("click",function(){let n=p(e).$implicit,o=a();return _(o.highlightRow(n))}),r(9,"mat-icon"),h(10,"select_all"),d(),r(11,"span"),h(12),x(13,"translate"),d()(),E(14,ja,24,14),d(),r(15,"mat-checkbox",44),x(16,"translate"),x(17,"translate"),g("change",function(n){let o=p(e).$implicit,m=a();return _(m.setRowConfirmedStatus(o,n))})("click",function(n){return p(e),_(n.stopPropagation())}),d()()()}if(i&2){let e=c.$implicit,t=he(7),n=a();s(2),u("matMenuTriggerFor",t),R("aria-label",M(3,10,"VS_TABLE_FIELD_CONFIRM_IS_MISSING_TOOLTIP")),s(10),U(M(13,12,"VS_TABLE_HIGHLIGHT_ROW")),s(2),T(n.readonly()?-1:14),s(),u("matTooltip",Ge(M(16,14,"VS_ROW_CONFIRM_TOOLTIP"))),He("aria-label",M(17,16,"VS_ROW_CONFIRM_TOOLTIP")),u("checked",e.confirmationStatus===n.ConfirmationStatus.Confirmed)("indeterminate",e.confirmationStatus===n.ConfirmationStatus.PartiallyConfirmed)("disabled",n.readonly())}}function Ga(i,c){if(i&1){let e=y();r(0,"td",40)(1,"button",49),x(2,"translate"),x(3,"translate"),g("click",function(){let n=p(e).dataIndex,o=a();return _(o.addNewRow(n))}),r(4,"mat-icon"),h(5,"add_box"),d()()()}if(i&2){a();let e=f(1);R("colspan",e.length),s(),u("matTooltip",M(2,3,"VS_TABLE_INLINE_ADD_ROW_BUTTON_TOOLTIP")),R("aria-label",M(3,5,"VS_TABLE_INLINE_ADD_ROW_BUTTON_TOOLTIP"))}}function Ka(i,c){if(i&1){let e=y();r(0,"td",40)(1,"button",49),x(2,"translate"),x(3,"translate"),g("click",function(){let n=p(e).dataIndex,o=a();return _(o.addNewRow(n+1))}),r(4,"mat-icon"),h(5,"add_box"),d()()()}if(i&2){a();let e=f(1);R("colspan",e.length),s(),u("matTooltip",M(2,3,"VS_TABLE_INLINE_ADD_ROW_BUTTON_TOOLTIP")),R("aria-label",M(3,5,"VS_TABLE_INLINE_ADD_ROW_BUTTON_TOOLTIP"))}}function $a(i,c){i&1&&I(0,"tr",50)}function Za(i,c){if(i&1&&(I(0,"tr",51),x(1,"toAbsoluteRowIndex")),i&2){let e=c.dataIndex,t=a();le("hide",t.readonly()),R("data-testid","add-table-row_above-row_"+Le(1,3,e,t.pageIndex(),t.pageSize()))}}function Xa(i,c){if(i&1&&(I(0,"tr",52),x(1,"toAbsoluteRowIndex")),i&2){let e,t=c.$implicit,n=c.dataIndex,o=a();le("row-selected",t.id===((e=o.selectedTableRow())==null?null:e.id)),R("data-testid","table-row_"+Le(1,3,n,o.pageIndex(),o.pageSize()))}}function Ya(i,c){if(i&1&&(I(0,"tr",53),x(1,"toAbsoluteRowIndex")),i&2){let e=c.dataIndex,t=a();le("hide",t.readonly()),R("data-testid","add-table-row_below-row_"+Le(1,3,e,t.pageIndex(),t.pageSize()))}}function Qa(i,c){if(i&1){let e=y();r(0,"div",16),h(1),x(2,"translate"),r(3,"button",54),g("click",function(){p(e);let n=a();return _(n.addNewRow(0))}),r(4,"mat-icon"),h(5,"add_circle_outline"),d()()()}i&2&&(s(),fe(" ",M(2,1,"VS_TABLE_ADD_FIRST_ROW_MESSAGE")," "))}function Ja(i,c){if(i&1){let e=y();r(0,"section",19)(1,"label",20),h(2,"VS_TABLE_PAGE"),d(),r(3,"ui-navigator",55),g("changePageIndex",function(n){p(e);let o=a();return _(o.goToPage(n))}),d()()}if(i&2){let e=a();s(3),u("currentPageIndex",e.pageIndex())("maxPageIndex",e.totalPages()-1)("totalPagesToLoad",e.totalPages())}}function er(i,c){if(i&1&&(r(0,"mat-option",22),h(1),d()),i&2){let e=c.$implicit;u("value",e),R("data-testid","rows-per-page-option_"+e),s(),U(e)}}function tr(i,c){i&1&&(r(0,"div",56),h(1,"VS_TABLE_ALL_CELLS_ARE_VALID_AND_CONFIRMED_MESSAGE"),d())}function ir(i,c){if(i&1){let e=y();r(0,"button",59),x(1,"translate"),g("click",function(){p(e);let n=a(3);return _(n.goToFirstInvalidCell())}),h(2),x(3,"translate"),d()}if(i&2){a(2);let e=f(0);u("matTooltip",Ge(Ft(1,3,"VS_TABLE_CHECK_NEXT_INVALID_CELL_BUTTON_TOOLTIP",Ne(9,po,e)))),s(2),fe(" ",Ft(3,6,e===1?"VS_TABLE_CHECK_NEXT_INVALID_CELL_BUTTON.singular":"VS_TABLE_CHECK_NEXT_INVALID_CELL_BUTTON.plural",Ne(11,po,e))," ")}}function nr(i,c){i&1&&(r(0,"div",56),h(1,"VS_TABLE_NO_INVALID_CELLS_MESSAGE"),d())}function or(i,c){if(i&1){let e=y();r(0,"ui-button-group",60),g("clickActionButton",function(n){p(e);let o=a(3);return _(o.handleConfirmationButtonClick(n.id))}),d()}if(i&2){let e=a(3);u("type",e.ButtonGroupType.Secondary)("options",e.confirmationButtonGroupOptions())}}function ar(i,c){i&1&&(r(0,"div",56),h(1,"VS_TABLE_NO_UNCONFIRMED_CELLS_MESSAGE"),d())}function rr(i,c){if(i&1&&(E(0,ir,4,13,"button",57)(1,nr,2,0,"div",56),E(2,or,1,2,"ui-button-group",58)(3,ar,2,0,"div",56)),i&2){a();let e=f(0),t=f(1);T(e>0?0:1),s(2),T(t>0?2:3)}}function lr(i,c){if(i&1&&(V(0)(1),E(2,tr,2,0,"div",56)(3,rr,4,2)),i&2){let e=a(),t=w(e.invalidCells().length);s();let n=w(e.unconfirmedCells().length);s(),T(t===0&&n===0?2:3)}}var za,Fa,Na,po,La,sr,Ps,cr=X(()=>{Ut();z();Bi();Qe();be();go();dt();Bt();Zi();Sn();at();Qt();$();Mo();To();Eo();ht();vt();cn();So();Ji();Pt();Po();Vn();Do();uo();z();Bi();Ut();$();Sn();Bt();dt();Zi();be();at();Qe();Qt();za=["tableContent"],Fa=()=>["before"],Na=()=>["after"],po=i=>({numberOfInvalidCells:i}),La=(i,c)=>c.id;sr=(()=>{class i{transform(e,t,n){return e+t*n}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=ci({name:"toAbsoluteRowIndex",type:i,pure:!0})}return i})(),Ps=(()=>{class i{_translateService=l(Li);_extractionManagerService=l(ie);_configurationsManagerService=l(ft);_userPreferencesService=l(en);_vsKeyboardShortcutsService=l(xt);_bridgeService=l(gt);_rootNodeService=l(ut);_elementRef=l(K);_tableService=l(Nn);field=b.required();readonly=b(!1);isTableSelectionEnabled=b(!1);isDrawingTableSelectionCells=b(!1);_matColumnResizeDirective=ve(ke);_tableContent=ve.required("tableContent");tableSelectionEvent=Ze();fieldId=C(()=>this.field().id);selectedCell=this._tableService.selectedCell;selectedTableRow=this._tableService.selectedRow;isPdfTextViewActive=this._bridgeService.pdfViewerTextMode;ConfirmationStatus=j;ButtonGroupType=ln;paginationValues=[5,10,15];columnTaxonomies=this._tableService.columnTaxonomies;columnIdsWithActions=C(()=>this.columnTaxonomies().map(e=>e.id).concat(["actions"]));columnSizes=C(()=>this.columnIdsWithActions().map(e=>this._userPreferencesService.get(this._getColumnSizePreferenceKey(e),Lt)||140));tableDataSource=this._tableService.paginatedDataSource;hasRows=this._tableService.hasRows;pageSize=this._tableService.rowsPerPage;pageIndex=this._tableService.pageIndex;totalPages=this._tableService.totalPages;invalidCells=this._tableService.invalidCells;unconfirmedCells=this._tableService.unconfirmedCells;extractTableIconColor=C(()=>this.isTableSelectionEnabled()&&!se(this._tableService.tableSelectionAppendFromRowIndex())?"primary":null);confirmationButtonGroupOptions=C(()=>{let e=this.unconfirmedCells().length,t=this.invalidCells().length;return[{id:qt.NextUnconfirmedCell,text:this._translateService.instant(e===1?"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.singular":"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.plural",{numberOfUnconfirmedCells:e}),description:this._translateService.instant("VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON_TOOLTIP",{numberOfUnconfirmedCells:e})},{id:qt.ConfirmAllCells,text:this._translateService.instant("VS_TABLE_CONFIRM_ALL_CELLS_BUTTON"),disabled:t>0}]});_editReferenceCapabilities=C(()=>{let e=this._tableService.selectedTableValue()?.fieldId;return e?this._configurationsManagerService.getFieldCustomization(e).referenceEditModes:[]});_runResizing=J(!1);constructor(){B(e=>{let t=this._matColumnResizeDirective()?.columnResizeNotifier;if(!t)return;if(this._runResizing())for(let o of this._tableService.columnTaxonomies()){let m=this._userPreferencesService.get(this._getColumnSizePreferenceKey(o.id),Lt);m&&t.resize(o.id,m)}let n=t.resizeCompleted.subscribe(o=>{this._userPreferencesService.save(this._getColumnSizePreferenceKey(o.columnId),o.size)});e(()=>n.unsubscribe())}),B(e=>{let t=this._registerHotkeys();e(()=>t?.unsubscribe())}),B(()=>{this._extractionManagerService.selectedValueId()===this.fieldId()&&this._tableContent()&&this._tableContent().nativeElement.focus()})}ngOnInit(){setTimeout(()=>{this._runResizing.set(!0)},100)}goToPage(e){this._tableService.pageIndex.set(e)}goToFirstInvalidCell(){this._tableService.goToFirstInvalidCell()}handleConfirmationButtonClick(e){this._tableService.handleConfirmationButtonClick(e)}setRowConfirmedStatus(e,t){this._tableService.setRowConfirmedStatus(e,t.checked?j.Confirmed:j.NotConfirmed)}setRowsPerPage(e){this._tableService.setRowsPerPage(e)}highlightRow(e){this._bridgeService.activeHighlight([e.id])}addNewRow(e){this.readonly()||this._tableService.addNewRow(e)}deleteRow(e){this._extractionManagerService.removeExtractedValues(this.fieldId(),[e])}deleteAllRows(){this._extractionManagerService.removeExtractedValues(this.fieldId(),this.field().valueIds)}highlightTable(){this._bridgeService.activeHighlight(this.field().valueIds)}toggleEntireTableSelection(){let e=this._tableService.tableSelectionAppendFromRowIndex()!==void 0;this._toggleTableSelection({forceStart:e,fromRow:void 0})}toggleRowsSelection(e){let t=this._tableService.getPaginatedRowIndex(e),n=this._tableService.tableSelectionAppendFromRowIndex(),o=n===void 0,m=!o&&n!==t;this._toggleTableSelection({forceStart:o||m,fromRow:t})}onDismiss(){this._dismissTable()}onValidate(){this._tableService.goToFirstInvalidCell()}tableTrackBy(e,t){return t.id}_toggleTableSelection(e){if(!this.isTableSelectionEnabled()||e.forceStart){this.tableSelectionEvent.emit(this._createTableSelectionInput({appendRows:e.fromRow!==void 0})),this._tableService.tableSelectionAppendFromRowIndex.set(e.fromRow),setTimeout(()=>this._bridgeService.focusPdfViewer$.next(!0));return}this.tableSelectionEvent.emit(null),this._tableService.tableSelectionAppendFromRowIndex.set(void 0)}_createTableSelectionInput(e){return{canExtractHeaders:!1,columnNames:this._tableService.columnTaxonomies().map(t=>t.name),appendRows:e.appendRows,tokensRequired:!this._editReferenceCapabilities().includes(En.area)}}_dismissTable(){let e=this._tableService.selectedTableId();e&&this._extractionManagerService.setSelectedValue(e),this.tableSelectionEvent.emit(null),this._tableService.isTableEditorVisible.set(!1)}_isFocusWithinTheTable(){let e=this._rootNodeService.getRootNode(this._elementRef.nativeElement).activeElement;return!!e&&!!this._elementRef.nativeElement.contains(e)}_registerHotkeys(){let e=new ni,t=this._vsKeyboardShortcutsService.table()?.moveToRightCell,n=this._vsKeyboardShortcutsService.table()?.moveToLeftCell,o=this._vsKeyboardShortcutsService.table()?.moveToUpCell,m=this._vsKeyboardShortcutsService.table()?.moveToDownCell,v=[t,n,o,m].filter(se);e.add(this._vsKeyboardShortcutsService.listen$(v,this._elementRef.nativeElement).pipe(Y(()=>this._isFocusWithinTheTable())).subscribe(_e=>{switch(_e.nativeEvent.preventDefault(),_e.shortcut){case t:this._tableService.moveCellPosition("Right");break;case n:this._tableService.moveCellPosition("Left");break;case o:this._tableService.moveCellPosition("Up");break;case m:this._tableService.moveCellPosition("Down");break}}));let S=this._vsKeyboardShortcutsService.table()?.closeTableEditor,P=this._vsKeyboardShortcutsService.table()?.startTableSelection,D=this._vsKeyboardShortcutsService.table()?.goToFirstInvalidCell,O=this._vsKeyboardShortcutsService.table()?.goToFirstUnconfirmedCell,F=[S,P,D,O].filter(se);return e.add(this._vsKeyboardShortcutsService.listen$(F).subscribe(_e=>{switch(_e.shortcut){case S:this._dismissTable();break;case P:this.toggleEntireTableSelection();break;case D:this._tableService.goToFirstInvalidCell();break;case O:this._tableService.goToFirstUnconfirmedCell();break}})),e}_getColumnSizePreferenceKey(e){return`ui-du-vs.column-size_${e}`}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-table-editor"]],viewQuery:function(t,n){t&1&&(Ce(n._matColumnResizeDirective,ke,5),Ce(n._tableContent,za,5)),t&2&&qe(2)},inputs:{field:[1,"field"],readonly:[1,"readonly"],isTableSelectionEnabled:[1,"isTableSelectionEnabled"],isDrawingTableSelectionCells:[1,"isDrawingTableSelectionCells"]},outputs:{tableSelectionEvent:"tableSelectionEvent"},features:[ze([...Fn])],decls:36,vars:23,consts:[["tableContent",""],["headerMenu",""],["bodyMenu",""],[1,"ui-compact-table"],["cdkScrollable","","data-testid","compact-table-form","tabindex","0",1,"table-form",3,"submit"],["mat-table","","multiTemplateDataRows","","columnResize","",3,"dataSource","trackBy"],[3,"matColumnDef"],["matColumnDef","actions","stickyEnd",""],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","before"],["matColumnDef","after"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","","uiKeydownStopEventPropagation","","class","row-add before",3,"hide",4,"matRowDef","matRowDefColumns"],["mat-row","",3,"row-selected",4,"matRowDef","matRowDefColumns"],["mat-row","","uiKeydownStopEventPropagation","","class","row-add after",3,"hide",4,"matRowDef","matRowDefColumns"],[1,"empty-table"],["data-testid","table-editor-footer",1,"footer"],[1,"left-pagination"],[1,"pagination-field"],["translate","",1,"pagination-label"],["data-testid","select-rows-per-page",1,"pagination-control","no-form-field-wrapper",3,"selectionChange","value"],[3,"value"],[1,"right-buttons"],["mat-stroked-button","","color","secondary","data-testid","dismiss-button",3,"click","matTooltip"],["mat-header-cell","","resizable","",3,"class","matResizableMinWidthPx",4,"matHeaderCellDef"],["mat-cell","","valign","top",3,"class","selected","missing","confirmed",4,"matCellDef"],["mat-header-cell","","resizable","",3,"matResizableMinWidthPx"],[1,"table-header-cell-contents"],[3,"disabled","disableInteraction","fieldId","color","hotkey"],["mat-cell","","valign","top"],[3,"fieldId","taxonomy","isReadonly","rowIndex"],["mat-header-cell",""],["mat-icon-button","","data-testid","table-header-menu",3,"matMenuTriggerFor"],["mat-menu-item","","data-testid","toggle-table-selection-mode",3,"disabled"],["mat-menu-item","","data-testid","highlight-table",3,"click"],["mat-menu-item","","data-testid","delete-all-rows",3,"disabled"],["mat-menu-item","","data-testid","toggle-table-selection-mode",3,"click","disabled"],[3,"color"],["mat-menu-item","","data-testid","delete-all-rows",3,"click","disabled"],["mat-cell",""],[1,"column-actions-container"],["mat-icon-button","","data-testid","table-body-menu",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["data-testid","table-row-confirmed-checkbox","tabindex","-1",1,"row-confirm-checkbox",3,"change","click","matTooltip","aria-label","checked","indeterminate","disabled"],["mat-menu-item","","data-testid","extract-rows-from-here",3,"click","disabled"],["mat-menu-item","","data-testid","insert-row-above",3,"click"],["mat-menu-item","","data-testid","insert-row-below",3,"click"],["mat-menu-item","","data-testid","delete-row",3,"click"],["color","primary","mat-mini-fab","","uiKeydownStopEventPropagation","","data-testid","insert-row-button",3,"click","matTooltip"],["mat-header-row",""],["mat-row","","uiKeydownStopEventPropagation","",1,"row-add","before"],["mat-row",""],["mat-row","","uiKeydownStopEventPropagation","",1,"row-add","after"],["mat-icon-button","","data-testid","add-first-row","uiKeydownStopEventPropagation","",3,"click"],[1,"pagination-control",3,"changePageIndex","currentPageIndex","maxPageIndex","totalPagesToLoad"],["translate",""],["mat-stroked-button","","color","warn","data-testid","next-invalid-cell-button",3,"matTooltip"],["data-testid","unconfirmed-cells-button-group",3,"type","options"],["mat-stroked-button","","color","warn","data-testid","next-invalid-cell-button",3,"click","matTooltip"],["data-testid","unconfirmed-cells-button-group",3,"clickActionButton","type","options"]],template:function(t,n){if(t&1){let o=y();V(0)(1),r(2,"div",3)(3,"form",4,0),g("submit",function(v){return p(o),_(v.preventDefault())}),r(5,"table",5),Ie(6,Ua,4,2,"div",6,La),We(8,7),V(9),H(10,Wa,15,9,"th",8)(11,qa,18,18,"td",9),je(),We(12,10),H(13,Ga,6,7,"td",9),je(),We(14,11),H(15,Ka,6,7,"td",9),je(),H(16,$a,1,0,"tr",12)(17,Za,2,7,"tr",13)(18,Xa,2,7,"tr",14)(19,Ya,2,7,"tr",15),d(),E(20,Qa,6,3,"div",16),d(),r(21,"div",17)(22,"div",18),E(23,Ja,4,3,"section",19),r(24,"section",19)(25,"label",20),h(26,"VS_TABLE_ROWS_PER_PAGE"),d(),r(27,"mat-select",21),g("selectionChange",function(v){return p(o),_(n.setRowsPerPage(v.value))}),Ie(28,er,2,3,"mat-option",22,mi),d()()(),r(30,"div",23),E(31,lr,4,3),r(32,"button",24),x(33,"translate"),g("click",function(){return p(o),_(n.onDismiss())}),h(34),x(35,"translate"),d()()()()}if(t&2){let o=w(!n.hasRows()),m=n.tableDataSource();s();let v=w(n.columnTaxonomies()),S=n.columnIdsWithActions();s(4),u("dataSource",m)("trackBy",n.tableTrackBy),s(),Ve(v),s(3),w(n.isPdfTextViewActive()),s(7),u("matHeaderRowDef",S)("matHeaderRowDefSticky",!0),s(),u("matRowDefColumns",Fe(21,Fa)),s(),u("matRowDefColumns",S),s(),u("matRowDefColumns",Fe(22,Na)),s(),T(o&&!n.readonly()?20:-1),s(3),T(o?-1:23),s(4),u("value",n.pageSize()),s(),Ve(n.paginationValues),s(3),T(!n.readonly()&&!o?31:-1),s(),u("matTooltip",Ge(M(33,17,"VS_TABLE_CLOSE_TOOLTIP"))),s(2),fe(" ",M(35,19,"VS_TABLE_CLOSE_BUTTON")," ")}},dependencies:[Ui,Ai,ki,Je,Ri,W,xe,yn,un,_n,vn,Cn,pn,gn,hn,fn,xn,bn,mt,Yi,Xi,Qi,ct,st,Hi,$i,Ki,Wi,te,lt,ot,nt,Ye,wi,Di,Xe,ao,ke,oo,dn,sn,Mn,tn,Rn,mo,rt,sr],styles:['.ui-compact-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:auto;margin:2px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%]:focus-visible{border-radius:4px;outline:solid 2px var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{width:100%}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-row[_ngcontent-%COMP%]{height:auto}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%]{height:0px;position:relative}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add.hide[_ngcontent-%COMP%]{display:none}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{border:0 none;background-color:transparent;position:absolute;height:14px;width:100%;top:-8px;z-index:105!important}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:before{content:"";position:absolute;left:0;right:0;top:50%;height:2px;transition:background-color .2s;background-color:transparent}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%] .mat-mdc-mini-fab[_ngcontent-%COMP%]{opacity:0;position:sticky;left:0;margin-left:-4px;margin-top:-5px;transition:opacity .2s;z-index:105;width:24px!important;height:24px!important;padding:0!important;display:inline-flex;align-items:center;justify-content:center}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%] .mat-mdc-mini-fab[_ngcontent-%COMP%] > *[role=img][_ngcontent-%COMP%]{height:16px;width:16px;font-size:16px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%] .mat-mdc-mini-fab[_ngcontent-%COMP%] > *[role=img][_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px;height:16px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%] .mat-mdc-mini-fab[_ngcontent-%COMP%] .mat-mdc-button-touch-target[_ngcontent-%COMP%]{width:24px!important;height:24px!important}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:hover:before, .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:focus-within:before{background-color:var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:hover .mat-mdc-button-base[_ngcontent-%COMP%], .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:focus-within .mat-mdc-button-base[_ngcontent-%COMP%]{opacity:1}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%], .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{overflow:visible;padding:0 4px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell.mat-column-actions[_ngcontent-%COMP%], .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell.mat-column-actions[_ngcontent-%COMP%]{width:91px;padding:0 4px;border-left:1px solid var(--mat-table-row-item-outline-color)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell.mat-column-actions[_ngcontent-%COMP%] .column-actions-container[_ngcontent-%COMP%], .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell.mat-column-actions[_ngcontent-%COMP%] .column-actions-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%]{background:var(--color-background-secondary);z-index:105!important}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%] .table-header-cell-contents[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:center}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{cursor:pointer;background:var(--color-background);vertical-align:middle}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .empty-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding-top:30px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .row-selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:2px solid var(--color-primary);border-bottom:2px solid var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .row-selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{border-left:2px solid var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .row-selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:last-child{border-right:2px solid var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .row-selected[_ngcontent-%COMP%] td.mat-column-actions[_ngcontent-%COMP%]{border-right:2px solid var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{box-sizing:border-box;display:flex;flex-wrap:wrap;gap:8px;padding:10px;border-top:1px solid var(--mat-table-row-item-outline-color)}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .left-pagination[_ngcontent-%COMP%]{display:flex;flex-shrink:0;align-items:center;gap:20px}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .left-pagination[_ngcontent-%COMP%] .pagination-field[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;gap:8px;height:100%}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .left-pagination[_ngcontent-%COMP%] .pagination-field[_ngcontent-%COMP%] .pagination-label[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-weight:400;line-height:20px}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .left-pagination[_ngcontent-%COMP%] .pagination-field[_ngcontent-%COMP%] .pagination-control[_ngcontent-%COMP%]{min-width:45px}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .right-buttons[_ngcontent-%COMP%]{margin-left:auto;display:flex;flex-shrink:0;align-items:center;gap:12px}'],changeDetection:0})}return i})()});cr();export{sr as ToAbsoluteRowIndexPipe,Ps as UiCompactTableEditorComponent};
|
|
1
|
+
import{c as bt,g as Ln,h as kn,i as An,j as Oo,l as Un,m as Bn,n as Hn,p as Wn,q as jn,r as qn,s as Gn,t as Kn,u as $n,v as Ro}from"./chunk-MEJRHTNP.js";import{h as Mn,j as Eo,k as Fn,l as Do,m as qt,n as Nn,o as Po}from"./chunk-6AEFIYR5.js";import{$ as l,$a as r,$e as ji,$h as bn,$j as gt,A as wt,Ab as h,Ad as Ii,Ae as lt,Af as mt,B as Te,Bb as U,Be as te,Bf as Bt,Ca as Rt,Cb as fe,Cd as Vi,Ce as be,Dd as zi,Dj as Rn,E as Q,Ea as si,Eb as V,Ed as Fi,Ej as To,Fa as k,Fb as w,Fd as et,Ga as Be,Gb as f,Gd as Ni,H as Dt,Ha as re,Hb as Ge,Hd as tt,Ia as ci,Ib as zt,Id as it,Ie as Hi,Ja as Re,Jb as vi,Je as go,K as we,Ka as di,Kb as ze,Kc as Si,L as oi,La as H,Lb as Fe,Mb as Ne,Mf as se,N as De,Nb as Ke,Nd as nt,Nh as dn,Od as ot,Oh as Mo,P as N,Pc as Mi,Pd as at,Pe as Wi,Ph as Ht,Qa as He,Qc as Ei,Qe as xo,Qh as Wt,Qi as jt,Ra as R,Re as st,Rh as mn,Ri as En,Sb as x,Se as ct,Sh as un,Ta as E,Tb as M,Te as dt,Th as pn,U as Pt,Ub as Ft,Uh as _n,Ui as Tn,Va as T,Vb as Le,Vc as kt,Vf as Ji,Vh as Cn,Wb as $e,Wh as hn,Wi as j,X as A,Xa as mi,Xh as fn,Y as Ue,Ya as Ie,Yb as Nt,Yh as vn,Z as Ot,Za as Ve,Zb as C,Zc as ge,Zh as gn,_a as u,_b as B,_c as ho,_h as xn,_i as ht,a as ni,aa as ai,ab as d,af as bo,ai as yn,b as Tt,ba as p,bb as I,bc as Ze,bk as xt,c as G,ca as _,cc as b,ci as Sn,dc as ve,dj as ft,ea as Pe,eb as ui,ee as Li,eg as en,eh as ln,ej as wn,ek as In,fa as Oe,fb as We,fd as Xe,fe as xe,fg as So,fh as sn,gb as je,gd as At,ge as rt,gg as tn,gk as Vn,hb as It,hc as gi,ia as J,ib as y,id as fo,ig as nn,ih as ut,jc as Lt,jd as Ti,jg as on,ka as Co,ke as W,kg as an,kl as zn,lb as g,lc as z,le as $,lh as cn,ma as ee,mb as a,mg as rn,ml as wo,na as K,nb as pi,nd as wi,o as ne,ob as _i,od as Di,p as Ae,pa as ri,pd as Ye,pf as qi,qb as Ci,qc as xi,qd as Qe,qf as Gi,qh as ce,rb as hi,rd as Pi,rj as Dn,sa as s,sb as fi,se as ki,sf as yo,sh as pt,sj as Pn,tc as bi,tf as Ki,ub as Ce,uc as yi,ue as Ai,uh as _t,uj as On,v as oe,va as ae,vb as qe,vd as vo,vf as $i,vj as ie,w as Y,wa as li,wb as he,wd as Oi,wf as Zi,xd as Ri,xf as Xi,yb as le,yd as Je,ye as Ui,yf as Yi,yh as Ct,yj as vt,zb as Vt,zd as Ut,ze as Bi,zf as Qi}from"./chunk-5LGMGLPM.js";import"./chunk-ZOBGFIAP.js";import"./chunk-7LF7TUYR.js";import"./chunk-QSPXPEUM.js";import"./chunk-MHF6VH7J.js";import"./chunk-OC2CZ3QN.js";import"./chunk-S75KSQCC.js";import"./chunk-F3WKVTVT.js";import"./chunk-TX6COQKF.js";import"./chunk-B3JIB7CB.js";import"./chunk-AV2XMJZK.js";import"./chunk-TLNUV6LJ.js";import"./chunk-X3MDAFQV.js";import"./chunk-LE344D6P.js";import"./chunk-BSSTUKEO.js";import"./chunk-SLCVE5JY.js";import"./chunk-NWYS2Y26.js";import"./chunk-5ORQKHAE.js";import"./chunk-NNIW76YM.js";import"./chunk-GN4LVN6F.js";import"./chunk-Q3TZ5E3J.js";import"./chunk-THUL57GX.js";import"./chunk-7FN55G7Q.js";import"./chunk-JA4SO6QN.js";import"./chunk-DJJWZ6ME.js";import"./chunk-BME7YW2F.js";import"./chunk-ZHEQ3EZZ.js";import"./chunk-LIP7LW4Z.js";import"./chunk-OCJB2TQU.js";import"./chunk-UFSYSDPG.js";import"./chunk-NVYUSY5M.js";import"./chunk-DP4VB7EI.js";import"./chunk-FBLIPTM4.js";import"./chunk-3JRA4PLP.js";import"./chunk-RQKBBL3R.js";import"./chunk-ZTKCIUS4.js";import"./chunk-FEFKMD5S.js";import"./chunk-5ORJAWGA.js";import"./chunk-YTZYL6W2.js";import"./chunk-JBS3UN52.js";import{a as L,b as ii,f as X}from"./chunk-3ONYU5UZ.js";function ye(i,c){if(!(i instanceof Node))return null;let e=i;for(;e!=null&&!(e instanceof Element);)e=e.parentNode;return e?.closest(c)??null}var Zn=X(()=>{"use strict"});function No(i){return Number(i.match(/(\d+)px/)?.[1])}function Lo(i){return Number(i?.match(/0 0\.01 (\d+)px/)?.[1])}var Qn,Gt,Io,Xn,Vo,zo,de,me,St,Ee,yt,ue,Kt,pe,Fo,$t,Zt,ko,Jn,Er,Tr,Ao,Se,Yn,Uo,eo,to,io=X(()=>{"use strict";z();z();kt();Pt();Co();Zn();mn();ho();vo();it();Qn=".cdk-header-cell, .mat-header-cell",Gt=".cdk-header-row, .mat-header-row",Io=".mat-column-resize-overlay-thumb",Xn="cdk-column-resize-hover-or-active",Vo="cdk-column-resize-with-resized-column",zo=new Ot("CdkColumnResizeOptions"),de=(()=>{class i{_renderer=l(Rt);_eventCleanups;destroyed=new G;selectorId=l(Ei).getId("cdk-column-resize-");id;_flushPending=!1;liveResizeUpdates=l(zo,{optional:!0})?.liveResizeUpdates??!0;ngAfterViewInit(){this.elementRef.nativeElement.classList.add(this.getUniqueCssClass()),this._listenForRowHoverEvents(),this._listenForResizeActivity(),this._listenForHoverActivity()}ngOnDestroy(){this._eventCleanups?.forEach(e=>e()),this.destroyed.next(),this.destroyed.complete()}getUniqueCssClass(){return this.selectorId}getTableId(){return String(this.elementRef.nativeElement.id)}setResized(){this.elementRef.nativeElement.classList.add(Vo)}_listenForRowHoverEvents(){this.ngZone.runOutsideAngular(()=>{let e=this.elementRef.nativeElement;this._eventCleanups=[this._renderer.listen(e,"mouseover",t=>{this.eventDispatcher.headerCellHovered.next(ye(t.target,Qn))}),this._renderer.listen(e,"mouseleave",t=>{t.relatedTarget&&!t.relatedTarget.matches(Io)&&this.eventDispatcher.headerCellHovered.next(null)})]})}_listenForResizeActivity(){oe(this.eventDispatcher.overlayHandleActiveForCell.pipe(Te(void 0)),this.notifier.triggerResize.pipe(Te(void 0)),this.notifier.resizeCompleted.pipe(Te(void 0))).pipe(wt(1),N(this.destroyed)).subscribe(()=>{this.setResized()})}_listenForHoverActivity(){this.eventDispatcher.headerRowHoveredOrActiveDistinct.pipe(De(null),Dt(),N(this.destroyed)).subscribe(([e,t])=>{t&&t.classList.add(Xn),e&&e.classList.remove(Xn)})}static \u0275fac=function(t){return new(t||i)};static \u0275dir=re({type:i,inputs:{liveResizeUpdates:"liveResizeUpdates"}})}return i})(),me=(()=>{class i{resizeCanceled=new G;resizeCompleted=new G;triggerResize=new G;static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),St=(()=>{class i{_source=l(me);resizeCompleted=this._source.resizeCompleted;resize(e,t){this._source.triggerResize.next({columnId:e,size:t,completeImmediately:!0,isStickyColumn:!0})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),Ee=(()=>{class i{_ngZone=l(ae);headerCellHovered=new G;overlayHandleActiveForCell=new G;headerCellHoveredDistinct=this.headerCellHovered.pipe(Q(),we());headerRowHoveredOrActiveDistinct=Ae([this.headerCellHoveredDistinct.pipe(ne(e=>ye(e,Gt)),De(null),Q()),this.overlayHandleActiveForCell.pipe(ne(e=>ye(e,Gt)),De(null),Q())]).pipe(oi(1),ne(([e,t])=>t||e),Q(),we());_headerRowHoveredOrActiveDistinctReenterZone=this.headerRowHoveredOrActiveDistinct.pipe(this._enterZone(),we());_lastSeenRow=null;_lastSeenRowHover=null;resizeOverlayVisibleForHeaderRow(e){return e!==this._lastSeenRow&&(this._lastSeenRow=e,this._lastSeenRowHover=this._headerRowHoveredOrActiveDistinctReenterZone.pipe(ne(t=>t===e),Q(),we())),this._lastSeenRowHover}_enterZone(){return e=>new Tt(t=>e.subscribe({next:n=>this._ngZone.run(()=>t.next(n)),error:n=>t.error(n),complete:()=>t.complete()}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),yt=class{tasks=[];endTasks=[]},ue=new Ot("_COALESCED_STYLE_SCHEDULER"),Kt=(()=>{class i{_currentSchedule=null;_ngZone=l(ae);constructor(){}schedule(e){this._createScheduleIfNeeded(),this._currentSchedule.tasks.push(e)}scheduleEnd(e){this._createScheduleIfNeeded(),this._currentSchedule.endTasks.push(e)}_createScheduleIfNeeded(){this._currentSchedule||(this._currentSchedule=new yt,this._ngZone.runOutsideAngular(()=>queueMicrotask(()=>{for(;this._currentSchedule.tasks.length||this._currentSchedule.endTasks.length;){let e=this._currentSchedule;this._currentSchedule=new yt;for(let t of e.tasks)t();for(let t of e.endTasks)t()}this._currentSchedule=null})))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),pe=(()=>{class i{_tableObserved=!1;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(e=>this._updateCachedSizes(e)):null;updateTableWidthAndStickyColumns(e){this.columnResize._flushPending=!0,this.styleScheduler.scheduleEnd(()=>{this.columnResize._flushPending&&(this.columnResize._flushPending=!1,this.table.updateStickyColumnStyles())})}getElementWidth(e){return No(e.style.width)||this._elemSizeCache.get(e)?.width||e.offsetWidth}registerColumn(e){this._tableObserved||(this._tableObserved=!0,this._resizeObserver?.observe(this.columnResize.elementRef.nativeElement,{box:"border-box"})),this._resizeObserver?.observe(e,{box:"border-box"})}ngOnDestroy(){this._resizeObserver?.disconnect()}_updateCachedSizes(e){for(let t of e){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};this._elemSizeCache.set(t.target,n)}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),Fo=(()=>{class i extends pe{columnResize=l(de);styleScheduler=l(ue);table=l(Wt);applyColumnSize(e,t,n,o){let m=n-(o??this.getElementWidth(t));m!==0&&(this.styleScheduler.schedule(()=>{t.style.width=ge(n)}),this.updateTableWidthAndStickyColumns(m))}applyMinColumnSize(e,t,n){let o=this.getElementWidth(t),m=Math.max(o,n);this.applyColumnSize(e,t,m,o)}applyMaxColumnSize(e,t,n){let o=this.getElementWidth(t),m=Math.min(o,n);this.applyColumnSize(e,t,m,o)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),$t=(()=>{class i extends pe{columnResize=l(de);styleScheduler=l(ue);table=l(Wt);_nonce=l(ri,{optional:!0});_document=l(Oe);_columnIndexes=new Map;_columnProperties=new Map;_styleElement;_indexSequence=0;defaultMinSize=0;defaultMaxSize=Number.MAX_SAFE_INTEGER;applyColumnSize(e,t,n,o){let m=n-(o??(this._getAppliedWidth(e)||t.offsetWidth));if(m===0)return;let v=ge(n);this._applyProperty(e,"flex",`0 0.01 ${v}`),this.updateTableWidthAndStickyColumns(m)}applyMinColumnSize(e,t,n){let o=ge(n);this._applyProperty(e,"min-width",o,n!==this.defaultMinSize),this.updateTableWidthAndStickyColumns(0)}applyMaxColumnSize(e,t,n){let o=ge(n);this._applyProperty(e,"max-width",o,n!==this.defaultMaxSize),this.updateTableWidthAndStickyColumns(0)}getColumnCssClass(e){return`cdk-column-${e}`}ngOnDestroy(){super.ngOnDestroy(),this._styleElement?.remove(),this._styleElement=void 0}_getPropertyValue(e,t){return this._getColumnPropertiesMap(e).get(t)}_getAppliedWidth(e){return Lo(this._getPropertyValue(e,"flex"))}_applyProperty(e,t,n,o=!0){let m=this._getColumnPropertiesMap(e);this.styleScheduler.schedule(()=>{o?m.set(t,n):m.delete(t),this._applySizeCss(e)})}_getStyleSheet(){return this._styleElement||(this._styleElement=this._document.createElement("style"),this._nonce&&this._styleElement.setAttribute("nonce",this._nonce),this._styleElement.appendChild(this._document.createTextNode("")),this._document.head.appendChild(this._styleElement)),this._styleElement.sheet}_getColumnPropertiesMap(e){let t=this._columnProperties.get(e);return t===void 0&&(t=new Map,this._columnProperties.set(e,t)),t}_applySizeCss(e){let t=this._getColumnPropertiesMap(e),n=Array.from(t.keys()),o=this._columnIndexes.get(e);if(o===void 0){if(!n.length)return;o=this._indexSequence++,this._columnIndexes.set(e,o)}else this._getStyleSheet().deleteRule(o);let m=this.getColumnCssClass(e),S=`.${this.columnResize.getUniqueCssClass()} .${m}`,P=n.map(D=>`${D}:${t.get(D)}`).join(";");this._getStyleSheet().insertRule(`${S} {${P}}`,o)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})();Zt={provide:pe,useClass:Fo},ko={provide:pe,useClass:$t},Jn=[St,Ee,me,{provide:ue,useClass:Kt}],Er=[...Jn,Zt],Tr=[...Jn,ko],Ao=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),Se=class{origin;overlayRef;minWidthPx;maxWidthPx;liveUpdates;constructor(c,e,t,n,o=!0){this.origin=c,this.overlayRef=e,this.minWidthPx=t,this.maxWidthPx=n,this.liveUpdates=o}},Yn="cdk-resizable-overlay-thumb-active",Uo="cdk-resizable-resize-disabled",eo=(()=>{class i{minWidthPxInternal=0;maxWidthPxInternal=Number.MAX_SAFE_INTEGER;inlineHandle;overlayRef;destroyed=new G;columnSizeStore=l(Ao,{optional:!0});_injector=l(Pe);_viewInitialized=!1;_isDestroyed=!1;get minWidthPx(){return this.minWidthPxInternal}set minWidthPx(e){this.minWidthPxInternal=e,this.columnResize.setResized(),this.elementRef.nativeElement&&this._viewInitialized&&this._applyMinWidthPx()}get maxWidthPx(){return this.maxWidthPxInternal}set maxWidthPx(e){this.maxWidthPxInternal=e,this.columnResize.setResized(),this.elementRef.nativeElement&&this._viewInitialized&&this._applyMaxWidthPx()}ngOnInit(){this.resizeStrategy.registerColumn(this.elementRef.nativeElement)}ngAfterViewInit(){this._listenForRowHoverEvents(),this._listenForResizeEvents(),this._appendInlineHandle(),this.styleScheduler.scheduleEnd(()=>{this._isDestroyed||(this._viewInitialized=!0,this._applyMinWidthPx(),this._applyMaxWidthPx(),this.columnSizeStore?.getSize(this.columnResize.getTableId(),this.columnDef.name)?.pipe(wt(1),N(this.destroyed)).subscribe(e=>{e!=null&&this._applySize(e)}))})}ngOnDestroy(){this._isDestroyed=!0,this.destroyed.next(),this.destroyed.complete(),this.inlineHandle?.remove(),this.overlayRef?.dispose()}_createOverlayForHandle(){let e=this.directionality.value==="rtl",t=Vi(this._injector,this.elementRef.nativeElement).withFlexibleDimensions(!1).withGrowAfterOpen(!1).withPush(!1).withDefaultOffsetX(e?1:0).withPositions([{originX:e?"start":"end",originY:"top",overlayX:"center",overlayY:"top"}]);return zi(this._injector,{direction:"ltr",disposeOnNavigation:!0,positionStrategy:t,scrollStrategy:Ii(this._injector),width:"16px"})}_listenForRowHoverEvents(){let e=this.elementRef.nativeElement,t=N(this.destroyed);this.eventDispatcher.resizeOverlayVisibleForHeaderRow(ye(e,Gt)).pipe(t).subscribe(n=>{if(n){let o=this.maxWidthPxInternal<Number.MAX_SAFE_INTEGER&&e.offsetWidth>this.maxWidthPxInternal;e.classList.toggle(Uo,o),o||(this.overlayRef||(this.overlayRef=this._createOverlayForHandle()),this._showHandleOverlay())}else this.overlayRef&&this.overlayRef.detach()})}_listenForResizeEvents(){let e=N(this.destroyed);oe(this.resizeNotifier.resizeCanceled,this.resizeNotifier.triggerResize).pipe(e,Y(t=>t.columnId===this.columnDef.name)).subscribe(({size:t,previousSize:n,completeImmediately:o})=>{this.elementRef.nativeElement.classList.add(Yn),this._applySize(t,n),o&&this._completeResizeOperation()}),oe(this.resizeNotifier.resizeCanceled,this.resizeNotifier.resizeCompleted).pipe(e).subscribe(t=>{this._cleanUpAfterResize(t)}),this.resizeNotifier.resizeCompleted.pipe(Y(t=>t.columnId===this.columnDef.name),Q((t,n)=>t.size===n.size),N(this.destroyed)).subscribe(t=>{this.columnSizeStore?.setSize(this.columnResize.getTableId(),this.columnDef.name,t.size)})}_completeResizeOperation(){this.ngZone.run(()=>{this.resizeNotifier.resizeCompleted.next({columnId:this.columnDef.name,size:this.elementRef.nativeElement.offsetWidth})})}_cleanUpAfterResize(e){this.elementRef.nativeElement.classList.remove(Yn),this.overlayRef&&this.overlayRef.hasAttached()&&(this._updateOverlayHandleHeight(),this.overlayRef.updatePosition(),e.columnId===this.columnDef.name&&this.inlineHandle.focus())}_createHandlePortal(){let e=Pe.create({parent:this.injector,providers:[{provide:Se,useValue:new Se(this.elementRef,this.overlayRef,this.minWidthPx,this.maxWidthPx,this.columnResize.liveResizeUpdates)}]});return new Pi(this.getOverlayHandleComponentType(),this.viewContainerRef,e)}_showHandleOverlay(){this._updateOverlayHandleHeight(),this.overlayRef.attach(this._createHandlePortal()),this.changeDetectorRef.markForCheck()}_updateOverlayHandleHeight(){ai(this.injector,()=>{li({write:()=>{this.overlayRef.updateSize({height:this.elementRef.nativeElement.offsetHeight})}})})}_applySize(e,t){let n=Math.min(Math.max(e,this.minWidthPx,0),this.maxWidthPx);this.resizeStrategy.applyColumnSize(this.columnDef.cssClassFriendlyName,this.elementRef.nativeElement,n,t)}_applyMinWidthPx(){this.resizeStrategy.applyMinColumnSize(this.columnDef.cssClassFriendlyName,this.elementRef.nativeElement,this.minWidthPx)}_applyMaxWidthPx(){this.resizeStrategy.applyMaxColumnSize(this.columnDef.cssClassFriendlyName,this.elementRef.nativeElement,this.maxWidthPx)}_appendInlineHandle(){this.inlineHandle=this.document.createElement("div"),this.inlineHandle.className=this.getInlineHandleCssClassName(),this.elementRef.nativeElement.appendChild(this.inlineHandle)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=re({type:i})}return i})(),to=(()=>{class i{_renderer=l(Rt);destroyed=new G;_cumulativeDeltaX=0;ngAfterViewInit(){this._listenForMouseEvents()}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete()}_listenForMouseEvents(){this.ngZone.runOutsideAngular(()=>{this._observableFromEvent(this.elementRef.nativeElement,"mouseenter").pipe(Te(this.resizeRef.origin.nativeElement),N(this.destroyed)).subscribe(e=>this.eventDispatcher.headerCellHovered.next(e)),this._observableFromEvent(this.elementRef.nativeElement,"mouseleave").pipe(ne(e=>e.relatedTarget&&ye(e.relatedTarget,Qn)),N(this.destroyed)).subscribe(e=>this.eventDispatcher.headerCellHovered.next(e)),this._observableFromEvent(this.elementRef.nativeElement,"mousedown").pipe(N(this.destroyed)).subscribe(e=>{this._dragStarted(e)})})}_dragStarted(e){if(e.button!==0)return;let t=this._observableFromEvent(this.document,"mouseup"),n=this._observableFromEvent(this.document,"mousemove"),o=this._observableFromEvent(this.document,"keyup").pipe(Y(F=>F.keyCode===27)),m=e.screenX,v=this._getOriginWidth(),S=0,P=this._getOriginOffset(),D=v,O=0;this._cumulativeDeltaX=0,this.updateResizeActive(!0),t.pipe(N(oe(o,this.destroyed))).subscribe(({screenX:F})=>{this.styleScheduler.scheduleEnd(()=>{this._notifyResizeEnded(D,F!==m)})}),o.pipe(N(oe(t,this.destroyed))).subscribe(()=>{this._notifyResizeEnded(v)}),n.pipe(ne(({screenX:F})=>F),De(m),Q(),Dt(),N(oe(t,o,this.destroyed))).subscribe(([F,_e])=>{let q=_e-F;if(!this.resizeRef.liveUpdates){this._cumulativeDeltaX+=q;let Z=this._computeNewSize(D,this._cumulativeDeltaX)-D;this._updateOverlayOffset(Z);return}if(O!==0)if(O<0&&q<0||O>0&&q>0){O+=q;return}else{let Z=O+q;if(O=O>0?Math.max(Z,0):Math.min(Z,0),q=Z-O,q===0)return}this._triggerResize(D,q),this.styleScheduler.scheduleEnd(()=>{let Z=this._getOriginWidth(),ti=this._getOriginOffset(),_o=ti-P,Et=Z-D;D=Z,P=ti,O+=q+(this._isLtr()?-Et:Et),S+=_o+(this._isLtr()?Et:0),this._updateOverlayOffset(S)})})}updateResizeActive(e){this.eventDispatcher.overlayHandleActiveForCell.next(e?this.resizeRef.origin.nativeElement:null)}_triggerResize(e,t){this.resizeNotifier.triggerResize.next({columnId:this.columnDef.name,size:this._computeNewSize(e,t),previousSize:e,isStickyColumn:this.columnDef.sticky||this.columnDef.stickyEnd})}_computeNewSize(e,t){let n=e+(this._isLtr()?t:-t);return n=Math.min(Math.max(n,this.resizeRef.minWidthPx,0),this.resizeRef.maxWidthPx),n}_getOriginWidth(){return this.resizeRef.origin.nativeElement.offsetWidth}_getOriginOffset(){return this.resizeRef.origin.nativeElement.offsetLeft}_updateOverlayOffset(e){this.resizeRef.overlayRef.overlayElement.style.transform=`translateX(${ge(e)})`}_isLtr(){return this.directionality.value==="ltr"}_notifyResizeEnded(e,t=!1){this.updateResizeActive(!1),this.ngZone.run(()=>{let n={columnId:this.columnDef.name,size:this._computeNewSize(e,this._cumulativeDeltaX)};t?(this.resizeRef.liveUpdates||this._triggerResize(e,this._cumulativeDeltaX),this.resizeNotifier.resizeCompleted.next(n)):this.resizeNotifier.resizeCanceled.next(n)})}_observableFromEvent(e,t){return new Tt(n=>{let o=v=>n.next(v),m=this._renderer.listen(e,t,o);return()=>{m(),n.complete()}})}static \u0275fac=function(t){return new(t||i)};static \u0275dir=re({type:i})}return i})()});var Bo,Ho,Wo,no,jo,Br,Xt,ke,qo,Yt,oo,Go,Ko,ao,Qt=X(()=>{"use strict";io();z();z();xo();it();fo();mn();Bo=["top"],Ho=(()=>{class i extends $t{getColumnCssClass(e){return`mat-column-${e}`}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275prov=A({token:i,factory:i.\u0275fac})}return i})(),Wo={provide:pe,useClass:Ho},no=[St,Ee,me,{provide:ue,useClass:Kt}],jo=[...no,Zt],Br=[...no,Wo],Xt=class extends de{getTableHeight(){return this.elementRef.nativeElement.offsetHeight}},ke=(()=>{class i extends Xt{columnResizeNotifier=l(St);elementRef=l(K);eventDispatcher=l(Ee);ngZone=l(ae);notifier=l(me);static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275dir=re({type:i,selectors:[["table","mat-table","","columnResize",""]],hostAttrs:[1,"mat-column-resize-table"],features:[ze([...jo,{provide:de,useExisting:i}]),Re]})}return i})(),qo=(()=>{class i extends to{columnDef=l(Ht);columnResize=l(de);directionality=l(At);elementRef=l(K);eventDispatcher=l(Ee);ngZone=l(ae);resizeNotifier=l(me);resizeRef=l(Se);styleScheduler=l(ue);document=l(Oe);topElement;updateResizeActive(e){super.updateResizeActive(e);let t=this.resizeRef.origin.nativeElement.offsetHeight;this.topElement.nativeElement.style.height=`${t}px`,this.resizeRef.overlayRef.updateSize({height:e?this.columnResize.getTableHeight():t})}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275cmp=k({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){if(t&1&&Ci(Bo,7),t&2){let o;hi(o=fi())&&(n.topElement=o.first)}},hostAttrs:[1,"mat-column-resize-overlay-thumb"],features:[Re],decls:2,vars:0,consts:[["top",""],[1,"mat-column-resize-overlay-thumb-top"]],template:function(t,n){t&1&&ui(0,"div",1,0)},encapsulation:2,changeDetection:0})}return i})(),Yt=class extends eo{minWidthPxInternal=32;getInlineHandleCssClassName(){return"mat-resizable-handle"}getOverlayHandleComponentType(){return qo}},oo=(()=>{class i extends Yt{columnDef=l(Ht);columnResize=l(de);directionality=l(At);elementRef=l(K);eventDispatcher=l(Ee);injector=l(Pe);ngZone=l(ae);resizeNotifier=l(me);resizeStrategy=l(pe);styleScheduler=l(ue);viewContainerRef=l(si);changeDetectorRef=l(gi);document=l(Oe);static \u0275fac=(()=>{let e;return function(n){return(e||(e=ee(i)))(n||i)}})();static \u0275dir=re({type:i,selectors:[["mat-header-cell","resizable",""],["th","mat-header-cell","","resizable",""]],hostAttrs:[1,"mat-resizable"],inputs:{minWidthPx:[0,"matResizableMinWidthPx","minWidthPx"],maxWidthPx:[0,"matResizableMaxWidthPx","maxWidthPx"]},features:[Re]})}return i})(),Go=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Be({type:i});static \u0275inj=Ue({})}return i})(),Ko=[Ti,tt,Go],ao=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=Be({type:i});static \u0275inj=Ue({imports:[Ko]})}return i})()});function oa(i,c){if(i&1){let e=y();r(0,"ui-du-compact-crop-popover",10),g("mouseenter",function(){p(e);let n=a(2);return _(n.onCropPopoverMouseEnter())}),d()}if(i&2){let e=a(2);u("crops",e.referenceCrops()??Fe(1,ia))}}function aa(i,c){if(i&1&&H(0,oa,1,2,"ng-template",5,1,$e),i&2){let e=a();u("cdkConnectedOverlayOrigin",e.overlayOrigin)("cdkConnectedOverlayOpen",e.shouldShowCropPopover())("cdkConnectedOverlayScrollStrategy",e.cropPopoverScrollStrategy)("cdkConnectedOverlayViewportMargin",30)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayPositions",e.cropPopoverPositions())}}function ra(i,c){if(i&1){let e=y();r(0,"button",11),x(1,"translate"),x(2,"uiHotkeysComboDisplay"),x(3,"translate"),g("click",function(){p(e);let n=a();return _(n.addNewValueToField())}),r(4,"mat-icon"),h(5,"add_circle_outline"),d()()}if(i&2){let e,t=a();u("disabled",!t.canChangeValue())("matTooltip",Ke(9,na,M(1,3,t.createValueTooltip()),M(2,5,(e=t.changeValueShortcut())==null?null:e.combos)).join(" ")),R("aria-label",M(3,7,t.createValueTooltip()))}}function la(i,c){if(i&1){let e=y();r(0,"ui-compact-actions-menu",12),g("change",function(){p(e);let n=a(),o=f(1);return _(o?n.changeExtractedValue():n.addNewValueToField())})("revert",function(){p(e);let n=a();return _(n.revertToPreviousValue())})("remove",function(){p(e);let n=a();return _(n.removeExtractedValue())})("textDirectionChange",function(n){p(e);let o=a();return _(o.onTextDirectionChange(n))})("reverseWords",function(){p(e);let n=a();return _(n.reverseWords())})("stateChange",function(n){p(e);let o=a();return _(o.menuOpen.set(n==="open"))}),d()}if(i&2){let e=a(),t=f(0);u("disableChange",!e.canChangeValue())("disableRevert",!e.hasHistory())("displayRemove",t.valueIds.length>0)("displayTextDirection",e.displayRTLFeatures())("displayReverseWords",e.displayRTLFeatures())("shouldMarkAsMissingInsteadOfRemove",t.valueIds.length===1)("shouldAddInsteadOfChange",t.valueIds.length===0)("hotkeys",e.hotkeys())}}var Jo,ea,ta,ia,na,Mt,ei=X(()=>{"use strict";kt();it();Ut();z();yo();Qe();be();bo();dt();Bt();at();$();Ct();ht();vt();cn();Ji();Pt();Vn();wo();Oo();z();it();kt();at();dt();be();Qe();$();Jo=["cropPopover"],ea=["cell"],ta=["*"],ia=()=>[],na=(i,c)=>[i,c];Mt=(()=>{class i{_overlay=l(Fi);_configurationsManagerService=l(ft);_extractionManagerService=l(ie);_bridgeService=l(gt);_vsKeyboardShortcutsService=l(xt);_valuesFactoryService=l(Pn);_scrollDispatcher=l(Oi);_rootNodeService=l(ut);_hostElement=l(K).nativeElement;field=b.required();taxonomy=b.required();value=b.required();rowIndex=b.required();readonly=b(!1);allowRevertValue=b(!1);textDirection=b("auto");positionCropHorizontally=b(!1);textDirectionChange=Ze();disableChange=J(!0);menuOpen=J(!1);overlayOrigin=l(et);_cropPopoverOverlay=ve("cropPopover");_cellElement=ve.required("cell");referenceCrops=C(()=>{let e=this.value();if(e?.id)return this._extractionManagerService.cropsMap()[e.id]?.crops});shouldShowCropPopover=C(()=>this.isSelected());_cropPopoverPositionFlipped=this._extractionManagerService.cropsPositionFlipped;cropPopoverPositions=C(()=>this._cropPopoverPositionFlipped()!==(this.positionCropHorizontally()||this.menuOpen())?nn:on);createValueTooltip=C(()=>this._pdfHasValidSelectionForValue()?"VS_SIMPLE_FIELD_CHANGE_VALUE_TOOLTIP":this.taxonomy().requiresReference?"":"VS_SIMPLE_FIELD_CHANGE_EMPTY_REFERENCE_VALUE_TOOLTIP");cropPopoverScrollStrategy=this._overlay.scrollStrategies.reposition();hasHistory=C(()=>!!this._extractionManagerService.historyMap()[this._valueOrFieldId()]?.history?.length);displayRTLFeatures=C(()=>this._configurationsManagerService.globalCustomizations().isRTLFeaturesEnabled&&!this._configurationsManagerService.isTemplateManager()&&zn(this.taxonomy()));hotkeys=this._vsKeyboardShortcutsService.table;markAsValidatedShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.markAsValidated);changeValueShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.changeValue);revertShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.revert);removeShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.remove);exitEditModeShortcut=C(()=>this.readonly()?void 0:this.hotkeys()?.exitEditMode);markAsValidatedCheckboxShortcut=C(()=>this.field().valueIds.length?this.markAsValidatedShortcut():void 0);checkboxTooltipKey=C(()=>!this.field().valueIds.length?"VS_TABLE_FIELD_CONFIRM_IS_MISSING_TOOLTIP":"VS_VALUE_CONFIRM_TOOLTIP");isSelected=C(()=>this._valueOrFieldId()===this._extractionManagerService.selectedValueId());confirmed=C(()=>(this.value()??this.field()).confirmationStatus===j.Confirmed);_pdfSelectionAsPrimaryValue=this._bridgeService.pdfSelectionAsPrimaryValue;_pdfHasValidSelectionForValue=C(()=>{if(this.readonly())return!1;let e=this._pdfSelectionAsPrimaryValue();return In(e,this._fieldConfiguration().referenceEditModes)&&!Tn(e?.reference,this.value()?.reference)});_fieldConfiguration=C(()=>this._configurationsManagerService.getFieldCustomization(this.taxonomy().id));_valueOrFieldId=C(()=>this.value()?.id??this.field().id);_valueOrFieldId$=Gi(this._valueOrFieldId);canChangeValue=C(()=>{let e=this.taxonomy(),t=this._pdfSelectionAsPrimaryValue();return!e.requiresReference&&!t||this._pdfHasValidSelectionForValue()});_resizeObserver=null;constructor(){B(e=>{let t=this.cropPopoverPositions(),n=this._cropPopoverOverlay()?.overlayRef;Nt(()=>{if(t&&n){let o=setTimeout(()=>this.shouldShowCropPopover()&&n.updatePosition());e(()=>clearTimeout(o))}})}),B(e=>{let t=this.shouldShowCropPopover();Nt(()=>{t?(this._resizeObserver??=new ResizeObserver(an(()=>this._handleResize(),10)),this._resizeObserver.observe(this._cellElement().nativeElement)):this._resizeObserver?.disconnect(),e(()=>this._resizeObserver?.disconnect())})}),B(e=>{let t=this._registerHotKeys();e(()=>t?.unsubscribe())}),B(()=>{this.isSelected()&&this._bringValueIntoViewAndFocus()}),Ae([this._extractionManagerService.focusedValueId$,this._valueOrFieldId$]).pipe(Y(([e,t])=>e===t),qi()).subscribe(()=>this._bringValueIntoViewAndFocus())}_handleResize(){let e=this._cropPopoverOverlay()?.overlayRef;this.shouldShowCropPopover()&&e&&requestAnimationFrame(()=>e.updatePosition())}addNewValueToField(){let e=L(L({},this._valuesFactoryService.generatePrimaryValue(this.field().fieldId,this.field().id)),this._pdfSelectionAsPrimaryValue());this._extractionManagerService.addExtractedPrimaryValue(this.field().id,e)}changeExtractedValue(){let e=this.value();if(!this.canChangeValue()||!e||this.taxonomy().type!==ce.Field)return;let n=L(L({},e),this._pdfSelectionAsPrimaryValue());this._extractionManagerService.updateExtractedPrimaryValue(n)}revertToPreviousValue(){this._extractionManagerService.restorePreviousValue(this._valueOrFieldId())}removeExtractedValue(){let e=this.value()?.id;e&&this._extractionManagerService.removeExtractedValues(this.field().id,[e])}onTextDirectionChange(e){this.textDirectionChange.emit(e)}reverseWords(){let e=this.value();if(!e?.reference)return;let n=this._bridgeService.reverseWordsInPrimaryValue(e);this._extractionManagerService.updateExtractedPrimaryValue(n)}onFocusChange(e){se(e)&&!this.isSelected()&&e!=="mouse"&&e!=="touch"&&(this._selectValue(jt.Tab),this._focusShell())}onClick(){this.isSelected()||this._selectValue(jt.MouseClick),this._bringValueIntoViewAndFocus()}onConfirmationChange(e){this._bringValueIntoViewAndFocus(),this._extractionManagerService.changeValueConfirmation(this._valueOrFieldId(),e)}restorePreviousValue(){this._extractionManagerService.restorePreviousValue(this._valueOrFieldId())}onCropPopoverMouseEnter(){this._cropPopoverPositionFlipped.update(e=>!e)}_selectValue(e){this._extractionManagerService.setSelectedValue(this._valueOrFieldId())}_registerHotKeys(){let e=this.markAsValidatedShortcut(),t=this.changeValueShortcut(),n=this.revertShortcut(),o=this.removeShortcut(),m=this.exitEditModeShortcut(),v=[e,t,n,o,m].filter(se);return this._vsKeyboardShortcutsService.listen$(v).subscribe(S=>{if(this.isSelected())switch(S.shortcut){case e:this.onConfirmationChange(!0);break;case t:{if(!this._pdfHasValidSelectionForValue())break;this.value()?this.changeExtractedValue():this.addNewValueToField();break}case n:this.restorePreviousValue();break;case o:this._extractionManagerService.removeExtractedValues(this.field().id,[this.value()?.id??""]);break;case m:this._focusShell();break;default:break}})}_bringValueIntoViewAndFocus(){this._isFocusWithinShell()||this._focusShell()}_focusShell(){requestAnimationFrame(()=>{this._cellElement().nativeElement.focus(),this._scrollIntoViewIfNeeded()})}_scrollIntoViewIfNeeded(){let e=this._hostElement,t=this._scrollDispatcher.getAncestorScrollContainers(e)[0];if(!t)return;let n=t.getElementRef().nativeElement,o=e.getBoundingClientRect(),m=n.getBoundingClientRect(),v=n.offsetHeight-n.clientHeight,S=n.offsetWidth-n.clientWidth,P={left:5,bottom:5+v,right:95+S,top:50},D={left:o.left-m.left,top:o.top-m.top,right:m.right-o.right,bottom:m.bottom-o.bottom},O,F;D.left<P.left?O={left:t.measureScrollOffset("left")+D.left-P.left,right:void 0}:D.right<P.right&&(O={left:void 0,right:t.measureScrollOffset("right")+D.right-P.right}),D.top<P.top?F={top:t.measureScrollOffset("top")+D.top-P.top,bottom:void 0}:D.bottom<P.bottom&&(F={top:void 0,bottom:t.measureScrollOffset("bottom")+D.bottom-P.bottom}),t.scrollTo(L(L({},O),F))}_isFocusWithinShell(){let e=this._cellElement().nativeElement,t=this._rootNodeService.getRootNode(e).activeElement;return e.contains(t)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-cell-shell"]],viewQuery:function(t,n){t&1&&(Ce(n._cropPopoverOverlay,Jo,5),Ce(n._cellElement,ea,5)),t&2&&qe(2)},inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],value:[1,"value"],rowIndex:[1,"rowIndex"],readonly:[1,"readonly"],allowRevertValue:[1,"allowRevertValue"],textDirection:[1,"textDirection"],positionCropHorizontally:[1,"positionCropHorizontally"]},outputs:{textDirectionChange:"textDirectionChange"},features:[di([et])],ngContentSelectors:ta,decls:15,vars:22,consts:[["cell",""],["cropPopover","cdkConnectedOverlay"],["cdkMonitorSubtreeFocus","","tabindex","0",1,"compact-cell-shell",3,"cdkFocusChange","click"],[3,"field","taxonomy","value","valueIndex"],[1,"value-container"],["cdkConnectedOverlay","","cdkConnectedOverlayTransformOriginOn","ui-du-compact-crop-popover",3,"cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayViewportMargin","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayPositions"],["mat-icon-button","","data-testid","missing-value-create-value","type","button","color","primary",3,"disabled","matTooltip"],["data-testid","confirmation-checkbox","matTooltipPosition","above","matTooltipShowDelay","500",3,"change","matTooltip","checked","disabled","aria-label"],[1,"menu"],["direction","vert",3,"disableChange","disableRevert","displayRemove","displayTextDirection","displayReverseWords","shouldMarkAsMissingInsteadOfRemove","shouldAddInsteadOfChange","hotkeys"],["data-testid","crop-popover",3,"mouseenter","crops"],["mat-icon-button","","data-testid","missing-value-create-value","type","button","color","primary",3,"click","disabled","matTooltip"],["direction","vert",3,"change","revert","remove","textDirectionChange","reverseWords","stateChange","disableChange","disableRevert","displayRemove","displayTextDirection","displayReverseWords","shouldMarkAsMissingInsteadOfRemove","shouldAddInsteadOfChange","hotkeys"]],template:function(t,n){if(t&1){let o=y();pi(),V(0)(1),r(2,"div",2,0),g("cdkFocusChange",function(v){return p(o),_(n.onFocusChange(v))})("click",function(){return p(o),_(n.onClick())}),I(4,"ui-du-compact-value-indicators",3),r(5,"div",4),_i(6),d(),E(7,aa,2,6,null,5),E(8,ra,6,12,"button",6),V(9),x(10,"translate"),r(11,"mat-checkbox",7),x(12,"uiHotkeysComboDisplay"),g("change",function(v){return p(o),_(n.onConfirmationChange(v.checked))}),d(),r(13,"div",8),E(14,la,1,8,"ui-compact-actions-menu",9),d()()}if(t&2){let o,m,v=w(n.field());s();let S=w(n.value()),P=n.taxonomy(),D=n.confirmed();s(),le("is-selected",n.isSelected()),R("data-testid","value-shell"+(n.isSelected()?"_selected":"")),s(2),u("field",v)("taxonomy",P)("value",S)("valueIndex",n.rowIndex()),s(3),T(S&&((o=n.referenceCrops())!=null&&o.length)?7:-1),s(),T(!n.readonly()&&!S?8:-1);let O=M(10,18,n.checkboxTooltipKey());s(3),u("matTooltip",vi("",O," ",M(12,20,(m=n.markAsValidatedCheckboxShortcut())==null?null:m.combos)))("checked",D)("disabled",n.readonly()),He("aria-label",O),s(3),T(n.readonly()?-1:14)}},dependencies:[tt,Ni,Mi,Si,Je,mt,ji,ot,nt,ct,st,te,lt,Ye,Xe,W,An,Ln,kn,rt,rn],styles:[".compact-cell-shell[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;min-height:40px;cursor:pointer;margin:4px 0;padding:0 2px;border-radius:4px;outline:2px solid transparent;display:flex;align-items:center}.compact-cell-shell.is-selected[_ngcontent-%COMP%]{outline-color:var(--color-primary);--value-selected: 1}.compact-cell-shell[_ngcontent-%COMP%]:hover{--value-hovered: 1}.compact-cell-shell[_ngcontent-%COMP%] .menu[_ngcontent-%COMP%]{opacity:calc(var(--value-hovered, 0) + var(--value-selected, 0))}.compact-cell-shell[_ngcontent-%COMP%] .value-container[_ngcontent-%COMP%]{flex:1;overflow:hidden}"],changeDetection:0})}return i})()});function sa(i,c){i&1&&(r(0,"i",2),h(1,"VS_SIMPLE_FIELD_REMOVED_MESSAGE"),d())}function ca(i,c){i&1&&(r(0,"i",2),h(1,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE"),d())}function da(i,c){if(i&1&&(r(0,"div",1),E(1,sa,2,0,"i",2)(2,ca,2,0,"i",2),d()),i&2){let e=a(),t=f(0);s(),T(t.confirmationStatus===e.ConfirmationStatus.Confirmed?1:2)}}function ma(i,c){if(i&1){let e=y();r(0,"ui-du-compact-boolean-input",10),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("validationError",e.computedValidationError())}}function ua(i,c){if(i&1){let e=y();r(0,"ui-du-compact-set-input",11),g("panelOpenChange",function(n){p(e);let o=a(2);return _(o.panelOpen.set(n))})("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))}),d()}if(i&2){let e=a(2),t=f(1),n=f(2);u("value",t.value??"")("options",n.values)("validationError",e.computedValidationError())}}function pa(i,c){if(i&1){let e=y();r(0,"ui-du-compact-number-input",12),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("valueUniqueId",t.id)("derivedParts",t.derivedParts)("validationError",e.computedValidationError())("textDirection",e.textDirection())("decimalSeparator",e.docTypeMetadata().decimalSeparator)("thousandsSeparator",e.docTypeMetadata().thousandsSeparator)}}function _a(i,c){if(i&1){let e=y();r(0,"ui-du-compact-monetary-input",13),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))})("derivedPartsChange",function(n){p(e);let o=a(2);return _(o.onDerivedPartsChange(n,!0))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("valueUniqueId",t.id)("derivedParts",t.derivedParts)("validationError",e.computedValidationError())("textDirection",e.textDirection())("decimalSeparator",e.docTypeMetadata().decimalSeparator)("thousandsSeparator",e.docTypeMetadata().thousandsSeparator)}}function Ca(i,c){if(i&1){let e=y();r(0,"ui-du-compact-date-input",14),g("panelOpenChange",function(n){p(e);let o=a(2);return _(o.panelOpen.set(n))})("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))})("derivedPartsChange",function(n){p(e);let o=a(2);return _(o.onDerivedPartsChange(n))}),d()}if(i&2){let e=a(2),t=f(0),n=f(1);u("fieldId",t.id)("value",n.value??"")("valueUniqueId",n.id)("derivedParts",n.derivedParts)("validationError",e.computedValidationError())("textDirection",e.textDirection())("displayFormat",e.docTypeMetadata().dateDisplayFormat)}}function ha(i,c){if(i&1){let e=y();r(0,"ui-du-compact-address-input",15),g("panelOpenChange",function(n){p(e);let o=a(2);return _(o.panelOpen.set(n))})("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n,!0))})("derivedPartsChange",function(n){p(e);let o=a(2);return _(o.onDerivedPartsChange(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("valueUniqueId",t.id)("derivedParts",t.derivedParts)("validationError",e.computedValidationError())("maxRows",4)("textDirection",e.textDirection())}}function fa(i,c){if(i&1){let e=y();r(0,"ui-du-compact-name-input",16),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n,!0))})("derivedPartsChange",function(n){p(e);let o=a(2);return _(o.onDerivedPartsChange(n))})("panelOpenChange",function(n){p(e);let o=a(2);return _(o.panelOpen.set(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("valueUniqueId",t.id)("derivedParts",t.derivedParts)("validationError",e.computedValidationError())("maxRows",4)("textDirection",e.textDirection())}}function va(i,c){if(i&1){let e=y();r(0,"ui-du-compact-text-input",17),g("valueChange",function(n){p(e);let o=a(2);return _(o.onInputValueChanges(n))}),d()}if(i&2){let e=a(2),t=f(1);u("value",t.value??"")("validationError",e.computedValidationError())("maxRows",4)("textDirection",e.textDirection())}}function ga(i,c){if(i&1&&I(0,"ui-du-compact-validator-notes",9),i&2){a();let e=f(9),t=f(10);a();let n=f(0),o=f(1);u("fieldId",n.id)("valueId",o.id)("taxonomy",e)("notes",t)("appInReadonlyMode",!1)}}function xa(i,c){if(i&1&&(r(0,"div"),E(1,ma,1,2,"ui-du-compact-boolean-input",3)(2,ua,1,3,"ui-du-compact-set-input",4)(3,pa,1,7,"ui-du-compact-number-input",5)(4,_a,1,7,"ui-du-compact-monetary-input",5)(5,Ca,1,7,"ui-du-compact-date-input",6)(6,ha,1,6,"ui-du-compact-address-input",7)(7,fa,1,6,"ui-du-compact-name-input",7)(8,va,1,4,"ui-du-compact-text-input",8),d(),V(9)(10),E(11,ga,1,5,"ui-du-compact-validator-notes",9)),i&2){let e,t=a(),n=f(2);s(),T((e=n.contentType)===t.FieldType.Boolean?1:e===t.FieldType.Set?2:e===t.FieldType.Number?3:e===t.FieldType.MonetaryQuantity?4:e===t.FieldType.Date?5:e===t.FieldType.Address?6:e===t.FieldType.Name?7:8),s(8);let o=w(t.validatorNotesTaxonomy());s(),w(t.validatorNotes()),s(),T(o&&o.enabled&&o.level===t.ValidatorNotesLevel.Value?11:-1)}}var ro,lo=X(()=>{"use strict";z();$();Ct();ht();vt();Ro();Un();ei();z();$();ro=(()=>{class i{_taxonomyManagerService=l(wn);_extractionManagerService=l(ie);_derivedPartsService=l(Dn);_extractionValidationService=l(On);field=b.required();taxonomy=b.required();value=b.required();rowIndex=b.required();panelOpen=J(!1);textDirection=J("auto");docTypeMetadata=C(()=>this._extractionManagerService.documentTypeTaxonomy());computedValidationError=C(()=>this._extractionValidationService.invalidPrimaryValuesMap()[this.value()?.id??""]?.validationError??null);validatorNotesTaxonomy=C(()=>this._taxonomyManagerService.getById(this.field().fieldId)?.validatorNotes);validatorNotes=C(()=>this.validatorNotesTaxonomy()?.enabled?this.value()?.validatorNotes:void 0);ValidatorNotesLevel=_t;FieldType=pt;ConfirmationStatus=j;hasHistory=C(()=>!!this._extractionManagerService.historyMap()[this._valueOrFieldId()]?.history?.length);_valueOrFieldId=C(()=>this.value()?.id??this.field().id);onTextDirectionChange(e){this.textDirection.set(e)}onInputValueChanges(e,t=!1){let n=this.value();if(!n)return;let o=t,m=this.taxonomy(),v=L({},n);!e&&n.value!==n.unformattedValue?(v.value=n.unformattedValue,v.derivedParts=n.derivedParts.map(S=>ii(L({},S),{value:""})),o=!1):(v.value=this._derivedPartsService.convertFormattedValueToValue(m.contentType,e)??e,v.derivedParts=this._derivedPartsService.convertFormattedValueToDerivedParts(m.contentType,e),v.reference||(v.unformattedValue=e)),this._extractionManagerService.updateExtractedPrimaryValue(v,o,!0)}onDerivedPartsChange(e,t=!1){let n=this.value();if(!n)return;let o=L(L({},n),this._derivedPartsService.derivedPartsToValueUpdate(n,e));this._extractionManagerService.updateExtractedPrimaryValue(o,!1,t)}onRevertToPreviousValue(){this._extractionManagerService.restorePreviousValue(this.value()?.id??this.field().id)}onConfirmCell(){this._changeCellConfirmation(!0)}onUnconfirmCell(){this._changeCellConfirmation(!1)}onRemoveExtractedValue(){this._extractionManagerService.removeExtractedValues(this.field().id,[this.value()?.id??""])}_changeCellConfirmation(e){this._extractionManagerService.changeValueConfirmation(this._valueOrFieldId(),e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-cell"]],inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],value:[1,"value"],rowIndex:[1,"rowIndex"]},decls:6,vars:10,consts:[[3,"textDirectionChange","field","taxonomy","value","textDirection","rowIndex","positionCropHorizontally"],["data-testid","missing-cell-value",1,"missing-value"],["translate",""],[3,"value","validationError"],[3,"value","options","validationError"],[3,"value","valueUniqueId","derivedParts","validationError","textDirection","decimalSeparator","thousandsSeparator"],[3,"fieldId","value","valueUniqueId","derivedParts","validationError","textDirection","displayFormat"],[3,"value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],[3,"value","validationError","maxRows","textDirection"],["data-testid","validator-notes",1,"validator-notes",3,"fieldId","valueId","taxonomy","notes","appInReadonlyMode"],[3,"valueChange","value","validationError"],[3,"panelOpenChange","valueChange","value","options","validationError"],[3,"valueChange","value","valueUniqueId","derivedParts","validationError","textDirection","decimalSeparator","thousandsSeparator"],[3,"valueChange","derivedPartsChange","value","valueUniqueId","derivedParts","validationError","textDirection","decimalSeparator","thousandsSeparator"],[3,"panelOpenChange","valueChange","derivedPartsChange","fieldId","value","valueUniqueId","derivedParts","validationError","textDirection","displayFormat"],[3,"panelOpenChange","valueChange","derivedPartsChange","value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],[3,"valueChange","derivedPartsChange","panelOpenChange","value","valueUniqueId","derivedParts","validationError","maxRows","textDirection"],[3,"valueChange","value","validationError","maxRows","textDirection"]],template:function(t,n){if(t&1){let o=y();V(0)(1)(2),r(3,"ui-du-compact-cell-shell",0),g("textDirectionChange",function(v){return p(o),_(n.onTextDirectionChange(v))}),E(4,da,3,1,"div",1)(5,xa,12,4),d()}if(t&2){let o=w(n.field());s();let m=w(n.value());s(),w(n.taxonomy()),s(),u("field",o)("taxonomy",n.taxonomy())("value",m)("textDirection",n.textDirection())("rowIndex",n.rowIndex())("positionCropHorizontally",n.panelOpen()),s(),T(m?5:4)}},dependencies:[W,xe,Mt,Bn,Hn,Wn,jn,qn,Kn,Gn,$n,bt],styles:[".missing-value[_ngcontent-%COMP%]{display:flex;align-items:center}.missing-value[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{margin-left:auto}"],changeDetection:0})}return i})()});function ba(i,c){i&1&&(r(0,"i",2),h(1,"VS_SIMPLE_FIELD_REMOVED_MESSAGE"),d())}function ya(i,c){i&1&&(r(0,"i",2),h(1,"VS_SIMPLE_FIELD_NO_DATA_MESSAGE"),d())}function Sa(i,c){if(i&1&&(r(0,"div",1),E(1,ba,2,0,"i",2)(2,ya,2,0,"i",2),d()),i&2){let e=a(),t=f(0);s(),T(t.confirmationStatus===e.ConfirmationStatus.Confirmed?1:2)}}function Ma(i,c){if(i&1&&I(0,"ui-du-compact-validator-notes",4),i&2){a();let e=f(2),t=f(3);a();let n=f(0),o=f(1);u("fieldId",n.id)("valueId",o.id)("taxonomy",t)("notes",e)("appInReadonlyMode",!0)}}function Ea(i,c){if(i&1&&(r(0,"div",3),h(1),d(),V(2)(3),E(4,Ma,1,5,"ui-du-compact-validator-notes",4)),i&2){let e=a();s(),fe(" ",e.stringValue()," "),s(),w(e.validatorNotes()),s();let t=w(e.validatorNotesTaxonomy());s(),T(t&&t.enabled&&t.level===e.ValidatorNotesLevel.Value?4:-1)}}var so,co=X(()=>{"use strict";z();be();$();Ct();ht();Un();ei();z();$();so=(()=>{class i{field=b.required();taxonomy=b.required();value=b.required();rowIndex=b.required();TaxonomyDefinitionType=ce;ConfirmationStatus=j;validatorNotesTaxonomy=C(()=>{let e=this.taxonomy();if(e.type===ce.Field)return e.validatorNotes});validatorNotes=C(()=>this.validatorNotesTaxonomy()?.enabled?this.value()?.validatorNotes:void 0);ValidatorNotesLevel=_t;stringValue=C(()=>{let e=this.taxonomy(),t=this.value()?.value??"";return t?e.contentType===pt.Set?e.values.find(n=>n===t)??"":t:""});isMissing=C(()=>!this.value());static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-readonly-cell"]],inputs:{field:[1,"field"],taxonomy:[1,"taxonomy"],value:[1,"value"],rowIndex:[1,"rowIndex"]},decls:5,vars:8,consts:[[3,"field","taxonomy","value","readonly","rowIndex"],[1,"missing-value"],["translate",""],[1,"display-value"],["data-testid","validator-notes",1,"validator-notes",3,"fieldId","valueId","taxonomy","notes","appInReadonlyMode"]],template:function(t,n){if(t&1&&(V(0)(1),r(2,"ui-du-compact-cell-shell",0),E(3,Sa,3,1,"div",1)(4,Ea,5,4),d()),t&2){let o=w(n.field());s();let m=w(n.value());s(),u("field",o)("taxonomy",n.taxonomy())("value",m)("readonly",!0)("rowIndex",n.rowIndex()),s(),T(m?4:3)}},dependencies:[te,W,xe,Mt,bt],encapsulation:2,changeDetection:0})}return i})()});function Pa(i,c){if(i&1&&It(0,1),i&2){let e=c.$implicit,t=c.$index;a();let n=he(6);u("ngTemplateOutlet",n)("ngTemplateOutletContext",Ke(2,Ta,e,t))}}function Oa(i,c){if(i&1&&It(0,1),i&2){a();let e=he(6);u("ngTemplateOutlet",e)("ngTemplateOutletContext",Ne(2,wa,-1))}}function Ra(i,c){if(i&1&&I(0,"ui-du-compact-readonly-cell",2),i&2){let e=a().value,t=a(),n=f(0),o=f(1);u("field",n)("taxonomy",o)("value",e)("rowIndex",t.rowIndex())}}function Ia(i,c){if(i&1&&I(0,"ui-du-compact-cell",2),i&2){let e=a().value,t=a(),n=f(0),o=f(1);u("field",n)("taxonomy",o)("value",e)("rowIndex",t.rowIndex())}}function Va(i,c){if(i&1&&E(0,Ra,1,4,"ui-du-compact-readonly-cell",2)(1,Ia,1,4,"ui-du-compact-cell",2),i&2){let e=a();T(e.isReadonly()?0:1)}}var Ta,wa,Da,mo,uo=X(()=>{"use strict";yi();z();be();$();Ct();vt();lo();co();z();yi();Ta=(i,c)=>({value:i,index:c}),wa=i=>({value:null,index:i}),Da=(i,c)=>c.id;mo=(()=>{class i{_extractionManagerService=l(ie);isReadonly=b.required();fieldId=b.required();taxonomy=b.required();field=C(()=>this._extractionManagerService.getById(this.fieldId()));rowIndex=b.required();values=C(()=>this.field().valueIds.map(e=>this._extractionManagerService.getById(e)));TaxonomyDefinitionType=ce;constructor(){B(()=>{let e=this.field();this._extractionManagerService.selectedValueId()===e.id&&e.valueIds.length&&this._extractionManagerService.setSelectedValue(e.valueIds[0])})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-cell-field"]],inputs:{isReadonly:[1,"isReadonly"],fieldId:[1,"fieldId"],taxonomy:[1,"taxonomy"],rowIndex:[1,"rowIndex"]},decls:7,vars:3,consts:[["valueTemplate",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"field","taxonomy","value","rowIndex"]],template:function(t,n){t&1&&(V(0)(1),Ie(2,Pa,1,5,"ng-container",1,Da,!1,Oa,1,4,"ng-container",1),H(5,Va,2,1,"ng-template",null,0,$e)),t&2&&(w(n.field()),s(),w(n.taxonomy()),s(),Ve(n.values()))},dependencies:[bi,xi,te,W,so,ro],encapsulation:2,changeDetection:0})}return i})()});function ka(i,c){if(i&1&&(r(0,"th",27)(1,"div",28),I(2,"ui-du-shared-field-hotkey-button",29),r(3,"span"),h(4),d()()()),i&2){let e=a(),t=e.$implicit,n=e.$index,o=f(1);Vt(zt("mat-column-",t.name.toLowerCase())),u("matResizableMinWidthPx",o),R("data-testid","header-cell_"+n),s(2),u("disabled",!0)("disableInteraction",!0)("fieldId",t.id)("color",t.color)("hotkey",""),s(2),U(t.name)}}function Aa(i,c){if(i&1&&(r(0,"td",30),I(1,"ui-du-compact-cell-field",31),x(2,"toAbsoluteRowIndex"),d()),i&2){let e,t=c.$implicit,n=c.dataIndex,o=a(),m=o.$implicit,v=o.$index,S=a();Vt(zt("mat-column-",m.contentType.toLowerCase())),le("selected",((e=S.selectedCell())==null?null:e.id)===t.id)("missing",!t.valueIds.length)("confirmed",t.confirmationStatus===S.ConfirmationStatus.Confirmed);let P=t.valueIds[v];s(),u("fieldId",P)("taxonomy",m)("isReadonly",S.readonly())("rowIndex",Le(2,14,n,S.pageIndex(),S.pageSize())),R("data-testid","table-cell_"+v)}}function Ua(i,c){if(i&1&&(r(0,"div",6),V(1),H(2,ka,5,11,"th",25)(3,Aa,3,18,"td",26),d()),i&2){let e=c.$implicit;u("matColumnDef",e.id),s(),w(e.contentType==="Set"?300:270)}}function Ba(i,c){if(i&1){let e=y();r(0,"button",37),g("click",function(){p(e);let n=a(2);return _(n.toggleEntireTableSelection())}),r(1,"mat-icon",38),h(2," photo_size_select_small"),d(),r(3,"span"),h(4),x(5,"translate"),d()()}if(i&2){let e=a(2),t=f(9);u("disabled",e.isDrawingTableSelectionCells()||t),s(),u("color",e.extractTableIconColor()),s(3),U(M(5,3,"VS_TABLE_EXTRACT_NEW_TABLE"))}}function Ha(i,c){if(i&1){let e=y();r(0,"button",39),g("click",function(){p(e);let n=a(2);return _(n.deleteAllRows())}),r(1,"mat-icon"),h(2,"delete_forever"),d(),r(3,"span"),h(4),x(5,"translate"),d()()}if(i&2){a(2);let e=f(0);u("disabled",e),s(4),U(M(5,2,"VS_TABLE_DELETE_ALL_ROWS"))}}function Wa(i,c){if(i&1){let e=y();r(0,"th",32)(1,"button",33),x(2,"translate"),r(3,"mat-icon"),h(4,"more_vert"),d()(),r(5,"mat-menu",null,1),E(7,Ba,6,5,"button",34),r(8,"button",35),g("click",function(){p(e);let n=a();return _(n.highlightTable())}),r(9,"mat-icon"),h(10,"table_chart"),d(),r(11,"span"),h(12),x(13,"translate"),d()(),E(14,Ha,6,4,"button",36),d()()}if(i&2){let e=he(6),t=a();s(),u("matMenuTriggerFor",e),R("aria-label",M(2,5,"A11Y_MORE_MENU")),s(6),T(t.readonly()?-1:7),s(5),U(M(13,7,"VS_TABLE_HIGHLIGHT_TABLE")),s(2),T(t.readonly()?-1:14)}}function ja(i,c){if(i&1){let e=y();r(0,"button",45),g("click",function(){p(e);let n=a().dataIndex,o=a();return _(o.toggleRowsSelection(n))}),r(1,"mat-icon",38),h(2," photo_size_select_small"),d(),r(3,"span"),h(4),x(5,"translate"),d()(),r(6,"button",46),g("click",function(){p(e);let n=a().dataIndex,o=a();return _(o.addNewRow(n))}),r(7,"mat-icon"),h(8,"vertical_align_top"),d(),r(9,"span"),h(10),x(11,"translate"),d()(),r(12,"button",47),g("click",function(){p(e);let n=a().dataIndex,o=a();return _(o.addNewRow(n+1))}),r(13,"mat-icon"),h(14,"vertical_align_bottom"),d(),r(15,"span"),h(16),x(17,"translate"),d()(),r(18,"button",48),g("click",function(){p(e);let n=a().$implicit,o=a();return _(o.deleteRow(n.id))}),r(19,"mat-icon"),h(20,"delete"),d(),r(21,"span"),h(22),x(23,"translate"),d()()}if(i&2){let e=a(2),t=f(9);u("disabled",e.isDrawingTableSelectionCells()||t),s(),u("color",e.extractTableIconColor()),s(3),U(M(5,6,"VS_TABLE_EXTRACT_TABLE_HERE")),s(6),U(M(11,8,"VS_TABLE_ADD_ROW_ABOVE")),s(6),U(M(17,10,"VS_TABLE_ADD_ROW_BELOW")),s(6),U(M(23,12,"VS_TABLE_DELETE_ROW"))}}function qa(i,c){if(i&1){let e=y();r(0,"td",40)(1,"div",41)(2,"button",42),x(3,"translate"),r(4,"mat-icon"),h(5,"more_vert"),d()(),r(6,"mat-menu",null,2)(8,"button",43),g("click",function(){let n=p(e).$implicit,o=a();return _(o.highlightRow(n))}),r(9,"mat-icon"),h(10,"select_all"),d(),r(11,"span"),h(12),x(13,"translate"),d()(),E(14,ja,24,14),d(),r(15,"mat-checkbox",44),x(16,"translate"),x(17,"translate"),g("change",function(n){let o=p(e).$implicit,m=a();return _(m.setRowConfirmedStatus(o,n))})("click",function(n){return p(e),_(n.stopPropagation())}),d()()()}if(i&2){let e=c.$implicit,t=he(7),n=a();s(2),u("matMenuTriggerFor",t),R("aria-label",M(3,10,"VS_TABLE_FIELD_CONFIRM_IS_MISSING_TOOLTIP")),s(10),U(M(13,12,"VS_TABLE_HIGHLIGHT_ROW")),s(2),T(n.readonly()?-1:14),s(),u("matTooltip",Ge(M(16,14,"VS_ROW_CONFIRM_TOOLTIP"))),He("aria-label",M(17,16,"VS_ROW_CONFIRM_TOOLTIP")),u("checked",e.confirmationStatus===n.ConfirmationStatus.Confirmed)("indeterminate",e.confirmationStatus===n.ConfirmationStatus.PartiallyConfirmed)("disabled",n.readonly())}}function Ga(i,c){if(i&1){let e=y();r(0,"td",40)(1,"button",49),x(2,"translate"),x(3,"translate"),g("click",function(){let n=p(e).dataIndex,o=a();return _(o.addNewRow(n))}),r(4,"mat-icon"),h(5,"add_box"),d()()()}if(i&2){a();let e=f(1);R("colspan",e.length),s(),u("matTooltip",M(2,3,"VS_TABLE_INLINE_ADD_ROW_BUTTON_TOOLTIP")),R("aria-label",M(3,5,"VS_TABLE_INLINE_ADD_ROW_BUTTON_TOOLTIP"))}}function Ka(i,c){if(i&1){let e=y();r(0,"td",40)(1,"button",49),x(2,"translate"),x(3,"translate"),g("click",function(){let n=p(e).dataIndex,o=a();return _(o.addNewRow(n+1))}),r(4,"mat-icon"),h(5,"add_box"),d()()()}if(i&2){a();let e=f(1);R("colspan",e.length),s(),u("matTooltip",M(2,3,"VS_TABLE_INLINE_ADD_ROW_BUTTON_TOOLTIP")),R("aria-label",M(3,5,"VS_TABLE_INLINE_ADD_ROW_BUTTON_TOOLTIP"))}}function $a(i,c){i&1&&I(0,"tr",50)}function Za(i,c){if(i&1&&(I(0,"tr",51),x(1,"toAbsoluteRowIndex")),i&2){let e=c.dataIndex,t=a();le("hide",t.readonly()),R("data-testid","add-table-row_above-row_"+Le(1,3,e,t.pageIndex(),t.pageSize()))}}function Xa(i,c){if(i&1&&(I(0,"tr",52),x(1,"toAbsoluteRowIndex")),i&2){let e,t=c.$implicit,n=c.dataIndex,o=a();le("row-selected",t.id===((e=o.selectedTableRow())==null?null:e.id)),R("data-testid","table-row_"+Le(1,3,n,o.pageIndex(),o.pageSize()))}}function Ya(i,c){if(i&1&&(I(0,"tr",53),x(1,"toAbsoluteRowIndex")),i&2){let e=c.dataIndex,t=a();le("hide",t.readonly()),R("data-testid","add-table-row_below-row_"+Le(1,3,e,t.pageIndex(),t.pageSize()))}}function Qa(i,c){if(i&1){let e=y();r(0,"div",16),h(1),x(2,"translate"),r(3,"button",54),g("click",function(){p(e);let n=a();return _(n.addNewRow(0))}),r(4,"mat-icon"),h(5,"add_circle_outline"),d()()()}i&2&&(s(),fe(" ",M(2,1,"VS_TABLE_ADD_FIRST_ROW_MESSAGE")," "))}function Ja(i,c){if(i&1){let e=y();r(0,"section",19)(1,"label",20),h(2,"VS_TABLE_PAGE"),d(),r(3,"ui-navigator",55),g("changePageIndex",function(n){p(e);let o=a();return _(o.goToPage(n))}),d()()}if(i&2){let e=a();s(3),u("currentPageIndex",e.pageIndex())("maxPageIndex",e.totalPages()-1)("totalPagesToLoad",e.totalPages())}}function er(i,c){if(i&1&&(r(0,"mat-option",22),h(1),d()),i&2){let e=c.$implicit;u("value",e),R("data-testid","rows-per-page-option_"+e),s(),U(e)}}function tr(i,c){i&1&&(r(0,"div",56),h(1,"VS_TABLE_ALL_CELLS_ARE_VALID_AND_CONFIRMED_MESSAGE"),d())}function ir(i,c){if(i&1){let e=y();r(0,"button",59),x(1,"translate"),g("click",function(){p(e);let n=a(3);return _(n.goToFirstInvalidCell())}),h(2),x(3,"translate"),d()}if(i&2){a(2);let e=f(0);u("matTooltip",Ge(Ft(1,3,"VS_TABLE_CHECK_NEXT_INVALID_CELL_BUTTON_TOOLTIP",Ne(9,po,e)))),s(2),fe(" ",Ft(3,6,e===1?"VS_TABLE_CHECK_NEXT_INVALID_CELL_BUTTON.singular":"VS_TABLE_CHECK_NEXT_INVALID_CELL_BUTTON.plural",Ne(11,po,e))," ")}}function nr(i,c){i&1&&(r(0,"div",56),h(1,"VS_TABLE_NO_INVALID_CELLS_MESSAGE"),d())}function or(i,c){if(i&1){let e=y();r(0,"ui-button-group",60),g("clickActionButton",function(n){p(e);let o=a(3);return _(o.handleConfirmationButtonClick(n.id))}),d()}if(i&2){let e=a(3);u("type",e.ButtonGroupType.Secondary)("options",e.confirmationButtonGroupOptions())}}function ar(i,c){i&1&&(r(0,"div",56),h(1,"VS_TABLE_NO_UNCONFIRMED_CELLS_MESSAGE"),d())}function rr(i,c){if(i&1&&(E(0,ir,4,13,"button",57)(1,nr,2,0,"div",56),E(2,or,1,2,"ui-button-group",58)(3,ar,2,0,"div",56)),i&2){a();let e=f(0),t=f(1);T(e>0?0:1),s(2),T(t>0?2:3)}}function lr(i,c){if(i&1&&(V(0)(1),E(2,tr,2,0,"div",56)(3,rr,4,2)),i&2){let e=a(),t=w(e.invalidCells().length);s();let n=w(e.unconfirmedCells().length);s(),T(t===0&&n===0?2:3)}}var za,Fa,Na,po,La,sr,Ps,cr=X(()=>{Ut();z();Bi();Qe();be();go();dt();Bt();Zi();Sn();at();Qt();$();Mo();To();Eo();ht();vt();cn();So();Ji();Pt();Po();Vn();Do();uo();z();Bi();Ut();$();Sn();Bt();dt();Zi();be();at();Qe();Qt();za=["tableContent"],Fa=()=>["before"],Na=()=>["after"],po=i=>({numberOfInvalidCells:i}),La=(i,c)=>c.id;sr=(()=>{class i{transform(e,t,n){return e+t*n}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=ci({name:"toAbsoluteRowIndex",type:i,pure:!0})}return i})(),Ps=(()=>{class i{_translateService=l(Li);_extractionManagerService=l(ie);_configurationsManagerService=l(ft);_userPreferencesService=l(en);_vsKeyboardShortcutsService=l(xt);_bridgeService=l(gt);_rootNodeService=l(ut);_elementRef=l(K);_tableService=l(Nn);field=b.required();readonly=b(!1);isTableSelectionEnabled=b(!1);isDrawingTableSelectionCells=b(!1);_matColumnResizeDirective=ve(ke);_tableContent=ve.required("tableContent");tableSelectionEvent=Ze();fieldId=C(()=>this.field().id);selectedCell=this._tableService.selectedCell;selectedTableRow=this._tableService.selectedRow;isPdfTextViewActive=this._bridgeService.pdfViewerTextMode;ConfirmationStatus=j;ButtonGroupType=ln;paginationValues=[5,10,15];columnTaxonomies=this._tableService.columnTaxonomies;columnIdsWithActions=C(()=>this.columnTaxonomies().map(e=>e.id).concat(["actions"]));columnSizes=C(()=>this.columnIdsWithActions().map(e=>this._userPreferencesService.get(this._getColumnSizePreferenceKey(e),Lt)||140));tableDataSource=this._tableService.paginatedDataSource;hasRows=this._tableService.hasRows;pageSize=this._tableService.rowsPerPage;pageIndex=this._tableService.pageIndex;totalPages=this._tableService.totalPages;invalidCells=this._tableService.invalidCells;unconfirmedCells=this._tableService.unconfirmedCells;extractTableIconColor=C(()=>this.isTableSelectionEnabled()&&!se(this._tableService.tableSelectionAppendFromRowIndex())?"primary":null);confirmationButtonGroupOptions=C(()=>{let e=this.unconfirmedCells().length,t=this.invalidCells().length;return[{id:qt.NextUnconfirmedCell,text:this._translateService.instant(e===1?"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.singular":"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.plural",{numberOfUnconfirmedCells:e}),description:this._translateService.instant("VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON_TOOLTIP",{numberOfUnconfirmedCells:e})},{id:qt.ConfirmAllCells,text:this._translateService.instant("VS_TABLE_CONFIRM_ALL_CELLS_BUTTON"),disabled:t>0}]});_editReferenceCapabilities=C(()=>{let e=this._tableService.selectedTableValue()?.fieldId;return e?this._configurationsManagerService.getFieldCustomization(e).referenceEditModes:[]});_runResizing=J(!1);constructor(){B(e=>{let t=this._matColumnResizeDirective()?.columnResizeNotifier;if(!t)return;if(this._runResizing())for(let o of this._tableService.columnTaxonomies()){let m=this._userPreferencesService.get(this._getColumnSizePreferenceKey(o.id),Lt);m&&t.resize(o.id,m)}let n=t.resizeCompleted.subscribe(o=>{this._userPreferencesService.save(this._getColumnSizePreferenceKey(o.columnId),o.size)});e(()=>n.unsubscribe())}),B(e=>{let t=this._registerHotkeys();e(()=>t?.unsubscribe())}),B(()=>{this._extractionManagerService.selectedValueId()===this.fieldId()&&this._tableContent()&&this._tableContent().nativeElement.focus()})}ngOnInit(){setTimeout(()=>{this._runResizing.set(!0)},100)}goToPage(e){this._tableService.pageIndex.set(e)}goToFirstInvalidCell(){this._tableService.goToFirstInvalidCell()}handleConfirmationButtonClick(e){this._tableService.handleConfirmationButtonClick(e)}setRowConfirmedStatus(e,t){this._tableService.setRowConfirmedStatus(e,t.checked?j.Confirmed:j.NotConfirmed)}setRowsPerPage(e){this._tableService.setRowsPerPage(e)}highlightRow(e){this._bridgeService.activeHighlight([e.id])}addNewRow(e){this.readonly()||this._tableService.addNewRow(e)}deleteRow(e){this._extractionManagerService.removeExtractedValues(this.fieldId(),[e])}deleteAllRows(){this._extractionManagerService.removeExtractedValues(this.fieldId(),this.field().valueIds)}highlightTable(){this._bridgeService.activeHighlight(this.field().valueIds)}toggleEntireTableSelection(){let e=this._tableService.tableSelectionAppendFromRowIndex()!==void 0;this._toggleTableSelection({forceStart:e,fromRow:void 0})}toggleRowsSelection(e){let t=this._tableService.getPaginatedRowIndex(e),n=this._tableService.tableSelectionAppendFromRowIndex(),o=n===void 0,m=!o&&n!==t;this._toggleTableSelection({forceStart:o||m,fromRow:t})}onDismiss(){this._dismissTable()}onValidate(){this._tableService.goToFirstInvalidCell()}tableTrackBy(e,t){return t.id}_toggleTableSelection(e){if(!this.isTableSelectionEnabled()||e.forceStart){this.tableSelectionEvent.emit(this._createTableSelectionInput({appendRows:e.fromRow!==void 0})),this._tableService.tableSelectionAppendFromRowIndex.set(e.fromRow),setTimeout(()=>this._bridgeService.focusPdfViewer$.next(!0));return}this.tableSelectionEvent.emit(null),this._tableService.tableSelectionAppendFromRowIndex.set(void 0)}_createTableSelectionInput(e){return{canExtractHeaders:!1,columnNames:this._tableService.columnTaxonomies().map(t=>t.name),appendRows:e.appendRows,tokensRequired:!this._editReferenceCapabilities().includes(En.area)}}_dismissTable(){let e=this._tableService.selectedTableId();e&&this._extractionManagerService.setSelectedValue(e),this.tableSelectionEvent.emit(null),this._tableService.isTableEditorVisible.set(!1)}_isFocusWithinTheTable(){let e=this._rootNodeService.getRootNode(this._elementRef.nativeElement).activeElement;return!!e&&!!this._elementRef.nativeElement.contains(e)}_registerHotkeys(){let e=new ni,t=this._vsKeyboardShortcutsService.table()?.moveToRightCell,n=this._vsKeyboardShortcutsService.table()?.moveToLeftCell,o=this._vsKeyboardShortcutsService.table()?.moveToUpCell,m=this._vsKeyboardShortcutsService.table()?.moveToDownCell,v=[t,n,o,m].filter(se);e.add(this._vsKeyboardShortcutsService.listen$(v,this._elementRef.nativeElement).pipe(Y(()=>this._isFocusWithinTheTable())).subscribe(_e=>{switch(_e.nativeEvent.preventDefault(),_e.shortcut){case t:this._tableService.moveCellPosition("Right");break;case n:this._tableService.moveCellPosition("Left");break;case o:this._tableService.moveCellPosition("Up");break;case m:this._tableService.moveCellPosition("Down");break}}));let S=this._vsKeyboardShortcutsService.table()?.closeTableEditor,P=this._vsKeyboardShortcutsService.table()?.startTableSelection,D=this._vsKeyboardShortcutsService.table()?.goToFirstInvalidCell,O=this._vsKeyboardShortcutsService.table()?.goToFirstUnconfirmedCell,F=[S,P,D,O].filter(se);return e.add(this._vsKeyboardShortcutsService.listen$(F).subscribe(_e=>{switch(_e.shortcut){case S:this._dismissTable();break;case P:this.toggleEntireTableSelection();break;case D:this._tableService.goToFirstInvalidCell();break;case O:this._tableService.goToFirstUnconfirmedCell();break}})),e}_getColumnSizePreferenceKey(e){return`ui-du-vs.column-size_${e}`}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=k({type:i,selectors:[["ui-du-compact-table-editor"]],viewQuery:function(t,n){t&1&&(Ce(n._matColumnResizeDirective,ke,5),Ce(n._tableContent,za,5)),t&2&&qe(2)},inputs:{field:[1,"field"],readonly:[1,"readonly"],isTableSelectionEnabled:[1,"isTableSelectionEnabled"],isDrawingTableSelectionCells:[1,"isDrawingTableSelectionCells"]},outputs:{tableSelectionEvent:"tableSelectionEvent"},features:[ze([...Fn])],decls:36,vars:23,consts:[["tableContent",""],["headerMenu",""],["bodyMenu",""],[1,"ui-compact-table"],["cdkScrollable","","data-testid","compact-table-form","tabindex","0",1,"table-form",3,"submit"],["mat-table","","multiTemplateDataRows","","columnResize","",3,"dataSource","trackBy"],[3,"matColumnDef"],["matColumnDef","actions","stickyEnd",""],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","before"],["matColumnDef","after"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","","uiKeydownStopEventPropagation","","class","row-add before",3,"hide",4,"matRowDef","matRowDefColumns"],["mat-row","",3,"row-selected",4,"matRowDef","matRowDefColumns"],["mat-row","","uiKeydownStopEventPropagation","","class","row-add after",3,"hide",4,"matRowDef","matRowDefColumns"],[1,"empty-table"],["data-testid","table-editor-footer",1,"footer"],[1,"left-pagination"],[1,"pagination-field"],["translate","",1,"pagination-label"],["data-testid","select-rows-per-page",1,"pagination-control","no-form-field-wrapper",3,"selectionChange","value"],[3,"value"],[1,"right-buttons"],["mat-stroked-button","","color","secondary","data-testid","dismiss-button",3,"click","matTooltip"],["mat-header-cell","","resizable","",3,"class","matResizableMinWidthPx",4,"matHeaderCellDef"],["mat-cell","","valign","top",3,"class","selected","missing","confirmed",4,"matCellDef"],["mat-header-cell","","resizable","",3,"matResizableMinWidthPx"],[1,"table-header-cell-contents"],[3,"disabled","disableInteraction","fieldId","color","hotkey"],["mat-cell","","valign","top"],[3,"fieldId","taxonomy","isReadonly","rowIndex"],["mat-header-cell",""],["mat-icon-button","","data-testid","table-header-menu",3,"matMenuTriggerFor"],["mat-menu-item","","data-testid","toggle-table-selection-mode",3,"disabled"],["mat-menu-item","","data-testid","highlight-table",3,"click"],["mat-menu-item","","data-testid","delete-all-rows",3,"disabled"],["mat-menu-item","","data-testid","toggle-table-selection-mode",3,"click","disabled"],[3,"color"],["mat-menu-item","","data-testid","delete-all-rows",3,"click","disabled"],["mat-cell",""],[1,"column-actions-container"],["mat-icon-button","","data-testid","table-body-menu",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["data-testid","table-row-confirmed-checkbox","tabindex","-1",1,"row-confirm-checkbox",3,"change","click","matTooltip","aria-label","checked","indeterminate","disabled"],["mat-menu-item","","data-testid","extract-rows-from-here",3,"click","disabled"],["mat-menu-item","","data-testid","insert-row-above",3,"click"],["mat-menu-item","","data-testid","insert-row-below",3,"click"],["mat-menu-item","","data-testid","delete-row",3,"click"],["color","primary","mat-mini-fab","","uiKeydownStopEventPropagation","","data-testid","insert-row-button",3,"click","matTooltip"],["mat-header-row",""],["mat-row","","uiKeydownStopEventPropagation","",1,"row-add","before"],["mat-row",""],["mat-row","","uiKeydownStopEventPropagation","",1,"row-add","after"],["mat-icon-button","","data-testid","add-first-row","uiKeydownStopEventPropagation","",3,"click"],[1,"pagination-control",3,"changePageIndex","currentPageIndex","maxPageIndex","totalPagesToLoad"],["translate",""],["mat-stroked-button","","color","warn","data-testid","next-invalid-cell-button",3,"matTooltip"],["data-testid","unconfirmed-cells-button-group",3,"type","options"],["mat-stroked-button","","color","warn","data-testid","next-invalid-cell-button",3,"click","matTooltip"],["data-testid","unconfirmed-cells-button-group",3,"clickActionButton","type","options"]],template:function(t,n){if(t&1){let o=y();V(0)(1),r(2,"div",3)(3,"form",4,0),g("submit",function(v){return p(o),_(v.preventDefault())}),r(5,"table",5),Ie(6,Ua,4,2,"div",6,La),We(8,7),V(9),H(10,Wa,15,9,"th",8)(11,qa,18,18,"td",9),je(),We(12,10),H(13,Ga,6,7,"td",9),je(),We(14,11),H(15,Ka,6,7,"td",9),je(),H(16,$a,1,0,"tr",12)(17,Za,2,7,"tr",13)(18,Xa,2,7,"tr",14)(19,Ya,2,7,"tr",15),d(),E(20,Qa,6,3,"div",16),d(),r(21,"div",17)(22,"div",18),E(23,Ja,4,3,"section",19),r(24,"section",19)(25,"label",20),h(26,"VS_TABLE_ROWS_PER_PAGE"),d(),r(27,"mat-select",21),g("selectionChange",function(v){return p(o),_(n.setRowsPerPage(v.value))}),Ie(28,er,2,3,"mat-option",22,mi),d()()(),r(30,"div",23),E(31,lr,4,3),r(32,"button",24),x(33,"translate"),g("click",function(){return p(o),_(n.onDismiss())}),h(34),x(35,"translate"),d()()()()}if(t&2){let o=w(!n.hasRows()),m=n.tableDataSource();s();let v=w(n.columnTaxonomies()),S=n.columnIdsWithActions();s(4),u("dataSource",m)("trackBy",n.tableTrackBy),s(),Ve(v),s(3),w(n.isPdfTextViewActive()),s(7),u("matHeaderRowDef",S)("matHeaderRowDefSticky",!0),s(),u("matRowDefColumns",Fe(21,Fa)),s(),u("matRowDefColumns",S),s(),u("matRowDefColumns",Fe(22,Na)),s(),T(o&&!n.readonly()?20:-1),s(3),T(o?-1:23),s(4),u("value",n.pageSize()),s(),Ve(n.paginationValues),s(3),T(!n.readonly()&&!o?31:-1),s(),u("matTooltip",Ge(M(33,17,"VS_TABLE_CLOSE_TOOLTIP"))),s(2),fe(" ",M(35,19,"VS_TABLE_CLOSE_BUTTON")," ")}},dependencies:[Ui,Ai,ki,Je,Ri,W,xe,yn,un,_n,vn,Cn,pn,gn,hn,fn,xn,bn,mt,Yi,Xi,Qi,ct,st,Hi,$i,Ki,Wi,te,lt,ot,nt,Ye,wi,Di,Xe,ao,ke,oo,dn,sn,Mn,tn,Rn,mo,rt,sr],styles:['.ui-compact-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:auto;margin:2px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%]:focus-visible{border-radius:4px;outline:solid 2px var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%]{width:100%}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-row[_ngcontent-%COMP%]{height:auto}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%]{height:0px;position:relative}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add.hide[_ngcontent-%COMP%]{display:none}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{border:0 none;background-color:transparent;position:absolute;height:14px;width:100%;top:-8px;z-index:105!important}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:before{content:"";position:absolute;left:0;right:0;top:50%;height:2px;transition:background-color .2s;background-color:transparent}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%] .mat-mdc-mini-fab[_ngcontent-%COMP%]{opacity:0;position:sticky;left:0;margin-left:-4px;margin-top:-5px;transition:opacity .2s;z-index:105;width:24px!important;height:24px!important;padding:0!important;display:inline-flex;align-items:center;justify-content:center}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%] .mat-mdc-mini-fab[_ngcontent-%COMP%] > *[role=img][_ngcontent-%COMP%]{height:16px;width:16px;font-size:16px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%] .mat-mdc-mini-fab[_ngcontent-%COMP%] > *[role=img][_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px;height:16px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%] .mat-mdc-mini-fab[_ngcontent-%COMP%] .mat-mdc-button-touch-target[_ngcontent-%COMP%]{width:24px!important;height:24px!important}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:hover:before, .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:focus-within:before{background-color:var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:hover .mat-mdc-button-base[_ngcontent-%COMP%], .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row.row-add[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:focus-within .mat-mdc-button-base[_ngcontent-%COMP%]{opacity:1}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%], .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{overflow:visible;padding:0 4px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell.mat-column-actions[_ngcontent-%COMP%], .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell.mat-column-actions[_ngcontent-%COMP%]{width:91px;padding:0 4px;border-left:1px solid var(--mat-table-row-item-outline-color)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell.mat-column-actions[_ngcontent-%COMP%] .column-actions-container[_ngcontent-%COMP%], .ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell.mat-column-actions[_ngcontent-%COMP%] .column-actions-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%]{background:var(--color-background-secondary);z-index:105!important}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-header-cell[_ngcontent-%COMP%] .table-header-cell-contents[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:center}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]{cursor:pointer;background:var(--color-background);vertical-align:middle}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .empty-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding-top:30px}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .row-selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-top:2px solid var(--color-primary);border-bottom:2px solid var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .row-selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{border-left:2px solid var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .row-selected[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:last-child{border-right:2px solid var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .table-form[_ngcontent-%COMP%] .row-selected[_ngcontent-%COMP%] td.mat-column-actions[_ngcontent-%COMP%]{border-right:2px solid var(--color-primary)}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{box-sizing:border-box;display:flex;flex-wrap:wrap;gap:8px;padding:10px;border-top:1px solid var(--mat-table-row-item-outline-color)}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .left-pagination[_ngcontent-%COMP%]{display:flex;flex-shrink:0;align-items:center;gap:20px}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .left-pagination[_ngcontent-%COMP%] .pagination-field[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;gap:8px;height:100%}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .left-pagination[_ngcontent-%COMP%] .pagination-field[_ngcontent-%COMP%] .pagination-label[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-weight:400;line-height:20px}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .left-pagination[_ngcontent-%COMP%] .pagination-field[_ngcontent-%COMP%] .pagination-control[_ngcontent-%COMP%]{min-width:45px}.ui-compact-table[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%] .right-buttons[_ngcontent-%COMP%]{margin-left:auto;display:flex;flex-shrink:0;align-items:center;gap:12px}'],changeDetection:0})}return i})()});cr();export{sr as ToAbsoluteRowIndexPipe,Ps as UiCompactTableEditorComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as g,$a as r,$e as ri,A as st,Ab as s,Af as Je,Ak as Rn,Bb as y,Bf as Ze,Cb as v,Cf as fi,Ci as ki,D as At,De as Qe,Df as _i,Eb as $t,Ee as ae,Ef as hi,Fa as M,Fb as Ht,Ff as Ci,Gb as Ne,Ha as Lt,Hb as $e,He as ye,Hf as gi,Ib as qt,Ie as re,Ja as X,Jc as jt,Je as le,Jk as Qi,Kk as Vn,Mf as xi,Mk as it,Nd as Se,Ni as Sn,Nk as ji,O as dt,Od as Te,Oe as ei,Pc as Xt,Pd as Ee,Pe as je,Qi as he,R as Fe,Ra as k,Re as se,Ri as ht,Sb as _,Se as de,Ta as u,Tb as h,Te as ce,U as un,Ue as ti,Va as f,Vc as fn,Vf as vi,We as hn,Wi as me,Wj as zi,X as Ce,Xa as De,Xe as ii,Xi as Ct,Ya as L,Ye as ni,Za as z,Zb as E,Ze as oi,_a as C,_b as Gt,_e as ai,_i as gt,_j as En,ab as l,af as li,al as nt,ba as R,bb as Ue,bi as Vi,bk as $i,bl as Xi,c as Ft,ca as V,cc as He,ci as Cn,cl as Me,d as Dt,dc as mt,dl as bt,ee as Yt,ei as Oi,ej as Li,el as we,fd as qe,fi as Fi,fl as St,ga as Pt,ge as N,gi as gn,gk as yn,gl as Wi,hc as Qt,hd as Wt,hk as Hi,hl as On,ia as ge,ib as U,id as _n,ik as In,jk as xt,ka as Bt,ke as Kt,kg as bi,l as rt,la as xe,lb as b,lc as S,le as G,lf as si,lh as Mi,li as Di,lk as H,ma as ve,mb as x,mc as $,mf as di,mg as Si,mk as Pe,na as kt,nd as Ge,nf as ci,ni as Ui,o as lt,of as pi,oi as Ni,pc as J,pd as ee,pf as Ie,qb as W,qd as te,qe as Jt,qg as Ti,qh as et,rb as Y,re as ie,rf as ut,rg as Ei,rh as wi,sa as a,sb as K,sf as ft,sg as yi,sh as Ri,si as xn,tc as Z,te as Zt,tf as pe,tg as Ii,ti as vn,tk as vt,ua as D,ub as ct,uc as q,uf as Xe,ui as Ai,vb as zt,ve as ne,vf as We,vi as bn,w as Ut,wb as pt,wf as Ye,wh as Ae,wi as Pi,wk as Mn,xf as mi,xh as _t,xi as Bi,xk as qi,yb as T,ye as oe,yf as ui,yh as tt,yj as Tn,yk as wn,z as Nt,zb as be,ze as Q,zf as Ke,zk as Gi}from"./chunk-TYL6NO3L.js";import{a as Vt,b as Ot,f as F}from"./chunk-3ONYU5UZ.js";var zo,Fn=F(()=>{"use strict";gt();S();zo=(()=>{class n{unconfirmedRegularValues(e){if(!e)return 0;let{total:i,confirmed:t}=this._countConfirmedValuesForFields(e.fields.filter(o=>o.taxonomyType!=="Table"));return Math.max(0,i-t)}unconfirmedTableValues(e){if(!e)return 0;let{total:i,confirmed:t}=this._countConfirmedValuesForFields(e.fields.filter(o=>o.taxonomyType==="Table"));return Math.max(0,i-t)}hasAllValuesConfirmed(e){return e?e.fields.find(t=>t.isMissing?!Ct(t.confirmationStatus):t.values.find(o=>!Ct(o.confirmationStatus)))===void 0:!0}_countConfirmedValuesForFields(e){return e.reduce(({total:i,confirmed:t},o)=>(o.isMissing&&(i+=1,t+=o.confirmationStatus===me.Confirmed?1:0),i+=o.values.length,o.values.forEach(d=>t+=d.confirmationStatus===me.Confirmed?1:0),{total:i,confirmed:t}),{total:0,confirmed:0})}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var Re,Be,Yi,Ki=F(()=>{"use strict";S();ft();Cn();G();Sn();Bi();tt();gt();vi();un();En();wn();Mn();Rn();In();Vn();bt();Pe();ji();S();Re=(function(n){return n.None="None",n.Partial="Partial",n.All="All",n})(Re||{}),Be=(function(n){return n.NextUnconfirmedCell="next-unconfirmed-cell",n.ConfirmAllCells="confirm-all-valid-cells",n})(Be||{}),Yi=(()=>{class n{_documentInfoService=g(Hi);_apoFactory=g(qi);_bridgeService=g(it);_extractionService=g(Me);_extractionValidationService=g(H);_externalInteractionsService=g(Qi);_errorService=g(ki);_pdfMapper=g(Gi);_translateService=g(Yt);_sharedSettings=g(Oi);tableFieldId=ge(null);_isReadonly=ge(!1);_selectedExtraction=ut(this._extractionService.selectedExtraction$);cellToScrollTo$=new Dt(null);tableInitialized$=new Ft;tableInitialized=ut(this.tableInitialized$);rowsPerPage=ge(this._sharedSettings.getPersistedTableRowsPerPage()??10);pageIndex=ge(0);tableSelectionAppendFromRowIndex=ge(void 0);tableField=E(()=>this._selectedExtraction()?.fields.find(e=>e.id===this.tableFieldId()));tableValue=E(()=>this.tableField()?.values[0]);numberOfRows=E(()=>this.tableValue()?.body.rows.length??0);hasRows=E(()=>this.numberOfRows()>0);numberOfInvalidCells=E(()=>this._getNumberOfInvalidCells());numberOfUnconfirmedCells=E(()=>this._getNumberOfUnconfirmedCells());totalPages=E(()=>{let e=this.tableValue();return e?.body.rows?Math.ceil(e.body.rows.length/this.rowsPerPage()):0});confirmationButtonGroupOptions=E(()=>{let e=this.numberOfUnconfirmedCells(),i=this.numberOfInvalidCells();return[{id:Be.NextUnconfirmedCell,text:this._translateService.instant(e===1?"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.singular":"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.plural",{numberOfUnconfirmedCells:e}),description:this._translateService.instant("VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON_TOOLTIP",{numberOfUnconfirmedCells:e})},{id:Be.ConfirmAllCells,text:this._translateService.instant("VS_TABLE_CONFIRM_ALL_CELLS_BUTTON"),disabled:i>0}]});paginatedDataSource=E(()=>{let e=this.tableValue(),i=this.pageIndex(),t=this.rowsPerPage(),o=e?e.body.rows.slice(i*t,(i+1)*t):[];return new Vi(o)});header=E(()=>{let e=this.tableValue();if(e?.header)return e.header;let i=this.tableField(),t=this._selectedExtraction();return i&&t?this._apoFactory.createEmptyTableHeader(i.id,t.docTypeId):null});headerRow=E(()=>this.header()?.cells??[]);headerRowIds=E(()=>this.headerRow().map(e=>e.id).concat(["actions"]),{equal:gi});constructor(){this._externalInteractionsService.selectTableCellInsideTableEditor$.pipe(dt(e=>this.tableFieldId()===e.table.id?rt(e):this.tableInitialized$.pipe(st(1)).pipe(lt(()=>e)))).subscribe(e=>this.selectCell(e)),this._externalInteractionsService.selectTableRowInsideTableEditor$.pipe(dt(e=>this.tableFieldId()===e[0].table.id?rt(e):this.tableInitialized$.pipe(st(1)).pipe(lt(()=>e)))).subscribe(e=>this._selectTableRow(e))}init({tableFieldId:e,isReadonly:i}){this._resetState(),this.tableFieldId.set(e),this._isReadonly.set(i),this.tableInitialized$.next()}cleanup(){this._resetState()}setRowsPerPage(e){this._updatePagination(0,e)}changePage(e){this._updatePagination(e,this.rowsPerPage())}selectCell(e,i=!1){let t=this.rowsPerPage(),o=this.pageIndex(),d=Math.floor(e.cell.rowIndex/t);d!==o&&e.cell.rowIndex!==-1&&(this._updatePagination(d,t),this.cellToScrollTo$.next(e.cell.uniqueId));let p=this._bridgeService.selectedTableCell$.value,O=(p?.cell.values?.length??0)>0;!this._isReadonly()&&(i||O)&&p?.cell&&p.cell.uniqueId!==e.cell.uniqueId&&this._extractionService.changeTableCellConfirmation({tableFieldId:p.table.id,rowUniqueId:p.cell.rowUniqueId,cellUniqueId:p.cell.uniqueId},!0),this._bridgeService.selectedTableCell$.next(e)}addNewRow(e){let i=this.getPaginatedRow(e),t=this._getSafeTableField(),o=this.tableValue(),d=this._extractionService.addEmptyTableRow(t.id,o?.uniqueId,i);if(d){let p=d[0];this.selectCell({cell:p,table:t,origin:he.CrudOperation}),this.cellToScrollTo$.next(p.uniqueId)}}setRowConfirmedStatus(e,i){let t=i===Re.All,o=this._getSafeTableField();e.filter(d=>this._isCellConfirmed(d)!==t).forEach(d=>this._extractionService.changeTableCellConfirmation({tableFieldId:o.id,rowUniqueId:d.rowUniqueId,cellUniqueId:d.uniqueId},t)),this._bridgeService.highlightTableCells$.next({table:o,cells:e})}getRowConfirmedStatus(e){let i=e.filter(t=>this._isCellConfirmed(t)).length;return i===e.length?Re.All:i===0?Re.None:Re.Partial}getPaginatedRow(e){let i=this.rowsPerPage(),t=this.pageIndex();return e+t*i}updateTableFromSelection(e){let i=this.tableSelectionAppendFromRowIndex(),t=i===void 0,[o,d]=this._createHeaderAndBodyFromSelection(e,i,t),p=this._getSafeTableFieldId();if(t)this._extractionService.replaceTableRows(p,o,d);else{if(!i&&i!==0)throw Error("The fromRow should be set!");let P=this._getSafeTableValue();this._extractionService.addTableRowsAtIndex(p,P.uniqueId,i+1,d)}let O=this.rowsPerPage(),I=Math.floor((t?0:i+1)/O);this._updatePagination(I,O)}goToFirstInvalidCell(){let e=this._getSafeTableField(),i=this._getFirstInvalidCell();i&&(this.selectCell({table:e,cell:i,origin:he.CrudOperation}),this.cellToScrollTo$.next(i.uniqueId))}handleConfirmationButtonClick(e){e===Be.NextUnconfirmedCell?this.goToFirstUnconfirmedCell():e===Be.ConfirmAllCells&&this._confirmUnconfirmedCells()}goToFirstUnconfirmedCell(){let e=this._getSafeTableField(),t=this._getFirstUnconfirmedRow()?.find(o=>!this._isCellConfirmed(o));t&&(this.selectCell({table:e,cell:t,origin:he.CrudOperation}),this.cellToScrollTo$.next(t.uniqueId))}removeEmptyRowsForActiveTable(){let e=this.tableFieldId();e&&this._extractionService.removeEmptyTableRows(e)}_selectTableRow(e){let i=this.rowsPerPage(),t=this.pageIndex(),o=Math.floor(e[0].cell.rowIndex/i);o!==t&&this._updatePagination(o,i);let d={table:e[0].table,cells:e.map(p=>p.cell)};this.cellToScrollTo$.next(e[0].cell.uniqueId),this._bridgeService.selectedTableCell$.next(null),this._bridgeService.selectedTableRow$.next(d),this._bridgeService.highlightTableCells$.next(d)}_confirmUnconfirmedCells(){let e=this._getSafeTableFieldId(),i=this._getSafeTableValue();this._extractionService.confirmTableValue(e,i.uniqueId),this._bridgeService.tableEditorVisibility$.next(!1)}_getAllRows(){return this._getSafeTableValue().body.rows}_getFirstInvalidCell(){let e=this._getSafeTableValue();for(let i of e.body.rows)for(let t of i)if(!t.isMissing&&this._extractionValidationService.validateFieldValue(t,t.values[0]))return t;return null}_getFirstUnconfirmedRow(){for(let e of this._getAllRows())if(this.getRowConfirmedStatus(e)!==Re.All)return e;return null}_getNumberOfInvalidCells(){let e=this._getSafeTableValue(),i=0;for(let t of e.body.rows)for(let o of t)!o.isMissing&&this._extractionValidationService.validateFieldValue(o,o.values[0])&&i++;return i}_getNumberOfUnconfirmedCells(){let e=0;for(let i of this._getAllRows())for(let t of i)this._isCellConfirmed(t)||e++;return e}_updatePagination(e,i){let t=Math.ceil(this.numberOfRows()/i),o=Math.max(Math.min(e,t-1),0);this._sharedSettings.persistTableRowsPerPage(i),this.rowsPerPage.set(i),this.pageIndex.set(o)}_isCellConfirmed(e){return e.isMissing?e.confirmationStatus===me.Confirmed:e.values[0].confirmationStatus===me.Confirmed}_resetState(){this.tableFieldId.set(null),this.pageIndex.set(0)}_createHeaderAndBodyFromSelection(e,i,t){let o=this._getSafeTableField(),d=this.header();if(!d)throw this._errorService.createError("Table editor must be initialized before creating a header!");let O=o.editReferenceCapabilities.includes(ht.area)?e.rows:e.rows.filter(j=>j.some(B=>B.tokens.length>0)),I=t&&e.hasHeader?O.shift():[],P=O,w=Ot(Vt({},d),{cells:[]}),Ve=[];if(t&&I){let j=vt();d.cells.forEach((B,Oe)=>{let at=I.find(ze=>ze.columnName===B.name);w.cells[Oe]=this._createTableCellFromSelection(at,o.id,B,0,j,!0)})}return P.forEach((j,B)=>{Ve[B]=[];let Oe=(i||0)+B,at=vt();d.cells.forEach((ze,dn)=>{let cn=j.find(mn=>mn.columnName===ze.name),pn=this._createTableCellFromSelection(cn,o.id,ze,Oe,at);Ve[B][dn]=pn})}),[w,Ve]}_createTableCellFromSelection(e,i,t,o,d,p=!1){let O=this._extractionService.selectedDocTypeId??"",I=p?this._apoFactory.createEmptyTableHeaderCell(i,t.id,t.columnIndex,d,O):this._apoFactory.createEmptyTableBodyCell(i,t.id,t.columnIndex,o,d,O,"AUTOMATIC_EXTRACTION"),P=I.editReferenceCapabilities.includes(ht.area),w=this._apoFactory.createEmptyValueForField(I),Ve=t.type===Ri.Set?t.taxonomy.values:[],j=e?P?[e.region]:e.tokens:[],[B,Oe]=P?[I.defaultValue,this._createCustomSelectionReference(e)]:this._pdfMapper.mapPDFTokensToValueAndReference(j,I.type,Ve);return w.reference=Oe,w.confirmationStatus=me.Confirmed,w.confidence=1,w.ocrConfidence=zi(j),w.value=p?t.name:B,w.unformattedValue=B,w.derivedParts=p?[]:w.derivedParts,I.isMissing=!w.reference?.words.length,I.isMissing||I.values.push(w),I.isHeaderCell=p,I.confirmationStatus=me.Confirmed,I.hasDerivedParts=w.derivedParts.length>0,I.boxesChanged=!0,I}_createCustomSelectionReference(e){let i=this._apoFactory.createDefaultReference();if(e==null)return i;let{top:t,left:o,width:d,height:p}=e.region.box;return i.words=[{length:0,startIndex:0,processingSource:this._documentInfoService.documentInfoModel().pages[e.pageIndex].processingSource,boxes:[[t,o,d,p]],pageIndex:e.pageIndex,pageHeight:0,pageWidth:0}],i}_getSafeTableFieldId(){let e=this.tableFieldId();if(!e)throw this._errorService.createError("Table service must be first initialized!");return e}_getSafeTableField(){let e=this.tableField();if(!e)throw this._errorService.createError("Table service must be first initialized!");return e}_getSafeTableValue(){let e=this.tableValue();if(!e)throw this._errorService.createError("Cannot perform operation on table value that does not exist!");return e}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var va,Dn=F(()=>{"use strict";S();xn();tt();gt();bt();Xi();ji();Ki();S();va=(()=>{class n{_extractionService=g(Me);_groupFieldsService=g(nt);_bridgeService=g(it);_tableEditorService=g(Yi);_matrixIterator=new Ni;moveFieldValuePosition(e,{shouldConfirmPrevious:i=!0}={}){let t=this._flattenFieldValues();if(t.length===0)return;let o=new Ui(t),d=o.findIndex(O=>O.isSelected),p=o.move(e,d);this._extractionService.selectFieldValue(p.fieldId,p.valueId,he.KeyboardShortcuts,-1,i)}moveCellPosition(e,i){let o=i.values[0],d=[...o?[o?.header.cells]:[],...o?.body.rows??[]],p=this._bridgeService.selectedField$.value,O=this._bridgeService.selectedTableCell$.value;if(p?.taxonomyType!==et.Table)return;let I=this._getCurrentCellPosition(O,d),P=this._matrixIterator.movePosition(I,e,d);if(!P)return;let w=d[P.rowIndex][P.colIndex];return this._tableEditorService.selectCell({table:i,cell:w,origin:he.KeyboardShortcuts},!0),P}_getFieldValues(e){let i=[];return e.forEach(t=>{if(t.values.length===0){i.push({fieldId:t.id,isSelected:t.isSelected});return}t.values.forEach(o=>{i.push({fieldId:t.id,valueId:o.uniqueId,isSelected:o.isSelected})})}),i}_flattenFieldValues=()=>{let e=this._extractionService.selectedExtraction;if(!e)return[];let i=e.docTypeField,t=[{fieldId:i.id,valueId:i.values[0].uniqueId,isSelected:i.isSelected}],o=this._getFieldValues(this._groupFieldsService.fieldsToValidate),d=this._getFieldValues(this._groupFieldsService.validFields),p=[...o,...d];return t.push(...p),t};_getCurrentCellPosition(e,i){if(!e||!i||i.length===0)return;let t=i.length,o=i[0].length;for(let d=0;d<t;d++)for(let p=0;p<o;p++)if(i[d][p].uniqueId===e.cell.uniqueId)return{rowIndex:d,colIndex:p}}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var Nn,Ji=F(()=>{"use strict";q();te();ce();Ze();S();te();ce();Ze();Nn=(()=>{class n{uiChipButton=!0;text;status="info";matMenuTriggerPanel;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ui-chip-button"]],hostVars:2,hostBindings:function(i,t){i&2&&T("ui-chip-button",t.uiChipButton)},inputs:{text:"text",status:"status",matMenuTriggerPanel:"matMenuTriggerPanel"},decls:5,vars:3,consts:[["mat-flat-button","",1,"btn-small","chip-btn",2,"height","20px","padding","2px 6px",3,"matMenuTriggerFor","ngClass"],[1,"apollo-button-text-left"]],template:function(i,t){i&1&&(r(0,"button",0)(1,"span",1),s(2),l(),r(3,"mat-icon"),s(4,"expand_more"),l()()),i&2&&(C("matMenuTriggerFor",t.matMenuTriggerPanel)("ngClass",t.status),a(2),y(t.text))},dependencies:[$,ee,Ge,de,se,Je,Ke],styles:[`.ui-chip-button button.mat-mdc-unelevated-button.chip-btn{height:20px;padding:2px 6px;box-sizing:border-box!important}.ui-chip-button button.mat-mdc-unelevated-button.chip-btn:focus-visible{outline:solid 2px var(--color-primary)}.ui-chip-button button.mat-mdc-unelevated-button.chip-btn .apollo-button-text-left{font-size:11px;line-height:16px}
|
|
1
|
+
import{$ as g,$a as r,$e as ri,A as st,Ab as s,Af as Je,Ak as Rn,Bb as y,Bf as Ze,Cb as v,Cf as fi,Ci as ki,D as At,De as Qe,Df as _i,Eb as $t,Ee as ae,Ef as hi,Fa as M,Fb as Ht,Ff as Ci,Gb as Ne,Ha as Lt,Hb as $e,He as ye,Hf as gi,Ib as qt,Ie as re,Ja as X,Jc as jt,Je as le,Jk as Qi,Kk as Vn,Mf as xi,Mk as it,Nd as Se,Ni as Sn,Nk as ji,O as dt,Od as Te,Oe as ei,Pc as Xt,Pd as Ee,Pe as je,Qi as he,R as Fe,Ra as k,Re as se,Ri as ht,Sb as _,Se as de,Ta as u,Tb as h,Te as ce,U as un,Ue as ti,Va as f,Vc as fn,Vf as vi,We as hn,Wi as me,Wj as zi,X as Ce,Xa as De,Xe as ii,Xi as Ct,Ya as L,Ye as ni,Za as z,Zb as E,Ze as oi,_a as C,_b as Gt,_e as ai,_i as gt,_j as En,ab as l,af as li,al as nt,ba as R,bb as Ue,bi as Vi,bk as $i,bl as Xi,c as Ft,ca as V,cc as He,ci as Cn,cl as Me,d as Dt,dc as mt,dl as bt,ee as Yt,ei as Oi,ej as Li,el as we,fd as qe,fi as Fi,fl as St,ga as Pt,ge as N,gi as gn,gk as yn,gl as Wi,hc as Qt,hd as Wt,hk as Hi,hl as On,ia as ge,ib as U,id as _n,ik as In,jk as xt,ka as Bt,ke as Kt,kg as bi,l as rt,la as xe,lb as b,lc as S,le as G,lf as si,lh as Mi,li as Di,lk as H,ma as ve,mb as x,mc as $,mf as di,mg as Si,mk as Pe,na as kt,nd as Ge,nf as ci,ni as Ui,o as lt,of as pi,oi as Ni,pc as J,pd as ee,pf as Ie,qb as W,qd as te,qe as Jt,qg as Ti,qh as et,rb as Y,re as ie,rf as ut,rg as Ei,rh as wi,sa as a,sb as K,sf as ft,sg as yi,sh as Ri,si as xn,tc as Z,te as Zt,tf as pe,tg as Ii,ti as vn,tk as vt,ua as D,ub as ct,uc as q,uf as Xe,ui as Ai,vb as zt,ve as ne,vf as We,vi as bn,w as Ut,wb as pt,wf as Ye,wh as Ae,wi as Pi,wk as Mn,xf as mi,xh as _t,xi as Bi,xk as qi,yb as T,ye as oe,yf as ui,yh as tt,yj as Tn,yk as wn,z as Nt,zb as be,ze as Q,zf as Ke,zk as Gi}from"./chunk-5LGMGLPM.js";import{a as Vt,b as Ot,f as F}from"./chunk-3ONYU5UZ.js";var zo,Fn=F(()=>{"use strict";gt();S();zo=(()=>{class n{unconfirmedRegularValues(e){if(!e)return 0;let{total:i,confirmed:t}=this._countConfirmedValuesForFields(e.fields.filter(o=>o.taxonomyType!=="Table"));return Math.max(0,i-t)}unconfirmedTableValues(e){if(!e)return 0;let{total:i,confirmed:t}=this._countConfirmedValuesForFields(e.fields.filter(o=>o.taxonomyType==="Table"));return Math.max(0,i-t)}hasAllValuesConfirmed(e){return e?e.fields.find(t=>t.isMissing?!Ct(t.confirmationStatus):t.values.find(o=>!Ct(o.confirmationStatus)))===void 0:!0}_countConfirmedValuesForFields(e){return e.reduce(({total:i,confirmed:t},o)=>(o.isMissing&&(i+=1,t+=o.confirmationStatus===me.Confirmed?1:0),i+=o.values.length,o.values.forEach(d=>t+=d.confirmationStatus===me.Confirmed?1:0),{total:i,confirmed:t}),{total:0,confirmed:0})}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var Re,Be,Yi,Ki=F(()=>{"use strict";S();ft();Cn();G();Sn();Bi();tt();gt();vi();un();En();wn();Mn();Rn();In();Vn();bt();Pe();ji();S();Re=(function(n){return n.None="None",n.Partial="Partial",n.All="All",n})(Re||{}),Be=(function(n){return n.NextUnconfirmedCell="next-unconfirmed-cell",n.ConfirmAllCells="confirm-all-valid-cells",n})(Be||{}),Yi=(()=>{class n{_documentInfoService=g(Hi);_apoFactory=g(qi);_bridgeService=g(it);_extractionService=g(Me);_extractionValidationService=g(H);_externalInteractionsService=g(Qi);_errorService=g(ki);_pdfMapper=g(Gi);_translateService=g(Yt);_sharedSettings=g(Oi);tableFieldId=ge(null);_isReadonly=ge(!1);_selectedExtraction=ut(this._extractionService.selectedExtraction$);cellToScrollTo$=new Dt(null);tableInitialized$=new Ft;tableInitialized=ut(this.tableInitialized$);rowsPerPage=ge(this._sharedSettings.getPersistedTableRowsPerPage()??10);pageIndex=ge(0);tableSelectionAppendFromRowIndex=ge(void 0);tableField=E(()=>this._selectedExtraction()?.fields.find(e=>e.id===this.tableFieldId()));tableValue=E(()=>this.tableField()?.values[0]);numberOfRows=E(()=>this.tableValue()?.body.rows.length??0);hasRows=E(()=>this.numberOfRows()>0);numberOfInvalidCells=E(()=>this._getNumberOfInvalidCells());numberOfUnconfirmedCells=E(()=>this._getNumberOfUnconfirmedCells());totalPages=E(()=>{let e=this.tableValue();return e?.body.rows?Math.ceil(e.body.rows.length/this.rowsPerPage()):0});confirmationButtonGroupOptions=E(()=>{let e=this.numberOfUnconfirmedCells(),i=this.numberOfInvalidCells();return[{id:Be.NextUnconfirmedCell,text:this._translateService.instant(e===1?"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.singular":"VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON.plural",{numberOfUnconfirmedCells:e}),description:this._translateService.instant("VS_TABLE_CHECK_FIRST_UNCONFIRMED_CELL_BUTTON_TOOLTIP",{numberOfUnconfirmedCells:e})},{id:Be.ConfirmAllCells,text:this._translateService.instant("VS_TABLE_CONFIRM_ALL_CELLS_BUTTON"),disabled:i>0}]});paginatedDataSource=E(()=>{let e=this.tableValue(),i=this.pageIndex(),t=this.rowsPerPage(),o=e?e.body.rows.slice(i*t,(i+1)*t):[];return new Vi(o)});header=E(()=>{let e=this.tableValue();if(e?.header)return e.header;let i=this.tableField(),t=this._selectedExtraction();return i&&t?this._apoFactory.createEmptyTableHeader(i.id,t.docTypeId):null});headerRow=E(()=>this.header()?.cells??[]);headerRowIds=E(()=>this.headerRow().map(e=>e.id).concat(["actions"]),{equal:gi});constructor(){this._externalInteractionsService.selectTableCellInsideTableEditor$.pipe(dt(e=>this.tableFieldId()===e.table.id?rt(e):this.tableInitialized$.pipe(st(1)).pipe(lt(()=>e)))).subscribe(e=>this.selectCell(e)),this._externalInteractionsService.selectTableRowInsideTableEditor$.pipe(dt(e=>this.tableFieldId()===e[0].table.id?rt(e):this.tableInitialized$.pipe(st(1)).pipe(lt(()=>e)))).subscribe(e=>this._selectTableRow(e))}init({tableFieldId:e,isReadonly:i}){this._resetState(),this.tableFieldId.set(e),this._isReadonly.set(i),this.tableInitialized$.next()}cleanup(){this._resetState()}setRowsPerPage(e){this._updatePagination(0,e)}changePage(e){this._updatePagination(e,this.rowsPerPage())}selectCell(e,i=!1){let t=this.rowsPerPage(),o=this.pageIndex(),d=Math.floor(e.cell.rowIndex/t);d!==o&&e.cell.rowIndex!==-1&&(this._updatePagination(d,t),this.cellToScrollTo$.next(e.cell.uniqueId));let p=this._bridgeService.selectedTableCell$.value,O=(p?.cell.values?.length??0)>0;!this._isReadonly()&&(i||O)&&p?.cell&&p.cell.uniqueId!==e.cell.uniqueId&&this._extractionService.changeTableCellConfirmation({tableFieldId:p.table.id,rowUniqueId:p.cell.rowUniqueId,cellUniqueId:p.cell.uniqueId},!0),this._bridgeService.selectedTableCell$.next(e)}addNewRow(e){let i=this.getPaginatedRow(e),t=this._getSafeTableField(),o=this.tableValue(),d=this._extractionService.addEmptyTableRow(t.id,o?.uniqueId,i);if(d){let p=d[0];this.selectCell({cell:p,table:t,origin:he.CrudOperation}),this.cellToScrollTo$.next(p.uniqueId)}}setRowConfirmedStatus(e,i){let t=i===Re.All,o=this._getSafeTableField();e.filter(d=>this._isCellConfirmed(d)!==t).forEach(d=>this._extractionService.changeTableCellConfirmation({tableFieldId:o.id,rowUniqueId:d.rowUniqueId,cellUniqueId:d.uniqueId},t)),this._bridgeService.highlightTableCells$.next({table:o,cells:e})}getRowConfirmedStatus(e){let i=e.filter(t=>this._isCellConfirmed(t)).length;return i===e.length?Re.All:i===0?Re.None:Re.Partial}getPaginatedRow(e){let i=this.rowsPerPage(),t=this.pageIndex();return e+t*i}updateTableFromSelection(e){let i=this.tableSelectionAppendFromRowIndex(),t=i===void 0,[o,d]=this._createHeaderAndBodyFromSelection(e,i,t),p=this._getSafeTableFieldId();if(t)this._extractionService.replaceTableRows(p,o,d);else{if(!i&&i!==0)throw Error("The fromRow should be set!");let P=this._getSafeTableValue();this._extractionService.addTableRowsAtIndex(p,P.uniqueId,i+1,d)}let O=this.rowsPerPage(),I=Math.floor((t?0:i+1)/O);this._updatePagination(I,O)}goToFirstInvalidCell(){let e=this._getSafeTableField(),i=this._getFirstInvalidCell();i&&(this.selectCell({table:e,cell:i,origin:he.CrudOperation}),this.cellToScrollTo$.next(i.uniqueId))}handleConfirmationButtonClick(e){e===Be.NextUnconfirmedCell?this.goToFirstUnconfirmedCell():e===Be.ConfirmAllCells&&this._confirmUnconfirmedCells()}goToFirstUnconfirmedCell(){let e=this._getSafeTableField(),t=this._getFirstUnconfirmedRow()?.find(o=>!this._isCellConfirmed(o));t&&(this.selectCell({table:e,cell:t,origin:he.CrudOperation}),this.cellToScrollTo$.next(t.uniqueId))}removeEmptyRowsForActiveTable(){let e=this.tableFieldId();e&&this._extractionService.removeEmptyTableRows(e)}_selectTableRow(e){let i=this.rowsPerPage(),t=this.pageIndex(),o=Math.floor(e[0].cell.rowIndex/i);o!==t&&this._updatePagination(o,i);let d={table:e[0].table,cells:e.map(p=>p.cell)};this.cellToScrollTo$.next(e[0].cell.uniqueId),this._bridgeService.selectedTableCell$.next(null),this._bridgeService.selectedTableRow$.next(d),this._bridgeService.highlightTableCells$.next(d)}_confirmUnconfirmedCells(){let e=this._getSafeTableFieldId(),i=this._getSafeTableValue();this._extractionService.confirmTableValue(e,i.uniqueId),this._bridgeService.tableEditorVisibility$.next(!1)}_getAllRows(){return this._getSafeTableValue().body.rows}_getFirstInvalidCell(){let e=this._getSafeTableValue();for(let i of e.body.rows)for(let t of i)if(!t.isMissing&&this._extractionValidationService.validateFieldValue(t,t.values[0]))return t;return null}_getFirstUnconfirmedRow(){for(let e of this._getAllRows())if(this.getRowConfirmedStatus(e)!==Re.All)return e;return null}_getNumberOfInvalidCells(){let e=this._getSafeTableValue(),i=0;for(let t of e.body.rows)for(let o of t)!o.isMissing&&this._extractionValidationService.validateFieldValue(o,o.values[0])&&i++;return i}_getNumberOfUnconfirmedCells(){let e=0;for(let i of this._getAllRows())for(let t of i)this._isCellConfirmed(t)||e++;return e}_updatePagination(e,i){let t=Math.ceil(this.numberOfRows()/i),o=Math.max(Math.min(e,t-1),0);this._sharedSettings.persistTableRowsPerPage(i),this.rowsPerPage.set(i),this.pageIndex.set(o)}_isCellConfirmed(e){return e.isMissing?e.confirmationStatus===me.Confirmed:e.values[0].confirmationStatus===me.Confirmed}_resetState(){this.tableFieldId.set(null),this.pageIndex.set(0)}_createHeaderAndBodyFromSelection(e,i,t){let o=this._getSafeTableField(),d=this.header();if(!d)throw this._errorService.createError("Table editor must be initialized before creating a header!");let O=o.editReferenceCapabilities.includes(ht.area)?e.rows:e.rows.filter(j=>j.some(B=>B.tokens.length>0)),I=t&&e.hasHeader?O.shift():[],P=O,w=Ot(Vt({},d),{cells:[]}),Ve=[];if(t&&I){let j=vt();d.cells.forEach((B,Oe)=>{let at=I.find(ze=>ze.columnName===B.name);w.cells[Oe]=this._createTableCellFromSelection(at,o.id,B,0,j,!0)})}return P.forEach((j,B)=>{Ve[B]=[];let Oe=(i||0)+B,at=vt();d.cells.forEach((ze,dn)=>{let cn=j.find(mn=>mn.columnName===ze.name),pn=this._createTableCellFromSelection(cn,o.id,ze,Oe,at);Ve[B][dn]=pn})}),[w,Ve]}_createTableCellFromSelection(e,i,t,o,d,p=!1){let O=this._extractionService.selectedDocTypeId??"",I=p?this._apoFactory.createEmptyTableHeaderCell(i,t.id,t.columnIndex,d,O):this._apoFactory.createEmptyTableBodyCell(i,t.id,t.columnIndex,o,d,O,"AUTOMATIC_EXTRACTION"),P=I.editReferenceCapabilities.includes(ht.area),w=this._apoFactory.createEmptyValueForField(I),Ve=t.type===Ri.Set?t.taxonomy.values:[],j=e?P?[e.region]:e.tokens:[],[B,Oe]=P?[I.defaultValue,this._createCustomSelectionReference(e)]:this._pdfMapper.mapPDFTokensToValueAndReference(j,I.type,Ve);return w.reference=Oe,w.confirmationStatus=me.Confirmed,w.confidence=1,w.ocrConfidence=zi(j),w.value=p?t.name:B,w.unformattedValue=B,w.derivedParts=p?[]:w.derivedParts,I.isMissing=!w.reference?.words.length,I.isMissing||I.values.push(w),I.isHeaderCell=p,I.confirmationStatus=me.Confirmed,I.hasDerivedParts=w.derivedParts.length>0,I.boxesChanged=!0,I}_createCustomSelectionReference(e){let i=this._apoFactory.createDefaultReference();if(e==null)return i;let{top:t,left:o,width:d,height:p}=e.region.box;return i.words=[{length:0,startIndex:0,processingSource:this._documentInfoService.documentInfoModel().pages[e.pageIndex].processingSource,boxes:[[t,o,d,p]],pageIndex:e.pageIndex,pageHeight:0,pageWidth:0}],i}_getSafeTableFieldId(){let e=this.tableFieldId();if(!e)throw this._errorService.createError("Table service must be first initialized!");return e}_getSafeTableField(){let e=this.tableField();if(!e)throw this._errorService.createError("Table service must be first initialized!");return e}_getSafeTableValue(){let e=this.tableValue();if(!e)throw this._errorService.createError("Cannot perform operation on table value that does not exist!");return e}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var va,Dn=F(()=>{"use strict";S();xn();tt();gt();bt();Xi();ji();Ki();S();va=(()=>{class n{_extractionService=g(Me);_groupFieldsService=g(nt);_bridgeService=g(it);_tableEditorService=g(Yi);_matrixIterator=new Ni;moveFieldValuePosition(e,{shouldConfirmPrevious:i=!0}={}){let t=this._flattenFieldValues();if(t.length===0)return;let o=new Ui(t),d=o.findIndex(O=>O.isSelected),p=o.move(e,d);this._extractionService.selectFieldValue(p.fieldId,p.valueId,he.KeyboardShortcuts,-1,i)}moveCellPosition(e,i){let o=i.values[0],d=[...o?[o?.header.cells]:[],...o?.body.rows??[]],p=this._bridgeService.selectedField$.value,O=this._bridgeService.selectedTableCell$.value;if(p?.taxonomyType!==et.Table)return;let I=this._getCurrentCellPosition(O,d),P=this._matrixIterator.movePosition(I,e,d);if(!P)return;let w=d[P.rowIndex][P.colIndex];return this._tableEditorService.selectCell({table:i,cell:w,origin:he.KeyboardShortcuts},!0),P}_getFieldValues(e){let i=[];return e.forEach(t=>{if(t.values.length===0){i.push({fieldId:t.id,isSelected:t.isSelected});return}t.values.forEach(o=>{i.push({fieldId:t.id,valueId:o.uniqueId,isSelected:o.isSelected})})}),i}_flattenFieldValues=()=>{let e=this._extractionService.selectedExtraction;if(!e)return[];let i=e.docTypeField,t=[{fieldId:i.id,valueId:i.values[0].uniqueId,isSelected:i.isSelected}],o=this._getFieldValues(this._groupFieldsService.fieldsToValidate),d=this._getFieldValues(this._groupFieldsService.validFields),p=[...o,...d];return t.push(...p),t};_getCurrentCellPosition(e,i){if(!e||!i||i.length===0)return;let t=i.length,o=i[0].length;for(let d=0;d<t;d++)for(let p=0;p<o;p++)if(i[d][p].uniqueId===e.cell.uniqueId)return{rowIndex:d,colIndex:p}}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Ce({token:n,factory:n.\u0275fac})}return n})()});var Nn,Ji=F(()=>{"use strict";q();te();ce();Ze();S();te();ce();Ze();Nn=(()=>{class n{uiChipButton=!0;text;status="info";matMenuTriggerPanel;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ui-chip-button"]],hostVars:2,hostBindings:function(i,t){i&2&&T("ui-chip-button",t.uiChipButton)},inputs:{text:"text",status:"status",matMenuTriggerPanel:"matMenuTriggerPanel"},decls:5,vars:3,consts:[["mat-flat-button","",1,"btn-small","chip-btn",2,"height","20px","padding","2px 6px",3,"matMenuTriggerFor","ngClass"],[1,"apollo-button-text-left"]],template:function(i,t){i&1&&(r(0,"button",0)(1,"span",1),s(2),l(),r(3,"mat-icon"),s(4,"expand_more"),l()()),i&2&&(C("matMenuTriggerFor",t.matMenuTriggerPanel)("ngClass",t.status),a(2),y(t.text))},dependencies:[$,ee,Ge,de,se,Je,Ke],styles:[`.ui-chip-button button.mat-mdc-unelevated-button.chip-btn{height:20px;padding:2px 6px;box-sizing:border-box!important}.ui-chip-button button.mat-mdc-unelevated-button.chip-btn:focus-visible{outline:solid 2px var(--color-primary)}.ui-chip-button button.mat-mdc-unelevated-button.chip-btn .apollo-button-text-left{font-size:11px;line-height:16px}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return n})()});var An=F(()=>{"use strict";Ji()});var Zi,en=F(()=>{"use strict";S();Zi=(()=>{class n{uiStatusIndicator=!0;text;status="info";static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ui-status-indicator"]],hostVars:4,hostBindings:function(i,t){i&2&&(be(t.status),T("ui-status-indicator",t.uiStatusIndicator))},inputs:{text:"text",status:"status"},decls:1,vars:1,template:function(i,t){i&1&&s(0),i&2&&v("",t.text,`
|
|
3
3
|
`)},styles:[`.ui-status-indicator{display:flex;align-items:center;padding:0 6px;height:20px;font-size:11px;font-weight:400}
|
|
4
4
|
`],encapsulation:2,changeDetection:0})}return n})()});var Pa,Pn=F(()=>{"use strict";S();ce();S();ce();Pa=(()=>{class n{expanded=!1;loading=!1;expand=new D;collapse=new D;static \u0275fac=function(i){return new(i||n)};static \u0275cmp=M({type:n,selectors:[["ui-expand-icon"]],inputs:{expanded:"expanded",loading:"loading"},outputs:{expand:"expand",collapse:"collapse"},decls:5,vars:4,consts:[["automation-id","expand-icon","data-testid","expand-icon",1,"ui-expand-icon"],[1,"arrow",3,"click"],[1,"line",3,"click"]],template:function(i,t){i&1&&(r(0,"div",0)(1,"mat-icon",1),b("click",function(){return t.expand.emit()}),s(2,"expand_more"),l(),r(3,"mat-icon",2),b("click",function(){return t.collapse.emit()}),s(4,"remove"),l()()),i&2&&T("is-expanded",t.expanded)("is-loading",t.loading)},dependencies:[de,se],styles:[`.ui-expand-icon{position:relative;display:flex;height:24px;width:24px;-webkit-user-select:none;user-select:none;margin:5px}.ui-expand-icon mat-icon{position:absolute!important;transition-duration:.25s;transition-timing-function:linear;transition-property:transform,opacity}.ui-expand-icon mat-icon.line{opacity:0;z-index:-1}.ui-expand-icon.is-expanded .mat-icon,.ui-expand-icon.is-loading .mat-icon{transform:rotate(180deg)}.ui-expand-icon.is-expanded .mat-icon.arrow,.ui-expand-icon.is-loading .mat-icon.arrow{opacity:0;z-index:-1}.ui-expand-icon.is-expanded .mat-icon.line,.ui-expand-icon.is-loading .mat-icon.line{opacity:1;z-index:1}.ui-expand-icon.is-loading .mat-icon.line{animation:rotate-center .6s infinite}@keyframes rotate-center{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|