[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: wp-media.js
/*! For license information please see wp-media.js.LICENSE.txt */ !function(){"use strict";var e={"./packages/packages/libs/wp-media/src/errors.ts":function(e,t,a){a.r(t),a.d(t,{WpMediaNotAvailableError:function(){return r},WpPluploadSettingsNotAvailableError:function(){return i}});var n=a("@elementor/utils");const r=(0,n.createError)({code:"wp_media_not_available",message:"`wp.media` is not available, make sure the `media-models` handle is set in the dependencies array"}),i=(0,n.createError)({code:"wp_plupload_settings_not_available",message:"`_wpPluploadSettings` is not available, make sure a wp media uploader is open"})},"./packages/packages/libs/wp-media/src/get-media-attachment.ts":function(e,t,a){a.r(t),a.d(t,{getMediaAttachment:function(){return getMediaAttachment}});var n=a("./packages/packages/libs/wp-media/src/media.ts"),r=a("./packages/packages/libs/wp-media/src/normalize.ts");async function getMediaAttachment({id:e}){if(!e)return null;const t=(0,n.default)().attachment(e),a=t.toJSON();if("url"in a)return(0,r.default)(a);try{return(0,r.default)(await t.fetch())}catch{return null}}},"./packages/packages/libs/wp-media/src/hooks/use-wp-media-attachment.ts":function(e,t,a){a.r(t),a.d(t,{default:function(){return useWpMediaAttachment}});var n=a("@elementor/query"),r=a("./packages/packages/libs/wp-media/src/get-media-attachment.ts");function useWpMediaAttachment(e){return(0,n.useQuery)({queryKey:["wp-attachment",e],queryFn:()=>(0,r.getMediaAttachment)({id:e}),enabled:!!e})}},"./packages/packages/libs/wp-media/src/hooks/use-wp-media-frame.ts":function(e,t,a){a.r(t),a.d(t,{default:function(){return useWpMediaFrame}});var n=a("react"),r=a("./packages/packages/libs/wp-media/src/media.ts"),i=a("./packages/packages/libs/wp-media/src/normalize.ts"),s=a("./packages/packages/libs/wp-media/src/wp-plupload-settings.ts");function useWpMediaFrame(e){const t=(0,n.useRef)();return(0,n.useEffect)(()=>()=>{cleanupFrame(t.current)},[]),{open:(a={})=>{cleanupFrame(t.current),t.current=function createFrame({onSelect:e,multiple:t,mediaTypes:a,selected:n,title:c,mode:o="browse"}){const u=(0,r.default)()({title:c,multiple:t,library:{type:getMimeTypes(a)}}).on("open",()=>{!function setTypeCaller(e){e.uploader.uploader.param("uploadTypeCaller","elementor-wp-media-upload")}(u),function applyMode(e,t="browse"){e.content.mode(t)}(u,o),function applySelection(e,t){const a=("number"==typeof t?[t]:t)?.filter(e=>!!e).map(e=>(0,r.default)().attachment(e));e.state().get("selection").set(a||[])}(u,n)}).on("close",()=>cleanupFrame(u)).on("insert select",()=>function select(e,t,a){const n=e.state().get("selection").toJSON().map(i.default),r=a;r(t?n:n[0])}(u,t,e));return function handleExtensions(e,t){const a=(0,s.default)().defaults.filters.mime_types?.[0]?.extensions;e.on("ready",()=>{(0,s.default)().defaults.filters.mime_types=[{extensions:getExtensions(t)}]}),e.on("close",()=>{(0,s.default)().defaults.filters.mime_types=a?[{extensions:a}]:[]})}(u,a),u}({...e,...a}),t.current?.open()}}}function cleanupFrame(e){e?.detach(),e?.remove()}const c=["avif","bmp","gif","ico","jpe","jpeg","jpg","png","webp"];function getMimeTypes(e){const t={image:c.map(e=>`image/${e}`),svg:["image/svg+xml"]};return e.reduce((e,a)=>e.concat(t[a]),[])}function getExtensions(e){const t={image:c,svg:["svg"]};return e.reduce((e,a)=>e.concat(t[a]),[]).join(",")}},"./packages/packages/libs/wp-media/src/media.ts":function(e,t,a){a.r(t);var n=a("./packages/packages/libs/wp-media/src/errors.ts");const r=window;t.default=()=>{if(!r.wp?.media)throw new n.WpMediaNotAvailableError;return r.wp.media}},"./packages/packages/libs/wp-media/src/normalize.ts":function(e,t,a){function normalize(e){const{filesizeInBytes:t,filesizeHumanReadable:a,author:n,authorName:r,...i}=e;return{...i,filesize:{inBytes:t,humanReadable:a},author:{id:parseInt(n),name:r}}}a.r(t),a.d(t,{default:function(){return normalize}})},"./packages/packages/libs/wp-media/src/wp-plupload-settings.ts":function(e,t,a){a.r(t);var n=a("./packages/packages/libs/wp-media/src/errors.ts");const r=window;t.default=()=>{if(!r._wpPluploadSettings)throw new n.WpPluploadSettingsNotAvailableError;return r._wpPluploadSettings}},"@elementor/query":function(e){e.exports=window.elementorV2.query},"@elementor/utils":function(e){e.exports=window.elementorV2.utils},react:function(e){e.exports=window.React}},t={};function __webpack_require__(a){var n=t[a];if(void 0!==n)return n.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};!function(){__webpack_require__.r(a),__webpack_require__.d(a,{getMediaAttachment:function(){return n.getMediaAttachment},useWpMediaAttachment:function(){return e.default},useWpMediaFrame:function(){return t.default}});var e=__webpack_require__("./packages/packages/libs/wp-media/src/hooks/use-wp-media-attachment.ts"),t=__webpack_require__("./packages/packages/libs/wp-media/src/hooks/use-wp-media-frame.ts"),n=__webpack_require__("./packages/packages/libs/wp-media/src/get-media-attachment.ts")}(),(window.elementorV2=window.elementorV2||{}).wpMedia=a}(),window.elementorV2.wpMedia?.init?.(); //# sourceMappingURL=wp-media.js.map
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.53 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002