1import{u as I,k as e,k7 as z,r as d,t as p,A as N,dN as Ce,k8 as Re,bq as w,iQ as Ie,_ as V,cv as W,k9 as Ae,ka as Fe,kb as De,m as Pe,Q as B,ak as D,e as ge,j as s,jp as Me,B as _e,T as U,h as v,cr as Oe,ae as C,cb as H,C as R,q as X,cw as be,dS as Ne,k3 as we,gT as xe,kc as G,kd as Le,ke as ye,kf as je,kg as ke,hr as Be,kh as Ue,k2 as ve,ki as He,kj as Ge,cx as $e,cz as qe,k1 as ze,jQ as Ve,cA as We}from"./index-BW1yVuiY.js";import{P as $,a as P,D as Xe}from"./DocViewer-XWhrBs9R.js";import{P as E,R as Ye,a as Qe}from"./ReuploadModal-biDlM2Qf.js";import{r as Ke}from"./removeExtension-DgCJtCoh.js";import{u as Ze}from"./useDispatchUnmount-xkomixvf.js";import{c as Y,p as Je,b as et,u as tt}from"./useTemplatePreviewFetch-DhX3hgGv.js";import{u as ot}from"./useTemplateFieldsFetch-CLzJHKkL.js";import{u as F}from"./useShowFetchError-V4voWAW0.js";import{e as Q,c as K,i as st,b as at,k as rt}from"./recipients.selectors-DajKk82k.js";import{a as nt,b as ct,c as lt,r as it}from"./reupload.selectors-BuBLD_WL.js";import{a as O,b as Z,c as J,d as mt,e as pt,p as dt}from"./placement.selectors-BuK1vo_6.js";import{F as St,P as ut}from"./FullScreenTemplate-uwMtlx40.js";import{v as ee}from"./viewOptions.selectors-QfaVY9Zg.js";import{c as Et}from"./viewOptions.actions-IHeOmsEf.js";import{R as ht}from"./ReloadIcon-Cpa56TwM.js";import{T as ft}from"./TextIcon-CeVTEP9A.js";import{T as b,D as Tt}from"./DiscardConfirmModal-jDC6WMPH.js";import{S as Ct}from"./SaveIcon-UODf4Dxv.js";import{c as Rt}from"./templateFlow.actions-DtxUcsI0.js";import{B as It}from"./BackButton-D4r9cLdk.js";import{D as At}from"./Diagram-BcUF85Lp.js";import{t as te}from"./templateFlow.selectors-cRnZPEAk.js";import{R as Ft}from"./ResetModal-dkcTnEzr.js";import{C as Dt}from"./CreateFolderForTemplateModal-BGpoWrj_.js";import{H as q,a as Pt}from"./FullScreenTemplate.styles-CpcTD1tE.js";import"./FilledCommentIcon-BtbAvd78.js";import"./DocViewerMobileToolbar.styles-Bt43GvqI.js";import"./Popover-BCBwiahZ.js";import"./react-content-loader.es--nnwPzA6.js";import"./ContractSvg-si61naZq.js";import"./Modal-BGaj1Vw_.js";import"./UploadFile-hccLM_xD.js";import"./Spinner-BL9cUwWz.js";import"./fetch-BLOjifoJ.js";import"./KebabIcon-fzFPVH3T.js";import"./LangMenu-JNKt8b0i.js";import"./EditIcon-BEVV1is9.js";import"./recipients-pp2HwHup.js";import"./AskModal-cE3PJkxr.js";import"./UploadDocumentCreateFolderModal-Bv9ZDo1q.js";import"./FormTextInput-KNIx5AFq.js";import"./TextInput-Bcio-Zp-.js";import"./array-BH-HeL-O.js";import"./folders.selectors-Dy_CJJEF.js";import"./Header.styles-D-g3jyFy.js";const gt=()=>{const t=I(),c=e(O),o=e(z),n=e(ee);return d.useMemo(()=>[{name:p.RESET,disabled:!0,Icon:ht,onClick:()=>{t(N(E.PLACEMENT_RESET))}},{name:p.TEXT_FIELD,Icon:ft,pointerMode:$.DRAW,drawingCompName:P.TEXT},{name:p.DATE_FIELD,Icon:Ce,pointerMode:$.DRAW,drawingCompName:P.DATE},{name:p.SIZE,value:o,options:Re}],[c,o,n])},Mt=()=>{const t=I(),{templateId:c}=w(),o=e(Y),n=o==null?void 0:o.name;return d.useMemo(()=>[{buttonIcon:"Delete and Close",label:p.CONTRACT_DELETE_AND_CLOSE,onClick:()=>{t(N(b.DISCARD_CONFIRMATION))},MobileIcon:Ie}],[c,n])},_t=()=>{const t=I(),c=V(),{templateId:o}=w(),n=e(Q),l=e(Z),r=e(J),S=e(W),i=e(mt),m=e(Ae),u=n.length>0,h=e(K),f=d.useMemo(()=>[{label:p.COMPLETE_AND_EXIT,onClick:()=>{t(Fe(o,S)),u&&t(De(l,r,h))},variant:Pe.PRIMARY,MobileIcon:Ct}],[o,n,l,r,S]);return d.useEffect(()=>{(!u||i.status===B.SUCCESS)&&m.status===B.SUCCESS&&(t(Rt()),localStorage.clear(),c.push(D.templatesAllUrl()))},[i,m]),f},Ot=({templateId:t,sender:c,recipients:o})=>{const{t:n}=ge(),[l,r]=d.useState(""),S=o.sorted.length,i=n(p.TEMPLATES_CLM_NOT_SPECIFIED),m=e(te);return m==="Document"&&localStorage.setItem("templateFlow",m),d.useEffect(()=>{const u=localStorage.getItem("templateFlow");r(u)},[]),s.jsxs(s.Fragment,{children:[s.jsx(It,{compact:!0,path:m===Me.DOCUMENT_WITH_RECIPIENT?D.templatesFillRecipientsUrl(t):D.templatesAllUrl(),label:n(p.BACK)}),s.jsx(_e,{mb:3,children:S>0&&l!=="Document"?s.jsxs(s.Fragment,{children:[s.jsx(U,{name:v.H4,children:n(p.SIGNERS)}),s.jsx(At,{compact:!0,sender:c,recipients:o,order:Oe.SEPARATE})]}):s.jsx(U,{name:v.H4,children:i})})]})},bt=({reuploading:t,onReset:c,onDiscard:o,onReuploadConfirm:n,onReupload:l})=>
1{const r=I(),S=e(C(H.CREATE_FOLDER_FOR_TEMPLATE)),i=()=>{r(R(H.CREATE_FOLDER_FOR_TEMPLATE))},m=e(C(E.PLACEMENT_RESET)),u=()=>{r(R(E.PLACEMENT_RESET))},h=e(C(b.DISCARD_CONFIRMATION)),f=()=>{r(R(b.DISCARD_CONFIRMATION))},T=e(C(E.REUPLOAD_CONFIRMATION)),g=()=>{r(R(E.REUPLOAD_CONFIRMATION))},A=e(C(E.REUPLOAD)),M=()=>{r(R(E.REUPLOAD))};return s.jsxs(s.Fragment,{children:[S&&s.jsx(Dt,{onClose:i}),m&&s.jsx(Ft,{onReset:c,onClose:u}),h&&s.jsx(Tt,{onDiscard:o,onClose:f}),T&&s.jsx(Ye,{onReuploadConfirm:n,onClose:g}),A&&s.jsx(Qe,{loading:t,onReupload:l,onClose:M})]})},Nt=X.div` 2 position: relative; 3 display: flex; 4 flex-direction: column; 5 height: calc(100vh - ${q}); 6 7 ${({theme:t})=>`@media ${t.devices.laptop} { 8 height: calc(100vh - ${Pt}); 9 }`} 10 ${({theme:t})=>`@media ${t.devices.mobile} { 11 height: calc(100vh - ${q}); 12 }`} 13`;X.div` 14 position: absolute; 15 top: 0; 16 left: 0; 17 width: 615px; 18 max-width: 100%; 19`;const wt=()=>{const t=I(),c=V(),{templateId:o}=w(),n=e(Je),l=e(et),r=e(Y),S=e(st),i=e(at),m=e(rt),u=e(Q),h=e(Z);e(J);const f=e(pt),T=e(W),g=e(be),A=e(z),M=Ke((r==null?void 0:r.name)||""),_={byId:i,byOrder:m,sorted:u},oe=e(O),x=e(dt),se=e(nt),ae=e(ct);e(lt),e(O);const L=e(Ne),re=e(it),ne=e(ee),ce=Mt(),le=_t(),ie=gt(),y=e(K),j=e(te),[xt,me]=d.useState("");j==="Document"&&localStorage.setItem("templateFlow",j);const pe=a=>{T[a.id]?t(Le(a)):t(ye(a,y))},de=a=>{(a.type===P.TEXT||a.type===P.DATE)&&t(je({...a,type:a.type,fontSize:A,text:""}))},Se=a=>{T[a]&&t(ke(a))},ue=(a,k)=>{a==="SIZE"&&Be(k)&&t(Ue(k))},Ee=()=>{t(ve(o))},he=()=>{t(He()),t(N(E.REUPLOAD))},fe=a=>{t(Ge(o,a))},Te=()=>{t($e(o)),t(G(o,i)),localStorage.clear(),c.push(D.templatesAllUrl())};return d.useEffect(()=>{const a=localStorage.getItem("templateFlow");t(we()),a!=null&&a.length?me(a):t(xe(o))},[]),d.useEffect(()=>{_.sorted.length>0&&t(G(o,i))},[_.sorted,oe]),tt(o),ot(o),F(n,l),F(x.status,x.error),F(se,ae),F(L.status,L.error),Ze(Ve,ze,qe,Et),s.jsxs(St,{headerContent:s.jsx(ut,{actions:ce,buttons:le,title:M}),sidebarContent:s.jsx(Ot,{templateId:o,sender:S,recipients:_}),children:[s.jsx(Nt,{"data-testid":"template-preview-container",children:r&&s.jsx(Xe,{pages:r.pages,placementById:h,placementByPages:f,fieldsById:T,fieldsByPages:g,fieldsFontSize:A,actions:ie,isSignatureNamesVisible:ne,onElemChange:pe,onElemCreate:de,onElemDelete:Se,onToolbarChange:ue,order:y})}),s.jsx(bt,{reuploading:re,onReset:Ee,onDiscard:Te,onReuploadConfirm:he,onReupload:fe})]})},go=()=>s.jsx(We,{children:s.jsx(wt,{})});export{go as TemplatePlacement,go as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.