Analyze the component structure

@return  void

@since   1.0
962098
private function analyze()
	{
		if (!file_exists($this->adminPath))
		{
			$this->hasAdmin = false;
		}

		if (!file_exists($this->frontPath))
		{
			$this->hasFront = false;
		}

		if (!file_exists($this->sourceFolder . "/cli"))
		{
			$this->hasCli = false;
		}

		if (file_exists($this->sourceFolder . "/media"))
		{
			$this->hasMedia = true;
		}
	}
161097
public function get_components() {

		$components = pods_transient_get( 'pods_components' );

		if ( 1 === (int) pods_v( 'pods_debug_components', 'get', 0 ) && pods_is_admin( array( 'pods' ) ) ) {
			$components = array();
		}

		if ( PODS_VERSION !== PodsInit::$version || ! is_array( $components ) || empty( $components ) || ( is_admin() && 'pods-components' === pods_v( 'page' ) && 1 !== (int) pods_transient_get( 'pods_components_refresh' ) ) ) {
			do_action( 'pods_components_get' );

			// @codingStandardsIgnoreLine
			$component_dir   = @opendir( untrailingslashit( $this->components_dir ) );
			$component_files = array();

			if ( false !== $component_dir ) {
				$file = readdir( $component_dir );

				while ( false !== $file ) {
					if ( '.' === substr( $file, 0, 1 ) ) {
						// Get next file
						$file = readdir( $component_dir );

						continue;
					} elseif ( is_dir( $this->components_dir . $file ) ) {
						// @codingStandardsIgnoreLine
						$component_subdir = @opendir( $this->components_dir . $file );

						if ( $component_subdir ) {
							$subfile = readdir( $component_subdir );

							while ( false !== $subfile ) {
								if ( '.' === substr( $subfile, 0, 1 ) ) {
									// Get next file
									$subfile = readdir( $component_subdir );

									continue;
								} elseif ( '.php' === substr( $subfile, - 4 ) ) {
									$component_files[] = str_replace( '\\', '/', $file . '/' . $subfile );
								}

								// Get next file
								$subfile = readdir( $component_subdir );
							}

							closedir( $component_subdir );
						}
					} elseif ( '.php' === substr( $file, - 4 ) ) {
						$component_files[] = $file;
					}//end if

					// Get next file
					$file = readdir( $component_dir );
				}//end while

				closedir( $component_dir );
			}//end if

			$default_headers = array(
				'ID'               => 'ID',
				'Name'             => 'Name',
				'ShortName'        => 'Short Name',
				'PluginName'       => 'Plugin Name',
				'ComponentName'    => 'Component Name',
				'URI'              => 'URI',
				'MenuName'         => 'Menu Name',
				'MenuPage'         => 'Menu Page',
				'MenuAddPage'      => 'Menu Add Page',
				'MustUse'          => 'Must Use',
				'Description'      => 'Description',
				'Version'          => 'Version',
				'Category'         => 'Category',
				'Author'           => 'Author',
				'AuthorURI'        => 'Author URI',
				'Class'            => 'Class',
				'Hide'             => 'Hide',
				'PluginDependency' => 'Plugin Dependency',
				'ThemeDependency'  => 'Theme Dependency',
				'DeveloperMode'    => 'Developer Mode',
				'TablelessMode'    => 'Tableless Mode',
				'Capability'       => 'Capability',
				'Plugin'           => 'Plugin',
			);

			$component_files = apply_filters( 'pods_components_register', $component_files );

			$components = array();

			foreach ( $component_files as $component_file ) {
				$external = false;

				if ( is_array( $component_file ) && isset( $component_file['File'] ) ) {
					$component_file = $component_file['File'];
					$component      = $component_file;

					$external = true;
				} else {
					$component = $this->components_dir . $component_file;
				}

				if ( ! is_readable( $component ) ) {
					continue;
				}

				$component_data = get_file_data( $component, $default_headers, 'pods_component' );

				if ( ( empty( $component_data['Name'] ) && empty( $component_data['ComponentName'] ) && empty( $component_data['PluginName'] ) ) || 'yes' === $component_data['Hide'] ) {
					continue;
				}

				if ( isset( $component_data['Plugin'] ) && pods_is_plugin_active( $component_data['Plugin'] ) ) {
					continue;
				}

				if ( empty( $component_data['Name'] ) ) {
					if ( ! empty( $component_data['ComponentName'] ) ) {
						$component_data['Name'] = $component_data['ComponentName'];
					} elseif ( ! empty( $component_data['PluginName'] ) ) {
						$component_data['Name'] = $component_data['PluginName'];
					}
				}

				if ( empty( $component_data['ShortName'] ) ) {
					$component_data['ShortName'] = $component_data['Name'];
				}

				if ( empty( $component_data['MenuName'] ) ) {
					$component_data['MenuName'] = $component_data['Name'];
				}

				if ( empty( $component_data['Class'] ) ) {
					$component_data['Class'] = 'Pods_' . pods_js_name( basename( $component, '.php' ), false );
				}

				if ( empty( $component_data['ID'] ) ) {
					$component_data['ID'] = $component_data['Name'];
				}

				$component_data['ID'] = sanitize_title( $component_data['ID'] );

				if ( 'on' === strtolower( $component_data['DeveloperMode'] ) && '1' === $component_data['DeveloperMode'] ) {
					$component_data['DeveloperMode'] = true;
				} else {
					$component_data['DeveloperMode'] = false;
				}

				if ( 'on' === strtolower( $component_data['TablelessMode'] ) && '1' === $component_data['TablelessMode'] ) {
					$component_data['TablelessMode'] = true;
				} else {
					$component_data['TablelessMode'] = false;
				}

				$component_data['External'] = $external;

				if ( 'on' === strtolower( $component_data['MustUse'] ) || '1' === $component_data['MustUse'] ) {
					$component_data['MustUse'] = true;
				} elseif ( 'off' === strtolower( $component_data['MustUse'] ) || '0' === $component_data['MustUse'] ) {
					$component_data['MustUse'] = false;
				} else {
					$component_data['MustUse'] = $component_data['External'];
				}

				$component_data['File'] = $component_file;

				$components[ $component_data['ID'] ] = $component_data;
			}//end foreach

			ksort( $components );

			pods_transient_set( 'pods_components_refresh', 1, ( 60 * 60 * 12 ) );

			pods_transient_set( 'pods_components', $components );
		}//end if

		if ( 1 === (int) pods_v( 'pods_debug_components', 'get', 0 ) && pods_is_admin( array( 'pods' ) ) ) {
			pods_debug( $components );
		}

		$this->components = $components;

		return $this->components;
	}
