/*! * Select2 4.0.3 * https://select2.github.io * * Released under the MIT license * https://github.com/select2/select2/blob/master/LICENSE.md */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof exports === 'object') { // Node/CommonJS factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function (jQuery) { // This is needed so we can catch the AMD loader configuration and use it // The inner file should be wrapped (by `banner.start.js`) in a function that // returns the AMD loader references. var S2 = (function () { // Restore the Select2 AMD loader so it can be used // Needed mostly in the language files, where the loader is not inserted if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) { var S2 = jQuery.fn.select2.amd; } var S2;(function () { if (!S2 || !S2.requirejs) { if (!S2) { S2 = {}; } else { require = S2; } /** * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ //Going sloppy to avoid 'use strict' string cost, but strict practices should //be followed. /*jslint sloppy: true */ /*global setTimeout: false */ var requirejs, require, define; (function (undef) { var main, req, makeMap, handlers, defined = {}, waiting = {}, config = {}, defining = {}, hasOwn = Object.prototype.hasOwnProperty, aps = [].slice, jsSuffixRegExp = /\.js$/; function hasProp(obj, prop) { return hasOwn.call(obj, prop); } /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @returns {String} normalized name */ function normalize(name, baseName) { var nameParts, nameSegment, mapValue, foundMap, lastIndex, foundI, foundStarMap, starI, i, j, part, baseParts = baseName && baseName.split("/"), map = config.map, starMap = (map && map['*']) || {}; //Adjust any relative paths. if (name && name.charAt(0) === ".") { //If have a base name, try to normalize against it, //otherwise, assume it is a top-level require that will //be relative to baseUrl in the end. if (baseName) { name = name.split('/'); lastIndex = name.length - 1; // Node .js allowance: if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); } //Lop off the last part of baseParts, so that . matches the //"directory" and not name of the baseName's module. For instance, //baseName of "one/two/three", maps to "one/two/three.js", but we //want the directory, "one/two" for this normalization. name = baseParts.slice(0, baseParts.length - 1).concat(name); //start trimDots for (i = 0; i < name.length; i += 1) { part = name[i]; if (part === ".") { name.splice(i, 1); i -= 1; } else if (part === "..") { if (i === 1 && (name[2] === '..' || name[0] === '..')) { //End of the line. Keep at least one non-dot //path segment at the front so it can be mapped //correctly to disk. Otherwise, there is likely //no path mapping for a path starting with '..'. //This can still fail, but catches the most reasonable //uses of .. break; } else if (i > 0) { name.splice(i - 1, 2); i -= 2; } } } //end trimDots name = name.join("/"); } else if (name.indexOf('./') === 0) { // No baseName, so this is ID is resolved relative // to baseUrl, pull off the leading dot. name = name.substring(2); } } //Apply map config if available. if ((baseParts || starMap) && map) { nameParts = name.split('/'); for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join("/"); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break; } } } } if (foundMap) { break; } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && starMap[nameSegment]) { foundStarMap = starMap[nameSegment]; starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } return name; } function makeRequire(relName, forceSync) { return function () { //A version of a require function that passes a moduleName //value for items that may need to //look up paths relative to the moduleName var args = aps.call(arguments, 0); //If first arg is not require('string'), and there is only //one arg, it is the array form without a callback. Insert //a null so that the following concat is correct. if (typeof args[0] !== 'string' && args.length === 1) { args.push(null); } return req.apply(undef, args.concat([relName, forceSync])); }; } function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(depName) { return function (value) { defined[depName] = value; }; } function callDep(name) { if (hasProp(waiting, name)) { var args = waiting[name]; delete waiting[name]; defining[name] = true; main.apply(undef, args); } if (!hasProp(defined, name) && !hasProp(defining, name)) { throw new Error('No ' + name); } return defined[name]; } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } /** * Makes a name map, normalizing the name, and using a plugin * for normalization if necessary. Grabs a ref to plugin * too, as an optimization. */ makeMap = function (name, relName) { var plugin, parts = splitPrefix(name), prefix = parts[0]; name = parts[1]; if (prefix) { prefix = normalize(prefix, relName); plugin = callDep(prefix); } //Normalize according if (prefix) { if (plugin && plugin.normalize) { name = plugin.normalize(name, makeNormalize(relName)); } else { name = normalize(name, relName); } } else { name = normalize(name, relName); parts = splitPrefix(name); prefix = parts[0]; name = parts[1]; if (prefix) { plugin = callDep(prefix); } } //Using ridiculous property names for space reasons return { f: prefix ? prefix + '!' + name : name, //fullName n: name, pr: prefix, p: plugin }; }; function makeConfig(name) { return function () { return (config && config.config && config.config[name]) || {}; }; } handlers = { require: function (name) { return makeRequire(name); }, exports: function (name) { var e = defined[name]; if (typeof e !== 'undefined') { return e; } else { return (defined[name] = {}); } }, module: function (name) { return { id: name, uri: '', exports: defined[name], config: makeConfig(name) }; } }; main = function (name, deps, callback, relName) { var cjsModule, depName, ret, map, i, args = [], callbackType = typeof callback, usingExports; //Use name if no relName relName = relName || name; //Call the callback to define the module, if necessary. if (callbackType === 'undefined' || callbackType === 'function') { //Pull out the defined dependencies and pass the ordered //values to the callback. //Default to [require, exports, module] if no deps deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; for (i = 0; i < deps.length; i += 1) { map = makeMap(deps[i], relName); depName = map.f; //Fast path CommonJS standard dependencies. if (depName === "require") { args[i] = handlers.require(name); } else if (depName === "exports") { //CommonJS module spec 1.1 args[i] = handlers.exports(name); usingExports = true; } else if (depName === "module") { //CommonJS module spec 1.1 cjsModule = args[i] = handlers.module(name); } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) { args[i] = callDep(depName); } else if (map.p) { map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); args[i] = defined[depName]; } else { throw new Error(name + ' missing ' + depName); } } ret = callback ? callback.apply(defined[name], args) : undefined; if (name) { //If setting exports via "module" is in play, //favor that over return value and exports. After that, //favor a non-undefined return value over exports use. if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) { defined[name] = cjsModule.exports; } else if (ret !== undef || !usingExports) { //Use the return value from the function. defined[name] = ret; } } } else if (name) { //May just be an object definition for the module. Only //worry about defining if have a module name. defined[name] = callback; } }; requirejs = require = req = function (deps, callback, relName, forceSync, alt) { if (typeof deps === "string") { if (handlers[deps]) { //callback in this case is really relName return handlers[deps](callback); } //Just return the module wanted. In this scenario, the //deps arg is the module name, and second arg (if passed) //is just the relName. //Normalize module name, if it contains . or .. return callDep(makeMap(deps, callback).f); } else if (!deps.splice) { //deps is a config object, not an array. config = deps; if (config.deps) { req(config.deps, config.callback); } if (!callback) { return; } if (callback.splice) { //callback is an array, which means it is a dependency list. //Adjust args if there are dependencies deps = callback; callback = relName; relName = null; } else { deps = undef; } } //Support require(['a']) callback = callback || function () {}; //If relName is a function, it is an errback handler, //so remove it. if (typeof relName === 'function') { relName = forceSync; forceSync = alt; } //Simulate async callback; if (forceSync) { main(undef, deps, callback, relName); } else { //Using a non-zero value because of concern for what old browsers //do, and latest browsers "upgrade" to 4 if lower value is used: //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: //If want a value immediately, use require('id') instead -- something //that works in almond on the global level, but not guaranteed and //unlikely to work in other AMD implementations. setTimeout(function () { main(undef, deps, callback, relName); }, 4); } return req; }; /** * Just drops the config on the floor, but returns req in case * the config return value is used. */ req.config = function (cfg) { return req(cfg); }; /** * Expose module registry for debugging and tooling */ requirejs._defined = defined; define = function (name, deps, callback) { if (typeof name !== 'string') { throw new Error('See almond README: incorrect module build, no module name'); } //This module may not have dependencies if (!deps.splice) { //deps is not an array, so probably means //an object literal or factory function for //the value. Adjust args. callback = deps; deps = []; } if (!hasProp(defined, name) && !hasProp(waiting, name)) { waiting[name] = [name, deps, callback]; } }; define.amd = { jQuery: true }; }()); S2.requirejs = requirejs;S2.require = require;S2.define = define; } }()); S2.define("almond", function(){}); /* global jQuery:false, $:false */ S2.define('jquery',[],function () { var _$ = jQuery || $; if (_$ == null && console && console.error) { console.error( 'Select2: An instance of jQuery or a jQuery-compatible library was not ' + 'found. Make sure that you are including jQuery before Select2 on your ' + 'web page.' ); } return _$; }); S2.define('select2/utils',[ 'jquery' ], function ($) { var Utils = {}; Utils.Extend = function (ChildClass, SuperClass) { var __hasProp = {}.hasOwnProperty; function BaseConstructor () { this.constructor = ChildClass; } for (var key in SuperClass) { if (__hasProp.call(SuperClass, key)) { ChildClass[key] = SuperClass[key]; } } BaseConstructor.prototype = SuperClass.prototype; ChildClass.prototype = new BaseConstructor(); ChildClass.__super__ = SuperClass.prototype; return ChildClass; }; function getMethods (theClass) { var proto = theClass.prototype; var methods = []; for (var methodName in proto) { var m = proto[methodName]; if (typeof m !== 'function') { continue; } if (methodName === 'constructor') { continue; } methods.push(methodName); } return methods; } Utils.Decorate = function (SuperClass, DecoratorClass) { var decoratedMethods = getMethods(DecoratorClass); var superMethods = getMethods(SuperClass); function DecoratedClass () { var unshift = Array.prototype.unshift; var argCount = DecoratorClass.prototype.constructor.length; var calledConstructor = SuperClass.prototype.constructor; if (argCount > 0) { unshift.call(arguments, SuperClass.prototype.constructor); calledConstructor = DecoratorClass.prototype.constructor; } calledConstructor.apply(this, arguments); } DecoratorClass.displayName = SuperClass.displayName; function ctr () { this.constructor = DecoratedClass; } DecoratedClass.prototype = new ctr(); for (var m = 0; m < superMethods.length; m++) { var superMethod = superMethods[m]; DecoratedClass.prototype[superMethod] = SuperClass.prototype[superMethod]; } var calledMethod = function (methodName) { // Stub out the original method if it's not decorating an actual method var originalMethod = function () {}; if (methodName in DecoratedClass.prototype) { originalMethod = DecoratedClass.prototype[methodName]; } var decoratedMethod = DecoratorClass.prototype[methodName]; return function () { var unshift = Array.prototype.unshift; unshift.call(arguments, originalMethod); return decoratedMethod.apply(this, arguments); }; }; for (var d = 0; d < decoratedMethods.length; d++) { var decoratedMethod = decoratedMethods[d]; DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod); } return DecoratedClass; }; var Observable = function () { this.listeners = {}; }; Observable.prototype.on = function (event, callback) { this.listeners = this.listeners || {}; if (event in this.listeners) { this.listeners[event].push(callback); } else { this.listeners[event] = [callback]; } }; Observable.prototype.trigger = function (event) { var slice = Array.prototype.slice; var params = slice.call(arguments, 1); this.listeners = this.listeners || {}; // Params should always come in as an array if (params == null) { params = []; } // If there are no arguments to the event, use a temporary object if (params.length === 0) { params.push({}); } // Set the `_type` of the first object to the event params[0]._type = event; if (event in this.listeners) { this.invoke(this.listeners[event], slice.call(arguments, 1)); } if ('*' in this.listeners) { this.invoke(this.listeners['*'], arguments); } }; Observable.prototype.invoke = function (listeners, params) { for (var i = 0, len = listeners.length; i < len; i++) { listeners[i].apply(this, params); } }; Utils.Observable = Observable; Utils.generateChars = function (length) { var chars = ''; for (var i = 0; i < length; i++) { var randomChar = Math.floor(Math.random() * 36); chars += randomChar.toString(36); } return chars; }; Utils.bind = function (func, context) { return function () { func.apply(context, arguments); }; }; Utils._convertData = function (data) { for (var originalKey in data) { var keys = originalKey.split('-'); var dataLevel = data; if (keys.length === 1) { continue; } for (var k = 0; k < keys.length; k++) { var key = keys[k]; // Lowercase the first letter // By default, dash-separated becomes camelCase key = key.substring(0, 1).toLowerCase() + key.substring(1); if (!(key in dataLevel)) { dataLevel[key] = {}; } if (k == keys.length - 1) { dataLevel[key] = data[originalKey]; } dataLevel = dataLevel[key]; } delete data[originalKey]; } return data; }; Utils.hasScroll = function (index, el) { // Adapted from the function created by @ShadowScripter // and adapted by @BillBarry on the Stack Exchange Code Review website. // The original code can be found at // http://codereview.stackexchange.com/q/13338 // and was designed to be used with the Sizzle selector engine. var $el = $(el); var overflowX = el.style.overflowX; var overflowY = el.style.overflowY; //Check both x and y declarations if (overflowX === overflowY && (overflowY === 'hidden' || overflowY === 'visible')) { return false; } if (overflowX === 'scroll' || overflowY === 'scroll') { return true; } return ($el.innerHeight() < el.scrollHeight || $el.innerWidth() < el.scrollWidth); }; Utils.escapeMarkup = function (markup) { var replaceMap = { '\\': '\', '&': '&', '<': '<', '>': '>', '"': '"', '\'': ''', '/': '/' }; // Do not try to escape the markup if it's not a string if (typeof markup !== 'string') { return markup; } return String(markup).replace(/[&<>"'\/\\]/g, function (match) { return replaceMap[match]; }); }; // Append an array of jQuery nodes to a given element. Utils.appendMany = function ($element, $nodes) { // jQuery 1.7.x does not support $.fn.append() with an array // Fall back to a jQuery object collection using $.fn.add() if ($.fn.jquery.substr(0, 3) === '1.7') { var $jqNodes = $(); $.map($nodes, function (node) { $jqNodes = $jqNodes.add(node); }); $nodes = $jqNodes; } $element.append($nodes); }; return Utils; }); S2.define('select2/results',[ 'jquery', './utils' ], function ($, Utils) { function Results ($element, options, dataAdapter) { this.$element = $element; this.data = dataAdapter; this.options = options; Results.__super__.constructor.call(this); } Utils.Extend(Results, Utils.Observable); Results.prototype.render = function () { var $results = $( '' ); if (this.options.get('multiple')) { $results.attr('aria-multiselectable', 'true'); } this.$results = $results; return $results; }; Results.prototype.clear = function () { this.$results.empty(); }; Results.prototype.displayMessage = function (params) { var escapeMarkup = this.options.get('escapeMarkup'); this.clear(); this.hideLoading(); var $message = $( '
  • ' ); var message = this.options.get('translations').get(params.message); $message.append( escapeMarkup( message(params.args) ) ); $message[0].className += ' select2-results__message'; this.$results.append($message); }; Results.prototype.hideMessages = function () { this.$results.find('.select2-results__message').remove(); }; Results.prototype.append = function (data) { this.hideLoading(); var $options = []; if (data.results == null || data.results.length === 0) { if (this.$results.children().length === 0) { this.trigger('results:message', { message: 'noResults' }); } return; } data.results = this.sort(data.results); for (var d = 0; d < data.results.length; d++) { var item = data.results[d]; var $option = this.option(item); $options.push($option); } this.$results.append($options); }; Results.prototype.position = function ($results, $dropdown) { var $resultsContainer = $dropdown.find('.select2-results'); $resultsContainer.append($results); }; Results.prototype.sort = function (data) { var sorter = this.options.get('sorter'); return sorter(data); }; Results.prototype.highlightFirstItem = function () { var $options = this.$results .find('.select2-results__option[aria-selected]'); var $selected = $options.filter('[aria-selected=true]'); // Check if there are any selected options if ($selected.length > 0) { // If there are selected options, highlight the first $selected.first().trigger('mouseenter'); } else { // If there are no selected options, highlight the first option // in the dropdown $options.first().trigger('mouseenter'); } this.ensureHighlightVisible(); }; Results.prototype.setClasses = function () { var self = this; this.data.current(function (selected) { var selectedIds = $.map(selected, function (s) { return s.id.toString(); }); var $options = self.$results .find('.select2-results__option[aria-selected]'); $options.each(function () { var $option = $(this); var item = $.data(this, 'data'); // id needs to be converted to a string when comparing var id = '' + item.id; if ((item.element != null && item.element.selected) || (item.element == null && $.inArray(id, selectedIds) > -1)) { $option.attr('aria-selected', 'true'); } else { $option.attr('aria-selected', 'false'); } }); }); }; Results.prototype.showLoading = function (params) { this.hideLoading(); var loadingMore = this.options.get('translations').get('searching'); var loading = { disabled: true, loading: true, text: loadingMore(params) }; var $loading = this.option(loading); $loading.className += ' loading-results'; this.$results.prepend($loading); }; Results.prototype.hideLoading = function () { this.$results.find('.loading-results').remove(); }; Results.prototype.option = function (data) { var option = document.createElement('li'); option.className = 'select2-results__option'; var attrs = { 'role': 'treeitem', 'aria-selected': 'false' }; if (data.disabled) { delete attrs['aria-selected']; attrs['aria-disabled'] = 'true'; } if (data.id == null) { delete attrs['aria-selected']; } if (data._resultId != null) { option.id = data._resultId; } if (data.title) { option.title = data.title; } if (data.children) { attrs.role = 'group'; attrs['aria-label'] = data.text; delete attrs['aria-selected']; } for (var attr in attrs) { var val = attrs[attr]; option.setAttribute(attr, val); } if (data.children) { var $option = $(option); var label = document.createElement('strong'); label.className = 'select2-results__group'; var $label = $(label); this.template(data, label); var $children = []; for (var c = 0; c < data.children.length; c++) { var child = data.children[c]; var $child = this.option(child); $children.push($child); } var $childrenContainer = $('', { 'class': 'select2-results__options select2-results__options--nested' }); $childrenContainer.append($children); $option.append(label); $option.append($childrenContainer); } else { this.template(data, option); } $.data(option, 'data', data); return option; }; Results.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-results'; this.$results.attr('id', id); container.on('results:all', function (params) { self.clear(); self.append(params.data); if (container.isOpen()) { self.setClasses(); self.highlightFirstItem(); } }); container.on('results:append', function (params) { self.append(params.data); if (container.isOpen()) { self.setClasses(); } }); container.on('query', function (params) { self.hideMessages(); self.showLoading(params); }); container.on('select', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('unselect', function () { if (!container.isOpen()) { return; } self.setClasses(); self.highlightFirstItem(); }); container.on('open', function () { // When the dropdown is open, aria-expended="true" self.$results.attr('aria-expanded', 'true'); self.$results.attr('aria-hidden', 'false'); self.setClasses(); self.ensureHighlightVisible(); }); container.on('close', function () { // When the dropdown is closed, aria-expended="false" self.$results.attr('aria-expanded', 'false'); self.$results.attr('aria-hidden', 'true'); self.$results.removeAttr('aria-activedescendant'); }); container.on('results:toggle', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } $highlighted.trigger('mouseup'); }); container.on('results:select', function () { var $highlighted = self.getHighlightedResults(); if ($highlighted.length === 0) { return; } var data = $highlighted.data('data'); if ($highlighted.attr('aria-selected') == 'true') { self.trigger('close', {}); } else { self.trigger('select', { data: data }); } }); container.on('results:previous', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); // If we are already at te top, don't move further if (currentIndex === 0) { return; } var nextIndex = currentIndex - 1; // If none are highlighted, highlight the first if ($highlighted.length === 0) { nextIndex = 0; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top; var nextTop = $next.offset().top; var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset); if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextTop - currentOffset < 0) { self.$results.scrollTop(nextOffset); } }); container.on('results:next', function () { var $highlighted = self.getHighlightedResults(); var $options = self.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); var nextIndex = currentIndex + 1; // If we are at the last option, stay there if (nextIndex >= $options.length) { return; } var $next = $options.eq(nextIndex); $next.trigger('mouseenter'); var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var nextBottom = $next.offset().top + $next.outerHeight(false); var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset; if (nextIndex === 0) { self.$results.scrollTop(0); } else if (nextBottom > currentOffset) { self.$results.scrollTop(nextOffset); } }); container.on('results:focus', function (params) { params.element.addClass('select2-results__option--highlighted'); }); container.on('results:message', function (params) { self.displayMessage(params); }); if ($.fn.mousewheel) { this.$results.on('mousewheel', function (e) { var top = self.$results.scrollTop(); var bottom = self.$results.get(0).scrollHeight - top + e.deltaY; var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0; var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height(); if (isAtTop) { self.$results.scrollTop(0); e.preventDefault(); e.stopPropagation(); } else if (isAtBottom) { self.$results.scrollTop( self.$results.get(0).scrollHeight - self.$results.height() ); e.preventDefault(); e.stopPropagation(); } }); } this.$results.on('mouseup', '.select2-results__option[aria-selected]', function (evt) { var $this = $(this); var data = $this.data('data'); if ($this.attr('aria-selected') === 'true') { if (self.options.get('multiple')) { self.trigger('unselect', { originalEvent: evt, data: data }); } else { self.trigger('close', {}); } return; } self.trigger('select', { originalEvent: evt, data: data }); }); this.$results.on('mouseenter', '.select2-results__option[aria-selected]', function (evt) { var data = $(this).data('data'); self.getHighlightedResults() .removeClass('select2-results__option--highlighted'); self.trigger('results:focus', { data: data, element: $(this) }); }); }; Results.prototype.getHighlightedResults = function () { var $highlighted = this.$results .find('.select2-results__option--highlighted'); return $highlighted; }; Results.prototype.destroy = function () { this.$results.remove(); }; Results.prototype.ensureHighlightVisible = function () { var $highlighted = this.getHighlightedResults(); if ($highlighted.length === 0) { return; } var $options = this.$results.find('[aria-selected]'); var currentIndex = $options.index($highlighted); var currentOffset = this.$results.offset().top; var nextTop = $highlighted.offset().top; var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset); var offsetDelta = nextTop - currentOffset; nextOffset -= $highlighted.outerHeight(false) * 2; if (currentIndex <= 2) { this.$results.scrollTop(0); } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) { this.$results.scrollTop(nextOffset); } }; Results.prototype.template = function (result, container) { var template = this.options.get('templateResult'); var escapeMarkup = this.options.get('escapeMarkup'); var content = template(result, container); if (content == null) { container.style.display = 'none'; } else if (typeof content === 'string') { container.innerHTML = escapeMarkup(content); } else { $(container).append(content); } }; return Results; }); S2.define('select2/keys',[ ], function () { var KEYS = { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, PAGE_UP: 33, PAGE_DOWN: 34, END: 35, HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, DELETE: 46 }; return KEYS; }); S2.define('select2/selection/base',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function BaseSelection ($element, options) { this.$element = $element; this.options = options; BaseSelection.__super__.constructor.call(this); } Utils.Extend(BaseSelection, Utils.Observable); BaseSelection.prototype.render = function () { var $selection = $( '' ); this._tabindex = 0; if (this.$element.data('old-tabindex') != null) { this._tabindex = this.$element.data('old-tabindex'); } else if (this.$element.attr('tabindex') != null) { this._tabindex = this.$element.attr('tabindex'); } $selection.attr('title', this.$element.attr('title')); $selection.attr('tabindex', this._tabindex); this.$selection = $selection; return $selection; }; BaseSelection.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-container'; var resultsId = container.id + '-results'; this.container = container; this.$selection.on('focus', function (evt) { self.trigger('focus', evt); }); this.$selection.on('blur', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', function (evt) { self.trigger('keypress', evt); if (evt.which === KEYS.SPACE) { evt.preventDefault(); } }); container.on('results:focus', function (params) { self.$selection.attr('aria-activedescendant', params.data._resultId); }); container.on('selection:update', function (params) { self.update(params.data); }); container.on('open', function () { // When the dropdown is open, aria-expanded="true" self.$selection.attr('aria-expanded', 'true'); self.$selection.attr('aria-owns', resultsId); self._attachCloseHandler(container); }); container.on('close', function () { // When the dropdown is closed, aria-expanded="false" self.$selection.attr('aria-expanded', 'false'); self.$selection.removeAttr('aria-activedescendant'); self.$selection.removeAttr('aria-owns'); self.$selection.focus(); self._detachCloseHandler(container); }); container.on('enable', function () { self.$selection.attr('tabindex', self._tabindex); }); container.on('disable', function () { self.$selection.attr('tabindex', '-1'); }); }; BaseSelection.prototype._handleBlur = function (evt) { var self = this; // This needs to be delayed as the active element is the body when the tab // key is pressed, possibly along with others. window.setTimeout(function () { // Don't trigger `blur` if the focus is still in the selection if ( (document.activeElement == self.$selection[0]) || ($.contains(self.$selection[0], document.activeElement)) ) { return; } self.trigger('blur', evt); }, 1); }; BaseSelection.prototype._attachCloseHandler = function (container) { var self = this; $(document.body).on('mousedown.select2.' + container.id, function (e) { var $target = $(e.target); var $select = $target.closest('.select2'); var $all = $('.select2.select2-container--open'); $all.each(function () { var $this = $(this); if (this == $select[0]) { return; } var $element = $this.data('element'); $element.select2('close'); }); }); }; BaseSelection.prototype._detachCloseHandler = function (container) { $(document.body).off('mousedown.select2.' + container.id); }; BaseSelection.prototype.position = function ($selection, $container) { var $selectionContainer = $container.find('.selection'); $selectionContainer.append($selection); }; BaseSelection.prototype.destroy = function () { this._detachCloseHandler(this.container); }; BaseSelection.prototype.update = function (data) { throw new Error('The `update` method must be defined in child classes.'); }; return BaseSelection; }); S2.define('select2/selection/single',[ 'jquery', './base', '../utils', '../keys' ], function ($, BaseSelection, Utils, KEYS) { function SingleSelection () { SingleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(SingleSelection, BaseSelection); SingleSelection.prototype.render = function () { var $selection = SingleSelection.__super__.render.call(this); $selection.addClass('select2-selection--single'); $selection.html( '' + '' + '' + '' ); return $selection; }; SingleSelection.prototype.bind = function (container, $container) { var self = this; SingleSelection.__super__.bind.apply(this, arguments); var id = container.id + '-container'; this.$selection.find('.select2-selection__rendered').attr('id', id); this.$selection.attr('aria-labelledby', id); this.$selection.on('mousedown', function (evt) { // Only respond to left clicks if (evt.which !== 1) { return; } self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on('focus', function (evt) { // User focuses on the container }); this.$selection.on('blur', function (evt) { // User exits the container }); container.on('focus', function (evt) { if (!container.isOpen()) { self.$selection.focus(); } }); container.on('selection:update', function (params) { self.update(params.data); }); }; SingleSelection.prototype.clear = function () { this.$selection.find('.select2-selection__rendered').empty(); }; SingleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; SingleSelection.prototype.selectionContainer = function () { return $(''); }; SingleSelection.prototype.update = function (data) { if (data.length === 0) { this.clear(); return; } var selection = data[0]; var $rendered = this.$selection.find('.select2-selection__rendered'); var formatted = this.display(selection, $rendered); $rendered.empty().append(formatted); $rendered.prop('title', selection.title || selection.text); }; return SingleSelection; }); S2.define('select2/selection/multiple',[ 'jquery', './base', '../utils' ], function ($, BaseSelection, Utils) { function MultipleSelection ($element, options) { MultipleSelection.__super__.constructor.apply(this, arguments); } Utils.Extend(MultipleSelection, BaseSelection); MultipleSelection.prototype.render = function () { var $selection = MultipleSelection.__super__.render.call(this); $selection.addClass('select2-selection--multiple'); $selection.html( '' ); return $selection; }; MultipleSelection.prototype.bind = function (container, $container) { var self = this; MultipleSelection.__super__.bind.apply(this, arguments); this.$selection.on('click', function (evt) { self.trigger('toggle', { originalEvent: evt }); }); this.$selection.on( 'click', '.select2-selection__choice__remove', function (evt) { // Ignore the event if it is disabled if (self.options.get('disabled')) { return; } var $remove = $(this); var $selection = $remove.parent(); var data = $selection.data('data'); self.trigger('unselect', { originalEvent: evt, data: data }); } ); }; MultipleSelection.prototype.clear = function () { this.$selection.find('.select2-selection__rendered').empty(); }; MultipleSelection.prototype.display = function (data, container) { var template = this.options.get('templateSelection'); var escapeMarkup = this.options.get('escapeMarkup'); return escapeMarkup(template(data, container)); }; MultipleSelection.prototype.selectionContainer = function () { var $container = $( '
  • ' + '' + '×' + '' + '
  • ' ); return $container; }; MultipleSelection.prototype.update = function (data) { this.clear(); if (data.length === 0) { return; } var $selections = []; for (var d = 0; d < data.length; d++) { var selection = data[d]; var $selection = this.selectionContainer(); var formatted = this.display(selection, $selection); $selection.append(formatted); $selection.prop('title', selection.title || selection.text); $selection.data('data', selection); $selections.push($selection); } var $rendered = this.$selection.find('.select2-selection__rendered'); Utils.appendMany($rendered, $selections); }; return MultipleSelection; }); S2.define('select2/selection/placeholder',[ '../utils' ], function (Utils) { function Placeholder (decorated, $element, options) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options); } Placeholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; Placeholder.prototype.createPlaceholder = function (decorated, placeholder) { var $placeholder = this.selectionContainer(); $placeholder.html(this.display(placeholder)); $placeholder.addClass('select2-selection__placeholder') .removeClass('select2-selection__choice'); return $placeholder; }; Placeholder.prototype.update = function (decorated, data) { var singlePlaceholder = ( data.length == 1 && data[0].id != this.placeholder.id ); var multipleSelections = data.length > 1; if (multipleSelections || singlePlaceholder) { return decorated.call(this, data); } this.clear(); var $placeholder = this.createPlaceholder(this.placeholder); this.$selection.find('.select2-selection__rendered').append($placeholder); }; return Placeholder; }); S2.define('select2/selection/allowClear',[ 'jquery', '../keys' ], function ($, KEYS) { function AllowClear () { } AllowClear.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); if (this.placeholder == null) { if (this.options.get('debug') && window.console && console.error) { console.error( 'Select2: The `allowClear` option should be used in combination ' + 'with the `placeholder` option.' ); } } this.$selection.on('mousedown', '.select2-selection__clear', function (evt) { self._handleClear(evt); }); container.on('keypress', function (evt) { self._handleKeyboardClear(evt, container); }); }; AllowClear.prototype._handleClear = function (_, evt) { // Ignore the event if it is disabled if (this.options.get('disabled')) { return; } var $clear = this.$selection.find('.select2-selection__clear'); // Ignore the event if nothing has been selected if ($clear.length === 0) { return; } evt.stopPropagation(); var data = $clear.data('data'); for (var d = 0; d < data.length; d++) { var unselectData = { data: data[d] }; // Trigger the `unselect` event, so people can prevent it from being // cleared. this.trigger('unselect', unselectData); // If the event was prevented, don't clear it out. if (unselectData.prevented) { return; } } this.$element.val(this.placeholder.id).trigger('change'); this.trigger('toggle', {}); }; AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { if (container.isOpen()) { return; } if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) { this._handleClear(evt); } }; AllowClear.prototype.update = function (decorated, data) { decorated.call(this, data); if (this.$selection.find('.select2-selection__placeholder').length > 0 || data.length === 0) { return; } var $remove = $( '' + '×' + '' ); $remove.data('data', data); this.$selection.find('.select2-selection__rendered').prepend($remove); }; return AllowClear; }); S2.define('select2/selection/search',[ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function Search (decorated, $element, options) { decorated.call(this, $element, options); } Search.prototype.render = function (decorated) { var $search = $( '' ); this.$searchContainer = $search; this.$search = $search.find('input'); var $rendered = decorated.call(this); this._transferTabIndex(); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('open', function () { self.$search.trigger('focus'); }); container.on('close', function () { self.$search.val(''); self.$search.removeAttr('aria-activedescendant'); self.$search.trigger('focus'); }); container.on('enable', function () { self.$search.prop('disabled', false); self._transferTabIndex(); }); container.on('disable', function () { self.$search.prop('disabled', true); }); container.on('focus', function (evt) { self.$search.trigger('focus'); }); container.on('results:focus', function (params) { self.$search.attr('aria-activedescendant', params.id); }); this.$selection.on('focusin', '.select2-search--inline', function (evt) { self.trigger('focus', evt); }); this.$selection.on('focusout', '.select2-search--inline', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', '.select2-search--inline', function (evt) { evt.stopPropagation(); self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); var key = evt.which; if (key === KEYS.BACKSPACE && self.$search.val() === '') { var $previousChoice = self.$searchContainer .prev('.select2-selection__choice'); if ($previousChoice.length > 0) { var item = $previousChoice.data('data'); self.searchRemoveChoice(item); evt.preventDefault(); } } }); // Try to detect the IE version should the `documentMode` property that // is stored on the document. This is only implemented in IE and is // slightly cleaner than doing a user agent check. // This property is not available in Edge, but Edge also doesn't have // this bug. var msie = document.documentMode; var disableInputEvents = msie && msie <= 11; // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$selection.on( 'input.searchcheck', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents) { self.$selection.off('input.search input.searchcheck'); return; } // Unbind the duplicated `keyup` event self.$selection.off('keyup.search'); } ); this.$selection.on( 'keyup.search input.search', '.select2-search--inline', function (evt) { // IE will trigger the `input` event when a placeholder is used on a // search box. To get around this issue, we are forced to ignore all // `input` events in IE and keep using `keyup`. if (disableInputEvents && evt.type === 'input') { self.$selection.off('input.search input.searchcheck'); return; } var key = evt.which; // We can freely ignore events from modifier keys if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { return; } // Tabbing will be handled during the `keydown` phase if (key == KEYS.TAB) { return; } self.handleSearch(evt); } ); }; /** * This method will transfer the tabindex attribute from the rendered * selection to the search box. This allows for the search box to be used as * the primary focus instead of the selection container. * * @private */ Search.prototype._transferTabIndex = function (decorated) { this.$search.attr('tabindex', this.$selection.attr('tabindex')); this.$selection.attr('tabindex', '-1'); }; Search.prototype.createPlaceholder = function (decorated, placeholder) { this.$search.attr('placeholder', placeholder.text); }; Search.prototype.update = function (decorated, data) { var searchHadFocus = this.$search[0] == document.activeElement; this.$search.attr('placeholder', ''); decorated.call(this, data); this.$selection.find('.select2-selection__rendered') .append(this.$searchContainer); this.resizeSearch(); if (searchHadFocus) { this.$search.focus(); } }; Search.prototype.handleSearch = function () { this.resizeSearch(); if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.searchRemoveChoice = function (decorated, item) { this.trigger('unselect', { data: item }); this.$search.val(item.text); this.handleSearch(); }; Search.prototype.resizeSearch = function () { this.$search.css('width', '25px'); var width = ''; if (this.$search.attr('placeholder') !== '') { width = this.$selection.find('.select2-selection__rendered').innerWidth(); } else { var minimumWidth = this.$search.val().length + 1; width = (minimumWidth * 0.75) + 'em'; } this.$search.css('width', width); }; return Search; }); S2.define('select2/selection/eventRelay',[ 'jquery' ], function ($) { function EventRelay () { } EventRelay.prototype.bind = function (decorated, container, $container) { var self = this; var relayEvents = [ 'open', 'opening', 'close', 'closing', 'select', 'selecting', 'unselect', 'unselecting' ]; var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting']; decorated.call(this, container, $container); container.on('*', function (name, params) { // Ignore events that should not be relayed if ($.inArray(name, relayEvents) === -1) { return; } // The parameters should always be an object params = params || {}; // Generate the jQuery event for the Select2 event var evt = $.Event('select2:' + name, { params: params }); self.$element.trigger(evt); // Only handle preventable events if it was one if ($.inArray(name, preventableEvents) === -1) { return; } params.prevented = evt.isDefaultPrevented(); }); }; return EventRelay; }); S2.define('select2/translation',[ 'jquery', 'require' ], function ($, require) { function Translation (dict) { this.dict = dict || {}; } Translation.prototype.all = function () { return this.dict; }; Translation.prototype.get = function (key) { return this.dict[key]; }; Translation.prototype.extend = function (translation) { this.dict = $.extend({}, translation.all(), this.dict); }; // Static functions Translation._cache = {}; Translation.loadPath = function (path) { if (!(path in Translation._cache)) { var translations = require(path); Translation._cache[path] = translations; } return new Translation(Translation._cache[path]); }; return Translation; }); S2.define('select2/diacritics',[ ], function () { var diacritics = { '\u24B6': 'A', '\uFF21': 'A', '\u00C0': 'A', '\u00C1': 'A', '\u00C2': 'A', '\u1EA6': 'A', '\u1EA4': 'A', '\u1EAA': 'A', '\u1EA8': 'A', '\u00C3': 'A', '\u0100': 'A', '\u0102': 'A', '\u1EB0': 'A', '\u1EAE': 'A', '\u1EB4': 'A', '\u1EB2': 'A', '\u0226': 'A', '\u01E0': 'A', '\u00C4': 'A', '\u01DE': 'A', '\u1EA2': 'A', '\u00C5': 'A', '\u01FA': 'A', '\u01CD': 'A', '\u0200': 'A', '\u0202': 'A', '\u1EA0': 'A', '\u1EAC': 'A', '\u1EB6': 'A', '\u1E00': 'A', '\u0104': 'A', '\u023A': 'A', '\u2C6F': 'A', '\uA732': 'AA', '\u00C6': 'AE', '\u01FC': 'AE', '\u01E2': 'AE', '\uA734': 'AO', '\uA736': 'AU', '\uA738': 'AV', '\uA73A': 'AV', '\uA73C': 'AY', '\u24B7': 'B', '\uFF22': 'B', '\u1E02': 'B', '\u1E04': 'B', '\u1E06': 'B', '\u0243': 'B', '\u0182': 'B', '\u0181': 'B', '\u24B8': 'C', '\uFF23': 'C', '\u0106': 'C', '\u0108': 'C', '\u010A': 'C', '\u010C': 'C', '\u00C7': 'C', '\u1E08': 'C', '\u0187': 'C', '\u023B': 'C', '\uA73E': 'C', '\u24B9': 'D', '\uFF24': 'D', '\u1E0A': 'D', '\u010E': 'D', '\u1E0C': 'D', '\u1E10': 'D', '\u1E12': 'D', '\u1E0E': 'D', '\u0110': 'D', '\u018B': 'D', '\u018A': 'D', '\u0189': 'D', '\uA779': 'D', '\u01F1': 'DZ', '\u01C4': 'DZ', '\u01F2': 'Dz', '\u01C5': 'Dz', '\u24BA': 'E', '\uFF25': 'E', '\u00C8': 'E', '\u00C9': 'E', '\u00CA': 'E', '\u1EC0': 'E', '\u1EBE': 'E', '\u1EC4': 'E', '\u1EC2': 'E', '\u1EBC': 'E', '\u0112': 'E', '\u1E14': 'E', '\u1E16': 'E', '\u0114': 'E', '\u0116': 'E', '\u00CB': 'E', '\u1EBA': 'E', '\u011A': 'E', '\u0204': 'E', '\u0206': 'E', '\u1EB8': 'E', '\u1EC6': 'E', '\u0228': 'E', '\u1E1C': 'E', '\u0118': 'E', '\u1E18': 'E', '\u1E1A': 'E', '\u0190': 'E', '\u018E': 'E', '\u24BB': 'F', '\uFF26': 'F', '\u1E1E': 'F', '\u0191': 'F', '\uA77B': 'F', '\u24BC': 'G', '\uFF27': 'G', '\u01F4': 'G', '\u011C': 'G', '\u1E20': 'G', '\u011E': 'G', '\u0120': 'G', '\u01E6': 'G', '\u0122': 'G', '\u01E4': 'G', '\u0193': 'G', '\uA7A0': 'G', '\uA77D': 'G', '\uA77E': 'G', '\u24BD': 'H', '\uFF28': 'H', '\u0124': 'H', '\u1E22': 'H', '\u1E26': 'H', '\u021E': 'H', '\u1E24': 'H', '\u1E28': 'H', '\u1E2A': 'H', '\u0126': 'H', '\u2C67': 'H', '\u2C75': 'H', '\uA78D': 'H', '\u24BE': 'I', '\uFF29': 'I', '\u00CC': 'I', '\u00CD': 'I', '\u00CE': 'I', '\u0128': 'I', '\u012A': 'I', '\u012C': 'I', '\u0130': 'I', '\u00CF': 'I', '\u1E2E': 'I', '\u1EC8': 'I', '\u01CF': 'I', '\u0208': 'I', '\u020A': 'I', '\u1ECA': 'I', '\u012E': 'I', '\u1E2C': 'I', '\u0197': 'I', '\u24BF': 'J', '\uFF2A': 'J', '\u0134': 'J', '\u0248': 'J', '\u24C0': 'K', '\uFF2B': 'K', '\u1E30': 'K', '\u01E8': 'K', '\u1E32': 'K', '\u0136': 'K', '\u1E34': 'K', '\u0198': 'K', '\u2C69': 'K', '\uA740': 'K', '\uA742': 'K', '\uA744': 'K', '\uA7A2': 'K', '\u24C1': 'L', '\uFF2C': 'L', '\u013F': 'L', '\u0139': 'L', '\u013D': 'L', '\u1E36': 'L', '\u1E38': 'L', '\u013B': 'L', '\u1E3C': 'L', '\u1E3A': 'L', '\u0141': 'L', '\u023D': 'L', '\u2C62': 'L', '\u2C60': 'L', '\uA748': 'L', '\uA746': 'L', '\uA780': 'L', '\u01C7': 'LJ', '\u01C8': 'Lj', '\u24C2': 'M', '\uFF2D': 'M', '\u1E3E': 'M', '\u1E40': 'M', '\u1E42': 'M', '\u2C6E': 'M', '\u019C': 'M', '\u24C3': 'N', '\uFF2E': 'N', '\u01F8': 'N', '\u0143': 'N', '\u00D1': 'N', '\u1E44': 'N', '\u0147': 'N', '\u1E46': 'N', '\u0145': 'N', '\u1E4A': 'N', '\u1E48': 'N', '\u0220': 'N', '\u019D': 'N', '\uA790': 'N', '\uA7A4': 'N', '\u01CA': 'NJ', '\u01CB': 'Nj', '\u24C4': 'O', '\uFF2F': 'O', '\u00D2': 'O', '\u00D3': 'O', '\u00D4': 'O', '\u1ED2': 'O', '\u1ED0': 'O', '\u1ED6': 'O', '\u1ED4': 'O', '\u00D5': 'O', '\u1E4C': 'O', '\u022C': 'O', '\u1E4E': 'O', '\u014C': 'O', '\u1E50': 'O', '\u1E52': 'O', '\u014E': 'O', '\u022E': 'O', '\u0230': 'O', '\u00D6': 'O', '\u022A': 'O', '\u1ECE': 'O', '\u0150': 'O', '\u01D1': 'O', '\u020C': 'O', '\u020E': 'O', '\u01A0': 'O', '\u1EDC': 'O', '\u1EDA': 'O', '\u1EE0': 'O', '\u1EDE': 'O', '\u1EE2': 'O', '\u1ECC': 'O', '\u1ED8': 'O', '\u01EA': 'O', '\u01EC': 'O', '\u00D8': 'O', '\u01FE': 'O', '\u0186': 'O', '\u019F': 'O', '\uA74A': 'O', '\uA74C': 'O', '\u01A2': 'OI', '\uA74E': 'OO', '\u0222': 'OU', '\u24C5': 'P', '\uFF30': 'P', '\u1E54': 'P', '\u1E56': 'P', '\u01A4': 'P', '\u2C63': 'P', '\uA750': 'P', '\uA752': 'P', '\uA754': 'P', '\u24C6': 'Q', '\uFF31': 'Q', '\uA756': 'Q', '\uA758': 'Q', '\u024A': 'Q', '\u24C7': 'R', '\uFF32': 'R', '\u0154': 'R', '\u1E58': 'R', '\u0158': 'R', '\u0210': 'R', '\u0212': 'R', '\u1E5A': 'R', '\u1E5C': 'R', '\u0156': 'R', '\u1E5E': 'R', '\u024C': 'R', '\u2C64': 'R', '\uA75A': 'R', '\uA7A6': 'R', '\uA782': 'R', '\u24C8': 'S', '\uFF33': 'S', '\u1E9E': 'S', '\u015A': 'S', '\u1E64': 'S', '\u015C': 'S', '\u1E60': 'S', '\u0160': 'S', '\u1E66': 'S', '\u1E62': 'S', '\u1E68': 'S', '\u0218': 'S', '\u015E': 'S', '\u2C7E': 'S', '\uA7A8': 'S', '\uA784': 'S', '\u24C9': 'T', '\uFF34': 'T', '\u1E6A': 'T', '\u0164': 'T', '\u1E6C': 'T', '\u021A': 'T', '\u0162': 'T', '\u1E70': 'T', '\u1E6E': 'T', '\u0166': 'T', '\u01AC': 'T', '\u01AE': 'T', '\u023E': 'T', '\uA786': 'T', '\uA728': 'TZ', '\u24CA': 'U', '\uFF35': 'U', '\u00D9': 'U', '\u00DA': 'U', '\u00DB': 'U', '\u0168': 'U', '\u1E78': 'U', '\u016A': 'U', '\u1E7A': 'U', '\u016C': 'U', '\u00DC': 'U', '\u01DB': 'U', '\u01D7': 'U', '\u01D5': 'U', '\u01D9': 'U', '\u1EE6': 'U', '\u016E': 'U', '\u0170': 'U', '\u01D3': 'U', '\u0214': 'U', '\u0216': 'U', '\u01AF': 'U', '\u1EEA': 'U', '\u1EE8': 'U', '\u1EEE': 'U', '\u1EEC': 'U', '\u1EF0': 'U', '\u1EE4': 'U', '\u1E72': 'U', '\u0172': 'U', '\u1E76': 'U', '\u1E74': 'U', '\u0244': 'U', '\u24CB': 'V', '\uFF36': 'V', '\u1E7C': 'V', '\u1E7E': 'V', '\u01B2': 'V', '\uA75E': 'V', '\u0245': 'V', '\uA760': 'VY', '\u24CC': 'W', '\uFF37': 'W', '\u1E80': 'W', '\u1E82': 'W', '\u0174': 'W', '\u1E86': 'W', '\u1E84': 'W', '\u1E88': 'W', '\u2C72': 'W', '\u24CD': 'X', '\uFF38': 'X', '\u1E8A': 'X', '\u1E8C': 'X', '\u24CE': 'Y', '\uFF39': 'Y', '\u1EF2': 'Y', '\u00DD': 'Y', '\u0176': 'Y', '\u1EF8': 'Y', '\u0232': 'Y', '\u1E8E': 'Y', '\u0178': 'Y', '\u1EF6': 'Y', '\u1EF4': 'Y', '\u01B3': 'Y', '\u024E': 'Y', '\u1EFE': 'Y', '\u24CF': 'Z', '\uFF3A': 'Z', '\u0179': 'Z', '\u1E90': 'Z', '\u017B': 'Z', '\u017D': 'Z', '\u1E92': 'Z', '\u1E94': 'Z', '\u01B5': 'Z', '\u0224': 'Z', '\u2C7F': 'Z', '\u2C6B': 'Z', '\uA762': 'Z', '\u24D0': 'a', '\uFF41': 'a', '\u1E9A': 'a', '\u00E0': 'a', '\u00E1': 'a', '\u00E2': 'a', '\u1EA7': 'a', '\u1EA5': 'a', '\u1EAB': 'a', '\u1EA9': 'a', '\u00E3': 'a', '\u0101': 'a', '\u0103': 'a', '\u1EB1': 'a', '\u1EAF': 'a', '\u1EB5': 'a', '\u1EB3': 'a', '\u0227': 'a', '\u01E1': 'a', '\u00E4': 'a', '\u01DF': 'a', '\u1EA3': 'a', '\u00E5': 'a', '\u01FB': 'a', '\u01CE': 'a', '\u0201': 'a', '\u0203': 'a', '\u1EA1': 'a', '\u1EAD': 'a', '\u1EB7': 'a', '\u1E01': 'a', '\u0105': 'a', '\u2C65': 'a', '\u0250': 'a', '\uA733': 'aa', '\u00E6': 'ae', '\u01FD': 'ae', '\u01E3': 'ae', '\uA735': 'ao', '\uA737': 'au', '\uA739': 'av', '\uA73B': 'av', '\uA73D': 'ay', '\u24D1': 'b', '\uFF42': 'b', '\u1E03': 'b', '\u1E05': 'b', '\u1E07': 'b', '\u0180': 'b', '\u0183': 'b', '\u0253': 'b', '\u24D2': 'c', '\uFF43': 'c', '\u0107': 'c', '\u0109': 'c', '\u010B': 'c', '\u010D': 'c', '\u00E7': 'c', '\u1E09': 'c', '\u0188': 'c', '\u023C': 'c', '\uA73F': 'c', '\u2184': 'c', '\u24D3': 'd', '\uFF44': 'd', '\u1E0B': 'd', '\u010F': 'd', '\u1E0D': 'd', '\u1E11': 'd', '\u1E13': 'd', '\u1E0F': 'd', '\u0111': 'd', '\u018C': 'd', '\u0256': 'd', '\u0257': 'd', '\uA77A': 'd', '\u01F3': 'dz', '\u01C6': 'dz', '\u24D4': 'e', '\uFF45': 'e', '\u00E8': 'e', '\u00E9': 'e', '\u00EA': 'e', '\u1EC1': 'e', '\u1EBF': 'e', '\u1EC5': 'e', '\u1EC3': 'e', '\u1EBD': 'e', '\u0113': 'e', '\u1E15': 'e', '\u1E17': 'e', '\u0115': 'e', '\u0117': 'e', '\u00EB': 'e', '\u1EBB': 'e', '\u011B': 'e', '\u0205': 'e', '\u0207': 'e', '\u1EB9': 'e', '\u1EC7': 'e', '\u0229': 'e', '\u1E1D': 'e', '\u0119': 'e', '\u1E19': 'e', '\u1E1B': 'e', '\u0247': 'e', '\u025B': 'e', '\u01DD': 'e', '\u24D5': 'f', '\uFF46': 'f', '\u1E1F': 'f', '\u0192': 'f', '\uA77C': 'f', '\u24D6': 'g', '\uFF47': 'g', '\u01F5': 'g', '\u011D': 'g', '\u1E21': 'g', '\u011F': 'g', '\u0121': 'g', '\u01E7': 'g', '\u0123': 'g', '\u01E5': 'g', '\u0260': 'g', '\uA7A1': 'g', '\u1D79': 'g', '\uA77F': 'g', '\u24D7': 'h', '\uFF48': 'h', '\u0125': 'h', '\u1E23': 'h', '\u1E27': 'h', '\u021F': 'h', '\u1E25': 'h', '\u1E29': 'h', '\u1E2B': 'h', '\u1E96': 'h', '\u0127': 'h', '\u2C68': 'h', '\u2C76': 'h', '\u0265': 'h', '\u0195': 'hv', '\u24D8': 'i', '\uFF49': 'i', '\u00EC': 'i', '\u00ED': 'i', '\u00EE': 'i', '\u0129': 'i', '\u012B': 'i', '\u012D': 'i', '\u00EF': 'i', '\u1E2F': 'i', '\u1EC9': 'i', '\u01D0': 'i', '\u0209': 'i', '\u020B': 'i', '\u1ECB': 'i', '\u012F': 'i', '\u1E2D': 'i', '\u0268': 'i', '\u0131': 'i', '\u24D9': 'j', '\uFF4A': 'j', '\u0135': 'j', '\u01F0': 'j', '\u0249': 'j', '\u24DA': 'k', '\uFF4B': 'k', '\u1E31': 'k', '\u01E9': 'k', '\u1E33': 'k', '\u0137': 'k', '\u1E35': 'k', '\u0199': 'k', '\u2C6A': 'k', '\uA741': 'k', '\uA743': 'k', '\uA745': 'k', '\uA7A3': 'k', '\u24DB': 'l', '\uFF4C': 'l', '\u0140': 'l', '\u013A': 'l', '\u013E': 'l', '\u1E37': 'l', '\u1E39': 'l', '\u013C': 'l', '\u1E3D': 'l', '\u1E3B': 'l', '\u017F': 'l', '\u0142': 'l', '\u019A': 'l', '\u026B': 'l', '\u2C61': 'l', '\uA749': 'l', '\uA781': 'l', '\uA747': 'l', '\u01C9': 'lj', '\u24DC': 'm', '\uFF4D': 'm', '\u1E3F': 'm', '\u1E41': 'm', '\u1E43': 'm', '\u0271': 'm', '\u026F': 'm', '\u24DD': 'n', '\uFF4E': 'n', '\u01F9': 'n', '\u0144': 'n', '\u00F1': 'n', '\u1E45': 'n', '\u0148': 'n', '\u1E47': 'n', '\u0146': 'n', '\u1E4B': 'n', '\u1E49': 'n', '\u019E': 'n', '\u0272': 'n', '\u0149': 'n', '\uA791': 'n', '\uA7A5': 'n', '\u01CC': 'nj', '\u24DE': 'o', '\uFF4F': 'o', '\u00F2': 'o', '\u00F3': 'o', '\u00F4': 'o', '\u1ED3': 'o', '\u1ED1': 'o', '\u1ED7': 'o', '\u1ED5': 'o', '\u00F5': 'o', '\u1E4D': 'o', '\u022D': 'o', '\u1E4F': 'o', '\u014D': 'o', '\u1E51': 'o', '\u1E53': 'o', '\u014F': 'o', '\u022F': 'o', '\u0231': 'o', '\u00F6': 'o', '\u022B': 'o', '\u1ECF': 'o', '\u0151': 'o', '\u01D2': 'o', '\u020D': 'o', '\u020F': 'o', '\u01A1': 'o', '\u1EDD': 'o', '\u1EDB': 'o', '\u1EE1': 'o', '\u1EDF': 'o', '\u1EE3': 'o', '\u1ECD': 'o', '\u1ED9': 'o', '\u01EB': 'o', '\u01ED': 'o', '\u00F8': 'o', '\u01FF': 'o', '\u0254': 'o', '\uA74B': 'o', '\uA74D': 'o', '\u0275': 'o', '\u01A3': 'oi', '\u0223': 'ou', '\uA74F': 'oo', '\u24DF': 'p', '\uFF50': 'p', '\u1E55': 'p', '\u1E57': 'p', '\u01A5': 'p', '\u1D7D': 'p', '\uA751': 'p', '\uA753': 'p', '\uA755': 'p', '\u24E0': 'q', '\uFF51': 'q', '\u024B': 'q', '\uA757': 'q', '\uA759': 'q', '\u24E1': 'r', '\uFF52': 'r', '\u0155': 'r', '\u1E59': 'r', '\u0159': 'r', '\u0211': 'r', '\u0213': 'r', '\u1E5B': 'r', '\u1E5D': 'r', '\u0157': 'r', '\u1E5F': 'r', '\u024D': 'r', '\u027D': 'r', '\uA75B': 'r', '\uA7A7': 'r', '\uA783': 'r', '\u24E2': 's', '\uFF53': 's', '\u00DF': 's', '\u015B': 's', '\u1E65': 's', '\u015D': 's', '\u1E61': 's', '\u0161': 's', '\u1E67': 's', '\u1E63': 's', '\u1E69': 's', '\u0219': 's', '\u015F': 's', '\u023F': 's', '\uA7A9': 's', '\uA785': 's', '\u1E9B': 's', '\u24E3': 't', '\uFF54': 't', '\u1E6B': 't', '\u1E97': 't', '\u0165': 't', '\u1E6D': 't', '\u021B': 't', '\u0163': 't', '\u1E71': 't', '\u1E6F': 't', '\u0167': 't', '\u01AD': 't', '\u0288': 't', '\u2C66': 't', '\uA787': 't', '\uA729': 'tz', '\u24E4': 'u', '\uFF55': 'u', '\u00F9': 'u', '\u00FA': 'u', '\u00FB': 'u', '\u0169': 'u', '\u1E79': 'u', '\u016B': 'u', '\u1E7B': 'u', '\u016D': 'u', '\u00FC': 'u', '\u01DC': 'u', '\u01D8': 'u', '\u01D6': 'u', '\u01DA': 'u', '\u1EE7': 'u', '\u016F': 'u', '\u0171': 'u', '\u01D4': 'u', '\u0215': 'u', '\u0217': 'u', '\u01B0': 'u', '\u1EEB': 'u', '\u1EE9': 'u', '\u1EEF': 'u', '\u1EED': 'u', '\u1EF1': 'u', '\u1EE5': 'u', '\u1E73': 'u', '\u0173': 'u', '\u1E77': 'u', '\u1E75': 'u', '\u0289': 'u', '\u24E5': 'v', '\uFF56': 'v', '\u1E7D': 'v', '\u1E7F': 'v', '\u028B': 'v', '\uA75F': 'v', '\u028C': 'v', '\uA761': 'vy', '\u24E6': 'w', '\uFF57': 'w', '\u1E81': 'w', '\u1E83': 'w', '\u0175': 'w', '\u1E87': 'w', '\u1E85': 'w', '\u1E98': 'w', '\u1E89': 'w', '\u2C73': 'w', '\u24E7': 'x', '\uFF58': 'x', '\u1E8B': 'x', '\u1E8D': 'x', '\u24E8': 'y', '\uFF59': 'y', '\u1EF3': 'y', '\u00FD': 'y', '\u0177': 'y', '\u1EF9': 'y', '\u0233': 'y', '\u1E8F': 'y', '\u00FF': 'y', '\u1EF7': 'y', '\u1E99': 'y', '\u1EF5': 'y', '\u01B4': 'y', '\u024F': 'y', '\u1EFF': 'y', '\u24E9': 'z', '\uFF5A': 'z', '\u017A': 'z', '\u1E91': 'z', '\u017C': 'z', '\u017E': 'z', '\u1E93': 'z', '\u1E95': 'z', '\u01B6': 'z', '\u0225': 'z', '\u0240': 'z', '\u2C6C': 'z', '\uA763': 'z', '\u0386': '\u0391', '\u0388': '\u0395', '\u0389': '\u0397', '\u038A': '\u0399', '\u03AA': '\u0399', '\u038C': '\u039F', '\u038E': '\u03A5', '\u03AB': '\u03A5', '\u038F': '\u03A9', '\u03AC': '\u03B1', '\u03AD': '\u03B5', '\u03AE': '\u03B7', '\u03AF': '\u03B9', '\u03CA': '\u03B9', '\u0390': '\u03B9', '\u03CC': '\u03BF', '\u03CD': '\u03C5', '\u03CB': '\u03C5', '\u03B0': '\u03C5', '\u03C9': '\u03C9', '\u03C2': '\u03C3' }; return diacritics; }); S2.define('select2/data/base',[ '../utils' ], function (Utils) { function BaseAdapter ($element, options) { BaseAdapter.__super__.constructor.call(this); } Utils.Extend(BaseAdapter, Utils.Observable); BaseAdapter.prototype.current = function (callback) { throw new Error('The `current` method must be defined in child classes.'); }; BaseAdapter.prototype.query = function (params, callback) { throw new Error('The `query` method must be defined in child classes.'); }; BaseAdapter.prototype.bind = function (container, $container) { // Can be implemented in subclasses }; BaseAdapter.prototype.destroy = function () { // Can be implemented in subclasses }; BaseAdapter.prototype.generateResultId = function (container, data) { var id = container.id + '-result-'; id += Utils.generateChars(4); if (data.id != null) { id += '-' + data.id.toString(); } else { id += '-' + Utils.generateChars(4); } return id; }; return BaseAdapter; }); S2.define('select2/data/select',[ './base', '../utils', 'jquery' ], function (BaseAdapter, Utils, $) { function SelectAdapter ($element, options) { this.$element = $element; this.options = options; SelectAdapter.__super__.constructor.call(this); } Utils.Extend(SelectAdapter, BaseAdapter); SelectAdapter.prototype.current = function (callback) { var data = []; var self = this; this.$element.find(':selected').each(function () { var $option = $(this); var option = self.item($option); data.push(option); }); callback(data); }; SelectAdapter.prototype.select = function (data) { var self = this; data.selected = true; // If data.element is a DOM node, use it instead if ($(data.element).is('option')) { data.element.selected = true; this.$element.trigger('change'); return; } if (this.$element.prop('multiple')) { this.current(function (currentData) { var val = []; data = [data]; data.push.apply(data, currentData); for (var d = 0; d < data.length; d++) { var id = data[d].id; if ($.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); } else { var val = data.id; this.$element.val(val); this.$element.trigger('change'); } }; SelectAdapter.prototype.unselect = function (data) { var self = this; if (!this.$element.prop('multiple')) { return; } data.selected = false; if ($(data.element).is('option')) { data.element.selected = false; this.$element.trigger('change'); return; } this.current(function (currentData) { var val = []; for (var d = 0; d < currentData.length; d++) { var id = currentData[d].id; if (id !== data.id && $.inArray(id, val) === -1) { val.push(id); } } self.$element.val(val); self.$element.trigger('change'); }); }; SelectAdapter.prototype.bind = function (container, $container) { var self = this; this.container = container; container.on('select', function (params) { self.select(params.data); }); container.on('unselect', function (params) { self.unselect(params.data); }); }; SelectAdapter.prototype.destroy = function () { // Remove anything added to child elements this.$element.find('*').each(function () { // Remove any custom data set by Select2 $.removeData(this, 'data'); }); }; SelectAdapter.prototype.query = function (params, callback) { var data = []; var self = this; var $options = this.$element.children(); $options.each(function () { var $option = $(this); if (!$option.is('option') && !$option.is('optgroup')) { return; } var option = self.item($option); var matches = self.matches(params, option); if (matches !== null) { data.push(matches); } }); callback({ results: data }); }; SelectAdapter.prototype.addOptions = function ($options) { Utils.appendMany(this.$element, $options); }; SelectAdapter.prototype.option = function (data) { var option; if (data.children) { option = document.createElement('optgroup'); option.label = data.text; } else { option = document.createElement('option'); if (option.textContent !== undefined) { option.textContent = data.text; } else { option.innerText = data.text; } } if (data.id) { option.value = data.id; } if (data.disabled) { option.disabled = true; } if (data.selected) { option.selected = true; } if (data.title) { option.title = data.title; } var $option = $(option); var normalizedData = this._normalizeItem(data); normalizedData.element = option; // Override the option's data with the combined data $.data(option, 'data', normalizedData); return $option; }; SelectAdapter.prototype.item = function ($option) { var data = {}; data = $.data($option[0], 'data'); if (data != null) { return data; } if ($option.is('option')) { data = { id: $option.val(), text: $option.text(), disabled: $option.prop('disabled'), selected: $option.prop('selected'), title: $option.prop('title') }; } else if ($option.is('optgroup')) { data = { text: $option.prop('label'), children: [], title: $option.prop('title') }; var $children = $option.children('option'); var children = []; for (var c = 0; c < $children.length; c++) { var $child = $($children[c]); var child = this.item($child); children.push(child); } data.children = children; } data = this._normalizeItem(data); data.element = $option[0]; $.data($option[0], 'data', data); return data; }; SelectAdapter.prototype._normalizeItem = function (item) { if (!$.isPlainObject(item)) { item = { id: item, text: item }; } item = $.extend({}, { text: '' }, item); var defaults = { selected: false, disabled: false }; if (item.id != null) { item.id = item.id.toString(); } if (item.text != null) { item.text = item.text.toString(); } if (item._resultId == null && item.id && this.container != null) { item._resultId = this.generateResultId(this.container, item); } return $.extend({}, defaults, item); }; SelectAdapter.prototype.matches = function (params, data) { var matcher = this.options.get('matcher'); return matcher(params, data); }; return SelectAdapter; }); S2.define('select2/data/array',[ './select', '../utils', 'jquery' ], function (SelectAdapter, Utils, $) { function ArrayAdapter ($element, options) { var data = options.get('data') || []; ArrayAdapter.__super__.constructor.call(this, $element, options); this.addOptions(this.convertToOptions(data)); } Utils.Extend(ArrayAdapter, SelectAdapter); ArrayAdapter.prototype.select = function (data) { var $option = this.$element.find('option').filter(function (i, elm) { return elm.value == data.id.toString(); }); if ($option.length === 0) { $option = this.option(data); this.addOptions($option); } ArrayAdapter.__super__.select.call(this, data); }; ArrayAdapter.prototype.convertToOptions = function (data) { var self = this; var $existing = this.$element.find('option'); var existingIds = $existing.map(function () { return self.item($(this)).id; }).get(); var $options = []; // Filter out all items except for the one passed in the argument function onlyItem (item) { return function () { return $(this).val() == item.id; }; } for (var d = 0; d < data.length; d++) { var item = this._normalizeItem(data[d]); // Skip items which were pre-loaded, only merge the data if ($.inArray(item.id, existingIds) >= 0) { var $existingOption = $existing.filter(onlyItem(item)); var existingData = this.item($existingOption); var newData = $.extend(true, {}, item, existingData); var $newOption = this.option(newData); $existingOption.replaceWith($newOption); continue; } var $option = this.option(item); if (item.children) { var $children = this.convertToOptions(item.children); Utils.appendMany($option, $children); } $options.push($option); } return $options; }; return ArrayAdapter; }); S2.define('select2/data/ajax',[ './array', '../utils', 'jquery' ], function (ArrayAdapter, Utils, $) { function AjaxAdapter ($element, options) { this.ajaxOptions = this._applyDefaults(options.get('ajax')); if (this.ajaxOptions.processResults != null) { this.processResults = this.ajaxOptions.processResults; } AjaxAdapter.__super__.constructor.call(this, $element, options); } Utils.Extend(AjaxAdapter, ArrayAdapter); AjaxAdapter.prototype._applyDefaults = function (options) { var defaults = { data: function (params) { return $.extend({}, params, { q: params.term }); }, transport: function (params, success, failure) { var $request = $.ajax(params); $request.then(success); $request.fail(failure); return $request; } }; return $.extend({}, defaults, options, true); }; AjaxAdapter.prototype.processResults = function (results) { return results; }; AjaxAdapter.prototype.query = function (params, callback) { var matches = []; var self = this; if (this._request != null) { // JSONP requests cannot always be aborted if ($.isFunction(this._request.abort)) { this._request.abort(); } this._request = null; } var options = $.extend({ type: 'GET' }, this.ajaxOptions); if (typeof options.url === 'function') { options.url = options.url.call(this.$element, params); } if (typeof options.data === 'function') { options.data = options.data.call(this.$element, params); } function request () { var $request = options.transport(options, function (data) { var results = self.processResults(data, params); if (self.options.get('debug') && window.console && console.error) { // Check to make sure that the response included a `results` key. if (!results || !results.results || !$.isArray(results.results)) { console.error( 'Select2: The AJAX results did not return an array in the ' + '`results` key of the response.' ); } } callback(results); }, function () { // Attempt to detect if a request was aborted // Only works if the transport exposes a status property if ($request.status && $request.status === '0') { return; } self.trigger('results:message', { message: 'errorLoading' }); }); self._request = $request; } if (this.ajaxOptions.delay && params.term != null) { if (this._queryTimeout) { window.clearTimeout(this._queryTimeout); } this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); } else { request(); } }; return AjaxAdapter; }); S2.define('select2/data/tags',[ 'jquery' ], function ($) { function Tags (decorated, $element, options) { var tags = options.get('tags'); var createTag = options.get('createTag'); if (createTag !== undefined) { this.createTag = createTag; } var insertTag = options.get('insertTag'); if (insertTag !== undefined) { this.insertTag = insertTag; } decorated.call(this, $element, options); if ($.isArray(tags)) { for (var t = 0; t < tags.length; t++) { var tag = tags[t]; var item = this._normalizeItem(tag); var $option = this.option(item); this.$element.append($option); } } } Tags.prototype.query = function (decorated, params, callback) { var self = this; this._removeOldTags(); if (params.term == null || params.page != null) { decorated.call(this, params, callback); return; } function wrapper (obj, child) { var data = obj.results; for (var i = 0; i < data.length; i++) { var option = data[i]; var checkChildren = ( option.children != null && !wrapper({ results: option.children }, true) ); var checkText = option.text === params.term; if (checkText || checkChildren) { if (child) { return false; } obj.data = data; callback(obj); return; } } if (child) { return true; } var tag = self.createTag(params); if (tag != null) { var $option = self.option(tag); $option.attr('data-select2-tag', true); self.addOptions([$option]); self.insertTag(data, tag); } obj.results = data; callback(obj); } decorated.call(this, params, wrapper); }; Tags.prototype.createTag = function (decorated, params) { var term = $.trim(params.term); if (term === '') { return null; } return { id: term, text: term }; }; Tags.prototype.insertTag = function (_, data, tag) { data.unshift(tag); }; Tags.prototype._removeOldTags = function (_) { var tag = this._lastTag; var $options = this.$element.find('option[data-select2-tag]'); $options.each(function () { if (this.selected) { return; } $(this).remove(); }); }; return Tags; }); S2.define('select2/data/tokenizer',[ 'jquery' ], function ($) { function Tokenizer (decorated, $element, options) { var tokenizer = options.get('tokenizer'); if (tokenizer !== undefined) { this.tokenizer = tokenizer; } decorated.call(this, $element, options); } Tokenizer.prototype.bind = function (decorated, container, $container) { decorated.call(this, container, $container); this.$search = container.dropdown.$search || container.selection.$search || $container.find('.select2-search__field'); }; Tokenizer.prototype.query = function (decorated, params, callback) { var self = this; function createAndSelect (data) { // Normalize the data object so we can use it for checks var item = self._normalizeItem(data); // Check if the data object already exists as a tag // Select it if it doesn't var $existingOptions = self.$element.find('option').filter(function () { return $(this).val() === item.id; }); // If an existing option wasn't found for it, create the option if (!$existingOptions.length) { var $option = self.option(item); $option.attr('data-select2-tag', true); self._removeOldTags(); self.addOptions([$option]); } // Select the item, now that we know there is an option for it select(item); } function select (data) { self.trigger('select', { data: data }); } params.term = params.term || ''; var tokenData = this.tokenizer(params, this.options, createAndSelect); if (tokenData.term !== params.term) { // Replace the search term if we have the search box if (this.$search.length) { this.$search.val(tokenData.term); this.$search.focus(); } params.term = tokenData.term; } decorated.call(this, params, callback); }; Tokenizer.prototype.tokenizer = function (_, params, options, callback) { var separators = options.get('tokenSeparators') || []; var term = params.term; var i = 0; var createTag = this.createTag || function (params) { return { id: params.term, text: params.term }; }; while (i < term.length) { var termChar = term[i]; if ($.inArray(termChar, separators) === -1) { i++; continue; } var part = term.substr(0, i); var partParams = $.extend({}, params, { term: part }); var data = createTag(partParams); if (data == null) { i++; continue; } callback(data); // Reset the term to not include the tokenized portion term = term.substr(i + 1) || ''; i = 0; } return { term: term }; }; return Tokenizer; }); S2.define('select2/data/minimumInputLength',[ ], function () { function MinimumInputLength (decorated, $e, options) { this.minimumInputLength = options.get('minimumInputLength'); decorated.call(this, $e, options); } MinimumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (params.term.length < this.minimumInputLength) { this.trigger('results:message', { message: 'inputTooShort', args: { minimum: this.minimumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MinimumInputLength; }); S2.define('select2/data/maximumInputLength',[ ], function () { function MaximumInputLength (decorated, $e, options) { this.maximumInputLength = options.get('maximumInputLength'); decorated.call(this, $e, options); } MaximumInputLength.prototype.query = function (decorated, params, callback) { params.term = params.term || ''; if (this.maximumInputLength > 0 && params.term.length > this.maximumInputLength) { this.trigger('results:message', { message: 'inputTooLong', args: { maximum: this.maximumInputLength, input: params.term, params: params } }); return; } decorated.call(this, params, callback); }; return MaximumInputLength; }); S2.define('select2/data/maximumSelectionLength',[ ], function (){ function MaximumSelectionLength (decorated, $e, options) { this.maximumSelectionLength = options.get('maximumSelectionLength'); decorated.call(this, $e, options); } MaximumSelectionLength.prototype.query = function (decorated, params, callback) { var self = this; this.current(function (currentData) { var count = currentData != null ? currentData.length : 0; if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) { self.trigger('results:message', { message: 'maximumSelected', args: { maximum: self.maximumSelectionLength } }); return; } decorated.call(self, params, callback); }); }; return MaximumSelectionLength; }); S2.define('select2/dropdown',[ 'jquery', './utils' ], function ($, Utils) { function Dropdown ($element, options) { this.$element = $element; this.options = options; Dropdown.__super__.constructor.call(this); } Utils.Extend(Dropdown, Utils.Observable); Dropdown.prototype.render = function () { var $dropdown = $( '' + '' + '' ); $dropdown.attr('dir', this.options.get('dir')); this.$dropdown = $dropdown; return $dropdown; }; Dropdown.prototype.bind = function () { // Should be implemented in subclasses }; Dropdown.prototype.position = function ($dropdown, $container) { // Should be implmented in subclasses }; Dropdown.prototype.destroy = function () { // Remove the dropdown from the DOM this.$dropdown.remove(); }; return Dropdown; }); S2.define('select2/dropdown/search',[ 'jquery', '../utils' ], function ($, Utils) { function Search () { } Search.prototype.render = function (decorated) { var $rendered = decorated.call(this); var $search = $( '' + '' + '' ); this.$searchContainer = $search; this.$search = $search.find('input'); $rendered.prepend($search); return $rendered; }; Search.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); this.$search.on('keydown', function (evt) { self.trigger('keypress', evt); self._keyUpPrevented = evt.isDefaultPrevented(); }); // Workaround for browsers which do not support the `input` event // This will prevent double-triggering of events for browsers which support // both the `keyup` and `input` events. this.$search.on('input', function (evt) { // Unbind the duplicated `keyup` event $(this).off('keyup'); }); this.$search.on('keyup input', function (evt) { self.handleSearch(evt); }); container.on('open', function () { self.$search.attr('tabindex', 0); self.$search.focus(); window.setTimeout(function () { self.$search.focus(); }, 0); }); container.on('close', function () { self.$search.attr('tabindex', -1); self.$search.val(''); }); container.on('focus', function () { if (container.isOpen()) { self.$search.focus(); } }); container.on('results:all', function (params) { if (params.query.term == null || params.query.term === '') { var showSearch = self.showSearch(params); if (showSearch) { self.$searchContainer.removeClass('select2-search--hide'); } else { self.$searchContainer.addClass('select2-search--hide'); } } }); }; Search.prototype.handleSearch = function (evt) { if (!this._keyUpPrevented) { var input = this.$search.val(); this.trigger('query', { term: input }); } this._keyUpPrevented = false; }; Search.prototype.showSearch = function (_, params) { return true; }; return Search; }); S2.define('select2/dropdown/hidePlaceholder',[ ], function () { function HidePlaceholder (decorated, $element, options, dataAdapter) { this.placeholder = this.normalizePlaceholder(options.get('placeholder')); decorated.call(this, $element, options, dataAdapter); } HidePlaceholder.prototype.append = function (decorated, data) { data.results = this.removePlaceholder(data.results); decorated.call(this, data); }; HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { if (typeof placeholder === 'string') { placeholder = { id: '', text: placeholder }; } return placeholder; }; HidePlaceholder.prototype.removePlaceholder = function (_, data) { var modifiedData = data.slice(0); for (var d = data.length - 1; d >= 0; d--) { var item = data[d]; if (this.placeholder.id === item.id) { modifiedData.splice(d, 1); } } return modifiedData; }; return HidePlaceholder; }); S2.define('select2/dropdown/infiniteScroll',[ 'jquery' ], function ($) { function InfiniteScroll (decorated, $element, options, dataAdapter) { this.lastParams = {}; decorated.call(this, $element, options, dataAdapter); this.$loadingMore = this.createLoadingMore(); this.loading = false; } InfiniteScroll.prototype.append = function (decorated, data) { this.$loadingMore.remove(); this.loading = false; decorated.call(this, data); if (this.showLoadingMore(data)) { this.$results.append(this.$loadingMore); } }; InfiniteScroll.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('query', function (params) { self.lastParams = params; self.loading = true; }); container.on('query:append', function (params) { self.lastParams = params; self.loading = true; }); this.$results.on('scroll', function () { var isLoadMoreVisible = $.contains( document.documentElement, self.$loadingMore[0] ); if (self.loading || !isLoadMoreVisible) { return; } var currentOffset = self.$results.offset().top + self.$results.outerHeight(false); var loadingMoreOffset = self.$loadingMore.offset().top + self.$loadingMore.outerHeight(false); if (currentOffset + 50 >= loadingMoreOffset) { self.loadMore(); } }); }; InfiniteScroll.prototype.loadMore = function () { this.loading = true; var params = $.extend({}, {page: 1}, this.lastParams); params.page++; this.trigger('query:append', params); }; InfiniteScroll.prototype.showLoadingMore = function (_, data) { return data.pagination && data.pagination.more; }; InfiniteScroll.prototype.createLoadingMore = function () { var $option = $( '
  • ' ); var message = this.options.get('translations').get('loadingMore'); $option.html(message(this.lastParams)); return $option; }; return InfiniteScroll; }); S2.define('select2/dropdown/attachBody',[ 'jquery', '../utils' ], function ($, Utils) { function AttachBody (decorated, $element, options) { this.$dropdownParent = options.get('dropdownParent') || $(document.body); decorated.call(this, $element, options); } AttachBody.prototype.bind = function (decorated, container, $container) { var self = this; var setupResultsEvents = false; decorated.call(this, container, $container); container.on('open', function () { self._showDropdown(); self._attachPositioningHandler(container); if (!setupResultsEvents) { setupResultsEvents = true; container.on('results:all', function () { self._positionDropdown(); self._resizeDropdown(); }); container.on('results:append', function () { self._positionDropdown(); self._resizeDropdown(); }); } }); container.on('close', function () { self._hideDropdown(); self._detachPositioningHandler(container); }); this.$dropdownContainer.on('mousedown', function (evt) { evt.stopPropagation(); }); }; AttachBody.prototype.destroy = function (decorated) { decorated.call(this); this.$dropdownContainer.remove(); }; AttachBody.prototype.position = function (decorated, $dropdown, $container) { // Clone all of the container classes $dropdown.attr('class', $container.attr('class')); $dropdown.removeClass('select2'); $dropdown.addClass('select2-container--open'); $dropdown.css({ position: 'absolute', top: -999999 }); this.$container = $container; }; AttachBody.prototype.render = function (decorated) { var $container = $(''); var $dropdown = decorated.call(this); $container.append($dropdown); this.$dropdownContainer = $container; return $container; }; AttachBody.prototype._hideDropdown = function (decorated) { this.$dropdownContainer.detach(); }; AttachBody.prototype._attachPositioningHandler = function (decorated, container) { var self = this; var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.each(function () { $(this).data('select2-scroll-position', { x: $(this).scrollLeft(), y: $(this).scrollTop() }); }); $watchers.on(scrollEvent, function (ev) { var position = $(this).data('select2-scroll-position'); $(this).scrollTop(position.y); }); $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, function (e) { self._positionDropdown(); self._resizeDropdown(); }); }; AttachBody.prototype._detachPositioningHandler = function (decorated, container) { var scrollEvent = 'scroll.select2.' + container.id; var resizeEvent = 'resize.select2.' + container.id; var orientationEvent = 'orientationchange.select2.' + container.id; var $watchers = this.$container.parents().filter(Utils.hasScroll); $watchers.off(scrollEvent); $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); }; AttachBody.prototype._positionDropdown = function () { var $window = $(window); var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); var newDirection = null; var offset = this.$container.offset(); offset.bottom = offset.top + this.$container.outerHeight(false); var container = { height: this.$container.outerHeight(false) }; container.top = offset.top; container.bottom = offset.top + container.height; var dropdown = { height: this.$dropdown.outerHeight(false) }; var viewport = { top: $window.scrollTop(), bottom: $window.scrollTop() + $window.height() }; var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); var css = { left: offset.left, top: container.bottom }; // Determine what the parent element is to use for calciulating the offset var $offsetParent = this.$dropdownParent; // For statically positoned elements, we need to get the element // that is determining the offset if ($offsetParent.css('position') === 'static') { $offsetParent = $offsetParent.offsetParent(); } var parentOffset = $offsetParent.offset(); css.top -= parentOffset.top; css.left -= parentOffset.left; if (!isCurrentlyAbove && !isCurrentlyBelow) { newDirection = 'below'; } if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { newDirection = 'above'; } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { newDirection = 'below'; } if (newDirection == 'above' || (isCurrentlyAbove && newDirection !== 'below')) { css.top = container.top - parentOffset.top - dropdown.height; } if (newDirection != null) { this.$dropdown .removeClass('select2-dropdown--below select2-dropdown--above') .addClass('select2-dropdown--' + newDirection); this.$container .removeClass('select2-container--below select2-container--above') .addClass('select2-container--' + newDirection); } this.$dropdownContainer.css(css); }; AttachBody.prototype._resizeDropdown = function () { var css = { width: this.$container.outerWidth(false) + 'px' }; if (this.options.get('dropdownAutoWidth')) { css.minWidth = css.width; css.position = 'relative'; css.width = 'auto'; } this.$dropdown.css(css); }; AttachBody.prototype._showDropdown = function (decorated) { this.$dropdownContainer.appendTo(this.$dropdownParent); this._positionDropdown(); this._resizeDropdown(); }; return AttachBody; }); S2.define('select2/dropdown/minimumResultsForSearch',[ ], function () { function countResults (data) { var count = 0; for (var d = 0; d < data.length; d++) { var item = data[d]; if (item.children) { count += countResults(item.children); } else { count++; } } return count; } function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { this.minimumResultsForSearch = options.get('minimumResultsForSearch'); if (this.minimumResultsForSearch < 0) { this.minimumResultsForSearch = Infinity; } decorated.call(this, $element, options, dataAdapter); } MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { if (countResults(params.data.results) < this.minimumResultsForSearch) { return false; } return decorated.call(this, params); }; return MinimumResultsForSearch; }); S2.define('select2/dropdown/selectOnClose',[ ], function () { function SelectOnClose () { } SelectOnClose.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('close', function (params) { self._handleSelectOnClose(params); }); }; SelectOnClose.prototype._handleSelectOnClose = function (_, params) { if (params && params.originalSelect2Event != null) { var event = params.originalSelect2Event; // Don't select an item if the close event was triggered from a select or // unselect event if (event._type === 'select' || event._type === 'unselect') { return; } } var $highlightedResults = this.getHighlightedResults(); // Only select highlighted results if ($highlightedResults.length < 1) { return; } var data = $highlightedResults.data('data'); // Don't re-select already selected resulte if ( (data.element != null && data.element.selected) || (data.element == null && data.selected) ) { return; } this.trigger('select', { data: data }); }; return SelectOnClose; }); S2.define('select2/dropdown/closeOnSelect',[ ], function () { function CloseOnSelect () { } CloseOnSelect.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('select', function (evt) { self._selectTriggered(evt); }); container.on('unselect', function (evt) { self._selectTriggered(evt); }); }; CloseOnSelect.prototype._selectTriggered = function (_, evt) { var originalEvent = evt.originalEvent; // Don't close if the control key is being held if (originalEvent && originalEvent.ctrlKey) { return; } this.trigger('close', { originalEvent: originalEvent, originalSelect2Event: evt }); }; return CloseOnSelect; }); S2.define('select2/i18n/en',[],function () { // English return { errorLoading: function () { return 'The results could not be loaded.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; var message = 'Please delete ' + overChars + ' character'; if (overChars != 1) { message += 's'; } return message; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; var message = 'Please enter ' + remainingChars + ' or more characters'; return message; }, loadingMore: function () { return 'Loading more results…'; }, maximumSelected: function (args) { var message = 'You can only select ' + args.maximum + ' item'; if (args.maximum != 1) { message += 's'; } return message; }, noResults: function () { return 'No results found'; }, searching: function () { return 'Searching…'; } }; }); S2.define('select2/defaults',[ 'jquery', 'require', './results', './selection/single', './selection/multiple', './selection/placeholder', './selection/allowClear', './selection/search', './selection/eventRelay', './utils', './translation', './diacritics', './data/select', './data/array', './data/ajax', './data/tags', './data/tokenizer', './data/minimumInputLength', './data/maximumInputLength', './data/maximumSelectionLength', './dropdown', './dropdown/search', './dropdown/hidePlaceholder', './dropdown/infiniteScroll', './dropdown/attachBody', './dropdown/minimumResultsForSearch', './dropdown/selectOnClose', './dropdown/closeOnSelect', './i18n/en' ], function ($, require, ResultsList, SingleSelection, MultipleSelection, Placeholder, AllowClear, SelectionSearch, EventRelay, Utils, Translation, DIACRITICS, SelectData, ArrayData, AjaxData, Tags, Tokenizer, MinimumInputLength, MaximumInputLength, MaximumSelectionLength, Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, EnglishTranslation) { function Defaults () { this.reset(); } Defaults.prototype.apply = function (options) { options = $.extend(true, {}, this.defaults, options); if (options.dataAdapter == null) { if (options.ajax != null) { options.dataAdapter = AjaxData; } else if (options.data != null) { options.dataAdapter = ArrayData; } else { options.dataAdapter = SelectData; } if (options.minimumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MinimumInputLength ); } if (options.maximumInputLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumInputLength ); } if (options.maximumSelectionLength > 0) { options.dataAdapter = Utils.Decorate( options.dataAdapter, MaximumSelectionLength ); } if (options.tags) { options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); } if (options.tokenSeparators != null || options.tokenizer != null) { options.dataAdapter = Utils.Decorate( options.dataAdapter, Tokenizer ); } if (options.query != null) { var Query = require(options.amdBase + 'compat/query'); options.dataAdapter = Utils.Decorate( options.dataAdapter, Query ); } if (options.initSelection != null) { var InitSelection = require(options.amdBase + 'compat/initSelection'); options.dataAdapter = Utils.Decorate( options.dataAdapter, InitSelection ); } } if (options.resultsAdapter == null) { options.resultsAdapter = ResultsList; if (options.ajax != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, InfiniteScroll ); } if (options.placeholder != null) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, HidePlaceholder ); } if (options.selectOnClose) { options.resultsAdapter = Utils.Decorate( options.resultsAdapter, SelectOnClose ); } } if (options.dropdownAdapter == null) { if (options.multiple) { options.dropdownAdapter = Dropdown; } else { var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); options.dropdownAdapter = SearchableDropdown; } if (options.minimumResultsForSearch !== 0) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, MinimumResultsForSearch ); } if (options.closeOnSelect) { options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, CloseOnSelect ); } if ( options.dropdownCssClass != null || options.dropdownCss != null || options.adaptDropdownCssClass != null ) { var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, DropdownCSS ); } options.dropdownAdapter = Utils.Decorate( options.dropdownAdapter, AttachBody ); } if (options.selectionAdapter == null) { if (options.multiple) { options.selectionAdapter = MultipleSelection; } else { options.selectionAdapter = SingleSelection; } // Add the placeholder mixin if a placeholder was specified if (options.placeholder != null) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, Placeholder ); } if (options.allowClear) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, AllowClear ); } if (options.multiple) { options.selectionAdapter = Utils.Decorate( options.selectionAdapter, SelectionSearch ); } if ( options.containerCssClass != null || options.containerCss != null || options.adaptContainerCssClass != null ) { var ContainerCSS = require(options.amdBase + 'compat/containerCss'); options.selectionAdapter = Utils.Decorate( options.selectionAdapter, ContainerCSS ); } options.selectionAdapter = Utils.Decorate( options.selectionAdapter, EventRelay ); } if (typeof options.language === 'string') { // Check if the language is specified with a region if (options.language.indexOf('-') > 0) { // Extract the region information if it is included var languageParts = options.language.split('-'); var baseLanguage = languageParts[0]; options.language = [options.language, baseLanguage]; } else { options.language = [options.language]; } } if ($.isArray(options.language)) { var languages = new Translation(); options.language.push('en'); var languageNames = options.language; for (var l = 0; l < languageNames.length; l++) { var name = languageNames[l]; var language = {}; try { // Try to load it with the original name language = Translation.loadPath(name); } catch (e) { try { // If we couldn't load it, check if it wasn't the full path name = this.defaults.amdLanguageBase + name; language = Translation.loadPath(name); } catch (ex) { // The translation could not be loaded at all. Sometimes this is // because of a configuration problem, other times this can be // because of how Select2 helps load all possible translation files. if (options.debug && window.console && console.warn) { console.warn( 'Select2: The language file for "' + name + '" could not be ' + 'automatically loaded. A fallback will be used instead.' ); } continue; } } languages.extend(language); } options.translations = languages; } else { var baseTranslation = Translation.loadPath( this.defaults.amdLanguageBase + 'en' ); var customTranslation = new Translation(options.language); customTranslation.extend(baseTranslation); options.translations = customTranslation; } return options; }; Defaults.prototype.reset = function () { function stripDiacritics (text) { // Used 'uni range + named function' from http://jsperf.com/diacritics/18 function match(a) { return DIACRITICS[a] || a; } return text.replace(/[^\u0000-\u007E]/g, match); } function matcher (params, data) { // Always return the object if there is nothing to compare if ($.trim(params.term) === '') { return data; } // Do a recursive check for options with children if (data.children && data.children.length > 0) { // Clone the data object if there are children // This is required as we modify the object to remove any non-matches var match = $.extend(true, {}, data); // Check each child of the option for (var c = data.children.length - 1; c >= 0; c--) { var child = data.children[c]; var matches = matcher(params, child); // If there wasn't a match, remove the object in the array if (matches == null) { match.children.splice(c, 1); } } // If any children matched, return the new object if (match.children.length > 0) { return match; } // If there were no matching children, check just the plain object return matcher(params, match); } var original = stripDiacritics(data.text).toUpperCase(); var term = stripDiacritics(params.term).toUpperCase(); // Check if the text contains the term if (original.indexOf(term) > -1) { return data; } // If it doesn't contain the term, don't return anything return null; } this.defaults = { amdBase: './', amdLanguageBase: './i18n/', closeOnSelect: true, debug: false, dropdownAutoWidth: false, escapeMarkup: Utils.escapeMarkup, language: EnglishTranslation, matcher: matcher, minimumInputLength: 0, maximumInputLength: 0, maximumSelectionLength: 0, minimumResultsForSearch: 0, selectOnClose: false, sorter: function (data) { return data; }, templateResult: function (result) { return result.text; }, templateSelection: function (selection) { return selection.text; }, theme: 'default', width: 'resolve' }; }; Defaults.prototype.set = function (key, value) { var camelKey = $.camelCase(key); var data = {}; data[camelKey] = value; var convertedData = Utils._convertData(data); $.extend(this.defaults, convertedData); }; var defaults = new Defaults(); return defaults; }); S2.define('select2/options',[ 'require', 'jquery', './defaults', './utils' ], function (require, $, Defaults, Utils) { function Options (options, $element) { this.options = options; if ($element != null) { this.fromElement($element); } this.options = Defaults.apply(this.options); if ($element && $element.is('input')) { var InputCompat = require(this.get('amdBase') + 'compat/inputData'); this.options.dataAdapter = Utils.Decorate( this.options.dataAdapter, InputCompat ); } } Options.prototype.fromElement = function ($e) { var excludedData = ['select2']; if (this.options.multiple == null) { this.options.multiple = $e.prop('multiple'); } if (this.options.disabled == null) { this.options.disabled = $e.prop('disabled'); } if (this.options.language == null) { if ($e.prop('lang')) { this.options.language = $e.prop('lang').toLowerCase(); } else if ($e.closest('[lang]').prop('lang')) { this.options.language = $e.closest('[lang]').prop('lang'); } } if (this.options.dir == null) { if ($e.prop('dir')) { this.options.dir = $e.prop('dir'); } else if ($e.closest('[dir]').prop('dir')) { this.options.dir = $e.closest('[dir]').prop('dir'); } else { this.options.dir = 'ltr'; } } $e.prop('disabled', this.options.disabled); $e.prop('multiple', this.options.multiple); if ($e.data('select2Tags')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-select2-tags` attribute has been changed to ' + 'use the `data-data` and `data-tags="true"` attributes and will be ' + 'removed in future versions of Select2.' ); } $e.data('data', $e.data('select2Tags')); $e.data('tags', true); } if ($e.data('ajaxUrl')) { if (this.options.debug && window.console && console.warn) { console.warn( 'Select2: The `data-ajax-url` attribute has been changed to ' + '`data-ajax--url` and support for the old attribute will be removed' + ' in future versions of Select2.' ); } $e.attr('ajax--url', $e.data('ajaxUrl')); $e.data('ajax--url', $e.data('ajaxUrl')); } var dataset = {}; // Prefer the element's `dataset` attribute if it exists // jQuery 1.x does not correctly handle data attributes with multiple dashes if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { dataset = $.extend(true, {}, $e[0].dataset, $e.data()); } else { dataset = $e.data(); } var data = $.extend(true, {}, dataset); data = Utils._convertData(data); for (var key in data) { if ($.inArray(key, excludedData) > -1) { continue; } if ($.isPlainObject(this.options[key])) { $.extend(this.options[key], data[key]); } else { this.options[key] = data[key]; } } return this; }; Options.prototype.get = function (key) { return this.options[key]; }; Options.prototype.set = function (key, val) { this.options[key] = val; }; return Options; }); S2.define('select2/core',[ 'jquery', './options', './utils', './keys' ], function ($, Options, Utils, KEYS) { var Select2 = function ($element, options) { if ($element.data('select2') != null) { $element.data('select2').destroy(); } this.$element = $element; this.id = this._generateId($element); options = options || {}; this.options = new Options(options, $element); Select2.__super__.constructor.call(this); // Set up the tabindex var tabindex = $element.attr('tabindex') || 0; $element.data('old-tabindex', tabindex); $element.attr('tabindex', '-1'); // Set up containers and adapters var DataAdapter = this.options.get('dataAdapter'); this.dataAdapter = new DataAdapter($element, this.options); var $container = this.render(); this._placeContainer($container); var SelectionAdapter = this.options.get('selectionAdapter'); this.selection = new SelectionAdapter($element, this.options); this.$selection = this.selection.render(); this.selection.position(this.$selection, $container); var DropdownAdapter = this.options.get('dropdownAdapter'); this.dropdown = new DropdownAdapter($element, this.options); this.$dropdown = this.dropdown.render(); this.dropdown.position(this.$dropdown, $container); var ResultsAdapter = this.options.get('resultsAdapter'); this.results = new ResultsAdapter($element, this.options, this.dataAdapter); this.$results = this.results.render(); this.results.position(this.$results, this.$dropdown); // Bind events var self = this; // Bind the container to all of the adapters this._bindAdapters(); // Register any DOM event handlers this._registerDomEvents(); // Register any internal event handlers this._registerDataEvents(); this._registerSelectionEvents(); this._registerDropdownEvents(); this._registerResultsEvents(); this._registerEvents(); // Set the initial state this.dataAdapter.current(function (initialData) { self.trigger('selection:update', { data: initialData }); }); // Hide the original select $element.addClass('select2-hidden-accessible'); $element.attr('aria-hidden', 'true'); // Synchronize any monitored attributes this._syncAttributes(); $element.data('select2', this); }; Utils.Extend(Select2, Utils.Observable); Select2.prototype._generateId = function ($element) { var id = ''; if ($element.attr('id') != null) { id = $element.attr('id'); } else if ($element.attr('name') != null) { id = $element.attr('name') + '-' + Utils.generateChars(2); } else { id = Utils.generateChars(4); } id = id.replace(/(:|\.|\[|\]|,)/g, ''); id = 'select2-' + id; return id; }; Select2.prototype._placeContainer = function ($container) { $container.insertAfter(this.$element); var width = this._resolveWidth(this.$element, this.options.get('width')); if (width != null) { $container.css('width', width); } }; Select2.prototype._resolveWidth = function ($element, method) { var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; if (method == 'resolve') { var styleWidth = this._resolveWidth($element, 'style'); if (styleWidth != null) { return styleWidth; } return this._resolveWidth($element, 'element'); } if (method == 'element') { var elementWidth = $element.outerWidth(false); if (elementWidth <= 0) { return 'auto'; } return elementWidth + 'px'; } if (method == 'style') { var style = $element.attr('style'); if (typeof(style) !== 'string') { return null; } var attrs = style.split(';'); for (var i = 0, l = attrs.length; i < l; i = i + 1) { var attr = attrs[i].replace(/\s/g, ''); var matches = attr.match(WIDTH); if (matches !== null && matches.length >= 1) { return matches[1]; } } return null; } return method; }; Select2.prototype._bindAdapters = function () { this.dataAdapter.bind(this, this.$container); this.selection.bind(this, this.$container); this.dropdown.bind(this, this.$container); this.results.bind(this, this.$container); }; Select2.prototype._registerDomEvents = function () { var self = this; this.$element.on('change.select2', function () { self.dataAdapter.current(function (data) { self.trigger('selection:update', { data: data }); }); }); this.$element.on('focus.select2', function (evt) { self.trigger('focus', evt); }); this._syncA = Utils.bind(this._syncAttributes, this); this._syncS = Utils.bind(this._syncSubtree, this); if (this.$element[0].attachEvent) { this.$element[0].attachEvent('onpropertychange', this._syncA); } var observer = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver ; if (observer != null) { this._observer = new observer(function (mutations) { $.each(mutations, self._syncA); $.each(mutations, self._syncS); }); this._observer.observe(this.$element[0], { attributes: true, childList: true, subtree: false }); } else if (this.$element[0].addEventListener) { this.$element[0].addEventListener( 'DOMAttrModified', self._syncA, false ); this.$element[0].addEventListener( 'DOMNodeInserted', self._syncS, false ); this.$element[0].addEventListener( 'DOMNodeRemoved', self._syncS, false ); } }; Select2.prototype._registerDataEvents = function () { var self = this; this.dataAdapter.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerSelectionEvents = function () { var self = this; var nonRelayEvents = ['toggle', 'focus']; this.selection.on('toggle', function () { self.toggleDropdown(); }); this.selection.on('focus', function (params) { self.focus(params); }); this.selection.on('*', function (name, params) { if ($.inArray(name, nonRelayEvents) !== -1) { return; } self.trigger(name, params); }); }; Select2.prototype._registerDropdownEvents = function () { var self = this; this.dropdown.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerResultsEvents = function () { var self = this; this.results.on('*', function (name, params) { self.trigger(name, params); }); }; Select2.prototype._registerEvents = function () { var self = this; this.on('open', function () { self.$container.addClass('select2-container--open'); }); this.on('close', function () { self.$container.removeClass('select2-container--open'); }); this.on('enable', function () { self.$container.removeClass('select2-container--disabled'); }); this.on('disable', function () { self.$container.addClass('select2-container--disabled'); }); this.on('blur', function () { self.$container.removeClass('select2-container--focus'); }); this.on('query', function (params) { if (!self.isOpen()) { self.trigger('open', {}); } this.dataAdapter.query(params, function (data) { self.trigger('results:all', { data: data, query: params }); }); }); this.on('query:append', function (params) { this.dataAdapter.query(params, function (data) { self.trigger('results:append', { data: data, query: params }); }); }); this.on('keypress', function (evt) { var key = evt.which; if (self.isOpen()) { if (key === KEYS.ESC || key === KEYS.TAB || (key === KEYS.UP && evt.altKey)) { self.close(); evt.preventDefault(); } else if (key === KEYS.ENTER) { self.trigger('results:select', {}); evt.preventDefault(); } else if ((key === KEYS.SPACE && evt.ctrlKey)) { self.trigger('results:toggle', {}); evt.preventDefault(); } else if (key === KEYS.UP) { self.trigger('results:previous', {}); evt.preventDefault(); } else if (key === KEYS.DOWN) { self.trigger('results:next', {}); evt.preventDefault(); } } else { if (key === KEYS.ENTER || key === KEYS.SPACE || (key === KEYS.DOWN && evt.altKey)) { self.open(); evt.preventDefault(); } } }); }; Select2.prototype._syncAttributes = function () { this.options.set('disabled', this.$element.prop('disabled')); if (this.options.get('disabled')) { if (this.isOpen()) { this.close(); } this.trigger('disable', {}); } else { this.trigger('enable', {}); } }; Select2.prototype._syncSubtree = function (evt, mutations) { var changed = false; var self = this; // Ignore any mutation events raised for elements that aren't options or // optgroups. This handles the case when the select element is destroyed if ( evt && evt.target && ( evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' ) ) { return; } if (!mutations) { // If mutation events aren't supported, then we can only assume that the // change affected the selections changed = true; } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { for (var n = 0; n < mutations.addedNodes.length; n++) { var node = mutations.addedNodes[n]; if (node.selected) { changed = true; } } } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { changed = true; } // Only re-pull the data if we think there is a change if (changed) { this.dataAdapter.current(function (currentData) { self.trigger('selection:update', { data: currentData }); }); } }; /** * Override the trigger method to automatically trigger pre-events when * there are events that can be prevented. */ Select2.prototype.trigger = function (name, args) { var actualTrigger = Select2.__super__.trigger; var preTriggerMap = { 'open': 'opening', 'close': 'closing', 'select': 'selecting', 'unselect': 'unselecting' }; if (args === undefined) { args = {}; } if (name in preTriggerMap) { var preTriggerName = preTriggerMap[name]; var preTriggerArgs = { prevented: false, name: name, args: args }; actualTrigger.call(this, preTriggerName, preTriggerArgs); if (preTriggerArgs.prevented) { args.prevented = true; return; } } actualTrigger.call(this, name, args); }; Select2.prototype.toggleDropdown = function () { if (this.options.get('disabled')) { return; } if (this.isOpen()) { this.close(); } else { this.open(); } }; Select2.prototype.open = function () { if (this.isOpen()) { return; } this.trigger('query', {}); }; Select2.prototype.close = function () { if (!this.isOpen()) { return; } this.trigger('close', {}); }; Select2.prototype.isOpen = function () { return this.$container.hasClass('select2-container--open'); }; Select2.prototype.hasFocus = function () { return this.$container.hasClass('select2-container--focus'); }; Select2.prototype.focus = function (data) { // No need to re-trigger focus events if we are already focused if (this.hasFocus()) { return; } this.$container.addClass('select2-container--focus'); this.trigger('focus', {}); }; Select2.prototype.enable = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("enable")` method has been deprecated and will' + ' be removed in later Select2 versions. Use $element.prop("disabled")' + ' instead.' ); } if (args == null || args.length === 0) { args = [true]; } var disabled = !args[0]; this.$element.prop('disabled', disabled); }; Select2.prototype.data = function () { if (this.options.get('debug') && arguments.length > 0 && window.console && console.warn) { console.warn( 'Select2: Data can no longer be set using `select2("data")`. You ' + 'should consider setting the value instead using `$element.val()`.' ); } var data = []; this.dataAdapter.current(function (currentData) { data = currentData; }); return data; }; Select2.prototype.val = function (args) { if (this.options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `select2("val")` method has been deprecated and will be' + ' removed in later Select2 versions. Use $element.val() instead.' ); } if (args == null || args.length === 0) { return this.$element.val(); } var newVal = args[0]; if ($.isArray(newVal)) { newVal = $.map(newVal, function (obj) { return obj.toString(); }); } this.$element.val(newVal).trigger('change'); }; Select2.prototype.destroy = function () { this.$container.remove(); if (this.$element[0].detachEvent) { this.$element[0].detachEvent('onpropertychange', this._syncA); } if (this._observer != null) { this._observer.disconnect(); this._observer = null; } else if (this.$element[0].removeEventListener) { this.$element[0] .removeEventListener('DOMAttrModified', this._syncA, false); this.$element[0] .removeEventListener('DOMNodeInserted', this._syncS, false); this.$element[0] .removeEventListener('DOMNodeRemoved', this._syncS, false); } this._syncA = null; this._syncS = null; this.$element.off('.select2'); this.$element.attr('tabindex', this.$element.data('old-tabindex')); this.$element.removeClass('select2-hidden-accessible'); this.$element.attr('aria-hidden', 'false'); this.$element.removeData('select2'); this.dataAdapter.destroy(); this.selection.destroy(); this.dropdown.destroy(); this.results.destroy(); this.dataAdapter = null; this.selection = null; this.dropdown = null; this.results = null; }; Select2.prototype.render = function () { var $container = $( '' + '' + '' + '' ); $container.attr('dir', this.options.get('dir')); this.$container = $container; this.$container.addClass('select2-container--' + this.options.get('theme')); $container.data('element', this.$element); return $container; }; return Select2; }); S2.define('jquery-mousewheel',[ 'jquery' ], function ($) { // Used to shim jQuery.mousewheel for non-full builds. return $; }); S2.define('jquery.select2',[ 'jquery', 'jquery-mousewheel', './select2/core', './select2/defaults' ], function ($, _, Select2, Defaults) { if ($.fn.select2 == null) { // All methods that should return the element var thisMethods = ['open', 'close', 'destroy']; $.fn.select2 = function (options) { options = options || {}; if (typeof options === 'object') { this.each(function () { var instanceOptions = $.extend(true, {}, options); var instance = new Select2($(this), instanceOptions); }); return this; } else if (typeof options === 'string') { var ret; var args = Array.prototype.slice.call(arguments, 1); this.each(function () { var instance = $(this).data('select2'); if (instance == null && window.console && console.error) { console.error( 'The select2(\'' + options + '\') method was called on an ' + 'element that is not using Select2.' ); } ret = instance[options].apply(instance, args); }); // Check if we should be returning `this` if ($.inArray(options, thisMethods) > -1) { return this; } return ret; } else { throw new Error('Invalid arguments for Select2: ' + options); } }; } if ($.fn.select2.defaults == null) { $.fn.select2.defaults = Defaults; } return Select2; }); // Return the AMD loader configuration so it can be used outside of this file return { define: S2.define, require: S2.require }; }()); // Autoload the jQuery bindings // We know that all of the modules exist above this, so we're safe var select2 = S2.require('jquery.select2'); // Hold the AMD module references on the jQuery function that was just loaded // This allows Select2 to use the internal loader outside of this file, such // as in the language files. jQuery.fn.select2.amd = S2; // Return the Select2 instance for anyone who is importing it. return select2; })); /** * External dependencies */ import { __ } from '@wordpress/i18n'; import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; import { createInterpolateElement, useEffect } from '@wordpress/element'; import { getAdminLink, getSettingWithCoercion } from '@woocommerce/settings'; import { isBoolean } from '@woocommerce/types'; import { Disabled, PanelBody, ToggleControl, // eslint-disable-next-line @wordpress/no-unsafe-wp-apis __experimentalToggleGroupControl as ToggleGroupControl, // eslint-disable-next-line @wordpress/no-unsafe-wp-apis __experimentalToggleGroupControlOption as ToggleGroupControlOption, } from '@wordpress/components'; /** * Internal dependencies */ import Block from './block'; const Edit = ( { attributes, setAttributes, context } ) => { const { showProductLink, imageSizing, showSaleBadge, saleBadgeAlign } = attributes; const blockProps = useBlockProps(); const isDescendentOfQueryLoop = Number.isFinite( context.queryId ); useEffect( () => setAttributes( { isDescendentOfQueryLoop } ), [ setAttributes, isDescendentOfQueryLoop ] ); const isBlockThemeEnabled = getSettingWithCoercion( 'is_block_theme_enabled', false, isBoolean ); useEffect( () => { if ( isBlockThemeEnabled && attributes.imageSizing !== 'full-size' ) { setAttributes( { imageSizing: 'full-size' } ); } }, [ attributes.imageSizing, isBlockThemeEnabled, setAttributes ] ); return (
    setAttributes( { showProductLink: ! showProductLink, } ) } /> setAttributes( { showSaleBadge: ! showSaleBadge, } ) } /> { showSaleBadge && ( setAttributes( { saleBadgeAlign: value } ) } > ) } { ! isBlockThemeEnabled && ( Customizer.', 'woocommerce' ), { a: ( // eslint-disable-next-line jsx-a11y/anchor-has-content ), } ) } value={ imageSizing } onChange={ ( value ) => setAttributes( { imageSizing: value } ) } > ) }
    ); }; export default Edit; "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const index=require("./index-4fce5d38.js"),prestoTimestampCss=":host{display:inline}",PrestoTimestampStyle0=prestoTimestampCss,PrestoTimestamp=class{constructor(e){index.registerInstance(this,e),this.time=void 0}handleClick(e){e.preventDefault();const t=document.body.querySelector("presto-player");t&&t.goToAndPlay(this.timeToSeconds(this.time))}timeToSeconds(e){let t,s=e.split(":");return s.length>1&&(t=60*parseInt(s[0])),parseInt(s[1])+parseInt(t)}render(){return index.h("a",{key:"643d2582416f86c927486f331bbb21fa631fc59b",href:"#",class:"presto-timestamp",onClick:e=>this.handleClick(e)},index.h("slot",{key:"6367df80d3a83fdc2acf7d1b7af9eca0525495f5"},this.time))}};PrestoTimestamp.style=PrestoTimestampStyle0,exports.presto_timestamp=PrestoTimestamp;const { __ } = wp.i18n; import chunkUpload from "@/admin/blocks/shared/media/chunk-upload"; import MediaPopup from "@/admin/blocks/shared/media/MediaPopup"; const { useState, useEffect } = wp.element; export default ({ closePopup, noticeOperations, onSelect, isPrivate }) => { const [videos, setVideos] = useState([]); const [fetching, setFetching] = useState(false); const [progress, setProgress] = useState(0); const [progressMessage, setProgressMessage] = useState(""); const [error, setError] = useState(""); const endpoint = isPrivate ? "private-videos" : "public-videos"; // reset progress and error on open useEffect(() => { setProgress(0); setError(""); }, []); // handle error const onError = (message) => { noticeOperations.removeAllNotices(); noticeOperations.createErrorNotice(message); }; const uploadFile = async (files) => { setError(""); setFetching(true); setProgressMessage(__("Uploading", "presto-player")); chunkUpload({ file: files[0], path: `presto-player/v1/bunny/upload`, onProgress: (percent) => { setProgress(percent - 10); // leave 10% for storing }, onComplete: storeFile, onError: (e) => { setError(e.message); setProgress(0); setFetching(false); }, }); }; const storeFile = async ({ path, name }) => { setProgressMessage(__("Storing", "presto-player")); try { const videos = await wp.apiFetch({ path: `presto-player/v1/bunny/${endpoint}`, method: "POST", data: { path, name, }, }); setVideos(videos); } catch (e) { setError(e.message); console.error(e); } finally { setProgress(0); setFetching(false); } }; const deleteVideo = async (video) => { try { setVideos((videos || []).filter((item) => item !== video)); await wp.apiFetch({ path: `presto-player/v1/bunny/${endpoint}`, method: "DELETE", data: { name: video?.title, }, }); } catch (e) { setError(e.message); } }; // loads videos for media popup const loadVideos = async () => { try { setFetching(true); const videos = await wp.apiFetch({ path: `presto-player/v1/bunny/${endpoint}`, }); setVideos(videos); } catch (e) { setError(e.message); } finally { setFetching(false); } }; return ( ); }; /* global _ */ /** * Internal dependencies. */ import { getChosenVars } from 'utils/chosen.js'; jQuery( document ).ready( function( $ ) { // Globally apply to elements on the page. $( '.edd-select-chosen' ).each( function() { const el = $( this ); el.chosen( getChosenVars( el ) ); } ); $( '.edd-select-chosen .chosen-search input' ).each( function() { // Bail if placeholder already set if ( $( this ).attr( 'placeholder' ) ) { return; } const selectElem = $( this ).parent().parent().parent().prev( 'select.edd-select-chosen' ), placeholder = selectElem.data( 'search-placeholder' ); if ( placeholder ) { $( this ).attr( 'placeholder', placeholder ); } } ); // Add placeholders for Chosen input fields $( '.chosen-choices' ).on( 'click', function() { let placeholder = $( this ).parent().prev().data( 'search-placeholder' ); if ( typeof placeholder === 'undefined' ) { placeholder = edd_vars.type_to_search; } $( this ).children( 'li' ).children( 'input' ).attr( 'placeholder', placeholder ); } ); // This fixes the Chosen box being 0px wide when the thickbox is opened $( '#post' ).on( 'click', '.edd-thickbox', function() { $( '.edd-select-chosen', '#choose-download' ).css( 'width', '100%' ); } ); // Variables for setting up the typing timer // Time in ms, Slow - 521ms, Moderate - 342ms, Fast - 300ms let userInteractionInterval = 342, typingTimerElements = '.edd-select-chosen .chosen-search input, .edd-select-chosen .search-field input', typingTimer; // Replace options with search results $( document.body ).on( 'keyup', typingTimerElements, _.debounce( function( e ) { let element = $( this ), val = element.val(), container = element.closest( '.edd-select-chosen' ), select = container.prev(), select_type = select.data( 'search-type' ), no_bundles = container.hasClass( 'no-bundles' ), variations = container.hasClass( 'variations' ), variations_only = container.hasClass( 'variations-only' ), lastKey = e.which, search_type = 'edd_download_search'; // String replace the chosen container IDs container.attr( 'id' ).replace( '_chosen', '' ); // Detect if we have a defined search type, otherwise default to downloads if ( typeof select_type !== 'undefined' ) { // Don't trigger AJAX if this select has all options loaded if ( 'no_ajax' === select_type ) { return; } search_type = 'edd_' + select_type + '_search'; } else { return; } // Don't fire if short or is a modifier key (shift, ctrl, apple command key, or arrow keys) if ( ( val.length <= 3 && 'edd_download_search' === search_type ) || ( lastKey === 16 || lastKey === 13 || lastKey === 91 || lastKey === 17 || lastKey === 37 || lastKey === 38 || lastKey === 39 || lastKey === 40 ) ) { container.children( '.spinner' ).remove(); return; } // Maybe append a spinner if ( ! container.children( '.spinner' ).length ) { container.append( '' ); } $.ajax( { type: 'GET', dataType: 'json', url: ajaxurl, data: { s: val, action: search_type, no_bundles: no_bundles, variations: variations, variations_only: variations_only, }, beforeSend: function() { select.closest( 'ul.chosen-results' ).empty(); }, success: function( data ) { // Remove all options but those that are selected $( 'option:not(:selected)', select ).remove(); // Add any option that doesn't already exist $.each( data, function( key, item ) { if ( ! $( 'option[value="' + item.id + '"]', select ).length ) { select.prepend( '' ); } } ); // Get the text immediately before triggering an update. // Any sooner will cause the text to jump around. const val = element.val(); // Update the options select.trigger( 'chosen:updated' ); element.val( val ); }, } ).fail( function( response ) { if ( window.console && window.console.log ) { console.log( response ); } } ).done( function( response ) { container.children( '.spinner' ).remove(); } ); }, userInteractionInterval ) ); } ); .wp-core-ui.wp-admin .wcc-root .screen-reader-text{clip:rect(1px,1px,1px,1px);position:absolute!important}.wp-core-ui.wp-admin .wcc-root .screen-reader-text:active,.wp-core-ui.wp-admin .wcc-root .screen-reader-text:focus,.wp-core-ui.wp-admin .wcc-root .screen-reader-text:hover{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}.wp-core-ui.wp-admin .wcc-root .global-notices{text-align:right;pointer-events:none;z-index:179;position:fixed;top:auto;right:0;bottom:0;left:0}@media (min-width:661px){.wp-core-ui.wp-admin .wcc-root .global-notices{top:63px;right:16px;bottom:auto;left:auto;max-width:calc(100% - 32px)}}@media (min-width:961px){.wp-core-ui.wp-admin .wcc-root .global-notices{top:71px;right:24px;max-width:calc(100% - 48px)}}@media (min-width:1041px){.wp-core-ui.wp-admin .wcc-root .global-notices{right:32px;max-width:calc(100% - 64px)}}.wp-core-ui.wp-admin .wcc-root .global-notices .notice{flex-wrap:nowrap;margin-bottom:0;text-align:left;pointer-events:auto;border-radius:0;box-shadow:0 2px 5px rgba(0,0,0,.2),0 0 56px rgba(0,0,0,.15)}.wp-core-ui.wp-admin .wcc-root .global-notices .notice .notice__icon-wrapper{border-radius:0}@media (min-width:661px){.wp-core-ui.wp-admin .wcc-root .global-notices .notice{display:flex;overflow:hidden;margin-bottom:24px;border-radius:3px}.wp-core-ui.wp-admin .wcc-root .global-notices .notice .notice__icon-wrapper{border-radius:3px 0 0 3px}}@media (min-width:661px){.wp-core-ui.wp-admin .wcc-root .global-notices .notice a.notice__action{font-size:14px;padding:13px 16px}}.wp-core-ui.wp-admin .wcc-root .global-notices .notice__dismiss{flex-shrink:0}@media (min-width:661px){.wp-core-ui.wp-admin .wcc-root .global-notices .notice__dismiss{padding:13px 16px 0}}.wp-core-ui.wp-admin .wcc-root .count{display:inline-block;padding:1px 6px;border:1px solid #b0b5b8;border-radius:12px;font-size:11px;font-weight:600;line-height:14px;color:#2b2d2f;text-align:center}.wp-core-ui.wp-admin .wcc-root .count.is-primary{color:#fff;border-color:#d52c82;background-color:#d52c82}.wp-core-ui.wp-admin .wcc-root .section-header.card{display:flex;align-items:center;padding-top:11px;padding-bottom:11px;position:relative;line-height:28px}.wp-core-ui.wp-admin .wcc-root .section-header.card:after{content:""}.wp-core-ui.wp-admin .wcc-root .section-header.card.is-empty .section-header__label:after{content:"\00a0"}.wp-core-ui.wp-admin .wcc-root .section-header__label{display:flex;align-items:center;flex-grow:1;position:relative;overflow:hidden}.wp-core-ui.wp-admin .wcc-root .section-header__label:before{content:"";display:block;position:absolute;-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;background:linear-gradient(90deg,hsla(0,0%,100%,0),#fff 90%);top:0;bottom:0;right:0;left:auto;width:20%;height:auto}.wp-core-ui.wp-admin .wcc-root .section-header__label .count{margin-left:8px}.wp-core-ui.wp-admin .wcc-root .section-header__actions{flex-grow:0;position:relative}.wp-core-ui.wp-admin .wcc-root .section-header__actions:after{content:".";display:block;height:0;width:0;clear:both;visibility:hidden;overflow:hidden}.wp-core-ui.wp-admin .wcc-root .section-header__label{color:#3d4145;font-size:14px}.wp-core-ui.wp-admin .wcc-root .section-header__actions .button{float:left;margin-right:8px}.wp-core-ui.wp-admin .wcc-root .section-header__actions>.button:last-child{margin-right:0}.wp-core-ui.wp-admin .wcc-root .form-select{background:#fff url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1LjUgNkwxNyA3LjVsLTYuNzUgNi43NUwzLjUgNy41IDUgNmw1LjI1IDUuMjVMMTUuNSA2eiIgZmlsbD0iI0M4RDdFMSIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+) no-repeat right 10px center;border-radius:4px;border:solid #ccced0;border-width:1px 1px 2px;color:#3d4145;cursor:pointer;display:inline-block;outline:0;overflow:hidden;font-size:16px;font-weight:400;line-height:1.4em;text-overflow:ellipsis;text-decoration:none;vertical-align:top;white-space:nowrap;box-sizing:border-box;padding:7px 32px 9px 14px;-webkit-appearance:none;appearance:none;margin:0 0 1em}.wp-core-ui.wp-admin .wcc-root .form-select:hover{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1LjUgNkwxNyA3LjVsLTYuNzUgNi43NUwzLjUgNy41IDUgNmw1LjI1IDUuMjVMMTUuNSA2eiIgZmlsbD0iI2E4YmVjZSIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.wp-core-ui.wp-admin .wcc-root .form-select:focus{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1LjUgNkwxNyA3LjVsLTYuNzUgNi43NUwzLjUgNy41IDUgNmw1LjI1IDUuMjVMMTUuNSA2eiIgZmlsbD0iIzJlNDQ1MyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+);border-color:#016087;box-shadow:0 0 0 2px #bbc9d5;outline:0;-moz-outline:none;-moz-user-focus:ignore}.wp-core-ui.wp-admin .wcc-root .form-select:disabled,.wp-core-ui.wp-admin .wcc-root .form-select:hover:disabled{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1LjUgNkwxNyA3LjVsLTYuNzUgNi43NUwzLjUgNy41IDUgNmw1LjI1IDUuMjVMMTUuNSA2eiIgZmlsbD0iI2U5ZWZmMyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+) no-repeat right 10px center}.wp-core-ui.wp-admin .wcc-root .form-select.is-compact{min-width:0;padding:0 20px 2px 6px;margin:0 4px;background-position:right 5px center;background-size:12px 12px}label+.wp-core-ui.wp-admin .wcc-root .form-select,label .wp-core-ui.wp-admin .wcc-root .form-select{display:block;min-width:200px}label+.wp-core-ui.wp-admin .wcc-root .form-select.is-compact,label .wp-core-ui.wp-admin .wcc-root .form-select.is-compact{display:inline-block;min-width:0}.wp-core-ui.wp-admin .wcc-root .form-select::-ms-expand{display:none}.wp-core-ui.wp-admin .wcc-root .form-select::-ms-value{background:none;color:#3d4145}.wp-core-ui.wp-admin .wcc-root .form-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #3d4145}.wp-core-ui.wp-admin .wcc-root .form-select.is-error{border-color:#eb0001}.wp-core-ui.wp-admin .wcc-root .form-select.is-error:hover{border-color:#ac120b}.wp-core-ui.wp-admin .wcc-root .form-select:disabled{color:#ccced0}.wp-core-ui.wp-admin .wcc-root .form-select:focus.is-error{box-shadow:0 0 0 2px #ffcfac}.wp-core-ui.wp-admin .wcc-root .form-select:focus.is-error:hover{box-shadow:0 0 0 2px #ffab78}.wp-core-ui.wp-admin .wcc-root .form-select:last-of-type,.wp-core-ui.wp-admin .wcc-root .form-select:only-of-type{margin-bottom:0}.wp-core-ui.wp-admin .wcc-root .payment-logo{background-position:0;background-repeat:no-repeat;background-size:35px auto;display:inline-block;height:20px;vertical-align:middle;width:35px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-alipay{background-image:url(/assets/images/payment-logos/alipay.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-apple-pay{background-image:url(/assets/images/payment-logos/apple-pay.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-bancontact{background-image:url(/assets/images/payment-logos/bancontact.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-giropay{background-image:url(/assets/images/payment-logos/giropay.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-eps{background-image:url(/assets/images/payment-logos/eps.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-ideal{background-image:url(/assets/images/payment-logos/ideal.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-netbanking{background-image:url(/assets/images/payment-logos/netbanking.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-paypal{background-image:url(/assets/images/payment-logos/paypal.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-p24{background-image:url(/assets/images/payment-logos/p24.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-brazil-tef{background-image:url(/assets/images/payment-logos/brazil-tef.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-wechat{background-image:url(/assets/images/payment-logos/wechat.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-sofort{background-image:url(/assets/images/payment-logos/sofort.svg)}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-amex,.wp-core-ui.wp-admin .wcc-root .payment-logo.is-diners,.wp-core-ui.wp-admin .wcc-root .payment-logo.is-discover,.wp-core-ui.wp-admin .wcc-root .payment-logo.is-jcb,.wp-core-ui.wp-admin .wcc-root .payment-logo.is-mastercard,.wp-core-ui.wp-admin .wcc-root .payment-logo.is-unionpay,.wp-core-ui.wp-admin .wcc-root .payment-logo.is-visa{background-size:30px 19px;width:30px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-paypal{background-size:70px;width:70px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-paypal.is-compact{width:16px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-ideal{height:30px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-giropay{background-size:60px auto;width:60px;height:20px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-bancontact{height:20px;background-size:100px auto;width:100px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-netbanking{width:90px;background-size:84px auto;margin-top:2px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-alipay,.wp-core-ui.wp-admin .wcc-root .payment-logo.is-p24{height:20px;background-size:70px auto;width:70px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-apple-pay{height:27px;background-size:42px auto;width:42px;margin-top:3px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-brazil-tef{background-size:100px auto;width:100px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-sofort{background-size:60px auto;width:80px;height:20px}.wp-core-ui.wp-admin .wcc-root .payment-logo.is-sofort.is-compact{width:16px}.wp-core-ui.wp-admin .wcc-root .payment-logo.disabled{filter:grayscale(100%)}.color-scheme.is-classic-blue{--color-accent:#d7730f;--color-accent-rgb:215,115,15;--color-accent-dark:#994b1f;--color-accent-dark-rgb:153,75,31;--color-accent-light:#eda268;--color-accent-light-rgb:237,162,104;--color-accent-0:#fef7f2;--color-accent-0-rgb:254,247,242;--color-accent-50:#fce4d5;--color-accent-50-rgb:252,228,213;--color-accent-100:#fad2b6;--color-accent-100-rgb:250,210,182;--color-accent-200:#f5ba8f;--color-accent-200-rgb:245,186,143;--color-accent-300:#eda268;--color-accent-300-rgb:237,162,104;--color-accent-400:#e38a40;--color-accent-400-rgb:227,138,64;--color-accent-500:#d7730f;--color-accent-500-rgb:215,115,15;--color-accent-600:#b95e1b;--color-accent-600-rgb:185,94,27;--color-accent-700:#994b1f;--color-accent-700-rgb:153,75,31;--color-accent-800:#79391f;--color-accent-800-rgb:121,57,31;--color-accent-900:#592a1b;--color-accent-900-rgb:89,42,27;--color-button-primary-background-hover:#e38a40;--sidebar-background:#e1e2e2;--sidebar-background-gradient:225,226,226;--sidebar-heading-color:#50575d;--sidebar-border-color:#ccced0;--sidebar-menu-a-first-child-after-background:225,226,226;--sidebar-menu-selected-background-color:#636d75;--sidebar-menu-selected-a-color:#fff;--sidebar-menu-selected-a-first-child-after-background:99,109,117;--sidebar-menu-hover-background:#fff;--sidebar-menu-hover-background-gradient:255,255,255;--sidebar-menu-hover-color:#016087;--profile-gravatar-user-secondary-info-color:#636d75}.color-scheme.is-powder-snow{--color-primary:#1a1a1a;--color-primary-rgb:26,26,26;--color-primary-light:#969ca1;--color-primary-light-rgb:150,156,161;--color-primary-dark:#3d4145;--color-primary-dark-rgb:61,65,69;--color-primary-0:#f3f5f6;--color-primary-0-rgb:246,246,246;--color-primary-50:#e1e2e2;--color-primary-50-rgb:225,226,226;--color-primary-100:#ccced0;--color-primary-100-rgb:204,206,208;--color-primary-200:#b0b5b8;--color-primary-200-rgb:176,181,184;--color-primary-300:#969ca1;--color-primary-300-rgb:150,156,161;--color-primary-400:#7c848b;--color-primary-400-rgb:124,132,139;--color-primary-500:#636d75;--color-primary-500-rgb:99,109,117;--color-primary-600:#50575d;--color-primary-600-rgb:80,87,93;--color-primary-700:#3d4145;--color-primary-700-rgb:61,65,69;--color-primary-800:#2b2d2f;--color-primary-800-rgb:43,45,47;--color-primary-900:#1a1a1a;--color-primary-900-rgb:26,26,26;--color-accent:#005fb7;--color-accent-rgb:0,95,183;--color-accent-dark:#183780;--color-accent-dark-rgb:24,55,128;--color-accent-light:#6795fe;--color-accent-light-rgb:103,149,254;--color-accent-0:#f5f9ff;--color-accent-0-rgb:245,249,255;--color-accent-50:#dbe8ff;--color-accent-50-rgb:219,232,255;--color-accent-100:#c1d7ff;--color-accent-100-rgb:193,215,255;--color-accent-200:#93b6ff;--color-accent-200-rgb:147,182,255;--color-accent-300:#6795fe;--color-accent-300-rgb:103,149,254;--color-accent-400:#3574f8;--color-accent-400-rgb:53,116,248;--color-accent-500:#005fb7;--color-accent-500-rgb:0,95,183;--color-accent-600:#144b9b;--color-accent-600-rgb:20,75,155;--color-accent-700:#183780;--color-accent-700-rgb:24,55,128;--color-accent-800:#162566;--color-accent-800-rgb:22,37,102;--color-accent-900:#10144d;--color-accent-900-rgb:16,20,77;--color-text:#1a1a1a;--color-text-subtle:#50575d;--color-surface:#fff;--color-surface-backdrop:#f6f6f6;--color-link:#005fb7;--color-link-rgb:0,95,183;--color-link-dark:#183780;--color-link-dark-rgb:24,55,128;--color-link-light:#6795fe;--color-link-light-rgb:103,149,254;--color-link-0:#f5f9ff;--color-link-0-rgb:245,249,255;--color-link-50:#dbe8ff;--color-link-50-rgb:219,232,255;--color-link-100:#c1d7ff;--color-link-100-rgb:193,215,255;--color-link-200:#93b6ff;--color-link-200-rgb:147,182,255;--color-link-300:#6795fe;--color-link-300-rgb:103,149,254;--color-link-400:#3574f8;--color-link-400-rgb:53,116,248;--color-link-500:#005fb7;--color-link-500-rgb:0,95,183;--color-link-600:#144b9b;--color-link-600-rgb:20,75,155;--color-link-700:#183780;--color-link-700-rgb:24,55,128;--color-link-800:#162566;--color-link-800-rgb:22,37,102;--color-link-900:#10144d;--color-link-900-rgb:16,20,77;--color-button-primary-background-hover:#3574f8;--color-button-primary-scary-background-hover:#ff4b1c;--sidebar-background:#e1e2e2;--sidebar-background-gradient:225,226,226;--sidebar-secondary-background:#fff;--sidebar-secondary-background-gradient:255,255,255;--sidebar-border-color:#ccced0;--sidebar-gridicon-fill:#636d75;--sidebar-heading-color:#1a1a1a;--sidebar-footer-button-color:#1a1a1a;--sidebar-menu-link-secondary-text-color:#636d75;--sidebar-menu-a-first-child-after-background:225,226,226;--sidebar-menu-selected-background-color:#50575d;--sidebar-menu-selected-a-color:#fff;--sidebar-menu-selected-a-first-child-after-background:80,87,93;--sidebar-menu-hover-background:#c1d7ff;--sidebar-menu-hover-background-gradient:193,215,255;--sidebar-menu-hover-color:#144b9b;--button-is-borderless-color:#636d75;--count-border-color:#636d75;--count-color:#636d75;--profile-gravatar-user-secondary-info-color:#50575d}.color-scheme.is-nightfall,.color-scheme.is-powder-snow{--masterbar-color:#fff;--masterbar-border-color:#3d4145;--masterbar-item-new-editor-background:#636d75;--masterbar-item-new-editor-hover-background:#7c848b;--masterbar-toggle-drafts-editor-background:#7c848b;--masterbar-toggle-drafts-editor-border-color:#ccced0;--masterbar-toggle-drafts-editor-hover-background:#7c848b}.color-scheme.is-nightfall{--color-primary:#1a1a1a;--color-primary-light:#969ca1;--color-primary-dark:#3d4145;--color-primary-rgb:26,26,26;--color-primary-0:#f6f6f6;--color-primary-0-rgb:246,246,246;--color-primary-50:#e1e2e2;--color-primary-50-rgb:225,226,226;--color-primary-100:#ccced0;--color-primary-100-rgb:204,206,208;--color-primary-200:#b0b5b8;--color-primary-200-rgb:176,181,184;--color-primary-300:#969ca1;--color-primary-300-rgb:150,156,161;--color-primary-400:#7c848b;--color-primary-400-rgb:124,132,139;--color-primary-500:#636d75;--color-primary-500-rgb:99,109,117;--color-primary-600:#50575d;--color-primary-600-rgb:80,87,93;--color-primary-700:#3d4145;--color-primary-700-rgb:61,65,69;--color-primary-800:#2b2d2f;--color-primary-800-rgb:43,45,47;--color-primary-900:#1a1a1a;--color-primary-900-rgb:26,26,26;--color-accent:#7c589f;--color-accent-rgb:124,88,159;--color-accent-dark:#4b3264;--color-accent-dark-rgb:75,50,100;--color-accent-light:#a88ebe;--color-accent-light-rgb:168,142,190;--color-accent-0:#f7f5f8;--color-accent-0-rgb:247,245,248;--color-accent-50:#e5deea;--color-accent-50-rgb:229,222,234;--color-accent-100:#d4c8de;--color-accent-100-rgb:212,200,222;--color-accent-200:#beabce;--color-accent-200-rgb:190,171,206;--color-accent-300:#a88ebe;--color-accent-300-rgb:168,142,190;--color-accent-400:#9273af;--color-accent-400-rgb:146,115,175;--color-accent-500:#7c589f;--color-accent-500-rgb:124,88,159;--color-accent-600:#634581;--color-accent-600-rgb:99,69,129;--color-accent-700:#4b3264;--color-accent-700-rgb:75,50,100;--color-accent-800:#342148;--color-accent-800-rgb:52,33,72;--color-accent-900:#1f112e;--color-accent-900-rgb:31,17,46;--color-text:#2b2d2f;--color-text-subtle:#636d75;--color-surface:#fff;--color-surface-backdrop:#f6f6f6;--color-link:#7c589f;--color-link-rgb:124,88,159;--color-link-dark:#4b3264;--color-link-dark-rgb:75,50,100;--color-link-light:#a88ebe;--color-link-light-rgb:168,142,190;--color-link-0:#f7f5f8;--color-link-0-rgb:247,245,248;--color-link-50:#e5deea;--color-link-50-rgb:229,222,234;--color-link-100:#d4c8de;--color-link-100-rgb:212,200,222;--color-link-200:#beabce;--color-link-200-rgb:190,171,206;--color-link-300:#a88ebe;--color-link-300-rgb:168,142,190;--color-link-400:#9273af;--color-link-400-rgb:146,115,175;--color-link-500:#7c589f;--color-link-500-rgb:124,88,159;--color-link-600:#634581;--color-link-600-rgb:99,69,129;--color-link-700:#4b3264;--color-link-700-rgb:75,50,100;--color-link-800:#342148;--color-link-800-rgb:52,33,72;--color-link-900:#1f112e;--color-link-900-rgb:31,17,46;--color-button-primary-background-hover:#9273af;--color-button-primary-scary-background-hover:#ff4b1c;--sidebar-background:#204a69;--sidebar-background-gradient:32,74,105;--sidebar-secondary-background:#fff;--sidebar-secondary-background-gradient:255,255,255;--sidebar-border-color:#23354b;--sidebar-text-color:#fff;--sidebar-gridicon-fill:#fff;--sidebar-heading-color:#b0b5b8;--sidebar-footer-button-color:#fff;--sidebar-menu-link-secondary-text-color:#fff;--sidebar-menu-a-first-child-after-background:32,74,105;--sidebar-menu-selected-background-color:#7e280e;--sidebar-menu-selected-a-color:#e1e2e2;--sidebar-menu-selected-a-first-child-after-background:126,40,14;--sidebar-menu-hover-background:#23354b;--sidebar-menu-hover-background-gradient:35,53,75;--sidebar-menu-hover-color:#e1e2e2;--button-is-borderless-color:#3d4145;--count-border-color:#3d4145;--count-color:#3d4145;--profile-gravatar-user-secondary-info-color:#e1e2e2}.color-scheme.is-sakura{--color-primary:#195d52;--color-primary-rgb:25,93,82;--color-primary-light:#438c7d;--color-primary-light-rgb:67,140,125;--color-primary-dark:#20473f;--color-primary-dark-rgb:32,71,63;--color-primary-0:#f3f6f5;--color-primary-0-rgb:243,246,245;--color-primary-50:#d8e3e0;--color-primary-50-rgb:216,227,224;--color-primary-100:#bad1cb;--color-primary-100-rgb:186,209,203;--color-primary-200:#93bab0;--color-primary-200-rgb:147,186,176;--color-primary-300:#6da296;--color-primary-300-rgb:109,162,150;--color-primary-400:#438c7d;--color-primary-400-rgb:67,140,125;--color-primary-500:#007565;--color-primary-500-rgb:0,117,101;--color-primary-600:#195d52;--color-primary-600-rgb:25,93,82;--color-primary-700:#20473f;--color-primary-700-rgb:32,71,63;--color-primary-800:#20312d;--color-primary-800-rgb:32,49,45;--color-primary-900:#1d1d1d;--color-primary-900-rgb:29,29,29;--color-accent:#005fb7;--color-accent-rgb:0,95,183;--color-accent-dark:#183780;--color-accent-dark-rgb:24,55,128;--color-accent-light:#6795fe;--color-accent-light-rgb:103,149,254;--color-accent-0:#f5f9ff;--color-accent-0-rgb:245,249,255;--color-accent-50:#dbe8ff;--color-accent-50-rgb:219,232,255;--color-accent-100:#c1d7ff;--color-accent-100-rgb:193,215,255;--color-accent-200:#93b6ff;--color-accent-200-rgb:147,182,255;--color-accent-300:#6795fe;--color-accent-300-rgb:103,149,254;--color-accent-400:#3574f8;--color-accent-400-rgb:53,116,248;--color-accent-500:#005fb7;--color-accent-500-rgb:0,95,183;--color-accent-600:#144b9b;--color-accent-600-rgb:20,75,155;--color-accent-700:#183780;--color-accent-700-rgb:24,55,128;--color-accent-800:#162566;--color-accent-800-rgb:22,37,102;--color-accent-900:#10144d;--color-accent-900-rgb:16,20,77;--color-text:#1a1a1a;--color-text-subtle:#50575d;--color-surface:#fff;--color-surface-backdrop:#f6f6f6;--color-link:#007565;--color-link-rgb:0,117,101;--color-link-dark:#20473f;--color-link-dark-rgb:32,71,63;--color-link-light:#6da296;--color-link-light-rgb:109,162,150;--color-link-0:#f3f6f5;--color-link-0-rgb:243,246,245;--color-link-50:#d8e3e0;--color-link-50-rgb:216,227,224;--color-link-100:#bad1cb;--color-link-100-rgb:186,209,203;--color-link-200:#93bab0;--color-link-200-rgb:147,186,176;--color-link-300:#6da296;--color-link-300-rgb:109,162,150;--color-link-400:#438c7d;--color-link-400-rgb:67,140,125;--color-link-500:#007565;--color-link-500-rgb:0,117,101;--color-link-600:#195d52;--color-link-600-rgb:25,93,82;--color-link-700:#20473f;--color-link-700-rgb:32,71,63;--color-link-800:#20312d;--color-link-800-rgb:32,49,45;--color-link-900:#1d1d1d;--color-link-900-rgb:29,29,29;--color-button-primary-background-hover:#3574f8;--color-button-primary-scary-background-hover:#ff4b1c;--masterbar-color:#fff;--masterbar-border-color:#20473f;--masterbar-item-new-editor-background:#636d75;--masterbar-item-new-editor-hover-background:#50575d;--masterbar-toggle-drafts-editor-background:#50575d;--masterbar-toggle-drafts-editor-border-color:#ccced0;--masterbar-toggle-drafts-editor-hover-background:#7c848b;--sidebar-background:#ebc6d5;--sidebar-background-gradient:235,198,213;--sidebar-secondary-background:#fff;--sidebar-secondary-background-gradient:255,255,255;--sidebar-border-color:#e1a7bf;--sidebar-text-color:#5d283d;--sidebar-gridicon-fill:#9b3c69;--sidebar-heading-color:#7b3252;--sidebar-footer-button-color:#1a1a1a;--sidebar-menu-link-secondary-text-color:#7b3252;--sidebar-menu-a-first-child-after-background:235,198,213;--sidebar-menu-selected-background-color:#dbe8ff;--sidebar-menu-selected-a-color:#144b9b;--sidebar-menu-selected-a-first-child-after-background:219,232,255;--sidebar-menu-hover-background:#c96895;--sidebar-menu-hover-background-gradient:201,104,149;--sidebar-menu-hover-color:#fff;--button-is-borderless-color:#636d75;--count-border-color:#636d75;--count-color:#636d75;--profile-gravatar-user-secondary-info-color:#7b3252}.color-scheme.is-laser-black{--color-primary:#005fb7;--color-primary-light:#3574f8;--color-primary-dark:#183780;--color-accent:#ff3997;--color-accent-light:#ffa2d4;--color-accent-dark:#b7266a;--color-white:#000;--color-white-rgb:0,0,0;--color-neutral:#636d75;--color-neutral-rgb:99,109,117;--color-neutral-dark:#3d4145;--color-neutral-dark-rgb:61,65,69;--color-neutral-light:#969ca1;--color-neutral-light-rgb:150,156,161;--color-neutral-0:#1a1a1a;--color-neutral-0-rgb:26,26,26;--color-neutral-50:#2b2d2f;--color-neutral-50-rgb:43,45,47;--color-neutral-100:#3d4145;--color-neutral-100-rgb:61,65,69;--color-neutral-200:#50575d;--color-neutral-200-rgb:80,87,93;--color-neutral-300:#636d75;--color-neutral-300-rgb:99,109,117;--color-neutral-400:#7c848b;--color-neutral-400-rgb:124,132,139;--color-neutral-500:#969ca1;--color-neutral-500-rgb:150,156,161;--color-neutral-600:#b0b5b8;--color-neutral-600-rgb:176,181,184;--color-neutral-700:#ccced0;--color-neutral-700-rgb:204,206,208;--color-neutral-800:#e1e2e2;--color-neutral-800-rgb:225,226,226;--color-neutral-900:#f6f6f6;--color-neutral-900-rgb:246,246,246;--color-success:#44a234;--color-success-light:#9dcf8d;--color-success-dark:#08720b;--color-warning:#f6c200;--color-warning-light:#fbe697;--color-warning-dark:#daaa12;--color-error:#ff4b1c;--color-error-light:#ffab78;--color-error-dark:#cb0c07;--color-text:#ccced0;--color-text-subtle:#969ca1;--color-surface:#000;--color-surface-backdrop:#1a1a1a;--color-surface-backdrop-rgb:26,26,26;--masterbar-color:#fff;--masterbar-border-color:#b0b5b8;--masterbar-item-new-editor-background:#636d75;--masterbar-item-new-editor-hover-background:#7c848b;--masterbar-toggle-drafts-editor-background:#7c848b;--masterbar-toggle-drafts-editor-border-color:#ccced0;--masterbar-toggle-drafts-editor-hover-background:#7c848b;--sidebar-background:#1a1a1a;--sidebar-background-gradient:26,26,26;--sidebar-secondary-background:#1a1a1a;--sidebar-secondary-background-gradient:26,26,26;--sidebar-text-color:#ccced0;--sidebar-gridicon-fill:#7c848b;--sidebar-heading-color:#7c848b;--sidebar-footer-button-color:#3d4145;--sidebar-menu-link-secondary-text-color:#3d4145;--sidebar-menu-a-first-child-after-background:26,26,26;--sidebar-menu-selected-background-color:#183780;--sidebar-menu-selected-a-color:#93b6ff;--sidebar-menu-selected-a-first-child-after-background:24,55,128;--sidebar-menu-hover-background:#3d4145;--sidebar-menu-hover-background-gradient:61,65,69;--sidebar-menu-hover-color:#ccced0;--profile-gravatar-user-secondary-info-color:#3d4145}.wp-core-ui.wp-admin .wcc-root .foldable-card.card{position:relative;transition:margin .15s linear;padding:0;border-radius:0}.wp-core-ui.wp-admin .wcc-root .foldable-card.card:after{content:".";display:block;height:0;width:0;clear:both;visibility:hidden;overflow:hidden}.wp-core-ui.wp-admin .wcc-root .foldable-card.card.is-expanded{margin:8px 0}.wp-core-ui.wp-admin .wcc-root .foldable-card__header{min-height:64px;width:100%;padding:16px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;position:relative}.wp-core-ui.wp-admin .wcc-root .foldable-card__header.is-clickable{cursor:pointer}.wp-core-ui.wp-admin .wcc-root .foldable-card__header.has-border .foldable-card__summary,.wp-core-ui.wp-admin .wcc-root .foldable-card__header.has-border .foldable-card__summary-expanded{margin-right:48px}.wp-core-ui.wp-admin .wcc-root .foldable-card__header.has-border .foldable-card__expand{border-left:1px solid #f6f6f6}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-compact .foldable-card__header{padding:8px 16px;min-height:40px}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-expanded .foldable-card__header{margin-bottom:0;height:inherit;min-height:64px}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-expanded.is-compact .foldable-card__header{min-height:40px}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-disabled .foldable-card__header{opacity:.2}.wp-core-ui.wp-admin .wcc-root .foldable-card__action{position:absolute;top:0;right:0;height:100%}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-expanded .foldable-card__action{height:100%}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-disabled .foldable-card__action{cursor:default}.wp-core-ui.wp-admin .wcc-root .accessible-focus .foldable-card__action:focus{outline:thin dotted}.wp-core-ui.wp-admin .wcc-root button.foldable-card__action{cursor:pointer}.wp-core-ui.wp-admin .wcc-root .foldable-card__main{max-width:calc(100% - 36px);display:flex;align-items:center;flex:2 1;margin-right:5px}@media (max-width:480px){.wp-core-ui.wp-admin .wcc-root .foldable-card__main{flex:1 1}}.wp-core-ui.wp-admin .wcc-root .foldable-card__secondary{display:flex;align-items:center;flex:1 1;justify-content:flex-end}@media (max-width:480px){.wp-core-ui.wp-admin .wcc-root .foldable-card__secondary{flex:0 1}}.wp-core-ui.wp-admin .wcc-root .foldable-card__expand{width:48px}.wp-core-ui.wp-admin .wcc-root .foldable-card__expand .gridicon{fill:#969ca1;display:flex;align-items:center;width:100%;vertical-align:middle;transition:transform .15s cubic-bezier(.175,.885,.32,1.275),color .2s ease-in}.wp-core-ui.wp-admin .wcc-root .foldable-card__expand .gridicon:hover{fill:#969ca1}.wp-core-ui.wp-admin .wcc-root .foldable-card__expand:hover .gridicon{fill:#636d75}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-expanded .foldable-card__expand .gridicon{transform:rotate(180deg)}.wp-core-ui.wp-admin .wcc-root .foldable-card__content{display:none}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-expanded .foldable-card__content{display:block;padding:16px;border-top:1px solid #f6f6f6}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-compact .foldable-card.is-expanded .foldable-card__content{padding:8px}.wp-core-ui.wp-admin .wcc-root .foldable-card__summary,.wp-core-ui.wp-admin .wcc-root .foldable-card__summary-expanded{margin-right:40px;color:#636d75;font-size:12px;transition:opacity .2s linear;display:inline-block}@media (max-width:480px){.wp-core-ui.wp-admin .wcc-root .foldable-card__summary,.wp-core-ui.wp-admin .wcc-root .foldable-card__summary-expanded{display:none}}.wp-core-ui.wp-admin .wcc-root .foldable-card.has-expanded-summary .foldable-card__summary,.wp-core-ui.wp-admin .wcc-root .foldable-card.has-expanded-summary .foldable-card__summary-expanded{transition:none;flex:2;text-align:right}.wp-core-ui.wp-admin .wcc-root .foldable-card__summary{opacity:1;display:inline-block}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-expanded .foldable-card__summary,.wp-core-ui.wp-admin .wcc-root .foldable-card__summary-expanded,.wp-core-ui.wp-admin .wcc-root .has-expanded-summary .foldable-card.is-expanded .foldable-card__summary{display:none}.wp-core-ui.wp-admin .wcc-root .foldable-card.is-expanded .foldable-card__summary-expanded{display:inline-block}"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[5396],{94971:(e,t,a)=>{a.r(t),a.d(t,{default:()=>g});var n=a(69307),o=a(65736),s=a(9818),c=a(22629),i=a(55609),m=a(86020),r=a(14812),l=a(67221),d=a(14599),_=a(72672),u=a(37942),p=a(70481),y=a(92962);const w=document.querySelector('[data-gateway_id="pre_install_woocommerce_payments_promotion"]'),g=()=>{const[e,t]=(0,n.useState)(null),[a,g]=(0,n.useState)(!1),[E,h]=(0,n.useState)(!1),{installAndActivatePlugins:v,dismissRecommendedPlugins:A}=(0,s.useDispatch)(l.PLUGINS_STORE_NAME),{createNotice:N}=(0,s.useDispatch)("core/notices"),{installedPaymentGateway:S,installedPaymentGateways:T,paymentGatewaySuggestions:G,isResolving:f}=(0,s.useSelect)((t=>{const a=E&&(0,p.V7)(e);return{installedPaymentGateway:a&&t(l.PAYMENT_GATEWAYS_STORE_NAME).getPaymentGateway(a),installedPaymentGateways:t(l.PAYMENT_GATEWAYS_STORE_NAME).getPaymentGateways().reduce(((e,t)=>(a===t.id||(e[t.id]=!0),e)),{}),isResolving:t(l.ONBOARDING_STORE_NAME).isResolving("getPaymentGatewaySuggestions"),paymentGatewaySuggestions:t(l.ONBOARDING_STORE_NAME).getPaymentGatewaySuggestions()}}),[E]),P=(0,n.useRef)(!1),R=G&&G.length>0&&!(0,y.j)(G)&&!a;if((0,n.useEffect)((()=>{if((R||w&&!f)&&!P.current){P.current=!0;const e=(G||[]).reduce(((e,t)=>t.plugins&&t.plugins.length>0?{...e,[t.plugins[0].replace(/\-/g,"_")+"_displayed"]:!0}:e),{woocommerce_payments_displayed:!!w});(0,d.recordEvent)("settings_payments_recommendations_pageview",e)}}),[R,w,f]),(0,n.useEffect)((()=>{S&&(window.location.href=S.settings_url)}),[S]),!R)return null;const b=async()=>{g(!0),(0,d.recordEvent)("settings_payments_recommendations_dismiss",{}),await A("payments")||(g(!1),N("error",(0,o.__)('There was a problem hiding the "Additional ways to get paid" card.',"woocommerce")))},k=(G||[]).filter((e=>!T[e.id]&&e.plugins?.length&&(!window.wcAdminFeatures["wc-pay-promotion"]||!e.id.startsWith("woocommerce_payments")))).map((a=>({key:a.id,title:(0,n.createElement)(n.Fragment,null,a.title,a.recommended&&(0,n.createElement)(m.Pill,null,(0,o.__)("Recommended","woocommerce"))),content:(0,c.decodeEntities)(a.content),after:(0,n.createElement)(i.Button,{isSecondary:!0,onClick:()=>(a=>{e||(t(a.id),(0,d.recordEvent)("settings_payments_recommendations_setup",{extension_selected:a.plugins[0]}),v([a.plugins[0]]).then((()=>{h(!0)})).catch((e=>{(0,u.a)(e),t(null)})))})(a),isBusy:e===a.id,disabled:!!e},a.actionText||(0,o.__)("Get started","woocommerce")),before:(0,n.createElement)("img",{src:a.square_image||a.image,alt:""})})));return(0,n.createElement)(i.Card,{size:"medium",className:"woocommerce-recommended-payments-card"},(0,n.createElement)(i.CardHeader,null,(0,n.createElement)("div",{className:"woocommerce-recommended-payments-card__header"},(0,n.createElement)(r.Text,{variant:"title.small",as:"p",size:"20",lineHeight:"28px"},(0,o.__)("Recommended payment providers","woocommerce")),(0,n.createElement)(r.Text,{className:"woocommerce-recommended-payments__header-heading",variant:"caption",as:"p",size:"12",lineHeight:"16px"},(0,o.__)('We recommend adding one of the following payment extensions to your store. The extension will be installed and activated for you when you click "Get started".',"woocommerce"))),(0,n.createElement)("div",{className:"woocommerce-card__menu woocommerce-card__header-item"},(0,n.createElement)(m.EllipsisMenu,{label:(0,o.__)("Task List Options","woocommerce"),renderContent:()=>(0,n.createElement)("div",{className:"woocommerce-review-activity-card__section-controls"},(0,n.createElement)(i.Button,{onClick:b},(0,o.__)("Hide this","woocommerce")))}))),(0,n.createElement)(m.List,{items:k}),(0,n.createElement)(i.CardFooter,null,(0,n.createElement)(i.Button,{href:"https://woocommerce.com/product-category/woocommerce-extensions/payment-gateways/?utm_source=payments_recommendations",target:"_blank",isTertiary:!0},(0,o.__)("Discover other payment providers","woocommerce"),(0,n.createElement)(_.Z,{size:18}))))}}}]);.decorator { width: 100vw; max-width: 500px; min-height: 250px; position: relative; } import{r as i,h as o,H as r}from"./p-cc7ce8c7.js";import{g as t}from"./p-09601e06.js";import{s as e,r as l}from"./p-8266bbed.js";import{c as n}from"./p-a27e9b70.js";import{o as s}from"./p-c27fae79.js";import"./p-830ab1a3.js";import"./p-25433d0f.js";import"./p-f70181c4.js";const a=":host{display:block}ul{margin:6px 0px;padding:0px;list-style:none}";const d=class{constructor(o){i(this,o);this.removeStateListener=()=>{}}getAlertType(){switch(e===null||e===void 0?void 0:e.type){case"error":return"danger";case"default":return"primary";default:return e===null||e===void 0?void 0:e.type}}componentWillLoad(){this.removeStateListener=s("formState",(()=>{if(["finalizing","updating"].includes(n())){l()}}))}disconnectedCallback(){this.removeStateListener()}getTopLevelError(){var i;if((e===null||e===void 0?void 0:e.code)==="checkout.invalid"&&((i=t())===null||i===void 0?void 0:i.length)){return""}return e===null||e===void 0?void 0:e.message}render(){if(!(e===null||e===void 0?void 0:e.message)||["finalizing","updating"].includes(n())){return o(r,{style:{display:"none"}})}return o(r,null,o("sc-alert",{type:this.getAlertType(),scrollOnOpen:true,open:!!(e===null||e===void 0?void 0:e.message),closable:!!(e===null||e===void 0?void 0:e.dismissible)},!!this.getTopLevelError()&&o("span",{slot:"title",innerHTML:this.getTopLevelError()}),(t()||[]).map(((i,r)=>o("div",{innerHTML:i,key:r})))),o("slot",null))}};d.style=a;export{d as sc_checkout_form_errors}; //# sourceMappingURL=p-64494b56.entry.js.mapimport '@presto-player/components/loader';window.jetpackModules = window.jetpackModules || {}; window.jetpackModules.models = ( function( window, $, _, Backbone ) { 'use strict'; var models = {}; models.Modules = Backbone.Model.extend( { visibles: {}, /** * Updates modules.items dataset to be a reflection of both the current * modules.raw data, as well as any filters or sorting that may be in effect. */ filter_and_sort: function() { var subsubsub = $( '.subsubsub .current' ), items = this.get( 'raw' ), m_filter = $( '.button-group.filter-active .active' ), m_sort = $( '.button-group.sort .active' ), m_search = $( '#srch-term-search-input' ) .val() .toLowerCase(), groups; // If a module filter has been selected, filter it! if ( ! subsubsub.closest( 'li' ).hasClass( 'all' ) ) { items = _.filter( items, function( item ) { return _.contains( item.module_tags, subsubsub.data( 'title' ) ); } ); } if ( m_filter.data( 'filter-by' ) ) { items = _.filter( items, function( item ) { return item[ m_filter.data( 'filter-by' ) ] === m_filter.data( 'filter-value' ); } ); } if ( m_search.length ) { items = _.filter( items, function( item ) { var search_text = item.name + ' ' + item.description + ' ' + item.long_description + ' ' + item.search_terms + ' ' + item.module_tags; return -1 !== search_text.toLowerCase().indexOf( m_search ); } ); } if ( m_sort.data( 'sort-by' ) ) { items = _.sortBy( items, m_sort.data( 'sort-by' ) ); if ( 'reverse' === m_sort.data( 'sort-order' ) ) { items.reverse(); } } // Sort unavailable modules to the end if the user is running in local mode. groups = _.groupBy( items, 'available' ); if ( _.has( groups, 'false' ) ) { items = [].concat( groups[ true ], groups[ false ] ); } // Now shove it back in. this.set( 'items', items ); return this; }, initialize: function() { var items = this.get( 'items' ); this.set( 'raw', items ); }, } ); return models; } )( window, jQuery, _, Backbone ); /** * External dependencies */ import TestRenderer, { act } from 'react-test-renderer'; import { createRegistry, RegistryProvider } from '@wordpress/data'; import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data'; /** * Internal dependencies */ import * as mockUseStoreCart from '../use-store-cart'; import { useStoreCartItemQuantity } from '../use-store-cart-item-quantity'; jest.mock( '../use-store-cart', () => ( { useStoreCart: jest.fn(), } ) ); jest.mock( '@woocommerce/block-data', () => ( { __esModule: true, CART_STORE_KEY: 'test/store', } ) ); // Make debounce instantaneous. jest.mock( 'use-debounce', () => ( { useDebounce: ( a ) => [ a ], } ) ); describe( 'useStoreCartItemQuantity', () => { let registry, renderer; const getWrappedComponents = ( Component ) => ( ); const getTestComponent = ( options ) => () => { const props = useStoreCartItemQuantity( options ); return
    ; }; let mockRemoveItemFromCart; let mockChangeCartItemQuantity; const setupMocks = ( { isPendingDelete, isPendingQuantity } ) => { mockRemoveItemFromCart = jest .fn() .mockReturnValue( { type: 'removeItemFromCartAction' } ); mockChangeCartItemQuantity = jest .fn() .mockReturnValue( { type: 'changeCartItemQuantityAction' } ); registry.registerStore( storeKey, { reducer: () => ( {} ), actions: { removeItemFromCart: mockRemoveItemFromCart, changeCartItemQuantity: mockChangeCartItemQuantity, }, selectors: { isItemPendingDelete: jest .fn() .mockReturnValue( isPendingDelete ), isItemPendingQuantity: jest .fn() .mockReturnValue( isPendingQuantity ), }, } ); }; beforeEach( () => { registry = createRegistry(); renderer = null; } ); afterEach( () => { mockRemoveItemFromCart.mockReset(); mockChangeCartItemQuantity.mockReset(); } ); describe( 'with no errors and not pending', () => { beforeEach( () => { setupMocks( { isPendingDelete: false, isPendingQuantity: false } ); mockUseStoreCart.useStoreCart.mockReturnValue( { cartErrors: {}, } ); } ); it( 'update quantity value should happen instantly', () => { const TestComponent = getTestComponent( { key: '123', quantity: 1, } ); act( () => { renderer = TestRenderer.create( getWrappedComponents( TestComponent ) ); } ); const { setItemQuantity, quantity } = renderer.root.findByType( 'div' ).props; //eslint-disable-line testing-library/await-async-query expect( quantity ).toBe( 1 ); act( () => { setItemQuantity( 2 ); } ); const { quantity: newQuantity } = renderer.root.findByType( 'div' ).props; //eslint-disable-line testing-library/await-async-query expect( newQuantity ).toBe( 2 ); } ); it( 'removeItem should call the dispatch action', () => { const TestComponent = getTestComponent( { key: '123', quantity: 1, } ); act( () => { renderer = TestRenderer.create( getWrappedComponents( TestComponent ) ); } ); const { removeItem } = renderer.root.findByType( 'div' ).props; //eslint-disable-line testing-library/await-async-query act( () => { removeItem(); } ); expect( mockRemoveItemFromCart ).toHaveBeenCalledWith( '123' ); } ); it( 'setItemQuantity should call the dispatch action', () => { const TestComponent = getTestComponent( { key: '123', quantity: 1, } ); act( () => { renderer = TestRenderer.create( getWrappedComponents( TestComponent ) ); } ); const { setItemQuantity } = renderer.root.findByType( 'div' ).props; //eslint-disable-line testing-library/await-async-query act( () => { setItemQuantity( 2 ); } ); expect( mockChangeCartItemQuantity.mock.calls ).toEqual( [ [ '123', 2 ], ] ); } ); } ); it( 'should expose store errors', () => { const mockCartErrors = [ { message: 'Test error' } ]; setupMocks( { isPendingDelete: false, isPendingQuantity: false, } ); mockUseStoreCart.useStoreCart.mockReturnValue( { cartErrors: mockCartErrors, } ); const TestComponent = getTestComponent( { key: '123', quantity: 1, } ); act( () => { renderer = TestRenderer.create( getWrappedComponents( TestComponent ) ); } ); const { cartItemQuantityErrors } = renderer.root.findByType( 'div' ).props; //eslint-disable-line testing-library/await-async-query expect( cartItemQuantityErrors ).toEqual( mockCartErrors ); } ); it( 'isPendingDelete should depend on the value provided by the store', () => { setupMocks( { isPendingDelete: true, isPendingQuantity: false, } ); mockUseStoreCart.useStoreCart.mockReturnValue( { cartErrors: {}, } ); const TestComponent = getTestComponent( { key: '123', quantity: 1, } ); act( () => { renderer = TestRenderer.create( getWrappedComponents( TestComponent ) ); } ); const { isPendingDelete } = renderer.root.findByType( 'div' ).props; //eslint-disable-line testing-library/await-async-query expect( isPendingDelete ).toBe( true ); } ); } ); /*! elementor - v3.29.0 - 04-06-2025 */ "use strict"; (self["webpackChunkelementorFrontend"] = self["webpackChunkelementorFrontend"] || []).push([["text-editor"],{ /***/ "../assets/dev/js/frontend/handlers/text-editor.js": /*!*********************************************************!*\ !*** ../assets/dev/js/frontend/handlers/text-editor.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); __webpack_require__(/*! core-js/modules/esnext.iterator.find.js */ "../node_modules/core-js/modules/esnext.iterator.find.js"); class TextEditor extends elementorModules.frontend.handlers.Base { getDefaultSettings() { return { selectors: { paragraph: 'p:first' }, classes: { dropCap: 'elementor-drop-cap', dropCapLetter: 'elementor-drop-cap-letter' } }; } getDefaultElements() { const selectors = this.getSettings('selectors'), classes = this.getSettings('classes'), $dropCap = jQuery('', { class: classes.dropCap }), $dropCapLetter = jQuery('', { class: classes.dropCapLetter }); $dropCap.append($dropCapLetter); return { $paragraph: this.$element.find(selectors.paragraph), $dropCap, $dropCapLetter }; } wrapDropCap() { const isDropCapEnabled = this.getElementSettings('drop_cap'); if (!isDropCapEnabled) { // If there is an old drop cap inside the paragraph if (this.dropCapLetter) { this.elements.$dropCap.remove(); this.elements.$paragraph.prepend(this.dropCapLetter); this.dropCapLetter = ''; } return; } const $paragraph = this.elements.$paragraph; if (!$paragraph.length) { return; } const paragraphContent = $paragraph.html().replace(/ /g, ' '), firstLetterMatch = paragraphContent.match(/^ *([^ ] ?)/); if (!firstLetterMatch) { return; } const firstLetter = firstLetterMatch[1], trimmedFirstLetter = firstLetter.trim(); // Don't apply drop cap when the content starting with an HTML tag if ('<' === trimmedFirstLetter) { return; } this.dropCapLetter = firstLetter; this.elements.$dropCapLetter.text(trimmedFirstLetter); const restoredParagraphContent = paragraphContent.slice(firstLetter.length).replace(/^ */, match => { return new Array(match.length + 1).join(' '); }); $paragraph.html(restoredParagraphContent).prepend(this.elements.$dropCap); } onInit() { super.onInit(...arguments); this.wrapDropCap(); } onElementChange(propertyName) { if ('drop_cap' === propertyName) { this.wrapDropCap(); } } } exports["default"] = TextEditor; /***/ }) }]); //# sourceMappingURL=text-editor.bd4eccbd156d0b1fc3cf.bundle.js.map( function ( $ ) { 'use strict'; var cssNudge = { init: function () { this.clickifyNavigateToButtons(); }, clickifyNavigateToButtons: function () { var navButton = document.querySelector( '.navigate-to' ); if ( ! navButton ) { return; } navButton.addEventListener( 'click', function () { // Get destination. var destination = this.getAttribute( 'data-navigate-to-page' ); if ( ! destination ) { return; } // Fire Tracks click event. window._tkq = window._tkq || []; window._tkq.push( [ 'recordEvent', 'calypso_upgrade_nudge_cta_click', { cta_name: 'customizer_css', }, ] ); // Navigate to a different page. if ( window.location.search.match( /calypso=true/ ) && window.parent.location !== window.location ) { // Calypso. window.top.postMessage( JSON.stringify( { calypso: true, command: 'navigateTo', destination: destination, } ), '*' ); } else { // Non-Calypso. window.location = 'https://wordpress.com' + destination; } } ); }, }; $( document ).ready( function () { cssNudge.init(); } ); } )( jQuery ); {"0":[null,"0"],"":{"po-revision-date":"2022-06-22 04:55:23+0000","mime-version":"1.0","content-type":"text/plain; charset=UTF-8","content-transfer-encoding":"8bit","plural-forms":"nplurals=2; plural=n != 1;","x-generator":"GlotPress/4.0.0-alpha.1","language":"es","project-id-version":"Plugins - WooCommerce Shipping & Tax - Stable (latest release)"},"One of the address data has non-roman character(s) that might not be printed properly!":[null,"¡Uno de los datos de la dirección tiene caracteres no romanos que podrían no imprimirse correctamente!"],"Successfully deleted %1$d transients from the database.":[null,"Borrados correctamente %1$d datos transitorios de la base de datos."],"Deletes the all the transients in your database that represent cached Tax Rates responses":[null,"Borra todos los datos transitorios en tu base de datos que representen a respuestas de tasas de impuestos en caché"],"Delete cached Tax transients":[null,"Borrar datos transitorios de impuestos en caché"],"Delete WooCommerce Tax cached tax rate responses":[null,"Borrar respuestas de tasas de impuestos en caché de impuestos de WooCommerce"],"Successfully deleted %1$d rows from the database.":[null,"Borrada(s) correctamente %1$d fila(s) de la base de datos."],"No \"CA\" tax rates were found.":[null,"No se han encontrado tasas de impuestos de «CA»."],"ERROR: The \"CA\" tax rate deletion process was cancelled because the existing tax rates could not be backed up.":[null,"ERROR: Se ha cancelado el proceso de borrado de la tasa de impuestos de «CA» porque no se ha podido hacer copia de seguridad de las tasas de impuestos existentes."],"Additional information.":[null,"Información adicional."],"A backup CSV of all existing tax rates will be made before the deletion process runs.":[null,"Antes de que se ejecute el proceso de borrado, se hará una copia de seguridad en CSV de todas las tasas de impuestos existentes."],"This option will delete ALL of your \"CA\" tax rates where the tax name ends with \" Tax\" (case insensitive).":[null,"Esta opción borrará TODAS tus tasas de impuestos de «CA» donde el nombre del impuesto termine en «Impuesto» (sin distinguir mayúsculas y minúsculas)"],"Note:":[null,"Nota:"],"Delete CA tax rates":[null,"Borrar las tasas de impuestos de CA"],"Delete California tax rates":[null,"Borrar las tasas de impuestos de California"],"Enabling this option overrides any tax rates you have manually added.":[null,"Activando esta opción, se anula cualquier tasa de impuestos que hayas añadido manualmente."],"Automated taxes documentation":[null,"Documentación sobre impuestos automáticos"],"Go to General settings":[null,"Ir a los ajustes generales"],"Go to the Tax settings":[null,"Ir a los ajustes de impuestos"],"Automated Taxes":[null,"Impuestos automáticos"],"Automated taxes are enabled":[null,"Los impuestos automáticos están activos"],"The automated taxes functionality is disabled. Enable the \"Automated taxes\" setting on the WooCommerce settings page":[null,"La funcionalidad de impuestos automáticos está desactivada. Activa el ajuste de «Impuestos automáticos» en la página de ajustes de WooCommerce"],"The core WooCommerce taxes functionality is disabled. Please ensure the \"Enable tax rates and calculations\" setting is turned \"on\" in the WooCommerce settings page":[null,"La funcionalidad de impuestos del núcleo de WooCommerce está desactivada. Por favor, asegúrate de que el ajuste de «Activar las tasas de impuestos y sus cálculos» esté «activado» en la página de ajustes de WooCommerce"],"TaxJar extension detected. Automated taxes functionality is disabled":[null,"Extensión TaxJar detectada. La funcionalidad de impuestos automáticos está desactivada"],"Your store's country (%s) is not supported. Automated taxes functionality is disabled":[null,"No es compatible con el país de tu tienda (%s). La funcionalidad de impuestos automáticos está desactivada "],"Features":[null,"Características"],"Carrier":[null,"Transportista"],"Express delivery from the experts in international shipping":[null,"Entrega exprés de los expertos en envíos internacionales"],"Live rates for %(carrierName)s at checkout":[null,"Tarifas en vivo de %(carrierName)s al finalizar la compra"],"Ship with the largest delivery network in the United States":[null,"Envía con la mayor red de entrega de Estados Unidos"],"Discounted %(carrierName)s shipping labels":[null,"Etiquetas de envío con descuento de %(carrierName)s"],"To be displayed at checkout, this carrier must be added as a shipping method to selected shipping zones":[null,"Para que se muestre al finalizar la compra, este transportista tiene que ser añadido como método de envío a las zonas de envío seleccionadas"],"Add to shipping zones":[null,"Añadir a las zonas de envío"],"Show live rates directly on your store - never under or overcharge for shipping again":[null,"Muestra las tarifas en vivo directamente en tu tienda - nunca vuelvas a cobrar de menos o de más en el envío"],"Live rates at checkout":[null,"Tarifas en vivo al finalizar la compra"],"Last updated %s.":[null,"Última actualización %s."],"At least one of the new predefined packages has the same name as existing packages.":[null,"Al menos uno de los nuevos paquetes predefinidos tiene el mismo nombre que los paquetes existentes."],"The new predefined package names are not unique.":[null,"Los nombres del paquete predefinido no son únicos."],"At least one of the new custom packages has the same name as existing packages.":[null,"Al menos uno de los nuevos paquetes personalizados tiene el mismo nombre que los paquetes existentes."],"The new custom package names are not unique.":[null,"Los nombres del nuevo paquete personalizado no son únicos."],"Go to shipping zones":[null,"Ir a las zonas de envío"],"Add DHL Express as a shipping method to selected shipping zones to display live rates at checkout.":[null,"Añade DHL Express como un método de envío para zonas de envío seleccionadas para mostrar las tarifas en vivo al finalizar la compra."],"DHL Express live rates are now available":[null,"Ahora están disponibles las tarifas en vivo de DHL Express"],"State %1$s is invalid for %2$s.":[null,"La provincia %1$s no es válida para %2$s."],"%1$s %2$s is invalid for %3$s.":[null,"%1$s %2$s no es válido para %3$s."],"A %1$s is required for %2$s.":[null,"Se necesita un %1$s para %2$s."],"A country is required":[null,"Se necesita un país"],"Your store is over the limit for rate calls this month and your account will be charged for overages. To prevent future overage charges you can upgrade your plan.":[null,"Tu tienda ha superado este mes el límite para la tarifa de llamadas y se cobrará el exceso en tu cuenta. Para evitar futuros cargos por exceso, puedes actualizar tu plan."],"There was an error trying to activate your subscription.":[null,"Ha habido un error al intentar activar tu suscripción."],"Your subscription was succesfully activated.":[null,"Tu suscripción se ha activado correctamente."],"Manage":[null,"Gestionar"],"Usage":[null,"Uso"],"View and manage your subscription usage":[null,"Ver y gestionar el uso de tu suscripción"],"Shipping method":[null,"Método de envío"],"The subscription is already active.":[null,"La suscripción ya está activa."],"Set up your own carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.":[null,"Configura tu propia cuenta de transportista para comparar tarifas e imprimir etiquetas de varios transportistas en WooCommerce Shipping. Aprende más sobre cómo añadir {{a}}cuentas de transportista{{{/a}}."],"There was an error connecting to your %(carrierName)s account. Please check that all of the information entered matches your %(carrierName)s account and try to connect again.":[null,"Ha habido un error al conectar con tu cuenta %(carrierName)s. Por favor, comprueba que toda la información introducida coincide con la de tu cuenta %(carrierName)s e intenta conectar de nuevo."],"Your carrier account was connected successfully.":[null,"Tu cuenta de transportista ha sido conectada correctamente."],"The date must be a valid date in the format YYYY-MM-DD":[null,"La fecha debe ser una fecha válida en el formato AAAA-MM-DD"],"The invoice number needs to be 9 or 13 letters and digits in length":[null,"El número de la factura tiene que ser de 9 o 13 letras y dígitos de longitud"],"The company website format is not valid":[null,"El formato de la web de la empresa no es válido"],"The email format is not valid":[null,"El formato del correo electrónico no es válido"],"The ZIP/Postal code needs to be 5 digits in length":[null,"El código postal tiene que ser de 5 dígitos de longitud"],"The phone number needs to be 10 digits in length":[null,"El número de teléfono tiene que ser de 10 dígitos de longitud"],"The UPS account number needs to be 6 letters and digits in length":[null,"El número de la cuenta de UPS tiene que ser de 6 letras y dígitos de longitud"],"This will remove the connection with %(carrier_name)s. All of your %(carrier_name)s account information will be deleted and you won\\u2019t see %(carrier_name)s rates.":[null,"Esto eliminará la conexión con %(carrier_name)s. Toda la información de tu cuenta %(carrier_name)s será borrada y no verás las tarifas de %(carrier_name)s."],"Disconnect your %(carrier_name)s account":[null,"Desconectar tu cuenta %(carrier_name)s"],"There was an error trying to disconnect your carrier account":[null,"Ha habido un error al intentar desconectar tu cuenta de transportista"],"Your carrier account was disconnected succesfully.":[null,"Tu cuenta de transportista ha sido desconectada correctamente."],"DHL Express":[null,"DHL Express"],"Powered by WooCommerce Tax. If automated taxes are enabled, you'll need to enter prices exclusive of tax.":[null,"Funciona con WooCommerce Tax. Si están activados los impuestos automáticos, tendrás que introducir los precios sin impuestos."],"WooCommerce Helper auth is missing":[null,"Falta la identificación de WooCommerce Helper"],"USPS labels without tracking are not eligible for refund.":[null,"Las etiquetas de USPS sin seguimiento no son elegibles para reembolso."],"General Information":[null,"Información general"],"Connect your %(carrierName)s account":[null,"Conecta tu cuenta de %(carrierName)s"],"%(carrierName)s not supported.":[null,"%(carrierName)s no es compatible."],"Loading":[null,"Cargando"],"WooCommerce Shipping & Tax Data":[null,"WooCommerce Shipping & Tax Data"],"Print customs form":[null,"Imprimir impreso de aduanas"],"Test your WooCommerce Shipping & Tax connection":[null,"Prueba tu conexión a WooCommerce Shipping & Tax"],"WooCommerce Shipping & Tax Status":[null,"Estado de WooCommerce Shipping & Tax"],"Connect your store to activate WooCommerce Shipping & Tax":[null,"Conecta tu tienda para usar WooCommerce Shipping & Tax"],"Connect Jetpack to activate WooCommerce Shipping & Tax":[null,"Conecta Jetpack para activar WooCommerce Shipping & Tax"],"WooCommerce Shipping now supports DHL labels for international shipments. Purchase and print discounted labels from DHL and USPS right here.":[null,"WooCommerce Shipping ahora es compatible con la etiquetas de DHL para envíos internacionales. Compra desde aquí etiquetas de DHL y USPS."],"Discounted DHL Shipping Labels":[null,"Discounted DHL Shipping Labels"],"WooCommerce Shipping":[null,"WooCommerce Shipping"],"Invalid WooCommerce Shipping & Tax service slug provided":[null,"Slug de servicio de WooCommerce Shipping & Tax no válido proporcionado"],"WooCommerce Shipping & Tax":[null,"WooCommerce Shipping & Tax"],"ZIP/Postal code":[null,"Código postal"],"This action will delete any information entered on the form.":[null,"Esta acción borrará cualquier información introducida en el formulario."],"Cancel connection":[null,"Cancelar conexión"],"Ok":[null,"Aceptar"],"UPS invoice control id":[null,"ID de control de factura de UPS"],"UPS invoice currency":[null,"Moneda de factura de UPS"],"UPS invoice amount":[null,"Cantidad de factura de UPS"],"UPS invoice date":[null,"Fecha de factura de UPS"],"UPS invoice number":[null,"Número de factura de UPS"],"I have been issued an invoice from UPS within the past 90 days":[null,"Se me ha emitido una factura de UPS en los últimos 90 días."],"UPS account information":[null,"Información de cuenta de UPS"],"Company website":[null,"Web de la empresa"],"Job title":[null,"Título profesional"],"Company name":[null,"Nombre de la empresa"],"This is the company info you used to create your UPS account":[null,"Esta es la información de la empresa que utilizaste para crear tu cuenta UPS"],"Company information":[null,"Información de la empresa"],"Email":[null,"Correo electrónico"],"Address 2 (optional)":[null,"Dirección 2 (opcional)"],"Account number":[null,"Número de cuenta"],"This is the account number and address from your UPS profile":[null,"Este es el número de cuenta y dirección de tu perfil de UPS"],"General information":[null,"Información general"],"If you need a UPS account number, go to {{a}}UPS.com{{/a}} to create a new account.":[null,"Si necesitas un número de cuenta de UPS ve a {{a}}UPS.com{{/a}} para crear una nueva cuenta."],"Set up your own UPS carrier account to compare rates and print labels from multiple carriers in WooCommerce Shipping. Learn more about adding {{a}}carrier accounts{{/a}}.":[null,"Configura tu propia cuenta de transportista de UPS para comparar tarifas e imprimir etiquetas de varios transportistas en WooCommerce Shipping. Aprende más sobre cómo añadir {{a}}cuentas de transportistas{{{/a}}."],"Connect your UPS account":[null,"Conecta a tu cuenta de UPS"],"Set up your own carrier account by adding your credentials here":[null,"Configura tu propia cuenta de transportista añadiendo aquí tus credenciales"],"Carrier account":[null,"Cuenta de transportista"],"Credentials":[null,"Credenciales"],"Adult signature required":[null,"Es obligatoria la firma de un adulto"],"Signature required":[null,"Firma obligatoria"],"Other\\u2026":[null,"Otros\\u2026"],"Select one\\u2026":[null,"Seleccionar uno\\u2026"],"Validating address\\u2026":[null,"Validando dirección\\u2026"],"Purchasing\\u2026":[null,"Comprando\\u2026"],"Your UPS account will be charged":[null,"Se cargará tu cuenta de UPS"],"Package %(index)s \\u2013 %(title)s":[null,"Paquete %(index)s \\u2013 %(title)s"],"Saving\\u2026":[null,"Guardando\\u2026"],"Your tax rates and settings will be automatically configured for %1$s. Learn more about setting up tax rates for additional nexuses":[null,"Tus tasas de impuestos y ajustes se configurarán automáticamente para %1$s. Aprende más sobre cómo configurar tasas de impuestos para nexos adicionales"],"Your tax rates and settings will be automatically configured for %1$s, %2$s. Learn more about setting up tax rates for additional nexuses":[null,"Tus tasas de impuestos y ajustes se configurarán automáticamente para %1$s, %2$s. Aprende más sobre cómo configurar tasas de impuestos para nexos adicionales"],"%(itemCount)d item is ready to be fulfilled":["%(itemCount)d items are ready to be fulfilled","%(itemCount)d elemento está listo para completar","%(itemCount)d elementos están listos para completar"],"%(itemCount)d item was fulfilled on {{span}}%(createdDate)s{{/span}}":["%(itemCount)d items were fulfilled on {{span}}%(createdDate)s{{/span}}","%(itemCount)d elemento se completó el {{span}}%(createdDate)s{{/span}}","%(itemCount)d elementos se completaron el {{span}}%(createdDate)s{{/span}}"],"Schedule a pickup":[null,"Programa una recogida"],"Label images older than 180 days are deleted by our technology partners for general security and data privacy concerns.":[null,"Las imágenes de las etiquetas de más de 180 días las borran nuestros colaboradores tecnológicos por cuestiones de seguridad y privacidad de datos."],"Labels older than 30 days cannot be refunded.":[null,"Las etiquetas de más de 30 días no se pueden reembolsar."],"Mark this order as complete and notify the customer":[null,"Marcar este pedido como completo y avisar al cliente"],"Notify the customer with shipment details":[null,"Avisar el cliente con los detalles del envío"],"You save %s with WooCommerce Shipping":[null,"Ahorras %s con WooCommerce Shipping"],"WooCommerce Shipping & Tax requires the WooCommerce plugin to be installed and active. You can download %s here.":[null,"WooCommerce Shipping & Tax necesita que esté instalado y activado el plugin WooCommerce. Puedes descargarlo aquí: %s."],"No tracking information available at this time":[null,"En este momento no hay disponible información de seguimiento"],"Connection error: unable to create label at this time":[null,"Error de conexión: en este momento no se puede crear la etiqueta"],"Track Package":["Track Packages","Seguimiento de paquete","Seguimiento de paquetes"],"Which package would you like to track?":[null,"¿Qué paquete te gustaría seguir?"],"%(service)s label (#%(labelIndex)d)":[null,"%(service)s etiqueta (#%(labelIndex)d)"],"To print this shipping label, {{a}}add a credit card to your account{{/a}}.":[null,"Para imprimir esta etiqueta de envío, {{a}}añade una tarjeta de crédito a tu cuenta{{/a}}."],"Add credit card":[null,"Añadir una tarjeta de crédito"],"To print this shipping label, {{a}}choose a credit card to add to your account{{/a}}.":[null,"Para imprimir esta etiqueta de envío, {{a}}elige una tarjeta de crédito para añadirla a tu cuenta{{/a}}."],"Choose credit card":[null,"Elegir una tarjeta de crédito"],"Buy shipping label":["Buy shipping labels","Comprar etiqueta de envío","Comprar etiquetas de envío"],"shipping label ready":["shipping labels ready","etiqueta de envío lista","etiquetas de envío listas"],"Shipping from":[null,"Envío desde"],"Shipping summary":[null,"Resumen del envío"],"Customer paid a {{shippingMethod/}} of {{shippingCost/}} for shipping":[null,"El cliente ha pagado un {{shippingMethod/}} de {{shippingCost/}} por el envío"],"Shipping rates":[null,"Tarifas de envío"],"HS Tariff number":[null,"Número del arancel del HS"],"Submit":[null,"Enviar"],"Total Weight (with package)":[null,"Peso total (con el paquete)"],"QTY":[null,"Cantidad"],"Weight":[null,"Peso"],"Items to fulfill":[null,"Elementos para rellenar"],"Select a package type":[null,"Selecciona un tipo de paquete"],"Package details":[null,"Detalles del paquete"],"Your shipping packages have been saved.":[null,"Han sido guardados tus paquetes de envío."],"0.0":[null,"0.0"],"Shipment Tracking":[null,"Seguimiento de envíos"],"Customs information valid":[null,"Información de aduanas válida"],"Customs information incomplete":[null,"Información de aduanas incompleta"],"Packing Log:":[null,"Registro de paquetería:"],"Chosen Rate:":[null,"Tarifa elegida:"],"Shipping Method ID:":[null,"ID del método de envío:"],"Shipping Method Name:":[null,"Nombre del método de envío:"],"Shipping Debug":[null,"Depuración de envíos"],"\"%2$s\" is missing weight, length, width, or height.
    Shipping rates cannot be calculated. Enter dimensions and weight for %2$s so your customers can purchase this item.":[null,"A «%2$s» le falta el peso, la longitud, la anchura o la altura.
    No se pueden calcular las tarifas de envío. Introduce las dimensiones y el peso de %2$s para que tus clientes puedan comprar este artículo."],"Unable to send request to WooCommerce Shipping & Tax server. The timestamp generated for the signature is too old.":[null,"No ha sido posible enviar la solicitud al servidor de WooCommerce Shipping & Tax. La marca temporal generada para la firma es demasiado antigua."],"Unable to send request to WooCommerce Shipping & Tax server. Jetpack Token is malformed.":[null,"No ha sido posible enviar la solicitud al servidor de WooCommerce Shipping & Tax. El token de JetPack está mal formado."],"Unable to send request to WooCommerce Shipping & Tax server. Jetpack Token is missing":[null,"No ha sido posible enviar la solicitud al servidor de WooCommerce Shipping & Tax. Falta el token de JetPack."],"Error: The WooCommerce Shipping & Tax server returned: %1$s %2$s ( %3$d )":[null,"Error: El servidor de WooCommerce Shipping & Tax ha devuelto: %1$s %2$s (%3$d)"],"Error: The WooCommerce Shipping & Tax server returned ( %d ) and an empty response body.":[null,"Error: El servidor de WooCommerce Shipping & Tax ha devuelto (%d) y un cuerpo de respuesta vacío."],"Error: The WooCommerce Shipping & Tax server returned HTTP code: %d":[null,"Error: El servidor de WooCommerce Shipping & Tax ha devuelto un código HTTP: %d"],"Unable to encode body for request to WooCommerce Shipping & Tax server.":[null,"No ha sido posible cifrar el cuerpo para la solicitud al servidor de WooCommerce Shipping & Tax."],"Unable to send request to WooCommerce Shipping & Tax server. Body must be an array.":[null,"No ha sido posible enviar la solicitud al servidor de WooCommerce Shipping & Tax. El cuerpo debe ser un array."],"Unable to send request to WooCommerce Shipping & Tax server. Jetpack connection does not implement get_access_token.":[null,"No ha sido posible enviar la solicitud al servidor de WooCommerce Shipping & Tax. La conexión de Jetpack no implementa `get_access_token`."],"Unable to send request to WooCommerce Shipping & Tax server. Jetpack_Data was not found.":[null,"No ha sido posible enviar la solicitud al servidor de WooCommerce Shipping & Tax. No se ha encontrado Jetpack_Data."],"No shipping rate could be calculated. No items in the package are shippable.":[null,"No se ha podido calcular la tarifa de envío. Ningún artículo del paquete se puede enviar."],"Product ( ID: %d ) is missing a dimension value. Shipping rates cannot be calculated.":[null,"Al producto (ID: %d) le falta un valor de dimensión. No se pueden calcular las tarifas de envío."],"Product ( ID: %d ) did not include a weight. Shipping rates cannot be calculated.":[null,"El producto (ID: %d) no incluye un peso. No se pueden calcular las tarifas de envío."],"Packing log:":[null,"Registro de paquetería:"],"Received rate: %1$s (%2$s)":[null,"Tarifa recibida: %1$s (%2$s)"],"Your customer selected {{shippingMethod/}}":[null,"Tu cliente ha elegido {{shippingMethod/}}"],"Total rate: %(total)s":[null,"Tarifa total: %(total)s"],"%(serviceName)s: %(rate)s":[null,"%(serviceName)s: %(rate)s"],"No rates found":[null,"No se han encontrado tarifas"],"WooCommerce Shipping gives you access to USPS Commercial Pricing, which is discounted over Retail rates.":[null,"WooCommerce Shipping te da acceso a USPS Commercial Pricing, que tienen descuento sobre las tarifas minoristas."],"more info":[null,"más información"],"ITN":[null,"ITN"],"Sanitary / Phytosanitary inspection":[null,"Inspección sanitaria / fitosanitaria"],"Quarantine":[null,"Cuarentena"],"None":[null,"Ninguno"],"Restriction type":[null,"Tipo de restricción"],"Details":[null,"Detalles"],"Sample":[null,"Muestra"],"Gift":[null,"Regalo"],"Documents":[null,"Documentos"],"Merchandise":[null,"Mercancía"],"Contents type":[null,"Tipo de contenido"],"Return to sender if package is unable to be delivered":[null,"Devolver al remitente si el paquete no puede ser entregado"],"Value (per unit)":[null,"Valor (por unidad)"],"Weight (per unit)":[null,"Peso (por unidad)"],"Save customs form":[null,"Guardar el formulario de aduanas"],"Customs":[null,"Aduanas"],"Use address as entered":[null,"Utilizar la dirección tal y como se ha introducido"],"View on Google Maps":[null,"Ver en Google Maps"],"Verify with USPS":[null,"Verificar con USPS"],"Automatic verification failed for this address. It may still be a valid address \\u2014 use the tools below to manually verify.":[null,"Ha fallado la verificación automática para esta dirección. Aún puede ser una dirección válida: usa las siguientes herramientas para verificarla manualmente."],"We were unable to automatically verify the address.":[null,"No hemos podido verificar automáticamente la dirección."],"We were unable to automatically verify the address \\u2014 %(error)s.":[null,"No hemos podido verificar automáticamente la dirección: %(error)s."],"You've edited the address, please revalidate it for accurate rates":[null,"Has editado la dirección. Por favor, vuelve a validarla para obtener tarifas precisas"],"Verify address":[null,"Verificar dirección"],"%(message)s. Please modify the address and try again.":[null,"%(message)s. Modifica la dirección y vuelve a intentarlo."],"View details":[null,"Ver detalles"],"Items":[null,"Artículos"],"Package":[null,"Paquete"],"Receipt":[null,"Recibo"],"Label #%(labelIndex)s details":[null,"Detalles de la etiqueta #%(labelIndex)s"],"{{icon/}} Delete this package":[null,"{{icon/}}} Borrar este paquete"],"Done":[null,"Hecho"],"Add boxes, envelopes, and other packages you use most frequently":[null,"Añade las cajas, sobres y otros paquetes que uses más frecuentemente"],"Remove":[null,"Quitar"],"Edit":[null,"Editar"],"Weight of empty package":[null,"Peso del paquete vacío"],"Unique package name":[null,"Nombre único del paquete"],"Envelope":[null,"Sobre"],"Box":[null,"Caja"],"This field is required.":[null,"Este campo es obligatorio."],"Payment":[null,"Pago"],"Email the label purchase receipts to %(ownerName)s (%(ownerLogin)s) at %(ownerEmail)s":[null,"Envía por correo electrónico los recibos de compra de etiquetas a %(ownerName)s (%(ownerLogin)s) a %(ownerEmail)s"],"Email Receipts":[null,"Recibos por correo electrónico"],"To purchase shipping labels, choose a credit card you have on file or add a new card.":[null,"Para comprar etiquetas de envío elige una tarjeta de crédito que tengas guardada o añade una nueva tarjeta."],"Choose a different card":[null,"Elige una tarjeta diferente"],"To purchase shipping labels, add a credit card.":[null,"Para comprar etiquetas de envío, añade una tarjeta de crédito."],"We'll charge the credit card on your account (%(card)s) to pay for the labels you print":[null,"Haremos un cargo en la tarjeta de crédito de tu cuenta (%(card)s) para pagar las etiquetas que imprimas"],"Credit cards are retrieved from the following WordPress.com account: %(wpcomLogin)s <%(wpcomEmail)s>":[null,"Las tarjetas de crédito se obtienen de la siguiente dirección de WordPress.com: %(wpcomLogin)s <%(wpcomEmail)s>"],"Only the site owner can change these settings. Please contact %(ownerName)s (%(ownerLogin)s) to change the shipping label settings.":[null,"Solo el propietario del sitio puede cambiar estos ajustes. Por favor, contacta con %(ownerName)s (%(ownerLogin)s) para cambiar los ajustes de etiquetas de envío."],"Only the site owner can manage shipping label payment methods. Please contact %(ownerName)s (%(ownerLogin)s) to manage payment methods.":[null,"Solo el propietario del sitio puede administrar los métodos de pago de etiquetas de envío. Por favor, contactda con %(ownerName)s (%(ownerLogin)s) para que administre los métodos de pago."],"%(card)s ****%(digits)s":[null,"%(tarjeta)s ****%(digits)s"],"Print shipping labels yourself and save a trip to the post office":[null,"Imprime tú mismo las etiquetas de envío y ahórrate un viaje a la oficina de correos"],"H":[null,"Al"],"W":[null,"An"],"L":[null,"L"],"Disconnect":[null,"Desconectar"],"Activate":[null,"Activar"],"No activity yet":[null,"Todavía no hay actividad"],"Note":[null,"Nota"],"Refunded %(amount)s":[null,"Reembolsado %(amount)s"],"%(service)s label (#%(labelNum)d) refund rejected":[null,"reembolso de etiqueta de %(service)s (#%(labelNum)d) rechazado"],"%(service)s label (#%(labelNum)d) refunded (%(amount)s)":[null,"reembolsado (%(amount)s) de etiqueta de %(service)s (#%(labelNum)d) rechazado"],"%(service)s label (#%(labelNum)d) refund requested (%(amount)s)":[null,"%(service)s etiqueta (#%(labelNum)d) solicitud de reembolso (%(amount)s)"],"Note sent to customer":[null,"Nota enviada al cliente"],"Internal note":[null,"Nota interna"],"Show notes from %(date)s":[null,"Mostrar notas desde %(date)s"],"%(count)s event":["%(count)s events","%(count)s evento","%(count)s eventos"],"WeChat Pay":[null,"WeChat Pay"],"Toggle menu":[null,"Alternar menú"],"Return to Order #%(orderId)s":[null,"Volver al pedido #%(orderId)s"],"Our team is here for you. View our {{docsA}}support docs{{/docsA}} or {{ticketA}}open a support ticket{{/ticketA}}.":[null,"Nuestro equipo está aquí para ti. Ve nuestros {{docsA}}documentos de soporte{{/docsA}} o {{ticketA}}abre un ticket de soporte{{/ticketA}}."],"Logging":[null,"Registro"],"No services configured. {{a}}Add a shipping service{{/a}}":[null,"No hay configurado ningún servicio. {{a}}Añade un servicio de envío{{/a}}"],"Edit service settings":[null,"Editar ajustes del servicio"],"Request was made %s - check logs below or {{a}}edit service settings{{/a}}":[null,"La solicitud la hizo %s - revisa los registros abajo o {{a}}edita los ajustes del servicio{{/a}}"],"Copy for support":[null,"Copiar para soporte"],"Last %s entry. {{a}}Show full log{{/a}}":["Last %s entries. {{a}}Show full log{{/a}}","Última %s entrada. {{a}}Mostrar registro completo{{/a}}","Últimas %s entradas. {{a}}Mostrar registro completo{{/a}}"],"Log tail copied to clipboard":[null,"Cola del registro copiada al portapapeles"],"You have unsaved changes. Are you sure you want to leave this page?":[null,"Tienes cambios sin guardar. ¿Estás seguro de querer abandonar esta página?"],"Value ($ per unit)":[null,"Valor ($ por unidad)"],"Weight (%s per unit)":[null,"Weight (%s per unit)"],"Description":[null,"Descripción"],"Country where the product was manufactured or assembled":[null,"País donde se fabricó o ensambló el producto"],"Origin country":[null,"País de origen"],"USPS":[null,"USPS"],"Optional":[null,"Opcional"],"Retry":[null,"Reintentar"],"shipping label printing":[null,"impresión de etiquetas de envío"],"shipping label printing and smoother payment setup":[null,"impresión de etiquetas de envío y una configuración de pago más sencilla"],"automated tax calculation and shipping label printing":[null,"cálculo automático de impuestos e impresión de etiquetas de envío"],"automated tax calculation, shipping label printing, and smoother payment setup":[null,"cálculo automático de impuestos, impresión de etiquetas de envío y configuración de pagos más sencilla"],"Data resource description.":[null,"Descripción del recurso de datos."],"Data resource ID.":[null,"ID del recurso de datos."],"List of supported currencies.":[null,"Lista de monedas disponibles."],"List of supported states in a given country.":[null,"Lista de provincias incluidas para un país dado."],"List of supported continents, countries, and states.":[null,"Lista de continentes, países y provincias incluidos."],"Sorry, you cannot view this resource.":[null,"Lo siento, no puedes ver este recurso."],"Sorry, you cannot list resources.":[null,"Lo siento, no puedes listar recursos."],"The unit weights are defined in for this country.":[null,"Las unidades de peso definidas para este país."],"Thousands separator for displayed prices in this country.":[null,"Separador de miles para los precios mostrados en este país."],"Full name of state.":[null,"Nombre completo de la provincia."],"State code.":[null,"Código de la provincia."],"List of states in this country.":[null,"Lista de provincias de este país."],"Number of decimal points shown in displayed prices for this country.":[null,"Número de decimales mostrados en los precios visibles para este país."],"Full name of country.":[null,"Nombre completo del país."],"The unit lengths are defined in for this country.":[null,"Las unidades de medida definidas para este país."],"Decimal separator for displayed prices for this country.":[null,"Separador decimal para los precios mostrados para este país."],"Currency symbol position for this country.":[null,"Posición del símbolo de moneda para este país."],"Default ISO4127 alpha-3 currency code for the country.":[null,"Código de moneda ISO4127 alpha-3 por defecto para el país."],"ISO3166 alpha-2 country code.":[null,"Código ISO3166 alpha-2 del país."],"List of countries on this continent.":[null,"Lista de países de este continente."],"Full name of continent.":[null,"Nombre completo del continente."],"There are no locations matching these parameters.":[null,"No hay ubicaciones que coincidan con estos parámetros."],"2 character continent code.":[null,"Código de 2 caracteres del continente."],"Shipping label tracking number":[null,"Número de seguimiento de la etiqueta de envío"],"Shipping label service":[null,"Servicio de etiquetas de envío"],"Warning: Erasing personal data will cause the ability to reprint or refund WooCommerce Shipping & Tax shipping labels to be lost on the affected orders.":[null,"Advertencia: El borrado de datos personales provocará la posibilidad de volver a imprimir o reembolsar etiquetas de envío de WooCommerce Shipping & Tax que hayan desaparecido en los pedidos afectados."],"By using this extension, you may be storing personal data or sharing data with external services. Learn more about how this works, including what you may want to include in your privacy policy.":[null,"Al usar esta extensión puede que estés almacenando datos personales o compartiendo datos con servicios externos. Aprende más sobre cómo funciona esto, incluyendo lo que quieras incluir en tu política de privacidad."],"There was a problem updating your saved credit cards.":[null,"Hubo un problema al actualizar tus tarjetas de crédito guardadas."],"No labels found for this period":[null,"No se han encontrado etiquetas en este periodo"],"Total":[null,"Total"],"Refund":[null,"Reembolso"],"Price":[null,"Precio"],"Order":[null,"Pedido"],"Time":[null,"Hora"],"Requested":[null,"Solicitado"],"Last 7 days":[null,"Últimos 7 días"],"This month":[null,"Este mes"],"Last month":[null,"El mes pasado"],"Year":[null,"Año"],"Export CSV":[null,"Exportar CSV"],"Other Log":[null,"Otros registros"],"Taxes Log":[null,"Registro de impuestos"],"Shipping Log":[null,"Registro de envíos"],"Display troubleshooting information on the Cart and Checkout pages.":[null,"Muestra información para resolución de problemas en las páginas de carrito y finalizar compra."],"Write diagnostic messages to log files. Helpful when contacting support.":[null,"Escribe mensajes de diagnóstico en los archivos de registro. Útil al contactar con soporte."],"Enter your email address at which to accept payments. You'll need to link your own account in order to perform anything other than \"sale\" transactions.":[null,"Introduce tu dirección de correo electrónico en la que aceptas pagos. Tendrás que enlazar a tu cuenta para realizar cualquier otra cosa además de las transacciones de \"ofertas\"."],"Payment Email":[null,"Correo electrónico de pagos"],"To authenticate payments with WooCommerce Shipping & Tax, click here.":[null,"Para identificar pagos con WooCommerce Shipping & Tax, haz clic aquí."],"Payments will be authenticated by WooCommerce Shipping & Tax and directed to the following email address. To disable this feature and link a PayPal account, click here.":[null,"Los pagos los identificará WooCommerce Shipping & Tax y se dirigirán a la siguiente dirección de correo electrónico. Para desactivar esta característica y enlazar a una cuenta de PayPal, haz clic aquí."],"%s (Note that \"authorizing payment only\" requires linking a PayPal account.)":[null,"%s (Date cuenta que \"autorizar solo pagos\" requiere enlazar con una cuenta de PayPal.)"],"Link account":[null,"Enlazar cuenta"],"Link a new or existing PayPal account to make sure future orders are marked “Processing” instead of “On hold”, and so refunds can be issued without leaving WooCommerce.":[null,"Enlaza una cuenta de PayPal nueva o existente para asegurar que los pedidos futuros se marquen como \"Procesando\" en vez de \"En espera\", y para emitir reembolsos sin tener que salir de WooCommerce."],"Link your PayPal account":[null,"Enlaza a tu cuenta de PayPal"],"To issue refunds via PayPal Checkout, you will need to link a PayPal account with the email address that received this payment.":[null,"Para enviar reembolsos a través de PayPal Exprés tendrás que enlazar a una cuenta de PayPal con la dirección de correo electrónico que recibió este pago."],"Link a PayPal account":[null,"Enlaza a una cuenta PayPal"],"Refresh":[null,"Recargar"],"Tracking number":[null,"Número de seguimiento"],"Provider":[null,"Proveedor"],"WooCommerce Shipping & Tax is almost ready to go! Once you connect Jetpack you'll have access to %s.":[null,"¡WooCommerce Shipping & Tax está casi listo! Una vez que conectes con Jetpack, tendrás acceso a %s."],"Hosted services for WooCommerce: automated tax calculation, shipping label printing, and smoother payment setup.":[null,"Servicios alojados para WooCommerce: cálculos automáticos de impuestos, tarifas de envío en directo, impresión de etiquetas de envío y una configuración de pago más sencilla."],"Tax Class":[null,"Clase de impuesto"],"Shipping":[null,"Envío"],"Compound":[null,"Compuesto"],"Priority":[null,"Prioridad"],"Tax Name":[null,"Nombre de impuesto"],"Rate %":[null,"Tarifa %"],"ZIP/Postcode":[null,"Código postal"],"State Code":[null,"Código de provincia"],"Country Code":[null,"Código de país"],"Enable automated taxes":[null,"Activar impuestos automáticos"],"Disable automated taxes":[null,"Desactivar impuestos automáticos"],"Automated taxes":[null,"Impuestos automáticos"],"By clicking \"%1$s\", you agree to the Terms of Service and to share certain data and settings with WordPress.com and/or third parties.":[null,"Haciendo clic en \"%1$s\" aceptas los términos del servicio y a compartir ciertos datos y ajustes con WordPress.com y/o otros."],"Setup complete.":[null,"Configuración completa."],"You can now enjoy %s.":[null,"Ya puedes disfrutar %s."],"WooCommerce Shipping & Tax is almost ready to go! Once you connect your store you'll have access to %s.":[null,"¡WooCommerce Shipping & Tax está casi listo! Una vez que conectes tu tienda tendrás acceso a %s."],"automated tax calculation":[null,"cálculo automático de impuestos"],"smoother payment setup":[null,"configuración de pago más sencilla"],"automated tax calculation and smoother payment setup":[null,"cálculo automático de impuestos y configuración de pago más sencilla"],"Required":[null,"Requerido"],"Your shipping settings have been saved.":[null,"Tus ajustes de envío se han guardado."],"Unable to save your shipping settings. Please try again.":[null,"No ha sido posible guardar tus ajustes de envío. Por favor, inténtalo de nuevo."],"Dimensions":[null,"Dimensiones"],"Close":[null,"Cerrar"],"Packages to be Shipped":[null,"Paquetes a enviar"],"Add to a New Package":[null,"Añadir a un nuevo paquete"],"Add items":[null,"Añadir artículos"],"Individually Shipped Item":[null,"Artículo enviado individualmente"],"Item Dimensions":[null,"Dimensiones del artículo"],"Please select a package":[null,"Por favor, elige un paquete"],"Service schemas were not loaded":[null,"No se cargaron los esquemas del servicio"],"Bad request":[null,"Petición errónea"],"Order not found":[null,"Pedido no encontrado"],"Got it, thanks!":[null,"¡Entendido, gracias!"],"Activate Jetpack and connect":[null,"Activa Jetpack y conecta"],"Install Jetpack and connect":[null,"Instala Jetpack y conecta"],"Something went wrong. Please try connecting to Jetpack manually, or contact support on the WordPress.org forums.":[null,"Algo fue mal. Por favor, trata de conectar manualmente con Jetpack, o contacta con soporte en los foros de WordPress.org."],"Connecting...":[null,"Conectando…"],"Activating...":[null,"Activando…"],"When you're ready, purchase and print discounted labels from %s right here.":[null,"Cuando estés listo, compra e imprime etiquetas de %s con descuento aquí mismo."],"Discounted Shipping Labels":[null,"Etiquetas de envío con descuento"],"American Express":[null,"American Express"],"Discover":[null,"Descubre"],"MasterCard":[null,"MasterCard"],"VISA":[null,"VISA"],"PayPal":[null,"PayPal"],"Add another credit card":[null,"Añadir otra tarjeta de créditoi"],"%(selectedCount)d package selected":["%(selectedCount)d packages selected","%(selectedCount)d paquete seleccionado","%(selectedCount)d paquetes seleccionados"],"Unable to get your settings. Please refresh the page to try again.":[null,"No ha sido posible recuperar tus ajustes. Por favor, recarga la página para intentarlo de nuevo."],"%(numSelected)d service selected":["%(numSelected)d services selected","%(numSelected)d servicio seleccionado","%(numSelected)d servicios seleccionados"],"Add and edit saved packages using the {{a}}Packaging Manager{{/a}}.":[null,"Añade y edita los paquetes guardados usando el {{a}}Gestor de paquetería{{/a}}."],"Tracking #: {{trackingLink/}}":[null,"Seguimiento #: {{trackingLink/}}"],"%(item)s from {{pckg/}}":[null,"%(item)s desde {{pckg/}}"],"Which items would you like to add to {{pckg/}}?":[null,"¿Qué artículos te gustaría añadir a {{pckg/}}?"],"1 item in 1 package: %(weight)s %(unit)s total":[null,"1 artículo en 1 paquete: %(weight)s %(unit)s en total"],"%(itemsCount)d items in 1 package: %(weight)s %(unit)s total":[null,"%(itemsCount)d artículos en 1 paquete: %(weight)s %(unit)s en total"],"%(itemsCount)d items in %(packageCount)d packages: %(weight)s %(unit)s total":[null,"%(itemsCount)d artículos en %(packageCount)d paquetes: %(weight)s %(unit)s en total"],"{{itemLink/}} is currently saved for a later shipment.":[null,"{{itemLink/}} está actualmente guardado para un envío posterior."],"{{itemLink/}} is currently shipped in its original packaging.":[null,"{{itemLink/}} está actualmente enviado en su paquete original."],"{{itemLink/}} is currently in {{pckg/}}.":[null,"{{itemLink/}} está en actualmente en {{pckg/}}."],"Choose rate: %(pckg)s":[null,"Elegir la tarifa: %(pckg)s"],"Refund label (-%(amount)s)":[null,"Etiqueta de reembolso (-%(amount)s)"],"Where would you like to move it?":[null,"¿A dónde te gustaría moverlo?"],"Unsaved changes made to packages":[null,"Los cambios realizados a los paquetes no se han guardado"],"There are no items in this package.":[null,"No existen artículos en este paquete."],"Ship in original packaging":[null,"Enviar en su paquete original"],"Request refund":[null,"Solicitar reembolso"],"Reprint":[null,"Volver a imprimir"],"Paper size":[null,"Tamaño del papel"],"No packages selected":[null,"No hay paquetes seleccionados"],"Move":[null,"Mover"],"Move item":[null,"Mover artículo"],"Increase the rates calculated by the carrier to account for packaging and handling costs. You can also add a negative amount to save your customers money.":[null,"Incrementa las tarifas calculadas por el transportista para tener en cuenta los costes de embalaje y manipulación. También puedes añadir una cantidad negativa para ahorrar dinero a tus clientes."],"Create new label":[null,"Crear nueva etiqueta"],"All packages selected":[null,"Seleccionados todos los paquetes"],"Add":[null,"Añadir"],"Add item":[null,"Añadir artículo"],"Add a credit card":[null,"Añadir una tarjeta de crédito"],"#%d - [Deleted product]":[null,"#%d - [producto borrado]"],"#%1$d - %2$s":[null,"#%1$d - %2$s"],"Support":[null,"Soporte"],"There was an error installing Jetpack. Please try installing it manually.":[null,"Hubo un error al instalar Jetpack. Por favor, trata de instalarlo manualmente."],"Shipping Labels":[null,"Etiquetas de envío"],"https://woocommerce.com/":[null,"https://woocommerce.com/"],"Phone":[null,"Teléfono"],"Connect":[null,"Conectar"],"Save Settings":[null,"Guardar ajustes"],"Your changes have been saved.":[null,"Tus cambios se han guardado."],"There was a problem with one or more entries. Please fix the errors below and try saving again.":[null,"Hubo un problema con una o más entradas. Por favor, soluciona los errores de abajo y trata de guardar de nuevo."],"Expand":[null,"Ampliar"],"Dismiss":[null,"Descartar"],"You have unsaved changes.":[null,"Tienes cambios sin guardar."],"Type of package":[null,"Tipo de paquete"],"Add package":["Add packages","Añadir paquete","Añadir paquetes"],"Invalid value.":[null,"Valor no válido."],"This field is required":[null,"Este campo es obligatorio"],"Package name":[null,"Nombre del paquete"],"This field must be unique":[null,"Este campo debe ser único"],"Unable to save your shipping packages. Please try again.":[null,"No se han podido guardar tus paquetes de envío. Por favor, inténtalo de nuevo."],"Save changes":[null,"Guardar cambios"],"Untitled":[null,"Sin título"],"Dimensions (L x W x H)":[null,"Dimensiones (L x An x Al)"],"All services selected":[null,"Seleccionados todos los servicios"],"Expand Services":[null,"Expandir servicios"],"Service":[null,"Servicio"],"Price adjustment":[null,"Ajuste de precio"],"Saved Packages":[null,"Paquetes guardados"],"Tracking":[null,"Seguimiento"],"Create shipping label":["Create shipping labels","Crear etiqueta de envío",""],"Name":[null,"Nombre"],"Company":[null,"Empresa"],"Address":[null,"Dirección"],"City":[null,"Ciudad"],"State":[null,"Provincia"],"Country":[null,"País"],"Invalid address":[null,"Dirección no válida"],"Origin address":[null,"Dirección de origen"],"Destination address":[null,"Dirección de destino"],"We have slightly modified the address entered. If correct, please use the suggested address to ensure accurate delivery.":[null,"Hemos modificado ligeramente la dirección introducida. Si es correcta, por favor, utiliza la dirección sugerida para asegurar una entrega precisa."],"Address entered":[null,"Dirección introducida"],"Edit address":[null,"Editar dirección"],"Suggested address":[null,"Dirección sugerida"],"Use selected address":[null,"Usar la dirección seleccionada"],"Use these packages":[null,"Utilizar estos paquetes"],"The service and rate chosen by the customer at checkout is not available. Please choose another.":[null,"El servicio y la tarifa elegidos por el cliente en el pago no están disponibles. Por favor, elige otro."],"Request a refund":[null,"Solicitar un reembolso"],"You can request a refund for a shipping label that has not been used to ship a package. It will take at least %(days)s days to process.":[null,"Puedes solicitar un reembolso de una etiqueta de envío que no se haya utilizado para enviar un paquete. Tardará al menos %(días)s en procesarse."],"Purchase date":[null,"Fecha de compra"],"Amount eligible for refund":[null,"Cantidad elegible para el reembolso"],"Reprint shipping label":[null,"Volver a imprimir la etiqueta de envío"],"If there was a printing error when you purchased the label, you can print it again.":[null,"Si hay un problema de impresión cuando compres la etiqueta puedes imprimirla de nuevo."],"NOTE: If you already used the label in a package, printing and using it again is a violation of our terms of service and may result in criminal charges.":[null,"NOTA: Si ya has usado la etiqueta en un paquete, imprimirla y usarla de nuevo es una violación de nuestros términos del servicio y podría resultar en cargos criminales."],"Print":[null,"Imprimir"],"Cancel":[null,"Cancelar"],"N/A":[null,"N/D"],"More":[null,"Más"],"Invalid PDF request.":[null,"Petición de PDF no válida."],"Unknown package":[null,"Paquete desconocido"],"Individual packaging":[null,"Empaquetado individual"],"Unable to update service settings. Validation failed. %s":[null,"No ha sido posible actualizar los ajustes del servicio. Falló la validación. %s"],"Unable to update service settings. The form data could not be read.":[null,"No ha sido posible actualizar los ajustes del servicio. Los datos del formulario no pudieron leerse."],"Unable to update service settings. Form data is missing service ID.":[null,"No ha sido posible actualizar los ajustes del servicio. Los datos del formulario son de un ID de servicio no disponible."],"Unable to update settings. The form data could not be read.":[null,"No fue posible actualizar los ajustes. Los datos del formulario no se han podido leer."],"Unable to update settings. %s":[null,"No ha sido posible actualizar los ajustes. %s"],"Packaging":[null,"Paquetería"],"Section not loading? Visit the status page for troubleshooting steps.":[null,"¿No carga la sección? Visita la página de estado para ver los pasos de solución de problemas."],"Note: Jetpack development mode is enabled on this site. This site will not be able to obtain payment methods from WooCommerce Shipping & Tax production servers.":[null,"Nota: El modo de desarrollo de Jetpack está activo en este sitio. Este sitio no podrá obtener métodos de pago de los servidores de producción de WooCommerce Shipping & Tax."],"Note: Jetpack is connected, but development mode is also enabled on this site. Please disable development mode.":[null,"Nota: Jetpack está conectado, pero también está activo el modo de desarrollo en este sitio. Por favor, desactiva el modo de desarrollo."],"Shipping Label":[null,"Etiqueta de envío"],"yd":[null,"yd"],"in":[null,"en"],"mm":[null,"mm"],"cm":[null,"cm"],"m":[null,"m"],"oz":[null,"oz"],"lbs":[null,"lbs"],"g":[null,"g"],"kg":[null,"kg"],"An invalid service ID was received.":[null,"Se ha recibido un ID de servicio no válido."],"An invalid service instance was received.":[null,"Se ha recibido una instancia de servicio no válida."],"Rest of the World":[null,"Resto del mundo"],"Support":[null,"Soporte"],"Debug":[null,"Depuración"],"Services":[null,"Servicios"],"Need help?":[null,"¿Necesitas ayuda?"],"Log is empty":[null,"El registro está vacío"],"Disabled":[null,"Desactivado"],"Enabled":[null,"Activo"],"%s Shipping Zone":[null,"Zona de envío %s"],"The most recent rate request failed":[null,"La reciente solicitud de tarifas más reciente ha fallado"],"The most recent rate request was successful":[null,"La solicitud de tarifas más reciente ha sido correcta"],"No rate requests have yet been made for this service":[null,"Aún no han hecho solicitudes de tarifas para este servicio"],"Setup for this service has not yet been completed":[null,"La configuración de este servició aún no se ha completado"],"Service data is up-to-date":[null,"Los datos del servicio están al día"],"Service data was found, but is more than one day old":[null,"Se encontaron datos del servicio, pero son de hace más de un día"],"Service data was found, but is more than three days old":[null,"Se encontraron datos del servicio, pero son de hace más de tres días"],"Service data found, but may be out of date":[null,"Se han encontrado datos del servicio, pero podrían ser obsoletos"],"No service data available":[null,"No hay disponibles datos del servicio"],"Jetpack":[null,"Jetpack"],"Jetpack %s is connected and working correctly":[null,"Jetpack %s está conectado y funcionando correctamente"],"This is a Jetpack staging site":[null,"Este es un sitio en pruebas de Jetpack"],"Jetpack is not connected to WordPress.com. Make sure the Jetpack plugin is installed, activated, and connected.":[null,"Jetpack no está conectado a WordPress.com. Asegúrate de que el plugin Jetpack está instalado, activado y conectado."],"Jetpack %1$s or higher is required (You are running %2$s)":[null,"Se necesita Jetpack %1$s o superior (estás ejecutando la versión %2$s)"],"Please install and activate the Jetpack plugin, version %s or higher":[null,"Por favor, instala y activa el plugin Jetpack, en su versión %s o superior"],"WooCommerce":[null,"WooCommerce"],"WooCommerce %s is configured correctly":[null,"WooCommerce %s está configurado correctamente"],"Please set Base Location in WooCommerce Settings > General":[null,"Por favor, establece la ubicación base en Ajustes de WooCommerce > General"],"WooCommerce %1$s or higher is required (You are running %2$s)":[null,"Se necesita WooCommerce %1$s o superior (estás ejecutando la versión %2$s)"],"Dismiss this notice":[null,"Descartar este aviso"],"ERROR: Your site has a problem connecting to the WooCommerce Shipping & Tax API. Please make sure your Jetpack connection is working.":[null,"ERROR: Tu sitio tiene un problema al conectar con la API de WooCommerce Shipping & Tax. Por favor, aségurate de que está funcionando tu conexión de Jetpack."],"Your site is successfully communicating to the WooCommerce Shipping & Tax API.":[null,"Tu sitio se está comunicando correctamente con la API de WooCommerce Shipping & Tax."],"This will test your WooCommerce Shipping & Tax connection to ensure everything is working correctly":[null,"Esto probará tu conexión de WooCommerce Shipping & Tax para asegurar que todo funciona correctamente"],"Test Connection":[null,"Probar conexión"],"The WooCommerce Shipping & Tax brandname\u0004WooCommerce Shipping & Tax":[null,"WooCommerce Shipping & Tax"],"The WooCommerce Shipping & Tax brandname\u0004WooCommerce Shipping":[null,"WooCommerce Shipping"],"%s - ZIP/Postal code checkout field label\u0004Invalid %s entered.":[null,"%s introducido no válido."],"%s - ZIP/Postal code checkout field label\u0004%s does not match the selected state.":[null,"%s no coincide con la provincia seleccionada."],"date is of the form MM/YY\u0004Expires %(date)s":[null,"Caduca %(date)s"],"A service with an unknown title and unknown method_title\u0004Unknown":[null,"Desconocido"],"This section displays the overall health of WooCommerce Shipping & Tax and the things it depends on\u0004Health":[null,"Salud"]}import restApi from '@automattic/jetpack-api'; export const FETCH_WORDADS_SETTINGS = 'FETCH_WORDADS_SETTINGS'; export const UPDATE_WORDADS_SETTINGS = 'UPDATE_WORDADS_SETTINGS'; /** * fetchJetpackSettings action * * @returns {object} - an action object. */ export const fetchWordAdsSettings = () => { return { type: FETCH_WORDADS_SETTINGS, }; }; /** * updateJetpackSettings action * * @param {*} settings - Jetpack settings object. * @returns {object} - an action object. */ export const updateWordAdsSettings = settings => { return { type: UPDATE_WORDADS_SETTINGS, settings, }; }; export default { [ FETCH_WORDADS_SETTINGS ]: function () { return restApi.fetchWordAdsSettings(); }, [ UPDATE_WORDADS_SETTINGS ]: function ( action ) { return restApi.updateWordAdsSettings( action.settings ); }, }; { "apiVersion": 2, "name": "surecart/coupon", "title": "Coupon", "description": "Display a coupon form.", "category": "surecart", "keywords": ["coupon", "promo"], "textdomain": "surecart", "ancestor": ["surecart/form", "surecart/totals"], "supports": { "reusable": false, "html": false, "multiple": false, "order-summary": true }, "attributes": { "lock": { "remove": true }, "text": { "type": "string", "default": "Add Coupon Code" }, "button_text": { "type": "string", "default": "Apply" }, "placeholder": { "type": "string", "default": "Enter coupon code" }, "collapsed": { "type": "boolean", "default": true }, "disabled": { "type": "boolean" } } } const webpack = require( 'webpack' ); // TODO: Migrate this to a common package in the monorepo to avoid code duplication. /** * Returns an instance of the DefinePlugin that adds color-studio colors as literals. * * @returns {object} DefinePlugin instance. */ function definePaletteColorsAsStaticVariables() { return new webpack.DefinePlugin( { // Replace palette colors as individual literals in the bundle. PALETTE: ( () => { const colors = require( '@automattic/color-studio' ).colors; const stringifiedColors = {}; // DefinePlugin replaces the values as unescaped text. // We therefore need to double-quote each value, to ensure it ends up as a string. for ( const color in colors ) { stringifiedColors[ color ] = `"${ colors[ color ] }"`; } return stringifiedColors; } )(), } ); } module.exports = definePaletteColorsAsStaticVariables; { "name": "woocommerce/checkout-order-summary-coupon-form-block", "version": "1.0.0", "title": "Coupon Form", "description": "Shows the apply coupon form.", "category": "woocommerce", "supports": { "align": false, "html": false, "multiple": false, "reusable": false }, "attributes": { "className": { "type": "string", "default": "" }, "lock": { "type": "object", "default": { "remove": false, "move": false } } }, "parent": [ "woocommerce/checkout-order-summary-block" ], "textdomain": "woo-gutenberg-products-block", "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2 } !function(){"use strict";var e={d:function(n,t){for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{__flushAllInjections:function(){return u},createLocation:function(){return p},createReplaceableLocation:function(){return d}});var t=window.React,r=class extends t.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback:this.props.children}};function o({children:e}){return t.createElement(r,{fallback:null},t.createElement(t.Suspense,{fallback:null},e))}var i=10,c=[];function u(){c.forEach((e=>e()))}function a(e){return()=>[...e.values()].sort(((e,n)=>e.priority-n.priority))}function l(e){return()=>(0,t.useMemo)((()=>e()),[])}function s(e){return n=>t.createElement(o,null,t.createElement(e,{...n}))}function p(){const e=new Map,n=a(e),r=l(n),o=function(e){return n=>{const r=e();return t.createElement(t.Fragment,null,r.map((({id:e,component:r})=>t.createElement(r,{...n,key:e}))))}}(r),u=function(e){return({component:n,id:t,options:r={}})=>{!e.has(t)||r?.overwrite?e.set(t,{id:t,component:s(n),priority:r.priority??i}):console.warn(`An injection with the id "${t}" already exists. Did you mean to use "options.overwrite"?`)}}(e);return c.push((()=>e.clear())),{inject:u,getInjections:n,useInjections:r,Slot:o}}function d(){const e=new Map,n=a(e),r=l(n),o=function(e){return n=>{const r=e(),{component:o}=r.find((({condition:e})=>e?.(n)))??{};return o?t.createElement(o,{...n}):n.children}}(r),u=function(e){return({component:n,id:t,condition:r=()=>!0,options:o={}})=>{e.set(t,{id:t,component:s(n),condition:r,priority:o.priority??i})}}(e);return c.push((()=>e.clear())),{getInjections:n,useInjections:r,inject:u,Slot:o}}(window.elementorV2=window.elementorV2||{}).locations=n}(),window.elementorV2.locations?.init?.();

    Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the astra domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/uchmtv5/public_html/wp-includes/functions.php on line 6121
    It looks like the link pointing here was faulty. Maybe try searching?
    /** * Internal dependencies */ import { Currency } from '@easy-digital-downloads/currency'; /** * Determine if a pie graph. * * @todo maybe pass from data? * * @param {Object} config Global chart config. * @return {Bool} */ export const isPieChart = ( config ) => { const { type } = config; return type === 'pie' || type === 'doughnut'; }; /** * Determine if a chart's dataset has a special conditional type. * * Currently just checks for currency. * * @param {string} label Current label. * @param {Object} config Global chart config. */ export const getLabelWithTypeCondition = ( label, datasetConfig ) => { let newLabel = label; const { type } = datasetConfig; if ( 'currency' === type ) { const currency = new Currency(); newLabel = currency.format( label, false ); } return newLabel; }; /** * Shared tooltip configuration. */ export const toolTipBaseConfig = { enabled: false, mode: 'index', position: 'nearest', /** * Output a a custom tooltip. * * @param {Object} tooltip Tooltip data. */ custom: function( tooltip ) { // Tooltip element. let tooltipEl = document.getElementById( 'edd-chartjs-tooltip' ); if ( ! tooltipEl ) { tooltipEl = document.createElement( 'div' ); tooltipEl.id = 'edd-chartjs-tooltip'; tooltipEl.innerHTML = '
    '; this._chart.canvas.parentNode.appendChild( tooltipEl ); } // Hide if no tooltip. if ( tooltip.opacity === 0 ) { tooltipEl.style.opacity = 0; return; } // Set caret position. tooltipEl.classList.remove( 'above', 'below', 'no-transform' ); if ( tooltip.yAlign ) { tooltipEl.classList.add( tooltip.yAlign ); } else { tooltipEl.classList.add( 'no-transform' ); } function getBody( bodyItem ) { return bodyItem.lines; } // Set Text if ( tooltip.body ) { const titleLines = tooltip.title || []; const bodyLines = tooltip.body.map( getBody ); let innerHtml = ''; innerHtml += ''; bodyLines.forEach( function( body, i ) { const colors = tooltip.labelColors[ i ]; const { borderColor, backgroundColor } = colors; // Super dirty check to use the legend's color. let fill = borderColor; if ( fill === 'rgb(230, 230, 230)' || fill === '#fff' ) { fill = backgroundColor; } const style = [ `background: ${ fill }`, `border-color: ${ fill }`, 'border-width: 2px', ]; const span = ''; innerHtml += '' + span + body + ''; } ); innerHtml += ''; const tableRoot = tooltipEl.querySelector( 'table' ); tableRoot.innerHTML = innerHtml; } const positionY = this._chart.canvas.offsetTop; const positionX = this._chart.canvas.offsetLeft; // Display, position, and set styles for font tooltipEl.style.opacity = 1; tooltipEl.style.left = positionX + tooltip.caretX + 'px'; tooltipEl.style.top = positionY + tooltip.caretY + 'px'; tooltipEl.style.fontFamily = tooltip._bodyFontFamily; tooltipEl.style.fontSize = tooltip.bodyFontSize + 'px'; tooltipEl.style.fontStyle = tooltip._bodyFontStyle; tooltipEl.style.padding = tooltip.yPadding + 'px ' + tooltip.xPadding + 'px'; }, }; /*! elementor - v3.29.0 - 28-05-2025 */ "use strict"; (self["webpackChunkelementorFrontend"] = self["webpackChunkelementorFrontend"] || []).push([["text-editor"],{ /***/ "../assets/dev/js/frontend/handlers/text-editor.js": /*!*********************************************************!*\ !*** ../assets/dev/js/frontend/handlers/text-editor.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); __webpack_require__(/*! core-js/modules/esnext.iterator.find.js */ "../node_modules/core-js/modules/esnext.iterator.find.js"); class TextEditor extends elementorModules.frontend.handlers.Base { getDefaultSettings() { return { selectors: { paragraph: 'p:first' }, classes: { dropCap: 'elementor-drop-cap', dropCapLetter: 'elementor-drop-cap-letter' } }; } getDefaultElements() { const selectors = this.getSettings('selectors'), classes = this.getSettings('classes'), $dropCap = jQuery('', { class: classes.dropCap }), $dropCapLetter = jQuery('', { class: classes.dropCapLetter }); $dropCap.append($dropCapLetter); return { $paragraph: this.$element.find(selectors.paragraph), $dropCap, $dropCapLetter }; } wrapDropCap() { const isDropCapEnabled = this.getElementSettings('drop_cap'); if (!isDropCapEnabled) { // If there is an old drop cap inside the paragraph if (this.dropCapLetter) { this.elements.$dropCap.remove(); this.elements.$paragraph.prepend(this.dropCapLetter); this.dropCapLetter = ''; } return; } const $paragraph = this.elements.$paragraph; if (!$paragraph.length) { return; } const paragraphContent = $paragraph.html().replace(/ /g, ' '), firstLetterMatch = paragraphContent.match(/^ *([^ ] ?)/); if (!firstLetterMatch) { return; } const firstLetter = firstLetterMatch[1], trimmedFirstLetter = firstLetter.trim(); // Don't apply drop cap when the content starting with an HTML tag if ('<' === trimmedFirstLetter) { return; } this.dropCapLetter = firstLetter; this.elements.$dropCapLetter.text(trimmedFirstLetter); const restoredParagraphContent = paragraphContent.slice(firstLetter.length).replace(/^ */, match => { return new Array(match.length + 1).join(' '); }); $paragraph.html(restoredParagraphContent).prepend(this.elements.$dropCap); } onInit() { super.onInit(...arguments); this.wrapDropCap(); } onElementChange(propertyName) { if ('drop_cap' === propertyName) { this.wrapDropCap(); } } } exports["default"] = TextEditor; /***/ }) }]); //# sourceMappingURL=text-editor.bd4eccbd156d0b1fc3cf.bundle.js.map"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[4854],{1427:(e,t,r)=>{r.d(t,{Z:()=>w});var a=r(69307),o=r(65736),s=r(94333),n=r(69771),l=r(9818),i=r(92819),c=r(7862),m=r.n(c),d=r(86020),u=r(67221),p=r(81921),y=r(20964),_=r(5213),h=r(10431);function g(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e||0===e.length)return null;const a=e.slice(0),o=a.pop();if(o.showFilters(t,r)){const e=(0,h.flattenFilters)(o.filters),r=t[o.param]||o.defaultValue||"all";return(0,i.find)(e,{value:r})}return g(a,t,r)}function f(e){return t=>(0,n.format)(e,t)}class b extends a.Component{shouldComponentUpdate(e){return e.isRequesting!==this.props.isRequesting||e.primaryData.isRequesting!==this.props.primaryData.isRequesting||e.secondaryData.isRequesting!==this.props.secondaryData.isRequesting||!(0,i.isEqual)(e.query,this.props.query)}getItemChartData(){const{primaryData:e,selectedChart:t}=this.props;return e.data.intervals.map((function(e){const r={};return e.subtotals.segments.forEach((function(e){if(e.segment_label){const a=r[e.segment_label]?e.segment_label+" (#"+e.segment_id+")":e.segment_label;r[e.segment_id]={label:a,value:e.subtotals[t.key]||0}}})),{date:(0,n.format)("Y-m-d\\TH:i:s",e.date_start),...r}}))}getTimeChartData(){const{query:e,primaryData:t,secondaryData:r,selectedChart:a,defaultDateRange:o}=this.props,s=(0,p.getIntervalForQuery)(e,o),{primary:l,secondary:i}=(0,p.getCurrentDates)(e,o);return t.data.intervals.map((function(t,o){const c=(0,p.getPreviousDate)(t.date_start,l.after,i.after,e.compare,s),m=r.data.intervals[o];return{date:(0,n.format)("Y-m-d\\TH:i:s",t.date_start),primary:{label:`${l.label} (${l.range})`,labelDate:t.date_start,value:t.subtotals[a.key]||0},secondary:{label:`${i.label} (${i.range})`,labelDate:c.format("YYYY-MM-DD HH:mm:ss"),value:m&&m.subtotals[a.key]||0}}}))}getTimeChartTotals(){const{primaryData:e,secondaryData:t,selectedChart:r}=this.props;return{primary:(0,i.get)(e,["data","totals",r.key],null),secondary:(0,i.get)(t,["data","totals",r.key],null)}}renderChart(e,t,r,s){const{emptySearchResults:n,filterParam:l,interactiveLegend:i,itemsLabel:c,legendPosition:m,path:y,query:_,selectedChart:h,showHeaderControls:g,primaryData:b,defaultDateRange:w}=this.props,v=(0,p.getIntervalForQuery)(_,w),C=(0,p.getAllowedIntervalsForQuery)(_,w),R=(0,p.getDateFormatsForInterval)(v,b.data.intervals.length,{type:"php"}),S=n?(0,o.__)("No data for the current search","woocommerce"):(0,o.__)("No data for the selected date range","woocommerce"),{formatAmount:D,getCurrencyConfig:E}=this.context;return(0,a.createElement)(d.Chart,{allowedIntervals:C,data:r,dateParser:"%Y-%m-%dT%H:%M:%S",emptyMessage:S,filterParam:l,interactiveLegend:i,interval:v,isRequesting:t,itemsLabel:c,legendPosition:m,legendTotals:s,mode:e,path:y,query:_,screenReaderFormat:f(R.screenReaderFormat),showHeaderControls:g,title:h.label,tooltipLabelFormat:f(R.tooltipLabelFormat),tooltipTitle:"time-comparison"===e&&h.label||null,tooltipValueFormat:(0,u.getTooltipValueFormat)(h.type,D),chartType:(0,p.getChartTypeForQuery)(_),valueType:h.type,xFormat:f(R.xFormat),x2Format:f(R.x2Format),currency:E()})}renderItemComparison(){const{isRequesting:e,primaryData:t}=this.props;if(t.isError)return(0,a.createElement)(_.Z,null);const r=e||t.isRequesting,o=this.getItemChartData();return this.renderChart("item-comparison",r,o)}renderTimeComparison(){const{isRequesting:e,primaryData:t,secondaryData:r}=this.props;if(!t||t.isError||r.isError)return(0,a.createElement)(_.Z,null);const o=e||t.isRequesting||r.isRequesting,s=this.getTimeChartData(),n=this.getTimeChartTotals();return this.renderChart("time-comparison",o,s,n)}render(){const{mode:e}=this.props;return"item-comparison"===e?this.renderItemComparison():this.renderTimeComparison()}}b.contextType=y.$,b.propTypes={filters:m().array,isRequesting:m().bool,itemsLabel:m().string,limitProperties:m().array,mode:m().string,path:m().string.isRequired,primaryData:m().object,query:m().object.isRequired,secondaryData:m().object,selectedChart:m().shape({key:m().string.isRequired,label:m().string.isRequired,order:m().oneOf(["asc","desc"]),orderby:m().string,type:m().oneOf(["average","number","currency"]).isRequired}).isRequired},b.defaultProps={isRequesting:!1,primaryData:{data:{intervals:[]},isError:!1,isRequesting:!1},secondaryData:{data:{intervals:[]},isError:!1,isRequesting:!1}};const w=(0,s.compose)((0,l.withSelect)(((e,t)=>{const{charts:r,endpoint:a,filters:o,isRequesting:s,limitProperties:n,query:l,advancedFilters:c}=t,m=n||[a],d=g(o,l),p=(0,i.get)(d,["settings","param"]),y=t.mode||function(e,t){if(e&&t){const r=(0,i.get)(e,["settings","param"]);if(!r||Object.keys(t).includes(r))return(0,i.get)(e,["chartMode"])}return null}(d,l)||"time-comparison",{woocommerce_default_date_range:_}=e(u.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),h=e(u.REPORTS_STORE_NAME),f={mode:y,filterParam:p,defaultDateRange:_};if(s)return f;const b=m.some((e=>l[e]&&l[e].length));if(l.search&&!b)return{...f,emptySearchResults:!0};const w=r&&r.map((e=>e.key)),v=(0,u.getReportChartData)({endpoint:a,dataType:"primary",query:l,selector:h,limitBy:m,filters:o,advancedFilters:c,defaultDateRange:_,fields:w});if("item-comparison"===y)return{...f,primaryData:v};const C=(0,u.getReportChartData)({endpoint:a,dataType:"secondary",query:l,selector:h,limitBy:m,filters:o,advancedFilters:c,defaultDateRange:_,fields:w});return{...f,primaryData:v,secondaryData:C}})))(b)},10140:(e,t,r)=>{r.d(t,{Z:()=>f});var a=r(69307),o=r(65736),s=r(94333),n=r(9818),l=r(7862),i=r.n(l),c=r(10431),m=r(86020),d=r(81595),u=r(67221),p=r(81921),y=r(14599),_=r(5213),h=r(20964);class g extends a.Component{formatVal(e,t){const{formatAmount:r,getCurrencyConfig:a}=this.context;return"currency"===t?r(e):(0,d.formatValue)(a(),t,e)}getValues(e,t){const{emptySearchResults:r,summaryData:a}=this.props,{totals:o}=a,s=o.primary?o.primary[e]:0,n=o.secondary?o.secondary[e]:0,l=r?0:s,i=r?0:n;return{delta:(0,d.calculateDelta)(l,i),prevValue:this.formatVal(i,t),value:this.formatVal(l,t)}}render(){const{charts:e,query:t,selectedChart:r,summaryData:s,endpoint:n,report:l,defaultDateRange:i}=this.props,{isError:d,isRequesting:u}=s;if(d)return(0,a.createElement)(_.Z,null);if(u)return(0,a.createElement)(m.SummaryListPlaceholder,{numberOfItems:e.length});const{compare:h}=(0,p.getDateParamsFromQuery)(t,i);return(0,a.createElement)(m.SummaryList,null,(t=>{let{onToggle:s}=t;return e.map((e=>{const{key:t,order:i,orderby:d,label:u,type:p,isReverseTrend:_,labelTooltipText:g}=e,f={chart:t};d&&(f.orderby=d),i&&(f.order=i);const b=(0,c.getNewPath)(f),w=r.key===t,{delta:v,prevValue:C,value:R}=this.getValues(t,p);return(0,a.createElement)(m.SummaryNumber,{key:t,delta:v,href:b,label:u,reverseTrend:_,prevLabel:"previous_period"===h?(0,o.__)("Previous period:","woocommerce"):(0,o.__)("Previous year:","woocommerce"),prevValue:C,selected:w,value:R,labelTooltipText:g,onLinkClickCallback:()=>{s&&s(),(0,y.recordEvent)("analytics_chart_tab_click",{report:l||n,key:t})}})}))}))}}g.propTypes={charts:i().array.isRequired,endpoint:i().string.isRequired,limitProperties:i().array,query:i().object.isRequired,selectedChart:i().shape({key:i().string.isRequired,label:i().string.isRequired,order:i().oneOf(["asc","desc"]),orderby:i().string,type:i().oneOf(["average","number","currency"]).isRequired}).isRequired,summaryData:i().object,report:i().string},g.defaultProps={summaryData:{totals:{primary:{},secondary:{}},isError:!1}},g.contextType=h.$;const f=(0,s.compose)((0,n.withSelect)(((e,t)=>{const{charts:r,endpoint:a,limitProperties:o,query:s,filters:n,advancedFilters:l}=t,i=o||[a],c=i.some((e=>s[e]&&s[e].length));if(s.search&&!c)return{emptySearchResults:!0};const m=r&&r.map((e=>e.key)),{woocommerce_default_date_range:d}=e(u.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{summaryData:(0,u.getSummaryNumbers)({endpoint:a,query:s,select:e,limitBy:i,filters:n,advancedFilters:l,defaultDateRange:d,fields:m}),defaultDateRange:d}})))(g)},68702:(e,t,r)=>{r.d(t,{O3:()=>n,be:()=>i,u8:()=>l});var a=r(65736),o=r(92694),s=r(84422);const n=(0,o.applyFilters)("woocommerce_admin_downloads_report_charts",[{key:"download_count",label:(0,a.__)("Downloads","woocommerce"),type:"number"}]),l=(0,o.applyFilters)("woocommerce_admin_downloads_report_filters",[{label:(0,a.__)("Show","woocommerce"),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:(0,a.__)("All downloads","woocommerce"),value:"all"},{label:(0,a.__)("Advanced filters","woocommerce"),value:"advanced"}]}]),i=(0,o.applyFilters)("woocommerce_admin_downloads_report_advanced_filters",{title:(0,a._x)("Downloads match {{select /}} filters","A sentence describing filters for Downloads. See screen shot for context: https://cloudup.com/ccxhyH2mEDg","woocommerce"),filters:{product:{labels:{add:(0,a.__)("Product","woocommerce"),placeholder:(0,a.__)("Search","woocommerce"),remove:(0,a.__)("Remove product filter","woocommerce"),rule:(0,a.__)("Select a product filter match","woocommerce"),title:(0,a.__)("{{title}}Product{{/title}} {{rule /}} {{filter /}}","woocommerce"),filter:(0,a.__)("Select product","woocommerce")},rules:[{value:"includes",label:(0,a._x)("Includes","products","woocommerce")},{value:"excludes",label:(0,a._x)("Excludes","products","woocommerce")}],input:{component:"Search",type:"products",getLabels:s.oC}},customer:{labels:{add:(0,a.__)("Username","woocommerce"),placeholder:(0,a.__)("Search customer username","woocommerce"),remove:(0,a.__)("Remove customer username filter","woocommerce"),rule:(0,a.__)("Select a customer username filter match","woocommerce"),title:(0,a.__)("{{title}}Username{{/title}} {{rule /}} {{filter /}}","woocommerce"),filter:(0,a.__)("Select customer username","woocommerce")},rules:[{value:"includes",label:(0,a._x)("Includes","customer usernames","woocommerce")},{value:"excludes",label:(0,a._x)("Excludes","customer usernames","woocommerce")}],input:{component:"Search",type:"usernames",getLabels:s.jk}},order:{labels:{add:(0,a.__)("Order #","woocommerce"),placeholder:(0,a.__)("Search order number","woocommerce"),remove:(0,a.__)("Remove order number filter","woocommerce"),rule:(0,a.__)("Select a order number filter match","woocommerce"),title:(0,a.__)("{{title}}Order #{{/title}} {{rule /}} {{filter /}}","woocommerce"),filter:(0,a.__)("Select order number","woocommerce")},rules:[{value:"includes",label:(0,a._x)("Includes","order numbers","woocommerce")},{value:"excludes",label:(0,a._x)("Excludes","order numbers","woocommerce")}],input:{component:"Search",type:"orders",getLabels:async e=>{const t=e.split(",");return await t.map((e=>({id:e,label:"#"+e})))}}},ip_address:{labels:{add:(0,a.__)("IP Address","woocommerce"),placeholder:(0,a.__)("Search IP address","woocommerce"),remove:(0,a.__)("Remove IP address filter","woocommerce"),rule:(0,a.__)("Select an IP address filter match","woocommerce"),title:(0,a.__)("{{title}}IP Address{{/title}} {{rule /}} {{filter /}}","woocommerce"),filter:(0,a.__)("Select IP address","woocommerce")},rules:[{value:"includes",label:(0,a._x)("Includes","IP addresses","woocommerce")},{value:"excludes",label:(0,a._x)("Excludes","IP addresses","woocommerce")}],input:{component:"Search",type:"downloadIps",getLabels:async e=>{const t=e.split(",");return await t.map((e=>({id:e,label:e})))}}}}})},1643:(e,t,r)=>{r.r(t),r.d(t,{default:()=>q});var a=r(69307),o=r(7862),s=r.n(o),n=r(68702),l=r(65736),i=r(9818),c=r(92819),m=r(76292),d=r.n(m),u=r(86020),p=r(10431),y=r(81595),_=r(74617),h=r(67221),g=r(81921),f=r(35063),b=r(20964),w=r(27182);class v extends a.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:(0,l.__)("Date","woocommerce"),key:"date",defaultSort:!0,required:!0,isLeftAligned:!0,isSortable:!0},{label:(0,l.__)("Product title","woocommerce"),key:"product",isSortable:!0,required:!0},{label:(0,l.__)("File name","woocommerce"),key:"file_name"},{label:(0,l.__)("Order #","woocommerce"),screenReaderLabel:(0,l.__)("Order Number","woocommerce"),key:"order_number"},{label:(0,l.__)("Username","woocommerce"),key:"user_id"},{label:(0,l.__)("IP","woocommerce"),key:"ip_address"}]}getRowsContent(e){const{query:t}=this.props,r=(0,p.getPersistedQuery)(t),o=(0,w.O3)("dateFormat",g.defaultTableDateFormat);return(0,c.map)(e,(e=>{const{_embedded:t,date:s,file_name:n,file_path:i,ip_address:c,order_id:m,order_number:d,product_id:y,username:h}=e,{code:g,name:f}=t.product[0];let b,w;if("woocommerce_rest_product_invalid_id"===g)b=(0,l.__)("(Deleted)","woocommerce"),w=(0,l.__)("(Deleted)","woocommerce");else{const e=(0,p.getNewPath)(r,"/analytics/products",{filter:"single_product",products:y});b=(0,a.createElement)(u.Link,{href:e,type:"wc-admin"},f),w=f}return[{display:(0,a.createElement)(u.Date,{date:s,visibleFormat:o}),value:s},{display:b,value:w},{display:(0,a.createElement)(u.Link,{href:i,type:"external"},n),value:n},{display:(0,a.createElement)(u.Link,{href:(0,_.getAdminLink)(`post.php?post=${m}&action=edit`),type:"wp-admin"},d),value:d},{display:h,value:h},{display:c,value:c}]}))}getSummary(e){const{download_count:t=0}=e,{query:r,defaultDateRange:a}=this.props,o=(0,g.getCurrentDates)(r,a),s=d()(o.primary.after),n=d()(o.primary.before).diff(s,"days")+1,i=this.context.getCurrencyConfig();return[{label:(0,l._n)("day","days",n,"woocommerce"),value:(0,y.formatValue)(i,"number",n)},{label:(0,l._n)("Download","Downloads",t,"woocommerce"),value:(0,y.formatValue)(i,"number",t)}]}render(){const{query:e,filters:t,advancedFilters:r}=this.props;return(0,a.createElement)(f.Z,{endpoint:"downloads",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["download_count"],query:e,tableQuery:{_embed:!0},title:(0,l.__)("Downloads","woocommerce"),columnPrefsKey:"downloads_report_columns",filters:t,advancedFilters:r})}}v.contextType=b.$;const C=(0,i.withSelect)((e=>{const{woocommerce_default_date_range:t}=e(h.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}}))(v);var R=r(60996),S=r(1427),D=r(10140),E=r(79934);class q extends a.Component{render(){const{query:e,path:t}=this.props;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(E.Z,{query:e,path:t,filters:n.u8,advancedFilters:n.be,report:"downloads"}),(0,a.createElement)(D.Z,{charts:n.O3,endpoint:"downloads",query:e,selectedChart:(0,R.Z)(e.chart,n.O3),filters:n.u8,advancedFilters:n.be}),(0,a.createElement)(S.Z,{charts:n.O3,endpoint:"downloads",path:t,query:e,selectedChart:(0,R.Z)(e.chart,n.O3),filters:n.u8,advancedFilters:n.be}),(0,a.createElement)(C,{query:e,filters:n.u8,advancedFilters:n.be}))}}q.propTypes={query:s().object.isRequired}},39565:(e,t,r)=>{r.d(t,{I:()=>o});var a=r(65736);function o(e){return[e.country,e.state,e.name||(0,a.__)("TAX","woocommerce"),e.priority].map((e=>e.toString().toUpperCase().trim())).filter(Boolean).join("-")}},84422:(e,t,r)=>{r.d(t,{FI:()=>h,V1:()=>g,YC:()=>u,hQ:()=>p,jk:()=>y,oC:()=>_,qc:()=>d,uC:()=>f});var a=r(96483),o=r(86989),s=r.n(o),n=r(92819),l=r(10431),i=r(67221),c=r(39565),m=r(27182);function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.identity;return function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;const n="function"==typeof e?e(o):e,i=(0,l.getIdsFromQuery)(r);if(i.length<1)return Promise.resolve([]);const c={include:i.join(","),per_page:i.length};return s()({path:(0,a.addQueryArgs)(n,c)}).then((e=>e.map(t)))}}d(i.NAMESPACE+"/products/attributes",(e=>({key:e.id,label:e.name})));const u=d(i.NAMESPACE+"/products/categories",(e=>({key:e.id,label:e.name}))),p=d(i.NAMESPACE+"/coupons",(e=>({key:e.id,label:e.code}))),y=d(i.NAMESPACE+"/customers",(e=>({key:e.id,label:e.name}))),_=d(i.NAMESPACE+"/products",(e=>({key:e.id,label:e.name}))),h=d(i.NAMESPACE+"/taxes",(e=>({key:e.id,label:(0,c.I)(e)})));function g(e){let{attributes:t,name:r}=e;const a=(0,m.O3)("variationTitleAttributesSeparator"," - ");if(r&&r.indexOf(a)>-1)return r;const o=(t||[]).map((e=>{let{option:t}=e;return t})).join(", ");return o?r+a+o:r}const f=d((e=>{let{products:t}=e;return t?i.NAMESPACE+`/products/${t}/variations`:i.NAMESPACE+"/variations"}),(e=>({key:e.id,label:g(e)})))},60996:(e,t,r)=>{r.d(t,{Z:()=>o});var a=r(92819);function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,a.find)(t,{key:e});return r||t[0]}}}]);/** * External dependencies */ import { triggerFragmentRefresh, triggerAddedToCartEvent, triggerAddingToCartEvent, } from '@woocommerce/base-utils'; /** * Default export for registering the controls with the store. * * @return {Object} An object with the controls to register with the store on the controls property of the registration object. */ export const controls = { UPDATE_LEGACY_CART_FRAGMENTS() { triggerFragmentRefresh(); }, TRIGGER_ADDING_TO_CART_EVENT() { triggerAddingToCartEvent(); }, TRIGGER_ADDED_TO_CART_EVENT( preserveCartData ) { triggerAddedToCartEvent( preserveCartData ); }, }; /*global wc_setup_params */ /*global wc_setup_currencies */ /*global wc_base_state */ /* @deprecated 4.6.0 */ jQuery( function( $ ) { function blockWizardUI() { $('.wc-setup-content').block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); } $( '.button-next' ).on( 'click', function() { var form = $( this ).parents( 'form' ).get( 0 ); if ( ( 'function' !== typeof form.checkValidity ) || form.checkValidity() ) { blockWizardUI(); } return true; } ); $( 'form.address-step' ).on( 'submit', function( e ) { var form = $( this ); if ( ( 'function' !== typeof form.checkValidity ) || form.checkValidity() ) { blockWizardUI(); } e.preventDefault(); $('.wc-setup-content').unblock(); $( this ).WCBackboneModal( { template: 'wc-modal-tracking-setup' } ); $( document.body ).on( 'wc_backbone_modal_response', function() { form.off( 'submit' ).trigger( 'submit' ); } ); $( '#wc_tracker_checkbox_dialog' ).on( 'change', function( e ) { var eventTarget = $( e.target ); $( '#wc_tracker_checkbox' ).prop( 'checked', eventTarget.prop( 'checked' ) ); } ); $( '#wc_tracker_submit' ).on( 'click', function () { form.off( 'submit' ).trigger( 'submit' ); } ); return true; } ); $( '#store_country' ).on( 'change', function() { // Prevent if we don't have the metabox data if ( wc_setup_params.states === null ){ return; } var $this = $( this ), country = $this.val(), $state_select = $( '#store_state' ); if ( ! $.isEmptyObject( wc_setup_params.states[ country ] ) ) { var states = wc_setup_params.states[ country ]; $state_select.empty(); $.each( states, function( index ) { $state_select.append( $( '' ) ); } ); $( '.store-state-container' ).show(); $state_select.selectWoo().val( wc_base_state ).trigger( 'change' ).prop( 'required', true ); } else { $( '.store-state-container' ).hide(); $state_select.empty().val( '' ).trigger( 'change' ).prop( 'required', false ); } $( '#currency_code' ).val( wc_setup_currencies[ country ] ).trigger( 'change' ); } ); /* Setup postcode field and validations */ $( '#store_country' ).on( 'change', function() { if ( ! wc_setup_params.postcodes ) { return; } var $this = $( this ), country = $this.val(), $store_postcode_input = $( '#store_postcode' ), country_postcode_obj = wc_setup_params.postcodes[ country ]; // Default to required, if its unknown whether postcode is required or not. if ( $.isEmptyObject( country_postcode_obj ) || country_postcode_obj.required ) { $store_postcode_input.attr( 'required', 'true' ); } else { $store_postcode_input.prop( 'required', false ); } } ); $( '#store_country' ).trigger( 'change' ); $( '.wc-wizard-services' ).on( 'change', '.wc-wizard-service-enable input', function() { if ( $( this ).is( ':checked' ) ) { $( this ).closest( '.wc-wizard-service-toggle' ).removeClass( 'disabled' ); $( this ).closest( '.wc-wizard-service-item' ).addClass( 'checked' ); $( this ).closest( '.wc-wizard-service-item' ) .find( '.wc-wizard-service-settings' ).removeClass( 'hide' ); } else { $( this ).closest( '.wc-wizard-service-toggle' ).addClass( 'disabled' ); $( this ).closest( '.wc-wizard-service-item' ).removeClass( 'checked' ); $( this ).closest( '.wc-wizard-service-item' ) .find( '.wc-wizard-service-settings' ).addClass( 'hide' ); } } ); $( '.wc-wizard-services' ).on( 'keyup', function( e ) { var code = e.keyCode || e.which, $focused = $( document.activeElement ); if ( $focused.is( '.wc-wizard-service-toggle, .wc-wizard-service-enable' ) && ( 13 === code || 32 === code ) ) { $focused.find( ':input' ).trigger( 'click' ); } } ); $( '.wc-wizard-services' ).on( 'click', '.wc-wizard-service-enable', function( e ) { var eventTarget = $( e.target ); if ( eventTarget.is( 'input' ) ) { e.stopPropagation(); return; } var $checkbox = $( this ).find( 'input[type="checkbox"]' ); $checkbox.prop( 'checked', ! $checkbox.prop( 'checked' ) ).trigger( 'change' ); } ); $( '.wc-wizard-services-list-toggle' ).on( 'click', function() { var listToggle = $( this ).closest( '.wc-wizard-services-list-toggle' ); if ( listToggle.hasClass( 'closed' ) ) { listToggle.removeClass( 'closed' ); } else { listToggle.addClass( 'closed' ); } $( this ).closest( '.wc-wizard-services' ).find( '.wc-wizard-service-item' ) .slideToggle() .css( 'display', 'flex' ); } ); $( '.wc-wizard-services' ).on( 'change', '.wc-wizard-shipping-method-select .method', function( e ) { var zone = $( this ).closest( '.wc-wizard-service-description' ); var selectedMethod = e.target.value; var description = zone.find( '.shipping-method-descriptions' ); description.find( '.shipping-method-description' ).addClass( 'hide' ); description.find( '.' + selectedMethod ).removeClass( 'hide' ); var $checkbox = zone.parent().find( 'input[type="checkbox"]' ); var settings = zone.find( '.shipping-method-settings' ); settings .find( '.shipping-method-setting' ) .addClass( 'hide' ) .find( '.shipping-method-required-field' ) .prop( 'required', false ); settings .find( '.' + selectedMethod ) .removeClass( 'hide' ) .find( '.shipping-method-required-field' ) .prop( 'required', $checkbox.prop( 'checked' ) ); } ).find( '.wc-wizard-shipping-method-select .method' ).trigger( 'change' ); $( '.wc-wizard-services' ).on( 'change', '.wc-wizard-shipping-method-enable', function() { var checked = $( this ).is( ':checked' ); var selectedMethod = $( this ) .closest( '.wc-wizard-service-item' ) .find( '.wc-wizard-shipping-method-select .method' ) .val(); $( this ) .closest( '.wc-wizard-service-item' ) .find( '.' + selectedMethod ) .find( '.shipping-method-required-field' ) .prop( 'required', checked ); } ); function submitActivateForm() { $( 'form.activate-jetpack' ).trigger( 'submit' ); } function waitForJetpackInstall() { wp.ajax.post( 'setup_wizard_check_jetpack' ) .then( function( result ) { // If we receive success, or an unexpected result // let the form submit. if ( ! result || ! result.is_active || 'yes' === result.is_active ) { return submitActivateForm(); } // Wait until checking the status again setTimeout( waitForJetpackInstall, 3000 ); } ) .fail( function() { // Submit the form as normal if the request fails submitActivateForm(); } ); } // Wait for a pending Jetpack install to finish before triggering a "save" // on the activate step, which launches the Jetpack connection flow. $( '.activate-jetpack' ).on( 'click', '.button-primary', function( e ) { blockWizardUI(); if ( 'no' === wc_setup_params.pending_jetpack_install ) { return true; } e.preventDefault(); waitForJetpackInstall(); } ); $( '.activate-new-onboarding' ).on( 'click', '.button-primary', function() { // Show pending spinner while activate happens. blockWizardUI(); } ); $( '.wc-wizard-services' ).on( 'change', 'input#stripe_create_account, input#ppec_paypal_reroute_requests', function() { if ( $( this ).is( ':checked' ) ) { $( this ).closest( '.wc-wizard-service-settings' ) .find( 'input.payment-email-input' ) .attr( 'type', 'email' ) .prop( 'disabled', false ) .prop( 'required', true ); } else { $( this ).closest( '.wc-wizard-service-settings' ) .find( 'input.payment-email-input' ) .attr( 'type', null ) .prop( 'disabled', true ) .prop( 'required', false ); } } ).find( 'input#stripe_create_account, input#ppec_paypal_reroute_requests' ).trigger( 'change' ); function addPlugins( bySlug, $el, hover ) { var plugins = $el.data( 'plugins' ); for ( var i in Array.isArray( plugins ) ? plugins : [] ) { var slug = plugins[ i ].slug; bySlug[ slug ] = bySlug[ slug ] || $( '' ) .append( '' + plugins[ i ].name + '' ); bySlug[ slug ].find( 'a' ) .on( 'mouseenter mouseleave', ( function( $hover, event ) { $hover.toggleClass( 'plugin-install-source', 'mouseenter' === event.type ); } ).bind( null, hover ? $el.closest( hover ) : $el ) ); } } function updatePluginInfo() { var pluginLinkBySlug = {}; var extraPlugins = []; $( '.wc-wizard-service-enable input:checked' ).each( function() { addPlugins( pluginLinkBySlug, $( this ), '.wc-wizard-service-item' ); var $container = $( this ).closest( '.wc-wizard-service-item' ); $container.find( 'input.payment-checkbox-input:checked' ).each( function() { extraPlugins.push( $( this ).attr( 'id' ) ); addPlugins( pluginLinkBySlug, $( this ), '.wc-wizard-service-settings' ); } ); $container.find( '.wc-wizard-shipping-method-select .method' ).each( function() { var $this = $( this ); if ( 'live_rates' === $this.val() ) { addPlugins( pluginLinkBySlug, $this, '.wc-wizard-service-item' ); } } ); } ); $( '.recommended-item input:checked' ).each( function() { addPlugins( pluginLinkBySlug, $( this ), '.recommended-item' ); } ); var $list = $( 'span.plugin-install-info-list' ).empty(); for ( var slug in pluginLinkBySlug ) { $list.append( pluginLinkBySlug[ slug ] ); } if ( extraPlugins && wc_setup_params.current_step && wc_setup_params.i18n.extra_plugins[ wc_setup_params.current_step ] && wc_setup_params.i18n.extra_plugins[ wc_setup_params.current_step ][ extraPlugins.join( ',' ) ] ) { $list.append( wc_setup_params.i18n.extra_plugins[ wc_setup_params.current_step ][ extraPlugins.join( ',' ) ] ); } $( 'span.plugin-install-info' ).toggle( $list.children().length > 0 ); } updatePluginInfo(); $( '.wc-setup-content' ).on( 'change', '[data-plugins]', updatePluginInfo ); $( document.body ).on( 'init_tooltips', function() { $( '.help_tip' ).tipTip( { 'attribute': 'data-tip', 'fadeIn': 50, 'fadeOut': 50, 'delay': 200, 'defaultPosition': 'top' } ); } ).trigger( 'init_tooltips' ); } ); .wc-block-product-categories { margin-bottom: 1em; &.is-dropdown { display: flex; } select { margin-right: 0.5em; } } .wc-block-product-categories-list--has-images { list-style: none outside; .wc-block-product-categories-list-item { margin: 4px 0 4px 60px; list-style: none outside; clear: both; ul { margin: 4px 0 0; } } .wc-block-product-categories-list-item__image { max-width: 50px; display: inline-block; position: relative; padding: 0; margin: 0; margin-right: 0.5em; margin-left: -60px; position: relative; vertical-align: middle; border: 1px solid #eee; img { display: block; height: auto; margin: 0; max-width: 100%; padding: 0; } } } .wc-block-product-categories-list-item-count::before { content: " ("; } .wc-block-product-categories-list-item-count::after { content: ")"; } .wp-block-woocommerce-product-categories.is-loading .wc-block-product-categories__placeholder { display: inline-block; height: 1em; width: 50%; min-width: 200px; background: currentColor; opacity: 0.2; } .wc-block-product-categories__button { display: flex; align-items: center; margin: 0; padding: 0 0.5em; position: relative; overflow: hidden; svg { fill: currentColor; outline: none; .rtl & { transform: rotate(180deg); } } &:active { color: currentColor; } &:disabled, &[aria-disabled="true"] { cursor: default; opacity: 0.3; } &[aria-disabled="true"]:focus, &:disabled:focus { box-shadow: none; } } @mixin clear-fix { &:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } } @mixin noticon($char, $size: null) { // This isn't very clean, but... we'll see ;) @if $size != 0 { font-size: $size; } content: $char; // Copied verbatim vertical-align: top; text-align: center; display: inline-block; font-family: "Noticons"; font-style: normal; font-weight: normal; font-variant: normal; line-height: 1; text-decoration: inherit; text-transform: none; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; speak: none; } // ========================================================================== // Breakpoint Mixin // See https://wpcalypso.wordpress.com/devdocs/docs/coding-guidelines/css.md#media-queries // ========================================================================== $breakpoints: 480px, 660px, 960px, 1040px; // Think very carefully before adding a new breakpoint @mixin breakpoint( $size ){ @if type-of($size) == string { $approved-value: 0; @each $breakpoint in $breakpoints { $and-larger: ">" + $breakpoint; $and-smaller: "<" + $breakpoint; @if $size == $and-smaller { $approved-value: 1; @media ( max-width: $breakpoint ) { @content; } } @else { @if $size == $and-larger { $approved-value: 2; @media ( min-width: $breakpoint + 1 ) { @content; } } @else { @each $breakpoint-end in $breakpoints { $range: $breakpoint + "-" + $breakpoint-end; @if $size == $range { $approved-value: 3; @media ( min-width: $breakpoint + 1 ) and ( max-width: $breakpoint-end ) { @content; } } } } } } @if $approved-value == 0 { $sizes: ""; @each $breakpoint in $breakpoints { $sizes: $sizes + " " + $breakpoint; } // TODO - change this to use @error, when it is supported by node-sass @warn "ERROR in breakpoint( #{ $size } ): You can only use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth( $breakpoints, 1 ) } >#{ nth( $breakpoints, 1 ) } #{ nth( $breakpoints, 1 ) }-#{ nth( $breakpoints, 2 ) } ]"; } } @else { $sizes: ""; @each $breakpoint in $breakpoints { $sizes: $sizes + " " + $breakpoint; } // TODO - change this to use @error, when it is supported by node-sass @warn "ERROR in breakpoint( #{ $size } ): Please wrap the breakpoint $size in parenthesis. You can use these sizes[ #{$sizes} ] using the following syntax [ <#{ nth( $breakpoints, 1 ) } >#{ nth( $breakpoints, 1 ) } #{ nth( $breakpoints, 1 ) }-#{ nth( $breakpoints, 2 ) } ]"; } } #jp-plugin-container { min-height: 100vh; } (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{100:function(n,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=n=>"string"==typeof n},35:function(n,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return u}));const o=n=>!(n=>null===n)(n)&&n instanceof Object&&n.constructor===Object;function u(n,t){return o(n)&&t in n}}}]); Page not found – UCHM
    /** * @type {import("@woocommerce/type-defs/add-to-cart-form").AddToCartFormStatusConstants} */ export const STATUS = { PRISTINE: 'pristine', IDLE: 'idle', DISABLED: 'disabled', PROCESSING: 'processing', BEFORE_PROCESSING: 'before_processing', AFTER_PROCESSING: 'after_processing', }; export const DEFAULT_STATE = { status: STATUS.PRISTINE, hasError: false, quantity: 0, processingResponse: null, requestParams: {}, }; export const ACTION_TYPES = { SET_PRISTINE: 'set_pristine', SET_IDLE: 'set_idle', SET_DISABLED: 'set_disabled', SET_PROCESSING: 'set_processing', SET_BEFORE_PROCESSING: 'set_before_processing', SET_AFTER_PROCESSING: 'set_after_processing', SET_PROCESSING_RESPONSE: 'set_processing_response', SET_HAS_ERROR: 'set_has_error', SET_NO_ERROR: 'set_no_error', SET_QUANTITY: 'set_quantity', SET_REQUEST_PARAMS: 'set_request_params', };