2018-12-13 23:41:57 -05:00
this [ "wp" ] = this [ "wp" ] || { } ; this [ "wp" ] [ "url" ] =
/******/ ( function ( modules ) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] ) {
/******/ return installedModules [ moduleId ] . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ i : moduleId ,
/******/ l : false ,
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Flag the module as loaded
/******/ module . l = true ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = modules ;
/******/
/******/ // expose the module cache
/******/ _ _webpack _require _ _ . c = installedModules ;
/******/
/******/ // define getter function for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , name , getter ) {
/******/ if ( ! _ _webpack _require _ _ . o ( exports , name ) ) {
/******/ Object . defineProperty ( exports , name , { enumerable : true , get : getter } ) ;
/******/ }
/******/ } ;
/******/
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = function ( exports ) {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ _ _webpack _require _ _ . t = function ( value , mode ) {
/******/ if ( mode & 1 ) value = _ _webpack _require _ _ ( value ) ;
/******/ if ( mode & 8 ) return value ;
/******/ if ( ( mode & 4 ) && typeof value === 'object' && value && value . _ _esModule ) return value ;
/******/ var ns = Object . create ( null ) ;
/******/ _ _webpack _require _ _ . r ( ns ) ;
/******/ Object . defineProperty ( ns , 'default' , { enumerable : true , value : value } ) ;
/******/ if ( mode & 2 && typeof value != 'string' ) for ( var key in value ) _ _webpack _require _ _ . d ( ns , key , function ( key ) { return value [ key ] ; } . bind ( null , key ) ) ;
/******/ return ns ;
/******/ } ;
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function getDefault ( ) { return module [ 'default' ] ; } :
/******/ function getModuleExports ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , 'a' , getter ) ;
/******/ return getter ;
/******/ } ;
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ _ _webpack _require _ _ . o = function ( object , property ) { return Object . prototype . hasOwnProperty . call ( object , property ) ; } ;
/******/
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "" ;
/******/
/******/
/******/ // Load entry module and return exports
2021-05-07 07:48:27 -04:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 460 ) ;
2018-12-13 23:41:57 -05:00
/******/ } )
/************************************************************************/
/******/ ( {
2021-04-15 11:19:43 -04:00
/***/ 12 :
2021-01-27 21:04:13 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-13 23:41:57 -05:00
"use strict" ;
2021-01-27 21:04:13 -05:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return /* binding */ _slicedToArray ; } ) ;
2018-12-13 23:41:57 -05:00
2021-01-27 21:04:13 -05:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
2021-05-07 07:48:27 -04:00
var arrayWithHoles = _ _webpack _require _ _ ( 38 ) ;
2018-12-16 23:52:00 -05:00
2021-01-27 21:04:13 -05:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit ( arr , i ) {
2021-05-07 07:48:27 -04:00
var _i = arr && ( typeof Symbol !== "undefined" && arr [ Symbol . iterator ] || arr [ "@@iterator" ] ) ;
if ( _i == null ) return ;
2021-01-27 21:04:13 -05:00
var _arr = [ ] ;
var _n = true ;
var _d = false ;
2021-05-07 07:48:27 -04:00
var _s , _e ;
2018-12-16 23:52:00 -05:00
2021-01-27 21:04:13 -05:00
try {
2021-05-07 07:48:27 -04:00
for ( _i = _i . call ( arr ) ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) {
2021-01-27 21:04:13 -05:00
_arr . push ( _s . value ) ;
2018-12-16 23:52:00 -05:00
2021-01-27 21:04:13 -05:00
if ( i && _arr . length === i ) break ;
2018-12-17 22:14:52 -05:00
}
2021-01-27 21:04:13 -05:00
} catch ( err ) {
_d = true ;
_e = err ;
} finally {
2018-12-17 22:14:52 -05:00
try {
2021-01-27 21:04:13 -05:00
if ( ! _n && _i [ "return" ] != null ) _i [ "return" ] ( ) ;
} finally {
if ( _d ) throw _e ;
2018-12-17 22:14:52 -05:00
}
2021-01-27 21:04:13 -05:00
}
2018-12-16 23:52:00 -05:00
2021-01-27 21:04:13 -05:00
return _arr ;
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
2021-04-15 11:19:43 -04:00
var unsupportedIterableToArray = _ _webpack _require _ _ ( 28 ) ;
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
2021-05-07 07:48:27 -04:00
var nonIterableRest = _ _webpack _require _ _ ( 39 ) ;
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
function _slicedToArray ( arr , i ) {
return Object ( arrayWithHoles [ "a" /* default */ ] ) ( arr ) || _iterableToArrayLimit ( arr , i ) || Object ( unsupportedIterableToArray [ "a" /* default */ ] ) ( arr , i ) || Object ( nonIterableRest [ "a" /* default */ ] ) ( ) ;
}
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
/***/ } ) ,
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
/***/ 2 :
/***/ ( function ( module , exports ) {
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
( function ( ) { module . exports = window [ "lodash" ] ; } ( ) ) ;
2018-12-17 22:14:52 -05:00
/***/ } ) ,
2021-01-27 21:04:13 -05:00
/***/ 24 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-17 22:14:52 -05:00
"use strict" ;
2021-01-27 21:04:13 -05:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _arrayLikeToArray ; } ) ;
function _arrayLikeToArray ( arr , len ) {
if ( len == null || len > arr . length ) len = arr . length ;
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) {
arr2 [ i ] = arr [ i ] ;
}
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
return arr2 ;
}
2018-12-17 22:14:52 -05:00
/***/ } ) ,
2021-04-15 11:19:43 -04:00
/***/ 28 :
2021-01-27 21:04:13 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-17 22:14:52 -05:00
"use strict" ;
2021-01-27 21:04:13 -05:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _unsupportedIterableToArray ; } ) ;
2021-04-15 11:19:43 -04:00
/* harmony import */ var _arrayLikeToArray _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 24 ) ;
2021-01-27 21:04:13 -05:00
function _unsupportedIterableToArray ( o , minLen ) {
if ( ! o ) return ;
2021-04-15 11:19:43 -04:00
if ( typeof o === "string" ) return Object ( _arrayLikeToArray _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( o , minLen ) ;
2021-01-27 21:04:13 -05:00
var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ;
if ( n === "Object" && o . constructor ) n = o . constructor . name ;
if ( n === "Map" || n === "Set" ) return Array . from ( o ) ;
2021-04-15 11:19:43 -04:00
if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return Object ( _arrayLikeToArray _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( o , minLen ) ;
2021-01-27 21:04:13 -05:00
}
2018-12-13 23:41:57 -05:00
/***/ } ) ,
2021-05-07 07:48:27 -04:00
/***/ 38 :
2021-01-27 21:04:13 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-13 23:41:57 -05:00
"use strict" ;
2021-01-27 21:04:13 -05:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _arrayWithHoles ; } ) ;
function _arrayWithHoles ( arr ) {
if ( Array . isArray ( arr ) ) return arr ;
}
2018-12-13 23:41:57 -05:00
2021-01-27 21:04:13 -05:00
/***/ } ) ,
2018-12-13 23:41:57 -05:00
2021-05-07 07:48:27 -04:00
/***/ 39 :
2021-01-27 21:04:13 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2020-01-08 06:57:23 -05:00
2021-01-27 21:04:13 -05:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _nonIterableRest ; } ) ;
function _nonIterableRest ( ) {
throw new TypeError ( "Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
}
2020-01-08 06:57:23 -05:00
/***/ } ) ,
2021-05-07 07:48:27 -04:00
/***/ 460 :
2020-01-08 06:57:23 -05:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2020-06-29 07:50:29 -04:00
// ESM COMPAT FLAG
2020-01-08 06:57:23 -05:00
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2020-06-29 07:50:29 -04:00
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "isURL" , function ( ) { return /* reexport */ isURL ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "isEmail" , function ( ) { return /* reexport */ isEmail ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "getProtocol" , function ( ) { return /* reexport */ getProtocol ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "isValidProtocol" , function ( ) { return /* reexport */ isValidProtocol ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "getAuthority" , function ( ) { return /* reexport */ getAuthority ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "isValidAuthority" , function ( ) { return /* reexport */ isValidAuthority ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "getPath" , function ( ) { return /* reexport */ getPath ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "isValidPath" , function ( ) { return /* reexport */ isValidPath ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "getQueryString" , function ( ) { return /* reexport */ getQueryString ; } ) ;
2021-01-27 21:04:13 -05:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "buildQueryString" , function ( ) { return /* reexport */ buildQueryString ; } ) ;
2020-06-29 07:50:29 -04:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "isValidQueryString" , function ( ) { return /* reexport */ isValidQueryString ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "getPathAndQueryString" , function ( ) { return /* reexport */ getPathAndQueryString ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "getFragment" , function ( ) { return /* reexport */ getFragment ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "isValidFragment" , function ( ) { return /* reexport */ isValidFragment ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "addQueryArgs" , function ( ) { return /* reexport */ addQueryArgs ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "getQueryArg" , function ( ) { return /* reexport */ getQueryArg ; } ) ;
2021-01-27 21:04:13 -05:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "getQueryArgs" , function ( ) { return /* reexport */ getQueryArgs ; } ) ;
2020-06-29 07:50:29 -04:00
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "hasQueryArg" , function ( ) { return /* reexport */ hasQueryArg ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "removeQueryArgs" , function ( ) { return /* reexport */ removeQueryArgs ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "prependHTTP" , function ( ) { return /* reexport */ prependHTTP ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "safeDecodeURI" , function ( ) { return /* reexport */ safeDecodeURI ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "safeDecodeURIComponent" , function ( ) { return /* reexport */ safeDecodeURIComponent ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "filterURLForDisplay" , function ( ) { return /* reexport */ filterURLForDisplay ; } ) ;
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "cleanForSlug" , function ( ) { return /* reexport */ cleanForSlug ; } ) ;
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-url.js
/ * *
* Determines whether the given string looks like a URL .
*
* @ param { string } url The string to scrutinise .
*
* @ example
* ` ` ` js
* const isURL = isURL ( 'https://wordpress.org' ) ; // true
* ` ` `
*
2020-02-10 17:33:27 -05:00
* @ see https : //url.spec.whatwg.org/
* @ see https : //url.spec.whatwg.org/#valid-url-string
*
2020-01-08 06:57:23 -05:00
* @ return { boolean } Whether or not it looks like a URL .
* /
function isURL ( url ) {
2020-02-10 17:33:27 -05:00
// A URL can be considered value if the `URL` constructor is able to parse
// it. The constructor throws an error for an invalid URL.
try {
new URL ( url ) ;
return true ;
2020-06-26 09:33:47 -04:00
} catch ( _unused ) {
2020-02-10 17:33:27 -05:00
return false ;
}
2020-01-08 06:57:23 -05:00
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-email.js
var EMAIL _REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i ;
/ * *
* Determines whether the given string looks like an email .
*
* @ param { string } email The string to scrutinise .
*
* @ example
* ` ` ` js
* const isEmail = isEmail ( 'hello@wordpress.org' ) ; // true
* ` ` `
*
* @ return { boolean } Whether or not it looks like an email .
* /
function isEmail ( email ) {
return EMAIL _REGEXP . test ( email ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-protocol.js
/ * *
* Returns the protocol part of the URL .
*
* @ param { string } url The full URL .
*
* @ example
* ` ` ` js
* const protocol1 = getProtocol ( 'tel:012345678' ) ; // 'tel:'
* const protocol2 = getProtocol ( 'https://wordpress.org' ) ; // 'https:'
* ` ` `
*
* @ return { string | void } The protocol part of the URL .
* /
function getProtocol ( url ) {
var matches = /^([^\s:]+:)/ . exec ( url ) ;
if ( matches ) {
return matches [ 1 ] ;
}
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-protocol.js
/ * *
* Tests if a url protocol is valid .
*
* @ param { string } protocol The url protocol .
*
* @ example
* ` ` ` js
* const isValid = isValidProtocol ( 'https:' ) ; // true
* const isNotValid = isValidProtocol ( 'https :' ) ; // false
* ` ` `
*
* @ return { boolean } True if the argument is a valid protocol ( e . g . http : , tel : ) .
* /
function isValidProtocol ( protocol ) {
if ( ! protocol ) {
return false ;
}
return /^[a-z\-.\+]+[0-9]*:$/i . test ( protocol ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-authority.js
/ * *
* Returns the authority part of the URL .
*
* @ param { string } url The full URL .
*
* @ example
* ` ` ` js
* const authority1 = getAuthority ( 'https://wordpress.org/help/' ) ; // 'wordpress.org'
* const authority2 = getAuthority ( 'https://localhost:8080/test/' ) ; // 'localhost:8080'
* ` ` `
*
* @ return { string | void } The authority part of the URL .
* /
function getAuthority ( url ) {
var matches = /^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/ . exec ( url ) ;
if ( matches ) {
return matches [ 1 ] ;
}
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-authority.js
/ * *
* Checks for invalid characters within the provided authority .
*
* @ param { string } authority A string containing the URL authority .
*
* @ example
* ` ` ` js
* const isValid = isValidAuthority ( 'wordpress.org' ) ; // true
* const isNotValid = isValidAuthority ( 'wordpress#org' ) ; // false
* ` ` `
*
* @ return { boolean } True if the argument contains a valid authority .
* /
function isValidAuthority ( authority ) {
if ( ! authority ) {
return false ;
}
return /^[^\s#?]+$/ . test ( authority ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path.js
/ * *
* Returns the path part of the URL .
*
* @ param { string } url The full URL .
*
* @ example
* ` ` ` js
* const path1 = getPath ( 'http://localhost:8080/this/is/a/test?query=true' ) ; // 'this/is/a/test'
* const path2 = getPath ( 'https://wordpress.org/help/faq/' ) ; // 'help/faq'
* ` ` `
*
* @ return { string | void } The path part of the URL .
* /
function getPath ( url ) {
var matches = /^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/ . exec ( url ) ;
if ( matches ) {
return matches [ 1 ] ;
}
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-path.js
/ * *
* Checks for invalid characters within the provided path .
*
* @ param { string } path The URL path .
*
* @ example
* ` ` ` js
* const isValid = isValidPath ( 'test/path/' ) ; // true
* const isNotValid = isValidPath ( '/invalid?test/path/' ) ; // false
* ` ` `
*
* @ return { boolean } True if the argument contains a valid path
* /
function isValidPath ( path ) {
if ( ! path ) {
return false ;
}
return /^[^\s#?]+$/ . test ( path ) ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-string.js
/ * *
* Returns the query string part of the URL .
*
* @ param { string } url The full URL .
*
* @ example
* ` ` ` js
2020-06-26 09:33:47 -04:00
* const queryString = getQueryString ( 'http://localhost:8080/this/is/a/test?query=true#fragment' ) ; // 'query=true'
2020-01-08 06:57:23 -05:00
* ` ` `
*
* @ return { string | void } The query string part of the URL .
* /
function getQueryString ( url ) {
2020-06-26 09:33:47 -04:00
var query ;
2020-01-08 06:57:23 -05:00
2020-06-26 09:33:47 -04:00
try {
2021-01-27 21:04:13 -05:00
query = new URL ( url , 'http://example.com' ) . search . substring ( 1 ) ;
2020-06-26 09:33:47 -04:00
} catch ( error ) { }
if ( query ) {
return query ;
2020-01-08 06:57:23 -05:00
}
}
2018-12-13 23:41:57 -05:00
2021-01-27 21:04:13 -05:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
2021-04-15 11:19:43 -04:00
var slicedToArray = _ _webpack _require _ _ ( 12 ) ;
2021-01-27 21:04:13 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/build-query-string.js
function _createForOfIteratorHelper ( o , allowArrayLike ) { var it ; if ( typeof Symbol === "undefined" || o [ Symbol . iterator ] == null ) { if ( Array . isArray ( o ) || ( it = _unsupportedIterableToArray ( o ) ) || allowArrayLike && o && typeof o . length === "number" ) { if ( it ) o = it ; var i = 0 ; var F = function F ( ) { } ; return { s : F , n : function n ( ) { if ( i >= o . length ) return { done : true } ; return { done : false , value : o [ i ++ ] } ; } , e : function e ( _e ) { throw _e ; } , f : F } ; } throw new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ; } var normalCompletion = true , didErr = false , err ; return { s : function s ( ) { it = o [ Symbol . iterator ] ( ) ; } , n : function n ( ) { var step = it . next ( ) ; normalCompletion = step . done ; return step ; } , e : function e ( _e2 ) { didErr = true ; err = _e2 ; } , f : function f ( ) { try { if ( ! normalCompletion && it . return != null ) it . return ( ) ; } finally { if ( didErr ) throw err ; } } } ; }
function _unsupportedIterableToArray ( o , minLen ) { if ( ! o ) return ; if ( typeof o === "string" ) return _arrayLikeToArray ( o , minLen ) ; var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ; if ( n === "Object" && o . constructor ) n = o . constructor . name ; if ( n === "Map" || n === "Set" ) return Array . from ( o ) ; if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return _arrayLikeToArray ( o , minLen ) ; }
function _arrayLikeToArray ( arr , len ) { if ( len == null || len > arr . length ) len = arr . length ; for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; }
/ * *
* Generates URL - encoded query string using input query data .
*
* It is intended to behave equivalent as PHP ' s ` http_build_query ` , configured
* with encoding type PHP _QUERY _RFC3986 ( spaces as ` %20 ` ) .
*
* @ example
* ` ` ` js
* const queryString = buildQueryString ( {
* simple : 'is ok' ,
* arrays : [ 'are' , 'fine' , 'too' ] ,
* objects : {
* evenNested : {
* ok : 'yes' ,
* } ,
* } ,
* } ) ;
* // "simple=is%20ok&arrays%5B0%5D=are&arrays%5B1%5D=fine&arrays%5B2%5D=too&objects%5BevenNested%5D%5Bok%5D=yes"
* ` ` `
*
* @ param { Record < string , * > } data Data to encode .
*
* @ return { string } Query string .
* /
function buildQueryString ( data ) {
var string = '' ;
var stack = Object . entries ( data ) ;
var pair ;
while ( pair = stack . shift ( ) ) {
var _pair = pair ,
_pair2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _pair , 2 ) ,
key = _pair2 [ 0 ] ,
value = _pair2 [ 1 ] ; // Support building deeply nested data, from array or object values.
var hasNestedData = Array . isArray ( value ) || value && value . constructor === Object ;
if ( hasNestedData ) {
// Push array or object values onto the stack as composed of their
// original key and nested index or key, retaining order by a
// combination of Array#reverse and Array#unshift onto the stack.
var valuePairs = Object . entries ( value ) . reverse ( ) ;
var _iterator = _createForOfIteratorHelper ( valuePairs ) ,
_step ;
try {
for ( _iterator . s ( ) ; ! ( _step = _iterator . n ( ) ) . done ; ) {
var _step$value = Object ( slicedToArray [ "a" /* default */ ] ) ( _step . value , 2 ) ,
member = _step$value [ 0 ] ,
memberValue = _step$value [ 1 ] ;
stack . unshift ( [ "" . concat ( key , "[" ) . concat ( member , "]" ) , memberValue ] ) ;
}
} catch ( err ) {
_iterator . e ( err ) ;
} finally {
_iterator . f ( ) ;
}
} else if ( value !== undefined ) {
// Null is treated as special case, equivalent to empty string.
if ( value === null ) {
value = '' ;
}
string += '&' + [ key , value ] . map ( encodeURIComponent ) . join ( '=' ) ;
}
} // Loop will concatenate with leading `&`, but it's only expected for all
// but the first query parameter. This strips the leading `&`, while still
// accounting for the case that the string may in-fact be empty.
return string . substr ( 1 ) ;
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-query-string.js
/ * *
* Checks for invalid characters within the provided query string .
*
* @ param { string } queryString The query string .
*
* @ example
* ` ` ` js
* const isValid = isValidQueryString ( 'query=true&another=false' ) ; // true
* const isNotValid = isValidQueryString ( 'query=true?another=false' ) ; // false
* ` ` `
*
* @ return { boolean } True if the argument contains a valid query string .
* /
function isValidQueryString ( queryString ) {
if ( ! queryString ) {
return false ;
}
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
return /^[^\s#?\/]+$/ . test ( queryString ) ;
}
2018-12-13 23:41:57 -05:00
2020-06-26 09:33:47 -04:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-path-and-query-string.js
/ * *
* Internal dependencies
* /
/ * *
* Returns the path part and query string part of the URL .
*
* @ param { string } url The full URL .
*
* @ example
* ` ` ` js
* const pathAndQueryString1 = getPathAndQueryString ( 'http://localhost:8080/this/is/a/test?query=true' ) ; // '/this/is/a/test?query=true'
* const pathAndQueryString2 = getPathAndQueryString ( 'https://wordpress.org/help/faq/' ) ; // '/help/faq'
* ` ` `
*
* @ return { string } The path part and query string part of the URL .
* /
function getPathAndQueryString ( url ) {
var path = getPath ( url ) ;
var queryString = getQueryString ( url ) ;
var value = '/' ;
if ( path ) value += path ;
if ( queryString ) value += "?" . concat ( queryString ) ;
return value ;
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-fragment.js
/ * *
* Returns the fragment part of the URL .
*
* @ param { string } url The full URL
*
* @ example
* ` ` ` js
* const fragment1 = getFragment ( 'http://localhost:8080/this/is/a/test?query=true#fragment' ) ; // '#fragment'
* const fragment2 = getFragment ( 'https://wordpress.org#another-fragment?query=true' ) ; // '#another-fragment'
* ` ` `
*
* @ return { string | void } The fragment part of the URL .
* /
function getFragment ( url ) {
var matches = /^\S+?(#[^\s\?]*)/ . exec ( url ) ;
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
if ( matches ) {
return matches [ 1 ] ;
}
}
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/is-valid-fragment.js
/ * *
* Checks for invalid characters within the provided fragment .
*
* @ param { string } fragment The url fragment .
*
* @ example
* ` ` ` js
* const isValid = isValidFragment ( '#valid-fragment' ) ; // true
* const isNotValid = isValidFragment ( '#invalid-#fragment' ) ; // false
* ` ` `
*
* @ return { boolean } True if the argument contains a valid fragment .
* /
function isValidFragment ( fragment ) {
if ( ! fragment ) {
return false ;
}
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
return /^#[^\s#?\/]*$/ . test ( fragment ) ;
}
2018-12-13 23:41:57 -05:00
2021-01-27 21:04:13 -05:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = _ _webpack _require _ _ ( 5 ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-args.js
function ownKeys ( object , enumerableOnly ) { var keys = Object . keys ( object ) ; if ( Object . getOwnPropertySymbols ) { var symbols = Object . getOwnPropertySymbols ( object ) ; if ( enumerableOnly ) symbols = symbols . filter ( function ( sym ) { return Object . getOwnPropertyDescriptor ( object , sym ) . enumerable ; } ) ; keys . push . apply ( keys , symbols ) ; } return keys ; }
function _objectSpread ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] != null ? arguments [ i ] : { } ; if ( i % 2 ) { ownKeys ( Object ( source ) , true ) . forEach ( function ( key ) { Object ( defineProperty [ "a" /* default */ ] ) ( target , key , source [ key ] ) ; } ) ; } else if ( Object . getOwnPropertyDescriptors ) { Object . defineProperties ( target , Object . getOwnPropertyDescriptors ( source ) ) ; } else { ownKeys ( Object ( source ) ) . forEach ( function ( key ) { Object . defineProperty ( target , key , Object . getOwnPropertyDescriptor ( source , key ) ) ; } ) ; } } return target ; }
/ * *
* Internal dependencies
* /
/** @typedef {import('./get-query-arg').QueryArgParsed} QueryArgParsed */
/ * *
* @ typedef { Record < string , QueryArgParsed > } QueryArgs
* /
/ * *
* Sets a value in object deeply by a given array of path segments . Mutates the
* object reference .
*
* @ param { Record < string , * > } object Object in which to assign .
* @ param { string [ ] } path Path segment at which to set value .
* @ param { * } value Value to set .
* /
function setPath ( object , path , value ) {
var length = path . length ;
var lastIndex = length - 1 ;
for ( var i = 0 ; i < length ; i ++ ) {
var key = path [ i ] ;
if ( ! key && Array . isArray ( object ) ) {
// If key is empty string and next value is array, derive key from
// the current length of the array.
key = object . length . toString ( ) ;
} // If the next key in the path is numeric (or empty string), it will be
// created as an array. Otherwise, it will be created as an object.
var isNextKeyArrayIndex = ! isNaN ( Number ( path [ i + 1 ] ) ) ;
object [ key ] = i === lastIndex ? // If at end of path, assign the intended value.
value : // Otherwise, advance to the next object in the path, creating
// it if it does not yet exist.
object [ key ] || ( isNextKeyArrayIndex ? [ ] : { } ) ;
if ( Array . isArray ( object [ key ] ) && ! isNextKeyArrayIndex ) {
// If we current key is non-numeric, but the next value is an
// array, coerce the value to an object.
object [ key ] = _objectSpread ( { } , object [ key ] ) ;
} // Update working reference object to the next in the path.
object = object [ key ] ;
}
}
/ * *
* Returns an object of query arguments of the given URL . If the given URL is
* invalid or has no querystring , an empty object is returned .
*
* @ param { string } url URL .
*
* @ example
* ` ` ` js
* const foo = getQueryArgs ( 'https://wordpress.org?foo=bar&bar=baz' ) ;
* // { "foo": "bar", "bar": "baz" }
* ` ` `
*
* @ return { QueryArgs } Query args object .
* /
function getQueryArgs ( url ) {
return ( getQueryString ( url ) || '' ) . // Normalize space encoding, accounting for PHP URL encoding
// corresponding to `application/x-www-form-urlencoded`.
//
// See: https://tools.ietf.org/html/rfc1866#section-8.2.1
replace ( /\+/g , '%20' ) . split ( '&' ) . reduce ( function ( accumulator , keyValue ) {
var _keyValue$split$filte = keyValue . split ( '=' ) // Filtering avoids decoding as `undefined` for value, where
// default is restored in destructuring assignment.
. filter ( Boolean ) . map ( decodeURIComponent ) ,
_keyValue$split$filte2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _keyValue$split$filte , 2 ) ,
key = _keyValue$split$filte2 [ 0 ] ,
_keyValue$split$filte3 = _keyValue$split$filte2 [ 1 ] ,
value = _keyValue$split$filte3 === void 0 ? '' : _keyValue$split$filte3 ;
if ( key ) {
var segments = key . replace ( /\]/g , '' ) . split ( '[' ) ;
setPath ( accumulator , segments , value ) ;
}
return accumulator ;
} , { } ) ;
}
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/add-query-args.js
/ * *
2021-01-27 21:04:13 -05:00
* Internal dependencies
2020-01-08 06:57:23 -05:00
* /
2018-12-13 23:41:57 -05:00
2021-01-27 21:04:13 -05:00
2020-01-08 06:57:23 -05:00
/ * *
* Appends arguments as querystring to the provided URL . If the URL already
* includes query arguments , the arguments are merged with ( and take precedent
* over ) the existing set .
*
* @ param { string } [ url = '' ] URL to which arguments should be appended . If omitted ,
* only the resulting querystring is returned .
2020-06-26 09:33:47 -04:00
* @ param { Object } [ args ] Query arguments to apply to URL .
2020-01-08 06:57:23 -05:00
*
* @ example
* ` ` ` js
* const newURL = addQueryArgs ( 'https://google.com' , { q : 'test' } ) ; // https://google.com/?q=test
* ` ` `
*
* @ return { string } URL with arguments applied .
* /
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
function addQueryArgs ( ) {
var url = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : '' ;
var args = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
// If no arguments are to be appended, return original URL.
if ( ! args || ! Object . keys ( args ) . length ) {
return url ;
}
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
var baseUrl = url ; // Determine whether URL already had query arguments.
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
var queryStringIndex = url . indexOf ( '?' ) ;
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
if ( queryStringIndex !== - 1 ) {
// Merge into existing query arguments.
2021-01-27 21:04:13 -05:00
args = Object . assign ( getQueryArgs ( url ) , args ) ; // Change working base URL to omit previous query arguments.
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
baseUrl = baseUrl . substr ( 0 , queryStringIndex ) ;
}
2018-12-13 23:41:57 -05:00
2021-01-27 21:04:13 -05:00
return baseUrl + '?' + buildQueryString ( args ) ;
2020-01-08 06:57:23 -05:00
}
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/get-query-arg.js
/ * *
2021-01-27 21:04:13 -05:00
* Internal dependencies
2020-01-08 06:57:23 -05:00
* /
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
/ * *
* @ typedef { { [ key : string ] : QueryArgParsed } } QueryArgObject
* /
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
/ * *
* @ typedef { string | string [ ] | QueryArgObject } QueryArgParsed
* /
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
/ * *
* Returns a single query argument of the url
*
* @ param { string } url URL .
* @ param { string } arg Query arg name .
*
* @ example
* ` ` ` js
* const foo = getQueryArg ( 'https://wordpress.org?foo=bar&bar=baz' , 'foo' ) ; // bar
* ` ` `
*
2021-01-27 21:04:13 -05:00
* @ return { QueryArgParsed | void } Query arg value .
2020-01-08 06:57:23 -05:00
* /
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
function getQueryArg ( url , arg ) {
2021-01-27 21:04:13 -05:00
return getQueryArgs ( url ) [ arg ] ;
2020-01-08 06:57:23 -05:00
}
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/has-query-arg.js
/ * *
* Internal dependencies
* /
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
/ * *
* Determines whether the URL contains a given query arg .
*
* @ param { string } url URL .
* @ param { string } arg Query arg name .
*
* @ example
* ` ` ` js
* const hasBar = hasQueryArg ( 'https://wordpress.org?foo=bar&bar=baz' , 'bar' ) ; // true
* ` ` `
*
* @ return { boolean } Whether or not the URL contains the query arg .
* /
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
function hasQueryArg ( url , arg ) {
return getQueryArg ( url , arg ) !== undefined ;
}
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/remove-query-args.js
/ * *
2021-01-27 21:04:13 -05:00
* Internal dependencies
2020-01-08 06:57:23 -05:00
* /
2018-12-17 22:14:52 -05:00
2021-01-27 21:04:13 -05:00
2020-01-08 06:57:23 -05:00
/ * *
* Removes arguments from the query string of the url
*
* @ param { string } url URL .
* @ param { ... string } args Query Args .
*
* @ example
* ` ` ` js
* const newUrl = removeQueryArgs ( 'https://wordpress.org?foo=bar&bar=baz&baz=foobar' , 'foo' , 'bar' ) ; // https://wordpress.org?baz=foobar
* ` ` `
*
* @ return { string } Updated URL .
* /
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
function removeQueryArgs ( url ) {
var queryStringIndex = url . indexOf ( '?' ) ;
2021-01-27 21:04:13 -05:00
if ( queryStringIndex === - 1 ) {
return url ;
}
var query = getQueryArgs ( url ) ;
var baseURL = url . substr ( 0 , queryStringIndex ) ;
2019-06-27 07:28:19 -04:00
2020-01-08 06:57:23 -05:00
for ( var _len = arguments . length , args = new Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) {
args [ _key - 1 ] = arguments [ _key ] ;
}
2019-06-27 07:28:19 -04:00
2020-01-08 06:57:23 -05:00
args . forEach ( function ( arg ) {
return delete query [ arg ] ;
} ) ;
2021-01-27 21:04:13 -05:00
var queryString = buildQueryString ( query ) ;
return queryString ? baseURL + '?' + queryString : baseURL ;
2020-01-08 06:57:23 -05:00
}
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/prepend-http.js
/ * *
* Internal dependencies
* /
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
var USABLE _HREF _REGEXP = /^(?:[a-z]+:|#|\?|\.|\/)/i ;
/ * *
* Prepends "http://" to a url , if it looks like something that is meant to be a TLD .
*
* @ param { string } url The URL to test .
*
* @ example
* ` ` ` js
* const actualURL = prependHTTP ( 'wordpress.org' ) ; // http://wordpress.org
* ` ` `
*
* @ return { string } The updated URL .
* /
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
function prependHTTP ( url ) {
if ( ! url ) {
return url ;
}
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
url = url . trim ( ) ;
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
if ( ! USABLE _HREF _REGEXP . test ( url ) && ! isEmail ( url ) ) {
return 'http://' + url ;
}
2018-12-13 23:41:57 -05:00
2020-01-08 06:57:23 -05:00
return url ;
}
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/safe-decode-uri.js
/ * *
* Safely decodes a URI with ` decodeURI ` . Returns the URI unmodified if
* ` decodeURI ` throws an error .
*
* @ param { string } uri URI to decode .
*
* @ example
* ` ` ` js
* const badUri = safeDecodeURI ( '%z' ) ; // does not throw an Error, simply returns '%z'
* ` ` `
*
* @ return { string } Decoded URI if possible .
* /
function safeDecodeURI ( uri ) {
try {
return decodeURI ( uri ) ;
} catch ( uriError ) {
return uri ;
}
}
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/safe-decode-uri-component.js
/ * *
* Safely decodes a URI component with ` decodeURIComponent ` . Returns the URI component unmodified if
* ` decodeURIComponent ` throws an error .
*
* @ param { string } uriComponent URI component to decode .
*
* @ return { string } Decoded URI component if possible .
* /
function safeDecodeURIComponent ( uriComponent ) {
try {
return decodeURIComponent ( uriComponent ) ;
} catch ( uriComponentError ) {
return uriComponent ;
}
}
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/filter-url-for-display.js
/ * *
* Returns a URL for display .
*
* @ param { string } url Original URL .
2021-01-27 21:04:13 -05:00
* @ param { number | null } maxLength URL length .
2020-01-08 06:57:23 -05:00
*
* @ example
* ` ` ` js
* const displayUrl = filterURLForDisplay ( 'https://www.wordpress.org/gutenberg/' ) ; // wordpress.org/gutenberg
2021-01-27 21:04:13 -05:00
* const imageUrl = filterURLForDisplay ( 'https://www.wordpress.org/wp-content/uploads/img.png' , 20 ) ; // …ent/uploads/img.png
2020-01-08 06:57:23 -05:00
* ` ` `
*
* @ return { string } Displayed URL .
* /
function filterURLForDisplay ( url ) {
2021-01-27 21:04:13 -05:00
var maxLength = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ;
2020-01-08 06:57:23 -05:00
// Remove protocol and www prefixes.
var filteredURL = url . replace ( /^(?:https?:)\/\/(?:www\.)?/ , '' ) ; // Ends with / and only has that single slash, strip it.
2018-12-17 22:14:52 -05:00
2020-01-08 06:57:23 -05:00
if ( filteredURL . match ( /^[^\/]+\/$/ ) ) {
2021-01-27 21:04:13 -05:00
filteredURL = filteredURL . replace ( '/' , '' ) ;
2020-01-08 06:57:23 -05:00
}
2021-01-27 21:04:13 -05:00
var mediaRegexp = /([\w|:])*\.(?:jpg|jpeg|gif|png|svg)/ ;
if ( ! maxLength || filteredURL . length <= maxLength || ! filteredURL . match ( mediaRegexp ) ) {
return filteredURL ;
} // If the file is not greater than max length, return last portion of URL.
filteredURL = filteredURL . split ( '?' ) [ 0 ] ;
var urlPieces = filteredURL . split ( '/' ) ;
var file = urlPieces [ urlPieces . length - 1 ] ;
if ( file . length <= maxLength ) {
return '…' + filteredURL . slice ( - maxLength ) ;
} // If the file is greater than max length, truncate the file.
var index = file . lastIndexOf ( '.' ) ;
var _ref = [ file . slice ( 0 , index ) , file . slice ( index + 1 ) ] ,
fileName = _ref [ 0 ] ,
extension = _ref [ 1 ] ;
var truncatedFile = fileName . slice ( - 3 ) + '.' + extension ;
return file . slice ( 0 , maxLength - truncatedFile . length - 1 ) + '…' + truncatedFile ;
2020-01-08 06:57:23 -05:00
}
2021-01-27 21:04:13 -05:00
// EXTERNAL MODULE: external "lodash"
var external _lodash _ = _ _webpack _require _ _ ( 2 ) ;
2020-02-06 16:03:31 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/clean-for-slug.js
/ * *
* External dependencies
* /
/ * *
* Performs some basic cleanup of a string for use as a post slug .
*
* This replicates some of what ` sanitize_title() ` does in WordPress core , but
* is only designed to approximate what the slug will be .
*
* Converts Latin - 1 Supplement and Latin Extended - A letters to basic Latin
2020-06-26 09:33:47 -04:00
* letters . Removes combining diacritical marks . Converts whitespace , periods ,
* and forward slashes to hyphens . Removes any remaining non - word characters
* except hyphens . Converts remaining string to lowercase . It does not account
* for octets , HTML entities , or other encoded characters .
2020-02-06 16:03:31 -05:00
*
* @ param { string } string Title or slug to be processed .
*
* @ return { string } Processed string .
* /
function cleanForSlug ( string ) {
if ( ! string ) {
return '' ;
}
2021-01-27 21:04:13 -05:00
return Object ( external _lodash _ [ "trim" ] ) ( Object ( external _lodash _ [ "deburr" ] ) ( string ) . replace ( /[\s\./]+/g , '-' ) . replace ( /[^\w-]+/g , '' ) . toLowerCase ( ) , '-' ) ;
2020-02-06 16:03:31 -05:00
}
2020-01-08 06:57:23 -05:00
// CONCATENATED MODULE: ./node_modules/@wordpress/url/build-module/index.js
2020-02-06 16:03:31 -05:00
2018-12-17 22:14:52 -05:00
2018-12-13 23:41:57 -05:00
2019-06-27 07:28:19 -04:00
2018-12-13 23:41:57 -05:00
2018-12-17 22:14:52 -05:00
2018-12-13 23:41:57 -05:00
2021-01-27 21:04:13 -05:00
/***/ } ) ,
/***/ 5 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _defineProperty ; } ) ;
function _defineProperty ( obj , key , value ) {
if ( key in obj ) {
Object . defineProperty ( obj , key , {
value : value ,
enumerable : true ,
configurable : true ,
writable : true
} ) ;
} else {
obj [ key ] = value ;
}
return obj ;
}
2018-12-13 23:41:57 -05:00
/***/ } )
2018-12-17 22:14:52 -05:00
/******/ } ) ;