741768
protected function resolveDependencies()
    {
        $objectManager = $this->bootstrap->getObjectManager();
        $this->baseComponentChain = $objectManager->get(ComponentChain::class);
    }
911677
final public function getComponents()
    {
        if ($this->components === null) {
            $this->setComponents($this->getDefaultComponents());
        }
        return $this->components;
    }
236359
private static function buildComponents()
    {
        static $components_built = false;
        static $components = array();

        if ($components_built) {
            return;
        }

        $components['animation'] = new SwatYUIComponent('animation');
        $components['animation']->addJavaScript();

        $components['autocomplete'] = new SwatYUIComponent('autocomplete');
        $components['autocomplete']->addJavaScript();

        $components['base'] = new SwatYUIComponent('base');
        $components['base']->addStyleSheet();

        $components['button'] = new SwatYUIComponent('button');
        $components['button']->addJavaScript();
        $components['button']->addStyleSheet(
            'button/assets/skins/sam',
            '',
            false
        );

        $components['calendar'] = new SwatYUIComponent('calendar');
        $components['calendar']->addJavaScript();

        $components['charts'] = new SwatYUIComponent('charts');
        $components['charts']->addJavaScript();

        $components['cookie'] = new SwatYUIComponent('cookie');
        $components['cookie']->addJavaScript();

        $components['connection'] = new SwatYUIComponent('connection');
        $components['connection']->addJavaScript();

        $components['container'] = new SwatYUIComponent('container');
        $components['container']->addJavaScript();
        $components['container']->addStyleSheet('container/assets', '', false);

        $components['container_core'] = new SwatYUIComponent('container_core');
        $components['container_core']->addJavaScript('container');
        $components['container_core']->addStyleSheet(
            'container/assets',
            'container-core',
            false
        );

        $components['datasource'] = new SwatYUIComponent('datasource');
        $components['datasource']->addJavaScript();

        $components['datatable'] = new SwatYUIComponent('datatable');
        $components['datatable']->addJavaScript();
        $components['datatable']->addStyleSheet(
            'datatable/assets/skins/sam',
            '',
            false
        );

        $components['dom'] = new SwatYUIComponent('dom');
        $components['dom']->addJavaScript();

        $components['dragdrop'] = new SwatYUIComponent('dragdrop');
        $components['dragdrop']->addJavaScript();

        $components['editor'] = new SwatYUIComponent('editor');
        $components['editor']->addJavaScript();
        $components['editor']->addStyleSheet(
            'editor/assets/skins/sam',
            '',
            false
        );

        $components['simpleeditor'] = new SwatYUIComponent('simpleeditor');
        $components['simpleeditor']->addJavaScript('editor');
        $components['simpleeditor']->addStyleSheet(
            'editor/assets/skins/sam',
            '',
            false
        );

        $components['element'] = new SwatYUIComponent('element');
        $components['element']->addJavaScript();

        $components['event'] = new SwatYUIComponent('event');
        $components['event']->addJavaScript();

        $components['event-delegate'] = new SwatYUIComponent('event-delegate');
        $components['event-delegate']->addJavaScript();

        $components['event-mouseenter'] = new SwatYUIComponent(
            'event-mouseenter'
        );

        $components['event-mouseenter']->addJavaScript();

        $components['fonts'] = new SwatYUIComponent('fonts');
        $components['fonts']->addStyleSheet();

        $components['grids'] = new SwatYUIComponent('grids');
        $components['grids']->addStyleSheet();

        $components['imagecropper'] = new SwatYUIComponent('imagecropper');
        $components['imagecropper']->addJavaScript();
        $components['imagecropper']->addStyleSheet(
            'imagecropper/assets/skins/sam',
            '',
            false
        );

        $components['json'] = new SwatYUIComponent('json');
        $components['json']->addJavaScript();

        $components['logger'] = new SwatYUIComponent('logger');
        $components['logger']->addJavaScript();

        $components['menu'] = new SwatYUIComponent('menu');
        $components['menu']->addJavaScript();
        $components['menu']->addStyleSheet('menu/assets/skins/sam', '', false);

        $components['paginator'] = new SwatYUIComponent('paginator');
        $components['paginator']->addJavaScript();
        $components['paginator']->addStyleSheet(
            'paginator/assets/skins/sam',
            '',
            false
        );

        $components['reset-fonts-grids'] = new SwatYUIComponent(
            'reset-fonts-grids'
        );
        $components['reset-fonts-grids']->addStyleSheet('', '', false);

        $components['reset'] = new SwatYUIComponent('reset');
        $components['reset']->addStyleSheet();

        $components['resize'] = new SwatYUIComponent('resize');
        $components['resize']->addJavaScript();
        $components['resize']->addStyleSheet(
            'resize/assets/skins/sam',
            '',
            false
        );

        $components['selector'] = new SwatYUIComponent('selector');
        $components['selector']->addJavaScript();

        $components['slider'] = new SwatYUIComponent('slider');
        $components['slider']->addJavaScript();

        $components['stylesheet'] = new SwatYUIComponent('stylesheet');
        $components['stylesheet']->addJavaScript();

        $components['swf'] = new SwatYUIComponent('swf');
        $components['swf']->addJavaScript();

        $components['tabview'] = new SwatYUIComponent('tabview');
        $components['tabview']->addJavaScript();
        $components['tabview']->addStyleSheet(
            'tabview/assets/skins/sam',
            '',
            false
        );

        $components['treeview'] = new SwatYUIComponent('treeview');
        $components['treeview']->addJavaScript();

        $components['yahoo'] = new SwatYUIComponent('yahoo');
        $components['yahoo']->addJavaScript();

        // dependencies
        $components['animation']->addDependency($components['yahoo']);
        $components['animation']->addDependency($components['dom']);
        $components['animation']->addDependency($components['event']);

        $components['autocomplete']->addDependency($components['yahoo']);
        $components['autocomplete']->addDependency($components['dom']);
        $components['autocomplete']->addDependency($components['event']);
        $components['autocomplete']->addDependency($components['connection']);
        $components['autocomplete']->addDependency($components['animation']);
        $components['autocomplete']->addDependency($components['datasource']);

        $components['button']->addDependency($components['yahoo']);
        $components['button']->addDependency($components['dom']);
        $components['button']->addDependency($components['event']);
        $components['button']->addDependency($components['element']);
        $components['button']->addDependency($components['container_core']);
        $components['button']->addDependency($components['menu']);

        $components['calendar']->addDependency($components['yahoo']);
        $components['calendar']->addDependency($components['dom']);
        $components['calendar']->addDependency($components['event']);

        $components['charts']->addDependency($components['yahoo']);
        $components['charts']->addDependency($components['dom']);
        $components['charts']->addDependency($components['event']);
        $components['charts']->addDependency($components['element']);
        $components['charts']->addDependency($components['datasource']);
        $components['charts']->addDependency($components['json']);
        $components['charts']->addDependency($components['swf']);

        $components['cookie']->addDependency($components['yahoo']);

        $components['connection']->addDependency($components['yahoo']);
        $components['connection']->addDependency($components['event']);

        $components['container']->addDependency($components['yahoo']);
        $components['container']->addDependency($components['dom']);
        $components['container']->addDependency($components['event']);
        $components['container']->addDependency($components['connection']);
        $components['container']->addDependency($components['animation']);

        $components['container_core']->addDependency($components['yahoo']);
        $components['container_core']->addDependency($components['dom']);
        $components['container_core']->addDependency($components['event']);
        $components['container_core']->addDependency($components['connection']);
        $components['container_core']->addDependency($components['animation']);

        $components['datatable']->addDependency($components['yahoo']);
        $components['datatable']->addDependency($components['datasource']);
        $components['datatable']->addDependency($components['dom']);
        $components['datatable']->addDependency($components['dragdrop']);
        $components['datatable']->addDependency($components['event']);
        $components['datatable']->addDependency($components['element']);
        $components['datatable']->addDependency($components['paginator']);

        $components['dom']->addDependency($components['yahoo']);

        $components['dragdrop']->addDependency($components['yahoo']);
        $components['dragdrop']->addDependency($components['dom']);
        $components['dragdrop']->addDependency($components['event']);

        $components['editor']->addDependency($components['yahoo']);
        $components['editor']->addDependency($components['dom']);
        $components['editor']->addDependency($components['event']);
        $components['editor']->addDependency($components['element']);
        $components['editor']->addDependency($components['button']);

        $components['simpleeditor']->addDependency($components['yahoo']);
        $components['simpleeditor']->addDependency($components['dom']);
        $components['simpleeditor']->addDependency($components['event']);
        $components['simpleeditor']->addDependency($components['element']);

        $components['element']->addDependency($components['yahoo']);
        $components['element']->addDependency($components['dom']);
        $components['element']->addDependency($components['event']);

        $components['event']->addDependency($components['yahoo']);

        $components['event-delegate']->addDependency($components['event']);

        $components['event-mouseenter']->addDependency($components['event']);

        $components['grids']->addDependency($components['fonts']);

        $components['imagecropper']->addDependency($components['yahoo']);
        $components['imagecropper']->addDependency($components['dom']);
        $components['imagecropper']->addDependency($components['event']);
        $components['imagecropper']->addDependency($components['dragdrop']);
        $components['imagecropper']->addDependency($components['element']);
        $components['imagecropper']->addDependency($components['resize']);

        $components['json']->addDependency($components['yahoo']);

        $components['logger']->addDependency($components['yahoo']);
        $components['logger']->addDependency($components['dom']);
        $components['logger']->addDependency($components['event']);
        $components['logger']->addDependency($components['dragdrop']);

        $components['menu']->addDependency($components['yahoo']);
        $components['menu']->addDependency($components['dom']);
        $components['menu']->addDependency($components['event']);
        $components['menu']->addDependency($components['container_core']);

        $components['paginator']->addDependency($components['yahoo']);
        $components['paginator']->addDependency($components['dom']);
        $components['paginator']->addDependency($components['event']);
        $components['paginator']->addDependency($components['element']);

        $components['resize']->addDependency($components['yahoo']);
        $components['resize']->addDependency($components['dom']);
        $components['resize']->addDependency($components['event']);
        $components['resize']->addDependency($components['dragdrop']);
        $components['resize']->addDependency($components['element']);

        $components['selector']->addDependency($components['yahoo']);
        $components['selector']->addDependency($components['dom']);

        $components['slider']->addDependency($components['yahoo']);
        $components['slider']->addDependency($components['dom']);
        $components['slider']->addDependency($components['event']);
        $components['slider']->addDependency($components['dragdrop']);

        $components['stylesheet']->addDependency($components['yahoo']);

        $components['swf']->addDependency($components['yahoo']);
        $components['swf']->addDependency($components['dom']);
        $components['swf']->addDependency($components['event']);
        $components['swf']->addDependency($components['element']);

        $components['tabview']->addDependency($components['yahoo']);
        $components['tabview']->addDependency($components['dom']);
        $components['tabview']->addDependency($components['event']);
        $components['tabview']->addDependency($components['element']);

        $components['treeview']->addDependency($components['yahoo']);

        self::$components = $components;

        $components_built = true;
    }
