1jQuery(function(e){new DLM_XHR_Download});class DLM_XHR_Download{responsHeaders={};constructor(){(dlmXHRinstance=this).init()}init(){dlmXHRinstance.attachButtonEvent()}attachButtonEvent(){jQuery("html,body").on("click",".dlm-no-access-modal-window > div",function(e){e.stopPropagation()}),jQuery("html, body").on("click",".dlm-no-access-modal-overlay, .dlm-no-access-modal-close, .dlm-no-access-modal-window",function(e){e.stopPropagation(),jQuery("#dlm-no-access-modal").remove()}),jQuery(document).on("keydown",function(e){"Escape"===e.key&&jQuery("#dlm-no-access-modal").remove()}),jQuery("html, body").on("click","a",function(e){let d=jQuery(this).attr("href"),o=!1;var r,s;jQuery(this).hasClass("dlm-no-xhr-download")&&(o=!0),"undefined"!=typeof dlmNonXHRGlobalLinks&&0<dlmNonXHRGlobalLinks.length&&void 0!==d&&dlmNonXHRGlobalLinks.forEach(e=>{0<=d.indexOf(e)&&(o=!0)}),o?jQuery("#dlm-no-access-modal").remove():(jQuery(document).trigger("dlm-xhr-download-button-click",[d,this,dlmXHRGlobalLinks]),void 0!==d&&0<=d.indexOf(dlmXHRGlobalLinks)&&(r=jQuery(this).data("redirect"),s=jQuery(this).attr("target"),void 0!==r&&!0===r&&"_blank"===s||dlmXHRinstance.handleDownloadClick(this,e)))})}handleDownloadClick(e,d){d.stopPropagation();var o=e.getAttribute("href"),o={button:e,href:o,buttonObj:jQuery(e)};-1===o.href.indexOf("blob:http")&&"#"!==o.href&&(d.preventDefault(),dlmXHRinstance.retrieveBlob(o))}retrieveBlob(e){let h=this,{button:x,href:f,buttonObj:w}=e,H,g=new XMLHttpRequest,b=dlmXHR.prevent_duplicates,R=w.attr("target"),y=w.attr("class");y=void 0!==y&&""!==y?y.replace("dlm-download-started","").replace("dlm-download-completed",""):"",w.addClass("dlm-download-started"),x.setAttribute("href","#"),x.removeAttribute("download"),x.setAttribute("disabled","disabled"),dlmXHRProgress&&(e='<img src="'+dlmXHRgif+'" class="dlm-xhr-loading-gif" style="display:inline-block; vertical-align: middle; margin-left:15px;">',x.innerHTML+=e),jQuery(document).trigger("dlm_download_triggered",[this,x,w,H,g]);let X=!1;g.responseType="blob",g.onreadystatechange=function(){var{status:e,readyState:d,statusText:o}=g,r=g.getAllResponseHeaders().split("\r\n").reduce((e,d)=>{var[d,o]=d.split(": ");return e[d]=o,e},{});1<Object.keys(r).length&&(X=!0,h.responseHeaders=r);let s="download",n=!1,t=!1,l=!1,a=!1,i=null,m=!1,c=!1,p=!1,v=!1,u=!1;if(X&&void 0!==h.responseHeaders["dlm-file-name"]&&(n=h.responseHeaders["dlm-file-name"]),X&&void 0!==h.responseHeaders["dlm-no-waypoints"]&&(t=!0),X&&void 0!==h.responseHeaders["dlm-redirect"]&&(l=h.responseHeaders["dlm-redirect"]),X&&void 0!==h.responseHeaders["dlm-external-download"]&&(a=!0),X&&void 0!==h.responseHeaders["dlm-no-access"]&&(i=h.responseHeaders["dlm-no-access"]),X&&void 0!==h.responseHeaders["dlm-no-access-modal"]&&(m=h.responseHeaders["dlm-no-access-modal"]),X&&void 0!==h.responseHeaders["dlm-error"]&&(c=h.responseHeaders["dlm-error"]),X&&void 0!==h.responseHeaders["dlm-download-id"]&&(p=h.responseHeaders["dlm-download-id"]),X&&void 0!==h.responseHeaders["dlm-version-id"]&&(v=h.responseHeaders["dlm-version-id"]),X&&void 0!==h.responseHeaders["dlm-no-access-modal-text"]&&(u=h.responseHeaders["dlm-no-access-modal-text"]),X&&void 0!==h.responseHeaders["x-dlm-file-name"]&&(n=h.responseHeaders["x-dlm-file-name"]),X&&void 0!==h.responseHeaders["x-dlm-no-waypoints"]&&(t=!0),X&&void 0!==h.responseHeaders["x-dlm-redirect"]&&(l=h.responseHeaders["x-dlm-redirect"]),X&&void 0!==h.responseHeaders["x-dlm-external-download"]&&(a=!0),X&&void 0!==h.responseHeaders["x-dlm-no-access"]&&(i=h.responseHeaders["x-dlm-no-access"]),X&&void 0!==h.responseHeaders["x-dlm-no-access-modal"]&&(m=h.responseHeaders["x-dlm-no-access-modal"]),X&&void 0!==h.responseHeaders["x-dlm-error"]&&(c=h.responseHeaders["x-dlm-error"]),X&&void 0!==h.responseHeaders["x-dlm-download-id"]&&(p=h.responseHeaders["x-dlm-download-id"]),X&&void 0!==h.responseHeaders["x-dlm-version-id"]&&(v=h.responseHeaders["x-dlm-version-id"]),X&&void 0!==h.responseHeaders["x-dlm-no-access-modal-text"]&&(u=h.responseHeaders["x-dlm-no-access-modal-text"]),n?(s=n.replace(/\"/g,"").replace(";",""),s=decodeURI(s)):X&&void 0!==h.responseHeaders["content-disposition"]&&(s=(s=h.responseHeaders["content-disposition"].split(/(?:filename\*=UTF-8'')|(?:filename=)/)[1]).replace(/\"/g,"").replace(";",""),s=decodeURI(s)),c=c&&(c in dlmXHRtranslations?dlmXHRtranslations[c]:dlmXHRtranslations.error),2===g.readyState){if(X&&void 0!==h.responseHeaders["x-dlm-force-abort"]&&""!==h.responseHeaders["x-dlm-force-abort"])return x.removeAttribute("download"),x.setAttribute("href",f),w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-loading-gif").remove(),g.abort(),void jQuery("#dlm-no-access-modal").remove();if(t)return g.abort(),l?void(window.location.href=l):void(window.location.href=f);if(a)return g.abort(),void dlmXHRinstance.dlmExternalDownload(h.responseHeaders,x,w,s,f);if(0===Object.keys(h.responseHeaders).filter(e=>-1!==e.indexOf("dlm-")).length)return g.abort(),void(window.location.href=f);if(i&&"true"===i&&m&&0!=m)return dlmXHRinstance.dlmNoAccessModal(h.responseHeaders),x.removeAttribute("download"),x.setAttribute("href",f),w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-loading-gif").remove(),void g.abort();if(c&&""!==c&&null!==c)return dlmXHRinstance.dlmLogDownload(h.responseHeaders,"failed",!1),x.removeAttribute("download"),x.setAttribute("href",f),w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-loading-gif").remove(),g.abort(),void(m&&0!=m?dlmXHRinstance.dlmNoAccessModal(h.responseHeaders):(w.find(".dlm-xhr-error").remove(),w.append('<span class="dlm-xhr-error">'+c+"</span>")));if(l&&""!==l&&null!==l)return dlmXHRinstance.dlmLogDownload(h.responseHeaders,"redirected",!1,l,i,R),x.removeAttribute("download"),x.setAttribute("href",f),w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-loading-gif").remove(),void g.abort()}404==e&&2==d&&((r=document.createElement("p")).innerHTML=o,x.parentNode.appendChild(r)),401==e&&2==d?window.location.href=o:(403==e&&2==d&&((r=document.createElement("p")).innerHTML=o,x.parentNode.appendChild(r)),200==e&&4==d&&(o=g.response,H=URL.createObjectURL(o),x.removeEventListener("click",dlmXHRinstance.handleDownloadClick),x.setAttribute("download",""+s),x.setAttribute("href",H),x.click(),w.removeClass().addClass(y+" dlm-d
1ownload-complete"),dlmXHRinstance.attachButtonEvent(),jQuery(document).trigger("dlm_download_complete",[this,x,w,H]),dlmXHRinstance.dlmLogDownload(h.responseHeaders,"completed",b),window.URL.revokeObjectURL(H),x.removeAttribute("download"),x.setAttribute("href",f),w.find(".dlm-xhr-loading-gif").remove(),setTimeout(function(){w.removeClass().addClass(y).find("span.dlm-xhr-progress").remove()},4e3)))},dlmXHRProgress&&g.addEventListener("progress",function(e){let d=e.total,o=(void 0!==e.total&&"undefined"!==e.total&&0!==e.total||void 0!==h.responseHeaders["x-dlm-filesize"]&&(d=h.responseHeaders["x-dlm-filesize"]),e.loaded/d*100);o=o.toFixed();var r;w.find("span.dlm-xhr-progress").remove(),r="dlm-download-started download-"+10*Math.ceil(o/10),1/0!=o&&w.append('<span class="dlm-xhr-progress"> '+o+"%</span>"),w.removeClass().addClass(y+" "+r),jQuery(document).trigger("dlm_download_progress",[this,x,w,H,e,o])}),g.onerror=function(){x.removeAttribute("download"),x.setAttribute("href",f),w.removeClass().addClass(y+" dlm-no-xhr-download").find("span.dlm-xhr-progress").remove(),w.find(".dlm-xhr-error").remove(),w.append('<span class="dlm-xhr-error">'+dlmXHRtranslations.error+"</span>"),console.log("** An error occurred during the transaction")},g.open("GET",f,!0),g.setRequestHeader("Cache-Control","no-store, no-cache, no-transform, max-age=0"),g.setRequestHeader("dlm-xhr-request","dlm_XMLHttpRequest"),g.send()}dlmLogDownload(e,d,o,r=null,s=null,n="_self"){var t,l;null!==s?window.open(r,n):(s=window.location.href,t=void 0!==e["x-dlm-download-id"]?e["x-dlm-download-id"]:e["dlm-download-id"],l=void 0!==e["x-dlm-version-id"]?e["x-dlm-version-id"]:e["dlm-version-id"],jQuery.post(dlmXHR.ajaxUrl,{download_id:t,version_id:l,status:d,cookie:o,currentURL:s,action:"log_dlm_xhr_download",responseHeaders:e,nonce:e["x-dlm-nonce"]},function(e){null!==r&&(null==n&&(n="_self"),window.open(r,n))}))}dlmNoAccessModal(e){let d="empty-download",o="empty-version",r="empty-restriction",s="",n=(void 0!==e["dlm-download-id"]&&(d=e["dlm-download-id"]),void 0!==e["dlm-version-id"]&&(o=e["dlm-version-id"]),void 0!==e["dlm-no-access-modal-text"]&&(s=e["dlm-no-access-modal-text"]),void 0!==e["dlm-no-access-restriction"]&&(r=e["dlm-no-access-restriction"]),void 0!==e["x-dlm-download-id"]&&(d=e["x-dlm-download-id"]),void 0!==e["x-dlm-version-id"]&&(o=e["x-dlm-version-id"]),void 0!==e["x-dlm-no-access-modal-text"]&&(s=e["x-dlm-no-access-modal-text"]),void 0!==e["x-dlm-no-access-restriction"]&&(r=e["x-dlm-no-access-restriction"]),{download_id:d,version_id:o,modal_text:s,restriction:r,action:"no_access_dlm_xhr_download",nonce:e["x-dlm-nonce"]});jQuery(document).trigger("dlm-xhr-modal-data",[n,e]),document.dispatchEvent(new CustomEvent("dlm-xhr-modal-data",{detail:{data:n,headers:e}})),jQuery.post(dlmXHR.ajaxUrl,n,function(e){jQuery("#dlm-no-access-modal").remove(),jQuery("body").append(e),jQuery(document).trigger(n.action,[e,n]),document.dispatchEvent(new CustomEvent(n.action,{detail:[e,n]}))})}dlmExternalDownload(o,s,n,r,t){let l=new XMLHttpRequest,a=(n.attr("target"),n.attr("class")),i,e="";void 0!==o["dlm-external-download"]&&(e=o["dlm-external-download"]),void 0!==o["x-dlm-external-download"]&&(e=o["x-dlm-external-download"]),a=void 0!==a&&""!==a?a.replace("dlm-download-started","").replace("dlm-download-completed",""):"",n.addClass("dlm-download-started"),s.setAttribute("href","#"),s.removeAttribute("download"),s.setAttribute("disabled","disabled"),jQuery(document).trigger("dlm_download_triggered",[this,s,n,i,l]),l.responseType="blob",l.onreadystatechange=function(){var{status:e,readyState:d}=l;403===e?(dlmXHRinstance.dlmLogDownload(o,"failed",!1),l.abort(),n.find(".dlm-xhr-error").remove(),n.append('<span class="dlm-xhr-error">Acces Denied to file.</span>')):200==e&&4==d&&(e=l.response,i=URL.createObjectURL(e),s.removeEventListener("click",dlmXHRinstance.handleDownloadClick),s.setAttribute("download",""+r),s.setAttribute("href",i),s.click(),n.removeClass().addClass(a+" dlm-download-complete"),dlmXHRinstance.attachButtonEvent(),jQuery(document).trigger("dlm_download_complete",[this,s,n,i]),dlmXHRinstance.dlmLogDownload(o,"completed",!1),window.URL.revokeObjectURL(i),s.removeAttribute("download"),s.setAttribute("href",t),n.find(".dlm-xhr-loading-gif").remove(),setTimeout(function(){n.removeClass().addClass(a).find("span.dlm-xhr-progress").remove()},1e3))},dlmXHRProgress&&l.addEventListener("progress",function(e){let d=e.total,o=(void 0!==e.total&&"undefined"!==e.total||(d=l.getResponseHeader("X-DLM-Filesize")),e.loaded/d*100);o=o.toFixed();var r;n.find("span.dlm-xhr-progress").remove(),r="dlm-download-started download-"+10*Math.ceil(o/10),1/0!=o&&n.append('<span class="dlm-xhr-progress"> '+o+"%</span>"),n.removeClass().addClass(a+" "+r),jQuery(document).trigger("dlm_download_progress",[this,s,n,i,e,o])}),l.onerror=function(){s.removeAttribute("download"),s.setAttribute("href",t),n.removeClass().addClass(a+" .dlm-no-xhr-download").find("span.dlm-xhr-progress").remove(),n.find(".dlm-xhr-error").remove(),n.append('<span class="dlm-xhr-error">'+dlmXHRtranslations.error+"</span>"),console.log("** An error occurred during the transaction")}
1,l.open("GET",e,!0),l.setRequestHeader("Cache-Control","no-store, no-cache, no-transform, max-age=0"),l.setRequestHeader("dlm-xhr-request","dlm_XMLHttpRequest"),l.send()}}
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.