<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;

/* @_uvdesk_extension_uvdesk_custom_fields/CustomFields/customFieldValidation.html.twig */
class __TwigTemplate_e24b6c74629c8797af2c4f946784ffd8 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 1
        yield "<script>
    customFieldValidation = {};
    customHandler = function(value, attr, computedState) {
        if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible') && !\$('[name=\"'+ attr + '[]' + '\"]').parents('.uv-element-block').is(':visible')) {
            return false;
        } else {
            var ele = \$('[name=\"'+ attr + '\"]');
            ele = ele.length ? ele : \$('[name=\"'+ attr + '[]' + '\"]');
            if(ele[0].type == 'radio') {
                var returnMe = true;
                \$.each(ele, function(key, eleChild) {
                    if(\$(eleChild).is(':checked')) {
                        returnMe = false;
                    }
                });
                return returnMe;
            } else if(ele[0].type == 'checkbox') {
                var returnMe = true;
                \$.each(ele, function(key, eleChild) {
                    if(\$(eleChild).is(':checked')) {
                        returnMe = false;
                    }
                });
                return returnMe;
            } else if(!\$('#create-ticket-form [name=\"'+ attr + '\"]').val()) {
                return true;
            }
        }
    };
    _.extend(Backbone.Validation.validators, {
        checkAllowedDomain: function(value, attr, customValue, model) {
            if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
                return false;
            domain = value.substring(value.indexOf(\"@\") + 1);
            if(customValue && customValue.indexOf(domain) === -1) {
                return true; //return error
            }
        },
        checkRestrictedDomain: function(value, attr, customValue, model) {
            if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
                return false;
            domain = value.substring(value.indexOf(\"@\") + 1);
            if(customValue && customValue.indexOf(domain) !== -1) {
                return true; //return error
            }
        },
        checkMaxFileSize: function(value, attr, customValue, model) {
            if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
                return false;
            fileInput = \$('input[name=\"' + attr + '\"]')[0] ? \$('input[name=\"' + attr + '\"]')[0] : \$('input[name=\"' + attr + '\"]');
            file = fileInput.files? fileInput.files[0] : '';
            filesize = file ? file.size / 1024 : 0;
            maxSize = (customValue && parseInt(customValue)) ? parseInt(customValue) : 5120;
            
            if(filesize > maxSize) {
                return true; //return error
            }
        },
        patternOrEmpty: function(value, attr, pattern, model) {
            defaultPatterns = Backbone.Validation.patterns;
            if (value && !value.toString().match(defaultPatterns[pattern] || pattern)) {
                return true; //error
            }
        },
      minOrEmpty: function(value, attr, minValue, model) {
        if (value && (value < minValue)) {
          return true; //error
        }
      },
      maxOrEmpty: function(value, attr, maxValue, model) {
        if (value && (value > maxValue)) {
          return true; //error
        }
      },
      patternCheck: function(value, attr, pattern, model) {
        if (value && !value.toString().match(pattern)) {
            return true; //error
        }
      },
    });
        ";
        // line 81
        if ((array_key_exists("headerCustomFields", $context) && ($context["headerCustomFields"] ?? null))) {
            // line 82
            yield "            ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(($context["headerCustomFields"] ?? null));
            foreach ($context['_seq'] as $context["_key"] => $context["customField"]) {
                // line 83
                yield "                ";
                $context["fieldtype"] = ((("text" != (($__internal_compile_0 = $context["customField"]) && is_array($__internal_compile_0) || $__internal_compile_0 instanceof ArrayAccess ? ($__internal_compile_0["fieldType"] ?? null) : null))) ? ((($__internal_compile_1 = $context["customField"]) && is_array($__internal_compile_1) || $__internal_compile_1 instanceof ArrayAccess ? ($__internal_compile_1["fieldType"] ?? null) : null)) : (((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["customField"], "validation", [], "array", false, true, false, 83), "fieldtype", [], "array", true, true, false, 83)) ? ((($__internal_compile_2 = (($__internal_compile_3 = $context["customField"]) && is_array($__internal_compile_3) || $__internal_compile_3 instanceof ArrayAccess ? ($__internal_compile_3["validation"] ?? null) : null)) && is_array($__internal_compile_2) || $__internal_compile_2 instanceof ArrayAccess ? ($__internal_compile_2["fieldtype"] ?? null) : null)) : ("text"))));
                // line 84
                yield "                    customFieldValidation['customFields[' + ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["customField"], "id", [], "any", false, false, false, 84), "html", null, true);
                yield " + ']'] = [
                    ";
                // line 85
                if (( !(CoreExtension::inFilter(($context["fieldtype"] ?? null), ["checkbox", "radio", "select"]) && Twig\Extension\CoreExtension::testEmpty((($__internal_compile_4 = $context["customField"]) && is_array($__internal_compile_4) || $__internal_compile_4 instanceof ArrayAccess ? ($__internal_compile_4["customFieldValues"] ?? null) : null))) && CoreExtension::getAttribute($this->env, $this->source, $context["customField"], "required", [], "any", false, false, false, 85))) {
                    // line 86
                    yield "                        {
                        fn : customHandler,
                        msg : '";
                    // line 88
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html", null, true);
                    yield "'
                    },
                    ";
                }
                // line 91
                yield "                    ";
                if (("number" == ($context["fieldtype"] ?? null))) {
                    // line 92
                    yield "                        {
                            patternOrEmpty : 'number',
                            msg: '";
                    // line 94
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Value is not valid number"), "html", null, true);
                    yield "',
                        },
                        ";
                    // line 96
                    if ((($__internal_compile_5 = (($__internal_compile_6 = $context["customField"]) && is_array($__internal_compile_6) || $__internal_compile_6 instanceof ArrayAccess ? ($__internal_compile_6["validation"] ?? null) : null)) && is_array($__internal_compile_5) || $__internal_compile_5 instanceof ArrayAccess ? ($__internal_compile_5["minNo"] ?? null) : null)) {
                        yield " 
                            {
                                minOrEmpty: ";
                        // line 98
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_7 = (($__internal_compile_8 = $context["customField"]) && is_array($__internal_compile_8) || $__internal_compile_8 instanceof ArrayAccess ? ($__internal_compile_8["validation"] ?? null) : null)) && is_array($__internal_compile_7) || $__internal_compile_7 instanceof ArrayAccess ? ($__internal_compile_7["minNo"] ?? null) : null), "html", null, true);
                        yield ",
                                msg: '";
                        // line 99
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide number greater than %min%", ["%min%" => (($__internal_compile_9 = (($__internal_compile_10 = $context["customField"]) && is_array($__internal_compile_10) || $__internal_compile_10 instanceof ArrayAccess ? ($__internal_compile_10["validation"] ?? null) : null)) && is_array($__internal_compile_9) || $__internal_compile_9 instanceof ArrayAccess ? ($__internal_compile_9["minNo"] ?? null) : null)]), "html", null, true);
                        yield "',
                            },
                        ";
                    }
                    // line 102
                    yield "                        ";
                    if ((($__internal_compile_11 = (($__internal_compile_12 = $context["customField"]) && is_array($__internal_compile_12) || $__internal_compile_12 instanceof ArrayAccess ? ($__internal_compile_12["validation"] ?? null) : null)) && is_array($__internal_compile_11) || $__internal_compile_11 instanceof ArrayAccess ? ($__internal_compile_11["maxNo"] ?? null) : null)) {
                        yield " 
                        {
                            maxOrEmpty: ";
                        // line 104
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_13 = (($__internal_compile_14 = $context["customField"]) && is_array($__internal_compile_14) || $__internal_compile_14 instanceof ArrayAccess ? ($__internal_compile_14["validation"] ?? null) : null)) && is_array($__internal_compile_13) || $__internal_compile_13 instanceof ArrayAccess ? ($__internal_compile_13["maxNo"] ?? null) : null), "html", null, true);
                        yield ",
                            msg: '";
                        // line 105
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide number smaller than %max%", ["%max%" => (($__internal_compile_15 = (($__internal_compile_16 = $context["customField"]) && is_array($__internal_compile_16) || $__internal_compile_16 instanceof ArrayAccess ? ($__internal_compile_16["validation"] ?? null) : null)) && is_array($__internal_compile_15) || $__internal_compile_15 instanceof ArrayAccess ? ($__internal_compile_15["maxNo"] ?? null) : null)]), "html", null, true);
                        yield "',
                        },
                        ";
                    }
                    // line 108
                    yield "                    ";
                } elseif (("email" == ($context["fieldtype"] ?? null))) {
                    // line 109
                    yield "                        {
                            patternOrEmpty: /^((([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\$/i,
                            msg: '";
                    // line 111
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Email Address is invalid"), "html", null, true);
                    yield "',
                        },
                        ";
                    // line 113
                    if ((($__internal_compile_17 = (($__internal_compile_18 = $context["customField"]) && is_array($__internal_compile_18) || $__internal_compile_18 instanceof ArrayAccess ? ($__internal_compile_18["validation"] ?? null) : null)) && is_array($__internal_compile_17) || $__internal_compile_17 instanceof ArrayAccess ? ($__internal_compile_17["allowedDomain"] ?? null) : null)) {
                        // line 114
                        yield "                            {
                                checkAllowedDomain: \"";
                        // line 115
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_19 = (($__internal_compile_20 = $context["customField"]) && is_array($__internal_compile_20) || $__internal_compile_20 instanceof ArrayAccess ? ($__internal_compile_20["validation"] ?? null) : null)) && is_array($__internal_compile_19) || $__internal_compile_19 instanceof ArrayAccess ? ($__internal_compile_19["allowedDomain"] ?? null) : null), "html", null, true);
                        yield "\",
                                msg: '";
                        // line 116
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Domain name should be in accepted domains"), "html", null, true);
                        yield "',
                            },
                        ";
                    }
                    // line 119
                    yield "                        ";
                    if ((($__internal_compile_21 = (($__internal_compile_22 = $context["customField"]) && is_array($__internal_compile_22) || $__internal_compile_22 instanceof ArrayAccess ? ($__internal_compile_22["validation"] ?? null) : null)) && is_array($__internal_compile_21) || $__internal_compile_21 instanceof ArrayAccess ? ($__internal_compile_21["restrictedDomain"] ?? null) : null)) {
                        // line 120
                        yield "                            {
                                checkRestrictedDomain: \"";
                        // line 121
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_23 = (($__internal_compile_24 = $context["customField"]) && is_array($__internal_compile_24) || $__internal_compile_24 instanceof ArrayAccess ? ($__internal_compile_24["validation"] ?? null) : null)) && is_array($__internal_compile_23) || $__internal_compile_23 instanceof ArrayAccess ? ($__internal_compile_23["restrictedDomain"] ?? null) : null), "html", null, true);
                        yield "\",
                                msg: '";
                        // line 122
                        yield "Domain name should not be in restricted domains";
                        yield "',
                            } ,
                        ";
                    }
                    // line 125
                    yield "                    ";
                } elseif (("url" == ($context["fieldtype"] ?? null))) {
                    // line 126
                    yield "                        {
                            patternOrEmpty: 'url',
                            msg: '";
                    // line 128
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide a valid url(with protocol)"), "html", null, true);
                    yield "',
                        } ,
                    ";
                } elseif (("file" ==                 // line 130
($context["fieldtype"] ?? null))) {
                    // line 131
                    yield "                        {
                            checkMaxFileSize: \"";
                    // line 132
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_25 = (($__internal_compile_26 = $context["customField"]) && is_array($__internal_compile_26) || $__internal_compile_26 instanceof ArrayAccess ? ($__internal_compile_26["validation"] ?? null) : null)) && is_array($__internal_compile_25) || $__internal_compile_25 instanceof ArrayAccess ? ($__internal_compile_25["maxFileSize"] ?? null) : null), "html", null, true);
                    yield "\",
                            msg: '";
                    // line 133
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("file size should not exceed %value% KB", ["%value%" => (((($__internal_compile_27 = (($__internal_compile_28 = $context["customField"]) && is_array($__internal_compile_28) || $__internal_compile_28 instanceof ArrayAccess ? ($__internal_compile_28["validation"] ?? null) : null)) && is_array($__internal_compile_27) || $__internal_compile_27 instanceof ArrayAccess ? ($__internal_compile_27["maxFileSize"] ?? null) : null)) ?: ("5120"))]), "html", null, true);
                    yield "',
                        } ,
                    ";
                }
                // line 136
                yield "                    ";
                if ((( !CoreExtension::inFilter(($context["fieldtype"] ?? null), ["checkbox", "radio", "select"]) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["customField"], "validation", [], "array", false, true, false, 136), "regex", [], "array", true, true, false, 136)) && (($__internal_compile_29 = (($__internal_compile_30 = $context["customField"]) && is_array($__internal_compile_30) || $__internal_compile_30 instanceof ArrayAccess ? ($__internal_compile_30["validation"] ?? null) : null)) && is_array($__internal_compile_29) || $__internal_compile_29 instanceof ArrayAccess ? ($__internal_compile_29["regex"] ?? null) : null))) {
                    // line 137
                    yield "                        {
                            patternCheck: \"";
                    // line 138
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_31 = (($__internal_compile_32 = $context["customField"]) && is_array($__internal_compile_32) || $__internal_compile_32 instanceof ArrayAccess ? ($__internal_compile_32["validation"] ?? null) : null)) && is_array($__internal_compile_31) || $__internal_compile_31 instanceof ArrayAccess ? ($__internal_compile_31["regex"] ?? null) : null), "html", null, true);
                    yield "\",
                            msg: \"";
                    // line 139
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This Field Value is not Valid"), "html", null, true);
                    yield "\",
                        } ,
                    ";
                }
                // line 142
                yield "                ];
                Array.isArray(validationParameters) ? validationParameters.push(value) : false;
            ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['customField'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 145
            yield "        ";
        }
        // line 146
        yield "        
                ";
        // line 147
        if ((array_key_exists("CustomerCustomFields", $context) && ($context["CustomerCustomFields"] ?? null))) {
            // line 148
            yield "            ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(($context["CustomerCustomFields"] ?? null));
            foreach ($context['_seq'] as $context["_key"] => $context["customField"]) {
                // line 149
                yield "                ";
                $context["fieldtype"] = ((("text" != (($__internal_compile_33 = $context["customField"]) && is_array($__internal_compile_33) || $__internal_compile_33 instanceof ArrayAccess ? ($__internal_compile_33["fieldType"] ?? null) : null))) ? ((($__internal_compile_34 = $context["customField"]) && is_array($__internal_compile_34) || $__internal_compile_34 instanceof ArrayAccess ? ($__internal_compile_34["fieldType"] ?? null) : null)) : (((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["customField"], "validation", [], "array", false, true, false, 149), "fieldtype", [], "array", true, true, false, 149)) ? ((($__internal_compile_35 = (($__internal_compile_36 = $context["customField"]) && is_array($__internal_compile_36) || $__internal_compile_36 instanceof ArrayAccess ? ($__internal_compile_36["validation"] ?? null) : null)) && is_array($__internal_compile_35) || $__internal_compile_35 instanceof ArrayAccess ? ($__internal_compile_35["fieldtype"] ?? null) : null)) : ("text"))));
                // line 150
                yield "                    customFieldValidation['customFields[' + ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["customField"], "id", [], "any", false, false, false, 150), "html", null, true);
                yield " + ']'] = [
                    ";
                // line 151
                if (( !(CoreExtension::inFilter(($context["fieldtype"] ?? null), ["checkbox", "radio", "select"]) && Twig\Extension\CoreExtension::testEmpty((($__internal_compile_37 = $context["customField"]) && is_array($__internal_compile_37) || $__internal_compile_37 instanceof ArrayAccess ? ($__internal_compile_37["customFieldValues"] ?? null) : null))) && CoreExtension::getAttribute($this->env, $this->source, $context["customField"], "required", [], "any", false, false, false, 151))) {
                    // line 152
                    yield "                        {
                        fn : customHandler,
                        msg : '";
                    // line 154
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html", null, true);
                    yield "'
                    },
                    ";
                }
                // line 157
                yield "                    ";
                if (("number" == ($context["fieldtype"] ?? null))) {
                    // line 158
                    yield "                        {
                            patternOrEmpty : 'number',
                            msg: '";
                    // line 160
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Value is not valid number"), "html", null, true);
                    yield "',
                        },
                        ";
                    // line 162
                    if ((($__internal_compile_38 = (($__internal_compile_39 = $context["customField"]) && is_array($__internal_compile_39) || $__internal_compile_39 instanceof ArrayAccess ? ($__internal_compile_39["validation"] ?? null) : null)) && is_array($__internal_compile_38) || $__internal_compile_38 instanceof ArrayAccess ? ($__internal_compile_38["minNo"] ?? null) : null)) {
                        yield " 
                            {
                                minOrEmpty: ";
                        // line 164
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_40 = (($__internal_compile_41 = $context["customField"]) && is_array($__internal_compile_41) || $__internal_compile_41 instanceof ArrayAccess ? ($__internal_compile_41["validation"] ?? null) : null)) && is_array($__internal_compile_40) || $__internal_compile_40 instanceof ArrayAccess ? ($__internal_compile_40["minNo"] ?? null) : null), "html", null, true);
                        yield ",
                                msg: '";
                        // line 165
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide number greater than %min%", ["%min%" => (($__internal_compile_42 = (($__internal_compile_43 = $context["customField"]) && is_array($__internal_compile_43) || $__internal_compile_43 instanceof ArrayAccess ? ($__internal_compile_43["validation"] ?? null) : null)) && is_array($__internal_compile_42) || $__internal_compile_42 instanceof ArrayAccess ? ($__internal_compile_42["minNo"] ?? null) : null)]), "html", null, true);
                        yield "',
                            },
                        ";
                    }
                    // line 168
                    yield "                        ";
                    if ((($__internal_compile_44 = (($__internal_compile_45 = $context["customField"]) && is_array($__internal_compile_45) || $__internal_compile_45 instanceof ArrayAccess ? ($__internal_compile_45["validation"] ?? null) : null)) && is_array($__internal_compile_44) || $__internal_compile_44 instanceof ArrayAccess ? ($__internal_compile_44["maxNo"] ?? null) : null)) {
                        yield " 
                        {
                            maxOrEmpty: ";
                        // line 170
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_46 = (($__internal_compile_47 = $context["customField"]) && is_array($__internal_compile_47) || $__internal_compile_47 instanceof ArrayAccess ? ($__internal_compile_47["validation"] ?? null) : null)) && is_array($__internal_compile_46) || $__internal_compile_46 instanceof ArrayAccess ? ($__internal_compile_46["maxNo"] ?? null) : null), "html", null, true);
                        yield ",
                            msg: '";
                        // line 171
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide number smaller than %max%", ["%max%" => (($__internal_compile_48 = (($__internal_compile_49 = $context["customField"]) && is_array($__internal_compile_49) || $__internal_compile_49 instanceof ArrayAccess ? ($__internal_compile_49["validation"] ?? null) : null)) && is_array($__internal_compile_48) || $__internal_compile_48 instanceof ArrayAccess ? ($__internal_compile_48["maxNo"] ?? null) : null)]), "html", null, true);
                        yield "',
                        },
                        ";
                    }
                    // line 174
                    yield "                    ";
                } elseif (("email" == ($context["fieldtype"] ?? null))) {
                    // line 175
                    yield "                        {
                            patternOrEmpty: /^((([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\$/i,
                            msg: '";
                    // line 177
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Email Address is invalid"), "html", null, true);
                    yield "',
                        },
                        ";
                    // line 179
                    if ((($__internal_compile_50 = (($__internal_compile_51 = $context["customField"]) && is_array($__internal_compile_51) || $__internal_compile_51 instanceof ArrayAccess ? ($__internal_compile_51["validation"] ?? null) : null)) && is_array($__internal_compile_50) || $__internal_compile_50 instanceof ArrayAccess ? ($__internal_compile_50["allowedDomain"] ?? null) : null)) {
                        // line 180
                        yield "                            {
                                checkAllowedDomain: \"";
                        // line 181
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_52 = (($__internal_compile_53 = $context["customField"]) && is_array($__internal_compile_53) || $__internal_compile_53 instanceof ArrayAccess ? ($__internal_compile_53["validation"] ?? null) : null)) && is_array($__internal_compile_52) || $__internal_compile_52 instanceof ArrayAccess ? ($__internal_compile_52["allowedDomain"] ?? null) : null), "html", null, true);
                        yield "\",
                                msg: '";
                        // line 182
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Domain name should be in accepted domains"), "html", null, true);
                        yield "',
                            },
                        ";
                    }
                    // line 185
                    yield "                        ";
                    if ((($__internal_compile_54 = (($__internal_compile_55 = $context["customField"]) && is_array($__internal_compile_55) || $__internal_compile_55 instanceof ArrayAccess ? ($__internal_compile_55["validation"] ?? null) : null)) && is_array($__internal_compile_54) || $__internal_compile_54 instanceof ArrayAccess ? ($__internal_compile_54["restrictedDomain"] ?? null) : null)) {
                        // line 186
                        yield "                            {
                                checkRestrictedDomain: \"";
                        // line 187
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_56 = (($__internal_compile_57 = $context["customField"]) && is_array($__internal_compile_57) || $__internal_compile_57 instanceof ArrayAccess ? ($__internal_compile_57["validation"] ?? null) : null)) && is_array($__internal_compile_56) || $__internal_compile_56 instanceof ArrayAccess ? ($__internal_compile_56["restrictedDomain"] ?? null) : null), "html", null, true);
                        yield "\",
                                msg: '";
                        // line 188
                        yield "Domain name should not be in restricted domains";
                        yield "',
                            } ,
                        ";
                    }
                    // line 191
                    yield "                    ";
                } elseif (("url" == ($context["fieldtype"] ?? null))) {
                    // line 192
                    yield "                        {
                            patternOrEmpty: 'url',
                            msg: '";
                    // line 194
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide a valid url(with protocol)"), "html", null, true);
                    yield "',
                        } ,
                    ";
                } elseif (("file" ==                 // line 196
($context["fieldtype"] ?? null))) {
                    // line 197
                    yield "                        {
                            checkMaxFileSize: \"";
                    // line 198
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_58 = (($__internal_compile_59 = $context["customField"]) && is_array($__internal_compile_59) || $__internal_compile_59 instanceof ArrayAccess ? ($__internal_compile_59["validation"] ?? null) : null)) && is_array($__internal_compile_58) || $__internal_compile_58 instanceof ArrayAccess ? ($__internal_compile_58["maxFileSize"] ?? null) : null), "html", null, true);
                    yield "\",
                            msg: '";
                    // line 199
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("file size should not exceed %value% KB", ["%value%" => (((($__internal_compile_60 = (($__internal_compile_61 = $context["customField"]) && is_array($__internal_compile_61) || $__internal_compile_61 instanceof ArrayAccess ? ($__internal_compile_61["validation"] ?? null) : null)) && is_array($__internal_compile_60) || $__internal_compile_60 instanceof ArrayAccess ? ($__internal_compile_60["maxFileSize"] ?? null) : null)) ?: ("5120"))]), "html", null, true);
                    yield "',
                        } ,
                    ";
                }
                // line 202
                yield "                    ";
                if ((( !CoreExtension::inFilter(($context["fieldtype"] ?? null), ["checkbox", "radio", "select"]) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["customField"], "validation", [], "array", false, true, false, 202), "regex", [], "array", true, true, false, 202)) && (($__internal_compile_62 = (($__internal_compile_63 = $context["customField"]) && is_array($__internal_compile_63) || $__internal_compile_63 instanceof ArrayAccess ? ($__internal_compile_63["validation"] ?? null) : null)) && is_array($__internal_compile_62) || $__internal_compile_62 instanceof ArrayAccess ? ($__internal_compile_62["regex"] ?? null) : null))) {
                    // line 203
                    yield "                        {
                            patternCheck: \"";
                    // line 204
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($__internal_compile_64 = (($__internal_compile_65 = $context["customField"]) && is_array($__internal_compile_65) || $__internal_compile_65 instanceof ArrayAccess ? ($__internal_compile_65["validation"] ?? null) : null)) && is_array($__internal_compile_64) || $__internal_compile_64 instanceof ArrayAccess ? ($__internal_compile_64["regex"] ?? null) : null), "html", null, true);
                    yield "\",
                            msg: \"";
                    // line 205
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This Field Value is not Valid"), "html", null, true);
                    yield "\",
                        } ,
                    ";
                }
                // line 208
                yield "                ];
                Array.isArray(validationParameters) ? validationParameters.push(value) : false;
            ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['customField'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 211
            yield "        ";
        }
        // line 212
        yield "    var validationParameters = true;
