import{ao as e,aI as n,c4 as L,bS as k,cm as C,bT as I,aq as m,L as N,at as P,a_ as E,bq as y,m as A,be as _,he as V,v as F,du as H}from"./app-k0jcl5PQ.js";import{F as z}from"./kLXBNYk1.chunk.js";import{L as a}from"./CCKlkV4O.chunk.js";import{V as M}from"./BHfFK47N.chunk.js";import{L as R}from"./BCKXZxoz.chunk.js";import{u as U}from"./BDd2EAdq.chunk.js";function q(s){return e.jsx("svg",{...s,children:e.jsx("path",{d:"m15.293 6.609-.793.79A8.8 8.8 0 0 0 11.997 7C8.006 6.978 4 10.17 4 12c0 .925 1.062 2.216 2.63 3.254l-.715.714C4.174 14.76 3 13.228 3 12c0-2.44 4.5-6.025 9.003-6 1.119.006 2.239.234 3.29.609m2.802 1.442C19.833 9.26 21 10.786 21 12c0 2.45-4.504 6-9 6-1.112 0-2.23-.223-3.279-.595l.794-.792A8.7 8.7 0 0 0 12 17c3.989 0 8-3.161 8-5 0-.911-1.055-2.196-2.62-3.235zm-7.65 7.635.787-.785A3.005 3.005 0 0 0 15 12q-.001-.397-.098-.763l.787-.785a4 4 0 0 1-5.245 5.235zM8.318 13.57a4 4 0 0 1 5.257-5.246l-.785.782a3.003 3.003 0 0 0-3.687 3.68zm-3.466 6.285a.5.5 0 1 1-.706-.708l15-14.971a.5.5 0 1 1 .706.708z",fill:"currentColor"})})}const D="_toggleEye_ts5j9_4",B="_input_ts5j9_9",u={toggleEye:D,input:B},i="share.passwordProtectedShareLink",d=N.encloseNamespace(i);function Q(s){const[r,f]=n.useState(""),[p,l]=n.useState(!1),[h,x]=n.useState(!1),[c,g]=n.useState(""),o=U(s.shareId),j=L();function S(t){t.preventDefault(),r&&(l(!0),A(j,_.checkPassword(s.shareId,r,b=>{if(b.success){V.set(s.shareId,r);const v=F.getHref(s.appLink);H.PageLoad(v);return}g(d("incorrectPasswordErrorMessage")),l(!1)},()=>{g(d("ajaxErrorMessage")),l(!1)})))}if(!o)return e.jsx(e.Fragment,{});const w=k.createUrl(C.getImageUrl(o),{size:I.Large});return e.jsxs(a,{children:[e.jsx(a.LeftImage,{title:o.name,imageUrl:w,objectType:o.typeId,fallbackImages:R}),e.jsxs(a.Right,{children:[e.jsx(a.Header,{}),e.jsx(a.Content,{children:e.jsxs(a.NarrowContent,{children:[e.jsx("p",{className:"h2",children:e.jsx(m,{namespace:i,phrase:"info"})}),e.jsxs("form",{onSubmit:S,className:"position-relative",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"h6",htmlFor:"link-password",children:e.jsx(m,{namespace:i,phrase:"prompt"})}),e.jsxs("div",{className:"position-relative",children:[e.jsx("input",{id:"link-password",type:h?"text":"password",className:`form-control form-control-lg ${u.input} ${c?"is-invalid":""}`,placeholder:d("placeholder"),onChange:t=>f(t.target.value),value:r,autoComplete:"off","aria-errormessage":"linkPasswordError"}),e.jsx(P,{className:`btn ${u.toggleEye}`,onClick:()=>x(t=>!t),children:e.jsx(E,{svg:h?M:q})})]}),c&&e.jsx(z,{className:"mb-3",name:"linkPassword",children:c})]}),e.jsx(y,{variant:"dark",showSpinner:p,type:"submit",className:"w-100 mt-3 btn-lg",disabled:p||!r,children:e.jsx(m,{namespace:i,phrase:"confirm"})})]})]})})]})]})}export{Q as PasswordProtectedShareLinkView};
//# sourceMappingURL=DsnNiiad.chunk.js.map
