| Server IP : 151.101.66.159 / Your IP : 216.73.216.66 Web Server : Flywheel/5.1.0 System : Linux wordpress 6.12.113+ #1 SMP Thu Oct 22 02:38:20 UTC 2026 x86_64 User : root ( ) PHP Version : 7.4.33.18 Disable Function : disk_free_space,diskfreespace,dl,exec,fpassthru,getmypid,getmyuid,highlight_file,link,opcache_compile_file,opcache_get_configuration,opcache_is_script_cached,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,phpinfo,popen,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,socket_listen,source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wp-content/plugins/file-manager-advanced/application/assets/dist/ |
Upload File : |
/*! For license information please see 821.f87c25ed.chunk.js.LICENSE.txt */
"use strict";(self.webpackChunkafm_react_admin=self.webpackChunkafm_react_admin||[]).push([[821],{7821(e,t,n){n.r(t),n.d(t,{default:()=>A});var i=n(6540),a=(n(5486),n(5688)),r=n(7850),o=n(7554),l=n(4848);function s(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(e,t,n){return(t=function(e){var t=function(e){if("object"!=v(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==v(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,a,r,o,l=[],s=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=r.call(n)).done)&&(l.push(i.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function p(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function r(n,i,a,r){var s=i&&i.prototype instanceof l?i:l,c=Object.create(s.prototype);return b(c,"_invoke",function(n,i,a){var r,l,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return r=t,l=0,s=e,f.n=n,o}};function m(n,i){for(l=n,s=i,t=0;!d&&c&&!a&&t<u.length;t++){var a,r=u[t],m=f.p,h=r[2];n>3?(a=h===i)&&(s=r[(l=r[4])?5:(l=3,3)],r[4]=r[5]=e):r[0]<=m&&((a=n<2&&m<r[1])?(l=0,f.v=i,f.n=r[1]):m<h&&(a=n<3||r[0]>i||i>h)&&(r[4]=n,r[5]=i,f.n=h,l=0))}if(a||n>1)return o;throw d=!0,i}return function(a,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,h),l=u,s=h;(t=l<2?e:s)||!d;){r||(l?l<3?(l>1&&(f.n=-1),m(l,s)):f.n=s:f.v=s);try{if(c=2,r){if(l||(a="next"),t=r[a]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=r.return)&&t.call(r),l<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),l=1);r=e}else if((t=(d=f.n<0)?s:n.call(i,f))!==o)break}catch(t){r=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,r),!0),c}var o={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][i]?t(t([][i]())):(b(t={},i,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,b(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,b(d,"constructor",c),b(c,"constructor",s),s.displayName="GeneratorFunction",b(c,a,"GeneratorFunction"),b(d),b(d,a,"Generator"),b(d,i,function(){return this}),b(d,"toString",function(){return"[object Generator]"}),(p=function(){return{w:r,m:f}})()}function b(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}b=function(e,t,n,i){function r(t,n){b(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(r("next",0),r("throw",1),r("return",2))},b(e,t,n,i)}function g(e,t,n,i,a,r,o){try{var l=e[r](o),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(i,a)}function w(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){var r=e.apply(t,n);function o(e){g(r,i,a,o,l,"next",e)}function l(e){g(r,i,a,o,l,"throw",e)}o(void 0)})}}var y=i.lazy(w(p().m(function e(){var t;return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.e(305).then(n.bind(n,3305));case 1:return e.n=2,n.e(708).then(n.t.bind(n,5708,23));case 2:return t=e.v,e.a(2,{default:t.default})}},e)}))),_={1:"Heading 1",2:"Heading 2",3:"Heading 3",4:"Heading 4"},x=function(e){return null==e||""===e||"false"===e?"Normal":_[String(e)]||"Normal"},j=function(e){if(e){var t=e.getSelection(!0);if(t){var n=(e.getFormat(t).link||"").trim(),i=window.prompt("Enter URL",n||"https://");if(null!==i){var a=i.trim();if(""!==a){var r=/^(https?:\/\/|mailto:|tel:)/i.test(a)?a:"https://".concat(a);if(0===t.length){var o=r.replace(/^https?:\/\//i,"");return e.insertText(t.index,o,"link",r,"user"),void e.setSelection(t.index+o.length,0,"user")}e.format("link",r,"user")}else e.format("link",!1,"user")}}}};function k(e){var t=e.value,n=e.onChange,a=e.readOnly,r=e.modules,o=e.formats,s=(0,i.useRef)(null);return(0,i.useEffect)(function(){var e=s.current;if(e){var t=function(){!function(e){e&&(e.querySelectorAll(".ql-picker.ql-header .ql-picker-item").forEach(function(e){var t=x(e.getAttribute("data-value"));e.textContent!==t&&(e.textContent=t)}),e.querySelectorAll(".ql-picker.ql-header .ql-picker-label").forEach(function(e){var t=e.querySelector(".afm-ql-header-text");t||((t=document.createElement("span")).className="afm-ql-header-text",e.insertBefore(t,e.firstChild));var n=x(e.getAttribute("data-value"));t.textContent!==n&&(t.textContent=n)}))}(e),function(e){e&&(e.querySelectorAll(".ql-toolbar button").forEach(function(e){var t=function(e){if(e.classList.contains("ql-bold"))return"Bold";if(e.classList.contains("ql-italic"))return"Italic";if(e.classList.contains("ql-underline"))return"Underline";if(e.classList.contains("ql-strike"))return"Strikethrough";if(e.classList.contains("ql-link"))return"Insert link";if(e.classList.contains("ql-image"))return"Insert image";if(e.classList.contains("ql-clean"))return"Clear formatting";if(e.classList.contains("ql-list"))return"ordered"===e.getAttribute("value")?"Numbered list":"Bullet list";if(e.classList.contains("ql-align")){var t=e.getAttribute("value")||"left";return"center"===t?"Align center":"right"===t?"Align right":"Align left"}return""}(e);t&&(e.setAttribute("title",t),e.setAttribute("aria-label",t))}),e.querySelectorAll(".ql-toolbar .ql-picker.ql-header .ql-picker-label").forEach(function(e){e.setAttribute("title","Text style"),e.setAttribute("aria-label","Text style")}))}(e)};t();var n=window.setTimeout(t,50),i=window.setTimeout(t,250),a=new MutationObserver(t);return a.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-value","class"]}),function(){window.clearTimeout(n),window.clearTimeout(i),a.disconnect()}}},[t,a]),(0,l.jsx)("div",{className:"afm-notif-editor",ref:s,children:(0,l.jsx)(i.Suspense,{fallback:(0,l.jsx)("div",{className:"afm-notif-editor__loading",children:"Loading editor..."}),children:(0,l.jsx)(y,{theme:"snow",value:t,onChange:n,readOnly:a,modules:r,formats:o})})})}var S="AFM File Log Recent Activity",N=function(e){return("string"==typeof e?e.trim():"")||S};function A(){var e,t,n,c,d,m,h,p,b,g=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).onContentReady,w=(0,a.lA)(),y=(null===(e=window.wpApiSettings)||void 0===e?void 0:e.nonce)||(null===(t=window.afmReact)||void 0===t?void 0:t.nonce)||"",_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t="".concat(w,"file-manager-advanced/v1/notifications");if(!e||"object"!==v(e))return t;var n=new URLSearchParams(e).toString();return n?"".concat(t).concat(t.includes("?")?"&":"?").concat(n):t},x=f((0,i.useState)(null),2),A=x[0],C=x[1],O=f((0,i.useState)(!0),2),P=O[0],T=O[1];(0,i.useEffect)(function(){P||null==g||g()},[P,g]);var q=f((0,i.useState)(!1),2),E=q[0],I=q[1],R=f((0,i.useState)(null),2),L=R[0],F=R[1],M=f((0,i.useState)("email"),2),U=M[0],W=M[1],D=f((0,i.useState)(!1),2),H=D[0],z=D[1],B=f((0,i.useState)(!1),2),G=B[0],X=B[1],J=f((0,i.useState)(""),2),Y=J[0],$=J[1],K=f((0,i.useState)(""),2),Q=K[0],V=K[1],Z=function(e){return e?e.split("\n\n").map(function(e){return"<p>".concat(e.split("\n").join("<br>"),"</p>")}).join(""):""},ee=function(e){return!(!e||"string"!=typeof e)&&/<(?:p|br|strong|b|em|i|u|s|strike|h[1-6]|ul|ol|li|a|img|div|span)\b/i.test(e)},te=function(e){return String(e||"").replace(/<[^>]+>/g,"").replace(/ /gi," ").replace(/\s+/g,"").toLowerCase()},ne="Hi {admin_email},\n\nA quick update from the Advanced File Manager plugin on your site {site_name}.\nA {item_type} was {event} by {username} on {date_time}. The {item_type} name is {file_name} with the extension {ext}, and the action was performed from the following IP Address: {ip_address}.",ie=function(e,t){return function(e,t){var n="string"==typeof e&&""!==e.trim()?e:t;if(!n)return"";if(function(e){return!(!e||"string"!=typeof e||!(e.includes("\n")||/<br\s*\/?>/i.test(e)||(e.match(/<p\b/gi)||[]).length>=2))}(n))return ee(n)?n:Z(n);var i=te(n),a=te(t||ne),r=te("Hi {admin_email},\n\nA quick update from the Advanced File Manager plugin on your site {site_name}.\nA file was {event} by {username} on {date_time}. The file name is {file_name} with the extension {ext}, and the action was performed from the following IP Address: {ip_address}.");return!i||i!==a&&i!==r?ee(n)?n:Z(n):"<p>Hi {admin_email},</p><p>A quick update from the Advanced File Manager plugin on your site {site_name}.<br>A {item_type} was {event} by {username} on {date_time}. The {item_type} name is {file_name} with the extension {ext}, and the action was performed from the following IP Address: {ip_address}.</p>"}(e,t)},ae=function(e){return e&&"<p><br></p>"!==e?e:""},re=f((0,i.useState)(Z("Hi {admin_email},\n\nA quick update from the Advanced File Manager plugin on your site {site_name}.\nA {item_type} was {event} by {username} on {date_time}. The {item_type} name is {file_name} with the extension {ext}, and the action was performed from the following IP Address: {ip_address}.")),2),oe=re[0],le=re[1],se=f((0,i.useState)(Z("Hi {admin_email},\n\nA quick update from the Advanced File Manager plugin on your site {site_name}.\nA {item_type} was {event} by {username} on {date_time}. The {item_type} name is {file_name} with the extension {ext}, and the action was performed from the following IP Address: {ip_address}.")),2),ce=se[0],ue=se[1],de=f((0,i.useState)(""),2),fe=de[0],me=de[1],he=f((0,i.useState)([]),2),ve=he[0],pe=he[1],be=f((0,i.useState)([]),2),ge=be[0],we=be[1],ye=(null===(n=window.afmReact)||void 0===n?void 0:n.hasPro)||!1,_e=!(null===(c=window.afmReact)||void 0===c||!c.hasActiveSmtpPlugin),xe=(null===(d=window.afmReact)||void 0===d?void 0:d.currentPlan)||"free",je=(null===(m=window.afmReact)||void 0===m||m.pricingUrl,(null===(h=window.afmReact)||void 0===h?void 0:h.smtpSettingsUrl)||"".concat(window.location.origin,"/wp-admin/admin.php?page=file-manager-advanced-recommend-post-smtp")),ke=je+(je.includes("?")?"&":"?")+"afm_embed=1",Se=function(e){return"email"===e||"slack"===e||"smtp"===e},Ne=(0,r.w)("slack_notification",xe,ye),Ae=!ye,Ce=Ae||H,Oe=Ae||G,Pe=Ae||H,Te=(Ae||G)&&(Ae||Ne);(0,i.useLayoutEffect)(function(){var e=sessionStorage.getItem("afm-notifications-subtab");if(!Se(e)||"smtp"===e&&_e){var t=(window.location.hash||"").replace(/^#/,"").replace(/^\//,"");if(t.startsWith("notifications/")){var n=t.split("/");if(n.length>1){var i=n[1].split("?")[0].toLowerCase();if(Se(i)&&("smtp"!==i||!_e))return sessionStorage.setItem("afm-notifications-subtab",i),void W(i)}}if("notifications"===t)return sessionStorage.setItem("afm-notifications-subtab","email"),void W("email");sessionStorage.setItem("afm-notifications-subtab","email"),W("email")}else W(e)},[]),(0,i.useEffect)(function(){U&&sessionStorage.setItem("afm-notifications-subtab",U)},[U]),(0,i.useEffect)(function(){var e=function(){var e=(window.location.hash||"").replace(/^#/,"").replace(/^\//,"");if(e.startsWith("notifications/")){var t=e.split("/");if(t.length>1){var n=t[1].split("?")[0].toLowerCase();if(Se(n)&&("smtp"!==n||!_e))return sessionStorage.setItem("afm-notifications-subtab",n),void W(function(e){return e!==n?n:e})}}if("notifications"===e){var i=sessionStorage.getItem("afm-notifications-subtab")||"email",a=Se(i)?i:"email",r="#/notifications/".concat(a);if(window.history&&window.history.replaceState){var o=window.location.href.split("#")[0]+r;window.history.replaceState(null,"",o)}else window.location.hash=r;W(function(e){return e!==a?a:e})}};return window.addEventListener("hashchange",e),function(){window.removeEventListener("hashchange",e)}},[]);var qe=(0,i.useRef)(!0);(0,i.useEffect)(function(){if(qe.current)qe.current=!1;else{var e="#/notifications/".concat(U);if(window.history&&window.history.replaceState){var t=window.location.href.split("#")[0]+e;window.history.replaceState(null,"",t)}else window.location.hash=e}},[U]);var Ee=[{value:"rm",label:"Delete File/Folder"},{value:"mkfile",label:"Create File"},{value:"mkdir",label:"Create Folder"}],Ie=[{code:"{username}",desc:"This will fetch the user's name who did the action"},{code:"{ip_address}",desc:"This will fetch the user's IP Address"},{code:"{event}",desc:"This will fetch which action the user performed (created/deleted)"},{code:"{item_type}",desc:"This will fetch whether the target is a file or folder"},{code:"{file_name}",desc:"This will fetch the file name on which that action was done"},{code:"{ext}",desc:"This will fetch the extension or mime type for the target item"},{code:"{date_time}",desc:"This will fetch the date the user acted on the file"},{code:"{site_name}",desc:"This will fetch the site name on which the action was performed"}];(0,i.useEffect)(function(){if(w&&y){var e=new URLSearchParams(window.location.search).get("webhook_url"),t=Promise.resolve();e&&(t=fetch(_(),{method:"POST",credentials:"same-origin",headers:{"X-WP-Nonce":y,"Content-Type":"application/json"},body:JSON.stringify({slack:{webhook_url:decodeURIComponent(e),enable:"yes"}})}).then(function(){var e=window.location.href.split("&webhook_url=")[0].split("?webhook_url=")[0];window.history.replaceState({},"",e)}).catch(function(e){console.error("AFM Notifications webhook save error:",e)})),t.then(function(){setTimeout(function(){fetch(_({_t:String(Date.now())}),{credentials:"same-origin",headers:{"X-WP-Nonce":y}}).then(function(e){return e.ok?e.json():Promise.reject("Failed to fetch")}).then(function(t){var n,i,a,r,o,l,s,c,u;C(t),z("yes"===(null==t||null===(n=t.email)||void 0===n?void 0:n.enable)),X("yes"===(null==t||null===(i=t.slack)||void 0===i?void 0:i.enable)),$((null==t||null===(a=t.email)||void 0===a?void 0:a.email)||""),V(N(null==t||null===(r=t.email)||void 0===r?void 0:r.subject)),pe(Array.isArray(null==t||null===(o=t.email)||void 0===o?void 0:o.events)?t.email.events:[]),le(ie(null==t||null===(l=t.email)||void 0===l?void 0:l.message,ne)),we(Array.isArray(null==t||null===(s=t.slack)||void 0===s?void 0:s.events)?t.slack.events:[]),ue(ie(null==t||null===(c=t.slack)||void 0===c?void 0:c.message,ne));var d=e?decodeURIComponent(e):"";me(d||(null==t||null===(u=t.slack)||void 0===u?void 0:u.webhook_url)||""),T(!1)}).catch(function(e){console.error("AFM Notifications fetch error:",e),T(!1)})},500)})}else console.warn("AFM Notifications: Missing API root or nonce")},[w,y]);var Re=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e&&e.preventDefault&&e.preventDefault(),ye){if(A&&!E){I(!0),F(null);var n={email:u({enable:H?"yes":"no",email:Y||"",events:ve||[],subject:N(Q),message:ae(oe)||""},(null==t?void 0:t.email)||{}),slack:u({enable:G?"yes":"no",webhook_url:fe||"",events:ge||[],message:ae(ce)||""},(null==t?void 0:t.slack)||{})};fetch(_(),{method:"POST",credentials:"same-origin",headers:{"X-WP-Nonce":y,"Content-Type":"application/json"},body:JSON.stringify(n)}).then(function(e){return e.ok?e.json():Promise.reject(e)}).then(function(e){if(F({type:"success",text:e.message||"Notification settings saved successfully."}),I(!1),setTimeout(function(){return F(null)},5e3),null!=e&&e.email||null!=e&&e.slack){var t=u(u({},A||{}),{},{email:e.email||(null==A?void 0:A.email),slack:e.slack||(null==A?void 0:A.slack)});return C(t),e.email&&(z("yes"===e.email.enable),$(e.email.email||""),V(N(e.email.subject)),pe(Array.isArray(e.email.events)?e.email.events:[]),le(ie(e.email.message,ne))),void(e.slack&&(X("yes"===e.slack.enable),we(Array.isArray(e.slack.events)?e.slack.events:[]),ue(ie(e.slack.message,ne)),me(e.slack.webhook_url||"")))}return fetch(_(),{credentials:"same-origin",headers:{"X-WP-Nonce":y}}).then(function(e){return e.ok?e.json():Promise.reject(e)}).then(function(e){var t,n,i,a,r,o,l,s,c;C(e),z("yes"===(null==e||null===(t=e.email)||void 0===t?void 0:t.enable)),X("yes"===(null==e||null===(n=e.slack)||void 0===n?void 0:n.enable)),$((null==e||null===(i=e.email)||void 0===i?void 0:i.email)||""),V(N(null==e||null===(a=e.email)||void 0===a?void 0:a.subject)),pe(Array.isArray(null==e||null===(r=e.email)||void 0===r?void 0:r.events)?e.email.events:[]),le(ie(null==e||null===(o=e.email)||void 0===o?void 0:o.message,ne)),we(Array.isArray(null==e||null===(l=e.slack)||void 0===l?void 0:l.events)?e.slack.events:[]),ue(ie(null==e||null===(s=e.slack)||void 0===s?void 0:s.message,ne)),me((null==e||null===(c=e.slack)||void 0===c?void 0:c.webhook_url)||"")})}).catch(function(e){console.error("AFM Notifications save error:",e),F({type:"error",text:e.message||"Failed to save notification settings."}),I(!1),setTimeout(function(){return F(null)},5e3)})}}else alert("Pro version is required for notifications.")},Le=(null===(p=window.afmReact)||void 0===p?void 0:p.pluginUrl)||(null===(b=window.afm_object)||void 0===b?void 0:b.plugin_url)||"/wp-content/plugins/file-manager-advanced/",Fe="https://slack.advancedfilemanager.com?install_application=true&redirect_to=".concat(encodeURIComponent("".concat(window.location.origin,"/wp-admin/admin.php?page=file_manager_advanced_ui#/notifications/slack"))),Me=(0,i.useCallback)(function(e,t){var n=(t||"").trim();if(n&&e)if(/^https?:\/\//i.test(n)||n.startsWith("data:image/")){var i=e.getSelection(!0)||{index:e.getLength()};e.insertEmbed(i.index,"image",n,"user"),e.setSelection(i.index+1,0,"user")}else window.alert("Please enter a valid image URL (http:// or https://).")},[]),Ue=(0,i.useMemo)(function(){return{toolbar:{container:[[{header:[1,2,3,4,!1]}],["bold","italic","underline","strike"],[{align:""},{align:"center"},{align:"right"}],["clean"],[{list:"ordered"},{list:"bullet"}],["image","link"]],handlers:{image:function(){var e=this.quill;if(e){if(window.wp&&wp.media){var t=wp.media({title:"Select or Upload Image",button:{text:"Use this image"},multiple:!1,library:{type:"image"}});return t.on("select",function(){var n=t.state().get("selection").first();if(n){var i=n.toJSON();Me(e,i.url||i.link||"")}}),void t.open()}var n=window.prompt("Enter image URL");n&&Me(e,n)}},link:function(){j(this.quill)}}}}},[Me]),We=(0,i.useMemo)(function(){return["header","bold","italic","underline","strike","align","list","image","link"]},[]),De=(0,i.useMemo)(function(){return{toolbar:{container:[["bold","italic","strike"],["clean"],[{list:"ordered"},{list:"bullet"}],["link"]],handlers:{link:function(){j(this.quill)}}}}},[]),He=(0,i.useMemo)(function(){return["bold","italic","strike","list","link"]},[]),ze=(0,i.useCallback)(function(e){le("string"==typeof e?e:"")},[]),Be=(0,i.useCallback)(function(e){ue("string"==typeof e?e:"")},[]),Ge=function(e){sessionStorage.setItem("afm-notifications-hash-just-set","true"),W(e);var t="#/notifications/".concat(e);if(window.history&&window.history.replaceState){var n=window.location.href.split("#")[0]+t;window.history.replaceState(null,"",n)}else window.location.hash=t;setTimeout(function(){sessionStorage.removeItem("afm-notifications-hash-just-set")},2e3)};if(P)return(0,l.jsxs)("div",{className:"afm-settings-shell",children:[(0,l.jsxs)("div",{className:"afm-settings-subnav","aria-hidden":"true",children:[(0,l.jsx)("span",{className:"afm-settings-subnav__tab is-active",children:"Email Notifications"}),(0,l.jsx)("span",{className:"afm-settings-subnav__tab",children:"Slack Notifications"}),!_e&&(0,l.jsx)("span",{className:"afm-settings-subnav__tab",children:"SMTP"})]}),(0,l.jsx)("div",{className:"afm-settings-body",children:(0,l.jsxs)("div",{className:"afm-settings-card",children:[(0,l.jsx)("style",{children:"\n @keyframes afm-skeleton-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n .afm-skeleton {\n background-color: #e2e8f0;\n background-image: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);\n background-size: 200% 100%;\n animation: afm-skeleton-shimmer 1.4s linear infinite;\n }\n "}),(0,l.jsx)("div",{className:"afm-skeleton",style:{height:"40px",width:"260px",borderRadius:"6px",marginBottom:"30px"}}),(0,l.jsx)("div",{className:"afm-skeleton",style:{height:"42px",width:"100%",maxWidth:"600px",borderRadius:"6px",marginBottom:"12px"}}),(0,l.jsx)("div",{className:"afm-skeleton",style:{height:"42px",width:"100%",maxWidth:"600px",borderRadius:"6px",marginBottom:"12px"}}),(0,l.jsx)("div",{className:"afm-skeleton",style:{height:"120px",width:"100%",maxWidth:"600px",borderRadius:"6px"}})]})})]});var Xe="smtp"!==U&&("email"===U&&Pe||"slack"===U&&Te),Je=E||!ye||"slack"===U&&!Ne,Ye=function(e){var t=e.id,n=e.name,i=e.checked,a=e.disabled,r=e.onChange;return(0,l.jsx)("button",{type:"button",id:t,name:n,role:"switch","aria-checked":i,disabled:a,className:"afm-switch".concat(i?" is-on":""),onClick:function(e){e.preventDefault(),!a&&r&&r({target:{checked:!i}})},children:(0,l.jsx)("span",{className:"afm-switch__knob","aria-hidden":"true"})})},$e=function(){return(0,l.jsxs)("div",{className:"afm-notif-placeholders",children:[(0,l.jsx)("p",{className:"afm-notif-placeholders__title",children:"Available placeholders:"}),(0,l.jsx)("div",{className:"afm-notif-placeholders__list",children:Ie.map(function(e,t){return(0,l.jsxs)("p",{className:"afm-notif-placeholders__item",children:[(0,l.jsx)("span",{className:"afm-notif-placeholders__code",children:e.code}),"- ",e.desc]},t)})})]})},Ke=function(e){var t=e.name,n=e.selected,i=e.onToggle,a=e.disabled;return(0,l.jsxs)("div",{className:"afm-form-field",children:[(0,l.jsx)("div",{className:"afm-field-head",children:(0,l.jsx)("label",{className:"afm-field-label",children:"Events Notification"})}),(0,l.jsx)("div",{className:"afm-notif-events",children:Ee.map(function(e){var r="".concat(t.replace(/[^a-z0-9_-]/gi,"-"),"-").concat(e.value);return(0,l.jsxs)("div",{className:"afm-notif-events__item".concat(a?" is-disabled":""),children:[(0,l.jsx)("input",{id:r,type:"checkbox",name:t,value:e.value,checked:n.includes(e.value),onChange:function(t){return i(e.value,t.target.checked)},disabled:a}),(0,l.jsx)("label",{htmlFor:r,children:e.label})]},e.value)})})]})};return(0,l.jsxs)("div",{className:"afm-settings-shell",children:[(0,l.jsxs)("nav",{className:"afm-settings-subnav","aria-label":"Notification channels",children:[(0,l.jsx)("a",{href:"#/notifications/email",onClick:function(e){e.preventDefault(),Ge("email")},className:"afm-settings-subnav__tab".concat("email"===U?" is-active":""),children:"Email Notifications"}),(0,l.jsx)("a",{href:"#/notifications/slack",onClick:function(e){e.preventDefault(),Ge("slack")},className:"afm-settings-subnav__tab".concat("slack"===U?" is-active":""),children:"Slack Notifications"}),!_e&&(0,l.jsx)("a",{href:"#/notifications/smtp",onClick:function(e){e.preventDefault(),Ge("smtp")},className:"afm-settings-subnav__tab".concat("smtp"===U?" is-active":""),children:"SMTP"})]}),(0,l.jsx)("div",{className:"afm-settings-body",children:(0,l.jsxs)("div",{className:"afm-settings-card",children:[L&&(0,l.jsxs)("div",{className:"afm-snackbar afm-snackbar-".concat("success"===L.type?"success":"error"),onClick:function(){return F(null)},style:{animation:"afm-slideIn 0.3s ease-out"},children:[(0,l.jsx)("span",{style:{fontSize:"14px",lineHeight:"1.5",flex:"1"},children:L.text}),(0,l.jsx)("button",{type:"button",className:"afm-snackbar-close",onClick:function(e){e.preventDefault(),e.stopPropagation(),F(null)},"aria-label":"Dismiss",children:"×"})]}),"smtp"===U&&!_e&&(0,l.jsx)("iframe",{title:"SMTP",src:ke,className:"afm-notif-smtp-frame"}),"smtp"!==U&&(0,l.jsxs)("form",{onSubmit:function(e){return Re(e)},className:"afm-stacked-form afm-notif-form",children:["email"===U&&(0,l.jsx)(o.A,{shouldShow:!ye,children:(0,l.jsxs)("div",{className:"afm-notif-channel",children:[(0,l.jsxs)("div",{className:"afm-notif-channel__head",children:[(0,l.jsxs)("div",{className:"afm-notif-channel__title",children:[(0,l.jsx)("span",{className:"afm-notif-channel__icon","aria-hidden":"true",children:(0,l.jsx)("img",{src:"".concat(Le,"application/assets/images/email_notification.svg"),alt:"",width:"24",height:"24"})}),(0,l.jsx)("span",{className:"afm-field-label",children:"Email Notifications"})]}),(0,l.jsx)(Ye,{id:"email_enable",name:"email_enable",checked:Ce,disabled:!ye,onChange:function(){var e=!H;z(e),Re(null,{email:{enable:e?"yes":"no"}})}})]}),Pe&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"afm-form-field",children:[(0,l.jsx)("div",{className:"afm-field-head",children:(0,l.jsx)("label",{className:"afm-field-label",htmlFor:"email_address",children:"Emails"})}),(0,l.jsxs)("div",{className:"afm-field-input",children:[(0,l.jsx)("input",{type:"email",id:"email_address",name:"email_address",value:Y,onChange:function(e){return $(e.target.value)},disabled:!ye,placeholder:"Enter email address"}),(0,l.jsx)("p",{className:"afm-field-help",children:"Email address to send notification."})]})]}),(0,l.jsx)(Ke,{name:"email_events[]",selected:ve,disabled:!ye,onToggle:function(e,t){pe(function(n){return t?[].concat(s(n),[e]):n.filter(function(t){return t!==e})})}}),(0,l.jsxs)("div",{className:"afm-form-field",children:[(0,l.jsx)("div",{className:"afm-field-head",children:(0,l.jsx)("label",{className:"afm-field-label",htmlFor:"email_subject",children:"Emails Subject"})}),(0,l.jsxs)("div",{className:"afm-field-input",children:[(0,l.jsx)("input",{type:"text",id:"email_subject",name:"email_subject",value:Q,onChange:function(e){return V(e.target.value)},disabled:!ye,placeholder:S}),(0,l.jsx)("p",{className:"afm-field-help",children:"Subject of the email notification."})]})]}),(0,l.jsxs)("div",{className:"afm-form-field afm-form-field--editor",children:[(0,l.jsx)("div",{className:"afm-field-head",children:(0,l.jsx)("label",{className:"afm-field-label",children:"Emails Message"})}),(0,l.jsxs)("div",{className:"afm-field-input",children:[(0,l.jsx)(k,{value:oe,onChange:ze,readOnly:!ye,modules:Ue,formats:We}),(0,l.jsx)("input",{type:"hidden",name:"email_message",value:oe}),(0,l.jsxs)("p",{className:"afm-field-help",children:["Message body of the email notification. You can use placeholders like ","{file_name}",", ","{action}"," etc."]}),(0,l.jsx)($e,{})]})]})]})]})}),"slack"===U&&(0,l.jsx)(o.A,{shouldShow:!ye||!Ne,children:(0,l.jsxs)("div",{className:"afm-notif-channel",children:[(0,l.jsxs)("div",{className:"afm-notif-channel__head",children:[(0,l.jsxs)("div",{className:"afm-notif-channel__title",children:[(0,l.jsx)("span",{className:"afm-notif-channel__icon","aria-hidden":"true",children:(0,l.jsx)("img",{src:"".concat(Le,"application/assets/images/slack_notification.svg"),alt:"",width:"24",height:"24"})}),(0,l.jsx)("span",{className:"afm-field-label",children:"Slack Notifications"})]}),(0,l.jsx)(Ye,{id:"slack_enable",name:"slack_enable",checked:Oe,disabled:!ye||!Ne,onChange:function(){var e=!G;X(e),Re(null,{slack:{enable:e?"yes":"no"}})}})]}),Te&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"afm-form-field",children:[(0,l.jsx)("div",{className:"afm-field-head",children:(0,l.jsx)("label",{className:"afm-field-label",htmlFor:"slack_webhook_url",children:"Slack Webhook URL"})}),(0,l.jsxs)("div",{className:"afm-field-input",children:[(0,l.jsx)("input",{type:"url",id:"slack_webhook_url",name:"slack_webhook_url",value:fe,onChange:function(e){return me(e.target.value)},disabled:!ye||!Ne,placeholder:"Webhook.slack.com"}),(0,l.jsxs)("p",{className:"afm-field-help",children:["Enable your Slack Webhook URL to receive notifications."," ",(0,l.jsx)("a",{className:"afm-field-link",href:Fe,target:"_blank",rel:"noopener noreferrer",children:"Click here to get your webhook URL."})]})]})]}),(0,l.jsx)(Ke,{name:"slack_events[]",selected:ge,disabled:!ye||!Ne,onToggle:function(e,t){we(function(n){return t?[].concat(s(n),[e]):n.filter(function(t){return t!==e})})}}),(0,l.jsxs)("div",{className:"afm-form-field afm-form-field--editor",children:[(0,l.jsx)("div",{className:"afm-field-head",children:(0,l.jsx)("label",{className:"afm-field-label",children:"Slack Message"})}),(0,l.jsxs)("div",{className:"afm-field-input",children:[(0,l.jsx)(k,{value:ce,onChange:Be,readOnly:!ye||!Ne,modules:De,formats:He}),(0,l.jsx)("input",{type:"hidden",name:"slack_message",value:ce}),(0,l.jsxs)("p",{className:"afm-field-help",children:["Customize the message to be sent to Slack. You can use placeholders like ","{file_name}",", ","{action}"," etc."]}),(0,l.jsx)($e,{})]})]})]})]})}),Xe&&(0,l.jsx)("div",{className:"afm-notif-actions",children:(0,l.jsx)("button",{type:"submit",name:"submit",id:"submit",className:"button button-primary afm-teal-button",disabled:Je,children:E?"Saving...":"Save Changes"})})]})]})})]})}},5688(e,t,n){function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,a,r,o,l=[],s=!0,c=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(i=r.call(n)).done)&&(l.push(i.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw a}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function r(){var e,t;return function(e){if(!e||"string"!=typeof e)return e;try{var t=new URL(e,window.location.origin);return t.protocol=window.location.protocol,t.host=window.location.host,t.toString()}catch(t){return e.startsWith("/")?"".concat(window.location.origin).concat(e):e}}((null===(e=window.wpApiSettings)||void 0===e?void 0:e.root)||(null===(t=window.afmReact)||void 0===t?void 0:t.jsonURL)||"".concat(window.location.origin,"/?rest_route=/"))}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r(),a=n.endsWith("/")?n:"".concat(n,"/"),o=String(e||"").replace(/^\//,""),l=Object.entries(t).filter(function(e){var t=i(e,2)[1];return null!=t&&""!==t}).map(function(e){var t=i(e,2),n=t[0],a=t[1];return"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(String(a)))});if(a.includes("rest_route=")){var s="".concat(a.split("rest_route=")[0],"rest_route="),c="".concat(s,"/").concat(o);return l.length&&(c+="&".concat(l.join("&"))),c}if(a.includes("/wp-json")){var u=function(e){try{return new URL(e,window.location.origin).origin}catch(e){return window.location.origin}}(a),d="".concat(u,"/?rest_route=/").concat(o);return l.length&&(d+="&".concat(l.join("&"))),d}var f="".concat(a).concat(o);return l.length&&(f+="?".concat(l.join("&"))),f}n.d(t,{_H:()=>o,lA:()=>r})},7850(e,t,n){n.d(t,{w:()=>a});var i={basic:{dropbox:!1,googledrive:!1,onedrive:!1,amazons3:!1,github:!1,googlecloud:!1,pcloud:!1,cloudflarer2:!1,wasabi:!1,digitalocean:!1,email_notification:!0,slack_notification:!1,filelogs:!0,adminer:!1,frontend_access:!0,public_access:!0,role_based_access:!0,individual_access:!0,private_folders:!1,hide_sensitive_files:!0,multilingual:!0,flexible_view:!0,flexible_root:!0,operations_control:!0,complete_operations:!0,advance_themes:!1,gutenberg_blocks:!0,code_editor_themes:!1,ai_integration:!1},professional:{dropbox:!0,googledrive:!0,onedrive:!0,amazons3:!0,github:!0,googlecloud:!0,pcloud:!0,cloudflarer2:!0,wasabi:!0,digitalocean:!1,email_notification:!0,slack_notification:!0,filelogs:!0,adminer:!1,frontend_access:!0,public_access:!0,role_based_access:!0,individual_access:!0,private_folders:!0,hide_sensitive_files:!0,multilingual:!0,flexible_view:!0,flexible_root:!0,operations_control:!0,complete_operations:!0,advance_themes:!0,gutenberg_blocks:!0,code_editor_themes:!0,ai_integration:!1},business:{dropbox:!0,googledrive:!0,onedrive:!0,amazons3:!0,github:!0,googlecloud:!0,pcloud:!0,cloudflarer2:!0,wasabi:!0,digitalocean:!1,email_notification:!0,slack_notification:!0,filelogs:!0,adminer:!0,frontend_access:!0,public_access:!0,role_based_access:!0,individual_access:!0,private_folders:!0,hide_sensitive_files:!0,multilingual:!0,flexible_view:!0,flexible_root:!0,operations_control:!0,complete_operations:!0,advance_themes:!0,gutenberg_blocks:!0,code_editor_themes:!0,ai_integration:!0}};function a(e,t,n){return!!n&&"free"!==t&&!!i[t]&&!0===i[t][e]}}}]);
//# sourceMappingURL=821.f87c25ed.chunk.js.map