1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4380],{17156:function(e,t,r){r.d(t,{sP:function(){return l},xb:function(){return o}});var n,a=r(51438);!function(e){e.DEFAULT="DEFAULT",e.CENTERED="CENTERED"}(n||(n={}));var o={watermarkType:n.DEFAULT,opacity:.2,size:10,color:"0,0,0",rotate:0},i=function e(t){(0,a.Z)(this,e),this._pdfObject=null,this._pdfUrl="",this.watermarkText="",this.watermarkType=n.DEFAULT,this.opacity=.3,this.size=20,this.color=[0,0,0],this.rotate=0,this.phone="",this.showWatermark=!1;var r=t.watermarkText,o=void 0===r?"":r,i=t.showWatermark,l=void 0!==i&&i,s=t.file,c=void 0===s?null:s,u=t.fileUrl,d=void 0===u?"":u,p=t.watermarkType,f=void 0===p?n.DEFAULT:p,h=t.opacity,w=void 0===h?.3:h,v=t.size,m=void 0===v?20:v,y=t.color,k=void 0===y?"0,0,0":y,b=t.rotate,g=void 0===b?0:b,E=t.phone,L=void 0===E?"":E;this.watermarkText=o,this.phone=L,this.showWatermark=l,this._pdfObject=c,this._pdfUrl=d,this.watermarkType=f,this.opacity=Number(w),this.size=Number(m),this.color="string"===typeof k?k.split(",").map(Number):k,this.rotate=Number(g)},l=function(e){return new i(e)}},4380:function(e,t,r){r.d(t,{Z:function(){return L}});var n=r(47568),a=r(26042),o=r(97582),i=r(85893),l=r(59417),s=r(67814),c=r(96486),u=r(67294),d=r(89885),p=r(45508),f=r(4027),h=r(42238),w=r(17156),v=r(96076),m=r(47041),y=v.jA,k=function(e){try{var t=new URL(e);return t.pathname=encodeURI(t.pathname),t.toString()}catch(r){return encodeURI(e)}},b=function(e){try{var t=new URL(e);return t.pathname=decodeURI(t.pathname),t.toString()}catch(r){return decodeURI(e)}},g=function(){var e=(0,n.Z)((function(e){var t;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,fetch(e,{method:"HEAD",headers:{Referer:y}})];case 1:return[2,200===(null===(t=r.sent())||void 0===t?void 0:t.status)?t:null];case 2:return r.sent(),[2,null];case 3:return[2]}}
1))}));return function(t){return e.apply(this,arguments)}}(),E=function(e){var t=(0,u.useState)(e),r=t[0],a=t[1],i=(0,u.useCallback)(function(){var e=(0,n.Z)((function(e){var t,r,n,a,l,s=arguments;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:if(t=s.length>1&&void 0!==s[1]?s[1]:0,r=s.length>2&&void 0!==s[2]?s[2]:5,t>Math.max(r,3))return[2,{updatedLink:e,depth:t,hasFile:!1}];o.label=1;case 1:return o.trys.push([1,4,,5]),[4,g(e)];case 2:return(n=o.sent())&&200===n.status?[2,{updatedLink:e,depth:t,hasFile:!0}]:[4,i(k(e),t+1,Math.max(r,5))];case 3:return(a=o.sent()).hasFile?[2,a]:[3,5];case 4:return l=o.sent(),console.error("error while checking file",l),[3,5];case 5:return[2,{updatedLink:e,depth:t,hasFile:!1}]}}))}));return function(t){return e.apply(this,arguments)}}(),[]),l=(0,u.useCallback)((0,n.Z)((function(){var t,r,n,a,l,s,c,u;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return r=!1,(t=e).includes("%")&&(r=!0),[4,g(t)];case 1:return o.sent()?[3,3]:(n=function(e){for(var t=e,r=0;t!==b(t);)t=b(t),r++;return{link:t,depth:r}}(t),a=n.link,l=n.depth,[4,i(a,l,Math.max(l,5))]);case 2:s=o.sent(),c=s.updatedLink,s.hasFile&&(t=c),o.label=3;case 3:return u=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=e,n=0;n<t;)r=k(r),n++;return r}(t),[2,{correctLink:t,encodedLink:u,isSpecialCharacterCase:r}]}}))})),[e,i]);return{link:r,updateLink:(0,u.useCallback)((function(e){a(e)}),[]),getCorrectPdfUrl:l}};function L(e){var t=e.title,r=e.isOpen,k=e.allowDownload,b=void 0===k?"0":k,g=e.isEncrypted,L=void 0===g?"0":g,_=e.encryptionVersion,U=void 0===_?"1":_,C=e.encryptionKey,x=void 0===C?"":C,A=e.phone,F=void 0===A?"":A,R=e.watermarkConfig,N=e.clientUrl,P=e.link,T=e.host,S=void 0===T?"":T,j=(0,u.useState)(!1),V=j[0],Z=j[1],D=(0,u.useRef)(null),I=(0,u.useRef)(null),M=(0,u.useRef)(null),q=(0,u.useContext)(d.Z),O=q.currentUser,K=q.appConfig,W=E(P),z=W.link,B=W.updateLink,J=W.getCorrectPdfUrl,G=function(){var e,t,r,n,a=new h.UAParser;return{osVersion:Number(null===(e=a.getOS())||void 0===e||null===(t=e.version)||void 0===t?void 0:t.split(".")[0]),isIphone:null===(r=null===a||void 0===a?void 0:a.getOS())||void 0===r||null===(n=r.name)||void 0===n?void 0:n.toLowerCase().includes("ios")}}(),H=G.osVersion,Q=G.isIphone,X=function(e,t,r){var a=(0,u.useMemo)((function(){return"2"===t}),[t]),i=(0,u.useMemo)((function(){return"1"===e?btoa(v.qn.VALUE+v.qn.VALUE1+r):""}),[r,e]),l=(0,u.useCallback)(function(){var e=(0,n.Z)((function(e){var t;return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),a?[4,(0,p.JR)(e,r)]:[3,2];case 1:case 3:return[2,n.sent()];case 2:return[4,(0,p.ow)(new Int8Array(e),r)];case 4:return[3,6];case 5:throw t=n.sent(),console.error("Error decrypting PDF:",t),t;case 6:return[2]}}
1))}));return function(t){return e.apply(this,arguments)}}(),[a,r]);return{isNewEncryption:a,encryptionKeyValue:i,decryptPdf:l}}(L,U,x),Y=X.encryptionKeyValue,$=X.decryptPdf,ee=(0,u.useMemo)((function(){return(null===O||void 0===O?void 0:O.phone)?btoa(v.qn.VALUE+v.qn.VALUE1+O.phone):F}),[O,F]),te=(0,u.useCallback)((function(e){return atob(e).replace(v.qn.VALUE,"").replace(v.qn.VALUE1,"")}),[]),re=(0,u.useMemo)((function(){var e,t=null;try{var r=(0,m.getCookie)(v.z1);r&&"string"===typeof r&&(t=new URL(r))}catch(n){console.error("error while getting base url",n)}return null!==(e=null!==N&&void 0!==N?N:null===t||void 0===t?void 0:t.host)&&void 0!==e?e:""}),[N]),ne=(0,u.useMemo)((function(){return"ADOBE"===K.web_pdfviewer&&!Q&&H<=13&&"1"!==L&&"3"!==b}),[null===K||void 0===K?void 0:K.web_pdfviewer,Q,H,L,b]),ae=function(e,t,r){return{configurePdfWatermark:(0,u.useCallback)((function(n,o){var i=(0,c.isEmpty)(t)?w.xb:t,l=r;try{l=atob(r).replace(v.qn.VALUE,"").replace(v.qn.VALUE1,"")}catch(p){console.error("invalid phone value",p)}if(e.web_pdfwatermarkstyle&&(0,c.isEmpty)(t))try{var s,u="string"===typeof e.web_pdfwatermarkstyle?JSON.parse(e.web_pdfwatermarkstyle||"{}"):null!==(s=e.web_pdfwatermarkstyle)&&void 0!==s?s:{};i=(0,a.Z)({phone:l},i,u)}catch(f){console.error("error while parsing the pdf watermark style",f)}var d=(0,w.sP)((0,a.Z)({phone:l,watermarkText:n,showWatermark:o},i));return window.pdfConfig=d,d}),[e.web_pdfwatermarkstyle,t,r])}}(K,R,ee).configurePdfWatermark,oe=(0,u.useCallback)(function(){var e=(0,n.Z)((function(e){var t,r,n,a;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),[4,fetch(e,{headers:{Referer:y}})];case 1:return[4,o.sent().arrayBuffer()];case 2:return t=o.sent(),[4,$(t)];case 3:return r=o.sent(),n=r.buffer,window.decryptedFile=n,Z(!0),[2,n];case 4:return a=o.sent(),console.error("error while fetching/decrypting",a),[3,5];case 5:return[2]}}
1))}));return function(t){return e.apply(this,arguments)}}(),[$]),ie=(0,u.useCallback)((0,n.Z)((function(){var e,t,r,n,a,i,l,s;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return[4,J()];case 1:return e=o.sent(),t=e.correctLink,r=e.encodedLink,n=e.isSpecialCharacterCase,B(n?t:r),a=null,"1"!==L||(0,c.isEmpty)(x)?[3,3]:[4,oe(t)];case 2:return a=o.sent(),M.current=a,[3,4];case 3:Z(!0),o.label=4;case 4:return i=(0,f.Z)(K.web_enablewatermarkpdfviewer)||(0,f.Z)(L)||"3"===b,(0,c.isEmpty)(R)||(i=R.showWatermark),l=(null===O||void 0===O?void 0:O.phone)?O.phone:te(F),s=ae(l,i),I.current=s,D.current,[2]}}))})),[J,B,L,x,K,b,R,O,F,ae,oe]),le=(0,u.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=new URLSearchParams;return e?(r.append("url",z),r.append("saveFlag",b)):(r.append("file",z),r.append("save_flag",b),r.append("is_encrypted",L),r.append("encryption_version",U),Y&&r.append("encryption_key",Y)),t&&r.append("title",t),ee&&r.append("phone",ee),re&&r.append("client_url",re),r.toString()}),[z,t,re,b,ee,L,U,Y]);(0,u.useEffect)((function(){return Object.defineProperty(window,"print",{value:function(e){}}),window.onkeydown=function(e){(80===e.keyCode||83===e.keyCode||67===e.keyCode)&&(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.preventDefault(),e.stopImmediatePropagation?e.stopImmediatePropagation():e.stopPropagation())},function(){window.onkeydown=null}}),[]);var se=function(){};return(0,u.useEffect)((function(){B(P)}),[P,B]),(0,u.useEffect)((function(){r?ie():Z(!1)}),[r,ie]),!V||(0,c.isEmpty)(z)?(0,i.jsx)("div",{className:"relative h-full w-full bg-background",children:(0,i.jsxs)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:[(0,i.jsx)(s.G,{icon:l.LM3,size:"3x",className:"text-muted-foreground",spin:!0}),(0,i.jsx)("div",{className:"text-muted-foreground text-center",children:"Loading..."})]})}):ne?(0,i.jsx)("iframe",{onLoad:se,src:"".concat(S||"/","pdf-viewer?").concat(le(!0)),sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-modals allow-top-navigation allow-top-navigation-by-user-activation allow-orientation-lock allow-downloads",allowFullScreen:!0,height:"100%",width:"100%"}):Q&&H<=16?(0,i.jsx)("iframe",{onLoad:se,ref:D,src:"".concat(S||"/","pdfjs/web/viewer1.html?").concat(le()),sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-modals allow-top-navigation allow-top-navigation-by-user-activation allow-orientation-lock allow-downloads",allowFullScreen:!0,allow:"fullscreen;camera *;microphone *;display-capture *",height:"100%",width:"100%"}):(0,i.jsx)("iframe",{ref:D,onLoad:se,src:"".concat(S||"/","pdfjs-latest/web/viewer.html?").concat(le()),sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-modals allow-top-navigation allow-top-navigation-by-user-activation allow-orientation-lock allow-downloads",allowFullScreen:!0,height:"100%",width:"100%"})}}}]);
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.