<?php
namespace TypeRocket\Elements;

use TypeRocket\Html\Html;
use TypeRocket\Utility\Str;

class Dashicons
{
    protected $icons = [
        'dashicons-menu' => '\f333',
        'dashicons-menu-alt' => '\f228',
        'dashicons-menu-alt2' => '\f329',
        'dashicons-menu-alt3' => '\f349',
        'dashicons-admin-site' => '\f319',
        'dashicons-admin-site-alt' => '\f11d',
        'dashicons-admin-site-alt2' => '\f11e',
        'dashicons-admin-site-alt3' => '\f11f',
        'dashicons-dashboard' => '\f226',
        'dashicons-admin-post' => '\f109',
        'dashicons-admin-media' => '\f104',
        'dashicons-admin-links' => '\f103',
        'dashicons-admin-page' => '\f105',
        'dashicons-admin-comments' => '\f101',
        'dashicons-admin-appearance' => '\f100',
        'dashicons-admin-plugins' => '\f106',
        'dashicons-plugins-checked' => '\f485',
        'dashicons-admin-users' => '\f110',
        'dashicons-admin-tools' => '\f107',
        'dashicons-admin-settings' => '\f108',
        'dashicons-admin-network' => '\f112',
        'dashicons-admin-home' => '\f102',
        'dashicons-admin-generic' => '\f111',
        'dashicons-admin-collapse' => '\f148',
        'dashicons-filter' => '\f536',
        'dashicons-admin-customizer' => '\f540',
        'dashicons-admin-multisite' => '\f541',
        'dashicons-welcome-write-blog' => '\f119',
        'dashicons-welcome-add-page' => '\f133',
        'dashicons-welcome-view-site' => '\f115',
        'dashicons-welcome-widgets-menus' => '\f116',
        'dashicons-welcome-comments' => '\f117',
        'dashicons-welcome-learn-more' => '\f118',
        'dashicons-format-aside' => '\f123',
        'dashicons-format-image' => '\f128',
        'dashicons-format-gallery' => '\f161',
        'dashicons-format-video' => '\f126',
        'dashicons-format-status' => '\f130',
        'dashicons-format-quote' => '\f122',
        'dashicons-format-chat' => '\f125',
        'dashicons-format-audio' => '\f127',
        'dashicons-camera' => '\f306',
        'dashicons-camera-alt' => '\f129',
        'dashicons-images-alt' => '\f232',
        'dashicons-images-alt2' => '\f233',
        'dashicons-video-alt' => '\f234',
        'dashicons-video-alt2' => '\f235',
        'dashicons-video-alt3' => '\f236',
        'dashicons-media-archive' => '\f501',
        'dashicons-media-audio' => '\f500',
        'dashicons-media-code' => '\f499',
        'dashicons-media-default' => '\f498',
        'dashicons-media-document' => '\f497',
        'dashicons-media-interactive' => '\f496',
        'dashicons-media-spreadsheet' => '\f495',
        'dashicons-media-text' => '\f491',
        'dashicons-media-video' => '\f490',
        'dashicons-playlist-audio' => '\f492',
        'dashicons-playlist-video' => '\f493',
        'dashicons-controls-play' => '\f522',
        'dashicons-controls-pause' => '\f523',
        'dashicons-controls-forward' => '\f519',
        'dashicons-controls-skipforward' => '\f517',
        'dashicons-controls-back' => '\f518',
        'dashicons-controls-skipback' => '\f516',
        'dashicons-controls-repeat' => '\f515',
        'dashicons-controls-volumeon' => '\f521',
        'dashicons-controls-volumeoff' => '\f520',
        'dashicons-image-crop' => '\f165',
        'dashicons-image-rotate' => '\f531',
        'dashicons-image-rotate-left' => '\f166',
        'dashicons-image-rotate-right' => '\f167',
        'dashicons-image-flip-vertical' => '\f168',
        'dashicons-image-flip-horizontal' => '\f169',
        'dashicons-image-filter' => '\f533',
        'dashicons-undo' => '\f171',
        'dashicons-redo' => '\f172',
        'dashicons-editor-bold' => '\f200',
        'dashicons-editor-italic' => '\f201',
        'dashicons-editor-ul' => '\f203',
        'dashicons-editor-ol' => '\f204',
        'dashicons-editor-ol-rtl' => '\f12c',
        'dashicons-editor-quote' => '\f205',
        'dashicons-editor-alignleft' => '\f206',
        'dashicons-editor-aligncenter' => '\f207',
        'dashicons-editor-alignright' => '\f208',
        'dashicons-editor-insertmore' => '\f209',
        'dashicons-editor-spellcheck' => '\f210',
        'dashicons-editor-expand' => '\f211',
        'dashicons-editor-contract' => '\f506',
        'dashicons-editor-kitchensink' => '\f212',
        'dashicons-editor-underline' => '\f213',
        'dashicons-editor-justify' => '\f214',
        'dashicons-editor-textcolor' => '\f215',
        'dashicons-editor-paste-word' => '\f216',
        'dashicons-editor-paste-text' => '\f217',
        'dashicons-editor-removeformatting' => '\f218',
        'dashicons-editor-video' => '\f219',
        'dashicons-editor-customchar' => '\f220',
        'dashicons-editor-outdent' => '\f221',
        'dashicons-editor-indent' => '\f222',
        'dashicons-editor-help' => '\f223',
        'dashicons-editor-strikethrough' => '\f224',
        'dashicons-editor-unlink' => '\f225',
        'dashicons-editor-rtl' => '\f320',
        'dashicons-editor-ltr' => '\f10c',
        'dashicons-editor-break' => '\f474',
        'dashicons-editor-code' => '\f475',
        'dashicons-editor-paragraph' => '\f476',
        'dashicons-editor-table' => '\f535',
        'dashicons-align-left' => '\f135',
        'dashicons-align-right' => '\f136',
        'dashicons-align-center' => '\f134',
        'dashicons-align-none' => '\f138',
        'dashicons-lock' => '\f160',
        'dashicons-unlock' => '\f528',
        'dashicons-calendar' => '\f145',
        'dashicons-calendar-alt' => '\f508',
        'dashicons-visibility' => '\f177',
        'dashicons-hidden' => '\f530',
        'dashicons-post-status' => '\f173',
        'dashicons-edit' => '\f464',
        'dashicons-trash' => '\f182',
        'dashicons-sticky' => '\f537',
        'dashicons-external' => '\f504',
        'dashicons-arrow-up' => '\f142',
        'dashicons-arrow-down' => '\f140',
        'dashicons-arrow-right' => '\f139',
        'dashicons-arrow-left' => '\f141',
        'dashicons-arrow-up-alt' => '\f342',
        'dashicons-arrow-down-alt' => '\f346',
        'dashicons-arrow-right-alt' => '\f344',
        'dashicons-arrow-left-alt' => '\f340',
        'dashicons-arrow-up-alt2' => '\f343',
        'dashicons-arrow-down-alt2' => '\f347',
        'dashicons-arrow-right-alt2' => '\f345',
        'dashicons-arrow-left-alt2' => '\f341',
        'dashicons-sort' => '\f156',
        'dashicons-leftright' => '\f229',
        'dashicons-randomize' => '\f503',
        'dashicons-list-view' => '\f163',
        'dashicons-excerpt-view' => '\f164',
        'dashicons-grid-view' => '\f509',
        'dashicons-move' => '\f545',
        'dashicons-share' => '\f237',
        'dashicons-share-alt' => '\f240',
        'dashicons-share-alt2' => '\f242',
        'dashicons-twitter' => '\f301',
        'dashicons-rss' => '\f303',
        'dashicons-email' => '\f465',
        'dashicons-email-alt' => '\f466',
        'dashicons-email-alt2' => '\f467',
        'dashicons-facebook' => '\f304',
        'dashicons-facebook-alt' => '\f305',
        'dashicons-googleplus' => '\f462',
        'dashicons-networking' => '\f325',
        'dashicons-instagram' => '\f12d',
        'dashicons-hammer' => '\f308',
        'dashicons-art' => '\f309',
        'dashicons-migrate' => '\f310',
        'dashicons-performance' => '\f311',
        'dashicons-universal-access' => '\f483',
        'dashicons-universal-access-alt' => '\f507',
        'dashicons-tickets' => '\f486',
        'dashicons-nametag' => '\f484',
        'dashicons-clipboard' => '\f481',
        'dashicons-heart' => '\f487',
        'dashicons-megaphone' => '\f488',
        'dashicons-schedule' => '\f489',
        'dashicons-tide' => '\f10d',
        'dashicons-rest-api' => '\f124',
        'dashicons-code-standards' => '\f13a',
        'dashicons-buddicons-activity' => '\f452',
        'dashicons-buddicons-bbpress-logo' => '\f12b',
        'dashicons-buddicons-buddypress-logo' => '\f448',
        'dashicons-buddicons-community' => '\f453',
        'dashicons-buddicons-forums' => '\f449',
        'dashicons-buddicons-friends' => '\f454',
        'dashicons-buddicons-groups' => '\f456',
        'dashicons-buddicons-pm' => '\f457',
        'dashicons-buddicons-replies' => '\f451',
        'dashicons-buddicons-topics' => '\f450',
        'dashicons-buddicons-tracking' => '\f455',
        'dashicons-wordpress' => '\f120',
        'dashicons-wordpress-alt' => '\f324',
        'dashicons-pressthis' => '\f157',
        'dashicons-update' => '\f463',
        'dashicons-update-alt' => '\f113',
        'dashicons-screenoptions' => '\f180',
        'dashicons-info' => '\f348',
        'dashicons-cart' => '\f174',
        'dashicons-feedback' => '\f175',
        'dashicons-cloud' => '\f176',
        'dashicons-translation' => '\f326',
        'dashicons-tag' => '\f323',
        'dashicons-category' => '\f318',
        'dashicons-archive' => '\f480',
        'dashicons-tagcloud' => '\f479',
        'dashicons-text' => '\f478',
        'dashicons-yes' => '\f147',
        'dashicons-yes-alt' => '\f12a',
        'dashicons-no' => '\f158',
        'dashicons-no-alt' => '\f335',
        'dashicons-plus' => '\f132',
        'dashicons-plus-alt' => '\f502',
        'dashicons-minus' => '\f460',
        'dashicons-dismiss' => '\f153',
        'dashicons-marker' => '\f159',
        'dashicons-star-filled' => '\f155',
        'dashicons-star-half' => '\f459',
        'dashicons-star-empty' => '\f154',
        'dashicons-flag' => '\f227',
        'dashicons-warning' => '\f534',
        'dashicons-location' => '\f230',
        'dashicons-location-alt' => '\f231',
        'dashicons-vault' => '\f178',
        'dashicons-shield' => '\f332',
        'dashicons-shield-alt' => '\f334',
        'dashicons-sos' => '\f468',
        'dashicons-search' => '\f179',
        'dashicons-slides' => '\f181',
        'dashicons-text-page' => '\f121',
        'dashicons-analytics' => '\f183',
        'dashicons-chart-pie' => '\f184',
        'dashicons-chart-bar' => '\f185',
        'dashicons-chart-line' => '\f238',
        'dashicons-chart-area' => '\f239',
        'dashicons-groups' => '\f307',
        'dashicons-businessman' => '\f338',
        'dashicons-businesswoman' => '\f12f',
        'dashicons-businessperson' => '\f12e',
        'dashicons-id' => '\f336',
        'dashicons-id-alt' => '\f337',
        'dashicons-products' => '\f312',
        'dashicons-awards' => '\f313',
        'dashicons-forms' => '\f314',
        'dashicons-testimonial' => '\f473',
        'dashicons-portfolio' => '\f322',
        'dashicons-book' => '\f330',
        'dashicons-book-alt' => '\f331',
        'dashicons-download' => '\f316',
        'dashicons-upload' => '\f317',
        'dashicons-backup' => '\f321',
        'dashicons-clock' => '\f469',
        'dashicons-lightbulb' => '\f339',
        'dashicons-microphone' => '\f482',
        'dashicons-desktop' => '\f472',
        'dashicons-laptop' => '\f547',
        'dashicons-tablet' => '\f471',
        'dashicons-smartphone' => '\f470',
        'dashicons-phone' => '\f525',
        'dashicons-index-card' => '\f510',
        'dashicons-carrot' => '\f511',
        'dashicons-building' => '\f512',
        'dashicons-store' => '\f513',
        'dashicons-album' => '\f514',
        'dashicons-palmtree' => '\f527',
        'dashicons-tickets-alt' => '\f524',
        'dashicons-money' => '\f526',
        'dashicons-smiley' => '\f328',
        'dashicons-thumbs-up' => '\f529',
        'dashicons-thumbs-down' => '\f542',
        'dashicons-layout' => '\f538',
        'dashicons-paperclip' => '\f546',
        'dashicons-games' => '\f18a',
        'dashicons-align-full-width	' => '\f187',
        "dashicons-bank" =>	'\f16a',
        "dashicons-hourglass" =>	'\f18c',
        "dashicons-money-alt" =>	'\f18e',
        "dashicons-open-folder" =>	'\f18f',
        "dashicons-pdf" =>	'\f190',
        "dashicons-pets" =>	'\f191',
        "dashicons-privacy" =>	'\f194',
        "dashicons-superhero" =>	'\f198',
        "dashicons-superhero-alt" =>	'\f197',
        "dashicons-edit-page" =>	'\f186',
        "dashicons-fullscreen-alt" =>	'\f188',
        "dashicons-fullscreen-exit-alt" =>	'\f189',
        "dashicons-beer" =>	'\f16c',
        "dashicons-coffee" =>	'\f16f',
        "dashicons-drumstick" =>	'\f17f',
        "dashicons-food" =>	'\f187',
        "dashicons-calculator" =>	'\f16e',
        "dashicons-printer" =>	'\f193',
        "dashicons-airplane" =>	'\f15f',
        "dashicons-car" =>	'\f16b',
        "dashicons-bell" =>	'\f16d',
        "dashicons-database-add" =>	'\f170',
        "dashicons-database-export" =>	'\f17a',
        "dashicons-database-import" =>	'\f17b',
        "dashicons-database-remove" =>	'\f17c',
        "dashicons-database-view" =>	'\f17d',
        "dashicons-database" =>	'\f17e',
        "dashicons-amazon" =>	'\f162',
        "dashicons-google" =>	'\f18b',
        "dashicons-linkedin" =>	'\f18d',
        "dashicons-pinterest" =>	'\f192',
        "dashicons-podio" =>	'\f19c',
        "dashicons-reddit" =>	'\f195',
        "dashicons-spotify" =>	'\f196',
        "dashicons-twitch" =>	'\f199',
        "dashicons-whatsapp" =>	'\f19a',
        "dashicons-xing" =>	'\f19d',
        "dashicons-youtube" =>	'\f19b',
        "dashicons-align-full-width" =>	'\f114',
        "dashicons-align-pull-left" =>	'\f10a',
        "dashicons-align-pull-right" =>	'\f10b',
        "dashicons-align-wide" =>	'\f11b',
        "dashicons-block-default" =>	'\f12b',
        "dashicons-button" =>	'\f11a',
        "dashicons-cloud-saved" =>	'\f137',
        "dashicons-cloud-upload" =>	'\f13b',
        "dashicons-columns" =>	'\f13c',
        "dashicons-cover-image" =>	'\f13d',
        "dashicons-ellipsis" =>	'\f11c',
        "dashicons-embed-audio" =>	'\f13e',
        "dashicons-embed-generic" =>	'\f13f',
        "dashicons-embed-photo" =>	'\f144',
        "dashicons-embed-post" =>	'\f146',
        "dashicons-embed-video" =>	'\f149',
        "dashicons-exit" =>	'\f14a',
        "dashicons-heading" =>	'\f10e',
        "dashicons-html" =>	'\f14b',
        "dashicons-info-outline" =>	'\f14c',
        "dashicons-insert-after" =>	'\f14d',
        "dashicons-insert-before" =>	'\f14e',
        "dashicons-insert" =>	'\f10f',
        "dashicons-remove" =>	'\f14f',
        "dashicons-shortcode" =>	'\f150',
        "dashicons-table-col-after" =>	'\f151',
        "dashicons-table-col-before" =>	'\f152',
        "dashicons-table-col-delete" =>	'\f15a',
        "dashicons-table-row-after" =>	'\f15b',
        "dashicons-table-row-before" =>	'\f15c',
        "dashicons-table-row-delete" =>	'\f15d',
        "dashicons-saved" =>	'\f15e',
    ];

    /**
     * @return string[]
     */
    public function icons()
    {
        return $this->icons;
    }

    /**
     * @return string[]
     */
    public function iconNames()
    {
        return array_keys($this->icons);
    }

    /**
     * @return static
     */
    public static function new()
    {
        return new static;
    }

    /**
     * @param $name
     *
     * @return string
     */
    public static function getIconClasses($name)
    {
        return 'dashicons dashicons-' . Str::trimStart($name, 'dashicons-');
    }

    /**
     * @param string $name
     * @param string $tag
     *
     * @return string
     */
    public static function getIconHtml($name, $tag = 'i')
    {
        return Html::el($tag, [
            'class' => static::getIconClasses($name)
        ]);
    }
}