Version Description
[Apr 4th, 2019] = * Fixed a bug where the indexing of the posts was getting affected if someone previously selected any value in the custom tab of the general settings of the plugin but saved the settings using the default tab. Yep, it's confusing, and thus it skipped through our nose. The good thing is, it's caught and fixed. Hurray!
Full changelog can be found here - Rank Math SEO changelog
Download this release
Release Info
Developer | MyThemeShop |
Plugin | WordPress SEO Plugin – Rank Math |
Version | 1.0.23 |
Comparing to | |
See all releases |
Code changes from version 1.0.22 to 1.0.23
- assets/admin/js/post-metabox.js +1 -1
- assets/admin/js/term-metabox.js +1 -1
- assets/admin/js/user-metabox.js +1 -1
- includes/frontend/class-add-attributes.php +2 -1
- includes/frontend/class-breadcrumbs.php +2 -1
- includes/frontend/class-frontend.php +8 -1
- includes/frontend/class-generate.php +2 -1
- includes/frontend/class-head.php +2 -1
- includes/frontend/class-remove-reply-to-com.php +2 -1
- includes/helpers/class-wordpress.php +8 -7
- includes/metaboxes/advanced.php +6 -1
- rank-math.php +3 -3
- readme.txt +3 -17
- vendor/composer/autoload_classmap.php +6 -99
- vendor/composer/autoload_psr4.php +0 -1
- vendor/composer/autoload_static.php +6 -104
- vendor/composer/installed.json +61 -142
- vendor/monolog/monolog/.php_cs +0 -59
- vendor/monolog/monolog/CHANGELOG.md +0 -370
- vendor/monolog/monolog/LICENSE +0 -19
- vendor/monolog/monolog/doc/01-usage.md +0 -231
- vendor/monolog/monolog/doc/02-handlers-formatters-processors.md +0 -158
- vendor/monolog/monolog/doc/03-utilities.md +0 -15
- vendor/monolog/monolog/doc/04-extending.md +0 -76
- vendor/monolog/monolog/doc/sockets.md +0 -39
- vendor/monolog/monolog/src/Monolog/ErrorHandler.php +0 -239
- vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +0 -78
- vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php +0 -89
- vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +0 -116
- vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +0 -86
- vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php +0 -36
- vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +0 -138
- vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +0 -141
- vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +0 -214
- vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +0 -181
- vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php +0 -47
- vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php +0 -166
- vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +0 -107
- vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +0 -314
- vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php +0 -48
- vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +0 -113
- vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +0 -196
- vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +0 -68
- vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +0 -101
- vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +0 -148
- vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +0 -240
- vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +0 -129
- vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +0 -211
- vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php +0 -72
- vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +0 -151
- vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php +0 -57
- vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php +0 -169
- vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php +0 -45
- vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +0 -107
- vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php +0 -128
- vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php +0 -82
- vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +0 -140
- vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +0 -28
- vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +0 -59
- vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +0 -34
- vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +0 -177
- vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +0 -195
- vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php +0 -126
- vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +0 -127
- vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php +0 -65
- vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php +0 -116
- vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +0 -90
- vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php +0 -116
- vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +0 -365
- vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +0 -69
- vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php +0 -62
- vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +0 -55
- vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php +0 -102
- vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +0 -67
- vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php +0 -68
- vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php +0 -21
- vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +0 -59
- vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +0 -185
- vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +0 -204
- vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php +0 -45
- vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +0 -242
- vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php +0 -56
- vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +0 -185
- vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +0 -232
- vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +0 -97
- vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php +0 -144
- vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +0 -190
- vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +0 -82
- vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +0 -294
- vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +0 -220
- vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +0 -120
- vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php +0 -80
- vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +0 -385
- vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +0 -176
- vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +0 -111
- vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +0 -67
- vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +0 -56
- vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +0 -103
- vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php +0 -164
- vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +0 -71
- vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +0 -95
- vendor/monolog/monolog/src/Monolog/Logger.php +0 -791
- vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php +0 -64
- vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +0 -112
- vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php +0 -35
- vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php +0 -63
- vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php +0 -35
- vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php +0 -63
- vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php +0 -31
- vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php +0 -25
- vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +0 -50
- vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php +0 -44
- vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php +0 -59
- vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +0 -113
- vendor/monolog/monolog/src/Monolog/Registry.php +0 -134
- vendor/monolog/monolog/src/Monolog/ResettableInterface.php +0 -31
- vendor/monolog/monolog/src/Monolog/SignalHandler.php +0 -115
- vendor/monolog/monolog/src/Monolog/Utils.php +0 -25
- vendor/rollbar/rollbar/src/Handlers/ErrorHandler.php +22 -18
- vendor/rollbar/rollbar/src/Monolog/Handler/RollbarHandler.php +9 -0
- vendor/rollbar/rollbar/src/Payload/Notifier.php +1 -1
- vendor/rollbar/rollbar/src/Scrubber.php +3 -2
- vendor/rollbar/rollbar/src/Truncation/FramesStrategy.php +7 -10
- vendor/rollbar/rollbar/src/Truncation/StringsStrategy.php +1 -2
assets/admin/js/post-metabox.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=251)}([function(e,t){e.exports=Array.isArray},function(e,t,n){var r=n(75)("wks"),i=n(40),a=n(2).Symbol,o="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(11),i=n(41);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=!n(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=jQuery},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(70)("wks"),i=n(71),a=n(6).Symbol,o="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(34),i=n(68);e.exports=n(20)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(12),i=n(77),a=n(79),o=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(2),i=n(3),a=n(14),o=n(40)("src"),s=Function.toString,u=(""+s).split("toString");n(39).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(a(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(a(n,o)||i(n,o,e[t]?""+e[t]:u.join(t+""))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||s.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return e}},,function(e,t,n){var r=n(89);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports={}},function(e,t,n){var r=n(35);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(36)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(181),i=n(43);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(0),i=n(30),a=n(130),o=n(60);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:a(o(e))}},function(e,t,n){var r=n(96),i=n(54);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},,function(e,t,n){var r=n(109),i=n(112)(r);e.exports=i},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(0),i=n(129),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||o.test(e)||!a.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(52),i=n(26),a=n(105),o=n(140),s=n(141),u=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:s(e),n=n&&!c?o(n):0;var l=e.length;return 0>n&&(n=u(l+n,0)),a(e)?l>=n&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},function(e,t,n){var r=n(156),i=n(33);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(19),i=n(159),a=n(160),o=Object.defineProperty;t.f=n(20)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(70)("keys"),i=n(71);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(75)("keys"),i=n(40);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){"use strict";var r=n(3),i=n(13),a=n(22),o=n(43),s=n(1);e.exports=function(e,t,n){var u=s(e),c=n(o,u,""[e]),l=c[0],f=c[1];a(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,l),r(RegExp.prototype,u,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(113),i=n(127),a=n(104),o=n(0),s=n(133);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?o(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(25),i=n(15);e.exports=function(e,t){for(var n=0,a=(t=r(t,e)).length;null!=e&&a>n;)e=e[i(t[n++])];return n&&n==a?e:void 0}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"\n")}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&9007199254740991>=e}},function(e,t,n){var r=n(115),i=n(116),a=n(117),o=n(118),s=n(119);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(120),i=n(57);e.exports=function e(t,n,a,o,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,a,o,e,s))}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(24);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){var r=n(24),i=n(211),a=n(144),o=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,f,p,d,h=0,v=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,h=t,f=e.apply(r,n)}function k(e){var n=e-d;return void 0===d||n>=t||0>n||m&&e-h>=l}function b(){var e=i();if(k(e))return w(e);p=setTimeout(b,function(e){var n=t-(e-d);return m?s(n,l-(e-h)):n}(e))}function w(e){return p=void 0,g&&u?y(e):(u=c=void 0,f)}function x(){var e=i(),n=k(e);if(u=arguments,c=this,d=e,n){if(void 0===p)return function(e){return h=e,p=setTimeout(b,t),v?y(e):f}(d);if(m)return p=setTimeout(b,t),y(d)}return void 0===p&&(p=setTimeout(b,t)),f}return t=a(t)||0,r(n)&&(v=!!n.leading,l=(m="maxWait"in n)?o(a(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),x.cancel=function(){void 0!==p&&clearTimeout(p),h=0,u=d=c=p=void 0},x.flush=function(){return void 0===p?f:w(i())},x}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(65),i=n(66),a=n(161),o=n(10),s=n(18),u=n(162),c=n(73),l=n(170),f=n(8)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,m,g){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in O)return O[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,P=!1,O=e.prototype,C=O[f]||O["@@iterator"]||v&&O[v],T=C||w(v),S=v?_?w("entries"):T:void 0,M="Array"==t&&O.entries||C;if(M&&(b=l(M.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||o(b,f,d)),_&&C&&"values"!==C.name&&(P=!0,T=function(){return C.call(this)}),r&&!g||!p&&!P&&O[f]||o(O,f,T),s[t]=T,s[x]=d,v)if(y={values:_?T:w("values"),keys:m?T:w("keys"),entries:S},g)for(k in y)k in O||a(O,k,y[k]);else i(i.P+i.F*(p||P),t,y);return y}},function(e,t){e.exports=!0},function(e,t,n){var r=n(6),i=n(7),a=n(157),o=n(10),s=n(21),u=function(e,t,n){var c,l,f,p=e&u.F,d=e&u.G,h=e&u.S,v=e&u.P,m=e&u.B,g=e&u.W,y=d?i:i[t]||(i[t]={}),k=y.prototype,b=d?r:h?r[t]:(r[t]||{}).prototype;for(c in d&&(n=t),n)(l=!p&&b&&void 0!==b[c])&&s(y,c)||(f=l?b[c]:n[c],y[c]=d&&"function"!=typeof b[c]?n[c]:m&&l?a(f,r):g&&b[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?a(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[c]=f,e&u.R&&k&&!k[c]&&o(k,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(35),i=n(6).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(165),i=n(72);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(7),i=n(6),a=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(65)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(34).f,i=n(21),a=n(8)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){var r=n(33);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(39),i=n(2),a=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(76)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t,n){e.exports=!n(4)&&!n(22)(function(){return 7!=Object.defineProperty(n(78)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9),i=n(2).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(184);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(83),i=n(45);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(14),i=n(23),a=n(188)(!1),o=n(44)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=o&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(11).f,i=n(14),a=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){var r=n(9),i=n(80),a=n(1)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(148),i=n(149),a=n(176);e.exports=function(e,t){return r(e)||i(e,t)||a()}},function(e,t,n){e.exports=n(196)},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(132),i=n(102);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&t>e}},function(e,t){e.exports=function(e){return void 0===e}},function(e,t,n){var r=n(107),i=n(108),a=n(47),o=n(0);e.exports=function(e,t){return(o(e)?r:i)(e,a(t,3))}},function(e,t,n){var r=n(61),i=n(47),a=n(146),o=n(0);e.exports=function(e,t){return(o(e)?r:a)(e,i(t,3))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,"").replace(i,"")};var r=/\[[^<>&\/\[\] - =]+?( [^\]]+?)?\]/g,i=/\[\/[^<>&\/\[\] - =]+?\]/g},function(e,t,n){var r=n(53),i=n(24);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(0);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return r(e)?e:[e]}},function(e,t,n){var r=n(52);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(25),i=n(103),a=n(0),o=n(91),s=n(54),u=n(15);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&o(p,l)&&(a(e)||i(e))}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(53),i=n(0),a=n(57);e.exports=function(e){return"string"==typeof e||!i(e)&&a(e)&&"[object String]"==r(e)}},,function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}},function(e,t,n){var r=n(28);e.exports=function(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}},function(e,t,n){var r=n(110),i=n(29);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(111)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===n(a[u],u,a))break}return t}}},function(e,t,n){var r=n(26);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var a=n.length,o=t?a:-1,s=Object(n);(t?o--:++o<a)&&!1!==i(s[o],o,s););return n}}},function(e,t,n){var r=n(114),i=n(126),a=n(59);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(55),i=n(56);e.exports=function(e,t,n,a){var o=n.length,s=o,u=!a;if(null==e)return!s;for(e=Object(e);o--;){var c=n[o];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<s;){var l=(c=n[o])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(a)var h=a(f,p,l,e,t,d);if(!(void 0===h?i(p,f,3,a,d):h))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(17),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return n>=0&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(17);e.exports=function(e){var t=this.__data__,n=r(t,e);return 0>n?void 0:t[n][1]}},function(e,t,n){var r=n(17);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(17);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return 0>i?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(55),i=n(121),a=n(123),o=n(124),s=n(99),u=n(0),c=n(100),l=n(101),f="[object Arguments]",p="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,m,g){var y=u(e),k=u(t),b=y?p:s(e),w=k?p:s(t),x=(b=b==f?d:b)==d,_=(w=w==f?d:w)==d,P=b==w;if(P&&c(e)){if(!c(t))return!1;y=!0,x=!1}if(P&&!x)return g||(g=new r),y||l(e)?i(e,t,n,v,m,g):a(e,t,b,n,v,m,g);if(!(1&n)){var O=x&&h.call(e,"__wrapped__"),C=_&&h.call(t,"__wrapped__");if(O||C){var T=O?e.value():e,S=C?t.value():t;return g||(g=new r),m(T,S,n,v,g)}}return!!P&&(g||(g=new r),o(e,t,n,v,m,g))}},function(e,t,n){var r=n(97),i=n(122),a=n(98);e.exports=function(e,t,n,o,s,u){var c=1&n,l=e.length,f=t.length;if(!(l==f||c&&f>l))return!1;var p=u.get(e);if(p&&u.get(t))return p==t;var d=-1,h=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++d<l;){var m=e[d],g=t[d];if(o)var y=c?o(g,m,d,t,e,u):o(m,g,d,e,t,u);if(void 0!==y){if(y)continue;h=!1;break}if(v){if(!i(t,function(e,t){if(!a(v,t)&&(m===e||s(m,e,n,o,u)))return v.push(t)})){h=!1;break}}else if(m!==g&&!s(m,g,n,o,u)){h=!1;break}}return u.delete(e),u.delete(t),h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(125),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,o,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var d=s.get(e);if(d&&s.get(t))return d==t;var h=!0;s.set(e,t),s.set(t,e);for(var v=u;++f<l;){var m=e[p=c[f]],g=t[p];if(a)var y=u?a(g,m,p,t,e,s):a(m,g,p,e,t,s);if(!(void 0===y?m===g||o(m,g,n,a,s):y)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var k=e.constructor,b=t.constructor;k!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof b&&b instanceof b)&&(h=!1)}return s.delete(e),s.delete(t),h}},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(58),i=n(29);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var a=t[n],o=e[a];t[n]=[a,o,r(o)]}return t}},function(e,t,n){var r=n(56),i=n(128),a=n(90),o=n(30),s=n(58),u=n(59),c=n(15);e.exports=function(e,t){return o(e)&&s(t)?u(c(e),t):function(n){var o=i(n,e);return void 0===o&&o===t?a(n,e):r(t,o,3)}}},function(e,t,n){var r=n(48);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n(131)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,"$1"):n||e)}),t});e.exports=a},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(134),i=n(135),a=n(30),o=n(15);e.exports=function(e){return a(e)?r(o(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(48);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(e=(0,i.default)(e)).replace(/ /gi,"-").toLowerCase()};var r,i=(r=n(137))&&r.__esModule?r:{default:r}},function(e,t,n){var r=n(138),i=n(60),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]/g;e.exports=function(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}},function(e,t,n){var r=n(139)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(142),i=n(29);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){var r=n(61);e.exports=function(e,t){return r(t,function(t){return e[t]})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=u((0,i.autop)((0,o.default)(e)),t);return n.length>0?n:[e]};var r=s(n(94)),i=n(147),a=s(n(50)),o=s(n(95));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t){var n=[];t=t||!1;for(var i=/<p(?:[^>]+)?>(.*?)<\/p>/gi,o=void 0;null!==(o=i.exec(e));)n.push(o);return(0,r.default)(n,function(e){return t?(0,a.default)(e[1]):e[1]})}},function(e,t,n){var r=n(28),i=n(26);e.exports=function(e,t){var n=-1,a=i(e)?Array(e.length):[];return r(e,function(e,r,i){a[++n]=t(e,r,i)}),a}},function(e,t,n){"use strict";n.r(t),n.d(t,"autop",function(){return c}),n.d(t,"removep",function(){return l});var r=n(87),i=n.n(r),a=(n(177),n(194),n(195),n(88)),o=n.n(a),s=(n(199),n(200),/(<((?=!--|!\[CDATA\[)((?=!-)!(?:-(?!->)[^\-]*)*(?:-->)?|!\[CDATA\[[^\]]*(?:](?!]>)[^\]]*)*?(?:]]>)?)|[^>]*>?))/);function u(e,t){for(var n=function(e){for(var t,n=[],r=e;t=r.match(s);)n.push(r.slice(0,t.index)),n.push(t[0]),r=r.slice(t.index+t[0].length);return r.length&&n.push(r),n}(e),r=!1,i=o()(t),a=1;n.length>a;a+=2)for(var u=0;i.length>u;u++){var c=i[u];if(-1!==n[a].indexOf(c)){n[a]=n[a].replace(RegExp(c,"g"),t[c]),r=!0;break}}return r&&(e=n.join("")),e}function c(e){var t=1>=arguments.length||void 0===arguments[1]||arguments[1],n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){var r=e.split("</pre>"),a=r.pop();e="";for(var o=0;r.length>o;o++){var s=r[o],c=s.indexOf("<pre");if(-1!==c){var l="<pre wp-pre-tag-"+o+"></pre>";n.push([l,s.substr(c)+"</pre>"]),e+=s.substr(0,c)+l}else e+=s}e+=a}var f="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=u(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(RegExp("(<"+f+"[s/>])","g"),"\n\n$1")).replace(RegExp("(</"+f+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));var p=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",p.forEach(function(t){e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)","g"),"$1")).replace(RegExp("(</?"+f+"[^>]*>)s*</p>","g"),"$1"),t&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,function(e){return e[0].replace(/\n/g,"<WPPreserveNewline />")})).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,function(e,t){return t?e:"<br />\n"})).replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(RegExp("(</?"+f+"[^>]*>)s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach(function(t){var n=i()(t,2);e=e.replace(n[0],n[1])}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}function l(e){var t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",r=t+"|pre",i=[],a=!1,o=!1;return e?(-1===e.indexOf("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(e){return i.push(e),"<wp-preserve>"})),-1!==e.indexOf("<pre")&&(a=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(e){return(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")})),-1!==e.indexOf("[caption")&&(o=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(RegExp("\\s*</("+n+")>\\s*","g"),"</$1>\n")).replace(RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,function(e,t){return t&&-1!==t.indexOf("\n")?"\n\n":"\n"})).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(RegExp("\\s*</("+r+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),a&&(e=e.replace(/<wp-line-break>/g,"\n")),o&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),i.length&&(e=e.replace(/<wp-preserve>/g,function(){return i.shift()})),e):""}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t,n){var r=n(150);e.exports=function(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s,u=r(e);!(i=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return n}},function(e,t,n){e.exports=n(151)},function(e,t,n){n(152),n(171),e.exports=n(173)},function(e,t,n){n(153);for(var r=n(6),i=n(10),a=n(18),o=n(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;s.length>u;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[o]&&i(f,o,c),a[c]=a.Array}},function(e,t,n){"use strict";var r=n(154),i=n(155),a=n(18),o=n(32);e.exports=n(64)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(63);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(158);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=!n(20)&&!n(36)(function(){return 7!=Object.defineProperty(n(67)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(35);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";var r=n(163),i=n(68),a=n(73),o={};n(10)(o,n(8)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var r=n(19),i=n(164),a=n(72),o=n(38)("IE_PROTO"),s=function(){},u=function(){var e,t=n(67)("iframe"),r=a.length;for(t.style.display="none",n(169).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[a[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[o]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(34),i=n(19),a=n(69);e.exports=n(20)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,u=0;s>u;)r.f(e,n=o[u++],t[n]);return e}},function(e,t,n){var r=n(21),i=n(32),a=n(166)(!1),o=n(38)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=o&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},function(e,t,n){var r=n(32),i=n(167),a=n(168);e.exports=function(e){return function(t,n,o){var s,u=r(t),c=i(u.length),l=a(o,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(37),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(37),i=Math.max,a=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):a(e,t)}},function(e,t,n){var r=n(6).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(21),i=n(74),a=n(38)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){"use strict";var r=n(172)(!0);n(64)(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return t.length>n?(e=r(t,n),this._i+=e.length,{value:e,done:!1}):{value:void 0,done:!0}})},function(e,t,n){var r=n(37),i=n(33);e.exports=function(e){return function(t,n){var a,o,s=i(t)+"",u=r(n),c=s.length;return 0>u||u>=c?e?"":void 0:55296>(a=s.charCodeAt(u))||a>56319||u+1===c||56320>(o=s.charCodeAt(u+1))||o>57343?e?s.charAt(u):a:e?s.slice(u,u+2):o-56320+(a-55296<<10)+65536}}},function(e,t,n){var r=n(19),i=n(174);e.exports=n(7).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){var r=n(175),i=n(8)("iterator"),a=n(18);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||a[r(e)]}},function(e,t,n){var r=n(63),i=n(8)("toStringTag"),a="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?r(t):"Object"==(o=r(t))&&"function"==typeof t.callee?"Arguments":o}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){for(var r=n(178),i=n(82),a=n(13),o=n(2),s=n(3),u=n(42),c=n(1),l=c("iterator"),f=c("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(d),v=0;h.length>v;v++){var m,g=h[v],y=d[g],k=o[g],b=k&&k.prototype;if(b&&(b[l]||s(b,l,p),b[f]||s(b,f,g),u[g]=p,y))for(m in r)b[m]||a(b,m,r[m],!0)}},function(e,t,n){"use strict";var r=n(179),i=n(180),a=n(42),o=n(23);e.exports=n(182)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(1)("unscopables"),i=Array.prototype;null==i[r]&&n(3)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(80);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";var r=n(76),i=n(183),a=n(13),o=n(3),s=n(42),u=n(185),c=n(85),l=n(192),f=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,m,g){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in O)return O[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,P=!1,O=e.prototype,C=O[f]||O["@@iterator"]||v&&O[v],T=C||w(v),S=v?_?w("entries"):T:void 0,M="Array"==t&&O.entries||C;if(M&&(b=l(M.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||o(b,f,d)),_&&C&&"values"!==C.name&&(P=!0,T=function(){return C.call(this)}),r&&!g||!p&&!P&&O[f]||o(O,f,T),s[t]=T,s[x]=d,v)if(y={values:_?T:w("values"),keys:m?T:w("keys"),entries:S},g)for(k in y)k in O||a(O,k,y[k]);else i(i.P+i.F*(p||P),t,y);return y}},function(e,t,n){var r=n(2),i=n(39),a=n(3),o=n(13),s=n(81),u=function(e,t,n){var c,l,f,p,d=e&u.F,h=e&u.G,v=e&u.P,m=e&u.B,g=h?r:e&u.S?r[t]||(r[t]={}):(r[t]||{}).prototype,y=h?i:i[t]||(i[t]={}),k=y.prototype||(y.prototype={});for(c in h&&(n=t),n)f=((l=!d&&g&&void 0!==g[c])?g:n)[c],p=m&&l?s(f,r):v&&"function"==typeof f?s(Function.call,f):f,g&&o(g,c,f,e&u.U),y[c]!=f&&a(y,c,p),v&&k[c]!=f&&(k[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var r=n(186),i=n(41),a=n(85),o={};n(3)(o,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var r=n(12),i=n(187),a=n(45),o=n(44)("IE_PROTO"),s=function(){},u=function(){var e,t=n(78)("iframe"),r=a.length;for(t.style.display="none",n(191).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[a[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[o]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(11),i=n(12),a=n(82);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,u=0;s>u;)r.f(e,n=o[u++],t[n]);return e}},function(e,t,n){var r=n(23),i=n(189),a=n(190);e.exports=function(e){return function(t,n,o){var s,u=r(t),c=i(u.length),l=a(o,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(84),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(84),i=Math.max,a=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):a(e,t)}},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(14),i=n(193),a=n(44)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var r=n(43);e.exports=function(e){return Object(r(e))}},function(e,t,n){n(46)("split",2,function(e,t,r){"use strict";var i=n(86),a=r,o=[].push;if("".split(/.?/).length){var s=void 0===/()??/.exec("")[1];r=function(e,t){var n=this+"";if(void 0===e&&0===t)return[];if(!i(e))return a.call(n,e,t);var r,u,c,l,f,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,m=RegExp(e.source,d+"g");for(s||(r=RegExp("^"+m.source+"$(?!\\s)",d));(u=m.exec(n))&&((c=u.index+u[0].length)<=h||(p.push(n.slice(h,u.index)),!s&&u.length>1&&u[0].replace(r,function(){for(f=1;arguments.length-2>f;f++)void 0===arguments[f]&&(u[f]=void 0)}),u.length>1&&n.length>u.index&&o.apply(p,u.slice(1)),l=u[0].length,h=c,v>p.length));)m.lastIndex===u.index&&m.lastIndex++;return h===n.length?!l&&m.test("")||p.push(""):p.push(n.slice(h)),p.length>v?p.slice(0,v):p}}return[function(n,i){var a=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,a,i):r.call(a+"",n,i)},r]})},function(e,t,n){n(46)("replace",2,function(e,t,n){return[function(r,i){"use strict";var a=e(this),o=null==r?void 0:r[t];return void 0!==o?o.call(r,a,i):n.call(a+"",r,i)},n]})},function(e,t,n){n(197),e.exports=n(7).Object.keys},function(e,t,n){var r=n(74),i=n(69);n(198)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(66),i=n(7),a=n(36);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],o={};o[e]=t(n),r(r.S+r.F*a(function(){n(1)}),"Object",o)}},function(e,t,n){n(46)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):RegExp(n)[t](r+"")},n]})},function(e,t,n){var r=n(2),i=n(201),a=n(11).f,o=n(205).f,s=n(86),u=n(206),c=r.RegExp,l=c,f=c.prototype,p=/a/g,d=/a/g,h=new c(p)!==p;if(n(4)&&(!h||n(22)(function(){return d[n(1)("match")]=!1,c(p)!=p||c(d)==d||"/a/i"!=c(p,"i")}))){c=function(e,t){var n=this instanceof c,r=s(e),a=void 0===t;return!n&&r&&e.constructor===c&&a?e:i(h?new l(r&&!a?e.source:e,t):l((r=e instanceof c)?e.source:e,r&&a?u.call(e):t),n?this:f,c)};for(var v=function(e){e in c||a(c,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})},m=o(l),g=0;m.length>g;)v(m[g++]);f.constructor=c,c.prototype=f,n(13)(r,"RegExp",c)}n(207)("RegExp")},function(e,t,n){var r=n(9),i=n(202).set;e.exports=function(e,t,n){var a,o=t.constructor;return o!==n&&"function"==typeof o&&(a=o.prototype)!==n.prototype&&r(a)&&i&&i(e,a),e}},function(e,t,n){var r=n(9),i=n(12),a=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(81)(Function.call,n(203).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return a(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:a}},function(e,t,n){var r=n(204),i=n(41),a=n(23),o=n(79),s=n(14),u=n(77),c=Object.getOwnPropertyDescriptor;t.f=n(4)?c:function(e,t){if(e=a(e),t=o(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(83),i=n(45).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";var r=n(12);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(2),i=n(11),a=n(4),o=n(1)("species");e.exports=function(e){var t=r[e];a&&t&&!t[o]&&i.f(t,o,{configurable:!0,get:function(){return this}})}},,function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r};i.default.extend({rankMathHighlight:function(e,t,n,r){if(3===e.nodeType){var a=e.data.match(t);if(a){var o=document.createElement(n||"span");o.className=r||"highlight";var s=e.splitText(a.index);s.splitText(a[0].length);var u=s.cloneNode(!0);return o.appendChild(u),s.parentNode.replaceChild(o,s),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==r))for(var c=0;e.childNodes.length>c;c++)c+=i.default.rankMathHighlight(e.childNodes[c],t,n,r);return 0}}),i.default.fn.rankMathUnhighlight=function(e){var t={className:"highlight",element:"span"};return i.default.extend(t,e),this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()},i.default.fn.rankMathHighlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(i.default.extend(n,t),void 0===e||""===e)return this;if(e.constructor===String&&(e=[e]),e=i.default.grep(e,function(e){return""!==e}),0===(e=i.default.map(e,function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")})).length)return this;var r=n.caseSensitive?"":"i",a="("+e.join("|")+")";n.wordsOnly&&(a="\\b"+a+"\\b");var o=RegExp(a,r);return this.each(function(){i.default.rankMathHighlight(this,o,n.element,n.className)})}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r},a=document.createElement("div");i.default.fn.lengthIndicator=function(e){var t=this;e=i.default.extend({},{minLength:0,maxLength:1e3,source:null},e),t.wrap('<span class="length-indicator-wrapper"/>'),t.parent().append('<span class="length-indicator"><span/></span><span class="length-count">0 / '+e.maxLength+"</span>");var n=t.parent().find(".length-indicator"),r=n.find(">span"),o=t.parent().find(".length-count"),s=function(){var i=function(e){return e&&"string"==typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),a.innerHTML=e,e=a.textContent,a.textContent=""),e}(null===e.source?t.val():e.source.text()).length;n.removeClass("invalid short"),r.css("left",Math.min(100,Math.floor(i/e.maxLength*100))+"%"),o.text(i+" / "+e.maxLength),i>e.minLength&&e.maxLength>=i||n.addClass("invalid")};t.on("input",s),null!==e.source&&e.source.on("rank-math-vars-replaced",s),s()}},function(e,t,n){var r=n(212);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(213),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();e.exports=a},function(e,t,n){var r;r=n(143),e.exports="object"==typeof r&&r&&r.Object===Object&&r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(5)),a=o(n(215));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank-math-serp-checklist",t.elemMetabox),this.scoreElem=(0,i.default)('<div class="misc-pub-section rank-math-seo-score"><span class="score-text"><span class="dashicons dashicons-chart-area"></span> SEO: <strong>Not available</strong></span></div>'),this.scoreText=this.scoreElem.find("strong"),this.scoreField=(0,i.default)("#rank_math_seo_score"),this.fkScoreElem=(0,i.default)('<div class="rank-math-seo-score below-focus-keyword"><span class="score-text">Not available</span></div>'),this.fkScoreText=this.fkScoreElem.find("span"),(0,i.default)("#misc-publishing-actions").append(this.scoreElem),(0,i.default)(".cmb-td",".cmb2-id-rank-math-focus-keyword").append(this.fkScoreElem),this.events()}return r(e,[{key:"display",value:function(e){var t=this;i.default.each(e,function(e,n){var r=t.elem.find(".seo-check-"+e);r.removeClass("test-ok test-gallery test-fail test-empty test-looking veryEasy difficult veryDifficult"),r.addClass("test-"+n.status),r.show(),"calculateFleschReading"===e&&r.addClass(n.factors[2]),r.find("span:eq(0)").html(n.message)})}},{key:"setPrimaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,a.default)(e,function(e,t,n){return!1===t&&(t={score:0}),e+t.score},0);status="bad-fk",n>80?status="good-fk":n>50&&(status="ok-fk"),t.removeClass("bad-fk ok-fk good-fk"),this.scoreElem.removeClass("bad-fk ok-fk good-fk"),this.fkScoreElem.removeClass("bad-fk ok-fk good-fk"),t.addClass(status),this.scoreElem.addClass(status),this.fkScoreElem.addClass(status),this.scoreText.html(n+" / 100"),this.fkScoreText.html(n+" / 100"),this.scoreField.val(parseInt(n))}},{key:"setSecondaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,a.default)(e,function(e,t){return e+("ok"===t.status?1:0)},0);t.addClass(3===n?"good-fk":2===n?"ok-fk":"bad-fk")}},{key:"hidePrimary",value:function(){this.elem.find("li.is-primary").hide()}},{key:"events",value:function(){var e=this;this.elem.on("click",".group-handle",function(t){t.preventDefault();var n=(0,i.default)(t.target).closest(".rank-math-serp-group"),r={};n.toggleClass("state-open state-closed"),e.updateGroupStatus(n),e.elem.find(">.rank-math-serp-group").each(function(){var e=(0,i.default)(this);r[e.data("id")]=e.hasClass("state-closed")?"closed":"open"}),i.default.ajax({url:rankMath.ajaxurl,type:"POST",data:{action:"rank_math_save_checklist_layout",security:rankMath.security,layout:r}})})}},{key:"updateGroupStatus",value:function(e){(e=e||(0,i.default)(".rank-math-serp-group")).each(function(){var e=(0,i.default)(this);1>e.find("li.test-fail").length&&1>e.find("li.test-empty").length?e.find(".group-status").addClass("passed"):e.find(".group-status").removeClass("passed")})}}]),e}();t.default=s},function(e,t,n){var r=n(216),i=n(28),a=n(47),o=n(217),s=n(0);e.exports=function(e,t,n){var u=s(e)?r:o,c=3>arguments.length;return u(e,a(t,4),n,c,i)}},function(e,t){e.exports=function(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}},function(e,t){e.exports=function(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=(r=n(5))&&r.__esModule?r:{default:r},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metabox=t,this.currentNetwork="facebook",this.useFacebook=!0,this.shouldUpdatePreview=!1,this.facebookTitleField=t.elemMetabox.find("#rank_math_facebook_title"),this.facebookDescriptionField=t.elemMetabox.find("#rank_math_facebook_description"),this.twitterTitleField=t.elemMetabox.find("#rank_math_twitter_title"),this.twitterDescriptionField=t.elemMetabox.find("#rank_math_twitter_description"),this.facebookImageField=t.elemMetabox.find("#rank_math_facebook_image"),this.twitterImageField=t.elemMetabox.find("#rank_math_twitter_image"),this.facebookImageStatus=t.elemMetabox.find("#rank_math_facebook_image-status"),this.twitterImageStatus=t.elemMetabox.find("#rank_math_twitter_image-status"),this.socialWrapper=t.elemMetabox.find(".rank-math-social-preview"),this.socialPreview=this.socialWrapper.find(".rank-math-social-preview-item"),this.socialTitle=this.socialWrapper.find(".rank-math-social-preview-title"),this.socialDescription=this.socialWrapper.find(".rank-math-social-preview-description"),this.events(),this.shouldUpdatePreview=!0,this.updatePreview()}return i(e,[{key:"events",value:function(){var e=this;this.facebookTitleField.on("input",function(){e.updateTitlePreview()}),this.facebookDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.facebookImageField.on("input",function(){e.updateThumbnailPreview()}),this.twitterTitleField.on("input",function(){e.updateTitlePreview()}),this.twitterDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.twitterImageField.on("input",function(){e.updateThumbnailPreview()});var t=(0,a.default)(".rank-math-social-preview-button"),n=t.find(">span");t.on("click",function(t){t.preventDefault(),n.toggleClass("dashicons-arrow-down dashicons-arrow-up"),e.updatePreview(),e.socialWrapper.toggleClass("open"),e.socialPreview.slideToggle()});var r=(0,a.default)("#rank_math_twitter_card_type");(0,a.default)(".preview-network").on("click",function(n){(0,a.default)(n.target).hasClass("tab-facebook")?t.show():r.trigger("change"),e.updatePreview()}),r.on("change",function(){var n=r.val();"player"===n&&(0,a.default)(".cmb2-id-rank-math-twitter-image, .cmb2-id-rank-math-twitter-title, .cmb2-id-rank-math-twitter-description").show();var i="player"===n||"app"===n;t.toggle(!i),(0,a.default)(".cmb2-id-rank-math-twitter-use-facebook").toggle(!i),e.updatePreview()}).trigger("change");var i=(0,a.default)("#rank_math_twitter_use_facebook2");(0,a.default)("#rank_math_twitter_use_facebook1, #rank_math_twitter_use_facebook2").on("input change",function(){e.useFacebook=i.is(":checked"),e.updatePreview()}).trigger("change"),(0,a.default)(".cmb2-id-rank-math-facebook-enable-image-overlay, .cmb2-id-rank-math-facebook-image-overlay, .cmb2-id-rank-math-twitter-enable-image-overlay, .cmb2-id-rank-math-twitter-image-overlay").on("change","input",function(){e.updateThumbnailOverlay()}),(0,a.default)(document).on("cmb_media_modal_select",function(t,n,r){"rank_math_facebook_image"!==r.field&&"rank_math_twitter_image"!==r.field||e.updateThumbnailPreview()}),(0,a.default)(document).on("cmb_init",function(t,n){n.$metabox.on("click",".cmb2-remove-file-button",function(){e.updateThumbnailPreview()})})}},{key:"updatePreview",value:function(){!1!==this.shouldUpdatePreview&&(this.currentNetwork=(0,a.default)(".preview-network.tab-active").attr("href").replace("#setting-panel-social-",""),this.socialWrapper.removeClass(),this.socialWrapper.addClass("rank-math-social-preview rank-math-social-preview-"+this.currentNetwork),"twitter"===this.currentNetwork&&this.socialWrapper.addClass((0,a.default)("#rank_math_twitter_card_type").val()),this.updateTitlePreview(),this.updateDescriptionPreview(),this.updateThumbnailPreview())}},{key:"updateTitlePreview",value:function(){var e=this[this.currentNetwork+"TitleField"].val()||this.metabox.title;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookTitleField.val()||this.metabox.title),e=this.metabox.truncate(this.metabox.swapVars(e),90),this.socialTitle.html(e)}},{key:"updateDescriptionPreview",value:function(){var e=this[this.currentNetwork+"DescriptionField"].val()||this.description;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookDescriptionField.val()||this.metabox.description),e=this.metabox.truncate(this.metabox.swapVars(e),240),this.socialDescription.html(e)}},{key:"updateThumbnailPreview",value:function(){var e=(0,a.default)("#rank_math_post_thumbnail").attr("src"),t=this.metabox.getContent(),n=!!/<img(?:[^>]+)?>/.test(t)&&(0,a.default)(t).find("img:first").attr("src"),r=this.facebookImageField.val()||e||n||rankMath.defautOgImage,i=this.twitterImageField.val()||e||n||rankMath.defautOgImage;if("twitter"===this.currentNetwork&&this.useFacebook)i=r;else if(this.twitterImageStatus.find("img.cmb-file-field-image").length){var o=this.twitterImageStatus.siblings(".notice"),s=this.twitterImageStatus.find("img.cmb-file-field-image")[0];o.addClass("hidden"),(0,a.default)(s).on("load",function(){(200>s.naturalWidth||200>s.naturalHeight)&&o.removeClass("hidden")})}var u=this.facebookImageStatus.siblings(".notice"),c=this.facebookImageStatus.find("img.cmb-file-field-image");u.addClass("hidden"),"facebook"===this.currentNetwork&&this.facebookImageField.val()&&c.length&&(0,a.default)(c[0]).on("load",function(){(200>c[0].naturalWidth||200>c[0].naturalHeight)&&u.removeClass("hidden")});var l=(0,a.default)(".rank-math-social-preview-image");(0,a.default)(".facebook-thumbnail",l).attr("src",r),(0,a.default)(".twitter-thumbnail",l).attr("src",i),l.toggleClass("no-facebook-image",!r),l.toggleClass("no-twitter-image",!i),l.parents(".rank-math-social-preview-facebook").find(".error-msg").toggleClass("show",!r),l.parents(".rank-math-social-preview-twitter").find(".error-msg").toggleClass("show",!i),this.updateThumbnailOverlay()}},{key:"updateThumbnailOverlay",value:function(){var e=(0,a.default)(".rank-math-social-preview-image-overlay"),t=(0,a.default)('[name="rank_math_'+this.currentNetwork+'_enable_image_overlay"]:checked').val(),n=(0,a.default)('[name="rank_math_'+this.currentNetwork+'_image_overlay"]:checked').val(),r=!(0,a.default)(".rank-math-social-preview-image").hasClass("no-"+this.currentNetwork+"-image");"twitter"===this.currentNetwork&&this.useFacebook&&(n=(0,a.default)('[name="rank_math_facebook_image_overlay"]:checked').val(),r=!1);var i=(0,a.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-enable-image-overlay"),o="on"===i.find("input:checked").val();i.toggle(r),i.find(".notice-warning").toggle(o),"on"===t?(e.attr("src",rankMath.overlayImages[n].url).show(),(0,a.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-image-overlay").toggle(r)):e.hide()}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(5)),a=o(n(62));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank_math_focus_keyword");var r=(0,a.default)(function(){t.updateFocusKeywords()},200),o=(0,a.default)(function(e,n){var r=e.find("li:last").prev(),i=t.assessor.assessFocusKeyword({elem:r,isPrimary:!1,keyword:n});t.checkList.setSecondaryKeywordStatus(i,r)},200);this.elem.on("content-loaded",function(){var e=n.elem.next("ul"),r=n.getFocusKeywords();(0,i.default)(e).find("li:gt(1)").each(function(){var e=(0,i.default)(this),n=t.assessor.assessFocusKeyword({elem:e,isPrimary:!1,keyword:r[e.index()-1]});t.checkList.setSecondaryKeywordStatus(n,e)})}),this.elem.tagEditor({autocomplete:1===rankMath.maxTags?null:this.getAutocompleteOptions(),sortable:!0,placeholder:this.elem.attr("placeholder"),onChange:function(e,t,n){1===n.length?t.find("li:not(.placeholder)").last().addClass("selected-fk"):t.find(".selected-fk").removeClass("selected-fk"),r()},onSelect:function(e,t){var n=e.parent();return!(!n.hasClass("selected-fk")&&""!==e.html()&&(t.find(".tag-editor-tag.active").length&&t.find("input").blur(),n.addClass("selected-fk").siblings().removeClass("selected-fk"),r(),1))},beforeTagDelete:function(e,t,n){return 1===n.length||(e.hasClass("selected-fk")&&t.find(">li").eq(1).addClass("selected-fk"),!0)},beforeTagSave:function(e,t,n,r,i){if(0!==n.length&&i)return o(t,i),i}}),this.elem.next().find(">li:not(.placeholder)").eq(1).addClass("selected-fk");var s=this.elem.parent();s.append(s.find(".cmb2-metabox-description"))}return r(e,[{key:"getAutocompleteOptions",value:function(){return{minLength:2,source:function(e,t){i.default.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:e.term,nolabels:"t",client:"hp",ds:"",lr:"lang_"+rankMath.locale,hl:rankMath.locale},success:function(e){t(i.default.map(e[1],function(e){return{value:(0,i.default)("<span>").html(e[0]).text()}}))}})}}}},{key:"getFocusKeywords",value:function(){var e=this.elem.tagEditor("getTags")[0];return e?e.tags:[]}},{key:"getFocusKeyword",value:function(){var e=this.elem.tagEditor("getTags")[0];if(!e)return{isPrimary:!0,keyword:""};var t=e.editor.find(".selected-fk").first();return t.length?{elem:t,isPrimary:1===t.index(),keyword:t.find(".tag-editor-tag").text()}:e.tags.length?{isPrimary:!0,keyword:e.tags[0]}:{isPrimary:!0,keyword:""}}},{key:"clearFocusKeywords",value:function(){this.elem.tagEditor("clearTags")}},{key:"addFocusKeyword",value:function(e){this.elem.tagEditor("addTag",e)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=(r=n(5))&&r.__esModule?r:{default:r},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.focusKeywords=t,this.modal=(0,a.default)("#rank-math-compare-keywords-wrapper"),this.holder=this.modal.find(".rank-math-keywords-fields"),this.iframe=this.modal.find("iframe.attachments-browser"),this.btnCompare=this.modal.find(".compare-keywords"),this.events()}return i(e,[{key:"events",value:function(){var e=this;(0,a.default)("#rank-math-compare-keywords-trigger").on("click",function(t){t.preventDefault();var n=e.focusKeywords.getFocusKeywords();e.holder.html(""),n.length?a.default.each(n,function(t,n){e.addNewField(n)}):e.addNewField(),e.modal.toggle(),e.btnCompare.trigger("click")}),this.modal.on("click",".media-modal-close",function(){e.modal.toggle()}),this.modal.on("click",".add-new-keywords",function(){e.addNewField()}),this.modal.on("click",".remove-keyword",function(e){(0,a.default)(e.currentTarget).parent().remove(),btnCompare.trigger("click")}),this.modal.on("click",".use-these-keywords",function(){e.focusKeywords.clearFocusKeywords(),e.holder.find("input").each(function(t,n){var r=(0,a.default)(n).val().trim();""!==r&&e.focusKeywords.addFocusKeyword(r)}),e.modal.toggle()}),this.btnCompare.on("click",function(){var t=[];if(e.holder.find("input").each(function(){var e=(0,a.default)(this).val().trim();""!==e&&t.push({keyword:e,geo:"",time:"today 12-m"})}),0===t.length)return!1;t={comparisonItem:t,category:0,property:""},e.iframe.attr("src",e.iframe.data("srcbase")+"&req="+encodeURIComponent(JSON.stringify(t)))}),this.holder.on("keydown","input",function(t){if(13===t.keyCode)return t.preventDefault(),e.btnCompare.trigger("click"),!1})}},{key:"addNewField",value:function(e){var t=(0,a.default)("<div/>"),n=(0,a.default)("<input/>",{type:"text",class:"widefat",value:e||""});t.append(n),t.append('<button class="button-small button-link button-link-delete remove-keyword"><span class="dashicons dashicons-trash"></span></button>'),this.holder.append(t),n.autocomplete(this.focusKeywords.getAutocompleteOptions()).focus()}}]),e}();t.default=o},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r="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},i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=l(n(5)),o=l(n(252)),s=l(n(62)),u=l(n(253)),c=l(n(254));function l(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.elemMetabox=(0,a.default)("#rank_math_metabox"),e.elemSlug=(0,a.default)("#post_name"),e.elemTitle=(0,a.default)("#title"),e.elemDescription=(0,a.default)("#excerpt"),e.elemContent=(0,a.default)("#content"),e.elemPrice=(0,a.default)("#_sale_price"),e.elemRegPrice=(0,a.default)("#_regular_price"),e.researches=!1,e.isGutenbergAvailable=(0,c.default)(),e.testRequired={title:!0,description:!0,url:!0,content:!0},e.testOptional={title:!0,headings:!0,imagealt:!0,titleBeginning:!0,contentBeginning:!0,keywordDensity:!0,newKeyword:!0},e.init(),e.updateOthers(),e.postSerpEvents(),e.primaryTerm(),e.featuredImage(),e.linkSuggestions(),e.richSnippetIcon(),void 0!==window.ET_PageBuilder&&Backbone.Events.listenTo(window.ET_PageBuilder.Events,"et-pb-content-updated",function(){e.updateDescriptionPreview()}),e.isGutenbergAvailable&&new u.default(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),i(t,[{key:"updateSlug",value:function(e){this.serpPermalinkField.val(e),this.elemSlug.val(e),(0,a.default)("#editable-post-name").text(e),(0,a.default)("#editable-post-name-full").text(e),this.isGutenbergAvailable&&e!==wp.data.select("core/editor").getEditedPostAttribute("slug")&&wp.data.dispatch("core/editor").editPost({slug:e})}},{key:"updateOthers",value:function(){var e=this;this.isGutenbergAvailable||(""===this.elemSlug.val()&&(0,a.default)("#editable-post-name-full").length&&this.elemSlug.val((0,a.default)("#editable-post-name-full").text()).trigger("input"),this.analyzeOnPage&&(0,a.default)(document).on("tinymce-editor-init",function(t,n){e.updatePreview()}))}},{key:"postSerpEvents",value:function(){var e=this;this.analyzeOnPage&&(this.elemContent.on("input change",(0,s.default)(function(){e.updateDescriptionPreview(),e.socialFields.updateThumbnailPreview()},500)),(0,a.default)(window).on("load",function(){!e.isGutenbergAvailable&&"undefined"!=typeof tinymce&&tinymce.activeEditor&&tinyMCE.editors.content.on("keyup change",(0,s.default)(function(t){e.updateDescriptionPreview(),e.socialFields.updateThumbnailPreview()},500))})),(0,a.default)(document).on("ajaxComplete",function(t,n,r){if("/admin-ajax.php"===r.url.substr(-15)){var i="";"string"==typeof r.data&&-1!==r.data.indexOf("action=sample-permalink")&&(i=""===n.responseText?e.elemTitle.val():(0,a.default)("<div>"+n.responseText+"</div>").find("#editable-post-name-full").text(),e.serpPermalinkField.val(i).trigger("input"))}}),this.elemPrice.on("input",(0,s.default)(function(){e.setVariable("wc_price",e.getWooCommerceProductPrice()),e.updateDescriptionPreview()},500)),this.elemRegPrice.on("input",(0,s.default)(function(){e.setVariable("wc_price",e.getWooCommerceProductPrice()),e.updateDescriptionPreview()},500))}},{key:"getWooCommerceProductPrice",value:function(){var e=this.elemPrice.val()?this.elemPrice.val():this.elemRegPrice.val();return accounting.formatMoney(e,{symbol:woocommerce_admin_meta_boxes.currency_format_symbol,decimal:woocommerce_admin_meta_boxes.currency_format_decimal_sep,thousand:woocommerce_admin_meta_boxes.currency_format_thousand_sep,precision:woocommerce_admin_meta_boxes.currency_format_num_decimals,format:woocommerce_admin_meta_boxes.currency_format})}},{key:"primaryTerm",value:function(){(0,a.default)("[data-primary-term]").each(function(){var e=(0,a.default)(this),t=e.val(),n=e.data("primary-term"),r=(0,a.default)("#"+n+"div"),i=(0,a.default)("#"+n+"checklist"),o=i.find("li"),s=i.find('input[type="checkbox"]:checked');o.addClass("rank-math-primary-term-li"),o.find("input").each(function(){var e=(0,a.default)(this);e.parent().append('<span class="rank-math-tooltip"><input class="rank-math-make-primary" value="'+e.val()+'" type="radio" name="rank_math_primary_'+n+'"><span>Make Term Primary</span></span>')}),s.each(function(){var e=(0,a.default)(this).closest("li");e.addClass("term-checked"),n+"-"+t===e.attr("id")&&(e.addClass("term-marked-primary"),e.find(">label .rank-math-make-primary").prop("checked",!0))}),r.on("click",'input[type="checkbox"]',function(){var t=(0,a.default)(this).closest("li");if(t.toggleClass("term-checked"),1===i.find("li.term-checked").length||t.hasClass("term-marked-primary")&&!t.hasClass("term-checked")){var n=i.find("li.term-checked:first > label .rank-math-make-primary");n.length>0?n.trigger("click"):(o.removeClass("term-marked-primary"),o.find('input[type="radio"]').prop("checked",!1),e.val(""))}}),r.on("click",".rank-math-make-primary",function(){var t=(0,a.default)(this),n=t.closest("li");o.removeClass("term-marked-primary"),n.addClass("term-marked-primary"),e.val(t.val())}),i.on("wpListAddEnd",function(){i.find("li:not(.rank-math-primary-term-li)").addClass("rank-math-primary-term-li term-checked").find("input").each(function(){var e=(0,a.default)(this);e.parent().append('<span class="rank-math-tooltip"><input class="rank-math-make-primary" value="'+e.val()+'" type="radio" name="rank_math_primary_'+n+'"><span>Make Term Primary</span></span>')})})})}},{key:"featuredImage",value:function(){var e=this;if(this.analyzeOnPage){var t=(0,a.default)("#postimagediv"),n=t.find(".hndle"),r=wp.media.featuredImage.frame();if(r.on("select",function(){var t=r.state().get("selection").first().toJSON(),i=(0,a.default)("#rank_math_post_thumbnail");200>t.width||200>t.height?0===(0,a.default)("#rank_math_image_warning").length&&(0,a.default)('<div id="rank_math_image_warning" class="notice notice-error notice-alt"><p>'+rankMath.featuredImageNotice+"</p></div>").insertAfter(n):(0,a.default)("#rank_math_image_warning").remove(),1>i.length&&(i=(0,a.default)('<img id="rank_math_post_thumbnail" />'),(0,a.default)(".facebook-thumbnail",".rank-math-social-preview-image").before(i)),i.attr("src","large"in t.sizes?t.sizes.large.url:t.sizes.full.url),e.setFeaturedImage(t.alt)}),(0,a.default)("#postimagediv").on("click","#remove-post-thumbnail",function(){(0,a.default)("#rank_math_image_warning").remove(),(0,a.default)("#rank_math_post_thumbnail").remove(),e.setFeaturedImage("")}),this.assessor.paper.setThumbnailAlt(t.find("img").attr("alt")),this.socialFields.updateThumbnailPreview(),this.isGutenbergAvailable){var i=void 0,o=void 0;wp.data.subscribe(function(){var t=wp.data.select("core/editor").getEditedPostAttribute("featured_media");e.isValidMediaId(t)&&void 0!==(i=wp.data.select("core").getMedia(t))&&i!==o&&(o=i,e.setFeaturedImage(i.alt_text))})}}}},{key:"isValidMediaId",value:function(e){return"number"==typeof e&&e>0}},{key:"setFeaturedImage",value:function(e){this.socialFields.updateThumbnailPreview(),this.assessor.paper.setThumbnailAlt(e),this.seoContentAssessments()}},{key:"linkSuggestions",value:function(){rankMath.postSettings.linkSuggestions&&(a.default.fn.extend({insertLink:function(e,t){var n=this[0],r="";if(n.selectionStart||"0"===n.selectionStart){var i=n.selectionStart,a=n.selectionEnd,o=n.scrollTop;r='<a href="'+e+'">'+n.value.substring(i,a)+"</a>",i===a&&(r='<a href="'+e+'">'+t+"</a>"),n.value=n.value.substring(0,i)+r+n.value.substring(a,n.value.length),n.focus(),n.selectionStart=i+r.length,n.selectionEnd=i+r.length,n.scrollTop=o}else n.value+=r='<a href="'+e+'">'+t+"</a>",n.focus()}}),"function"==typeof ClipboardJS&&new ClipboardJS(".suggestion-copy").on("success",function(e){var t=(0,a.default)(e.trigger).parent().next(".suggestion-title"),n=t.html();t.text("Link Copied"),setTimeout(function(){t.html(n)},1500)}),(0,a.default)(window).on("load",function(){if("object"!==("undefined"==typeof tinymce?"undefined":r(tinymce)))return!0;var e=null,t=null;(0,a.default)(".suggestion-insert").on("click",function(n){n.preventDefault();var r,i,o,s,u=(0,a.default)(this);if(u.hasClass("clicked"))return!0;if(null!==tinymce.activeEditor&&!0!==tinymce.activeEditor.isHidden()){e=tinymce.activeEditor,t=(0,a.default)(e.getBody());var c=e.selection.getContent()||"";if(t.find("a[data-mce-selected]").length){var l=(o=e.selection.getStart(),(s=e.dom.getParent(o,"a[href]"))||(i=e.selection.getContent({format:"raw"}))&&-1!==i.indexOf("</a>")&&((r=i.match(/href="([^">]+)"/))&&r[1]&&(s=e.$('a[href="'+r[1]+'"]',o)[0]),s&&e.selection.select(s)),s);e.dom.setAttribs(l,{href:u.data("url")}),(0,a.default)(l).text()!==c&&e.insertContent(c)}else e.insertContent(c.length?'<a href="'+u.data("url")+'">'+c+"</a>":'<a href="'+u.data("url")+'">'+u.data("text")+"</a>")}else{var f=(0,a.default)("textarea.wp-editor-area:visible");f.length&&f.first().insertLink(u.data("url"),u.data("text"))}var p=u.closest(".suggestion-item").find(".suggestion-title"),d=p.html();p.text("Link Inserted"),u.addClass("clicked"),setTimeout(function(){var e,t,n,r;p.html(d),u.removeClass("clicked"),!0===rankMath.postSettings.useFocusKeyword&&(t=u,n=(e=p).data("fkcount")||0,(n+=1)===(r=e.data("fk")).length&&(n=0),e.find(">a").text(r[n]),e.data("fkcount",n),t.data("text",r[n]))},1500)})}),(0,a.default)("#rank_math_metabox_link_suggestions").find("h2").append((0,a.default)("#rank-math-link-suggestions-tooltip").html()))}},{key:"richSnippetIcon",value:function(){var e={off:"dashicons-image-filter",article:"dashicons-admin-post",book:"dashicons-book-alt",course:"dashicons-welcome-learn-more",event:"dashicons-calendar",jobposting:"dashicons-megaphone",local:"dashicons-store",music:"dashicons-format-audio",product:"dashicons-cart",recipe:"dashicons-carrot",restaurant:"dashicons-palmtree",video:"dashicons-format-video",person:"dashicons-admin-users",review:"dashicons-star-filled",service:"dashicons-admin-generic",software:"dashicons-index-card"},t=(0,a.default)('.rank-math-tabs-navigation a[href="#setting-panel-richsnippet"] .dashicons'),n=(0,a.default)("#_bsf_post_type");if((0,a.default)('#rank_math_rich_snippet, input[type="radio"][name="rank_math_rich_snippet"]').on("change",function(){var r="rank_math_rich_snippet"===(0,a.default)(this).attr("id")?(0,a.default)(this).val():(0,a.default)('input[type="radio"][name="rank_math_rich_snippet"]:checked').val();t.removeClass().addClass("dashicons "+e[r]),n.length&&"off"!==r&&n.val("0").trigger("change")}).trigger("change"),n.length){var r=(0,a.default)("#rank_math_rich_snippet"),i=(0,a.default)('input[name="rank_math_rich_snippet"][value="off"]');n.on("change",function(){"0"!==n.val()&&(r.val("off").trigger("change"),i.prop("checked",!0).trigger("change"))}).trigger("change")}}}]),t}();(0,a.default)(function(){new f})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=m(n(5));n(209),n(210);var a=m(n(93)),o=m(n(92)),s=m(n(136)),u=m(n(31)),c=m(n(62)),l=m(n(214)),f=m(n(218)),p=m(n(219)),d=m(n(220)),h=m(n(50)),v=m(n(145));function m(e){return e&&e.__esModule?e:{default:e}}var g=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"init",value:function(){this.title="",this.permalink="",this.description="",this.variableMap=null,this.analyzeOnPage=null!==document.getElementById("rank-math-serp-checklist"),this.shouldAssess=!1,this.primaryResult={},this.serpCanonical=this.elemMetabox.find("#rank_math_canonical_url"),this.serpTitleField=this.elemMetabox.find("#rank_math_title"),this.serpPermalinkField=this.elemMetabox.find("#rank_math_permalink"),this.serpDescriptionField=this.elemMetabox.find("#rank_math_description"),this.serpWrapper=this.elemMetabox.find(".serp-preview"),this.serpBg=this.elemMetabox.find(".serp-preview-bg input"),this.serpTitle=this.serpWrapper.find(".serp-title"),this.serpPermalink=this.serpWrapper.find(".serp-url"),this.serpDescription=this.serpWrapper.find(".serp-description"),this.desktopSnippet=this.serpWrapper.find(".serp-snippet-data"),this.assessor=new Assessor({elemContent:this.elemContent,researches:this.researches}),this.analyzeOnPage&&(this.checkList=new l.default(this)),this.socialFields=new f.default(this),this.compareKeywords=new d.default(this.focusKeywords),this.focusKeywords=new p.default(this),this.wrapInGroup(),this.serpEvents(),this.updateEvents(),this.updatePreview(),this.initLengthIndicator(),rankMathAdmin.variableInserter(!1)}},{key:"wrapInGroup",value:function(){this.serpTitle.wrap('<div class="group"></div>'),this.serpPermalink.wrap('<div class="group"></div>'),this.serpDescription.wrap('<div class="group"></div>'),(0,i.default)(".cmb2-id-rank-math-title").insertAfter(this.serpTitle),(0,i.default)(".cmb2-id-rank-math-permalink").insertAfter(this.serpPermalink),(0,i.default)(".cmb2-id-rank-math-description").insertAfter(this.serpDescription),(0,i.default)(".group",this.serpWrapper).prepend('<span class="dashicons dashicons-no-alt serp-close"></span>')}},{key:"initLengthIndicator",value:function(){this.serpTitleField.lengthIndicator({minLength:15,maxLength:60,source:this.serpTitle}),this.serpPermalinkField.lengthIndicator({minLength:5,maxLength:75,source:this.serpPermalink}),this.serpDescriptionField.lengthIndicator({minLength:80,maxLength:160,source:this.serpDescription})}},{key:"serpEvents",value:function(){var e=this,t=this.elemMetabox.find(".rank-math-select-device");t.on("click",function(n){n.preventDefault();var r,a=(0,i.default)(n.currentTarget),o=a.hasClass("active");r=function(t){switch(t){case"desktop-preview":e.serpWrapper.removeClass("mobile-preview"),e.serpWrapper.addClass("desktop-preview expanded-preview");break;case"mobile-preview":e.serpWrapper.removeClass("desktop-preview"),e.serpWrapper.addClass("mobile-preview expanded-preview");break;default:e.serpWrapper.removeClass("mobile-preview expanded-preview"),e.serpWrapper.addClass("desktop-preview")}},t.removeClass("active"),o?r("normal"):a.hasClass("device-desktop")?(r("desktop-preview"),a.addClass("active")):a.hasClass("device-mobile")&&(r("mobile-preview"),a.addClass("active"))});var n=!0,r=this.elemMetabox.find(".rank-math-edit-snippet");this.elemMetabox.on("click",".rank-math-edit-snippet",function(t){t.preventDefault(),r.toggleClass("hidden active"),e.desktopSnippet.toggle();var i={type:"click",isHidden:n=!n};e.serpTitle.trigger(i),e.serpPermalink.trigger(i),e.serpDescription.trigger(i)}),this.elemMetabox.on("click",".serp-title, .serp-url, .serp-description, .serp-close",function(t){t.preventDefault();var a=(0,i.default)(t.target).parent();"isHidden"in t?a.toggleClass("active",!t.isHidden):(a.toggleClass("active"),0===e.serpWrapper.find(".group.active").length&&r.hasClass("active")&&(n=!n,r.toggleClass("hidden active")),3!==e.serpWrapper.find(".group.active").length||r.hasClass("active")||(n=!1,r.toggleClass("hidden active")))});var a=(0,i.default)("#rank_math_robots2");a.on("change",function(){a.is(":checked")?e.serpWrapper.addClass("noindex-preview"):e.serpWrapper.removeClass("noindex-preview")}).trigger("change"),(0,i.default)("textarea[data-autoresize]").each(function(){var e=(0,i.default)(this);e.on("keyup input",function(){e.css("height","auto").css("height",e.prop("scrollHeight"))})})}},{key:"updateEvents",value:function(){var e=this;this.serpTitleField.on("input",(0,c.default)(function(){e.updateTitlePreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemTitle.on("input",(0,c.default)(function(){e.setVariable("title",e.elemTitle.val()),e.setVariable("term",e.elemTitle.val()),e.setVariable("author",e.elemTitle.val()),e.setVariable("name",e.elemTitle.val()),e.updateTitlePreview()},500)),this.serpPermalinkField.val(this.serpPermalinkField.val()||this.elemSlug.val()).on("input",(0,c.default)(function(){var t=decodeURIComponent(e.serpPermalinkField.val());e.updateSlug(t),e.updatePermalinkPreview()},500)).on("blur",function(){var t=(0,s.default)(e.serpPermalinkField.val());e.updateSlug(t)}).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemSlug.on("input",(0,c.default)(function(){e.serpPermalinkField.val(e.elemSlug.val()).trigger("input")},500)),this.serpDescriptionField.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemDescription.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500))}},{key:"updateSlug",value:function(e){this.serpPermalinkField.val(e),this.elemSlug.val(e)}},{key:"seoAssessments",value:function(e){if(!1!==this.shouldAssess){var t=null;"title"===e?t=this.assessor.assessTitle(this.title):"permalink"===e?t=this.assessor.assessPermalink(this.permalink):"description"===e?(this.assessor.paper.setDescription(this.description),t=this.assessor.assessFocusKeyword(this.focusKeywords.getFocusKeyword())):"content"===e&&(t=this.assessor.assessContent(this.description)),this.setKeywordStatus(t)}}},{key:"seoTitleAssessments",value:function(){this.seoAssessments("title")}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessments("permalink")}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessments("description")}},{key:"seoContentAssessments",value:function(){this.seoAssessments("content")}},{key:"seoAssessAll",value:function(){if(!1!==this.shouldAssess){this.assessor.paper.setTitle(this.title),this.assessor.paper.setPermalink(this.permalink),this.assessor.paper.setKeyword(this.focusKeywords.getFocusKeyword().keyword),this.assessor.paper.setDescription(this.description);var e=this.assessor.runAll();this.setKeywordStatus(e)}}},{key:"setKeywordStatus",value:function(e){if(!1!==this.analyzeOnPage){var t=this.focusKeywords.getFocusKeyword();if(t.isPrimary||void 0===t.elem)this.checkList.elem.show(),this.checkList.display(e);else{var n={keywordDensity:e.keywordDensity,keywordInContent:e.keywordInContent,keywordInSubheadings:e.keywordInSubheadings};"post"!==rankMath.objectType&&this.checkList.elem.hide(),this.checkList.hidePrimary(),this.checkList.display(n),this.checkList.setSecondaryKeywordStatus(n,t.elem),delete e.keywordDensity,delete e.keywordInContent,delete e.keywordInSubheadings,delete this.primaryResult.keywordInTitle,delete this.primaryResult.keywordInMetaDescription,delete this.primaryResult.keywordInPermalink,delete this.primaryResult.keywordIn10Content,delete this.primaryResult.keywordInImageAlt,delete this.primaryResult.keywordNotUsed,delete this.primaryResult.titleStartWithKeyword}this.primaryResult=i.default.extend({},this.primaryResult,e),this.checkList.setPrimaryKeywordStatus(this.primaryResult,this.focusKeywords.elem.next().find(">li:not(.placeholder)").eq(1))}}},{key:"updatePreview",value:function(){this.updateTitlePreview(),this.updatePermalinkPreview(),this.updateDescriptionPreview(),this.shouldAssess=this.analyzeOnPage,this.seoAssessAll(),this.focusKeywords.elem.trigger("content-loaded"),this.updateFocusKeywords()}},{key:"updateFocusKeywords",value:function(){var e=this.focusKeywords.getFocusKeyword().keyword;if(""!==e&&(this.setVariable("focuskw",e),this.serpBg.val(e)),this.focusKeywords.getFocusKeyword().isPrimary){this.shouldAssess=!1,this.updateDescriptionPreview(),this.shouldAssess=!0,this.seoFocusKeywordAssessments(),this.highlightKeywords(),this.updatePreviewCallbacks("description",this.description),this.updatePreviewCallbacks("focus-keyword",e);var t=(0,i.default)(".focus-keyword-link");t.length&&""!==e&&t.attr("href",t.attr("href").replace("%focus_keyword%",e).replace("%post_type%",rankMath.objectType).replace("%taxonomy%",rankMath.objectType))}else this.seoFocusKeywordAssessments()}},{key:"updateTitlePreview",value:function(){this.title=this.serpTitleField.val();var e=""!==this.title;this.title=this.swapVars(""!==this.title?this.title:this.serpTitle.data("format")),this.serpTitle.html(this.title),this.serpTitleField.attr("placeholder",e?this.title:this.serpTitle.data("format")),this.socialFields.facebookTitleField.attr("placeholder",this.title),this.socialFields.twitterTitleField.attr("placeholder",this.title),this.seoTitleAssessments(),this.highlightKeywords(this.serpTitle),this.updatePreviewCallbacks("title",this.title),this.serpTitle.trigger("rank-math-vars-replaced")}},{key:"updatePermalinkPreview",value:function(){var e=this.serpPermalink.data("format")||"",t=(0,s.default)(this.serpPermalinkField.val());this.permalink=""!==t?e.replace(/%(postname|pagename)%/,t).trimRight("/")+"/":"",this.serpCanonical.attr("placeholder",this.permalink),this.serpPermalink.html(this.permalink),this.seoPermalinkAssessments(),this.highlightKeywords(this.serpPermalink),this.updatePreviewCallbacks("permalink",this.permalink),this.serpPermalink.trigger("rank-math-vars-replaced")}},{key:"updateDescriptionPreview",value:function(){this.description=this.swapVars(this.getDescription()),this.serpDescription.html(this.description),this.serpDescriptionField.attr("placeholder",""!==this.description?this.description:this.serpDescription.data("format"));var e=this.getDescriptionTruncated(this.description,300);this.socialFields.facebookDescriptionField.attr("placeholder",e),this.socialFields.twitterDescriptionField.attr("placeholder",e),this.seoContentAssessments(),this.highlightKeywords(this.serpDescription),this.updatePreviewCallbacks("description",this.description),this.serpDescription.trigger("rank-math-vars-replaced")}},{key:"updatePreviewCallbacks",value:function(e,t){this.elemMetabox.trigger("rank-math-updating-preview-"+(e=e||"global")),this.elemMetabox.trigger("rank-math-"+e+"-updated",t)}},{key:"highlightKeywords",value:function(e){var t=this.focusKeywords.getFocusKeyword().keyword;!1!==t&&(e?(e.hasClass("serp-url")&&(t=this.assessor.paper.get("keywordPermalink")),e.rankMathUnhighlight(),e.rankMathHighlight(t)):(this.serpTitle.rankMathUnhighlight(),this.serpTitle.rankMathHighlight(t),this.serpPermalink.rankMathUnhighlight(),this.serpPermalink.rankMathHighlight(this.assessor.paper.get("keywordPermalink")),this.serpDescription.rankMathUnhighlight(),this.serpDescription.rankMathHighlight(t)))}},{key:"swapVars",value:function(e,t){var n=this;return(e=e||"")?(t=t||this.getMapObj(),(e=e.replace(" %page%","").replace("%sep% %sep%","%sep%")).replace(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/giu,function(e){var r=e.toLowerCase().replace(/%+/g,"");return["title","post_title","term","author","name"].includes(r)?n.isGutenbergAvailable?t.title:n.elemTitle.val():["description","tag_description","category_description","cat_description","author_description","user_description"].includes(r)?(0,i.default)("#description").val():["fk","focuskeyword","focuskw"].includes(r)?n.focusKeywords.getFocusKeyword().keyword:r.includes("customfield(")?(r=r.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[r]:"":(r.includes("(")&&(r=r.split("(")[0]),r in t?t[r]:r)}).trim()):""}},{key:"getMapObj",value:function(){var e=this;return null!==this.variableMap?this.variableMap:(this.variableMap={},i.default.each(rankMath.variables,function(t,n){t=t.toLowerCase().replace(/%+/g,"").split("(")[0],e.variableMap[t]=n.example}),this.variableMap)}},{key:"setVariable",value:function(e,t){null!==this.variableMap?this.variableMap[e]=t:void 0!==rankMath.variables[e]&&(rankMath.variables[e].example=t)}},{key:"getContent",value:function(){return this.assessor.paper.get("content")}},{key:"getDescription",value:function(){this.assessor.refreshContent();var e=this.getExcerpt(),t=this.serpDescriptionField.val();if(""!==t)return(0,h.default)(t);if(!(0,o.default)(e)&&""!==e)return(0,h.default)(e);var n=this.serpDescription.data("format"),r=this.generateDescriptionFromContent(this.getContent());return this.setVariable("excerpt",r),(0,o.default)(n)||""===n?r:(0,h.default)(n)}},{key:"getExcerpt",value:function(){if(this.isGutenbergAvailable)return"";var e=this.elemDescription.val();return this.setVariable("excerpt",e),this.setVariable("excerpt_only",e),this.setVariable("wc_shortdesc",e),e}},{key:"generateDescriptionFromContent",value:function(e){if(""===e)return"";var t=this.focusKeywords.getFocusKeyword().keyword,n=(0,a.default)((0,v.default)(e,!0),function(e){return""!==i.default.trim(e)});if(!n.length)return"";if(""!==t){var r=(0,a.default)(n,function(e){return(0,u.default)(e.toLowerCase(),t)});if(r.length>0)return this.getDescriptionTruncated(r[0],160)}return this.getDescriptionTruncated(n[0],160)}},{key:"getDescriptionTruncated",value:function(e,t){return t?this.truncate(e.replace(/\r?\n|\r/g," "),t):e.replace(/\r?\n|\r/g," ")}},{key:"truncate",value:function(e,t){return e.length>t?e.substring(0,t):e}}]),e}();t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=(r=n(62))&&r.__esModule?r:{default:r},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metabox=t,this.getPostAttribute=this.getPostAttribute.bind(this),this.refresh=this.refresh.bind(this),this._data=this.collectGutenbergData(this.getPostAttribute),this.subscribeToGutenberg()}return i(e,[{key:"collectGutenbergData",value:function(){return{content:this.getPostAttribute("content"),title:this.getPostAttribute("title"),slug:this.getSlug(),excerpt:this.getPostAttribute("excerpt")}}},{key:"getSlug",value:function(){if("auto-draft"===this.getPostAttribute("status"))return"";var e=this.getPostAttribute("generated_slug");return"auto-draft"!==e&&"en"===rankMath.locale||(e=""),this.getPostAttribute("slug")||e}},{key:"getPostAttribute",value:function(e){return this._coreEditorSelect||(this._coreEditorSelect=wp.data.select("core/editor")),this._coreEditorSelect.getEditedPostAttribute(e)}},{key:"subscribeToGutenberg",value:function(){this.subscriber=(0,a.default)(this.refresh,500),wp.data.subscribe(this.subscriber)}},{key:"refresh",value:function(){var e=this.collectGutenbergData();this.handleEditorChange(e),this._data=e}},{key:"handleEditorChange",value:function(e){this._data.title!==e.title&&(this.metabox.title=e.title,this.metabox.setVariable("title",e.title),this.metabox.setVariable("term",e.title),this.metabox.setVariable("author",e.title),this.metabox.setVariable("name",e.title),this.metabox.updateTitlePreview()),this._data.excerpt!==e.excerpt&&(this.metabox.setVariable("excerpt",e.excerpt),this.metabox.setVariable("excerpt_only",e.excerpt),this.metabox.setVariable("wc_shortdesc",e.excerpt),this.metabox.updateDescriptionPreview()),this._data.slug!==e.slug&&this.metabox.serpPermalinkField.val(e.slug).trigger("input"),this._data.content!==e.content&&(this.metabox.assessor.paper.setContent(e.content),this.metabox.updateDescriptionPreview(),this.metabox.socialFields.updateThumbnailPreview())}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(92)),i=a(n(96));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(){return!(0,r.default)(window.wp)&&!(0,r.default)(wp.data)&&!(0,r.default)(wp.data.select("core/editor"))&&(0,i.default)(wp.data.select("core/editor").getEditedPostAttribute)}}]);
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=251)}([function(e,t){e.exports=Array.isArray},function(e,t,n){var r=n(75)("wks"),i=n(40),a=n(2).Symbol,o="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(11),i=n(41);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=!n(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=jQuery},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(70)("wks"),i=n(71),a=n(6).Symbol,o="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(34),i=n(68);e.exports=n(20)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(12),i=n(77),a=n(79),o=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(2),i=n(3),a=n(14),o=n(40)("src"),s=Function.toString,u=(""+s).split("toString");n(39).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(a(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(a(n,o)||i(n,o,e[t]?""+e[t]:u.join(t+""))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||s.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return e}},,function(e,t,n){var r=n(89);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports={}},function(e,t,n){var r=n(35);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(36)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(181),i=n(43);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(0),i=n(30),a=n(130),o=n(60);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:a(o(e))}},function(e,t,n){var r=n(96),i=n(54);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},,function(e,t,n){var r=n(109),i=n(112)(r);e.exports=i},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(0),i=n(129),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||o.test(e)||!a.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(52),i=n(26),a=n(105),o=n(140),s=n(141),u=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:s(e),n=n&&!c?o(n):0;var l=e.length;return 0>n&&(n=u(l+n,0)),a(e)?l>=n&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},function(e,t,n){var r=n(156),i=n(33);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(19),i=n(159),a=n(160),o=Object.defineProperty;t.f=n(20)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(70)("keys"),i=n(71);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(75)("keys"),i=n(40);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){"use strict";var r=n(3),i=n(13),a=n(22),o=n(43),s=n(1);e.exports=function(e,t,n){var u=s(e),c=n(o,u,""[e]),l=c[0],f=c[1];a(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,l),r(RegExp.prototype,u,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(113),i=n(127),a=n(104),o=n(0),s=n(133);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?o(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(25),i=n(15);e.exports=function(e,t){for(var n=0,a=(t=r(t,e)).length;null!=e&&a>n;)e=e[i(t[n++])];return n&&n==a?e:void 0}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"\n")}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&9007199254740991>=e}},function(e,t,n){var r=n(115),i=n(116),a=n(117),o=n(118),s=n(119);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(120),i=n(57);e.exports=function e(t,n,a,o,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,a,o,e,s))}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(24);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){var r=n(24),i=n(211),a=n(144),o=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,f,p,d,h=0,v=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,h=t,f=e.apply(r,n)}function k(e){var n=e-d;return void 0===d||n>=t||0>n||m&&e-h>=l}function b(){var e=i();if(k(e))return w(e);p=setTimeout(b,function(e){var n=t-(e-d);return m?s(n,l-(e-h)):n}(e))}function w(e){return p=void 0,g&&u?y(e):(u=c=void 0,f)}function x(){var e=i(),n=k(e);if(u=arguments,c=this,d=e,n){if(void 0===p)return function(e){return h=e,p=setTimeout(b,t),v?y(e):f}(d);if(m)return p=setTimeout(b,t),y(d)}return void 0===p&&(p=setTimeout(b,t)),f}return t=a(t)||0,r(n)&&(v=!!n.leading,l=(m="maxWait"in n)?o(a(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),x.cancel=function(){void 0!==p&&clearTimeout(p),h=0,u=d=c=p=void 0},x.flush=function(){return void 0===p?f:w(i())},x}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(65),i=n(66),a=n(161),o=n(10),s=n(18),u=n(162),c=n(73),l=n(170),f=n(8)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,m,g){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in O)return O[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,P=!1,O=e.prototype,C=O[f]||O["@@iterator"]||v&&O[v],T=C||w(v),S=v?_?w("entries"):T:void 0,M="Array"==t&&O.entries||C;if(M&&(b=l(M.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||o(b,f,d)),_&&C&&"values"!==C.name&&(P=!0,T=function(){return C.call(this)}),r&&!g||!p&&!P&&O[f]||o(O,f,T),s[t]=T,s[x]=d,v)if(y={values:_?T:w("values"),keys:m?T:w("keys"),entries:S},g)for(k in y)k in O||a(O,k,y[k]);else i(i.P+i.F*(p||P),t,y);return y}},function(e,t){e.exports=!0},function(e,t,n){var r=n(6),i=n(7),a=n(157),o=n(10),s=n(21),u=function(e,t,n){var c,l,f,p=e&u.F,d=e&u.G,h=e&u.S,v=e&u.P,m=e&u.B,g=e&u.W,y=d?i:i[t]||(i[t]={}),k=y.prototype,b=d?r:h?r[t]:(r[t]||{}).prototype;for(c in d&&(n=t),n)(l=!p&&b&&void 0!==b[c])&&s(y,c)||(f=l?b[c]:n[c],y[c]=d&&"function"!=typeof b[c]?n[c]:m&&l?a(f,r):g&&b[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?a(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[c]=f,e&u.R&&k&&!k[c]&&o(k,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(35),i=n(6).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(165),i=n(72);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(7),i=n(6),a=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(65)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(34).f,i=n(21),a=n(8)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){var r=n(33);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(39),i=n(2),a=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(76)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t,n){e.exports=!n(4)&&!n(22)(function(){return 7!=Object.defineProperty(n(78)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9),i=n(2).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(184);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(83),i=n(45);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(14),i=n(23),a=n(188)(!1),o=n(44)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=o&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(11).f,i=n(14),a=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){var r=n(9),i=n(80),a=n(1)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(148),i=n(149),a=n(176);e.exports=function(e,t){return r(e)||i(e,t)||a()}},function(e,t,n){e.exports=n(196)},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(132),i=n(102);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&t>e}},function(e,t){e.exports=function(e){return void 0===e}},function(e,t,n){var r=n(107),i=n(108),a=n(47),o=n(0);e.exports=function(e,t){return(o(e)?r:i)(e,a(t,3))}},function(e,t,n){var r=n(61),i=n(47),a=n(146),o=n(0);e.exports=function(e,t){return(o(e)?r:a)(e,i(t,3))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,"").replace(i,"")};var r=/\[[^<>&\/\[\] - =]+?( [^\]]+?)?\]/g,i=/\[\/[^<>&\/\[\] - =]+?\]/g},function(e,t,n){var r=n(53),i=n(24);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(0);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return r(e)?e:[e]}},function(e,t,n){var r=n(52);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(25),i=n(103),a=n(0),o=n(91),s=n(54),u=n(15);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&o(p,l)&&(a(e)||i(e))}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(53),i=n(0),a=n(57);e.exports=function(e){return"string"==typeof e||!i(e)&&a(e)&&"[object String]"==r(e)}},,function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}},function(e,t,n){var r=n(28);e.exports=function(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}},function(e,t,n){var r=n(110),i=n(29);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(111)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===n(a[u],u,a))break}return t}}},function(e,t,n){var r=n(26);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var a=n.length,o=t?a:-1,s=Object(n);(t?o--:++o<a)&&!1!==i(s[o],o,s););return n}}},function(e,t,n){var r=n(114),i=n(126),a=n(59);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(55),i=n(56);e.exports=function(e,t,n,a){var o=n.length,s=o,u=!a;if(null==e)return!s;for(e=Object(e);o--;){var c=n[o];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<s;){var l=(c=n[o])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(a)var h=a(f,p,l,e,t,d);if(!(void 0===h?i(p,f,3,a,d):h))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(17),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return n>=0&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(17);e.exports=function(e){var t=this.__data__,n=r(t,e);return 0>n?void 0:t[n][1]}},function(e,t,n){var r=n(17);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(17);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return 0>i?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(55),i=n(121),a=n(123),o=n(124),s=n(99),u=n(0),c=n(100),l=n(101),f="[object Arguments]",p="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,m,g){var y=u(e),k=u(t),b=y?p:s(e),w=k?p:s(t),x=(b=b==f?d:b)==d,_=(w=w==f?d:w)==d,P=b==w;if(P&&c(e)){if(!c(t))return!1;y=!0,x=!1}if(P&&!x)return g||(g=new r),y||l(e)?i(e,t,n,v,m,g):a(e,t,b,n,v,m,g);if(!(1&n)){var O=x&&h.call(e,"__wrapped__"),C=_&&h.call(t,"__wrapped__");if(O||C){var T=O?e.value():e,S=C?t.value():t;return g||(g=new r),m(T,S,n,v,g)}}return!!P&&(g||(g=new r),o(e,t,n,v,m,g))}},function(e,t,n){var r=n(97),i=n(122),a=n(98);e.exports=function(e,t,n,o,s,u){var c=1&n,l=e.length,f=t.length;if(!(l==f||c&&f>l))return!1;var p=u.get(e);if(p&&u.get(t))return p==t;var d=-1,h=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++d<l;){var m=e[d],g=t[d];if(o)var y=c?o(g,m,d,t,e,u):o(m,g,d,e,t,u);if(void 0!==y){if(y)continue;h=!1;break}if(v){if(!i(t,function(e,t){if(!a(v,t)&&(m===e||s(m,e,n,o,u)))return v.push(t)})){h=!1;break}}else if(m!==g&&!s(m,g,n,o,u)){h=!1;break}}return u.delete(e),u.delete(t),h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(125),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,o,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var d=s.get(e);if(d&&s.get(t))return d==t;var h=!0;s.set(e,t),s.set(t,e);for(var v=u;++f<l;){var m=e[p=c[f]],g=t[p];if(a)var y=u?a(g,m,p,t,e,s):a(m,g,p,e,t,s);if(!(void 0===y?m===g||o(m,g,n,a,s):y)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var k=e.constructor,b=t.constructor;k!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof b&&b instanceof b)&&(h=!1)}return s.delete(e),s.delete(t),h}},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(58),i=n(29);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var a=t[n],o=e[a];t[n]=[a,o,r(o)]}return t}},function(e,t,n){var r=n(56),i=n(128),a=n(90),o=n(30),s=n(58),u=n(59),c=n(15);e.exports=function(e,t){return o(e)&&s(t)?u(c(e),t):function(n){var o=i(n,e);return void 0===o&&o===t?a(n,e):r(t,o,3)}}},function(e,t,n){var r=n(48);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n(131)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,"$1"):n||e)}),t});e.exports=a},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(134),i=n(135),a=n(30),o=n(15);e.exports=function(e){return a(e)?r(o(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(48);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(e=(0,i.default)(e)).replace(/ /gi,"-").toLowerCase()};var r,i=(r=n(137))&&r.__esModule?r:{default:r}},function(e,t,n){var r=n(138),i=n(60),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]/g;e.exports=function(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}},function(e,t,n){var r=n(139)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(142),i=n(29);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){var r=n(61);e.exports=function(e,t){return r(t,function(t){return e[t]})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=u((0,i.autop)((0,o.default)(e)),t);return n.length>0?n:[e]};var r=s(n(94)),i=n(147),a=s(n(50)),o=s(n(95));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t){var n=[];t=t||!1;for(var i=/<p(?:[^>]+)?>(.*?)<\/p>/gi,o=void 0;null!==(o=i.exec(e));)n.push(o);return(0,r.default)(n,function(e){return t?(0,a.default)(e[1]):e[1]})}},function(e,t,n){var r=n(28),i=n(26);e.exports=function(e,t){var n=-1,a=i(e)?Array(e.length):[];return r(e,function(e,r,i){a[++n]=t(e,r,i)}),a}},function(e,t,n){"use strict";n.r(t),n.d(t,"autop",function(){return c}),n.d(t,"removep",function(){return l});var r=n(87),i=n.n(r),a=(n(177),n(194),n(195),n(88)),o=n.n(a),s=(n(199),n(200),/(<((?=!--|!\[CDATA\[)((?=!-)!(?:-(?!->)[^\-]*)*(?:-->)?|!\[CDATA\[[^\]]*(?:](?!]>)[^\]]*)*?(?:]]>)?)|[^>]*>?))/);function u(e,t){for(var n=function(e){for(var t,n=[],r=e;t=r.match(s);)n.push(r.slice(0,t.index)),n.push(t[0]),r=r.slice(t.index+t[0].length);return r.length&&n.push(r),n}(e),r=!1,i=o()(t),a=1;n.length>a;a+=2)for(var u=0;i.length>u;u++){var c=i[u];if(-1!==n[a].indexOf(c)){n[a]=n[a].replace(RegExp(c,"g"),t[c]),r=!0;break}}return r&&(e=n.join("")),e}function c(e){var t=1>=arguments.length||void 0===arguments[1]||arguments[1],n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){var r=e.split("</pre>"),a=r.pop();e="";for(var o=0;r.length>o;o++){var s=r[o],c=s.indexOf("<pre");if(-1!==c){var l="<pre wp-pre-tag-"+o+"></pre>";n.push([l,s.substr(c)+"</pre>"]),e+=s.substr(0,c)+l}else e+=s}e+=a}var f="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=u(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(RegExp("(<"+f+"[s/>])","g"),"\n\n$1")).replace(RegExp("(</"+f+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));var p=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",p.forEach(function(t){e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)","g"),"$1")).replace(RegExp("(</?"+f+"[^>]*>)s*</p>","g"),"$1"),t&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,function(e){return e[0].replace(/\n/g,"<WPPreserveNewline />")})).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,function(e,t){return t?e:"<br />\n"})).replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(RegExp("(</?"+f+"[^>]*>)s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach(function(t){var n=i()(t,2);e=e.replace(n[0],n[1])}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}function l(e){var t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",r=t+"|pre",i=[],a=!1,o=!1;return e?(-1===e.indexOf("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(e){return i.push(e),"<wp-preserve>"})),-1!==e.indexOf("<pre")&&(a=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(e){return(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")})),-1!==e.indexOf("[caption")&&(o=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(RegExp("\\s*</("+n+")>\\s*","g"),"</$1>\n")).replace(RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,function(e,t){return t&&-1!==t.indexOf("\n")?"\n\n":"\n"})).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(RegExp("\\s*</("+r+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),a&&(e=e.replace(/<wp-line-break>/g,"\n")),o&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),i.length&&(e=e.replace(/<wp-preserve>/g,function(){return i.shift()})),e):""}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t,n){var r=n(150);e.exports=function(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s,u=r(e);!(i=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}return n}},function(e,t,n){e.exports=n(151)},function(e,t,n){n(152),n(171),e.exports=n(173)},function(e,t,n){n(153);for(var r=n(6),i=n(10),a=n(18),o=n(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;s.length>u;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[o]&&i(f,o,c),a[c]=a.Array}},function(e,t,n){"use strict";var r=n(154),i=n(155),a=n(18),o=n(32);e.exports=n(64)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(63);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(158);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=!n(20)&&!n(36)(function(){return 7!=Object.defineProperty(n(67)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(35);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";var r=n(163),i=n(68),a=n(73),o={};n(10)(o,n(8)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var r=n(19),i=n(164),a=n(72),o=n(38)("IE_PROTO"),s=function(){},u=function(){var e,t=n(67)("iframe"),r=a.length;for(t.style.display="none",n(169).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[a[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[o]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(34),i=n(19),a=n(69);e.exports=n(20)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,u=0;s>u;)r.f(e,n=o[u++],t[n]);return e}},function(e,t,n){var r=n(21),i=n(32),a=n(166)(!1),o=n(38)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=o&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~a(c,n)||c.push(n));return c}},function(e,t,n){var r=n(32),i=n(167),a=n(168);e.exports=function(e){return function(t,n,o){var s,u=r(t),c=i(u.length),l=a(o,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(37),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(37),i=Math.max,a=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):a(e,t)}},function(e,t,n){var r=n(6).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(21),i=n(74),a=n(38)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){"use strict";var r=n(172)(!0);n(64)(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return t.length>n?(e=r(t,n),this._i+=e.length,{value:e,done:!1}):{value:void 0,done:!0}})},function(e,t,n){var r=n(37),i=n(33);e.exports=function(e){return function(t,n){var a,o,s=i(t)+"",u=r(n),c=s.length;return 0>u||u>=c?e?"":void 0:55296>(a=s.charCodeAt(u))||a>56319||u+1===c||56320>(o=s.charCodeAt(u+1))||o>57343?e?s.charAt(u):a:e?s.slice(u,u+2):o-56320+(a-55296<<10)+65536}}},function(e,t,n){var r=n(19),i=n(174);e.exports=n(7).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){var r=n(175),i=n(8)("iterator"),a=n(18);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||a[r(e)]}},function(e,t,n){var r=n(63),i=n(8)("toStringTag"),a="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?r(t):"Object"==(o=r(t))&&"function"==typeof t.callee?"Arguments":o}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){for(var r=n(178),i=n(82),a=n(13),o=n(2),s=n(3),u=n(42),c=n(1),l=c("iterator"),f=c("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(d),v=0;h.length>v;v++){var m,g=h[v],y=d[g],k=o[g],b=k&&k.prototype;if(b&&(b[l]||s(b,l,p),b[f]||s(b,f,g),u[g]=p,y))for(m in r)b[m]||a(b,m,r[m],!0)}},function(e,t,n){"use strict";var r=n(179),i=n(180),a=n(42),o=n(23);e.exports=n(182)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(1)("unscopables"),i=Array.prototype;null==i[r]&&n(3)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(80);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";var r=n(76),i=n(183),a=n(13),o=n(3),s=n(42),u=n(185),c=n(85),l=n(192),f=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,m,g){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in O)return O[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,P=!1,O=e.prototype,C=O[f]||O["@@iterator"]||v&&O[v],T=C||w(v),S=v?_?w("entries"):T:void 0,M="Array"==t&&O.entries||C;if(M&&(b=l(M.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||o(b,f,d)),_&&C&&"values"!==C.name&&(P=!0,T=function(){return C.call(this)}),r&&!g||!p&&!P&&O[f]||o(O,f,T),s[t]=T,s[x]=d,v)if(y={values:_?T:w("values"),keys:m?T:w("keys"),entries:S},g)for(k in y)k in O||a(O,k,y[k]);else i(i.P+i.F*(p||P),t,y);return y}},function(e,t,n){var r=n(2),i=n(39),a=n(3),o=n(13),s=n(81),u=function(e,t,n){var c,l,f,p,d=e&u.F,h=e&u.G,v=e&u.P,m=e&u.B,g=h?r:e&u.S?r[t]||(r[t]={}):(r[t]||{}).prototype,y=h?i:i[t]||(i[t]={}),k=y.prototype||(y.prototype={});for(c in h&&(n=t),n)f=((l=!d&&g&&void 0!==g[c])?g:n)[c],p=m&&l?s(f,r):v&&"function"==typeof f?s(Function.call,f):f,g&&o(g,c,f,e&u.U),y[c]!=f&&a(y,c,p),v&&k[c]!=f&&(k[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var r=n(186),i=n(41),a=n(85),o={};n(3)(o,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},function(e,t,n){var r=n(12),i=n(187),a=n(45),o=n(44)("IE_PROTO"),s=function(){},u=function(){var e,t=n(78)("iframe"),r=a.length;for(t.style.display="none",n(191).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[a[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[o]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(11),i=n(12),a=n(82);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,u=0;s>u;)r.f(e,n=o[u++],t[n]);return e}},function(e,t,n){var r=n(23),i=n(189),a=n(190);e.exports=function(e){return function(t,n,o){var s,u=r(t),c=i(u.length),l=a(o,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(84),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(84),i=Math.max,a=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):a(e,t)}},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(14),i=n(193),a=n(44)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var r=n(43);e.exports=function(e){return Object(r(e))}},function(e,t,n){n(46)("split",2,function(e,t,r){"use strict";var i=n(86),a=r,o=[].push;if("".split(/.?/).length){var s=void 0===/()??/.exec("")[1];r=function(e,t){var n=this+"";if(void 0===e&&0===t)return[];if(!i(e))return a.call(n,e,t);var r,u,c,l,f,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,m=RegExp(e.source,d+"g");for(s||(r=RegExp("^"+m.source+"$(?!\\s)",d));(u=m.exec(n))&&((c=u.index+u[0].length)<=h||(p.push(n.slice(h,u.index)),!s&&u.length>1&&u[0].replace(r,function(){for(f=1;arguments.length-2>f;f++)void 0===arguments[f]&&(u[f]=void 0)}),u.length>1&&n.length>u.index&&o.apply(p,u.slice(1)),l=u[0].length,h=c,v>p.length));)m.lastIndex===u.index&&m.lastIndex++;return h===n.length?!l&&m.test("")||p.push(""):p.push(n.slice(h)),p.length>v?p.slice(0,v):p}}return[function(n,i){var a=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,a,i):r.call(a+"",n,i)},r]})},function(e,t,n){n(46)("replace",2,function(e,t,n){return[function(r,i){"use strict";var a=e(this),o=null==r?void 0:r[t];return void 0!==o?o.call(r,a,i):n.call(a+"",r,i)},n]})},function(e,t,n){n(197),e.exports=n(7).Object.keys},function(e,t,n){var r=n(74),i=n(69);n(198)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(66),i=n(7),a=n(36);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],o={};o[e]=t(n),r(r.S+r.F*a(function(){n(1)}),"Object",o)}},function(e,t,n){n(46)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):RegExp(n)[t](r+"")},n]})},function(e,t,n){var r=n(2),i=n(201),a=n(11).f,o=n(205).f,s=n(86),u=n(206),c=r.RegExp,l=c,f=c.prototype,p=/a/g,d=/a/g,h=new c(p)!==p;if(n(4)&&(!h||n(22)(function(){return d[n(1)("match")]=!1,c(p)!=p||c(d)==d||"/a/i"!=c(p,"i")}))){c=function(e,t){var n=this instanceof c,r=s(e),a=void 0===t;return!n&&r&&e.constructor===c&&a?e:i(h?new l(r&&!a?e.source:e,t):l((r=e instanceof c)?e.source:e,r&&a?u.call(e):t),n?this:f,c)};for(var v=function(e){e in c||a(c,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})},m=o(l),g=0;m.length>g;)v(m[g++]);f.constructor=c,c.prototype=f,n(13)(r,"RegExp",c)}n(207)("RegExp")},function(e,t,n){var r=n(9),i=n(202).set;e.exports=function(e,t,n){var a,o=t.constructor;return o!==n&&"function"==typeof o&&(a=o.prototype)!==n.prototype&&r(a)&&i&&i(e,a),e}},function(e,t,n){var r=n(9),i=n(12),a=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(81)(Function.call,n(203).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return a(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:a}},function(e,t,n){var r=n(204),i=n(41),a=n(23),o=n(79),s=n(14),u=n(77),c=Object.getOwnPropertyDescriptor;t.f=n(4)?c:function(e,t){if(e=a(e),t=o(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(83),i=n(45).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";var r=n(12);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(2),i=n(11),a=n(4),o=n(1)("species");e.exports=function(e){var t=r[e];a&&t&&!t[o]&&i.f(t,o,{configurable:!0,get:function(){return this}})}},,function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r};i.default.extend({rankMathHighlight:function(e,t,n,r){if(3===e.nodeType){var a=e.data.match(t);if(a){var o=document.createElement(n||"span");o.className=r||"highlight";var s=e.splitText(a.index);s.splitText(a[0].length);var u=s.cloneNode(!0);return o.appendChild(u),s.parentNode.replaceChild(o,s),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==r))for(var c=0;e.childNodes.length>c;c++)c+=i.default.rankMathHighlight(e.childNodes[c],t,n,r);return 0}}),i.default.fn.rankMathUnhighlight=function(e){var t={className:"highlight",element:"span"};return i.default.extend(t,e),this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()},i.default.fn.rankMathHighlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(i.default.extend(n,t),void 0===e||""===e)return this;if(e.constructor===String&&(e=[e]),e=i.default.grep(e,function(e){return""!==e}),0===(e=i.default.map(e,function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")})).length)return this;var r=n.caseSensitive?"":"i",a="("+e.join("|")+")";n.wordsOnly&&(a="\\b"+a+"\\b");var o=RegExp(a,r);return this.each(function(){i.default.rankMathHighlight(this,o,n.element,n.className)})}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r},a=document.createElement("div");i.default.fn.lengthIndicator=function(e){var t=this;e=i.default.extend({},{minLength:0,maxLength:1e3,source:null},e),t.wrap('<span class="length-indicator-wrapper"/>'),t.parent().append('<span class="length-indicator"><span/></span><span class="length-count">0 / '+e.maxLength+"</span>");var n=t.parent().find(".length-indicator"),r=n.find(">span"),o=t.parent().find(".length-count"),s=function(){var i=function(e){return e&&"string"==typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),a.innerHTML=e,e=a.textContent,a.textContent=""),e}(null===e.source?t.val():e.source.text()).length;n.removeClass("invalid short"),r.css("left",Math.min(100,Math.floor(i/e.maxLength*100))+"%"),o.text(i+" / "+e.maxLength),i>e.minLength&&e.maxLength>=i||n.addClass("invalid")};t.on("input",s),null!==e.source&&e.source.on("rank-math-vars-replaced",s),s()}},function(e,t,n){var r=n(212);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(213),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();e.exports=a},function(e,t,n){var r;r=n(143),e.exports="object"==typeof r&&r&&r.Object===Object&&r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(5)),a=o(n(215));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank-math-serp-checklist",t.elemMetabox),this.scoreElem=(0,i.default)('<div class="misc-pub-section rank-math-seo-score"><span class="score-text"><span class="dashicons dashicons-chart-area"></span> SEO: <strong>Not available</strong></span></div>'),this.scoreText=this.scoreElem.find("strong"),this.scoreField=(0,i.default)("#rank_math_seo_score"),this.fkScoreElem=(0,i.default)('<div class="rank-math-seo-score below-focus-keyword"><span class="score-text">Not available</span></div>'),this.fkScoreText=this.fkScoreElem.find("span"),(0,i.default)("#misc-publishing-actions").append(this.scoreElem),(0,i.default)(".cmb-td",".cmb2-id-rank-math-focus-keyword").append(this.fkScoreElem),this.events()}return r(e,[{key:"display",value:function(e){var t=this;i.default.each(e,function(e,n){var r=t.elem.find(".seo-check-"+e);r.removeClass("test-ok test-gallery test-fail test-empty test-looking veryEasy difficult veryDifficult"),r.addClass("test-"+n.status),r.show(),"calculateFleschReading"===e&&r.addClass(n.factors[2]),r.find("span:eq(0)").html(n.message)})}},{key:"setPrimaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,a.default)(e,function(e,t,n){return!1===t&&(t={score:0}),e+t.score},0);status="bad-fk",n>80?status="good-fk":n>50&&(status="ok-fk"),t.removeClass("bad-fk ok-fk good-fk"),this.scoreElem.removeClass("bad-fk ok-fk good-fk"),this.fkScoreElem.removeClass("bad-fk ok-fk good-fk"),t.addClass(status),this.scoreElem.addClass(status),this.fkScoreElem.addClass(status),this.scoreText.html(n+" / 100"),this.fkScoreText.html(n+" / 100"),this.scoreField.val(parseInt(n))}},{key:"setSecondaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,a.default)(e,function(e,t){return e+("ok"===t.status?1:0)},0);t.addClass(3===n?"good-fk":2===n?"ok-fk":"bad-fk")}},{key:"hidePrimary",value:function(){this.elem.find("li.is-primary").hide()}},{key:"events",value:function(){var e=this;this.elem.on("click",".group-handle",function(t){t.preventDefault();var n=(0,i.default)(t.target).closest(".rank-math-serp-group"),r={};n.toggleClass("state-open state-closed"),e.updateGroupStatus(n),e.elem.find(">.rank-math-serp-group").each(function(){var e=(0,i.default)(this);r[e.data("id")]=e.hasClass("state-closed")?"closed":"open"}),i.default.ajax({url:rankMath.ajaxurl,type:"POST",data:{action:"rank_math_save_checklist_layout",security:rankMath.security,layout:r}})})}},{key:"updateGroupStatus",value:function(e){(e=e||(0,i.default)(".rank-math-serp-group")).each(function(){var e=(0,i.default)(this);1>e.find("li.test-fail").length&&1>e.find("li.test-empty").length?e.find(".group-status").addClass("passed"):e.find(".group-status").removeClass("passed")})}}]),e}();t.default=s},function(e,t,n){var r=n(216),i=n(28),a=n(47),o=n(217),s=n(0);e.exports=function(e,t,n){var u=s(e)?r:o,c=3>arguments.length;return u(e,a(t,4),n,c,i)}},function(e,t){e.exports=function(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}},function(e,t){e.exports=function(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=(r=n(5))&&r.__esModule?r:{default:r},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metabox=t,this.currentNetwork="facebook",this.useFacebook=!0,this.shouldUpdatePreview=!1,this.facebookTitleField=t.elemMetabox.find("#rank_math_facebook_title"),this.facebookDescriptionField=t.elemMetabox.find("#rank_math_facebook_description"),this.twitterTitleField=t.elemMetabox.find("#rank_math_twitter_title"),this.twitterDescriptionField=t.elemMetabox.find("#rank_math_twitter_description"),this.facebookImageField=t.elemMetabox.find("#rank_math_facebook_image"),this.twitterImageField=t.elemMetabox.find("#rank_math_twitter_image"),this.facebookImageStatus=t.elemMetabox.find("#rank_math_facebook_image-status"),this.twitterImageStatus=t.elemMetabox.find("#rank_math_twitter_image-status"),this.socialWrapper=t.elemMetabox.find(".rank-math-social-preview"),this.socialPreview=this.socialWrapper.find(".rank-math-social-preview-item"),this.socialTitle=this.socialWrapper.find(".rank-math-social-preview-title"),this.socialDescription=this.socialWrapper.find(".rank-math-social-preview-description"),this.events(),this.shouldUpdatePreview=!0,this.updatePreview()}return i(e,[{key:"events",value:function(){var e=this;this.facebookTitleField.on("input",function(){e.updateTitlePreview()}),this.facebookDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.facebookImageField.on("input",function(){e.updateThumbnailPreview()}),this.twitterTitleField.on("input",function(){e.updateTitlePreview()}),this.twitterDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.twitterImageField.on("input",function(){e.updateThumbnailPreview()});var t=(0,a.default)(".rank-math-social-preview-button"),n=t.find(">span");t.on("click",function(t){t.preventDefault(),n.toggleClass("dashicons-arrow-down dashicons-arrow-up"),e.updatePreview(),e.socialWrapper.toggleClass("open"),e.socialPreview.slideToggle()});var r=(0,a.default)("#rank_math_twitter_card_type");(0,a.default)(".preview-network").on("click",function(n){(0,a.default)(n.target).hasClass("tab-facebook")?t.show():r.trigger("change"),e.updatePreview()}),r.on("change",function(){var n=r.val();"player"===n&&(0,a.default)(".cmb2-id-rank-math-twitter-image, .cmb2-id-rank-math-twitter-title, .cmb2-id-rank-math-twitter-description").show();var i="player"===n||"app"===n;t.toggle(!i),(0,a.default)(".cmb2-id-rank-math-twitter-use-facebook").toggle(!i),e.updatePreview()}).trigger("change");var i=(0,a.default)("#rank_math_twitter_use_facebook2");(0,a.default)("#rank_math_twitter_use_facebook1, #rank_math_twitter_use_facebook2").on("input change",function(){e.useFacebook=i.is(":checked"),e.updatePreview()}).trigger("change"),(0,a.default)(".cmb2-id-rank-math-facebook-enable-image-overlay, .cmb2-id-rank-math-facebook-image-overlay, .cmb2-id-rank-math-twitter-enable-image-overlay, .cmb2-id-rank-math-twitter-image-overlay").on("change","input",function(){e.updateThumbnailOverlay()}),(0,a.default)(document).on("cmb_media_modal_select",function(t,n,r){"rank_math_facebook_image"!==r.field&&"rank_math_twitter_image"!==r.field||e.updateThumbnailPreview()}),(0,a.default)(document).on("cmb_init",function(t,n){n.$metabox.on("click",".cmb2-remove-file-button",function(){e.updateThumbnailPreview()})})}},{key:"updatePreview",value:function(){!1!==this.shouldUpdatePreview&&(this.currentNetwork=(0,a.default)(".preview-network.tab-active").attr("href").replace("#setting-panel-social-",""),this.socialWrapper.removeClass(),this.socialWrapper.addClass("rank-math-social-preview rank-math-social-preview-"+this.currentNetwork),"twitter"===this.currentNetwork&&this.socialWrapper.addClass((0,a.default)("#rank_math_twitter_card_type").val()),this.updateTitlePreview(),this.updateDescriptionPreview(),this.updateThumbnailPreview())}},{key:"updateTitlePreview",value:function(){var e=this[this.currentNetwork+"TitleField"].val()||this.metabox.title;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookTitleField.val()||this.metabox.title),e=this.metabox.truncate(this.metabox.swapVars(e),90),this.socialTitle.html(e)}},{key:"updateDescriptionPreview",value:function(){var e=this[this.currentNetwork+"DescriptionField"].val()||this.description;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookDescriptionField.val()||this.metabox.description),e=this.metabox.truncate(this.metabox.swapVars(e),240),this.socialDescription.html(e)}},{key:"updateThumbnailPreview",value:function(){var e=(0,a.default)("#rank_math_post_thumbnail").attr("src"),t=this.metabox.getContent(),n=!!/<img(?:[^>]+)?>/.test(t)&&(0,a.default)(t).find("img:first").attr("src"),r=this.facebookImageField.val()||e||n||rankMath.defautOgImage,i=this.twitterImageField.val()||e||n||rankMath.defautOgImage;if("twitter"===this.currentNetwork&&this.useFacebook)i=r;else if(this.twitterImageStatus.find("img.cmb-file-field-image").length){var o=this.twitterImageStatus.siblings(".notice"),s=this.twitterImageStatus.find("img.cmb-file-field-image")[0];o.addClass("hidden"),(0,a.default)(s).on("load",function(){(200>s.naturalWidth||200>s.naturalHeight)&&o.removeClass("hidden")})}var u=this.facebookImageStatus.siblings(".notice"),c=this.facebookImageStatus.find("img.cmb-file-field-image");u.addClass("hidden"),"facebook"===this.currentNetwork&&this.facebookImageField.val()&&c.length&&(0,a.default)(c[0]).on("load",function(){(200>c[0].naturalWidth||200>c[0].naturalHeight)&&u.removeClass("hidden")});var l=(0,a.default)(".rank-math-social-preview-image");(0,a.default)(".facebook-thumbnail",l).attr("src",r),(0,a.default)(".twitter-thumbnail",l).attr("src",i),l.toggleClass("no-facebook-image",!r),l.toggleClass("no-twitter-image",!i),l.parents(".rank-math-social-preview-facebook").find(".error-msg").toggleClass("show",!r),l.parents(".rank-math-social-preview-twitter").find(".error-msg").toggleClass("show",!i),this.updateThumbnailOverlay()}},{key:"updateThumbnailOverlay",value:function(){var e=(0,a.default)(".rank-math-social-preview-image-overlay"),t=(0,a.default)('[name="rank_math_'+this.currentNetwork+'_enable_image_overlay"]:checked').val(),n=(0,a.default)('[name="rank_math_'+this.currentNetwork+'_image_overlay"]:checked').val(),r=!(0,a.default)(".rank-math-social-preview-image").hasClass("no-"+this.currentNetwork+"-image");"twitter"===this.currentNetwork&&this.useFacebook&&(n=(0,a.default)('[name="rank_math_facebook_image_overlay"]:checked').val(),r=!1);var i=(0,a.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-enable-image-overlay"),o="on"===i.find("input:checked").val();i.toggle(r),i.find(".notice-warning").toggle(o),"on"===t?(e.attr("src",rankMath.overlayImages[n].url).show(),(0,a.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-image-overlay").toggle(r)):e.hide()}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(5)),a=o(n(62));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank_math_focus_keyword");var r=(0,a.default)(function(){t.updateFocusKeywords()},200),o=(0,a.default)(function(e,n){var r=e.find("li:last").prev(),i=t.assessor.assessFocusKeyword({elem:r,isPrimary:!1,keyword:n});t.checkList.setSecondaryKeywordStatus(i,r)},200);this.elem.on("content-loaded",function(){var e=n.elem.next("ul"),r=n.getFocusKeywords();(0,i.default)(e).find("li:gt(1)").each(function(){var e=(0,i.default)(this),n=t.assessor.assessFocusKeyword({elem:e,isPrimary:!1,keyword:r[e.index()-1]});t.checkList.setSecondaryKeywordStatus(n,e)})}),this.elem.tagEditor({autocomplete:1===rankMath.maxTags?null:this.getAutocompleteOptions(),sortable:!0,placeholder:this.elem.attr("placeholder"),onChange:function(e,t,n){1===n.length?t.find("li:not(.placeholder)").last().addClass("selected-fk"):t.find(".selected-fk").removeClass("selected-fk"),r()},onSelect:function(e,t){var n=e.parent();return!(!n.hasClass("selected-fk")&&""!==e.html()&&(t.find(".tag-editor-tag.active").length&&t.find("input").blur(),n.addClass("selected-fk").siblings().removeClass("selected-fk"),r(),1))},beforeTagDelete:function(e,t,n){return 1===n.length||(e.hasClass("selected-fk")&&t.find(">li").eq(1).addClass("selected-fk"),!0)},beforeTagSave:function(e,t,n,r,i){if(0!==n.length&&i)return o(t,i),i}}),this.elem.next().find(">li:not(.placeholder)").eq(1).addClass("selected-fk");var s=this.elem.parent();s.append(s.find(".cmb2-metabox-description"))}return r(e,[{key:"getAutocompleteOptions",value:function(){return{minLength:2,source:function(e,t){i.default.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:e.term,nolabels:"t",client:"hp",ds:"",lr:"lang_"+rankMath.locale,hl:rankMath.locale},success:function(e){t(i.default.map(e[1],function(e){return{value:(0,i.default)("<span>").html(e[0]).text()}}))}})}}}},{key:"getFocusKeywords",value:function(){var e=this.elem.tagEditor("getTags")[0];return e?e.tags:[]}},{key:"getFocusKeyword",value:function(){var e=this.elem.tagEditor("getTags")[0];if(!e)return{isPrimary:!0,keyword:""};var t=e.editor.find(".selected-fk").first();return t.length?{elem:t,isPrimary:1===t.index(),keyword:t.find(".tag-editor-tag").text()}:e.tags.length?{isPrimary:!0,keyword:e.tags[0]}:{isPrimary:!0,keyword:""}}},{key:"clearFocusKeywords",value:function(){this.elem.tagEditor("clearTags")}},{key:"addFocusKeyword",value:function(e){this.elem.tagEditor("addTag",e)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=(r=n(5))&&r.__esModule?r:{default:r},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.focusKeywords=t,this.modal=(0,a.default)("#rank-math-compare-keywords-wrapper"),this.holder=this.modal.find(".rank-math-keywords-fields"),this.iframe=this.modal.find("iframe.attachments-browser"),this.btnCompare=this.modal.find(".compare-keywords"),this.events()}return i(e,[{key:"events",value:function(){var e=this;(0,a.default)("#rank-math-compare-keywords-trigger").on("click",function(t){t.preventDefault();var n=e.focusKeywords.getFocusKeywords();e.holder.html(""),n.length?a.default.each(n,function(t,n){e.addNewField(n)}):e.addNewField(),e.modal.toggle(),e.btnCompare.trigger("click")}),this.modal.on("click",".media-modal-close",function(){e.modal.toggle()}),this.modal.on("click",".add-new-keywords",function(){e.addNewField()}),this.modal.on("click",".remove-keyword",function(e){(0,a.default)(e.currentTarget).parent().remove(),btnCompare.trigger("click")}),this.modal.on("click",".use-these-keywords",function(){e.focusKeywords.clearFocusKeywords(),e.holder.find("input").each(function(t,n){var r=(0,a.default)(n).val().trim();""!==r&&e.focusKeywords.addFocusKeyword(r)}),e.modal.toggle()}),this.btnCompare.on("click",function(){var t=[];if(e.holder.find("input").each(function(){var e=(0,a.default)(this).val().trim();""!==e&&t.push({keyword:e,geo:"",time:"today 12-m"})}),0===t.length)return!1;t={comparisonItem:t,category:0,property:""},e.iframe.attr("src",e.iframe.data("srcbase")+"&req="+encodeURIComponent(JSON.stringify(t)))}),this.holder.on("keydown","input",function(t){if(13===t.keyCode)return t.preventDefault(),e.btnCompare.trigger("click"),!1})}},{key:"addNewField",value:function(e){var t=(0,a.default)("<div/>"),n=(0,a.default)("<input/>",{type:"text",class:"widefat",value:e||""});t.append(n),t.append('<button class="button-small button-link button-link-delete remove-keyword"><span class="dashicons dashicons-trash"></span></button>'),this.holder.append(t),n.autocomplete(this.focusKeywords.getAutocompleteOptions()).focus()}}]),e}();t.default=o},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r="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},i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=l(n(5)),o=l(n(252)),s=l(n(62)),u=l(n(253)),c=l(n(254));function l(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.elemMetabox=(0,a.default)("#rank_math_metabox"),e.elemSlug=(0,a.default)("#post_name"),e.elemTitle=(0,a.default)("#title"),e.elemDescription=(0,a.default)("#excerpt"),e.elemContent=(0,a.default)("#content"),e.elemPrice=(0,a.default)("#_sale_price"),e.elemRegPrice=(0,a.default)("#_regular_price"),e.researches=!1,e.isGutenbergAvailable=(0,c.default)(),e.testRequired={title:!0,description:!0,url:!0,content:!0},e.testOptional={title:!0,headings:!0,imagealt:!0,titleBeginning:!0,contentBeginning:!0,keywordDensity:!0,newKeyword:!0},e.init(),e.updateOthers(),e.postSerpEvents(),e.primaryTerm(),e.featuredImage(),e.linkSuggestions(),e.richSnippetIcon(),void 0!==window.ET_PageBuilder&&Backbone.Events.listenTo(window.ET_PageBuilder.Events,"et-pb-content-updated",function(){e.updateDescriptionPreview()}),e.isGutenbergAvailable&&new u.default(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),i(t,[{key:"updateSlug",value:function(e){this.serpPermalinkField.val(e),this.elemSlug.val(e),(0,a.default)("#editable-post-name").text(e),(0,a.default)("#editable-post-name-full").text(e),this.isGutenbergAvailable&&e!==wp.data.select("core/editor").getEditedPostAttribute("slug")&&wp.data.dispatch("core/editor").editPost({slug:e})}},{key:"updateOthers",value:function(){var e=this;this.isGutenbergAvailable||(""===this.elemSlug.val()&&(0,a.default)("#editable-post-name-full").length&&this.elemSlug.val((0,a.default)("#editable-post-name-full").text()).trigger("input"),this.analyzeOnPage&&(0,a.default)(document).on("tinymce-editor-init",function(t,n){e.updatePreview()}))}},{key:"postSerpEvents",value:function(){var e=this;this.analyzeOnPage&&(this.elemContent.on("input change",(0,s.default)(function(){e.updateDescriptionPreview(),e.socialFields.updateThumbnailPreview()},500)),(0,a.default)(window).on("load",function(){!e.isGutenbergAvailable&&"undefined"!=typeof tinymce&&tinymce.activeEditor&&tinyMCE.editors.content.on("keyup change",(0,s.default)(function(t){e.updateDescriptionPreview(),e.socialFields.updateThumbnailPreview()},500))})),(0,a.default)(document).on("ajaxComplete",function(t,n,r){if("/admin-ajax.php"===r.url.substr(-15)){var i="";"string"==typeof r.data&&-1!==r.data.indexOf("action=sample-permalink")&&(i=""===n.responseText?e.elemTitle.val():(0,a.default)("<div>"+n.responseText+"</div>").find("#editable-post-name-full").text(),e.serpPermalinkField.val(i).trigger("input"))}}),this.elemPrice.on("input",(0,s.default)(function(){e.setVariable("wc_price",e.getWooCommerceProductPrice()),e.updateDescriptionPreview()},500)),this.elemRegPrice.on("input",(0,s.default)(function(){e.setVariable("wc_price",e.getWooCommerceProductPrice()),e.updateDescriptionPreview()},500))}},{key:"getWooCommerceProductPrice",value:function(){var e=this.elemPrice.val()?this.elemPrice.val():this.elemRegPrice.val();return accounting.formatMoney(e,{symbol:woocommerce_admin_meta_boxes.currency_format_symbol,decimal:woocommerce_admin_meta_boxes.currency_format_decimal_sep,thousand:woocommerce_admin_meta_boxes.currency_format_thousand_sep,precision:woocommerce_admin_meta_boxes.currency_format_num_decimals,format:woocommerce_admin_meta_boxes.currency_format})}},{key:"primaryTerm",value:function(){(0,a.default)("[data-primary-term]").each(function(){var e=(0,a.default)(this),t=e.val(),n=e.data("primary-term"),r=(0,a.default)("#"+n+"div"),i=(0,a.default)("#"+n+"checklist"),o=i.find("li"),s=i.find('input[type="checkbox"]:checked');o.addClass("rank-math-primary-term-li"),o.find("input").each(function(){var e=(0,a.default)(this);e.parent().append('<span class="rank-math-tooltip"><input class="rank-math-make-primary" value="'+e.val()+'" type="radio" name="rank_math_primary_'+n+'"><span>Make Term Primary</span></span>')}),s.each(function(){var e=(0,a.default)(this).closest("li");e.addClass("term-checked"),n+"-"+t===e.attr("id")&&(e.addClass("term-marked-primary"),e.find(">label .rank-math-make-primary").prop("checked",!0))}),r.on("click",'input[type="checkbox"]',function(){var t=(0,a.default)(this).closest("li");if(t.toggleClass("term-checked"),1===i.find("li.term-checked").length||t.hasClass("term-marked-primary")&&!t.hasClass("term-checked")){var n=i.find("li.term-checked:first > label .rank-math-make-primary");n.length>0?n.trigger("click"):(o.removeClass("term-marked-primary"),o.find('input[type="radio"]').prop("checked",!1),e.val(""))}}),r.on("click",".rank-math-make-primary",function(){var t=(0,a.default)(this),n=t.closest("li");o.removeClass("term-marked-primary"),n.addClass("term-marked-primary"),e.val(t.val())}),i.on("wpListAddEnd",function(){i.find("li:not(.rank-math-primary-term-li)").addClass("rank-math-primary-term-li term-checked").find("input").each(function(){var e=(0,a.default)(this);e.parent().append('<span class="rank-math-tooltip"><input class="rank-math-make-primary" value="'+e.val()+'" type="radio" name="rank_math_primary_'+n+'"><span>Make Term Primary</span></span>')})})})}},{key:"featuredImage",value:function(){var e=this;if(this.analyzeOnPage){var t=(0,a.default)("#postimagediv"),n=t.find(".hndle"),r=wp.media.featuredImage.frame();if(r.on("select",function(){var t=r.state().get("selection").first().toJSON(),i=(0,a.default)("#rank_math_post_thumbnail");200>t.width||200>t.height?0===(0,a.default)("#rank_math_image_warning").length&&(0,a.default)('<div id="rank_math_image_warning" class="notice notice-error notice-alt"><p>'+rankMath.featuredImageNotice+"</p></div>").insertAfter(n):(0,a.default)("#rank_math_image_warning").remove(),1>i.length&&(i=(0,a.default)('<img id="rank_math_post_thumbnail" />'),(0,a.default)(".facebook-thumbnail",".rank-math-social-preview-image").before(i)),i.attr("src","large"in t.sizes?t.sizes.large.url:t.sizes.full.url),e.setFeaturedImage(t.alt)}),(0,a.default)("#postimagediv").on("click","#remove-post-thumbnail",function(){(0,a.default)("#rank_math_image_warning").remove(),(0,a.default)("#rank_math_post_thumbnail").remove(),e.setFeaturedImage("")}),this.assessor.paper.setThumbnailAlt(t.find("img").attr("alt")),this.socialFields.updateThumbnailPreview(),this.isGutenbergAvailable){var i=void 0,o=void 0;wp.data.subscribe(function(){var t=wp.data.select("core/editor").getEditedPostAttribute("featured_media");e.isValidMediaId(t)&&void 0!==(i=wp.data.select("core").getMedia(t))&&i!==o&&(o=i,e.setFeaturedImage(i.alt_text))})}}}},{key:"isValidMediaId",value:function(e){return"number"==typeof e&&e>0}},{key:"setFeaturedImage",value:function(e){this.socialFields.updateThumbnailPreview(),this.assessor.paper.setThumbnailAlt(e),this.seoContentAssessments()}},{key:"linkSuggestions",value:function(){rankMath.postSettings.linkSuggestions&&(a.default.fn.extend({insertLink:function(e,t){var n=this[0],r="";if(n.selectionStart||"0"===n.selectionStart){var i=n.selectionStart,a=n.selectionEnd,o=n.scrollTop;r='<a href="'+e+'">'+n.value.substring(i,a)+"</a>",i===a&&(r='<a href="'+e+'">'+t+"</a>"),n.value=n.value.substring(0,i)+r+n.value.substring(a,n.value.length),n.focus(),n.selectionStart=i+r.length,n.selectionEnd=i+r.length,n.scrollTop=o}else n.value+=r='<a href="'+e+'">'+t+"</a>",n.focus()}}),"function"==typeof ClipboardJS&&new ClipboardJS(".suggestion-copy").on("success",function(e){var t=(0,a.default)(e.trigger).parent().next(".suggestion-title"),n=t.html();t.text("Link Copied"),setTimeout(function(){t.html(n)},1500)}),(0,a.default)(window).on("load",function(){if("object"!==("undefined"==typeof tinymce?"undefined":r(tinymce)))return!0;var e=null,t=null;(0,a.default)(".suggestion-insert").on("click",function(n){n.preventDefault();var r,i,o,s,u=(0,a.default)(this);if(u.hasClass("clicked"))return!0;if(null!==tinymce.activeEditor&&!0!==tinymce.activeEditor.isHidden()){e=tinymce.activeEditor,t=(0,a.default)(e.getBody());var c=e.selection.getContent()||"";if(t.find("a[data-mce-selected]").length){var l=(o=e.selection.getStart(),(s=e.dom.getParent(o,"a[href]"))||(i=e.selection.getContent({format:"raw"}))&&-1!==i.indexOf("</a>")&&((r=i.match(/href="([^">]+)"/))&&r[1]&&(s=e.$('a[href="'+r[1]+'"]',o)[0]),s&&e.selection.select(s)),s);e.dom.setAttribs(l,{href:u.data("url")}),(0,a.default)(l).text()!==c&&e.insertContent(c)}else e.insertContent(c.length?'<a href="'+u.data("url")+'">'+c+"</a>":'<a href="'+u.data("url")+'">'+u.data("text")+"</a>")}else{var f=(0,a.default)("textarea.wp-editor-area:visible");f.length&&f.first().insertLink(u.data("url"),u.data("text"))}var p=u.closest(".suggestion-item").find(".suggestion-title"),d=p.html();p.text("Link Inserted"),u.addClass("clicked"),setTimeout(function(){var e,t,n,r;p.html(d),u.removeClass("clicked"),!0===rankMath.postSettings.useFocusKeyword&&(t=u,n=(e=p).data("fkcount")||0,(n+=1)===(r=e.data("fk")).length&&(n=0),e.find(">a").text(r[n]),e.data("fkcount",n),t.data("text",r[n]))},1500)})}),(0,a.default)("#rank_math_metabox_link_suggestions").find("h2").append((0,a.default)("#rank-math-link-suggestions-tooltip").html()))}},{key:"richSnippetIcon",value:function(){var e={off:"dashicons-image-filter",article:"dashicons-admin-post",book:"dashicons-book-alt",course:"dashicons-welcome-learn-more",event:"dashicons-calendar",jobposting:"dashicons-megaphone",local:"dashicons-store",music:"dashicons-format-audio",product:"dashicons-cart",recipe:"dashicons-carrot",restaurant:"dashicons-palmtree",video:"dashicons-format-video",person:"dashicons-admin-users",review:"dashicons-star-filled",service:"dashicons-admin-generic",software:"dashicons-index-card"},t=(0,a.default)('.rank-math-tabs-navigation a[href="#setting-panel-richsnippet"] .dashicons'),n=(0,a.default)("#_bsf_post_type");if((0,a.default)('#rank_math_rich_snippet, input[type="radio"][name="rank_math_rich_snippet"]').on("change",function(){var r="rank_math_rich_snippet"===(0,a.default)(this).attr("id")?(0,a.default)(this).val():(0,a.default)('input[type="radio"][name="rank_math_rich_snippet"]:checked').val();t.removeClass().addClass("dashicons "+e[r]),n.length&&"off"!==r&&n.val("0").trigger("change")}).trigger("change"),n.length){var r=(0,a.default)("#rank_math_rich_snippet"),i=(0,a.default)('input[name="rank_math_rich_snippet"][value="off"]');n.on("change",function(){"0"!==n.val()&&(r.val("off").trigger("change"),i.prop("checked",!0).trigger("change"))}).trigger("change")}}}]),t}();(0,a.default)(function(){new f})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=m(n(5));n(209),n(210);var a=m(n(93)),o=m(n(92)),s=m(n(136)),u=m(n(31)),c=m(n(62)),l=m(n(214)),f=m(n(218)),p=m(n(219)),d=m(n(220)),h=m(n(50)),v=m(n(145));function m(e){return e&&e.__esModule?e:{default:e}}var g=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"init",value:function(){this.title="",this.permalink="",this.description="",this.variableMap=null,this.analyzeOnPage=null!==document.getElementById("rank-math-serp-checklist"),this.shouldAssess=!1,this.primaryResult={},this.serpCanonical=this.elemMetabox.find("#rank_math_canonical_url"),this.serpTitleField=this.elemMetabox.find("#rank_math_title"),this.serpPermalinkField=this.elemMetabox.find("#rank_math_permalink"),this.serpDescriptionField=this.elemMetabox.find("#rank_math_description"),this.serpWrapper=this.elemMetabox.find(".serp-preview"),this.serpBg=this.elemMetabox.find(".serp-preview-bg input"),this.serpTitle=this.serpWrapper.find(".serp-title"),this.serpPermalink=this.serpWrapper.find(".serp-url"),this.serpDescription=this.serpWrapper.find(".serp-description"),this.desktopSnippet=this.serpWrapper.find(".serp-snippet-data"),this.assessor=new Assessor({elemContent:this.elemContent,researches:this.researches}),this.analyzeOnPage&&(this.checkList=new l.default(this)),this.socialFields=new f.default(this),this.compareKeywords=new d.default(this.focusKeywords),this.focusKeywords=new p.default(this),this.wrapInGroup(),this.serpEvents(),this.updateEvents(),this.updatePreview(),this.initLengthIndicator(),rankMathAdmin.variableInserter(!1)}},{key:"wrapInGroup",value:function(){this.serpTitle.wrap('<div class="group"></div>'),this.serpPermalink.wrap('<div class="group"></div>'),this.serpDescription.wrap('<div class="group"></div>'),(0,i.default)(".cmb2-id-rank-math-title").insertAfter(this.serpTitle),(0,i.default)(".cmb2-id-rank-math-permalink").insertAfter(this.serpPermalink),(0,i.default)(".cmb2-id-rank-math-description").insertAfter(this.serpDescription),(0,i.default)(".group",this.serpWrapper).prepend('<span class="dashicons dashicons-no-alt serp-close"></span>')}},{key:"initLengthIndicator",value:function(){this.serpTitleField.lengthIndicator({minLength:15,maxLength:60,source:this.serpTitle}),this.serpPermalinkField.lengthIndicator({minLength:5,maxLength:75,source:this.serpPermalink}),this.serpDescriptionField.lengthIndicator({minLength:80,maxLength:160,source:this.serpDescription})}},{key:"serpEvents",value:function(){var e=this,t=this.elemMetabox.find(".rank-math-select-device");t.on("click",function(n){n.preventDefault();var r,a=(0,i.default)(n.currentTarget),o=a.hasClass("active");r=function(t){switch(t){case"desktop-preview":e.serpWrapper.removeClass("mobile-preview"),e.serpWrapper.addClass("desktop-preview expanded-preview");break;case"mobile-preview":e.serpWrapper.removeClass("desktop-preview"),e.serpWrapper.addClass("mobile-preview expanded-preview");break;default:e.serpWrapper.removeClass("mobile-preview expanded-preview"),e.serpWrapper.addClass("desktop-preview")}},t.removeClass("active"),o?r("normal"):a.hasClass("device-desktop")?(r("desktop-preview"),a.addClass("active")):a.hasClass("device-mobile")&&(r("mobile-preview"),a.addClass("active"))});var n=!0,r=this.elemMetabox.find(".rank-math-edit-snippet");this.elemMetabox.on("click",".rank-math-edit-snippet",function(t){t.preventDefault(),r.toggleClass("hidden active"),e.desktopSnippet.toggle();var i={type:"click",isHidden:n=!n};e.serpTitle.trigger(i),e.serpPermalink.trigger(i),e.serpDescription.trigger(i)}),this.elemMetabox.on("click",".serp-title, .serp-url, .serp-description, .serp-close",function(t){t.preventDefault();var a=(0,i.default)(t.target).parent();"isHidden"in t?a.toggleClass("active",!t.isHidden):(a.toggleClass("active"),0===e.serpWrapper.find(".group.active").length&&r.hasClass("active")&&(n=!n,r.toggleClass("hidden active")),3!==e.serpWrapper.find(".group.active").length||r.hasClass("active")||(n=!1,r.toggleClass("hidden active")))});var a=(0,i.default)("#rank_math_robots1"),o=(0,i.default)("#rank_math_robots2");a.on("change",function(){a.is(":checked")?(e.serpWrapper.addClass("noindex-preview"),o.prop("checked",!1).trigger("change")):e.serpWrapper.removeClass("noindex-preview")}),o.on("change",function(){o.is(":checked")?(e.serpWrapper.addClass("noindex-preview"),a.prop("checked",!1)):e.serpWrapper.removeClass("noindex-preview")}).trigger("change"),(0,i.default)("textarea[data-autoresize]").each(function(){var e=(0,i.default)(this);e.on("keyup input",function(){e.css("height","auto").css("height",e.prop("scrollHeight"))})})}},{key:"updateEvents",value:function(){var e=this;this.serpTitleField.on("input",(0,c.default)(function(){e.updateTitlePreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemTitle.on("input",(0,c.default)(function(){e.setVariable("title",e.elemTitle.val()),e.setVariable("term",e.elemTitle.val()),e.setVariable("author",e.elemTitle.val()),e.setVariable("name",e.elemTitle.val()),e.updateTitlePreview()},500)),this.serpPermalinkField.val(this.serpPermalinkField.val()||this.elemSlug.val()).on("input",(0,c.default)(function(){var t=decodeURIComponent(e.serpPermalinkField.val());e.updateSlug(t),e.updatePermalinkPreview()},500)).on("blur",function(){var t=(0,s.default)(e.serpPermalinkField.val());e.updateSlug(t)}).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemSlug.on("input",(0,c.default)(function(){e.serpPermalinkField.val(e.elemSlug.val()).trigger("input")},500)),this.serpDescriptionField.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemDescription.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500))}},{key:"updateSlug",value:function(e){this.serpPermalinkField.val(e),this.elemSlug.val(e)}},{key:"seoAssessments",value:function(e){if(!1!==this.shouldAssess){var t=null;"title"===e?t=this.assessor.assessTitle(this.title):"permalink"===e?t=this.assessor.assessPermalink(this.permalink):"description"===e?(this.assessor.paper.setDescription(this.description),t=this.assessor.assessFocusKeyword(this.focusKeywords.getFocusKeyword())):"content"===e&&(t=this.assessor.assessContent(this.description)),this.setKeywordStatus(t)}}},{key:"seoTitleAssessments",value:function(){this.seoAssessments("title")}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessments("permalink")}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessments("description")}},{key:"seoContentAssessments",value:function(){this.seoAssessments("content")}},{key:"seoAssessAll",value:function(){if(!1!==this.shouldAssess){this.assessor.paper.setTitle(this.title),this.assessor.paper.setPermalink(this.permalink),this.assessor.paper.setKeyword(this.focusKeywords.getFocusKeyword().keyword),this.assessor.paper.setDescription(this.description);var e=this.assessor.runAll();this.setKeywordStatus(e)}}},{key:"setKeywordStatus",value:function(e){if(!1!==this.analyzeOnPage){var t=this.focusKeywords.getFocusKeyword();if(t.isPrimary||void 0===t.elem)this.checkList.elem.show(),this.checkList.display(e);else{var n={keywordDensity:e.keywordDensity,keywordInContent:e.keywordInContent,keywordInSubheadings:e.keywordInSubheadings};"post"!==rankMath.objectType&&this.checkList.elem.hide(),this.checkList.hidePrimary(),this.checkList.display(n),this.checkList.setSecondaryKeywordStatus(n,t.elem),delete e.keywordDensity,delete e.keywordInContent,delete e.keywordInSubheadings,delete this.primaryResult.keywordInTitle,delete this.primaryResult.keywordInMetaDescription,delete this.primaryResult.keywordInPermalink,delete this.primaryResult.keywordIn10Content,delete this.primaryResult.keywordInImageAlt,delete this.primaryResult.keywordNotUsed,delete this.primaryResult.titleStartWithKeyword}this.primaryResult=i.default.extend({},this.primaryResult,e),this.checkList.setPrimaryKeywordStatus(this.primaryResult,this.focusKeywords.elem.next().find(">li:not(.placeholder)").eq(1))}}},{key:"updatePreview",value:function(){this.updateTitlePreview(),this.updatePermalinkPreview(),this.updateDescriptionPreview(),this.shouldAssess=this.analyzeOnPage,this.seoAssessAll(),this.focusKeywords.elem.trigger("content-loaded"),this.updateFocusKeywords()}},{key:"updateFocusKeywords",value:function(){var e=this.focusKeywords.getFocusKeyword().keyword;if(""!==e&&(this.setVariable("focuskw",e),this.serpBg.val(e)),this.focusKeywords.getFocusKeyword().isPrimary){this.shouldAssess=!1,this.updateDescriptionPreview(),this.shouldAssess=!0,this.seoFocusKeywordAssessments(),this.highlightKeywords(),this.updatePreviewCallbacks("description",this.description),this.updatePreviewCallbacks("focus-keyword",e);var t=(0,i.default)(".focus-keyword-link");t.length&&""!==e&&t.attr("href",t.attr("href").replace("%focus_keyword%",e).replace("%post_type%",rankMath.objectType).replace("%taxonomy%",rankMath.objectType))}else this.seoFocusKeywordAssessments()}},{key:"updateTitlePreview",value:function(){this.title=this.serpTitleField.val();var e=""!==this.title;this.title=this.swapVars(""!==this.title?this.title:this.serpTitle.data("format")),this.serpTitle.html(this.title),this.serpTitleField.attr("placeholder",e?this.title:this.serpTitle.data("format")),this.socialFields.facebookTitleField.attr("placeholder",this.title),this.socialFields.twitterTitleField.attr("placeholder",this.title),this.seoTitleAssessments(),this.highlightKeywords(this.serpTitle),this.updatePreviewCallbacks("title",this.title),this.serpTitle.trigger("rank-math-vars-replaced")}},{key:"updatePermalinkPreview",value:function(){var e=this.serpPermalink.data("format")||"",t=(0,s.default)(this.serpPermalinkField.val());this.permalink=""!==t?e.replace(/%(postname|pagename)%/,t).trimRight("/")+"/":"",this.serpCanonical.attr("placeholder",this.permalink),this.serpPermalink.html(this.permalink),this.seoPermalinkAssessments(),this.highlightKeywords(this.serpPermalink),this.updatePreviewCallbacks("permalink",this.permalink),this.serpPermalink.trigger("rank-math-vars-replaced")}},{key:"updateDescriptionPreview",value:function(){this.description=this.swapVars(this.getDescription()),this.serpDescription.html(this.description),this.serpDescriptionField.attr("placeholder",""!==this.description?this.description:this.serpDescription.data("format"));var e=this.getDescriptionTruncated(this.description,300);this.socialFields.facebookDescriptionField.attr("placeholder",e),this.socialFields.twitterDescriptionField.attr("placeholder",e),this.seoContentAssessments(),this.highlightKeywords(this.serpDescription),this.updatePreviewCallbacks("description",this.description),this.serpDescription.trigger("rank-math-vars-replaced")}},{key:"updatePreviewCallbacks",value:function(e,t){this.elemMetabox.trigger("rank-math-updating-preview-"+(e=e||"global")),this.elemMetabox.trigger("rank-math-"+e+"-updated",t)}},{key:"highlightKeywords",value:function(e){var t=this.focusKeywords.getFocusKeyword().keyword;!1!==t&&(e?(e.hasClass("serp-url")&&(t=this.assessor.paper.get("keywordPermalink")),e.rankMathUnhighlight(),e.rankMathHighlight(t)):(this.serpTitle.rankMathUnhighlight(),this.serpTitle.rankMathHighlight(t),this.serpPermalink.rankMathUnhighlight(),this.serpPermalink.rankMathHighlight(this.assessor.paper.get("keywordPermalink")),this.serpDescription.rankMathUnhighlight(),this.serpDescription.rankMathHighlight(t)))}},{key:"swapVars",value:function(e,t){var n=this;return(e=e||"")?(t=t||this.getMapObj(),(e=e.replace(" %page%","").replace("%sep% %sep%","%sep%")).replace(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/giu,function(e){var r=e.toLowerCase().replace(/%+/g,"");return["title","post_title","term","author","name"].includes(r)?n.isGutenbergAvailable?t.title:n.elemTitle.val():["description","tag_description","category_description","cat_description","author_description","user_description"].includes(r)?(0,i.default)("#description").val():["fk","focuskeyword","focuskw"].includes(r)?n.focusKeywords.getFocusKeyword().keyword:r.includes("customfield(")?(r=r.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[r]:"":(r.includes("(")&&(r=r.split("(")[0]),r in t?t[r]:r)}).trim()):""}},{key:"getMapObj",value:function(){var e=this;return null!==this.variableMap?this.variableMap:(this.variableMap={},i.default.each(rankMath.variables,function(t,n){t=t.toLowerCase().replace(/%+/g,"").split("(")[0],e.variableMap[t]=n.example}),this.variableMap)}},{key:"setVariable",value:function(e,t){null!==this.variableMap?this.variableMap[e]=t:void 0!==rankMath.variables[e]&&(rankMath.variables[e].example=t)}},{key:"getContent",value:function(){return this.assessor.paper.get("content")}},{key:"getDescription",value:function(){this.assessor.refreshContent();var e=this.getExcerpt(),t=this.serpDescriptionField.val();if(""!==t)return(0,h.default)(t);if(!(0,o.default)(e)&&""!==e)return(0,h.default)(e);var n=this.serpDescription.data("format"),r=this.generateDescriptionFromContent(this.getContent());return this.setVariable("excerpt",r),(0,o.default)(n)||""===n?r:(0,h.default)(n)}},{key:"getExcerpt",value:function(){if(this.isGutenbergAvailable)return"";var e=this.elemDescription.val();return this.setVariable("excerpt",e),this.setVariable("excerpt_only",e),this.setVariable("wc_shortdesc",e),e}},{key:"generateDescriptionFromContent",value:function(e){if(""===e)return"";var t=this.focusKeywords.getFocusKeyword().keyword,n=(0,a.default)((0,v.default)(e,!0),function(e){return""!==i.default.trim(e)});if(!n.length)return"";if(""!==t){var r=(0,a.default)(n,function(e){return(0,u.default)(e.toLowerCase(),t)});if(r.length>0)return this.getDescriptionTruncated(r[0],160)}return this.getDescriptionTruncated(n[0],160)}},{key:"getDescriptionTruncated",value:function(e,t){return t?this.truncate(e.replace(/\r?\n|\r/g," "),t):e.replace(/\r?\n|\r/g," ")}},{key:"truncate",value:function(e,t){return e.length>t?e.substring(0,t):e}}]),e}();t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=(r=n(62))&&r.__esModule?r:{default:r},o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metabox=t,this.getPostAttribute=this.getPostAttribute.bind(this),this.refresh=this.refresh.bind(this),this._data=this.collectGutenbergData(this.getPostAttribute),this.subscribeToGutenberg()}return i(e,[{key:"collectGutenbergData",value:function(){return{content:this.getPostAttribute("content"),title:this.getPostAttribute("title"),slug:this.getSlug(),excerpt:this.getPostAttribute("excerpt")}}},{key:"getSlug",value:function(){if("auto-draft"===this.getPostAttribute("status"))return"";var e=this.getPostAttribute("generated_slug");return"auto-draft"!==e&&"en"===rankMath.locale||(e=""),this.getPostAttribute("slug")||e}},{key:"getPostAttribute",value:function(e){return this._coreEditorSelect||(this._coreEditorSelect=wp.data.select("core/editor")),this._coreEditorSelect.getEditedPostAttribute(e)}},{key:"subscribeToGutenberg",value:function(){this.subscriber=(0,a.default)(this.refresh,500),wp.data.subscribe(this.subscriber)}},{key:"refresh",value:function(){var e=this.collectGutenbergData();this.handleEditorChange(e),this._data=e}},{key:"handleEditorChange",value:function(e){this._data.title!==e.title&&(this.metabox.title=e.title,this.metabox.setVariable("title",e.title),this.metabox.setVariable("term",e.title),this.metabox.setVariable("author",e.title),this.metabox.setVariable("name",e.title),this.metabox.updateTitlePreview()),this._data.excerpt!==e.excerpt&&(this.metabox.setVariable("excerpt",e.excerpt),this.metabox.setVariable("excerpt_only",e.excerpt),this.metabox.setVariable("wc_shortdesc",e.excerpt),this.metabox.updateDescriptionPreview()),this._data.slug!==e.slug&&this.metabox.serpPermalinkField.val(e.slug).trigger("input"),this._data.content!==e.content&&(this.metabox.assessor.paper.setContent(e.content),this.metabox.updateDescriptionPreview(),this.metabox.socialFields.updateThumbnailPreview())}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(92)),i=a(n(96));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(){return!(0,r.default)(window.wp)&&!(0,r.default)(wp.data)&&!(0,r.default)(wp.data.select("core/editor"))&&(0,i.default)(wp.data.select("core/editor").getEditedPostAttribute)}}]);
|
assets/admin/js/term-metabox.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=352)}([function(e,t){e.exports=Array.isArray},function(e,t,n){var r=n(75)("wks"),i=n(40),o=n(2).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(11),i=n(41);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=!n(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=jQuery},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(70)("wks"),i=n(71),o=n(6).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(34),i=n(68);e.exports=n(20)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(12),i=n(77),o=n(79),a=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(2),i=n(3),o=n(14),a=n(40)("src"),s=Function.toString,u=(""+s).split("toString");n(39).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(t+""))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return e}},,function(e,t,n){var r=n(89);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports={}},function(e,t,n){var r=n(35);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(36)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(181),i=n(43);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(0),i=n(30),o=n(130),a=n(60);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(96),i=n(54);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},,function(e,t,n){var r=n(109),i=n(112)(r);e.exports=i},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(0),i=n(129),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(52),i=n(26),o=n(105),a=n(140),s=n(141),u=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:s(e),n=n&&!c?a(n):0;var l=e.length;return 0>n&&(n=u(l+n,0)),o(e)?l>=n&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},function(e,t,n){var r=n(156),i=n(33);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(19),i=n(159),o=n(160),a=Object.defineProperty;t.f=n(20)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(70)("keys"),i=n(71);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(75)("keys"),i=n(40);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){"use strict";var r=n(3),i=n(13),o=n(22),a=n(43),s=n(1);e.exports=function(e,t,n){var u=s(e),c=n(a,u,""[e]),l=c[0],f=c[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,l),r(RegExp.prototype,u,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(113),i=n(127),o=n(104),a=n(0),s=n(133);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(25),i=n(15);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&o>n;)e=e[i(t[n++])];return n&&n==o?e:void 0}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"\n")}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&9007199254740991>=e}},function(e,t,n){var r=n(115),i=n(116),o=n(117),a=n(118),s=n(119);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(120),i=n(57);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(24);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){var r=n(24),i=n(211),o=n(144),a=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,f,p,d,h=0,v=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,h=t,f=e.apply(r,n)}function k(e){var n=e-d;return void 0===d||n>=t||0>n||g&&e-h>=l}function b(){var e=i();if(k(e))return w(e);p=setTimeout(b,function(e){var n=t-(e-d);return g?s(n,l-(e-h)):n}(e))}function w(e){return p=void 0,m&&u?y(e):(u=c=void 0,f)}function x(){var e=i(),n=k(e);if(u=arguments,c=this,d=e,n){if(void 0===p)return function(e){return h=e,p=setTimeout(b,t),v?y(e):f}(d);if(g)return p=setTimeout(b,t),y(d)}return void 0===p&&(p=setTimeout(b,t)),f}return t=o(t)||0,r(n)&&(v=!!n.leading,l=(g="maxWait"in n)?a(o(n.maxWait)||0,t):l,m="trailing"in n?!!n.trailing:m),x.cancel=function(){void 0!==p&&clearTimeout(p),h=0,u=d=c=p=void 0},x.flush=function(){return void 0===p?f:w(i())},x}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(65),i=n(66),o=n(161),a=n(10),s=n(18),u=n(162),c=n(73),l=n(170),f=n(8)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,g,m){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in P)return P[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,O=!1,P=e.prototype,T=P[f]||P["@@iterator"]||v&&P[v],C=T||w(v),S=v?_?w("entries"):C:void 0,j="Array"==t&&P.entries||T;if(j&&(b=l(j.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||a(b,f,d)),_&&T&&"values"!==T.name&&(O=!0,C=function(){return T.call(this)}),r&&!m||!p&&!O&&P[f]||a(P,f,C),s[t]=C,s[x]=d,v)if(y={values:_?C:w("values"),keys:g?C:w("keys"),entries:S},m)for(k in y)k in P||o(P,k,y[k]);else i(i.P+i.F*(p||O),t,y);return y}},function(e,t){e.exports=!0},function(e,t,n){var r=n(6),i=n(7),o=n(157),a=n(10),s=n(21),u=function(e,t,n){var c,l,f,p=e&u.F,d=e&u.G,h=e&u.S,v=e&u.P,g=e&u.B,m=e&u.W,y=d?i:i[t]||(i[t]={}),k=y.prototype,b=d?r:h?r[t]:(r[t]||{}).prototype;for(c in d&&(n=t),n)(l=!p&&b&&void 0!==b[c])&&s(y,c)||(f=l?b[c]:n[c],y[c]=d&&"function"!=typeof b[c]?n[c]:g&&l?o(f,r):m&&b[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?o(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[c]=f,e&u.R&&k&&!k[c]&&a(k,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(35),i=n(6).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(165),i=n(72);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(7),i=n(6),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(65)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(34).f,i=n(21),o=n(8)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(33);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(39),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(76)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t,n){e.exports=!n(4)&&!n(22)(function(){return 7!=Object.defineProperty(n(78)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9),i=n(2).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(184);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(83),i=n(45);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(14),i=n(23),o=n(188)(!1),a=n(44)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(11).f,i=n(14),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(9),i=n(80),o=n(1)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(148),i=n(149),o=n(176);e.exports=function(e,t){return r(e)||i(e,t)||o()}},function(e,t,n){e.exports=n(196)},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(132),i=n(102);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&t>e}},function(e,t){e.exports=function(e){return void 0===e}},function(e,t,n){var r=n(107),i=n(108),o=n(47),a=n(0);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},function(e,t,n){var r=n(61),i=n(47),o=n(146),a=n(0);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,"").replace(i,"")};var r=/\[[^<>&\/\[\] - =]+?( [^\]]+?)?\]/g,i=/\[\/[^<>&\/\[\] - =]+?\]/g},function(e,t,n){var r=n(53),i=n(24);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(0);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return r(e)?e:[e]}},function(e,t,n){var r=n(52);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(25),i=n(103),o=n(0),a=n(91),s=n(54),u=n(15);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(o(e)||i(e))}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(53),i=n(0),o=n(57);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},,function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},function(e,t,n){var r=n(28);e.exports=function(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}},function(e,t,n){var r=n(110),i=n(29);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(111)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},function(e,t,n){var r=n(26);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},function(e,t,n){var r=n(114),i=n(126),o=n(59);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(55),i=n(56);e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=n[a])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(o)var h=o(f,p,l,e,t,d);if(!(void 0===h?i(p,f,3,o,d):h))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(17),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return n>=0&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(17);e.exports=function(e){var t=this.__data__,n=r(t,e);return 0>n?void 0:t[n][1]}},function(e,t,n){var r=n(17);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(17);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return 0>i?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(55),i=n(121),o=n(123),a=n(124),s=n(99),u=n(0),c=n(100),l=n(101),f="[object Arguments]",p="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,m){var y=u(e),k=u(t),b=y?p:s(e),w=k?p:s(t),x=(b=b==f?d:b)==d,_=(w=w==f?d:w)==d,O=b==w;if(O&&c(e)){if(!c(t))return!1;y=!0,x=!1}if(O&&!x)return m||(m=new r),y||l(e)?i(e,t,n,v,g,m):o(e,t,b,n,v,g,m);if(!(1&n)){var P=x&&h.call(e,"__wrapped__"),T=_&&h.call(t,"__wrapped__");if(P||T){var C=P?e.value():e,S=T?t.value():t;return m||(m=new r),g(C,S,n,v,m)}}return!!O&&(m||(m=new r),a(e,t,n,v,g,m))}},function(e,t,n){var r=n(97),i=n(122),o=n(98);e.exports=function(e,t,n,a,s,u){var c=1&n,l=e.length,f=t.length;if(!(l==f||c&&f>l))return!1;var p=u.get(e);if(p&&u.get(t))return p==t;var d=-1,h=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++d<l;){var g=e[d],m=t[d];if(a)var y=c?a(m,g,d,t,e,u):a(g,m,d,e,t,u);if(void 0!==y){if(y)continue;h=!1;break}if(v){if(!i(t,function(e,t){if(!o(v,t)&&(g===e||s(g,e,n,a,u)))return v.push(t)})){h=!1;break}}else if(g!==m&&!s(g,m,n,a,u)){h=!1;break}}return u.delete(e),u.delete(t),h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(125),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var d=s.get(e);if(d&&s.get(t))return d==t;var h=!0;s.set(e,t),s.set(t,e);for(var v=u;++f<l;){var g=e[p=c[f]],m=t[p];if(o)var y=u?o(m,g,p,t,e,s):o(g,m,p,e,t,s);if(!(void 0===y?g===m||a(g,m,n,o,s):y)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var k=e.constructor,b=t.constructor;k!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof b&&b instanceof b)&&(h=!1)}return s.delete(e),s.delete(t),h}},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(58),i=n(29);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},function(e,t,n){var r=n(56),i=n(128),o=n(90),a=n(30),s=n(58),u=n(59),c=n(15);e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},function(e,t,n){var r=n(48);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=n(131)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)}),t});e.exports=o},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(134),i=n(135),o=n(30),a=n(15);e.exports=function(e){return o(e)?r(a(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(48);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(e=(0,i.default)(e)).replace(/ /gi,"-").toLowerCase()};var r,i=(r=n(137))&&r.__esModule?r:{default:r}},function(e,t,n){var r=n(138),i=n(60),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]/g;e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(a,"")}},function(e,t,n){var r=n(139)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(142),i=n(29);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){var r=n(61);e.exports=function(e,t){return r(t,function(t){return e[t]})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=u((0,i.autop)((0,a.default)(e)),t);return n.length>0?n:[e]};var r=s(n(94)),i=n(147),o=s(n(50)),a=s(n(95));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t){var n=[];t=t||!1;for(var i=/<p(?:[^>]+)?>(.*?)<\/p>/gi,a=void 0;null!==(a=i.exec(e));)n.push(a);return(0,r.default)(n,function(e){return t?(0,o.default)(e[1]):e[1]})}},function(e,t,n){var r=n(28),i=n(26);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,function(e,r,i){o[++n]=t(e,r,i)}),o}},function(e,t,n){"use strict";n.r(t),n.d(t,"autop",function(){return c}),n.d(t,"removep",function(){return l});var r=n(87),i=n.n(r),o=(n(177),n(194),n(195),n(88)),a=n.n(o),s=(n(199),n(200),/(<((?=!--|!\[CDATA\[)((?=!-)!(?:-(?!->)[^\-]*)*(?:-->)?|!\[CDATA\[[^\]]*(?:](?!]>)[^\]]*)*?(?:]]>)?)|[^>]*>?))/);function u(e,t){for(var n=function(e){for(var t,n=[],r=e;t=r.match(s);)n.push(r.slice(0,t.index)),n.push(t[0]),r=r.slice(t.index+t[0].length);return r.length&&n.push(r),n}(e),r=!1,i=a()(t),o=1;n.length>o;o+=2)for(var u=0;i.length>u;u++){var c=i[u];if(-1!==n[o].indexOf(c)){n[o]=n[o].replace(RegExp(c,"g"),t[c]),r=!0;break}}return r&&(e=n.join("")),e}function c(e){var t=1>=arguments.length||void 0===arguments[1]||arguments[1],n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){var r=e.split("</pre>"),o=r.pop();e="";for(var a=0;r.length>a;a++){var s=r[a],c=s.indexOf("<pre");if(-1!==c){var l="<pre wp-pre-tag-"+a+"></pre>";n.push([l,s.substr(c)+"</pre>"]),e+=s.substr(0,c)+l}else e+=s}e+=o}var f="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=u(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(RegExp("(<"+f+"[s/>])","g"),"\n\n$1")).replace(RegExp("(</"+f+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));var p=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",p.forEach(function(t){e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)","g"),"$1")).replace(RegExp("(</?"+f+"[^>]*>)s*</p>","g"),"$1"),t&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,function(e){return e[0].replace(/\n/g,"<WPPreserveNewline />")})).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,function(e,t){return t?e:"<br />\n"})).replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(RegExp("(</?"+f+"[^>]*>)s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach(function(t){var n=i()(t,2);e=e.replace(n[0],n[1])}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}function l(e){var t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",r=t+"|pre",i=[],o=!1,a=!1;return e?(-1===e.indexOf("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(e){return i.push(e),"<wp-preserve>"})),-1!==e.indexOf("<pre")&&(o=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(e){return(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")})),-1!==e.indexOf("[caption")&&(a=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(RegExp("\\s*</("+n+")>\\s*","g"),"</$1>\n")).replace(RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,function(e,t){return t&&-1!==t.indexOf("\n")?"\n\n":"\n"})).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(RegExp("\\s*</("+r+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(/<wp-line-break>/g,"\n")),a&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),i.length&&(e=e.replace(/<wp-preserve>/g,function(){return i.shift()})),e):""}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t,n){var r=n(150);e.exports=function(e,t){var n=[],i=!0,o=!1,a=void 0;try{for(var s,u=r(e);!(i=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return n}},function(e,t,n){e.exports=n(151)},function(e,t,n){n(152),n(171),e.exports=n(173)},function(e,t,n){n(153);for(var r=n(6),i=n(10),o=n(18),a=n(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;s.length>u;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[a]&&i(f,a,c),o[c]=o.Array}},function(e,t,n){"use strict";var r=n(154),i=n(155),o=n(18),a=n(32);e.exports=n(64)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(63);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(158);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=!n(20)&&!n(36)(function(){return 7!=Object.defineProperty(n(67)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(35);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";var r=n(163),i=n(68),o=n(73),a={};n(10)(a,n(8)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(19),i=n(164),o=n(72),a=n(38)("IE_PROTO"),s=function(){},u=function(){var e,t=n(67)("iframe"),r=o.length;for(t.style.display="none",n(169).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(34),i=n(19),o=n(69);e.exports=n(20)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(21),i=n(32),o=n(166)(!1),a=n(38)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(32),i=n(167),o=n(168);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(37),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(37),i=Math.max,o=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(6).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(21),i=n(74),o=n(38)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";var r=n(172)(!0);n(64)(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return t.length>n?(e=r(t,n),this._i+=e.length,{value:e,done:!1}):{value:void 0,done:!0}})},function(e,t,n){var r=n(37),i=n(33);e.exports=function(e){return function(t,n){var o,a,s=i(t)+"",u=r(n),c=s.length;return 0>u||u>=c?e?"":void 0:55296>(o=s.charCodeAt(u))||o>56319||u+1===c||56320>(a=s.charCodeAt(u+1))||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){var r=n(19),i=n(174);e.exports=n(7).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){var r=n(175),i=n(8)("iterator"),o=n(18);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(63),i=n(8)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){for(var r=n(178),i=n(82),o=n(13),a=n(2),s=n(3),u=n(42),c=n(1),l=c("iterator"),f=c("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(d),v=0;h.length>v;v++){var g,m=h[v],y=d[m],k=a[m],b=k&&k.prototype;if(b&&(b[l]||s(b,l,p),b[f]||s(b,f,m),u[m]=p,y))for(g in r)b[g]||o(b,g,r[g],!0)}},function(e,t,n){"use strict";var r=n(179),i=n(180),o=n(42),a=n(23);e.exports=n(182)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(1)("unscopables"),i=Array.prototype;null==i[r]&&n(3)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(80);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";var r=n(76),i=n(183),o=n(13),a=n(3),s=n(42),u=n(185),c=n(85),l=n(192),f=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,g,m){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in P)return P[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,O=!1,P=e.prototype,T=P[f]||P["@@iterator"]||v&&P[v],C=T||w(v),S=v?_?w("entries"):C:void 0,j="Array"==t&&P.entries||T;if(j&&(b=l(j.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||a(b,f,d)),_&&T&&"values"!==T.name&&(O=!0,C=function(){return T.call(this)}),r&&!m||!p&&!O&&P[f]||a(P,f,C),s[t]=C,s[x]=d,v)if(y={values:_?C:w("values"),keys:g?C:w("keys"),entries:S},m)for(k in y)k in P||o(P,k,y[k]);else i(i.P+i.F*(p||O),t,y);return y}},function(e,t,n){var r=n(2),i=n(39),o=n(3),a=n(13),s=n(81),u=function(e,t,n){var c,l,f,p,d=e&u.F,h=e&u.G,v=e&u.P,g=e&u.B,m=h?r:e&u.S?r[t]||(r[t]={}):(r[t]||{}).prototype,y=h?i:i[t]||(i[t]={}),k=y.prototype||(y.prototype={});for(c in h&&(n=t),n)f=((l=!d&&m&&void 0!==m[c])?m:n)[c],p=g&&l?s(f,r):v&&"function"==typeof f?s(Function.call,f):f,m&&a(m,c,f,e&u.U),y[c]!=f&&o(y,c,p),v&&k[c]!=f&&(k[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var r=n(186),i=n(41),o=n(85),a={};n(3)(a,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(12),i=n(187),o=n(45),a=n(44)("IE_PROTO"),s=function(){},u=function(){var e,t=n(78)("iframe"),r=o.length;for(t.style.display="none",n(191).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(11),i=n(12),o=n(82);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(23),i=n(189),o=n(190);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(84),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(84),i=Math.max,o=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(14),i=n(193),o=n(44)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(43);e.exports=function(e){return Object(r(e))}},function(e,t,n){n(46)("split",2,function(e,t,r){"use strict";var i=n(86),o=r,a=[].push;if("".split(/.?/).length){var s=void 0===/()??/.exec("")[1];r=function(e,t){var n=this+"";if(void 0===e&&0===t)return[];if(!i(e))return o.call(n,e,t);var r,u,c,l,f,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,g=RegExp(e.source,d+"g");for(s||(r=RegExp("^"+g.source+"$(?!\\s)",d));(u=g.exec(n))&&((c=u.index+u[0].length)<=h||(p.push(n.slice(h,u.index)),!s&&u.length>1&&u[0].replace(r,function(){for(f=1;arguments.length-2>f;f++)void 0===arguments[f]&&(u[f]=void 0)}),u.length>1&&n.length>u.index&&a.apply(p,u.slice(1)),l=u[0].length,h=c,v>p.length));)g.lastIndex===u.index&&g.lastIndex++;return h===n.length?!l&&g.test("")||p.push(""):p.push(n.slice(h)),p.length>v?p.slice(0,v):p}}return[function(n,i){var o=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(o+"",n,i)},r]})},function(e,t,n){n(46)("replace",2,function(e,t,n){return[function(r,i){"use strict";var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(o+"",r,i)},n]})},function(e,t,n){n(197),e.exports=n(7).Object.keys},function(e,t,n){var r=n(74),i=n(69);n(198)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(66),i=n(7),o=n(36);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t,n){n(46)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):RegExp(n)[t](r+"")},n]})},function(e,t,n){var r=n(2),i=n(201),o=n(11).f,a=n(205).f,s=n(86),u=n(206),c=r.RegExp,l=c,f=c.prototype,p=/a/g,d=/a/g,h=new c(p)!==p;if(n(4)&&(!h||n(22)(function(){return d[n(1)("match")]=!1,c(p)!=p||c(d)==d||"/a/i"!=c(p,"i")}))){c=function(e,t){var n=this instanceof c,r=s(e),o=void 0===t;return!n&&r&&e.constructor===c&&o?e:i(h?new l(r&&!o?e.source:e,t):l((r=e instanceof c)?e.source:e,r&&o?u.call(e):t),n?this:f,c)};for(var v=function(e){e in c||o(c,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})},g=a(l),m=0;g.length>m;)v(g[m++]);f.constructor=c,c.prototype=f,n(13)(r,"RegExp",c)}n(207)("RegExp")},function(e,t,n){var r=n(9),i=n(202).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t,n){var r=n(9),i=n(12),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(81)(Function.call,n(203).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){var r=n(204),i=n(41),o=n(23),a=n(79),s=n(14),u=n(77),c=Object.getOwnPropertyDescriptor;t.f=n(4)?c:function(e,t){if(e=o(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(83),i=n(45).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";var r=n(12);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(2),i=n(11),o=n(4),a=n(1)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r};i.default.extend({rankMathHighlight:function(e,t,n,r){if(3===e.nodeType){var o=e.data.match(t);if(o){var a=document.createElement(n||"span");a.className=r||"highlight";var s=e.splitText(o.index);s.splitText(o[0].length);var u=s.cloneNode(!0);return a.appendChild(u),s.parentNode.replaceChild(a,s),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==r))for(var c=0;e.childNodes.length>c;c++)c+=i.default.rankMathHighlight(e.childNodes[c],t,n,r);return 0}}),i.default.fn.rankMathUnhighlight=function(e){var t={className:"highlight",element:"span"};return i.default.extend(t,e),this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()},i.default.fn.rankMathHighlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(i.default.extend(n,t),void 0===e||""===e)return this;if(e.constructor===String&&(e=[e]),e=i.default.grep(e,function(e){return""!==e}),0===(e=i.default.map(e,function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")})).length)return this;var r=n.caseSensitive?"":"i",o="("+e.join("|")+")";n.wordsOnly&&(o="\\b"+o+"\\b");var a=RegExp(o,r);return this.each(function(){i.default.rankMathHighlight(this,a,n.element,n.className)})}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r},o=document.createElement("div");i.default.fn.lengthIndicator=function(e){var t=this;e=i.default.extend({},{minLength:0,maxLength:1e3,source:null},e),t.wrap('<span class="length-indicator-wrapper"/>'),t.parent().append('<span class="length-indicator"><span/></span><span class="length-count">0 / '+e.maxLength+"</span>");var n=t.parent().find(".length-indicator"),r=n.find(">span"),a=t.parent().find(".length-count"),s=function(){var i=function(e){return e&&"string"==typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),o.innerHTML=e,e=o.textContent,o.textContent=""),e}(null===e.source?t.val():e.source.text()).length;n.removeClass("invalid short"),r.css("left",Math.min(100,Math.floor(i/e.maxLength*100))+"%"),a.text(i+" / "+e.maxLength),i>e.minLength&&e.maxLength>=i||n.addClass("invalid")};t.on("input",s),null!==e.source&&e.source.on("rank-math-vars-replaced",s),s()}},function(e,t,n){var r=n(212);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(213),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){var r;r=n(143),e.exports="object"==typeof r&&r&&r.Object===Object&&r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(215));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank-math-serp-checklist",t.elemMetabox),this.scoreElem=(0,i.default)('<div class="misc-pub-section rank-math-seo-score"><span class="score-text"><span class="dashicons dashicons-chart-area"></span> SEO: <strong>Not available</strong></span></div>'),this.scoreText=this.scoreElem.find("strong"),this.scoreField=(0,i.default)("#rank_math_seo_score"),this.fkScoreElem=(0,i.default)('<div class="rank-math-seo-score below-focus-keyword"><span class="score-text">Not available</span></div>'),this.fkScoreText=this.fkScoreElem.find("span"),(0,i.default)("#misc-publishing-actions").append(this.scoreElem),(0,i.default)(".cmb-td",".cmb2-id-rank-math-focus-keyword").append(this.fkScoreElem),this.events()}return r(e,[{key:"display",value:function(e){var t=this;i.default.each(e,function(e,n){var r=t.elem.find(".seo-check-"+e);r.removeClass("test-ok test-gallery test-fail test-empty test-looking veryEasy difficult veryDifficult"),r.addClass("test-"+n.status),r.show(),"calculateFleschReading"===e&&r.addClass(n.factors[2]),r.find("span:eq(0)").html(n.message)})}},{key:"setPrimaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,o.default)(e,function(e,t,n){return!1===t&&(t={score:0}),e+t.score},0);status="bad-fk",n>80?status="good-fk":n>50&&(status="ok-fk"),t.removeClass("bad-fk ok-fk good-fk"),this.scoreElem.removeClass("bad-fk ok-fk good-fk"),this.fkScoreElem.removeClass("bad-fk ok-fk good-fk"),t.addClass(status),this.scoreElem.addClass(status),this.fkScoreElem.addClass(status),this.scoreText.html(n+" / 100"),this.fkScoreText.html(n+" / 100"),this.scoreField.val(parseInt(n))}},{key:"setSecondaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,o.default)(e,function(e,t){return e+("ok"===t.status?1:0)},0);t.addClass(3===n?"good-fk":2===n?"ok-fk":"bad-fk")}},{key:"hidePrimary",value:function(){this.elem.find("li.is-primary").hide()}},{key:"events",value:function(){var e=this;this.elem.on("click",".group-handle",function(t){t.preventDefault();var n=(0,i.default)(t.target).closest(".rank-math-serp-group"),r={};n.toggleClass("state-open state-closed"),e.updateGroupStatus(n),e.elem.find(">.rank-math-serp-group").each(function(){var e=(0,i.default)(this);r[e.data("id")]=e.hasClass("state-closed")?"closed":"open"}),i.default.ajax({url:rankMath.ajaxurl,type:"POST",data:{action:"rank_math_save_checklist_layout",security:rankMath.security,layout:r}})})}},{key:"updateGroupStatus",value:function(e){(e=e||(0,i.default)(".rank-math-serp-group")).each(function(){var e=(0,i.default)(this);1>e.find("li.test-fail").length&&1>e.find("li.test-empty").length?e.find(".group-status").addClass("passed"):e.find(".group-status").removeClass("passed")})}}]),e}();t.default=s},function(e,t,n){var r=n(216),i=n(28),o=n(47),a=n(217),s=n(0);e.exports=function(e,t,n){var u=s(e)?r:a,c=3>arguments.length;return u(e,o(t,4),n,c,i)}},function(e,t){e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},function(e,t){e.exports=function(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(r=n(5))&&r.__esModule?r:{default:r},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metabox=t,this.currentNetwork="facebook",this.useFacebook=!0,this.shouldUpdatePreview=!1,this.facebookTitleField=t.elemMetabox.find("#rank_math_facebook_title"),this.facebookDescriptionField=t.elemMetabox.find("#rank_math_facebook_description"),this.twitterTitleField=t.elemMetabox.find("#rank_math_twitter_title"),this.twitterDescriptionField=t.elemMetabox.find("#rank_math_twitter_description"),this.facebookImageField=t.elemMetabox.find("#rank_math_facebook_image"),this.twitterImageField=t.elemMetabox.find("#rank_math_twitter_image"),this.facebookImageStatus=t.elemMetabox.find("#rank_math_facebook_image-status"),this.twitterImageStatus=t.elemMetabox.find("#rank_math_twitter_image-status"),this.socialWrapper=t.elemMetabox.find(".rank-math-social-preview"),this.socialPreview=this.socialWrapper.find(".rank-math-social-preview-item"),this.socialTitle=this.socialWrapper.find(".rank-math-social-preview-title"),this.socialDescription=this.socialWrapper.find(".rank-math-social-preview-description"),this.events(),this.shouldUpdatePreview=!0,this.updatePreview()}return i(e,[{key:"events",value:function(){var e=this;this.facebookTitleField.on("input",function(){e.updateTitlePreview()}),this.facebookDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.facebookImageField.on("input",function(){e.updateThumbnailPreview()}),this.twitterTitleField.on("input",function(){e.updateTitlePreview()}),this.twitterDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.twitterImageField.on("input",function(){e.updateThumbnailPreview()});var t=(0,o.default)(".rank-math-social-preview-button"),n=t.find(">span");t.on("click",function(t){t.preventDefault(),n.toggleClass("dashicons-arrow-down dashicons-arrow-up"),e.updatePreview(),e.socialWrapper.toggleClass("open"),e.socialPreview.slideToggle()});var r=(0,o.default)("#rank_math_twitter_card_type");(0,o.default)(".preview-network").on("click",function(n){(0,o.default)(n.target).hasClass("tab-facebook")?t.show():r.trigger("change"),e.updatePreview()}),r.on("change",function(){var n=r.val();"player"===n&&(0,o.default)(".cmb2-id-rank-math-twitter-image, .cmb2-id-rank-math-twitter-title, .cmb2-id-rank-math-twitter-description").show();var i="player"===n||"app"===n;t.toggle(!i),(0,o.default)(".cmb2-id-rank-math-twitter-use-facebook").toggle(!i),e.updatePreview()}).trigger("change");var i=(0,o.default)("#rank_math_twitter_use_facebook2");(0,o.default)("#rank_math_twitter_use_facebook1, #rank_math_twitter_use_facebook2").on("input change",function(){e.useFacebook=i.is(":checked"),e.updatePreview()}).trigger("change"),(0,o.default)(".cmb2-id-rank-math-facebook-enable-image-overlay, .cmb2-id-rank-math-facebook-image-overlay, .cmb2-id-rank-math-twitter-enable-image-overlay, .cmb2-id-rank-math-twitter-image-overlay").on("change","input",function(){e.updateThumbnailOverlay()}),(0,o.default)(document).on("cmb_media_modal_select",function(t,n,r){"rank_math_facebook_image"!==r.field&&"rank_math_twitter_image"!==r.field||e.updateThumbnailPreview()}),(0,o.default)(document).on("cmb_init",function(t,n){n.$metabox.on("click",".cmb2-remove-file-button",function(){e.updateThumbnailPreview()})})}},{key:"updatePreview",value:function(){!1!==this.shouldUpdatePreview&&(this.currentNetwork=(0,o.default)(".preview-network.tab-active").attr("href").replace("#setting-panel-social-",""),this.socialWrapper.removeClass(),this.socialWrapper.addClass("rank-math-social-preview rank-math-social-preview-"+this.currentNetwork),"twitter"===this.currentNetwork&&this.socialWrapper.addClass((0,o.default)("#rank_math_twitter_card_type").val()),this.updateTitlePreview(),this.updateDescriptionPreview(),this.updateThumbnailPreview())}},{key:"updateTitlePreview",value:function(){var e=this[this.currentNetwork+"TitleField"].val()||this.metabox.title;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookTitleField.val()||this.metabox.title),e=this.metabox.truncate(this.metabox.swapVars(e),90),this.socialTitle.html(e)}},{key:"updateDescriptionPreview",value:function(){var e=this[this.currentNetwork+"DescriptionField"].val()||this.description;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookDescriptionField.val()||this.metabox.description),e=this.metabox.truncate(this.metabox.swapVars(e),240),this.socialDescription.html(e)}},{key:"updateThumbnailPreview",value:function(){var e=(0,o.default)("#rank_math_post_thumbnail").attr("src"),t=this.metabox.getContent(),n=!!/<img(?:[^>]+)?>/.test(t)&&(0,o.default)(t).find("img:first").attr("src"),r=this.facebookImageField.val()||e||n||rankMath.defautOgImage,i=this.twitterImageField.val()||e||n||rankMath.defautOgImage;if("twitter"===this.currentNetwork&&this.useFacebook)i=r;else if(this.twitterImageStatus.find("img.cmb-file-field-image").length){var a=this.twitterImageStatus.siblings(".notice"),s=this.twitterImageStatus.find("img.cmb-file-field-image")[0];a.addClass("hidden"),(0,o.default)(s).on("load",function(){(200>s.naturalWidth||200>s.naturalHeight)&&a.removeClass("hidden")})}var u=this.facebookImageStatus.siblings(".notice"),c=this.facebookImageStatus.find("img.cmb-file-field-image");u.addClass("hidden"),"facebook"===this.currentNetwork&&this.facebookImageField.val()&&c.length&&(0,o.default)(c[0]).on("load",function(){(200>c[0].naturalWidth||200>c[0].naturalHeight)&&u.removeClass("hidden")});var l=(0,o.default)(".rank-math-social-preview-image");(0,o.default)(".facebook-thumbnail",l).attr("src",r),(0,o.default)(".twitter-thumbnail",l).attr("src",i),l.toggleClass("no-facebook-image",!r),l.toggleClass("no-twitter-image",!i),l.parents(".rank-math-social-preview-facebook").find(".error-msg").toggleClass("show",!r),l.parents(".rank-math-social-preview-twitter").find(".error-msg").toggleClass("show",!i),this.updateThumbnailOverlay()}},{key:"updateThumbnailOverlay",value:function(){var e=(0,o.default)(".rank-math-social-preview-image-overlay"),t=(0,o.default)('[name="rank_math_'+this.currentNetwork+'_enable_image_overlay"]:checked').val(),n=(0,o.default)('[name="rank_math_'+this.currentNetwork+'_image_overlay"]:checked').val(),r=!(0,o.default)(".rank-math-social-preview-image").hasClass("no-"+this.currentNetwork+"-image");"twitter"===this.currentNetwork&&this.useFacebook&&(n=(0,o.default)('[name="rank_math_facebook_image_overlay"]:checked').val(),r=!1);var i=(0,o.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-enable-image-overlay"),a="on"===i.find("input:checked").val();i.toggle(r),i.find(".notice-warning").toggle(a),"on"===t?(e.attr("src",rankMath.overlayImages[n].url).show(),(0,o.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-image-overlay").toggle(r)):e.hide()}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(62));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank_math_focus_keyword");var r=(0,o.default)(function(){t.updateFocusKeywords()},200),a=(0,o.default)(function(e,n){var r=e.find("li:last").prev(),i=t.assessor.assessFocusKeyword({elem:r,isPrimary:!1,keyword:n});t.checkList.setSecondaryKeywordStatus(i,r)},200);this.elem.on("content-loaded",function(){var e=n.elem.next("ul"),r=n.getFocusKeywords();(0,i.default)(e).find("li:gt(1)").each(function(){var e=(0,i.default)(this),n=t.assessor.assessFocusKeyword({elem:e,isPrimary:!1,keyword:r[e.index()-1]});t.checkList.setSecondaryKeywordStatus(n,e)})}),this.elem.tagEditor({autocomplete:1===rankMath.maxTags?null:this.getAutocompleteOptions(),sortable:!0,placeholder:this.elem.attr("placeholder"),onChange:function(e,t,n){1===n.length?t.find("li:not(.placeholder)").last().addClass("selected-fk"):t.find(".selected-fk").removeClass("selected-fk"),r()},onSelect:function(e,t){var n=e.parent();return!(!n.hasClass("selected-fk")&&""!==e.html()&&(t.find(".tag-editor-tag.active").length&&t.find("input").blur(),n.addClass("selected-fk").siblings().removeClass("selected-fk"),r(),1))},beforeTagDelete:function(e,t,n){return 1===n.length||(e.hasClass("selected-fk")&&t.find(">li").eq(1).addClass("selected-fk"),!0)},beforeTagSave:function(e,t,n,r,i){if(0!==n.length&&i)return a(t,i),i}}),this.elem.next().find(">li:not(.placeholder)").eq(1).addClass("selected-fk");var s=this.elem.parent();s.append(s.find(".cmb2-metabox-description"))}return r(e,[{key:"getAutocompleteOptions",value:function(){return{minLength:2,source:function(e,t){i.default.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:e.term,nolabels:"t",client:"hp",ds:"",lr:"lang_"+rankMath.locale,hl:rankMath.locale},success:function(e){t(i.default.map(e[1],function(e){return{value:(0,i.default)("<span>").html(e[0]).text()}}))}})}}}},{key:"getFocusKeywords",value:function(){var e=this.elem.tagEditor("getTags")[0];return e?e.tags:[]}},{key:"getFocusKeyword",value:function(){var e=this.elem.tagEditor("getTags")[0];if(!e)return{isPrimary:!0,keyword:""};var t=e.editor.find(".selected-fk").first();return t.length?{elem:t,isPrimary:1===t.index(),keyword:t.find(".tag-editor-tag").text()}:e.tags.length?{isPrimary:!0,keyword:e.tags[0]}:{isPrimary:!0,keyword:""}}},{key:"clearFocusKeywords",value:function(){this.elem.tagEditor("clearTags")}},{key:"addFocusKeyword",value:function(e){this.elem.tagEditor("addTag",e)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(r=n(5))&&r.__esModule?r:{default:r},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.focusKeywords=t,this.modal=(0,o.default)("#rank-math-compare-keywords-wrapper"),this.holder=this.modal.find(".rank-math-keywords-fields"),this.iframe=this.modal.find("iframe.attachments-browser"),this.btnCompare=this.modal.find(".compare-keywords"),this.events()}return i(e,[{key:"events",value:function(){var e=this;(0,o.default)("#rank-math-compare-keywords-trigger").on("click",function(t){t.preventDefault();var n=e.focusKeywords.getFocusKeywords();e.holder.html(""),n.length?o.default.each(n,function(t,n){e.addNewField(n)}):e.addNewField(),e.modal.toggle(),e.btnCompare.trigger("click")}),this.modal.on("click",".media-modal-close",function(){e.modal.toggle()}),this.modal.on("click",".add-new-keywords",function(){e.addNewField()}),this.modal.on("click",".remove-keyword",function(e){(0,o.default)(e.currentTarget).parent().remove(),btnCompare.trigger("click")}),this.modal.on("click",".use-these-keywords",function(){e.focusKeywords.clearFocusKeywords(),e.holder.find("input").each(function(t,n){var r=(0,o.default)(n).val().trim();""!==r&&e.focusKeywords.addFocusKeyword(r)}),e.modal.toggle()}),this.btnCompare.on("click",function(){var t=[];if(e.holder.find("input").each(function(){var e=(0,o.default)(this).val().trim();""!==e&&t.push({keyword:e,geo:"",time:"today 12-m"})}),0===t.length)return!1;t={comparisonItem:t,category:0,property:""},e.iframe.attr("src",e.iframe.data("srcbase")+"&req="+encodeURIComponent(JSON.stringify(t)))}),this.holder.on("keydown","input",function(t){if(13===t.keyCode)return t.preventDefault(),e.btnCompare.trigger("click"),!1})}},{key:"addNewField",value:function(e){var t=(0,o.default)("<div/>"),n=(0,o.default)("<input/>",{type:"text",class:"widefat",value:e||""});t.append(n),t.append('<button class="button-small button-link button-link-delete remove-keyword"><span class="dashicons dashicons-trash"></span></button>'),this.holder.append(t),n.autocomplete(this.focusKeywords.getAutocompleteOptions()).focus()}}]),e}();t.default=a},function(e,t,n){var r=n(222),i=n(208)(function(e,t){return null==e?{}:r(e,t)});e.exports=i},function(e,t,n){var r=n(223),i=n(90);e.exports=function(e,t){return r(e,t,function(t,n){return i(e,n)})}},function(e,t,n){var r=n(48),i=n(224),o=n(25);e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=r(e,c);n(l,c)&&i(u,o(c,e),l)}return u}},function(e,t,n){var r=n(225),i=n(25),o=n(91),a=n(24),s=n(15);e.exports=function(e,t,n,u){if(!a(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,p=e;null!=p&&++c<l;){var d=s(t[c]),h=n;if(c!=f){var v=p[d];void 0===(h=u?u(v,d,p):void 0)&&(h=a(v)?v:o(t[c+1])?[]:{})}r(p,d,h),p=p[d]}return e}},function(e,t,n){var r=n(226),i=n(89),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(227);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(228),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=g(n(5));n(209),n(210);var o=g(n(93)),a=g(n(92)),s=g(n(136)),u=g(n(31)),c=g(n(62)),l=g(n(214)),f=g(n(218)),p=g(n(219)),d=g(n(220)),h=g(n(50)),v=g(n(145));function g(e){return e&&e.__esModule?e:{default:e}}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"init",value:function(){this.title="",this.permalink="",this.description="",this.variableMap=null,this.analyzeOnPage=null!==document.getElementById("rank-math-serp-checklist"),this.shouldAssess=!1,this.primaryResult={},this.serpCanonical=this.elemMetabox.find("#rank_math_canonical_url"),this.serpTitleField=this.elemMetabox.find("#rank_math_title"),this.serpPermalinkField=this.elemMetabox.find("#rank_math_permalink"),this.serpDescriptionField=this.elemMetabox.find("#rank_math_description"),this.serpWrapper=this.elemMetabox.find(".serp-preview"),this.serpBg=this.elemMetabox.find(".serp-preview-bg input"),this.serpTitle=this.serpWrapper.find(".serp-title"),this.serpPermalink=this.serpWrapper.find(".serp-url"),this.serpDescription=this.serpWrapper.find(".serp-description"),this.desktopSnippet=this.serpWrapper.find(".serp-snippet-data"),this.assessor=new Assessor({elemContent:this.elemContent,researches:this.researches}),this.analyzeOnPage&&(this.checkList=new l.default(this)),this.socialFields=new f.default(this),this.compareKeywords=new d.default(this.focusKeywords),this.focusKeywords=new p.default(this),this.wrapInGroup(),this.serpEvents(),this.updateEvents(),this.updatePreview(),this.initLengthIndicator(),rankMathAdmin.variableInserter(!1)}},{key:"wrapInGroup",value:function(){this.serpTitle.wrap('<div class="group"></div>'),this.serpPermalink.wrap('<div class="group"></div>'),this.serpDescription.wrap('<div class="group"></div>'),(0,i.default)(".cmb2-id-rank-math-title").insertAfter(this.serpTitle),(0,i.default)(".cmb2-id-rank-math-permalink").insertAfter(this.serpPermalink),(0,i.default)(".cmb2-id-rank-math-description").insertAfter(this.serpDescription),(0,i.default)(".group",this.serpWrapper).prepend('<span class="dashicons dashicons-no-alt serp-close"></span>')}},{key:"initLengthIndicator",value:function(){this.serpTitleField.lengthIndicator({minLength:15,maxLength:60,source:this.serpTitle}),this.serpPermalinkField.lengthIndicator({minLength:5,maxLength:75,source:this.serpPermalink}),this.serpDescriptionField.lengthIndicator({minLength:80,maxLength:160,source:this.serpDescription})}},{key:"serpEvents",value:function(){var e=this,t=this.elemMetabox.find(".rank-math-select-device");t.on("click",function(n){n.preventDefault();var r,o=(0,i.default)(n.currentTarget),a=o.hasClass("active");r=function(t){switch(t){case"desktop-preview":e.serpWrapper.removeClass("mobile-preview"),e.serpWrapper.addClass("desktop-preview expanded-preview");break;case"mobile-preview":e.serpWrapper.removeClass("desktop-preview"),e.serpWrapper.addClass("mobile-preview expanded-preview");break;default:e.serpWrapper.removeClass("mobile-preview expanded-preview"),e.serpWrapper.addClass("desktop-preview")}},t.removeClass("active"),a?r("normal"):o.hasClass("device-desktop")?(r("desktop-preview"),o.addClass("active")):o.hasClass("device-mobile")&&(r("mobile-preview"),o.addClass("active"))});var n=!0,r=this.elemMetabox.find(".rank-math-edit-snippet");this.elemMetabox.on("click",".rank-math-edit-snippet",function(t){t.preventDefault(),r.toggleClass("hidden active"),e.desktopSnippet.toggle();var i={type:"click",isHidden:n=!n};e.serpTitle.trigger(i),e.serpPermalink.trigger(i),e.serpDescription.trigger(i)}),this.elemMetabox.on("click",".serp-title, .serp-url, .serp-description, .serp-close",function(t){t.preventDefault();var o=(0,i.default)(t.target).parent();"isHidden"in t?o.toggleClass("active",!t.isHidden):(o.toggleClass("active"),0===e.serpWrapper.find(".group.active").length&&r.hasClass("active")&&(n=!n,r.toggleClass("hidden active")),3!==e.serpWrapper.find(".group.active").length||r.hasClass("active")||(n=!1,r.toggleClass("hidden active")))});var o=(0,i.default)("#rank_math_robots2");o.on("change",function(){o.is(":checked")?e.serpWrapper.addClass("noindex-preview"):e.serpWrapper.removeClass("noindex-preview")}).trigger("change"),(0,i.default)("textarea[data-autoresize]").each(function(){var e=(0,i.default)(this);e.on("keyup input",function(){e.css("height","auto").css("height",e.prop("scrollHeight"))})})}},{key:"updateEvents",value:function(){var e=this;this.serpTitleField.on("input",(0,c.default)(function(){e.updateTitlePreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemTitle.on("input",(0,c.default)(function(){e.setVariable("title",e.elemTitle.val()),e.setVariable("term",e.elemTitle.val()),e.setVariable("author",e.elemTitle.val()),e.setVariable("name",e.elemTitle.val()),e.updateTitlePreview()},500)),this.serpPermalinkField.val(this.serpPermalinkField.val()||this.elemSlug.val()).on("input",(0,c.default)(function(){var t=decodeURIComponent(e.serpPermalinkField.val());e.updateSlug(t),e.updatePermalinkPreview()},500)).on("blur",function(){var t=(0,s.default)(e.serpPermalinkField.val());e.updateSlug(t)}).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemSlug.on("input",(0,c.default)(function(){e.serpPermalinkField.val(e.elemSlug.val()).trigger("input")},500)),this.serpDescriptionField.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemDescription.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500))}},{key:"updateSlug",value:function(e){this.serpPermalinkField.val(e),this.elemSlug.val(e)}},{key:"seoAssessments",value:function(e){if(!1!==this.shouldAssess){var t=null;"title"===e?t=this.assessor.assessTitle(this.title):"permalink"===e?t=this.assessor.assessPermalink(this.permalink):"description"===e?(this.assessor.paper.setDescription(this.description),t=this.assessor.assessFocusKeyword(this.focusKeywords.getFocusKeyword())):"content"===e&&(t=this.assessor.assessContent(this.description)),this.setKeywordStatus(t)}}},{key:"seoTitleAssessments",value:function(){this.seoAssessments("title")}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessments("permalink")}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessments("description")}},{key:"seoContentAssessments",value:function(){this.seoAssessments("content")}},{key:"seoAssessAll",value:function(){if(!1!==this.shouldAssess){this.assessor.paper.setTitle(this.title),this.assessor.paper.setPermalink(this.permalink),this.assessor.paper.setKeyword(this.focusKeywords.getFocusKeyword().keyword),this.assessor.paper.setDescription(this.description);var e=this.assessor.runAll();this.setKeywordStatus(e)}}},{key:"setKeywordStatus",value:function(e){if(!1!==this.analyzeOnPage){var t=this.focusKeywords.getFocusKeyword();if(t.isPrimary||void 0===t.elem)this.checkList.elem.show(),this.checkList.display(e);else{var n={keywordDensity:e.keywordDensity,keywordInContent:e.keywordInContent,keywordInSubheadings:e.keywordInSubheadings};"post"!==rankMath.objectType&&this.checkList.elem.hide(),this.checkList.hidePrimary(),this.checkList.display(n),this.checkList.setSecondaryKeywordStatus(n,t.elem),delete e.keywordDensity,delete e.keywordInContent,delete e.keywordInSubheadings,delete this.primaryResult.keywordInTitle,delete this.primaryResult.keywordInMetaDescription,delete this.primaryResult.keywordInPermalink,delete this.primaryResult.keywordIn10Content,delete this.primaryResult.keywordInImageAlt,delete this.primaryResult.keywordNotUsed,delete this.primaryResult.titleStartWithKeyword}this.primaryResult=i.default.extend({},this.primaryResult,e),this.checkList.setPrimaryKeywordStatus(this.primaryResult,this.focusKeywords.elem.next().find(">li:not(.placeholder)").eq(1))}}},{key:"updatePreview",value:function(){this.updateTitlePreview(),this.updatePermalinkPreview(),this.updateDescriptionPreview(),this.shouldAssess=this.analyzeOnPage,this.seoAssessAll(),this.focusKeywords.elem.trigger("content-loaded"),this.updateFocusKeywords()}},{key:"updateFocusKeywords",value:function(){var e=this.focusKeywords.getFocusKeyword().keyword;if(""!==e&&(this.setVariable("focuskw",e),this.serpBg.val(e)),this.focusKeywords.getFocusKeyword().isPrimary){this.shouldAssess=!1,this.updateDescriptionPreview(),this.shouldAssess=!0,this.seoFocusKeywordAssessments(),this.highlightKeywords(),this.updatePreviewCallbacks("description",this.description),this.updatePreviewCallbacks("focus-keyword",e);var t=(0,i.default)(".focus-keyword-link");t.length&&""!==e&&t.attr("href",t.attr("href").replace("%focus_keyword%",e).replace("%post_type%",rankMath.objectType).replace("%taxonomy%",rankMath.objectType))}else this.seoFocusKeywordAssessments()}},{key:"updateTitlePreview",value:function(){this.title=this.serpTitleField.val();var e=""!==this.title;this.title=this.swapVars(""!==this.title?this.title:this.serpTitle.data("format")),this.serpTitle.html(this.title),this.serpTitleField.attr("placeholder",e?this.title:this.serpTitle.data("format")),this.socialFields.facebookTitleField.attr("placeholder",this.title),this.socialFields.twitterTitleField.attr("placeholder",this.title),this.seoTitleAssessments(),this.highlightKeywords(this.serpTitle),this.updatePreviewCallbacks("title",this.title),this.serpTitle.trigger("rank-math-vars-replaced")}},{key:"updatePermalinkPreview",value:function(){var e=this.serpPermalink.data("format")||"",t=(0,s.default)(this.serpPermalinkField.val());this.permalink=""!==t?e.replace(/%(postname|pagename)%/,t).trimRight("/")+"/":"",this.serpCanonical.attr("placeholder",this.permalink),this.serpPermalink.html(this.permalink),this.seoPermalinkAssessments(),this.highlightKeywords(this.serpPermalink),this.updatePreviewCallbacks("permalink",this.permalink),this.serpPermalink.trigger("rank-math-vars-replaced")}},{key:"updateDescriptionPreview",value:function(){this.description=this.swapVars(this.getDescription()),this.serpDescription.html(this.description),this.serpDescriptionField.attr("placeholder",""!==this.description?this.description:this.serpDescription.data("format"));var e=this.getDescriptionTruncated(this.description,300);this.socialFields.facebookDescriptionField.attr("placeholder",e),this.socialFields.twitterDescriptionField.attr("placeholder",e),this.seoContentAssessments(),this.highlightKeywords(this.serpDescription),this.updatePreviewCallbacks("description",this.description),this.serpDescription.trigger("rank-math-vars-replaced")}},{key:"updatePreviewCallbacks",value:function(e,t){this.elemMetabox.trigger("rank-math-updating-preview-"+(e=e||"global")),this.elemMetabox.trigger("rank-math-"+e+"-updated",t)}},{key:"highlightKeywords",value:function(e){var t=this.focusKeywords.getFocusKeyword().keyword;!1!==t&&(e?(e.hasClass("serp-url")&&(t=this.assessor.paper.get("keywordPermalink")),e.rankMathUnhighlight(),e.rankMathHighlight(t)):(this.serpTitle.rankMathUnhighlight(),this.serpTitle.rankMathHighlight(t),this.serpPermalink.rankMathUnhighlight(),this.serpPermalink.rankMathHighlight(this.assessor.paper.get("keywordPermalink")),this.serpDescription.rankMathUnhighlight(),this.serpDescription.rankMathHighlight(t)))}},{key:"swapVars",value:function(e,t){var n=this;return(e=e||"")?(t=t||this.getMapObj(),(e=e.replace(" %page%","").replace("%sep% %sep%","%sep%")).replace(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/giu,function(e){var r=e.toLowerCase().replace(/%+/g,"");return["title","post_title","term","author","name"].includes(r)?n.isGutenbergAvailable?t.title:n.elemTitle.val():["description","tag_description","category_description","cat_description","author_description","user_description"].includes(r)?(0,i.default)("#description").val():["fk","focuskeyword","focuskw"].includes(r)?n.focusKeywords.getFocusKeyword().keyword:r.includes("customfield(")?(r=r.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[r]:"":(r.includes("(")&&(r=r.split("(")[0]),r in t?t[r]:r)}).trim()):""}},{key:"getMapObj",value:function(){var e=this;return null!==this.variableMap?this.variableMap:(this.variableMap={},i.default.each(rankMath.variables,function(t,n){t=t.toLowerCase().replace(/%+/g,"").split("(")[0],e.variableMap[t]=n.example}),this.variableMap)}},{key:"setVariable",value:function(e,t){null!==this.variableMap?this.variableMap[e]=t:void 0!==rankMath.variables[e]&&(rankMath.variables[e].example=t)}},{key:"getContent",value:function(){return this.assessor.paper.get("content")}},{key:"getDescription",value:function(){this.assessor.refreshContent();var e=this.getExcerpt(),t=this.serpDescriptionField.val();if(""!==t)return(0,h.default)(t);if(!(0,a.default)(e)&&""!==e)return(0,h.default)(e);var n=this.serpDescription.data("format"),r=this.generateDescriptionFromContent(this.getContent());return this.setVariable("excerpt",r),(0,a.default)(n)||""===n?r:(0,h.default)(n)}},{key:"getExcerpt",value:function(){if(this.isGutenbergAvailable)return"";var e=this.elemDescription.val();return this.setVariable("excerpt",e),this.setVariable("excerpt_only",e),this.setVariable("wc_shortdesc",e),e}},{key:"generateDescriptionFromContent",value:function(e){if(""===e)return"";var t=this.focusKeywords.getFocusKeyword().keyword,n=(0,o.default)((0,v.default)(e,!0),function(e){return""!==i.default.trim(e)});if(!n.length)return"";if(""!==t){var r=(0,o.default)(n,function(e){return(0,u.default)(e.toLowerCase(),t)});if(r.length>0)return this.getDescriptionTruncated(r[0],160)}return this.getDescriptionTruncated(n[0],160)}},{key:"getDescriptionTruncated",value:function(e,t){return t?this.truncate(e.replace(/\r?\n|\r/g," "),t):e.replace(/\r?\n|\r/g," ")}},{key:"truncate",value:function(e,t){return e.length>t?e.substring(0,t):e}}]),e}();t.default=m},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=u(n(5)),o=u(n(235)),a=u(n(62)),s=u(n(221));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return(0,i.default)(".rank-math-term-description-wrap").prev().remove(),e.elemMetabox=(0,i.default)("#cmb2-metabox-rank_math_metabox"),e.elemSlug=(0,i.default)("#slug"),e.elemTitle=(0,i.default)("#name"),e.elemDescription=(0,i.default)("#rank_math_description"),e.elemContent=null,e.researches={keywordInTitle:!0,keywordInMetaDescription:!0,keywordInPermalink:!0,titleStartWithKeyword:!0,keywordNotUsed:!0},e.researches=(0,s.default)(e.researches,Object.keys(rankMath.assessor.researchesTests)),e.init(),e.analyzeOnPage&&(e.elemDescription.on("input change",(0,a.default)(function(){e.updateDescriptionPreview(),e.socialFields.updateThumbnailPreview()},500)),(0,i.default)(window).on("load",function(){!e.isGutenbergAvailable&&"undefined"!=typeof tinymce&&tinymce.activeEditor&&tinyMCE.editors.rank_math_description.on("keyup change",(0,a.default)(function(t){e.updateDescriptionPreview(),e.socialFields.updateThumbnailPreview()},500))})),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),r(t,[{key:"seoTitleAssessments",value:function(){this.seoAssessAll()}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessAll()}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessAll()}},{key:"seoContentAssessments",value:function(){this.seoAssessAll()}},{key:"getExcerpt",value:function(){if(this.isGutenbergAvailable)return this.getMapObj().excerpt;var e="undefined"!=typeof tinymce&&tinymce.activeEditor&&"rank_math_description"===tinymce.activeEditor.id?tinymce.activeEditor.getContent():this.elemDescription.val();return this.setVariable("excerpt",e),this.setVariable("excerpt_only",e),this.setVariable("wc_shortdesc",e),e}}]),t}();(0,i.default)(function(){new c})}]);
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=352)}([function(e,t){e.exports=Array.isArray},function(e,t,n){var r=n(75)("wks"),i=n(40),o=n(2).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(11),i=n(41);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=!n(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=jQuery},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(70)("wks"),i=n(71),o=n(6).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(34),i=n(68);e.exports=n(20)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(12),i=n(77),o=n(79),a=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(2),i=n(3),o=n(14),a=n(40)("src"),s=Function.toString,u=(""+s).split("toString");n(39).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(t+""))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return e}},,function(e,t,n){var r=n(89);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports={}},function(e,t,n){var r=n(35);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(36)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(181),i=n(43);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(0),i=n(30),o=n(130),a=n(60);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(96),i=n(54);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},,function(e,t,n){var r=n(109),i=n(112)(r);e.exports=i},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(0),i=n(129),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(52),i=n(26),o=n(105),a=n(140),s=n(141),u=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:s(e),n=n&&!c?a(n):0;var l=e.length;return 0>n&&(n=u(l+n,0)),o(e)?l>=n&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},function(e,t,n){var r=n(156),i=n(33);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(19),i=n(159),o=n(160),a=Object.defineProperty;t.f=n(20)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(70)("keys"),i=n(71);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(75)("keys"),i=n(40);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){"use strict";var r=n(3),i=n(13),o=n(22),a=n(43),s=n(1);e.exports=function(e,t,n){var u=s(e),c=n(a,u,""[e]),l=c[0],f=c[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,l),r(RegExp.prototype,u,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(113),i=n(127),o=n(104),a=n(0),s=n(133);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(25),i=n(15);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&o>n;)e=e[i(t[n++])];return n&&n==o?e:void 0}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"\n")}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&9007199254740991>=e}},function(e,t,n){var r=n(115),i=n(116),o=n(117),a=n(118),s=n(119);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(120),i=n(57);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(24);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){var r=n(24),i=n(211),o=n(144),a=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,f,p,d,h=0,v=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,h=t,f=e.apply(r,n)}function k(e){var n=e-d;return void 0===d||n>=t||0>n||g&&e-h>=l}function b(){var e=i();if(k(e))return w(e);p=setTimeout(b,function(e){var n=t-(e-d);return g?s(n,l-(e-h)):n}(e))}function w(e){return p=void 0,m&&u?y(e):(u=c=void 0,f)}function x(){var e=i(),n=k(e);if(u=arguments,c=this,d=e,n){if(void 0===p)return function(e){return h=e,p=setTimeout(b,t),v?y(e):f}(d);if(g)return p=setTimeout(b,t),y(d)}return void 0===p&&(p=setTimeout(b,t)),f}return t=o(t)||0,r(n)&&(v=!!n.leading,l=(g="maxWait"in n)?a(o(n.maxWait)||0,t):l,m="trailing"in n?!!n.trailing:m),x.cancel=function(){void 0!==p&&clearTimeout(p),h=0,u=d=c=p=void 0},x.flush=function(){return void 0===p?f:w(i())},x}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(65),i=n(66),o=n(161),a=n(10),s=n(18),u=n(162),c=n(73),l=n(170),f=n(8)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,g,m){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in P)return P[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,O=!1,P=e.prototype,T=P[f]||P["@@iterator"]||v&&P[v],C=T||w(v),S=v?_?w("entries"):C:void 0,j="Array"==t&&P.entries||T;if(j&&(b=l(j.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||a(b,f,d)),_&&T&&"values"!==T.name&&(O=!0,C=function(){return T.call(this)}),r&&!m||!p&&!O&&P[f]||a(P,f,C),s[t]=C,s[x]=d,v)if(y={values:_?C:w("values"),keys:g?C:w("keys"),entries:S},m)for(k in y)k in P||o(P,k,y[k]);else i(i.P+i.F*(p||O),t,y);return y}},function(e,t){e.exports=!0},function(e,t,n){var r=n(6),i=n(7),o=n(157),a=n(10),s=n(21),u=function(e,t,n){var c,l,f,p=e&u.F,d=e&u.G,h=e&u.S,v=e&u.P,g=e&u.B,m=e&u.W,y=d?i:i[t]||(i[t]={}),k=y.prototype,b=d?r:h?r[t]:(r[t]||{}).prototype;for(c in d&&(n=t),n)(l=!p&&b&&void 0!==b[c])&&s(y,c)||(f=l?b[c]:n[c],y[c]=d&&"function"!=typeof b[c]?n[c]:g&&l?o(f,r):m&&b[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?o(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[c]=f,e&u.R&&k&&!k[c]&&a(k,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(35),i=n(6).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(165),i=n(72);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(7),i=n(6),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(65)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(34).f,i=n(21),o=n(8)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(33);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(39),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(76)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t,n){e.exports=!n(4)&&!n(22)(function(){return 7!=Object.defineProperty(n(78)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9),i=n(2).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(184);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(83),i=n(45);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(14),i=n(23),o=n(188)(!1),a=n(44)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(11).f,i=n(14),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(9),i=n(80),o=n(1)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(148),i=n(149),o=n(176);e.exports=function(e,t){return r(e)||i(e,t)||o()}},function(e,t,n){e.exports=n(196)},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(132),i=n(102);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&t>e}},function(e,t){e.exports=function(e){return void 0===e}},function(e,t,n){var r=n(107),i=n(108),o=n(47),a=n(0);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},function(e,t,n){var r=n(61),i=n(47),o=n(146),a=n(0);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,"").replace(i,"")};var r=/\[[^<>&\/\[\] - =]+?( [^\]]+?)?\]/g,i=/\[\/[^<>&\/\[\] - =]+?\]/g},function(e,t,n){var r=n(53),i=n(24);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(0);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return r(e)?e:[e]}},function(e,t,n){var r=n(52);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(25),i=n(103),o=n(0),a=n(91),s=n(54),u=n(15);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(o(e)||i(e))}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(53),i=n(0),o=n(57);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},,function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},function(e,t,n){var r=n(28);e.exports=function(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}},function(e,t,n){var r=n(110),i=n(29);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(111)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},function(e,t,n){var r=n(26);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},function(e,t,n){var r=n(114),i=n(126),o=n(59);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(55),i=n(56);e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=n[a])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(o)var h=o(f,p,l,e,t,d);if(!(void 0===h?i(p,f,3,o,d):h))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(17),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return n>=0&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(17);e.exports=function(e){var t=this.__data__,n=r(t,e);return 0>n?void 0:t[n][1]}},function(e,t,n){var r=n(17);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(17);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return 0>i?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(55),i=n(121),o=n(123),a=n(124),s=n(99),u=n(0),c=n(100),l=n(101),f="[object Arguments]",p="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,m){var y=u(e),k=u(t),b=y?p:s(e),w=k?p:s(t),x=(b=b==f?d:b)==d,_=(w=w==f?d:w)==d,O=b==w;if(O&&c(e)){if(!c(t))return!1;y=!0,x=!1}if(O&&!x)return m||(m=new r),y||l(e)?i(e,t,n,v,g,m):o(e,t,b,n,v,g,m);if(!(1&n)){var P=x&&h.call(e,"__wrapped__"),T=_&&h.call(t,"__wrapped__");if(P||T){var C=P?e.value():e,S=T?t.value():t;return m||(m=new r),g(C,S,n,v,m)}}return!!O&&(m||(m=new r),a(e,t,n,v,g,m))}},function(e,t,n){var r=n(97),i=n(122),o=n(98);e.exports=function(e,t,n,a,s,u){var c=1&n,l=e.length,f=t.length;if(!(l==f||c&&f>l))return!1;var p=u.get(e);if(p&&u.get(t))return p==t;var d=-1,h=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++d<l;){var g=e[d],m=t[d];if(a)var y=c?a(m,g,d,t,e,u):a(g,m,d,e,t,u);if(void 0!==y){if(y)continue;h=!1;break}if(v){if(!i(t,function(e,t){if(!o(v,t)&&(g===e||s(g,e,n,a,u)))return v.push(t)})){h=!1;break}}else if(g!==m&&!s(g,m,n,a,u)){h=!1;break}}return u.delete(e),u.delete(t),h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(125),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var d=s.get(e);if(d&&s.get(t))return d==t;var h=!0;s.set(e,t),s.set(t,e);for(var v=u;++f<l;){var g=e[p=c[f]],m=t[p];if(o)var y=u?o(m,g,p,t,e,s):o(g,m,p,e,t,s);if(!(void 0===y?g===m||a(g,m,n,o,s):y)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var k=e.constructor,b=t.constructor;k!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof b&&b instanceof b)&&(h=!1)}return s.delete(e),s.delete(t),h}},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(58),i=n(29);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},function(e,t,n){var r=n(56),i=n(128),o=n(90),a=n(30),s=n(58),u=n(59),c=n(15);e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},function(e,t,n){var r=n(48);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=n(131)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)}),t});e.exports=o},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(134),i=n(135),o=n(30),a=n(15);e.exports=function(e){return o(e)?r(a(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(48);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(e=(0,i.default)(e)).replace(/ /gi,"-").toLowerCase()};var r,i=(r=n(137))&&r.__esModule?r:{default:r}},function(e,t,n){var r=n(138),i=n(60),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]/g;e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(a,"")}},function(e,t,n){var r=n(139)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(142),i=n(29);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){var r=n(61);e.exports=function(e,t){return r(t,function(t){return e[t]})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=u((0,i.autop)((0,a.default)(e)),t);return n.length>0?n:[e]};var r=s(n(94)),i=n(147),o=s(n(50)),a=s(n(95));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t){var n=[];t=t||!1;for(var i=/<p(?:[^>]+)?>(.*?)<\/p>/gi,a=void 0;null!==(a=i.exec(e));)n.push(a);return(0,r.default)(n,function(e){return t?(0,o.default)(e[1]):e[1]})}},function(e,t,n){var r=n(28),i=n(26);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,function(e,r,i){o[++n]=t(e,r,i)}),o}},function(e,t,n){"use strict";n.r(t),n.d(t,"autop",function(){return c}),n.d(t,"removep",function(){return l});var r=n(87),i=n.n(r),o=(n(177),n(194),n(195),n(88)),a=n.n(o),s=(n(199),n(200),/(<((?=!--|!\[CDATA\[)((?=!-)!(?:-(?!->)[^\-]*)*(?:-->)?|!\[CDATA\[[^\]]*(?:](?!]>)[^\]]*)*?(?:]]>)?)|[^>]*>?))/);function u(e,t){for(var n=function(e){for(var t,n=[],r=e;t=r.match(s);)n.push(r.slice(0,t.index)),n.push(t[0]),r=r.slice(t.index+t[0].length);return r.length&&n.push(r),n}(e),r=!1,i=a()(t),o=1;n.length>o;o+=2)for(var u=0;i.length>u;u++){var c=i[u];if(-1!==n[o].indexOf(c)){n[o]=n[o].replace(RegExp(c,"g"),t[c]),r=!0;break}}return r&&(e=n.join("")),e}function c(e){var t=1>=arguments.length||void 0===arguments[1]||arguments[1],n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){var r=e.split("</pre>"),o=r.pop();e="";for(var a=0;r.length>a;a++){var s=r[a],c=s.indexOf("<pre");if(-1!==c){var l="<pre wp-pre-tag-"+a+"></pre>";n.push([l,s.substr(c)+"</pre>"]),e+=s.substr(0,c)+l}else e+=s}e+=o}var f="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=u(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(RegExp("(<"+f+"[s/>])","g"),"\n\n$1")).replace(RegExp("(</"+f+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));var p=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",p.forEach(function(t){e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)","g"),"$1")).replace(RegExp("(</?"+f+"[^>]*>)s*</p>","g"),"$1"),t&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,function(e){return e[0].replace(/\n/g,"<WPPreserveNewline />")})).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,function(e,t){return t?e:"<br />\n"})).replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(RegExp("(</?"+f+"[^>]*>)s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach(function(t){var n=i()(t,2);e=e.replace(n[0],n[1])}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}function l(e){var t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",r=t+"|pre",i=[],o=!1,a=!1;return e?(-1===e.indexOf("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(e){return i.push(e),"<wp-preserve>"})),-1!==e.indexOf("<pre")&&(o=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(e){return(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")})),-1!==e.indexOf("[caption")&&(a=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(RegExp("\\s*</("+n+")>\\s*","g"),"</$1>\n")).replace(RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,function(e,t){return t&&-1!==t.indexOf("\n")?"\n\n":"\n"})).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(RegExp("\\s*</("+r+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(/<wp-line-break>/g,"\n")),a&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),i.length&&(e=e.replace(/<wp-preserve>/g,function(){return i.shift()})),e):""}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t,n){var r=n(150);e.exports=function(e,t){var n=[],i=!0,o=!1,a=void 0;try{for(var s,u=r(e);!(i=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return n}},function(e,t,n){e.exports=n(151)},function(e,t,n){n(152),n(171),e.exports=n(173)},function(e,t,n){n(153);for(var r=n(6),i=n(10),o=n(18),a=n(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;s.length>u;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[a]&&i(f,a,c),o[c]=o.Array}},function(e,t,n){"use strict";var r=n(154),i=n(155),o=n(18),a=n(32);e.exports=n(64)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(63);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(158);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=!n(20)&&!n(36)(function(){return 7!=Object.defineProperty(n(67)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(35);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";var r=n(163),i=n(68),o=n(73),a={};n(10)(a,n(8)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(19),i=n(164),o=n(72),a=n(38)("IE_PROTO"),s=function(){},u=function(){var e,t=n(67)("iframe"),r=o.length;for(t.style.display="none",n(169).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(34),i=n(19),o=n(69);e.exports=n(20)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(21),i=n(32),o=n(166)(!1),a=n(38)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(32),i=n(167),o=n(168);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(37),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(37),i=Math.max,o=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(6).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(21),i=n(74),o=n(38)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";var r=n(172)(!0);n(64)(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return t.length>n?(e=r(t,n),this._i+=e.length,{value:e,done:!1}):{value:void 0,done:!0}})},function(e,t,n){var r=n(37),i=n(33);e.exports=function(e){return function(t,n){var o,a,s=i(t)+"",u=r(n),c=s.length;return 0>u||u>=c?e?"":void 0:55296>(o=s.charCodeAt(u))||o>56319||u+1===c||56320>(a=s.charCodeAt(u+1))||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){var r=n(19),i=n(174);e.exports=n(7).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){var r=n(175),i=n(8)("iterator"),o=n(18);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(63),i=n(8)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){for(var r=n(178),i=n(82),o=n(13),a=n(2),s=n(3),u=n(42),c=n(1),l=c("iterator"),f=c("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(d),v=0;h.length>v;v++){var g,m=h[v],y=d[m],k=a[m],b=k&&k.prototype;if(b&&(b[l]||s(b,l,p),b[f]||s(b,f,m),u[m]=p,y))for(g in r)b[g]||o(b,g,r[g],!0)}},function(e,t,n){"use strict";var r=n(179),i=n(180),o=n(42),a=n(23);e.exports=n(182)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(1)("unscopables"),i=Array.prototype;null==i[r]&&n(3)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(80);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";var r=n(76),i=n(183),o=n(13),a=n(3),s=n(42),u=n(185),c=n(85),l=n(192),f=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,g,m){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in P)return P[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,O=!1,P=e.prototype,T=P[f]||P["@@iterator"]||v&&P[v],C=T||w(v),S=v?_?w("entries"):C:void 0,j="Array"==t&&P.entries||T;if(j&&(b=l(j.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||a(b,f,d)),_&&T&&"values"!==T.name&&(O=!0,C=function(){return T.call(this)}),r&&!m||!p&&!O&&P[f]||a(P,f,C),s[t]=C,s[x]=d,v)if(y={values:_?C:w("values"),keys:g?C:w("keys"),entries:S},m)for(k in y)k in P||o(P,k,y[k]);else i(i.P+i.F*(p||O),t,y);return y}},function(e,t,n){var r=n(2),i=n(39),o=n(3),a=n(13),s=n(81),u=function(e,t,n){var c,l,f,p,d=e&u.F,h=e&u.G,v=e&u.P,g=e&u.B,m=h?r:e&u.S?r[t]||(r[t]={}):(r[t]||{}).prototype,y=h?i:i[t]||(i[t]={}),k=y.prototype||(y.prototype={});for(c in h&&(n=t),n)f=((l=!d&&m&&void 0!==m[c])?m:n)[c],p=g&&l?s(f,r):v&&"function"==typeof f?s(Function.call,f):f,m&&a(m,c,f,e&u.U),y[c]!=f&&o(y,c,p),v&&k[c]!=f&&(k[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var r=n(186),i=n(41),o=n(85),a={};n(3)(a,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(12),i=n(187),o=n(45),a=n(44)("IE_PROTO"),s=function(){},u=function(){var e,t=n(78)("iframe"),r=o.length;for(t.style.display="none",n(191).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(11),i=n(12),o=n(82);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(23),i=n(189),o=n(190);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(84),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(84),i=Math.max,o=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(14),i=n(193),o=n(44)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(43);e.exports=function(e){return Object(r(e))}},function(e,t,n){n(46)("split",2,function(e,t,r){"use strict";var i=n(86),o=r,a=[].push;if("".split(/.?/).length){var s=void 0===/()??/.exec("")[1];r=function(e,t){var n=this+"";if(void 0===e&&0===t)return[];if(!i(e))return o.call(n,e,t);var r,u,c,l,f,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,g=RegExp(e.source,d+"g");for(s||(r=RegExp("^"+g.source+"$(?!\\s)",d));(u=g.exec(n))&&((c=u.index+u[0].length)<=h||(p.push(n.slice(h,u.index)),!s&&u.length>1&&u[0].replace(r,function(){for(f=1;arguments.length-2>f;f++)void 0===arguments[f]&&(u[f]=void 0)}),u.length>1&&n.length>u.index&&a.apply(p,u.slice(1)),l=u[0].length,h=c,v>p.length));)g.lastIndex===u.index&&g.lastIndex++;return h===n.length?!l&&g.test("")||p.push(""):p.push(n.slice(h)),p.length>v?p.slice(0,v):p}}return[function(n,i){var o=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(o+"",n,i)},r]})},function(e,t,n){n(46)("replace",2,function(e,t,n){return[function(r,i){"use strict";var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(o+"",r,i)},n]})},function(e,t,n){n(197),e.exports=n(7).Object.keys},function(e,t,n){var r=n(74),i=n(69);n(198)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(66),i=n(7),o=n(36);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t,n){n(46)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):RegExp(n)[t](r+"")},n]})},function(e,t,n){var r=n(2),i=n(201),o=n(11).f,a=n(205).f,s=n(86),u=n(206),c=r.RegExp,l=c,f=c.prototype,p=/a/g,d=/a/g,h=new c(p)!==p;if(n(4)&&(!h||n(22)(function(){return d[n(1)("match")]=!1,c(p)!=p||c(d)==d||"/a/i"!=c(p,"i")}))){c=function(e,t){var n=this instanceof c,r=s(e),o=void 0===t;return!n&&r&&e.constructor===c&&o?e:i(h?new l(r&&!o?e.source:e,t):l((r=e instanceof c)?e.source:e,r&&o?u.call(e):t),n?this:f,c)};for(var v=function(e){e in c||o(c,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})},g=a(l),m=0;g.length>m;)v(g[m++]);f.constructor=c,c.prototype=f,n(13)(r,"RegExp",c)}n(207)("RegExp")},function(e,t,n){var r=n(9),i=n(202).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t,n){var r=n(9),i=n(12),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(81)(Function.call,n(203).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){var r=n(204),i=n(41),o=n(23),a=n(79),s=n(14),u=n(77),c=Object.getOwnPropertyDescriptor;t.f=n(4)?c:function(e,t){if(e=o(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(83),i=n(45).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";var r=n(12);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(2),i=n(11),o=n(4),a=n(1)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r};i.default.extend({rankMathHighlight:function(e,t,n,r){if(3===e.nodeType){var o=e.data.match(t);if(o){var a=document.createElement(n||"span");a.className=r||"highlight";var s=e.splitText(o.index);s.splitText(o[0].length);var u=s.cloneNode(!0);return a.appendChild(u),s.parentNode.replaceChild(a,s),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==r))for(var c=0;e.childNodes.length>c;c++)c+=i.default.rankMathHighlight(e.childNodes[c],t,n,r);return 0}}),i.default.fn.rankMathUnhighlight=function(e){var t={className:"highlight",element:"span"};return i.default.extend(t,e),this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()},i.default.fn.rankMathHighlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(i.default.extend(n,t),void 0===e||""===e)return this;if(e.constructor===String&&(e=[e]),e=i.default.grep(e,function(e){return""!==e}),0===(e=i.default.map(e,function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")})).length)return this;var r=n.caseSensitive?"":"i",o="("+e.join("|")+")";n.wordsOnly&&(o="\\b"+o+"\\b");var a=RegExp(o,r);return this.each(function(){i.default.rankMathHighlight(this,a,n.element,n.className)})}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r},o=document.createElement("div");i.default.fn.lengthIndicator=function(e){var t=this;e=i.default.extend({},{minLength:0,maxLength:1e3,source:null},e),t.wrap('<span class="length-indicator-wrapper"/>'),t.parent().append('<span class="length-indicator"><span/></span><span class="length-count">0 / '+e.maxLength+"</span>");var n=t.parent().find(".length-indicator"),r=n.find(">span"),a=t.parent().find(".length-count"),s=function(){var i=function(e){return e&&"string"==typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),o.innerHTML=e,e=o.textContent,o.textContent=""),e}(null===e.source?t.val():e.source.text()).length;n.removeClass("invalid short"),r.css("left",Math.min(100,Math.floor(i/e.maxLength*100))+"%"),a.text(i+" / "+e.maxLength),i>e.minLength&&e.maxLength>=i||n.addClass("invalid")};t.on("input",s),null!==e.source&&e.source.on("rank-math-vars-replaced",s),s()}},function(e,t,n){var r=n(212);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(213),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){var r;r=n(143),e.exports="object"==typeof r&&r&&r.Object===Object&&r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(215));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank-math-serp-checklist",t.elemMetabox),this.scoreElem=(0,i.default)('<div class="misc-pub-section rank-math-seo-score"><span class="score-text"><span class="dashicons dashicons-chart-area"></span> SEO: <strong>Not available</strong></span></div>'),this.scoreText=this.scoreElem.find("strong"),this.scoreField=(0,i.default)("#rank_math_seo_score"),this.fkScoreElem=(0,i.default)('<div class="rank-math-seo-score below-focus-keyword"><span class="score-text">Not available</span></div>'),this.fkScoreText=this.fkScoreElem.find("span"),(0,i.default)("#misc-publishing-actions").append(this.scoreElem),(0,i.default)(".cmb-td",".cmb2-id-rank-math-focus-keyword").append(this.fkScoreElem),this.events()}return r(e,[{key:"display",value:function(e){var t=this;i.default.each(e,function(e,n){var r=t.elem.find(".seo-check-"+e);r.removeClass("test-ok test-gallery test-fail test-empty test-looking veryEasy difficult veryDifficult"),r.addClass("test-"+n.status),r.show(),"calculateFleschReading"===e&&r.addClass(n.factors[2]),r.find("span:eq(0)").html(n.message)})}},{key:"setPrimaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,o.default)(e,function(e,t,n){return!1===t&&(t={score:0}),e+t.score},0);status="bad-fk",n>80?status="good-fk":n>50&&(status="ok-fk"),t.removeClass("bad-fk ok-fk good-fk"),this.scoreElem.removeClass("bad-fk ok-fk good-fk"),this.fkScoreElem.removeClass("bad-fk ok-fk good-fk"),t.addClass(status),this.scoreElem.addClass(status),this.fkScoreElem.addClass(status),this.scoreText.html(n+" / 100"),this.fkScoreText.html(n+" / 100"),this.scoreField.val(parseInt(n))}},{key:"setSecondaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,o.default)(e,function(e,t){return e+("ok"===t.status?1:0)},0);t.addClass(3===n?"good-fk":2===n?"ok-fk":"bad-fk")}},{key:"hidePrimary",value:function(){this.elem.find("li.is-primary").hide()}},{key:"events",value:function(){var e=this;this.elem.on("click",".group-handle",function(t){t.preventDefault();var n=(0,i.default)(t.target).closest(".rank-math-serp-group"),r={};n.toggleClass("state-open state-closed"),e.updateGroupStatus(n),e.elem.find(">.rank-math-serp-group").each(function(){var e=(0,i.default)(this);r[e.data("id")]=e.hasClass("state-closed")?"closed":"open"}),i.default.ajax({url:rankMath.ajaxurl,type:"POST",data:{action:"rank_math_save_checklist_layout",security:rankMath.security,layout:r}})})}},{key:"updateGroupStatus",value:function(e){(e=e||(0,i.default)(".rank-math-serp-group")).each(function(){var e=(0,i.default)(this);1>e.find("li.test-fail").length&&1>e.find("li.test-empty").length?e.find(".group-status").addClass("passed"):e.find(".group-status").removeClass("passed")})}}]),e}();t.default=s},function(e,t,n){var r=n(216),i=n(28),o=n(47),a=n(217),s=n(0);e.exports=function(e,t,n){var u=s(e)?r:a,c=3>arguments.length;return u(e,o(t,4),n,c,i)}},function(e,t){e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},function(e,t){e.exports=function(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(r=n(5))&&r.__esModule?r:{default:r},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metabox=t,this.currentNetwork="facebook",this.useFacebook=!0,this.shouldUpdatePreview=!1,this.facebookTitleField=t.elemMetabox.find("#rank_math_facebook_title"),this.facebookDescriptionField=t.elemMetabox.find("#rank_math_facebook_description"),this.twitterTitleField=t.elemMetabox.find("#rank_math_twitter_title"),this.twitterDescriptionField=t.elemMetabox.find("#rank_math_twitter_description"),this.facebookImageField=t.elemMetabox.find("#rank_math_facebook_image"),this.twitterImageField=t.elemMetabox.find("#rank_math_twitter_image"),this.facebookImageStatus=t.elemMetabox.find("#rank_math_facebook_image-status"),this.twitterImageStatus=t.elemMetabox.find("#rank_math_twitter_image-status"),this.socialWrapper=t.elemMetabox.find(".rank-math-social-preview"),this.socialPreview=this.socialWrapper.find(".rank-math-social-preview-item"),this.socialTitle=this.socialWrapper.find(".rank-math-social-preview-title"),this.socialDescription=this.socialWrapper.find(".rank-math-social-preview-description"),this.events(),this.shouldUpdatePreview=!0,this.updatePreview()}return i(e,[{key:"events",value:function(){var e=this;this.facebookTitleField.on("input",function(){e.updateTitlePreview()}),this.facebookDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.facebookImageField.on("input",function(){e.updateThumbnailPreview()}),this.twitterTitleField.on("input",function(){e.updateTitlePreview()}),this.twitterDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.twitterImageField.on("input",function(){e.updateThumbnailPreview()});var t=(0,o.default)(".rank-math-social-preview-button"),n=t.find(">span");t.on("click",function(t){t.preventDefault(),n.toggleClass("dashicons-arrow-down dashicons-arrow-up"),e.updatePreview(),e.socialWrapper.toggleClass("open"),e.socialPreview.slideToggle()});var r=(0,o.default)("#rank_math_twitter_card_type");(0,o.default)(".preview-network").on("click",function(n){(0,o.default)(n.target).hasClass("tab-facebook")?t.show():r.trigger("change"),e.updatePreview()}),r.on("change",function(){var n=r.val();"player"===n&&(0,o.default)(".cmb2-id-rank-math-twitter-image, .cmb2-id-rank-math-twitter-title, .cmb2-id-rank-math-twitter-description").show();var i="player"===n||"app"===n;t.toggle(!i),(0,o.default)(".cmb2-id-rank-math-twitter-use-facebook").toggle(!i),e.updatePreview()}).trigger("change");var i=(0,o.default)("#rank_math_twitter_use_facebook2");(0,o.default)("#rank_math_twitter_use_facebook1, #rank_math_twitter_use_facebook2").on("input change",function(){e.useFacebook=i.is(":checked"),e.updatePreview()}).trigger("change"),(0,o.default)(".cmb2-id-rank-math-facebook-enable-image-overlay, .cmb2-id-rank-math-facebook-image-overlay, .cmb2-id-rank-math-twitter-enable-image-overlay, .cmb2-id-rank-math-twitter-image-overlay").on("change","input",function(){e.updateThumbnailOverlay()}),(0,o.default)(document).on("cmb_media_modal_select",function(t,n,r){"rank_math_facebook_image"!==r.field&&"rank_math_twitter_image"!==r.field||e.updateThumbnailPreview()}),(0,o.default)(document).on("cmb_init",function(t,n){n.$metabox.on("click",".cmb2-remove-file-button",function(){e.updateThumbnailPreview()})})}},{key:"updatePreview",value:function(){!1!==this.shouldUpdatePreview&&(this.currentNetwork=(0,o.default)(".preview-network.tab-active").attr("href").replace("#setting-panel-social-",""),this.socialWrapper.removeClass(),this.socialWrapper.addClass("rank-math-social-preview rank-math-social-preview-"+this.currentNetwork),"twitter"===this.currentNetwork&&this.socialWrapper.addClass((0,o.default)("#rank_math_twitter_card_type").val()),this.updateTitlePreview(),this.updateDescriptionPreview(),this.updateThumbnailPreview())}},{key:"updateTitlePreview",value:function(){var e=this[this.currentNetwork+"TitleField"].val()||this.metabox.title;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookTitleField.val()||this.metabox.title),e=this.metabox.truncate(this.metabox.swapVars(e),90),this.socialTitle.html(e)}},{key:"updateDescriptionPreview",value:function(){var e=this[this.currentNetwork+"DescriptionField"].val()||this.description;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookDescriptionField.val()||this.metabox.description),e=this.metabox.truncate(this.metabox.swapVars(e),240),this.socialDescription.html(e)}},{key:"updateThumbnailPreview",value:function(){var e=(0,o.default)("#rank_math_post_thumbnail").attr("src"),t=this.metabox.getContent(),n=!!/<img(?:[^>]+)?>/.test(t)&&(0,o.default)(t).find("img:first").attr("src"),r=this.facebookImageField.val()||e||n||rankMath.defautOgImage,i=this.twitterImageField.val()||e||n||rankMath.defautOgImage;if("twitter"===this.currentNetwork&&this.useFacebook)i=r;else if(this.twitterImageStatus.find("img.cmb-file-field-image").length){var a=this.twitterImageStatus.siblings(".notice"),s=this.twitterImageStatus.find("img.cmb-file-field-image")[0];a.addClass("hidden"),(0,o.default)(s).on("load",function(){(200>s.naturalWidth||200>s.naturalHeight)&&a.removeClass("hidden")})}var u=this.facebookImageStatus.siblings(".notice"),c=this.facebookImageStatus.find("img.cmb-file-field-image");u.addClass("hidden"),"facebook"===this.currentNetwork&&this.facebookImageField.val()&&c.length&&(0,o.default)(c[0]).on("load",function(){(200>c[0].naturalWidth||200>c[0].naturalHeight)&&u.removeClass("hidden")});var l=(0,o.default)(".rank-math-social-preview-image");(0,o.default)(".facebook-thumbnail",l).attr("src",r),(0,o.default)(".twitter-thumbnail",l).attr("src",i),l.toggleClass("no-facebook-image",!r),l.toggleClass("no-twitter-image",!i),l.parents(".rank-math-social-preview-facebook").find(".error-msg").toggleClass("show",!r),l.parents(".rank-math-social-preview-twitter").find(".error-msg").toggleClass("show",!i),this.updateThumbnailOverlay()}},{key:"updateThumbnailOverlay",value:function(){var e=(0,o.default)(".rank-math-social-preview-image-overlay"),t=(0,o.default)('[name="rank_math_'+this.currentNetwork+'_enable_image_overlay"]:checked').val(),n=(0,o.default)('[name="rank_math_'+this.currentNetwork+'_image_overlay"]:checked').val(),r=!(0,o.default)(".rank-math-social-preview-image").hasClass("no-"+this.currentNetwork+"-image");"twitter"===this.currentNetwork&&this.useFacebook&&(n=(0,o.default)('[name="rank_math_facebook_image_overlay"]:checked').val(),r=!1);var i=(0,o.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-enable-image-overlay"),a="on"===i.find("input:checked").val();i.toggle(r),i.find(".notice-warning").toggle(a),"on"===t?(e.attr("src",rankMath.overlayImages[n].url).show(),(0,o.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-image-overlay").toggle(r)):e.hide()}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(62));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank_math_focus_keyword");var r=(0,o.default)(function(){t.updateFocusKeywords()},200),a=(0,o.default)(function(e,n){var r=e.find("li:last").prev(),i=t.assessor.assessFocusKeyword({elem:r,isPrimary:!1,keyword:n});t.checkList.setSecondaryKeywordStatus(i,r)},200);this.elem.on("content-loaded",function(){var e=n.elem.next("ul"),r=n.getFocusKeywords();(0,i.default)(e).find("li:gt(1)").each(function(){var e=(0,i.default)(this),n=t.assessor.assessFocusKeyword({elem:e,isPrimary:!1,keyword:r[e.index()-1]});t.checkList.setSecondaryKeywordStatus(n,e)})}),this.elem.tagEditor({autocomplete:1===rankMath.maxTags?null:this.getAutocompleteOptions(),sortable:!0,placeholder:this.elem.attr("placeholder"),onChange:function(e,t,n){1===n.length?t.find("li:not(.placeholder)").last().addClass("selected-fk"):t.find(".selected-fk").removeClass("selected-fk"),r()},onSelect:function(e,t){var n=e.parent();return!(!n.hasClass("selected-fk")&&""!==e.html()&&(t.find(".tag-editor-tag.active").length&&t.find("input").blur(),n.addClass("selected-fk").siblings().removeClass("selected-fk"),r(),1))},beforeTagDelete:function(e,t,n){return 1===n.length||(e.hasClass("selected-fk")&&t.find(">li").eq(1).addClass("selected-fk"),!0)},beforeTagSave:function(e,t,n,r,i){if(0!==n.length&&i)return a(t,i),i}}),this.elem.next().find(">li:not(.placeholder)").eq(1).addClass("selected-fk");var s=this.elem.parent();s.append(s.find(".cmb2-metabox-description"))}return r(e,[{key:"getAutocompleteOptions",value:function(){return{minLength:2,source:function(e,t){i.default.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:e.term,nolabels:"t",client:"hp",ds:"",lr:"lang_"+rankMath.locale,hl:rankMath.locale},success:function(e){t(i.default.map(e[1],function(e){return{value:(0,i.default)("<span>").html(e[0]).text()}}))}})}}}},{key:"getFocusKeywords",value:function(){var e=this.elem.tagEditor("getTags")[0];return e?e.tags:[]}},{key:"getFocusKeyword",value:function(){var e=this.elem.tagEditor("getTags")[0];if(!e)return{isPrimary:!0,keyword:""};var t=e.editor.find(".selected-fk").first();return t.length?{elem:t,isPrimary:1===t.index(),keyword:t.find(".tag-editor-tag").text()}:e.tags.length?{isPrimary:!0,keyword:e.tags[0]}:{isPrimary:!0,keyword:""}}},{key:"clearFocusKeywords",value:function(){this.elem.tagEditor("clearTags")}},{key:"addFocusKeyword",value:function(e){this.elem.tagEditor("addTag",e)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(r=n(5))&&r.__esModule?r:{default:r},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.focusKeywords=t,this.modal=(0,o.default)("#rank-math-compare-keywords-wrapper"),this.holder=this.modal.find(".rank-math-keywords-fields"),this.iframe=this.modal.find("iframe.attachments-browser"),this.btnCompare=this.modal.find(".compare-keywords"),this.events()}return i(e,[{key:"events",value:function(){var e=this;(0,o.default)("#rank-math-compare-keywords-trigger").on("click",function(t){t.preventDefault();var n=e.focusKeywords.getFocusKeywords();e.holder.html(""),n.length?o.default.each(n,function(t,n){e.addNewField(n)}):e.addNewField(),e.modal.toggle(),e.btnCompare.trigger("click")}),this.modal.on("click",".media-modal-close",function(){e.modal.toggle()}),this.modal.on("click",".add-new-keywords",function(){e.addNewField()}),this.modal.on("click",".remove-keyword",function(e){(0,o.default)(e.currentTarget).parent().remove(),btnCompare.trigger("click")}),this.modal.on("click",".use-these-keywords",function(){e.focusKeywords.clearFocusKeywords(),e.holder.find("input").each(function(t,n){var r=(0,o.default)(n).val().trim();""!==r&&e.focusKeywords.addFocusKeyword(r)}),e.modal.toggle()}),this.btnCompare.on("click",function(){var t=[];if(e.holder.find("input").each(function(){var e=(0,o.default)(this).val().trim();""!==e&&t.push({keyword:e,geo:"",time:"today 12-m"})}),0===t.length)return!1;t={comparisonItem:t,category:0,property:""},e.iframe.attr("src",e.iframe.data("srcbase")+"&req="+encodeURIComponent(JSON.stringify(t)))}),this.holder.on("keydown","input",function(t){if(13===t.keyCode)return t.preventDefault(),e.btnCompare.trigger("click"),!1})}},{key:"addNewField",value:function(e){var t=(0,o.default)("<div/>"),n=(0,o.default)("<input/>",{type:"text",class:"widefat",value:e||""});t.append(n),t.append('<button class="button-small button-link button-link-delete remove-keyword"><span class="dashicons dashicons-trash"></span></button>'),this.holder.append(t),n.autocomplete(this.focusKeywords.getAutocompleteOptions()).focus()}}]),e}();t.default=a},function(e,t,n){var r=n(222),i=n(208)(function(e,t){return null==e?{}:r(e,t)});e.exports=i},function(e,t,n){var r=n(223),i=n(90);e.exports=function(e,t){return r(e,t,function(t,n){return i(e,n)})}},function(e,t,n){var r=n(48),i=n(224),o=n(25);e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=r(e,c);n(l,c)&&i(u,o(c,e),l)}return u}},function(e,t,n){var r=n(225),i=n(25),o=n(91),a=n(24),s=n(15);e.exports=function(e,t,n,u){if(!a(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,p=e;null!=p&&++c<l;){var d=s(t[c]),h=n;if(c!=f){var v=p[d];void 0===(h=u?u(v,d,p):void 0)&&(h=a(v)?v:o(t[c+1])?[]:{})}r(p,d,h),p=p[d]}return e}},function(e,t,n){var r=n(226),i=n(89),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(227);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(228),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=g(n(5));n(209),n(210);var o=g(n(93)),a=g(n(92)),s=g(n(136)),u=g(n(31)),c=g(n(62)),l=g(n(214)),f=g(n(218)),p=g(n(219)),d=g(n(220)),h=g(n(50)),v=g(n(145));function g(e){return e&&e.__esModule?e:{default:e}}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"init",value:function(){this.title="",this.permalink="",this.description="",this.variableMap=null,this.analyzeOnPage=null!==document.getElementById("rank-math-serp-checklist"),this.shouldAssess=!1,this.primaryResult={},this.serpCanonical=this.elemMetabox.find("#rank_math_canonical_url"),this.serpTitleField=this.elemMetabox.find("#rank_math_title"),this.serpPermalinkField=this.elemMetabox.find("#rank_math_permalink"),this.serpDescriptionField=this.elemMetabox.find("#rank_math_description"),this.serpWrapper=this.elemMetabox.find(".serp-preview"),this.serpBg=this.elemMetabox.find(".serp-preview-bg input"),this.serpTitle=this.serpWrapper.find(".serp-title"),this.serpPermalink=this.serpWrapper.find(".serp-url"),this.serpDescription=this.serpWrapper.find(".serp-description"),this.desktopSnippet=this.serpWrapper.find(".serp-snippet-data"),this.assessor=new Assessor({elemContent:this.elemContent,researches:this.researches}),this.analyzeOnPage&&(this.checkList=new l.default(this)),this.socialFields=new f.default(this),this.compareKeywords=new d.default(this.focusKeywords),this.focusKeywords=new p.default(this),this.wrapInGroup(),this.serpEvents(),this.updateEvents(),this.updatePreview(),this.initLengthIndicator(),rankMathAdmin.variableInserter(!1)}},{key:"wrapInGroup",value:function(){this.serpTitle.wrap('<div class="group"></div>'),this.serpPermalink.wrap('<div class="group"></div>'),this.serpDescription.wrap('<div class="group"></div>'),(0,i.default)(".cmb2-id-rank-math-title").insertAfter(this.serpTitle),(0,i.default)(".cmb2-id-rank-math-permalink").insertAfter(this.serpPermalink),(0,i.default)(".cmb2-id-rank-math-description").insertAfter(this.serpDescription),(0,i.default)(".group",this.serpWrapper).prepend('<span class="dashicons dashicons-no-alt serp-close"></span>')}},{key:"initLengthIndicator",value:function(){this.serpTitleField.lengthIndicator({minLength:15,maxLength:60,source:this.serpTitle}),this.serpPermalinkField.lengthIndicator({minLength:5,maxLength:75,source:this.serpPermalink}),this.serpDescriptionField.lengthIndicator({minLength:80,maxLength:160,source:this.serpDescription})}},{key:"serpEvents",value:function(){var e=this,t=this.elemMetabox.find(".rank-math-select-device");t.on("click",function(n){n.preventDefault();var r,o=(0,i.default)(n.currentTarget),a=o.hasClass("active");r=function(t){switch(t){case"desktop-preview":e.serpWrapper.removeClass("mobile-preview"),e.serpWrapper.addClass("desktop-preview expanded-preview");break;case"mobile-preview":e.serpWrapper.removeClass("desktop-preview"),e.serpWrapper.addClass("mobile-preview expanded-preview");break;default:e.serpWrapper.removeClass("mobile-preview expanded-preview"),e.serpWrapper.addClass("desktop-preview")}},t.removeClass("active"),a?r("normal"):o.hasClass("device-desktop")?(r("desktop-preview"),o.addClass("active")):o.hasClass("device-mobile")&&(r("mobile-preview"),o.addClass("active"))});var n=!0,r=this.elemMetabox.find(".rank-math-edit-snippet");this.elemMetabox.on("click",".rank-math-edit-snippet",function(t){t.preventDefault(),r.toggleClass("hidden active"),e.desktopSnippet.toggle();var i={type:"click",isHidden:n=!n};e.serpTitle.trigger(i),e.serpPermalink.trigger(i),e.serpDescription.trigger(i)}),this.elemMetabox.on("click",".serp-title, .serp-url, .serp-description, .serp-close",function(t){t.preventDefault();var o=(0,i.default)(t.target).parent();"isHidden"in t?o.toggleClass("active",!t.isHidden):(o.toggleClass("active"),0===e.serpWrapper.find(".group.active").length&&r.hasClass("active")&&(n=!n,r.toggleClass("hidden active")),3!==e.serpWrapper.find(".group.active").length||r.hasClass("active")||(n=!1,r.toggleClass("hidden active")))});var o=(0,i.default)("#rank_math_robots1"),a=(0,i.default)("#rank_math_robots2");o.on("change",function(){o.is(":checked")?(e.serpWrapper.addClass("noindex-preview"),a.prop("checked",!1).trigger("change")):e.serpWrapper.removeClass("noindex-preview")}),a.on("change",function(){a.is(":checked")?(e.serpWrapper.addClass("noindex-preview"),o.prop("checked",!1)):e.serpWrapper.removeClass("noindex-preview")}).trigger("change"),(0,i.default)("textarea[data-autoresize]").each(function(){var e=(0,i.default)(this);e.on("keyup input",function(){e.css("height","auto").css("height",e.prop("scrollHeight"))})})}},{key:"updateEvents",value:function(){var e=this;this.serpTitleField.on("input",(0,c.default)(function(){e.updateTitlePreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemTitle.on("input",(0,c.default)(function(){e.setVariable("title",e.elemTitle.val()),e.setVariable("term",e.elemTitle.val()),e.setVariable("author",e.elemTitle.val()),e.setVariable("name",e.elemTitle.val()),e.updateTitlePreview()},500)),this.serpPermalinkField.val(this.serpPermalinkField.val()||this.elemSlug.val()).on("input",(0,c.default)(function(){var t=decodeURIComponent(e.serpPermalinkField.val());e.updateSlug(t),e.updatePermalinkPreview()},500)).on("blur",function(){var t=(0,s.default)(e.serpPermalinkField.val());e.updateSlug(t)}).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemSlug.on("input",(0,c.default)(function(){e.serpPermalinkField.val(e.elemSlug.val()).trigger("input")},500)),this.serpDescriptionField.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemDescription.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500))}},{key:"updateSlug",value:function(e){this.serpPermalinkField.val(e),this.elemSlug.val(e)}},{key:"seoAssessments",value:function(e){if(!1!==this.shouldAssess){var t=null;"title"===e?t=this.assessor.assessTitle(this.title):"permalink"===e?t=this.assessor.assessPermalink(this.permalink):"description"===e?(this.assessor.paper.setDescription(this.description),t=this.assessor.assessFocusKeyword(this.focusKeywords.getFocusKeyword())):"content"===e&&(t=this.assessor.assessContent(this.description)),this.setKeywordStatus(t)}}},{key:"seoTitleAssessments",value:function(){this.seoAssessments("title")}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessments("permalink")}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessments("description")}},{key:"seoContentAssessments",value:function(){this.seoAssessments("content")}},{key:"seoAssessAll",value:function(){if(!1!==this.shouldAssess){this.assessor.paper.setTitle(this.title),this.assessor.paper.setPermalink(this.permalink),this.assessor.paper.setKeyword(this.focusKeywords.getFocusKeyword().keyword),this.assessor.paper.setDescription(this.description);var e=this.assessor.runAll();this.setKeywordStatus(e)}}},{key:"setKeywordStatus",value:function(e){if(!1!==this.analyzeOnPage){var t=this.focusKeywords.getFocusKeyword();if(t.isPrimary||void 0===t.elem)this.checkList.elem.show(),this.checkList.display(e);else{var n={keywordDensity:e.keywordDensity,keywordInContent:e.keywordInContent,keywordInSubheadings:e.keywordInSubheadings};"post"!==rankMath.objectType&&this.checkList.elem.hide(),this.checkList.hidePrimary(),this.checkList.display(n),this.checkList.setSecondaryKeywordStatus(n,t.elem),delete e.keywordDensity,delete e.keywordInContent,delete e.keywordInSubheadings,delete this.primaryResult.keywordInTitle,delete this.primaryResult.keywordInMetaDescription,delete this.primaryResult.keywordInPermalink,delete this.primaryResult.keywordIn10Content,delete this.primaryResult.keywordInImageAlt,delete this.primaryResult.keywordNotUsed,delete this.primaryResult.titleStartWithKeyword}this.primaryResult=i.default.extend({},this.primaryResult,e),this.checkList.setPrimaryKeywordStatus(this.primaryResult,this.focusKeywords.elem.next().find(">li:not(.placeholder)").eq(1))}}},{key:"updatePreview",value:function(){this.updateTitlePreview(),this.updatePermalinkPreview(),this.updateDescriptionPreview(),this.shouldAssess=this.analyzeOnPage,this.seoAssessAll(),this.focusKeywords.elem.trigger("content-loaded"),this.updateFocusKeywords()}},{key:"updateFocusKeywords",value:function(){var e=this.focusKeywords.getFocusKeyword().keyword;if(""!==e&&(this.setVariable("focuskw",e),this.serpBg.val(e)),this.focusKeywords.getFocusKeyword().isPrimary){this.shouldAssess=!1,this.updateDescriptionPreview(),this.shouldAssess=!0,this.seoFocusKeywordAssessments(),this.highlightKeywords(),this.updatePreviewCallbacks("description",this.description),this.updatePreviewCallbacks("focus-keyword",e);var t=(0,i.default)(".focus-keyword-link");t.length&&""!==e&&t.attr("href",t.attr("href").replace("%focus_keyword%",e).replace("%post_type%",rankMath.objectType).replace("%taxonomy%",rankMath.objectType))}else this.seoFocusKeywordAssessments()}},{key:"updateTitlePreview",value:function(){this.title=this.serpTitleField.val();var e=""!==this.title;this.title=this.swapVars(""!==this.title?this.title:this.serpTitle.data("format")),this.serpTitle.html(this.title),this.serpTitleField.attr("placeholder",e?this.title:this.serpTitle.data("format")),this.socialFields.facebookTitleField.attr("placeholder",this.title),this.socialFields.twitterTitleField.attr("placeholder",this.title),this.seoTitleAssessments(),this.highlightKeywords(this.serpTitle),this.updatePreviewCallbacks("title",this.title),this.serpTitle.trigger("rank-math-vars-replaced")}},{key:"updatePermalinkPreview",value:function(){var e=this.serpPermalink.data("format")||"",t=(0,s.default)(this.serpPermalinkField.val());this.permalink=""!==t?e.replace(/%(postname|pagename)%/,t).trimRight("/")+"/":"",this.serpCanonical.attr("placeholder",this.permalink),this.serpPermalink.html(this.permalink),this.seoPermalinkAssessments(),this.highlightKeywords(this.serpPermalink),this.updatePreviewCallbacks("permalink",this.permalink),this.serpPermalink.trigger("rank-math-vars-replaced")}},{key:"updateDescriptionPreview",value:function(){this.description=this.swapVars(this.getDescription()),this.serpDescription.html(this.description),this.serpDescriptionField.attr("placeholder",""!==this.description?this.description:this.serpDescription.data("format"));var e=this.getDescriptionTruncated(this.description,300);this.socialFields.facebookDescriptionField.attr("placeholder",e),this.socialFields.twitterDescriptionField.attr("placeholder",e),this.seoContentAssessments(),this.highlightKeywords(this.serpDescription),this.updatePreviewCallbacks("description",this.description),this.serpDescription.trigger("rank-math-vars-replaced")}},{key:"updatePreviewCallbacks",value:function(e,t){this.elemMetabox.trigger("rank-math-updating-preview-"+(e=e||"global")),this.elemMetabox.trigger("rank-math-"+e+"-updated",t)}},{key:"highlightKeywords",value:function(e){var t=this.focusKeywords.getFocusKeyword().keyword;!1!==t&&(e?(e.hasClass("serp-url")&&(t=this.assessor.paper.get("keywordPermalink")),e.rankMathUnhighlight(),e.rankMathHighlight(t)):(this.serpTitle.rankMathUnhighlight(),this.serpTitle.rankMathHighlight(t),this.serpPermalink.rankMathUnhighlight(),this.serpPermalink.rankMathHighlight(this.assessor.paper.get("keywordPermalink")),this.serpDescription.rankMathUnhighlight(),this.serpDescription.rankMathHighlight(t)))}},{key:"swapVars",value:function(e,t){var n=this;return(e=e||"")?(t=t||this.getMapObj(),(e=e.replace(" %page%","").replace("%sep% %sep%","%sep%")).replace(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/giu,function(e){var r=e.toLowerCase().replace(/%+/g,"");return["title","post_title","term","author","name"].includes(r)?n.isGutenbergAvailable?t.title:n.elemTitle.val():["description","tag_description","category_description","cat_description","author_description","user_description"].includes(r)?(0,i.default)("#description").val():["fk","focuskeyword","focuskw"].includes(r)?n.focusKeywords.getFocusKeyword().keyword:r.includes("customfield(")?(r=r.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[r]:"":(r.includes("(")&&(r=r.split("(")[0]),r in t?t[r]:r)}).trim()):""}},{key:"getMapObj",value:function(){var e=this;return null!==this.variableMap?this.variableMap:(this.variableMap={},i.default.each(rankMath.variables,function(t,n){t=t.toLowerCase().replace(/%+/g,"").split("(")[0],e.variableMap[t]=n.example}),this.variableMap)}},{key:"setVariable",value:function(e,t){null!==this.variableMap?this.variableMap[e]=t:void 0!==rankMath.variables[e]&&(rankMath.variables[e].example=t)}},{key:"getContent",value:function(){return this.assessor.paper.get("content")}},{key:"getDescription",value:function(){this.assessor.refreshContent();var e=this.getExcerpt(),t=this.serpDescriptionField.val();if(""!==t)return(0,h.default)(t);if(!(0,a.default)(e)&&""!==e)return(0,h.default)(e);var n=this.serpDescription.data("format"),r=this.generateDescriptionFromContent(this.getContent());return this.setVariable("excerpt",r),(0,a.default)(n)||""===n?r:(0,h.default)(n)}},{key:"getExcerpt",value:function(){if(this.isGutenbergAvailable)return"";var e=this.elemDescription.val();return this.setVariable("excerpt",e),this.setVariable("excerpt_only",e),this.setVariable("wc_shortdesc",e),e}},{key:"generateDescriptionFromContent",value:function(e){if(""===e)return"";var t=this.focusKeywords.getFocusKeyword().keyword,n=(0,o.default)((0,v.default)(e,!0),function(e){return""!==i.default.trim(e)});if(!n.length)return"";if(""!==t){var r=(0,o.default)(n,function(e){return(0,u.default)(e.toLowerCase(),t)});if(r.length>0)return this.getDescriptionTruncated(r[0],160)}return this.getDescriptionTruncated(n[0],160)}},{key:"getDescriptionTruncated",value:function(e,t){return t?this.truncate(e.replace(/\r?\n|\r/g," "),t):e.replace(/\r?\n|\r/g," ")}},{key:"truncate",value:function(e,t){return e.length>t?e.substring(0,t):e}}]),e}();t.default=m},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=u(n(5)),o=u(n(235)),a=u(n(62)),s=u(n(221));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return(0,i.default)(".rank-math-term-description-wrap").prev().remove(),e.elemMetabox=(0,i.default)("#cmb2-metabox-rank_math_metabox"),e.elemSlug=(0,i.default)("#slug"),e.elemTitle=(0,i.default)("#name"),e.elemDescription=(0,i.default)("#rank_math_description"),e.elemContent=null,e.researches={keywordInTitle:!0,keywordInMetaDescription:!0,keywordInPermalink:!0,titleStartWithKeyword:!0,keywordNotUsed:!0},e.researches=(0,s.default)(e.researches,Object.keys(rankMath.assessor.researchesTests)),e.init(),e.analyzeOnPage&&(e.elemDescription.on("input change",(0,a.default)(function(){e.updateDescriptionPreview(),e.socialFields.updateThumbnailPreview()},500)),(0,i.default)(window).on("load",function(){!e.isGutenbergAvailable&&"undefined"!=typeof tinymce&&tinymce.activeEditor&&tinyMCE.editors.rank_math_description.on("keyup change",(0,a.default)(function(t){e.updateDescriptionPreview(),e.socialFields.updateThumbnailPreview()},500))})),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),r(t,[{key:"seoTitleAssessments",value:function(){this.seoAssessAll()}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessAll()}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessAll()}},{key:"seoContentAssessments",value:function(){this.seoAssessAll()}},{key:"getExcerpt",value:function(){if(this.isGutenbergAvailable)return this.getMapObj().excerpt;var e="undefined"!=typeof tinymce&&tinymce.activeEditor&&"rank_math_description"===tinymce.activeEditor.id?tinymce.activeEditor.getContent():this.elemDescription.val();return this.setVariable("excerpt",e),this.setVariable("excerpt_only",e),this.setVariable("wc_shortdesc",e),e}}]),t}();(0,i.default)(function(){new c})}]);
|
assets/admin/js/user-metabox.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=353)}([function(e,t){e.exports=Array.isArray},function(e,t,n){var r=n(75)("wks"),i=n(40),o=n(2).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(11),i=n(41);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=!n(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=jQuery},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(70)("wks"),i=n(71),o=n(6).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(34),i=n(68);e.exports=n(20)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(12),i=n(77),o=n(79),a=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(2),i=n(3),o=n(14),a=n(40)("src"),s=Function.toString,u=(""+s).split("toString");n(39).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(t+""))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return e}},,function(e,t,n){var r=n(89);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports={}},function(e,t,n){var r=n(35);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(36)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(181),i=n(43);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(0),i=n(30),o=n(130),a=n(60);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(96),i=n(54);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},,function(e,t,n){var r=n(109),i=n(112)(r);e.exports=i},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(0),i=n(129),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(52),i=n(26),o=n(105),a=n(140),s=n(141),u=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:s(e),n=n&&!c?a(n):0;var l=e.length;return 0>n&&(n=u(l+n,0)),o(e)?l>=n&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},function(e,t,n){var r=n(156),i=n(33);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(19),i=n(159),o=n(160),a=Object.defineProperty;t.f=n(20)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(70)("keys"),i=n(71);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(75)("keys"),i=n(40);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){"use strict";var r=n(3),i=n(13),o=n(22),a=n(43),s=n(1);e.exports=function(e,t,n){var u=s(e),c=n(a,u,""[e]),l=c[0],f=c[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,l),r(RegExp.prototype,u,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(113),i=n(127),o=n(104),a=n(0),s=n(133);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(25),i=n(15);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&o>n;)e=e[i(t[n++])];return n&&n==o?e:void 0}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"\n")}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&9007199254740991>=e}},function(e,t,n){var r=n(115),i=n(116),o=n(117),a=n(118),s=n(119);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(120),i=n(57);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(24);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){var r=n(24),i=n(211),o=n(144),a=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,f,p,d,h=0,v=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,h=t,f=e.apply(r,n)}function k(e){var n=e-d;return void 0===d||n>=t||0>n||g&&e-h>=l}function b(){var e=i();if(k(e))return w(e);p=setTimeout(b,function(e){var n=t-(e-d);return g?s(n,l-(e-h)):n}(e))}function w(e){return p=void 0,m&&u?y(e):(u=c=void 0,f)}function x(){var e=i(),n=k(e);if(u=arguments,c=this,d=e,n){if(void 0===p)return function(e){return h=e,p=setTimeout(b,t),v?y(e):f}(d);if(g)return p=setTimeout(b,t),y(d)}return void 0===p&&(p=setTimeout(b,t)),f}return t=o(t)||0,r(n)&&(v=!!n.leading,l=(g="maxWait"in n)?a(o(n.maxWait)||0,t):l,m="trailing"in n?!!n.trailing:m),x.cancel=function(){void 0!==p&&clearTimeout(p),h=0,u=d=c=p=void 0},x.flush=function(){return void 0===p?f:w(i())},x}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(65),i=n(66),o=n(161),a=n(10),s=n(18),u=n(162),c=n(73),l=n(170),f=n(8)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,g,m){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in P)return P[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,O=!1,P=e.prototype,T=P[f]||P["@@iterator"]||v&&P[v],C=T||w(v),S=v?_?w("entries"):C:void 0,j="Array"==t&&P.entries||T;if(j&&(b=l(j.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||a(b,f,d)),_&&T&&"values"!==T.name&&(O=!0,C=function(){return T.call(this)}),r&&!m||!p&&!O&&P[f]||a(P,f,C),s[t]=C,s[x]=d,v)if(y={values:_?C:w("values"),keys:g?C:w("keys"),entries:S},m)for(k in y)k in P||o(P,k,y[k]);else i(i.P+i.F*(p||O),t,y);return y}},function(e,t){e.exports=!0},function(e,t,n){var r=n(6),i=n(7),o=n(157),a=n(10),s=n(21),u=function(e,t,n){var c,l,f,p=e&u.F,d=e&u.G,h=e&u.S,v=e&u.P,g=e&u.B,m=e&u.W,y=d?i:i[t]||(i[t]={}),k=y.prototype,b=d?r:h?r[t]:(r[t]||{}).prototype;for(c in d&&(n=t),n)(l=!p&&b&&void 0!==b[c])&&s(y,c)||(f=l?b[c]:n[c],y[c]=d&&"function"!=typeof b[c]?n[c]:g&&l?o(f,r):m&&b[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?o(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[c]=f,e&u.R&&k&&!k[c]&&a(k,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(35),i=n(6).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(165),i=n(72);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(7),i=n(6),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(65)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(34).f,i=n(21),o=n(8)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(33);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(39),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(76)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t,n){e.exports=!n(4)&&!n(22)(function(){return 7!=Object.defineProperty(n(78)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9),i=n(2).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(184);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(83),i=n(45);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(14),i=n(23),o=n(188)(!1),a=n(44)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(11).f,i=n(14),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(9),i=n(80),o=n(1)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(148),i=n(149),o=n(176);e.exports=function(e,t){return r(e)||i(e,t)||o()}},function(e,t,n){e.exports=n(196)},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(132),i=n(102);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&t>e}},function(e,t){e.exports=function(e){return void 0===e}},function(e,t,n){var r=n(107),i=n(108),o=n(47),a=n(0);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},function(e,t,n){var r=n(61),i=n(47),o=n(146),a=n(0);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,"").replace(i,"")};var r=/\[[^<>&\/\[\] - =]+?( [^\]]+?)?\]/g,i=/\[\/[^<>&\/\[\] - =]+?\]/g},function(e,t,n){var r=n(53),i=n(24);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(0);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return r(e)?e:[e]}},function(e,t,n){var r=n(52);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(25),i=n(103),o=n(0),a=n(91),s=n(54),u=n(15);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(o(e)||i(e))}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(53),i=n(0),o=n(57);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},,function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},function(e,t,n){var r=n(28);e.exports=function(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}},function(e,t,n){var r=n(110),i=n(29);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(111)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},function(e,t,n){var r=n(26);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},function(e,t,n){var r=n(114),i=n(126),o=n(59);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(55),i=n(56);e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=n[a])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(o)var h=o(f,p,l,e,t,d);if(!(void 0===h?i(p,f,3,o,d):h))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(17),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return n>=0&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(17);e.exports=function(e){var t=this.__data__,n=r(t,e);return 0>n?void 0:t[n][1]}},function(e,t,n){var r=n(17);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(17);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return 0>i?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(55),i=n(121),o=n(123),a=n(124),s=n(99),u=n(0),c=n(100),l=n(101),f="[object Arguments]",p="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,m){var y=u(e),k=u(t),b=y?p:s(e),w=k?p:s(t),x=(b=b==f?d:b)==d,_=(w=w==f?d:w)==d,O=b==w;if(O&&c(e)){if(!c(t))return!1;y=!0,x=!1}if(O&&!x)return m||(m=new r),y||l(e)?i(e,t,n,v,g,m):o(e,t,b,n,v,g,m);if(!(1&n)){var P=x&&h.call(e,"__wrapped__"),T=_&&h.call(t,"__wrapped__");if(P||T){var C=P?e.value():e,S=T?t.value():t;return m||(m=new r),g(C,S,n,v,m)}}return!!O&&(m||(m=new r),a(e,t,n,v,g,m))}},function(e,t,n){var r=n(97),i=n(122),o=n(98);e.exports=function(e,t,n,a,s,u){var c=1&n,l=e.length,f=t.length;if(!(l==f||c&&f>l))return!1;var p=u.get(e);if(p&&u.get(t))return p==t;var d=-1,h=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++d<l;){var g=e[d],m=t[d];if(a)var y=c?a(m,g,d,t,e,u):a(g,m,d,e,t,u);if(void 0!==y){if(y)continue;h=!1;break}if(v){if(!i(t,function(e,t){if(!o(v,t)&&(g===e||s(g,e,n,a,u)))return v.push(t)})){h=!1;break}}else if(g!==m&&!s(g,m,n,a,u)){h=!1;break}}return u.delete(e),u.delete(t),h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(125),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var d=s.get(e);if(d&&s.get(t))return d==t;var h=!0;s.set(e,t),s.set(t,e);for(var v=u;++f<l;){var g=e[p=c[f]],m=t[p];if(o)var y=u?o(m,g,p,t,e,s):o(g,m,p,e,t,s);if(!(void 0===y?g===m||a(g,m,n,o,s):y)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var k=e.constructor,b=t.constructor;k!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof b&&b instanceof b)&&(h=!1)}return s.delete(e),s.delete(t),h}},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(58),i=n(29);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},function(e,t,n){var r=n(56),i=n(128),o=n(90),a=n(30),s=n(58),u=n(59),c=n(15);e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},function(e,t,n){var r=n(48);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=n(131)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)}),t});e.exports=o},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(134),i=n(135),o=n(30),a=n(15);e.exports=function(e){return o(e)?r(a(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(48);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(e=(0,i.default)(e)).replace(/ /gi,"-").toLowerCase()};var r,i=(r=n(137))&&r.__esModule?r:{default:r}},function(e,t,n){var r=n(138),i=n(60),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]/g;e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(a,"")}},function(e,t,n){var r=n(139)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(142),i=n(29);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){var r=n(61);e.exports=function(e,t){return r(t,function(t){return e[t]})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=u((0,i.autop)((0,a.default)(e)),t);return n.length>0?n:[e]};var r=s(n(94)),i=n(147),o=s(n(50)),a=s(n(95));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t){var n=[];t=t||!1;for(var i=/<p(?:[^>]+)?>(.*?)<\/p>/gi,a=void 0;null!==(a=i.exec(e));)n.push(a);return(0,r.default)(n,function(e){return t?(0,o.default)(e[1]):e[1]})}},function(e,t,n){var r=n(28),i=n(26);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,function(e,r,i){o[++n]=t(e,r,i)}),o}},function(e,t,n){"use strict";n.r(t),n.d(t,"autop",function(){return c}),n.d(t,"removep",function(){return l});var r=n(87),i=n.n(r),o=(n(177),n(194),n(195),n(88)),a=n.n(o),s=(n(199),n(200),/(<((?=!--|!\[CDATA\[)((?=!-)!(?:-(?!->)[^\-]*)*(?:-->)?|!\[CDATA\[[^\]]*(?:](?!]>)[^\]]*)*?(?:]]>)?)|[^>]*>?))/);function u(e,t){for(var n=function(e){for(var t,n=[],r=e;t=r.match(s);)n.push(r.slice(0,t.index)),n.push(t[0]),r=r.slice(t.index+t[0].length);return r.length&&n.push(r),n}(e),r=!1,i=a()(t),o=1;n.length>o;o+=2)for(var u=0;i.length>u;u++){var c=i[u];if(-1!==n[o].indexOf(c)){n[o]=n[o].replace(RegExp(c,"g"),t[c]),r=!0;break}}return r&&(e=n.join("")),e}function c(e){var t=1>=arguments.length||void 0===arguments[1]||arguments[1],n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){var r=e.split("</pre>"),o=r.pop();e="";for(var a=0;r.length>a;a++){var s=r[a],c=s.indexOf("<pre");if(-1!==c){var l="<pre wp-pre-tag-"+a+"></pre>";n.push([l,s.substr(c)+"</pre>"]),e+=s.substr(0,c)+l}else e+=s}e+=o}var f="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=u(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(RegExp("(<"+f+"[s/>])","g"),"\n\n$1")).replace(RegExp("(</"+f+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));var p=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",p.forEach(function(t){e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)","g"),"$1")).replace(RegExp("(</?"+f+"[^>]*>)s*</p>","g"),"$1"),t&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,function(e){return e[0].replace(/\n/g,"<WPPreserveNewline />")})).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,function(e,t){return t?e:"<br />\n"})).replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(RegExp("(</?"+f+"[^>]*>)s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach(function(t){var n=i()(t,2);e=e.replace(n[0],n[1])}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}function l(e){var t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",r=t+"|pre",i=[],o=!1,a=!1;return e?(-1===e.indexOf("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(e){return i.push(e),"<wp-preserve>"})),-1!==e.indexOf("<pre")&&(o=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(e){return(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")})),-1!==e.indexOf("[caption")&&(a=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(RegExp("\\s*</("+n+")>\\s*","g"),"</$1>\n")).replace(RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,function(e,t){return t&&-1!==t.indexOf("\n")?"\n\n":"\n"})).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(RegExp("\\s*</("+r+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(/<wp-line-break>/g,"\n")),a&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),i.length&&(e=e.replace(/<wp-preserve>/g,function(){return i.shift()})),e):""}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t,n){var r=n(150);e.exports=function(e,t){var n=[],i=!0,o=!1,a=void 0;try{for(var s,u=r(e);!(i=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return n}},function(e,t,n){e.exports=n(151)},function(e,t,n){n(152),n(171),e.exports=n(173)},function(e,t,n){n(153);for(var r=n(6),i=n(10),o=n(18),a=n(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;s.length>u;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[a]&&i(f,a,c),o[c]=o.Array}},function(e,t,n){"use strict";var r=n(154),i=n(155),o=n(18),a=n(32);e.exports=n(64)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(63);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(158);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=!n(20)&&!n(36)(function(){return 7!=Object.defineProperty(n(67)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(35);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";var r=n(163),i=n(68),o=n(73),a={};n(10)(a,n(8)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(19),i=n(164),o=n(72),a=n(38)("IE_PROTO"),s=function(){},u=function(){var e,t=n(67)("iframe"),r=o.length;for(t.style.display="none",n(169).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(34),i=n(19),o=n(69);e.exports=n(20)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(21),i=n(32),o=n(166)(!1),a=n(38)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(32),i=n(167),o=n(168);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(37),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(37),i=Math.max,o=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(6).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(21),i=n(74),o=n(38)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";var r=n(172)(!0);n(64)(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return t.length>n?(e=r(t,n),this._i+=e.length,{value:e,done:!1}):{value:void 0,done:!0}})},function(e,t,n){var r=n(37),i=n(33);e.exports=function(e){return function(t,n){var o,a,s=i(t)+"",u=r(n),c=s.length;return 0>u||u>=c?e?"":void 0:55296>(o=s.charCodeAt(u))||o>56319||u+1===c||56320>(a=s.charCodeAt(u+1))||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){var r=n(19),i=n(174);e.exports=n(7).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){var r=n(175),i=n(8)("iterator"),o=n(18);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(63),i=n(8)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){for(var r=n(178),i=n(82),o=n(13),a=n(2),s=n(3),u=n(42),c=n(1),l=c("iterator"),f=c("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(d),v=0;h.length>v;v++){var g,m=h[v],y=d[m],k=a[m],b=k&&k.prototype;if(b&&(b[l]||s(b,l,p),b[f]||s(b,f,m),u[m]=p,y))for(g in r)b[g]||o(b,g,r[g],!0)}},function(e,t,n){"use strict";var r=n(179),i=n(180),o=n(42),a=n(23);e.exports=n(182)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(1)("unscopables"),i=Array.prototype;null==i[r]&&n(3)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(80);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";var r=n(76),i=n(183),o=n(13),a=n(3),s=n(42),u=n(185),c=n(85),l=n(192),f=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,g,m){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in P)return P[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,O=!1,P=e.prototype,T=P[f]||P["@@iterator"]||v&&P[v],C=T||w(v),S=v?_?w("entries"):C:void 0,j="Array"==t&&P.entries||T;if(j&&(b=l(j.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||a(b,f,d)),_&&T&&"values"!==T.name&&(O=!0,C=function(){return T.call(this)}),r&&!m||!p&&!O&&P[f]||a(P,f,C),s[t]=C,s[x]=d,v)if(y={values:_?C:w("values"),keys:g?C:w("keys"),entries:S},m)for(k in y)k in P||o(P,k,y[k]);else i(i.P+i.F*(p||O),t,y);return y}},function(e,t,n){var r=n(2),i=n(39),o=n(3),a=n(13),s=n(81),u=function(e,t,n){var c,l,f,p,d=e&u.F,h=e&u.G,v=e&u.P,g=e&u.B,m=h?r:e&u.S?r[t]||(r[t]={}):(r[t]||{}).prototype,y=h?i:i[t]||(i[t]={}),k=y.prototype||(y.prototype={});for(c in h&&(n=t),n)f=((l=!d&&m&&void 0!==m[c])?m:n)[c],p=g&&l?s(f,r):v&&"function"==typeof f?s(Function.call,f):f,m&&a(m,c,f,e&u.U),y[c]!=f&&o(y,c,p),v&&k[c]!=f&&(k[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var r=n(186),i=n(41),o=n(85),a={};n(3)(a,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(12),i=n(187),o=n(45),a=n(44)("IE_PROTO"),s=function(){},u=function(){var e,t=n(78)("iframe"),r=o.length;for(t.style.display="none",n(191).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(11),i=n(12),o=n(82);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(23),i=n(189),o=n(190);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(84),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(84),i=Math.max,o=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(14),i=n(193),o=n(44)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(43);e.exports=function(e){return Object(r(e))}},function(e,t,n){n(46)("split",2,function(e,t,r){"use strict";var i=n(86),o=r,a=[].push;if("".split(/.?/).length){var s=void 0===/()??/.exec("")[1];r=function(e,t){var n=this+"";if(void 0===e&&0===t)return[];if(!i(e))return o.call(n,e,t);var r,u,c,l,f,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,g=RegExp(e.source,d+"g");for(s||(r=RegExp("^"+g.source+"$(?!\\s)",d));(u=g.exec(n))&&((c=u.index+u[0].length)<=h||(p.push(n.slice(h,u.index)),!s&&u.length>1&&u[0].replace(r,function(){for(f=1;arguments.length-2>f;f++)void 0===arguments[f]&&(u[f]=void 0)}),u.length>1&&n.length>u.index&&a.apply(p,u.slice(1)),l=u[0].length,h=c,v>p.length));)g.lastIndex===u.index&&g.lastIndex++;return h===n.length?!l&&g.test("")||p.push(""):p.push(n.slice(h)),p.length>v?p.slice(0,v):p}}return[function(n,i){var o=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(o+"",n,i)},r]})},function(e,t,n){n(46)("replace",2,function(e,t,n){return[function(r,i){"use strict";var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(o+"",r,i)},n]})},function(e,t,n){n(197),e.exports=n(7).Object.keys},function(e,t,n){var r=n(74),i=n(69);n(198)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(66),i=n(7),o=n(36);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t,n){n(46)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):RegExp(n)[t](r+"")},n]})},function(e,t,n){var r=n(2),i=n(201),o=n(11).f,a=n(205).f,s=n(86),u=n(206),c=r.RegExp,l=c,f=c.prototype,p=/a/g,d=/a/g,h=new c(p)!==p;if(n(4)&&(!h||n(22)(function(){return d[n(1)("match")]=!1,c(p)!=p||c(d)==d||"/a/i"!=c(p,"i")}))){c=function(e,t){var n=this instanceof c,r=s(e),o=void 0===t;return!n&&r&&e.constructor===c&&o?e:i(h?new l(r&&!o?e.source:e,t):l((r=e instanceof c)?e.source:e,r&&o?u.call(e):t),n?this:f,c)};for(var v=function(e){e in c||o(c,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})},g=a(l),m=0;g.length>m;)v(g[m++]);f.constructor=c,c.prototype=f,n(13)(r,"RegExp",c)}n(207)("RegExp")},function(e,t,n){var r=n(9),i=n(202).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t,n){var r=n(9),i=n(12),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(81)(Function.call,n(203).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){var r=n(204),i=n(41),o=n(23),a=n(79),s=n(14),u=n(77),c=Object.getOwnPropertyDescriptor;t.f=n(4)?c:function(e,t){if(e=o(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(83),i=n(45).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";var r=n(12);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(2),i=n(11),o=n(4),a=n(1)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r};i.default.extend({rankMathHighlight:function(e,t,n,r){if(3===e.nodeType){var o=e.data.match(t);if(o){var a=document.createElement(n||"span");a.className=r||"highlight";var s=e.splitText(o.index);s.splitText(o[0].length);var u=s.cloneNode(!0);return a.appendChild(u),s.parentNode.replaceChild(a,s),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==r))for(var c=0;e.childNodes.length>c;c++)c+=i.default.rankMathHighlight(e.childNodes[c],t,n,r);return 0}}),i.default.fn.rankMathUnhighlight=function(e){var t={className:"highlight",element:"span"};return i.default.extend(t,e),this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()},i.default.fn.rankMathHighlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(i.default.extend(n,t),void 0===e||""===e)return this;if(e.constructor===String&&(e=[e]),e=i.default.grep(e,function(e){return""!==e}),0===(e=i.default.map(e,function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")})).length)return this;var r=n.caseSensitive?"":"i",o="("+e.join("|")+")";n.wordsOnly&&(o="\\b"+o+"\\b");var a=RegExp(o,r);return this.each(function(){i.default.rankMathHighlight(this,a,n.element,n.className)})}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r},o=document.createElement("div");i.default.fn.lengthIndicator=function(e){var t=this;e=i.default.extend({},{minLength:0,maxLength:1e3,source:null},e),t.wrap('<span class="length-indicator-wrapper"/>'),t.parent().append('<span class="length-indicator"><span/></span><span class="length-count">0 / '+e.maxLength+"</span>");var n=t.parent().find(".length-indicator"),r=n.find(">span"),a=t.parent().find(".length-count"),s=function(){var i=function(e){return e&&"string"==typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),o.innerHTML=e,e=o.textContent,o.textContent=""),e}(null===e.source?t.val():e.source.text()).length;n.removeClass("invalid short"),r.css("left",Math.min(100,Math.floor(i/e.maxLength*100))+"%"),a.text(i+" / "+e.maxLength),i>e.minLength&&e.maxLength>=i||n.addClass("invalid")};t.on("input",s),null!==e.source&&e.source.on("rank-math-vars-replaced",s),s()}},function(e,t,n){var r=n(212);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(213),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){var r;r=n(143),e.exports="object"==typeof r&&r&&r.Object===Object&&r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(215));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank-math-serp-checklist",t.elemMetabox),this.scoreElem=(0,i.default)('<div class="misc-pub-section rank-math-seo-score"><span class="score-text"><span class="dashicons dashicons-chart-area"></span> SEO: <strong>Not available</strong></span></div>'),this.scoreText=this.scoreElem.find("strong"),this.scoreField=(0,i.default)("#rank_math_seo_score"),this.fkScoreElem=(0,i.default)('<div class="rank-math-seo-score below-focus-keyword"><span class="score-text">Not available</span></div>'),this.fkScoreText=this.fkScoreElem.find("span"),(0,i.default)("#misc-publishing-actions").append(this.scoreElem),(0,i.default)(".cmb-td",".cmb2-id-rank-math-focus-keyword").append(this.fkScoreElem),this.events()}return r(e,[{key:"display",value:function(e){var t=this;i.default.each(e,function(e,n){var r=t.elem.find(".seo-check-"+e);r.removeClass("test-ok test-gallery test-fail test-empty test-looking veryEasy difficult veryDifficult"),r.addClass("test-"+n.status),r.show(),"calculateFleschReading"===e&&r.addClass(n.factors[2]),r.find("span:eq(0)").html(n.message)})}},{key:"setPrimaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,o.default)(e,function(e,t,n){return!1===t&&(t={score:0}),e+t.score},0);status="bad-fk",n>80?status="good-fk":n>50&&(status="ok-fk"),t.removeClass("bad-fk ok-fk good-fk"),this.scoreElem.removeClass("bad-fk ok-fk good-fk"),this.fkScoreElem.removeClass("bad-fk ok-fk good-fk"),t.addClass(status),this.scoreElem.addClass(status),this.fkScoreElem.addClass(status),this.scoreText.html(n+" / 100"),this.fkScoreText.html(n+" / 100"),this.scoreField.val(parseInt(n))}},{key:"setSecondaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,o.default)(e,function(e,t){return e+("ok"===t.status?1:0)},0);t.addClass(3===n?"good-fk":2===n?"ok-fk":"bad-fk")}},{key:"hidePrimary",value:function(){this.elem.find("li.is-primary").hide()}},{key:"events",value:function(){var e=this;this.elem.on("click",".group-handle",function(t){t.preventDefault();var n=(0,i.default)(t.target).closest(".rank-math-serp-group"),r={};n.toggleClass("state-open state-closed"),e.updateGroupStatus(n),e.elem.find(">.rank-math-serp-group").each(function(){var e=(0,i.default)(this);r[e.data("id")]=e.hasClass("state-closed")?"closed":"open"}),i.default.ajax({url:rankMath.ajaxurl,type:"POST",data:{action:"rank_math_save_checklist_layout",security:rankMath.security,layout:r}})})}},{key:"updateGroupStatus",value:function(e){(e=e||(0,i.default)(".rank-math-serp-group")).each(function(){var e=(0,i.default)(this);1>e.find("li.test-fail").length&&1>e.find("li.test-empty").length?e.find(".group-status").addClass("passed"):e.find(".group-status").removeClass("passed")})}}]),e}();t.default=s},function(e,t,n){var r=n(216),i=n(28),o=n(47),a=n(217),s=n(0);e.exports=function(e,t,n){var u=s(e)?r:a,c=3>arguments.length;return u(e,o(t,4),n,c,i)}},function(e,t){e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},function(e,t){e.exports=function(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(r=n(5))&&r.__esModule?r:{default:r},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metabox=t,this.currentNetwork="facebook",this.useFacebook=!0,this.shouldUpdatePreview=!1,this.facebookTitleField=t.elemMetabox.find("#rank_math_facebook_title"),this.facebookDescriptionField=t.elemMetabox.find("#rank_math_facebook_description"),this.twitterTitleField=t.elemMetabox.find("#rank_math_twitter_title"),this.twitterDescriptionField=t.elemMetabox.find("#rank_math_twitter_description"),this.facebookImageField=t.elemMetabox.find("#rank_math_facebook_image"),this.twitterImageField=t.elemMetabox.find("#rank_math_twitter_image"),this.facebookImageStatus=t.elemMetabox.find("#rank_math_facebook_image-status"),this.twitterImageStatus=t.elemMetabox.find("#rank_math_twitter_image-status"),this.socialWrapper=t.elemMetabox.find(".rank-math-social-preview"),this.socialPreview=this.socialWrapper.find(".rank-math-social-preview-item"),this.socialTitle=this.socialWrapper.find(".rank-math-social-preview-title"),this.socialDescription=this.socialWrapper.find(".rank-math-social-preview-description"),this.events(),this.shouldUpdatePreview=!0,this.updatePreview()}return i(e,[{key:"events",value:function(){var e=this;this.facebookTitleField.on("input",function(){e.updateTitlePreview()}),this.facebookDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.facebookImageField.on("input",function(){e.updateThumbnailPreview()}),this.twitterTitleField.on("input",function(){e.updateTitlePreview()}),this.twitterDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.twitterImageField.on("input",function(){e.updateThumbnailPreview()});var t=(0,o.default)(".rank-math-social-preview-button"),n=t.find(">span");t.on("click",function(t){t.preventDefault(),n.toggleClass("dashicons-arrow-down dashicons-arrow-up"),e.updatePreview(),e.socialWrapper.toggleClass("open"),e.socialPreview.slideToggle()});var r=(0,o.default)("#rank_math_twitter_card_type");(0,o.default)(".preview-network").on("click",function(n){(0,o.default)(n.target).hasClass("tab-facebook")?t.show():r.trigger("change"),e.updatePreview()}),r.on("change",function(){var n=r.val();"player"===n&&(0,o.default)(".cmb2-id-rank-math-twitter-image, .cmb2-id-rank-math-twitter-title, .cmb2-id-rank-math-twitter-description").show();var i="player"===n||"app"===n;t.toggle(!i),(0,o.default)(".cmb2-id-rank-math-twitter-use-facebook").toggle(!i),e.updatePreview()}).trigger("change");var i=(0,o.default)("#rank_math_twitter_use_facebook2");(0,o.default)("#rank_math_twitter_use_facebook1, #rank_math_twitter_use_facebook2").on("input change",function(){e.useFacebook=i.is(":checked"),e.updatePreview()}).trigger("change"),(0,o.default)(".cmb2-id-rank-math-facebook-enable-image-overlay, .cmb2-id-rank-math-facebook-image-overlay, .cmb2-id-rank-math-twitter-enable-image-overlay, .cmb2-id-rank-math-twitter-image-overlay").on("change","input",function(){e.updateThumbnailOverlay()}),(0,o.default)(document).on("cmb_media_modal_select",function(t,n,r){"rank_math_facebook_image"!==r.field&&"rank_math_twitter_image"!==r.field||e.updateThumbnailPreview()}),(0,o.default)(document).on("cmb_init",function(t,n){n.$metabox.on("click",".cmb2-remove-file-button",function(){e.updateThumbnailPreview()})})}},{key:"updatePreview",value:function(){!1!==this.shouldUpdatePreview&&(this.currentNetwork=(0,o.default)(".preview-network.tab-active").attr("href").replace("#setting-panel-social-",""),this.socialWrapper.removeClass(),this.socialWrapper.addClass("rank-math-social-preview rank-math-social-preview-"+this.currentNetwork),"twitter"===this.currentNetwork&&this.socialWrapper.addClass((0,o.default)("#rank_math_twitter_card_type").val()),this.updateTitlePreview(),this.updateDescriptionPreview(),this.updateThumbnailPreview())}},{key:"updateTitlePreview",value:function(){var e=this[this.currentNetwork+"TitleField"].val()||this.metabox.title;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookTitleField.val()||this.metabox.title),e=this.metabox.truncate(this.metabox.swapVars(e),90),this.socialTitle.html(e)}},{key:"updateDescriptionPreview",value:function(){var e=this[this.currentNetwork+"DescriptionField"].val()||this.description;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookDescriptionField.val()||this.metabox.description),e=this.metabox.truncate(this.metabox.swapVars(e),240),this.socialDescription.html(e)}},{key:"updateThumbnailPreview",value:function(){var e=(0,o.default)("#rank_math_post_thumbnail").attr("src"),t=this.metabox.getContent(),n=!!/<img(?:[^>]+)?>/.test(t)&&(0,o.default)(t).find("img:first").attr("src"),r=this.facebookImageField.val()||e||n||rankMath.defautOgImage,i=this.twitterImageField.val()||e||n||rankMath.defautOgImage;if("twitter"===this.currentNetwork&&this.useFacebook)i=r;else if(this.twitterImageStatus.find("img.cmb-file-field-image").length){var a=this.twitterImageStatus.siblings(".notice"),s=this.twitterImageStatus.find("img.cmb-file-field-image")[0];a.addClass("hidden"),(0,o.default)(s).on("load",function(){(200>s.naturalWidth||200>s.naturalHeight)&&a.removeClass("hidden")})}var u=this.facebookImageStatus.siblings(".notice"),c=this.facebookImageStatus.find("img.cmb-file-field-image");u.addClass("hidden"),"facebook"===this.currentNetwork&&this.facebookImageField.val()&&c.length&&(0,o.default)(c[0]).on("load",function(){(200>c[0].naturalWidth||200>c[0].naturalHeight)&&u.removeClass("hidden")});var l=(0,o.default)(".rank-math-social-preview-image");(0,o.default)(".facebook-thumbnail",l).attr("src",r),(0,o.default)(".twitter-thumbnail",l).attr("src",i),l.toggleClass("no-facebook-image",!r),l.toggleClass("no-twitter-image",!i),l.parents(".rank-math-social-preview-facebook").find(".error-msg").toggleClass("show",!r),l.parents(".rank-math-social-preview-twitter").find(".error-msg").toggleClass("show",!i),this.updateThumbnailOverlay()}},{key:"updateThumbnailOverlay",value:function(){var e=(0,o.default)(".rank-math-social-preview-image-overlay"),t=(0,o.default)('[name="rank_math_'+this.currentNetwork+'_enable_image_overlay"]:checked').val(),n=(0,o.default)('[name="rank_math_'+this.currentNetwork+'_image_overlay"]:checked').val(),r=!(0,o.default)(".rank-math-social-preview-image").hasClass("no-"+this.currentNetwork+"-image");"twitter"===this.currentNetwork&&this.useFacebook&&(n=(0,o.default)('[name="rank_math_facebook_image_overlay"]:checked').val(),r=!1);var i=(0,o.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-enable-image-overlay"),a="on"===i.find("input:checked").val();i.toggle(r),i.find(".notice-warning").toggle(a),"on"===t?(e.attr("src",rankMath.overlayImages[n].url).show(),(0,o.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-image-overlay").toggle(r)):e.hide()}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(62));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank_math_focus_keyword");var r=(0,o.default)(function(){t.updateFocusKeywords()},200),a=(0,o.default)(function(e,n){var r=e.find("li:last").prev(),i=t.assessor.assessFocusKeyword({elem:r,isPrimary:!1,keyword:n});t.checkList.setSecondaryKeywordStatus(i,r)},200);this.elem.on("content-loaded",function(){var e=n.elem.next("ul"),r=n.getFocusKeywords();(0,i.default)(e).find("li:gt(1)").each(function(){var e=(0,i.default)(this),n=t.assessor.assessFocusKeyword({elem:e,isPrimary:!1,keyword:r[e.index()-1]});t.checkList.setSecondaryKeywordStatus(n,e)})}),this.elem.tagEditor({autocomplete:1===rankMath.maxTags?null:this.getAutocompleteOptions(),sortable:!0,placeholder:this.elem.attr("placeholder"),onChange:function(e,t,n){1===n.length?t.find("li:not(.placeholder)").last().addClass("selected-fk"):t.find(".selected-fk").removeClass("selected-fk"),r()},onSelect:function(e,t){var n=e.parent();return!(!n.hasClass("selected-fk")&&""!==e.html()&&(t.find(".tag-editor-tag.active").length&&t.find("input").blur(),n.addClass("selected-fk").siblings().removeClass("selected-fk"),r(),1))},beforeTagDelete:function(e,t,n){return 1===n.length||(e.hasClass("selected-fk")&&t.find(">li").eq(1).addClass("selected-fk"),!0)},beforeTagSave:function(e,t,n,r,i){if(0!==n.length&&i)return a(t,i),i}}),this.elem.next().find(">li:not(.placeholder)").eq(1).addClass("selected-fk");var s=this.elem.parent();s.append(s.find(".cmb2-metabox-description"))}return r(e,[{key:"getAutocompleteOptions",value:function(){return{minLength:2,source:function(e,t){i.default.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:e.term,nolabels:"t",client:"hp",ds:"",lr:"lang_"+rankMath.locale,hl:rankMath.locale},success:function(e){t(i.default.map(e[1],function(e){return{value:(0,i.default)("<span>").html(e[0]).text()}}))}})}}}},{key:"getFocusKeywords",value:function(){var e=this.elem.tagEditor("getTags")[0];return e?e.tags:[]}},{key:"getFocusKeyword",value:function(){var e=this.elem.tagEditor("getTags")[0];if(!e)return{isPrimary:!0,keyword:""};var t=e.editor.find(".selected-fk").first();return t.length?{elem:t,isPrimary:1===t.index(),keyword:t.find(".tag-editor-tag").text()}:e.tags.length?{isPrimary:!0,keyword:e.tags[0]}:{isPrimary:!0,keyword:""}}},{key:"clearFocusKeywords",value:function(){this.elem.tagEditor("clearTags")}},{key:"addFocusKeyword",value:function(e){this.elem.tagEditor("addTag",e)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(r=n(5))&&r.__esModule?r:{default:r},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.focusKeywords=t,this.modal=(0,o.default)("#rank-math-compare-keywords-wrapper"),this.holder=this.modal.find(".rank-math-keywords-fields"),this.iframe=this.modal.find("iframe.attachments-browser"),this.btnCompare=this.modal.find(".compare-keywords"),this.events()}return i(e,[{key:"events",value:function(){var e=this;(0,o.default)("#rank-math-compare-keywords-trigger").on("click",function(t){t.preventDefault();var n=e.focusKeywords.getFocusKeywords();e.holder.html(""),n.length?o.default.each(n,function(t,n){e.addNewField(n)}):e.addNewField(),e.modal.toggle(),e.btnCompare.trigger("click")}),this.modal.on("click",".media-modal-close",function(){e.modal.toggle()}),this.modal.on("click",".add-new-keywords",function(){e.addNewField()}),this.modal.on("click",".remove-keyword",function(e){(0,o.default)(e.currentTarget).parent().remove(),btnCompare.trigger("click")}),this.modal.on("click",".use-these-keywords",function(){e.focusKeywords.clearFocusKeywords(),e.holder.find("input").each(function(t,n){var r=(0,o.default)(n).val().trim();""!==r&&e.focusKeywords.addFocusKeyword(r)}),e.modal.toggle()}),this.btnCompare.on("click",function(){var t=[];if(e.holder.find("input").each(function(){var e=(0,o.default)(this).val().trim();""!==e&&t.push({keyword:e,geo:"",time:"today 12-m"})}),0===t.length)return!1;t={comparisonItem:t,category:0,property:""},e.iframe.attr("src",e.iframe.data("srcbase")+"&req="+encodeURIComponent(JSON.stringify(t)))}),this.holder.on("keydown","input",function(t){if(13===t.keyCode)return t.preventDefault(),e.btnCompare.trigger("click"),!1})}},{key:"addNewField",value:function(e){var t=(0,o.default)("<div/>"),n=(0,o.default)("<input/>",{type:"text",class:"widefat",value:e||""});t.append(n),t.append('<button class="button-small button-link button-link-delete remove-keyword"><span class="dashicons dashicons-trash"></span></button>'),this.holder.append(t),n.autocomplete(this.focusKeywords.getAutocompleteOptions()).focus()}}]),e}();t.default=a},function(e,t,n){var r=n(222),i=n(208)(function(e,t){return null==e?{}:r(e,t)});e.exports=i},function(e,t,n){var r=n(223),i=n(90);e.exports=function(e,t){return r(e,t,function(t,n){return i(e,n)})}},function(e,t,n){var r=n(48),i=n(224),o=n(25);e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=r(e,c);n(l,c)&&i(u,o(c,e),l)}return u}},function(e,t,n){var r=n(225),i=n(25),o=n(91),a=n(24),s=n(15);e.exports=function(e,t,n,u){if(!a(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,p=e;null!=p&&++c<l;){var d=s(t[c]),h=n;if(c!=f){var v=p[d];void 0===(h=u?u(v,d,p):void 0)&&(h=a(v)?v:o(t[c+1])?[]:{})}r(p,d,h),p=p[d]}return e}},function(e,t,n){var r=n(226),i=n(89),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(227);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(228),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=g(n(5));n(209),n(210);var o=g(n(93)),a=g(n(92)),s=g(n(136)),u=g(n(31)),c=g(n(62)),l=g(n(214)),f=g(n(218)),p=g(n(219)),d=g(n(220)),h=g(n(50)),v=g(n(145));function g(e){return e&&e.__esModule?e:{default:e}}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"init",value:function(){this.title="",this.permalink="",this.description="",this.variableMap=null,this.analyzeOnPage=null!==document.getElementById("rank-math-serp-checklist"),this.shouldAssess=!1,this.primaryResult={},this.serpCanonical=this.elemMetabox.find("#rank_math_canonical_url"),this.serpTitleField=this.elemMetabox.find("#rank_math_title"),this.serpPermalinkField=this.elemMetabox.find("#rank_math_permalink"),this.serpDescriptionField=this.elemMetabox.find("#rank_math_description"),this.serpWrapper=this.elemMetabox.find(".serp-preview"),this.serpBg=this.elemMetabox.find(".serp-preview-bg input"),this.serpTitle=this.serpWrapper.find(".serp-title"),this.serpPermalink=this.serpWrapper.find(".serp-url"),this.serpDescription=this.serpWrapper.find(".serp-description"),this.desktopSnippet=this.serpWrapper.find(".serp-snippet-data"),this.assessor=new Assessor({elemContent:this.elemContent,researches:this.researches}),this.analyzeOnPage&&(this.checkList=new l.default(this)),this.socialFields=new f.default(this),this.compareKeywords=new d.default(this.focusKeywords),this.focusKeywords=new p.default(this),this.wrapInGroup(),this.serpEvents(),this.updateEvents(),this.updatePreview(),this.initLengthIndicator(),rankMathAdmin.variableInserter(!1)}},{key:"wrapInGroup",value:function(){this.serpTitle.wrap('<div class="group"></div>'),this.serpPermalink.wrap('<div class="group"></div>'),this.serpDescription.wrap('<div class="group"></div>'),(0,i.default)(".cmb2-id-rank-math-title").insertAfter(this.serpTitle),(0,i.default)(".cmb2-id-rank-math-permalink").insertAfter(this.serpPermalink),(0,i.default)(".cmb2-id-rank-math-description").insertAfter(this.serpDescription),(0,i.default)(".group",this.serpWrapper).prepend('<span class="dashicons dashicons-no-alt serp-close"></span>')}},{key:"initLengthIndicator",value:function(){this.serpTitleField.lengthIndicator({minLength:15,maxLength:60,source:this.serpTitle}),this.serpPermalinkField.lengthIndicator({minLength:5,maxLength:75,source:this.serpPermalink}),this.serpDescriptionField.lengthIndicator({minLength:80,maxLength:160,source:this.serpDescription})}},{key:"serpEvents",value:function(){var e=this,t=this.elemMetabox.find(".rank-math-select-device");t.on("click",function(n){n.preventDefault();var r,o=(0,i.default)(n.currentTarget),a=o.hasClass("active");r=function(t){switch(t){case"desktop-preview":e.serpWrapper.removeClass("mobile-preview"),e.serpWrapper.addClass("desktop-preview expanded-preview");break;case"mobile-preview":e.serpWrapper.removeClass("desktop-preview"),e.serpWrapper.addClass("mobile-preview expanded-preview");break;default:e.serpWrapper.removeClass("mobile-preview expanded-preview"),e.serpWrapper.addClass("desktop-preview")}},t.removeClass("active"),a?r("normal"):o.hasClass("device-desktop")?(r("desktop-preview"),o.addClass("active")):o.hasClass("device-mobile")&&(r("mobile-preview"),o.addClass("active"))});var n=!0,r=this.elemMetabox.find(".rank-math-edit-snippet");this.elemMetabox.on("click",".rank-math-edit-snippet",function(t){t.preventDefault(),r.toggleClass("hidden active"),e.desktopSnippet.toggle();var i={type:"click",isHidden:n=!n};e.serpTitle.trigger(i),e.serpPermalink.trigger(i),e.serpDescription.trigger(i)}),this.elemMetabox.on("click",".serp-title, .serp-url, .serp-description, .serp-close",function(t){t.preventDefault();var o=(0,i.default)(t.target).parent();"isHidden"in t?o.toggleClass("active",!t.isHidden):(o.toggleClass("active"),0===e.serpWrapper.find(".group.active").length&&r.hasClass("active")&&(n=!n,r.toggleClass("hidden active")),3!==e.serpWrapper.find(".group.active").length||r.hasClass("active")||(n=!1,r.toggleClass("hidden active")))});var o=(0,i.default)("#rank_math_robots2");o.on("change",function(){o.is(":checked")?e.serpWrapper.addClass("noindex-preview"):e.serpWrapper.removeClass("noindex-preview")}).trigger("change"),(0,i.default)("textarea[data-autoresize]").each(function(){var e=(0,i.default)(this);e.on("keyup input",function(){e.css("height","auto").css("height",e.prop("scrollHeight"))})})}},{key:"updateEvents",value:function(){var e=this;this.serpTitleField.on("input",(0,c.default)(function(){e.updateTitlePreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemTitle.on("input",(0,c.default)(function(){e.setVariable("title",e.elemTitle.val()),e.setVariable("term",e.elemTitle.val()),e.setVariable("author",e.elemTitle.val()),e.setVariable("name",e.elemTitle.val()),e.updateTitlePreview()},500)),this.serpPermalinkField.val(this.serpPermalinkField.val()||this.elemSlug.val()).on("input",(0,c.default)(function(){var t=decodeURIComponent(e.serpPermalinkField.val());e.updateSlug(t),e.updatePermalinkPreview()},500)).on("blur",function(){var t=(0,s.default)(e.serpPermalinkField.val());e.updateSlug(t)}).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemSlug.on("input",(0,c.default)(function(){e.serpPermalinkField.val(e.elemSlug.val()).trigger("input")},500)),this.serpDescriptionField.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemDescription.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500))}},{key:"updateSlug",value:function(e){this.serpPermalinkField.val(e),this.elemSlug.val(e)}},{key:"seoAssessments",value:function(e){if(!1!==this.shouldAssess){var t=null;"title"===e?t=this.assessor.assessTitle(this.title):"permalink"===e?t=this.assessor.assessPermalink(this.permalink):"description"===e?(this.assessor.paper.setDescription(this.description),t=this.assessor.assessFocusKeyword(this.focusKeywords.getFocusKeyword())):"content"===e&&(t=this.assessor.assessContent(this.description)),this.setKeywordStatus(t)}}},{key:"seoTitleAssessments",value:function(){this.seoAssessments("title")}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessments("permalink")}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessments("description")}},{key:"seoContentAssessments",value:function(){this.seoAssessments("content")}},{key:"seoAssessAll",value:function(){if(!1!==this.shouldAssess){this.assessor.paper.setTitle(this.title),this.assessor.paper.setPermalink(this.permalink),this.assessor.paper.setKeyword(this.focusKeywords.getFocusKeyword().keyword),this.assessor.paper.setDescription(this.description);var e=this.assessor.runAll();this.setKeywordStatus(e)}}},{key:"setKeywordStatus",value:function(e){if(!1!==this.analyzeOnPage){var t=this.focusKeywords.getFocusKeyword();if(t.isPrimary||void 0===t.elem)this.checkList.elem.show(),this.checkList.display(e);else{var n={keywordDensity:e.keywordDensity,keywordInContent:e.keywordInContent,keywordInSubheadings:e.keywordInSubheadings};"post"!==rankMath.objectType&&this.checkList.elem.hide(),this.checkList.hidePrimary(),this.checkList.display(n),this.checkList.setSecondaryKeywordStatus(n,t.elem),delete e.keywordDensity,delete e.keywordInContent,delete e.keywordInSubheadings,delete this.primaryResult.keywordInTitle,delete this.primaryResult.keywordInMetaDescription,delete this.primaryResult.keywordInPermalink,delete this.primaryResult.keywordIn10Content,delete this.primaryResult.keywordInImageAlt,delete this.primaryResult.keywordNotUsed,delete this.primaryResult.titleStartWithKeyword}this.primaryResult=i.default.extend({},this.primaryResult,e),this.checkList.setPrimaryKeywordStatus(this.primaryResult,this.focusKeywords.elem.next().find(">li:not(.placeholder)").eq(1))}}},{key:"updatePreview",value:function(){this.updateTitlePreview(),this.updatePermalinkPreview(),this.updateDescriptionPreview(),this.shouldAssess=this.analyzeOnPage,this.seoAssessAll(),this.focusKeywords.elem.trigger("content-loaded"),this.updateFocusKeywords()}},{key:"updateFocusKeywords",value:function(){var e=this.focusKeywords.getFocusKeyword().keyword;if(""!==e&&(this.setVariable("focuskw",e),this.serpBg.val(e)),this.focusKeywords.getFocusKeyword().isPrimary){this.shouldAssess=!1,this.updateDescriptionPreview(),this.shouldAssess=!0,this.seoFocusKeywordAssessments(),this.highlightKeywords(),this.updatePreviewCallbacks("description",this.description),this.updatePreviewCallbacks("focus-keyword",e);var t=(0,i.default)(".focus-keyword-link");t.length&&""!==e&&t.attr("href",t.attr("href").replace("%focus_keyword%",e).replace("%post_type%",rankMath.objectType).replace("%taxonomy%",rankMath.objectType))}else this.seoFocusKeywordAssessments()}},{key:"updateTitlePreview",value:function(){this.title=this.serpTitleField.val();var e=""!==this.title;this.title=this.swapVars(""!==this.title?this.title:this.serpTitle.data("format")),this.serpTitle.html(this.title),this.serpTitleField.attr("placeholder",e?this.title:this.serpTitle.data("format")),this.socialFields.facebookTitleField.attr("placeholder",this.title),this.socialFields.twitterTitleField.attr("placeholder",this.title),this.seoTitleAssessments(),this.highlightKeywords(this.serpTitle),this.updatePreviewCallbacks("title",this.title),this.serpTitle.trigger("rank-math-vars-replaced")}},{key:"updatePermalinkPreview",value:function(){var e=this.serpPermalink.data("format")||"",t=(0,s.default)(this.serpPermalinkField.val());this.permalink=""!==t?e.replace(/%(postname|pagename)%/,t).trimRight("/")+"/":"",this.serpCanonical.attr("placeholder",this.permalink),this.serpPermalink.html(this.permalink),this.seoPermalinkAssessments(),this.highlightKeywords(this.serpPermalink),this.updatePreviewCallbacks("permalink",this.permalink),this.serpPermalink.trigger("rank-math-vars-replaced")}},{key:"updateDescriptionPreview",value:function(){this.description=this.swapVars(this.getDescription()),this.serpDescription.html(this.description),this.serpDescriptionField.attr("placeholder",""!==this.description?this.description:this.serpDescription.data("format"));var e=this.getDescriptionTruncated(this.description,300);this.socialFields.facebookDescriptionField.attr("placeholder",e),this.socialFields.twitterDescriptionField.attr("placeholder",e),this.seoContentAssessments(),this.highlightKeywords(this.serpDescription),this.updatePreviewCallbacks("description",this.description),this.serpDescription.trigger("rank-math-vars-replaced")}},{key:"updatePreviewCallbacks",value:function(e,t){this.elemMetabox.trigger("rank-math-updating-preview-"+(e=e||"global")),this.elemMetabox.trigger("rank-math-"+e+"-updated",t)}},{key:"highlightKeywords",value:function(e){var t=this.focusKeywords.getFocusKeyword().keyword;!1!==t&&(e?(e.hasClass("serp-url")&&(t=this.assessor.paper.get("keywordPermalink")),e.rankMathUnhighlight(),e.rankMathHighlight(t)):(this.serpTitle.rankMathUnhighlight(),this.serpTitle.rankMathHighlight(t),this.serpPermalink.rankMathUnhighlight(),this.serpPermalink.rankMathHighlight(this.assessor.paper.get("keywordPermalink")),this.serpDescription.rankMathUnhighlight(),this.serpDescription.rankMathHighlight(t)))}},{key:"swapVars",value:function(e,t){var n=this;return(e=e||"")?(t=t||this.getMapObj(),(e=e.replace(" %page%","").replace("%sep% %sep%","%sep%")).replace(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/giu,function(e){var r=e.toLowerCase().replace(/%+/g,"");return["title","post_title","term","author","name"].includes(r)?n.isGutenbergAvailable?t.title:n.elemTitle.val():["description","tag_description","category_description","cat_description","author_description","user_description"].includes(r)?(0,i.default)("#description").val():["fk","focuskeyword","focuskw"].includes(r)?n.focusKeywords.getFocusKeyword().keyword:r.includes("customfield(")?(r=r.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[r]:"":(r.includes("(")&&(r=r.split("(")[0]),r in t?t[r]:r)}).trim()):""}},{key:"getMapObj",value:function(){var e=this;return null!==this.variableMap?this.variableMap:(this.variableMap={},i.default.each(rankMath.variables,function(t,n){t=t.toLowerCase().replace(/%+/g,"").split("(")[0],e.variableMap[t]=n.example}),this.variableMap)}},{key:"setVariable",value:function(e,t){null!==this.variableMap?this.variableMap[e]=t:void 0!==rankMath.variables[e]&&(rankMath.variables[e].example=t)}},{key:"getContent",value:function(){return this.assessor.paper.get("content")}},{key:"getDescription",value:function(){this.assessor.refreshContent();var e=this.getExcerpt(),t=this.serpDescriptionField.val();if(""!==t)return(0,h.default)(t);if(!(0,a.default)(e)&&""!==e)return(0,h.default)(e);var n=this.serpDescription.data("format"),r=this.generateDescriptionFromContent(this.getContent());return this.setVariable("excerpt",r),(0,a.default)(n)||""===n?r:(0,h.default)(n)}},{key:"getExcerpt",value:function(){if(this.isGutenbergAvailable)return"";var e=this.elemDescription.val();return this.setVariable("excerpt",e),this.setVariable("excerpt_only",e),this.setVariable("wc_shortdesc",e),e}},{key:"generateDescriptionFromContent",value:function(e){if(""===e)return"";var t=this.focusKeywords.getFocusKeyword().keyword,n=(0,o.default)((0,v.default)(e,!0),function(e){return""!==i.default.trim(e)});if(!n.length)return"";if(""!==t){var r=(0,o.default)(n,function(e){return(0,u.default)(e.toLowerCase(),t)});if(r.length>0)return this.getDescriptionTruncated(r[0],160)}return this.getDescriptionTruncated(n[0],160)}},{key:"getDescriptionTruncated",value:function(e,t){return t?this.truncate(e.replace(/\r?\n|\r/g," "),t):e.replace(/\r?\n|\r/g," ")}},{key:"truncate",value:function(e,t){return e.length>t?e.substring(0,t):e}}]),e}();t.default=m},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(5)),o=s(n(235)),a=s(n(221));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.elemMetabox=(0,i.default)("#cmb2-metabox-rank_math_metabox"),e.elemSlug=(0,i.default)("#rank_math_permalink"),e.elemTitle=(0,i.default)("#display_name"),e.elemDescription=(0,i.default)("#description"),e.elemContent=null,e.researches={keywordInTitle:!0,keywordInMetaDescription:!0,keywordInPermalink:!0,titleStartWithKeyword:!0,keywordNotUsed:!0},e.researches=(0,a.default)(e.researches,Object.keys(rankMath.assessor.researchesTests)),e.init(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),r(t,[{key:"seoTitleAssessments",value:function(){this.seoAssessAll()}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessAll()}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessAll()}},{key:"seoContentAssessments",value:function(){this.seoAssessAll()}}]),t}();(0,i.default)(function(){new u})}]);
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=353)}([function(e,t){e.exports=Array.isArray},function(e,t,n){var r=n(75)("wks"),i=n(40),o=n(2).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(11),i=n(41);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){e.exports=!n(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=jQuery},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(70)("wks"),i=n(71),o=n(6).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(34),i=n(68);e.exports=n(20)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(12),i=n(77),o=n(79),a=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(2),i=n(3),o=n(14),a=n(40)("src"),s=Function.toString,u=(""+s).split("toString");n(39).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(c&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(t+""))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){return e}},,function(e,t,n){var r=n(89);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t){e.exports={}},function(e,t,n){var r=n(35);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(36)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(181),i=n(43);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(0),i=n(30),o=n(130),a=n(60);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(96),i=n(54);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},,function(e,t,n){var r=n(109),i=n(112)(r);e.exports=i},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(0),i=n(129),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},function(e,t,n){var r=n(52),i=n(26),o=n(105),a=n(140),s=n(141),u=Math.max;e.exports=function(e,t,n,c){e=i(e)?e:s(e),n=n&&!c?a(n):0;var l=e.length;return 0>n&&(n=u(l+n,0)),o(e)?l>=n&&e.indexOf(t,n)>-1:!!l&&r(e,t,n)>-1}},function(e,t,n){var r=n(156),i=n(33);e.exports=function(e){return r(i(e))}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(19),i=n(159),o=n(160),a=Object.defineProperty;t.f=n(20)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(70)("keys"),i=n(71);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(75)("keys"),i=n(40);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){"use strict";var r=n(3),i=n(13),o=n(22),a=n(43),s=n(1);e.exports=function(e,t,n){var u=s(e),c=n(a,u,""[e]),l=c[0],f=c[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,l),r(RegExp.prototype,u,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,n){var r=n(113),i=n(127),o=n(104),a=n(0),s=n(133);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(25),i=n(15);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&o>n;)e=e[i(t[n++])];return n&&n==o?e:void 0}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"\n")}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&9007199254740991>=e}},function(e,t,n){var r=n(115),i=n(116),o=n(117),a=n(118),s=n(119);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},function(e,t,n){var r=n(120),i=n(57);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(24);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){var r=n(24),i=n(211),o=n(144),a=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,f,p,d,h=0,v=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,h=t,f=e.apply(r,n)}function k(e){var n=e-d;return void 0===d||n>=t||0>n||g&&e-h>=l}function b(){var e=i();if(k(e))return w(e);p=setTimeout(b,function(e){var n=t-(e-d);return g?s(n,l-(e-h)):n}(e))}function w(e){return p=void 0,m&&u?y(e):(u=c=void 0,f)}function x(){var e=i(),n=k(e);if(u=arguments,c=this,d=e,n){if(void 0===p)return function(e){return h=e,p=setTimeout(b,t),v?y(e):f}(d);if(g)return p=setTimeout(b,t),y(d)}return void 0===p&&(p=setTimeout(b,t)),f}return t=o(t)||0,r(n)&&(v=!!n.leading,l=(g="maxWait"in n)?a(o(n.maxWait)||0,t):l,m="trailing"in n?!!n.trailing:m),x.cancel=function(){void 0!==p&&clearTimeout(p),h=0,u=d=c=p=void 0},x.flush=function(){return void 0===p?f:w(i())},x}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(65),i=n(66),o=n(161),a=n(10),s=n(18),u=n(162),c=n(73),l=n(170),f=n(8)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,g,m){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in P)return P[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,O=!1,P=e.prototype,T=P[f]||P["@@iterator"]||v&&P[v],C=T||w(v),S=v?_?w("entries"):C:void 0,j="Array"==t&&P.entries||T;if(j&&(b=l(j.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||a(b,f,d)),_&&T&&"values"!==T.name&&(O=!0,C=function(){return T.call(this)}),r&&!m||!p&&!O&&P[f]||a(P,f,C),s[t]=C,s[x]=d,v)if(y={values:_?C:w("values"),keys:g?C:w("keys"),entries:S},m)for(k in y)k in P||o(P,k,y[k]);else i(i.P+i.F*(p||O),t,y);return y}},function(e,t){e.exports=!0},function(e,t,n){var r=n(6),i=n(7),o=n(157),a=n(10),s=n(21),u=function(e,t,n){var c,l,f,p=e&u.F,d=e&u.G,h=e&u.S,v=e&u.P,g=e&u.B,m=e&u.W,y=d?i:i[t]||(i[t]={}),k=y.prototype,b=d?r:h?r[t]:(r[t]||{}).prototype;for(c in d&&(n=t),n)(l=!p&&b&&void 0!==b[c])&&s(y,c)||(f=l?b[c]:n[c],y[c]=d&&"function"!=typeof b[c]?n[c]:g&&l?o(f,r):m&&b[c]==f?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):v&&"function"==typeof f?o(Function.call,f):f,v&&((y.virtual||(y.virtual={}))[c]=f,e&u.R&&k&&!k[c]&&a(k,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(35),i=n(6).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(165),i=n(72);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(7),i=n(6),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(65)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(34).f,i=n(21),o=n(8)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(33);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(39),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(76)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t,n){e.exports=!n(4)&&!n(22)(function(){return 7!=Object.defineProperty(n(78)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(9),i=n(2).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(184);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(83),i=n(45);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(14),i=n(23),o=n(188)(!1),a=n(44)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(11).f,i=n(14),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(9),i=n(80),o=n(1)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(148),i=n(149),o=n(176);e.exports=function(e,t){return r(e)||i(e,t)||o()}},function(e,t,n){e.exports=n(196)},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(132),i=n(102);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&t>e}},function(e,t){e.exports=function(e){return void 0===e}},function(e,t,n){var r=n(107),i=n(108),o=n(47),a=n(0);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},function(e,t,n){var r=n(61),i=n(47),o=n(146),a=n(0);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(r,"").replace(i,"")};var r=/\[[^<>&\/\[\] - =]+?( [^\]]+?)?\]/g,i=/\[\/[^<>&\/\[\] - =]+?\]/g},function(e,t,n){var r=n(53),i=n(24);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(0);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return r(e)?e:[e]}},function(e,t,n){var r=n(52);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(25),i=n(103),o=n(0),a=n(91),s=n(54),u=n(15);e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(o(e)||i(e))}},function(e,t){e.exports=function(){return!1}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(53),i=n(0),o=n(57);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},,function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},function(e,t,n){var r=n(28);e.exports=function(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}},function(e,t,n){var r=n(110),i=n(29);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(111)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},function(e,t,n){var r=n(26);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},function(e,t,n){var r=n(114),i=n(126),o=n(59);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(55),i=n(56);e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=n[a])[0],f=e[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(o)var h=o(f,p,l,e,t,d);if(!(void 0===h?i(p,f,3,o,d):h))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(17),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return n>=0&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(17);e.exports=function(e){var t=this.__data__,n=r(t,e);return 0>n?void 0:t[n][1]}},function(e,t,n){var r=n(17);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(17);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return 0>i?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(55),i=n(121),o=n(123),a=n(124),s=n(99),u=n(0),c=n(100),l=n(101),f="[object Arguments]",p="[object Array]",d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,g,m){var y=u(e),k=u(t),b=y?p:s(e),w=k?p:s(t),x=(b=b==f?d:b)==d,_=(w=w==f?d:w)==d,O=b==w;if(O&&c(e)){if(!c(t))return!1;y=!0,x=!1}if(O&&!x)return m||(m=new r),y||l(e)?i(e,t,n,v,g,m):o(e,t,b,n,v,g,m);if(!(1&n)){var P=x&&h.call(e,"__wrapped__"),T=_&&h.call(t,"__wrapped__");if(P||T){var C=P?e.value():e,S=T?t.value():t;return m||(m=new r),g(C,S,n,v,m)}}return!!O&&(m||(m=new r),a(e,t,n,v,g,m))}},function(e,t,n){var r=n(97),i=n(122),o=n(98);e.exports=function(e,t,n,a,s,u){var c=1&n,l=e.length,f=t.length;if(!(l==f||c&&f>l))return!1;var p=u.get(e);if(p&&u.get(t))return p==t;var d=-1,h=!0,v=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++d<l;){var g=e[d],m=t[d];if(a)var y=c?a(m,g,d,t,e,u):a(g,m,d,e,t,u);if(void 0!==y){if(y)continue;h=!1;break}if(v){if(!i(t,function(e,t){if(!o(v,t)&&(g===e||s(g,e,n,a,u)))return v.push(t)})){h=!1;break}}else if(g!==m&&!s(g,m,n,a,u)){h=!1;break}}return u.delete(e),u.delete(t),h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(125),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in t:i.call(t,p)))return!1}var d=s.get(e);if(d&&s.get(t))return d==t;var h=!0;s.set(e,t),s.set(t,e);for(var v=u;++f<l;){var g=e[p=c[f]],m=t[p];if(o)var y=u?o(m,g,p,t,e,s):o(g,m,p,e,t,s);if(!(void 0===y?g===m||a(g,m,n,o,s):y)){h=!1;break}v||(v="constructor"==p)}if(h&&!v){var k=e.constructor,b=t.constructor;k!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof k&&k instanceof k&&"function"==typeof b&&b instanceof b)&&(h=!1)}return s.delete(e),s.delete(t),h}},function(e,t,n){var r=n(51)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(58),i=n(29);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},function(e,t,n){var r=n(56),i=n(128),o=n(90),a=n(30),s=n(58),u=n(59),c=n(15);e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},function(e,t,n){var r=n(48);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=n(131)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(r,function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)}),t});e.exports=o},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(134),i=n(135),o=n(30),a=n(15);e.exports=function(e){return o(e)?r(a(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(48);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(e=(0,i.default)(e)).replace(/ /gi,"-").toLowerCase()};var r,i=(r=n(137))&&r.__esModule?r:{default:r}},function(e,t,n){var r=n(138),i=n(60),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]/g;e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(a,"")}},function(e,t,n){var r=n(139)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(142),i=n(29);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){var r=n(61);e.exports=function(e,t){return r(t,function(t){return e[t]})}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=u((0,i.autop)((0,a.default)(e)),t);return n.length>0?n:[e]};var r=s(n(94)),i=n(147),o=s(n(50)),a=s(n(95));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t){var n=[];t=t||!1;for(var i=/<p(?:[^>]+)?>(.*?)<\/p>/gi,a=void 0;null!==(a=i.exec(e));)n.push(a);return(0,r.default)(n,function(e){return t?(0,o.default)(e[1]):e[1]})}},function(e,t,n){var r=n(28),i=n(26);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,function(e,r,i){o[++n]=t(e,r,i)}),o}},function(e,t,n){"use strict";n.r(t),n.d(t,"autop",function(){return c}),n.d(t,"removep",function(){return l});var r=n(87),i=n.n(r),o=(n(177),n(194),n(195),n(88)),a=n.n(o),s=(n(199),n(200),/(<((?=!--|!\[CDATA\[)((?=!-)!(?:-(?!->)[^\-]*)*(?:-->)?|!\[CDATA\[[^\]]*(?:](?!]>)[^\]]*)*?(?:]]>)?)|[^>]*>?))/);function u(e,t){for(var n=function(e){for(var t,n=[],r=e;t=r.match(s);)n.push(r.slice(0,t.index)),n.push(t[0]),r=r.slice(t.index+t[0].length);return r.length&&n.push(r),n}(e),r=!1,i=a()(t),o=1;n.length>o;o+=2)for(var u=0;i.length>u;u++){var c=i[u];if(-1!==n[o].indexOf(c)){n[o]=n[o].replace(RegExp(c,"g"),t[c]),r=!0;break}}return r&&(e=n.join("")),e}function c(e){var t=1>=arguments.length||void 0===arguments[1]||arguments[1],n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){var r=e.split("</pre>"),o=r.pop();e="";for(var a=0;r.length>a;a++){var s=r[a],c=s.indexOf("<pre");if(-1!==c){var l="<pre wp-pre-tag-"+a+"></pre>";n.push([l,s.substr(c)+"</pre>"]),e+=s.substr(0,c)+l}else e+=s}e+=o}var f="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=u(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(RegExp("(<"+f+"[s/>])","g"),"\n\n$1")).replace(RegExp("(</"+f+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));var p=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",p.forEach(function(t){e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(RegExp("<p>s*(</?"+f+"[^>]*>)","g"),"$1")).replace(RegExp("(</?"+f+"[^>]*>)s*</p>","g"),"$1"),t&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,function(e){return e[0].replace(/\n/g,"<WPPreserveNewline />")})).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,function(e,t){return t?e:"<br />\n"})).replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(RegExp("(</?"+f+"[^>]*>)s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach(function(t){var n=i()(t,2);e=e.replace(n[0],n[1])}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}function l(e){var t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",r=t+"|pre",i=[],o=!1,a=!1;return e?(-1===e.indexOf("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(e){return i.push(e),"<wp-preserve>"})),-1!==e.indexOf("<pre")&&(o=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(e){return(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")})),-1!==e.indexOf("[caption")&&(a=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){return e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(RegExp("\\s*</("+n+")>\\s*","g"),"</$1>\n")).replace(RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,function(e,t){return t&&-1!==t.indexOf("\n")?"\n\n":"\n"})).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(RegExp("\\s*<((?:"+r+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(RegExp("\\s*</("+r+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(/<wp-line-break>/g,"\n")),a&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),i.length&&(e=e.replace(/<wp-preserve>/g,function(){return i.shift()})),e):""}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t,n){var r=n(150);e.exports=function(e,t){var n=[],i=!0,o=!1,a=void 0;try{for(var s,u=r(e);!(i=(s=u.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return n}},function(e,t,n){e.exports=n(151)},function(e,t,n){n(152),n(171),e.exports=n(173)},function(e,t,n){n(153);for(var r=n(6),i=n(10),o=n(18),a=n(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;s.length>u;u++){var c=s[u],l=r[c],f=l&&l.prototype;f&&!f[a]&&i(f,a,c),o[c]=o.Array}},function(e,t,n){"use strict";var r=n(154),i=n(155),o=n(18),a=n(32);e.exports=n(64)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(63);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(158);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){e.exports=!n(20)&&!n(36)(function(){return 7!=Object.defineProperty(n(67)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(35);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";var r=n(163),i=n(68),o=n(73),a={};n(10)(a,n(8)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(19),i=n(164),o=n(72),a=n(38)("IE_PROTO"),s=function(){},u=function(){var e,t=n(67)("iframe"),r=o.length;for(t.style.display="none",n(169).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(34),i=n(19),o=n(69);e.exports=n(20)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(21),i=n(32),o=n(166)(!1),a=n(38)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(32),i=n(167),o=n(168);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(37),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(37),i=Math.max,o=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(6).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(21),i=n(74),o=n(38)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){"use strict";var r=n(172)(!0);n(64)(String,"String",function(e){this._t=e+"",this._i=0},function(){var e,t=this._t,n=this._i;return t.length>n?(e=r(t,n),this._i+=e.length,{value:e,done:!1}):{value:void 0,done:!0}})},function(e,t,n){var r=n(37),i=n(33);e.exports=function(e){return function(t,n){var o,a,s=i(t)+"",u=r(n),c=s.length;return 0>u||u>=c?e?"":void 0:55296>(o=s.charCodeAt(u))||o>56319||u+1===c||56320>(a=s.charCodeAt(u+1))||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){var r=n(19),i=n(174);e.exports=n(7).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){var r=n(175),i=n(8)("iterator"),o=n(18);e.exports=n(7).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(63),i=n(8)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(e,t,n){for(var r=n(178),i=n(82),o=n(13),a=n(2),s=n(3),u=n(42),c=n(1),l=c("iterator"),f=c("toStringTag"),p=u.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},h=i(d),v=0;h.length>v;v++){var g,m=h[v],y=d[m],k=a[m],b=k&&k.prototype;if(b&&(b[l]||s(b,l,p),b[f]||s(b,f,m),u[m]=p,y))for(g in r)b[g]||o(b,g,r[g],!0)}},function(e,t,n){"use strict";var r=n(179),i=n(180),o=n(42),a=n(23);e.exports=n(182)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return e&&e.length>n?i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]]):(this._t=void 0,i(1))},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){var r=n(1)("unscopables"),i=Array.prototype;null==i[r]&&n(3)(i,r,{}),e.exports=function(e){i[r][e]=!0}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(80);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";var r=n(76),i=n(183),o=n(13),a=n(3),s=n(42),u=n(185),c=n(85),l=n(192),f=n(1)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,h,v,g,m){u(n,t,h);var y,k,b,w=function(e){if(!p&&e in P)return P[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",_="values"==v,O=!1,P=e.prototype,T=P[f]||P["@@iterator"]||v&&P[v],C=T||w(v),S=v?_?w("entries"):C:void 0,j="Array"==t&&P.entries||T;if(j&&(b=l(j.call(new e)))!==Object.prototype&&b.next&&(c(b,x,!0),r||"function"==typeof b[f]||a(b,f,d)),_&&T&&"values"!==T.name&&(O=!0,C=function(){return T.call(this)}),r&&!m||!p&&!O&&P[f]||a(P,f,C),s[t]=C,s[x]=d,v)if(y={values:_?C:w("values"),keys:g?C:w("keys"),entries:S},m)for(k in y)k in P||o(P,k,y[k]);else i(i.P+i.F*(p||O),t,y);return y}},function(e,t,n){var r=n(2),i=n(39),o=n(3),a=n(13),s=n(81),u=function(e,t,n){var c,l,f,p,d=e&u.F,h=e&u.G,v=e&u.P,g=e&u.B,m=h?r:e&u.S?r[t]||(r[t]={}):(r[t]||{}).prototype,y=h?i:i[t]||(i[t]={}),k=y.prototype||(y.prototype={});for(c in h&&(n=t),n)f=((l=!d&&m&&void 0!==m[c])?m:n)[c],p=g&&l?s(f,r):v&&"function"==typeof f?s(Function.call,f):f,m&&a(m,c,f,e&u.U),y[c]!=f&&o(y,c,p),v&&k[c]!=f&&(k[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var r=n(186),i=n(41),o=n(85),a={};n(3)(a,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(12),i=n(187),o=n(45),a=n(44)("IE_PROTO"),s=function(){},u=function(){var e,t=n(78)("iframe"),r=o.length;for(t.style.display="none",n(191).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(11),i=n(12),o=n(82);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(23),i=n(189),o=n(190);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(84),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(84),i=Math.max,o=Math.min;e.exports=function(e,t){return 0>(e=r(e))?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(14),i=n(193),o=n(44)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(43);e.exports=function(e){return Object(r(e))}},function(e,t,n){n(46)("split",2,function(e,t,r){"use strict";var i=n(86),o=r,a=[].push;if("".split(/.?/).length){var s=void 0===/()??/.exec("")[1];r=function(e,t){var n=this+"";if(void 0===e&&0===t)return[];if(!i(e))return o.call(n,e,t);var r,u,c,l,f,p=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,v=void 0===t?4294967295:t>>>0,g=RegExp(e.source,d+"g");for(s||(r=RegExp("^"+g.source+"$(?!\\s)",d));(u=g.exec(n))&&((c=u.index+u[0].length)<=h||(p.push(n.slice(h,u.index)),!s&&u.length>1&&u[0].replace(r,function(){for(f=1;arguments.length-2>f;f++)void 0===arguments[f]&&(u[f]=void 0)}),u.length>1&&n.length>u.index&&a.apply(p,u.slice(1)),l=u[0].length,h=c,v>p.length));)g.lastIndex===u.index&&g.lastIndex++;return h===n.length?!l&&g.test("")||p.push(""):p.push(n.slice(h)),p.length>v?p.slice(0,v):p}}return[function(n,i){var o=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(o+"",n,i)},r]})},function(e,t,n){n(46)("replace",2,function(e,t,n){return[function(r,i){"use strict";var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(o+"",r,i)},n]})},function(e,t,n){n(197),e.exports=n(7).Object.keys},function(e,t,n){var r=n(74),i=n(69);n(198)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(66),i=n(7),o=n(36);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t,n){n(46)("match",1,function(e,t,n){return[function(n){"use strict";var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):RegExp(n)[t](r+"")},n]})},function(e,t,n){var r=n(2),i=n(201),o=n(11).f,a=n(205).f,s=n(86),u=n(206),c=r.RegExp,l=c,f=c.prototype,p=/a/g,d=/a/g,h=new c(p)!==p;if(n(4)&&(!h||n(22)(function(){return d[n(1)("match")]=!1,c(p)!=p||c(d)==d||"/a/i"!=c(p,"i")}))){c=function(e,t){var n=this instanceof c,r=s(e),o=void 0===t;return!n&&r&&e.constructor===c&&o?e:i(h?new l(r&&!o?e.source:e,t):l((r=e instanceof c)?e.source:e,r&&o?u.call(e):t),n?this:f,c)};for(var v=function(e){e in c||o(c,e,{configurable:!0,get:function(){return l[e]},set:function(t){l[e]=t}})},g=a(l),m=0;g.length>m;)v(g[m++]);f.constructor=c,c.prototype=f,n(13)(r,"RegExp",c)}n(207)("RegExp")},function(e,t,n){var r=n(9),i=n(202).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t,n){var r=n(9),i=n(12),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(81)(Function.call,n(203).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){var r=n(204),i=n(41),o=n(23),a=n(79),s=n(14),u=n(77),c=Object.getOwnPropertyDescriptor;t.f=n(4)?c:function(e,t){if(e=o(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(83),i=n(45).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";var r=n(12);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";var r=n(2),i=n(11),o=n(4),a=n(1)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r};i.default.extend({rankMathHighlight:function(e,t,n,r){if(3===e.nodeType){var o=e.data.match(t);if(o){var a=document.createElement(n||"span");a.className=r||"highlight";var s=e.splitText(o.index);s.splitText(o[0].length);var u=s.cloneNode(!0);return a.appendChild(u),s.parentNode.replaceChild(a,s),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==r))for(var c=0;e.childNodes.length>c;c++)c+=i.default.rankMathHighlight(e.childNodes[c],t,n,r);return 0}}),i.default.fn.rankMathUnhighlight=function(e){var t={className:"highlight",element:"span"};return i.default.extend(t,e),this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()},i.default.fn.rankMathHighlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(i.default.extend(n,t),void 0===e||""===e)return this;if(e.constructor===String&&(e=[e]),e=i.default.grep(e,function(e){return""!==e}),0===(e=i.default.map(e,function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")})).length)return this;var r=n.caseSensitive?"":"i",o="("+e.join("|")+")";n.wordsOnly&&(o="\\b"+o+"\\b");var a=RegExp(o,r);return this.each(function(){i.default.rankMathHighlight(this,a,n.element,n.className)})}},function(e,t,n){"use strict";var r,i=(r=n(5))&&r.__esModule?r:{default:r},o=document.createElement("div");i.default.fn.lengthIndicator=function(e){var t=this;e=i.default.extend({},{minLength:0,maxLength:1e3,source:null},e),t.wrap('<span class="length-indicator-wrapper"/>'),t.parent().append('<span class="length-indicator"><span/></span><span class="length-count">0 / '+e.maxLength+"</span>");var n=t.parent().find(".length-indicator"),r=n.find(">span"),a=t.parent().find(".length-count"),s=function(){var i=function(e){return e&&"string"==typeof e&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"").replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),o.innerHTML=e,e=o.textContent,o.textContent=""),e}(null===e.source?t.val():e.source.text()).length;n.removeClass("invalid short"),r.css("left",Math.min(100,Math.floor(i/e.maxLength*100))+"%"),a.text(i+" / "+e.maxLength),i>e.minLength&&e.maxLength>=i||n.addClass("invalid")};t.on("input",s),null!==e.source&&e.source.on("rank-math-vars-replaced",s),s()}},function(e,t,n){var r=n(212);e.exports=function(){return r.Date.now()}},function(e,t,n){var r=n(213),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){var r;r=n(143),e.exports="object"==typeof r&&r&&r.Object===Object&&r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(215));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank-math-serp-checklist",t.elemMetabox),this.scoreElem=(0,i.default)('<div class="misc-pub-section rank-math-seo-score"><span class="score-text"><span class="dashicons dashicons-chart-area"></span> SEO: <strong>Not available</strong></span></div>'),this.scoreText=this.scoreElem.find("strong"),this.scoreField=(0,i.default)("#rank_math_seo_score"),this.fkScoreElem=(0,i.default)('<div class="rank-math-seo-score below-focus-keyword"><span class="score-text">Not available</span></div>'),this.fkScoreText=this.fkScoreElem.find("span"),(0,i.default)("#misc-publishing-actions").append(this.scoreElem),(0,i.default)(".cmb-td",".cmb2-id-rank-math-focus-keyword").append(this.fkScoreElem),this.events()}return r(e,[{key:"display",value:function(e){var t=this;i.default.each(e,function(e,n){var r=t.elem.find(".seo-check-"+e);r.removeClass("test-ok test-gallery test-fail test-empty test-looking veryEasy difficult veryDifficult"),r.addClass("test-"+n.status),r.show(),"calculateFleschReading"===e&&r.addClass(n.factors[2]),r.find("span:eq(0)").html(n.message)})}},{key:"setPrimaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,o.default)(e,function(e,t,n){return!1===t&&(t={score:0}),e+t.score},0);status="bad-fk",n>80?status="good-fk":n>50&&(status="ok-fk"),t.removeClass("bad-fk ok-fk good-fk"),this.scoreElem.removeClass("bad-fk ok-fk good-fk"),this.fkScoreElem.removeClass("bad-fk ok-fk good-fk"),t.addClass(status),this.scoreElem.addClass(status),this.fkScoreElem.addClass(status),this.scoreText.html(n+" / 100"),this.fkScoreText.html(n+" / 100"),this.scoreField.val(parseInt(n))}},{key:"setSecondaryKeywordStatus",value:function(e,t){t.removeClass("good-fk ok-fk bad-fk");var n=(0,o.default)(e,function(e,t){return e+("ok"===t.status?1:0)},0);t.addClass(3===n?"good-fk":2===n?"ok-fk":"bad-fk")}},{key:"hidePrimary",value:function(){this.elem.find("li.is-primary").hide()}},{key:"events",value:function(){var e=this;this.elem.on("click",".group-handle",function(t){t.preventDefault();var n=(0,i.default)(t.target).closest(".rank-math-serp-group"),r={};n.toggleClass("state-open state-closed"),e.updateGroupStatus(n),e.elem.find(">.rank-math-serp-group").each(function(){var e=(0,i.default)(this);r[e.data("id")]=e.hasClass("state-closed")?"closed":"open"}),i.default.ajax({url:rankMath.ajaxurl,type:"POST",data:{action:"rank_math_save_checklist_layout",security:rankMath.security,layout:r}})})}},{key:"updateGroupStatus",value:function(e){(e=e||(0,i.default)(".rank-math-serp-group")).each(function(){var e=(0,i.default)(this);1>e.find("li.test-fail").length&&1>e.find("li.test-empty").length?e.find(".group-status").addClass("passed"):e.find(".group-status").removeClass("passed")})}}]),e}();t.default=s},function(e,t,n){var r=n(216),i=n(28),o=n(47),a=n(217),s=n(0);e.exports=function(e,t,n){var u=s(e)?r:a,c=3>arguments.length;return u(e,o(t,4),n,c,i)}},function(e,t){e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},function(e,t){e.exports=function(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(r=n(5))&&r.__esModule?r:{default:r},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metabox=t,this.currentNetwork="facebook",this.useFacebook=!0,this.shouldUpdatePreview=!1,this.facebookTitleField=t.elemMetabox.find("#rank_math_facebook_title"),this.facebookDescriptionField=t.elemMetabox.find("#rank_math_facebook_description"),this.twitterTitleField=t.elemMetabox.find("#rank_math_twitter_title"),this.twitterDescriptionField=t.elemMetabox.find("#rank_math_twitter_description"),this.facebookImageField=t.elemMetabox.find("#rank_math_facebook_image"),this.twitterImageField=t.elemMetabox.find("#rank_math_twitter_image"),this.facebookImageStatus=t.elemMetabox.find("#rank_math_facebook_image-status"),this.twitterImageStatus=t.elemMetabox.find("#rank_math_twitter_image-status"),this.socialWrapper=t.elemMetabox.find(".rank-math-social-preview"),this.socialPreview=this.socialWrapper.find(".rank-math-social-preview-item"),this.socialTitle=this.socialWrapper.find(".rank-math-social-preview-title"),this.socialDescription=this.socialWrapper.find(".rank-math-social-preview-description"),this.events(),this.shouldUpdatePreview=!0,this.updatePreview()}return i(e,[{key:"events",value:function(){var e=this;this.facebookTitleField.on("input",function(){e.updateTitlePreview()}),this.facebookDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.facebookImageField.on("input",function(){e.updateThumbnailPreview()}),this.twitterTitleField.on("input",function(){e.updateTitlePreview()}),this.twitterDescriptionField.on("input",function(){e.updateDescriptionPreview()}),this.twitterImageField.on("input",function(){e.updateThumbnailPreview()});var t=(0,o.default)(".rank-math-social-preview-button"),n=t.find(">span");t.on("click",function(t){t.preventDefault(),n.toggleClass("dashicons-arrow-down dashicons-arrow-up"),e.updatePreview(),e.socialWrapper.toggleClass("open"),e.socialPreview.slideToggle()});var r=(0,o.default)("#rank_math_twitter_card_type");(0,o.default)(".preview-network").on("click",function(n){(0,o.default)(n.target).hasClass("tab-facebook")?t.show():r.trigger("change"),e.updatePreview()}),r.on("change",function(){var n=r.val();"player"===n&&(0,o.default)(".cmb2-id-rank-math-twitter-image, .cmb2-id-rank-math-twitter-title, .cmb2-id-rank-math-twitter-description").show();var i="player"===n||"app"===n;t.toggle(!i),(0,o.default)(".cmb2-id-rank-math-twitter-use-facebook").toggle(!i),e.updatePreview()}).trigger("change");var i=(0,o.default)("#rank_math_twitter_use_facebook2");(0,o.default)("#rank_math_twitter_use_facebook1, #rank_math_twitter_use_facebook2").on("input change",function(){e.useFacebook=i.is(":checked"),e.updatePreview()}).trigger("change"),(0,o.default)(".cmb2-id-rank-math-facebook-enable-image-overlay, .cmb2-id-rank-math-facebook-image-overlay, .cmb2-id-rank-math-twitter-enable-image-overlay, .cmb2-id-rank-math-twitter-image-overlay").on("change","input",function(){e.updateThumbnailOverlay()}),(0,o.default)(document).on("cmb_media_modal_select",function(t,n,r){"rank_math_facebook_image"!==r.field&&"rank_math_twitter_image"!==r.field||e.updateThumbnailPreview()}),(0,o.default)(document).on("cmb_init",function(t,n){n.$metabox.on("click",".cmb2-remove-file-button",function(){e.updateThumbnailPreview()})})}},{key:"updatePreview",value:function(){!1!==this.shouldUpdatePreview&&(this.currentNetwork=(0,o.default)(".preview-network.tab-active").attr("href").replace("#setting-panel-social-",""),this.socialWrapper.removeClass(),this.socialWrapper.addClass("rank-math-social-preview rank-math-social-preview-"+this.currentNetwork),"twitter"===this.currentNetwork&&this.socialWrapper.addClass((0,o.default)("#rank_math_twitter_card_type").val()),this.updateTitlePreview(),this.updateDescriptionPreview(),this.updateThumbnailPreview())}},{key:"updateTitlePreview",value:function(){var e=this[this.currentNetwork+"TitleField"].val()||this.metabox.title;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookTitleField.val()||this.metabox.title),e=this.metabox.truncate(this.metabox.swapVars(e),90),this.socialTitle.html(e)}},{key:"updateDescriptionPreview",value:function(){var e=this[this.currentNetwork+"DescriptionField"].val()||this.description;"twitter"===this.currentNetwork&&this.useFacebook&&(e=this.facebookDescriptionField.val()||this.metabox.description),e=this.metabox.truncate(this.metabox.swapVars(e),240),this.socialDescription.html(e)}},{key:"updateThumbnailPreview",value:function(){var e=(0,o.default)("#rank_math_post_thumbnail").attr("src"),t=this.metabox.getContent(),n=!!/<img(?:[^>]+)?>/.test(t)&&(0,o.default)(t).find("img:first").attr("src"),r=this.facebookImageField.val()||e||n||rankMath.defautOgImage,i=this.twitterImageField.val()||e||n||rankMath.defautOgImage;if("twitter"===this.currentNetwork&&this.useFacebook)i=r;else if(this.twitterImageStatus.find("img.cmb-file-field-image").length){var a=this.twitterImageStatus.siblings(".notice"),s=this.twitterImageStatus.find("img.cmb-file-field-image")[0];a.addClass("hidden"),(0,o.default)(s).on("load",function(){(200>s.naturalWidth||200>s.naturalHeight)&&a.removeClass("hidden")})}var u=this.facebookImageStatus.siblings(".notice"),c=this.facebookImageStatus.find("img.cmb-file-field-image");u.addClass("hidden"),"facebook"===this.currentNetwork&&this.facebookImageField.val()&&c.length&&(0,o.default)(c[0]).on("load",function(){(200>c[0].naturalWidth||200>c[0].naturalHeight)&&u.removeClass("hidden")});var l=(0,o.default)(".rank-math-social-preview-image");(0,o.default)(".facebook-thumbnail",l).attr("src",r),(0,o.default)(".twitter-thumbnail",l).attr("src",i),l.toggleClass("no-facebook-image",!r),l.toggleClass("no-twitter-image",!i),l.parents(".rank-math-social-preview-facebook").find(".error-msg").toggleClass("show",!r),l.parents(".rank-math-social-preview-twitter").find(".error-msg").toggleClass("show",!i),this.updateThumbnailOverlay()}},{key:"updateThumbnailOverlay",value:function(){var e=(0,o.default)(".rank-math-social-preview-image-overlay"),t=(0,o.default)('[name="rank_math_'+this.currentNetwork+'_enable_image_overlay"]:checked').val(),n=(0,o.default)('[name="rank_math_'+this.currentNetwork+'_image_overlay"]:checked').val(),r=!(0,o.default)(".rank-math-social-preview-image").hasClass("no-"+this.currentNetwork+"-image");"twitter"===this.currentNetwork&&this.useFacebook&&(n=(0,o.default)('[name="rank_math_facebook_image_overlay"]:checked').val(),r=!1);var i=(0,o.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-enable-image-overlay"),a="on"===i.find("input:checked").val();i.toggle(r),i.find(".notice-warning").toggle(a),"on"===t?(e.attr("src",rankMath.overlayImages[n].url).show(),(0,o.default)(".cmb2-id-rank-math-"+this.currentNetwork+"-image-overlay").toggle(r)):e.hide()}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(5)),o=a(n(62));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elem=(0,i.default)("#rank_math_focus_keyword");var r=(0,o.default)(function(){t.updateFocusKeywords()},200),a=(0,o.default)(function(e,n){var r=e.find("li:last").prev(),i=t.assessor.assessFocusKeyword({elem:r,isPrimary:!1,keyword:n});t.checkList.setSecondaryKeywordStatus(i,r)},200);this.elem.on("content-loaded",function(){var e=n.elem.next("ul"),r=n.getFocusKeywords();(0,i.default)(e).find("li:gt(1)").each(function(){var e=(0,i.default)(this),n=t.assessor.assessFocusKeyword({elem:e,isPrimary:!1,keyword:r[e.index()-1]});t.checkList.setSecondaryKeywordStatus(n,e)})}),this.elem.tagEditor({autocomplete:1===rankMath.maxTags?null:this.getAutocompleteOptions(),sortable:!0,placeholder:this.elem.attr("placeholder"),onChange:function(e,t,n){1===n.length?t.find("li:not(.placeholder)").last().addClass("selected-fk"):t.find(".selected-fk").removeClass("selected-fk"),r()},onSelect:function(e,t){var n=e.parent();return!(!n.hasClass("selected-fk")&&""!==e.html()&&(t.find(".tag-editor-tag.active").length&&t.find("input").blur(),n.addClass("selected-fk").siblings().removeClass("selected-fk"),r(),1))},beforeTagDelete:function(e,t,n){return 1===n.length||(e.hasClass("selected-fk")&&t.find(">li").eq(1).addClass("selected-fk"),!0)},beforeTagSave:function(e,t,n,r,i){if(0!==n.length&&i)return a(t,i),i}}),this.elem.next().find(">li:not(.placeholder)").eq(1).addClass("selected-fk");var s=this.elem.parent();s.append(s.find(".cmb2-metabox-description"))}return r(e,[{key:"getAutocompleteOptions",value:function(){return{minLength:2,source:function(e,t){i.default.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:e.term,nolabels:"t",client:"hp",ds:"",lr:"lang_"+rankMath.locale,hl:rankMath.locale},success:function(e){t(i.default.map(e[1],function(e){return{value:(0,i.default)("<span>").html(e[0]).text()}}))}})}}}},{key:"getFocusKeywords",value:function(){var e=this.elem.tagEditor("getTags")[0];return e?e.tags:[]}},{key:"getFocusKeyword",value:function(){var e=this.elem.tagEditor("getTags")[0];if(!e)return{isPrimary:!0,keyword:""};var t=e.editor.find(".selected-fk").first();return t.length?{elem:t,isPrimary:1===t.index(),keyword:t.find(".tag-editor-tag").text()}:e.tags.length?{isPrimary:!0,keyword:e.tags[0]}:{isPrimary:!0,keyword:""}}},{key:"clearFocusKeywords",value:function(){this.elem.tagEditor("clearTags")}},{key:"addFocusKeyword",value:function(e){this.elem.tagEditor("addTag",e)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=(r=n(5))&&r.__esModule?r:{default:r},a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.focusKeywords=t,this.modal=(0,o.default)("#rank-math-compare-keywords-wrapper"),this.holder=this.modal.find(".rank-math-keywords-fields"),this.iframe=this.modal.find("iframe.attachments-browser"),this.btnCompare=this.modal.find(".compare-keywords"),this.events()}return i(e,[{key:"events",value:function(){var e=this;(0,o.default)("#rank-math-compare-keywords-trigger").on("click",function(t){t.preventDefault();var n=e.focusKeywords.getFocusKeywords();e.holder.html(""),n.length?o.default.each(n,function(t,n){e.addNewField(n)}):e.addNewField(),e.modal.toggle(),e.btnCompare.trigger("click")}),this.modal.on("click",".media-modal-close",function(){e.modal.toggle()}),this.modal.on("click",".add-new-keywords",function(){e.addNewField()}),this.modal.on("click",".remove-keyword",function(e){(0,o.default)(e.currentTarget).parent().remove(),btnCompare.trigger("click")}),this.modal.on("click",".use-these-keywords",function(){e.focusKeywords.clearFocusKeywords(),e.holder.find("input").each(function(t,n){var r=(0,o.default)(n).val().trim();""!==r&&e.focusKeywords.addFocusKeyword(r)}),e.modal.toggle()}),this.btnCompare.on("click",function(){var t=[];if(e.holder.find("input").each(function(){var e=(0,o.default)(this).val().trim();""!==e&&t.push({keyword:e,geo:"",time:"today 12-m"})}),0===t.length)return!1;t={comparisonItem:t,category:0,property:""},e.iframe.attr("src",e.iframe.data("srcbase")+"&req="+encodeURIComponent(JSON.stringify(t)))}),this.holder.on("keydown","input",function(t){if(13===t.keyCode)return t.preventDefault(),e.btnCompare.trigger("click"),!1})}},{key:"addNewField",value:function(e){var t=(0,o.default)("<div/>"),n=(0,o.default)("<input/>",{type:"text",class:"widefat",value:e||""});t.append(n),t.append('<button class="button-small button-link button-link-delete remove-keyword"><span class="dashicons dashicons-trash"></span></button>'),this.holder.append(t),n.autocomplete(this.focusKeywords.getAutocompleteOptions()).focus()}}]),e}();t.default=a},function(e,t,n){var r=n(222),i=n(208)(function(e,t){return null==e?{}:r(e,t)});e.exports=i},function(e,t,n){var r=n(223),i=n(90);e.exports=function(e,t){return r(e,t,function(t,n){return i(e,n)})}},function(e,t,n){var r=n(48),i=n(224),o=n(25);e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=r(e,c);n(l,c)&&i(u,o(c,e),l)}return u}},function(e,t,n){var r=n(225),i=n(25),o=n(91),a=n(24),s=n(15);e.exports=function(e,t,n,u){if(!a(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,p=e;null!=p&&++c<l;){var d=s(t[c]),h=n;if(c!=f){var v=p[d];void 0===(h=u?u(v,d,p):void 0)&&(h=a(v)?v:o(t[c+1])?[]:{})}r(p,d,h),p=p[d]}return e}},function(e,t,n){var r=n(226),i=n(89),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t,n){var r=n(227);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(228),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=g(n(5));n(209),n(210);var o=g(n(93)),a=g(n(92)),s=g(n(136)),u=g(n(31)),c=g(n(62)),l=g(n(214)),f=g(n(218)),p=g(n(219)),d=g(n(220)),h=g(n(50)),v=g(n(145));function g(e){return e&&e.__esModule?e:{default:e}}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"init",value:function(){this.title="",this.permalink="",this.description="",this.variableMap=null,this.analyzeOnPage=null!==document.getElementById("rank-math-serp-checklist"),this.shouldAssess=!1,this.primaryResult={},this.serpCanonical=this.elemMetabox.find("#rank_math_canonical_url"),this.serpTitleField=this.elemMetabox.find("#rank_math_title"),this.serpPermalinkField=this.elemMetabox.find("#rank_math_permalink"),this.serpDescriptionField=this.elemMetabox.find("#rank_math_description"),this.serpWrapper=this.elemMetabox.find(".serp-preview"),this.serpBg=this.elemMetabox.find(".serp-preview-bg input"),this.serpTitle=this.serpWrapper.find(".serp-title"),this.serpPermalink=this.serpWrapper.find(".serp-url"),this.serpDescription=this.serpWrapper.find(".serp-description"),this.desktopSnippet=this.serpWrapper.find(".serp-snippet-data"),this.assessor=new Assessor({elemContent:this.elemContent,researches:this.researches}),this.analyzeOnPage&&(this.checkList=new l.default(this)),this.socialFields=new f.default(this),this.compareKeywords=new d.default(this.focusKeywords),this.focusKeywords=new p.default(this),this.wrapInGroup(),this.serpEvents(),this.updateEvents(),this.updatePreview(),this.initLengthIndicator(),rankMathAdmin.variableInserter(!1)}},{key:"wrapInGroup",value:function(){this.serpTitle.wrap('<div class="group"></div>'),this.serpPermalink.wrap('<div class="group"></div>'),this.serpDescription.wrap('<div class="group"></div>'),(0,i.default)(".cmb2-id-rank-math-title").insertAfter(this.serpTitle),(0,i.default)(".cmb2-id-rank-math-permalink").insertAfter(this.serpPermalink),(0,i.default)(".cmb2-id-rank-math-description").insertAfter(this.serpDescription),(0,i.default)(".group",this.serpWrapper).prepend('<span class="dashicons dashicons-no-alt serp-close"></span>')}},{key:"initLengthIndicator",value:function(){this.serpTitleField.lengthIndicator({minLength:15,maxLength:60,source:this.serpTitle}),this.serpPermalinkField.lengthIndicator({minLength:5,maxLength:75,source:this.serpPermalink}),this.serpDescriptionField.lengthIndicator({minLength:80,maxLength:160,source:this.serpDescription})}},{key:"serpEvents",value:function(){var e=this,t=this.elemMetabox.find(".rank-math-select-device");t.on("click",function(n){n.preventDefault();var r,o=(0,i.default)(n.currentTarget),a=o.hasClass("active");r=function(t){switch(t){case"desktop-preview":e.serpWrapper.removeClass("mobile-preview"),e.serpWrapper.addClass("desktop-preview expanded-preview");break;case"mobile-preview":e.serpWrapper.removeClass("desktop-preview"),e.serpWrapper.addClass("mobile-preview expanded-preview");break;default:e.serpWrapper.removeClass("mobile-preview expanded-preview"),e.serpWrapper.addClass("desktop-preview")}},t.removeClass("active"),a?r("normal"):o.hasClass("device-desktop")?(r("desktop-preview"),o.addClass("active")):o.hasClass("device-mobile")&&(r("mobile-preview"),o.addClass("active"))});var n=!0,r=this.elemMetabox.find(".rank-math-edit-snippet");this.elemMetabox.on("click",".rank-math-edit-snippet",function(t){t.preventDefault(),r.toggleClass("hidden active"),e.desktopSnippet.toggle();var i={type:"click",isHidden:n=!n};e.serpTitle.trigger(i),e.serpPermalink.trigger(i),e.serpDescription.trigger(i)}),this.elemMetabox.on("click",".serp-title, .serp-url, .serp-description, .serp-close",function(t){t.preventDefault();var o=(0,i.default)(t.target).parent();"isHidden"in t?o.toggleClass("active",!t.isHidden):(o.toggleClass("active"),0===e.serpWrapper.find(".group.active").length&&r.hasClass("active")&&(n=!n,r.toggleClass("hidden active")),3!==e.serpWrapper.find(".group.active").length||r.hasClass("active")||(n=!1,r.toggleClass("hidden active")))});var o=(0,i.default)("#rank_math_robots1"),a=(0,i.default)("#rank_math_robots2");o.on("change",function(){o.is(":checked")?(e.serpWrapper.addClass("noindex-preview"),a.prop("checked",!1).trigger("change")):e.serpWrapper.removeClass("noindex-preview")}),a.on("change",function(){a.is(":checked")?(e.serpWrapper.addClass("noindex-preview"),o.prop("checked",!1)):e.serpWrapper.removeClass("noindex-preview")}).trigger("change"),(0,i.default)("textarea[data-autoresize]").each(function(){var e=(0,i.default)(this);e.on("keyup input",function(){e.css("height","auto").css("height",e.prop("scrollHeight"))})})}},{key:"updateEvents",value:function(){var e=this;this.serpTitleField.on("input",(0,c.default)(function(){e.updateTitlePreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemTitle.on("input",(0,c.default)(function(){e.setVariable("title",e.elemTitle.val()),e.setVariable("term",e.elemTitle.val()),e.setVariable("author",e.elemTitle.val()),e.setVariable("name",e.elemTitle.val()),e.updateTitlePreview()},500)),this.serpPermalinkField.val(this.serpPermalinkField.val()||this.elemSlug.val()).on("input",(0,c.default)(function(){var t=decodeURIComponent(e.serpPermalinkField.val());e.updateSlug(t),e.updatePermalinkPreview()},500)).on("blur",function(){var t=(0,s.default)(e.serpPermalinkField.val());e.updateSlug(t)}).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemSlug.on("input",(0,c.default)(function(){e.serpPermalinkField.val(e.elemSlug.val()).trigger("input")},500)),this.serpDescriptionField.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500)).on("keypress",function(e){if(13===e.which||13===e.keyCode)return e.preventDefault(),(0,i.default)(e.target).closest(".cmb-row").prev().trigger("click"),!1}),this.elemDescription.on("input",(0,c.default)(function(){e.updateDescriptionPreview()},500))}},{key:"updateSlug",value:function(e){this.serpPermalinkField.val(e),this.elemSlug.val(e)}},{key:"seoAssessments",value:function(e){if(!1!==this.shouldAssess){var t=null;"title"===e?t=this.assessor.assessTitle(this.title):"permalink"===e?t=this.assessor.assessPermalink(this.permalink):"description"===e?(this.assessor.paper.setDescription(this.description),t=this.assessor.assessFocusKeyword(this.focusKeywords.getFocusKeyword())):"content"===e&&(t=this.assessor.assessContent(this.description)),this.setKeywordStatus(t)}}},{key:"seoTitleAssessments",value:function(){this.seoAssessments("title")}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessments("permalink")}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessments("description")}},{key:"seoContentAssessments",value:function(){this.seoAssessments("content")}},{key:"seoAssessAll",value:function(){if(!1!==this.shouldAssess){this.assessor.paper.setTitle(this.title),this.assessor.paper.setPermalink(this.permalink),this.assessor.paper.setKeyword(this.focusKeywords.getFocusKeyword().keyword),this.assessor.paper.setDescription(this.description);var e=this.assessor.runAll();this.setKeywordStatus(e)}}},{key:"setKeywordStatus",value:function(e){if(!1!==this.analyzeOnPage){var t=this.focusKeywords.getFocusKeyword();if(t.isPrimary||void 0===t.elem)this.checkList.elem.show(),this.checkList.display(e);else{var n={keywordDensity:e.keywordDensity,keywordInContent:e.keywordInContent,keywordInSubheadings:e.keywordInSubheadings};"post"!==rankMath.objectType&&this.checkList.elem.hide(),this.checkList.hidePrimary(),this.checkList.display(n),this.checkList.setSecondaryKeywordStatus(n,t.elem),delete e.keywordDensity,delete e.keywordInContent,delete e.keywordInSubheadings,delete this.primaryResult.keywordInTitle,delete this.primaryResult.keywordInMetaDescription,delete this.primaryResult.keywordInPermalink,delete this.primaryResult.keywordIn10Content,delete this.primaryResult.keywordInImageAlt,delete this.primaryResult.keywordNotUsed,delete this.primaryResult.titleStartWithKeyword}this.primaryResult=i.default.extend({},this.primaryResult,e),this.checkList.setPrimaryKeywordStatus(this.primaryResult,this.focusKeywords.elem.next().find(">li:not(.placeholder)").eq(1))}}},{key:"updatePreview",value:function(){this.updateTitlePreview(),this.updatePermalinkPreview(),this.updateDescriptionPreview(),this.shouldAssess=this.analyzeOnPage,this.seoAssessAll(),this.focusKeywords.elem.trigger("content-loaded"),this.updateFocusKeywords()}},{key:"updateFocusKeywords",value:function(){var e=this.focusKeywords.getFocusKeyword().keyword;if(""!==e&&(this.setVariable("focuskw",e),this.serpBg.val(e)),this.focusKeywords.getFocusKeyword().isPrimary){this.shouldAssess=!1,this.updateDescriptionPreview(),this.shouldAssess=!0,this.seoFocusKeywordAssessments(),this.highlightKeywords(),this.updatePreviewCallbacks("description",this.description),this.updatePreviewCallbacks("focus-keyword",e);var t=(0,i.default)(".focus-keyword-link");t.length&&""!==e&&t.attr("href",t.attr("href").replace("%focus_keyword%",e).replace("%post_type%",rankMath.objectType).replace("%taxonomy%",rankMath.objectType))}else this.seoFocusKeywordAssessments()}},{key:"updateTitlePreview",value:function(){this.title=this.serpTitleField.val();var e=""!==this.title;this.title=this.swapVars(""!==this.title?this.title:this.serpTitle.data("format")),this.serpTitle.html(this.title),this.serpTitleField.attr("placeholder",e?this.title:this.serpTitle.data("format")),this.socialFields.facebookTitleField.attr("placeholder",this.title),this.socialFields.twitterTitleField.attr("placeholder",this.title),this.seoTitleAssessments(),this.highlightKeywords(this.serpTitle),this.updatePreviewCallbacks("title",this.title),this.serpTitle.trigger("rank-math-vars-replaced")}},{key:"updatePermalinkPreview",value:function(){var e=this.serpPermalink.data("format")||"",t=(0,s.default)(this.serpPermalinkField.val());this.permalink=""!==t?e.replace(/%(postname|pagename)%/,t).trimRight("/")+"/":"",this.serpCanonical.attr("placeholder",this.permalink),this.serpPermalink.html(this.permalink),this.seoPermalinkAssessments(),this.highlightKeywords(this.serpPermalink),this.updatePreviewCallbacks("permalink",this.permalink),this.serpPermalink.trigger("rank-math-vars-replaced")}},{key:"updateDescriptionPreview",value:function(){this.description=this.swapVars(this.getDescription()),this.serpDescription.html(this.description),this.serpDescriptionField.attr("placeholder",""!==this.description?this.description:this.serpDescription.data("format"));var e=this.getDescriptionTruncated(this.description,300);this.socialFields.facebookDescriptionField.attr("placeholder",e),this.socialFields.twitterDescriptionField.attr("placeholder",e),this.seoContentAssessments(),this.highlightKeywords(this.serpDescription),this.updatePreviewCallbacks("description",this.description),this.serpDescription.trigger("rank-math-vars-replaced")}},{key:"updatePreviewCallbacks",value:function(e,t){this.elemMetabox.trigger("rank-math-updating-preview-"+(e=e||"global")),this.elemMetabox.trigger("rank-math-"+e+"-updated",t)}},{key:"highlightKeywords",value:function(e){var t=this.focusKeywords.getFocusKeyword().keyword;!1!==t&&(e?(e.hasClass("serp-url")&&(t=this.assessor.paper.get("keywordPermalink")),e.rankMathUnhighlight(),e.rankMathHighlight(t)):(this.serpTitle.rankMathUnhighlight(),this.serpTitle.rankMathHighlight(t),this.serpPermalink.rankMathUnhighlight(),this.serpPermalink.rankMathHighlight(this.assessor.paper.get("keywordPermalink")),this.serpDescription.rankMathUnhighlight(),this.serpDescription.rankMathHighlight(t)))}},{key:"swapVars",value:function(e,t){var n=this;return(e=e||"")?(t=t||this.getMapObj(),(e=e.replace(" %page%","").replace("%sep% %sep%","%sep%")).replace(/%(([a-z0-9_-]+)\(([^)]*)\)|[^\s]+)%/giu,function(e){var r=e.toLowerCase().replace(/%+/g,"");return["title","post_title","term","author","name"].includes(r)?n.isGutenbergAvailable?t.title:n.elemTitle.val():["description","tag_description","category_description","cat_description","author_description","user_description"].includes(r)?(0,i.default)("#description").val():["fk","focuskeyword","focuskw"].includes(r)?n.focusKeywords.getFocusKeyword().keyword:r.includes("customfield(")?(r=r.replace("customfield(","").replace(")",""))in rankMath.customFields?rankMath.customFields[r]:"":(r.includes("(")&&(r=r.split("(")[0]),r in t?t[r]:r)}).trim()):""}},{key:"getMapObj",value:function(){var e=this;return null!==this.variableMap?this.variableMap:(this.variableMap={},i.default.each(rankMath.variables,function(t,n){t=t.toLowerCase().replace(/%+/g,"").split("(")[0],e.variableMap[t]=n.example}),this.variableMap)}},{key:"setVariable",value:function(e,t){null!==this.variableMap?this.variableMap[e]=t:void 0!==rankMath.variables[e]&&(rankMath.variables[e].example=t)}},{key:"getContent",value:function(){return this.assessor.paper.get("content")}},{key:"getDescription",value:function(){this.assessor.refreshContent();var e=this.getExcerpt(),t=this.serpDescriptionField.val();if(""!==t)return(0,h.default)(t);if(!(0,a.default)(e)&&""!==e)return(0,h.default)(e);var n=this.serpDescription.data("format"),r=this.generateDescriptionFromContent(this.getContent());return this.setVariable("excerpt",r),(0,a.default)(n)||""===n?r:(0,h.default)(n)}},{key:"getExcerpt",value:function(){if(this.isGutenbergAvailable)return"";var e=this.elemDescription.val();return this.setVariable("excerpt",e),this.setVariable("excerpt_only",e),this.setVariable("wc_shortdesc",e),e}},{key:"generateDescriptionFromContent",value:function(e){if(""===e)return"";var t=this.focusKeywords.getFocusKeyword().keyword,n=(0,o.default)((0,v.default)(e,!0),function(e){return""!==i.default.trim(e)});if(!n.length)return"";if(""!==t){var r=(0,o.default)(n,function(e){return(0,u.default)(e.toLowerCase(),t)});if(r.length>0)return this.getDescriptionTruncated(r[0],160)}return this.getDescriptionTruncated(n[0],160)}},{key:"getDescriptionTruncated",value:function(e,t){return t?this.truncate(e.replace(/\r?\n|\r/g," "),t):e.replace(/\r?\n|\r/g," ")}},{key:"truncate",value:function(e,t){return e.length>t?e.substring(0,t):e}}]),e}();t.default=m},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(5)),o=s(n(235)),a=s(n(221));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.elemMetabox=(0,i.default)("#cmb2-metabox-rank_math_metabox"),e.elemSlug=(0,i.default)("#rank_math_permalink"),e.elemTitle=(0,i.default)("#display_name"),e.elemDescription=(0,i.default)("#description"),e.elemContent=null,e.researches={keywordInTitle:!0,keywordInMetaDescription:!0,keywordInPermalink:!0,titleStartWithKeyword:!0,keywordNotUsed:!0},e.researches=(0,a.default)(e.researches,Object.keys(rankMath.assessor.researchesTests)),e.init(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),r(t,[{key:"seoTitleAssessments",value:function(){this.seoAssessAll()}},{key:"seoPermalinkAssessments",value:function(){this.seoAssessAll()}},{key:"seoFocusKeywordAssessments",value:function(){this.seoAssessAll()}},{key:"seoContentAssessments",value:function(){this.seoAssessAll()}}]),t}();(0,i.default)(function(){new u})}]);
|
includes/frontend/class-add-attributes.php
CHANGED
@@ -8,9 +8,10 @@
|
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
-
namespace RankMath;
|
12 |
|
13 |
use stdClass;
|
|
|
14 |
use RankMath\Traits\Hooker;
|
15 |
use MyThemeShop\Helpers\Str;
|
16 |
use MyThemeShop\Helpers\Url;
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
+
namespace RankMath\Frontend;
|
12 |
|
13 |
use stdClass;
|
14 |
+
use RankMath\Helper;
|
15 |
use RankMath\Traits\Hooker;
|
16 |
use MyThemeShop\Helpers\Str;
|
17 |
use MyThemeShop\Helpers\Url;
|
includes/frontend/class-breadcrumbs.php
CHANGED
@@ -8,8 +8,9 @@
|
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
-
namespace RankMath;
|
12 |
|
|
|
13 |
use RankMath\Traits\Hooker;
|
14 |
|
15 |
defined( 'ABSPATH' ) || exit;
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
+
namespace RankMath\Frontend;
|
12 |
|
13 |
+
use RankMath\Helper;
|
14 |
use RankMath\Traits\Hooker;
|
15 |
|
16 |
defined( 'ABSPATH' ) || exit;
|
includes/frontend/class-frontend.php
CHANGED
@@ -11,9 +11,10 @@
|
|
11 |
* @author Rank Math <support@rankmath.com>
|
12 |
*/
|
13 |
|
14 |
-
namespace RankMath;
|
15 |
|
16 |
use RankMath\Post;
|
|
|
17 |
use RankMath\Traits\Hooker;
|
18 |
use RankMath\OpenGraph\Facebook;
|
19 |
use RankMath\OpenGraph\Twitter;
|
@@ -50,6 +51,12 @@ class Frontend {
|
|
50 |
|
51 |
if ( Helper::get_settings( 'general.breadcrumbs' ) ) {
|
52 |
rank_math()->breadcrumbs = new Breadcrumbs;
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
new Add_Attributes;
|
11 |
* @author Rank Math <support@rankmath.com>
|
12 |
*/
|
13 |
|
14 |
+
namespace RankMath\Frontend;
|
15 |
|
16 |
use RankMath\Post;
|
17 |
+
use RankMath\Helper;
|
18 |
use RankMath\Traits\Hooker;
|
19 |
use RankMath\OpenGraph\Facebook;
|
20 |
use RankMath\OpenGraph\Twitter;
|
51 |
|
52 |
if ( Helper::get_settings( 'general.breadcrumbs' ) ) {
|
53 |
rank_math()->breadcrumbs = new Breadcrumbs;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* If breadcrumbs are active (which they supposedly are if the users has enabled this settings,
|
57 |
+
* there's no reason to have bbPress breadcrumbs as well.
|
58 |
+
*/
|
59 |
+
add_filter( 'bbp_get_breadcrumb', '__return_false' );
|
60 |
}
|
61 |
|
62 |
new Add_Attributes;
|
includes/frontend/class-generate.php
CHANGED
@@ -8,11 +8,12 @@
|
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
-
namespace RankMath;
|
12 |
|
13 |
use RankMath\Post;
|
14 |
use RankMath\Term;
|
15 |
use RankMath\User;
|
|
|
16 |
use RankMath\Traits\Hooker;
|
17 |
use RankMath\Sitemap\Router;
|
18 |
use MyThemeShop\Helpers\Url;
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
+
namespace RankMath\Frontend;
|
12 |
|
13 |
use RankMath\Post;
|
14 |
use RankMath\Term;
|
15 |
use RankMath\User;
|
16 |
+
use RankMath\Helper;
|
17 |
use RankMath\Traits\Hooker;
|
18 |
use RankMath\Sitemap\Router;
|
19 |
use MyThemeShop\Helpers\Url;
|
includes/frontend/class-head.php
CHANGED
@@ -8,9 +8,10 @@
|
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
-
namespace RankMath;
|
12 |
|
13 |
use RankMath\Post;
|
|
|
14 |
use RankMath\Traits\Hooker;
|
15 |
use RankMath\Sitemap\Router;
|
16 |
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
+
namespace RankMath\Frontend;
|
12 |
|
13 |
use RankMath\Post;
|
14 |
+
use RankMath\Helper;
|
15 |
use RankMath\Traits\Hooker;
|
16 |
use RankMath\Sitemap\Router;
|
17 |
|
includes/frontend/class-remove-reply-to-com.php
CHANGED
@@ -8,8 +8,9 @@
|
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
-
namespace RankMath;
|
12 |
|
|
|
13 |
use RankMath\Traits\Hooker;
|
14 |
|
15 |
defined( 'ABSPATH' ) || exit;
|
8 |
* @author Rank Math <support@rankmath.com>
|
9 |
*/
|
10 |
|
11 |
+
namespace RankMath\Frontend;
|
12 |
|
13 |
+
use RankMath\Helper;
|
14 |
use RankMath\Traits\Hooker;
|
15 |
|
16 |
defined( 'ABSPATH' ) || exit;
|
includes/helpers/class-wordpress.php
CHANGED
@@ -139,7 +139,7 @@ trait WordPress {
|
|
139 |
$site_type = get_transient( '_rank_math_site_type' );
|
140 |
$business_type = [ 'news', 'business', 'webshop', 'otherbusiness' ];
|
141 |
|
142 |
-
if ( in_array( $site_type, $business_type ) ) {
|
143 |
return self::get_admin_url( 'options-titles#setting-panel-local' );
|
144 |
}
|
145 |
return admin_url( 'admin.php?page=rank-math&view=modules' );
|
@@ -313,7 +313,7 @@ trait WordPress {
|
|
313 |
*/
|
314 |
public static function get_formatted_duration( $iso8601 ) {
|
315 |
$end = substr( $iso8601, -1 );
|
316 |
-
if ( ! in_array( $end, [ 'D', 'H', 'M', 'S' ] ) ) {
|
317 |
return '';
|
318 |
}
|
319 |
|
@@ -327,17 +327,18 @@ trait WordPress {
|
|
327 |
* @return array
|
328 |
*/
|
329 |
public static function get_robots_defaults() {
|
|
|
330 |
$screen = get_current_screen();
|
331 |
|
332 |
-
if ( 'post' === $screen->base ) {
|
333 |
-
$robots = Helper::get_settings( "titles.pt_{$screen->post_type}_robots" );
|
334 |
}
|
335 |
|
336 |
-
if ( 'term' === $screen->base ) {
|
337 |
-
$robots = Helper::get_settings( "titles.tax_{$screen->taxonomy}_robots" );
|
338 |
}
|
339 |
|
340 |
-
if ( is_array( $robots ) && ! in_array( 'noindex', $robots ) ) {
|
341 |
$robots[] = 'index';
|
342 |
}
|
343 |
|
139 |
$site_type = get_transient( '_rank_math_site_type' );
|
140 |
$business_type = [ 'news', 'business', 'webshop', 'otherbusiness' ];
|
141 |
|
142 |
+
if ( in_array( $site_type, $business_type, true ) ) {
|
143 |
return self::get_admin_url( 'options-titles#setting-panel-local' );
|
144 |
}
|
145 |
return admin_url( 'admin.php?page=rank-math&view=modules' );
|
313 |
*/
|
314 |
public static function get_formatted_duration( $iso8601 ) {
|
315 |
$end = substr( $iso8601, -1 );
|
316 |
+
if ( ! in_array( $end, [ 'D', 'H', 'M', 'S' ], true ) ) {
|
317 |
return '';
|
318 |
}
|
319 |
|
327 |
* @return array
|
328 |
*/
|
329 |
public static function get_robots_defaults() {
|
330 |
+
$robots = [];
|
331 |
$screen = get_current_screen();
|
332 |
|
333 |
+
if ( 'post' === $screen->base && Helper::get_settings( "titles.pt_{$screen->post_type}_custom_robots" ) ) {
|
334 |
+
$robots = Helper::get_settings( "titles.pt_{$screen->post_type}_robots", [] );
|
335 |
}
|
336 |
|
337 |
+
if ( 'term' === $screen->base && Helper::get_settings( "titles.tax_{$screen->taxonomy}_custom_robots" ) ) {
|
338 |
+
$robots = Helper::get_settings( "titles.tax_{$screen->taxonomy}_robots", [] );
|
339 |
}
|
340 |
|
341 |
+
if ( is_array( $robots ) && ! in_array( 'noindex', $robots, true ) ) {
|
342 |
$robots[] = 'index';
|
343 |
}
|
344 |
|
includes/metaboxes/advanced.php
CHANGED
@@ -7,13 +7,18 @@
|
|
7 |
*/
|
8 |
|
9 |
use RankMath\Helper;
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
$cmb->add_field( array(
|
12 |
'id' => 'rank_math_robots',
|
13 |
'type' => 'multicheck',
|
14 |
'name' => esc_html__( 'Robots Meta', 'rank-math' ),
|
15 |
'desc' => esc_html__( 'Custom values for robots meta tag.', 'rank-math' ),
|
16 |
-
'options' =>
|
17 |
'default_cb' => '\\RankMath\\Helper::get_robots_defaults',
|
18 |
'select_all_button' => false,
|
19 |
) );
|
7 |
*/
|
8 |
|
9 |
use RankMath\Helper;
|
10 |
+
use RankMath\Admin\Admin_Helper;
|
11 |
+
|
12 |
+
$robot_index = [
|
13 |
+
'index' => esc_html__( 'Index', 'rank-math' ) . Admin_Helper::get_tooltip( esc_html__( 'Instructs search engines to index and show these pages in the search results.', 'rank-math' ) ),
|
14 |
+
];
|
15 |
|
16 |
$cmb->add_field( array(
|
17 |
'id' => 'rank_math_robots',
|
18 |
'type' => 'multicheck',
|
19 |
'name' => esc_html__( 'Robots Meta', 'rank-math' ),
|
20 |
'desc' => esc_html__( 'Custom values for robots meta tag.', 'rank-math' ),
|
21 |
+
'options' => $robot_index + Helper::choices_robots(),
|
22 |
'default_cb' => '\\RankMath\\Helper::get_robots_defaults',
|
23 |
'select_all_button' => false,
|
24 |
) );
|
rank-math.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* @wordpress-plugin
|
11 |
* Plugin Name: Rank Math SEO
|
12 |
-
* Version: 1.0.
|
13 |
* Plugin URI: https://s.rankmath.com/home
|
14 |
* Description: Rank Math is a revolutionary SEO product that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible.
|
15 |
* Author: Rank Math
|
@@ -34,7 +34,7 @@ final class RankMath {
|
|
34 |
*
|
35 |
* @var string
|
36 |
*/
|
37 |
-
public $version = '1.0.
|
38 |
|
39 |
/**
|
40 |
* Rank Math database version.
|
@@ -350,7 +350,7 @@ final class RankMath {
|
|
350 |
* Initialize the frontend.
|
351 |
*/
|
352 |
public function init_frontend() {
|
353 |
-
$this->container['frontend'] = new \RankMath\Frontend;
|
354 |
}
|
355 |
|
356 |
/**
|
9 |
*
|
10 |
* @wordpress-plugin
|
11 |
* Plugin Name: Rank Math SEO
|
12 |
+
* Version: 1.0.23
|
13 |
* Plugin URI: https://s.rankmath.com/home
|
14 |
* Description: Rank Math is a revolutionary SEO product that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible.
|
15 |
* Author: Rank Math
|
34 |
*
|
35 |
* @var string
|
36 |
*/
|
37 |
+
public $version = '1.0.23';
|
38 |
|
39 |
/**
|
40 |
* Rank Math database version.
|
350 |
* Initialize the frontend.
|
351 |
*/
|
352 |
public function init_frontend() {
|
353 |
+
$this->container['frontend'] = new \RankMath\Frontend\Frontend;
|
354 |
}
|
355 |
|
356 |
/**
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: seo, sitemap, google search console, schema.org, redirection
|
|
5 |
Tested up to: 5.1
|
6 |
Requires at least: 4.6.0
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 1.0.
|
9 |
License: GPL-2.0+
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.txt
|
11 |
|
@@ -447,21 +447,7 @@ We look forward to helping you.
|
|
447 |
|
448 |
== Changelog ==
|
449 |
|
450 |
-
= 1.0.
|
451 |
-
*
|
452 |
-
* Made Robot Meta tags in sync with global settings. Do check them out
|
453 |
-
* Added support for custom permalink in Strip Category base option
|
454 |
-
* Added compatibility for Advanced Access Manager Plugin
|
455 |
-
* Fixed link suggestion showing HTML data
|
456 |
-
* Improved the notice for the conflicting plugins. It should not show up again once dismissed
|
457 |
-
* Fixed a fatal error with the Review and Contact Shortcode
|
458 |
-
* Fixed an error where Focus Keyword was not getting detected if it had ellipsis in it
|
459 |
-
* Fixed a bug where SERP Preview was disabled even after changing the option back to indexed
|
460 |
-
* Fixed Sitemaps not showing in Google Search Console on some sites
|
461 |
-
* Fixed Redirection options not getting removed from the single post editor
|
462 |
-
* Removed Google Plus (Google+ is buried)
|
463 |
-
* Removed Crawl Errors from Search Console ([Google](https://s.rankmath.com/gscerrorsapi) disables the Crawl Errors API)
|
464 |
-
* Removed unneeded validations on multisite
|
465 |
-
* Enhanced the overall code further and added more unit tests
|
466 |
|
467 |
Full changelog can be found here - **[Rank Math SEO changelog](https://rankmath.com/changelog)**
|
5 |
Tested up to: 5.1
|
6 |
Requires at least: 4.6.0
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 1.0.23
|
9 |
License: GPL-2.0+
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.txt
|
11 |
|
447 |
|
448 |
== Changelog ==
|
449 |
|
450 |
+
= 1.0.23 [Apr 4th, 2019] =
|
451 |
+
* Fixed a bug where the indexing of the posts was getting affected if someone previously selected any value in the custom tab of the general settings of the plugin but saved the settings using the default tab. Yep, it's confusing, and thus it skipped through our nose. The good thing is, it's caught and fixed. Hurray!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
|
453 |
Full changelog can be found here - **[Rank Math SEO changelog](https://rankmath.com/changelog)**
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -6,99 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'Monolog\\ErrorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/ErrorHandler.php',
|
10 |
-
'Monolog\\Formatter\\ChromePHPFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php',
|
11 |
-
'Monolog\\Formatter\\ElasticaFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php',
|
12 |
-
'Monolog\\Formatter\\FlowdockFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php',
|
13 |
-
'Monolog\\Formatter\\FluentdFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php',
|
14 |
-
'Monolog\\Formatter\\FormatterInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php',
|
15 |
-
'Monolog\\Formatter\\GelfMessageFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php',
|
16 |
-
'Monolog\\Formatter\\HtmlFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php',
|
17 |
-
'Monolog\\Formatter\\JsonFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php',
|
18 |
-
'Monolog\\Formatter\\LineFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LineFormatter.php',
|
19 |
-
'Monolog\\Formatter\\LogglyFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php',
|
20 |
-
'Monolog\\Formatter\\LogstashFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php',
|
21 |
-
'Monolog\\Formatter\\MongoDBFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php',
|
22 |
-
'Monolog\\Formatter\\NormalizerFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php',
|
23 |
-
'Monolog\\Formatter\\ScalarFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php',
|
24 |
-
'Monolog\\Formatter\\WildfireFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php',
|
25 |
-
'Monolog\\Handler\\AbstractHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php',
|
26 |
-
'Monolog\\Handler\\AbstractProcessingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php',
|
27 |
-
'Monolog\\Handler\\AbstractSyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php',
|
28 |
-
'Monolog\\Handler\\AmqpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AmqpHandler.php',
|
29 |
-
'Monolog\\Handler\\BrowserConsoleHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php',
|
30 |
-
'Monolog\\Handler\\BufferHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/BufferHandler.php',
|
31 |
-
'Monolog\\Handler\\ChromePHPHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php',
|
32 |
-
'Monolog\\Handler\\CouchDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php',
|
33 |
-
'Monolog\\Handler\\CubeHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/CubeHandler.php',
|
34 |
-
'Monolog\\Handler\\Curl\\Util' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/Curl/Util.php',
|
35 |
-
'Monolog\\Handler\\DeduplicationHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php',
|
36 |
-
'Monolog\\Handler\\DoctrineCouchDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php',
|
37 |
-
'Monolog\\Handler\\DynamoDbHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php',
|
38 |
-
'Monolog\\Handler\\ElasticSearchHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php',
|
39 |
-
'Monolog\\Handler\\ErrorLogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php',
|
40 |
-
'Monolog\\Handler\\FilterHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FilterHandler.php',
|
41 |
-
'Monolog\\Handler\\FingersCrossedHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php',
|
42 |
-
'Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php',
|
43 |
-
'Monolog\\Handler\\FingersCrossed\\ChannelLevelActivationStrategy' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php',
|
44 |
-
'Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php',
|
45 |
-
'Monolog\\Handler\\FirePHPHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php',
|
46 |
-
'Monolog\\Handler\\FleepHookHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php',
|
47 |
-
'Monolog\\Handler\\FlowdockHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php',
|
48 |
-
'Monolog\\Handler\\GelfHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php',
|
49 |
-
'Monolog\\Handler\\GroupHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php',
|
50 |
-
'Monolog\\Handler\\HandlerInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HandlerInterface.php',
|
51 |
-
'Monolog\\Handler\\HandlerWrapper' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php',
|
52 |
-
'Monolog\\Handler\\HipChatHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HipChatHandler.php',
|
53 |
-
'Monolog\\Handler\\IFTTTHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php',
|
54 |
-
'Monolog\\Handler\\InsightOpsHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php',
|
55 |
-
'Monolog\\Handler\\LogEntriesHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php',
|
56 |
-
'Monolog\\Handler\\LogglyHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php',
|
57 |
-
'Monolog\\Handler\\MailHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MailHandler.php',
|
58 |
-
'Monolog\\Handler\\MandrillHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MandrillHandler.php',
|
59 |
-
'Monolog\\Handler\\MissingExtensionException' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php',
|
60 |
-
'Monolog\\Handler\\MongoDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php',
|
61 |
-
'Monolog\\Handler\\NativeMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php',
|
62 |
-
'Monolog\\Handler\\NewRelicHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php',
|
63 |
-
'Monolog\\Handler\\NullHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NullHandler.php',
|
64 |
-
'Monolog\\Handler\\PHPConsoleHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php',
|
65 |
-
'Monolog\\Handler\\PsrHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PsrHandler.php',
|
66 |
-
'Monolog\\Handler\\PushoverHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PushoverHandler.php',
|
67 |
-
'Monolog\\Handler\\RavenHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RavenHandler.php',
|
68 |
-
'Monolog\\Handler\\RedisHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RedisHandler.php',
|
69 |
-
'Monolog\\Handler\\RollbarHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RollbarHandler.php',
|
70 |
-
'Monolog\\Handler\\RotatingFileHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php',
|
71 |
-
'Monolog\\Handler\\SamplingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SamplingHandler.php',
|
72 |
-
'Monolog\\Handler\\SlackHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackHandler.php',
|
73 |
-
'Monolog\\Handler\\SlackWebhookHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php',
|
74 |
-
'Monolog\\Handler\\Slack\\SlackRecord' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php',
|
75 |
-
'Monolog\\Handler\\SlackbotHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php',
|
76 |
-
'Monolog\\Handler\\SocketHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php',
|
77 |
-
'Monolog\\Handler\\StreamHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php',
|
78 |
-
'Monolog\\Handler\\SwiftMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php',
|
79 |
-
'Monolog\\Handler\\SyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php',
|
80 |
-
'Monolog\\Handler\\SyslogUdpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php',
|
81 |
-
'Monolog\\Handler\\SyslogUdp\\UdpSocket' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php',
|
82 |
-
'Monolog\\Handler\\TestHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/TestHandler.php',
|
83 |
-
'Monolog\\Handler\\WhatFailureGroupHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php',
|
84 |
-
'Monolog\\Handler\\ZendMonitorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php',
|
85 |
-
'Monolog\\Logger' => $vendorDir . '/monolog/monolog/src/Monolog/Logger.php',
|
86 |
-
'Monolog\\Processor\\GitProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/GitProcessor.php',
|
87 |
-
'Monolog\\Processor\\IntrospectionProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php',
|
88 |
-
'Monolog\\Processor\\MemoryPeakUsageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php',
|
89 |
-
'Monolog\\Processor\\MemoryProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php',
|
90 |
-
'Monolog\\Processor\\MemoryUsageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php',
|
91 |
-
'Monolog\\Processor\\MercurialProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php',
|
92 |
-
'Monolog\\Processor\\ProcessIdProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php',
|
93 |
-
'Monolog\\Processor\\ProcessorInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php',
|
94 |
-
'Monolog\\Processor\\PsrLogMessageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php',
|
95 |
-
'Monolog\\Processor\\TagProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/TagProcessor.php',
|
96 |
-
'Monolog\\Processor\\UidProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/UidProcessor.php',
|
97 |
-
'Monolog\\Processor\\WebProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/WebProcessor.php',
|
98 |
-
'Monolog\\Registry' => $vendorDir . '/monolog/monolog/src/Monolog/Registry.php',
|
99 |
-
'Monolog\\ResettableInterface' => $vendorDir . '/monolog/monolog/src/Monolog/ResettableInterface.php',
|
100 |
-
'Monolog\\SignalHandler' => $vendorDir . '/monolog/monolog/src/Monolog/SignalHandler.php',
|
101 |
-
'Monolog\\Utils' => $vendorDir . '/monolog/monolog/src/Monolog/Utils.php',
|
102 |
'MyThemeShop\\Admin\\List_Table' => $vendorDir . '/mythemeshop/wordpress-helpers/src/admin/class-list-table.php',
|
103 |
'MyThemeShop\\Admin\\Page' => $vendorDir . '/mythemeshop/wordpress-helpers/src/admin/class-page.php',
|
104 |
'MyThemeShop\\Database\\Database' => $vendorDir . '/mythemeshop/wordpress-helpers/src/database/class-database.php',
|
@@ -132,7 +39,6 @@ return array(
|
|
132 |
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
133 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
134 |
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
135 |
-
'RankMath\\Add_Attributes' => $baseDir . '/includes/frontend/class-add-attributes.php',
|
136 |
'RankMath\\Admin\\Admin' => $baseDir . '/includes/admin/class-admin.php',
|
137 |
'RankMath\\Admin\\Admin_Helper' => $baseDir . '/includes/admin/class-admin-helper.php',
|
138 |
'RankMath\\Admin\\Admin_Menu' => $baseDir . '/includes/admin/class-admin-menu.php',
|
@@ -158,15 +64,17 @@ return array(
|
|
158 |
'RankMath\\Admin\\Serp_Preview' => $baseDir . '/includes/admin/class-serp-preview.php',
|
159 |
'RankMath\\Admin\\Setup_Wizard' => $baseDir . '/includes/admin/class-setup-wizard.php',
|
160 |
'RankMath\\Admin\\Watcher' => $baseDir . '/includes/admin/watcher/class-watcher.php',
|
161 |
-
'RankMath\\Breadcrumbs' => $baseDir . '/includes/frontend/class-breadcrumbs.php',
|
162 |
'RankMath\\CLI\\Commands' => $baseDir . '/includes/cli/class-commands.php',
|
163 |
'RankMath\\CMB2' => $baseDir . '/includes/class-cmb2.php',
|
164 |
'RankMath\\Common' => $baseDir . '/includes/class-common.php',
|
165 |
'RankMath\\Compatibility' => $baseDir . '/includes/class-compatibility.php',
|
166 |
-
'RankMath\\Frontend' => $baseDir . '/includes/frontend/class-
|
|
|
|
|
|
|
|
|
|
|
167 |
'RankMath\\Frontend\\Shortcodes' => $baseDir . '/includes/frontend/class-shortcodes.php',
|
168 |
-
'RankMath\\Generate' => $baseDir . '/includes/frontend/class-generate.php',
|
169 |
-
'RankMath\\Head' => $baseDir . '/includes/frontend/class-head.php',
|
170 |
'RankMath\\Helper' => $baseDir . '/includes/class-helper.php',
|
171 |
'RankMath\\Helpers\\Api' => $baseDir . '/includes/helpers/class-api.php',
|
172 |
'RankMath\\Helpers\\Attachment' => $baseDir . '/includes/helpers/class-attachment.php',
|
@@ -206,7 +114,6 @@ return array(
|
|
206 |
'RankMath\\Redirections\\Redirector' => $baseDir . '/includes/modules/redirections/class-redirector.php',
|
207 |
'RankMath\\Redirections\\Table' => $baseDir . '/includes/modules/redirections/class-table.php',
|
208 |
'RankMath\\Redirections\\Watcher' => $baseDir . '/includes/modules/redirections/class-watcher.php',
|
209 |
-
'RankMath\\Remove_Reply_To_Com' => $baseDir . '/includes/frontend/class-remove-reply-to-com.php',
|
210 |
'RankMath\\Replace_Vars' => $baseDir . '/includes/class-replace-vars.php',
|
211 |
'RankMath\\Rest\\Admin' => $baseDir . '/includes/rest/class-admin.php',
|
212 |
'RankMath\\Rest\\Helper' => $baseDir . '/includes/rest/class-helper.php',
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
'MyThemeShop\\Admin\\List_Table' => $vendorDir . '/mythemeshop/wordpress-helpers/src/admin/class-list-table.php',
|
10 |
'MyThemeShop\\Admin\\Page' => $vendorDir . '/mythemeshop/wordpress-helpers/src/admin/class-page.php',
|
11 |
'MyThemeShop\\Database\\Database' => $vendorDir . '/mythemeshop/wordpress-helpers/src/database/class-database.php',
|
39 |
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
40 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
41 |
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
|
|
42 |
'RankMath\\Admin\\Admin' => $baseDir . '/includes/admin/class-admin.php',
|
43 |
'RankMath\\Admin\\Admin_Helper' => $baseDir . '/includes/admin/class-admin-helper.php',
|
44 |
'RankMath\\Admin\\Admin_Menu' => $baseDir . '/includes/admin/class-admin-menu.php',
|
64 |
'RankMath\\Admin\\Serp_Preview' => $baseDir . '/includes/admin/class-serp-preview.php',
|
65 |
'RankMath\\Admin\\Setup_Wizard' => $baseDir . '/includes/admin/class-setup-wizard.php',
|
66 |
'RankMath\\Admin\\Watcher' => $baseDir . '/includes/admin/watcher/class-watcher.php',
|
|
|
67 |
'RankMath\\CLI\\Commands' => $baseDir . '/includes/cli/class-commands.php',
|
68 |
'RankMath\\CMB2' => $baseDir . '/includes/class-cmb2.php',
|
69 |
'RankMath\\Common' => $baseDir . '/includes/class-common.php',
|
70 |
'RankMath\\Compatibility' => $baseDir . '/includes/class-compatibility.php',
|
71 |
+
'RankMath\\Frontend\\Add_Attributes' => $baseDir . '/includes/frontend/class-add-attributes.php',
|
72 |
+
'RankMath\\Frontend\\Breadcrumbs' => $baseDir . '/includes/frontend/class-breadcrumbs.php',
|
73 |
+
'RankMath\\Frontend\\Frontend' => $baseDir . '/includes/frontend/class-frontend.php',
|
74 |
+
'RankMath\\Frontend\\Generate' => $baseDir . '/includes/frontend/class-generate.php',
|
75 |
+
'RankMath\\Frontend\\Head' => $baseDir . '/includes/frontend/class-head.php',
|
76 |
+
'RankMath\\Frontend\\Remove_Reply_To_Com' => $baseDir . '/includes/frontend/class-remove-reply-to-com.php',
|
77 |
'RankMath\\Frontend\\Shortcodes' => $baseDir . '/includes/frontend/class-shortcodes.php',
|
|
|
|
|
78 |
'RankMath\\Helper' => $baseDir . '/includes/class-helper.php',
|
79 |
'RankMath\\Helpers\\Api' => $baseDir . '/includes/helpers/class-api.php',
|
80 |
'RankMath\\Helpers\\Attachment' => $baseDir . '/includes/helpers/class-attachment.php',
|
114 |
'RankMath\\Redirections\\Redirector' => $baseDir . '/includes/modules/redirections/class-redirector.php',
|
115 |
'RankMath\\Redirections\\Table' => $baseDir . '/includes/modules/redirections/class-table.php',
|
116 |
'RankMath\\Redirections\\Watcher' => $baseDir . '/includes/modules/redirections/class-watcher.php',
|
|
|
117 |
'RankMath\\Replace_Vars' => $baseDir . '/includes/class-replace-vars.php',
|
118 |
'RankMath\\Rest\\Admin' => $baseDir . '/includes/rest/class-admin.php',
|
119 |
'RankMath\\Rest\\Helper' => $baseDir . '/includes/rest/class-helper.php',
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -10,5 +10,4 @@ return array(
|
|
10 |
'RankMath\\' => array($baseDir . '/includes'),
|
11 |
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
12 |
'MyThemeShop\\Helpers\\' => array($vendorDir . '/mythemeshop/wordpress-helpers/src'),
|
13 |
-
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
|
14 |
);
|
10 |
'RankMath\\' => array($baseDir . '/includes'),
|
11 |
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
12 |
'MyThemeShop\\Helpers\\' => array($vendorDir . '/mythemeshop/wordpress-helpers/src'),
|
|
|
13 |
);
|
vendor/composer/autoload_static.php
CHANGED
@@ -24,7 +24,6 @@ class ComposerStaticInite0bd047aa5058f04568aa38dfc5ac000
|
|
24 |
'M' =>
|
25 |
array (
|
26 |
'MyThemeShop\\Helpers\\' => 20,
|
27 |
-
'Monolog\\' => 8,
|
28 |
),
|
29 |
);
|
30 |
|
@@ -45,106 +44,9 @@ class ComposerStaticInite0bd047aa5058f04568aa38dfc5ac000
|
|
45 |
array (
|
46 |
0 => __DIR__ . '/..' . '/mythemeshop/wordpress-helpers/src',
|
47 |
),
|
48 |
-
'Monolog\\' =>
|
49 |
-
array (
|
50 |
-
0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog',
|
51 |
-
),
|
52 |
);
|
53 |
|
54 |
public static $classMap = array (
|
55 |
-
'Monolog\\ErrorHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/ErrorHandler.php',
|
56 |
-
'Monolog\\Formatter\\ChromePHPFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php',
|
57 |
-
'Monolog\\Formatter\\ElasticaFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php',
|
58 |
-
'Monolog\\Formatter\\FlowdockFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php',
|
59 |
-
'Monolog\\Formatter\\FluentdFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php',
|
60 |
-
'Monolog\\Formatter\\FormatterInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php',
|
61 |
-
'Monolog\\Formatter\\GelfMessageFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php',
|
62 |
-
'Monolog\\Formatter\\HtmlFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php',
|
63 |
-
'Monolog\\Formatter\\JsonFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php',
|
64 |
-
'Monolog\\Formatter\\LineFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LineFormatter.php',
|
65 |
-
'Monolog\\Formatter\\LogglyFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php',
|
66 |
-
'Monolog\\Formatter\\LogstashFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php',
|
67 |
-
'Monolog\\Formatter\\MongoDBFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php',
|
68 |
-
'Monolog\\Formatter\\NormalizerFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php',
|
69 |
-
'Monolog\\Formatter\\ScalarFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php',
|
70 |
-
'Monolog\\Formatter\\WildfireFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php',
|
71 |
-
'Monolog\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php',
|
72 |
-
'Monolog\\Handler\\AbstractProcessingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php',
|
73 |
-
'Monolog\\Handler\\AbstractSyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php',
|
74 |
-
'Monolog\\Handler\\AmqpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AmqpHandler.php',
|
75 |
-
'Monolog\\Handler\\BrowserConsoleHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php',
|
76 |
-
'Monolog\\Handler\\BufferHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/BufferHandler.php',
|
77 |
-
'Monolog\\Handler\\ChromePHPHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php',
|
78 |
-
'Monolog\\Handler\\CouchDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php',
|
79 |
-
'Monolog\\Handler\\CubeHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/CubeHandler.php',
|
80 |
-
'Monolog\\Handler\\Curl\\Util' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/Curl/Util.php',
|
81 |
-
'Monolog\\Handler\\DeduplicationHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php',
|
82 |
-
'Monolog\\Handler\\DoctrineCouchDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php',
|
83 |
-
'Monolog\\Handler\\DynamoDbHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php',
|
84 |
-
'Monolog\\Handler\\ElasticSearchHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php',
|
85 |
-
'Monolog\\Handler\\ErrorLogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php',
|
86 |
-
'Monolog\\Handler\\FilterHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FilterHandler.php',
|
87 |
-
'Monolog\\Handler\\FingersCrossedHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php',
|
88 |
-
'Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php',
|
89 |
-
'Monolog\\Handler\\FingersCrossed\\ChannelLevelActivationStrategy' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php',
|
90 |
-
'Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php',
|
91 |
-
'Monolog\\Handler\\FirePHPHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php',
|
92 |
-
'Monolog\\Handler\\FleepHookHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php',
|
93 |
-
'Monolog\\Handler\\FlowdockHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php',
|
94 |
-
'Monolog\\Handler\\GelfHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php',
|
95 |
-
'Monolog\\Handler\\GroupHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php',
|
96 |
-
'Monolog\\Handler\\HandlerInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HandlerInterface.php',
|
97 |
-
'Monolog\\Handler\\HandlerWrapper' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php',
|
98 |
-
'Monolog\\Handler\\HipChatHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HipChatHandler.php',
|
99 |
-
'Monolog\\Handler\\IFTTTHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php',
|
100 |
-
'Monolog\\Handler\\InsightOpsHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php',
|
101 |
-
'Monolog\\Handler\\LogEntriesHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php',
|
102 |
-
'Monolog\\Handler\\LogglyHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php',
|
103 |
-
'Monolog\\Handler\\MailHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MailHandler.php',
|
104 |
-
'Monolog\\Handler\\MandrillHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MandrillHandler.php',
|
105 |
-
'Monolog\\Handler\\MissingExtensionException' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php',
|
106 |
-
'Monolog\\Handler\\MongoDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php',
|
107 |
-
'Monolog\\Handler\\NativeMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php',
|
108 |
-
'Monolog\\Handler\\NewRelicHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php',
|
109 |
-
'Monolog\\Handler\\NullHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NullHandler.php',
|
110 |
-
'Monolog\\Handler\\PHPConsoleHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php',
|
111 |
-
'Monolog\\Handler\\PsrHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PsrHandler.php',
|
112 |
-
'Monolog\\Handler\\PushoverHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PushoverHandler.php',
|
113 |
-
'Monolog\\Handler\\RavenHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RavenHandler.php',
|
114 |
-
'Monolog\\Handler\\RedisHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RedisHandler.php',
|
115 |
-
'Monolog\\Handler\\RollbarHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RollbarHandler.php',
|
116 |
-
'Monolog\\Handler\\RotatingFileHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php',
|
117 |
-
'Monolog\\Handler\\SamplingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SamplingHandler.php',
|
118 |
-
'Monolog\\Handler\\SlackHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackHandler.php',
|
119 |
-
'Monolog\\Handler\\SlackWebhookHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php',
|
120 |
-
'Monolog\\Handler\\Slack\\SlackRecord' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php',
|
121 |
-
'Monolog\\Handler\\SlackbotHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php',
|
122 |
-
'Monolog\\Handler\\SocketHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php',
|
123 |
-
'Monolog\\Handler\\StreamHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php',
|
124 |
-
'Monolog\\Handler\\SwiftMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php',
|
125 |
-
'Monolog\\Handler\\SyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php',
|
126 |
-
'Monolog\\Handler\\SyslogUdpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php',
|
127 |
-
'Monolog\\Handler\\SyslogUdp\\UdpSocket' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php',
|
128 |
-
'Monolog\\Handler\\TestHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/TestHandler.php',
|
129 |
-
'Monolog\\Handler\\WhatFailureGroupHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php',
|
130 |
-
'Monolog\\Handler\\ZendMonitorHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php',
|
131 |
-
'Monolog\\Logger' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Logger.php',
|
132 |
-
'Monolog\\Processor\\GitProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/GitProcessor.php',
|
133 |
-
'Monolog\\Processor\\IntrospectionProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php',
|
134 |
-
'Monolog\\Processor\\MemoryPeakUsageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php',
|
135 |
-
'Monolog\\Processor\\MemoryProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php',
|
136 |
-
'Monolog\\Processor\\MemoryUsageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php',
|
137 |
-
'Monolog\\Processor\\MercurialProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php',
|
138 |
-
'Monolog\\Processor\\ProcessIdProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php',
|
139 |
-
'Monolog\\Processor\\ProcessorInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php',
|
140 |
-
'Monolog\\Processor\\PsrLogMessageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php',
|
141 |
-
'Monolog\\Processor\\TagProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/TagProcessor.php',
|
142 |
-
'Monolog\\Processor\\UidProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/UidProcessor.php',
|
143 |
-
'Monolog\\Processor\\WebProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/WebProcessor.php',
|
144 |
-
'Monolog\\Registry' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Registry.php',
|
145 |
-
'Monolog\\ResettableInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/ResettableInterface.php',
|
146 |
-
'Monolog\\SignalHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/SignalHandler.php',
|
147 |
-
'Monolog\\Utils' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Utils.php',
|
148 |
'MyThemeShop\\Admin\\List_Table' => __DIR__ . '/..' . '/mythemeshop/wordpress-helpers/src/admin/class-list-table.php',
|
149 |
'MyThemeShop\\Admin\\Page' => __DIR__ . '/..' . '/mythemeshop/wordpress-helpers/src/admin/class-page.php',
|
150 |
'MyThemeShop\\Database\\Database' => __DIR__ . '/..' . '/mythemeshop/wordpress-helpers/src/database/class-database.php',
|
@@ -178,7 +80,6 @@ class ComposerStaticInite0bd047aa5058f04568aa38dfc5ac000
|
|
178 |
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
179 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
180 |
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
181 |
-
'RankMath\\Add_Attributes' => __DIR__ . '/../..' . '/includes/frontend/class-add-attributes.php',
|
182 |
'RankMath\\Admin\\Admin' => __DIR__ . '/../..' . '/includes/admin/class-admin.php',
|
183 |
'RankMath\\Admin\\Admin_Helper' => __DIR__ . '/../..' . '/includes/admin/class-admin-helper.php',
|
184 |
'RankMath\\Admin\\Admin_Menu' => __DIR__ . '/../..' . '/includes/admin/class-admin-menu.php',
|
@@ -204,15 +105,17 @@ class ComposerStaticInite0bd047aa5058f04568aa38dfc5ac000
|
|
204 |
'RankMath\\Admin\\Serp_Preview' => __DIR__ . '/../..' . '/includes/admin/class-serp-preview.php',
|
205 |
'RankMath\\Admin\\Setup_Wizard' => __DIR__ . '/../..' . '/includes/admin/class-setup-wizard.php',
|
206 |
'RankMath\\Admin\\Watcher' => __DIR__ . '/../..' . '/includes/admin/watcher/class-watcher.php',
|
207 |
-
'RankMath\\Breadcrumbs' => __DIR__ . '/../..' . '/includes/frontend/class-breadcrumbs.php',
|
208 |
'RankMath\\CLI\\Commands' => __DIR__ . '/../..' . '/includes/cli/class-commands.php',
|
209 |
'RankMath\\CMB2' => __DIR__ . '/../..' . '/includes/class-cmb2.php',
|
210 |
'RankMath\\Common' => __DIR__ . '/../..' . '/includes/class-common.php',
|
211 |
'RankMath\\Compatibility' => __DIR__ . '/../..' . '/includes/class-compatibility.php',
|
212 |
-
'RankMath\\Frontend' => __DIR__ . '/../..' . '/includes/frontend/class-
|
|
|
|
|
|
|
|
|
|
|
213 |
'RankMath\\Frontend\\Shortcodes' => __DIR__ . '/../..' . '/includes/frontend/class-shortcodes.php',
|
214 |
-
'RankMath\\Generate' => __DIR__ . '/../..' . '/includes/frontend/class-generate.php',
|
215 |
-
'RankMath\\Head' => __DIR__ . '/../..' . '/includes/frontend/class-head.php',
|
216 |
'RankMath\\Helper' => __DIR__ . '/../..' . '/includes/class-helper.php',
|
217 |
'RankMath\\Helpers\\Api' => __DIR__ . '/../..' . '/includes/helpers/class-api.php',
|
218 |
'RankMath\\Helpers\\Attachment' => __DIR__ . '/../..' . '/includes/helpers/class-attachment.php',
|
@@ -252,7 +155,6 @@ class ComposerStaticInite0bd047aa5058f04568aa38dfc5ac000
|
|
252 |
'RankMath\\Redirections\\Redirector' => __DIR__ . '/../..' . '/includes/modules/redirections/class-redirector.php',
|
253 |
'RankMath\\Redirections\\Table' => __DIR__ . '/../..' . '/includes/modules/redirections/class-table.php',
|
254 |
'RankMath\\Redirections\\Watcher' => __DIR__ . '/../..' . '/includes/modules/redirections/class-watcher.php',
|
255 |
-
'RankMath\\Remove_Reply_To_Com' => __DIR__ . '/../..' . '/includes/frontend/class-remove-reply-to-com.php',
|
256 |
'RankMath\\Replace_Vars' => __DIR__ . '/../..' . '/includes/class-replace-vars.php',
|
257 |
'RankMath\\Rest\\Admin' => __DIR__ . '/../..' . '/includes/rest/class-admin.php',
|
258 |
'RankMath\\Rest\\Helper' => __DIR__ . '/../..' . '/includes/rest/class-helper.php',
|
24 |
'M' =>
|
25 |
array (
|
26 |
'MyThemeShop\\Helpers\\' => 20,
|
|
|
27 |
),
|
28 |
);
|
29 |
|
44 |
array (
|
45 |
0 => __DIR__ . '/..' . '/mythemeshop/wordpress-helpers/src',
|
46 |
),
|
|
|
|
|
|
|
|
|
47 |
);
|
48 |
|
49 |
public static $classMap = array (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
'MyThemeShop\\Admin\\List_Table' => __DIR__ . '/..' . '/mythemeshop/wordpress-helpers/src/admin/class-list-table.php',
|
51 |
'MyThemeShop\\Admin\\Page' => __DIR__ . '/..' . '/mythemeshop/wordpress-helpers/src/admin/class-page.php',
|
52 |
'MyThemeShop\\Database\\Database' => __DIR__ . '/..' . '/mythemeshop/wordpress-helpers/src/database/class-database.php',
|
80 |
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
81 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
82 |
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
|
|
83 |
'RankMath\\Admin\\Admin' => __DIR__ . '/../..' . '/includes/admin/class-admin.php',
|
84 |
'RankMath\\Admin\\Admin_Helper' => __DIR__ . '/../..' . '/includes/admin/class-admin-helper.php',
|
85 |
'RankMath\\Admin\\Admin_Menu' => __DIR__ . '/../..' . '/includes/admin/class-admin-menu.php',
|
105 |
'RankMath\\Admin\\Serp_Preview' => __DIR__ . '/../..' . '/includes/admin/class-serp-preview.php',
|
106 |
'RankMath\\Admin\\Setup_Wizard' => __DIR__ . '/../..' . '/includes/admin/class-setup-wizard.php',
|
107 |
'RankMath\\Admin\\Watcher' => __DIR__ . '/../..' . '/includes/admin/watcher/class-watcher.php',
|
|
|
108 |
'RankMath\\CLI\\Commands' => __DIR__ . '/../..' . '/includes/cli/class-commands.php',
|
109 |
'RankMath\\CMB2' => __DIR__ . '/../..' . '/includes/class-cmb2.php',
|
110 |
'RankMath\\Common' => __DIR__ . '/../..' . '/includes/class-common.php',
|
111 |
'RankMath\\Compatibility' => __DIR__ . '/../..' . '/includes/class-compatibility.php',
|
112 |
+
'RankMath\\Frontend\\Add_Attributes' => __DIR__ . '/../..' . '/includes/frontend/class-add-attributes.php',
|
113 |
+
'RankMath\\Frontend\\Breadcrumbs' => __DIR__ . '/../..' . '/includes/frontend/class-breadcrumbs.php',
|
114 |
+
'RankMath\\Frontend\\Frontend' => __DIR__ . '/../..' . '/includes/frontend/class-frontend.php',
|
115 |
+
'RankMath\\Frontend\\Generate' => __DIR__ . '/../..' . '/includes/frontend/class-generate.php',
|
116 |
+
'RankMath\\Frontend\\Head' => __DIR__ . '/../..' . '/includes/frontend/class-head.php',
|
117 |
+
'RankMath\\Frontend\\Remove_Reply_To_Com' => __DIR__ . '/../..' . '/includes/frontend/class-remove-reply-to-com.php',
|
118 |
'RankMath\\Frontend\\Shortcodes' => __DIR__ . '/../..' . '/includes/frontend/class-shortcodes.php',
|
|
|
|
|
119 |
'RankMath\\Helper' => __DIR__ . '/../..' . '/includes/class-helper.php',
|
120 |
'RankMath\\Helpers\\Api' => __DIR__ . '/../..' . '/includes/helpers/class-api.php',
|
121 |
'RankMath\\Helpers\\Attachment' => __DIR__ . '/../..' . '/includes/helpers/class-attachment.php',
|
155 |
'RankMath\\Redirections\\Redirector' => __DIR__ . '/../..' . '/includes/modules/redirections/class-redirector.php',
|
156 |
'RankMath\\Redirections\\Table' => __DIR__ . '/../..' . '/includes/modules/redirections/class-table.php',
|
157 |
'RankMath\\Redirections\\Watcher' => __DIR__ . '/../..' . '/includes/modules/redirections/class-watcher.php',
|
|
|
158 |
'RankMath\\Replace_Vars' => __DIR__ . '/../..' . '/includes/class-replace-vars.php',
|
159 |
'RankMath\\Rest\\Admin' => __DIR__ . '/../..' . '/includes/rest/class-admin.php',
|
160 |
'RankMath\\Rest\\Helper' => __DIR__ . '/../..' . '/includes/rest/class-helper.php',
|
vendor/composer/installed.json
CHANGED
@@ -37,86 +37,6 @@
|
|
37 |
],
|
38 |
"description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks."
|
39 |
},
|
40 |
-
{
|
41 |
-
"name": "monolog/monolog",
|
42 |
-
"version": "1.24.0",
|
43 |
-
"version_normalized": "1.24.0.0",
|
44 |
-
"source": {
|
45 |
-
"type": "git",
|
46 |
-
"url": "https://github.com/Seldaek/monolog.git",
|
47 |
-
"reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266"
|
48 |
-
},
|
49 |
-
"dist": {
|
50 |
-
"type": "zip",
|
51 |
-
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266",
|
52 |
-
"reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266",
|
53 |
-
"shasum": ""
|
54 |
-
},
|
55 |
-
"require": {
|
56 |
-
"php": ">=5.3.0",
|
57 |
-
"psr/log": "~1.0"
|
58 |
-
},
|
59 |
-
"provide": {
|
60 |
-
"psr/log-implementation": "1.0.0"
|
61 |
-
},
|
62 |
-
"require-dev": {
|
63 |
-
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
64 |
-
"doctrine/couchdb": "~1.0@dev",
|
65 |
-
"graylog2/gelf-php": "~1.0",
|
66 |
-
"jakub-onderka/php-parallel-lint": "0.9",
|
67 |
-
"php-amqplib/php-amqplib": "~2.4",
|
68 |
-
"php-console/php-console": "^3.1.3",
|
69 |
-
"phpunit/phpunit": "~4.5",
|
70 |
-
"phpunit/phpunit-mock-objects": "2.3.0",
|
71 |
-
"ruflin/elastica": ">=0.90 <3.0",
|
72 |
-
"sentry/sentry": "^0.13",
|
73 |
-
"swiftmailer/swiftmailer": "^5.3|^6.0"
|
74 |
-
},
|
75 |
-
"suggest": {
|
76 |
-
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
|
77 |
-
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
|
78 |
-
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
|
79 |
-
"ext-mongo": "Allow sending log messages to a MongoDB server",
|
80 |
-
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
|
81 |
-
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
|
82 |
-
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
|
83 |
-
"php-console/php-console": "Allow sending log messages to Google Chrome",
|
84 |
-
"rollbar/rollbar": "Allow sending log messages to Rollbar",
|
85 |
-
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
|
86 |
-
"sentry/sentry": "Allow sending log messages to a Sentry server"
|
87 |
-
},
|
88 |
-
"time": "2018-11-05T09:00:11+00:00",
|
89 |
-
"type": "library",
|
90 |
-
"extra": {
|
91 |
-
"branch-alias": {
|
92 |
-
"dev-master": "2.0.x-dev"
|
93 |
-
}
|
94 |
-
},
|
95 |
-
"installation-source": "dist",
|
96 |
-
"autoload": {
|
97 |
-
"psr-4": {
|
98 |
-
"Monolog\\": "src/Monolog"
|
99 |
-
}
|
100 |
-
},
|
101 |
-
"notification-url": "https://packagist.org/downloads/",
|
102 |
-
"license": [
|
103 |
-
"MIT"
|
104 |
-
],
|
105 |
-
"authors": [
|
106 |
-
{
|
107 |
-
"name": "Jordi Boggiano",
|
108 |
-
"email": "j.boggiano@seld.be",
|
109 |
-
"homepage": "http://seld.be"
|
110 |
-
}
|
111 |
-
],
|
112 |
-
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
113 |
-
"homepage": "http://github.com/Seldaek/monolog",
|
114 |
-
"keywords": [
|
115 |
-
"log",
|
116 |
-
"logging",
|
117 |
-
"psr-3"
|
118 |
-
]
|
119 |
-
},
|
120 |
{
|
121 |
"name": "psr/log",
|
122 |
"version": "1.1.0",
|
@@ -166,68 +86,6 @@
|
|
166 |
"psr-3"
|
167 |
]
|
168 |
},
|
169 |
-
{
|
170 |
-
"name": "rollbar/rollbar",
|
171 |
-
"version": "v1.7.4",
|
172 |
-
"version_normalized": "1.7.4.0",
|
173 |
-
"source": {
|
174 |
-
"type": "git",
|
175 |
-
"url": "https://github.com/rollbar/rollbar-php.git",
|
176 |
-
"reference": "c20bc20b91222f367ce18b3e0bf30863c1c9de57"
|
177 |
-
},
|
178 |
-
"dist": {
|
179 |
-
"type": "zip",
|
180 |
-
"url": "https://api.github.com/repos/rollbar/rollbar-php/zipball/c20bc20b91222f367ce18b3e0bf30863c1c9de57",
|
181 |
-
"reference": "c20bc20b91222f367ce18b3e0bf30863c1c9de57",
|
182 |
-
"shasum": ""
|
183 |
-
},
|
184 |
-
"require": {
|
185 |
-
"ext-curl": "*",
|
186 |
-
"monolog/monolog": "^1.23",
|
187 |
-
"psr/log": "^1.0.1"
|
188 |
-
},
|
189 |
-
"require-dev": {
|
190 |
-
"codeclimate/php-test-reporter": "dev-master",
|
191 |
-
"mockery/mockery": "0.9.*",
|
192 |
-
"monolog/monolog": "^1.23",
|
193 |
-
"packfire/php5.3-compat": "*",
|
194 |
-
"phpmd/phpmd": "@stable",
|
195 |
-
"phpunit/phpunit": "4.8.*",
|
196 |
-
"squizlabs/php_codesniffer": "2.*"
|
197 |
-
},
|
198 |
-
"suggest": {
|
199 |
-
"fluent/logger": "Needed to use the 'fluent' handler for fluentd support",
|
200 |
-
"packfire/php5.3-compat": "for backward compatibility with PHP 5.3"
|
201 |
-
},
|
202 |
-
"time": "2019-01-02T16:24:41+00:00",
|
203 |
-
"type": "library",
|
204 |
-
"installation-source": "dist",
|
205 |
-
"autoload": {
|
206 |
-
"psr-4": {
|
207 |
-
"Rollbar\\": "src/"
|
208 |
-
}
|
209 |
-
},
|
210 |
-
"notification-url": "https://packagist.org/downloads/",
|
211 |
-
"license": [
|
212 |
-
"MIT"
|
213 |
-
],
|
214 |
-
"authors": [
|
215 |
-
{
|
216 |
-
"name": "Rollbar, Inc.",
|
217 |
-
"email": "support@rollbar.com",
|
218 |
-
"role": "Developer"
|
219 |
-
}
|
220 |
-
],
|
221 |
-
"description": "Monitors errors and exceptions and reports them to Rollbar",
|
222 |
-
"homepage": "http://github.com/rollbar/rollbar-php",
|
223 |
-
"keywords": [
|
224 |
-
"debugging",
|
225 |
-
"errors",
|
226 |
-
"exceptions",
|
227 |
-
"logging",
|
228 |
-
"monitoring"
|
229 |
-
]
|
230 |
-
},
|
231 |
{
|
232 |
"name": "cmb2/cmb2",
|
233 |
"version": "v2.6.0",
|
@@ -323,5 +181,66 @@
|
|
323 |
}
|
324 |
],
|
325 |
"description": "Collection of utilities required during development of a plugin or theme for WordPress. Build for developers by developers."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
}
|
327 |
]
|
37 |
],
|
38 |
"description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks."
|
39 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
{
|
41 |
"name": "psr/log",
|
42 |
"version": "1.1.0",
|
86 |
"psr-3"
|
87 |
]
|
88 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
{
|
90 |
"name": "cmb2/cmb2",
|
91 |
"version": "v2.6.0",
|
181 |
}
|
182 |
],
|
183 |
"description": "Collection of utilities required during development of a plugin or theme for WordPress. Build for developers by developers."
|
184 |
+
},
|
185 |
+
{
|
186 |
+
"name": "rollbar/rollbar",
|
187 |
+
"version": "v1.7.5",
|
188 |
+
"version_normalized": "1.7.5.0",
|
189 |
+
"source": {
|
190 |
+
"type": "git",
|
191 |
+
"url": "https://github.com/rollbar/rollbar-php.git",
|
192 |
+
"reference": "b1b33ae00f0d3f28d351552a85a367a425456ad7"
|
193 |
+
},
|
194 |
+
"dist": {
|
195 |
+
"type": "zip",
|
196 |
+
"url": "https://api.github.com/repos/rollbar/rollbar-php/zipball/b1b33ae00f0d3f28d351552a85a367a425456ad7",
|
197 |
+
"reference": "b1b33ae00f0d3f28d351552a85a367a425456ad7",
|
198 |
+
"shasum": ""
|
199 |
+
},
|
200 |
+
"require": {
|
201 |
+
"ext-curl": "*",
|
202 |
+
"psr/log": "^1.0.1"
|
203 |
+
},
|
204 |
+
"require-dev": {
|
205 |
+
"codeclimate/php-test-reporter": "dev-master",
|
206 |
+
"mockery/mockery": "0.9.*",
|
207 |
+
"monolog/monolog": "^1.24",
|
208 |
+
"packfire/php5.3-compat": "*",
|
209 |
+
"phpmd/phpmd": "@stable",
|
210 |
+
"phpunit/phpunit": "4.8.*",
|
211 |
+
"squizlabs/php_codesniffer": "2.*"
|
212 |
+
},
|
213 |
+
"suggest": {
|
214 |
+
"fluent/logger": "Needed to use the 'fluent' handler for fluentd support",
|
215 |
+
"packfire/php5.3-compat": "for backward compatibility with PHP 5.3"
|
216 |
+
},
|
217 |
+
"time": "2019-03-04T08:56:09+00:00",
|
218 |
+
"type": "library",
|
219 |
+
"installation-source": "dist",
|
220 |
+
"autoload": {
|
221 |
+
"psr-4": {
|
222 |
+
"Rollbar\\": "src/"
|
223 |
+
}
|
224 |
+
},
|
225 |
+
"notification-url": "https://packagist.org/downloads/",
|
226 |
+
"license": [
|
227 |
+
"MIT"
|
228 |
+
],
|
229 |
+
"authors": [
|
230 |
+
{
|
231 |
+
"name": "Rollbar, Inc.",
|
232 |
+
"email": "support@rollbar.com",
|
233 |
+
"role": "Developer"
|
234 |
+
}
|
235 |
+
],
|
236 |
+
"description": "Monitors errors and exceptions and reports them to Rollbar",
|
237 |
+
"homepage": "http://github.com/rollbar/rollbar-php",
|
238 |
+
"keywords": [
|
239 |
+
"debugging",
|
240 |
+
"errors",
|
241 |
+
"exceptions",
|
242 |
+
"logging",
|
243 |
+
"monitoring"
|
244 |
+
]
|
245 |
}
|
246 |
]
|
vendor/monolog/monolog/.php_cs
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$header = <<<EOF
|
4 |
-
This file is part of the Monolog package.
|
5 |
-
|
6 |
-
(c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
|
8 |
-
For the full copyright and license information, please view the LICENSE
|
9 |
-
file that was distributed with this source code.
|
10 |
-
EOF;
|
11 |
-
|
12 |
-
$finder = Symfony\CS\Finder::create()
|
13 |
-
->files()
|
14 |
-
->name('*.php')
|
15 |
-
->exclude('Fixtures')
|
16 |
-
->in(__DIR__.'/src')
|
17 |
-
->in(__DIR__.'/tests')
|
18 |
-
;
|
19 |
-
|
20 |
-
return Symfony\CS\Config::create()
|
21 |
-
->setUsingCache(true)
|
22 |
-
//->setUsingLinter(false)
|
23 |
-
->setRiskyAllowed(true)
|
24 |
-
->setRules(array(
|
25 |
-
'@PSR2' => true,
|
26 |
-
'binary_operator_spaces' => true,
|
27 |
-
'blank_line_before_return' => true,
|
28 |
-
'header_comment' => array('header' => $header),
|
29 |
-
'include' => true,
|
30 |
-
'long_array_syntax' => true,
|
31 |
-
'method_separation' => true,
|
32 |
-
'no_blank_lines_after_class_opening' => true,
|
33 |
-
'no_blank_lines_after_phpdoc' => true,
|
34 |
-
'no_blank_lines_between_uses' => true,
|
35 |
-
'no_duplicate_semicolons' => true,
|
36 |
-
'no_extra_consecutive_blank_lines' => true,
|
37 |
-
'no_leading_import_slash' => true,
|
38 |
-
'no_leading_namespace_whitespace' => true,
|
39 |
-
'no_trailing_comma_in_singleline_array' => true,
|
40 |
-
'no_unused_imports' => true,
|
41 |
-
'object_operator_without_whitespace' => true,
|
42 |
-
'phpdoc_align' => true,
|
43 |
-
'phpdoc_indent' => true,
|
44 |
-
'phpdoc_no_access' => true,
|
45 |
-
'phpdoc_no_package' => true,
|
46 |
-
'phpdoc_order' => true,
|
47 |
-
'phpdoc_scalar' => true,
|
48 |
-
'phpdoc_trim' => true,
|
49 |
-
'phpdoc_type_to_var' => true,
|
50 |
-
'psr0' => true,
|
51 |
-
'single_blank_line_before_namespace' => true,
|
52 |
-
'spaces_cast' => true,
|
53 |
-
'standardize_not_equals' => true,
|
54 |
-
'ternary_operator_spaces' => true,
|
55 |
-
'trailing_comma_in_multiline_array' => true,
|
56 |
-
'whitespacy_lines' => true,
|
57 |
-
))
|
58 |
-
->finder($finder)
|
59 |
-
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/CHANGELOG.md
DELETED
@@ -1,370 +0,0 @@
|
|
1 |
-
### 1.24.0 (2018-11-05)
|
2 |
-
|
3 |
-
* Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors
|
4 |
-
* Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers)
|
5 |
-
* Added a way to log signals being received using Monolog\SignalHandler
|
6 |
-
* Added ability to customize error handling at the Logger level using Logger::setExceptionHandler
|
7 |
-
* Added InsightOpsHandler to migrate users of the LogEntriesHandler
|
8 |
-
* Added protection to NormalizerHandler against circular and very deep structures, it now stops normalizing at a depth of 9
|
9 |
-
* Added capture of stack traces to ErrorHandler when logging PHP errors
|
10 |
-
* Added RavenHandler support for a `contexts` context or extra key to forward that to Sentry's contexts
|
11 |
-
* Added forwarding of context info to FluentdFormatter
|
12 |
-
* Added SocketHandler::setChunkSize to override the default chunk size in case you must send large log lines to rsyslog for example
|
13 |
-
* Added ability to extend/override BrowserConsoleHandler
|
14 |
-
* Added SlackWebhookHandler::getWebhookUrl and SlackHandler::getToken to enable class extensibility
|
15 |
-
* Added SwiftMailerHandler::getSubjectFormatter to enable class extensibility
|
16 |
-
* Dropped official support for HHVM in test builds
|
17 |
-
* Fixed normalization of exception traces when call_user_func is used to avoid serializing objects and the data they contain
|
18 |
-
* Fixed naming of fields in Slack handler, all field names are now capitalized in all cases
|
19 |
-
* Fixed HipChatHandler bug where slack dropped messages randomly
|
20 |
-
* Fixed normalization of objects in Slack handlers
|
21 |
-
* Fixed support for PHP7's Throwable in NewRelicHandler
|
22 |
-
* Fixed race bug when StreamHandler sometimes incorrectly reported it failed to create a directory
|
23 |
-
* Fixed table row styling issues in HtmlFormatter
|
24 |
-
* Fixed RavenHandler dropping the message when logging exception
|
25 |
-
* Fixed WhatFailureGroupHandler skipping processors when using handleBatch
|
26 |
-
and implement it where possible
|
27 |
-
* Fixed display of anonymous class names
|
28 |
-
|
29 |
-
### 1.23.0 (2017-06-19)
|
30 |
-
|
31 |
-
* Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument
|
32 |
-
* Fixed GelfHandler truncation to be per field and not per message
|
33 |
-
* Fixed compatibility issue with PHP <5.3.6
|
34 |
-
* Fixed support for headless Chrome in ChromePHPHandler
|
35 |
-
* Fixed support for latest Aws SDK in DynamoDbHandler
|
36 |
-
* Fixed support for SwiftMailer 6.0+ in SwiftMailerHandler
|
37 |
-
|
38 |
-
### 1.22.1 (2017-03-13)
|
39 |
-
|
40 |
-
* Fixed lots of minor issues in the new Slack integrations
|
41 |
-
* Fixed support for allowInlineLineBreaks in LineFormatter when formatting exception backtraces
|
42 |
-
|
43 |
-
### 1.22.0 (2016-11-26)
|
44 |
-
|
45 |
-
* Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily
|
46 |
-
* Added MercurialProcessor to add mercurial revision and branch names to log records
|
47 |
-
* Added support for AWS SDK v3 in DynamoDbHandler
|
48 |
-
* Fixed fatal errors occuring when normalizing generators that have been fully consumed
|
49 |
-
* Fixed RollbarHandler to include a level (rollbar level), monolog_level (original name), channel and datetime (unix)
|
50 |
-
* Fixed RollbarHandler not flushing records automatically, calling close() explicitly is not necessary anymore
|
51 |
-
* Fixed SyslogUdpHandler to avoid sending empty frames
|
52 |
-
* Fixed a few PHP 7.0 and 7.1 compatibility issues
|
53 |
-
|
54 |
-
### 1.21.0 (2016-07-29)
|
55 |
-
|
56 |
-
* Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues
|
57 |
-
* Added support for more formats in RotatingFileHandler::setFilenameFormat as long as they have Y, m and d in order
|
58 |
-
* Added ability to format the main line of text the SlackHandler sends by explictly setting a formatter on the handler
|
59 |
-
* Added information about SoapFault instances in NormalizerFormatter
|
60 |
-
* Added $handleOnlyReportedErrors option on ErrorHandler::registerErrorHandler (default true) to allow logging of all errors no matter the error_reporting level
|
61 |
-
|
62 |
-
### 1.20.0 (2016-07-02)
|
63 |
-
|
64 |
-
* Added FingersCrossedHandler::activate() to manually trigger the handler regardless of the activation policy
|
65 |
-
* Added StreamHandler::getUrl to retrieve the stream's URL
|
66 |
-
* Added ability to override addRow/addTitle in HtmlFormatter
|
67 |
-
* Added the $context to context information when the ErrorHandler handles a regular php error
|
68 |
-
* Deprecated RotatingFileHandler::setFilenameFormat to only support 3 formats: Y, Y-m and Y-m-d
|
69 |
-
* Fixed WhatFailureGroupHandler to work with PHP7 throwables
|
70 |
-
* Fixed a few minor bugs
|
71 |
-
|
72 |
-
### 1.19.0 (2016-04-12)
|
73 |
-
|
74 |
-
* Break: StreamHandler will not close streams automatically that it does not own. If you pass in a stream (not a path/url), then it will not close it for you. You can retrieve those using getStream() if needed
|
75 |
-
* Added DeduplicationHandler to remove duplicate records from notifications across multiple requests, useful for email or other notifications on errors
|
76 |
-
* Added ability to use `%message%` and other LineFormatter replacements in the subject line of emails sent with NativeMailHandler and SwiftMailerHandler
|
77 |
-
* Fixed HipChatHandler handling of long messages
|
78 |
-
|
79 |
-
### 1.18.2 (2016-04-02)
|
80 |
-
|
81 |
-
* Fixed ElasticaFormatter to use more precise dates
|
82 |
-
* Fixed GelfMessageFormatter sending too long messages
|
83 |
-
|
84 |
-
### 1.18.1 (2016-03-13)
|
85 |
-
|
86 |
-
* Fixed SlackHandler bug where slack dropped messages randomly
|
87 |
-
* Fixed RedisHandler issue when using with the PHPRedis extension
|
88 |
-
* Fixed AmqpHandler content-type being incorrectly set when using with the AMQP extension
|
89 |
-
* Fixed BrowserConsoleHandler regression
|
90 |
-
|
91 |
-
### 1.18.0 (2016-03-01)
|
92 |
-
|
93 |
-
* Added optional reduction of timestamp precision via `Logger->useMicrosecondTimestamps(false)`, disabling it gets you a bit of performance boost but reduces the precision to the second instead of microsecond
|
94 |
-
* Added possibility to skip some extra stack frames in IntrospectionProcessor if you have some library wrapping Monolog that is always adding frames
|
95 |
-
* Added `Logger->withName` to clone a logger (keeping all handlers) with a new name
|
96 |
-
* Added FluentdFormatter for the Fluentd unix socket protocol
|
97 |
-
* Added HandlerWrapper base class to ease the creation of handler wrappers, just extend it and override as needed
|
98 |
-
* Added support for replacing context sub-keys using `%context.*%` in LineFormatter
|
99 |
-
* Added support for `payload` context value in RollbarHandler
|
100 |
-
* Added setRelease to RavenHandler to describe the application version, sent with every log
|
101 |
-
* Added support for `fingerprint` context value in RavenHandler
|
102 |
-
* Fixed JSON encoding errors that would gobble up the whole log record, we now handle those more gracefully by dropping chars as needed
|
103 |
-
* Fixed write timeouts in SocketHandler and derivatives, set to 10sec by default, lower it with `setWritingTimeout()`
|
104 |
-
* Fixed PHP7 compatibility with regard to Exception/Throwable handling in a few places
|
105 |
-
|
106 |
-
### 1.17.2 (2015-10-14)
|
107 |
-
|
108 |
-
* Fixed ErrorHandler compatibility with non-Monolog PSR-3 loggers
|
109 |
-
* Fixed SlackHandler handling to use slack functionalities better
|
110 |
-
* Fixed SwiftMailerHandler bug when sending multiple emails they all had the same id
|
111 |
-
* Fixed 5.3 compatibility regression
|
112 |
-
|
113 |
-
### 1.17.1 (2015-08-31)
|
114 |
-
|
115 |
-
* Fixed RollbarHandler triggering PHP notices
|
116 |
-
|
117 |
-
### 1.17.0 (2015-08-30)
|
118 |
-
|
119 |
-
* Added support for `checksum` and `release` context/extra values in RavenHandler
|
120 |
-
* Added better support for exceptions in RollbarHandler
|
121 |
-
* Added UidProcessor::getUid
|
122 |
-
* Added support for showing the resource type in NormalizedFormatter
|
123 |
-
* Fixed IntrospectionProcessor triggering PHP notices
|
124 |
-
|
125 |
-
### 1.16.0 (2015-08-09)
|
126 |
-
|
127 |
-
* Added IFTTTHandler to notify ifttt.com triggers
|
128 |
-
* Added Logger::setHandlers() to allow setting/replacing all handlers
|
129 |
-
* Added $capSize in RedisHandler to cap the log size
|
130 |
-
* Fixed StreamHandler creation of directory to only trigger when the first log write happens
|
131 |
-
* Fixed bug in the handling of curl failures
|
132 |
-
* Fixed duplicate logging of fatal errors when both error and fatal error handlers are registered in monolog's ErrorHandler
|
133 |
-
* Fixed missing fatal errors records with handlers that need to be closed to flush log records
|
134 |
-
* Fixed TagProcessor::addTags support for associative arrays
|
135 |
-
|
136 |
-
### 1.15.0 (2015-07-12)
|
137 |
-
|
138 |
-
* Added addTags and setTags methods to change a TagProcessor
|
139 |
-
* Added automatic creation of directories if they are missing for a StreamHandler to open a log file
|
140 |
-
* Added retry functionality to Loggly, Cube and Mandrill handlers so they retry up to 5 times in case of network failure
|
141 |
-
* Fixed process exit code being incorrectly reset to 0 if ErrorHandler::registerExceptionHandler was used
|
142 |
-
* Fixed HTML/JS escaping in BrowserConsoleHandler
|
143 |
-
* Fixed JSON encoding errors being silently suppressed (PHP 5.5+ only)
|
144 |
-
|
145 |
-
### 1.14.0 (2015-06-19)
|
146 |
-
|
147 |
-
* Added PHPConsoleHandler to send record to Chrome's PHP Console extension and library
|
148 |
-
* Added support for objects implementing __toString in the NormalizerFormatter
|
149 |
-
* Added support for HipChat's v2 API in HipChatHandler
|
150 |
-
* Added Logger::setTimezone() to initialize the timezone monolog should use in case date.timezone isn't correct for your app
|
151 |
-
* Added an option to send formatted message instead of the raw record on PushoverHandler via ->useFormattedMessage(true)
|
152 |
-
* Fixed curl errors being silently suppressed
|
153 |
-
|
154 |
-
### 1.13.1 (2015-03-09)
|
155 |
-
|
156 |
-
* Fixed regression in HipChat requiring a new token to be created
|
157 |
-
|
158 |
-
### 1.13.0 (2015-03-05)
|
159 |
-
|
160 |
-
* Added Registry::hasLogger to check for the presence of a logger instance
|
161 |
-
* Added context.user support to RavenHandler
|
162 |
-
* Added HipChat API v2 support in the HipChatHandler
|
163 |
-
* Added NativeMailerHandler::addParameter to pass params to the mail() process
|
164 |
-
* Added context data to SlackHandler when $includeContextAndExtra is true
|
165 |
-
* Added ability to customize the Swift_Message per-email in SwiftMailerHandler
|
166 |
-
* Fixed SwiftMailerHandler to lazily create message instances if a callback is provided
|
167 |
-
* Fixed serialization of INF and NaN values in Normalizer and LineFormatter
|
168 |
-
|
169 |
-
### 1.12.0 (2014-12-29)
|
170 |
-
|
171 |
-
* Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers.
|
172 |
-
* Added PsrHandler to forward records to another PSR-3 logger
|
173 |
-
* Added SamplingHandler to wrap around a handler and include only every Nth record
|
174 |
-
* Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now)
|
175 |
-
* Added exception codes in the output of most formatters
|
176 |
-
* Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line)
|
177 |
-
* Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data
|
178 |
-
* Added $host to HipChatHandler for users of private instances
|
179 |
-
* Added $transactionName to NewRelicHandler and support for a transaction_name context value
|
180 |
-
* Fixed MandrillHandler to avoid outputing API call responses
|
181 |
-
* Fixed some non-standard behaviors in SyslogUdpHandler
|
182 |
-
|
183 |
-
### 1.11.0 (2014-09-30)
|
184 |
-
|
185 |
-
* Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names
|
186 |
-
* Added WhatFailureGroupHandler to suppress any exception coming from the wrapped handlers and avoid chain failures if a logging service fails
|
187 |
-
* Added MandrillHandler to send emails via the Mandrillapp.com API
|
188 |
-
* Added SlackHandler to log records to a Slack.com account
|
189 |
-
* Added FleepHookHandler to log records to a Fleep.io account
|
190 |
-
* Added LogglyHandler::addTag to allow adding tags to an existing handler
|
191 |
-
* Added $ignoreEmptyContextAndExtra to LineFormatter to avoid empty [] at the end
|
192 |
-
* Added $useLocking to StreamHandler and RotatingFileHandler to enable flock() while writing
|
193 |
-
* Added support for PhpAmqpLib in the AmqpHandler
|
194 |
-
* Added FingersCrossedHandler::clear and BufferHandler::clear to reset them between batches in long running jobs
|
195 |
-
* Added support for adding extra fields from $_SERVER in the WebProcessor
|
196 |
-
* Fixed support for non-string values in PrsLogMessageProcessor
|
197 |
-
* Fixed SwiftMailer messages being sent with the wrong date in long running scripts
|
198 |
-
* Fixed minor PHP 5.6 compatibility issues
|
199 |
-
* Fixed BufferHandler::close being called twice
|
200 |
-
|
201 |
-
### 1.10.0 (2014-06-04)
|
202 |
-
|
203 |
-
* Added Logger::getHandlers() and Logger::getProcessors() methods
|
204 |
-
* Added $passthruLevel argument to FingersCrossedHandler to let it always pass some records through even if the trigger level is not reached
|
205 |
-
* Added support for extra data in NewRelicHandler
|
206 |
-
* Added $expandNewlines flag to the ErrorLogHandler to create multiple log entries when a message has multiple lines
|
207 |
-
|
208 |
-
### 1.9.1 (2014-04-24)
|
209 |
-
|
210 |
-
* Fixed regression in RotatingFileHandler file permissions
|
211 |
-
* Fixed initialization of the BufferHandler to make sure it gets flushed after receiving records
|
212 |
-
* Fixed ChromePHPHandler and FirePHPHandler's activation strategies to be more conservative
|
213 |
-
|
214 |
-
### 1.9.0 (2014-04-20)
|
215 |
-
|
216 |
-
* Added LogEntriesHandler to send logs to a LogEntries account
|
217 |
-
* Added $filePermissions to tweak file mode on StreamHandler and RotatingFileHandler
|
218 |
-
* Added $useFormatting flag to MemoryProcessor to make it send raw data in bytes
|
219 |
-
* Added support for table formatting in FirePHPHandler via the table context key
|
220 |
-
* Added a TagProcessor to add tags to records, and support for tags in RavenHandler
|
221 |
-
* Added $appendNewline flag to the JsonFormatter to enable using it when logging to files
|
222 |
-
* Added sound support to the PushoverHandler
|
223 |
-
* Fixed multi-threading support in StreamHandler
|
224 |
-
* Fixed empty headers issue when ChromePHPHandler received no records
|
225 |
-
* Fixed default format of the ErrorLogHandler
|
226 |
-
|
227 |
-
### 1.8.0 (2014-03-23)
|
228 |
-
|
229 |
-
* Break: the LineFormatter now strips newlines by default because this was a bug, set $allowInlineLineBreaks to true if you need them
|
230 |
-
* Added BrowserConsoleHandler to send logs to any browser's console via console.log() injection in the output
|
231 |
-
* Added FilterHandler to filter records and only allow those of a given list of levels through to the wrapped handler
|
232 |
-
* Added FlowdockHandler to send logs to a Flowdock account
|
233 |
-
* Added RollbarHandler to send logs to a Rollbar account
|
234 |
-
* Added HtmlFormatter to send prettier log emails with colors for each log level
|
235 |
-
* Added GitProcessor to add the current branch/commit to extra record data
|
236 |
-
* Added a Monolog\Registry class to allow easier global access to pre-configured loggers
|
237 |
-
* Added support for the new official graylog2/gelf-php lib for GelfHandler, upgrade if you can by replacing the mlehner/gelf-php requirement
|
238 |
-
* Added support for HHVM
|
239 |
-
* Added support for Loggly batch uploads
|
240 |
-
* Added support for tweaking the content type and encoding in NativeMailerHandler
|
241 |
-
* Added $skipClassesPartials to tweak the ignored classes in the IntrospectionProcessor
|
242 |
-
* Fixed batch request support in GelfHandler
|
243 |
-
|
244 |
-
### 1.7.0 (2013-11-14)
|
245 |
-
|
246 |
-
* Added ElasticSearchHandler to send logs to an Elastic Search server
|
247 |
-
* Added DynamoDbHandler and ScalarFormatter to send logs to Amazon's Dynamo DB
|
248 |
-
* Added SyslogUdpHandler to send logs to a remote syslogd server
|
249 |
-
* Added LogglyHandler to send logs to a Loggly account
|
250 |
-
* Added $level to IntrospectionProcessor so it only adds backtraces when needed
|
251 |
-
* Added $version to LogstashFormatter to allow using the new v1 Logstash format
|
252 |
-
* Added $appName to NewRelicHandler
|
253 |
-
* Added configuration of Pushover notification retries/expiry
|
254 |
-
* Added $maxColumnWidth to NativeMailerHandler to change the 70 chars default
|
255 |
-
* Added chainability to most setters for all handlers
|
256 |
-
* Fixed RavenHandler batch processing so it takes the message from the record with highest priority
|
257 |
-
* Fixed HipChatHandler batch processing so it sends all messages at once
|
258 |
-
* Fixed issues with eAccelerator
|
259 |
-
* Fixed and improved many small things
|
260 |
-
|
261 |
-
### 1.6.0 (2013-07-29)
|
262 |
-
|
263 |
-
* Added HipChatHandler to send logs to a HipChat chat room
|
264 |
-
* Added ErrorLogHandler to send logs to PHP's error_log function
|
265 |
-
* Added NewRelicHandler to send logs to NewRelic's service
|
266 |
-
* Added Monolog\ErrorHandler helper class to register a Logger as exception/error/fatal handler
|
267 |
-
* Added ChannelLevelActivationStrategy for the FingersCrossedHandler to customize levels by channel
|
268 |
-
* Added stack traces output when normalizing exceptions (json output & co)
|
269 |
-
* Added Monolog\Logger::API constant (currently 1)
|
270 |
-
* Added support for ChromePHP's v4.0 extension
|
271 |
-
* Added support for message priorities in PushoverHandler, see $highPriorityLevel and $emergencyLevel
|
272 |
-
* Added support for sending messages to multiple users at once with the PushoverHandler
|
273 |
-
* Fixed RavenHandler's support for batch sending of messages (when behind a Buffer or FingersCrossedHandler)
|
274 |
-
* Fixed normalization of Traversables with very large data sets, only the first 1000 items are shown now
|
275 |
-
* Fixed issue in RotatingFileHandler when an open_basedir restriction is active
|
276 |
-
* Fixed minor issues in RavenHandler and bumped the API to Raven 0.5.0
|
277 |
-
* Fixed SyslogHandler issue when many were used concurrently with different facilities
|
278 |
-
|
279 |
-
### 1.5.0 (2013-04-23)
|
280 |
-
|
281 |
-
* Added ProcessIdProcessor to inject the PID in log records
|
282 |
-
* Added UidProcessor to inject a unique identifier to all log records of one request/run
|
283 |
-
* Added support for previous exceptions in the LineFormatter exception serialization
|
284 |
-
* Added Monolog\Logger::getLevels() to get all available levels
|
285 |
-
* Fixed ChromePHPHandler so it avoids sending headers larger than Chrome can handle
|
286 |
-
|
287 |
-
### 1.4.1 (2013-04-01)
|
288 |
-
|
289 |
-
* Fixed exception formatting in the LineFormatter to be more minimalistic
|
290 |
-
* Fixed RavenHandler's handling of context/extra data, requires Raven client >0.1.0
|
291 |
-
* Fixed log rotation in RotatingFileHandler to work with long running scripts spanning multiple days
|
292 |
-
* Fixed WebProcessor array access so it checks for data presence
|
293 |
-
* Fixed Buffer, Group and FingersCrossed handlers to make use of their processors
|
294 |
-
|
295 |
-
### 1.4.0 (2013-02-13)
|
296 |
-
|
297 |
-
* Added RedisHandler to log to Redis via the Predis library or the phpredis extension
|
298 |
-
* Added ZendMonitorHandler to log to the Zend Server monitor
|
299 |
-
* Added the possibility to pass arrays of handlers and processors directly in the Logger constructor
|
300 |
-
* Added `$useSSL` option to the PushoverHandler which is enabled by default
|
301 |
-
* Fixed ChromePHPHandler and FirePHPHandler issue when multiple instances are used simultaneously
|
302 |
-
* Fixed header injection capability in the NativeMailHandler
|
303 |
-
|
304 |
-
### 1.3.1 (2013-01-11)
|
305 |
-
|
306 |
-
* Fixed LogstashFormatter to be usable with stream handlers
|
307 |
-
* Fixed GelfMessageFormatter levels on Windows
|
308 |
-
|
309 |
-
### 1.3.0 (2013-01-08)
|
310 |
-
|
311 |
-
* Added PSR-3 compliance, the `Monolog\Logger` class is now an instance of `Psr\Log\LoggerInterface`
|
312 |
-
* Added PsrLogMessageProcessor that you can selectively enable for full PSR-3 compliance
|
313 |
-
* Added LogstashFormatter (combine with SocketHandler or StreamHandler to send logs to Logstash)
|
314 |
-
* Added PushoverHandler to send mobile notifications
|
315 |
-
* Added CouchDBHandler and DoctrineCouchDBHandler
|
316 |
-
* Added RavenHandler to send data to Sentry servers
|
317 |
-
* Added support for the new MongoClient class in MongoDBHandler
|
318 |
-
* Added microsecond precision to log records' timestamps
|
319 |
-
* Added `$flushOnOverflow` param to BufferHandler to flush by batches instead of losing
|
320 |
-
the oldest entries
|
321 |
-
* Fixed normalization of objects with cyclic references
|
322 |
-
|
323 |
-
### 1.2.1 (2012-08-29)
|
324 |
-
|
325 |
-
* Added new $logopts arg to SyslogHandler to provide custom openlog options
|
326 |
-
* Fixed fatal error in SyslogHandler
|
327 |
-
|
328 |
-
### 1.2.0 (2012-08-18)
|
329 |
-
|
330 |
-
* Added AmqpHandler (for use with AMQP servers)
|
331 |
-
* Added CubeHandler
|
332 |
-
* Added NativeMailerHandler::addHeader() to send custom headers in mails
|
333 |
-
* Added the possibility to specify more than one recipient in NativeMailerHandler
|
334 |
-
* Added the possibility to specify float timeouts in SocketHandler
|
335 |
-
* Added NOTICE and EMERGENCY levels to conform with RFC 5424
|
336 |
-
* Fixed the log records to use the php default timezone instead of UTC
|
337 |
-
* Fixed BufferHandler not being flushed properly on PHP fatal errors
|
338 |
-
* Fixed normalization of exotic resource types
|
339 |
-
* Fixed the default format of the SyslogHandler to avoid duplicating datetimes in syslog
|
340 |
-
|
341 |
-
### 1.1.0 (2012-04-23)
|
342 |
-
|
343 |
-
* Added Monolog\Logger::isHandling() to check if a handler will
|
344 |
-
handle the given log level
|
345 |
-
* Added ChromePHPHandler
|
346 |
-
* Added MongoDBHandler
|
347 |
-
* Added GelfHandler (for use with Graylog2 servers)
|
348 |
-
* Added SocketHandler (for use with syslog-ng for example)
|
349 |
-
* Added NormalizerFormatter
|
350 |
-
* Added the possibility to change the activation strategy of the FingersCrossedHandler
|
351 |
-
* Added possibility to show microseconds in logs
|
352 |
-
* Added `server` and `referer` to WebProcessor output
|
353 |
-
|
354 |
-
### 1.0.2 (2011-10-24)
|
355 |
-
|
356 |
-
* Fixed bug in IE with large response headers and FirePHPHandler
|
357 |
-
|
358 |
-
### 1.0.1 (2011-08-25)
|
359 |
-
|
360 |
-
* Added MemoryPeakUsageProcessor and MemoryUsageProcessor
|
361 |
-
* Added Monolog\Logger::getName() to get a logger's channel name
|
362 |
-
|
363 |
-
### 1.0.0 (2011-07-06)
|
364 |
-
|
365 |
-
* Added IntrospectionProcessor to get info from where the logger was called
|
366 |
-
* Fixed WebProcessor in CLI
|
367 |
-
|
368 |
-
### 1.0.0-RC1 (2011-07-01)
|
369 |
-
|
370 |
-
* Initial release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/LICENSE
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
Copyright (c) 2011-2016 Jordi Boggiano
|
2 |
-
|
3 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
-
of this software and associated documentation files (the "Software"), to deal
|
5 |
-
in the Software without restriction, including without limitation the rights
|
6 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
-
copies of the Software, and to permit persons to whom the Software is furnished
|
8 |
-
to do so, subject to the following conditions:
|
9 |
-
|
10 |
-
The above copyright notice and this permission notice shall be included in all
|
11 |
-
copies or substantial portions of the Software.
|
12 |
-
|
13 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 |
-
THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/doc/01-usage.md
DELETED
@@ -1,231 +0,0 @@
|
|
1 |
-
# Using Monolog
|
2 |
-
|
3 |
-
- [Installation](#installation)
|
4 |
-
- [Core Concepts](#core-concepts)
|
5 |
-
- [Log Levels](#log-levels)
|
6 |
-
- [Configuring a logger](#configuring-a-logger)
|
7 |
-
- [Adding extra data in the records](#adding-extra-data-in-the-records)
|
8 |
-
- [Leveraging channels](#leveraging-channels)
|
9 |
-
- [Customizing the log format](#customizing-the-log-format)
|
10 |
-
|
11 |
-
## Installation
|
12 |
-
|
13 |
-
Monolog is available on Packagist ([monolog/monolog](http://packagist.org/packages/monolog/monolog))
|
14 |
-
and as such installable via [Composer](http://getcomposer.org/).
|
15 |
-
|
16 |
-
```bash
|
17 |
-
composer require monolog/monolog
|
18 |
-
```
|
19 |
-
|
20 |
-
If you do not use Composer, you can grab the code from GitHub, and use any
|
21 |
-
PSR-0 compatible autoloader (e.g. the [Symfony2 ClassLoader component](https://github.com/symfony/ClassLoader))
|
22 |
-
to load Monolog classes.
|
23 |
-
|
24 |
-
## Core Concepts
|
25 |
-
|
26 |
-
Every `Logger` instance has a channel (name) and a stack of handlers. Whenever
|
27 |
-
you add a record to the logger, it traverses the handler stack. Each handler
|
28 |
-
decides whether it fully handled the record, and if so, the propagation of the
|
29 |
-
record ends there.
|
30 |
-
|
31 |
-
This allows for flexible logging setups, for example having a `StreamHandler` at
|
32 |
-
the bottom of the stack that will log anything to disk, and on top of that add
|
33 |
-
a `MailHandler` that will send emails only when an error message is logged.
|
34 |
-
Handlers also have a `$bubble` property which defines whether they block the
|
35 |
-
record or not if they handled it. In this example, setting the `MailHandler`'s
|
36 |
-
`$bubble` argument to false means that records handled by the `MailHandler` will
|
37 |
-
not propagate to the `StreamHandler` anymore.
|
38 |
-
|
39 |
-
You can create many `Logger`s, each defining a channel (e.g.: db, request,
|
40 |
-
router, ..) and each of them combining various handlers, which can be shared
|
41 |
-
or not. The channel is reflected in the logs and allows you to easily see or
|
42 |
-
filter records.
|
43 |
-
|
44 |
-
Each Handler also has a Formatter, a default one with settings that make sense
|
45 |
-
will be created if you don't set one. The formatters normalize and format
|
46 |
-
incoming records so that they can be used by the handlers to output useful
|
47 |
-
information.
|
48 |
-
|
49 |
-
Custom severity levels are not available. Only the eight
|
50 |
-
[RFC 5424](http://tools.ietf.org/html/rfc5424) levels (debug, info, notice,
|
51 |
-
warning, error, critical, alert, emergency) are present for basic filtering
|
52 |
-
purposes, but for sorting and other use cases that would require
|
53 |
-
flexibility, you should add Processors to the Logger that can add extra
|
54 |
-
information (tags, user ip, ..) to the records before they are handled.
|
55 |
-
|
56 |
-
## Log Levels
|
57 |
-
|
58 |
-
Monolog supports the logging levels described by [RFC 5424](http://tools.ietf.org/html/rfc5424).
|
59 |
-
|
60 |
-
- **DEBUG** (100): Detailed debug information.
|
61 |
-
|
62 |
-
- **INFO** (200): Interesting events. Examples: User logs in, SQL logs.
|
63 |
-
|
64 |
-
- **NOTICE** (250): Normal but significant events.
|
65 |
-
|
66 |
-
- **WARNING** (300): Exceptional occurrences that are not errors. Examples:
|
67 |
-
Use of deprecated APIs, poor use of an API, undesirable things that are not
|
68 |
-
necessarily wrong.
|
69 |
-
|
70 |
-
- **ERROR** (400): Runtime errors that do not require immediate action but
|
71 |
-
should typically be logged and monitored.
|
72 |
-
|
73 |
-
- **CRITICAL** (500): Critical conditions. Example: Application component
|
74 |
-
unavailable, unexpected exception.
|
75 |
-
|
76 |
-
- **ALERT** (550): Action must be taken immediately. Example: Entire website
|
77 |
-
down, database unavailable, etc. This should trigger the SMS alerts and wake
|
78 |
-
you up.
|
79 |
-
|
80 |
-
- **EMERGENCY** (600): Emergency: system is unusable.
|
81 |
-
|
82 |
-
## Configuring a logger
|
83 |
-
|
84 |
-
Here is a basic setup to log to a file and to firephp on the DEBUG level:
|
85 |
-
|
86 |
-
```php
|
87 |
-
<?php
|
88 |
-
|
89 |
-
use Monolog\Logger;
|
90 |
-
use Monolog\Handler\StreamHandler;
|
91 |
-
use Monolog\Handler\FirePHPHandler;
|
92 |
-
|
93 |
-
// Create the logger
|
94 |
-
$logger = new Logger('my_logger');
|
95 |
-
// Now add some handlers
|
96 |
-
$logger->pushHandler(new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG));
|
97 |
-
$logger->pushHandler(new FirePHPHandler());
|
98 |
-
|
99 |
-
// You can now use your logger
|
100 |
-
$logger->addInfo('My logger is now ready');
|
101 |
-
```
|
102 |
-
|
103 |
-
Let's explain it. The first step is to create the logger instance which will
|
104 |
-
be used in your code. The argument is a channel name, which is useful when
|
105 |
-
you use several loggers (see below for more details about it).
|
106 |
-
|
107 |
-
The logger itself does not know how to handle a record. It delegates it to
|
108 |
-
some handlers. The code above registers two handlers in the stack to allow
|
109 |
-
handling records in two different ways.
|
110 |
-
|
111 |
-
Note that the FirePHPHandler is called first as it is added on top of the
|
112 |
-
stack. This allows you to temporarily add a logger with bubbling disabled if
|
113 |
-
you want to override other configured loggers.
|
114 |
-
|
115 |
-
> If you use Monolog standalone and are looking for an easy way to
|
116 |
-
> configure many handlers, the [theorchard/monolog-cascade](https://github.com/theorchard/monolog-cascade)
|
117 |
-
> can help you build complex logging configs via PHP arrays, yaml or json configs.
|
118 |
-
|
119 |
-
## Adding extra data in the records
|
120 |
-
|
121 |
-
Monolog provides two different ways to add extra informations along the simple
|
122 |
-
textual message.
|
123 |
-
|
124 |
-
### Using the logging context
|
125 |
-
|
126 |
-
The first way is the context, allowing to pass an array of data along the
|
127 |
-
record:
|
128 |
-
|
129 |
-
```php
|
130 |
-
<?php
|
131 |
-
|
132 |
-
$logger->addInfo('Adding a new user', array('username' => 'Seldaek'));
|
133 |
-
```
|
134 |
-
|
135 |
-
Simple handlers (like the StreamHandler for instance) will simply format
|
136 |
-
the array to a string but richer handlers can take advantage of the context
|
137 |
-
(FirePHP is able to display arrays in pretty way for instance).
|
138 |
-
|
139 |
-
### Using processors
|
140 |
-
|
141 |
-
The second way is to add extra data for all records by using a processor.
|
142 |
-
Processors can be any callable. They will get the record as parameter and
|
143 |
-
must return it after having eventually changed the `extra` part of it. Let's
|
144 |
-
write a processor adding some dummy data in the record:
|
145 |
-
|
146 |
-
```php
|
147 |
-
<?php
|
148 |
-
|
149 |
-
$logger->pushProcessor(function ($record) {
|
150 |
-
$record['extra']['dummy'] = 'Hello world!';
|
151 |
-
|
152 |
-
return $record;
|
153 |
-
});
|
154 |
-
```
|
155 |
-
|
156 |
-
Monolog provides some built-in processors that can be used in your project.
|
157 |
-
Look at the [dedicated chapter](https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md#processors) for the list.
|
158 |
-
|
159 |
-
> Tip: processors can also be registered on a specific handler instead of
|
160 |
-
the logger to apply only for this handler.
|
161 |
-
|
162 |
-
## Leveraging channels
|
163 |
-
|
164 |
-
Channels are a great way to identify to which part of the application a record
|
165 |
-
is related. This is useful in big applications (and is leveraged by
|
166 |
-
MonologBundle in Symfony2).
|
167 |
-
|
168 |
-
Picture two loggers sharing a handler that writes to a single log file.
|
169 |
-
Channels would allow you to identify the logger that issued every record.
|
170 |
-
You can easily grep through the log files filtering this or that channel.
|
171 |
-
|
172 |
-
```php
|
173 |
-
<?php
|
174 |
-
|
175 |
-
use Monolog\Logger;
|
176 |
-
use Monolog\Handler\StreamHandler;
|
177 |
-
use Monolog\Handler\FirePHPHandler;
|
178 |
-
|
179 |
-
// Create some handlers
|
180 |
-
$stream = new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG);
|
181 |
-
$firephp = new FirePHPHandler();
|
182 |
-
|
183 |
-
// Create the main logger of the app
|
184 |
-
$logger = new Logger('my_logger');
|
185 |
-
$logger->pushHandler($stream);
|
186 |
-
$logger->pushHandler($firephp);
|
187 |
-
|
188 |
-
// Create a logger for the security-related stuff with a different channel
|
189 |
-
$securityLogger = new Logger('security');
|
190 |
-
$securityLogger->pushHandler($stream);
|
191 |
-
$securityLogger->pushHandler($firephp);
|
192 |
-
|
193 |
-
// Or clone the first one to only change the channel
|
194 |
-
$securityLogger = $logger->withName('security');
|
195 |
-
```
|
196 |
-
|
197 |
-
## Customizing the log format
|
198 |
-
|
199 |
-
In Monolog it's easy to customize the format of the logs written into files,
|
200 |
-
sockets, mails, databases and other handlers. Most of the handlers use the
|
201 |
-
|
202 |
-
```php
|
203 |
-
$record['formatted']
|
204 |
-
```
|
205 |
-
|
206 |
-
value to be automatically put into the log device. This value depends on the
|
207 |
-
formatter settings. You can choose between predefined formatter classes or
|
208 |
-
write your own (e.g. a multiline text file for human-readable output).
|
209 |
-
|
210 |
-
To configure a predefined formatter class, just set it as the handler's field:
|
211 |
-
|
212 |
-
```php
|
213 |
-
// the default date format is "Y-m-d H:i:s"
|
214 |
-
$dateFormat = "Y n j, g:i a";
|
215 |
-
// the default output format is "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"
|
216 |
-
$output = "%datetime% > %level_name% > %message% %context% %extra%\n";
|
217 |
-
// finally, create a formatter
|
218 |
-
$formatter = new LineFormatter($output, $dateFormat);
|
219 |
-
|
220 |
-
// Create a handler
|
221 |
-
$stream = new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG);
|
222 |
-
$stream->setFormatter($formatter);
|
223 |
-
// bind it to a logger object
|
224 |
-
$securityLogger = new Logger('security');
|
225 |
-
$securityLogger->pushHandler($stream);
|
226 |
-
```
|
227 |
-
|
228 |
-
You may also reuse the same formatter between multiple handlers and share those
|
229 |
-
handlers between multiple loggers.
|
230 |
-
|
231 |
-
[Handlers, Formatters and Processors](02-handlers-formatters-processors.md) →
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/doc/02-handlers-formatters-processors.md
DELETED
@@ -1,158 +0,0 @@
|
|
1 |
-
# Handlers, Formatters and Processors
|
2 |
-
|
3 |
-
- [Handlers](#handlers)
|
4 |
-
- [Log to files and syslog](#log-to-files-and-syslog)
|
5 |
-
- [Send alerts and emails](#send-alerts-and-emails)
|
6 |
-
- [Log specific servers and networked logging](#log-specific-servers-and-networked-logging)
|
7 |
-
- [Logging in development](#logging-in-development)
|
8 |
-
- [Log to databases](#log-to-databases)
|
9 |
-
- [Wrappers / Special Handlers](#wrappers--special-handlers)
|
10 |
-
- [Formatters](#formatters)
|
11 |
-
- [Processors](#processors)
|
12 |
-
- [Third Party Packages](#third-party-packages)
|
13 |
-
|
14 |
-
## Handlers
|
15 |
-
|
16 |
-
### Log to files and syslog
|
17 |
-
|
18 |
-
- _StreamHandler_: Logs records into any PHP stream, use this for log files.
|
19 |
-
- _RotatingFileHandler_: Logs records to a file and creates one logfile per day.
|
20 |
-
It will also delete files older than `$maxFiles`. You should use
|
21 |
-
[logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile
|
22 |
-
setups though, this is just meant as a quick and dirty solution.
|
23 |
-
- _SyslogHandler_: Logs records to the syslog.
|
24 |
-
- _ErrorLogHandler_: Logs records to PHP's
|
25 |
-
[`error_log()`](http://docs.php.net/manual/en/function.error-log.php) function.
|
26 |
-
|
27 |
-
### Send alerts and emails
|
28 |
-
|
29 |
-
- _NativeMailerHandler_: Sends emails using PHP's
|
30 |
-
[`mail()`](http://php.net/manual/en/function.mail.php) function.
|
31 |
-
- _SwiftMailerHandler_: Sends emails using a [`Swift_Mailer`](http://swiftmailer.org/) instance.
|
32 |
-
- _PushoverHandler_: Sends mobile notifications via the [Pushover](https://www.pushover.net/) API.
|
33 |
-
- _HipChatHandler_: Logs records to a [HipChat](http://hipchat.com) chat room using its API.
|
34 |
-
- _FlowdockHandler_: Logs records to a [Flowdock](https://www.flowdock.com/) account.
|
35 |
-
- _SlackHandler_: Logs records to a [Slack](https://www.slack.com/) account using the Slack API.
|
36 |
-
- _SlackbotHandler_: Logs records to a [Slack](https://www.slack.com/) account using the Slackbot incoming hook.
|
37 |
-
- _SlackWebhookHandler_: Logs records to a [Slack](https://www.slack.com/) account using Slack Webhooks.
|
38 |
-
- _MandrillHandler_: Sends emails via the Mandrill API using a [`Swift_Message`](http://swiftmailer.org/) instance.
|
39 |
-
- _FleepHookHandler_: Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks.
|
40 |
-
- _IFTTTHandler_: Notifies an [IFTTT](https://ifttt.com/maker) trigger with the log channel, level name and message.
|
41 |
-
|
42 |
-
### Log specific servers and networked logging
|
43 |
-
|
44 |
-
- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this
|
45 |
-
for UNIX and TCP sockets. See an [example](sockets.md).
|
46 |
-
- _AmqpHandler_: Logs records to an [amqp](http://www.amqp.org/) compatible
|
47 |
-
server. Requires the [php-amqp](http://pecl.php.net/package/amqp) extension (1.0+).
|
48 |
-
- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server.
|
49 |
-
- _CubeHandler_: Logs records to a [Cube](http://square.github.com/cube/) server.
|
50 |
-
- _RavenHandler_: Logs records to a [Sentry](http://getsentry.com/) server using
|
51 |
-
[raven](https://packagist.org/packages/raven/raven).
|
52 |
-
- _ZendMonitorHandler_: Logs records to the Zend Monitor present in Zend Server.
|
53 |
-
- _NewRelicHandler_: Logs records to a [NewRelic](http://newrelic.com/) application.
|
54 |
-
- _LogglyHandler_: Logs records to a [Loggly](http://www.loggly.com/) account.
|
55 |
-
- _RollbarHandler_: Logs records to a [Rollbar](https://rollbar.com/) account.
|
56 |
-
- _SyslogUdpHandler_: Logs records to a remote [Syslogd](http://www.rsyslog.com/) server.
|
57 |
-
- _LogEntriesHandler_: Logs records to a [LogEntries](http://logentries.com/) account.
|
58 |
-
- _InsightOpsHandler_: Logs records to a [InsightOps](https://www.rapid7.com/products/insightops/) account.
|
59 |
-
|
60 |
-
### Logging in development
|
61 |
-
|
62 |
-
- _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing
|
63 |
-
inline `console` messages within [FireBug](http://getfirebug.com/).
|
64 |
-
- _ChromePHPHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing
|
65 |
-
inline `console` messages within Chrome.
|
66 |
-
- _BrowserConsoleHandler_: Handler to send logs to browser's Javascript `console` with
|
67 |
-
no browser extension required. Most browsers supporting `console` API are supported.
|
68 |
-
- _PHPConsoleHandler_: Handler for [PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef), providing
|
69 |
-
inline `console` and notification popup messages within Chrome.
|
70 |
-
|
71 |
-
### Log to databases
|
72 |
-
|
73 |
-
- _RedisHandler_: Logs records to a [redis](http://redis.io) server.
|
74 |
-
- _MongoDBHandler_: Handler to write records in MongoDB via a
|
75 |
-
[Mongo](http://pecl.php.net/package/mongo) extension connection.
|
76 |
-
- _CouchDBHandler_: Logs records to a CouchDB server.
|
77 |
-
- _DoctrineCouchDBHandler_: Logs records to a CouchDB server via the Doctrine CouchDB ODM.
|
78 |
-
- _ElasticSearchHandler_: Logs records to an Elastic Search server.
|
79 |
-
- _DynamoDbHandler_: Logs records to a DynamoDB table with the [AWS SDK](https://github.com/aws/aws-sdk-php).
|
80 |
-
|
81 |
-
### Wrappers / Special Handlers
|
82 |
-
|
83 |
-
- _FingersCrossedHandler_: A very interesting wrapper. It takes a logger as
|
84 |
-
parameter and will accumulate log records of all levels until a record
|
85 |
-
exceeds the defined severity level. At which point it delivers all records,
|
86 |
-
including those of lower severity, to the handler it wraps. This means that
|
87 |
-
until an error actually happens you will not see anything in your logs, but
|
88 |
-
when it happens you will have the full information, including debug and info
|
89 |
-
records. This provides you with all the information you need, but only when
|
90 |
-
you need it.
|
91 |
-
- _DeduplicationHandler_: Useful if you are sending notifications or emails
|
92 |
-
when critical errors occur. It takes a logger as parameter and will
|
93 |
-
accumulate log records of all levels until the end of the request (or
|
94 |
-
`flush()` is called). At that point it delivers all records to the handler
|
95 |
-
it wraps, but only if the records are unique over a given time period
|
96 |
-
(60seconds by default). If the records are duplicates they are simply
|
97 |
-
discarded. The main use of this is in case of critical failure like if your
|
98 |
-
database is unreachable for example all your requests will fail and that
|
99 |
-
can result in a lot of notifications being sent. Adding this handler reduces
|
100 |
-
the amount of notifications to a manageable level.
|
101 |
-
- _WhatFailureGroupHandler_: This handler extends the _GroupHandler_ ignoring
|
102 |
-
exceptions raised by each child handler. This allows you to ignore issues
|
103 |
-
where a remote tcp connection may have died but you do not want your entire
|
104 |
-
application to crash and may wish to continue to log to other handlers.
|
105 |
-
- _BufferHandler_: This handler will buffer all the log records it receives
|
106 |
-
until `close()` is called at which point it will call `handleBatch()` on the
|
107 |
-
handler it wraps with all the log messages at once. This is very useful to
|
108 |
-
send an email with all records at once for example instead of having one mail
|
109 |
-
for every log record.
|
110 |
-
- _GroupHandler_: This handler groups other handlers. Every record received is
|
111 |
-
sent to all the handlers it is configured with.
|
112 |
-
- _FilterHandler_: This handler only lets records of the given levels through
|
113 |
-
to the wrapped handler.
|
114 |
-
- _SamplingHandler_: Wraps around another handler and lets you sample records
|
115 |
-
if you only want to store some of them.
|
116 |
-
- _NullHandler_: Any record it can handle will be thrown away. This can be used
|
117 |
-
to put on top of an existing handler stack to disable it temporarily.
|
118 |
-
- _PsrHandler_: Can be used to forward log records to an existing PSR-3 logger
|
119 |
-
- _TestHandler_: Used for testing, it records everything that is sent to it and
|
120 |
-
has accessors to read out the information.
|
121 |
-
- _HandlerWrapper_: A simple handler wrapper you can inherit from to create
|
122 |
-
your own wrappers easily.
|
123 |
-
|
124 |
-
## Formatters
|
125 |
-
|
126 |
-
- _LineFormatter_: Formats a log record into a one-line string.
|
127 |
-
- _HtmlFormatter_: Used to format log records into a human readable html table, mainly suitable for emails.
|
128 |
-
- _NormalizerFormatter_: Normalizes objects/resources down to strings so a record can easily be serialized/encoded.
|
129 |
-
- _ScalarFormatter_: Used to format log records into an associative array of scalar values.
|
130 |
-
- _JsonFormatter_: Encodes a log record into json.
|
131 |
-
- _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler.
|
132 |
-
- _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler.
|
133 |
-
- _GelfMessageFormatter_: Used to format log records into Gelf message instances, only useful for the GelfHandler.
|
134 |
-
- _LogstashFormatter_: Used to format log records into [logstash](http://logstash.net/) event json, useful for any handler listed under inputs [here](http://logstash.net/docs/latest).
|
135 |
-
- _ElasticaFormatter_: Used to format log records into an Elastica\Document object, only useful for the ElasticSearchHandler.
|
136 |
-
- _LogglyFormatter_: Used to format log records into Loggly messages, only useful for the LogglyHandler.
|
137 |
-
- _FlowdockFormatter_: Used to format log records into Flowdock messages, only useful for the FlowdockHandler.
|
138 |
-
- _MongoDBFormatter_: Converts \DateTime instances to \MongoDate and objects recursively to arrays, only useful with the MongoDBHandler.
|
139 |
-
|
140 |
-
## Processors
|
141 |
-
|
142 |
-
- _PsrLogMessageProcessor_: Processes a log record's message according to PSR-3 rules, replacing `{foo}` with the value from `$context['foo']`.
|
143 |
-
- _IntrospectionProcessor_: Adds the line/file/class/method from which the log call originated.
|
144 |
-
- _WebProcessor_: Adds the current request URI, request method and client IP to a log record.
|
145 |
-
- _MemoryUsageProcessor_: Adds the current memory usage to a log record.
|
146 |
-
- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record.
|
147 |
-
- _ProcessIdProcessor_: Adds the process id to a log record.
|
148 |
-
- _UidProcessor_: Adds a unique identifier to a log record.
|
149 |
-
- _GitProcessor_: Adds the current git branch and commit to a log record.
|
150 |
-
- _TagProcessor_: Adds an array of predefined tags to a log record.
|
151 |
-
|
152 |
-
## Third Party Packages
|
153 |
-
|
154 |
-
Third party handlers, formatters and processors are
|
155 |
-
[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
|
156 |
-
can also add your own there if you publish one.
|
157 |
-
|
158 |
-
← [Usage](01-usage.md) | [Utility classes](03-utilities.md) →
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/doc/03-utilities.md
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
# Utilities
|
2 |
-
|
3 |
-
- _Registry_: The `Monolog\Registry` class lets you configure global loggers that you
|
4 |
-
can then statically access from anywhere. It is not really a best practice but can
|
5 |
-
help in some older codebases or for ease of use.
|
6 |
-
- _ErrorHandler_: The `Monolog\ErrorHandler` class allows you to easily register
|
7 |
-
a Logger instance as an exception handler, error handler or fatal error handler.
|
8 |
-
- _SignalHandler_: The `Monolog\SignalHandler` class allows you to easily register
|
9 |
-
a Logger instance as a POSIX signal handler.
|
10 |
-
- _ErrorLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log
|
11 |
-
level is reached.
|
12 |
-
- _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain
|
13 |
-
log level is reached, depending on which channel received the log record.
|
14 |
-
|
15 |
-
← [Handlers, Formatters and Processors](02-handlers-formatters-processors.md) | [Extending Monolog](04-extending.md) →
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/doc/04-extending.md
DELETED
@@ -1,76 +0,0 @@
|
|
1 |
-
# Extending Monolog
|
2 |
-
|
3 |
-
Monolog is fully extensible, allowing you to adapt your logger to your needs.
|
4 |
-
|
5 |
-
## Writing your own handler
|
6 |
-
|
7 |
-
Monolog provides many built-in handlers. But if the one you need does not
|
8 |
-
exist, you can write it and use it in your logger. The only requirement is
|
9 |
-
to implement `Monolog\Handler\HandlerInterface`.
|
10 |
-
|
11 |
-
Let's write a PDOHandler to log records to a database. We will extend the
|
12 |
-
abstract class provided by Monolog to keep things DRY.
|
13 |
-
|
14 |
-
```php
|
15 |
-
<?php
|
16 |
-
|
17 |
-
use Monolog\Logger;
|
18 |
-
use Monolog\Handler\AbstractProcessingHandler;
|
19 |
-
|
20 |
-
class PDOHandler extends AbstractProcessingHandler
|
21 |
-
{
|
22 |
-
private $initialized = false;
|
23 |
-
private $pdo;
|
24 |
-
private $statement;
|
25 |
-
|
26 |
-
public function __construct(PDO $pdo, $level = Logger::DEBUG, $bubble = true)
|
27 |
-
{
|
28 |
-
$this->pdo = $pdo;
|
29 |
-
parent::__construct($level, $bubble);
|
30 |
-
}
|
31 |
-
|
32 |
-
protected function write(array $record)
|
33 |
-
{
|
34 |
-
if (!$this->initialized) {
|
35 |
-
$this->initialize();
|
36 |
-
}
|
37 |
-
|
38 |
-
$this->statement->execute(array(
|
39 |
-
'channel' => $record['channel'],
|
40 |
-
'level' => $record['level'],
|
41 |
-
'message' => $record['formatted'],
|
42 |
-
'time' => $record['datetime']->format('U'),
|
43 |
-
));
|
44 |
-
}
|
45 |
-
|
46 |
-
private function initialize()
|
47 |
-
{
|
48 |
-
$this->pdo->exec(
|
49 |
-
'CREATE TABLE IF NOT EXISTS monolog '
|
50 |
-
.'(channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED)'
|
51 |
-
);
|
52 |
-
$this->statement = $this->pdo->prepare(
|
53 |
-
'INSERT INTO monolog (channel, level, message, time) VALUES (:channel, :level, :message, :time)'
|
54 |
-
);
|
55 |
-
|
56 |
-
$this->initialized = true;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
```
|
60 |
-
|
61 |
-
You can now use this handler in your logger:
|
62 |
-
|
63 |
-
```php
|
64 |
-
<?php
|
65 |
-
|
66 |
-
$logger->pushHandler(new PDOHandler(new PDO('sqlite:logs.sqlite')));
|
67 |
-
|
68 |
-
// You can now use your logger
|
69 |
-
$logger->addInfo('My logger is now ready');
|
70 |
-
```
|
71 |
-
|
72 |
-
The `Monolog\Handler\AbstractProcessingHandler` class provides most of the
|
73 |
-
logic needed for the handler, including the use of processors and the formatting
|
74 |
-
of the record (which is why we use ``$record['formatted']`` instead of ``$record['message']``).
|
75 |
-
|
76 |
-
← [Utility classes](03-utilities.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/doc/sockets.md
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
Sockets Handler
|
2 |
-
===============
|
3 |
-
|
4 |
-
This handler allows you to write your logs to sockets using [fsockopen](http://php.net/fsockopen)
|
5 |
-
or [pfsockopen](http://php.net/pfsockopen).
|
6 |
-
|
7 |
-
Persistent sockets are mainly useful in web environments where you gain some performance not closing/opening
|
8 |
-
the connections between requests.
|
9 |
-
|
10 |
-
You can use a `unix://` prefix to access unix sockets and `udp://` to open UDP sockets instead of the default TCP.
|
11 |
-
|
12 |
-
Basic Example
|
13 |
-
-------------
|
14 |
-
|
15 |
-
```php
|
16 |
-
<?php
|
17 |
-
|
18 |
-
use Monolog\Logger;
|
19 |
-
use Monolog\Handler\SocketHandler;
|
20 |
-
|
21 |
-
// Create the logger
|
22 |
-
$logger = new Logger('my_logger');
|
23 |
-
|
24 |
-
// Create the handler
|
25 |
-
$handler = new SocketHandler('unix:///var/log/httpd_app_log.socket');
|
26 |
-
$handler->setPersistent(true);
|
27 |
-
|
28 |
-
// Now add the handler
|
29 |
-
$logger->pushHandler($handler, Logger::DEBUG);
|
30 |
-
|
31 |
-
// You can now use your logger
|
32 |
-
$logger->addInfo('My logger is now ready');
|
33 |
-
|
34 |
-
```
|
35 |
-
|
36 |
-
In this example, using syslog-ng, you should see the log on the log server:
|
37 |
-
|
38 |
-
cweb1 [2012-02-26 00:12:03] my_logger.INFO: My logger is now ready [] []
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/ErrorHandler.php
DELETED
@@ -1,239 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog;
|
13 |
-
|
14 |
-
use Psr\Log\LoggerInterface;
|
15 |
-
use Psr\Log\LogLevel;
|
16 |
-
use Monolog\Handler\AbstractHandler;
|
17 |
-
use Monolog\Registry;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Monolog error handler
|
21 |
-
*
|
22 |
-
* A facility to enable logging of runtime errors, exceptions and fatal errors.
|
23 |
-
*
|
24 |
-
* Quick setup: <code>ErrorHandler::register($logger);</code>
|
25 |
-
*
|
26 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
27 |
-
*/
|
28 |
-
class ErrorHandler
|
29 |
-
{
|
30 |
-
private $logger;
|
31 |
-
|
32 |
-
private $previousExceptionHandler;
|
33 |
-
private $uncaughtExceptionLevel;
|
34 |
-
|
35 |
-
private $previousErrorHandler;
|
36 |
-
private $errorLevelMap;
|
37 |
-
private $handleOnlyReportedErrors;
|
38 |
-
|
39 |
-
private $hasFatalErrorHandler;
|
40 |
-
private $fatalLevel;
|
41 |
-
private $reservedMemory;
|
42 |
-
private $lastFatalTrace;
|
43 |
-
private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR);
|
44 |
-
|
45 |
-
public function __construct(LoggerInterface $logger)
|
46 |
-
{
|
47 |
-
$this->logger = $logger;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Registers a new ErrorHandler for a given Logger
|
52 |
-
*
|
53 |
-
* By default it will handle errors, exceptions and fatal errors
|
54 |
-
*
|
55 |
-
* @param LoggerInterface $logger
|
56 |
-
* @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling
|
57 |
-
* @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling
|
58 |
-
* @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling
|
59 |
-
* @return ErrorHandler
|
60 |
-
*/
|
61 |
-
public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null)
|
62 |
-
{
|
63 |
-
//Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929
|
64 |
-
class_exists('\\Psr\\Log\\LogLevel', true);
|
65 |
-
|
66 |
-
$handler = new static($logger);
|
67 |
-
if ($errorLevelMap !== false) {
|
68 |
-
$handler->registerErrorHandler($errorLevelMap);
|
69 |
-
}
|
70 |
-
if ($exceptionLevel !== false) {
|
71 |
-
$handler->registerExceptionHandler($exceptionLevel);
|
72 |
-
}
|
73 |
-
if ($fatalLevel !== false) {
|
74 |
-
$handler->registerFatalHandler($fatalLevel);
|
75 |
-
}
|
76 |
-
|
77 |
-
return $handler;
|
78 |
-
}
|
79 |
-
|
80 |
-
public function registerExceptionHandler($level = null, $callPrevious = true)
|
81 |
-
{
|
82 |
-
$prev = set_exception_handler(array($this, 'handleException'));
|
83 |
-
$this->uncaughtExceptionLevel = $level;
|
84 |
-
if ($callPrevious && $prev) {
|
85 |
-
$this->previousExceptionHandler = $prev;
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1, $handleOnlyReportedErrors = true)
|
90 |
-
{
|
91 |
-
$prev = set_error_handler(array($this, 'handleError'), $errorTypes);
|
92 |
-
$this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
|
93 |
-
if ($callPrevious) {
|
94 |
-
$this->previousErrorHandler = $prev ?: true;
|
95 |
-
}
|
96 |
-
|
97 |
-
$this->handleOnlyReportedErrors = $handleOnlyReportedErrors;
|
98 |
-
}
|
99 |
-
|
100 |
-
public function registerFatalHandler($level = null, $reservedMemorySize = 20)
|
101 |
-
{
|
102 |
-
register_shutdown_function(array($this, 'handleFatalError'));
|
103 |
-
|
104 |
-
$this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
|
105 |
-
$this->fatalLevel = $level;
|
106 |
-
$this->hasFatalErrorHandler = true;
|
107 |
-
}
|
108 |
-
|
109 |
-
protected function defaultErrorLevelMap()
|
110 |
-
{
|
111 |
-
return array(
|
112 |
-
E_ERROR => LogLevel::CRITICAL,
|
113 |
-
E_WARNING => LogLevel::WARNING,
|
114 |
-
E_PARSE => LogLevel::ALERT,
|
115 |
-
E_NOTICE => LogLevel::NOTICE,
|
116 |
-
E_CORE_ERROR => LogLevel::CRITICAL,
|
117 |
-
E_CORE_WARNING => LogLevel::WARNING,
|
118 |
-
E_COMPILE_ERROR => LogLevel::ALERT,
|
119 |
-
E_COMPILE_WARNING => LogLevel::WARNING,
|
120 |
-
E_USER_ERROR => LogLevel::ERROR,
|
121 |
-
E_USER_WARNING => LogLevel::WARNING,
|
122 |
-
E_USER_NOTICE => LogLevel::NOTICE,
|
123 |
-
E_STRICT => LogLevel::NOTICE,
|
124 |
-
E_RECOVERABLE_ERROR => LogLevel::ERROR,
|
125 |
-
E_DEPRECATED => LogLevel::NOTICE,
|
126 |
-
E_USER_DEPRECATED => LogLevel::NOTICE,
|
127 |
-
);
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* @private
|
132 |
-
*/
|
133 |
-
public function handleException($e)
|
134 |
-
{
|
135 |
-
$this->logger->log(
|
136 |
-
$this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel,
|
137 |
-
sprintf('Uncaught Exception %s: "%s" at %s line %s', Utils::getClass($e), $e->getMessage(), $e->getFile(), $e->getLine()),
|
138 |
-
array('exception' => $e)
|
139 |
-
);
|
140 |
-
|
141 |
-
if ($this->previousExceptionHandler) {
|
142 |
-
call_user_func($this->previousExceptionHandler, $e);
|
143 |
-
}
|
144 |
-
|
145 |
-
exit(255);
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* @private
|
150 |
-
*/
|
151 |
-
public function handleError($code, $message, $file = '', $line = 0, $context = array())
|
152 |
-
{
|
153 |
-
if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) {
|
154 |
-
return;
|
155 |
-
}
|
156 |
-
|
157 |
-
// fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries
|
158 |
-
if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) {
|
159 |
-
$level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
|
160 |
-
$this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line));
|
161 |
-
} else {
|
162 |
-
// http://php.net/manual/en/function.debug-backtrace.php
|
163 |
-
// As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added.
|
164 |
-
// Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'.
|
165 |
-
$trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS);
|
166 |
-
array_shift($trace); // Exclude handleError from trace
|
167 |
-
$this->lastFatalTrace = $trace;
|
168 |
-
}
|
169 |
-
|
170 |
-
if ($this->previousErrorHandler === true) {
|
171 |
-
return false;
|
172 |
-
} elseif ($this->previousErrorHandler) {
|
173 |
-
return call_user_func($this->previousErrorHandler, $code, $message, $file, $line, $context);
|
174 |
-
}
|
175 |
-
}
|
176 |
-
|
177 |
-
/**
|
178 |
-
* @private
|
179 |
-
*/
|
180 |
-
public function handleFatalError()
|
181 |
-
{
|
182 |
-
$this->reservedMemory = null;
|
183 |
-
|
184 |
-
$lastError = error_get_last();
|
185 |
-
if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) {
|
186 |
-
$this->logger->log(
|
187 |
-
$this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel,
|
188 |
-
'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
|
189 |
-
array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $this->lastFatalTrace)
|
190 |
-
);
|
191 |
-
|
192 |
-
if ($this->logger instanceof Logger) {
|
193 |
-
foreach ($this->logger->getHandlers() as $handler) {
|
194 |
-
if ($handler instanceof AbstractHandler) {
|
195 |
-
$handler->close();
|
196 |
-
}
|
197 |
-
}
|
198 |
-
}
|
199 |
-
}
|
200 |
-
}
|
201 |
-
|
202 |
-
private static function codeToString($code)
|
203 |
-
{
|
204 |
-
switch ($code) {
|
205 |
-
case E_ERROR:
|
206 |
-
return 'E_ERROR';
|
207 |
-
case E_WARNING:
|
208 |
-
return 'E_WARNING';
|
209 |
-
case E_PARSE:
|
210 |
-
return 'E_PARSE';
|
211 |
-
case E_NOTICE:
|
212 |
-
return 'E_NOTICE';
|
213 |
-
case E_CORE_ERROR:
|
214 |
-
return 'E_CORE_ERROR';
|
215 |
-
case E_CORE_WARNING:
|
216 |
-
return 'E_CORE_WARNING';
|
217 |
-
case E_COMPILE_ERROR:
|
218 |
-
return 'E_COMPILE_ERROR';
|
219 |
-
case E_COMPILE_WARNING:
|
220 |
-
return 'E_COMPILE_WARNING';
|
221 |
-
case E_USER_ERROR:
|
222 |
-
return 'E_USER_ERROR';
|
223 |
-
case E_USER_WARNING:
|
224 |
-
return 'E_USER_WARNING';
|
225 |
-
case E_USER_NOTICE:
|
226 |
-
return 'E_USER_NOTICE';
|
227 |
-
case E_STRICT:
|
228 |
-
return 'E_STRICT';
|
229 |
-
case E_RECOVERABLE_ERROR:
|
230 |
-
return 'E_RECOVERABLE_ERROR';
|
231 |
-
case E_DEPRECATED:
|
232 |
-
return 'E_DEPRECATED';
|
233 |
-
case E_USER_DEPRECATED:
|
234 |
-
return 'E_USER_DEPRECATED';
|
235 |
-
}
|
236 |
-
|
237 |
-
return 'Unknown PHP error';
|
238 |
-
}
|
239 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Formats a log message according to the ChromePHP array format
|
18 |
-
*
|
19 |
-
* @author Christophe Coevoet <stof@notk.org>
|
20 |
-
*/
|
21 |
-
class ChromePHPFormatter implements FormatterInterface
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* Translates Monolog log levels to Wildfire levels.
|
25 |
-
*/
|
26 |
-
private $logLevels = array(
|
27 |
-
Logger::DEBUG => 'log',
|
28 |
-
Logger::INFO => 'info',
|
29 |
-
Logger::NOTICE => 'info',
|
30 |
-
Logger::WARNING => 'warn',
|
31 |
-
Logger::ERROR => 'error',
|
32 |
-
Logger::CRITICAL => 'error',
|
33 |
-
Logger::ALERT => 'error',
|
34 |
-
Logger::EMERGENCY => 'error',
|
35 |
-
);
|
36 |
-
|
37 |
-
/**
|
38 |
-
* {@inheritdoc}
|
39 |
-
*/
|
40 |
-
public function format(array $record)
|
41 |
-
{
|
42 |
-
// Retrieve the line and file if set and remove them from the formatted extra
|
43 |
-
$backtrace = 'unknown';
|
44 |
-
if (isset($record['extra']['file'], $record['extra']['line'])) {
|
45 |
-
$backtrace = $record['extra']['file'].' : '.$record['extra']['line'];
|
46 |
-
unset($record['extra']['file'], $record['extra']['line']);
|
47 |
-
}
|
48 |
-
|
49 |
-
$message = array('message' => $record['message']);
|
50 |
-
if ($record['context']) {
|
51 |
-
$message['context'] = $record['context'];
|
52 |
-
}
|
53 |
-
if ($record['extra']) {
|
54 |
-
$message['extra'] = $record['extra'];
|
55 |
-
}
|
56 |
-
if (count($message) === 1) {
|
57 |
-
$message = reset($message);
|
58 |
-
}
|
59 |
-
|
60 |
-
return array(
|
61 |
-
$record['channel'],
|
62 |
-
$message,
|
63 |
-
$backtrace,
|
64 |
-
$this->logLevels[$record['level']],
|
65 |
-
);
|
66 |
-
}
|
67 |
-
|
68 |
-
public function formatBatch(array $records)
|
69 |
-
{
|
70 |
-
$formatted = array();
|
71 |
-
|
72 |
-
foreach ($records as $record) {
|
73 |
-
$formatted[] = $this->format($record);
|
74 |
-
}
|
75 |
-
|
76 |
-
return $formatted;
|
77 |
-
}
|
78 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
use Elastica\Document;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Format a log message into an Elastica Document
|
18 |
-
*
|
19 |
-
* @author Jelle Vink <jelle.vink@gmail.com>
|
20 |
-
*/
|
21 |
-
class ElasticaFormatter extends NormalizerFormatter
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* @var string Elastic search index name
|
25 |
-
*/
|
26 |
-
protected $index;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* @var string Elastic search document type
|
30 |
-
*/
|
31 |
-
protected $type;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @param string $index Elastic Search index name
|
35 |
-
* @param string $type Elastic Search document type
|
36 |
-
*/
|
37 |
-
public function __construct($index, $type)
|
38 |
-
{
|
39 |
-
// elasticsearch requires a ISO 8601 format date with optional millisecond precision.
|
40 |
-
parent::__construct('Y-m-d\TH:i:s.uP');
|
41 |
-
|
42 |
-
$this->index = $index;
|
43 |
-
$this->type = $type;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* {@inheritdoc}
|
48 |
-
*/
|
49 |
-
public function format(array $record)
|
50 |
-
{
|
51 |
-
$record = parent::format($record);
|
52 |
-
|
53 |
-
return $this->getDocument($record);
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Getter index
|
58 |
-
* @return string
|
59 |
-
*/
|
60 |
-
public function getIndex()
|
61 |
-
{
|
62 |
-
return $this->index;
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Getter type
|
67 |
-
* @return string
|
68 |
-
*/
|
69 |
-
public function getType()
|
70 |
-
{
|
71 |
-
return $this->type;
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Convert a log message into an Elastica Document
|
76 |
-
*
|
77 |
-
* @param array $record Log message
|
78 |
-
* @return Document
|
79 |
-
*/
|
80 |
-
protected function getDocument($record)
|
81 |
-
{
|
82 |
-
$document = new Document();
|
83 |
-
$document->setData($record);
|
84 |
-
$document->setType($this->type);
|
85 |
-
$document->setIndex($this->index);
|
86 |
-
|
87 |
-
return $document;
|
88 |
-
}
|
89 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* formats the record to be used in the FlowdockHandler
|
16 |
-
*
|
17 |
-
* @author Dominik Liebler <liebler.dominik@gmail.com>
|
18 |
-
*/
|
19 |
-
class FlowdockFormatter implements FormatterInterface
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
private $source;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @var string
|
28 |
-
*/
|
29 |
-
private $sourceEmail;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @param string $source
|
33 |
-
* @param string $sourceEmail
|
34 |
-
*/
|
35 |
-
public function __construct($source, $sourceEmail)
|
36 |
-
{
|
37 |
-
$this->source = $source;
|
38 |
-
$this->sourceEmail = $sourceEmail;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* {@inheritdoc}
|
43 |
-
*/
|
44 |
-
public function format(array $record)
|
45 |
-
{
|
46 |
-
$tags = array(
|
47 |
-
'#logs',
|
48 |
-
'#' . strtolower($record['level_name']),
|
49 |
-
'#' . $record['channel'],
|
50 |
-
);
|
51 |
-
|
52 |
-
foreach ($record['extra'] as $value) {
|
53 |
-
$tags[] = '#' . $value;
|
54 |
-
}
|
55 |
-
|
56 |
-
$subject = sprintf(
|
57 |
-
'in %s: %s - %s',
|
58 |
-
$this->source,
|
59 |
-
$record['level_name'],
|
60 |
-
$this->getShortMessage($record['message'])
|
61 |
-
);
|
62 |
-
|
63 |
-
$record['flowdock'] = array(
|
64 |
-
'source' => $this->source,
|
65 |
-
'from_address' => $this->sourceEmail,
|
66 |
-
'subject' => $subject,
|
67 |
-
'content' => $record['message'],
|
68 |
-
'tags' => $tags,
|
69 |
-
'project' => $this->source,
|
70 |
-
);
|
71 |
-
|
72 |
-
return $record;
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* {@inheritdoc}
|
77 |
-
*/
|
78 |
-
public function formatBatch(array $records)
|
79 |
-
{
|
80 |
-
$formatted = array();
|
81 |
-
|
82 |
-
foreach ($records as $record) {
|
83 |
-
$formatted[] = $this->format($record);
|
84 |
-
}
|
85 |
-
|
86 |
-
return $formatted;
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* @param string $message
|
91 |
-
*
|
92 |
-
* @return string
|
93 |
-
*/
|
94 |
-
public function getShortMessage($message)
|
95 |
-
{
|
96 |
-
static $hasMbString;
|
97 |
-
|
98 |
-
if (null === $hasMbString) {
|
99 |
-
$hasMbString = function_exists('mb_strlen');
|
100 |
-
}
|
101 |
-
|
102 |
-
$maxLength = 45;
|
103 |
-
|
104 |
-
if ($hasMbString) {
|
105 |
-
if (mb_strlen($message, 'UTF-8') > $maxLength) {
|
106 |
-
$message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...';
|
107 |
-
}
|
108 |
-
} else {
|
109 |
-
if (strlen($message) > $maxLength) {
|
110 |
-
$message = substr($message, 0, $maxLength - 4) . ' ...';
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
return $message;
|
115 |
-
}
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Class FluentdFormatter
|
16 |
-
*
|
17 |
-
* Serializes a log message to Fluentd unix socket protocol
|
18 |
-
*
|
19 |
-
* Fluentd config:
|
20 |
-
*
|
21 |
-
* <source>
|
22 |
-
* type unix
|
23 |
-
* path /var/run/td-agent/td-agent.sock
|
24 |
-
* </source>
|
25 |
-
*
|
26 |
-
* Monolog setup:
|
27 |
-
*
|
28 |
-
* $logger = new Monolog\Logger('fluent.tag');
|
29 |
-
* $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock');
|
30 |
-
* $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter());
|
31 |
-
* $logger->pushHandler($fluentHandler);
|
32 |
-
*
|
33 |
-
* @author Andrius Putna <fordnox@gmail.com>
|
34 |
-
*/
|
35 |
-
class FluentdFormatter implements FormatterInterface
|
36 |
-
{
|
37 |
-
/**
|
38 |
-
* @var bool $levelTag should message level be a part of the fluentd tag
|
39 |
-
*/
|
40 |
-
protected $levelTag = false;
|
41 |
-
|
42 |
-
public function __construct($levelTag = false)
|
43 |
-
{
|
44 |
-
if (!function_exists('json_encode')) {
|
45 |
-
throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter');
|
46 |
-
}
|
47 |
-
|
48 |
-
$this->levelTag = (bool) $levelTag;
|
49 |
-
}
|
50 |
-
|
51 |
-
public function isUsingLevelsInTag()
|
52 |
-
{
|
53 |
-
return $this->levelTag;
|
54 |
-
}
|
55 |
-
|
56 |
-
public function format(array $record)
|
57 |
-
{
|
58 |
-
$tag = $record['channel'];
|
59 |
-
if ($this->levelTag) {
|
60 |
-
$tag .= '.' . strtolower($record['level_name']);
|
61 |
-
}
|
62 |
-
|
63 |
-
$message = array(
|
64 |
-
'message' => $record['message'],
|
65 |
-
'context' => $record['context'],
|
66 |
-
'extra' => $record['extra'],
|
67 |
-
);
|
68 |
-
|
69 |
-
if (!$this->levelTag) {
|
70 |
-
$message['level'] = $record['level'];
|
71 |
-
$message['level_name'] = $record['level_name'];
|
72 |
-
}
|
73 |
-
|
74 |
-
return json_encode(array($tag, $record['datetime']->getTimestamp(), $message));
|
75 |
-
}
|
76 |
-
|
77 |
-
public function formatBatch(array $records)
|
78 |
-
{
|
79 |
-
$message = '';
|
80 |
-
foreach ($records as $record) {
|
81 |
-
$message .= $this->format($record);
|
82 |
-
}
|
83 |
-
|
84 |
-
return $message;
|
85 |
-
}
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Interface for formatters
|
16 |
-
*
|
17 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
18 |
-
*/
|
19 |
-
interface FormatterInterface
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* Formats a log record.
|
23 |
-
*
|
24 |
-
* @param array $record A record to format
|
25 |
-
* @return mixed The formatted record
|
26 |
-
*/
|
27 |
-
public function format(array $record);
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Formats a set of log records.
|
31 |
-
*
|
32 |
-
* @param array $records A set of records to format
|
33 |
-
* @return mixed The formatted set of records
|
34 |
-
*/
|
35 |
-
public function formatBatch(array $records);
|
36 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Gelf\Message;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Serializes a log message to GELF
|
19 |
-
* @see http://www.graylog2.org/about/gelf
|
20 |
-
*
|
21 |
-
* @author Matt Lehner <mlehner@gmail.com>
|
22 |
-
*/
|
23 |
-
class GelfMessageFormatter extends NormalizerFormatter
|
24 |
-
{
|
25 |
-
const DEFAULT_MAX_LENGTH = 32766;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @var string the name of the system for the Gelf log message
|
29 |
-
*/
|
30 |
-
protected $systemName;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @var string a prefix for 'extra' fields from the Monolog record (optional)
|
34 |
-
*/
|
35 |
-
protected $extraPrefix;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* @var string a prefix for 'context' fields from the Monolog record (optional)
|
39 |
-
*/
|
40 |
-
protected $contextPrefix;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* @var int max length per field
|
44 |
-
*/
|
45 |
-
protected $maxLength;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Translates Monolog log levels to Graylog2 log priorities.
|
49 |
-
*/
|
50 |
-
private $logLevels = array(
|
51 |
-
Logger::DEBUG => 7,
|
52 |
-
Logger::INFO => 6,
|
53 |
-
Logger::NOTICE => 5,
|
54 |
-
Logger::WARNING => 4,
|
55 |
-
Logger::ERROR => 3,
|
56 |
-
Logger::CRITICAL => 2,
|
57 |
-
Logger::ALERT => 1,
|
58 |
-
Logger::EMERGENCY => 0,
|
59 |
-
);
|
60 |
-
|
61 |
-
public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $maxLength = null)
|
62 |
-
{
|
63 |
-
parent::__construct('U.u');
|
64 |
-
|
65 |
-
$this->systemName = $systemName ?: gethostname();
|
66 |
-
|
67 |
-
$this->extraPrefix = $extraPrefix;
|
68 |
-
$this->contextPrefix = $contextPrefix;
|
69 |
-
$this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength;
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* {@inheritdoc}
|
74 |
-
*/
|
75 |
-
public function format(array $record)
|
76 |
-
{
|
77 |
-
$record = parent::format($record);
|
78 |
-
|
79 |
-
if (!isset($record['datetime'], $record['message'], $record['level'])) {
|
80 |
-
throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given');
|
81 |
-
}
|
82 |
-
|
83 |
-
$message = new Message();
|
84 |
-
$message
|
85 |
-
->setTimestamp($record['datetime'])
|
86 |
-
->setShortMessage((string) $record['message'])
|
87 |
-
->setHost($this->systemName)
|
88 |
-
->setLevel($this->logLevels[$record['level']]);
|
89 |
-
|
90 |
-
// message length + system name length + 200 for padding / metadata
|
91 |
-
$len = 200 + strlen((string) $record['message']) + strlen($this->systemName);
|
92 |
-
|
93 |
-
if ($len > $this->maxLength) {
|
94 |
-
$message->setShortMessage(substr($record['message'], 0, $this->maxLength));
|
95 |
-
}
|
96 |
-
|
97 |
-
if (isset($record['channel'])) {
|
98 |
-
$message->setFacility($record['channel']);
|
99 |
-
}
|
100 |
-
if (isset($record['extra']['line'])) {
|
101 |
-
$message->setLine($record['extra']['line']);
|
102 |
-
unset($record['extra']['line']);
|
103 |
-
}
|
104 |
-
if (isset($record['extra']['file'])) {
|
105 |
-
$message->setFile($record['extra']['file']);
|
106 |
-
unset($record['extra']['file']);
|
107 |
-
}
|
108 |
-
|
109 |
-
foreach ($record['extra'] as $key => $val) {
|
110 |
-
$val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
|
111 |
-
$len = strlen($this->extraPrefix . $key . $val);
|
112 |
-
if ($len > $this->maxLength) {
|
113 |
-
$message->setAdditional($this->extraPrefix . $key, substr($val, 0, $this->maxLength));
|
114 |
-
break;
|
115 |
-
}
|
116 |
-
$message->setAdditional($this->extraPrefix . $key, $val);
|
117 |
-
}
|
118 |
-
|
119 |
-
foreach ($record['context'] as $key => $val) {
|
120 |
-
$val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
|
121 |
-
$len = strlen($this->contextPrefix . $key . $val);
|
122 |
-
if ($len > $this->maxLength) {
|
123 |
-
$message->setAdditional($this->contextPrefix . $key, substr($val, 0, $this->maxLength));
|
124 |
-
break;
|
125 |
-
}
|
126 |
-
$message->setAdditional($this->contextPrefix . $key, $val);
|
127 |
-
}
|
128 |
-
|
129 |
-
if (null === $message->getFile() && isset($record['context']['exception']['file'])) {
|
130 |
-
if (preg_match("/^(.+):([0-9]+)$/", $record['context']['exception']['file'], $matches)) {
|
131 |
-
$message->setFile($matches[1]);
|
132 |
-
$message->setLine($matches[2]);
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
return $message;
|
137 |
-
}
|
138 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php
DELETED
@@ -1,141 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* This file is part of the Monolog package.
|
4 |
-
*
|
5 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
6 |
-
*
|
7 |
-
* For the full copyright and license information, please view the LICENSE
|
8 |
-
* file that was distributed with this source code.
|
9 |
-
*/
|
10 |
-
|
11 |
-
namespace Monolog\Formatter;
|
12 |
-
|
13 |
-
use Monolog\Logger;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Formats incoming records into an HTML table
|
17 |
-
*
|
18 |
-
* This is especially useful for html email logging
|
19 |
-
*
|
20 |
-
* @author Tiago Brito <tlfbrito@gmail.com>
|
21 |
-
*/
|
22 |
-
class HtmlFormatter extends NormalizerFormatter
|
23 |
-
{
|
24 |
-
/**
|
25 |
-
* Translates Monolog log levels to html color priorities.
|
26 |
-
*/
|
27 |
-
protected $logLevels = array(
|
28 |
-
Logger::DEBUG => '#cccccc',
|
29 |
-
Logger::INFO => '#468847',
|
30 |
-
Logger::NOTICE => '#3a87ad',
|
31 |
-
Logger::WARNING => '#c09853',
|
32 |
-
Logger::ERROR => '#f0ad4e',
|
33 |
-
Logger::CRITICAL => '#FF7708',
|
34 |
-
Logger::ALERT => '#C12A19',
|
35 |
-
Logger::EMERGENCY => '#000000',
|
36 |
-
);
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @param string $dateFormat The format of the timestamp: one supported by DateTime::format
|
40 |
-
*/
|
41 |
-
public function __construct($dateFormat = null)
|
42 |
-
{
|
43 |
-
parent::__construct($dateFormat);
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Creates an HTML table row
|
48 |
-
*
|
49 |
-
* @param string $th Row header content
|
50 |
-
* @param string $td Row standard cell content
|
51 |
-
* @param bool $escapeTd false if td content must not be html escaped
|
52 |
-
* @return string
|
53 |
-
*/
|
54 |
-
protected function addRow($th, $td = ' ', $escapeTd = true)
|
55 |
-
{
|
56 |
-
$th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8');
|
57 |
-
if ($escapeTd) {
|
58 |
-
$td = '<pre>'.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'</pre>';
|
59 |
-
}
|
60 |
-
|
61 |
-
return "<tr style=\"padding: 4px;text-align: left;\">\n<th style=\"vertical-align: top;background: #ccc;color: #000\" width=\"100\">$th:</th>\n<td style=\"padding: 4px;text-align: left;vertical-align: top;background: #eee;color: #000\">".$td."</td>\n</tr>";
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Create a HTML h1 tag
|
66 |
-
*
|
67 |
-
* @param string $title Text to be in the h1
|
68 |
-
* @param int $level Error level
|
69 |
-
* @return string
|
70 |
-
*/
|
71 |
-
protected function addTitle($title, $level)
|
72 |
-
{
|
73 |
-
$title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8');
|
74 |
-
|
75 |
-
return '<h1 style="background: '.$this->logLevels[$level].';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>';
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Formats a log record.
|
80 |
-
*
|
81 |
-
* @param array $record A record to format
|
82 |
-
* @return mixed The formatted record
|
83 |
-
*/
|
84 |
-
public function format(array $record)
|
85 |
-
{
|
86 |
-
$output = $this->addTitle($record['level_name'], $record['level']);
|
87 |
-
$output .= '<table cellspacing="1" width="100%" class="monolog-output">';
|
88 |
-
|
89 |
-
$output .= $this->addRow('Message', (string) $record['message']);
|
90 |
-
$output .= $this->addRow('Time', $record['datetime']->format($this->dateFormat));
|
91 |
-
$output .= $this->addRow('Channel', $record['channel']);
|
92 |
-
if ($record['context']) {
|
93 |
-
$embeddedTable = '<table cellspacing="1" width="100%">';
|
94 |
-
foreach ($record['context'] as $key => $value) {
|
95 |
-
$embeddedTable .= $this->addRow($key, $this->convertToString($value));
|
96 |
-
}
|
97 |
-
$embeddedTable .= '</table>';
|
98 |
-
$output .= $this->addRow('Context', $embeddedTable, false);
|
99 |
-
}
|
100 |
-
if ($record['extra']) {
|
101 |
-
$embeddedTable = '<table cellspacing="1" width="100%">';
|
102 |
-
foreach ($record['extra'] as $key => $value) {
|
103 |
-
$embeddedTable .= $this->addRow($key, $this->convertToString($value));
|
104 |
-
}
|
105 |
-
$embeddedTable .= '</table>';
|
106 |
-
$output .= $this->addRow('Extra', $embeddedTable, false);
|
107 |
-
}
|
108 |
-
|
109 |
-
return $output.'</table>';
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Formats a set of log records.
|
114 |
-
*
|
115 |
-
* @param array $records A set of records to format
|
116 |
-
* @return mixed The formatted set of records
|
117 |
-
*/
|
118 |
-
public function formatBatch(array $records)
|
119 |
-
{
|
120 |
-
$message = '';
|
121 |
-
foreach ($records as $record) {
|
122 |
-
$message .= $this->format($record);
|
123 |
-
}
|
124 |
-
|
125 |
-
return $message;
|
126 |
-
}
|
127 |
-
|
128 |
-
protected function convertToString($data)
|
129 |
-
{
|
130 |
-
if (null === $data || is_scalar($data)) {
|
131 |
-
return (string) $data;
|
132 |
-
}
|
133 |
-
|
134 |
-
$data = $this->normalize($data);
|
135 |
-
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
136 |
-
return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
137 |
-
}
|
138 |
-
|
139 |
-
return str_replace('\\/', '/', json_encode($data));
|
140 |
-
}
|
141 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
DELETED
@@ -1,214 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
use Exception;
|
15 |
-
use Monolog\Utils;
|
16 |
-
use Throwable;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Encodes whatever record data is passed to it as json
|
20 |
-
*
|
21 |
-
* This can be useful to log to databases or remote APIs
|
22 |
-
*
|
23 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
24 |
-
*/
|
25 |
-
class JsonFormatter extends NormalizerFormatter
|
26 |
-
{
|
27 |
-
const BATCH_MODE_JSON = 1;
|
28 |
-
const BATCH_MODE_NEWLINES = 2;
|
29 |
-
|
30 |
-
protected $batchMode;
|
31 |
-
protected $appendNewline;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @var bool
|
35 |
-
*/
|
36 |
-
protected $includeStacktraces = false;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @param int $batchMode
|
40 |
-
* @param bool $appendNewline
|
41 |
-
*/
|
42 |
-
public function __construct($batchMode = self::BATCH_MODE_JSON, $appendNewline = true)
|
43 |
-
{
|
44 |
-
$this->batchMode = $batchMode;
|
45 |
-
$this->appendNewline = $appendNewline;
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* The batch mode option configures the formatting style for
|
50 |
-
* multiple records. By default, multiple records will be
|
51 |
-
* formatted as a JSON-encoded array. However, for
|
52 |
-
* compatibility with some API endpoints, alternative styles
|
53 |
-
* are available.
|
54 |
-
*
|
55 |
-
* @return int
|
56 |
-
*/
|
57 |
-
public function getBatchMode()
|
58 |
-
{
|
59 |
-
return $this->batchMode;
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* True if newlines are appended to every formatted record
|
64 |
-
*
|
65 |
-
* @return bool
|
66 |
-
*/
|
67 |
-
public function isAppendingNewlines()
|
68 |
-
{
|
69 |
-
return $this->appendNewline;
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* {@inheritdoc}
|
74 |
-
*/
|
75 |
-
public function format(array $record)
|
76 |
-
{
|
77 |
-
return $this->toJson($this->normalize($record), true) . ($this->appendNewline ? "\n" : '');
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* {@inheritdoc}
|
82 |
-
*/
|
83 |
-
public function formatBatch(array $records)
|
84 |
-
{
|
85 |
-
switch ($this->batchMode) {
|
86 |
-
case static::BATCH_MODE_NEWLINES:
|
87 |
-
return $this->formatBatchNewlines($records);
|
88 |
-
|
89 |
-
case static::BATCH_MODE_JSON:
|
90 |
-
default:
|
91 |
-
return $this->formatBatchJson($records);
|
92 |
-
}
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* @param bool $include
|
97 |
-
*/
|
98 |
-
public function includeStacktraces($include = true)
|
99 |
-
{
|
100 |
-
$this->includeStacktraces = $include;
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Return a JSON-encoded array of records.
|
105 |
-
*
|
106 |
-
* @param array $records
|
107 |
-
* @return string
|
108 |
-
*/
|
109 |
-
protected function formatBatchJson(array $records)
|
110 |
-
{
|
111 |
-
return $this->toJson($this->normalize($records), true);
|
112 |
-
}
|
113 |
-
|
114 |
-
/**
|
115 |
-
* Use new lines to separate records instead of a
|
116 |
-
* JSON-encoded array.
|
117 |
-
*
|
118 |
-
* @param array $records
|
119 |
-
* @return string
|
120 |
-
*/
|
121 |
-
protected function formatBatchNewlines(array $records)
|
122 |
-
{
|
123 |
-
$instance = $this;
|
124 |
-
|
125 |
-
$oldNewline = $this->appendNewline;
|
126 |
-
$this->appendNewline = false;
|
127 |
-
array_walk($records, function (&$value, $key) use ($instance) {
|
128 |
-
$value = $instance->format($value);
|
129 |
-
});
|
130 |
-
$this->appendNewline = $oldNewline;
|
131 |
-
|
132 |
-
return implode("\n", $records);
|
133 |
-
}
|
134 |
-
|
135 |
-
/**
|
136 |
-
* Normalizes given $data.
|
137 |
-
*
|
138 |
-
* @param mixed $data
|
139 |
-
*
|
140 |
-
* @return mixed
|
141 |
-
*/
|
142 |
-
protected function normalize($data, $depth = 0)
|
143 |
-
{
|
144 |
-
if ($depth > 9) {
|
145 |
-
return 'Over 9 levels deep, aborting normalization';
|
146 |
-
}
|
147 |
-
|
148 |
-
if (is_array($data) || $data instanceof \Traversable) {
|
149 |
-
$normalized = array();
|
150 |
-
|
151 |
-
$count = 1;
|
152 |
-
foreach ($data as $key => $value) {
|
153 |
-
if ($count++ > 1000) {
|
154 |
-
$normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization';
|
155 |
-
break;
|
156 |
-
}
|
157 |
-
|
158 |
-
$normalized[$key] = $this->normalize($value, $depth+1);
|
159 |
-
}
|
160 |
-
|
161 |
-
return $normalized;
|
162 |
-
}
|
163 |
-
|
164 |
-
if ($data instanceof Exception || $data instanceof Throwable) {
|
165 |
-
return $this->normalizeException($data);
|
166 |
-
}
|
167 |
-
|
168 |
-
return $data;
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Normalizes given exception with or without its own stack trace based on
|
173 |
-
* `includeStacktraces` property.
|
174 |
-
*
|
175 |
-
* @param Exception|Throwable $e
|
176 |
-
*
|
177 |
-
* @return array
|
178 |
-
*/
|
179 |
-
protected function normalizeException($e)
|
180 |
-
{
|
181 |
-
// TODO 2.0 only check for Throwable
|
182 |
-
if (!$e instanceof Exception && !$e instanceof Throwable) {
|
183 |
-
throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e));
|
184 |
-
}
|
185 |
-
|
186 |
-
$data = array(
|
187 |
-
'class' => Utils::getClass($e),
|
188 |
-
'message' => $e->getMessage(),
|
189 |
-
'code' => $e->getCode(),
|
190 |
-
'file' => $e->getFile().':'.$e->getLine(),
|
191 |
-
);
|
192 |
-
|
193 |
-
if ($this->includeStacktraces) {
|
194 |
-
$trace = $e->getTrace();
|
195 |
-
foreach ($trace as $frame) {
|
196 |
-
if (isset($frame['file'])) {
|
197 |
-
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
198 |
-
} elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
|
199 |
-
// We should again normalize the frames, because it might contain invalid items
|
200 |
-
$data['trace'][] = $frame['function'];
|
201 |
-
} else {
|
202 |
-
// We should again normalize the frames, because it might contain invalid items
|
203 |
-
$data['trace'][] = $this->normalize($frame);
|
204 |
-
}
|
205 |
-
}
|
206 |
-
}
|
207 |
-
|
208 |
-
if ($previous = $e->getPrevious()) {
|
209 |
-
$data['previous'] = $this->normalizeException($previous);
|
210 |
-
}
|
211 |
-
|
212 |
-
return $data;
|
213 |
-
}
|
214 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php
DELETED
@@ -1,181 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
use Monolog\Utils;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Formats incoming records into a one-line string
|
18 |
-
*
|
19 |
-
* This is especially useful for logging to files
|
20 |
-
*
|
21 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
22 |
-
* @author Christophe Coevoet <stof@notk.org>
|
23 |
-
*/
|
24 |
-
class LineFormatter extends NormalizerFormatter
|
25 |
-
{
|
26 |
-
const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n";
|
27 |
-
|
28 |
-
protected $format;
|
29 |
-
protected $allowInlineLineBreaks;
|
30 |
-
protected $ignoreEmptyContextAndExtra;
|
31 |
-
protected $includeStacktraces;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @param string $format The format of the message
|
35 |
-
* @param string $dateFormat The format of the timestamp: one supported by DateTime::format
|
36 |
-
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
|
37 |
-
* @param bool $ignoreEmptyContextAndExtra
|
38 |
-
*/
|
39 |
-
public function __construct($format = null, $dateFormat = null, $allowInlineLineBreaks = false, $ignoreEmptyContextAndExtra = false)
|
40 |
-
{
|
41 |
-
$this->format = $format ?: static::SIMPLE_FORMAT;
|
42 |
-
$this->allowInlineLineBreaks = $allowInlineLineBreaks;
|
43 |
-
$this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra;
|
44 |
-
parent::__construct($dateFormat);
|
45 |
-
}
|
46 |
-
|
47 |
-
public function includeStacktraces($include = true)
|
48 |
-
{
|
49 |
-
$this->includeStacktraces = $include;
|
50 |
-
if ($this->includeStacktraces) {
|
51 |
-
$this->allowInlineLineBreaks = true;
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
public function allowInlineLineBreaks($allow = true)
|
56 |
-
{
|
57 |
-
$this->allowInlineLineBreaks = $allow;
|
58 |
-
}
|
59 |
-
|
60 |
-
public function ignoreEmptyContextAndExtra($ignore = true)
|
61 |
-
{
|
62 |
-
$this->ignoreEmptyContextAndExtra = $ignore;
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* {@inheritdoc}
|
67 |
-
*/
|
68 |
-
public function format(array $record)
|
69 |
-
{
|
70 |
-
$vars = parent::format($record);
|
71 |
-
|
72 |
-
$output = $this->format;
|
73 |
-
|
74 |
-
foreach ($vars['extra'] as $var => $val) {
|
75 |
-
if (false !== strpos($output, '%extra.'.$var.'%')) {
|
76 |
-
$output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output);
|
77 |
-
unset($vars['extra'][$var]);
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
|
82 |
-
foreach ($vars['context'] as $var => $val) {
|
83 |
-
if (false !== strpos($output, '%context.'.$var.'%')) {
|
84 |
-
$output = str_replace('%context.'.$var.'%', $this->stringify($val), $output);
|
85 |
-
unset($vars['context'][$var]);
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
if ($this->ignoreEmptyContextAndExtra) {
|
90 |
-
if (empty($vars['context'])) {
|
91 |
-
unset($vars['context']);
|
92 |
-
$output = str_replace('%context%', '', $output);
|
93 |
-
}
|
94 |
-
|
95 |
-
if (empty($vars['extra'])) {
|
96 |
-
unset($vars['extra']);
|
97 |
-
$output = str_replace('%extra%', '', $output);
|
98 |
-
}
|
99 |
-
}
|
100 |
-
|
101 |
-
foreach ($vars as $var => $val) {
|
102 |
-
if (false !== strpos($output, '%'.$var.'%')) {
|
103 |
-
$output = str_replace('%'.$var.'%', $this->stringify($val), $output);
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
// remove leftover %extra.xxx% and %context.xxx% if any
|
108 |
-
if (false !== strpos($output, '%')) {
|
109 |
-
$output = preg_replace('/%(?:extra|context)\..+?%/', '', $output);
|
110 |
-
}
|
111 |
-
|
112 |
-
return $output;
|
113 |
-
}
|
114 |
-
|
115 |
-
public function formatBatch(array $records)
|
116 |
-
{
|
117 |
-
$message = '';
|
118 |
-
foreach ($records as $record) {
|
119 |
-
$message .= $this->format($record);
|
120 |
-
}
|
121 |
-
|
122 |
-
return $message;
|
123 |
-
}
|
124 |
-
|
125 |
-
public function stringify($value)
|
126 |
-
{
|
127 |
-
return $this->replaceNewlines($this->convertToString($value));
|
128 |
-
}
|
129 |
-
|
130 |
-
protected function normalizeException($e)
|
131 |
-
{
|
132 |
-
// TODO 2.0 only check for Throwable
|
133 |
-
if (!$e instanceof \Exception && !$e instanceof \Throwable) {
|
134 |
-
throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e));
|
135 |
-
}
|
136 |
-
|
137 |
-
$previousText = '';
|
138 |
-
if ($previous = $e->getPrevious()) {
|
139 |
-
do {
|
140 |
-
$previousText .= ', '.Utils::getClass($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine();
|
141 |
-
} while ($previous = $previous->getPrevious());
|
142 |
-
}
|
143 |
-
|
144 |
-
$str = '[object] ('.Utils::getClass($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')';
|
145 |
-
if ($this->includeStacktraces) {
|
146 |
-
$str .= "\n[stacktrace]\n".$e->getTraceAsString()."\n";
|
147 |
-
}
|
148 |
-
|
149 |
-
return $str;
|
150 |
-
}
|
151 |
-
|
152 |
-
protected function convertToString($data)
|
153 |
-
{
|
154 |
-
if (null === $data || is_bool($data)) {
|
155 |
-
return var_export($data, true);
|
156 |
-
}
|
157 |
-
|
158 |
-
if (is_scalar($data)) {
|
159 |
-
return (string) $data;
|
160 |
-
}
|
161 |
-
|
162 |
-
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
163 |
-
return $this->toJson($data, true);
|
164 |
-
}
|
165 |
-
|
166 |
-
return str_replace('\\/', '/', @json_encode($data));
|
167 |
-
}
|
168 |
-
|
169 |
-
protected function replaceNewlines($str)
|
170 |
-
{
|
171 |
-
if ($this->allowInlineLineBreaks) {
|
172 |
-
if (0 === strpos($str, '{')) {
|
173 |
-
return str_replace(array('\r', '\n'), array("\r", "\n"), $str);
|
174 |
-
}
|
175 |
-
|
176 |
-
return $str;
|
177 |
-
}
|
178 |
-
|
179 |
-
return str_replace(array("\r\n", "\r", "\n"), ' ', $str);
|
180 |
-
}
|
181 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Encodes message information into JSON in a format compatible with Loggly.
|
16 |
-
*
|
17 |
-
* @author Adam Pancutt <adam@pancutt.com>
|
18 |
-
*/
|
19 |
-
class LogglyFormatter extends JsonFormatter
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* Overrides the default batch mode to new lines for compatibility with the
|
23 |
-
* Loggly bulk API.
|
24 |
-
*
|
25 |
-
* @param int $batchMode
|
26 |
-
*/
|
27 |
-
public function __construct($batchMode = self::BATCH_MODE_NEWLINES, $appendNewline = false)
|
28 |
-
{
|
29 |
-
parent::__construct($batchMode, $appendNewline);
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Appends the 'timestamp' parameter for indexing by Loggly.
|
34 |
-
*
|
35 |
-
* @see https://www.loggly.com/docs/automated-parsing/#json
|
36 |
-
* @see \Monolog\Formatter\JsonFormatter::format()
|
37 |
-
*/
|
38 |
-
public function format(array $record)
|
39 |
-
{
|
40 |
-
if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) {
|
41 |
-
$record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
|
42 |
-
// TODO 2.0 unset the 'datetime' parameter, retained for BC
|
43 |
-
}
|
44 |
-
|
45 |
-
return parent::format($record);
|
46 |
-
}
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php
DELETED
@@ -1,166 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Serializes a log message to Logstash Event Format
|
16 |
-
*
|
17 |
-
* @see http://logstash.net/
|
18 |
-
* @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb
|
19 |
-
*
|
20 |
-
* @author Tim Mower <timothy.mower@gmail.com>
|
21 |
-
*/
|
22 |
-
class LogstashFormatter extends NormalizerFormatter
|
23 |
-
{
|
24 |
-
const V0 = 0;
|
25 |
-
const V1 = 1;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @var string the name of the system for the Logstash log message, used to fill the @source field
|
29 |
-
*/
|
30 |
-
protected $systemName;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @var string an application name for the Logstash log message, used to fill the @type field
|
34 |
-
*/
|
35 |
-
protected $applicationName;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* @var string a prefix for 'extra' fields from the Monolog record (optional)
|
39 |
-
*/
|
40 |
-
protected $extraPrefix;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* @var string a prefix for 'context' fields from the Monolog record (optional)
|
44 |
-
*/
|
45 |
-
protected $contextPrefix;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @var int logstash format version to use
|
49 |
-
*/
|
50 |
-
protected $version;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @param string $applicationName the application that sends the data, used as the "type" field of logstash
|
54 |
-
* @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine
|
55 |
-
* @param string $extraPrefix prefix for extra keys inside logstash "fields"
|
56 |
-
* @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_
|
57 |
-
* @param int $version the logstash format version to use, defaults to 0
|
58 |
-
*/
|
59 |
-
public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $version = self::V0)
|
60 |
-
{
|
61 |
-
// logstash requires a ISO 8601 format date with optional millisecond precision.
|
62 |
-
parent::__construct('Y-m-d\TH:i:s.uP');
|
63 |
-
|
64 |
-
$this->systemName = $systemName ?: gethostname();
|
65 |
-
$this->applicationName = $applicationName;
|
66 |
-
$this->extraPrefix = $extraPrefix;
|
67 |
-
$this->contextPrefix = $contextPrefix;
|
68 |
-
$this->version = $version;
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* {@inheritdoc}
|
73 |
-
*/
|
74 |
-
public function format(array $record)
|
75 |
-
{
|
76 |
-
$record = parent::format($record);
|
77 |
-
|
78 |
-
if ($this->version === self::V1) {
|
79 |
-
$message = $this->formatV1($record);
|
80 |
-
} else {
|
81 |
-
$message = $this->formatV0($record);
|
82 |
-
}
|
83 |
-
|
84 |
-
return $this->toJson($message) . "\n";
|
85 |
-
}
|
86 |
-
|
87 |
-
protected function formatV0(array $record)
|
88 |
-
{
|
89 |
-
if (empty($record['datetime'])) {
|
90 |
-
$record['datetime'] = gmdate('c');
|
91 |
-
}
|
92 |
-
$message = array(
|
93 |
-
'@timestamp' => $record['datetime'],
|
94 |
-
'@source' => $this->systemName,
|
95 |
-
'@fields' => array(),
|
96 |
-
);
|
97 |
-
if (isset($record['message'])) {
|
98 |
-
$message['@message'] = $record['message'];
|
99 |
-
}
|
100 |
-
if (isset($record['channel'])) {
|
101 |
-
$message['@tags'] = array($record['channel']);
|
102 |
-
$message['@fields']['channel'] = $record['channel'];
|
103 |
-
}
|
104 |
-
if (isset($record['level'])) {
|
105 |
-
$message['@fields']['level'] = $record['level'];
|
106 |
-
}
|
107 |
-
if ($this->applicationName) {
|
108 |
-
$message['@type'] = $this->applicationName;
|
109 |
-
}
|
110 |
-
if (isset($record['extra']['server'])) {
|
111 |
-
$message['@source_host'] = $record['extra']['server'];
|
112 |
-
}
|
113 |
-
if (isset($record['extra']['url'])) {
|
114 |
-
$message['@source_path'] = $record['extra']['url'];
|
115 |
-
}
|
116 |
-
if (!empty($record['extra'])) {
|
117 |
-
foreach ($record['extra'] as $key => $val) {
|
118 |
-
$message['@fields'][$this->extraPrefix . $key] = $val;
|
119 |
-
}
|
120 |
-
}
|
121 |
-
if (!empty($record['context'])) {
|
122 |
-
foreach ($record['context'] as $key => $val) {
|
123 |
-
$message['@fields'][$this->contextPrefix . $key] = $val;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
return $message;
|
128 |
-
}
|
129 |
-
|
130 |
-
protected function formatV1(array $record)
|
131 |
-
{
|
132 |
-
if (empty($record['datetime'])) {
|
133 |
-
$record['datetime'] = gmdate('c');
|
134 |
-
}
|
135 |
-
$message = array(
|
136 |
-
'@timestamp' => $record['datetime'],
|
137 |
-
'@version' => 1,
|
138 |
-
'host' => $this->systemName,
|
139 |
-
);
|
140 |
-
if (isset($record['message'])) {
|
141 |
-
$message['message'] = $record['message'];
|
142 |
-
}
|
143 |
-
if (isset($record['channel'])) {
|
144 |
-
$message['type'] = $record['channel'];
|
145 |
-
$message['channel'] = $record['channel'];
|
146 |
-
}
|
147 |
-
if (isset($record['level_name'])) {
|
148 |
-
$message['level'] = $record['level_name'];
|
149 |
-
}
|
150 |
-
if ($this->applicationName) {
|
151 |
-
$message['type'] = $this->applicationName;
|
152 |
-
}
|
153 |
-
if (!empty($record['extra'])) {
|
154 |
-
foreach ($record['extra'] as $key => $val) {
|
155 |
-
$message[$this->extraPrefix . $key] = $val;
|
156 |
-
}
|
157 |
-
}
|
158 |
-
if (!empty($record['context'])) {
|
159 |
-
foreach ($record['context'] as $key => $val) {
|
160 |
-
$message[$this->contextPrefix . $key] = $val;
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
return $message;
|
165 |
-
}
|
166 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
use Monolog\Utils;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Formats a record for use with the MongoDBHandler.
|
18 |
-
*
|
19 |
-
* @author Florian Plattner <me@florianplattner.de>
|
20 |
-
*/
|
21 |
-
class MongoDBFormatter implements FormatterInterface
|
22 |
-
{
|
23 |
-
private $exceptionTraceAsString;
|
24 |
-
private $maxNestingLevel;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2
|
28 |
-
* @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings
|
29 |
-
*/
|
30 |
-
public function __construct($maxNestingLevel = 3, $exceptionTraceAsString = true)
|
31 |
-
{
|
32 |
-
$this->maxNestingLevel = max($maxNestingLevel, 0);
|
33 |
-
$this->exceptionTraceAsString = (bool) $exceptionTraceAsString;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* {@inheritDoc}
|
38 |
-
*/
|
39 |
-
public function format(array $record)
|
40 |
-
{
|
41 |
-
return $this->formatArray($record);
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* {@inheritDoc}
|
46 |
-
*/
|
47 |
-
public function formatBatch(array $records)
|
48 |
-
{
|
49 |
-
foreach ($records as $key => $record) {
|
50 |
-
$records[$key] = $this->format($record);
|
51 |
-
}
|
52 |
-
|
53 |
-
return $records;
|
54 |
-
}
|
55 |
-
|
56 |
-
protected function formatArray(array $record, $nestingLevel = 0)
|
57 |
-
{
|
58 |
-
if ($this->maxNestingLevel == 0 || $nestingLevel <= $this->maxNestingLevel) {
|
59 |
-
foreach ($record as $name => $value) {
|
60 |
-
if ($value instanceof \DateTime) {
|
61 |
-
$record[$name] = $this->formatDate($value, $nestingLevel + 1);
|
62 |
-
} elseif ($value instanceof \Exception) {
|
63 |
-
$record[$name] = $this->formatException($value, $nestingLevel + 1);
|
64 |
-
} elseif (is_array($value)) {
|
65 |
-
$record[$name] = $this->formatArray($value, $nestingLevel + 1);
|
66 |
-
} elseif (is_object($value)) {
|
67 |
-
$record[$name] = $this->formatObject($value, $nestingLevel + 1);
|
68 |
-
}
|
69 |
-
}
|
70 |
-
} else {
|
71 |
-
$record = '[...]';
|
72 |
-
}
|
73 |
-
|
74 |
-
return $record;
|
75 |
-
}
|
76 |
-
|
77 |
-
protected function formatObject($value, $nestingLevel)
|
78 |
-
{
|
79 |
-
$objectVars = get_object_vars($value);
|
80 |
-
$objectVars['class'] = Utils::getClass($value);
|
81 |
-
|
82 |
-
return $this->formatArray($objectVars, $nestingLevel);
|
83 |
-
}
|
84 |
-
|
85 |
-
protected function formatException(\Exception $exception, $nestingLevel)
|
86 |
-
{
|
87 |
-
$formattedException = array(
|
88 |
-
'class' => Utils::getClass($exception),
|
89 |
-
'message' => $exception->getMessage(),
|
90 |
-
'code' => $exception->getCode(),
|
91 |
-
'file' => $exception->getFile() . ':' . $exception->getLine(),
|
92 |
-
);
|
93 |
-
|
94 |
-
if ($this->exceptionTraceAsString === true) {
|
95 |
-
$formattedException['trace'] = $exception->getTraceAsString();
|
96 |
-
} else {
|
97 |
-
$formattedException['trace'] = $exception->getTrace();
|
98 |
-
}
|
99 |
-
|
100 |
-
return $this->formatArray($formattedException, $nestingLevel);
|
101 |
-
}
|
102 |
-
|
103 |
-
protected function formatDate(\DateTime $value, $nestingLevel)
|
104 |
-
{
|
105 |
-
return new \MongoDate($value->getTimestamp());
|
106 |
-
}
|
107 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php
DELETED
@@ -1,314 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
use Exception;
|
15 |
-
use Monolog\Utils;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Normalizes incoming records to remove objects/resources so it's easier to dump to various targets
|
19 |
-
*
|
20 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
21 |
-
*/
|
22 |
-
class NormalizerFormatter implements FormatterInterface
|
23 |
-
{
|
24 |
-
const SIMPLE_DATE = "Y-m-d H:i:s";
|
25 |
-
|
26 |
-
protected $dateFormat;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* @param string $dateFormat The format of the timestamp: one supported by DateTime::format
|
30 |
-
*/
|
31 |
-
public function __construct($dateFormat = null)
|
32 |
-
{
|
33 |
-
$this->dateFormat = $dateFormat ?: static::SIMPLE_DATE;
|
34 |
-
if (!function_exists('json_encode')) {
|
35 |
-
throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter');
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* {@inheritdoc}
|
41 |
-
*/
|
42 |
-
public function format(array $record)
|
43 |
-
{
|
44 |
-
return $this->normalize($record);
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* {@inheritdoc}
|
49 |
-
*/
|
50 |
-
public function formatBatch(array $records)
|
51 |
-
{
|
52 |
-
foreach ($records as $key => $record) {
|
53 |
-
$records[$key] = $this->format($record);
|
54 |
-
}
|
55 |
-
|
56 |
-
return $records;
|
57 |
-
}
|
58 |
-
|
59 |
-
protected function normalize($data, $depth = 0)
|
60 |
-
{
|
61 |
-
if ($depth > 9) {
|
62 |
-
return 'Over 9 levels deep, aborting normalization';
|
63 |
-
}
|
64 |
-
|
65 |
-
if (null === $data || is_scalar($data)) {
|
66 |
-
if (is_float($data)) {
|
67 |
-
if (is_infinite($data)) {
|
68 |
-
return ($data > 0 ? '' : '-') . 'INF';
|
69 |
-
}
|
70 |
-
if (is_nan($data)) {
|
71 |
-
return 'NaN';
|
72 |
-
}
|
73 |
-
}
|
74 |
-
|
75 |
-
return $data;
|
76 |
-
}
|
77 |
-
|
78 |
-
if (is_array($data)) {
|
79 |
-
$normalized = array();
|
80 |
-
|
81 |
-
$count = 1;
|
82 |
-
foreach ($data as $key => $value) {
|
83 |
-
if ($count++ > 1000) {
|
84 |
-
$normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization';
|
85 |
-
break;
|
86 |
-
}
|
87 |
-
|
88 |
-
$normalized[$key] = $this->normalize($value, $depth+1);
|
89 |
-
}
|
90 |
-
|
91 |
-
return $normalized;
|
92 |
-
}
|
93 |
-
|
94 |
-
if ($data instanceof \DateTime) {
|
95 |
-
return $data->format($this->dateFormat);
|
96 |
-
}
|
97 |
-
|
98 |
-
if (is_object($data)) {
|
99 |
-
// TODO 2.0 only check for Throwable
|
100 |
-
if ($data instanceof Exception || (PHP_VERSION_ID > 70000 && $data instanceof \Throwable)) {
|
101 |
-
return $this->normalizeException($data);
|
102 |
-
}
|
103 |
-
|
104 |
-
// non-serializable objects that implement __toString stringified
|
105 |
-
if (method_exists($data, '__toString') && !$data instanceof \JsonSerializable) {
|
106 |
-
$value = $data->__toString();
|
107 |
-
} else {
|
108 |
-
// the rest is json-serialized in some way
|
109 |
-
$value = $this->toJson($data, true);
|
110 |
-
}
|
111 |
-
|
112 |
-
return sprintf("[object] (%s: %s)", Utils::getClass($data), $value);
|
113 |
-
}
|
114 |
-
|
115 |
-
if (is_resource($data)) {
|
116 |
-
return sprintf('[resource] (%s)', get_resource_type($data));
|
117 |
-
}
|
118 |
-
|
119 |
-
return '[unknown('.gettype($data).')]';
|
120 |
-
}
|
121 |
-
|
122 |
-
protected function normalizeException($e)
|
123 |
-
{
|
124 |
-
// TODO 2.0 only check for Throwable
|
125 |
-
if (!$e instanceof Exception && !$e instanceof \Throwable) {
|
126 |
-
throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e));
|
127 |
-
}
|
128 |
-
|
129 |
-
$data = array(
|
130 |
-
'class' => Utils::getClass($e),
|
131 |
-
'message' => $e->getMessage(),
|
132 |
-
'code' => $e->getCode(),
|
133 |
-
'file' => $e->getFile().':'.$e->getLine(),
|
134 |
-
);
|
135 |
-
|
136 |
-
if ($e instanceof \SoapFault) {
|
137 |
-
if (isset($e->faultcode)) {
|
138 |
-
$data['faultcode'] = $e->faultcode;
|
139 |
-
}
|
140 |
-
|
141 |
-
if (isset($e->faultactor)) {
|
142 |
-
$data['faultactor'] = $e->faultactor;
|
143 |
-
}
|
144 |
-
|
145 |
-
if (isset($e->detail)) {
|
146 |
-
$data['detail'] = $e->detail;
|
147 |
-
}
|
148 |
-
}
|
149 |
-
|
150 |
-
$trace = $e->getTrace();
|
151 |
-
foreach ($trace as $frame) {
|
152 |
-
if (isset($frame['file'])) {
|
153 |
-
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
154 |
-
} elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
|
155 |
-
// Simplify closures handling
|
156 |
-
$data['trace'][] = $frame['function'];
|
157 |
-
} else {
|
158 |
-
if (isset($frame['args'])) {
|
159 |
-
// Make sure that objects present as arguments are not serialized nicely but rather only
|
160 |
-
// as a class name to avoid any unexpected leak of sensitive information
|
161 |
-
$frame['args'] = array_map(function ($arg) {
|
162 |
-
if (is_object($arg) && !($arg instanceof \DateTime || $arg instanceof \DateTimeInterface)) {
|
163 |
-
return sprintf("[object] (%s)", Utils::getClass($arg));
|
164 |
-
}
|
165 |
-
|
166 |
-
return $arg;
|
167 |
-
}, $frame['args']);
|
168 |
-
}
|
169 |
-
// We should again normalize the frames, because it might contain invalid items
|
170 |
-
$data['trace'][] = $this->toJson($this->normalize($frame), true);
|
171 |
-
}
|
172 |
-
}
|
173 |
-
|
174 |
-
if ($previous = $e->getPrevious()) {
|
175 |
-
$data['previous'] = $this->normalizeException($previous);
|
176 |
-
}
|
177 |
-
|
178 |
-
return $data;
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Return the JSON representation of a value
|
183 |
-
*
|
184 |
-
* @param mixed $data
|
185 |
-
* @param bool $ignoreErrors
|
186 |
-
* @throws \RuntimeException if encoding fails and errors are not ignored
|
187 |
-
* @return string
|
188 |
-
*/
|
189 |
-
protected function toJson($data, $ignoreErrors = false)
|
190 |
-
{
|
191 |
-
// suppress json_encode errors since it's twitchy with some inputs
|
192 |
-
if ($ignoreErrors) {
|
193 |
-
return @$this->jsonEncode($data);
|
194 |
-
}
|
195 |
-
|
196 |
-
$json = $this->jsonEncode($data);
|
197 |
-
|
198 |
-
if ($json === false) {
|
199 |
-
$json = $this->handleJsonError(json_last_error(), $data);
|
200 |
-
}
|
201 |
-
|
202 |
-
return $json;
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* @param mixed $data
|
207 |
-
* @return string JSON encoded data or null on failure
|
208 |
-
*/
|
209 |
-
private function jsonEncode($data)
|
210 |
-
{
|
211 |
-
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
212 |
-
return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
213 |
-
}
|
214 |
-
|
215 |
-
return json_encode($data);
|
216 |
-
}
|
217 |
-
|
218 |
-
/**
|
219 |
-
* Handle a json_encode failure.
|
220 |
-
*
|
221 |
-
* If the failure is due to invalid string encoding, try to clean the
|
222 |
-
* input and encode again. If the second encoding attempt fails, the
|
223 |
-
* inital error is not encoding related or the input can't be cleaned then
|
224 |
-
* raise a descriptive exception.
|
225 |
-
*
|
226 |
-
* @param int $code return code of json_last_error function
|
227 |
-
* @param mixed $data data that was meant to be encoded
|
228 |
-
* @throws \RuntimeException if failure can't be corrected
|
229 |
-
* @return string JSON encoded data after error correction
|
230 |
-
*/
|
231 |
-
private function handleJsonError($code, $data)
|
232 |
-
{
|
233 |
-
if ($code !== JSON_ERROR_UTF8) {
|
234 |
-
$this->throwEncodeError($code, $data);
|
235 |
-
}
|
236 |
-
|
237 |
-
if (is_string($data)) {
|
238 |
-
$this->detectAndCleanUtf8($data);
|
239 |
-
} elseif (is_array($data)) {
|
240 |
-
array_walk_recursive($data, array($this, 'detectAndCleanUtf8'));
|
241 |
-
} else {
|
242 |
-
$this->throwEncodeError($code, $data);
|
243 |
-
}
|
244 |
-
|
245 |
-
$json = $this->jsonEncode($data);
|
246 |
-
|
247 |
-
if ($json === false) {
|
248 |
-
$this->throwEncodeError(json_last_error(), $data);
|
249 |
-
}
|
250 |
-
|
251 |
-
return $json;
|
252 |
-
}
|
253 |
-
|
254 |
-
/**
|
255 |
-
* Throws an exception according to a given code with a customized message
|
256 |
-
*
|
257 |
-
* @param int $code return code of json_last_error function
|
258 |
-
* @param mixed $data data that was meant to be encoded
|
259 |
-
* @throws \RuntimeException
|
260 |
-
*/
|
261 |
-
private function throwEncodeError($code, $data)
|
262 |
-
{
|
263 |
-
switch ($code) {
|
264 |
-
case JSON_ERROR_DEPTH:
|
265 |
-
$msg = 'Maximum stack depth exceeded';
|
266 |
-
break;
|
267 |
-
case JSON_ERROR_STATE_MISMATCH:
|
268 |
-
$msg = 'Underflow or the modes mismatch';
|
269 |
-
break;
|
270 |
-
case JSON_ERROR_CTRL_CHAR:
|
271 |
-
$msg = 'Unexpected control character found';
|
272 |
-
break;
|
273 |
-
case JSON_ERROR_UTF8:
|
274 |
-
$msg = 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
275 |
-
break;
|
276 |
-
default:
|
277 |
-
$msg = 'Unknown error';
|
278 |
-
}
|
279 |
-
|
280 |
-
throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true));
|
281 |
-
}
|
282 |
-
|
283 |
-
/**
|
284 |
-
* Detect invalid UTF-8 string characters and convert to valid UTF-8.
|
285 |
-
*
|
286 |
-
* Valid UTF-8 input will be left unmodified, but strings containing
|
287 |
-
* invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed
|
288 |
-
* original encoding of ISO-8859-15. This conversion may result in
|
289 |
-
* incorrect output if the actual encoding was not ISO-8859-15, but it
|
290 |
-
* will be clean UTF-8 output and will not rely on expensive and fragile
|
291 |
-
* detection algorithms.
|
292 |
-
*
|
293 |
-
* Function converts the input in place in the passed variable so that it
|
294 |
-
* can be used as a callback for array_walk_recursive.
|
295 |
-
*
|
296 |
-
* @param mixed &$data Input to check and convert if needed
|
297 |
-
* @private
|
298 |
-
*/
|
299 |
-
public function detectAndCleanUtf8(&$data)
|
300 |
-
{
|
301 |
-
if (is_string($data) && !preg_match('//u', $data)) {
|
302 |
-
$data = preg_replace_callback(
|
303 |
-
'/[\x80-\xFF]+/',
|
304 |
-
function ($m) { return utf8_encode($m[0]); },
|
305 |
-
$data
|
306 |
-
);
|
307 |
-
$data = str_replace(
|
308 |
-
array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'),
|
309 |
-
array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'),
|
310 |
-
$data
|
311 |
-
);
|
312 |
-
}
|
313 |
-
}
|
314 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Formats data into an associative array of scalar values.
|
16 |
-
* Objects and arrays will be JSON encoded.
|
17 |
-
*
|
18 |
-
* @author Andrew Lawson <adlawson@gmail.com>
|
19 |
-
*/
|
20 |
-
class ScalarFormatter extends NormalizerFormatter
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* {@inheritdoc}
|
24 |
-
*/
|
25 |
-
public function format(array $record)
|
26 |
-
{
|
27 |
-
foreach ($record as $key => $value) {
|
28 |
-
$record[$key] = $this->normalizeValue($value);
|
29 |
-
}
|
30 |
-
|
31 |
-
return $record;
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @param mixed $value
|
36 |
-
* @return mixed
|
37 |
-
*/
|
38 |
-
protected function normalizeValue($value)
|
39 |
-
{
|
40 |
-
$normalized = $this->normalize($value);
|
41 |
-
|
42 |
-
if (is_array($normalized) || is_object($normalized)) {
|
43 |
-
return $this->toJson($normalized, true);
|
44 |
-
}
|
45 |
-
|
46 |
-
return $normalized;
|
47 |
-
}
|
48 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php
DELETED
@@ -1,113 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Formatter;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Serializes a log message according to Wildfire's header requirements
|
18 |
-
*
|
19 |
-
* @author Eric Clemmons (@ericclemmons) <eric@uxdriven.com>
|
20 |
-
* @author Christophe Coevoet <stof@notk.org>
|
21 |
-
* @author Kirill chEbba Chebunin <iam@chebba.org>
|
22 |
-
*/
|
23 |
-
class WildfireFormatter extends NormalizerFormatter
|
24 |
-
{
|
25 |
-
const TABLE = 'table';
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Translates Monolog log levels to Wildfire levels.
|
29 |
-
*/
|
30 |
-
private $logLevels = array(
|
31 |
-
Logger::DEBUG => 'LOG',
|
32 |
-
Logger::INFO => 'INFO',
|
33 |
-
Logger::NOTICE => 'INFO',
|
34 |
-
Logger::WARNING => 'WARN',
|
35 |
-
Logger::ERROR => 'ERROR',
|
36 |
-
Logger::CRITICAL => 'ERROR',
|
37 |
-
Logger::ALERT => 'ERROR',
|
38 |
-
Logger::EMERGENCY => 'ERROR',
|
39 |
-
);
|
40 |
-
|
41 |
-
/**
|
42 |
-
* {@inheritdoc}
|
43 |
-
*/
|
44 |
-
public function format(array $record)
|
45 |
-
{
|
46 |
-
// Retrieve the line and file if set and remove them from the formatted extra
|
47 |
-
$file = $line = '';
|
48 |
-
if (isset($record['extra']['file'])) {
|
49 |
-
$file = $record['extra']['file'];
|
50 |
-
unset($record['extra']['file']);
|
51 |
-
}
|
52 |
-
if (isset($record['extra']['line'])) {
|
53 |
-
$line = $record['extra']['line'];
|
54 |
-
unset($record['extra']['line']);
|
55 |
-
}
|
56 |
-
|
57 |
-
$record = $this->normalize($record);
|
58 |
-
$message = array('message' => $record['message']);
|
59 |
-
$handleError = false;
|
60 |
-
if ($record['context']) {
|
61 |
-
$message['context'] = $record['context'];
|
62 |
-
$handleError = true;
|
63 |
-
}
|
64 |
-
if ($record['extra']) {
|
65 |
-
$message['extra'] = $record['extra'];
|
66 |
-
$handleError = true;
|
67 |
-
}
|
68 |
-
if (count($message) === 1) {
|
69 |
-
$message = reset($message);
|
70 |
-
}
|
71 |
-
|
72 |
-
if (isset($record['context'][self::TABLE])) {
|
73 |
-
$type = 'TABLE';
|
74 |
-
$label = $record['channel'] .': '. $record['message'];
|
75 |
-
$message = $record['context'][self::TABLE];
|
76 |
-
} else {
|
77 |
-
$type = $this->logLevels[$record['level']];
|
78 |
-
$label = $record['channel'];
|
79 |
-
}
|
80 |
-
|
81 |
-
// Create JSON object describing the appearance of the message in the console
|
82 |
-
$json = $this->toJson(array(
|
83 |
-
array(
|
84 |
-
'Type' => $type,
|
85 |
-
'File' => $file,
|
86 |
-
'Line' => $line,
|
87 |
-
'Label' => $label,
|
88 |
-
),
|
89 |
-
$message,
|
90 |
-
), $handleError);
|
91 |
-
|
92 |
-
// The message itself is a serialization of the above JSON object + it's length
|
93 |
-
return sprintf(
|
94 |
-
'%s|%s|',
|
95 |
-
strlen($json),
|
96 |
-
$json
|
97 |
-
);
|
98 |
-
}
|
99 |
-
|
100 |
-
public function formatBatch(array $records)
|
101 |
-
{
|
102 |
-
throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter');
|
103 |
-
}
|
104 |
-
|
105 |
-
protected function normalize($data, $depth = 0)
|
106 |
-
{
|
107 |
-
if (is_object($data) && !$data instanceof \DateTime) {
|
108 |
-
return $data;
|
109 |
-
}
|
110 |
-
|
111 |
-
return parent::normalize($data, $depth);
|
112 |
-
}
|
113 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php
DELETED
@@ -1,196 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\FormatterInterface;
|
15 |
-
use Monolog\Formatter\LineFormatter;
|
16 |
-
use Monolog\Logger;
|
17 |
-
use Monolog\ResettableInterface;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Base Handler class providing the Handler structure
|
21 |
-
*
|
22 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
23 |
-
*/
|
24 |
-
abstract class AbstractHandler implements HandlerInterface, ResettableInterface
|
25 |
-
{
|
26 |
-
protected $level = Logger::DEBUG;
|
27 |
-
protected $bubble = true;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* @var FormatterInterface
|
31 |
-
*/
|
32 |
-
protected $formatter;
|
33 |
-
protected $processors = array();
|
34 |
-
|
35 |
-
/**
|
36 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
37 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
38 |
-
*/
|
39 |
-
public function __construct($level = Logger::DEBUG, $bubble = true)
|
40 |
-
{
|
41 |
-
$this->setLevel($level);
|
42 |
-
$this->bubble = $bubble;
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* {@inheritdoc}
|
47 |
-
*/
|
48 |
-
public function isHandling(array $record)
|
49 |
-
{
|
50 |
-
return $record['level'] >= $this->level;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* {@inheritdoc}
|
55 |
-
*/
|
56 |
-
public function handleBatch(array $records)
|
57 |
-
{
|
58 |
-
foreach ($records as $record) {
|
59 |
-
$this->handle($record);
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Closes the handler.
|
65 |
-
*
|
66 |
-
* This will be called automatically when the object is destroyed
|
67 |
-
*/
|
68 |
-
public function close()
|
69 |
-
{
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* {@inheritdoc}
|
74 |
-
*/
|
75 |
-
public function pushProcessor($callback)
|
76 |
-
{
|
77 |
-
if (!is_callable($callback)) {
|
78 |
-
throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
|
79 |
-
}
|
80 |
-
array_unshift($this->processors, $callback);
|
81 |
-
|
82 |
-
return $this;
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* {@inheritdoc}
|
87 |
-
*/
|
88 |
-
public function popProcessor()
|
89 |
-
{
|
90 |
-
if (!$this->processors) {
|
91 |
-
throw new \LogicException('You tried to pop from an empty processor stack.');
|
92 |
-
}
|
93 |
-
|
94 |
-
return array_shift($this->processors);
|
95 |
-
}
|
96 |
-
|
97 |
-
/**
|
98 |
-
* {@inheritdoc}
|
99 |
-
*/
|
100 |
-
public function setFormatter(FormatterInterface $formatter)
|
101 |
-
{
|
102 |
-
$this->formatter = $formatter;
|
103 |
-
|
104 |
-
return $this;
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* {@inheritdoc}
|
109 |
-
*/
|
110 |
-
public function getFormatter()
|
111 |
-
{
|
112 |
-
if (!$this->formatter) {
|
113 |
-
$this->formatter = $this->getDefaultFormatter();
|
114 |
-
}
|
115 |
-
|
116 |
-
return $this->formatter;
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Sets minimum logging level at which this handler will be triggered.
|
121 |
-
*
|
122 |
-
* @param int|string $level Level or level name
|
123 |
-
* @return self
|
124 |
-
*/
|
125 |
-
public function setLevel($level)
|
126 |
-
{
|
127 |
-
$this->level = Logger::toMonologLevel($level);
|
128 |
-
|
129 |
-
return $this;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* Gets minimum logging level at which this handler will be triggered.
|
134 |
-
*
|
135 |
-
* @return int
|
136 |
-
*/
|
137 |
-
public function getLevel()
|
138 |
-
{
|
139 |
-
return $this->level;
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Sets the bubbling behavior.
|
144 |
-
*
|
145 |
-
* @param bool $bubble true means that this handler allows bubbling.
|
146 |
-
* false means that bubbling is not permitted.
|
147 |
-
* @return self
|
148 |
-
*/
|
149 |
-
public function setBubble($bubble)
|
150 |
-
{
|
151 |
-
$this->bubble = $bubble;
|
152 |
-
|
153 |
-
return $this;
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* Gets the bubbling behavior.
|
158 |
-
*
|
159 |
-
* @return bool true means that this handler allows bubbling.
|
160 |
-
* false means that bubbling is not permitted.
|
161 |
-
*/
|
162 |
-
public function getBubble()
|
163 |
-
{
|
164 |
-
return $this->bubble;
|
165 |
-
}
|
166 |
-
|
167 |
-
public function __destruct()
|
168 |
-
{
|
169 |
-
try {
|
170 |
-
$this->close();
|
171 |
-
} catch (\Exception $e) {
|
172 |
-
// do nothing
|
173 |
-
} catch (\Throwable $e) {
|
174 |
-
// do nothing
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
public function reset()
|
179 |
-
{
|
180 |
-
foreach ($this->processors as $processor) {
|
181 |
-
if ($processor instanceof ResettableInterface) {
|
182 |
-
$processor->reset();
|
183 |
-
}
|
184 |
-
}
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Gets the default formatter.
|
189 |
-
*
|
190 |
-
* @return FormatterInterface
|
191 |
-
*/
|
192 |
-
protected function getDefaultFormatter()
|
193 |
-
{
|
194 |
-
return new LineFormatter();
|
195 |
-
}
|
196 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\ResettableInterface;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Base Handler class providing the Handler structure
|
18 |
-
*
|
19 |
-
* Classes extending it should (in most cases) only implement write($record)
|
20 |
-
*
|
21 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
22 |
-
* @author Christophe Coevoet <stof@notk.org>
|
23 |
-
*/
|
24 |
-
abstract class AbstractProcessingHandler extends AbstractHandler
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* {@inheritdoc}
|
28 |
-
*/
|
29 |
-
public function handle(array $record)
|
30 |
-
{
|
31 |
-
if (!$this->isHandling($record)) {
|
32 |
-
return false;
|
33 |
-
}
|
34 |
-
|
35 |
-
$record = $this->processRecord($record);
|
36 |
-
|
37 |
-
$record['formatted'] = $this->getFormatter()->format($record);
|
38 |
-
|
39 |
-
$this->write($record);
|
40 |
-
|
41 |
-
return false === $this->bubble;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Writes the record down to the log of the implementing handler
|
46 |
-
*
|
47 |
-
* @param array $record
|
48 |
-
* @return void
|
49 |
-
*/
|
50 |
-
abstract protected function write(array $record);
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Processes a record.
|
54 |
-
*
|
55 |
-
* @param array $record
|
56 |
-
* @return array
|
57 |
-
*/
|
58 |
-
protected function processRecord(array $record)
|
59 |
-
{
|
60 |
-
if ($this->processors) {
|
61 |
-
foreach ($this->processors as $processor) {
|
62 |
-
$record = call_user_func($processor, $record);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
return $record;
|
67 |
-
}
|
68 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php
DELETED
@@ -1,101 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\LineFormatter;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Common syslog functionality
|
19 |
-
*/
|
20 |
-
abstract class AbstractSyslogHandler extends AbstractProcessingHandler
|
21 |
-
{
|
22 |
-
protected $facility;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Translates Monolog log levels to syslog log priorities.
|
26 |
-
*/
|
27 |
-
protected $logLevels = array(
|
28 |
-
Logger::DEBUG => LOG_DEBUG,
|
29 |
-
Logger::INFO => LOG_INFO,
|
30 |
-
Logger::NOTICE => LOG_NOTICE,
|
31 |
-
Logger::WARNING => LOG_WARNING,
|
32 |
-
Logger::ERROR => LOG_ERR,
|
33 |
-
Logger::CRITICAL => LOG_CRIT,
|
34 |
-
Logger::ALERT => LOG_ALERT,
|
35 |
-
Logger::EMERGENCY => LOG_EMERG,
|
36 |
-
);
|
37 |
-
|
38 |
-
/**
|
39 |
-
* List of valid log facility names.
|
40 |
-
*/
|
41 |
-
protected $facilities = array(
|
42 |
-
'auth' => LOG_AUTH,
|
43 |
-
'authpriv' => LOG_AUTHPRIV,
|
44 |
-
'cron' => LOG_CRON,
|
45 |
-
'daemon' => LOG_DAEMON,
|
46 |
-
'kern' => LOG_KERN,
|
47 |
-
'lpr' => LOG_LPR,
|
48 |
-
'mail' => LOG_MAIL,
|
49 |
-
'news' => LOG_NEWS,
|
50 |
-
'syslog' => LOG_SYSLOG,
|
51 |
-
'user' => LOG_USER,
|
52 |
-
'uucp' => LOG_UUCP,
|
53 |
-
);
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @param mixed $facility
|
57 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
58 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
59 |
-
*/
|
60 |
-
public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
|
61 |
-
{
|
62 |
-
parent::__construct($level, $bubble);
|
63 |
-
|
64 |
-
if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
|
65 |
-
$this->facilities['local0'] = LOG_LOCAL0;
|
66 |
-
$this->facilities['local1'] = LOG_LOCAL1;
|
67 |
-
$this->facilities['local2'] = LOG_LOCAL2;
|
68 |
-
$this->facilities['local3'] = LOG_LOCAL3;
|
69 |
-
$this->facilities['local4'] = LOG_LOCAL4;
|
70 |
-
$this->facilities['local5'] = LOG_LOCAL5;
|
71 |
-
$this->facilities['local6'] = LOG_LOCAL6;
|
72 |
-
$this->facilities['local7'] = LOG_LOCAL7;
|
73 |
-
} else {
|
74 |
-
$this->facilities['local0'] = 128; // LOG_LOCAL0
|
75 |
-
$this->facilities['local1'] = 136; // LOG_LOCAL1
|
76 |
-
$this->facilities['local2'] = 144; // LOG_LOCAL2
|
77 |
-
$this->facilities['local3'] = 152; // LOG_LOCAL3
|
78 |
-
$this->facilities['local4'] = 160; // LOG_LOCAL4
|
79 |
-
$this->facilities['local5'] = 168; // LOG_LOCAL5
|
80 |
-
$this->facilities['local6'] = 176; // LOG_LOCAL6
|
81 |
-
$this->facilities['local7'] = 184; // LOG_LOCAL7
|
82 |
-
}
|
83 |
-
|
84 |
-
// convert textual description of facility to syslog constant
|
85 |
-
if (array_key_exists(strtolower($facility), $this->facilities)) {
|
86 |
-
$facility = $this->facilities[strtolower($facility)];
|
87 |
-
} elseif (!in_array($facility, array_values($this->facilities), true)) {
|
88 |
-
throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given');
|
89 |
-
}
|
90 |
-
|
91 |
-
$this->facility = $facility;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* {@inheritdoc}
|
96 |
-
*/
|
97 |
-
protected function getDefaultFormatter()
|
98 |
-
{
|
99 |
-
return new LineFormatter('%channel%.%level_name%: %message% %context% %extra%');
|
100 |
-
}
|
101 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php
DELETED
@@ -1,148 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\JsonFormatter;
|
16 |
-
use PhpAmqpLib\Message\AMQPMessage;
|
17 |
-
use PhpAmqpLib\Channel\AMQPChannel;
|
18 |
-
use AMQPExchange;
|
19 |
-
|
20 |
-
class AmqpHandler extends AbstractProcessingHandler
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* @var AMQPExchange|AMQPChannel $exchange
|
24 |
-
*/
|
25 |
-
protected $exchange;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @var string
|
29 |
-
*/
|
30 |
-
protected $exchangeName;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use
|
34 |
-
* @param string $exchangeName
|
35 |
-
* @param int $level
|
36 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
37 |
-
*/
|
38 |
-
public function __construct($exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true)
|
39 |
-
{
|
40 |
-
if ($exchange instanceof AMQPExchange) {
|
41 |
-
$exchange->setName($exchangeName);
|
42 |
-
} elseif ($exchange instanceof AMQPChannel) {
|
43 |
-
$this->exchangeName = $exchangeName;
|
44 |
-
} else {
|
45 |
-
throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required');
|
46 |
-
}
|
47 |
-
$this->exchange = $exchange;
|
48 |
-
|
49 |
-
parent::__construct($level, $bubble);
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* {@inheritDoc}
|
54 |
-
*/
|
55 |
-
protected function write(array $record)
|
56 |
-
{
|
57 |
-
$data = $record["formatted"];
|
58 |
-
$routingKey = $this->getRoutingKey($record);
|
59 |
-
|
60 |
-
if ($this->exchange instanceof AMQPExchange) {
|
61 |
-
$this->exchange->publish(
|
62 |
-
$data,
|
63 |
-
$routingKey,
|
64 |
-
0,
|
65 |
-
array(
|
66 |
-
'delivery_mode' => 2,
|
67 |
-
'content_type' => 'application/json',
|
68 |
-
)
|
69 |
-
);
|
70 |
-
} else {
|
71 |
-
$this->exchange->basic_publish(
|
72 |
-
$this->createAmqpMessage($data),
|
73 |
-
$this->exchangeName,
|
74 |
-
$routingKey
|
75 |
-
);
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* {@inheritDoc}
|
81 |
-
*/
|
82 |
-
public function handleBatch(array $records)
|
83 |
-
{
|
84 |
-
if ($this->exchange instanceof AMQPExchange) {
|
85 |
-
parent::handleBatch($records);
|
86 |
-
|
87 |
-
return;
|
88 |
-
}
|
89 |
-
|
90 |
-
foreach ($records as $record) {
|
91 |
-
if (!$this->isHandling($record)) {
|
92 |
-
continue;
|
93 |
-
}
|
94 |
-
|
95 |
-
$record = $this->processRecord($record);
|
96 |
-
$data = $this->getFormatter()->format($record);
|
97 |
-
|
98 |
-
$this->exchange->batch_basic_publish(
|
99 |
-
$this->createAmqpMessage($data),
|
100 |
-
$this->exchangeName,
|
101 |
-
$this->getRoutingKey($record)
|
102 |
-
);
|
103 |
-
}
|
104 |
-
|
105 |
-
$this->exchange->publish_batch();
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* Gets the routing key for the AMQP exchange
|
110 |
-
*
|
111 |
-
* @param array $record
|
112 |
-
* @return string
|
113 |
-
*/
|
114 |
-
protected function getRoutingKey(array $record)
|
115 |
-
{
|
116 |
-
$routingKey = sprintf(
|
117 |
-
'%s.%s',
|
118 |
-
// TODO 2.0 remove substr call
|
119 |
-
substr($record['level_name'], 0, 4),
|
120 |
-
$record['channel']
|
121 |
-
);
|
122 |
-
|
123 |
-
return strtolower($routingKey);
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* @param string $data
|
128 |
-
* @return AMQPMessage
|
129 |
-
*/
|
130 |
-
private function createAmqpMessage($data)
|
131 |
-
{
|
132 |
-
return new AMQPMessage(
|
133 |
-
(string) $data,
|
134 |
-
array(
|
135 |
-
'delivery_mode' => 2,
|
136 |
-
'content_type' => 'application/json',
|
137 |
-
)
|
138 |
-
);
|
139 |
-
}
|
140 |
-
|
141 |
-
/**
|
142 |
-
* {@inheritDoc}
|
143 |
-
*/
|
144 |
-
protected function getDefaultFormatter()
|
145 |
-
{
|
146 |
-
return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);
|
147 |
-
}
|
148 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php
DELETED
@@ -1,240 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\LineFormatter;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Handler sending logs to browser's javascript console with no browser extension required
|
18 |
-
*
|
19 |
-
* @author Olivier Poitrey <rs@dailymotion.com>
|
20 |
-
*/
|
21 |
-
class BrowserConsoleHandler extends AbstractProcessingHandler
|
22 |
-
{
|
23 |
-
protected static $initialized = false;
|
24 |
-
protected static $records = array();
|
25 |
-
|
26 |
-
/**
|
27 |
-
* {@inheritDoc}
|
28 |
-
*
|
29 |
-
* Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format.
|
30 |
-
*
|
31 |
-
* Example of formatted string:
|
32 |
-
*
|
33 |
-
* You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white}
|
34 |
-
*/
|
35 |
-
protected function getDefaultFormatter()
|
36 |
-
{
|
37 |
-
return new LineFormatter('[[%channel%]]{macro: autolabel} [[%level_name%]]{font-weight: bold} %message%');
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* {@inheritDoc}
|
42 |
-
*/
|
43 |
-
protected function write(array $record)
|
44 |
-
{
|
45 |
-
// Accumulate records
|
46 |
-
static::$records[] = $record;
|
47 |
-
|
48 |
-
// Register shutdown handler if not already done
|
49 |
-
if (!static::$initialized) {
|
50 |
-
static::$initialized = true;
|
51 |
-
$this->registerShutdownFunction();
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Convert records to javascript console commands and send it to the browser.
|
57 |
-
* This method is automatically called on PHP shutdown if output is HTML or Javascript.
|
58 |
-
*/
|
59 |
-
public static function send()
|
60 |
-
{
|
61 |
-
$format = static::getResponseFormat();
|
62 |
-
if ($format === 'unknown') {
|
63 |
-
return;
|
64 |
-
}
|
65 |
-
|
66 |
-
if (count(static::$records)) {
|
67 |
-
if ($format === 'html') {
|
68 |
-
static::writeOutput('<script>' . static::generateScript() . '</script>');
|
69 |
-
} elseif ($format === 'js') {
|
70 |
-
static::writeOutput(static::generateScript());
|
71 |
-
}
|
72 |
-
static::resetStatic();
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
public function close()
|
77 |
-
{
|
78 |
-
self::resetStatic();
|
79 |
-
}
|
80 |
-
|
81 |
-
public function reset()
|
82 |
-
{
|
83 |
-
self::resetStatic();
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Forget all logged records
|
88 |
-
*/
|
89 |
-
public static function resetStatic()
|
90 |
-
{
|
91 |
-
static::$records = array();
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Wrapper for register_shutdown_function to allow overriding
|
96 |
-
*/
|
97 |
-
protected function registerShutdownFunction()
|
98 |
-
{
|
99 |
-
if (PHP_SAPI !== 'cli') {
|
100 |
-
register_shutdown_function(array('Monolog\Handler\BrowserConsoleHandler', 'send'));
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* Wrapper for echo to allow overriding
|
106 |
-
*
|
107 |
-
* @param string $str
|
108 |
-
*/
|
109 |
-
protected static function writeOutput($str)
|
110 |
-
{
|
111 |
-
echo $str;
|
112 |
-
}
|
113 |
-
|
114 |
-
/**
|
115 |
-
* Checks the format of the response
|
116 |
-
*
|
117 |
-
* If Content-Type is set to application/javascript or text/javascript -> js
|
118 |
-
* If Content-Type is set to text/html, or is unset -> html
|
119 |
-
* If Content-Type is anything else -> unknown
|
120 |
-
*
|
121 |
-
* @return string One of 'js', 'html' or 'unknown'
|
122 |
-
*/
|
123 |
-
protected static function getResponseFormat()
|
124 |
-
{
|
125 |
-
// Check content type
|
126 |
-
foreach (headers_list() as $header) {
|
127 |
-
if (stripos($header, 'content-type:') === 0) {
|
128 |
-
// This handler only works with HTML and javascript outputs
|
129 |
-
// text/javascript is obsolete in favour of application/javascript, but still used
|
130 |
-
if (stripos($header, 'application/javascript') !== false || stripos($header, 'text/javascript') !== false) {
|
131 |
-
return 'js';
|
132 |
-
}
|
133 |
-
if (stripos($header, 'text/html') === false) {
|
134 |
-
return 'unknown';
|
135 |
-
}
|
136 |
-
break;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
return 'html';
|
141 |
-
}
|
142 |
-
|
143 |
-
private static function generateScript()
|
144 |
-
{
|
145 |
-
$script = array();
|
146 |
-
foreach (static::$records as $record) {
|
147 |
-
$context = static::dump('Context', $record['context']);
|
148 |
-
$extra = static::dump('Extra', $record['extra']);
|
149 |
-
|
150 |
-
if (empty($context) && empty($extra)) {
|
151 |
-
$script[] = static::call_array('log', static::handleStyles($record['formatted']));
|
152 |
-
} else {
|
153 |
-
$script = array_merge($script,
|
154 |
-
array(static::call_array('groupCollapsed', static::handleStyles($record['formatted']))),
|
155 |
-
$context,
|
156 |
-
$extra,
|
157 |
-
array(static::call('groupEnd'))
|
158 |
-
);
|
159 |
-
}
|
160 |
-
}
|
161 |
-
|
162 |
-
return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);";
|
163 |
-
}
|
164 |
-
|
165 |
-
private static function handleStyles($formatted)
|
166 |
-
{
|
167 |
-
$args = array(static::quote('font-weight: normal'));
|
168 |
-
$format = '%c' . $formatted;
|
169 |
-
preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
|
170 |
-
|
171 |
-
foreach (array_reverse($matches) as $match) {
|
172 |
-
$args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0]));
|
173 |
-
$args[] = '"font-weight: normal"';
|
174 |
-
|
175 |
-
$pos = $match[0][1];
|
176 |
-
$format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0]));
|
177 |
-
}
|
178 |
-
|
179 |
-
array_unshift($args, static::quote($format));
|
180 |
-
|
181 |
-
return $args;
|
182 |
-
}
|
183 |
-
|
184 |
-
private static function handleCustomStyles($style, $string)
|
185 |
-
{
|
186 |
-
static $colors = array('blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey');
|
187 |
-
static $labels = array();
|
188 |
-
|
189 |
-
return preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function ($m) use ($string, &$colors, &$labels) {
|
190 |
-
if (trim($m[1]) === 'autolabel') {
|
191 |
-
// Format the string as a label with consistent auto assigned background color
|
192 |
-
if (!isset($labels[$string])) {
|
193 |
-
$labels[$string] = $colors[count($labels) % count($colors)];
|
194 |
-
}
|
195 |
-
$color = $labels[$string];
|
196 |
-
|
197 |
-
return "background-color: $color; color: white; border-radius: 3px; padding: 0 2px 0 2px";
|
198 |
-
}
|
199 |
-
|
200 |
-
return $m[1];
|
201 |
-
}, $style);
|
202 |
-
}
|
203 |
-
|
204 |
-
private static function dump($title, array $dict)
|
205 |
-
{
|
206 |
-
$script = array();
|
207 |
-
$dict = array_filter($dict);
|
208 |
-
if (empty($dict)) {
|
209 |
-
return $script;
|
210 |
-
}
|
211 |
-
$script[] = static::call('log', static::quote('%c%s'), static::quote('font-weight: bold'), static::quote($title));
|
212 |
-
foreach ($dict as $key => $value) {
|
213 |
-
$value = json_encode($value);
|
214 |
-
if (empty($value)) {
|
215 |
-
$value = static::quote('');
|
216 |
-
}
|
217 |
-
$script[] = static::call('log', static::quote('%s: %o'), static::quote($key), $value);
|
218 |
-
}
|
219 |
-
|
220 |
-
return $script;
|
221 |
-
}
|
222 |
-
|
223 |
-
private static function quote($arg)
|
224 |
-
{
|
225 |
-
return '"' . addcslashes($arg, "\"\n\\") . '"';
|
226 |
-
}
|
227 |
-
|
228 |
-
private static function call()
|
229 |
-
{
|
230 |
-
$args = func_get_args();
|
231 |
-
$method = array_shift($args);
|
232 |
-
|
233 |
-
return static::call_array($method, $args);
|
234 |
-
}
|
235 |
-
|
236 |
-
private static function call_array($method, array $args)
|
237 |
-
{
|
238 |
-
return 'c.' . $method . '(' . implode(', ', $args) . ');';
|
239 |
-
}
|
240 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php
DELETED
@@ -1,129 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\ResettableInterface;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Buffers all records until closing the handler and then pass them as batch.
|
19 |
-
*
|
20 |
-
* This is useful for a MailHandler to send only one mail per request instead of
|
21 |
-
* sending one per log message.
|
22 |
-
*
|
23 |
-
* @author Christophe Coevoet <stof@notk.org>
|
24 |
-
*/
|
25 |
-
class BufferHandler extends AbstractHandler
|
26 |
-
{
|
27 |
-
protected $handler;
|
28 |
-
protected $bufferSize = 0;
|
29 |
-
protected $bufferLimit;
|
30 |
-
protected $flushOnOverflow;
|
31 |
-
protected $buffer = array();
|
32 |
-
protected $initialized = false;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @param HandlerInterface $handler Handler.
|
36 |
-
* @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
|
37 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
38 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
39 |
-
* @param bool $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded
|
40 |
-
*/
|
41 |
-
public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false)
|
42 |
-
{
|
43 |
-
parent::__construct($level, $bubble);
|
44 |
-
$this->handler = $handler;
|
45 |
-
$this->bufferLimit = (int) $bufferLimit;
|
46 |
-
$this->flushOnOverflow = $flushOnOverflow;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* {@inheritdoc}
|
51 |
-
*/
|
52 |
-
public function handle(array $record)
|
53 |
-
{
|
54 |
-
if ($record['level'] < $this->level) {
|
55 |
-
return false;
|
56 |
-
}
|
57 |
-
|
58 |
-
if (!$this->initialized) {
|
59 |
-
// __destructor() doesn't get called on Fatal errors
|
60 |
-
register_shutdown_function(array($this, 'close'));
|
61 |
-
$this->initialized = true;
|
62 |
-
}
|
63 |
-
|
64 |
-
if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) {
|
65 |
-
if ($this->flushOnOverflow) {
|
66 |
-
$this->flush();
|
67 |
-
} else {
|
68 |
-
array_shift($this->buffer);
|
69 |
-
$this->bufferSize--;
|
70 |
-
}
|
71 |
-
}
|
72 |
-
|
73 |
-
if ($this->processors) {
|
74 |
-
foreach ($this->processors as $processor) {
|
75 |
-
$record = call_user_func($processor, $record);
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
$this->buffer[] = $record;
|
80 |
-
$this->bufferSize++;
|
81 |
-
|
82 |
-
return false === $this->bubble;
|
83 |
-
}
|
84 |
-
|
85 |
-
public function flush()
|
86 |
-
{
|
87 |
-
if ($this->bufferSize === 0) {
|
88 |
-
return;
|
89 |
-
}
|
90 |
-
|
91 |
-
$this->handler->handleBatch($this->buffer);
|
92 |
-
$this->clear();
|
93 |
-
}
|
94 |
-
|
95 |
-
public function __destruct()
|
96 |
-
{
|
97 |
-
// suppress the parent behavior since we already have register_shutdown_function()
|
98 |
-
// to call close(), and the reference contained there will prevent this from being
|
99 |
-
// GC'd until the end of the request
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* {@inheritdoc}
|
104 |
-
*/
|
105 |
-
public function close()
|
106 |
-
{
|
107 |
-
$this->flush();
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Clears the buffer without flushing any messages down to the wrapped handler.
|
112 |
-
*/
|
113 |
-
public function clear()
|
114 |
-
{
|
115 |
-
$this->bufferSize = 0;
|
116 |
-
$this->buffer = array();
|
117 |
-
}
|
118 |
-
|
119 |
-
public function reset()
|
120 |
-
{
|
121 |
-
$this->flush();
|
122 |
-
|
123 |
-
parent::reset();
|
124 |
-
|
125 |
-
if ($this->handler instanceof ResettableInterface) {
|
126 |
-
$this->handler->reset();
|
127 |
-
}
|
128 |
-
}
|
129 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php
DELETED
@@ -1,211 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\ChromePHPFormatter;
|
15 |
-
use Monolog\Logger;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
|
19 |
-
*
|
20 |
-
* This also works out of the box with Firefox 43+
|
21 |
-
*
|
22 |
-
* @author Christophe Coevoet <stof@notk.org>
|
23 |
-
*/
|
24 |
-
class ChromePHPHandler extends AbstractProcessingHandler
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* Version of the extension
|
28 |
-
*/
|
29 |
-
const VERSION = '4.0';
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Header name
|
33 |
-
*/
|
34 |
-
const HEADER_NAME = 'X-ChromeLogger-Data';
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+)
|
38 |
-
*/
|
39 |
-
const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}';
|
40 |
-
|
41 |
-
protected static $initialized = false;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Tracks whether we sent too much data
|
45 |
-
*
|
46 |
-
* Chrome limits the headers to 256KB, so when we sent 240KB we stop sending
|
47 |
-
*
|
48 |
-
* @var bool
|
49 |
-
*/
|
50 |
-
protected static $overflowed = false;
|
51 |
-
|
52 |
-
protected static $json = array(
|
53 |
-
'version' => self::VERSION,
|
54 |
-
'columns' => array('label', 'log', 'backtrace', 'type'),
|
55 |
-
'rows' => array(),
|
56 |
-
);
|
57 |
-
|
58 |
-
protected static $sendHeaders = true;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
62 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
63 |
-
*/
|
64 |
-
public function __construct($level = Logger::DEBUG, $bubble = true)
|
65 |
-
{
|
66 |
-
parent::__construct($level, $bubble);
|
67 |
-
if (!function_exists('json_encode')) {
|
68 |
-
throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s ChromePHPHandler');
|
69 |
-
}
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* {@inheritdoc}
|
74 |
-
*/
|
75 |
-
public function handleBatch(array $records)
|
76 |
-
{
|
77 |
-
$messages = array();
|
78 |
-
|
79 |
-
foreach ($records as $record) {
|
80 |
-
if ($record['level'] < $this->level) {
|
81 |
-
continue;
|
82 |
-
}
|
83 |
-
$messages[] = $this->processRecord($record);
|
84 |
-
}
|
85 |
-
|
86 |
-
if (!empty($messages)) {
|
87 |
-
$messages = $this->getFormatter()->formatBatch($messages);
|
88 |
-
self::$json['rows'] = array_merge(self::$json['rows'], $messages);
|
89 |
-
$this->send();
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* {@inheritDoc}
|
95 |
-
*/
|
96 |
-
protected function getDefaultFormatter()
|
97 |
-
{
|
98 |
-
return new ChromePHPFormatter();
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Creates & sends header for a record
|
103 |
-
*
|
104 |
-
* @see sendHeader()
|
105 |
-
* @see send()
|
106 |
-
* @param array $record
|
107 |
-
*/
|
108 |
-
protected function write(array $record)
|
109 |
-
{
|
110 |
-
self::$json['rows'][] = $record['formatted'];
|
111 |
-
|
112 |
-
$this->send();
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Sends the log header
|
117 |
-
*
|
118 |
-
* @see sendHeader()
|
119 |
-
*/
|
120 |
-
protected function send()
|
121 |
-
{
|
122 |
-
if (self::$overflowed || !self::$sendHeaders) {
|
123 |
-
return;
|
124 |
-
}
|
125 |
-
|
126 |
-
if (!self::$initialized) {
|
127 |
-
self::$initialized = true;
|
128 |
-
|
129 |
-
self::$sendHeaders = $this->headersAccepted();
|
130 |
-
if (!self::$sendHeaders) {
|
131 |
-
return;
|
132 |
-
}
|
133 |
-
|
134 |
-
self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
135 |
-
}
|
136 |
-
|
137 |
-
$json = @json_encode(self::$json);
|
138 |
-
$data = base64_encode(utf8_encode($json));
|
139 |
-
if (strlen($data) > 240 * 1024) {
|
140 |
-
self::$overflowed = true;
|
141 |
-
|
142 |
-
$record = array(
|
143 |
-
'message' => 'Incomplete logs, chrome header size limit reached',
|
144 |
-
'context' => array(),
|
145 |
-
'level' => Logger::WARNING,
|
146 |
-
'level_name' => Logger::getLevelName(Logger::WARNING),
|
147 |
-
'channel' => 'monolog',
|
148 |
-
'datetime' => new \DateTime(),
|
149 |
-
'extra' => array(),
|
150 |
-
);
|
151 |
-
self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);
|
152 |
-
$json = @json_encode(self::$json);
|
153 |
-
$data = base64_encode(utf8_encode($json));
|
154 |
-
}
|
155 |
-
|
156 |
-
if (trim($data) !== '') {
|
157 |
-
$this->sendHeader(self::HEADER_NAME, $data);
|
158 |
-
}
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Send header string to the client
|
163 |
-
*
|
164 |
-
* @param string $header
|
165 |
-
* @param string $content
|
166 |
-
*/
|
167 |
-
protected function sendHeader($header, $content)
|
168 |
-
{
|
169 |
-
if (!headers_sent() && self::$sendHeaders) {
|
170 |
-
header(sprintf('%s: %s', $header, $content));
|
171 |
-
}
|
172 |
-
}
|
173 |
-
|
174 |
-
/**
|
175 |
-
* Verifies if the headers are accepted by the current user agent
|
176 |
-
*
|
177 |
-
* @return bool
|
178 |
-
*/
|
179 |
-
protected function headersAccepted()
|
180 |
-
{
|
181 |
-
if (empty($_SERVER['HTTP_USER_AGENT'])) {
|
182 |
-
return false;
|
183 |
-
}
|
184 |
-
|
185 |
-
return preg_match(self::USER_AGENT_REGEX, $_SERVER['HTTP_USER_AGENT']);
|
186 |
-
}
|
187 |
-
|
188 |
-
/**
|
189 |
-
* BC getter for the sendHeaders property that has been made static
|
190 |
-
*/
|
191 |
-
public function __get($property)
|
192 |
-
{
|
193 |
-
if ('sendHeaders' !== $property) {
|
194 |
-
throw new \InvalidArgumentException('Undefined property '.$property);
|
195 |
-
}
|
196 |
-
|
197 |
-
return static::$sendHeaders;
|
198 |
-
}
|
199 |
-
|
200 |
-
/**
|
201 |
-
* BC setter for the sendHeaders property that has been made static
|
202 |
-
*/
|
203 |
-
public function __set($property, $value)
|
204 |
-
{
|
205 |
-
if ('sendHeaders' !== $property) {
|
206 |
-
throw new \InvalidArgumentException('Undefined property '.$property);
|
207 |
-
}
|
208 |
-
|
209 |
-
static::$sendHeaders = $value;
|
210 |
-
}
|
211 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\JsonFormatter;
|
15 |
-
use Monolog\Logger;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* CouchDB handler
|
19 |
-
*
|
20 |
-
* @author Markus Bachmann <markus.bachmann@bachi.biz>
|
21 |
-
*/
|
22 |
-
class CouchDBHandler extends AbstractProcessingHandler
|
23 |
-
{
|
24 |
-
private $options;
|
25 |
-
|
26 |
-
public function __construct(array $options = array(), $level = Logger::DEBUG, $bubble = true)
|
27 |
-
{
|
28 |
-
$this->options = array_merge(array(
|
29 |
-
'host' => 'localhost',
|
30 |
-
'port' => 5984,
|
31 |
-
'dbname' => 'logger',
|
32 |
-
'username' => null,
|
33 |
-
'password' => null,
|
34 |
-
), $options);
|
35 |
-
|
36 |
-
parent::__construct($level, $bubble);
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* {@inheritDoc}
|
41 |
-
*/
|
42 |
-
protected function write(array $record)
|
43 |
-
{
|
44 |
-
$basicAuth = null;
|
45 |
-
if ($this->options['username']) {
|
46 |
-
$basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']);
|
47 |
-
}
|
48 |
-
|
49 |
-
$url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname'];
|
50 |
-
$context = stream_context_create(array(
|
51 |
-
'http' => array(
|
52 |
-
'method' => 'POST',
|
53 |
-
'content' => $record['formatted'],
|
54 |
-
'ignore_errors' => true,
|
55 |
-
'max_redirects' => 0,
|
56 |
-
'header' => 'Content-type: application/json',
|
57 |
-
),
|
58 |
-
));
|
59 |
-
|
60 |
-
if (false === @file_get_contents($url, null, $context)) {
|
61 |
-
throw new \RuntimeException(sprintf('Could not connect to %s', $url));
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* {@inheritDoc}
|
67 |
-
*/
|
68 |
-
protected function getDefaultFormatter()
|
69 |
-
{
|
70 |
-
return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);
|
71 |
-
}
|
72 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php
DELETED
@@ -1,151 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Logs to Cube.
|
18 |
-
*
|
19 |
-
* @link http://square.github.com/cube/
|
20 |
-
* @author Wan Chen <kami@kamisama.me>
|
21 |
-
*/
|
22 |
-
class CubeHandler extends AbstractProcessingHandler
|
23 |
-
{
|
24 |
-
private $udpConnection;
|
25 |
-
private $httpConnection;
|
26 |
-
private $scheme;
|
27 |
-
private $host;
|
28 |
-
private $port;
|
29 |
-
private $acceptedSchemes = array('http', 'udp');
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Create a Cube handler
|
33 |
-
*
|
34 |
-
* @throws \UnexpectedValueException when given url is not a valid url.
|
35 |
-
* A valid url must consist of three parts : protocol://host:port
|
36 |
-
* Only valid protocols used by Cube are http and udp
|
37 |
-
*/
|
38 |
-
public function __construct($url, $level = Logger::DEBUG, $bubble = true)
|
39 |
-
{
|
40 |
-
$urlInfo = parse_url($url);
|
41 |
-
|
42 |
-
if (!isset($urlInfo['scheme'], $urlInfo['host'], $urlInfo['port'])) {
|
43 |
-
throw new \UnexpectedValueException('URL "'.$url.'" is not valid');
|
44 |
-
}
|
45 |
-
|
46 |
-
if (!in_array($urlInfo['scheme'], $this->acceptedSchemes)) {
|
47 |
-
throw new \UnexpectedValueException(
|
48 |
-
'Invalid protocol (' . $urlInfo['scheme'] . ').'
|
49 |
-
. ' Valid options are ' . implode(', ', $this->acceptedSchemes));
|
50 |
-
}
|
51 |
-
|
52 |
-
$this->scheme = $urlInfo['scheme'];
|
53 |
-
$this->host = $urlInfo['host'];
|
54 |
-
$this->port = $urlInfo['port'];
|
55 |
-
|
56 |
-
parent::__construct($level, $bubble);
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Establish a connection to an UDP socket
|
61 |
-
*
|
62 |
-
* @throws \LogicException when unable to connect to the socket
|
63 |
-
* @throws MissingExtensionException when there is no socket extension
|
64 |
-
*/
|
65 |
-
protected function connectUdp()
|
66 |
-
{
|
67 |
-
if (!extension_loaded('sockets')) {
|
68 |
-
throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler');
|
69 |
-
}
|
70 |
-
|
71 |
-
$this->udpConnection = socket_create(AF_INET, SOCK_DGRAM, 0);
|
72 |
-
if (!$this->udpConnection) {
|
73 |
-
throw new \LogicException('Unable to create a socket');
|
74 |
-
}
|
75 |
-
|
76 |
-
if (!socket_connect($this->udpConnection, $this->host, $this->port)) {
|
77 |
-
throw new \LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port);
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Establish a connection to a http server
|
83 |
-
* @throws \LogicException when no curl extension
|
84 |
-
*/
|
85 |
-
protected function connectHttp()
|
86 |
-
{
|
87 |
-
if (!extension_loaded('curl')) {
|
88 |
-
throw new \LogicException('The curl extension is needed to use http URLs with the CubeHandler');
|
89 |
-
}
|
90 |
-
|
91 |
-
$this->httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put');
|
92 |
-
|
93 |
-
if (!$this->httpConnection) {
|
94 |
-
throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port);
|
95 |
-
}
|
96 |
-
|
97 |
-
curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, "POST");
|
98 |
-
curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true);
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* {@inheritdoc}
|
103 |
-
*/
|
104 |
-
protected function write(array $record)
|
105 |
-
{
|
106 |
-
$date = $record['datetime'];
|
107 |
-
|
108 |
-
$data = array('time' => $date->format('Y-m-d\TH:i:s.uO'));
|
109 |
-
unset($record['datetime']);
|
110 |
-
|
111 |
-
if (isset($record['context']['type'])) {
|
112 |
-
$data['type'] = $record['context']['type'];
|
113 |
-
unset($record['context']['type']);
|
114 |
-
} else {
|
115 |
-
$data['type'] = $record['channel'];
|
116 |
-
}
|
117 |
-
|
118 |
-
$data['data'] = $record['context'];
|
119 |
-
$data['data']['level'] = $record['level'];
|
120 |
-
|
121 |
-
if ($this->scheme === 'http') {
|
122 |
-
$this->writeHttp(json_encode($data));
|
123 |
-
} else {
|
124 |
-
$this->writeUdp(json_encode($data));
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
private function writeUdp($data)
|
129 |
-
{
|
130 |
-
if (!$this->udpConnection) {
|
131 |
-
$this->connectUdp();
|
132 |
-
}
|
133 |
-
|
134 |
-
socket_send($this->udpConnection, $data, strlen($data), 0);
|
135 |
-
}
|
136 |
-
|
137 |
-
private function writeHttp($data)
|
138 |
-
{
|
139 |
-
if (!$this->httpConnection) {
|
140 |
-
$this->connectHttp();
|
141 |
-
}
|
142 |
-
|
143 |
-
curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']');
|
144 |
-
curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array(
|
145 |
-
'Content-Type: application/json',
|
146 |
-
'Content-Length: ' . strlen('['.$data.']'),
|
147 |
-
));
|
148 |
-
|
149 |
-
Curl\Util::execute($this->httpConnection, 5, false);
|
150 |
-
}
|
151 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler\Curl;
|
13 |
-
|
14 |
-
class Util
|
15 |
-
{
|
16 |
-
private static $retriableErrorCodes = array(
|
17 |
-
CURLE_COULDNT_RESOLVE_HOST,
|
18 |
-
CURLE_COULDNT_CONNECT,
|
19 |
-
CURLE_HTTP_NOT_FOUND,
|
20 |
-
CURLE_READ_ERROR,
|
21 |
-
CURLE_OPERATION_TIMEOUTED,
|
22 |
-
CURLE_HTTP_POST_ERROR,
|
23 |
-
CURLE_SSL_CONNECT_ERROR,
|
24 |
-
);
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Executes a CURL request with optional retries and exception on failure
|
28 |
-
*
|
29 |
-
* @param resource $ch curl handler
|
30 |
-
* @throws \RuntimeException
|
31 |
-
*/
|
32 |
-
public static function execute($ch, $retries = 5, $closeAfterDone = true)
|
33 |
-
{
|
34 |
-
while ($retries--) {
|
35 |
-
if (curl_exec($ch) === false) {
|
36 |
-
$curlErrno = curl_errno($ch);
|
37 |
-
|
38 |
-
if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || !$retries) {
|
39 |
-
$curlError = curl_error($ch);
|
40 |
-
|
41 |
-
if ($closeAfterDone) {
|
42 |
-
curl_close($ch);
|
43 |
-
}
|
44 |
-
|
45 |
-
throw new \RuntimeException(sprintf('Curl error (code %s): %s', $curlErrno, $curlError));
|
46 |
-
}
|
47 |
-
|
48 |
-
continue;
|
49 |
-
}
|
50 |
-
|
51 |
-
if ($closeAfterDone) {
|
52 |
-
curl_close($ch);
|
53 |
-
}
|
54 |
-
break;
|
55 |
-
}
|
56 |
-
}
|
57 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php
DELETED
@@ -1,169 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Simple handler wrapper that deduplicates log records across multiple requests
|
18 |
-
*
|
19 |
-
* It also includes the BufferHandler functionality and will buffer
|
20 |
-
* all messages until the end of the request or flush() is called.
|
21 |
-
*
|
22 |
-
* This works by storing all log records' messages above $deduplicationLevel
|
23 |
-
* to the file specified by $deduplicationStore. When further logs come in at the end of the
|
24 |
-
* request (or when flush() is called), all those above $deduplicationLevel are checked
|
25 |
-
* against the existing stored logs. If they match and the timestamps in the stored log is
|
26 |
-
* not older than $time seconds, the new log record is discarded. If no log record is new, the
|
27 |
-
* whole data set is discarded.
|
28 |
-
*
|
29 |
-
* This is mainly useful in combination with Mail handlers or things like Slack or HipChat handlers
|
30 |
-
* that send messages to people, to avoid spamming with the same message over and over in case of
|
31 |
-
* a major component failure like a database server being down which makes all requests fail in the
|
32 |
-
* same way.
|
33 |
-
*
|
34 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
35 |
-
*/
|
36 |
-
class DeduplicationHandler extends BufferHandler
|
37 |
-
{
|
38 |
-
/**
|
39 |
-
* @var string
|
40 |
-
*/
|
41 |
-
protected $deduplicationStore;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @var int
|
45 |
-
*/
|
46 |
-
protected $deduplicationLevel;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @var int
|
50 |
-
*/
|
51 |
-
protected $time;
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @var bool
|
55 |
-
*/
|
56 |
-
private $gc = false;
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @param HandlerInterface $handler Handler.
|
60 |
-
* @param string $deduplicationStore The file/path where the deduplication log should be kept
|
61 |
-
* @param int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes
|
62 |
-
* @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through
|
63 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
64 |
-
*/
|
65 |
-
public function __construct(HandlerInterface $handler, $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, $time = 60, $bubble = true)
|
66 |
-
{
|
67 |
-
parent::__construct($handler, 0, Logger::DEBUG, $bubble, false);
|
68 |
-
|
69 |
-
$this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) .'.log' : $deduplicationStore;
|
70 |
-
$this->deduplicationLevel = Logger::toMonologLevel($deduplicationLevel);
|
71 |
-
$this->time = $time;
|
72 |
-
}
|
73 |
-
|
74 |
-
public function flush()
|
75 |
-
{
|
76 |
-
if ($this->bufferSize === 0) {
|
77 |
-
return;
|
78 |
-
}
|
79 |
-
|
80 |
-
$passthru = null;
|
81 |
-
|
82 |
-
foreach ($this->buffer as $record) {
|
83 |
-
if ($record['level'] >= $this->deduplicationLevel) {
|
84 |
-
|
85 |
-
$passthru = $passthru || !$this->isDuplicate($record);
|
86 |
-
if ($passthru) {
|
87 |
-
$this->appendRecord($record);
|
88 |
-
}
|
89 |
-
}
|
90 |
-
}
|
91 |
-
|
92 |
-
// default of null is valid as well as if no record matches duplicationLevel we just pass through
|
93 |
-
if ($passthru === true || $passthru === null) {
|
94 |
-
$this->handler->handleBatch($this->buffer);
|
95 |
-
}
|
96 |
-
|
97 |
-
$this->clear();
|
98 |
-
|
99 |
-
if ($this->gc) {
|
100 |
-
$this->collectLogs();
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
private function isDuplicate(array $record)
|
105 |
-
{
|
106 |
-
if (!file_exists($this->deduplicationStore)) {
|
107 |
-
return false;
|
108 |
-
}
|
109 |
-
|
110 |
-
$store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
111 |
-
if (!is_array($store)) {
|
112 |
-
return false;
|
113 |
-
}
|
114 |
-
|
115 |
-
$yesterday = time() - 86400;
|
116 |
-
$timestampValidity = $record['datetime']->getTimestamp() - $this->time;
|
117 |
-
$expectedMessage = preg_replace('{[\r\n].*}', '', $record['message']);
|
118 |
-
|
119 |
-
for ($i = count($store) - 1; $i >= 0; $i--) {
|
120 |
-
list($timestamp, $level, $message) = explode(':', $store[$i], 3);
|
121 |
-
|
122 |
-
if ($level === $record['level_name'] && $message === $expectedMessage && $timestamp > $timestampValidity) {
|
123 |
-
return true;
|
124 |
-
}
|
125 |
-
|
126 |
-
if ($timestamp < $yesterday) {
|
127 |
-
$this->gc = true;
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
return false;
|
132 |
-
}
|
133 |
-
|
134 |
-
private function collectLogs()
|
135 |
-
{
|
136 |
-
if (!file_exists($this->deduplicationStore)) {
|
137 |
-
return false;
|
138 |
-
}
|
139 |
-
|
140 |
-
$handle = fopen($this->deduplicationStore, 'rw+');
|
141 |
-
flock($handle, LOCK_EX);
|
142 |
-
$validLogs = array();
|
143 |
-
|
144 |
-
$timestampValidity = time() - $this->time;
|
145 |
-
|
146 |
-
while (!feof($handle)) {
|
147 |
-
$log = fgets($handle);
|
148 |
-
if (substr($log, 0, 10) >= $timestampValidity) {
|
149 |
-
$validLogs[] = $log;
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
ftruncate($handle, 0);
|
154 |
-
rewind($handle);
|
155 |
-
foreach ($validLogs as $log) {
|
156 |
-
fwrite($handle, $log);
|
157 |
-
}
|
158 |
-
|
159 |
-
flock($handle, LOCK_UN);
|
160 |
-
fclose($handle);
|
161 |
-
|
162 |
-
$this->gc = false;
|
163 |
-
}
|
164 |
-
|
165 |
-
private function appendRecord(array $record)
|
166 |
-
{
|
167 |
-
file_put_contents($this->deduplicationStore, $record['datetime']->getTimestamp() . ':' . $record['level_name'] . ':' . preg_replace('{[\r\n].*}', '', $record['message']) . "\n", FILE_APPEND);
|
168 |
-
}
|
169 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\NormalizerFormatter;
|
16 |
-
use Doctrine\CouchDB\CouchDBClient;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* CouchDB handler for Doctrine CouchDB ODM
|
20 |
-
*
|
21 |
-
* @author Markus Bachmann <markus.bachmann@bachi.biz>
|
22 |
-
*/
|
23 |
-
class DoctrineCouchDBHandler extends AbstractProcessingHandler
|
24 |
-
{
|
25 |
-
private $client;
|
26 |
-
|
27 |
-
public function __construct(CouchDBClient $client, $level = Logger::DEBUG, $bubble = true)
|
28 |
-
{
|
29 |
-
$this->client = $client;
|
30 |
-
parent::__construct($level, $bubble);
|
31 |
-
}
|
32 |
-
|
33 |
-
/**
|
34 |
-
* {@inheritDoc}
|
35 |
-
*/
|
36 |
-
protected function write(array $record)
|
37 |
-
{
|
38 |
-
$this->client->postDocument($record['formatted']);
|
39 |
-
}
|
40 |
-
|
41 |
-
protected function getDefaultFormatter()
|
42 |
-
{
|
43 |
-
return new NormalizerFormatter;
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Aws\Sdk;
|
15 |
-
use Aws\DynamoDb\DynamoDbClient;
|
16 |
-
use Aws\DynamoDb\Marshaler;
|
17 |
-
use Monolog\Formatter\ScalarFormatter;
|
18 |
-
use Monolog\Logger;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/)
|
22 |
-
*
|
23 |
-
* @link https://github.com/aws/aws-sdk-php/
|
24 |
-
* @author Andrew Lawson <adlawson@gmail.com>
|
25 |
-
*/
|
26 |
-
class DynamoDbHandler extends AbstractProcessingHandler
|
27 |
-
{
|
28 |
-
const DATE_FORMAT = 'Y-m-d\TH:i:s.uO';
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @var DynamoDbClient
|
32 |
-
*/
|
33 |
-
protected $client;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* @var string
|
37 |
-
*/
|
38 |
-
protected $table;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @var int
|
42 |
-
*/
|
43 |
-
protected $version;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @var Marshaler
|
47 |
-
*/
|
48 |
-
protected $marshaler;
|
49 |
-
|
50 |
-
/**
|
51 |
-
* @param DynamoDbClient $client
|
52 |
-
* @param string $table
|
53 |
-
* @param int $level
|
54 |
-
* @param bool $bubble
|
55 |
-
*/
|
56 |
-
public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true)
|
57 |
-
{
|
58 |
-
if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) {
|
59 |
-
$this->version = 3;
|
60 |
-
$this->marshaler = new Marshaler;
|
61 |
-
} else {
|
62 |
-
$this->version = 2;
|
63 |
-
}
|
64 |
-
|
65 |
-
$this->client = $client;
|
66 |
-
$this->table = $table;
|
67 |
-
|
68 |
-
parent::__construct($level, $bubble);
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* {@inheritdoc}
|
73 |
-
*/
|
74 |
-
protected function write(array $record)
|
75 |
-
{
|
76 |
-
$filtered = $this->filterEmptyFields($record['formatted']);
|
77 |
-
if ($this->version === 3) {
|
78 |
-
$formatted = $this->marshaler->marshalItem($filtered);
|
79 |
-
} else {
|
80 |
-
$formatted = $this->client->formatAttributes($filtered);
|
81 |
-
}
|
82 |
-
|
83 |
-
$this->client->putItem(array(
|
84 |
-
'TableName' => $this->table,
|
85 |
-
'Item' => $formatted,
|
86 |
-
));
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* @param array $record
|
91 |
-
* @return array
|
92 |
-
*/
|
93 |
-
protected function filterEmptyFields(array $record)
|
94 |
-
{
|
95 |
-
return array_filter($record, function ($value) {
|
96 |
-
return !empty($value) || false === $value || 0 === $value;
|
97 |
-
});
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* {@inheritdoc}
|
102 |
-
*/
|
103 |
-
protected function getDefaultFormatter()
|
104 |
-
{
|
105 |
-
return new ScalarFormatter(self::DATE_FORMAT);
|
106 |
-
}
|
107 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php
DELETED
@@ -1,128 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\FormatterInterface;
|
15 |
-
use Monolog\Formatter\ElasticaFormatter;
|
16 |
-
use Monolog\Logger;
|
17 |
-
use Elastica\Client;
|
18 |
-
use Elastica\Exception\ExceptionInterface;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Elastic Search handler
|
22 |
-
*
|
23 |
-
* Usage example:
|
24 |
-
*
|
25 |
-
* $client = new \Elastica\Client();
|
26 |
-
* $options = array(
|
27 |
-
* 'index' => 'elastic_index_name',
|
28 |
-
* 'type' => 'elastic_doc_type',
|
29 |
-
* );
|
30 |
-
* $handler = new ElasticSearchHandler($client, $options);
|
31 |
-
* $log = new Logger('application');
|
32 |
-
* $log->pushHandler($handler);
|
33 |
-
*
|
34 |
-
* @author Jelle Vink <jelle.vink@gmail.com>
|
35 |
-
*/
|
36 |
-
class ElasticSearchHandler extends AbstractProcessingHandler
|
37 |
-
{
|
38 |
-
/**
|
39 |
-
* @var Client
|
40 |
-
*/
|
41 |
-
protected $client;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @var array Handler config options
|
45 |
-
*/
|
46 |
-
protected $options = array();
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @param Client $client Elastica Client object
|
50 |
-
* @param array $options Handler configuration
|
51 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
52 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
53 |
-
*/
|
54 |
-
public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true)
|
55 |
-
{
|
56 |
-
parent::__construct($level, $bubble);
|
57 |
-
$this->client = $client;
|
58 |
-
$this->options = array_merge(
|
59 |
-
array(
|
60 |
-
'index' => 'monolog', // Elastic index name
|
61 |
-
'type' => 'record', // Elastic document type
|
62 |
-
'ignore_error' => false, // Suppress Elastica exceptions
|
63 |
-
),
|
64 |
-
$options
|
65 |
-
);
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* {@inheritDoc}
|
70 |
-
*/
|
71 |
-
protected function write(array $record)
|
72 |
-
{
|
73 |
-
$this->bulkSend(array($record['formatted']));
|
74 |
-
}
|
75 |
-
|
76 |
-
/**
|
77 |
-
* {@inheritdoc}
|
78 |
-
*/
|
79 |
-
public function setFormatter(FormatterInterface $formatter)
|
80 |
-
{
|
81 |
-
if ($formatter instanceof ElasticaFormatter) {
|
82 |
-
return parent::setFormatter($formatter);
|
83 |
-
}
|
84 |
-
throw new \InvalidArgumentException('ElasticSearchHandler is only compatible with ElasticaFormatter');
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Getter options
|
89 |
-
* @return array
|
90 |
-
*/
|
91 |
-
public function getOptions()
|
92 |
-
{
|
93 |
-
return $this->options;
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* {@inheritDoc}
|
98 |
-
*/
|
99 |
-
protected function getDefaultFormatter()
|
100 |
-
{
|
101 |
-
return new ElasticaFormatter($this->options['index'], $this->options['type']);
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* {@inheritdoc}
|
106 |
-
*/
|
107 |
-
public function handleBatch(array $records)
|
108 |
-
{
|
109 |
-
$documents = $this->getFormatter()->formatBatch($records);
|
110 |
-
$this->bulkSend($documents);
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Use Elasticsearch bulk API to send list of documents
|
115 |
-
* @param array $documents
|
116 |
-
* @throws \RuntimeException
|
117 |
-
*/
|
118 |
-
protected function bulkSend(array $documents)
|
119 |
-
{
|
120 |
-
try {
|
121 |
-
$this->client->addDocuments($documents);
|
122 |
-
} catch (ExceptionInterface $e) {
|
123 |
-
if (!$this->options['ignore_error']) {
|
124 |
-
throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e);
|
125 |
-
}
|
126 |
-
}
|
127 |
-
}
|
128 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\LineFormatter;
|
15 |
-
use Monolog\Logger;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Stores to PHP error_log() handler.
|
19 |
-
*
|
20 |
-
* @author Elan Ruusamäe <glen@delfi.ee>
|
21 |
-
*/
|
22 |
-
class ErrorLogHandler extends AbstractProcessingHandler
|
23 |
-
{
|
24 |
-
const OPERATING_SYSTEM = 0;
|
25 |
-
const SAPI = 4;
|
26 |
-
|
27 |
-
protected $messageType;
|
28 |
-
protected $expandNewlines;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @param int $messageType Says where the error should go.
|
32 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
33 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
34 |
-
* @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries
|
35 |
-
*/
|
36 |
-
public function __construct($messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, $bubble = true, $expandNewlines = false)
|
37 |
-
{
|
38 |
-
parent::__construct($level, $bubble);
|
39 |
-
|
40 |
-
if (false === in_array($messageType, self::getAvailableTypes())) {
|
41 |
-
$message = sprintf('The given message type "%s" is not supported', print_r($messageType, true));
|
42 |
-
throw new \InvalidArgumentException($message);
|
43 |
-
}
|
44 |
-
|
45 |
-
$this->messageType = $messageType;
|
46 |
-
$this->expandNewlines = $expandNewlines;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* @return array With all available types
|
51 |
-
*/
|
52 |
-
public static function getAvailableTypes()
|
53 |
-
{
|
54 |
-
return array(
|
55 |
-
self::OPERATING_SYSTEM,
|
56 |
-
self::SAPI,
|
57 |
-
);
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* {@inheritDoc}
|
62 |
-
*/
|
63 |
-
protected function getDefaultFormatter()
|
64 |
-
{
|
65 |
-
return new LineFormatter('[%datetime%] %channel%.%level_name%: %message% %context% %extra%');
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* {@inheritdoc}
|
70 |
-
*/
|
71 |
-
protected function write(array $record)
|
72 |
-
{
|
73 |
-
if ($this->expandNewlines) {
|
74 |
-
$lines = preg_split('{[\r\n]+}', (string) $record['formatted']);
|
75 |
-
foreach ($lines as $line) {
|
76 |
-
error_log($line, $this->messageType);
|
77 |
-
}
|
78 |
-
} else {
|
79 |
-
error_log((string) $record['formatted'], $this->messageType);
|
80 |
-
}
|
81 |
-
}
|
82 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Simple handler wrapper that filters records based on a list of levels
|
18 |
-
*
|
19 |
-
* It can be configured with an exact list of levels to allow, or a min/max level.
|
20 |
-
*
|
21 |
-
* @author Hennadiy Verkh
|
22 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
23 |
-
*/
|
24 |
-
class FilterHandler extends AbstractHandler
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* Handler or factory callable($record, $this)
|
28 |
-
*
|
29 |
-
* @var callable|\Monolog\Handler\HandlerInterface
|
30 |
-
*/
|
31 |
-
protected $handler;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Minimum level for logs that are passed to handler
|
35 |
-
*
|
36 |
-
* @var int[]
|
37 |
-
*/
|
38 |
-
protected $acceptedLevels;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Whether the messages that are handled can bubble up the stack or not
|
42 |
-
*
|
43 |
-
* @var bool
|
44 |
-
*/
|
45 |
-
protected $bubble;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @param callable|HandlerInterface $handler Handler or factory callable($record, $this).
|
49 |
-
* @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
|
50 |
-
* @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
|
51 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
52 |
-
*/
|
53 |
-
public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true)
|
54 |
-
{
|
55 |
-
$this->handler = $handler;
|
56 |
-
$this->bubble = $bubble;
|
57 |
-
$this->setAcceptedLevels($minLevelOrList, $maxLevel);
|
58 |
-
|
59 |
-
if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
|
60 |
-
throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* @return array
|
66 |
-
*/
|
67 |
-
public function getAcceptedLevels()
|
68 |
-
{
|
69 |
-
return array_flip($this->acceptedLevels);
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* @param int|string|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided
|
74 |
-
* @param int|string $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array
|
75 |
-
*/
|
76 |
-
public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY)
|
77 |
-
{
|
78 |
-
if (is_array($minLevelOrList)) {
|
79 |
-
$acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList);
|
80 |
-
} else {
|
81 |
-
$minLevelOrList = Logger::toMonologLevel($minLevelOrList);
|
82 |
-
$maxLevel = Logger::toMonologLevel($maxLevel);
|
83 |
-
$acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) {
|
84 |
-
return $level >= $minLevelOrList && $level <= $maxLevel;
|
85 |
-
}));
|
86 |
-
}
|
87 |
-
$this->acceptedLevels = array_flip($acceptedLevels);
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* {@inheritdoc}
|
92 |
-
*/
|
93 |
-
public function isHandling(array $record)
|
94 |
-
{
|
95 |
-
return isset($this->acceptedLevels[$record['level']]);
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* {@inheritdoc}
|
100 |
-
*/
|
101 |
-
public function handle(array $record)
|
102 |
-
{
|
103 |
-
if (!$this->isHandling($record)) {
|
104 |
-
return false;
|
105 |
-
}
|
106 |
-
|
107 |
-
// The same logic as in FingersCrossedHandler
|
108 |
-
if (!$this->handler instanceof HandlerInterface) {
|
109 |
-
$this->handler = call_user_func($this->handler, $record, $this);
|
110 |
-
if (!$this->handler instanceof HandlerInterface) {
|
111 |
-
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
-
if ($this->processors) {
|
116 |
-
foreach ($this->processors as $processor) {
|
117 |
-
$record = call_user_func($processor, $record);
|
118 |
-
}
|
119 |
-
}
|
120 |
-
|
121 |
-
$this->handler->handle($record);
|
122 |
-
|
123 |
-
return false === $this->bubble;
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* {@inheritdoc}
|
128 |
-
*/
|
129 |
-
public function handleBatch(array $records)
|
130 |
-
{
|
131 |
-
$filtered = array();
|
132 |
-
foreach ($records as $record) {
|
133 |
-
if ($this->isHandling($record)) {
|
134 |
-
$filtered[] = $record;
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
$this->handler->handleBatch($filtered);
|
139 |
-
}
|
140 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler\FingersCrossed;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Interface for activation strategies for the FingersCrossedHandler.
|
16 |
-
*
|
17 |
-
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
18 |
-
*/
|
19 |
-
interface ActivationStrategyInterface
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* Returns whether the given record activates the handler.
|
23 |
-
*
|
24 |
-
* @param array $record
|
25 |
-
* @return bool
|
26 |
-
*/
|
27 |
-
public function isHandlerActivated(array $record);
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler\FingersCrossed;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Channel and Error level based monolog activation strategy. Allows to trigger activation
|
18 |
-
* based on level per channel. e.g. trigger activation on level 'ERROR' by default, except
|
19 |
-
* for records of the 'sql' channel; those should trigger activation on level 'WARN'.
|
20 |
-
*
|
21 |
-
* Example:
|
22 |
-
*
|
23 |
-
* <code>
|
24 |
-
* $activationStrategy = new ChannelLevelActivationStrategy(
|
25 |
-
* Logger::CRITICAL,
|
26 |
-
* array(
|
27 |
-
* 'request' => Logger::ALERT,
|
28 |
-
* 'sensitive' => Logger::ERROR,
|
29 |
-
* )
|
30 |
-
* );
|
31 |
-
* $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy);
|
32 |
-
* </code>
|
33 |
-
*
|
34 |
-
* @author Mike Meessen <netmikey@gmail.com>
|
35 |
-
*/
|
36 |
-
class ChannelLevelActivationStrategy implements ActivationStrategyInterface
|
37 |
-
{
|
38 |
-
private $defaultActionLevel;
|
39 |
-
private $channelToActionLevel;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any
|
43 |
-
* @param array $channelToActionLevel An array that maps channel names to action levels.
|
44 |
-
*/
|
45 |
-
public function __construct($defaultActionLevel, $channelToActionLevel = array())
|
46 |
-
{
|
47 |
-
$this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel);
|
48 |
-
$this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel);
|
49 |
-
}
|
50 |
-
|
51 |
-
public function isHandlerActivated(array $record)
|
52 |
-
{
|
53 |
-
if (isset($this->channelToActionLevel[$record['channel']])) {
|
54 |
-
return $record['level'] >= $this->channelToActionLevel[$record['channel']];
|
55 |
-
}
|
56 |
-
|
57 |
-
return $record['level'] >= $this->defaultActionLevel;
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler\FingersCrossed;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Error level based activation strategy.
|
18 |
-
*
|
19 |
-
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
20 |
-
*/
|
21 |
-
class ErrorLevelActivationStrategy implements ActivationStrategyInterface
|
22 |
-
{
|
23 |
-
private $actionLevel;
|
24 |
-
|
25 |
-
public function __construct($actionLevel)
|
26 |
-
{
|
27 |
-
$this->actionLevel = Logger::toMonologLevel($actionLevel);
|
28 |
-
}
|
29 |
-
|
30 |
-
public function isHandlerActivated(array $record)
|
31 |
-
{
|
32 |
-
return $record['level'] >= $this->actionLevel;
|
33 |
-
}
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php
DELETED
@@ -1,177 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
|
15 |
-
use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
|
16 |
-
use Monolog\Logger;
|
17 |
-
use Monolog\ResettableInterface;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Buffers all records until a certain level is reached
|
21 |
-
*
|
22 |
-
* The advantage of this approach is that you don't get any clutter in your log files.
|
23 |
-
* Only requests which actually trigger an error (or whatever your actionLevel is) will be
|
24 |
-
* in the logs, but they will contain all records, not only those above the level threshold.
|
25 |
-
*
|
26 |
-
* You can find the various activation strategies in the
|
27 |
-
* Monolog\Handler\FingersCrossed\ namespace.
|
28 |
-
*
|
29 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
30 |
-
*/
|
31 |
-
class FingersCrossedHandler extends AbstractHandler
|
32 |
-
{
|
33 |
-
protected $handler;
|
34 |
-
protected $activationStrategy;
|
35 |
-
protected $buffering = true;
|
36 |
-
protected $bufferSize;
|
37 |
-
protected $buffer = array();
|
38 |
-
protected $stopBuffering;
|
39 |
-
protected $passthruLevel;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
|
43 |
-
* @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
|
44 |
-
* @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
|
45 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
46 |
-
* @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true)
|
47 |
-
* @param int $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered
|
48 |
-
*/
|
49 |
-
public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true, $passthruLevel = null)
|
50 |
-
{
|
51 |
-
if (null === $activationStrategy) {
|
52 |
-
$activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING);
|
53 |
-
}
|
54 |
-
|
55 |
-
// convert simple int activationStrategy to an object
|
56 |
-
if (!$activationStrategy instanceof ActivationStrategyInterface) {
|
57 |
-
$activationStrategy = new ErrorLevelActivationStrategy($activationStrategy);
|
58 |
-
}
|
59 |
-
|
60 |
-
$this->handler = $handler;
|
61 |
-
$this->activationStrategy = $activationStrategy;
|
62 |
-
$this->bufferSize = $bufferSize;
|
63 |
-
$this->bubble = $bubble;
|
64 |
-
$this->stopBuffering = $stopBuffering;
|
65 |
-
|
66 |
-
if ($passthruLevel !== null) {
|
67 |
-
$this->passthruLevel = Logger::toMonologLevel($passthruLevel);
|
68 |
-
}
|
69 |
-
|
70 |
-
if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
|
71 |
-
throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
|
72 |
-
}
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* {@inheritdoc}
|
77 |
-
*/
|
78 |
-
public function isHandling(array $record)
|
79 |
-
{
|
80 |
-
return true;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Manually activate this logger regardless of the activation strategy
|
85 |
-
*/
|
86 |
-
public function activate()
|
87 |
-
{
|
88 |
-
if ($this->stopBuffering) {
|
89 |
-
$this->buffering = false;
|
90 |
-
}
|
91 |
-
if (!$this->handler instanceof HandlerInterface) {
|
92 |
-
$record = end($this->buffer) ?: null;
|
93 |
-
|
94 |
-
$this->handler = call_user_func($this->handler, $record, $this);
|
95 |
-
if (!$this->handler instanceof HandlerInterface) {
|
96 |
-
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
97 |
-
}
|
98 |
-
}
|
99 |
-
$this->handler->handleBatch($this->buffer);
|
100 |
-
$this->buffer = array();
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* {@inheritdoc}
|
105 |
-
*/
|
106 |
-
public function handle(array $record)
|
107 |
-
{
|
108 |
-
if ($this->processors) {
|
109 |
-
foreach ($this->processors as $processor) {
|
110 |
-
$record = call_user_func($processor, $record);
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
if ($this->buffering) {
|
115 |
-
$this->buffer[] = $record;
|
116 |
-
if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) {
|
117 |
-
array_shift($this->buffer);
|
118 |
-
}
|
119 |
-
if ($this->activationStrategy->isHandlerActivated($record)) {
|
120 |
-
$this->activate();
|
121 |
-
}
|
122 |
-
} else {
|
123 |
-
$this->handler->handle($record);
|
124 |
-
}
|
125 |
-
|
126 |
-
return false === $this->bubble;
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* {@inheritdoc}
|
131 |
-
*/
|
132 |
-
public function close()
|
133 |
-
{
|
134 |
-
$this->flushBuffer();
|
135 |
-
}
|
136 |
-
|
137 |
-
public function reset()
|
138 |
-
{
|
139 |
-
$this->flushBuffer();
|
140 |
-
|
141 |
-
parent::reset();
|
142 |
-
|
143 |
-
if ($this->handler instanceof ResettableInterface) {
|
144 |
-
$this->handler->reset();
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Clears the buffer without flushing any messages down to the wrapped handler.
|
150 |
-
*
|
151 |
-
* It also resets the handler to its initial buffering state.
|
152 |
-
*/
|
153 |
-
public function clear()
|
154 |
-
{
|
155 |
-
$this->buffer = array();
|
156 |
-
$this->reset();
|
157 |
-
}
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Resets the state of the handler. Stops forwarding records to the wrapped handler.
|
161 |
-
*/
|
162 |
-
private function flushBuffer()
|
163 |
-
{
|
164 |
-
if (null !== $this->passthruLevel) {
|
165 |
-
$level = $this->passthruLevel;
|
166 |
-
$this->buffer = array_filter($this->buffer, function ($record) use ($level) {
|
167 |
-
return $record['level'] >= $level;
|
168 |
-
});
|
169 |
-
if (count($this->buffer) > 0) {
|
170 |
-
$this->handler->handleBatch($this->buffer);
|
171 |
-
}
|
172 |
-
}
|
173 |
-
|
174 |
-
$this->buffer = array();
|
175 |
-
$this->buffering = true;
|
176 |
-
}
|
177 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php
DELETED
@@ -1,195 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\WildfireFormatter;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol.
|
18 |
-
*
|
19 |
-
* @author Eric Clemmons (@ericclemmons) <eric@uxdriven.com>
|
20 |
-
*/
|
21 |
-
class FirePHPHandler extends AbstractProcessingHandler
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* WildFire JSON header message format
|
25 |
-
*/
|
26 |
-
const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2';
|
27 |
-
|
28 |
-
/**
|
29 |
-
* FirePHP structure for parsing messages & their presentation
|
30 |
-
*/
|
31 |
-
const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1';
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Must reference a "known" plugin, otherwise headers won't display in FirePHP
|
35 |
-
*/
|
36 |
-
const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3';
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Header prefix for Wildfire to recognize & parse headers
|
40 |
-
*/
|
41 |
-
const HEADER_PREFIX = 'X-Wf';
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Whether or not Wildfire vendor-specific headers have been generated & sent yet
|
45 |
-
*/
|
46 |
-
protected static $initialized = false;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Shared static message index between potentially multiple handlers
|
50 |
-
* @var int
|
51 |
-
*/
|
52 |
-
protected static $messageIndex = 1;
|
53 |
-
|
54 |
-
protected static $sendHeaders = true;
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Base header creation function used by init headers & record headers
|
58 |
-
*
|
59 |
-
* @param array $meta Wildfire Plugin, Protocol & Structure Indexes
|
60 |
-
* @param string $message Log message
|
61 |
-
* @return array Complete header string ready for the client as key and message as value
|
62 |
-
*/
|
63 |
-
protected function createHeader(array $meta, $message)
|
64 |
-
{
|
65 |
-
$header = sprintf('%s-%s', self::HEADER_PREFIX, join('-', $meta));
|
66 |
-
|
67 |
-
return array($header => $message);
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Creates message header from record
|
72 |
-
*
|
73 |
-
* @see createHeader()
|
74 |
-
* @param array $record
|
75 |
-
* @return string
|
76 |
-
*/
|
77 |
-
protected function createRecordHeader(array $record)
|
78 |
-
{
|
79 |
-
// Wildfire is extensible to support multiple protocols & plugins in a single request,
|
80 |
-
// but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake.
|
81 |
-
return $this->createHeader(
|
82 |
-
array(1, 1, 1, self::$messageIndex++),
|
83 |
-
$record['formatted']
|
84 |
-
);
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* {@inheritDoc}
|
89 |
-
*/
|
90 |
-
protected function getDefaultFormatter()
|
91 |
-
{
|
92 |
-
return new WildfireFormatter();
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Wildfire initialization headers to enable message parsing
|
97 |
-
*
|
98 |
-
* @see createHeader()
|
99 |
-
* @see sendHeader()
|
100 |
-
* @return array
|
101 |
-
*/
|
102 |
-
protected function getInitHeaders()
|
103 |
-
{
|
104 |
-
// Initial payload consists of required headers for Wildfire
|
105 |
-
return array_merge(
|
106 |
-
$this->createHeader(array('Protocol', 1), self::PROTOCOL_URI),
|
107 |
-
$this->createHeader(array(1, 'Structure', 1), self::STRUCTURE_URI),
|
108 |
-
$this->createHeader(array(1, 'Plugin', 1), self::PLUGIN_URI)
|
109 |
-
);
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Send header string to the client
|
114 |
-
*
|
115 |
-
* @param string $header
|
116 |
-
* @param string $content
|
117 |
-
*/
|
118 |
-
protected function sendHeader($header, $content)
|
119 |
-
{
|
120 |
-
if (!headers_sent() && self::$sendHeaders) {
|
121 |
-
header(sprintf('%s: %s', $header, $content));
|
122 |
-
}
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Creates & sends header for a record, ensuring init headers have been sent prior
|
127 |
-
*
|
128 |
-
* @see sendHeader()
|
129 |
-
* @see sendInitHeaders()
|
130 |
-
* @param array $record
|
131 |
-
*/
|
132 |
-
protected function write(array $record)
|
133 |
-
{
|
134 |
-
if (!self::$sendHeaders) {
|
135 |
-
return;
|
136 |
-
}
|
137 |
-
|
138 |
-
// WildFire-specific headers must be sent prior to any messages
|
139 |
-
if (!self::$initialized) {
|
140 |
-
self::$initialized = true;
|
141 |
-
|
142 |
-
self::$sendHeaders = $this->headersAccepted();
|
143 |
-
if (!self::$sendHeaders) {
|
144 |
-
return;
|
145 |
-
}
|
146 |
-
|
147 |
-
foreach ($this->getInitHeaders() as $header => $content) {
|
148 |
-
$this->sendHeader($header, $content);
|
149 |
-
}
|
150 |
-
}
|
151 |
-
|
152 |
-
$header = $this->createRecordHeader($record);
|
153 |
-
if (trim(current($header)) !== '') {
|
154 |
-
$this->sendHeader(key($header), current($header));
|
155 |
-
}
|
156 |
-
}
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Verifies if the headers are accepted by the current user agent
|
160 |
-
*
|
161 |
-
* @return bool
|
162 |
-
*/
|
163 |
-
protected function headersAccepted()
|
164 |
-
{
|
165 |
-
if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) {
|
166 |
-
return true;
|
167 |
-
}
|
168 |
-
|
169 |
-
return isset($_SERVER['HTTP_X_FIREPHP_VERSION']);
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* BC getter for the sendHeaders property that has been made static
|
174 |
-
*/
|
175 |
-
public function __get($property)
|
176 |
-
{
|
177 |
-
if ('sendHeaders' !== $property) {
|
178 |
-
throw new \InvalidArgumentException('Undefined property '.$property);
|
179 |
-
}
|
180 |
-
|
181 |
-
return static::$sendHeaders;
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* BC setter for the sendHeaders property that has been made static
|
186 |
-
*/
|
187 |
-
public function __set($property, $value)
|
188 |
-
{
|
189 |
-
if ('sendHeaders' !== $property) {
|
190 |
-
throw new \InvalidArgumentException('Undefined property '.$property);
|
191 |
-
}
|
192 |
-
|
193 |
-
static::$sendHeaders = $value;
|
194 |
-
}
|
195 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\LineFormatter;
|
15 |
-
use Monolog\Logger;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Sends logs to Fleep.io using Webhook integrations
|
19 |
-
*
|
20 |
-
* You'll need a Fleep.io account to use this handler.
|
21 |
-
*
|
22 |
-
* @see https://fleep.io/integrations/webhooks/ Fleep Webhooks Documentation
|
23 |
-
* @author Ando Roots <ando@sqroot.eu>
|
24 |
-
*/
|
25 |
-
class FleepHookHandler extends SocketHandler
|
26 |
-
{
|
27 |
-
const FLEEP_HOST = 'fleep.io';
|
28 |
-
|
29 |
-
const FLEEP_HOOK_URI = '/hook/';
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @var string Webhook token (specifies the conversation where logs are sent)
|
33 |
-
*/
|
34 |
-
protected $token;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Construct a new Fleep.io Handler.
|
38 |
-
*
|
39 |
-
* For instructions on how to create a new web hook in your conversations
|
40 |
-
* see https://fleep.io/integrations/webhooks/
|
41 |
-
*
|
42 |
-
* @param string $token Webhook token
|
43 |
-
* @param bool|int $level The minimum logging level at which this handler will be triggered
|
44 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
45 |
-
* @throws MissingExtensionException
|
46 |
-
*/
|
47 |
-
public function __construct($token, $level = Logger::DEBUG, $bubble = true)
|
48 |
-
{
|
49 |
-
if (!extension_loaded('openssl')) {
|
50 |
-
throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler');
|
51 |
-
}
|
52 |
-
|
53 |
-
$this->token = $token;
|
54 |
-
|
55 |
-
$connectionString = 'ssl://' . self::FLEEP_HOST . ':443';
|
56 |
-
parent::__construct($connectionString, $level, $bubble);
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Returns the default formatter to use with this handler
|
61 |
-
*
|
62 |
-
* Overloaded to remove empty context and extra arrays from the end of the log message.
|
63 |
-
*
|
64 |
-
* @return LineFormatter
|
65 |
-
*/
|
66 |
-
protected function getDefaultFormatter()
|
67 |
-
{
|
68 |
-
return new LineFormatter(null, null, true, true);
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Handles a log record
|
73 |
-
*
|
74 |
-
* @param array $record
|
75 |
-
*/
|
76 |
-
public function write(array $record)
|
77 |
-
{
|
78 |
-
parent::write($record);
|
79 |
-
$this->closeSocket();
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* {@inheritdoc}
|
84 |
-
*
|
85 |
-
* @param array $record
|
86 |
-
* @return string
|
87 |
-
*/
|
88 |
-
protected function generateDataStream($record)
|
89 |
-
{
|
90 |
-
$content = $this->buildContent($record);
|
91 |
-
|
92 |
-
return $this->buildHeader($content) . $content;
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Builds the header of the API Call
|
97 |
-
*
|
98 |
-
* @param string $content
|
99 |
-
* @return string
|
100 |
-
*/
|
101 |
-
private function buildHeader($content)
|
102 |
-
{
|
103 |
-
$header = "POST " . self::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n";
|
104 |
-
$header .= "Host: " . self::FLEEP_HOST . "\r\n";
|
105 |
-
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
|
106 |
-
$header .= "Content-Length: " . strlen($content) . "\r\n";
|
107 |
-
$header .= "\r\n";
|
108 |
-
|
109 |
-
return $header;
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* Builds the body of API call
|
114 |
-
*
|
115 |
-
* @param array $record
|
116 |
-
* @return string
|
117 |
-
*/
|
118 |
-
private function buildContent($record)
|
119 |
-
{
|
120 |
-
$dataArray = array(
|
121 |
-
'message' => $record['formatted'],
|
122 |
-
);
|
123 |
-
|
124 |
-
return http_build_query($dataArray);
|
125 |
-
}
|
126 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php
DELETED
@@ -1,127 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\FlowdockFormatter;
|
16 |
-
use Monolog\Formatter\FormatterInterface;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Sends notifications through the Flowdock push API
|
20 |
-
*
|
21 |
-
* This must be configured with a FlowdockFormatter instance via setFormatter()
|
22 |
-
*
|
23 |
-
* Notes:
|
24 |
-
* API token - Flowdock API token
|
25 |
-
*
|
26 |
-
* @author Dominik Liebler <liebler.dominik@gmail.com>
|
27 |
-
* @see https://www.flowdock.com/api/push
|
28 |
-
*/
|
29 |
-
class FlowdockHandler extends SocketHandler
|
30 |
-
{
|
31 |
-
/**
|
32 |
-
* @var string
|
33 |
-
*/
|
34 |
-
protected $apiToken;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @param string $apiToken
|
38 |
-
* @param bool|int $level The minimum logging level at which this handler will be triggered
|
39 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
40 |
-
*
|
41 |
-
* @throws MissingExtensionException if OpenSSL is missing
|
42 |
-
*/
|
43 |
-
public function __construct($apiToken, $level = Logger::DEBUG, $bubble = true)
|
44 |
-
{
|
45 |
-
if (!extension_loaded('openssl')) {
|
46 |
-
throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler');
|
47 |
-
}
|
48 |
-
|
49 |
-
parent::__construct('ssl://api.flowdock.com:443', $level, $bubble);
|
50 |
-
$this->apiToken = $apiToken;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* {@inheritdoc}
|
55 |
-
*/
|
56 |
-
public function setFormatter(FormatterInterface $formatter)
|
57 |
-
{
|
58 |
-
if (!$formatter instanceof FlowdockFormatter) {
|
59 |
-
throw new \InvalidArgumentException('The FlowdockHandler requires an instance of Monolog\Formatter\FlowdockFormatter to function correctly');
|
60 |
-
}
|
61 |
-
|
62 |
-
return parent::setFormatter($formatter);
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Gets the default formatter.
|
67 |
-
*
|
68 |
-
* @return FormatterInterface
|
69 |
-
*/
|
70 |
-
protected function getDefaultFormatter()
|
71 |
-
{
|
72 |
-
throw new \InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\Formatter\FlowdockFormatter to function correctly');
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* {@inheritdoc}
|
77 |
-
*
|
78 |
-
* @param array $record
|
79 |
-
*/
|
80 |
-
protected function write(array $record)
|
81 |
-
{
|
82 |
-
parent::write($record);
|
83 |
-
|
84 |
-
$this->closeSocket();
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* {@inheritdoc}
|
89 |
-
*
|
90 |
-
* @param array $record
|
91 |
-
* @return string
|
92 |
-
*/
|
93 |
-
protected function generateDataStream($record)
|
94 |
-
{
|
95 |
-
$content = $this->buildContent($record);
|
96 |
-
|
97 |
-
return $this->buildHeader($content) . $content;
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Builds the body of API call
|
102 |
-
*
|
103 |
-
* @param array $record
|
104 |
-
* @return string
|
105 |
-
*/
|
106 |
-
private function buildContent($record)
|
107 |
-
{
|
108 |
-
return json_encode($record['formatted']['flowdock']);
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Builds the header of the API Call
|
113 |
-
*
|
114 |
-
* @param string $content
|
115 |
-
* @return string
|
116 |
-
*/
|
117 |
-
private function buildHeader($content)
|
118 |
-
{
|
119 |
-
$header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n";
|
120 |
-
$header .= "Host: api.flowdock.com\r\n";
|
121 |
-
$header .= "Content-Type: application/json\r\n";
|
122 |
-
$header .= "Content-Length: " . strlen($content) . "\r\n";
|
123 |
-
$header .= "\r\n";
|
124 |
-
|
125 |
-
return $header;
|
126 |
-
}
|
127 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Gelf\IMessagePublisher;
|
15 |
-
use Gelf\PublisherInterface;
|
16 |
-
use Gelf\Publisher;
|
17 |
-
use InvalidArgumentException;
|
18 |
-
use Monolog\Logger;
|
19 |
-
use Monolog\Formatter\GelfMessageFormatter;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Handler to send messages to a Graylog2 (http://www.graylog2.org) server
|
23 |
-
*
|
24 |
-
* @author Matt Lehner <mlehner@gmail.com>
|
25 |
-
* @author Benjamin Zikarsky <benjamin@zikarsky.de>
|
26 |
-
*/
|
27 |
-
class GelfHandler extends AbstractProcessingHandler
|
28 |
-
{
|
29 |
-
/**
|
30 |
-
* @var Publisher the publisher object that sends the message to the server
|
31 |
-
*/
|
32 |
-
protected $publisher;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @param PublisherInterface|IMessagePublisher|Publisher $publisher a publisher object
|
36 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
37 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
38 |
-
*/
|
39 |
-
public function __construct($publisher, $level = Logger::DEBUG, $bubble = true)
|
40 |
-
{
|
41 |
-
parent::__construct($level, $bubble);
|
42 |
-
|
43 |
-
if (!$publisher instanceof Publisher && !$publisher instanceof IMessagePublisher && !$publisher instanceof PublisherInterface) {
|
44 |
-
throw new InvalidArgumentException('Invalid publisher, expected a Gelf\Publisher, Gelf\IMessagePublisher or Gelf\PublisherInterface instance');
|
45 |
-
}
|
46 |
-
|
47 |
-
$this->publisher = $publisher;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* {@inheritdoc}
|
52 |
-
*/
|
53 |
-
protected function write(array $record)
|
54 |
-
{
|
55 |
-
$this->publisher->publish($record['formatted']);
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* {@inheritDoc}
|
60 |
-
*/
|
61 |
-
protected function getDefaultFormatter()
|
62 |
-
{
|
63 |
-
return new GelfMessageFormatter();
|
64 |
-
}
|
65 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\FormatterInterface;
|
15 |
-
use Monolog\ResettableInterface;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Forwards records to multiple handlers
|
19 |
-
*
|
20 |
-
* @author Lenar Lõhmus <lenar@city.ee>
|
21 |
-
*/
|
22 |
-
class GroupHandler extends AbstractHandler
|
23 |
-
{
|
24 |
-
protected $handlers;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param array $handlers Array of Handlers.
|
28 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
29 |
-
*/
|
30 |
-
public function __construct(array $handlers, $bubble = true)
|
31 |
-
{
|
32 |
-
foreach ($handlers as $handler) {
|
33 |
-
if (!$handler instanceof HandlerInterface) {
|
34 |
-
throw new \InvalidArgumentException('The first argument of the GroupHandler must be an array of HandlerInterface instances.');
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
$this->handlers = $handlers;
|
39 |
-
$this->bubble = $bubble;
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* {@inheritdoc}
|
44 |
-
*/
|
45 |
-
public function isHandling(array $record)
|
46 |
-
{
|
47 |
-
foreach ($this->handlers as $handler) {
|
48 |
-
if ($handler->isHandling($record)) {
|
49 |
-
return true;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
return false;
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* {@inheritdoc}
|
58 |
-
*/
|
59 |
-
public function handle(array $record)
|
60 |
-
{
|
61 |
-
if ($this->processors) {
|
62 |
-
foreach ($this->processors as $processor) {
|
63 |
-
$record = call_user_func($processor, $record);
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
foreach ($this->handlers as $handler) {
|
68 |
-
$handler->handle($record);
|
69 |
-
}
|
70 |
-
|
71 |
-
return false === $this->bubble;
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* {@inheritdoc}
|
76 |
-
*/
|
77 |
-
public function handleBatch(array $records)
|
78 |
-
{
|
79 |
-
if ($this->processors) {
|
80 |
-
$processed = array();
|
81 |
-
foreach ($records as $record) {
|
82 |
-
foreach ($this->processors as $processor) {
|
83 |
-
$processed[] = call_user_func($processor, $record);
|
84 |
-
}
|
85 |
-
}
|
86 |
-
$records = $processed;
|
87 |
-
}
|
88 |
-
|
89 |
-
foreach ($this->handlers as $handler) {
|
90 |
-
$handler->handleBatch($records);
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
public function reset()
|
95 |
-
{
|
96 |
-
parent::reset();
|
97 |
-
|
98 |
-
foreach ($this->handlers as $handler) {
|
99 |
-
if ($handler instanceof ResettableInterface) {
|
100 |
-
$handler->reset();
|
101 |
-
}
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* {@inheritdoc}
|
107 |
-
*/
|
108 |
-
public function setFormatter(FormatterInterface $formatter)
|
109 |
-
{
|
110 |
-
foreach ($this->handlers as $handler) {
|
111 |
-
$handler->setFormatter($formatter);
|
112 |
-
}
|
113 |
-
|
114 |
-
return $this;
|
115 |
-
}
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php
DELETED
@@ -1,90 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\FormatterInterface;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Interface that all Monolog Handlers must implement
|
18 |
-
*
|
19 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
20 |
-
*/
|
21 |
-
interface HandlerInterface
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* Checks whether the given record will be handled by this handler.
|
25 |
-
*
|
26 |
-
* This is mostly done for performance reasons, to avoid calling processors for nothing.
|
27 |
-
*
|
28 |
-
* Handlers should still check the record levels within handle(), returning false in isHandling()
|
29 |
-
* is no guarantee that handle() will not be called, and isHandling() might not be called
|
30 |
-
* for a given record.
|
31 |
-
*
|
32 |
-
* @param array $record Partial log record containing only a level key
|
33 |
-
*
|
34 |
-
* @return bool
|
35 |
-
*/
|
36 |
-
public function isHandling(array $record);
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Handles a record.
|
40 |
-
*
|
41 |
-
* All records may be passed to this method, and the handler should discard
|
42 |
-
* those that it does not want to handle.
|
43 |
-
*
|
44 |
-
* The return value of this function controls the bubbling process of the handler stack.
|
45 |
-
* Unless the bubbling is interrupted (by returning true), the Logger class will keep on
|
46 |
-
* calling further handlers in the stack with a given log record.
|
47 |
-
*
|
48 |
-
* @param array $record The record to handle
|
49 |
-
* @return bool true means that this handler handled the record, and that bubbling is not permitted.
|
50 |
-
* false means the record was either not processed or that this handler allows bubbling.
|
51 |
-
*/
|
52 |
-
public function handle(array $record);
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Handles a set of records at once.
|
56 |
-
*
|
57 |
-
* @param array $records The records to handle (an array of record arrays)
|
58 |
-
*/
|
59 |
-
public function handleBatch(array $records);
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Adds a processor in the stack.
|
63 |
-
*
|
64 |
-
* @param callable $callback
|
65 |
-
* @return self
|
66 |
-
*/
|
67 |
-
public function pushProcessor($callback);
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Removes the processor on top of the stack and returns it.
|
71 |
-
*
|
72 |
-
* @return callable
|
73 |
-
*/
|
74 |
-
public function popProcessor();
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Sets the formatter.
|
78 |
-
*
|
79 |
-
* @param FormatterInterface $formatter
|
80 |
-
* @return self
|
81 |
-
*/
|
82 |
-
public function setFormatter(FormatterInterface $formatter);
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Gets the formatter.
|
86 |
-
*
|
87 |
-
* @return FormatterInterface
|
88 |
-
*/
|
89 |
-
public function getFormatter();
|
90 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\ResettableInterface;
|
15 |
-
use Monolog\Formatter\FormatterInterface;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* This simple wrapper class can be used to extend handlers functionality.
|
19 |
-
*
|
20 |
-
* Example: A custom filtering that can be applied to any handler.
|
21 |
-
*
|
22 |
-
* Inherit from this class and override handle() like this:
|
23 |
-
*
|
24 |
-
* public function handle(array $record)
|
25 |
-
* {
|
26 |
-
* if ($record meets certain conditions) {
|
27 |
-
* return false;
|
28 |
-
* }
|
29 |
-
* return $this->handler->handle($record);
|
30 |
-
* }
|
31 |
-
*
|
32 |
-
* @author Alexey Karapetov <alexey@karapetov.com>
|
33 |
-
*/
|
34 |
-
class HandlerWrapper implements HandlerInterface, ResettableInterface
|
35 |
-
{
|
36 |
-
/**
|
37 |
-
* @var HandlerInterface
|
38 |
-
*/
|
39 |
-
protected $handler;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* HandlerWrapper constructor.
|
43 |
-
* @param HandlerInterface $handler
|
44 |
-
*/
|
45 |
-
public function __construct(HandlerInterface $handler)
|
46 |
-
{
|
47 |
-
$this->handler = $handler;
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* {@inheritdoc}
|
52 |
-
*/
|
53 |
-
public function isHandling(array $record)
|
54 |
-
{
|
55 |
-
return $this->handler->isHandling($record);
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* {@inheritdoc}
|
60 |
-
*/
|
61 |
-
public function handle(array $record)
|
62 |
-
{
|
63 |
-
return $this->handler->handle($record);
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* {@inheritdoc}
|
68 |
-
*/
|
69 |
-
public function handleBatch(array $records)
|
70 |
-
{
|
71 |
-
return $this->handler->handleBatch($records);
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* {@inheritdoc}
|
76 |
-
*/
|
77 |
-
public function pushProcessor($callback)
|
78 |
-
{
|
79 |
-
$this->handler->pushProcessor($callback);
|
80 |
-
|
81 |
-
return $this;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* {@inheritdoc}
|
86 |
-
*/
|
87 |
-
public function popProcessor()
|
88 |
-
{
|
89 |
-
return $this->handler->popProcessor();
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* {@inheritdoc}
|
94 |
-
*/
|
95 |
-
public function setFormatter(FormatterInterface $formatter)
|
96 |
-
{
|
97 |
-
$this->handler->setFormatter($formatter);
|
98 |
-
|
99 |
-
return $this;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* {@inheritdoc}
|
104 |
-
*/
|
105 |
-
public function getFormatter()
|
106 |
-
{
|
107 |
-
return $this->handler->getFormatter();
|
108 |
-
}
|
109 |
-
|
110 |
-
public function reset()
|
111 |
-
{
|
112 |
-
if ($this->handler instanceof ResettableInterface) {
|
113 |
-
return $this->handler->reset();
|
114 |
-
}
|
115 |
-
}
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php
DELETED
@@ -1,365 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Sends notifications through the hipchat api to a hipchat room
|
18 |
-
*
|
19 |
-
* Notes:
|
20 |
-
* API token - HipChat API token
|
21 |
-
* Room - HipChat Room Id or name, where messages are sent
|
22 |
-
* Name - Name used to send the message (from)
|
23 |
-
* notify - Should the message trigger a notification in the clients
|
24 |
-
* version - The API version to use (HipChatHandler::API_V1 | HipChatHandler::API_V2)
|
25 |
-
*
|
26 |
-
* @author Rafael Dohms <rafael@doh.ms>
|
27 |
-
* @see https://www.hipchat.com/docs/api
|
28 |
-
*/
|
29 |
-
class HipChatHandler extends SocketHandler
|
30 |
-
{
|
31 |
-
/**
|
32 |
-
* Use API version 1
|
33 |
-
*/
|
34 |
-
const API_V1 = 'v1';
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Use API version v2
|
38 |
-
*/
|
39 |
-
const API_V2 = 'v2';
|
40 |
-
|
41 |
-
/**
|
42 |
-
* The maximum allowed length for the name used in the "from" field.
|
43 |
-
*/
|
44 |
-
const MAXIMUM_NAME_LENGTH = 15;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* The maximum allowed length for the message.
|
48 |
-
*/
|
49 |
-
const MAXIMUM_MESSAGE_LENGTH = 9500;
|
50 |
-
|
51 |
-
/**
|
52 |
-
* @var string
|
53 |
-
*/
|
54 |
-
private $token;
|
55 |
-
|
56 |
-
/**
|
57 |
-
* @var string
|
58 |
-
*/
|
59 |
-
private $room;
|
60 |
-
|
61 |
-
/**
|
62 |
-
* @var string
|
63 |
-
*/
|
64 |
-
private $name;
|
65 |
-
|
66 |
-
/**
|
67 |
-
* @var bool
|
68 |
-
*/
|
69 |
-
private $notify;
|
70 |
-
|
71 |
-
/**
|
72 |
-
* @var string
|
73 |
-
*/
|
74 |
-
private $format;
|
75 |
-
|
76 |
-
/**
|
77 |
-
* @var string
|
78 |
-
*/
|
79 |
-
private $host;
|
80 |
-
|
81 |
-
/**
|
82 |
-
* @var string
|
83 |
-
*/
|
84 |
-
private $version;
|
85 |
-
|
86 |
-
/**
|
87 |
-
* @param string $token HipChat API Token
|
88 |
-
* @param string $room The room that should be alerted of the message (Id or Name)
|
89 |
-
* @param string $name Name used in the "from" field.
|
90 |
-
* @param bool $notify Trigger a notification in clients or not
|
91 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
92 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
93 |
-
* @param bool $useSSL Whether to connect via SSL.
|
94 |
-
* @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
|
95 |
-
* @param string $host The HipChat server hostname.
|
96 |
-
* @param string $version The HipChat API version (default HipChatHandler::API_V1)
|
97 |
-
*/
|
98 |
-
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1)
|
99 |
-
{
|
100 |
-
if ($version == self::API_V1 && !$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) {
|
101 |
-
throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
|
102 |
-
}
|
103 |
-
|
104 |
-
$connectionString = $useSSL ? 'ssl://'.$host.':443' : $host.':80';
|
105 |
-
parent::__construct($connectionString, $level, $bubble);
|
106 |
-
|
107 |
-
$this->token = $token;
|
108 |
-
$this->name = $name;
|
109 |
-
$this->notify = $notify;
|
110 |
-
$this->room = $room;
|
111 |
-
$this->format = $format;
|
112 |
-
$this->host = $host;
|
113 |
-
$this->version = $version;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* {@inheritdoc}
|
118 |
-
*
|
119 |
-
* @param array $record
|
120 |
-
* @return string
|
121 |
-
*/
|
122 |
-
protected function generateDataStream($record)
|
123 |
-
{
|
124 |
-
$content = $this->buildContent($record);
|
125 |
-
|
126 |
-
return $this->buildHeader($content) . $content;
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Builds the body of API call
|
131 |
-
*
|
132 |
-
* @param array $record
|
133 |
-
* @return string
|
134 |
-
*/
|
135 |
-
private function buildContent($record)
|
136 |
-
{
|
137 |
-
$dataArray = array(
|
138 |
-
'notify' => $this->version == self::API_V1 ?
|
139 |
-
($this->notify ? 1 : 0) :
|
140 |
-
($this->notify ? 'true' : 'false'),
|
141 |
-
'message' => $record['formatted'],
|
142 |
-
'message_format' => $this->format,
|
143 |
-
'color' => $this->getAlertColor($record['level']),
|
144 |
-
);
|
145 |
-
|
146 |
-
if (!$this->validateStringLength($dataArray['message'], static::MAXIMUM_MESSAGE_LENGTH)) {
|
147 |
-
if (function_exists('mb_substr')) {
|
148 |
-
$dataArray['message'] = mb_substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]';
|
149 |
-
} else {
|
150 |
-
$dataArray['message'] = substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]';
|
151 |
-
}
|
152 |
-
}
|
153 |
-
|
154 |
-
// if we are using the legacy API then we need to send some additional information
|
155 |
-
if ($this->version == self::API_V1) {
|
156 |
-
$dataArray['room_id'] = $this->room;
|
157 |
-
}
|
158 |
-
|
159 |
-
// append the sender name if it is set
|
160 |
-
// always append it if we use the v1 api (it is required in v1)
|
161 |
-
if ($this->version == self::API_V1 || $this->name !== null) {
|
162 |
-
$dataArray['from'] = (string) $this->name;
|
163 |
-
}
|
164 |
-
|
165 |
-
return http_build_query($dataArray);
|
166 |
-
}
|
167 |
-
|
168 |
-
/**
|
169 |
-
* Builds the header of the API Call
|
170 |
-
*
|
171 |
-
* @param string $content
|
172 |
-
* @return string
|
173 |
-
*/
|
174 |
-
private function buildHeader($content)
|
175 |
-
{
|
176 |
-
if ($this->version == self::API_V1) {
|
177 |
-
$header = "POST /v1/rooms/message?format=json&auth_token={$this->token} HTTP/1.1\r\n";
|
178 |
-
} else {
|
179 |
-
// needed for rooms with special (spaces, etc) characters in the name
|
180 |
-
$room = rawurlencode($this->room);
|
181 |
-
$header = "POST /v2/room/{$room}/notification?auth_token={$this->token} HTTP/1.1\r\n";
|
182 |
-
}
|
183 |
-
|
184 |
-
$header .= "Host: {$this->host}\r\n";
|
185 |
-
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
|
186 |
-
$header .= "Content-Length: " . strlen($content) . "\r\n";
|
187 |
-
$header .= "\r\n";
|
188 |
-
|
189 |
-
return $header;
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* Assigns a color to each level of log records.
|
194 |
-
*
|
195 |
-
* @param int $level
|
196 |
-
* @return string
|
197 |
-
*/
|
198 |
-
protected function getAlertColor($level)
|
199 |
-
{
|
200 |
-
switch (true) {
|
201 |
-
case $level >= Logger::ERROR:
|
202 |
-
return 'red';
|
203 |
-
case $level >= Logger::WARNING:
|
204 |
-
return 'yellow';
|
205 |
-
case $level >= Logger::INFO:
|
206 |
-
return 'green';
|
207 |
-
case $level == Logger::DEBUG:
|
208 |
-
return 'gray';
|
209 |
-
default:
|
210 |
-
return 'yellow';
|
211 |
-
}
|
212 |
-
}
|
213 |
-
|
214 |
-
/**
|
215 |
-
* {@inheritdoc}
|
216 |
-
*
|
217 |
-
* @param array $record
|
218 |
-
*/
|
219 |
-
protected function write(array $record)
|
220 |
-
{
|
221 |
-
parent::write($record);
|
222 |
-
$this->finalizeWrite();
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* Finalizes the request by reading some bytes and then closing the socket
|
227 |
-
*
|
228 |
-
* If we do not read some but close the socket too early, hipchat sometimes
|
229 |
-
* drops the request entirely.
|
230 |
-
*/
|
231 |
-
protected function finalizeWrite()
|
232 |
-
{
|
233 |
-
$res = $this->getResource();
|
234 |
-
if (is_resource($res)) {
|
235 |
-
@fread($res, 2048);
|
236 |
-
}
|
237 |
-
$this->closeSocket();
|
238 |
-
}
|
239 |
-
|
240 |
-
/**
|
241 |
-
* {@inheritdoc}
|
242 |
-
*/
|
243 |
-
public function handleBatch(array $records)
|
244 |
-
{
|
245 |
-
if (count($records) == 0) {
|
246 |
-
return true;
|
247 |
-
}
|
248 |
-
|
249 |
-
$batchRecords = $this->combineRecords($records);
|
250 |
-
|
251 |
-
$handled = false;
|
252 |
-
foreach ($batchRecords as $batchRecord) {
|
253 |
-
if ($this->isHandling($batchRecord)) {
|
254 |
-
$this->write($batchRecord);
|
255 |
-
$handled = true;
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
if (!$handled) {
|
260 |
-
return false;
|
261 |
-
}
|
262 |
-
|
263 |
-
return false === $this->bubble;
|
264 |
-
}
|
265 |
-
|
266 |
-
/**
|
267 |
-
* Combines multiple records into one. Error level of the combined record
|
268 |
-
* will be the highest level from the given records. Datetime will be taken
|
269 |
-
* from the first record.
|
270 |
-
*
|
271 |
-
* @param $records
|
272 |
-
* @return array
|
273 |
-
*/
|
274 |
-
private function combineRecords($records)
|
275 |
-
{
|
276 |
-
$batchRecord = null;
|
277 |
-
$batchRecords = array();
|
278 |
-
$messages = array();
|
279 |
-
$formattedMessages = array();
|
280 |
-
$level = 0;
|
281 |
-
$levelName = null;
|
282 |
-
$datetime = null;
|
283 |
-
|
284 |
-
foreach ($records as $record) {
|
285 |
-
$record = $this->processRecord($record);
|
286 |
-
|
287 |
-
if ($record['level'] > $level) {
|
288 |
-
$level = $record['level'];
|
289 |
-
$levelName = $record['level_name'];
|
290 |
-
}
|
291 |
-
|
292 |
-
if (null === $datetime) {
|
293 |
-
$datetime = $record['datetime'];
|
294 |
-
}
|
295 |
-
|
296 |
-
$messages[] = $record['message'];
|
297 |
-
$messageStr = implode(PHP_EOL, $messages);
|
298 |
-
$formattedMessages[] = $this->getFormatter()->format($record);
|
299 |
-
$formattedMessageStr = implode('', $formattedMessages);
|
300 |
-
|
301 |
-
$batchRecord = array(
|
302 |
-
'message' => $messageStr,
|
303 |
-
'formatted' => $formattedMessageStr,
|
304 |
-
'context' => array(),
|
305 |
-
'extra' => array(),
|
306 |
-
);
|
307 |
-
|
308 |
-
if (!$this->validateStringLength($batchRecord['formatted'], static::MAXIMUM_MESSAGE_LENGTH)) {
|
309 |
-
// Pop the last message and implode the remaining messages
|
310 |
-
$lastMessage = array_pop($messages);
|
311 |
-
$lastFormattedMessage = array_pop($formattedMessages);
|
312 |
-
$batchRecord['message'] = implode(PHP_EOL, $messages);
|
313 |
-
$batchRecord['formatted'] = implode('', $formattedMessages);
|
314 |
-
|
315 |
-
$batchRecords[] = $batchRecord;
|
316 |
-
$messages = array($lastMessage);
|
317 |
-
$formattedMessages = array($lastFormattedMessage);
|
318 |
-
|
319 |
-
$batchRecord = null;
|
320 |
-
}
|
321 |
-
}
|
322 |
-
|
323 |
-
if (null !== $batchRecord) {
|
324 |
-
$batchRecords[] = $batchRecord;
|
325 |
-
}
|
326 |
-
|
327 |
-
// Set the max level and datetime for all records
|
328 |
-
foreach ($batchRecords as &$batchRecord) {
|
329 |
-
$batchRecord = array_merge(
|
330 |
-
$batchRecord,
|
331 |
-
array(
|
332 |
-
'level' => $level,
|
333 |
-
'level_name' => $levelName,
|
334 |
-
'datetime' => $datetime,
|
335 |
-
)
|
336 |
-
);
|
337 |
-
}
|
338 |
-
|
339 |
-
return $batchRecords;
|
340 |
-
}
|
341 |
-
|
342 |
-
/**
|
343 |
-
* Validates the length of a string.
|
344 |
-
*
|
345 |
-
* If the `mb_strlen()` function is available, it will use that, as HipChat
|
346 |
-
* allows UTF-8 characters. Otherwise, it will fall back to `strlen()`.
|
347 |
-
*
|
348 |
-
* Note that this might cause false failures in the specific case of using
|
349 |
-
* a valid name with less than 16 characters, but 16 or more bytes, on a
|
350 |
-
* system where `mb_strlen()` is unavailable.
|
351 |
-
*
|
352 |
-
* @param string $str
|
353 |
-
* @param int $length
|
354 |
-
*
|
355 |
-
* @return bool
|
356 |
-
*/
|
357 |
-
private function validateStringLength($str, $length)
|
358 |
-
{
|
359 |
-
if (function_exists('mb_strlen')) {
|
360 |
-
return (mb_strlen($str) <= $length);
|
361 |
-
}
|
362 |
-
|
363 |
-
return (strlen($str) <= $length);
|
364 |
-
}
|
365 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* IFTTTHandler uses cURL to trigger IFTTT Maker actions
|
18 |
-
*
|
19 |
-
* Register a secret key and trigger/event name at https://ifttt.com/maker
|
20 |
-
*
|
21 |
-
* value1 will be the channel from monolog's Logger constructor,
|
22 |
-
* value2 will be the level name (ERROR, WARNING, ..)
|
23 |
-
* value3 will be the log record's message
|
24 |
-
*
|
25 |
-
* @author Nehal Patel <nehal@nehalpatel.me>
|
26 |
-
*/
|
27 |
-
class IFTTTHandler extends AbstractProcessingHandler
|
28 |
-
{
|
29 |
-
private $eventName;
|
30 |
-
private $secretKey;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @param string $eventName The name of the IFTTT Maker event that should be triggered
|
34 |
-
* @param string $secretKey A valid IFTTT secret key
|
35 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
36 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
37 |
-
*/
|
38 |
-
public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true)
|
39 |
-
{
|
40 |
-
$this->eventName = $eventName;
|
41 |
-
$this->secretKey = $secretKey;
|
42 |
-
|
43 |
-
parent::__construct($level, $bubble);
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* {@inheritdoc}
|
48 |
-
*/
|
49 |
-
public function write(array $record)
|
50 |
-
{
|
51 |
-
$postData = array(
|
52 |
-
"value1" => $record["channel"],
|
53 |
-
"value2" => $record["level_name"],
|
54 |
-
"value3" => $record["message"],
|
55 |
-
);
|
56 |
-
$postString = json_encode($postData);
|
57 |
-
|
58 |
-
$ch = curl_init();
|
59 |
-
curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey);
|
60 |
-
curl_setopt($ch, CURLOPT_POST, true);
|
61 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
62 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
|
63 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
64 |
-
"Content-Type: application/json",
|
65 |
-
));
|
66 |
-
|
67 |
-
Curl\Util::execute($ch);
|
68 |
-
}
|
69 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Inspired on LogEntriesHandler.
|
18 |
-
*
|
19 |
-
* @author Robert Kaufmann III <rok3@rok3.me>
|
20 |
-
* @author Gabriel Machado <gabriel.ms1@hotmail.com>
|
21 |
-
*/
|
22 |
-
class InsightOpsHandler extends SocketHandler
|
23 |
-
{
|
24 |
-
/**
|
25 |
-
* @var string
|
26 |
-
*/
|
27 |
-
protected $logToken;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* @param string $token Log token supplied by InsightOps
|
31 |
-
* @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'.
|
32 |
-
* @param bool $useSSL Whether or not SSL encryption should be used
|
33 |
-
* @param int $level The minimum logging level to trigger this handler
|
34 |
-
* @param bool $bubble Whether or not messages that are handled should bubble up the stack.
|
35 |
-
*
|
36 |
-
* @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
|
37 |
-
*/
|
38 |
-
public function __construct($token, $region = 'us', $useSSL = true, $level = Logger::DEBUG, $bubble = true)
|
39 |
-
{
|
40 |
-
if ($useSSL && !extension_loaded('openssl')) {
|
41 |
-
throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
|
42 |
-
}
|
43 |
-
|
44 |
-
$endpoint = $useSSL
|
45 |
-
? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443'
|
46 |
-
: $region . '.data.logs.insight.rapid7.com:80';
|
47 |
-
|
48 |
-
parent::__construct($endpoint, $level, $bubble);
|
49 |
-
$this->logToken = $token;
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* {@inheritdoc}
|
54 |
-
*
|
55 |
-
* @param array $record
|
56 |
-
* @return string
|
57 |
-
*/
|
58 |
-
protected function generateDataStream($record)
|
59 |
-
{
|
60 |
-
return $this->logToken . ' ' . $record['formatted'];
|
61 |
-
}
|
62 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* @author Robert Kaufmann III <rok3@rok3.me>
|
18 |
-
*/
|
19 |
-
class LogEntriesHandler extends SocketHandler
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
protected $logToken;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param string $token Log token supplied by LogEntries
|
28 |
-
* @param bool $useSSL Whether or not SSL encryption should be used.
|
29 |
-
* @param int $level The minimum logging level to trigger this handler
|
30 |
-
* @param bool $bubble Whether or not messages that are handled should bubble up the stack.
|
31 |
-
*
|
32 |
-
* @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
|
33 |
-
*/
|
34 |
-
public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true, $host = 'data.logentries.com')
|
35 |
-
{
|
36 |
-
if ($useSSL && !extension_loaded('openssl')) {
|
37 |
-
throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
|
38 |
-
}
|
39 |
-
|
40 |
-
$endpoint = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80';
|
41 |
-
parent::__construct($endpoint, $level, $bubble);
|
42 |
-
$this->logToken = $token;
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* {@inheritdoc}
|
47 |
-
*
|
48 |
-
* @param array $record
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
protected function generateDataStream($record)
|
52 |
-
{
|
53 |
-
return $this->logToken . ' ' . $record['formatted'];
|
54 |
-
}
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php
DELETED
@@ -1,102 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\LogglyFormatter;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Sends errors to Loggly.
|
19 |
-
*
|
20 |
-
* @author Przemek Sobstel <przemek@sobstel.org>
|
21 |
-
* @author Adam Pancutt <adam@pancutt.com>
|
22 |
-
* @author Gregory Barchard <gregory@barchard.net>
|
23 |
-
*/
|
24 |
-
class LogglyHandler extends AbstractProcessingHandler
|
25 |
-
{
|
26 |
-
const HOST = 'logs-01.loggly.com';
|
27 |
-
const ENDPOINT_SINGLE = 'inputs';
|
28 |
-
const ENDPOINT_BATCH = 'bulk';
|
29 |
-
|
30 |
-
protected $token;
|
31 |
-
|
32 |
-
protected $tag = array();
|
33 |
-
|
34 |
-
public function __construct($token, $level = Logger::DEBUG, $bubble = true)
|
35 |
-
{
|
36 |
-
if (!extension_loaded('curl')) {
|
37 |
-
throw new \LogicException('The curl extension is needed to use the LogglyHandler');
|
38 |
-
}
|
39 |
-
|
40 |
-
$this->token = $token;
|
41 |
-
|
42 |
-
parent::__construct($level, $bubble);
|
43 |
-
}
|
44 |
-
|
45 |
-
public function setTag($tag)
|
46 |
-
{
|
47 |
-
$tag = !empty($tag) ? $tag : array();
|
48 |
-
$this->tag = is_array($tag) ? $tag : array($tag);
|
49 |
-
}
|
50 |
-
|
51 |
-
public function addTag($tag)
|
52 |
-
{
|
53 |
-
if (!empty($tag)) {
|
54 |
-
$tag = is_array($tag) ? $tag : array($tag);
|
55 |
-
$this->tag = array_unique(array_merge($this->tag, $tag));
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
protected function write(array $record)
|
60 |
-
{
|
61 |
-
$this->send($record["formatted"], self::ENDPOINT_SINGLE);
|
62 |
-
}
|
63 |
-
|
64 |
-
public function handleBatch(array $records)
|
65 |
-
{
|
66 |
-
$level = $this->level;
|
67 |
-
|
68 |
-
$records = array_filter($records, function ($record) use ($level) {
|
69 |
-
return ($record['level'] >= $level);
|
70 |
-
});
|
71 |
-
|
72 |
-
if ($records) {
|
73 |
-
$this->send($this->getFormatter()->formatBatch($records), self::ENDPOINT_BATCH);
|
74 |
-
}
|
75 |
-
}
|
76 |
-
|
77 |
-
protected function send($data, $endpoint)
|
78 |
-
{
|
79 |
-
$url = sprintf("https://%s/%s/%s/", self::HOST, $endpoint, $this->token);
|
80 |
-
|
81 |
-
$headers = array('Content-Type: application/json');
|
82 |
-
|
83 |
-
if (!empty($this->tag)) {
|
84 |
-
$headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag);
|
85 |
-
}
|
86 |
-
|
87 |
-
$ch = curl_init();
|
88 |
-
|
89 |
-
curl_setopt($ch, CURLOPT_URL, $url);
|
90 |
-
curl_setopt($ch, CURLOPT_POST, true);
|
91 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
92 |
-
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
93 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
94 |
-
|
95 |
-
Curl\Util::execute($ch);
|
96 |
-
}
|
97 |
-
|
98 |
-
protected function getDefaultFormatter()
|
99 |
-
{
|
100 |
-
return new LogglyFormatter();
|
101 |
-
}
|
102 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Base class for all mail handlers
|
16 |
-
*
|
17 |
-
* @author Gyula Sallai
|
18 |
-
*/
|
19 |
-
abstract class MailHandler extends AbstractProcessingHandler
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* {@inheritdoc}
|
23 |
-
*/
|
24 |
-
public function handleBatch(array $records)
|
25 |
-
{
|
26 |
-
$messages = array();
|
27 |
-
|
28 |
-
foreach ($records as $record) {
|
29 |
-
if ($record['level'] < $this->level) {
|
30 |
-
continue;
|
31 |
-
}
|
32 |
-
$messages[] = $this->processRecord($record);
|
33 |
-
}
|
34 |
-
|
35 |
-
if (!empty($messages)) {
|
36 |
-
$this->send((string) $this->getFormatter()->formatBatch($messages), $messages);
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Send a mail with the given content
|
42 |
-
*
|
43 |
-
* @param string $content formatted email body to be sent
|
44 |
-
* @param array $records the array of log records that formed this content
|
45 |
-
*/
|
46 |
-
abstract protected function send($content, array $records);
|
47 |
-
|
48 |
-
/**
|
49 |
-
* {@inheritdoc}
|
50 |
-
*/
|
51 |
-
protected function write(array $record)
|
52 |
-
{
|
53 |
-
$this->send((string) $record['formatted'], array($record));
|
54 |
-
}
|
55 |
-
|
56 |
-
protected function getHighestRecord(array $records)
|
57 |
-
{
|
58 |
-
$highestRecord = null;
|
59 |
-
foreach ($records as $record) {
|
60 |
-
if ($highestRecord === null || $highestRecord['level'] < $record['level']) {
|
61 |
-
$highestRecord = $record;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
|
65 |
-
return $highestRecord;
|
66 |
-
}
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* MandrillHandler uses cURL to send the emails to the Mandrill API
|
18 |
-
*
|
19 |
-
* @author Adam Nicholson <adamnicholson10@gmail.com>
|
20 |
-
*/
|
21 |
-
class MandrillHandler extends MailHandler
|
22 |
-
{
|
23 |
-
protected $message;
|
24 |
-
protected $apiKey;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param string $apiKey A valid Mandrill API key
|
28 |
-
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
|
29 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
30 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
31 |
-
*/
|
32 |
-
public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true)
|
33 |
-
{
|
34 |
-
parent::__construct($level, $bubble);
|
35 |
-
|
36 |
-
if (!$message instanceof \Swift_Message && is_callable($message)) {
|
37 |
-
$message = call_user_func($message);
|
38 |
-
}
|
39 |
-
if (!$message instanceof \Swift_Message) {
|
40 |
-
throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it');
|
41 |
-
}
|
42 |
-
$this->message = $message;
|
43 |
-
$this->apiKey = $apiKey;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* {@inheritdoc}
|
48 |
-
*/
|
49 |
-
protected function send($content, array $records)
|
50 |
-
{
|
51 |
-
$message = clone $this->message;
|
52 |
-
$message->setBody($content);
|
53 |
-
$message->setDate(time());
|
54 |
-
|
55 |
-
$ch = curl_init();
|
56 |
-
|
57 |
-
curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json');
|
58 |
-
curl_setopt($ch, CURLOPT_POST, 1);
|
59 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
60 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
|
61 |
-
'key' => $this->apiKey,
|
62 |
-
'raw_message' => (string) $message,
|
63 |
-
'async' => false,
|
64 |
-
)));
|
65 |
-
|
66 |
-
Curl\Util::execute($ch);
|
67 |
-
}
|
68 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Exception can be thrown if an extension for an handler is missing
|
16 |
-
*
|
17 |
-
* @author Christian Bergau <cbergau86@gmail.com>
|
18 |
-
*/
|
19 |
-
class MissingExtensionException extends \Exception
|
20 |
-
{
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\NormalizerFormatter;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Logs to a MongoDB database.
|
19 |
-
*
|
20 |
-
* usage example:
|
21 |
-
*
|
22 |
-
* $log = new Logger('application');
|
23 |
-
* $mongodb = new MongoDBHandler(new \Mongo("mongodb://localhost:27017"), "logs", "prod");
|
24 |
-
* $log->pushHandler($mongodb);
|
25 |
-
*
|
26 |
-
* @author Thomas Tourlourat <thomas@tourlourat.com>
|
27 |
-
*/
|
28 |
-
class MongoDBHandler extends AbstractProcessingHandler
|
29 |
-
{
|
30 |
-
protected $mongoCollection;
|
31 |
-
|
32 |
-
public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true)
|
33 |
-
{
|
34 |
-
if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo || $mongo instanceof \MongoDB\Client)) {
|
35 |
-
throw new \InvalidArgumentException('MongoClient, Mongo or MongoDB\Client instance required');
|
36 |
-
}
|
37 |
-
|
38 |
-
$this->mongoCollection = $mongo->selectCollection($database, $collection);
|
39 |
-
|
40 |
-
parent::__construct($level, $bubble);
|
41 |
-
}
|
42 |
-
|
43 |
-
protected function write(array $record)
|
44 |
-
{
|
45 |
-
if ($this->mongoCollection instanceof \MongoDB\Collection) {
|
46 |
-
$this->mongoCollection->insertOne($record["formatted"]);
|
47 |
-
} else {
|
48 |
-
$this->mongoCollection->save($record["formatted"]);
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* {@inheritDoc}
|
54 |
-
*/
|
55 |
-
protected function getDefaultFormatter()
|
56 |
-
{
|
57 |
-
return new NormalizerFormatter();
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php
DELETED
@@ -1,185 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\LineFormatter;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* NativeMailerHandler uses the mail() function to send the emails
|
19 |
-
*
|
20 |
-
* @author Christophe Coevoet <stof@notk.org>
|
21 |
-
* @author Mark Garrett <mark@moderndeveloperllc.com>
|
22 |
-
*/
|
23 |
-
class NativeMailerHandler extends MailHandler
|
24 |
-
{
|
25 |
-
/**
|
26 |
-
* The email addresses to which the message will be sent
|
27 |
-
* @var array
|
28 |
-
*/
|
29 |
-
protected $to;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* The subject of the email
|
33 |
-
* @var string
|
34 |
-
*/
|
35 |
-
protected $subject;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Optional headers for the message
|
39 |
-
* @var array
|
40 |
-
*/
|
41 |
-
protected $headers = array();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Optional parameters for the message
|
45 |
-
* @var array
|
46 |
-
*/
|
47 |
-
protected $parameters = array();
|
48 |
-
|
49 |
-
/**
|
50 |
-
* The wordwrap length for the message
|
51 |
-
* @var int
|
52 |
-
*/
|
53 |
-
protected $maxColumnWidth;
|
54 |
-
|
55 |
-
/**
|
56 |
-
* The Content-type for the message
|
57 |
-
* @var string
|
58 |
-
*/
|
59 |
-
protected $contentType = 'text/plain';
|
60 |
-
|
61 |
-
/**
|
62 |
-
* The encoding for the message
|
63 |
-
* @var string
|
64 |
-
*/
|
65 |
-
protected $encoding = 'utf-8';
|
66 |
-
|
67 |
-
/**
|
68 |
-
* @param string|array $to The receiver of the mail
|
69 |
-
* @param string $subject The subject of the mail
|
70 |
-
* @param string $from The sender of the mail
|
71 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
72 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
73 |
-
* @param int $maxColumnWidth The maximum column width that the message lines will have
|
74 |
-
*/
|
75 |
-
public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70)
|
76 |
-
{
|
77 |
-
parent::__construct($level, $bubble);
|
78 |
-
$this->to = is_array($to) ? $to : array($to);
|
79 |
-
$this->subject = $subject;
|
80 |
-
$this->addHeader(sprintf('From: %s', $from));
|
81 |
-
$this->maxColumnWidth = $maxColumnWidth;
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Add headers to the message
|
86 |
-
*
|
87 |
-
* @param string|array $headers Custom added headers
|
88 |
-
* @return self
|
89 |
-
*/
|
90 |
-
public function addHeader($headers)
|
91 |
-
{
|
92 |
-
foreach ((array) $headers as $header) {
|
93 |
-
if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
|
94 |
-
throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
|
95 |
-
}
|
96 |
-
$this->headers[] = $header;
|
97 |
-
}
|
98 |
-
|
99 |
-
return $this;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Add parameters to the message
|
104 |
-
*
|
105 |
-
* @param string|array $parameters Custom added parameters
|
106 |
-
* @return self
|
107 |
-
*/
|
108 |
-
public function addParameter($parameters)
|
109 |
-
{
|
110 |
-
$this->parameters = array_merge($this->parameters, (array) $parameters);
|
111 |
-
|
112 |
-
return $this;
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* {@inheritdoc}
|
117 |
-
*/
|
118 |
-
protected function send($content, array $records)
|
119 |
-
{
|
120 |
-
$content = wordwrap($content, $this->maxColumnWidth);
|
121 |
-
$headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n");
|
122 |
-
$headers .= 'Content-type: ' . $this->getContentType() . '; charset=' . $this->getEncoding() . "\r\n";
|
123 |
-
if ($this->getContentType() == 'text/html' && false === strpos($headers, 'MIME-Version:')) {
|
124 |
-
$headers .= 'MIME-Version: 1.0' . "\r\n";
|
125 |
-
}
|
126 |
-
|
127 |
-
$subject = $this->subject;
|
128 |
-
if ($records) {
|
129 |
-
$subjectFormatter = new LineFormatter($this->subject);
|
130 |
-
$subject = $subjectFormatter->format($this->getHighestRecord($records));
|
131 |
-
}
|
132 |
-
|
133 |
-
$parameters = implode(' ', $this->parameters);
|
134 |
-
foreach ($this->to as $to) {
|
135 |
-
mail($to, $subject, $content, $headers, $parameters);
|
136 |
-
}
|
137 |
-
}
|
138 |
-
|
139 |
-
/**
|
140 |
-
* @return string $contentType
|
141 |
-
*/
|
142 |
-
public function getContentType()
|
143 |
-
{
|
144 |
-
return $this->contentType;
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* @return string $encoding
|
149 |
-
*/
|
150 |
-
public function getEncoding()
|
151 |
-
{
|
152 |
-
return $this->encoding;
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML
|
157 |
-
* messages.
|
158 |
-
* @return self
|
159 |
-
*/
|
160 |
-
public function setContentType($contentType)
|
161 |
-
{
|
162 |
-
if (strpos($contentType, "\n") !== false || strpos($contentType, "\r") !== false) {
|
163 |
-
throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection');
|
164 |
-
}
|
165 |
-
|
166 |
-
$this->contentType = $contentType;
|
167 |
-
|
168 |
-
return $this;
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* @param string $encoding
|
173 |
-
* @return self
|
174 |
-
*/
|
175 |
-
public function setEncoding($encoding)
|
176 |
-
{
|
177 |
-
if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) {
|
178 |
-
throw new \InvalidArgumentException('The encoding can not contain newline characters to prevent email header injection');
|
179 |
-
}
|
180 |
-
|
181 |
-
$this->encoding = $encoding;
|
182 |
-
|
183 |
-
return $this;
|
184 |
-
}
|
185 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php
DELETED
@@ -1,204 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\NormalizerFormatter;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Class to record a log on a NewRelic application.
|
19 |
-
* Enabling New Relic High Security mode may prevent capture of useful information.
|
20 |
-
*
|
21 |
-
* This handler requires a NormalizerFormatter to function and expects an array in $record['formatted']
|
22 |
-
*
|
23 |
-
* @see https://docs.newrelic.com/docs/agents/php-agent
|
24 |
-
* @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security
|
25 |
-
*/
|
26 |
-
class NewRelicHandler extends AbstractProcessingHandler
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* Name of the New Relic application that will receive logs from this handler.
|
30 |
-
*
|
31 |
-
* @var string
|
32 |
-
*/
|
33 |
-
protected $appName;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Name of the current transaction
|
37 |
-
*
|
38 |
-
* @var string
|
39 |
-
*/
|
40 |
-
protected $transactionName;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Some context and extra data is passed into the handler as arrays of values. Do we send them as is
|
44 |
-
* (useful if we are using the API), or explode them for display on the NewRelic RPM website?
|
45 |
-
*
|
46 |
-
* @var bool
|
47 |
-
*/
|
48 |
-
protected $explodeArrays;
|
49 |
-
|
50 |
-
/**
|
51 |
-
* {@inheritDoc}
|
52 |
-
*
|
53 |
-
* @param string $appName
|
54 |
-
* @param bool $explodeArrays
|
55 |
-
* @param string $transactionName
|
56 |
-
*/
|
57 |
-
public function __construct(
|
58 |
-
$level = Logger::ERROR,
|
59 |
-
$bubble = true,
|
60 |
-
$appName = null,
|
61 |
-
$explodeArrays = false,
|
62 |
-
$transactionName = null
|
63 |
-
) {
|
64 |
-
parent::__construct($level, $bubble);
|
65 |
-
|
66 |
-
$this->appName = $appName;
|
67 |
-
$this->explodeArrays = $explodeArrays;
|
68 |
-
$this->transactionName = $transactionName;
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* {@inheritDoc}
|
73 |
-
*/
|
74 |
-
protected function write(array $record)
|
75 |
-
{
|
76 |
-
if (!$this->isNewRelicEnabled()) {
|
77 |
-
throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler');
|
78 |
-
}
|
79 |
-
|
80 |
-
if ($appName = $this->getAppName($record['context'])) {
|
81 |
-
$this->setNewRelicAppName($appName);
|
82 |
-
}
|
83 |
-
|
84 |
-
if ($transactionName = $this->getTransactionName($record['context'])) {
|
85 |
-
$this->setNewRelicTransactionName($transactionName);
|
86 |
-
unset($record['formatted']['context']['transaction_name']);
|
87 |
-
}
|
88 |
-
|
89 |
-
if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) {
|
90 |
-
newrelic_notice_error($record['message'], $record['context']['exception']);
|
91 |
-
unset($record['formatted']['context']['exception']);
|
92 |
-
} else {
|
93 |
-
newrelic_notice_error($record['message']);
|
94 |
-
}
|
95 |
-
|
96 |
-
if (isset($record['formatted']['context']) && is_array($record['formatted']['context'])) {
|
97 |
-
foreach ($record['formatted']['context'] as $key => $parameter) {
|
98 |
-
if (is_array($parameter) && $this->explodeArrays) {
|
99 |
-
foreach ($parameter as $paramKey => $paramValue) {
|
100 |
-
$this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue);
|
101 |
-
}
|
102 |
-
} else {
|
103 |
-
$this->setNewRelicParameter('context_' . $key, $parameter);
|
104 |
-
}
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
if (isset($record['formatted']['extra']) && is_array($record['formatted']['extra'])) {
|
109 |
-
foreach ($record['formatted']['extra'] as $key => $parameter) {
|
110 |
-
if (is_array($parameter) && $this->explodeArrays) {
|
111 |
-
foreach ($parameter as $paramKey => $paramValue) {
|
112 |
-
$this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue);
|
113 |
-
}
|
114 |
-
} else {
|
115 |
-
$this->setNewRelicParameter('extra_' . $key, $parameter);
|
116 |
-
}
|
117 |
-
}
|
118 |
-
}
|
119 |
-
}
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Checks whether the NewRelic extension is enabled in the system.
|
123 |
-
*
|
124 |
-
* @return bool
|
125 |
-
*/
|
126 |
-
protected function isNewRelicEnabled()
|
127 |
-
{
|
128 |
-
return extension_loaded('newrelic');
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Returns the appname where this log should be sent. Each log can override the default appname, set in this
|
133 |
-
* handler's constructor, by providing the appname in it's context.
|
134 |
-
*
|
135 |
-
* @param array $context
|
136 |
-
* @return null|string
|
137 |
-
*/
|
138 |
-
protected function getAppName(array $context)
|
139 |
-
{
|
140 |
-
if (isset($context['appname'])) {
|
141 |
-
return $context['appname'];
|
142 |
-
}
|
143 |
-
|
144 |
-
return $this->appName;
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Returns the name of the current transaction. Each log can override the default transaction name, set in this
|
149 |
-
* handler's constructor, by providing the transaction_name in it's context
|
150 |
-
*
|
151 |
-
* @param array $context
|
152 |
-
*
|
153 |
-
* @return null|string
|
154 |
-
*/
|
155 |
-
protected function getTransactionName(array $context)
|
156 |
-
{
|
157 |
-
if (isset($context['transaction_name'])) {
|
158 |
-
return $context['transaction_name'];
|
159 |
-
}
|
160 |
-
|
161 |
-
return $this->transactionName;
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Sets the NewRelic application that should receive this log.
|
166 |
-
*
|
167 |
-
* @param string $appName
|
168 |
-
*/
|
169 |
-
protected function setNewRelicAppName($appName)
|
170 |
-
{
|
171 |
-
newrelic_set_appname($appName);
|
172 |
-
}
|
173 |
-
|
174 |
-
/**
|
175 |
-
* Overwrites the name of the current transaction
|
176 |
-
*
|
177 |
-
* @param string $transactionName
|
178 |
-
*/
|
179 |
-
protected function setNewRelicTransactionName($transactionName)
|
180 |
-
{
|
181 |
-
newrelic_name_transaction($transactionName);
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* @param string $key
|
186 |
-
* @param mixed $value
|
187 |
-
*/
|
188 |
-
protected function setNewRelicParameter($key, $value)
|
189 |
-
{
|
190 |
-
if (null === $value || is_scalar($value)) {
|
191 |
-
newrelic_add_custom_parameter($key, $value);
|
192 |
-
} else {
|
193 |
-
newrelic_add_custom_parameter($key, @json_encode($value));
|
194 |
-
}
|
195 |
-
}
|
196 |
-
|
197 |
-
/**
|
198 |
-
* {@inheritDoc}
|
199 |
-
*/
|
200 |
-
protected function getDefaultFormatter()
|
201 |
-
{
|
202 |
-
return new NormalizerFormatter();
|
203 |
-
}
|
204 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Blackhole
|
18 |
-
*
|
19 |
-
* Any record it can handle will be thrown away. This can be used
|
20 |
-
* to put on top of an existing stack to override it temporarily.
|
21 |
-
*
|
22 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
23 |
-
*/
|
24 |
-
class NullHandler extends AbstractHandler
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
28 |
-
*/
|
29 |
-
public function __construct($level = Logger::DEBUG)
|
30 |
-
{
|
31 |
-
parent::__construct($level, false);
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* {@inheritdoc}
|
36 |
-
*/
|
37 |
-
public function handle(array $record)
|
38 |
-
{
|
39 |
-
if ($record['level'] < $this->level) {
|
40 |
-
return false;
|
41 |
-
}
|
42 |
-
|
43 |
-
return true;
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php
DELETED
@@ -1,242 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Exception;
|
15 |
-
use Monolog\Formatter\LineFormatter;
|
16 |
-
use Monolog\Logger;
|
17 |
-
use PhpConsole\Connector;
|
18 |
-
use PhpConsole\Handler;
|
19 |
-
use PhpConsole\Helper;
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Monolog handler for Google Chrome extension "PHP Console"
|
23 |
-
*
|
24 |
-
* Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely
|
25 |
-
*
|
26 |
-
* Usage:
|
27 |
-
* 1. Install Google Chrome extension https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef
|
28 |
-
* 2. See overview https://github.com/barbushin/php-console#overview
|
29 |
-
* 3. Install PHP Console library https://github.com/barbushin/php-console#installation
|
30 |
-
* 4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png)
|
31 |
-
*
|
32 |
-
* $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler()));
|
33 |
-
* \Monolog\ErrorHandler::register($logger);
|
34 |
-
* echo $undefinedVar;
|
35 |
-
* $logger->addDebug('SELECT * FROM users', array('db', 'time' => 0.012));
|
36 |
-
* PC::debug($_SERVER); // PHP Console debugger for any type of vars
|
37 |
-
*
|
38 |
-
* @author Sergey Barbushin https://www.linkedin.com/in/barbushin
|
39 |
-
*/
|
40 |
-
class PHPConsoleHandler extends AbstractProcessingHandler
|
41 |
-
{
|
42 |
-
private $options = array(
|
43 |
-
'enabled' => true, // bool Is PHP Console server enabled
|
44 |
-
'classesPartialsTraceIgnore' => array('Monolog\\'), // array Hide calls of classes started with...
|
45 |
-
'debugTagsKeysInContext' => array(0, 'tag'), // bool Is PHP Console server enabled
|
46 |
-
'useOwnErrorsHandler' => false, // bool Enable errors handling
|
47 |
-
'useOwnExceptionsHandler' => false, // bool Enable exceptions handling
|
48 |
-
'sourcesBasePath' => null, // string Base path of all project sources to strip in errors source paths
|
49 |
-
'registerHelper' => true, // bool Register PhpConsole\Helper that allows short debug calls like PC::debug($var, 'ta.g.s')
|
50 |
-
'serverEncoding' => null, // string|null Server internal encoding
|
51 |
-
'headersLimit' => null, // int|null Set headers size limit for your web-server
|
52 |
-
'password' => null, // string|null Protect PHP Console connection by password
|
53 |
-
'enableSslOnlyMode' => false, // bool Force connection by SSL for clients with PHP Console installed
|
54 |
-
'ipMasks' => array(), // array Set IP masks of clients that will be allowed to connect to PHP Console: array('192.168.*.*', '127.0.0.1')
|
55 |
-
'enableEvalListener' => false, // bool Enable eval request to be handled by eval dispatcher(if enabled, 'password' option is also required)
|
56 |
-
'dumperDetectCallbacks' => false, // bool Convert callback items in dumper vars to (callback SomeClass::someMethod) strings
|
57 |
-
'dumperLevelLimit' => 5, // int Maximum dumped vars array or object nested dump level
|
58 |
-
'dumperItemsCountLimit' => 100, // int Maximum dumped var same level array items or object properties number
|
59 |
-
'dumperItemSizeLimit' => 5000, // int Maximum length of any string or dumped array item
|
60 |
-
'dumperDumpSizeLimit' => 500000, // int Maximum approximate size of dumped vars result formatted in JSON
|
61 |
-
'detectDumpTraceAndSource' => false, // bool Autodetect and append trace data to debug
|
62 |
-
'dataStorage' => null, // PhpConsole\Storage|null Fixes problem with custom $_SESSION handler(see http://goo.gl/Ne8juJ)
|
63 |
-
);
|
64 |
-
|
65 |
-
/** @var Connector */
|
66 |
-
private $connector;
|
67 |
-
|
68 |
-
/**
|
69 |
-
* @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
|
70 |
-
* @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
|
71 |
-
* @param int $level
|
72 |
-
* @param bool $bubble
|
73 |
-
* @throws Exception
|
74 |
-
*/
|
75 |
-
public function __construct(array $options = array(), Connector $connector = null, $level = Logger::DEBUG, $bubble = true)
|
76 |
-
{
|
77 |
-
if (!class_exists('PhpConsole\Connector')) {
|
78 |
-
throw new Exception('PHP Console library not found. See https://github.com/barbushin/php-console#installation');
|
79 |
-
}
|
80 |
-
parent::__construct($level, $bubble);
|
81 |
-
$this->options = $this->initOptions($options);
|
82 |
-
$this->connector = $this->initConnector($connector);
|
83 |
-
}
|
84 |
-
|
85 |
-
private function initOptions(array $options)
|
86 |
-
{
|
87 |
-
$wrongOptions = array_diff(array_keys($options), array_keys($this->options));
|
88 |
-
if ($wrongOptions) {
|
89 |
-
throw new Exception('Unknown options: ' . implode(', ', $wrongOptions));
|
90 |
-
}
|
91 |
-
|
92 |
-
return array_replace($this->options, $options);
|
93 |
-
}
|
94 |
-
|
95 |
-
private function initConnector(Connector $connector = null)
|
96 |
-
{
|
97 |
-
if (!$connector) {
|
98 |
-
if ($this->options['dataStorage']) {
|
99 |
-
Connector::setPostponeStorage($this->options['dataStorage']);
|
100 |
-
}
|
101 |
-
$connector = Connector::getInstance();
|
102 |
-
}
|
103 |
-
|
104 |
-
if ($this->options['registerHelper'] && !Helper::isRegistered()) {
|
105 |
-
Helper::register();
|
106 |
-
}
|
107 |
-
|
108 |
-
if ($this->options['enabled'] && $connector->isActiveClient()) {
|
109 |
-
if ($this->options['useOwnErrorsHandler'] || $this->options['useOwnExceptionsHandler']) {
|
110 |
-
$handler = Handler::getInstance();
|
111 |
-
$handler->setHandleErrors($this->options['useOwnErrorsHandler']);
|
112 |
-
$handler->setHandleExceptions($this->options['useOwnExceptionsHandler']);
|
113 |
-
$handler->start();
|
114 |
-
}
|
115 |
-
if ($this->options['sourcesBasePath']) {
|
116 |
-
$connector->setSourcesBasePath($this->options['sourcesBasePath']);
|
117 |
-
}
|
118 |
-
if ($this->options['serverEncoding']) {
|
119 |
-
$connector->setServerEncoding($this->options['serverEncoding']);
|
120 |
-
}
|
121 |
-
if ($this->options['password']) {
|
122 |
-
$connector->setPassword($this->options['password']);
|
123 |
-
}
|
124 |
-
if ($this->options['enableSslOnlyMode']) {
|
125 |
-
$connector->enableSslOnlyMode();
|
126 |
-
}
|
127 |
-
if ($this->options['ipMasks']) {
|
128 |
-
$connector->setAllowedIpMasks($this->options['ipMasks']);
|
129 |
-
}
|
130 |
-
if ($this->options['headersLimit']) {
|
131 |
-
$connector->setHeadersLimit($this->options['headersLimit']);
|
132 |
-
}
|
133 |
-
if ($this->options['detectDumpTraceAndSource']) {
|
134 |
-
$connector->getDebugDispatcher()->detectTraceAndSource = true;
|
135 |
-
}
|
136 |
-
$dumper = $connector->getDumper();
|
137 |
-
$dumper->levelLimit = $this->options['dumperLevelLimit'];
|
138 |
-
$dumper->itemsCountLimit = $this->options['dumperItemsCountLimit'];
|
139 |
-
$dumper->itemSizeLimit = $this->options['dumperItemSizeLimit'];
|
140 |
-
$dumper->dumpSizeLimit = $this->options['dumperDumpSizeLimit'];
|
141 |
-
$dumper->detectCallbacks = $this->options['dumperDetectCallbacks'];
|
142 |
-
if ($this->options['enableEvalListener']) {
|
143 |
-
$connector->startEvalRequestsListener();
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
return $connector;
|
148 |
-
}
|
149 |
-
|
150 |
-
public function getConnector()
|
151 |
-
{
|
152 |
-
return $this->connector;
|
153 |
-
}
|
154 |
-
|
155 |
-
public function getOptions()
|
156 |
-
{
|
157 |
-
return $this->options;
|
158 |
-
}
|
159 |
-
|
160 |
-
public function handle(array $record)
|
161 |
-
{
|
162 |
-
if ($this->options['enabled'] && $this->connector->isActiveClient()) {
|
163 |
-
return parent::handle($record);
|
164 |
-
}
|
165 |
-
|
166 |
-
return !$this->bubble;
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Writes the record down to the log of the implementing handler
|
171 |
-
*
|
172 |
-
* @param array $record
|
173 |
-
* @return void
|
174 |
-
*/
|
175 |
-
protected function write(array $record)
|
176 |
-
{
|
177 |
-
if ($record['level'] < Logger::NOTICE) {
|
178 |
-
$this->handleDebugRecord($record);
|
179 |
-
} elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) {
|
180 |
-
$this->handleExceptionRecord($record);
|
181 |
-
} else {
|
182 |
-
$this->handleErrorRecord($record);
|
183 |
-
}
|
184 |
-
}
|
185 |
-
|
186 |
-
private function handleDebugRecord(array $record)
|
187 |
-
{
|
188 |
-
$tags = $this->getRecordTags($record);
|
189 |
-
$message = $record['message'];
|
190 |
-
if ($record['context']) {
|
191 |
-
$message .= ' ' . json_encode($this->connector->getDumper()->dump(array_filter($record['context'])));
|
192 |
-
}
|
193 |
-
$this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']);
|
194 |
-
}
|
195 |
-
|
196 |
-
private function handleExceptionRecord(array $record)
|
197 |
-
{
|
198 |
-
$this->connector->getErrorsDispatcher()->dispatchException($record['context']['exception']);
|
199 |
-
}
|
200 |
-
|
201 |
-
private function handleErrorRecord(array $record)
|
202 |
-
{
|
203 |
-
$context = $record['context'];
|
204 |
-
|
205 |
-
$this->connector->getErrorsDispatcher()->dispatchError(
|
206 |
-
isset($context['code']) ? $context['code'] : null,
|
207 |
-
isset($context['message']) ? $context['message'] : $record['message'],
|
208 |
-
isset($context['file']) ? $context['file'] : null,
|
209 |
-
isset($context['line']) ? $context['line'] : null,
|
210 |
-
$this->options['classesPartialsTraceIgnore']
|
211 |
-
);
|
212 |
-
}
|
213 |
-
|
214 |
-
private function getRecordTags(array &$record)
|
215 |
-
{
|
216 |
-
$tags = null;
|
217 |
-
if (!empty($record['context'])) {
|
218 |
-
$context = & $record['context'];
|
219 |
-
foreach ($this->options['debugTagsKeysInContext'] as $key) {
|
220 |
-
if (!empty($context[$key])) {
|
221 |
-
$tags = $context[$key];
|
222 |
-
if ($key === 0) {
|
223 |
-
array_shift($context);
|
224 |
-
} else {
|
225 |
-
unset($context[$key]);
|
226 |
-
}
|
227 |
-
break;
|
228 |
-
}
|
229 |
-
}
|
230 |
-
}
|
231 |
-
|
232 |
-
return $tags ?: strtolower($record['level_name']);
|
233 |
-
}
|
234 |
-
|
235 |
-
/**
|
236 |
-
* {@inheritDoc}
|
237 |
-
*/
|
238 |
-
protected function getDefaultFormatter()
|
239 |
-
{
|
240 |
-
return new LineFormatter('%message%');
|
241 |
-
}
|
242 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Psr\Log\LoggerInterface;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Proxies log messages to an existing PSR-3 compliant logger.
|
19 |
-
*
|
20 |
-
* @author Michael Moussa <michael.moussa@gmail.com>
|
21 |
-
*/
|
22 |
-
class PsrHandler extends AbstractHandler
|
23 |
-
{
|
24 |
-
/**
|
25 |
-
* PSR-3 compliant logger
|
26 |
-
*
|
27 |
-
* @var LoggerInterface
|
28 |
-
*/
|
29 |
-
protected $logger;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied
|
33 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
34 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
35 |
-
*/
|
36 |
-
public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true)
|
37 |
-
{
|
38 |
-
parent::__construct($level, $bubble);
|
39 |
-
|
40 |
-
$this->logger = $logger;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* {@inheritDoc}
|
45 |
-
*/
|
46 |
-
public function handle(array $record)
|
47 |
-
{
|
48 |
-
if (!$this->isHandling($record)) {
|
49 |
-
return false;
|
50 |
-
}
|
51 |
-
|
52 |
-
$this->logger->log(strtolower($record['level_name']), $record['message'], $record['context']);
|
53 |
-
|
54 |
-
return false === $this->bubble;
|
55 |
-
}
|
56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php
DELETED
@@ -1,185 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Sends notifications through the pushover api to mobile phones
|
18 |
-
*
|
19 |
-
* @author Sebastian Göttschkes <sebastian.goettschkes@googlemail.com>
|
20 |
-
* @see https://www.pushover.net/api
|
21 |
-
*/
|
22 |
-
class PushoverHandler extends SocketHandler
|
23 |
-
{
|
24 |
-
private $token;
|
25 |
-
private $users;
|
26 |
-
private $title;
|
27 |
-
private $user;
|
28 |
-
private $retry;
|
29 |
-
private $expire;
|
30 |
-
|
31 |
-
private $highPriorityLevel;
|
32 |
-
private $emergencyLevel;
|
33 |
-
private $useFormattedMessage = false;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* All parameters that can be sent to Pushover
|
37 |
-
* @see https://pushover.net/api
|
38 |
-
* @var array
|
39 |
-
*/
|
40 |
-
private $parameterNames = array(
|
41 |
-
'token' => true,
|
42 |
-
'user' => true,
|
43 |
-
'message' => true,
|
44 |
-
'device' => true,
|
45 |
-
'title' => true,
|
46 |
-
'url' => true,
|
47 |
-
'url_title' => true,
|
48 |
-
'priority' => true,
|
49 |
-
'timestamp' => true,
|
50 |
-
'sound' => true,
|
51 |
-
'retry' => true,
|
52 |
-
'expire' => true,
|
53 |
-
'callback' => true,
|
54 |
-
);
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Sounds the api supports by default
|
58 |
-
* @see https://pushover.net/api#sounds
|
59 |
-
* @var array
|
60 |
-
*/
|
61 |
-
private $sounds = array(
|
62 |
-
'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming',
|
63 |
-
'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb',
|
64 |
-
'persistent', 'echo', 'updown', 'none',
|
65 |
-
);
|
66 |
-
|
67 |
-
/**
|
68 |
-
* @param string $token Pushover api token
|
69 |
-
* @param string|array $users Pushover user id or array of ids the message will be sent to
|
70 |
-
* @param string $title Title sent to the Pushover API
|
71 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
72 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
73 |
-
* @param bool $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
|
74 |
-
* the pushover.net app owner. OpenSSL is required for this option.
|
75 |
-
* @param int $highPriorityLevel The minimum logging level at which this handler will start
|
76 |
-
* sending "high priority" requests to the Pushover API
|
77 |
-
* @param int $emergencyLevel The minimum logging level at which this handler will start
|
78 |
-
* sending "emergency" requests to the Pushover API
|
79 |
-
* @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
|
80 |
-
* @param int $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
|
81 |
-
*/
|
82 |
-
public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200)
|
83 |
-
{
|
84 |
-
$connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80';
|
85 |
-
parent::__construct($connectionString, $level, $bubble);
|
86 |
-
|
87 |
-
$this->token = $token;
|
88 |
-
$this->users = (array) $users;
|
89 |
-
$this->title = $title ?: gethostname();
|
90 |
-
$this->highPriorityLevel = Logger::toMonologLevel($highPriorityLevel);
|
91 |
-
$this->emergencyLevel = Logger::toMonologLevel($emergencyLevel);
|
92 |
-
$this->retry = $retry;
|
93 |
-
$this->expire = $expire;
|
94 |
-
}
|
95 |
-
|
96 |
-
protected function generateDataStream($record)
|
97 |
-
{
|
98 |
-
$content = $this->buildContent($record);
|
99 |
-
|
100 |
-
return $this->buildHeader($content) . $content;
|
101 |
-
}
|
102 |
-
|
103 |
-
private function buildContent($record)
|
104 |
-
{
|
105 |
-
// Pushover has a limit of 512 characters on title and message combined.
|
106 |
-
$maxMessageLength = 512 - strlen($this->title);
|
107 |
-
|
108 |
-
$message = ($this->useFormattedMessage) ? $record['formatted'] : $record['message'];
|
109 |
-
$message = substr($message, 0, $maxMessageLength);
|
110 |
-
|
111 |
-
$timestamp = $record['datetime']->getTimestamp();
|
112 |
-
|
113 |
-
$dataArray = array(
|
114 |
-
'token' => $this->token,
|
115 |
-
'user' => $this->user,
|
116 |
-
'message' => $message,
|
117 |
-
'title' => $this->title,
|
118 |
-
'timestamp' => $timestamp,
|
119 |
-
);
|
120 |
-
|
121 |
-
if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) {
|
122 |
-
$dataArray['priority'] = 2;
|
123 |
-
$dataArray['retry'] = $this->retry;
|
124 |
-
$dataArray['expire'] = $this->expire;
|
125 |
-
} elseif (isset($record['level']) && $record['level'] >= $this->highPriorityLevel) {
|
126 |
-
$dataArray['priority'] = 1;
|
127 |
-
}
|
128 |
-
|
129 |
-
// First determine the available parameters
|
130 |
-
$context = array_intersect_key($record['context'], $this->parameterNames);
|
131 |
-
$extra = array_intersect_key($record['extra'], $this->parameterNames);
|
132 |
-
|
133 |
-
// Least important info should be merged with subsequent info
|
134 |
-
$dataArray = array_merge($extra, $context, $dataArray);
|
135 |
-
|
136 |
-
// Only pass sounds that are supported by the API
|
137 |
-
if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) {
|
138 |
-
unset($dataArray['sound']);
|
139 |
-
}
|
140 |
-
|
141 |
-
return http_build_query($dataArray);
|
142 |
-
}
|
143 |
-
|
144 |
-
private function buildHeader($content)
|
145 |
-
{
|
146 |
-
$header = "POST /1/messages.json HTTP/1.1\r\n";
|
147 |
-
$header .= "Host: api.pushover.net\r\n";
|
148 |
-
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
|
149 |
-
$header .= "Content-Length: " . strlen($content) . "\r\n";
|
150 |
-
$header .= "\r\n";
|
151 |
-
|
152 |
-
return $header;
|
153 |
-
}
|
154 |
-
|
155 |
-
protected function write(array $record)
|
156 |
-
{
|
157 |
-
foreach ($this->users as $user) {
|
158 |
-
$this->user = $user;
|
159 |
-
|
160 |
-
parent::write($record);
|
161 |
-
$this->closeSocket();
|
162 |
-
}
|
163 |
-
|
164 |
-
$this->user = null;
|
165 |
-
}
|
166 |
-
|
167 |
-
public function setHighPriorityLevel($value)
|
168 |
-
{
|
169 |
-
$this->highPriorityLevel = $value;
|
170 |
-
}
|
171 |
-
|
172 |
-
public function setEmergencyLevel($value)
|
173 |
-
{
|
174 |
-
$this->emergencyLevel = $value;
|
175 |
-
}
|
176 |
-
|
177 |
-
/**
|
178 |
-
* Use the formatted message?
|
179 |
-
* @param bool $value
|
180 |
-
*/
|
181 |
-
public function useFormattedMessage($value)
|
182 |
-
{
|
183 |
-
$this->useFormattedMessage = (bool) $value;
|
184 |
-
}
|
185 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php
DELETED
@@ -1,232 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\LineFormatter;
|
15 |
-
use Monolog\Formatter\FormatterInterface;
|
16 |
-
use Monolog\Logger;
|
17 |
-
use Raven_Client;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server
|
21 |
-
* using sentry-php (https://github.com/getsentry/sentry-php)
|
22 |
-
*
|
23 |
-
* @author Marc Abramowitz <marc@marc-abramowitz.com>
|
24 |
-
*/
|
25 |
-
class RavenHandler extends AbstractProcessingHandler
|
26 |
-
{
|
27 |
-
/**
|
28 |
-
* Translates Monolog log levels to Raven log levels.
|
29 |
-
*/
|
30 |
-
protected $logLevels = array(
|
31 |
-
Logger::DEBUG => Raven_Client::DEBUG,
|
32 |
-
Logger::INFO => Raven_Client::INFO,
|
33 |
-
Logger::NOTICE => Raven_Client::INFO,
|
34 |
-
Logger::WARNING => Raven_Client::WARNING,
|
35 |
-
Logger::ERROR => Raven_Client::ERROR,
|
36 |
-
Logger::CRITICAL => Raven_Client::FATAL,
|
37 |
-
Logger::ALERT => Raven_Client::FATAL,
|
38 |
-
Logger::EMERGENCY => Raven_Client::FATAL,
|
39 |
-
);
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @var string should represent the current version of the calling
|
43 |
-
* software. Can be any string (git commit, version number)
|
44 |
-
*/
|
45 |
-
protected $release;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @var Raven_Client the client object that sends the message to the server
|
49 |
-
*/
|
50 |
-
protected $ravenClient;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @var LineFormatter The formatter to use for the logs generated via handleBatch()
|
54 |
-
*/
|
55 |
-
protected $batchFormatter;
|
56 |
-
|
57 |
-
/**
|
58 |
-
* @param Raven_Client $ravenClient
|
59 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
60 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
61 |
-
*/
|
62 |
-
public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true)
|
63 |
-
{
|
64 |
-
parent::__construct($level, $bubble);
|
65 |
-
|
66 |
-
$this->ravenClient = $ravenClient;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* {@inheritdoc}
|
71 |
-
*/
|
72 |
-
public function handleBatch(array $records)
|
73 |
-
{
|
74 |
-
$level = $this->level;
|
75 |
-
|
76 |
-
// filter records based on their level
|
77 |
-
$records = array_filter($records, function ($record) use ($level) {
|
78 |
-
return $record['level'] >= $level;
|
79 |
-
});
|
80 |
-
|
81 |
-
if (!$records) {
|
82 |
-
return;
|
83 |
-
}
|
84 |
-
|
85 |
-
// the record with the highest severity is the "main" one
|
86 |
-
$record = array_reduce($records, function ($highest, $record) {
|
87 |
-
if ($record['level'] > $highest['level']) {
|
88 |
-
return $record;
|
89 |
-
}
|
90 |
-
|
91 |
-
return $highest;
|
92 |
-
});
|
93 |
-
|
94 |
-
// the other ones are added as a context item
|
95 |
-
$logs = array();
|
96 |
-
foreach ($records as $r) {
|
97 |
-
$logs[] = $this->processRecord($r);
|
98 |
-
}
|
99 |
-
|
100 |
-
if ($logs) {
|
101 |
-
$record['context']['logs'] = (string) $this->getBatchFormatter()->formatBatch($logs);
|
102 |
-
}
|
103 |
-
|
104 |
-
$this->handle($record);
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Sets the formatter for the logs generated by handleBatch().
|
109 |
-
*
|
110 |
-
* @param FormatterInterface $formatter
|
111 |
-
*/
|
112 |
-
public function setBatchFormatter(FormatterInterface $formatter)
|
113 |
-
{
|
114 |
-
$this->batchFormatter = $formatter;
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Gets the formatter for the logs generated by handleBatch().
|
119 |
-
*
|
120 |
-
* @return FormatterInterface
|
121 |
-
*/
|
122 |
-
public function getBatchFormatter()
|
123 |
-
{
|
124 |
-
if (!$this->batchFormatter) {
|
125 |
-
$this->batchFormatter = $this->getDefaultBatchFormatter();
|
126 |
-
}
|
127 |
-
|
128 |
-
return $this->batchFormatter;
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* {@inheritdoc}
|
133 |
-
*/
|
134 |
-
protected function write(array $record)
|
135 |
-
{
|
136 |
-
$previousUserContext = false;
|
137 |
-
$options = array();
|
138 |
-
$options['level'] = $this->logLevels[$record['level']];
|
139 |
-
$options['tags'] = array();
|
140 |
-
if (!empty($record['extra']['tags'])) {
|
141 |
-
$options['tags'] = array_merge($options['tags'], $record['extra']['tags']);
|
142 |
-
unset($record['extra']['tags']);
|
143 |
-
}
|
144 |
-
if (!empty($record['context']['tags'])) {
|
145 |
-
$options['tags'] = array_merge($options['tags'], $record['context']['tags']);
|
146 |
-
unset($record['context']['tags']);
|
147 |
-
}
|
148 |
-
if (!empty($record['context']['fingerprint'])) {
|
149 |
-
$options['fingerprint'] = $record['context']['fingerprint'];
|
150 |
-
unset($record['context']['fingerprint']);
|
151 |
-
}
|
152 |
-
if (!empty($record['context']['logger'])) {
|
153 |
-
$options['logger'] = $record['context']['logger'];
|
154 |
-
unset($record['context']['logger']);
|
155 |
-
} else {
|
156 |
-
$options['logger'] = $record['channel'];
|
157 |
-
}
|
158 |
-
foreach ($this->getExtraParameters() as $key) {
|
159 |
-
foreach (array('extra', 'context') as $source) {
|
160 |
-
if (!empty($record[$source][$key])) {
|
161 |
-
$options[$key] = $record[$source][$key];
|
162 |
-
unset($record[$source][$key]);
|
163 |
-
}
|
164 |
-
}
|
165 |
-
}
|
166 |
-
if (!empty($record['context'])) {
|
167 |
-
$options['extra']['context'] = $record['context'];
|
168 |
-
if (!empty($record['context']['user'])) {
|
169 |
-
$previousUserContext = $this->ravenClient->context->user;
|
170 |
-
$this->ravenClient->user_context($record['context']['user']);
|
171 |
-
unset($options['extra']['context']['user']);
|
172 |
-
}
|
173 |
-
}
|
174 |
-
if (!empty($record['extra'])) {
|
175 |
-
$options['extra']['extra'] = $record['extra'];
|
176 |
-
}
|
177 |
-
|
178 |
-
if (!empty($this->release) && !isset($options['release'])) {
|
179 |
-
$options['release'] = $this->release;
|
180 |
-
}
|
181 |
-
|
182 |
-
if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) {
|
183 |
-
$options['message'] = $record['formatted'];
|
184 |
-
$this->ravenClient->captureException($record['context']['exception'], $options);
|
185 |
-
} else {
|
186 |
-
$this->ravenClient->captureMessage($record['formatted'], array(), $options);
|
187 |
-
}
|
188 |
-
|
189 |
-
if ($previousUserContext !== false) {
|
190 |
-
$this->ravenClient->user_context($previousUserContext);
|
191 |
-
}
|
192 |
-
}
|
193 |
-
|
194 |
-
/**
|
195 |
-
* {@inheritDoc}
|
196 |
-
*/
|
197 |
-
protected function getDefaultFormatter()
|
198 |
-
{
|
199 |
-
return new LineFormatter('[%channel%] %message%');
|
200 |
-
}
|
201 |
-
|
202 |
-
/**
|
203 |
-
* Gets the default formatter for the logs generated by handleBatch().
|
204 |
-
*
|
205 |
-
* @return FormatterInterface
|
206 |
-
*/
|
207 |
-
protected function getDefaultBatchFormatter()
|
208 |
-
{
|
209 |
-
return new LineFormatter();
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* Gets extra parameters supported by Raven that can be found in "extra" and "context"
|
214 |
-
*
|
215 |
-
* @return array
|
216 |
-
*/
|
217 |
-
protected function getExtraParameters()
|
218 |
-
{
|
219 |
-
return array('contexts', 'checksum', 'release', 'event_id');
|
220 |
-
}
|
221 |
-
|
222 |
-
/**
|
223 |
-
* @param string $value
|
224 |
-
* @return self
|
225 |
-
*/
|
226 |
-
public function setRelease($value)
|
227 |
-
{
|
228 |
-
$this->release = $value;
|
229 |
-
|
230 |
-
return $this;
|
231 |
-
}
|
232 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\LineFormatter;
|
15 |
-
use Monolog\Logger;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Logs to a Redis key using rpush
|
19 |
-
*
|
20 |
-
* usage example:
|
21 |
-
*
|
22 |
-
* $log = new Logger('application');
|
23 |
-
* $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs", "prod");
|
24 |
-
* $log->pushHandler($redis);
|
25 |
-
*
|
26 |
-
* @author Thomas Tourlourat <thomas@tourlourat.com>
|
27 |
-
*/
|
28 |
-
class RedisHandler extends AbstractProcessingHandler
|
29 |
-
{
|
30 |
-
private $redisClient;
|
31 |
-
private $redisKey;
|
32 |
-
protected $capSize;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @param \Predis\Client|\Redis $redis The redis instance
|
36 |
-
* @param string $key The key name to push records to
|
37 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
38 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
39 |
-
* @param int $capSize Number of entries to limit list size to
|
40 |
-
*/
|
41 |
-
public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true, $capSize = false)
|
42 |
-
{
|
43 |
-
if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) {
|
44 |
-
throw new \InvalidArgumentException('Predis\Client or Redis instance required');
|
45 |
-
}
|
46 |
-
|
47 |
-
$this->redisClient = $redis;
|
48 |
-
$this->redisKey = $key;
|
49 |
-
$this->capSize = $capSize;
|
50 |
-
|
51 |
-
parent::__construct($level, $bubble);
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* {@inheritDoc}
|
56 |
-
*/
|
57 |
-
protected function write(array $record)
|
58 |
-
{
|
59 |
-
if ($this->capSize) {
|
60 |
-
$this->writeCapped($record);
|
61 |
-
} else {
|
62 |
-
$this->redisClient->rpush($this->redisKey, $record["formatted"]);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Write and cap the collection
|
68 |
-
* Writes the record to the redis list and caps its
|
69 |
-
*
|
70 |
-
* @param array $record associative record array
|
71 |
-
* @return void
|
72 |
-
*/
|
73 |
-
protected function writeCapped(array $record)
|
74 |
-
{
|
75 |
-
if ($this->redisClient instanceof \Redis) {
|
76 |
-
$this->redisClient->multi()
|
77 |
-
->rpush($this->redisKey, $record["formatted"])
|
78 |
-
->ltrim($this->redisKey, -$this->capSize, -1)
|
79 |
-
->exec();
|
80 |
-
} else {
|
81 |
-
$redisKey = $this->redisKey;
|
82 |
-
$capSize = $this->capSize;
|
83 |
-
$this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) {
|
84 |
-
$tx->rpush($redisKey, $record["formatted"]);
|
85 |
-
$tx->ltrim($redisKey, -$capSize, -1);
|
86 |
-
});
|
87 |
-
}
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* {@inheritDoc}
|
92 |
-
*/
|
93 |
-
protected function getDefaultFormatter()
|
94 |
-
{
|
95 |
-
return new LineFormatter();
|
96 |
-
}
|
97 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php
DELETED
@@ -1,144 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use RollbarNotifier;
|
15 |
-
use Exception;
|
16 |
-
use Monolog\Logger;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Sends errors to Rollbar
|
20 |
-
*
|
21 |
-
* If the context data contains a `payload` key, that is used as an array
|
22 |
-
* of payload options to RollbarNotifier's report_message/report_exception methods.
|
23 |
-
*
|
24 |
-
* Rollbar's context info will contain the context + extra keys from the log record
|
25 |
-
* merged, and then on top of that a few keys:
|
26 |
-
*
|
27 |
-
* - level (rollbar level name)
|
28 |
-
* - monolog_level (monolog level name, raw level, as rollbar only has 5 but monolog 8)
|
29 |
-
* - channel
|
30 |
-
* - datetime (unix timestamp)
|
31 |
-
*
|
32 |
-
* @author Paul Statezny <paulstatezny@gmail.com>
|
33 |
-
*/
|
34 |
-
class RollbarHandler extends AbstractProcessingHandler
|
35 |
-
{
|
36 |
-
/**
|
37 |
-
* Rollbar notifier
|
38 |
-
*
|
39 |
-
* @var RollbarNotifier
|
40 |
-
*/
|
41 |
-
protected $rollbarNotifier;
|
42 |
-
|
43 |
-
protected $levelMap = array(
|
44 |
-
Logger::DEBUG => 'debug',
|
45 |
-
Logger::INFO => 'info',
|
46 |
-
Logger::NOTICE => 'info',
|
47 |
-
Logger::WARNING => 'warning',
|
48 |
-
Logger::ERROR => 'error',
|
49 |
-
Logger::CRITICAL => 'critical',
|
50 |
-
Logger::ALERT => 'critical',
|
51 |
-
Logger::EMERGENCY => 'critical',
|
52 |
-
);
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Records whether any log records have been added since the last flush of the rollbar notifier
|
56 |
-
*
|
57 |
-
* @var bool
|
58 |
-
*/
|
59 |
-
private $hasRecords = false;
|
60 |
-
|
61 |
-
protected $initialized = false;
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @param RollbarNotifier $rollbarNotifier RollbarNotifier object constructed with valid token
|
65 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
66 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
67 |
-
*/
|
68 |
-
public function __construct(RollbarNotifier $rollbarNotifier, $level = Logger::ERROR, $bubble = true)
|
69 |
-
{
|
70 |
-
$this->rollbarNotifier = $rollbarNotifier;
|
71 |
-
|
72 |
-
parent::__construct($level, $bubble);
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* {@inheritdoc}
|
77 |
-
*/
|
78 |
-
protected function write(array $record)
|
79 |
-
{
|
80 |
-
if (!$this->initialized) {
|
81 |
-
// __destructor() doesn't get called on Fatal errors
|
82 |
-
register_shutdown_function(array($this, 'close'));
|
83 |
-
$this->initialized = true;
|
84 |
-
}
|
85 |
-
|
86 |
-
$context = $record['context'];
|
87 |
-
$payload = array();
|
88 |
-
if (isset($context['payload'])) {
|
89 |
-
$payload = $context['payload'];
|
90 |
-
unset($context['payload']);
|
91 |
-
}
|
92 |
-
$context = array_merge($context, $record['extra'], array(
|
93 |
-
'level' => $this->levelMap[$record['level']],
|
94 |
-
'monolog_level' => $record['level_name'],
|
95 |
-
'channel' => $record['channel'],
|
96 |
-
'datetime' => $record['datetime']->format('U'),
|
97 |
-
));
|
98 |
-
|
99 |
-
if (isset($context['exception']) && $context['exception'] instanceof Exception) {
|
100 |
-
$payload['level'] = $context['level'];
|
101 |
-
$exception = $context['exception'];
|
102 |
-
unset($context['exception']);
|
103 |
-
|
104 |
-
$this->rollbarNotifier->report_exception($exception, $context, $payload);
|
105 |
-
} else {
|
106 |
-
$this->rollbarNotifier->report_message(
|
107 |
-
$record['message'],
|
108 |
-
$context['level'],
|
109 |
-
$context,
|
110 |
-
$payload
|
111 |
-
);
|
112 |
-
}
|
113 |
-
|
114 |
-
$this->hasRecords = true;
|
115 |
-
}
|
116 |
-
|
117 |
-
public function flush()
|
118 |
-
{
|
119 |
-
if ($this->hasRecords) {
|
120 |
-
$this->rollbarNotifier->flush();
|
121 |
-
$this->hasRecords = false;
|
122 |
-
}
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* {@inheritdoc}
|
127 |
-
*/
|
128 |
-
public function close()
|
129 |
-
{
|
130 |
-
$this->flush();
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* {@inheritdoc}
|
135 |
-
*/
|
136 |
-
public function reset()
|
137 |
-
{
|
138 |
-
$this->flush();
|
139 |
-
|
140 |
-
parent::reset();
|
141 |
-
}
|
142 |
-
|
143 |
-
|
144 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php
DELETED
@@ -1,190 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Stores logs to files that are rotated every day and a limited number of files are kept.
|
18 |
-
*
|
19 |
-
* This rotation is only intended to be used as a workaround. Using logrotate to
|
20 |
-
* handle the rotation is strongly encouraged when you can use it.
|
21 |
-
*
|
22 |
-
* @author Christophe Coevoet <stof@notk.org>
|
23 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
24 |
-
*/
|
25 |
-
class RotatingFileHandler extends StreamHandler
|
26 |
-
{
|
27 |
-
const FILE_PER_DAY = 'Y-m-d';
|
28 |
-
const FILE_PER_MONTH = 'Y-m';
|
29 |
-
const FILE_PER_YEAR = 'Y';
|
30 |
-
|
31 |
-
protected $filename;
|
32 |
-
protected $maxFiles;
|
33 |
-
protected $mustRotate;
|
34 |
-
protected $nextRotation;
|
35 |
-
protected $filenameFormat;
|
36 |
-
protected $dateFormat;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @param string $filename
|
40 |
-
* @param int $maxFiles The maximal amount of files to keep (0 means unlimited)
|
41 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
42 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
43 |
-
* @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
|
44 |
-
* @param bool $useLocking Try to lock log file before doing any writes
|
45 |
-
*/
|
46 |
-
public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
|
47 |
-
{
|
48 |
-
$this->filename = $filename;
|
49 |
-
$this->maxFiles = (int) $maxFiles;
|
50 |
-
$this->nextRotation = new \DateTime('tomorrow');
|
51 |
-
$this->filenameFormat = '{filename}-{date}';
|
52 |
-
$this->dateFormat = 'Y-m-d';
|
53 |
-
|
54 |
-
parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking);
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* {@inheritdoc}
|
59 |
-
*/
|
60 |
-
public function close()
|
61 |
-
{
|
62 |
-
parent::close();
|
63 |
-
|
64 |
-
if (true === $this->mustRotate) {
|
65 |
-
$this->rotate();
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* {@inheritdoc}
|
71 |
-
*/
|
72 |
-
public function reset()
|
73 |
-
{
|
74 |
-
parent::reset();
|
75 |
-
|
76 |
-
if (true === $this->mustRotate) {
|
77 |
-
$this->rotate();
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
public function setFilenameFormat($filenameFormat, $dateFormat)
|
82 |
-
{
|
83 |
-
if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) {
|
84 |
-
trigger_error(
|
85 |
-
'Invalid date format - format must be one of '.
|
86 |
-
'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '.
|
87 |
-
'or RotatingFileHandler::FILE_PER_YEAR ("Y"), or you can set one of the '.
|
88 |
-
'date formats using slashes, underscores and/or dots instead of dashes.',
|
89 |
-
E_USER_DEPRECATED
|
90 |
-
);
|
91 |
-
}
|
92 |
-
if (substr_count($filenameFormat, '{date}') === 0) {
|
93 |
-
trigger_error(
|
94 |
-
'Invalid filename format - format should contain at least `{date}`, because otherwise rotating is impossible.',
|
95 |
-
E_USER_DEPRECATED
|
96 |
-
);
|
97 |
-
}
|
98 |
-
$this->filenameFormat = $filenameFormat;
|
99 |
-
$this->dateFormat = $dateFormat;
|
100 |
-
$this->url = $this->getTimedFilename();
|
101 |
-
$this->close();
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* {@inheritdoc}
|
106 |
-
*/
|
107 |
-
protected function write(array $record)
|
108 |
-
{
|
109 |
-
// on the first record written, if the log is new, we should rotate (once per day)
|
110 |
-
if (null === $this->mustRotate) {
|
111 |
-
$this->mustRotate = !file_exists($this->url);
|
112 |
-
}
|
113 |
-
|
114 |
-
if ($this->nextRotation < $record['datetime']) {
|
115 |
-
$this->mustRotate = true;
|
116 |
-
$this->close();
|
117 |
-
}
|
118 |
-
|
119 |
-
parent::write($record);
|
120 |
-
}
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Rotates the files.
|
124 |
-
*/
|
125 |
-
protected function rotate()
|
126 |
-
{
|
127 |
-
// update filename
|
128 |
-
$this->url = $this->getTimedFilename();
|
129 |
-
$this->nextRotation = new \DateTime('tomorrow');
|
130 |
-
|
131 |
-
// skip GC of old logs if files are unlimited
|
132 |
-
if (0 === $this->maxFiles) {
|
133 |
-
return;
|
134 |
-
}
|
135 |
-
|
136 |
-
$logFiles = glob($this->getGlobPattern());
|
137 |
-
if ($this->maxFiles >= count($logFiles)) {
|
138 |
-
// no files to remove
|
139 |
-
return;
|
140 |
-
}
|
141 |
-
|
142 |
-
// Sorting the files by name to remove the older ones
|
143 |
-
usort($logFiles, function ($a, $b) {
|
144 |
-
return strcmp($b, $a);
|
145 |
-
});
|
146 |
-
|
147 |
-
foreach (array_slice($logFiles, $this->maxFiles) as $file) {
|
148 |
-
if (is_writable($file)) {
|
149 |
-
// suppress errors here as unlink() might fail if two processes
|
150 |
-
// are cleaning up/rotating at the same time
|
151 |
-
set_error_handler(function ($errno, $errstr, $errfile, $errline) {});
|
152 |
-
unlink($file);
|
153 |
-
restore_error_handler();
|
154 |
-
}
|
155 |
-
}
|
156 |
-
|
157 |
-
$this->mustRotate = false;
|
158 |
-
}
|
159 |
-
|
160 |
-
protected function getTimedFilename()
|
161 |
-
{
|
162 |
-
$fileInfo = pathinfo($this->filename);
|
163 |
-
$timedFilename = str_replace(
|
164 |
-
array('{filename}', '{date}'),
|
165 |
-
array($fileInfo['filename'], date($this->dateFormat)),
|
166 |
-
$fileInfo['dirname'] . '/' . $this->filenameFormat
|
167 |
-
);
|
168 |
-
|
169 |
-
if (!empty($fileInfo['extension'])) {
|
170 |
-
$timedFilename .= '.'.$fileInfo['extension'];
|
171 |
-
}
|
172 |
-
|
173 |
-
return $timedFilename;
|
174 |
-
}
|
175 |
-
|
176 |
-
protected function getGlobPattern()
|
177 |
-
{
|
178 |
-
$fileInfo = pathinfo($this->filename);
|
179 |
-
$glob = str_replace(
|
180 |
-
array('{filename}', '{date}'),
|
181 |
-
array($fileInfo['filename'], '[0-9][0-9][0-9][0-9]*'),
|
182 |
-
$fileInfo['dirname'] . '/' . $this->filenameFormat
|
183 |
-
);
|
184 |
-
if (!empty($fileInfo['extension'])) {
|
185 |
-
$glob .= '.'.$fileInfo['extension'];
|
186 |
-
}
|
187 |
-
|
188 |
-
return $glob;
|
189 |
-
}
|
190 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Sampling handler
|
16 |
-
*
|
17 |
-
* A sampled event stream can be useful for logging high frequency events in
|
18 |
-
* a production environment where you only need an idea of what is happening
|
19 |
-
* and are not concerned with capturing every occurrence. Since the decision to
|
20 |
-
* handle or not handle a particular event is determined randomly, the
|
21 |
-
* resulting sampled log is not guaranteed to contain 1/N of the events that
|
22 |
-
* occurred in the application, but based on the Law of large numbers, it will
|
23 |
-
* tend to be close to this ratio with a large number of attempts.
|
24 |
-
*
|
25 |
-
* @author Bryan Davis <bd808@wikimedia.org>
|
26 |
-
* @author Kunal Mehta <legoktm@gmail.com>
|
27 |
-
*/
|
28 |
-
class SamplingHandler extends AbstractHandler
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* @var callable|HandlerInterface $handler
|
32 |
-
*/
|
33 |
-
protected $handler;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* @var int $factor
|
37 |
-
*/
|
38 |
-
protected $factor;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
|
42 |
-
* @param int $factor Sample factor
|
43 |
-
*/
|
44 |
-
public function __construct($handler, $factor)
|
45 |
-
{
|
46 |
-
parent::__construct();
|
47 |
-
$this->handler = $handler;
|
48 |
-
$this->factor = $factor;
|
49 |
-
|
50 |
-
if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
|
51 |
-
throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
public function isHandling(array $record)
|
56 |
-
{
|
57 |
-
return $this->handler->isHandling($record);
|
58 |
-
}
|
59 |
-
|
60 |
-
public function handle(array $record)
|
61 |
-
{
|
62 |
-
if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) {
|
63 |
-
// The same logic as in FingersCrossedHandler
|
64 |
-
if (!$this->handler instanceof HandlerInterface) {
|
65 |
-
$this->handler = call_user_func($this->handler, $record, $this);
|
66 |
-
if (!$this->handler instanceof HandlerInterface) {
|
67 |
-
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
if ($this->processors) {
|
72 |
-
foreach ($this->processors as $processor) {
|
73 |
-
$record = call_user_func($processor, $record);
|
74 |
-
}
|
75 |
-
}
|
76 |
-
|
77 |
-
$this->handler->handle($record);
|
78 |
-
}
|
79 |
-
|
80 |
-
return false === $this->bubble;
|
81 |
-
}
|
82 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php
DELETED
@@ -1,294 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler\Slack;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\NormalizerFormatter;
|
16 |
-
use Monolog\Formatter\FormatterInterface;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Slack record utility helping to log to Slack webhooks or API.
|
20 |
-
*
|
21 |
-
* @author Greg Kedzierski <greg@gregkedzierski.com>
|
22 |
-
* @author Haralan Dobrev <hkdobrev@gmail.com>
|
23 |
-
* @see https://api.slack.com/incoming-webhooks
|
24 |
-
* @see https://api.slack.com/docs/message-attachments
|
25 |
-
*/
|
26 |
-
class SlackRecord
|
27 |
-
{
|
28 |
-
const COLOR_DANGER = 'danger';
|
29 |
-
|
30 |
-
const COLOR_WARNING = 'warning';
|
31 |
-
|
32 |
-
const COLOR_GOOD = 'good';
|
33 |
-
|
34 |
-
const COLOR_DEFAULT = '#e3e4e6';
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Slack channel (encoded ID or name)
|
38 |
-
* @var string|null
|
39 |
-
*/
|
40 |
-
private $channel;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Name of a bot
|
44 |
-
* @var string|null
|
45 |
-
*/
|
46 |
-
private $username;
|
47 |
-
|
48 |
-
/**
|
49 |
-
* User icon e.g. 'ghost', 'http://example.com/user.png'
|
50 |
-
* @var string
|
51 |
-
*/
|
52 |
-
private $userIcon;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Whether the message should be added to Slack as attachment (plain text otherwise)
|
56 |
-
* @var bool
|
57 |
-
*/
|
58 |
-
private $useAttachment;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Whether the the context/extra messages added to Slack as attachments are in a short style
|
62 |
-
* @var bool
|
63 |
-
*/
|
64 |
-
private $useShortAttachment;
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Whether the attachment should include context and extra data
|
68 |
-
* @var bool
|
69 |
-
*/
|
70 |
-
private $includeContextAndExtra;
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
|
74 |
-
* @var array
|
75 |
-
*/
|
76 |
-
private $excludeFields;
|
77 |
-
|
78 |
-
/**
|
79 |
-
* @var FormatterInterface
|
80 |
-
*/
|
81 |
-
private $formatter;
|
82 |
-
|
83 |
-
/**
|
84 |
-
* @var NormalizerFormatter
|
85 |
-
*/
|
86 |
-
private $normalizerFormatter;
|
87 |
-
|
88 |
-
public function __construct($channel = null, $username = null, $useAttachment = true, $userIcon = null, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array(), FormatterInterface $formatter = null)
|
89 |
-
{
|
90 |
-
$this->channel = $channel;
|
91 |
-
$this->username = $username;
|
92 |
-
$this->userIcon = trim($userIcon, ':');
|
93 |
-
$this->useAttachment = $useAttachment;
|
94 |
-
$this->useShortAttachment = $useShortAttachment;
|
95 |
-
$this->includeContextAndExtra = $includeContextAndExtra;
|
96 |
-
$this->excludeFields = $excludeFields;
|
97 |
-
$this->formatter = $formatter;
|
98 |
-
|
99 |
-
if ($this->includeContextAndExtra) {
|
100 |
-
$this->normalizerFormatter = new NormalizerFormatter();
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
public function getSlackData(array $record)
|
105 |
-
{
|
106 |
-
$dataArray = array();
|
107 |
-
$record = $this->excludeFields($record);
|
108 |
-
|
109 |
-
if ($this->username) {
|
110 |
-
$dataArray['username'] = $this->username;
|
111 |
-
}
|
112 |
-
|
113 |
-
if ($this->channel) {
|
114 |
-
$dataArray['channel'] = $this->channel;
|
115 |
-
}
|
116 |
-
|
117 |
-
if ($this->formatter && !$this->useAttachment) {
|
118 |
-
$message = $this->formatter->format($record);
|
119 |
-
} else {
|
120 |
-
$message = $record['message'];
|
121 |
-
}
|
122 |
-
|
123 |
-
if ($this->useAttachment) {
|
124 |
-
$attachment = array(
|
125 |
-
'fallback' => $message,
|
126 |
-
'text' => $message,
|
127 |
-
'color' => $this->getAttachmentColor($record['level']),
|
128 |
-
'fields' => array(),
|
129 |
-
'mrkdwn_in' => array('fields'),
|
130 |
-
'ts' => $record['datetime']->getTimestamp()
|
131 |
-
);
|
132 |
-
|
133 |
-
if ($this->useShortAttachment) {
|
134 |
-
$attachment['title'] = $record['level_name'];
|
135 |
-
} else {
|
136 |
-
$attachment['title'] = 'Message';
|
137 |
-
$attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']);
|
138 |
-
}
|
139 |
-
|
140 |
-
|
141 |
-
if ($this->includeContextAndExtra) {
|
142 |
-
foreach (array('extra', 'context') as $key) {
|
143 |
-
if (empty($record[$key])) {
|
144 |
-
continue;
|
145 |
-
}
|
146 |
-
|
147 |
-
if ($this->useShortAttachment) {
|
148 |
-
$attachment['fields'][] = $this->generateAttachmentField(
|
149 |
-
$key,
|
150 |
-
$record[$key]
|
151 |
-
);
|
152 |
-
} else {
|
153 |
-
// Add all extra fields as individual fields in attachment
|
154 |
-
$attachment['fields'] = array_merge(
|
155 |
-
$attachment['fields'],
|
156 |
-
$this->generateAttachmentFields($record[$key])
|
157 |
-
);
|
158 |
-
}
|
159 |
-
}
|
160 |
-
}
|
161 |
-
|
162 |
-
$dataArray['attachments'] = array($attachment);
|
163 |
-
} else {
|
164 |
-
$dataArray['text'] = $message;
|
165 |
-
}
|
166 |
-
|
167 |
-
if ($this->userIcon) {
|
168 |
-
if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) {
|
169 |
-
$dataArray['icon_url'] = $this->userIcon;
|
170 |
-
} else {
|
171 |
-
$dataArray['icon_emoji'] = ":{$this->userIcon}:";
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
return $dataArray;
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Returned a Slack message attachment color associated with
|
180 |
-
* provided level.
|
181 |
-
*
|
182 |
-
* @param int $level
|
183 |
-
* @return string
|
184 |
-
*/
|
185 |
-
public function getAttachmentColor($level)
|
186 |
-
{
|
187 |
-
switch (true) {
|
188 |
-
case $level >= Logger::ERROR:
|
189 |
-
return self::COLOR_DANGER;
|
190 |
-
case $level >= Logger::WARNING:
|
191 |
-
return self::COLOR_WARNING;
|
192 |
-
case $level >= Logger::INFO:
|
193 |
-
return self::COLOR_GOOD;
|
194 |
-
default:
|
195 |
-
return self::COLOR_DEFAULT;
|
196 |
-
}
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Stringifies an array of key/value pairs to be used in attachment fields
|
201 |
-
*
|
202 |
-
* @param array $fields
|
203 |
-
*
|
204 |
-
* @return string
|
205 |
-
*/
|
206 |
-
public function stringify($fields)
|
207 |
-
{
|
208 |
-
$normalized = $this->normalizerFormatter->format($fields);
|
209 |
-
$prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128;
|
210 |
-
|
211 |
-
$hasSecondDimension = count(array_filter($normalized, 'is_array'));
|
212 |
-
$hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
|
213 |
-
|
214 |
-
return $hasSecondDimension || $hasNonNumericKeys
|
215 |
-
? json_encode($normalized, $prettyPrintFlag)
|
216 |
-
: json_encode($normalized);
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Sets the formatter
|
221 |
-
*
|
222 |
-
* @param FormatterInterface $formatter
|
223 |
-
*/
|
224 |
-
public function setFormatter(FormatterInterface $formatter)
|
225 |
-
{
|
226 |
-
$this->formatter = $formatter;
|
227 |
-
}
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Generates attachment field
|
231 |
-
*
|
232 |
-
* @param string $title
|
233 |
-
* @param string|array $value
|
234 |
-
*
|
235 |
-
* @return array
|
236 |
-
*/
|
237 |
-
private function generateAttachmentField($title, $value)
|
238 |
-
{
|
239 |
-
$value = is_array($value)
|
240 |
-
? sprintf('```%s```', $this->stringify($value))
|
241 |
-
: $value;
|
242 |
-
|
243 |
-
return array(
|
244 |
-
'title' => ucfirst($title),
|
245 |
-
'value' => $value,
|
246 |
-
'short' => false
|
247 |
-
);
|
248 |
-
}
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Generates a collection of attachment fields from array
|
252 |
-
*
|
253 |
-
* @param array $data
|
254 |
-
*
|
255 |
-
* @return array
|
256 |
-
*/
|
257 |
-
private function generateAttachmentFields(array $data)
|
258 |
-
{
|
259 |
-
$fields = array();
|
260 |
-
foreach ($this->normalizerFormatter->format($data) as $key => $value) {
|
261 |
-
$fields[] = $this->generateAttachmentField($key, $value);
|
262 |
-
}
|
263 |
-
|
264 |
-
return $fields;
|
265 |
-
}
|
266 |
-
|
267 |
-
/**
|
268 |
-
* Get a copy of record with fields excluded according to $this->excludeFields
|
269 |
-
*
|
270 |
-
* @param array $record
|
271 |
-
*
|
272 |
-
* @return array
|
273 |
-
*/
|
274 |
-
private function excludeFields(array $record)
|
275 |
-
{
|
276 |
-
foreach ($this->excludeFields as $field) {
|
277 |
-
$keys = explode('.', $field);
|
278 |
-
$node = &$record;
|
279 |
-
$lastKey = end($keys);
|
280 |
-
foreach ($keys as $key) {
|
281 |
-
if (!isset($node[$key])) {
|
282 |
-
break;
|
283 |
-
}
|
284 |
-
if ($lastKey === $key) {
|
285 |
-
unset($node[$key]);
|
286 |
-
break;
|
287 |
-
}
|
288 |
-
$node = &$node[$key];
|
289 |
-
}
|
290 |
-
}
|
291 |
-
|
292 |
-
return $record;
|
293 |
-
}
|
294 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php
DELETED
@@ -1,220 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\FormatterInterface;
|
15 |
-
use Monolog\Logger;
|
16 |
-
use Monolog\Handler\Slack\SlackRecord;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Sends notifications through Slack API
|
20 |
-
*
|
21 |
-
* @author Greg Kedzierski <greg@gregkedzierski.com>
|
22 |
-
* @see https://api.slack.com/
|
23 |
-
*/
|
24 |
-
class SlackHandler extends SocketHandler
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* Slack API token
|
28 |
-
* @var string
|
29 |
-
*/
|
30 |
-
private $token;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Instance of the SlackRecord util class preparing data for Slack API.
|
34 |
-
* @var SlackRecord
|
35 |
-
*/
|
36 |
-
private $slackRecord;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @param string $token Slack API token
|
40 |
-
* @param string $channel Slack channel (encoded ID or name)
|
41 |
-
* @param string|null $username Name of a bot
|
42 |
-
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
|
43 |
-
* @param string|null $iconEmoji The emoji name to use (or null)
|
44 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
45 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
46 |
-
* @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
|
47 |
-
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
|
48 |
-
* @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
|
49 |
-
* @throws MissingExtensionException If no OpenSSL PHP extension configured
|
50 |
-
*/
|
51 |
-
public function __construct($token, $channel, $username = null, $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array())
|
52 |
-
{
|
53 |
-
if (!extension_loaded('openssl')) {
|
54 |
-
throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
|
55 |
-
}
|
56 |
-
|
57 |
-
parent::__construct('ssl://slack.com:443', $level, $bubble);
|
58 |
-
|
59 |
-
$this->slackRecord = new SlackRecord(
|
60 |
-
$channel,
|
61 |
-
$username,
|
62 |
-
$useAttachment,
|
63 |
-
$iconEmoji,
|
64 |
-
$useShortAttachment,
|
65 |
-
$includeContextAndExtra,
|
66 |
-
$excludeFields,
|
67 |
-
$this->formatter
|
68 |
-
);
|
69 |
-
|
70 |
-
$this->token = $token;
|
71 |
-
}
|
72 |
-
|
73 |
-
public function getSlackRecord()
|
74 |
-
{
|
75 |
-
return $this->slackRecord;
|
76 |
-
}
|
77 |
-
|
78 |
-
public function getToken()
|
79 |
-
{
|
80 |
-
return $this->token;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* {@inheritdoc}
|
85 |
-
*
|
86 |
-
* @param array $record
|
87 |
-
* @return string
|
88 |
-
*/
|
89 |
-
protected function generateDataStream($record)
|
90 |
-
{
|
91 |
-
$content = $this->buildContent($record);
|
92 |
-
|
93 |
-
return $this->buildHeader($content) . $content;
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Builds the body of API call
|
98 |
-
*
|
99 |
-
* @param array $record
|
100 |
-
* @return string
|
101 |
-
*/
|
102 |
-
private function buildContent($record)
|
103 |
-
{
|
104 |
-
$dataArray = $this->prepareContentData($record);
|
105 |
-
|
106 |
-
return http_build_query($dataArray);
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Prepares content data
|
111 |
-
*
|
112 |
-
* @param array $record
|
113 |
-
* @return array
|
114 |
-
*/
|
115 |
-
protected function prepareContentData($record)
|
116 |
-
{
|
117 |
-
$dataArray = $this->slackRecord->getSlackData($record);
|
118 |
-
$dataArray['token'] = $this->token;
|
119 |
-
|
120 |
-
if (!empty($dataArray['attachments'])) {
|
121 |
-
$dataArray['attachments'] = json_encode($dataArray['attachments']);
|
122 |
-
}
|
123 |
-
|
124 |
-
return $dataArray;
|
125 |
-
}
|
126 |
-
|
127 |
-
/**
|
128 |
-
* Builds the header of the API Call
|
129 |
-
*
|
130 |
-
* @param string $content
|
131 |
-
* @return string
|
132 |
-
*/
|
133 |
-
private function buildHeader($content)
|
134 |
-
{
|
135 |
-
$header = "POST /api/chat.postMessage HTTP/1.1\r\n";
|
136 |
-
$header .= "Host: slack.com\r\n";
|
137 |
-
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
|
138 |
-
$header .= "Content-Length: " . strlen($content) . "\r\n";
|
139 |
-
$header .= "\r\n";
|
140 |
-
|
141 |
-
return $header;
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* {@inheritdoc}
|
146 |
-
*
|
147 |
-
* @param array $record
|
148 |
-
*/
|
149 |
-
protected function write(array $record)
|
150 |
-
{
|
151 |
-
parent::write($record);
|
152 |
-
$this->finalizeWrite();
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* Finalizes the request by reading some bytes and then closing the socket
|
157 |
-
*
|
158 |
-
* If we do not read some but close the socket too early, slack sometimes
|
159 |
-
* drops the request entirely.
|
160 |
-
*/
|
161 |
-
protected function finalizeWrite()
|
162 |
-
{
|
163 |
-
$res = $this->getResource();
|
164 |
-
if (is_resource($res)) {
|
165 |
-
@fread($res, 2048);
|
166 |
-
}
|
167 |
-
$this->closeSocket();
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Returned a Slack message attachment color associated with
|
172 |
-
* provided level.
|
173 |
-
*
|
174 |
-
* @param int $level
|
175 |
-
* @return string
|
176 |
-
* @deprecated Use underlying SlackRecord instead
|
177 |
-
*/
|
178 |
-
protected function getAttachmentColor($level)
|
179 |
-
{
|
180 |
-
trigger_error(
|
181 |
-
'SlackHandler::getAttachmentColor() is deprecated. Use underlying SlackRecord instead.',
|
182 |
-
E_USER_DEPRECATED
|
183 |
-
);
|
184 |
-
|
185 |
-
return $this->slackRecord->getAttachmentColor($level);
|
186 |
-
}
|
187 |
-
|
188 |
-
/**
|
189 |
-
* Stringifies an array of key/value pairs to be used in attachment fields
|
190 |
-
*
|
191 |
-
* @param array $fields
|
192 |
-
* @return string
|
193 |
-
* @deprecated Use underlying SlackRecord instead
|
194 |
-
*/
|
195 |
-
protected function stringify($fields)
|
196 |
-
{
|
197 |
-
trigger_error(
|
198 |
-
'SlackHandler::stringify() is deprecated. Use underlying SlackRecord instead.',
|
199 |
-
E_USER_DEPRECATED
|
200 |
-
);
|
201 |
-
|
202 |
-
return $this->slackRecord->stringify($fields);
|
203 |
-
}
|
204 |
-
|
205 |
-
public function setFormatter(FormatterInterface $formatter)
|
206 |
-
{
|
207 |
-
parent::setFormatter($formatter);
|
208 |
-
$this->slackRecord->setFormatter($formatter);
|
209 |
-
|
210 |
-
return $this;
|
211 |
-
}
|
212 |
-
|
213 |
-
public function getFormatter()
|
214 |
-
{
|
215 |
-
$formatter = parent::getFormatter();
|
216 |
-
$this->slackRecord->setFormatter($formatter);
|
217 |
-
|
218 |
-
return $formatter;
|
219 |
-
}
|
220 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Formatter\FormatterInterface;
|
15 |
-
use Monolog\Logger;
|
16 |
-
use Monolog\Handler\Slack\SlackRecord;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Sends notifications through Slack Webhooks
|
20 |
-
*
|
21 |
-
* @author Haralan Dobrev <hkdobrev@gmail.com>
|
22 |
-
* @see https://api.slack.com/incoming-webhooks
|
23 |
-
*/
|
24 |
-
class SlackWebhookHandler extends AbstractProcessingHandler
|
25 |
-
{
|
26 |
-
/**
|
27 |
-
* Slack Webhook token
|
28 |
-
* @var string
|
29 |
-
*/
|
30 |
-
private $webhookUrl;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Instance of the SlackRecord util class preparing data for Slack API.
|
34 |
-
* @var SlackRecord
|
35 |
-
*/
|
36 |
-
private $slackRecord;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @param string $webhookUrl Slack Webhook URL
|
40 |
-
* @param string|null $channel Slack channel (encoded ID or name)
|
41 |
-
* @param string|null $username Name of a bot
|
42 |
-
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
|
43 |
-
* @param string|null $iconEmoji The emoji name to use (or null)
|
44 |
-
* @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
|
45 |
-
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
|
46 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
47 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
48 |
-
* @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
|
49 |
-
*/
|
50 |
-
public function __construct($webhookUrl, $channel = null, $username = null, $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true, array $excludeFields = array())
|
51 |
-
{
|
52 |
-
parent::__construct($level, $bubble);
|
53 |
-
|
54 |
-
$this->webhookUrl = $webhookUrl;
|
55 |
-
|
56 |
-
$this->slackRecord = new SlackRecord(
|
57 |
-
$channel,
|
58 |
-
$username,
|
59 |
-
$useAttachment,
|
60 |
-
$iconEmoji,
|
61 |
-
$useShortAttachment,
|
62 |
-
$includeContextAndExtra,
|
63 |
-
$excludeFields,
|
64 |
-
$this->formatter
|
65 |
-
);
|
66 |
-
}
|
67 |
-
|
68 |
-
public function getSlackRecord()
|
69 |
-
{
|
70 |
-
return $this->slackRecord;
|
71 |
-
}
|
72 |
-
|
73 |
-
public function getWebhookUrl()
|
74 |
-
{
|
75 |
-
return $this->webhookUrl;
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* {@inheritdoc}
|
80 |
-
*
|
81 |
-
* @param array $record
|
82 |
-
*/
|
83 |
-
protected function write(array $record)
|
84 |
-
{
|
85 |
-
$postData = $this->slackRecord->getSlackData($record);
|
86 |
-
$postString = json_encode($postData);
|
87 |
-
|
88 |
-
$ch = curl_init();
|
89 |
-
$options = array(
|
90 |
-
CURLOPT_URL => $this->webhookUrl,
|
91 |
-
CURLOPT_POST => true,
|
92 |
-
CURLOPT_RETURNTRANSFER => true,
|
93 |
-
CURLOPT_HTTPHEADER => array('Content-type: application/json'),
|
94 |
-
CURLOPT_POSTFIELDS => $postString
|
95 |
-
);
|
96 |
-
if (defined('CURLOPT_SAFE_UPLOAD')) {
|
97 |
-
$options[CURLOPT_SAFE_UPLOAD] = true;
|
98 |
-
}
|
99 |
-
|
100 |
-
curl_setopt_array($ch, $options);
|
101 |
-
|
102 |
-
Curl\Util::execute($ch);
|
103 |
-
}
|
104 |
-
|
105 |
-
public function setFormatter(FormatterInterface $formatter)
|
106 |
-
{
|
107 |
-
parent::setFormatter($formatter);
|
108 |
-
$this->slackRecord->setFormatter($formatter);
|
109 |
-
|
110 |
-
return $this;
|
111 |
-
}
|
112 |
-
|
113 |
-
public function getFormatter()
|
114 |
-
{
|
115 |
-
$formatter = parent::getFormatter();
|
116 |
-
$this->slackRecord->setFormatter($formatter);
|
117 |
-
|
118 |
-
return $formatter;
|
119 |
-
}
|
120 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Sends notifications through Slack's Slackbot
|
18 |
-
*
|
19 |
-
* @author Haralan Dobrev <hkdobrev@gmail.com>
|
20 |
-
* @see https://slack.com/apps/A0F81R8ET-slackbot
|
21 |
-
*/
|
22 |
-
class SlackbotHandler extends AbstractProcessingHandler
|
23 |
-
{
|
24 |
-
/**
|
25 |
-
* The slug of the Slack team
|
26 |
-
* @var string
|
27 |
-
*/
|
28 |
-
private $slackTeam;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Slackbot token
|
32 |
-
* @var string
|
33 |
-
*/
|
34 |
-
private $token;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Slack channel name
|
38 |
-
* @var string
|
39 |
-
*/
|
40 |
-
private $channel;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* @param string $slackTeam Slack team slug
|
44 |
-
* @param string $token Slackbot token
|
45 |
-
* @param string $channel Slack channel (encoded ID or name)
|
46 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
47 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
48 |
-
*/
|
49 |
-
public function __construct($slackTeam, $token, $channel, $level = Logger::CRITICAL, $bubble = true)
|
50 |
-
{
|
51 |
-
parent::__construct($level, $bubble);
|
52 |
-
|
53 |
-
$this->slackTeam = $slackTeam;
|
54 |
-
$this->token = $token;
|
55 |
-
$this->channel = $channel;
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* {@inheritdoc}
|
60 |
-
*
|
61 |
-
* @param array $record
|
62 |
-
*/
|
63 |
-
protected function write(array $record)
|
64 |
-
{
|
65 |
-
$slackbotUrl = sprintf(
|
66 |
-
'https://%s.slack.com/services/hooks/slackbot?token=%s&channel=%s',
|
67 |
-
$this->slackTeam,
|
68 |
-
$this->token,
|
69 |
-
$this->channel
|
70 |
-
);
|
71 |
-
|
72 |
-
$ch = curl_init();
|
73 |
-
curl_setopt($ch, CURLOPT_URL, $slackbotUrl);
|
74 |
-
curl_setopt($ch, CURLOPT_POST, true);
|
75 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
76 |
-
curl_setopt($ch, CURLOPT_POSTFIELDS, $record['message']);
|
77 |
-
|
78 |
-
Curl\Util::execute($ch);
|
79 |
-
}
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php
DELETED
@@ -1,385 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Stores to any socket - uses fsockopen() or pfsockopen().
|
18 |
-
*
|
19 |
-
* @author Pablo de Leon Belloc <pablolb@gmail.com>
|
20 |
-
* @see http://php.net/manual/en/function.fsockopen.php
|
21 |
-
*/
|
22 |
-
class SocketHandler extends AbstractProcessingHandler
|
23 |
-
{
|
24 |
-
private $connectionString;
|
25 |
-
private $connectionTimeout;
|
26 |
-
private $resource;
|
27 |
-
private $timeout = 0;
|
28 |
-
private $writingTimeout = 10;
|
29 |
-
private $lastSentBytes = null;
|
30 |
-
private $chunkSize = null;
|
31 |
-
private $persistent = false;
|
32 |
-
private $errno;
|
33 |
-
private $errstr;
|
34 |
-
private $lastWritingAt;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @param string $connectionString Socket connection string
|
38 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
39 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
40 |
-
*/
|
41 |
-
public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true)
|
42 |
-
{
|
43 |
-
parent::__construct($level, $bubble);
|
44 |
-
$this->connectionString = $connectionString;
|
45 |
-
$this->connectionTimeout = (float) ini_get('default_socket_timeout');
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Connect (if necessary) and write to the socket
|
50 |
-
*
|
51 |
-
* @param array $record
|
52 |
-
*
|
53 |
-
* @throws \UnexpectedValueException
|
54 |
-
* @throws \RuntimeException
|
55 |
-
*/
|
56 |
-
protected function write(array $record)
|
57 |
-
{
|
58 |
-
$this->connectIfNotConnected();
|
59 |
-
$data = $this->generateDataStream($record);
|
60 |
-
$this->writeToSocket($data);
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* We will not close a PersistentSocket instance so it can be reused in other requests.
|
65 |
-
*/
|
66 |
-
public function close()
|
67 |
-
{
|
68 |
-
if (!$this->isPersistent()) {
|
69 |
-
$this->closeSocket();
|
70 |
-
}
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Close socket, if open
|
75 |
-
*/
|
76 |
-
public function closeSocket()
|
77 |
-
{
|
78 |
-
if (is_resource($this->resource)) {
|
79 |
-
fclose($this->resource);
|
80 |
-
$this->resource = null;
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Set socket connection to nbe persistent. It only has effect before the connection is initiated.
|
86 |
-
*
|
87 |
-
* @param bool $persistent
|
88 |
-
*/
|
89 |
-
public function setPersistent($persistent)
|
90 |
-
{
|
91 |
-
$this->persistent = (bool) $persistent;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Set connection timeout. Only has effect before we connect.
|
96 |
-
*
|
97 |
-
* @param float $seconds
|
98 |
-
*
|
99 |
-
* @see http://php.net/manual/en/function.fsockopen.php
|
100 |
-
*/
|
101 |
-
public function setConnectionTimeout($seconds)
|
102 |
-
{
|
103 |
-
$this->validateTimeout($seconds);
|
104 |
-
$this->connectionTimeout = (float) $seconds;
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Set write timeout. Only has effect before we connect.
|
109 |
-
*
|
110 |
-
* @param float $seconds
|
111 |
-
*
|
112 |
-
* @see http://php.net/manual/en/function.stream-set-timeout.php
|
113 |
-
*/
|
114 |
-
public function setTimeout($seconds)
|
115 |
-
{
|
116 |
-
$this->validateTimeout($seconds);
|
117 |
-
$this->timeout = (float) $seconds;
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Set writing timeout. Only has effect during connection in the writing cycle.
|
122 |
-
*
|
123 |
-
* @param float $seconds 0 for no timeout
|
124 |
-
*/
|
125 |
-
public function setWritingTimeout($seconds)
|
126 |
-
{
|
127 |
-
$this->validateTimeout($seconds);
|
128 |
-
$this->writingTimeout = (float) $seconds;
|
129 |
-
}
|
130 |
-
|
131 |
-
/**
|
132 |
-
* Set chunk size. Only has effect during connection in the writing cycle.
|
133 |
-
*
|
134 |
-
* @param float $bytes
|
135 |
-
*/
|
136 |
-
public function setChunkSize($bytes)
|
137 |
-
{
|
138 |
-
$this->chunkSize = $bytes;
|
139 |
-
}
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Get current connection string
|
143 |
-
*
|
144 |
-
* @return string
|
145 |
-
*/
|
146 |
-
public function getConnectionString()
|
147 |
-
{
|
148 |
-
return $this->connectionString;
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Get persistent setting
|
153 |
-
*
|
154 |
-
* @return bool
|
155 |
-
*/
|
156 |
-
public function isPersistent()
|
157 |
-
{
|
158 |
-
return $this->persistent;
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Get current connection timeout setting
|
163 |
-
*
|
164 |
-
* @return float
|
165 |
-
*/
|
166 |
-
public function getConnectionTimeout()
|
167 |
-
{
|
168 |
-
return $this->connectionTimeout;
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Get current in-transfer timeout
|
173 |
-
*
|
174 |
-
* @return float
|
175 |
-
*/
|
176 |
-
public function getTimeout()
|
177 |
-
{
|
178 |
-
return $this->timeout;
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Get current local writing timeout
|
183 |
-
*
|
184 |
-
* @return float
|
185 |
-
*/
|
186 |
-
public function getWritingTimeout()
|
187 |
-
{
|
188 |
-
return $this->writingTimeout;
|
189 |
-
}
|
190 |
-
|
191 |
-
/**
|
192 |
-
* Get current chunk size
|
193 |
-
*
|
194 |
-
* @return float
|
195 |
-
*/
|
196 |
-
public function getChunkSize()
|
197 |
-
{
|
198 |
-
return $this->chunkSize;
|
199 |
-
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* Check to see if the socket is currently available.
|
203 |
-
*
|
204 |
-
* UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.
|
205 |
-
*
|
206 |
-
* @return bool
|
207 |
-
*/
|
208 |
-
public function isConnected()
|
209 |
-
{
|
210 |
-
return is_resource($this->resource)
|
211 |
-
&& !feof($this->resource); // on TCP - other party can close connection.
|
212 |
-
}
|
213 |
-
|
214 |
-
/**
|
215 |
-
* Wrapper to allow mocking
|
216 |
-
*/
|
217 |
-
protected function pfsockopen()
|
218 |
-
{
|
219 |
-
return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout);
|
220 |
-
}
|
221 |
-
|
222 |
-
/**
|
223 |
-
* Wrapper to allow mocking
|
224 |
-
*/
|
225 |
-
protected function fsockopen()
|
226 |
-
{
|
227 |
-
return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout);
|
228 |
-
}
|
229 |
-
|
230 |
-
/**
|
231 |
-
* Wrapper to allow mocking
|
232 |
-
*
|
233 |
-
* @see http://php.net/manual/en/function.stream-set-timeout.php
|
234 |
-
*/
|
235 |
-
protected function streamSetTimeout()
|
236 |
-
{
|
237 |
-
$seconds = floor($this->timeout);
|
238 |
-
$microseconds = round(($this->timeout - $seconds) * 1e6);
|
239 |
-
|
240 |
-
return stream_set_timeout($this->resource, $seconds, $microseconds);
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* Wrapper to allow mocking
|
245 |
-
*
|
246 |
-
* @see http://php.net/manual/en/function.stream-set-chunk-size.php
|
247 |
-
*/
|
248 |
-
protected function streamSetChunkSize()
|
249 |
-
{
|
250 |
-
return stream_set_chunk_size($this->resource, $this->chunkSize);
|
251 |
-
}
|
252 |
-
|
253 |
-
/**
|
254 |
-
* Wrapper to allow mocking
|
255 |
-
*/
|
256 |
-
protected function fwrite($data)
|
257 |
-
{
|
258 |
-
return @fwrite($this->resource, $data);
|
259 |
-
}
|
260 |
-
|
261 |
-
/**
|
262 |
-
* Wrapper to allow mocking
|
263 |
-
*/
|
264 |
-
protected function streamGetMetadata()
|
265 |
-
{
|
266 |
-
return stream_get_meta_data($this->resource);
|
267 |
-
}
|
268 |
-
|
269 |
-
private function validateTimeout($value)
|
270 |
-
{
|
271 |
-
$ok = filter_var($value, FILTER_VALIDATE_FLOAT);
|
272 |
-
if ($ok === false || $value < 0) {
|
273 |
-
throw new \InvalidArgumentException("Timeout must be 0 or a positive float (got $value)");
|
274 |
-
}
|
275 |
-
}
|
276 |
-
|
277 |
-
private function connectIfNotConnected()
|
278 |
-
{
|
279 |
-
if ($this->isConnected()) {
|
280 |
-
return;
|
281 |
-
}
|
282 |
-
$this->connect();
|
283 |
-
}
|
284 |
-
|
285 |
-
protected function generateDataStream($record)
|
286 |
-
{
|
287 |
-
return (string) $record['formatted'];
|
288 |
-
}
|
289 |
-
|
290 |
-
/**
|
291 |
-
* @return resource|null
|
292 |
-
*/
|
293 |
-
protected function getResource()
|
294 |
-
{
|
295 |
-
return $this->resource;
|
296 |
-
}
|
297 |
-
|
298 |
-
private function connect()
|
299 |
-
{
|
300 |
-
$this->createSocketResource();
|
301 |
-
$this->setSocketTimeout();
|
302 |
-
$this->setStreamChunkSize();
|
303 |
-
}
|
304 |
-
|
305 |
-
private function createSocketResource()
|
306 |
-
{
|
307 |
-
if ($this->isPersistent()) {
|
308 |
-
$resource = $this->pfsockopen();
|
309 |
-
} else {
|
310 |
-
$resource = $this->fsockopen();
|
311 |
-
}
|
312 |
-
if (!$resource) {
|
313 |
-
throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)");
|
314 |
-
}
|
315 |
-
$this->resource = $resource;
|
316 |
-
}
|
317 |
-
|
318 |
-
private function setSocketTimeout()
|
319 |
-
{
|
320 |
-
if (!$this->streamSetTimeout()) {
|
321 |
-
throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()");
|
322 |
-
}
|
323 |
-
}
|
324 |
-
|
325 |
-
private function setStreamChunkSize()
|
326 |
-
{
|
327 |
-
if ($this->chunkSize && !$this->streamSetChunkSize()) {
|
328 |
-
throw new \UnexpectedValueException("Failed setting chunk size with stream_set_chunk_size()");
|
329 |
-
}
|
330 |
-
}
|
331 |
-
|
332 |
-
private function writeToSocket($data)
|
333 |
-
{
|
334 |
-
$length = strlen($data);
|
335 |
-
$sent = 0;
|
336 |
-
$this->lastSentBytes = $sent;
|
337 |
-
while ($this->isConnected() && $sent < $length) {
|
338 |
-
if (0 == $sent) {
|
339 |
-
$chunk = $this->fwrite($data);
|
340 |
-
} else {
|
341 |
-
$chunk = $this->fwrite(substr($data, $sent));
|
342 |
-
}
|
343 |
-
if ($chunk === false) {
|
344 |
-
throw new \RuntimeException("Could not write to socket");
|
345 |
-
}
|
346 |
-
$sent += $chunk;
|
347 |
-
$socketInfo = $this->streamGetMetadata();
|
348 |
-
if ($socketInfo['timed_out']) {
|
349 |
-
throw new \RuntimeException("Write timed-out");
|
350 |
-
}
|
351 |
-
|
352 |
-
if ($this->writingIsTimedOut($sent)) {
|
353 |
-
throw new \RuntimeException("Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)");
|
354 |
-
}
|
355 |
-
}
|
356 |
-
if (!$this->isConnected() && $sent < $length) {
|
357 |
-
throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)");
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
private function writingIsTimedOut($sent)
|
362 |
-
{
|
363 |
-
$writingTimeout = (int) floor($this->writingTimeout);
|
364 |
-
if (0 === $writingTimeout) {
|
365 |
-
return false;
|
366 |
-
}
|
367 |
-
|
368 |
-
if ($sent !== $this->lastSentBytes) {
|
369 |
-
$this->lastWritingAt = time();
|
370 |
-
$this->lastSentBytes = $sent;
|
371 |
-
|
372 |
-
return false;
|
373 |
-
} else {
|
374 |
-
usleep(100);
|
375 |
-
}
|
376 |
-
|
377 |
-
if ((time() - $this->lastWritingAt) >= $writingTimeout) {
|
378 |
-
$this->closeSocket();
|
379 |
-
|
380 |
-
return true;
|
381 |
-
}
|
382 |
-
|
383 |
-
return false;
|
384 |
-
}
|
385 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
DELETED
@@ -1,176 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Stores to any stream resource
|
18 |
-
*
|
19 |
-
* Can be used to store into php://stderr, remote and local files, etc.
|
20 |
-
*
|
21 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
22 |
-
*/
|
23 |
-
class StreamHandler extends AbstractProcessingHandler
|
24 |
-
{
|
25 |
-
protected $stream;
|
26 |
-
protected $url;
|
27 |
-
private $errorMessage;
|
28 |
-
protected $filePermission;
|
29 |
-
protected $useLocking;
|
30 |
-
private $dirCreated;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @param resource|string $stream
|
34 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
35 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
36 |
-
* @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
|
37 |
-
* @param bool $useLocking Try to lock log file before doing any writes
|
38 |
-
*
|
39 |
-
* @throws \Exception If a missing directory is not buildable
|
40 |
-
* @throws \InvalidArgumentException If stream is not a resource or string
|
41 |
-
*/
|
42 |
-
public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
|
43 |
-
{
|
44 |
-
parent::__construct($level, $bubble);
|
45 |
-
if (is_resource($stream)) {
|
46 |
-
$this->stream = $stream;
|
47 |
-
} elseif (is_string($stream)) {
|
48 |
-
$this->url = $stream;
|
49 |
-
} else {
|
50 |
-
throw new \InvalidArgumentException('A stream must either be a resource or a string.');
|
51 |
-
}
|
52 |
-
|
53 |
-
$this->filePermission = $filePermission;
|
54 |
-
$this->useLocking = $useLocking;
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* {@inheritdoc}
|
59 |
-
*/
|
60 |
-
public function close()
|
61 |
-
{
|
62 |
-
if ($this->url && is_resource($this->stream)) {
|
63 |
-
fclose($this->stream);
|
64 |
-
}
|
65 |
-
$this->stream = null;
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Return the currently active stream if it is open
|
70 |
-
*
|
71 |
-
* @return resource|null
|
72 |
-
*/
|
73 |
-
public function getStream()
|
74 |
-
{
|
75 |
-
return $this->stream;
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Return the stream URL if it was configured with a URL and not an active resource
|
80 |
-
*
|
81 |
-
* @return string|null
|
82 |
-
*/
|
83 |
-
public function getUrl()
|
84 |
-
{
|
85 |
-
return $this->url;
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* {@inheritdoc}
|
90 |
-
*/
|
91 |
-
protected function write(array $record)
|
92 |
-
{
|
93 |
-
if (!is_resource($this->stream)) {
|
94 |
-
if (null === $this->url || '' === $this->url) {
|
95 |
-
throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');
|
96 |
-
}
|
97 |
-
$this->createDir();
|
98 |
-
$this->errorMessage = null;
|
99 |
-
set_error_handler(array($this, 'customErrorHandler'));
|
100 |
-
$this->stream = fopen($this->url, 'a');
|
101 |
-
if ($this->filePermission !== null) {
|
102 |
-
@chmod($this->url, $this->filePermission);
|
103 |
-
}
|
104 |
-
restore_error_handler();
|
105 |
-
if (!is_resource($this->stream)) {
|
106 |
-
$this->stream = null;
|
107 |
-
throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url));
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
if ($this->useLocking) {
|
112 |
-
// ignoring errors here, there's not much we can do about them
|
113 |
-
flock($this->stream, LOCK_EX);
|
114 |
-
}
|
115 |
-
|
116 |
-
$this->streamWrite($this->stream, $record);
|
117 |
-
|
118 |
-
if ($this->useLocking) {
|
119 |
-
flock($this->stream, LOCK_UN);
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Write to stream
|
125 |
-
* @param resource $stream
|
126 |
-
* @param array $record
|
127 |
-
*/
|
128 |
-
protected function streamWrite($stream, array $record)
|
129 |
-
{
|
130 |
-
fwrite($stream, (string) $record['formatted']);
|
131 |
-
}
|
132 |
-
|
133 |
-
private function customErrorHandler($code, $msg)
|
134 |
-
{
|
135 |
-
$this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg);
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* @param string $stream
|
140 |
-
*
|
141 |
-
* @return null|string
|
142 |
-
*/
|
143 |
-
private function getDirFromStream($stream)
|
144 |
-
{
|
145 |
-
$pos = strpos($stream, '://');
|
146 |
-
if ($pos === false) {
|
147 |
-
return dirname($stream);
|
148 |
-
}
|
149 |
-
|
150 |
-
if ('file://' === substr($stream, 0, 7)) {
|
151 |
-
return dirname(substr($stream, 7));
|
152 |
-
}
|
153 |
-
|
154 |
-
return;
|
155 |
-
}
|
156 |
-
|
157 |
-
private function createDir()
|
158 |
-
{
|
159 |
-
// Do not try to create dir if it has already been tried.
|
160 |
-
if ($this->dirCreated) {
|
161 |
-
return;
|
162 |
-
}
|
163 |
-
|
164 |
-
$dir = $this->getDirFromStream($this->url);
|
165 |
-
if (null !== $dir && !is_dir($dir)) {
|
166 |
-
$this->errorMessage = null;
|
167 |
-
set_error_handler(array($this, 'customErrorHandler'));
|
168 |
-
$status = mkdir($dir, 0777, true);
|
169 |
-
restore_error_handler();
|
170 |
-
if (false === $status && !is_dir($dir)) {
|
171 |
-
throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir));
|
172 |
-
}
|
173 |
-
}
|
174 |
-
$this->dirCreated = true;
|
175 |
-
}
|
176 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php
DELETED
@@ -1,111 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Formatter\FormatterInterface;
|
16 |
-
use Monolog\Formatter\LineFormatter;
|
17 |
-
use Swift;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* SwiftMailerHandler uses Swift_Mailer to send the emails
|
21 |
-
*
|
22 |
-
* @author Gyula Sallai
|
23 |
-
*/
|
24 |
-
class SwiftMailerHandler extends MailHandler
|
25 |
-
{
|
26 |
-
protected $mailer;
|
27 |
-
private $messageTemplate;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* @param \Swift_Mailer $mailer The mailer to use
|
31 |
-
* @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
|
32 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
33 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
34 |
-
*/
|
35 |
-
public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true)
|
36 |
-
{
|
37 |
-
parent::__construct($level, $bubble);
|
38 |
-
|
39 |
-
$this->mailer = $mailer;
|
40 |
-
$this->messageTemplate = $message;
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* {@inheritdoc}
|
45 |
-
*/
|
46 |
-
protected function send($content, array $records)
|
47 |
-
{
|
48 |
-
$this->mailer->send($this->buildMessage($content, $records));
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Gets the formatter for the Swift_Message subject.
|
53 |
-
*
|
54 |
-
* @param string $format The format of the subject
|
55 |
-
* @return FormatterInterface
|
56 |
-
*/
|
57 |
-
protected function getSubjectFormatter($format)
|
58 |
-
{
|
59 |
-
return new LineFormatter($format);
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Creates instance of Swift_Message to be sent
|
64 |
-
*
|
65 |
-
* @param string $content formatted email body to be sent
|
66 |
-
* @param array $records Log records that formed the content
|
67 |
-
* @return \Swift_Message
|
68 |
-
*/
|
69 |
-
protected function buildMessage($content, array $records)
|
70 |
-
{
|
71 |
-
$message = null;
|
72 |
-
if ($this->messageTemplate instanceof \Swift_Message) {
|
73 |
-
$message = clone $this->messageTemplate;
|
74 |
-
$message->generateId();
|
75 |
-
} elseif (is_callable($this->messageTemplate)) {
|
76 |
-
$message = call_user_func($this->messageTemplate, $content, $records);
|
77 |
-
}
|
78 |
-
|
79 |
-
if (!$message instanceof \Swift_Message) {
|
80 |
-
throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it');
|
81 |
-
}
|
82 |
-
|
83 |
-
if ($records) {
|
84 |
-
$subjectFormatter = $this->getSubjectFormatter($message->getSubject());
|
85 |
-
$message->setSubject($subjectFormatter->format($this->getHighestRecord($records)));
|
86 |
-
}
|
87 |
-
|
88 |
-
$message->setBody($content);
|
89 |
-
if (version_compare(Swift::VERSION, '6.0.0', '>=')) {
|
90 |
-
$message->setDate(new \DateTimeImmutable());
|
91 |
-
} else {
|
92 |
-
$message->setDate(time());
|
93 |
-
}
|
94 |
-
|
95 |
-
return $message;
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* BC getter, to be removed in 2.0
|
100 |
-
*/
|
101 |
-
public function __get($name)
|
102 |
-
{
|
103 |
-
if ($name === 'message') {
|
104 |
-
trigger_error('SwiftMailerHandler->message is deprecated, use ->buildMessage() instead to retrieve the message', E_USER_DEPRECATED);
|
105 |
-
|
106 |
-
return $this->buildMessage(null, array());
|
107 |
-
}
|
108 |
-
|
109 |
-
throw new \InvalidArgumentException('Invalid property '.$name);
|
110 |
-
}
|
111 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Logs to syslog service.
|
18 |
-
*
|
19 |
-
* usage example:
|
20 |
-
*
|
21 |
-
* $log = new Logger('application');
|
22 |
-
* $syslog = new SyslogHandler('myfacility', 'local6');
|
23 |
-
* $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%");
|
24 |
-
* $syslog->setFormatter($formatter);
|
25 |
-
* $log->pushHandler($syslog);
|
26 |
-
*
|
27 |
-
* @author Sven Paulus <sven@karlsruhe.org>
|
28 |
-
*/
|
29 |
-
class SyslogHandler extends AbstractSyslogHandler
|
30 |
-
{
|
31 |
-
protected $ident;
|
32 |
-
protected $logopts;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @param string $ident
|
36 |
-
* @param mixed $facility
|
37 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
38 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
39 |
-
* @param int $logopts Option flags for the openlog() call, defaults to LOG_PID
|
40 |
-
*/
|
41 |
-
public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID)
|
42 |
-
{
|
43 |
-
parent::__construct($facility, $level, $bubble);
|
44 |
-
|
45 |
-
$this->ident = $ident;
|
46 |
-
$this->logopts = $logopts;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* {@inheritdoc}
|
51 |
-
*/
|
52 |
-
public function close()
|
53 |
-
{
|
54 |
-
closelog();
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* {@inheritdoc}
|
59 |
-
*/
|
60 |
-
protected function write(array $record)
|
61 |
-
{
|
62 |
-
if (!openlog($this->ident, $this->logopts, $this->facility)) {
|
63 |
-
throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"');
|
64 |
-
}
|
65 |
-
syslog($this->logLevels[$record['level']], (string) $record['formatted']);
|
66 |
-
}
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler\SyslogUdp;
|
13 |
-
|
14 |
-
class UdpSocket
|
15 |
-
{
|
16 |
-
const DATAGRAM_MAX_LENGTH = 65023;
|
17 |
-
|
18 |
-
protected $ip;
|
19 |
-
protected $port;
|
20 |
-
protected $socket;
|
21 |
-
|
22 |
-
public function __construct($ip, $port = 514)
|
23 |
-
{
|
24 |
-
$this->ip = $ip;
|
25 |
-
$this->port = $port;
|
26 |
-
$this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
|
27 |
-
}
|
28 |
-
|
29 |
-
public function write($line, $header = "")
|
30 |
-
{
|
31 |
-
$this->send($this->assembleMessage($line, $header));
|
32 |
-
}
|
33 |
-
|
34 |
-
public function close()
|
35 |
-
{
|
36 |
-
if (is_resource($this->socket)) {
|
37 |
-
socket_close($this->socket);
|
38 |
-
$this->socket = null;
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
42 |
-
protected function send($chunk)
|
43 |
-
{
|
44 |
-
if (!is_resource($this->socket)) {
|
45 |
-
throw new \LogicException('The UdpSocket to '.$this->ip.':'.$this->port.' has been closed and can not be written to anymore');
|
46 |
-
}
|
47 |
-
socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port);
|
48 |
-
}
|
49 |
-
|
50 |
-
protected function assembleMessage($line, $header)
|
51 |
-
{
|
52 |
-
$chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header);
|
53 |
-
|
54 |
-
return $header . substr($line, 0, $chunkSize);
|
55 |
-
}
|
56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
use Monolog\Handler\SyslogUdp\UdpSocket;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* A Handler for logging to a remote syslogd server.
|
19 |
-
*
|
20 |
-
* @author Jesper Skovgaard Nielsen <nulpunkt@gmail.com>
|
21 |
-
*/
|
22 |
-
class SyslogUdpHandler extends AbstractSyslogHandler
|
23 |
-
{
|
24 |
-
protected $socket;
|
25 |
-
protected $ident;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @param string $host
|
29 |
-
* @param int $port
|
30 |
-
* @param mixed $facility
|
31 |
-
* @param int $level The minimum logging level at which this handler will be triggered
|
32 |
-
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
33 |
-
* @param string $ident Program name or tag for each log message.
|
34 |
-
*/
|
35 |
-
public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $ident = 'php')
|
36 |
-
{
|
37 |
-
parent::__construct($facility, $level, $bubble);
|
38 |
-
|
39 |
-
$this->ident = $ident;
|
40 |
-
|
41 |
-
$this->socket = new UdpSocket($host, $port ?: 514);
|
42 |
-
}
|
43 |
-
|
44 |
-
protected function write(array $record)
|
45 |
-
{
|
46 |
-
$lines = $this->splitMessageIntoLines($record['formatted']);
|
47 |
-
|
48 |
-
$header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']]);
|
49 |
-
|
50 |
-
foreach ($lines as $line) {
|
51 |
-
$this->socket->write($line, $header);
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
public function close()
|
56 |
-
{
|
57 |
-
$this->socket->close();
|
58 |
-
}
|
59 |
-
|
60 |
-
private function splitMessageIntoLines($message)
|
61 |
-
{
|
62 |
-
if (is_array($message)) {
|
63 |
-
$message = implode("\n", $message);
|
64 |
-
}
|
65 |
-
|
66 |
-
return preg_split('/$\R?^/m', $message, -1, PREG_SPLIT_NO_EMPTY);
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Make common syslog header (see rfc5424)
|
71 |
-
*/
|
72 |
-
protected function makeCommonSyslogHeader($severity)
|
73 |
-
{
|
74 |
-
$priority = $severity + $this->facility;
|
75 |
-
|
76 |
-
if (!$pid = getmypid()) {
|
77 |
-
$pid = '-';
|
78 |
-
}
|
79 |
-
|
80 |
-
if (!$hostname = gethostname()) {
|
81 |
-
$hostname = '-';
|
82 |
-
}
|
83 |
-
|
84 |
-
return "<$priority>1 " .
|
85 |
-
$this->getDateTime() . " " .
|
86 |
-
$hostname . " " .
|
87 |
-
$this->ident . " " .
|
88 |
-
$pid . " - - ";
|
89 |
-
}
|
90 |
-
|
91 |
-
protected function getDateTime()
|
92 |
-
{
|
93 |
-
return date(\DateTime::RFC3339);
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Inject your own socket, mainly used for testing
|
98 |
-
*/
|
99 |
-
public function setSocket($socket)
|
100 |
-
{
|
101 |
-
$this->socket = $socket;
|
102 |
-
}
|
103 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php
DELETED
@@ -1,164 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Used for testing purposes.
|
16 |
-
*
|
17 |
-
* It records all records and gives you access to them for verification.
|
18 |
-
*
|
19 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
20 |
-
*
|
21 |
-
* @method bool hasEmergency($record)
|
22 |
-
* @method bool hasAlert($record)
|
23 |
-
* @method bool hasCritical($record)
|
24 |
-
* @method bool hasError($record)
|
25 |
-
* @method bool hasWarning($record)
|
26 |
-
* @method bool hasNotice($record)
|
27 |
-
* @method bool hasInfo($record)
|
28 |
-
* @method bool hasDebug($record)
|
29 |
-
*
|
30 |
-
* @method bool hasEmergencyRecords()
|
31 |
-
* @method bool hasAlertRecords()
|
32 |
-
* @method bool hasCriticalRecords()
|
33 |
-
* @method bool hasErrorRecords()
|
34 |
-
* @method bool hasWarningRecords()
|
35 |
-
* @method bool hasNoticeRecords()
|
36 |
-
* @method bool hasInfoRecords()
|
37 |
-
* @method bool hasDebugRecords()
|
38 |
-
*
|
39 |
-
* @method bool hasEmergencyThatContains($message)
|
40 |
-
* @method bool hasAlertThatContains($message)
|
41 |
-
* @method bool hasCriticalThatContains($message)
|
42 |
-
* @method bool hasErrorThatContains($message)
|
43 |
-
* @method bool hasWarningThatContains($message)
|
44 |
-
* @method bool hasNoticeThatContains($message)
|
45 |
-
* @method bool hasInfoThatContains($message)
|
46 |
-
* @method bool hasDebugThatContains($message)
|
47 |
-
*
|
48 |
-
* @method bool hasEmergencyThatMatches($message)
|
49 |
-
* @method bool hasAlertThatMatches($message)
|
50 |
-
* @method bool hasCriticalThatMatches($message)
|
51 |
-
* @method bool hasErrorThatMatches($message)
|
52 |
-
* @method bool hasWarningThatMatches($message)
|
53 |
-
* @method bool hasNoticeThatMatches($message)
|
54 |
-
* @method bool hasInfoThatMatches($message)
|
55 |
-
* @method bool hasDebugThatMatches($message)
|
56 |
-
*
|
57 |
-
* @method bool hasEmergencyThatPasses($message)
|
58 |
-
* @method bool hasAlertThatPasses($message)
|
59 |
-
* @method bool hasCriticalThatPasses($message)
|
60 |
-
* @method bool hasErrorThatPasses($message)
|
61 |
-
* @method bool hasWarningThatPasses($message)
|
62 |
-
* @method bool hasNoticeThatPasses($message)
|
63 |
-
* @method bool hasInfoThatPasses($message)
|
64 |
-
* @method bool hasDebugThatPasses($message)
|
65 |
-
*/
|
66 |
-
class TestHandler extends AbstractProcessingHandler
|
67 |
-
{
|
68 |
-
protected $records = array();
|
69 |
-
protected $recordsByLevel = array();
|
70 |
-
|
71 |
-
public function getRecords()
|
72 |
-
{
|
73 |
-
return $this->records;
|
74 |
-
}
|
75 |
-
|
76 |
-
public function clear()
|
77 |
-
{
|
78 |
-
$this->records = array();
|
79 |
-
$this->recordsByLevel = array();
|
80 |
-
}
|
81 |
-
|
82 |
-
public function hasRecords($level)
|
83 |
-
{
|
84 |
-
return isset($this->recordsByLevel[$level]);
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* @param string|array $record Either a message string or an array containing message and optionally context keys that will be checked against all records
|
89 |
-
* @param int $level Logger::LEVEL constant value
|
90 |
-
*/
|
91 |
-
public function hasRecord($record, $level)
|
92 |
-
{
|
93 |
-
if (is_string($record)) {
|
94 |
-
$record = array('message' => $record);
|
95 |
-
}
|
96 |
-
|
97 |
-
return $this->hasRecordThatPasses(function ($rec) use ($record) {
|
98 |
-
if ($rec['message'] !== $record['message']) {
|
99 |
-
return false;
|
100 |
-
}
|
101 |
-
if (isset($record['context']) && $rec['context'] !== $record['context']) {
|
102 |
-
return false;
|
103 |
-
}
|
104 |
-
return true;
|
105 |
-
}, $level);
|
106 |
-
}
|
107 |
-
|
108 |
-
public function hasRecordThatContains($message, $level)
|
109 |
-
{
|
110 |
-
return $this->hasRecordThatPasses(function ($rec) use ($message) {
|
111 |
-
return strpos($rec['message'], $message) !== false;
|
112 |
-
}, $level);
|
113 |
-
}
|
114 |
-
|
115 |
-
public function hasRecordThatMatches($regex, $level)
|
116 |
-
{
|
117 |
-
return $this->hasRecordThatPasses(function ($rec) use ($regex) {
|
118 |
-
return preg_match($regex, $rec['message']) > 0;
|
119 |
-
}, $level);
|
120 |
-
}
|
121 |
-
|
122 |
-
public function hasRecordThatPasses($predicate, $level)
|
123 |
-
{
|
124 |
-
if (!is_callable($predicate)) {
|
125 |
-
throw new \InvalidArgumentException("Expected a callable for hasRecordThatSucceeds");
|
126 |
-
}
|
127 |
-
|
128 |
-
if (!isset($this->recordsByLevel[$level])) {
|
129 |
-
return false;
|
130 |
-
}
|
131 |
-
|
132 |
-
foreach ($this->recordsByLevel[$level] as $i => $rec) {
|
133 |
-
if (call_user_func($predicate, $rec, $i)) {
|
134 |
-
return true;
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
return false;
|
139 |
-
}
|
140 |
-
|
141 |
-
/**
|
142 |
-
* {@inheritdoc}
|
143 |
-
*/
|
144 |
-
protected function write(array $record)
|
145 |
-
{
|
146 |
-
$this->recordsByLevel[$record['level']][] = $record;
|
147 |
-
$this->records[] = $record;
|
148 |
-
}
|
149 |
-
|
150 |
-
public function __call($method, $args)
|
151 |
-
{
|
152 |
-
if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
|
153 |
-
$genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
|
154 |
-
$level = constant('Monolog\Logger::' . strtoupper($matches[2]));
|
155 |
-
if (method_exists($this, $genericMethod)) {
|
156 |
-
$args[] = $level;
|
157 |
-
|
158 |
-
return call_user_func_array(array($this, $genericMethod), $args);
|
159 |
-
}
|
160 |
-
}
|
161 |
-
|
162 |
-
throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
|
163 |
-
}
|
164 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Handler;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Forwards records to multiple handlers suppressing failures of each handler
|
16 |
-
* and continuing through to give every handler a chance to succeed.
|
17 |
-
*
|
18 |
-
* @author Craig D'Amelio <craig@damelio.ca>
|
19 |
-
*/
|
20 |
-
class WhatFailureGroupHandler extends GroupHandler
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* {@inheritdoc}
|
24 |
-
*/
|
25 |
-
public function handle(array $record)
|
26 |
-
{
|
27 |
-
if ($this->processors) {
|
28 |
-
foreach ($this->processors as $processor) {
|
29 |
-
$record = call_user_func($processor, $record);
|
30 |
-
}
|
31 |
-
}
|
32 |
-
|
33 |
-
foreach ($this->handlers as $handler) {
|
34 |
-
try {
|
35 |
-
$handler->handle($record);
|
36 |
-
} catch (\Exception $e) {
|
37 |
-
// What failure?
|
38 |
-
} catch (\Throwable $e) {
|
39 |
-
// What failure?
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
return false === $this->bubble;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* {@inheritdoc}
|
48 |
-
*/
|
49 |
-
public function handleBatch(array $records)
|
50 |
-
{
|
51 |
-
if ($this->processors) {
|
52 |
-
$processed = array();
|
53 |
-
foreach ($records as $record) {
|
54 |
-
foreach ($this->processors as $processor) {
|
55 |
-
$processed[] = call_user_func($processor, $record);
|
56 |
-
}
|
57 |
-
}
|
58 |
-
$records = $processed;
|
59 |
-
}
|
60 |
-
|
61 |
-
foreach ($this->handlers as $handler) {
|
62 |
-
try {
|
63 |
-
$handler->handleBatch($records);
|
64 |
-
} catch (\Exception $e) {
|
65 |
-
// What failure?
|
66 |
-
} catch (\Throwable $e) {
|
67 |
-
// What failure?
|
68 |
-
}
|
69 |
-
}
|
70 |
-
}
|
71 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* This file is part of the Monolog package.
|
4 |
-
*
|
5 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
6 |
-
*
|
7 |
-
* For the full copyright and license information, please view the LICENSE
|
8 |
-
* file that was distributed with this source code.
|
9 |
-
*/
|
10 |
-
|
11 |
-
namespace Monolog\Handler;
|
12 |
-
|
13 |
-
use Monolog\Formatter\NormalizerFormatter;
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Handler sending logs to Zend Monitor
|
18 |
-
*
|
19 |
-
* @author Christian Bergau <cbergau86@gmail.com>
|
20 |
-
*/
|
21 |
-
class ZendMonitorHandler extends AbstractProcessingHandler
|
22 |
-
{
|
23 |
-
/**
|
24 |
-
* Monolog level / ZendMonitor Custom Event priority map
|
25 |
-
*
|
26 |
-
* @var array
|
27 |
-
*/
|
28 |
-
protected $levelMap = array(
|
29 |
-
Logger::DEBUG => 1,
|
30 |
-
Logger::INFO => 2,
|
31 |
-
Logger::NOTICE => 3,
|
32 |
-
Logger::WARNING => 4,
|
33 |
-
Logger::ERROR => 5,
|
34 |
-
Logger::CRITICAL => 6,
|
35 |
-
Logger::ALERT => 7,
|
36 |
-
Logger::EMERGENCY => 0,
|
37 |
-
);
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Construct
|
41 |
-
*
|
42 |
-
* @param int $level
|
43 |
-
* @param bool $bubble
|
44 |
-
* @throws MissingExtensionException
|
45 |
-
*/
|
46 |
-
public function __construct($level = Logger::DEBUG, $bubble = true)
|
47 |
-
{
|
48 |
-
if (!function_exists('zend_monitor_custom_event')) {
|
49 |
-
throw new MissingExtensionException('You must have Zend Server installed in order to use this handler');
|
50 |
-
}
|
51 |
-
parent::__construct($level, $bubble);
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* {@inheritdoc}
|
56 |
-
*/
|
57 |
-
protected function write(array $record)
|
58 |
-
{
|
59 |
-
$this->writeZendMonitorCustomEvent(
|
60 |
-
$this->levelMap[$record['level']],
|
61 |
-
$record['message'],
|
62 |
-
$record['formatted']
|
63 |
-
);
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Write a record to Zend Monitor
|
68 |
-
*
|
69 |
-
* @param int $level
|
70 |
-
* @param string $message
|
71 |
-
* @param array $formatted
|
72 |
-
*/
|
73 |
-
protected function writeZendMonitorCustomEvent($level, $message, $formatted)
|
74 |
-
{
|
75 |
-
zend_monitor_custom_event($level, $message, $formatted);
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* {@inheritdoc}
|
80 |
-
*/
|
81 |
-
public function getDefaultFormatter()
|
82 |
-
{
|
83 |
-
return new NormalizerFormatter();
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Get the level map
|
88 |
-
*
|
89 |
-
* @return array
|
90 |
-
*/
|
91 |
-
public function getLevelMap()
|
92 |
-
{
|
93 |
-
return $this->levelMap;
|
94 |
-
}
|
95 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Logger.php
DELETED
@@ -1,791 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog;
|
13 |
-
|
14 |
-
use Monolog\Handler\HandlerInterface;
|
15 |
-
use Monolog\Handler\StreamHandler;
|
16 |
-
use Psr\Log\LoggerInterface;
|
17 |
-
use Psr\Log\InvalidArgumentException;
|
18 |
-
use Exception;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Monolog log channel
|
22 |
-
*
|
23 |
-
* It contains a stack of Handlers and a stack of Processors,
|
24 |
-
* and uses them to store records that are added to it.
|
25 |
-
*
|
26 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
27 |
-
*/
|
28 |
-
class Logger implements LoggerInterface, ResettableInterface
|
29 |
-
{
|
30 |
-
/**
|
31 |
-
* Detailed debug information
|
32 |
-
*/
|
33 |
-
const DEBUG = 100;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Interesting events
|
37 |
-
*
|
38 |
-
* Examples: User logs in, SQL logs.
|
39 |
-
*/
|
40 |
-
const INFO = 200;
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Uncommon events
|
44 |
-
*/
|
45 |
-
const NOTICE = 250;
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Exceptional occurrences that are not errors
|
49 |
-
*
|
50 |
-
* Examples: Use of deprecated APIs, poor use of an API,
|
51 |
-
* undesirable things that are not necessarily wrong.
|
52 |
-
*/
|
53 |
-
const WARNING = 300;
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Runtime errors
|
57 |
-
*/
|
58 |
-
const ERROR = 400;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Critical conditions
|
62 |
-
*
|
63 |
-
* Example: Application component unavailable, unexpected exception.
|
64 |
-
*/
|
65 |
-
const CRITICAL = 500;
|
66 |
-
|
67 |
-
/**
|
68 |
-
* Action must be taken immediately
|
69 |
-
*
|
70 |
-
* Example: Entire website down, database unavailable, etc.
|
71 |
-
* This should trigger the SMS alerts and wake you up.
|
72 |
-
*/
|
73 |
-
const ALERT = 550;
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Urgent alert.
|
77 |
-
*/
|
78 |
-
const EMERGENCY = 600;
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Monolog API version
|
82 |
-
*
|
83 |
-
* This is only bumped when API breaks are done and should
|
84 |
-
* follow the major version of the library
|
85 |
-
*
|
86 |
-
* @var int
|
87 |
-
*/
|
88 |
-
const API = 1;
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Logging levels from syslog protocol defined in RFC 5424
|
92 |
-
*
|
93 |
-
* @var array $levels Logging levels
|
94 |
-
*/
|
95 |
-
protected static $levels = array(
|
96 |
-
self::DEBUG => 'DEBUG',
|
97 |
-
self::INFO => 'INFO',
|
98 |
-
self::NOTICE => 'NOTICE',
|
99 |
-
self::WARNING => 'WARNING',
|
100 |
-
self::ERROR => 'ERROR',
|
101 |
-
self::CRITICAL => 'CRITICAL',
|
102 |
-
self::ALERT => 'ALERT',
|
103 |
-
self::EMERGENCY => 'EMERGENCY',
|
104 |
-
);
|
105 |
-
|
106 |
-
/**
|
107 |
-
* @var \DateTimeZone
|
108 |
-
*/
|
109 |
-
protected static $timezone;
|
110 |
-
|
111 |
-
/**
|
112 |
-
* @var string
|
113 |
-
*/
|
114 |
-
protected $name;
|
115 |
-
|
116 |
-
/**
|
117 |
-
* The handler stack
|
118 |
-
*
|
119 |
-
* @var HandlerInterface[]
|
120 |
-
*/
|
121 |
-
protected $handlers;
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Processors that will process all log records
|
125 |
-
*
|
126 |
-
* To process records of a single handler instead, add the processor on that specific handler
|
127 |
-
*
|
128 |
-
* @var callable[]
|
129 |
-
*/
|
130 |
-
protected $processors;
|
131 |
-
|
132 |
-
/**
|
133 |
-
* @var bool
|
134 |
-
*/
|
135 |
-
protected $microsecondTimestamps = true;
|
136 |
-
|
137 |
-
/**
|
138 |
-
* @var callable
|
139 |
-
*/
|
140 |
-
protected $exceptionHandler;
|
141 |
-
|
142 |
-
/**
|
143 |
-
* @param string $name The logging channel
|
144 |
-
* @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc.
|
145 |
-
* @param callable[] $processors Optional array of processors
|
146 |
-
*/
|
147 |
-
public function __construct($name, array $handlers = array(), array $processors = array())
|
148 |
-
{
|
149 |
-
$this->name = $name;
|
150 |
-
$this->setHandlers($handlers);
|
151 |
-
$this->processors = $processors;
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* @return string
|
156 |
-
*/
|
157 |
-
public function getName()
|
158 |
-
{
|
159 |
-
return $this->name;
|
160 |
-
}
|
161 |
-
|
162 |
-
/**
|
163 |
-
* Return a new cloned instance with the name changed
|
164 |
-
*
|
165 |
-
* @return static
|
166 |
-
*/
|
167 |
-
public function withName($name)
|
168 |
-
{
|
169 |
-
$new = clone $this;
|
170 |
-
$new->name = $name;
|
171 |
-
|
172 |
-
return $new;
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Pushes a handler on to the stack.
|
177 |
-
*
|
178 |
-
* @param HandlerInterface $handler
|
179 |
-
* @return $this
|
180 |
-
*/
|
181 |
-
public function pushHandler(HandlerInterface $handler)
|
182 |
-
{
|
183 |
-
array_unshift($this->handlers, $handler);
|
184 |
-
|
185 |
-
return $this;
|
186 |
-
}
|
187 |
-
|
188 |
-
/**
|
189 |
-
* Pops a handler from the stack
|
190 |
-
*
|
191 |
-
* @return HandlerInterface
|
192 |
-
*/
|
193 |
-
public function popHandler()
|
194 |
-
{
|
195 |
-
if (!$this->handlers) {
|
196 |
-
throw new \LogicException('You tried to pop from an empty handler stack.');
|
197 |
-
}
|
198 |
-
|
199 |
-
return array_shift($this->handlers);
|
200 |
-
}
|
201 |
-
|
202 |
-
/**
|
203 |
-
* Set handlers, replacing all existing ones.
|
204 |
-
*
|
205 |
-
* If a map is passed, keys will be ignored.
|
206 |
-
*
|
207 |
-
* @param HandlerInterface[] $handlers
|
208 |
-
* @return $this
|
209 |
-
*/
|
210 |
-
public function setHandlers(array $handlers)
|
211 |
-
{
|
212 |
-
$this->handlers = array();
|
213 |
-
foreach (array_reverse($handlers) as $handler) {
|
214 |
-
$this->pushHandler($handler);
|
215 |
-
}
|
216 |
-
|
217 |
-
return $this;
|
218 |
-
}
|
219 |
-
|
220 |
-
/**
|
221 |
-
* @return HandlerInterface[]
|
222 |
-
*/
|
223 |
-
public function getHandlers()
|
224 |
-
{
|
225 |
-
return $this->handlers;
|
226 |
-
}
|
227 |
-
|
228 |
-
/**
|
229 |
-
* Adds a processor on to the stack.
|
230 |
-
*
|
231 |
-
* @param callable $callback
|
232 |
-
* @return $this
|
233 |
-
*/
|
234 |
-
public function pushProcessor($callback)
|
235 |
-
{
|
236 |
-
if (!is_callable($callback)) {
|
237 |
-
throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
|
238 |
-
}
|
239 |
-
array_unshift($this->processors, $callback);
|
240 |
-
|
241 |
-
return $this;
|
242 |
-
}
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Removes the processor on top of the stack and returns it.
|
246 |
-
*
|
247 |
-
* @return callable
|
248 |
-
*/
|
249 |
-
public function popProcessor()
|
250 |
-
{
|
251 |
-
if (!$this->processors) {
|
252 |
-
throw new \LogicException('You tried to pop from an empty processor stack.');
|
253 |
-
}
|
254 |
-
|
255 |
-
return array_shift($this->processors);
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* @return callable[]
|
260 |
-
*/
|
261 |
-
public function getProcessors()
|
262 |
-
{
|
263 |
-
return $this->processors;
|
264 |
-
}
|
265 |
-
|
266 |
-
/**
|
267 |
-
* Control the use of microsecond resolution timestamps in the 'datetime'
|
268 |
-
* member of new records.
|
269 |
-
*
|
270 |
-
* Generating microsecond resolution timestamps by calling
|
271 |
-
* microtime(true), formatting the result via sprintf() and then parsing
|
272 |
-
* the resulting string via \DateTime::createFromFormat() can incur
|
273 |
-
* a measurable runtime overhead vs simple usage of DateTime to capture
|
274 |
-
* a second resolution timestamp in systems which generate a large number
|
275 |
-
* of log events.
|
276 |
-
*
|
277 |
-
* @param bool $micro True to use microtime() to create timestamps
|
278 |
-
*/
|
279 |
-
public function useMicrosecondTimestamps($micro)
|
280 |
-
{
|
281 |
-
$this->microsecondTimestamps = (bool) $micro;
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Adds a log record.
|
286 |
-
*
|
287 |
-
* @param int $level The logging level
|
288 |
-
* @param string $message The log message
|
289 |
-
* @param array $context The log context
|
290 |
-
* @return bool Whether the record has been processed
|
291 |
-
*/
|
292 |
-
public function addRecord($level, $message, array $context = array())
|
293 |
-
{
|
294 |
-
if (!$this->handlers) {
|
295 |
-
$this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));
|
296 |
-
}
|
297 |
-
|
298 |
-
$levelName = static::getLevelName($level);
|
299 |
-
|
300 |
-
// check if any handler will handle this message so we can return early and save cycles
|
301 |
-
$handlerKey = null;
|
302 |
-
reset($this->handlers);
|
303 |
-
while ($handler = current($this->handlers)) {
|
304 |
-
if ($handler->isHandling(array('level' => $level))) {
|
305 |
-
$handlerKey = key($this->handlers);
|
306 |
-
break;
|
307 |
-
}
|
308 |
-
|
309 |
-
next($this->handlers);
|
310 |
-
}
|
311 |
-
|
312 |
-
if (null === $handlerKey) {
|
313 |
-
return false;
|
314 |
-
}
|
315 |
-
|
316 |
-
if (!static::$timezone) {
|
317 |
-
static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
|
318 |
-
}
|
319 |
-
|
320 |
-
// php7.1+ always has microseconds enabled, so we do not need this hack
|
321 |
-
if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) {
|
322 |
-
$ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone);
|
323 |
-
} else {
|
324 |
-
$ts = new \DateTime(null, static::$timezone);
|
325 |
-
}
|
326 |
-
$ts->setTimezone(static::$timezone);
|
327 |
-
|
328 |
-
$record = array(
|
329 |
-
'message' => (string) $message,
|
330 |
-
'context' => $context,
|
331 |
-
'level' => $level,
|
332 |
-
'level_name' => $levelName,
|
333 |
-
'channel' => $this->name,
|
334 |
-
'datetime' => $ts,
|
335 |
-
'extra' => array(),
|
336 |
-
);
|
337 |
-
|
338 |
-
try {
|
339 |
-
foreach ($this->processors as $processor) {
|
340 |
-
$record = call_user_func($processor, $record);
|
341 |
-
}
|
342 |
-
|
343 |
-
while ($handler = current($this->handlers)) {
|
344 |
-
if (true === $handler->handle($record)) {
|
345 |
-
break;
|
346 |
-
}
|
347 |
-
|
348 |
-
next($this->handlers);
|
349 |
-
}
|
350 |
-
} catch (Exception $e) {
|
351 |
-
$this->handleException($e, $record);
|
352 |
-
}
|
353 |
-
|
354 |
-
return true;
|
355 |
-
}
|
356 |
-
|
357 |
-
/**
|
358 |
-
* Ends a log cycle and frees all resources used by handlers.
|
359 |
-
*
|
360 |
-
* Closing a Handler means flushing all buffers and freeing any open resources/handles.
|
361 |
-
* Handlers that have been closed should be able to accept log records again and re-open
|
362 |
-
* themselves on demand, but this may not always be possible depending on implementation.
|
363 |
-
*
|
364 |
-
* This is useful at the end of a request and will be called automatically on every handler
|
365 |
-
* when they get destructed.
|
366 |
-
*/
|
367 |
-
public function close()
|
368 |
-
{
|
369 |
-
foreach ($this->handlers as $handler) {
|
370 |
-
if (method_exists($handler, 'close')) {
|
371 |
-
$handler->close();
|
372 |
-
}
|
373 |
-
}
|
374 |
-
}
|
375 |
-
|
376 |
-
/**
|
377 |
-
* Ends a log cycle and resets all handlers and processors to their initial state.
|
378 |
-
*
|
379 |
-
* Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal
|
380 |
-
* state, and getting it back to a state in which it can receive log records again.
|
381 |
-
*
|
382 |
-
* This is useful in case you want to avoid logs leaking between two requests or jobs when you
|
383 |
-
* have a long running process like a worker or an application server serving multiple requests
|
384 |
-
* in one process.
|
385 |
-
*/
|
386 |
-
public function reset()
|
387 |
-
{
|
388 |
-
foreach ($this->handlers as $handler) {
|
389 |
-
if ($handler instanceof ResettableInterface) {
|
390 |
-
$handler->reset();
|
391 |
-
}
|
392 |
-
}
|
393 |
-
|
394 |
-
foreach ($this->processors as $processor) {
|
395 |
-
if ($processor instanceof ResettableInterface) {
|
396 |
-
$processor->reset();
|
397 |
-
}
|
398 |
-
}
|
399 |
-
}
|
400 |
-
|
401 |
-
/**
|
402 |
-
* Adds a log record at the DEBUG level.
|
403 |
-
*
|
404 |
-
* @param string $message The log message
|
405 |
-
* @param array $context The log context
|
406 |
-
* @return bool Whether the record has been processed
|
407 |
-
*/
|
408 |
-
public function addDebug($message, array $context = array())
|
409 |
-
{
|
410 |
-
return $this->addRecord(static::DEBUG, $message, $context);
|
411 |
-
}
|
412 |
-
|
413 |
-
/**
|
414 |
-
* Adds a log record at the INFO level.
|
415 |
-
*
|
416 |
-
* @param string $message The log message
|
417 |
-
* @param array $context The log context
|
418 |
-
* @return bool Whether the record has been processed
|
419 |
-
*/
|
420 |
-
public function addInfo($message, array $context = array())
|
421 |
-
{
|
422 |
-
return $this->addRecord(static::INFO, $message, $context);
|
423 |
-
}
|
424 |
-
|
425 |
-
/**
|
426 |
-
* Adds a log record at the NOTICE level.
|
427 |
-
*
|
428 |
-
* @param string $message The log message
|
429 |
-
* @param array $context The log context
|
430 |
-
* @return bool Whether the record has been processed
|
431 |
-
*/
|
432 |
-
public function addNotice($message, array $context = array())
|
433 |
-
{
|
434 |
-
return $this->addRecord(static::NOTICE, $message, $context);
|
435 |
-
}
|
436 |
-
|
437 |
-
/**
|
438 |
-
* Adds a log record at the WARNING level.
|
439 |
-
*
|
440 |
-
* @param string $message The log message
|
441 |
-
* @param array $context The log context
|
442 |
-
* @return bool Whether the record has been processed
|
443 |
-
*/
|
444 |
-
public function addWarning($message, array $context = array())
|
445 |
-
{
|
446 |
-
return $this->addRecord(static::WARNING, $message, $context);
|
447 |
-
}
|
448 |
-
|
449 |
-
/**
|
450 |
-
* Adds a log record at the ERROR level.
|
451 |
-
*
|
452 |
-
* @param string $message The log message
|
453 |
-
* @param array $context The log context
|
454 |
-
* @return bool Whether the record has been processed
|
455 |
-
*/
|
456 |
-
public function addError($message, array $context = array())
|
457 |
-
{
|
458 |
-
return $this->addRecord(static::ERROR, $message, $context);
|
459 |
-
}
|
460 |
-
|
461 |
-
/**
|
462 |
-
* Adds a log record at the CRITICAL level.
|
463 |
-
*
|
464 |
-
* @param string $message The log message
|
465 |
-
* @param array $context The log context
|
466 |
-
* @return bool Whether the record has been processed
|
467 |
-
*/
|
468 |
-
public function addCritical($message, array $context = array())
|
469 |
-
{
|
470 |
-
return $this->addRecord(static::CRITICAL, $message, $context);
|
471 |
-
}
|
472 |
-
|
473 |
-
/**
|
474 |
-
* Adds a log record at the ALERT level.
|
475 |
-
*
|
476 |
-
* @param string $message The log message
|
477 |
-
* @param array $context The log context
|
478 |
-
* @return bool Whether the record has been processed
|
479 |
-
*/
|
480 |
-
public function addAlert($message, array $context = array())
|
481 |
-
{
|
482 |
-
return $this->addRecord(static::ALERT, $message, $context);
|
483 |
-
}
|
484 |
-
|
485 |
-
/**
|
486 |
-
* Adds a log record at the EMERGENCY level.
|
487 |
-
*
|
488 |
-
* @param string $message The log message
|
489 |
-
* @param array $context The log context
|
490 |
-
* @return bool Whether the record has been processed
|
491 |
-
*/
|
492 |
-
public function addEmergency($message, array $context = array())
|
493 |
-
{
|
494 |
-
return $this->addRecord(static::EMERGENCY, $message, $context);
|
495 |
-
}
|
496 |
-
|
497 |
-
/**
|
498 |
-
* Gets all supported logging levels.
|
499 |
-
*
|
500 |
-
* @return array Assoc array with human-readable level names => level codes.
|
501 |
-
*/
|
502 |
-
public static function getLevels()
|
503 |
-
{
|
504 |
-
return array_flip(static::$levels);
|
505 |
-
}
|
506 |
-
|
507 |
-
/**
|
508 |
-
* Gets the name of the logging level.
|
509 |
-
*
|
510 |
-
* @param int $level
|
511 |
-
* @return string
|
512 |
-
*/
|
513 |
-
public static function getLevelName($level)
|
514 |
-
{
|
515 |
-
if (!isset(static::$levels[$level])) {
|
516 |
-
throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels)));
|
517 |
-
}
|
518 |
-
|
519 |
-
return static::$levels[$level];
|
520 |
-
}
|
521 |
-
|
522 |
-
/**
|
523 |
-
* Converts PSR-3 levels to Monolog ones if necessary
|
524 |
-
*
|
525 |
-
* @param string|int Level number (monolog) or name (PSR-3)
|
526 |
-
* @return int
|
527 |
-
*/
|
528 |
-
public static function toMonologLevel($level)
|
529 |
-
{
|
530 |
-
if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) {
|
531 |
-
return constant(__CLASS__.'::'.strtoupper($level));
|
532 |
-
}
|
533 |
-
|
534 |
-
return $level;
|
535 |
-
}
|
536 |
-
|
537 |
-
/**
|
538 |
-
* Checks whether the Logger has a handler that listens on the given level
|
539 |
-
*
|
540 |
-
* @param int $level
|
541 |
-
* @return bool
|
542 |
-
*/
|
543 |
-
public function isHandling($level)
|
544 |
-
{
|
545 |
-
$record = array(
|
546 |
-
'level' => $level,
|
547 |
-
);
|
548 |
-
|
549 |
-
foreach ($this->handlers as $handler) {
|
550 |
-
if ($handler->isHandling($record)) {
|
551 |
-
return true;
|
552 |
-
}
|
553 |
-
}
|
554 |
-
|
555 |
-
return false;
|
556 |
-
}
|
557 |
-
|
558 |
-
/**
|
559 |
-
* Set a custom exception handler
|
560 |
-
*
|
561 |
-
* @param callable $callback
|
562 |
-
* @return $this
|
563 |
-
*/
|
564 |
-
public function setExceptionHandler($callback)
|
565 |
-
{
|
566 |
-
if (!is_callable($callback)) {
|
567 |
-
throw new \InvalidArgumentException('Exception handler must be valid callable (callback or object with an __invoke method), '.var_export($callback, true).' given');
|
568 |
-
}
|
569 |
-
$this->exceptionHandler = $callback;
|
570 |
-
|
571 |
-
return $this;
|
572 |
-
}
|
573 |
-
|
574 |
-
/**
|
575 |
-
* @return callable
|
576 |
-
*/
|
577 |
-
public function getExceptionHandler()
|
578 |
-
{
|
579 |
-
return $this->exceptionHandler;
|
580 |
-
}
|
581 |
-
|
582 |
-
/**
|
583 |
-
* Delegates exception management to the custom exception handler,
|
584 |
-
* or throws the exception if no custom handler is set.
|
585 |
-
*/
|
586 |
-
protected function handleException(Exception $e, array $record)
|
587 |
-
{
|
588 |
-
if (!$this->exceptionHandler) {
|
589 |
-
throw $e;
|
590 |
-
}
|
591 |
-
|
592 |
-
call_user_func($this->exceptionHandler, $e, $record);
|
593 |
-
}
|
594 |
-
|
595 |
-
/**
|
596 |
-
* Adds a log record at an arbitrary level.
|
597 |
-
*
|
598 |
-
* This method allows for compatibility with common interfaces.
|
599 |
-
*
|
600 |
-
* @param mixed $level The log level
|
601 |
-
* @param string $message The log message
|
602 |
-
* @param array $context The log context
|
603 |
-
* @return bool Whether the record has been processed
|
604 |
-
*/
|
605 |
-
public function log($level, $message, array $context = array())
|
606 |
-
{
|
607 |
-
$level = static::toMonologLevel($level);
|
608 |
-
|
609 |
-
return $this->addRecord($level, $message, $context);
|
610 |
-
}
|
611 |
-
|
612 |
-
/**
|
613 |
-
* Adds a log record at the DEBUG level.
|
614 |
-
*
|
615 |
-
* This method allows for compatibility with common interfaces.
|
616 |
-
*
|
617 |
-
* @param string $message The log message
|
618 |
-
* @param array $context The log context
|
619 |
-
* @return bool Whether the record has been processed
|
620 |
-
*/
|
621 |
-
public function debug($message, array $context = array())
|
622 |
-
{
|
623 |
-
return $this->addRecord(static::DEBUG, $message, $context);
|
624 |
-
}
|
625 |
-
|
626 |
-
/**
|
627 |
-
* Adds a log record at the INFO level.
|
628 |
-
*
|
629 |
-
* This method allows for compatibility with common interfaces.
|
630 |
-
*
|
631 |
-
* @param string $message The log message
|
632 |
-
* @param array $context The log context
|
633 |
-
* @return bool Whether the record has been processed
|
634 |
-
*/
|
635 |
-
public function info($message, array $context = array())
|
636 |
-
{
|
637 |
-
return $this->addRecord(static::INFO, $message, $context);
|
638 |
-
}
|
639 |
-
|
640 |
-
/**
|
641 |
-
* Adds a log record at the NOTICE level.
|
642 |
-
*
|
643 |
-
* This method allows for compatibility with common interfaces.
|
644 |
-
*
|
645 |
-
* @param string $message The log message
|
646 |
-
* @param array $context The log context
|
647 |
-
* @return bool Whether the record has been processed
|
648 |
-
*/
|
649 |
-
public function notice($message, array $context = array())
|
650 |
-
{
|
651 |
-
return $this->addRecord(static::NOTICE, $message, $context);
|
652 |
-
}
|
653 |
-
|
654 |
-
/**
|
655 |
-
* Adds a log record at the WARNING level.
|
656 |
-
*
|
657 |
-
* This method allows for compatibility with common interfaces.
|
658 |
-
*
|
659 |
-
* @param string $message The log message
|
660 |
-
* @param array $context The log context
|
661 |
-
* @return bool Whether the record has been processed
|
662 |
-
*/
|
663 |
-
public function warn($message, array $context = array())
|
664 |
-
{
|
665 |
-
return $this->addRecord(static::WARNING, $message, $context);
|
666 |
-
}
|
667 |
-
|
668 |
-
/**
|
669 |
-
* Adds a log record at the WARNING level.
|
670 |
-
*
|
671 |
-
* This method allows for compatibility with common interfaces.
|
672 |
-
*
|
673 |
-
* @param string $message The log message
|
674 |
-
* @param array $context The log context
|
675 |
-
* @return bool Whether the record has been processed
|
676 |
-
*/
|
677 |
-
public function warning($message, array $context = array())
|
678 |
-
{
|
679 |
-
return $this->addRecord(static::WARNING, $message, $context);
|
680 |
-
}
|
681 |
-
|
682 |
-
/**
|
683 |
-
* Adds a log record at the ERROR level.
|
684 |
-
*
|
685 |
-
* This method allows for compatibility with common interfaces.
|
686 |
-
*
|
687 |
-
* @param string $message The log message
|
688 |
-
* @param array $context The log context
|
689 |
-
* @return bool Whether the record has been processed
|
690 |
-
*/
|
691 |
-
public function err($message, array $context = array())
|
692 |
-
{
|
693 |
-
return $this->addRecord(static::ERROR, $message, $context);
|
694 |
-
}
|
695 |
-
|
696 |
-
/**
|
697 |
-
* Adds a log record at the ERROR level.
|
698 |
-
*
|
699 |
-
* This method allows for compatibility with common interfaces.
|
700 |
-
*
|
701 |
-
* @param string $message The log message
|
702 |
-
* @param array $context The log context
|
703 |
-
* @return bool Whether the record has been processed
|
704 |
-
*/
|
705 |
-
public function error($message, array $context = array())
|
706 |
-
{
|
707 |
-
return $this->addRecord(static::ERROR, $message, $context);
|
708 |
-
}
|
709 |
-
|
710 |
-
/**
|
711 |
-
* Adds a log record at the CRITICAL level.
|
712 |
-
*
|
713 |
-
* This method allows for compatibility with common interfaces.
|
714 |
-
*
|
715 |
-
* @param string $message The log message
|
716 |
-
* @param array $context The log context
|
717 |
-
* @return bool Whether the record has been processed
|
718 |
-
*/
|
719 |
-
public function crit($message, array $context = array())
|
720 |
-
{
|
721 |
-
return $this->addRecord(static::CRITICAL, $message, $context);
|
722 |
-
}
|
723 |
-
|
724 |
-
/**
|
725 |
-
* Adds a log record at the CRITICAL level.
|
726 |
-
*
|
727 |
-
* This method allows for compatibility with common interfaces.
|
728 |
-
*
|
729 |
-
* @param string $message The log message
|
730 |
-
* @param array $context The log context
|
731 |
-
* @return bool Whether the record has been processed
|
732 |
-
*/
|
733 |
-
public function critical($message, array $context = array())
|
734 |
-
{
|
735 |
-
return $this->addRecord(static::CRITICAL, $message, $context);
|
736 |
-
}
|
737 |
-
|
738 |
-
/**
|
739 |
-
* Adds a log record at the ALERT level.
|
740 |
-
*
|
741 |
-
* This method allows for compatibility with common interfaces.
|
742 |
-
*
|
743 |
-
* @param string $message The log message
|
744 |
-
* @param array $context The log context
|
745 |
-
* @return bool Whether the record has been processed
|
746 |
-
*/
|
747 |
-
public function alert($message, array $context = array())
|
748 |
-
{
|
749 |
-
return $this->addRecord(static::ALERT, $message, $context);
|
750 |
-
}
|
751 |
-
|
752 |
-
/**
|
753 |
-
* Adds a log record at the EMERGENCY level.
|
754 |
-
*
|
755 |
-
* This method allows for compatibility with common interfaces.
|
756 |
-
*
|
757 |
-
* @param string $message The log message
|
758 |
-
* @param array $context The log context
|
759 |
-
* @return bool Whether the record has been processed
|
760 |
-
*/
|
761 |
-
public function emerg($message, array $context = array())
|
762 |
-
{
|
763 |
-
return $this->addRecord(static::EMERGENCY, $message, $context);
|
764 |
-
}
|
765 |
-
|
766 |
-
/**
|
767 |
-
* Adds a log record at the EMERGENCY level.
|
768 |
-
*
|
769 |
-
* This method allows for compatibility with common interfaces.
|
770 |
-
*
|
771 |
-
* @param string $message The log message
|
772 |
-
* @param array $context The log context
|
773 |
-
* @return bool Whether the record has been processed
|
774 |
-
*/
|
775 |
-
public function emergency($message, array $context = array())
|
776 |
-
{
|
777 |
-
return $this->addRecord(static::EMERGENCY, $message, $context);
|
778 |
-
}
|
779 |
-
|
780 |
-
/**
|
781 |
-
* Set the timezone to be used for the timestamp of log records.
|
782 |
-
*
|
783 |
-
* This is stored globally for all Logger instances
|
784 |
-
*
|
785 |
-
* @param \DateTimeZone $tz Timezone object
|
786 |
-
*/
|
787 |
-
public static function setTimezone(\DateTimeZone $tz)
|
788 |
-
{
|
789 |
-
self::$timezone = $tz;
|
790 |
-
}
|
791 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Injects Git branch and Git commit SHA in all records
|
18 |
-
*
|
19 |
-
* @author Nick Otter
|
20 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
21 |
-
*/
|
22 |
-
class GitProcessor implements ProcessorInterface
|
23 |
-
{
|
24 |
-
private $level;
|
25 |
-
private static $cache;
|
26 |
-
|
27 |
-
public function __construct($level = Logger::DEBUG)
|
28 |
-
{
|
29 |
-
$this->level = Logger::toMonologLevel($level);
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @param array $record
|
34 |
-
* @return array
|
35 |
-
*/
|
36 |
-
public function __invoke(array $record)
|
37 |
-
{
|
38 |
-
// return if the level is not high enough
|
39 |
-
if ($record['level'] < $this->level) {
|
40 |
-
return $record;
|
41 |
-
}
|
42 |
-
|
43 |
-
$record['extra']['git'] = self::getGitInfo();
|
44 |
-
|
45 |
-
return $record;
|
46 |
-
}
|
47 |
-
|
48 |
-
private static function getGitInfo()
|
49 |
-
{
|
50 |
-
if (self::$cache) {
|
51 |
-
return self::$cache;
|
52 |
-
}
|
53 |
-
|
54 |
-
$branches = `git branch -v --no-abbrev`;
|
55 |
-
if (preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) {
|
56 |
-
return self::$cache = array(
|
57 |
-
'branch' => $matches[1],
|
58 |
-
'commit' => $matches[2],
|
59 |
-
);
|
60 |
-
}
|
61 |
-
|
62 |
-
return self::$cache = array();
|
63 |
-
}
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Injects line/file:class/function where the log message came from
|
18 |
-
*
|
19 |
-
* Warning: This only works if the handler processes the logs directly.
|
20 |
-
* If you put the processor on a handler that is behind a FingersCrossedHandler
|
21 |
-
* for example, the processor will only be called once the trigger level is reached,
|
22 |
-
* and all the log records will have the same file/line/.. data from the call that
|
23 |
-
* triggered the FingersCrossedHandler.
|
24 |
-
*
|
25 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
26 |
-
*/
|
27 |
-
class IntrospectionProcessor implements ProcessorInterface
|
28 |
-
{
|
29 |
-
private $level;
|
30 |
-
|
31 |
-
private $skipClassesPartials;
|
32 |
-
|
33 |
-
private $skipStackFramesCount;
|
34 |
-
|
35 |
-
private $skipFunctions = array(
|
36 |
-
'call_user_func',
|
37 |
-
'call_user_func_array',
|
38 |
-
);
|
39 |
-
|
40 |
-
public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array(), $skipStackFramesCount = 0)
|
41 |
-
{
|
42 |
-
$this->level = Logger::toMonologLevel($level);
|
43 |
-
$this->skipClassesPartials = array_merge(array('Monolog\\'), $skipClassesPartials);
|
44 |
-
$this->skipStackFramesCount = $skipStackFramesCount;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @param array $record
|
49 |
-
* @return array
|
50 |
-
*/
|
51 |
-
public function __invoke(array $record)
|
52 |
-
{
|
53 |
-
// return if the level is not high enough
|
54 |
-
if ($record['level'] < $this->level) {
|
55 |
-
return $record;
|
56 |
-
}
|
57 |
-
|
58 |
-
/*
|
59 |
-
* http://php.net/manual/en/function.debug-backtrace.php
|
60 |
-
* As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added.
|
61 |
-
* Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'.
|
62 |
-
*/
|
63 |
-
$trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS);
|
64 |
-
|
65 |
-
// skip first since it's always the current method
|
66 |
-
array_shift($trace);
|
67 |
-
// the call_user_func call is also skipped
|
68 |
-
array_shift($trace);
|
69 |
-
|
70 |
-
$i = 0;
|
71 |
-
|
72 |
-
while ($this->isTraceClassOrSkippedFunction($trace, $i)) {
|
73 |
-
if (isset($trace[$i]['class'])) {
|
74 |
-
foreach ($this->skipClassesPartials as $part) {
|
75 |
-
if (strpos($trace[$i]['class'], $part) !== false) {
|
76 |
-
$i++;
|
77 |
-
continue 2;
|
78 |
-
}
|
79 |
-
}
|
80 |
-
} elseif (in_array($trace[$i]['function'], $this->skipFunctions)) {
|
81 |
-
$i++;
|
82 |
-
continue;
|
83 |
-
}
|
84 |
-
|
85 |
-
break;
|
86 |
-
}
|
87 |
-
|
88 |
-
$i += $this->skipStackFramesCount;
|
89 |
-
|
90 |
-
// we should have the call source now
|
91 |
-
$record['extra'] = array_merge(
|
92 |
-
$record['extra'],
|
93 |
-
array(
|
94 |
-
'file' => isset($trace[$i - 1]['file']) ? $trace[$i - 1]['file'] : null,
|
95 |
-
'line' => isset($trace[$i - 1]['line']) ? $trace[$i - 1]['line'] : null,
|
96 |
-
'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : null,
|
97 |
-
'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : null,
|
98 |
-
)
|
99 |
-
);
|
100 |
-
|
101 |
-
return $record;
|
102 |
-
}
|
103 |
-
|
104 |
-
private function isTraceClassOrSkippedFunction(array $trace, $index)
|
105 |
-
{
|
106 |
-
if (!isset($trace[$index])) {
|
107 |
-
return false;
|
108 |
-
}
|
109 |
-
|
110 |
-
return isset($trace[$index]['class']) || in_array($trace[$index]['function'], $this->skipFunctions);
|
111 |
-
}
|
112 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Injects memory_get_peak_usage in all records
|
16 |
-
*
|
17 |
-
* @see Monolog\Processor\MemoryProcessor::__construct() for options
|
18 |
-
* @author Rob Jensen
|
19 |
-
*/
|
20 |
-
class MemoryPeakUsageProcessor extends MemoryProcessor
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* @param array $record
|
24 |
-
* @return array
|
25 |
-
*/
|
26 |
-
public function __invoke(array $record)
|
27 |
-
{
|
28 |
-
$bytes = memory_get_peak_usage($this->realUsage);
|
29 |
-
$formatted = $this->formatBytes($bytes);
|
30 |
-
|
31 |
-
$record['extra']['memory_peak_usage'] = $formatted;
|
32 |
-
|
33 |
-
return $record;
|
34 |
-
}
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Some methods that are common for all memory processors
|
16 |
-
*
|
17 |
-
* @author Rob Jensen
|
18 |
-
*/
|
19 |
-
abstract class MemoryProcessor implements ProcessorInterface
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
|
23 |
-
*/
|
24 |
-
protected $realUsage;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @var bool If true, then format memory size to human readable string (MB, KB, B depending on size)
|
28 |
-
*/
|
29 |
-
protected $useFormatting;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @param bool $realUsage Set this to true to get the real size of memory allocated from system.
|
33 |
-
* @param bool $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size)
|
34 |
-
*/
|
35 |
-
public function __construct($realUsage = true, $useFormatting = true)
|
36 |
-
{
|
37 |
-
$this->realUsage = (bool) $realUsage;
|
38 |
-
$this->useFormatting = (bool) $useFormatting;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is
|
43 |
-
*
|
44 |
-
* @param int $bytes
|
45 |
-
* @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as is
|
46 |
-
*/
|
47 |
-
protected function formatBytes($bytes)
|
48 |
-
{
|
49 |
-
$bytes = (int) $bytes;
|
50 |
-
|
51 |
-
if (!$this->useFormatting) {
|
52 |
-
return $bytes;
|
53 |
-
}
|
54 |
-
|
55 |
-
if ($bytes > 1024 * 1024) {
|
56 |
-
return round($bytes / 1024 / 1024, 2).' MB';
|
57 |
-
} elseif ($bytes > 1024) {
|
58 |
-
return round($bytes / 1024, 2).' KB';
|
59 |
-
}
|
60 |
-
|
61 |
-
return $bytes . ' B';
|
62 |
-
}
|
63 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Injects memory_get_usage in all records
|
16 |
-
*
|
17 |
-
* @see Monolog\Processor\MemoryProcessor::__construct() for options
|
18 |
-
* @author Rob Jensen
|
19 |
-
*/
|
20 |
-
class MemoryUsageProcessor extends MemoryProcessor
|
21 |
-
{
|
22 |
-
/**
|
23 |
-
* @param array $record
|
24 |
-
* @return array
|
25 |
-
*/
|
26 |
-
public function __invoke(array $record)
|
27 |
-
{
|
28 |
-
$bytes = memory_get_usage($this->realUsage);
|
29 |
-
$formatted = $this->formatBytes($bytes);
|
30 |
-
|
31 |
-
$record['extra']['memory_usage'] = $formatted;
|
32 |
-
|
33 |
-
return $record;
|
34 |
-
}
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jonathan A. Schweder <jonathanschweder@gmail.com>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
use Monolog\Logger;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Injects Hg branch and Hg revision number in all records
|
18 |
-
*
|
19 |
-
* @author Jonathan A. Schweder <jonathanschweder@gmail.com>
|
20 |
-
*/
|
21 |
-
class MercurialProcessor implements ProcessorInterface
|
22 |
-
{
|
23 |
-
private $level;
|
24 |
-
private static $cache;
|
25 |
-
|
26 |
-
public function __construct($level = Logger::DEBUG)
|
27 |
-
{
|
28 |
-
$this->level = Logger::toMonologLevel($level);
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @param array $record
|
33 |
-
* @return array
|
34 |
-
*/
|
35 |
-
public function __invoke(array $record)
|
36 |
-
{
|
37 |
-
// return if the level is not high enough
|
38 |
-
if ($record['level'] < $this->level) {
|
39 |
-
return $record;
|
40 |
-
}
|
41 |
-
|
42 |
-
$record['extra']['hg'] = self::getMercurialInfo();
|
43 |
-
|
44 |
-
return $record;
|
45 |
-
}
|
46 |
-
|
47 |
-
private static function getMercurialInfo()
|
48 |
-
{
|
49 |
-
if (self::$cache) {
|
50 |
-
return self::$cache;
|
51 |
-
}
|
52 |
-
|
53 |
-
$result = explode(' ', trim(`hg id -nb`));
|
54 |
-
if (count($result) >= 3) {
|
55 |
-
return self::$cache = array(
|
56 |
-
'branch' => $result[1],
|
57 |
-
'revision' => $result[2],
|
58 |
-
);
|
59 |
-
}
|
60 |
-
|
61 |
-
return self::$cache = array();
|
62 |
-
}
|
63 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Adds value of getmypid into records
|
16 |
-
*
|
17 |
-
* @author Andreas Hörnicke
|
18 |
-
*/
|
19 |
-
class ProcessIdProcessor implements ProcessorInterface
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @param array $record
|
23 |
-
* @return array
|
24 |
-
*/
|
25 |
-
public function __invoke(array $record)
|
26 |
-
{
|
27 |
-
$record['extra']['process_id'] = getmypid();
|
28 |
-
|
29 |
-
return $record;
|
30 |
-
}
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* An optional interface to allow labelling Monolog processors.
|
16 |
-
*
|
17 |
-
* @author Nicolas Grekas <p@tchwork.com>
|
18 |
-
*/
|
19 |
-
interface ProcessorInterface
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @return array The processed records
|
23 |
-
*/
|
24 |
-
public function __invoke(array $records);
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
use Monolog\Utils;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Processes a record's message according to PSR-3 rules
|
18 |
-
*
|
19 |
-
* It replaces {foo} with the value from $context['foo']
|
20 |
-
*
|
21 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
22 |
-
*/
|
23 |
-
class PsrLogMessageProcessor implements ProcessorInterface
|
24 |
-
{
|
25 |
-
/**
|
26 |
-
* @param array $record
|
27 |
-
* @return array
|
28 |
-
*/
|
29 |
-
public function __invoke(array $record)
|
30 |
-
{
|
31 |
-
if (false === strpos($record['message'], '{')) {
|
32 |
-
return $record;
|
33 |
-
}
|
34 |
-
|
35 |
-
$replacements = array();
|
36 |
-
foreach ($record['context'] as $key => $val) {
|
37 |
-
if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
|
38 |
-
$replacements['{'.$key.'}'] = $val;
|
39 |
-
} elseif (is_object($val)) {
|
40 |
-
$replacements['{'.$key.'}'] = '[object '.Utils::getClass($val).']';
|
41 |
-
} else {
|
42 |
-
$replacements['{'.$key.'}'] = '['.gettype($val).']';
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
$record['message'] = strtr($record['message'], $replacements);
|
47 |
-
|
48 |
-
return $record;
|
49 |
-
}
|
50 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Adds a tags array into record
|
16 |
-
*
|
17 |
-
* @author Martijn Riemers
|
18 |
-
*/
|
19 |
-
class TagProcessor implements ProcessorInterface
|
20 |
-
{
|
21 |
-
private $tags;
|
22 |
-
|
23 |
-
public function __construct(array $tags = array())
|
24 |
-
{
|
25 |
-
$this->setTags($tags);
|
26 |
-
}
|
27 |
-
|
28 |
-
public function addTags(array $tags = array())
|
29 |
-
{
|
30 |
-
$this->tags = array_merge($this->tags, $tags);
|
31 |
-
}
|
32 |
-
|
33 |
-
public function setTags(array $tags = array())
|
34 |
-
{
|
35 |
-
$this->tags = $tags;
|
36 |
-
}
|
37 |
-
|
38 |
-
public function __invoke(array $record)
|
39 |
-
{
|
40 |
-
$record['extra']['tags'] = $this->tags;
|
41 |
-
|
42 |
-
return $record;
|
43 |
-
}
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
use Monolog\ResettableInterface;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Adds a unique identifier into records
|
18 |
-
*
|
19 |
-
* @author Simon Mönch <sm@webfactory.de>
|
20 |
-
*/
|
21 |
-
class UidProcessor implements ProcessorInterface, ResettableInterface
|
22 |
-
{
|
23 |
-
private $uid;
|
24 |
-
|
25 |
-
public function __construct($length = 7)
|
26 |
-
{
|
27 |
-
if (!is_int($length) || $length > 32 || $length < 1) {
|
28 |
-
throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
|
29 |
-
}
|
30 |
-
|
31 |
-
|
32 |
-
$this->uid = $this->generateUid($length);
|
33 |
-
}
|
34 |
-
|
35 |
-
public function __invoke(array $record)
|
36 |
-
{
|
37 |
-
$record['extra']['uid'] = $this->uid;
|
38 |
-
|
39 |
-
return $record;
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* @return string
|
44 |
-
*/
|
45 |
-
public function getUid()
|
46 |
-
{
|
47 |
-
return $this->uid;
|
48 |
-
}
|
49 |
-
|
50 |
-
public function reset()
|
51 |
-
{
|
52 |
-
$this->uid = $this->generateUid(strlen($this->uid));
|
53 |
-
}
|
54 |
-
|
55 |
-
private function generateUid($length)
|
56 |
-
{
|
57 |
-
return substr(hash('md5', uniqid('', true)), 0, $length);
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php
DELETED
@@ -1,113 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog\Processor;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Injects url/method and remote IP of the current web request in all records
|
16 |
-
*
|
17 |
-
* @author Jordi Boggiano <j.boggiano@seld.be>
|
18 |
-
*/
|
19 |
-
class WebProcessor implements ProcessorInterface
|
20 |
-
{
|
21 |
-
/**
|
22 |
-
* @var array|\ArrayAccess
|
23 |
-
*/
|
24 |
-
protected $serverData;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Default fields
|
28 |
-
*
|
29 |
-
* Array is structured as [key in record.extra => key in $serverData]
|
30 |
-
*
|
31 |
-
* @var array
|
32 |
-
*/
|
33 |
-
protected $extraFields = array(
|
34 |
-
'url' => 'REQUEST_URI',
|
35 |
-
'ip' => 'REMOTE_ADDR',
|
36 |
-
'http_method' => 'REQUEST_METHOD',
|
37 |
-
'server' => 'SERVER_NAME',
|
38 |
-
'referrer' => 'HTTP_REFERER',
|
39 |
-
);
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @param array|\ArrayAccess $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data
|
43 |
-
* @param array|null $extraFields Field names and the related key inside $serverData to be added. If not provided it defaults to: url, ip, http_method, server, referrer
|
44 |
-
*/
|
45 |
-
public function __construct($serverData = null, array $extraFields = null)
|
46 |
-
{
|
47 |
-
if (null === $serverData) {
|
48 |
-
$this->serverData = &$_SERVER;
|
49 |
-
} elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) {
|
50 |
-
$this->serverData = $serverData;
|
51 |
-
} else {
|
52 |
-
throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.');
|
53 |
-
}
|
54 |
-
|
55 |
-
if (null !== $extraFields) {
|
56 |
-
if (isset($extraFields[0])) {
|
57 |
-
foreach (array_keys($this->extraFields) as $fieldName) {
|
58 |
-
if (!in_array($fieldName, $extraFields)) {
|
59 |
-
unset($this->extraFields[$fieldName]);
|
60 |
-
}
|
61 |
-
}
|
62 |
-
} else {
|
63 |
-
$this->extraFields = $extraFields;
|
64 |
-
}
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* @param array $record
|
70 |
-
* @return array
|
71 |
-
*/
|
72 |
-
public function __invoke(array $record)
|
73 |
-
{
|
74 |
-
// skip processing if for some reason request data
|
75 |
-
// is not present (CLI or wonky SAPIs)
|
76 |
-
if (!isset($this->serverData['REQUEST_URI'])) {
|
77 |
-
return $record;
|
78 |
-
}
|
79 |
-
|
80 |
-
$record['extra'] = $this->appendExtraFields($record['extra']);
|
81 |
-
|
82 |
-
return $record;
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* @param string $extraName
|
87 |
-
* @param string $serverName
|
88 |
-
* @return $this
|
89 |
-
*/
|
90 |
-
public function addExtraField($extraName, $serverName)
|
91 |
-
{
|
92 |
-
$this->extraFields[$extraName] = $serverName;
|
93 |
-
|
94 |
-
return $this;
|
95 |
-
}
|
96 |
-
|
97 |
-
/**
|
98 |
-
* @param array $extra
|
99 |
-
* @return array
|
100 |
-
*/
|
101 |
-
private function appendExtraFields(array $extra)
|
102 |
-
{
|
103 |
-
foreach ($this->extraFields as $extraName => $serverName) {
|
104 |
-
$extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null;
|
105 |
-
}
|
106 |
-
|
107 |
-
if (isset($this->serverData['UNIQUE_ID'])) {
|
108 |
-
$extra['unique_id'] = $this->serverData['UNIQUE_ID'];
|
109 |
-
}
|
110 |
-
|
111 |
-
return $extra;
|
112 |
-
}
|
113 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Registry.php
DELETED
@@ -1,134 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog;
|
13 |
-
|
14 |
-
use InvalidArgumentException;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Monolog log registry
|
18 |
-
*
|
19 |
-
* Allows to get `Logger` instances in the global scope
|
20 |
-
* via static method calls on this class.
|
21 |
-
*
|
22 |
-
* <code>
|
23 |
-
* $application = new Monolog\Logger('application');
|
24 |
-
* $api = new Monolog\Logger('api');
|
25 |
-
*
|
26 |
-
* Monolog\Registry::addLogger($application);
|
27 |
-
* Monolog\Registry::addLogger($api);
|
28 |
-
*
|
29 |
-
* function testLogger()
|
30 |
-
* {
|
31 |
-
* Monolog\Registry::api()->addError('Sent to $api Logger instance');
|
32 |
-
* Monolog\Registry::application()->addError('Sent to $application Logger instance');
|
33 |
-
* }
|
34 |
-
* </code>
|
35 |
-
*
|
36 |
-
* @author Tomas Tatarko <tomas@tatarko.sk>
|
37 |
-
*/
|
38 |
-
class Registry
|
39 |
-
{
|
40 |
-
/**
|
41 |
-
* List of all loggers in the registry (by named indexes)
|
42 |
-
*
|
43 |
-
* @var Logger[]
|
44 |
-
*/
|
45 |
-
private static $loggers = array();
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Adds new logging channel to the registry
|
49 |
-
*
|
50 |
-
* @param Logger $logger Instance of the logging channel
|
51 |
-
* @param string|null $name Name of the logging channel ($logger->getName() by default)
|
52 |
-
* @param bool $overwrite Overwrite instance in the registry if the given name already exists?
|
53 |
-
* @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists
|
54 |
-
*/
|
55 |
-
public static function addLogger(Logger $logger, $name = null, $overwrite = false)
|
56 |
-
{
|
57 |
-
$name = $name ?: $logger->getName();
|
58 |
-
|
59 |
-
if (isset(self::$loggers[$name]) && !$overwrite) {
|
60 |
-
throw new InvalidArgumentException('Logger with the given name already exists');
|
61 |
-
}
|
62 |
-
|
63 |
-
self::$loggers[$name] = $logger;
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
* Checks if such logging channel exists by name or instance
|
68 |
-
*
|
69 |
-
* @param string|Logger $logger Name or logger instance
|
70 |
-
*/
|
71 |
-
public static function hasLogger($logger)
|
72 |
-
{
|
73 |
-
if ($logger instanceof Logger) {
|
74 |
-
$index = array_search($logger, self::$loggers, true);
|
75 |
-
|
76 |
-
return false !== $index;
|
77 |
-
} else {
|
78 |
-
return isset(self::$loggers[$logger]);
|
79 |
-
}
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Removes instance from registry by name or instance
|
84 |
-
*
|
85 |
-
* @param string|Logger $logger Name or logger instance
|
86 |
-
*/
|
87 |
-
public static function removeLogger($logger)
|
88 |
-
{
|
89 |
-
if ($logger instanceof Logger) {
|
90 |
-
if (false !== ($idx = array_search($logger, self::$loggers, true))) {
|
91 |
-
unset(self::$loggers[$idx]);
|
92 |
-
}
|
93 |
-
} else {
|
94 |
-
unset(self::$loggers[$logger]);
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Clears the registry
|
100 |
-
*/
|
101 |
-
public static function clear()
|
102 |
-
{
|
103 |
-
self::$loggers = array();
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Gets Logger instance from the registry
|
108 |
-
*
|
109 |
-
* @param string $name Name of the requested Logger instance
|
110 |
-
* @throws \InvalidArgumentException If named Logger instance is not in the registry
|
111 |
-
* @return Logger Requested instance of Logger
|
112 |
-
*/
|
113 |
-
public static function getInstance($name)
|
114 |
-
{
|
115 |
-
if (!isset(self::$loggers[$name])) {
|
116 |
-
throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name));
|
117 |
-
}
|
118 |
-
|
119 |
-
return self::$loggers[$name];
|
120 |
-
}
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Gets Logger instance from the registry via static method call
|
124 |
-
*
|
125 |
-
* @param string $name Name of the requested Logger instance
|
126 |
-
* @param array $arguments Arguments passed to static method call
|
127 |
-
* @throws \InvalidArgumentException If named Logger instance is not in the registry
|
128 |
-
* @return Logger Requested instance of Logger
|
129 |
-
*/
|
130 |
-
public static function __callStatic($name, $arguments)
|
131 |
-
{
|
132 |
-
return self::getInstance($name);
|
133 |
-
}
|
134 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/ResettableInterface.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Handler or Processor implementing this interface will be reset when Logger::reset() is called.
|
16 |
-
*
|
17 |
-
* Resetting ends a log cycle gets them back to their initial state.
|
18 |
-
*
|
19 |
-
* Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal
|
20 |
-
* state, and getting it back to a state in which it can receive log records again.
|
21 |
-
*
|
22 |
-
* This is useful in case you want to avoid logs leaking between two requests or jobs when you
|
23 |
-
* have a long running process like a worker or an application server serving multiple requests
|
24 |
-
* in one process.
|
25 |
-
*
|
26 |
-
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
27 |
-
*/
|
28 |
-
interface ResettableInterface
|
29 |
-
{
|
30 |
-
public function reset();
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/SignalHandler.php
DELETED
@@ -1,115 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog;
|
13 |
-
|
14 |
-
use Psr\Log\LoggerInterface;
|
15 |
-
use Psr\Log\LogLevel;
|
16 |
-
use ReflectionExtension;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Monolog POSIX signal handler
|
20 |
-
*
|
21 |
-
* @author Robert Gust-Bardon <robert@gust-bardon.org>
|
22 |
-
*/
|
23 |
-
class SignalHandler
|
24 |
-
{
|
25 |
-
private $logger;
|
26 |
-
|
27 |
-
private $previousSignalHandler = array();
|
28 |
-
private $signalLevelMap = array();
|
29 |
-
private $signalRestartSyscalls = array();
|
30 |
-
|
31 |
-
public function __construct(LoggerInterface $logger)
|
32 |
-
{
|
33 |
-
$this->logger = $logger;
|
34 |
-
}
|
35 |
-
|
36 |
-
public function registerSignalHandler($signo, $level = LogLevel::CRITICAL, $callPrevious = true, $restartSyscalls = true, $async = true)
|
37 |
-
{
|
38 |
-
if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) {
|
39 |
-
return $this;
|
40 |
-
}
|
41 |
-
|
42 |
-
if ($callPrevious) {
|
43 |
-
if (function_exists('pcntl_signal_get_handler')) {
|
44 |
-
$handler = pcntl_signal_get_handler($signo);
|
45 |
-
if ($handler === false) {
|
46 |
-
return $this;
|
47 |
-
}
|
48 |
-
$this->previousSignalHandler[$signo] = $handler;
|
49 |
-
} else {
|
50 |
-
$this->previousSignalHandler[$signo] = true;
|
51 |
-
}
|
52 |
-
} else {
|
53 |
-
unset($this->previousSignalHandler[$signo]);
|
54 |
-
}
|
55 |
-
$this->signalLevelMap[$signo] = $level;
|
56 |
-
$this->signalRestartSyscalls[$signo] = $restartSyscalls;
|
57 |
-
|
58 |
-
if (function_exists('pcntl_async_signals') && $async !== null) {
|
59 |
-
pcntl_async_signals($async);
|
60 |
-
}
|
61 |
-
|
62 |
-
pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls);
|
63 |
-
|
64 |
-
return $this;
|
65 |
-
}
|
66 |
-
|
67 |
-
public function handleSignal($signo, array $siginfo = null)
|
68 |
-
{
|
69 |
-
static $signals = array();
|
70 |
-
|
71 |
-
if (!$signals && extension_loaded('pcntl')) {
|
72 |
-
$pcntl = new ReflectionExtension('pcntl');
|
73 |
-
$constants = $pcntl->getConstants();
|
74 |
-
if (!$constants) {
|
75 |
-
// HHVM 3.24.2 returns an empty array.
|
76 |
-
$constants = get_defined_constants(true);
|
77 |
-
$constants = $constants['Core'];
|
78 |
-
}
|
79 |
-
foreach ($constants as $name => $value) {
|
80 |
-
if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) {
|
81 |
-
$signals[$value] = $name;
|
82 |
-
}
|
83 |
-
}
|
84 |
-
unset($constants);
|
85 |
-
}
|
86 |
-
|
87 |
-
$level = isset($this->signalLevelMap[$signo]) ? $this->signalLevelMap[$signo] : LogLevel::CRITICAL;
|
88 |
-
$signal = isset($signals[$signo]) ? $signals[$signo] : $signo;
|
89 |
-
$context = isset($siginfo) ? $siginfo : array();
|
90 |
-
$this->logger->log($level, sprintf('Program received signal %s', $signal), $context);
|
91 |
-
|
92 |
-
if (!isset($this->previousSignalHandler[$signo])) {
|
93 |
-
return;
|
94 |
-
}
|
95 |
-
|
96 |
-
if ($this->previousSignalHandler[$signo] === true || $this->previousSignalHandler[$signo] === SIG_DFL) {
|
97 |
-
if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch')
|
98 |
-
&& extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill')) {
|
99 |
-
$restartSyscalls = isset($this->restartSyscalls[$signo]) ? $this->restartSyscalls[$signo] : true;
|
100 |
-
pcntl_signal($signo, SIG_DFL, $restartSyscalls);
|
101 |
-
pcntl_sigprocmask(SIG_UNBLOCK, array($signo), $oldset);
|
102 |
-
posix_kill(posix_getpid(), $signo);
|
103 |
-
pcntl_signal_dispatch();
|
104 |
-
pcntl_sigprocmask(SIG_SETMASK, $oldset);
|
105 |
-
pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls);
|
106 |
-
}
|
107 |
-
} elseif (is_callable($this->previousSignalHandler[$signo])) {
|
108 |
-
if (PHP_VERSION_ID >= 70100) {
|
109 |
-
$this->previousSignalHandler[$signo]($signo, $siginfo);
|
110 |
-
} else {
|
111 |
-
$this->previousSignalHandler[$signo]($signo);
|
112 |
-
}
|
113 |
-
}
|
114 |
-
}
|
115 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/monolog/monolog/src/Monolog/Utils.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/*
|
4 |
-
* This file is part of the Monolog package.
|
5 |
-
*
|
6 |
-
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
7 |
-
*
|
8 |
-
* For the full copyright and license information, please view the LICENSE
|
9 |
-
* file that was distributed with this source code.
|
10 |
-
*/
|
11 |
-
|
12 |
-
namespace Monolog;
|
13 |
-
|
14 |
-
class Utils
|
15 |
-
{
|
16 |
-
/**
|
17 |
-
* @internal
|
18 |
-
*/
|
19 |
-
public static function getClass($object)
|
20 |
-
{
|
21 |
-
$class = \get_class($object);
|
22 |
-
|
23 |
-
return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
|
24 |
-
}
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/rollbar/rollbar/src/Handlers/ErrorHandler.php
CHANGED
@@ -6,14 +6,14 @@ use Rollbar\Payload\Level;
|
|
6 |
|
7 |
class ErrorHandler extends AbstractHandler
|
8 |
{
|
9 |
-
|
10 |
public function register()
|
11 |
{
|
12 |
$this->previousHandler = set_error_handler(array($this, 'handle'));
|
13 |
-
|
14 |
parent::register();
|
15 |
}
|
16 |
-
|
17 |
public function handle()
|
18 |
{
|
19 |
/**
|
@@ -21,18 +21,32 @@ class ErrorHandler extends AbstractHandler
|
|
21 |
* through language structures. This hack allows to simulate that.
|
22 |
*/
|
23 |
$args = func_get_args();
|
24 |
-
|
25 |
if (!isset($args[0]) || !isset($args[1])) {
|
26 |
throw new \Exception('No $errno or $errstr to be passed to the error handler.');
|
27 |
}
|
28 |
-
|
29 |
$errno = $args[0];
|
30 |
$errstr = $args[1];
|
31 |
$errfile = isset($args[2]) ? $args[2] : null;
|
32 |
$errline = isset($args[3]) ? $args[3] : null;
|
33 |
-
|
34 |
parent::handle();
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
if (is_null($this->logger())) {
|
37 |
return false;
|
38 |
}
|
@@ -45,17 +59,7 @@ class ErrorHandler extends AbstractHandler
|
|
45 |
generateErrorWrapper($errno, $errstr, $errfile, $errline);
|
46 |
|
47 |
$this->logger()->log(Level::ERROR, $exception, array(), true);
|
48 |
-
|
49 |
-
if ($this->previousHandler !== null) {
|
50 |
-
call_user_func(
|
51 |
-
$this->previousHandler,
|
52 |
-
$errno,
|
53 |
-
$errstr,
|
54 |
-
$errfile,
|
55 |
-
$errline
|
56 |
-
);
|
57 |
-
}
|
58 |
-
|
59 |
return false;
|
60 |
}
|
61 |
}
|
6 |
|
7 |
class ErrorHandler extends AbstractHandler
|
8 |
{
|
9 |
+
|
10 |
public function register()
|
11 |
{
|
12 |
$this->previousHandler = set_error_handler(array($this, 'handle'));
|
13 |
+
|
14 |
parent::register();
|
15 |
}
|
16 |
+
|
17 |
public function handle()
|
18 |
{
|
19 |
/**
|
21 |
* through language structures. This hack allows to simulate that.
|
22 |
*/
|
23 |
$args = func_get_args();
|
24 |
+
|
25 |
if (!isset($args[0]) || !isset($args[1])) {
|
26 |
throw new \Exception('No $errno or $errstr to be passed to the error handler.');
|
27 |
}
|
28 |
+
|
29 |
$errno = $args[0];
|
30 |
$errstr = $args[1];
|
31 |
$errfile = isset($args[2]) ? $args[2] : null;
|
32 |
$errline = isset($args[3]) ? $args[3] : null;
|
33 |
+
|
34 |
parent::handle();
|
35 |
+
|
36 |
+
if (!is_null($this->previousHandler)) {
|
37 |
+
$stop_processing = call_user_func(
|
38 |
+
$this->previousHandler,
|
39 |
+
$errno,
|
40 |
+
$errstr,
|
41 |
+
$errfile,
|
42 |
+
$errline
|
43 |
+
);
|
44 |
+
|
45 |
+
if ($stop_processing) {
|
46 |
+
return $stop_processing;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
if (is_null($this->logger())) {
|
51 |
return false;
|
52 |
}
|
59 |
generateErrorWrapper($errno, $errstr, $errfile, $errline);
|
60 |
|
61 |
$this->logger()->log(Level::ERROR, $exception, array(), true);
|
62 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
return false;
|
64 |
}
|
65 |
}
|
vendor/rollbar/rollbar/src/Monolog/Handler/RollbarHandler.php
CHANGED
@@ -9,6 +9,15 @@
|
|
9 |
*
|
10 |
* Using Monolog's handler is the recommended approach when using Rollbar
|
11 |
* with Monolog.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
|
14 |
/*
|
9 |
*
|
10 |
* Using Monolog's handler is the recommended approach when using Rollbar
|
11 |
* with Monolog.
|
12 |
+
*
|
13 |
+
* !!! 1/17/2019 UPDATE !!!
|
14 |
+
* Rollbar PHP SDK is dropping dependency on the Monolog library completely. For
|
15 |
+
* a while the Monolog library provided a mechanism to report to Rollbar as
|
16 |
+
* part of their `2.0.0-beta`.
|
17 |
+
* IF you decide to use this class, i.e. due to legacy code, please make sure
|
18 |
+
* to require `Seldaek/monolog:v1.24` in your project by yourself. Otherwise,
|
19 |
+
* using this class will result in a fatal error due to lack of the Monolog
|
20 |
+
* library.
|
21 |
*/
|
22 |
|
23 |
/*
|
vendor/rollbar/rollbar/src/Payload/Notifier.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
class Notifier implements \Serializable
|
4 |
{
|
5 |
const NAME = "rollbar-php";
|
6 |
-
const VERSION = "1.7.
|
7 |
|
8 |
public static function defaultNotifier()
|
9 |
{
|
3 |
class Notifier implements \Serializable
|
4 |
{
|
5 |
const NAME = "rollbar-php";
|
6 |
+
const VERSION = "1.7.5";
|
7 |
|
8 |
public static function defaultNotifier()
|
9 |
{
|
vendor/rollbar/rollbar/src/Scrubber.php
CHANGED
@@ -57,7 +57,8 @@ class Scrubber implements ScrubberInterface
|
|
57 |
return $data;
|
58 |
}
|
59 |
|
60 |
-
|
|
|
61 |
|
62 |
return $this->internalScrub($data, $fields, $replacement, $path);
|
63 |
}
|
@@ -110,7 +111,7 @@ class Scrubber implements ScrubberInterface
|
|
110 |
return;
|
111 |
}
|
112 |
|
113 |
-
if (isset($fields[$key])) {
|
114 |
$val = $replacement;
|
115 |
} else {
|
116 |
$val = $scrubber->internalScrub($val, $fields, $replacement, $current);
|
57 |
return $data;
|
58 |
}
|
59 |
|
60 |
+
// Scrub fields is case insensitive, so force all fields to lowercase
|
61 |
+
$fields = array_change_key_case(array_flip($fields), CASE_LOWER);
|
62 |
|
63 |
return $this->internalScrub($data, $fields, $replacement, $path);
|
64 |
}
|
111 |
return;
|
112 |
}
|
113 |
|
114 |
+
if (isset($fields[strtolower($key)])) {
|
115 |
$val = $replacement;
|
116 |
} else {
|
117 |
$val = $scrubber->internalScrub($val, $fields, $replacement, $current);
|
vendor/rollbar/rollbar/src/Truncation/FramesStrategy.php
CHANGED
@@ -9,19 +9,16 @@ class FramesStrategy extends AbstractStrategy
|
|
9 |
|
10 |
public function execute(EncodedPayload $payload)
|
11 |
{
|
12 |
-
$key = false;
|
13 |
$data = $payload->data();
|
14 |
|
15 |
-
if (isset($data['data']['body']['trace_chain']
|
16 |
-
$
|
|
|
|
|
|
|
|
|
17 |
} elseif (isset($data['data']['body']['trace']['frames'])) {
|
18 |
-
$
|
19 |
-
}
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
if ($key) {
|
24 |
-
$data['data']['body'][$key]['frames'] = $this->selectFrames($data['data']['body'][$key]['frames']);
|
25 |
$payload->encode($data);
|
26 |
}
|
27 |
|
9 |
|
10 |
public function execute(EncodedPayload $payload)
|
11 |
{
|
|
|
12 |
$data = $payload->data();
|
13 |
|
14 |
+
if (isset($data['data']['body']['trace_chain'])) {
|
15 |
+
foreach ($data['data']['body']['trace_chain'] as $offset => $value) {
|
16 |
+
$data['data']['body']['trace_chain'][$offset]['frames'] = $this->selectFrames($value['frames']);
|
17 |
+
}
|
18 |
+
|
19 |
+
$payload->encode($data);
|
20 |
} elseif (isset($data['data']['body']['trace']['frames'])) {
|
21 |
+
$data['data']['body']['trace']['frames'] = $this->selectFrames($data['data']['body']['trace']['frames']);
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
$payload->encode($data);
|
23 |
}
|
24 |
|
vendor/rollbar/rollbar/src/Truncation/StringsStrategy.php
CHANGED
@@ -44,8 +44,7 @@ class StringsStrategy extends AbstractStrategy
|
|
44 |
$modified = true;
|
45 |
}
|
46 |
} else {
|
47 |
-
$strlen = strlen($value)
|
48 |
-
if (is_string($value) && $strlen > $threshold) {
|
49 |
$value = substr($value, 0, $threshold);
|
50 |
$modified = true;
|
51 |
$payload->decreaseSize($strlen - $threshold);
|
44 |
$modified = true;
|
45 |
}
|
46 |
} else {
|
47 |
+
if (is_string($value) && (($strlen = strlen($value)) > $threshold)) {
|
|
|
48 |
$value = substr($value, 0, $threshold);
|
49 |
$modified = true;
|
50 |
$payload->decreaseSize($strlen - $threshold);
|