// Copyright (c) 2025 MatteuSan and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

@use '../core/validators';
@use 'sass:map';

$prefix-properties: (
  transition: (
    'webkit'
  ),
  box-shadow: (
    'webkit',
    'ms'
  ),
  background-clip: (
    'webkit'
  ),
  box-reflect: (
    'webkit'
  ),
  filter: (
    'webkit'
  ),
  word-break: (
    'ms'
  ),
  object-fit: (
    'o'
  ),
  transform: (
    'webkit',
    'ms'
  ),
  appearance: (
    'webkit',
    'moz'
  ),
  user-select: (
    'webkit',
    'moz',
    'ms'
  )
);

$prefix-values: ();

$_valid-prefixes: ('webkit', 'ms', 'moz', 'o');

@mixin _prefix-property($property, $value, $targets: all) {
  @if not validators.has-property($prefix-properties, $property) {

    #{$property}: $value;

  } @else {
    $_prefix-map: map.get($prefix-properties, $property);

    @each $prefix in $_prefix-map {
      #{'-' + $prefix + '-' + $property}: $value;
    }

    #{$property}: $value;
  }
}

@function _prefix-value($property, $value, $targets: all) {
  //
}

@mixin prefix($property, $value, $targets: all) {
  @warn 'WARNING [prefix()]: The prefix mixin will be deprecated in version 2.x. Please do not use this mixin in production code.';
  @include _prefix-property($property, $value, $targets);
}