</script>  ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "@_uvdesk_extension_uvdesk_custom_fields/CustomFields/customFieldValidation.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  461 => 212,  458 => 211,  450 => 208,  444 => 205,  440 => 204,  437 => 203,  434 => 202,  428 => 199,  424 => 198,  421 => 197,  419 => 196,  414 => 194,  410 => 192,  407 => 191,  401 => 188,  397 => 187,  394 => 186,  391 => 185,  385 => 182,  381 => 181,  378 => 180,  376 => 179,  371 => 177,  367 => 175,  364 => 174,  358 => 171,  354 => 170,  348 => 168,  342 => 165,  338 => 164,  333 => 162,  328 => 160,  324 => 158,  321 => 157,  315 => 154,  311 => 152,  309 => 151,  304 => 150,  301 => 149,  296 => 148,  294 => 147,  291 => 146,  288 => 145,  280 => 142,  274 => 139,  270 => 138,  267 => 137,  264 => 136,  258 => 133,  254 => 132,  251 => 131,  249 => 130,  244 => 128,  240 => 126,  237 => 125,  231 => 122,  227 => 121,  224 => 120,  221 => 119,  215 => 116,  211 => 115,  208 => 114,  206 => 113,  201 => 111,  197 => 109,  194 => 108,  188 => 105,  184 => 104,  178 => 102,  172 => 99,  168 => 98,  163 => 96,  158 => 94,  154 => 92,  151 => 91,  145 => 88,  141 => 86,  139 => 85,  134 => 84,  131 => 83,  126 => 82,  124 => 81,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "@_uvdesk_extension_uvdesk_custom_fields/CustomFields/customFieldValidation.html.twig", "/home/bmdranzo/public_html/apps/uvdesk/custom-fields/src/Resources/views/CustomFields/customFieldValidation.html.twig");
    }
}
