관리-도구
편집 파일: 14-ceb9c6b1a7045c9634b7.js
(window.webpackJsonp_font_awesome_admin=window.webpackJsonp_font_awesome_admin||[]).push([[14],{164:function(e,t,n){"use strict";n.r(t),n.d(t,"CONFLICT_DETECTION_SCANNER_DURATION_MIN",(function(){return m})),n.d(t,"preprocessResponse",(function(){return y})),n.d(t,"resetPendingOptions",(function(){return D})),n.d(t,"resetOptionsFormState",(function(){return P})),n.d(t,"addPendingOption",(function(){return R})),n.d(t,"updatePendingUnregisteredClientsForDeletion",(function(){return w})),n.d(t,"resetUnregisteredClientsDeletionStatus",(function(){return v})),n.d(t,"resetPendingBlocklistSubmissionStatus",(function(){return A})),n.d(t,"submitPendingUnregisteredClientDeletions",(function(){return M})),n.d(t,"updatePendingBlocklist",(function(){return U})),n.d(t,"submitPendingBlocklist",(function(){return j})),n.d(t,"checkPreferenceConflicts",(function(){return k})),n.d(t,"chooseAwayFromKitConfig",(function(){return F})),n.d(t,"chooseIntoKitConfig",(function(){return L})),n.d(t,"queryKits",(function(){return W})),n.d(t,"submitPendingOptions",(function(){return B})),n.d(t,"updateApiToken",(function(){return q})),n.d(t,"userAttemptToStopScanner",(function(){return K})),n.d(t,"reportDetectedConflicts",(function(){return G})),n.d(t,"snoozeV3DeprecationWarning",(function(){return x})),n.d(t,"setActiveAdminTab",(function(){return $})),n.d(t,"setConflictDetectionScanner",(function(){return X}));var o=n(171),s=n.n(o),r=n(180),c=n.n(r),i=n(29),a=n.n(i),u=n(0),l=n.n(u),d=n(174),f=n.n(d),_=n(167),p=n(150),E=n(166),T=n.n(E);const N=s.a.create(),m=10,g=Object(p.__)("Couldn't save those changes","font-awesome"),O=Object(p.__)("Changes not saved because your WordPress server does not allow this kind of request. Look for details in the browser console.","font-awesome"),h=Object(p.__)("Couldn't check preferences","font-awesome"),S=Object(p.__)("A request to your WordPress server never received a response","font-awesome"),I=Object(p.__)("A request to your WordPress server failed","font-awesome"),b=Object(p.__)("Couldn't start the scanner","font-awesome"),C=Object(p.__)("Couldn't snooze","font-awesome");function y(e){const t=T()(e,"headers.fontawesome-confirmation");if(204===e.status&&""!==e.data)return Object(_.b)({error:null,confirmed:t,trimmed:e.data,expectEmpty:!0}),e.data={},e;const n=l()(e,"data",null),o="string"==typeof n&&a()(n)>0,s=o?function(e){if(!e||""===e)return null;const t=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=null,s=null;if("string"!=typeof t)return null;if(n>=t.length)return null;try{return o=JSON.parse(t.slice(n)),{start:n,parsed:o}}catch(e){const o=t.indexOf("[",n+1),r=t.indexOf("{",n+1);if(-1===o&&-1===r)return null;s=-1!==o&&-1!==r?o<r?o:r:-1!==r?r:o}return null===s?null:e(t,s)}(e);if(null===t)return null;{const{start:n,parsed:o}=t;return{start:n,json:e.slice(n),trimmed:e.slice(0,n),parsed:o}}}(n):{};o&&s&&(e.data=l()(s,"parsed"));const r=l()(s,"trimmed",""),c=l()(e,"data.errors",null);if(e.status>=400){if(c)e.uiMessage=Object(_.b)({error:e.data,confirmed:t,trimmed:r});else{const n=l()(e,"config.method","").toUpperCase(),o=l()(e,"config.url"),s=e.status,r=l()(e,"statusText"),c=Object(_.d)(e),i=Object(_.c)(l()(e,"headers",{})),a=Object(_.c)(l()(e,"config.headers",{})),u=l()(e,"data");e.uiMessage=Object(_.b)({confirmed:t,requestData:c,requestMethod:n,requestUrl:o,responseHeaders:i,requestHeaders:a,responseStatus:s,responseStatusText:r,responseData:u}),405===s&&(e.uiMessage=O)}return e}if(e.status<400&&e.status>=300)return t&&""===r||(e.uiMessage=Object(_.b)({error:null,confirmed:t,trimmed:r})),e;if(c){const n=!0;return e.falsePositive=!0,e.uiMessage=Object(_.b)({error:e.data,confirmed:t,falsePositive:n,trimmed:r}),e}{const n=l()(e,"data.error",null);return n?(e.uiMessage=Object(_.b)({error:n,ok:!0,confirmed:t,trimmed:r}),e):(t||(e.uiMessage=Object(_.b)({error:null,ok:!0,confirmed:t,trimmed:r})),e)}}function D(){return{type:"RESET_PENDING_OPTIONS"}}function P(){return{type:"OPTIONS_FORM_STATE_RESET"}}function R(e){return function(t,n){const{options:o}=n();for(const[n,s]of c()(e))t(o[n]===s?{type:"RESET_PENDING_OPTION",change:{[n]:s}}:{type:"ADD_PENDING_OPTION",change:{[n]:s}})}}function w(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"UPDATE_PENDING_UNREGISTERED_CLIENTS_FOR_DELETION",data:e}}function v(){return{type:"DELETE_UNREGISTERED_CLIENTS_RESET"}}function A(){return{type:"BLOCKLIST_UPDATE_RESET"}}function M(){return function(e,t){const{apiNonce:n,apiUrl:o,unregisteredClientsDeletionStatus:s}=t(),r=l()(s,"pending",null);if(!r||0===a()(r))return;e({type:"DELETE_UNREGISTERED_CLIENTS_START"});const c=t=>{let{uiMessage:n}=t;e({type:"DELETE_UNREGISTERED_CLIENTS_END",success:!1,message:n||g})};return N.delete(o+"/conflict-detection/conflicts",{data:r,headers:{"X-WP-Nonce":n}}).then(t=>{const{status:n,data:o,falsePositive:s}=t;s?c(t):e({type:"DELETE_UNREGISTERED_CLIENTS_END",success:!0,data:204===n?null:o,message:""})}).catch(c)}}function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"UPDATE_PENDING_BLOCKLIST",data:e}}function j(){return function(e,t){const{apiNonce:n,apiUrl:o,blocklistUpdateStatus:s}=t(),r=l()(s,"pending",null);if(!r)return;e({type:"BLOCKLIST_UPDATE_START"});const c=t=>{let{uiMessage:n}=t;e({type:"BLOCKLIST_UPDATE_END",success:!1,message:n||g})};return N.put(o+"/conflict-detection/conflicts/blocklist",r,{headers:{"X-WP-Nonce":n}}).then(t=>{const{status:n,data:o,falsePositive:s}=t;s?c(t):e({type:"BLOCKLIST_UPDATE_END",success:!0,data:204===n?null:o,message:""})}).catch(c)}}function k(){return function(e,t){e({type:"PREFERENCE_CHECK_START"});const{apiNonce:n,apiUrl:o,options:s,pendingOptions:r}=t(),c=t=>{let{uiMessage:n}=t;e({type:"PREFERENCE_CHECK_END",success:!1,message:n||h})};return N.post(o+"/preference-check",{...s,...r},{headers:{"X-WP-Nonce":n}}).then(t=>{const{data:n,falsePositive:o}=t;o?c(t):e({type:"PREFERENCE_CHECK_END",success:!0,message:"",detectedConflicts:n})}).catch(c)}}function F(e){let{activeKitToken:t}=e;return function(e,n){const{releases:o}=n();e({type:"CHOOSE_AWAY_FROM_KIT_CONFIG",activeKitToken:t,concreteVersion:l()(o,"latest_version_6")})}}function L(){return{type:"CHOOSE_INTO_KIT_CONFIG"}}function W(){return function(e,t){const{apiNonce:n,apiUrl:o,options:s}=t(),r=l()(s,"kitToken",null);e({type:"KITS_QUERY_START"});const c=t=>{let{uiMessage:n}=t;e({type:"KITS_QUERY_END",success:!1,message:n||Object(p.__)("Failed to fetch kits","font-awesome")})},i=t=>{let{uiMessage:n}=t;e({type:"OPTIONS_FORM_SUBMIT_END",success:!1,message:n||Object(p.__)("Couldn't update latest kit settings","font-awesome")})};return N.post(o+"/api","query {\n me {\n kits {\n name\n version\n technologySelected\n licenseSelected\n minified\n token\n shimEnabled\n autoAccessibilityEnabled\n status\n }\n }\n }",{headers:{"X-WP-Nonce":n}}).then(t=>{if(t.falsePositive)return c(t);const a=l()(t,"data.data");if(!l()(a,"me"))return e({type:"KITS_QUERY_END",success:!1,message:Object(p.__)("Failed to fetch kits. Regenerate your API Token and try again.","font-awesome")});if(e({type:"KITS_QUERY_END",data:a,success:!0}),!r)return;const u=l()(a,"me.kits",[]),d=f()(u,{token:r});if(!d)return;const _={};return s.usePro&&"pro"!==d.licenseSelected?_.usePro=!1:s.usePro||"pro"!==d.licenseSelected||(_.usePro=!0),"svg"===s.technology&&"svg"!==d.technologySelected?(_.technology="webfont",_.pseudoElements=!0):"svg"!==s.technology&&"svg"===d.technologySelected&&(_.technology="svg",_.pseudoElements=!1),s.version!==d.version&&(_.version=d.version),s.compat&&!d.shimEnabled?_.compat=!1:!s.compat&&d.shimEnabled&&(_.compat=!0),e({type:"OPTIONS_FORM_SUBMIT_START"}),N.put(o+"/config",{options:{...s,..._}},{headers:{"X-WP-Nonce":n}}).then(t=>{const{data:n,falsePositive:o}=t;if(o)return i(t);e({type:"OPTIONS_FORM_SUBMIT_END",data:n,success:!0,message:Object(p.__)("Kit changes saved","font-awesome")})}).catch(i)}).catch(c)}}function B(){return function(e,t){const{apiNonce:n,apiUrl:o,options:s,pendingOptions:r}=t();e({type:"OPTIONS_FORM_SUBMIT_START"});const c=t=>{let{uiMessage:n}=t;e({type:"OPTIONS_FORM_SUBMIT_END",success:!1,message:n||g})};return N.put(o+"/config",{options:{...s,...r}},{headers:{"X-WP-Nonce":n}}).then(t=>{const{data:n,falsePositive:o}=t;o?c(t):e({type:"OPTIONS_FORM_SUBMIT_END",data:n,success:!0,message:Object(p.__)("Changes saved","font-awesome")})}).catch(c)}}function q(e){let{apiToken:t=!1,runQueryKits:n=!1}=e;return function(e,o){const{apiNonce:s,apiUrl:r,options:c}=o();e({type:"OPTIONS_FORM_SUBMIT_START"});const i=t=>{let{uiMessage:n}=t;e({type:"OPTIONS_FORM_SUBMIT_END",success:!1,message:n||g})};return N.put(r+"/config",{options:{...c,apiToken:t}},{headers:{"X-WP-Nonce":s}}).then(t=>{const{data:o,falsePositive:s}=t;if(s)i(t);else if(e({type:"OPTIONS_FORM_SUBMIT_END",data:o,success:!0,message:Object(p.__)("API Token saved","font-awesome")}),n)return e(W())}).catch(i)}}function K(){return{type:"USER_STOP_SCANNER"}}function G(e){let{nodesTested:t={}}=e;return(e,n)=>{const{apiNonce:o,apiUrl:s,unregisteredClients:r,showConflictDetectionReporter:c}=n();if(c){if(a()(t.conflict)>0){const n=Object.keys(t.conflict).reduce((function(e,n){return e[n]=t.conflict[n],e}),{});e({type:"CONFLICT_DETECTION_SUBMIT_START",unregisteredClientsBeforeDetection:r,recentConflictsDetected:t.conflict});const c=t=>{let{uiMessage:n}=t;e({type:"CONFLICT_DETECTION_SUBMIT_END",success:!1,message:n||g})};return N.post(s+"/conflict-detection/conflicts",n,{headers:{"X-WP-Nonce":o}}).then(t=>{const{status:n,data:o,falsePositive:s}=t;s?c(t):e({type:"CONFLICT_DETECTION_SUBMIT_END",success:!0,data:204===n||0===a()(o)?null:o})}).catch(c)}e({type:"CONFLICT_DETECTION_NONE_FOUND"})}}}function x(){return(e,t)=>{const{apiNonce:n,apiUrl:o}=t();e({type:"SNOOZE_V3DEPRECATION_WARNING_START"});const s=t=>{let{uiMessage:n}=t;e({type:"SNOOZE_V3DEPRECATION_WARNING_END",success:!1,message:n||C})};return N.put(o+"/v3deprecation",{snooze:!0},{headers:{"X-WP-Nonce":n}}).then(t=>{const{falsePositive:n}=t;n?s(t):e({type:"SNOOZE_V3DEPRECATION_WARNING_END",success:!0,snooze:!0,message:""})}).catch(s)}}function $(e){return{type:"SET_ACTIVE_ADMIN_TAB",tab:e}}function X(e){let{enable:t=!0}=e;return function(e,n){const{apiNonce:o,apiUrl:s}=n(),r=t?"ENABLE_CONFLICT_DETECTION_SCANNER_END":"DISABLE_CONFLICT_DETECTION_SCANNER_END";e({type:t?"ENABLE_CONFLICT_DETECTION_SCANNER_START":"DISABLE_CONFLICT_DETECTION_SCANNER_START"});const c=t=>{let{uiMessage:n}=t;e({type:r,success:!1,message:n||b})};return N.put(s+"/conflict-detection/until",t?Math.floor(new Date((new Date).valueOf()+1e3*m*60)/1e3):Math.floor(new Date/1e3)-1,{headers:{"X-WP-Nonce":o}}).then(t=>{const{status:n,data:o,falsePositive:s}=t;s?c(t):e({type:r,data:204===n?null:o,success:!0})}).catch(c)}}N.interceptors.response.use(e=>y(e),e=>{if(e.response)e.response=y(e.response),e.uiMessage=l()(e,"response.uiMessage");else if(e.request){const t="fontawesome_request_noresponse",n={errors:{[t]:[S]},error_data:{[t]:{request:e.request}}};e.uiMessage=Object(_.b)({error:n})}else{const t="fontawesome_request_failed",n={errors:{[t]:[I]},error_data:{[t]:{failedRequestMessage:e.message}}};e.uiMessage=Object(_.b)({error:n})}return Promise.reject(e)})},167:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return C})),n.d(t,"c",(function(){return y}));var o=n(0),s=n.n(o),r=n(179),c=n.n(r),i=n(29),a=n.n(i),u=n(150);const l=Object(u.__)("Font Awesome WordPress Plugin Error Report","font-awesome"),d=Object(u.__)("D'oh! That failed big time.","font-awesome"),f=Object(u.__)("There was an error attempting to report the error.","font-awesome"),_=Object(u.__)("Oh no! Your web browser could not reach your WordPress server.","font-awesome"),p=Object(u.__)("It looks like your web browser session expired. Try logging out and log back in to WordPress admin.","font-awesome"),E=Object(u.__)("The last request was successful, but it also returned the following error(s), which might be helpful for troubleshooting.","font-awesome"),T=Object(u.__)("Error","font-awesome"),N=Object(u.__)("WARNING: The last request contained errors, though your WordPress server reported it as a success. This usually means there's a problem with your theme or one of your other plugins emitting output that is causing problems.","font-awesome"),m=Object(u.__)("WARNING: The last response from your WordPress server did not include the confirmation header that should be in all valid Font Awesome responses. This is a clue that some code from another theme or plugin is acting badly and causing the wrong headers to be sent.","font-awesome"),g=Object(u.__)("CONFIRMED: The last response from your WordPress server included the confirmation header that is expected for all valid responses from the Font Awesome plugin's code running on your WordPress server.","font-awesome"),O=Object(u.__)("WARNING: Invalid Data Trimmed from Server Response","font-awesome"),h=Object(u.__)("WARNING: We expected the last response from the server to contain no data, but it contained something unexpected.","font-awesome"),S=Object(u.__)("Your WordPress server returned an error for that last request, but there was no information about the error.","font-awesome"),I=["requestMethod","responseStatus","responseStatusText","requestUrl","requestData","responseHeaders","responseData","requestHeaders"];function b(e){if(!s()(e,"code"))return console.info(f),d;let t=null,n="";const o=s()(e,"message");o&&(n=n.concat(`message: ${o}\n`),t=o);const r=s()(e,"code");if(r)switch(n=n.concat(`code: ${r}\n`),r){case"rest_no_route":t=_;break;case"rest_cookie_invalid_nonce":t=p;break;case"fontawesome_unknown_error":t=d}const c=s()(e,"data");if("string"==typeof c)n=n.concat(`data: ${c}\n`);else{const t=s()(e,"data.status");t&&(n=n.concat(`status: ${t}\n`));const o=s()(e,"data.trace");o&&(n=n.concat(`trace:\n${o}\n`))}n&&""!==n?console.info(n):console.info(e);const i=s()(e,"data.request");i&&console.info(i);const a=s()(e,"data.failedRequestMessage");return a&&console.info(a),t}function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=s()(e,"config.headers.Content-Type","").toLowerCase(),n=s()(e,"config.data","");let o="";if("application/json"===t){try{const e=JSON.parse(n);"boolean"!=typeof s()(e,"options.apiToken")&&c()(e,"options.apiToken","REDACTED"),o=JSON.stringify(e)}catch(e){o="ERROR while redacting request data: "+e.toString()}return o}return n}function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={...e};for(const e in t)"x-wp-nonce"===e.toLowerCase()&&(t[e]="REDACTED");return t}t.b=function(e){const{error:t=null,ok:n=!1,falsePositive:o=!1,confirmed:r=!1,expectEmpty:c=!1,trimmed:i=""}=e;console.group(l),n&&console.info(E),o&&console.info(N),r?console.info(g):console.info(m);const u=[];for(const t of I){const n=s()(e,t);if(void 0!==n){const e=typeof n;if("string"===e||"number"===e)u.push(`${t}: ${n}`);else if("object"===e){u.push(t+":");for(const e in n)u.push(`\t${e}: ${n[e].toString()}`)}else console.info(`Unexpected report content type '${e}' for ${t}:`,n)}}a()(u)>0&&console.info("Extra Info:\n"+u.join("\n")),""!==i&&(console.group(O),c&&console.info(h),console.info(i),console.groupEnd());const d=null!==t?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object.keys(e.errors||[]).map(t=>({code:t,message:s()(e,`errors.${t}.0`),data:s()(e,"error_data."+t)}));0===a()(t)&&t.push({code:"fontawesome_unknown_error",message:f});const n=t.reduce((e,t)=>{console.group(T);const n=b(t);return console.groupEnd(),e||"previous_exception"===t.code?e:n},null);return n}(t):null;return t&&""===i&&r&&console.info(S),console.groupEnd(),d}}}]);