110366
protected function analyzeSelector()
    {
        if ($this->analyzed === false) {
            // Calculate specificity
            $selector = $this->getValue();

            // Set flags
            $isEscaped = false;
            $inSelectorPart = false;
            $wasEscaped = false;
            $inAttribute = false;

            $countIdSelectors = 0;
            $countClassSelectors = 0;
            $countAttributeSelectors = 0;
            $countPseudoClassSelectors = 0;
            $countTypeSelectors = 0;
            $countPseudoElementSelectors = 0;
            $countUniversalSelectors = 0;

            $charset = $this->getCharset();

            if (preg_match('/[^\x00-\x7f]/', $selector)) {
                $isAscii = false;
                $strLen = mb_strlen($selector, $charset);
            } else {
                $isAscii = true;
                $strLen = strlen($selector);
            }

            for ($i = 0, $j = $strLen; $i < $j; $i++) {
                if ($isAscii === true) {
                    $char = $selector[$i];
                } else {
                    $char = mb_substr($selector, $i, 1, $charset);
                }

                // Check for escape character
                if ($isEscaped === false && $char === "\\") {
                    $isEscaped = true;
                } else {
                    $wasEscaped = $isEscaped;
                    $isEscaped = false;
                }

                // Filter user-defined strings, that can contain special characters, comments etc.
                // and therefore need to be ignored.
                if ($inAttribute === false && $wasEscaped === false && $char === "[") {
                    $countAttributeSelectors++;
                    $inAttribute = true;
                    continue;
                } else {
                    if ($wasEscaped === false && $char === "]") {
                        $inAttribute = false;
                        continue;
                    }
                }

                if ($inAttribute === false) {
                    if ($char === "#") {
                        $countIdSelectors++;
                        $inSelectorPart = true;
                    } elseif ($char === ".") {
                        $countClassSelectors++;
                        $inSelectorPart = true;
                    } elseif ($char === ":") {
                        if ($isAscii === true) {
                            $nextChars = substr($selector, $i);
                        } else {
                            $nextChars = mb_substr($selector, $i, null, $charset);
                        }
                        $nextChars = preg_replace('/^(\:(?:\:)?[-a-z]+)[^-a-z]*.*/', '\\1', $nextChars);

                        // Check for pseudo element selector
                        if (substr($nextChars, $i, 2) === "::") {
                            $countPseudoElementSelectors++;

                            // Check for pseudo element
                            if ($nextChars === "::first-line") {
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_FIRST_LINE;
                            } elseif ($nextChars === "::first-letter") {
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_FIRST_LETTER;
                                // "after" >= CSS3
                            } elseif ($nextChars === "::after") {
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_AFTER;
                                // "before" >= CSS3
                            } elseif ($nextChars === "::before") {
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_BEFORE;
                                // Other pseudo elements
                            } else {
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_UNKNOWN;
                            }
                            $i += (strlen($nextChars) - 1);

                            $inSelectorPart = true;
                            // Special pseudo class selector
                        } elseif ($nextChars === ":not") {
                            // This pseudo class selector is NOT counted, only the contained
                            // elements are counted!
                            $i += (5 - 1);
                            $inSelectorPart = false;
                            // Other pseudo class selectors
                        } else {
                            $countPseudoClassSelectors++;

                            // Check for pseudo class
                            // (and old pseudo element notation < CSS 3)
                            if ($nextChars === ":link") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_LINK;
                            } elseif ($nextChars === ":visited") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_VISITED;
                            } elseif ($nextChars === ":hover") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_HOVER;
                            } elseif ($nextChars === ":active") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_ACTIVE;
                            } elseif ($nextChars === ":focus") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_FOCUS;
                            } elseif ($nextChars === ":checked") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_CHECKED;
                            } elseif ($nextChars === ":enabled") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_ENABLED;
                            } elseif ($nextChars === ":disabled") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_DISABLED;
                            } elseif ($nextChars === ":target") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_TARGET;
                            } elseif ($nextChars === ":empty") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_EMPTY;
                            } elseif ($nextChars === ":lang") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_LANG;
                            }  elseif ($nextChars === ":root") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_ROOT;
                            } elseif ($nextChars === ":nth-child") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_NTH_CHILD;
                            } elseif ($nextChars === ":nth-last-child") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_NTH_LAST_CHILD;
                            } elseif ($nextChars === ":nth-of-type") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_NTH_OF_TYPE;
                            } elseif ($nextChars === ":nth-last-of-type") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_NTH_LAST_OF_TYPE;
                            } elseif ($nextChars === ":first-child") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_FIRST_CHILD;
                            } elseif ($nextChars === ":last-child") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_LAST_CHILD;
                            } elseif ($nextChars === ":only-child") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_ONLY_CHILD;
                            } elseif ($nextChars === ":only-of-type") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_ONLY_OF_TYPE;
                            } elseif ($nextChars === ":first-of-type") {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_FIRST_OF_TYPE;
                            } elseif ($nextChars === ":after") {
                                // Old pseudo element notation < CSS 3
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_AFTER;
                            } elseif ($nextChars === ":before") {
                                // Old pseudo element notation < CSS 3
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_BEFORE;
                            } elseif ($nextChars === ":first-line") {
                                // Old pseudo element notation < CSS 3
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_FIRST_LINE;
                            } elseif ($nextChars === ":first-letter") {
                                // Old pseudo element notation < CSS 3
                                $this->pseudoElements[] = self::PSEUDO_ELEMENT_FIRST_LETTER;
                            } else {
                                $this->pseudoClasses[] = self::PSEUDO_CLASS_UNKNOWN;
                            }
                            $i += (strlen($nextChars) - 1);

                            $inSelectorPart = true;
                        }
                    } else {
                        if ($char === "*") {
                            $countUniversalSelectors++;
                            $inSelectorPart = true;
                        } else {
                            if ($char === "+" || $char === ">" || $char === "~" || /*preg_match('/\s/', $char)*/
                                $char === " " || $char === "\t" || $char === "\f"
                            ) {
                                $inSelectorPart = false;
                            } else {
                                if ($inSelectorPart === false) {
                                    $countTypeSelectors++;
                                    $inSelectorPart = true;
                                }
                            }
                        }
                    }
                }
            }

            // Set specificity
            $this->specificity += ($countIdSelectors * 100);
            $this->specificity += ($countClassSelectors * 10);
            $this->specificity += ($countAttributeSelectors * 10);
            $this->specificity += ($countPseudoClassSelectors * 10);
            $this->specificity += ($countTypeSelectors * 1);
            $this->specificity += ($countPseudoElementSelectors * 1);
            $this->specificity += ($countUniversalSelectors * 0);

            // Update flag
            $this->analyzed = true;
        }
    }
