Plugin Directory

Changeset 2955028


Ignore:
Timestamp:
08/17/2023 03:48:47 PM (2 years ago)
Author:
andreadegiovine
Message:

4.0.10

Location:
custom-post-types
Files:
43 added
8 edited

Legend:

Unmodified
Added
Removed
  • custom-post-types/trunk/assets/css/backend.css

    r2924614 r2955028  
    1 :root{--cpt-white: #fff;--cpt-black: #000;--cpt-grey: #e0e0e0;--cpt-grey-2: #f0f1f2;--cpt-grey-4: #444;--cpt-grey-light: #fcfcfd;--cpt-grey-dark: #d5d8da;--cpt-blue: #2271b1;--cpt-blue-2: #135e96;--cpt-red: #dc3232;--cpt-red-2: #b32d2e;--cpt-yellow: #ffb900;--cpt-green: #00a32a}.cpt-fields-section:not([data-template]),.cpt-field .cpt-repeater-fields:not([data-template]),.cpt-fields-section[data-template=post-type-form],.cpt-field [data-template=post-type-form].cpt-repeater-fields{margin-bottom:1em;background:#e0e0e0;display:flex;flex-flow:row wrap}.inside .cpt-fields-section:not([data-template]),.inside .cpt-field .cpt-repeater-fields:not([data-template]),.cpt-field .inside .cpt-repeater-fields:not([data-template]),.inside .cpt-fields-section[data-template=post-type-form],.inside .cpt-field [data-template=post-type-form].cpt-repeater-fields,.cpt-field .inside [data-template=post-type-form].cpt-repeater-fields{margin:-6px -12px -12px}.cpt-field{width:100%}.cpt-field .cpt-color-section{align-items:center;display:flex;flex-flow:row nowrap;max-width:150px;width:100%}.cpt-field .cpt-color-section .preview{background-color:#f0f1f2;box-shadow:0 1px 3px rgba(0,0,0,.4);border-radius:100%;cursor:pointer;flex:0 0 22px;height:22px;margin-right:10px}.cpt-field .cpt-file-section{position:relative}.cpt-field .cpt-file-wrap{height:150px;position:relative;width:150px}.cpt-field .cpt-file-wrap:hover .cpt-file-actions{z-index:3}.cpt-field .cpt-file-preview{background-color:#f5f5f5;height:100%;width:100%;position:absolute}.cpt-field .cpt-file-preview img{position:relative;z-index:2;background-color:#fff}.cpt-field .cpt-file-actions{align-items:center;background-color:rgba(245,245,245,.7);border:1px dashed #d5d8da;display:flex;flex-flow:column wrap;height:calc(100% - 22px);justify-content:flex-end;padding:10px;position:relative;transition:opacity .2s;width:calc(100% - 22px);z-index:1}.cpt-field .cpt-file-actions .file-name{font-size:smaller;padding-bottom:10px;overflow:hidden;text-overflow:ellipsis;width:100%;white-space:nowrap}.cpt-field .cpt-file-button{z-index:2;line-height:0}.cpt-field .cpt-repeater-section{counter-reset:seq}.cpt-field .cpt-repeater-group{display:flex;flex-flow:row nowrap;position:relative;width:100%}.cpt-field .cpt-repeater-group:first-child>.buttons{border-top:0}.cpt-field .cpt-repeater-group:last-child>.buttons{border-bottom:0}.cpt-field .cpt-repeater-buttons{background-color:#e0e0e0;border:1px solid #fff;border-left:0;border-right:0;display:flex;flex-flow:column wrap}.cpt-field .cpt-repeater-buttons .order{align-items:center;display:flex;margin:8px auto}.cpt-field .cpt-repeater-buttons .order:before{background:#fff;border-radius:4px;color:#444;counter-increment:seq;content:counter(seq);font-size:10px;font-weight:bold;line-height:18px;padding:0 6px}.cpt-field .cpt-repeater-buttons .move{color:#444;cursor:grab}.cpt-field .cpt-repeater-buttons .remove{color:#dc3232}.cpt-field .cpt-repeater-button{line-height:0;border:0;padding:8px;background:rgba(0,0,0,0)}.cpt-field .cpt-repeater-button:focus{box-shadow:unset}.cpt-field .cpt-repeater-button:hover{background:#fff}.cpt-field .cpt-repeater-fields{margin:0 !important;width:100%}.cpt-field .cpt-repeater-extra{display:flex;flex-flow:row wrap;width:100%}.cpt-field .cpt-repeater-remove{background:rgba(224,224,224,.9);position:absolute;z-index:2;display:flex;flex-flow:row wrap;justify-content:center;align-items:center;height:100%;width:100%;gap:20px;opacity:0;pointer-events:none;transition:opacity .3s ease}.cpt-field .cpt-repeater-remove.active{opacity:1;pointer-events:inherit}.cpt-field .cpt-repeater-add{margin:10px 0 0;background:unset;border:0;color:#2271b1;cursor:pointer;height:30px;width:34px;padding:0}.cpt-field .cpt-repeater-add:focus{box-shadow:unset;outline:none}.cpt-field .cpt-repeater-add .dashicons{font-size:30px;height:auto;width:auto}.cpt-field .cpt-repeater-add:disabled{display:none}.cpt-field .cpt-repeater-spinner{align-items:center;display:flex;height:40px;justify-content:center;width:100%}.cpt-field .cpt-repeater-spinner .spinner{background-position:center;height:20px;margin:0;visibility:visible;width:20px}.cpt-field .select2-container .select2-selection{min-height:40px !important}@media screen and (min-width: 783px){.cpt-field .select2-container .select2-selection{min-height:30px !important}}.cpt-field .select2-container .select2-search--inline .select2-search__field{vertical-align:top !important}.cpt-field .select2-selection__arrow{height:37px !important}@media screen and (min-width: 783px){.cpt-field .select2-selection__arrow{height:29px !important}}.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__choice{margin-bottom:0 !important;margin-top:4px !important;line-height:27px}@media screen and (min-width: 783px){.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__choice{line-height:18px}}.cpt-field .select2-selection__choice__remove{line-height:27px}@media screen and (min-width: 783px){.cpt-field .select2-selection__choice__remove{line-height:18px}}.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__clear{height:34px !important;margin-top:0 !important}@media screen and (min-width: 783px){.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__clear{height:26px !important}}.cpt-field .select2-selection__rendered:not(ul){line-height:38px !important}@media screen and (min-width: 783px){.cpt-field .select2-selection__rendered:not(ul){line-height:28px !important}}.cpt-field-tinymce textarea{display:inline-block !important}.cpt-field-tinymce textarea[aria-hidden=true]{opacity:0;pointer-events:none;position:absolute;bottom:0;left:0}@media screen and (max-width: 782px){.cpt-field{width:100% !important}}.cpt-field-required label[for]:after{content:"*";margin-left:4px;font-weight:bold}.cpt-field-inner{margin:1px}.cpt-field-wrap{background:#fff;display:flex;flex-flow:column wrap;padding:10px 15px;transition:background .1s ease-in-out}.cpt-field-wrap:hover{background:#fcfcfd}.cpt-field-wrap label{margin-bottom:3px}.cpt-field-wrap.advanced-field{height:0;overflow:hidden;pointer-events:none;padding:0;margin:-1px 0}.cpt-field-wrap.advanced-field.active{height:auto;overflow:auto;pointer-events:auto;padding:10px 15px;margin:unset}.cpt-field-wrap.advanced-field-btn .button{align-items:center;display:flex;justify-content:center;min-height:35px;text-align:center;width:100%}.cpt-field-wrap.advanced-field-btn .button .dashicons{margin-right:10px}.cpt-field-wrap .input input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]),.cpt-field-wrap .input select,.cpt-field-wrap .input textarea{width:100%}.cpt-field-wrap .input textarea:not([class^=select2]){height:100px}.cpt-field-wrap .input .template-shortcode{margin:15px 0 0}.cpt-field-wrap .input .template-shortcode input{border:0;background:rgba(0,0,0,0);cursor:copy;margin:0}.cpt-field-wrap .input .template-shortcode input:not(:last-child){margin:0 0 10px}.cpt-field-wrap .description{margin-top:3px}.cpt-field-wrap .description p{font-size:smaller;opacity:.7;margin:0;padding:0}@media screen and (min-width: 783px){.cpt-field-wrap.horizontal{flex-flow:row wrap}.cpt-field-wrap.horizontal label{display:flex;justify-content:end;text-align:right;width:15%;padding-right:13px;margin:0}.cpt-field-wrap.horizontal .input{flex:1}.cpt-field-wrap.horizontal .description{width:35%;padding-left:13px;margin:0}}.cpt-notice .notice-title{display:block}.cpt-notice .message{margin:.5em 0;padding:2px}.cpt-notice .message p:first-child{margin-top:0;padding-top:0}.cpt-notice .message p:last-child{margin-bottom:0;padding-bottom:0}.cpt-notice .actions{margin-top:1em;padding-top:.5em;border-top:1px solid #d5d8da}.cpt-notice .actions .dashicons{font-size:110%;text-decoration:none;vertical-align:middle}.cpt-notice .actions a:not(:last-child){margin-right:20px}.cpt-notice .cpt-dismiss-notice{color:#b32d2e}.cpt-notice pre.error-code{margin:.5em 0 0}.cpt-notice pre.error-code code{padding:5px;display:none}.cpt-notice pre.error-code code.show{display:block}.cpt-pro-banner{border:5px dashed #ffb900;display:inline-block;margin:20px 0;max-width:300px;padding:0 1em;text-align:center;width:100%}.cpt-row{display:flex;flex-flow:row wrap;margin-left:-15px;margin-right:-15px}.cpt-col-3{padding:0 15px;width:calc(100% - 30px)}@media screen and (min-width: 783px){.cpt-col-3{width:calc(33.3333333333% - 30px)}}.cpt-hidden-input{bottom:0;opacity:0;position:absolute;pointer-events:none;max-width:148px}
     1:root{--cpt-white: #fff;--cpt-black: #000;--cpt-grey: #e0e0e0;--cpt-grey-2: #f0f1f2;--cpt-grey-4: #444;--cpt-grey-light: #fcfcfd;--cpt-grey-dark: #d5d8da;--cpt-blue: #2271b1;--cpt-blue-2: #135e96;--cpt-red: #dc3232;--cpt-red-2: #b32d2e;--cpt-yellow: #ffb900;--cpt-green: #00a32a}.cpt-fields-section:not([data-template]),.cpt-field .cpt-repeater-fields:not([data-template]),.cpt-fields-section[data-template=post-type-form],.cpt-field [data-template=post-type-form].cpt-repeater-fields{margin-bottom:1em;background:#e0e0e0;display:flex;flex-flow:row wrap}.inside .cpt-fields-section:not([data-template]),.inside .cpt-field .cpt-repeater-fields:not([data-template]),.cpt-field .inside .cpt-repeater-fields:not([data-template]),.inside .cpt-fields-section[data-template=post-type-form],.inside .cpt-field [data-template=post-type-form].cpt-repeater-fields,.cpt-field .inside [data-template=post-type-form].cpt-repeater-fields{margin:-6px -12px -12px}.cpt-field{width:100%}.cpt-field .cpt-file-section{position:relative}.cpt-field .cpt-file-wrap{height:150px;position:relative;width:150px}.cpt-field .cpt-file-wrap:hover .cpt-file-actions{z-index:3}.cpt-field .cpt-file-preview{background-color:#f5f5f5;height:100%;width:100%;position:absolute}.cpt-field .cpt-file-preview img{position:relative;z-index:2;background-color:#fff}.cpt-field .cpt-file-actions{align-items:center;background-color:rgba(245,245,245,.7);border:1px dashed #d5d8da;display:flex;flex-flow:column wrap;height:calc(100% - 22px);justify-content:flex-end;padding:10px;position:relative;transition:opacity .2s;width:calc(100% - 22px);z-index:1}.cpt-field .cpt-file-actions .file-name{font-size:smaller;padding-bottom:10px;overflow:hidden;text-overflow:ellipsis;width:100%;white-space:nowrap}.cpt-field .cpt-file-button{z-index:2;line-height:0}.cpt-field .cpt-repeater-section{counter-reset:seq}.cpt-field .cpt-repeater-group{display:flex;flex-flow:row nowrap;position:relative;width:100%}.cpt-field .cpt-repeater-group:first-child>.buttons{border-top:0}.cpt-field .cpt-repeater-group:last-child>.buttons{border-bottom:0}.cpt-field .cpt-repeater-buttons{background-color:#e0e0e0;border:1px solid #fff;border-left:0;border-right:0;display:flex;flex-flow:column wrap}.cpt-field .cpt-repeater-buttons .order{align-items:center;display:flex;margin:8px auto}.cpt-field .cpt-repeater-buttons .order:before{background:#fff;border-radius:4px;color:#444;counter-increment:seq;content:counter(seq);font-size:10px;font-weight:bold;line-height:18px;padding:0 6px}.cpt-field .cpt-repeater-buttons .move{color:#444;cursor:grab}.cpt-field .cpt-repeater-buttons .remove{color:#dc3232}.cpt-field .cpt-repeater-button{line-height:0;border:0;padding:8px;background:rgba(0,0,0,0)}.cpt-field .cpt-repeater-button:focus{box-shadow:unset}.cpt-field .cpt-repeater-button:hover{background:#fff}.cpt-field .cpt-repeater-fields{margin:0 !important;width:100%}.cpt-field .cpt-repeater-extra{display:flex;flex-flow:row wrap;width:100%}.cpt-field .cpt-repeater-remove{background:rgba(224,224,224,.9);position:absolute;z-index:2;display:flex;flex-flow:row wrap;justify-content:center;align-items:center;height:100%;width:100%;gap:20px;opacity:0;pointer-events:none;transition:opacity .3s ease}.cpt-field .cpt-repeater-remove.active{opacity:1;pointer-events:inherit}.cpt-field .cpt-repeater-add{margin:10px 0 0;background:unset;border:0;color:#2271b1;cursor:pointer;height:30px;width:34px;padding:0}.cpt-field .cpt-repeater-add:focus{box-shadow:unset;outline:none}.cpt-field .cpt-repeater-add .dashicons{font-size:30px;height:auto;width:auto}.cpt-field .cpt-repeater-add:disabled{display:none}.cpt-field .cpt-repeater-spinner{align-items:center;display:flex;height:40px;justify-content:center;width:100%}.cpt-field .cpt-repeater-spinner .spinner{background-position:center;height:20px;margin:0;visibility:visible;width:20px}.cpt-field .select2-container .select2-selection{min-height:40px !important}@media screen and (min-width: 783px){.cpt-field .select2-container .select2-selection{min-height:30px !important}}.cpt-field .select2-container .select2-search--inline .select2-search__field{vertical-align:top !important}.cpt-field .select2-selection__arrow{height:37px !important}@media screen and (min-width: 783px){.cpt-field .select2-selection__arrow{height:29px !important}}.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__choice{margin-bottom:0 !important;margin-top:4px !important;line-height:27px}@media screen and (min-width: 783px){.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__choice{line-height:18px}}.cpt-field .select2-selection__choice__remove{line-height:27px}@media screen and (min-width: 783px){.cpt-field .select2-selection__choice__remove{line-height:18px}}.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__clear{height:34px !important;margin-top:0 !important}@media screen and (min-width: 783px){.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__clear{height:26px !important}}.cpt-field .select2-selection__rendered:not(ul){line-height:38px !important}@media screen and (min-width: 783px){.cpt-field .select2-selection__rendered:not(ul){line-height:28px !important}}.cpt-field-tinymce textarea{display:inline-block !important}.cpt-field-tinymce textarea[aria-hidden=true]{opacity:0;pointer-events:none;position:absolute;bottom:0;left:0}@media screen and (max-width: 782px){.cpt-field{width:100% !important}}.cpt-field-required label[for]:after{content:"*";margin-left:4px;font-weight:bold}.cpt-field-inner{margin:1px}.cpt-field-wrap{background:#fff;display:flex;flex-flow:column wrap;padding:10px 15px;transition:background .1s ease-in-out}.cpt-field-wrap:hover{background:#fcfcfd}.cpt-field-wrap label{margin-bottom:3px}.cpt-field-wrap.advanced-field{height:0;overflow:hidden;pointer-events:none;padding:0;margin:-1px 0}.cpt-field-wrap.advanced-field.active{height:auto;overflow:auto;pointer-events:auto;padding:10px 15px;margin:unset}.cpt-field-wrap.advanced-field-btn .button{align-items:center;display:flex;justify-content:center;min-height:35px;text-align:center;width:100%}.cpt-field-wrap.advanced-field-btn .button .dashicons{margin-right:10px}.cpt-field-wrap .input input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]),.cpt-field-wrap .input select,.cpt-field-wrap .input textarea{width:100%}.cpt-field-wrap .input textarea:not([class^=select2]){height:100px}.cpt-field-wrap .input .template-shortcode{margin:15px 0 0}.cpt-field-wrap .input .template-shortcode input{border:0;background:rgba(0,0,0,0);cursor:copy;margin:0}.cpt-field-wrap .input .template-shortcode input:not(:last-child){margin:0 0 10px}.cpt-field-wrap .description{margin-top:3px}.cpt-field-wrap .description p{font-size:smaller;opacity:.7;margin:0;padding:0}@media screen and (min-width: 783px){.cpt-field-wrap.horizontal{flex-flow:row wrap}.cpt-field-wrap.horizontal label{display:flex;justify-content:end;text-align:right;width:15%;padding-right:13px;margin:0}.cpt-field-wrap.horizontal .input{flex:1}.cpt-field-wrap.horizontal .description{width:35%;padding-left:13px;margin:0}}.cpt-notice .notice-title{display:block}.cpt-notice .message{margin:.5em 0;padding:2px}.cpt-notice .message p:first-child{margin-top:0;padding-top:0}.cpt-notice .message p:last-child{margin-bottom:0;padding-bottom:0}.cpt-notice .actions{margin-top:1em;padding-top:.5em;border-top:1px solid #d5d8da}.cpt-notice .actions .dashicons{font-size:110%;text-decoration:none;vertical-align:middle}.cpt-notice .actions a:not(:last-child){margin-right:20px}.cpt-notice .cpt-dismiss-notice{color:#b32d2e}.cpt-notice pre.error-code{margin:.5em 0 0}.cpt-notice pre.error-code code{padding:5px;display:none}.cpt-notice pre.error-code code.show{display:block}.cpt-pro-banner{border:5px dashed #ffb900;display:inline-block;margin:20px 0;max-width:300px;padding:0 1em;text-align:center;width:100%}.cpt-row{display:flex;flex-flow:row wrap;margin-left:-15px;margin-right:-15px}.cpt-col-3{padding:0 15px;width:calc(100% - 30px)}@media screen and (min-width: 783px){.cpt-col-3{width:calc(33.3333333333% - 30px)}}.cpt-hidden-input{bottom:0;opacity:0;position:absolute;pointer-events:none;max-width:148px}
    22.datepicker{width:min-content}.datepicker:not(.active){display:none}.datepicker-dropdown{position:absolute;z-index:20;padding-top:4px}.datepicker-dropdown.datepicker-orient-top{padding-top:0;padding-bottom:4px}.datepicker-picker{display:flex;flex-direction:column;border-radius:4px;background-color:#fff}.datepicker-dropdown .datepicker-picker{box-shadow:0 2px 3px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1)}.datepicker-main{flex:auto;padding:2px}.datepicker-footer{box-shadow:inset 0 1px 1px rgba(10,10,10,.1);background-color:#f5f5f5}.datepicker-title{box-shadow:inset 0 -1px 1px rgba(10,10,10,.1);background-color:#f5f5f5;padding:.375rem .75rem;text-align:center;font-weight:700}.datepicker-controls{display:flex}.datepicker-header .datepicker-controls{padding:2px 2px 0}.datepicker-controls .button{display:inline-flex;position:relative;align-items:center;justify-content:center;margin:0;border:1px solid #dcdcdc;border-radius:4px;box-shadow:none;background-color:#fff;cursor:pointer;padding:calc(0.375em - 1px) .75em;height:2.25em;vertical-align:top;text-align:center;line-height:1.5;white-space:nowrap;color:#363636;font-size:1rem}.datepicker-controls .button:focus,.datepicker-controls .button:active{outline:none}.datepicker-controls .button:hover{border-color:#b8b8b8;color:#363636}.datepicker-controls .button:focus{border-color:#3273dc;color:#363636}.datepicker-controls .button:focus:not(:active){box-shadow:0 0 0 .125em rgba(50,115,220,.25)}.datepicker-controls .button:active{border-color:#474747;color:#363636}.datepicker-controls .button[disabled]{cursor:not-allowed}.datepicker-header .datepicker-controls .button{border-color:rgba(0,0,0,0);font-weight:bold}.datepicker-header .datepicker-controls .button:hover{background-color:#f9f9f9}.datepicker-header .datepicker-controls .button:active{background-color:#f2f2f2}.datepicker-footer .datepicker-controls .button{flex:auto;margin:calc(.375rem - 1px) .375rem;border-radius:2px;font-size:.75rem}.datepicker-controls .view-switch{flex:auto}.datepicker-controls .prev-button,.datepicker-controls .next-button{padding-right:.375rem;padding-left:.375rem;flex:0 0 14.2857142857%}.datepicker-controls .prev-button.disabled,.datepicker-controls .next-button.disabled{visibility:hidden}.datepicker-view,.datepicker-grid{display:flex}.datepicker-view{align-items:stretch;width:15.75rem}.datepicker-grid{flex-wrap:wrap;flex:auto}.datepicker .days{display:flex;flex-direction:column;flex:auto}.datepicker .days-of-week{display:flex}.datepicker .week-numbers{display:flex;flex-direction:column;flex:0 0 9.6774193548%}.datepicker .weeks{display:flex;flex-direction:column;align-items:stretch;flex:auto}.datepicker span{display:flex;align-items:center;justify-content:center;border-radius:4px;cursor:default;-webkit-touch-callout:none;user-select:none}.datepicker .dow{height:1.5rem;font-size:.875rem;font-weight:700}.datepicker .week{flex:auto;color:#b8b8b8;font-size:.75rem}.datepicker-cell,.datepicker .days .dow{flex-basis:14.2857142857%}.datepicker-cell{height:2.25rem}.datepicker-cell:not(.day){flex-basis:25%;height:4.5rem}.datepicker-cell:not(.disabled):hover{background-color:#f9f9f9;cursor:pointer}.datepicker-cell.focused:not(.selected){background-color:#e9e9e9}.datepicker-cell.selected,.datepicker-cell.selected:hover{background-color:#3273dc;color:#fff;font-weight:600}.datepicker-cell.disabled{color:#dcdcdc}.datepicker-cell.prev:not(.disabled),.datepicker-cell.next:not(.disabled){color:#7a7a7a}.datepicker-cell.prev.selected,.datepicker-cell.next.selected{color:#e6e6e6}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today){border-radius:0;background-color:#f5f5f5}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today):not(.disabled):hover{background-color:#efefef}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today).focused{background-color:#e9e9e9}.datepicker-cell.today:not(.selected){background-color:#00d1b2}.datepicker-cell.today:not(.selected):not(.disabled){color:#fff}.datepicker-cell.today.focused:not(.selected){background-color:#00ccad}.datepicker-cell.range-end:not(.selected),.datepicker-cell.range-start:not(.selected){background-color:#b8b8b8;color:#fff}.datepicker-cell.range-end.focused:not(.selected),.datepicker-cell.range-start.focused:not(.selected){background-color:#b3b3b3}.datepicker-cell.range-start:not(.range-end){border-radius:4px 0 0 4px}.datepicker-cell.range-end:not(.range-start){border-radius:0 4px 4px 0}.datepicker-cell.range{border-radius:0;background-color:#dcdcdc}.datepicker-cell.range:not(.disabled):not(.focused):not(.today):hover{background-color:#d7d7d7}.datepicker-cell.range.disabled{color:#c6c6c6}.datepicker-cell.range.focused{background-color:#d1d1d1}.datepicker-input.in-edit{border-color:#276bda}.datepicker-input.in-edit:focus,.datepicker-input.in-edit:active{box-shadow:0 0 .25em .25em rgba(39,107,218,.2)}
    33.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{background-color:rgba(0,0,0,0);border:none;font-size:1em}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline;list-style:none;padding:0}.select2-container .select2-selection--multiple .select2-selection__clear{background-color:rgba(0,0,0,0);border:none;font-size:1em}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;margin-left:5px;padding:0;max-width:100%;resize:none;height:18px;vertical-align:bottom;font-family:sans-serif;overflow:hidden;word-break:keep-all}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option--selectable{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;height:26px;margin-right:20px;padding-right:0px}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #888 rgba(0,0,0,0);border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;padding-bottom:5px;padding-right:5px;position:relative}.select2-container--default .select2-selection--multiple.select2-selection--clearable{padding-right:25px}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;font-weight:bold;height:20px;margin-right:10px;margin-top:5px;position:absolute;right:0;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:inline-block;margin-left:5px;margin-top:5px;padding:0;padding-left:20px;position:relative;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap}.select2-container--default .select2-selection--multiple .select2-selection__choice__display{cursor:default;padding-left:2px;padding-right:5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{background-color:rgba(0,0,0,0);border:none;border-right:1px solid #aaa;border-top-left-radius:4px;border-bottom-left-radius:4px;color:#999;cursor:pointer;font-size:1em;font-weight:bold;padding:0 4px;position:absolute;left:0;top:0}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus{background-color:#f1f1f1;color:#333;outline:none}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__display{padding-left:5px;padding-right:2px}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{border-left:1px solid #aaa;border-right:none;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__clear{float:left;margin-left:10px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid #000 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:rgba(0,0,0,0);border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--group{padding:0}.select2-container--default .select2-results__option--disabled{color:#999}.select2-container--default .select2-results__option--selected{background-color:#ddd}.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable{background-color:#5897fb;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, white 50%, #eeeeee 100%);background-image:-o-linear-gradient(top, white 50%, #eeeeee 100%);background-image:linear-gradient(to bottom, white 50%, #eeeeee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF", endColorstr="#FFEEEEEE", GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;height:26px;margin-right:20px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE", endColorstr="#FFCCCCCC", GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:rgba(0,0,0,0);border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #888 rgba(0,0,0,0);border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, white 0%, #eeeeee 50%);background-image:-o-linear-gradient(top, white 0%, #eeeeee 50%);background-image:linear-gradient(to bottom, white 0%, #eeeeee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF", endColorstr="#FFEEEEEE", GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eeeeee 50%, white 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, white 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, white 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE", endColorstr="#FFFFFFFF", GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0;padding-bottom:5px;padding-right:5px}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;display:inline-block;margin-left:5px;margin-top:5px;padding:0}.select2-container--classic .select2-selection--multiple .select2-selection__choice__display{cursor:default;padding-left:2px;padding-right:5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{background-color:rgba(0,0,0,0);border:none;border-top-left-radius:4px;border-bottom-left-radius:4px;color:#888;cursor:pointer;font-size:1em;font-weight:bold;padding:0 4px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555;outline:none}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__display{padding-left:5px;padding-right:2px}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid rgba(0,0,0,0)}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option--group{padding:0}.select2-container--classic .select2-results__option--disabled{color:gray}.select2-container--classic .select2-results__option--highlighted.select2-results__option--selectable{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
  • custom-post-types/trunk/assets/js/backend.js

    r2932737 r2955028  
    1 !function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=jQuery},function(e,t,n){},function(e,t,n){var i,r,o;r=[n(0)],void 0===(o="function"==typeof(i=function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;return function(){
     1!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=jQuery},function(e,t,n){},function(e,t,n){var i,r,o;r=[n(0)],void 0===(o="function"==typeof(i=function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;return function(){
    22/**
    33 * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
    44 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
    55 */
    6 var e,n,i;t&&t.requirejs||(t?n=t:t={},function(t){var r,o,s,a,l={},c={},u={},d={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function m(e,t){var n,i,r,o,s,a,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e){for(s=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[s])&&(e[s]=e[s].replace(f,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),d=0;d<e.length;d++)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(i=n.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((r=m[g.slice(0,p).join("/")])&&(r=r[i])){o=r,a=d;break}if(o)break;!l&&v&&v[i]&&(l=v[i],c=d)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function v(e,t){return function(){var n=h.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),o.apply(void 0,n.concat([e,t]))}}function y(e){return function(t){l[e]=t}}function b(e){if(g(c,e)){var t=c[e];delete c[e],d[e]=!0,r.apply(void 0,t)}if(!g(l,e)&&!g(d,e))throw new Error("No "+e);return l[e]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function _(e){return e?w(e):[]}function k(e){return function(){return u&&u.config&&u.config[e]||{}}}s=function(e,t){var n,i,r=w(e),o=r[0],s=t[1];return e=r[1],o&&(n=b(o=m(o,s))),o?e=n&&n.normalize?n.normalize(e,(i=s,function(e){return m(e,i)})):m(e,s):(o=(r=w(e=m(e,s)))[0],e=r[1],o&&(n=b(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:k(e)}}},r=function(e,t,n,i){var r,o,u,p,h,f,m,w=[],k=typeof n;if(f=_(i=i||e),"undefined"===k||"function"===k){for(t=!t.length&&n.length?["require","exports","module"]:t,h=0;h<t.length;h+=1)if("require"===(o=(p=s(t[h],f)).f))w[h]=a.require(e);else if("exports"===o)w[h]=a.exports(e),m=!0;else if("module"===o)r=w[h]=a.module(e);else if(g(l,o)||g(c,o)||g(d,o))w[h]=b(o);else{if(!p.p)throw new Error(e+" missing "+o);p.p.load(p.n,v(i,!0),y(o),{}),w[h]=l[o]}u=n?n.apply(l[e],w):void 0,e&&(r&&void 0!==r.exports&&r.exports!==l[e]?l[e]=r.exports:void 0===u&&m||(l[e]=u))}else e&&(l[e]=n)},e=n=o=function(e,t,n,i,l){if("string"==typeof e)return a[e]?a[e](t):b(s(e,_(t)).f);if(!e.splice){if((u=e).deps&&o(u.deps,u.callback),!t)return;t.splice?(e=t,t=n,n=null):e=void 0}return t=t||function(){},"function"==typeof n&&(n=i,i=l),i?r(void 0,e,t,n):setTimeout((function(){r(void 0,e,t,n)}),4),o},o.config=function(e){return o(e)},e._defined=l,(i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=i)}(),t.define("almond",(function(){})),t.define("jquery",[],(function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t})),t.define("select2/utils",["jquery"],(function(e){var t={};function n(e){var t=e.prototype,n=[];for(var i in t)"function"==typeof t[i]&&"constructor"!==i&&n.push(i);return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},t.Decorate=function(e,t){var i=n(t),r=n(e);function o(){var n=Array.prototype.unshift,i=t.prototype.constructor.length,r=e.prototype.constructor;i>0&&(n.call(arguments,e.prototype.constructor),r=t.prototype.constructor),r.apply(this,arguments)}t.displayName=e.displayName,o.prototype=new function(){this.constructor=o};for(var s=0;s<r.length;s++){var a=r[s];o.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in o.prototype&&(n=o.prototype[e]);var i=t.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(arguments,n),i.apply(this,arguments)}},c=0;c<i.length;c++){var u=i[c];o.prototype[u]=l(u)}return o};var i=function(){this.listeners={}};i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},t.Observable=i,t.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},t.bind=function(e,t){return function(){e.apply(t,arguments)}},t._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),r==n.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},t.hasScroll=function(t,n){var i=e(n),r=n.style.overflowX,o=n.style.overflowY;return(r!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===r||"scroll"===o||i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth)},t.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,(function(e){return t[e]}))},t.__cache={};var r=0;return t.GetUniqueElementId=function(e){var n=e.getAttribute("data-select2-id");return null!=n||(n=e.id?"select2-data-"+e.id:"select2-data-"+(++r).toString()+"-"+t.generateChars(4),e.setAttribute("data-select2-id",n)),n},t.StoreData=function(e,n,i){var r=t.GetUniqueElementId(e);t.__cache[r]||(t.__cache[r]={}),t.__cache[r][n]=i},t.GetData=function(n,i){var r=t.GetUniqueElementId(n);return i?t.__cache[r]&&null!=t.__cache[r][i]?t.__cache[r][i]:e(n).data(i):t.__cache[r]},t.RemoveData=function(e){var n=t.GetUniqueElementId(e);null!=t.__cache[n]&&delete t.__cache[n],e.removeAttribute("data-select2-id")},t.copyNonInternalCssClasses=function(e,t){var n=e.getAttribute("class").trim().split(/\s+/);n=n.filter((function(e){return 0===e.indexOf("select2-")}));var i=t.getAttribute("class").trim().split(/\s+/);i=i.filter((function(e){return 0!==e.indexOf("select2-")}));var r=n.concat(i);e.setAttribute("class",r.join(" "))},t})),t.define("select2/results",["jquery","./utils"],(function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(t.message);i.append(n(r(t.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},n.prototype.position=function(e,t){t.find(".select2-results").append(e)},n.prototype.sort=function(e){return this.options.get("sorter")(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option--selectable"),t=e.filter(".select2-results__option--selected");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var n=this;this.data.current((function(i){var r=i.map((function(e){return e.id.toString()}));n.$results.find(".select2-results__option--selectable").each((function(){var n=e(this),i=t.GetData(this,"data"),o=""+i.id;null!=i.element&&i.element.selected||null==i.element&&r.indexOf(o)>-1?(this.classList.add("select2-results__option--selected"),n.attr("aria-selected","true")):(this.classList.remove("select2-results__option--selected"),n.attr("aria-selected","false"))}))}))},n.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(n){var i=document.createElement("li");i.classList.add("select2-results__option"),i.classList.add("select2-results__option--selectable");var r={role:"option"},o=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var s in(null!=n.element&&o.call(n.element,":disabled")||null==n.element&&n.disabled)&&(r["aria-disabled"]="true",i.classList.remove("select2-results__option--selectable"),i.classList.add("select2-results__option--disabled")),null==n.id&&i.classList.remove("select2-results__option--selectable"),null!=n._resultId&&(i.id=n._resultId),n.title&&(i.title=n.title),n.children&&(r.role="group",r["aria-label"]=n.text,i.classList.remove("select2-results__option--selectable"),i.classList.add("select2-results__option--group")),r){var a=r[s];i.setAttribute(s,a)}if(n.children){var l=e(i),c=document.createElement("strong");c.className="select2-results__group",this.template(n,c);for(var u=[],d=0;d<n.children.length;d++){var p=n.children[d],h=this.option(p);u.push(h)}var f=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"none"});f.append(u),l.append(c),l.append(f)}else this.template(n,i);return t.StoreData(i,"data",n),i},n.prototype.bind=function(n,i){var r=this,o=n.id+"-results";this.$results.attr("id",o),n.on("results:all",(function(e){r.clear(),r.append(e.data),n.isOpen()&&(r.setClasses(),r.highlightFirstItem())})),n.on("results:append",(function(e){r.append(e.data),n.isOpen()&&r.setClasses()})),n.on("query",(function(e){r.hideMessages(),r.showLoading(e)})),n.on("select",(function(){n.isOpen()&&(r.setClasses(),r.options.get("scrollAfterSelect")&&r.highlightFirstItem())})),n.on("unselect",(function(){n.isOpen()&&(r.setClasses(),r.options.get("scrollAfterSelect")&&r.highlightFirstItem())})),n.on("open",(function(){r.$results.attr("aria-expanded","true"),r.$results.attr("aria-hidden","false"),r.setClasses(),r.ensureHighlightVisible()})),n.on("close",(function(){r.$results.attr("aria-expanded","false"),r.$results.attr("aria-hidden","true"),r.$results.removeAttr("aria-activedescendant")})),n.on("results:toggle",(function(){var e=r.getHighlightedResults();0!==e.length&&e.trigger("mouseup")})),n.on("results:select",(function(){var e=r.getHighlightedResults();if(0!==e.length){var n=t.GetData(e[0],"data");e.hasClass("select2-results__option--selected")?r.trigger("close",{}):r.trigger("select",{data:n})}})),n.on("results:previous",(function(){var e=r.getHighlightedResults(),t=r.$results.find(".select2-results__option--selectable"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var o=t.eq(i);o.trigger("mouseenter");var s=r.$results.offset().top,a=o.offset().top,l=r.$results.scrollTop()+(a-s);0===i?r.$results.scrollTop(0):a-s<0&&r.$results.scrollTop(l)}})),n.on("results:next",(function(){var e=r.getHighlightedResults(),t=r.$results.find(".select2-results__option--selectable"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var o=r.$results.offset().top+r.$results.outerHeight(!1),s=i.offset().top+i.outerHeight(!1),a=r.$results.scrollTop()+s-o;0===n?r.$results.scrollTop(0):s>o&&r.$results.scrollTop(a)}})),n.on("results:focus",(function(e){e.element[0].classList.add("select2-results__option--highlighted"),e.element[0].setAttribute("aria-selected","true")})),n.on("results:message",(function(e){r.displayMessage(e)})),e.fn.mousewheel&&this.$results.on("mousewheel",(function(e){var t=r.$results.scrollTop(),n=r.$results.get(0).scrollHeight-t+e.deltaY,i=e.deltaY>0&&t-e.deltaY<=0,o=e.deltaY<0&&n<=r.$results.height();i?(r.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):o&&(r.$results.scrollTop(r.$results.get(0).scrollHeight-r.$results.height()),e.preventDefault(),e.stopPropagation())})),this.$results.on("mouseup",".select2-results__option--selectable",(function(n){var i=e(this),o=t.GetData(this,"data");i.hasClass("select2-results__option--selected")?r.options.get("multiple")?r.trigger("unselect",{originalEvent:n,data:o}):r.trigger("close",{}):r.trigger("select",{originalEvent:n,data:o})})),this.$results.on("mouseenter",".select2-results__option--selectable",(function(n){var i=t.GetData(this,"data");r.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),r.trigger("results:focus",{data:i,element:e(this)})}))},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find(".select2-results__option--selectable").index(e),n=this.$results.offset().top,i=e.offset().top,r=this.$results.scrollTop()+(i-n),o=i-n;r-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),o=i(t,n);null==o?n.style.display="none":"string"==typeof o?n.innerHTML=r(o):e(n).append(o)},n})),t.define("select2/keys",[],(function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),t.define("select2/selection/base",["jquery","../utils","../keys"],(function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var n=e('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=t.GetData(this.$element[0],"old-tabindex")?this._tabindex=t.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),n.attr("title",this.$element.attr("title")),n.attr("tabindex",this._tabindex),n.attr("aria-disabled","false"),this.$selection=n,n},i.prototype.bind=function(e,t){var i=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",(function(e){i.trigger("focus",e)})),this.$selection.on("blur",(function(e){i._handleBlur(e)})),this.$selection.on("keydown",(function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()})),e.on("results:focus",(function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)})),e.on("selection:update",(function(e){i.update(e.data)})),e.on("open",(function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",r),i._attachCloseHandler(e)})),e.on("close",(function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.trigger("focus"),i._detachCloseHandler(e)})),e.on("enable",(function(){i.$selection.attr("tabindex",i._tabindex),i.$selection.attr("aria-disabled","false")})),e.on("disable",(function(){i.$selection.attr("tabindex","-1"),i.$selection.attr("aria-disabled","true")}))},i.prototype._handleBlur=function(t){var n=this;window.setTimeout((function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)}),1)},i.prototype._attachCloseHandler=function(n){e(document.body).on("mousedown.select2."+n.id,(function(n){var i=e(n.target).closest(".select2");e(".select2.select2-container--open").each((function(){this!=i[0]&&t.GetData(this,"element").select2("close")}))}))},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},i.prototype.position=function(e,t){t.find(".selection").append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i.prototype.isEnabled=function(){return!this.isDisabled()},i.prototype.isDisabled=function(){return this.options.get("disabled")},i})),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.attr("aria-controls",i),this.$selection.on("mousedown",(function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})})),this.$selection.on("focus",(function(e){})),this.$selection.on("blur",(function(e){})),e.on("focus",(function(t){e.isOpen()||n.$selection.trigger("focus")}))},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r})),t.define("select2/selection/multiple",["jquery","./base","../utils"],(function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,r){var o=this;i.__super__.bind.apply(this,arguments);var s=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s),this.$selection.on("click",(function(e){o.trigger("toggle",{originalEvent:e})})),this.$selection.on("click",".select2-selection__choice__remove",(function(t){if(!o.isDisabled()){var i=e(this).parent(),r=n.GetData(i[0],"data");o.trigger("unselect",{originalEvent:t,data:r})}})),this.$selection.on("keydown",".select2-selection__choice__remove",(function(e){o.isDisabled()||e.stopPropagation()}))},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e('<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">&times;</span></button><span class="select2-selection__choice__display"></span></li>')},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=this.$selection.find(".select2-selection__rendered").attr("id")+"-choice-",r=0;r<e.length;r++){var o=e[r],s=this.selectionContainer(),a=this.display(o,s),l=i+n.generateChars(4)+"-";o.id?l+=o.id:l+=n.generateChars(4),s.find(".select2-selection__choice__display").append(a).attr("id",l);var c=o.title||o.text;c&&s.attr("title",c);var u=this.options.get("translations").get("removeItem"),d=s.find(".select2-selection__choice__remove");d.attr("title",u()),d.attr("aria-label",u()),d.attr("aria-describedby",l),n.StoreData(s[0],"data",o),t.push(s)}this.$selection.find(".select2-selection__rendered").append(t)}},i})),t.define("select2/selection/placeholder",[],(function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();n.html(this.display(t)),n[0].classList.add("select2-selection__placeholder"),n[0].classList.remove("select2-selection__choice");var i=t.title||t.text||n.text();return this.$selection.find(".select2-selection__rendered").attr("title",i),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},e})),t.define("select2/selection/allowClear",["jquery","../keys","../utils"],(function(e,t,n){function i(){}return i.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",(function(e){i._handleClear(e)})),t.on("keypress",(function(e){i._handleKeyboardClear(e,t)}))},i.prototype._handleClear=function(e,t){if(!this.isDisabled()){var i=this.$selection.find(".select2-selection__clear");if(0!==i.length){t.stopPropagation();var r=n.GetData(i[0],"data"),o=this.$element.val();this.$element.val(this.placeholder.id);var s={data:r};if(this.trigger("clear",s),s.prevented)this.$element.val(o);else{for(var a=0;a<r.length;a++)if(s={data:r[a]},this.trigger("unselect",s),s.prevented)return void this.$element.val(o);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},i.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},i.prototype.update=function(t,i){if(t.call(this,i),this.$selection.find(".select2-selection__clear").remove(),this.$selection[0].classList.remove("select2-selection--clearable"),!(this.$selection.find(".select2-selection__placeholder").length>0||0===i.length)){var r=this.$selection.find(".select2-selection__rendered").attr("id"),o=this.options.get("translations").get("removeAllItems"),s=e('<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">&times;</span></button>');s.attr("title",o()),s.attr("aria-label",o()),s.attr("aria-describedby",r),n.StoreData(s[0],"data",i),this.$selection.prepend(s),this.$selection[0].classList.add("select2-selection--clearable")}},i})),t.define("select2/selection/search",["jquery","../utils","../keys"],(function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=this.options.get("translations").get("search"),i=e('<span class="select2-search select2-search--inline"><textarea class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" ></textarea></span>');this.$searchContainer=i,this.$search=i.find("textarea"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",n());var r=t.call(this);return this._transferTabIndex(),r.append(this.$searchContainer),r},i.prototype.bind=function(e,i,r){var o=this,s=i.id+"-results",a=i.id+"-container";e.call(this,i,r),o.$search.attr("aria-describedby",a),i.on("open",(function(){o.$search.attr("aria-controls",s),o.$search.trigger("focus")})),i.on("close",(function(){o.$search.val(""),o.resizeSearch(),o.$search.removeAttr("aria-controls"),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")})),i.on("enable",(function(){o.$search.prop("disabled",!1),o._transferTabIndex()})),i.on("disable",(function(){o.$search.prop("disabled",!0)})),i.on("focus",(function(e){o.$search.trigger("focus")})),i.on("results:focus",(function(e){e.data._resultId?o.$search.attr("aria-activedescendant",e.data._resultId):o.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search--inline",(function(e){o.trigger("focus",e)})),this.$selection.on("focusout",".select2-search--inline",(function(e){o._handleBlur(e)})),this.$selection.on("keydown",".select2-search--inline",(function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===o.$search.val()){var i=o.$selection.find(".select2-selection__choice").last();if(i.length>0){var r=t.GetData(i[0],"data");o.searchRemoveChoice(r),e.preventDefault()}}})),this.$selection.on("click",".select2-search--inline",(function(e){o.$search.val()&&e.stopPropagation()}));var l=document.documentMode,c=l&&l<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(e){c?o.$selection.off("input.search input.searchcheck"):o.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(e){if(c&&"input"===e.type)o.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&o.handleSearch(e)}}))},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger("focus")},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="100%";""===this.$search.attr("placeholder")&&(e=.75*(this.$search.val().length+1)+"em"),this.$search.css("width",e)},i})),t.define("select2/selection/selectionCss",["../utils"],(function(e){function t(){}return t.prototype.render=function(t){var n=t.call(this),i=this.options.get("selectionCssClass")||"";return-1!==i.indexOf(":all:")&&(i=i.replace(":all:",""),e.copyNonInternalCssClasses(n[0],this.$element[0])),n.addClass(i),n},t})),t.define("select2/selection/eventRelay",["jquery"],(function(e){function t(){}return t.prototype.bind=function(t,n,i){var r=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],s=["opening","closing","selecting","unselecting","clearing"];t.call(this,n,i),n.on("*",(function(t,n){if(-1!==o.indexOf(t)){n=n||{};var i=e.Event("select2:"+t,{params:n});r.$element.trigger(i),-1!==s.indexOf(t)&&(n.prevented=i.isDefaultPrevented())}}))},t})),t.define("select2/translation",["jquery","require"],(function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n})),t.define("select2/diacritics",[],(function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}})),t.define("select2/data/base",["../utils"],(function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),null!=n.id?i+="-"+n.id.toString():i+="-"+e.generateChars(4),i},t})),t.define("select2/data/select",["./base","../utils","jquery"],(function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),(function(e){return t.item(n(e))})))},i.prototype.select=function(e){var t=this;if(e.selected=!0,null!=e.element&&"option"===e.element.tagName.toLowerCase())return e.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(n){var i=[];(e=[e]).push.apply(e,n);for(var r=0;r<e.length;r++){var o=e[r].id;-1===i.indexOf(o)&&i.push(o)}t.$element.val(i),t.$element.trigger("input").trigger("change")}));else{var n=e.id;this.$element.val(n),this.$element.trigger("input").trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,null!=e.element&&"option"===e.element.tagName.toLowerCase())return e.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current((function(n){for(var i=[],r=0;r<n.length;r++){var o=n[r].id;o!==e.id&&-1===i.indexOf(o)&&i.push(o)}t.$element.val(i),t.$element.trigger("input").trigger("change")}))}},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",(function(e){n.select(e.data)})),e.on("unselect",(function(e){n.unselect(e.data)}))},i.prototype.destroy=function(){this.$element.find("*").each((function(){t.RemoveData(this)}))},i.prototype.query=function(e,t){var i=[],r=this;this.$element.children().each((function(){if("option"===this.tagName.toLowerCase()||"optgroup"===this.tagName.toLowerCase()){var t=n(this),o=r.item(t),s=r.matches(e,o);null!==s&&i.push(s)}})),t({results:i})},i.prototype.addOptions=function(e){this.$element.append(e)},i.prototype.option=function(e){var i;e.children?(i=document.createElement("optgroup")).label=e.text:void 0!==(i=document.createElement("option")).textContent?i.textContent=e.text:i.innerText=e.text,void 0!==e.id&&(i.value=e.id),e.disabled&&(i.disabled=!0),e.selected&&(i.selected=!0),e.title&&(i.title=e.title);var r=this._normalizeItem(e);return r.element=i,t.StoreData(i,"data",r),n(i)},i.prototype.item=function(e){var i={};if(null!=(i=t.GetData(e[0],"data")))return i;var r=e[0];if("option"===r.tagName.toLowerCase())i={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if("optgroup"===r.tagName.toLowerCase()){i={text:e.prop("label"),children:[],title:e.prop("title")};for(var o=e.children("option"),s=[],a=0;a<o.length;a++){var l=n(o[a]),c=this.item(l);s.push(c)}i.children=s}return(i=this._normalizeItem(i)).element=e[0],t.StoreData(e[0],"data",i),i},i.prototype._normalizeItem=function(e){return e!==Object(e)&&(e={id:e,text:e}),null!=(e=n.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},{selected:!1,disabled:!1},e)},i.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},i})),t.define("select2/data/array",["./select","../utils","jquery"],(function(e,t,n){function i(e,t){this._dataToConvert=t.get("data")||[],i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype.bind=function(e,t){i.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},i.prototype.select=function(e){var t=this.$element.find("option").filter((function(t,n){return n.value==e.id.toString()}));0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){var t=this,i=this.$element.find("option"),r=i.map((function(){return t.item(n(this)).id})).get(),o=[];function s(e){return function(){return n(this).val()==e.id}}for(var a=0;a<e.length;a++){var l=this._normalizeItem(e[a]);if(r.indexOf(l.id)>=0){var c=i.filter(s(l)),u=this.item(c),d=n.extend(!0,{},l,u),p=this.option(d);c.replaceWith(p)}else{var h=this.option(l);if(l.children){var f=this.convertToOptions(l.children);h.append(f)}o.push(h)}}return o},i})),t.define("select2/data/ajax",["./array","../utils","jquery"],(function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var r=n.ajax(e);return r.then(t),r.fail(i),r}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){var i=this;null!=this._request&&("function"==typeof this._request.abort&&this._request.abort(),this._request=null);var r=n.extend({type:"GET"},this.ajaxOptions);function o(){var n=r.transport(r,(function(n){var r=i.processResults(n,e);i.options.get("debug")&&window.console&&console.error&&(r&&r.results&&Array.isArray(r.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(r)}),(function(){(!("status"in n)||0!==n.status&&"0"!==n.status)&&i.trigger("results:message",{message:"errorLoading"})}));i._request=n}"function"==typeof r.url&&(r.url=r.url.call(this.$element,e)),"function"==typeof r.data&&(r.data=r.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(o,this.ajaxOptions.delay)):o()},i})),t.define("select2/data/tags",["jquery"],(function(e){function t(e,t,n){var i=n.get("tags"),r=n.get("createTag");void 0!==r&&(this.createTag=r);var o=n.get("insertTag");if(void 0!==o&&(this.insertTag=o),e.call(this,t,n),Array.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return t.prototype.query=function(e,t,n){var i=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,(function e(r,o){for(var s=r.results,a=0;a<s.length;a++){var l=s[a],c=null!=l.children&&!e({results:l.children},!0);if((l.text||"").toUpperCase()===(t.term||"").toUpperCase()||c)return!o&&(r.data=s,void n(r))}if(o)return!0;var u=i.createTag(t);if(null!=u){var d=i.option(u);d.attr("data-select2-tag","true"),i.addOptions([d]),i.insertTag(s,u)}r.results=s,n(r)})):e.call(this,t,n)},t.prototype.createTag=function(e,t){if(null==t.term)return null;var n=t.term.trim();return""===n?null:{id:n,text:n}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){this.$element.find("option[data-select2-tag]").each((function(){this.selected||e(this).remove()}))},t})),t.define("select2/data/tokenizer",["jquery"],(function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,i){var r=this;n.term=n.term||"";var o=this.tokenizer(n,this.options,(function(t){var n=r._normalizeItem(t);if(!r.$element.find("option").filter((function(){return e(this).val()===n.id})).length){var i=r.option(n);i.attr("data-select2-tag",!0),r._removeOldTags(),r.addOptions([i])}!function(e){r.trigger("select",{data:e})}(n)}));o.term!==n.term&&(this.$search.length&&(this.$search.val(o.term),this.$search.trigger("focus")),n.term=o.term),t.call(this,n,i)},t.prototype.tokenizer=function(t,n,i,r){for(var o=i.get("tokenSeparators")||[],s=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<s.length;){var c=s[a];if(-1!==o.indexOf(c)){var u=s.substr(0,a),d=l(e.extend({},n,{term:u}));null!=d?(r(d),s=s.substr(a+1)||"",a=0):a++}else a++}return{term:s}},t})),t.define("select2/data/minimumInputLength",[],(function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumInputLength",[],(function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumSelectionLength",[],(function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",(function(){i._checkIfMaximumSelected()}))},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected((function(){e.call(i,t,n)}))},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current((function(e){var i=null!=e?e.length:0;n.maximumSelectionLength>0&&i>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()}))},e})),t.define("select2/dropdown",["jquery","./utils"],(function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n})),t.define("select2/dropdown/search",["jquery"],(function(e){function t(){}return t.prototype.render=function(t){var n=t.call(this),i=this.options.get("translations").get("search"),r=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=r,this.$search=r.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",i()),n.prepend(r),n},t.prototype.bind=function(t,n,i){var r=this,o=n.id+"-results";t.call(this,n,i),this.$search.on("keydown",(function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()})),this.$search.on("input",(function(t){e(this).off("keyup")})),this.$search.on("keyup input",(function(e){r.handleSearch(e)})),n.on("open",(function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",o),r.$search.trigger("focus"),window.setTimeout((function(){r.$search.trigger("focus")}),0)})),n.on("close",(function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")})),n.on("focus",(function(){n.isOpen()||r.$search.trigger("focus")})),n.on("results:all",(function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer[0].classList.remove("select2-search--hide"):r.$searchContainer[0].classList.add("select2-search--hide"))})),n.on("results:focus",(function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}))},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t})),t.define("select2/dropdown/hidePlaceholder",[],(function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e})),t.define("select2/dropdown/infiniteScroll",["jquery"],(function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",(function(e){i.lastParams=e,i.loading=!0})),t.on("query:append",(function(e){i.lastParams=e,i.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=e.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&t&&this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore()},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t})),t.define("select2/dropdown/attachBody",["jquery","../utils"],(function(e,t){function n(t,n,i){this.$dropdownParent=e(i.get("dropdownParent")||document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",(function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)})),t.on("close",(function(){i._hideDropdown(),i._detachPositioningHandler(t)})),this.$dropdownContainer.on("mousedown",(function(e){e.stopPropagation()}))},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t[0].classList.remove("select2"),t[0].classList.add("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:append",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:message",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("select",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("unselect",(function(){n._positionDropdown(),n._resizeDropdown()})),this._containerResultsHandlersBound=!0}},n.prototype._attachPositioningHandler=function(n,i){var r=this,o="scroll.select2."+i.id,s="resize.select2."+i.id,a="orientationchange.select2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each((function(){t.StoreData(this,"select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})})),l.on(o,(function(n){var i=t.GetData(this,"select2-scroll-position");e(this).scrollTop(i.y)})),e(window).on(o+" "+s+" "+a,(function(e){r._positionDropdown(),r._resizeDropdown()}))},n.prototype._detachPositioningHandler=function(n,i){var r="scroll.select2."+i.id,o="resize.select2."+i.id,s="orientationchange.select2."+i.id;this.$container.parents().filter(t.hasScroll).off(r),e(window).off(r+" "+o+" "+s)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown[0].classList.contains("select2-dropdown--above"),i=this.$dropdown[0].classList.contains("select2-dropdown--below"),r=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var a=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),u=l<o.top-a,d=c>o.bottom+a,p={left:o.left,top:s.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var f={top:0,left:0};(e.contains(document.body,h[0])||h[0].isConnected)&&(f=h.offset()),p.top-=f.top,p.left-=f.left,n||i||(r="below"),d||!u||n?!u&&d&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(p.top=s.top-f.top-a),null!=r&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+r),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+r)),this.$dropdownContainer.css(p)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n})),t.define("select2/dropdown/minimumResultsForSearch",[],(function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];r.children?n+=e(r.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e})),t.define("select2/dropdown/selectOnClose",["../utils"],(function(e){function t(){}return t.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",(function(e){i._handleSelectOnClose(e)}))},t.prototype._handleSelectOnClose=function(t,n){if(n&&null!=n.originalSelect2Event){var i=n.originalSelect2Event;if("select"===i._type||"unselect"===i._type)return}var r=this.getHighlightedResults();if(!(r.length<1)){var o=e.GetData(r[0],"data");null!=o.element&&o.element.selected||null==o.element&&o.selected||this.trigger("select",{data:o})}},t})),t.define("select2/dropdown/closeOnSelect",[],(function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",(function(e){i._selectTriggered(e)})),t.on("unselect",(function(e){i._selectTriggered(e)}))},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e})),t.define("select2/dropdown/dropdownCss",["../utils"],(function(e){function t(){}return t.prototype.render=function(t){var n=t.call(this),i=this.options.get("dropdownCssClass")||"";return-1!==i.indexOf(":all:")&&(i=i.replace(":all:",""),e.copyNonInternalCssClasses(n[0],this.$element[0])),n.addClass(i),n},t})),t.define("select2/dropdown/tagsSearchHighlight",["../utils"],(function(e){function t(){}return t.prototype.highlightFirstItem=function(t){var n=this.$results.find(".select2-results__option--selectable:not(.select2-results__option--selected)");if(n.length>0){var i=n.first(),r=e.GetData(i[0],"data").element;if(r&&r.getAttribute&&"true"===r.getAttribute("data-select2-tag"))return void i.trigger("mouseenter")}t.call(this)},t})),t.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"},removeItem:function(){return"Remove item"},search:function(){return"Search"}}})),t.define("select2/defaults",["jquery","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/selectionCss","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./dropdown/dropdownCss","./dropdown/tagsSearchHighlight","./i18n/en"],(function(e,t,n,i,r,o,s,a,l,c,u,d,p,h,f,g,m,v,y,b,w,_,k,x,D,S,$,E,C,O,A){function L(){this.reset()}return L.prototype.apply=function(u){if(null==(u=e.extend(!0,{},this.defaults,u)).dataAdapter&&(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=h:u.dataAdapter=p,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,b)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,m))),null==u.resultsAdapter&&(u.resultsAdapter=t,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,x)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,k)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,$)),u.tags&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,O))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=w;else{var d=c.Decorate(w,_);u.dropdownAdapter=d}0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,S)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,E)),null!=u.dropdownCssClass&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,C)),u.dropdownAdapter=c.Decorate(u.dropdownAdapter,D)}null==u.selectionAdapter&&(u.multiple?u.selectionAdapter=i:u.selectionAdapter=n,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,r)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,o)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),null!=u.selectionCssClass&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),u.selectionAdapter=c.Decorate(u.selectionAdapter,l)),u.language=this._resolveLanguage(u.language),u.language.push("en");for(var A=[],L=0;L<u.language.length;L++){var j=u.language[L];-1===A.indexOf(j)&&A.push(j)}return u.language=A,u.translations=this._processTranslations(u.language,u.debug),u},L.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,(function(e){return d[e]||e}))}this.defaults={amdLanguageBase:"./i18n/",autocomplete:"off",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:{},matcher:function n(i,r){if(null==i.term||""===i.term.trim())return r;if(r.children&&r.children.length>0){for(var o=e.extend(!0,{},r),s=r.children.length-1;s>=0;s--)null==n(i,r.children[s])&&o.children.splice(s,1);return o.children.length>0?o:n(i,o)}var a=t(r.text).toUpperCase(),l=t(i.term).toUpperCase();return a.indexOf(l)>-1?r:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},L.prototype.applyFromElement=function(e,t){var n=e.language,i=this.defaults.language,r=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(r),this._resolveLanguage(n),this._resolveLanguage(i),this._resolveLanguage(o));return e.language=s,e},L.prototype._resolveLanguage=function(t){if(!t)return[];if(e.isEmptyObject(t))return[];if(e.isPlainObject(t))return[t];var n;n=Array.isArray(t)?t:[t];for(var i=[],r=0;r<n.length;r++)if(i.push(n[r]),"string"==typeof n[r]&&n[r].indexOf("-")>0){var o=n[r].split("-")[0];i.push(o)}return i},L.prototype._processTranslations=function(t,n){for(var i=new u,r=0;r<t.length;r++){var o=new u,s=t[r];if("string"==typeof s)try{o=u.loadPath(s)}catch(e){try{s=this.defaults.amdLanguageBase+s,o=u.loadPath(s)}catch(e){n&&window.console&&console.warn&&console.warn('Select2: The language file for "'+s+'" could not be automatically loaded. A fallback will be used instead.')}}else o=e.isPlainObject(s)?new u(s):s;i.extend(o)}return i},L.prototype.set=function(t,n){var i={};i[e.camelCase(t)]=n;var r=c._convertData(i);e.extend(!0,this.defaults,r)},new L})),t.define("select2/options",["jquery","./defaults","./utils"],(function(e,t,n){function i(e,n){this.options=e,null!=n&&this.fromElement(n),null!=n&&(this.options=t.applyFromElement(this.options,n)),this.options=t.apply(this.options)}return i.prototype.fromElement=function(t){var i=["select2"];null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.autocomplete&&t.prop("autocomplete")&&(this.options.autocomplete=t.prop("autocomplete")),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),n.GetData(t[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),n.StoreData(t[0],"data",n.GetData(t[0],"select2Tags")),n.StoreData(t[0],"tags",!0)),n.GetData(t[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),t.attr("ajax--url",n.GetData(t[0],"ajaxUrl")),n.StoreData(t[0],"ajax-Url",n.GetData(t[0],"ajaxUrl")));var r={};function o(e,t){return t.toUpperCase()}for(var s=0;s<t[0].attributes.length;s++){var a=t[0].attributes[s].name;if("data-"==a.substr(0,"data-".length)){var l=a.substring("data-".length),c=n.GetData(t[0],l);r[l.replace(/-([a-z])/g,o)]=c}}e.fn.jquery&&"1."==e.fn.jquery.substr(0,2)&&t[0].dataset&&(r=e.extend(!0,{},t[0].dataset,r));var u=e.extend(!0,{},n.GetData(t[0]),r);for(var d in u=n._convertData(u))i.indexOf(d)>-1||(e.isPlainObject(this.options[d])?e.extend(this.options[d],u[d]):this.options[d]=u[d]);return this},i.prototype.get=function(e){return this.options[e]},i.prototype.set=function(e,t){this.options[e]=t},i})),t.define("select2/core",["jquery","./options","./utils","./keys"],(function(e,t,n,i){var r=function(e,i){null!=n.GetData(e[0],"select2")&&n.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),i=i||{},this.options=new t(i,e),r.__super__.constructor.call(this);var o=e.attr("tabindex")||0;n.StoreData(e[0],"old-tabindex",o),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var a=this.render();this._placeContainer(a);var l=this.options.get("selectionAdapter");this.selection=new l(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var c=this.options.get("dropdownAdapter");this.dropdown=new c(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var u=this.options.get("resultsAdapter");this.results=new u(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var d=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(e){d.trigger("selection:update",{data:e})})),e[0].classList.add("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),n.StoreData(e[0],"select2",this),e.data("select2",this)};return n.Extend(r,n.Observable),r.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},r.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},r.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"==t){var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&c.length>=1)return c[1]}return null}return"computedstyle"==t?window.getComputedStyle(e[0]).width:t},r.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},r.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",(function(){e.dataAdapter.current((function(t){e.trigger("selection:update",{data:t})}))})),this.$element.on("focus.select2",(function(t){e.trigger("focus",t)})),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this._observer=new window.MutationObserver((function(t){e._syncA(),e._syncS(t)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},r.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",(function(t,n){e.trigger(t,n)}))},r.prototype._registerSelectionEvents=function(){var e=this,t=["toggle","focus"];this.selection.on("toggle",(function(){e.toggleDropdown()})),this.selection.on("focus",(function(t){e.focus(t)})),this.selection.on("*",(function(n,i){-1===t.indexOf(n)&&e.trigger(n,i)}))},r.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",(function(t,n){e.trigger(t,n)}))},r.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",(function(t,n){e.trigger(t,n)}))},r.prototype._registerEvents=function(){var e=this;this.on("open",(function(){e.$container[0].classList.add("select2-container--open")})),this.on("close",(function(){e.$container[0].classList.remove("select2-container--open")})),this.on("enable",(function(){e.$container[0].classList.remove("select2-container--disabled")})),this.on("disable",(function(){e.$container[0].classList.add("select2-container--disabled")})),this.on("blur",(function(){e.$container[0].classList.remove("select2-container--focus")})),this.on("query",(function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,(function(n){e.trigger("results:all",{data:n,query:t})}))})),this.on("query:append",(function(t){this.dataAdapter.query(t,(function(n){e.trigger("results:append",{data:n,query:t})}))})),this.on("keypress",(function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.UP&&t.altKey?(e.close(t),t.preventDefault()):n===i.ENTER||n===i.TAB?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())}))},r.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},r.prototype._isChangeMutation=function(e){var t=this;if(e.addedNodes&&e.addedNodes.length>0){for(var n=0;n<e.addedNodes.length;n++)if(e.addedNodes[n].selected)return!0}else{if(e.removedNodes&&e.removedNodes.length>0)return!0;if(Array.isArray(e))return e.some((function(e){return t._isChangeMutation(e)}))}return!1},r.prototype._syncSubtree=function(e){var t=this._isChangeMutation(e),n=this;t&&this.dataAdapter.current((function(e){n.trigger("selection:update",{data:e})}))},r.prototype.trigger=function(e,t){var n=r.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in i){var o=i[e],s={prevented:!1,name:e,args:t};if(n.call(this,o,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},r.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},r.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get("disabled")},r.prototype.isOpen=function(){return this.$container[0].classList.contains("select2-container--open")},r.prototype.hasFocus=function(){return this.$container[0].classList.contains("select2-container--focus")},r.prototype.focus=function(e){this.hasFocus()||(this.$container[0].classList.add("select2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},r.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current((function(t){e=t})),e},r.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];Array.isArray(t)&&(t=t.map((function(e){return e.toString()}))),this.$element.val(t).trigger("input").trigger("change")},r.prototype.destroy=function(){n.RemoveData(this.$container[0]),this.$container.remove(),this._observer.disconnect(),this._observer=null,this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",n.GetData(this.$element[0],"old-tabindex")),this.$element[0].classList.remove("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),n.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),n.StoreData(t[0],"element",this.$element),t},r})),t.define("jquery-mousewheel",["jquery"],(function(e){return e})),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],(function(e,t,n,i,r){if(null==e.fn.select2){var o=["open","close","destroy"];e.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each((function(){var i=e.extend(!0,{},t);new n(e(this),i)})),this;if("string"==typeof t){var i,s=Array.prototype.slice.call(arguments,1);return this.each((function(){var e=r.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),i=e[t].apply(e,s)})),o.indexOf(t)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=i),n})),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n})?i.apply(t,r):i)||(e.exports=o)},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n.p,n.p,n(3);var i=n(0),r=n.n(i);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),a=new E(r||[]);return i(s,"_invoke",{value:x(e,n,a)}),s}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var h={};function f(){}function g(){}function m(){}var v={};u(v,a,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(C([])));b&&b!==t&&n.call(b,a)&&(v=b);var w=m.prototype=f.prototype=Object.create(v);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){var r;i(this,"_invoke",{value:function(i,s){function a(){return new t((function(r,a){!function i(r,s,a,l){var c=p(e[r],e,s);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,l)}))}l(c.arg)}(i,s,r,a)}))}return r=r?r.then(a,a):a()}})}function x(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return O()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=D(s,n);if(a){if(a===h)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=p(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function D(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,D(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var r=p(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,h;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function $(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return g.prototype=m,i(w,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new k(d(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=C,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),$(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;$(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function a(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(i,r)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){a(o,i,r,s,l,"next",e)}function l(e){a(o,i,r,s,l,"throw",e)}s(void 0)}))}}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,s=void 0,s=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===o(s)?s:String(s)),i)}var r,s}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"appendFieldEvents",value:function(e,t){this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]);var n=this.fieldsEvents[e];n&&r.a.each(n,(function(e,n){r()(t).on(e,(function(e){n(t,e)}))}))}},{key:"sanitizeTitle",value:function(e){e=(e=e.replace(/^\s+|\s+$/g,"")).toLowerCase();for(var t="àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;",n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuuncescrzyuudtn------".charAt(n));return e=e.replace(".","-").replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/\//g,"")}},{key:"autoFillKey",value:function(e,t){var n=this;r()(t).add(e).on("focusout",(function(){var i=r()(e).val(),o=r()(t).val();!i.length&&o.length&&r()(e).val(n.sanitizeTitle(o))}))}},{key:"copyToClipboard",value:function(e){var t=navigator.clipboard.writeText(r()(e).val()).then((function(){return!0}),(function(){return!1}));return l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"disableProFieldSelectOptions",value:function(e){var t=r()(e).closest(".cpt-fields-section");if(t&&"manage_cpt_field"===t.data("id")){var n=r()(e).find("select > option");r.a.each(n,(function(e,t){t.text.endsWith(" [PRO only]")&&(t.disabled=!0)}))}}}])&&c(t.prototype,n),i&&c(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();window.cptUtils=new u,wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.checkbox={load:function(e,t){var n=r()(e).find('input[type="checkbox"][required]');r()(n).on("click",(function(t){r()(n).prop("required",!r()(e).find('input[type="checkbox"]:checked').length)}))}},e}));
    7 /*!
    8  * vanilla-picker v2.12.1
    9  * https://vanilla-picker.js.org
     6var e,n,i;t&&t.requirejs||(t?n=t:t={},function(t){var r,o,s,a,l={},c={},u={},d={},h=Object.prototype.hasOwnProperty,p=[].slice,f=/\.js$/;function g(e,t){return h.call(e,t)}function m(e,t){var n,i,r,o,s,a,l,c,d,h,p,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e){for(s=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[s])&&(e[s]=e[s].replace(f,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),d=0;d<e.length;d++)if("."===(p=e[d]))e.splice(d,1),d-=1;else if(".."===p){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((g||v)&&m){for(d=(n=e.split("/")).length;d>0;d-=1){if(i=n.slice(0,d).join("/"),g)for(h=g.length;h>0;h-=1)if((r=m[g.slice(0,h).join("/")])&&(r=r[i])){o=r,a=d;break}if(o)break;!l&&v&&v[i]&&(l=v[i],c=d)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function v(e,t){return function(){var n=p.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),o.apply(void 0,n.concat([e,t]))}}function y(e){return function(t){l[e]=t}}function b(e){if(g(c,e)){var t=c[e];delete c[e],d[e]=!0,r.apply(void 0,t)}if(!g(l,e)&&!g(d,e))throw new Error("No "+e);return l[e]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function _(e){return e?w(e):[]}function k(e){return function(){return u&&u.config&&u.config[e]||{}}}s=function(e,t){var n,i,r=w(e),o=r[0],s=t[1];return e=r[1],o&&(n=b(o=m(o,s))),o?e=n&&n.normalize?n.normalize(e,(i=s,function(e){return m(e,i)})):m(e,s):(o=(r=w(e=m(e,s)))[0],e=r[1],o&&(n=b(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},a={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:k(e)}}},r=function(e,t,n,i){var r,o,u,h,p,f,m,w=[],k=typeof n;if(f=_(i=i||e),"undefined"===k||"function"===k){for(t=!t.length&&n.length?["require","exports","module"]:t,p=0;p<t.length;p+=1)if("require"===(o=(h=s(t[p],f)).f))w[p]=a.require(e);else if("exports"===o)w[p]=a.exports(e),m=!0;else if("module"===o)r=w[p]=a.module(e);else if(g(l,o)||g(c,o)||g(d,o))w[p]=b(o);else{if(!h.p)throw new Error(e+" missing "+o);h.p.load(h.n,v(i,!0),y(o),{}),w[p]=l[o]}u=n?n.apply(l[e],w):void 0,e&&(r&&void 0!==r.exports&&r.exports!==l[e]?l[e]=r.exports:void 0===u&&m||(l[e]=u))}else e&&(l[e]=n)},e=n=o=function(e,t,n,i,l){if("string"==typeof e)return a[e]?a[e](t):b(s(e,_(t)).f);if(!e.splice){if((u=e).deps&&o(u.deps,u.callback),!t)return;t.splice?(e=t,t=n,n=null):e=void 0}return t=t||function(){},"function"==typeof n&&(n=i,i=l),i?r(void 0,e,t,n):setTimeout((function(){r(void 0,e,t,n)}),4),o},o.config=function(e){return o(e)},e._defined=l,(i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=i)}(),t.define("almond",(function(){})),t.define("jquery",[],(function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t})),t.define("select2/utils",["jquery"],(function(e){var t={};function n(e){var t=e.prototype,n=[];for(var i in t)"function"==typeof t[i]&&"constructor"!==i&&n.push(i);return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},t.Decorate=function(e,t){var i=n(t),r=n(e);function o(){var n=Array.prototype.unshift,i=t.prototype.constructor.length,r=e.prototype.constructor;i>0&&(n.call(arguments,e.prototype.constructor),r=t.prototype.constructor),r.apply(this,arguments)}t.displayName=e.displayName,o.prototype=new function(){this.constructor=o};for(var s=0;s<r.length;s++){var a=r[s];o.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in o.prototype&&(n=o.prototype[e]);var i=t.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(arguments,n),i.apply(this,arguments)}},c=0;c<i.length;c++){var u=i[c];o.prototype[u]=l(u)}return o};var i=function(){this.listeners={}};i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},t.Observable=i,t.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},t.bind=function(e,t){return function(){e.apply(t,arguments)}},t._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),r==n.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},t.hasScroll=function(t,n){var i=e(n),r=n.style.overflowX,o=n.style.overflowY;return(r!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===r||"scroll"===o||i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth)},t.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,(function(e){return t[e]}))},t.__cache={};var r=0;return t.GetUniqueElementId=function(e){var n=e.getAttribute("data-select2-id");return null!=n||(n=e.id?"select2-data-"+e.id:"select2-data-"+(++r).toString()+"-"+t.generateChars(4),e.setAttribute("data-select2-id",n)),n},t.StoreData=function(e,n,i){var r=t.GetUniqueElementId(e);t.__cache[r]||(t.__cache[r]={}),t.__cache[r][n]=i},t.GetData=function(n,i){var r=t.GetUniqueElementId(n);return i?t.__cache[r]&&null!=t.__cache[r][i]?t.__cache[r][i]:e(n).data(i):t.__cache[r]},t.RemoveData=function(e){var n=t.GetUniqueElementId(e);null!=t.__cache[n]&&delete t.__cache[n],e.removeAttribute("data-select2-id")},t.copyNonInternalCssClasses=function(e,t){var n=e.getAttribute("class").trim().split(/\s+/);n=n.filter((function(e){return 0===e.indexOf("select2-")}));var i=t.getAttribute("class").trim().split(/\s+/);i=i.filter((function(e){return 0!==e.indexOf("select2-")}));var r=n.concat(i);e.setAttribute("class",r.join(" "))},t})),t.define("select2/results",["jquery","./utils"],(function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(t.message);i.append(n(r(t.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},n.prototype.position=function(e,t){t.find(".select2-results").append(e)},n.prototype.sort=function(e){return this.options.get("sorter")(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option--selectable"),t=e.filter(".select2-results__option--selected");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var n=this;this.data.current((function(i){var r=i.map((function(e){return e.id.toString()}));n.$results.find(".select2-results__option--selectable").each((function(){var n=e(this),i=t.GetData(this,"data"),o=""+i.id;null!=i.element&&i.element.selected||null==i.element&&r.indexOf(o)>-1?(this.classList.add("select2-results__option--selected"),n.attr("aria-selected","true")):(this.classList.remove("select2-results__option--selected"),n.attr("aria-selected","false"))}))}))},n.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(n){var i=document.createElement("li");i.classList.add("select2-results__option"),i.classList.add("select2-results__option--selectable");var r={role:"option"},o=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var s in(null!=n.element&&o.call(n.element,":disabled")||null==n.element&&n.disabled)&&(r["aria-disabled"]="true",i.classList.remove("select2-results__option--selectable"),i.classList.add("select2-results__option--disabled")),null==n.id&&i.classList.remove("select2-results__option--selectable"),null!=n._resultId&&(i.id=n._resultId),n.title&&(i.title=n.title),n.children&&(r.role="group",r["aria-label"]=n.text,i.classList.remove("select2-results__option--selectable"),i.classList.add("select2-results__option--group")),r){var a=r[s];i.setAttribute(s,a)}if(n.children){var l=e(i),c=document.createElement("strong");c.className="select2-results__group",this.template(n,c);for(var u=[],d=0;d<n.children.length;d++){var h=n.children[d],p=this.option(h);u.push(p)}var f=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"none"});f.append(u),l.append(c),l.append(f)}else this.template(n,i);return t.StoreData(i,"data",n),i},n.prototype.bind=function(n,i){var r=this,o=n.id+"-results";this.$results.attr("id",o),n.on("results:all",(function(e){r.clear(),r.append(e.data),n.isOpen()&&(r.setClasses(),r.highlightFirstItem())})),n.on("results:append",(function(e){r.append(e.data),n.isOpen()&&r.setClasses()})),n.on("query",(function(e){r.hideMessages(),r.showLoading(e)})),n.on("select",(function(){n.isOpen()&&(r.setClasses(),r.options.get("scrollAfterSelect")&&r.highlightFirstItem())})),n.on("unselect",(function(){n.isOpen()&&(r.setClasses(),r.options.get("scrollAfterSelect")&&r.highlightFirstItem())})),n.on("open",(function(){r.$results.attr("aria-expanded","true"),r.$results.attr("aria-hidden","false"),r.setClasses(),r.ensureHighlightVisible()})),n.on("close",(function(){r.$results.attr("aria-expanded","false"),r.$results.attr("aria-hidden","true"),r.$results.removeAttr("aria-activedescendant")})),n.on("results:toggle",(function(){var e=r.getHighlightedResults();0!==e.length&&e.trigger("mouseup")})),n.on("results:select",(function(){var e=r.getHighlightedResults();if(0!==e.length){var n=t.GetData(e[0],"data");e.hasClass("select2-results__option--selected")?r.trigger("close",{}):r.trigger("select",{data:n})}})),n.on("results:previous",(function(){var e=r.getHighlightedResults(),t=r.$results.find(".select2-results__option--selectable"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var o=t.eq(i);o.trigger("mouseenter");var s=r.$results.offset().top,a=o.offset().top,l=r.$results.scrollTop()+(a-s);0===i?r.$results.scrollTop(0):a-s<0&&r.$results.scrollTop(l)}})),n.on("results:next",(function(){var e=r.getHighlightedResults(),t=r.$results.find(".select2-results__option--selectable"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var o=r.$results.offset().top+r.$results.outerHeight(!1),s=i.offset().top+i.outerHeight(!1),a=r.$results.scrollTop()+s-o;0===n?r.$results.scrollTop(0):s>o&&r.$results.scrollTop(a)}})),n.on("results:focus",(function(e){e.element[0].classList.add("select2-results__option--highlighted"),e.element[0].setAttribute("aria-selected","true")})),n.on("results:message",(function(e){r.displayMessage(e)})),e.fn.mousewheel&&this.$results.on("mousewheel",(function(e){var t=r.$results.scrollTop(),n=r.$results.get(0).scrollHeight-t+e.deltaY,i=e.deltaY>0&&t-e.deltaY<=0,o=e.deltaY<0&&n<=r.$results.height();i?(r.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):o&&(r.$results.scrollTop(r.$results.get(0).scrollHeight-r.$results.height()),e.preventDefault(),e.stopPropagation())})),this.$results.on("mouseup",".select2-results__option--selectable",(function(n){var i=e(this),o=t.GetData(this,"data");i.hasClass("select2-results__option--selected")?r.options.get("multiple")?r.trigger("unselect",{originalEvent:n,data:o}):r.trigger("close",{}):r.trigger("select",{originalEvent:n,data:o})})),this.$results.on("mouseenter",".select2-results__option--selectable",(function(n){var i=t.GetData(this,"data");r.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),r.trigger("results:focus",{data:i,element:e(this)})}))},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find(".select2-results__option--selectable").index(e),n=this.$results.offset().top,i=e.offset().top,r=this.$results.scrollTop()+(i-n),o=i-n;r-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),o=i(t,n);null==o?n.style.display="none":"string"==typeof o?n.innerHTML=r(o):e(n).append(o)},n})),t.define("select2/keys",[],(function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),t.define("select2/selection/base",["jquery","../utils","../keys"],(function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var n=e('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=t.GetData(this.$element[0],"old-tabindex")?this._tabindex=t.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),n.attr("title",this.$element.attr("title")),n.attr("tabindex",this._tabindex),n.attr("aria-disabled","false"),this.$selection=n,n},i.prototype.bind=function(e,t){var i=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",(function(e){i.trigger("focus",e)})),this.$selection.on("blur",(function(e){i._handleBlur(e)})),this.$selection.on("keydown",(function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()})),e.on("results:focus",(function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)})),e.on("selection:update",(function(e){i.update(e.data)})),e.on("open",(function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",r),i._attachCloseHandler(e)})),e.on("close",(function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.trigger("focus"),i._detachCloseHandler(e)})),e.on("enable",(function(){i.$selection.attr("tabindex",i._tabindex),i.$selection.attr("aria-disabled","false")})),e.on("disable",(function(){i.$selection.attr("tabindex","-1"),i.$selection.attr("aria-disabled","true")}))},i.prototype._handleBlur=function(t){var n=this;window.setTimeout((function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)}),1)},i.prototype._attachCloseHandler=function(n){e(document.body).on("mousedown.select2."+n.id,(function(n){var i=e(n.target).closest(".select2");e(".select2.select2-container--open").each((function(){this!=i[0]&&t.GetData(this,"element").select2("close")}))}))},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},i.prototype.position=function(e,t){t.find(".selection").append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i.prototype.isEnabled=function(){return!this.isDisabled()},i.prototype.isDisabled=function(){return this.options.get("disabled")},i})),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e[0].classList.add("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.attr("aria-controls",i),this.$selection.on("mousedown",(function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})})),this.$selection.on("focus",(function(e){})),this.$selection.on("blur",(function(e){})),e.on("focus",(function(t){e.isOpen()||n.$selection.trigger("focus")}))},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r})),t.define("select2/selection/multiple",["jquery","./base","../utils"],(function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e[0].classList.add("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,r){var o=this;i.__super__.bind.apply(this,arguments);var s=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",s),this.$selection.on("click",(function(e){o.trigger("toggle",{originalEvent:e})})),this.$selection.on("click",".select2-selection__choice__remove",(function(t){if(!o.isDisabled()){var i=e(this).parent(),r=n.GetData(i[0],"data");o.trigger("unselect",{originalEvent:t,data:r})}})),this.$selection.on("keydown",".select2-selection__choice__remove",(function(e){o.isDisabled()||e.stopPropagation()}))},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e('<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">&times;</span></button><span class="select2-selection__choice__display"></span></li>')},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=this.$selection.find(".select2-selection__rendered").attr("id")+"-choice-",r=0;r<e.length;r++){var o=e[r],s=this.selectionContainer(),a=this.display(o,s),l=i+n.generateChars(4)+"-";o.id?l+=o.id:l+=n.generateChars(4),s.find(".select2-selection__choice__display").append(a).attr("id",l);var c=o.title||o.text;c&&s.attr("title",c);var u=this.options.get("translations").get("removeItem"),d=s.find(".select2-selection__choice__remove");d.attr("title",u()),d.attr("aria-label",u()),d.attr("aria-describedby",l),n.StoreData(s[0],"data",o),t.push(s)}this.$selection.find(".select2-selection__rendered").append(t)}},i})),t.define("select2/selection/placeholder",[],(function(){function e(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();n.html(this.display(t)),n[0].classList.add("select2-selection__placeholder"),n[0].classList.remove("select2-selection__choice");var i=t.title||t.text||n.text();return this.$selection.find(".select2-selection__rendered").attr("title",i),n},e.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},e})),t.define("select2/selection/allowClear",["jquery","../keys","../utils"],(function(e,t,n){function i(){}return i.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",(function(e){i._handleClear(e)})),t.on("keypress",(function(e){i._handleKeyboardClear(e,t)}))},i.prototype._handleClear=function(e,t){if(!this.isDisabled()){var i=this.$selection.find(".select2-selection__clear");if(0!==i.length){t.stopPropagation();var r=n.GetData(i[0],"data"),o=this.$element.val();this.$element.val(this.placeholder.id);var s={data:r};if(this.trigger("clear",s),s.prevented)this.$element.val(o);else{for(var a=0;a<r.length;a++)if(s={data:r[a]},this.trigger("unselect",s),s.prevented)return void this.$element.val(o);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},i.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},i.prototype.update=function(t,i){if(t.call(this,i),this.$selection.find(".select2-selection__clear").remove(),this.$selection[0].classList.remove("select2-selection--clearable"),!(this.$selection.find(".select2-selection__placeholder").length>0||0===i.length)){var r=this.$selection.find(".select2-selection__rendered").attr("id"),o=this.options.get("translations").get("removeAllItems"),s=e('<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">&times;</span></button>');s.attr("title",o()),s.attr("aria-label",o()),s.attr("aria-describedby",r),n.StoreData(s[0],"data",i),this.$selection.prepend(s),this.$selection[0].classList.add("select2-selection--clearable")}},i})),t.define("select2/selection/search",["jquery","../utils","../keys"],(function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=this.options.get("translations").get("search"),i=e('<span class="select2-search select2-search--inline"><textarea class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" ></textarea></span>');this.$searchContainer=i,this.$search=i.find("textarea"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",n());var r=t.call(this);return this._transferTabIndex(),r.append(this.$searchContainer),r},i.prototype.bind=function(e,i,r){var o=this,s=i.id+"-results",a=i.id+"-container";e.call(this,i,r),o.$search.attr("aria-describedby",a),i.on("open",(function(){o.$search.attr("aria-controls",s),o.$search.trigger("focus")})),i.on("close",(function(){o.$search.val(""),o.resizeSearch(),o.$search.removeAttr("aria-controls"),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")})),i.on("enable",(function(){o.$search.prop("disabled",!1),o._transferTabIndex()})),i.on("disable",(function(){o.$search.prop("disabled",!0)})),i.on("focus",(function(e){o.$search.trigger("focus")})),i.on("results:focus",(function(e){e.data._resultId?o.$search.attr("aria-activedescendant",e.data._resultId):o.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search--inline",(function(e){o.trigger("focus",e)})),this.$selection.on("focusout",".select2-search--inline",(function(e){o._handleBlur(e)})),this.$selection.on("keydown",".select2-search--inline",(function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===o.$search.val()){var i=o.$selection.find(".select2-selection__choice").last();if(i.length>0){var r=t.GetData(i[0],"data");o.searchRemoveChoice(r),e.preventDefault()}}})),this.$selection.on("click",".select2-search--inline",(function(e){o.$search.val()&&e.stopPropagation()}));var l=document.documentMode,c=l&&l<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(e){c?o.$selection.off("input.search input.searchcheck"):o.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(e){if(c&&"input"===e.type)o.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&o.handleSearch(e)}}))},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.resizeSearch(),n&&this.$search.trigger("focus")},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="100%";""===this.$search.attr("placeholder")&&(e=.75*(this.$search.val().length+1)+"em"),this.$search.css("width",e)},i})),t.define("select2/selection/selectionCss",["../utils"],(function(e){function t(){}return t.prototype.render=function(t){var n=t.call(this),i=this.options.get("selectionCssClass")||"";return-1!==i.indexOf(":all:")&&(i=i.replace(":all:",""),e.copyNonInternalCssClasses(n[0],this.$element[0])),n.addClass(i),n},t})),t.define("select2/selection/eventRelay",["jquery"],(function(e){function t(){}return t.prototype.bind=function(t,n,i){var r=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],s=["opening","closing","selecting","unselecting","clearing"];t.call(this,n,i),n.on("*",(function(t,n){if(-1!==o.indexOf(t)){n=n||{};var i=e.Event("select2:"+t,{params:n});r.$element.trigger(i),-1!==s.indexOf(t)&&(n.prevented=i.isDefaultPrevented())}}))},t})),t.define("select2/translation",["jquery","require"],(function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n})),t.define("select2/diacritics",[],(function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}})),t.define("select2/data/base",["../utils"],(function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),null!=n.id?i+="-"+n.id.toString():i+="-"+e.generateChars(4),i},t})),t.define("select2/data/select",["./base","../utils","jquery"],(function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=this;e(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),(function(e){return t.item(n(e))})))},i.prototype.select=function(e){var t=this;if(e.selected=!0,null!=e.element&&"option"===e.element.tagName.toLowerCase())return e.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(n){var i=[];(e=[e]).push.apply(e,n);for(var r=0;r<e.length;r++){var o=e[r].id;-1===i.indexOf(o)&&i.push(o)}t.$element.val(i),t.$element.trigger("input").trigger("change")}));else{var n=e.id;this.$element.val(n),this.$element.trigger("input").trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,null!=e.element&&"option"===e.element.tagName.toLowerCase())return e.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current((function(n){for(var i=[],r=0;r<n.length;r++){var o=n[r].id;o!==e.id&&-1===i.indexOf(o)&&i.push(o)}t.$element.val(i),t.$element.trigger("input").trigger("change")}))}},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",(function(e){n.select(e.data)})),e.on("unselect",(function(e){n.unselect(e.data)}))},i.prototype.destroy=function(){this.$element.find("*").each((function(){t.RemoveData(this)}))},i.prototype.query=function(e,t){var i=[],r=this;this.$element.children().each((function(){if("option"===this.tagName.toLowerCase()||"optgroup"===this.tagName.toLowerCase()){var t=n(this),o=r.item(t),s=r.matches(e,o);null!==s&&i.push(s)}})),t({results:i})},i.prototype.addOptions=function(e){this.$element.append(e)},i.prototype.option=function(e){var i;e.children?(i=document.createElement("optgroup")).label=e.text:void 0!==(i=document.createElement("option")).textContent?i.textContent=e.text:i.innerText=e.text,void 0!==e.id&&(i.value=e.id),e.disabled&&(i.disabled=!0),e.selected&&(i.selected=!0),e.title&&(i.title=e.title);var r=this._normalizeItem(e);return r.element=i,t.StoreData(i,"data",r),n(i)},i.prototype.item=function(e){var i={};if(null!=(i=t.GetData(e[0],"data")))return i;var r=e[0];if("option"===r.tagName.toLowerCase())i={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if("optgroup"===r.tagName.toLowerCase()){i={text:e.prop("label"),children:[],title:e.prop("title")};for(var o=e.children("option"),s=[],a=0;a<o.length;a++){var l=n(o[a]),c=this.item(l);s.push(c)}i.children=s}return(i=this._normalizeItem(i)).element=e[0],t.StoreData(e[0],"data",i),i},i.prototype._normalizeItem=function(e){return e!==Object(e)&&(e={id:e,text:e}),null!=(e=n.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},{selected:!1,disabled:!1},e)},i.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},i})),t.define("select2/data/array",["./select","../utils","jquery"],(function(e,t,n){function i(e,t){this._dataToConvert=t.get("data")||[],i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype.bind=function(e,t){i.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},i.prototype.select=function(e){var t=this.$element.find("option").filter((function(t,n){return n.value==e.id.toString()}));0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){var t=this,i=this.$element.find("option"),r=i.map((function(){return t.item(n(this)).id})).get(),o=[];function s(e){return function(){return n(this).val()==e.id}}for(var a=0;a<e.length;a++){var l=this._normalizeItem(e[a]);if(r.indexOf(l.id)>=0){var c=i.filter(s(l)),u=this.item(c),d=n.extend(!0,{},l,u),h=this.option(d);c.replaceWith(h)}else{var p=this.option(l);if(l.children){var f=this.convertToOptions(l.children);p.append(f)}o.push(p)}}return o},i})),t.define("select2/data/ajax",["./array","../utils","jquery"],(function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var r=n.ajax(e);return r.then(t),r.fail(i),r}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){var i=this;null!=this._request&&("function"==typeof this._request.abort&&this._request.abort(),this._request=null);var r=n.extend({type:"GET"},this.ajaxOptions);function o(){var n=r.transport(r,(function(n){var r=i.processResults(n,e);i.options.get("debug")&&window.console&&console.error&&(r&&r.results&&Array.isArray(r.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(r)}),(function(){(!("status"in n)||0!==n.status&&"0"!==n.status)&&i.trigger("results:message",{message:"errorLoading"})}));i._request=n}"function"==typeof r.url&&(r.url=r.url.call(this.$element,e)),"function"==typeof r.data&&(r.data=r.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(o,this.ajaxOptions.delay)):o()},i})),t.define("select2/data/tags",["jquery"],(function(e){function t(e,t,n){var i=n.get("tags"),r=n.get("createTag");void 0!==r&&(this.createTag=r);var o=n.get("insertTag");if(void 0!==o&&(this.insertTag=o),e.call(this,t,n),Array.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return t.prototype.query=function(e,t,n){var i=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,(function e(r,o){for(var s=r.results,a=0;a<s.length;a++){var l=s[a],c=null!=l.children&&!e({results:l.children},!0);if((l.text||"").toUpperCase()===(t.term||"").toUpperCase()||c)return!o&&(r.data=s,void n(r))}if(o)return!0;var u=i.createTag(t);if(null!=u){var d=i.option(u);d.attr("data-select2-tag","true"),i.addOptions([d]),i.insertTag(s,u)}r.results=s,n(r)})):e.call(this,t,n)},t.prototype.createTag=function(e,t){if(null==t.term)return null;var n=t.term.trim();return""===n?null:{id:n,text:n}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){this.$element.find("option[data-select2-tag]").each((function(){this.selected||e(this).remove()}))},t})),t.define("select2/data/tokenizer",["jquery"],(function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,i){var r=this;n.term=n.term||"";var o=this.tokenizer(n,this.options,(function(t){var n=r._normalizeItem(t);if(!r.$element.find("option").filter((function(){return e(this).val()===n.id})).length){var i=r.option(n);i.attr("data-select2-tag",!0),r._removeOldTags(),r.addOptions([i])}!function(e){r.trigger("select",{data:e})}(n)}));o.term!==n.term&&(this.$search.length&&(this.$search.val(o.term),this.$search.trigger("focus")),n.term=o.term),t.call(this,n,i)},t.prototype.tokenizer=function(t,n,i,r){for(var o=i.get("tokenSeparators")||[],s=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<s.length;){var c=s[a];if(-1!==o.indexOf(c)){var u=s.substr(0,a),d=l(e.extend({},n,{term:u}));null!=d?(r(d),s=s.substr(a+1)||"",a=0):a++}else a++}return{term:s}},t})),t.define("select2/data/minimumInputLength",[],(function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumInputLength",[],(function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumSelectionLength",[],(function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",(function(){i._checkIfMaximumSelected()}))},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected((function(){e.call(i,t,n)}))},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current((function(e){var i=null!=e?e.length:0;n.maximumSelectionLength>0&&i>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()}))},e})),t.define("select2/dropdown",["jquery","./utils"],(function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n})),t.define("select2/dropdown/search",["jquery"],(function(e){function t(){}return t.prototype.render=function(t){var n=t.call(this),i=this.options.get("translations").get("search"),r=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=r,this.$search=r.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",i()),n.prepend(r),n},t.prototype.bind=function(t,n,i){var r=this,o=n.id+"-results";t.call(this,n,i),this.$search.on("keydown",(function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()})),this.$search.on("input",(function(t){e(this).off("keyup")})),this.$search.on("keyup input",(function(e){r.handleSearch(e)})),n.on("open",(function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",o),r.$search.trigger("focus"),window.setTimeout((function(){r.$search.trigger("focus")}),0)})),n.on("close",(function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")})),n.on("focus",(function(){n.isOpen()||r.$search.trigger("focus")})),n.on("results:all",(function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer[0].classList.remove("select2-search--hide"):r.$searchContainer[0].classList.add("select2-search--hide"))})),n.on("results:focus",(function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}))},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t})),t.define("select2/dropdown/hidePlaceholder",[],(function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e})),t.define("select2/dropdown/infiniteScroll",["jquery"],(function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",(function(e){i.lastParams=e,i.loading=!0})),t.on("query:append",(function(e){i.lastParams=e,i.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=e.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&t&&this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore()},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t})),t.define("select2/dropdown/attachBody",["jquery","../utils"],(function(e,t){function n(t,n,i){this.$dropdownParent=e(i.get("dropdownParent")||document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",(function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)})),t.on("close",(function(){i._hideDropdown(),i._detachPositioningHandler(t)})),this.$dropdownContainer.on("mousedown",(function(e){e.stopPropagation()}))},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t[0].classList.remove("select2"),t[0].classList.add("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:append",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:message",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("select",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("unselect",(function(){n._positionDropdown(),n._resizeDropdown()})),this._containerResultsHandlersBound=!0}},n.prototype._attachPositioningHandler=function(n,i){var r=this,o="scroll.select2."+i.id,s="resize.select2."+i.id,a="orientationchange.select2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each((function(){t.StoreData(this,"select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})})),l.on(o,(function(n){var i=t.GetData(this,"select2-scroll-position");e(this).scrollTop(i.y)})),e(window).on(o+" "+s+" "+a,(function(e){r._positionDropdown(),r._resizeDropdown()}))},n.prototype._detachPositioningHandler=function(n,i){var r="scroll.select2."+i.id,o="resize.select2."+i.id,s="orientationchange.select2."+i.id;this.$container.parents().filter(t.hasScroll).off(r),e(window).off(r+" "+o+" "+s)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown[0].classList.contains("select2-dropdown--above"),i=this.$dropdown[0].classList.contains("select2-dropdown--below"),r=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var a=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),u=l<o.top-a,d=c>o.bottom+a,h={left:o.left,top:s.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var f={top:0,left:0};(e.contains(document.body,p[0])||p[0].isConnected)&&(f=p.offset()),h.top-=f.top,h.left-=f.left,n||i||(r="below"),d||!u||n?!u&&d&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(h.top=s.top-f.top-a),null!=r&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+r),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+r)),this.$dropdownContainer.css(h)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n})),t.define("select2/dropdown/minimumResultsForSearch",[],(function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];r.children?n+=e(r.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e})),t.define("select2/dropdown/selectOnClose",["../utils"],(function(e){function t(){}return t.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",(function(e){i._handleSelectOnClose(e)}))},t.prototype._handleSelectOnClose=function(t,n){if(n&&null!=n.originalSelect2Event){var i=n.originalSelect2Event;if("select"===i._type||"unselect"===i._type)return}var r=this.getHighlightedResults();if(!(r.length<1)){var o=e.GetData(r[0],"data");null!=o.element&&o.element.selected||null==o.element&&o.selected||this.trigger("select",{data:o})}},t})),t.define("select2/dropdown/closeOnSelect",[],(function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",(function(e){i._selectTriggered(e)})),t.on("unselect",(function(e){i._selectTriggered(e)}))},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e})),t.define("select2/dropdown/dropdownCss",["../utils"],(function(e){function t(){}return t.prototype.render=function(t){var n=t.call(this),i=this.options.get("dropdownCssClass")||"";return-1!==i.indexOf(":all:")&&(i=i.replace(":all:",""),e.copyNonInternalCssClasses(n[0],this.$element[0])),n.addClass(i),n},t})),t.define("select2/dropdown/tagsSearchHighlight",["../utils"],(function(e){function t(){}return t.prototype.highlightFirstItem=function(t){var n=this.$results.find(".select2-results__option--selectable:not(.select2-results__option--selected)");if(n.length>0){var i=n.first(),r=e.GetData(i[0],"data").element;if(r&&r.getAttribute&&"true"===r.getAttribute("data-select2-tag"))return void i.trigger("mouseenter")}t.call(this)},t})),t.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"},removeItem:function(){return"Remove item"},search:function(){return"Search"}}})),t.define("select2/defaults",["jquery","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/selectionCss","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./dropdown/dropdownCss","./dropdown/tagsSearchHighlight","./i18n/en"],(function(e,t,n,i,r,o,s,a,l,c,u,d,h,p,f,g,m,v,y,b,w,_,k,D,x,S,A,$,C,E,O){function L(){this.reset()}return L.prototype.apply=function(u){if(null==(u=e.extend(!0,{},this.defaults,u)).dataAdapter&&(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=p:u.dataAdapter=h,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,b)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,m))),null==u.resultsAdapter&&(u.resultsAdapter=t,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,D)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,k)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,A)),u.tags&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,E))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=w;else{var d=c.Decorate(w,_);u.dropdownAdapter=d}0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,S)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,$)),null!=u.dropdownCssClass&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,C)),u.dropdownAdapter=c.Decorate(u.dropdownAdapter,x)}null==u.selectionAdapter&&(u.multiple?u.selectionAdapter=i:u.selectionAdapter=n,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,r)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,o)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),null!=u.selectionCssClass&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),u.selectionAdapter=c.Decorate(u.selectionAdapter,l)),u.language=this._resolveLanguage(u.language),u.language.push("en");for(var O=[],L=0;L<u.language.length;L++){var j=u.language[L];-1===O.indexOf(j)&&O.push(j)}return u.language=O,u.translations=this._processTranslations(u.language,u.debug),u},L.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,(function(e){return d[e]||e}))}this.defaults={amdLanguageBase:"./i18n/",autocomplete:"off",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:{},matcher:function n(i,r){if(null==i.term||""===i.term.trim())return r;if(r.children&&r.children.length>0){for(var o=e.extend(!0,{},r),s=r.children.length-1;s>=0;s--)null==n(i,r.children[s])&&o.children.splice(s,1);return o.children.length>0?o:n(i,o)}var a=t(r.text).toUpperCase(),l=t(i.term).toUpperCase();return a.indexOf(l)>-1?r:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},L.prototype.applyFromElement=function(e,t){var n=e.language,i=this.defaults.language,r=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(r),this._resolveLanguage(n),this._resolveLanguage(i),this._resolveLanguage(o));return e.language=s,e},L.prototype._resolveLanguage=function(t){if(!t)return[];if(e.isEmptyObject(t))return[];if(e.isPlainObject(t))return[t];var n;n=Array.isArray(t)?t:[t];for(var i=[],r=0;r<n.length;r++)if(i.push(n[r]),"string"==typeof n[r]&&n[r].indexOf("-")>0){var o=n[r].split("-")[0];i.push(o)}return i},L.prototype._processTranslations=function(t,n){for(var i=new u,r=0;r<t.length;r++){var o=new u,s=t[r];if("string"==typeof s)try{o=u.loadPath(s)}catch(e){try{s=this.defaults.amdLanguageBase+s,o=u.loadPath(s)}catch(e){n&&window.console&&console.warn&&console.warn('Select2: The language file for "'+s+'" could not be automatically loaded. A fallback will be used instead.')}}else o=e.isPlainObject(s)?new u(s):s;i.extend(o)}return i},L.prototype.set=function(t,n){var i={};i[e.camelCase(t)]=n;var r=c._convertData(i);e.extend(!0,this.defaults,r)},new L})),t.define("select2/options",["jquery","./defaults","./utils"],(function(e,t,n){function i(e,n){this.options=e,null!=n&&this.fromElement(n),null!=n&&(this.options=t.applyFromElement(this.options,n)),this.options=t.apply(this.options)}return i.prototype.fromElement=function(t){var i=["select2"];null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.autocomplete&&t.prop("autocomplete")&&(this.options.autocomplete=t.prop("autocomplete")),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),n.GetData(t[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),n.StoreData(t[0],"data",n.GetData(t[0],"select2Tags")),n.StoreData(t[0],"tags",!0)),n.GetData(t[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),t.attr("ajax--url",n.GetData(t[0],"ajaxUrl")),n.StoreData(t[0],"ajax-Url",n.GetData(t[0],"ajaxUrl")));var r={};function o(e,t){return t.toUpperCase()}for(var s=0;s<t[0].attributes.length;s++){var a=t[0].attributes[s].name;if("data-"==a.substr(0,"data-".length)){var l=a.substring("data-".length),c=n.GetData(t[0],l);r[l.replace(/-([a-z])/g,o)]=c}}e.fn.jquery&&"1."==e.fn.jquery.substr(0,2)&&t[0].dataset&&(r=e.extend(!0,{},t[0].dataset,r));var u=e.extend(!0,{},n.GetData(t[0]),r);for(var d in u=n._convertData(u))i.indexOf(d)>-1||(e.isPlainObject(this.options[d])?e.extend(this.options[d],u[d]):this.options[d]=u[d]);return this},i.prototype.get=function(e){return this.options[e]},i.prototype.set=function(e,t){this.options[e]=t},i})),t.define("select2/core",["jquery","./options","./utils","./keys"],(function(e,t,n,i){var r=function(e,i){null!=n.GetData(e[0],"select2")&&n.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),i=i||{},this.options=new t(i,e),r.__super__.constructor.call(this);var o=e.attr("tabindex")||0;n.StoreData(e[0],"old-tabindex",o),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var a=this.render();this._placeContainer(a);var l=this.options.get("selectionAdapter");this.selection=new l(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var c=this.options.get("dropdownAdapter");this.dropdown=new c(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var u=this.options.get("resultsAdapter");this.results=new u(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var d=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(e){d.trigger("selection:update",{data:e})})),e[0].classList.add("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),n.StoreData(e[0],"select2",this),e.data("select2",this)};return n.Extend(r,n.Observable),r.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},r.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},r.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"==t){var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&c.length>=1)return c[1]}return null}return"computedstyle"==t?window.getComputedStyle(e[0]).width:t},r.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},r.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",(function(){e.dataAdapter.current((function(t){e.trigger("selection:update",{data:t})}))})),this.$element.on("focus.select2",(function(t){e.trigger("focus",t)})),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this._observer=new window.MutationObserver((function(t){e._syncA(),e._syncS(t)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},r.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",(function(t,n){e.trigger(t,n)}))},r.prototype._registerSelectionEvents=function(){var e=this,t=["toggle","focus"];this.selection.on("toggle",(function(){e.toggleDropdown()})),this.selection.on("focus",(function(t){e.focus(t)})),this.selection.on("*",(function(n,i){-1===t.indexOf(n)&&e.trigger(n,i)}))},r.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",(function(t,n){e.trigger(t,n)}))},r.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",(function(t,n){e.trigger(t,n)}))},r.prototype._registerEvents=function(){var e=this;this.on("open",(function(){e.$container[0].classList.add("select2-container--open")})),this.on("close",(function(){e.$container[0].classList.remove("select2-container--open")})),this.on("enable",(function(){e.$container[0].classList.remove("select2-container--disabled")})),this.on("disable",(function(){e.$container[0].classList.add("select2-container--disabled")})),this.on("blur",(function(){e.$container[0].classList.remove("select2-container--focus")})),this.on("query",(function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,(function(n){e.trigger("results:all",{data:n,query:t})}))})),this.on("query:append",(function(t){this.dataAdapter.query(t,(function(n){e.trigger("results:append",{data:n,query:t})}))})),this.on("keypress",(function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.UP&&t.altKey?(e.close(t),t.preventDefault()):n===i.ENTER||n===i.TAB?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())}))},r.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},r.prototype._isChangeMutation=function(e){var t=this;if(e.addedNodes&&e.addedNodes.length>0){for(var n=0;n<e.addedNodes.length;n++)if(e.addedNodes[n].selected)return!0}else{if(e.removedNodes&&e.removedNodes.length>0)return!0;if(Array.isArray(e))return e.some((function(e){return t._isChangeMutation(e)}))}return!1},r.prototype._syncSubtree=function(e){var t=this._isChangeMutation(e),n=this;t&&this.dataAdapter.current((function(e){n.trigger("selection:update",{data:e})}))},r.prototype.trigger=function(e,t){var n=r.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in i){var o=i[e],s={prevented:!1,name:e,args:t};if(n.call(this,o,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},r.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},r.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},r.prototype.isEnabled=function(){return!this.isDisabled()},r.prototype.isDisabled=function(){return this.options.get("disabled")},r.prototype.isOpen=function(){return this.$container[0].classList.contains("select2-container--open")},r.prototype.hasFocus=function(){return this.$container[0].classList.contains("select2-container--focus")},r.prototype.focus=function(e){this.hasFocus()||(this.$container[0].classList.add("select2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},r.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current((function(t){e=t})),e},r.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];Array.isArray(t)&&(t=t.map((function(e){return e.toString()}))),this.$element.val(t).trigger("input").trigger("change")},r.prototype.destroy=function(){n.RemoveData(this.$container[0]),this.$container.remove(),this._observer.disconnect(),this._observer=null,this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",n.GetData(this.$element[0],"old-tabindex")),this.$element[0].classList.remove("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),n.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),n.StoreData(t[0],"element",this.$element),t},r})),t.define("jquery-mousewheel",["jquery"],(function(e){return e})),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],(function(e,t,n,i,r){if(null==e.fn.select2){var o=["open","close","destroy"];e.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each((function(){var i=e.extend(!0,{},t);new n(e(this),i)})),this;if("string"==typeof t){var i,s=Array.prototype.slice.call(arguments,1);return this.each((function(){var e=r.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),i=e[t].apply(e,s)})),o.indexOf(t)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=i),n})),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n})?i.apply(t,r):i)||(e.exports=o)},function(e,t,n){},function(e,t){
     7/**!
     8 * wp-color-picker-alpha
    109 *
    11  * Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
    12  * Released under the ISC license.
     10 * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
     11 * Only run in input and is defined data alpha in true
     12 *
     13 * Version: 3.0.2
     14 * https://github.com/kallookoo/wp-color-picker-alpha
     15 * Licensed under the GPLv2 license or later.
    1316 */
    14 var d=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},p=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var n=this;n.length<e;)n=t+n;return n};var f={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString();return n||"0"}var m=function(){function e(t,n,i,r){d(this,e);var o=this;if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===i){var s=t&&""+t;s&&function(t){if(t.startsWith("hsl")){var n=t.match(/([\-\d\.e]+)/g).map(Number),i=h(n,4),r=i[0],s=i[1],a=i[2],l=i[3];void 0===l&&(l=1),r/=360,s/=100,a/=100,o.hsla=[r,s,a,l]}else if(t.startsWith("rgb")){var c=t.match(/([\-\d\.e]+)/g).map(Number),u=h(c,4),d=u[0],p=u[1],f=u[2],g=u[3];void 0===g&&(g=1),o.rgba=[d,p,f,g]}else t.startsWith("#")?o.rgba=e.hexToRgb(t):o.rgba=e.nameToRgb(t)||e.hexToRgb(t)}(s.toLowerCase())}else this.rgba=[t,n,i,void 0===r?1:r]}return p(e,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return g(e,3===t?3:0)}));return e?"rgba("+t+")":"rgb("+t+")"}},{key:"printHSL",value:function(e){var t=[360,100,100,1],n=["","%","%",""],i=(e?this.hsla:this.hsla.slice(0,3)).map((function(e,i){return g(e*t[i],3===i?3:1)+n[i]}));return e?"hsla("+i+")":"hsl("+i+")"}},{key:"printHex",value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=e.hslToRgb(this._hsla)},set:function(e){3===e.length&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=e.rgbToHsl(this._rgba)},set:function(e){3===e.length&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)})).map((function(e){return e.padStart(2,"0")})).join("")},set:function(t){this.rgba=e.hexToRgb(t)}}],[{key:"hexToRgb",value:function(e){var t=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!t.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var n=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(t){var n=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=f[n];return void 0===i?i:e.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=h(e,4),n=t[0],i=t[1],r=t[2],o=t[3];n/=255,i/=255,r/=255;var s=Math.max(n,i,r),a=Math.min(n,i,r),l=void 0,c=void 0,u=(s+a)/2;if(s===a)l=c=0;else{var d=s-a;switch(c=u>.5?d/(2-s-a):d/(s+a),s){case n:l=(i-r)/d+(i<r?6:0);break;case i:l=(r-n)/d+2;break;case r:l=(n-i)/d+4}l/=6}return[l,c,u,o]}},{key:"hslToRgb",value:function(e){var t=h(e,4),n=t[0],i=t[1],r=t[2],o=t[3],s=void 0,a=void 0,l=void 0;if(0===i)s=a=l=r;else{var c=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},u=r<.5?r*(1+i):r+i-r*i,d=2*r-u;s=c(d,u,n+1/3),a=c(d,u,n),l=c(d,u,n-1/3)}var p=[255*s,255*a,255*l].map(Math.round);return p[3]=o,p}}]),e}(),v=function(){function e(){d(this,e),this._events=[]}return p(e,[{key:"add",value:function(e,t,n){e.addEventListener(t,n,!1),this._events.push({target:e,type:t,handler:n})}},{key:"remove",value:function(t,n,i){this._events=this._events.filter((function(r){var o=!0;return t&&t!==r.target&&(o=!1),n&&n!==r.type&&(o=!1),i&&i!==r.handler&&(o=!1),o&&e._doRemove(r.target,r.type,r.handler),!o}))}},{key:"destroy",value:function(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(e,t,n){e.removeEventListener(t,n,!1)}}]),e}();function y(e,t,n){var i=!1;function r(e,t,n){return Math.max(t,Math.min(e,n))}function o(e,o,s){if(s&&(i=!0),i){e.preventDefault();var a=t.getBoundingClientRect(),l=a.width,c=a.height,u=o.clientX,d=o.clientY,p=r(u-a.left,0,l),h=r(d-a.top,0,c);n(p/l,h/c)}}function s(e,t){1===(void 0===e.buttons?e.which:e.buttons)?o(e,e,t):i=!1}function a(e,t){1===e.touches.length?o(e,e.touches[0],t):i=!1}e.add(t,"mousedown",(function(e){s(e,!0)})),e.add(t,"touchstart",(function(e){a(e,!0)})),e.add(window,"mousemove",s),e.add(t,"touchmove",a),e.add(window,"mouseup",(function(e){i=!1})),e.add(t,"touchend",(function(e){i=!1})),e.add(t,"touchcancel",(function(e){i=!1}))}function b(e,t){return(t||document).querySelector(e)}function w(e){e.preventDefault(),e.stopPropagation()}function _(e,t,n,i,r){e.add(t,"keydown",(function(e){n.indexOf(e.key)>=0&&(r&&w(e),i(e))}))}var k=function(){function e(t){d(this,e),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new v,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return p(e,[{key:"setOptions",value:function(e){var t=this;if(e){var n=this.settings;if(e instanceof HTMLElement)n.parent=e;else{n.parent&&e.parent&&n.parent!==e.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(e,t,n){for(var i in e)n&&n.indexOf(i)>=0||(t[i]=e[i])}(e,n),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var i=e.color||e.colour;i&&this._setColor(i)}var r=n.parent;if(r&&n.popup&&!this._popupInited){var o=function(e){return t.openHandler(e)};this._events.add(r,"click",o),_(this._events,r,[" ","Spacebar","Enter"],o),this._popupInited=!0}else e.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&"keydown"===e.type?this._domEdit:this.domElement;setTimeout((function(){return t.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var t=e&&e.type,n=!1;if(e)if("mousedown"===t||"focusin"===t){var i=(this.__containedEvent||0)+100;e.timeStamp>i&&(n=!0)}else w(e),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="","mousedown"!==t&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:"setColor",value:function(e,t){this._setColor(e,{silent:t})}},{key:"_setColor",value:function(e,t){if("string"==typeof e&&(e=e.trim()),e){t=t||{};var n=void 0;try{n=new m(e)}catch(e){if(t.failSilently)return;throw e}if(!this.settings.alpha){var i=n.hsla;i[3]=1,n.hsla=i}this.colour=this.color=n,this._setHSLA(null,null,null,null,t)}}},{key:"setColour",value:function(e,t){this.setColor(e,t)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t,n,i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',r=(t=i,(n=document.createElement("div")).innerHTML=t,n.firstElementChild);return this.domElement=r,this._domH=b(".picker_hue",r),this._domSL=b(".picker_sl",r),this._domA=b(".picker_alpha",r),this._domEdit=b(".picker_editor input",r),this._domSample=b(".picker_sample",r),this._domOkay=b(".picker_done button",r),this._domCancel=b(".picker_cancel button",r),r.classList.add("layout_"+this.settings.layout),this.settings.alpha||r.classList.add("no_alpha"),this.settings.editor||r.classList.add("no_editor"),this.settings.cancelButton||r.classList.add("no_cancel"),this._ifPopup((function(){return r.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,t=this,n=this.domElement,i=this._events;function r(e,t,n){i.add(e,t,n)}r(n,"click",(function(e){return e.preventDefault()})),y(i,this._domH,(function(e,n){return t._setHSLA(e)})),y(i,this._domSL,(function(e,n){return t._setHSLA(null,e,1-n)})),this.settings.alpha&&y(i,this._domA,(function(e,n){return t._setHSLA(null,null,null,1-n)}));var o=this._domEdit;r(o,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(o,"focus",(function(e){this.selectionStart===this.selectionEnd&&this.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};r(window,"mousedown",t),r(window,"focusin",t),_(i,n,["Esc","Escape"],t);var o=function(t){e.__containedEvent=t.timeStamp};r(n,"mousedown",o),r(n,"focusin",o),r(e._domCancel,"click",t)}));var s=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};r(this._domOkay,"click",s),_(i,n,["Enter"],s)}},{key:"_setPosition",value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup((function(n){"static"===getComputedStyle(e).position&&(e.style.position="relative");var i=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){e===i?t.classList.add(e):t.classList.remove(e)})),t.classList.add(i)}))}},{key:"_setHSLA",value:function(e,t,n,i,r){r=r||{};var o=this.colour,s=o.hsla;[e,t,n,i].forEach((function(e,t){(e||0===e)&&(s[t]=e)})),o.hsla=s,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(o)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,n=t.hsla,i="hsl("+360*n[0]+", 100%, 50%)",r=t.hslString,o=t.hslaString,s=this._domH,a=this._domSL,l=this._domA,c=b(".picker_selector",s),u=b(".picker_selector",a),d=b(".picker_selector",l);y(0,c,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,y(0,u,n[1]),w(0,u,1-n[2]),a.style.color=r,w(0,d,1-n[3]);var p=r,h=p.replace("hsl","hsla").replace(")",", 0)"),f="linear-gradient("+[p,h]+")";if(this._domA.style.background=f+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n                   linear-gradient(45deg, lightgrey 25%,       white 25%,       white 75%, lightgrey 75%) 1em 1em / 2em 2em",!e.fromEditor){var g=this.settings.editorFormat,m=this.settings.alpha,v=void 0;switch(g){case"rgb":v=t.printRGB(m);break;case"hsl":v=t.printHSL(m);break;default:v=t.printHex(m)}this._domEdit.value=v}this._domSample.style.color=o}function y(e,t,n){t.style.left=100*n+"%"}function w(e,t,n){t.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:"_toggleDOM",value:function(e){var t=this.domElement;if(!t)return!1;var n=e?"":"none",i=t.style.display!==n;return i&&(t.style.display=n),i}}]),e}(),x=document.createElement("style");x.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(x),k.StyleElement=x,wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.color={load:function(e,t){var n=r()(e).find(".cpt-color-section:first"),i=r()(n).children("input"),o=r()(n).children(".preview"),s=void 0!==r()(i).attr("alpha");new k({parent:n[0],popup:"top",alpha:s,color:i[0].value,onChange:function(e){o[0].style.backgroundColor=e.rgbaString,i[0].setAttribute("value",e.hex.endsWith("ff")&&e.hex.length>6?e.hex.slice(0,-2):e.hex)}})}},e}));n(4);function D(e){return e[e.length-1]}function S(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function $(e,t){return e?e.split(t):[]}function E(e,t,n){return(void 0===t||e>=t)&&(void 0===n||e<=n)}function C(e,t,n){return e<t?t:e>n?n:e}function O(e,t,n={},i=0,r=""){r+=`<${Object.keys(n).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(r=r(i)),`${e} ${t}="${r}"`},e)}></${e}>`;const o=i+1;return o<t?O(e,t,n,o,r):r}function A(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function L(e){return new Date(e).setHours(0,0,0,0)}function j(){return(new Date).setHours(0,0,0,0)}function T(...e){switch(e.length){case 0:return j();case 1:return L(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function M(e,t){const n=new Date(e);return n.setDate(n.getDate()+t)}function N(e,t){const n=new Date(e),i=n.getMonth()+t;let r=i%12;r<0&&(r+=12);const o=n.setMonth(i);return n.getMonth()!==r?n.setDate(0):o}function F(e,t){const n=new Date(e),i=n.getMonth(),r=n.setFullYear(n.getFullYear()+t);return 1===i&&2===n.getMonth()?n.setDate(0):r}function P(e,t){return(e-t+7)%7}function I(e,t,n=0){const i=new Date(e).getDay();return M(e,P(t,n)-P(i,n))}function R(e,t){return Math.round((e-t)/6048e5)+1}function H(e){const t=I(e,4,1);return R(t,I(new Date(t).setMonth(0,4),4,1))}function q(e,t){const n=I(new Date(e).setMonth(0,1),t,t),i=I(e,t,t),r=R(i,n);if(r<53)return r;return i===I(new Date(e).setDate(32),t,t)?1:r}function B(e){return q(e,0)}function z(e){return q(e,6)}function V(e,t){const n=new Date(e).getFullYear();return Math.floor(n/t)*t}function U(e,t,n){if(1!==t&&2!==t)return e;const i=new Date(e);return 1===t?n?i.setMonth(i.getMonth()+1,0):i.setDate(1):n?i.setFullYear(i.getFullYear()+1,0,0):i.setMonth(0,1),i.setHours(0,0,0,0)}const W=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,Y=/[\s!-/:-@[-`{-~年月日]+/;let G={};const K={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,n){const i=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),i=t=>t.toLowerCase().startsWith(e);if(r=n.monthsShort.findIndex(i),r<0&&(r=n.months.findIndex(i)),r<0)return NaN}return i.setMonth(r),i.getMonth()!==function e(t){return t>-1?t%12:e(t+12)}(r)?i.setDate(0):i.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},Z={d:e=>e.getDate(),dd:e=>J(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>J(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>J(e.getFullYear(),2).slice(-2),yyyy:e=>J(e.getFullYear(),4)};function J(e,t){return e.toString().padStart(t,"0")}function Q(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in G)return G[e];const t=e.split(W),n=e.match(new RegExp(W,"g"));if(0===t.length||!n)throw new Error("Invalid date format.");const i=n.map(e=>Z[e]),r=Object.keys(K).reduce((e,t)=>(n.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return G[e]={parser(e,t){const i=e.split(Y).reduce((e,t,i)=>{if(t.length>0&&n[i]){const r=n[i][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,n)=>{const r=K[n](e,i[n],t);return isNaN(r)?e:r},j())},formatter:(e,n)=>i.reduce((i,r,o)=>i+`${t[o]}${r(e,n)}`,"")+D(t)}}function X(e,t,n){if(e instanceof Date||"number"==typeof e){const t=L(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return j();if(t&&t.toValue){const i=t.toValue(e,t,n);return isNaN(i)?void 0:L(i)}return Q(t).parser(e,n)}}function ee(e,t,n){if(isNaN(e)||!e&&0!==e)return"";const i="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(i,t,n):Q(t).formatter(i,n)}const te=document.createRange();function ne(e){return te.createContextualFragment(e)}function ie(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function re(e){return e.getRootNode().activeElement===e}function oe(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function se(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function ae(e){e.firstChild&&(e.removeChild(e.firstChild),ae(e))}const le=new WeakMap,{addEventListener:ce,removeEventListener:ue}=EventTarget.prototype;function de(e,t){let n=le.get(e);n||(n=[],le.set(e,n)),t.forEach(e=>{ce.call(...e),n.push(e)})}function pe(e){let t=le.get(e);t&&(t.forEach(e=>{ue.call(...e)}),le.delete(e))}if(!Event.prototype.composedPath){const e=(t,n=[])=>{let i;return n.push(t),t.parentNode?i=t.parentNode:t.host?i=t.host:t.defaultView&&(i=t.defaultView),i?e(i,n):n};Event.prototype.composedPath=function(){return e(this.target)}}function he(e,t){const n="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return function e(t,n,i){const[r,...o]=t;return n(r)?r:r!==i&&"HTML"!==r.tagName&&0!==o.length?e(o,n,i):void 0}(e.composedPath(),n,e.currentTarget)}var fe={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},ge={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:me,format:ve,weekStart:ye}=ge;function be(e,t){return e.length<6&&t>=0&&t<7?S(e,t):e}function we(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return H;case 2:return B;case 3:return z}}function _e(e,t,n){return t.weekStart=e,t.weekEnd=(e+6)%7,4===n&&(t.getWeekNumber=we(4,e)),e}function ke(e,t,n,i){const r=X(e,t,n);return void 0!==r?r:i}function xe(e,t,n=3){const i=parseInt(e,10);return i>=0&&i<=n?i:t}function De(e,t,n,i){t in e&&(n in e||(e[n]=i?i(e[t]):e[t]),delete e[t])}function Se(e,t){const n=Object.assign({},e),i={},r=t.constructor.locales,o=!!t.rangeSideIndex;let{datesDisabled:s,format:a,language:l,locale:c,maxDate:u,maxView:d,minDate:p,pickLevel:h,startView:f,weekNumbers:g,weekStart:m}=t.config||{};if(De(n,"calendarWeeks","weekNumbers",e=>e?1:0),De(n,"clearBtn","clearButton"),De(n,"todayBtn","todayButton"),De(n,"todayBtnMode","todayButtonMode"),n.language){let e;if(n.language!==l&&(r[n.language]?e=n.language:(e=n.language.split("-")[0],r[e]||(e=!1))),delete n.language,e){l=i.language=e;const t=c||r[me];c=Object.assign({format:ve,weekStart:ye},r[me]),l!==me&&Object.assign(c,r[l]),i.locale=c,a===t.format&&(a=i.format=c.format),m===t.weekStart&&(m=_e(c.weekStart,i,g))}}if(n.format){const e="function"==typeof n.format.toDisplay,t="function"==typeof n.format.toValue,r=W.test(n.format);(e&&t||r)&&(a=i.format=n.format),delete n.format}let v=h;"pickLevel"in n&&(v=xe(n.pickLevel,h,2),delete n.pickLevel),v!==h&&(v>h&&("minDate"in n||(n.minDate=p),"maxDate"in n||(n.maxDate=u)),s&&!n.datesDisabled&&(n.datesDisabled=[]),h=i.pickLevel=v);let y=p,b=u;if("minDate"in n){const e=T(0,0,1);y=null===n.minDate?e:ke(n.minDate,a,c,y),y!==e&&(y=U(y,h,!1)),delete n.minDate}if("maxDate"in n&&(b=null===n.maxDate?void 0:ke(n.maxDate,a,c,b),void 0!==b&&(b=U(b,h,!0)),delete n.maxDate),b<y?(p=i.minDate=b,u=i.maxDate=y):(p!==y&&(p=i.minDate=y),u!==b&&(u=i.maxDate=b)),n.datesDisabled){const e=n.datesDisabled;if("function"==typeof e)i.datesDisabled=null,i.checkDisabled=(t,n)=>e(new Date(t),n,o);else{const t=i.datesDisabled=e.reduce((e,t)=>{const n=X(t,a,c);return void 0!==n?S(e,U(n,h,o)):e},[]);i.checkDisabled=e=>t.includes(e)}delete n.datesDisabled}if("defaultViewDate"in n){const e=X(n.defaultViewDate,a,c);void 0!==e&&(i.defaultViewDate=e),delete n.defaultViewDate}if("weekStart"in n){const e=Number(n.weekStart)%7;isNaN(e)||(m=_e(e,i,g)),delete n.weekStart}if(n.daysOfWeekDisabled&&(i.daysOfWeekDisabled=n.daysOfWeekDisabled.reduce(be,[]),delete n.daysOfWeekDisabled),n.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=n.daysOfWeekHighlighted.reduce(be,[]),delete n.daysOfWeekHighlighted),"weekNumbers"in n){let e=n.weekNumbers;if(e){const t="function"==typeof e?(t,n)=>e(new Date(t),n):we(e=parseInt(e,10),m);t&&(g=i.weekNumbers=e,i.getWeekNumber=t)}else g=i.weekNumbers=0,i.getWeekNumber=null;delete n.weekNumbers}if("maxNumberOfDates"in n){const e=parseInt(n.maxNumberOfDates,10);e>=0&&(i.maxNumberOfDates=e,i.multidate=1!==e),delete n.maxNumberOfDates}n.dateDelimiter&&(i.dateDelimiter=String(n.dateDelimiter),delete n.dateDelimiter);let w=d;"maxView"in n&&(w=xe(n.maxView,d),delete n.maxView),w=h>w?h:w,w!==d&&(d=i.maxView=w);let _=f;if("startView"in n&&(_=xe(n.startView,_),delete n.startView),_<h?_=h:_>d&&(_=d),_!==f&&(i.startView=_),n.prevArrow){const e=ne(n.prevArrow);e.childNodes.length>0&&(i.prevArrow=e.childNodes),delete n.prevArrow}if(n.nextArrow){const e=ne(n.nextArrow);e.childNodes.length>0&&(i.nextArrow=e.childNodes),delete n.nextArrow}if("disableTouchKeyboard"in n&&(i.disableTouchKeyboard="ontouchstart"in document&&!!n.disableTouchKeyboard,delete n.disableTouchKeyboard),n.orientation){const e=n.orientation.toLowerCase().split(/\s+/g);i.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete n.orientation}if("todayButtonMode"in n){switch(n.todayButtonMode){case 0:case 1:i.todayButtonMode=n.todayButtonMode}delete n.todayButtonMode}return Object.entries(n).forEach(([e,t])=>{void 0!==t&&e in ge&&(i[e]=t)}),i}const $e={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};var Ee=A('<div class="datepicker">\n  <div class="datepicker-picker">\n    <div class="datepicker-header">\n      <div class="datepicker-title"></div>\n      <div class="datepicker-controls">\n        <button type="button" class="%buttonClass% prev-button prev-btn"></button>\n        <button type="button" class="%buttonClass% view-switch"></button>\n        <button type="button" class="%buttonClass% next-button next-btn"></button>\n      </div>\n    </div>\n    <div class="datepicker-main"></div>\n    <div class="datepicker-footer">\n      <div class="datepicker-controls">\n        <button type="button" class="%buttonClass% today-button today-btn"></button>\n        <button type="button" class="%buttonClass% clear-button clear-btn"></button>\n      </div>\n    </div>\n  </div>\n</div>'),Ce=A(`<div class="days">\n  <div class="days-of-week">${O("span",7,{class:"dow"})}</div>\n  <div class="datepicker-grid">${O("span",42)}</div>\n</div>`),Oe=A(`<div class="week-numbers calendar-weeks">\n  <div class="days-of-week"><span class="dow"></span></div>\n  <div class="weeks">${O("span",6,{class:"week"})}</div>\n</div>`);class Ae{constructor(e,t){Object.assign(this,t,{picker:e,element:ne('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,n){this.disabled=[];const i=this.picker;i.setViewSwitchLabel(e),i.setPrevButtonDisabled(t),i.setNextButtonDisabled(n)}setDisabled(e,t){t.add("disabled"),S(this.disabled,e)}performBeforeHook(e,t){let n=this.beforeShow(new Date(t));switch(typeof n){case"boolean":n={enabled:n};break;case"string":n={classes:n}}if(n){const i=e.classList;if(!1===n.enabled&&this.setDisabled(t,i),n.classes){const e=n.classes.split(/\s+/);i.add(...e),e.includes("disabled")&&this.setDisabled(t,i)}n.content&&function(e,t){ae(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(ne(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,n.content)}}renderCell(e,t,n,i,{selected:r,range:o},s,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=i);const l=e.classList;if(e.className="datepicker-cell "+this.cellClass,n<this.first?l.add("prev"):n>this.last&&l.add("next"),l.add(...a),(s||this.checkDisabled(i,this.id))&&this.setDisabled(i,l),o){const[e,t]=o;n>e&&n<t&&l.add("range"),n===e&&l.add("range-start"),n===t&&l.add("range-end")}r.includes(n)&&l.add("selected"),n===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,i)}refreshCell(e,t,n,[i,r]){const o=e.classList;o.remove("range","range-start","range-end","selected","focused"),t>i&&t<r&&o.add("range"),t===i&&o.add("range-start"),t===r&&o.add("range-end"),n.includes(t)&&o.add("selected"),t===this.focused&&o.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class Le extends Ae{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=ne(Ce).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const n=this.locale=e.locale;this.dayNames=n.daysMin,this.switchLabelFormat=n.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=ne(Oe).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(se(this.dow),this.weekNumbers&&se(this.weekNumbers.dow)):(oe(this.dow),this.weekNumbers&&oe(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const n=(this.weekStart+t)%7;e.textContent=this.dayNames[n],e.className=this.daysOfWeekDisabled.includes(n)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),n=e.getMonth(),i=T(t,n,1),r=I(i,this.weekStart,this.weekStart);this.first=i,this.last=T(t,n+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?j():void 0,this.prepareForRender(ee(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=I(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((n,i)=>{const r=M(t,7*i);n.textContent=this.getWeekNumber(r,e),i>3&&n.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const n=M(this.start,t),i=new Date(n),r=i.getDay(),o=[];this.today===n&&o.push("today"),this.daysOfWeekHighlighted.includes(r)&&o.push("highlighted"),this.renderCell(e,i.getDate(),n,n,this,n<this.minDate||n>this.maxDate||this.daysOfWeekDisabled.includes(r),o)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function je(e,t){if(!e||!e[0]||!e[1])return;const[[n,i],[r,o]]=e;return n>t||r<t?void 0:[n===t?i:-1,r===t?o:12]}class Te extends Ae{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(ne(O("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=T(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const n=new Date(t),i=n.getFullYear(),r=n.getMonth();return void 0===e[i]?e[i]=[r]:S(e[i],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,n=this.year===this.minYear,i=this.year===this.maxYear,r=je(this.range,this.year);Array.from(this.grid.children).forEach((o,s)=>{const a=U(new Date(this.year,s,1),1,this.isRangeEnd);this.renderCell(o,this.monthNames[s],s,a,{selected:e,range:r},t||n&&s<this.minMonth||i&&s>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=je(this.range,this.year)||[];Array.from(this.grid.children).forEach((n,i)=>{this.refreshCell(n,i,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class Me extends Ae{constructor(e,t){super(e,t)}init(e,t=!0){var n;t&&(this.navStep=10*this.step,this.beforeShowOption="beforeShow"+(n=this.cellClass,[...n].reduce((e,t,n)=>e+(n?t:t.toUpperCase()),"")),this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(ne(O("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=V(e.minDate,this.step),this.minDate=T(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=V(e.maxDate,this.step),this.maxDate=T(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=V(e,this.navStep),n=t+9*this.step;this.first=t,this.last=n,this.start=t-this.step,this.focused=V(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>S(e,V(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return V(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const n=this.start+t*this.step,i=U(new Date(n,0,1),2,this.isRangeEnd);e.dataset.year=n,this.renderCell(e,n,n,i,this,n<this.minYear||n>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function Ne(e,t){const n={date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e};e.element.dispatchEvent(new CustomEvent(t,{detail:n}))}function Fe(e,t){const{config:n,picker:i}=e,{currentView:r,viewDate:o}=i;let s;switch(r.id){case 0:s=N(o,t);break;case 1:s=F(o,t);break;default:s=F(o,t*r.navStep)}s=C(s,n.minDate,n.maxDate),i.changeFocus(s).render()}function Pe(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Ie(e){e.setDate({clear:!0})}function Re(e){const t=j();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function He(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},n=e.element;re(n)?n.addEventListener("blur",t,{once:!0}):t()}function qe(e,t){const n=e.picker,i=new Date(n.viewDate),r=n.currentView.id,o=1===r?N(i,t-i.getMonth()):F(i,t-i.getFullYear());n.changeFocus(o).changeView(r-1).render()}function Be(e){Pe(e)}function ze(e){Fe(e,-1)}function Ve(e){Fe(e,1)}function Ue(e,t){const n=he(t,".datepicker-cell");if(!n||n.classList.contains("disabled"))return;const{id:i,isMinView:r}=e.picker.currentView,o=n.dataset;r?e.setDate(Number(o.date)):qe(e,Number(1===i?o.month:o.year))}function We(e){e.preventDefault()}const Ye=["left","top","right","bottom"].reduce((e,t)=>(e[t]="datepicker-orient-"+t,e),{}),Ge=e=>e?e+"px":e;function Ke(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,se(e.controls.title)):(e.controls.title.textContent="",oe(e.controls.title))),t.prevArrow){const n=e.controls.prevButton;ae(n),t.prevArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const n=e.controls.nextButton;ae(n),t.nextArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?se(e.controls.todayButton):oe(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:n}=e.datepicker.config;e.controls.todayButton.disabled=!E(j(),t,n)}"clearButton"in t&&(t.clearButton?se(e.controls.clearButton):oe(e.controls.clearButton))}function Ze(e){const{dates:t,config:n,rangeSideIndex:i}=e;return C(t.length>0?D(t):U(n.defaultViewDate,n.pickLevel,i),n.minDate,n.maxDate)}function Je(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:n,year:i,first:r,last:o}=e.currentView,s=new Date(t).getFullYear();switch(n){case 0:return t<r||t>o;case 1:return s!==i;default:return s<r||s>o}}function Qe(e){return window.getComputedStyle(e).direction}class Xe{constructor(e){const{config:t,inputField:n}=this.datepicker=e,i=Ee.replace(/%buttonClass%/g,t.buttonClass),r=this.element=ne(i).firstChild,[o,s,a]=r.firstChild.children,l=o.firstElementChild,[c,u,d]=o.lastElementChild.children,[p,h]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:u,nextButton:d,todayButton:p,clearButton:h};this.main=s,this.controls=f;const g=n?"dropdown":"inline";r.classList.add("datepicker-"+g),Ke(this,t),this.viewDate=Ze(e),de(e,[[r,"mousedown",We],[s,"click",Ue.bind(null,e)],[f.viewSwitch,"click",Be.bind(null,e)],[f.prevButton,"click",ze.bind(null,e)],[f.nextButton,"click",Ve.bind(null,e)],[f.todayButton,"click",Re.bind(null,e)],[f.clearButton,"click",Ie.bind(null,e)]]),this.views=[new Le(this),new Te(this),new Me(this,{id:2,name:"years",cellClass:"year",step:1}),new Me(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):n.after(this.element)}setOptions(e){Ke(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,n=e.inputField;if(n){const i=Qe(n);i!==Qe(ie(t))?t.dir=i:t.dir&&t.removeAttribute("dir"),t.style.visibility="hidden",t.classList.add("active"),this.place(),t.style.visibility="",e.config.disableTouchKeyboard&&n.blur()}else t.classList.add("active");this.active=!0,Ne(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Ne(this.datepicker,"hide"))}place(){const{classList:e,offsetParent:t,style:n}=this.element,{config:i,inputField:r}=this.datepicker,{width:o,height:s}=this.element.getBoundingClientRect(),{left:a,top:l,right:c,bottom:u,width:d,height:p}=r.getBoundingClientRect();let{x:h,y:f}=i.orientation,g=a,m=l;if(t!==document.body&&t){const e=t.getBoundingClientRect();g-=e.left-t.scrollLeft,m-=e.top-t.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=function e(t){const n=ie(t);if(n!==document.body&&n)return"visible"!==window.getComputedStyle(n).overflow?n:e(n)}(r);let y=0,b=0,{clientWidth:w,clientHeight:_}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(b=e.top),e.left>0&&(y=e.left),e.right<w&&(w=e.right),e.bottom<_&&(_=e.bottom)}let k=0;"auto"===h&&(a<y?(h="left",k=y-a):a+o>w?(h="right",w<c&&(k=w-c)):h="rtl"===Qe(r)?c-o<y?"left":"right":"left"),"right"===h&&(g+=d-o),g+=k,"auto"===f&&(f=l-s>b&&u+s>_?"top":"bottom"),"top"===f?m-=s:m+=p,e.remove(...Object.values(Ye)),e.add(Ye[h],Ye[f]),n.left=Ge(g),n.top=Ge(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Je(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e){const t=void 0===e?Ze(this.datepicker):e;return this._renderMethod=Je(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:n,_oldView:i}=this,r=new Date(this._oldViewDate),o=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[o](),i&&(this.main.replaceChild(t.element,i.element),Ne(n,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&Ne(n,"changeYear"),e.getMonth()!==r.getMonth()&&Ne(n,"changeMonth")}}}function et(e,t,n){const i=e.picker,r=i.currentView,o=r.step||1;let s,a=i.viewDate;switch(r.id){case 0:a=M(a,n?7*t:t),s=M;break;case 1:a=N(a,n?4*t:t),s=N;break;default:a=F(a,t*(n?4:1)*o),s=F}a=function e(t,n,i,r,o,s){if(E(t,o,s)){if(r(t)){return e(n(t,i),n,i,r,o,s)}return t}}(a,s,t<0?-o:o,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&i.changeFocus(a).render()}function tt(e,t){const{config:n,picker:i,editMode:r}=e,o=i.active,{key:s,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,u=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===s)return void He(e);if("Enter"===s){if(o)if(r)e.exitEditMode({update:!0,autohide:n.autohide});else{const t=i.currentView;t.isMinView?e.setDate(i.viewDate):(i.changeView(t.id-1).render(),u())}else e.update();return}const d=n.shortcutKeys,p={key:s,ctrlOrMetaKey:c,altKey:a,shiftKey:l},h=Object.keys(d).find(e=>{const t=d[e];return!Object.keys(t).find(e=>t[e]!==p[e])});if(h){let t;if("toggle"===h?t=h:r?"exitEditMode"===h&&(t=h):o?"hide"===h?t=h:"prevButton"===h?t=[Fe,[e,-1]]:"nextButton"===h?t=[Fe,[e,1]]:"viewSwitch"===h?t=[Pe,[e]]:n.clearButton&&"clearButton"===h?t=[Ie,[e]]:n.todayButton&&"todayButton"===h&&(t=[Re,[e]]):"show"===h&&(t=h),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void u()}if(!o||r)return;const f=(n,i)=>{l||c||a?e.enterEditMode():(et(e,n,i),t.preventDefault())};"ArrowLeft"===s?f(-1,!1):"ArrowRight"===s?f(1,!1):"ArrowUp"===s?f(-1,!0):"ArrowDown"===s?f(1,!0):("Backspace"===s||"Delete"===s||s&&1===s.length&&!c)&&e.enterEditMode()}function nt(e){e.config.showOnFocus&&!e._showing&&e.show()}function it(e,t){const n=t.target;(e.picker.active||e.config.showOnClick)&&(n._active=re(n),n._clicking=setTimeout(()=>{delete n._active,delete n._clicking},2e3))}function rt(e,t){const n=t.target;n._clicking&&(clearTimeout(n._clicking),delete n._clicking,n._active&&e.enterEditMode(),delete n._active,e.config.showOnClick&&e.show())}function ot(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function st(e,t){const{element:n,picker:i}=e;if(!i.active&&!re(n))return;const r=i.element;he(t,e=>e===n||e===r)||He(e)}function at(e,t){return e.map(e=>ee(e,t.format,t.locale)).join(t.dateDelimiter)}function lt(e,t,n=!1){if(0===t.length)return n?[]:void 0;const{config:i,dates:r,rangeSideIndex:o}=e,{pickLevel:s,maxNumberOfDates:a}=i;let l=t.reduce((e,t)=>{let n=X(t,i.format,i.locale);return void 0===n||(n=U(n,s,o),!E(n,i.minDate,i.maxDate)||e.includes(n)||i.checkDisabled(n,s)||!(s>0)&&i.daysOfWeekDisabled.includes(new Date(n).getDay())||e.push(n)),e},[]);return 0!==l.length?(i.multidate&&!n&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function ct(e,t=3,n=!0,i){const{config:r,picker:o,inputField:s}=e;if(2&t){const e=o.active?r.pickLevel:r.startView;o.update(i).changeView(e).render(n)}1&t&&s&&(s.value=at(e.dates,r))}function ut(e,t,n){const i=e.config;let{clear:r,render:o,autohide:s,revert:a,forceRefresh:l,viewDate:c}=n;void 0===o&&(o=!0),o?void 0===s&&(s=i.autohide):s=l=!1,c=X(c,i.format,i.locale);const u=lt(e,t,r);(u||a)&&(u&&u.toString()!==e.dates.toString()?(e.dates=u,ct(e,o?3:1,!0,c),Ne(e,"changeDate")):ct(e,l?3:1,!0,c),s&&e.hide())}function dt(e,t){return t?n=>ee(n,t,e.config.locale):e=>new Date(e)}class pt{constructor(e,t={},n){e.datepicker=this,this.element=e,this.dates=[];const i=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:j(),maxDate:void 0,minDate:void 0},Se(ge,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(i.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):i.container=e,n){const e=n.inputs.indexOf(r),t=n.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=n,this.rangeSideIndex=e}this._options=t,Object.assign(i,Se(t,this)),i.shortcutKeys=function(e){return Object.keys($e).reduce((t,n)=>{const i=void 0===e[n]?$e[n]:e[n],r=i&&i.key;if(!r||"string"!=typeof r)return t;const o={key:r,ctrlOrMetaKey:!!(i.ctrlOrMetaKey||i.ctrlKey||i.metaKey)};return r.length>1&&(o.altKey=!!i.altKey,o.shiftKey=!!i.shiftKey),t[n]=o,t},{})}(t.shortcutKeys||{});const o=$(e.value||e.dataset.date,i.dateDelimiter);delete e.dataset.date;const s=lt(this,o);s&&s.length>0&&(this.dates=s),r&&(r.value=at(this.dates,i));const a=this.picker=new Xe(this),l=[e,"keydown",tt.bind(null,this)];r?de(this,[l,[r,"focus",nt.bind(null,this)],[r,"mousedown",it.bind(null,this)],[r,"click",rt.bind(null,this)],[r,"paste",ot.bind(null,this)],[document,"mousedown",st.bind(null,this)],[window,"resize",a.place.bind(a)]]):(de(this,[l]),this.show())}static formatDate(e,t,n){return ee(e,t,n&&fe[n]||fe.en)}static parseDate(e,t,n){return X(e,t,n&&fe[n]||fe.en)}static get locales(){return fe}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=Se(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),ct(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;re(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),pe(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e){const t=dt(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],n={},i=D(e);!i||"object"!=typeof i||Array.isArray(i)||i instanceof Date||Object.assign(n,t.pop());ut(this,Array.isArray(t[0])?t[0]:t,n)}update(e){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});ut(this,$(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e){return dt(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:n,picker:i,active:r,rangeSideIndex:o}=this,s=n.pickLevel,a=X(e,n.format,n.locale);void 0!==a&&(i.changeFocus(U(a,s,o)),r&&t&&i.changeView(s),i.render())}refresh(e,t=!1){let n;e&&"string"!=typeof e&&(t=e,e=void 0),n="picker"===e?2:"input"===e?1:3,ct(this,n,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}function ht(e){return(ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ft(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ht(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ht(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ht(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.date={load:function(e,t){var n=r()(e).find(".cpt-date-section:first"),i=r()(n).children("input"),o="no"!==r()(i).data("max")&&r()(i).data("max"),s="no"!==r()(i).data("min")&&r()(i).data("min");new pt(i[0],{autohide:!0,clearBtn:!0,maxDate:o,minDate:s,format:"dd/mm/yyyy"})}},e}));var gt=wp.i18n,mt=gt.__;gt._x,gt._n,gt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.file={load:function(e,t){new vt(e)}},e}));var vt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fileSection=r()(t).find(".cpt-file-section:first"),this.fileTypes=r()(this.fileSection).data("type"),this.fileInput=r()(this.fileSection).find("input"),this.filePreview=r()(this.fileSection).find("img"),this.fileActions=r()(this.fileSection).find(".cpt-file-actions"),this.fileName=r()(this.fileSection).find(".file-name"),this.addButton=r()(this.fileSection).find(".cpt-file-upload"),this.removeButton=r()(this.fileSection).find(".cpt-file-remove"),this.listenRemoveEvent(),this.listenAddEvent()}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(){var e=this;r()(this.addButton).on("click",(function(t){t.preventDefault();var n=wp.media({title:mt("Add file","custom-post-types"),frame:"select",library:wp.media.query({type:e.fileTypes,uploadedTo:wp.media.view.settings.post.id}),button:{text:mt("Choose file","custom-post-types")},multiple:!1}).on("select",(function(){var t=n.state().get("selection").first().toJSON(),i=!!(t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url)&&t.sizes.thumbnail.url;i&&(r()(e.filePreview).attr("src",i),r()(e.filePreview).show());var o=t.mime;o.startsWith("image")&&(o="image"),o.startsWith("audio")&&(o="audio"),o.startsWith("video")&&(o="video"),"-1"!=r.a.inArray(o,e.fileTypes)?(r()(e.fileName).html(t.url.split("/").reverse()[0]),r()(e.fileActions).attr("title",t.url.split("/").reverse()[0]),r()(e.fileInput).val(t.id),r()(e.removeButton).prop("disabled",!1)):e.resetField()})).open()}))}},{key:"listenRemoveEvent",value:function(){var e=this;r()(this.removeButton).on("click",(function(t){t.preventDefault(),e.resetField()}))}},{key:"resetField",value:function(){r()(this.fileName).html(""),r()(this.fileInput).val(""),r()(this.filePreview).removeAttr("src"),r()(this.filePreview).hide(),r()(this.removeButton).prop("disabled",!0),r()(this.fileActions).attr("title",mt("Choose","custom-post-types"))}}])&&ft(t.prototype,n),i&&ft(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();n(1),n(2);function yt(e){return(yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==yt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==yt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===yt(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.post_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-post_rel-options",nonce:cpt.ajax_nonce,search:e.term,post_type:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e}));var wt=wp.i18n;wt.__,wt._x,wt._n,wt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.repeater={load:function(e,t){new _t(e)}},e}));var _t=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.repeaterSection=r()(t).find(".cpt-repeater-section:first"),this.parent=r()(this.repeaterSection).data("parent"),this.fields=r()(this.repeaterSection).data("fields"),this.initSortable();var i=r()(this.repeaterSection).parent().children(".cpt-repeater-add:first");i.length>0&&this.listenAddEvent(i);var o=r()(this.repeaterSection).find(".cpt-repeater-group");r.a.each(o,(function(e,t){n.initFieldGroup(t)}))}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(e){var t=this;r()(e).on("click",(function(n){n.preventDefault(),r()(e).prop("disabled",!0);var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(t.repeaterSection).append(i);var o=r()(t.repeaterSection).children(".cpt-repeater-group").length,s=[];s.push({name:"action",value:"cpt-get-repeater-group"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"fields",value:JSON.stringify(t.fields)}),s.push({name:"parent",value:t.parent+"["+o+"]"}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(n){if(n.success){r()(e).prop("disabled",!1),r()(i).remove();var o=r()(n.data);r()(t.repeaterSection).append(o),t.initFieldGroup(o)}else r()(e).prop("disabled",!1),r()(i).remove(),console.log("Error",n)}})}))}},{key:"initSortable",value:function(){var e=r()(this.repeaterSection).children(".cpt-repeater-group").children(".cpt-repeater-buttons").find(".move");r()(e).on("click",(function(e){e.preventDefault()})),r()(this.repeaterSection).sortable({handle:".move",cancel:"",cursor:"grab",axis:"y",delay:150,dropOnEmpty:!1,opacity:.5,revert:!0})}},{key:"initFieldGroup",value:function(e){var t=r()(e).find(".cpt-repeater-fields:first").children(".cpt-field"),n=r()(e).find(".cpt-repeater-fields:first .cpt-repeater-extra").children(".cpt-field");r.a.each(r.a.merge(t,n),(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")})),this.listenRemoveEvent(e),this.autofillKeyInput(e),this.listenSwitchFieldTypeEvent(e)}},{key:"listenRemoveEvent",value:function(e){var t=r()(e).find(".remove:first"),n=r()(t).closest(".cpt-repeater-group").children(".cpt-repeater-remove");r()(t).on("click",(function(e){e.preventDefault(),r()(n).addClass("active")})),r()(n).find(".abort:first").on("click",(function(e){e.preventDefault(),r()(n).removeClass("active")})),r()(n).find(".confirm:first").on("click",(function(t){t.preventDefault(),r()(e).remove()}))}},{key:"autofillKeyInput",value:function(e){var t=r()(e).find('input[id$="-label"]:first'),n=r()(e).find('input[id$="-key"]:first');window.cptUtils.autoFillKey(n,t)}},{key:"listenSwitchFieldTypeEvent",value:function(e){var t=r()(e).find(".cpt-repeater-field-type:first").find("select"),n=r()(e).find(".cpt-repeater-extra:first");r()(t).on("select2:select",(function(e){r()(n).empty();var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(n).append(i);var o=!!r()(t).val().length&&r()(t).val();if(o){var s=r()(t).attr("name").replace("meta-fields","").replace("[type]",""),a=[];a.push({name:"action",value:"cpt-get-repeater-extra-fields"}),a.push({name:"nonce",value:cpt.ajax_nonce}),a.push({name:"field-type",value:o}),a.push({name:"parent",value:s}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:a,success:function(e){if(e.success){r()(i).remove();var t=r()(e.data);r()(n).append(t),r()(n).children(".cpt-field"),r.a.each(t,(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")}))}else r()(i).remove(),console.log("Error",e)}})}else r()(i).remove()}))}}])&&bt(t.prototype,n),i&&bt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function kt(e){return(kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,St(i.key),i)}}function Dt(e,t,n){return(t=St(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function St(e){var t=function(e,t){if("object"!==kt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==kt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===kt(t)?t:String(t)}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.select={load:function(e,t){window.cptUtils.disableProFieldSelectOptions(e);var n=r()(e).find("select:first"),i={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};r()(n).select2(i)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tax_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-tax_rel-options",nonce:cpt.ajax_nonce,search:e.term,taxonomy:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.text={load:function(e,t){}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.time={load:function(e,t){for(var n=r()(e).find(".cpt-time-section:first"),i=r()(n).children("select"),o=r()(i).data("value")?r()(i).data("value"):"",s="no"!==r()(i).data("max")&&r()(i).data("max"),a="no"!==r()(i).data("min")&&r()(i).data("min"),l=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"00:00",i=0;if(!n)return i;var r=!!n.split(":")&&n.split(":"),o=null!==(e=r[0])&&void 0!==e&&e,s=null!==(t=r[1])&&void 0!==t&&t,a=Number(o+s);return Number.isInteger(a)?a:i},c=l(s),u=l(a),d=0;d<=23;d++){d=d<10?"0"+d:d;for(var p=0;p<=59;p++){var h=d+":"+(p=p<10?"0"+p:p);(u>0&&l(h)<u||c>0&&l(h)>c)&&c>u||r()(i).append(r()('<option value="'+h+'"'+(o==h?' selected="selected"':"")+">"+h+"</option>"))}}var f={placeholder:r()(i).attr("placeholder")?r()(selectEl).attr("placeholder"):" ... ",allowClear:!0,multiple:!1};r()(i).select2(f)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tinymce={load:function(e,t){new $t(e)}},e}));var $t=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Dt(this,"editorEl",void 0),Dt(this,"editorId",void 0),Dt(this,"editorForm",void 0),Dt(this,"defaultArgs",{tinymce:{wpautop:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,spellchecker,fullscreen,wp_adv,listbuttons",toolbar2:"styleselect,strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",textarea_rows:20,wp_autoresize_on:!1,autoresize_min_height:50},quicktags:{buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,more,close"},mediaButtons:!0}),this.editorEl=r()(t).find("textarea:first"),this.editorId=r()(this.editorEl).attr("id"),this.defaultArgs.tinymce.wp_autoresize_on=r()(this.editorEl).is("[autoresize]"),this.editorForm=r()(t).closest("form"),this.startEditor()}var t,n,i;return t=e,(n=[{key:"startEditor",value:function(){var e=this,t=!1,n=setInterval((function(){!r()("#post-title-0")&&r()("body").hasClass("block-editor-page")||(t=!0,e.removeEditor(),e.initializeEditor(),e.listenSubmitEvent(),e.listenSortableEvent()),t&&clearInterval(n)}),500)}},{key:"initializeEditor",value:function(){wp.oldEditor.initialize(this.editorId,this.defaultArgs)}},{key:"removeEditor",value:function(){wp.oldEditor.remove(this.editorId)}},{key:"listenSubmitEvent",value:function(){var e=tinyMCE.editors[this.editorId];r()(this.editorForm).on("submit",(function(t){e.save()})),e.on("blur",(function(t){e.save()})),r()(document).ajaxComplete((function(t,n,i){i.data&&i.data.match(/action=add-tag/)&&(e.setContent(""),e.save())}))}},{key:"listenSortableEvent",value:function(){var e=this,t=r()(this.editorEl).closest(".ui-sortable");r()(t).on("sortstart",(function(){e.removeEditor()})),r()(t).on("sortstop",(function(){e.initializeEditor()}))}}])&&xt(t.prototype,n),i&&xt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Et(e){return(Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ct(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==Et(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===Et(o)?o:String(o)),i)}var r,o}var Ot=wp.i18n,At=Ot.__;Ot._x,Ot._n,Ot._nx;new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.body=r()("body"),this.window=r()(window),this.utils=new u,this.loadFields(),this.loadUiFeatures()}var t,n,i;return t=e,(n=[{key:"loadUiFeatures",value:function(){var e=this;this.body.on("click",".cpt-field-wrap.advanced-field-btn .button",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-fields-section"),i=r()(n).find(".cpt-field-wrap.advanced-field");r()(t).hasClass("button-secondary")?(r()(i).removeClass("active"),r()(t).removeClass("button-secondary").addClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-insert"),r()(t).find(".label").html(At("Advanced view","custom-post-types"))):(r()(i).addClass("active"),r()(t).addClass("button-secondary").removeClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-remove"),r()(t).find(".label").html(At("Simple view","custom-post-types")))})),this.window.on("load",(function(){if(e.body.hasClass("block-editor-page")){var t=r()('.cpt-fields-section *[id^="meta-fields-"][required]');t.length<=0||setInterval((function(){!function(e){var t=!0;r.a.each(e,(function(e,n){var i=r()(n).val().length>0;t=!!t&&i}));var n=r()(".edit-post-header__settings button.editor-post-publish-button__button");t?(r()(n).removeAttr("disabled"),r()(n).attr("aria-disabled","false")):(r()(n).attr("disabled","disabled"),r()(n).attr("aria-disabled","true"))}(t)}),200)}})),this.body.on("click",".cpt-notice.is-dismissible a.cpt-dismiss-notice",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-notice").find("button.notice-dismiss"),i=r()(t).data("notice"),o=r()(t).data("duration"),s=[];s.push({name:"action",value:"cpt-dismiss-notice"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"key",value:i}),s.push({name:"duration",value:o}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?n.click():console.log("Error",e)}})})),this.body.on("click",".cpt-notice pre.error-code > a",(function(e){e.preventDefault();var t=e.currentTarget;r()(t).closest(".error-code").find("code").addClass("show"),r()(t).remove()}));var t=r()('div[data-id="manage_cpt"].cpt-fields-section, div[data-id="manage_cpt_tax"].cpt-fields-section');r.a.each(t,(function(t,n){var i=r()(n).find('input[id$="-plural"]:first'),o=r()(n).find('input[id$="-id"]:first');e.utils.autoFillKey(o,i)}))}},{key:"loadFields",value:function(){var e=this;this.$fieldGroups=r()(".cpt-fields-section"),this.$fieldGroups&&(this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]),r.a.each(this.$fieldGroups,(function(t,n){var i=r()(n).children(".cpt-field");i&&r.a.each(i,(function(t,n){var i=r()(n).data("field-type");e.utils.appendFieldEvents(i,n),r()(n).trigger("load")}))})))}}])&&Ct(t.prototype,n),i&&Ct(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}())}]);
     17!function(e,t){var n={version:302};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var i=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(i)&&i>=n.version)return}if(!Color.fn.hasOwnProperty("to_s")){Color.fn.to_s=function(e){"hex"===(e=e||"hex")&&this._alpha<1&&(e="rgba");var t="";return"hex"===e?t=this.toString():this.error||(t=this.toCSS(e).replace(/\(\s+/,"(").replace(/\s+\)/,")")),t},window.wpColorPickerAlpha=n;var r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(e){return void 0===e&&(e=this._color),this.alphaOptions.alphaEnabled?(e=e.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(e=e.replace(/\s+/g,"")),e):e.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(e){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(e){var t=this,n=function(n){var i=e.val(),r=new Color(i),o=(i=i.replace(/^(#|(rgb|hsl)a?)/,""),t.alphaOptions.alphaColorType);e.removeClass("iris-error"),r.error?""!==i&&e.addClass("iris-error"):"hex"===o&&"keyup"===n.type&&i.match(/^[0-9a-fA-F]{3}$/)||r.toIEOctoHex()!==t._color.toIEOctoHex()&&t._setOption("color",t._getColor(r))};e.on("change",n).on("keyup",t._debounce(n,100)),t.options.hide&&e.one("focus",(function(){t.show()}))},_initControls:function(){if(this._super(),this.alphaOptions.alphaEnabled){var t=this,n=t.controls.strip.clone(!1,!1),i=n.find(".iris-slider-offset"),r={stripAlpha:n,stripAlphaSlider:i};n.addClass("iris-strip-alpha"),i.addClass("iris-slider-offset-alpha"),n.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,(function(e,n){t.controls[e]=n})),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(e,n){t.active="strip",t._color._alpha=parseFloat(n.value/100),t._change.apply(t,arguments)}})}},_dimensions:function(e){if(this._super(e),this.alphaOptions.alphaEnabled){var t,n,i,r,o,s=this.options,a=this.controls.square,l=this.picker.find(".iris-strip");for(t=Math.round(this.picker.outerWidth(!0)-(s.border?22:0)),n=Math.round(a.outerWidth()),i=Math.round((t-n)/2),r=Math.round(i/2),o=Math.round(n+2*i+2*r);o>t;)i=Math.round(i-2),r=Math.round(r-1),o=Math.round(n+2*i+2*r);a.css("margin","0"),l.width(i).css("margin-left",r+"px")}},_change:function(){var t=this,n=t.active;if(t._super(),t.alphaOptions.alphaEnabled){var i=t.controls,o=parseInt(100*t._color._alpha),s=t._color.toRgb(),a=["rgb("+s.r+","+s.g+","+s.b+") 0%","rgba("+s.r+","+s.g+","+s.b+", 0) 100%"];t.picker.closest(".wp-picker-container").find(".wp-color-result");t.options.color=t._getColor(),i.stripAlpha.css({background:"linear-gradient(to bottom, "+a.join(", ")+"), url("+r+")"}),n&&i.stripAlphaSlider.slider("value",o),t._color.error||t.element.removeClass("iris-error").val(t.options.color),t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",(function(){var n=e(this).data("color");t.alphaOptions.alphaReset&&(t._color._alpha=1,n=t._getColor()),t._setOption("color",n)}))}},_paintDimension:function(e,t){var n=!1;this.alphaOptions.alphaEnabled&&"strip"===t&&(n=this._color,this._color=new Color(n.toString()),this.hue=this._color.h()),this._super(e,t),n&&(this._color=n)},_setOption:function(e,t){if("color"!==e||!this.alphaOptions.alphaEnabled)return this._super(e,t);t=""+t,newColor=new Color(t).setHSpace(this.options.mode),newColor.error||this._getColor(newColor)===this._getColor()||(this._color=newColor,this.options.color=this._getColor(),this.active="external",this._change())},color:function(e){return!0===e?this._color.clone():void 0===e?this._getColor():void this.option("color",e)}}),e.widget("wp.wpColorPicker",e.wp.wpColorPicker,{alphaOptions:{alphaEnabled:!1},_getAlphaOptions:function(){var t=this.element,n=t.data("type")||this.options.type,i=t.data("defaultColor")||t.val(),r={alphaEnabled:t.data("alphaEnabled")||!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"rgb",alphaColorWithSpace:!1};return r.alphaEnabled&&(r.alphaEnabled=t.is("input")&&"full"===n),r.alphaEnabled?(r.alphaColorWithSpace=i&&i.match(/\s/),e.each(r,(function(e,n){var o=t.data(e)||n;switch(e){case"alphaCustomWidth":o=o?parseInt(o,10):0,o=isNaN(o)?n:o;break;case"alphaColorType":o.match(/^(hex|(rgb|hsl)a?)$/)||(o=i&&i.match(/^#/)?"hex":i&&i.match(/^hsla?/)?"hsl":n);break;default:o=!!o}r[e]=o})),r):r},_create:function(){e.support.iris&&(this.alphaOptions=this._getAlphaOptions(),this._super())},_addListeners:function(){if(!this.alphaOptions.alphaEnabled)return this._super();var t=this,n=t.element,i=t.toggler.is("a");this.alphaOptions.defaultWidth=n.width(),this.alphaOptions.alphaCustomWidth&&n.width(parseInt(this.alphaOptions.defaultWidth+this.alphaOptions.alphaCustomWidth,10)),t.toggler.css({position:"relative","background-image":"url("+r+")"}),i?t.toggler.html('<span class="color-alpha" />'):t.toggler.append('<span class="color-alpha" />'),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":n.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),n.iris({change:function(e,n){t.colorAlpha.css({"background-color":n.color.to_s(t.alphaOptions.alphaColorType)}),"function"==typeof t.options.change&&t.options.change.call(this,e,n)}}),t.wrap.on("click.wpcolorpicker",(function(e){e.stopPropagation()})),t.toggler.on("click",(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()})),n.on("change",(function(r){var o=e(this).val();(n.hasClass("iris-error")||""===o||o.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r))})),t.button.on("click",(function(r){e(this).hasClass("wp-picker-default")?n.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(n.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r),n.trigger("change"))}))}})}}(jQuery)},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n.p,n.p,n(3);var i=n(0),r=n.n(i);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),a=new $(r||[]);return i(s,"_invoke",{value:D(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function g(){}function m(){}var v={};u(v,a,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(C([])));b&&b!==t&&n.call(b,a)&&(v=b);var w=m.prototype=f.prototype=Object.create(v);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){var r;i(this,"_invoke",{value:function(i,s){function a(){return new t((function(r,a){!function i(r,s,a,l){var c=h(e[r],e,s);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,l)}))}l(c.arg)}(i,s,r,a)}))}return r=r?r.then(a,a):a()}})}function D(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return E()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function $(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:E}}function E(){return{value:void 0,done:!0}}return g.prototype=m,i(w,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new k(d(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=C,$.prototype={constructor:$,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function a(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(i,r)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){a(o,i,r,s,l,"next",e)}function l(e){a(o,i,r,s,l,"throw",e)}s(void 0)}))}}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,s=void 0,s=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===o(s)?s:String(s)),i)}var r,s}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"appendFieldEvents",value:function(e,t){this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]);var n=this.fieldsEvents[e];n&&r.a.each(n,(function(e,n){r()(t).on(e,(function(e){n(t,e)}))}))}},{key:"sanitizeTitle",value:function(e){e=(e=e.replace(/^\s+|\s+$/g,"")).toLowerCase();for(var t="àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;",n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuuncescrzyuudtn------".charAt(n));return e=e.replace(".","-").replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/\//g,"")}},{key:"autoFillKey",value:function(e,t){var n=this;r()(t).add(e).on("focusout",(function(){var i=r()(e).val(),o=r()(t).val();!i.length&&o.length&&r()(e).val(n.sanitizeTitle(o))}))}},{key:"copyToClipboard",value:function(e){var t=navigator.clipboard.writeText(r()(e).val()).then((function(){return!0}),(function(){return!1}));return l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"disableProFieldSelectOptions",value:function(e){var t=r()(e).closest(".cpt-fields-section");if(t&&"manage_cpt_field"===t.data("id")){var n=r()(e).find("select > option");r.a.each(n,(function(e,t){t.text.endsWith(" [PRO only]")&&(t.disabled=!0)}))}}}])&&c(t.prototype,n),i&&c(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();window.cptUtils=new u,wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.checkbox={load:function(e,t){var n=r()(e).find('input[type="checkbox"][required]');r()(n).on("click",(function(t){r()(n).prop("required",!r()(e).find('input[type="checkbox"]:checked').length)}))}},e}));n(4);wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.color={load:function(e,t){var n=r()(e).find(".cpt-color-section:first"),i=r()(n).children("input");r()(i).wpColorPicker({palettes:!0})}},e}));n(5);function d(e){return e[e.length-1]}function h(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function p(e,t){return e?e.split(t):[]}function f(e,t,n){return(void 0===t||e>=t)&&(void 0===n||e<=n)}function g(e,t,n){return e<t?t:e>n?n:e}function m(e,t,n={},i=0,r=""){r+=`<${Object.keys(n).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(r=r(i)),`${e} ${t}="${r}"`},e)}></${e}>`;const o=i+1;return o<t?m(e,t,n,o,r):r}function v(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function y(e){return new Date(e).setHours(0,0,0,0)}function b(){return(new Date).setHours(0,0,0,0)}function w(...e){switch(e.length){case 0:return b();case 1:return y(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function _(e,t){const n=new Date(e);return n.setDate(n.getDate()+t)}function k(e,t){const n=new Date(e),i=n.getMonth()+t;let r=i%12;r<0&&(r+=12);const o=n.setMonth(i);return n.getMonth()!==r?n.setDate(0):o}function D(e,t){const n=new Date(e),i=n.getMonth(),r=n.setFullYear(n.getFullYear()+t);return 1===i&&2===n.getMonth()?n.setDate(0):r}function x(e,t){return(e-t+7)%7}function S(e,t,n=0){const i=new Date(e).getDay();return _(e,x(t,n)-x(i,n))}function A(e,t){return Math.round((e-t)/6048e5)+1}function $(e){const t=S(e,4,1);return A(t,S(new Date(t).setMonth(0,4),4,1))}function C(e,t){const n=S(new Date(e).setMonth(0,1),t,t),i=S(e,t,t),r=A(i,n);if(r<53)return r;return i===S(new Date(e).setDate(32),t,t)?1:r}function E(e){return C(e,0)}function O(e){return C(e,6)}function L(e,t){const n=new Date(e).getFullYear();return Math.floor(n/t)*t}function j(e,t,n){if(1!==t&&2!==t)return e;const i=new Date(e);return 1===t?n?i.setMonth(i.getMonth()+1,0):i.setDate(1):n?i.setFullYear(i.getFullYear()+1,0,0):i.setMonth(0,1),i.setHours(0,0,0,0)}const M=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,T=/[\s!-/:-@[-`{-~年月日]+/;let N={};const F={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,n){const i=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),i=t=>t.toLowerCase().startsWith(e);if(r=n.monthsShort.findIndex(i),r<0&&(r=n.months.findIndex(i)),r<0)return NaN}return i.setMonth(r),i.getMonth()!==function e(t){return t>-1?t%12:e(t+12)}(r)?i.setDate(0):i.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},I={d:e=>e.getDate(),dd:e=>P(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>P(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>P(e.getFullYear(),2).slice(-2),yyyy:e=>P(e.getFullYear(),4)};function P(e,t){return e.toString().padStart(t,"0")}function B(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in N)return N[e];const t=e.split(M),n=e.match(new RegExp(M,"g"));if(0===t.length||!n)throw new Error("Invalid date format.");const i=n.map(e=>I[e]),r=Object.keys(F).reduce((e,t)=>(n.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return N[e]={parser(e,t){const i=e.split(T).reduce((e,t,i)=>{if(t.length>0&&n[i]){const r=n[i][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,n)=>{const r=F[n](e,i[n],t);return isNaN(r)?e:r},b())},formatter:(e,n)=>i.reduce((i,r,o)=>i+`${t[o]}${r(e,n)}`,"")+d(t)}}function R(e,t,n){if(e instanceof Date||"number"==typeof e){const t=y(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return b();if(t&&t.toValue){const i=t.toValue(e,t,n);return isNaN(i)?void 0:y(i)}return B(t).parser(e,n)}}function q(e,t,n){if(isNaN(e)||!e&&0!==e)return"";const i="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(i,t,n):B(t).formatter(i,n)}const H=document.createRange();function V(e){return H.createContextualFragment(e)}function W(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function U(e){return e.getRootNode().activeElement===e}function z(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function Y(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function G(e){e.firstChild&&(e.removeChild(e.firstChild),G(e))}const K=new WeakMap,{addEventListener:Z,removeEventListener:J}=EventTarget.prototype;function Q(e,t){let n=K.get(e);n||(n=[],K.set(e,n)),t.forEach(e=>{Z.call(...e),n.push(e)})}function X(e){let t=K.get(e);t&&(t.forEach(e=>{J.call(...e)}),K.delete(e))}if(!Event.prototype.composedPath){const e=(t,n=[])=>{let i;return n.push(t),t.parentNode?i=t.parentNode:t.host?i=t.host:t.defaultView&&(i=t.defaultView),i?e(i,n):n};Event.prototype.composedPath=function(){return e(this.target)}}function ee(e,t){const n="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return function e(t,n,i){const[r,...o]=t;return n(r)?r:r!==i&&"HTML"!==r.tagName&&0!==o.length?e(o,n,i):void 0}(e.composedPath(),n,e.currentTarget)}var te={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},ne={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:ie,format:re,weekStart:oe}=ne;function se(e,t){return e.length<6&&t>=0&&t<7?h(e,t):e}function ae(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return $;case 2:return E;case 3:return O}}function le(e,t,n){return t.weekStart=e,t.weekEnd=(e+6)%7,4===n&&(t.getWeekNumber=ae(4,e)),e}function ce(e,t,n,i){const r=R(e,t,n);return void 0!==r?r:i}function ue(e,t,n=3){const i=parseInt(e,10);return i>=0&&i<=n?i:t}function de(e,t,n,i){t in e&&(n in e||(e[n]=i?i(e[t]):e[t]),delete e[t])}function he(e,t){const n=Object.assign({},e),i={},r=t.constructor.locales,o=!!t.rangeSideIndex;let{datesDisabled:s,format:a,language:l,locale:c,maxDate:u,maxView:d,minDate:p,pickLevel:f,startView:g,weekNumbers:m,weekStart:v}=t.config||{};if(de(n,"calendarWeeks","weekNumbers",e=>e?1:0),de(n,"clearBtn","clearButton"),de(n,"todayBtn","todayButton"),de(n,"todayBtnMode","todayButtonMode"),n.language){let e;if(n.language!==l&&(r[n.language]?e=n.language:(e=n.language.split("-")[0],r[e]||(e=!1))),delete n.language,e){l=i.language=e;const t=c||r[ie];c=Object.assign({format:re,weekStart:oe},r[ie]),l!==ie&&Object.assign(c,r[l]),i.locale=c,a===t.format&&(a=i.format=c.format),v===t.weekStart&&(v=le(c.weekStart,i,m))}}if(n.format){const e="function"==typeof n.format.toDisplay,t="function"==typeof n.format.toValue,r=M.test(n.format);(e&&t||r)&&(a=i.format=n.format),delete n.format}let y=f;"pickLevel"in n&&(y=ue(n.pickLevel,f,2),delete n.pickLevel),y!==f&&(y>f&&("minDate"in n||(n.minDate=p),"maxDate"in n||(n.maxDate=u)),s&&!n.datesDisabled&&(n.datesDisabled=[]),f=i.pickLevel=y);let b=p,_=u;if("minDate"in n){const e=w(0,0,1);b=null===n.minDate?e:ce(n.minDate,a,c,b),b!==e&&(b=j(b,f,!1)),delete n.minDate}if("maxDate"in n&&(_=null===n.maxDate?void 0:ce(n.maxDate,a,c,_),void 0!==_&&(_=j(_,f,!0)),delete n.maxDate),_<b?(p=i.minDate=_,u=i.maxDate=b):(p!==b&&(p=i.minDate=b),u!==_&&(u=i.maxDate=_)),n.datesDisabled){const e=n.datesDisabled;if("function"==typeof e)i.datesDisabled=null,i.checkDisabled=(t,n)=>e(new Date(t),n,o);else{const t=i.datesDisabled=e.reduce((e,t)=>{const n=R(t,a,c);return void 0!==n?h(e,j(n,f,o)):e},[]);i.checkDisabled=e=>t.includes(e)}delete n.datesDisabled}if("defaultViewDate"in n){const e=R(n.defaultViewDate,a,c);void 0!==e&&(i.defaultViewDate=e),delete n.defaultViewDate}if("weekStart"in n){const e=Number(n.weekStart)%7;isNaN(e)||(v=le(e,i,m)),delete n.weekStart}if(n.daysOfWeekDisabled&&(i.daysOfWeekDisabled=n.daysOfWeekDisabled.reduce(se,[]),delete n.daysOfWeekDisabled),n.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=n.daysOfWeekHighlighted.reduce(se,[]),delete n.daysOfWeekHighlighted),"weekNumbers"in n){let e=n.weekNumbers;if(e){const t="function"==typeof e?(t,n)=>e(new Date(t),n):ae(e=parseInt(e,10),v);t&&(m=i.weekNumbers=e,i.getWeekNumber=t)}else m=i.weekNumbers=0,i.getWeekNumber=null;delete n.weekNumbers}if("maxNumberOfDates"in n){const e=parseInt(n.maxNumberOfDates,10);e>=0&&(i.maxNumberOfDates=e,i.multidate=1!==e),delete n.maxNumberOfDates}n.dateDelimiter&&(i.dateDelimiter=String(n.dateDelimiter),delete n.dateDelimiter);let k=d;"maxView"in n&&(k=ue(n.maxView,d),delete n.maxView),k=f>k?f:k,k!==d&&(d=i.maxView=k);let D=g;if("startView"in n&&(D=ue(n.startView,D),delete n.startView),D<f?D=f:D>d&&(D=d),D!==g&&(i.startView=D),n.prevArrow){const e=V(n.prevArrow);e.childNodes.length>0&&(i.prevArrow=e.childNodes),delete n.prevArrow}if(n.nextArrow){const e=V(n.nextArrow);e.childNodes.length>0&&(i.nextArrow=e.childNodes),delete n.nextArrow}if("disableTouchKeyboard"in n&&(i.disableTouchKeyboard="ontouchstart"in document&&!!n.disableTouchKeyboard,delete n.disableTouchKeyboard),n.orientation){const e=n.orientation.toLowerCase().split(/\s+/g);i.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete n.orientation}if("todayButtonMode"in n){switch(n.todayButtonMode){case 0:case 1:i.todayButtonMode=n.todayButtonMode}delete n.todayButtonMode}return Object.entries(n).forEach(([e,t])=>{void 0!==t&&e in ne&&(i[e]=t)}),i}const pe={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};var fe=v('<div class="datepicker">\n  <div class="datepicker-picker">\n    <div class="datepicker-header">\n      <div class="datepicker-title"></div>\n      <div class="datepicker-controls">\n        <button type="button" class="%buttonClass% prev-button prev-btn"></button>\n        <button type="button" class="%buttonClass% view-switch"></button>\n        <button type="button" class="%buttonClass% next-button next-btn"></button>\n      </div>\n    </div>\n    <div class="datepicker-main"></div>\n    <div class="datepicker-footer">\n      <div class="datepicker-controls">\n        <button type="button" class="%buttonClass% today-button today-btn"></button>\n        <button type="button" class="%buttonClass% clear-button clear-btn"></button>\n      </div>\n    </div>\n  </div>\n</div>'),ge=v(`<div class="days">\n  <div class="days-of-week">${m("span",7,{class:"dow"})}</div>\n  <div class="datepicker-grid">${m("span",42)}</div>\n</div>`),me=v(`<div class="week-numbers calendar-weeks">\n  <div class="days-of-week"><span class="dow"></span></div>\n  <div class="weeks">${m("span",6,{class:"week"})}</div>\n</div>`);class ve{constructor(e,t){Object.assign(this,t,{picker:e,element:V('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,n){this.disabled=[];const i=this.picker;i.setViewSwitchLabel(e),i.setPrevButtonDisabled(t),i.setNextButtonDisabled(n)}setDisabled(e,t){t.add("disabled"),h(this.disabled,e)}performBeforeHook(e,t){let n=this.beforeShow(new Date(t));switch(typeof n){case"boolean":n={enabled:n};break;case"string":n={classes:n}}if(n){const i=e.classList;if(!1===n.enabled&&this.setDisabled(t,i),n.classes){const e=n.classes.split(/\s+/);i.add(...e),e.includes("disabled")&&this.setDisabled(t,i)}n.content&&function(e,t){G(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(V(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,n.content)}}renderCell(e,t,n,i,{selected:r,range:o},s,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=i);const l=e.classList;if(e.className="datepicker-cell "+this.cellClass,n<this.first?l.add("prev"):n>this.last&&l.add("next"),l.add(...a),(s||this.checkDisabled(i,this.id))&&this.setDisabled(i,l),o){const[e,t]=o;n>e&&n<t&&l.add("range"),n===e&&l.add("range-start"),n===t&&l.add("range-end")}r.includes(n)&&l.add("selected"),n===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,i)}refreshCell(e,t,n,[i,r]){const o=e.classList;o.remove("range","range-start","range-end","selected","focused"),t>i&&t<r&&o.add("range"),t===i&&o.add("range-start"),t===r&&o.add("range-end"),n.includes(t)&&o.add("selected"),t===this.focused&&o.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class ye extends ve{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=V(ge).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const n=this.locale=e.locale;this.dayNames=n.daysMin,this.switchLabelFormat=n.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=V(me).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(Y(this.dow),this.weekNumbers&&Y(this.weekNumbers.dow)):(z(this.dow),this.weekNumbers&&z(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const n=(this.weekStart+t)%7;e.textContent=this.dayNames[n],e.className=this.daysOfWeekDisabled.includes(n)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),n=e.getMonth(),i=w(t,n,1),r=S(i,this.weekStart,this.weekStart);this.first=i,this.last=w(t,n+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?b():void 0,this.prepareForRender(q(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=S(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((n,i)=>{const r=_(t,7*i);n.textContent=this.getWeekNumber(r,e),i>3&&n.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const n=_(this.start,t),i=new Date(n),r=i.getDay(),o=[];this.today===n&&o.push("today"),this.daysOfWeekHighlighted.includes(r)&&o.push("highlighted"),this.renderCell(e,i.getDate(),n,n,this,n<this.minDate||n>this.maxDate||this.daysOfWeekDisabled.includes(r),o)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function be(e,t){if(!e||!e[0]||!e[1])return;const[[n,i],[r,o]]=e;return n>t||r<t?void 0:[n===t?i:-1,r===t?o:12]}class we extends ve{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(V(m("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=w(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const n=new Date(t),i=n.getFullYear(),r=n.getMonth();return void 0===e[i]?e[i]=[r]:h(e[i],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,n=this.year===this.minYear,i=this.year===this.maxYear,r=be(this.range,this.year);Array.from(this.grid.children).forEach((o,s)=>{const a=j(new Date(this.year,s,1),1,this.isRangeEnd);this.renderCell(o,this.monthNames[s],s,a,{selected:e,range:r},t||n&&s<this.minMonth||i&&s>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=be(this.range,this.year)||[];Array.from(this.grid.children).forEach((n,i)=>{this.refreshCell(n,i,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class _e extends ve{constructor(e,t){super(e,t)}init(e,t=!0){var n;t&&(this.navStep=10*this.step,this.beforeShowOption="beforeShow"+(n=this.cellClass,[...n].reduce((e,t,n)=>e+(n?t:t.toUpperCase()),"")),this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(V(m("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=L(e.minDate,this.step),this.minDate=w(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=L(e.maxDate,this.step),this.maxDate=w(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=L(e,this.navStep),n=t+9*this.step;this.first=t,this.last=n,this.start=t-this.step,this.focused=L(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>h(e,L(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return L(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const n=this.start+t*this.step,i=j(new Date(n,0,1),2,this.isRangeEnd);e.dataset.year=n,this.renderCell(e,n,n,i,this,n<this.minYear||n>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function ke(e,t){const n={date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e};e.element.dispatchEvent(new CustomEvent(t,{detail:n}))}function De(e,t){const{config:n,picker:i}=e,{currentView:r,viewDate:o}=i;let s;switch(r.id){case 0:s=k(o,t);break;case 1:s=D(o,t);break;default:s=D(o,t*r.navStep)}s=g(s,n.minDate,n.maxDate),i.changeFocus(s).render()}function xe(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Se(e){e.setDate({clear:!0})}function Ae(e){const t=b();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function $e(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},n=e.element;U(n)?n.addEventListener("blur",t,{once:!0}):t()}function Ce(e,t){const n=e.picker,i=new Date(n.viewDate),r=n.currentView.id,o=1===r?k(i,t-i.getMonth()):D(i,t-i.getFullYear());n.changeFocus(o).changeView(r-1).render()}function Ee(e){xe(e)}function Oe(e){De(e,-1)}function Le(e){De(e,1)}function je(e,t){const n=ee(t,".datepicker-cell");if(!n||n.classList.contains("disabled"))return;const{id:i,isMinView:r}=e.picker.currentView,o=n.dataset;r?e.setDate(Number(o.date)):Ce(e,Number(1===i?o.month:o.year))}function Me(e){e.preventDefault()}const Te=["left","top","right","bottom"].reduce((e,t)=>(e[t]="datepicker-orient-"+t,e),{}),Ne=e=>e?e+"px":e;function Fe(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,Y(e.controls.title)):(e.controls.title.textContent="",z(e.controls.title))),t.prevArrow){const n=e.controls.prevButton;G(n),t.prevArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const n=e.controls.nextButton;G(n),t.nextArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?Y(e.controls.todayButton):z(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:n}=e.datepicker.config;e.controls.todayButton.disabled=!f(b(),t,n)}"clearButton"in t&&(t.clearButton?Y(e.controls.clearButton):z(e.controls.clearButton))}function Ie(e){const{dates:t,config:n,rangeSideIndex:i}=e;return g(t.length>0?d(t):j(n.defaultViewDate,n.pickLevel,i),n.minDate,n.maxDate)}function Pe(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:n,year:i,first:r,last:o}=e.currentView,s=new Date(t).getFullYear();switch(n){case 0:return t<r||t>o;case 1:return s!==i;default:return s<r||s>o}}function Be(e){return window.getComputedStyle(e).direction}class Re{constructor(e){const{config:t,inputField:n}=this.datepicker=e,i=fe.replace(/%buttonClass%/g,t.buttonClass),r=this.element=V(i).firstChild,[o,s,a]=r.firstChild.children,l=o.firstElementChild,[c,u,d]=o.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:u,nextButton:d,todayButton:h,clearButton:p};this.main=s,this.controls=f;const g=n?"dropdown":"inline";r.classList.add("datepicker-"+g),Fe(this,t),this.viewDate=Ie(e),Q(e,[[r,"mousedown",Me],[s,"click",je.bind(null,e)],[f.viewSwitch,"click",Ee.bind(null,e)],[f.prevButton,"click",Oe.bind(null,e)],[f.nextButton,"click",Le.bind(null,e)],[f.todayButton,"click",Ae.bind(null,e)],[f.clearButton,"click",Se.bind(null,e)]]),this.views=[new ye(this),new we(this),new _e(this,{id:2,name:"years",cellClass:"year",step:1}),new _e(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):n.after(this.element)}setOptions(e){Fe(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,n=e.inputField;if(n){const i=Be(n);i!==Be(W(t))?t.dir=i:t.dir&&t.removeAttribute("dir"),t.style.visibility="hidden",t.classList.add("active"),this.place(),t.style.visibility="",e.config.disableTouchKeyboard&&n.blur()}else t.classList.add("active");this.active=!0,ke(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,ke(this.datepicker,"hide"))}place(){const{classList:e,offsetParent:t,style:n}=this.element,{config:i,inputField:r}=this.datepicker,{width:o,height:s}=this.element.getBoundingClientRect(),{left:a,top:l,right:c,bottom:u,width:d,height:h}=r.getBoundingClientRect();let{x:p,y:f}=i.orientation,g=a,m=l;if(t!==document.body&&t){const e=t.getBoundingClientRect();g-=e.left-t.scrollLeft,m-=e.top-t.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=function e(t){const n=W(t);if(n!==document.body&&n)return"visible"!==window.getComputedStyle(n).overflow?n:e(n)}(r);let y=0,b=0,{clientWidth:w,clientHeight:_}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(b=e.top),e.left>0&&(y=e.left),e.right<w&&(w=e.right),e.bottom<_&&(_=e.bottom)}let k=0;"auto"===p&&(a<y?(p="left",k=y-a):a+o>w?(p="right",w<c&&(k=w-c)):p="rtl"===Be(r)?c-o<y?"left":"right":"left"),"right"===p&&(g+=d-o),g+=k,"auto"===f&&(f=l-s>b&&u+s>_?"top":"bottom"),"top"===f?m-=s:m+=h,e.remove(...Object.values(Te)),e.add(Te[p],Te[f]),n.left=Ne(g),n.top=Ne(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Pe(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e){const t=void 0===e?Ie(this.datepicker):e;return this._renderMethod=Pe(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:n,_oldView:i}=this,r=new Date(this._oldViewDate),o=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[o](),i&&(this.main.replaceChild(t.element,i.element),ke(n,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&ke(n,"changeYear"),e.getMonth()!==r.getMonth()&&ke(n,"changeMonth")}}}function qe(e,t,n){const i=e.picker,r=i.currentView,o=r.step||1;let s,a=i.viewDate;switch(r.id){case 0:a=_(a,n?7*t:t),s=_;break;case 1:a=k(a,n?4*t:t),s=k;break;default:a=D(a,t*(n?4:1)*o),s=D}a=function e(t,n,i,r,o,s){if(f(t,o,s)){if(r(t)){return e(n(t,i),n,i,r,o,s)}return t}}(a,s,t<0?-o:o,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&i.changeFocus(a).render()}function He(e,t){const{config:n,picker:i,editMode:r}=e,o=i.active,{key:s,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,u=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===s)return void $e(e);if("Enter"===s){if(o)if(r)e.exitEditMode({update:!0,autohide:n.autohide});else{const t=i.currentView;t.isMinView?e.setDate(i.viewDate):(i.changeView(t.id-1).render(),u())}else e.update();return}const d=n.shortcutKeys,h={key:s,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(d).find(e=>{const t=d[e];return!Object.keys(t).find(e=>t[e]!==h[e])});if(p){let t;if("toggle"===p?t=p:r?"exitEditMode"===p&&(t=p):o?"hide"===p?t=p:"prevButton"===p?t=[De,[e,-1]]:"nextButton"===p?t=[De,[e,1]]:"viewSwitch"===p?t=[xe,[e]]:n.clearButton&&"clearButton"===p?t=[Se,[e]]:n.todayButton&&"todayButton"===p&&(t=[Ae,[e]]):"show"===p&&(t=p),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void u()}if(!o||r)return;const f=(n,i)=>{l||c||a?e.enterEditMode():(qe(e,n,i),t.preventDefault())};"ArrowLeft"===s?f(-1,!1):"ArrowRight"===s?f(1,!1):"ArrowUp"===s?f(-1,!0):"ArrowDown"===s?f(1,!0):("Backspace"===s||"Delete"===s||s&&1===s.length&&!c)&&e.enterEditMode()}function Ve(e){e.config.showOnFocus&&!e._showing&&e.show()}function We(e,t){const n=t.target;(e.picker.active||e.config.showOnClick)&&(n._active=U(n),n._clicking=setTimeout(()=>{delete n._active,delete n._clicking},2e3))}function Ue(e,t){const n=t.target;n._clicking&&(clearTimeout(n._clicking),delete n._clicking,n._active&&e.enterEditMode(),delete n._active,e.config.showOnClick&&e.show())}function ze(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function Ye(e,t){const{element:n,picker:i}=e;if(!i.active&&!U(n))return;const r=i.element;ee(t,e=>e===n||e===r)||$e(e)}function Ge(e,t){return e.map(e=>q(e,t.format,t.locale)).join(t.dateDelimiter)}function Ke(e,t,n=!1){if(0===t.length)return n?[]:void 0;const{config:i,dates:r,rangeSideIndex:o}=e,{pickLevel:s,maxNumberOfDates:a}=i;let l=t.reduce((e,t)=>{let n=R(t,i.format,i.locale);return void 0===n||(n=j(n,s,o),!f(n,i.minDate,i.maxDate)||e.includes(n)||i.checkDisabled(n,s)||!(s>0)&&i.daysOfWeekDisabled.includes(new Date(n).getDay())||e.push(n)),e},[]);return 0!==l.length?(i.multidate&&!n&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function Ze(e,t=3,n=!0,i){const{config:r,picker:o,inputField:s}=e;if(2&t){const e=o.active?r.pickLevel:r.startView;o.update(i).changeView(e).render(n)}1&t&&s&&(s.value=Ge(e.dates,r))}function Je(e,t,n){const i=e.config;let{clear:r,render:o,autohide:s,revert:a,forceRefresh:l,viewDate:c}=n;void 0===o&&(o=!0),o?void 0===s&&(s=i.autohide):s=l=!1,c=R(c,i.format,i.locale);const u=Ke(e,t,r);(u||a)&&(u&&u.toString()!==e.dates.toString()?(e.dates=u,Ze(e,o?3:1,!0,c),ke(e,"changeDate")):Ze(e,l?3:1,!0,c),s&&e.hide())}function Qe(e,t){return t?n=>q(n,t,e.config.locale):e=>new Date(e)}class Xe{constructor(e,t={},n){e.datepicker=this,this.element=e,this.dates=[];const i=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:b(),maxDate:void 0,minDate:void 0},he(ne,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(i.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):i.container=e,n){const e=n.inputs.indexOf(r),t=n.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=n,this.rangeSideIndex=e}this._options=t,Object.assign(i,he(t,this)),i.shortcutKeys=function(e){return Object.keys(pe).reduce((t,n)=>{const i=void 0===e[n]?pe[n]:e[n],r=i&&i.key;if(!r||"string"!=typeof r)return t;const o={key:r,ctrlOrMetaKey:!!(i.ctrlOrMetaKey||i.ctrlKey||i.metaKey)};return r.length>1&&(o.altKey=!!i.altKey,o.shiftKey=!!i.shiftKey),t[n]=o,t},{})}(t.shortcutKeys||{});const o=p(e.value||e.dataset.date,i.dateDelimiter);delete e.dataset.date;const s=Ke(this,o);s&&s.length>0&&(this.dates=s),r&&(r.value=Ge(this.dates,i));const a=this.picker=new Re(this),l=[e,"keydown",He.bind(null,this)];r?Q(this,[l,[r,"focus",Ve.bind(null,this)],[r,"mousedown",We.bind(null,this)],[r,"click",Ue.bind(null,this)],[r,"paste",ze.bind(null,this)],[document,"mousedown",Ye.bind(null,this)],[window,"resize",a.place.bind(a)]]):(Q(this,[l]),this.show())}static formatDate(e,t,n){return q(e,t,n&&te[n]||te.en)}static parseDate(e,t,n){return R(e,t,n&&te[n]||te.en)}static get locales(){return te}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=he(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),Ze(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;U(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),X(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e){const t=Qe(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],n={},i=d(e);!i||"object"!=typeof i||Array.isArray(i)||i instanceof Date||Object.assign(n,t.pop());Je(this,Array.isArray(t[0])?t[0]:t,n)}update(e){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});Je(this,p(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e){return Qe(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:n,picker:i,active:r,rangeSideIndex:o}=this,s=n.pickLevel,a=R(e,n.format,n.locale);void 0!==a&&(i.changeFocus(j(a,s,o)),r&&t&&i.changeView(s),i.render())}refresh(e,t=!1){let n;e&&"string"!=typeof e&&(t=e,e=void 0),n="picker"===e?2:"input"===e?1:3,Ze(this,n,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}function et(e){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==et(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===et(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.date={load:function(e,t){var n=r()(e).find(".cpt-date-section:first"),i=r()(n).children("input"),o="no"!==r()(i).data("max")&&r()(i).data("max"),s="no"!==r()(i).data("min")&&r()(i).data("min");new Xe(i[0],{autohide:!0,clearBtn:!0,maxDate:o,minDate:s,format:"dd/mm/yyyy"})}},e}));var nt=wp.i18n,it=nt.__;nt._x,nt._n,nt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.file={load:function(e,t){new rt(e)}},e}));var rt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fileSection=r()(t).find(".cpt-file-section:first"),this.fileTypes=r()(this.fileSection).data("type"),this.fileInput=r()(this.fileSection).find("input"),this.filePreview=r()(this.fileSection).find("img"),this.fileActions=r()(this.fileSection).find(".cpt-file-actions"),this.fileName=r()(this.fileSection).find(".file-name"),this.addButton=r()(this.fileSection).find(".cpt-file-upload"),this.removeButton=r()(this.fileSection).find(".cpt-file-remove"),this.listenRemoveEvent(),this.listenAddEvent()}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(){var e=this;r()(this.addButton).on("click",(function(t){t.preventDefault();var n=wp.media({title:it("Add file","custom-post-types"),frame:"select",library:wp.media.query({type:e.fileTypes,uploadedTo:wp.media.view.settings.post.id}),button:{text:it("Choose file","custom-post-types")},multiple:!1}).on("select",(function(){var t=n.state().get("selection").first().toJSON(),i=!!(t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url)&&t.sizes.thumbnail.url;i&&(r()(e.filePreview).attr("src",i),r()(e.filePreview).show());var o=t.mime;o.startsWith("image")&&(o="image"),o.startsWith("audio")&&(o="audio"),o.startsWith("video")&&(o="video"),"-1"!=r.a.inArray(o,e.fileTypes)?(r()(e.fileName).html(t.url.split("/").reverse()[0]),r()(e.fileActions).attr("title",t.url.split("/").reverse()[0]),r()(e.fileInput).val(t.id),r()(e.removeButton).prop("disabled",!1)):e.resetField()})).open()}))}},{key:"listenRemoveEvent",value:function(){var e=this;r()(this.removeButton).on("click",(function(t){t.preventDefault(),e.resetField()}))}},{key:"resetField",value:function(){r()(this.fileName).html(""),r()(this.fileInput).val(""),r()(this.filePreview).removeAttr("src"),r()(this.filePreview).hide(),r()(this.removeButton).prop("disabled",!0),r()(this.fileActions).attr("title",it("Choose","custom-post-types"))}}])&&tt(t.prototype,n),i&&tt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();n(1),n(2);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function st(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ot(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ot(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ot(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.post_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-post_rel-options",nonce:cpt.ajax_nonce,search:e.term,post_type:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e}));var at=wp.i18n;at.__,at._x,at._n,at._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.repeater={load:function(e,t){new lt(e)}},e}));var lt=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.repeaterSection=r()(t).find(".cpt-repeater-section:first"),this.parent=r()(this.repeaterSection).data("parent"),this.fields=r()(this.repeaterSection).data("fields"),this.initSortable();var i=r()(this.repeaterSection).parent().children(".cpt-repeater-add:first");i.length>0&&this.listenAddEvent(i);var o=r()(this.repeaterSection).find(".cpt-repeater-group");r.a.each(o,(function(e,t){n.initFieldGroup(t)}))}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(e){var t=this;r()(e).on("click",(function(n){n.preventDefault(),r()(e).prop("disabled",!0);var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(t.repeaterSection).append(i);var o=r()(t.repeaterSection).children(".cpt-repeater-group").length,s=[];s.push({name:"action",value:"cpt-get-repeater-group"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"fields",value:JSON.stringify(t.fields)}),s.push({name:"parent",value:t.parent+"["+o+"]"}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(n){if(n.success){r()(e).prop("disabled",!1),r()(i).remove();var o=r()(n.data);r()(t.repeaterSection).append(o),t.initFieldGroup(o)}else r()(e).prop("disabled",!1),r()(i).remove(),console.log("Error",n)}})}))}},{key:"initSortable",value:function(){var e=r()(this.repeaterSection).children(".cpt-repeater-group").children(".cpt-repeater-buttons").find(".move");r()(e).on("click",(function(e){e.preventDefault()})),r()(this.repeaterSection).sortable({handle:".move",cancel:"",cursor:"grab",axis:"y",delay:150,dropOnEmpty:!1,opacity:.5,revert:!0})}},{key:"initFieldGroup",value:function(e){var t=r()(e).find(".cpt-repeater-fields:first").children(".cpt-field"),n=r()(e).find(".cpt-repeater-fields:first .cpt-repeater-extra").children(".cpt-field");r.a.each(r.a.merge(t,n),(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")})),this.listenRemoveEvent(e),this.autofillKeyInput(e),this.listenSwitchFieldTypeEvent(e)}},{key:"listenRemoveEvent",value:function(e){var t=r()(e).find(".remove:first"),n=r()(t).closest(".cpt-repeater-group").children(".cpt-repeater-remove");r()(t).on("click",(function(e){e.preventDefault(),r()(n).addClass("active")})),r()(n).find(".abort:first").on("click",(function(e){e.preventDefault(),r()(n).removeClass("active")})),r()(n).find(".confirm:first").on("click",(function(t){t.preventDefault(),r()(e).remove()}))}},{key:"autofillKeyInput",value:function(e){var t=r()(e).find('input[id$="-label"]:first'),n=r()(e).find('input[id$="-key"]:first');window.cptUtils.autoFillKey(n,t)}},{key:"listenSwitchFieldTypeEvent",value:function(e){var t=r()(e).find(".cpt-repeater-field-type:first").find("select"),n=r()(e).find(".cpt-repeater-extra:first");r()(t).on("select2:select",(function(e){r()(n).empty();var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(n).append(i);var o=!!r()(t).val().length&&r()(t).val();if(o){var s=r()(t).attr("name").replace("meta-fields","").replace("[type]",""),a=[];a.push({name:"action",value:"cpt-get-repeater-extra-fields"}),a.push({name:"nonce",value:cpt.ajax_nonce}),a.push({name:"field-type",value:o}),a.push({name:"parent",value:s}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:a,success:function(e){if(e.success){r()(i).remove();var t=r()(e.data);r()(n).append(t),r()(n).children(".cpt-field"),r.a.each(t,(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")}))}else r()(i).remove(),console.log("Error",e)}})}else r()(i).remove()}))}}])&&st(t.prototype,n),i&&st(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ut(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ht(i.key),i)}}function dt(e,t,n){return(t=ht(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ht(e){var t=function(e,t){if("object"!==ct(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ct(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ct(t)?t:String(t)}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.select={load:function(e,t){window.cptUtils.disableProFieldSelectOptions(e);var n=r()(e).find("select:first"),i={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};r()(n).select2(i)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tax_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-tax_rel-options",nonce:cpt.ajax_nonce,search:e.term,taxonomy:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.text={load:function(e,t){}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.time={load:function(e,t){for(var n=r()(e).find(".cpt-time-section:first"),i=r()(n).children("select"),o=r()(i).data("value")?r()(i).data("value"):"",s="no"!==r()(i).data("max")&&r()(i).data("max"),a="no"!==r()(i).data("min")&&r()(i).data("min"),l=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"00:00",i=0;if(!n)return i;var r=!!n.split(":")&&n.split(":"),o=null!==(e=r[0])&&void 0!==e&&e,s=null!==(t=r[1])&&void 0!==t&&t,a=Number(o+s);return Number.isInteger(a)?a:i},c=l(s),u=l(a),d=0;d<=23;d++){d=d<10?"0"+d:d;for(var h=0;h<=59;h++){var p=d+":"+(h=h<10?"0"+h:h);(u>0&&l(p)<u||c>0&&l(p)>c)&&c>u||r()(i).append(r()('<option value="'+p+'"'+(o==p?' selected="selected"':"")+">"+p+"</option>"))}}var f={placeholder:r()(i).attr("placeholder")?r()(selectEl).attr("placeholder"):" ... ",allowClear:!0,multiple:!1};r()(i).select2(f)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tinymce={load:function(e,t){new pt(e)}},e}));var pt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),dt(this,"editorEl",void 0),dt(this,"editorId",void 0),dt(this,"editorForm",void 0),dt(this,"defaultArgs",{tinymce:{wpautop:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,spellchecker,fullscreen,wp_adv,listbuttons",toolbar2:"styleselect,strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",textarea_rows:20,wp_autoresize_on:!1,autoresize_min_height:50},quicktags:{buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,more,close"},mediaButtons:!0}),this.editorEl=r()(t).find("textarea:first"),this.editorId=r()(this.editorEl).attr("id"),this.defaultArgs.tinymce.wp_autoresize_on=r()(this.editorEl).is("[autoresize]"),this.editorForm=r()(t).closest("form"),this.startEditor()}var t,n,i;return t=e,(n=[{key:"startEditor",value:function(){var e=this,t=!1,n=setInterval((function(){!r()("#post-title-0")&&r()("body").hasClass("block-editor-page")||(t=!0,e.removeEditor(),e.initializeEditor(),e.listenSubmitEvent(),e.listenSortableEvent()),t&&clearInterval(n)}),500)}},{key:"initializeEditor",value:function(){wp.oldEditor.initialize(this.editorId,this.defaultArgs)}},{key:"removeEditor",value:function(){wp.oldEditor.remove(this.editorId)}},{key:"listenSubmitEvent",value:function(){var e=tinyMCE.editors[this.editorId];r()(this.editorForm).on("submit",(function(t){e.save()})),e.on("blur",(function(t){e.save()})),r()(document).ajaxComplete((function(t,n,i){i.data&&i.data.match(/action=add-tag/)&&(e.setContent(""),e.save())}))}},{key:"listenSortableEvent",value:function(){var e=this,t=r()(this.editorEl).closest(".ui-sortable");r()(t).on("sortstart",(function(){e.removeEditor()})),r()(t).on("sortstop",(function(){e.initializeEditor()}))}}])&&ut(t.prototype,n),i&&ut(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ft(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ft(o)?o:String(o)),i)}var r,o}var mt=wp.i18n,vt=mt.__;mt._x,mt._n,mt._nx;new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.body=r()("body"),this.window=r()(window),this.utils=new u,this.loadFields(),this.loadUiFeatures()}var t,n,i;return t=e,(n=[{key:"loadUiFeatures",value:function(){var e=this;this.body.on("click",".cpt-field-wrap.advanced-field-btn .button",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-fields-section"),i=r()(n).find(".cpt-field-wrap.advanced-field");r()(t).hasClass("button-secondary")?(r()(i).removeClass("active"),r()(t).removeClass("button-secondary").addClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-insert"),r()(t).find(".label").html(vt("Advanced view","custom-post-types"))):(r()(i).addClass("active"),r()(t).addClass("button-secondary").removeClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-remove"),r()(t).find(".label").html(vt("Simple view","custom-post-types")))})),this.window.on("load",(function(){if(e.body.hasClass("block-editor-page")){var t=r()('.cpt-fields-section *[id^="meta-fields-"][required]');t.length<=0||setInterval((function(){!function(e){var t=!0;r.a.each(e,(function(e,n){var i=r()(n).val().length>0;t=!!t&&i}));var n=r()(".edit-post-header__settings button.editor-post-publish-button__button");t?(r()(n).removeAttr("disabled"),r()(n).attr("aria-disabled","false")):(r()(n).attr("disabled","disabled"),r()(n).attr("aria-disabled","true"))}(t)}),200)}})),this.body.on("click",".cpt-notice.is-dismissible a.cpt-dismiss-notice",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-notice").find("button.notice-dismiss"),i=r()(t).data("notice"),o=r()(t).data("duration"),s=[];s.push({name:"action",value:"cpt-dismiss-notice"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"key",value:i}),s.push({name:"duration",value:o}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?n.click():console.log("Error",e)}})})),this.body.on("click",".cpt-notice pre.error-code > a",(function(e){e.preventDefault();var t=e.currentTarget;r()(t).closest(".error-code").find("code").addClass("show"),r()(t).remove()}));var t=r()('div[data-id="manage_cpt"].cpt-fields-section, div[data-id="manage_cpt_tax"].cpt-fields-section');r.a.each(t,(function(t,n){var i=r()(n).find('input[id$="-plural"]:first'),o=r()(n).find('input[id$="-id"]:first');e.utils.autoFillKey(o,i)}))}},{key:"loadFields",value:function(){var e=this;this.$fieldGroups=r()(".cpt-fields-section"),this.$fieldGroups&&(this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]),r.a.each(this.$fieldGroups,(function(t,n){var i=r()(n).children(".cpt-field");i&&r.a.each(i,(function(t,n){var i=r()(n).data("field-type");e.utils.appendFieldEvents(i,n),r()(n).trigger("load")}))})))}}])&&gt(t.prototype,n),i&&gt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}())}]);
  • custom-post-types/trunk/custom-post-types.php

    r2954735 r2955028  
    88Text Domain: custom-post-types
    99Domain Path: /languages/
    10 Version: 4.0.9
     10Version: 4.0.10
    1111*/
    1212
  • custom-post-types/trunk/includes/classes/Core.php

    r2954735 r2955028  
    363363                wp_enqueue_media();
    364364                wp_enqueue_editor();
    365                 wp_enqueue_script(Utils::getInfo('options_prefix'), Utils::getInfo('url') . 'assets/js/backend.js', ['jquery', 'wp-i18n', 'wp-util', 'wp-hooks', 'wp-editor'], null, true);
     365                wp_enqueue_style( 'wp-color-picker' );
     366                wp_enqueue_script(Utils::getInfo('options_prefix'), Utils::getInfo('url') . 'assets/js/backend.js', ['jquery', 'wp-i18n', 'wp-util', 'wp-hooks', 'wp-editor', 'wp-color-picker'], null, true);
    366367                wp_localize_script(Utils::getInfo('options_prefix'), 'cpt', Utils::getJsVariables());
    367368                wp_set_script_translations(Utils::getInfo('options_prefix'), 'custom-post-types');
  • custom-post-types/trunk/includes/classes/FieldGroups.php

    r2954735 r2955028  
    440440
    441441    /**
     442     * @param $config
     443     * @return void
     444     */
     445    private function initMediaFields($config = [])
     446    {
     447        $this->initRestFields('attachment', $config, function($key, $id){
     448            return $this->getMediaField($key, $id);
     449        });
     450
     451        add_action('add_meta_boxes', function ($posttype) use ($config) {
     452            if ($posttype !== 'attachment') {
     453                return;
     454            }
     455            add_meta_box(
     456                $config['id'],
     457                $config['label'],
     458                function ($post) use ($config) {
     459                    echo $this->getFieldsSection($config, function ($key) use ($post) {
     460                        return !empty($post->ID) ? get_post_meta($post->ID, $key, true) : null;
     461                    });
     462                },
     463                'attachment',
     464                $config['position']
     465            );
     466        });
     467        add_action('edit_attachment', function ($post_id) use ($config) {
     468            $this->saveMeta($config['fields'], function ($key, $value) use ($post_id) {
     469                $value = $this->getSanitizedValue('attachment', $key, $value);
     470                return update_post_meta($post_id, $key, $value);
     471            });
     472        });
     473    }
     474
     475    /**
     476     * @param $config
     477     * @return void
     478     */
     479    private function initCommentFields($config = [])
     480    {
     481        $this->initRestFields('comment', $config, function($key, $id){
     482            return $this->geCommentField($key, $id);
     483        });
     484
     485        add_action('add_meta_boxes', function ($posttype) use ($config) {
     486            if ($posttype !== 'comment') {
     487                return;
     488            }
     489            add_meta_box(
     490                $config['id'],
     491                $config['label'],
     492                function ($comment) use ($config) {
     493                    echo $this->getFieldsSection($config, function ($key) use ($comment) {
     494                        return !empty($comment->comment_ID) ? get_comment_meta($comment->comment_ID, $key, true) : null;
     495                    });
     496                },
     497                'comment',
     498                $config['position']
     499            );
     500        });
     501        add_action('edit_comment', function ($comment_id) use ($config) {
     502            $this->saveMeta($config['fields'], function ($key, $value) use ($comment_id) {
     503                $value = $this->getSanitizedValue('comment', $key, $value);
     504                return update_comment_meta($comment_id, $key, $value);
     505            });
     506        });
     507    }
     508
     509    /**
    442510     * @param $referenceId
    443511     * @param $key
     
    530598                            $this->initUserFields($fieldGroup);
    531599                        }
     600                        if($id == 'media'){
     601                            $this->screensWithFields[] = 'attachment';
     602                            $this->initMediaFields($fieldGroup);
     603                        }
     604                        if($id == 'comments'){
     605                            $this->screensWithFields[] = 'comment';
     606                            $this->initCommentFields($fieldGroup);
     607                        }
    532608                        break;
    533609                }
     
    17281804        $type = isset($taxonomy_fields[$key]['type']) ? $taxonomy_fields[$key]['type'] : $key;
    17291805        $output = $this->applyFieldGetFilters($value, $key, $type, $term->taxonomy, $term_id);
    1730         return is_array($output) ? (current_user_can('edit_posts') ? '<pre>' . print_r($output, true) . '</pre>' : '') : $output;
     1806        return is_array($output) && !Utils::isRest() ? (current_user_can('edit_posts') ? '<pre>' . print_r($output, true) . '</pre>' : '') : $output;
    17311807    }
    17321808
     
    17621838        $type = isset($users_fields[$key]['type']) ? $users_fields[$key]['type'] : $key;
    17631839        $output = $this->applyFieldGetFilters($value, $key, $type, 'user', $user_id);
    1764         return is_array($output) ? (current_user_can('edit_posts') ? '<pre>' . print_r($output, true) . '</pre>' : '') : $output;
     1840        return is_array($output) && !Utils::isRest() ? (current_user_can('edit_posts') ? '<pre>' . print_r($output, true) . '</pre>' : '') : $output;
     1841    }
     1842
     1843    /**
     1844     * @param $key
     1845     * @param $attachment_id
     1846     * @return string
     1847     */
     1848    public function getMediaField($key, $attachment_id = false){
     1849        if (!$attachment_id) {
     1850            return '';
     1851        }
     1852        $value = get_post_meta($attachment_id, $key, true);
     1853        $attachments_fields = Utils::getFieldsByExtra('attachment');
     1854        $type = isset($attachments_fields[$key]['type']) ? $attachments_fields[$key]['type'] : $key;
     1855        $output = $this->applyFieldGetFilters($value, $key, $type, 'attachment', $attachment_id);
     1856        return is_array($output) && !Utils::isRest() ? (current_user_can('edit_posts') ? '<pre>' . print_r($output, true) . '</pre>' : '') : $output;
     1857    }
     1858
     1859    /**
     1860     * @param $key
     1861     * @param $comment_id
     1862     * @return string
     1863     */
     1864    public function geCommentField($key, $comment_id = false){
     1865        if (!$comment_id) {
     1866            return '';
     1867        }
     1868        $value = get_comment_meta($comment_id, $key, true);
     1869        $comments_fields = Utils::getFieldsByExtra('comment');
     1870        $type = isset($comments_fields[$key]['type']) ? $comments_fields[$key]['type'] : $key;
     1871        $output = $this->applyFieldGetFilters($value, $key, $type, 'comment', $comment_id);
     1872        return is_array($output) && !Utils::isRest() ? (current_user_can('edit_posts') ? '<pre>' . print_r($output, true) . '</pre>' : '') : $output;
    17651873    }
    17661874
  • custom-post-types/trunk/includes/classes/Utils.php

    r2954735 r2955028  
    187187
    188188        $options['-- ' . __('Extra', 'custom-post-types') . ' --'] = [
    189             'extra/users' => __('Users'),
     189            'extra/users' => __('Users', 'custom-post-types'),
     190            'extra/media' => __('Media', 'custom-post-types'),
     191            'extra/comments' => __('Comments', 'custom-post-types'),
    190192        ];
    191193
     
    517519
    518520    /**
     521     * @return string[]
     522     */
     523    public static function getTaxonomiesBlacklist(){
     524        $registered = array_keys(get_taxonomies());
     525        return $registered;
     526    }
     527
     528    /**
     529     * @return string[]
     530     */
     531    public static function getAdminPagesBlacklist(){
     532        global $menu, $submenu;
     533        $registered = [
     534            'custom-post-types',
     535            'custom-post-types-pro',
     536        ];
     537        foreach ($menu as $registeredMenu) {
     538            if(
     539                empty($registeredMenu[2]) || // error
     540                strpos($registeredMenu[2], '.php') !== false || // core page
     541                (!empty($registeredMenu[4]) && $registeredMenu[4] == 'wp-menu-separator') // menu separator
     542            ){
     543                continue;
     544            }
     545            $registered[] = $registeredMenu[2];
     546        }
     547        foreach ($submenu as $registeredSubmenu) {
     548            foreach ($registeredSubmenu as $singleMenu) {
     549                if(
     550                    empty($singleMenu[2]) || // error
     551                    strpos($singleMenu[2], '.php') !== false // core page
     552                ){
     553                    continue;
     554                }
     555                $registered[] = $singleMenu[2];
     556            }
     557        }
     558        return $registered;
     559    }
     560
     561    /**
    519562     * @return array
    520563     */
    521564    public static function getUiPostTypesArgs() {
    522565        $args = [];
    523        
     566
    524567        $default_args = [
    525568            'public' => false,
     
    773816                                        );
    774817                                    }
     818                                    if ($content == 'media') {
     819                                        $output[] = sprintf(
     820                                            '<a href="%s" title="%s">%s</a>',
     821                                            admin_url('upload.php'),
     822                                            __('View', 'custom-post-types'),
     823                                            __('Media')
     824                                        );
     825                                    }
     826                                    if ($content == 'comments') {
     827                                        $output[] = sprintf(
     828                                            '<a href="%s" title="%s">%s</a>',
     829                                            admin_url('edit-comments.php'),
     830                                            __('View', 'custom-post-types'),
     831                                            __('Comments')
     832                                        );
     833                                    }
    775834                                    break;
    776835                                case 'options':
     
    817876        return $args;
    818877    }
    819 
    820     /**
    821      * @return string[]
    822      */
    823     public static function getTaxonomiesBlacklist(){
    824         $registered = array_keys(get_taxonomies());
    825         return $registered;
    826     }
    827 
    828     /**
    829      * @return string[]
    830      */
    831     public static function getAdminPagesBlacklist(){
    832         global $menu, $submenu;
    833         $registered = [
    834             'custom-post-types',
    835             'custom-post-types-pro',
    836         ];
    837         foreach ($menu as $registeredMenu) {
    838             if(
    839                 empty($registeredMenu[2]) || // error
    840                 strpos($registeredMenu[2], '.php') !== false || // core page
    841                 (!empty($registeredMenu[4]) && $registeredMenu[4] == 'wp-menu-separator') // menu separator
    842             ){
    843                 continue;
    844             }
    845             $registered[] = $registeredMenu[2];
    846         }
    847         foreach ($submenu as $registeredSubmenu) {
    848             foreach ($registeredSubmenu as $singleMenu) {
    849                 if(
    850                     empty($singleMenu[2]) || // error
    851                     strpos($singleMenu[2], '.php') !== false // core page
    852                 ){
    853                     continue;
    854                 }
    855                 $registered[] = $singleMenu[2];
    856             }
    857         }
    858         return $registered;
    859     }
    860878}
  • custom-post-types/trunk/includes/fields/color.php

    r2944690 r2955028  
    88        'templateCallback' => function ($name, $id, $config) {
    99            return sprintf(
    10                 '<div class="cpt-color-section"><div class="preview"></div><input type="text" name="%s" id="%s" value="%s" autocomplete="off" aria-autocomplete="none"%s%s></div>',
     10                '<div class="cpt-color-section"><input type="text" name="%s" id="%s" value="%s" autocomplete="off" aria-autocomplete="none"%s%s></div>',
    1111                $name,
    1212                $id,
    1313                $config['value'],
    14                 !empty($config['extra']['alpha']) && $config['extra']['alpha'] == 'true' ? ' alpha' : '',
     14                !empty($config['extra']['alpha']) && $config['extra']['alpha'] == 'true' ? ' data-alpha-enabled="true" data-alpha-color-type="hex"' : '',
    1515                !empty($config['required']) ? ' required' : ''
    1616            );
  • custom-post-types/trunk/readme.txt

    r2954735 r2955028  
    55Requires at least: 4.0
    66Tested up to: 6.3
    7 Stable tag: 4.0.9
     7Stable tag: 4.0.10
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    206206== Changelog ==
    207207
     208= 4.0.10 - 2023-08-17 =
     209* Color picker native instead vanilla;
     210* Introducing fields for Media and Comment;
     211* Improve rest api fields for: terms, users, media, comments;
     212
    208213= 4.0.9 - 2023-08-16 =
    209214* Introducing of blacklist for prevent the override of core contents;
Note: See TracChangeset for help on using the changeset viewer.