Modify paths if in a super group

@param   object  $asset  Asset
@return  object
763151
protected function isSuperGroupAsset($asset)
	{
		if ($asset->extensionType() != 'components'
		 || $asset->isDeclaration()
		 || $asset->isExternal())
		{
			return $asset;
		}

		if (defined('JPATH_GROUPCOMPONENT'))
		{
			$base = JPATH_GROUPCOMPONENT;

			$asset->setPath('source', $base . DS . 'assets' . DS . $asset->type() . DS . $asset->file());
			//$asset->setPath('source', $base . DS . $asset->file());
		}

		return $asset;
	}
1115908
public function getAsset($asset)
    {
        $assetId = Utilities::getEntityId(
            $asset,
            'WindowsAzure\MediaServices\Models\Asset'
        );

        return Asset::createFromOptions($this->_getEntity("Assets('{$assetId}')"));
    }
307369
public function add (Asset $asset) : void
    {
        $this->assets[$asset->getAssetPath()] = $asset;
        $this->setAssets($this->assets);
    }
67650
public function setAssets($assets): self
    {
        if (is_array($assets)) {
            $assets = new \ArrayIterator($assets);
        }
        if (!$assets instanceof \Traversable) {
            throw new \InvalidArgumentException('Assets must be an iterable array or object.');
        }
        $this->assets = $assets;

        return $this;
    }
1104849
public function updatePaths(MutableBag $paths)
    {
        if ($paths->isEmpty()) {
            return $paths;
        }

        if ($web = $paths['web']) {
            if ($web === 'public') {
                $paths->remove('web');
            } elseif (strpos($web, '%site%') !== 0) {
                $paths['web'] = '%site%/' . $web;
            }
        }
        $webLength = strlen($web . '/');

        if ($files = $paths['files']) {
            if ($files === $web . '/files') {
                $paths->remove('files');
            } elseif (strpos($files, $web . '/') === 0) {
                $paths['files'] = '%web%/' . substr($files, $webLength);
            }
        }

        if ($paths->has('themebase')) {
            $themes = $paths->remove('themebase');
            if ($themes === $web . '/theme') {
                // nothing
            } elseif (strpos($themes, $web . '/') === 0) {
                $paths['themes'] = '%web%/' . substr($themes, $webLength);
            }
        }

        if ($paths->has('view')) {
            $boltAssets = $paths->remove('view');
            if ($boltAssets === $web . '/bolt-public/view') {
                // nothing
            } elseif (strpos($boltAssets, $web . '/') === 0) {
                $paths['bolt_assets'] = '%web%/' . substr($boltAssets, $webLength);
            }
        }

        if ($var = $paths['var']) {
            if ($var === 'var') {
                $paths->remove('var');
            } elseif (strpos($var, '%site%') !== 0) {
                $paths['var'] = '%site%/' . $var;
            }
        }
        $var = $var ?: 'var';
        $varLength = strlen($var . '/');

        if ($cache = $paths['cache']) {
            // Handle v4 style layouts
            if (strpos($cache, $var . '/') === 0) {
                $paths['cache'] = '%var%/' . substr($cache, $varLength);
            }
        }

        if ($paths->has('app')) {
            return $paths;
        }

        $appPathKeys = ['cache', 'config', 'database'];
        $appPaths = array_intersect_key($paths->toArray(), array_flip($appPathKeys));
        // Only paths without %app% alias in them.
        $appPaths = array_filter($appPaths, function ($path) {
            return strpos($path, '%app%') === false || strpos($path, 'app') === 0;
        });
        if (empty($appPaths)) {
            return $paths;
        }
        $app = $this->determineMostCommonBaseAppPath($appPaths);

        if ($app === 'app') {
            // "app/" is the default "app" path, so don't bother setting.
            $appPathToTrim = 'app/';
        } elseif ($app === '') {
            // no common base path so just ignore app path alias
            $appPathToTrim = '';
        } else {
            // custom app path, set it.
            $site = $paths->get('site', '.');
            $paths['app'] = '%site%/' . Path::makeRelative($app, $site);
            $appPathToTrim = $app . '/';
        }

        foreach ($appPathKeys as $key) {
            if (!($path = $paths[$key])) {
                continue;
            }
            if ($appPathToTrim && strpos($path, $appPathToTrim) === 0) {
                $path = Str::replaceFirst($path, $appPathToTrim, '');
                if ($path === $key) {
                    $paths->remove($key);
                } else {
                    $paths[$key] = '%app%/' . $path;
                }
            } else {
                $paths[$key] = $path;
            }
        }

        return $paths;
    }