765086
function analyzeDependencies(component) {
  const checkList = ['base'];

  search(
    dependencyTree({
      directory: dir,
      filename: path.join(dir, component, 'index.js'),
      filter: path => !~path.indexOf('node_modules')
    }),
    component,
    checkList
  );

  if (!whiteList.includes(component)) {
    checkList.push(component);
  }

  return checkList.filter(item => checkComponentHasStyle(item));
}
233342
protected function parseComponentSettings()
    {
        $this->settings = $this->getSettingsAttribute();

        $manager = ComponentManager::instance();
        $components = [];
        foreach ($this->settings as $setting => $value) {
            if (!is_array($value)) {
                continue;
            }

            $settingParts = explode(' ', $setting);
            $settingName = $settingParts[0];

            $components[$setting] = $value;
            unset($this->settings[$setting]);
        }

        $this->settings['components'] = $components;
    }
10915
private function componentsReady()
    {
        $this->getRegistryCache()->isAppReady();

        if ($this->componentsloaded) {
            foreach ($this->components as $component) {
                $component->ready($this);
            }
        }
    }
1280286
private function discoverComponentSections()
	{
		$loader = null;
		if (App::has('component'))
		{
			$loader = App::get('component');
		}

		$roots = array(PATH_CORE, PATH_APP);

		// group by component
		foreach ($roots as $base)
		{
			foreach (glob($base . DS . 'components' . DS . 'com_*' . DS . 'api') as $path)
			{
				// get component
				$pieces = explode(DS, $path);
				array_pop($pieces);
				$component = str_replace('com_', '', array_pop($pieces));

				if ($loader && !$loader->isEnabled('com_' . $component))
				{
					continue;
				}

				// add all matching files to section
				$this->sections[$component] = glob($path . DS . 'controllers' . DS . '*.php');
			}
		}
	}
