/*
This fugly thing exists because VC needs a class for container shortcodes in order to get the VC GUI to work.
The Class must be named as following: WPBakeryShortCode_Component{ComponentName}
488817
private function createContainerClassIfIsNeeded($vcMapping)
    {
        if (isset($vcMapping['is_container']) && $vcMapping['is_container'] === true) {
            $className = sprintf('WPBakeryShortCode_%s', $vcMapping['base']);
            if (!class_exists($className)) {
                eval("class {$className} extends WPBakeryShortCodesContainer {}");
            }
        }
    }
163893
function compileSourcePreCode() {
    var $version = '##version##';

    var componentRenderers = {};

    function extend(target, source) {
        if (source) {
            Object.keys(source).forEach(function (key) {
                var value = source[key];
                if (typeof value !== 'undefined') {
                    target[key] = value;
                }
            });
        }

        return target;
    }

    function each(array, iterator) {
        if (array && array.length > 0) {
            for (var i = 0, l = array.length; i < l; i++) {
                if (iterator(array[i], i) === false) {
                    break;
                }
            }
        }
    }

    function contains(array, value) {
        var result;
        each(array, function (item) {
            result = item === value;
            return !result;
        });

        return result;
    }

    var HTML_ENTITY = {
        /* jshint ignore:start */
        '&': '&amp;',
        '<': '&lt;',
        '>': '&gt;',
        '"': '&quot;',
        /* eslint-disable quotes */
        "'": '&#39;'
        /* eslint-enable quotes */
        /* jshint ignore:end */
    };

    function htmlFilterReplacer(c) {
        return HTML_ENTITY[c];
    }

    function escapeHTML(source) {
        if (source == null) {
            return '';
        }

        if (typeof source === 'string') {
            return source ? source.replace(/[&<>"']/g, htmlFilterReplacer) : '';
        }

        return '' + source;
    }

    function _classFilter(source) {
        if (source instanceof Array) {
            return source.join(' ');
        }

        return source;
    }

    function _styleFilter(source) {
        if (typeof source === 'object') {
            var result = '';
            if (source) {
                Object.keys(source).forEach(function (key) {
                    result += key + ':' + source[key] + ';';
                });
            }

            return result;
        }

        return source;
    }

    function _xclassFilter(source) {
        if (source instanceof Array) {
            source = source.join(' ');
        }

        return source ? ' ' + source : '';
    }

    function _xstyleFilter(source) {
        var result;
        if (typeof source === 'object') {
            result = '';
            if (source) {
                Object.keys(source).forEach(function (key) {
                    result += key + ':' + source[key] + ';';
                });
            }
        }
        else {
            result = source;
        }

        return result ? ';' + result : '';
    }

    function attrFilter(name, value) {
        if (value) {
            return ' ' + name + '="' + value + '"';
        }

        return '';
    }

    function boolAttrFilter(name, value) {
        if (value && value !== 'false' && value !== '0') {
            return ' ' + name;
        }

        return '';
    }

    function callFilter(ctx, name, args) {
        var filter = ctx.proto.filters[name];
        if (typeof filter === 'function') {
            return filter.apply(ctx, args);
        }
    }
}
217701
function(viewClass) {
      var t = this,
          newIdNum = 1,
          components = t.get('components'),
          classParts = viewClass.split('.'),
          appName = classParts[0],
          appView = classParts[1];

      // Instantiate and add the component
      var component = new Component({
        id: Monitor.generateUniqueCollectionId(components, 'c'),
        viewClass: viewClass,
        viewOptions: UI.app[appName][appView].prototype.defaultOptions,
        css: {
          '.nm-cv': 'top:10px;'
        }
      });
      components.add(component);
      return component;
    }
605807
function use(fullQualifiedClassName) {
	var container = use.getContainer(fullQualifiedClassName)
	;
	
	if (container._loader === null) {
		use.loadCount++;
		container._loader = Ajax.factory(
			"get", container._path + use.fileExtension
		);
		container._loader.addEventListener(Ajax.Event.LOAD, function(event) {
			var  domains
				, className
			;
			use.loadCount--;
			// Load into script ram
			container._class = new Function(event.detail.responseText);
			// Import into context
			domains = fullQualifiedClassName.split(use.classPathDelimiter);
			className = domains.pop();
			
			namespace(domains.join(use.classPathDelimiter), function() {
				var contextBackup = null
					, property
				;
				// Save old class name
				if(this.hasOwnProperty(className)) {
					contextBackup = this[className];
				}
				// Run loaded code
				container._class.call(this);
				
				// Restore backup
				if (contextBackup === null) return;
				if (this[className] !== contextBackup) {
					for(property in contextBackup) {
						if(property == className) continue;
						if(this[className].hasOwnProperty(property)) {
							throw new Error(
								"CoreJs: "
								+ "Overlapping namespace with class "
								+ "property '"
								+ fullQualifiedClassName +"."+property
								+"' detected."
							);
						} else {
							this[className][property] = contextBackup[property];
						}
					}
				}
			});
		});
		container._loader.addEventListener(
			Ajax.Event.LOAD, namespace.handleEvent
		);
		container._loader.load();
	}
}
580507
public function columnsShortCodeHandler( $atts, $content, $shortcode ) {
		if ( ! $content ) {
			return '';
		}

		$atts = shortcode_atts(
			[
				'class' => null,
				'count' => 2,
			],
			$atts,
			$shortcode
		);

		$classes = $atts['class'] ?? '';

		switch ( $atts['count'] ) {
			case 2:
				$classes .= ' twocolumn';
				break;
			case 3:
				$classes .= ' threecolumn';
				break;
			default:
				$classes .= ' twocolumn';
		}

		return sprintf(
			'<div class="%1$s">%2$s</div>',
			trim( $classes ),
			wpautop( trim( $content ) )
		);
	}
501710
function initCustomComponents() {
    if (typeof projectConfig.crux.components !== 'string') {
      return false;
    }
    var componentPath = path.normalize(global['__rootdir'] + '/' + projectConfig.crux.components + '/'),
      componentList;
    try {
      componentList = util.readDirectoryRelative(componentPath, 'directory', null, true);
    } catch (e) {
      // there are no app components.
      return false;
    }
    var self = this;
    _.forEach(componentList, function(compName) {
      if (self.__components.indexOf('custom:' + compName) === -1) return;
      try {
        var CompClass = require(path.normalize(componentPath + '/' + compName + '/index.js'));
      } catch (e) {
        console.log(e);
        if (e.message.indexOf('Cannot find module') !== -1 && e.message.indexOf('index.js') !== -1) {
          log.warn('Crux.application: Custom component "%s" does not have index.js. Skipping...', compName);
          return;
        }
        e.message = "[Crux.customComponent: " + compName + "] " + e.message;
        throw e;
      }
      if (typeof CompClass !== 'function' || CompClass.prototype.__type !== 'CruxComponent') {
        throw new Error('[Crux.run()] Crux custom component "' + compName + '" does not extend Crux.Component');
      }
      var compConfig = getComponentConfiguration(compName);
      var compObj = new CompClass(compConfig, appConfig);
      if (compObj.name === 'CruxComponent') {
        compObj.name = compName;
      }
      registryObj.register(compObj);
      compObj.registry(registryObj);
    });
  }
1166185
function Wookmark(container, options) {
    options = options || {};

    if (typeof container === 'string') {
      container = document.querySelector(container);
    }

    // Instance variables.
    this.container = container;
    this.columns = this.resizeTimer = null;
    this.activeItemCount = 0;
    this.placeholders = [];
    this.itemHeightsInitialized = false;
    this.itemHeightsDirty = false;
    this.elementTag = 'div';

    // Bind instance methods
    this.initItems = __bind(this.initItems, this);
    this.updateOptions = __bind(this.updateOptions, this);
    this.onResize = __bind(this.onResize, this);
    this.onRefresh = __bind(this.onRefresh, this);
    this.getItemWidth = __bind(this.getItemWidth, this);
    this.layout = __bind(this.layout, this);
    this.layoutFull = __bind(this.layoutFull, this);
    this.layoutColumns = __bind(this.layoutColumns, this);
    this.filter = __bind(this.filter, this);
    this.clear = __bind(this.clear, this);
    this.getActiveItems = __bind(this.getActiveItems, this);
    this.refreshPlaceholders = __bind(this.refreshPlaceholders, this);
    this.sortElements = __bind(this.sortElements, this);
    this.updateFilterClasses = __bind(this.updateFilterClasses, this);

    // Initialize children of the container
    this.initItems();

    // Initial update and layout
    this.container.style.display = 'block';
    this.updateOptions(options);

    // Collect filter classes after items have been initialized
    this.updateFilterClasses();

    // Listen to resize event of the browser if enabled
    if (this.autoResize) {
      addEventListener(window, 'resize', this.onResize);
    }

    // Listen to external refresh event
    addEventListener(this.container, 'refreshWookmark', this.onRefresh);
  }
512245
public function mediaShortCodeHandler( $atts, $content, $shortcode ) {
		global $wp_embed;
		$atts = shortcode_atts(
			[
				'caption' => null,
				'src' => null,
			], $atts
		);
		$src = $atts['src'] ?? $content;
		if ( str_starts_with( $src, '“' ) || str_starts_with( $src, '”' ) || str_starts_with( $src, '‘' ) || str_starts_with( $src, '’' ) ) {
			$src = trim( $src, '“”‘’' ); // Trim fancy quotes, for MS-Word compatibility
		}
		$src = esc_url_raw( $src );
		if ( ! filter_var( $src, FILTER_VALIDATE_URL ) ) {
			return '';
		}
		// Can't use `do_shortcode_by_tags` because the default callback for 'embed' is `__return_false` - @see \WP_Embed::__construct
		$e = $wp_embed->run_shortcode( sprintf( '[embed src="%s"]', $src ) );
		if ( $atts['caption'] ) {
			return sprintf(
				'<figure class="embed">%1$s<figcaption>%2$s</figcaption></figure>',
				str_replace( [ '<p>', '</p>' ], '', $e ),
				$atts['caption']
			);
		} else {
			return $e;
		}
	}
388284
function(SuperC, proto, name) {
		name = name || gui.Class.ANONYMOUS;
		// TODO: this in devmode if and when we might know the name beforehand
		// C = gui.Function.create ( name, null, this._namedbody ( name ));
		var C = function $Class() {
			if (this instanceof $Class) {
				return gui.Class.$constructor.apply(this, arguments);
			} else {
				return $Class.extend.apply($Class, arguments);
			}
		};
		C.$classid = gui.KeyMaster.generateKey("class");
		C.prototype = Object.create(proto || null);
		C.prototype.constructor = C;
		C = this._internals(C, SuperC);
		C = this._interface(C);
		C = this._classname(C, name);
		return C;
	}
918950
@Override
	public void setCustomPostprocessors(Map<String, String> keysClassNames) {
		for (Entry<String, String> entry : keysClassNames.entrySet()) {
			ResourceBundlePostProcessor customProcessor = (ResourceBundlePostProcessor) ClassLoaderResourceUtils
					.buildObjectInstance((String) entry.getValue());
			boolean isVariantPostProcessor = customProcessor.getClass()
					.getAnnotation(VariantPostProcessor.class) != null;

			if (customProcessor instanceof BundlingProcessLifeCycleListener) {
				listeners.add((BundlingProcessLifeCycleListener) customProcessor);
			}
			String key = (String) entry.getKey();
			customPostProcessors.put(key, getCustomProcessorWrapper(customProcessor, key, isVariantPostProcessor));
		}
	}
771473
function parseAddressComponents(components, short = Options.short) {
  const results = {}
  components.map(component => {
    if (short) { results[component.types[0]] = component.short_name
    } else { results[component.types[0]] = component.long_name }
  })
  return results
}
366703
@Override
	public synchronized WComponent getUI(final Object httpServletRequest) {
		String configuredUIClassName = getComponentToLaunchClassName();

		if (sharedUI == null || !Util.equals(configuredUIClassName, uiClassName)) {
			uiClassName = configuredUIClassName;
			WComponent ui = createUI();

			if (ui instanceof WApplication) {
				sharedUI = (WApplication) ui;
			} else {
				LOG.warn(
						"Top-level component should be a WApplication."
						+ " Creating WApplication wrapper...");

				sharedUI = new WApplication();
				ui.setLocked(false);
				sharedUI.add(ui);
				sharedUI.setLocked(true);
			}

			if (ConfigurationProperties.getLdeServerShowMemoryProfile()) {
				ProfileContainer profiler = new ProfileContainer();

				sharedUI.setLocked(false);
				sharedUI.add(profiler);
				sharedUI.setLocked(true);
			}
		}

		return sharedUI;
	}
799590
function template(templateSpec, env) {
            /* istanbul ignore next */
            if (!env) {
                throw new Exception("No environment passed to template");
            }
            if (!templateSpec || !templateSpec.main) {
                throw new Exception('Unknown template object: ' + typeof templateSpec);
            }

            // Note: Using env.VM references rather than local var references throughout this section to allow
            // for external users to override these as psuedo-supported APIs.
            env.VM.checkRevision(templateSpec.compiler);

            var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {
                if (hash) {
                    context = Utils.extend({}, context, hash);
                }

                var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);

                if (result == null && env.compile) {
                    var options = { helpers: helpers, partials: partials, data: data, depths: depths };
                    partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);
                    result = partials[name](context, options);
                }
                if (result != null) {
                    if (indent) {
                        var lines = result.split('\n');
                        for (var i = 0, l = lines.length; i < l; i++) {
                            if (!lines[i] && i + 1 === l) {
                                break;
                            }

                            lines[i] = indent + lines[i];
                        }
                        result = lines.join('\n');
                    }
                    return result;
                } else {
                    throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
                }
            };

            // Just add water
            var container = {
                lookup: function(depths, name) {
                    var len = depths.length;
                    for (var i = 0; i < len; i++) {
                        if (depths[i] && depths[i][name] != null) {
                            return depths[i][name];
                        }
                    }
                },
                lambda: function(current, context) {
                    return typeof current === 'function' ? current.call(context) : current;
                },

                escapeExpression: Utils.escapeExpression,
                invokePartial: invokePartialWrapper,

                fn: function(i) {
                    return templateSpec[i];
                },

                programs: [],
                program: function(i, data, depths) {
                    var programWrapper = this.programs[i],
                        fn = this.fn(i);
                    if (data || depths) {
                        programWrapper = program(this, i, fn, data, depths);
                    } else if (!programWrapper) {
                        programWrapper = this.programs[i] = program(this, i, fn);
                    }
                    return programWrapper;
                },

                data: function(data, depth) {
                    while (data && depth--) {
                        data = data._parent;
                    }
                    return data;
                },
                merge: function(param, common) {
                    var ret = param || common;

                    if (param && common && (param !== common)) {
                        ret = Utils.extend({}, common, param);
                    }

                    return ret;
                },

                noop: env.VM.noop,
                compilerInfo: templateSpec.compiler
            };

            var ret = function(context, options) {
                options = options || {};
                var data = options.data;

                ret._setup(options);
                if (!options.partial && templateSpec.useData) {
                    data = initData(context, data);
                }
                var depths;
                if (templateSpec.useDepths) {
                    depths = options.depths ? [context].concat(options.depths) : [context];
                }

                return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);
            };
            ret.isTop = true;

            ret._setup = function(options) {
                if (!options.partial) {
                    container.helpers = container.merge(options.helpers, env.helpers);

                    if (templateSpec.usePartial) {
                        container.partials = container.merge(options.partials, env.partials);
                    }
                } else {
                    container.helpers = options.helpers;
                    container.partials = options.partials;
                }
            };

            ret._child = function(i, data, depths) {
                if (templateSpec.useDepths && !depths) {
                    throw new Exception('must pass parent depths');
                }

                return program(container, i, templateSpec[i], data, depths);
            };
            return ret;
        }
