protected function addRemoteResource(ResourceSettings $settings): bool
    {
        $settings->repositoryKey = $this->getRemoteResourceRepositoryKey($settings);

        if ($this->resources->has($settings->repositoryKey)) {
            ++$settings->order;

            return $this->addRemoteResource($settings);
        }

        if ($settings->url === null && (!$this->mergeResources || !$settings->compile)) {
            $settings->url = $this->getThemeBaseUrl($settings->theme);
        }

        $this->resources->add($settings->repositoryKey, $settings);

        return true;
    }