572158
private function dumpStructure() {
    dump("Requesters:");
    dump($this->requesters);

    dump("Request roots:");
    dump($this->requestRoots);

    dump("Request paths:");
    dump($this->requestPaths);

    dump("Local names:");
    dump($this->localNames);

    if (isset($this->tree)) {
      dump("Containment tree:");
      dump($this->tree);
    }
  }
732726
function Analyze() {
		$info = &$this->getid3->info;

		$info['fileformat'] = 'ogg';

		// Warn about illegal tags - only vorbiscomments are allowed
		if (isset($info['id3v2'])) {
			$info['warning'][] = 'Illegal ID3v2 tag present.';
		}
		if (isset($info['id3v1'])) {
			$info['warning'][] = 'Illegal ID3v1 tag present.';
		}
		if (isset($info['ape'])) {
			$info['warning'][] = 'Illegal APE tag present.';
		}


		// Page 1 - Stream Header

		fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);

		$oggpageinfo = $this->ParseOggPageHeader();
		$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;

		if (ftell($this->getid3->fp) >= $this->getid3->fread_buffer_size()) {
			$info['error'][] = 'Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)';
			unset($info['fileformat']);
			unset($info['ogg']);
			return false;
		}

		$filedata = fread($this->getid3->fp, $oggpageinfo['page_length']);
		$filedataoffset = 0;

		if (substr($filedata, 0, 4) == 'fLaC') {

			$info['audio']['dataformat']   = 'flac';
			$info['audio']['bitrate_mode'] = 'vbr';
			$info['audio']['lossless']     = true;

		} elseif (substr($filedata, 1, 6) == 'vorbis') {

			$this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);

		} elseif (substr($filedata, 0, 8) == 'Speex   ') {

			// http://www.speex.org/manual/node10.html

			$info['audio']['dataformat']   = 'speex';
			$info['mime_type']             = 'audio/speex';
			$info['audio']['bitrate_mode'] = 'abr';
			$info['audio']['lossless']     = false;

			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_string']           =                              substr($filedata, $filedataoffset, 8); // hard-coded to 'Speex   '
			$filedataoffset += 8;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']          =                              substr($filedata, $filedataoffset, 20);
			$filedataoffset += 20;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version_id']       = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['header_size']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode_bitstream_version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['bitrate']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['framesize']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr']                    = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['frames_per_packet']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['extra_headers']          = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved1']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;
			$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved2']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
			$filedataoffset += 4;

			$info['speex']['speex_version'] = trim($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']);
			$info['speex']['sample_rate']   = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate'];
			$info['speex']['channels']      = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels'];
			$info['speex']['vbr']           = (bool) $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr'];
			$info['speex']['band_type']     = $this->SpeexBandModeLookup($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']);

			$info['audio']['sample_rate']   = $info['speex']['sample_rate'];
			$info['audio']['channels']      = $info['speex']['channels'];
			if ($info['speex']['vbr']) {
				$info['audio']['bitrate_mode'] = 'vbr';
			}


		} elseif (substr($filedata, 0, 8) == "fishead\x00") {

			// Ogg Skeleton version 3.0 Format Specification
			// http://xiph.org/ogg/doc/skeleton.html
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['version_major']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));
			$filedataoffset += 2;
			$info['ogg']['skeleton']['fishead']['raw']['version_minor']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));
			$filedataoffset += 2;
			$info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['basetime_numerator']           = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['basetime_denominator']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
			$filedataoffset += 8;
			$info['ogg']['skeleton']['fishead']['raw']['utc']                          = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 20));
			$filedataoffset += 20;

			$info['ogg']['skeleton']['fishead']['version']          = $info['ogg']['skeleton']['fishead']['raw']['version_major'].'.'.$info['ogg']['skeleton']['fishead']['raw']['version_minor'];
			$info['ogg']['skeleton']['fishead']['presentationtime'] = $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'];
			$info['ogg']['skeleton']['fishead']['basetime']         = $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator']         / $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator'];
			$info['ogg']['skeleton']['fishead']['utc']              = $info['ogg']['skeleton']['fishead']['raw']['utc'];


			$counter = 0;
			do {
				$oggpageinfo = $this->ParseOggPageHeader();
				$info['ogg']['pageheader'][$oggpageinfo['page_seqno'].'.'.$counter++] = $oggpageinfo;
				$filedata = fread($this->getid3->fp, $oggpageinfo['page_length']);
				fseek($this->getid3->fp, $oggpageinfo['page_end_offset'], SEEK_SET);

				if (substr($filedata, 0, 8) == "fisbone\x00") {

					$filedataoffset = 8;
					$info['ogg']['skeleton']['fisbone']['raw']['message_header_offset']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
					$filedataoffset += 4;
					$info['ogg']['skeleton']['fisbone']['raw']['serial_number']           = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
					$filedataoffset += 4;
					$info['ogg']['skeleton']['fisbone']['raw']['number_header_packets']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
					$filedataoffset += 4;
					$info['ogg']['skeleton']['fisbone']['raw']['granulerate_numerator']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
					$filedataoffset += 8;
					$info['ogg']['skeleton']['fisbone']['raw']['granulerate_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
					$filedataoffset += 8;
					$info['ogg']['skeleton']['fisbone']['raw']['basegranule']             = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
					$filedataoffset += 8;
					$info['ogg']['skeleton']['fisbone']['raw']['preroll']                 = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
					$filedataoffset += 4;
					$info['ogg']['skeleton']['fisbone']['raw']['granuleshift']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));
					$filedataoffset += 1;
					$info['ogg']['skeleton']['fisbone']['raw']['padding']                 =                              substr($filedata, $filedataoffset,  3);
					$filedataoffset += 3;

				} elseif (substr($filedata, 1, 6) == 'theora') {

					$info['video']['dataformat'] = 'theora';
$info['error'][] = 'Ogg Theora not correctly handled in this version of getID3 ['.$this->getid3->version().']';
//break;

				} elseif (substr($filedata, 1, 6) == 'vorbis') {

					$this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);

				} else {
$info['error'][] = 'unexpected';
//break;
				}
			//} while ($oggpageinfo['page_seqno'] == 0);
			} while (($oggpageinfo['page_seqno'] == 0) && (substr($filedata, 0, 8) != "fisbone\x00"));
			fseek($this->getid3->fp, $oggpageinfo['page_start_offset'], SEEK_SET);