1154902
protected function _relativizePath($path)
    {
        $plugins = Plugin::loaded();
        $index = array_search('AssetCompress', $plugins);
        unset($plugins[$index]);

        foreach ($plugins as $plugin) {
            $pluginPath = Plugin::path($plugin) . 'webroot';
            if (strpos($path, $pluginPath) === 0) {
                return str_replace($pluginPath, '/' . Inflector::underscore($plugin), $path);
            }
        }
        $path = str_replace(WWW_ROOT, '/', $path);

        return str_replace(DS, '/', $path);
    }
995904
public function purge (Asset $asset)
    {
        $url = $this->getImgixUrl($asset);

        Craft::trace(
            Craft::t(
                'imgix',
                'Purging asset #{id}: {url}', [ 'id' => $asset->id, 'url' => $url ]
            ),
            'imgix');

        return $this->purgeUrl($url);
    }
1150000
public function inline($asset, $content, $group = null)
    {
        $this->parent->inline($asset, $content, $this->mergePassedGroup($asset, $group));

        return $this;
    }
1306535
public function addInlineJs($asset)
    {
        return $this->addType(Assets::JS_COLLECTION, Assets::INLINE_JS_TYPE, $asset, $this->unifyLegacyArguments(\func_get_args(), Assets::INLINE_JS_TYPE));
    }
856885
public function setAssetsCachePath($path)
    {
        if (@file_exists($path) && is_dir($path)) {
            $this->assets_cache_path = realpath($path).'/';
        } elseif (null!==$path_rp = $this->findRealPath($path)) {
            $this->assets_cache_path = rtrim($path_rp, '/').'/';
        } else {
            throw new \InvalidArgumentException(
                sprintf('Assets cache path "%s" was not found or is not a directory!', $path)
            );
        }
        return $this;
    }
858764
public function webpackAsset($asset)
    {
        $asset_id        = $this->public_path . '/' . Compiler::getAliasId($asset);
        $full_asset_path = $this->web_dir . '/' . $asset_id;

        return [
            'js'  => file_exists($full_asset_path . '.js')
                ? $asset_id . '.js?' . filemtime($full_asset_path . '.js')
                : false,
            'css' => file_exists($full_asset_path . '.css')
                ? $asset_id . '.css?' . filemtime($full_asset_path . '.css')
                : false,
        ];
    }
1143866
public function mixed(array $assets)
    {
        $manager = clone $this;

        $manager->clear()
                ->addCollection(new CssCollection)
                ->addCollection(new JavascriptCollection)
                ->addArray($assets);

        return $manager;
    }
1077086
public function addPublicAsset($asset)
    {
        // Remove from protected / deleted lists
        $key = $this->getAssetKey($asset);
        unset($this->protected[$key]);
        unset($this->deleted[$key]);
        // Skip if already public
        if (isset($this->public[$key])) {
            return false;
        }
        unset($asset['Variant']);
        $this->public[$key] = $asset;
        return true;
    }
793173
public function getAsset($asset)
    {
        if (!isset($this->assetCache[$asset])) {
            $this->assetCache[$asset] = $this->assetRepository->createAsset($asset);
        }
        return $this->assetCache[$asset];
    }
816972
protected function mergePassedGroup($asset, $group = null)
    {
        if (!$this->groupPrefix) {
            return $group;
        }
        $group = $group ? $group : $this->namer->guessGroup($asset);

        return $this->groupName($group);
    }
1082216
public function setAssetsDirectory($path)
    {
        $realpath = $this->getFullPath($path, null, true);
        if (@file_exists($realpath) && is_dir($realpath)) {
            $this->_assets_dir = $path;
        } else {
            throw new InvalidArgumentException(
                sprintf('Assets directory "%s" not found !', $path)
            );
        }
        return $this;
    }
204524
protected function getAssetPath(string $asset): string
    {
        $assetConfig = $this->applicationConfig->getSnapshotConfig()->getAssets();
        $location = $assetConfig[$asset]['location'] ?? 'code';
        $path = $this->applicationConfig->getPath($location);
        return "$path/$asset";
    }