<?php if (! $__env->hasRenderedOnce('45f40a12-07a3-49c8-a046-9f7d49dd442a')): $__env->markAsRenderedOnce('45f40a12-07a3-49c8-a046-9f7d49dd442a'); ?>
        <style>
            .iran-plate {
                display: inline-flex;
                align-items: stretch;
                border: 2.5px solid #1a1a1a;
                border-radius: 6px;
                overflow: hidden;
                background: #fff;
                font-family: 'Yekan Bakh', 'Tahoma', sans-serif;
                height: 44px;
                min-width: 178px;
                box-shadow: 2px 2px 5px rgba(0,0,0,.18);
                direction: rtl;
                user-select: none;
            }
            .iran-plate.iran-plate-sm {
                height: 36px;
                min-width: 148px;
                transform-origin: right center;
            }
            .iran-plate .plate-right,
            .iran-plate .plate-letter,
            .iran-plate .plate-middle {
                display: flex;
                align-items: center;
                justify-content: center;
                background: #fff;
                color: #111;
                border-left: 2px solid #1a1a1a;
                font-weight: 700;
            }
            .iran-plate .plate-right {
                padding: 0 8px;
                min-width: 40px;
                font-size: 1.2rem;
                letter-spacing: 2px;
            }
            .iran-plate .plate-letter {
                padding: 0 6px;
                min-width: 30px;
                font-size: 1.35rem;
            }
            .iran-plate .plate-middle {
                padding: 0 8px;
                min-width: 56px;
                font-size: 1.2rem;
                letter-spacing: 2px;
            }
            .iran-plate .plate-iran-section {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                min-width: 50px;
                background: #1a3a8f;
                padding: 3px 6px;
                gap: 1px;
            }
            .iran-plate .plate-iran-flag {
                display: flex;
                width: 30px;
                height: 9px;
                overflow: hidden;
                border-radius: 1px;
                border: 0.5px solid rgba(255,255,255,0.4);
            }
            .iran-plate .flag-stripe { flex: 1; display: block; }
            .iran-plate .flag-green { background: #239f40; }
            .iran-plate .flag-white { background: #fff; }
            .iran-plate .flag-red { background: #da0000; }
            .iran-plate .plate-iran-text {
                color: #fff;
                font-size: .58rem;
                font-weight: 700;
                line-height: 1;
                letter-spacing: .5px;
                text-align: center;
                font-family: 'Tahoma', sans-serif;
            }
            .iran-plate .plate-iran-code {
                color: #fff;
                font-size: 1rem;
                font-weight: 700;
                line-height: 1.1;
                text-align: center;
                letter-spacing: 1px;
            }
            .iran-plate.iran-plate-sm .plate-right,
            .iran-plate.iran-plate-sm .plate-middle { font-size: 1rem; }
            .iran-plate.iran-plate-sm .plate-letter { font-size: 1.1rem; }
            .iran-plate.iran-plate-sm .plate-iran-code { font-size: .85rem; }
            .iran-plate-fallback {
                font-family: Consolas, monospace;
                direction: ltr;
                display: inline-block;
            }
        </style>
<?php endif; ?>

<?php
    $plate = $plate ?? null;
    $size = $size ?? 'md';
    $loadStylesOnly = $loadStylesOnly ?? false;
    $toPersianDigits = static function (?string $value): string {
        $value = (string) ($value ?? '');
        return strtr($value, ['0'=>'۰','1'=>'۱','2'=>'۲','3'=>'۳','4'=>'۴','5'=>'۵','6'=>'۶','7'=>'۷','8'=>'۸','9'=>'۹']);
    };
    $clean = preg_replace('/[\s\x{200c}\x{200f}-]+/u', '', (string) $plate);
    $clean = preg_replace('/ایران/u', '', $clean);
    $matches = [];
    $parsed = preg_match('/^(\d{2})([\p{Arabic}A-Za-z])(\d{3})(\d{2})$/u', $clean, $matches)
        ? [
            'right' => $toPersianDigits($matches[1]),
            'letter' => $matches[2],
            'middle' => $toPersianDigits($matches[3]),
            'iran_code' => $toPersianDigits($matches[4]),
        ]
        : null;
?>

<?php if($loadStylesOnly): ?>
<?php elseif($parsed): ?>
    <div class="iran-plate <?php echo e($size === 'sm' ? 'iran-plate-sm' : ''); ?>">
        <div class="plate-right"><?php echo e($parsed['right']); ?></div>
        <div class="plate-letter"><?php echo e($parsed['letter']); ?></div>
        <div class="plate-middle"><?php echo e($parsed['middle']); ?></div>
        <div class="plate-iran-section">
            <div class="plate-iran-flag">
                <span class="flag-stripe flag-green"></span>
                <span class="flag-stripe flag-white"></span>
                <span class="flag-stripe flag-red"></span>
            </div>
            <div class="plate-iran-text">ایران</div>
            <div class="plate-iran-code"><?php echo e($parsed['iran_code']); ?></div>
        </div>
    </div>
<?php elseif(!empty($plate)): ?>
    <span class="iran-plate-fallback"><?php echo e($plate); ?></span>
<?php else: ?>
    <span class="text-muted">-</span>
<?php endif; ?>
<?php /**PATH S:\wamp\www\sabok\temp-laravel\resources\views/admin/partials/iran-plate.blade.php ENDPATH**/ ?>