$info['error'][] = 'Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']';
//return false;


		} else {

			$info['error'][] = 'Expecting either "Speex   " or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"';
			unset($info['ogg']);
			unset($info['mime_type']);
			return false;

		}

		// Page 2 - Comment Header
		$oggpageinfo = $this->ParseOggPageHeader();
		$info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;

		switch ($info['audio']['dataformat']) {
			case 'vorbis':
				$filedata = fread($this->getid3->fp, $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
				$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, 0, 1));
				$info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] =                              substr($filedata, 1, 6); // hard-coded to 'vorbis'

				$this->ParseVorbisCommentsFilepointer();
				break;

			case 'flac':
				$getid3_flac = new getid3_flac($this->getid3);
				if (!$getid3_flac->FLACparseMETAdata()) {
					$info['error'][] = 'Failed to parse FLAC headers';
					return false;
				}
				unset($getid3_flac);
				break;

			case 'speex':
				fseek($this->getid3->fp, $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length'], SEEK_CUR);
				$this->ParseVorbisCommentsFilepointer();
				break;

		}



		// Last Page - Number of Samples

		if (!getid3_lib::intValueSupported($info['avdataend'])) {

			$info['warning'][] = 'Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)';

		} else {

			fseek($this->getid3->fp, max($info['avdataend'] - $this->getid3->fread_buffer_size(), 0), SEEK_SET);
			$LastChunkOfOgg = strrev(fread($this->getid3->fp, $this->getid3->fread_buffer_size()));
			if ($LastOggSpostion = strpos($LastChunkOfOgg, 'SggO')) {
				fseek($this->getid3->fp, $info['avdataend'] - ($LastOggSpostion + strlen('SggO')), SEEK_SET);
				$info['avdataend'] = ftell($this->getid3->fp);
				$info['ogg']['pageheader']['eos'] = $this->ParseOggPageHeader();
				$info['ogg']['samples']   = $info['ogg']['pageheader']['eos']['pcm_abs_position'];
				if ($info['ogg']['samples'] == 0) {
					$info['error'][] = 'Corrupt Ogg file: eos.number of samples == zero';
					return false;
				}
				if (!empty($info['audio']['sample_rate'])) {
					$info['ogg']['bitrate_average'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['ogg']['samples'] / $info['audio']['sample_rate']);
				}
			}

		}

		if (!empty($info['ogg']['bitrate_average'])) {
			$info['audio']['bitrate'] = $info['ogg']['bitrate_average'];
		} elseif (!empty($info['ogg']['bitrate_nominal'])) {
			$info['audio']['bitrate'] = $info['ogg']['bitrate_nominal'];
		} elseif (!empty($info['ogg']['bitrate_min']) && !empty($info['ogg']['bitrate_max'])) {
			$info['audio']['bitrate'] = ($info['ogg']['bitrate_min'] + $info['ogg']['bitrate_max']) / 2;
		}
		if (isset($info['audio']['bitrate']) && !isset($info['playtime_seconds'])) {
			if ($info['audio']['bitrate'] == 0) {
				$info['error'][] = 'Corrupt Ogg file: bitrate_audio == zero';
				return false;
			}
			$info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']);
		}

		if (isset($info['ogg']['vendor'])) {
			$info['audio']['encoder'] = preg_replace('/^Encoded with /', '', $info['ogg']['vendor']);

			// Vorbis only
			if ($info['audio']['dataformat'] == 'vorbis') {

				// Vorbis 1.0 starts with Xiph.Org
				if  (preg_match('/^Xiph.Org/', $info['audio']['encoder'])) {

					if ($info['audio']['bitrate_mode'] == 'abr') {

						// Set -b 128 on abr files
						$info['audio']['encoder_options'] = '-b '.round($info['ogg']['bitrate_nominal'] / 1000);

					} elseif (($info['audio']['bitrate_mode'] == 'vbr') && ($info['audio']['channels'] == 2) && ($info['audio']['sample_rate'] >= 44100) && ($info['audio']['sample_rate'] <= 48000)) {
						// Set -q N on vbr files
						$info['audio']['encoder_options'] = '-q '.$this->get_quality_from_nominal_bitrate($info['ogg']['bitrate_nominal']);

					}
				}

				if (empty($info['audio']['encoder_options']) && !empty($info['ogg']['bitrate_nominal'])) {
					$info['audio']['encoder_options'] = 'Nominal bitrate: '.intval(round($info['ogg']['bitrate_nominal'] / 1000)).'kbps';
				}
			}
		}

		return true;
	}
