diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 04af8c186..d915ebae9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,28 +29,12 @@ build: - mix deps.get - mix compile --force -docs-build: - stage: build - only: - - master@pleroma/pleroma - - develop@pleroma/pleroma - variables: - MIX_ENV: dev - PLEROMA_BUILD_ENV: prod - script: - - mix deps.get - - mix compile - - mix docs - artifacts: - paths: - - priv/static/doc - benchmark: stage: benchmark variables: MIX_ENV: benchmark services: - - name: lainsoykaf/postgres-with-rum + - name: postgres:9.6 alias: postgres command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] script: @@ -62,7 +46,7 @@ benchmark: unit-testing: stage: test services: - - name: lainsoykaf/postgres-with-rum + - name: postgres:9.6 alias: postgres command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] script: @@ -74,7 +58,7 @@ unit-testing: unit-testing-rum: stage: test services: - - name: lainsoykaf/postgres-with-rum + - name: minibikini/postgres-with-rum:12 alias: postgres command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] variables: @@ -129,6 +113,7 @@ review_app: - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - ssh-keyscan -H "pleroma.online" >> ~/.ssh/known_hosts - (ssh -t dokku@pleroma.online -- apps:create "$CI_ENVIRONMENT_SLUG") || true + - (ssh -t dokku@pleroma.online -- git:set "$CI_ENVIRONMENT_SLUG" keep-git-dir true) || true - ssh -t dokku@pleroma.online -- config:set "$CI_ENVIRONMENT_SLUG" APP_NAME="$CI_ENVIRONMENT_SLUG" APP_HOST="$CI_ENVIRONMENT_SLUG.pleroma.online" MIX_ENV=dokku - (ssh -t dokku@pleroma.online -- postgres:create $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db) || true - (ssh -t dokku@pleroma.online -- postgres:link $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db "$CI_ENVIRONMENT_SLUG") || true @@ -154,7 +139,7 @@ stop_review_app: - ssh -t dokku@pleroma.online -- --force postgres:destroy $(echo $CI_ENVIRONMENT_SLUG | sed -e 's/-/_/g')_db amd64: - stage: release + stage: release # TODO: Replace with upstream image when 1.9.0 comes out image: rinpatch/elixir:1.9.0-rc.0 only: &release-only diff --git a/CHANGELOG.md b/CHANGELOG.md index acfe4ceb1..3d48cd65a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,15 +10,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - **Breaking:** Elixir >=1.8 is now required (was >= 1.7) +- **Breaking:** attachment links (`config :pleroma, :instance, no_attachment_links` and `config :pleroma, Pleroma.Upload, link_name`) disabled by default - Replaced [pleroma_job_queue](https://git.pleroma.social/pleroma/pleroma_job_queue) and `Pleroma.Web.Federator.RetryQueue` with [Oban](https://github.com/sorentwo/oban) (see [`docs/config.md`](docs/config.md) on migrating customized worker / retry settings) - Introduced [quantum](https://github.com/quantum-elixir/quantum-core) job scheduler - Enabled `:instance, extended_nickname_format` in the default config - Add `rel="ugc"` to all links in statuses, to prevent SEO spam - Extract RSS functionality from OStatus - MRF (Simple Policy): Also use `:accept`/`:reject` on the actors rather than only their activities +- OStatus: Extract RSS functionality +- Deprecated `User.Info` embedded schema (fields moved to `User`) +- Store status data inside Flag activity
API Changes +- **Breaking** Admin API: `PATCH /api/pleroma/admin/users/:nickname/force_password_reset` is now `PATCH /api/pleroma/admin/users/force_password_reset` (accepts `nicknames` array in the request body) - **Breaking:** Admin API: Return link alongside with token on password reset - **Breaking:** `/api/pleroma/admin/users/invite_token` now uses `POST`, changed accepted params and returns full invite in json instead of only token string. - Admin API: Return `total` when querying for reports @@ -27,11 +32,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Mastodon API: Add `pleroma.direct_conversation_id` to the status endpoint (`GET /api/v1/statuses/:id`) - Mastodon API: `pleroma.thread_muted` to the Status entity - Mastodon API: Mark the direct conversation as read for the author when they send a new direct message +- Mastodon API, streaming: Add `pleroma.direct_conversation_id` to the `conversation` stream event payload.
### Added - Refreshing poll results for remote polls - Authentication: Added rate limit for password-authorized actions / login existence checks +- Static Frontend: Add the ability to render user profiles and notices server-side without requiring JS app. - Mix task to re-count statuses for all users (`mix pleroma.count_statuses`) - Support for `X-Forwarded-For` and similar HTTP headers which used by reverse proxies to pass a real user IP address to the backend. Must not be enabled unless your instance is behind at least one reverse proxy (such as Nginx, Apache HTTPD or Varnish Cache).
@@ -46,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Mastodon API: Add `pleroma.unread_conversation_count` to the Account entity - OAuth: support for hierarchical permissions / [Mastodon 2.4.3 OAuth permissions](https://docs.joinmastodon.org/api/permissions/) - Metadata Link: Atom syndication Feed +- Mix task to re-count statuses for all users (`mix pleroma.count_statuses`) - Mastodon API: Add `exclude_visibilities` parameter to the timeline and notification endpoints - Admin API: `/users/:nickname/toggle_activation` endpoint is now deprecated in favor of: `/users/activate`, `/users/deactivate`, both accept `nicknames` array - Admin API: `POST/DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group` are deprecated in favor of: `POST/DELETE /api/pleroma/admin/users/permission_group/:permission_group` (both accept `nicknames` array), `DELETE /api/pleroma/admin/users` (`nickname` query param or `nickname` sent in JSON body) is deprecated in favor of: `DELETE /api/pleroma/admin/users` (`nicknames` query array param or `nicknames` sent in JSON body). @@ -53,24 +61,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Pleroma API: `POST /api/v1/pleroma/conversations/read` to mark all conversations as read - ActivityPub: Support `Move` activities - Mastodon API: Add `/api/v1/markers` for managing timeline read markers - -### Changed -- **Breaking:** Elixir >=1.8 is now required (was >= 1.7) -- **Breaking:** Admin API: Return link alongside with token on password reset -- Replaced [pleroma_job_queue](https://git.pleroma.social/pleroma/pleroma_job_queue) and `Pleroma.Web.Federator.RetryQueue` with [Oban](https://github.com/sorentwo/oban) (see [`docs/config.md`](docs/config.md) on migrating customized worker / retry settings) -- Introduced [quantum](https://github.com/quantum-elixir/quantum-core) job scheduler -- Admin API: Return `total` when querying for reports -- Mastodon API: Return `pleroma.direct_conversation_id` when creating a direct message (`POST /api/v1/statuses`) -- Admin API: Return link alongside with token on password reset -- MRF (Simple Policy): Also use `:accept`/`:reject` on the actors rather than only their activities -- OStatus: Extract RSS functionality -- Mastodon API: Add `pleroma.direct_conversation_id` to the status endpoint (`GET /api/v1/statuses/:id`) -- Mastodon API: Mark the direct conversation as read for the author when they send a new direct message +- Mastodon API: Add the `recipients` parameter to `GET /api/v1/conversations` +- Configuration: `feed` option for user atom feed. +- Pleroma API: Add Emoji reactions
-- Deprecated `User.Info` embedded schema (fields moved to `User`) ### Fixed - Report emails now include functional links to profiles of remote user accounts +- Not being able to log in to some third-party apps when logged in to MastoFE
API Changes diff --git a/README.md b/README.md index dd49822e9..7fc1fd381 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,43 @@ -# Pleroma + -**Note**: This readme as well as complete documentation is also available at +## About -## About Pleroma +Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed. -Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support the same federation standards (OStatus and ActivityPub). What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement either OStatus or ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed. +Pleroma is written in Elixir and uses PostgresSQL for data storage. It's efficient enough to be ran on low-power devices like Raspberry Pi (though we wouldn't recommend storing the database on the internal SD card ;) but can scale well when ran on more powerful hardware (albeit only single-node for now). -Pleroma is written in Elixir, high-performance and can run on small devices like a Raspberry Pi. +For clients it supports the [Mastodon client API](https://docs.joinmastodon.org/api/guidelines/) with Pleroma extensions (see the API section on ). -For clients it supports the [Mastodon client API](https://docs.joinmastodon.org/api/guidelines/) with Pleroma extensions (see "Pleroma's APIs and Mastodon API extensions" section on ). - -- [Client Applications for Pleroma](https://docs-develop.pleroma.social/clients.html) - -If you want to run your own server, feel free to contact us at @lain@pleroma.soykaf.com or in our dev chat at #pleroma on freenode or via matrix at . +- [Client Applications for Pleroma](https://docs-develop.pleroma.social/backend/clients/) ## Installation -**Note:** The guide below may be outdated and in most cases shouldn't be used. Instead check out our [wiki](https://docs.pleroma.social) for platform-specific installation instructions, most likely [Installing on Linux using OTP releases](https://docs.pleroma.social/otp_en.html) is the guide you need. + +### OTP releases (Recommended) +If you are running Linux (glibc or musl) on x86/arm, the recommended way to install Pleroma is by using OTP releases. OTP releases are as close as you can get to binary releases with Erlang/Elixir. The release is self-contained, and provides everything needed to boot it. The installation instructions are available [here](https://docs-develop.pleroma.social/backend/installation/otp_en/). + +### From Source +If your platform is not supported, or you just want to be able to edit the source code easily, you may install Pleroma from source. + +- [Debian-based](https://docs-develop.pleroma.social/backend/installation/debian_based_en/) +- [Debian-based (jp)](https://docs-develop.pleroma.social/backend/installation/debian_based_jp/) +- [Alpine Linux](https://docs-develop.pleroma.social/backend/installation/alpine_linux_en/) +- [Arch Linux](https://docs-develop.pleroma.social/backend/installation/arch_linux_en/) +- [Gentoo Linux](https://docs-develop.pleroma.social/backend/installation/gentoo_en/) +- [NetBSD](https://docs-develop.pleroma.social/backend/installation/netbsd_en/) +- [OpenBSD](https://docs-develop.pleroma.social/backend/installation/openbsd_en/) +- [OpenBSD (fi)](https://docs-develop.pleroma.social/backend/installation/openbsd_fi/) +- [CentOS 7](https://docs-develop.pleroma.social/backend/installation/centos7_en/) ### OS/Distro packages -Currently Pleroma is not packaged by any OS/Distros, but feel free to reach out to us at [#pleroma-dev on freenode](https://webchat.freenode.net/?channels=%23pleroma-dev) or via matrix at for assistance. If you want to change default options in your Pleroma package, please **discuss it with us first**. +Currently Pleroma is not packaged by any OS/Distros, but if you want to package it for one, we can guide you through the process on our [community channels](#community-channels). If you want to change default options in your Pleroma package, please **discuss it with us first**. ### Docker While we don’t provide docker files, other people have written very good ones. Take a look at or . -### Dependencies +## Documentation +- Latest Released revision: +- Latest Git revision: -* Postgresql version 9.6 or newer, including the contrib modules -* Elixir version 1.7 or newer. If your distribution only has an old version available, check [Elixir’s install page](https://elixir-lang.org/install.html) or use a tool like [asdf](https://github.com/asdf-vm/asdf). -* Build-essential tools - -### Configuration - -* Run `mix deps.get` to install elixir dependencies. -* Run `mix pleroma.instance gen`. This will ask you questions about your instance and generate a configuration file in `config/generated_config.exs`. Check that and copy it to either `config/dev.secret.exs` or `config/prod.secret.exs`. It will also create a `config/setup_db.psql`, which you should run as the PostgreSQL superuser (i.e., `sudo -u postgres psql -f config/setup_db.psql`). It will create the database, user, and password you gave `mix pleroma.gen.instance` earlier, as well as set up the necessary extensions in the database. PostgreSQL superuser privileges are only needed for this step. -* For these next steps, the default will be to run pleroma using the dev configuration file, `config/dev.secret.exs`. To run them using the prod config file, prefix each command at the shell with `MIX_ENV=prod`. For example: `MIX_ENV=prod mix phx.server`. Documentation for the config can be found at [`docs/config.md`](docs/config.md) in the repository, or at the "Configuration" page on -* Run `mix ecto.migrate` to run the database migrations. You will have to do this again after certain updates. -* You can check if your instance is configured correctly by running it with `mix phx.server` and checking the instance info endpoint at `/api/v1/instance`. If it shows your uri, name and email correctly, you are configured correctly. If it shows something like `localhost:4000`, your configuration is probably wrong, unless you are running a local development setup. -* The common and convenient way for adding HTTPS is by using Nginx as a reverse proxy. You can look at example Nginx configuration in `installation/pleroma.nginx`. If you need TLS/SSL certificates for HTTPS, you can look get some for free with letsencrypt: . The simplest way to obtain and install a certificate is to use [Certbot.](https://certbot.eff.org) Depending on your specific setup, certbot may be able to get a certificate and configure your web server automatically. - -## Running - -* By default, it listens on port 4000 (TCP), so you can access it on (if you are on the same machine). In case of an error it will restart automatically. - -### Frontends - -Pleroma comes with two frontends. The first one, Pleroma FE, can be reached by normally visiting the site. The other one, based on the Mastodon project, can be found by visiting the /web path of your site. - -### As systemd service (with provided .service file) - -Example .service file can be found in `installation/pleroma.service`. Copy this to `/etc/systemd/system/`. Running `systemctl enable --now pleroma.service` will run Pleroma and enable startup on boot. Logs can be watched by using `journalctl -fu pleroma.service`. - -### As OpenRC service (with provided RC file) - -Copy `installation/init.d/pleroma` to `/etc/init.d/pleroma`. You can add it to the services ran by default with: `rc-update add pleroma` - -### Standalone/run by other means - -Run `mix phx.server` in repository’s root, it will output log into stdout/stderr. - -### Using an upstream proxy for federation - -Add the following to your `dev.secret.exs` or `prod.secret.exs` if you want to proxify all http requests that Pleroma makes to an upstream proxy server: - -```elixir -config :pleroma, :http, - proxy_url: "127.0.0.1:8123" -``` - -This is useful for running Pleroma inside Tor or I2P. - -## Customization and contribution - -The [Pleroma Documentation](https://docs-develop.pleroma.social) offers manuals and guides on how to further customize your instance to your liking and how you can contribute to the project. - -## Troubleshooting - -### No incoming federation - -Check that you correctly forward the `host` header to the backend. It is needed to validate signatures. +## Community Channels +* IRC: **#pleroma** and **#pleroma-dev** on freenode, webchat is available at +* Matrix: and diff --git a/config/config.exs b/config/config.exs index a69d41d17..75f463797 100644 --- a/config/config.exs +++ b/config/config.exs @@ -90,7 +90,7 @@ config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank. config :pleroma, Pleroma.Upload, uploader: Pleroma.Uploaders.Local, filters: [Pleroma.Upload.Filter.Dedupe], - link_name: true, + link_name: false, proxy_remote: false, proxy_opts: [ redirect_on_failure: false, @@ -257,7 +257,7 @@ config :pleroma, :instance, mrf_transparency_exclusions: [], autofollowed_nicknames: [], max_pinned_statuses: 1, - no_attachment_links: false, + no_attachment_links: true, welcome_user_nickname: nil, welcome_message: nil, max_report_comment_size: 1000, @@ -274,7 +274,13 @@ config :pleroma, :instance, account_field_name_length: 512, account_field_value_length: 2048, external_user_synchronization: true, - extended_nickname_format: false + extended_nickname_format: true + +config :pleroma, :feed, + post_title: %{ + max_length: 100, + omission: "..." + } config :pleroma, :markup, # XXX - unfortunately, inline images must be enabled by default right now, because @@ -284,8 +290,8 @@ config :pleroma, :markup, allow_tables: false, allow_fonts: false, scrub_policy: [ - Pleroma.HTML.Transform.MediaProxy, - Pleroma.HTML.Scrubber.Default + Pleroma.HTML.Scrubber.Default, + Pleroma.HTML.Transform.MediaProxy ] config :pleroma, :frontend_configurations, @@ -599,10 +605,13 @@ config :pleroma, Pleroma.ActivityExpiration, enabled: true config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false +config :pleroma, :static_fe, enabled: false + config :pleroma, :web_cache_ttl, activity_pub: nil, activity_pub_question: 30_000 +config :swarm, node_blacklist: [~r/myhtml_.*$/] # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" diff --git a/docs/API/admin_api.md b/docs/API/admin_api.md index e64ae6429..c042b08ac 100644 --- a/docs/API/admin_api.md +++ b/docs/API/admin_api.md @@ -392,13 +392,13 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret } ``` - -## `/api/pleroma/admin/users/:nickname/force_password_reset` +## `/api/pleroma/admin/users/force_password_reset` ### Force passord reset for a user with a given nickname - Methods: `PATCH` -- Params: none +- Params: + - `nicknames` - Response: none (code `204`) ## `/api/pleroma/admin/reports` diff --git a/docs/API/differences_in_mastoapi_responses.md b/docs/API/differences_in_mastoapi_responses.md index 41965f872..e649bdf24 100644 --- a/docs/API/differences_in_mastoapi_responses.md +++ b/docs/API/differences_in_mastoapi_responses.md @@ -73,6 +73,12 @@ Has an additional field under the `pleroma` object: - `recipients`: The list of the recipients of this Conversation. These will be addressed when replying to this conversation. +## GET `/api/v1/conversations` + +Accepts additional parameters: + +- `recipients`: Only return conversations with the given recipients (a list of user ids). Usage example: `GET /api/v1/conversations?recipients[]=1&recipients[]=2` + ## Account Search Behavior has changed: diff --git a/docs/API/pleroma_api.md b/docs/API/pleroma_api.md index 6c326dc9b..ad16d027e 100644 --- a/docs/API/pleroma_api.md +++ b/docs/API/pleroma_api.md @@ -479,3 +479,35 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa * `artist`: the artist of the media playing [optional] * `length`: the length of the media playing [optional] * Response: the newly created media metadata entity representing the Listen activity + +# Emoji Reactions + +Emoji reactions work a lot like favourites do. They make it possible to react to a post with a single emoji character. + +## `POST /api/v1/pleroma/statuses/:id/react_with_emoji` +### React to a post with a unicode emoji +* Method: `POST` +* Authentication: required +* Params: `emoji`: A single character unicode emoji +* Response: JSON, the status. + +## `POST /api/v1/pleroma/statuses/:id/unreact_with_emoji` +### Remove a reaction to a post with a unicode emoji +* Method: `POST` +* Authentication: required +* Params: `emoji`: A single character unicode emoji +* Response: JSON, the status. + +## `GET /api/v1/pleroma/statuses/:id/emoji_reactions_by` +### Get an object of emoji to account mappings with accounts that reacted to the post +* Method: `GET` +* Authentication: optional +* Params: None +* Response: JSON, a map of emoji to account list mappings. +* Example Response: +```json +{ + "😀" => [{"id" => "xyz.."...}, {"id" => "zyx..."}], + "🗡" => [{"id" => "abc..."}] +} +``` diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md index 3427ae419..7832f6962 100644 --- a/docs/configuration/cheatsheet.md +++ b/docs/configuration/cheatsheet.md @@ -6,10 +6,378 @@ Pleroma configuration works by first importing the base config (`config/config.e You shouldn't edit the base config directly to avoid breakages and merge conflicts, but it can be used as a reference if you don't understand how an option is supposed to be formatted, the latest version of it can be viewed [here](https://git.pleroma.social/pleroma/pleroma/blob/develop/config/config.exs). +## :instance +* `name`: The instance’s name. +* `email`: Email used to reach an Administrator/Moderator of the instance. +* `notify_email`: Email used for notifications. +* `description`: The instance’s description, can be seen in nodeinfo and ``/api/v1/instance``. +* `limit`: Posts character limit (CW/Subject included in the counter). +* `remote_limit`: Hard character limit beyond which remote posts will be dropped. +* `upload_limit`: File size limit of uploads (except for avatar, background, banner). +* `avatar_upload_limit`: File size limit of user’s profile avatars. +* `background_upload_limit`: File size limit of user’s profile backgrounds. +* `banner_upload_limit`: File size limit of user’s profile banners. +* `poll_limits`: A map with poll limits for **local** polls. + * `max_options`: Maximum number of options. + * `max_option_chars`: Maximum number of characters per option. + * `min_expiration`: Minimum expiration time (in seconds). + * `max_expiration`: Maximum expiration time (in seconds). +* `registrations_open`: Enable registrations for anyone, invitations can be enabled when false. +* `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`). +* `account_activation_required`: Require users to confirm their emails before signing in. +* `federating`: Enable federation with other instances. +* `federation_incoming_replies_max_depth`: Max. depth of reply-to activities fetching on incoming federation, to prevent out-of-memory situations while fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes. +* `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it. +* `allow_relay`: Enable Pleroma’s Relay, which makes it possible to follow a whole instance. +* `rewrite_policy`: Message Rewrite Policy, either one or a list. Here are the ones available by default: + * `Pleroma.Web.ActivityPub.MRF.NoOpPolicy`: Doesn’t modify activities (default). + * `Pleroma.Web.ActivityPub.MRF.DropPolicy`: Drops all activities. It generally doesn’t makes sense to use in production. + * `Pleroma.Web.ActivityPub.MRF.SimplePolicy`: Restrict the visibility of activities from certains instances (See [`:mrf_simple`](#mrf_simple)). + * `Pleroma.Web.ActivityPub.MRF.TagPolicy`: Applies policies to individual users based on tags, which can be set using pleroma-fe/admin-fe/any other app that supports Pleroma Admin API. For example it allows marking posts from individual users nsfw (sensitive). + * `Pleroma.Web.ActivityPub.MRF.SubchainPolicy`: Selectively runs other MRF policies when messages match (See [`:mrf_subchain`](#mrf_subchain)). + * `Pleroma.Web.ActivityPub.MRF.RejectNonPublic`: Drops posts with non-public visibility settings (See [`:mrf_rejectnonpublic`](#mrf_rejectnonpublic)). + * `Pleroma.Web.ActivityPub.MRF.EnsureRePrepended`: Rewrites posts to ensure that replies to posts with subjects do not have an identical subject and instead begin with re:. + * `Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy`: Rejects posts from likely spambots by rejecting posts from new users that contain links. + * `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`: Crawls attachments using their MediaProxy URLs so that the MediaProxy cache is primed. + * `Pleroma.Web.ActivityPub.MRF.MentionPolicy`: Drops posts mentioning configurable users. (See [`:mrf_mention`](#mrf_mention)). + * `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (See [`:mrf_vocabulary`](#mrf_vocabulary)). +* `public`: Makes the client API in authentificated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network. +* `quarantined_instances`: List of ActivityPub instances where private(DMs, followers-only) activities will not be send. +* `managed_config`: Whenether the config for pleroma-fe is configured in [:frontend_configurations](#frontend_configurations) or in ``static/config.json``. +* `allowed_post_formats`: MIME-type list of formats allowed to be posted (transformed into HTML). +* `mrf_transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo). +* `mrf_transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value. +* `extended_nickname_format`: Set to `true` to use extended local nicknames format (allows underscores/dashes). This will break federation with + older software for theses nicknames. +* `max_pinned_statuses`: The maximum number of pinned statuses. `0` will disable the feature. +* `autofollowed_nicknames`: Set to nicknames of (local) users that every new user should automatically follow. +* `no_attachment_links`: Set to true to disable automatically adding attachment link text to statuses. +* `welcome_message`: A message that will be send to a newly registered users as a direct message. +* `welcome_user_nickname`: The nickname of the local user that sends the welcome message. +* `max_report_comment_size`: The maximum size of the report comment (Default: `1000`). +* `safe_dm_mentions`: If set to true, only mentions at the beginning of a post will be used to address people in direct messages. This is to prevent accidental mentioning of people when talking about them (e.g. "@friend hey i really don't like @enemy"). Default: `false`. +* `healthcheck`: If set to true, system data will be shown on ``/api/pleroma/healthcheck``. +* `remote_post_retention_days`: The default amount of days to retain remote posts when pruning the database. +* `user_bio_length`: A user bio maximum length (default: `5000`). +* `user_name_length`: A user name maximum length (default: `100`). +* `skip_thread_containment`: Skip filter out broken threads. The default is `false`. +* `limit_to_local_content`: Limit unauthenticated users to search for local statutes and users only. Possible values: `:unauthenticated`, `:all` and `false`. The default is `:unauthenticated`. +* `max_account_fields`: The maximum number of custom fields in the user profile (default: `10`). +* `max_remote_account_fields`: The maximum number of custom fields in the remote user profile (default: `20`). +* `account_field_name_length`: An account field name maximum length (default: `512`). +* `account_field_value_length`: An account field value maximum length (default: `2048`). +* `external_user_synchronization`: Enabling following/followers counters synchronization for external users. -## Pleroma.Upload -* `uploader`: Select which `Pleroma.Uploaders` to use -* `filters`: List of `Pleroma.Upload.Filter` to use. +!!! danger + This is a Work In Progress, not usable just yet + +* `dynamic_configuration`: Allow transferring configuration to DB with the subsequent customization from Admin api. + +## Federation +### MRF policies + +!!! note + Configuring MRF policies is not enough for them to take effect. You have to enable them by specifying their module in `rewrite_policy` under [:instance](#instance) section. + +#### :mrf_simple +* `media_removal`: List of instances to remove media from. +* `media_nsfw`: List of instances to put media as NSFW(sensitive) from. +* `federated_timeline_removal`: List of instances to remove from Federated (aka The Whole Known Network) Timeline. +* `reject`: List of instances to reject any activities from. +* `accept`: List of instances to accept any activities from. +* `report_removal`: List of instances to reject reports from. +* `avatar_removal`: List of instances to strip avatars from. +* `banner_removal`: List of instances to strip banners from. + +#### :mrf_subchain +This policy processes messages through an alternate pipeline when a given message matches certain criteria. +All criteria are configured as a map of regular expressions to lists of policy modules. + +* `match_actor`: Matches a series of regular expressions against the actor field. + +Example: + +```elixir +config :pleroma, :mrf_subchain, + match_actor: %{ + ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy] + } +``` + +#### :mrf_rejectnonpublic +* `allow_followersonly`: whether to allow followers-only posts. +* `allow_direct`: whether to allow direct messages. + +#### :mrf_hellthread +* `delist_threshold`: Number of mentioned users after which the message gets delisted (the message can still be seen, but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable. +* `reject_threshold`: Number of mentioned users after which the messaged gets rejected. Set to 0 to disable. + +#### :mrf_keyword +* `reject`: A list of patterns which result in message being rejected, each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html). +* `federated_timeline_removal`: A list of patterns which result in message being removed from federated timelines (a.k.a unlisted), each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html). +* `replace`: A list of tuples containing `{pattern, replacement}`, `pattern` can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html). + +#### :mrf_mention +* `actors`: A list of actors, for which to drop any posts mentioning. + +#### :mrf_vocabulary +* `accept`: A list of ActivityStreams terms to accept. If empty, all supported messages are accepted. +* `reject`: A list of ActivityStreams terms to reject. If empty, no messages are rejected. + +#### :mrf_user_allowlist + +The keys in this section are the domain names that the policy should apply to. +Each key should be assigned a list of users that should be allowed through by +their ActivityPub ID. + +An example: + +```elixir +config :pleroma, :mrf_user_allowlist, + "example.org": ["https://example.org/users/admin"] +``` + +### :activitypub +* ``unfollow_blocked``: Whether blocks result in people getting unfollowed +* ``outgoing_blocks``: Whether to federate blocks to other instances +* ``deny_follow_blocked``: Whether to disallow following an account that has blocked the user in question +* ``sign_object_fetches``: Sign object fetches with HTTP signatures + +### :fetch_initial_posts +* `enabled`: if enabled, when a new user is federated with, fetch some of their latest posts +* `pages`: the amount of pages to fetch + +## Pleroma.ScheduledActivity + +* `daily_user_limit`: the number of scheduled activities a user is allowed to create in a single day (Default: `25`) +* `total_user_limit`: the number of scheduled activities a user is allowed to create in total (Default: `300`) +* `enabled`: whether scheduled activities are sent to the job queue to be executed + +## Pleroma.ActivityExpiration + +* `enabled`: whether expired activities will be sent to the job queue to be deleted + +## Frontends + +### :frontend_configurations + +This can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for `pleroma_fe` and `masto_fe` are configured. You can find the documentation for `pleroma_fe` configuration into [Pleroma-FE configuration and customization for instance administrators](/frontend/CONFIGURATION/#options). + +Frontends can access these settings at `/api/pleroma/frontend_configurations` + +To add your own configuration for PleromaFE, use it like this: + +```elixir +config :pleroma, :frontend_configurations, + pleroma_fe: %{ + theme: "pleroma-dark", + # ... see /priv/static/static/config.json for the available keys. +}, + masto_fe: %{ + showInstanceSpecificPanel: true + } +``` + +These settings **need to be complete**, they will override the defaults. + +### :static_fe + +Render profiles and posts using server-generated HTML that is viewable without using JavaScript. + +Available options: + +* `enabled` - Enables the rendering of static HTML. Defaults to `false`. + +### :assets + +This section configures assets to be used with various frontends. Currently the only option +relates to mascots on the mastodon frontend + +* `mascots`: KeywordList of mascots, each element __MUST__ contain both a `url` and a + `mime_type` key. +* `default_mascot`: An element from `mascots` - This will be used as the default mascot + on MastoFE (default: `:pleroma_fox_tan`). + +### :manifest + +This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE. + +* `icons`: Describe the icons of the app, this a list of maps describing icons in the same way as the + [spec](https://www.w3.org/TR/appmanifest/#imageresource-and-its-members) describes it. + + Example: + + ```elixir + config :pleroma, :manifest, + icons: [ + %{ + src: "/static/logo.png" + }, + %{ + src: "/static/icon.png", + type: "image/png" + }, + %{ + src: "/static/icon.ico", + sizes: "72x72 96x96 128x128 256x256" + } + ] + ``` + +* `theme_color`: Describe the theme color of the app. (Example: `"#282c37"`, `"rebeccapurple"`). +* `background_color`: Describe the background color of the app. (Example: `"#191b22"`, `"aliceblue"`). + +## :emoji +* `shortcode_globs`: Location of custom emoji files. `*` can be used as a wildcard. Example `["/emoji/custom/**/*.png"]` +* `pack_extensions`: A list of file extensions for emojis, when no emoji.txt for a pack is present. Example `[".png", ".gif"]` +* `groups`: Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the groupname and the value the location or array of locations. `*` can be used as a wildcard. Example `[Custom: ["/emoji/*.png", "/emoji/custom/*.png"]]` +* `default_manifest`: Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download. Currently only one manifest can be added (no arrays). +* `shared_pack_cache_seconds_per_file`: When an emoji pack is shared, the archive is created and cached in + memory for this amount of seconds multiplied by the number of files. + +## :media_proxy +* `enabled`: Enables proxying of remote media to the instance’s proxy +* `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts. +* `proxy_opts`: All options defined in `Pleroma.ReverseProxy` documentation, defaults to `[max_body_length: (25*1_048_576)]`. +* `whitelist`: List of domains to bypass the mediaproxy + +## Link previews + +### Pleroma.Web.Metadata (provider) +* `providers`: a list of metadata providers to enable. Providers available: + * `Pleroma.Web.Metadata.Providers.OpenGraph` + * `Pleroma.Web.Metadata.Providers.TwitterCard` + * `Pleroma.Web.Metadata.Providers.RelMe` - add links from user bio with rel=me into the `
` as ``. + * `Pleroma.Web.Metadata.Providers.Feed` - add a link to a user's Atom feed into the `
` as ``. +* `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews. + +### :rich_media (consumer) +* `enabled`: if enabled the instance will parse metadata from attached links to generate link previews. +* `ignore_hosts`: list of hosts which will be ignored by the metadata parser. For example `["accounts.google.com", "xss.website"]`, defaults to `[]`. +* `ignore_tld`: list TLDs (top-level domains) which will ignore for parse metadata. default is ["local", "localdomain", "lan"]. +* `parsers`: list of Rich Media parsers. + +## HTTP server + +### Pleroma.Web.Endpoint + +!!! note + `Phoenix` endpoint configuration, all configuration options can be viewed [here](https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#module-dynamic-configuration), only common options are listed here. + +* `http` - a list containing http protocol configuration, all configuration options can be viewed [here](https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html#module-options), only common options are listed here. For deployment using docker, you need to set this to `[ip: {0,0,0,0}, port: 4000]` to make pleroma accessible from other containers (such as your nginx server). + - `ip` - a tuple consisting of 4 integers + - `port` +* `url` - a list containing the configuration for generating urls, accepts + - `host` - the host without the scheme and a post (e.g `example.com`, not `https://example.com:2020`) + - `scheme` - e.g `http`, `https` + - `port` + - `path` +* `extra_cookie_attrs` - a list of `Key=Value` strings to be added as non-standard cookie attributes. Defaults to `["SameSite=Lax"]`. See the [SameSite article](https://www.owasp.org/index.php/SameSite) on OWASP for more info. + +Example: +```elixir +config :pleroma, Pleroma.Web.Endpoint, + url: [host: "example.com", port: 2020, scheme: "https"], + http: [ + port: 8080, + ip: {127, 0, 0, 1} + ] +``` + +This will make Pleroma listen on `127.0.0.1` port `8080` and generate urls starting with `https://example.com:2020` + +### :http_security +* ``enabled``: Whether the managed content security policy is enabled. +* ``sts``: Whether to additionally send a `Strict-Transport-Security` header. +* ``sts_max_age``: The maximum age for the `Strict-Transport-Security` header if sent. +* ``ct_max_age``: The maximum age for the `Expect-CT` header if sent. +* ``referrer_policy``: The referrer policy to use, either `"same-origin"` or `"no-referrer"`. +* ``report_uri``: Adds the specified url to `report-uri` and `report-to` group in CSP header. + +### Pleroma.Plugs.RemoteIp + +!!! warning + If your instance is not behind at least one reverse proxy, you should not enable this plug. + +`Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration. + +Available options: + +* `enabled` - Enable/disable the plug. Defaults to `false`. +* `headers` - A list of strings naming the `req_headers` to use when deriving the `remote_ip`. Order does not matter. Defaults to `~w[forwarded x-forwarded-for x-client-ip x-real-ip]`. +* `proxies` - A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Defaults to `[]`. +* `reserved` - Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network). + + +### :rate_limit + +This is an advanced feature and disabled by default. + +If your instance is behind a reverse proxy you must enable and configure [`Pleroma.Plugs.RemoteIp`](#pleroma-plugs-remoteip). + +A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where: + +* The first element: `scale` (Integer). The time scale in milliseconds. +* The second element: `limit` (Integer). How many requests to limit in the time scale provided. + +It is also possible to have different limits for unauthenticated and authenticated users: the keyword value must be a list of two tuples where the first one is a config for unauthenticated users and the second one is for authenticated. + +Supported rate limiters: + +* `:search` for the search requests (account & status search etc.) +* `:app_account_creation` for registering user accounts from the same IP address +* `:relations_actions` for actions on relations with all users (follow, unfollow) +* `:relation_id_action` for actions on relation with a specific user (follow, unfollow) +* `:statuses_actions` for create / delete / fav / unfav / reblog / unreblog actions on any statuses +* `:status_id_action` for fav / unfav or reblog / unreblog actions on the same status by the same user + +### :web_cache_ttl + +The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration. + +Available caches: + +* `:activity_pub` - activity pub routes (except question activities). Defaults to `nil` (no expiration). +* `:activity_pub_question` - activity pub routes (question activities). Defaults to `30_000` (30 seconds). + +## :hackney_pools + +Advanced. Tweaks Hackney (http client) connections pools. + +There's three pools used: + +* `:federation` for the federation jobs. + You may want this pool max_connections to be at least equal to the number of federator jobs + retry queue jobs. +* `:media` for rich media, media proxy +* `:upload` for uploaded media (if using a remote uploader and `proxy_remote: true`) + +For each pool, the options are: + +* `max_connections` - how much connections a pool can hold +* `timeout` - retention duration for connections + + +## Captcha + +### Pleroma.Captcha +* `enabled`: Whether the captcha should be shown on registration. +* `method`: The method/service to use for captcha. +* `seconds_valid`: The time in seconds for which the captcha is valid. + +### Captcha providers + +#### Pleroma.Captcha.Kocaptcha +Kocaptcha is a very simple captcha service with a single API endpoint, +the source code is here: https://github.com/koto-bank/kocaptcha. The default endpoint +`https://captcha.kotobank.ch` is hosted by the developer. + +* `endpoint`: the Kocaptcha endpoint to use. + +## Uploads + +### Pleroma.Upload +* `uploader`: Which one of the [uploaders](#uploaders) to use. +* `filters`: List of [upload filters](#upload-filters) to use. * `link_name`: When enabled Pleroma will add a `name` parameter to the url of the upload, for example `https://instance.tld/media/corndog.png?name=corndog.png`. This is needed to provide the correct filename in Content-Disposition headers when using filters like `Pleroma.Upload.Filter.Dedupe` * `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host. * `proxy_remote`: If you're using a remote uploader, Pleroma will proxy media requests instead of redirecting to it. @@ -18,34 +386,40 @@ You shouldn't edit the base config directly to avoid breakages and merge conflic !!! warning `strip_exif` has been replaced by `Pleroma.Upload.Filter.Mogrify`. -## Pleroma.Uploaders.Local -* `uploads`: Which directory to store the user-uploads in, relative to pleroma’s working directory +### Uploaders +#### Pleroma.Uploaders.Local +* `uploads`: Which directory to store the user-uploads in, relative to pleroma’s working directory. -## Pleroma.Uploaders.S3 -* `bucket`: S3 bucket name -* `bucket_namespace`: S3 bucket namespace +#### Pleroma.Uploaders.S3 +* `bucket`: S3 bucket name. +* `bucket_namespace`: S3 bucket namespace. * `public_endpoint`: S3 endpoint that the user finally accesses(ex. "https://s3.dualstack.ap-northeast-1.amazonaws.com") * `truncated_namespace`: If you use S3 compatible service such as Digital Ocean Spaces or CDN, set folder name or "" etc. For example, when using CDN to S3 virtual host format, set "". At this time, write CNAME to CDN in public_endpoint. * `streaming_enabled`: Enable streaming uploads, when enabled the file will be sent to the server in chunks as it's being read. This may be unsupported by some providers, try disabling this if you have upload problems. -## Pleroma.Upload.Filter.Mogrify + +### Upload filters + +#### Pleroma.Upload.Filter.Mogrify * `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", "auto-orient", {"implode", "1"}]`. -## Pleroma.Upload.Filter.Dedupe +#### Pleroma.Upload.Filter.Dedupe No specific configuration. -## Pleroma.Upload.Filter.AnonymizeFilename +#### Pleroma.Upload.Filter.AnonymizeFilename This filter replaces the filename (not the path) of an upload. For complete obfuscation, add `Pleroma.Upload.Filter.Dedupe` before AnonymizeFilename. * `text`: Text to replace filenames in links. If empty, `{random}.extension` will be used. You can get the original filename extension by using `{extension}`, for example `custom-file-name.{extension}`. -## Pleroma.Emails.Mailer +## Email + +### Pleroma.Emails.Mailer * `adapter`: one of the mail adapters listed in [Swoosh readme](https://github.com/swoosh/swoosh#adapters), or `Swoosh.Adapters.Local` for in-memory mailbox. * `api_key` / `password` and / or other adapter-specific settings, per the above documentation. * `enabled`: Allows enable/disable send emails. Default: `false`. @@ -72,77 +446,112 @@ config :pleroma, Pleroma.Emails.Mailer, auth: :always ``` -## :uri_schemes -* `valid_schemes`: List of the scheme part that is considered valid to be an URL +### :email_notifications -## :instance -* `name`: The instance’s name -* `email`: Email used to reach an Administrator/Moderator of the instance -* `notify_email`: Email used for notifications. -* `description`: The instance’s description, can be seen in nodeinfo and ``/api/v1/instance`` -* `limit`: Posts character limit (CW/Subject included in the counter) -* `remote_limit`: Hard character limit beyond which remote posts will be dropped. -* `upload_limit`: File size limit of uploads (except for avatar, background, banner) -* `avatar_upload_limit`: File size limit of user’s profile avatars -* `background_upload_limit`: File size limit of user’s profile backgrounds -* `banner_upload_limit`: File size limit of user’s profile banners -* `poll_limits`: A map with poll limits for **local** polls - * `max_options`: Maximum number of options - * `max_option_chars`: Maximum number of characters per option - * `min_expiration`: Minimum expiration time (in seconds) - * `max_expiration`: Maximum expiration time (in seconds) -* `registrations_open`: Enable registrations for anyone, invitations can be enabled when false. -* `invites_enabled`: Enable user invitations for admins (depends on `registrations_open: false`). -* `account_activation_required`: Require users to confirm their emails before signing in. -* `federating`: Enable federation with other instances -* `federation_incoming_replies_max_depth`: Max. depth of reply-to activities fetching on incoming federation, to prevent out-of-memory situations while fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes. -* `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it. -* `allow_relay`: Enable Pleroma’s Relay, which makes it possible to follow a whole instance -* `rewrite_policy`: Message Rewrite Policy, either one or a list. Here are the ones available by default: - * `Pleroma.Web.ActivityPub.MRF.NoOpPolicy`: Doesn’t modify activities (default) - * `Pleroma.Web.ActivityPub.MRF.DropPolicy`: Drops all activities. It generally doesn’t makes sense to use in production - * `Pleroma.Web.ActivityPub.MRF.SimplePolicy`: Restrict the visibility of activities from certains instances (See ``:mrf_simple`` section) - * `Pleroma.Web.ActivityPub.MRF.TagPolicy`: Applies policies to individual users based on tags, which can be set using pleroma-fe/admin-fe/any other app that supports Pleroma Admin API. For example it allows marking posts from individual users nsfw (sensitive) - * `Pleroma.Web.ActivityPub.MRF.SubchainPolicy`: Selectively runs other MRF policies when messages match (see ``:mrf_subchain`` section) - * `Pleroma.Web.ActivityPub.MRF.RejectNonPublic`: Drops posts with non-public visibility settings (See ``:mrf_rejectnonpublic`` section) - * `Pleroma.Web.ActivityPub.MRF.EnsureRePrepended`: Rewrites posts to ensure that replies to posts with subjects do not have an identical subject and instead begin with re:. - * `Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy`: Rejects posts from likely spambots by rejecting posts from new users that contain links. - * `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`: Crawls attachments using their MediaProxy URLs so that the MediaProxy cache is primed. - * `Pleroma.Web.ActivityPub.MRF.MentionPolicy`: Drops posts mentioning configurable users. (see `:mrf_mention` section) - * `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (see `:mrf_vocabulary` section) -* `public`: Makes the client API in authentificated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network. -* `quarantined_instances`: List of ActivityPub instances where private(DMs, followers-only) activities will not be send. -* `managed_config`: Whenether the config for pleroma-fe is configured in this config or in ``static/config.json`` -* `allowed_post_formats`: MIME-type list of formats allowed to be posted (transformed into HTML) -* `mrf_transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo). -* `mrf_transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value. -* `extended_nickname_format`: Set to `true` to use extended local nicknames format (allows underscores/dashes). This will break federation with - older software for theses nicknames. -* `max_pinned_statuses`: The maximum number of pinned statuses. `0` will disable the feature. -* `autofollowed_nicknames`: Set to nicknames of (local) users that every new user should automatically follow. -* `no_attachment_links`: Set to true to disable automatically adding attachment link text to statuses -* `welcome_message`: A message that will be send to a newly registered users as a direct message. -* `welcome_user_nickname`: The nickname of the local user that sends the welcome message. -* `max_report_comment_size`: The maximum size of the report comment (Default: `1000`) -* `safe_dm_mentions`: If set to true, only mentions at the beginning of a post will be used to address people in direct messages. This is to prevent accidental mentioning of people when talking about them (e.g. "@friend hey i really don't like @enemy"). Default: `false`. -* `healthcheck`: If set to true, system data will be shown on ``/api/pleroma/healthcheck``. -* `remote_post_retention_days`: The default amount of days to retain remote posts when pruning the database. -* `user_bio_length`: A user bio maximum length (default: `5000`) -* `user_name_length`: A user name maximum length (default: `100`) -* `skip_thread_containment`: Skip filter out broken threads. The default is `false`. -* `limit_to_local_content`: Limit unauthenticated users to search for local statutes and users only. Possible values: `:unauthenticated`, `:all` and `false`. The default is `:unauthenticated`. -* `max_account_fields`: The maximum number of custom fields in the user profile (default: `10`) -* `max_remote_account_fields`: The maximum number of custom fields in the remote user profile (default: `20`) -* `account_field_name_length`: An account field name maximum length (default: `512`) -* `account_field_value_length`: An account field value maximum length (default: `2048`) -* `external_user_synchronization`: Enabling following/followers counters synchronization for external users. +Email notifications settings. -!!! danger - This is a Work In Progress, not usable just yet + - digest - emails of "what you've missed" for users who have been + inactive for a while. + - active: globally enable or disable digest emails + - schedule: When to send digest email, in [crontab format](https://en.wikipedia.org/wiki/Cron). + "0 0 * * 0" is the default, meaning "once a week at midnight on Sunday morning" + - interval: Minimum interval between digest emails to one user + - inactivity_threshold: Minimum user inactivity threshold -* `dynamic_configuration`: Allow transferring configuration to DB with the subsequent customization from Admin api. +### Pleroma.Emails.UserEmail +- `:logo` - a path to a custom logo. Set it to `nil` to use the default Pleroma logo. +- `:styling` - a map with color settings for email templates. +## Background jobs + +### Oban + +[Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration. + +Configuration options described in [Oban readme](https://github.com/sorentwo/oban#usage): + +* `repo` - app's Ecto repo (`Pleroma.Repo`) +* `verbose` - logs verbosity +* `prune` - non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning) (`:disabled` / `{:maxlen, value}` / `{:maxage, value}`) +* `queues` - job queues (see below) + +Pleroma has the following queues: + +* `activity_expiration` - Activity expiration +* `federator_outgoing` - Outgoing federation +* `federator_incoming` - Incoming federation +* `mailer` - Email sender, see [`Pleroma.Emails.Mailer`](#pleromaemailsmailer) +* `transmogrifier` - Transmogrifier +* `web_push` - Web push notifications +* `scheduled_activities` - Scheduled activities, see [`Pleroma.ScheduledActivity`](#pleromascheduledactivity) + +Example: + +```elixir +config :pleroma, Oban, + repo: Pleroma.Repo, + verbose: false, + prune: {:maxlen, 1500}, + queues: [ + federator_incoming: 50, + federator_outgoing: 50 + ] +``` + +This config contains two queues: `federator_incoming` and `federator_outgoing`. Both have the number of max concurrent jobs set to `50`. + +#### Migrating `pleroma_job_queue` settings + +`config :pleroma_job_queue, :queues` is replaced by `config :pleroma, Oban, :queues` and uses the same format (keys are queues' names, values are max concurrent jobs numbers). + +### :workers + +Includes custom worker options not interpretable directly by `Oban`. + +* `retries` — keyword lists where keys are `Oban` queues (see above) and values are numbers of max attempts for failed jobs. + +Example: + +```elixir +config :pleroma, :workers, + retries: [ + federator_incoming: 5, + federator_outgoing: 5 + ] +``` + +#### Migrating `Pleroma.Web.Federator.RetryQueue` settings + +* `max_retries` is replaced with `config :pleroma, :workers, retries: [federator_outgoing: 5]` +* `enabled: false` corresponds to `config :pleroma, :workers, retries: [federator_outgoing: 1]` +* deprecated options: `max_jobs`, `initial_timeout` + +### Pleroma.Scheduler + +Configuration for [Quantum](https://github.com/quantum-elixir/quantum-core) jobs scheduler. + +See [Quantum readme](https://github.com/quantum-elixir/quantum-core#usage) for the list of supported options. + +Example: + +```elixir +config :pleroma, Pleroma.Scheduler, + global: true, + overlap: true, + timezone: :utc, + jobs: [{"0 */6 * * * *", {Pleroma.Web.Websub, :refresh_subscriptions, []}}] +``` + +The above example defines a single job which invokes `Pleroma.Web.Websub.refresh_subscriptions()` every 6 hours ("0 */6 * * * *", [crontab format](https://en.wikipedia.org/wiki/Cron)). + +## :web_push_encryption, :vapid_details + +Web Push Notifications configuration. You can use the mix task `mix web_push.gen.keypair` to generate it. + +* ``subject``: a mailto link for the administrative contact. It’s best if this email is not a personal email address, but rather a group email so that if a person leaves an organization, is unavailable for an extended period, or otherwise can’t respond, someone else on the list can. +* ``public_key``: VAPID public key +* ``private_key``: VAPID private key ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog, and `Quack.Logger` to log to Slack @@ -187,430 +596,30 @@ config :quack, See the [Quack Github](https://github.com/azohra/quack) for more details -## :frontend_configurations - -This can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for `pleroma_fe` and `masto_fe` are configured. You can find the documentation for `pleroma_fe` configuration into [Pleroma-FE configuration and customization for instance administrators](/frontend/CONFIGURATION/#options). - -Frontends can access these settings at `/api/pleroma/frontend_configurations` - -To add your own configuration for PleromaFE, use it like this: - -```elixir -config :pleroma, :frontend_configurations, - pleroma_fe: %{ - theme: "pleroma-dark", - # ... see /priv/static/static/config.json for the available keys. -}, - masto_fe: %{ - showInstanceSpecificPanel: true - } -``` - -These settings **need to be complete**, they will override the defaults. - -NOTE: for versions < 1.0, you need to set [`:fe`](#fe) to false, as shown a few lines below. - -## :fe -!!! warning - __THIS IS DEPRECATED__ - - If you are using this method, please change it to the [`frontend_configurations`](#frontend_configurations) method. - Please **set this option to false** in your config like this: - - ```elixir - config :pleroma, :fe, false - ``` - -This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:instance`` is set to false. - -* `theme`: Which theme to use, they are defined in ``styles.json`` -* `logo`: URL of the logo, defaults to Pleroma’s logo -* `logo_mask`: Whether to use only the logo's shape as a mask (true) or as a regular image (false) -* `logo_margin`: What margin to use around the logo -* `background`: URL of the background, unless viewing a user profile with a background that is set -* `redirect_root_no_login`: relative URL which indicates where to redirect when a user isn’t logged in. -* `redirect_root_login`: relative URL which indicates where to redirect when a user is logged in. -* `show_instance_panel`: Whenether to show the instance’s specific panel. -* `scope_options_enabled`: Enable setting an notice visibility and subject/CW when posting -* `formatting_options_enabled`: Enable setting a formatting different than plain-text (ie. HTML, Markdown) when posting, relates to ``:instance, allowed_post_formats`` -* `collapse_message_with_subjects`: When a message has a subject(aka Content Warning), collapse it by default -* `hide_post_stats`: Hide notices statistics(repeats, favorites, …) -* `hide_user_stats`: Hide profile statistics(posts, posts per day, followers, followings, …) - -## :assets - -This section configures assets to be used with various frontends. Currently the only option -relates to mascots on the mastodon frontend - -* `mascots`: KeywordList of mascots, each element __MUST__ contain both a `url` and a - `mime_type` key. -* `default_mascot`: An element from `mascots` - This will be used as the default mascot - on MastoFE (default: `:pleroma_fox_tan`) - -## :manifest - -This section describe PWA manifest instance-specific values. Currently this option relate only for MastoFE. - -* `icons`: Describe the icons of the app, this a list of maps describing icons in the same way as the - [spec](https://www.w3.org/TR/appmanifest/#imageresource-and-its-members) describes it. - - Example: - - ```elixir - config :pleroma, :manifest, - icons: [ - %{ - src: "/static/logo.png" - }, - %{ - src: "/static/icon.png", - type: "image/png" - }, - %{ - src: "/static/icon.ico", - sizes: "72x72 96x96 128x128 256x256" - } - ] - ``` - -* `theme_color`: Describe the theme color of the app. (Example: `"#282c37"`, `"rebeccapurple"`) -* `background_color`: Describe the background color of the app. (Example: `"#191b22"`, `"aliceblue"`) - -## :mrf_simple -* `media_removal`: List of instances to remove medias from -* `media_nsfw`: List of instances to put medias as NSFW(sensitive) from -* `federated_timeline_removal`: List of instances to remove from Federated (aka The Whole Known Network) Timeline -* `reject`: List of instances to reject any activities from -* `accept`: List of instances to accept any activities from -* `report_removal`: List of instances to reject reports from -* `avatar_removal`: List of instances to strip avatars from -* `banner_removal`: List of instances to strip banners from - -## :mrf_subchain -This policy processes messages through an alternate pipeline when a given message matches certain criteria. -All criteria are configured as a map of regular expressions to lists of policy modules. - -* `match_actor`: Matches a series of regular expressions against the actor field. - -Example: - -```elixir -config :pleroma, :mrf_subchain, - match_actor: %{ - ~r/https:\/\/example.com/s => [Pleroma.Web.ActivityPub.MRF.DropPolicy] - } -``` - -## :mrf_rejectnonpublic -* `allow_followersonly`: whether to allow followers-only posts -* `allow_direct`: whether to allow direct messages - -## :mrf_hellthread -* `delist_threshold`: Number of mentioned users after which the message gets delisted (the message can still be seen, but it will not show up in public timelines and mentioned users won't get notifications about it). Set to 0 to disable. -* `reject_threshold`: Number of mentioned users after which the messaged gets rejected. Set to 0 to disable. - -## :mrf_keyword -* `reject`: A list of patterns which result in message being rejected, each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html) -* `federated_timeline_removal`: A list of patterns which result in message being removed from federated timelines (a.k.a unlisted), each pattern can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html) -* `replace`: A list of tuples containing `{pattern, replacement}`, `pattern` can be a string or a [regular expression](https://hexdocs.pm/elixir/Regex.html) - -## :mrf_mention -* `actors`: A list of actors, for which to drop any posts mentioning. - -## :mrf_vocabulary -* `accept`: A list of ActivityStreams terms to accept. If empty, all supported messages are accepted. -* `reject`: A list of ActivityStreams terms to reject. If empty, no messages are rejected. - -## :media_proxy -* `enabled`: Enables proxying of remote media to the instance’s proxy -* `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts. -* `proxy_opts`: All options defined in `Pleroma.ReverseProxy` documentation, defaults to `[max_body_length: (25*1_048_576)]`. -* `whitelist`: List of domains to bypass the mediaproxy - -## :gopher -* `enabled`: Enables the gopher interface -* `ip`: IP address to bind to -* `port`: Port to bind to -* `dstport`: Port advertised in urls (optional, defaults to `port`) - -## Pleroma.Web.Endpoint - -!!! note - `Phoenix` endpoint configuration, all configuration options can be viewed [here](https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#module-dynamic-configuration), only common options are listed here. - -* `http` - a list containing http protocol configuration, all configuration options can be viewed [here](https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html#module-options), only common options are listed here. For deployment using docker, you need to set this to `[ip: {0,0,0,0}, port: 4000]` to make pleroma accessible from other containers (such as your nginx server). - - `ip` - a tuple consisting of 4 integers - - `port` -* `url` - a list containing the configuration for generating urls, accepts - - `host` - the host without the scheme and a post (e.g `example.com`, not `https://example.com:2020`) - - `scheme` - e.g `http`, `https` - - `port` - - `path` -* `extra_cookie_attrs` - a list of `Key=Value` strings to be added as non-standard cookie attributes. Defaults to `["SameSite=Lax"]`. See the [SameSite article](https://www.owasp.org/index.php/SameSite) on OWASP for more info. +## Database options + +### RUM indexing for full text search !!! warning - If you modify anything inside these lists, default `config.exs` values will be overwritten, which may result in breakage, to make sure this does not happen please copy the default value for the list from `config.exs` and modify/add only what you need + It is recommended to use PostgreSQL v11 or newer. We have seen some minor issues with lower PostgreSQL versions. -Example: -```elixir -config :pleroma, Pleroma.Web.Endpoint, - url: [host: "example.com", port: 2020, scheme: "https"], - http: [ - # start copied from config.exs - dispatch: [ - {:_, - [ - {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []}, - {"/websocket", Phoenix.Endpoint.CowboyWebSocket, - {Phoenix.Transports.WebSocket, - {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}}, - {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}} - ]} - # end copied from config.exs - ], - port: 8080, - ip: {127, 0, 0, 1} - ] -``` +* `rum_enabled`: If RUM indexes should be used. Defaults to `false`. -This will make Pleroma listen on `127.0.0.1` port `8080` and generate urls starting with `https://example.com:2020` +RUM indexes are an alternative indexing scheme that is not included in PostgreSQL by default. While they may eventually be mainlined, for now they have to be installed as a PostgreSQL extension from https://github.com/postgrespro/rum. -## :activitypub -* ``unfollow_blocked``: Whether blocks result in people getting unfollowed -* ``outgoing_blocks``: Whether to federate blocks to other instances -* ``deny_follow_blocked``: Whether to disallow following an account that has blocked the user in question -* ``sign_object_fetches``: Sign object fetches with HTTP signatures +Their advantage over the standard GIN indexes is that they allow efficient ordering of search results by timestamp, which makes search queries a lot faster on larger servers, by one or two orders of magnitude. They take up around 3 times as much space as GIN indexes. -## :http_security -* ``enabled``: Whether the managed content security policy is enabled -* ``sts``: Whether to additionally send a `Strict-Transport-Security` header -* ``sts_max_age``: The maximum age for the `Strict-Transport-Security` header if sent -* ``ct_max_age``: The maximum age for the `Expect-CT` header if sent -* ``referrer_policy``: The referrer policy to use, either `"same-origin"` or `"no-referrer"` -* ``report_uri``: Adds the specified url to `report-uri` and `report-to` group in CSP header. +To enable them, both the `rum_enabled` flag has to be set and the following special migration has to be run: -## :mrf_user_allowlist +`mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/` -The keys in this section are the domain names that the policy should apply to. -Each key should be assigned a list of users that should be allowed through by -their ActivityPub ID. +This will probably take a long time. -An example: +## Alternative client protocols -```elixir -config :pleroma, :mrf_user_allowlist, - "example.org": ["https://example.org/users/admin"] -``` - -## :web_push_encryption, :vapid_details - -Web Push Notifications configuration. You can use the mix task `mix web_push.gen.keypair` to generate it. - -* ``subject``: a mailto link for the administrative contact. It’s best if this email is not a personal email address, but rather a group email so that if a person leaves an organization, is unavailable for an extended period, or otherwise can’t respond, someone else on the list can. -* ``public_key``: VAPID public key -* ``private_key``: VAPID private key - -## Pleroma.Captcha -* `enabled`: Whether the captcha should be shown on registration -* `method`: The method/service to use for captcha -* `seconds_valid`: The time in seconds for which the captcha is valid - -### Pleroma.Captcha.Kocaptcha -Kocaptcha is a very simple captcha service with a single API endpoint, -the source code is here: https://github.com/koto-bank/kocaptcha. The default endpoint -`https://captcha.kotobank.ch` is hosted by the developer. - -* `endpoint`: the kocaptcha endpoint to use - -## :admin_token - -Allows to set a token that can be used to authenticate with the admin api without using an actual user by giving it as the 'admin_token' parameter. Example: - -```elixir -config :pleroma, :admin_token, "somerandomtoken" -``` - -You can then do - -```sh -curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerandomtoken" -``` - -## Oban - -[Oban](https://github.com/sorentwo/oban) asynchronous job processor configuration. - -Configuration options described in [Oban readme](https://github.com/sorentwo/oban#usage): -* `repo` - app's Ecto repo (`Pleroma.Repo`) -* `verbose` - logs verbosity -* `prune` - non-retryable jobs [pruning settings](https://github.com/sorentwo/oban#pruning) (`:disabled` / `{:maxlen, value}` / `{:maxage, value}`) -* `queues` - job queues (see below) - -Pleroma has the following queues: - -* `activity_expiration` - Activity expiration -* `federator_outgoing` - Outgoing federation -* `federator_incoming` - Incoming federation -* `mailer` - Email sender, see [`Pleroma.Emails.Mailer`](#pleromaemailsmailer) -* `transmogrifier` - Transmogrifier -* `web_push` - Web push notifications -* `scheduled_activities` - Scheduled activities, see [`Pleroma.ScheduledActivity`](#pleromascheduledactivity) - -Example: - -```elixir -config :pleroma, Oban, - repo: Pleroma.Repo, - verbose: false, - prune: {:maxlen, 1500}, - queues: [ - federator_incoming: 50, - federator_outgoing: 50 - ] -``` - -This config contains two queues: `federator_incoming` and `federator_outgoing`. Both have the number of max concurrent jobs set to `50`. - -### Migrating `pleroma_job_queue` settings - -`config :pleroma_job_queue, :queues` is replaced by `config :pleroma, Oban, :queues` and uses the same format (keys are queues' names, values are max concurrent jobs numbers). - -## :workers - -Includes custom worker options not interpretable directly by `Oban`. - -* `retries` — keyword lists where keys are `Oban` queues (see above) and values are numbers of max attempts for failed jobs. - -Example: - -```elixir -config :pleroma, :workers, - retries: [ - federator_incoming: 5, - federator_outgoing: 5 - ] -``` - -### Migrating `Pleroma.Web.Federator.RetryQueue` settings - -* `max_retries` is replaced with `config :pleroma, :workers, retries: [federator_outgoing: 5]` -* `enabled: false` corresponds to `config :pleroma, :workers, retries: [federator_outgoing: 1]` -* deprecated options: `max_jobs`, `initial_timeout` - -## Pleroma.Web.Metadata -* `providers`: a list of metadata providers to enable. Providers available: - * Pleroma.Web.Metadata.Providers.OpenGraph - * Pleroma.Web.Metadata.Providers.TwitterCard - * Pleroma.Web.Metadata.Providers.RelMe - add links from user bio with rel=me into the `
` as `` - * Pleroma.Web.Metadata.Providers.Feed - add a link to a user's Atom feed into the `
` as `` -* `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews - -## :rich_media -* `enabled`: if enabled the instance will parse metadata from attached links to generate link previews -* `ignore_hosts`: list of hosts which will be ignored by the metadata parser. For example `["accounts.google.com", "xss.website"]`, defaults to `[]`. -* `ignore_tld`: list TLDs (top-level domains) which will ignore for parse metadata. default is ["local", "localdomain", "lan"] -* `parsers`: list of Rich Media parsers - -## :fetch_initial_posts -* `enabled`: if enabled, when a new user is federated with, fetch some of their latest posts -* `pages`: the amount of pages to fetch - -## :hackney_pools - -Advanced. Tweaks Hackney (http client) connections pools. - -There's three pools used: - -* `:federation` for the federation jobs. - You may want this pool max_connections to be at least equal to the number of federator jobs + retry queue jobs. -* `:media` for rich media, media proxy -* `:upload` for uploaded media (if using a remote uploader and `proxy_remote: true`) - -For each pool, the options are: - -* `max_connections` - how much connections a pool can hold -* `timeout` - retention duration for connections - -## :auto_linker - -Configuration for the `auto_linker` library: - -* `class: "auto-linker"` - specify the class to be added to the generated link. false to clear -* `rel: "noopener noreferrer"` - override the rel attribute. false to clear -* `new_window: true` - set to false to remove `target='_blank'` attribute -* `scheme: false` - Set to true to link urls with schema `http://google.com` -* `truncate: false` - Set to a number to truncate urls longer then the number. Truncated urls will end in `..` -* `strip_prefix: true` - Strip the scheme prefix -* `extra: false` - link urls with rarely used schemes (magnet, ipfs, irc, etc.) - -Example: - -```elixir -config :auto_linker, - opts: [ - scheme: true, - extra: true, - class: false, - strip_prefix: false, - new_window: false, - rel: "ugc" - ] -``` - -## Pleroma.Scheduler - -Configuration for [Quantum](https://github.com/quantum-elixir/quantum-core) jobs scheduler. - -See [Quantum readme](https://github.com/quantum-elixir/quantum-core#usage) for the list of supported options. - -Example: - -```elixir -config :pleroma, Pleroma.Scheduler, - global: true, - overlap: true, - timezone: :utc, - jobs: [{"0 */6 * * * *", {Pleroma.Web.Websub, :refresh_subscriptions, []}}] -``` - -The above example defines a single job which invokes `Pleroma.Web.Websub.refresh_subscriptions()` every 6 hours ("0 */6 * * * *", [crontab format](https://en.wikipedia.org/wiki/Cron)). - -## Pleroma.ScheduledActivity - -* `daily_user_limit`: the number of scheduled activities a user is allowed to create in a single day (Default: `25`) -* `total_user_limit`: the number of scheduled activities a user is allowed to create in total (Default: `300`) -* `enabled`: whether scheduled activities are sent to the job queue to be executed - -## Pleroma.ActivityExpiration - -* `enabled`: whether expired activities will be sent to the job queue to be deleted - -## Pleroma.Web.Auth.Authenticator - -* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator -* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication - -## :ldap - -Use LDAP for user authentication. When a user logs in to the Pleroma -instance, the name and password will be verified by trying to authenticate -(bind) to an LDAP server. If a user exists in the LDAP directory but there -is no account with the same name yet on the Pleroma instance then a new -Pleroma account will be created with the same name as the LDAP user name. - -* `enabled`: enables LDAP authentication -* `host`: LDAP server hostname -* `port`: LDAP port, e.g. 389 or 636 -* `ssl`: true to use SSL, usually implies the port 636 -* `sslopts`: additional SSL options -* `tls`: true to start TLS, usually implies the port 389 -* `tlsopts`: additional TLS options -* `base`: LDAP base, e.g. "dc=example,dc=com" -* `uid`: LDAP attribute name to authenticate the user, e.g. when "cn", the filter will be "cn=username,base" - -## BBS / SSH access +### BBS / SSH access To enable simple command line interface accessible over ssh, add a setting like this to your configuration file: @@ -628,10 +637,33 @@ config :esshd, Feel free to adjust the priv_dir and port number. Then you will have to create the key for the keys (in the example `priv/ssh_keys`) and create the host keys with `ssh-keygen -m PEM -N "" -b 2048 -t rsa -f ssh_host_rsa_key`. After restarting, you should be able to connect to your Pleroma instance with `ssh username@server -p $PORT` -## :auth +### :gopher +* `enabled`: Enables the gopher interface +* `ip`: IP address to bind to +* `port`: Port to bind to +* `dstport`: Port advertised in urls (optional, defaults to `port`) -* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator -* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication + +## Authentication + +### :admin_token + +Allows to set a token that can be used to authenticate with the admin api without using an actual user by giving it as the 'admin_token' parameter. Example: + +```elixir +config :pleroma, :admin_token, "somerandomtoken" +``` + +You can then do + +```sh +curl "http://localhost:4000/api/pleroma/admin/invite_token?admin_token=somerandomtoken" +``` + +### :auth + +* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator. +* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication. Authentication / authorization settings. @@ -639,24 +671,30 @@ Authentication / authorization settings. * `oauth_consumer_template`: OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`. * `oauth_consumer_strategies`: the list of enabled OAuth consumer strategies; by default it's set by `OAUTH_CONSUMER_STRATEGIES` environment variable. Each entry in this space-delimited string should be of format `` or `:` (e.g. `twitter` or `keycloak:ueberauth_keycloak_strategy` in case dependency is named differently than `ueberauth_`). -## :email_notifications +### Pleroma.Web.Auth.Authenticator -Email notifications settings. +* `Pleroma.Web.Auth.PleromaAuthenticator`: default database authenticator. +* `Pleroma.Web.Auth.LDAPAuthenticator`: LDAP authentication. - - digest - emails of "what you've missed" for users who have been - inactive for a while. - - active: globally enable or disable digest emails - - schedule: When to send digest email, in [crontab format](https://en.wikipedia.org/wiki/Cron). - "0 0 * * 0" is the default, meaning "once a week at midnight on Sunday morning" - - interval: Minimum interval between digest emails to one user - - inactivity_threshold: Minimum user inactivity threshold +### :ldap -## Pleroma.Emails.UserEmail +Use LDAP for user authentication. When a user logs in to the Pleroma +instance, the name and password will be verified by trying to authenticate +(bind) to an LDAP server. If a user exists in the LDAP directory but there +is no account with the same name yet on the Pleroma instance then a new +Pleroma account will be created with the same name as the LDAP user name. -- `:logo` - a path to a custom logo. Set it to `nil` to use the default Pleroma logo. -- `:styling` - a map with color settings for email templates. +* `enabled`: enables LDAP authentication +* `host`: LDAP server hostname +* `port`: LDAP port, e.g. 389 or 636 +* `ssl`: true to use SSL, usually implies the port 636 +* `sslopts`: additional SSL options +* `tls`: true to start TLS, usually implies the port 389 +* `tlsopts`: additional TLS options +* `base`: LDAP base, e.g. "dc=example,dc=com" +* `uid`: LDAP attribute name to authenticate the user, e.g. when "cn", the filter will be "cn=username,base" -## OAuth consumer mode +### OAuth consumer mode OAuth consumer mode allows sign in / sign up via external OAuth providers (e.g. Twitter, Facebook, Google, Microsoft, etc.). Implementation is based on Ueberauth; see the list of [available strategies](https://github.com/ueberauth/ueberauth/wiki/List-of-Strategies). @@ -728,7 +766,7 @@ config :ueberauth, Ueberauth, ] ``` -## OAuth 2.0 provider - :oauth2 +### OAuth 2.0 provider - :oauth2 Configure OAuth 2 provider capabilities: @@ -737,70 +775,33 @@ Configure OAuth 2 provider capabilities: * `clean_expired_tokens` - Enable a background job to clean expired oauth tokens. Defaults to `false`. * `clean_expired_tokens_interval` - Interval to run the job to clean expired tokens. Defaults to `86_400_000` (24 hours). -## :emoji -* `shortcode_globs`: Location of custom emoji files. `*` can be used as a wildcard. Example `["/emoji/custom/**/*.png"]` -* `pack_extensions`: A list of file extensions for emojis, when no emoji.txt for a pack is present. Example `[".png", ".gif"]` -* `groups`: Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the groupname and the value the location or array of locations. `*` can be used as a wildcard. Example `[Custom: ["/emoji/*.png", "/emoji/custom/*.png"]]` -* `default_manifest`: Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download. Currently only one manifest can be added (no arrays). -* `shared_pack_cache_seconds_per_file`: When an emoji pack is shared, the archive is created and cached in - memory for this amount of seconds multiplied by the number of files. +## Link parsing -## Database options +### :uri_schemes +* `valid_schemes`: List of the scheme part that is considered valid to be an URL. -### RUM indexing for full text search -* `rum_enabled`: If RUM indexes should be used. Defaults to `false`. +### :auto_linker -RUM indexes are an alternative indexing scheme that is not included in PostgreSQL by default. While they may eventually be mainlined, for now they have to be installed as a PostgreSQL extension from https://github.com/postgrespro/rum. +Configuration for the `auto_linker` library: -Their advantage over the standard GIN indexes is that they allow efficient ordering of search results by timestamp, which makes search queries a lot faster on larger servers, by one or two orders of magnitude. They take up around 3 times as much space as GIN indexes. +* `class: "auto-linker"` - specify the class to be added to the generated link. false to clear. +* `rel: "noopener noreferrer"` - override the rel attribute. false to clear. +* `new_window: true` - set to false to remove `target='_blank'` attribute. +* `scheme: false` - Set to true to link urls with schema `http://google.com`. +* `truncate: false` - Set to a number to truncate urls longer then the number. Truncated urls will end in `..`. +* `strip_prefix: true` - Strip the scheme prefix. +* `extra: false` - link urls with rarely used schemes (magnet, ipfs, irc, etc.). -To enable them, both the `rum_enabled` flag has to be set and the following special migration has to be run: +Example: -`mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/` - -This will probably take a long time. - -## :rate_limit - -This is an advanced feature and disabled by default. - -If your instance is behind a reverse proxy you must enable and configure [`Pleroma.Plugs.RemoteIp`](#pleroma-plugs-remoteip). - -A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where: - -* The first element: `scale` (Integer). The time scale in milliseconds. -* The second element: `limit` (Integer). How many requests to limit in the time scale provided. - -It is also possible to have different limits for unauthenticated and authenticated users: the keyword value must be a list of two tuples where the first one is a config for unauthenticated users and the second one is for authenticated. - -Supported rate limiters: - -* `:search` for the search requests (account & status search etc.) -* `:app_account_creation` for registering user accounts from the same IP address -* `:relations_actions` for actions on relations with all users (follow, unfollow) -* `:relation_id_action` for actions on relation with a specific user (follow, unfollow) -* `:statuses_actions` for create / delete / fav / unfav / reblog / unreblog actions on any statuses -* `:status_id_action` for fav / unfav or reblog / unreblog actions on the same status by the same user - -## :web_cache_ttl - -The expiration time for the web responses cache. Values should be in milliseconds or `nil` to disable expiration. - -Available caches: - -* `:activity_pub` - activity pub routes (except question activities). Defaults to `nil` (no expiration). -* `:activity_pub_question` - activity pub routes (question activities). Defaults to `30_000` (30 seconds). - -## Pleroma.Plugs.RemoteIp - -!!! warning - If your instance is not behind at least one reverse proxy, you should not enable this plug. - -`Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration. - -Available options: - -* `enabled` - Enable/disable the plug. Defaults to `false`. -* `headers` - A list of strings naming the `req_headers` to use when deriving the `remote_ip`. Order does not matter. Defaults to `~w[forwarded x-forwarded-for x-client-ip x-real-ip]`. -* `proxies` - A list of strings in [CIDR](https://en.wikipedia.org/wiki/CIDR) notation specifying the IPs of known proxies. Defaults to `[]`. -* `reserved` - Defaults to [localhost](https://en.wikipedia.org/wiki/Localhost) and [private network](https://en.wikipedia.org/wiki/Private_network). +```elixir +config :auto_linker, + opts: [ + scheme: true, + extra: true, + class: false, + strip_prefix: false, + new_window: false, + rel: "ugc" + ] +``` diff --git a/docs/installation/openbsd_en.md b/docs/installation/openbsd_en.md index 3585a326b..45602bd75 100644 --- a/docs/installation/openbsd_en.md +++ b/docs/installation/openbsd_en.md @@ -1,9 +1,13 @@ # Installing on OpenBSD + This guide describes the installation and configuration of pleroma (and the required software to run it) on a single OpenBSD 6.4 server. + For any additional information regarding commands and configuration files mentioned here, check the man pages [online](https://man.openbsd.org/) or directly on your server with the man command. #### Required software + The following packages need to be installed: + * elixir * gmake * ImageMagick @@ -11,8 +15,11 @@ The following packages need to be installed: * postgresql-server * postgresql-contrib -To install them, run the following command (with doas or as root): -`pkg_add elixir gmake ImageMagick git postgresql-server postgresql-contrib` +To install them, run the following command (with doas or as root): + +``` +pkg_add elixir gmake ImageMagick git postgresql-server postgresql-contrib +``` Pleroma requires a reverse proxy, OpenBSD has relayd in base (and is used in this guide) and packages/ports are available for nginx (www/nginx) and apache (www/apache-httpd). Independently of the reverse proxy, [acme-client(1)](https://man.openbsd.org/acme-client) can be used to get a certificate from Let's Encrypt. @@ -31,8 +38,8 @@ Create the \_pleroma user, assign it the pleroma login class and create its home #### Clone pleroma's directory Enter a shell as the \_pleroma user. As root, run `su _pleroma -;cd`. Then clone the repository with `git clone -b stable https://git.pleroma.social/pleroma/pleroma.git`. Pleroma is now installed in /home/\_pleroma/pleroma/, it will be configured and started at the end of this guide. -#### Postgresql -Start a shell as the \_postgresql user (as root run `su _postgresql -` then run the `initdb` command to initialize postgresql: +#### PostgreSQL +Start a shell as the \_postgresql user (as root run `su _postgresql -` then run the `initdb` command to initialize postgresql: If you wish to not use the default location for postgresql's data (/var/postgresql/data), add the following switch at the end of the command: `-D ` and modify the `datadir` variable in the /etc/rc.d/postgresql script. When this is done, enable postgresql so that it starts on boot and start it. As root, run: @@ -44,6 +51,7 @@ To check that it started properly and didn't fail right after starting, you can #### httpd httpd will have three fuctions: + * redirect requests trying to reach the instance over http to the https URL * serve a robots.txt file * get Let's Encrypt certificates, with acme-client @@ -76,9 +84,9 @@ types { include "/usr/share/misc/mime.types" } ``` -Do not forget to change *\* to your server's address(es). If httpd should only listen on one protocol family, comment one of the two first *listen* options. +Do not forget to change ** to your server's address(es). If httpd should only listen on one protocol family, comment one of the two first *listen* options. -Create the /var/www/htdocs/local/ folder and write the content of your robots.txt in /var/www/htdocs/local/robots.txt. +Create the /var/www/htdocs/local/ folder and write the content of your robots.txt in /var/www/htdocs/local/robots.txt. Check the configuration with `httpd -n`, if it is OK enable and start httpd (as root): ``` rcctl enable httpd @@ -86,7 +94,7 @@ rcctl start httpd ``` #### acme-client -acme-client is used to get SSL/TLS certificates from Let's Encrypt. +acme-client is used to get SSL/TLS certificates from Let's Encrypt. Insert the following configuration in /etc/acme-client.conf: ``` # @@ -107,7 +115,7 @@ domain { challengedir "/var/www/acme/" } ``` -Replace *\* by the domain name you'll use for your instance. As root, run `acme-client -n` to check the config, then `acme-client -ADv ` to create account and domain keys, and request a certificate for the first time. +Replace ** by the domain name you'll use for your instance. As root, run `acme-client -n` to check the config, then `acme-client -ADv ` to create account and domain keys, and request a certificate for the first time. Make acme-client run everyday by adding it in /etc/daily.local. As root, run the following command: `echo "acme-client " >> /etc/daily.local`. Relayd will look for certificates and keys based on the address it listens on (see next part), the easiest way to make them available to relayd is to create a link, as root run: @@ -118,7 +126,7 @@ ln -s /etc/ssl/private/.key /etc/ssl/private/.key This will have to be done for each IPv4 and IPv6 address relayd listens on. #### relayd -relayd will be used as the reverse proxy sitting in front of pleroma. +relayd will be used as the reverse proxy sitting in front of pleroma. Insert the following configuration in /etc/relayd.conf: ``` # $OpenBSD: relayd.conf,v 1.4 2018/03/23 09:55:06 claudio Exp $ @@ -169,7 +177,7 @@ relay wwwtls { forward to port 80 check http "/robots.txt" code 200 } ``` -Again, change *\* to your server's address(es) and comment one of the two *listen* options if needed. Also change *wss://CHANGEME.tld* to *wss://\*. +Again, change ** to your server's address(es) and comment one of the two *listen* options if needed. Also change *wss://CHANGEME.tld* to *wss://*. Check the configuration with `relayd -n`, if it is OK enable and start relayd (as root): ``` rcctl enable relayd @@ -177,7 +185,7 @@ rcctl start relayd ``` #### pf -Enabling and configuring pf is highly recommended. +Enabling and configuring pf is highly recommended. In /etc/pf.conf, insert the following configuration: ``` # Macros @@ -202,20 +210,22 @@ pass in quick on $if inet6 proto icmp6 to ($if) icmp6-type { echoreq unreach par pass in quick on $if proto tcp to ($if) port { http https } # relayd/httpd pass in quick on $if proto tcp from $authorized_ssh_clients to ($if) port ssh ``` -Replace *\* by your server's network interface name (which you can get with ifconfig). Consider replacing the content of the authorized\_ssh\_clients macro by, for exemple, your home IP address, to avoid SSH connection attempts from bots. +Replace ** by your server's network interface name (which you can get with ifconfig). Consider replacing the content of the authorized\_ssh\_clients macro by, for exemple, your home IP address, to avoid SSH connection attempts from bots. Check pf's configuration by running `pfctl -nf /etc/pf.conf`, load it with `pfctl -f /etc/pf.conf` and enable pf at boot with `rcctl enable pf`. #### Configure and start pleroma -Enter a shell as \_pleroma (as root `su _pleroma -`) and enter pleroma's installation directory (`cd ~/pleroma/`). +Enter a shell as \_pleroma (as root `su _pleroma -`) and enter pleroma's installation directory (`cd ~/pleroma/`). + Then follow the main installation guide: + * run `mix deps.get` * run `mix pleroma.instance gen` and enter your instance's information when asked * copy config/generated\_config.exs to config/prod.secret.exs. The default values should be sufficient but you should edit it and check that everything seems OK. * exit your current shell back to a root one and run `psql -U postgres -f /home/_pleroma/config/setup_db.psql` to setup the database. * return to a \_pleroma shell into pleroma's installation directory (`su _pleroma -;cd ~/pleroma`) and run `MIX_ENV=prod mix ecto.migrate` -As \_pleroma in /home/\_pleroma/pleroma, you can now run `LC_ALL=en_US.UTF-8 MIX_ENV=prod mix phx.server` to start your instance. +As \_pleroma in /home/\_pleroma/pleroma, you can now run `LC_ALL=en_US.UTF-8 MIX_ENV=prod mix phx.server` to start your instance. In another SSH session/tmux window, check that it is working properly by running `ftp -MVo - http://127.0.0.1:4000/api/v1/instance`, you should get json output. Double-check that *uri*'s value is your instance's domain name. ##### Starting pleroma at boot diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md index c028f4229..965e30e2a 100644 --- a/docs/installation/otp_en.md +++ b/docs/installation/otp_en.md @@ -42,6 +42,10 @@ apk add curl unzip ncurses postgresql postgresql-contrib nginx certbot ## Setup ### Configuring PostgreSQL #### (Optional) Installing RUM indexes + +!!! warning + It is recommended to use PostgreSQL v11 or newer. We have seen some minor issues with lower PostgreSQL versions. + RUM indexes are an alternative indexing scheme that is not included in PostgreSQL by default. You can read more about them on the [Configuration page](../configuration/cheatsheet.md#rum-indexing-for-full-text-search). They are completely optional and most of the time are not worth it, especially if you are running a single user instance (unless you absolutely need ordered search results). Debian/Ubuntu (available only on Buster/19.04): @@ -74,7 +78,7 @@ rc-service postgresql restart # Create the Pleroma user adduser --system --shell /bin/false --home /opt/pleroma pleroma -# Set the flavour environment variable to the string you got in Detecting flavour section. +# Set the flavour environment variable to the string you got in Detecting flavour section. # For example if the flavour is `arm64-musl` the command will be export FLAVOUR="arm64-musl" @@ -180,7 +184,7 @@ rc-service pleroma start rc-update add pleroma ``` -If everything worked, you should see Pleroma-FE when visiting your domain. If that didn't happen, try reviewing the installation steps, starting Pleroma in the foreground and seeing if there are any errrors. +If everything worked, you should see Pleroma-FE when visiting your domain. If that didn't happen, try reviewing the installation steps, starting Pleroma in the foreground and seeing if there are any errrors. Still doesn't work? Feel free to contact us on [#pleroma on freenode](https://webchat.freenode.net/?channels=%23pleroma) or via matrix at , you can also [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma/issues/new) diff --git a/lib/mix/tasks/pleroma/config.ex b/lib/mix/tasks/pleroma/config.ex index 11e4fde43..0e21408b2 100644 --- a/lib/mix/tasks/pleroma/config.ex +++ b/lib/mix/tasks/pleroma/config.ex @@ -45,7 +45,7 @@ defmodule Mix.Tasks.Pleroma.Config do if Pleroma.Config.get([:instance, :dynamic_configuration]) do config_path = "config/#{env}.exported_from_db.secret.exs" - {:ok, file} = File.open(config_path, [:write]) + {:ok, file} = File.open(config_path, [:write, :utf8]) IO.write(file, "use Mix.Config\r\n") Repo.all(Config) diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index d681eecc8..2b6a55f98 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -36,7 +36,8 @@ defmodule Pleroma.Application do Pleroma.Emoji, Pleroma.Captcha, Pleroma.Daemons.ScheduledActivityDaemon, - Pleroma.Daemons.ActivityExpirationDaemon + Pleroma.Daemons.ActivityExpirationDaemon, + Pleroma.Plugs.RateLimiter.Supervisor ] ++ cachex_children() ++ hackney_pool_children() ++ diff --git a/lib/pleroma/bbs/handler.ex b/lib/pleroma/bbs/handler.ex index b0e9ebbd0..054d422b0 100644 --- a/lib/pleroma/bbs/handler.ex +++ b/lib/pleroma/bbs/handler.ex @@ -5,6 +5,7 @@ defmodule Pleroma.BBS.Handler do use Sshd.ShellHandler alias Pleroma.Activity + alias Pleroma.HTML alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.CommonAPI @@ -44,7 +45,7 @@ defmodule Pleroma.BBS.Handler do def puts_activity(activity) do status = Pleroma.Web.MastodonAPI.StatusView.render("show.json", %{activity: activity}) IO.puts("-- #{status.id} by #{status.account.display_name} (#{status.account.acct})") - IO.puts(HtmlSanitizeEx.strip_tags(status.content)) + IO.puts(HTML.strip_tags(status.content)) IO.puts("") end diff --git a/lib/pleroma/constants.ex b/lib/pleroma/constants.ex index 0bf20cdd0..1a432e681 100644 --- a/lib/pleroma/constants.ex +++ b/lib/pleroma/constants.ex @@ -9,6 +9,8 @@ defmodule Pleroma.Constants do const(object_internal_fields, do: [ + "reactions", + "reaction_count", "likes", "like_count", "announcements", diff --git a/lib/pleroma/conversation/participation.ex b/lib/pleroma/conversation/participation.ex index 176b82a20..aafe57280 100644 --- a/lib/pleroma/conversation/participation.ex +++ b/lib/pleroma/conversation/participation.ex @@ -122,9 +122,37 @@ defmodule Pleroma.Conversation.Participation do order_by: [desc: p.updated_at], preload: [conversation: [:users]] ) + |> restrict_recipients(user, params) |> Pleroma.Pagination.fetch_paginated(params) end + def restrict_recipients(query, user, %{"recipients" => user_ids}) do + user_ids = + [user.id | user_ids] + |> Enum.uniq() + |> Enum.reduce([], fn user_id, acc -> + case FlakeId.Ecto.CompatType.dump(user_id) do + {:ok, user_id} -> [user_id | acc] + _ -> acc + end + end) + + conversation_subquery = + __MODULE__ + |> group_by([p], p.conversation_id) + |> having( + [p], + count(p.user_id) == ^length(user_ids) and + fragment("array_agg(?) @> ?", p.user_id, ^user_ids) + ) + |> select([p], %{id: p.conversation_id}) + + query + |> join(:inner, [p], c in subquery(conversation_subquery), on: p.conversation_id == c.id) + end + + def restrict_recipients(query, _, _), do: query + def for_user_and_conversation(user, conversation) do from(p in __MODULE__, where: p.user_id == ^user.id, diff --git a/lib/pleroma/docs/json.ex b/lib/pleroma/docs/json.ex index 18ba01d58..f2a56d845 100644 --- a/lib/pleroma/docs/json.ex +++ b/lib/pleroma/docs/json.ex @@ -5,7 +5,7 @@ defmodule Pleroma.Docs.JSON do def process(descriptions) do config_path = "docs/generate_config.json" - with {:ok, file} <- File.open(config_path, [:write]), + with {:ok, file} <- File.open(config_path, [:write, :utf8]), json <- generate_json(descriptions), :ok <- IO.write(file, json), :ok <- File.close(file) do diff --git a/lib/pleroma/emoji-data.txt b/lib/pleroma/emoji-data.txt new file mode 100644 index 000000000..2fb5c3ff6 --- /dev/null +++ b/lib/pleroma/emoji-data.txt @@ -0,0 +1,769 @@ +# emoji-data.txt +# Date: 2019-01-15, 12:10:05 GMT +# © 2019 Unicode®, Inc. +# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries. +# For terms of use, see http://www.unicode.org/terms_of_use.html +# +# Emoji Data for UTS #51 +# Version: 12.0 +# +# For documentation and usage, see http://www.unicode.org/reports/tr51 +# +# Format: +# ; # +# Note: there is no guarantee as to the structure of whitespace or comments +# +# Characters and sequences are listed in code point order. Users should be shown a more natural order. +# See the CLDR collation order for Emoji. + + +# ================================================ + +# All omitted code points have Emoji=No +# @missing: 0000..10FFFF ; Emoji ; No + +0023 ; Emoji # 1.1 [1] (#️) number sign +002A ; Emoji # 1.1 [1] (*️) asterisk +0030..0039 ; Emoji # 1.1 [10] (0️..9️) digit zero..digit nine +00A9 ; Emoji # 1.1 [1] (©️) copyright +00AE ; Emoji # 1.1 [1] (®️) registered +203C ; Emoji # 1.1 [1] (‼️) double exclamation mark +2049 ; Emoji # 3.0 [1] (⁉️) exclamation question mark +2122 ; Emoji # 1.1 [1] (™️) trade mark +2139 ; Emoji # 3.0 [1] (ℹ️) information +2194..2199 ; Emoji # 1.1 [6] (↔️..↙️) left-right arrow..down-left arrow +21A9..21AA ; Emoji # 1.1 [2] (↩️..↪️) right arrow curving left..left arrow curving right +231A..231B ; Emoji # 1.1 [2] (⌚..⌛) watch..hourglass done +2328 ; Emoji # 1.1 [1] (⌨️) keyboard +23CF ; Emoji # 4.0 [1] (⏏️) eject button +23E9..23F3 ; Emoji # 6.0 [11] (⏩..⏳) fast-forward button..hourglass not done +23F8..23FA ; Emoji # 7.0 [3] (⏸️..⏺️) pause button..record button +24C2 ; Emoji # 1.1 [1] (Ⓜ️) circled M +25AA..25AB ; Emoji # 1.1 [2] (▪️..▫️) black small square..white small square +25B6 ; Emoji # 1.1 [1] (▶️) play button +25C0 ; Emoji # 1.1 [1] (◀️) reverse button +25FB..25FE ; Emoji # 3.2 [4] (◻️..◾) white medium square..black medium-small square +2600..2604 ; Emoji # 1.1 [5] (☀️..☄️) sun..comet +260E ; Emoji # 1.1 [1] (☎️) telephone +2611 ; Emoji # 1.1 [1] (☑️) check box with check +2614..2615 ; Emoji # 4.0 [2] (☔..☕) umbrella with rain drops..hot beverage +2618 ; Emoji # 4.1 [1] (☘️) shamrock +261D ; Emoji # 1.1 [1] (☝️) index pointing up +2620 ; Emoji # 1.1 [1] (☠️) skull and crossbones +2622..2623 ; Emoji # 1.1 [2] (☢️..☣️) radioactive..biohazard +2626 ; Emoji # 1.1 [1] (☦️) orthodox cross +262A ; Emoji # 1.1 [1] (☪️) star and crescent +262E..262F ; Emoji # 1.1 [2] (☮️..☯️) peace symbol..yin yang +2638..263A ; Emoji # 1.1 [3] (☸️..☺️) wheel of dharma..smiling face +2640 ; Emoji # 1.1 [1] (♀️) female sign +2642 ; Emoji # 1.1 [1] (♂️) male sign +2648..2653 ; Emoji # 1.1 [12] (♈..♓) Aries..Pisces +265F..2660 ; Emoji # 1.1 [2] (♟️..♠️) chess pawn..spade suit +2663 ; Emoji # 1.1 [1] (♣️) club suit +2665..2666 ; Emoji # 1.1 [2] (♥️..♦️) heart suit..diamond suit +2668 ; Emoji # 1.1 [1] (♨️) hot springs +267B ; Emoji # 3.2 [1] (♻️) recycling symbol +267E..267F ; Emoji # 4.1 [2] (♾️..♿) infinity..wheelchair symbol +2692..2697 ; Emoji # 4.1 [6] (⚒️..⚗️) hammer and pick..alembic +2699 ; Emoji # 4.1 [1] (⚙️) gear +269B..269C ; Emoji # 4.1 [2] (⚛️..⚜️) atom symbol..fleur-de-lis +26A0..26A1 ; Emoji # 4.0 [2] (⚠️..⚡) warning..high voltage +26AA..26AB ; Emoji # 4.1 [2] (⚪..⚫) white circle..black circle +26B0..26B1 ; Emoji # 4.1 [2] (⚰️..⚱️) coffin..funeral urn +26BD..26BE ; Emoji # 5.2 [2] (⚽..⚾) soccer ball..baseball +26C4..26C5 ; Emoji # 5.2 [2] (⛄..⛅) snowman without snow..sun behind cloud +26C8 ; Emoji # 5.2 [1] (⛈️) cloud with lightning and rain +26CE ; Emoji # 6.0 [1] (⛎) Ophiuchus +26CF ; Emoji # 5.2 [1] (⛏️) pick +26D1 ; Emoji # 5.2 [1] (⛑️) rescue worker’s helmet +26D3..26D4 ; Emoji # 5.2 [2] (⛓️..⛔) chains..no entry +26E9..26EA ; Emoji # 5.2 [2] (⛩️..⛪) shinto shrine..church +26F0..26F5 ; Emoji # 5.2 [6] (⛰️..⛵) mountain..sailboat +26F7..26FA ; Emoji # 5.2 [4] (⛷️..⛺) skier..tent +26FD ; Emoji # 5.2 [1] (⛽) fuel pump +2702 ; Emoji # 1.1 [1] (✂️) scissors +2705 ; Emoji # 6.0 [1] (✅) check mark button +2708..2709 ; Emoji # 1.1 [2] (✈️..✉️) airplane..envelope +270A..270B ; Emoji # 6.0 [2] (✊..✋) raised fist..raised hand +270C..270D ; Emoji # 1.1 [2] (✌️..✍️) victory hand..writing hand +270F ; Emoji # 1.1 [1] (✏️) pencil +2712 ; Emoji # 1.1 [1] (✒️) black nib +2714 ; Emoji # 1.1 [1] (✔️) check mark +2716 ; Emoji # 1.1 [1] (✖️) multiplication sign +271D ; Emoji # 1.1 [1] (✝️) latin cross +2721 ; Emoji # 1.1 [1] (✡️) star of David +2728 ; Emoji # 6.0 [1] (✨) sparkles +2733..2734 ; Emoji # 1.1 [2] (✳️..✴️) eight-spoked asterisk..eight-pointed star +2744 ; Emoji # 1.1 [1] (❄️) snowflake +2747 ; Emoji # 1.1 [1] (❇️) sparkle +274C ; Emoji # 6.0 [1] (❌) cross mark +274E ; Emoji # 6.0 [1] (❎) cross mark button +2753..2755 ; Emoji # 6.0 [3] (❓..❕) question mark..white exclamation mark +2757 ; Emoji # 5.2 [1] (❗) exclamation mark +2763..2764 ; Emoji # 1.1 [2] (❣️..❤️) heart exclamation..red heart +2795..2797 ; Emoji # 6.0 [3] (➕..➗) plus sign..division sign +27A1 ; Emoji # 1.1 [1] (➡️) right arrow +27B0 ; Emoji # 6.0 [1] (➰) curly loop +27BF ; Emoji # 6.0 [1] (➿) double curly loop +2934..2935 ; Emoji # 3.2 [2] (⤴️..⤵️) right arrow curving up..right arrow curving down +2B05..2B07 ; Emoji # 4.0 [3] (⬅️..⬇️) left arrow..down arrow +2B1B..2B1C ; Emoji # 5.1 [2] (⬛..⬜) black large square..white large square +2B50 ; Emoji # 5.1 [1] (⭐) star +2B55 ; Emoji # 5.2 [1] (⭕) hollow red circle +3030 ; Emoji # 1.1 [1] (〰️) wavy dash +303D ; Emoji # 3.2 [1] (〽️) part alternation mark +3297 ; Emoji # 1.1 [1] (㊗️) Japanese “congratulations” button +3299 ; Emoji # 1.1 [1] (㊙️) Japanese “secret” button +1F004 ; Emoji # 5.1 [1] (🀄) mahjong red dragon +1F0CF ; Emoji # 6.0 [1] (🃏) joker +1F170..1F171 ; Emoji # 6.0 [2] (🅰️..🅱️) A button (blood type)..B button (blood type) +1F17E ; Emoji # 6.0 [1] (🅾️) O button (blood type) +1F17F ; Emoji # 5.2 [1] (🅿️) P button +1F18E ; Emoji # 6.0 [1] (🆎) AB button (blood type) +1F191..1F19A ; Emoji # 6.0 [10] (🆑..🆚) CL button..VS button +1F1E6..1F1FF ; Emoji # 6.0 [26] (🇦..🇿) regional indicator symbol letter a..regional indicator symbol letter z +1F201..1F202 ; Emoji # 6.0 [2] (🈁..🈂️) Japanese “here” button..Japanese “service charge” button +1F21A ; Emoji # 5.2 [1] (🈚) Japanese “free of charge” button +1F22F ; Emoji # 5.2 [1] (🈯) Japanese “reserved” button +1F232..1F23A ; Emoji # 6.0 [9] (🈲..🈺) Japanese “prohibited” button..Japanese “open for business” button +1F250..1F251 ; Emoji # 6.0 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button +1F300..1F320 ; Emoji # 6.0 [33] (🌀..🌠) cyclone..shooting star +1F321 ; Emoji # 7.0 [1] (🌡️) thermometer +1F324..1F32C ; Emoji # 7.0 [9] (🌤️..🌬️) sun behind small cloud..wind face +1F32D..1F32F ; Emoji # 8.0 [3] (🌭..🌯) hot dog..burrito +1F330..1F335 ; Emoji # 6.0 [6] (🌰..🌵) chestnut..cactus +1F336 ; Emoji # 7.0 [1] (🌶️) hot pepper +1F337..1F37C ; Emoji # 6.0 [70] (🌷..🍼) tulip..baby bottle +1F37D ; Emoji # 7.0 [1] (🍽️) fork and knife with plate +1F37E..1F37F ; Emoji # 8.0 [2] (🍾..🍿) bottle with popping cork..popcorn +1F380..1F393 ; Emoji # 6.0 [20] (🎀..🎓) ribbon..graduation cap +1F396..1F397 ; Emoji # 7.0 [2] (🎖️..🎗️) military medal..reminder ribbon +1F399..1F39B ; Emoji # 7.0 [3] (🎙️..🎛️) studio microphone..control knobs +1F39E..1F39F ; Emoji # 7.0 [2] (🎞️..🎟️) film frames..admission tickets +1F3A0..1F3C4 ; Emoji # 6.0 [37] (🎠..🏄) carousel horse..person surfing +1F3C5 ; Emoji # 7.0 [1] (🏅) sports medal +1F3C6..1F3CA ; Emoji # 6.0 [5] (🏆..🏊) trophy..person swimming +1F3CB..1F3CE ; Emoji # 7.0 [4] (🏋️..🏎️) person lifting weights..racing car +1F3CF..1F3D3 ; Emoji # 8.0 [5] (🏏..🏓) cricket game..ping pong +1F3D4..1F3DF ; Emoji # 7.0 [12] (🏔️..🏟️) snow-capped mountain..stadium +1F3E0..1F3F0 ; Emoji # 6.0 [17] (🏠..🏰) house..castle +1F3F3..1F3F5 ; Emoji # 7.0 [3] (🏳️..🏵️) white flag..rosette +1F3F7 ; Emoji # 7.0 [1] (🏷️) label +1F3F8..1F3FF ; Emoji # 8.0 [8] (🏸..🏿) badminton..dark skin tone +1F400..1F43E ; Emoji # 6.0 [63] (🐀..🐾) rat..paw prints +1F43F ; Emoji # 7.0 [1] (🐿️) chipmunk +1F440 ; Emoji # 6.0 [1] (👀) eyes +1F441 ; Emoji # 7.0 [1] (👁️) eye +1F442..1F4F7 ; Emoji # 6.0[182] (👂..📷) ear..camera +1F4F8 ; Emoji # 7.0 [1] (📸) camera with flash +1F4F9..1F4FC ; Emoji # 6.0 [4] (📹..📼) video camera..videocassette +1F4FD ; Emoji # 7.0 [1] (📽️) film projector +1F4FF ; Emoji # 8.0 [1] (📿) prayer beads +1F500..1F53D ; Emoji # 6.0 [62] (🔀..🔽) shuffle tracks button..downwards button +1F549..1F54A ; Emoji # 7.0 [2] (🕉️..🕊️) om..dove +1F54B..1F54E ; Emoji # 8.0 [4] (🕋..🕎) kaaba..menorah +1F550..1F567 ; Emoji # 6.0 [24] (🕐..🕧) one o’clock..twelve-thirty +1F56F..1F570 ; Emoji # 7.0 [2] (🕯️..🕰️) candle..mantelpiece clock +1F573..1F579 ; Emoji # 7.0 [7] (🕳️..🕹️) hole..joystick +1F57A ; Emoji # 9.0 [1] (🕺) man dancing +1F587 ; Emoji # 7.0 [1] (🖇️) linked paperclips +1F58A..1F58D ; Emoji # 7.0 [4] (🖊️..🖍️) pen..crayon +1F590 ; Emoji # 7.0 [1] (🖐️) hand with fingers splayed +1F595..1F596 ; Emoji # 7.0 [2] (🖕..🖖) middle finger..vulcan salute +1F5A4 ; Emoji # 9.0 [1] (🖤) black heart +1F5A5 ; Emoji # 7.0 [1] (🖥️) desktop computer +1F5A8 ; Emoji # 7.0 [1] (🖨️) printer +1F5B1..1F5B2 ; Emoji # 7.0 [2] (🖱️..🖲️) computer mouse..trackball +1F5BC ; Emoji # 7.0 [1] (🖼️) framed picture +1F5C2..1F5C4 ; Emoji # 7.0 [3] (🗂️..🗄️) card index dividers..file cabinet +1F5D1..1F5D3 ; Emoji # 7.0 [3] (🗑️..🗓️) wastebasket..spiral calendar +1F5DC..1F5DE ; Emoji # 7.0 [3] (🗜️..🗞️) clamp..rolled-up newspaper +1F5E1 ; Emoji # 7.0 [1] (🗡️) dagger +1F5E3 ; Emoji # 7.0 [1] (🗣️) speaking head +1F5E8 ; Emoji # 7.0 [1] (🗨️) left speech bubble +1F5EF ; Emoji # 7.0 [1] (🗯️) right anger bubble +1F5F3 ; Emoji # 7.0 [1] (🗳️) ballot box with ballot +1F5FA ; Emoji # 7.0 [1] (🗺️) world map +1F5FB..1F5FF ; Emoji # 6.0 [5] (🗻..🗿) mount fuji..moai +1F600 ; Emoji # 6.1 [1] (😀) grinning face +1F601..1F610 ; Emoji # 6.0 [16] (😁..😐) beaming face with smiling eyes..neutral face +1F611 ; Emoji # 6.1 [1] (😑) expressionless face +1F612..1F614 ; Emoji # 6.0 [3] (😒..😔) unamused face..pensive face +1F615 ; Emoji # 6.1 [1] (😕) confused face +1F616 ; Emoji # 6.0 [1] (😖) confounded face +1F617 ; Emoji # 6.1 [1] (😗) kissing face +1F618 ; Emoji # 6.0 [1] (😘) face blowing a kiss +1F619 ; Emoji # 6.1 [1] (😙) kissing face with smiling eyes +1F61A ; Emoji # 6.0 [1] (😚) kissing face with closed eyes +1F61B ; Emoji # 6.1 [1] (😛) face with tongue +1F61C..1F61E ; Emoji # 6.0 [3] (😜..😞) winking face with tongue..disappointed face +1F61F ; Emoji # 6.1 [1] (😟) worried face +1F620..1F625 ; Emoji # 6.0 [6] (😠..😥) angry face..sad but relieved face +1F626..1F627 ; Emoji # 6.1 [2] (😦..😧) frowning face with open mouth..anguished face +1F628..1F62B ; Emoji # 6.0 [4] (😨..😫) fearful face..tired face +1F62C ; Emoji # 6.1 [1] (😬) grimacing face +1F62D ; Emoji # 6.0 [1] (😭) loudly crying face +1F62E..1F62F ; Emoji # 6.1 [2] (😮..😯) face with open mouth..hushed face +1F630..1F633 ; Emoji # 6.0 [4] (😰..😳) anxious face with sweat..flushed face +1F634 ; Emoji # 6.1 [1] (😴) sleeping face +1F635..1F640 ; Emoji # 6.0 [12] (😵..🙀) dizzy face..weary cat +1F641..1F642 ; Emoji # 7.0 [2] (🙁..🙂) slightly frowning face..slightly smiling face +1F643..1F644 ; Emoji # 8.0 [2] (🙃..🙄) upside-down face..face with rolling eyes +1F645..1F64F ; Emoji # 6.0 [11] (🙅..🙏) person gesturing NO..folded hands +1F680..1F6C5 ; Emoji # 6.0 [70] (🚀..🛅) rocket..left luggage +1F6CB..1F6CF ; Emoji # 7.0 [5] (🛋️..🛏️) couch and lamp..bed +1F6D0 ; Emoji # 8.0 [1] (🛐) place of worship +1F6D1..1F6D2 ; Emoji # 9.0 [2] (🛑..🛒) stop sign..shopping cart +1F6D5 ; Emoji # 12.0 [1] (🛕) hindu temple +1F6E0..1F6E5 ; Emoji # 7.0 [6] (🛠️..🛥️) hammer and wrench..motor boat +1F6E9 ; Emoji # 7.0 [1] (🛩️) small airplane +1F6EB..1F6EC ; Emoji # 7.0 [2] (🛫..🛬) airplane departure..airplane arrival +1F6F0 ; Emoji # 7.0 [1] (🛰️) satellite +1F6F3 ; Emoji # 7.0 [1] (🛳️) passenger ship +1F6F4..1F6F6 ; Emoji # 9.0 [3] (🛴..🛶) kick scooter..canoe +1F6F7..1F6F8 ; Emoji # 10.0 [2] (🛷..🛸) sled..flying saucer +1F6F9 ; Emoji # 11.0 [1] (🛹) skateboard +1F6FA ; Emoji # 12.0 [1] (🛺) auto rickshaw +1F7E0..1F7EB ; Emoji # 12.0 [12] (🟠..🟫) orange circle..brown square +1F90D..1F90F ; Emoji # 12.0 [3] (🤍..🤏) white heart..pinching hand +1F910..1F918 ; Emoji # 8.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns +1F919..1F91E ; Emoji # 9.0 [6] (🤙..🤞) call me hand..crossed fingers +1F91F ; Emoji # 10.0 [1] (🤟) love-you gesture +1F920..1F927 ; Emoji # 9.0 [8] (🤠..🤧) cowboy hat face..sneezing face +1F928..1F92F ; Emoji # 10.0 [8] (🤨..🤯) face with raised eyebrow..exploding head +1F930 ; Emoji # 9.0 [1] (🤰) pregnant woman +1F931..1F932 ; Emoji # 10.0 [2] (🤱..🤲) breast-feeding..palms up together +1F933..1F93A ; Emoji # 9.0 [8] (🤳..🤺) selfie..person fencing +1F93C..1F93E ; Emoji # 9.0 [3] (🤼..🤾) people wrestling..person playing handball +1F93F ; Emoji # 12.0 [1] (🤿) diving mask +1F940..1F945 ; Emoji # 9.0 [6] (🥀..🥅) wilted flower..goal net +1F947..1F94B ; Emoji # 9.0 [5] (🥇..🥋) 1st place medal..martial arts uniform +1F94C ; Emoji # 10.0 [1] (🥌) curling stone +1F94D..1F94F ; Emoji # 11.0 [3] (🥍..🥏) lacrosse..flying disc +1F950..1F95E ; Emoji # 9.0 [15] (🥐..🥞) croissant..pancakes +1F95F..1F96B ; Emoji # 10.0 [13] (🥟..🥫) dumpling..canned food +1F96C..1F970 ; Emoji # 11.0 [5] (🥬..🥰) leafy green..smiling face with hearts +1F971 ; Emoji # 12.0 [1] (🥱) yawning face +1F973..1F976 ; Emoji # 11.0 [4] (🥳..🥶) partying face..cold face +1F97A ; Emoji # 11.0 [1] (🥺) pleading face +1F97B ; Emoji # 12.0 [1] (🥻) sari +1F97C..1F97F ; Emoji # 11.0 [4] (🥼..🥿) lab coat..flat shoe +1F980..1F984 ; Emoji # 8.0 [5] (🦀..🦄) crab..unicorn +1F985..1F991 ; Emoji # 9.0 [13] (🦅..🦑) eagle..squid +1F992..1F997 ; Emoji # 10.0 [6] (🦒..🦗) giraffe..cricket +1F998..1F9A2 ; Emoji # 11.0 [11] (🦘..🦢) kangaroo..swan +1F9A5..1F9AA ; Emoji # 12.0 [6] (🦥..🦪) sloth..oyster +1F9AE..1F9AF ; Emoji # 12.0 [2] (🦮..🦯) guide dog..probing cane +1F9B0..1F9B9 ; Emoji # 11.0 [10] (🦰..🦹) red hair..supervillain +1F9BA..1F9BF ; Emoji # 12.0 [6] (🦺..🦿) safety vest..mechanical leg +1F9C0 ; Emoji # 8.0 [1] (🧀) cheese wedge +1F9C1..1F9C2 ; Emoji # 11.0 [2] (🧁..🧂) cupcake..salt +1F9C3..1F9CA ; Emoji # 12.0 [8] (🧃..🧊) beverage box..ice cube +1F9CD..1F9CF ; Emoji # 12.0 [3] (🧍..🧏) person standing..deaf person +1F9D0..1F9E6 ; Emoji # 10.0 [23] (🧐..🧦) face with monocle..socks +1F9E7..1F9FF ; Emoji # 11.0 [25] (🧧..🧿) red envelope..nazar amulet +1FA70..1FA73 ; Emoji # 12.0 [4] (🩰..🩳) ballet shoes..shorts +1FA78..1FA7A ; Emoji # 12.0 [3] (🩸..🩺) drop of blood..stethoscope +1FA80..1FA82 ; Emoji # 12.0 [3] (🪀..🪂) yo-yo..parachute +1FA90..1FA95 ; Emoji # 12.0 [6] (🪐..🪕) ringed planet..banjo + +# Total elements: 1311 + +# ================================================ + +# All omitted code points have Emoji_Presentation=No +# @missing: 0000..10FFFF ; Emoji_Presentation ; No + +231A..231B ; Emoji_Presentation # 1.1 [2] (⌚..⌛) watch..hourglass done +23E9..23EC ; Emoji_Presentation # 6.0 [4] (⏩..⏬) fast-forward button..fast down button +23F0 ; Emoji_Presentation # 6.0 [1] (⏰) alarm clock +23F3 ; Emoji_Presentation # 6.0 [1] (⏳) hourglass not done +25FD..25FE ; Emoji_Presentation # 3.2 [2] (◽..◾) white medium-small square..black medium-small square +2614..2615 ; Emoji_Presentation # 4.0 [2] (☔..☕) umbrella with rain drops..hot beverage +2648..2653 ; Emoji_Presentation # 1.1 [12] (♈..♓) Aries..Pisces +267F ; Emoji_Presentation # 4.1 [1] (♿) wheelchair symbol +2693 ; Emoji_Presentation # 4.1 [1] (⚓) anchor +26A1 ; Emoji_Presentation # 4.0 [1] (⚡) high voltage +26AA..26AB ; Emoji_Presentation # 4.1 [2] (⚪..⚫) white circle..black circle +26BD..26BE ; Emoji_Presentation # 5.2 [2] (⚽..⚾) soccer ball..baseball +26C4..26C5 ; Emoji_Presentation # 5.2 [2] (⛄..⛅) snowman without snow..sun behind cloud +26CE ; Emoji_Presentation # 6.0 [1] (⛎) Ophiuchus +26D4 ; Emoji_Presentation # 5.2 [1] (⛔) no entry +26EA ; Emoji_Presentation # 5.2 [1] (⛪) church +26F2..26F3 ; Emoji_Presentation # 5.2 [2] (⛲..⛳) fountain..flag in hole +26F5 ; Emoji_Presentation # 5.2 [1] (⛵) sailboat +26FA ; Emoji_Presentation # 5.2 [1] (⛺) tent +26FD ; Emoji_Presentation # 5.2 [1] (⛽) fuel pump +2705 ; Emoji_Presentation # 6.0 [1] (✅) check mark button +270A..270B ; Emoji_Presentation # 6.0 [2] (✊..✋) raised fist..raised hand +2728 ; Emoji_Presentation # 6.0 [1] (✨) sparkles +274C ; Emoji_Presentation # 6.0 [1] (❌) cross mark +274E ; Emoji_Presentation # 6.0 [1] (❎) cross mark button +2753..2755 ; Emoji_Presentation # 6.0 [3] (❓..❕) question mark..white exclamation mark +2757 ; Emoji_Presentation # 5.2 [1] (❗) exclamation mark +2795..2797 ; Emoji_Presentation # 6.0 [3] (➕..➗) plus sign..division sign +27B0 ; Emoji_Presentation # 6.0 [1] (➰) curly loop +27BF ; Emoji_Presentation # 6.0 [1] (➿) double curly loop +2B1B..2B1C ; Emoji_Presentation # 5.1 [2] (⬛..⬜) black large square..white large square +2B50 ; Emoji_Presentation # 5.1 [1] (⭐) star +2B55 ; Emoji_Presentation # 5.2 [1] (⭕) hollow red circle +1F004 ; Emoji_Presentation # 5.1 [1] (🀄) mahjong red dragon +1F0CF ; Emoji_Presentation # 6.0 [1] (🃏) joker +1F18E ; Emoji_Presentation # 6.0 [1] (🆎) AB button (blood type) +1F191..1F19A ; Emoji_Presentation # 6.0 [10] (🆑..🆚) CL button..VS button +1F1E6..1F1FF ; Emoji_Presentation # 6.0 [26] (🇦..🇿) regional indicator symbol letter a..regional indicator symbol letter z +1F201 ; Emoji_Presentation # 6.0 [1] (🈁) Japanese “here” button +1F21A ; Emoji_Presentation # 5.2 [1] (🈚) Japanese “free of charge” button +1F22F ; Emoji_Presentation # 5.2 [1] (🈯) Japanese “reserved” button +1F232..1F236 ; Emoji_Presentation # 6.0 [5] (🈲..🈶) Japanese “prohibited” button..Japanese “not free of charge” button +1F238..1F23A ; Emoji_Presentation # 6.0 [3] (🈸..🈺) Japanese “application” button..Japanese “open for business” button +1F250..1F251 ; Emoji_Presentation # 6.0 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button +1F300..1F320 ; Emoji_Presentation # 6.0 [33] (🌀..🌠) cyclone..shooting star +1F32D..1F32F ; Emoji_Presentation # 8.0 [3] (🌭..🌯) hot dog..burrito +1F330..1F335 ; Emoji_Presentation # 6.0 [6] (🌰..🌵) chestnut..cactus +1F337..1F37C ; Emoji_Presentation # 6.0 [70] (🌷..🍼) tulip..baby bottle +1F37E..1F37F ; Emoji_Presentation # 8.0 [2] (🍾..🍿) bottle with popping cork..popcorn +1F380..1F393 ; Emoji_Presentation # 6.0 [20] (🎀..🎓) ribbon..graduation cap +1F3A0..1F3C4 ; Emoji_Presentation # 6.0 [37] (🎠..🏄) carousel horse..person surfing +1F3C5 ; Emoji_Presentation # 7.0 [1] (🏅) sports medal +1F3C6..1F3CA ; Emoji_Presentation # 6.0 [5] (🏆..🏊) trophy..person swimming +1F3CF..1F3D3 ; Emoji_Presentation # 8.0 [5] (🏏..🏓) cricket game..ping pong +1F3E0..1F3F0 ; Emoji_Presentation # 6.0 [17] (🏠..🏰) house..castle +1F3F4 ; Emoji_Presentation # 7.0 [1] (🏴) black flag +1F3F8..1F3FF ; Emoji_Presentation # 8.0 [8] (🏸..🏿) badminton..dark skin tone +1F400..1F43E ; Emoji_Presentation # 6.0 [63] (🐀..🐾) rat..paw prints +1F440 ; Emoji_Presentation # 6.0 [1] (👀) eyes +1F442..1F4F7 ; Emoji_Presentation # 6.0[182] (👂..📷) ear..camera +1F4F8 ; Emoji_Presentation # 7.0 [1] (📸) camera with flash +1F4F9..1F4FC ; Emoji_Presentation # 6.0 [4] (📹..📼) video camera..videocassette +1F4FF ; Emoji_Presentation # 8.0 [1] (📿) prayer beads +1F500..1F53D ; Emoji_Presentation # 6.0 [62] (🔀..🔽) shuffle tracks button..downwards button +1F54B..1F54E ; Emoji_Presentation # 8.0 [4] (🕋..🕎) kaaba..menorah +1F550..1F567 ; Emoji_Presentation # 6.0 [24] (🕐..🕧) one o’clock..twelve-thirty +1F57A ; Emoji_Presentation # 9.0 [1] (🕺) man dancing +1F595..1F596 ; Emoji_Presentation # 7.0 [2] (🖕..🖖) middle finger..vulcan salute +1F5A4 ; Emoji_Presentation # 9.0 [1] (🖤) black heart +1F5FB..1F5FF ; Emoji_Presentation # 6.0 [5] (🗻..🗿) mount fuji..moai +1F600 ; Emoji_Presentation # 6.1 [1] (😀) grinning face +1F601..1F610 ; Emoji_Presentation # 6.0 [16] (😁..😐) beaming face with smiling eyes..neutral face +1F611 ; Emoji_Presentation # 6.1 [1] (😑) expressionless face +1F612..1F614 ; Emoji_Presentation # 6.0 [3] (😒..😔) unamused face..pensive face +1F615 ; Emoji_Presentation # 6.1 [1] (😕) confused face +1F616 ; Emoji_Presentation # 6.0 [1] (😖) confounded face +1F617 ; Emoji_Presentation # 6.1 [1] (😗) kissing face +1F618 ; Emoji_Presentation # 6.0 [1] (😘) face blowing a kiss +1F619 ; Emoji_Presentation # 6.1 [1] (😙) kissing face with smiling eyes +1F61A ; Emoji_Presentation # 6.0 [1] (😚) kissing face with closed eyes +1F61B ; Emoji_Presentation # 6.1 [1] (😛) face with tongue +1F61C..1F61E ; Emoji_Presentation # 6.0 [3] (😜..😞) winking face with tongue..disappointed face +1F61F ; Emoji_Presentation # 6.1 [1] (😟) worried face +1F620..1F625 ; Emoji_Presentation # 6.0 [6] (😠..😥) angry face..sad but relieved face +1F626..1F627 ; Emoji_Presentation # 6.1 [2] (😦..😧) frowning face with open mouth..anguished face +1F628..1F62B ; Emoji_Presentation # 6.0 [4] (😨..😫) fearful face..tired face +1F62C ; Emoji_Presentation # 6.1 [1] (😬) grimacing face +1F62D ; Emoji_Presentation # 6.0 [1] (😭) loudly crying face +1F62E..1F62F ; Emoji_Presentation # 6.1 [2] (😮..😯) face with open mouth..hushed face +1F630..1F633 ; Emoji_Presentation # 6.0 [4] (😰..😳) anxious face with sweat..flushed face +1F634 ; Emoji_Presentation # 6.1 [1] (😴) sleeping face +1F635..1F640 ; Emoji_Presentation # 6.0 [12] (😵..🙀) dizzy face..weary cat +1F641..1F642 ; Emoji_Presentation # 7.0 [2] (🙁..🙂) slightly frowning face..slightly smiling face +1F643..1F644 ; Emoji_Presentation # 8.0 [2] (🙃..🙄) upside-down face..face with rolling eyes +1F645..1F64F ; Emoji_Presentation # 6.0 [11] (🙅..🙏) person gesturing NO..folded hands +1F680..1F6C5 ; Emoji_Presentation # 6.0 [70] (🚀..🛅) rocket..left luggage +1F6CC ; Emoji_Presentation # 7.0 [1] (🛌) person in bed +1F6D0 ; Emoji_Presentation # 8.0 [1] (🛐) place of worship +1F6D1..1F6D2 ; Emoji_Presentation # 9.0 [2] (🛑..🛒) stop sign..shopping cart +1F6D5 ; Emoji_Presentation # 12.0 [1] (🛕) hindu temple +1F6EB..1F6EC ; Emoji_Presentation # 7.0 [2] (🛫..🛬) airplane departure..airplane arrival +1F6F4..1F6F6 ; Emoji_Presentation # 9.0 [3] (🛴..🛶) kick scooter..canoe +1F6F7..1F6F8 ; Emoji_Presentation # 10.0 [2] (🛷..🛸) sled..flying saucer +1F6F9 ; Emoji_Presentation # 11.0 [1] (🛹) skateboard +1F6FA ; Emoji_Presentation # 12.0 [1] (🛺) auto rickshaw +1F7E0..1F7EB ; Emoji_Presentation # 12.0 [12] (🟠..🟫) orange circle..brown square +1F90D..1F90F ; Emoji_Presentation # 12.0 [3] (🤍..🤏) white heart..pinching hand +1F910..1F918 ; Emoji_Presentation # 8.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns +1F919..1F91E ; Emoji_Presentation # 9.0 [6] (🤙..🤞) call me hand..crossed fingers +1F91F ; Emoji_Presentation # 10.0 [1] (🤟) love-you gesture +1F920..1F927 ; Emoji_Presentation # 9.0 [8] (🤠..🤧) cowboy hat face..sneezing face +1F928..1F92F ; Emoji_Presentation # 10.0 [8] (🤨..🤯) face with raised eyebrow..exploding head +1F930 ; Emoji_Presentation # 9.0 [1] (🤰) pregnant woman +1F931..1F932 ; Emoji_Presentation # 10.0 [2] (🤱..🤲) breast-feeding..palms up together +1F933..1F93A ; Emoji_Presentation # 9.0 [8] (🤳..🤺) selfie..person fencing +1F93C..1F93E ; Emoji_Presentation # 9.0 [3] (🤼..🤾) people wrestling..person playing handball +1F93F ; Emoji_Presentation # 12.0 [1] (🤿) diving mask +1F940..1F945 ; Emoji_Presentation # 9.0 [6] (🥀..🥅) wilted flower..goal net +1F947..1F94B ; Emoji_Presentation # 9.0 [5] (🥇..🥋) 1st place medal..martial arts uniform +1F94C ; Emoji_Presentation # 10.0 [1] (🥌) curling stone +1F94D..1F94F ; Emoji_Presentation # 11.0 [3] (🥍..🥏) lacrosse..flying disc +1F950..1F95E ; Emoji_Presentation # 9.0 [15] (🥐..🥞) croissant..pancakes +1F95F..1F96B ; Emoji_Presentation # 10.0 [13] (🥟..🥫) dumpling..canned food +1F96C..1F970 ; Emoji_Presentation # 11.0 [5] (🥬..🥰) leafy green..smiling face with hearts +1F971 ; Emoji_Presentation # 12.0 [1] (🥱) yawning face +1F973..1F976 ; Emoji_Presentation # 11.0 [4] (🥳..🥶) partying face..cold face +1F97A ; Emoji_Presentation # 11.0 [1] (🥺) pleading face +1F97B ; Emoji_Presentation # 12.0 [1] (🥻) sari +1F97C..1F97F ; Emoji_Presentation # 11.0 [4] (🥼..🥿) lab coat..flat shoe +1F980..1F984 ; Emoji_Presentation # 8.0 [5] (🦀..🦄) crab..unicorn +1F985..1F991 ; Emoji_Presentation # 9.0 [13] (🦅..🦑) eagle..squid +1F992..1F997 ; Emoji_Presentation # 10.0 [6] (🦒..🦗) giraffe..cricket +1F998..1F9A2 ; Emoji_Presentation # 11.0 [11] (🦘..🦢) kangaroo..swan +1F9A5..1F9AA ; Emoji_Presentation # 12.0 [6] (🦥..🦪) sloth..oyster +1F9AE..1F9AF ; Emoji_Presentation # 12.0 [2] (🦮..🦯) guide dog..probing cane +1F9B0..1F9B9 ; Emoji_Presentation # 11.0 [10] (🦰..🦹) red hair..supervillain +1F9BA..1F9BF ; Emoji_Presentation # 12.0 [6] (🦺..🦿) safety vest..mechanical leg +1F9C0 ; Emoji_Presentation # 8.0 [1] (🧀) cheese wedge +1F9C1..1F9C2 ; Emoji_Presentation # 11.0 [2] (🧁..🧂) cupcake..salt +1F9C3..1F9CA ; Emoji_Presentation # 12.0 [8] (🧃..🧊) beverage box..ice cube +1F9CD..1F9CF ; Emoji_Presentation # 12.0 [3] (🧍..🧏) person standing..deaf person +1F9D0..1F9E6 ; Emoji_Presentation # 10.0 [23] (🧐..🧦) face with monocle..socks +1F9E7..1F9FF ; Emoji_Presentation # 11.0 [25] (🧧..🧿) red envelope..nazar amulet +1FA70..1FA73 ; Emoji_Presentation # 12.0 [4] (🩰..🩳) ballet shoes..shorts +1FA78..1FA7A ; Emoji_Presentation # 12.0 [3] (🩸..🩺) drop of blood..stethoscope +1FA80..1FA82 ; Emoji_Presentation # 12.0 [3] (🪀..🪂) yo-yo..parachute +1FA90..1FA95 ; Emoji_Presentation # 12.0 [6] (🪐..🪕) ringed planet..banjo + +# Total elements: 1093 + +# ================================================ + +# All omitted code points have Emoji_Modifier=No +# @missing: 0000..10FFFF ; Emoji_Modifier ; No + +1F3FB..1F3FF ; Emoji_Modifier # 8.0 [5] (🏻..🏿) light skin tone..dark skin tone + +# Total elements: 5 + +# ================================================ + +# All omitted code points have Emoji_Modifier_Base=No +# @missing: 0000..10FFFF ; Emoji_Modifier_Base ; No + +261D ; Emoji_Modifier_Base # 1.1 [1] (☝️) index pointing up +26F9 ; Emoji_Modifier_Base # 5.2 [1] (⛹️) person bouncing ball +270A..270B ; Emoji_Modifier_Base # 6.0 [2] (✊..✋) raised fist..raised hand +270C..270D ; Emoji_Modifier_Base # 1.1 [2] (✌️..✍️) victory hand..writing hand +1F385 ; Emoji_Modifier_Base # 6.0 [1] (🎅) Santa Claus +1F3C2..1F3C4 ; Emoji_Modifier_Base # 6.0 [3] (🏂..🏄) snowboarder..person surfing +1F3C7 ; Emoji_Modifier_Base # 6.0 [1] (🏇) horse racing +1F3CA ; Emoji_Modifier_Base # 6.0 [1] (🏊) person swimming +1F3CB..1F3CC ; Emoji_Modifier_Base # 7.0 [2] (🏋️..🏌️) person lifting weights..person golfing +1F442..1F443 ; Emoji_Modifier_Base # 6.0 [2] (👂..👃) ear..nose +1F446..1F450 ; Emoji_Modifier_Base # 6.0 [11] (👆..👐) backhand index pointing up..open hands +1F466..1F478 ; Emoji_Modifier_Base # 6.0 [19] (👦..👸) boy..princess +1F47C ; Emoji_Modifier_Base # 6.0 [1] (👼) baby angel +1F481..1F483 ; Emoji_Modifier_Base # 6.0 [3] (💁..💃) person tipping hand..woman dancing +1F485..1F487 ; Emoji_Modifier_Base # 6.0 [3] (💅..💇) nail polish..person getting haircut +1F48F ; Emoji_Modifier_Base # 6.0 [1] (💏) kiss +1F491 ; Emoji_Modifier_Base # 6.0 [1] (💑) couple with heart +1F4AA ; Emoji_Modifier_Base # 6.0 [1] (💪) flexed biceps +1F574..1F575 ; Emoji_Modifier_Base # 7.0 [2] (🕴️..🕵️) man in suit levitating..detective +1F57A ; Emoji_Modifier_Base # 9.0 [1] (🕺) man dancing +1F590 ; Emoji_Modifier_Base # 7.0 [1] (🖐️) hand with fingers splayed +1F595..1F596 ; Emoji_Modifier_Base # 7.0 [2] (🖕..🖖) middle finger..vulcan salute +1F645..1F647 ; Emoji_Modifier_Base # 6.0 [3] (🙅..🙇) person gesturing NO..person bowing +1F64B..1F64F ; Emoji_Modifier_Base # 6.0 [5] (🙋..🙏) person raising hand..folded hands +1F6A3 ; Emoji_Modifier_Base # 6.0 [1] (🚣) person rowing boat +1F6B4..1F6B6 ; Emoji_Modifier_Base # 6.0 [3] (🚴..🚶) person biking..person walking +1F6C0 ; Emoji_Modifier_Base # 6.0 [1] (🛀) person taking bath +1F6CC ; Emoji_Modifier_Base # 7.0 [1] (🛌) person in bed +1F90F ; Emoji_Modifier_Base # 12.0 [1] (🤏) pinching hand +1F918 ; Emoji_Modifier_Base # 8.0 [1] (🤘) sign of the horns +1F919..1F91E ; Emoji_Modifier_Base # 9.0 [6] (🤙..🤞) call me hand..crossed fingers +1F91F ; Emoji_Modifier_Base # 10.0 [1] (🤟) love-you gesture +1F926 ; Emoji_Modifier_Base # 9.0 [1] (🤦) person facepalming +1F930 ; Emoji_Modifier_Base # 9.0 [1] (🤰) pregnant woman +1F931..1F932 ; Emoji_Modifier_Base # 10.0 [2] (🤱..🤲) breast-feeding..palms up together +1F933..1F939 ; Emoji_Modifier_Base # 9.0 [7] (🤳..🤹) selfie..person juggling +1F93C..1F93E ; Emoji_Modifier_Base # 9.0 [3] (🤼..🤾) people wrestling..person playing handball +1F9B5..1F9B6 ; Emoji_Modifier_Base # 11.0 [2] (🦵..🦶) leg..foot +1F9B8..1F9B9 ; Emoji_Modifier_Base # 11.0 [2] (🦸..🦹) superhero..supervillain +1F9BB ; Emoji_Modifier_Base # 12.0 [1] (🦻) ear with hearing aid +1F9CD..1F9CF ; Emoji_Modifier_Base # 12.0 [3] (🧍..🧏) person standing..deaf person +1F9D1..1F9DD ; Emoji_Modifier_Base # 10.0 [13] (🧑..🧝) person..elf + +# Total elements: 120 + +# ================================================ + +# All omitted code points have Emoji_Component=No +# @missing: 0000..10FFFF ; Emoji_Component ; No + +0023 ; Emoji_Component # 1.1 [1] (#️) number sign +002A ; Emoji_Component # 1.1 [1] (*️) asterisk +0030..0039 ; Emoji_Component # 1.1 [10] (0️..9️) digit zero..digit nine +200D ; Emoji_Component # 1.1 [1] (‍) zero width joiner +20E3 ; Emoji_Component # 3.0 [1] (⃣) combining enclosing keycap +FE0F ; Emoji_Component # 3.2 [1] () VARIATION SELECTOR-16 +1F1E6..1F1FF ; Emoji_Component # 6.0 [26] (🇦..🇿) regional indicator symbol letter a..regional indicator symbol letter z +1F3FB..1F3FF ; Emoji_Component # 8.0 [5] (🏻..🏿) light skin tone..dark skin tone +1F9B0..1F9B3 ; Emoji_Component # 11.0 [4] (🦰..🦳) red hair..white hair +E0020..E007F ; Emoji_Component # 3.1 [96] (󠀠..󠁿) tag space..cancel tag + +# Total elements: 146 + +# ================================================ + +# All omitted code points have Extended_Pictographic=No +# @missing: 0000..10FFFF ; Extended_Pictographic ; No + +00A9 ; Extended_Pictographic# 1.1 [1] (©️) copyright +00AE ; Extended_Pictographic# 1.1 [1] (®️) registered +203C ; Extended_Pictographic# 1.1 [1] (‼️) double exclamation mark +2049 ; Extended_Pictographic# 3.0 [1] (⁉️) exclamation question mark +2122 ; Extended_Pictographic# 1.1 [1] (™️) trade mark +2139 ; Extended_Pictographic# 3.0 [1] (ℹ️) information +2194..2199 ; Extended_Pictographic# 1.1 [6] (↔️..↙️) left-right arrow..down-left arrow +21A9..21AA ; Extended_Pictographic# 1.1 [2] (↩️..↪️) right arrow curving left..left arrow curving right +231A..231B ; Extended_Pictographic# 1.1 [2] (⌚..⌛) watch..hourglass done +2328 ; Extended_Pictographic# 1.1 [1] (⌨️) keyboard +2388 ; Extended_Pictographic# 3.0 [1] (⎈) HELM SYMBOL +23CF ; Extended_Pictographic# 4.0 [1] (⏏️) eject button +23E9..23F3 ; Extended_Pictographic# 6.0 [11] (⏩..⏳) fast-forward button..hourglass not done +23F8..23FA ; Extended_Pictographic# 7.0 [3] (⏸️..⏺️) pause button..record button +24C2 ; Extended_Pictographic# 1.1 [1] (Ⓜ️) circled M +25AA..25AB ; Extended_Pictographic# 1.1 [2] (▪️..▫️) black small square..white small square +25B6 ; Extended_Pictographic# 1.1 [1] (▶️) play button +25C0 ; Extended_Pictographic# 1.1 [1] (◀️) reverse button +25FB..25FE ; Extended_Pictographic# 3.2 [4] (◻️..◾) white medium square..black medium-small square +2600..2605 ; Extended_Pictographic# 1.1 [6] (☀️..★) sun..BLACK STAR +2607..2612 ; Extended_Pictographic# 1.1 [12] (☇..☒) LIGHTNING..BALLOT BOX WITH X +2614..2615 ; Extended_Pictographic# 4.0 [2] (☔..☕) umbrella with rain drops..hot beverage +2616..2617 ; Extended_Pictographic# 3.2 [2] (☖..☗) WHITE SHOGI PIECE..BLACK SHOGI PIECE +2618 ; Extended_Pictographic# 4.1 [1] (☘️) shamrock +2619 ; Extended_Pictographic# 3.0 [1] (☙) REVERSED ROTATED FLORAL HEART BULLET +261A..266F ; Extended_Pictographic# 1.1 [86] (☚..♯) BLACK LEFT POINTING INDEX..MUSIC SHARP SIGN +2670..2671 ; Extended_Pictographic# 3.0 [2] (♰..♱) WEST SYRIAC CROSS..EAST SYRIAC CROSS +2672..267D ; Extended_Pictographic# 3.2 [12] (♲..♽) UNIVERSAL RECYCLING SYMBOL..PARTIALLY-RECYCLED PAPER SYMBOL +267E..267F ; Extended_Pictographic# 4.1 [2] (♾️..♿) infinity..wheelchair symbol +2680..2685 ; Extended_Pictographic# 3.2 [6] (⚀..⚅) DIE FACE-1..DIE FACE-6 +2690..2691 ; Extended_Pictographic# 4.0 [2] (⚐..⚑) WHITE FLAG..BLACK FLAG +2692..269C ; Extended_Pictographic# 4.1 [11] (⚒️..⚜️) hammer and pick..fleur-de-lis +269D ; Extended_Pictographic# 5.1 [1] (⚝) OUTLINED WHITE STAR +269E..269F ; Extended_Pictographic# 5.2 [2] (⚞..⚟) THREE LINES CONVERGING RIGHT..THREE LINES CONVERGING LEFT +26A0..26A1 ; Extended_Pictographic# 4.0 [2] (⚠️..⚡) warning..high voltage +26A2..26B1 ; Extended_Pictographic# 4.1 [16] (⚢..⚱️) DOUBLED FEMALE SIGN..funeral urn +26B2 ; Extended_Pictographic# 5.0 [1] (⚲) NEUTER +26B3..26BC ; Extended_Pictographic# 5.1 [10] (⚳..⚼) CERES..SESQUIQUADRATE +26BD..26BF ; Extended_Pictographic# 5.2 [3] (⚽..⚿) soccer ball..SQUARED KEY +26C0..26C3 ; Extended_Pictographic# 5.1 [4] (⛀..⛃) WHITE DRAUGHTS MAN..BLACK DRAUGHTS KING +26C4..26CD ; Extended_Pictographic# 5.2 [10] (⛄..⛍) snowman without snow..DISABLED CAR +26CE ; Extended_Pictographic# 6.0 [1] (⛎) Ophiuchus +26CF..26E1 ; Extended_Pictographic# 5.2 [19] (⛏️..⛡) pick..RESTRICTED LEFT ENTRY-2 +26E2 ; Extended_Pictographic# 6.0 [1] (⛢) ASTRONOMICAL SYMBOL FOR URANUS +26E3 ; Extended_Pictographic# 5.2 [1] (⛣) HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE +26E4..26E7 ; Extended_Pictographic# 6.0 [4] (⛤..⛧) PENTAGRAM..INVERTED PENTAGRAM +26E8..26FF ; Extended_Pictographic# 5.2 [24] (⛨..⛿) BLACK CROSS ON SHIELD..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE +2700 ; Extended_Pictographic# 7.0 [1] (✀) BLACK SAFETY SCISSORS +2701..2704 ; Extended_Pictographic# 1.1 [4] (✁..✄) UPPER BLADE SCISSORS..WHITE SCISSORS +2705 ; Extended_Pictographic# 6.0 [1] (✅) check mark button +2708..2709 ; Extended_Pictographic# 1.1 [2] (✈️..✉️) airplane..envelope +270A..270B ; Extended_Pictographic# 6.0 [2] (✊..✋) raised fist..raised hand +270C..2712 ; Extended_Pictographic# 1.1 [7] (✌️..✒️) victory hand..black nib +2714 ; Extended_Pictographic# 1.1 [1] (✔️) check mark +2716 ; Extended_Pictographic# 1.1 [1] (✖️) multiplication sign +271D ; Extended_Pictographic# 1.1 [1] (✝️) latin cross +2721 ; Extended_Pictographic# 1.1 [1] (✡️) star of David +2728 ; Extended_Pictographic# 6.0 [1] (✨) sparkles +2733..2734 ; Extended_Pictographic# 1.1 [2] (✳️..✴️) eight-spoked asterisk..eight-pointed star +2744 ; Extended_Pictographic# 1.1 [1] (❄️) snowflake +2747 ; Extended_Pictographic# 1.1 [1] (❇️) sparkle +274C ; Extended_Pictographic# 6.0 [1] (❌) cross mark +274E ; Extended_Pictographic# 6.0 [1] (❎) cross mark button +2753..2755 ; Extended_Pictographic# 6.0 [3] (❓..❕) question mark..white exclamation mark +2757 ; Extended_Pictographic# 5.2 [1] (❗) exclamation mark +2763..2767 ; Extended_Pictographic# 1.1 [5] (❣️..❧) heart exclamation..ROTATED FLORAL HEART BULLET +2795..2797 ; Extended_Pictographic# 6.0 [3] (➕..➗) plus sign..division sign +27A1 ; Extended_Pictographic# 1.1 [1] (➡️) right arrow +27B0 ; Extended_Pictographic# 6.0 [1] (➰) curly loop +27BF ; Extended_Pictographic# 6.0 [1] (➿) double curly loop +2934..2935 ; Extended_Pictographic# 3.2 [2] (⤴️..⤵️) right arrow curving up..right arrow curving down +2B05..2B07 ; Extended_Pictographic# 4.0 [3] (⬅️..⬇️) left arrow..down arrow +2B1B..2B1C ; Extended_Pictographic# 5.1 [2] (⬛..⬜) black large square..white large square +2B50 ; Extended_Pictographic# 5.1 [1] (⭐) star +2B55 ; Extended_Pictographic# 5.2 [1] (⭕) hollow red circle +3030 ; Extended_Pictographic# 1.1 [1] (〰️) wavy dash +303D ; Extended_Pictographic# 3.2 [1] (〽️) part alternation mark +3297 ; Extended_Pictographic# 1.1 [1] (㊗️) Japanese “congratulations” button +3299 ; Extended_Pictographic# 1.1 [1] (㊙️) Japanese “secret” button +1F000..1F02B ; Extended_Pictographic# 5.1 [44] (🀀..🀫) MAHJONG TILE EAST WIND..MAHJONG TILE BACK +1F02C..1F02F ; Extended_Pictographic# NA [4] (🀬..🀯) .. +1F030..1F093 ; Extended_Pictographic# 5.1[100] (🀰..🂓) DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06 +1F094..1F09F ; Extended_Pictographic# NA [12] (🂔..🂟) .. +1F0A0..1F0AE ; Extended_Pictographic# 6.0 [15] (🂠..🂮) PLAYING CARD BACK..PLAYING CARD KING OF SPADES +1F0AF..1F0B0 ; Extended_Pictographic# NA [2] (🂯..🂰) .. +1F0B1..1F0BE ; Extended_Pictographic# 6.0 [14] (🂱..🂾) PLAYING CARD ACE OF HEARTS..PLAYING CARD KING OF HEARTS +1F0BF ; Extended_Pictographic# 7.0 [1] (🂿) PLAYING CARD RED JOKER +1F0C0 ; Extended_Pictographic# NA [1] (🃀) +1F0C1..1F0CF ; Extended_Pictographic# 6.0 [15] (🃁..🃏) PLAYING CARD ACE OF DIAMONDS..joker +1F0D0 ; Extended_Pictographic# NA [1] (🃐) +1F0D1..1F0DF ; Extended_Pictographic# 6.0 [15] (🃑..🃟) PLAYING CARD ACE OF CLUBS..PLAYING CARD WHITE JOKER +1F0E0..1F0F5 ; Extended_Pictographic# 7.0 [22] (🃠..🃵) PLAYING CARD FOOL..PLAYING CARD TRUMP-21 +1F0F6..1F0FF ; Extended_Pictographic# NA [10] (🃶..🃿) .. +1F10D..1F10F ; Extended_Pictographic# NA [3] (🄍..🄏) .. +1F12F ; Extended_Pictographic# 11.0 [1] (🄯) COPYLEFT SYMBOL +1F16C ; Extended_Pictographic# 12.0 [1] (🅬) RAISED MR SIGN +1F16D..1F16F ; Extended_Pictographic# NA [3] (🅭..🅯) .. +1F170..1F171 ; Extended_Pictographic# 6.0 [2] (🅰️..🅱️) A button (blood type)..B button (blood type) +1F17E ; Extended_Pictographic# 6.0 [1] (🅾️) O button (blood type) +1F17F ; Extended_Pictographic# 5.2 [1] (🅿️) P button +1F18E ; Extended_Pictographic# 6.0 [1] (🆎) AB button (blood type) +1F191..1F19A ; Extended_Pictographic# 6.0 [10] (🆑..🆚) CL button..VS button +1F1AD..1F1E5 ; Extended_Pictographic# NA [57] (🆭..🇥) .. +1F201..1F202 ; Extended_Pictographic# 6.0 [2] (🈁..🈂️) Japanese “here” button..Japanese “service charge” button +1F203..1F20F ; Extended_Pictographic# NA [13] (🈃..🈏) .. +1F21A ; Extended_Pictographic# 5.2 [1] (🈚) Japanese “free of charge” button +1F22F ; Extended_Pictographic# 5.2 [1] (🈯) Japanese “reserved” button +1F232..1F23A ; Extended_Pictographic# 6.0 [9] (🈲..🈺) Japanese “prohibited” button..Japanese “open for business” button +1F23C..1F23F ; Extended_Pictographic# NA [4] (🈼..🈿) .. +1F249..1F24F ; Extended_Pictographic# NA [7] (🉉..🉏) .. +1F250..1F251 ; Extended_Pictographic# 6.0 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button +1F252..1F25F ; Extended_Pictographic# NA [14] (🉒..🉟) .. +1F260..1F265 ; Extended_Pictographic# 10.0 [6] (🉠..🉥) ROUNDED SYMBOL FOR FU..ROUNDED SYMBOL FOR CAI +1F266..1F2FF ; Extended_Pictographic# NA[154] (🉦..🋿) .. +1F300..1F320 ; Extended_Pictographic# 6.0 [33] (🌀..🌠) cyclone..shooting star +1F321..1F32C ; Extended_Pictographic# 7.0 [12] (🌡️..🌬️) thermometer..wind face +1F32D..1F32F ; Extended_Pictographic# 8.0 [3] (🌭..🌯) hot dog..burrito +1F330..1F335 ; Extended_Pictographic# 6.0 [6] (🌰..🌵) chestnut..cactus +1F336 ; Extended_Pictographic# 7.0 [1] (🌶️) hot pepper +1F337..1F37C ; Extended_Pictographic# 6.0 [70] (🌷..🍼) tulip..baby bottle +1F37D ; Extended_Pictographic# 7.0 [1] (🍽️) fork and knife with plate +1F37E..1F37F ; Extended_Pictographic# 8.0 [2] (🍾..🍿) bottle with popping cork..popcorn +1F380..1F393 ; Extended_Pictographic# 6.0 [20] (🎀..🎓) ribbon..graduation cap +1F394..1F39F ; Extended_Pictographic# 7.0 [12] (🎔..🎟️) HEART WITH TIP ON THE LEFT..admission tickets +1F3A0..1F3C4 ; Extended_Pictographic# 6.0 [37] (🎠..🏄) carousel horse..person surfing +1F3C5 ; Extended_Pictographic# 7.0 [1] (🏅) sports medal +1F3C6..1F3CA ; Extended_Pictographic# 6.0 [5] (🏆..🏊) trophy..person swimming +1F3CB..1F3CE ; Extended_Pictographic# 7.0 [4] (🏋️..🏎️) person lifting weights..racing car +1F3CF..1F3D3 ; Extended_Pictographic# 8.0 [5] (🏏..🏓) cricket game..ping pong +1F3D4..1F3DF ; Extended_Pictographic# 7.0 [12] (🏔️..🏟️) snow-capped mountain..stadium +1F3E0..1F3F0 ; Extended_Pictographic# 6.0 [17] (🏠..🏰) house..castle +1F3F1..1F3F7 ; Extended_Pictographic# 7.0 [7] (🏱..🏷️) WHITE PENNANT..label +1F3F8..1F3FA ; Extended_Pictographic# 8.0 [3] (🏸..🏺) badminton..amphora +1F400..1F43E ; Extended_Pictographic# 6.0 [63] (🐀..🐾) rat..paw prints +1F43F ; Extended_Pictographic# 7.0 [1] (🐿️) chipmunk +1F440 ; Extended_Pictographic# 6.0 [1] (👀) eyes +1F441 ; Extended_Pictographic# 7.0 [1] (👁️) eye +1F442..1F4F7 ; Extended_Pictographic# 6.0[182] (👂..📷) ear..camera +1F4F8 ; Extended_Pictographic# 7.0 [1] (📸) camera with flash +1F4F9..1F4FC ; Extended_Pictographic# 6.0 [4] (📹..📼) video camera..videocassette +1F4FD..1F4FE ; Extended_Pictographic# 7.0 [2] (📽️..📾) film projector..PORTABLE STEREO +1F4FF ; Extended_Pictographic# 8.0 [1] (📿) prayer beads +1F500..1F53D ; Extended_Pictographic# 6.0 [62] (🔀..🔽) shuffle tracks button..downwards button +1F546..1F54A ; Extended_Pictographic# 7.0 [5] (🕆..🕊️) WHITE LATIN CROSS..dove +1F54B..1F54F ; Extended_Pictographic# 8.0 [5] (🕋..🕏) kaaba..BOWL OF HYGIEIA +1F550..1F567 ; Extended_Pictographic# 6.0 [24] (🕐..🕧) one o’clock..twelve-thirty +1F568..1F579 ; Extended_Pictographic# 7.0 [18] (🕨..🕹️) RIGHT SPEAKER..joystick +1F57A ; Extended_Pictographic# 9.0 [1] (🕺) man dancing +1F57B..1F5A3 ; Extended_Pictographic# 7.0 [41] (🕻..🖣) LEFT HAND TELEPHONE RECEIVER..BLACK DOWN POINTING BACKHAND INDEX +1F5A4 ; Extended_Pictographic# 9.0 [1] (🖤) black heart +1F5A5..1F5FA ; Extended_Pictographic# 7.0 [86] (🖥️..🗺️) desktop computer..world map +1F5FB..1F5FF ; Extended_Pictographic# 6.0 [5] (🗻..🗿) mount fuji..moai +1F600 ; Extended_Pictographic# 6.1 [1] (😀) grinning face +1F601..1F610 ; Extended_Pictographic# 6.0 [16] (😁..😐) beaming face with smiling eyes..neutral face +1F611 ; Extended_Pictographic# 6.1 [1] (😑) expressionless face +1F612..1F614 ; Extended_Pictographic# 6.0 [3] (😒..😔) unamused face..pensive face +1F615 ; Extended_Pictographic# 6.1 [1] (😕) confused face +1F616 ; Extended_Pictographic# 6.0 [1] (😖) confounded face +1F617 ; Extended_Pictographic# 6.1 [1] (😗) kissing face +1F618 ; Extended_Pictographic# 6.0 [1] (😘) face blowing a kiss +1F619 ; Extended_Pictographic# 6.1 [1] (😙) kissing face with smiling eyes +1F61A ; Extended_Pictographic# 6.0 [1] (😚) kissing face with closed eyes +1F61B ; Extended_Pictographic# 6.1 [1] (😛) face with tongue +1F61C..1F61E ; Extended_Pictographic# 6.0 [3] (😜..😞) winking face with tongue..disappointed face +1F61F ; Extended_Pictographic# 6.1 [1] (😟) worried face +1F620..1F625 ; Extended_Pictographic# 6.0 [6] (😠..😥) angry face..sad but relieved face +1F626..1F627 ; Extended_Pictographic# 6.1 [2] (😦..😧) frowning face with open mouth..anguished face +1F628..1F62B ; Extended_Pictographic# 6.0 [4] (😨..😫) fearful face..tired face +1F62C ; Extended_Pictographic# 6.1 [1] (😬) grimacing face +1F62D ; Extended_Pictographic# 6.0 [1] (😭) loudly crying face +1F62E..1F62F ; Extended_Pictographic# 6.1 [2] (😮..😯) face with open mouth..hushed face +1F630..1F633 ; Extended_Pictographic# 6.0 [4] (😰..😳) anxious face with sweat..flushed face +1F634 ; Extended_Pictographic# 6.1 [1] (😴) sleeping face +1F635..1F640 ; Extended_Pictographic# 6.0 [12] (😵..🙀) dizzy face..weary cat +1F641..1F642 ; Extended_Pictographic# 7.0 [2] (🙁..🙂) slightly frowning face..slightly smiling face +1F643..1F644 ; Extended_Pictographic# 8.0 [2] (🙃..🙄) upside-down face..face with rolling eyes +1F645..1F64F ; Extended_Pictographic# 6.0 [11] (🙅..🙏) person gesturing NO..folded hands +1F680..1F6C5 ; Extended_Pictographic# 6.0 [70] (🚀..🛅) rocket..left luggage +1F6C6..1F6CF ; Extended_Pictographic# 7.0 [10] (🛆..🛏️) TRIANGLE WITH ROUNDED CORNERS..bed +1F6D0 ; Extended_Pictographic# 8.0 [1] (🛐) place of worship +1F6D1..1F6D2 ; Extended_Pictographic# 9.0 [2] (🛑..🛒) stop sign..shopping cart +1F6D3..1F6D4 ; Extended_Pictographic# 10.0 [2] (🛓..🛔) STUPA..PAGODA +1F6D5 ; Extended_Pictographic# 12.0 [1] (🛕) hindu temple +1F6D6..1F6DF ; Extended_Pictographic# NA [10] (🛖..🛟) .. +1F6E0..1F6EC ; Extended_Pictographic# 7.0 [13] (🛠️..🛬) hammer and wrench..airplane arrival +1F6ED..1F6EF ; Extended_Pictographic# NA [3] (🛭..🛯) .. +1F6F0..1F6F3 ; Extended_Pictographic# 7.0 [4] (🛰️..🛳️) satellite..passenger ship +1F6F4..1F6F6 ; Extended_Pictographic# 9.0 [3] (🛴..🛶) kick scooter..canoe +1F6F7..1F6F8 ; Extended_Pictographic# 10.0 [2] (🛷..🛸) sled..flying saucer +1F6F9 ; Extended_Pictographic# 11.0 [1] (🛹) skateboard +1F6FA ; Extended_Pictographic# 12.0 [1] (🛺) auto rickshaw +1F6FB..1F6FF ; Extended_Pictographic# NA [5] (🛻..🛿) .. +1F774..1F77F ; Extended_Pictographic# NA [12] (🝴..🝿) .. +1F7D5..1F7D8 ; Extended_Pictographic# 11.0 [4] (🟕..🟘) CIRCLED TRIANGLE..NEGATIVE CIRCLED SQUARE +1F7D9..1F7DF ; Extended_Pictographic# NA [7] (🟙..🟟) .. +1F7E0..1F7EB ; Extended_Pictographic# 12.0 [12] (🟠..🟫) orange circle..brown square +1F7EC..1F7FF ; Extended_Pictographic# NA [20] (🟬..🟿) .. +1F80C..1F80F ; Extended_Pictographic# NA [4] (🠌..🠏) .. +1F848..1F84F ; Extended_Pictographic# NA [8] (🡈..🡏) .. +1F85A..1F85F ; Extended_Pictographic# NA [6] (🡚..🡟) .. +1F888..1F88F ; Extended_Pictographic# NA [8] (🢈..🢏) .. +1F8AE..1F8FF ; Extended_Pictographic# NA [82] (🢮..🣿) .. +1F90C ; Extended_Pictographic# NA [1] (🤌) +1F90D..1F90F ; Extended_Pictographic# 12.0 [3] (🤍..🤏) white heart..pinching hand +1F910..1F918 ; Extended_Pictographic# 8.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns +1F919..1F91E ; Extended_Pictographic# 9.0 [6] (🤙..🤞) call me hand..crossed fingers +1F91F ; Extended_Pictographic# 10.0 [1] (🤟) love-you gesture +1F920..1F927 ; Extended_Pictographic# 9.0 [8] (🤠..🤧) cowboy hat face..sneezing face +1F928..1F92F ; Extended_Pictographic# 10.0 [8] (🤨..🤯) face with raised eyebrow..exploding head +1F930 ; Extended_Pictographic# 9.0 [1] (🤰) pregnant woman +1F931..1F932 ; Extended_Pictographic# 10.0 [2] (🤱..🤲) breast-feeding..palms up together +1F933..1F93A ; Extended_Pictographic# 9.0 [8] (🤳..🤺) selfie..person fencing +1F93C..1F93E ; Extended_Pictographic# 9.0 [3] (🤼..🤾) people wrestling..person playing handball +1F93F ; Extended_Pictographic# 12.0 [1] (🤿) diving mask +1F940..1F945 ; Extended_Pictographic# 9.0 [6] (🥀..🥅) wilted flower..goal net +1F947..1F94B ; Extended_Pictographic# 9.0 [5] (🥇..🥋) 1st place medal..martial arts uniform +1F94C ; Extended_Pictographic# 10.0 [1] (🥌) curling stone +1F94D..1F94F ; Extended_Pictographic# 11.0 [3] (🥍..🥏) lacrosse..flying disc +1F950..1F95E ; Extended_Pictographic# 9.0 [15] (🥐..🥞) croissant..pancakes +1F95F..1F96B ; Extended_Pictographic# 10.0 [13] (🥟..🥫) dumpling..canned food +1F96C..1F970 ; Extended_Pictographic# 11.0 [5] (🥬..🥰) leafy green..smiling face with hearts +1F971 ; Extended_Pictographic# 12.0 [1] (🥱) yawning face +1F972 ; Extended_Pictographic# NA [1] (🥲) +1F973..1F976 ; Extended_Pictographic# 11.0 [4] (🥳..🥶) partying face..cold face +1F977..1F979 ; Extended_Pictographic# NA [3] (🥷..🥹) .. +1F97A ; Extended_Pictographic# 11.0 [1] (🥺) pleading face +1F97B ; Extended_Pictographic# 12.0 [1] (🥻) sari +1F97C..1F97F ; Extended_Pictographic# 11.0 [4] (🥼..🥿) lab coat..flat shoe +1F980..1F984 ; Extended_Pictographic# 8.0 [5] (🦀..🦄) crab..unicorn +1F985..1F991 ; Extended_Pictographic# 9.0 [13] (🦅..🦑) eagle..squid +1F992..1F997 ; Extended_Pictographic# 10.0 [6] (🦒..🦗) giraffe..cricket +1F998..1F9A2 ; Extended_Pictographic# 11.0 [11] (🦘..🦢) kangaroo..swan +1F9A3..1F9A4 ; Extended_Pictographic# NA [2] (🦣..🦤) .. +1F9A5..1F9AA ; Extended_Pictographic# 12.0 [6] (🦥..🦪) sloth..oyster +1F9AB..1F9AD ; Extended_Pictographic# NA [3] (🦫..🦭) .. +1F9AE..1F9AF ; Extended_Pictographic# 12.0 [2] (🦮..🦯) guide dog..probing cane +1F9B0..1F9B9 ; Extended_Pictographic# 11.0 [10] (🦰..🦹) red hair..supervillain +1F9BA..1F9BF ; Extended_Pictographic# 12.0 [6] (🦺..🦿) safety vest..mechanical leg +1F9C0 ; Extended_Pictographic# 8.0 [1] (🧀) cheese wedge +1F9C1..1F9C2 ; Extended_Pictographic# 11.0 [2] (🧁..🧂) cupcake..salt +1F9C3..1F9CA ; Extended_Pictographic# 12.0 [8] (🧃..🧊) beverage box..ice cube +1F9CB..1F9CC ; Extended_Pictographic# NA [2] (🧋..🧌) .. +1F9CD..1F9CF ; Extended_Pictographic# 12.0 [3] (🧍..🧏) person standing..deaf person +1F9D0..1F9E6 ; Extended_Pictographic# 10.0 [23] (🧐..🧦) face with monocle..socks +1F9E7..1F9FF ; Extended_Pictographic# 11.0 [25] (🧧..🧿) red envelope..nazar amulet +1FA00..1FA53 ; Extended_Pictographic# 12.0 [84] (🨀..🩓) NEUTRAL CHESS KING..BLACK CHESS KNIGHT-BISHOP +1FA54..1FA5F ; Extended_Pictographic# NA [12] (🩔..🩟) .. +1FA60..1FA6D ; Extended_Pictographic# 11.0 [14] (🩠..🩭) XIANGQI RED GENERAL..XIANGQI BLACK SOLDIER +1FA6E..1FA6F ; Extended_Pictographic# NA [2] (🩮..🩯) .. +1FA70..1FA73 ; Extended_Pictographic# 12.0 [4] (🩰..🩳) ballet shoes..shorts +1FA74..1FA77 ; Extended_Pictographic# NA [4] (🩴..🩷) .. +1FA78..1FA7A ; Extended_Pictographic# 12.0 [3] (🩸..🩺) drop of blood..stethoscope +1FA7B..1FA7F ; Extended_Pictographic# NA [5] (🩻..🩿) .. +1FA80..1FA82 ; Extended_Pictographic# 12.0 [3] (🪀..🪂) yo-yo..parachute +1FA83..1FA8F ; Extended_Pictographic# NA [13] (🪃..🪏) .. +1FA90..1FA95 ; Extended_Pictographic# 12.0 [6] (🪐..🪕) ringed planet..banjo +1FA96..1FFFD ; Extended_Pictographic# NA[1384] (🪖..🿽) .. + +# Total elements: 3793 + +#EOF diff --git a/lib/pleroma/emoji.ex b/lib/pleroma/emoji.ex index bafad2ae9..abfd49aaa 100644 --- a/lib/pleroma/emoji.ex +++ b/lib/pleroma/emoji.ex @@ -98,4 +98,35 @@ defmodule Pleroma.Emoji do defp update_emojis(emojis) do :ets.insert(@ets, emojis) end + + @external_resource "lib/pleroma/emoji-data.txt" + + emojis = + @external_resource + |> File.read!() + |> String.split("\n") + |> Enum.filter(fn line -> line != "" and not String.starts_with?(line, "#") end) + |> Enum.map(fn line -> + line + |> String.split(";", parts: 2) + |> hd() + |> String.trim() + |> String.split("..") + |> case do + [number] -> + <> + + [first, last] -> + String.to_integer(first, 16)..String.to_integer(last, 16) + |> Enum.map(&<<&1::utf8>>) + end + end) + |> List.flatten() + |> Enum.uniq() + + for emoji <- emojis do + def is_unicode_emoji?(unquote(emoji)), do: true + end + + def is_unicode_emoji?(_), do: false end diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex index 937bafed5..997e965f0 100644 --- a/lib/pleroma/html.ex +++ b/lib/pleroma/html.ex @@ -3,8 +3,6 @@ # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.HTML do - alias HtmlSanitizeEx.Scrubber - defp get_scrubbers(scrubber) when is_atom(scrubber), do: [scrubber] defp get_scrubbers(scrubbers) when is_list(scrubbers), do: scrubbers defp get_scrubbers(_), do: [Pleroma.HTML.Scrubber.Default] @@ -24,9 +22,13 @@ defmodule Pleroma.HTML do end) end - def filter_tags(html, scrubber), do: Scrubber.scrub(html, scrubber) + def filter_tags(html, scrubber) do + {:ok, content} = FastSanitize.Sanitizer.scrub(html, scrubber) + content + end + def filter_tags(html), do: filter_tags(html, nil) - def strip_tags(html), do: Scrubber.scrub(html, Scrubber.StripTags) + def strip_tags(html), do: filter_tags(html, FastSanitize.Sanitizer.StripTags) def get_cached_scrubbed_html_for_activity( content, @@ -46,7 +48,7 @@ defmodule Pleroma.HTML do def get_cached_stripped_html_for_activity(content, activity, key) do get_cached_scrubbed_html_for_activity( content, - HtmlSanitizeEx.Scrubber.StripTags, + FastSanitize.Sanitizer.StripTags, activity, key, &HtmlEntities.decode/1 @@ -106,16 +108,15 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do @valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], []) - require HtmlSanitizeEx.Scrubber.Meta - alias HtmlSanitizeEx.Scrubber.Meta + require FastSanitize.Sanitizer.Meta + alias FastSanitize.Sanitizer.Meta - Meta.remove_cdata_sections_before_scrub() Meta.strip_comments() # links - Meta.allow_tag_with_uri_attributes("a", ["href", "data-user", "data-tag"], @valid_schemes) + Meta.allow_tag_with_uri_attributes(:a, ["href", "data-user", "data-tag"], @valid_schemes) - Meta.allow_tag_with_this_attribute_values("a", "class", [ + Meta.allow_tag_with_this_attribute_values(:a, "class", [ "hashtag", "u-url", "mention", @@ -123,29 +124,29 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do "mention u-url" ]) - Meta.allow_tag_with_this_attribute_values("a", "rel", [ + Meta.allow_tag_with_this_attribute_values(:a, "rel", [ "tag", "nofollow", "noopener", "noreferrer" ]) - Meta.allow_tag_with_these_attributes("a", ["name", "title"]) + Meta.allow_tag_with_these_attributes(:a, ["name", "title"]) # paragraphs and linebreaks - Meta.allow_tag_with_these_attributes("br", []) - Meta.allow_tag_with_these_attributes("p", []) + Meta.allow_tag_with_these_attributes(:br, []) + Meta.allow_tag_with_these_attributes(:p, []) # microformats - Meta.allow_tag_with_this_attribute_values("span", "class", ["h-card"]) - Meta.allow_tag_with_these_attributes("span", []) + Meta.allow_tag_with_this_attribute_values(:span, "class", ["h-card"]) + Meta.allow_tag_with_these_attributes(:span, []) # allow inline images for custom emoji if Pleroma.Config.get([:markup, :allow_inline_images]) do # restrict img tags to http/https only, because of MediaProxy. - Meta.allow_tag_with_uri_attributes("img", ["src"], ["http", "https"]) + Meta.allow_tag_with_uri_attributes(:img, ["src"], ["http", "https"]) - Meta.allow_tag_with_these_attributes("img", [ + Meta.allow_tag_with_these_attributes(:img, [ "width", "height", "class", @@ -160,19 +161,18 @@ end defmodule Pleroma.HTML.Scrubber.Default do @doc "The default HTML scrubbing policy: no " - require HtmlSanitizeEx.Scrubber.Meta - alias HtmlSanitizeEx.Scrubber.Meta + require FastSanitize.Sanitizer.Meta + alias FastSanitize.Sanitizer.Meta # credo:disable-for-previous-line # No idea how to fix this one… @valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], []) - Meta.remove_cdata_sections_before_scrub() Meta.strip_comments() - Meta.allow_tag_with_uri_attributes("a", ["href", "data-user", "data-tag"], @valid_schemes) + Meta.allow_tag_with_uri_attributes(:a, ["href", "data-user", "data-tag"], @valid_schemes) - Meta.allow_tag_with_this_attribute_values("a", "class", [ + Meta.allow_tag_with_this_attribute_values(:a, "class", [ "hashtag", "u-url", "mention", @@ -180,7 +180,7 @@ defmodule Pleroma.HTML.Scrubber.Default do "mention u-url" ]) - Meta.allow_tag_with_this_attribute_values("a", "rel", [ + Meta.allow_tag_with_this_attribute_values(:a, "rel", [ "tag", "nofollow", "noopener", @@ -188,37 +188,37 @@ defmodule Pleroma.HTML.Scrubber.Default do "ugc" ]) - Meta.allow_tag_with_these_attributes("a", ["name", "title"]) + Meta.allow_tag_with_these_attributes(:a, ["name", "title"]) - Meta.allow_tag_with_these_attributes("abbr", ["title"]) + Meta.allow_tag_with_these_attributes(:abbr, ["title"]) - Meta.allow_tag_with_these_attributes("b", []) - Meta.allow_tag_with_these_attributes("blockquote", []) - Meta.allow_tag_with_these_attributes("br", []) - Meta.allow_tag_with_these_attributes("code", []) - Meta.allow_tag_with_these_attributes("del", []) - Meta.allow_tag_with_these_attributes("em", []) - Meta.allow_tag_with_these_attributes("i", []) - Meta.allow_tag_with_these_attributes("li", []) - Meta.allow_tag_with_these_attributes("ol", []) - Meta.allow_tag_with_these_attributes("p", []) - Meta.allow_tag_with_these_attributes("pre", []) - Meta.allow_tag_with_these_attributes("strong", []) - Meta.allow_tag_with_these_attributes("sub", []) - Meta.allow_tag_with_these_attributes("sup", []) - Meta.allow_tag_with_these_attributes("u", []) - Meta.allow_tag_with_these_attributes("ul", []) + Meta.allow_tag_with_these_attributes(:b, []) + Meta.allow_tag_with_these_attributes(:blockquote, []) + Meta.allow_tag_with_these_attributes(:br, []) + Meta.allow_tag_with_these_attributes(:code, []) + Meta.allow_tag_with_these_attributes(:del, []) + Meta.allow_tag_with_these_attributes(:em, []) + Meta.allow_tag_with_these_attributes(:i, []) + Meta.allow_tag_with_these_attributes(:li, []) + Meta.allow_tag_with_these_attributes(:ol, []) + Meta.allow_tag_with_these_attributes(:p, []) + Meta.allow_tag_with_these_attributes(:pre, []) + Meta.allow_tag_with_these_attributes(:strong, []) + Meta.allow_tag_with_these_attributes(:sub, []) + Meta.allow_tag_with_these_attributes(:sup, []) + Meta.allow_tag_with_these_attributes(:u, []) + Meta.allow_tag_with_these_attributes(:ul, []) - Meta.allow_tag_with_this_attribute_values("span", "class", ["h-card"]) - Meta.allow_tag_with_these_attributes("span", []) + Meta.allow_tag_with_this_attribute_values(:span, "class", ["h-card"]) + Meta.allow_tag_with_these_attributes(:span, []) @allow_inline_images Pleroma.Config.get([:markup, :allow_inline_images]) if @allow_inline_images do # restrict img tags to http/https only, because of MediaProxy. - Meta.allow_tag_with_uri_attributes("img", ["src"], ["http", "https"]) + Meta.allow_tag_with_uri_attributes(:img, ["src"], ["http", "https"]) - Meta.allow_tag_with_these_attributes("img", [ + Meta.allow_tag_with_these_attributes(:img, [ "width", "height", "class", @@ -228,24 +228,24 @@ defmodule Pleroma.HTML.Scrubber.Default do end if Pleroma.Config.get([:markup, :allow_tables]) do - Meta.allow_tag_with_these_attributes("table", []) - Meta.allow_tag_with_these_attributes("tbody", []) - Meta.allow_tag_with_these_attributes("td", []) - Meta.allow_tag_with_these_attributes("th", []) - Meta.allow_tag_with_these_attributes("thead", []) - Meta.allow_tag_with_these_attributes("tr", []) + Meta.allow_tag_with_these_attributes(:table, []) + Meta.allow_tag_with_these_attributes(:tbody, []) + Meta.allow_tag_with_these_attributes(:td, []) + Meta.allow_tag_with_these_attributes(:th, []) + Meta.allow_tag_with_these_attributes(:thead, []) + Meta.allow_tag_with_these_attributes(:tr, []) end if Pleroma.Config.get([:markup, :allow_headings]) do - Meta.allow_tag_with_these_attributes("h1", []) - Meta.allow_tag_with_these_attributes("h2", []) - Meta.allow_tag_with_these_attributes("h3", []) - Meta.allow_tag_with_these_attributes("h4", []) - Meta.allow_tag_with_these_attributes("h5", []) + Meta.allow_tag_with_these_attributes(:h1, []) + Meta.allow_tag_with_these_attributes(:h2, []) + Meta.allow_tag_with_these_attributes(:h3, []) + Meta.allow_tag_with_these_attributes(:h4, []) + Meta.allow_tag_with_these_attributes(:h5, []) end if Pleroma.Config.get([:markup, :allow_fonts]) do - Meta.allow_tag_with_these_attributes("font", ["face"]) + Meta.allow_tag_with_these_attributes(:font, ["face"]) end Meta.strip_everything_not_covered() @@ -258,7 +258,7 @@ defmodule Pleroma.HTML.Transform.MediaProxy do def before_scrub(html), do: html - def scrub_attribute("img", {"src", "http" <> target}) do + def scrub_attribute(:img, {"src", "http" <> target}) do media_url = ("http" <> target) |> MediaProxy.url() @@ -268,16 +268,16 @@ defmodule Pleroma.HTML.Transform.MediaProxy do def scrub_attribute(_tag, attribute), do: attribute - def scrub({"img", attributes, children}) do + def scrub({:img, attributes, children}) do attributes = attributes - |> Enum.map(fn attr -> scrub_attribute("img", attr) end) + |> Enum.map(fn attr -> scrub_attribute(:img, attr) end) |> Enum.reject(&is_nil(&1)) - {"img", attributes, children} + {:img, attributes, children} end - def scrub({:comment, _children}), do: "" + def scrub({:comment, _text, _children}), do: "" def scrub({tag, attributes, children}), do: {tag, attributes, children} def scrub({_tag, children}), do: children @@ -291,16 +291,15 @@ defmodule Pleroma.HTML.Scrubber.LinksOnly do @valid_schemes Pleroma.Config.get([:uri_schemes, :valid_schemes], []) - require HtmlSanitizeEx.Scrubber.Meta - alias HtmlSanitizeEx.Scrubber.Meta + require FastSanitize.Sanitizer.Meta + alias FastSanitize.Sanitizer.Meta - Meta.remove_cdata_sections_before_scrub() Meta.strip_comments() # links - Meta.allow_tag_with_uri_attributes("a", ["href"], @valid_schemes) + Meta.allow_tag_with_uri_attributes(:a, ["href"], @valid_schemes) - Meta.allow_tag_with_this_attribute_values("a", "rel", [ + Meta.allow_tag_with_this_attribute_values(:a, "rel", [ "tag", "nofollow", "noopener", @@ -309,6 +308,6 @@ defmodule Pleroma.HTML.Scrubber.LinksOnly do "ugc" ]) - Meta.allow_tag_with_these_attributes("a", ["name", "title"]) + Meta.allow_tag_with_these_attributes(:a, ["name", "title"]) Meta.strip_everything_not_covered() end diff --git a/lib/pleroma/moderation_log.ex b/lib/pleroma/moderation_log.ex index e8884e6e8..ffa5dc25d 100644 --- a/lib/pleroma/moderation_log.ex +++ b/lib/pleroma/moderation_log.ex @@ -369,6 +369,24 @@ defmodule Pleroma.ModerationLog do "@#{actor_nickname} created users: #{users_to_nicknames_string(subjects)}" end + @spec get_log_entry_message(ModerationLog) :: String.t() + def get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "activate", + "subject" => user + } + }) + when is_map(user) do + get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "activate", + "subject" => [user] + } + }) + end + @spec get_log_entry_message(ModerationLog) :: String.t() def get_log_entry_message(%ModerationLog{ data: %{ @@ -380,6 +398,24 @@ defmodule Pleroma.ModerationLog do "@#{actor_nickname} activated users: #{users_to_nicknames_string(users)}" end + @spec get_log_entry_message(ModerationLog) :: String.t() + def get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "deactivate", + "subject" => user + } + }) + when is_map(user) do + get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "deactivate", + "subject" => [user] + } + }) + end + @spec get_log_entry_message(ModerationLog) :: String.t() def get_log_entry_message(%ModerationLog{ data: %{ @@ -419,6 +455,26 @@ defmodule Pleroma.ModerationLog do "@#{actor_nickname} removed tags: #{tags_string} from users: #{nicknames_to_string(nicknames)}" end + @spec get_log_entry_message(ModerationLog) :: String.t() + def get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "grant", + "subject" => user, + "permission" => permission + } + }) + when is_map(user) do + get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "grant", + "subject" => [user], + "permission" => permission + } + }) + end + @spec get_log_entry_message(ModerationLog) :: String.t() def get_log_entry_message(%ModerationLog{ data: %{ @@ -431,6 +487,26 @@ defmodule Pleroma.ModerationLog do "@#{actor_nickname} made #{users_to_nicknames_string(users)} #{permission}" end + @spec get_log_entry_message(ModerationLog) :: String.t() + def get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "revoke", + "subject" => user, + "permission" => permission + } + }) + when is_map(user) do + get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "revoke", + "subject" => [user], + "permission" => permission + } + }) + end + @spec get_log_entry_message(ModerationLog) :: String.t() def get_log_entry_message(%ModerationLog{ data: %{ @@ -540,6 +616,17 @@ defmodule Pleroma.ModerationLog do "@#{actor_nickname} deleted status ##{subject_id}" end + @spec get_log_entry_message(ModerationLog) :: String.t() + def get_log_entry_message(%ModerationLog{ + data: %{ + "actor" => %{"nickname" => actor_nickname}, + "action" => "force_password_reset", + "subject" => subjects + } + }) do + "@#{actor_nickname} force password reset for users: #{users_to_nicknames_string(subjects)}" + end + defp nicknames_to_string(nicknames) do nicknames |> Enum.map(&"@#{&1}") diff --git a/lib/pleroma/object/containment.ex b/lib/pleroma/object/containment.ex index 68535c09e..25aa32f60 100644 --- a/lib/pleroma/object/containment.ex +++ b/lib/pleroma/object/containment.ex @@ -64,15 +64,17 @@ defmodule Pleroma.Object.Containment do def contain_origin(id, %{"attributedTo" => actor} = params), do: contain_origin(id, Map.put(params, "actor", actor)) - def contain_origin_from_id(_id, %{"id" => nil}), do: :error + def contain_origin(_id, _data), do: :error - def contain_origin_from_id(id, %{"id" => other_id} = _params) do + def contain_origin_from_id(id, %{"id" => other_id} = _params) when is_binary(other_id) do id_uri = URI.parse(id) other_uri = URI.parse(other_id) compare_uris(id_uri, other_uri) end + def contain_origin_from_id(_id, _data), do: :error + def contain_child(%{"object" => %{"id" => id, "attributedTo" => _} = object}), do: contain_origin(id, object) diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index 441ae8b65..9a9a46550 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -38,7 +38,8 @@ defmodule Pleroma.Object.Fetcher do data <- maybe_reinject_internal_fields(data, struct), changeset <- Object.change(struct, %{data: data}), changeset <- touch_changeset(changeset), - {:ok, object} <- Repo.insert_or_update(changeset) do + {:ok, object} <- Repo.insert_or_update(changeset), + {:ok, object} <- Object.set_cache(object) do {:ok, object} else e -> @@ -53,7 +54,7 @@ defmodule Pleroma.Object.Fetcher do {:ok, object} <- reinject_object(object, data) do {:ok, object} else - {:local, true} -> object + {:local, true} -> {:ok, object} e -> {:error, e} end end diff --git a/lib/pleroma/plugs/rate_limiter.ex b/lib/pleroma/plugs/rate_limiter.ex deleted file mode 100644 index 31388f574..000000000 --- a/lib/pleroma/plugs/rate_limiter.ex +++ /dev/null @@ -1,131 +0,0 @@ -# Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors -# SPDX-License-Identifier: AGPL-3.0-only - -defmodule Pleroma.Plugs.RateLimiter do - @moduledoc """ - - ## Configuration - - A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where: - - * The first element: `scale` (Integer). The time scale in milliseconds. - * The second element: `limit` (Integer). How many requests to limit in the time scale provided. - - It is also possible to have different limits for unauthenticated and authenticated users: the keyword value must be a list of two tuples where the first one is a config for unauthenticated users and the second one is for authenticated. - - To disable a limiter set its value to `nil`. - - ### Example - - config :pleroma, :rate_limit, - one: {1000, 10}, - two: [{10_000, 10}, {10_000, 50}], - foobar: nil - - Here we have three limiters: - - * `one` which is not over 10req/1s - * `two` which has two limits: 10req/10s for unauthenticated users and 50req/10s for authenticated users - * `foobar` which is disabled - - ## Usage - - AllowedSyntax: - - plug(Pleroma.Plugs.RateLimiter, :limiter_name) - plug(Pleroma.Plugs.RateLimiter, {:limiter_name, options}) - - Allowed options: - - * `bucket_name` overrides bucket name (e.g. to have a separate limit for a set of actions) - * `params` appends values of specified request params (e.g. ["id"]) to bucket name - - Inside a controller: - - plug(Pleroma.Plugs.RateLimiter, :one when action == :one) - plug(Pleroma.Plugs.RateLimiter, :two when action in [:two, :three]) - - plug( - Pleroma.Plugs.RateLimiter, - {:status_id_action, bucket_name: "status_id_action:fav_unfav", params: ["id"]} - when action in ~w(fav_status unfav_status)a - ) - - or inside a router pipeline: - - pipeline :api do - ... - plug(Pleroma.Plugs.RateLimiter, :one) - ... - end - """ - import Pleroma.Web.TranslationHelpers - import Plug.Conn - - alias Pleroma.User - - def init(limiter_name) when is_atom(limiter_name) do - init({limiter_name, []}) - end - - def init({limiter_name, opts}) do - case Pleroma.Config.get([:rate_limit, limiter_name]) do - nil -> nil - config -> {limiter_name, config, opts} - end - end - - # Do not limit if there is no limiter configuration - def call(conn, nil), do: conn - - def call(conn, settings) do - case check_rate(conn, settings) do - {:ok, _count} -> - conn - - {:error, _count} -> - render_throttled_error(conn) - end - end - - defp bucket_name(conn, limiter_name, opts) do - bucket_name = opts[:bucket_name] || limiter_name - - if params_names = opts[:params] do - params_values = for p <- Enum.sort(params_names), do: conn.params[p] - Enum.join([bucket_name] ++ params_values, ":") - else - bucket_name - end - end - - defp check_rate( - %{assigns: %{user: %User{id: user_id}}} = conn, - {limiter_name, [_, {scale, limit}], opts} - ) do - bucket_name = bucket_name(conn, limiter_name, opts) - ExRated.check_rate("#{bucket_name}:#{user_id}", scale, limit) - end - - defp check_rate(conn, {limiter_name, [{scale, limit} | _], opts}) do - bucket_name = bucket_name(conn, limiter_name, opts) - ExRated.check_rate("#{bucket_name}:#{ip(conn)}", scale, limit) - end - - defp check_rate(conn, {limiter_name, {scale, limit}, opts}) do - check_rate(conn, {limiter_name, [{scale, limit}, {scale, limit}], opts}) - end - - def ip(%{remote_ip: remote_ip}) do - remote_ip - |> Tuple.to_list() - |> Enum.join(".") - end - - defp render_throttled_error(conn) do - conn - |> render_error(:too_many_requests, "Throttled") - |> halt() - end -end diff --git a/lib/pleroma/plugs/rate_limiter/limiter_supervisor.ex b/lib/pleroma/plugs/rate_limiter/limiter_supervisor.ex new file mode 100644 index 000000000..187582ede --- /dev/null +++ b/lib/pleroma/plugs/rate_limiter/limiter_supervisor.ex @@ -0,0 +1,44 @@ +defmodule Pleroma.Plugs.RateLimiter.LimiterSupervisor do + use DynamicSupervisor + + import Cachex.Spec + + def start_link(init_arg) do + DynamicSupervisor.start_link(__MODULE__, init_arg, name: __MODULE__) + end + + def add_limiter(limiter_name, expiration) do + {:ok, _pid} = + DynamicSupervisor.start_child( + __MODULE__, + %{ + id: String.to_atom("rl_#{limiter_name}"), + start: + {Cachex, :start_link, + [ + limiter_name, + [ + expiration: + expiration( + default: expiration, + interval: check_interval(expiration), + lazy: true + ) + ] + ]} + } + ) + end + + @impl true + def init(_init_arg) do + DynamicSupervisor.init(strategy: :one_for_one) + end + + defp check_interval(exp) do + (exp / 2) + |> Kernel.trunc() + |> Kernel.min(5000) + |> Kernel.max(1) + end +end diff --git a/lib/pleroma/plugs/rate_limiter/rate_limiter.ex b/lib/pleroma/plugs/rate_limiter/rate_limiter.ex new file mode 100644 index 000000000..d720508c8 --- /dev/null +++ b/lib/pleroma/plugs/rate_limiter/rate_limiter.ex @@ -0,0 +1,227 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2019 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Plugs.RateLimiter do + @moduledoc """ + + ## Configuration + + A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where: + + * The first element: `scale` (Integer). The time scale in milliseconds. + * The second element: `limit` (Integer). How many requests to limit in the time scale provided. + + It is also possible to have different limits for unauthenticated and authenticated users: the keyword value must be a list of two tuples where the first one is a config for unauthenticated users and the second one is for authenticated. + + To disable a limiter set its value to `nil`. + + ### Example + + config :pleroma, :rate_limit, + one: {1000, 10}, + two: [{10_000, 10}, {10_000, 50}], + foobar: nil + + Here we have three limiters: + + * `one` which is not over 10req/1s + * `two` which has two limits: 10req/10s for unauthenticated users and 50req/10s for authenticated users + * `foobar` which is disabled + + ## Usage + + AllowedSyntax: + + plug(Pleroma.Plugs.RateLimiter, name: :limiter_name) + plug(Pleroma.Plugs.RateLimiter, options) # :name is a required option + + Allowed options: + + * `name` required, always used to fetch the limit values from the config + * `bucket_name` overrides name for counting purposes (e.g. to have a separate limit for a set of actions) + * `params` appends values of specified request params (e.g. ["id"]) to bucket name + + Inside a controller: + + plug(Pleroma.Plugs.RateLimiter, [name: :one] when action == :one) + plug(Pleroma.Plugs.RateLimiter, [name: :two] when action in [:two, :three]) + + plug( + Pleroma.Plugs.RateLimiter, + [name: :status_id_action, bucket_name: "status_id_action:fav_unfav", params: ["id"]] + when action in ~w(fav_status unfav_status)a + ) + + or inside a router pipeline: + + pipeline :api do + ... + plug(Pleroma.Plugs.RateLimiter, name: :one) + ... + end + """ + import Pleroma.Web.TranslationHelpers + import Plug.Conn + + alias Pleroma.Plugs.RateLimiter.LimiterSupervisor + alias Pleroma.User + + def init(opts) do + limiter_name = Keyword.get(opts, :name) + + case Pleroma.Config.get([:rate_limit, limiter_name]) do + nil -> + nil + + config -> + name_root = Keyword.get(opts, :bucket_name, limiter_name) + + %{ + name: name_root, + limits: config, + opts: opts + } + end + end + + # Do not limit if there is no limiter configuration + def call(conn, nil), do: conn + + def call(conn, settings) do + settings + |> incorporate_conn_info(conn) + |> check_rate() + |> case do + {:ok, _count} -> + conn + + {:error, _count} -> + render_throttled_error(conn) + end + end + + def inspect_bucket(conn, name_root, settings) do + settings = + settings + |> incorporate_conn_info(conn) + + bucket_name = make_bucket_name(%{settings | name: name_root}) + key_name = make_key_name(settings) + limit = get_limits(settings) + + case Cachex.get(bucket_name, key_name) do + {:error, :no_cache} -> + {:err, :not_found} + + {:ok, nil} -> + {0, limit} + + {:ok, value} -> + {value, limit - value} + end + end + + defp check_rate(settings) do + bucket_name = make_bucket_name(settings) + key_name = make_key_name(settings) + limit = get_limits(settings) + + case Cachex.get_and_update(bucket_name, key_name, &increment_value(&1, limit)) do + {:commit, value} -> + {:ok, value} + + {:ignore, value} -> + {:error, value} + + {:error, :no_cache} -> + initialize_buckets(settings) + check_rate(settings) + end + end + + defp increment_value(nil, _limit), do: {:commit, 1} + + defp increment_value(val, limit) when val >= limit, do: {:ignore, val} + + defp increment_value(val, _limit), do: {:commit, val + 1} + + defp incorporate_conn_info(settings, %{assigns: %{user: %User{id: user_id}}, params: params}) do + Map.merge(settings, %{ + mode: :user, + conn_params: params, + conn_info: "#{user_id}" + }) + end + + defp incorporate_conn_info(settings, %{params: params} = conn) do + Map.merge(settings, %{ + mode: :anon, + conn_params: params, + conn_info: "#{ip(conn)}" + }) + end + + defp ip(%{remote_ip: remote_ip}) do + remote_ip + |> Tuple.to_list() + |> Enum.join(".") + end + + defp render_throttled_error(conn) do + conn + |> render_error(:too_many_requests, "Throttled") + |> halt() + end + + defp make_key_name(settings) do + "" + |> attach_params(settings) + |> attach_identity(settings) + end + + defp get_scale(_, {scale, _}), do: scale + + defp get_scale(:anon, [{scale, _}, {_, _}]), do: scale + + defp get_scale(:user, [{_, _}, {scale, _}]), do: scale + + defp get_limits(%{limits: {_scale, limit}}), do: limit + + defp get_limits(%{mode: :user, limits: [_, {_, limit}]}), do: limit + + defp get_limits(%{limits: [{_, limit}, _]}), do: limit + + defp make_bucket_name(%{mode: :user, name: name_root}), + do: user_bucket_name(name_root) + + defp make_bucket_name(%{mode: :anon, name: name_root}), + do: anon_bucket_name(name_root) + + defp attach_params(input, %{conn_params: conn_params, opts: opts}) do + param_string = + opts + |> Keyword.get(:params, []) + |> Enum.sort() + |> Enum.map(&Map.get(conn_params, &1, "")) + |> Enum.join(":") + + "#{input}#{param_string}" + end + + defp initialize_buckets(%{name: _name, limits: nil}), do: :ok + + defp initialize_buckets(%{name: name, limits: limits}) do + LimiterSupervisor.add_limiter(anon_bucket_name(name), get_scale(:anon, limits)) + LimiterSupervisor.add_limiter(user_bucket_name(name), get_scale(:user, limits)) + end + + defp attach_identity(base, %{mode: :user, conn_info: conn_info}), + do: "user:#{base}:#{conn_info}" + + defp attach_identity(base, %{mode: :anon, conn_info: conn_info}), + do: "ip:#{base}:#{conn_info}" + + defp user_bucket_name(name_root), do: "user:#{name_root}" |> String.to_atom() + defp anon_bucket_name(name_root), do: "anon:#{name_root}" |> String.to_atom() +end diff --git a/lib/pleroma/plugs/rate_limiter/supervisor.ex b/lib/pleroma/plugs/rate_limiter/supervisor.ex new file mode 100644 index 000000000..9672f7876 --- /dev/null +++ b/lib/pleroma/plugs/rate_limiter/supervisor.ex @@ -0,0 +1,16 @@ +defmodule Pleroma.Plugs.RateLimiter.Supervisor do + use Supervisor + + def start_link(opts) do + Supervisor.start_link(__MODULE__, opts, name: __MODULE__) + end + + def init(_args) do + children = [ + Pleroma.Plugs.RateLimiter.LimiterSupervisor + ] + + opts = [strategy: :one_for_one, name: Pleroma.Web.Streamer.Supervisor] + Supervisor.init(children, opts) + end +end diff --git a/lib/pleroma/plugs/static_fe_plug.ex b/lib/pleroma/plugs/static_fe_plug.ex new file mode 100644 index 000000000..b3fb3c582 --- /dev/null +++ b/lib/pleroma/plugs/static_fe_plug.ex @@ -0,0 +1,26 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2019 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Plugs.StaticFEPlug do + import Plug.Conn + alias Pleroma.Web.StaticFE.StaticFEController + + def init(options), do: options + + def call(conn, _) do + if enabled?() and accepts_html?(conn) do + conn + |> StaticFEController.call(:show) + |> halt() + else + conn + end + end + + defp enabled?, do: Pleroma.Config.get([:static_fe, :enabled], false) + + defp accepts_html?(conn) do + conn |> get_req_header("accept") |> List.first() |> String.contains?("text/html") + end +end diff --git a/lib/pleroma/plugs/trailing_format_plug.ex b/lib/pleroma/plugs/trailing_format_plug.ex index ce366b218..a4b8a406d 100644 --- a/lib/pleroma/plugs/trailing_format_plug.ex +++ b/lib/pleroma/plugs/trailing_format_plug.ex @@ -24,7 +24,8 @@ defmodule Pleroma.Plugs.TrailingFormatPlug do "/api/help", "/api/externalprofile", "/notice", - "/api/pleroma/emoji" + "/api/pleroma/emoji", + "/api/oauth_tokens" ] def init(opts) do diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index d40f6ed08..293c6c846 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1102,7 +1102,12 @@ defmodule Pleroma.User do def deactivate(%User{} = user, status) do with {:ok, user} <- set_activation_status(user, status) do Enum.each(get_followers(user), &invalidate_cache/1) - Enum.each(get_friends(user), &update_follower_count/1) + + # Only update local user counts, remote will be update during the next pull. + user + |> get_friends() + |> Enum.filter(& &1.local) + |> Enum.each(&update_follower_count/1) {:ok, user} end diff --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex index 2eda454bc..364bc1c89 100644 --- a/lib/pleroma/user/query.ex +++ b/lib/pleroma/user/query.ex @@ -175,6 +175,7 @@ defmodule Pleroma.User.Query do [u, following: f, relationships: r], u.ap_id in ^to or (f.follower_address in ^to and r.state == "accept") ) + |> distinct(true) end defp compose_query({:order_by, key}, query) do diff --git a/lib/pleroma/user/search.ex b/lib/pleroma/user/search.ex index bab8d92e2..09664db76 100644 --- a/lib/pleroma/user/search.ex +++ b/lib/pleroma/user/search.ex @@ -54,15 +54,7 @@ defmodule Pleroma.User.Search do |> maybe_restrict_local(for_user) end - @nickname_regex ~r/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~\-@]+$/ defp fts_search(query, query_string) do - {nickname_weight, name_weight} = - if String.match?(query_string, @nickname_regex) do - {"A", "B"} - else - {"B", "A"} - end - query_string = to_tsquery(query_string) from( @@ -70,12 +62,10 @@ defmodule Pleroma.User.Search do where: fragment( """ - (setweight(to_tsvector('simple', ?), ?) || setweight(to_tsvector('simple', ?), ?)) @@ to_tsquery('simple', ?) + (to_tsvector('simple', ?) || to_tsvector('simple', ?)) @@ to_tsquery('simple', ?) """, u.name, - ^name_weight, u.nickname, - ^nickname_weight, ^query_string ) ) diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 67c2cb659..8e1c2594d 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -322,6 +322,32 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do end end + def react_with_emoji(user, object, emoji, options \\ []) do + with local <- Keyword.get(options, :local, true), + activity_id <- Keyword.get(options, :activity_id, nil), + Pleroma.Emoji.is_unicode_emoji?(emoji), + reaction_data <- make_emoji_reaction_data(user, object, emoji, activity_id), + {:ok, activity} <- insert(reaction_data, local), + {:ok, object} <- add_emoji_reaction_to_object(activity, object), + :ok <- maybe_federate(activity) do + {:ok, activity, object} + end + end + + def unreact_with_emoji(user, reaction_id, options \\ []) do + with local <- Keyword.get(options, :local, true), + activity_id <- Keyword.get(options, :activity_id, nil), + user_ap_id <- user.ap_id, + %Activity{actor: ^user_ap_id} = reaction_activity <- Activity.get_by_ap_id(reaction_id), + object <- Object.normalize(reaction_activity), + unreact_data <- make_undo_data(user, reaction_activity, activity_id), + {:ok, activity} <- insert(unreact_data, local), + {:ok, object} <- remove_emoji_reaction_from_object(reaction_activity, object), + :ok <- maybe_federate(activity) do + {:ok, activity, object} + end + end + # TODO: This is weird, maybe we shouldn't check here if we can make the activity. def like( %User{ap_id: ap_id} = user, @@ -503,7 +529,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do with flag_data <- make_flag_data(params, additional), {:ok, activity} <- insert(flag_data, local), - :ok <- maybe_federate(activity) do + {:ok, stripped_activity} <- strip_report_status_data(activity), + :ok <- maybe_federate(stripped_activity) do Enum.each(User.all_superusers(), fn superuser -> superuser |> Pleroma.Emails.AdminEmail.report(actor, account, statuses, content) @@ -591,7 +618,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do |> fetch_activities_query(opts) |> restrict_unlisted() |> Pagination.fetch_paginated(opts, pagination) - |> Enum.reverse() end @valid_visibilities ~w[direct unlisted public private] diff --git a/lib/pleroma/web/activity_pub/relay.ex b/lib/pleroma/web/activity_pub/relay.ex index f90d75a8a..fc2619680 100644 --- a/lib/pleroma/web/activity_pub/relay.ex +++ b/lib/pleroma/web/activity_pub/relay.ex @@ -11,13 +11,17 @@ defmodule Pleroma.Web.ActivityPub.Relay do def get_actor do actor = - "#{Pleroma.Web.Endpoint.url()}/relay" + relay_ap_id() |> User.get_or_create_service_actor_by_ap_id() {:ok, actor} = User.set_invisible(actor, true) actor end + def relay_ap_id do + "#{Pleroma.Web.Endpoint.url()}/relay" + end + @spec follow(String.t()) :: {:ok, Activity.t()} | {:error, any()} def follow(target_instance) do with %User{} = local_user <- get_actor(), diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 78ee6192a..ce95fb6ba 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -507,6 +507,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do }) {:user_locked, true} -> + {:ok, _relationship} = FollowingRelationship.update(follower, followed, "pending") :noop end @@ -565,6 +566,34 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do end end + @misskey_reactions %{ + "like" => "👍", + "love" => "❤️", + "laugh" => "😆", + "hmm" => "🤔", + "surprise" => "😮", + "congrats" => "🎉", + "angry" => "💢", + "confused" => "😥", + "rip" => "😇", + "pudding" => "🍮", + "star" => "⭐" + } + + @doc "Rewrite misskey likes into EmojiReactions" + def handle_incoming( + %{ + "type" => "Like", + "_misskey_reaction" => reaction + } = data, + options + ) do + data + |> Map.put("type", "EmojiReaction") + |> Map.put("content", @misskey_reactions[reaction] || reaction) + |> handle_incoming(options) + end + def handle_incoming( %{"type" => "Like", "object" => object_id, "actor" => _actor, "id" => id} = data, _options @@ -579,6 +608,27 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do end end + def handle_incoming( + %{ + "type" => "EmojiReaction", + "object" => object_id, + "actor" => _actor, + "id" => id, + "content" => emoji + } = data, + _options + ) do + with actor <- Containment.get_actor(data), + {:ok, %User{} = actor} <- User.get_or_fetch_by_ap_id(actor), + {:ok, object} <- get_obj_helper(object_id), + {:ok, activity, _object} <- + ActivityPub.react_with_emoji(actor, object, emoji, activity_id: id, local: false) do + {:ok, activity} + else + _e -> :error + end + end + def handle_incoming( %{"type" => "Announce", "object" => object_id, "actor" => _actor, "id" => id} = data, _options @@ -714,6 +764,28 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do end end + def handle_incoming( + %{ + "type" => "Undo", + "object" => %{"type" => "EmojiReaction", "id" => reaction_activity_id}, + "actor" => _actor, + "id" => id + } = data, + _options + ) do + with actor <- Containment.get_actor(data), + {:ok, %User{} = actor} <- User.get_or_fetch_by_ap_id(actor), + {:ok, activity, _} <- + ActivityPub.unreact_with_emoji(actor, reaction_activity_id, + activity_id: id, + local: false + ) do + {:ok, activity} + else + _e -> :error + end + end + def handle_incoming( %{ "type" => "Undo", @@ -1065,7 +1137,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do Map.put(object, "attachment", attachments) end - defp strip_internal_fields(object) do + def strip_internal_fields(object) do object |> Map.drop(Pleroma.Constants.object_internal_fields()) end diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index 699d5162f..91cfa2194 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -12,6 +12,7 @@ defmodule Pleroma.Web.ActivityPub.Utils do alias Pleroma.User alias Pleroma.Web alias Pleroma.Web.ActivityPub.Visibility + alias Pleroma.Web.AdminAPI.AccountView alias Pleroma.Web.Endpoint alias Pleroma.Web.Router.Helpers @@ -21,6 +22,7 @@ defmodule Pleroma.Web.ActivityPub.Utils do require Pleroma.Constants @supported_object_types ["Article", "Note", "Video", "Page", "Question", "Answer", "Audio"] + @strip_status_report_states ~w(closed resolved) @supported_report_states ~w(open closed resolved) @valid_visibilities ~w(public unlisted private direct) @@ -253,6 +255,16 @@ defmodule Pleroma.Web.ActivityPub.Utils do |> Repo.one() end + @doc """ + Returns like activities targeting an object + """ + def get_object_likes(%{data: %{"id" => id}}) do + id + |> Activity.Queries.by_object_id() + |> Activity.Queries.by_type("Like") + |> Repo.all() + end + @spec make_like_data(User.t(), map(), String.t()) :: map() def make_like_data( %User{ap_id: ap_id} = actor, @@ -284,13 +296,30 @@ defmodule Pleroma.Web.ActivityPub.Utils do |> maybe_put("id", activity_id) end + def make_emoji_reaction_data(user, object, emoji, activity_id) do + make_like_data(user, object, activity_id) + |> Map.put("type", "EmojiReaction") + |> Map.put("content", emoji) + end + @spec update_element_in_object(String.t(), list(any), Object.t()) :: {:ok, Object.t()} | {:error, Ecto.Changeset.t()} def update_element_in_object(property, element, object) do + length = + if is_map(element) do + element + |> Map.values() + |> List.flatten() + |> length() + else + element + |> length() + end + data = Map.merge( object.data, - %{"#{property}_count" => length(element), "#{property}s" => element} + %{"#{property}_count" => length, "#{property}s" => element} ) object @@ -298,6 +327,38 @@ defmodule Pleroma.Web.ActivityPub.Utils do |> Object.update_and_set_cache() end + @spec add_emoji_reaction_to_object(Activity.t(), Object.t()) :: + {:ok, Object.t()} | {:error, Ecto.Changeset.t()} + + def add_emoji_reaction_to_object( + %Activity{data: %{"content" => emoji, "actor" => actor}}, + object + ) do + reactions = object.data["reactions"] || %{} + emoji_actors = reactions[emoji] || [] + new_emoji_actors = [actor | emoji_actors] |> Enum.uniq() + new_reactions = Map.put(reactions, emoji, new_emoji_actors) + update_element_in_object("reaction", new_reactions, object) + end + + def remove_emoji_reaction_from_object( + %Activity{data: %{"content" => emoji, "actor" => actor}}, + object + ) do + reactions = object.data["reactions"] || %{} + emoji_actors = reactions[emoji] || [] + new_emoji_actors = List.delete(emoji_actors, actor) + + new_reactions = + if new_emoji_actors == [] do + Map.delete(reactions, emoji) + else + Map.put(reactions, emoji, new_emoji_actors) + end + + update_element_in_object("reaction", new_reactions, object) + end + @spec add_like_to_object(Activity.t(), Object.t()) :: {:ok, Object.t()} | {:error, Ecto.Changeset.t()} def add_like_to_object(%Activity{data: %{"actor" => actor}}, object) do @@ -395,6 +456,19 @@ defmodule Pleroma.Web.ActivityPub.Utils do |> Repo.one() end + def get_latest_reaction(internal_activity_id, %{ap_id: ap_id}, emoji) do + %{data: %{"object" => object_ap_id}} = Activity.get_by_id(internal_activity_id) + + "EmojiReaction" + |> Activity.Queries.by_type() + |> where(actor: ^ap_id) + |> where([activity], fragment("?->>'content' = ?", activity.data, ^emoji)) + |> Activity.Queries.by_object_id(object_ap_id) + |> order_by([activity], fragment("? desc nulls last", activity.id)) + |> limit(1) + |> Repo.one() + end + #### Announce-related helpers @doc """ @@ -487,6 +561,25 @@ defmodule Pleroma.Web.ActivityPub.Utils do |> maybe_put("id", activity_id) end + def make_undo_data( + %User{ap_id: actor, follower_address: follower_address}, + %Activity{ + data: %{"id" => undone_activity_id, "context" => context}, + actor: undone_activity_actor + }, + activity_id \\ nil + ) do + %{ + "type" => "Undo", + "actor" => actor, + "object" => undone_activity_id, + "to" => [follower_address, undone_activity_actor], + "cc" => [Pleroma.Constants.as_public()], + "context" => context + } + |> maybe_put("id", activity_id) + end + @spec add_announce_to_object(Activity.t(), Object.t()) :: {:ok, Object.t()} | {:error, Ecto.Changeset.t()} def add_announce_to_object( @@ -614,10 +707,24 @@ defmodule Pleroma.Web.ActivityPub.Utils do defp build_flag_object(%{account: account, statuses: statuses} = _) do [account.ap_id] ++ - Enum.map(statuses || [], fn - %Activity{} = act -> act.data["id"] - act when is_map(act) -> act["id"] - act when is_binary(act) -> act + Enum.map(statuses || [], fn act -> + id = + case act do + %Activity{} = act -> act.data["id"] + act when is_map(act) -> act["id"] + act when is_binary(act) -> act + end + + activity = Activity.get_by_ap_id_with_object(id) + actor = User.get_by_ap_id(activity.object.data["actor"]) + + %{ + "type" => "Note", + "id" => activity.data["id"], + "content" => activity.object.data["content"], + "published" => activity.object.data["published"], + "actor" => AccountView.render("show.json", %{user: actor}) + } end) end @@ -664,6 +771,20 @@ defmodule Pleroma.Web.ActivityPub.Utils do #### Report-related helpers + def update_report_state(%Activity{} = activity, state) + when state in @strip_status_report_states do + {:ok, stripped_activity} = strip_report_status_data(activity) + + new_data = + activity.data + |> Map.put("state", state) + |> Map.put("object", stripped_activity.data["object"]) + + activity + |> Changeset.change(data: new_data) + |> Repo.update() + end + def update_report_state(%Activity{} = activity, state) when state in @supported_report_states do new_data = Map.put(activity.data, "state", state) @@ -674,6 +795,14 @@ defmodule Pleroma.Web.ActivityPub.Utils do def update_report_state(_, _), do: {:error, "Unsupported state"} + def strip_report_status_data(activity) do + [actor | reported_activities] = activity.data["object"] + stripped_activities = Enum.map(reported_activities, & &1["id"]) + new_data = put_in(activity.data, ["object"], [actor | stripped_activities]) + + {:ok, %{activity | data: new_data}} + end + def update_activity_visibility(activity, visibility) when visibility in @valid_visibilities do [to, cc, recipients] = activity diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex index 7ffbb23e7..30fc01755 100644 --- a/lib/pleroma/web/admin_api/admin_api_controller.ex +++ b/lib/pleroma/web/admin_api/admin_api_controller.ex @@ -334,6 +334,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do } with {:ok, users, count} <- Search.user(Map.merge(search_params, filters)), + {:ok, users, count} <- filter_relay_user(users, count), do: conn |> json( @@ -345,6 +346,17 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do ) end + defp filter_relay_user(users, count) do + filtered_users = Enum.reject(users, &relay_user?/1) + count = if Enum.any?(users, &relay_user?/1), do: length(filtered_users), else: count + + {:ok, filtered_users, count} + end + + defp relay_user?(user) do + user.ap_id == Relay.relay_ap_id() + end + @filters ~w(local external active deactivated is_admin is_moderator) @spec maybe_parse_filters(String.t()) :: %{required(String.t()) => true} | %{} @@ -595,10 +607,16 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do end @doc "Force password reset for a given user" - def force_password_reset(conn, %{"nickname" => nickname}) do - (%User{local: true} = user) = User.get_cached_by_nickname(nickname) + def force_password_reset(%{assigns: %{user: admin}} = conn, %{"nicknames" => nicknames}) do + users = nicknames |> Enum.map(&User.get_cached_by_nickname/1) - User.force_password_reset_async(user) + Enum.map(users, &User.force_password_reset_async/1) + + ModerationLog.insert_log(%{ + actor: admin, + subject: users, + action: "force_password_reset" + }) json_response(conn, :no_content, "") end diff --git a/lib/pleroma/web/admin_api/report.ex b/lib/pleroma/web/admin_api/report.ex index c751dc2be..9c3468570 100644 --- a/lib/pleroma/web/admin_api/report.ex +++ b/lib/pleroma/web/admin_api/report.ex @@ -13,8 +13,9 @@ defmodule Pleroma.Web.AdminAPI.Report do account = User.get_cached_by_ap_id(account_ap_id) statuses = - Enum.map(status_ap_ids, fn ap_id -> - Activity.get_by_ap_id_with_object(ap_id) + Enum.map(status_ap_ids, fn + act when is_map(act) -> Activity.get_by_ap_id_with_object(act["id"]) + act when is_binary(act) -> Activity.get_by_ap_id_with_object(act) end) %{report: report, user: user, account: account, statuses: statuses} diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index e57345621..f1937b1ec 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -120,6 +120,25 @@ defmodule Pleroma.Web.CommonAPI do end end + def react_with_emoji(id, user, emoji) do + with %Activity{} = activity <- Activity.get_by_id(id), + object <- Object.normalize(activity) do + ActivityPub.react_with_emoji(user, object, emoji) + else + _ -> + {:error, dgettext("errors", "Could not add reaction emoji")} + end + end + + def unreact_with_emoji(id, user, emoji) do + with %Activity{} = reaction_activity <- Utils.get_latest_reaction(id, user, emoji) do + ActivityPub.unreact_with_emoji(user, reaction_activity.data["id"]) + else + _ -> + {:error, dgettext("errors", "Could not remove reaction emoji")} + end + end + def vote(user, %{data: %{"type" => "Question"}} = object, choices) do with :ok <- validate_not_author(object, user), :ok <- validate_existing_votes(user, object), diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex index 2212e93f4..49735b5c2 100644 --- a/lib/pleroma/web/endpoint.ex +++ b/lib/pleroma/web/endpoint.ex @@ -12,7 +12,7 @@ defmodule Pleroma.Web.Endpoint do plug(Pleroma.Plugs.HTTPSecurityPlug) plug(Pleroma.Plugs.UploadedMedia) - @static_cache_control "public, no-cache" + @static_cache_control "public max-age=86400 must-revalidate" # InstanceStatic needs to be before Plug.Static to be able to override shipped-static files # If you're adding new paths to `only:` you'll need to configure them in InstanceStatic as well diff --git a/lib/pleroma/web/feed/feed_controller.ex b/lib/pleroma/web/feed/feed_controller.ex index d91ecef9c..d0e23007d 100644 --- a/lib/pleroma/web/feed/feed_controller.ex +++ b/lib/pleroma/web/feed/feed_controller.ex @@ -33,21 +33,22 @@ defmodule Pleroma.Web.Feed.FeedController do def feed(conn, %{"nickname" => nickname} = params) do with {_, %User{} = user} <- {:fetch_user, User.get_cached_by_nickname(nickname)} do - query_params = - params - |> Map.take(["max_id"]) - |> Map.put("type", ["Create"]) - |> Map.put("whole_db", true) - |> Map.put("actor_id", user.ap_id) - activities = - query_params + %{ + "type" => ["Create"], + "whole_db" => true, + "actor_id" => user.ap_id + } + |> Map.merge(Map.take(params, ["max_id"])) |> ActivityPub.fetch_public_activities() - |> Enum.reverse() conn |> put_resp_content_type("application/atom+xml") - |> render("feed.xml", user: user, activities: activities) + |> render("feed.xml", + user: user, + activities: activities, + feed_config: Pleroma.Config.get([:feed]) + ) end end diff --git a/lib/pleroma/web/feed/feed_view.ex b/lib/pleroma/web/feed/feed_view.ex index 5eef1e757..bb1332fd3 100644 --- a/lib/pleroma/web/feed/feed_view.ex +++ b/lib/pleroma/web/feed/feed_view.ex @@ -6,12 +6,23 @@ defmodule Pleroma.Web.Feed.FeedView do use Phoenix.HTML use Pleroma.Web, :view + alias Pleroma.Formatter alias Pleroma.Object alias Pleroma.User alias Pleroma.Web.MediaProxy require Pleroma.Constants + def prepare_activity(activity) do + object = activity_object(activity) + + %{ + activity: activity, + data: Map.get(object, :data), + object: object + } + end + def most_recent_update(activities, user) do (List.first(activities) || user).updated_at |> NaiveDateTime.to_iso8601() @@ -23,31 +34,23 @@ defmodule Pleroma.Web.Feed.FeedView do |> MediaProxy.url() end - def last_activity(activities) do - List.last(activities) + def last_activity(activities), do: List.last(activities) + + def activity_object(activity), do: Object.normalize(activity) + + def activity_title(%{data: %{"content" => content}}, opts \\ %{}) do + content + |> Formatter.truncate(opts[:max_length], opts[:omission]) + |> escape() end - def activity_object(activity) do - Object.normalize(activity) - end - - def activity_object_data(activity) do - activity - |> activity_object() - |> Map.get(:data) - end - - def activity_content(activity) do - content = activity_object_data(activity)["content"] - + def activity_content(%{data: %{"content" => content}}) do content |> String.replace(~r/[\n\r]/, "") |> escape() end - def activity_context(activity) do - activity.data["context"] - end + def activity_context(activity), do: activity.data["context"] def attachment_href(attachment) do attachment["url"] diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index 7df7dc097..757283378 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -66,9 +66,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do @relations [:follow, :unfollow] @needs_account ~W(followers following lists follow unfollow mute unmute block unblock)a - plug(RateLimiter, {:relations_id_action, params: ["id", "uri"]} when action in @relations) - plug(RateLimiter, :relations_actions when action in @relations) - plug(RateLimiter, :app_account_creation when action == :create) + plug(RateLimiter, [name: :relations_id_action, params: ["id", "uri"]] when action in @relations) + plug(RateLimiter, [name: :relations_actions] when action in @relations) + plug(RateLimiter, [name: :app_account_creation] when action == :create) plug(:assign_account_by_id when action in @needs_account) action_fallback(Pleroma.Web.MastodonAPI.FallbackController) diff --git a/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex b/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex index bfd5120ba..d9e51de7f 100644 --- a/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex @@ -15,7 +15,7 @@ defmodule Pleroma.Web.MastodonAPI.AuthController do @local_mastodon_name "Mastodon-Local" - plug(Pleroma.Plugs.RateLimiter, :password_reset when action == :password_reset) + plug(Pleroma.Plugs.RateLimiter, [name: :password_reset] when action == :password_reset) @doc "GET /web/login" def login(%{assigns: %{user: %User{}}} = conn, _params) do diff --git a/lib/pleroma/web/mastodon_api/controllers/search_controller.ex b/lib/pleroma/web/mastodon_api/controllers/search_controller.ex index 6cfd68a84..0a929f55b 100644 --- a/lib/pleroma/web/mastodon_api/controllers/search_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/search_controller.ex @@ -22,7 +22,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug) - plug(RateLimiter, :search when action in [:search, :search2, :account_search]) + plug(RateLimiter, [name: :search] when action in [:search, :search2, :account_search]) def account_search(%{assigns: %{user: user}} = conn, %{"q" => query} = params) do accounts = User.search(query, search_options(params, user)) diff --git a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex index e5d016f63..74b223cf4 100644 --- a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex @@ -82,17 +82,17 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do plug( RateLimiter, - {:status_id_action, bucket_name: "status_id_action:reblog_unreblog", params: ["id"]} + [name: :status_id_action, bucket_name: "status_id_action:reblog_unreblog", params: ["id"]] when action in ~w(reblog unreblog)a ) plug( RateLimiter, - {:status_id_action, bucket_name: "status_id_action:fav_unfav", params: ["id"]} + [name: :status_id_action, bucket_name: "status_id_action:fav_unfav", params: ["id"]] when action in ~w(favourite unfavourite)a ) - plug(RateLimiter, :statuses_actions when action in @rate_limited_status_actions) + plug(RateLimiter, [name: :statuses_actions] when action in @rate_limited_status_actions) action_fallback(Pleroma.Web.MastodonAPI.FallbackController) diff --git a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex index f2d2d3ccb..384159336 100644 --- a/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex @@ -71,7 +71,6 @@ defmodule Pleroma.Web.MastodonAPI.TimelineController do |> Map.put("blocking_user", user) |> Map.put("muting_user", user) |> ActivityPub.fetch_public_activities() - |> Enum.reverse() conn |> add_link_headers(activities, %{"local" => local_only}) @@ -110,7 +109,6 @@ defmodule Pleroma.Web.MastodonAPI.TimelineController do |> Map.put("tag_all", tag_all) |> Map.put("tag_reject", tag_reject) |> ActivityPub.fetch_public_activities() - |> Enum.reverse() conn |> add_link_headers(activities, %{"local" => local_only}) diff --git a/lib/pleroma/web/mastodon_api/views/conversation_view.ex b/lib/pleroma/web/mastodon_api/views/conversation_view.ex index e9d2735b3..c5998e661 100644 --- a/lib/pleroma/web/mastodon_api/views/conversation_view.ex +++ b/lib/pleroma/web/mastodon_api/views/conversation_view.ex @@ -34,7 +34,11 @@ defmodule Pleroma.Web.MastodonAPI.ConversationView do id: participation.id |> to_string(), accounts: render(AccountView, "index.json", users: users, as: :user), unread: !participation.read, - last_status: render(StatusView, "show.json", activity: activity, for: user) + last_status: + render(StatusView, "show.json", + activity: activity, + direct_conversation_id: participation.id + ) } end end diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index b785ca9d4..baff54151 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -243,7 +243,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do end direct_conversation_id = - with {_, true} <- {:include_id, opts[:with_direct_conversation_id]}, + with {_, nil} <- {:direct_conversation_id, opts[:direct_conversation_id]}, + {_, true} <- {:include_id, opts[:with_direct_conversation_id]}, {_, %User{} = for_user} <- {:for_user, opts[:for]}, %{data: %{"context" => context}} when is_binary(context) <- activity, %Conversation{} = conversation <- Conversation.get_for_ap_id(context), @@ -251,6 +252,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do Participation.for_user_and_conversation(for_user, conversation) do participation_id else + {:direct_conversation_id, participation_id} when is_integer(participation_id) -> + participation_id + _e -> nil end diff --git a/lib/pleroma/web/mongooseim/mongoose_im_controller.ex b/lib/pleroma/web/mongooseim/mongoose_im_controller.ex index 6ed181cff..358600e7d 100644 --- a/lib/pleroma/web/mongooseim/mongoose_im_controller.ex +++ b/lib/pleroma/web/mongooseim/mongoose_im_controller.ex @@ -10,8 +10,8 @@ defmodule Pleroma.Web.MongooseIM.MongooseIMController do alias Pleroma.Repo alias Pleroma.User - plug(RateLimiter, :authentication when action in [:user_exists, :check_password]) - plug(RateLimiter, {:authentication, params: ["user"]} when action == :check_password) + plug(RateLimiter, [name: :authentication] when action in [:user_exists, :check_password]) + plug(RateLimiter, [name: :authentication, params: ["user"]] when action == :check_password) def user_exists(conn, %{"user" => username}) do with %User{} <- Repo.get_by(User, nickname: username, local: true) do diff --git a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex index 192984242..486b9f6a4 100644 --- a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex +++ b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex @@ -46,6 +46,7 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do data |> Map.merge(%{quarantined_instances: quarantined}) + |> Map.put(:enabled, Config.get([:instance, :federating])) else %{} end @@ -58,6 +59,7 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do "polls", "pleroma_explicit_addressing", "shareable_emoji_packs", + "multifetch", if Config.get([:media_proxy, :enabled]) do "media_proxy" end, diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index fe71aca8c..2aee8cab2 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -6,6 +6,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do use Pleroma.Web, :controller alias Pleroma.Helpers.UriHelper + alias Pleroma.Plugs.RateLimiter alias Pleroma.Registration alias Pleroma.Repo alias Pleroma.User @@ -24,7 +25,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do plug(:fetch_session) plug(:fetch_flash) - plug(Pleroma.Plugs.RateLimiter, :authentication when action == :create_authorization) + plug(RateLimiter, [name: :authentication] when action == :create_authorization) action_fallback(Pleroma.Web.OAuth.FallbackController) @@ -36,7 +37,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do authorize(conn, Map.merge(params, auth_attrs)) end - def authorize(%Plug.Conn{assigns: %{token: %Token{}}} = conn, params) do + def authorize(%Plug.Conn{assigns: %{token: %Token{}}} = conn, %{"force_login" => _} = params) do if ControllerHelper.truthy_param?(params["force_login"]) do do_authorize(conn, params) else @@ -44,6 +45,22 @@ defmodule Pleroma.Web.OAuth.OAuthController do end end + # Note: the token is set in oauth_plug, but the token and client do not always go together. + # For example, MastodonFE's token is set if user requests with another client, + # after user already authorized to MastodonFE. + # So we have to check client and token. + def authorize( + %Plug.Conn{assigns: %{token: %Token{} = token}} = conn, + %{"client_id" => client_id} = params + ) do + with %Token{} = t <- Repo.get_by(Token, token: token.token) |> Repo.preload(:app), + ^client_id <- t.app.client_id do + handle_existing_authorization(conn, params) + else + _ -> do_authorize(conn, params) + end + end + def authorize(%Plug.Conn{} = conn, params), do: do_authorize(conn, params) defp do_authorize(%Plug.Conn{} = conn, params) do diff --git a/lib/pleroma/web/ostatus/ostatus_controller.ex b/lib/pleroma/web/ostatus/ostatus_controller.ex index 6958519de..12a7c2365 100644 --- a/lib/pleroma/web/ostatus/ostatus_controller.ex +++ b/lib/pleroma/web/ostatus/ostatus_controller.ex @@ -8,6 +8,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do alias Fallback.RedirectController alias Pleroma.Activity alias Pleroma.Object + alias Pleroma.Plugs.RateLimiter alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPubController alias Pleroma.Web.ActivityPub.ObjectView @@ -17,8 +18,8 @@ defmodule Pleroma.Web.OStatus.OStatusController do alias Pleroma.Web.Router plug( - Pleroma.Plugs.RateLimiter, - {:ap_routes, params: ["uuid"]} when action in [:object, :activity] + RateLimiter, + [name: :ap_routes, params: ["uuid"]] when action in [:object, :activity] ) plug( diff --git a/lib/pleroma/web/pleroma_api/controllers/account_controller.ex b/lib/pleroma/web/pleroma_api/controllers/account_controller.ex index db6faac83..bc2f1017c 100644 --- a/lib/pleroma/web/pleroma_api/controllers/account_controller.ex +++ b/lib/pleroma/web/pleroma_api/controllers/account_controller.ex @@ -42,7 +42,7 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do when action != :confirmation_resend ) - plug(RateLimiter, :account_confirmation_resend when action == :confirmation_resend) + plug(RateLimiter, [name: :account_confirmation_resend] when action == :confirmation_resend) plug(:assign_account_by_id when action in [:favourites, :subscribe, :unsubscribe]) plug(:put_view, Pleroma.Web.MastodonAPI.AccountView) diff --git a/lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex b/lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex index 651a99423..8fed3f5bb 100644 --- a/lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex +++ b/lib/pleroma/web/pleroma_api/controllers/pleroma_api_controller.ex @@ -7,10 +7,15 @@ defmodule Pleroma.Web.PleromaAPI.PleromaAPIController do import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2] + alias Pleroma.Activity alias Pleroma.Conversation.Participation alias Pleroma.Notification + alias Pleroma.Object alias Pleroma.Plugs.OAuthScopesPlug + alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub + alias Pleroma.Web.CommonAPI + alias Pleroma.Web.MastodonAPI.AccountView alias Pleroma.Web.MastodonAPI.ConversationView alias Pleroma.Web.MastodonAPI.NotificationView alias Pleroma.Web.MastodonAPI.StatusView @@ -29,6 +34,47 @@ defmodule Pleroma.Web.PleromaAPI.PleromaAPIController do plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug) + def emoji_reactions_by(%{assigns: %{user: user}} = conn, %{"id" => activity_id}) do + with %Activity{} = activity <- Activity.get_by_id_with_object(activity_id), + %Object{data: %{"reactions" => emoji_reactions}} <- Object.normalize(activity) do + reactions = + emoji_reactions + |> Enum.map(fn {emoji, users} -> + users = Enum.map(users, &User.get_cached_by_ap_id/1) + {emoji, AccountView.render("index.json", %{users: users, for: user, as: :user})} + end) + |> Enum.into(%{}) + + conn + |> json(reactions) + else + _e -> + conn + |> json(%{}) + end + end + + def react_with_emoji(%{assigns: %{user: user}} = conn, %{"id" => activity_id, "emoji" => emoji}) do + with {:ok, _activity, _object} <- CommonAPI.react_with_emoji(activity_id, user, emoji), + activity <- Activity.get_by_id(activity_id) do + conn + |> put_view(StatusView) + |> render("show.json", %{activity: activity, for: user, as: :activity}) + end + end + + def unreact_with_emoji(%{assigns: %{user: user}} = conn, %{ + "id" => activity_id, + "emoji" => emoji + }) do + with {:ok, _activity, _object} <- CommonAPI.unreact_with_emoji(activity_id, user, emoji), + activity <- Activity.get_by_id(activity_id) do + conn + |> put_view(StatusView) + |> render("show.json", %{activity: activity, for: user, as: :activity}) + end + end + def conversation(%{assigns: %{user: user}} = conn, %{"id" => participation_id}) do with %Participation{} = participation <- Participation.get(participation_id), true <- user.id == participation.user_id do diff --git a/lib/pleroma/web/rel_me.ex b/lib/pleroma/web/rel_me.ex index d376e2069..16b1a53d2 100644 --- a/lib/pleroma/web/rel_me.ex +++ b/lib/pleroma/web/rel_me.ex @@ -25,13 +25,13 @@ defmodule Pleroma.Web.RelMe do def parse(_), do: {:error, "No URL provided"} defp parse_url(url) do - {:ok, %Tesla.Env{body: html}} = Pleroma.HTTP.get(url, [], adapter: @hackney_options) - - data = - Floki.attribute(html, "link[rel~=me]", "href") ++ - Floki.attribute(html, "a[rel~=me]", "href") - - {:ok, data} + with {:ok, %Tesla.Env{body: html, status: status}} when status in 200..299 <- + Pleroma.HTTP.get(url, [], adapter: @hackney_options), + data <- + Floki.attribute(html, "link[rel~=me]", "href") ++ + Floki.attribute(html, "a[rel~=me]", "href") do + {:ok, data} + end rescue e -> {:error, "Parsing error: #{inspect(e)}"} end diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index f69c5c2bc..93e7e45f9 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -171,7 +171,7 @@ defmodule Pleroma.Web.Router do post("/users/email_invite", AdminAPIController, :email_invite) get("/users/:nickname/password_reset", AdminAPIController, :get_password_reset) - patch("/users/:nickname/force_password_reset", AdminAPIController, :force_password_reset) + patch("/users/force_password_reset", AdminAPIController, :force_password_reset) get("/users", AdminAPIController, :list_users) get("/users/:nickname", AdminAPIController, :user_show) @@ -260,6 +260,12 @@ defmodule Pleroma.Web.Router do end end + scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do + pipe_through(:api) + + get("/statuses/:id/emoji_reactions_by", PleromaAPIController, :emoji_reactions_by) + end + scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do scope [] do pipe_through(:authenticated_api) @@ -273,6 +279,8 @@ defmodule Pleroma.Web.Router do pipe_through(:authenticated_api) patch("/conversations/:id", PleromaAPIController, :update_conversation) + post("/statuses/:id/react_with_emoji", PleromaAPIController, :react_with_emoji) + post("/statuses/:id/unreact_with_emoji", PleromaAPIController, :unreact_with_emoji) post("/notifications/read", PleromaAPIController, :read_notification) patch("/accounts/update_avatar", AccountController, :update_avatar) @@ -495,6 +503,7 @@ defmodule Pleroma.Web.Router do pipeline :ostatus do plug(:accepts, ["html", "xml", "atom", "activity+json", "json"]) + plug(Pleroma.Plugs.StaticFEPlug) end pipeline :oembed do diff --git a/lib/pleroma/web/static_fe/static_fe_controller.ex b/lib/pleroma/web/static_fe/static_fe_controller.ex new file mode 100644 index 000000000..8ccf15f4b --- /dev/null +++ b/lib/pleroma/web/static_fe/static_fe_controller.ex @@ -0,0 +1,163 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2019 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.StaticFE.StaticFEController do + use Pleroma.Web, :controller + + alias Pleroma.Activity + alias Pleroma.Object + alias Pleroma.User + alias Pleroma.Web.ActivityPub.ActivityPub + alias Pleroma.Web.ActivityPub.Visibility + alias Pleroma.Web.Metadata + alias Pleroma.Web.Router.Helpers + + plug(:put_layout, :static_fe) + plug(:put_view, Pleroma.Web.StaticFE.StaticFEView) + plug(:assign_id) + + @page_keys ["max_id", "min_id", "limit", "since_id", "order"] + + defp get_title(%Object{data: %{"name" => name}}) when is_binary(name), + do: name + + defp get_title(%Object{data: %{"summary" => summary}}) when is_binary(summary), + do: summary + + defp get_title(_), do: nil + + defp not_found(conn, message) do + conn + |> put_status(404) + |> render("error.html", %{message: message, meta: ""}) + end + + def get_counts(%Activity{} = activity) do + %Object{data: data} = Object.normalize(activity) + + %{ + likes: data["like_count"] || 0, + replies: data["repliesCount"] || 0, + announces: data["announcement_count"] || 0 + } + end + + def represent(%Activity{} = activity), do: represent(activity, false) + + def represent(%Activity{object: %Object{data: data}} = activity, selected) do + {:ok, user} = User.get_or_fetch(activity.object.data["actor"]) + + link = + case user.local do + true -> Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity) + _ -> data["url"] || data["external_url"] || data["id"] + end + + %{ + user: user, + title: get_title(activity.object), + content: data["content"] || nil, + attachment: data["attachment"], + link: link, + published: data["published"], + sensitive: data["sensitive"], + selected: selected, + counts: get_counts(activity), + id: activity.id + } + end + + def show(%{assigns: %{notice_id: notice_id}} = conn, _params) do + with %Activity{local: true} = activity <- + Activity.get_by_id_with_object(notice_id), + true <- Visibility.is_public?(activity.object), + %User{} = user <- User.get_by_ap_id(activity.object.data["actor"]) do + meta = Metadata.build_tags(%{activity_id: notice_id, object: activity.object, user: user}) + + timeline = + activity.object.data["context"] + |> ActivityPub.fetch_activities_for_context(%{}) + |> Enum.reverse() + |> Enum.map(&represent(&1, &1.object.id == activity.object.id)) + + render(conn, "conversation.html", %{activities: timeline, meta: meta}) + else + %Activity{object: %Object{data: data}} -> + conn + |> put_status(:found) + |> redirect(external: data["url"] || data["external_url"] || data["id"]) + + _ -> + not_found(conn, "Post not found.") + end + end + + def show(%{assigns: %{username_or_id: username_or_id}} = conn, params) do + case User.get_cached_by_nickname_or_id(username_or_id) do + %User{} = user -> + meta = Metadata.build_tags(%{user: user}) + + timeline = + ActivityPub.fetch_user_activities(user, nil, Map.take(params, @page_keys)) + |> Enum.map(&represent/1) + + prev_page_id = + (params["min_id"] || params["max_id"]) && + List.first(timeline) && List.first(timeline).id + + next_page_id = List.last(timeline) && List.last(timeline).id + + render(conn, "profile.html", %{ + user: user, + timeline: timeline, + prev_page_id: prev_page_id, + next_page_id: next_page_id, + meta: meta + }) + + _ -> + not_found(conn, "User not found.") + end + end + + def show(%{assigns: %{object_id: _}} = conn, _params) do + url = Helpers.url(conn) <> conn.request_path + + case Activity.get_create_by_object_ap_id_with_object(url) do + %Activity{} = activity -> + to = Helpers.o_status_path(Pleroma.Web.Endpoint, :notice, activity) + redirect(conn, to: to) + + _ -> + not_found(conn, "Post not found.") + end + end + + def show(%{assigns: %{activity_id: _}} = conn, _params) do + url = Helpers.url(conn) <> conn.request_path + + case Activity.get_by_ap_id(url) do + %Activity{} = activity -> + to = Helpers.o_status_path(Pleroma.Web.Endpoint, :notice, activity) + redirect(conn, to: to) + + _ -> + not_found(conn, "Post not found.") + end + end + + def assign_id(%{path_info: ["notice", notice_id]} = conn, _opts), + do: assign(conn, :notice_id, notice_id) + + def assign_id(%{path_info: ["users", user_id]} = conn, _opts), + do: assign(conn, :username_or_id, user_id) + + def assign_id(%{path_info: ["objects", object_id]} = conn, _opts), + do: assign(conn, :object_id, object_id) + + def assign_id(%{path_info: ["activities", activity_id]} = conn, _opts), + do: assign(conn, :activity_id, activity_id) + + def assign_id(conn, _opts), do: conn +end diff --git a/lib/pleroma/web/static_fe/static_fe_view.ex b/lib/pleroma/web/static_fe/static_fe_view.ex new file mode 100644 index 000000000..821ece9a9 --- /dev/null +++ b/lib/pleroma/web/static_fe/static_fe_view.ex @@ -0,0 +1,47 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2019 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.StaticFE.StaticFEView do + use Pleroma.Web, :view + + alias Calendar.Strftime + alias Pleroma.Emoji.Formatter + alias Pleroma.User + alias Pleroma.Web.Endpoint + alias Pleroma.Web.Gettext + alias Pleroma.Web.MediaProxy + alias Pleroma.Web.Metadata.Utils + alias Pleroma.Web.Router.Helpers + + use Phoenix.HTML + + @media_types ["image", "audio", "video"] + + def emoji_for_user(%User{} = user) do + user.source_data + |> Map.get("tag", []) + |> Enum.filter(fn %{"type" => t} -> t == "Emoji" end) + |> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} -> + {String.trim(name, ":"), url} + end) + end + + def fetch_media_type(%{"mediaType" => mediaType}) do + Utils.fetch_media_type(@media_types, mediaType) + end + + def format_date(date) do + {:ok, date, _} = DateTime.from_iso8601(date) + Strftime.strftime!(date, "%Y/%m/%d %l:%M:%S %p UTC") + end + + def instance_name, do: Pleroma.Config.get([:instance, :name], "Pleroma") + + def open_content? do + Pleroma.Config.get( + [:frontend_configurations, :collapse_message_with_subjects], + true + ) + end +end diff --git a/lib/pleroma/web/streamer/worker.ex b/lib/pleroma/web/streamer/worker.ex index c2ee9e1f5..33b24840d 100644 --- a/lib/pleroma/web/streamer/worker.ex +++ b/lib/pleroma/web/streamer/worker.ex @@ -136,7 +136,7 @@ defmodule Pleroma.Web.Streamer.Worker do recipients = MapSet.new(item.recipients) domain_blocks = Pleroma.Web.ActivityPub.MRF.subdomains_regex(user.domain_blocks) - with parent when not is_nil(parent) <- Object.normalize(item), + with parent <- Object.normalize(item) || item, true <- Enum.all?([blocks, mutes, reblog_mutes], &(item.actor not in &1)), true <- Enum.all?([blocks, mutes], &(parent.data["actor"] not in &1)), true <- MapSet.disjoint?(recipients, recipient_blocks), diff --git a/lib/pleroma/web/templates/feed/feed/_activity.xml.eex b/lib/pleroma/web/templates/feed/feed/_activity.xml.eex index d1f5e903c..514eacaed 100644 --- a/lib/pleroma/web/templates/feed/feed/_activity.xml.eex +++ b/lib/pleroma/web/templates/feed/feed/_activity.xml.eex @@ -2,11 +2,13 @@ http://activitystrea.ms/schema/1.0/note http://activitystrea.ms/schema/1.0/post <%= @data["id"] %> - <%= "New note by #{@user.nickname}" %> - <%= activity_content(@activity) %> + <%= activity_title(@object, Keyword.get(@feed_config, :post_title, %{})) %> + <%= activity_content(@object) %> <%= @data["published"] %> <%= @data["published"] %> - <%= activity_context(@activity) %> + + <%= activity_context(@activity) %> + <%= if @data["summary"] do %> diff --git a/lib/pleroma/web/templates/feed/feed/feed.xml.eex b/lib/pleroma/web/templates/feed/feed/feed.xml.eex index 45df9dc09..5ae36d345 100644 --- a/lib/pleroma/web/templates/feed/feed/feed.xml.eex +++ b/lib/pleroma/web/templates/feed/feed/feed.xml.eex @@ -19,6 +19,6 @@ <% end %> <%= for activity <- @activities do %> - <%= render @view_module, "_activity.xml", Map.merge(assigns, %{activity: activity, data: activity_object_data(activity)}) %> + <%= render @view_module, "_activity.xml", Map.merge(assigns, prepare_activity(activity)) %> <% end %> diff --git a/lib/pleroma/web/templates/layout/static_fe.html.eex b/lib/pleroma/web/templates/layout/static_fe.html.eex new file mode 100644 index 000000000..819632cec --- /dev/null +++ b/lib/pleroma/web/templates/layout/static_fe.html.eex @@ -0,0 +1,15 @@ + + + + + + <%= Pleroma.Config.get([:instance, :name]) %> + <%= Phoenix.HTML.raw(assigns[:meta] || "") %> + + + +
+ <%= render @view_module, @view_template, assigns %> +
+ + diff --git a/lib/pleroma/web/templates/static_fe/static_fe/_attachment.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/_attachment.html.eex new file mode 100644 index 000000000..7e04e9550 --- /dev/null +++ b/lib/pleroma/web/templates/static_fe/static_fe/_attachment.html.eex @@ -0,0 +1,8 @@ +<%= case @mediaType do %> +<% "audio" -> %> + +<% "video" -> %> + +<% _ -> %> +<%= @name %> +<% end %> diff --git a/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex new file mode 100644 index 000000000..df5e5eedd --- /dev/null +++ b/lib/pleroma/web/templates/static_fe/static_fe/_notice.html.eex @@ -0,0 +1,37 @@ +
id="selected" <% end %>> +

+ <%= link format_date(@published), to: @link, class: "activity-link" %> +

+ <%= render("_user_card.html", %{user: @user}) %> +
+ <%= if @title != "" do %> +
open<% end %>> + <%= raw @title %> +
<%= raw @content %>
+
+ <% else %> +
<%= raw @content %>
+ <% end %> + <%= for %{"name" => name, "url" => [url | _]} <- @attachment do %> + <%= if @sensitive do %> +
+ <%= Gettext.gettext("sensitive media") %> +
+ <%= render("_attachment.html", %{name: name, url: url["href"], + mediaType: fetch_media_type(url)}) %> +
+
+ <% else %> + <%= render("_attachment.html", %{name: name, url: url["href"], + mediaType: fetch_media_type(url)}) %> + <% end %> + <% end %> +
+ <%= if @selected do %> +
+
<%= Gettext.gettext("replies") %>
<%= @counts.replies %>
+
<%= Gettext.gettext("announces") %>
<%= @counts.announces %>
+
<%= Gettext.gettext("likes") %>
<%= @counts.likes %>
+
+ <% end %> +
diff --git a/lib/pleroma/web/templates/static_fe/static_fe/_user_card.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/_user_card.html.eex new file mode 100644 index 000000000..c7789f9ac --- /dev/null +++ b/lib/pleroma/web/templates/static_fe/static_fe/_user_card.html.eex @@ -0,0 +1,11 @@ + diff --git a/lib/pleroma/web/templates/static_fe/static_fe/conversation.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/conversation.html.eex new file mode 100644 index 000000000..2acd84828 --- /dev/null +++ b/lib/pleroma/web/templates/static_fe/static_fe/conversation.html.eex @@ -0,0 +1,11 @@ +
+

<%= link instance_name(), to: "/" %>

+
+ +
+
+ <%= for activity <- @activities do %> + <%= render("_notice.html", activity) %> + <% end %> +
+
diff --git a/lib/pleroma/web/templates/static_fe/static_fe/error.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/error.html.eex new file mode 100644 index 000000000..d98a1eba7 --- /dev/null +++ b/lib/pleroma/web/templates/static_fe/static_fe/error.html.eex @@ -0,0 +1,7 @@ +
+

<%= gettext("Oops") %>

+
+ +
+

<%= @message %>

+
diff --git a/lib/pleroma/web/templates/static_fe/static_fe/profile.html.eex b/lib/pleroma/web/templates/static_fe/static_fe/profile.html.eex new file mode 100644 index 000000000..94063c92d --- /dev/null +++ b/lib/pleroma/web/templates/static_fe/static_fe/profile.html.eex @@ -0,0 +1,31 @@ +
+

<%= link instance_name(), to: "/" %>

+ +

+
+ + + +
+ <%= raw Formatter.emojify(@user.name, emoji_for_user(@user)) %> | + <%= link "@#{@user.nickname}@#{Endpoint.host()}", to: User.profile_url(@user) %> +

+

<%= raw @user.bio %>

+
+ +
+
+ <%= for activity <- @timeline do %> + <%= render("_notice.html", Map.put(activity, :selected, false)) %> + <% end %> +

+ <%= if @prev_page_id do %> + <%= link "«", to: "?min_id=" <> @prev_page_id %> + <% end %> + <%= if @prev_page_id && @next_page_id, do: " | " %> + <%= if @next_page_id do %> + <%= link "»", to: "?max_id=" <> @next_page_id %> + <% end %> +

+
+
diff --git a/mix.exs b/mix.exs index dcb9d9ea8..81ce4f25c 100644 --- a/mix.exs +++ b/mix.exs @@ -63,7 +63,7 @@ defmodule Pleroma.Mixfile do def application do [ mod: {Pleroma.Application, []}, - extra_applications: [:logger, :runtime_tools, :comeonin, :quack], + extra_applications: [:logger, :runtime_tools, :comeonin, :quack, :fast_sanitize, :swarm], included_applications: [:ex_syslogger] ] end @@ -108,8 +108,8 @@ defmodule Pleroma.Mixfile do {:comeonin, "~> 4.1.1"}, {:pbkdf2_elixir, "~> 0.12.3"}, {:trailing_format_plug, "~> 0.0.7"}, - {:html_sanitize_ex, "~> 1.3.0"}, - {:html_entities, "~> 0.4"}, + {:fast_sanitize, "~> 0.1"}, + {:html_entities, "~> 0.5", override: true}, {:phoenix_html, "~> 2.10"}, {:calendar, "~> 0.17.4"}, {:cachex, "~> 3.0.2"}, @@ -155,7 +155,6 @@ defmodule Pleroma.Mixfile do {:joken, "~> 2.0"}, {:benchee, "~> 1.0"}, {:esshd, "~> 0.1.0", runtime: Application.get_env(:esshd, :enabled, false)}, - {:ex_rated, "~> 1.3"}, {:ex_const, "~> 0.2"}, {:plug_static_index_html, "~> 1.0.0"}, {:excoveralls, "~> 0.11.1", only: :test}, diff --git a/mix.lock b/mix.lock index 5f740638c..d4a80df77 100644 --- a/mix.lock +++ b/mix.lock @@ -13,44 +13,45 @@ "comeonin": {:hex, :comeonin, "4.1.2", "3eb5620fd8e35508991664b4c2b04dd41e52f1620b36957be837c1d7784b7592", [:mix], [{:argon2_elixir, "~> 1.2", [hex: :argon2_elixir, repo: "hexpm", optional: true]}, {:bcrypt_elixir, "~> 0.12.1 or ~> 1.0", [hex: :bcrypt_elixir, repo: "hexpm", optional: true]}, {:pbkdf2_elixir, "~> 0.12", [hex: :pbkdf2_elixir, repo: "hexpm", optional: true]}], "hexpm"}, "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"}, "cors_plug": {:hex, :cors_plug, "1.5.2", "72df63c87e4f94112f458ce9d25800900cc88608c1078f0e4faddf20933eda6e", [:mix], [{:plug, "~> 1.3 or ~> 1.4 or ~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "cowboy": {:hex, :cowboy, "2.6.3", "99aa50e94e685557cad82e704457336a453d4abcb77839ad22dbe71f311fcc06", [:rebar3], [{:cowlib, "~> 2.7.3", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, - "cowlib": {:hex, :cowlib, "2.7.3", "a7ffcd0917e6d50b4d5fb28e9e2085a0ceb3c97dea310505f7460ff5ed764ce9", [:rebar3], [], "hexpm"}, + "cowboy": {:hex, :cowboy, "2.7.0", "91ed100138a764355f43316b1d23d7ff6bdb0de4ea618cb5d8677c93a7a2f115", [:rebar3], [{:cowlib, "~> 2.8.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"}, + "cowlib": {:hex, :cowlib, "2.8.0", "fd0ff1787db84ac415b8211573e9a30a3ebe71b5cbff7f720089972b2319c8a4", [:rebar3], [], "hexpm"}, "credo": {:hex, :credo, "0.9.3", "76fa3e9e497ab282e0cf64b98a624aa11da702854c52c82db1bf24e54ab7c97a", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:poison, ">= 0.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, - "crontab": {:hex, :crontab, "1.1.7", "b9219f0bdc8678b94143655a8f229716c5810c0636a4489f98c0956137e53985", [:mix], [{:ecto, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm"}, + "crontab": {:hex, :crontab, "1.1.8", "2ce0e74777dfcadb28a1debbea707e58b879e6aa0ffbf9c9bb540887bce43617", [:mix], [{:ecto, "~> 1.0 or ~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm"}, "crypt": {:git, "https://github.com/msantos/crypt", "1f2b58927ab57e72910191a7ebaeff984382a1d3", [ref: "1f2b58927ab57e72910191a7ebaeff984382a1d3"]}, "custom_base": {:hex, :custom_base, "0.2.1", "4a832a42ea0552299d81652aa0b1f775d462175293e99dfbe4d7dbaab785a706", [:mix], [], "hexpm"}, "db_connection": {:hex, :db_connection, "2.1.1", "a51e8a2ee54ef2ae6ec41a668c85787ed40cb8944928c191280fe34c15b76ae5", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"}, "decimal": {:hex, :decimal, "1.8.0", "ca462e0d885f09a1c5a342dbd7c1dcf27ea63548c65a65e67334f4b61803822e", [:mix], [], "hexpm"}, "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm"}, - "earmark": {:hex, :earmark, "1.3.6", "ce1d0675e10a5bb46b007549362bd3f5f08908843957687d8484fe7f37466b19", [:mix], [], "hexpm"}, - "ecto": {:hex, :ecto, "3.2.0", "940e2598813f205223d60c78d66e514afe1db5167ed8075510a59e496619cfb5", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "earmark": {:hex, :earmark, "1.4.2", "3aa0bd23bc4c61cf2f1e5d752d1bb470560a6f8539974f767a38923bb20e1d7f", [:mix], [], "hexpm"}, + "ecto": {:hex, :ecto, "3.2.3", "51274df79862845b388733fddcf6f107d0c8c86e27abe7131fa98f8d30761bda", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, "ecto_sql": {:hex, :ecto_sql, "3.2.0", "751cea597e8deb616084894dd75cbabfdbe7255ff01e8c058ca13f0353a3921b", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.2.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.2.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, "esshd": {:hex, :esshd, "0.1.0", "6f93a2062adb43637edad0ea7357db2702a4b80dd9683482fe00f5134e97f4c1", [:mix], [], "hexpm"}, - "eternal": {:hex, :eternal, "1.2.0", "e2a6b6ce3b8c248f7dc31451aefca57e3bdf0e48d73ae5043229380a67614c41", [:mix], [], "hexpm"}, + "eternal": {:hex, :eternal, "1.2.1", "d5b6b2499ba876c57be2581b5b999ee9bdf861c647401066d3eeed111d096bc4", [:mix], [], "hexpm"}, "ex2ms": {:hex, :ex2ms, "1.5.0", "19e27f9212be9a96093fed8cdfbef0a2b56c21237196d26760f11dfcfae58e97", [:mix], [], "hexpm"}, - "ex_aws": {:hex, :ex_aws, "2.1.0", "b92651527d6c09c479f9013caa9c7331f19cba38a650590d82ebf2c6c16a1d8a", [:mix], [{:configparser_ex, "~> 2.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "1.6.3 or 1.6.5 or 1.7.1 or 1.8.6 or ~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8", [hex: :jsx, repo: "hexpm", optional: true]}, {:poison, ">= 1.2.0", [hex: :poison, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}, {:xml_builder, "~> 0.1.0", [hex: :xml_builder, repo: "hexpm", optional: true]}], "hexpm"}, - "ex_aws_s3": {:hex, :ex_aws_s3, "2.0.1", "9e09366e77f25d3d88c5393824e613344631be8db0d1839faca49686e99b6704", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_aws": {:hex, :ex_aws, "2.1.1", "1e4de2106cfbf4e837de41be41cd15813eabc722315e388f0d6bb3732cec47cd", [:mix], [{:configparser_ex, "~> 4.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "1.6.3 or 1.6.5 or 1.7.1 or 1.8.6 or ~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8", [hex: :jsx, repo: "hexpm", optional: true]}, {:poison, ">= 1.2.0", [hex: :poison, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_aws_s3": {:hex, :ex_aws_s3, "2.0.2", "c0258bbdfea55de4f98f0b2f0ca61fe402cc696f573815134beb1866e778f47b", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm"}, "ex_const": {:hex, :ex_const, "0.2.4", "d06e540c9d834865b012a17407761455efa71d0ce91e5831e86881b9c9d82448", [:mix], [], "hexpm"}, "ex_doc": {:hex, :ex_doc, "0.21.2", "caca5bc28ed7b3bdc0b662f8afe2bee1eedb5c3cf7b322feeeb7c6ebbde089d6", [:mix], [{:earmark, "~> 1.3.3 or ~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, "ex_machina": {:hex, :ex_machina, "2.3.0", "92a5ad0a8b10ea6314b876a99c8c9e3f25f4dde71a2a835845b136b9adaf199a", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm"}, - "ex_rated": {:hex, :ex_rated, "1.3.3", "30ecbdabe91f7eaa9d37fa4e81c85ba420f371babeb9d1910adbcd79ec798d27", [:mix], [{:ex2ms, "~> 1.5", [hex: :ex2ms, repo: "hexpm", optional: false]}], "hexpm"}, "ex_syslogger": {:git, "https://github.com/slashmili/ex_syslogger.git", "f3963399047af17e038897c69e20d552e6899e1d", [tag: "1.4.0"]}, - "excoveralls": {:hex, :excoveralls, "0.11.1", "dd677fbdd49114fdbdbf445540ec735808250d56b011077798316505064edb2c", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, + "excoveralls": {:hex, :excoveralls, "0.11.2", "0c6f2c8db7683b0caa9d490fb8125709c54580b4255ffa7ad35f3264b075a643", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, + "fast_html": {:hex, :fast_html, "0.99.3", "e7ce6245fed0635f4719a31cc409091ed17b2091165a4a1cffbf2ceac77abbf4", [:make, :mix], [], "hexpm"}, + "fast_sanitize": {:hex, :fast_sanitize, "0.1.3", "e89a743b1679c344abdfcf79778d1499fbc599eca2d8a8cdfaf9ff520986fb72", [:mix], [{:fast_html, "~> 0.99", [hex: :fast_html, repo: "hexpm", optional: false]}, {:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "flake_id": {:hex, :flake_id, "0.1.0", "7716b086d2e405d09b647121a166498a0d93d1a623bead243e1f74216079ccb3", [:mix], [{:base62, "~> 1.2", [hex: :base62, repo: "hexpm", optional: false]}, {:ecto, ">= 2.0.0", [hex: :ecto, repo: "hexpm", optional: true]}], "hexpm"}, "floki": {:hex, :floki, "0.23.0", "956ab6dba828c96e732454809fb0bd8d43ce0979b75f34de6322e73d4c917829", [:mix], [{:html_entities, "~> 0.4.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm"}, - "gen_smtp": {:hex, :gen_smtp, "0.14.0", "39846a03522456077c6429b4badfd1d55e5e7d0fdfb65e935b7c5e38549d9202", [:rebar3], [], "hexpm"}, - "gen_stage": {:hex, :gen_stage, "0.14.2", "6a2a578a510c5bfca8a45e6b27552f613b41cf584b58210f017088d3d17d0b14", [:mix], [], "hexpm"}, + "gen_smtp": {:hex, :gen_smtp, "0.15.0", "9f51960c17769b26833b50df0b96123605a8024738b62db747fece14eb2fbfcc", [:rebar3], [], "hexpm"}, + "gen_stage": {:hex, :gen_stage, "0.14.3", "d0c66f1c87faa301c1a85a809a3ee9097a4264b2edf7644bf5c123237ef732bf", [:mix], [], "hexpm"}, "gen_state_machine": {:hex, :gen_state_machine, "2.0.5", "9ac15ec6e66acac994cc442dcc2c6f9796cf380ec4b08267223014be1c728a95", [:mix], [], "hexpm"}, - "gettext": {:hex, :gettext, "0.17.0", "abe21542c831887a2b16f4c94556db9c421ab301aee417b7c4fbde7fbdbe01ec", [:mix], [], "hexpm"}, + "gettext": {:hex, :gettext, "0.17.1", "8baab33482df4907b3eae22f719da492cee3981a26e649b9c2be1c0192616962", [:mix], [], "hexpm"}, "hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"}, - "html_entities": {:hex, :html_entities, "0.4.0", "f2fee876858cf6aaa9db608820a3209e45a087c5177332799592142b50e89a6b", [:mix], [], "hexpm"}, + "html_entities": {:hex, :html_entities, "0.5.0", "40f5c5b9cbe23073b48a4e69c67b6c11974f623a76165e2b92d098c0e88ccb1d", [:mix], [], "hexpm"}, "html_sanitize_ex": {:hex, :html_sanitize_ex, "1.3.0", "f005ad692b717691203f940c686208aa3d8ffd9dd4bb3699240096a51fa9564e", [:mix], [{:mochiweb, "~> 2.15", [hex: :mochiweb, repo: "hexpm", optional: false]}], "hexpm"}, "http_signatures": {:git, "https://git.pleroma.social/pleroma/http_signatures.git", "293d77bb6f4a67ac8bde1428735c3b42f22cbb30", [ref: "293d77bb6f4a67ac8bde1428735c3b42f22cbb30"]}, - "httpoison": {:hex, :httpoison, "1.2.0", "2702ed3da5fd7a8130fc34b11965c8cfa21ade2f232c00b42d96d4967c39a3a3", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, + "httpoison": {:hex, :httpoison, "1.6.1", "2ce5bf6e535cd0ab02e905ba8c276580bab80052c5c549f53ddea52d72e81f33", [:mix], [{:hackney, "~> 1.15 and >= 1.15.2", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"}, "inet_cidr": {:hex, :inet_cidr, "1.0.4", "a05744ab7c221ca8e395c926c3919a821eb512e8f36547c062f62c4ca0cf3d6e", [:mix], [], "hexpm"}, "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, - "joken": {:hex, :joken, "2.0.1", "ec9ab31bf660f343380da033b3316855197c8d4c6ef597fa3fcb451b326beb14", [:mix], [{:jose, "~> 1.9", [hex: :jose, repo: "hexpm", optional: false]}], "hexpm"}, + "joken": {:hex, :joken, "2.1.0", "bf21a73105d82649f617c5e59a7f8919aa47013d2519ebcc39d998d8d12adda9", [:mix], [{:jose, "~> 1.9", [hex: :jose, repo: "hexpm", optional: false]}], "hexpm"}, "jose": {:hex, :jose, "1.9.0", "4167c5f6d06ffaebffd15cdb8da61a108445ef5e85ab8f5a7ad926fdf3ada154", [:mix, :rebar3], [{:base64url, "~> 0.0.1", [hex: :base64url, repo: "hexpm", optional: false]}], "hexpm"}, "libring": {:hex, :libring, "1.4.0", "41246ba2f3fbc76b3971f6bce83119dfec1eee17e977a48d8a9cfaaf58c2a8d6", [:mix], [], "hexpm"}, "makeup": {:hex, :makeup, "1.0.0", "671df94cf5a594b739ce03b0d0316aa64312cee2574b6a44becb83cd90fb05dc", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, @@ -63,16 +64,18 @@ "mock": {:hex, :mock, "0.3.3", "42a433794b1291a9cf1525c6d26b38e039e0d3a360732b5e467bfc77ef26c914", [:mix], [{:meck, "~> 0.8.13", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"}, "mogrify": {:hex, :mogrify, "0.6.1", "de1b527514f2d95a7bbe9642eb556061afb337e220cf97adbf3a4e6438ed70af", [:mix], [], "hexpm"}, "mox": {:hex, :mox, "0.5.1", "f86bb36026aac1e6f924a4b6d024b05e9adbed5c63e8daa069bd66fb3292165b", [:mix], [], "hexpm"}, + "myhtmlex": {:git, "https://git.pleroma.social/pleroma/myhtmlex.git", "ad0097e2f61d4953bfef20fb6abddf23b87111e6", [ref: "ad0097e2f61d4953bfef20fb6abddf23b87111e6", submodules: true]}, "nimble_parsec": {:hex, :nimble_parsec, "0.5.1", "c90796ecee0289dbb5ad16d3ad06f957b0cd1199769641c961cfe0b97db190e0", [:mix], [], "hexpm"}, + "nodex": {:git, "https://git.pleroma.social/pleroma/nodex", "cb6730f943cfc6aad674c92161be23a8411f15d1", [ref: "cb6730f943cfc6aad674c92161be23a8411f15d1"]}, "oban": {:hex, :oban, "0.8.1", "4bbf62eb1829f856d69aeb5069ac7036afe07db8221a17de2a9169cc7a58a318", [:mix], [{:ecto_sql, "~> 3.1", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.14", [hex: :postgrex, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, "parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm"}, - "pbkdf2_elixir": {:hex, :pbkdf2_elixir, "0.12.3", "6706a148809a29c306062862c803406e88f048277f6e85b68faf73291e820b84", [:mix], [], "hexpm"}, - "phoenix": {:hex, :phoenix, "1.4.9", "746d098e10741c334d88143d3c94cab1756435f94387a63441792e66ec0ee974", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, + "pbkdf2_elixir": {:hex, :pbkdf2_elixir, "0.12.4", "8dd29ed783f2e12195d7e0a4640effc0a7c37e6537da491f1db01839eee6d053", [:mix], [], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.4.10", "619e4a545505f562cd294df52294372d012823f4fd9d34a6657a8b242898c255", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.8.1 or ~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.0.0", "c43117a136e7399ea04ecaac73f8f23ee0ffe3e07acfcb8062fe5f4c9f0f6531", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.9", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_html": {:hex, :phoenix_html, "2.13.1", "fa8f034b5328e2dfa0e4131b5569379003f34bc1fafdaa84985b0b9d2f12e68b", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "phoenix_html": {:hex, :phoenix_html, "2.13.3", "850e292ff6e204257f5f9c4c54a8cb1f6fbc16ed53d360c2b780a3d0ba333867", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.2", "496c303bdf1b2e98a9d26e89af5bba3ab487ba3a3735f74bf1f4064d2a845a3e", [:mix], [], "hexpm"}, "phoenix_swoosh": {:hex, :phoenix_swoosh, "0.2.0", "a7e0b32077cd6d2323ae15198839b05d9caddfa20663fd85787479e81f89520e", [:mix], [{:phoenix, "~> 1.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.2", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:swoosh, "~> 0.1", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm"}, - "plug": {:hex, :plug, "1.8.2", "0bcce1daa420f189a6491f3940cc77ea7fb1919761175c9c3b59800d897440fc", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, + "plug": {:hex, :plug, "1.8.3", "12d5f9796dc72e8ac9614e94bda5e51c4c028d0d428e9297650d09e15a684478", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, "plug_cowboy": {:hex, :plug_cowboy, "2.1.0", "b75768153c3a8a9e8039d4b25bb9b14efbc58e9c4a6e6a270abff1cd30cbe320", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, "plug_static_index_html": {:hex, :plug_static_index_html, "1.0.0", "840123d4d3975585133485ea86af73cb2600afd7f2a976f9f5fd8b3808e636a0", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, @@ -80,7 +83,7 @@ "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm"}, "postgrex": {:hex, :postgrex, "0.15.1", "23ce3417de70f4c0e9e7419ad85bdabcc6860a6925fe2c6f3b1b5b1e8e47bf2f", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, "prometheus": {:hex, :prometheus, "4.4.1", "1e96073b3ed7788053768fea779cbc896ddc3bdd9ba60687f2ad50b252ac87d6", [:mix, :rebar3], [], "hexpm"}, - "prometheus_ecto": {:hex, :prometheus_ecto, "1.4.1", "6c768ea9654de871e5b32fab2eac348467b3021604ebebbcbd8bcbe806a65ed5", [:mix], [{:ecto, "~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}], "hexpm"}, + "prometheus_ecto": {:hex, :prometheus_ecto, "1.4.3", "3dd4da1812b8e0dbee81ea58bb3b62ed7588f2eae0c9e97e434c46807ff82311", [:mix], [{:ecto, "~> 2.0 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}], "hexpm"}, "prometheus_ex": {:hex, :prometheus_ex, "3.0.5", "fa58cfd983487fc5ead331e9a3e0aa622c67232b3ec71710ced122c4c453a02f", [:mix], [{:prometheus, "~> 4.0", [hex: :prometheus, repo: "hexpm", optional: false]}], "hexpm"}, "prometheus_phoenix": {:hex, :prometheus_phoenix, "1.3.0", "c4b527e0b3a9ef1af26bdcfbfad3998f37795b9185d475ca610fe4388fdd3bb5", [:mix], [{:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.3 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}], "hexpm"}, "prometheus_plugs": {:hex, :prometheus_plugs, "1.1.5", "25933d48f8af3a5941dd7b621c889749894d8a1082a6ff7c67cc99dec26377c5", [:mix], [{:accept, "~> 0.1", [hex: :accept, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:prometheus_ex, "~> 1.1 or ~> 2.0 or ~> 3.0", [hex: :prometheus_ex, repo: "hexpm", optional: false]}, {:prometheus_process_collector, "~> 1.1", [hex: :prometheus_process_collector, repo: "hexpm", optional: true]}], "hexpm"}, @@ -92,16 +95,16 @@ "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.5", "6eaf7ad16cb568bb01753dbbd7a95ff8b91c7979482b95f38443fe2c8852a79b", [:make, :mix, :rebar3], [], "hexpm"}, "swarm": {:hex, :swarm, "3.4.0", "64f8b30055d74640d2186c66354b33b999438692a91be275bb89cdc7e401f448", [:mix], [{:gen_state_machine, "~> 2.0", [hex: :gen_state_machine, repo: "hexpm", optional: false]}, {:libring, "~> 1.0", [hex: :libring, repo: "hexpm", optional: false]}], "hexpm"}, "sweet_xml": {:hex, :sweet_xml, "0.6.6", "fc3e91ec5dd7c787b6195757fbcf0abc670cee1e4172687b45183032221b66b8", [:mix], [], "hexpm"}, - "swoosh": {:hex, :swoosh, "0.23.2", "7dda95ff0bf54a2298328d6899c74dae1223777b43563ccebebb4b5d2b61df38", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm"}, + "swoosh": {:hex, :swoosh, "0.23.5", "bfd9404bbf5069b1be2ffd317923ce57e58b332e25dbca2a35dedd7820dfee5a", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm"}, "syslog": {:git, "https://github.com/Vagabond/erlang-syslog.git", "4a6c6f2c996483e86c1320e9553f91d337bcb6aa", [tag: "1.0.5"]}, "telemetry": {:hex, :telemetry, "0.4.0", "8339bee3fa8b91cb84d14c2935f8ecf399ccd87301ad6da6b71c09553834b2ab", [:rebar3], [], "hexpm"}, "tesla": {:hex, :tesla, "1.3.0", "f35d72f029e608f9cdc6f6d6fcc7c66cf6d6512a70cfef9206b21b8bd0203a30", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 0.4", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.3", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, "timex": {:hex, :timex, "3.6.1", "efdf56d0e67a6b956cc57774353b0329c8ab7726766a11547e529357ffdc1d56", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5 or ~> 1.0.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"}, "trailing_format_plug": {:hex, :trailing_format_plug, "0.0.7", "64b877f912cf7273bed03379936df39894149e35137ac9509117e59866e10e45", [:mix], [{:plug, "> 0.12.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "tzdata": {:hex, :tzdata, "0.5.21", "8cbf3607fcce69636c672d5be2bbb08687fe26639a62bdcc283d267277db7cf0", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, - "ueberauth": {:hex, :ueberauth, "0.6.1", "9e90d3337dddf38b1ca2753aca9b1e53d8a52b890191cdc55240247c89230412", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, + "tzdata": {:hex, :tzdata, "0.5.22", "f2ba9105117ee0360eae2eca389783ef7db36d533899b2e84559404dbc77ebb8", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, + "ueberauth": {:hex, :ueberauth, "0.6.2", "25a31111249d60bad8b65438b2306a4dc91f3208faa62f5a8c33e8713989b2e8", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm"}, "unsafe": {:hex, :unsafe, "1.0.1", "a27e1874f72ee49312e0a9ec2e0b27924214a05e3ddac90e91727bc76f8613d8", [:mix], [], "hexpm"}, - "web_push_encryption": {:hex, :web_push_encryption, "0.2.1", "d42cecf73420d9dc0053ba3299cc8c8d6ff2be2487d67ca2a57265868e4d9a98", [:mix], [{:httpoison, "~> 1.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, + "web_push_encryption": {:hex, :web_push_encryption, "0.2.3", "a0ceab85a805a30852f143d22d71c434046fbdbafbc7292e7887cec500826a80", [:mix], [{:httpoison, "~> 1.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, "websocket_client": {:git, "https://github.com/jeremyong/websocket_client.git", "9a6f65d05ebf2725d62fb19262b21f1805a59fbf", []}, } diff --git a/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs b/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs index f3928a149..99102117f 100644 --- a/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs +++ b/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs @@ -8,10 +8,10 @@ defmodule Pleroma.Repo.Migrations.MigrateOldBookmarks do def up do query = - from(u in User, + from(u in "users", where: u.local == true, - where: fragment("array_length(bookmarks, 1)") > 0, - select: %{id: u.id, bookmarks: fragment("bookmarks")} + where: fragment("array_length(?, 1)", u.bookmarks) > 0, + select: %{id: u.id, bookmarks: u.bookmarks} ) Repo.stream(query) diff --git a/priv/repo/migrations/20191025143434_add_defaults_to_tables.exs b/priv/repo/migrations/20191025143434_add_defaults_to_tables.exs new file mode 100644 index 000000000..a5bc82335 --- /dev/null +++ b/priv/repo/migrations/20191025143434_add_defaults_to_tables.exs @@ -0,0 +1,68 @@ +defmodule Pleroma.Repo.Migrations.AddDefaultsToTables do + use Ecto.Migration + + def up do + execute("ALTER TABLE activities + ALTER COLUMN recipients SET DEFAULT ARRAY[]::character varying[]") + + execute("ALTER TABLE filters + ALTER COLUMN whole_word SET DEFAULT true") + + execute("ALTER TABLE push_subscriptions + ALTER COLUMN data SET DEFAULT '{}'::jsonb") + + execute(~s(ALTER TABLE users + ALTER COLUMN tags SET DEFAULT ARRAY[]::character varying[], + ALTER COLUMN notification_settings SET DEFAULT + '{"followers": true, "follows": true, "non_follows": true, "non_followers": true}'::jsonb)) + + # irreversible updates + + execute( + "UPDATE activities SET recipients = ARRAY[]::character varying[] WHERE recipients IS NULL" + ) + + execute("UPDATE filters SET whole_word = true WHERE whole_word IS NULL") + + execute("UPDATE push_subscriptions SET data = '{}'::jsonb WHERE data IS NULL") + + execute("UPDATE users SET source_data = '{}'::jsonb where source_data IS NULL") + execute("UPDATE users SET note_count = 0 where note_count IS NULL") + execute("UPDATE users SET background = '{}'::jsonb where background IS NULL") + execute("UPDATE users SET follower_count = 0 where follower_count IS NULL") + + execute( + "UPDATE users SET unread_conversation_count = 0 where unread_conversation_count IS NULL" + ) + + execute( + ~s(UPDATE users SET email_notifications = '{"digest": false}'::jsonb where email_notifications IS NULL) + ) + + execute("UPDATE users SET default_scope = 'public' where default_scope IS NULL") + + execute( + "UPDATE users SET pleroma_settings_store = '{}'::jsonb where pleroma_settings_store IS NULL" + ) + + execute("UPDATE users SET tags = ARRAY[]::character varying[] WHERE tags IS NULL") + execute(~s(UPDATE users SET notification_settings = + '{"followers": true, "follows": true, "non_follows": true, "non_followers": true}'::jsonb + WHERE notification_settings = '{}'::jsonb)) + end + + def down do + execute("ALTER TABLE activities + ALTER COLUMN recipients DROP DEFAULT") + + execute("ALTER TABLE filters + ALTER COLUMN whole_word DROP DEFAULT") + + execute("ALTER TABLE push_subscriptions + ALTER COLUMN data DROP DEFAULT") + + execute("ALTER TABLE users + ALTER COLUMN tags DROP DEFAULT, + ALTER COLUMN notification_settings SET DEFAULT '{}'::jsonb") + end +end diff --git a/priv/repo/migrations/20191029101340_migrate_missing_follow_requests.exs b/priv/repo/migrations/20191029101340_migrate_missing_follow_requests.exs new file mode 100644 index 000000000..90b18efc8 --- /dev/null +++ b/priv/repo/migrations/20191029101340_migrate_missing_follow_requests.exs @@ -0,0 +1,35 @@ +defmodule Pleroma.Repo.Migrations.MigrateMissingFollowingRelationships do + use Ecto.Migration + + def change do + execute(import_pending_follows_from_activities(), "") + end + + defp import_pending_follows_from_activities do + """ + INSERT INTO + following_relationships ( + follower_id, + following_id, + state, + inserted_at, + updated_at + ) + SELECT + followers.id, + following.id, + activities.data ->> 'state', + (activities.data ->> 'published') :: timestamp, + now() + FROM + activities + JOIN users AS followers ON (activities.actor = followers.ap_id) + JOIN users AS following ON (activities.data ->> 'object' = following.ap_id) + WHERE + activities.data ->> 'type' = 'Follow' + AND activities.data ->> 'state' = 'pending' + ORDER BY activities.updated_at DESC + ON CONFLICT DO NOTHING + """ + end +end diff --git a/priv/repo/migrations/20191029172832_fix_blocked_follows.exs b/priv/repo/migrations/20191029172832_fix_blocked_follows.exs new file mode 100644 index 000000000..71f8f1330 --- /dev/null +++ b/priv/repo/migrations/20191029172832_fix_blocked_follows.exs @@ -0,0 +1,112 @@ +defmodule Pleroma.Repo.Migrations.FixBlockedFollows do + use Ecto.Migration + + import Ecto.Query + alias Pleroma.Config + alias Pleroma.Repo + + def up do + unfollow_blocked = Config.get([:activitypub, :unfollow_blocked]) + + if unfollow_blocked do + "activities" + |> where([activity], fragment("? ->> 'type' = 'Block'", activity.data)) + |> distinct([activity], [ + activity.actor, + fragment( + "coalesce((?)->'object'->>'id', (?)->>'object')", + activity.data, + activity.data + ) + ]) + |> order_by([activity], [fragment("? desc nulls last", activity.id)]) + |> select([activity], %{ + blocker: activity.actor, + blocked: + fragment("coalesce((?)->'object'->>'id', (?)->>'object')", activity.data, activity.data), + created_at: activity.id + }) + |> Repo.stream() + |> Enum.map(&unfollow_if_blocked/1) + |> Enum.uniq() + |> Enum.each(&update_follower_count/1) + end + end + + def down do + end + + def unfollow_if_blocked(%{blocker: blocker_id, blocked: blocked_id, created_at: blocked_at}) do + query = + from( + activity in "activities", + where: fragment("? ->> 'type' = 'Follow'", activity.data), + where: activity.actor == ^blocked_id, + # this is to use the index + where: + fragment( + "coalesce((?)->'object'->>'id', (?)->>'object') = ?", + activity.data, + activity.data, + ^blocker_id + ), + where: activity.id > ^blocked_at, + where: fragment("(?)->>'state' = 'accept'", activity.data), + order_by: [fragment("? desc nulls last", activity.id)] + ) + + unless Repo.exists?(query) do + blocker = "users" |> select([:id, :local]) |> Repo.get_by(ap_id: blocker_id) + blocked = "users" |> select([:id]) |> Repo.get_by(ap_id: blocked_id) + + if !is_nil(blocker) && !is_nil(blocked) do + unfollow(blocked, blocker) + end + end + end + + def unfollow(%{id: follower_id}, %{id: followed_id} = followed) do + following_relationship = + "following_relationships" + |> where(follower_id: ^follower_id, following_id: ^followed_id, state: "accept") + |> select([:id]) + |> Repo.one() + + case following_relationship do + nil -> + {:ok, nil} + + %{id: following_relationship_id} -> + "following_relationships" + |> where(id: ^following_relationship_id) + |> Repo.delete_all() + + followed + end + end + + def update_follower_count(%{id: user_id} = user) do + if user.local or !Pleroma.Config.get([:instance, :external_user_synchronization]) do + follower_count_query = + "users" + |> where([u], u.id != ^user_id) + |> where([u], u.deactivated != ^true) + |> join(:inner, [u], r in "following_relationships", + as: :relationships, + on: r.following_id == ^user_id and r.follower_id == u.id + ) + |> where([relationships: r], r.state == "accept") + |> select([u], %{count: count(u.id)}) + + "users" + |> where(id: ^user_id) + |> join(:inner, [u], s in subquery(follower_count_query)) + |> update([u, s], + set: [follower_count: s.count] + ) + |> Repo.update_all([]) + end + end + + def update_follower_count(_), do: :noop +end diff --git a/priv/static/index.html b/priv/static/index.html index fc5eee901..f1a26cc95 100644 --- a/priv/static/index.html +++ b/priv/static/index.html @@ -1 +1 @@ -Pleroma
\ No newline at end of file +Pleroma
\ No newline at end of file diff --git a/priv/static/schemas/litepub-0.1.jsonld b/priv/static/schemas/litepub-0.1.jsonld index 509df4bb7..e7ebf72be 100644 --- a/priv/static/schemas/litepub-0.1.jsonld +++ b/priv/static/schemas/litepub-0.1.jsonld @@ -29,6 +29,7 @@ "@id": "litepub:oauthRegistrationEndpoint", "@type": "@id" }, + "EmojiReaction": "litepub:EmojiReaction", "alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" diff --git a/priv/static/static/css/app.4e8e80a2f95232cff399.css b/priv/static/static/css/app.fd71461124f3eb029b1b.css similarity index 97% rename from priv/static/static/css/app.4e8e80a2f95232cff399.css rename to priv/static/static/css/app.fd71461124f3eb029b1b.css index ca3d4e41f..6ab9849ec 100644 --- a/priv/static/static/css/app.4e8e80a2f95232cff399.css +++ b/priv/static/static/css/app.fd71461124f3eb029b1b.css @@ -99,4 +99,4 @@ font-size: 14px; } -/*# sourceMappingURL=app.4e8e80a2f95232cff399.css.map*/ \ No newline at end of file +/*# sourceMappingURL=app.fd71461124f3eb029b1b.css.map*/ \ No newline at end of file diff --git a/priv/static/static/css/app.4e8e80a2f95232cff399.css.map b/priv/static/static/css/app.fd71461124f3eb029b1b.css.map similarity index 95% rename from priv/static/static/css/app.4e8e80a2f95232cff399.css.map rename to priv/static/static/css/app.fd71461124f3eb029b1b.css.map index dc2c92ced..660b09d2c 100644 --- a/priv/static/static/css/app.4e8e80a2f95232cff399.css.map +++ b/priv/static/static/css/app.fd71461124f3eb029b1b.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/hocs/with_load_more/with_load_more.scss","webpack:///./src/components/tab_switcher/tab_switcher.scss","webpack:///./src/hocs/with_subscription/with_subscription.scss"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;AClFA;AACA;AACA;AACA;AACA;AACA;AACA,C","file":"static/css/app.4e8e80a2f95232cff399.css","sourcesContent":[".with-load-more-footer {\n padding: 10px;\n text-align: center;\n border-top: 1px solid;\n border-top-color: #222;\n border-top-color: var(--border, #222);\n}\n.with-load-more-footer .error {\n font-size: 14px;\n}",".tab-switcher {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.tab-switcher .contents {\n -ms-flex: 1 0 auto;\n flex: 1 0 auto;\n min-height: 0px;\n}\n.tab-switcher .contents .hidden {\n display: none;\n}\n.tab-switcher .contents.scrollable-tabs {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n overflow-y: auto;\n}\n.tab-switcher .tabs {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n width: 100%;\n overflow-y: hidden;\n overflow-x: auto;\n padding-top: 5px;\n box-sizing: border-box;\n}\n.tab-switcher .tabs::after, .tab-switcher .tabs::before {\n display: block;\n content: \"\";\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n border-bottom: 1px solid;\n border-bottom-color: #222;\n border-bottom-color: var(--border, #222);\n}\n.tab-switcher .tabs .tab-wrapper {\n height: 28px;\n position: relative;\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.tab-switcher .tabs .tab-wrapper .tab {\n width: 100%;\n min-width: 1px;\n position: relative;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 6px 1em;\n padding-bottom: 99px;\n margin-bottom: -93px;\n white-space: nowrap;\n}\n.tab-switcher .tabs .tab-wrapper .tab:not(.active) {\n z-index: 4;\n}\n.tab-switcher .tabs .tab-wrapper .tab:not(.active):hover {\n z-index: 6;\n}\n.tab-switcher .tabs .tab-wrapper .tab.active {\n background: transparent;\n z-index: 5;\n}\n.tab-switcher .tabs .tab-wrapper .tab img {\n max-height: 26px;\n vertical-align: top;\n margin-top: -5px;\n}\n.tab-switcher .tabs .tab-wrapper:not(.active)::after {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 7;\n border-bottom: 1px solid;\n border-bottom-color: #222;\n border-bottom-color: var(--border, #222);\n}",".with-subscription-loading {\n padding: 10px;\n text-align: center;\n}\n.with-subscription-loading .error {\n font-size: 14px;\n}"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/hocs/with_load_more/with_load_more.scss","webpack:///./src/components/tab_switcher/tab_switcher.scss","webpack:///./src/hocs/with_subscription/with_subscription.scss"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,C;AClFA;AACA;AACA;AACA;AACA;AACA;AACA,C","file":"static/css/app.fd71461124f3eb029b1b.css","sourcesContent":[".with-load-more-footer {\n padding: 10px;\n text-align: center;\n border-top: 1px solid;\n border-top-color: #222;\n border-top-color: var(--border, #222);\n}\n.with-load-more-footer .error {\n font-size: 14px;\n}",".tab-switcher {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.tab-switcher .contents {\n -ms-flex: 1 0 auto;\n flex: 1 0 auto;\n min-height: 0px;\n}\n.tab-switcher .contents .hidden {\n display: none;\n}\n.tab-switcher .contents.scrollable-tabs {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n overflow-y: auto;\n}\n.tab-switcher .tabs {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n width: 100%;\n overflow-y: hidden;\n overflow-x: auto;\n padding-top: 5px;\n box-sizing: border-box;\n}\n.tab-switcher .tabs::after, .tab-switcher .tabs::before {\n display: block;\n content: \"\";\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n border-bottom: 1px solid;\n border-bottom-color: #222;\n border-bottom-color: var(--border, #222);\n}\n.tab-switcher .tabs .tab-wrapper {\n height: 28px;\n position: relative;\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n.tab-switcher .tabs .tab-wrapper .tab {\n width: 100%;\n min-width: 1px;\n position: relative;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 6px 1em;\n padding-bottom: 99px;\n margin-bottom: -93px;\n white-space: nowrap;\n}\n.tab-switcher .tabs .tab-wrapper .tab:not(.active) {\n z-index: 4;\n}\n.tab-switcher .tabs .tab-wrapper .tab:not(.active):hover {\n z-index: 6;\n}\n.tab-switcher .tabs .tab-wrapper .tab.active {\n background: transparent;\n z-index: 5;\n}\n.tab-switcher .tabs .tab-wrapper .tab img {\n max-height: 26px;\n vertical-align: top;\n margin-top: -5px;\n}\n.tab-switcher .tabs .tab-wrapper:not(.active)::after {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 7;\n border-bottom: 1px solid;\n border-bottom-color: #222;\n border-bottom-color: var(--border, #222);\n}",".with-subscription-loading {\n padding: 10px;\n text-align: center;\n}\n.with-subscription-loading .error {\n font-size: 14px;\n}"],"sourceRoot":""} \ No newline at end of file diff --git a/priv/static/static/js/2.48f39bc510b7c0a7fca6.js b/priv/static/static/js/2.48f39bc510b7c0a7fca6.js deleted file mode 100644 index eabbcf690..000000000 --- a/priv/static/static/js/2.48f39bc510b7c0a7fca6.js +++ /dev/null @@ -1,2 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{987:function(t,e,i){"use strict";i.r(e);var n=i(988),c=i.n(n);for(var r in n)"default"!==r&&function(t){i.d(e,t,function(){return n[t]})}(r);var a=i(991),s=i(0);var o=function(t){i(989)},u=Object(s.a)(c.a,a.a,a.b,!1,o,null,null);e.default=u.exports},988:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=c(i(332));function c(t){return t&&t.__esModule?t:{default:t}}var r={components:{TabSwitcher:c(i(197)).default},data:function(){return{meta:{stickers:[]},path:""}},computed:{pack:function(){return this.$store.state.instance.stickers||[]}},methods:{clear:function(){this.meta={stickers:[]}},pick:function(t,e){var i=this,c=this.$store;fetch(t).then(function(t){t.blob().then(function(t){var r=new File([t],e,{mimetype:"image/png"}),a=new FormData;a.append("file",r),n.default.uploadMedia({store:c,formData:a}).then(function(t){i.$emit("uploaded",t),i.clear()},function(t){console.warn("Can't attach sticker"),console.warn(t),i.$emit("upload-failed","default")})})})}}};e.default=r},989:function(t,e,i){var n=i(990);"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);(0,i(2).default)("cc6cdea4",n,!0,{})},990:function(t,e,i){(t.exports=i(1)(!1)).push([t.i,".sticker-picker{width:100%;position:relative}.sticker-picker .tab-switcher{position:absolute;top:0;bottom:0;left:0;right:0}.sticker-picker .sticker-picker-content .sticker{display:inline-block;width:20%;height:20%}.sticker-picker .sticker-picker-content .sticker img{width:100%}.sticker-picker .sticker-picker-content .sticker img:hover{filter:drop-shadow(0 0 5px var(--link,#d8a070))}",""])},991:function(t,e,i){"use strict";i.d(e,"a",function(){return n}),i.d(e,"b",function(){return c});var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"sticker-picker"},[i("tab-switcher",{staticClass:"tab-switcher",attrs:{"render-only-focused":!0,"scrollable-tabs":""}},t._l(t.pack,function(e){return i("div",{key:e.path,staticClass:"sticker-picker-content",attrs:{"image-tooltip":e.meta.title,image:e.path+e.meta.tabIcon}},t._l(e.meta.stickers,function(n){return i("div",{key:n,staticClass:"sticker",on:{click:function(i){i.stopPropagation(),i.preventDefault(),t.pick(e.path+n,e.meta.title)}}},[i("img",{attrs:{src:e.path+n}})])}),0)}),0)],1)},c=[]}}]); -//# sourceMappingURL=2.48f39bc510b7c0a7fca6.js.map \ No newline at end of file diff --git a/priv/static/static/js/2.73375b727cef616c59b4.js b/priv/static/static/js/2.73375b727cef616c59b4.js new file mode 100644 index 000000000..ebfd9acbd --- /dev/null +++ b/priv/static/static/js/2.73375b727cef616c59b4.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{1012:function(t,e,i){"use strict";i.r(e);var n=i(1013),c=i.n(n);for(var r in n)"default"!==r&&function(t){i.d(e,t,function(){return n[t]})}(r);var a=i(1016),s=i(0);var o=function(t){i(1014)},u=Object(s.a)(c.a,a.a,a.b,!1,o,null,null);e.default=u.exports},1013:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=c(i(348));function c(t){return t&&t.__esModule?t:{default:t}}var r={components:{TabSwitcher:c(i(205)).default},data:function(){return{meta:{stickers:[]},path:""}},computed:{pack:function(){return this.$store.state.instance.stickers||[]}},methods:{clear:function(){this.meta={stickers:[]}},pick:function(t,e){var i=this,c=this.$store;fetch(t).then(function(t){t.blob().then(function(t){var r=new File([t],e,{mimetype:"image/png"}),a=new FormData;a.append("file",r),n.default.uploadMedia({store:c,formData:a}).then(function(t){i.$emit("uploaded",t),i.clear()},function(t){console.warn("Can't attach sticker"),console.warn(t),i.$emit("upload-failed","default")})})})}}};e.default=r},1014:function(t,e,i){var n=i(1015);"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);(0,i(2).default)("cc6cdea4",n,!0,{})},1015:function(t,e,i){(t.exports=i(1)(!1)).push([t.i,".sticker-picker{width:100%;position:relative}.sticker-picker .tab-switcher{position:absolute;top:0;bottom:0;left:0;right:0}.sticker-picker .sticker-picker-content .sticker{display:inline-block;width:20%;height:20%}.sticker-picker .sticker-picker-content .sticker img{width:100%}.sticker-picker .sticker-picker-content .sticker img:hover{filter:drop-shadow(0 0 5px var(--link,#d8a070))}",""])},1016:function(t,e,i){"use strict";i.d(e,"a",function(){return n}),i.d(e,"b",function(){return c});var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"sticker-picker"},[i("tab-switcher",{staticClass:"tab-switcher",attrs:{"render-only-focused":!0,"scrollable-tabs":""}},t._l(t.pack,function(e){return i("div",{key:e.path,staticClass:"sticker-picker-content",attrs:{"image-tooltip":e.meta.title,image:e.path+e.meta.tabIcon}},t._l(e.meta.stickers,function(n){return i("div",{key:n,staticClass:"sticker",on:{click:function(i){i.stopPropagation(),i.preventDefault(),t.pick(e.path+n,e.meta.title)}}},[i("img",{attrs:{src:e.path+n}})])}),0)}),0)],1)},c=[]}}]); +//# sourceMappingURL=2.73375b727cef616c59b4.js.map \ No newline at end of file diff --git a/priv/static/static/js/2.48f39bc510b7c0a7fca6.js.map b/priv/static/static/js/2.73375b727cef616c59b4.js.map similarity index 92% rename from priv/static/static/js/2.48f39bc510b7c0a7fca6.js.map rename to priv/static/static/js/2.73375b727cef616c59b4.js.map index be87ffa46..d2c864eb3 100644 --- a/priv/static/static/js/2.48f39bc510b7c0a7fca6.js.map +++ b/priv/static/static/js/2.73375b727cef616c59b4.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/components/sticker_picker/sticker_picker.vue","webpack:///./src/components/sticker_picker/sticker_picker.js","webpack:///./src/components/sticker_picker/sticker_picker.vue?d6cd","webpack:///./src/components/sticker_picker/sticker_picker.vue?d5ea","webpack:///./src/components/sticker_picker/sticker_picker.vue?8003"],"names":["__webpack_require__","r","__webpack_exports__","_babel_loader_sticker_picker_js__WEBPACK_IMPORTED_MODULE_0__","_babel_loader_sticker_picker_js__WEBPACK_IMPORTED_MODULE_0___default","n","__WEBPACK_IMPORT_KEY__","key","d","_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70972e0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sticker_picker_vue__WEBPACK_IMPORTED_MODULE_1__","_node_modules_vue_loader_lib_runtime_component_normalizer__WEBPACK_IMPORTED_MODULE_2__","__vue_styles__","context","Component","Object","a","StickerPicker","components","TabSwitcher","data","meta","stickers","path","computed","pack","this","$store","state","instance","methods","clear","pick","sticker","name","_this","store","fetch","then","res","blob","file","File","mimetype","formData","FormData","append","statusPosterService","uploadMedia","fileData","$emit","error","console","warn","content","module","i","locals","exports","add","default","push","render","staticRenderFns","_vm","_h","$createElement","_c","_self","staticClass","attrs","render-only-focused","scrollable-tabs","_l","stickerpack","image-tooltip","title","image","tabIcon","on","click","$event","stopPropagation","preventDefault","src"],"mappings":"0FAAAA,EAAAC,EAAAC,GAAA,IAAAC,EAAAH,EAAA,KAAAI,EAAAJ,EAAAK,EAAAF,GAAA,QAAAG,KAAAH,EAAA,YAAAG,GAAA,SAAAC,GAAAP,EAAAQ,EAAAN,EAAAK,EAAA,kBAAAJ,EAAAI,KAAA,CAAAD,GAAA,IAAAG,EAAAT,EAAA,KAAAU,EAAAV,EAAA,GAQA,IAEAW,EAVA,SAAAC,GACEZ,EAAQ,MAeVa,EAAgBC,OAAAJ,EAAA,EAAAI,CACdV,EAAAW,EACAN,EAAA,EACAA,EAAA,GAXF,EAaAE,EATA,KAEA,MAYeT,EAAA,QAAAW,EAAiB,2FCzBhC,QAAAb,EAAA,yDAGA,IAAMgB,EAAgB,CACpBC,WAAY,CACVC,cAJJlB,EAAA,MAIIkB,SAEFC,KAJoB,WAKlB,MAAO,CACLC,KAAM,CACJC,SAAU,IAEZC,KAAM,KAGVC,SAAU,CACRC,KADQ,WAEN,OAAOC,KAAKC,OAAOC,MAAMC,SAASP,UAAY,KAGlDQ,QAAS,CACPC,MADO,WAELL,KAAKL,KAAO,CACVC,SAAU,KAGdU,KANO,SAMDC,EAASC,GAAM,IAAAC,EAAAT,KACbU,EAAQV,KAAKC,OAEnBU,MAAMJ,GACHK,KAAK,SAACC,GACLA,EAAIC,OAAOF,KAAK,SAACE,GACf,IAAIC,EAAO,IAAIC,KAAK,CAACF,GAAON,EAAM,CAAES,SAAU,cAC1CC,EAAW,IAAIC,SACnBD,EAASE,OAAO,OAAQL,GACxBM,UAAoBC,YAAY,CAAEZ,QAAOQ,aACtCN,KAAK,SAACW,GACLd,EAAKe,MAAM,WAAYD,GACvBd,EAAKJ,SACJ,SAACoB,GACFC,QAAQC,KAAK,wBACbD,QAAQC,KAAKF,GACbhB,EAAKe,MAAM,gBAAiB,8BAQ7BjC,uBChDf,IAAAqC,EAAcrD,EAAQ,KACtB,iBAAAqD,MAAA,EAA4CC,EAAAC,EAASF,EAAA,MACrDA,EAAAG,SAAAF,EAAAG,QAAAJ,EAAAG,SAGAE,EADU1D,EAAQ,GAAgE2D,SAClF,WAAAN,GAAA,4BCRAC,EAAAG,QAA2BzD,EAAQ,EAARA,EAA0D,IAKrF4D,KAAA,CAAcN,EAAAC,EAAS,oYAAoY,uCCL3ZvD,EAAAQ,EAAAN,EAAA,sBAAA2D,IAAA7D,EAAAQ,EAAAN,EAAA,sBAAA4D,IAAA,IAAAD,EAAA,WAA0B,IAAAE,EAAAtC,KAAauC,EAAAD,EAAAE,eAA0BC,EAAAH,EAAAI,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBE,YAAA,kBAA6B,CAAAF,EAAA,gBAAqBE,YAAA,eAAAC,MAAA,CAAkCC,uBAAA,EAAAC,kBAAA,KAAiDR,EAAAS,GAAAT,EAAA,cAAAU,GAAyC,OAAAP,EAAA,OAAiB3D,IAAAkE,EAAAnD,KAAA8C,YAAA,yBAAAC,MAAA,CAAiEK,gBAAAD,EAAArD,KAAAuD,MAAAC,MAAAH,EAAAnD,KAAAmD,EAAArD,KAAAyD,UAA4Fd,EAAAS,GAAAC,EAAArD,KAAA,kBAAAY,GAAsD,OAAAkC,EAAA,OAAiB3D,IAAAyB,EAAAoC,YAAA,UAAAU,GAAA,CAAsCC,MAAA,SAAAC,GAAyBA,EAAAC,kBAAyBD,EAAAE,iBAAwBnB,EAAAhC,KAAA0C,EAAAnD,KAAAU,EAAAyC,EAAArD,KAAAuD,UAA+D,CAAAT,EAAA,OAAYG,MAAA,CAAOc,IAAAV,EAAAnD,KAAAU,SAAsC,KAAK,QAC1vB8B,EAAA","file":"static/js/2.48f39bc510b7c0a7fca6.js","sourcesContent":["function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./sticker_picker.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./sticker_picker.js\"\nimport __vue_script__ from \"!!babel-loader!./sticker_picker.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-70972e0c\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./sticker_picker.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* eslint-env browser */\nimport statusPosterService from '../../services/status_poster/status_poster.service.js'\nimport TabSwitcher from '../tab_switcher/tab_switcher.js'\n\nconst StickerPicker = {\n components: {\n TabSwitcher\n },\n data () {\n return {\n meta: {\n stickers: []\n },\n path: ''\n }\n },\n computed: {\n pack () {\n return this.$store.state.instance.stickers || []\n }\n },\n methods: {\n clear () {\n this.meta = {\n stickers: []\n }\n },\n pick (sticker, name) {\n const store = this.$store\n // TODO remove this workaround by finding a way to bypass reuploads\n fetch(sticker)\n .then((res) => {\n res.blob().then((blob) => {\n var file = new File([blob], name, { mimetype: 'image/png' })\n var formData = new FormData()\n formData.append('file', file)\n statusPosterService.uploadMedia({ store, formData })\n .then((fileData) => {\n this.$emit('uploaded', fileData)\n this.clear()\n }, (error) => {\n console.warn(\"Can't attach sticker\")\n console.warn(error)\n this.$emit('upload-failed', 'default')\n })\n })\n })\n }\n }\n}\n\nexport default StickerPicker\n","// style-loader: Adds some css to the DOM by adding a \n","import * as DateUtils from 'src/services/date_utils/date_utils.js'\nimport { uniq } from 'lodash'\n\nexport default {\n name: 'PollForm',\n props: ['visible'],\n data: () => ({\n pollType: 'single',\n options: ['', ''],\n expiryAmount: 10,\n expiryUnit: 'minutes'\n }),\n computed: {\n pollLimits () {\n return this.$store.state.instance.pollLimits\n },\n maxOptions () {\n return this.pollLimits.max_options\n },\n maxLength () {\n return this.pollLimits.max_option_chars\n },\n expiryUnits () {\n const allUnits = ['minutes', 'hours', 'days']\n const expiry = this.convertExpiryFromUnit\n return allUnits.filter(\n unit => this.pollLimits.max_expiration >= expiry(unit, 1)\n )\n },\n minExpirationInCurrentUnit () {\n return Math.ceil(\n this.convertExpiryToUnit(\n this.expiryUnit,\n this.pollLimits.min_expiration\n )\n )\n },\n maxExpirationInCurrentUnit () {\n return Math.floor(\n this.convertExpiryToUnit(\n this.expiryUnit,\n this.pollLimits.max_expiration\n )\n )\n }\n },\n methods: {\n clear () {\n this.pollType = 'single'\n this.options = ['', '']\n this.expiryAmount = 10\n this.expiryUnit = 'minutes'\n },\n nextOption (index) {\n const element = this.$el.querySelector(`#poll-${index + 1}`)\n if (element) {\n element.focus()\n } else {\n // Try adding an option and try focusing on it\n const addedOption = this.addOption()\n if (addedOption) {\n this.$nextTick(function () {\n this.nextOption(index)\n })\n }\n }\n },\n addOption () {\n if (this.options.length < this.maxOptions) {\n this.options.push('')\n return true\n }\n return false\n },\n deleteOption (index, event) {\n if (this.options.length > 2) {\n this.options.splice(index, 1)\n }\n },\n convertExpiryToUnit (unit, amount) {\n // Note: we want seconds and not milliseconds\n switch (unit) {\n case 'minutes': return (1000 * amount) / DateUtils.MINUTE\n case 'hours': return (1000 * amount) / DateUtils.HOUR\n case 'days': return (1000 * amount) / DateUtils.DAY\n }\n },\n convertExpiryFromUnit (unit, amount) {\n // Note: we want seconds and not milliseconds\n switch (unit) {\n case 'minutes': return 0.001 * amount * DateUtils.MINUTE\n case 'hours': return 0.001 * amount * DateUtils.HOUR\n case 'days': return 0.001 * amount * DateUtils.DAY\n }\n },\n expiryAmountChange () {\n this.expiryAmount =\n Math.max(this.minExpirationInCurrentUnit, this.expiryAmount)\n this.expiryAmount =\n Math.min(this.maxExpirationInCurrentUnit, this.expiryAmount)\n this.updatePollToParent()\n },\n updatePollToParent () {\n const expiresIn = this.convertExpiryFromUnit(\n this.expiryUnit,\n this.expiryAmount\n )\n\n const options = uniq(this.options.filter(option => option !== ''))\n if (options.length < 2) {\n this.$emit('update-poll', { error: this.$t('polls.not_enough_options') })\n return\n }\n this.$emit('update-poll', {\n options,\n multiple: this.pollType === 'multiple',\n expiresIn\n })\n }\n }\n}\n","import UserAvatar from '../user_avatar/user_avatar.vue'\nimport RemoteFollow from '../remote_follow/remote_follow.vue'\nimport ProgressButton from '../progress_button/progress_button.vue'\nimport FollowButton from '../follow_button/follow_button.vue'\nimport ModerationTools from '../moderation_tools/moderation_tools.vue'\nimport AccountActions from '../account_actions/account_actions.vue'\nimport { hex2rgb } from '../../services/color_convert/color_convert.js'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\nimport { mapGetters } from 'vuex'\n\nexport default {\n props: [\n 'user', 'switcher', 'selected', 'hideBio', 'rounded', 'bordered', 'allowZoomingAvatar'\n ],\n data () {\n return {\n followRequestInProgress: false,\n betterShadow: this.$store.state.interface.browserSupport.cssFilter\n }\n },\n created () {\n this.$store.dispatch('fetchUserRelationship', this.user.id)\n },\n computed: {\n classes () {\n return [{\n 'user-card-rounded-t': this.rounded === 'top', // set border-top-left-radius and border-top-right-radius\n 'user-card-rounded': this.rounded === true, // set border-radius for all sides\n 'user-card-bordered': this.bordered === true // set border for all sides\n }]\n },\n style () {\n const color = this.$store.getters.mergedConfig.customTheme.colors\n ? this.$store.getters.mergedConfig.customTheme.colors.bg // v2\n : this.$store.getters.mergedConfig.colors.bg // v1\n\n if (color) {\n const rgb = (typeof color === 'string') ? hex2rgb(color) : color\n const tintColor = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .5)`\n\n return {\n backgroundColor: `rgb(${Math.floor(rgb.r * 0.53)}, ${Math.floor(rgb.g * 0.56)}, ${Math.floor(rgb.b * 0.59)})`,\n backgroundImage: [\n `linear-gradient(to bottom, ${tintColor}, ${tintColor})`,\n `url(${this.user.cover_photo})`\n ].join(', ')\n }\n }\n },\n isOtherUser () {\n return this.user.id !== this.$store.state.users.currentUser.id\n },\n subscribeUrl () {\n // eslint-disable-next-line no-undef\n const serverUrl = new URL(this.user.statusnet_profile_url)\n return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`\n },\n loggedIn () {\n return this.$store.state.users.currentUser\n },\n dailyAvg () {\n const days = Math.ceil((new Date() - new Date(this.user.created_at)) / (60 * 60 * 24 * 1000))\n return Math.round(this.user.statuses_count / days)\n },\n userHighlightType: {\n get () {\n const data = this.$store.getters.mergedConfig.highlight[this.user.screen_name]\n return (data && data.type) || 'disabled'\n },\n set (type) {\n const data = this.$store.getters.mergedConfig.highlight[this.user.screen_name]\n if (type !== 'disabled') {\n this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: (data && data.color) || '#FFFFFF', type })\n } else {\n this.$store.dispatch('setHighlight', { user: this.user.screen_name, color: undefined })\n }\n },\n ...mapGetters(['mergedConfig'])\n },\n userHighlightColor: {\n get () {\n const data = this.$store.getters.mergedConfig.highlight[this.user.screen_name]\n return data && data.color\n },\n set (color) {\n this.$store.dispatch('setHighlight', { user: this.user.screen_name, color })\n }\n },\n visibleRole () {\n const rights = this.user.rights\n if (!rights) { return }\n const validRole = rights.admin || rights.moderator\n const roleTitle = rights.admin ? 'admin' : 'moderator'\n return validRole && roleTitle\n },\n ...mapGetters(['mergedConfig'])\n },\n components: {\n UserAvatar,\n RemoteFollow,\n ModerationTools,\n AccountActions,\n ProgressButton,\n FollowButton\n },\n methods: {\n muteUser () {\n this.$store.dispatch('muteUser', this.user.id)\n },\n unmuteUser () {\n this.$store.dispatch('unmuteUser', this.user.id)\n },\n subscribeUser () {\n return this.$store.dispatch('subscribeUser', this.user.id)\n },\n unsubscribeUser () {\n return this.$store.dispatch('unsubscribeUser', this.user.id)\n },\n setProfileView (v) {\n if (this.switcher) {\n const store = this.$store\n store.commit('setProfileView', { v })\n }\n },\n linkClicked ({ target }) {\n if (target.tagName === 'SPAN') {\n target = target.parentNode\n }\n if (target.tagName === 'A') {\n window.open(target.href, '_blank')\n }\n },\n userProfileLink (user) {\n return generateProfileLink(\n user.id, user.screen_name,\n this.$store.state.instance.restrictedNicknames\n )\n },\n zoomAvatar () {\n const attachment = {\n url: this.user.profile_image_url_original,\n mimetype: 'image'\n }\n this.$store.dispatch('setMedia', [attachment])\n this.$store.dispatch('setCurrent', attachment)\n }\n }\n}\n","import StillImage from '../still-image/still-image.vue'\n\nconst UserAvatar = {\n props: [\n 'user',\n 'betterShadow',\n 'compact'\n ],\n data () {\n return {\n showPlaceholder: false\n }\n },\n components: {\n StillImage\n },\n computed: {\n imgSrc () {\n return this.showPlaceholder ? '/images/avi.png' : this.user.profile_image_url_original\n }\n },\n methods: {\n imageLoadError () {\n this.showPlaceholder = true\n }\n },\n watch: {\n src () {\n this.showPlaceholder = false\n }\n }\n}\n\nexport default UserAvatar\n","export default {\n props: [ 'user' ],\n computed: {\n subscribeUrl () {\n // eslint-disable-next-line no-undef\n const serverUrl = new URL(this.user.statusnet_profile_url)\n return `${serverUrl.protocol}//${serverUrl.host}/main/ostatus`\n }\n }\n}\n","\n\n\n","import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'\nexport default {\n props: ['user', 'labelFollowing', 'buttonClass'],\n data () {\n return {\n inProgress: false\n }\n },\n computed: {\n isPressed () {\n return this.inProgress || this.user.following\n },\n title () {\n if (this.inProgress || this.user.following) {\n return this.$t('user_card.follow_unfollow')\n } else if (this.user.requested) {\n return this.$t('user_card.follow_again')\n } else {\n return this.$t('user_card.follow')\n }\n },\n label () {\n if (this.inProgress) {\n return this.$t('user_card.follow_progress')\n } else if (this.user.following) {\n return this.labelFollowing || this.$t('user_card.following')\n } else if (this.user.requested) {\n return this.$t('user_card.follow_sent')\n } else {\n return this.$t('user_card.follow')\n }\n }\n },\n methods: {\n onClick () {\n this.user.following ? this.unfollow() : this.follow()\n },\n follow () {\n this.inProgress = true\n requestFollow(this.user, this.$store).then(() => {\n this.inProgress = false\n })\n },\n unfollow () {\n const store = this.$store\n this.inProgress = true\n requestUnfollow(this.user, store).then(() => {\n this.inProgress = false\n store.commit('removeStatus', { timeline: 'friends', userId: this.user.id })\n })\n }\n }\n}\n","import DialogModal from '../dialog_modal/dialog_modal.vue'\n\nconst FORCE_NSFW = 'mrf_tag:media-force-nsfw'\nconst STRIP_MEDIA = 'mrf_tag:media-strip'\nconst FORCE_UNLISTED = 'mrf_tag:force-unlisted'\nconst DISABLE_REMOTE_SUBSCRIPTION = 'mrf_tag:disable-remote-subscription'\nconst DISABLE_ANY_SUBSCRIPTION = 'mrf_tag:disable-any-subscription'\nconst SANDBOX = 'mrf_tag:sandbox'\nconst QUARANTINE = 'mrf_tag:quarantine'\n\nconst ModerationTools = {\n props: [\n 'user'\n ],\n data () {\n return {\n showDropDown: false,\n tags: {\n FORCE_NSFW,\n STRIP_MEDIA,\n FORCE_UNLISTED,\n DISABLE_REMOTE_SUBSCRIPTION,\n DISABLE_ANY_SUBSCRIPTION,\n SANDBOX,\n QUARANTINE\n },\n showDeleteUserDialog: false\n }\n },\n components: {\n DialogModal\n },\n computed: {\n tagsSet () {\n return new Set(this.user.tags)\n },\n hasTagPolicy () {\n return this.$store.state.instance.tagPolicyAvailable\n }\n },\n methods: {\n hasTag (tagName) {\n return this.tagsSet.has(tagName)\n },\n toggleTag (tag) {\n const store = this.$store\n if (this.tagsSet.has(tag)) {\n store.state.api.backendInteractor.untagUser(this.user, tag).then(response => {\n if (!response.ok) { return }\n store.commit('untagUser', { user: this.user, tag })\n })\n } else {\n store.state.api.backendInteractor.tagUser(this.user, tag).then(response => {\n if (!response.ok) { return }\n store.commit('tagUser', { user: this.user, tag })\n })\n }\n },\n toggleRight (right) {\n const store = this.$store\n if (this.user.rights[right]) {\n store.state.api.backendInteractor.deleteRight(this.user, right).then(response => {\n if (!response.ok) { return }\n store.commit('updateRight', { user: this.user, right: right, value: false })\n })\n } else {\n store.state.api.backendInteractor.addRight(this.user, right).then(response => {\n if (!response.ok) { return }\n store.commit('updateRight', { user: this.user, right: right, value: true })\n })\n }\n },\n toggleActivationStatus () {\n const store = this.$store\n const status = !!this.user.deactivated\n store.state.api.backendInteractor.setActivationStatus(this.user, status).then(response => {\n if (!response.ok) { return }\n store.commit('updateActivationStatus', { user: this.user, status: status })\n })\n },\n deleteUserDialog (show) {\n this.showDeleteUserDialog = show\n },\n deleteUser () {\n const store = this.$store\n const user = this.user\n const { id, name } = user\n store.state.api.backendInteractor.deleteUser(user)\n .then(e => {\n this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id)\n const isProfile = this.$route.name === 'external-user-profile' || this.$route.name === 'user-profile'\n const isTargetUser = this.$route.params.name === name || this.$route.params.id === id\n if (isProfile && isTargetUser) {\n window.history.back()\n }\n })\n }\n }\n}\n\nexport default ModerationTools\n","const DialogModal = {\n props: {\n darkOverlay: {\n default: true,\n type: Boolean\n },\n onCancel: {\n default: () => {},\n type: Function\n }\n }\n}\n\nexport default DialogModal\n","import ProgressButton from '../progress_button/progress_button.vue'\n\nconst AccountActions = {\n props: [\n 'user'\n ],\n data () {\n return { }\n },\n components: {\n ProgressButton\n },\n methods: {\n showRepeats () {\n this.$store.dispatch('showReblogs', this.user.id)\n },\n hideRepeats () {\n this.$store.dispatch('hideReblogs', this.user.id)\n },\n blockUser () {\n this.$store.dispatch('blockUser', this.user.id)\n },\n unblockUser () {\n this.$store.dispatch('unblockUser', this.user.id)\n },\n reportUser () {\n this.$store.dispatch('openUserReportingModal', this.user.id)\n },\n mentionUser () {\n this.$store.dispatch('openPostStatusModal', { replyTo: true, repliedUser: this.user })\n }\n }\n}\n\nexport default AccountActions\n","import Attachment from '../attachment/attachment.vue'\nimport { chunk, last, dropRight, sumBy } from 'lodash'\n\nconst Gallery = {\n props: [\n 'attachments',\n 'nsfw',\n 'setMedia'\n ],\n data () {\n return {\n sizes: {}\n }\n },\n components: { Attachment },\n computed: {\n rows () {\n if (!this.attachments) {\n return []\n }\n const rows = chunk(this.attachments, 3)\n if (last(rows).length === 1 && rows.length > 1) {\n // if 1 attachment on last row -> add it to the previous row instead\n const lastAttachment = last(rows)[0]\n const allButLastRow = dropRight(rows)\n last(allButLastRow).push(lastAttachment)\n return allButLastRow\n }\n return rows\n },\n useContainFit () {\n return this.$store.getters.mergedConfig.useContainFit\n }\n },\n methods: {\n onNaturalSizeLoad (id, size) {\n this.$set(this.sizes, id, size)\n },\n rowStyle (itemsPerRow) {\n return { 'padding-bottom': `${(100 / (itemsPerRow + 0.6))}%` }\n },\n itemStyle (id, row) {\n const total = sumBy(row, item => this.getAspectRatio(item.id))\n return { flex: `${this.getAspectRatio(id) / total} 1 0%` }\n },\n getAspectRatio (id) {\n const size = this.sizes[id]\n return size ? size.width / size.height : 1\n }\n }\n}\n\nexport default Gallery\n","const LinkPreview = {\n name: 'LinkPreview',\n props: [\n 'card',\n 'size',\n 'nsfw'\n ],\n data () {\n return {\n imageLoaded: false\n }\n },\n computed: {\n useImage () {\n // Currently BE shoudn't give cards if tagged NSFW, this is a bit paranoid\n // as it makes sure to hide the image if somehow NSFW tagged preview can\n // exist.\n return this.card.image && !this.nsfw && this.size !== 'hide'\n },\n useDescription () {\n return this.card.description && /\\S/.test(this.card.description)\n }\n },\n created () {\n if (this.useImage) {\n const newImg = new Image()\n newImg.onload = () => {\n this.imageLoaded = true\n }\n newImg.src = this.card.image\n }\n }\n}\n\nexport default LinkPreview\n","import UserAvatar from '../user_avatar/user_avatar.vue'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\n\nconst AvatarList = {\n props: ['users'],\n computed: {\n slicedUsers () {\n return this.users ? this.users.slice(0, 15) : []\n }\n },\n components: {\n UserAvatar\n },\n methods: {\n userProfileLink (user) {\n return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)\n }\n }\n}\n\nexport default AvatarList\n","import { find } from 'lodash'\n\nconst StatusPopover = {\n name: 'StatusPopover',\n props: [\n 'statusId'\n ],\n data () {\n return {\n popperOptions: {\n modifiers: {\n preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }\n }\n }\n }\n },\n computed: {\n status () {\n return find(this.$store.state.statuses.allStatuses, { id: this.statusId })\n }\n },\n components: {\n Status: () => import('../status/status.vue')\n },\n methods: {\n enter () {\n if (!this.status) {\n this.$store.dispatch('fetchStatus', this.statusId)\n }\n }\n }\n}\n\nexport default StatusPopover\n","import { reduce, filter, findIndex, clone, get } from 'lodash'\nimport Status from '../status/status.vue'\n\nconst sortById = (a, b) => {\n const idA = a.type === 'retweet' ? a.retweeted_status.id : a.id\n const idB = b.type === 'retweet' ? b.retweeted_status.id : b.id\n const seqA = Number(idA)\n const seqB = Number(idB)\n const isSeqA = !Number.isNaN(seqA)\n const isSeqB = !Number.isNaN(seqB)\n if (isSeqA && isSeqB) {\n return seqA < seqB ? -1 : 1\n } else if (isSeqA && !isSeqB) {\n return -1\n } else if (!isSeqA && isSeqB) {\n return 1\n } else {\n return idA < idB ? -1 : 1\n }\n}\n\nconst sortAndFilterConversation = (conversation, statusoid) => {\n if (statusoid.type === 'retweet') {\n conversation = filter(\n conversation,\n (status) => (status.type === 'retweet' || status.id !== statusoid.retweeted_status.id)\n )\n } else {\n conversation = filter(conversation, (status) => status.type !== 'retweet')\n }\n return conversation.filter(_ => _).sort(sortById)\n}\n\nconst conversation = {\n data () {\n return {\n highlight: null,\n expanded: false\n }\n },\n props: [\n 'statusId',\n 'collapsable',\n 'isPage',\n 'pinnedStatusIdsObject',\n 'inProfile'\n ],\n created () {\n if (this.isPage) {\n this.fetchConversation()\n }\n },\n computed: {\n status () {\n return this.$store.state.statuses.allStatusesObject[this.statusId]\n },\n originalStatusId () {\n if (this.status.retweeted_status) {\n return this.status.retweeted_status.id\n } else {\n return this.statusId\n }\n },\n conversationId () {\n return this.getConversationId(this.statusId)\n },\n conversation () {\n if (!this.status) {\n return []\n }\n\n if (!this.isExpanded) {\n return [this.status]\n }\n\n const conversation = clone(this.$store.state.statuses.conversationsObject[this.conversationId])\n const statusIndex = findIndex(conversation, { id: this.originalStatusId })\n if (statusIndex !== -1) {\n conversation[statusIndex] = this.status\n }\n\n return sortAndFilterConversation(conversation, this.status)\n },\n replies () {\n let i = 1\n // eslint-disable-next-line camelcase\n return reduce(this.conversation, (result, { id, in_reply_to_status_id }) => {\n /* eslint-disable camelcase */\n const irid = in_reply_to_status_id\n /* eslint-enable camelcase */\n if (irid) {\n result[irid] = result[irid] || []\n result[irid].push({\n name: `#${i}`,\n id: id\n })\n }\n i++\n return result\n }, {})\n },\n isExpanded () {\n return this.expanded || this.isPage\n }\n },\n components: {\n Status\n },\n watch: {\n statusId (newVal, oldVal) {\n const newConversationId = this.getConversationId(newVal)\n const oldConversationId = this.getConversationId(oldVal)\n if (newConversationId && oldConversationId && newConversationId === oldConversationId) {\n this.setHighlight(this.originalStatusId)\n } else {\n this.fetchConversation()\n }\n },\n expanded (value) {\n if (value) {\n this.fetchConversation()\n }\n }\n },\n methods: {\n fetchConversation () {\n if (this.status) {\n this.$store.state.api.backendInteractor.fetchConversation({ id: this.statusId })\n .then(({ ancestors, descendants }) => {\n this.$store.dispatch('addNewStatuses', { statuses: ancestors })\n this.$store.dispatch('addNewStatuses', { statuses: descendants })\n this.setHighlight(this.originalStatusId)\n })\n } else {\n this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusId })\n .then((status) => {\n this.$store.dispatch('addNewStatuses', { statuses: [status] })\n this.fetchConversation()\n })\n }\n },\n getReplies (id) {\n return this.replies[id] || []\n },\n focused (id) {\n return (this.isExpanded) && id === this.statusId\n },\n setHighlight (id) {\n if (!id) return\n this.highlight = id\n this.$store.dispatch('fetchFavsAndRepeats', id)\n },\n getHighlight () {\n return this.isExpanded ? this.highlight : null\n },\n toggleExpanded () {\n this.expanded = !this.expanded\n },\n getConversationId (statusId) {\n const status = this.$store.state.statuses.allStatusesObject[statusId]\n return get(status, 'retweeted_status.statusnet_conversation_id', get(status, 'statusnet_conversation_id'))\n }\n }\n}\n\nexport default conversation\n","import Timeline from '../timeline/timeline.vue'\nconst PublicAndExternalTimeline = {\n components: {\n Timeline\n },\n computed: {\n timeline () { return this.$store.state.statuses.timelines.publicAndExternal }\n },\n created () {\n this.$store.dispatch('startFetchingTimeline', { timeline: 'publicAndExternal' })\n },\n destroyed () {\n this.$store.dispatch('stopFetching', 'publicAndExternal')\n }\n}\n\nexport default PublicAndExternalTimeline\n","import Timeline from '../timeline/timeline.vue'\nconst FriendsTimeline = {\n components: {\n Timeline\n },\n computed: {\n timeline () { return this.$store.state.statuses.timelines.friends }\n }\n}\n\nexport default FriendsTimeline\n","import Timeline from '../timeline/timeline.vue'\n\nconst TagTimeline = {\n created () {\n this.$store.commit('clearTimeline', { timeline: 'tag' })\n this.$store.dispatch('startFetchingTimeline', { timeline: 'tag', tag: this.tag })\n },\n components: {\n Timeline\n },\n computed: {\n tag () { return this.$route.params.tag },\n timeline () { return this.$store.state.statuses.timelines.tag }\n },\n watch: {\n tag () {\n this.$store.commit('clearTimeline', { timeline: 'tag' })\n this.$store.dispatch('startFetchingTimeline', { timeline: 'tag', tag: this.tag })\n }\n },\n destroyed () {\n this.$store.dispatch('stopFetching', 'tag')\n }\n}\n\nexport default TagTimeline\n","import Conversation from '../conversation/conversation.vue'\n\nconst conversationPage = {\n components: {\n Conversation\n },\n computed: {\n statusId () {\n return this.$route.params.id\n }\n }\n}\n\nexport default conversationPage\n","import Notifications from '../notifications/notifications.vue'\n\nconst tabModeDict = {\n mentions: ['mention'],\n 'likes+repeats': ['repeat', 'like'],\n follows: ['follow']\n}\n\nconst Interactions = {\n data () {\n return {\n filterMode: tabModeDict['mentions']\n }\n },\n methods: {\n onModeSwitch (key) {\n this.filterMode = tabModeDict[key]\n }\n },\n components: {\n Notifications\n }\n}\n\nexport default Interactions\n","import Notification from '../notification/notification.vue'\nimport notificationsFetcher from '../../services/notifications_fetcher/notifications_fetcher.service.js'\nimport {\n notificationsFromStore,\n visibleNotificationsFromStore,\n unseenNotificationsFromStore\n} from '../../services/notification_utils/notification_utils.js'\n\nconst Notifications = {\n props: {\n // Disables display of panel header\n noHeading: Boolean,\n // Disables panel styles, unread mark, potentially other notification-related actions\n // meant for \"Interactions\" timeline\n minimalMode: Boolean,\n // Custom filter mode, an array of strings, possible values 'mention', 'repeat', 'like', 'follow', used to override global filter for use in \"Interactions\" timeline\n filterMode: Array\n },\n data () {\n return {\n bottomedOut: false\n }\n },\n computed: {\n mainClass () {\n return this.minimalMode ? '' : 'panel panel-default'\n },\n notifications () {\n return notificationsFromStore(this.$store)\n },\n error () {\n return this.$store.state.statuses.notifications.error\n },\n unseenNotifications () {\n return unseenNotificationsFromStore(this.$store)\n },\n visibleNotifications () {\n return visibleNotificationsFromStore(this.$store, this.filterMode)\n },\n unseenCount () {\n return this.unseenNotifications.length\n },\n loading () {\n return this.$store.state.statuses.notifications.loading\n }\n },\n components: {\n Notification\n },\n watch: {\n unseenCount (count) {\n if (count > 0) {\n this.$store.dispatch('setPageTitle', `(${count})`)\n } else {\n this.$store.dispatch('setPageTitle', '')\n }\n }\n },\n methods: {\n markAsSeen () {\n this.$store.dispatch('markNotificationsAsSeen')\n },\n fetchOlderNotifications () {\n if (this.loading) {\n return\n }\n\n const store = this.$store\n const credentials = store.state.users.currentUser.credentials\n store.commit('setNotificationsLoading', { value: true })\n notificationsFetcher.fetchAndUpdate({\n store,\n credentials,\n older: true\n }).then(notifs => {\n store.commit('setNotificationsLoading', { value: false })\n if (notifs.length === 0) {\n this.bottomedOut = true\n }\n })\n }\n }\n}\n\nexport default Notifications\n","import Status from '../status/status.vue'\nimport UserAvatar from '../user_avatar/user_avatar.vue'\nimport UserCard from '../user_card/user_card.vue'\nimport Timeago from '../timeago/timeago.vue'\nimport { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\n\nconst Notification = {\n data () {\n return {\n userExpanded: false,\n betterShadow: this.$store.state.interface.browserSupport.cssFilter,\n unmuted: false\n }\n },\n props: [ 'notification' ],\n components: {\n Status,\n UserAvatar,\n UserCard,\n Timeago\n },\n methods: {\n toggleUserExpanded () {\n this.userExpanded = !this.userExpanded\n },\n generateUserProfileLink (user) {\n return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)\n },\n getUser (notification) {\n return this.$store.state.users.usersObject[notification.from_profile.id]\n },\n toggleMute () {\n this.unmuted = !this.unmuted\n }\n },\n computed: {\n userClass () {\n return highlightClass(this.notification.from_profile)\n },\n userStyle () {\n const highlight = this.$store.getters.mergedConfig.highlight\n const user = this.notification.from_profile\n return highlightStyle(highlight[user.screen_name])\n },\n userInStore () {\n return this.$store.getters.findUser(this.notification.from_profile.id)\n },\n user () {\n if (this.userInStore) {\n return this.userInStore\n }\n return this.notification.from_profile\n },\n userProfileLink () {\n return this.generateUserProfileLink(this.user)\n },\n needMute () {\n return this.user.muted\n }\n }\n}\n\nexport default Notification\n","import Timeline from '../timeline/timeline.vue'\n\nconst DMs = {\n computed: {\n timeline () {\n return this.$store.state.statuses.timelines.dms\n }\n },\n components: {\n Timeline\n }\n}\n\nexport default DMs\n","import get from 'lodash/get'\nimport UserCard from '../user_card/user_card.vue'\nimport FollowCard from '../follow_card/follow_card.vue'\nimport Timeline from '../timeline/timeline.vue'\nimport Conversation from '../conversation/conversation.vue'\nimport List from '../list/list.vue'\nimport withLoadMore from '../../hocs/with_load_more/with_load_more'\n\nconst FollowerList = withLoadMore({\n fetch: (props, $store) => $store.dispatch('fetchFollowers', props.userId),\n select: (props, $store) => get($store.getters.findUser(props.userId), 'followerIds', []).map(id => $store.getters.findUser(id)),\n destroy: (props, $store) => $store.dispatch('clearFollowers', props.userId),\n childPropName: 'items',\n additionalPropNames: ['userId']\n})(List)\n\nconst FriendList = withLoadMore({\n fetch: (props, $store) => $store.dispatch('fetchFriends', props.userId),\n select: (props, $store) => get($store.getters.findUser(props.userId), 'friendIds', []).map(id => $store.getters.findUser(id)),\n destroy: (props, $store) => $store.dispatch('clearFriends', props.userId),\n childPropName: 'items',\n additionalPropNames: ['userId']\n})(List)\n\nconst defaultTabKey = 'statuses'\n\nconst UserProfile = {\n data () {\n return {\n error: false,\n userId: null,\n tab: defaultTabKey\n }\n },\n created () {\n const routeParams = this.$route.params\n this.load(routeParams.name || routeParams.id)\n this.tab = get(this.$route, 'query.tab', defaultTabKey)\n },\n destroyed () {\n this.stopFetching()\n },\n computed: {\n timeline () {\n return this.$store.state.statuses.timelines.user\n },\n favorites () {\n return this.$store.state.statuses.timelines.favorites\n },\n media () {\n return this.$store.state.statuses.timelines.media\n },\n isUs () {\n return this.userId && this.$store.state.users.currentUser.id &&\n this.userId === this.$store.state.users.currentUser.id\n },\n user () {\n return this.$store.getters.findUser(this.userId)\n },\n isExternal () {\n return this.$route.name === 'external-user-profile'\n },\n followsTabVisible () {\n return this.isUs || !this.user.hide_follows\n },\n followersTabVisible () {\n return this.isUs || !this.user.hide_followers\n }\n },\n methods: {\n load (userNameOrId) {\n const startFetchingTimeline = (timeline, userId) => {\n // Clear timeline only if load another user's profile\n if (userId !== this.$store.state.statuses.timelines[timeline].userId) {\n this.$store.commit('clearTimeline', { timeline })\n }\n this.$store.dispatch('startFetchingTimeline', { timeline, userId })\n }\n\n const loadById = (userId) => {\n this.userId = userId\n startFetchingTimeline('user', userId)\n startFetchingTimeline('media', userId)\n if (this.isUs) {\n startFetchingTimeline('favorites', userId)\n }\n // Fetch all pinned statuses immediately\n this.$store.dispatch('fetchPinnedStatuses', userId)\n }\n\n // Reset view\n this.userId = null\n this.error = false\n\n // Check if user data is already loaded in store\n const user = this.$store.getters.findUser(userNameOrId)\n if (user) {\n loadById(user.id)\n } else {\n this.$store.dispatch('fetchUser', userNameOrId)\n .then(({ id }) => loadById(id))\n .catch((reason) => {\n const errorMessage = get(reason, 'error.error')\n if (errorMessage === 'No user with such user_id') { // Known error\n this.error = this.$t('user_profile.profile_does_not_exist')\n } else if (errorMessage) {\n this.error = errorMessage\n } else {\n this.error = this.$t('user_profile.profile_loading_error')\n }\n })\n }\n },\n stopFetching () {\n this.$store.dispatch('stopFetching', 'user')\n this.$store.dispatch('stopFetching', 'favorites')\n this.$store.dispatch('stopFetching', 'media')\n },\n switchUser (userNameOrId) {\n this.stopFetching()\n this.load(userNameOrId)\n },\n onTabSwitch (tab) {\n this.tab = tab\n this.$router.replace({ query: { tab } })\n }\n },\n watch: {\n '$route.params.id': function (newVal) {\n if (newVal) {\n this.switchUser(newVal)\n }\n },\n '$route.params.name': function (newVal) {\n if (newVal) {\n this.switchUser(newVal)\n }\n },\n '$route.query': function (newVal) {\n this.tab = newVal.tab || defaultTabKey\n }\n },\n components: {\n UserCard,\n Timeline,\n FollowerList,\n FriendList,\n FollowCard,\n Conversation\n }\n}\n\nexport default UserProfile\n","import BasicUserCard from '../basic_user_card/basic_user_card.vue'\nimport RemoteFollow from '../remote_follow/remote_follow.vue'\nimport FollowButton from '../follow_button/follow_button.vue'\n\nconst FollowCard = {\n props: [\n 'user',\n 'noFollowsYou'\n ],\n components: {\n BasicUserCard,\n RemoteFollow,\n FollowButton\n },\n computed: {\n isMe () {\n return this.$store.state.users.currentUser.id === this.user.id\n },\n loggedIn () {\n return this.$store.state.users.currentUser\n }\n }\n}\n\nexport default FollowCard\n","import UserCard from '../user_card/user_card.vue'\nimport UserAvatar from '../user_avatar/user_avatar.vue'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\n\nconst BasicUserCard = {\n props: [\n 'user'\n ],\n data () {\n return {\n userExpanded: false\n }\n },\n components: {\n UserCard,\n UserAvatar\n },\n methods: {\n toggleUserExpanded () {\n this.userExpanded = !this.userExpanded\n },\n userProfileLink (user) {\n return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)\n }\n }\n}\n\nexport default BasicUserCard\n","\n\n\n\n\n","import FollowCard from '../follow_card/follow_card.vue'\nimport Conversation from '../conversation/conversation.vue'\nimport Status from '../status/status.vue'\nimport map from 'lodash/map'\n\nconst Search = {\n components: {\n FollowCard,\n Conversation,\n Status\n },\n props: [\n 'query'\n ],\n data () {\n return {\n loaded: false,\n loading: false,\n searchTerm: this.query || '',\n userIds: [],\n statuses: [],\n hashtags: [],\n currenResultTab: 'statuses'\n }\n },\n computed: {\n users () {\n return this.userIds.map(userId => this.$store.getters.findUser(userId))\n },\n visibleStatuses () {\n const allStatusesObject = this.$store.state.statuses.allStatusesObject\n\n return this.statuses.filter(status =>\n allStatusesObject[status.id] && !allStatusesObject[status.id].deleted\n )\n }\n },\n mounted () {\n this.search(this.query)\n },\n watch: {\n query (newValue) {\n this.searchTerm = newValue\n this.search(newValue)\n }\n },\n methods: {\n newQuery (query) {\n this.$router.push({ name: 'search', query: { query } })\n this.$refs.searchInput.focus()\n },\n search (query) {\n if (!query) {\n this.loading = false\n return\n }\n\n this.loading = true\n this.userIds = []\n this.statuses = []\n this.hashtags = []\n this.$refs.searchInput.blur()\n\n this.$store.dispatch('search', { q: query, resolve: true })\n .then(data => {\n this.loading = false\n this.userIds = map(data.accounts, 'id')\n this.statuses = data.statuses\n this.hashtags = data.hashtags\n this.currenResultTab = this.getActiveTab()\n this.loaded = true\n })\n },\n resultCount (tabName) {\n const length = this[tabName].length\n return length === 0 ? '' : ` (${length})`\n },\n onResultTabSwitch (key) {\n this.currenResultTab = key\n },\n getActiveTab () {\n if (this.visibleStatuses.length > 0) {\n return 'statuses'\n } else if (this.users.length > 0) {\n return 'people'\n } else if (this.hashtags.length > 0) {\n return 'hashtags'\n }\n\n return 'statuses'\n },\n lastHistoryRecord (hashtag) {\n return hashtag.history && hashtag.history[0]\n }\n }\n}\n\nexport default Search\n","/* eslint-env browser */\nimport { filter, trim } from 'lodash'\n\nimport TabSwitcher from '../tab_switcher/tab_switcher.js'\nimport StyleSwitcher from '../style_switcher/style_switcher.vue'\nimport InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue'\nimport { extractCommit } from '../../services/version/version.service'\nimport { instanceDefaultProperties, defaultState as configDefaultState } from '../../modules/config.js'\nimport Checkbox from '../checkbox/checkbox.vue'\n\nconst pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/'\nconst pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/'\n\nconst multiChoiceProperties = [\n 'postContentType',\n 'subjectLineBehavior'\n]\n\nconst settings = {\n data () {\n const instance = this.$store.state.instance\n\n return {\n loopSilentAvailable:\n // Firefox\n Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||\n // Chrome-likes\n Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||\n // Future spec, still not supported in Nightly 63 as of 08/2018\n Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks'),\n\n backendVersion: instance.backendVersion,\n frontendVersion: instance.frontendVersion\n }\n },\n components: {\n TabSwitcher,\n StyleSwitcher,\n InterfaceLanguageSwitcher,\n Checkbox\n },\n computed: {\n user () {\n return this.$store.state.users.currentUser\n },\n currentSaveStateNotice () {\n return this.$store.state.interface.settings.currentSaveStateNotice\n },\n postFormats () {\n return this.$store.state.instance.postFormats || []\n },\n instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },\n frontendVersionLink () {\n return pleromaFeCommitUrl + this.frontendVersion\n },\n backendVersionLink () {\n return pleromaBeCommitUrl + extractCommit(this.backendVersion)\n },\n // Getting localized values for instance-default properties\n ...instanceDefaultProperties\n .filter(key => multiChoiceProperties.includes(key))\n .map(key => [\n key + 'DefaultValue',\n function () {\n return this.$store.getters.instanceDefaultConfig[key]\n }\n ])\n .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),\n ...instanceDefaultProperties\n .filter(key => !multiChoiceProperties.includes(key))\n .map(key => [\n key + 'LocalizedValue',\n function () {\n return this.$t('settings.values.' + this.$store.getters.instanceDefaultConfig[key])\n }\n ])\n .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),\n // Generating computed values for vuex properties\n ...Object.keys(configDefaultState)\n .map(key => [key, {\n get () { return this.$store.getters.mergedConfig[key] },\n set (value) {\n this.$store.dispatch('setOption', { name: key, value })\n }\n }])\n .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),\n // Special cases (need to transform values)\n muteWordsString: {\n get () { return this.$store.getters.mergedConfig.muteWords.join('\\n') },\n set (value) {\n this.$store.dispatch('setOption', {\n name: 'muteWords',\n value: filter(value.split('\\n'), (word) => trim(word).length > 0)\n })\n }\n }\n },\n // Updating nested properties\n watch: {\n notificationVisibility: {\n handler (value) {\n this.$store.dispatch('setOption', {\n name: 'notificationVisibility',\n value: this.$store.getters.mergedConfig.notificationVisibility\n })\n },\n deep: true\n }\n }\n}\n\nexport default settings\n","import { rgb2hex, hex2rgb, getContrastRatio, alphaBlend } from '../../services/color_convert/color_convert.js'\nimport { set, delete as del } from 'vue'\nimport { generateColors, generateShadows, generateRadii, generateFonts, composePreset, getThemes } from '../../services/style_setter/style_setter.js'\nimport ColorInput from '../color_input/color_input.vue'\nimport RangeInput from '../range_input/range_input.vue'\nimport OpacityInput from '../opacity_input/opacity_input.vue'\nimport ShadowControl from '../shadow_control/shadow_control.vue'\nimport FontControl from '../font_control/font_control.vue'\nimport ContrastRatio from '../contrast_ratio/contrast_ratio.vue'\nimport TabSwitcher from '../tab_switcher/tab_switcher.js'\nimport Preview from './preview.vue'\nimport ExportImport from '../export_import/export_import.vue'\nimport Checkbox from '../checkbox/checkbox.vue'\n\n// List of color values used in v1\nconst v1OnlyNames = [\n 'bg',\n 'fg',\n 'text',\n 'link',\n 'cRed',\n 'cGreen',\n 'cBlue',\n 'cOrange'\n].map(_ => _ + 'ColorLocal')\n\nexport default {\n data () {\n return {\n availableStyles: [],\n selected: this.$store.getters.mergedConfig.theme,\n\n previewShadows: {},\n previewColors: {},\n previewRadii: {},\n previewFonts: {},\n\n shadowsInvalid: true,\n colorsInvalid: true,\n radiiInvalid: true,\n\n keepColor: false,\n keepShadows: false,\n keepOpacity: false,\n keepRoundness: false,\n keepFonts: false,\n\n textColorLocal: '',\n linkColorLocal: '',\n\n bgColorLocal: '',\n bgOpacityLocal: undefined,\n\n fgColorLocal: '',\n fgTextColorLocal: undefined,\n fgLinkColorLocal: undefined,\n\n btnColorLocal: undefined,\n btnTextColorLocal: undefined,\n btnOpacityLocal: undefined,\n\n inputColorLocal: undefined,\n inputTextColorLocal: undefined,\n inputOpacityLocal: undefined,\n\n panelColorLocal: undefined,\n panelTextColorLocal: undefined,\n panelLinkColorLocal: undefined,\n panelFaintColorLocal: undefined,\n panelOpacityLocal: undefined,\n\n topBarColorLocal: undefined,\n topBarTextColorLocal: undefined,\n topBarLinkColorLocal: undefined,\n\n alertErrorColorLocal: undefined,\n alertWarningColorLocal: undefined,\n\n badgeOpacityLocal: undefined,\n badgeNotificationColorLocal: undefined,\n\n borderColorLocal: undefined,\n borderOpacityLocal: undefined,\n\n faintColorLocal: undefined,\n faintOpacityLocal: undefined,\n faintLinkColorLocal: undefined,\n\n cRedColorLocal: '',\n cBlueColorLocal: '',\n cGreenColorLocal: '',\n cOrangeColorLocal: '',\n\n shadowSelected: undefined,\n shadowsLocal: {},\n fontsLocal: {},\n\n btnRadiusLocal: '',\n inputRadiusLocal: '',\n checkboxRadiusLocal: '',\n panelRadiusLocal: '',\n avatarRadiusLocal: '',\n avatarAltRadiusLocal: '',\n attachmentRadiusLocal: '',\n tooltipRadiusLocal: ''\n }\n },\n created () {\n const self = this\n\n getThemes().then((themesComplete) => {\n self.availableStyles = themesComplete\n })\n },\n mounted () {\n this.normalizeLocalState(this.$store.getters.mergedConfig.customTheme)\n if (typeof this.shadowSelected === 'undefined') {\n this.shadowSelected = this.shadowsAvailable[0]\n }\n },\n computed: {\n selectedVersion () {\n return Array.isArray(this.selected) ? 1 : 2\n },\n currentColors () {\n return {\n bg: this.bgColorLocal,\n text: this.textColorLocal,\n link: this.linkColorLocal,\n\n fg: this.fgColorLocal,\n fgText: this.fgTextColorLocal,\n fgLink: this.fgLinkColorLocal,\n\n panel: this.panelColorLocal,\n panelText: this.panelTextColorLocal,\n panelLink: this.panelLinkColorLocal,\n panelFaint: this.panelFaintColorLocal,\n\n input: this.inputColorLocal,\n inputText: this.inputTextColorLocal,\n\n topBar: this.topBarColorLocal,\n topBarText: this.topBarTextColorLocal,\n topBarLink: this.topBarLinkColorLocal,\n\n btn: this.btnColorLocal,\n btnText: this.btnTextColorLocal,\n\n alertError: this.alertErrorColorLocal,\n alertWarning: this.alertWarningColorLocal,\n badgeNotification: this.badgeNotificationColorLocal,\n\n faint: this.faintColorLocal,\n faintLink: this.faintLinkColorLocal,\n border: this.borderColorLocal,\n\n cRed: this.cRedColorLocal,\n cBlue: this.cBlueColorLocal,\n cGreen: this.cGreenColorLocal,\n cOrange: this.cOrangeColorLocal\n }\n },\n currentOpacity () {\n return {\n bg: this.bgOpacityLocal,\n btn: this.btnOpacityLocal,\n input: this.inputOpacityLocal,\n panel: this.panelOpacityLocal,\n topBar: this.topBarOpacityLocal,\n border: this.borderOpacityLocal,\n faint: this.faintOpacityLocal\n }\n },\n currentRadii () {\n return {\n btn: this.btnRadiusLocal,\n input: this.inputRadiusLocal,\n checkbox: this.checkboxRadiusLocal,\n panel: this.panelRadiusLocal,\n avatar: this.avatarRadiusLocal,\n avatarAlt: this.avatarAltRadiusLocal,\n tooltip: this.tooltipRadiusLocal,\n attachment: this.attachmentRadiusLocal\n }\n },\n preview () {\n return composePreset(this.previewColors, this.previewRadii, this.previewShadows, this.previewFonts)\n },\n previewTheme () {\n if (!this.preview.theme.colors) return { colors: {}, opacity: {}, radii: {}, shadows: {}, fonts: {} }\n return this.preview.theme\n },\n // This needs optimization maybe\n previewContrast () {\n if (!this.previewTheme.colors.bg) return {}\n const colors = this.previewTheme.colors\n const opacity = this.previewTheme.opacity\n if (!colors.bg) return {}\n const hints = (ratio) => ({\n text: ratio.toPrecision(3) + ':1',\n // AA level, AAA level\n aa: ratio >= 4.5,\n aaa: ratio >= 7,\n // same but for 18pt+ texts\n laa: ratio >= 3,\n laaa: ratio >= 4.5\n })\n\n // fgsfds :DDDD\n const fgs = {\n text: hex2rgb(colors.text),\n panelText: hex2rgb(colors.panelText),\n panelLink: hex2rgb(colors.panelLink),\n btnText: hex2rgb(colors.btnText),\n topBarText: hex2rgb(colors.topBarText),\n inputText: hex2rgb(colors.inputText),\n\n link: hex2rgb(colors.link),\n topBarLink: hex2rgb(colors.topBarLink),\n\n red: hex2rgb(colors.cRed),\n green: hex2rgb(colors.cGreen),\n blue: hex2rgb(colors.cBlue),\n orange: hex2rgb(colors.cOrange)\n }\n\n const bgs = {\n bg: hex2rgb(colors.bg),\n btn: hex2rgb(colors.btn),\n panel: hex2rgb(colors.panel),\n topBar: hex2rgb(colors.topBar),\n input: hex2rgb(colors.input),\n alertError: hex2rgb(colors.alertError),\n alertWarning: hex2rgb(colors.alertWarning),\n badgeNotification: hex2rgb(colors.badgeNotification)\n }\n\n /* This is a bit confusing because \"bottom layer\" used is text color\n * This is done to get worst case scenario when background below transparent\n * layer matches text color, making it harder to read the lower alpha is.\n */\n const ratios = {\n bgText: getContrastRatio(alphaBlend(bgs.bg, opacity.bg, fgs.text), fgs.text),\n bgLink: getContrastRatio(alphaBlend(bgs.bg, opacity.bg, fgs.link), fgs.link),\n bgRed: getContrastRatio(alphaBlend(bgs.bg, opacity.bg, fgs.red), fgs.red),\n bgGreen: getContrastRatio(alphaBlend(bgs.bg, opacity.bg, fgs.green), fgs.green),\n bgBlue: getContrastRatio(alphaBlend(bgs.bg, opacity.bg, fgs.blue), fgs.blue),\n bgOrange: getContrastRatio(alphaBlend(bgs.bg, opacity.bg, fgs.orange), fgs.orange),\n\n tintText: getContrastRatio(alphaBlend(bgs.bg, 0.5, fgs.panelText), fgs.text),\n\n panelText: getContrastRatio(alphaBlend(bgs.panel, opacity.panel, fgs.panelText), fgs.panelText),\n panelLink: getContrastRatio(alphaBlend(bgs.panel, opacity.panel, fgs.panelLink), fgs.panelLink),\n\n btnText: getContrastRatio(alphaBlend(bgs.btn, opacity.btn, fgs.btnText), fgs.btnText),\n\n inputText: getContrastRatio(alphaBlend(bgs.input, opacity.input, fgs.inputText), fgs.inputText),\n\n topBarText: getContrastRatio(alphaBlend(bgs.topBar, opacity.topBar, fgs.topBarText), fgs.topBarText),\n topBarLink: getContrastRatio(alphaBlend(bgs.topBar, opacity.topBar, fgs.topBarLink), fgs.topBarLink)\n }\n\n return Object.entries(ratios).reduce((acc, [k, v]) => { acc[k] = hints(v); return acc }, {})\n },\n previewRules () {\n if (!this.preview.rules) return ''\n return [\n ...Object.values(this.preview.rules),\n 'color: var(--text)',\n 'font-family: var(--interfaceFont, sans-serif)'\n ].join(';')\n },\n shadowsAvailable () {\n return Object.keys(this.previewTheme.shadows).sort()\n },\n currentShadowOverriden: {\n get () {\n return !!this.currentShadow\n },\n set (val) {\n if (val) {\n set(this.shadowsLocal, this.shadowSelected, this.currentShadowFallback.map(_ => Object.assign({}, _)))\n } else {\n del(this.shadowsLocal, this.shadowSelected)\n }\n }\n },\n currentShadowFallback () {\n return this.previewTheme.shadows[this.shadowSelected]\n },\n currentShadow: {\n get () {\n return this.shadowsLocal[this.shadowSelected]\n },\n set (v) {\n set(this.shadowsLocal, this.shadowSelected, v)\n }\n },\n themeValid () {\n return !this.shadowsInvalid && !this.colorsInvalid && !this.radiiInvalid\n },\n exportedTheme () {\n const saveEverything = (\n !this.keepFonts &&\n !this.keepShadows &&\n !this.keepOpacity &&\n !this.keepRoundness &&\n !this.keepColor\n )\n\n const theme = {}\n\n if (this.keepFonts || saveEverything) {\n theme.fonts = this.fontsLocal\n }\n if (this.keepShadows || saveEverything) {\n theme.shadows = this.shadowsLocal\n }\n if (this.keepOpacity || saveEverything) {\n theme.opacity = this.currentOpacity\n }\n if (this.keepColor || saveEverything) {\n theme.colors = this.currentColors\n }\n if (this.keepRoundness || saveEverything) {\n theme.radii = this.currentRadii\n }\n\n return {\n // To separate from other random JSON files and possible future theme formats\n _pleroma_theme_version: 2, theme\n }\n }\n },\n components: {\n ColorInput,\n OpacityInput,\n RangeInput,\n ContrastRatio,\n ShadowControl,\n FontControl,\n TabSwitcher,\n Preview,\n ExportImport,\n Checkbox\n },\n methods: {\n setCustomTheme () {\n this.$store.dispatch('setOption', {\n name: 'customTheme',\n value: {\n shadows: this.shadowsLocal,\n fonts: this.fontsLocal,\n opacity: this.currentOpacity,\n colors: this.currentColors,\n radii: this.currentRadii\n }\n })\n },\n onImport (parsed) {\n if (parsed._pleroma_theme_version === 1) {\n this.normalizeLocalState(parsed, 1)\n } else if (parsed._pleroma_theme_version === 2) {\n this.normalizeLocalState(parsed.theme, 2)\n }\n },\n importValidator (parsed) {\n const version = parsed._pleroma_theme_version\n return version >= 1 || version <= 2\n },\n clearAll () {\n const state = this.$store.getters.mergedConfig.customTheme\n const version = state.colors ? 2 : 'l1'\n this.normalizeLocalState(this.$store.getters.mergedConfig.customTheme, version)\n },\n\n // Clears all the extra stuff when loading V1 theme\n clearV1 () {\n Object.keys(this.$data)\n .filter(_ => _.endsWith('ColorLocal') || _.endsWith('OpacityLocal'))\n .filter(_ => !v1OnlyNames.includes(_))\n .forEach(key => {\n set(this.$data, key, undefined)\n })\n },\n\n clearRoundness () {\n Object.keys(this.$data)\n .filter(_ => _.endsWith('RadiusLocal'))\n .forEach(key => {\n set(this.$data, key, undefined)\n })\n },\n\n clearOpacity () {\n Object.keys(this.$data)\n .filter(_ => _.endsWith('OpacityLocal'))\n .forEach(key => {\n set(this.$data, key, undefined)\n })\n },\n\n clearShadows () {\n this.shadowsLocal = {}\n },\n\n clearFonts () {\n this.fontsLocal = {}\n },\n\n /**\n * This applies stored theme data onto form. Supports three versions of data:\n * v2 (version = 2) - newer version of themes.\n * v1 (version = 1) - older version of themes (import from file)\n * v1l (version = l1) - older version of theme (load from local storage)\n * v1 and v1l differ because of way themes were stored/exported.\n * @param {Object} input - input data\n * @param {Number} version - version of data. 0 means try to guess based on data. \"l1\" means v1, locastorage type\n */\n normalizeLocalState (input, version = 0) {\n const colors = input.colors || input\n const radii = input.radii || input\n const opacity = input.opacity\n const shadows = input.shadows || {}\n const fonts = input.fonts || {}\n\n if (version === 0) {\n if (input.version) version = input.version\n // Old v1 naming: fg is text, btn is foreground\n if (typeof colors.text === 'undefined' && typeof colors.fg !== 'undefined') {\n version = 1\n }\n // New v2 naming: text is text, fg is foreground\n if (typeof colors.text !== 'undefined' && typeof colors.fg !== 'undefined') {\n version = 2\n }\n }\n\n // Stuff that differs between V1 and V2\n if (version === 1) {\n this.fgColorLocal = rgb2hex(colors.btn)\n this.textColorLocal = rgb2hex(colors.fg)\n }\n\n if (!this.keepColor) {\n this.clearV1()\n const keys = new Set(version !== 1 ? Object.keys(colors) : [])\n if (version === 1 || version === 'l1') {\n keys\n .add('bg')\n .add('link')\n .add('cRed')\n .add('cBlue')\n .add('cGreen')\n .add('cOrange')\n }\n\n keys.forEach(key => {\n this[key + 'ColorLocal'] = rgb2hex(colors[key])\n })\n }\n\n if (!this.keepRoundness) {\n this.clearRoundness()\n Object.entries(radii).forEach(([k, v]) => {\n // 'Radius' is kept mostly for v1->v2 localstorage transition\n const key = k.endsWith('Radius') ? k.split('Radius')[0] : k\n this[key + 'RadiusLocal'] = v\n })\n }\n\n if (!this.keepShadows) {\n this.clearShadows()\n this.shadowsLocal = shadows\n this.shadowSelected = this.shadowsAvailable[0]\n }\n\n if (!this.keepFonts) {\n this.clearFonts()\n this.fontsLocal = fonts\n }\n\n if (opacity && !this.keepOpacity) {\n this.clearOpacity()\n Object.entries(opacity).forEach(([k, v]) => {\n if (typeof v === 'undefined' || v === null || Number.isNaN(v)) return\n this[k + 'OpacityLocal'] = v\n })\n }\n }\n },\n watch: {\n currentRadii () {\n try {\n this.previewRadii = generateRadii({ radii: this.currentRadii })\n this.radiiInvalid = false\n } catch (e) {\n this.radiiInvalid = true\n console.warn(e)\n }\n },\n shadowsLocal: {\n handler () {\n try {\n this.previewShadows = generateShadows({ shadows: this.shadowsLocal })\n this.shadowsInvalid = false\n } catch (e) {\n this.shadowsInvalid = true\n console.warn(e)\n }\n },\n deep: true\n },\n fontsLocal: {\n handler () {\n try {\n this.previewFonts = generateFonts({ fonts: this.fontsLocal })\n this.fontsInvalid = false\n } catch (e) {\n this.fontsInvalid = true\n console.warn(e)\n }\n },\n deep: true\n },\n currentColors () {\n try {\n this.previewColors = generateColors({\n opacity: this.currentOpacity,\n colors: this.currentColors\n })\n this.colorsInvalid = false\n } catch (e) {\n this.colorsInvalid = true\n console.warn(e)\n }\n },\n currentOpacity () {\n try {\n this.previewColors = generateColors({\n opacity: this.currentOpacity,\n colors: this.currentColors\n })\n } catch (e) {\n console.warn(e)\n }\n },\n selected () {\n if (this.selectedVersion === 1) {\n if (!this.keepRoundness) {\n this.clearRoundness()\n }\n\n if (!this.keepShadows) {\n this.clearShadows()\n }\n\n if (!this.keepOpacity) {\n this.clearOpacity()\n }\n\n if (!this.keepColor) {\n this.clearV1()\n\n this.bgColorLocal = this.selected[1]\n this.fgColorLocal = this.selected[2]\n this.textColorLocal = this.selected[3]\n this.linkColorLocal = this.selected[4]\n this.cRedColorLocal = this.selected[5]\n this.cGreenColorLocal = this.selected[6]\n this.cBlueColorLocal = this.selected[7]\n this.cOrangeColorLocal = this.selected[8]\n }\n } else if (this.selectedVersion >= 2) {\n this.normalizeLocalState(this.selected.theme, 2)\n }\n }\n }\n}\n","\n\n\n\n\n","\n\n\n","\n\n\n","import ColorInput from '../color_input/color_input.vue'\nimport OpacityInput from '../opacity_input/opacity_input.vue'\nimport { getCssShadow } from '../../services/style_setter/style_setter.js'\nimport { hex2rgb } from '../../services/color_convert/color_convert.js'\n\nexport default {\n // 'Value' and 'Fallback' can be undefined, but if they are\n // initially vue won't detect it when they become something else\n // therefore i'm using \"ready\" which should be passed as true when\n // data becomes available\n props: [\n 'value', 'fallback', 'ready'\n ],\n data () {\n return {\n selectedId: 0,\n // TODO there are some bugs regarding display of array (it's not getting updated when deleting for some reason)\n cValue: this.value || this.fallback || []\n }\n },\n components: {\n ColorInput,\n OpacityInput\n },\n methods: {\n add () {\n this.cValue.push(Object.assign({}, this.selected))\n this.selectedId = this.cValue.length - 1\n },\n del () {\n this.cValue.splice(this.selectedId, 1)\n this.selectedId = this.cValue.length === 0 ? undefined : this.selectedId - 1\n },\n moveUp () {\n const movable = this.cValue.splice(this.selectedId, 1)[0]\n this.cValue.splice(this.selectedId - 1, 0, movable)\n this.selectedId -= 1\n },\n moveDn () {\n const movable = this.cValue.splice(this.selectedId, 1)[0]\n this.cValue.splice(this.selectedId + 1, 0, movable)\n this.selectedId += 1\n }\n },\n beforeUpdate () {\n this.cValue = this.value || this.fallback\n },\n computed: {\n selected () {\n if (this.ready && this.cValue.length > 0) {\n return this.cValue[this.selectedId]\n } else {\n return {\n x: 0,\n y: 0,\n blur: 0,\n spread: 0,\n inset: false,\n color: '#000000',\n alpha: 1\n }\n }\n },\n moveUpValid () {\n return this.ready && this.selectedId > 0\n },\n moveDnValid () {\n return this.ready && this.selectedId < this.cValue.length - 1\n },\n present () {\n return this.ready &&\n typeof this.cValue[this.selectedId] !== 'undefined' &&\n !this.usingFallback\n },\n usingFallback () {\n return typeof this.value === 'undefined'\n },\n rgb () {\n return hex2rgb(this.selected.color)\n },\n style () {\n return this.ready ? {\n boxShadow: getCssShadow(this.cValue)\n } : {}\n }\n }\n}\n","import { set } from 'vue'\n\nexport default {\n props: [\n 'name', 'label', 'value', 'fallback', 'options', 'no-inherit'\n ],\n data () {\n return {\n lValue: this.value,\n availableOptions: [\n this.noInherit ? '' : 'inherit',\n 'custom',\n ...(this.options || []),\n 'serif',\n 'monospace',\n 'sans-serif'\n ].filter(_ => _)\n }\n },\n beforeUpdate () {\n this.lValue = this.value\n },\n computed: {\n present () {\n return typeof this.lValue !== 'undefined'\n },\n dValue () {\n return this.lValue || this.fallback || {}\n },\n family: {\n get () {\n return this.dValue.family\n },\n set (v) {\n set(this.lValue, 'family', v)\n this.$emit('input', this.lValue)\n }\n },\n isCustom () {\n return this.preset === 'custom'\n },\n preset: {\n get () {\n if (this.family === 'serif' ||\n this.family === 'sans-serif' ||\n this.family === 'monospace' ||\n this.family === 'inherit') {\n return this.family\n } else {\n return 'custom'\n }\n },\n set (v) {\n this.family = v === 'custom' ? '' : v\n }\n }\n }\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","import { validationMixin } from 'vuelidate'\nimport { required, sameAs } from 'vuelidate/lib/validators'\nimport { mapActions, mapState } from 'vuex'\n\nconst registration = {\n mixins: [validationMixin],\n data: () => ({\n user: {\n email: '',\n fullname: '',\n username: '',\n password: '',\n confirm: ''\n },\n captcha: {}\n }),\n validations: {\n user: {\n email: { required },\n username: { required },\n fullname: { required },\n password: { required },\n confirm: {\n required,\n sameAsPassword: sameAs('password')\n }\n }\n },\n created () {\n if ((!this.registrationOpen && !this.token) || this.signedIn) {\n this.$router.push({ name: 'root' })\n }\n\n this.setCaptcha()\n },\n computed: {\n token () { return this.$route.params.token },\n bioPlaceholder () {\n return this.$t('registration.bio_placeholder').replace(/\\s*\\n\\s*/g, ' \\n')\n },\n ...mapState({\n registrationOpen: (state) => state.instance.registrationOpen,\n signedIn: (state) => !!state.users.currentUser,\n isPending: (state) => state.users.signUpPending,\n serverValidationErrors: (state) => state.users.signUpErrors,\n termsOfService: (state) => state.instance.tos\n })\n },\n methods: {\n ...mapActions(['signUp', 'getCaptcha']),\n async submit () {\n this.user.nickname = this.user.username\n this.user.token = this.token\n\n this.user.captcha_solution = this.captcha.solution\n this.user.captcha_token = this.captcha.token\n this.user.captcha_answer_data = this.captcha.answer_data\n\n this.$v.$touch()\n\n if (!this.$v.$invalid) {\n try {\n await this.signUp(this.user)\n this.$router.push({ name: 'friends' })\n } catch (error) {\n console.warn('Registration failed: ' + error)\n }\n }\n },\n setCaptcha () {\n this.getCaptcha().then(cpt => { this.captcha = cpt })\n }\n }\n}\n\nexport default registration\n","import { mapState } from 'vuex'\nimport passwordResetApi from '../../services/new_api/password_reset.js'\n\nconst passwordReset = {\n data: () => ({\n user: {\n email: ''\n },\n isPending: false,\n success: false,\n throttled: false,\n error: null\n }),\n computed: {\n ...mapState({\n signedIn: (state) => !!state.users.currentUser,\n instance: state => state.instance\n }),\n mailerEnabled () {\n return this.instance.mailerEnabled\n }\n },\n created () {\n if (this.signedIn) {\n this.$router.push({ name: 'root' })\n }\n },\n props: {\n passwordResetRequested: {\n default: false,\n type: Boolean\n }\n },\n methods: {\n dismissError () {\n this.error = null\n },\n submit () {\n this.isPending = true\n const email = this.user.email\n const instance = this.instance.server\n\n passwordResetApi({ instance, email }).then(({ status }) => {\n this.isPending = false\n this.user.email = ''\n\n if (status === 204) {\n this.success = true\n this.error = null\n } else if (status === 404 || status === 400) {\n this.error = this.$t('password_reset.not_found')\n this.$nextTick(() => {\n this.$refs.email.focus()\n })\n } else if (status === 429) {\n this.throttled = true\n this.error = this.$t('password_reset.too_many_requests')\n }\n }).catch(() => {\n this.isPending = false\n this.user.email = ''\n this.error = this.$t('general.generic_error')\n })\n }\n }\n}\n\nexport default passwordReset\n","import unescape from 'lodash/unescape'\nimport get from 'lodash/get'\nimport map from 'lodash/map'\nimport reject from 'lodash/reject'\nimport TabSwitcher from '../tab_switcher/tab_switcher.js'\nimport ImageCropper from '../image_cropper/image_cropper.vue'\nimport StyleSwitcher from '../style_switcher/style_switcher.vue'\nimport ScopeSelector from '../scope_selector/scope_selector.vue'\nimport fileSizeFormatService from '../../services/file_size_format/file_size_format.js'\nimport BlockCard from '../block_card/block_card.vue'\nimport MuteCard from '../mute_card/mute_card.vue'\nimport SelectableList from '../selectable_list/selectable_list.vue'\nimport ProgressButton from '../progress_button/progress_button.vue'\nimport EmojiInput from '../emoji_input/emoji_input.vue'\nimport suggestor from '../emoji_input/suggestor.js'\nimport Autosuggest from '../autosuggest/autosuggest.vue'\nimport Importer from '../importer/importer.vue'\nimport Exporter from '../exporter/exporter.vue'\nimport withSubscription from '../../hocs/with_subscription/with_subscription'\nimport Checkbox from '../checkbox/checkbox.vue'\nimport Mfa from './mfa.vue'\n\nconst BlockList = withSubscription({\n fetch: (props, $store) => $store.dispatch('fetchBlocks'),\n select: (props, $store) => get($store.state.users.currentUser, 'blockIds', []),\n childPropName: 'items'\n})(SelectableList)\n\nconst MuteList = withSubscription({\n fetch: (props, $store) => $store.dispatch('fetchMutes'),\n select: (props, $store) => get($store.state.users.currentUser, 'muteIds', []),\n childPropName: 'items'\n})(SelectableList)\n\nconst UserSettings = {\n data () {\n return {\n newEmail: '',\n newName: this.$store.state.users.currentUser.name,\n newBio: unescape(this.$store.state.users.currentUser.description),\n newLocked: this.$store.state.users.currentUser.locked,\n newNoRichText: this.$store.state.users.currentUser.no_rich_text,\n newDefaultScope: this.$store.state.users.currentUser.default_scope,\n hideFollows: this.$store.state.users.currentUser.hide_follows,\n hideFollowers: this.$store.state.users.currentUser.hide_followers,\n hideFollowsCount: this.$store.state.users.currentUser.hide_follows_count,\n hideFollowersCount: this.$store.state.users.currentUser.hide_followers_count,\n showRole: this.$store.state.users.currentUser.show_role,\n role: this.$store.state.users.currentUser.role,\n discoverable: this.$store.state.users.currentUser.discoverable,\n pickAvatarBtnVisible: true,\n bannerUploading: false,\n backgroundUploading: false,\n banner: null,\n bannerPreview: null,\n background: null,\n backgroundPreview: null,\n bannerUploadError: null,\n backgroundUploadError: null,\n changeEmailError: false,\n changeEmailPassword: '',\n changedEmail: false,\n deletingAccount: false,\n deleteAccountConfirmPasswordInput: '',\n deleteAccountError: false,\n changePasswordInputs: [ '', '', '' ],\n changedPassword: false,\n changePasswordError: false,\n activeTab: 'profile',\n notificationSettings: this.$store.state.users.currentUser.notification_settings\n }\n },\n created () {\n this.$store.dispatch('fetchTokens')\n },\n components: {\n StyleSwitcher,\n ScopeSelector,\n TabSwitcher,\n ImageCropper,\n BlockList,\n MuteList,\n EmojiInput,\n Autosuggest,\n BlockCard,\n MuteCard,\n ProgressButton,\n Importer,\n Exporter,\n Mfa,\n Checkbox\n },\n computed: {\n user () {\n return this.$store.state.users.currentUser\n },\n emojiUserSuggestor () {\n return suggestor({\n emoji: [\n ...this.$store.state.instance.emoji,\n ...this.$store.state.instance.customEmoji\n ],\n users: this.$store.state.users.users,\n updateUsersList: (input) => this.$store.dispatch('searchUsers', input)\n })\n },\n emojiSuggestor () {\n return suggestor({ emoji: [\n ...this.$store.state.instance.emoji,\n ...this.$store.state.instance.customEmoji\n ] })\n },\n pleromaBackend () {\n return this.$store.state.instance.pleromaBackend\n },\n minimalScopesMode () {\n return this.$store.state.instance.minimalScopesMode\n },\n vis () {\n return {\n public: { selected: this.newDefaultScope === 'public' },\n unlisted: { selected: this.newDefaultScope === 'unlisted' },\n private: { selected: this.newDefaultScope === 'private' },\n direct: { selected: this.newDefaultScope === 'direct' }\n }\n },\n currentSaveStateNotice () {\n return this.$store.state.interface.settings.currentSaveStateNotice\n },\n oauthTokens () {\n return this.$store.state.oauthTokens.tokens.map(oauthToken => {\n return {\n id: oauthToken.id,\n appName: oauthToken.app_name,\n validUntil: new Date(oauthToken.valid_until).toLocaleDateString()\n }\n })\n }\n },\n methods: {\n updateProfile () {\n this.$store.state.api.backendInteractor\n .updateProfile({\n params: {\n note: this.newBio,\n locked: this.newLocked,\n // Backend notation.\n /* eslint-disable camelcase */\n display_name: this.newName,\n default_scope: this.newDefaultScope,\n no_rich_text: this.newNoRichText,\n hide_follows: this.hideFollows,\n hide_followers: this.hideFollowers,\n discoverable: this.discoverable,\n hide_follows_count: this.hideFollowsCount,\n hide_followers_count: this.hideFollowersCount,\n show_role: this.showRole\n /* eslint-enable camelcase */\n } }).then((user) => {\n this.$store.commit('addNewUsers', [user])\n this.$store.commit('setCurrentUser', user)\n })\n },\n updateNotificationSettings () {\n this.$store.state.api.backendInteractor\n .updateNotificationSettings({ settings: this.notificationSettings })\n },\n changeVis (visibility) {\n this.newDefaultScope = visibility\n },\n uploadFile (slot, e) {\n const file = e.target.files[0]\n if (!file) { return }\n if (file.size > this.$store.state.instance[slot + 'limit']) {\n const filesize = fileSizeFormatService.fileSizeFormat(file.size)\n const allowedsize = fileSizeFormatService.fileSizeFormat(this.$store.state.instance[slot + 'limit'])\n this[slot + 'UploadError'] = this.$t('upload.error.base') + ' ' + this.$t('upload.error.file_too_big', { filesize: filesize.num, filesizeunit: filesize.unit, allowedsize: allowedsize.num, allowedsizeunit: allowedsize.unit })\n return\n }\n // eslint-disable-next-line no-undef\n const reader = new FileReader()\n reader.onload = ({ target }) => {\n const img = target.result\n this[slot + 'Preview'] = img\n this[slot] = file\n }\n reader.readAsDataURL(file)\n },\n submitAvatar (cropper, file) {\n const that = this\n return new Promise((resolve, reject) => {\n function updateAvatar (avatar) {\n that.$store.state.api.backendInteractor.updateAvatar({ avatar })\n .then((user) => {\n that.$store.commit('addNewUsers', [user])\n that.$store.commit('setCurrentUser', user)\n resolve()\n })\n .catch((err) => {\n reject(new Error(that.$t('upload.error.base') + ' ' + err.message))\n })\n }\n\n if (cropper) {\n cropper.getCroppedCanvas().toBlob(updateAvatar, file.type)\n } else {\n updateAvatar(file)\n }\n })\n },\n clearUploadError (slot) {\n this[slot + 'UploadError'] = null\n },\n submitBanner () {\n if (!this.bannerPreview) { return }\n\n this.bannerUploading = true\n this.$store.state.api.backendInteractor.updateBanner({ banner: this.banner })\n .then((user) => {\n this.$store.commit('addNewUsers', [user])\n this.$store.commit('setCurrentUser', user)\n this.bannerPreview = null\n })\n .catch((err) => {\n this.bannerUploadError = this.$t('upload.error.base') + ' ' + err.message\n })\n .then(() => { this.bannerUploading = false })\n },\n submitBg () {\n if (!this.backgroundPreview) { return }\n let background = this.background\n this.backgroundUploading = true\n this.$store.state.api.backendInteractor.updateBg({ background }).then((data) => {\n if (!data.error) {\n this.$store.commit('addNewUsers', [data])\n this.$store.commit('setCurrentUser', data)\n this.backgroundPreview = null\n } else {\n this.backgroundUploadError = this.$t('upload.error.base') + data.error\n }\n this.backgroundUploading = false\n })\n },\n importFollows (file) {\n return this.$store.state.api.backendInteractor.importFollows(file)\n .then((status) => {\n if (!status) {\n throw new Error('failed')\n }\n })\n },\n importBlocks (file) {\n return this.$store.state.api.backendInteractor.importBlocks(file)\n .then((status) => {\n if (!status) {\n throw new Error('failed')\n }\n })\n },\n generateExportableUsersContent (users) {\n // Get addresses\n return users.map((user) => {\n // check is it's a local user\n if (user && user.is_local) {\n // append the instance address\n // eslint-disable-next-line no-undef\n return user.screen_name + '@' + location.hostname\n }\n return user.screen_name\n }).join('\\n')\n },\n getFollowsContent () {\n return this.$store.state.api.backendInteractor.exportFriends({ id: this.$store.state.users.currentUser.id })\n .then(this.generateExportableUsersContent)\n },\n getBlocksContent () {\n return this.$store.state.api.backendInteractor.fetchBlocks()\n .then(this.generateExportableUsersContent)\n },\n confirmDelete () {\n this.deletingAccount = true\n },\n deleteAccount () {\n this.$store.state.api.backendInteractor.deleteAccount({ password: this.deleteAccountConfirmPasswordInput })\n .then((res) => {\n if (res.status === 'success') {\n this.$store.dispatch('logout')\n this.$router.push({ name: 'root' })\n } else {\n this.deleteAccountError = res.error\n }\n })\n },\n changePassword () {\n const params = {\n password: this.changePasswordInputs[0],\n newPassword: this.changePasswordInputs[1],\n newPasswordConfirmation: this.changePasswordInputs[2]\n }\n this.$store.state.api.backendInteractor.changePassword(params)\n .then((res) => {\n if (res.status === 'success') {\n this.changedPassword = true\n this.changePasswordError = false\n this.logout()\n } else {\n this.changedPassword = false\n this.changePasswordError = res.error\n }\n })\n },\n changeEmail () {\n const params = {\n email: this.newEmail,\n password: this.changeEmailPassword\n }\n this.$store.state.api.backendInteractor.changeEmail(params)\n .then((res) => {\n if (res.status === 'success') {\n this.changedEmail = true\n this.changeEmailError = false\n } else {\n this.changedEmail = false\n this.changeEmailError = res.error\n }\n })\n },\n activateTab (tabName) {\n this.activeTab = tabName\n },\n logout () {\n this.$store.dispatch('logout')\n this.$router.replace('/')\n },\n revokeToken (id) {\n if (window.confirm(`${this.$i18n.t('settings.revoke_token')}?`)) {\n this.$store.dispatch('revokeToken', id)\n }\n },\n filterUnblockedUsers (userIds) {\n return reject(userIds, (userId) => {\n const user = this.$store.getters.findUser(userId)\n return !user || user.statusnet_blocking || user.id === this.$store.state.users.currentUser.id\n })\n },\n filterUnMutedUsers (userIds) {\n return reject(userIds, (userId) => {\n const user = this.$store.getters.findUser(userId)\n return !user || user.muted || user.id === this.$store.state.users.currentUser.id\n })\n },\n queryUserIds (query) {\n return this.$store.dispatch('searchUsers', query)\n .then((users) => map(users, 'id'))\n },\n blockUsers (ids) {\n return this.$store.dispatch('blockUsers', ids)\n },\n unblockUsers (ids) {\n return this.$store.dispatch('unblockUsers', ids)\n },\n muteUsers (ids) {\n return this.$store.dispatch('muteUsers', ids)\n },\n unmuteUsers (ids) {\n return this.$store.dispatch('unmuteUsers', ids)\n },\n identity (value) {\n return value\n }\n }\n}\n\nexport default UserSettings\n","import Cropper from 'cropperjs'\nimport 'cropperjs/dist/cropper.css'\n\nconst ImageCropper = {\n props: {\n trigger: {\n type: [String, window.Element],\n required: true\n },\n submitHandler: {\n type: Function,\n required: true\n },\n cropperOptions: {\n type: Object,\n default () {\n return {\n aspectRatio: 1,\n autoCropArea: 1,\n viewMode: 1,\n movable: false,\n zoomable: false,\n guides: false\n }\n }\n },\n mimes: {\n type: String,\n default: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'\n },\n saveButtonLabel: {\n type: String\n },\n saveWithoutCroppingButtonlabel: {\n type: String\n },\n cancelButtonLabel: {\n type: String\n }\n },\n data () {\n return {\n cropper: undefined,\n dataUrl: undefined,\n filename: undefined,\n submitting: false,\n submitError: null\n }\n },\n computed: {\n saveText () {\n return this.saveButtonLabel || this.$t('image_cropper.save')\n },\n saveWithoutCroppingText () {\n return this.saveWithoutCroppingButtonlabel || this.$t('image_cropper.save_without_cropping')\n },\n cancelText () {\n return this.cancelButtonLabel || this.$t('image_cropper.cancel')\n },\n submitErrorMsg () {\n return this.submitError && this.submitError instanceof Error ? this.submitError.toString() : this.submitError\n }\n },\n methods: {\n destroy () {\n if (this.cropper) {\n this.cropper.destroy()\n }\n this.$refs.input.value = ''\n this.dataUrl = undefined\n this.$emit('close')\n },\n submit (cropping = true) {\n this.submitting = true\n this.avatarUploadError = null\n this.submitHandler(cropping && this.cropper, this.file)\n .then(() => this.destroy())\n .catch((err) => {\n this.submitError = err\n })\n .finally(() => {\n this.submitting = false\n })\n },\n pickImage () {\n this.$refs.input.click()\n },\n createCropper () {\n this.cropper = new Cropper(this.$refs.img, this.cropperOptions)\n },\n getTriggerDOM () {\n return typeof this.trigger === 'object' ? this.trigger : document.querySelector(this.trigger)\n },\n readFile () {\n const fileInput = this.$refs.input\n if (fileInput.files != null && fileInput.files[0] != null) {\n this.file = fileInput.files[0]\n let reader = new window.FileReader()\n reader.onload = (e) => {\n this.dataUrl = e.target.result\n this.$emit('open')\n }\n reader.readAsDataURL(this.file)\n this.$emit('changed', this.file, reader)\n }\n },\n clearError () {\n this.submitError = null\n }\n },\n mounted () {\n // listen for click event on trigger\n const trigger = this.getTriggerDOM()\n if (!trigger) {\n this.$emit('error', 'No image make trigger found.', 'user')\n } else {\n trigger.addEventListener('click', this.pickImage)\n }\n // listen for input file changes\n const fileInput = this.$refs.input\n fileInput.addEventListener('change', this.readFile)\n },\n beforeDestroy: function () {\n // remove the event listeners\n const trigger = this.getTriggerDOM()\n if (trigger) {\n trigger.removeEventListener('click', this.pickImage)\n }\n const fileInput = this.$refs.input\n fileInput.removeEventListener('change', this.readFile)\n }\n}\n\nexport default ImageCropper\n","import BasicUserCard from '../basic_user_card/basic_user_card.vue'\n\nconst BlockCard = {\n props: ['userId'],\n data () {\n return {\n progress: false\n }\n },\n computed: {\n user () {\n return this.$store.getters.findUser(this.userId)\n },\n blocked () {\n return this.user.statusnet_blocking\n }\n },\n components: {\n BasicUserCard\n },\n methods: {\n unblockUser () {\n this.progress = true\n this.$store.dispatch('unblockUser', this.user.id).then(() => {\n this.progress = false\n })\n },\n blockUser () {\n this.progress = true\n this.$store.dispatch('blockUser', this.user.id).then(() => {\n this.progress = false\n })\n }\n }\n}\n\nexport default BlockCard\n","import BasicUserCard from '../basic_user_card/basic_user_card.vue'\n\nconst MuteCard = {\n props: ['userId'],\n data () {\n return {\n progress: false\n }\n },\n computed: {\n user () {\n return this.$store.getters.findUser(this.userId)\n },\n muted () {\n return this.user.muted\n }\n },\n components: {\n BasicUserCard\n },\n methods: {\n unmuteUser () {\n this.progress = true\n this.$store.dispatch('unmuteUser', this.user.id).then(() => {\n this.progress = false\n })\n },\n muteUser () {\n this.progress = true\n this.$store.dispatch('muteUser', this.user.id).then(() => {\n this.progress = false\n })\n }\n }\n}\n\nexport default MuteCard\n","import List from '../list/list.vue'\nimport Checkbox from '../checkbox/checkbox.vue'\n\nconst SelectableList = {\n components: {\n List,\n Checkbox\n },\n props: {\n items: {\n type: Array,\n default: () => []\n },\n getKey: {\n type: Function,\n default: item => item.id\n }\n },\n data () {\n return {\n selected: []\n }\n },\n computed: {\n allKeys () {\n return this.items.map(this.getKey)\n },\n filteredSelected () {\n return this.allKeys.filter(key => this.selected.indexOf(key) !== -1)\n },\n allSelected () {\n return this.filteredSelected.length === this.items.length\n },\n noneSelected () {\n return this.filteredSelected.length === 0\n },\n someSelected () {\n return !this.allSelected && !this.noneSelected\n }\n },\n methods: {\n isSelected (item) {\n return this.filteredSelected.indexOf(this.getKey(item)) !== -1\n },\n toggle (checked, item) {\n const key = this.getKey(item)\n const oldChecked = this.isSelected(key)\n if (checked !== oldChecked) {\n if (checked) {\n this.selected.push(key)\n } else {\n this.selected.splice(this.selected.indexOf(key), 1)\n }\n }\n },\n toggleAll (value) {\n if (value) {\n this.selected = this.allKeys.slice(0)\n } else {\n this.selected = []\n }\n }\n }\n}\n\nexport default SelectableList\n","const debounceMilliseconds = 500\n\nexport default {\n props: {\n query: { // function to query results and return a promise\n type: Function,\n required: true\n },\n filter: { // function to filter results in real time\n type: Function\n },\n placeholder: {\n type: String,\n default: 'Search...'\n }\n },\n data () {\n return {\n term: '',\n timeout: null,\n results: [],\n resultsVisible: false\n }\n },\n computed: {\n filtered () {\n return this.filter ? this.filter(this.results) : this.results\n }\n },\n watch: {\n term (val) {\n this.fetchResults(val)\n }\n },\n methods: {\n fetchResults (term) {\n clearTimeout(this.timeout)\n this.timeout = setTimeout(() => {\n this.results = []\n if (term) {\n this.query(term).then((results) => { this.results = results })\n }\n }, debounceMilliseconds)\n },\n onInputClick () {\n this.resultsVisible = true\n },\n onClickOutside () {\n this.resultsVisible = false\n }\n }\n}\n","const Importer = {\n props: {\n submitHandler: {\n type: Function,\n required: true\n },\n submitButtonLabel: {\n type: String,\n default () {\n return this.$t('importer.submit')\n }\n },\n successMessage: {\n type: String,\n default () {\n return this.$t('importer.success')\n }\n },\n errorMessage: {\n type: String,\n default () {\n return this.$t('importer.error')\n }\n }\n },\n data () {\n return {\n file: null,\n error: false,\n success: false,\n submitting: false\n }\n },\n methods: {\n change () {\n this.file = this.$refs.input.files[0]\n },\n submit () {\n this.dismiss()\n this.submitting = true\n this.submitHandler(this.file)\n .then(() => { this.success = true })\n .catch(() => { this.error = true })\n .finally(() => { this.submitting = false })\n },\n dismiss () {\n this.success = false\n this.error = false\n }\n }\n}\n\nexport default Importer\n","const Exporter = {\n props: {\n getContent: {\n type: Function,\n required: true\n },\n filename: {\n type: String,\n default: 'export.csv'\n },\n exportButtonLabel: {\n type: String,\n default () {\n return this.$t('exporter.export')\n }\n },\n processingMessage: {\n type: String,\n default () {\n return this.$t('exporter.processing')\n }\n }\n },\n data () {\n return {\n processing: false\n }\n },\n methods: {\n process () {\n this.processing = true\n this.getContent()\n .then((content) => {\n const fileToDownload = document.createElement('a')\n fileToDownload.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(content))\n fileToDownload.setAttribute('download', this.filename)\n fileToDownload.style.display = 'none'\n document.body.appendChild(fileToDownload)\n fileToDownload.click()\n document.body.removeChild(fileToDownload)\n // Add delay before hiding processing state since browser takes some time to handle file download\n setTimeout(() => { this.processing = false }, 2000)\n })\n }\n }\n}\n\nexport default Exporter\n","import RecoveryCodes from './mfa_backup_codes.vue'\nimport TOTP from './mfa_totp.vue'\nimport Confirm from './confirm.vue'\nimport VueQrcode from '@chenfengyuan/vue-qrcode'\nimport { mapState } from 'vuex'\n\nconst Mfa = {\n data: () => ({\n settings: { // current settings of MFA\n available: false,\n enabled: false,\n totp: false\n },\n setupState: { // setup mfa\n state: '', // state of setup. '' -> 'getBackupCodes' -> 'setupOTP' -> 'complete'\n setupOTPState: '' // state of setup otp. '' -> 'prepare' -> 'confirm' -> 'complete'\n },\n backupCodes: {\n getNewCodes: false,\n inProgress: false, // progress of fetch codes\n codes: []\n },\n otpSettings: { // pre-setup setting of OTP. secret key, qrcode url.\n provisioning_uri: '',\n key: ''\n },\n currentPassword: null,\n otpConfirmToken: null,\n error: null,\n readyInit: false\n }),\n components: {\n 'recovery-codes': RecoveryCodes,\n 'totp-item': TOTP,\n 'qrcode': VueQrcode,\n 'confirm': Confirm\n },\n computed: {\n canSetupOTP () {\n return (\n (this.setupInProgress && this.backupCodesPrepared) ||\n this.settings.enabled\n ) && !this.settings.totp && !this.setupOTPInProgress\n },\n setupInProgress () {\n return this.setupState.state !== '' && this.setupState.state !== 'complete'\n },\n setupOTPInProgress () {\n return this.setupState.state === 'setupOTP' && !this.completedOTP\n },\n prepareOTP () {\n return this.setupState.setupOTPState === 'prepare'\n },\n confirmOTP () {\n return this.setupState.setupOTPState === 'confirm'\n },\n completedOTP () {\n return this.setupState.setupOTPState === 'completed'\n },\n backupCodesPrepared () {\n return !this.backupCodes.inProgress && this.backupCodes.codes.length > 0\n },\n confirmNewBackupCodes () {\n return this.backupCodes.getNewCodes\n },\n ...mapState({\n backendInteractor: (state) => state.api.backendInteractor\n })\n },\n\n methods: {\n activateOTP () {\n if (!this.settings.enabled) {\n this.setupState.state = 'getBackupcodes'\n this.fetchBackupCodes()\n }\n },\n fetchBackupCodes () {\n this.backupCodes.inProgress = true\n this.backupCodes.codes = []\n\n return this.backendInteractor.generateMfaBackupCodes()\n .then((res) => {\n this.backupCodes.codes = res.codes\n this.backupCodes.inProgress = false\n })\n },\n getBackupCodes () { // get a new backup codes\n this.backupCodes.getNewCodes = true\n },\n confirmBackupCodes () { // confirm getting new backup codes\n this.fetchBackupCodes().then((res) => {\n this.backupCodes.getNewCodes = false\n })\n },\n cancelBackupCodes () { // cancel confirm form of new backup codes\n this.backupCodes.getNewCodes = false\n },\n\n // Setup OTP\n setupOTP () { // prepare setup OTP\n this.setupState.state = 'setupOTP'\n this.setupState.setupOTPState = 'prepare'\n this.backendInteractor.mfaSetupOTP()\n .then((res) => {\n this.otpSettings = res\n this.setupState.setupOTPState = 'confirm'\n })\n },\n doConfirmOTP () { // handler confirm enable OTP\n this.error = null\n this.backendInteractor.mfaConfirmOTP({\n token: this.otpConfirmToken,\n password: this.currentPassword\n })\n .then((res) => {\n if (res.error) {\n this.error = res.error\n return\n }\n this.completeSetup()\n })\n },\n\n completeSetup () {\n this.setupState.setupOTPState = 'complete'\n this.setupState.state = 'complete'\n this.currentPassword = null\n this.error = null\n this.fetchSettings()\n },\n cancelSetup () { // cancel setup\n this.setupState.setupOTPState = ''\n this.setupState.state = ''\n this.currentPassword = null\n this.error = null\n },\n // end Setup OTP\n\n // fetch settings from server\n async fetchSettings () {\n let result = await this.backendInteractor.fetchSettingsMFA()\n if (result.error) return\n this.settings = result.settings\n this.settings.available = true\n return result\n }\n },\n mounted () {\n this.fetchSettings().then(() => {\n this.readyInit = true\n })\n }\n}\nexport default Mfa\n","export default {\n props: {\n backupCodes: {\n type: Object,\n default: () => ({\n inProgress: false,\n codes: []\n })\n }\n },\n data: () => ({}),\n computed: {\n inProgress () { return this.backupCodes.inProgress },\n ready () { return this.backupCodes.codes.length > 0 },\n displayTitle () { return this.inProgress || this.ready }\n }\n}\n","import Confirm from './confirm.vue'\nimport { mapState } from 'vuex'\n\nexport default {\n props: ['settings'],\n data: () => ({\n error: false,\n currentPassword: '',\n deactivate: false,\n inProgress: false // progress peform request to disable otp method\n }),\n components: {\n 'confirm': Confirm\n },\n computed: {\n isActivated () {\n return this.settings.totp\n },\n ...mapState({\n backendInteractor: (state) => state.api.backendInteractor\n })\n },\n methods: {\n doActivate () {\n this.$emit('activate')\n },\n cancelDeactivate () { this.deactivate = false },\n doDeactivate () {\n this.error = null\n this.deactivate = true\n },\n confirmDeactivate () { // confirm deactivate TOTP method\n this.error = null\n this.inProgress = true\n this.backendInteractor.mfaDisableOTP({\n password: this.currentPassword\n })\n .then((res) => {\n this.inProgress = false\n if (res.error) {\n this.error = res.error\n return\n }\n this.deactivate = false\n this.$emit('deactivate')\n })\n }\n }\n}\n","const Confirm = {\n props: ['disabled'],\n data: () => ({}),\n methods: {\n confirm () { this.$emit('confirm') },\n cancel () { this.$emit('cancel') }\n }\n}\nexport default Confirm\n","import FollowRequestCard from '../follow_request_card/follow_request_card.vue'\n\nconst FollowRequests = {\n components: {\n FollowRequestCard\n },\n computed: {\n requests () {\n return this.$store.state.api.followRequests\n }\n }\n}\n\nexport default FollowRequests\n","import BasicUserCard from '../basic_user_card/basic_user_card.vue'\n\nconst FollowRequestCard = {\n props: ['user'],\n components: {\n BasicUserCard\n },\n methods: {\n approveUser () {\n this.$store.state.api.backendInteractor.approveUser(this.user.id)\n this.$store.dispatch('removeFollowRequest', this.user)\n },\n denyUser () {\n this.$store.state.api.backendInteractor.denyUser(this.user.id)\n this.$store.dispatch('removeFollowRequest', this.user)\n }\n }\n}\n\nexport default FollowRequestCard\n","import oauth from '../../services/new_api/oauth.js'\n\nconst oac = {\n props: ['code'],\n mounted () {\n if (this.code) {\n const { clientId, clientSecret } = this.$store.state.oauth\n\n oauth.getToken({\n clientId,\n clientSecret,\n instance: this.$store.state.instance.server,\n code: this.code\n }).then((result) => {\n this.$store.commit('setToken', result.access_token)\n this.$store.dispatch('loginUser', result.access_token)\n this.$router.push({ name: 'friends' })\n })\n }\n }\n}\n\nexport default oac\n","import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'\nimport oauthApi from '../../services/new_api/oauth.js'\n\nconst LoginForm = {\n data: () => ({\n user: {},\n error: false\n }),\n computed: {\n isPasswordAuth () { return this.requiredPassword },\n isTokenAuth () { return this.requiredToken },\n ...mapState({\n registrationOpen: state => state.instance.registrationOpen,\n instance: state => state.instance,\n loggingIn: state => state.users.loggingIn,\n oauth: state => state.oauth\n }),\n ...mapGetters(\n 'authFlow', ['requiredPassword', 'requiredToken', 'requiredMFA']\n )\n },\n methods: {\n ...mapMutations('authFlow', ['requireMFA']),\n ...mapActions({ login: 'authFlow/login' }),\n submit () {\n this.isTokenAuth ? this.submitToken() : this.submitPassword()\n },\n submitToken () {\n const { clientId, clientSecret } = this.oauth\n const data = {\n clientId,\n clientSecret,\n instance: this.instance.server,\n commit: this.$store.commit\n }\n\n oauthApi.getOrCreateApp(data)\n .then((app) => { oauthApi.login({ ...app, ...data }) })\n },\n submitPassword () {\n const { clientId } = this.oauth\n const data = {\n clientId,\n oauth: this.oauth,\n instance: this.instance.server,\n commit: this.$store.commit\n }\n this.error = false\n\n oauthApi.getOrCreateApp(data).then((app) => {\n oauthApi.getTokenWithCredentials(\n {\n ...app,\n instance: data.instance,\n username: this.user.username,\n password: this.user.password\n }\n ).then((result) => {\n if (result.error) {\n if (result.error === 'mfa_required') {\n this.requireMFA({ app: app, settings: result })\n } else if (result.identifier === 'password_reset_required') {\n this.$router.push({ name: 'password-reset', params: { passwordResetRequested: true } })\n } else {\n this.error = result.error\n this.focusOnPasswordInput()\n }\n return\n }\n this.login(result).then(() => {\n this.$router.push({ name: 'friends' })\n })\n })\n })\n },\n clearError () { this.error = false },\n focusOnPasswordInput () {\n let passwordInput = this.$refs.passwordInput\n passwordInput.focus()\n passwordInput.setSelectionRange(0, passwordInput.value.length)\n }\n }\n}\n\nexport default LoginForm\n","import mfaApi from '../../services/new_api/mfa.js'\nimport { mapState, mapGetters, mapActions, mapMutations } from 'vuex'\n\nexport default {\n data: () => ({\n code: null,\n error: false\n }),\n computed: {\n ...mapGetters({\n authApp: 'authFlow/app',\n authSettings: 'authFlow/settings'\n }),\n ...mapState({ instance: 'instance' })\n },\n methods: {\n ...mapMutations('authFlow', ['requireTOTP', 'abortMFA']),\n ...mapActions({ login: 'authFlow/login' }),\n clearError () { this.error = false },\n submit () {\n const data = {\n app: this.authApp,\n instance: this.instance.server,\n mfaToken: this.authSettings.mfa_token,\n code: this.code\n }\n\n mfaApi.verifyRecoveryCode(data).then((result) => {\n if (result.error) {\n this.error = result.error\n this.code = null\n return\n }\n\n this.login(result).then(() => {\n this.$router.push({ name: 'friends' })\n })\n })\n }\n }\n}\n","import mfaApi from '../../services/new_api/mfa.js'\nimport { mapState, mapGetters, mapActions, mapMutations } from 'vuex'\nexport default {\n data: () => ({\n code: null,\n error: false\n }),\n computed: {\n ...mapGetters({\n authApp: 'authFlow/app',\n authSettings: 'authFlow/settings'\n }),\n ...mapState({ instance: 'instance' })\n },\n methods: {\n ...mapMutations('authFlow', ['requireRecovery', 'abortMFA']),\n ...mapActions({ login: 'authFlow/login' }),\n clearError () { this.error = false },\n submit () {\n const data = {\n app: this.authApp,\n instance: this.instance.server,\n mfaToken: this.authSettings.mfa_token,\n code: this.code\n }\n\n mfaApi.verifyOTPCode(data).then((result) => {\n if (result.error) {\n this.error = result.error\n this.code = null\n return\n }\n\n this.login(result).then(() => {\n this.$router.push({ name: 'friends' })\n })\n })\n }\n }\n}\n","import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\n\nconst chatPanel = {\n props: [ 'floating' ],\n data () {\n return {\n currentMessage: '',\n channel: null,\n collapsed: true\n }\n },\n computed: {\n messages () {\n return this.$store.state.chat.messages\n }\n },\n methods: {\n submit (message) {\n this.$store.state.chat.channel.push('new_msg', { text: message }, 10000)\n this.currentMessage = ''\n },\n togglePanel () {\n this.collapsed = !this.collapsed\n },\n userProfileLink (user) {\n return generateProfileLink(user.id, user.username, this.$store.state.instance.restrictedNicknames)\n }\n }\n}\n\nexport default chatPanel\n","import apiService from '../../services/api/api.service.js'\nimport FollowCard from '../follow_card/follow_card.vue'\n\nconst WhoToFollow = {\n components: {\n FollowCard\n },\n data () {\n return {\n users: []\n }\n },\n mounted () {\n this.getWhoToFollow()\n },\n methods: {\n showWhoToFollow (reply) {\n reply.forEach((i, index) => {\n this.$store.state.api.backendInteractor.fetchUser({ id: i.acct })\n .then((externalUser) => {\n if (!externalUser.error) {\n this.$store.commit('addNewUsers', [externalUser])\n this.users.push(externalUser)\n }\n })\n })\n },\n getWhoToFollow () {\n const credentials = this.$store.state.users.currentUser.credentials\n if (credentials) {\n apiService.suggestions({ credentials: credentials })\n .then((reply) => {\n this.showWhoToFollow(reply)\n })\n }\n }\n }\n}\n\nexport default WhoToFollow\n","import InstanceSpecificPanel from '../instance_specific_panel/instance_specific_panel.vue'\nimport FeaturesPanel from '../features_panel/features_panel.vue'\nimport TermsOfServicePanel from '../terms_of_service_panel/terms_of_service_panel.vue'\n\nconst About = {\n components: {\n InstanceSpecificPanel,\n FeaturesPanel,\n TermsOfServicePanel\n },\n computed: {\n showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }\n }\n}\n\nexport default About\n","const InstanceSpecificPanel = {\n computed: {\n instanceSpecificPanelContent () {\n return this.$store.state.instance.instanceSpecificPanelContent\n }\n }\n}\n\nexport default InstanceSpecificPanel\n","const FeaturesPanel = {\n computed: {\n chat: function () { return this.$store.state.instance.chatAvailable },\n gopher: function () { return this.$store.state.instance.gopherAvailable },\n whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled },\n mediaProxy: function () { return this.$store.state.instance.mediaProxyAvailable },\n minimalScopesMode: function () { return this.$store.state.instance.minimalScopesMode },\n textlimit: function () { return this.$store.state.instance.textlimit }\n }\n}\n\nexport default FeaturesPanel\n","const TermsOfServicePanel = {\n computed: {\n content () {\n return this.$store.state.instance.tos\n }\n }\n}\n\nexport default TermsOfServicePanel\n","const RemoteUserResolver = {\n data: () => ({\n error: false\n }),\n mounted () {\n this.redirect()\n },\n methods: {\n redirect () {\n const acct = this.$route.params.username + '@' + this.$route.params.hostname\n this.$store.state.api.backendInteractor.fetchUser({ id: acct })\n .then((externalUser) => {\n if (externalUser.error) {\n this.error = true\n } else {\n this.$store.commit('addNewUsers', [externalUser])\n const id = externalUser.id\n this.$router.replace({\n name: 'external-user-profile',\n params: { id }\n })\n }\n })\n .catch(() => {\n this.error = true\n })\n }\n }\n}\n\nexport default RemoteUserResolver\n","import UserPanel from './components/user_panel/user_panel.vue'\nimport NavPanel from './components/nav_panel/nav_panel.vue'\nimport Notifications from './components/notifications/notifications.vue'\nimport SearchBar from './components/search_bar/search_bar.vue'\nimport InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'\nimport FeaturesPanel from './components/features_panel/features_panel.vue'\nimport WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'\nimport ChatPanel from './components/chat_panel/chat_panel.vue'\nimport MediaModal from './components/media_modal/media_modal.vue'\nimport SideDrawer from './components/side_drawer/side_drawer.vue'\nimport MobilePostStatusButton from './components/mobile_post_status_button/mobile_post_status_button.vue'\nimport MobileNav from './components/mobile_nav/mobile_nav.vue'\nimport UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue'\nimport PostStatusModal from './components/post_status_modal/post_status_modal.vue'\nimport { windowWidth } from './services/window_utils/window_utils'\n\nexport default {\n name: 'app',\n components: {\n UserPanel,\n NavPanel,\n Notifications,\n SearchBar,\n InstanceSpecificPanel,\n FeaturesPanel,\n WhoToFollowPanel,\n ChatPanel,\n MediaModal,\n SideDrawer,\n MobilePostStatusButton,\n MobileNav,\n UserReportingModal,\n PostStatusModal\n },\n data: () => ({\n mobileActivePanel: 'timeline',\n searchBarHidden: true,\n supportsMask: window.CSS && window.CSS.supports && (\n window.CSS.supports('mask-size', 'contain') ||\n window.CSS.supports('-webkit-mask-size', 'contain') ||\n window.CSS.supports('-moz-mask-size', 'contain') ||\n window.CSS.supports('-ms-mask-size', 'contain') ||\n window.CSS.supports('-o-mask-size', 'contain')\n )\n }),\n created () {\n // Load the locale from the storage\n this.$i18n.locale = this.$store.getters.mergedConfig.interfaceLanguage\n window.addEventListener('resize', this.updateMobileState)\n },\n destroyed () {\n window.removeEventListener('resize', this.updateMobileState)\n },\n computed: {\n currentUser () { return this.$store.state.users.currentUser },\n background () {\n return this.currentUser.background_image || this.$store.state.instance.background\n },\n enableMask () { return this.supportsMask && this.$store.state.instance.logoMask },\n logoStyle () {\n return {\n 'visibility': this.enableMask ? 'hidden' : 'visible'\n }\n },\n logoMaskStyle () {\n return this.enableMask ? {\n 'mask-image': `url(${this.$store.state.instance.logo})`\n } : {\n 'background-color': this.enableMask ? '' : 'transparent'\n }\n },\n logoBgStyle () {\n return Object.assign({\n 'margin': `${this.$store.state.instance.logoMargin} 0`,\n opacity: this.searchBarHidden ? 1 : 0\n }, this.enableMask ? {} : {\n 'background-color': this.enableMask ? '' : 'transparent'\n })\n },\n logo () { return this.$store.state.instance.logo },\n bgStyle () {\n return {\n 'background-image': `url(${this.background})`\n }\n },\n bgAppStyle () {\n return {\n '--body-background-image': `url(${this.background})`\n }\n },\n sitename () { return this.$store.state.instance.name },\n chat () { return this.$store.state.chat.channel.state === 'joined' },\n suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },\n showInstanceSpecificPanel () {\n return this.$store.state.instance.showInstanceSpecificPanel &&\n !this.$store.getters.mergedConfig.hideISP &&\n this.$store.state.instance.instanceSpecificPanelContent\n },\n showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },\n isMobileLayout () { return this.$store.state.interface.mobileLayout }\n },\n methods: {\n scrollToTop () {\n window.scrollTo(0, 0)\n },\n logout () {\n this.$router.replace('/main/public')\n this.$store.dispatch('logout')\n },\n onSearchBarToggled (hidden) {\n this.searchBarHidden = hidden\n },\n updateMobileState () {\n const mobileLayout = windowWidth() <= 800\n const changed = mobileLayout !== this.isMobileLayout\n if (changed) {\n this.$store.dispatch('setMobileLayout', mobileLayout)\n }\n }\n }\n}\n","import AuthForm from '../auth_form/auth_form.js'\nimport PostStatusForm from '../post_status_form/post_status_form.vue'\nimport UserCard from '../user_card/user_card.vue'\nimport { mapState } from 'vuex'\n\nconst UserPanel = {\n computed: {\n signedIn () { return this.user },\n ...mapState({ user: state => state.users.currentUser })\n },\n components: {\n AuthForm,\n PostStatusForm,\n UserCard\n }\n}\n\nexport default UserPanel\n","import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'\n\nconst NavPanel = {\n created () {\n if (this.currentUser && this.currentUser.locked) {\n const store = this.$store\n const credentials = store.state.users.currentUser.credentials\n\n followRequestFetcher.startFetching({ store, credentials })\n }\n },\n computed: {\n currentUser () {\n return this.$store.state.users.currentUser\n },\n chat () {\n return this.$store.state.chat.channel\n },\n followRequestCount () {\n return this.$store.state.api.followRequests.length\n }\n }\n}\n\nexport default NavPanel\n","const SearchBar = {\n data: () => ({\n searchTerm: undefined,\n hidden: true,\n error: false,\n loading: false\n }),\n watch: {\n '$route': function (route) {\n if (route.name === 'search') {\n this.searchTerm = route.query.query\n }\n }\n },\n methods: {\n find (searchTerm) {\n this.$router.push({ name: 'search', query: { query: searchTerm } })\n this.$refs.searchInput.focus()\n },\n toggleHidden () {\n this.hidden = !this.hidden\n this.$emit('toggled', this.hidden)\n this.$nextTick(() => {\n if (!this.hidden) {\n this.$refs.searchInput.focus()\n }\n })\n }\n }\n}\n\nexport default SearchBar\n","import apiService from '../../services/api/api.service.js'\nimport generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'\nimport { shuffle } from 'lodash'\n\nfunction showWhoToFollow (panel, reply) {\n const shuffled = shuffle(reply)\n\n panel.usersToFollow.forEach((toFollow, index) => {\n let user = shuffled[index]\n let img = user.avatar || '/images/avi.png'\n let name = user.acct\n\n toFollow.img = img\n toFollow.name = name\n\n panel.$store.state.api.backendInteractor.fetchUser({ id: name })\n .then((externalUser) => {\n if (!externalUser.error) {\n panel.$store.commit('addNewUsers', [externalUser])\n toFollow.id = externalUser.id\n }\n })\n })\n}\n\nfunction getWhoToFollow (panel) {\n var credentials = panel.$store.state.users.currentUser.credentials\n if (credentials) {\n panel.usersToFollow.forEach(toFollow => {\n toFollow.name = 'Loading...'\n })\n apiService.suggestions({ credentials: credentials })\n .then((reply) => {\n showWhoToFollow(panel, reply)\n })\n }\n}\n\nconst WhoToFollowPanel = {\n data: () => ({\n usersToFollow: new Array(3).fill().map(x => (\n {\n img: '/images/avi.png',\n name: '',\n id: 0\n }\n ))\n }),\n computed: {\n user: function () {\n return this.$store.state.users.currentUser.screen_name\n },\n suggestionsEnabled () {\n return this.$store.state.instance.suggestionsEnabled\n }\n },\n methods: {\n userProfileLink (id, name) {\n return generateProfileLink(id, name, this.$store.state.instance.restrictedNicknames)\n }\n },\n watch: {\n user: function (user, oldUser) {\n if (this.suggestionsEnabled) {\n getWhoToFollow(this)\n }\n }\n },\n mounted:\n function () {\n if (this.suggestionsEnabled) {\n getWhoToFollow(this)\n }\n }\n}\n\nexport default WhoToFollowPanel\n","import StillImage from '../still-image/still-image.vue'\nimport VideoAttachment from '../video_attachment/video_attachment.vue'\nimport Modal from '../modal/modal.vue'\nimport fileTypeService from '../../services/file_type/file_type.service.js'\nimport GestureService from '../../services/gesture_service/gesture_service'\n\nconst MediaModal = {\n components: {\n StillImage,\n VideoAttachment,\n Modal\n },\n computed: {\n showing () {\n return this.$store.state.mediaViewer.activated\n },\n media () {\n return this.$store.state.mediaViewer.media\n },\n currentIndex () {\n return this.$store.state.mediaViewer.currentIndex\n },\n currentMedia () {\n return this.media[this.currentIndex]\n },\n canNavigate () {\n return this.media.length > 1\n },\n type () {\n return this.currentMedia ? fileTypeService.fileType(this.currentMedia.mimetype) : null\n }\n },\n created () {\n this.mediaSwipeGestureRight = GestureService.swipeGesture(\n GestureService.DIRECTION_RIGHT,\n this.goPrev,\n 50\n )\n this.mediaSwipeGestureLeft = GestureService.swipeGesture(\n GestureService.DIRECTION_LEFT,\n this.goNext,\n 50\n )\n },\n methods: {\n mediaTouchStart (e) {\n GestureService.beginSwipe(e, this.mediaSwipeGestureRight)\n GestureService.beginSwipe(e, this.mediaSwipeGestureLeft)\n },\n mediaTouchMove (e) {\n GestureService.updateSwipe(e, this.mediaSwipeGestureRight)\n GestureService.updateSwipe(e, this.mediaSwipeGestureLeft)\n },\n hide () {\n this.$store.dispatch('closeMediaViewer')\n },\n goPrev () {\n if (this.canNavigate) {\n const prevIndex = this.currentIndex === 0 ? this.media.length - 1 : (this.currentIndex - 1)\n this.$store.dispatch('setCurrent', this.media[prevIndex])\n }\n },\n goNext () {\n if (this.canNavigate) {\n const nextIndex = this.currentIndex === this.media.length - 1 ? 0 : (this.currentIndex + 1)\n this.$store.dispatch('setCurrent', this.media[nextIndex])\n }\n },\n handleKeyupEvent (e) {\n if (this.showing && e.keyCode === 27) { // escape\n this.hide()\n }\n },\n handleKeydownEvent (e) {\n if (!this.showing) {\n return\n }\n\n if (e.keyCode === 39) { // arrow right\n this.goNext()\n } else if (e.keyCode === 37) { // arrow left\n this.goPrev()\n }\n }\n },\n mounted () {\n document.addEventListener('keyup', this.handleKeyupEvent)\n document.addEventListener('keydown', this.handleKeydownEvent)\n },\n destroyed () {\n document.removeEventListener('keyup', this.handleKeyupEvent)\n document.removeEventListener('keydown', this.handleKeydownEvent)\n }\n}\n\nexport default MediaModal\n","\n\n\n\n\n","import UserCard from '../user_card/user_card.vue'\nimport { unseenNotificationsFromStore } from '../../services/notification_utils/notification_utils'\nimport GestureService from '../../services/gesture_service/gesture_service'\n\nconst SideDrawer = {\n props: [ 'logout' ],\n data: () => ({\n closed: true,\n closeGesture: undefined\n }),\n created () {\n this.closeGesture = GestureService.swipeGesture(GestureService.DIRECTION_LEFT, this.toggleDrawer)\n },\n components: { UserCard },\n computed: {\n currentUser () {\n return this.$store.state.users.currentUser\n },\n chat () { return this.$store.state.chat.channel.state === 'joined' },\n unseenNotifications () {\n return unseenNotificationsFromStore(this.$store)\n },\n unseenNotificationsCount () {\n return this.unseenNotifications.length\n },\n suggestionsEnabled () {\n return this.$store.state.instance.suggestionsEnabled\n },\n logo () {\n return this.$store.state.instance.logo\n },\n sitename () {\n return this.$store.state.instance.name\n },\n followRequestCount () {\n return this.$store.state.api.followRequests.length\n }\n },\n methods: {\n toggleDrawer () {\n this.closed = !this.closed\n },\n doLogout () {\n this.logout()\n this.toggleDrawer()\n },\n touchStart (e) {\n GestureService.beginSwipe(e, this.closeGesture)\n },\n touchMove (e) {\n GestureService.updateSwipe(e, this.closeGesture)\n }\n }\n}\n\nexport default SideDrawer\n","import { debounce } from 'lodash'\n\nconst MobilePostStatusButton = {\n data () {\n return {\n hidden: false,\n scrollingDown: false,\n inputActive: false,\n oldScrollPos: 0,\n amountScrolled: 0\n }\n },\n created () {\n if (this.autohideFloatingPostButton) {\n this.activateFloatingPostButtonAutohide()\n }\n window.addEventListener('resize', this.handleOSK)\n },\n destroyed () {\n if (this.autohideFloatingPostButton) {\n this.deactivateFloatingPostButtonAutohide()\n }\n window.removeEventListener('resize', this.handleOSK)\n },\n computed: {\n isLoggedIn () {\n return !!this.$store.state.users.currentUser\n },\n isHidden () {\n return this.autohideFloatingPostButton && (this.hidden || this.inputActive)\n },\n autohideFloatingPostButton () {\n return !!this.$store.getters.mergedConfig.autohideFloatingPostButton\n }\n },\n watch: {\n autohideFloatingPostButton: function (isEnabled) {\n if (isEnabled) {\n this.activateFloatingPostButtonAutohide()\n } else {\n this.deactivateFloatingPostButtonAutohide()\n }\n }\n },\n methods: {\n activateFloatingPostButtonAutohide () {\n window.addEventListener('scroll', this.handleScrollStart)\n window.addEventListener('scroll', this.handleScrollEnd)\n },\n deactivateFloatingPostButtonAutohide () {\n window.removeEventListener('scroll', this.handleScrollStart)\n window.removeEventListener('scroll', this.handleScrollEnd)\n },\n openPostForm () {\n this.$store.dispatch('openPostStatusModal')\n },\n handleOSK () {\n // This is a big hack: we're guessing from changed window sizes if the\n // on-screen keyboard is active or not. This is only really important\n // for phones in portrait mode and it's more important to show the button\n // in normal scenarios on all phones, than it is to hide it when the\n // keyboard is active.\n // Guesswork based on https://www.mydevice.io/#compare-devices\n\n // for example, iphone 4 and android phones from the same time period\n const smallPhone = window.innerWidth < 350\n const smallPhoneKbOpen = smallPhone && window.innerHeight < 345\n\n const biggerPhone = !smallPhone && window.innerWidth < 450\n const biggerPhoneKbOpen = biggerPhone && window.innerHeight < 560\n if (smallPhoneKbOpen || biggerPhoneKbOpen) {\n this.inputActive = true\n } else {\n this.inputActive = false\n }\n },\n handleScrollStart: debounce(function () {\n if (window.scrollY > this.oldScrollPos) {\n this.hidden = true\n } else {\n this.hidden = false\n }\n this.oldScrollPos = window.scrollY\n }, 100, { leading: true, trailing: false }),\n\n handleScrollEnd: debounce(function () {\n this.hidden = false\n this.oldScrollPos = window.scrollY\n }, 100, { leading: false, trailing: true })\n }\n}\n\nexport default MobilePostStatusButton\n","import SideDrawer from '../side_drawer/side_drawer.vue'\nimport Notifications from '../notifications/notifications.vue'\nimport { unseenNotificationsFromStore } from '../../services/notification_utils/notification_utils'\nimport GestureService from '../../services/gesture_service/gesture_service'\n\nconst MobileNav = {\n components: {\n SideDrawer,\n Notifications\n },\n data: () => ({\n notificationsCloseGesture: undefined,\n notificationsOpen: false\n }),\n created () {\n this.notificationsCloseGesture = GestureService.swipeGesture(\n GestureService.DIRECTION_RIGHT,\n this.closeMobileNotifications,\n 50\n )\n },\n computed: {\n currentUser () {\n return this.$store.state.users.currentUser\n },\n unseenNotifications () {\n return unseenNotificationsFromStore(this.$store)\n },\n unseenNotificationsCount () {\n return this.unseenNotifications.length\n },\n sitename () { return this.$store.state.instance.name }\n },\n methods: {\n toggleMobileSidebar () {\n this.$refs.sideDrawer.toggleDrawer()\n },\n openMobileNotifications () {\n this.notificationsOpen = true\n },\n closeMobileNotifications () {\n if (this.notificationsOpen) {\n // make sure to mark notifs seen only when the notifs were open and not\n // from close-calls.\n this.notificationsOpen = false\n this.markNotificationsAsSeen()\n }\n },\n notificationsTouchStart (e) {\n GestureService.beginSwipe(e, this.notificationsCloseGesture)\n },\n notificationsTouchMove (e) {\n GestureService.updateSwipe(e, this.notificationsCloseGesture)\n },\n scrollToTop () {\n window.scrollTo(0, 0)\n },\n logout () {\n this.$router.replace('/main/public')\n this.$store.dispatch('logout')\n },\n markNotificationsAsSeen () {\n this.$refs.notifications.markAsSeen()\n },\n onScroll ({ target: { scrollTop, clientHeight, scrollHeight } }) {\n if (this.$store.getters.mergedConfig.autoLoad && scrollTop + clientHeight >= scrollHeight) {\n this.$refs.notifications.fetchOlderNotifications()\n }\n }\n },\n watch: {\n $route () {\n // handles closing notificaitons when you press any router-link on the\n // notifications.\n this.closeMobileNotifications()\n }\n }\n}\n\nexport default MobileNav\n","\nimport Status from '../status/status.vue'\nimport List from '../list/list.vue'\nimport Checkbox from '../checkbox/checkbox.vue'\nimport Modal from '../modal/modal.vue'\n\nconst UserReportingModal = {\n components: {\n Status,\n List,\n Checkbox,\n Modal\n },\n data () {\n return {\n comment: '',\n forward: false,\n statusIdsToReport: [],\n processing: false,\n error: false\n }\n },\n computed: {\n isLoggedIn () {\n return !!this.$store.state.users.currentUser\n },\n isOpen () {\n return this.isLoggedIn && this.$store.state.reports.modalActivated\n },\n userId () {\n return this.$store.state.reports.userId\n },\n user () {\n return this.$store.getters.findUser(this.userId)\n },\n remoteInstance () {\n return !this.user.is_local && this.user.screen_name.substr(this.user.screen_name.indexOf('@') + 1)\n },\n statuses () {\n return this.$store.state.reports.statuses\n }\n },\n watch: {\n userId: 'resetState'\n },\n methods: {\n resetState () {\n // Reset state\n this.comment = ''\n this.forward = false\n this.statusIdsToReport = []\n this.processing = false\n this.error = false\n },\n closeModal () {\n this.$store.dispatch('closeUserReportingModal')\n },\n reportUser () {\n this.processing = true\n this.error = false\n const params = {\n userId: this.userId,\n comment: this.comment,\n forward: this.forward,\n statusIds: this.statusIdsToReport\n }\n this.$store.state.api.backendInteractor.reportUser(params)\n .then(() => {\n this.processing = false\n this.resetState()\n this.closeModal()\n })\n .catch(() => {\n this.processing = false\n this.error = true\n })\n },\n clearError () {\n this.error = false\n },\n isChecked (statusId) {\n return this.statusIdsToReport.indexOf(statusId) !== -1\n },\n toggleStatus (checked, statusId) {\n if (checked === this.isChecked(statusId)) {\n return\n }\n\n if (checked) {\n this.statusIdsToReport.push(statusId)\n } else {\n this.statusIdsToReport.splice(this.statusIdsToReport.indexOf(statusId), 1)\n }\n },\n resize (e) {\n const target = e.target || e\n if (!(target instanceof window.Element)) { return }\n // Auto is needed to make textbox shrink when removing lines\n target.style.height = 'auto'\n target.style.height = `${target.scrollHeight}px`\n if (target.value === '') {\n target.style.height = null\n }\n }\n }\n}\n\nexport default UserReportingModal\n","import PostStatusForm from '../post_status_form/post_status_form.vue'\nimport Modal from '../modal/modal.vue'\nimport get from 'lodash/get'\n\nconst PostStatusModal = {\n components: {\n PostStatusForm,\n Modal\n },\n data () {\n return {\n resettingForm: false\n }\n },\n computed: {\n isLoggedIn () {\n return !!this.$store.state.users.currentUser\n },\n modalActivated () {\n return this.$store.state.postStatus.modalActivated\n },\n isFormVisible () {\n return this.isLoggedIn && !this.resettingForm && this.modalActivated\n },\n params () {\n return this.$store.state.postStatus.params || {}\n }\n },\n watch: {\n params (newVal, oldVal) {\n if (get(newVal, 'repliedUser.id') !== get(oldVal, 'repliedUser.id')) {\n this.resettingForm = true\n this.$nextTick(() => {\n this.resettingForm = false\n })\n }\n },\n isFormVisible (val) {\n if (val) {\n this.$nextTick(() => this.$el && this.$el.querySelector('textarea').focus())\n }\n }\n },\n methods: {\n closeModal () {\n this.$store.dispatch('closePostStatusModal')\n }\n }\n}\n\nexport default PostStatusModal\n","import Vue from 'vue'\n\nimport './tab_switcher.scss'\n\nexport default Vue.component('tab-switcher', {\n name: 'TabSwitcher',\n props: {\n renderOnlyFocused: {\n required: false,\n type: Boolean,\n default: false\n },\n onSwitch: {\n required: false,\n type: Function,\n default: undefined\n },\n activeTab: {\n required: false,\n type: String,\n default: undefined\n },\n scrollableTabs: {\n required: false,\n type: Boolean,\n default: false\n }\n },\n data () {\n return {\n active: this.$slots.default.findIndex(_ => _.tag)\n }\n },\n computed: {\n activeIndex () {\n // In case of controlled component\n if (this.activeTab) {\n return this.$slots.default.findIndex(slot => this.activeTab === slot.key)\n } else {\n return this.active\n }\n }\n },\n beforeUpdate () {\n const currentSlot = this.$slots.default[this.active]\n if (!currentSlot.tag) {\n this.active = this.$slots.default.findIndex(_ => _.tag)\n }\n },\n methods: {\n activateTab (index) {\n return (e) => {\n e.preventDefault()\n if (typeof this.onSwitch === 'function') {\n this.onSwitch.call(null, this.$slots.default[index].key)\n }\n this.active = index\n }\n }\n },\n render (h) {\n const tabs = this.$slots.default\n .map((slot, index) => {\n if (!slot.tag) return\n const classesTab = ['tab']\n const classesWrapper = ['tab-wrapper']\n\n if (this.activeIndex === index) {\n classesTab.push('active')\n classesWrapper.push('active')\n }\n if (slot.data.attrs.image) {\n return (\n
\n \n \n {slot.data.attrs.label ? '' : slot.data.attrs.label}\n \n
\n )\n }\n return (\n
\n \n {slot.data.attrs.label}\n
\n )\n })\n\n const contents = this.$slots.default.map((slot, index) => {\n if (!slot.tag) return\n const active = this.activeIndex === index\n if (this.renderOnlyFocused) {\n return active\n ?
{slot}
\n :
\n }\n return
{slot}
\n })\n\n return (\n
\n
\n {tabs}\n
\n
\n {contents}\n
\n
\n )\n }\n})\n","import { set, delete as del } from 'vue'\nimport { setPreset, applyTheme } from '../services/style_setter/style_setter.js'\n\nconst browserLocale = (window.navigator.language || 'en').split('-')[0]\n\nexport const defaultState = {\n colors: {},\n // bad name: actually hides posts of muted USERS\n hideMutedPosts: undefined, // instance default\n collapseMessageWithSubject: undefined, // instance default\n padEmoji: true,\n hideAttachments: false,\n hideAttachmentsInConv: false,\n maxThumbnails: 16,\n hideNsfw: true,\n preloadImage: true,\n loopVideo: true,\n loopVideoSilentOnly: true,\n autoLoad: true,\n streaming: false,\n hoverPreview: true,\n autohideFloatingPostButton: false,\n pauseOnUnfocused: true,\n stopGifs: false,\n replyVisibility: 'all',\n notificationVisibility: {\n follows: true,\n mentions: true,\n likes: true,\n repeats: true\n },\n webPushNotifications: false,\n muteWords: [],\n highlight: {},\n interfaceLanguage: browserLocale,\n hideScopeNotice: false,\n scopeCopy: undefined, // instance default\n subjectLineBehavior: undefined, // instance default\n alwaysShowSubjectInput: undefined, // instance default\n postContentType: undefined, // instance default\n minimalScopesMode: undefined, // instance default\n // This hides statuses filtered via a word filter\n hideFilteredStatuses: undefined, // instance default\n playVideosInModal: false,\n useOneClickNsfw: false,\n useContainFit: false,\n hidePostStats: undefined, // instance default\n hideUserStats: undefined // instance default\n}\n\n// caching the instance default properties\nexport const instanceDefaultProperties = Object.entries(defaultState)\n .filter(([key, value]) => value === undefined)\n .map(([key, value]) => key)\n\nconst config = {\n state: defaultState,\n getters: {\n mergedConfig (state, getters, rootState, rootGetters) {\n const { instance } = rootState\n return {\n ...state,\n ...instanceDefaultProperties\n .map(key => [key, state[key] === undefined\n ? instance[key]\n : state[key]\n ])\n .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})\n }\n }\n },\n mutations: {\n setOption (state, { name, value }) {\n set(state, name, value)\n },\n setHighlight (state, { user, color, type }) {\n const data = this.state.config.highlight[user]\n if (color || type) {\n set(state.highlight, user, { color: color || data.color, type: type || data.type })\n } else {\n del(state.highlight, user)\n }\n }\n },\n actions: {\n setHighlight ({ commit, dispatch }, { user, color, type }) {\n commit('setHighlight', { user, color, type })\n },\n setOption ({ commit, dispatch }, { name, value }) {\n commit('setOption', { name, value })\n switch (name) {\n case 'theme':\n setPreset(value, commit)\n break\n case 'customTheme':\n applyTheme(value, commit)\n }\n }\n }\n}\n\nexport default config\n","import apiService from '../api/api.service.js'\nimport timelineFetcherService from '../timeline_fetcher/timeline_fetcher.service.js'\nimport notificationsFetcher from '../notifications_fetcher/notifications_fetcher.service.js'\n\nconst backendInteractorService = credentials => {\n const fetchStatus = ({ id }) => {\n return apiService.fetchStatus({ id, credentials })\n }\n\n const fetchConversation = ({ id }) => {\n return apiService.fetchConversation({ id, credentials })\n }\n\n const fetchFriends = ({ id, maxId, sinceId, limit }) => {\n return apiService.fetchFriends({ id, maxId, sinceId, limit, credentials })\n }\n\n const exportFriends = ({ id }) => {\n return apiService.exportFriends({ id, credentials })\n }\n\n const fetchFollowers = ({ id, maxId, sinceId, limit }) => {\n return apiService.fetchFollowers({ id, maxId, sinceId, limit, credentials })\n }\n\n const fetchUser = ({ id }) => {\n return apiService.fetchUser({ id, credentials })\n }\n\n const fetchUserRelationship = ({ id }) => {\n return apiService.fetchUserRelationship({ id, credentials })\n }\n\n const followUser = ({ id, reblogs }) => {\n return apiService.followUser({ credentials, id, reblogs })\n }\n\n const unfollowUser = (id) => {\n return apiService.unfollowUser({ credentials, id })\n }\n\n const blockUser = (id) => {\n return apiService.blockUser({ credentials, id })\n }\n\n const unblockUser = (id) => {\n return apiService.unblockUser({ credentials, id })\n }\n\n const approveUser = (id) => {\n return apiService.approveUser({ credentials, id })\n }\n\n const denyUser = (id) => {\n return apiService.denyUser({ credentials, id })\n }\n\n const startFetchingTimeline = ({ timeline, store, userId = false, tag }) => {\n return timelineFetcherService.startFetching({ timeline, store, credentials, userId, tag })\n }\n\n const startFetchingNotifications = ({ store }) => {\n return notificationsFetcher.startFetching({ store, credentials })\n }\n\n // eslint-disable-next-line camelcase\n const tagUser = ({ screen_name }, tag) => {\n return apiService.tagUser({ screen_name, tag, credentials })\n }\n\n // eslint-disable-next-line camelcase\n const untagUser = ({ screen_name }, tag) => {\n return apiService.untagUser({ screen_name, tag, credentials })\n }\n\n // eslint-disable-next-line camelcase\n const addRight = ({ screen_name }, right) => {\n return apiService.addRight({ screen_name, right, credentials })\n }\n\n // eslint-disable-next-line camelcase\n const deleteRight = ({ screen_name }, right) => {\n return apiService.deleteRight({ screen_name, right, credentials })\n }\n\n // eslint-disable-next-line camelcase\n const setActivationStatus = ({ screen_name }, status) => {\n return apiService.setActivationStatus({ screen_name, status, credentials })\n }\n\n // eslint-disable-next-line camelcase\n const deleteUser = ({ screen_name }) => {\n return apiService.deleteUser({ screen_name, credentials })\n }\n\n const vote = (pollId, choices) => {\n return apiService.vote({ credentials, pollId, choices })\n }\n\n const fetchPoll = (pollId) => {\n return apiService.fetchPoll({ credentials, pollId })\n }\n\n const updateNotificationSettings = ({ settings }) => {\n return apiService.updateNotificationSettings({ credentials, settings })\n }\n\n const fetchMutes = () => apiService.fetchMutes({ credentials })\n const muteUser = (id) => apiService.muteUser({ credentials, id })\n const unmuteUser = (id) => apiService.unmuteUser({ credentials, id })\n const subscribeUser = (id) => apiService.subscribeUser({ credentials, id })\n const unsubscribeUser = (id) => apiService.unsubscribeUser({ credentials, id })\n const fetchBlocks = () => apiService.fetchBlocks({ credentials })\n const fetchFollowRequests = () => apiService.fetchFollowRequests({ credentials })\n const fetchOAuthTokens = () => apiService.fetchOAuthTokens({ credentials })\n const revokeOAuthToken = (id) => apiService.revokeOAuthToken({ id, credentials })\n const fetchPinnedStatuses = (id) => apiService.fetchPinnedStatuses({ credentials, id })\n const pinOwnStatus = (id) => apiService.pinOwnStatus({ credentials, id })\n const unpinOwnStatus = (id) => apiService.unpinOwnStatus({ credentials, id })\n const muteConversation = (id) => apiService.muteConversation({ credentials, id })\n const unmuteConversation = (id) => apiService.unmuteConversation({ credentials, id })\n\n const getCaptcha = () => apiService.getCaptcha()\n const register = (params) => apiService.register({ credentials, params })\n const updateAvatar = ({ avatar }) => apiService.updateAvatar({ credentials, avatar })\n const updateBg = ({ background }) => apiService.updateBg({ credentials, background })\n const updateBanner = ({ banner }) => apiService.updateBanner({ credentials, banner })\n const updateProfile = ({ params }) => apiService.updateProfile({ credentials, params })\n\n const importBlocks = (file) => apiService.importBlocks({ file, credentials })\n const importFollows = (file) => apiService.importFollows({ file, credentials })\n\n const deleteAccount = ({ password }) => apiService.deleteAccount({ credentials, password })\n const changeEmail = ({ email, password }) => apiService.changeEmail({ credentials, email, password })\n const changePassword = ({ password, newPassword, newPasswordConfirmation }) =>\n apiService.changePassword({ credentials, password, newPassword, newPasswordConfirmation })\n\n const fetchSettingsMFA = () => apiService.settingsMFA({ credentials })\n const generateMfaBackupCodes = () => apiService.generateMfaBackupCodes({ credentials })\n const mfaSetupOTP = () => apiService.mfaSetupOTP({ credentials })\n const mfaConfirmOTP = ({ password, token }) => apiService.mfaConfirmOTP({ credentials, password, token })\n const mfaDisableOTP = ({ password }) => apiService.mfaDisableOTP({ credentials, password })\n\n const fetchFavoritedByUsers = (id) => apiService.fetchFavoritedByUsers({ id })\n const fetchRebloggedByUsers = (id) => apiService.fetchRebloggedByUsers({ id })\n const reportUser = (params) => apiService.reportUser({ credentials, ...params })\n\n const favorite = (id) => apiService.favorite({ id, credentials })\n const unfavorite = (id) => apiService.unfavorite({ id, credentials })\n const retweet = (id) => apiService.retweet({ id, credentials })\n const unretweet = (id) => apiService.unretweet({ id, credentials })\n const search2 = ({ q, resolve, limit, offset, following }) =>\n apiService.search2({ credentials, q, resolve, limit, offset, following })\n const searchUsers = (query) => apiService.searchUsers({ query, credentials })\n\n const backendInteractorServiceInstance = {\n fetchStatus,\n fetchConversation,\n fetchFriends,\n exportFriends,\n fetchFollowers,\n followUser,\n unfollowUser,\n blockUser,\n unblockUser,\n fetchUser,\n fetchUserRelationship,\n verifyCredentials: apiService.verifyCredentials,\n startFetchingTimeline,\n startFetchingNotifications,\n fetchMutes,\n muteUser,\n unmuteUser,\n subscribeUser,\n unsubscribeUser,\n fetchBlocks,\n fetchOAuthTokens,\n revokeOAuthToken,\n fetchPinnedStatuses,\n pinOwnStatus,\n unpinOwnStatus,\n muteConversation,\n unmuteConversation,\n tagUser,\n untagUser,\n addRight,\n deleteRight,\n deleteUser,\n setActivationStatus,\n register,\n getCaptcha,\n updateAvatar,\n updateBg,\n updateBanner,\n updateProfile,\n importBlocks,\n importFollows,\n deleteAccount,\n changeEmail,\n changePassword,\n fetchSettingsMFA,\n generateMfaBackupCodes,\n mfaSetupOTP,\n mfaConfirmOTP,\n mfaDisableOTP,\n fetchFollowRequests,\n approveUser,\n denyUser,\n vote,\n fetchPoll,\n fetchFavoritedByUsers,\n fetchRebloggedByUsers,\n reportUser,\n favorite,\n unfavorite,\n retweet,\n unretweet,\n updateNotificationSettings,\n search2,\n searchUsers\n }\n\n return backendInteractorServiceInstance\n}\n\nexport default backendInteractorService\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./still-image.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./still-image.js\"\nimport __vue_script__ from \"!!babel-loader!./still-image.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-1bc509fc\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./still-image.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* script */\nexport * from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timeago.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timeago.vue\"\n/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-ac499830\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./timeago.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./post_status_form.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./post_status_form.js\"\nimport __vue_script__ from \"!!babel-loader!./post_status_form.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f350f69c\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./post_status_form.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* script */\nexport * from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./progress_button.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./progress_button.vue\"\n/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-9f751ae6\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./progress_button.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","import { filter, sortBy } from 'lodash'\n\nexport const notificationsFromStore = store => store.state.statuses.notifications.data\n\nexport const visibleTypes = store => ([\n store.state.config.notificationVisibility.likes && 'like',\n store.state.config.notificationVisibility.mentions && 'mention',\n store.state.config.notificationVisibility.repeats && 'repeat',\n store.state.config.notificationVisibility.follows && 'follow'\n].filter(_ => _))\n\nconst sortById = (a, b) => {\n const seqA = Number(a.id)\n const seqB = Number(b.id)\n const isSeqA = !Number.isNaN(seqA)\n const isSeqB = !Number.isNaN(seqB)\n if (isSeqA && isSeqB) {\n return seqA > seqB ? -1 : 1\n } else if (isSeqA && !isSeqB) {\n return 1\n } else if (!isSeqA && isSeqB) {\n return -1\n } else {\n return a.id > b.id ? -1 : 1\n }\n}\n\nexport const visibleNotificationsFromStore = (store, types) => {\n // map is just to clone the array since sort mutates it and it causes some issues\n let sortedNotifications = notificationsFromStore(store).map(_ => _).sort(sortById)\n sortedNotifications = sortBy(sortedNotifications, 'seen')\n return sortedNotifications.filter(\n (notification) => (types || visibleTypes(store)).includes(notification.type)\n )\n}\n\nexport const unseenNotificationsFromStore = store =>\n filter(visibleNotificationsFromStore(store), ({ seen }) => !seen)\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./follow_card.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./follow_card.js\"\nimport __vue_script__ from \"!!babel-loader!./follow_card.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5b90ae69\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./follow_card.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./list.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-c1790f52\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./modal.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./modal.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./modal.vue\"\n/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-068d175e\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./modal.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","\nconst DIRECTION_LEFT = [-1, 0]\nconst DIRECTION_RIGHT = [1, 0]\nconst DIRECTION_UP = [0, -1]\nconst DIRECTION_DOWN = [0, 1]\n\nconst deltaCoord = (oldCoord, newCoord) => [newCoord[0] - oldCoord[0], newCoord[1] - oldCoord[1]]\n\nconst touchEventCoord = e => ([e.touches[0].screenX, e.touches[0].screenY])\n\nconst vectorLength = v => Math.sqrt(v[0] * v[0] + v[1] * v[1])\n\nconst perpendicular = v => [v[1], -v[0]]\n\nconst dotProduct = (v1, v2) => v1[0] * v2[0] + v1[1] * v2[1]\n\nconst project = (v1, v2) => {\n const scalar = (dotProduct(v1, v2) / dotProduct(v2, v2))\n return [scalar * v2[0], scalar * v2[1]]\n}\n\n// direction: either use the constants above or an arbitrary 2d vector.\n// threshold: how many Px to move from touch origin before checking if the\n// callback should be called.\n// divergentTolerance: a scalar for much of divergent direction we tolerate when\n// above threshold. for example, with 1.0 we only call the callback if\n// divergent component of delta is < 1.0 * direction component of delta.\nconst swipeGesture = (direction, onSwipe, threshold = 30, perpendicularTolerance = 1.0) => {\n return {\n direction,\n onSwipe,\n threshold,\n perpendicularTolerance,\n _startPos: [0, 0],\n _swiping: false\n }\n}\n\nconst beginSwipe = (event, gesture) => {\n gesture._startPos = touchEventCoord(event)\n gesture._swiping = true\n}\n\nconst updateSwipe = (event, gesture) => {\n if (!gesture._swiping) return\n // movement too small\n const delta = deltaCoord(gesture._startPos, touchEventCoord(event))\n if (vectorLength(delta) < gesture.threshold) return\n // movement is opposite from direction\n if (dotProduct(delta, gesture.direction) < 0) return\n // movement perpendicular to direction is too much\n const towardsDir = project(delta, gesture.direction)\n const perpendicularDir = perpendicular(gesture.direction)\n const towardsPerpendicular = project(delta, perpendicularDir)\n if (\n vectorLength(towardsDir) * gesture.perpendicularTolerance <\n vectorLength(towardsPerpendicular)\n ) return\n\n gesture.onSwipe()\n gesture._swiping = false\n}\n\nconst GestureService = {\n DIRECTION_LEFT,\n DIRECTION_RIGHT,\n DIRECTION_UP,\n DIRECTION_DOWN,\n swipeGesture,\n beginSwipe,\n updateSwipe\n}\n\nexport default GestureService\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"still-image\",class:{ animated: _vm.animated }},[(_vm.animated)?_c('canvas',{ref:\"canvas\"}):_vm._e(),_vm._v(\" \"),_c('img',{key:_vm.src,ref:\"src\",attrs:{\"src\":_vm.src,\"referrerpolicy\":_vm.referrerpolicy},on:{\"load\":_vm.onLoad,\"error\":_vm.onError}})])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('video',{staticClass:\"video\",attrs:{\"src\":_vm.attachment.url,\"loop\":_vm.loopVideo,\"controls\":_vm.controls,\"playsinline\":\"\"},on:{\"loadeddata\":_vm.onVideoDataLoad}})}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {\nvar _obj;\nvar _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.usePlaceHolder)?_c('div',{on:{\"click\":_vm.openModal}},[(_vm.type !== 'html')?_c('a',{staticClass:\"placeholder\",attrs:{\"target\":\"_blank\",\"href\":_vm.attachment.url}},[_vm._v(\"\\n [\"+_vm._s(_vm.nsfw ? \"NSFW/\" : \"\")+_vm._s(_vm.type.toUpperCase())+\"]\\n \")]):_vm._e()]):_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(!_vm.isEmpty),expression:\"!isEmpty\"}],staticClass:\"attachment\",class:( _obj = {}, _obj[_vm.type] = true, _obj.loading = _vm.loading, _obj['fullwidth'] = _vm.fullwidth, _obj['nsfw-placeholder'] = _vm.hidden, _obj )},[(_vm.hidden)?_c('a',{staticClass:\"image-attachment\",attrs:{\"href\":_vm.attachment.url},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleHidden($event)}}},[_c('img',{key:_vm.nsfwImage,staticClass:\"nsfw\",class:{'small': _vm.isSmall},attrs:{\"src\":_vm.nsfwImage}}),_vm._v(\" \"),(_vm.type === 'video')?_c('i',{staticClass:\"play-icon icon-play-circled\"}):_vm._e()]):_vm._e(),_vm._v(\" \"),(_vm.nsfw && _vm.hideNsfwLocal && !_vm.hidden)?_c('div',{staticClass:\"hider\"},[_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleHidden($event)}}},[_vm._v(\"Hide\")])]):_vm._e(),_vm._v(\" \"),(_vm.type === 'image' && (!_vm.hidden || _vm.preloadImage))?_c('a',{staticClass:\"image-attachment\",class:{'hidden': _vm.hidden && _vm.preloadImage },attrs:{\"href\":_vm.attachment.url,\"target\":\"_blank\",\"title\":_vm.attachment.description},on:{\"click\":_vm.openModal}},[_c('StillImage',{attrs:{\"referrerpolicy\":_vm.referrerpolicy,\"mimetype\":_vm.attachment.mimetype,\"src\":_vm.attachment.large_thumb_url || _vm.attachment.url,\"image-load-handler\":_vm.onImageLoad}})],1):_vm._e(),_vm._v(\" \"),(_vm.type === 'video' && !_vm.hidden)?_c('a',{staticClass:\"video-container\",class:{'small': _vm.isSmall},attrs:{\"href\":_vm.allowPlay ? undefined : _vm.attachment.url},on:{\"click\":_vm.openModal}},[_c('VideoAttachment',{staticClass:\"video\",attrs:{\"attachment\":_vm.attachment,\"controls\":_vm.allowPlay}}),_vm._v(\" \"),(!_vm.allowPlay)?_c('i',{staticClass:\"play-icon icon-play-circled\"}):_vm._e()],1):_vm._e(),_vm._v(\" \"),(_vm.type === 'audio')?_c('audio',{attrs:{\"src\":_vm.attachment.url,\"controls\":\"\"}}):_vm._e(),_vm._v(\" \"),(_vm.type === 'html' && _vm.attachment.oembed)?_c('div',{staticClass:\"oembed\",on:{\"click\":function($event){$event.preventDefault();return _vm.linkClicked($event)}}},[(_vm.attachment.thumb_url)?_c('div',{staticClass:\"image\"},[_c('img',{attrs:{\"src\":_vm.attachment.thumb_url}})]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"text\"},[_c('h1',[_c('a',{attrs:{\"href\":_vm.attachment.url}},[_vm._v(_vm._s(_vm.attachment.oembed.title))])]),_vm._v(\" \"),_c('div',{domProps:{\"innerHTML\":_vm._s(_vm.attachment.oembed.oembedHTML)}})])]):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.loggedIn)?_c('div',[_c('i',{staticClass:\"button-icon favorite-button fav-active\",class:_vm.classes,attrs:{\"title\":_vm.$t('tool_tip.favorite')},on:{\"click\":function($event){$event.preventDefault();_vm.favorite()}}}),_vm._v(\" \"),(!_vm.mergedConfig.hidePostStats && _vm.status.fave_num > 0)?_c('span',[_vm._v(_vm._s(_vm.status.fave_num))]):_vm._e()]):_c('div',[_c('i',{staticClass:\"button-icon favorite-button\",class:_vm.classes,attrs:{\"title\":_vm.$t('tool_tip.favorite')}}),_vm._v(\" \"),(!_vm.mergedConfig.hidePostStats && _vm.status.fave_num > 0)?_c('span',[_vm._v(_vm._s(_vm.status.fave_num))]):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.loggedIn)?_c('div',[(_vm.visibility !== 'private' && _vm.visibility !== 'direct')?[_c('i',{staticClass:\"button-icon retweet-button icon-retweet rt-active\",class:_vm.classes,attrs:{\"title\":_vm.$t('tool_tip.repeat')},on:{\"click\":function($event){$event.preventDefault();_vm.retweet()}}}),_vm._v(\" \"),(!_vm.mergedConfig.hidePostStats && _vm.status.repeat_num > 0)?_c('span',[_vm._v(_vm._s(_vm.status.repeat_num))]):_vm._e()]:[_c('i',{staticClass:\"button-icon icon-lock\",class:_vm.classes,attrs:{\"title\":_vm.$t('timeline.no_retweet_hint')}})]],2):(!_vm.loggedIn)?_c('div',[_c('i',{staticClass:\"button-icon icon-retweet\",class:_vm.classes,attrs:{\"title\":_vm.$t('tool_tip.repeat')}}),_vm._v(\" \"),(!_vm.mergedConfig.hidePostStats && _vm.status.repeat_num > 0)?_c('span',[_vm._v(_vm._s(_vm.status.repeat_num))]):_vm._e()]):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('time',{attrs:{\"datetime\":_vm.time,\"title\":_vm.localeDateString}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(_vm.relativeTime.key, [_vm.relativeTime.num]))+\"\\n\")])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"poll\",class:_vm.containerClass},[_vm._l((_vm.options),function(option,index){return _c('div',{key:index,staticClass:\"poll-option\"},[(_vm.showResults)?_c('div',{staticClass:\"option-result\",attrs:{\"title\":_vm.resultTitle(option)}},[_c('div',{staticClass:\"option-result-label\"},[_c('span',{staticClass:\"result-percentage\"},[_vm._v(\"\\n \"+_vm._s(_vm.percentageForOption(option.votes_count))+\"%\\n \")]),_vm._v(\" \"),_c('span',[_vm._v(_vm._s(option.title))])]),_vm._v(\" \"),_c('div',{staticClass:\"result-fill\",style:({ 'width': ((_vm.percentageForOption(option.votes_count)) + \"%\") })})]):_c('div',{on:{\"click\":function($event){_vm.activateOption(index)}}},[(_vm.poll.multiple)?_c('input',{attrs:{\"type\":\"checkbox\",\"disabled\":_vm.loading},domProps:{\"value\":index}}):_c('input',{attrs:{\"type\":\"radio\",\"disabled\":_vm.loading},domProps:{\"value\":index}}),_vm._v(\" \"),_c('label',{staticClass:\"option-vote\"},[_c('div',[_vm._v(_vm._s(option.title))])])])])}),_vm._v(\" \"),_c('div',{staticClass:\"footer faint\"},[(!_vm.showResults)?_c('button',{staticClass:\"btn btn-default poll-vote-button\",attrs:{\"type\":\"button\",\"disabled\":_vm.isDisabled},on:{\"click\":_vm.vote}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('polls.vote'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"total\"},[_vm._v(\"\\n \"+_vm._s(_vm.totalVotesCount)+\" \"+_vm._s(_vm.$t(\"polls.votes\"))+\" · \\n \")]),_vm._v(\" \"),_c('i18n',{attrs:{\"path\":_vm.expired ? 'polls.expired' : 'polls.expires_in'}},[_c('Timeago',{attrs:{\"time\":_vm.expiresAt,\"auto-update\":60,\"now-threshold\":0}})],1)],1)],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.canDelete || _vm.canMute || _vm.canPin)?_c('v-popover',{staticClass:\"extra-button-popover\",attrs:{\"trigger\":\"click\",\"placement\":\"top\"}},[_c('div',{attrs:{\"slot\":\"popover\"},slot:\"popover\"},[_c('div',{staticClass:\"dropdown-menu\"},[(_vm.canMute && !_vm.status.thread_muted)?_c('button',{staticClass:\"dropdown-item dropdown-item-icon\",on:{\"click\":function($event){$event.preventDefault();return _vm.muteConversation($event)}}},[_c('i',{staticClass:\"icon-eye-off\"}),_c('span',[_vm._v(_vm._s(_vm.$t(\"status.mute_conversation\")))])]):_vm._e(),_vm._v(\" \"),(_vm.canMute && _vm.status.thread_muted)?_c('button',{staticClass:\"dropdown-item dropdown-item-icon\",on:{\"click\":function($event){$event.preventDefault();return _vm.unmuteConversation($event)}}},[_c('i',{staticClass:\"icon-eye-off\"}),_c('span',[_vm._v(_vm._s(_vm.$t(\"status.unmute_conversation\")))])]):_vm._e(),_vm._v(\" \"),(!_vm.status.pinned && _vm.canPin)?_c('button',{directives:[{name:\"close-popover\",rawName:\"v-close-popover\"}],staticClass:\"dropdown-item dropdown-item-icon\",on:{\"click\":function($event){$event.preventDefault();return _vm.pinStatus($event)}}},[_c('i',{staticClass:\"icon-pin\"}),_c('span',[_vm._v(_vm._s(_vm.$t(\"status.pin\")))])]):_vm._e(),_vm._v(\" \"),(_vm.status.pinned && _vm.canPin)?_c('button',{directives:[{name:\"close-popover\",rawName:\"v-close-popover\"}],staticClass:\"dropdown-item dropdown-item-icon\",on:{\"click\":function($event){$event.preventDefault();return _vm.unpinStatus($event)}}},[_c('i',{staticClass:\"icon-pin\"}),_c('span',[_vm._v(_vm._s(_vm.$t(\"status.unpin\")))])]):_vm._e(),_vm._v(\" \"),(_vm.canDelete)?_c('button',{directives:[{name:\"close-popover\",rawName:\"v-close-popover\"}],staticClass:\"dropdown-item dropdown-item-icon\",on:{\"click\":function($event){$event.preventDefault();return _vm.deleteStatus($event)}}},[_c('i',{staticClass:\"icon-cancel\"}),_c('span',[_vm._v(_vm._s(_vm.$t(\"status.delete\")))])]):_vm._e()])]),_vm._v(\" \"),_c('div',{staticClass:\"button-icon\"},[_c('i',{staticClass:\"icon-ellipsis\"})])]):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"media-upload\",on:{\"drop\":[function($event){$event.preventDefault();},_vm.fileDrop],\"dragover\":function($event){$event.preventDefault();return _vm.fileDrag($event)}}},[_c('label',{staticClass:\"btn btn-default\",attrs:{\"title\":_vm.$t('tool_tip.media_upload')}},[(_vm.uploading)?_c('i',{staticClass:\"icon-spin4 animate-spin\"}):_vm._e(),_vm._v(\" \"),(!_vm.uploading)?_c('i',{staticClass:\"icon-upload\"}):_vm._e(),_vm._v(\" \"),(_vm.uploadReady)?_c('input',{staticStyle:{\"position\":\"fixed\",\"top\":\"-100em\"},attrs:{\"type\":\"file\",\"multiple\":\"true\"},on:{\"change\":_vm.change}}):_vm._e()])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.showNothing)?_c('div',{staticClass:\"scope-selector\"},[(_vm.showDirect)?_c('i',{staticClass:\"icon-mail-alt\",class:_vm.css.direct,attrs:{\"title\":_vm.$t('post_status.scope.direct')},on:{\"click\":function($event){_vm.changeVis('direct')}}}):_vm._e(),_vm._v(\" \"),(_vm.showPrivate)?_c('i',{staticClass:\"icon-lock\",class:_vm.css.private,attrs:{\"title\":_vm.$t('post_status.scope.private')},on:{\"click\":function($event){_vm.changeVis('private')}}}):_vm._e(),_vm._v(\" \"),(_vm.showUnlisted)?_c('i',{staticClass:\"icon-lock-open-alt\",class:_vm.css.unlisted,attrs:{\"title\":_vm.$t('post_status.scope.unlisted')},on:{\"click\":function($event){_vm.changeVis('unlisted')}}}):_vm._e(),_vm._v(\" \"),(_vm.showPublic)?_c('i',{staticClass:\"icon-globe\",class:_vm.css.public,attrs:{\"title\":_vm.$t('post_status.scope.public')},on:{\"click\":function($event){_vm.changeVis('public')}}}):_vm._e()]):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',{staticClass:\"checkbox\",class:{ disabled: _vm.disabled, indeterminate: _vm.indeterminate }},[_c('input',{attrs:{\"type\":\"checkbox\",\"disabled\":_vm.disabled},domProps:{\"checked\":_vm.checked,\"indeterminate\":_vm.indeterminate},on:{\"change\":function($event){_vm.$emit('change', $event.target.checked)}}}),_vm._v(\" \"),_c('i',{staticClass:\"checkbox-indicator\"}),_vm._v(\" \"),(!!_vm.$slots.default)?_c('span',{staticClass:\"label\"},[_vm._t(\"default\")],2):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"emoji-picker panel panel-default panel-body\"},[_c('div',{staticClass:\"heading\"},[_c('span',{staticClass:\"emoji-tabs\"},_vm._l((_vm.emojis),function(group){return _c('span',{key:group.id,staticClass:\"emoji-tabs-item\",class:{\n active: _vm.activeGroupView === group.id,\n disabled: group.emojis.length === 0\n },attrs:{\"title\":group.text},on:{\"click\":function($event){$event.preventDefault();_vm.highlight(group.id)}}},[_c('i',{class:group.icon})])}),0),_vm._v(\" \"),(_vm.stickerPickerEnabled)?_c('span',{staticClass:\"additional-tabs\"},[_c('span',{staticClass:\"stickers-tab-icon additional-tabs-item\",class:{active: _vm.showingStickers},attrs:{\"title\":_vm.$t('emoji.stickers')},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleStickers($event)}}},[_c('i',{staticClass:\"icon-star\"})])]):_vm._e()]),_vm._v(\" \"),_c('div',{staticClass:\"content\"},[_c('div',{staticClass:\"emoji-content\",class:{hidden: _vm.showingStickers}},[_c('div',{staticClass:\"emoji-search\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.keyword),expression:\"keyword\"}],staticClass:\"form-control\",attrs:{\"type\":\"text\",\"placeholder\":_vm.$t('emoji.search_emoji')},domProps:{\"value\":(_vm.keyword)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.keyword=$event.target.value}}})]),_vm._v(\" \"),_c('div',{ref:\"emoji-groups\",staticClass:\"emoji-groups\",class:_vm.groupsScrolledClass,on:{\"scroll\":_vm.onScroll}},_vm._l((_vm.emojisView),function(group){return _c('div',{key:group.id,staticClass:\"emoji-group\"},[_c('h6',{ref:'group-' + group.id,refInFor:true,staticClass:\"emoji-group-title\"},[_vm._v(\"\\n \"+_vm._s(group.text)+\"\\n \")]),_vm._v(\" \"),_vm._l((group.emojis),function(emoji){return _c('span',{key:group.id + emoji.displayText,staticClass:\"emoji-item\",attrs:{\"title\":emoji.displayText},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();_vm.onEmoji(emoji)}}},[(!emoji.imageUrl)?_c('span',[_vm._v(_vm._s(emoji.replacement))]):_c('img',{attrs:{\"src\":emoji.imageUrl}})])}),_vm._v(\" \"),_c('span',{ref:'group-end-' + group.id,refInFor:true})],2)}),0),_vm._v(\" \"),_c('div',{staticClass:\"keep-open\"},[_c('Checkbox',{model:{value:(_vm.keepOpen),callback:function ($$v) {_vm.keepOpen=$$v},expression:\"keepOpen\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('emoji.keep_open'))+\"\\n \")])],1)]),_vm._v(\" \"),(_vm.showingStickers)?_c('div',{staticClass:\"stickers-content\"},[_c('sticker-picker',{on:{\"uploaded\":_vm.onStickerUploaded,\"upload-failed\":_vm.onStickerUploadFailed}})],1):_vm._e()])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"click-outside\",rawName:\"v-click-outside\",value:(_vm.onClickOutside),expression:\"onClickOutside\"}],staticClass:\"emoji-input\",class:{ 'with-picker': !_vm.hideEmojiButton }},[_vm._t(\"default\"),_vm._v(\" \"),(_vm.enableEmojiPicker)?[(!_vm.hideEmojiButton)?_c('div',{staticClass:\"emoji-picker-icon\",on:{\"click\":function($event){$event.preventDefault();return _vm.togglePicker($event)}}},[_c('i',{staticClass:\"icon-smile\"})]):_vm._e(),_vm._v(\" \"),(_vm.enableEmojiPicker)?_c('EmojiPicker',{ref:\"picker\",staticClass:\"emoji-picker-panel\",class:{ hide: !_vm.showPicker },attrs:{\"enable-sticker-picker\":_vm.enableStickerPicker},on:{\"emoji\":_vm.insert,\"sticker-uploaded\":_vm.onStickerUploaded,\"sticker-upload-failed\":_vm.onStickerUploadFailed}}):_vm._e()]:_vm._e(),_vm._v(\" \"),_c('div',{ref:\"panel\",staticClass:\"autocomplete-panel\",class:{ hide: !_vm.showSuggestions }},[_c('div',{staticClass:\"autocomplete-panel-body\"},_vm._l((_vm.suggestions),function(suggestion,index){return _c('div',{key:index,staticClass:\"autocomplete-item\",class:{ highlighted: suggestion.highlighted },on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();_vm.onClick($event, suggestion)}}},[_c('span',{staticClass:\"image\"},[(suggestion.img)?_c('img',{attrs:{\"src\":suggestion.img}}):_c('span',[_vm._v(_vm._s(suggestion.replacement))])]),_vm._v(\" \"),_c('div',{staticClass:\"label\"},[_c('span',{staticClass:\"displayText\"},[_vm._v(_vm._s(suggestion.displayText))]),_vm._v(\" \"),_c('span',{staticClass:\"detailText\"},[_vm._v(_vm._s(suggestion.detailText))])])])}),0)])],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.visible)?_c('div',{staticClass:\"poll-form\"},[_vm._l((_vm.options),function(option,index){return _c('div',{key:index,staticClass:\"poll-option\"},[_c('div',{staticClass:\"input-container\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.options[index]),expression:\"options[index]\"}],staticClass:\"poll-option-input\",attrs:{\"id\":(\"poll-\" + index),\"type\":\"text\",\"placeholder\":_vm.$t('polls.option'),\"maxlength\":_vm.maxLength},domProps:{\"value\":(_vm.options[index])},on:{\"change\":_vm.updatePollToParent,\"keydown\":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }$event.stopPropagation();$event.preventDefault();_vm.nextOption(index)},\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.options, index, $event.target.value)}}})]),_vm._v(\" \"),(_vm.options.length > 2)?_c('div',{staticClass:\"icon-container\"},[_c('i',{staticClass:\"icon-cancel\",on:{\"click\":function($event){_vm.deleteOption(index)}}})]):_vm._e()])}),_vm._v(\" \"),(_vm.options.length < _vm.maxOptions)?_c('a',{staticClass:\"add-option faint\",on:{\"click\":_vm.addOption}},[_c('i',{staticClass:\"icon-plus\"}),_vm._v(\"\\n \"+_vm._s(_vm.$t(\"polls.add_option\"))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"poll-type-expiry\"},[_c('div',{staticClass:\"poll-type\",attrs:{\"title\":_vm.$t('polls.type')}},[_c('label',{staticClass:\"select\",attrs:{\"for\":\"poll-type-selector\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.pollType),expression:\"pollType\"}],staticClass:\"select\",on:{\"change\":[function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.pollType=$event.target.multiple ? $$selectedVal : $$selectedVal[0]},_vm.updatePollToParent]}},[_c('option',{attrs:{\"value\":\"single\"}},[_vm._v(_vm._s(_vm.$t('polls.single_choice')))]),_vm._v(\" \"),_c('option',{attrs:{\"value\":\"multiple\"}},[_vm._v(_vm._s(_vm.$t('polls.multiple_choices')))])]),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])]),_vm._v(\" \"),_c('div',{staticClass:\"poll-expiry\",attrs:{\"title\":_vm.$t('polls.expiry')}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.expiryAmount),expression:\"expiryAmount\"}],staticClass:\"expiry-amount hide-number-spinner\",attrs:{\"type\":\"number\",\"min\":_vm.minExpirationInCurrentUnit,\"max\":_vm.maxExpirationInCurrentUnit},domProps:{\"value\":(_vm.expiryAmount)},on:{\"change\":_vm.expiryAmountChange,\"input\":function($event){if($event.target.composing){ return; }_vm.expiryAmount=$event.target.value}}}),_vm._v(\" \"),_c('label',{staticClass:\"expiry-unit select\"},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.expiryUnit),expression:\"expiryUnit\"}],on:{\"change\":[function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.expiryUnit=$event.target.multiple ? $$selectedVal : $$selectedVal[0]},_vm.expiryAmountChange]}},_vm._l((_vm.expiryUnits),function(unit){return _c('option',{key:unit,domProps:{\"value\":unit}},[_vm._v(\"\\n \"+_vm._s(_vm.$t((\"time.\" + unit + \"_short\"), ['']))+\"\\n \")])}),0),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])])])],2):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:\"form\",staticClass:\"post-status-form\"},[_c('form',{attrs:{\"autocomplete\":\"off\"},on:{\"submit\":function($event){$event.preventDefault();_vm.postStatus(_vm.newStatus)}}},[_c('div',{staticClass:\"form-group\"},[(!_vm.$store.state.users.currentUser.locked && _vm.newStatus.visibility == 'private')?_c('i18n',{staticClass:\"visibility-notice\",attrs:{\"path\":\"post_status.account_not_locked_warning\",\"tag\":\"p\"}},[_c('router-link',{attrs:{\"to\":{ name: 'user-settings' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('post_status.account_not_locked_warning_link'))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),(!_vm.hideScopeNotice && _vm.newStatus.visibility === 'public')?_c('p',{staticClass:\"visibility-notice notice-dismissible\"},[_c('span',[_vm._v(_vm._s(_vm.$t('post_status.scope_notice.public')))]),_vm._v(\" \"),_c('a',{staticClass:\"button-icon dismiss\",on:{\"click\":function($event){$event.preventDefault();_vm.dismissScopeNotice()}}},[_c('i',{staticClass:\"icon-cancel\"})])]):(!_vm.hideScopeNotice && _vm.newStatus.visibility === 'unlisted')?_c('p',{staticClass:\"visibility-notice notice-dismissible\"},[_c('span',[_vm._v(_vm._s(_vm.$t('post_status.scope_notice.unlisted')))]),_vm._v(\" \"),_c('a',{staticClass:\"button-icon dismiss\",on:{\"click\":function($event){$event.preventDefault();_vm.dismissScopeNotice()}}},[_c('i',{staticClass:\"icon-cancel\"})])]):(!_vm.hideScopeNotice && _vm.newStatus.visibility === 'private' && _vm.$store.state.users.currentUser.locked)?_c('p',{staticClass:\"visibility-notice notice-dismissible\"},[_c('span',[_vm._v(_vm._s(_vm.$t('post_status.scope_notice.private')))]),_vm._v(\" \"),_c('a',{staticClass:\"button-icon dismiss\",on:{\"click\":function($event){$event.preventDefault();_vm.dismissScopeNotice()}}},[_c('i',{staticClass:\"icon-cancel\"})])]):(_vm.newStatus.visibility === 'direct')?_c('p',{staticClass:\"visibility-notice\"},[(_vm.safeDMEnabled)?_c('span',[_vm._v(_vm._s(_vm.$t('post_status.direct_warning_to_first_only')))]):_c('span',[_vm._v(_vm._s(_vm.$t('post_status.direct_warning_to_all')))])]):_vm._e(),_vm._v(\" \"),(_vm.newStatus.spoilerText || _vm.alwaysShowSubject)?_c('EmojiInput',{staticClass:\"form-control\",attrs:{\"enable-emoji-picker\":\"\",\"suggest\":_vm.emojiSuggestor},model:{value:(_vm.newStatus.spoilerText),callback:function ($$v) {_vm.$set(_vm.newStatus, \"spoilerText\", $$v)},expression:\"newStatus.spoilerText\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.newStatus.spoilerText),expression:\"newStatus.spoilerText\"}],staticClass:\"form-post-subject\",attrs:{\"type\":\"text\",\"placeholder\":_vm.$t('post_status.content_warning')},domProps:{\"value\":(_vm.newStatus.spoilerText)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.newStatus, \"spoilerText\", $event.target.value)}}})]):_vm._e(),_vm._v(\" \"),_c('EmojiInput',{ref:\"emoji-input\",staticClass:\"form-control main-input\",attrs:{\"suggest\":_vm.emojiUserSuggestor,\"enable-emoji-picker\":\"\",\"hide-emoji-button\":\"\",\"enable-sticker-picker\":\"\"},on:{\"input\":_vm.onEmojiInputInput,\"sticker-uploaded\":_vm.addMediaFile,\"sticker-upload-failed\":_vm.uploadFailed},model:{value:(_vm.newStatus.status),callback:function ($$v) {_vm.$set(_vm.newStatus, \"status\", $$v)},expression:\"newStatus.status\"}},[_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.newStatus.status),expression:\"newStatus.status\"}],ref:\"textarea\",staticClass:\"form-post-body\",attrs:{\"placeholder\":_vm.$t('post_status.default'),\"rows\":\"1\",\"disabled\":_vm.posting},domProps:{\"value\":(_vm.newStatus.status)},on:{\"keydown\":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }if(!$event.metaKey){ return null; }_vm.postStatus(_vm.newStatus)},\"keyup\":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }if(!$event.ctrlKey){ return null; }_vm.postStatus(_vm.newStatus)},\"drop\":_vm.fileDrop,\"dragover\":function($event){$event.preventDefault();return _vm.fileDrag($event)},\"input\":[function($event){if($event.target.composing){ return; }_vm.$set(_vm.newStatus, \"status\", $event.target.value)},_vm.resize],\"compositionupdate\":_vm.resize,\"paste\":_vm.paste}}),_vm._v(\" \"),(_vm.hasStatusLengthLimit)?_c('p',{staticClass:\"character-counter faint\",class:{ error: _vm.isOverLengthLimit }},[_vm._v(\"\\n \"+_vm._s(_vm.charactersLeft)+\"\\n \")]):_vm._e()]),_vm._v(\" \"),_c('div',{staticClass:\"visibility-tray\"},[_c('scope-selector',{attrs:{\"show-all\":_vm.showAllScopes,\"user-default\":_vm.userDefaultScope,\"original-scope\":_vm.copyMessageScope,\"initial-scope\":_vm.newStatus.visibility,\"on-scope-change\":_vm.changeVis}}),_vm._v(\" \"),(_vm.postFormats.length > 1)?_c('div',{staticClass:\"text-format\"},[_c('label',{staticClass:\"select\",attrs:{\"for\":\"post-content-type\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.newStatus.contentType),expression:\"newStatus.contentType\"}],staticClass:\"form-control\",attrs:{\"id\":\"post-content-type\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.$set(_vm.newStatus, \"contentType\", $event.target.multiple ? $$selectedVal : $$selectedVal[0])}}},_vm._l((_vm.postFormats),function(postFormat){return _c('option',{key:postFormat,domProps:{\"value\":postFormat}},[_vm._v(\"\\n \"+_vm._s(_vm.$t((\"post_status.content_type[\\\"\" + postFormat + \"\\\"]\")))+\"\\n \")])}),0),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])]):_vm._e(),_vm._v(\" \"),(_vm.postFormats.length === 1 && _vm.postFormats[0] !== 'text/plain')?_c('div',{staticClass:\"text-format\"},[_c('span',{staticClass:\"only-format\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t((\"post_status.content_type[\\\"\" + (_vm.postFormats[0]) + \"\\\"]\")))+\"\\n \")])]):_vm._e()],1)],1),_vm._v(\" \"),(_vm.pollsAvailable)?_c('poll-form',{ref:\"pollForm\",attrs:{\"visible\":_vm.pollFormVisible},on:{\"update-poll\":_vm.setPoll}}):_vm._e(),_vm._v(\" \"),_c('div',{ref:\"bottom\",staticClass:\"form-bottom\"},[_c('div',{staticClass:\"form-bottom-left\"},[_c('media-upload',{ref:\"mediaUpload\",staticClass:\"media-upload-icon\",attrs:{\"drop-files\":_vm.dropFiles},on:{\"uploading\":_vm.disableSubmit,\"uploaded\":_vm.addMediaFile,\"upload-failed\":_vm.uploadFailed}}),_vm._v(\" \"),_c('div',{staticClass:\"emoji-icon\"},[_c('i',{staticClass:\"icon-smile btn btn-default\",attrs:{\"title\":_vm.$t('emoji.add_emoji')},on:{\"click\":_vm.showEmojiPicker}})]),_vm._v(\" \"),(_vm.pollsAvailable)?_c('div',{staticClass:\"poll-icon\",class:{ selected: _vm.pollFormVisible }},[_c('i',{staticClass:\"icon-chart-bar btn btn-default\",attrs:{\"title\":_vm.$t('polls.add_poll')},on:{\"click\":_vm.togglePollForm}})]):_vm._e()],1),_vm._v(\" \"),(_vm.posting)?_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":\"\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('post_status.posting'))+\"\\n \")]):(_vm.isOverLengthLimit)?_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":\"\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")]):_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.submitDisabled,\"type\":\"submit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")])]),_vm._v(\" \"),(_vm.error)?_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n Error: \"+_vm._s(_vm.error)+\"\\n \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":_vm.clearError}})]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"attachments\"},_vm._l((_vm.newStatus.files),function(file){return _c('div',{key:file.url,staticClass:\"media-upload-wrapper\"},[_c('i',{staticClass:\"fa button-icon icon-cancel\",on:{\"click\":function($event){_vm.removeMediaFile(file)}}}),_vm._v(\" \"),_c('div',{staticClass:\"media-upload-container attachment\"},[(_vm.type(file) === 'image')?_c('img',{staticClass:\"thumbnail media-upload\",attrs:{\"src\":file.url}}):_vm._e(),_vm._v(\" \"),(_vm.type(file) === 'video')?_c('video',{attrs:{\"src\":file.url,\"controls\":\"\"}}):_vm._e(),_vm._v(\" \"),(_vm.type(file) === 'audio')?_c('audio',{attrs:{\"src\":file.url,\"controls\":\"\"}}):_vm._e(),_vm._v(\" \"),(_vm.type(file) === 'unknown')?_c('a',{attrs:{\"href\":file.url}},[_vm._v(_vm._s(file.url))]):_vm._e()])])}),0),_vm._v(\" \"),(_vm.newStatus.files.length > 0)?_c('div',{staticClass:\"upload_settings\"},[_c('Checkbox',{model:{value:(_vm.newStatus.nsfw),callback:function ($$v) {_vm.$set(_vm.newStatus, \"nsfw\", $$v)},expression:\"newStatus.nsfw\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('post_status.attachments_sensitive'))+\"\\n \")])],1):_vm._e()],1)])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('StillImage',{staticClass:\"avatar\",class:{ 'avatar-compact': _vm.compact, 'better-shadow': _vm.betterShadow },attrs:{\"alt\":_vm.user.screen_name,\"title\":_vm.user.screen_name,\"src\":_vm.imgSrc,\"image-load-error\":_vm.imageLoadError}})}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"remote-follow\"},[_c('form',{attrs:{\"method\":\"POST\",\"action\":_vm.subscribeUrl}},[_c('input',{attrs:{\"type\":\"hidden\",\"name\":\"nickname\"},domProps:{\"value\":_vm.user.screen_name}}),_vm._v(\" \"),_c('input',{attrs:{\"type\":\"hidden\",\"name\":\"profile\",\"value\":\"\"}}),_vm._v(\" \"),_c('button',{staticClass:\"remote-button\",attrs:{\"click\":\"submit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.remote_follow'))+\"\\n \")])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('button',{attrs:{\"disabled\":_vm.progress || _vm.disabled},on:{\"click\":_vm.onClick}},[(_vm.progress && _vm.$slots.progress)?[_vm._t(\"progress\")]:[_vm._t(\"default\")]],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('button',{staticClass:\"btn btn-default follow-button\",class:{ pressed: _vm.isPressed },attrs:{\"disabled\":_vm.inProgress,\"title\":_vm.title},on:{\"click\":_vm.onClick}},[_vm._v(\"\\n \"+_vm._s(_vm.label)+\"\\n\")])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{class:{ 'dark-overlay': _vm.darkOverlay },on:{\"click\":function($event){if($event.target !== $event.currentTarget){ return null; }$event.stopPropagation();_vm.onCancel()}}},[_c('div',{staticClass:\"dialog-modal panel panel-default\",on:{\"click\":function($event){$event.stopPropagation();}}},[_c('div',{staticClass:\"panel-heading dialog-modal-heading\"},[_c('div',{staticClass:\"title\"},[_vm._t(\"header\")],2)]),_vm._v(\" \"),_c('div',{staticClass:\"dialog-modal-content\"},[_vm._t(\"default\")],2),_vm._v(\" \"),_c('div',{staticClass:\"dialog-modal-footer user-interactions panel-footer\"},[_vm._t(\"footer\")],2)])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('v-popover',{staticClass:\"moderation-tools-popover\",attrs:{\"trigger\":\"click\",\"placement\":\"bottom-end\"},on:{\"show\":function($event){_vm.showDropDown = true},\"hide\":function($event){_vm.showDropDown = false}}},[_c('div',{attrs:{\"slot\":\"popover\"},slot:\"popover\"},[_c('div',{staticClass:\"dropdown-menu\"},[(_vm.user.is_local)?_c('span',[_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleRight(\"admin\")}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(!!_vm.user.rights.admin ? 'user_card.admin_menu.revoke_admin' : 'user_card.admin_menu.grant_admin'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleRight(\"moderator\")}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(!!_vm.user.rights.moderator ? 'user_card.admin_menu.revoke_moderator' : 'user_card.admin_menu.grant_moderator'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"dropdown-divider\",attrs:{\"role\":\"separator\"}})]):_vm._e(),_vm._v(\" \"),_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleActivationStatus()}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(!!_vm.user.deactivated ? 'user_card.admin_menu.activate_account' : 'user_card.admin_menu.deactivate_account'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.deleteUserDialog(true)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.delete_account'))+\"\\n \")]),_vm._v(\" \"),(_vm.hasTagPolicy)?_c('div',{staticClass:\"dropdown-divider\",attrs:{\"role\":\"separator\"}}):_vm._e(),_vm._v(\" \"),(_vm.hasTagPolicy)?_c('span',[_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleTag(_vm.tags.FORCE_NSFW)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.force_nsfw'))+\"\\n \"),_c('span',{staticClass:\"menu-checkbox\",class:{ 'menu-checkbox-checked': _vm.hasTag(_vm.tags.FORCE_NSFW) }})]),_vm._v(\" \"),_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleTag(_vm.tags.STRIP_MEDIA)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.strip_media'))+\"\\n \"),_c('span',{staticClass:\"menu-checkbox\",class:{ 'menu-checkbox-checked': _vm.hasTag(_vm.tags.STRIP_MEDIA) }})]),_vm._v(\" \"),_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleTag(_vm.tags.FORCE_UNLISTED)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.force_unlisted'))+\"\\n \"),_c('span',{staticClass:\"menu-checkbox\",class:{ 'menu-checkbox-checked': _vm.hasTag(_vm.tags.FORCE_UNLISTED) }})]),_vm._v(\" \"),_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleTag(_vm.tags.SANDBOX)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.sandbox'))+\"\\n \"),_c('span',{staticClass:\"menu-checkbox\",class:{ 'menu-checkbox-checked': _vm.hasTag(_vm.tags.SANDBOX) }})]),_vm._v(\" \"),(_vm.user.is_local)?_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleTag(_vm.tags.DISABLE_REMOTE_SUBSCRIPTION)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.disable_remote_subscription'))+\"\\n \"),_c('span',{staticClass:\"menu-checkbox\",class:{ 'menu-checkbox-checked': _vm.hasTag(_vm.tags.DISABLE_REMOTE_SUBSCRIPTION) }})]):_vm._e(),_vm._v(\" \"),(_vm.user.is_local)?_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleTag(_vm.tags.DISABLE_ANY_SUBSCRIPTION)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.disable_any_subscription'))+\"\\n \"),_c('span',{staticClass:\"menu-checkbox\",class:{ 'menu-checkbox-checked': _vm.hasTag(_vm.tags.DISABLE_ANY_SUBSCRIPTION) }})]):_vm._e(),_vm._v(\" \"),(_vm.user.is_local)?_c('button',{staticClass:\"dropdown-item\",on:{\"click\":function($event){_vm.toggleTag(_vm.tags.QUARANTINE)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.quarantine'))+\"\\n \"),_c('span',{staticClass:\"menu-checkbox\",class:{ 'menu-checkbox-checked': _vm.hasTag(_vm.tags.QUARANTINE) }})]):_vm._e()]):_vm._e()])]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default btn-block\",class:{ pressed: _vm.showDropDown }},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.moderation'))+\"\\n \")])]),_vm._v(\" \"),_c('portal',{attrs:{\"to\":\"modal\"}},[(_vm.showDeleteUserDialog)?_c('DialogModal',{attrs:{\"on-cancel\":_vm.deleteUserDialog.bind(this, false)}},[_c('template',{slot:\"header\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.delete_user'))+\"\\n \")]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('user_card.admin_menu.delete_user_confirmation')))]),_vm._v(\" \"),_c('template',{slot:\"footer\"},[_c('button',{staticClass:\"btn btn-default\",on:{\"click\":function($event){_vm.deleteUserDialog(false)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.cancel'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default danger\",on:{\"click\":function($event){_vm.deleteUser()}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.admin_menu.delete_user'))+\"\\n \")])])],2):_vm._e()],1)],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"account-actions\"},[_c('v-popover',{staticClass:\"account-tools-popover\",attrs:{\"trigger\":\"click\",\"container\":false,\"placement\":\"bottom-end\",\"offset\":5}},[_c('div',{attrs:{\"slot\":\"popover\"},slot:\"popover\"},[_c('div',{staticClass:\"dropdown-menu\"},[_c('button',{staticClass:\"btn btn-default btn-block dropdown-item\",on:{\"click\":_vm.mentionUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.mention'))+\"\\n \")]),_vm._v(\" \"),(_vm.user.following)?[_c('div',{staticClass:\"dropdown-divider\",attrs:{\"role\":\"separator\"}}),_vm._v(\" \"),(_vm.user.showing_reblogs)?_c('button',{staticClass:\"btn btn-default dropdown-item\",on:{\"click\":_vm.hideRepeats}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.hide_repeats'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(!_vm.user.showing_reblogs)?_c('button',{staticClass:\"btn btn-default dropdown-item\",on:{\"click\":_vm.showRepeats}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.show_repeats'))+\"\\n \")]):_vm._e()]:_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"dropdown-divider\",attrs:{\"role\":\"separator\"}}),_vm._v(\" \"),(_vm.user.statusnet_blocking)?_c('button',{staticClass:\"btn btn-default btn-block dropdown-item\",on:{\"click\":_vm.unblockUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unblock'))+\"\\n \")]):_c('button',{staticClass:\"btn btn-default btn-block dropdown-item\",on:{\"click\":_vm.blockUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.block'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default btn-block dropdown-item\",on:{\"click\":_vm.reportUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.report'))+\"\\n \")])],2)]),_vm._v(\" \"),_c('div',{staticClass:\"btn btn-default ellipsis-button\"},[_c('i',{staticClass:\"icon-ellipsis trigger-button\"})])])],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"user-card\",class:_vm.classes},[_c('div',{staticClass:\"background-image\",class:{ 'hide-bio': _vm.hideBio },style:(_vm.style)}),_vm._v(\" \"),_c('div',{staticClass:\"panel-heading\"},[_c('div',{staticClass:\"user-info\"},[_c('div',{staticClass:\"container\"},[(_vm.allowZoomingAvatar)?_c('a',{staticClass:\"user-info-avatar-link\",on:{\"click\":_vm.zoomAvatar}},[_c('UserAvatar',{attrs:{\"better-shadow\":_vm.betterShadow,\"user\":_vm.user}}),_vm._v(\" \"),_vm._m(0)],1):_c('router-link',{attrs:{\"to\":_vm.userProfileLink(_vm.user)}},[_c('UserAvatar',{attrs:{\"better-shadow\":_vm.betterShadow,\"user\":_vm.user}})],1),_vm._v(\" \"),_c('div',{staticClass:\"user-summary\"},[_c('div',{staticClass:\"top-line\"},[(_vm.user.name_html)?_c('div',{staticClass:\"user-name\",attrs:{\"title\":_vm.user.name},domProps:{\"innerHTML\":_vm._s(_vm.user.name_html)}}):_c('div',{staticClass:\"user-name\",attrs:{\"title\":_vm.user.name}},[_vm._v(\"\\n \"+_vm._s(_vm.user.name)+\"\\n \")]),_vm._v(\" \"),(!_vm.isOtherUser)?_c('router-link',{attrs:{\"to\":{ name: 'user-settings' }}},[_c('i',{staticClass:\"button-icon icon-wrench usersettings\",attrs:{\"title\":_vm.$t('tool_tip.user_settings')}})]):_vm._e(),_vm._v(\" \"),(_vm.isOtherUser && !_vm.user.is_local)?_c('a',{attrs:{\"href\":_vm.user.statusnet_profile_url,\"target\":\"_blank\"}},[_c('i',{staticClass:\"icon-link-ext usersettings\"})]):_vm._e(),_vm._v(\" \"),(_vm.isOtherUser && _vm.loggedIn)?_c('AccountActions',{attrs:{\"user\":_vm.user}}):_vm._e()],1),_vm._v(\" \"),_c('div',{staticClass:\"bottom-line\"},[_c('router-link',{staticClass:\"user-screen-name\",attrs:{\"to\":_vm.userProfileLink(_vm.user)}},[_vm._v(\"\\n @\"+_vm._s(_vm.user.screen_name)+\"\\n \")]),_vm._v(\" \"),(!_vm.hideBio && !!_vm.visibleRole)?_c('span',{staticClass:\"alert staff\"},[_vm._v(_vm._s(_vm.visibleRole))]):_vm._e(),_vm._v(\" \"),(_vm.user.locked)?_c('span',[_c('i',{staticClass:\"icon icon-lock\"})]):_vm._e(),_vm._v(\" \"),(!_vm.mergedConfig.hideUserStats && !_vm.hideBio)?_c('span',{staticClass:\"dailyAvg\"},[_vm._v(_vm._s(_vm.dailyAvg)+\" \"+_vm._s(_vm.$t('user_card.per_day')))]):_vm._e()],1)])],1),_vm._v(\" \"),_c('div',{staticClass:\"user-meta\"},[(_vm.user.follows_you && _vm.loggedIn && _vm.isOtherUser)?_c('div',{staticClass:\"following\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.follows_you'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.isOtherUser && (_vm.loggedIn || !_vm.switcher))?_c('div',{staticClass:\"highlighter\"},[(_vm.userHighlightType !== 'disabled')?_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.userHighlightColor),expression:\"userHighlightColor\"}],staticClass:\"userHighlightText\",attrs:{\"id\":'userHighlightColorTx'+_vm.user.id,\"type\":\"text\"},domProps:{\"value\":(_vm.userHighlightColor)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.userHighlightColor=$event.target.value}}}):_vm._e(),_vm._v(\" \"),(_vm.userHighlightType !== 'disabled')?_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.userHighlightColor),expression:\"userHighlightColor\"}],staticClass:\"userHighlightCl\",attrs:{\"id\":'userHighlightColor'+_vm.user.id,\"type\":\"color\"},domProps:{\"value\":(_vm.userHighlightColor)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.userHighlightColor=$event.target.value}}}):_vm._e(),_vm._v(\" \"),_c('label',{staticClass:\"userHighlightSel select\",attrs:{\"for\":\"style-switcher\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.userHighlightType),expression:\"userHighlightType\"}],staticClass:\"userHighlightSel\",attrs:{\"id\":'userHighlightSel'+_vm.user.id},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.userHighlightType=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},[_c('option',{attrs:{\"value\":\"disabled\"}},[_vm._v(\"No highlight\")]),_vm._v(\" \"),_c('option',{attrs:{\"value\":\"solid\"}},[_vm._v(\"Solid bg\")]),_vm._v(\" \"),_c('option',{attrs:{\"value\":\"striped\"}},[_vm._v(\"Striped bg\")]),_vm._v(\" \"),_c('option',{attrs:{\"value\":\"side\"}},[_vm._v(\"Side stripe\")])]),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])]):_vm._e()]),_vm._v(\" \"),(_vm.loggedIn && _vm.isOtherUser)?_c('div',{staticClass:\"user-interactions\"},[_c('div',{staticClass:\"btn-group\"},[_c('FollowButton',{attrs:{\"user\":_vm.user}}),_vm._v(\" \"),(_vm.user.following)?[(!_vm.user.subscribed)?_c('ProgressButton',{staticClass:\"btn btn-default\",attrs:{\"click\":_vm.subscribeUser,\"title\":_vm.$t('user_card.subscribe')}},[_c('i',{staticClass:\"icon-bell-alt\"})]):_c('ProgressButton',{staticClass:\"btn btn-default pressed\",attrs:{\"click\":_vm.unsubscribeUser,\"title\":_vm.$t('user_card.unsubscribe')}},[_c('i',{staticClass:\"icon-bell-ringing-o\"})])]:_vm._e()],2),_vm._v(\" \"),_c('div',[(_vm.user.muted)?_c('button',{staticClass:\"btn btn-default btn-block pressed\",on:{\"click\":_vm.unmuteUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.muted'))+\"\\n \")]):_c('button',{staticClass:\"btn btn-default btn-block\",on:{\"click\":_vm.muteUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.mute'))+\"\\n \")])]),_vm._v(\" \"),(_vm.loggedIn.role === \"admin\")?_c('ModerationTools',{attrs:{\"user\":_vm.user}}):_vm._e()],1):_vm._e(),_vm._v(\" \"),(!_vm.loggedIn && _vm.user.is_local)?_c('div',{staticClass:\"user-interactions\"},[_c('RemoteFollow',{attrs:{\"user\":_vm.user}})],1):_vm._e()])]),_vm._v(\" \"),(!_vm.hideBio)?_c('div',{staticClass:\"panel-body\"},[(!_vm.mergedConfig.hideUserStats && _vm.switcher)?_c('div',{staticClass:\"user-counts\"},[_c('div',{staticClass:\"user-count\",on:{\"click\":function($event){$event.preventDefault();_vm.setProfileView('statuses')}}},[_c('h5',[_vm._v(_vm._s(_vm.$t('user_card.statuses')))]),_vm._v(\" \"),_c('span',[_vm._v(_vm._s(_vm.user.statuses_count)+\" \"),_c('br')])]),_vm._v(\" \"),_c('div',{staticClass:\"user-count\",on:{\"click\":function($event){$event.preventDefault();_vm.setProfileView('friends')}}},[_c('h5',[_vm._v(_vm._s(_vm.$t('user_card.followees')))]),_vm._v(\" \"),_c('span',[_vm._v(_vm._s(_vm.user.friends_count))])]),_vm._v(\" \"),_c('div',{staticClass:\"user-count\",on:{\"click\":function($event){$event.preventDefault();_vm.setProfileView('followers')}}},[_c('h5',[_vm._v(_vm._s(_vm.$t('user_card.followers')))]),_vm._v(\" \"),_c('span',[_vm._v(_vm._s(_vm.user.followers_count))])])]):_vm._e(),_vm._v(\" \"),(!_vm.hideBio && _vm.user.description_html)?_c('p',{staticClass:\"user-card-bio\",domProps:{\"innerHTML\":_vm._s(_vm.user.description_html)},on:{\"click\":function($event){$event.preventDefault();return _vm.linkClicked($event)}}}):(!_vm.hideBio)?_c('p',{staticClass:\"user-card-bio\"},[_vm._v(\"\\n \"+_vm._s(_vm.user.description)+\"\\n \")]):_vm._e()]):_vm._e()])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"user-info-avatar-link-overlay\"},[_c('i',{staticClass:\"button-icon icon-zoom-in\"})])}]\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:\"galleryContainer\",staticStyle:{\"width\":\"100%\"}},_vm._l((_vm.rows),function(row,index){return _c('div',{key:index,staticClass:\"gallery-row\",class:{ 'contain-fit': _vm.useContainFit, 'cover-fit': !_vm.useContainFit },style:(_vm.rowStyle(row.length))},[_c('div',{staticClass:\"gallery-row-inner\"},_vm._l((row),function(attachment){return _c('attachment',{key:attachment.id,style:(_vm.itemStyle(attachment.id, row)),attrs:{\"set-media\":_vm.setMedia,\"nsfw\":_vm.nsfw,\"attachment\":attachment,\"allow-play\":false,\"natural-size-load\":_vm.onNaturalSizeLoad.bind(null, attachment.id)}})}),1)])}),0)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('a',{staticClass:\"link-preview-card\",attrs:{\"href\":_vm.card.url,\"target\":\"_blank\",\"rel\":\"noopener\"}},[(_vm.useImage && _vm.imageLoaded)?_c('div',{staticClass:\"card-image\",class:{ 'small-image': _vm.size === 'small' }},[_c('img',{attrs:{\"src\":_vm.card.image}})]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"card-content\"},[_c('span',{staticClass:\"card-host faint\"},[_vm._v(_vm._s(_vm.card.provider_name))]),_vm._v(\" \"),_c('h4',{staticClass:\"card-title\"},[_vm._v(_vm._s(_vm.card.title))]),_vm._v(\" \"),(_vm.useDescription)?_c('p',{staticClass:\"card-description\"},[_vm._v(_vm._s(_vm.card.description))]):_vm._e()])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"avatars\"},_vm._l((_vm.slicedUsers),function(user){return _c('router-link',{key:user.id,staticClass:\"avatars-item\",attrs:{\"to\":_vm.userProfileLink(user)}},[_c('UserAvatar',{staticClass:\"avatar-small\",attrs:{\"user\":user}})],1)}),1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-popover',{attrs:{\"popover-class\":\"status-popover\",\"placement\":\"top-start\",\"popper-options\":_vm.popperOptions},on:{\"show\":function($event){_vm.enter()}}},[_c('template',{slot:\"popover\"},[(_vm.status)?_c('Status',{attrs:{\"is-preview\":true,\"statusoid\":_vm.status,\"compact\":true}}):_c('div',{staticClass:\"status-preview-loading\"},[_c('i',{staticClass:\"icon-spin4 animate-spin\"})])],1),_vm._v(\" \"),_vm._t(\"default\")],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.hideStatus)?_c('div',{staticClass:\"status-el\",class:[{ 'status-el_focused': _vm.isFocused }, { 'status-conversation': _vm.inlineExpanded }]},[(_vm.error)?_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.error)+\"\\n \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":_vm.clearError}})]):_vm._e(),_vm._v(\" \"),(_vm.muted && !_vm.isPreview)?[_c('div',{staticClass:\"media status container muted\"},[_c('small',[_c('router-link',{attrs:{\"to\":_vm.userProfileLink}},[_vm._v(\"\\n \"+_vm._s(_vm.status.user.screen_name)+\"\\n \")])],1),_vm._v(\" \"),_c('small',{staticClass:\"muteWords\"},[_vm._v(_vm._s(_vm.muteWordHits.join(', ')))]),_vm._v(\" \"),_c('a',{staticClass:\"unmute\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleMute($event)}}},[_c('i',{staticClass:\"button-icon icon-eye-off\"})])])]:[(_vm.showPinned)?_c('div',{staticClass:\"status-pin\"},[_c('i',{staticClass:\"fa icon-pin faint\"}),_vm._v(\" \"),_c('span',{staticClass:\"faint\"},[_vm._v(_vm._s(_vm.$t('status.pinned')))])]):_vm._e(),_vm._v(\" \"),(_vm.retweet && !_vm.noHeading && !_vm.inConversation)?_c('div',{staticClass:\"media container retweet-info\",class:[_vm.repeaterClass, { highlighted: _vm.repeaterStyle }],style:([_vm.repeaterStyle])},[(_vm.retweet)?_c('UserAvatar',{staticClass:\"media-left\",attrs:{\"better-shadow\":_vm.betterShadow,\"user\":_vm.statusoid.user}}):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"media-body faint\"},[_c('span',{staticClass:\"user-name\"},[(_vm.retweeterHtml)?_c('router-link',{attrs:{\"to\":_vm.retweeterProfileLink},domProps:{\"innerHTML\":_vm._s(_vm.retweeterHtml)}}):_c('router-link',{attrs:{\"to\":_vm.retweeterProfileLink}},[_vm._v(_vm._s(_vm.retweeter))])],1),_vm._v(\" \"),_c('i',{staticClass:\"fa icon-retweet retweeted\",attrs:{\"title\":_vm.$t('tool_tip.repeat')}}),_vm._v(\"\\n \"+_vm._s(_vm.$t('timeline.repeated'))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"media status\",class:[_vm.userClass, { highlighted: _vm.userStyle, 'is-retweet': _vm.retweet && !_vm.inConversation }],style:([ _vm.userStyle ]),attrs:{\"data-tags\":_vm.tags}},[(!_vm.noHeading)?_c('div',{staticClass:\"media-left\"},[_c('router-link',{attrs:{\"to\":_vm.userProfileLink},nativeOn:{\"!click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.toggleUserExpanded($event)}}},[_c('UserAvatar',{attrs:{\"compact\":_vm.compact,\"better-shadow\":_vm.betterShadow,\"user\":_vm.status.user}})],1)],1):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"status-body\"},[(_vm.userExpanded)?_c('UserCard',{staticClass:\"status-usercard\",attrs:{\"user\":_vm.status.user,\"rounded\":true,\"bordered\":true}}):_vm._e(),_vm._v(\" \"),(!_vm.noHeading)?_c('div',{staticClass:\"media-heading\"},[_c('div',{staticClass:\"heading-name-row\"},[_c('div',{staticClass:\"name-and-account-name\"},[(_vm.status.user.name_html)?_c('h4',{staticClass:\"user-name\",domProps:{\"innerHTML\":_vm._s(_vm.status.user.name_html)}}):_c('h4',{staticClass:\"user-name\"},[_vm._v(\"\\n \"+_vm._s(_vm.status.user.name)+\"\\n \")]),_vm._v(\" \"),_c('router-link',{staticClass:\"account-name\",attrs:{\"to\":_vm.userProfileLink}},[_vm._v(\"\\n \"+_vm._s(_vm.status.user.screen_name)+\"\\n \")])],1),_vm._v(\" \"),_c('span',{staticClass:\"heading-right\"},[_c('router-link',{staticClass:\"timeago faint-link\",attrs:{\"to\":{ name: 'conversation', params: { id: _vm.status.id } }}},[_c('Timeago',{attrs:{\"time\":_vm.status.created_at,\"auto-update\":60}})],1),_vm._v(\" \"),(_vm.status.visibility)?_c('div',{staticClass:\"button-icon visibility-icon\"},[_c('i',{class:_vm.visibilityIcon(_vm.status.visibility),attrs:{\"title\":_vm._f(\"capitalize\")(_vm.status.visibility)}})]):_vm._e(),_vm._v(\" \"),(!_vm.status.is_local && !_vm.isPreview)?_c('a',{staticClass:\"source_url\",attrs:{\"href\":_vm.status.external_url,\"target\":\"_blank\",\"title\":\"Source\"}},[_c('i',{staticClass:\"button-icon icon-link-ext-alt\"})]):_vm._e(),_vm._v(\" \"),(_vm.expandable && !_vm.isPreview)?[_c('a',{attrs:{\"href\":\"#\",\"title\":\"Expand\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleExpanded($event)}}},[_c('i',{staticClass:\"button-icon icon-plus-squared\"})])]:_vm._e(),_vm._v(\" \"),(_vm.unmuted)?_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleMute($event)}}},[_c('i',{staticClass:\"button-icon icon-eye-off\"})]):_vm._e()],2)]),_vm._v(\" \"),_c('div',{staticClass:\"heading-reply-row\"},[(_vm.isReply)?_c('div',{staticClass:\"reply-to-and-accountname\"},[(!_vm.isPreview)?_c('StatusPopover',{attrs:{\"status-id\":_vm.status.in_reply_to_status_id}},[_c('a',{staticClass:\"reply-to\",attrs:{\"href\":\"#\",\"aria-label\":_vm.$t('tool_tip.reply')},on:{\"click\":function($event){$event.preventDefault();_vm.gotoOriginal(_vm.status.in_reply_to_status_id)}}},[_c('i',{staticClass:\"button-icon icon-reply\"}),_vm._v(\" \"),_c('span',{staticClass:\"faint-link reply-to-text\"},[_vm._v(_vm._s(_vm.$t('status.reply_to')))])])]):_c('span',{staticClass:\"reply-to\"},[_c('span',{staticClass:\"reply-to-text\"},[_vm._v(_vm._s(_vm.$t('status.reply_to')))])]),_vm._v(\" \"),_c('router-link',{attrs:{\"to\":_vm.replyProfileLink}},[_vm._v(\"\\n \"+_vm._s(_vm.replyToName)+\"\\n \")]),_vm._v(\" \"),(_vm.replies && _vm.replies.length)?_c('span',{staticClass:\"faint replies-separator\"},[_vm._v(\"\\n -\\n \")]):_vm._e()],1):_vm._e(),_vm._v(\" \"),(_vm.inConversation && !_vm.isPreview && _vm.replies && _vm.replies.length)?_c('div',{staticClass:\"replies\"},[_c('span',{staticClass:\"faint\"},[_vm._v(_vm._s(_vm.$t('status.replies_list')))]),_vm._v(\" \"),_vm._l((_vm.replies),function(reply){return _c('StatusPopover',{key:reply.id,attrs:{\"status-id\":reply.id}},[_c('a',{staticClass:\"reply-link\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();_vm.gotoOriginal(reply.id)}}},[_vm._v(_vm._s(reply.name))])])})],2):_vm._e()])]):_vm._e(),_vm._v(\" \"),(_vm.longSubject)?_c('div',{staticClass:\"status-content-wrapper\",class:{ 'tall-status': !_vm.showingLongSubject }},[(!_vm.showingLongSubject)?_c('a',{staticClass:\"tall-status-hider\",class:{ 'tall-status-hider_focused': _vm.isFocused },attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();_vm.showingLongSubject=true}}},[_vm._v(_vm._s(_vm.$t(\"general.show_more\")))]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"status-content media-body\",domProps:{\"innerHTML\":_vm._s(_vm.contentHtml)},on:{\"click\":function($event){$event.preventDefault();return _vm.linkClicked($event)}}}),_vm._v(\" \"),(_vm.showingLongSubject)?_c('a',{staticClass:\"status-unhider\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();_vm.showingLongSubject=false}}},[_vm._v(_vm._s(_vm.$t(\"general.show_less\")))]):_vm._e()]):_c('div',{staticClass:\"status-content-wrapper\",class:{'tall-status': _vm.hideTallStatus}},[(_vm.hideTallStatus)?_c('a',{staticClass:\"tall-status-hider\",class:{ 'tall-status-hider_focused': _vm.isFocused },attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleShowMore($event)}}},[_vm._v(_vm._s(_vm.$t(\"general.show_more\")))]):_vm._e(),_vm._v(\" \"),(!_vm.hideSubjectStatus)?_c('div',{staticClass:\"status-content media-body\",domProps:{\"innerHTML\":_vm._s(_vm.contentHtml)},on:{\"click\":function($event){$event.preventDefault();return _vm.linkClicked($event)}}}):_c('div',{staticClass:\"status-content media-body\",domProps:{\"innerHTML\":_vm._s(_vm.status.summary_html)},on:{\"click\":function($event){$event.preventDefault();return _vm.linkClicked($event)}}}),_vm._v(\" \"),(_vm.hideSubjectStatus)?_c('a',{staticClass:\"cw-status-hider\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleShowMore($event)}}},[_vm._v(_vm._s(_vm.$t(\"general.show_more\")))]):_vm._e(),_vm._v(\" \"),(_vm.showingMore)?_c('a',{staticClass:\"status-unhider\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleShowMore($event)}}},[_vm._v(_vm._s(_vm.$t(\"general.show_less\")))]):_vm._e()]),_vm._v(\" \"),(_vm.status.poll && _vm.status.poll.options)?_c('div',[_c('poll',{attrs:{\"base-poll\":_vm.status.poll}})],1):_vm._e(),_vm._v(\" \"),(_vm.status.attachments && (!_vm.hideSubjectStatus || _vm.showingLongSubject))?_c('div',{staticClass:\"attachments media-body\"},[_vm._l((_vm.nonGalleryAttachments),function(attachment){return _c('attachment',{key:attachment.id,staticClass:\"non-gallery\",attrs:{\"size\":_vm.attachmentSize,\"nsfw\":_vm.nsfwClickthrough,\"attachment\":attachment,\"allow-play\":true,\"set-media\":_vm.setMedia()}})}),_vm._v(\" \"),(_vm.galleryAttachments.length > 0)?_c('gallery',{attrs:{\"nsfw\":_vm.nsfwClickthrough,\"attachments\":_vm.galleryAttachments,\"set-media\":_vm.setMedia()}}):_vm._e()],2):_vm._e(),_vm._v(\" \"),(_vm.status.card && !_vm.hideSubjectStatus && !_vm.noHeading)?_c('div',{staticClass:\"link-preview media-body\"},[_c('link-preview',{attrs:{\"card\":_vm.status.card,\"size\":_vm.attachmentSize,\"nsfw\":_vm.nsfwClickthrough}})],1):_vm._e(),_vm._v(\" \"),_c('transition',{attrs:{\"name\":\"fade\"}},[(!_vm.hidePostStats && _vm.isFocused && _vm.combinedFavsAndRepeatsUsers.length > 0)?_c('div',{staticClass:\"favs-repeated-users\"},[_c('div',{staticClass:\"stats\"},[(_vm.statusFromGlobalRepository.rebloggedBy && _vm.statusFromGlobalRepository.rebloggedBy.length > 0)?_c('div',{staticClass:\"stat-count\"},[_c('a',{staticClass:\"stat-title\"},[_vm._v(_vm._s(_vm.$t('status.repeats')))]),_vm._v(\" \"),_c('div',{staticClass:\"stat-number\"},[_vm._v(\"\\n \"+_vm._s(_vm.statusFromGlobalRepository.rebloggedBy.length)+\"\\n \")])]):_vm._e(),_vm._v(\" \"),(_vm.statusFromGlobalRepository.favoritedBy && _vm.statusFromGlobalRepository.favoritedBy.length > 0)?_c('div',{staticClass:\"stat-count\"},[_c('a',{staticClass:\"stat-title\"},[_vm._v(_vm._s(_vm.$t('status.favorites')))]),_vm._v(\" \"),_c('div',{staticClass:\"stat-number\"},[_vm._v(\"\\n \"+_vm._s(_vm.statusFromGlobalRepository.favoritedBy.length)+\"\\n \")])]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"avatar-row\"},[_c('AvatarList',{attrs:{\"users\":_vm.combinedFavsAndRepeatsUsers}})],1)])]):_vm._e()]),_vm._v(\" \"),(!_vm.noHeading && !_vm.isPreview)?_c('div',{staticClass:\"status-actions media-body\"},[_c('div',[(_vm.loggedIn)?_c('i',{staticClass:\"button-icon icon-reply\",class:{'button-icon-active': _vm.replying},attrs:{\"title\":_vm.$t('tool_tip.reply')},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleReplying($event)}}}):_c('i',{staticClass:\"button-icon button-icon-disabled icon-reply\",attrs:{\"title\":_vm.$t('tool_tip.reply')}}),_vm._v(\" \"),(_vm.status.replies_count > 0)?_c('span',[_vm._v(_vm._s(_vm.status.replies_count))]):_vm._e()]),_vm._v(\" \"),_c('retweet-button',{attrs:{\"visibility\":_vm.status.visibility,\"logged-in\":_vm.loggedIn,\"status\":_vm.status}}),_vm._v(\" \"),_c('favorite-button',{attrs:{\"logged-in\":_vm.loggedIn,\"status\":_vm.status}}),_vm._v(\" \"),_c('extra-buttons',{attrs:{\"status\":_vm.status},on:{\"onError\":_vm.showError,\"onSuccess\":_vm.clearError}})],1):_vm._e()],1)]),_vm._v(\" \"),(_vm.replying)?_c('div',{staticClass:\"container\"},[_c('PostStatusForm',{staticClass:\"reply-body\",attrs:{\"reply-to\":_vm.status.id,\"attentions\":_vm.status.attentions,\"replied-user\":_vm.status.user,\"copy-message-scope\":_vm.status.visibility,\"subject\":_vm.replySubject},on:{\"posted\":_vm.toggleReplying}})],1):_vm._e()]],2):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"timeline panel-default\",class:[_vm.isExpanded ? 'panel' : 'panel-disabled']},[(_vm.isExpanded)?_c('div',{staticClass:\"panel-heading conversation-heading\"},[_c('span',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(_vm.$t('timeline.conversation'))+\" \")]),_vm._v(\" \"),(_vm.collapsable)?_c('span',[_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleExpanded($event)}}},[_vm._v(_vm._s(_vm.$t('timeline.collapse')))])]):_vm._e()]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.conversation),function(status){return _c('status',{key:status.id,staticClass:\"status-fadein panel-body\",attrs:{\"inline-expanded\":_vm.collapsable && _vm.isExpanded,\"statusoid\":status,\"expandable\":!_vm.isExpanded,\"show-pinned\":_vm.pinnedStatusIdsObject && _vm.pinnedStatusIdsObject[status.id],\"focused\":_vm.focused(status.id),\"in-conversation\":_vm.isExpanded,\"highlight\":_vm.getHighlight(),\"replies\":_vm.getReplies(status.id),\"in-profile\":_vm.inProfile},on:{\"goto\":_vm.setHighlight,\"toggleExpanded\":_vm.toggleExpanded}})})],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:_vm.classes.root},[_c('div',{class:_vm.classes.header},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.title)+\"\\n \")]),_vm._v(\" \"),(_vm.timelineError)?_c('div',{staticClass:\"loadmore-error alert error\",on:{\"click\":function($event){$event.preventDefault();}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('timeline.error_fetching'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.timeline.newStatusCount > 0 && !_vm.timelineError)?_c('button',{staticClass:\"loadmore-button\",on:{\"click\":function($event){$event.preventDefault();return _vm.showNewStatuses($event)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('timeline.show_new'))+_vm._s(_vm.newStatusCountStr)+\"\\n \")]):_vm._e(),_vm._v(\" \"),(!_vm.timeline.newStatusCount > 0 && !_vm.timelineError)?_c('div',{staticClass:\"loadmore-text faint\",on:{\"click\":function($event){$event.preventDefault();}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('timeline.up_to_date'))+\"\\n \")]):_vm._e()]),_vm._v(\" \"),_c('div',{class:_vm.classes.body},[_c('div',{staticClass:\"timeline\"},[_vm._l((_vm.pinnedStatusIds),function(statusId){return [(_vm.timeline.statusesObject[statusId])?_c('conversation',{key:statusId + '-pinned',staticClass:\"status-fadein\",attrs:{\"status-id\":statusId,\"collapsable\":true,\"pinned-status-ids-object\":_vm.pinnedStatusIdsObject,\"in-profile\":_vm.inProfile}}):_vm._e()]}),_vm._v(\" \"),_vm._l((_vm.timeline.visibleStatuses),function(status){return [(!_vm.excludedStatusIdsObject[status.id])?_c('conversation',{key:status.id,staticClass:\"status-fadein\",attrs:{\"status-id\":status.id,\"collapsable\":true,\"in-profile\":_vm.inProfile}}):_vm._e()]})],2)]),_vm._v(\" \"),_c('div',{class:_vm.classes.footer},[(_vm.count===0)?_c('div',{staticClass:\"new-status-notification text-center panel-footer faint\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('timeline.no_statuses'))+\"\\n \")]):(_vm.bottomedOut)?_c('div',{staticClass:\"new-status-notification text-center panel-footer faint\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('timeline.no_more_statuses'))+\"\\n \")]):(!_vm.timeline.loading)?_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();_vm.fetchOlderStatuses()}}},[_c('div',{staticClass:\"new-status-notification text-center panel-footer\"},[_vm._v(_vm._s(_vm.$t('timeline.load_older')))])]):_c('div',{staticClass:\"new-status-notification text-center panel-footer\"},[_c('i',{staticClass:\"icon-spin3 animate-spin\"})])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Timeline',{attrs:{\"title\":_vm.$t('nav.public_tl'),\"timeline\":_vm.timeline,\"timeline-name\":'public'}})}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Timeline',{attrs:{\"title\":_vm.$t('nav.twkn'),\"timeline\":_vm.timeline,\"timeline-name\":'publicAndExternal'}})}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Timeline',{attrs:{\"title\":_vm.$t('nav.timeline'),\"timeline\":_vm.timeline,\"timeline-name\":'friends'}})}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Timeline',{attrs:{\"title\":_vm.tag,\"timeline\":_vm.timeline,\"timeline-name\":'tag',\"tag\":_vm.tag}})}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('conversation',{attrs:{\"collapsable\":false,\"is-page\":\"true\",\"status-id\":_vm.statusId}})}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.notification.type === 'mention')?_c('status',{attrs:{\"compact\":true,\"statusoid\":_vm.notification.status}}):_c('div',[(_vm.needMute && !_vm.unmuted)?_c('div',{staticClass:\"container muted\"},[_c('small',[_c('router-link',{attrs:{\"to\":_vm.userProfileLink}},[_vm._v(\"\\n \"+_vm._s(_vm.notification.from_profile.screen_name)+\"\\n \")])],1),_vm._v(\" \"),_c('a',{staticClass:\"unmute\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleMute($event)}}},[_c('i',{staticClass:\"button-icon icon-eye-off\"})])]):_c('div',{staticClass:\"non-mention\",class:[_vm.userClass, { highlighted: _vm.userStyle }],style:([ _vm.userStyle ])},[_c('a',{staticClass:\"avatar-container\",attrs:{\"href\":_vm.notification.from_profile.statusnet_profile_url},on:{\"!click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.toggleUserExpanded($event)}}},[_c('UserAvatar',{attrs:{\"compact\":true,\"better-shadow\":_vm.betterShadow,\"user\":_vm.notification.from_profile}})],1),_vm._v(\" \"),_c('div',{staticClass:\"notification-right\"},[(_vm.userExpanded)?_c('UserCard',{attrs:{\"user\":_vm.getUser(_vm.notification),\"rounded\":true,\"bordered\":true}}):_vm._e(),_vm._v(\" \"),_c('span',{staticClass:\"notification-details\"},[_c('div',{staticClass:\"name-and-action\"},[(!!_vm.notification.from_profile.name_html)?_c('span',{staticClass:\"username\",attrs:{\"title\":'@'+_vm.notification.from_profile.screen_name},domProps:{\"innerHTML\":_vm._s(_vm.notification.from_profile.name_html)}}):_c('span',{staticClass:\"username\",attrs:{\"title\":'@'+_vm.notification.from_profile.screen_name}},[_vm._v(_vm._s(_vm.notification.from_profile.name))]),_vm._v(\" \"),(_vm.notification.type === 'like')?_c('span',[_c('i',{staticClass:\"fa icon-star lit\"}),_vm._v(\" \"),_c('small',[_vm._v(_vm._s(_vm.$t('notifications.favorited_you')))])]):_vm._e(),_vm._v(\" \"),(_vm.notification.type === 'repeat')?_c('span',[_c('i',{staticClass:\"fa icon-retweet lit\",attrs:{\"title\":_vm.$t('tool_tip.repeat')}}),_vm._v(\" \"),_c('small',[_vm._v(_vm._s(_vm.$t('notifications.repeated_you')))])]):_vm._e(),_vm._v(\" \"),(_vm.notification.type === 'follow')?_c('span',[_c('i',{staticClass:\"fa icon-user-plus lit\"}),_vm._v(\" \"),_c('small',[_vm._v(_vm._s(_vm.$t('notifications.followed_you')))])]):_vm._e()]),_vm._v(\" \"),(_vm.notification.type === 'follow')?_c('div',{staticClass:\"timeago\"},[_c('span',{staticClass:\"faint\"},[_c('Timeago',{attrs:{\"time\":_vm.notification.created_at,\"auto-update\":240}})],1)]):_c('div',{staticClass:\"timeago\"},[(_vm.notification.status)?_c('router-link',{staticClass:\"faint-link\",attrs:{\"to\":{ name: 'conversation', params: { id: _vm.notification.status.id } }}},[_c('Timeago',{attrs:{\"time\":_vm.notification.created_at,\"auto-update\":240}})],1):_vm._e()],1),_vm._v(\" \"),(_vm.needMute)?_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.toggleMute($event)}}},[_c('i',{staticClass:\"button-icon icon-eye-off\"})]):_vm._e()]),_vm._v(\" \"),(_vm.notification.type === 'follow')?_c('div',{staticClass:\"follow-text\"},[_c('router-link',{attrs:{\"to\":_vm.userProfileLink}},[_vm._v(\"\\n @\"+_vm._s(_vm.notification.from_profile.screen_name)+\"\\n \")])],1):[_c('status',{staticClass:\"faint\",attrs:{\"compact\":true,\"statusoid\":_vm.notification.action,\"no-heading\":true}})]],2)])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"notifications\",class:{ minimal: _vm.minimalMode }},[_c('div',{class:_vm.mainClass},[(!_vm.noHeading)?_c('div',{staticClass:\"panel-heading\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('notifications.notifications'))+\"\\n \"),(_vm.unseenCount)?_c('span',{staticClass:\"badge badge-notification unseen-count\"},[_vm._v(_vm._s(_vm.unseenCount))]):_vm._e()]),_vm._v(\" \"),(_vm.error)?_c('div',{staticClass:\"loadmore-error alert error\",on:{\"click\":function($event){$event.preventDefault();}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('timeline.error_fetching'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.unseenCount)?_c('button',{staticClass:\"read-button\",on:{\"click\":function($event){$event.preventDefault();return _vm.markAsSeen($event)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('notifications.read'))+\"\\n \")]):_vm._e()]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},_vm._l((_vm.visibleNotifications),function(notification){return _c('div',{key:notification.id,staticClass:\"notification\",class:{\"unseen\": !_vm.minimalMode && !notification.seen}},[_c('div',{staticClass:\"notification-overlay\"}),_vm._v(\" \"),_c('notification',{attrs:{\"notification\":notification}})],1)}),0),_vm._v(\" \"),_c('div',{staticClass:\"panel-footer\"},[(_vm.bottomedOut)?_c('div',{staticClass:\"new-status-notification text-center panel-footer faint\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('notifications.no_more_notifications'))+\"\\n \")]):(!_vm.loading)?_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();_vm.fetchOlderNotifications()}}},[_c('div',{staticClass:\"new-status-notification text-center panel-footer\"},[_vm._v(\"\\n \"+_vm._s(_vm.minimalMode ? _vm.$t('interactions.load_older') : _vm.$t('notifications.load_older'))+\"\\n \")])]):_c('div',{staticClass:\"new-status-notification text-center panel-footer\"},[_c('i',{staticClass:\"icon-spin3 animate-spin\"})])])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.interactions\"))+\"\\n \")])]),_vm._v(\" \"),_c('tab-switcher',{ref:\"tabSwitcher\",attrs:{\"on-switch\":_vm.onModeSwitch}},[_c('span',{key:\"mentions\",attrs:{\"label\":_vm.$t('nav.mentions')}}),_vm._v(\" \"),_c('span',{key:\"likes+repeats\",attrs:{\"label\":_vm.$t('interactions.favs_repeats')}}),_vm._v(\" \"),_c('span',{key:\"follows\",attrs:{\"label\":_vm.$t('interactions.follows')}})]),_vm._v(\" \"),_c('Notifications',{ref:\"notifications\",attrs:{\"no-heading\":true,\"minimal-mode\":true,\"filter-mode\":_vm.filterMode}})],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Timeline',{attrs:{\"title\":_vm.$t('nav.dms'),\"timeline\":_vm.timeline,\"timeline-name\":'dms'}})}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"basic-user-card\"},[_c('router-link',{attrs:{\"to\":_vm.userProfileLink(_vm.user)}},[_c('UserAvatar',{staticClass:\"avatar\",attrs:{\"user\":_vm.user},nativeOn:{\"click\":function($event){$event.preventDefault();return _vm.toggleUserExpanded($event)}}})],1),_vm._v(\" \"),(_vm.userExpanded)?_c('div',{staticClass:\"basic-user-card-expanded-content\"},[_c('UserCard',{attrs:{\"user\":_vm.user,\"rounded\":true,\"bordered\":true}})],1):_c('div',{staticClass:\"basic-user-card-collapsed-content\"},[_c('div',{staticClass:\"basic-user-card-user-name\",attrs:{\"title\":_vm.user.name}},[(_vm.user.name_html)?_c('span',{staticClass:\"basic-user-card-user-name-value\",domProps:{\"innerHTML\":_vm._s(_vm.user.name_html)}}):_c('span',{staticClass:\"basic-user-card-user-name-value\"},[_vm._v(_vm._s(_vm.user.name))])]),_vm._v(\" \"),_c('div',[_c('router-link',{staticClass:\"basic-user-card-screen-name\",attrs:{\"to\":_vm.userProfileLink(_vm.user)}},[_vm._v(\"\\n @\"+_vm._s(_vm.user.screen_name)+\"\\n \")])],1),_vm._v(\" \"),_vm._t(\"default\")],2)],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('basic-user-card',{attrs:{\"user\":_vm.user}},[_c('div',{staticClass:\"follow-card-content-container\"},[(!_vm.noFollowsYou && _vm.user.follows_you)?_c('span',{staticClass:\"faint\"},[_vm._v(\"\\n \"+_vm._s(_vm.isMe ? _vm.$t('user_card.its_you') : _vm.$t('user_card.follows_you'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(!_vm.loggedIn)?[(!_vm.user.following)?_c('div',{staticClass:\"follow-card-follow-button\"},[_c('RemoteFollow',{attrs:{\"user\":_vm.user}})],1):_vm._e()]:[_c('FollowButton',{staticClass:\"follow-card-follow-button\",attrs:{\"user\":_vm.user,\"label-following\":_vm.$t('user_card.follow_unfollow')}})]],2)])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"list\"},[_vm._l((_vm.items),function(item){return _c('div',{key:_vm.getKey(item),staticClass:\"list-item\"},[_vm._t(\"item\",null,{item:item})],2)}),_vm._v(\" \"),(_vm.items.length === 0 && !!_vm.$slots.empty)?_c('div',{staticClass:\"list-empty-content faint\"},[_vm._t(\"empty\")],2):_vm._e()],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.user)?_c('div',{staticClass:\"user-profile panel panel-default\"},[_c('UserCard',{attrs:{\"user\":_vm.user,\"switcher\":true,\"selected\":_vm.timeline.viewing,\"allow-zooming-avatar\":true,\"rounded\":\"top\"}}),_vm._v(\" \"),_c('tab-switcher',{attrs:{\"active-tab\":_vm.tab,\"render-only-focused\":true,\"on-switch\":_vm.onTabSwitch}},[_c('Timeline',{key:\"statuses\",attrs:{\"label\":_vm.$t('user_card.statuses'),\"count\":_vm.user.statuses_count,\"embedded\":true,\"title\":_vm.$t('user_profile.timeline_title'),\"timeline\":_vm.timeline,\"timeline-name\":\"user\",\"user-id\":_vm.userId,\"pinned-status-ids\":_vm.user.pinnedStatusIds,\"in-profile\":true}}),_vm._v(\" \"),(_vm.followsTabVisible)?_c('div',{key:\"followees\",attrs:{\"label\":_vm.$t('user_card.followees'),\"disabled\":!_vm.user.friends_count}},[_c('FriendList',{attrs:{\"user-id\":_vm.userId},scopedSlots:_vm._u([{key:\"item\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('FollowCard',{attrs:{\"user\":item}})]}}])})],1):_vm._e(),_vm._v(\" \"),(_vm.followersTabVisible)?_c('div',{key:\"followers\",attrs:{\"label\":_vm.$t('user_card.followers'),\"disabled\":!_vm.user.followers_count}},[_c('FollowerList',{attrs:{\"user-id\":_vm.userId},scopedSlots:_vm._u([{key:\"item\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('FollowCard',{attrs:{\"user\":item,\"no-follows-you\":_vm.isUs}})]}}])})],1):_vm._e(),_vm._v(\" \"),_c('Timeline',{key:\"media\",attrs:{\"label\":_vm.$t('user_card.media'),\"disabled\":!_vm.media.visibleStatuses.length,\"embedded\":true,\"title\":_vm.$t('user_card.media'),\"timeline-name\":\"media\",\"timeline\":_vm.media,\"user-id\":_vm.userId,\"in-profile\":true}}),_vm._v(\" \"),(_vm.isUs)?_c('Timeline',{key:\"favorites\",attrs:{\"label\":_vm.$t('user_card.favorites'),\"disabled\":!_vm.favorites.visibleStatuses.length,\"embedded\":true,\"title\":_vm.$t('user_card.favorites'),\"timeline-name\":\"favorites\",\"timeline\":_vm.favorites,\"in-profile\":true}}):_vm._e()],1)],1):_c('div',{staticClass:\"panel user-profile-placeholder\"},[_c('div',{staticClass:\"panel-heading\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.profile_tab'))+\"\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[(_vm.error)?_c('span',[_vm._v(_vm._s(_vm.error))]):_c('i',{staticClass:\"icon-spin3 animate-spin\"})])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('nav.search'))+\"\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"search-input-container\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.searchTerm),expression:\"searchTerm\"}],ref:\"searchInput\",staticClass:\"search-input\",attrs:{\"placeholder\":_vm.$t('nav.search')},domProps:{\"value\":(_vm.searchTerm)},on:{\"keyup\":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }_vm.newQuery(_vm.searchTerm)},\"input\":function($event){if($event.target.composing){ return; }_vm.searchTerm=$event.target.value}}}),_vm._v(\" \"),_c('button',{staticClass:\"btn search-button\",on:{\"click\":function($event){_vm.newQuery(_vm.searchTerm)}}},[_c('i',{staticClass:\"icon-search\"})])]),_vm._v(\" \"),(_vm.loading)?_c('div',{staticClass:\"text-center loading-icon\"},[_c('i',{staticClass:\"icon-spin3 animate-spin\"})]):(_vm.loaded)?_c('div',[_c('div',{staticClass:\"search-nav-heading\"},[_c('tab-switcher',{ref:\"tabSwitcher\",attrs:{\"on-switch\":_vm.onResultTabSwitch,\"active-tab\":_vm.currenResultTab}},[_c('span',{key:\"statuses\",attrs:{\"label\":_vm.$t('user_card.statuses') + _vm.resultCount('visibleStatuses')}}),_vm._v(\" \"),_c('span',{key:\"people\",attrs:{\"label\":_vm.$t('search.people') + _vm.resultCount('users')}}),_vm._v(\" \"),_c('span',{key:\"hashtags\",attrs:{\"label\":_vm.$t('search.hashtags') + _vm.resultCount('hashtags')}})])],1)]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[(_vm.currenResultTab === 'statuses')?_c('div',[(_vm.visibleStatuses.length === 0 && !_vm.loading && _vm.loaded)?_c('div',{staticClass:\"search-result-heading\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('search.no_results')))])]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.visibleStatuses),function(status){return _c('Status',{key:status.id,staticClass:\"search-result\",attrs:{\"collapsable\":false,\"expandable\":false,\"compact\":false,\"statusoid\":status,\"no-heading\":false}})})],2):(_vm.currenResultTab === 'people')?_c('div',[(_vm.users.length === 0 && !_vm.loading && _vm.loaded)?_c('div',{staticClass:\"search-result-heading\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('search.no_results')))])]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.users),function(user){return _c('FollowCard',{key:user.id,staticClass:\"list-item search-result\",attrs:{\"user\":user}})})],2):(_vm.currenResultTab === 'hashtags')?_c('div',[(_vm.hashtags.length === 0 && !_vm.loading && _vm.loaded)?_c('div',{staticClass:\"search-result-heading\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('search.no_results')))])]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.hashtags),function(hashtag){return _c('div',{key:hashtag.url,staticClass:\"status trend search-result\"},[_c('div',{staticClass:\"hashtag\"},[_c('router-link',{attrs:{\"to\":{ name: 'tag-timeline', params: { tag: hashtag.name } }}},[_vm._v(\"\\n #\"+_vm._s(hashtag.name)+\"\\n \")]),_vm._v(\" \"),(_vm.lastHistoryRecord(hashtag))?_c('div',[(_vm.lastHistoryRecord(hashtag).accounts == 1)?_c('span',[_vm._v(\"\\n \"+_vm._s(_vm.$t('search.person_talking', { count: _vm.lastHistoryRecord(hashtag).accounts }))+\"\\n \")]):_c('span',[_vm._v(\"\\n \"+_vm._s(_vm.$t('search.people_talking', { count: _vm.lastHistoryRecord(hashtag).accounts }))+\"\\n \")])]):_vm._e()],1),_vm._v(\" \"),(_vm.lastHistoryRecord(hashtag))?_c('div',{staticClass:\"count\"},[_vm._v(\"\\n \"+_vm._s(_vm.lastHistoryRecord(hashtag).uses)+\"\\n \")]):_vm._e()])})],2):_vm._e()]),_vm._v(\" \"),_c('div',{staticClass:\"search-result-footer text-center panel-footer faint\"})])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"color-control style-control\",class:{ disabled: !_vm.present || _vm.disabled }},[_c('label',{staticClass:\"label\",attrs:{\"for\":_vm.name}},[_vm._v(\"\\n \"+_vm._s(_vm.label)+\"\\n \")]),_vm._v(\" \"),(typeof _vm.fallback !== 'undefined')?_c('input',{staticClass:\"opt exlcude-disabled\",attrs:{\"id\":_vm.name + '-o',\"type\":\"checkbox\"},domProps:{\"checked\":_vm.present},on:{\"input\":function($event){_vm.$emit('input', typeof _vm.value === 'undefined' ? _vm.fallback : undefined)}}}):_vm._e(),_vm._v(\" \"),(typeof _vm.fallback !== 'undefined')?_c('label',{staticClass:\"opt-l\",attrs:{\"for\":_vm.name + '-o'}}):_vm._e(),_vm._v(\" \"),_c('input',{staticClass:\"color-input\",attrs:{\"id\":_vm.name,\"type\":\"color\",\"disabled\":!_vm.present || _vm.disabled},domProps:{\"value\":_vm.value || _vm.fallback},on:{\"input\":function($event){_vm.$emit('input', $event.target.value)}}}),_vm._v(\" \"),_c('input',{staticClass:\"text-input\",attrs:{\"id\":_vm.name + '-t',\"type\":\"text\",\"disabled\":!_vm.present || _vm.disabled},domProps:{\"value\":_vm.value || _vm.fallback},on:{\"input\":function($event){_vm.$emit('input', $event.target.value)}}})])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"range-control style-control\",class:{ disabled: !_vm.present || _vm.disabled }},[_c('label',{staticClass:\"label\",attrs:{\"for\":_vm.name}},[_vm._v(\"\\n \"+_vm._s(_vm.label)+\"\\n \")]),_vm._v(\" \"),(typeof _vm.fallback !== 'undefined')?_c('input',{staticClass:\"opt exclude-disabled\",attrs:{\"id\":_vm.name + '-o',\"type\":\"checkbox\"},domProps:{\"checked\":_vm.present},on:{\"input\":function($event){_vm.$emit('input', !_vm.present ? _vm.fallback : undefined)}}}):_vm._e(),_vm._v(\" \"),(typeof _vm.fallback !== 'undefined')?_c('label',{staticClass:\"opt-l\",attrs:{\"for\":_vm.name + '-o'}}):_vm._e(),_vm._v(\" \"),_c('input',{staticClass:\"input-number\",attrs:{\"id\":_vm.name,\"type\":\"range\",\"disabled\":!_vm.present || _vm.disabled,\"max\":_vm.max || _vm.hardMax || 100,\"min\":_vm.min || _vm.hardMin || 0,\"step\":_vm.step || 1},domProps:{\"value\":_vm.value || _vm.fallback},on:{\"input\":function($event){_vm.$emit('input', $event.target.value)}}}),_vm._v(\" \"),_c('input',{staticClass:\"input-number\",attrs:{\"id\":_vm.name,\"type\":\"number\",\"disabled\":!_vm.present || _vm.disabled,\"max\":_vm.hardMax,\"min\":_vm.hardMin,\"step\":_vm.step || 1},domProps:{\"value\":_vm.value || _vm.fallback},on:{\"input\":function($event){_vm.$emit('input', $event.target.value)}}})])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"opacity-control style-control\",class:{ disabled: !_vm.present || _vm.disabled }},[_c('label',{staticClass:\"label\",attrs:{\"for\":_vm.name}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.common.opacity'))+\"\\n \")]),_vm._v(\" \"),(typeof _vm.fallback !== 'undefined')?_c('input',{staticClass:\"opt exclude-disabled\",attrs:{\"id\":_vm.name + '-o',\"type\":\"checkbox\"},domProps:{\"checked\":_vm.present},on:{\"input\":function($event){_vm.$emit('input', !_vm.present ? _vm.fallback : undefined)}}}):_vm._e(),_vm._v(\" \"),(typeof _vm.fallback !== 'undefined')?_c('label',{staticClass:\"opt-l\",attrs:{\"for\":_vm.name + '-o'}}):_vm._e(),_vm._v(\" \"),_c('input',{staticClass:\"input-number\",attrs:{\"id\":_vm.name,\"type\":\"number\",\"disabled\":!_vm.present || _vm.disabled,\"max\":\"1\",\"min\":\"0\",\"step\":\".05\"},domProps:{\"value\":_vm.value || _vm.fallback},on:{\"input\":function($event){_vm.$emit('input', $event.target.value)}}})])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"shadow-control\",class:{ disabled: !_vm.present }},[_c('div',{staticClass:\"shadow-preview-container\"},[_c('div',{staticClass:\"y-shift-control\",attrs:{\"disabled\":!_vm.present}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.y),expression:\"selected.y\"}],staticClass:\"input-number\",attrs:{\"disabled\":!_vm.present,\"type\":\"number\"},domProps:{\"value\":(_vm.selected.y)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.selected, \"y\", $event.target.value)}}}),_vm._v(\" \"),_c('div',{staticClass:\"wrap\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.y),expression:\"selected.y\"}],staticClass:\"input-range\",attrs:{\"disabled\":!_vm.present,\"type\":\"range\",\"max\":\"20\",\"min\":\"-20\"},domProps:{\"value\":(_vm.selected.y)},on:{\"__r\":function($event){_vm.$set(_vm.selected, \"y\", $event.target.value)}}})])]),_vm._v(\" \"),_c('div',{staticClass:\"preview-window\"},[_c('div',{staticClass:\"preview-block\",style:(_vm.style)})]),_vm._v(\" \"),_c('div',{staticClass:\"x-shift-control\",attrs:{\"disabled\":!_vm.present}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.x),expression:\"selected.x\"}],staticClass:\"input-number\",attrs:{\"disabled\":!_vm.present,\"type\":\"number\"},domProps:{\"value\":(_vm.selected.x)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.selected, \"x\", $event.target.value)}}}),_vm._v(\" \"),_c('div',{staticClass:\"wrap\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.x),expression:\"selected.x\"}],staticClass:\"input-range\",attrs:{\"disabled\":!_vm.present,\"type\":\"range\",\"max\":\"20\",\"min\":\"-20\"},domProps:{\"value\":(_vm.selected.x)},on:{\"__r\":function($event){_vm.$set(_vm.selected, \"x\", $event.target.value)}}})])])]),_vm._v(\" \"),_c('div',{staticClass:\"shadow-tweak\"},[_c('div',{staticClass:\"id-control style-control\",attrs:{\"disabled\":_vm.usingFallback}},[_c('label',{staticClass:\"select\",attrs:{\"for\":\"shadow-switcher\",\"disabled\":!_vm.ready || _vm.usingFallback}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selectedId),expression:\"selectedId\"}],staticClass:\"shadow-switcher\",attrs:{\"id\":\"shadow-switcher\",\"disabled\":!_vm.ready || _vm.usingFallback},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.selectedId=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},_vm._l((_vm.cValue),function(shadow,index){return _c('option',{key:index,domProps:{\"value\":index}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.shadows.shadow_id', { value: index }))+\"\\n \")])}),0),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":!_vm.ready || !_vm.present},on:{\"click\":_vm.del}},[_c('i',{staticClass:\"icon-cancel\"})]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":!_vm.moveUpValid},on:{\"click\":_vm.moveUp}},[_c('i',{staticClass:\"icon-up-open\"})]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":!_vm.moveDnValid},on:{\"click\":_vm.moveDn}},[_c('i',{staticClass:\"icon-down-open\"})]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.usingFallback},on:{\"click\":_vm.add}},[_c('i',{staticClass:\"icon-plus\"})])]),_vm._v(\" \"),_c('div',{staticClass:\"inset-control style-control\",attrs:{\"disabled\":!_vm.present}},[_c('label',{staticClass:\"label\",attrs:{\"for\":\"inset\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.shadows.inset'))+\"\\n \")]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.inset),expression:\"selected.inset\"}],staticClass:\"input-inset\",attrs:{\"id\":\"inset\",\"disabled\":!_vm.present,\"name\":\"inset\",\"type\":\"checkbox\"},domProps:{\"checked\":Array.isArray(_vm.selected.inset)?_vm._i(_vm.selected.inset,null)>-1:(_vm.selected.inset)},on:{\"change\":function($event){var $$a=_vm.selected.inset,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.$set(_vm.selected, \"inset\", $$a.concat([$$v])))}else{$$i>-1&&(_vm.$set(_vm.selected, \"inset\", $$a.slice(0,$$i).concat($$a.slice($$i+1))))}}else{_vm.$set(_vm.selected, \"inset\", $$c)}}}}),_vm._v(\" \"),_c('label',{staticClass:\"checkbox-label\",attrs:{\"for\":\"inset\"}})]),_vm._v(\" \"),_c('div',{staticClass:\"blur-control style-control\",attrs:{\"disabled\":!_vm.present}},[_c('label',{staticClass:\"label\",attrs:{\"for\":\"spread\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.shadows.blur'))+\"\\n \")]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.blur),expression:\"selected.blur\"}],staticClass:\"input-range\",attrs:{\"id\":\"blur\",\"disabled\":!_vm.present,\"name\":\"blur\",\"type\":\"range\",\"max\":\"20\",\"min\":\"0\"},domProps:{\"value\":(_vm.selected.blur)},on:{\"__r\":function($event){_vm.$set(_vm.selected, \"blur\", $event.target.value)}}}),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.blur),expression:\"selected.blur\"}],staticClass:\"input-number\",attrs:{\"disabled\":!_vm.present,\"type\":\"number\",\"min\":\"0\"},domProps:{\"value\":(_vm.selected.blur)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.selected, \"blur\", $event.target.value)}}})]),_vm._v(\" \"),_c('div',{staticClass:\"spread-control style-control\",attrs:{\"disabled\":!_vm.present}},[_c('label',{staticClass:\"label\",attrs:{\"for\":\"spread\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.shadows.spread'))+\"\\n \")]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.spread),expression:\"selected.spread\"}],staticClass:\"input-range\",attrs:{\"id\":\"spread\",\"disabled\":!_vm.present,\"name\":\"spread\",\"type\":\"range\",\"max\":\"20\",\"min\":\"-20\"},domProps:{\"value\":(_vm.selected.spread)},on:{\"__r\":function($event){_vm.$set(_vm.selected, \"spread\", $event.target.value)}}}),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected.spread),expression:\"selected.spread\"}],staticClass:\"input-number\",attrs:{\"disabled\":!_vm.present,\"type\":\"number\"},domProps:{\"value\":(_vm.selected.spread)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.selected, \"spread\", $event.target.value)}}})]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"disabled\":!_vm.present,\"label\":_vm.$t('settings.style.common.color'),\"name\":\"shadow\"},model:{value:(_vm.selected.color),callback:function ($$v) {_vm.$set(_vm.selected, \"color\", $$v)},expression:\"selected.color\"}}),_vm._v(\" \"),_c('OpacityInput',{attrs:{\"disabled\":!_vm.present},model:{value:(_vm.selected.alpha),callback:function ($$v) {_vm.$set(_vm.selected, \"alpha\", $$v)},expression:\"selected.alpha\"}}),_vm._v(\" \"),_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.shadows.hint'))+\"\\n \")])],1)])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"font-control style-control\",class:{ custom: _vm.isCustom }},[_c('label',{staticClass:\"label\",attrs:{\"for\":_vm.preset === 'custom' ? _vm.name : _vm.name + '-font-switcher'}},[_vm._v(\"\\n \"+_vm._s(_vm.label)+\"\\n \")]),_vm._v(\" \"),(typeof _vm.fallback !== 'undefined')?_c('input',{staticClass:\"opt exlcude-disabled\",attrs:{\"id\":_vm.name + '-o',\"type\":\"checkbox\"},domProps:{\"checked\":_vm.present},on:{\"input\":function($event){_vm.$emit('input', typeof _vm.value === 'undefined' ? _vm.fallback : undefined)}}}):_vm._e(),_vm._v(\" \"),(typeof _vm.fallback !== 'undefined')?_c('label',{staticClass:\"opt-l\",attrs:{\"for\":_vm.name + '-o'}}):_vm._e(),_vm._v(\" \"),_c('label',{staticClass:\"select\",attrs:{\"for\":_vm.name + '-font-switcher',\"disabled\":!_vm.present}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.preset),expression:\"preset\"}],staticClass:\"font-switcher\",attrs:{\"id\":_vm.name + '-font-switcher',\"disabled\":!_vm.present},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.preset=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},_vm._l((_vm.availableOptions),function(option){return _c('option',{key:option,domProps:{\"value\":option}},[_vm._v(\"\\n \"+_vm._s(option === 'custom' ? _vm.$t('settings.style.fonts.custom') : option)+\"\\n \")])}),0),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})]),_vm._v(\" \"),(_vm.isCustom)?_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.family),expression:\"family\"}],staticClass:\"custom-font\",attrs:{\"id\":_vm.name,\"type\":\"text\"},domProps:{\"value\":(_vm.family)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.family=$event.target.value}}}):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.contrast)?_c('span',{staticClass:\"contrast-ratio\"},[_c('span',{staticClass:\"rating\",attrs:{\"title\":_vm.hint}},[(_vm.contrast.aaa)?_c('span',[_c('i',{staticClass:\"icon-thumbs-up-alt\"})]):_vm._e(),_vm._v(\" \"),(!_vm.contrast.aaa && _vm.contrast.aa)?_c('span',[_c('i',{staticClass:\"icon-adjust\"})]):_vm._e(),_vm._v(\" \"),(!_vm.contrast.aaa && !_vm.contrast.aa)?_c('span',[_c('i',{staticClass:\"icon-attention\"})]):_vm._e()]),_vm._v(\" \"),(_vm.contrast && _vm.large)?_c('span',{staticClass:\"rating\",attrs:{\"title\":_vm.hint_18pt}},[(_vm.contrast.laaa)?_c('span',[_c('i',{staticClass:\"icon-thumbs-up-alt\"})]):_vm._e(),_vm._v(\" \"),(!_vm.contrast.laaa && _vm.contrast.laa)?_c('span',[_c('i',{staticClass:\"icon-adjust\"})]):_vm._e(),_vm._v(\" \"),(!_vm.contrast.laaa && !_vm.contrast.laa)?_c('span',[_c('i',{staticClass:\"icon-attention\"})]):_vm._e()]):_vm._e()]):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"import-export-container\"},[_vm._t(\"before\"),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.exportData}},[_vm._v(\"\\n \"+_vm._s(_vm.exportLabel)+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.importData}},[_vm._v(\"\\n \"+_vm._s(_vm.importLabel)+\"\\n \")]),_vm._v(\" \"),_vm._t(\"afterButtons\"),_vm._v(\" \"),(_vm.importFailed)?_c('p',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.importFailedText)+\"\\n \")]):_vm._e(),_vm._v(\" \"),_vm._t(\"afterError\")],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"style-switcher\"},[_c('div',{staticClass:\"presets-container\"},[_c('div',{staticClass:\"save-load\"},[_c('export-import',{attrs:{\"export-object\":_vm.exportedTheme,\"export-label\":_vm.$t(\"settings.export_theme\"),\"import-label\":_vm.$t(\"settings.import_theme\"),\"import-failed-text\":_vm.$t(\"settings.invalid_theme_imported\"),\"on-import\":_vm.onImport,\"validator\":_vm.importValidator}},[_c('template',{slot:\"before\"},[_c('div',{staticClass:\"presets\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.presets'))+\"\\n \"),_c('label',{staticClass:\"select\",attrs:{\"for\":\"preset-switcher\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selected),expression:\"selected\"}],staticClass:\"preset-switcher\",attrs:{\"id\":\"preset-switcher\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.selected=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},_vm._l((_vm.availableStyles),function(style){return _c('option',{key:style.name,style:({\n backgroundColor: style[1] || style.theme.colors.bg,\n color: style[3] || style.theme.colors.text\n }),domProps:{\"value\":style}},[_vm._v(\"\\n \"+_vm._s(style[0] || style.name)+\"\\n \")])}),0),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])])])],2)],1),_vm._v(\" \"),_c('div',{staticClass:\"save-load-options\"},[_c('span',{staticClass:\"keep-option\"},[_c('Checkbox',{model:{value:(_vm.keepColor),callback:function ($$v) {_vm.keepColor=$$v},expression:\"keepColor\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.keep_color'))+\"\\n \")])],1),_vm._v(\" \"),_c('span',{staticClass:\"keep-option\"},[_c('Checkbox',{model:{value:(_vm.keepShadows),callback:function ($$v) {_vm.keepShadows=$$v},expression:\"keepShadows\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.keep_shadows'))+\"\\n \")])],1),_vm._v(\" \"),_c('span',{staticClass:\"keep-option\"},[_c('Checkbox',{model:{value:(_vm.keepOpacity),callback:function ($$v) {_vm.keepOpacity=$$v},expression:\"keepOpacity\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.keep_opacity'))+\"\\n \")])],1),_vm._v(\" \"),_c('span',{staticClass:\"keep-option\"},[_c('Checkbox',{model:{value:(_vm.keepRoundness),callback:function ($$v) {_vm.keepRoundness=$$v},expression:\"keepRoundness\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.keep_roundness'))+\"\\n \")])],1),_vm._v(\" \"),_c('span',{staticClass:\"keep-option\"},[_c('Checkbox',{model:{value:(_vm.keepFonts),callback:function ($$v) {_vm.keepFonts=$$v},expression:\"keepFonts\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.keep_fonts'))+\"\\n \")])],1),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.style.switcher.save_load_hint')))])])]),_vm._v(\" \"),_c('div',{staticClass:\"preview-container\"},[_c('preview',{style:(_vm.previewRules)})],1),_vm._v(\" \"),_c('keep-alive',[_c('tab-switcher',{key:\"style-tweak\"},[_c('div',{staticClass:\"color-container\",attrs:{\"label\":_vm.$t('settings.style.common_colors._tab_label')}},[_c('div',{staticClass:\"tab-header\"},[_c('p',[_vm._v(_vm._s(_vm.$t('settings.theme_help')))]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.clearOpacity}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.clear_opacity'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.clearV1}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.clear_all'))+\"\\n \")])]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.theme_help_v2_1')))]),_vm._v(\" \"),_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.common_colors.main')))]),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('ColorInput',{attrs:{\"name\":\"bgColor\",\"label\":_vm.$t('settings.background')},model:{value:(_vm.bgColorLocal),callback:function ($$v) {_vm.bgColorLocal=$$v},expression:\"bgColorLocal\"}}),_vm._v(\" \"),_c('OpacityInput',{attrs:{\"name\":\"bgOpacity\",\"fallback\":_vm.previewTheme.opacity.bg || 1},model:{value:(_vm.bgOpacityLocal),callback:function ($$v) {_vm.bgOpacityLocal=$$v},expression:\"bgOpacityLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"textColor\",\"label\":_vm.$t('settings.text')},model:{value:(_vm.textColorLocal),callback:function ($$v) {_vm.textColorLocal=$$v},expression:\"textColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.bgText}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"linkColor\",\"label\":_vm.$t('settings.links')},model:{value:(_vm.linkColorLocal),callback:function ($$v) {_vm.linkColorLocal=$$v},expression:\"linkColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.bgLink}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('ColorInput',{attrs:{\"name\":\"fgColor\",\"label\":_vm.$t('settings.foreground')},model:{value:(_vm.fgColorLocal),callback:function ($$v) {_vm.fgColorLocal=$$v},expression:\"fgColorLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"fgTextColor\",\"label\":_vm.$t('settings.text'),\"fallback\":_vm.previewTheme.colors.fgText},model:{value:(_vm.fgTextColorLocal),callback:function ($$v) {_vm.fgTextColorLocal=$$v},expression:\"fgTextColorLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"fgLinkColor\",\"label\":_vm.$t('settings.links'),\"fallback\":_vm.previewTheme.colors.fgLink},model:{value:(_vm.fgLinkColorLocal),callback:function ($$v) {_vm.fgLinkColorLocal=$$v},expression:\"fgLinkColorLocal\"}}),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.style.common_colors.foreground_hint')))])],1),_vm._v(\" \"),_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.common_colors.rgbo')))]),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('ColorInput',{attrs:{\"name\":\"cRedColor\",\"label\":_vm.$t('settings.cRed')},model:{value:(_vm.cRedColorLocal),callback:function ($$v) {_vm.cRedColorLocal=$$v},expression:\"cRedColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.bgRed}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"cBlueColor\",\"label\":_vm.$t('settings.cBlue')},model:{value:(_vm.cBlueColorLocal),callback:function ($$v) {_vm.cBlueColorLocal=$$v},expression:\"cBlueColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.bgBlue}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('ColorInput',{attrs:{\"name\":\"cGreenColor\",\"label\":_vm.$t('settings.cGreen')},model:{value:(_vm.cGreenColorLocal),callback:function ($$v) {_vm.cGreenColorLocal=$$v},expression:\"cGreenColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.bgGreen}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"cOrangeColor\",\"label\":_vm.$t('settings.cOrange')},model:{value:(_vm.cOrangeColorLocal),callback:function ($$v) {_vm.cOrangeColorLocal=$$v},expression:\"cOrangeColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.bgOrange}})],1),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.theme_help_v2_2')))])]),_vm._v(\" \"),_c('div',{staticClass:\"color-container\",attrs:{\"label\":_vm.$t('settings.style.advanced_colors._tab_label')}},[_c('div',{staticClass:\"tab-header\"},[_c('p',[_vm._v(_vm._s(_vm.$t('settings.theme_help')))]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.clearOpacity}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.clear_opacity'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.clearV1}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.clear_all'))+\"\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.advanced_colors.alert')))]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"alertError\",\"label\":_vm.$t('settings.style.advanced_colors.alert_error'),\"fallback\":_vm.previewTheme.colors.alertError},model:{value:(_vm.alertErrorColorLocal),callback:function ($$v) {_vm.alertErrorColorLocal=$$v},expression:\"alertErrorColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.alertError}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"alertWarning\",\"label\":_vm.$t('settings.style.advanced_colors.alert_warning'),\"fallback\":_vm.previewTheme.colors.alertWarning},model:{value:(_vm.alertWarningColorLocal),callback:function ($$v) {_vm.alertWarningColorLocal=$$v},expression:\"alertWarningColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.alertWarning}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.advanced_colors.badge')))]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"badgeNotification\",\"label\":_vm.$t('settings.style.advanced_colors.badge_notification'),\"fallback\":_vm.previewTheme.colors.badgeNotification},model:{value:(_vm.badgeNotificationColorLocal),callback:function ($$v) {_vm.badgeNotificationColorLocal=$$v},expression:\"badgeNotificationColorLocal\"}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.advanced_colors.panel_header')))]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"panelColor\",\"fallback\":_vm.fgColorLocal,\"label\":_vm.$t('settings.background')},model:{value:(_vm.panelColorLocal),callback:function ($$v) {_vm.panelColorLocal=$$v},expression:\"panelColorLocal\"}}),_vm._v(\" \"),_c('OpacityInput',{attrs:{\"name\":\"panelOpacity\",\"fallback\":_vm.previewTheme.opacity.panel || 1},model:{value:(_vm.panelOpacityLocal),callback:function ($$v) {_vm.panelOpacityLocal=$$v},expression:\"panelOpacityLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"panelTextColor\",\"fallback\":_vm.previewTheme.colors.panelText,\"label\":_vm.$t('settings.text')},model:{value:(_vm.panelTextColorLocal),callback:function ($$v) {_vm.panelTextColorLocal=$$v},expression:\"panelTextColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.panelText,\"large\":\"1\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"panelLinkColor\",\"fallback\":_vm.previewTheme.colors.panelLink,\"label\":_vm.$t('settings.links')},model:{value:(_vm.panelLinkColorLocal),callback:function ($$v) {_vm.panelLinkColorLocal=$$v},expression:\"panelLinkColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.panelLink,\"large\":\"1\"}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.advanced_colors.top_bar')))]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"topBarColor\",\"fallback\":_vm.fgColorLocal,\"label\":_vm.$t('settings.background')},model:{value:(_vm.topBarColorLocal),callback:function ($$v) {_vm.topBarColorLocal=$$v},expression:\"topBarColorLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"topBarTextColor\",\"fallback\":_vm.previewTheme.colors.topBarText,\"label\":_vm.$t('settings.text')},model:{value:(_vm.topBarTextColorLocal),callback:function ($$v) {_vm.topBarTextColorLocal=$$v},expression:\"topBarTextColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.topBarText}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"topBarLinkColor\",\"fallback\":_vm.previewTheme.colors.topBarLink,\"label\":_vm.$t('settings.links')},model:{value:(_vm.topBarLinkColorLocal),callback:function ($$v) {_vm.topBarLinkColorLocal=$$v},expression:\"topBarLinkColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.topBarLink}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.advanced_colors.inputs')))]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"inputColor\",\"fallback\":_vm.fgColorLocal,\"label\":_vm.$t('settings.background')},model:{value:(_vm.inputColorLocal),callback:function ($$v) {_vm.inputColorLocal=$$v},expression:\"inputColorLocal\"}}),_vm._v(\" \"),_c('OpacityInput',{attrs:{\"name\":\"inputOpacity\",\"fallback\":_vm.previewTheme.opacity.input || 1},model:{value:(_vm.inputOpacityLocal),callback:function ($$v) {_vm.inputOpacityLocal=$$v},expression:\"inputOpacityLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"inputTextColor\",\"fallback\":_vm.previewTheme.colors.inputText,\"label\":_vm.$t('settings.text')},model:{value:(_vm.inputTextColorLocal),callback:function ($$v) {_vm.inputTextColorLocal=$$v},expression:\"inputTextColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.inputText}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.advanced_colors.buttons')))]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"btnColor\",\"fallback\":_vm.fgColorLocal,\"label\":_vm.$t('settings.background')},model:{value:(_vm.btnColorLocal),callback:function ($$v) {_vm.btnColorLocal=$$v},expression:\"btnColorLocal\"}}),_vm._v(\" \"),_c('OpacityInput',{attrs:{\"name\":\"btnOpacity\",\"fallback\":_vm.previewTheme.opacity.btn || 1},model:{value:(_vm.btnOpacityLocal),callback:function ($$v) {_vm.btnOpacityLocal=$$v},expression:\"btnOpacityLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"btnTextColor\",\"fallback\":_vm.previewTheme.colors.btnText,\"label\":_vm.$t('settings.text')},model:{value:(_vm.btnTextColorLocal),callback:function ($$v) {_vm.btnTextColorLocal=$$v},expression:\"btnTextColorLocal\"}}),_vm._v(\" \"),_c('ContrastRatio',{attrs:{\"contrast\":_vm.previewContrast.btnText}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.advanced_colors.borders')))]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"borderColor\",\"fallback\":_vm.previewTheme.colors.border,\"label\":_vm.$t('settings.style.common.color')},model:{value:(_vm.borderColorLocal),callback:function ($$v) {_vm.borderColorLocal=$$v},expression:\"borderColorLocal\"}}),_vm._v(\" \"),_c('OpacityInput',{attrs:{\"name\":\"borderOpacity\",\"fallback\":_vm.previewTheme.opacity.border || 1},model:{value:(_vm.borderOpacityLocal),callback:function ($$v) {_vm.borderOpacityLocal=$$v},expression:\"borderOpacityLocal\"}})],1),_vm._v(\" \"),_c('div',{staticClass:\"color-item\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.style.advanced_colors.faint_text')))]),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"faintColor\",\"fallback\":_vm.previewTheme.colors.faint || 1,\"label\":_vm.$t('settings.text')},model:{value:(_vm.faintColorLocal),callback:function ($$v) {_vm.faintColorLocal=$$v},expression:\"faintColorLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"faintLinkColor\",\"fallback\":_vm.previewTheme.colors.faintLink,\"label\":_vm.$t('settings.links')},model:{value:(_vm.faintLinkColorLocal),callback:function ($$v) {_vm.faintLinkColorLocal=$$v},expression:\"faintLinkColorLocal\"}}),_vm._v(\" \"),_c('ColorInput',{attrs:{\"name\":\"panelFaintColor\",\"fallback\":_vm.previewTheme.colors.panelFaint,\"label\":_vm.$t('settings.style.advanced_colors.panel_header')},model:{value:(_vm.panelFaintColorLocal),callback:function ($$v) {_vm.panelFaintColorLocal=$$v},expression:\"panelFaintColorLocal\"}}),_vm._v(\" \"),_c('OpacityInput',{attrs:{\"name\":\"faintOpacity\",\"fallback\":_vm.previewTheme.opacity.faint || 0.5},model:{value:(_vm.faintOpacityLocal),callback:function ($$v) {_vm.faintOpacityLocal=$$v},expression:\"faintOpacityLocal\"}})],1)]),_vm._v(\" \"),_c('div',{staticClass:\"radius-container\",attrs:{\"label\":_vm.$t('settings.style.radii._tab_label')}},[_c('div',{staticClass:\"tab-header\"},[_c('p',[_vm._v(_vm._s(_vm.$t('settings.radii_help')))]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.clearRoundness}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.clear_all'))+\"\\n \")])]),_vm._v(\" \"),_c('RangeInput',{attrs:{\"name\":\"btnRadius\",\"label\":_vm.$t('settings.btnRadius'),\"fallback\":_vm.previewTheme.radii.btn,\"max\":\"16\",\"hard-min\":\"0\"},model:{value:(_vm.btnRadiusLocal),callback:function ($$v) {_vm.btnRadiusLocal=$$v},expression:\"btnRadiusLocal\"}}),_vm._v(\" \"),_c('RangeInput',{attrs:{\"name\":\"inputRadius\",\"label\":_vm.$t('settings.inputRadius'),\"fallback\":_vm.previewTheme.radii.input,\"max\":\"9\",\"hard-min\":\"0\"},model:{value:(_vm.inputRadiusLocal),callback:function ($$v) {_vm.inputRadiusLocal=$$v},expression:\"inputRadiusLocal\"}}),_vm._v(\" \"),_c('RangeInput',{attrs:{\"name\":\"checkboxRadius\",\"label\":_vm.$t('settings.checkboxRadius'),\"fallback\":_vm.previewTheme.radii.checkbox,\"max\":\"16\",\"hard-min\":\"0\"},model:{value:(_vm.checkboxRadiusLocal),callback:function ($$v) {_vm.checkboxRadiusLocal=$$v},expression:\"checkboxRadiusLocal\"}}),_vm._v(\" \"),_c('RangeInput',{attrs:{\"name\":\"panelRadius\",\"label\":_vm.$t('settings.panelRadius'),\"fallback\":_vm.previewTheme.radii.panel,\"max\":\"50\",\"hard-min\":\"0\"},model:{value:(_vm.panelRadiusLocal),callback:function ($$v) {_vm.panelRadiusLocal=$$v},expression:\"panelRadiusLocal\"}}),_vm._v(\" \"),_c('RangeInput',{attrs:{\"name\":\"avatarRadius\",\"label\":_vm.$t('settings.avatarRadius'),\"fallback\":_vm.previewTheme.radii.avatar,\"max\":\"28\",\"hard-min\":\"0\"},model:{value:(_vm.avatarRadiusLocal),callback:function ($$v) {_vm.avatarRadiusLocal=$$v},expression:\"avatarRadiusLocal\"}}),_vm._v(\" \"),_c('RangeInput',{attrs:{\"name\":\"avatarAltRadius\",\"label\":_vm.$t('settings.avatarAltRadius'),\"fallback\":_vm.previewTheme.radii.avatarAlt,\"max\":\"28\",\"hard-min\":\"0\"},model:{value:(_vm.avatarAltRadiusLocal),callback:function ($$v) {_vm.avatarAltRadiusLocal=$$v},expression:\"avatarAltRadiusLocal\"}}),_vm._v(\" \"),_c('RangeInput',{attrs:{\"name\":\"attachmentRadius\",\"label\":_vm.$t('settings.attachmentRadius'),\"fallback\":_vm.previewTheme.radii.attachment,\"max\":\"50\",\"hard-min\":\"0\"},model:{value:(_vm.attachmentRadiusLocal),callback:function ($$v) {_vm.attachmentRadiusLocal=$$v},expression:\"attachmentRadiusLocal\"}}),_vm._v(\" \"),_c('RangeInput',{attrs:{\"name\":\"tooltipRadius\",\"label\":_vm.$t('settings.tooltipRadius'),\"fallback\":_vm.previewTheme.radii.tooltip,\"max\":\"50\",\"hard-min\":\"0\"},model:{value:(_vm.tooltipRadiusLocal),callback:function ($$v) {_vm.tooltipRadiusLocal=$$v},expression:\"tooltipRadiusLocal\"}})],1),_vm._v(\" \"),_c('div',{staticClass:\"shadow-container\",attrs:{\"label\":_vm.$t('settings.style.shadows._tab_label')}},[_c('div',{staticClass:\"tab-header shadow-selector\"},[_c('div',{staticClass:\"select-container\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.shadows.component'))+\"\\n \"),_c('label',{staticClass:\"select\",attrs:{\"for\":\"shadow-switcher\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.shadowSelected),expression:\"shadowSelected\"}],staticClass:\"shadow-switcher\",attrs:{\"id\":\"shadow-switcher\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.shadowSelected=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},_vm._l((_vm.shadowsAvailable),function(shadow){return _c('option',{key:shadow,domProps:{\"value\":shadow}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.shadows.components.' + shadow))+\"\\n \")])}),0),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])]),_vm._v(\" \"),_c('div',{staticClass:\"override\"},[_c('label',{staticClass:\"label\",attrs:{\"for\":\"override\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.shadows.override'))+\"\\n \")]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.currentShadowOverriden),expression:\"currentShadowOverriden\"}],staticClass:\"input-override\",attrs:{\"id\":\"override\",\"name\":\"override\",\"type\":\"checkbox\"},domProps:{\"checked\":Array.isArray(_vm.currentShadowOverriden)?_vm._i(_vm.currentShadowOverriden,null)>-1:(_vm.currentShadowOverriden)},on:{\"change\":function($event){var $$a=_vm.currentShadowOverriden,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.currentShadowOverriden=$$a.concat([$$v]))}else{$$i>-1&&(_vm.currentShadowOverriden=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.currentShadowOverriden=$$c}}}}),_vm._v(\" \"),_c('label',{staticClass:\"checkbox-label\",attrs:{\"for\":\"override\"}})]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.clearShadows}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.clear_all'))+\"\\n \")])]),_vm._v(\" \"),_c('shadow-control',{attrs:{\"ready\":!!_vm.currentShadowFallback,\"fallback\":_vm.currentShadowFallback},model:{value:(_vm.currentShadow),callback:function ($$v) {_vm.currentShadow=$$v},expression:\"currentShadow\"}}),_vm._v(\" \"),(_vm.shadowSelected === 'avatar' || _vm.shadowSelected === 'avatarStatus')?_c('div',[_c('i18n',{attrs:{\"path\":\"settings.style.shadows.filter_hint.always_drop_shadow\",\"tag\":\"p\"}},[_c('code',[_vm._v(\"filter: drop-shadow()\")])]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.style.shadows.filter_hint.avatar_inset')))]),_vm._v(\" \"),_c('i18n',{attrs:{\"path\":\"settings.style.shadows.filter_hint.drop_shadow_syntax\",\"tag\":\"p\"}},[_c('code',[_vm._v(\"drop-shadow\")]),_vm._v(\" \"),_c('code',[_vm._v(\"spread-radius\")]),_vm._v(\" \"),_c('code',[_vm._v(\"inset\")])]),_vm._v(\" \"),_c('i18n',{attrs:{\"path\":\"settings.style.shadows.filter_hint.inset_classic\",\"tag\":\"p\"}},[_c('code',[_vm._v(\"box-shadow\")])]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.style.shadows.filter_hint.spread_zero')))])],1):_vm._e()],1),_vm._v(\" \"),_c('div',{staticClass:\"fonts-container\",attrs:{\"label\":_vm.$t('settings.style.fonts._tab_label')}},[_c('div',{staticClass:\"tab-header\"},[_c('p',[_vm._v(_vm._s(_vm.$t('settings.style.fonts.help')))]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.clearFonts}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.clear_all'))+\"\\n \")])]),_vm._v(\" \"),_c('FontControl',{attrs:{\"name\":\"ui\",\"label\":_vm.$t('settings.style.fonts.components.interface'),\"fallback\":_vm.previewTheme.fonts.interface,\"no-inherit\":\"1\"},model:{value:(_vm.fontsLocal.interface),callback:function ($$v) {_vm.$set(_vm.fontsLocal, \"interface\", $$v)},expression:\"fontsLocal.interface\"}}),_vm._v(\" \"),_c('FontControl',{attrs:{\"name\":\"input\",\"label\":_vm.$t('settings.style.fonts.components.input'),\"fallback\":_vm.previewTheme.fonts.input},model:{value:(_vm.fontsLocal.input),callback:function ($$v) {_vm.$set(_vm.fontsLocal, \"input\", $$v)},expression:\"fontsLocal.input\"}}),_vm._v(\" \"),_c('FontControl',{attrs:{\"name\":\"post\",\"label\":_vm.$t('settings.style.fonts.components.post'),\"fallback\":_vm.previewTheme.fonts.post},model:{value:(_vm.fontsLocal.post),callback:function ($$v) {_vm.$set(_vm.fontsLocal, \"post\", $$v)},expression:\"fontsLocal.post\"}}),_vm._v(\" \"),_c('FontControl',{attrs:{\"name\":\"postCode\",\"label\":_vm.$t('settings.style.fonts.components.postCode'),\"fallback\":_vm.previewTheme.fonts.postCode},model:{value:(_vm.fontsLocal.postCode),callback:function ($$v) {_vm.$set(_vm.fontsLocal, \"postCode\", $$v)},expression:\"fontsLocal.postCode\"}})],1)])],1),_vm._v(\" \"),_c('div',{staticClass:\"apply-container\"},[_c('button',{staticClass:\"btn submit\",attrs:{\"disabled\":!_vm.themeValid},on:{\"click\":_vm.setCustomTheme}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.apply'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn\",on:{\"click\":_vm.clearAll}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.style.switcher.reset'))+\"\\n \")])])],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('label',{attrs:{\"for\":\"interface-language-switcher\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.interfaceLanguage'))+\"\\n \")]),_vm._v(\" \"),_c('label',{staticClass:\"select\",attrs:{\"for\":\"interface-language-switcher\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.language),expression:\"language\"}],attrs:{\"id\":\"interface-language-switcher\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.language=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},_vm._l((_vm.languageCodes),function(langCode,i){return _c('option',{key:langCode,domProps:{\"value\":langCode}},[_vm._v(\"\\n \"+_vm._s(_vm.languageNames[i])+\"\\n \")])}),0),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"settings panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.settings'))+\"\\n \")]),_vm._v(\" \"),_c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.currentSaveStateNotice)?[(_vm.currentSaveStateNotice.error)?_c('div',{staticClass:\"alert error\",on:{\"click\":function($event){$event.preventDefault();}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.saving_err'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(!_vm.currentSaveStateNotice.error)?_c('div',{staticClass:\"alert transparent\",on:{\"click\":function($event){$event.preventDefault();}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.saving_ok'))+\"\\n \")]):_vm._e()]:_vm._e()],2)],1),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[_c('keep-alive',[_c('tab-switcher',[_c('div',{attrs:{\"label\":_vm.$t('settings.general')}},[_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.interface')))]),_vm._v(\" \"),_c('ul',{staticClass:\"setting-list\"},[_c('li',[_c('interface-language-switcher')],1),_vm._v(\" \"),(_vm.instanceSpecificPanelPresent)?_c('li',[_c('Checkbox',{model:{value:(_vm.hideISP),callback:function ($$v) {_vm.hideISP=$$v},expression:\"hideISP\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_isp'))+\"\\n \")])],1):_vm._e()])]),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('nav.timeline')))]),_vm._v(\" \"),_c('ul',{staticClass:\"setting-list\"},[_c('li',[_c('Checkbox',{model:{value:(_vm.hideMutedPosts),callback:function ($$v) {_vm.hideMutedPosts=$$v},expression:\"hideMutedPosts\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_muted_posts'))+\" \"+_vm._s(_vm.$t('settings.instance_default', { value: _vm.hideMutedPostsLocalizedValue }))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.collapseMessageWithSubject),callback:function ($$v) {_vm.collapseMessageWithSubject=$$v},expression:\"collapseMessageWithSubject\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.collapse_subject'))+\" \"+_vm._s(_vm.$t('settings.instance_default', { value: _vm.collapseMessageWithSubjectLocalizedValue }))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.streaming),callback:function ($$v) {_vm.streaming=$$v},expression:\"streaming\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.streaming'))+\"\\n \")]),_vm._v(\" \"),_c('ul',{staticClass:\"setting-list suboptions\",class:[{disabled: !_vm.streaming}]},[_c('li',[_c('Checkbox',{attrs:{\"disabled\":!_vm.streaming},model:{value:(_vm.pauseOnUnfocused),callback:function ($$v) {_vm.pauseOnUnfocused=$$v},expression:\"pauseOnUnfocused\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.pause_on_unfocused'))+\"\\n \")])],1)])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.autoLoad),callback:function ($$v) {_vm.autoLoad=$$v},expression:\"autoLoad\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.autoload'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.hoverPreview),callback:function ($$v) {_vm.hoverPreview=$$v},expression:\"hoverPreview\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.reply_link_preview'))+\"\\n \")])],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.composing')))]),_vm._v(\" \"),_c('ul',{staticClass:\"setting-list\"},[_c('li',[_c('Checkbox',{model:{value:(_vm.scopeCopy),callback:function ($$v) {_vm.scopeCopy=$$v},expression:\"scopeCopy\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.scope_copy'))+\" \"+_vm._s(_vm.$t('settings.instance_default', { value: _vm.scopeCopyLocalizedValue }))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.alwaysShowSubjectInput),callback:function ($$v) {_vm.alwaysShowSubjectInput=$$v},expression:\"alwaysShowSubjectInput\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.subject_input_always_show'))+\" \"+_vm._s(_vm.$t('settings.instance_default', { value: _vm.alwaysShowSubjectInputLocalizedValue }))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('div',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.subject_line_behavior'))+\"\\n \"),_c('label',{staticClass:\"select\",attrs:{\"for\":\"subjectLineBehavior\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.subjectLineBehavior),expression:\"subjectLineBehavior\"}],attrs:{\"id\":\"subjectLineBehavior\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.subjectLineBehavior=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},[_c('option',{attrs:{\"value\":\"email\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.subject_line_email'))+\"\\n \"+_vm._s(_vm.subjectLineBehaviorDefaultValue == 'email' ? _vm.$t('settings.instance_default_simple') : '')+\"\\n \")]),_vm._v(\" \"),_c('option',{attrs:{\"value\":\"masto\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.subject_line_mastodon'))+\"\\n \"+_vm._s(_vm.subjectLineBehaviorDefaultValue == 'mastodon' ? _vm.$t('settings.instance_default_simple') : '')+\"\\n \")]),_vm._v(\" \"),_c('option',{attrs:{\"value\":\"noop\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.subject_line_noop'))+\"\\n \"+_vm._s(_vm.subjectLineBehaviorDefaultValue == 'noop' ? _vm.$t('settings.instance_default_simple') : '')+\"\\n \")])]),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])])]),_vm._v(\" \"),(_vm.postFormats.length > 0)?_c('li',[_c('div',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.post_status_content_type'))+\"\\n \"),_c('label',{staticClass:\"select\",attrs:{\"for\":\"postContentType\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.postContentType),expression:\"postContentType\"}],attrs:{\"id\":\"postContentType\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.postContentType=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},_vm._l((_vm.postFormats),function(postFormat){return _c('option',{key:postFormat,domProps:{\"value\":postFormat}},[_vm._v(\"\\n \"+_vm._s(_vm.$t((\"post_status.content_type[\\\"\" + postFormat + \"\\\"]\")))+\"\\n \"+_vm._s(_vm.postContentTypeDefaultValue === postFormat ? _vm.$t('settings.instance_default_simple') : '')+\"\\n \")])}),0),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])])]):_vm._e(),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.minimalScopesMode),callback:function ($$v) {_vm.minimalScopesMode=$$v},expression:\"minimalScopesMode\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.minimal_scopes_mode'))+\" \"+_vm._s(_vm.$t('settings.instance_default', { value: _vm.minimalScopesModeLocalizedValue }))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.autohideFloatingPostButton),callback:function ($$v) {_vm.autohideFloatingPostButton=$$v},expression:\"autohideFloatingPostButton\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.autohide_floating_post_button'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.padEmoji),callback:function ($$v) {_vm.padEmoji=$$v},expression:\"padEmoji\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.pad_emoji'))+\"\\n \")])],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.attachments')))]),_vm._v(\" \"),_c('ul',{staticClass:\"setting-list\"},[_c('li',[_c('Checkbox',{model:{value:(_vm.hideAttachments),callback:function ($$v) {_vm.hideAttachments=$$v},expression:\"hideAttachments\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_attachments_in_tl'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.hideAttachmentsInConv),callback:function ($$v) {_vm.hideAttachmentsInConv=$$v},expression:\"hideAttachmentsInConv\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_attachments_in_convo'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('label',{attrs:{\"for\":\"maxThumbnails\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.max_thumbnails'))+\"\\n \")]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model.number\",value:(_vm.maxThumbnails),expression:\"maxThumbnails\",modifiers:{\"number\":true}}],staticClass:\"number-input\",attrs:{\"id\":\"maxThumbnails\",\"type\":\"number\",\"min\":\"0\",\"step\":\"1\"},domProps:{\"value\":(_vm.maxThumbnails)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.maxThumbnails=_vm._n($event.target.value)},\"blur\":function($event){_vm.$forceUpdate()}}})]),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.hideNsfw),callback:function ($$v) {_vm.hideNsfw=$$v},expression:\"hideNsfw\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.nsfw_clickthrough'))+\"\\n \")])],1),_vm._v(\" \"),_c('ul',{staticClass:\"setting-list suboptions\"},[_c('li',[_c('Checkbox',{attrs:{\"disabled\":!_vm.hideNsfw},model:{value:(_vm.preloadImage),callback:function ($$v) {_vm.preloadImage=$$v},expression:\"preloadImage\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.preload_images'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{attrs:{\"disabled\":!_vm.hideNsfw},model:{value:(_vm.useOneClickNsfw),callback:function ($$v) {_vm.useOneClickNsfw=$$v},expression:\"useOneClickNsfw\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.use_one_click_nsfw'))+\"\\n \")])],1)]),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.stopGifs),callback:function ($$v) {_vm.stopGifs=$$v},expression:\"stopGifs\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.stop_gifs'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.loopVideo),callback:function ($$v) {_vm.loopVideo=$$v},expression:\"loopVideo\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.loop_video'))+\"\\n \")]),_vm._v(\" \"),_c('ul',{staticClass:\"setting-list suboptions\",class:[{disabled: !_vm.streaming}]},[_c('li',[_c('Checkbox',{attrs:{\"disabled\":!_vm.loopVideo || !_vm.loopSilentAvailable},model:{value:(_vm.loopVideoSilentOnly),callback:function ($$v) {_vm.loopVideoSilentOnly=$$v},expression:\"loopVideoSilentOnly\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.loop_video_silent_only'))+\"\\n \")]),_vm._v(\" \"),(!_vm.loopSilentAvailable)?_c('div',{staticClass:\"unavailable\"},[_c('i',{staticClass:\"icon-globe\"}),_vm._v(\"! \"+_vm._s(_vm.$t('settings.limited_availability'))+\"\\n \")]):_vm._e()],1)])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.playVideosInModal),callback:function ($$v) {_vm.playVideosInModal=$$v},expression:\"playVideosInModal\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.play_videos_in_modal'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.useContainFit),callback:function ($$v) {_vm.useContainFit=$$v},expression:\"useContainFit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.use_contain_fit'))+\"\\n \")])],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.notifications')))]),_vm._v(\" \"),_c('ul',{staticClass:\"setting-list\"},[_c('li',[_c('Checkbox',{model:{value:(_vm.webPushNotifications),callback:function ($$v) {_vm.webPushNotifications=$$v},expression:\"webPushNotifications\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.enable_web_push_notifications'))+\"\\n \")])],1)])])]),_vm._v(\" \"),_c('div',{attrs:{\"label\":_vm.$t('settings.theme')}},[_c('div',{staticClass:\"setting-item\"},[_c('style-switcher')],1)]),_vm._v(\" \"),_c('div',{attrs:{\"label\":_vm.$t('settings.filtering')}},[_c('div',{staticClass:\"setting-item\"},[_c('div',{staticClass:\"select-multiple\"},[_c('span',{staticClass:\"label\"},[_vm._v(_vm._s(_vm.$t('settings.notification_visibility')))]),_vm._v(\" \"),_c('ul',{staticClass:\"option-list\"},[_c('li',[_c('Checkbox',{model:{value:(_vm.notificationVisibility.likes),callback:function ($$v) {_vm.$set(_vm.notificationVisibility, \"likes\", $$v)},expression:\"notificationVisibility.likes\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.notification_visibility_likes'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.notificationVisibility.repeats),callback:function ($$v) {_vm.$set(_vm.notificationVisibility, \"repeats\", $$v)},expression:\"notificationVisibility.repeats\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.notification_visibility_repeats'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.notificationVisibility.follows),callback:function ($$v) {_vm.$set(_vm.notificationVisibility, \"follows\", $$v)},expression:\"notificationVisibility.follows\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.notification_visibility_follows'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.notificationVisibility.mentions),callback:function ($$v) {_vm.$set(_vm.notificationVisibility, \"mentions\", $$v)},expression:\"notificationVisibility.mentions\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.notification_visibility_mentions'))+\"\\n \")])],1)])]),_vm._v(\" \"),_c('div',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.replies_in_timeline'))+\"\\n \"),_c('label',{staticClass:\"select\",attrs:{\"for\":\"replyVisibility\"}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.replyVisibility),expression:\"replyVisibility\"}],attrs:{\"id\":\"replyVisibility\"},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.replyVisibility=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},[_c('option',{attrs:{\"value\":\"all\",\"selected\":\"\"}},[_vm._v(_vm._s(_vm.$t('settings.reply_visibility_all')))]),_vm._v(\" \"),_c('option',{attrs:{\"value\":\"following\"}},[_vm._v(_vm._s(_vm.$t('settings.reply_visibility_following')))]),_vm._v(\" \"),_c('option',{attrs:{\"value\":\"self\"}},[_vm._v(_vm._s(_vm.$t('settings.reply_visibility_self')))])]),_vm._v(\" \"),_c('i',{staticClass:\"icon-down-open\"})])]),_vm._v(\" \"),_c('div',[_c('Checkbox',{model:{value:(_vm.hidePostStats),callback:function ($$v) {_vm.hidePostStats=$$v},expression:\"hidePostStats\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_post_stats'))+\" \"+_vm._s(_vm.$t('settings.instance_default', { value: _vm.hidePostStatsLocalizedValue }))+\"\\n \")])],1),_vm._v(\" \"),_c('div',[_c('Checkbox',{model:{value:(_vm.hideUserStats),callback:function ($$v) {_vm.hideUserStats=$$v},expression:\"hideUserStats\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_user_stats'))+\" \"+_vm._s(_vm.$t('settings.instance_default', { value: _vm.hideUserStatsLocalizedValue }))+\"\\n \")])],1)]),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.filtering_explanation')))]),_vm._v(\" \"),_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.muteWordsString),expression:\"muteWordsString\"}],attrs:{\"id\":\"muteWords\"},domProps:{\"value\":(_vm.muteWordsString)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.muteWordsString=$event.target.value}}})]),_vm._v(\" \"),_c('div',[_c('Checkbox',{model:{value:(_vm.hideFilteredStatuses),callback:function ($$v) {_vm.hideFilteredStatuses=$$v},expression:\"hideFilteredStatuses\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_filtered_statuses'))+\" \"+_vm._s(_vm.$t('settings.instance_default', { value: _vm.hideFilteredStatusesLocalizedValue }))+\"\\n \")])],1)])]),_vm._v(\" \"),_c('div',{attrs:{\"label\":_vm.$t('settings.version.title')}},[_c('div',{staticClass:\"setting-item\"},[_c('ul',{staticClass:\"setting-list\"},[_c('li',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.version.backend_version')))]),_vm._v(\" \"),_c('ul',{staticClass:\"option-list\"},[_c('li',[_c('a',{attrs:{\"href\":_vm.backendVersionLink,\"target\":\"_blank\"}},[_vm._v(_vm._s(_vm.backendVersion))])])])]),_vm._v(\" \"),_c('li',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.version.frontend_version')))]),_vm._v(\" \"),_c('ul',{staticClass:\"option-list\"},[_c('li',[_c('a',{attrs:{\"href\":_vm.frontendVersionLink,\"target\":\"_blank\"}},[_vm._v(_vm._s(_vm.frontendVersion))])])])])])])])])],1)],1)])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"settings panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('registration.registration'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[_c('form',{staticClass:\"registration-form\",on:{\"submit\":function($event){$event.preventDefault();_vm.submit(_vm.user)}}},[_c('div',{staticClass:\"container\"},[_c('div',{staticClass:\"text-fields\"},[_c('div',{staticClass:\"form-group\",class:{ 'form-group--error': _vm.$v.user.username.$error }},[_c('label',{staticClass:\"form--label\",attrs:{\"for\":\"sign-up-username\"}},[_vm._v(_vm._s(_vm.$t('login.username')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model.trim\",value:(_vm.$v.user.username.$model),expression:\"$v.user.username.$model\",modifiers:{\"trim\":true}}],staticClass:\"form-control\",attrs:{\"id\":\"sign-up-username\",\"disabled\":_vm.isPending,\"placeholder\":_vm.$t('registration.username_placeholder')},domProps:{\"value\":(_vm.$v.user.username.$model)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.$v.user.username, \"$model\", $event.target.value.trim())},\"blur\":function($event){_vm.$forceUpdate()}}})]),_vm._v(\" \"),(_vm.$v.user.username.$dirty)?_c('div',{staticClass:\"form-error\"},[_c('ul',[(!_vm.$v.user.username.required)?_c('li',[_c('span',[_vm._v(_vm._s(_vm.$t('registration.validations.username_required')))])]):_vm._e()])]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"form-group\",class:{ 'form-group--error': _vm.$v.user.fullname.$error }},[_c('label',{staticClass:\"form--label\",attrs:{\"for\":\"sign-up-fullname\"}},[_vm._v(_vm._s(_vm.$t('registration.fullname')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model.trim\",value:(_vm.$v.user.fullname.$model),expression:\"$v.user.fullname.$model\",modifiers:{\"trim\":true}}],staticClass:\"form-control\",attrs:{\"id\":\"sign-up-fullname\",\"disabled\":_vm.isPending,\"placeholder\":_vm.$t('registration.fullname_placeholder')},domProps:{\"value\":(_vm.$v.user.fullname.$model)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.$v.user.fullname, \"$model\", $event.target.value.trim())},\"blur\":function($event){_vm.$forceUpdate()}}})]),_vm._v(\" \"),(_vm.$v.user.fullname.$dirty)?_c('div',{staticClass:\"form-error\"},[_c('ul',[(!_vm.$v.user.fullname.required)?_c('li',[_c('span',[_vm._v(_vm._s(_vm.$t('registration.validations.fullname_required')))])]):_vm._e()])]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"form-group\",class:{ 'form-group--error': _vm.$v.user.email.$error }},[_c('label',{staticClass:\"form--label\",attrs:{\"for\":\"email\"}},[_vm._v(_vm._s(_vm.$t('registration.email')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.$v.user.email.$model),expression:\"$v.user.email.$model\"}],staticClass:\"form-control\",attrs:{\"id\":\"email\",\"disabled\":_vm.isPending,\"type\":\"email\"},domProps:{\"value\":(_vm.$v.user.email.$model)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.$v.user.email, \"$model\", $event.target.value)}}})]),_vm._v(\" \"),(_vm.$v.user.email.$dirty)?_c('div',{staticClass:\"form-error\"},[_c('ul',[(!_vm.$v.user.email.required)?_c('li',[_c('span',[_vm._v(_vm._s(_vm.$t('registration.validations.email_required')))])]):_vm._e()])]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('label',{staticClass:\"form--label\",attrs:{\"for\":\"bio\"}},[_vm._v(_vm._s(_vm.$t('registration.bio'))+\" (\"+_vm._s(_vm.$t('general.optional'))+\")\")]),_vm._v(\" \"),_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.bio),expression:\"user.bio\"}],staticClass:\"form-control\",attrs:{\"id\":\"bio\",\"disabled\":_vm.isPending,\"placeholder\":_vm.bioPlaceholder},domProps:{\"value\":(_vm.user.bio)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"bio\", $event.target.value)}}})]),_vm._v(\" \"),_c('div',{staticClass:\"form-group\",class:{ 'form-group--error': _vm.$v.user.password.$error }},[_c('label',{staticClass:\"form--label\",attrs:{\"for\":\"sign-up-password\"}},[_vm._v(_vm._s(_vm.$t('login.password')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.password),expression:\"user.password\"}],staticClass:\"form-control\",attrs:{\"id\":\"sign-up-password\",\"disabled\":_vm.isPending,\"type\":\"password\"},domProps:{\"value\":(_vm.user.password)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"password\", $event.target.value)}}})]),_vm._v(\" \"),(_vm.$v.user.password.$dirty)?_c('div',{staticClass:\"form-error\"},[_c('ul',[(!_vm.$v.user.password.required)?_c('li',[_c('span',[_vm._v(_vm._s(_vm.$t('registration.validations.password_required')))])]):_vm._e()])]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"form-group\",class:{ 'form-group--error': _vm.$v.user.confirm.$error }},[_c('label',{staticClass:\"form--label\",attrs:{\"for\":\"sign-up-password-confirmation\"}},[_vm._v(_vm._s(_vm.$t('registration.password_confirm')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.confirm),expression:\"user.confirm\"}],staticClass:\"form-control\",attrs:{\"id\":\"sign-up-password-confirmation\",\"disabled\":_vm.isPending,\"type\":\"password\"},domProps:{\"value\":(_vm.user.confirm)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"confirm\", $event.target.value)}}})]),_vm._v(\" \"),(_vm.$v.user.confirm.$dirty)?_c('div',{staticClass:\"form-error\"},[_c('ul',[(!_vm.$v.user.confirm.required)?_c('li',[_c('span',[_vm._v(_vm._s(_vm.$t('registration.validations.password_confirmation_required')))])]):_vm._e(),_vm._v(\" \"),(!_vm.$v.user.confirm.sameAsPassword)?_c('li',[_c('span',[_vm._v(_vm._s(_vm.$t('registration.validations.password_confirmation_match')))])]):_vm._e()])]):_vm._e(),_vm._v(\" \"),(_vm.captcha.type != 'none')?_c('div',{staticClass:\"form-group\",attrs:{\"id\":\"captcha-group\"}},[_c('label',{staticClass:\"form--label\",attrs:{\"for\":\"captcha-label\"}},[_vm._v(_vm._s(_vm.$t('captcha')))]),_vm._v(\" \"),(_vm.captcha.type == 'kocaptcha')?[_c('img',{attrs:{\"src\":_vm.captcha.url},on:{\"click\":_vm.setCaptcha}}),_vm._v(\" \"),_c('sub',[_vm._v(_vm._s(_vm.$t('registration.new_captcha')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.captcha.solution),expression:\"captcha.solution\"}],staticClass:\"form-control\",attrs:{\"id\":\"captcha-answer\",\"disabled\":_vm.isPending,\"type\":\"text\",\"autocomplete\":\"off\"},domProps:{\"value\":(_vm.captcha.solution)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.captcha, \"solution\", $event.target.value)}}})]:_vm._e()],2):_vm._e(),_vm._v(\" \"),(_vm.token)?_c('div',{staticClass:\"form-group\"},[_c('label',{attrs:{\"for\":\"token\"}},[_vm._v(_vm._s(_vm.$t('registration.token')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.token),expression:\"token\"}],staticClass:\"form-control\",attrs:{\"id\":\"token\",\"disabled\":\"true\",\"type\":\"text\"},domProps:{\"value\":(_vm.token)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.token=$event.target.value}}})]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.isPending,\"type\":\"submit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")])])]),_vm._v(\" \"),_c('div',{staticClass:\"terms-of-service\",domProps:{\"innerHTML\":_vm._s(_vm.termsOfService)}})]),_vm._v(\" \"),(_vm.serverValidationErrors.length)?_c('div',{staticClass:\"form-group\"},[_c('div',{staticClass:\"alert error\"},_vm._l((_vm.serverValidationErrors),function(error){return _c('span',{key:error},[_vm._v(_vm._s(error))])}),0)]):_vm._e()])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"settings panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('password_reset.password_reset'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[_c('form',{staticClass:\"password-reset-form\",on:{\"submit\":function($event){$event.preventDefault();return _vm.submit($event)}}},[_c('div',{staticClass:\"container\"},[(!_vm.mailerEnabled)?_c('div',[(_vm.passwordResetRequested)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('password_reset.password_reset_required_but_mailer_is_disabled'))+\"\\n \")]):_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('password_reset.password_reset_disabled'))+\"\\n \")])]):(_vm.success || _vm.throttled)?_c('div',[(_vm.success)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('password_reset.check_email'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"form-group text-center\"},[_c('router-link',{attrs:{\"to\":{name: 'root'}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('password_reset.return_home'))+\"\\n \")])],1)]):_c('div',[(_vm.passwordResetRequested)?_c('p',{staticClass:\"password-reset-required error\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('password_reset.password_reset_required'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('password_reset.instruction'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.email),expression:\"user.email\"}],ref:\"email\",staticClass:\"form-control\",attrs:{\"disabled\":_vm.isPending,\"placeholder\":_vm.$t('password_reset.placeholder'),\"type\":\"input\"},domProps:{\"value\":(_vm.user.email)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"email\", $event.target.value)}}})]),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('button',{staticClass:\"btn btn-default btn-block\",attrs:{\"disabled\":_vm.isPending,\"type\":\"submit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")])])]),_vm._v(\" \"),(_vm.error)?_c('p',{staticClass:\"alert error notice-dismissible\"},[_c('span',[_vm._v(_vm._s(_vm.error))]),_vm._v(\" \"),_c('a',{staticClass:\"button-icon dismiss\",on:{\"click\":function($event){$event.preventDefault();_vm.dismissError()}}},[_c('i',{staticClass:\"icon-cancel\"})])]):_vm._e()])])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"image-cropper\"},[(_vm.dataUrl)?_c('div',[_c('div',{staticClass:\"image-cropper-image-container\"},[_c('img',{ref:\"img\",attrs:{\"src\":_vm.dataUrl,\"alt\":\"\"},on:{\"load\":function($event){$event.stopPropagation();return _vm.createCropper($event)}}})]),_vm._v(\" \"),_c('div',{staticClass:\"image-cropper-buttons-wrapper\"},[_c('button',{staticClass:\"btn\",attrs:{\"type\":\"button\",\"disabled\":_vm.submitting},domProps:{\"textContent\":_vm._s(_vm.saveText)},on:{\"click\":function($event){_vm.submit()}}}),_vm._v(\" \"),_c('button',{staticClass:\"btn\",attrs:{\"type\":\"button\",\"disabled\":_vm.submitting},domProps:{\"textContent\":_vm._s(_vm.cancelText)},on:{\"click\":_vm.destroy}}),_vm._v(\" \"),_c('button',{staticClass:\"btn\",attrs:{\"type\":\"button\",\"disabled\":_vm.submitting},domProps:{\"textContent\":_vm._s(_vm.saveWithoutCroppingText)},on:{\"click\":function($event){_vm.submit(false)}}}),_vm._v(\" \"),(_vm.submitting)?_c('i',{staticClass:\"icon-spin4 animate-spin\"}):_vm._e()]),_vm._v(\" \"),(_vm.submitError)?_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.submitErrorMsg)+\"\\n \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":_vm.clearError}})]):_vm._e()]):_vm._e(),_vm._v(\" \"),_c('input',{ref:\"input\",staticClass:\"image-cropper-img-input\",attrs:{\"type\":\"file\",\"accept\":_vm.mimes}})])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('basic-user-card',{attrs:{\"user\":_vm.user}},[_c('div',{staticClass:\"block-card-content-container\"},[(_vm.blocked)?_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.progress},on:{\"click\":_vm.unblockUser}},[(_vm.progress)?[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unblock_progress'))+\"\\n \")]:[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unblock'))+\"\\n \")]],2):_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.progress},on:{\"click\":_vm.blockUser}},[(_vm.progress)?[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.block_progress'))+\"\\n \")]:[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.block'))+\"\\n \")]],2)])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('basic-user-card',{attrs:{\"user\":_vm.user}},[_c('div',{staticClass:\"mute-card-content-container\"},[(_vm.muted)?_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.progress},on:{\"click\":_vm.unmuteUser}},[(_vm.progress)?[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unmute_progress'))+\"\\n \")]:[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unmute'))+\"\\n \")]],2):_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.progress},on:{\"click\":_vm.muteUser}},[(_vm.progress)?[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.mute_progress'))+\"\\n \")]:[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.mute'))+\"\\n \")]],2)])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"selectable-list\"},[(_vm.items.length > 0)?_c('div',{staticClass:\"selectable-list-header\"},[_c('div',{staticClass:\"selectable-list-checkbox-wrapper\"},[_c('Checkbox',{attrs:{\"checked\":_vm.allSelected,\"indeterminate\":_vm.someSelected},on:{\"change\":_vm.toggleAll}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('selectable_list.select_all'))+\"\\n \")])],1),_vm._v(\" \"),_c('div',{staticClass:\"selectable-list-header-actions\"},[_vm._t(\"header\",null,{selected:_vm.filteredSelected})],2)]):_vm._e(),_vm._v(\" \"),_c('List',{attrs:{\"items\":_vm.items,\"get-key\":_vm.getKey},scopedSlots:_vm._u([{key:\"item\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('div',{staticClass:\"selectable-list-item-inner\",class:{ 'selectable-list-item-selected-inner': _vm.isSelected(item) }},[_c('div',{staticClass:\"selectable-list-checkbox-wrapper\"},[_c('Checkbox',{attrs:{\"checked\":_vm.isSelected(item)},on:{\"change\":function (checked) { return _vm.toggle(checked, item); }}})],1),_vm._v(\" \"),_vm._t(\"item\",null,{item:item})],2)]}}])},[_c('template',{slot:\"empty\"},[_vm._t(\"empty\")],2)],2)],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"click-outside\",rawName:\"v-click-outside\",value:(_vm.onClickOutside),expression:\"onClickOutside\"}],staticClass:\"autosuggest\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.term),expression:\"term\"}],staticClass:\"autosuggest-input\",attrs:{\"placeholder\":_vm.placeholder},domProps:{\"value\":(_vm.term)},on:{\"click\":_vm.onInputClick,\"input\":function($event){if($event.target.composing){ return; }_vm.term=$event.target.value}}}),_vm._v(\" \"),(_vm.resultsVisible && _vm.filtered.length > 0)?_c('div',{staticClass:\"autosuggest-results\"},[_vm._l((_vm.filtered),function(item){return _vm._t(\"default\",null,{item:item})})],2):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"importer\"},[_c('form',[_c('input',{ref:\"input\",attrs:{\"type\":\"file\"},on:{\"change\":_vm.change}})]),_vm._v(\" \"),(_vm.submitting)?_c('i',{staticClass:\"icon-spin4 animate-spin importer-uploading\"}):_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.submit}},[_vm._v(\"\\n \"+_vm._s(_vm.submitButtonLabel)+\"\\n \")]),_vm._v(\" \"),(_vm.success)?_c('div',[_c('i',{staticClass:\"icon-cross\",on:{\"click\":_vm.dismiss}}),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.successMessage))])]):(_vm.error)?_c('div',[_c('i',{staticClass:\"icon-cross\",on:{\"click\":_vm.dismiss}}),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.errorMessage))])]):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"exporter\"},[(_vm.processing)?_c('div',[_c('i',{staticClass:\"icon-spin4 animate-spin exporter-processing\"}),_vm._v(\" \"),_c('span',[_vm._v(_vm._s(_vm.processingMessage))])]):_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.process}},[_vm._v(\"\\n \"+_vm._s(_vm.exportButtonLabel)+\"\\n \")])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.displayTitle)?_c('h4',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.mfa.recovery_codes'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.inProgress)?_c('i',[_vm._v(_vm._s(_vm.$t('settings.mfa.waiting_a_recovery_codes')))]):_vm._e(),_vm._v(\" \"),(_vm.ready)?[_c('p',{staticClass:\"alert warning\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.mfa.recovery_codes_warning'))+\"\\n \")]),_vm._v(\" \"),_c('ul',{staticClass:\"backup-codes\"},_vm._l((_vm.backupCodes.codes),function(code){return _c('li',{key:code},[_vm._v(\"\\n \"+_vm._s(code)+\"\\n \")])}),0)]:_vm._e()],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._t(\"default\"),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.disabled},on:{\"click\":_vm.confirm}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.confirm'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.disabled},on:{\"click\":_vm.cancel}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.cancel'))+\"\\n \")])],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"method-item\"},[_c('strong',[_vm._v(_vm._s(_vm.$t('settings.mfa.otp')))]),_vm._v(\" \"),(!_vm.isActivated)?_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.doActivate}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.enable'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.isActivated)?_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.deactivate},on:{\"click\":_vm.doDeactivate}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.disable'))+\"\\n \")]):_vm._e()]),_vm._v(\" \"),(_vm.deactivate)?_c('confirm',{attrs:{\"disabled\":_vm.inProgress},on:{\"confirm\":_vm.confirmDeactivate,\"cancel\":_vm.cancelDeactivate}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.enter_current_password_to_confirm'))+\":\\n \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.currentPassword),expression:\"currentPassword\"}],attrs:{\"type\":\"password\"},domProps:{\"value\":(_vm.currentPassword)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.currentPassword=$event.target.value}}})]):_vm._e(),_vm._v(\" \"),(_vm.error)?_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.error)+\"\\n \")]):_vm._e()],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.readyInit && _vm.settings.available)?_c('div',{staticClass:\"setting-item mfa-settings\"},[_c('div',{staticClass:\"mfa-heading\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.mfa.title')))])]),_vm._v(\" \"),_c('div',[(!_vm.setupInProgress)?_c('div',{staticClass:\"setting-item\"},[_c('h3',[_vm._v(_vm._s(_vm.$t('settings.mfa.authentication_methods')))]),_vm._v(\" \"),_c('totp-item',{attrs:{\"settings\":_vm.settings},on:{\"deactivate\":_vm.fetchSettings,\"activate\":_vm.activateOTP}}),_vm._v(\" \"),_c('br'),_vm._v(\" \"),(_vm.settings.enabled)?_c('div',[(!_vm.confirmNewBackupCodes)?_c('recovery-codes',{attrs:{\"backup-codes\":_vm.backupCodes}}):_vm._e(),_vm._v(\" \"),(!_vm.confirmNewBackupCodes)?_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.getBackupCodes}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.mfa.generate_new_recovery_codes'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.confirmNewBackupCodes)?_c('div',[_c('confirm',{attrs:{\"disabled\":_vm.backupCodes.inProgress},on:{\"confirm\":_vm.confirmBackupCodes,\"cancel\":_vm.cancelBackupCodes}},[_c('p',{staticClass:\"warning\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.mfa.warning_of_generate_new_codes'))+\"\\n \")])])],1):_vm._e()],1):_vm._e()],1):_vm._e(),_vm._v(\" \"),(_vm.setupInProgress)?_c('div',[_c('h3',[_vm._v(_vm._s(_vm.$t('settings.mfa.setup_otp')))]),_vm._v(\" \"),(!_vm.setupOTPInProgress)?_c('recovery-codes',{attrs:{\"backup-codes\":_vm.backupCodes}}):_vm._e(),_vm._v(\" \"),(_vm.canSetupOTP)?_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.cancelSetup}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.cancel'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.canSetupOTP)?_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.setupOTP}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.mfa.setup_otp'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.setupOTPInProgress)?[(_vm.prepareOTP)?_c('i',[_vm._v(_vm._s(_vm.$t('settings.mfa.wait_pre_setup_otp')))]):_vm._e(),_vm._v(\" \"),(_vm.confirmOTP)?_c('div',[_c('div',{staticClass:\"setup-otp\"},[_c('div',{staticClass:\"qr-code\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('settings.mfa.scan.title')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.mfa.scan.desc')))]),_vm._v(\" \"),_c('qrcode',{attrs:{\"value\":_vm.otpSettings.provisioning_uri,\"options\":{ width: 200 }}}),_vm._v(\" \"),_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.mfa.scan.secret_code'))+\":\\n \"+_vm._s(_vm.otpSettings.key)+\"\\n \")])],1),_vm._v(\" \"),_c('div',{staticClass:\"verify\"},[_c('h4',[_vm._v(_vm._s(_vm.$t('general.verify')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.mfa.verify.desc')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.otpConfirmToken),expression:\"otpConfirmToken\"}],attrs:{\"type\":\"text\"},domProps:{\"value\":(_vm.otpConfirmToken)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.otpConfirmToken=$event.target.value}}}),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.enter_current_password_to_confirm'))+\":\")]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.currentPassword),expression:\"currentPassword\"}],attrs:{\"type\":\"password\"},domProps:{\"value\":(_vm.currentPassword)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.currentPassword=$event.target.value}}}),_vm._v(\" \"),_c('div',{staticClass:\"confirm-otp-actions\"},[_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.doConfirmOTP}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.mfa.confirm_and_enable'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.cancelSetup}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.cancel'))+\"\\n \")])]),_vm._v(\" \"),(_vm.error)?_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.error)+\"\\n \")]):_vm._e()])])]):_vm._e()]:_vm._e()],2):_vm._e()])]):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"settings panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.user_settings'))+\"\\n \")]),_vm._v(\" \"),_c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.currentSaveStateNotice)?[(_vm.currentSaveStateNotice.error)?_c('div',{staticClass:\"alert error\",on:{\"click\":function($event){$event.preventDefault();}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.saving_err'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(!_vm.currentSaveStateNotice.error)?_c('div',{staticClass:\"alert transparent\",on:{\"click\":function($event){$event.preventDefault();}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.saving_ok'))+\"\\n \")]):_vm._e()]:_vm._e()],2)],1),_vm._v(\" \"),_c('div',{staticClass:\"panel-body profile-edit\"},[_c('tab-switcher',[_c('div',{attrs:{\"label\":_vm.$t('settings.profile_tab')}},[_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.name_bio')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.name')))]),_vm._v(\" \"),_c('EmojiInput',{attrs:{\"enable-emoji-picker\":\"\",\"suggest\":_vm.emojiSuggestor},model:{value:(_vm.newName),callback:function ($$v) {_vm.newName=$$v},expression:\"newName\"}},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.newName),expression:\"newName\"}],attrs:{\"id\":\"username\",\"classname\":\"name-changer\"},domProps:{\"value\":(_vm.newName)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.newName=$event.target.value}}})]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.bio')))]),_vm._v(\" \"),_c('EmojiInput',{attrs:{\"enable-emoji-picker\":\"\",\"suggest\":_vm.emojiUserSuggestor},model:{value:(_vm.newBio),callback:function ($$v) {_vm.newBio=$$v},expression:\"newBio\"}},[_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.newBio),expression:\"newBio\"}],attrs:{\"classname\":\"bio\"},domProps:{\"value\":(_vm.newBio)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.newBio=$event.target.value}}})]),_vm._v(\" \"),_c('p',[_c('Checkbox',{model:{value:(_vm.newLocked),callback:function ($$v) {_vm.newLocked=$$v},expression:\"newLocked\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.lock_account_description'))+\"\\n \")])],1),_vm._v(\" \"),_c('div',[_c('label',{attrs:{\"for\":\"default-vis\"}},[_vm._v(_vm._s(_vm.$t('settings.default_vis')))]),_vm._v(\" \"),_c('div',{staticClass:\"visibility-tray\",attrs:{\"id\":\"default-vis\"}},[_c('scope-selector',{attrs:{\"show-all\":true,\"user-default\":_vm.newDefaultScope,\"initial-scope\":_vm.newDefaultScope,\"on-scope-change\":_vm.changeVis}})],1)]),_vm._v(\" \"),_c('p',[_c('Checkbox',{model:{value:(_vm.newNoRichText),callback:function ($$v) {_vm.newNoRichText=$$v},expression:\"newNoRichText\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.no_rich_text_description'))+\"\\n \")])],1),_vm._v(\" \"),_c('p',[_c('Checkbox',{model:{value:(_vm.hideFollows),callback:function ($$v) {_vm.hideFollows=$$v},expression:\"hideFollows\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_follows_description'))+\"\\n \")])],1),_vm._v(\" \"),_c('p',{staticClass:\"setting-subitem\"},[_c('Checkbox',{attrs:{\"disabled\":!_vm.hideFollows},model:{value:(_vm.hideFollowsCount),callback:function ($$v) {_vm.hideFollowsCount=$$v},expression:\"hideFollowsCount\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_follows_count_description'))+\"\\n \")])],1),_vm._v(\" \"),_c('p',[_c('Checkbox',{model:{value:(_vm.hideFollowers),callback:function ($$v) {_vm.hideFollowers=$$v},expression:\"hideFollowers\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_followers_description'))+\"\\n \")])],1),_vm._v(\" \"),_c('p',{staticClass:\"setting-subitem\"},[_c('Checkbox',{attrs:{\"disabled\":!_vm.hideFollowers},model:{value:(_vm.hideFollowersCount),callback:function ($$v) {_vm.hideFollowersCount=$$v},expression:\"hideFollowersCount\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.hide_followers_count_description'))+\"\\n \")])],1),_vm._v(\" \"),_c('p',[_c('Checkbox',{model:{value:(_vm.showRole),callback:function ($$v) {_vm.showRole=$$v},expression:\"showRole\"}},[(_vm.role === 'admin')?[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.show_admin_badge'))+\"\\n \")]:_vm._e(),_vm._v(\" \"),(_vm.role === 'moderator')?[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.show_moderator_badge'))+\"\\n \")]:_vm._e()],2)],1),_vm._v(\" \"),_c('p',[_c('Checkbox',{model:{value:(_vm.discoverable),callback:function ($$v) {_vm.discoverable=$$v},expression:\"discoverable\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.discoverable'))+\"\\n \")])],1),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.newName && _vm.newName.length === 0},on:{\"click\":_vm.updateProfile}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")])],1),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.avatar')))]),_vm._v(\" \"),_c('p',{staticClass:\"visibility-notice\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.avatar_size_instruction'))+\"\\n \")]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.current_avatar')))]),_vm._v(\" \"),_c('img',{staticClass:\"current-avatar\",attrs:{\"src\":_vm.user.profile_image_url_original}}),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.set_new_avatar')))]),_vm._v(\" \"),_c('button',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.pickAvatarBtnVisible),expression:\"pickAvatarBtnVisible\"}],staticClass:\"btn\",attrs:{\"id\":\"pick-avatar\",\"type\":\"button\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.upload_a_photo'))+\"\\n \")]),_vm._v(\" \"),_c('image-cropper',{attrs:{\"trigger\":\"#pick-avatar\",\"submit-handler\":_vm.submitAvatar},on:{\"open\":function($event){_vm.pickAvatarBtnVisible=false},\"close\":function($event){_vm.pickAvatarBtnVisible=true}}})],1),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.profile_banner')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.current_profile_banner')))]),_vm._v(\" \"),_c('img',{staticClass:\"banner\",attrs:{\"src\":_vm.user.cover_photo}}),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.set_new_profile_banner')))]),_vm._v(\" \"),(_vm.bannerPreview)?_c('img',{staticClass:\"banner\",attrs:{\"src\":_vm.bannerPreview}}):_vm._e(),_vm._v(\" \"),_c('div',[_c('input',{attrs:{\"type\":\"file\"},on:{\"change\":function($event){_vm.uploadFile('banner', $event)}}})]),_vm._v(\" \"),(_vm.bannerUploading)?_c('i',{staticClass:\" icon-spin4 animate-spin uploading\"}):(_vm.bannerPreview)?_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.submitBanner}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.bannerUploadError)?_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n Error: \"+_vm._s(_vm.bannerUploadError)+\"\\n \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":function($event){_vm.clearUploadError('banner')}}})]):_vm._e()]),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.profile_background')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.set_new_profile_background')))]),_vm._v(\" \"),(_vm.backgroundPreview)?_c('img',{staticClass:\"bg\",attrs:{\"src\":_vm.backgroundPreview}}):_vm._e(),_vm._v(\" \"),_c('div',[_c('input',{attrs:{\"type\":\"file\"},on:{\"change\":function($event){_vm.uploadFile('background', $event)}}})]),_vm._v(\" \"),(_vm.backgroundUploading)?_c('i',{staticClass:\" icon-spin4 animate-spin uploading\"}):(_vm.backgroundPreview)?_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.submitBg}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.backgroundUploadError)?_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n Error: \"+_vm._s(_vm.backgroundUploadError)+\"\\n \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":function($event){_vm.clearUploadError('background')}}})]):_vm._e()])]),_vm._v(\" \"),_c('div',{attrs:{\"label\":_vm.$t('settings.security_tab')}},[_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.change_email')))]),_vm._v(\" \"),_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.new_email')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.newEmail),expression:\"newEmail\"}],attrs:{\"type\":\"email\",\"autocomplete\":\"email\"},domProps:{\"value\":(_vm.newEmail)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.newEmail=$event.target.value}}})]),_vm._v(\" \"),_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.current_password')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.changeEmailPassword),expression:\"changeEmailPassword\"}],attrs:{\"type\":\"password\",\"autocomplete\":\"current-password\"},domProps:{\"value\":(_vm.changeEmailPassword)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.changeEmailPassword=$event.target.value}}})]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.changeEmail}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")]),_vm._v(\" \"),(_vm.changedEmail)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.changed_email'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.changeEmailError !== false)?[_c('p',[_vm._v(_vm._s(_vm.$t('settings.change_email_error')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.changeEmailError))])]:_vm._e()],2),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.change_password')))]),_vm._v(\" \"),_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.current_password')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.changePasswordInputs[0]),expression:\"changePasswordInputs[0]\"}],attrs:{\"type\":\"password\"},domProps:{\"value\":(_vm.changePasswordInputs[0])},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.changePasswordInputs, 0, $event.target.value)}}})]),_vm._v(\" \"),_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.new_password')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.changePasswordInputs[1]),expression:\"changePasswordInputs[1]\"}],attrs:{\"type\":\"password\"},domProps:{\"value\":(_vm.changePasswordInputs[1])},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.changePasswordInputs, 1, $event.target.value)}}})]),_vm._v(\" \"),_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.confirm_new_password')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.changePasswordInputs[2]),expression:\"changePasswordInputs[2]\"}],attrs:{\"type\":\"password\"},domProps:{\"value\":(_vm.changePasswordInputs[2])},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.changePasswordInputs, 2, $event.target.value)}}})]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.changePassword}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")]),_vm._v(\" \"),(_vm.changedPassword)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.changed_password'))+\"\\n \")]):(_vm.changePasswordError !== false)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.change_password_error'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.changePasswordError)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.changePasswordError)+\"\\n \")]):_vm._e()]),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.oauth_tokens')))]),_vm._v(\" \"),_c('table',{staticClass:\"oauth-tokens\"},[_c('thead',[_c('tr',[_c('th',[_vm._v(_vm._s(_vm.$t('settings.app_name')))]),_vm._v(\" \"),_c('th',[_vm._v(_vm._s(_vm.$t('settings.valid_until')))]),_vm._v(\" \"),_c('th')])]),_vm._v(\" \"),_c('tbody',_vm._l((_vm.oauthTokens),function(oauthToken){return _c('tr',{key:oauthToken.id},[_c('td',[_vm._v(_vm._s(oauthToken.appName))]),_vm._v(\" \"),_c('td',[_vm._v(_vm._s(oauthToken.validUntil))]),_vm._v(\" \"),_c('td',{staticClass:\"actions\"},[_c('button',{staticClass:\"btn btn-default\",on:{\"click\":function($event){_vm.revokeToken(oauthToken.id)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.revoke_token'))+\"\\n \")])])])}),0)])]),_vm._v(\" \"),_c('mfa'),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.delete_account')))]),_vm._v(\" \"),(!_vm.deletingAccount)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.delete_account_description'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.deletingAccount)?_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('settings.delete_account_instructions')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('login.password')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.deleteAccountConfirmPasswordInput),expression:\"deleteAccountConfirmPasswordInput\"}],attrs:{\"type\":\"password\"},domProps:{\"value\":(_vm.deleteAccountConfirmPasswordInput)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.deleteAccountConfirmPasswordInput=$event.target.value}}}),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.deleteAccount}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.delete_account'))+\"\\n \")])]):_vm._e(),_vm._v(\" \"),(_vm.deleteAccountError !== false)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.delete_account_error'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.deleteAccountError)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.deleteAccountError)+\"\\n \")]):_vm._e(),_vm._v(\" \"),(!_vm.deletingAccount)?_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.confirmDelete}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")]):_vm._e()])],1),_vm._v(\" \"),(_vm.pleromaBackend)?_c('div',{attrs:{\"label\":_vm.$t('settings.notifications')}},[_c('div',{staticClass:\"setting-item\"},[_c('div',{staticClass:\"select-multiple\"},[_c('span',{staticClass:\"label\"},[_vm._v(_vm._s(_vm.$t('settings.notification_setting')))]),_vm._v(\" \"),_c('ul',{staticClass:\"option-list\"},[_c('li',[_c('Checkbox',{model:{value:(_vm.notificationSettings.follows),callback:function ($$v) {_vm.$set(_vm.notificationSettings, \"follows\", $$v)},expression:\"notificationSettings.follows\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.notification_setting_follows'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.notificationSettings.followers),callback:function ($$v) {_vm.$set(_vm.notificationSettings, \"followers\", $$v)},expression:\"notificationSettings.followers\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.notification_setting_followers'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.notificationSettings.non_follows),callback:function ($$v) {_vm.$set(_vm.notificationSettings, \"non_follows\", $$v)},expression:\"notificationSettings.non_follows\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.notification_setting_non_follows'))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('Checkbox',{model:{value:(_vm.notificationSettings.non_followers),callback:function ($$v) {_vm.$set(_vm.notificationSettings, \"non_followers\", $$v)},expression:\"notificationSettings.non_followers\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.notification_setting_non_followers'))+\"\\n \")])],1)])]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.notification_mutes')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.notification_blocks')))]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.updateNotificationSettings}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.submit'))+\"\\n \")])])]):_vm._e(),_vm._v(\" \"),(_vm.pleromaBackend)?_c('div',{attrs:{\"label\":_vm.$t('settings.data_import_export_tab')}},[_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.follow_import')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.import_followers_from_a_csv_file')))]),_vm._v(\" \"),_c('Importer',{attrs:{\"submit-handler\":_vm.importFollows,\"success-message\":_vm.$t('settings.follows_imported'),\"error-message\":_vm.$t('settings.follow_import_error')}})],1),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.follow_export')))]),_vm._v(\" \"),_c('Exporter',{attrs:{\"get-content\":_vm.getFollowsContent,\"filename\":\"friends.csv\",\"export-button-label\":_vm.$t('settings.follow_export_button')}})],1),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.block_import')))]),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('settings.import_blocks_from_a_csv_file')))]),_vm._v(\" \"),_c('Importer',{attrs:{\"submit-handler\":_vm.importBlocks,\"success-message\":_vm.$t('settings.blocks_imported'),\"error-message\":_vm.$t('settings.block_import_error')}})],1),_vm._v(\" \"),_c('div',{staticClass:\"setting-item\"},[_c('h2',[_vm._v(_vm._s(_vm.$t('settings.block_export')))]),_vm._v(\" \"),_c('Exporter',{attrs:{\"get-content\":_vm.getBlocksContent,\"filename\":\"blocks.csv\",\"export-button-label\":_vm.$t('settings.block_export_button')}})],1)]):_vm._e(),_vm._v(\" \"),_c('div',{attrs:{\"label\":_vm.$t('settings.blocks_tab')}},[_c('div',{staticClass:\"profile-edit-usersearch-wrapper\"},[_c('Autosuggest',{attrs:{\"filter\":_vm.filterUnblockedUsers,\"query\":_vm.queryUserIds,\"placeholder\":_vm.$t('settings.search_user_to_block')},scopedSlots:_vm._u([{key:\"default\",fn:function(row){return _c('BlockCard',{attrs:{\"user-id\":row.item}})}}])})],1),_vm._v(\" \"),_c('BlockList',{attrs:{\"refresh\":true,\"get-key\":_vm.identity},scopedSlots:_vm._u([{key:\"header\",fn:function(ref){\nvar selected = ref.selected;\nreturn [_c('div',{staticClass:\"profile-edit-bulk-actions\"},[(selected.length > 0)?_c('ProgressButton',{staticClass:\"btn btn-default\",attrs:{\"click\":function () { return _vm.blockUsers(selected); }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.block'))+\"\\n \"),_c('template',{slot:\"progress\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.block_progress'))+\"\\n \")])],2):_vm._e(),_vm._v(\" \"),(selected.length > 0)?_c('ProgressButton',{staticClass:\"btn btn-default\",attrs:{\"click\":function () { return _vm.unblockUsers(selected); }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unblock'))+\"\\n \"),_c('template',{slot:\"progress\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unblock_progress'))+\"\\n \")])],2):_vm._e()],1)]}},{key:\"item\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('BlockCard',{attrs:{\"user-id\":item}})]}}])},[_c('template',{slot:\"empty\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.no_blocks'))+\"\\n \")])],2)],1),_vm._v(\" \"),_c('div',{attrs:{\"label\":_vm.$t('settings.mutes_tab')}},[_c('div',{staticClass:\"profile-edit-usersearch-wrapper\"},[_c('Autosuggest',{attrs:{\"filter\":_vm.filterUnMutedUsers,\"query\":_vm.queryUserIds,\"placeholder\":_vm.$t('settings.search_user_to_mute')},scopedSlots:_vm._u([{key:\"default\",fn:function(row){return _c('MuteCard',{attrs:{\"user-id\":row.item}})}}])})],1),_vm._v(\" \"),_c('MuteList',{attrs:{\"refresh\":true,\"get-key\":_vm.identity},scopedSlots:_vm._u([{key:\"header\",fn:function(ref){\nvar selected = ref.selected;\nreturn [_c('div',{staticClass:\"profile-edit-bulk-actions\"},[(selected.length > 0)?_c('ProgressButton',{staticClass:\"btn btn-default\",attrs:{\"click\":function () { return _vm.muteUsers(selected); }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.mute'))+\"\\n \"),_c('template',{slot:\"progress\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.mute_progress'))+\"\\n \")])],2):_vm._e(),_vm._v(\" \"),(selected.length > 0)?_c('ProgressButton',{staticClass:\"btn btn-default\",attrs:{\"click\":function () { return _vm.unmuteUsers(selected); }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unmute'))+\"\\n \"),_c('template',{slot:\"progress\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.unmute_progress'))+\"\\n \")])],2):_vm._e()],1)]}},{key:\"item\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('MuteCard',{attrs:{\"user-id\":item}})]}}])},[_c('template',{slot:\"empty\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.no_mutes'))+\"\\n \")])],2)],1)])],1)])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('basic-user-card',{attrs:{\"user\":_vm.user}},[_c('div',{staticClass:\"follow-request-card-content-container\"},[_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.approveUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.approve'))+\"\\n \")]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",on:{\"click\":_vm.denyUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_card.deny'))+\"\\n \")])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"settings panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('nav.friend_requests'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},_vm._l((_vm.requests),function(request){return _c('FollowRequestCard',{key:request.id,staticClass:\"list-item\",attrs:{\"user\":request}})}),1)])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('h1',[_vm._v(\"...\")])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"login panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('login.login'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[_c('form',{staticClass:\"login-form\",on:{\"submit\":function($event){$event.preventDefault();return _vm.submit($event)}}},[(_vm.isPasswordAuth)?[_c('div',{staticClass:\"form-group\"},[_c('label',{attrs:{\"for\":\"username\"}},[_vm._v(_vm._s(_vm.$t('login.username')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.username),expression:\"user.username\"}],staticClass:\"form-control\",attrs:{\"id\":\"username\",\"disabled\":_vm.loggingIn,\"placeholder\":_vm.$t('login.placeholder')},domProps:{\"value\":(_vm.user.username)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"username\", $event.target.value)}}})]),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('label',{attrs:{\"for\":\"password\"}},[_vm._v(_vm._s(_vm.$t('login.password')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.password),expression:\"user.password\"}],ref:\"passwordInput\",staticClass:\"form-control\",attrs:{\"id\":\"password\",\"disabled\":_vm.loggingIn,\"type\":\"password\"},domProps:{\"value\":(_vm.user.password)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"password\", $event.target.value)}}})]),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('router-link',{attrs:{\"to\":{name: 'password-reset'}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('password_reset.forgot_password'))+\"\\n \")])],1)]:_vm._e(),_vm._v(\" \"),(_vm.isTokenAuth)?_c('div',{staticClass:\"form-group\"},[_c('p',[_vm._v(_vm._s(_vm.$t('login.description')))])]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('div',{staticClass:\"login-bottom\"},[_c('div',[(_vm.registrationOpen)?_c('router-link',{staticClass:\"register\",attrs:{\"to\":{name: 'registration'}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('login.register'))+\"\\n \")]):_vm._e()],1),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.loggingIn,\"type\":\"submit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('login.login'))+\"\\n \")])])])],2)]),_vm._v(\" \"),(_vm.error)?_c('div',{staticClass:\"form-group\"},[_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.error)+\"\\n \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":_vm.clearError}})])]):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"login panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('login.heading.recovery'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[_c('form',{staticClass:\"login-form\",on:{\"submit\":function($event){$event.preventDefault();return _vm.submit($event)}}},[_c('div',{staticClass:\"form-group\"},[_c('label',{attrs:{\"for\":\"code\"}},[_vm._v(_vm._s(_vm.$t('login.recovery_code')))]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.code),expression:\"code\"}],staticClass:\"form-control\",attrs:{\"id\":\"code\"},domProps:{\"value\":(_vm.code)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.code=$event.target.value}}})]),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('div',{staticClass:\"login-bottom\"},[_c('div',[_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.requireTOTP($event)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('login.enter_two_factor_code'))+\"\\n \")]),_vm._v(\" \"),_c('br'),_vm._v(\" \"),_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.abortMFA($event)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.cancel'))+\"\\n \")])]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"type\":\"submit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.verify'))+\"\\n \")])])])])]),_vm._v(\" \"),(_vm.error)?_c('div',{staticClass:\"form-group\"},[_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.error)+\"\\n \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":_vm.clearError}})])]):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"login panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('login.heading.totp'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[_c('form',{staticClass:\"login-form\",on:{\"submit\":function($event){$event.preventDefault();return _vm.submit($event)}}},[_c('div',{staticClass:\"form-group\"},[_c('label',{attrs:{\"for\":\"code\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('login.authentication_code'))+\"\\n \")]),_vm._v(\" \"),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.code),expression:\"code\"}],staticClass:\"form-control\",attrs:{\"id\":\"code\"},domProps:{\"value\":(_vm.code)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.code=$event.target.value}}})]),_vm._v(\" \"),_c('div',{staticClass:\"form-group\"},[_c('div',{staticClass:\"login-bottom\"},[_c('div',[_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.requireRecovery($event)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('login.enter_recovery_code'))+\"\\n \")]),_vm._v(\" \"),_c('br'),_vm._v(\" \"),_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.abortMFA($event)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.cancel'))+\"\\n \")])]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-default\",attrs:{\"type\":\"submit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('general.verify'))+\"\\n \")])])])])]),_vm._v(\" \"),(_vm.error)?_c('div',{staticClass:\"form-group\"},[_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.error)+\"\\n \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":_vm.clearError}})])]):_vm._e()])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.collapsed || !_vm.floating)?_c('div',{staticClass:\"chat-panel\"},[_c('div',{staticClass:\"panel panel-default\"},[_c('div',{staticClass:\"panel-heading timeline-heading\",class:{ 'chat-heading': _vm.floating },on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.togglePanel($event)}}},[_c('div',{staticClass:\"title\"},[_c('span',[_vm._v(_vm._s(_vm.$t('chat.title')))]),_vm._v(\" \"),(_vm.floating)?_c('i',{staticClass:\"icon-cancel\"}):_vm._e()])]),_vm._v(\" \"),_c('div',{directives:[{name:\"chat-scroll\",rawName:\"v-chat-scroll\"}],staticClass:\"chat-window\"},_vm._l((_vm.messages),function(message){return _c('div',{key:message.id,staticClass:\"chat-message\"},[_c('span',{staticClass:\"chat-avatar\"},[_c('img',{attrs:{\"src\":message.author.avatar}})]),_vm._v(\" \"),_c('div',{staticClass:\"chat-content\"},[_c('router-link',{staticClass:\"chat-name\",attrs:{\"to\":_vm.userProfileLink(message.author)}},[_vm._v(\"\\n \"+_vm._s(message.author.username)+\"\\n \")]),_vm._v(\" \"),_c('br'),_vm._v(\" \"),_c('span',{staticClass:\"chat-text\"},[_vm._v(\"\\n \"+_vm._s(message.text)+\"\\n \")])],1)])}),0),_vm._v(\" \"),_c('div',{staticClass:\"chat-input\"},[_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.currentMessage),expression:\"currentMessage\"}],staticClass:\"chat-input-textarea\",attrs:{\"rows\":\"1\"},domProps:{\"value\":(_vm.currentMessage)},on:{\"keyup\":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }_vm.submit(_vm.currentMessage)},\"input\":function($event){if($event.target.composing){ return; }_vm.currentMessage=$event.target.value}}})])])]):_c('div',{staticClass:\"chat-panel\"},[_c('div',{staticClass:\"panel panel-default\"},[_c('div',{staticClass:\"panel-heading stub timeline-heading chat-heading\",on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.togglePanel($event)}}},[_c('div',{staticClass:\"title\"},[_c('i',{staticClass:\"icon-comment-empty\"}),_vm._v(\"\\n \"+_vm._s(_vm.$t('chat.title'))+\"\\n \")])])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('who_to_follow.who_to_follow'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},_vm._l((_vm.users),function(user){return _c('FollowCard',{key:user.id,staticClass:\"list-item\",attrs:{\"user\":user}})}),1)])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"instance-specific-panel\"},[_c('div',{staticClass:\"panel panel-default\"},[_c('div',{staticClass:\"panel-body\"},[_c('div',{domProps:{\"innerHTML\":_vm._s(_vm.instanceSpecificPanelContent)}})])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"features-panel\"},[_c('div',{staticClass:\"panel panel-default base01-background\"},[_c('div',{staticClass:\"panel-heading timeline-heading base02-background base04\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('features_panel.title'))+\"\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body features-panel\"},[_c('ul',[(_vm.chat)?_c('li',[_vm._v(\"\\n \"+_vm._s(_vm.$t('features_panel.chat'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.gopher)?_c('li',[_vm._v(\"\\n \"+_vm._s(_vm.$t('features_panel.gopher'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.whoToFollow)?_c('li',[_vm._v(\"\\n \"+_vm._s(_vm.$t('features_panel.who_to_follow'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.mediaProxy)?_c('li',[_vm._v(\"\\n \"+_vm._s(_vm.$t('features_panel.media_proxy'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('li',[_vm._v(_vm._s(_vm.$t('features_panel.scope_options')))]),_vm._v(\" \"),_c('li',[_vm._v(_vm._s(_vm.$t('features_panel.text_limit'))+\" = \"+_vm._s(_vm.textlimit))])])])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"panel panel-default\"},[_c('div',{staticClass:\"panel-body\"},[_c('div',{staticClass:\"tos-content\",domProps:{\"innerHTML\":_vm._s(_vm.content)}})])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"sidebar\"},[_c('instance-specific-panel'),_vm._v(\" \"),(_vm.showFeaturesPanel)?_c('features-panel'):_vm._e(),_vm._v(\" \"),_c('terms-of-service-panel')],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"panel panel-default\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('remote_user_resolver.remote_user_resolver'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('remote_user_resolver.searching_for'))+\" @\"+_vm._s(_vm.$route.params.username)+\"@\"+_vm._s(_vm.$route.params.hostname)+\"\\n \")]),_vm._v(\" \"),(_vm.error)?_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('remote_user_resolver.error'))+\"\\n \")]):_vm._e()])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"user-panel\"},[(_vm.signedIn)?_c('div',{key:\"user-panel\",staticClass:\"panel panel-default signed-in\"},[_c('UserCard',{attrs:{\"user\":_vm.user,\"hide-bio\":true,\"rounded\":\"top\"}}),_vm._v(\" \"),_c('div',{staticClass:\"panel-footer\"},[_c('PostStatusForm')],1)],1):_c('auth-form',{key:\"user-panel\"})],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"nav-panel\"},[_c('div',{staticClass:\"panel panel-default\"},[_c('ul',[(_vm.currentUser)?_c('li',[_c('router-link',{attrs:{\"to\":{ name: 'friends' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.timeline\"))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),(_vm.currentUser)?_c('li',[_c('router-link',{attrs:{\"to\":{ name: 'interactions', params: { username: _vm.currentUser.screen_name } }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.interactions\"))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),(_vm.currentUser)?_c('li',[_c('router-link',{attrs:{\"to\":{ name: 'dms', params: { username: _vm.currentUser.screen_name } }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.dms\"))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),(_vm.currentUser && _vm.currentUser.locked)?_c('li',[_c('router-link',{attrs:{\"to\":{ name: 'friend-requests' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.friend_requests\"))+\"\\n \"),(_vm.followRequestCount > 0)?_c('span',{staticClass:\"badge follow-request-count\"},[_vm._v(\"\\n \"+_vm._s(_vm.followRequestCount)+\"\\n \")]):_vm._e()])],1):_vm._e(),_vm._v(\" \"),_c('li',[_c('router-link',{attrs:{\"to\":{ name: 'public-timeline' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.public_tl\"))+\"\\n \")])],1),_vm._v(\" \"),_c('li',[_c('router-link',{attrs:{\"to\":{ name: 'public-external-timeline' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.twkn\"))+\"\\n \")])],1)])])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"search-bar-container\"},[(_vm.loading)?_c('i',{staticClass:\"icon-spin4 finder-icon animate-spin-slow\"}):_vm._e(),_vm._v(\" \"),(_vm.hidden)?_c('a',{attrs:{\"href\":\"#\",\"title\":_vm.$t('nav.search')}},[_c('i',{staticClass:\"button-icon icon-search\",on:{\"click\":function($event){$event.preventDefault();$event.stopPropagation();return _vm.toggleHidden($event)}}})]):[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.searchTerm),expression:\"searchTerm\"}],ref:\"searchInput\",staticClass:\"search-bar-input\",attrs:{\"id\":\"search-bar-input\",\"placeholder\":_vm.$t('nav.search'),\"type\":\"text\"},domProps:{\"value\":(_vm.searchTerm)},on:{\"keyup\":function($event){if(!('button' in $event)&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }_vm.find(_vm.searchTerm)},\"input\":function($event){if($event.target.composing){ return; }_vm.searchTerm=$event.target.value}}}),_vm._v(\" \"),_c('button',{staticClass:\"btn search-button\",on:{\"click\":function($event){_vm.find(_vm.searchTerm)}}},[_c('i',{staticClass:\"icon-search\"})]),_vm._v(\" \"),_c('i',{staticClass:\"button-icon icon-cancel\",on:{\"click\":function($event){$event.preventDefault();$event.stopPropagation();return _vm.toggleHidden($event)}}})]],2)])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"who-to-follow-panel\"},[_c('div',{staticClass:\"panel panel-default base01-background\"},[_c('div',{staticClass:\"panel-heading timeline-heading base02-background base04\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('who_to_follow.who_to_follow'))+\"\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"who-to-follow\"},[_vm._l((_vm.usersToFollow),function(user){return _c('p',{key:user.id,staticClass:\"who-to-follow-items\"},[_c('img',{attrs:{\"src\":user.img}}),_vm._v(\" \"),_c('router-link',{attrs:{\"to\":_vm.userProfileLink(user.id, user.name)}},[_vm._v(\"\\n \"+_vm._s(user.name)+\"\\n \")]),_c('br')],1)}),_vm._v(\" \"),_c('p',{staticClass:\"who-to-follow-more\"},[_c('router-link',{attrs:{\"to\":{ name: 'who-to-follow' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('who_to_follow.more'))+\"\\n \")])],1)],2)])])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.isOpen),expression:\"isOpen\"},{name:\"body-scroll-lock\",rawName:\"v-body-scroll-lock\",value:(_vm.isOpen),expression:\"isOpen\"}],staticClass:\"modal-view\",on:{\"click\":function($event){if($event.target !== $event.currentTarget){ return null; }_vm.$emit('backdropClicked')}}},[_vm._t(\"default\")],2)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.showing)?_c('Modal',{staticClass:\"media-modal-view\",on:{\"backdropClicked\":_vm.hide}},[(_vm.type === 'image')?_c('img',{staticClass:\"modal-image\",attrs:{\"src\":_vm.currentMedia.url},on:{\"touchstart\":function($event){$event.stopPropagation();return _vm.mediaTouchStart($event)},\"touchmove\":function($event){$event.stopPropagation();return _vm.mediaTouchMove($event)}}}):_vm._e(),_vm._v(\" \"),(_vm.type === 'video')?_c('VideoAttachment',{staticClass:\"modal-image\",attrs:{\"attachment\":_vm.currentMedia,\"controls\":true},nativeOn:{\"click\":function($event){$event.stopPropagation();}}}):_vm._e(),_vm._v(\" \"),(_vm.canNavigate)?_c('button',{staticClass:\"modal-view-button-arrow modal-view-button-arrow--prev\",attrs:{\"title\":_vm.$t('media_modal.previous')},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.goPrev($event)}}},[_c('i',{staticClass:\"icon-left-open arrow-icon\"})]):_vm._e(),_vm._v(\" \"),(_vm.canNavigate)?_c('button',{staticClass:\"modal-view-button-arrow modal-view-button-arrow--next\",attrs:{\"title\":_vm.$t('media_modal.next')},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.goNext($event)}}},[_c('i',{staticClass:\"icon-right-open arrow-icon\"})]):_vm._e()],1):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"side-drawer-container\",class:{ 'side-drawer-container-closed': _vm.closed, 'side-drawer-container-open': !_vm.closed }},[_c('div',{staticClass:\"side-drawer-darken\",class:{ 'side-drawer-darken-closed': _vm.closed}}),_vm._v(\" \"),_c('div',{staticClass:\"side-drawer\",class:{'side-drawer-closed': _vm.closed},on:{\"touchstart\":_vm.touchStart,\"touchmove\":_vm.touchMove}},[_c('div',{staticClass:\"side-drawer-heading\",on:{\"click\":_vm.toggleDrawer}},[(_vm.currentUser)?_c('UserCard',{attrs:{\"user\":_vm.currentUser,\"hide-bio\":true}}):_c('div',{staticClass:\"side-drawer-logo-wrapper\"},[_c('img',{attrs:{\"src\":_vm.logo}}),_vm._v(\" \"),_c('span',[_vm._v(_vm._s(_vm.sitename))])])],1),_vm._v(\" \"),_c('ul',[(!_vm.currentUser)?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'login' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"login.login\"))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),(_vm.currentUser)?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'dms', params: { username: _vm.currentUser.screen_name } }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.dms\"))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),(_vm.currentUser)?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'interactions', params: { username: _vm.currentUser.screen_name } }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.interactions\"))+\"\\n \")])],1):_vm._e()]),_vm._v(\" \"),_c('ul',[(_vm.currentUser)?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'friends' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.timeline\"))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),(_vm.currentUser && _vm.currentUser.locked)?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":\"/friend-requests\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.friend_requests\"))+\"\\n \"),(_vm.followRequestCount > 0)?_c('span',{staticClass:\"badge follow-request-count\"},[_vm._v(\"\\n \"+_vm._s(_vm.followRequestCount)+\"\\n \")]):_vm._e()])],1):_vm._e(),_vm._v(\" \"),_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":\"/main/public\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.public_tl\"))+\"\\n \")])],1),_vm._v(\" \"),_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":\"/main/all\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.twkn\"))+\"\\n \")])],1),_vm._v(\" \"),(_vm.currentUser && _vm.chat)?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'chat' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.chat\"))+\"\\n \")])],1):_vm._e()]),_vm._v(\" \"),_c('ul',[_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'search' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.search\"))+\"\\n \")])],1),_vm._v(\" \"),(_vm.currentUser && _vm.suggestionsEnabled)?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'who-to-follow' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.who_to_follow\"))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'settings' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"settings.settings\"))+\"\\n \")])],1),_vm._v(\" \"),_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('router-link',{attrs:{\"to\":{ name: 'about'}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.about\"))+\"\\n \")])],1),_vm._v(\" \"),(_vm.currentUser && _vm.currentUser.role === 'admin')?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('a',{attrs:{\"href\":\"/pleroma/admin/#/login-pleroma\",\"target\":\"_blank\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"nav.administration\"))+\"\\n \")])]):_vm._e(),_vm._v(\" \"),(_vm.currentUser)?_c('li',{on:{\"click\":_vm.toggleDrawer}},[_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":_vm.doLogout}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"login.logout\"))+\"\\n \")])]):_vm._e()])]),_vm._v(\" \"),_c('div',{staticClass:\"side-drawer-click-outside\",class:{'side-drawer-click-outside-closed': _vm.closed},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();return _vm.toggleDrawer($event)}}})])}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isLoggedIn)?_c('div',[_c('button',{staticClass:\"new-status-button\",class:{ 'hidden': _vm.isHidden },on:{\"click\":_vm.openPostForm}},[_c('i',{staticClass:\"icon-edit\"})])]):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('nav',{staticClass:\"nav-bar container\",attrs:{\"id\":\"nav\"}},[_c('div',{staticClass:\"mobile-inner-nav\",on:{\"click\":function($event){_vm.scrollToTop()}}},[_c('div',{staticClass:\"item\"},[_c('a',{staticClass:\"mobile-nav-button\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();_vm.toggleMobileSidebar()}}},[_c('i',{staticClass:\"button-icon icon-menu\"})]),_vm._v(\" \"),_c('router-link',{staticClass:\"site-name\",attrs:{\"to\":{ name: 'root' },\"active-class\":\"home\"}},[_vm._v(\"\\n \"+_vm._s(_vm.sitename)+\"\\n \")])],1),_vm._v(\" \"),_c('div',{staticClass:\"item right\"},[(_vm.currentUser)?_c('a',{staticClass:\"mobile-nav-button\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();_vm.openMobileNotifications()}}},[_c('i',{staticClass:\"button-icon icon-bell-alt\"}),_vm._v(\" \"),(_vm.unseenNotificationsCount)?_c('div',{staticClass:\"alert-dot\"}):_vm._e()]):_vm._e()])])]),_vm._v(\" \"),(_vm.currentUser)?_c('div',{staticClass:\"mobile-notifications-drawer\",class:{ 'closed': !_vm.notificationsOpen },on:{\"touchstart\":function($event){$event.stopPropagation();return _vm.notificationsTouchStart($event)},\"touchmove\":function($event){$event.stopPropagation();return _vm.notificationsTouchMove($event)}}},[_c('div',{staticClass:\"mobile-notifications-header\"},[_c('span',{staticClass:\"title\"},[_vm._v(_vm._s(_vm.$t('notifications.notifications')))]),_vm._v(\" \"),_c('a',{staticClass:\"mobile-nav-button\",on:{\"click\":function($event){$event.stopPropagation();$event.preventDefault();_vm.closeMobileNotifications()}}},[_c('i',{staticClass:\"button-icon icon-cancel\"})])]),_vm._v(\" \"),_c('div',{staticClass:\"mobile-notifications\",on:{\"scroll\":_vm.onScroll}},[_c('Notifications',{ref:\"notifications\",attrs:{\"no-heading\":true}})],1)]):_vm._e(),_vm._v(\" \"),_c('SideDrawer',{ref:\"sideDrawer\",attrs:{\"logout\":_vm.logout}})],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isOpen)?_c('Modal',{on:{\"backdropClicked\":_vm.closeModal}},[_c('div',{staticClass:\"user-reporting-panel panel\"},[_c('div',{staticClass:\"panel-heading\"},[_c('div',{staticClass:\"title\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_reporting.title', [_vm.user.screen_name]))+\"\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"panel-body\"},[_c('div',{staticClass:\"user-reporting-panel-left\"},[_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('user_reporting.add_comment_description')))]),_vm._v(\" \"),_c('textarea',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.comment),expression:\"comment\"}],staticClass:\"form-control\",attrs:{\"placeholder\":_vm.$t('user_reporting.additional_comments'),\"rows\":\"1\"},domProps:{\"value\":(_vm.comment)},on:{\"input\":[function($event){if($event.target.composing){ return; }_vm.comment=$event.target.value},_vm.resize]}})]),_vm._v(\" \"),(!_vm.user.is_local)?_c('div',[_c('p',[_vm._v(_vm._s(_vm.$t('user_reporting.forward_description')))]),_vm._v(\" \"),_c('Checkbox',{model:{value:(_vm.forward),callback:function ($$v) {_vm.forward=$$v},expression:\"forward\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_reporting.forward_to', [_vm.remoteInstance]))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),_c('div',[_c('button',{staticClass:\"btn btn-default\",attrs:{\"disabled\":_vm.processing},on:{\"click\":_vm.reportUser}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_reporting.submit'))+\"\\n \")]),_vm._v(\" \"),(_vm.error)?_c('div',{staticClass:\"alert error\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('user_reporting.generic_error'))+\"\\n \")]):_vm._e()])]),_vm._v(\" \"),_c('div',{staticClass:\"user-reporting-panel-right\"},[_c('List',{attrs:{\"items\":_vm.statuses},scopedSlots:_vm._u([{key:\"item\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('div',{staticClass:\"status-fadein user-reporting-panel-sitem\"},[_c('Status',{attrs:{\"in-conversation\":false,\"focused\":false,\"statusoid\":item}}),_vm._v(\" \"),_c('Checkbox',{attrs:{\"checked\":_vm.isChecked(item.id)},on:{\"change\":function (checked) { return _vm.toggleStatus(checked, item.id); }}})],1)]}}])})],1)])])]):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isLoggedIn && !_vm.resettingForm)?_c('Modal',{staticClass:\"post-form-modal-view\",attrs:{\"is-open\":_vm.modalActivated},on:{\"backdropClicked\":_vm.closeModal}},[_c('div',{staticClass:\"post-form-modal-panel panel\"},[_c('div',{staticClass:\"panel-heading\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('post_status.new_status'))+\"\\n \")]),_vm._v(\" \"),_c('PostStatusForm',_vm._b({staticClass:\"panel-body\",on:{\"posted\":_vm.closeModal}},'PostStatusForm',_vm.params,false))],1)]):_vm._e()}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{style:(_vm.bgAppStyle),attrs:{\"id\":\"app\"}},[_c('div',{staticClass:\"app-bg-wrapper\",style:(_vm.bgStyle),attrs:{\"id\":\"app_bg_wrapper\"}}),_vm._v(\" \"),(_vm.isMobileLayout)?_c('MobileNav'):_c('nav',{staticClass:\"nav-bar container\",attrs:{\"id\":\"nav\"},on:{\"click\":function($event){_vm.scrollToTop()}}},[_c('div',{staticClass:\"inner-nav\"},[_c('div',{staticClass:\"logo\",style:(_vm.logoBgStyle)},[_c('div',{staticClass:\"mask\",style:(_vm.logoMaskStyle)}),_vm._v(\" \"),_c('img',{style:(_vm.logoStyle),attrs:{\"src\":_vm.logo}})]),_vm._v(\" \"),_c('div',{staticClass:\"item\"},[_c('router-link',{staticClass:\"site-name\",attrs:{\"to\":{ name: 'root' },\"active-class\":\"home\"}},[_vm._v(\"\\n \"+_vm._s(_vm.sitename)+\"\\n \")])],1),_vm._v(\" \"),_c('div',{staticClass:\"item right\"},[_c('search-bar',{staticClass:\"nav-icon mobile-hidden\",on:{\"toggled\":_vm.onSearchBarToggled},nativeOn:{\"click\":function($event){$event.stopPropagation();}}}),_vm._v(\" \"),_c('router-link',{staticClass:\"mobile-hidden\",attrs:{\"to\":{ name: 'settings'}}},[_c('i',{staticClass:\"button-icon icon-cog nav-icon\",attrs:{\"title\":_vm.$t('nav.preferences')}})]),_vm._v(\" \"),(_vm.currentUser && _vm.currentUser.role === 'admin')?_c('a',{staticClass:\"mobile-hidden\",attrs:{\"href\":\"/pleroma/admin/#/login-pleroma\",\"target\":\"_blank\"}},[_c('i',{staticClass:\"button-icon icon-gauge nav-icon\",attrs:{\"title\":_vm.$t('nav.administration')}})]):_vm._e(),_vm._v(\" \"),(_vm.currentUser)?_c('a',{staticClass:\"mobile-hidden\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.logout($event)}}},[_c('i',{staticClass:\"button-icon icon-logout nav-icon\",attrs:{\"title\":_vm.$t('login.logout')}})]):_vm._e()],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"container\",attrs:{\"id\":\"content\"}},[_c('div',{staticClass:\"sidebar-flexer mobile-hidden\"},[_c('div',{staticClass:\"sidebar-bounds\"},[_c('div',{staticClass:\"sidebar-scroller\"},[_c('div',{staticClass:\"sidebar\"},[_c('user-panel'),_vm._v(\" \"),(!_vm.isMobileLayout)?_c('div',[_c('nav-panel'),_vm._v(\" \"),(_vm.showInstanceSpecificPanel)?_c('instance-specific-panel'):_vm._e(),_vm._v(\" \"),(!_vm.currentUser && _vm.showFeaturesPanel)?_c('features-panel'):_vm._e(),_vm._v(\" \"),(_vm.currentUser && _vm.suggestionsEnabled)?_c('who-to-follow-panel'):_vm._e(),_vm._v(\" \"),(_vm.currentUser)?_c('notifications'):_vm._e()],1):_vm._e()],1)])])]),_vm._v(\" \"),_c('div',{staticClass:\"main\"},[(!_vm.currentUser)?_c('div',{staticClass:\"login-hint panel panel-default\"},[_c('router-link',{staticClass:\"panel-body\",attrs:{\"to\":{ name: 'login' }}},[_vm._v(\"\\n \"+_vm._s(_vm.$t(\"login.hint\"))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),_c('transition',{attrs:{\"name\":\"fade\"}},[_c('router-view')],1)],1),_vm._v(\" \"),_c('media-modal')],1),_vm._v(\" \"),(_vm.currentUser && _vm.chat)?_c('chat-panel',{staticClass:\"floating-chat mobile-hidden\",attrs:{\"floating\":true}}):_vm._e(),_vm._v(\" \"),_c('MobilePostStatusButton'),_vm._v(\" \"),_c('UserReportingModal'),_vm._v(\" \"),_c('PostStatusModal'),_vm._v(\" \"),_c('portal-target',{attrs:{\"name\":\"modal\"}})],1)}\nvar staticRenderFns = []\nexport { render, staticRenderFns }","import { map } from 'lodash'\nimport apiService from '../api/api.service.js'\n\nconst postStatus = ({ store, status, spoilerText, visibility, sensitive, poll, media = [], inReplyToStatusId = undefined, contentType = 'text/plain' }) => {\n const mediaIds = map(media, 'id')\n\n return apiService.postStatus({\n credentials: store.state.users.currentUser.credentials,\n status,\n spoilerText,\n visibility,\n sensitive,\n mediaIds,\n inReplyToStatusId,\n contentType,\n poll })\n .then((data) => {\n if (!data.error) {\n store.dispatch('addNewStatuses', {\n statuses: [data],\n timeline: 'friends',\n showImmediately: true,\n noIdUpdate: true // To prevent missing notices on next pull.\n })\n }\n return data\n })\n .catch((err) => {\n return {\n error: err.message\n }\n })\n}\n\nconst uploadMedia = ({ store, formData }) => {\n const credentials = store.state.users.currentUser.credentials\n\n return apiService.uploadMedia({ credentials, formData })\n}\n\nconst statusPosterService = {\n postStatus,\n uploadMedia\n}\n\nexport default statusPosterService\n","import { camelCase } from 'lodash'\n\nimport apiService from '../api/api.service.js'\n\nconst update = ({ store, statuses, timeline, showImmediately, userId }) => {\n const ccTimeline = camelCase(timeline)\n\n store.dispatch('setError', { value: false })\n\n store.dispatch('addNewStatuses', {\n timeline: ccTimeline,\n userId,\n statuses,\n showImmediately\n })\n}\n\nconst fetchAndUpdate = ({\n store,\n credentials,\n timeline = 'friends',\n older = false,\n showImmediately = false,\n userId = false,\n tag = false,\n until\n}) => {\n const args = { timeline, credentials }\n const rootState = store.rootState || store.state\n const { getters } = store\n const timelineData = rootState.statuses.timelines[camelCase(timeline)]\n const hideMutedPosts = getters.mergedConfig.hideMutedPosts\n\n if (older) {\n args['until'] = until || timelineData.minId\n } else {\n args['since'] = timelineData.maxId\n }\n\n args['userId'] = userId\n args['tag'] = tag\n args['withMuted'] = !hideMutedPosts\n\n const numStatusesBeforeFetch = timelineData.statuses.length\n\n return apiService.fetchTimeline(args)\n .then((statuses) => {\n if (!older && statuses.length >= 20 && !timelineData.loading && numStatusesBeforeFetch > 0) {\n store.dispatch('queueFlush', { timeline: timeline, id: timelineData.maxId })\n }\n update({ store, statuses, timeline, showImmediately, userId })\n return statuses\n }, () => store.dispatch('setError', { value: true }))\n}\n\nconst startFetching = ({ timeline = 'friends', credentials, store, userId = false, tag = false }) => {\n const rootState = store.rootState || store.state\n const timelineData = rootState.statuses.timelines[camelCase(timeline)]\n const showImmediately = timelineData.visibleStatuses.length === 0\n timelineData.userId = userId\n fetchAndUpdate({ timeline, credentials, store, showImmediately, userId, tag })\n const boundFetchAndUpdate = () => fetchAndUpdate({ timeline, credentials, store, userId, tag })\n return setInterval(boundFetchAndUpdate, 10000)\n}\nconst timelineFetcher = {\n fetchAndUpdate,\n startFetching\n}\n\nexport default timelineFetcher\n","import apiService from '../api/api.service.js'\n\nconst update = ({ store, notifications, older }) => {\n store.dispatch('setNotificationsError', { value: false })\n\n store.dispatch('addNewNotifications', { notifications, older })\n}\n\nconst fetchAndUpdate = ({ store, credentials, older = false }) => {\n const args = { credentials }\n const { getters } = store\n const rootState = store.rootState || store.state\n const timelineData = rootState.statuses.notifications\n const hideMutedPosts = getters.mergedConfig.hideMutedPosts\n\n args['withMuted'] = !hideMutedPosts\n\n args['timeline'] = 'notifications'\n if (older) {\n if (timelineData.minId !== Number.POSITIVE_INFINITY) {\n args['until'] = timelineData.minId\n }\n return fetchNotifications({ store, args, older })\n } else {\n // fetch new notifications\n if (timelineData.maxId !== Number.POSITIVE_INFINITY) {\n args['since'] = timelineData.maxId\n }\n const result = fetchNotifications({ store, args, older })\n\n // load unread notifications repeatedly to provide consistency between browser tabs\n const notifications = timelineData.data\n const unread = notifications.filter(n => !n.seen).map(n => n.id)\n if (unread.length) {\n args['since'] = Math.min(...unread)\n fetchNotifications({ store, args, older })\n }\n\n return result\n }\n}\n\nconst fetchNotifications = ({ store, args, older }) => {\n return apiService.fetchTimeline(args)\n .then((notifications) => {\n update({ store, notifications, older })\n return notifications\n }, () => store.dispatch('setNotificationsError', { value: true }))\n .catch(() => store.dispatch('setNotificationsError', { value: true }))\n}\n\nconst startFetching = ({ credentials, store }) => {\n fetchAndUpdate({ credentials, store })\n const boundFetchAndUpdate = () => fetchAndUpdate({ credentials, store })\n // Initially there's set flag to silence all desktop notifications so\n // that there won't spam of them when user just opened up the FE we\n // reset that flag after a while to show new notifications once again.\n setTimeout(() => store.dispatch('setNotificationsSilence', false), 10000)\n return setInterval(boundFetchAndUpdate, 10000)\n}\n\nconst notificationsFetcher = {\n fetchAndUpdate,\n startFetching\n}\n\nexport default notificationsFetcher\n","// When contributing, please sort JSON before committing so it would be easier to see what's missing and what's being added compared to English and other languages. It's not obligatory, but just an advice.\n// To sort json use jq https://stedolan.github.io/jq and invoke it like `jq -S . xx.json > xx.sorted.json`, AFAIK, there's no inplace edit option like in sed\n// Also, when adding a new language to \"messages\" variable, please do it alphabetically by language code so that users can search or check their custom language easily.\n\n// For anyone contributing to old huge messages.js and in need to quickly convert it to JSON\n// sed command for converting currently formatted JS to JSON:\n// sed -i -e \"s/'//gm\" -e 's/\"/\\\\\"/gm' -re 's/^( +)(.+?): ((.+?))?(,?)(\\{?)$/\\1\"\\2\": \"\\4\"/gm' -e 's/\\\"\\{\\\"/{/g' -e 's/,\"$/\",/g' file.json\n// There's only problem that apostrophe character ' gets replaced by \\\\ so you have to fix it manually, sorry.\n\nconst messages = {\n ar: require('./ar.json'),\n ca: require('./ca.json'),\n cs: require('./cs.json'),\n de: require('./de.json'),\n en: require('./en.json'),\n eo: require('./eo.json'),\n es: require('./es.json'),\n et: require('./et.json'),\n eu: require('./eu.json'),\n fi: require('./fi.json'),\n fr: require('./fr.json'),\n ga: require('./ga.json'),\n he: require('./he.json'),\n hu: require('./hu.json'),\n it: require('./it.json'),\n ja: require('./ja.json'),\n ja_pedantic: require('./ja_pedantic.json'),\n ko: require('./ko.json'),\n nb: require('./nb.json'),\n nl: require('./nl.json'),\n oc: require('./oc.json'),\n pl: require('./pl.json'),\n pt: require('./pt.json'),\n ro: require('./ro.json'),\n ru: require('./ru.json'),\n te: require('./te.json'),\n zh: require('./zh.json')\n}\n\nexport default messages\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./attachment.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./attachment.js\"\nimport __vue_script__ from \"!!babel-loader!./attachment.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-47ab0ca0\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./attachment.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* script */\nexport * from \"!!babel-loader!./video_attachment.js\"\nimport __vue_script__ from \"!!babel-loader!./video_attachment.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6fce6a82\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./video_attachment.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","export const SECOND = 1000\nexport const MINUTE = 60 * SECOND\nexport const HOUR = 60 * MINUTE\nexport const DAY = 24 * HOUR\nexport const WEEK = 7 * DAY\nexport const MONTH = 30 * DAY\nexport const YEAR = 365.25 * DAY\n\nexport const relativeTime = (date, nowThreshold = 1) => {\n if (typeof date === 'string') date = Date.parse(date)\n const round = Date.now() > date ? Math.floor : Math.ceil\n const d = Math.abs(Date.now() - date)\n let r = { num: round(d / YEAR), key: 'time.years' }\n if (d < nowThreshold * SECOND) {\n r.num = 0\n r.key = 'time.now'\n } else if (d < MINUTE) {\n r.num = round(d / SECOND)\n r.key = 'time.seconds'\n } else if (d < HOUR) {\n r.num = round(d / MINUTE)\n r.key = 'time.minutes'\n } else if (d < DAY) {\n r.num = round(d / HOUR)\n r.key = 'time.hours'\n } else if (d < WEEK) {\n r.num = round(d / DAY)\n r.key = 'time.days'\n } else if (d < MONTH) {\n r.num = round(d / WEEK)\n r.key = 'time.weeks'\n } else if (d < YEAR) {\n r.num = round(d / MONTH)\n r.key = 'time.months'\n }\n // Remove plural form when singular\n if (r.num === 1) r.key = r.key.slice(0, -1)\n return r\n}\n\nexport const relativeTimeShort = (date, nowThreshold = 1) => {\n const r = relativeTime(date, nowThreshold)\n r.key += '_short'\n return r\n}\n","const fileSizeFormat = (num) => {\n var exponent\n var unit\n var units = ['B', 'KiB', 'MiB', 'GiB', 'TiB']\n if (num < 1) {\n return num + ' ' + units[0]\n }\n\n exponent = Math.min(Math.floor(Math.log(num) / Math.log(1024)), units.length - 1)\n num = (num / Math.pow(1024, exponent)).toFixed(2) * 1\n unit = units[exponent]\n return { num: num, unit: unit }\n}\nconst fileSizeFormatService = {\n fileSizeFormat\n}\nexport default fileSizeFormatService\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./scope_selector.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./scope_selector.js\"\nimport __vue_script__ from \"!!babel-loader!./scope_selector.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-28e8cbf1\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./scope_selector.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./emoji_input.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./emoji_input.js\"\nimport __vue_script__ from \"!!babel-loader!./emoji_input.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-a4078164\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./emoji_input.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","export const findOffset = (child, parent, { top = 0, left = 0 } = {}, ignorePadding = true) => {\n const result = {\n top: top + child.offsetTop,\n left: left + child.offsetLeft\n }\n if (!ignorePadding && child !== window) {\n const { topPadding, leftPadding } = findPadding(child)\n result.top += ignorePadding ? 0 : topPadding\n result.left += ignorePadding ? 0 : leftPadding\n }\n\n if (child.offsetParent && (parent === window || parent.contains(child.offsetParent) || parent === child.offsetParent)) {\n return findOffset(child.offsetParent, parent, result, false)\n } else {\n if (parent !== window) {\n const { topPadding, leftPadding } = findPadding(parent)\n result.top += topPadding\n result.left += leftPadding\n }\n return result\n }\n}\n\nconst findPadding = (el) => {\n const topPaddingStr = window.getComputedStyle(el)['padding-top']\n const topPadding = Number(topPaddingStr.substring(0, topPaddingStr.length - 2))\n const leftPaddingStr = window.getComputedStyle(el)['padding-left']\n const leftPadding = Number(leftPaddingStr.substring(0, leftPaddingStr.length - 2))\n\n return { topPadding, leftPadding }\n}\n","import { debounce } from 'lodash'\n/**\n * suggest - generates a suggestor function to be used by emoji-input\n * data: object providing source information for specific types of suggestions:\n * data.emoji - optional, an array of all emoji available i.e.\n * (state.instance.emoji + state.instance.customEmoji)\n * data.users - optional, an array of all known users\n * updateUsersList - optional, a function to search and append to users\n *\n * Depending on data present one or both (or none) can be present, so if field\n * doesn't support user linking you can just provide only emoji.\n */\n\nconst debounceUserSearch = debounce((data, input) => {\n data.updateUsersList(input)\n}, 500, { leading: true, trailing: false })\n\nexport default data => input => {\n const firstChar = input[0]\n if (firstChar === ':' && data.emoji) {\n return suggestEmoji(data.emoji)(input)\n }\n if (firstChar === '@' && data.users) {\n return suggestUsers(data)(input)\n }\n return []\n}\n\nexport const suggestEmoji = emojis => input => {\n const noPrefix = input.toLowerCase().substr(1)\n return emojis\n .filter(({ displayText }) => displayText.toLowerCase().startsWith(noPrefix))\n .sort((a, b) => {\n let aScore = 0\n let bScore = 0\n\n // Make custom emojis a priority\n aScore += a.imageUrl ? 10 : 0\n bScore += b.imageUrl ? 10 : 0\n\n // Sort alphabetically\n const alphabetically = a.displayText > b.displayText ? 1 : -1\n\n return bScore - aScore + alphabetically\n })\n}\n\nexport const suggestUsers = data => input => {\n const noPrefix = input.toLowerCase().substr(1)\n const users = data.users\n\n const newUsers = users.filter(\n user =>\n user.screen_name.toLowerCase().startsWith(noPrefix) ||\n user.name.toLowerCase().startsWith(noPrefix)\n\n /* taking only 20 results so that sorting is a bit cheaper, we display\n * only 5 anyway. could be inaccurate, but we ideally we should query\n * backend anyway\n */\n ).slice(0, 20).sort((a, b) => {\n let aScore = 0\n let bScore = 0\n\n // Matches on screen name (i.e. user@instance) makes a priority\n aScore += a.screen_name.toLowerCase().startsWith(noPrefix) ? 2 : 0\n bScore += b.screen_name.toLowerCase().startsWith(noPrefix) ? 2 : 0\n\n // Matches on name takes second priority\n aScore += a.name.toLowerCase().startsWith(noPrefix) ? 1 : 0\n bScore += b.name.toLowerCase().startsWith(noPrefix) ? 1 : 0\n\n const diff = (bScore - aScore) * 10\n\n // Then sort alphabetically\n const nameAlphabetically = a.name > b.name ? 1 : -1\n const screenNameAlphabetically = a.screen_name > b.screen_name ? 1 : -1\n\n return diff + nameAlphabetically + screenNameAlphabetically\n /* eslint-disable camelcase */\n }).map(({ screen_name, name, profile_image_url_original }) => ({\n displayText: screen_name,\n detailText: name,\n imageUrl: profile_image_url_original,\n replacement: '@' + screen_name + ' '\n }))\n\n // BE search users if there are no matches\n if (newUsers.length === 0 && data.updateUsersList) {\n debounceUserSearch(data, noPrefix)\n }\n return newUsers\n /* eslint-enable camelcase */\n}\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./remote_follow.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./remote_follow.js\"\nimport __vue_script__ from \"!!babel-loader!./remote_follow.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-e95e446e\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./remote_follow.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* script */\nexport * from \"!!babel-loader!./follow_button.js\"\nimport __vue_script__ from \"!!babel-loader!./follow_button.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-3ddddf8d\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./follow_button.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","import { hex2rgb } from '../color_convert/color_convert.js'\nconst highlightStyle = (prefs) => {\n if (prefs === undefined) return\n const { color, type } = prefs\n if (typeof color !== 'string') return\n const rgb = hex2rgb(color)\n if (rgb == null) return\n const solidColor = `rgb(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)})`\n const tintColor = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .1)`\n const tintColor2 = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .2)`\n if (type === 'striped') {\n return {\n backgroundImage: [\n 'repeating-linear-gradient(135deg,',\n `${tintColor} ,`,\n `${tintColor} 20px,`,\n `${tintColor2} 20px,`,\n `${tintColor2} 40px`\n ].join(' '),\n backgroundPosition: '0 0'\n }\n } else if (type === 'solid') {\n return {\n backgroundColor: tintColor2\n }\n } else if (type === 'side') {\n return {\n backgroundImage: [\n 'linear-gradient(to right,',\n `${solidColor} ,`,\n `${solidColor} 2px,`,\n `transparent 6px`\n ].join(' '),\n backgroundPosition: '0 0'\n }\n }\n}\n\nconst highlightClass = (user) => {\n return 'USER____' + user.screen_name\n .replace(/\\./g, '_')\n .replace(/@/g, '_AT_')\n}\n\nexport {\n highlightClass,\n highlightStyle\n}\n","import isFunction from 'lodash/isFunction'\n\nconst getComponentOptions = (Component) => (isFunction(Component)) ? Component.options : Component\n\nconst getComponentProps = (Component) => getComponentOptions(Component).props\n\nexport {\n getComponentOptions,\n getComponentProps\n}\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!./style_switcher.scss\")\n}\n/* script */\nexport * from \"!!babel-loader!./style_switcher.js\"\nimport __vue_script__ from \"!!babel-loader!./style_switcher.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-1bd287ab\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./style_switcher.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./color_input.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./color_input.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./color_input.vue\"\n/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-a377bb38\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./color_input.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* script */\nexport * from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./opacity_input.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../node_modules/vue-loader/lib/selector?type=script&index=0!./opacity_input.vue\"\n/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-87056ae2\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./opacity_input.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* script */\nexport * from \"!!babel-loader!./confirm.js\"\nimport __vue_script__ from \"!!babel-loader!./confirm.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-20b6e7b3\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./confirm.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","import LoginForm from '../login_form/login_form.vue'\nimport MFARecoveryForm from '../mfa_form/recovery_form.vue'\nimport MFATOTPForm from '../mfa_form/totp_form.vue'\nimport { mapGetters } from 'vuex'\n\nconst AuthForm = {\n name: 'AuthForm',\n render (createElement) {\n return createElement('component', { is: this.authForm })\n },\n computed: {\n authForm () {\n if (this.requiredTOTP) { return 'MFATOTPForm' }\n if (this.requiredRecovery) { return 'MFARecoveryForm' }\n return 'LoginForm'\n },\n ...mapGetters('authFlow', ['requiredTOTP', 'requiredRecovery'])\n },\n components: {\n MFARecoveryForm,\n MFATOTPForm,\n LoginForm\n }\n}\n\nexport default AuthForm\n","const verifyOTPCode = ({ app, instance, mfaToken, code }) => {\n const url = `${instance}/oauth/mfa/challenge`\n const form = new window.FormData()\n\n form.append('client_id', app.client_id)\n form.append('client_secret', app.client_secret)\n form.append('mfa_token', mfaToken)\n form.append('code', code)\n form.append('challenge_type', 'totp')\n\n return window.fetch(url, {\n method: 'POST',\n body: form\n }).then((data) => data.json())\n}\n\nconst verifyRecoveryCode = ({ app, instance, mfaToken, code }) => {\n const url = `${instance}/oauth/mfa/challenge`\n const form = new window.FormData()\n\n form.append('client_id', app.client_id)\n form.append('client_secret', app.client_secret)\n form.append('mfa_token', mfaToken)\n form.append('code', code)\n form.append('challenge_type', 'recovery')\n\n return window.fetch(url, {\n method: 'POST',\n body: form\n }).then((data) => data.json())\n}\n\nconst mfa = {\n verifyOTPCode,\n verifyRecoveryCode\n}\n\nexport default mfa\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./chat_panel.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./chat_panel.js\"\nimport __vue_script__ from \"!!babel-loader!./chat_panel.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-7ea51572\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./chat_panel.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","/* script */\nexport * from \"!!babel-loader!./instance_specific_panel.js\"\nimport __vue_script__ from \"!!babel-loader!./instance_specific_panel.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5b01187b\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./instance_specific_panel.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./features_panel.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./features_panel.js\"\nimport __vue_script__ from \"!!babel-loader!./features_panel.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-3443e05c\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./features_panel.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"scoped\\\":false,\\\"sourceMap\\\":false}!sass-loader!../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./side_drawer.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!./side_drawer.js\"\nimport __vue_script__ from \"!!babel-loader!./side_drawer.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5c94965a\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./side_drawer.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","\nexport const windowWidth = () =>\n window.innerWidth ||\n document.documentElement.clientWidth ||\n document.body.clientWidth\n","import Vue from 'vue'\nimport VueRouter from 'vue-router'\nimport Vuex from 'vuex'\n\nimport interfaceModule from './modules/interface.js'\nimport instanceModule from './modules/instance.js'\nimport statusesModule from './modules/statuses.js'\nimport usersModule from './modules/users.js'\nimport apiModule from './modules/api.js'\nimport configModule from './modules/config.js'\nimport chatModule from './modules/chat.js'\nimport oauthModule from './modules/oauth.js'\nimport authFlowModule from './modules/auth_flow.js'\nimport mediaViewerModule from './modules/media_viewer.js'\nimport oauthTokensModule from './modules/oauth_tokens.js'\nimport reportsModule from './modules/reports.js'\nimport pollsModule from './modules/polls.js'\nimport postStatusModule from './modules/postStatus.js'\n\nimport VueI18n from 'vue-i18n'\n\nimport createPersistedState from './lib/persisted_state.js'\nimport pushNotifications from './lib/push_notifications_plugin.js'\n\nimport messages from './i18n/messages.js'\n\nimport VueChatScroll from 'vue-chat-scroll'\nimport VueClickOutside from 'v-click-outside'\nimport PortalVue from 'portal-vue'\nimport VBodyScrollLock from './directives/body_scroll_lock'\nimport VTooltip from 'v-tooltip'\n\nimport afterStoreSetup from './boot/after_store.js'\n\nconst currentLocale = (window.navigator.language || 'en').split('-')[0]\n\nVue.use(Vuex)\nVue.use(VueRouter)\nVue.use(VueI18n)\nVue.use(VueChatScroll)\nVue.use(VueClickOutside)\nVue.use(PortalVue)\nVue.use(VBodyScrollLock)\nVue.use(VTooltip, {\n popover: {\n defaultTrigger: 'hover click',\n defaultContainer: false,\n defaultOffset: 5\n }\n})\n\nconst i18n = new VueI18n({\n // By default, use the browser locale, we will update it if neccessary\n locale: currentLocale,\n fallbackLocale: 'en',\n messages\n})\n\nconst persistedStateOptions = {\n paths: [\n 'config',\n 'users.lastLoginName',\n 'oauth'\n ]\n};\n\n(async () => {\n const persistedState = await createPersistedState(persistedStateOptions)\n const store = new Vuex.Store({\n modules: {\n i18n: {\n getters: {\n i18n: () => i18n\n }\n },\n interface: interfaceModule,\n instance: instanceModule,\n statuses: statusesModule,\n users: usersModule,\n api: apiModule,\n config: configModule,\n chat: chatModule,\n oauth: oauthModule,\n authFlow: authFlowModule,\n mediaViewer: mediaViewerModule,\n oauthTokens: oauthTokensModule,\n reports: reportsModule,\n polls: pollsModule,\n postStatus: postStatusModule\n },\n plugins: [persistedState, pushNotifications],\n strict: false // Socket modifies itself, let's ignore this for now.\n // strict: process.env.NODE_ENV !== 'production'\n })\n\n afterStoreSetup({ store, i18n })\n})()\n\n// These are inlined by webpack's DefinePlugin\n/* eslint-disable */\nwindow.___pleromafe_mode = process.env\nwindow.___pleromafe_commit_hash = COMMIT_HASH\nwindow.___pleromafe_dev_overrides = DEV_OVERRIDES\n","import { set, delete as del } from 'vue'\n\nconst defaultState = {\n settings: {\n currentSaveStateNotice: null,\n noticeClearTimeout: null,\n notificationPermission: null\n },\n browserSupport: {\n cssFilter: window.CSS && window.CSS.supports && (\n window.CSS.supports('filter', 'drop-shadow(0 0)') ||\n window.CSS.supports('-webkit-filter', 'drop-shadow(0 0)')\n )\n },\n mobileLayout: false\n}\n\nconst interfaceMod = {\n state: defaultState,\n mutations: {\n settingsSaved (state, { success, error }) {\n if (success) {\n if (state.noticeClearTimeout) {\n clearTimeout(state.noticeClearTimeout)\n }\n set(state.settings, 'currentSaveStateNotice', { error: false, data: success })\n set(state.settings, 'noticeClearTimeout',\n setTimeout(() => del(state.settings, 'currentSaveStateNotice'), 2000))\n } else {\n set(state.settings, 'currentSaveStateNotice', { error: true, errorData: error })\n }\n },\n setNotificationPermission (state, permission) {\n state.notificationPermission = permission\n },\n setMobileLayout (state, value) {\n state.mobileLayout = value\n }\n },\n actions: {\n setPageTitle ({ rootState }, option = '') {\n document.title = `${option} ${rootState.instance.name}`\n },\n settingsSaved ({ commit, dispatch }, { success, error }) {\n commit('settingsSaved', { success, error })\n },\n setNotificationPermission ({ commit }, permission) {\n commit('setNotificationPermission', permission)\n },\n setMobileLayout ({ commit }, value) {\n commit('setMobileLayout', value)\n }\n }\n}\n\nexport default interfaceMod\n","import { set } from 'vue'\nimport { setPreset } from '../services/style_setter/style_setter.js'\nimport { instanceDefaultProperties } from './config.js'\n\nconst defaultState = {\n // Stuff from static/config.json and apiConfig\n name: 'Pleroma FE',\n registrationOpen: true,\n safeDM: true,\n textlimit: 5000,\n server: 'http://localhost:4040/',\n theme: 'pleroma-dark',\n background: '/static/aurora_borealis.jpg',\n logo: '/static/logo.png',\n logoMask: true,\n logoMargin: '.2em',\n redirectRootNoLogin: '/main/all',\n redirectRootLogin: '/main/friends',\n showInstanceSpecificPanel: false,\n alwaysShowSubjectInput: true,\n hideMutedPosts: false,\n collapseMessageWithSubject: false,\n hidePostStats: false,\n hideUserStats: false,\n hideFilteredStatuses: false,\n disableChat: false,\n scopeCopy: true,\n subjectLineBehavior: 'email',\n postContentType: 'text/plain',\n nsfwCensorImage: undefined,\n vapidPublicKey: undefined,\n noAttachmentLinks: false,\n showFeaturesPanel: true,\n minimalScopesMode: false,\n\n // Nasty stuff\n pleromaBackend: true,\n emoji: [],\n emojiFetched: false,\n customEmoji: [],\n customEmojiFetched: false,\n restrictedNicknames: [],\n postFormats: [],\n\n // Feature-set, apparently, not everything here is reported...\n mediaProxyAvailable: false,\n chatAvailable: false,\n gopherAvailable: false,\n suggestionsEnabled: false,\n suggestionsWeb: '',\n\n // Html stuff\n instanceSpecificPanelContent: '',\n tos: '',\n\n // Version Information\n backendVersion: '',\n frontendVersion: '',\n\n pollsAvailable: false,\n pollLimits: {\n max_options: 4,\n max_option_chars: 255,\n min_expiration: 60,\n max_expiration: 60 * 60 * 24\n }\n}\n\nconst instance = {\n state: defaultState,\n mutations: {\n setInstanceOption (state, { name, value }) {\n if (typeof value !== 'undefined') {\n set(state, name, value)\n }\n }\n },\n getters: {\n instanceDefaultConfig (state) {\n return instanceDefaultProperties\n .map(key => [key, state[key]])\n .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})\n }\n },\n actions: {\n setInstanceOption ({ commit, dispatch }, { name, value }) {\n commit('setInstanceOption', { name, value })\n switch (name) {\n case 'name':\n dispatch('setPageTitle')\n break\n case 'chatAvailable':\n if (value) {\n dispatch('initializeSocket')\n }\n break\n }\n },\n async getStaticEmoji ({ commit }) {\n try {\n const res = await window.fetch('/static/emoji.json')\n if (res.ok) {\n const values = await res.json()\n const emoji = Object.keys(values).map((key) => {\n return {\n displayText: key,\n imageUrl: false,\n replacement: values[key]\n }\n }).sort((a, b) => a.displayText - b.displayText)\n commit('setInstanceOption', { name: 'emoji', value: emoji })\n } else {\n throw (res)\n }\n } catch (e) {\n console.warn(\"Can't load static emoji\")\n console.warn(e)\n }\n },\n\n async getCustomEmoji ({ commit, state }) {\n try {\n const res = await window.fetch('/api/pleroma/emoji.json')\n if (res.ok) {\n const result = await res.json()\n const values = Array.isArray(result) ? Object.assign({}, ...result) : result\n const emoji = Object.entries(values).map(([key, value]) => {\n const imageUrl = value.image_url\n return {\n displayText: key,\n imageUrl: imageUrl ? state.server + imageUrl : value,\n tags: imageUrl ? value.tags.sort((a, b) => a > b ? 1 : 0) : ['utf'],\n replacement: `:${key}: `\n }\n // Technically could use tags but those are kinda useless right now,\n // should have been \"pack\" field, that would be more useful\n }).sort((a, b) => a.displayText.toLowerCase() > b.displayText.toLowerCase() ? 1 : 0)\n commit('setInstanceOption', { name: 'customEmoji', value: emoji })\n } else {\n throw (res)\n }\n } catch (e) {\n console.warn(\"Can't load custom emojis\")\n console.warn(e)\n }\n },\n\n setTheme ({ commit }, themeName) {\n commit('setInstanceOption', { name: 'theme', value: themeName })\n return setPreset(themeName, commit)\n },\n fetchEmoji ({ dispatch, state }) {\n if (!state.customEmojiFetched) {\n state.customEmojiFetched = true\n dispatch('getCustomEmoji')\n }\n if (!state.emojiFetched) {\n state.emojiFetched = true\n dispatch('getStaticEmoji')\n }\n }\n }\n}\n\nexport default instance\n","import { remove, slice, each, findIndex, find, maxBy, minBy, merge, first, last, isArray, omitBy } from 'lodash'\nimport { set } from 'vue'\nimport apiService from '../services/api/api.service.js'\n// import parse from '../services/status_parser/status_parser.js'\n\nconst emptyTl = (userId = 0) => ({\n statuses: [],\n statusesObject: {},\n faves: [],\n visibleStatuses: [],\n visibleStatusesObject: {},\n newStatusCount: 0,\n maxId: 0,\n minId: 0,\n minVisibleId: 0,\n loading: false,\n followers: [],\n friends: [],\n userId,\n flushMarker: 0\n})\n\nconst emptyNotifications = () => ({\n desktopNotificationSilence: true,\n maxId: 0,\n minId: Number.POSITIVE_INFINITY,\n data: [],\n idStore: {},\n loading: false,\n error: false\n})\n\nexport const defaultState = () => ({\n allStatuses: [],\n allStatusesObject: {},\n conversationsObject: {},\n maxId: 0,\n notifications: emptyNotifications(),\n favorites: new Set(),\n error: false,\n timelines: {\n mentions: emptyTl(),\n public: emptyTl(),\n user: emptyTl(),\n favorites: emptyTl(),\n media: emptyTl(),\n publicAndExternal: emptyTl(),\n friends: emptyTl(),\n tag: emptyTl(),\n dms: emptyTl()\n }\n})\n\nexport const prepareStatus = (status) => {\n // Set deleted flag\n status.deleted = false\n\n // To make the array reactive\n status.attachments = status.attachments || []\n\n return status\n}\n\nconst visibleNotificationTypes = (rootState) => {\n return [\n rootState.config.notificationVisibility.likes && 'like',\n rootState.config.notificationVisibility.mentions && 'mention',\n rootState.config.notificationVisibility.repeats && 'repeat',\n rootState.config.notificationVisibility.follows && 'follow'\n ].filter(_ => _)\n}\n\nconst mergeOrAdd = (arr, obj, item) => {\n const oldItem = obj[item.id]\n\n if (oldItem) {\n // We already have this, so only merge the new info.\n // We ignore null values to avoid overwriting existing properties with missing data\n // we also skip 'user' because that is handled by users module\n merge(oldItem, omitBy(item, (v, k) => v === null || k === 'user'))\n // Reactivity fix.\n oldItem.attachments.splice(oldItem.attachments.length)\n return { item: oldItem, new: false }\n } else {\n // This is a new item, prepare it\n prepareStatus(item)\n arr.push(item)\n set(obj, item.id, item)\n return { item, new: true }\n }\n}\n\nconst sortById = (a, b) => {\n const seqA = Number(a.id)\n const seqB = Number(b.id)\n const isSeqA = !Number.isNaN(seqA)\n const isSeqB = !Number.isNaN(seqB)\n if (isSeqA && isSeqB) {\n return seqA > seqB ? -1 : 1\n } else if (isSeqA && !isSeqB) {\n return 1\n } else if (!isSeqA && isSeqB) {\n return -1\n } else {\n return a.id > b.id ? -1 : 1\n }\n}\n\nconst sortTimeline = (timeline) => {\n timeline.visibleStatuses = timeline.visibleStatuses.sort(sortById)\n timeline.statuses = timeline.statuses.sort(sortById)\n timeline.minVisibleId = (last(timeline.visibleStatuses) || {}).id\n return timeline\n}\n\n// Add status to the global storages (arrays and objects maintaining statuses) except timelines\nconst addStatusToGlobalStorage = (state, data) => {\n const result = mergeOrAdd(state.allStatuses, state.allStatusesObject, data)\n if (result.new) {\n // Add to conversation\n const status = result.item\n const conversationsObject = state.conversationsObject\n const conversationId = status.statusnet_conversation_id\n if (conversationsObject[conversationId]) {\n conversationsObject[conversationId].push(status)\n } else {\n set(conversationsObject, conversationId, [status])\n }\n }\n return result\n}\n\n// Remove status from the global storages (arrays and objects maintaining statuses) except timelines\nconst removeStatusFromGlobalStorage = (state, status) => {\n remove(state.allStatuses, { id: status.id })\n\n // TODO: Need to remove from allStatusesObject?\n\n // Remove possible notification\n remove(state.notifications.data, ({ action: { id } }) => id === status.id)\n\n // Remove from conversation\n const conversationId = status.statusnet_conversation_id\n if (state.conversationsObject[conversationId]) {\n remove(state.conversationsObject[conversationId], { id: status.id })\n }\n}\n\nconst addNewStatuses = (state, { statuses, showImmediately = false, timeline, user = {},\n noIdUpdate = false, userId }) => {\n // Sanity check\n if (!isArray(statuses)) {\n return false\n }\n\n const allStatuses = state.allStatuses\n const timelineObject = state.timelines[timeline]\n\n const maxNew = statuses.length > 0 ? maxBy(statuses, 'id').id : 0\n const minNew = statuses.length > 0 ? minBy(statuses, 'id').id : 0\n const newer = timeline && (maxNew > timelineObject.maxId || timelineObject.maxId === 0) && statuses.length > 0\n const older = timeline && (minNew < timelineObject.minId || timelineObject.minId === 0) && statuses.length > 0\n\n if (!noIdUpdate && newer) {\n timelineObject.maxId = maxNew\n }\n if (!noIdUpdate && older) {\n timelineObject.minId = minNew\n }\n\n // This makes sure that user timeline won't get data meant for other\n // user. I.e. opening different user profiles makes request which could\n // return data late after user already viewing different user profile\n if ((timeline === 'user' || timeline === 'media') && timelineObject.userId !== userId) {\n return\n }\n\n const addStatus = (data, showImmediately, addToTimeline = true) => {\n const result = addStatusToGlobalStorage(state, data)\n const status = result.item\n\n if (result.new) {\n // We are mentioned in a post\n if (status.type === 'status' && find(status.attentions, { id: user.id })) {\n const mentions = state.timelines.mentions\n\n // Add the mention to the mentions timeline\n if (timelineObject !== mentions) {\n mergeOrAdd(mentions.statuses, mentions.statusesObject, status)\n mentions.newStatusCount += 1\n\n sortTimeline(mentions)\n }\n }\n if (status.visibility === 'direct') {\n const dms = state.timelines.dms\n\n mergeOrAdd(dms.statuses, dms.statusesObject, status)\n dms.newStatusCount += 1\n\n sortTimeline(dms)\n }\n }\n\n // Decide if we should treat the status as new for this timeline.\n let resultForCurrentTimeline\n // Some statuses should only be added to the global status repository.\n if (timeline && addToTimeline) {\n resultForCurrentTimeline = mergeOrAdd(timelineObject.statuses, timelineObject.statusesObject, status)\n }\n\n if (timeline && showImmediately) {\n // Add it directly to the visibleStatuses, don't change\n // newStatusCount\n mergeOrAdd(timelineObject.visibleStatuses, timelineObject.visibleStatusesObject, status)\n } else if (timeline && addToTimeline && resultForCurrentTimeline.new) {\n // Just change newStatuscount\n timelineObject.newStatusCount += 1\n }\n\n return status\n }\n\n const favoriteStatus = (favorite, counter) => {\n const status = find(allStatuses, { id: favorite.in_reply_to_status_id })\n if (status) {\n // This is our favorite, so the relevant bit.\n if (favorite.user.id === user.id) {\n status.favorited = true\n } else {\n status.fave_num += 1\n }\n }\n return status\n }\n\n const processors = {\n 'status': (status) => {\n addStatus(status, showImmediately)\n },\n 'retweet': (status) => {\n // RetweetedStatuses are never shown immediately\n const retweetedStatus = addStatus(status.retweeted_status, false, false)\n\n let retweet\n // If the retweeted status is already there, don't add the retweet\n // to the timeline.\n if (timeline && find(timelineObject.statuses, (s) => {\n if (s.retweeted_status) {\n return s.id === retweetedStatus.id || s.retweeted_status.id === retweetedStatus.id\n } else {\n return s.id === retweetedStatus.id\n }\n })) {\n // Already have it visible (either as the original or another RT), don't add to timeline, don't show.\n retweet = addStatus(status, false, false)\n } else {\n retweet = addStatus(status, showImmediately)\n }\n\n retweet.retweeted_status = retweetedStatus\n },\n 'favorite': (favorite) => {\n // Only update if this is a new favorite.\n // Ignore our own favorites because we get info about likes as response to like request\n if (!state.favorites.has(favorite.id)) {\n state.favorites.add(favorite.id)\n favoriteStatus(favorite)\n }\n },\n 'deletion': (deletion) => {\n const uri = deletion.uri\n const status = find(allStatuses, { uri })\n if (!status) {\n return\n }\n\n removeStatusFromGlobalStorage(state, status)\n\n if (timeline) {\n remove(timelineObject.statuses, { uri })\n remove(timelineObject.visibleStatuses, { uri })\n }\n },\n 'follow': (follow) => {\n // NOOP, it is known status but we don't do anything about it for now\n },\n 'default': (unknown) => {\n console.log('unknown status type')\n console.log(unknown)\n }\n }\n\n each(statuses, (status) => {\n const type = status.type\n const processor = processors[type] || processors['default']\n processor(status)\n })\n\n // Keep the visible statuses sorted\n if (timeline) {\n sortTimeline(timelineObject)\n }\n}\n\nconst addNewNotifications = (state, { dispatch, notifications, older, visibleNotificationTypes, rootGetters }) => {\n each(notifications, (notification) => {\n if (notification.type !== 'follow') {\n notification.action = addStatusToGlobalStorage(state, notification.action).item\n notification.status = notification.status && addStatusToGlobalStorage(state, notification.status).item\n }\n\n // Only add a new notification if we don't have one for the same action\n if (!state.notifications.idStore.hasOwnProperty(notification.id)) {\n state.notifications.maxId = notification.id > state.notifications.maxId\n ? notification.id\n : state.notifications.maxId\n state.notifications.minId = notification.id < state.notifications.minId\n ? notification.id\n : state.notifications.minId\n\n state.notifications.data.push(notification)\n state.notifications.idStore[notification.id] = notification\n\n if ('Notification' in window && window.Notification.permission === 'granted') {\n const notifObj = {}\n const status = notification.status\n const title = notification.from_profile.name\n notifObj.icon = notification.from_profile.profile_image_url\n let i18nString\n switch (notification.type) {\n case 'like':\n i18nString = 'favorited_you'\n break\n case 'repeat':\n i18nString = 'repeated_you'\n break\n case 'follow':\n i18nString = 'followed_you'\n break\n }\n\n if (i18nString) {\n notifObj.body = rootGetters.i18n.t('notifications.' + i18nString)\n } else {\n notifObj.body = notification.status.text\n }\n\n // Shows first attached non-nsfw image, if any. Should add configuration for this somehow...\n if (status && status.attachments && status.attachments.length > 0 && !status.nsfw &&\n status.attachments[0].mimetype.startsWith('image/')) {\n notifObj.image = status.attachments[0].url\n }\n\n if (!notification.seen && !state.notifications.desktopNotificationSilence && visibleNotificationTypes.includes(notification.type)) {\n let notification = new window.Notification(title, notifObj)\n // Chrome is known for not closing notifications automatically\n // according to MDN, anyway.\n setTimeout(notification.close.bind(notification), 5000)\n }\n }\n } else if (notification.seen) {\n state.notifications.idStore[notification.id].seen = true\n }\n })\n}\n\nconst removeStatus = (state, { timeline, userId }) => {\n const timelineObject = state.timelines[timeline]\n if (userId) {\n remove(timelineObject.statuses, { user: { id: userId } })\n remove(timelineObject.visibleStatuses, { user: { id: userId } })\n timelineObject.minVisibleId = timelineObject.visibleStatuses.length > 0 ? last(timelineObject.visibleStatuses).id : 0\n timelineObject.maxId = timelineObject.statuses.length > 0 ? first(timelineObject.statuses).id : 0\n }\n}\n\nexport const mutations = {\n addNewStatuses,\n addNewNotifications,\n removeStatus,\n showNewStatuses (state, { timeline }) {\n const oldTimeline = (state.timelines[timeline])\n\n oldTimeline.newStatusCount = 0\n oldTimeline.visibleStatuses = slice(oldTimeline.statuses, 0, 50)\n oldTimeline.minVisibleId = last(oldTimeline.visibleStatuses).id\n oldTimeline.minId = oldTimeline.minVisibleId\n oldTimeline.visibleStatusesObject = {}\n each(oldTimeline.visibleStatuses, (status) => { oldTimeline.visibleStatusesObject[status.id] = status })\n },\n resetStatuses (state) {\n const emptyState = defaultState()\n Object.entries(emptyState).forEach(([key, value]) => {\n state[key] = value\n })\n },\n clearTimeline (state, { timeline, excludeUserId = false }) {\n const userId = excludeUserId ? state.timelines[timeline].userId : undefined\n state.timelines[timeline] = emptyTl(userId)\n },\n clearNotifications (state) {\n state.notifications = emptyNotifications()\n },\n setFavorited (state, { status, value }) {\n const newStatus = state.allStatusesObject[status.id]\n\n if (newStatus.favorited !== value) {\n if (value) {\n newStatus.fave_num++\n } else {\n newStatus.fave_num--\n }\n }\n\n newStatus.favorited = value\n },\n setFavoritedConfirm (state, { status, user }) {\n const newStatus = state.allStatusesObject[status.id]\n newStatus.favorited = status.favorited\n newStatus.fave_num = status.fave_num\n const index = findIndex(newStatus.favoritedBy, { id: user.id })\n if (index !== -1 && !newStatus.favorited) {\n newStatus.favoritedBy.splice(index, 1)\n } else if (index === -1 && newStatus.favorited) {\n newStatus.favoritedBy.push(user)\n }\n },\n setMutedStatus (state, status) {\n const newStatus = state.allStatusesObject[status.id]\n newStatus.thread_muted = status.thread_muted\n\n if (newStatus.thread_muted !== undefined) {\n state.conversationsObject[newStatus.statusnet_conversation_id].forEach(status => { status.thread_muted = newStatus.thread_muted })\n }\n },\n setRetweeted (state, { status, value }) {\n const newStatus = state.allStatusesObject[status.id]\n\n if (newStatus.repeated !== value) {\n if (value) {\n newStatus.repeat_num++\n } else {\n newStatus.repeat_num--\n }\n }\n\n newStatus.repeated = value\n },\n setRetweetedConfirm (state, { status, user }) {\n const newStatus = state.allStatusesObject[status.id]\n newStatus.repeated = status.repeated\n newStatus.repeat_num = status.repeat_num\n const index = findIndex(newStatus.rebloggedBy, { id: user.id })\n if (index !== -1 && !newStatus.repeated) {\n newStatus.rebloggedBy.splice(index, 1)\n } else if (index === -1 && newStatus.repeated) {\n newStatus.rebloggedBy.push(user)\n }\n },\n setDeleted (state, { status }) {\n const newStatus = state.allStatusesObject[status.id]\n newStatus.deleted = true\n },\n setManyDeleted (state, condition) {\n Object.values(state.allStatusesObject).forEach(status => {\n if (condition(status)) {\n status.deleted = true\n }\n })\n },\n setLoading (state, { timeline, value }) {\n state.timelines[timeline].loading = value\n },\n setNsfw (state, { id, nsfw }) {\n const newStatus = state.allStatusesObject[id]\n newStatus.nsfw = nsfw\n },\n setError (state, { value }) {\n state.error = value\n },\n setNotificationsLoading (state, { value }) {\n state.notifications.loading = value\n },\n setNotificationsError (state, { value }) {\n state.notifications.error = value\n },\n setNotificationsSilence (state, { value }) {\n state.notifications.desktopNotificationSilence = value\n },\n markNotificationsAsSeen (state) {\n each(state.notifications.data, (notification) => {\n notification.seen = true\n })\n },\n queueFlush (state, { timeline, id }) {\n state.timelines[timeline].flushMarker = id\n },\n addRepeats (state, { id, rebloggedByUsers, currentUser }) {\n const newStatus = state.allStatusesObject[id]\n newStatus.rebloggedBy = rebloggedByUsers.filter(_ => _)\n // repeats stats can be incorrect based on polling condition, let's update them using the most recent data\n newStatus.repeat_num = newStatus.rebloggedBy.length\n newStatus.repeated = !!newStatus.rebloggedBy.find(({ id }) => currentUser.id === id)\n },\n addFavs (state, { id, favoritedByUsers, currentUser }) {\n const newStatus = state.allStatusesObject[id]\n newStatus.favoritedBy = favoritedByUsers.filter(_ => _)\n // favorites stats can be incorrect based on polling condition, let's update them using the most recent data\n newStatus.fave_num = newStatus.favoritedBy.length\n newStatus.favorited = !!newStatus.favoritedBy.find(({ id }) => currentUser.id === id)\n },\n updateStatusWithPoll (state, { id, poll }) {\n const status = state.allStatusesObject[id]\n status.poll = poll\n }\n}\n\nconst statuses = {\n state: defaultState(),\n actions: {\n addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false, userId }) {\n commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser, userId })\n },\n addNewNotifications ({ rootState, commit, dispatch, rootGetters }, { notifications, older }) {\n commit('addNewNotifications', { visibleNotificationTypes: visibleNotificationTypes(rootState), dispatch, notifications, older, rootGetters })\n },\n setError ({ rootState, commit }, { value }) {\n commit('setError', { value })\n },\n setNotificationsLoading ({ rootState, commit }, { value }) {\n commit('setNotificationsLoading', { value })\n },\n setNotificationsError ({ rootState, commit }, { value }) {\n commit('setNotificationsError', { value })\n },\n setNotificationsSilence ({ rootState, commit }, { value }) {\n commit('setNotificationsSilence', { value })\n },\n fetchStatus ({ rootState, dispatch }, id) {\n rootState.api.backendInteractor.fetchStatus({ id })\n .then((status) => dispatch('addNewStatuses', { statuses: [status] }))\n },\n deleteStatus ({ rootState, commit }, status) {\n commit('setDeleted', { status })\n apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials })\n },\n markStatusesAsDeleted ({ commit }, condition) {\n commit('setManyDeleted', condition)\n },\n favorite ({ rootState, commit }, status) {\n // Optimistic favoriting...\n commit('setFavorited', { status, value: true })\n rootState.api.backendInteractor.favorite(status.id)\n .then(status => commit('setFavoritedConfirm', { status, user: rootState.users.currentUser }))\n },\n unfavorite ({ rootState, commit }, status) {\n // Optimistic unfavoriting...\n commit('setFavorited', { status, value: false })\n rootState.api.backendInteractor.unfavorite(status.id)\n .then(status => commit('setFavoritedConfirm', { status, user: rootState.users.currentUser }))\n },\n fetchPinnedStatuses ({ rootState, dispatch }, userId) {\n rootState.api.backendInteractor.fetchPinnedStatuses(userId)\n .then(statuses => dispatch('addNewStatuses', { statuses, timeline: 'user', userId, showImmediately: true, noIdUpdate: true }))\n },\n pinStatus ({ rootState, dispatch }, statusId) {\n return rootState.api.backendInteractor.pinOwnStatus(statusId)\n .then((status) => dispatch('addNewStatuses', { statuses: [status] }))\n },\n unpinStatus ({ rootState, dispatch }, statusId) {\n rootState.api.backendInteractor.unpinOwnStatus(statusId)\n .then((status) => dispatch('addNewStatuses', { statuses: [status] }))\n },\n muteConversation ({ rootState, commit }, statusId) {\n return rootState.api.backendInteractor.muteConversation(statusId)\n .then((status) => commit('setMutedStatus', status))\n },\n unmuteConversation ({ rootState, commit }, statusId) {\n return rootState.api.backendInteractor.unmuteConversation(statusId)\n .then((status) => commit('setMutedStatus', status))\n },\n retweet ({ rootState, commit }, status) {\n // Optimistic retweeting...\n commit('setRetweeted', { status, value: true })\n rootState.api.backendInteractor.retweet(status.id)\n .then(status => commit('setRetweetedConfirm', { status: status.retweeted_status, user: rootState.users.currentUser }))\n },\n unretweet ({ rootState, commit }, status) {\n // Optimistic unretweeting...\n commit('setRetweeted', { status, value: false })\n rootState.api.backendInteractor.unretweet(status.id)\n .then(status => commit('setRetweetedConfirm', { status, user: rootState.users.currentUser }))\n },\n queueFlush ({ rootState, commit }, { timeline, id }) {\n commit('queueFlush', { timeline, id })\n },\n markNotificationsAsSeen ({ rootState, commit }) {\n commit('markNotificationsAsSeen')\n apiService.markNotificationsAsSeen({\n id: rootState.statuses.notifications.maxId,\n credentials: rootState.users.currentUser.credentials\n })\n },\n fetchFavsAndRepeats ({ rootState, commit }, id) {\n Promise.all([\n rootState.api.backendInteractor.fetchFavoritedByUsers(id),\n rootState.api.backendInteractor.fetchRebloggedByUsers(id)\n ]).then(([favoritedByUsers, rebloggedByUsers]) => {\n commit('addFavs', { id, favoritedByUsers, currentUser: rootState.users.currentUser })\n commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser })\n })\n },\n fetchFavs ({ rootState, commit }, id) {\n rootState.api.backendInteractor.fetchFavoritedByUsers(id)\n .then(favoritedByUsers => commit('addFavs', { id, favoritedByUsers, currentUser: rootState.users.currentUser }))\n },\n fetchRepeats ({ rootState, commit }, id) {\n rootState.api.backendInteractor.fetchRebloggedByUsers(id)\n .then(rebloggedByUsers => commit('addRepeats', { id, rebloggedByUsers, currentUser: rootState.users.currentUser }))\n },\n search (store, { q, resolve, limit, offset, following }) {\n return store.rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following })\n .then((data) => {\n store.commit('addNewUsers', data.accounts)\n store.commit('addNewStatuses', { statuses: data.statuses })\n return data\n })\n }\n },\n mutations\n}\n\nexport default statuses\n","const qvitterStatusType = (status) => {\n if (status.is_post_verb) {\n return 'status'\n }\n\n if (status.retweeted_status) {\n return 'retweet'\n }\n\n if ((typeof status.uri === 'string' && status.uri.match(/(fave|objectType=Favourite)/)) ||\n (typeof status.text === 'string' && status.text.match(/favorited/))) {\n return 'favorite'\n }\n\n if (status.text.match(/deleted notice {{tag/) || status.qvitter_delete_notice) {\n return 'deletion'\n }\n\n if (status.text.match(/started following/) || status.activity_type === 'follow') {\n return 'follow'\n }\n\n return 'unknown'\n}\n\nexport const parseUser = (data) => {\n const output = {}\n const masto = data.hasOwnProperty('acct')\n // case for users in \"mentions\" property for statuses in MastoAPI\n const mastoShort = masto && !data.hasOwnProperty('avatar')\n\n output.id = String(data.id)\n\n if (masto) {\n output.screen_name = data.acct\n output.statusnet_profile_url = data.url\n\n // There's nothing else to get\n if (mastoShort) {\n return output\n }\n\n output.name = data.display_name\n output.name_html = addEmojis(data.display_name, data.emojis)\n\n output.description = data.note\n output.description_html = addEmojis(data.note, data.emojis)\n\n // Utilize avatar_static for gif avatars?\n output.profile_image_url = data.avatar\n output.profile_image_url_original = data.avatar\n\n // Same, utilize header_static?\n output.cover_photo = data.header\n\n output.friends_count = data.following_count\n\n output.bot = data.bot\n\n if (data.pleroma) {\n const relationship = data.pleroma.relationship\n\n output.background_image = data.pleroma.background_image\n output.token = data.pleroma.chat_token\n\n if (relationship) {\n output.follows_you = relationship.followed_by\n output.requested = relationship.requested\n output.following = relationship.following\n output.statusnet_blocking = relationship.blocking\n output.muted = relationship.muting\n output.showing_reblogs = relationship.showing_reblogs\n output.subscribed = relationship.subscribing\n }\n\n output.hide_follows = data.pleroma.hide_follows\n output.hide_followers = data.pleroma.hide_followers\n output.hide_follows_count = data.pleroma.hide_follows_count\n output.hide_followers_count = data.pleroma.hide_followers_count\n\n output.rights = {\n moderator: data.pleroma.is_moderator,\n admin: data.pleroma.is_admin\n }\n // TODO: Clean up in UI? This is duplication from what BE does for qvitterapi\n if (output.rights.admin) {\n output.role = 'admin'\n } else if (output.rights.moderator) {\n output.role = 'moderator'\n } else {\n output.role = 'member'\n }\n }\n\n if (data.source) {\n output.description = data.source.note\n output.default_scope = data.source.privacy\n if (data.source.pleroma) {\n output.no_rich_text = data.source.pleroma.no_rich_text\n output.show_role = data.source.pleroma.show_role\n output.discoverable = data.source.pleroma.discoverable\n }\n }\n\n // TODO: handle is_local\n output.is_local = !output.screen_name.includes('@')\n } else {\n output.screen_name = data.screen_name\n\n output.name = data.name\n output.name_html = data.name_html\n\n output.description = data.description\n output.description_html = data.description_html\n\n output.profile_image_url = data.profile_image_url\n output.profile_image_url_original = data.profile_image_url_original\n\n output.cover_photo = data.cover_photo\n\n output.friends_count = data.friends_count\n\n // output.bot = ??? missing\n\n output.statusnet_profile_url = data.statusnet_profile_url\n\n output.statusnet_blocking = data.statusnet_blocking\n\n output.is_local = data.is_local\n output.role = data.role\n output.show_role = data.show_role\n\n output.follows_you = data.follows_you\n\n output.muted = data.muted\n\n if (data.rights) {\n output.rights = {\n moderator: data.rights.delete_others_notice,\n admin: data.rights.admin\n }\n }\n output.no_rich_text = data.no_rich_text\n output.default_scope = data.default_scope\n output.hide_follows = data.hide_follows\n output.hide_followers = data.hide_followers\n output.hide_follows_count = data.hide_follows_count\n output.hide_followers_count = data.hide_followers_count\n output.background_image = data.background_image\n // on mastoapi this info is contained in a \"relationship\"\n output.following = data.following\n // Websocket token\n output.token = data.token\n }\n\n output.created_at = new Date(data.created_at)\n output.locked = data.locked\n output.followers_count = data.followers_count\n output.statuses_count = data.statuses_count\n output.friendIds = []\n output.followerIds = []\n output.pinnedStatusIds = []\n\n if (data.pleroma) {\n output.follow_request_count = data.pleroma.follow_request_count\n\n output.tags = data.pleroma.tags\n output.deactivated = data.pleroma.deactivated\n\n output.notification_settings = data.pleroma.notification_settings\n }\n\n output.tags = output.tags || []\n output.rights = output.rights || {}\n output.notification_settings = output.notification_settings || {}\n\n return output\n}\n\nexport const parseAttachment = (data) => {\n const output = {}\n const masto = !data.hasOwnProperty('oembed')\n\n if (masto) {\n // Not exactly same...\n output.mimetype = data.pleroma ? data.pleroma.mime_type : data.type\n output.meta = data.meta // not present in BE yet\n output.id = data.id\n } else {\n output.mimetype = data.mimetype\n // output.meta = ??? missing\n }\n\n output.url = data.url\n output.description = data.description\n\n return output\n}\nexport const addEmojis = (string, emojis) => {\n const matchOperatorsRegex = /[|\\\\{}()[\\]^$+*?.-]/g\n return emojis.reduce((acc, emoji) => {\n const regexSafeShortCode = emoji.shortcode.replace(matchOperatorsRegex, '\\\\$&')\n return acc.replace(\n new RegExp(`:${regexSafeShortCode}:`, 'g'),\n `${emoji.shortcode}`\n )\n }, string)\n}\n\nexport const parseStatus = (data) => {\n const output = {}\n const masto = data.hasOwnProperty('account')\n\n if (masto) {\n output.favorited = data.favourited\n output.fave_num = data.favourites_count\n\n output.repeated = data.reblogged\n output.repeat_num = data.reblogs_count\n\n output.type = data.reblog ? 'retweet' : 'status'\n output.nsfw = data.sensitive\n\n output.statusnet_html = addEmojis(data.content, data.emojis)\n\n output.tags = data.tags\n\n if (data.pleroma) {\n const { pleroma } = data\n output.text = pleroma.content ? data.pleroma.content['text/plain'] : data.content\n output.summary = pleroma.spoiler_text ? data.pleroma.spoiler_text['text/plain'] : data.spoiler_text\n output.statusnet_conversation_id = data.pleroma.conversation_id\n output.is_local = pleroma.local\n output.in_reply_to_screen_name = data.pleroma.in_reply_to_account_acct\n output.thread_muted = pleroma.thread_muted\n } else {\n output.text = data.content\n output.summary = data.spoiler_text\n }\n\n output.in_reply_to_status_id = data.in_reply_to_id\n output.in_reply_to_user_id = data.in_reply_to_account_id\n output.replies_count = data.replies_count\n\n if (output.type === 'retweet') {\n output.retweeted_status = parseStatus(data.reblog)\n }\n\n output.summary_html = addEmojis(data.spoiler_text, data.emojis)\n output.external_url = data.url\n output.poll = data.poll\n output.pinned = data.pinned\n output.muted = data.muted\n } else {\n output.favorited = data.favorited\n output.fave_num = data.fave_num\n\n output.repeated = data.repeated\n output.repeat_num = data.repeat_num\n\n // catchall, temporary\n // Object.assign(output, data)\n\n output.type = qvitterStatusType(data)\n\n if (data.nsfw === undefined) {\n output.nsfw = isNsfw(data)\n if (data.retweeted_status) {\n output.nsfw = data.retweeted_status.nsfw\n }\n } else {\n output.nsfw = data.nsfw\n }\n\n output.statusnet_html = data.statusnet_html\n output.text = data.text\n\n output.in_reply_to_status_id = data.in_reply_to_status_id\n output.in_reply_to_user_id = data.in_reply_to_user_id\n output.in_reply_to_screen_name = data.in_reply_to_screen_name\n output.statusnet_conversation_id = data.statusnet_conversation_id\n\n if (output.type === 'retweet') {\n output.retweeted_status = parseStatus(data.retweeted_status)\n }\n\n output.summary = data.summary\n output.summary_html = data.summary_html\n output.external_url = data.external_url\n output.is_local = data.is_local\n }\n\n output.id = String(data.id)\n output.visibility = data.visibility\n output.card = data.card\n output.created_at = new Date(data.created_at)\n\n // Converting to string, the right way.\n output.in_reply_to_status_id = output.in_reply_to_status_id\n ? String(output.in_reply_to_status_id)\n : null\n output.in_reply_to_user_id = output.in_reply_to_user_id\n ? String(output.in_reply_to_user_id)\n : null\n\n output.user = parseUser(masto ? data.account : data.user)\n\n output.attentions = ((masto ? data.mentions : data.attentions) || []).map(parseUser)\n\n output.attachments = ((masto ? data.media_attachments : data.attachments) || [])\n .map(parseAttachment)\n\n const retweetedStatus = masto ? data.reblog : data.retweeted_status\n if (retweetedStatus) {\n output.retweeted_status = parseStatus(retweetedStatus)\n }\n\n output.favoritedBy = []\n output.rebloggedBy = []\n\n return output\n}\n\nexport const parseNotification = (data) => {\n const mastoDict = {\n 'favourite': 'like',\n 'reblog': 'repeat'\n }\n const masto = !data.hasOwnProperty('ntype')\n const output = {}\n\n if (masto) {\n output.type = mastoDict[data.type] || data.type\n output.seen = data.pleroma.is_seen\n output.status = output.type === 'follow'\n ? null\n : parseStatus(data.status)\n output.action = output.status // TODO: Refactor, this is unneeded\n output.from_profile = parseUser(data.account)\n } else {\n const parsedNotice = parseStatus(data.notice)\n output.type = data.ntype\n output.seen = Boolean(data.is_seen)\n output.status = output.type === 'like'\n ? parseStatus(data.notice.favorited_status)\n : parsedNotice\n output.action = parsedNotice\n output.from_profile = parseUser(data.from_profile)\n }\n\n output.created_at = new Date(data.created_at)\n output.id = parseInt(data.id)\n\n return output\n}\n\nconst isNsfw = (status) => {\n const nsfwRegex = /#nsfw/i\n return (status.tags || []).includes('nsfw') || !!(status.text || '').match(nsfwRegex)\n}\n","import { humanizeErrors } from '../../modules/errors'\n\nexport function StatusCodeError (statusCode, body, options, response) {\n this.name = 'StatusCodeError'\n this.statusCode = statusCode\n this.message = statusCode + ' - ' + (JSON && JSON.stringify ? JSON.stringify(body) : body)\n this.error = body // legacy attribute\n this.options = options\n this.response = response\n\n if (Error.captureStackTrace) { // required for non-V8 environments\n Error.captureStackTrace(this)\n }\n}\nStatusCodeError.prototype = Object.create(Error.prototype)\nStatusCodeError.prototype.constructor = StatusCodeError\n\nexport class RegistrationError extends Error {\n constructor (error) {\n super()\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this)\n }\n\n try {\n // the error is probably a JSON object with a single key, \"errors\", whose value is another JSON object containing the real errors\n if (typeof error === 'string') {\n error = JSON.parse(error)\n if (error.hasOwnProperty('error')) {\n error = JSON.parse(error.error)\n }\n }\n\n if (typeof error === 'object') {\n // replace ap_id with username\n if (error.ap_id) {\n error.username = error.ap_id\n delete error.ap_id\n }\n this.message = humanizeErrors(error)\n } else {\n this.message = error\n }\n } catch (e) {\n // can't parse it, so just treat it like a string\n this.message = error\n }\n }\n}\n","import { capitalize } from 'lodash'\n\nexport function humanizeErrors (errors) {\n return Object.entries(errors).reduce((errs, [k, val]) => {\n let message = val.reduce((acc, message) => {\n let key = capitalize(k.replace(/_/g, ' '))\n return acc + [key, message].join(' ') + '. '\n }, '')\n return [...errs, message]\n }, [])\n}\n","import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'\nimport oauthApi from '../services/new_api/oauth.js'\nimport { compact, map, each, merge, last, concat, uniq } from 'lodash'\nimport { set } from 'vue'\nimport { registerPushNotifications, unregisterPushNotifications } from '../services/push/push.js'\n\n// TODO: Unify with mergeOrAdd in statuses.js\nexport const mergeOrAdd = (arr, obj, item) => {\n if (!item) { return false }\n const oldItem = obj[item.id]\n if (oldItem) {\n // We already have this, so only merge the new info.\n merge(oldItem, item)\n return { item: oldItem, new: false }\n } else {\n // This is a new item, prepare it\n arr.push(item)\n set(obj, item.id, item)\n if (item.screen_name && !item.screen_name.includes('@')) {\n set(obj, item.screen_name.toLowerCase(), item)\n }\n return { item, new: true }\n }\n}\n\nconst getNotificationPermission = () => {\n const Notification = window.Notification\n\n if (!Notification) return Promise.resolve(null)\n if (Notification.permission === 'default') return Notification.requestPermission()\n return Promise.resolve(Notification.permission)\n}\n\nconst blockUser = (store, id) => {\n return store.rootState.api.backendInteractor.blockUser(id)\n .then((relationship) => {\n store.commit('updateUserRelationship', [relationship])\n store.commit('addBlockId', id)\n store.commit('removeStatus', { timeline: 'friends', userId: id })\n store.commit('removeStatus', { timeline: 'public', userId: id })\n store.commit('removeStatus', { timeline: 'publicAndExternal', userId: id })\n })\n}\n\nconst unblockUser = (store, id) => {\n return store.rootState.api.backendInteractor.unblockUser(id)\n .then((relationship) => store.commit('updateUserRelationship', [relationship]))\n}\n\nconst muteUser = (store, id) => {\n return store.rootState.api.backendInteractor.muteUser(id)\n .then((relationship) => {\n store.commit('updateUserRelationship', [relationship])\n store.commit('addMuteId', id)\n })\n}\n\nconst unmuteUser = (store, id) => {\n return store.rootState.api.backendInteractor.unmuteUser(id)\n .then((relationship) => store.commit('updateUserRelationship', [relationship]))\n}\n\nconst hideReblogs = (store, userId) => {\n return store.rootState.api.backendInteractor.followUser({ id: userId, reblogs: false })\n .then((relationship) => {\n store.commit('updateUserRelationship', [relationship])\n })\n}\n\nconst showReblogs = (store, userId) => {\n return store.rootState.api.backendInteractor.followUser({ id: userId, reblogs: true })\n .then((relationship) => store.commit('updateUserRelationship', [relationship]))\n}\n\nexport const mutations = {\n setMuted (state, { user: { id }, muted }) {\n const user = state.usersObject[id]\n set(user, 'muted', muted)\n },\n tagUser (state, { user: { id }, tag }) {\n const user = state.usersObject[id]\n const tags = user.tags || []\n const newTags = tags.concat([tag])\n set(user, 'tags', newTags)\n },\n untagUser (state, { user: { id }, tag }) {\n const user = state.usersObject[id]\n const tags = user.tags || []\n const newTags = tags.filter(t => t !== tag)\n set(user, 'tags', newTags)\n },\n updateRight (state, { user: { id }, right, value }) {\n const user = state.usersObject[id]\n let newRights = user.rights\n newRights[right] = value\n set(user, 'rights', newRights)\n },\n updateActivationStatus (state, { user: { id }, status }) {\n const user = state.usersObject[id]\n set(user, 'deactivated', !status)\n },\n setCurrentUser (state, user) {\n state.lastLoginName = user.screen_name\n state.currentUser = merge(state.currentUser || {}, user)\n },\n clearCurrentUser (state) {\n state.currentUser = false\n state.lastLoginName = false\n },\n beginLogin (state) {\n state.loggingIn = true\n },\n endLogin (state) {\n state.loggingIn = false\n },\n saveFriendIds (state, { id, friendIds }) {\n const user = state.usersObject[id]\n user.friendIds = uniq(concat(user.friendIds, friendIds))\n },\n saveFollowerIds (state, { id, followerIds }) {\n const user = state.usersObject[id]\n user.followerIds = uniq(concat(user.followerIds, followerIds))\n },\n // Because frontend doesn't have a reason to keep these stuff in memory\n // outside of viewing someones user profile.\n clearFriends (state, userId) {\n const user = state.usersObject[userId]\n if (user) {\n set(user, 'friendIds', [])\n }\n },\n clearFollowers (state, userId) {\n const user = state.usersObject[userId]\n if (user) {\n set(user, 'followerIds', [])\n }\n },\n addNewUsers (state, users) {\n each(users, (user) => mergeOrAdd(state.users, state.usersObject, user))\n },\n updateUserRelationship (state, relationships) {\n relationships.forEach((relationship) => {\n const user = state.usersObject[relationship.id]\n if (user) {\n user.follows_you = relationship.followed_by\n user.following = relationship.following\n user.muted = relationship.muting\n user.statusnet_blocking = relationship.blocking\n user.subscribed = relationship.subscribing\n user.showing_reblogs = relationship.showing_reblogs\n }\n })\n },\n updateBlocks (state, blockedUsers) {\n // Reset statusnet_blocking of all fetched users\n each(state.users, (user) => { user.statusnet_blocking = false })\n each(blockedUsers, (user) => mergeOrAdd(state.users, state.usersObject, user))\n },\n saveBlockIds (state, blockIds) {\n state.currentUser.blockIds = blockIds\n },\n addBlockId (state, blockId) {\n if (state.currentUser.blockIds.indexOf(blockId) === -1) {\n state.currentUser.blockIds.push(blockId)\n }\n },\n updateMutes (state, mutedUsers) {\n // Reset muted of all fetched users\n each(state.users, (user) => { user.muted = false })\n each(mutedUsers, (user) => mergeOrAdd(state.users, state.usersObject, user))\n },\n saveMuteIds (state, muteIds) {\n state.currentUser.muteIds = muteIds\n },\n addMuteId (state, muteId) {\n if (state.currentUser.muteIds.indexOf(muteId) === -1) {\n state.currentUser.muteIds.push(muteId)\n }\n },\n setPinnedToUser (state, status) {\n const user = state.usersObject[status.user.id]\n const index = user.pinnedStatusIds.indexOf(status.id)\n if (status.pinned && index === -1) {\n user.pinnedStatusIds.push(status.id)\n } else if (!status.pinned && index !== -1) {\n user.pinnedStatusIds.splice(index, 1)\n }\n },\n setUserForStatus (state, status) {\n status.user = state.usersObject[status.user.id]\n },\n setUserForNotification (state, notification) {\n if (notification.type !== 'follow') {\n notification.action.user = state.usersObject[notification.action.user.id]\n }\n notification.from_profile = state.usersObject[notification.from_profile.id]\n },\n setColor (state, { user: { id }, highlighted }) {\n const user = state.usersObject[id]\n set(user, 'highlight', highlighted)\n },\n signUpPending (state) {\n state.signUpPending = true\n state.signUpErrors = []\n },\n signUpSuccess (state) {\n state.signUpPending = false\n },\n signUpFailure (state, errors) {\n state.signUpPending = false\n state.signUpErrors = errors\n }\n}\n\nexport const getters = {\n findUser: state => query => {\n const result = state.usersObject[query]\n // In case it's a screen_name, we can try searching case-insensitive\n if (!result && typeof query === 'string') {\n return state.usersObject[query.toLowerCase()]\n }\n return result\n }\n}\n\nexport const defaultState = {\n loggingIn: false,\n lastLoginName: false,\n currentUser: false,\n users: [],\n usersObject: {},\n signUpPending: false,\n signUpErrors: []\n}\n\nconst users = {\n state: defaultState,\n mutations,\n getters,\n actions: {\n fetchUser (store, id) {\n return store.rootState.api.backendInteractor.fetchUser({ id })\n .then((user) => {\n store.commit('addNewUsers', [user])\n return user\n })\n },\n fetchUserRelationship (store, id) {\n if (store.state.currentUser) {\n store.rootState.api.backendInteractor.fetchUserRelationship({ id })\n .then((relationships) => store.commit('updateUserRelationship', relationships))\n }\n },\n fetchBlocks (store) {\n return store.rootState.api.backendInteractor.fetchBlocks()\n .then((blocks) => {\n store.commit('saveBlockIds', map(blocks, 'id'))\n store.commit('updateBlocks', blocks)\n return blocks\n })\n },\n blockUser (store, id) {\n return blockUser(store, id)\n },\n unblockUser (store, id) {\n return unblockUser(store, id)\n },\n blockUsers (store, ids = []) {\n return Promise.all(ids.map(id => blockUser(store, id)))\n },\n unblockUsers (store, ids = []) {\n return Promise.all(ids.map(id => unblockUser(store, id)))\n },\n fetchMutes (store) {\n return store.rootState.api.backendInteractor.fetchMutes()\n .then((mutes) => {\n store.commit('updateMutes', mutes)\n store.commit('saveMuteIds', map(mutes, 'id'))\n return mutes\n })\n },\n muteUser (store, id) {\n return muteUser(store, id)\n },\n unmuteUser (store, id) {\n return unmuteUser(store, id)\n },\n hideReblogs (store, id) {\n return hideReblogs(store, id)\n },\n showReblogs (store, id) {\n return showReblogs(store, id)\n },\n muteUsers (store, ids = []) {\n return Promise.all(ids.map(id => muteUser(store, id)))\n },\n unmuteUsers (store, ids = []) {\n return Promise.all(ids.map(id => unmuteUser(store, id)))\n },\n fetchFriends ({ rootState, commit }, id) {\n const user = rootState.users.usersObject[id]\n const maxId = last(user.friendIds)\n return rootState.api.backendInteractor.fetchFriends({ id, maxId })\n .then((friends) => {\n commit('addNewUsers', friends)\n commit('saveFriendIds', { id, friendIds: map(friends, 'id') })\n return friends\n })\n },\n fetchFollowers ({ rootState, commit }, id) {\n const user = rootState.users.usersObject[id]\n const maxId = last(user.followerIds)\n return rootState.api.backendInteractor.fetchFollowers({ id, maxId })\n .then((followers) => {\n commit('addNewUsers', followers)\n commit('saveFollowerIds', { id, followerIds: map(followers, 'id') })\n return followers\n })\n },\n clearFriends ({ commit }, userId) {\n commit('clearFriends', userId)\n },\n clearFollowers ({ commit }, userId) {\n commit('clearFollowers', userId)\n },\n subscribeUser ({ rootState, commit }, id) {\n return rootState.api.backendInteractor.subscribeUser(id)\n .then((relationship) => commit('updateUserRelationship', [relationship]))\n },\n unsubscribeUser ({ rootState, commit }, id) {\n return rootState.api.backendInteractor.unsubscribeUser(id)\n .then((relationship) => commit('updateUserRelationship', [relationship]))\n },\n registerPushNotifications (store) {\n const token = store.state.currentUser.credentials\n const vapidPublicKey = store.rootState.instance.vapidPublicKey\n const isEnabled = store.rootState.config.webPushNotifications\n const notificationVisibility = store.rootState.config.notificationVisibility\n\n registerPushNotifications(isEnabled, vapidPublicKey, token, notificationVisibility)\n },\n unregisterPushNotifications (store) {\n const token = store.state.currentUser.credentials\n\n unregisterPushNotifications(token)\n },\n addNewUsers ({ commit }, users) {\n commit('addNewUsers', users)\n },\n addNewStatuses (store, { statuses }) {\n const users = map(statuses, 'user')\n const retweetedUsers = compact(map(statuses, 'retweeted_status.user'))\n store.commit('addNewUsers', users)\n store.commit('addNewUsers', retweetedUsers)\n\n each(statuses, (status) => {\n // Reconnect users to statuses\n store.commit('setUserForStatus', status)\n // Set pinned statuses to user\n store.commit('setPinnedToUser', status)\n })\n each(compact(map(statuses, 'retweeted_status')), (status) => {\n // Reconnect users to retweets\n store.commit('setUserForStatus', status)\n // Set pinned retweets to user\n store.commit('setPinnedToUser', status)\n })\n },\n addNewNotifications (store, { notifications }) {\n const users = map(notifications, 'from_profile')\n const notificationIds = notifications.map(_ => _.id)\n store.commit('addNewUsers', users)\n\n const notificationsObject = store.rootState.statuses.notifications.idStore\n const relevantNotifications = Object.entries(notificationsObject)\n .filter(([k, val]) => notificationIds.includes(k))\n .map(([k, val]) => val)\n\n // Reconnect users to notifications\n each(relevantNotifications, (notification) => {\n store.commit('setUserForNotification', notification)\n })\n },\n searchUsers (store, query) {\n return store.rootState.api.backendInteractor.searchUsers(query)\n .then((users) => {\n store.commit('addNewUsers', users)\n return users\n })\n },\n async signUp (store, userInfo) {\n store.commit('signUpPending')\n\n let rootState = store.rootState\n\n try {\n let data = await rootState.api.backendInteractor.register(userInfo)\n store.commit('signUpSuccess')\n store.commit('setToken', data.access_token)\n store.dispatch('loginUser', data.access_token)\n } catch (e) {\n let errors = e.message\n store.commit('signUpFailure', errors)\n throw e\n }\n },\n async getCaptcha (store) {\n return store.rootState.api.backendInteractor.getCaptcha()\n },\n\n logout (store) {\n const { oauth, instance } = store.rootState\n\n const data = {\n ...oauth,\n commit: store.commit,\n instance: instance.server\n }\n\n return oauthApi.getOrCreateApp(data)\n .then((app) => {\n const params = {\n app,\n instance: data.instance,\n token: oauth.userToken\n }\n\n return oauthApi.revokeToken(params)\n })\n .then(() => {\n store.commit('clearCurrentUser')\n store.dispatch('disconnectFromSocket')\n store.commit('clearToken')\n store.dispatch('stopFetching', 'friends')\n store.commit('setBackendInteractor', backendInteractorService(store.getters.getToken()))\n store.dispatch('stopFetching', 'notifications')\n store.commit('clearNotifications')\n store.commit('resetStatuses')\n })\n },\n loginUser (store, accessToken) {\n return new Promise((resolve, reject) => {\n const commit = store.commit\n commit('beginLogin')\n store.rootState.api.backendInteractor.verifyCredentials(accessToken)\n .then((data) => {\n if (!data.error) {\n const user = data\n // user.credentials = userCredentials\n user.credentials = accessToken\n user.blockIds = []\n user.muteIds = []\n commit('setCurrentUser', user)\n commit('addNewUsers', [user])\n\n store.dispatch('fetchEmoji')\n\n getNotificationPermission()\n .then(permission => commit('setNotificationPermission', permission))\n\n // Set our new backend interactor\n commit('setBackendInteractor', backendInteractorService(accessToken))\n\n if (user.token) {\n store.dispatch('setWsToken', user.token)\n\n // Initialize the chat socket.\n store.dispatch('initializeSocket')\n }\n\n // Start getting fresh posts.\n store.dispatch('startFetchingTimeline', { timeline: 'friends' })\n\n // Start fetching notifications\n store.dispatch('startFetchingNotifications')\n\n // Get user mutes\n store.dispatch('fetchMutes')\n\n // Fetch our friends\n store.rootState.api.backendInteractor.fetchFriends({ id: user.id })\n .then((friends) => commit('addNewUsers', friends))\n } else {\n const response = data.error\n // Authentication failed\n commit('endLogin')\n if (response.status === 401) {\n reject(new Error('Wrong username or password'))\n } else {\n reject(new Error('An error occurred, please try again'))\n }\n }\n commit('endLogin')\n resolve()\n })\n .catch((error) => {\n console.log(error)\n commit('endLogin')\n reject(new Error('Failed to connect to server, try again'))\n })\n })\n }\n }\n}\n\nexport default users\n","import runtime from 'serviceworker-webpack-plugin/lib/runtime'\n\nfunction urlBase64ToUint8Array (base64String) {\n const padding = '='.repeat((4 - base64String.length % 4) % 4)\n const base64 = (base64String + padding)\n .replace(/-/g, '+')\n .replace(/_/g, '/')\n\n const rawData = window.atob(base64)\n return Uint8Array.from([...rawData].map((char) => char.charCodeAt(0)))\n}\n\nfunction isPushSupported () {\n return 'serviceWorker' in navigator && 'PushManager' in window\n}\n\nfunction getOrCreateServiceWorker () {\n return runtime.register()\n .catch((err) => console.error('Unable to get or create a service worker.', err))\n}\n\nfunction subscribePush (registration, isEnabled, vapidPublicKey) {\n if (!isEnabled) return Promise.reject(new Error('Web Push is disabled in config'))\n if (!vapidPublicKey) return Promise.reject(new Error('VAPID public key is not found'))\n\n const subscribeOptions = {\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(vapidPublicKey)\n }\n return registration.pushManager.subscribe(subscribeOptions)\n}\n\nfunction unsubscribePush (registration) {\n return registration.pushManager.getSubscription()\n .then((subscribtion) => {\n if (subscribtion === null) { return }\n return subscribtion.unsubscribe()\n })\n}\n\nfunction deleteSubscriptionFromBackEnd (token) {\n return window.fetch('/api/v1/push/subscription/', {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${token}`\n }\n }).then((response) => {\n if (!response.ok) throw new Error('Bad status code from server.')\n return response\n })\n}\n\nfunction sendSubscriptionToBackEnd (subscription, token, notificationVisibility) {\n return window.fetch('/api/v1/push/subscription/', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${token}`\n },\n body: JSON.stringify({\n subscription,\n data: {\n alerts: {\n follow: notificationVisibility.follows,\n favourite: notificationVisibility.likes,\n mention: notificationVisibility.mentions,\n reblog: notificationVisibility.repeats\n }\n }\n })\n }).then((response) => {\n if (!response.ok) throw new Error('Bad status code from server.')\n return response.json()\n }).then((responseData) => {\n if (!responseData.id) throw new Error('Bad response from server.')\n return responseData\n })\n}\n\nexport function registerPushNotifications (isEnabled, vapidPublicKey, token, notificationVisibility) {\n if (isPushSupported()) {\n getOrCreateServiceWorker()\n .then((registration) => subscribePush(registration, isEnabled, vapidPublicKey))\n .then((subscription) => sendSubscriptionToBackEnd(subscription, token, notificationVisibility))\n .catch((e) => console.warn(`Failed to setup Web Push Notifications: ${e.message}`))\n }\n}\n\nexport function unregisterPushNotifications (token) {\n if (isPushSupported()) {\n Promise.all([\n deleteSubscriptionFromBackEnd(token),\n getOrCreateServiceWorker()\n .then((registration) => {\n return unsubscribePush(registration).then((result) => [registration, result])\n })\n .then(([registration, unsubResult]) => {\n if (!unsubResult) {\n console.warn('Push subscription cancellation wasn\\'t successful, killing SW anyway...')\n }\n return registration.unregister().then((result) => {\n if (!result) {\n console.warn('Failed to kill SW')\n }\n })\n })\n ]).catch((e) => console.warn(`Failed to disable Web Push Notifications: ${e.message}`))\n }\n}\n","import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'\nimport { Socket } from 'phoenix'\n\nconst api = {\n state: {\n backendInteractor: backendInteractorService(),\n fetchers: {},\n socket: null,\n followRequests: []\n },\n mutations: {\n setBackendInteractor (state, backendInteractor) {\n state.backendInteractor = backendInteractor\n },\n addFetcher (state, { fetcherName, fetcher }) {\n state.fetchers[fetcherName] = fetcher\n },\n removeFetcher (state, { fetcherName }) {\n delete state.fetchers[fetcherName]\n },\n setWsToken (state, token) {\n state.wsToken = token\n },\n setSocket (state, socket) {\n state.socket = socket\n },\n setFollowRequests (state, value) {\n state.followRequests = value\n }\n },\n actions: {\n startFetchingTimeline (store, { timeline = 'friends', tag = false, userId = false }) {\n // Don't start fetching if we already are.\n if (store.state.fetchers[timeline]) return\n\n const fetcher = store.state.backendInteractor.startFetchingTimeline({ timeline, store, userId, tag })\n store.commit('addFetcher', { fetcherName: timeline, fetcher })\n },\n startFetchingNotifications (store) {\n // Don't start fetching if we already are.\n if (store.state.fetchers['notifications']) return\n\n const fetcher = store.state.backendInteractor.startFetchingNotifications({ store })\n store.commit('addFetcher', { fetcherName: 'notifications', fetcher })\n },\n stopFetching (store, fetcherName) {\n const fetcher = store.state.fetchers[fetcherName]\n window.clearInterval(fetcher)\n store.commit('removeFetcher', { fetcherName })\n },\n setWsToken (store, token) {\n store.commit('setWsToken', token)\n },\n initializeSocket ({ dispatch, commit, state, rootState }) {\n // Set up websocket connection\n const token = state.wsToken\n if (rootState.instance.chatAvailable && typeof token !== 'undefined' && state.socket === null) {\n const socket = new Socket('/socket', { params: { token } })\n socket.connect()\n\n commit('setSocket', socket)\n dispatch('initializeChat', socket)\n }\n },\n disconnectFromSocket ({ commit, state }) {\n state.socket && state.socket.disconnect()\n commit('setSocket', null)\n },\n removeFollowRequest (store, request) {\n let requests = store.state.followRequests.filter((it) => it !== request)\n store.commit('setFollowRequests', requests)\n }\n }\n}\n\nexport default api\n","const chat = {\n state: {\n messages: [],\n channel: { state: '' }\n },\n mutations: {\n setChannel (state, channel) {\n state.channel = channel\n },\n addMessage (state, message) {\n state.messages.push(message)\n state.messages = state.messages.slice(-19, 20)\n },\n setMessages (state, messages) {\n state.messages = messages.slice(-19, 20)\n }\n },\n actions: {\n initializeChat (store, socket) {\n const channel = socket.channel('chat:public')\n channel.on('new_msg', (msg) => {\n store.commit('addMessage', msg)\n })\n channel.on('messages', ({ messages }) => {\n store.commit('setMessages', messages)\n })\n channel.join()\n store.commit('setChannel', channel)\n }\n }\n}\n\nexport default chat\n","import { delete as del } from 'vue'\n\nconst oauth = {\n state: {\n clientId: false,\n clientSecret: false,\n /* App token is authentication for app without any user, used mostly for\n * MastoAPI's registration of new users, stored so that we can fall back to\n * it on logout\n */\n appToken: false,\n /* User token is authentication for app with user, this is for every calls\n * that need authorized user to be successful (i.e. posting, liking etc)\n */\n userToken: false\n },\n mutations: {\n setClientData (state, { clientId, clientSecret }) {\n state.clientId = clientId\n state.clientSecret = clientSecret\n },\n setAppToken (state, token) {\n state.appToken = token\n },\n setToken (state, token) {\n state.userToken = token\n },\n clearToken (state) {\n state.userToken = false\n // state.token is userToken with older name, coming from persistent state\n // let's clear it as well, since it is being used as a fallback of state.userToken\n del(state, 'token')\n }\n },\n getters: {\n getToken: state => () => {\n // state.token is userToken with older name, coming from persistent state\n // added here for smoother transition, otherwise user will be logged out\n return state.userToken || state.token || state.appToken\n },\n getUserToken: state => () => {\n // state.token is userToken with older name, coming from persistent state\n // added here for smoother transition, otherwise user will be logged out\n return state.userToken || state.token\n }\n }\n}\n\nexport default oauth\n","const PASSWORD_STRATEGY = 'password'\nconst TOKEN_STRATEGY = 'token'\n\n// MFA strategies\nconst TOTP_STRATEGY = 'totp'\nconst RECOVERY_STRATEGY = 'recovery'\n\n// initial state\nconst state = {\n app: null,\n settings: {},\n strategy: PASSWORD_STRATEGY,\n initStrategy: PASSWORD_STRATEGY // default strategy from config\n}\n\nconst resetState = (state) => {\n state.strategy = state.initStrategy\n state.settings = {}\n state.app = null\n}\n\n// getters\nconst getters = {\n app: (state, getters) => {\n return state.app\n },\n settings: (state, getters) => {\n return state.settings\n },\n requiredPassword: (state, getters, rootState) => {\n return state.strategy === PASSWORD_STRATEGY\n },\n requiredToken: (state, getters, rootState) => {\n return state.strategy === TOKEN_STRATEGY\n },\n requiredTOTP: (state, getters, rootState) => {\n return state.strategy === TOTP_STRATEGY\n },\n requiredRecovery: (state, getters, rootState) => {\n return state.strategy === RECOVERY_STRATEGY\n }\n}\n\n// mutations\nconst mutations = {\n setInitialStrategy (state, strategy) {\n if (strategy) {\n state.initStrategy = strategy\n state.strategy = strategy\n }\n },\n requirePassword (state) {\n state.strategy = PASSWORD_STRATEGY\n },\n requireToken (state) {\n state.strategy = TOKEN_STRATEGY\n },\n requireMFA (state, { app, settings }) {\n state.settings = settings\n state.app = app\n state.strategy = TOTP_STRATEGY // default strategy of MFA\n },\n requireRecovery (state) {\n state.strategy = RECOVERY_STRATEGY\n },\n requireTOTP (state) {\n state.strategy = TOTP_STRATEGY\n },\n abortMFA (state) {\n resetState(state)\n }\n}\n\n// actions\nconst actions = {\n // eslint-disable-next-line camelcase\n async login ({ state, dispatch, commit }, { access_token }) {\n commit('setToken', access_token, { root: true })\n await dispatch('loginUser', access_token, { root: true })\n resetState(state)\n }\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations,\n actions\n}\n","import fileTypeService from '../services/file_type/file_type.service.js'\n\nconst mediaViewer = {\n state: {\n media: [],\n currentIndex: 0,\n activated: false\n },\n mutations: {\n setMedia (state, media) {\n state.media = media\n },\n setCurrent (state, index) {\n state.activated = true\n state.currentIndex = index\n },\n close (state) {\n state.activated = false\n }\n },\n actions: {\n setMedia ({ commit }, attachments) {\n const media = attachments.filter(attachment => {\n const type = fileTypeService.fileType(attachment.mimetype)\n return type === 'image' || type === 'video'\n })\n commit('setMedia', media)\n },\n setCurrent ({ commit, state }, current) {\n const index = state.media.indexOf(current)\n commit('setCurrent', index || 0)\n },\n closeMediaViewer ({ commit }) {\n commit('close')\n }\n }\n}\n\nexport default mediaViewer\n","const oauthTokens = {\n state: {\n tokens: []\n },\n actions: {\n fetchTokens ({ rootState, commit }) {\n rootState.api.backendInteractor.fetchOAuthTokens().then((tokens) => {\n commit('swapTokens', tokens)\n })\n },\n revokeToken ({ rootState, commit, state }, id) {\n rootState.api.backendInteractor.revokeOAuthToken(id).then((response) => {\n if (response.status === 201) {\n commit('swapTokens', state.tokens.filter(token => token.id !== id))\n }\n })\n }\n },\n mutations: {\n swapTokens (state, tokens) {\n state.tokens = tokens\n }\n }\n}\n\nexport default oauthTokens\n","import filter from 'lodash/filter'\n\nconst reports = {\n state: {\n userId: null,\n statuses: [],\n modalActivated: false\n },\n mutations: {\n openUserReportingModal (state, { userId, statuses }) {\n state.userId = userId\n state.statuses = statuses\n state.modalActivated = true\n },\n closeUserReportingModal (state) {\n state.modalActivated = false\n }\n },\n actions: {\n openUserReportingModal ({ rootState, commit }, userId) {\n const statuses = filter(rootState.statuses.allStatuses, status => status.user.id === userId)\n commit('openUserReportingModal', { userId, statuses })\n },\n closeUserReportingModal ({ commit }) {\n commit('closeUserReportingModal')\n }\n }\n}\n\nexport default reports\n","import { merge } from 'lodash'\nimport { set } from 'vue'\n\nconst polls = {\n state: {\n // Contains key = id, value = number of trackers for this poll\n trackedPolls: {},\n pollsObject: {}\n },\n mutations: {\n mergeOrAddPoll (state, poll) {\n const existingPoll = state.pollsObject[poll.id]\n // Make expired-state change trigger re-renders properly\n poll.expired = Date.now() > Date.parse(poll.expires_at)\n if (existingPoll) {\n set(state.pollsObject, poll.id, merge(existingPoll, poll))\n } else {\n set(state.pollsObject, poll.id, poll)\n }\n },\n trackPoll (state, pollId) {\n const currentValue = state.trackedPolls[pollId]\n if (currentValue) {\n set(state.trackedPolls, pollId, currentValue + 1)\n } else {\n set(state.trackedPolls, pollId, 1)\n }\n },\n untrackPoll (state, pollId) {\n const currentValue = state.trackedPolls[pollId]\n if (currentValue) {\n set(state.trackedPolls, pollId, currentValue - 1)\n } else {\n set(state.trackedPolls, pollId, 0)\n }\n }\n },\n actions: {\n mergeOrAddPoll ({ commit }, poll) {\n commit('mergeOrAddPoll', poll)\n },\n updateTrackedPoll ({ rootState, dispatch, commit }, pollId) {\n rootState.api.backendInteractor.fetchPoll(pollId).then(poll => {\n setTimeout(() => {\n if (rootState.polls.trackedPolls[pollId]) {\n dispatch('updateTrackedPoll', pollId)\n }\n }, 30 * 1000)\n commit('mergeOrAddPoll', poll)\n })\n },\n trackPoll ({ rootState, commit, dispatch }, pollId) {\n if (!rootState.polls.trackedPolls[pollId]) {\n setTimeout(() => dispatch('updateTrackedPoll', pollId), 30 * 1000)\n }\n commit('trackPoll', pollId)\n },\n untrackPoll ({ commit }, pollId) {\n commit('untrackPoll', pollId)\n },\n votePoll ({ rootState, commit }, { id, pollId, choices }) {\n return rootState.api.backendInteractor.vote(pollId, choices).then(poll => {\n commit('mergeOrAddPoll', poll)\n return poll\n })\n }\n }\n}\n\nexport default polls\n","const postStatus = {\n state: {\n params: null,\n modalActivated: false\n },\n mutations: {\n openPostStatusModal (state, params) {\n state.params = params\n state.modalActivated = true\n },\n closePostStatusModal (state) {\n state.modalActivated = false\n }\n },\n actions: {\n openPostStatusModal ({ commit }, params) {\n commit('openPostStatusModal', params)\n },\n closePostStatusModal ({ commit }) {\n commit('closePostStatusModal')\n }\n }\n}\n\nexport default postStatus\n","import merge from 'lodash.merge'\nimport objectPath from 'object-path'\nimport localforage from 'localforage'\nimport { each } from 'lodash'\n\nlet loaded = false\n\nconst defaultReducer = (state, paths) => (\n paths.length === 0 ? state : paths.reduce((substate, path) => {\n objectPath.set(substate, path, objectPath.get(state, path))\n return substate\n }, {})\n)\n\nconst saveImmedeatelyActions = [\n 'markNotificationsAsSeen',\n 'clearCurrentUser',\n 'setCurrentUser',\n 'setHighlight',\n 'setOption',\n 'setClientData',\n 'setToken',\n 'clearToken'\n]\n\nconst defaultStorage = (() => {\n return localforage\n})()\n\nexport default function createPersistedState ({\n key = 'vuex-lz',\n paths = [],\n getState = (key, storage) => {\n let value = storage.getItem(key)\n return value\n },\n setState = (key, state, storage) => {\n if (!loaded) {\n console.log('waiting for old state to be loaded...')\n return Promise.resolve()\n } else {\n return storage.setItem(key, state)\n }\n },\n reducer = defaultReducer,\n storage = defaultStorage,\n subscriber = store => handler => store.subscribe(handler)\n} = {}) {\n return getState(key, storage).then((savedState) => {\n return store => {\n try {\n if (savedState !== null && typeof savedState === 'object') {\n // build user cache\n const usersState = savedState.users || {}\n usersState.usersObject = {}\n const users = usersState.users || []\n each(users, (user) => { usersState.usersObject[user.id] = user })\n savedState.users = usersState\n\n store.replaceState(\n merge({}, store.state, savedState)\n )\n }\n loaded = true\n } catch (e) {\n console.log(\"Couldn't load state\")\n console.error(e)\n loaded = true\n }\n subscriber(store)((mutation, state) => {\n try {\n if (saveImmedeatelyActions.includes(mutation.type)) {\n setState(key, reducer(state, paths), storage)\n .then(success => {\n if (typeof success !== 'undefined') {\n if (mutation.type === 'setOption' || mutation.type === 'setCurrentUser') {\n store.dispatch('settingsSaved', { success })\n }\n }\n }, error => {\n if (mutation.type === 'setOption' || mutation.type === 'setCurrentUser') {\n store.dispatch('settingsSaved', { error })\n }\n })\n }\n } catch (e) {\n console.log(\"Couldn't persist state:\")\n console.log(e)\n }\n })\n }\n })\n}\n","export default (store) => {\n store.subscribe((mutation, state) => {\n const vapidPublicKey = state.instance.vapidPublicKey\n const webPushNotification = state.config.webPushNotifications\n const permission = state.interface.notificationPermission === 'granted'\n const user = state.users.currentUser\n\n const isUserMutation = mutation.type === 'setCurrentUser'\n const isVapidMutation = mutation.type === 'setInstanceOption' && mutation.payload.name === 'vapidPublicKey'\n const isPermMutation = mutation.type === 'setNotificationPermission' && mutation.payload === 'granted'\n const isUserConfigMutation = mutation.type === 'setOption' && mutation.payload.name === 'webPushNotifications'\n const isVisibilityMutation = mutation.type === 'setOption' && mutation.payload.name === 'notificationVisibility'\n\n if (isUserMutation || isVapidMutation || isPermMutation || isUserConfigMutation || isVisibilityMutation) {\n if (user && vapidPublicKey && permission && webPushNotification) {\n return store.dispatch('registerPushNotifications')\n } else if (isUserConfigMutation && !webPushNotification) {\n return store.dispatch('unregisterPushNotifications')\n }\n }\n })\n}\n","import * as bodyScrollLock from 'body-scroll-lock'\n\nlet previousNavPaddingRight\nlet previousAppBgWrapperRight\nconst lockerEls = new Set([])\n\nconst disableBodyScroll = (el) => {\n const scrollBarGap = window.innerWidth - document.documentElement.clientWidth\n bodyScrollLock.disableBodyScroll(el, {\n reserveScrollBarGap: true\n })\n lockerEls.add(el)\n setTimeout(() => {\n if (lockerEls.size <= 1) {\n // If previousNavPaddingRight is already set, don't set it again.\n if (previousNavPaddingRight === undefined) {\n const navEl = document.getElementById('nav')\n previousNavPaddingRight = window.getComputedStyle(navEl).getPropertyValue('padding-right')\n navEl.style.paddingRight = previousNavPaddingRight ? `calc(${previousNavPaddingRight} + ${scrollBarGap}px)` : `${scrollBarGap}px`\n }\n // If previousAppBgWrapeprRight is already set, don't set it again.\n if (previousAppBgWrapperRight === undefined) {\n const appBgWrapperEl = document.getElementById('app_bg_wrapper')\n previousAppBgWrapperRight = window.getComputedStyle(appBgWrapperEl).getPropertyValue('right')\n appBgWrapperEl.style.right = previousAppBgWrapperRight ? `calc(${previousAppBgWrapperRight} + ${scrollBarGap}px)` : `${scrollBarGap}px`\n }\n document.body.classList.add('scroll-locked')\n }\n })\n}\n\nconst enableBodyScroll = (el) => {\n lockerEls.delete(el)\n setTimeout(() => {\n if (lockerEls.size === 0) {\n if (previousNavPaddingRight !== undefined) {\n document.getElementById('nav').style.paddingRight = previousNavPaddingRight\n // Restore previousNavPaddingRight to undefined so disableBodyScroll knows it can be set again.\n previousNavPaddingRight = undefined\n }\n if (previousAppBgWrapperRight !== undefined) {\n document.getElementById('app_bg_wrapper').style.right = previousAppBgWrapperRight\n // Restore previousAppBgWrapperRight to undefined so disableBodyScroll knows it can be set again.\n previousAppBgWrapperRight = undefined\n }\n document.body.classList.remove('scroll-locked')\n }\n })\n bodyScrollLock.enableBodyScroll(el)\n}\n\nconst directive = {\n inserted: (el, binding) => {\n if (binding.value) {\n disableBodyScroll(el)\n }\n },\n componentUpdated: (el, binding) => {\n if (binding.oldValue === binding.value) {\n return\n }\n\n if (binding.value) {\n disableBodyScroll(el)\n } else {\n enableBodyScroll(el)\n }\n },\n unbind: (el) => {\n enableBodyScroll(el)\n }\n}\n\nexport default (Vue) => {\n Vue.directive('body-scroll-lock', directive)\n}\n","import Vue from 'vue'\nimport VueRouter from 'vue-router'\nimport routes from './routes'\nimport App from '../App.vue'\nimport { windowWidth } from '../services/window_utils/window_utils'\nimport { getOrCreateApp, getClientToken } from '../services/new_api/oauth.js'\nimport backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js'\n\nconst getStatusnetConfig = async ({ store }) => {\n try {\n const res = await window.fetch('/api/statusnet/config.json')\n if (res.ok) {\n const data = await res.json()\n const { name, closed: registrationClosed, textlimit, uploadlimit, server, vapidPublicKey, safeDMMentionsEnabled } = data.site\n\n store.dispatch('setInstanceOption', { name: 'name', value: name })\n store.dispatch('setInstanceOption', { name: 'registrationOpen', value: (registrationClosed === '0') })\n store.dispatch('setInstanceOption', { name: 'textlimit', value: parseInt(textlimit) })\n store.dispatch('setInstanceOption', { name: 'server', value: server })\n store.dispatch('setInstanceOption', { name: 'safeDM', value: safeDMMentionsEnabled !== '0' })\n\n // TODO: default values for this stuff, added if to not make it break on\n // my dev config out of the box.\n if (uploadlimit) {\n store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadlimit.uploadlimit) })\n store.dispatch('setInstanceOption', { name: 'avatarlimit', value: parseInt(uploadlimit.avatarlimit) })\n store.dispatch('setInstanceOption', { name: 'backgroundlimit', value: parseInt(uploadlimit.backgroundlimit) })\n store.dispatch('setInstanceOption', { name: 'bannerlimit', value: parseInt(uploadlimit.bannerlimit) })\n }\n\n if (vapidPublicKey) {\n store.dispatch('setInstanceOption', { name: 'vapidPublicKey', value: vapidPublicKey })\n }\n\n return data.site.pleromafe\n } else {\n throw (res)\n }\n } catch (error) {\n console.error('Could not load statusnet config, potentially fatal')\n console.error(error)\n }\n}\n\nconst getStaticConfig = async () => {\n try {\n const res = await window.fetch('/static/config.json')\n if (res.ok) {\n return res.json()\n } else {\n throw (res)\n }\n } catch (error) {\n console.warn('Failed to load static/config.json, continuing without it.')\n console.warn(error)\n return {}\n }\n}\n\nconst setSettings = async ({ apiConfig, staticConfig, store }) => {\n const overrides = window.___pleromafe_dev_overrides || {}\n const env = window.___pleromafe_mode.NODE_ENV\n\n // This takes static config and overrides properties that are present in apiConfig\n let config = {}\n if (overrides.staticConfigPreference && env === 'development') {\n console.warn('OVERRIDING API CONFIG WITH STATIC CONFIG')\n config = Object.assign({}, apiConfig, staticConfig)\n } else {\n config = Object.assign({}, staticConfig, apiConfig)\n }\n\n const copyInstanceOption = (name) => {\n store.dispatch('setInstanceOption', { name, value: config[name] })\n }\n\n copyInstanceOption('nsfwCensorImage')\n copyInstanceOption('background')\n copyInstanceOption('hidePostStats')\n copyInstanceOption('hideUserStats')\n copyInstanceOption('hideFilteredStatuses')\n copyInstanceOption('logo')\n\n store.dispatch('setInstanceOption', {\n name: 'logoMask',\n value: typeof config.logoMask === 'undefined'\n ? true\n : config.logoMask\n })\n\n store.dispatch('setInstanceOption', {\n name: 'logoMargin',\n value: typeof config.logoMargin === 'undefined'\n ? 0\n : config.logoMargin\n })\n store.commit('authFlow/setInitialStrategy', config.loginMethod)\n\n copyInstanceOption('redirectRootNoLogin')\n copyInstanceOption('redirectRootLogin')\n copyInstanceOption('showInstanceSpecificPanel')\n copyInstanceOption('minimalScopesMode')\n copyInstanceOption('hideMutedPosts')\n copyInstanceOption('collapseMessageWithSubject')\n copyInstanceOption('scopeCopy')\n copyInstanceOption('subjectLineBehavior')\n copyInstanceOption('postContentType')\n copyInstanceOption('alwaysShowSubjectInput')\n copyInstanceOption('noAttachmentLinks')\n copyInstanceOption('showFeaturesPanel')\n\n return store.dispatch('setTheme', config['theme'])\n}\n\nconst getTOS = async ({ store }) => {\n try {\n const res = await window.fetch('/static/terms-of-service.html')\n if (res.ok) {\n const html = await res.text()\n store.dispatch('setInstanceOption', { name: 'tos', value: html })\n } else {\n throw (res)\n }\n } catch (e) {\n console.warn(\"Can't load TOS\")\n console.warn(e)\n }\n}\n\nconst getInstancePanel = async ({ store }) => {\n try {\n const res = await window.fetch('/instance/panel.html')\n if (res.ok) {\n const html = await res.text()\n store.dispatch('setInstanceOption', { name: 'instanceSpecificPanelContent', value: html })\n } else {\n throw (res)\n }\n } catch (e) {\n console.warn(\"Can't load instance panel\")\n console.warn(e)\n }\n}\n\nconst getStickers = async ({ store }) => {\n try {\n const res = await window.fetch('/static/stickers.json')\n if (res.ok) {\n const values = await res.json()\n const stickers = (await Promise.all(\n Object.entries(values).map(async ([name, path]) => {\n const resPack = await window.fetch(path + 'pack.json')\n var meta = {}\n if (resPack.ok) {\n meta = await resPack.json()\n }\n return {\n pack: name,\n path,\n meta\n }\n })\n )).sort((a, b) => {\n return a.meta.title.localeCompare(b.meta.title)\n })\n store.dispatch('setInstanceOption', { name: 'stickers', value: stickers })\n } else {\n throw (res)\n }\n } catch (e) {\n console.warn(\"Can't load stickers\")\n console.warn(e)\n }\n}\n\nconst getAppSecret = async ({ store }) => {\n const { state, commit } = store\n const { oauth, instance } = state\n return getOrCreateApp({ ...oauth, instance: instance.server, commit })\n .then((app) => getClientToken({ ...app, instance: instance.server }))\n .then((token) => {\n commit('setAppToken', token.access_token)\n commit('setBackendInteractor', backendInteractorService(store.getters.getToken()))\n })\n}\n\nconst getNodeInfo = async ({ store }) => {\n try {\n const res = await window.fetch('/nodeinfo/2.0.json')\n if (res.ok) {\n const data = await res.json()\n const metadata = data.metadata\n const features = metadata.features\n store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') })\n store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') })\n store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })\n store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') })\n store.dispatch('setInstanceOption', { name: 'pollLimits', value: metadata.pollLimits })\n store.dispatch('setInstanceOption', { name: 'mailerEnabled', value: metadata.mailerEnabled })\n\n store.dispatch('setInstanceOption', { name: 'restrictedNicknames', value: metadata.restrictedNicknames })\n store.dispatch('setInstanceOption', { name: 'postFormats', value: metadata.postFormats })\n\n const suggestions = metadata.suggestions\n store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled })\n store.dispatch('setInstanceOption', { name: 'suggestionsWeb', value: suggestions.web })\n\n const software = data.software\n store.dispatch('setInstanceOption', { name: 'backendVersion', value: software.version })\n store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: software.name === 'pleroma' })\n\n const frontendVersion = window.___pleromafe_commit_hash\n store.dispatch('setInstanceOption', { name: 'frontendVersion', value: frontendVersion })\n store.dispatch('setInstanceOption', { name: 'tagPolicyAvailable', value: metadata.federation.mrf_policies.includes('TagPolicy') })\n } else {\n throw (res)\n }\n } catch (e) {\n console.warn('Could not load nodeinfo')\n console.warn(e)\n }\n}\n\nconst setConfig = async ({ store }) => {\n // apiConfig, staticConfig\n const configInfos = await Promise.all([getStatusnetConfig({ store }), getStaticConfig()])\n const apiConfig = configInfos[0]\n const staticConfig = configInfos[1]\n\n await setSettings({ store, apiConfig, staticConfig }).then(getAppSecret({ store }))\n}\n\nconst checkOAuthToken = async ({ store }) => {\n return new Promise(async (resolve, reject) => {\n if (store.getters.getUserToken()) {\n try {\n await store.dispatch('loginUser', store.getters.getUserToken())\n } catch (e) {\n console.log(e)\n }\n }\n resolve()\n })\n}\n\nconst afterStoreSetup = async ({ store, i18n }) => {\n if (store.state.config.customTheme) {\n // This is a hack to deal with async loading of config.json and themes\n // See: style_setter.js, setPreset()\n window.themeLoaded = true\n store.dispatch('setOption', {\n name: 'customTheme',\n value: store.state.config.customTheme\n })\n }\n\n const width = windowWidth()\n store.dispatch('setMobileLayout', width <= 800)\n\n // Now we can try getting the server settings and logging in\n await Promise.all([\n checkOAuthToken({ store }),\n setConfig({ store }),\n getTOS({ store }),\n getInstancePanel({ store }),\n getStickers({ store }),\n getNodeInfo({ store })\n ])\n\n const router = new VueRouter({\n mode: 'history',\n routes: routes(store),\n scrollBehavior: (to, _from, savedPosition) => {\n if (to.matched.some(m => m.meta.dontScroll)) {\n return false\n }\n return savedPosition || { x: 0, y: 0 }\n }\n })\n\n /* eslint-disable no-new */\n return new Vue({\n router,\n store,\n i18n,\n el: '#app',\n render: h => h(App)\n })\n}\n\nexport default afterStoreSetup\n","import PublicTimeline from 'components/public_timeline/public_timeline.vue'\nimport PublicAndExternalTimeline from 'components/public_and_external_timeline/public_and_external_timeline.vue'\nimport FriendsTimeline from 'components/friends_timeline/friends_timeline.vue'\nimport TagTimeline from 'components/tag_timeline/tag_timeline.vue'\nimport ConversationPage from 'components/conversation-page/conversation-page.vue'\nimport Interactions from 'components/interactions/interactions.vue'\nimport DMs from 'components/dm_timeline/dm_timeline.vue'\nimport UserProfile from 'components/user_profile/user_profile.vue'\nimport Search from 'components/search/search.vue'\nimport Settings from 'components/settings/settings.vue'\nimport Registration from 'components/registration/registration.vue'\nimport PasswordReset from 'components/password_reset/password_reset.vue'\nimport UserSettings from 'components/user_settings/user_settings.vue'\nimport FollowRequests from 'components/follow_requests/follow_requests.vue'\nimport OAuthCallback from 'components/oauth_callback/oauth_callback.vue'\nimport Notifications from 'components/notifications/notifications.vue'\nimport AuthForm from 'components/auth_form/auth_form.js'\nimport ChatPanel from 'components/chat_panel/chat_panel.vue'\nimport WhoToFollow from 'components/who_to_follow/who_to_follow.vue'\nimport About from 'components/about/about.vue'\nimport RemoteUserResolver from 'components/remote_user_resolver/remote_user_resolver.vue'\n\nexport default (store) => {\n const validateAuthenticatedRoute = (to, from, next) => {\n if (store.state.users.currentUser) {\n next()\n } else {\n next(store.state.instance.redirectRootNoLogin || '/main/all')\n }\n }\n\n return [\n { name: 'root',\n path: '/',\n redirect: _to => {\n return (store.state.users.currentUser\n ? store.state.instance.redirectRootLogin\n : store.state.instance.redirectRootNoLogin) || '/main/all'\n }\n },\n { name: 'public-external-timeline', path: '/main/all', component: PublicAndExternalTimeline },\n { name: 'public-timeline', path: '/main/public', component: PublicTimeline },\n { name: 'friends', path: '/main/friends', component: FriendsTimeline, beforeEnter: validateAuthenticatedRoute },\n { name: 'tag-timeline', path: '/tag/:tag', component: TagTimeline },\n { name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },\n { name: 'remote-user-profile-acct',\n path: '/remote-users/(@?):username([^/@]+)@:hostname([^/@]+)',\n component: RemoteUserResolver,\n beforeEnter: validateAuthenticatedRoute\n },\n { name: 'remote-user-profile',\n path: '/remote-users/:hostname/:username',\n component: RemoteUserResolver,\n beforeEnter: validateAuthenticatedRoute\n },\n { name: 'external-user-profile', path: '/users/:id', component: UserProfile },\n { name: 'interactions', path: '/users/:username/interactions', component: Interactions, beforeEnter: validateAuthenticatedRoute },\n { name: 'dms', path: '/users/:username/dms', component: DMs, beforeEnter: validateAuthenticatedRoute },\n { name: 'settings', path: '/settings', component: Settings },\n { name: 'registration', path: '/registration', component: Registration },\n { name: 'password-reset', path: '/password-reset', component: PasswordReset, props: true },\n { name: 'registration-token', path: '/registration/:token', component: Registration },\n { name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute },\n { name: 'user-settings', path: '/user-settings', component: UserSettings, beforeEnter: validateAuthenticatedRoute },\n { name: 'notifications', path: '/:username/notifications', component: Notifications, beforeEnter: validateAuthenticatedRoute },\n { name: 'login', path: '/login', component: AuthForm },\n { name: 'chat', path: '/chat', component: ChatPanel, props: () => ({ floating: false }) },\n { name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },\n { name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },\n { name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },\n { name: 'about', path: '/about', component: About },\n { name: 'user-profile', path: '/(users/)?:name', component: UserProfile }\n ]\n}\n","/* script */\nexport * from \"!!babel-loader!./public_timeline.js\"\nimport __vue_script__ from \"!!babel-loader!./public_timeline.js\"/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5f2a502e\\\",\\\"hasScoped\\\":false,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../node_modules/vue-loader/lib/selector?type=template&index=0!./public_timeline.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n","// style-loader: Adds some css to the DOM by adding a