1104804
@Override
	public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
		if (!component.isRendered()) {
			return;
		}
		SocialShare socialShare = (SocialShare) component;
		ResponseWriter rw = context.getResponseWriter();
		String clientId = socialShare.getClientId();

		if (!BsfUtils.isStringValued(socialShare.getShares())) {
			return;
		}

		beginResponsiveWrapper(component, rw);

		rw.startElement("div", socialShare);
		rw.writeAttribute("id", clientId + "_wrapper", "id");

		// Create the div container
		rw.startElement("div", socialShare);
		rw.writeAttribute("id", clientId, "id");
		if (BsfUtils.isStringValued(socialShare.getStyle()))
			rw.writeAttribute("style", socialShare.getStyle(), "style");
		rw.writeAttribute("class", socialShare.getStyleClass(), "class");
		rw.endElement("div");

		rw.endElement("div");

		// decode shares
		String shares = "";
		String[] _share = socialShare.getShares().split(",");
		for (int i = 0; i < _share.length; i++) {
			_share[i] = "'" + _share[i] + "'";
			shares += _share[i];
			if (i < _share.length - 1)
				shares += ",";
		}

		String showCount = socialShare.getShowCount();
		if (!"false".equalsIgnoreCase(showCount) && !"true".equalsIgnoreCase(showCount)
				&& BsfUtils.isStringValued(showCount))
			showCount = "'" + showCount + "'";

		String scriptId = "#" + BsfUtils.escapeJQuerySpecialCharsInSelector(clientId);
		rw.startElement("script", socialShare);
		rw.writeText("$(function () { " +
		// social share section
				"$('" + scriptId + "').jsSocials({  "
				+ (BsfUtils.isStringValued(socialShare.getUrl()) ? "url: '" + socialShare.getUrl() + "', " : "")
				+ (BsfUtils.isStringValued(socialShare.getText()) ? "text: '" + socialShare.getText() + "', " : "")
				+ (BsfUtils.isStringValued(socialShare.getShareIn()) ? "shareIn: '" + socialShare.getShareIn() + "', "	: "")
				+ (BsfUtils.isStringValued(showCount) ? "showCount: " + showCount + ", " : "")
				+ (socialShare.isShowLabel() ? "showLabel: true, " : "showLabel: false,") + "shares: [" + shares + "] "
				+ "});" 
				+ (socialShare.isDisableBlock() ?
				// no block
						"" :
						// overlay
						"$('" + scriptId + "_wrapper').block({" 
						      + "	message: '" + socialShare.getBlockMessage() 
						      + "',"
						      + "	css: { " + "		border: 'none', " 
						      + "     padding: '8px', "
						      + "		backgroundColor: '#000', " 
						      + "		'-webkit-border-radius': '10px', "
						      + "		'-moz-border-radius': '10px', " 
						      + " 	'border-radius': '10px', "
						      + "		opacity: 1, " 
						      + "		color: '#fff', " + "		fontSize: '12px', "
						      + "		cursor: 'default', " 
						      + "		top: '40%', " 
						      + "		left: '35%' " 
						      + "	}, "
						      + " overlayCSS: { "
						      + "     backgroundColor: '#000', " 
						      + "     opacity: 0.6, "
						      + "     cursor: 'default' " 
						      + " } " 
						      + "}); " 
						      + "$('" + scriptId
						      + "_wrapper').click(function() { $('" + scriptId + "_wrapper').unblock(); }); ")
				              + "});", null);

		rw.endElement("script");
	}
