<commit_before>require_relative '../../../helpers/carto/html_safe'
require_relative '../api/vizjson_presenter'

module Carto
  module Admin
    class VisualizationPublicMapAdapter
      extend Forwardable
      include Carto::HtmlSafe
          GEOMETRY_MAPPING = {
            'st_multipolygon'    => 'polygon',
            'st_polygon'         => 'polygon',
            'st_multilinestring' => 'line',
            'st_linestring'      => 'line',
            'st_multipoint'      => 'point',
            'st_point'           => 'point'
          }

      delegate [ :type_slide?, :has_permission?, :derived?, :organization, :organization?, :id, :likes, 
                :password_protected?, :varnish_key, :related_tables, :is_password_valid?, :get_auth_tokens, :table, :name,
                :overlays, :created_at, :updated_at, :description, :mapviews, :geometry_types, :privacy,
                :surrogate_key, :has_password? ] => :visualization

      attr_reader :visualization

      def tags
        # TODO: patch for #3611, should be fixed by activerecord-postgres-array but it's not working
        tags = @visualization.tags
        return tags.gsub('{', '').gsub('}', '').split(',') if (tags && tags.kind_of?(String))
        tags
      end

      def initialize(visualization)
        @visualization = visualization
      end

      def to_vizjson(options = {})
        Carto::Api::VizJSONPresenter.new(@visualization, $tables_metadata).to_vizjson(options)
      end<commit_msg>Removed patch<commit_after>require_relative '../../../helpers/carto/html_safe'
require_relative '../api/vizjson_presenter'

module Carto
  module Admin
    class VisualizationPublicMapAdapter
      extend Forwardable
      include Carto::HtmlSafe
          GEOMETRY_MAPPING = {
            'st_multipolygon'    => 'polygon',
            'st_polygon'         => 'polygon',
            'st_multilinestring' => 'line',
            'st_linestring'      => 'line',
            'st_multipoint'      => 'point',
            'st_point'           => 'point'
          }

      delegate [ :type_slide?, :has_permission?, :derived?, :organization, :organization?, :id, :likes, 
                :password_protected?, :varnish_key, :related_tables, :is_password_valid?, :get_auth_tokens, :table, :name,
                :overlays, :created_at, :updated_at, :description, :mapviews, :geometry_types, :privacy, :tags,
                :surrogate_key, :has_password? ] => :visualization

      attr_reader :visualization

      def initialize(visualization)
        @visualization = visualization
      end

      def to_vizjson(options = {})
        Carto::Api::VizJSONPresenter.new(@visualization, $tables_metadata).to_vizjson(options)
      end
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.0014705882352941176, 'mean_word_length': 2.54296875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3314651', 'n_tokens_mistral': 843, 'n_tokens_neox': 803, 'n_words': 155}