1328410
public function renderComponent()
    {
        $name = array_pop($this->componentStack);

        return $this->render($name, $this->componentData($name));
    }
327853
protected function getMainComponentInfo() {
    // Scanning for components and parsing their info is expensive, so cache it.
    if ($this->componentInfo === NULL) {
      $components = $this->componentDiscovery->getMainComponents();

      // Couldn't figure out how to sort the components with a uasort(). Went
      // with the quick and dirty way instead. Don't judge me!
      Element::order($components, [
        'lightning_core',
        'lightning_media',
        'lightning_layout',
        'lightning_workflow',
        'lightning_preview',
      ]);

      $this->componentInfo = array_map(
        function (Extension $component) {
          return $this->infoParser->parse($component->getPathname());
        },
        $components
      );
    }
    return $this->componentInfo;
  }
1103376
def analyze
      @analyze ||= begin
        debug { "Analyzing spec and lock:" }

        if same?
          debug { "  Same!" }
          return lock.manifests
        end

        debug { "  Removed:" } ; removed_dependency_names.each { |name| debug { "    #{name}" } }
        debug { "  ExplicitRemoved:" } ; explicit_removed_dependency_names.each { |name| debug { "    #{name}" } }
        debug { "  Added:" } ; added_dependency_names.each { |name| debug { "    #{name}" } }
        debug { "  NonMatchingAdded:" } ; nonmatching_added_dependency_names.each { |name| debug { "    #{name}" } }
        debug { "  Changed:" } ; changed_dependency_names.each { |name| debug { "    #{name}" } }
        debug { "  DeepKeep:" } ; deep_keep_manifest_names.each { |name| debug { "    #{name}" } }
        debug { "  ShallowStrip:" } ; shallow_strip_manifest_names.each { |name| debug { "    #{name}" } }

        manifests = ManifestSet.new(lock_manifests)
        manifests.deep_keep!(deep_keep_manifest_names)
        manifests.shallow_strip!(shallow_strip_manifest_names)
        manifests.to_a
      end
    end