1053653
<T extends Component> List<T> getFormRowChildren(AbstractComponentContainer container, final Class<T> cls) {

        final List<T> result = Lists.newArrayList();
        CmsVaadinUtils.visitDescendants(container, new Predicate<Component>() {

            public boolean apply(Component comp) {

                if (cls.isAssignableFrom(comp.getClass())) {
                    result.add(cls.cast(comp));
                }
                return true;
            }
        });
        return result;
    }
723084
function createPlatformFactory(parentPlaformFactory, name, providers) {
	        if (providers === void 0) { providers = []; }
	        var marker = new OpaqueToken("Platform: " + name);
	        return function (extraProviders) {
	            if (extraProviders === void 0) { extraProviders = []; }
	            if (!getPlatform()) {
	                if (parentPlaformFactory) {
	                    parentPlaformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
	                }
	                else {
	                    createPlatform(ReflectiveInjector.resolveAndCreate(providers.concat(extraProviders).concat({ provide: marker, useValue: true })));
	                }
	            }
	            return assertPlatform(marker);
	        };
	    }
733980
def code
      # Start with config code
      initializer_code = @client ? generate_config_code : ''
      component_code = ''

      asset_files = AssetFiles.from_cache(@volt_app.app_url, @component_name, @component_paths)
      asset_files.component_paths.each do |component_path, component_name|
        comp_template = ComponentTemplates.new(component_path, component_name, @client)
        initializer_code << comp_template.initializer_code + "\n\n"
        component_code << comp_template.component_code + "\n\n"
      end

      initializer_code + component_code
    end