(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[73162],{29156:(t,e,n)=>{"use strict";function r(t){if(!t)return!1;let e=t.split("?")[0]||t;return"/dashboard"===e||e.startsWith("/dashboard/")}function i(t){if(!t)return!1;let e=t.split("?")[0]||t;return"/admin"===e||e.startsWith("/admin/")}n.d(e,{M:()=>r,P:()=>i})},58281:(t,e,n)=>{Promise.resolve().then(n.bind(n,26203))},90927:(t,e,n)=>{"use strict";n.d(e,{B7:()=>h,Bw:()=>l,I9:()=>a,X8:()=>d,ae:()=>f,oG:()=>u}),n(86559);var r=n(76541);let i=["res.cloudinary.com"];function s(t){let e=t.toLowerCase();return"supabase.co"===e||e.endsWith(".supabase.co")||e.includes("datahub.com.np")||e.includes("s3-np1")}function o(t,e,n){let r=t.trim(),i=`url=${encodeURIComponent(r)}`;return`/api/media/image?${i}`}function a(t){return`/api/media/file?url=${encodeURIComponent(t.trim())}`}function u(t,e){if(!t||"string"!=typeof t)return"";let n=t.trim();if(!n)return"";if(n.startsWith("blob:")||n.startsWith("data:"))return n;let i=e??(0,r.getApiBaseUrl)();if(d(n)){let t=l(n,i);return t.includes("/media/image")?t:o(n,i)}return l(n,i)||n}function c(t){if(!t||"string"!=typeof t)return!1;let e=t.trim();return e.startsWith("/")&&!e.startsWith("//")}function d(t){if(!t||"string"!=typeof t)return!1;let e=t.trim();return!(!e||c(e)||e.startsWith("blob:")||e.startsWith("data:")||e.includes("/media/image")||e.includes("/storage/v1/object/sign/"))&&(!/^https?:\/\//i.test(e)||function(t){if(!t||!/^https?:\/\//i.test(t))return!1;try{let e=new URL(t);return s(e.hostname)||e.pathname.includes("/dplms-saas-bucket/")}catch{return!1}}(e)||function(t){try{let e=new URL(t);return"drive.google.com"===e.hostname||e.hostname.endsWith(".drive.google.com")||"docs.google.com"===e.hostname||e.hostname.endsWith(".googleusercontent.com")||"googleusercontent.com"===e.hostname}catch{return!1}}(e))}function l(t,e){if(!t||"string"!=typeof t)return"";let n=t.trim();return n?n.includes("/media/image")||n.includes("/storage/v1/object/sign/")||c(n)?n:!/^https?:\/\//i.test(n)||d(n)?o(n,e):n:""}function h(t,e){return u(t,e)}function f(t){if(!t||"string"!=typeof t)return!1;let e=t.trim();if(e.startsWith("blob:")||e.startsWith("data:"))return!1;try{if(e.startsWith("https://")||e.startsWith("http://"))return!0;let n=new URL(t).hostname.toLowerCase();return s(n)||i.some(t=>n===t||n.endsWith("."+t))}catch{return!1}}},99462:(t,e,n)=>{"use strict";n.d(e,{Fb:()=>f,b:()=>o,sK:()=>m});var r=n(73321),i=n(12115);let s="academy-route-change";function o(){window.dispatchEvent(new Event(s))}let a=new Set,u=!1;function c(){u||(u=!0,setTimeout(()=>{u=!1,a.forEach(t=>{try{t()}catch{}})},0))}function d(t){a.add(t);let e=()=>c();return window.addEventListener("popstate",e),window.addEventListener(s,e),()=>{a.delete(t),window.removeEventListener("popstate",e),window.removeEventListener(s,e)}}function l(){return window.location.pathname||"/"}function h(){return window.location.search||""}function f(){return(0,i.useSyncExternalStore)(d,h,()=>"")}function m(){let t=(0,r.usePathname)()||"/",e=(0,i.useSyncExternalStore)(d,l,()=>t);return((0,i.useEffect)(()=>{c()},[]),e&&e!==t)?e:t}}},t=>{t.O(0,[35760,92619,59185,98500,21935,76541,30313,6953,26203,28441,93794,77358],()=>t(t.s=58281)),_N_E=t.O()}]);