434369
public static function cleanComponents()
    {
        foreach (self::$components as $name => $component)
        {
            if ( ! $component->persistence)
            {
                self::$components[$name] = null;
                unset(self::$components[$name]);
            }
        }
    }
1140685
protected function detectUiComponents()
    {

        /* @var $extensionsManager Manager */
        $extensionsManager = app()->make(Manager::class);
        $components        = [];
        $directories       = [];

        foreach ($this->paths as $path) {
            try {
                $directories[] = $this->files->directories($path);
            } catch (Exception $ex) {
                continue;
            }
        }

        $directories = count($directories) ? array_merge(...$directories) : [];
        $inner       = [];

        foreach ($directories as $index => $directory) {
            $classBasename = class_basename($directory);

            if (!in_array($classBasename, ['Widgets', 'UiComponents'], true) || !$extensionsManager->getActiveExtensionByPath($directory)) {
                unset($directories[$index]);
                continue;
            }

            if (!empty($componentDirectory = $this->files->directories($directory))) {
                $inner[] = $componentDirectory;
            }
        }

        $inner       = count($inner) ? array_merge(...$inner) : [];
        $directories = array_merge($directories, $inner);

        foreach ($directories as $directory) {
            $components[] = $this->files->files($directory);
        }
        return count($components) ? array_merge(...$components) : [];
    }