@processmaker/screen-builder 2.85.2 → 2.85.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-form-builder.css +1 -1
- package/dist/vue-form-builder.es.js +6 -7
- package/dist/vue-form-builder.es.js.map +1 -1
- package/dist/vue-form-builder.umd.js +1 -1
- package/dist/vue-form-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/sortable/Sortable.vue +8 -1
- package/src/components/sortable/sortableList/SortableList.vue +5 -4
- package/src/stories/Sortable.stories.js +49 -0
|
@@ -337,7 +337,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
337
337
|
| <mf-value> [ '<' | '>' ]? '='? <mf-name>
|
|
338
338
|
| <mf-value> '<' '='? <mf-name> '<' '='? <mf-value>
|
|
339
339
|
| <mf-value> '>' '='? <mf-name> '>' '='? <mf-value>`},"mf-value":{syntax:"<number> | <dimension> | <ident> | <ratio>"},"min()":{syntax:"min( <calc-sum># )"},"minmax()":{syntax:"minmax( [ <length> | <percentage> | min-content | max-content | auto ] , [ <length> | <percentage> | <flex> | min-content | max-content | auto ] )"},"named-color":{syntax:"transparent | aliceblue | antiquewhite | aqua | aquamarine | azure | beige | bisque | black | blanchedalmond | blue | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | cyan | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | fuchsia | gainsboro | ghostwhite | gold | goldenrod | gray | green | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | lime | limegreen | linen | magenta | maroon | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | navy | oldlace | olive | olivedrab | orange | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | purple | rebeccapurple | red | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | silver | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | teal | thistle | tomato | turquoise | violet | wheat | white | whitesmoke | yellow | yellowgreen"},"namespace-prefix":{syntax:"<ident>"},"ns-prefix":{syntax:"[ <ident-token> | '*' ]? '|'"},"number-percentage":{syntax:"<number> | <percentage>"},"numeric-figure-values":{syntax:"[ lining-nums | oldstyle-nums ]"},"numeric-fraction-values":{syntax:"[ diagonal-fractions | stacked-fractions ]"},"numeric-spacing-values":{syntax:"[ proportional-nums | tabular-nums ]"},nth:{syntax:"<an-plus-b> | even | odd"},"opacity()":{syntax:"opacity( [ <number-percentage> ] )"},"overflow-position":{syntax:"unsafe | safe"},"outline-radius":{syntax:"<length> | <percentage>"},"page-body":{syntax:"<declaration>? [ ; <page-body> ]? | <page-margin-box> <page-body>"},"page-margin-box":{syntax:"<page-margin-box-type> '{' <declaration-list> '}'"},"page-margin-box-type":{syntax:"@top-left-corner | @top-left | @top-center | @top-right | @top-right-corner | @bottom-left-corner | @bottom-left | @bottom-center | @bottom-right | @bottom-right-corner | @left-top | @left-middle | @left-bottom | @right-top | @right-middle | @right-bottom"},"page-selector-list":{syntax:"[ <page-selector># ]?"},"page-selector":{syntax:"<pseudo-page>+ | <ident> <pseudo-page>*"},"path()":{syntax:"path( [ <fill-rule>, ]? <string> )"},"paint()":{syntax:"paint( <ident>, <declaration-value>? )"},"perspective()":{syntax:"perspective( <length> )"},"polygon()":{syntax:"polygon( <fill-rule>? , [ <length-percentage> <length-percentage> ]# )"},position:{syntax:"[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]"},"pseudo-class-selector":{syntax:"':' <ident-token> | ':' <function-token> <any-value> ')'"},"pseudo-element-selector":{syntax:"':' <pseudo-class-selector>"},"pseudo-page":{syntax:": [ left | right | first | blank ]"},quote:{syntax:"open-quote | close-quote | no-open-quote | no-close-quote"},"radial-gradient()":{syntax:"radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> )"},"relative-selector":{syntax:"<combinator>? <complex-selector>"},"relative-selector-list":{syntax:"<relative-selector>#"},"relative-size":{syntax:"larger | smaller"},"repeat-style":{syntax:"repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2}"},"repeating-linear-gradient()":{syntax:"repeating-linear-gradient( [ <angle> | to <side-or-corner> ]? , <color-stop-list> )"},"repeating-radial-gradient()":{syntax:"repeating-radial-gradient( [ <ending-shape> || <size> ]? [ at <position> ]? , <color-stop-list> )"},"rgb()":{syntax:"rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )"},"rgba()":{syntax:"rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )"},"rotate()":{syntax:"rotate( [ <angle> | <zero> ] )"},"rotate3d()":{syntax:"rotate3d( <number> , <number> , <number> , [ <angle> | <zero> ] )"},"rotateX()":{syntax:"rotateX( [ <angle> | <zero> ] )"},"rotateY()":{syntax:"rotateY( [ <angle> | <zero> ] )"},"rotateZ()":{syntax:"rotateZ( [ <angle> | <zero> ] )"},"saturate()":{syntax:"saturate( <number-percentage> )"},"scale()":{syntax:"scale( <number> , <number>? )"},"scale3d()":{syntax:"scale3d( <number> , <number> , <number> )"},"scaleX()":{syntax:"scaleX( <number> )"},"scaleY()":{syntax:"scaleY( <number> )"},"scaleZ()":{syntax:"scaleZ( <number> )"},"self-position":{syntax:"center | start | end | self-start | self-end | flex-start | flex-end"},"shape-radius":{syntax:"<length-percentage> | closest-side | farthest-side"},"skew()":{syntax:"skew( [ <angle> | <zero> ] , [ <angle> | <zero> ]? )"},"skewX()":{syntax:"skewX( [ <angle> | <zero> ] )"},"skewY()":{syntax:"skewY( [ <angle> | <zero> ] )"},"sepia()":{syntax:"sepia( <number-percentage> )"},shadow:{syntax:"inset? && <length>{2,4} && <color>?"},"shadow-t":{syntax:"[ <length>{2,3} && <color>? ]"},shape:{syntax:"rect(<top>, <right>, <bottom>, <left>)"},"shape-box":{syntax:"<box> | margin-box"},"side-or-corner":{syntax:"[ left | right ] || [ top | bottom ]"},"single-animation":{syntax:"<time> || <timing-function> || <time> || <single-animation-iteration-count> || <single-animation-direction> || <single-animation-fill-mode> || <single-animation-play-state> || [ none | <keyframes-name> ]"},"single-animation-direction":{syntax:"normal | reverse | alternate | alternate-reverse"},"single-animation-fill-mode":{syntax:"none | forwards | backwards | both"},"single-animation-iteration-count":{syntax:"infinite | <number>"},"single-animation-play-state":{syntax:"running | paused"},"single-transition":{syntax:"[ none | <single-transition-property> ] || <time> || <timing-function> || <time>"},"single-transition-property":{syntax:"all | <custom-ident>"},size:{syntax:"closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}"},"step-position":{syntax:"jump-start | jump-end | jump-none | jump-both | start | end"},"step-timing-function":{syntax:"step-start | step-end | steps(<integer>[, <step-position>]?)"},"subclass-selector":{syntax:"<id-selector> | <class-selector> | <attribute-selector> | <pseudo-class-selector>"},"supports-condition":{syntax:"not <supports-in-parens> | <supports-in-parens> [ and <supports-in-parens> ]* | <supports-in-parens> [ or <supports-in-parens> ]*"},"supports-in-parens":{syntax:"( <supports-condition> ) | <supports-feature> | <general-enclosed>"},"supports-feature":{syntax:"<supports-decl> | <supports-selector-fn>"},"supports-decl":{syntax:"( <declaration> )"},"supports-selector-fn":{syntax:"selector( <complex-selector> )"},symbol:{syntax:"<string> | <image> | <custom-ident>"},target:{syntax:"<target-counter()> | <target-counters()> | <target-text()>"},"target-counter()":{syntax:"target-counter( [ <string> | <url> ] , <custom-ident> , <counter-style>? )"},"target-counters()":{syntax:"target-counters( [ <string> | <url> ] , <custom-ident> , <string> , <counter-style>? )"},"target-text()":{syntax:"target-text( [ <string> | <url> ] , [ content | before | after | first-letter ]? )"},"time-percentage":{syntax:"<time> | <percentage>"},"timing-function":{syntax:"linear | <cubic-bezier-timing-function> | <step-timing-function>"},"track-breadth":{syntax:"<length-percentage> | <flex> | min-content | max-content | auto"},"track-list":{syntax:"[ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?"},"track-repeat":{syntax:"repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? )"},"track-size":{syntax:"<track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )"},"transform-function":{syntax:"<matrix()> | <translate()> | <translateX()> | <translateY()> | <scale()> | <scaleX()> | <scaleY()> | <rotate()> | <skew()> | <skewX()> | <skewY()> | <matrix3d()> | <translate3d()> | <translateZ()> | <scale3d()> | <scaleZ()> | <rotate3d()> | <rotateX()> | <rotateY()> | <rotateZ()> | <perspective()>"},"transform-list":{syntax:"<transform-function>+"},"translate()":{syntax:"translate( <length-percentage> , <length-percentage>? )"},"translate3d()":{syntax:"translate3d( <length-percentage> , <length-percentage> , <length> )"},"translateX()":{syntax:"translateX( <length-percentage> )"},"translateY()":{syntax:"translateY( <length-percentage> )"},"translateZ()":{syntax:"translateZ( <length> )"},"type-or-unit":{syntax:"string | color | url | integer | number | length | angle | time | frequency | cap | ch | em | ex | ic | lh | rlh | rem | vb | vi | vw | vh | vmin | vmax | mm | Q | cm | in | pt | pc | px | deg | grad | rad | turn | ms | s | Hz | kHz | %"},"type-selector":{syntax:"<wq-name> | <ns-prefix>? '*'"},"var()":{syntax:"var( <custom-property-name> , <declaration-value>? )"},"viewport-length":{syntax:"auto | <length-percentage>"},"wq-name":{syntax:"<ns-prefix>? <ident-token>"}},r5={atrules:{charset:{prelude:"<string>"},"font-face":{descriptors:{"unicode-range":{comment:"replaces <unicode-range>, an old production name",syntax:"<urange>#"}}}},properties:{"-moz-background-clip":{comment:"deprecated syntax in old Firefox, https://developer.mozilla.org/en/docs/Web/CSS/background-clip",syntax:"padding | border"},"-moz-border-radius-bottomleft":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-left-radius",syntax:"<'border-bottom-left-radius'>"},"-moz-border-radius-bottomright":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius",syntax:"<'border-bottom-right-radius'>"},"-moz-border-radius-topleft":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-left-radius",syntax:"<'border-top-left-radius'>"},"-moz-border-radius-topright":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius",syntax:"<'border-bottom-right-radius'>"},"-moz-control-character-visibility":{comment:"firefox specific keywords, https://bugzilla.mozilla.org/show_bug.cgi?id=947588",syntax:"visible | hidden"},"-moz-osx-font-smoothing":{comment:"misssed old syntax https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth",syntax:"auto | grayscale"},"-moz-user-select":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/user-select",syntax:"none | text | all | -moz-none"},"-ms-flex-align":{comment:"misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-align",syntax:"start | end | center | baseline | stretch"},"-ms-flex-item-align":{comment:"misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-align",syntax:"auto | start | end | center | baseline | stretch"},"-ms-flex-line-pack":{comment:"misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-line-pack",syntax:"start | end | center | justify | distribute | stretch"},"-ms-flex-negative":{comment:"misssed old syntax implemented in IE; TODO: find references for comfirmation",syntax:"<'flex-shrink'>"},"-ms-flex-pack":{comment:"misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-pack",syntax:"start | end | center | justify | distribute"},"-ms-flex-order":{comment:"misssed old syntax implemented in IE; https://msdn.microsoft.com/en-us/library/jj127303(v=vs.85).aspx",syntax:"<integer>"},"-ms-flex-positive":{comment:"misssed old syntax implemented in IE; TODO: find references for comfirmation",syntax:"<'flex-grow'>"},"-ms-flex-preferred-size":{comment:"misssed old syntax implemented in IE; TODO: find references for comfirmation",syntax:"<'flex-basis'>"},"-ms-interpolation-mode":{comment:"https://msdn.microsoft.com/en-us/library/ff521095(v=vs.85).aspx",syntax:"nearest-neighbor | bicubic"},"-ms-grid-column-align":{comment:"add this property first since it uses as fallback for flexbox, https://msdn.microsoft.com/en-us/library/windows/apps/hh466338.aspx",syntax:"start | end | center | stretch"},"-ms-grid-row-align":{comment:"add this property first since it uses as fallback for flexbox, https://msdn.microsoft.com/en-us/library/windows/apps/hh466348.aspx",syntax:"start | end | center | stretch"},"-ms-hyphenate-limit-last":{comment:"misssed old syntax implemented in IE; https://www.w3.org/TR/css-text-4/#hyphenate-line-limits",syntax:"none | always | column | page | spread"},"-webkit-appearance":{comment:"webkit specific keywords",references:["http://css-infos.net/property/-webkit-appearance"],syntax:"none | button | button-bevel | caps-lock-indicator | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbargripper-horizontal | scrollbargripper-vertical | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button"},"-webkit-background-clip":{comment:"https://developer.mozilla.org/en/docs/Web/CSS/background-clip",syntax:"[ <box> | border | padding | content | text ]#"},"-webkit-column-break-after":{comment:"added, http://help.dottoro.com/lcrthhhv.php",syntax:"always | auto | avoid"},"-webkit-column-break-before":{comment:"added, http://help.dottoro.com/lcxquvkf.php",syntax:"always | auto | avoid"},"-webkit-column-break-inside":{comment:"added, http://help.dottoro.com/lclhnthl.php",syntax:"always | auto | avoid"},"-webkit-font-smoothing":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth",syntax:"auto | none | antialiased | subpixel-antialiased"},"-webkit-mask-box-image":{comment:"missed; https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-mask-box-image",syntax:"[ <url> | <gradient> | none ] [ <length-percentage>{4} <-webkit-mask-box-repeat>{2} ]?"},"-webkit-print-color-adjust":{comment:"missed",references:["https://developer.mozilla.org/en/docs/Web/CSS/-webkit-print-color-adjust"],syntax:"economy | exact"},"-webkit-text-security":{comment:"missed; http://help.dottoro.com/lcbkewgt.php",syntax:"none | circle | disc | square"},"-webkit-user-drag":{comment:"missed; http://help.dottoro.com/lcbixvwm.php",syntax:"none | element | auto"},"-webkit-user-select":{comment:"auto is supported by old webkit, https://developer.mozilla.org/en-US/docs/Web/CSS/user-select",syntax:"auto | none | text | all"},"alignment-baseline":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/text.html#AlignmentBaselineProperty"],syntax:"auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical"},"baseline-shift":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/text.html#BaselineShiftProperty"],syntax:"baseline | sub | super | <svg-length>"},behavior:{comment:"added old IE property https://msdn.microsoft.com/en-us/library/ms530723(v=vs.85).aspx",syntax:"<url>+"},"clip-rule":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/masking.html#ClipRuleProperty"],syntax:"nonzero | evenodd"},cue:{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<'cue-before'> <'cue-after'>?"},"cue-after":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<url> <decibel>? | none"},"cue-before":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<url> <decibel>? | none"},cursor:{comment:"added legacy keywords: hand, -webkit-grab. -webkit-grabbing, -webkit-zoom-in, -webkit-zoom-out, -moz-grab, -moz-grabbing, -moz-zoom-in, -moz-zoom-out",references:["https://www.sitepoint.com/css3-cursor-styles/"],syntax:"[ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing | hand | -webkit-grab | -webkit-grabbing | -webkit-zoom-in | -webkit-zoom-out | -moz-grab | -moz-grabbing | -moz-zoom-in | -moz-zoom-out ] ]"},display:{comment:"extended with -ms-flexbox",syntax:"| <-non-standard-display>"},position:{comment:"extended with -webkit-sticky",syntax:"| -webkit-sticky"},"dominant-baseline":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/text.html#DominantBaselineProperty"],syntax:"auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge"},"image-rendering":{comment:"extended with <-non-standard-image-rendering>, added SVG keywords optimizeSpeed and optimizeQuality",references:["https://developer.mozilla.org/en/docs/Web/CSS/image-rendering","https://www.w3.org/TR/SVG/painting.html#ImageRenderingProperty"],syntax:"| optimizeSpeed | optimizeQuality | <-non-standard-image-rendering>"},fill:{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#FillProperty"],syntax:"<paint>"},"fill-opacity":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#FillProperty"],syntax:"<number-zero-one>"},"fill-rule":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#FillProperty"],syntax:"nonzero | evenodd"},filter:{comment:"extend with IE legacy syntaxes",syntax:"| <-ms-filter-function-list>"},"glyph-orientation-horizontal":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/text.html#GlyphOrientationHorizontalProperty"],syntax:"<angle>"},"glyph-orientation-vertical":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/text.html#GlyphOrientationVerticalProperty"],syntax:"<angle>"},kerning:{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/text.html#KerningProperty"],syntax:"auto | <svg-length>"},"letter-spacing":{comment:"fix syntax <length> -> <length-percentage>",references:["https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/letter-spacing"],syntax:"normal | <length-percentage>"},marker:{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#MarkerProperties"],syntax:"none | <url>"},"marker-end":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#MarkerProperties"],syntax:"none | <url>"},"marker-mid":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#MarkerProperties"],syntax:"none | <url>"},"marker-start":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#MarkerProperties"],syntax:"none | <url>"},"max-width":{comment:"fix auto -> none (https://github.com/mdn/data/pull/431); extend by non-standard width keywords https://developer.mozilla.org/en-US/docs/Web/CSS/max-width",syntax:"none | <length-percentage> | min-content | max-content | fit-content(<length-percentage>) | <-non-standard-width>"},width:{comment:"per spec fit-content should be a function, however browsers are supporting it as a keyword (https://github.com/csstree/stylelint-validator/issues/29)",syntax:"| fit-content | -moz-fit-content | -webkit-fit-content"},"min-width":{comment:"extend by non-standard width keywords https://developer.mozilla.org/en-US/docs/Web/CSS/width",syntax:"auto | <length-percentage> | min-content | max-content | fit-content(<length-percentage>) | <-non-standard-width>"},overflow:{comment:"extend by vendor keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow",syntax:"| <-non-standard-overflow>"},pause:{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<'pause-before'> <'pause-after'>?"},"pause-after":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<time> | none | x-weak | weak | medium | strong | x-strong"},"pause-before":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<time> | none | x-weak | weak | medium | strong | x-strong"},rest:{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<'rest-before'> <'rest-after'>?"},"rest-after":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<time> | none | x-weak | weak | medium | strong | x-strong"},"rest-before":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<time> | none | x-weak | weak | medium | strong | x-strong"},"shape-rendering":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#ShapeRenderingPropert"],syntax:"auto | optimizeSpeed | crispEdges | geometricPrecision"},src:{comment:"added @font-face's src property https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src",syntax:"[ <url> [ format( <string># ) ]? | local( <family-name> ) ]#"},speak:{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"auto | none | normal"},"speak-as":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"normal | spell-out || digits || [ literal-punctuation | no-punctuation ]"},stroke:{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#StrokeProperties"],syntax:"<paint>"},"stroke-dasharray":{comment:"added SVG property; a list of comma and/or white space separated <length>s and <percentage>s",references:["https://www.w3.org/TR/SVG/painting.html#StrokeProperties"],syntax:"none | [ <svg-length>+ ]#"},"stroke-dashoffset":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#StrokeProperties"],syntax:"<svg-length>"},"stroke-linecap":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#StrokeProperties"],syntax:"butt | round | square"},"stroke-linejoin":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#StrokeProperties"],syntax:"miter | round | bevel"},"stroke-miterlimit":{comment:"added SVG property (<miterlimit> = <number-one-or-greater>) ",references:["https://www.w3.org/TR/SVG/painting.html#StrokeProperties"],syntax:"<number-one-or-greater>"},"stroke-opacity":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#StrokeProperties"],syntax:"<number-zero-one>"},"stroke-width":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/painting.html#StrokeProperties"],syntax:"<svg-length>"},"text-anchor":{comment:"added SVG property",references:["https://www.w3.org/TR/SVG/text.html#TextAlignmentProperties"],syntax:"start | middle | end"},"unicode-bidi":{comment:"added prefixed keywords https://developer.mozilla.org/en-US/docs/Web/CSS/unicode-bidi",syntax:"| -moz-isolate | -moz-isolate-override | -moz-plaintext | -webkit-isolate | -webkit-isolate-override | -webkit-plaintext"},"unicode-range":{comment:"added missed property https://developer.mozilla.org/en-US/docs/Web/CSS/%40font-face/unicode-range",syntax:"<urange>#"},"voice-balance":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<number> | left | center | right | leftwards | rightwards"},"voice-duration":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"auto | <time>"},"voice-family":{comment:"<name> -> <family-name>, https://www.w3.org/TR/css3-speech/#property-index",syntax:"[ [ <family-name> | <generic-voice> ] , ]* [ <family-name> | <generic-voice> ] | preserve"},"voice-pitch":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<frequency> && absolute | [ [ x-low | low | medium | high | x-high ] || [ <frequency> | <semitones> | <percentage> ] ]"},"voice-range":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"<frequency> && absolute | [ [ x-low | low | medium | high | x-high ] || [ <frequency> | <semitones> | <percentage> ] ]"},"voice-rate":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"[ normal | x-slow | slow | medium | fast | x-fast ] || <percentage>"},"voice-stress":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"normal | strong | moderate | none | reduced"},"voice-volume":{comment:"https://www.w3.org/TR/css3-speech/#property-index",syntax:"silent | [ [ x-soft | soft | medium | loud | x-loud ] || <decibel> ]"},"writing-mode":{comment:"extend with SVG keywords",syntax:"| <svg-writing-mode>"}},syntaxes:{"-legacy-gradient":{comment:"added collection of legacy gradient syntaxes",syntax:"<-webkit-gradient()> | <-legacy-linear-gradient> | <-legacy-repeating-linear-gradient> | <-legacy-radial-gradient> | <-legacy-repeating-radial-gradient>"},"-legacy-linear-gradient":{comment:"like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",syntax:"-moz-linear-gradient( <-legacy-linear-gradient-arguments> ) | -webkit-linear-gradient( <-legacy-linear-gradient-arguments> ) | -o-linear-gradient( <-legacy-linear-gradient-arguments> )"},"-legacy-repeating-linear-gradient":{comment:"like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",syntax:"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> ) | -webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> ) | -o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )"},"-legacy-linear-gradient-arguments":{comment:"like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",syntax:"[ <angle> | <side-or-corner> ]? , <color-stop-list>"},"-legacy-radial-gradient":{comment:"deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",syntax:"-moz-radial-gradient( <-legacy-radial-gradient-arguments> ) | -webkit-radial-gradient( <-legacy-radial-gradient-arguments> ) | -o-radial-gradient( <-legacy-radial-gradient-arguments> )"},"-legacy-repeating-radial-gradient":{comment:"deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",syntax:"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> ) | -webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> ) | -o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )"},"-legacy-radial-gradient-arguments":{comment:"deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",syntax:"[ <position> , ]? [ [ [ <-legacy-radial-gradient-shape> || <-legacy-radial-gradient-size> ] | [ <length> | <percentage> ]{2} ] , ]? <color-stop-list>"},"-legacy-radial-gradient-size":{comment:"before a standard it contains 2 extra keywords (`contain` and `cover`) https://www.w3.org/TR/2011/WD-css3-images-20110908/#ltsize",syntax:"closest-side | closest-corner | farthest-side | farthest-corner | contain | cover"},"-legacy-radial-gradient-shape":{comment:"define to double sure it doesn't extends in future https://www.w3.org/TR/2011/WD-css3-images-20110908/#ltshape",syntax:"circle | ellipse"},"-non-standard-font":{comment:"non standard fonts",references:["https://webkit.org/blog/3709/using-the-system-font-in-web-content/"],syntax:"-apple-system-body | -apple-system-headline | -apple-system-subheadline | -apple-system-caption1 | -apple-system-caption2 | -apple-system-footnote | -apple-system-short-body | -apple-system-short-headline | -apple-system-short-subheadline | -apple-system-short-caption1 | -apple-system-short-footnote | -apple-system-tall-body"},"-non-standard-color":{comment:"non standard colors",references:["http://cssdot.ru/%D0%A1%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%87%D0%BD%D0%B8%D0%BA_CSS/color-i305.html","https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Mozilla_Color_Preference_Extensions"],syntax:"-moz-ButtonDefault | -moz-ButtonHoverFace | -moz-ButtonHoverText | -moz-CellHighlight | -moz-CellHighlightText | -moz-Combobox | -moz-ComboboxText | -moz-Dialog | -moz-DialogText | -moz-dragtargetzone | -moz-EvenTreeRow | -moz-Field | -moz-FieldText | -moz-html-CellHighlight | -moz-html-CellHighlightText | -moz-mac-accentdarkestshadow | -moz-mac-accentdarkshadow | -moz-mac-accentface | -moz-mac-accentlightesthighlight | -moz-mac-accentlightshadow | -moz-mac-accentregularhighlight | -moz-mac-accentregularshadow | -moz-mac-chrome-active | -moz-mac-chrome-inactive | -moz-mac-focusring | -moz-mac-menuselect | -moz-mac-menushadow | -moz-mac-menutextselect | -moz-MenuHover | -moz-MenuHoverText | -moz-MenuBarText | -moz-MenuBarHoverText | -moz-nativehyperlinktext | -moz-OddTreeRow | -moz-win-communicationstext | -moz-win-mediatext | -moz-activehyperlinktext | -moz-default-background-color | -moz-default-color | -moz-hyperlinktext | -moz-visitedhyperlinktext | -webkit-activelink | -webkit-focus-ring-color | -webkit-link | -webkit-text"},"-non-standard-image-rendering":{comment:"non-standard keywords http://phrogz.net/tmp/canvas_image_zoom.html",syntax:"optimize-contrast | -moz-crisp-edges | -o-crisp-edges | -webkit-optimize-contrast"},"-non-standard-overflow":{comment:"non-standard keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow",syntax:"-moz-scrollbars-none | -moz-scrollbars-horizontal | -moz-scrollbars-vertical | -moz-hidden-unscrollable"},"-non-standard-width":{comment:"non-standard keywords https://developer.mozilla.org/en-US/docs/Web/CSS/width",syntax:"fill-available | min-intrinsic | intrinsic | -moz-available | -moz-fit-content | -moz-min-content | -moz-max-content | -webkit-min-content | -webkit-max-content"},"-webkit-gradient()":{comment:"first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/ - TODO: simplify when after match algorithm improvement ( [, point, radius | , point] -> [, radius]? , point )",syntax:"-webkit-gradient( <-webkit-gradient-type>, <-webkit-gradient-point> [, <-webkit-gradient-point> | , <-webkit-gradient-radius>, <-webkit-gradient-point> ] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )"},"-webkit-gradient-color-stop":{comment:"first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",syntax:"from( <color> ) | color-stop( [ <number-zero-one> | <percentage> ] , <color> ) | to( <color> )"},"-webkit-gradient-point":{comment:"first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",syntax:"[ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]"},"-webkit-gradient-radius":{comment:"first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",syntax:"<length> | <percentage>"},"-webkit-gradient-type":{comment:"first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",syntax:"linear | radial"},"-webkit-mask-box-repeat":{comment:"missed; https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-mask-box-image",syntax:"repeat | stretch | round"},"-webkit-mask-clip-style":{comment:"missed; there is no enough information about `-webkit-mask-clip` property, but looks like all those keywords are working",syntax:"border | border-box | padding | padding-box | content | content-box | text"},"-ms-filter-function-list":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",syntax:"<-ms-filter-function>+"},"-ms-filter-function":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",syntax:"<-ms-filter-function-progid> | <-ms-filter-function-legacy>"},"-ms-filter-function-progid":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",syntax:"'progid:' [ <ident-token> '.' ]* [ <ident-token> | <function-token> <any-value>? ) ]"},"-ms-filter-function-legacy":{comment:"https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",syntax:"<ident-token> | <function-token> <any-value>? )"},"-ms-filter":{syntax:"<string>"},age:{comment:"https://www.w3.org/TR/css3-speech/#voice-family",syntax:"child | young | old"},"attr-name":{syntax:"<wq-name>"},"attr-fallback":{syntax:"<any-value>"},"border-radius":{comment:"missed, https://drafts.csswg.org/css-backgrounds-3/#the-border-radius",syntax:"<length-percentage>{1,2}"},bottom:{comment:"missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",syntax:"<length> | auto"},"content-list":{comment:"missed -> https://drafts.csswg.org/css-content/#typedef-content-list (document-url, <target> and leader() is omitted util stabilization)",syntax:"[ <string> | contents | <image> | <quote> | <target> | <leader()> | <attr()> | counter( <ident>, <'list-style-type'>? ) ]+"},"element()":{comment:"https://drafts.csswg.org/css-gcpm/#element-syntax & https://drafts.csswg.org/css-images-4/#element-notation",syntax:"element( <custom-ident> , [ first | start | last | first-except ]? ) | element( <id-selector> )"},"generic-voice":{comment:"https://www.w3.org/TR/css3-speech/#voice-family",syntax:"[ <age>? <gender> <integer>? ]"},gender:{comment:"https://www.w3.org/TR/css3-speech/#voice-family",syntax:"male | female | neutral"},"generic-family":{comment:"added -apple-system",references:["https://webkit.org/blog/3709/using-the-system-font-in-web-content/"],syntax:"| -apple-system"},gradient:{comment:"added legacy syntaxes support",syntax:"| <-legacy-gradient>"},left:{comment:"missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",syntax:"<length> | auto"},"mask-image":{comment:"missed; https://drafts.fxtf.org/css-masking-1/#the-mask-image",syntax:"<mask-reference>#"},"name-repeat":{comment:"missed, and looks like obsolete, keep it as is since other property syntaxes should be changed too; https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-name-repeat",syntax:"repeat( [ <positive-integer> | auto-fill ], <line-names>+)"},"named-color":{comment:"added non standard color names",syntax:"| <-non-standard-color>"},paint:{comment:"used by SVG https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint",syntax:"none | <color> | <url> [ none | <color> ]? | context-fill | context-stroke"},"page-size":{comment:"https://www.w3.org/TR/css-page-3/#typedef-page-size-page-size",syntax:"A5 | A4 | A3 | B5 | B4 | JIS-B5 | JIS-B4 | letter | legal | ledger"},ratio:{comment:"missed, https://drafts.csswg.org/mediaqueries-4/#typedef-ratio",syntax:"<integer> / <integer>"},right:{comment:"missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",syntax:"<length> | auto"},shape:{comment:"missed spaces in function body and add backwards compatible syntax",syntax:"rect( <top>, <right>, <bottom>, <left> ) | rect( <top> <right> <bottom> <left> )"},"svg-length":{comment:"All coordinates and lengths in SVG can be specified with or without a unit identifier",references:["https://www.w3.org/TR/SVG11/coords.html#Units"],syntax:"<percentage> | <length> | <number>"},"svg-writing-mode":{comment:"SVG specific keywords (deprecated for CSS)",references:["https://developer.mozilla.org/en/docs/Web/CSS/writing-mode","https://www.w3.org/TR/SVG/text.html#WritingModeProperty"],syntax:"lr-tb | rl-tb | tb-rl | lr | rl | tb"},top:{comment:"missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",syntax:"<length> | auto"},"track-group":{comment:"used by old grid-columns and grid-rows syntax v0",syntax:"'(' [ <string>* <track-minmax> <string>* ]+ ')' [ '[' <positive-integer> ']' ]? | <track-minmax>"},"track-list-v0":{comment:"used by old grid-columns and grid-rows syntax v0",syntax:"[ <string>* <track-group> <string>* ]+ | none"},"track-minmax":{comment:"used by old grid-columns and grid-rows syntax v0",syntax:"minmax( <track-breadth> , <track-breadth> ) | auto | <track-breadth> | fit-content"},x:{comment:"missed; not sure we should add it, but no others except `cursor` is using it so it's ok for now; https://drafts.csswg.org/css-ui-3/#cursor",syntax:"<number>"},y:{comment:"missed; not sure we should add it, but no others except `cursor` is using so it's ok for now; https://drafts.csswg.org/css-ui-3/#cursor",syntax:"<number>"},declaration:{comment:"missed, restored by https://drafts.csswg.org/css-syntax",syntax:"<ident-token> : <declaration-value>? [ '!' important ]?"},"declaration-list":{comment:"missed, restored by https://drafts.csswg.org/css-syntax",syntax:"[ <declaration>? ';' ]* <declaration>?"},url:{comment:"https://drafts.csswg.org/css-values-4/#urls",syntax:"url( <string> <url-modifier>* ) | <url-token>"},"url-modifier":{comment:"https://drafts.csswg.org/css-values-4/#typedef-url-modifier",syntax:"<ident> | <function-token> <any-value> )"},"number-zero-one":{syntax:"<number [0,1]>"},"number-one-or-greater":{syntax:"<number [1,∞]>"},"positive-integer":{syntax:"<integer [0,∞]>"},"-non-standard-display":{syntax:"-ms-inline-flexbox | -ms-grid | -ms-inline-grid | -webkit-flex | -webkit-inline-flex | -webkit-box | -webkit-inline-box | -moz-inline-stack | -moz-box | -moz-inline-box"}}},a5=XU,i5=e5,n5=t5,$p=r5,gS=/^\s*\|\s*/;function s5(t){const e=Object.create(null);for(const r in t){const a=t[r];let i=null;if(a.descriptors){i=Object.create(null);for(const n in a.descriptors)i[n]=a.descriptors[n].syntax}e[r.substr(1)]={prelude:a.syntax.trim().match(/^@\S+\s+([^;\{]*)/)[1].trim()||null,descriptors:i}}return e}function Pp(t,e){const r={};for(const a in t)r[a]=t[a].syntax||t[a];for(const a in e)a in t?e[a].syntax?r[a]=gS.test(e[a].syntax)?r[a]+" "+e[a].syntax.trim():e[a].syntax:delete r[a]:e[a].syntax&&(r[a]=e[a].syntax.replace(gS,""));return r}function vS(t){const e={};for(const r in t)e[r]=t[r].syntax;return e}function o5(t,e){const r={};for(const a in t){const i=e[a]&&e[a].descriptors||null;r[a]={prelude:a in e&&"prelude"in e[a]?e[a].prelude:t[a].prelude||null,descriptors:t[a].descriptors?Pp(t[a].descriptors,i||{}):i&&vS(i)}}for(const a in e)hasOwnProperty.call(t,a)||(r[a]={prelude:e[a].prelude||null,descriptors:e[a].descriptors&&vS(e[a].descriptors)});return r}var l5={types:Pp(n5,$p.syntaxes),atrules:o5(s5(a5),$p.atrules),properties:Pp(i5,$p.properties)},bS=ce.cmpChar,yS=ce.isDigit,ms=ce.TYPE,SS=ms.WhiteSpace,xS=ms.Comment,Dp=ms.Ident,Xr=ms.Number,u5=ms.Dimension,$r=43,Rt=45,tu=110,Ua=!0,c5=!1;function ru(t,e){var r=this.scanner.tokenStart+t,a=this.scanner.source.charCodeAt(r);for((a===$r||a===Rt)&&(e&&this.error("Number sign is not allowed"),r++);r<this.scanner.tokenEnd;r++)yS(this.scanner.source.charCodeAt(r))||this.error("Integer is expected",r)}function Bi(t){return ru.call(this,0,t)}function ba(t,e){if(!bS(this.scanner.source,this.scanner.tokenStart+t,e)){var r="";switch(e){case tu:r="N is expected";break;case Rt:r="HyphenMinus is expected";break}this.error(r,this.scanner.tokenStart+t)}}function Ip(){for(var t=0,e=0,r=this.scanner.tokenType;r===SS||r===xS;)r=this.scanner.lookupType(++t);if(r!==Xr)if(this.scanner.isDelim($r,t)||this.scanner.isDelim(Rt,t)){e=this.scanner.isDelim($r,t)?$r:Rt;do r=this.scanner.lookupType(++t);while(r===SS||r===xS);r!==Xr&&(this.scanner.skip(t),Bi.call(this,Ua))}else return null;return t>0&&this.scanner.skip(t),e===0&&(r=this.scanner.source.charCodeAt(this.scanner.tokenStart),r!==$r&&r!==Rt&&this.error("Number sign is expected")),Bi.call(this,e!==0),e===Rt?"-"+this.consume(Xr):this.consume(Xr)}var d5={name:"AnPlusB",structure:{a:[String,null],b:[String,null]},parse:function(){var t=this.scanner.tokenStart,e=null,r=null;if(this.scanner.tokenType===Xr)Bi.call(this,c5),r=this.consume(Xr);else if(this.scanner.tokenType===Dp&&bS(this.scanner.source,this.scanner.tokenStart,Rt))switch(e="-1",ba.call(this,1,tu),this.scanner.getTokenLength()){case 2:this.scanner.next(),r=Ip.call(this);break;case 3:ba.call(this,2,Rt),this.scanner.next(),this.scanner.skipSC(),Bi.call(this,Ua),r="-"+this.consume(Xr);break;default:ba.call(this,2,Rt),ru.call(this,3,Ua),this.scanner.next(),r=this.scanner.substrToCursor(t+2)}else if(this.scanner.tokenType===Dp||this.scanner.isDelim($r)&&this.scanner.lookupType(1)===Dp){var a=0;switch(e="1",this.scanner.isDelim($r)&&(a=1,this.scanner.next()),ba.call(this,0,tu),this.scanner.getTokenLength()){case 1:this.scanner.next(),r=Ip.call(this);break;case 2:ba.call(this,1,Rt),this.scanner.next(),this.scanner.skipSC(),Bi.call(this,Ua),r="-"+this.consume(Xr);break;default:ba.call(this,1,Rt),ru.call(this,2,Ua),this.scanner.next(),r=this.scanner.substrToCursor(t+a+1)}}else if(this.scanner.tokenType===u5){for(var i=this.scanner.source.charCodeAt(this.scanner.tokenStart),a=i===$r||i===Rt,n=this.scanner.tokenStart+a;n<this.scanner.tokenEnd&&yS(this.scanner.source.charCodeAt(n));n++);n===this.scanner.tokenStart+a&&this.error("Integer is expected",this.scanner.tokenStart+a),ba.call(this,n-this.scanner.tokenStart,tu),e=this.scanner.source.substring(t,n),n+1===this.scanner.tokenEnd?(this.scanner.next(),r=Ip.call(this)):(ba.call(this,n-this.scanner.tokenStart+1,Rt),n+2===this.scanner.tokenEnd?(this.scanner.next(),this.scanner.skipSC(),Bi.call(this,Ua),r="-"+this.consume(Xr)):(ru.call(this,n-this.scanner.tokenStart+2,Ua),this.scanner.next(),r=this.scanner.substrToCursor(n+1)))}else this.error();return e!==null&&e.charCodeAt(0)===$r&&(e=e.substr(1)),r!==null&&r.charCodeAt(0)===$r&&(r=r.substr(1)),{type:"AnPlusB",loc:this.getLocation(t,this.scanner.tokenStart),a:e,b:r}},generate:function(t){var e=t.a!==null&&t.a!==void 0,r=t.b!==null&&t.b!==void 0;e?(this.chunk(t.a==="+1"?"+n":t.a==="1"?"n":t.a==="-1"?"-n":t.a+"n"),r&&(r=String(t.b),r.charAt(0)==="-"||r.charAt(0)==="+"?(this.chunk(r.charAt(0)),this.chunk(r.substr(1))):(this.chunk("+"),this.chunk(r)))):this.chunk(String(t.b))}},p5=ce,au=p5.TYPE,f5=au.WhiteSpace,zp=au.Semicolon,kS=au.LeftCurlyBracket,h5=au.Delim,m5=33;function g5(){return this.scanner.tokenIndex>0&&this.scanner.lookupType(-1)===f5?this.scanner.tokenIndex>1?this.scanner.getTokenStart(this.scanner.tokenIndex-1):this.scanner.firstCharOffset:this.scanner.tokenStart}function _S(){return 0}function v5(t){return t===kS?1:0}function b5(t){return t===kS||t===zp?1:0}function y5(t,e,r){return t===h5&&e.charCodeAt(r)===m5||t===zp?1:0}function S5(t){return t===zp?2:0}var Ga={name:"Raw",structure:{value:String},parse:function(t,e,r){var a=this.scanner.getTokenStart(t),i;return this.scanner.skip(this.scanner.getRawLength(t,e||_S)),r&&this.scanner.tokenStart>a?i=g5.call(this):i=this.scanner.tokenStart,{type:"Raw",loc:this.getLocation(a,i),value:this.scanner.source.substring(a,i)}},generate:function(t){this.chunk(t.value)},mode:{default:_S,leftCurlyBracket:v5,leftCurlyBracketOrSemicolon:b5,exclamationMarkOrSemicolon:y5,semicolonIncluded:S5}},iu=ce.TYPE,x5=Ga.mode,wS=iu.AtKeyword,CS=iu.Semicolon,Lp=iu.LeftCurlyBracket,k5=iu.RightCurlyBracket;function TS(t){return this.Raw(t,x5.leftCurlyBracketOrSemicolon,!0)}function _5(){for(var t=1,e;e=this.scanner.lookupType(t);t++){if(e===k5)return!0;if(e===Lp||e===wS)return!1}return!1}var w5={name:"Atrule",structure:{name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]},parse:function(){var t=this.scanner.tokenStart,e,r,a=null,i=null;switch(this.eat(wS),e=this.scanner.substrToCursor(t+1),r=e.toLowerCase(),this.scanner.skipSC(),this.scanner.eof===!1&&this.scanner.tokenType!==Lp&&this.scanner.tokenType!==CS&&(this.parseAtrulePrelude?(a=this.parseWithFallback(this.AtrulePrelude.bind(this,e),TS),a.type==="AtrulePrelude"&&a.children.head===null&&(a=null)):a=TS.call(this,this.scanner.tokenIndex),this.scanner.skipSC()),this.scanner.tokenType){case CS:this.scanner.next();break;case Lp:this.atrule.hasOwnProperty(r)&&typeof this.atrule[r].block=="function"?i=this.atrule[r].block.call(this):i=this.Block(_5.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.scanner.tokenStart),name:e,prelude:a,block:i}},generate:function(t){this.chunk("@"),this.chunk(t.name),t.prelude!==null&&(this.chunk(" "),this.node(t.prelude)),t.block?this.node(t.block):this.chunk(";")},walkContext:"atrule"},AS=ce.TYPE,C5=AS.Semicolon,T5=AS.LeftCurlyBracket,A5={name:"AtrulePrelude",structure:{children:[[]]},parse:function(t){var e=null;return t!==null&&(t=t.toLowerCase()),this.scanner.skipSC(),this.atrule.hasOwnProperty(t)&&typeof this.atrule[t].prelude=="function"?e=this.atrule[t].prelude.call(this):e=this.readSequence(this.scope.AtrulePrelude),this.scanner.skipSC(),this.scanner.eof!==!0&&this.scanner.tokenType!==T5&&this.scanner.tokenType!==C5&&this.error("Semicolon or block is expected"),e===null&&(e=this.createList()),{type:"AtrulePrelude",loc:this.getLocationFromList(e),children:e}},generate:function(t){this.children(t)},walkContext:"atrulePrelude"},gs=ce.TYPE,vs=gs.Ident,O5=gs.String,E5=gs.Colon,M5=gs.LeftSquareBracket,OS=gs.RightSquareBracket,$5=36,ES=42,nu=61,P5=94,jp=124,D5=126;function I5(){this.scanner.eof&&this.error("Unexpected end of input");var t=this.scanner.tokenStart,e=!1,r=!0;return this.scanner.isDelim(ES)?(e=!0,r=!1,this.scanner.next()):this.scanner.isDelim(jp)||this.eat(vs),this.scanner.isDelim(jp)?this.scanner.source.charCodeAt(this.scanner.tokenStart+1)!==nu?(this.scanner.next(),this.eat(vs)):e&&this.error("Identifier is expected",this.scanner.tokenEnd):e&&this.error("Vertical line is expected"),r&&this.scanner.tokenType===E5&&(this.scanner.next(),this.eat(vs)),{type:"Identifier",loc:this.getLocation(t,this.scanner.tokenStart),name:this.scanner.substrToCursor(t)}}function z5(){var t=this.scanner.tokenStart,e=this.scanner.source.charCodeAt(t);return e!==nu&&e!==D5&&e!==P5&&e!==$5&&e!==ES&&e!==jp&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.scanner.next(),e!==nu&&(this.scanner.isDelim(nu)||this.error("Equal sign is expected"),this.scanner.next()),this.scanner.substrToCursor(t)}var L5={name:"AttributeSelector",structure:{name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]},parse:function(){var t=this.scanner.tokenStart,e,r=null,a=null,i=null;return this.eat(M5),this.scanner.skipSC(),e=I5.call(this),this.scanner.skipSC(),this.scanner.tokenType!==OS&&(this.scanner.tokenType!==vs&&(r=z5.call(this),this.scanner.skipSC(),a=this.scanner.tokenType===O5?this.String():this.Identifier(),this.scanner.skipSC()),this.scanner.tokenType===vs&&(i=this.scanner.getTokenValue(),this.scanner.next(),this.scanner.skipSC())),this.eat(OS),{type:"AttributeSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:e,matcher:r,value:a,flags:i}},generate:function(t){var e=" ";this.chunk("["),this.node(t.name),t.matcher!==null&&(this.chunk(t.matcher),t.value!==null&&(this.node(t.value),t.value.type==="String"&&(e=""))),t.flags!==null&&(this.chunk(e),this.chunk(t.flags)),this.chunk("]")}},Wi=ce.TYPE,j5=Ga.mode,N5=Wi.WhiteSpace,R5=Wi.Comment,MS=Wi.Semicolon,F5=Wi.AtKeyword,q5=Wi.LeftCurlyBracket,$S=Wi.RightCurlyBracket;function PS(t){return this.Raw(t,null,!0)}function B5(){return this.parseWithFallback(this.Rule,PS)}function DS(t){return this.Raw(t,j5.semicolonIncluded,!0)}function W5(){if(this.scanner.tokenType===MS)return DS.call(this,this.scanner.tokenIndex);var t=this.parseWithFallback(this.Declaration,DS);return this.scanner.tokenType===MS&&this.scanner.next(),t}var V5={name:"Block",structure:{children:[["Atrule","Rule","Declaration"]]},parse:function(t){var e=t?W5:B5,r=this.scanner.tokenStart,a=this.createList();this.eat(q5);e:for(;!this.scanner.eof;)switch(this.scanner.tokenType){case $S:break e;case N5:case R5:this.scanner.next();break;case F5:a.push(this.parseWithFallback(this.Atrule,PS));break;default:a.push(e.call(this))}return this.scanner.eof||this.eat($S),{type:"Block",loc:this.getLocation(r,this.scanner.tokenStart),children:a}},generate:function(t){this.chunk("{"),this.children(t,function(e){e.type==="Declaration"&&this.chunk(";")}),this.chunk("}")},walkContext:"block"},IS=ce.TYPE,U5=IS.LeftSquareBracket,G5=IS.RightSquareBracket,H5={name:"Brackets",structure:{children:[[]]},parse:function(t,e){var r=this.scanner.tokenStart,a=null;return this.eat(U5),a=t.call(this,e),this.scanner.eof||this.eat(G5),{type:"Brackets",loc:this.getLocation(r,this.scanner.tokenStart),children:a}},generate:function(t){this.chunk("["),this.children(t),this.chunk("]")}},Y5=ce.TYPE.CDC,Q5={name:"CDC",structure:[],parse:function(){var t=this.scanner.tokenStart;return this.eat(Y5),{type:"CDC",loc:this.getLocation(t,this.scanner.tokenStart)}},generate:function(){this.chunk("-->")}},K5=ce.TYPE.CDO,J5={name:"CDO",structure:[],parse:function(){var t=this.scanner.tokenStart;return this.eat(K5),{type:"CDO",loc:this.getLocation(t,this.scanner.tokenStart)}},generate:function(){this.chunk("<!--")}},Z5=ce.TYPE,X5=Z5.Ident,e8=46,t8={name:"ClassSelector",structure:{name:String},parse:function(){return this.scanner.isDelim(e8)||this.error("Full stop is expected"),this.scanner.next(),{type:"ClassSelector",loc:this.getLocation(this.scanner.tokenStart-1,this.scanner.tokenEnd),name:this.consume(X5)}},generate:function(t){this.chunk("."),this.chunk(t.name)}},r8=ce.TYPE,a8=r8.Ident,i8=43,zS=47,n8=62,s8=126,o8={name:"Combinator",structure:{name:String},parse:function(){var t=this.scanner.tokenStart,e=this.scanner.source.charCodeAt(this.scanner.tokenStart);switch(e){case n8:case i8:case s8:this.scanner.next();break;case zS:this.scanner.next(),(this.scanner.tokenType!==a8||this.scanner.lookupValue(0,"deep")===!1)&&this.error("Identifier `deep` is expected"),this.scanner.next(),this.scanner.isDelim(zS)||this.error("Solidus is expected"),this.scanner.next();break;default:this.error("Combinator is expected")}return{type:"Combinator",loc:this.getLocation(t,this.scanner.tokenStart),name:this.scanner.substrToCursor(t)}},generate:function(t){this.chunk(t.name)}},l8=ce.TYPE,u8=l8.Comment,c8=42,d8=47,p8={name:"Comment",structure:{value:String},parse:function(){var t=this.scanner.tokenStart,e=this.scanner.tokenEnd;return this.eat(u8),e-t+2>=2&&this.scanner.source.charCodeAt(e-2)===c8&&this.scanner.source.charCodeAt(e-1)===d8&&(e-=2),{type:"Comment",loc:this.getLocation(t,this.scanner.tokenStart),value:this.scanner.source.substring(t+2,e)}},generate:function(t){this.chunk("/*"),this.chunk(t.value),this.chunk("*/")}},f8=Vd.isCustomProperty,Vi=ce.TYPE,LS=Ga.mode,jS=Vi.Ident,NS=Vi.Hash,h8=Vi.Colon,RS=Vi.Semicolon,FS=Vi.Delim,m8=Vi.WhiteSpace,qS=33,g8=35,v8=36,b8=38,y8=42,S8=43,BS=47;function x8(t){return this.Raw(t,LS.exclamationMarkOrSemicolon,!0)}function k8(t){return this.Raw(t,LS.exclamationMarkOrSemicolon,!1)}function _8(){var t=this.scanner.tokenIndex,e=this.Value();return e.type!=="Raw"&&this.scanner.eof===!1&&this.scanner.tokenType!==RS&&this.scanner.isDelim(qS)===!1&&this.scanner.isBalanceEdge(t)===!1&&this.error(),e}var w8={name:"Declaration",structure:{important:[Boolean,String],property:String,value:["Value","Raw"]},parse:function(){var t=this.scanner.tokenStart,e=this.scanner.tokenIndex,r=C8.call(this),a=f8(r),i=a?this.parseCustomProperty:this.parseValue,n=a?k8:x8,s=!1,o;this.scanner.skipSC(),this.eat(h8);const u=this.scanner.tokenIndex;if(a||this.scanner.skipSC(),i?o=this.parseWithFallback(_8,n):o=n.call(this,this.scanner.tokenIndex),a&&o.type==="Value"&&o.children.isEmpty()){for(let l=u-this.scanner.tokenIndex;l<=0;l++)if(this.scanner.lookupType(l)===m8){o.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.scanner.isDelim(qS)&&(s=T8.call(this),this.scanner.skipSC()),this.scanner.eof===!1&&this.scanner.tokenType!==RS&&this.scanner.isBalanceEdge(e)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(t,this.scanner.tokenStart),important:s,property:r,value:o}},generate:function(t){this.chunk(t.property),this.chunk(":"),this.node(t.value),t.important&&this.chunk(t.important===!0?"!important":"!"+t.important)},walkContext:"declaration"};function C8(){var t=this.scanner.tokenStart;if(this.scanner.tokenType===FS)switch(this.scanner.source.charCodeAt(this.scanner.tokenStart)){case y8:case v8:case S8:case g8:case b8:this.scanner.next();break;case BS:this.scanner.next(),this.scanner.isDelim(BS)&&this.scanner.next();break}return this.scanner.tokenType===NS?this.eat(NS):this.eat(jS),this.scanner.substrToCursor(t)}function T8(){this.eat(FS),this.scanner.skipSC();var t=this.consume(jS);return t==="important"?!0:t}var Np=ce.TYPE,A8=Ga.mode,O8=Np.WhiteSpace,E8=Np.Comment,M8=Np.Semicolon;function $8(t){return this.Raw(t,A8.semicolonIncluded,!0)}var P8={name:"DeclarationList",structure:{children:[["Declaration"]]},parse:function(){for(var t=this.createList();!this.scanner.eof;)switch(this.scanner.tokenType){case O8:case E8:case M8:this.scanner.next();break;default:t.push(this.parseWithFallback(this.Declaration,$8))}return{type:"DeclarationList",loc:this.getLocationFromList(t),children:t}},generate:function(t){this.children(t,function(e){e.type==="Declaration"&&this.chunk(";")})}},D8=Xn.consumeNumber,I8=ce.TYPE,z8=I8.Dimension,L8={name:"Dimension",structure:{value:String,unit:String},parse:function(){var t=this.scanner.tokenStart,e=D8(this.scanner.source,t);return this.eat(z8),{type:"Dimension",loc:this.getLocation(t,this.scanner.tokenStart),value:this.scanner.source.substring(t,e),unit:this.scanner.source.substring(e,this.scanner.tokenStart)}},generate:function(t){this.chunk(t.value),this.chunk(t.unit)}},j8=ce.TYPE,N8=j8.RightParenthesis,R8={name:"Function",structure:{name:String,children:[[]]},parse:function(t,e){var r=this.scanner.tokenStart,a=this.consumeFunctionName(),i=a.toLowerCase(),n;return n=e.hasOwnProperty(i)?e[i].call(this,e):t.call(this,e),this.scanner.eof||this.eat(N8),{type:"Function",loc:this.getLocation(r,this.scanner.tokenStart),name:a,children:n}},generate:function(t){this.chunk(t.name),this.chunk("("),this.children(t),this.chunk(")")},walkContext:"function"},F8=ce.TYPE,q8=F8.Hash,B8={name:"Hash",structure:{value:String},parse:function(){var t=this.scanner.tokenStart;return this.eat(q8),{type:"Hash",loc:this.getLocation(t,this.scanner.tokenStart),value:this.scanner.substrToCursor(t+1)}},generate:function(t){this.chunk("#"),this.chunk(t.value)}},W8=ce.TYPE,V8=W8.Ident,U8={name:"Identifier",structure:{name:String},parse:function(){return{type:"Identifier",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),name:this.consume(V8)}},generate:function(t){this.chunk(t.name)}},G8=ce.TYPE,H8=G8.Hash,Y8={name:"IdSelector",structure:{name:String},parse:function(){var t=this.scanner.tokenStart;return this.eat(H8),{type:"IdSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:this.scanner.substrToCursor(t+1)}},generate:function(t){this.chunk("#"),this.chunk(t.name)}},Ha=ce.TYPE,WS=Ha.Ident,Q8=Ha.Number,K8=Ha.Dimension,J8=Ha.LeftParenthesis,VS=Ha.RightParenthesis,Z8=Ha.Colon,X8=Ha.Delim,e6={name:"MediaFeature",structure:{name:String,value:["Identifier","Number","Dimension","Ratio",null]},parse:function(){var t=this.scanner.tokenStart,e,r=null;if(this.eat(J8),this.scanner.skipSC(),e=this.consume(WS),this.scanner.skipSC(),this.scanner.tokenType!==VS){switch(this.eat(Z8),this.scanner.skipSC(),this.scanner.tokenType){case Q8:this.lookupNonWSType(1)===X8?r=this.Ratio():r=this.Number();break;case K8:r=this.Dimension();break;case WS:r=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.scanner.skipSC()}return this.eat(VS),{type:"MediaFeature",loc:this.getLocation(t,this.scanner.tokenStart),name:e,value:r}},generate:function(t){this.chunk("("),this.chunk(t.name),t.value!==null&&(this.chunk(":"),this.node(t.value)),this.chunk(")")}},su=ce.TYPE,t6=su.WhiteSpace,r6=su.Comment,a6=su.Ident,i6=su.LeftParenthesis,n6={name:"MediaQuery",structure:{children:[["Identifier","MediaFeature","WhiteSpace"]]},parse:function(){this.scanner.skipSC();var t=this.createList(),e=null,r=null;e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case r6:this.scanner.next();continue;case t6:r=this.WhiteSpace();continue;case a6:e=this.Identifier();break;case i6:e=this.MediaFeature();break;default:break e}r!==null&&(t.push(r),r=null),t.push(e)}return e===null&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(t),children:t}},generate:function(t){this.children(t)}},s6=ce.TYPE.Comma,o6={name:"MediaQueryList",structure:{children:[["MediaQuery"]]},parse:function(t){var e=this.createList();for(this.scanner.skipSC();!this.scanner.eof&&(e.push(this.MediaQuery(t)),this.scanner.tokenType===s6);)this.scanner.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}},generate:function(t){this.children(t,function(){this.chunk(",")})}},l6={name:"Nth",structure:{nth:["AnPlusB","Identifier"],selector:["SelectorList",null]},parse:function(t){this.scanner.skipSC();var e=this.scanner.tokenStart,r=e,a=null,i;return this.scanner.lookupValue(0,"odd")||this.scanner.lookupValue(0,"even")?i=this.Identifier():i=this.AnPlusB(),this.scanner.skipSC(),t&&this.scanner.lookupValue(0,"of")?(this.scanner.next(),a=this.SelectorList(),this.needPositions&&(r=this.getLastListNode(a.children).loc.end.offset)):this.needPositions&&(r=i.loc.end.offset),{type:"Nth",loc:this.getLocation(e,r),nth:i,selector:a}},generate:function(t){this.node(t.nth),t.selector!==null&&(this.chunk(" of "),this.node(t.selector))}},u6=ce.TYPE.Number,c6={name:"Number",structure:{value:String},parse:function(){return{type:"Number",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(u6)}},generate:function(t){this.chunk(t.value)}},d6={name:"Operator",structure:{value:String},parse:function(){var t=this.scanner.tokenStart;return this.scanner.next(),{type:"Operator",loc:this.getLocation(t,this.scanner.tokenStart),value:this.scanner.substrToCursor(t)}},generate:function(t){this.chunk(t.value)}},US=ce.TYPE,p6=US.LeftParenthesis,f6=US.RightParenthesis,h6={name:"Parentheses",structure:{children:[[]]},parse:function(t,e){var r=this.scanner.tokenStart,a=null;return this.eat(p6),a=t.call(this,e),this.scanner.eof||this.eat(f6),{type:"Parentheses",loc:this.getLocation(r,this.scanner.tokenStart),children:a}},generate:function(t){this.chunk("("),this.children(t),this.chunk(")")}},m6=Xn.consumeNumber,g6=ce.TYPE,v6=g6.Percentage,b6={name:"Percentage",structure:{value:String},parse:function(){var t=this.scanner.tokenStart,e=m6(this.scanner.source,t);return this.eat(v6),{type:"Percentage",loc:this.getLocation(t,this.scanner.tokenStart),value:this.scanner.source.substring(t,e)}},generate:function(t){this.chunk(t.value),this.chunk("%")}},ou=ce.TYPE,y6=ou.Ident,S6=ou.Function,x6=ou.Colon,k6=ou.RightParenthesis,_6={name:"PseudoClassSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var t=this.scanner.tokenStart,e=null,r,a;return this.eat(x6),this.scanner.tokenType===S6?(r=this.consumeFunctionName(),a=r.toLowerCase(),this.pseudo.hasOwnProperty(a)?(this.scanner.skipSC(),e=this.pseudo[a].call(this),this.scanner.skipSC()):(e=this.createList(),e.push(this.Raw(this.scanner.tokenIndex,null,!1))),this.eat(k6)):r=this.consume(y6),{type:"PseudoClassSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:r,children:e}},generate:function(t){this.chunk(":"),this.chunk(t.name),t.children!==null&&(this.chunk("("),this.children(t),this.chunk(")"))},walkContext:"function"},lu=ce.TYPE,w6=lu.Ident,C6=lu.Function,GS=lu.Colon,T6=lu.RightParenthesis,A6={name:"PseudoElementSelector",structure:{name:String,children:[["Raw"],null]},parse:function(){var t=this.scanner.tokenStart,e=null,r,a;return this.eat(GS),this.eat(GS),this.scanner.tokenType===C6?(r=this.consumeFunctionName(),a=r.toLowerCase(),this.pseudo.hasOwnProperty(a)?(this.scanner.skipSC(),e=this.pseudo[a].call(this),this.scanner.skipSC()):(e=this.createList(),e.push(this.Raw(this.scanner.tokenIndex,null,!1))),this.eat(T6)):r=this.consume(w6),{type:"PseudoElementSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:r,children:e}},generate:function(t){this.chunk("::"),this.chunk(t.name),t.children!==null&&(this.chunk("("),this.children(t),this.chunk(")"))},walkContext:"function"},O6=ce.isDigit,HS=ce.TYPE,E6=HS.Number,M6=HS.Delim,$6=47,P6=46;function YS(){this.scanner.skipWS();for(var t=this.consume(E6),e=0;e<t.length;e++){var r=t.charCodeAt(e);!O6(r)&&r!==P6&&this.error("Unsigned number is expected",this.scanner.tokenStart-t.length+e)}return Number(t)===0&&this.error("Zero number is not allowed",this.scanner.tokenStart-t.length),t}var D6={name:"Ratio",structure:{left:String,right:String},parse:function(){var t=this.scanner.tokenStart,e=YS.call(this),r;return this.scanner.skipWS(),this.scanner.isDelim($6)||this.error("Solidus is expected"),this.eat(M6),r=YS.call(this),{type:"Ratio",loc:this.getLocation(t,this.scanner.tokenStart),left:e,right:r}},generate:function(t){this.chunk(t.left),this.chunk("/"),this.chunk(t.right)}},I6=ce.TYPE,z6=Ga.mode,L6=I6.LeftCurlyBracket;function QS(t){return this.Raw(t,z6.leftCurlyBracket,!0)}function j6(){var t=this.SelectorList();return t.type!=="Raw"&&this.scanner.eof===!1&&this.scanner.tokenType!==L6&&this.error(),t}var N6={name:"Rule",structure:{prelude:["SelectorList","Raw"],block:["Block"]},parse:function(){var t=this.scanner.tokenIndex,e=this.scanner.tokenStart,r,a;return this.parseRulePrelude?r=this.parseWithFallback(j6,QS):r=QS.call(this,t),a=this.Block(!0),{type:"Rule",loc:this.getLocation(e,this.scanner.tokenStart),prelude:r,block:a}},generate:function(t){this.node(t.prelude),this.node(t.block)},walkContext:"rule"},R6={name:"Selector",structure:{children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]},parse:function(){var t=this.readSequence(this.scope.Selector);return this.getFirstListNode(t)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(t),children:t}},generate:function(t){this.children(t)}},F6=ce.TYPE,q6=F6.Comma,B6={name:"SelectorList",structure:{children:[["Selector","Raw"]]},parse:function(){for(var t=this.createList();!this.scanner.eof;){if(t.push(this.Selector()),this.scanner.tokenType===q6){this.scanner.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(t),children:t}},generate:function(t){this.children(t,function(){this.chunk(",")})},walkContext:"selector"},W6=ce.TYPE.String,V6={name:"String",structure:{value:String},parse:function(){return{type:"String",loc:this.getLocation(this.scanner.tokenStart,this.scanner.tokenEnd),value:this.consume(W6)}},generate:function(t){this.chunk(t.value)}},bs=ce.TYPE,U6=bs.WhiteSpace,G6=bs.Comment,H6=bs.AtKeyword,Y6=bs.CDO,Q6=bs.CDC,K6=33;function KS(t){return this.Raw(t,null,!1)}var J6={name:"StyleSheet",structure:{children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]},parse:function(){for(var t=this.scanner.tokenStart,e=this.createList(),r;!this.scanner.eof;){switch(this.scanner.tokenType){case U6:this.scanner.next();continue;case G6:if(this.scanner.source.charCodeAt(this.scanner.tokenStart+2)!==K6){this.scanner.next();continue}r=this.Comment();break;case Y6:r=this.CDO();break;case Q6:r=this.CDC();break;case H6:r=this.parseWithFallback(this.Atrule,KS);break;default:r=this.parseWithFallback(this.Rule,KS)}e.push(r)}return{type:"StyleSheet",loc:this.getLocation(t,this.scanner.tokenStart),children:e}},generate:function(t){this.children(t)},walkContext:"stylesheet"},Z6=ce.TYPE,X6=Z6.Ident,eG=42,JS=124;function Rp(){this.scanner.tokenType!==X6&&this.scanner.isDelim(eG)===!1&&this.error("Identifier or asterisk is expected"),this.scanner.next()}var tG={name:"TypeSelector",structure:{name:String},parse:function(){var t=this.scanner.tokenStart;return this.scanner.isDelim(JS)?(this.scanner.next(),Rp.call(this)):(Rp.call(this),this.scanner.isDelim(JS)&&(this.scanner.next(),Rp.call(this))),{type:"TypeSelector",loc:this.getLocation(t,this.scanner.tokenStart),name:this.scanner.substrToCursor(t)}},generate:function(t){this.chunk(t.name)}},rG=ce.isHexDigit,ZS=ce.cmpChar,Fp=ce.TYPE,aG=ce.NAME,iG=Fp.Ident,XS=Fp.Number,ex=Fp.Dimension,uu=43,tx=45,qp=63,nG=117;function ys(t,e){for(var r=this.scanner.tokenStart+t,a=0;r<this.scanner.tokenEnd;r++){var i=this.scanner.source.charCodeAt(r);if(i===tx&&e&&a!==0)return ys.call(this,t+a+1,!1)===0&&this.error(),-1;rG(i)||this.error(e&&a!==0?"HyphenMinus"+(a<6?" or hex digit":"")+" is expected":a<6?"Hex digit is expected":"Unexpected input",r),++a>6&&this.error("Too many hex digits",r)}return this.scanner.next(),a}function cu(t){for(var e=0;this.scanner.isDelim(qp);)++e>t&&this.error("Too many question marks"),this.scanner.next()}function Bp(t){this.scanner.source.charCodeAt(this.scanner.tokenStart)!==t&&this.error(aG[t]+" is expected")}function sG(){var t=0;if(this.scanner.isDelim(uu)){if(this.scanner.next(),this.scanner.tokenType===iG){t=ys.call(this,0,!0),t>0&&cu.call(this,6-t);return}if(this.scanner.isDelim(qp)){this.scanner.next(),cu.call(this,5);return}this.error("Hex digit or question mark is expected");return}if(this.scanner.tokenType===XS){if(Bp.call(this,uu),t=ys.call(this,1,!0),this.scanner.isDelim(qp)){cu.call(this,6-t);return}if(this.scanner.tokenType===ex||this.scanner.tokenType===XS){Bp.call(this,tx),ys.call(this,1,!1);return}return}if(this.scanner.tokenType===ex){Bp.call(this,uu),t=ys.call(this,1,!0),t>0&&cu.call(this,6-t);return}this.error()}var oG={name:"UnicodeRange",structure:{value:String},parse:function(){var t=this.scanner.tokenStart;return ZS(this.scanner.source,t,nG)||this.error("U is expected"),ZS(this.scanner.source,t+1,uu)||this.error("Plus sign is expected"),this.scanner.next(),sG.call(this),{type:"UnicodeRange",loc:this.getLocation(t,this.scanner.tokenStart),value:this.scanner.substrToCursor(t)}},generate:function(t){this.chunk(t.value)}},rx=ce.isWhiteSpace,lG=ce.cmpStr,Wp=ce.TYPE,ax=Wp.Function,ix=Wp.Url,uG=Wp.RightParenthesis,cG={name:"Url",structure:{value:["String","Raw"]},parse:function(){var t=this.scanner.tokenStart,e;switch(this.scanner.tokenType){case ix:for(var r=t+4,a=this.scanner.tokenEnd-1;r<a&&rx(this.scanner.source.charCodeAt(r));)r++;for(;r<a&&rx(this.scanner.source.charCodeAt(a-1));)a--;e={type:"Raw",loc:this.getLocation(r,a),value:this.scanner.source.substring(r,a)},this.eat(ix);break;case ax:lG(this.scanner.source,this.scanner.tokenStart,this.scanner.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(ax),this.scanner.skipSC(),e=this.String(),this.scanner.skipSC(),this.eat(uG);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(t,this.scanner.tokenStart),value:e}},generate:function(t){this.chunk("url"),this.chunk("("),this.node(t.value),this.chunk(")")}},dG={name:"Value",structure:{children:[[]]},parse:function(){var t=this.scanner.tokenStart,e=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(t,this.scanner.tokenStart),children:e}},generate:function(t){this.children(t)}},pG=ce.TYPE.WhiteSpace,fG=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),hG={name:"WhiteSpace",structure:{value:String},parse:function(){return this.eat(pG),fG},generate:function(t){this.chunk(t.value)}},Vp={AnPlusB:d5,Atrule:w5,AtrulePrelude:A5,AttributeSelector:L5,Block:V5,Brackets:H5,CDC:Q5,CDO:J5,ClassSelector:t8,Combinator:o8,Comment:p8,Declaration:w8,DeclarationList:P8,Dimension:L8,Function:R8,Hash:B8,Identifier:U8,IdSelector:Y8,MediaFeature:e6,MediaQuery:n6,MediaQueryList:o6,Nth:l6,Number:c6,Operator:d6,Parentheses:h6,Percentage:b6,PseudoClassSelector:_6,PseudoElementSelector:A6,Ratio:D6,Raw:Ga,Rule:N6,Selector:R6,SelectorList:B6,String:V6,StyleSheet:J6,TypeSelector:tG,UnicodeRange:oG,Url:cG,Value:dG,WhiteSpace:hG},Up=l5,mG={generic:!0,types:Up.types,atrules:Up.atrules,properties:Up.properties,node:Vp},nx=ce.cmpChar,gG=ce.cmpStr,tr=ce.TYPE,vG=tr.Ident,bG=tr.String,yG=tr.Number,SG=tr.Function,xG=tr.Url,kG=tr.Hash,_G=tr.Dimension,wG=tr.Percentage,CG=tr.LeftParenthesis,TG=tr.LeftSquareBracket,AG=tr.Comma,OG=tr.Delim,EG=35,MG=42,sx=43,$G=45,PG=47,DG=117,ox=function(e){switch(this.scanner.tokenType){case kG:return this.Hash();case AG:return e.space=null,e.ignoreWSAfter=!0,this.Operator();case CG:return this.Parentheses(this.readSequence,e.recognizer);case TG:return this.Brackets(this.readSequence,e.recognizer);case bG:return this.String();case _G:return this.Dimension();case wG:return this.Percentage();case yG:return this.Number();case SG:return gG(this.scanner.source,this.scanner.tokenStart,this.scanner.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case xG:return this.Url();case vG:return nx(this.scanner.source,this.scanner.tokenStart,DG)&&nx(this.scanner.source,this.scanner.tokenStart+1,sx)?this.UnicodeRange():this.Identifier();case OG:var r=this.scanner.source.charCodeAt(this.scanner.tokenStart);if(r===PG||r===MG||r===sx||r===$G)return this.Operator();r===EG&&this.error("Hex or identifier is expected",this.scanner.tokenStart+1);break}},IG={getNode:ox},ya=ce.TYPE,zG=ya.Delim,LG=ya.Ident,jG=ya.Dimension,NG=ya.Percentage,RG=ya.Number,FG=ya.Hash,lx=ya.Colon,qG=ya.LeftSquareBracket,BG=35,WG=42,VG=43,UG=47,ux=46,GG=62,HG=124,YG=126;function QG(t){switch(this.scanner.tokenType){case qG:return this.AttributeSelector();case FG:return this.IdSelector();case lx:return this.scanner.lookupType(1)===lx?this.PseudoElementSelector():this.PseudoClassSelector();case LG:return this.TypeSelector();case RG:case NG:return this.Percentage();case jG:this.scanner.source.charCodeAt(this.scanner.tokenStart)===ux&&this.error("Identifier is expected",this.scanner.tokenStart+1);break;case zG:var e=this.scanner.source.charCodeAt(this.scanner.tokenStart);switch(e){case VG:case GG:case YG:return t.space=null,t.ignoreWSAfter=!0,this.Combinator();case UG:return this.Combinator();case ux:return this.ClassSelector();case WG:case HG:return this.TypeSelector();case BG:return this.IdSelector()}break}}var KG={getNode:QG},JG=function(){return this.createSingleNodeList(this.Raw(this.scanner.tokenIndex,null,!1))},cx=ce.TYPE,ZG=Ga.mode,XG=cx.Comma,eH=cx.WhiteSpace,tH=function(){var t=this.createList();if(this.scanner.skipSC(),t.push(this.Identifier()),this.scanner.skipSC(),this.scanner.tokenType===XG){t.push(this.Operator());const e=this.scanner.tokenIndex,r=this.parseCustomProperty?this.Value(null):this.Raw(this.scanner.tokenIndex,ZG.exclamationMarkOrSemicolon,!1);if(r.type==="Value"&&r.children.isEmpty()){for(let a=e-this.scanner.tokenIndex;a<=0;a++)if(this.scanner.lookupType(a)===eH){r.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}t.push(r)}return t},rH={getNode:ox,expression:JG,var:tH},aH={AtrulePrelude:IG,Selector:KG,Value:rH},iH={parse:{prelude:null,block:function(){return this.Block(!0)}}},Ss=ce.TYPE,nH=Ss.String,sH=Ss.Ident,oH=Ss.Url,lH=Ss.Function,uH=Ss.LeftParenthesis,cH={parse:{prelude:function(){var t=this.createList();switch(this.scanner.skipSC(),this.scanner.tokenType){case nH:t.push(this.String());break;case oH:case lH:t.push(this.Url());break;default:this.error("String or url() is expected")}return(this.lookupNonWSType(0)===sH||this.lookupNonWSType(0)===uH)&&(t.push(this.WhiteSpace()),t.push(this.MediaQueryList())),t},block:null}},dH={parse:{prelude:function(){return this.createSingleNodeList(this.MediaQueryList())},block:function(){return this.Block(!1)}}},pH={parse:{prelude:function(){return this.createSingleNodeList(this.SelectorList())},block:function(){return this.Block(!0)}}},Ui=ce.TYPE,fH=Ui.WhiteSpace,hH=Ui.Comment,dx=Ui.Ident,mH=Ui.Function,gH=Ui.Colon,vH=Ui.LeftParenthesis;function bH(){return this.createSingleNodeList(this.Raw(this.scanner.tokenIndex,null,!1))}function yH(){return this.scanner.skipSC(),this.scanner.tokenType===dx&&this.lookupNonWSType(1)===gH?this.createSingleNodeList(this.Declaration()):px.call(this)}function px(){var t=this.createList(),e=null,r;this.scanner.skipSC();e:for(;!this.scanner.eof;){switch(this.scanner.tokenType){case fH:e=this.WhiteSpace();continue;case hH:this.scanner.next();continue;case mH:r=this.Function(bH,this.scope.AtrulePrelude);break;case dx:r=this.Identifier();break;case vH:r=this.Parentheses(yH,this.scope.AtrulePrelude);break;default:break e}e!==null&&(t.push(e),e=null),t.push(r)}return t}var SH={parse:{prelude:function(){var t=px.call(this);return this.getFirstListNode(t)===null&&this.error("Condition is expected"),t},block:function(){return this.Block(!1)}}},xH={"font-face":iH,import:cH,media:dH,page:pH,supports:SH},kH={parse:function(){return this.createSingleNodeList(this.Identifier())}},_H={parse:function(){return this.createSingleNodeList(this.SelectorList())}},wH={parse:function(){return this.createSingleNodeList(this.Identifier())}},fx={parse:function(){return this.createSingleNodeList(this.SelectorList())}},CH=fx,TH=fx,AH=!0,hx={parse:function(){return this.createSingleNodeList(this.Nth(AH))}},OH=hx,EH=hx,MH=!1,mx={parse:function(){return this.createSingleNodeList(this.Nth(MH))}},$H=mx,PH=mx,DH={parse:function(){return this.createSingleNodeList(this.Selector())}},IH={dir:kH,has:_H,lang:wH,matches:CH,not:TH,"nth-child":OH,"nth-last-child":EH,"nth-last-of-type":$H,"nth-of-type":PH,slotted:DH},zH={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude:function(t){return this.AtrulePrelude(t.atrule?String(t.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",rule:"Rule",selectorList:"SelectorList",selector:"Selector",block:function(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},scope:aH,atrule:xH,pseudo:IH,node:Vp},LH={node:Vp};const jH={name:"css-tree",version:"1.1.3",description:"A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations",author:"Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)",license:"MIT",repository:"csstree/csstree",keywords:["css","ast","tokenizer","parser","walker","lexer","generator","utils","syntax","validation"],main:"lib/index.js",unpkg:"dist/csstree.min.js",jsdelivr:"dist/csstree.min.js",scripts:{build:"rollup --config",lint:"eslint data lib scripts test && node scripts/review-syntax-patch --lint && node scripts/update-docs --lint","lint-and-test":"npm run lint && npm test","update:docs":"node scripts/update-docs","review:syntax-patch":"node scripts/review-syntax-patch",test:"mocha --reporter progress",coverage:"nyc npm test",travis:"nyc npm run lint-and-test && npm run coveralls",coveralls:"nyc report --reporter=text-lcov | coveralls",prepublishOnly:"npm run build",hydrogen:"node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/parse --stat -o /dev/null"},dependencies:{"mdn-data":"2.0.14","source-map":"^0.6.1"},devDependencies:{"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-json":"^4.0.2","@rollup/plugin-node-resolve":"^7.1.1",coveralls:"^3.0.9",eslint:"^6.8.0","json-to-ast":"^2.1.0",mocha:"^6.2.3",nyc:"^14.1.1",rollup:"^1.32.1","rollup-plugin-terser":"^5.3.0"},engines:{node:">=8.0.0"},files:["data","dist","lib"]};function NH(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var a in r)t[a]=r[a]}return t}$d.exports=hb.create(NH(mG,zH,LH)),$d.exports.version=jH.version;var RH=$d.exports,Ya=RH,gx={exports:{}};(function(t){(function(e,r){t.exports?t.exports=r():e.Scrollparent=r()})(wt,function(){function e(a){var i=getComputedStyle(a,null).getPropertyValue("overflow");return i.indexOf("scroll")>-1||i.indexOf("auto")>-1}function r(a){if(a instanceof HTMLElement||a instanceof SVGElement){for(var i=a.parentNode;i.parentNode;){if(e(i))return i;i=i.parentNode}return document.scrollingElement||document.documentElement}}return r})})(gx);var FH=gx.exports;const qH=ar(FH),BH={name:"custom-css-output",render(t){return t("style",this.$slots.default)}},du=[{code:"AFN",name:"Afghanistan Afghani",format:"####.##",symbol:""},{code:"ALL",name:"Albanian Lek",format:"####.##",symbol:""},{code:"DZD",name:"Algerian Dinar",format:"####.##",symbol:"دج (Arabic) or DA (Latin)"},{code:"AOA",name:"Angolan Kwanza",format:"####.##",symbol:"Kz"},{code:"ARS",name:"Argentine Peso",format:"#.###,##",symbol:""},{code:"AMD",name:"Armenian Dram",format:"#,###.##",symbol:"֏"},{code:"AWG",name:"Aruban Guilder",format:"#,###.##",symbol:""},{code:"AUD",name:"Australian Dollar",format:"# ###.##",symbol:""},{code:"AZN",name:"Azerbaijanian Manat",format:"####.##",symbol:""},{code:"BSD",name:"Bahamian Dollar",format:"#,###.##",symbol:""},{code:"BHD",name:"Bahraini Dinar",format:"#,###.###",symbol:".د.ب (Arabic) or BD (Latin"},{code:"BDT",name:"Bangladesh Taka",format:"#,###.##",symbol:"৳"},{code:"BBD",name:"Barbados Dollar",format:"####.##",symbol:""},{code:"BYN",name:"Belarussian Ruble",format:"####",symbol:""},{code:"BZD",name:"Belize Dollar",format:"#,###.##",symbol:""},{code:"BMD",name:"Bermudian Dollar",format:"#,###.##",symbol:""},{code:"BTN",name:"Bhutan Ngultrum",format:"####.##",symbol:"Nu"},{code:"BOB",name:"Bolivia, Boliviano",format:"#,###.##",symbol:""},{code:"BAM",name:"Bosnia and Herzegovina, Convertible Marks",format:"#,###.##",symbol:""},{code:"BWP",name:"Botswana, Pula",format:"#,###.##",symbol:""},{code:"BRL",name:"Brazilian Real",format:"#.###,##",symbol:""},{code:"BND",name:"Brunei Dollar",format:"#,###.##",symbol:""},{code:"BGN",name:"Bulgarian Lev",format:"####.##",symbol:""},{code:"BIF",name:"Burundi Franc",format:"####",symbol:"FBu"},{code:"KHR",name:"Cambodia, Riel",format:"####.##",symbol:""},{code:"CAD",name:"Canadian Dollar",format:"#,###.##",symbol:""},{code:"CVE",name:"Cape Verde Escudo",format:"####.##",symbol:""},{code:"KYD",name:"Cayman Islands Dollar",format:"#,###.##",symbol:""},{code:"XPF",name:"CFP Franc",format:"####",symbol:"₣"},{code:"CLP",name:"Chilean Peso",format:"#.###",symbol:""},{code:"CNY",name:"China Yuan Renminbi",format:"#,###.##",symbol:""},{code:"COP",name:"Colombian Peso",format:"#.###,##",symbol:""},{code:"KMF",name:"Comoro Franc",format:"####",symbol:"CF"},{code:"CRC",name:"Costa Rican Colon",format:"#.###,##",symbol:""},{code:"HRK",name:"Croatian Kuna",format:"#.###,##",symbol:""},{code:"CUP",name:"Cuban Peso",format:"#,###.##",symbol:""},{code:"CZK",name:"Czech Koruna",format:"#.###,##",symbol:""},{code:"DKK",name:"Danish Krone",format:"#.###,##",symbol:""},{code:"DJF",name:"Djibouti Franc",format:"####",symbol:"Fdj"},{code:"DOP",name:"Dominican Peso",format:"#,###.##",symbol:""},{code:"XCD",name:"East Caribbean Dollar",format:"#,###.##",symbol:""},{code:"EGP",name:"Egyptian Pound",format:"#,###.##",symbol:""},{code:"SVC",name:"El Salvador Colon",format:"#,###.##",symbol:""},{code:"ERN",name:"Eritrea Nakfa",format:"####.##",symbol:"Nkf (Latin script) ናቕፋ (Ge'ez script) ناكفا (Arabic script)"},{code:"ETB",name:"Ethiopian Birr",format:"####.##",symbol:"Br (Latin Script) ብር (Ethiopic Script)"},{code:"EUR",name:"Euro",format:"#,###.##",symbol:""},{code:"FKP",name:"Falkland Islands Pound",format:"####.##",symbol:""},{code:"FJD",name:"Fiji Dollar",format:"####.##",symbol:""},{code:"CDF",name:"Congolais Franc",format:"####.##",symbol:"FC"},{code:"GMD",name:"Gambia Dalasi",format:"####.##",symbol:"D"},{code:"GEL",name:"Georgia Lari",format:"####.##",symbol:"ლ (Lasi) of the Georgian script"},{code:"GHC",name:"Ghana Cedi",format:"#,###.##",symbol:""},{code:"GIP",name:"Gibraltar Pound",format:"#,###.##",symbol:""},{code:"GTQ",name:"Guatemala, Quetzal",format:"#,###.##",symbol:""},{code:"GWP",name:"Guinea-Bissau Peso",format:"####.##",symbol:"$ or COL$"},{code:"GYD",name:"Guyana Dollar",format:"####.##",symbol:""},{code:"HTG",name:"Haitian Gourde",format:"####.##",symbol:"G"},{code:"HNL",name:"Honduran Lempira",format:"#,###.##",symbol:""},{code:"HKD",name:"Hong Kong Dollar",format:"#,###.##",symbol:""},{code:"HUF",name:"Hungary Forint",format:"#.###",symbol:""},{code:"ISK",name:"Iceland Krona",format:"#.###",symbol:""},{code:"INR",name:"Indian Rupee",format:"#,##,###.##",symbol:"₹"},{code:"IDR",name:"Indonesian Rupiah",format:"#.###,##",symbol:""},{code:"IRR",name:"Iranian Rial",format:"#,###.##",symbol:""},{code:"IQD",name:"Iraqi Dinar",format:"####.###",symbol:"ع.د"},{code:"JMD",name:"Jamaican Dollar",format:"#,###.##",symbol:""},{code:"JPY",name:"Japanese Yen",format:"#,###",symbol:""},{code:"JOD",name:"Jordanian Dinar",format:"#,###.###",symbol:"د.ا"},{code:"KZT",name:"Kazakhstan Tenge",format:"####.##",symbol:""},{code:"KES",name:"Kenyan Shilling",format:"#,###.##",symbol:"KES"},{code:"KWD",name:"Kuwaiti Dinar",format:"#,###.###",symbol:"د.ك or KD"},{code:"KGS",name:"Kyrgyzstan Som",format:"####.##",symbol:""},{code:"LAK",name:"Laos, Kip",format:"####.##",symbol:""},{code:"LVL",name:"Latvian Lats",format:"#,###.##",symbol:"Ls"},{code:"LBP",name:"Lebanese Pound",format:"# ###",symbol:""},{code:"LSL",name:"Lesotho Loti",format:"####.##",symbol:"L (singular) or M (plural)"},{code:"LRD",name:"Liberian Dollar",format:"####.##",symbol:""},{code:"LYD",name:"Libyan Dinar",format:"####.###",symbol:"LD and ل.د"},{code:"LTL",name:"Lithuanian Litas",format:"# ###,##",symbol:"Lt"},{code:"MOP",name:"Macao Pataca",format:"####.##",symbol:"MOP$"},{code:"MKD",name:"Macedonia, Denar",format:"#,###.##",symbol:""},{code:"MGA",name:"Malagasy Ariary",format:"####",symbol:"Ar"},{code:"MWK",name:"Malawi Kwacha",format:"####.##",symbol:"MK"},{code:"MYR",name:"Malaysian Ringgit",format:"#,###.##",symbol:""},{code:"MVR",name:"Maldives Rufiyaa",format:"####.##",symbol:"Rf"},{code:"MTL",name:"Maltese Lira",format:"#,###.##",symbol:"₤ and Lm"},{code:"MRO",name:"Mauritanian Ouguiya",format:"####.##",symbol:"UM"},{code:"MUR",name:"Mauritius Rupee",format:"#,###",symbol:""},{code:"MXN",name:"Mexican Peso",format:"#,###.##",symbol:""},{code:"MDL",name:"Moldovan Leu",format:"####.##",symbol:"L"},{code:"MNT",name:"Mongolian Tugrik",format:"####.##",symbol:""},{code:"MAD",name:"Moroccan Dirham",format:"####.##",symbol:"MAD"},{code:"MZM",name:"Mozambique Metical",format:"#.###,##",symbol:""},{code:"MMK",name:"Myanmar Kyat",format:"####.##",symbol:"K"},{code:"NAD",name:"Namibian Dollar",format:"####.##",symbol:""},{code:"NPR",name:"Nepalese Rupee",format:"#,###.##",symbol:""},{code:"ANG",name:"Netherlands Antillian Guilder",format:"#.###,##",symbol:""},{code:"ILS",name:"New Israeli Shekel",format:"#,###.##",symbol:""},{code:"TWD",name:"New Taiwan Dollar",format:"####.##",symbol:""},{code:"TRY",name:"New Turkish Lira",format:"#,###.##",symbol:"₺"},{code:"NZD",name:"New Zealand Dollar",format:"#,###.##",symbol:""},{code:"NIO",name:"Nicaragua, Cordoba Oro",format:"####.##",symbol:""},{code:"NGN",name:"Nigeria, Naira",format:"#,###.##",symbol:""},{code:"KPW",name:"North Korean Won",format:"####.##",symbol:""},{code:"NOK",name:"Norwegian Krone",format:"#.###,##",symbol:""},{code:"PKR",name:"Pakistan Rupee",format:"#,###.##",symbol:""},{code:"PAB",name:"Panama Balboa",format:"####.##",symbol:""},{code:"PGK",name:"Papua New Guinea Kina",format:"####.##",symbol:"K"},{code:"PYG",name:"Paraguay Guarani",format:"####",symbol:""},{code:"PEN",name:"Peru Nuevo Sol",format:"#,###.##",symbol:""},{code:"UYU",name:"Uruguay Peso",format:"#.###,##",symbol:""},{code:"PHP",name:"Philippine Peso",format:"#,###.##",symbol:""},{code:"PLN",name:"Poland Zloty",format:"# ###,##",symbol:""},{code:"GBP",name:"United Kingdom Pound Sterling",format:"#,###.##",symbol:""},{code:"QAR",name:"Qatari Rial",format:"####.##",symbol:""},{code:"OMR",name:"Rial Omani",format:"#,###.###",symbol:"ر.ع."},{code:"RON",name:"Romania, New Leu",format:"#.###,##",symbol:""},{code:"RUB",name:"Russian Ruble",format:"#.###,##",symbol:""},{code:"RWF",name:"Rwanda Franc",format:"####",symbol:"FRw"},{code:"SHP",name:"Saint Helena Pound",format:"####.##",symbol:""},{code:"WST",name:"Samoa Tala",format:"####.##",symbol:"SAT"},{code:"STN",name:"Sao Tome and Principe Dobra",format:"####.##",symbol:"Db"},{code:"SAR",name:"Saudi Riyal",format:"#,###.##",symbol:""},{code:"RSD",name:"Serbian Dinar",format:"####.##",symbol:""},{code:"SCR",name:"Seychelles Rupee",format:"####.##",symbol:""},{code:"SLL",name:"Sierra Leone Leone",format:"####.##",symbol:"Le"},{code:"SGD",name:"Singapore Dollar",format:"#,###.##",symbol:""},{code:"SKK",name:"Slovak Koruna",format:"# ###,##",symbol:"Sk"},{code:"SIT",name:"Slovenia Tolar",format:"#.###,##",symbol:"SlT"},{code:"SBD",name:"Solomon Islands Dollar",format:"####.##",symbol:""},{code:"SOS",name:"Somali Shilling",format:"####.##",symbol:""},{code:"ZAR",name:"South Africa Rand",format:"# ###.##",symbol:""},{code:"KRW",name:"South Korea Won",format:"#,###",symbol:""},{code:"LKR",name:"Sri Lanka Rupee",format:"####.##",symbol:""},{code:"SDD",name:"Sudanese Dinar",format:"####.##",symbol:"LSd"},{code:"SRD",name:"Surinam Dollar",format:"####.##",symbol:"$"},{code:"SZL",name:"Swaziland Lilangeni",format:"#, ###.##",symbol:"L (singular) or E (plural)"},{code:"SEK",name:"Swedish Krona",format:"# ###,##",symbol:""},{code:"CHF",name:"Swiss Franc",format:"#'###.##",symbol:""},{code:"SYP",name:"Syrian Pound",format:"####.##",symbol:""},{code:"TZS",name:"Tanzanian Shilling",format:"#,###.##",symbol:"TSh"},{code:"THB",name:"Thailand, Baht",format:"#,###.##",symbol:""},{code:"TOP",name:"Tongan Paanga",format:"#,###.##",symbol:"T$"},{code:"TTD",name:"Trinidad and Tobago Dollar",format:"####.##",symbol:""},{code:"TND",name:"Tunisian Dinar",format:"####.###",symbol:"د.ت (Tunisian Arabic) or DT (Latin)"},{code:"TMT",name:"Turkmenistani New Manat",format:"####.##",symbol:"T"},{code:"AED",name:"UAE Dirham",format:"#,###.##",symbol:"د.إ"},{code:"UGX",name:"Uganda Shilling",format:"####.##",symbol:"USh"},{code:"UAH",name:"Ukraine Hryvnia",format:"# ###,##",symbol:""},{code:"CLF",name:"Unidad de Fomento",format:"####.##",symbol:"CLF"},{code:"USD",name:"US Dollar",format:"#,###.##",symbol:"$"},{code:"UZS",name:"Uzbekistan Sum",format:"####.##",symbol:""},{code:"VUV",name:"Vanuatu Vatu",format:"#,###",symbol:"VT"},{code:"VES",name:"Venezuela Bolivares Fuertes",format:"#.###,##",symbol:""},{code:"VND",name:"Viet Nam Dong",format:"#.###",symbol:""},{code:"YER",name:"Yemeni Rial",format:"####.##",symbol:""},{code:"ZMK",name:"Zambian Kwacha",format:"####.##",symbol:"ZK"},{code:"ZWD",name:"Zimbabwe Dollar",format:"# ###.##",symbol:""}],WH=Object.freeze(Object.defineProperty({__proto__:null,default:du},Symbol.toStringTag,{value:"Module"}));function vx(t){return t.component!=="FormMultiColumn"?t:t.items.flatMap(vx)}function VH(t){return t.flatMap(e=>e.items).flatMap(vx)}Lt.register("custom-same",function(t,e){let r;const a=t;return e.includes(".")?r=e.split(".").reduce((i,n)=>i[n],this.validator.input):r=this.validator._flattenObject(this.validator.input)[e],r===a},"The :attribute and :custom-same fields must match."),Lt.register("after",function(t,e){const r=xr(t).toISOString(),a=xr(e).toISOString();return r>a},"The :attribute must be after :after."),Lt.register("after_or_equal",function(t,e){const r=xr(t).toISOString(),a=xr(e).toISOString();return r>=a},"The :attribute must be equal or after :after_or_equal."),Lt.register("before",function(t,e){const r=xr(t).toISOString(),a=xr(e).toISOString();return r<a},"The :attribute must be before :before."),Lt.register("before_or_equal",function(t,e){const r=xr(t).toISOString(),a=xr(e).toISOString();return r<=a},"The :attribute must be equal or before :before_or_equal."),Lt.register("custom_date",function(t){let e="MM/DD/YYYY";return typeof window.ProcessMaker<"u"&&window.ProcessMaker.user&&window.ProcessMaker.user.datetime_format&&(e=window.ProcessMaker.user.datetime_format.replace(/[\sHh:msaAzZ]/g,"")),xr(t,[e,xr.ISO_8601],!0).isValid()},"The :attribute must be a valid date.");function UH(t,e){const r={},a={int:"integer",boolean:"boolean",string:"string",datetime:"custom-datetime",date:"custom-date",float:"regex:/^[+-]?\\d+(\\.\\d+)?$/",currency:"regex:/^[+-]?\\d+(\\.\\d+)?$/",array:"array",percentage:"regex:/^[+-]?\\d+(\\.\\d+)?$/",password:"string"};return r.validator=null,r.config=t,r.data=e,r.elements={},r.rules={},r.getDataAndRules=i=>{i.forEach(n=>{if(n){if(Array.isArray(n)&&r.getDataAndRules(n),n.items&&(n.component==="FormLoop"?r.ruleFormLoop(n.config.name,n.items):r.getDataAndRules(n.items)),n.component==="FormNestedScreen"){const s=H.get(window,`nestedScreens.id_${n.config.screen}`);s&&r.getDataAndRules(s)}n.config&&n.config.name&&n.config.validation&&r.addRule(n.config.name,n.config.validation),n.component==="FormInput"&&n.config&&n.config.name&&n.config.dataFormat&&r.addRuleFormat(n.config.name,n.config.dataFormat)}})},r.addRule=(i,n)=>{const s=[];typeof n=="string"?s.push(n):n.forEach(o=>{s.push(o.value)}),r.rules[i]=s},r.addRuleFormat=(i,n)=>{r.rules[i]||(r.rules[i]=[]),r.rules[i].push(a[n])},r.ruleFormLoop=(i,n)=>{n.forEach(s=>{Array.isArray(s)&&r.ruleFormLoop(i,s),s.items&&(s.component==="FormLoop"?r.ruleFormLoop(`${i}.*.${s.config.name}`,s.items):r.ruleFormLoop(i,s.items)),s.config&&s.config.name&&s.config.validation&&(Array.isArray(s.config.validation)&&s.config.validation.forEach(o=>{if(!o.value.includes(":"))return;const u=o.value.split(":")[0];let l=o.value.split(":")[1],c;if(u.includes("required_")||u.includes("same")){if(l.includes("_parent"))l=l.split("_parent.").pop(),c=`${u}:${l}`;else if(!l.includes(","))c=`${u}:${i}.*.${l}`;else{l=l.split(",")[0];const d=o.value.split(":")[1].split(",")[1];c=`${u}:${i}.*.${l},${d}`}o.value=c}}),r.addRule(`${i}.*.${s.config.name}`,s.config.validation)),s.component==="FormInput"&&s.config&&s.config.name&&s.config.dataFormat&&r.addRuleFormat(`${i}.*.${s.config.name}`,s.config.dataFormat)})},r.getValidator=()=>{r.getDataAndRules(r.config),r.validator=new Lt(r.data,r.rules)},r.getErrors=()=>r.failed()?r.validator.errors.errors:{},r.failed=()=>(r.getValidator(),r.validator.fails()),r}const GH={props:["value"],data(){return{display:"running",errorMessage:"",showMessage:!1,variables:[]}},computed:{message(){return this.$t("{{variable}} running.",{variable:this.variables.join(", ")})}},methods:{error(t){this.display="error",this.errorMessage=t},show(t){this.variables.indexOf(t)===-1&&this.variables.push(t),this.display="running",this.errorMessage="",this.showMessage=!1,this.$refs.modal.show()},hide(t){t===-1&&this.variables.splice(0);const e=this.variables.indexOf(t);e>-1&&this.variables.splice(e,1),this.variables.length===0&&this.$refs.modal.hide()}}};var HH=function(){var e=this,r=e._self._c;return r("b-modal",{ref:"modal",attrs:{size:"lg",id:"watchers-synchronous",title:"","hide-header":"","no-close-on-esc":"","hide-header-close":"","no-close-on-backdrop":""}},[e.display==="running"?r("div",{staticClass:"container text-center"},[r("div",{staticClass:"icon-container m-4"},[r("svg",{staticClass:"lds-gear",attrs:{width:"50%",height:"50%",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"}},[r("g",{attrs:{transform:"translate(50 50)"}},[r("g",{attrs:{transform:"rotate(248.825)"}},[r("animateTransform",{attrs:{attributeName:"transform",type:"rotate",values:"0;360",keyTimes:"0;1",dur:"4.7s",repeatCount:"indefinite"}}),r("path",{attrs:{d:"M37.43995192304605 -6.5 L47.43995192304605 -6.5 L47.43995192304605 6.5 L37.43995192304605 6.5 A38 38 0 0 1 35.67394948182593 13.090810836924174 L35.67394948182593 13.090810836924174 L44.33420351967032 18.090810836924174 L37.83420351967032 29.34914108612188 L29.17394948182593 24.34914108612188 A38 38 0 0 1 24.34914108612188 29.17394948182593 L24.34914108612188 29.17394948182593 L29.34914108612188 37.83420351967032 L18.090810836924184 44.33420351967032 L13.090810836924183 35.67394948182593 A38 38 0 0 1 6.5 37.43995192304605 L6.5 37.43995192304605 L6.500000000000001 47.43995192304605 L-6.499999999999995 47.43995192304606 L-6.499999999999996 37.43995192304606 A38 38 0 0 1 -13.09081083692417 35.67394948182593 L-13.09081083692417 35.67394948182593 L-18.09081083692417 44.33420351967032 L-29.34914108612187 37.834203519670325 L-24.349141086121872 29.173949481825936 A38 38 0 0 1 -29.17394948182592 24.34914108612189 L-29.17394948182592 24.34914108612189 L-37.83420351967031 29.349141086121893 L-44.33420351967031 18.0908108369242 L-35.67394948182592 13.090810836924193 A38 38 0 0 1 -37.43995192304605 6.5000000000000036 L-37.43995192304605 6.5000000000000036 L-47.43995192304605 6.500000000000004 L-47.43995192304606 -6.499999999999993 L-37.43995192304606 -6.499999999999994 A38 38 0 0 1 -35.67394948182593 -13.090810836924167 L-35.67394948182593 -13.090810836924167 L-44.33420351967032 -18.090810836924163 L-37.834203519670325 -29.34914108612187 L-29.173949481825936 -24.34914108612187 A38 38 0 0 1 -24.349141086121893 -29.17394948182592 L-24.349141086121893 -29.17394948182592 L-29.349141086121897 -37.834203519670304 L-18.0908108369242 -44.334203519670304 L-13.090810836924195 -35.67394948182592 A38 38 0 0 1 -6.500000000000005 -37.43995192304605 L-6.500000000000005 -37.43995192304605 L-6.500000000000007 -47.43995192304605 L6.49999999999999 -47.43995192304606 L6.499999999999992 -37.43995192304606 A38 38 0 0 1 13.090810836924149 -35.67394948182594 L13.090810836924149 -35.67394948182594 L18.090810836924142 -44.33420351967033 L29.349141086121847 -37.83420351967034 L24.349141086121854 -29.17394948182595 A38 38 0 0 1 29.17394948182592 -24.349141086121893 L29.17394948182592 -24.349141086121893 L37.834203519670304 -29.349141086121897 L44.334203519670304 -18.0908108369242 L35.67394948182592 -13.090810836924197 A38 38 0 0 1 37.43995192304605 -6.500000000000007 M0 -20A20 20 0 1 0 0 20 A20 20 0 1 0 0 -20"}})],1)])])]),r("h3",{staticClass:"display-6"},[e._v(e._s(e.message))]),r("p",{staticClass:"lead"},[e._v(e._s(e.$t("This window will automatically close when complete.")))])]):r("div",{staticClass:"container text-center"},[r("div",{staticClass:"icon-container m-4"},[r("i",{staticClass:"fas fa-sad-tear fa-10x"})]),r("h3",{staticClass:"display-6"},[e._v(e._s(e.$t("Something has gone wrong.")))]),r("p",{staticClass:"lead"},[e._v(e._s(e.$t("Unfortunately this screen has had an issue. We've notified the administrator."))+" "),r("a",{attrs:{href:"javascript:void(0)","data-cy":"watchers-show-error-message"},on:{click:function(a){e.showMessage=!e.showMessage}}},[r("i",{staticClass:"fas fa-info-circle"})])]),e.showMessage?r("small",{staticClass:"text-danger text-left small"},[e._v(e._s(e.errorMessage))]):e._e()]),r("div",{staticClass:"w-100 text-right",attrs:{slot:"modal-footer"},slot:"modal-footer"},[e.display==="error"?r("button",{staticClass:"btn btn-outline-secondary",attrs:{type:"button"},on:{click:function(a){return e.hide(-1)}}},[e._v(e._s(e.$t("Close")))]):e._e()])])},YH=[],QH=oe(GH,HH,YH,!1,null,null,null,null);const bx=QH.exports,KH={props:{value:Object}};var JH=function(){var e=this,r=e._self._c;return r("b-alert",{ref:"alert",attrs:{variant:"danger",dismissible:""},model:{value:e.value.show,callback:function(a){e.$set(e.value,"show",a)},expression:"value.show"}},[r("b",[e._v(" "+e._s(e.value.error)+" ")]),r("ul",e._l(e.value.errors,function(a,i){return r("li",{key:`error-${i}`},[e._v(e._s(a))])}),0)])},ZH=[],XH=oe(KH,JH,ZH,!1,null,null,null,null);const Gp=XH.exports,_te="",e7={name:"ScreenRenderer",components:{WatchersSynchronous:bx,ScreenRendererError:Gp},mixins:[ib,ac],props:{loopContext:{type:String,default:""}},data(){return{currentDefinition:null,codigo:"",displayAsyncLoading:!1}},watch:{definition:{deep:!0,handler(t){H.isEmpty(t.config)||this.rebuildScreen(t)}}},mounted(){this.currentDefinition=H.cloneDeep(this.definition),this.component=this.buildComponent(this.currentDefinition)},methods:{rebuildScreen(t){H.isEqual(t,this.currentDefinition)||(this.currentDefinition=H.cloneDeep(t),this.component=this.buildComponent(this.currentDefinition))},onAsyncWatcherOn(){this.displayAsyncLoading=typeof this._parent>"u"},onAsyncWatcherOff(){this.displayAsyncLoading=!1},getCurrentPage(){return this.$refs.component.getCurrentPage()},setCurrentPage(t){this.$refs.component.setCurrentPage(t)}}};var t7=function(){var e=this,r=e._self._c;return r("b-container",{attrs:{fluid:""}},[e.displayAsyncLoading?r("div",{ref:"watchersAsynchronous",staticClass:"alert alert-light",attrs:{role:"alert"}},[r("svg",{staticClass:"lds-gear",attrs:{width:"20px",height:"20px",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"}},[r("g",{attrs:{transform:"translate(50 50)"}},[r("g",{attrs:{transform:"rotate(248.825)"}},[r("animateTransform",{attrs:{attributeName:"transform",type:"rotate",values:"0;360",keyTimes:"0;1",dur:"4.7s",repeatCount:"indefinite"}}),r("path",{attrs:{d:"M37.43995192304605 -6.5 L47.43995192304605 -6.5 L47.43995192304605 6.5 L37.43995192304605 6.5 A38 38 0 0 1 35.67394948182593 13.090810836924174 L35.67394948182593 13.090810836924174 L44.33420351967032 18.090810836924174 L37.83420351967032 29.34914108612188 L29.17394948182593 24.34914108612188 A38 38 0 0 1 24.34914108612188 29.17394948182593 L24.34914108612188 29.17394948182593 L29.34914108612188 37.83420351967032 L18.090810836924184 44.33420351967032 L13.090810836924183 35.67394948182593 A38 38 0 0 1 6.5 37.43995192304605 L6.5 37.43995192304605 L6.500000000000001 47.43995192304605 L-6.499999999999995 47.43995192304606 L-6.499999999999996 37.43995192304606 A38 38 0 0 1 -13.09081083692417 35.67394948182593 L-13.09081083692417 35.67394948182593 L-18.09081083692417 44.33420351967032 L-29.34914108612187 37.834203519670325 L-24.349141086121872 29.173949481825936 A38 38 0 0 1 -29.17394948182592 24.34914108612189 L-29.17394948182592 24.34914108612189 L-37.83420351967031 29.349141086121893 L-44.33420351967031 18.0908108369242 L-35.67394948182592 13.090810836924193 A38 38 0 0 1 -37.43995192304605 6.5000000000000036 L-37.43995192304605 6.5000000000000036 L-47.43995192304605 6.500000000000004 L-47.43995192304606 -6.499999999999993 L-37.43995192304606 -6.499999999999994 A38 38 0 0 1 -35.67394948182593 -13.090810836924167 L-35.67394948182593 -13.090810836924167 L-44.33420351967032 -18.090810836924163 L-37.834203519670325 -29.34914108612187 L-29.173949481825936 -24.34914108612187 A38 38 0 0 1 -24.349141086121893 -29.17394948182592 L-24.349141086121893 -29.17394948182592 L-29.349141086121897 -37.834203519670304 L-18.0908108369242 -44.334203519670304 L-13.090810836924195 -35.67394948182592 A38 38 0 0 1 -6.500000000000005 -37.43995192304605 L-6.500000000000005 -37.43995192304605 L-6.500000000000007 -47.43995192304605 L6.49999999999999 -47.43995192304606 L6.499999999999992 -37.43995192304606 A38 38 0 0 1 13.090810836924149 -35.67394948182594 L13.090810836924149 -35.67394948182594 L18.090810836924142 -44.33420351967033 L29.349141086121847 -37.83420351967034 L24.349141086121854 -29.17394948182595 A38 38 0 0 1 29.17394948182592 -24.349141086121893 L29.17394948182592 -24.349141086121893 L37.834203519670304 -29.349141086121897 L44.334203519670304 -18.0908108369242 L35.67394948182592 -13.090810836924197 A38 38 0 0 1 37.43995192304605 -6.500000000000007 M0 -20A20 20 0 1 0 0 20 A20 20 0 1 0 0 -20"}})],1)])]),e._v(" "+e._s(e.$t("Loading..."))+" ")]):e._e(),r(e.component,{ref:"component",tag:"component",attrs:{vdata:e.value,_parent:e._parent,"_initial-page":e.currentPage},on:{submit:e.submit,asyncWatcherTriggered:e.onAsyncWatcherOn,asyncWatcherCompleted:e.onAsyncWatcherOff}}),e.showErrors&&e.building.error?r("screen-renderer-error",{model:{value:e.building,callback:function(a){e.building=a},expression:"building"}}):e._e(),r("watchers-synchronous",{ref:"watchersSynchronous"})],1)},r7=[],a7=oe(e7,t7,r7,!1,null,null,null,null);const yx=a7.exports,wte="",i7={name:"VueFormRenderer",components:{ScreenRenderer:yx,CustomCssOutput:BH},mixins:[ac,ph],model:{prop:"data",event:"update"},props:["config","data","_parent","page","computed","customCss","mode","watchers","isLoop","ancestorScreens","loopContext","showErrors","testScreenDefinition","deviceScreen"],data(){return{definition:{config:this.config,computed:this.computed,customCss:this.customCss,watchers:this.watchers,isMobile:!1},formSubmitErrorClass:"",watchers_config:{api:{execute:null,execution:null}},customCssWrapped:"",customFunctions:{formatCurrency(){const t=(e,r)=>{const a=du.find(n=>n.code===r),i={alias:"currency"};if(a){const n=a.format.match(/[.,]/g);n.length===0?n.push("","."):n.length===1&&n.push(n[0]==="."?",":"."),i.digits=(a.format.split(n[1])[1]||"").length,i.radixPoint=n[1],i.groupSeparator=n[0],i.prefix=`${a.symbol} `,i.suffix=` ${a.code}`}return db.format(e,i)};return function(e){const r=JSON.parse(`[${e}]`);return t(H.get(this,r[0]),r[1])}}},scrollable:null,containerObserver:null}},computed:{containerClass(){return this.parentScreen?`screen-${this.parentScreen}`:"custom-css-scope"},cssDevice(){return{"--mobile-width":dh}},containerDeviceClass(){return this.deviceScreen==="mobile"?"container-mobile":"container-desktop"}},watch:{customCss(t){this.definition.customCss=t,this.parseCss()},config:{deep:!0,handler(t){this.definition.config=t,this.$nextTick(()=>{this.registerCustomFunctions()})}},data:{deep:!0,handler(){this.$emit("update",this.data);const t=this.getMainScreen();t&&this.validate(t)}},computed:{deep:!0,handler(t){this.definition.computed=t}},watchers:{deep:!0,handler(t){this.definition.watchers=t}}},created(){this.parseCss=H.debounce(this.parseCss,500,{leading:!0}),this.containerObserver=new ResizeObserver(this.onContainerObserver)},mounted(){this.registerCustomFunctions(),window.ProcessMaker&&window.ProcessMaker.EventBus&&window.ProcessMaker.EventBus.$emit("screen-renderer-init",this),this.scrollable=qH(this.$el),this.containerObserver.observe(this.$refs.formRendererContainer)},methods:{...Pt.mapActions("globalErrorsModule",["validate","hasSubmitted","showValidationOnLoad","restartValidation"]),getMainScreen(){return this.$refs.renderer&&this.$refs.renderer.$refs.component},countElements(t){const e={config:t};return this.$refs.renderer.countElements(e)},checkForRecordList(t,e){return t.forEach(r=>{r.items&&this.checkForRecordList(r.items,e),r.component==="FormRecordList"&&this.removeRecordListForms(r,e)}),e},removeRecordListForms(t,e){const r=t.config.form;return delete e[r],e},checkForNestedScreenErrors(t){if(t.$options._componentTag==="FormNestedScreen")return t.errors()},isValid(){const t=VH(this.definition.config),e=H.cloneDeep(this.definition.config);return this.checkForRecordList(t,e),this.dataTypeValidator=UH(e,this.data),this.errors=this.dataTypeValidator.getErrors(),this.errors&&(this.formSubmitErrorClass="invalid-form-submission"),H.size(this.errors)===0},registerCustomFunctions(t=this){t.registerCustomFunction instanceof Function&&Object.keys(this.customFunctions).forEach(e=>{t.registerCustomFunction(e,this.customFunctions[e])}),t.$children instanceof Array&&t.$children.forEach(e=>this.registerCustomFunctions(e))},submit(t,e=!1,r=null){this.$emit("submit",this.data,e,r)},parseCss(){const t=`.${this.containerClass}`;try{const e=Ya.parse(this.customCss,{onParseError(i){throw i.formattedMessage}});let r=0;Ya.walk(e,function(i,n,s){if(i.type.match(/^.+Selector$/)&&i.name!==t&&s&&(n.prev||(s.prependData({type:"WhiteSpace",loc:null,value:" "}),s.prependData({type:"TypeSelector",loc:null,name:t}))),r>5e3)throw Error("CSS is too long");r+=1});const a=[];Ya.walk(e,{visit:"Atrule",enter:(i,n,s)=>{if(!n.prev&&i.name==="media"){const o={minWidth:0,maxWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),rules:[]};Ya.walk(i.prelude,{visit:"MediaFeature",enter:u=>{["min-width","max-width"].includes(u.name)&&(o[H.camelCase(u.name)]=parseInt(u.value.value,10),o.rules.length===0&&Ya.walk(i.block,{visit:"Rule",enter:l=>{const c=Ya.generate(l);o.rules.push(c)}}),a.push(o))}}),s.remove(n)}}}),this.customCssWrapped=Ya.generate(e),a.forEach(i=>{const{width:n}=this.$refs.formRendererContainer.getBoundingClientRect();n>=i.minWidth&&n<=i.maxWidth&&(this.customCssWrapped+=i.rules.join(" "))}),this.$emit("css-errors","")}catch(e){this.$emit("css-errors",e)}},getCurrentPage(){return this.$refs.renderer.getCurrentPage()},setCurrentPage(t){this.$refs.renderer.setCurrentPage(t)},onContainerObserver(t){t[0].target.getBoundingClientRect(),this.parseCss()}}};var n7=function(){var e=this,r=e._self._c;return r("div",{ref:"formRendererContainer",class:[e.containerClass,e.containerDeviceClass],style:e.cssDevice,attrs:{id:"vue-form-renderer","data-cy":"screen-renderer-container"}},[r("custom-css-output",[e._v(e._s(e.customCssWrapped))]),r("screen-renderer",{ref:"renderer",staticClass:"p-0",attrs:{value:e.data,_parent:e._parent,definition:e.definition,"current-page":e.currentPage,"data-cy":"screen-renderer","show-errors":e.showErrors,"test-screen-definition":e.testScreenDefinition||!1,"loop-context":e.loopContext},on:{submit:e.submit}})],1)},s7=[],o7=oe(i7,n7,s7,!1,null,"caa03b53",null,null);const Gi=o7.exports,l7={name:"FormLoop",components:{VueFormRenderer:Gi},mixins:[],props:["value","config","transientData","name","mode","formConfig"],data(){return{matrix:[],items:[],additionalItems:0,transientDataCopy:null,parentObjectChanges:[]}},computed:{parentLoopContext(){let t=this.$parent,e=0,r="";for(;!t.loopContext;){if(t=t.$parent,t===this.$root){t=null;break}if(e>100)throw new Error("Loop Error");e++}return t&&(r=t.loopContext),r},rendererConfig(){const{items:t}=this;return[{name:"LoopItem",items:t}]},times(){if(!this.config||!this.config.settings)return[];if(this.config.settings.type==="existing"){const e=H.get(this.transientData,this.name,null);return e?[...e.keys()]:[]}let{times:t}=this.config.settings;try{t=_r.render(t,this.transientData)}catch(e){throw new Error(e)}return t=parseInt(t),Number.isNaN(t)?[]:(t>100&&(t=100),t+=this.additionalItems,[...Array(t).keys()])}},watch:{transientData:{handler(){this.transientDataCopy=H.cloneDeep(this.transientData),this.$delete(this.transientDataCopy,this.name);const t=H.get(this,`transientData.${this.name}`,null);t&&Array.isArray(t)?this.matrix=t:this.matrix=[],this.setupMatrix()},immediate:!0},value:{handler(){this.items=this.value},immediate:!0},matrix:{handler(){H.isEqual(this.$parent.transientData[this.name],this.matrix)||this.$set(this.$parent.transientData,this.name,H.cloneDeep(this.matrix))},deep:!0},times(){this.setupMatrix()},"config.settings.times":{handler(){this.additionalItems=0}}},mounted(){this.$set(this.$parent.transientData,this.name,H.cloneDeep(this.matrix))},methods:{getLoopContext(t){let e=`${this.name}.${t.toString()}`;return this.parentLoopContext!==""&&(e=`${this.parentLoopContext}.${e}`),e},add(){this.config.settings.type==="existing"?this.setMatrixValue(this.matrix.length,{}):this.additionalItems++},remove(){this.config.settings.type==="existing"?this.$delete(this.matrix,this.matrix.length-1):this.additionalItems--},removeConfirm(){const t=this.$t("Are you sure you want to delete this?");window.ProcessMaker.confirmModal(this.$t("Caution!"),t,"",()=>{this.remove()})},setMatrixValue(t,e){const r=H.omit(e,"_parent");this.registerParentVariableChanges(e),this.$set(this.matrix,t,r),this.setChagnedParentVariables()},registerParentVariableChanges(t){t._parent&&Object.keys(t._parent).forEach(e=>{H.isEqual(this.transientDataCopy[e],t._parent[e])||this.parentObjectChanges.push({key:e,value:t._parent[e]})})},setChagnedParentVariables(){this.parentObjectChanges.forEach(t=>{this.$set(this.$parent.transientData,t.key,t.value)}),this.parentObjectChanges=[]},getMatrixValue(t){let e=H.cloneDeep(this.matrix[t]);return e||(e={}),e._parent=H.cloneDeep(this.transientDataCopy),e},setupMatrix(){for(const t of this.times)typeof this.matrix[t]>"u"&&this.setMatrixValue(t,{});this.matrix.length!==this.times.length&&(this.matrix=this.matrix.slice(0,this.times.length))},submit(){this.$emit("submit")}}};var u7=function(){var e=this,r=e._self._c;return r("div",[e._l(e.times,function(a){return r("form",{key:a,on:{submit:function(i){i.preventDefault()}}},[r("vue-form-renderer",{attrs:{data:e.getMatrixValue(a),config:e.rendererConfig,computed:null,"custom-css":null,watchers:null,"is-loop":!0,"debug-context":"Loop #"+a,mode:e.mode,"loop-context":e.getLoopContext(a),"form-config":e.formConfig},on:{submit:e.submit,pageNavigate:function(i){return e.$emit("pageNavigate",i)},update:function(i){return e.setMatrixValue(a,i)}}})],1)}),e.config.settings.add?r("b-row",{staticClass:"justify-content-md-center"},[r("b-col",{attrs:{md:"auto"}},[r("b-button",{staticClass:"ml-1 mr-1",attrs:{size:"sm",variant:"secondary",title:e.$t("Add Item")},on:{click:e.add}},[r("i",{staticClass:"fas fa-plus"})]),e.times.length>0?r("b-button",{staticClass:"ml-1 mr-1",attrs:{size:"sm",variant:"outline-danger",title:e.$t("Delete Item")},on:{click:e.removeConfirm}},[r("i",{staticClass:"fas fa-minus"})]):e._e()],1)],1):e._e()],2)},c7=[],d7=oe(l7,u7,c7,!1,null,null,null,null);const xs=d7.exports,Cte="",pu=typeof window>"u"?global:window,Hp=[{name:"empty",items:[]}],p7={components:{VueFormRenderer:Gi},props:{name:String,screen:Number,value:null,validationData:null,_parent:null,ancestorScreens:{type:Array,default:()=>[]}},data(){return{localData:{},config:Hp,computed:[],customCSS:null,watchers:[],screenTitle:null}},computed:{validatedConfig(){return this.config&&this.config[0]?this.config:Hp},data:{get(){return this.validationData||this.localData},set(t){Object.keys(t).forEach(e=>{this.validationData&&this.$set(this.validationData,e,t[e])})}},placeholder(){return this.screen?"":this.$t("Select a screen to nest")}},methods:{isSubmitButton(t){return t.config&&t.component==="FormButton"&&t.config.event==="submit"},hideSubmitButtons(t){t.forEach(e=>{Array.isArray(e)&&this.hideSubmitButtons(e),e.items&&this.hideSubmitButtons(e.items),this.isSubmitButton(e)&&(e.config.hidden=!0)})},disableForm(t){t.forEach(e=>{Array.isArray(e)&&this.disableForm(e),e.items&&this.disableForm(e.items),e&&e.config&&(e.config.disabled=!0,e.config.readonly=!0,e.config.editable=!1)})},loadScreen(t){this.config=Hp,this.computed=[],this.customCSS=null,this.watchers=[],this.screenTitle=null,t&&this.$dataProvider.getScreen(t).then(e=>{this.config=e.data.config,this.hideSubmitButtons(this.config),this.computed=e.data.computed,this.customCSS=e.data.custom_css,this.watchers=e.data.watchers,this.screenTitle=e.data.title,this.$attrs.disabled&&this.disableForm(this.config),this.ancestorScreens.includes(this.screenTitle)?pu.ProcessMaker.alert(`Rendering of nested "${this.screenTitle}" screen was disallowed to prevent loop.`,"warning"):(pu.nestedScreens||(pu.nestedScreens={}),pu.nestedScreens["id_"+t]=this.config,this.$root.$emit("nested-screen-updated"))})},errors(){return this.$refs.nestedScreen.isValid(),this.$refs.nestedScreen.errors}},watch:{screen(t){this.loadScreen(t)}},mounted(){this.loadScreen(this.screen)}};var f7=function(){var e=this,r=e._self._c;return e.ancestorScreens.includes(e.screenTitle)?e._e():r("vue-form-renderer",{ref:"nestedScreen",staticClass:"form-nested-screen",attrs:{placeholder:e.placeholder,config:e.validatedConfig,"ancestor-screens":[...e.ancestorScreens,e.screenTitle],mode:"preview",computed:e.computed,"custom-css":e.customCSS,watchers:e.watchers,"debug-context":"Nested Screen",_parent:e._parent},on:{"css-errors":function(a){e.cssErrors=a}},model:{value:e.data,callback:function(a){e.data=a},expression:"data"}})},h7=[],m7=oe(p7,f7,h7,!1,null,null,null,null);const ks=m7.exports,Tte="",g7={key:"__actions",label:"Actions",thClass:"text-right",tdClass:"text-right"},v7={components:{VueFormRenderer:Gi},mixins:[Md],props:["name","label","fields","value","editable","_config","form","validationData","formConfig","formComputed","formWatchers","_perPage"],data(){return{editFormVersion:0,single:"",plural:"",addItem:{},editItem:{},editIndex:null,currentPage:1,paginatorPage:1,perPageSelectEnabled:!1,perPage:5,lastPage:1,css:{tableClass:"table table-hover table-responsive text-break mb-0 d-table",loadingClass:"loading",detailRowClass:"vuetable-detail-row",handleIcon:"grey sidebar icon",sortableIcon:"fas fa-sort",ascendingIcon:"fas fa-sort-up",descendingIcon:"fas fa-sort-down",ascendingClass:"ascending",descendingClass:"descending",renderIcon(t){return`<i class="${t.join(" ")}"></i>`}},initFormValues:{},currentRowIndex:null}},computed:{popupConfig(){const t=[];return t[this.form]=this.formConfig[this.form],t},debug(){return{perPageSelectEnabled:this.perPageSelectEnabled,perPageSelectEnabled2:this.$refs.pagination&&this.$refs.pagination.perPageSelectEnabled}},parentObj(){let t=this.$parent;for(;"transientData"in t.$props;)t=t.$parent;return t},dataManager(){if(this.$refs.vuetable){const t=this.$refs.vuetable.makePagination(this.value.length);return{pagination:t,data:this.value.slice(t.from-1,t.to)}}console.log("refs vuetable not exists")},tableData(){const t=this.value||[],e=this.paginatorPage-1;return this.lastPage=Math.ceil(t.length/this.perPage),{total:t.length,per_page:this.perPage,current_page:this.paginatorPage,last_page:this.lastPage,next_page_url:null,prev_page_url:null,from:e,to:t.length,data:t,lastSortConfig:!1}},tableFields(){const t=this.getTableFieldsFromDataSource();return this.editable&&!this.selfReferenced&&t.push(g7),t},selfReferenced(){return this.form&&this.form===this.$parent.currentPage}},watch:{"tableData.total":{deep:!0,handler(t){const e=Math.ceil(t/this.perPage);this.currentPage=this.currentPage>e?e:this.currentPage,this.currentPage=this.currentPage==0?1:this.currentPage}}},mounted(){this._perPage&&(this.perPage=this._perPage),this.updateRowDataNamePrefix=H.debounce(this.updateRowDataNamePrefix,100)},methods:{updateRowDataNamePrefix(){this.setUploadDataNamePrefix(this.currentRowIndex)},emitShownEvent(){window.ProcessMaker.EventBus.$emit("modal-shown")},formatIfDate(t){return ee.dateUtils.formatIfDate(t)},isImage(t,e){const r=H.get(e,t.key);return typeof r=="string"&&r.substr(0,11)==="data:image/"},isWebEntryFile(t,e){const r=H.get(e,t.key),a=/^webentry_.*:*$/;let i=r;return Array.isArray(r)&&(i=r[0].file),a.test(i)},formatIfWebEntryFile(t,e){return H.get(window,"PM4ConfigOverrides.requestFiles",{})[`${t.key}.${e.row_id}`].map(i=>i.file_name).join(", ")},isFiledownload(t){return t.key==="__filedownload"},setUploadDataNamePrefix(t=null){this.currentRowIndex=t;let e=null;t!==null&&this.editItem?e=this.editItem.row_id:this.addItem&&(e=this.addItem.row_id),this.$root.$emit("set-upload-data-name",this,t,e)},getTableFieldsFromDataSource(){const{jsonData:t,key:e,value:r,dataName:a}=this.fields,i=n=>({key:n[e||"value"],sortable:!0,label:n[r||"content"],tdClass:"table-column"});return this.getValidFieldData(t,a).map(i)},getValidFieldData(t,e){let r=this.validationData[e];if(t)try{r=JSON.parse(t)}catch{r=[]}return Array.isArray(r)?r:[]},hideInformation(){this.$refs.infoModal.hide()},onPaginationData(t){this.$refs.pagination.setPaginationData(t)},onChangePerPage(t){this.perPage=parseInt(t)},onChangePage(t){t=="next"?this.paginatorPage+=1:t=="prev"?this.paginatorPage-=1:this.paginatorPage=t,this.paginatorPage<=0&&(this.paginatorPage=1),this.paginatorPage>this.lastPage&&(this.paginatorPage=this.lastPage)},showEditForm(t,e){const r=(this.currentPage-1)*this.perPage+t;this.editItem=JSON.parse(JSON.stringify(H.find(this.tableData.data,{row_id:e}))),this.editIndex=r,this.editFormVersion++,this.$nextTick(()=>{this.setUploadDataNamePrefix(r),this.$refs.editModal.show()})},edit(t){if(this.$refs.addRenderer.hasSubmitted(!0),this.$refs.editRenderer.$refs.renderer.$refs.component.$v.vdata.$invalid){t.preventDefault();return}const e=this.tableData.data?JSON.parse(JSON.stringify(this.tableData.data)):[],r=H.findIndex(e,{row_id:this.editItem.row_id});e[r]=JSON.parse(JSON.stringify(this.editItem)),delete e[r]._parent,this.$emit("input",e)},showAddForm(){const t=Math.random().toString(36).substring(2)+Date.now().toString(36);if(this.$set(this.addItem,"row_id",t),this.setUploadDataNamePrefix(),!this.form){this.$refs.infoModal.show();return}this.$refs.addModal.show();const{_parent:e,...r}=this.addItem;this.initFormValues=H.cloneDeep(r)},handleHideAddModal(){this.addItem=this.initFormValues,this.$refs.addRenderer.hasSubmitted(!1)},async handleOk(t){if(this.$refs.addRenderer.hasSubmitted(!0),t.preventDefault(),this.$refs.addRenderer.$refs.renderer.$refs.component.$v.vdata.$invalid)return;const e=this.value?JSON.parse(JSON.stringify(this.value)):[],r=JSON.parse(JSON.stringify({...this.addItem,_parent:void 0}));delete r._parent,e[e.length]=r,this.$emit("input",e),this.addItem={},this.$nextTick(()=>{this.$refs.addModal.hide()})},showDeleteConfirmation(t,e){this.deleteIndex=H.find(this.tableData.data,{row_id:e}),this.$refs.deleteModal.show()},downloadFile(t,e,r){const a=this.$root.task.request_data._request.id,i=`${this.name}.${r}.${e}`;window.ProcessMaker.apiClient.get(`requests/${a}/files?name=${i}`).then(n=>{const s=n.data;if(s&&s.data&&s.data.length){const o=s.data[0];this.downloadRecordListFile(o,a)}})},downloadRecordListFile(t,e){window.ProcessMaker.apiClient({baseURL:"/",url:`/request/${e}/files/${t.id}`,method:"GET",responseType:"blob"}).then(r=>{const a=window.URL.createObjectURL(new Blob([r.data])),i=document.createElement("a");i.href=a,i.setAttribute("download",t.file_name),document.body.appendChild(i),i.click()})},remove(){const t=this.tableData.data?JSON.parse(JSON.stringify(this.tableData.data)):[],e=this.deleteIndex;H.remove(t,{row_id:this.deleteIndex.row_id}),this.$emit("input",t),this.$root.$emit("removed-record",this,e)}}};var b7=function(){var e=this,r=e._self._c;return r("div",{staticClass:"data-table overflow-auto"},[r("div",{staticClass:"row mb-2 ml-0 mr-0"},[r("div",{staticClass:"col"},[r("h4",[e._v(e._s(e.label))])]),r("div",{staticClass:"col text-right"},[e.editable&&!e.selfReferenced?r("button",{staticClass:"btn btn-primary",attrs:{"data-cy":"add-row"},on:{click:e.showAddForm}},[e._v(" "+e._s(e.$t("Add"))+" ")]):e._e()])]),e.value?[r("b-table",{ref:"vuetable",attrs:{"per-page":e.perPage,"data-manager":e.dataManager,fields:e.tableFields,items:e.tableData.data,"sort-compare-options":{numeric:!1},"sort-null-last":!0,"sort-icon-left":"",css:e.css,"empty-text":e.$t("No Data Available"),"current-page":e.currentPage,"data-cy":"table"},scopedSlots:e._u([{key:"cell()",fn:function({index:a,field:i,item:n}){return[e.isFiledownload(i,n)?[r("span",{attrs:{href:"#"},on:{click:function(s){return e.downloadFile(n,i.key,a)}}},[e._v(e._s(e.mustache(i.key,n)))])]:e.isImage(i,n)?[r("img",{staticStyle:{},attrs:{src:e.mustache(i.key,n)}})]:e.isWebEntryFile(i,n)?[e._v(" "+e._s(e.formatIfWebEntryFile(i,n))+" ")]:[e._v(" "+e._s(e.formatIfDate(e.mustache(i.key,n)))+" ")]]}},{key:"cell(__actions)",fn:function({index:a,item:i}){return[r("div",{staticClass:"actions"},[r("div",{staticClass:"btn-group btn-group-sm",attrs:{role:"group","aria-label":"Actions"}},[r("button",{staticClass:"btn btn-primary",attrs:{title:e.$t("Edit"),"data-cy":"edit-row"},on:{click:function(n){return e.showEditForm(a,i.row_id)}}},[r("i",{staticClass:"fas fa-edit"})]),r("button",{staticClass:"btn btn-danger",attrs:{title:e.$t("Delete"),"data-cy":"remove-row"},on:{click:function(n){return e.showDeleteConfirmation(a,i.row_id)}}},[r("i",{staticClass:"fas fa-trash-alt"})])])])]}}])}),e.tableData.total>e.perPage?r("b-pagination",{attrs:{"data-cy":"table-pagination","total-rows":e.tableData.total,"per-page":e.perPage,"aria-label":e.$t("Pagination"),"aria-controls":"vuetable"},on:{change:e.onChangePage},model:{value:e.currentPage,callback:function(a){e.currentPage=a},expression:"currentPage"}}):e._e()]:r("div",[e._v(" "+e._s(e.$t("This record list is empty or contains no data."))+" ")]),e.editable&&!e.selfReferenced?r("b-modal",{ref:"addModal",attrs:{static:!0,size:"lg","ok-title":e.$t("Ok"),"cancel-title":e.$t("Cancel"),title:e.$t("Add"),"header-close-content":"×","data-cy":"modal-add"},on:{ok:e.handleOk,hidden:e.handleHideAddModal,shown:e.emitShownEvent}},[r("vue-form-renderer",{key:Array.isArray(e.value)?e.value.length:0,ref:"addRenderer",attrs:{page:0,config:e.popupConfig,"current-page":e.form,computed:e.formComputed,watchers:e.formWatchers,"debug-context":"Record List Add",_parent:e.validationData},on:{update:e.updateRowDataNamePrefix},model:{value:e.addItem,callback:function(a){e.addItem=a},expression:"addItem"}})],1):e._e(),e.editable&&!e.selfReferenced?r("b-modal",{ref:"editModal",attrs:{static:!0,size:"lg","ok-title":e.$t("Save"),"cancel-title":e.$t("Cancel"),title:e.$t("Edit Record"),"header-close-content":"×","data-cy":"modal-edit"},on:{ok:e.edit,hidden:function(a){return e.$refs.addRenderer.hasSubmitted(!1)},shown:e.emitShownEvent}},[r("vue-form-renderer",{key:e.editFormVersion,ref:"editRenderer",attrs:{page:0,config:e.popupConfig,"current-page":e.form,computed:e.formComputed,watchers:e.formWatchers,"debug-context":"Record List Edit",_parent:e.validationData},on:{update:e.updateRowDataNamePrefix},model:{value:e.editItem,callback:function(a){e.editItem=a},expression:"editItem"}})],1):e._e(),e.editable&&!e.selfReferenced?r("b-modal",{ref:"deleteModal",attrs:{size:"lg","ok-title":e.$t("Delete"),"cancel-title":e.$t("Cancel"),title:e.$t("Delete Record"),"header-close-content":"×","data-cy":"modal-remove"},on:{ok:e.remove}},[r("p",[e._v(e._s(e.$t("Are you sure you want to remove this record?")))])]):e._e(),e.editable&&!e.selfReferenced?r("b-modal",{ref:"infoModal",attrs:{size:"sm","ok-title":e.$t("OK"),title:e.$t("Information form"),"header-close-content":"×","ok-only":"","data-cy":"modal-not-assigned"},on:{ok:e.hideInformation}},[r("p",[e._v(e._s(e.$t("The form to be displayed is not assigned.")))])]):e._e(),e.editable&&e.selfReferenced?r("div",{staticClass:"alert alert-danger"},[e._v(" "+e._s(e.$t("The Record List control is not allowed to reference other controls on its own page to add or edit records. Specify a secondary page with controls to enter records."))+" ")]):e._e()],2)},y7=[],S7=oe(v7,b7,y7,!1,null,null,null,null);const fu=S7.exports,x7={name:"FormRecordListStatic",components:{},mixins:[Md],props:["label","fields","value","editable","_config","form"],mounted(){},methods:{formatIfDate(t){return ee.formatIfDate(t)}}};var k7=function(){var e=this,r=e._self._c;return r("div",{staticClass:"record-list"},[r("h4",[e._v(e._s(e.$t(e.label)))]),r("table",[r("thead",[r("tr",e._l(e.fields,function(a,i){return r("th",{key:i},[e._v(" "+e._s(a.content)+" ")])}),0)]),r("tbody",e._l(e.value,function(a,i){return r("tr",{key:i},e._l(e.fields,function(n,s){return r("td",{key:s},[e._v(" "+e._s(e.formatIfDate(e.mustache(n.value,a)))+" ")])}),0)}),0)])])},_7=[],w7=oe(x7,k7,_7,!1,null,null,null,null);const Sx=w7.exports,C7={props:["label","fontSize","fontWeight","textAlign","verticalAlign","validationData","color","name"],computed:{styles(){return{fontSize:this.fontSize,fontWeight:this.fontWeight,textAlign:this.textAlign,verticalAlign:this.verticalAlign,color:this.color}},rendered(){if(!this.validationData)return this.label;try{return _r.render(this.label,this.validationData)}catch{return this.label}}}};var T7=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("div",{style:e.styles,domProps:{innerHTML:e._s(e.rendered)}})])},A7=[],O7=oe(C7,T7,A7,!1,null,null,null,null);const hu=O7.exports,E7={};var M7=function(){var e=this,r=e._self._c;return r("div",{staticClass:"row"},[e._t("default")],2)},$7=[],P7=oe(E7,M7,$7,!1,null,null,null,null);const Yp=P7.exports,D7="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQ2IiBoZWlnaHQ9IjE1MyIgdmlld0JveD0iMCAwIDE0NiAxNTMiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMTUuMDAxIDMzLjQ5OTZDMTE1LjAwMSA0MC4xMjczIDEyMC4zNzQgNDUuNSAxMjcuMDAxIDQ1LjVDMTMzLjYyOCA0NS41IDEzOS4wMDEgNDAuMTI3MyAxMzkuMDAxIDMzLjQ5OTZDMTM5LjAwMSAyNi44NzI3IDEzMy42MjggMjEuNSAxMjcuMDAxIDIxLjVDMTIwLjM3NCAyMS41IDExNS4wMDEgMjYuODcyNyAxMTUuMDAxIDMzLjQ5OTZaIiBmaWxsPSIjN0NEMEIwIi8+CjxwYXRoIGQ9Ik0xMjcuOTA3IDI2LjkzMjNMMTI5LjEwOCAzMC42MzA0SDEzMi45OThDMTMzLjYwMyAzMC42MzA0IDEzMy44NTYgMzEuNDA1MyAxMzMuMzY1IDMxLjc2MjFMMTMwLjIxOSAzNC4wNDc0TDEzMS40MjEgMzcuNzQ2NEMxMzEuNjA4IDM4LjMyMTkgMTMwLjk0OSAzOC44MDA3IDEzMC40NTkgMzguNDQ1N0wxMjcuMzEyIDM2LjE1ODdMMTI0LjE2NiAzOC40NDU3QzEyMy42NzcgMzguODAwNyAxMjMuMDE3IDM4LjMyMTkgMTIzLjIwNCAzNy43NDY0TDEyNC40MDYgMzQuMDQ3NEwxMjEuMjYgMzEuNzYyMUMxMjAuNzcgMzEuNDA1MyAxMjEuMDIyIDMwLjYzMDQgMTIxLjYyNyAzMC42MzA0SDEyNS41MTZMMTI2LjcxOCAyNi45MzIzQzEyNi45MDYgMjYuMzU1OSAxMjcuNzIgMjYuMzU1OSAxMjcuOTA3IDI2LjkzMjNaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNODIuMzQ5MSAwLjc5Mjk2OUM3OS44NTk3IDguMjYwOTcgNzQuMTkwNCA5LjA5MDI5IDc0LjE5MDQgOS4wOTAyOUM3NC4xOTA0IDkuMDkwMjkgNzkuODU5NyA5LjkyMDk3IDgyLjM0OTEgMTcuMzg3NkM4NC44Mzg0IDkuOTIwOTcgOTAuNTA3OCA5LjA5MDI5IDkwLjUwNzggOS4wOTAyOUM5MC41MDc4IDkuMDkwMjkgODQuODM4NCA4LjI2MDk3IDgyLjM0OTEgMC43OTI5NjlaIiBmaWxsPSIjREVFRkZBIi8+CjxwYXRoIGQ9Ik00OS4zNTA0IDEzNS43OTNDNDYuODU5OCAxNDMuMjYxIDQxLjE5MDQgMTQ0LjA5IDQxLjE5MDQgMTQ0LjA5QzQxLjE5MDQgMTQ0LjA5IDQ2Ljg1OTggMTQ0LjkyIDQ5LjM1MDQgMTUyLjM4OEM1MS44Mzg0IDE0NC45MiA1Ny41MDkxIDE0NC4wOSA1Ny41MDkxIDE0NC4wOUM1Ny41MDkxIDE0NC4wOSA1MS44Mzg0IDE0My4yNjEgNDkuMzUwNCAxMzUuNzkzWiIgZmlsbD0iI0RFRUZGQSIvPgo8cGF0aCBkPSJNMTM5LjkwMiA5My43OTNDMTM4LjE1OCA5OS4wMjEgMTM0LjE5IDk5LjYwMjMgMTM0LjE5IDk5LjYwMjNDMTM0LjE5IDk5LjYwMjMgMTM4LjE1OCAxMDAuMTgyIDEzOS45MDIgMTA1LjQwOUMxNDEuNjQ1IDEwMC4xODIgMTQ1LjYxMyA5OS42MDIzIDE0NS42MTMgOTkuNjAyM0MxNDUuNjEzIDk5LjYwMjMgMTQxLjY0NSA5OS4wMjEgMTM5LjkwMiA5My43OTNaIiBmaWxsPSIjREVFRkZBIi8+CjxwYXRoIGQ9Ik04LjkwMTEyIDMwLjc5M0M3LjE1OTc5IDM2LjAxOTYgMy4xOTA0MyAzNi42MDEgMy4xOTA0MyAzNi42MDFDMy4xOTA0MyAzNi42MDEgNy4xNTk3OSAzNy4xODEgOC45MDExMiA0Mi40MDc2QzEwLjY0MzggMzcuMTgxIDE0LjYxMzEgMzYuNjAxIDE0LjYxMzEgMzYuNjAxQzE0LjYxMzEgMzYuNjAxIDEwLjY0MzggMzYuMDE5NiA4LjkwMTEyIDMwLjc5M1oiIGZpbGw9IiNERUVGRkEiLz4KPHBhdGggZD0iTTEyMS45NTYgNzUuNjcwMkMxMjEuOTU2IDEwNC44NzYgOTguMjc4NSAxMjguNTUzIDY5LjA3MzIgMTI4LjU1M0MzOS44Njc5IDEyOC41NTMgMTYuMTkwNCAxMDQuODc2IDE2LjE5MDQgNzUuNjcwMkMxNi4xOTA0IDQ2LjQ2NDkgMzkuODY3OSAyMi43OTMgNjkuMDczMiAyMi43OTNDOTguMjc4NSAyMi43OTMgMTIxLjk1NiA0Ni40NjQ5IDEyMS45NTYgNzUuNjcwMloiIGZpbGw9IiNERUVGRkEiLz4KPHBhdGggZD0iTTQ3LjYzNjQgODEuOTYyNUw2My4yNDYzIDkzLjM2ODdDNjQuNzg5NyA5NC40OTYyIDY2Ljk1NyA5NC4yMDA3IDY4LjEzOTMgOTIuNjk1NUw5MS42OTA4IDYyLjc4NDFDOTIuOTA1OCA2MS4yMzUxIDkyLjY0MzEgNTkuMDAyMSA5MS4wOTQxIDU3Ljc4N0M4OS41NTA3IDU2LjU3MTkgODcuMzE3NiA1Ni44MzQ3IDg2LjEwMjYgNTguMzc4MUw2NC42NzQ3IDg1LjYwMjFMNTEuODM0NiA3Ni4yMTU1QzUwLjI0NzMgNzUuMDYwNiA0OC4wMTk2IDc1LjQwNTUgNDYuODU5MiA3Ni45OTI3QzQ1LjcwNDQgNzguNTc5OSA0Ni4wNDkyIDgwLjgwMjEgNDcuNjM2NCA4MS45NjI1WiIgZmlsbD0iIzREODJDNiIvPgo8cGF0aCBkPSJNMC40MDAzOTEgMTI1Ljc1QzAuNDAwMzkxIDEzMy42MiA2Ljc4MDM5IDE0MCAxNC42NTEgMTQwQzIyLjUyMjUgMTQwIDI4LjkwMzQgMTMzLjYyIDI4LjkwMzQgMTI1Ljc1QzI4LjkwMzQgMTE3Ljg3OSAyMi41MjI1IDExMS41IDE0LjY1MSAxMTEuNUM2Ljc4MDM5IDExMS41IDAuNDAwMzkxIDExNy44NzkgMC40MDAzOTEgMTI1Ljc1WiIgZmlsbD0iIzc3QTlGMiIvPgo8cGF0aCBkPSJNMTYuMzE4NyAxMzAuMzI5QzE0LjE2MjUgMTMwLjM2NiAxMS45Nzk0IDEzMC4zOTUgOS45OTY5NSAxMzAuMjU4QzkuMzY5ODggMTMwLjIxNSA4LjgyNyAxMjkuMjE3IDkuNTg5MzQgMTI4LjkwM0M5LjI2ODY0IDEyOC43MzggOC45NDM1IDEyOC41NzkgOC44MDM3NSAxMjguMjE5QzguNjcxMTcgMTI3Ljg4IDguODI5NyAxMjcuNDE3IDkuMTg1MzQgMTI3LjMzQzguNDM3MzMgMTI3LjUxNCA4LjE0MjYxIDEyNi4zMjggOC43MjU3OCAxMjUuOTQ1QzguNDE2NzMgMTI1LjY4MiA4LjE1OTY1IDEyNS4zMzUgOC4wOTUxNSAxMjQuOTM1QzguMDI5NzUgMTI0LjUzNCA4LjE5MzY4IDEyNC4wODIgOC41NTAyMiAxMjMuODg4QzguNzg0MDMgMTIzLjc2MSA5LjA2MDg0IDEyMy43NTcgOS4zMjY4OSAxMjMuNzU1QzEwLjIyMzYgMTIzLjc0OCAxMS4xMjAzIDEyMy43NDEgMTIuMDE3IDEyMy43MzRDMTEuNzc0MiAxMjIuMzMyIDExLjcwMDggMTIwLjgwMyAxMi40MTM4IDExOS41NzFDMTIuNjI4OCAxMTkuMTk5IDEzLjIwNTggMTE4Ljc1NSAxMy42NjM1IDExOS4wNEMxNC4wOTI2IDExOS4zMDggMTMuOTc0MyAxMTkuOTczIDEzLjk1MTkgMTIwLjM5M0MxMy44NjMzIDEyMi4xMzggMTQuODU1OSAxMjMuODkzIDE2LjM5NzYgMTI0LjcxNUMxNi4zOTc2IDEyNC43MTUgMTYuMjk1NCAxMjguNDMzIDE2LjMxODcgMTMwLjMyOVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xNy4xMDI1IDEzMC4zMTVIMjAuMzYxNVYxMjQuNzA3SDE3LjEwMjVWMTMwLjMxNVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=",Ate="",I7={props:["title","link","url"],data(){return{linkText:`View All ${this.link}`}},methods:{openLink(){window.open(this.url,"_blank")}}};var z7=function(){var e=this,r=e._self._c;return r("div",{staticClass:"container content"},[r("img",{attrs:{src:D7,alt:"empty table"}}),r("span",{staticClass:"title"},[e._v(" "+e._s(e.$t(e.title))+" ")]),e.url!==""?r("b-link",{on:{click:function(a){return e.openLink()}}},[e._v(" "+e._s(e.$t(e.linkText))+" ")]):e._e()],1)},L7=[],j7=oe(I7,z7,L7,!1,null,"7665402d",null,null);const Qp=j7.exports,N7=vn(),R7={components:{formEmpty:Qp},mixins:[N7,ic],data(){return{countInProgress:"0",countOverdue:"0",countResponse:"0",fields:[],data:[],tableData:[],orderBy:"ID",order_direction:"DESC",status:"",showTable:!0,sortOrder:[{field:"ID",sortField:"ID",direction:"DESC"}],tasksPreview:window.SharedComponents&&window.SharedComponents.TasksHome||{}}},computed:{noDataUrl(){var t,e;return`${(e=(t=window.ProcessMaker)==null?void 0:t.app)==null?void 0:e.url}/tasks`}},mounted(){this.setFields(),this.pmql=`(user_id = ${ProcessMaker.user.id}) AND (status = "In Progress")`,this.fetch(),this.$root.$on("dropdownSelectionTask",this.fetchData),this.$root.$on("searchTask",this.fetchSearch)},methods:{getSortParam(){return this.sortOrder instanceof Array&&this.sortOrder.length>0?`&order_by=${this.sortOrder[0].sortField}&order_direction=${this.sortOrder[0].direction}`:""},fetch(){Vue.nextTick(()=>{let t="",e="";this.pmql!==void 0&&(t=this.pmql),this.filterDropdowns!==void 0&&(e=this.filterDropdowns);let{filter:r}=this,a="";r&&r.length&&(r.isPMQL()?(t=`(${t}) and (${r})`,r=""):a=`&user_id=${window.ProcessMaker.user.id}&filter=${r}&statusfilter=ACTIVE,CLOSED`),this.previousFilter!==r&&(this.page=1),this.previousFilter=r,this.previousPmql!==t&&(this.page=1),this.previousPmql=t;const i=[];ProcessMaker.apiClient.get(`tasks?page=${this.page}&include=process,processRequest,processRequest.user,user,data&pmql=${encodeURIComponent(t)}&per_page=${this.perPage}${a}${this.getSortParam()}&non_system=true&${e}`).then(n=>{this.showTable=n.data.data.length!==0,this.tableData=n.data,this.countResponse=this.tableData.meta.total,this.countOverdue=`${this.tableData.meta.in_overdue}`,i.push(this.countOverdue),this.countInProgress=`${this.tableData.meta.total}`,i.push(this.countInProgress);const s={count:`${this.countResponse}`,showControl:!0,showAvatar:!0,variant:"warning",textColor:"text-warning",colorText:"color: #ff9900",url:"/tasks",dropdownShow:"tasks"};this.$emit("tasksCount",{dataControls:s,tasksDropdown:i})}).catch(()=>{this.tableData=[]})})},getColumns(){const t=[{label:"Task",field:"task",sortable:!0,default:!0},{label:"Request",field:"request",sortable:!0,default:!0}];return this.status==="CLOSED"?t.push({label:"Completed",field:"completed_at",sortable:!0,default:!0}):t.push({label:"Due",field:"due_at",sortable:!0,default:!0}),t},setFields(){this.getColumns().forEach(e=>{const r={title:()=>this.$t(e.label)};switch(e.field){case"task":r.name="__slot:name",r.field="element_name",r.sortField="element_name";break;case"request":r.name="__slot:requestName",r.sortField="process_requests.id,process_requests.name";break;case"due_at":r.name="__slot:dueDate";break;case"completed_at":r.name="__slot:completedDate";break;default:r.name=e.field}r.field||(r.field=e.field),(e.format==="datetime"||e.format==="date")&&(r.callback="formatDate"),e.sortable&&!r.sortField&&(r.sortField=e.field),this.fields.push(r)}),this.fields.push({name:"__slot:preview",title:""}),this.$nextTick(()=>{this.$refs.vuetable.normalizeFields()})},formatDate(t,e){return e=e||"",t?window.moment(t).format(e):"n/a"},onAction(t,e,r){let a="";return t==="edit"&&(a=`/tasks/${e.id}/edit`),t==="showRequestSummary"&&(a=`/requests/${e.process_request.id}`),a},previewTasks(t){this.$refs["preview-sidebar"].showSideBar(t,this.tableData.data,!0)},classDueDate(t){const e=moment(t),r=moment(),a=e.diff(r,"hours");return a<0?"text-danger":a<=1?"text-warning":"text-dark"},fetchData(t){(t==="In Progress"||t==="all")&&(this.filterDropdowns="",this.pmql=`(user_id = ${ProcessMaker.user.id}) AND (status = "In Progress")`),t==="Overdue"&&(this.filterDropdowns="overdue=true"),this.fetch()},fetchSearch(t){this.pmql="",this.pmql=t,this.fetch()}}};var F7=function(){var e=this,r=e._self._c;return e.showTable?r("div",[r("vuetable",{ref:"vuetable",attrs:{"data-manager":e.dataManager,"sort-order":e.sortOrder,"api-mode":!1,fields:e.fields,data:e.tableData,css:e.css,"data-path":"data","pagination-path":"meta"},scopedSlots:e._u([{key:"name",fn:function(a){return[r("b-link",{directives:[{name:"uni-id",rawName:"v-uni-id",value:a.rowData.id.toString(),expression:"props.rowData.id.toString()"}],attrs:{href:e.onAction("edit",a.rowData,a.rowIndex)}},[e._v(" "+e._s(a.rowData.element_name)+" ")])]}},{key:"requestName",fn:function(a){return[r("b-link",{attrs:{href:e.onAction("showRequestSummary",a.rowData,a.rowIndex)}},[e._v(" #"+e._s(a.rowData.process_request.id)+" "+e._s(a.rowData.process_request.name)+" ")])]}},{key:"dueDate",fn:function(a){return[r("span",{class:e.classDueDate(a.rowData.due_at)},[e._v(" "+e._s(e.formatDate(a.rowData.due_at))+" ")])]}},{key:"completedDate",fn:function(a){return[r("span",{staticClass:"text-dark"},[e._v(" "+e._s(e.formatDate(a.rowData.completed_at))+" ")])]}},{key:"preview",fn:function(a){return[r("span",[r("i",{staticClass:"fa fa-eye",on:{click:function(i){return e.previewTasks(a.rowData)}}})])]}}],null,!1,4211731584)}),r(e.tasksPreview,{ref:"preview-sidebar",tag:"component"})],1):r("div",[r("formEmpty",{attrs:{link:"Tasks",title:"No tasks in sight",url:e.noDataUrl}})],1)},q7=[],B7=oe(R7,F7,q7,!1,null,null,null,null);const Kp=B7.exports,W7=vn(),V7={components:{formEmpty:Qp},mixins:[W7,ic],data(){return{countResponse:"0",fields:[],filter:"",data:[],tableData:[],orderBy:"id",orderDirection:"DESC",additionalParams:"",showTable:!0,sortOrder:[{field:"id",sortField:"id",direction:"desc"}]}},computed:{noDataUrl(){var t,e;return`${(e=(t=window.ProcessMaker)==null?void 0:t.app)==null?void 0:e.url}/requests`}},mounted(){this.setFields(),this.pmql=`requester = "${Processmaker.user.username}"`,this.fetch(),this.$root.$on("dropdownSelectionRequest",this.fetchData),this.$root.$on("searchRequest",this.fetchSearch)},methods:{fetch(){Vue.nextTick(()=>{let t="";this.pmql!==void 0&&(t=this.pmql);let{filter:e}=this;e&&e.length&&e.isPMQL()&&(t=`(${t}) and (${e})`,e=""),this.previousFilter!==e&&(this.page=1),this.previousFilter=e,this.previousPmql!==t&&(this.page=1),this.previousPmql=t,ProcessMaker.apiClient.get(`requests?page=${this.page}&include=process,participants,data&pmql=${encodeURIComponent(t)}
|
|
340
|
-
&per_page=${this.perPage}&filter=${e}&order_by=${this.orderBy==="__slot:ids"?"id":this.orderBy}&order_direction=${this.orderDirection}${this.additionalParams}`).then(r=>{this.showTable=r.data.data.length!==0;for(const n of r.data.data)n.status=this.formatStatus(n.status);this.tableData=r.data,this.countResponse=this.tableData.meta.total;const a={count:`${this.countResponse}`,showControl:!0,showAvatar:!0,variant:"primary",textColor:"text-primary",colorText:"color: #1572C2",url:"/requests",dropdownShow:"requests"},i=[];this.$emit("requestsCount",{dataControls:a,tasksDropdown:i})}).catch(()=>{this.tableData=[]})})},setFields(){this.fields.push({name:"__slot:ids",field:"id",sortField:"id",sortable:!0,title:"#"}),this.fields.push({name:"__slot:name",field:"name",sortField:"name",sortable:!0,title:()=>this.$t("Name")}),this.fields.push({name:"__slot:status",field:"status",sortField:"status",sortable:!0,title:()=>this.$t("Status")}),this.fields.push({name:"__slot:actions",title:""}),this.$nextTick(()=>{this.$refs.vuetable.normalizeFields()})},formatStatus(t){let e="",r="";switch(t){case"DRAFT":e="danger",r="Draft";break;case"CANCELED":e="danger",r="Canceled";break;case"COMPLETED":e="primary",r="Completed";break;case"ERROR":e="danger",r="Error";break;default:e="success",r="In Progress"}return{color:e,label:r}},openRequest(t,e){return`/requests/${t.id}`},classDueDate(t){const e=moment(t),r=moment(),a=e.diff(r,"hours");return a<0?"text-danger":a<=1?"text-warning":"text-dark"},fetchData(t){t[0]==="by_me"&&t[1]!=="all"&&(this.pmql=`(user_id = ${ProcessMaker.user.id}) AND (status = "${t[1]}")`),t[0]==="as_participant"&&t[1]!=="all"&&(this.pmql=`(status = "${t[1]}") AND (participant = "${Processmaker.user.username}")`),t[1]==="all"&&(this.pmql=`(user_id = ${ProcessMaker.user.id}) AND ((status = "In Progress") OR (status = "Completed"))`),this.fetch()},fetchSearch(t){this.pmql="",this.pmql=t,this.fetch()}}};var U7=function(){var e=this,r=e._self._c;return e.showTable?r("div",[r("vuetable",{ref:"vuetable",attrs:{"data-manager":e.dataManager,"sort-order":e.sortOrder,"api-mode":!1,fields:e.fields,data:e.tableData,css:e.css,"data-path":"data","pagination-path":"meta"},scopedSlots:e._u([{key:"ids",fn:function(a){return[r("b-link",{staticClass:"text-nowrap",attrs:{href:e.openRequest(a.rowData,a.rowIndex)}},[e._v(" #"+e._s(a.rowData.id)+" ")])]}},{key:"name",fn:function(a){return[r("span",{directives:[{name:"uni-id",rawName:"v-uni-id",value:a.rowData.id.toString(),expression:"props.rowData.id.toString()"}]},[e._v(e._s(a.rowData.name))])]}},{key:"status",fn:function(a){return[r("span",[r("i",{class:`fas fa-circle text-${a.rowData.status.color}`}),e._v(" "+e._s(a.rowData.status.label)+" ")])]}},{key:"actions",fn:function(a){return[r("div",{staticClass:"actions"},[r("div",{staticClass:"popout"},[r("b-btn",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}},{name:"uni-aria-describedby",rawName:"v-uni-aria-describedby",value:a.rowData.id.toString(),expression:"props.rowData.id.toString()"}],attrs:{variant:"link",href:e.openRequest(a.rowData,a.rowIndex),title:e.$t("Open Request")}},[r("i",{staticClass:"fas fa-caret-square-right fa-lg fa-fw"})])],1)])]}}],null,!1,3091698390)})],1):r("div",[r("formEmpty",{attrs:{link:"Requests",title:"No Requests to Show",url:e.noDataUrl}})],1)},G7=[],H7=oe(V7,U7,G7,!1,null,null,null,null);const Jp=H7.exports,Ote="",Y7={mixins:[vn()],props:["name","description","filter","id","process"],data(){return{disabled:!1,spin:0,showtip:!0,showdetail:!1}},computed:{ariaHidden(){return this.showdetail?"false":"true"},ariaExpanded(){return this.showdetail?"true":"false"},emptyStartEvents(){return this.process.startEvents.filter(t=>!t.eventDefinitions||t.eventDefinitions.length===0)},transformedName(){return this.process.name.replace(new RegExp(this.filter,"gi"),t=>t)},truncatedDescription(){if(!this.process.description)return'<span class="text-primary"></span>';let t="";const e=this.process.description.split(" "),r=100;let a=null;for(;a=e.shift();)t.length+a.length+1<=r&&(t=`${t} ${a}`);return t.replace(new RegExp(this.filter,"gi"),i=>`<span class="text-primary"> ${i} </span>`)}},methods:{newRequestLink(t,e){if(this.disabled)return;this.disabled=!0,this.spin=`${t.id}.${e.id}`;const r=e.id;window.ProcessMaker.apiClient.post(`/process_events/${this.process.id}?event=${r}`).then(a=>{this.spin=0;const i=a.data;this.$cookies.set("fromTriggerStartEvent",!0,"1min"),window.location=`/requests/${i.id}?fromTriggerStartEvent=`}).catch(a=>{this.disabled=!1;const{data:i}=a.response;i.message&&ProcessMaker.alert(i.message,"danger")})},showRequestDetails(t,e){this.showdetail===!1?this.showdetail=!0:this.showdetail=!1,this.$root.$emit("bv::toggle::collapse",this.getComputedId(t,e))},getNewRequestLinkHref(t,e){const{id:r}=t,a=e.id;return`/process_events/${r}?event=${a}`},getComputedId(t,e){return`process-${t.id}-${e.id}`}}};var Q7=function(){var e=this,r=e._self._c;return r("div",[e._l(e.emptyStartEvents,function(a){return[r("div",{key:a.id,staticClass:"mb-3 card-request"},[r("div",{staticClass:"card-body"},[r("div",{staticClass:"d-flex justify-content-between"},[r("div",[r("span",{directives:[{name:"uni-id",rawName:"v-uni-id",value:a.id.toString(),expression:"event.id.toString()"}],staticClass:"card-info card-title"},[e._v(" "+e._s(e.transformedName)+" ")]),r("span",{staticClass:"card-info"},[e._v(" "+e._s(a.name)+" ")])]),r("div",{staticClass:"d-flex align-items-center"},[r("button",{staticClass:"btn btn-ellipsis btn-sm mr-1",attrs:{"aria-expanded":e.ariaExpanded,"aria-controls":e.getComputedId(e.process,a)},on:{click:function(i){return e.showRequestDetails(e.process,a)}}},[r("i",{staticClass:"fas fa-ellipsis-v"})]),r("button",{directives:[{name:"uni-aria-describedby",rawName:"v-uni-aria-describedby",value:a.id.toString(),expression:"event.id.toString()"}],staticClass:"btn btn-custom btn-sm",attrs:{href:e.getNewRequestLinkHref(e.process,a)},on:{click:function(i){return i.preventDefault(),e.newRequestLink(e.process,a)}}},[e._v(" "+e._s(e.$t("Start"))+" "),r("i",{staticClass:"fas fa-play mr-1 card-icon"})])])]),r("b-collapse",{attrs:{id:e.getComputedId(e.process,a),"aria-hidden":e.ariaHidden}},[r("hr"),r("p",{staticClass:"card-text text-muted card-description"},[e._v(" "+e._s(e.process.description)+" ")])])],1)])]})],2)},K7=[],J7=oe(Y7,Q7,K7,!1,null,"6935b2c4",null,null);const Z7={components:{ProcessCard:J7.exports,formEmpty:Qp},data(){return{filter:"",loading:!1,error:!1,loaded:!1,processes:{},perPage:10,page:1}},mounted(){this.fetch(),this.$root.$on("dropdownSelectionStart",this.fetchData)},methods:{hasEmptyStartEvents(t){return!!t.events.find(e=>!e.eventDefinitions||e.eventDefinitions.length===0)},fetch(){Vue.nextTick(()=>{window.ProcessMaker.apiClient.get(`start_processes?page=${this.page}&per_page=${this.perPage}&filter=${this.filter}&order_by=category.name,name&order_direction=asc,asc&include=events&without_event_definitions=true`).then(t=>{const{data:e}=t;this.processes=e.data}).catch(()=>{this.error=!0})})},fetchData(t){this.filter=t,this.fetch()}}};var X7=function(){var e=this,r=e._self._c;return r("div",[Object.keys(e.processes).length&&!e.loading?r("div",{staticClass:"process-list"},[r("b-container",{attrs:{fluid:""}},e._l(e.processes,function(a,i){return r("div",{key:`process-${i}`},[e.hasEmptyStartEvents(a)?r("ProcessCard",{attrs:{filter:e.filter,process:a}}):e._e()],1)}),0)],1):r("div",[r("formEmpty",{attrs:{link:"",title:"No Request to Start",url:""}})],1)])},eY=[],tY=oe(Z7,X7,eY,!1,null,null,null,null);const rY=tY.exports,$te="",aY={components:{FormTasks:Kp,FormRequests:Jp,FormNewRequest:rY},mixins:[],props:["listOption"],data(){return{optionRequest:"by_me",dropdownRequest:"In Progress",titleDropdown:"View All",viewAll:"View All",title:this.$t("List Table"),dataControl:{},searchCriteria:"",showInput:!1,pmql:"",badgeVariant:"",typeSelected:"",showBadge:!1,customStyle:{"border-radius":"8px"}}},watch:{listOption(){this.title=this.listOption,this.dataControl={}}},mounted(){this.title=this.listOption},methods:{getData(t){this.dataControl=t.dataControls},openExternalLink(){window.open(this.dataControl.url,"_blank")},handleDropdownSelection(t,e){const r=[];this.typeSelected=t,t==="tasks"?(this.$root.$emit("dropdownSelectionTask",e),this.titleDropdown=e==="all"?this.viewAll:e,this.colorBadge()):(t==="requests_filter"&&(this.optionRequest=e,e==="by_me"&&(this.title="Request Started By Me"),e==="as_participant"&&(this.title="With Me as Participant")),t==="requests_dropdown"&&(this.titleDropdown=e==="all"?this.viewAll:e,this.colorBadge(),this.dropdownRequest=e),r.push(this.optionRequest),r.push(this.dropdownRequest),this.$root.$emit("dropdownSelectionRequest",r))},toggleInput(t){this.showInput&&this.searchCriteria!==""&&this.performSearch(t),this.showInput=!this.showInput},performSearch(t){this.pmql=`(fulltext LIKE "%${this.searchCriteria}%")`,t==="tasks"&&this.$root.$emit("searchTask",this.pmql),t==="requests"&&this.$root.$emit("searchRequest",this.pmql),t===void 0&&this.$root.$emit("dropdownSelectionStart",`${this.searchCriteria}`)},clearSearch(t){this.searchCriteria="",this.toggleInput(t)},colorBadge(){this.titleDropdown==="In Progress"&&(this.typeSelected==="tasks"&&(this.badgeVariant="warning"),this.typeSelected==="requests_dropdown"&&(this.badgeVariant="success"),this.showBadge=!0),this.titleDropdown==="Overdue"&&(this.badgeVariant="danger",this.showBadge=!0),this.titleDropdown==="Overdue"&&(this.badgeVariant="danger",this.showBadge=!0),this.titleDropdown==="Completed"&&(this.badgeVariant="primary",this.showBadge=!0),(this.titleDropdown==="View All"||this.titleDropdown==="all")&&(this.badgeVariant="",this.showBadge=!1)}}};var iY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"card",style:e.customStyle},[r("div",{staticClass:"card-header d-flex justify-content-between align-items-center"},[e.dataControl.showControl?[r("div",{staticClass:"mb-1 mt-1"},[e.dataControl.showAvatar?r("b-avatar",{staticClass:"avatar-text",attrs:{size:"2em",variant:e.dataControl.variant,text:e.dataControl.count}}):e._e(),r("p",{staticClass:"control-text mb-0",style:e.dataControl.colorText},[e._v(" "+e._s(e.$t(e.title))+" ")]),e.dataControl.dropdownShow==="requests"?[r("b-dropdown",{attrs:{variant:"outline-secondary","no-caret":""},scopedSlots:e._u([{key:"button-content",fn:function(){return[r("i",{staticClass:"fas fa-caret-down"})]},proxy:!0}],null,!1,2500479221)},[r("b-dropdown-item",{on:{click:function(a){return e.handleDropdownSelection("requests_filter","by_me")}}},[e._v(" "+e._s(e.$t("As Requester"))+" ")]),r("b-dropdown-item",{on:{click:function(a){return e.handleDropdownSelection("requests_filter","as_participant")}}},[e._v(" "+e._s(e.$t("As Participant"))+" ")])],1)]:e._e()],2)]:[r("span",{staticClass:"control-text"},[e._v(e._s(e.$t(e.title)))])],r("div",{staticClass:"ml-auto d-flex align-items-center"},[e.dataControl.dropdownShow==="requests"?[r("div",{staticClass:"mr-4"},[r("b-dropdown",{attrs:{variant:"outline-secondary",size:"sm"},scopedSlots:e._u([{key:"button-content",fn:function(){return[r("span",[e.showBadge?r("b-icon",{attrs:{icon:"circle-fill",variant:e.badgeVariant}}):e._e(),e._v(" "+e._s(e.$t(e.titleDropdown))+" ")],1)]},proxy:!0}],null,!1,3897299558)},[r("b-dropdown-item",{attrs:{variant:"success"},on:{click:function(a){return e.handleDropdownSelection("requests_dropdown","In Progress")}}},[r("i",{staticClass:"fas fa-circle mr-2"}),e._v(e._s(e.$t("In Progress"))+" ")]),r("b-dropdown-item",{attrs:{variant:"primary"},on:{click:function(a){return e.handleDropdownSelection("requests_dropdown","Completed")}}},[r("i",{staticClass:"fas fa-circle mr-2"}),e._v(e._s(e.$t("Completed"))+" ")]),r("b-dropdown-item",{on:{click:function(a){return e.handleDropdownSelection("requests_dropdown","all")}}},[e._v(" "+e._s(e.$t("View All"))+" ")])],1)],1)]:e._e(),e.dataControl.dropdownShow==="tasks"?[r("div",{staticClass:"mr-4"},[r("b-dropdown",{attrs:{variant:"outline-secondary",size:"sm"},scopedSlots:e._u([{key:"button-content",fn:function(){return[r("span",[e.showBadge?r("b-icon",{attrs:{icon:"circle-fill",variant:e.badgeVariant}}):e._e(),e._v(" "+e._s(e.$t(e.titleDropdown))+" ")],1)]},proxy:!0}],null,!1,3897299558)},[r("b-dropdown-item",{attrs:{variant:"warning"},on:{click:function(a){return e.handleDropdownSelection("tasks","In Progress")}}},[r("i",{staticClass:"fas fa-circle mr-2"}),e._v(e._s(e.$t("In Progress"))+" ")]),r("b-dropdown-item",{attrs:{variant:"danger"},on:{click:function(a){return e.handleDropdownSelection("tasks","Overdue")}}},[r("i",{staticClass:"fas fa-circle mr-2"}),e._v(e._s(e.$t("Overdue"))+" ")]),r("b-dropdown-item",{on:{click:function(a){return e.handleDropdownSelection("tasks","all")}}},[e._v(" "+e._s(e.$t("View All"))+" ")])],1)],1)]:e._e(),r("div",[r("div",{staticClass:"d-flex justify-content-end"},[r("button",{staticClass:"btn btn-outline-secondary border-0 mr-1",on:{click:function(a){return e.toggleInput(e.dataControl.dropdownShow)}}},[r("i",{staticClass:"fas fa-search"})]),e.showInput?r("input",{directives:[{name:"model",rawName:"v-model",value:e.searchCriteria,expression:"searchCriteria"}],ref:"input",staticClass:"form-control narrow-input",attrs:{type:"text"},domProps:{value:e.searchCriteria},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.performSearch(e.dataControl.dropdownShow)},input:function(a){a.target.composing||(e.searchCriteria=a.target.value)}}}):e._e(),e.showInput?r("button",{staticClass:"btn btn-clear",on:{click:function(a){return e.clearSearch(e.dataControl.dropdownShow)}}},[r("i",{staticClass:"fas fa-times"})]):e._e()])])],2),e.listOption!=="Start New Request"?r("div",[r("b-link",{on:{click:e.openExternalLink}},[r("i",{staticClass:"fas fa-external-link-alt custom-icon"})])],1):e._e()],2),r("div",{staticClass:"card-body list-table"},[e.listOption==="My Tasks"?[r("FormTasks",{on:{tasksCount:e.getData}})]:e._e(),e.listOption==="My Requests"?[r("FormRequests",{on:{requestsCount:e.getData}})]:e._e(),e.listOption==="Start New Request"?[r("FormNewRequest",{on:{startControl:e.getData}})]:e._e()],2)])},nY=[],sY=oe(aY,iY,nY,!1,null,"fd3adc7b",null,null);const _s=sY.exports,Pte="",oY={props:["listChartOption"],data(){return{title:this.$t("Analytics Chart"),graphic:[],customStyle:{"border-radius":"8px"}}},watch:{listChartOption(){this.listChartOption&&this.listChartOption.name&&(this.graphic=this.listChartOption)}},mounted(){this.listChartOption&&this.listChartOption.name&&(this.graphic=this.listChartOption)},methods:{openExternalLink(){window.open("/package-analytics-reporting","_blank")}}};var lY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"card",style:e.customStyle},[r("div",{staticClass:"card-header d-flex justify-content-between align-items-center"},[r("span",{staticClass:"mb-2 mt-2 control-text"},[e._v(e._s(e.title))]),r("b-link",{on:{click:e.openExternalLink}},[r("i",{staticClass:"fas fa-external-link-alt custom-icon"})])],1),r("div",[r("div",{staticClass:"d-flex flex-wrap p-2"},[r("b-col",{attrs:{cols:"12"}},[r("b-card-text",[r("b-embed",{attrs:{type:"iframe",src:e.graphic.link}})],1)],1)],1)])])},uY=[],cY=oe(oY,lY,uY,!1,null,"54713fad",null,null);const ws=cY.exports,Cs=Object.freeze(Object.defineProperty({__proto__:null,AddLoopRow:Hu,FileDownload:Xs,FileUpload:bn,FormAnalyticsChart:ws,FormAvatar:yn,FormButton:qa,FormImage:Jn,FormInputMasked:Ba,FormListTable:_s,FormLoop:xs,FormMaskedInput:Ba,FormNestedScreen:ks,FormRecordList:fu,FormRecordListStatic:Sx,FormRequests:Jp,FormTasks:Kp,FormText:hu,NewFormMultiColumn:Yp,ScreenRendererError:Gp},Symbol.toStringTag,{value:"Module"})),Dte="",dY={name:"MustacheHelper"};var pY=function(){var e=this,r=e._self._c;return r("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"mustache",attrs:{title:e.$t("This field accepts mustache syntax")}},[e._v(" {} ")])},fY=[],hY=oe(dY,pY,fY,!1,null,"8cef93f7",null,null);const Hi=hY.exports,mY={props:["name","label","value","helper","validation","dataCy"],components:{FormMultiSelect:ee.FormMultiSelect},data(){return{variables:[],newTags:[]}},computed:{selectedVariable:{get(){return this.value},set(t){this.$emit("input",t)}}},methods:{addTag(t){this.newTags.push(t),this.selectedVariable=t,this.variables=this.newTags.concat(this.variables)},loadVariables(){this.variables=[],this.findElements(this.$root.$children[0].config),this.variables=this.newTags.concat(this.variables),this.selectedVariable&&!this.variables.includes(this.selectedVariable)&&this.variables.unshift(this.selectedVariable)},findElements(t,e=[]){t.forEach(r=>{Array.isArray(r)&&this.findElements(r),r.items&&this.findElements(r.items),r.config&&r.config.name&&this.variables.push(r.config.name),r.component==="FormNestedScreen"&&this.loadVariablesFromScreen(r.config.screen,e)})},loadVariablesFromScreen(t,e){e.indexOf(t)===-1&&(e.push(t),t&&this.$dataProvider.getScreen(t).then(r=>{this.findElements(r.data.config)}))}}};var gY=function(){var e=this,r=e._self._c;return r("form-multi-select",{attrs:{name:e.$t("Variable to Watch"),label:e.$t("Variable to Watch")+" *",options:e.variables,taggable:!0,placeholder:e.$t("None"),multiple:!1,"show-labels":!1,"internal-search":!0,validation:e.validation,helper:e.helper,"tag-placeholder":e.$t("Press enter to use this variable"),"data-cy":e.dataCy},on:{open:e.loadVariables,tag:e.addTag},model:{value:e.selectedVariable,callback:function(a){e.selectedVariable=a},expression:"selectedVariable"}})},vY=[],bY=oe(mY,gY,vY,!1,null,null,null,null);const xx=bY.exports,kx=["collectionId","labelField","valueField","pmql","unique"],yY={components:{MustacheHelper:Hi,ScreenVariableSelector:xx},props:["value"],data(){return{collections:[],fields:[],collectionId:null,labelField:null,valueField:null,pmql:"",unique:!1}},computed:{options(){return Object.fromEntries(kx.map(t=>[t,this[t]]))}},watch:{value:{handler(t){t&&kx.forEach(e=>this[e]=t[e])},immediate:!0},collectionId:{handler(){this.getFields()}},options:{handler(){this.$emit("input",this.options)},deep:!0}},created(){this.onDebouncedPmqlChange=H.debounce(t=>{this.onPmqlChange(t)},1e3)},mounted(){this.getCollections(),this.collectionId&&this.getFields()},methods:{resetFields(){this.labelField=null,this.valueField=null},getCollections(){this.$dataProvider.getCollections().then(t=>{this.collections=[{value:null,text:this.$t("Select a collection")},...t.data.data.map(e=>({text:e.name,value:e.id}))]})},getFields(){this.collectionId&&this.$dataProvider.getCollectionFields(this.collectionId).then(t=>{this.fields=[{value:null,text:this.$t("Select a field")},{value:"id",text:this.$t("Collection Record ID")},...t.data.data.map(e=>({text:e.label,value:e.field}))]})},onNLQConversion(t){this.pmql=t},onPmqlChange(t){this.pmql=t}}};var SY=function(){var e=this,r=e._self._c;return r("div",[r("div",[r("label",{attrs:{for:"collection"}},[e._v(e._s(e.$t("Collection")))]),r("b-form-select",{attrs:{id:"collection",options:e.collections,"data-cy":"inspector-collection"},on:{change:e.resetFields},model:{value:e.collectionId,callback:function(a){e.collectionId=a},expression:"collectionId"}})],1),e.fields.length>1?r("div",{staticClass:"mt-3"},[r("label",{attrs:{for:"label"}},[e._v(e._s(e.$t("Label")))]),r("b-form-select",{attrs:{id:"label",options:e.fields,"data-cy":"inspector-collection-label"},model:{value:e.labelField,callback:function(a){e.labelField=a},expression:"labelField"}})],1):e._e(),e.fields.length>1?r("div",{staticClass:"mt-3"},[r("label",{attrs:{for:"value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-select",{attrs:{id:"value",options:e.fields,"data-cy":"inspector-collection-value"},model:{value:e.valueField,callback:function(a){e.valueField=a},expression:"valueField"}})],1):e._e(),e.fields.length>1?r("div",{staticClass:"mt-3"},[r("pmql-input",{staticClass:"mb-1",attrs:{"search-type":"collections_w_mustaches","data-cy":"inspector-collection-pmql","input-label":"PMQL",condensed:!0,"ai-enabled":!0,placeholder:e.$t("PMQL")},model:{value:e.pmql,callback:function(a){e.pmql=a},expression:"pmql"}}),r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("Advanced data search")))])],1):e._e(),e.fields.length>1?r("div",{staticClass:"mt-3"},[r("form-checkbox",{attrs:{label:e.$t("Ignore duplicates in list"),helper:e.$t("Select to show only distinct list entries if labels are repeated. Only the first value will be used if duplicate labels have different values."),"data-cy":"inspector-collection-isDependent"},model:{value:e.unique,callback:function(a){e.unique=a},expression:"unique"}})],1):e._e()])},xY=[],kY=oe(yY,SY,xY,!1,null,null,null,null);const Zp=kY.exports,Ite="",_Y={components:{},props:{label:{},value:{},helper:{},options:{}},data(){return{newColor:""}},computed:{hasColor(){return!!this.value}},methods:{emitChanges(t){this.$emit("input",t),this.$emit("update-state")},checkColor(){this.hasColor&&this.emitChanges("")},selectColor(t){this.emitChanges(t)},parsedColor(t){return t.split("-")[1]}}};var wY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("div",[r("label",[e._v(e._s(e.label))]),r("b-button-toolbar",[r("b-button-group",{attrs:{size:"sm"}},e._l(e.options,function(a){return r("b-button",{key:a.value,staticClass:"btn btn-sm mr-1 pr-1 pl-1 pt-0 pb-0 btn-outline-none",class:["bg-"+e.parsedColor(a.value)],attrs:{size:"sm",variant:"outline-light",title:a.content}},[r("i",{staticClass:"fas fa-check",class:[a.value===e.value?"text-light":"text-"+e.parsedColor(a.value)],on:{click:function(i){return e.selectColor(a.value)}}})])}),1)],1),r("small",{on:{click:function(a){return e.checkColor()}}},[r("i",{staticClass:"fas fa-ban"}),e._v(" "+e._s(e.$t("Clear Color Selection"))+" ")])],1)])},CY=[],TY=oe(_Y,wY,CY,!1,null,"7de98bb3",null,null);const _x=TY.exports,Ts=[{value:"provideData",text:"Provide Values"},{value:"dataObject",text:"Request Data"},{value:"dataConnector",text:"Data Connector"},{value:"collection",text:"Collection"}],ea=Ts.reduce((t,e)=>(t[e.value]=e.value,t),{}),zte="",AY={components:{draggable:Oa,MonacoEditor:_a},props:["options"],model:{prop:"options",event:"change"},data(){return{jsonError:"",optionError:"",dragging:!1,dataSourceValues:ea,dataSources:Ts,dataSource:ea.provideData,jsonData:"",key:null,value:null,dataName:"",pmqlQuery:"",optionsList:[],showOptionCard:!1,showRemoveWarning:!1,showJsonEditor:!1,optionCardType:"",editIndex:null,removeIndex:null,optionValue:"",optionContent:"",showRenderAs:!1,renderAs:"dropdown",allowMultiSelect:!1,defaultOptionKey:!1,selectedOptions:[],renderAsOptions:[{text:"Dropdown/Multiselect",value:"dropdown"},{text:"Radio/Checkbox Group",value:"checkbox"}],monacoOptions:{automaticLayout:!0,fontSize:8},monacoLargeOptions:{automaticLayout:!0},showPopup:!1}},watch:{options:{handler(){this.dataSource=this.options.dataSource,this.jsonData=this.options.jsonData,this.dataName=this.options.dataName,this.key=this.options.key,this.value=this.options.value,this.pmqlQuery=this.options.pmqlQuery,this.defaultOptionKey=this.options.defaultOptionKey,this.selectedOptions=this.options.selectedOptions,this.optionsList=this.options.optionsList,this.showRenderAs=this.options.showRenderAs,this.renderAs=this.options.renderAs,this.allowMultiSelect=this.options.allowMultiSelect,this.showOptionCard=this.options.showOptionCard,this.showRemoveWarning=this.options.showRemoveWarning,this.showJsonEditor=this.options.showJsonEditor,this.editIndex=this.options.editIndex,this.removeIndex=this.options.removeIndex}},dataSource(){this.jsonData="",this.dataName=""},dataObjectOptions(t){this.$emit("change",t)}},computed:{jsonDataClass(){return this.jsonError?"is-invalid":""},optionKeyClass(){return this.optionError?"is-invalid":""},keyField(){return this.key||"value"},valueField(){return this.value||"content"},currentItemToDelete(){if(this.removeIndex!==null&&this.optionsList.length>0&&this.optionsList[this.removeIndex]!==void 0){let t=this.optionsList[this.removeIndex][this.valueField];return this.$t('Are you sure you want to delete "{{item}}"?',{item:t})}return""},dataObjectOptions(){return{dataSource:this.dataSource,jsonData:this.jsonData,dataName:this.dataName,key:this.key,value:this.value,pmqlQuery:this.pmqlQuery,defaultOptionKey:this.defaultOptionKey,selectedOptions:this.selectedOptions,optionsList:this.optionsList,showRenderAs:this.showRenderAs,renderAs:this.renderAs,allowMultiSelect:this.allowMultiSelect,showOptionCard:this.showOptionCard,showRemoveWarning:this.showRemoveWarning,showJsonEditor:this.showJsonEditor,editIndex:this.editIndex,removeIndex:this.removeIndex}}},mounted(){this.initData()},methods:{initData(){this.dataSource=this.options.dataSource,this.jsonData=this.options.jsonData,this.dataName=this.options.dataName,this.key=this.options.key,this.value=this.options.value,this.pmqlQuery=this.options.pmqlQuery,this.defaultOptionKey=this.options.defaultOptionKey,this.selectedOptions=this.options.selectedOptions,this.optionsList=this.options.optionsList?this.options.optionsList:[],this.jsonData=JSON.stringify(this.optionsList),this.showRenderAs=this.options.showRenderAs,this.renderAs=this.options.renderAs,this.allowMultiSelect=this.options.allowMultiSelect},defaultOptionClick(){this.defaultOptionKey===event.target.value&&(this.defaultOptionKey=!1)},rowCss(t){return t%2===0?"striped":"bg-default"},keyChanged(){this.jsonDataChange()},valueChanged(){this.jsonDataChange()},jsonDataChange(){let t=[];try{if(t=JSON.parse(this.jsonData),t.constructor!==Array&&t.constructor!==Object)throw Error("String does not represent a valid JSON")}catch(r){this.jsonError=r.message;return}this.optionsList=[];const e=this;t.forEach(r=>{e.optionsList.push({[e.keyField]:r[e.keyField],[e.valueField]:r[e.valueField]})}),this.jsonError=""},updateSort(){this.jsonData=JSON.stringify(this.optionsList),this.$emit("change",this.dataObjectOptions)},editAsJson(){this.showJsonEditor=!0},editAsOptionList(){this.showJsonEditor=!1},showEditOption(t){this.optionCardType="edit",this.editIndex=t,this.optionContent=this.optionsList[t][this.valueField],this.optionValue=this.optionsList[t][this.keyField],this.optionError=""},showAddOption(){this.optionCardType="insert",this.optionContent="",this.optionValue="",this.showOptionCard=!0,this.optionError="",this.editIndex=null},addOption(){const t=this;if(this.optionsList===void 0&&this.initData(),this.optionCardType==="insert"){if(this.optionsList.find(e=>e[t.keyField]===this.optionValue)){this.optionError="An item with the same key already exists";return}this.optionsList.push({[this.valueField]:this.optionContent,[this.keyField]:this.optionValue})}else{if(this.optionsList.find((e,r)=>e[t.keyField]===this.optionValue&&r!==this.editIndex)){this.optionError="An item with the same key already exists";return}this.optionsList[this.editIndex][this.keyField]=this.optionValue,this.optionsList[this.editIndex][this.valueField]=this.optionContent}this.jsonError="",this.jsonData=JSON.stringify(this.optionsList),this.showOptionCard=!1,this.optionError="",this.editIndex=null},deleteOption(){this.optionsList.splice(this.removeIndex,1),this.jsonData=JSON.stringify(this.optionsList),this.showRemoveWarning=!1,this.removeIndex=null},removeOption(t){this.removeIndex=t,this.showRemoveWarning=!0},expandEditor(){this.showPopup=!0},closePopup(){this.showPopup=!1}}};var OY=function(){var e=this,r=e._self._c;return r("div",[!e.showJsonEditor&&e.dataSource===e.dataSourceValues.provideData?r("div",[r("div",{staticClass:"row"},[r("div",{staticClass:"col-10"},[r("label",{attrs:{for:"data-sources"}},[r("b",[e._v(e._s(e.$t("Column")))])])]),r("div",{staticClass:"col-2"},[r("a",{staticClass:"fas fa-plus-square",on:{click:e.showAddOption}})])]),e.showOptionCard?r("div",{staticClass:"card mb-2"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Add Column"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Column"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Column Header")))]),r("b-form-input",{attrs:{id:"option-content"},model:{value:e.optionContent,callback:function(a){e.optionContent=a},expression:"optionContent"}}),r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass},model:{value:e.optionValue,callback:function(a){e.optionValue=a},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e()],1),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-2",attrs:{type:"button"},on:{click:function(a){e.showOptionCard=!1}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button"},on:{click:function(a){return e.addOption()}}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e._e(),r("div",{staticClass:"row"},[r("div",{staticClass:"col"},[r("draggable",{attrs:{element:"div",group:"options"},on:{update:e.updateSort,start:function(a){e.drag=!0},end:function(a){e.drag=!1}},model:{value:e.optionsList,callback:function(a){e.optionsList=a},expression:"optionsList"}},e._l(e.optionsList,function(a,i){return r("div",{key:a.value},[e.removeIndex===i?r("div",[r("div",{staticClass:"card mb-3 bg-danger text-white text-right"},[r("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.currentItemToDelete)+" ")]),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-light mr-2",attrs:{type:"button"},on:{click:function(n){e.removeIndex=null}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-danger",attrs:{type:"button"},on:{click:function(n){return e.deleteOption()}}},[e._v(" "+e._s(e.$t("Delete"))+" ")])])])]):e._e(),e.editIndex===i?r("div",[r("div",{staticClass:"card my-2"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Add Option"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Option"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Column Header")))]),r("b-form-input",{attrs:{id:"option-content"},model:{value:e.optionContent,callback:function(n){e.optionContent=n},expression:"optionContent"}}),r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass},model:{value:e.optionValue,callback:function(n){e.optionValue=n},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e()],1),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-2",attrs:{type:"button"},on:{click:function(n){e.editIndex=null}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button"},on:{click:function(n){return e.addOption()}}},[e._v(" "+e._s(e.$t("Update"))+" ")])])])]):e._e(),r("div",{staticClass:"row border-top",class:e.rowCss(i)},[r("div",{staticClass:"col-1",staticStyle:{cursor:"grab"}},[r("span",{staticClass:"fas fa-arrows-alt-v"})]),r("div",{staticClass:"col-1 d-flex align-items-center"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.defaultOptionKey,expression:"defaultOptionKey"}],staticClass:"form-check",attrs:{type:"radio",name:"defaultOptionGroup"},domProps:{value:a[e.keyField],checked:e._q(e.defaultOptionKey,a[e.keyField])},on:{click:e.defaultOptionClick,change:function(n){e.defaultOptionKey=a[e.keyField]}}})]),r("div",{staticClass:"col-5",staticStyle:{cursor:"grab"}},[e._v(" "+e._s(a[e.valueField])+" ")]),r("div",{staticClass:"col-1"},[r("a",{staticClass:"fas fa-cog",staticStyle:{cursor:"pointer"},on:{click:function(n){return e.showEditOption(i)}}})]),r("div",{staticClass:"col-1"},[r("a",{staticClass:"fas fa-trash-alt",staticStyle:{cursor:"pointer"},on:{click:function(n){return e.removeOption(i)}}})])])])}),0)],1)]),r("div",{staticClass:"row"},[r("div",{staticClass:"col text-right"},[r("a",{attrs:{href:"#"},on:{click:function(a){return e.editAsJson()}}},[r("small",{staticClass:"form-text text-muted mb-3"},[r("b",[e._v("</>")]),e._v(" "+e._s(e.$t("Edit as JSON")))])])])]),e.showRenderAs?r("div",{staticClass:"row mb-3"},[r("div",{staticClass:"col-12"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.allowMultiSelect,expression:"allowMultiSelect"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.allowMultiSelect)?e._i(e.allowMultiSelect,null)>-1:e.allowMultiSelect},on:{change:function(a){var i=e.allowMultiSelect,n=a.target,s=!!n.checked;if(Array.isArray(i)){var o=null,u=e._i(i,o);n.checked?u<0&&(e.allowMultiSelect=i.concat([o])):u>-1&&(e.allowMultiSelect=i.slice(0,u).concat(i.slice(u+1)))}else e.allowMultiSelect=s}}}),e._v(" Allow multiple selections ")])]):e._e(),e.showRenderAs?r("div",{staticClass:"row mb-3"},[r("div",{staticClass:"col"},[r("label",{attrs:{for:"render-as"}},[e._v(e._s(e.$t("Render Options As")))]),r("b-form-select",{attrs:{id:"render-as",options:e.renderAsOptions},model:{value:e.renderAs,callback:function(a){e.renderAs=a},expression:"renderAs"}})],1)]):e._e()]):e._e(),e.showJsonEditor&&e.dataSource===e.dataSourceValues.provideData?r("div",[e.dataSource===e.dataSourceValues.provideData?r("div",[r("div",{staticClass:"mb-2"},[r("label",{attrs:{for:"json-data"}},[e._v(e._s(e.$t("JSON Data")))]),r("button",{staticClass:"btn-sm float-right",attrs:{type:"button","aria-label":e.$t("Expand Editor")},on:{click:e.expandEditor}},[r("i",{staticClass:"fas fa-expand"})])]),r("div",{staticClass:"small-editor-container"},[r("MonacoEditor",{staticClass:"editor",attrs:{options:e.monacoOptions,language:"json"},on:{change:e.jsonDataChange},model:{value:e.jsonData,callback:function(a){e.jsonData=a},expression:"jsonData"}})],1),r("b-modal",{attrs:{size:"lg",centered:"",title:e.$t("Script Config Editor"),"header-close-content":"×"},model:{value:e.showPopup,callback:function(a){e.showPopup=a},expression:"showPopup"}},[r("div",{staticClass:"editor-container"},[r("MonacoEditor",{staticClass:"editor",attrs:{options:e.monacoLargeOptions,language:"json"},on:{change:e.jsonDataChange},model:{value:e.jsonData,callback:function(a){e.jsonData=a},expression:"jsonData"}})],1),r("div",{attrs:{slot:"modal-footer"},slot:"modal-footer"},[r("b-button",{staticClass:"btn btn-secondary text-uppercase",on:{click:e.closePopup}},[e._v(" "+e._s(e.$t("Close"))+" ")])],1)])],1):e._e(),e.jsonError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.jsonError))])]):e._e(),r("a",{staticClass:"text-right",attrs:{href:"#"},on:{click:function(a){return e.editAsOptionList()}}},[r("small",{staticClass:"form-text text-muted mb-3"},[r("b",[e._v("</>")]),e._v(" "+e._s(e.$t("Edit as Option List")))])])]):e._e(),e.dataSource===e.dataSourceValues.dataObject?r("div",[r("label",{attrs:{for:"data-name"}},[e._v(e._s(e.$t("Data Name")))]),r("b-form-input",{attrs:{id:"data-name"},model:{value:e.dataName,callback:function(a){e.dataName=a},expression:"dataName"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Data source to populate select")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataObject||e.showJsonEditor?r("div",[r("label",{attrs:{for:"key"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"key"},on:{change:e.keyChanged},model:{value:e.key,callback:function(a){e.key=a},expression:"key"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Field to save to the data object")))]),r("label",{attrs:{for:"value"}},[e._v(e._s(e.$t("Content")))]),r("b-form-input",{attrs:{id:"value"},on:{change:e.valueChanged},model:{value:e.value,callback:function(a){e.value=a},expression:"value"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Field to show in the select box")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataObject?r("div",[r("label",{attrs:{for:"pmql-query"}},[e._v(e._s(e.$t("PMQL")))]),r("b-form-textarea",{attrs:{id:"json-data",rows:"4"},model:{value:e.pmqlQuery,callback:function(a){e.pmqlQuery=a},expression:"pmqlQuery"}}),r("small",{staticClass:"form-text text-muted"},[e._v("Advanced data search")])],1):e._e()])},EY=[],MY=oe(AY,OY,EY,!1,null,"d454ec3c",null,null);const wx=MY.exports,$Y={components:{FormInput:ee.FormInput,FormCheckbox:ee.FormCheckbox,FormTextArea:ee.FormTextArea,draggable:Oa},data(){return{addValue:"",addContent:"",addError:"",existingOptions:[],dataJson:[],displayList:!1}},mounted(){this.existingOptions=JSON.parse(JSON.stringify(this.options))},watch:{displayList(){this.displayList&&(this.dataJson=this.options?JSON.stringify(this.options):"")},options(){this.existingOptions=JSON.parse(JSON.stringify(this.options))}},props:["label","options","helper"],model:{prop:"options",event:"change"},computed:{deleteIf(){return this.options.length>1},isValidJson(){try{return JSON.parse(this.dataJson),!0}catch{return!1}}},methods:{saveDataJson(){this.isValidJson&&this.$emit("change",JSON.parse(this.dataJson))},updateSort(){this.existingOptions.forEach((e,r)=>{e.value=r+1});let t=JSON.parse(JSON.stringify(this.existingOptions));this.$emit("change",t)},resetAdd(){this.addValue="",this.addContent="",this.addError=""},addNewOption(t){let e=JSON.parse(JSON.stringify(this.options));if(isNaN(this.addContent)){this.addError=this.$t("This value must be numeric"),t.preventDefault();return}if(!(0<this.addContent&&this.addContent<13)){this.addError=this.$t("This value must be between 1-12"),t.preventDefault();return}let r=0,a=0;if(this.existingOptions.forEach(i=>{r++,a+=Number(i.content),i.value=r}),a+Number(this.addContent)>12){this.addError=this.$t("The total size of the columns exceeds 12"),t.preventDefault();return}e.push({value:r+1,content:this.addContent}),this.$emit("change",e),this.resetAdd()},removeOption(t){let e=JSON.parse(JSON.stringify(this.options));e.splice(t,1),e.forEach((r,a)=>{r.value=a+1}),this.$emit("change",e)}}};var PY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("h3",[e._v(e._s(e.label))]),r("form-checkbox",{attrs:{name:"type",toggle:"true",label:e.$t("Show in Json Format"),helper:"","data-cy":"inspector-jsonFormat"},model:{value:e.displayList,callback:function(a){e.displayList=a},expression:"displayList"}}),e.displayList?[r("div",{staticClass:"alert",class:{"alert-success":e.isValidJson,"alert-danger":!e.isValidJson}},[e.isValidJson?r("span",[e._v("Valid JSON Data Object")]):r("span",[e._v("Invalid JSON Data Object")])]),r("form-text-area",{attrs:{name:"dataJson",label:e.$t("Json Options"),rows:"8",helper:e.$t("It must be a correct json format"),"data-cy":"inspector-dataJson"},model:{value:e.dataJson,callback:function(a){e.dataJson=a},expression:"dataJson"}}),r("b-btn",{attrs:{disabled:!e.isValidJson,"data-cy":"inspector-dataJson-save"},on:{click:e.saveDataJson}},[e._v(e._s(e.$t("Save")))])]:[r("table",{staticClass:"table table-sm"},[r("thead",{staticClass:"thead-dark"},[r("tr",[r("th",[e._v(e._s(e.$t("Column")))]),r("th",[e._v(e._s(e.$t("Colspan")))]),r("th",[e._v(e._s(e.$t("Remove")))])])]),r("draggable",{attrs:{element:"tbody",group:"options"},on:{update:e.updateSort},model:{value:e.existingOptions,callback:function(a){e.existingOptions=a},expression:"existingOptions"}},e._l(e.existingOptions,function(a,i){return r("tr",{key:i,attrs:{"data-cy":`inspector-columns-tr-${i}`}},[r("td",[e._v(e._s(a.value))]),r("td",[e._v(e._s(a.content))]),r("td",[e.deleteIf?r("button",{staticClass:"btn btn-danger btn-sm",attrs:{"data-cy":"inspector-columns-remove","aria-label":e.$t("Delete")},on:{click:function(n){return e.removeOption(i)}}},[e._v("x ")]):e._e()])])}),0)],1),r("b-btn",{directives:[{name:"b-modal",rawName:"v-b-modal.addOptionModal",modifiers:{addOptionModal:!0}}],attrs:{"data-cy":"inspector-columns-add"}},[e._v(e._s(e.$t("Add Column")))]),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.helper)))]):e._e(),r("b-modal",{attrs:{"ok-title":e.$t("Ok"),"cancel-title":e.$t("Cancel"),id:"addOptionModal",title:e.$t("Add New Column"),"data-cy":"inspector-add-column-modal"},on:{cancel:e.resetAdd,ok:e.addNewOption}},[r("form-input",{attrs:{label:e.$t("Column Width"),validate:"required|numeric|between:1,12",error:this.addError,"data-cy":"inspector-add-column-width"},model:{value:e.addContent,callback:function(a){e.addContent=a},expression:"addContent"}})],1)]],2)},DY=[],IY=oe($Y,PY,DY,!1,null,null,null,null);const Cx=IY.exports,Lte="",zY={components:{MustacheHelper:Hi},mixins:[],props:{value:String},data(){return{field:"",dataMapping:[],options:[]}},methods:{loadOptions(){const t=this.getConfig();let e=t.endpoint;this.options=[],window.ProcessMaker.apiClient.get(`/data_sources/${t.dataSource}`).then(r=>{let a=window._.get(r,`data.endpoints.${e}`,null);if(this.dsEndpoint=a,a===null)return;let i=window._.get(a,"dataMapping",[]);this.options=i.map(n=>n.key)})},getConfig(){try{return JSON.parse(this.value)}catch{return{}}},setConfig(t,e){const r=this.getConfig();JSON.stringify(r[t])!==JSON.stringify(e)&&(r[t]=e,this.$emit("input",JSON.stringify(r)))},removeRowIndex(t){this.dataMapping.splice(t,1)},addMapping(){this.dataMapping.push({key:"",value:""})}},watch:{dataMapping:{deep:!0,immediate:!0,handler(t){this.setConfig("dataMapping",t)}},value:{immediate:!0,handler(){const t=this.getConfig().dataMapping;t&&(this.dataMapping.splice(0),t.forEach(e=>{this.dataMapping.push(e)}))}}}};var LY=function(){var e=this,r=e._self._c;return r("div",[r("div",{staticClass:"d-flex mb-1"},[r("label",{staticClass:"flex-grow-1 m-0"},[e._v(e._s(e.$t("Output Variable Property Mapping")))]),r("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm px-2",attrs:{type:"button"},on:{click:e.addMapping}},[e._v("+ "+e._s(e.$t("Property"))+" ")])]),r("table",{staticClass:"table table-striped table-sm border mb-1"},[r("thead",[r("tr",[r("th",{attrs:{scope:"col"}},[r("div",{staticClass:"float-left"},[e._v(e._s(e.$t("Source")))]),e._v(" "),r("mustache-helper",{staticClass:"float-left ml-2"})],1),r("th",{attrs:{scope:"col"}},[r("div",{staticClass:"float-left"},[e._v(e._s(e.$t("Form Variable")))]),e._v(" "),r("mustache-helper",{staticClass:"float-left ml-2"})],1),r("th",{attrs:{scope:"col"}},[e._v(" ")])])]),r("tbody",e._l(e.dataMapping,function(a,i){return r("tr",{key:i},[r("td",{staticClass:"p-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:a.value,expression:"row.value"}],staticClass:"form-control",attrs:{name:"value",placeholder:e.$t("Leave blank to map all response data"),type:"text"},domProps:{value:a.value},on:{input:function(n){n.target.composing||e.$set(a,"value",n.target.value)}}})]),r("td",{staticClass:"p-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:a.key,expression:"row.key"}],staticClass:"form-control",attrs:{name:"key",placeholder:e.$t("The Request variable is a new/existing variable"),type:"text"},domProps:{value:a.key},on:{input:function(n){n.target.composing||e.$set(a,"key",n.target.value)}}})]),r("td",{staticClass:"align-middle text-right p-1"},[r("a",{staticClass:"btn btn-sm btn-danger",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.removeRowIndex(i)}}},[r("i",{staticClass:"fa fa-trash-alt"})])])])}),0)]),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(" "+e._s(e.$t("Properties to map from the Data Connector into the output variable"))+" "),r("br"),e._v(" "+e._s(e.$t("(If empty, all data returned will be mapped to the output variable)"))+" ")])])},jY=[],NY=oe(zY,LY,jY,!1,null,"831d025b",null,null);const Xp=NY.exports,jte="",RY={props:["value","helper"],components:{MonacoEditor:_a},data(){return{mode:"basic",jsValue:"",basicValue:"",monacoOptions:{lineNumbers:"off",glyphMargin:!1,folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:0,minimap:{enabled:!1},fixedOverflowWidgets:!0,automaticLayout:!0}}},watch:{value:{handler(){H.isEqual(this.configValue,this.value)||(this.mode="basic",this.basicValue="",this.jsValue="",this.value&&(typeof this.value=="string"?(this.mode="basic",this.effectiveValue=this.value):(this.mode=this.value.mode,this.effectiveValue=this.value.value)))},immediate:!0},mode(){this.emit()},jsValue(){this.emit()},basicValue(){this.emit()}},computed:{effectiveValue:{get(){return this.mode==="js"?this.jsValue:this.basicValue},set(t){this.mode==="js"?this.jsValue=t:this.basicValue=t}},configValue(){return{mode:this.mode,value:this.effectiveValue}}},methods:{emit(){this.$emit("input",this.configValue)}}};var FY=function(){var e=this,r=e._self._c;return r("div",[r("label",[e._v(e._s(e.$t("Default Value"))+" ")]),r("div",{staticClass:"float-right buttons"},[r("b-button",{class:{active:e.mode==="basic"},attrs:{title:e.$t("Basic Mode"),variant:"light",size:"sm","data-cy":"inspector-defaultValue-basic"},on:{click:function(a){e.mode="basic"}}},[r("i",{staticClass:"fas fa-i-cursor"})]),r("b-button",{class:{active:e.mode==="js"},attrs:{title:e.$t("Javascript"),variant:"light",size:"sm","data-cy":"inspector-defaultValue-js"},on:{click:function(a){e.mode="js"}}},[r("i",{staticClass:"fab fa-js-square"})])],1),e.mode==="basic"?r("div",[r("b-form-input",{attrs:{"data-cy":"inspector-defaultValue-basicValue"},model:{value:e.basicValue,callback:function(a){e.basicValue=a},expression:"basicValue"}}),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.helper)))]):e._e()],1):e._e(),e.mode==="js"?r("div",[r("MonacoEditor",{staticClass:"editor",attrs:{options:e.monacoOptions,language:"javascript","data-cy":"inspector-defaultValue-jsValue"},model:{value:e.jsValue,callback:function(a){e.jsValue=a},expression:"jsValue"}}),e.helper?r("small",{staticClass:"form-text text-muted mt-2"},[e._v(e._s(e.$t(e.helper)))]):e._e()],1):e._e()])},qY=[],BY=oe(RY,FY,qY,!1,null,"ae4176b8",null,null);const ef=BY.exports,WY={props:["optionValue","optionContent"],data(){},watch:{},computed:{},mounted(){},methods:{}};var VY=function(){var e=this,r=e._self._c;return e.showOptionCard?r("div",{staticClass:"card"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header pl-2"},[e._v(" "+e._s(e.$t("Add Option"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Option"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass},model:{value:e.optionValue,callback:function(a){e.optionValue=a},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e(),r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Content")))]),r("b-form-input",{attrs:{id:"option-content"},model:{value:e.optionContent,callback:function(a){e.optionContent=a},expression:"optionContent"}}),r("div",{staticClass:"card-footer pr-1 mt-3 text-right"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-3",attrs:{type:"button"},on:{click:function(a){e.showOptionCard=!1}}},[e._v(" "+e._s(e.$t("Close"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button"},on:{click:function(a){return e.addOption()}}},[e._v(" "+e._s(e.$t("Save"))+" ")])])],1)]):e._e()},UY=[],GY=oe(WY,VY,UY,!1,null,null,null,null);const Tx=GY.exports,Nte="",HY={components:{RequiredAsterisk:ee.RequiredAsterisk},mixins:[ee.ValidationMixin],inheritAttrs:!1,props:["label","error","options","helper","name","value","selectedControl"],computed:{classList(){return{"has-errors":this.validator&&this.validator.errorCount||this.error}}},methods:{getLabelFromValue(t){const e=this.options.find(r=>r.value==t);return e?e.content:null}}};var YY=function(){var e=this,r=e._self._c;return r("div",[r("required-asterisk"),r("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),r("multiselect",e._g(e._b({class:e.classList,attrs:{value:e.value,placeholder:e.$t("Select..."),"show-labels":!1,options:e.options.map(a=>a.value),"custom-label":e.getLabelFromValue}},"multiselect",e.$attrs,!1),e.$listeners),[r("template",{slot:"noResult"},[e._v(" "+e._s(e.$t("No elements found. Consider changing the search query."))+" ")]),r("template",{slot:"noOptions"},[e._v(" "+e._s(e.$t("No Data Available"))+" ")])],2),e.validator&&e.validator.errorCount||e.error?r("div",{staticClass:"invalid-feedback d-block"},[e._l(e.validator.errors.get(e.name),function(a,i){return r("div",{key:i},[e._v(" "+e._s(a)+" ")])}),e.error?r("div",[e._v(e._s(e.error))]):e._e()],2):e._e(),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]):e._e()],1)},QY=[],KY=oe(HY,YY,QY,!1,null,null,null,null);const tf=KY.exports,Rte="",JY={props:["value"],components:{FileUpload:Gf},data(){return{files:[]}},computed:{owner(){return this.$parent.$parent.inspection.config}},methods:{editSave(t){let e=new FileReader;e.readAsDataURL(t.file),e.addEventListener("load",()=>{let r=t.file.name.split(".");this.owner.name=escape(r[0]),this.$emit("input",e.result)},!1)}}};var ZY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("file-upload",{ref:"upload",staticClass:"btn btn-sm btn-primary",attrs:{extensions:"gif,jpg,jpeg,png,webp",accept:"image/png,image/gif,image/jpeg,image/webp",name:"avatar"},on:{"input-file":e.editSave},model:{value:e.files,callback:function(a){e.files=a},expression:"files"}},[e._v(" "+e._s(e.$t("Upload"))+" ")]),r("small",{staticClass:"form-text text-muted",attrs:{"data-v-7779e22f":""}},[e._v(e._s(e.$t("Preview")))]),r("div",{staticClass:"image-preview"},[r("img",{staticStyle:{height:"4em"},attrs:{src:e.value}})])],1)},XY=[],eQ=oe(JY,ZY,XY,!1,null,"70a59c9a",null,null);const Ax=eQ.exports,tQ={props:["value","selectedControl"],components:{FormInput:ee.FormInput,FormCheckbox:ee.FormCheckbox},data(){return{imageName:null}},computed:{renderImage:{get(){return this.selectedControl.config.renderImage},set(t){this.selectedControl.config.renderImage=t}},mode(){return this.$root.$children[0].mode}},watch:{value(){this.value==null?this.renderImage=!1:(this.renderImage=!0,this.imageName=this.value)},imageName(){this.$emit("input",this.imageName)},renderImage(){this.renderImage||(this.renderImage=!1,this.imageName=null,this.$emit("input",this.imageName))}},mounted(){this.value&&(this.renderImage=!0,this.imageName=this.value)}};var rQ=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("form-checkbox",{attrs:{label:e.$t("Render image from a variable name"),"data-cy":"inspector-renderImage"},model:{value:e.renderImage,callback:function(a){e.renderImage=a},expression:"renderImage"}}),e.renderImage?r("form-input",{attrs:{label:e.$t("Variable Name"),"data-cy":"inspector-variableName"},model:{value:e.imageName,callback:function(a){e.imageName=a},expression:"imageName"}}):e._e()],1)},aQ=[],iQ=oe(tQ,rQ,aQ,!1,null,null,null,null);const Ox=iQ.exports,Fte="",nQ={props:{builder:Object,selectedControl:Object,formConfig:Array,value:null},data(){return{suggestVariables:!1,localValue:this.value||"",open:!1}},computed:{allOptions(){const t=this.builder.variablesTree,{variables:e,prefix:r,parent_prefix:a}=this.loadVariables({items:t}),i=r.length,n=a.length;return r?[...Object.keys(e).filter(s=>s.substr(0,i)===r).map(s=>s.substr(i)),...Object.keys(e).filter(s=>s.substr(0,n)===a).map(s=>`_parent.${s.substr(n)}`)]:Object.keys(e)},options(){if(!this.localValue)return;const t=new RegExp(this.localValue.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\.\d+/g,".index"),"g");return this.allOptions.filter(e=>e.match(t)).splice(0,5).map(e=>({value:e.replace(t,this.localValue),text:e.replace(t,`<b>${this.localValue}</b>`)}))}},methods:{loadVariables(t,e="",r={},a={prefix:"",parent_prefix:""}){const i=e;return t.items?(e+=t.prefix||"",t.items.forEach(n=>{n.config===this.selectedControl.config&&(a.prefix=e,a.parent_prefix=i),this.loadVariables(n,e,r,a)})):r[`${e}${t.name}`]=null,{variables:r,...a}},choose(t){this.localValue=t.value,this.$emit("input",this.localValue),this.$emit("change",this.localValue),this.open=!1},blur(){setTimeout(()=>this.open=!1,500)},focus(){this.open=!0},input(){this.$emit("input",this.localValue)},change(){this.open=!0,this.$emit("change",this.localValue)}},watch:{value(t){t!=this.localValue&&(this.localValue=t)}}};var sQ=function(){var e=this,r=e._self._c;return r("b-input-group",{scopedSlots:e._u([e.suggestVariables?{key:"append",fn:function(){return[r("b-dropdown",{ref:"dropdown",attrs:{text:"(x)",right:"","no-caret":"",variant:"outline-secondary","menu-class":{"input-variable-open":e.open}}},e._l(e.options,function(a){return r("b-dropdown-item",{key:a.value,staticClass:"text-small",on:{click:function(i){return e.choose(a)}}},[r("small",[r("code",{domProps:{innerHTML:e._s(a.text)}})])])}),1)]},proxy:!0}:null],null,!0)},[r("b-form-input",e._b({on:{focus:e.focus,input:e.input,blur:e.blur,change:e.change},model:{value:e.localValue,callback:function(a){e.localValue=a},expression:"localValue"}},"b-form-input",e.$attrs,!1))],1)},oQ=[],lQ=oe(nQ,sQ,oQ,!1,null,null,null,null);const rf=lQ.exports,qte="",uQ={props:["value","screenType"],inheritAttrs:!1,components:{FormInput:ee.FormInput,FormCheckbox:ee.FormCheckbox},data(){return{options:[{value:"new",text:this.$t("New Array of Objects")},{value:"existing",text:this.$t("Existing Array")}],settings:{type:"new",varname:"",times:"3",add:!1}}},watch:{settings:{handler(){this.$emit("input",this.settings),this.$emit("setName",this.settings.varname)},deep:!0},value:{handler(){this.settings=this.value},immediate:!0}},computed:{}};var cQ=function(){var e=this,r=e._self._c;return r("div",[e.screenType=="form"?r("div",{staticClass:"form-group border-bottom pb-3"},[r("label",{attrs:{for:"type"}},[e._v(e._s(e.$t("Data Source")))]),r("b-form-select",{attrs:{id:"type",options:e.options,"data-cy":"inspector-source"},model:{value:e.settings.type,callback:function(a){e.$set(e.settings,"type",a)},expression:"settings.type"}})],1):e._e(),r("div",{staticClass:"form-group border-bottom"},[r("FormInput",{attrs:{label:e.$t("Variable Name"),name:e.$t("Variable Name"),helper:e.$t("This variable will contain an array of objects"),validation:"regex:/^(?:[A-Z_.a-z])(?:[0-9A-Z_.a-z])*$/|required","data-cy":"inspector-name"},model:{value:e.settings.varname,callback:function(a){e.$set(e.settings,"varname",a)},expression:"settings.varname"}})],1),e.screenType=="form"&&e.settings.type==="new"?r("div",{staticClass:"form-group border-bottom"},[r("FormInput",{attrs:{label:e.$t("Default Loop Count"),name:e.$t("Default Loop Count"),helper:e.$t("Number of times to show the loop. Value must be greater than zero."),validation:"required|integer|min:1|max:100","data-cy":"inspector-times"},model:{value:e.settings.times,callback:function(a){e.$set(e.settings,"times",a)},expression:"settings.times"}})],1):e._e(),e.screenType=="form"?r("form-checkbox",{attrs:{name:"add",label:e.$t("Allow additional loops"),helper:e.$t("Check this box to allow task assignee to add additional loops"),"data-cy":"inspector-add"},model:{value:e.settings.add,callback:function(a){e.$set(e.settings,"add",a)},expression:"settings.add"}}):e._e()],1)},dQ=[],pQ=oe(uQ,cQ,dQ,!1,null,null,null,null);const Ex=pQ.exports,Bte="",fQ={components:{draggable:Oa,MonacoEditor:_a,MustacheHelper:Hi,CollectionSelectList:Zp},props:["options","selectedControl"],model:{prop:"options",event:"change"},data(){return{optionError:"",dragging:!1,dataSourceValues:ea,dataSources:Ts,dataSource:ea.provideData,jsonData:"",key:null,value:null,dataName:"",collectionOptions:null,selectedDataSource:"",dataSourcesList:[],selectedEndPoint:"",endpoints:{},pmqlQuery:"",optionsList:[],showOptionCard:!1,showRemoveWarning:!1,showJsonEditor:!1,optionCardType:"",editIndex:null,removeIndex:null,optionValue:"",optionContent:"",showRenderAs:!1,renderAs:"dropdown",allowMultiSelect:!1,defaultOptionKey:!1,selectedOptions:[],renderAsOptions:[{text:this.$t("Dropdown/Multiselect"),value:"dropdown"},{text:this.$t("Radio/Checkbox Group"),value:"checkbox"}],monacoOptions:{automaticLayout:!0,fontSize:8,language:"json",formatOnPaste:!0,formatOnType:!0},monacoLargeOptions:{automaticLayout:!0},showPopup:!1,returnValueOptions:[{text:this.$t("Single Value"),value:"single"},{text:this.$t("Object"),value:"object"}],valueTypeReturned:""}},watch:{allowMultiSelect(t){this.selectedControl.config.dataFormat=t?"array":"string"},options(t){Object.keys(t).forEach(e=>{typeof t[e]<"u"&&this.$set(this,e,t[e])})},dataSource(t){switch(this.showRenderAs=!0,t){case"dataConnector":this.jsonData="",this.dataName="",this.collectionOptions=null,this.getDataSourceList();break;case"dataObject":this.jsonData="",this.selectedDataSource="",this.collectionOptions=null;break;case"provideData":this.dataName="",this.selectedDataSource="",this.collectionOptions=null;break;case"collection":this.showRenderAs=!1,this.jsonData="",this.dataName="",this.selectedDataSource="";break}},dataObjectOptions(t){this.$emit("change",t)},dataSourcesList(){this.dataSourcesList.some(t=>t.value===this.selectedDataSource)||this.dataSourcesList.length>0&&(this.selectedDataSource=this.dataSourcesList[0].value)},endPointList(){this.endPointList.some(t=>t.value===this.selectedEndPoint)||this.endPointList.length>0&&(this.selectedEndPoint=this.endPointList[0].value)}},computed:{showTypeOfValueReturned(){return this.dataSource!==ea.collection},endPointList(){return H.get(this.endpoints,this.selectedDataSource,[])},dataSourceTypes(){return typeof this.options.allowMultiSelect>"u"?[this.dataSources[0],this.$t(this.dataSources[1])]:this.dataSources.map(t=>({value:t.value,text:this.$t(t.text)}))},optionKeyClass(){return this.optionError?"is-invalid":""},keyField(){return this.key||"value"},valueField(){return this.value||"content"},currentItemToDelete(){if(this.removeIndex!==null&&this.optionsList.length>0&&this.optionsList[this.removeIndex]!==void 0){let t=this.optionsList[this.removeIndex][this.valueField];return this.$t('Are you sure you want to delete "{{item}}" option?',{item:t})}return""},dataObjectOptions(){return this.dataName||(this.dataName=this.options.dataName?this.options.dataName:"response"),{dataSource:this.dataSource,jsonData:this.jsonData,dataName:this.dataName,collectionOptions:this.collectionOptions,selectedDataSource:this.selectedDataSource,selectedEndPoint:this.selectedEndPoint,key:this.key,value:this.value,pmqlQuery:this.pmqlQuery,defaultOptionKey:this.defaultOptionKey,selectedOptions:this.selectedOptions,optionsList:this.optionsList,showRenderAs:this.showRenderAs,renderAs:this.renderAs,allowMultiSelect:this.allowMultiSelect,showOptionCard:this.showOptionCard,showRemoveWarning:this.showRemoveWarning,showJsonEditor:this.showJsonEditor,editIndex:this.editIndex,removeIndex:this.removeIndex,valueTypeReturned:this.valueTypeReturned}}},created(){this.onDebouncedPmqlChange=H.debounce(t=>{this.onPmqlChange(t)},1500)},mounted(){this.dataSource=this.options.dataSource,this.jsonData=this.options.jsonData,this.dataName=this.options.dataName,this.collectionOptions=this.options.collectionOptions,this.selectedDataSource=this.options.selectedDataSource,this.selectedEndPoint=this.options.selectedEndPoint,this.key=this.options.key,this.value=this.options.value,this.pmqlQuery=this.options.pmqlQuery,this.defaultOptionKey=this.options.defaultOptionKey,this.selectedOptions=this.options.selectedOptions,this.optionsList=this.options.optionsList?this.options.optionsList:[],this.jsonData=JSON.stringify(this.optionsList),this.showRenderAs=this.options.showRenderAs,this.renderAs=this.options.renderAs,this.allowMultiSelect=this.options.allowMultiSelect,this.valueTypeReturned=this.options.valueTypeReturned},methods:{monacoMounted(t){t.getAction("editor.action.formatDocument").run()},getDataSourceList(){this.$dataProvider.get("/data_sources").then(t=>{let e=t.data.data;this.dataSourcesList=[{value:null,text:this.$t("Select...")}].concat(e.map(this.convertToSelectOptions)),this.setEndpointList(e)})},setEndpointList(t){const e={};t.forEach(r=>{const a=r.endpoints?r.endpoints:[];e[r.id]=[{value:null,text:this.$t("Select...")}].concat(Object.keys(a).map(i=>({text:i,value:i})))}),this.endpoints=e},convertToSelectOptions(t){return{value:t.id,text:t.name}},jsonDataChange(){let t=[];try{if(t=JSON.parse(this.jsonData),t.constructor!==Array&&t.constructor!==Object)throw Error("String does not represent a valid JSON")}catch(r){this.jsonError=r.message;return}this.optionsList=[];const e=this;t.forEach(r=>{e.optionsList.push({[e.keyField]:r[e.keyField],[e.valueField]:r[e.valueField]})}),this.jsonError=""},defaultOptionClick(){this.defaultOptionKey===event.target.value&&(this.defaultOptionKey=!1)},rowCss(t){return t%2===0?"striped":"bg-default"},keyChanged(){this.jsonDataChange()},valueChanged(){this.jsonDataChange()},updateSort(){this.jsonData=JSON.stringify(this.optionsList),this.$emit("change",this.dataObjectOptions)},showEditOption(t){this.optionCardType="edit",this.editIndex=t,this.optionContent=this.optionsList[t][this.valueField],this.optionValue=this.optionsList[t][this.keyField],this.optionError=""},showAddOption(){this.optionCardType="insert",this.optionContent="",this.optionValue="",this.showOptionCard=!0,this.optionError="",this.editIndex=null},addOption(){const t=this;if(this.optionCardType==="insert"){if(this.optionsList.find(e=>e[t.keyField]===this.optionValue)){this.optionError="An item with the same key already exists";return}this.optionsList.push({[this.valueField]:this.optionContent,[this.keyField]:this.optionValue})}else{if(this.optionsList.find((e,r)=>e[t.keyField]===this.optionValue&&r!==this.editIndex)){this.optionError="An item with the same key already exists";return}this.optionsList[this.editIndex][this.keyField]=this.optionValue,this.optionsList[this.editIndex][this.valueField]=this.optionContent}this.jsonData=JSON.stringify(this.optionsList),this.showOptionCard=!1,this.optionError="",this.editIndex=null},deleteOption(){this.optionsList.splice(this.removeIndex,1),this.jsonData=JSON.stringify(this.optionsList),this.showRemoveWarning=!1,this.removeIndex=null},removeOption(t){this.removeIndex=t,this.showRemoveWarning=!0},expandEditor(){this.showPopup=!0},closePopup(){this.showPopup=!1},onNLQConversion(t){this.pmqlQuery=t},onPmqlChange(t){this.pmqlQuery=t}}};var hQ=function(){var e=this,r=e._self._c;return r("div",[r("label",{attrs:{for:"data-sources"}},[e._v(e._s(e.$t("Data Source")))]),r("b-form-select",{staticClass:"mb-3",attrs:{id:"data-sources",options:e.dataSourceTypes,"data-cy":"inspector-data-sources"},model:{value:e.dataSource,callback:function(a){e.dataSource=a},expression:"dataSource"}}),!e.showJsonEditor&&e.dataSource===e.dataSourceValues.provideData?r("div",[r("div",{staticClass:"row"},[r("div",{staticClass:"col-10"},[r("label",{attrs:{for:"data-sources"}},[r("b",[e._v(e._s(e.$t("Options")))])])]),r("div",{staticClass:"col-2"},[r("a",{staticClass:"fas fa-plus-square",attrs:{"data-cy":"inspector-add-option"},on:{click:e.showAddOption}})])]),e.showOptionCard?r("div",{staticClass:"card mb-2"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Add Option"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Option"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass,"data-cy":"inspector-option-value"},model:{value:e.optionValue,callback:function(a){e.optionValue=a},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e(),r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Content")))]),r("b-form-input",{attrs:{id:"option-content","data-cy":"inspector-option-content"},model:{value:e.optionContent,callback:function(a){e.optionContent=a},expression:"optionContent"}})],1),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-2",attrs:{type:"button","data-cy":"inspector-option-cancel"},on:{click:function(a){e.showOptionCard=!1}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button","data-cy":"inspector-option-save"},on:{click:function(a){return e.addOption()}}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e._e(),r("div",{staticClass:"row"},[r("div",{staticClass:"col"},[r("draggable",{attrs:{element:"div",group:"options"},on:{update:e.updateSort,start:function(a){e.drag=!0},end:function(a){e.drag=!1}},model:{value:e.optionsList,callback:function(a){e.optionsList=a},expression:"optionsList"}},e._l(e.optionsList,function(a,i){return r("div",{key:a.value},[e.removeIndex===i?r("div",[r("div",{staticClass:"card mb-3 bg-danger text-white text-left mt-2"},[r("div",{staticClass:"card-body p-2",domProps:{innerHTML:e._s(e.currentItemToDelete)}}),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-light mr-2",attrs:{type:"button","data-cy":"inspector-options-remove-cancel"},on:{click:function(n){e.removeIndex=null}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-danger",attrs:{type:"button","data-cy":"inspector-options-remove-confirm"},on:{click:function(n){return e.deleteOption()}}},[e._v(" "+e._s(e.$t("Delete"))+" ")])])])]):e._e(),e.editIndex===i?r("div",[r("div",{staticClass:"card my-2"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Add Option"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Option"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass,"data-cy":"inspector-option-value"},model:{value:e.optionValue,callback:function(n){e.optionValue=n},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e(),r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Content")))]),r("b-form-input",{attrs:{id:"option-content","data-cy":"inspector-option-content"},model:{value:e.optionContent,callback:function(n){e.optionContent=n},expression:"optionContent"}})],1),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-2",attrs:{type:"button"},on:{click:function(n){e.editIndex=null}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button","data-cy":"inspector-option-save"},on:{click:function(n){return e.addOption()}}},[e._v(" "+e._s(e.$t("Update"))+" ")])])])]):e._e(),r("div",{staticClass:"row border-top",class:e.rowCss(i)},[r("div",{staticClass:"col-1",staticStyle:{cursor:"grab"}},[r("span",{staticClass:"fas fa-arrows-alt-v"})]),r("div",{staticClass:"col-1 d-flex align-items-center"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.defaultOptionKey,expression:"defaultOptionKey"}],staticClass:"form-check",attrs:{type:"radio",name:"defaultOptionGroup"},domProps:{value:a[e.keyField],checked:e._q(e.defaultOptionKey,a[e.keyField])},on:{click:e.defaultOptionClick,change:function(n){e.defaultOptionKey=a[e.keyField]}}})]),r("div",{staticClass:"col-5",staticStyle:{cursor:"grab"}},[e._v(" "+e._s(a[e.valueField])+" ")]),r("div",{staticClass:"col-1"},[r("a",{staticClass:"fas fa-cog",staticStyle:{cursor:"pointer"},attrs:{"data-cy":"inspector-options-edit"},on:{click:function(n){return e.showEditOption(i)}}})]),r("div",{staticClass:"col-1"},[r("a",{staticClass:"fas fa-trash-alt",staticStyle:{cursor:"pointer"},attrs:{"data-cy":"inspector-options-remove"},on:{click:function(n){return e.removeOption(i)}}})])])])}),0)],1)]),r("div",{staticClass:"row"},[r("div",{staticClass:"col text-right"},[r("button",{staticClass:"edit-json text-muted mt-1 mb-3",attrs:{type:"button","data-cy":"inspector-edit-json"},on:{click:function(a){e.showJsonEditor=!0}}},[r("i",{staticClass:"fas fa-code",attrs:{"aria-hidden":"true"}}),e._v(" "+e._s(e.$t("Edit as JSON"))+" ")])])])]):e._e(),e.dataSource===e.dataSourceValues.dataObject||e.dataSource===e.dataSourceValues.dataConnector?r("div",[r("label",{attrs:{for:"element-name"}},[e._v(e._s(e.$t("Options Variable")))]),r("mustache-helper"),r("b-form-input",{attrs:{id:"element-name",placeholder:"Request Variable Name","data-cy":"inspector-options-variable"},model:{value:e.dataName,callback:function(a){e.dataName=a},expression:"dataName"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Get options from this variable. Must be an array.")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataObject?r("div",[r("label",{attrs:{for:"value"}},[e._v(e._s(e.$t("Option Label Shown")))]),r("b-form-input",{attrs:{id:"value",placeholder:"Request Variable Property","data-cy":"inspector-options-label"},on:{change:e.valueChanged},model:{value:e.value,callback:function(a){e.value=a},expression:"value"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Enter the property name from the Request data variable that displays to the user on the screen.")))])],1):e._e(),e.dataSource===e.dataSourceValues.collection?r("div",[r("collection-select-list",{model:{value:e.collectionOptions,callback:function(a){e.collectionOptions=a},expression:"collectionOptions"}})],1):e._e(),e.showRenderAs?r("div",[r("div",{staticClass:"row mb-3"},[r("div",{staticClass:"col"},[r("label",{attrs:{for:"render-as"}},[e._v(e._s(e.$t("Show Control As")))]),r("b-form-select",{attrs:{id:"render-as",options:e.renderAsOptions,"data-cy":"inspector-render-as"},model:{value:e.renderAs,callback:function(a){e.renderAs=a},expression:"renderAs"}})],1)]),r("div",{staticClass:"row mb-3"},[r("div",{staticClass:"col-12"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.allowMultiSelect,expression:"allowMultiSelect"}],attrs:{type:"checkbox","data-cy":"inspector-allow-multi-select"},domProps:{checked:Array.isArray(e.allowMultiSelect)?e._i(e.allowMultiSelect,null)>-1:e.allowMultiSelect},on:{change:function(a){var i=e.allowMultiSelect,n=a.target,s=!!n.checked;if(Array.isArray(i)){var o=null,u=e._i(i,o);n.checked?u<0&&(e.allowMultiSelect=i.concat([o])):u>-1&&(e.allowMultiSelect=i.slice(0,u).concat(i.slice(u+1)))}else e.allowMultiSelect=s}}}),e._v(" "+e._s(e.$t("Allow Multiple Selections"))+" ")])])]):e._e(),e.showJsonEditor&&e.dataSource===e.dataSourceValues.provideData?r("div",[r("div",{staticClass:"mb-2"},[r("label",{attrs:{for:"json-data"}},[e._v(e._s(e.$t("JSON Data")))]),r("button",{staticClass:"btn-sm float-right",attrs:{type:"button","data-cy":"inspector-monaco-json-expand"},on:{click:e.expandEditor}},[r("i",{staticClass:"fas fa-expand"})])]),r("div",{staticClass:"small-editor-container"},[r("monaco-editor",{staticClass:"editor",attrs:{options:e.monacoOptions,language:"json","data-cy":"inspector-monaco-json"},on:{change:e.jsonDataChange,editorDidMount:e.monacoMounted},model:{value:e.jsonData,callback:function(a){e.jsonData=a},expression:"jsonData"}})],1),r("b-modal",{attrs:{size:"lg",centered:"",title:e.$t("Script Config Editor")},model:{value:e.showPopup,callback:function(a){e.showPopup=a},expression:"showPopup"}},[r("div",{staticClass:"editor-container"},[r("monaco-editor",{staticClass:"editor",attrs:{options:e.monacoLargeOptions,language:"json","data-cy":"inspector-monaco-json-expanded"},on:{change:e.jsonDataChange},model:{value:e.jsonData,callback:function(a){e.jsonData=a},expression:"jsonData"}})],1),r("div",{attrs:{slot:"modal-footer"},slot:"modal-footer"},[r("b-button",{staticClass:"btn btn-secondary text-uppercase",attrs:{"data-cy":"inspector-monaco-json-expanded-close"},on:{click:e.closePopup}},[e._v(" "+e._s(e.$t("Close"))+" ")])],1)]),r("button",{staticClass:"edit-json text-muted mt-1 mb-3",attrs:{type:"button"},on:{click:function(a){e.showJsonEditor=!1}}},[r("i",{staticClass:"fas fa-code",attrs:{"aria-hidden":"true"}}),e._v(" "+e._s(e.$t("Edit as Option List"))+" ")])],1):e._e(),e.showTypeOfValueReturned?r("div",[r("label",{attrs:{for:"value-type-returned"}},[e._v(e._s(e.$t("Type of Value Returned")))]),r("b-form-select",{attrs:{id:"value-type-returded",options:e.returnValueOptions,"data-cy":"inspector-value-returned"},model:{value:e.valueTypeReturned,callback:function(a){e.valueTypeReturned=a},expression:"valueTypeReturned"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Select 'Single Value' to use parts of the selected object. Select 'Object' to use the entire selected value.")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataConnector?r("div",[e.valueTypeReturned==="single"?r("div",[r("label",{attrs:{for:"key"}},[e._v(e._s(e.$t("Value")))]),r("mustache-helper"),r("b-form-input",{attrs:{id:"key","data-cy":"inspector-datasource-value"},on:{change:e.keyChanged},model:{value:e.key,callback:function(a){e.key=a},expression:"key"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Key name in the selected object to use as the value of this control. Leave blank to use the entire selected value.")))])],1):e._e(),r("label",{attrs:{for:"value"}},[e._v(e._s(e.$t("Content")))]),r("mustache-helper"),r("b-form-input",{attrs:{id:"value","data-cy":"inspector-datasource-content"},on:{change:e.valueChanged},model:{value:e.value,callback:function(a){e.value=a},expression:"value"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Content to display to the user in the select list.")))])],1):e._e(),e.valueTypeReturned==="single"&&e.dataSource===e.dataSourceValues.dataObject?r("div",[r("label",{attrs:{for:"key"}},[e._v(e._s(e.$t("Variable Data Property")))]),r("b-form-input",{attrs:{id:"key",placeholder:"Request Variable Property","data-cy":"inspector-options-value"},on:{change:e.keyChanged},model:{value:e.key,callback:function(a){e.key=a},expression:"key"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Enter the property name from the Request data variable that will be passed as the value when selected.")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataConnector?r("div",[r("label",{attrs:{for:"data-sources-list"}},[e._v(e._s(e.$t("Data Connector")))]),r("b-form-select",{class:e.selectedDataSource?"":"is-invalid",attrs:{id:"data-sources-list",options:e.dataSourcesList,"data-cy":"inspector-data-connector"},model:{value:e.selectedDataSource,callback:function(a){e.selectedDataSource=a},expression:"selectedDataSource"}}),e.selectedDataSource?e._e():r("div",{staticClass:"invalid-feedback"},[e._v(e._s(e.$t("An Data Connector must be selected")))]),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Data Connector to use")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataConnector?r("div",[r("label",{attrs:{for:"endpoint-list"}},[e._v(e._s(e.$t("End Point")))]),r("b-form-select",{class:e.selectedDataSource&&!e.selectedEndPoint?"is-invalid":"",attrs:{id:"endpoint-list",options:e.endPointList,"data-cy":"inspector-endpoint"},model:{value:e.selectedEndPoint,callback:function(a){e.selectedEndPoint=a},expression:"selectedEndPoint"}}),e.selectedDataSource&&!e.selectedEndPoint?r("div",{staticClass:"invalid-feedback"},[e._v(e._s(e.$t("An Endpoint must be selected")))]):e._e(),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Endpoint to populate select")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataConnector?r("div",[r("pmql-input",{staticClass:"mb-1",attrs:{"search-type":"collections","input-label":"PMQL",condensed:!0,"ai-enabled":!0,placeholder:e.$t("PMQL")},model:{value:e.pmqlQuery,callback:function(a){e.pmqlQuery=a},expression:"pmqlQuery"}}),r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("Advanced data search")))])],1):e._e()],1)},mQ=[],gQ=oe(fQ,hQ,mQ,!1,null,"e0acf8b1",null,null);const Mx=gQ.exports,Wte="",vQ={components:{MustacheHelper:Hi},mixins:[],props:{value:String},data(){return{field:"",outboundConfig:[],types:["PARAM","HEADER","BODY"],apiProperties:[],type:null}},watch:{outboundConfig:{deep:!0,immediate:!0,handler(t){this.setConfig("outboundConfig",t)}},value:{immediate:!0,handler(){const{outboundConfig:t}=this.getConfig();t&&(this.outboundConfig.splice(0),t.forEach(e=>{this.outboundConfig.push(e)}))}}},methods:{getConfig(){try{return JSON.parse(this.value)}catch{return{}}},setConfig(t,e){const r=this.getConfig();JSON.stringify(r[t])!==JSON.stringify(e)&&(r[t]=e,this.$emit("input",JSON.stringify(r)))},removeRowIndex(t){this.outboundConfig.splice(t,1)},addMapping(){this.outboundConfig.push({type:"PARAM",key:"",value:""})},loadOptions(t){const e=this.getConfig();if(this.apiProperties=[],H.isNil(e.dataSource)||H.isNil(e.endpoint))return;let{endpoint:r}=e;const a=e.endpoint.split(":");a.length>1&&(a.shift(),r=a.join("").trim()),window.ProcessMaker.apiClient.get(`/data_sources/${e.dataSource}`).then(i=>{const n=this.outboundConfig[t].type,s=H.get(i,`data.endpoints.${r}`,null);if(s!==null){if(this.apiProperties=[],n==="HEADER"){const o=H.get(s,"headers",[]);this.apiProperties=o.reduce((u,l)=>(H.findIndex(this.apiProperties,{key:l.key})<0&&u.push(l.key),u),[])}if(n==="PARAM"){const o=H.get(s,"params",[]);this.apiProperties=o.reduce((l,c)=>(H.findIndex(this.apiProperties,{key:c.key})<0&&l.push(c.key),l),[]);const u=(s.url||"").matchAll(/\{\{(.+?)}}/gm);for(const l of u){const c=l[1];this.apiProperties.every(d=>d!==c)&&this.apiProperties.push(c)}}if(n==="BODY"){const o=(s.body||"").matchAll(/\{\{(.+?)}}/gm);for(const u of o){const l=u[1];this.apiProperties.every(c=>c!==l)&&this.apiProperties.push(l)}}}})}}};var bQ=function(){var e=this,r=e._self._c;return r("div",[r("div",{staticClass:"d-flex mb-1"},[r("label",{staticClass:"flex-grow-1 m-0"},[e._v(e._s(e.$t("Outbound Configuration")))]),r("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm px-2",attrs:{type:"button"},on:{click:e.addMapping}},[e._v(" + "+e._s(e.$t("Property"))+" ")])]),r("table",{staticClass:"table table-striped table-sm border mb-1"},[r("thead",[r("tr",[r("th",{attrs:{scope:"col"}},[e._v(e._s(e.$t("Type")))]),r("th",{attrs:{scope:"col"}},[e._v(e._s(e.$t("Key")))]),r("th",{attrs:{scope:"col"}},[r("div",{staticClass:"float-left"},[e._v(e._s(e.$t("Value")))]),r("mustache-helper",{staticClass:"float-left ml-2"})],1),r("th",{attrs:{scope:"col"}},[e._v(" ")])])]),r("tbody",e._l(e.outboundConfig,function(a,i){return r("tr",{key:i},[r("td",{staticClass:"p-1"},[r("multiselect",{attrs:{placeholder:e.$t("Select a parameter type"),options:e.types,multiple:!1,"show-labels":!1,searchable:!0,"internal-search":!1},model:{value:a.type,callback:function(n){e.$set(a,"type",n)},expression:"row.type"}})],1),r("td",{staticClass:"p-1"},[r("multiselect",{attrs:{placeholder:e.$t("Select a connector property"),options:e.apiProperties,multiple:!1,"show-labels":!1,searchable:!0,"internal-search":!1},on:{"search-change":function(n){return e.loadOptions(i)},open:function(n){return e.loadOptions(i)}},model:{value:a.key,callback:function(n){e.$set(a,"key",n)},expression:"row.key"}},[r("template",{slot:"noResult"},[e._t("noResult",function(){return[e._v(e._s(e.$t("Not found")))]})],2),r("template",{slot:"noOptions"},[e._t("noOptions",function(){return[e._v(e._s(e.$t("Not available")))]})],2)],2)],1),r("td",{staticClass:"p-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:a.value,expression:"row.value"}],staticClass:"form-control",attrs:{name:"value",placeholder:e.$t("New Value"),type:"text"},domProps:{value:a.value},on:{input:function(n){n.target.composing||e.$set(a,"value",n.target.value)}}})]),r("td",{staticClass:"align-middle text-right p-1"},[r("a",{staticClass:"btn btn-sm btn-danger",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.removeRowIndex(i)}}},[r("i",{staticClass:"fa fa-trash-alt"})])])])}),0)]),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(" "+e._s(e.$t("Properties to map from a request variable to a Data Connector property"))+" "),r("br"),e._v(" "+e._s(e.$t("The value can be a string or a mustache expression."))+" "+e._s(e.$t("For example"))+" "),r("span",{pre:!0},[e._v(" {{ var1 }} ")]),e._v(" "+e._s(e.$t("will use the value stored in variable var1"))+" ")])])},yQ=[],SQ=oe(vQ,bQ,yQ,!1,null,"8e9c415d",null,null);const af=SQ.exports,xQ={inheritAttrs:!1,props:["label","helper","formConfig","currentPage"],methods:{getLabelFromValue(t){const e=this.options.find(r=>r.value==t);return e?e.content:null}},computed:{options(){return Object.keys(this.formConfig).filter(t=>t!=this.currentPage).map(t=>({value:t,content:this.formConfig[t].name}))}}};var kQ=function(){var e=this,r=e._self._c;return r("div",[r("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),r("multiselect",e._g(e._b({attrs:{placeholder:e.$t("Select..."),"show-labels":!1,options:e.options.map(a=>a.value),"custom-label":e.getLabelFromValue}},"multiselect",e.$attrs,!1),e.$listeners),[r("template",{slot:"noResult"},[e._v(" "+e._s(e.$t("No elements found. Consider changing the search query."))+" ")]),r("template",{slot:"noOptions"},[e._v(" "+e._s(e.$t("No Data Available"))+" ")])],2),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]):e._e()],1)},_Q=[],wQ=oe(xQ,kQ,_Q,!1,null,null,null,null);const $x=wQ.exports,As={form:"form",display:"display"},CQ=[{inspector:[{type:"FormInput",field:"conditionalHide",config:{label:"Visibility Rule",helper:"This control is hidden until this expression is true"}},{type:"DeviceVisibility",field:"deviceVisibility",config:{label:"Device Visibility",helper:"This control is hidden until this expression is true"}},{type:"FormInput",field:"customFormatter",config:{label:"Custom Format String",helper:"Use the Mask Pattern format <br> Date ##/##/#### <br> SSN ###-##-#### <br> Phone (###) ###-####",validation:""}},{type:"FormInput",field:"customCssSelector",config:{label:"CSS Selector Name",helper:"Use this in your custom css rules",validation:"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{type:"FormInput",field:"ariaLabel",config:{label:"Aria Label",helper:"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{type:"FormInput",field:"tabindex",config:{label:"Tab Order",helper:"Order in which a user will move focus from one control to another by pressing the Tab key",validation:"regex: [0-9]*"}}]}],TQ=typeof window>"u"?global:window,AQ={mixins:[nb],props:{api:{type:String,default:"screens"},builder:{type:Object,required:!0},screenType:{type:String,default:As.form},validateNested:{type:Boolean,default:!1}},mounted(){this.$root.$on("remove-nested",e=>{this.value===e&&this.$emit("input",null)});let t='(type = "FORM" or type = "DISPLAY")';this.screenType===As.display&&(t='(type = "DISPLAY")'),this.builder.screen&&(t+=` and id != ${this.builder.screen.id}`),this.pmql=t,this.fields="screens.id,title"},methods:{isNavButton(t){return t.config&&t.component==="FormButton"&&t.config.event==="pageNavigate"},containsNavbutton(t){t.forEach(e=>{Array.isArray(e)&&this.containsNavbutton(e),e.items&&this.containsNavbutton(e.items),this.isNavButton(e)&&(this.nav=!0)})},change(t){if(t&&this.validateNested&&(this.nav=!1,this.containsNavbutton(t.config),this.nav))return TQ.ProcessMaker.alert(this.$t("The nested form contains navigation buttons"),"warning"),!1;const e=this.storeId?H.get(t,this.trackBy):t;this.$dataProvider.flushScreenCache(),this.$emit("input",e)}}};var OQ=function(){var e=this,r=e._self._c;return r("div",[r("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),r("multiselect",{attrs:{value:e.selectedOption,placeholder:e.placeholder,options:e.options,multiple:e.multiple,"track-by":e.trackBy,"show-labels":!1,searchable:!0,"internal-search":!1,label:"title"},on:{input:e.change,"search-change":e.loadOptions,open:function(a){return e.loadOptions()}}},[r("template",{slot:"noResult"},[e._t("noResult",function(){return[e._v(e._s(e.$t("Not found")))]})],2),r("template",{slot:"noOptions"},[e._t("noOptions",function(){return[e._v(e._s(e.$t("No Data Available")))]})],2)],2),e.value?r("div",{staticClass:"screen-link mt-2"},[r("a",{attrs:{href:`/designer/screen-builder/${e.value}/edit`,target:"_blank"}},[e._v(" "+e._s(e.$t("Open Screen"))+" "),r("i",{staticClass:"ml-1 fas fa-external-link-alt"})])]):e._e()],1)},EQ=[],MQ=oe(AQ,OQ,EQ,!1,null,null,null,null);const Px=MQ.exports,Dx={defaultMask:{label:"Data Format",options:[],config:{}},currency:{label:"Currency Format",options:du,optionsLabel:"code",config:du}},$Q={extends:tf,computed:{isVisible(){return this.selectedControl.config.dataFormat==="currency"},maskConfig(){return Dx[this.selectedControl.config.dataFormat]||Dx.defaultMask},maskLabel(){return this.$t(this.maskConfig.label||"Data Format")},maskOptions(){return this.maskConfig.options},maskOptionsLabel(){return this.maskConfig.optionsLabel}}};var PQ=function(){var e=this,r=e._self._c;return r("div",{directives:[{name:"show",rawName:"v-show",value:e.isVisible,expression:"isVisible"}]},[r("label",{staticClass:"typo__label"},[e._v(e._s(e.maskLabel))]),r("multiselect",e._g(e._b({class:e.classList,attrs:{value:e.value,placeholder:e.$t("Select..."),"show-labels":!1,options:e.maskOptions,label:e.maskOptionsLabel}},"multiselect",e.$attrs,!1),e.$listeners),[r("template",{slot:"noResult"},[e._v(e._s(e.$t("No elements found. Consider changing the search query.")))]),r("template",{slot:"noOptions"},[e._v(e._s(e.$t("No Data Available")))])],2),e.validator&&e.validator.errorCount||e.error?r("div",{staticClass:"invalid-feedback d-block"},[e._l(e.validator.errors.get(this.name),function(a,i){return r("div",{key:i},[e._v(e._s(a))])}),e.error?r("div",[e._v(e._s(e.error))]):e._e()],2):e._e(),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]):e._e()],1)},DQ=[],IQ=oe($Q,PQ,DQ,!1,null,null,null,null);const nf=IQ.exports,Vte="",zQ={components:{FormInput:ee.FormInput,InputVariable:rf,FormCheckbox:ee.FormCheckbox},props:["label","value","helper","name","builder","selectedControl","formConfig"],data(){return{rules:[],showCard:!1,showDeleteConfirmCard:!1,selectedOption:"",confirmMessage:"",removeIndex:null,optionError:"",disableBtn:!1,cloneRules:[],options:[{value:"accepted",content:this.$t("Accepted"),helper:this.$t("The field under validation must be yes, on, 1 or true.")},{value:"alpha",content:this.$t("Alpha"),helper:this.$t("The field under validation must be entirely alphabetic characters.")},{value:"alpha_num",content:this.$t("Alpha-Numeric"),helper:this.$t("The field under validation must be entirely alpha-numeric characters.")},{value:"",field:"between:",content:this.$t("Between Min & Max"),helper:this.$t("The field under validation must have a size between the given min and max."),visible:!0,configs:[{type:"FormInput",label:this.$t("Min"),helper:"",validation:"required|integer"},{type:"FormInput",label:this.$t("Max"),helper:"",validation:"required|integer"}]},{value:"email",content:this.$t("Email"),helper:this.$t("The field under validation must be formatted as an e-mail address.")},{value:"",field:"in:",content:this.$t("In"),helper:this.$t("The field under validation must be included in the given list of values. The field can be an array or string."),visible:!0,configs:[{type:"FormInput",label:this.$t("Values"),helper:"",validation:"required"}]},{value:"",field:"max:",content:this.$t("Max Length"),helper:"",visible:!0,configs:[{type:"FormInput",label:this.$t("Max Input"),helper:this.$t("Validate that an attribute is no greater than a given length."),validation:"required|integer"}]},{value:"",field:"min:",content:this.$t("Min Length"),helper:"",visible:!0,configs:[{type:"FormInput",label:this.$t("Min Input"),helper:this.$t("Validate that an attribute is at least a given length."),validation:"required|integer"}]},{value:"",field:"not_in:",content:this.$t("Not In"),helper:this.$t("The field under validation must not be included in the given list of values."),visible:!0,configs:[{type:"FormInput",label:this.$t("Values"),helper:"",validation:"required"}]},{value:"required",content:this.$t("Required"),helper:this.$t("Checks if the length of the String representation of the value is >")},{value:"",field:"required_if:",content:this.$t("Required If"),helper:this.$t("The field under validation must be present and not empty if the Variable Name field is equal to any value."),visible:!0,configs:[{type:"InputVariable",name:"variable-name",label:this.$t("Variable Name"),helper:"",validation:"required"},{type:"FormInput",name:"variable-value",label:this.$t("Variable Value"),helper:"",validation:""}]},{value:"",field:"required_unless:",content:this.$t("Required Unless"),helper:this.$t("The field under validation must be present and not empty unless the Variable Name field is equal to any value."),visible:!0,configs:[{type:"InputVariable",name:"variable-name",label:this.$t("Variable Name"),helper:"",validation:"required"},{type:"FormInput",name:"variable-value",label:this.$t("Variable Value"),helper:""}]},{value:"",field:"same:",content:this.$t("Same"),helper:this.$t("The given field must match the field under validation."),visible:!0,configs:[{type:"InputVariable",name:"variable-name",label:this.$t("Variable Name"),helper:"",validation:"required"}]},{value:"url",content:"URL",helper:this.$t("Validate that an attribute has a valid URL format.")},{value:"custom_date",content:"Date",helper:this.$t("The field under validation must be a valid date format which is acceptable by Javascript's Date object.")},{value:"",field:"after:",content:this.$t("After Date"),helper:this.$t("The field under validation must be after the given date."),visible:!0,configs:[{type:"FormInput",label:this.$t("Date"),helper:"",validation:"required"}]},{value:"",field:"after_or_equal:",content:this.$t("After or Equal to Date"),helper:this.$t("The field unter validation must be after or equal to the given field."),visible:!0,configs:[{type:"FormInput",label:this.$t("Date"),helper:"",validation:"required"}]},{value:"",field:"before:",content:this.$t("Before Date"),helper:this.$t("The field unter validation must be before the given date."),visible:!0,configs:[{type:"FormInput",label:this.$t("Date"),helper:"",validation:"required"}]},{value:"",field:"before_or_equal:",content:this.$t("Before or Equal to Date"),helper:this.$t("The field unter validation must be before or equal to the given field."),visible:!0,configs:[{type:"FormInput",label:this.$t("Date"),helper:"",validation:"required"}]},{value:"",field:"regex:",content:this.$t("Regex"),helper:this.$t("The field under validation must match the given regular expression."),visible:!0,configs:[{type:"FormInput",label:this.$t("Regex Pattern"),helper:"",validation:"required"}]}].sort((t,e)=>t.content>e.content?1:-1)}},computed:{fieldClass(){return this.optionError?"is-invalid":""},hasRules(){return!!(this.rules&&this.rules.length)},requiredCheckbox:{get(){return this.rules.some(t=>t.value==="required")},set(t){t?this.rules.push(this.options.find(e=>e.value==="required")):this.rules=this.rules.filter(e=>e.value!=="required")}}},watch:{rules:{deep:!0,handler(t){this.showCard=!1,this.selectedOption="",(typeof t=="string"||t===void 0)&&(this.rules=[]),this.rules&&this.setRuleConfigs(),this.$emit("input",t)}},value(){this.rules=this.value||[],this.cloneSetRules()},selectedOption:{deep:!0,handler(t){var e;this.disableBtn=!0,this.optionError="",t&&((e=this.rules)!=null&&e.find(r=>r.content===t.content)?(this.optionError=this.$t("This field already exists"),this.disableBtn=!0):this.disableBtn=!1)}}},mounted(){this.rules=this.value||[],this.cloneSetRules()},methods:{showAddCard(){this.showCard=!0,this.selectedOption||(this.disableBtn=!0)},hideCard(){this.showCard=!1,this.selectedOption="",this.optionError=""},saveRule(){const t=H.cloneDeep(this.selectedOption);this.rules.push(t),this.hideCard(),this.selectedOption=""},confirmDelete(t){this.removeIndex=t,this.showDeleteConfirmCard=!0,this.confirmMessage=H.unescape(this.$t('Are you sure you want to delete the "{{item}}" rule?',{item:this.rules[t].content}))},hideDeleteConfirmCard(){this.removeIndex=null,this.showDeleteConfirmCard=!1},deleteRule(t){this.rules.splice(t,1),this.cloneRules.splice(t,1),this.hideDeleteConfirmCard()},setRuleConfigs(){this.rules.forEach(t=>{if(t.configs){let e=[];t.configs.forEach(r=>{r.value&&e.push(r.value)}),e.length>1&&(e=e.join(",")),e.length&&(t.value=t.field+e)}})},onUpdate(t,e){const r=this.formatRuleContentAsId(t.content);this.$root.$emit("bv::toggle::collapse",r),this.$set(this.rules[e],"visible",!1),this.cloneRules=JSON.parse(JSON.stringify(this.rules))},onCancel(t,e){const r=this.formatRuleContentAsId(t.content);this.cloneRules&&this.cloneRules[e]?H.isEqual(t,this.cloneRules[e])||Object.assign(this.rules[e],JSON.parse(JSON.stringify(this.cloneRules[e]))):(t.configs.forEach(a=>{a.value&&(a.value="")}),this.rules[e].configs=t.configs),this.$root.$emit("bv::toggle::collapse",r)},formatRuleContentAsId(t){return t.toLowerCase().split(" ").join("-")},cloneSetRules(){this.cloneRules=JSON.parse(JSON.stringify(this.rules))}}};var LQ=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("div",{staticClass:"d-flex justify-content-between align-items-center mb-3"},[r("label",{staticClass:"m-0"},[e._v(e._s(e.label))]),r("b-button",{attrs:{variant:"secondary",size:"sm","data-cy":"add-rule"},on:{click:e.showAddCard}},[e._v(e._s(e.$t("Add Rule")))])],1),e.showCard?r("div",{staticClass:"card mb-2"},[r("div",{staticClass:"card-body p-2"},[r("multiselect",{class:e.fieldClass,attrs:{label:"content","track-by":"content",placeholder:e.$t("Select..."),"show-labels":!1,options:e.options,"data-cy":"select-rule"},model:{value:e.selectedOption,callback:function(a){e.selectedOption=a},expression:"selectedOption"}},[r("template",{slot:"noResult"},[e._v(e._s(e.$t("No elements found. Consider changing the search query.")))]),r("template",{slot:"noOptions"},[e._v(e._s(e.$t("No Data Available")))])],2),e.optionError?r("div",{staticClass:"invalid-feedback d-block"},[r("div",[e._v(e._s(e.optionError))])]):e._e()],1),r("div",{staticClass:"card-footer text-right p-2"},[r("b-button",{staticClass:"mr-2",attrs:{variant:"outline-secondary",size:"sm","data-cy":"cancel-rule"},on:{click:e.hideCard}},[e._v(e._s(e.$t("Cancel")))]),r("b-button",{attrs:{disabled:e.disableBtn,variant:"secondary",size:"sm","data-cy":"save-rule"},on:{click:e.saveRule}},[e._v(e._s(e.$t("Save")))])],1)]):e._e(),!e.hasRules&&!e.showCard?r("p",[e._v(e._s(e.$t("No validation rule(s)")))]):e._e(),e.hasRules?r("div",[r("div",{attrs:{role:"tablist"}},e._l(e.rules,function(a,i){return r("b-card",{key:i,staticClass:"mb-2 border-1",class:{"border-0":e.showDeleteConfirmCard,"border-top-1":e.showDeleteConfirmCard,"border-1":!e.showDeleteConfirmCard}},[e.showDeleteConfirmCard&&e.removeIndex==i?r("div",{staticClass:"card mb-3 bg-danger text-white text-right"},[r("div",{staticClass:"card-body p-2 text-left"},[e._v(" "+e._s(e.confirmMessage)+" ")]),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-light mr-2",attrs:{type:"button","data-cy":"cancel-confirm-delete-rule"},on:{click:e.hideDeleteConfirmCard}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-danger",attrs:{type:"button","data-cy":"confirm-delete-rule"},on:{click:function(n){return e.deleteRule(i)}}},[e._v(" "+e._s(e.$t("Delete"))+" ")])])]):e._e(),r("b-card-header",{staticClass:"p-0",attrs:{"header-tag":"header",role:"tab"}},[r("div",{staticClass:"p-1 d-flex justify-content-between align-items-center"},[e._v(" "+e._s(a.content)+" "),r("div",{staticClass:"actions"},[a.configs?r("b-button",{directives:[{name:"b-toggle",rawName:"v-b-toggle",value:e.formatRuleContentAsId(a.content),expression:"formatRuleContentAsId(rule.content)"}],staticClass:"p-0 mr-1 secondary",attrs:{"aria-label":e.$t("Toggle Configuration"),variant:"link","data-cy":"edit-rule"}},[r("i",{staticClass:"fas fa-cog fa-fw text-secondary"})]):e._e(),r("b-button",{staticClass:"p-0",attrs:{"aria-label":e.$t("Delete"),variant:"link","data-cy":"remove-rule"},on:{click:function(n){return e.confirmDelete(i)}}},[r("i",{staticClass:"fas fa-trash-alt fa-fw text-secondary"})])],1)])]),r("b-collapse",{attrs:{id:e.formatRuleContentAsId(a.content),accordion:e.formatRuleContentAsId(a.content),visible:a.visible,role:"tabpanel"}},[r("b-card-body",[r("div",{staticClass:"p-2"},[e._l(a.configs,function(n){return r("div",{key:n.label,staticClass:"mb-2"},[n.type==="FormInput"?r("div",[r("form-input",{attrs:{label:n.label,name:n.name||n.label,validation:n.validation,helper:n.helper},model:{value:n.value,callback:function(s){e.$set(n,"value",s)},expression:"config.value"}})],1):r(n.type,{tag:"component",attrs:{label:n.label,name:n.name||n.label,validation:n.validation,helper:n.helper,builder:e.builder,"selected-control":e.selectedControl,"form-config":e.formConfig},model:{value:n.value,callback:function(s){e.$set(n,"value",s)},expression:"config.value"}})],1)}),r("div",[r("small",{staticClass:"form-text text-muted"},[e._v(e._s(a.helper))])])],2),r("b-card-footer",{staticClass:"text-right"},[r("b-button",{staticClass:"mr-2",attrs:{variant:"outline-secondary",size:"sm","data-cy":"cancel-rule"},on:{click:function(n){return e.onCancel(a,i)}}},[e._v(e._s(e.$t("Cancel")))]),r("b-button",{attrs:{variant:"secondary",size:"sm","data-cy":"update-rule"},on:{click:function(n){return e.onUpdate(a,i)}}},[e._v(e._s(e.$t("Update")))])],1)],1)],1)],1)}),1)]):e._e(),r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]),r("div",{staticClass:"mt-4 required-checkbox"},[r("form-checkbox",{attrs:{label:e.$t("Make Required")},model:{value:e.requiredCheckbox,callback:function(a){e.requiredCheckbox=a},expression:"requiredCheckbox"}})],1)])},jQ=[],NQ=oe(zQ,LQ,jQ,!1,null,"a2315d60",null,null);const Ix=NQ.exports,RQ={components:{FormCheckbox:ee.FormCheckbox},props:["value","selectedControl"],data(){return{event:"",loading:null}},computed:{mode(){return this.$root.$children[0].mode}},watch:{loading(){this.$emit("input",this.loading)},value(){this.loading=this.value},"selectedControl.config.event":function(t){this.event=t}},mounted(){this.event=this.selectedControl.config.event,this.loading=this.value}};var FQ=function(){var e=this,r=e._self._c;return e.event==="submit"?r("div",{staticStyle:{"border-style":"none !important"}},[r("div",[r("form-checkbox",{attrs:{label:e.$t("Loading Submit Button"),toggle:!1,helper:e.$t("Loading Submit Button")},model:{value:e.loading,callback:function(a){e.loading=a},expression:"loading"}})],1)]):e._e()},qQ=[],BQ=oe(RQ,FQ,qQ,!1,null,null,null,null);const zx=BQ.exports,WQ={components:{FormInput:ee.FormInput},props:["value","selectedControl"],data(){return{event:"",loadingLabel:null}},computed:{mode(){return this.$root.$children[0].mode}},watch:{loadingLabel(){this.$emit("input",this.loadingLabel)},value(){this.loadingLabel=this.value},"selectedControl.config.event":function(t){this.event=t}},mounted(){this.event=this.selectedControl.config.event,this.loadingLabel=this.value}};var VQ=function(){var e=this,r=e._self._c;return e.event==="submit"?r("div",{staticStyle:{"padding-top":"0px !important"}},[r("div",[r("form-input",{staticClass:"mb-3",attrs:{type:"text",label:e.$t("Loading Label")},model:{value:e.loadingLabel,callback:function(a){e.loadingLabel=a},expression:"loadingLabel"}})],1)]):e._e()},UQ=[],GQ=oe(WQ,VQ,UQ,!1,null,null,null,null);const Lx=GQ.exports,HQ={props:["value"],data(){return{selectedOption:null,formattedOptions:[{name:"",link:""}]}},watch:{selectedOption(t){this.$emit("input",t)},value(){this.selectedOption=this.value}},mounted(){this.fetchChartData(),this.selectedOption=this.value},methods:{fetchChartData(){try{ProcessMaker.apiClient.get("analytics-reporting-all").then(t=>{this.formattedOptions=t.data.data.map(e=>({name:e.name,link:e.link}))})}catch(t){console.error("Error fetching data:",t)}}}};var YQ=function(){var e=this,r=e._self._c;return r("div",[r("label",{staticClass:"typo__label"},[e._v(e._s(e.$t("Analytics Management")))]),r("multiselect",{attrs:{placeholder:e.$t("Select Chart"),"internal-search":!1,"show-labels":!1,options:e.formattedOptions,label:"name","track-by":"link",multiple:!1,"allow-empty":!1},model:{value:e.selectedOption,callback:function(a){e.selectedOption=a},expression:"selectedOption"}})],1)},QQ=[],KQ=oe(HQ,YQ,QQ,!1,null,null,null,null);const jx=KQ.exports,Nx=Object.freeze(Object.defineProperty({__proto__:null,AnalyticsSelector:jx,CollectionSelectList:Zp,ColorSelect:_x,ColumnSetup:wx,ContainerColumns:Cx,DataMapping:Xp,DefaultValueEditor:ef,DeviceVisibility:ed,EditOption:Tx,FormMultiselect:tf,ImageUpload:Ax,ImageVariable:Ox,InputVariable:rf,LabelSubmitButton:Lx,LoadingSubmitButton:zx,LoopInspector:Ex,MustacheHelper:Hi,OptionsList:Mx,OutboundConfig:af,PageSelect:$x,ScreenSelector:Px,SelectDataTypeMask:nf,Tooltip:Xc,ValidationSelect:Ix,dataSourceValues:ea,dataSources:Ts},Symbol.toStringTag,{value:"Module"})),Ute="",Rx=[{name:"Variable",fields:[{name:"name",hideFor:"FormImage"},"fieldValue","label","dataFormat","dataMask","validation","readonly","disabled","initiallyChecked","screen","multipleUpload"],open:!0},{name:"Configuration",fields:[{name:"name",showFor:"FormImage"},"image","eventData","tooltip","type","placeholder","content","helper","Multiselect checkbox (doesn’t exist)","richtext","rows",{name:"options",showFor:"FormMultiColumn"},"form","editable"],open:!1},{name(t){return t.component==="AiSection"?"AI Section":t.component==="FormRecordList"?"Columns":"Data Source"},fields:["fields",{name:"options",hideFor:"FormMultiColumn"}],open:!1},{name:"Design",fields:["color","bgcolor","variant","toggle","height","width"],open:!1},{name:"Advanced",fields:["conditionalHide","deviceVisibility","customCssSelector","defaultValue","showForDesktop",{name:"customFormatter",showFor:"FormInput"},{name:"ariaLabel",showFor:"FormInput"},{name:"ariaLabel",showFor:"FormSelectList"},{name:"ariaLabel",showFor:"FormDatePicker"},{name:"ariaLabel",showFor:"FormCheckbox"},{name:"ariaLabel",showFor:"FormDatePicker"},{name:"ariaLabel",showFor:"FileUpload"},{name:"ariaLabel",showFor:"FileDownload"},{name:"ariaLabel",showFor:"FormSelectList"},{name:"ariaLabel",showFor:"FormButton"},{name:"ariaLabel",showFor:"FormTextArea"},{name:"tabindex",showFor:"FormInput"},{name:"tabindex",showFor:"FormSelectList"},{name:"tabindex",showFor:"FormDatePicker"},{name:"tabindex",showFor:"FormCheckbox"},{name:"tabindex",showFor:"FormDatePicker"},{name:"tabindex",showFor:"FileUpload"},{name:"tabindex",showFor:"FileDownload"},{name:"tabindex",showFor:"FormSelectList"},{name:"tabindex",showFor:"FormButton"},{name:"tabindex",showFor:"FormTextArea"}],open:!1}];class Fx{constructor(){se(this,"names",[]);se(this,"generateNameId",(e,r)=>{let a=e+"_"+r;return this.names.indexOf(a)!==-1&&(r++,a=this.generateNameId(e,r)),a})}GetVariableNames(e){e.forEach(r=>{Array.isArray(r)&&this.GetVariableNames(r),r.items&&this.GetVariableNames(r.items),r.config&&r.config.name&&this.names.push(`${r.config.name}`)})}generate(e,r){this.names=[],this.GetVariableNames(e);let a=this.generateNameId(this.snakeCase(r),1);return this.names.push(a),[this.names,a]}snakeCase(e){return e.replace(/\W+/g," ").split(/ |\B(?=[A-Z])/).map(r=>r.toLowerCase()).join("_")}}const Gte="",JQ={name:"PagesDropdown",props:{data:{type:Array,default:null},boundary:{type:String,default:"viewport"}},methods:{onAddPage(){this.$emit("addPage")},onSeeAllPages(){this.$emit("seeAllPages")},onClickPage(t){this.$emit("clickPage",this.data[t])}}};var ZQ=function(){var e=this,r=e._self._c;return r("b-dropdown",{ref:"pageDropdown",attrs:{"data-test":"page-dropdown",variant:"platform",boundary:e.boundary,"menu-class":"page-dropdown-menu"},scopedSlots:e._u([{key:"button-content",fn:function(){return[r("i",{staticClass:"fa fa-file"})]},proxy:!0}])},[r("b-dropdown-item",{attrs:{"data-test":"add-page"},on:{click:e.onAddPage}},[r("i",{staticClass:"fa fa-plus platform-dropdown-item-icon"}),e._v(" "+e._s(e.$t("Create Page"))+" ")]),r("b-dropdown-item",{attrs:{"data-test":"see-all-pages"},on:{click:e.onSeeAllPages}},[r("i",{staticClass:"fa fa-eye platform-dropdown-item-icon"}),e._v(" "+e._s(e.$t("See all pages"))+" ")]),r("b-dropdown-divider"),e._l(e.data,function(a,i){return r("b-dropdown-item",{key:i,attrs:{"data-test":"page-"+a.name,"data-cy":"page-"+i},on:{click:function(n){return e.onClickPage(i)}}},[e._v(" "+e._s(a.name)+" ")])})],2)},XQ=[],eK=oe(JQ,ZQ,XQ,!1,null,"18f6828f",null,null);const tK=eK.exports,rK={name:"required-checkbox",props:["value"],data(){return{required:!1}},watch:{value:{handler(){this.value&&this.value==="required"?this.required=!0:this.required=!1},immediate:!0},required:{handler(){this.$emit("input",this.required?"required":"")}}}};var aK=function(){var e=this,r=e._self._c;return r("div",[r("b-form-checkbox",{model:{value:e.required,callback:function(a){e.required=a},expression:"required"}},[e._v(e._s(e.$t("Required")))])],1)},iK=[],nK=oe(rK,aK,iK,!1,null,null,null,null);const qx=nK.exports,sK={name:"multiple-upload-checkbox",props:["value"],data(){return{selected:!1}},watch:{value:{handler(){this.value?this.selected=!0:this.selected=!1},immediate:!0},selected:{handler(){this.$emit("input",this.selected)}}}};var oK=function(){var e=this,r=e._self._c;return r("div",[r("b-form-checkbox",{model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}},[e._v(e._s(e.$t("Upload multiple files")))])],1)},lK=[],uK=oe(sK,oK,lK,!1,null,null,null,null);const Bx=uK.exports,Wx=200,cK={props:{pages:{type:Array,required:!0},initialOpenedPages:{type:Array,default:()=>[0]},buttonIcon:{type:String,default:()=>"fa fa-file"}},data(){return{tabsListOverflow:!1,showLeftScroll:!0,showRightScroll:!0,updates:0,activeTab:0,localOpenedPages:this.initialOpenedPages}},computed:{validLocalOpenedPages(){return this.localOpenedPages.filter(t=>this.pages[t])}},watch:{openedPages:{handler(t){this.localOpenedPages=t},deep:!0},pages:{handler(){this.localOpenedPages=this.localOpenedPages.filter(t=>this.pages[t])},deep:!0}},mounted(){this.$nextTick(()=>{window.addEventListener("resize",this.checkTabsOverflow),this.$refs.tabs.$el.querySelector(".nav-tabs").addEventListener("scroll",this.checkScrollPosition),Promise.resolve().then(()=>{this.checkTabsOverflow(),this.checkScrollPosition()})})},beforeDestroy(){window.removeEventListener("resize",this.checkTabsOverflow)},updated(){this.checkTabsOverflow()},methods:{tabOpened(){const t=this.localOpenedPages[this.activeTab];this.$emit("tab-opened",t)},pageNumber(t){return t+1},checkScrollPosition(){const t=this.$refs.tabs.$el.querySelector(".nav-tabs");this.showLeftScroll=t.scrollLeft>0,this.showRightScroll=t.scrollWidth-t.clientWidth>t.scrollLeft},scrollTabsLeft(){const t=this.$refs.tabs.$el.querySelector(".nav-tabs");t.scrollLeft-=Wx},scrollTabsRight(){const t=this.$refs.tabs.$el.querySelector(".nav-tabs");t.scrollLeft+=Wx},tabsUpdated(){this.updates++},waitUpdates(t,e,r=80){return new Promise(a=>{const i=Date.now(),n=setInterval(()=>{(this.updates>=t||Date.now()-i>e)&&(clearInterval(n),a())},r)})},closeTab(t){const e=this.localOpenedPages[t];this.localOpenedPages.splice(t,1),this.$emit("tab-closed",this.pages[e],this.localOpenedPages)},updateTabsReferences(t){this.localOpenedPages=this.localOpenedPages.map(e=>e>t?e-1:e)},async openPageByIndex(t){if(t===-1)return;const e=this.localOpenedPages.indexOf(t*1);e===-1?(this.localOpenedPages.push(t),await this.waitUpdates(this.updates+2,1e3),this.activeTab=this.localOpenedPages.length-1):this.activeTab=e},closePageByIndex(t){const e=this.localOpenedPages.indexOf(t);e!==-1&&this.localOpenedPages.splice(e,1)},checkTabsOverflow(){const t=this.$refs.tabs.$el.querySelector(".nav-tabs");this.tabsListOverflow=t.scrollWidth>t.clientWidth}}};var dK=function(){var e=this,r=e._self._c;return r("b-tabs",{ref:"tabs",staticClass:"h-100 w-100 flat-tabs",attrs:{"content-class":"h-tab","nav-class":"nav-tabs-nowrap",lazy:""},on:{changed:e.tabsUpdated,input:e.tabOpened},scopedSlots:e._u([{key:"tabs-start",fn:function(){return[r("div",{staticClass:"tabs-sticky d-flex flex-row tabs-start"},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.tabsListOverflow,expression:"tabsListOverflow"}],staticClass:"position-relative overflow-visible"},[r("div",{staticClass:"nav-scroll nav-scroll-left",attrs:{role:"link","data-test":"scroll-left"},on:{click:e.scrollTabsLeft}},[r("i",{staticClass:"fas fa-chevron-left"})])])]),r("div",{class:{"dd-ml":e.tabsListOverflow}},[e._t("tabs-start")],2)]},proxy:!0},{key:"tabs-end",fn:function(){return[e.tabsListOverflow?r("div",{staticClass:"tabs-sticky overflow-visible"},[r("div",{staticClass:"nav-scroll nav-scroll-right",attrs:{role:"link","data-test":"scroll-right"},on:{click:e.scrollTabsRight}},[r("i",{staticClass:"fas fa-chevron-right"})])]):e._e()]},proxy:!0},{key:"empty",fn:function(){return[r("p",{staticClass:"text-center m-5 text-secondary",attrs:{"data-test":"tab-content"}},[e._v(" "+e._s(e.$t("There are no open pages."))),r("br"),e._v(" "+e._s(e.$t("Open a new page above using the button"))+" "),r("i",{class:e.buttonIcon})])]},proxy:!0}],null,!0),model:{value:e.activeTab,callback:function(a){e.activeTab=a},expression:"activeTab"}},e._l(e.validLocalOpenedPages,function(a,i){return r("b-tab",{key:`tab-${i}`,staticClass:"h-100 w-100",scopedSlots:e._u([{key:"title",fn:function(){var n;return[r("b-badge",{staticClass:"mr-1",attrs:{variant:"primary"}},[e._v(" "+e._s(e.pageNumber(a))+" ")]),r("span",{attrs:{"data-test":`tab-${i}`}},[e._v(" "+e._s((n=e.pages[a])==null?void 0:n.name)+" ")]),r("span",{staticClass:"close-tab",attrs:{"data-test":`close-tab-${i}`,role:"link"},on:{click:function(s){return s.stopPropagation(),e.closeTab(i)}}},[r("i",{staticClass:"fas fa-times"})])]},proxy:!0},{key:"default",fn:function(){return[r("div",{staticClass:"h-100 w-100",attrs:{"data-test":"tab-content"}},[e._t("default",null,{currentPage:a})],2)]},proxy:!0}],null,!0)})}),1)},pK=[],fK=oe(cK,dK,pK,!1,null,null,null,null);const hK=fK.exports,Hte="",mK={name:"SortableList",props:{items:{type:Array,required:!0},filteredItems:{type:Array,required:!0}},data(){return{newName:"",draggedItem:0,draggedOverItem:0,editRowIndex:null}},computed:{sortedItems(){return[...this.filteredItems].sort((e,r)=>e.order-r.order)}},methods:{validateState(t,e){const r=!(t!=null&&t.trim()),a=this.items.filter(i=>i!==e).find(i=>i.name===t);return r||a?!1:null},validateError(t,e){return t!=null&&t.trim()?this.$t("The Page Name field is required."):this.items.filter(i=>i!==e).find(i=>i.name===t)?this.$t("Must be unique."):""},onFocus(t){this.newName=t.name},async onBlur(t,e){this.validateState(t,e)===!1?this.newName=e.name:e.name=t,await this.$nextTick(),setTimeout(()=>{this.editRowIndex=null},250)},async onCancel(t){this.newName=t.name,this.editRowIndex=null},onClick(t,e){this.editRowIndex=e,this.$emit("item-edit",t)},dragStart(t,e){this.editRowIndex=null,this.draggedItem=e,t.target.classList.add("dragging")},dragEnter(t,e){this.draggedOverItem=e},dragEnd(t){t.target.classList.remove("dragging");const e=[...this.items].sort((i,n)=>i.order-n.order),r=e.findIndex(i=>i.order===this.draggedItem),a=e.findIndex(i=>i.order===this.draggedOverItem);if(r!==a){const i=e[a].order,n=this.draggedItem>this.draggedOverItem?1:-1;if(r<a){for(let o=r+1;o<=a;o++){const u=e[o].order;e[o].order=u+n}e[r].order=i}else if(r>a){for(let o=a;o<=r-1;o++){const u=e[o].order;e[o].order=u+n}e[r].order=i}const s=[...e];s.sort((o,u)=>o.order-u.order),s.forEach((o,u)=>{o.order=u+1})}this.$emit("ordered",e)},dragOver(t){t.preventDefault()}}};var gK=function(){var e=this,r=e._self._c;return r("div",{staticClass:"row mt-3"},[r("div",{staticClass:"col p-0 border rounded-lg sortable-list"},[e._m(0),r("div",{staticClass:"sortable-container",on:{dragover:e.dragOver}},e._l(e.sortedItems,function(a,i){return r("div",{key:i,staticClass:"sortable-item sortable-draggable",attrs:{"data-order":a.order,"data-test":`item-${a.order}`,title:a.name,draggable:"true"},on:{dragstart:n=>e.dragStart(n,a.order),dragenter:n=>e.dragEnter(n,a.order),dragend:e.dragEnd}},[e._m(1,!0),r("div",{staticClass:"rounded sortable-item-name"},[e.editRowIndex===i?r("b-form-input",{attrs:{type:"text",autofocus:"",required:"",state:e.validateState(e.newName,a),error:e.validateError(e.newName,a)},on:{blur:function(n){return n.stopPropagation(),e.onBlur(e.newName,a)},keydown:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.stopPropagation(),e.onBlur(e.newName,a))},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"esc",27,n.key,["Esc","Escape"])?null:(n.stopPropagation(),e.onCancel(a))}],focus:function(n){return e.onFocus(a)}},model:{value:e.newName,callback:function(n){e.newName=n},expression:"newName"}}):r("span",[e._v(e._s(a.name))])],1),r("div",{staticClass:"border rounded-lg sortable-item-action"},[e.editRowIndex===i?r("button",{staticClass:"btn"},[r("i",{staticClass:"fas fa-check"})]):r("button",{staticClass:"btn",on:{click:function(n){return n.stopPropagation(),e.onClick(a,i)}}},[r("i",{staticClass:"fas fa-edit"})]),r("div",{staticClass:"sortable-item-vr"}),r("button",{staticClass:"btn",on:{click:function(n){return e.$emit("item-delete",a)}}},[r("i",{staticClass:"fas fa-trash-alt"})])])])}),0)])])},vK=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"sortable-list-header"},[e("div",{staticClass:"sortable-item-icon"}),e("div",{staticClass:"sortable-list-title"},[t._v("PAGE NAME")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"sortable-item-icon"},[e("i",{staticClass:"fas fa-bars"})])}],bK=oe(mK,gK,vK,!1,null,"783e3808",null,null);const yK=bK.exports,Yte="",SK={name:"Sortable",components:{SortableList:yK},props:{items:{type:Array,required:!0},filterKey:{type:String,required:!0}},data(){return{search:"",filteredItems:[...this.items]}},watch:{search(t){this.filteredItems=this.filterItems(t,this.items)},items:{handler(t){this.filteredItems=[...t],this.search.length>0&&(this.filteredItems=this.filterItems(this.search,t))},deep:!0}},methods:{clearSearch(t){return t.trim().toLowerCase()},filterItems(t,e){const r=this.clearSearch(t);return e.filter(a=>a[this.filterKey].toLowerCase().includes(r))}}};var xK=function(){var e=this,r=e._self._c;return r("div",{staticClass:"container sortable-box"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-sm border rounded-lg p-0 mr-3 sortable-search-box"},[r("i",{staticClass:"fa fa-search sortable-search-icon"}),r("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"form-control border-0 shadow-none px-0",attrs:{id:"search",placeholder:e.$t("Search here"),"data-test":"search"},domProps:{value:e.search},on:{input:function(a){a.target.composing||(e.search=a.target.value)}}})]),r("div",[r("button",{staticClass:"btn sortable-btn-new",attrs:{type:"button"},on:{click:function(a){return e.$emit("add-page",a)}}},[r("i",{staticClass:"fa fa-plus"})])])]),r("SortableList",{attrs:{items:e.items,"filtered-items":e.filteredItems},on:{ordered:function(a){return e.$emit("ordered",a)},"item-edit":function(a){return e.$emit("item-edit",a)},"item-delete":function(a){return e.$emit("item-delete",a)}}})],1)},kK=[],_K=oe(SK,xK,kK,!1,null,"787061e3",null,null);const wK=_K.exports,Qte="",Kte="",Jte="",Qa=typeof window>"u"?global:window;Qa.ProcessMaker&&Qa.ProcessMaker.user&&Qa.ProcessMaker.user.lang&&Lt.useLang(Qa.ProcessMaker.user.lang),Lt.register("columns-adds-to-12",t=>t.reduce((r,a)=>r+parseInt(a.content),0)===12,"Columns must add to 12");const CK=[{name:"Default",items:[]}],TK={"Input Fields":1,"Content Fields":2,Dashboards:2.5,Navigation:3,Files:4,Advanced:5},AK="Advanced",OK={components:{TabsBar:hK,draggable:Oa,FormInput:ee.FormInput,FormSelectList:ee.FormSelectList,FormCheckbox:ee.FormCheckbox,FormTextArea:ee.FormTextArea,FormDatePicker:ee.FormDatePicker,FormHtmlEditor:ee.FormHtmlEditor,FormHtmlViewer:ee.FormHtmlViewer,RequiredCheckbox:qx,MultipleUploadsCheckbox:Bx,defaultValueEditor:ef,...Nx,...Cs,PagesDropdown:tK,Sortable:wK},mixins:[gn,lb],props:{renderControls:{type:Boolean,default:!0},validationErrors:{type:Array},initialConfig:{type:Array},title:{type:String},screenType:{type:String,default:As.form},screen:{type:Object},processId:{default:0}},data(){const t=this.initialConfig||CK;this.migrateConfig(t);const e=new Fx,r=e.GetVariableNames(t);return this.title&&t[0].name==="Default"&&(t[0].name=this.title),{showAddPageValidations:!1,openedPages:[0],currentPage:0,selected:null,display:"editor",inspection:{},controls:[],pageAddModal:!1,addPageName:"",editPageIndex:null,editPageName:"",originalPageName:null,config:t,confirmMessage:"",pageDelete:0,translated:[],showAssignment:!1,showVariable:!1,showDesign:!1,filterQuery:"",accordions:Rx,variables:r,generator:e,variablesTree:[],language:"en",collator:null,editorContentKey:0,cancelledJobs:[],collapse:{},groupOrder:{}}},computed:{sortedPages(){return[...this.config].sort((t,e)=>t.order-e.order)},builder(){return this},displayDelete(){return this.config.length>1},filteredControls(){return this.controls.filter(e=>e.label.toLowerCase().includes(this.filterQuery.toLowerCase()))},filteredControlsGrouped(){const t=this.filteredControls.reduce((e,r)=>{let a=H.get(r,"group",null);a||(a=AK);let i=e.findIndex(n=>n.name===a);return i===-1&&(e.push({name:a,order:this.getGroupOrder(a),elements:[]}),i=e.length-1),e[i].elements.push(r),e},[]);return t.sort((e,r)=>e.order-r.order),t.forEach((e,r)=>{t[r].elements.sort((a,i)=>{const n=a.order!==void 0?a.order:Number.POSITIVE_INFINITY,s=i.order!==void 0?i.order:Number.POSITIVE_INFINITY;return n-s})}),t},showToolbar(){return this.screenType===As.form}},watch:{config:{handler(){this.checkForCaptchaInLoops(),this.$emit("change",this.config)},deep:!0},currentPage(){this.inspect()},inspection(t){if(!this.translated.includes(t)){for(const e in t.inspector)if(t.inspector[e].config.label=this.$t(t.inspector[e].config.label),t.inspector[e].config.helper=this.$t(t.inspector[e].config.helper),t.inspector[e].config.options)for(const r in t.inspector[e].config.options)t.inspector[e].config.options[r].content=this.$t(t.inspector[e].config.options[r].content);this.translated.push(t)}},controls(){this.processId!==0&&this.processId!==void 0&&!this.config[this.currentPage].items.length&&this.addDefaultAiControl()}},created(){this.$store.dispatch("undoRedoModule/pushState",{config:JSON.stringify(this.config),currentPage:this.currentPage}),this.initiateLanguageSupport()},mounted(){!localStorage.getItem("cancelledJobs")||localStorage.getItem("cancelledJobs")==="null"?this.cancelledJobs=[]:this.cancelledJobs=JSON.parse(localStorage.getItem("cancelledJobs")),this.checkForCaptchaInLoops(),this.$root.$on("nested-screen-updated",()=>{this.checkForCaptchaInLoops()}),this.$root.$on("ai-form-generated",(t,e)=>{this.previewAiChanges(t,e)}),this.$root.$on("apply-ai-changes",t=>{this.applyAiChanges(t)}),this.$root.$on("ai-form-progress-updated",(t,e)=>{this.updateProgress(t,e)}),this.setGroupOrder(TK)},methods:{isCurrentPageEmpty(t){var e,r;return((r=(e=this.config[t])==null?void 0:e.items)==null?void 0:r.length)===0},onClick(t){this.$refs.tabsBar.openPageByIndex(this.config.indexOf(t))},checkPageName(t,e=!1){return!e&&!this.showAddPageValidations?null:t.trim()?this.config.map(a=>a.name).filter(a=>a!==this.originalPageName).includes(t)?this.$t("Must be unique."):"":this.$t("The Page Name field is required.")},getGroupOrder(t){return H.get(this.groupOrder,t,Number.POSITIVE_INFINITY)},setGroupOrder(t){this.groupOrder={...this.groupOrder,...t}},toggleCollapse(t){this.collapse[t]&&this.collapse[t]===!0?this.collapse[t]=!1:this.collapse[t]=!0},isCollapsed(t){return this.collapse[t]},refreshContent(){this.editorContentKey++},checkForCaptchaInLoops(){this.config.forEach(t=>{this.checkForCaptcha(t.items)})},checkForCaptcha(t,e=!1,r=null){t.forEach(a=>{if(!a.items&&a.component==="Captcha"&&e&&(r&&r.config.screen?(this.$root.$emit("remove-nested",r.config.screen),r.config.screen=null,Qa.ProcessMaker.alert(this.$t("You are trying to place a nested screen within CAPTCHA elements inside a loop. CAPTCHA controls cannot be placed within a Loop control."),"danger")):(t.splice(t.indexOf(a),1),Qa.ProcessMaker.alert(this.$t("CAPTCHA controls cannot be placed within a Loop control."),"danger"))),a.items&&this.checkForCaptcha(a.items,!0,r),a.component==="FormNestedScreen"&&a.config.screen&&window.nestedScreens){const i=window.nestedScreens[`id_${a.config.screen}`];i&&i.forEach(n=>{this.checkForCaptcha(n.items,e,a)})}})},loadVariablesTree(){const t={config:this.$parent.config,computed:this.$parent.computed,customCSS:this.$parent.customCSS,watchers:this.$parent.watchers};this.variablesTree=this.$refs.treeOfVariables.getVariablesTree(t),this.$refs.treeOfVariables.getVariablesTree({config:[]})},accordionName(t){return t.name instanceof Function?t.name(this.inspection):t.name},toggleAccordion(t){this.accordions.forEach(e=>{e!==t&&(e.open=!1)}),t.open=!t.open},openAccordion(t){this.accordions.forEach(e=>{e.open=!1}),t.open=!0},migrateConfig(t=this.config){t.forEach(e=>this.replaceFormText(e.items)),t.forEach(e=>this.migrateFormSubmit(e.items)),t.forEach(e=>this.updateFieldNameValidation(e.items)),this.updatePageOrder(t),t.forEach(e=>this.removeDataVariableFromNestedScreens(e.items)),t.forEach((e,r)=>{e.order=e.order||r+1})},updatePageOrder(t){const e=[...t];e.sort((r,a)=>{const i=r.order||t.indexOf(r)+1,n=a.order||t.indexOf(a)+1;return i-n}),e.forEach((r,a)=>{r.order=a+1})},updateFieldNameValidation(t){t.forEach(e=>{e.inspector&&e.inspector.forEach(r=>{r.field==="name"&&"validation"in r.config&&r.config.name!=="DataVariable"&&e.component!=="FileUpload"&&e.component!=="FormButton"&&(r.config.validation=Yt.config.validation)}),e.items instanceof Array&&this.replaceFormText(e.items)})},removeDataVariableFromNestedScreens(t){t.forEach(e=>{if(e.inspector){const r=e.inspector.find(a=>a.config.name==="DataVariable");e.inspector=e.inspector.filter(a=>a.config.name!=="DataVariable"),r&&delete e.config.name}})},replaceFormText(t){t.forEach(e=>{if(e.component==="FormText"){e.component="FormHtmlEditor",e["editor-component"]="FormHtmlEditor";const r=(e.config.fontSize?`font-size: ${e.config.fontSize};`:"")+(e.config.fontWeight?`font-weight: ${e.config.fontWeight};`:"")+(e.config.textAlign?`text-align: ${e.config.textAlign};`:"");e.config={content:'<div style="'+r+'">'+e.config.label+"</div>",interactive:!0}}e.items instanceof Array&&this.replaceFormText(e.items)})},migrateFormSubmit(t){t.forEach(e=>{e["editor-control"]!=="FormSubmit"&&(e["editor-control"]=e["editor-component"]),e.config.event==="submit"&&(e["editor-component"]==="FormNestedScreen"?(delete e.config.event,e["editor-control"]="FormNestedScreen",e.config.name="Nested Screen"):e["editor-control"]!=="FormImage"&&(e["editor-control"]="FormSubmit")),e.config.event==="pageNavigate"&&(e["editor-control"]="PageNavigation"),e.items instanceof Array&&e.component==="FormMultiColumn"&&(e["editor-control"]="FormMultiColumn",e.items.forEach(r=>this.migrateFormSubmit(r)))})},getAllAccordionizedFields(){return this._allAccordionizedFields?this._allAccordionizedFields:(this._allAccordionizedFields=this.accordions.flatMap(t=>t.fields.map(e=>typeof e=="string"?e:e.name)),this._allAccordionizedFields)},knownField(t){return this.getAllAccordionizedFields().includes(t)},getInspectorFields(t){if(!this.inspection.inspector)return[];const e=t.fields.filter(a=>{if(typeof a!="string"){const{component:i}=this.inspection,{showFor:n,hideFor:s}=a;if(n)return n===i;if(s)return s!==i}return!0}).map(a=>typeof a!="string"?a.name:a);return(this.controls.find(a=>a["editor-control"]===this.inspection["editor-control"])||this.controls.find(a=>a.component===this.inspection.component)||{inspector:[]}).inspector.filter(a=>!!(e.includes(a.field)||!this.knownField(a.field)&&t.name==="Configuration"))},updateState(){this.$store.dispatch("undoRedoModule/pushState",{config:JSON.stringify(this.config),currentPage:this.currentPage})},async undo(){this.inspect(),this.$store.dispatch("undoRedoModule/undo"),this.config=JSON.parse(this.$store.getters["undoRedoModule/currentState"].config),await this.$nextTick(),this.$refs.tabsBar.openPageByIndex(this.$store.getters["undoRedoModule/currentState"].currentPage)},async redo(){this.inspect(),this.$store.dispatch("undoRedoModule/redo"),this.config=JSON.parse(this.$store.getters["undoRedoModule/currentState"].config),await this.$nextTick(),this.$refs.tabsBar.openPageByIndex(this.$store.getters["undoRedoModule/currentState"].currentPage)},updateConfig(t){this.config[this.currentPage].items=t,this.updateState()},hasError(t){return this.validationErrors.some(({item:e})=>e===t)},focusInspector(t){this.showConfiguration=!0,this.$refs.tabsBar.openPageByIndex(this.config.indexOf(t.page)),this.$nextTick(()=>{this.inspect(t.item),this.$nextTick(()=>{const e=this.$el.querySelector(`[field-name="${t.field}"]`);if(e){const r=this.$el.querySelector(`[accordion-name="${e.getAttribute("field-accordion")}"]`);r&&r.getAttribute("is-open")==="0"&&r.click(),e.focus instanceof Function&&e.focus()}})})},confirmDelete(t=this.config[this.currentPage]){this.confirmMessage=this.$t("Are you sure you want to delete {{item}}?",{item:t.name}),this.config.length!==1&&(this.pageDelete=this.config.indexOf(t),this.$refs.confirm.show())},hideConfirmModal(){this.$refs.confirm.hide()},addControl(t){this.controls.push(t)},deleteItem(t){this.config[this.currentPage].items.splice(t,1),this.inspection.inspector.splice(0,this.inspection.inspector.length),this.updateState()},duplicateItem(t){const e=H.cloneDeep(this.config[this.currentPage].items[t]);this.config[this.currentPage].items.push(e)},openEditPageModal(t){this.editPageIndex=t;const e=this.config[t].name;this.originalPageName=e,this.editPageName=e,this.$refs.editPageModal.show()},editPage(t){if(this.$refs.editPageInput.validator.errorCount){t.preventDefault();return}this.config[this.editPageIndex].name=this.editPageName,this.updateState()},addPage(t){if(this.checkPageName(this.addPageName,!0)){this.showAddPageValidations=!0,t.preventDefault();return}const r=this.config.reduce((a,i)=>i.order>a?i.order:a,0);this.config.push({name:this.addPageName,order:r+1,items:[]}),this.addPageName="",this.currentPage=this.config.length-1,this.updateState(),this.$refs.tabsBar.openPageByIndex(this.config.length-1)},calcNewIndexFor(t,e){if(t===this.pageDelete)throw new Error(`${this.$t("Can not delete this page, it is referenced by")}: ${e}`);return t>this.pageDelete?t-1:t},updateRecordListReferences(){this.config.forEach(t=>{t.items.forEach(e=>{e.component==="FormRecordList"&&(e.config.form=this.calcNewIndexFor(e.config.form*1,e.config.label))})})},updateNavigationButtonsReferences(){this.config.forEach(t=>{t.items.forEach(e=>{e.component==="FormButton"&&e.config.event==="pageNavigate"&&(e.config.eventData=this.calcNewIndexFor(e.config.eventData*1,e.config.label))})})},async deletePage(){const t=H.cloneDeep(this.config);try{this.updateRecordListReferences(),this.updateNavigationButtonsReferences(),this.$refs.tabsBar.closePageByIndex(this.pageDelete),this.$refs.tabsBar.updateTabsReferences(this.pageDelete),await this.$nextTick(),this.config.splice(this.pageDelete,1)}catch(e){this.config=t,Qa.ProcessMaker.alert(e.message,"danger");return}this.updatePageOrder(this.config),this.$store.dispatch("undoRedoModule/pushState",{config:JSON.stringify(this.config),currentPage:this.currentPage,deletedPage:!0})},inspect(t={}){this.inspection=t,this.selected=t;const e=this.accordions.find(r=>this.getInspectorFields(r).length>0);e&&this.openAccordion(e)},cloneControl(t){const e={config:JSON.parse(JSON.stringify(t.config)),inspector:JSON.parse(JSON.stringify(t.inspector)),component:t.component,"editor-component":t["editor-component"],"editor-control":t["editor-control"],label:t.label,value:t.value};if(t.component==="FormDatePicker"&&e.config.phrases&&(e.config.phrases.ok=this.$t(e.config.phrases.ok),e.config.phrases.cancel=this.$t(e.config.phrases.cancel)),e.config.label=this.$t(e.config.label),Array.isArray(e.config.options))for(const r in e.config.options)e.config.options[r].content=this.$t(e.config.options[r].content);return t.container&&(e.items=JSON.parse(JSON.stringify(t.items)),e.container=!0),(H.findIndex(t.inspector,Yt)!==-1||t.component==="FormLoop")&&([this.variables,e.config.name]=this.generator.generate(this.config,e["editor-control"]?e["editor-control"]:e.component),H.has(e,"config.settings.varname")&&(e.config.settings.varname=e.config.name)),e},initiateLanguageSupport(){document.documentElement.lang&&(this.language=document.documentElement.lang),this.collator=Intl.Collator(this.language)},isAiSection(t){return t.component==="AiSection"},aiPreview(t){return t.items&&t.items[0]&&t.items[0].length},previewAiChanges(t,e){this.config.forEach((r,a)=>{r.items.forEach((i,n)=>{i.component==="AiSection"&&e===i.config.aiConfig.nonce&&this.$set(i,"items",JSON.parse(JSON.stringify(t)))})})},applyAiChanges(t){t.component="FormMultiColumn",t.label="Multicolumn / Table",t["editor-control"]="MultiColumn",t["editor-component"]="MultiColumn",t.inspector=[{type:"ContainerColumns",field:"options",config:{label:"Column Width",validation:"columns-adds-to-12"}}],t.config={icon:"fas fa-table",options:[{value:"1",content:"12"}]}},updateProgress(t,e){this.config.forEach(r=>{r.items.forEach(a=>{if(a.component==="AiSection"&&e===a.config.aiConfig.nonce){if(this.cancelledJobs.some(i=>i===e))return;this.$set(a.config.aiConfig,"progress",t)}})})},addDefaultAiControl(){const t=this.builder.controls.find(r=>r.component==="AiSection"),e=this.cloneControl(t);e.config.aiConfig.autofocus=!0,e.config.aiConfig.screenTitle=this.screen.title,e.config.aiConfig.screenDescription=this.screen.description,this.config[this.currentPage].items.push(e),this.updateState(),this.inspect(e)}}};var EK=function(){var e=this,r=e._self._c;return r("b-row",{staticClass:"custom-row h-100 m-0"},[r("b-col",{staticClass:"overflow-hidden h-100 p-0 controls-column"},[r("b-card",{staticClass:"h-100 rounded-0 border-top-0 border-bottom-0 border-left-0",attrs:{"no-body":""}},[r("b-input-group",{staticStyle:{height:"42px"},attrs:{size:"sm"}},[r("b-input-group-prepend",[r("span",{staticClass:"input-group-text rounded-0 border-left-0 border-top-0 border-bottom-0"},[r("i",{staticClass:"fas fa-search icon"})])]),r("b-form-input",{staticClass:"border-0 rounded-0",staticStyle:{height:"42px"},attrs:{type:"text",size:"lg",placeholder:e.$t("Search Here")},model:{value:e.filterQuery,callback:function(a){e.filterQuery=a},expression:"filterQuery"}})],1),r("b-card-body",{staticClass:"p-0 overflow-auto",attrs:{"no-body":""}},[e._l(e.filteredControlsGrouped,function({name:a,elements:i},n){return[r("b-button",{staticClass:"w-100 rounded-0 text-left",staticStyle:{"font-size":"smaller",height:"42px",color:"grey","border-color":"rgb(224, 224, 224)","background-color":"rgb(235, 238, 242)"},attrs:{"aria-controls":`collapse-${n+1}`},on:{click:function(s){return e.toggleCollapse(n)}}},[r("strong",[e._v(e._s(e.$t(a)))]),r("b-icon",{staticClass:"float-right",attrs:{icon:e.isCollapsed(n)?"chevron-down":"chevron-up"}})],1),r("b-collapse",{staticClass:"mt-2",model:{value:e.collapse[n],callback:function(s){e.$set(e.collapse,n,s)},expression:"collapse[index]"}},[r("b-list-group",[e.renderControls?r("draggable",e._b({staticClass:"controls list-group w-auto list-group-flush",attrs:{id:"controls","data-cy":"controls",clone:e.cloneControl},model:{value:e.filteredControlsGrouped[n].elements,callback:function(s){e.$set(e.filteredControlsGrouped[n],"elements",s)},expression:"filteredControlsGrouped[index].elements"}},"draggable",{sort:!1,group:{name:"controls",pull:"clone",put:!1}},!1),e._l(i,function(s,o){return r("b-list-group-item",{directives:[{name:"b-popover",rawName:"v-b-popover.hover.right",value:{content:e.$t(s.popoverContent),customClass:"custom-popover",boundaryPadding:16},expression:`{
|
|
340
|
+
&per_page=${this.perPage}&filter=${e}&order_by=${this.orderBy==="__slot:ids"?"id":this.orderBy}&order_direction=${this.orderDirection}${this.additionalParams}`).then(r=>{this.showTable=r.data.data.length!==0;for(const n of r.data.data)n.status=this.formatStatus(n.status);this.tableData=r.data,this.countResponse=this.tableData.meta.total;const a={count:`${this.countResponse}`,showControl:!0,showAvatar:!0,variant:"primary",textColor:"text-primary",colorText:"color: #1572C2",url:"/requests",dropdownShow:"requests"},i=[];this.$emit("requestsCount",{dataControls:a,tasksDropdown:i})}).catch(()=>{this.tableData=[]})})},setFields(){this.fields.push({name:"__slot:ids",field:"id",sortField:"id",sortable:!0,title:"#"}),this.fields.push({name:"__slot:name",field:"name",sortField:"name",sortable:!0,title:()=>this.$t("Name")}),this.fields.push({name:"__slot:status",field:"status",sortField:"status",sortable:!0,title:()=>this.$t("Status")}),this.fields.push({name:"__slot:actions",title:""}),this.$nextTick(()=>{this.$refs.vuetable.normalizeFields()})},formatStatus(t){let e="",r="";switch(t){case"DRAFT":e="danger",r="Draft";break;case"CANCELED":e="danger",r="Canceled";break;case"COMPLETED":e="primary",r="Completed";break;case"ERROR":e="danger",r="Error";break;default:e="success",r="In Progress"}return{color:e,label:r}},openRequest(t,e){return`/requests/${t.id}`},classDueDate(t){const e=moment(t),r=moment(),a=e.diff(r,"hours");return a<0?"text-danger":a<=1?"text-warning":"text-dark"},fetchData(t){t[0]==="by_me"&&t[1]!=="all"&&(this.pmql=`(user_id = ${ProcessMaker.user.id}) AND (status = "${t[1]}")`),t[0]==="as_participant"&&t[1]!=="all"&&(this.pmql=`(status = "${t[1]}") AND (participant = "${Processmaker.user.username}")`),t[1]==="all"&&(this.pmql=`(user_id = ${ProcessMaker.user.id}) AND ((status = "In Progress") OR (status = "Completed"))`),this.fetch()},fetchSearch(t){this.pmql="",this.pmql=t,this.fetch()}}};var U7=function(){var e=this,r=e._self._c;return e.showTable?r("div",[r("vuetable",{ref:"vuetable",attrs:{"data-manager":e.dataManager,"sort-order":e.sortOrder,"api-mode":!1,fields:e.fields,data:e.tableData,css:e.css,"data-path":"data","pagination-path":"meta"},scopedSlots:e._u([{key:"ids",fn:function(a){return[r("b-link",{staticClass:"text-nowrap",attrs:{href:e.openRequest(a.rowData,a.rowIndex)}},[e._v(" #"+e._s(a.rowData.id)+" ")])]}},{key:"name",fn:function(a){return[r("span",{directives:[{name:"uni-id",rawName:"v-uni-id",value:a.rowData.id.toString(),expression:"props.rowData.id.toString()"}]},[e._v(e._s(a.rowData.name))])]}},{key:"status",fn:function(a){return[r("span",[r("i",{class:`fas fa-circle text-${a.rowData.status.color}`}),e._v(" "+e._s(a.rowData.status.label)+" ")])]}},{key:"actions",fn:function(a){return[r("div",{staticClass:"actions"},[r("div",{staticClass:"popout"},[r("b-btn",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}},{name:"uni-aria-describedby",rawName:"v-uni-aria-describedby",value:a.rowData.id.toString(),expression:"props.rowData.id.toString()"}],attrs:{variant:"link",href:e.openRequest(a.rowData,a.rowIndex),title:e.$t("Open Request")}},[r("i",{staticClass:"fas fa-caret-square-right fa-lg fa-fw"})])],1)])]}}],null,!1,3091698390)})],1):r("div",[r("formEmpty",{attrs:{link:"Requests",title:"No Requests to Show",url:e.noDataUrl}})],1)},G7=[],H7=oe(V7,U7,G7,!1,null,null,null,null);const Jp=H7.exports,Ote="",Y7={mixins:[vn()],props:["name","description","filter","id","process"],data(){return{disabled:!1,spin:0,showtip:!0,showdetail:!1}},computed:{ariaHidden(){return this.showdetail?"false":"true"},ariaExpanded(){return this.showdetail?"true":"false"},emptyStartEvents(){return this.process.startEvents.filter(t=>!t.eventDefinitions||t.eventDefinitions.length===0)},transformedName(){return this.process.name.replace(new RegExp(this.filter,"gi"),t=>t)},truncatedDescription(){if(!this.process.description)return'<span class="text-primary"></span>';let t="";const e=this.process.description.split(" "),r=100;let a=null;for(;a=e.shift();)t.length+a.length+1<=r&&(t=`${t} ${a}`);return t.replace(new RegExp(this.filter,"gi"),i=>`<span class="text-primary"> ${i} </span>`)}},methods:{newRequestLink(t,e){if(this.disabled)return;this.disabled=!0,this.spin=`${t.id}.${e.id}`;const r=e.id;window.ProcessMaker.apiClient.post(`/process_events/${this.process.id}?event=${r}`).then(a=>{this.spin=0;const i=a.data;this.$cookies.set("fromTriggerStartEvent",!0,"1min"),window.location=`/requests/${i.id}?fromTriggerStartEvent=`}).catch(a=>{this.disabled=!1;const{data:i}=a.response;i.message&&ProcessMaker.alert(i.message,"danger")})},showRequestDetails(t,e){this.showdetail===!1?this.showdetail=!0:this.showdetail=!1,this.$root.$emit("bv::toggle::collapse",this.getComputedId(t,e))},getNewRequestLinkHref(t,e){const{id:r}=t,a=e.id;return`/process_events/${r}?event=${a}`},getComputedId(t,e){return`process-${t.id}-${e.id}`}}};var Q7=function(){var e=this,r=e._self._c;return r("div",[e._l(e.emptyStartEvents,function(a){return[r("div",{key:a.id,staticClass:"mb-3 card-request"},[r("div",{staticClass:"card-body"},[r("div",{staticClass:"d-flex justify-content-between"},[r("div",[r("span",{directives:[{name:"uni-id",rawName:"v-uni-id",value:a.id.toString(),expression:"event.id.toString()"}],staticClass:"card-info card-title"},[e._v(" "+e._s(e.transformedName)+" ")]),r("span",{staticClass:"card-info"},[e._v(" "+e._s(a.name)+" ")])]),r("div",{staticClass:"d-flex align-items-center"},[r("button",{staticClass:"btn btn-ellipsis btn-sm mr-1",attrs:{"aria-expanded":e.ariaExpanded,"aria-controls":e.getComputedId(e.process,a)},on:{click:function(i){return e.showRequestDetails(e.process,a)}}},[r("i",{staticClass:"fas fa-ellipsis-v"})]),r("button",{directives:[{name:"uni-aria-describedby",rawName:"v-uni-aria-describedby",value:a.id.toString(),expression:"event.id.toString()"}],staticClass:"btn btn-custom btn-sm",attrs:{href:e.getNewRequestLinkHref(e.process,a)},on:{click:function(i){return i.preventDefault(),e.newRequestLink(e.process,a)}}},[e._v(" "+e._s(e.$t("Start"))+" "),r("i",{staticClass:"fas fa-play mr-1 card-icon"})])])]),r("b-collapse",{attrs:{id:e.getComputedId(e.process,a),"aria-hidden":e.ariaHidden}},[r("hr"),r("p",{staticClass:"card-text text-muted card-description"},[e._v(" "+e._s(e.process.description)+" ")])])],1)])]})],2)},K7=[],J7=oe(Y7,Q7,K7,!1,null,"6935b2c4",null,null);const Z7={components:{ProcessCard:J7.exports,formEmpty:Qp},data(){return{filter:"",loading:!1,error:!1,loaded:!1,processes:{},perPage:10,page:1}},mounted(){this.fetch(),this.$root.$on("dropdownSelectionStart",this.fetchData)},methods:{hasEmptyStartEvents(t){return!!t.events.find(e=>!e.eventDefinitions||e.eventDefinitions.length===0)},fetch(){Vue.nextTick(()=>{window.ProcessMaker.apiClient.get(`start_processes?page=${this.page}&per_page=${this.perPage}&filter=${this.filter}&order_by=category.name,name&order_direction=asc,asc&include=events&without_event_definitions=true`).then(t=>{const{data:e}=t;this.processes=e.data}).catch(()=>{this.error=!0})})},fetchData(t){this.filter=t,this.fetch()}}};var X7=function(){var e=this,r=e._self._c;return r("div",[Object.keys(e.processes).length&&!e.loading?r("div",{staticClass:"process-list"},[r("b-container",{attrs:{fluid:""}},e._l(e.processes,function(a,i){return r("div",{key:`process-${i}`},[e.hasEmptyStartEvents(a)?r("ProcessCard",{attrs:{filter:e.filter,process:a}}):e._e()],1)}),0)],1):r("div",[r("formEmpty",{attrs:{link:"",title:"No Request to Start",url:""}})],1)])},eY=[],tY=oe(Z7,X7,eY,!1,null,null,null,null);const rY=tY.exports,$te="",aY={components:{FormTasks:Kp,FormRequests:Jp,FormNewRequest:rY},mixins:[],props:["listOption"],data(){return{optionRequest:"by_me",dropdownRequest:"In Progress",titleDropdown:"View All",viewAll:"View All",title:this.$t("List Table"),dataControl:{},searchCriteria:"",showInput:!1,pmql:"",badgeVariant:"",typeSelected:"",showBadge:!1,customStyle:{"border-radius":"8px"}}},watch:{listOption(){this.title=this.listOption,this.dataControl={}}},mounted(){this.title=this.listOption},methods:{getData(t){this.dataControl=t.dataControls},openExternalLink(){window.open(this.dataControl.url,"_blank")},handleDropdownSelection(t,e){const r=[];this.typeSelected=t,t==="tasks"?(this.$root.$emit("dropdownSelectionTask",e),this.titleDropdown=e==="all"?this.viewAll:e,this.colorBadge()):(t==="requests_filter"&&(this.optionRequest=e,e==="by_me"&&(this.title="Request Started By Me"),e==="as_participant"&&(this.title="With Me as Participant")),t==="requests_dropdown"&&(this.titleDropdown=e==="all"?this.viewAll:e,this.colorBadge(),this.dropdownRequest=e),r.push(this.optionRequest),r.push(this.dropdownRequest),this.$root.$emit("dropdownSelectionRequest",r))},toggleInput(t){this.showInput&&this.searchCriteria!==""&&this.performSearch(t),this.showInput=!this.showInput},performSearch(t){this.pmql=`(fulltext LIKE "%${this.searchCriteria}%")`,t==="tasks"&&this.$root.$emit("searchTask",this.pmql),t==="requests"&&this.$root.$emit("searchRequest",this.pmql),t===void 0&&this.$root.$emit("dropdownSelectionStart",`${this.searchCriteria}`)},clearSearch(t){this.searchCriteria="",this.toggleInput(t)},colorBadge(){this.titleDropdown==="In Progress"&&(this.typeSelected==="tasks"&&(this.badgeVariant="warning"),this.typeSelected==="requests_dropdown"&&(this.badgeVariant="success"),this.showBadge=!0),this.titleDropdown==="Overdue"&&(this.badgeVariant="danger",this.showBadge=!0),this.titleDropdown==="Overdue"&&(this.badgeVariant="danger",this.showBadge=!0),this.titleDropdown==="Completed"&&(this.badgeVariant="primary",this.showBadge=!0),(this.titleDropdown==="View All"||this.titleDropdown==="all")&&(this.badgeVariant="",this.showBadge=!1)}}};var iY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"card",style:e.customStyle},[r("div",{staticClass:"card-header d-flex justify-content-between align-items-center"},[e.dataControl.showControl?[r("div",{staticClass:"mb-1 mt-1"},[e.dataControl.showAvatar?r("b-avatar",{staticClass:"avatar-text",attrs:{size:"2em",variant:e.dataControl.variant,text:e.dataControl.count}}):e._e(),r("p",{staticClass:"control-text mb-0",style:e.dataControl.colorText},[e._v(" "+e._s(e.$t(e.title))+" ")]),e.dataControl.dropdownShow==="requests"?[r("b-dropdown",{attrs:{variant:"outline-secondary","no-caret":""},scopedSlots:e._u([{key:"button-content",fn:function(){return[r("i",{staticClass:"fas fa-caret-down"})]},proxy:!0}],null,!1,2500479221)},[r("b-dropdown-item",{on:{click:function(a){return e.handleDropdownSelection("requests_filter","by_me")}}},[e._v(" "+e._s(e.$t("As Requester"))+" ")]),r("b-dropdown-item",{on:{click:function(a){return e.handleDropdownSelection("requests_filter","as_participant")}}},[e._v(" "+e._s(e.$t("As Participant"))+" ")])],1)]:e._e()],2)]:[r("span",{staticClass:"control-text"},[e._v(e._s(e.$t(e.title)))])],r("div",{staticClass:"ml-auto d-flex align-items-center"},[e.dataControl.dropdownShow==="requests"?[r("div",{staticClass:"mr-4"},[r("b-dropdown",{attrs:{variant:"outline-secondary",size:"sm"},scopedSlots:e._u([{key:"button-content",fn:function(){return[r("span",[e.showBadge?r("b-icon",{attrs:{icon:"circle-fill",variant:e.badgeVariant}}):e._e(),e._v(" "+e._s(e.$t(e.titleDropdown))+" ")],1)]},proxy:!0}],null,!1,3897299558)},[r("b-dropdown-item",{attrs:{variant:"success"},on:{click:function(a){return e.handleDropdownSelection("requests_dropdown","In Progress")}}},[r("i",{staticClass:"fas fa-circle mr-2"}),e._v(e._s(e.$t("In Progress"))+" ")]),r("b-dropdown-item",{attrs:{variant:"primary"},on:{click:function(a){return e.handleDropdownSelection("requests_dropdown","Completed")}}},[r("i",{staticClass:"fas fa-circle mr-2"}),e._v(e._s(e.$t("Completed"))+" ")]),r("b-dropdown-item",{on:{click:function(a){return e.handleDropdownSelection("requests_dropdown","all")}}},[e._v(" "+e._s(e.$t("View All"))+" ")])],1)],1)]:e._e(),e.dataControl.dropdownShow==="tasks"?[r("div",{staticClass:"mr-4"},[r("b-dropdown",{attrs:{variant:"outline-secondary",size:"sm"},scopedSlots:e._u([{key:"button-content",fn:function(){return[r("span",[e.showBadge?r("b-icon",{attrs:{icon:"circle-fill",variant:e.badgeVariant}}):e._e(),e._v(" "+e._s(e.$t(e.titleDropdown))+" ")],1)]},proxy:!0}],null,!1,3897299558)},[r("b-dropdown-item",{attrs:{variant:"warning"},on:{click:function(a){return e.handleDropdownSelection("tasks","In Progress")}}},[r("i",{staticClass:"fas fa-circle mr-2"}),e._v(e._s(e.$t("In Progress"))+" ")]),r("b-dropdown-item",{attrs:{variant:"danger"},on:{click:function(a){return e.handleDropdownSelection("tasks","Overdue")}}},[r("i",{staticClass:"fas fa-circle mr-2"}),e._v(e._s(e.$t("Overdue"))+" ")]),r("b-dropdown-item",{on:{click:function(a){return e.handleDropdownSelection("tasks","all")}}},[e._v(" "+e._s(e.$t("View All"))+" ")])],1)],1)]:e._e(),r("div",[r("div",{staticClass:"d-flex justify-content-end"},[r("button",{staticClass:"btn btn-outline-secondary border-0 mr-1",on:{click:function(a){return e.toggleInput(e.dataControl.dropdownShow)}}},[r("i",{staticClass:"fas fa-search"})]),e.showInput?r("input",{directives:[{name:"model",rawName:"v-model",value:e.searchCriteria,expression:"searchCriteria"}],ref:"input",staticClass:"form-control narrow-input",attrs:{type:"text"},domProps:{value:e.searchCriteria},on:{keyup:function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.performSearch(e.dataControl.dropdownShow)},input:function(a){a.target.composing||(e.searchCriteria=a.target.value)}}}):e._e(),e.showInput?r("button",{staticClass:"btn btn-clear",on:{click:function(a){return e.clearSearch(e.dataControl.dropdownShow)}}},[r("i",{staticClass:"fas fa-times"})]):e._e()])])],2),e.listOption!=="Start New Request"?r("div",[r("b-link",{on:{click:e.openExternalLink}},[r("i",{staticClass:"fas fa-external-link-alt custom-icon"})])],1):e._e()],2),r("div",{staticClass:"card-body list-table"},[e.listOption==="My Tasks"?[r("FormTasks",{on:{tasksCount:e.getData}})]:e._e(),e.listOption==="My Requests"?[r("FormRequests",{on:{requestsCount:e.getData}})]:e._e(),e.listOption==="Start New Request"?[r("FormNewRequest",{on:{startControl:e.getData}})]:e._e()],2)])},nY=[],sY=oe(aY,iY,nY,!1,null,"fd3adc7b",null,null);const _s=sY.exports,Pte="",oY={props:["listChartOption"],data(){return{title:this.$t("Analytics Chart"),graphic:[],customStyle:{"border-radius":"8px"}}},watch:{listChartOption(){this.listChartOption&&this.listChartOption.name&&(this.graphic=this.listChartOption)}},mounted(){this.listChartOption&&this.listChartOption.name&&(this.graphic=this.listChartOption)},methods:{openExternalLink(){window.open("/package-analytics-reporting","_blank")}}};var lY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"card",style:e.customStyle},[r("div",{staticClass:"card-header d-flex justify-content-between align-items-center"},[r("span",{staticClass:"mb-2 mt-2 control-text"},[e._v(e._s(e.title))]),r("b-link",{on:{click:e.openExternalLink}},[r("i",{staticClass:"fas fa-external-link-alt custom-icon"})])],1),r("div",[r("div",{staticClass:"d-flex flex-wrap p-2"},[r("b-col",{attrs:{cols:"12"}},[r("b-card-text",[r("b-embed",{attrs:{type:"iframe",src:e.graphic.link}})],1)],1)],1)])])},uY=[],cY=oe(oY,lY,uY,!1,null,"54713fad",null,null);const ws=cY.exports,Cs=Object.freeze(Object.defineProperty({__proto__:null,AddLoopRow:Hu,FileDownload:Xs,FileUpload:bn,FormAnalyticsChart:ws,FormAvatar:yn,FormButton:qa,FormImage:Jn,FormInputMasked:Ba,FormListTable:_s,FormLoop:xs,FormMaskedInput:Ba,FormNestedScreen:ks,FormRecordList:fu,FormRecordListStatic:Sx,FormRequests:Jp,FormTasks:Kp,FormText:hu,NewFormMultiColumn:Yp,ScreenRendererError:Gp},Symbol.toStringTag,{value:"Module"})),Dte="",dY={name:"MustacheHelper"};var pY=function(){var e=this,r=e._self._c;return r("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"mustache",attrs:{title:e.$t("This field accepts mustache syntax")}},[e._v(" {} ")])},fY=[],hY=oe(dY,pY,fY,!1,null,"8cef93f7",null,null);const Hi=hY.exports,mY={props:["name","label","value","helper","validation","dataCy"],components:{FormMultiSelect:ee.FormMultiSelect},data(){return{variables:[],newTags:[]}},computed:{selectedVariable:{get(){return this.value},set(t){this.$emit("input",t)}}},methods:{addTag(t){this.newTags.push(t),this.selectedVariable=t,this.variables=this.newTags.concat(this.variables)},loadVariables(){this.variables=[],this.findElements(this.$root.$children[0].config),this.variables=this.newTags.concat(this.variables),this.selectedVariable&&!this.variables.includes(this.selectedVariable)&&this.variables.unshift(this.selectedVariable)},findElements(t,e=[]){t.forEach(r=>{Array.isArray(r)&&this.findElements(r),r.items&&this.findElements(r.items),r.config&&r.config.name&&this.variables.push(r.config.name),r.component==="FormNestedScreen"&&this.loadVariablesFromScreen(r.config.screen,e)})},loadVariablesFromScreen(t,e){e.indexOf(t)===-1&&(e.push(t),t&&this.$dataProvider.getScreen(t).then(r=>{this.findElements(r.data.config)}))}}};var gY=function(){var e=this,r=e._self._c;return r("form-multi-select",{attrs:{name:e.$t("Variable to Watch"),label:e.$t("Variable to Watch")+" *",options:e.variables,taggable:!0,placeholder:e.$t("None"),multiple:!1,"show-labels":!1,"internal-search":!0,validation:e.validation,helper:e.helper,"tag-placeholder":e.$t("Press enter to use this variable"),"data-cy":e.dataCy},on:{open:e.loadVariables,tag:e.addTag},model:{value:e.selectedVariable,callback:function(a){e.selectedVariable=a},expression:"selectedVariable"}})},vY=[],bY=oe(mY,gY,vY,!1,null,null,null,null);const xx=bY.exports,kx=["collectionId","labelField","valueField","pmql","unique"],yY={components:{MustacheHelper:Hi,ScreenVariableSelector:xx},props:["value"],data(){return{collections:[],fields:[],collectionId:null,labelField:null,valueField:null,pmql:"",unique:!1}},computed:{options(){return Object.fromEntries(kx.map(t=>[t,this[t]]))}},watch:{value:{handler(t){t&&kx.forEach(e=>this[e]=t[e])},immediate:!0},collectionId:{handler(){this.getFields()}},options:{handler(){this.$emit("input",this.options)},deep:!0}},created(){this.onDebouncedPmqlChange=H.debounce(t=>{this.onPmqlChange(t)},1e3)},mounted(){this.getCollections(),this.collectionId&&this.getFields()},methods:{resetFields(){this.labelField=null,this.valueField=null},getCollections(){this.$dataProvider.getCollections().then(t=>{this.collections=[{value:null,text:this.$t("Select a collection")},...t.data.data.map(e=>({text:e.name,value:e.id}))]})},getFields(){this.collectionId&&this.$dataProvider.getCollectionFields(this.collectionId).then(t=>{this.fields=[{value:null,text:this.$t("Select a field")},{value:"id",text:this.$t("Collection Record ID")},...t.data.data.map(e=>({text:e.label,value:e.field}))]})},onNLQConversion(t){this.pmql=t},onPmqlChange(t){this.pmql=t}}};var SY=function(){var e=this,r=e._self._c;return r("div",[r("div",[r("label",{attrs:{for:"collection"}},[e._v(e._s(e.$t("Collection")))]),r("b-form-select",{attrs:{id:"collection",options:e.collections,"data-cy":"inspector-collection"},on:{change:e.resetFields},model:{value:e.collectionId,callback:function(a){e.collectionId=a},expression:"collectionId"}})],1),e.fields.length>1?r("div",{staticClass:"mt-3"},[r("label",{attrs:{for:"label"}},[e._v(e._s(e.$t("Label")))]),r("b-form-select",{attrs:{id:"label",options:e.fields,"data-cy":"inspector-collection-label"},model:{value:e.labelField,callback:function(a){e.labelField=a},expression:"labelField"}})],1):e._e(),e.fields.length>1?r("div",{staticClass:"mt-3"},[r("label",{attrs:{for:"value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-select",{attrs:{id:"value",options:e.fields,"data-cy":"inspector-collection-value"},model:{value:e.valueField,callback:function(a){e.valueField=a},expression:"valueField"}})],1):e._e(),e.fields.length>1?r("div",{staticClass:"mt-3"},[r("pmql-input",{staticClass:"mb-1",attrs:{"search-type":"collections_w_mustaches","data-cy":"inspector-collection-pmql","input-label":"PMQL",condensed:!0,"ai-enabled":!0,placeholder:e.$t("PMQL")},model:{value:e.pmql,callback:function(a){e.pmql=a},expression:"pmql"}}),r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("Advanced data search")))])],1):e._e(),e.fields.length>1?r("div",{staticClass:"mt-3"},[r("form-checkbox",{attrs:{label:e.$t("Ignore duplicates in list"),helper:e.$t("Select to show only distinct list entries if labels are repeated. Only the first value will be used if duplicate labels have different values."),"data-cy":"inspector-collection-isDependent"},model:{value:e.unique,callback:function(a){e.unique=a},expression:"unique"}})],1):e._e()])},xY=[],kY=oe(yY,SY,xY,!1,null,null,null,null);const Zp=kY.exports,Ite="",_Y={components:{},props:{label:{},value:{},helper:{},options:{}},data(){return{newColor:""}},computed:{hasColor(){return!!this.value}},methods:{emitChanges(t){this.$emit("input",t),this.$emit("update-state")},checkColor(){this.hasColor&&this.emitChanges("")},selectColor(t){this.emitChanges(t)},parsedColor(t){return t.split("-")[1]}}};var wY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("div",[r("label",[e._v(e._s(e.label))]),r("b-button-toolbar",[r("b-button-group",{attrs:{size:"sm"}},e._l(e.options,function(a){return r("b-button",{key:a.value,staticClass:"btn btn-sm mr-1 pr-1 pl-1 pt-0 pb-0 btn-outline-none",class:["bg-"+e.parsedColor(a.value)],attrs:{size:"sm",variant:"outline-light",title:a.content}},[r("i",{staticClass:"fas fa-check",class:[a.value===e.value?"text-light":"text-"+e.parsedColor(a.value)],on:{click:function(i){return e.selectColor(a.value)}}})])}),1)],1),r("small",{on:{click:function(a){return e.checkColor()}}},[r("i",{staticClass:"fas fa-ban"}),e._v(" "+e._s(e.$t("Clear Color Selection"))+" ")])],1)])},CY=[],TY=oe(_Y,wY,CY,!1,null,"7de98bb3",null,null);const _x=TY.exports,Ts=[{value:"provideData",text:"Provide Values"},{value:"dataObject",text:"Request Data"},{value:"dataConnector",text:"Data Connector"},{value:"collection",text:"Collection"}],ea=Ts.reduce((t,e)=>(t[e.value]=e.value,t),{}),zte="",AY={components:{draggable:Oa,MonacoEditor:_a},props:["options"],model:{prop:"options",event:"change"},data(){return{jsonError:"",optionError:"",dragging:!1,dataSourceValues:ea,dataSources:Ts,dataSource:ea.provideData,jsonData:"",key:null,value:null,dataName:"",pmqlQuery:"",optionsList:[],showOptionCard:!1,showRemoveWarning:!1,showJsonEditor:!1,optionCardType:"",editIndex:null,removeIndex:null,optionValue:"",optionContent:"",showRenderAs:!1,renderAs:"dropdown",allowMultiSelect:!1,defaultOptionKey:!1,selectedOptions:[],renderAsOptions:[{text:"Dropdown/Multiselect",value:"dropdown"},{text:"Radio/Checkbox Group",value:"checkbox"}],monacoOptions:{automaticLayout:!0,fontSize:8},monacoLargeOptions:{automaticLayout:!0},showPopup:!1}},watch:{options:{handler(){this.dataSource=this.options.dataSource,this.jsonData=this.options.jsonData,this.dataName=this.options.dataName,this.key=this.options.key,this.value=this.options.value,this.pmqlQuery=this.options.pmqlQuery,this.defaultOptionKey=this.options.defaultOptionKey,this.selectedOptions=this.options.selectedOptions,this.optionsList=this.options.optionsList,this.showRenderAs=this.options.showRenderAs,this.renderAs=this.options.renderAs,this.allowMultiSelect=this.options.allowMultiSelect,this.showOptionCard=this.options.showOptionCard,this.showRemoveWarning=this.options.showRemoveWarning,this.showJsonEditor=this.options.showJsonEditor,this.editIndex=this.options.editIndex,this.removeIndex=this.options.removeIndex}},dataSource(){this.jsonData="",this.dataName=""},dataObjectOptions(t){this.$emit("change",t)}},computed:{jsonDataClass(){return this.jsonError?"is-invalid":""},optionKeyClass(){return this.optionError?"is-invalid":""},keyField(){return this.key||"value"},valueField(){return this.value||"content"},currentItemToDelete(){if(this.removeIndex!==null&&this.optionsList.length>0&&this.optionsList[this.removeIndex]!==void 0){let t=this.optionsList[this.removeIndex][this.valueField];return this.$t('Are you sure you want to delete "{{item}}"?',{item:t})}return""},dataObjectOptions(){return{dataSource:this.dataSource,jsonData:this.jsonData,dataName:this.dataName,key:this.key,value:this.value,pmqlQuery:this.pmqlQuery,defaultOptionKey:this.defaultOptionKey,selectedOptions:this.selectedOptions,optionsList:this.optionsList,showRenderAs:this.showRenderAs,renderAs:this.renderAs,allowMultiSelect:this.allowMultiSelect,showOptionCard:this.showOptionCard,showRemoveWarning:this.showRemoveWarning,showJsonEditor:this.showJsonEditor,editIndex:this.editIndex,removeIndex:this.removeIndex}}},mounted(){this.initData()},methods:{initData(){this.dataSource=this.options.dataSource,this.jsonData=this.options.jsonData,this.dataName=this.options.dataName,this.key=this.options.key,this.value=this.options.value,this.pmqlQuery=this.options.pmqlQuery,this.defaultOptionKey=this.options.defaultOptionKey,this.selectedOptions=this.options.selectedOptions,this.optionsList=this.options.optionsList?this.options.optionsList:[],this.jsonData=JSON.stringify(this.optionsList),this.showRenderAs=this.options.showRenderAs,this.renderAs=this.options.renderAs,this.allowMultiSelect=this.options.allowMultiSelect},defaultOptionClick(){this.defaultOptionKey===event.target.value&&(this.defaultOptionKey=!1)},rowCss(t){return t%2===0?"striped":"bg-default"},keyChanged(){this.jsonDataChange()},valueChanged(){this.jsonDataChange()},jsonDataChange(){let t=[];try{if(t=JSON.parse(this.jsonData),t.constructor!==Array&&t.constructor!==Object)throw Error("String does not represent a valid JSON")}catch(r){this.jsonError=r.message;return}this.optionsList=[];const e=this;t.forEach(r=>{e.optionsList.push({[e.keyField]:r[e.keyField],[e.valueField]:r[e.valueField]})}),this.jsonError=""},updateSort(){this.jsonData=JSON.stringify(this.optionsList),this.$emit("change",this.dataObjectOptions)},editAsJson(){this.showJsonEditor=!0},editAsOptionList(){this.showJsonEditor=!1},showEditOption(t){this.optionCardType="edit",this.editIndex=t,this.optionContent=this.optionsList[t][this.valueField],this.optionValue=this.optionsList[t][this.keyField],this.optionError=""},showAddOption(){this.optionCardType="insert",this.optionContent="",this.optionValue="",this.showOptionCard=!0,this.optionError="",this.editIndex=null},addOption(){const t=this;if(this.optionsList===void 0&&this.initData(),this.optionCardType==="insert"){if(this.optionsList.find(e=>e[t.keyField]===this.optionValue)){this.optionError="An item with the same key already exists";return}this.optionsList.push({[this.valueField]:this.optionContent,[this.keyField]:this.optionValue})}else{if(this.optionsList.find((e,r)=>e[t.keyField]===this.optionValue&&r!==this.editIndex)){this.optionError="An item with the same key already exists";return}this.optionsList[this.editIndex][this.keyField]=this.optionValue,this.optionsList[this.editIndex][this.valueField]=this.optionContent}this.jsonError="",this.jsonData=JSON.stringify(this.optionsList),this.showOptionCard=!1,this.optionError="",this.editIndex=null},deleteOption(){this.optionsList.splice(this.removeIndex,1),this.jsonData=JSON.stringify(this.optionsList),this.showRemoveWarning=!1,this.removeIndex=null},removeOption(t){this.removeIndex=t,this.showRemoveWarning=!0},expandEditor(){this.showPopup=!0},closePopup(){this.showPopup=!1}}};var OY=function(){var e=this,r=e._self._c;return r("div",[!e.showJsonEditor&&e.dataSource===e.dataSourceValues.provideData?r("div",[r("div",{staticClass:"row"},[r("div",{staticClass:"col-10"},[r("label",{attrs:{for:"data-sources"}},[r("b",[e._v(e._s(e.$t("Column")))])])]),r("div",{staticClass:"col-2"},[r("a",{staticClass:"fas fa-plus-square",on:{click:e.showAddOption}})])]),e.showOptionCard?r("div",{staticClass:"card mb-2"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Add Column"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Column"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Column Header")))]),r("b-form-input",{attrs:{id:"option-content"},model:{value:e.optionContent,callback:function(a){e.optionContent=a},expression:"optionContent"}}),r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass},model:{value:e.optionValue,callback:function(a){e.optionValue=a},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e()],1),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-2",attrs:{type:"button"},on:{click:function(a){e.showOptionCard=!1}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button"},on:{click:function(a){return e.addOption()}}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e._e(),r("div",{staticClass:"row"},[r("div",{staticClass:"col"},[r("draggable",{attrs:{element:"div",group:"options"},on:{update:e.updateSort,start:function(a){e.drag=!0},end:function(a){e.drag=!1}},model:{value:e.optionsList,callback:function(a){e.optionsList=a},expression:"optionsList"}},e._l(e.optionsList,function(a,i){return r("div",{key:a.value},[e.removeIndex===i?r("div",[r("div",{staticClass:"card mb-3 bg-danger text-white text-right"},[r("div",{staticClass:"card-body p-2"},[e._v(" "+e._s(e.currentItemToDelete)+" ")]),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-light mr-2",attrs:{type:"button"},on:{click:function(n){e.removeIndex=null}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-danger",attrs:{type:"button"},on:{click:function(n){return e.deleteOption()}}},[e._v(" "+e._s(e.$t("Delete"))+" ")])])])]):e._e(),e.editIndex===i?r("div",[r("div",{staticClass:"card my-2"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Add Option"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Option"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Column Header")))]),r("b-form-input",{attrs:{id:"option-content"},model:{value:e.optionContent,callback:function(n){e.optionContent=n},expression:"optionContent"}}),r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass},model:{value:e.optionValue,callback:function(n){e.optionValue=n},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e()],1),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-2",attrs:{type:"button"},on:{click:function(n){e.editIndex=null}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button"},on:{click:function(n){return e.addOption()}}},[e._v(" "+e._s(e.$t("Update"))+" ")])])])]):e._e(),r("div",{staticClass:"row border-top",class:e.rowCss(i)},[r("div",{staticClass:"col-1",staticStyle:{cursor:"grab"}},[r("span",{staticClass:"fas fa-arrows-alt-v"})]),r("div",{staticClass:"col-1 d-flex align-items-center"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.defaultOptionKey,expression:"defaultOptionKey"}],staticClass:"form-check",attrs:{type:"radio",name:"defaultOptionGroup"},domProps:{value:a[e.keyField],checked:e._q(e.defaultOptionKey,a[e.keyField])},on:{click:e.defaultOptionClick,change:function(n){e.defaultOptionKey=a[e.keyField]}}})]),r("div",{staticClass:"col-5",staticStyle:{cursor:"grab"}},[e._v(" "+e._s(a[e.valueField])+" ")]),r("div",{staticClass:"col-1"},[r("a",{staticClass:"fas fa-cog",staticStyle:{cursor:"pointer"},on:{click:function(n){return e.showEditOption(i)}}})]),r("div",{staticClass:"col-1"},[r("a",{staticClass:"fas fa-trash-alt",staticStyle:{cursor:"pointer"},on:{click:function(n){return e.removeOption(i)}}})])])])}),0)],1)]),r("div",{staticClass:"row"},[r("div",{staticClass:"col text-right"},[r("a",{attrs:{href:"#"},on:{click:function(a){return e.editAsJson()}}},[r("small",{staticClass:"form-text text-muted mb-3"},[r("b",[e._v("</>")]),e._v(" "+e._s(e.$t("Edit as JSON")))])])])]),e.showRenderAs?r("div",{staticClass:"row mb-3"},[r("div",{staticClass:"col-12"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.allowMultiSelect,expression:"allowMultiSelect"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.allowMultiSelect)?e._i(e.allowMultiSelect,null)>-1:e.allowMultiSelect},on:{change:function(a){var i=e.allowMultiSelect,n=a.target,s=!!n.checked;if(Array.isArray(i)){var o=null,u=e._i(i,o);n.checked?u<0&&(e.allowMultiSelect=i.concat([o])):u>-1&&(e.allowMultiSelect=i.slice(0,u).concat(i.slice(u+1)))}else e.allowMultiSelect=s}}}),e._v(" Allow multiple selections ")])]):e._e(),e.showRenderAs?r("div",{staticClass:"row mb-3"},[r("div",{staticClass:"col"},[r("label",{attrs:{for:"render-as"}},[e._v(e._s(e.$t("Render Options As")))]),r("b-form-select",{attrs:{id:"render-as",options:e.renderAsOptions},model:{value:e.renderAs,callback:function(a){e.renderAs=a},expression:"renderAs"}})],1)]):e._e()]):e._e(),e.showJsonEditor&&e.dataSource===e.dataSourceValues.provideData?r("div",[e.dataSource===e.dataSourceValues.provideData?r("div",[r("div",{staticClass:"mb-2"},[r("label",{attrs:{for:"json-data"}},[e._v(e._s(e.$t("JSON Data")))]),r("button",{staticClass:"btn-sm float-right",attrs:{type:"button","aria-label":e.$t("Expand Editor")},on:{click:e.expandEditor}},[r("i",{staticClass:"fas fa-expand"})])]),r("div",{staticClass:"small-editor-container"},[r("MonacoEditor",{staticClass:"editor",attrs:{options:e.monacoOptions,language:"json"},on:{change:e.jsonDataChange},model:{value:e.jsonData,callback:function(a){e.jsonData=a},expression:"jsonData"}})],1),r("b-modal",{attrs:{size:"lg",centered:"",title:e.$t("Script Config Editor"),"header-close-content":"×"},model:{value:e.showPopup,callback:function(a){e.showPopup=a},expression:"showPopup"}},[r("div",{staticClass:"editor-container"},[r("MonacoEditor",{staticClass:"editor",attrs:{options:e.monacoLargeOptions,language:"json"},on:{change:e.jsonDataChange},model:{value:e.jsonData,callback:function(a){e.jsonData=a},expression:"jsonData"}})],1),r("div",{attrs:{slot:"modal-footer"},slot:"modal-footer"},[r("b-button",{staticClass:"btn btn-secondary text-uppercase",on:{click:e.closePopup}},[e._v(" "+e._s(e.$t("Close"))+" ")])],1)])],1):e._e(),e.jsonError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.jsonError))])]):e._e(),r("a",{staticClass:"text-right",attrs:{href:"#"},on:{click:function(a){return e.editAsOptionList()}}},[r("small",{staticClass:"form-text text-muted mb-3"},[r("b",[e._v("</>")]),e._v(" "+e._s(e.$t("Edit as Option List")))])])]):e._e(),e.dataSource===e.dataSourceValues.dataObject?r("div",[r("label",{attrs:{for:"data-name"}},[e._v(e._s(e.$t("Data Name")))]),r("b-form-input",{attrs:{id:"data-name"},model:{value:e.dataName,callback:function(a){e.dataName=a},expression:"dataName"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Data source to populate select")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataObject||e.showJsonEditor?r("div",[r("label",{attrs:{for:"key"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"key"},on:{change:e.keyChanged},model:{value:e.key,callback:function(a){e.key=a},expression:"key"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Field to save to the data object")))]),r("label",{attrs:{for:"value"}},[e._v(e._s(e.$t("Content")))]),r("b-form-input",{attrs:{id:"value"},on:{change:e.valueChanged},model:{value:e.value,callback:function(a){e.value=a},expression:"value"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Field to show in the select box")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataObject?r("div",[r("label",{attrs:{for:"pmql-query"}},[e._v(e._s(e.$t("PMQL")))]),r("b-form-textarea",{attrs:{id:"json-data",rows:"4"},model:{value:e.pmqlQuery,callback:function(a){e.pmqlQuery=a},expression:"pmqlQuery"}}),r("small",{staticClass:"form-text text-muted"},[e._v("Advanced data search")])],1):e._e()])},EY=[],MY=oe(AY,OY,EY,!1,null,"d454ec3c",null,null);const wx=MY.exports,$Y={components:{FormInput:ee.FormInput,FormCheckbox:ee.FormCheckbox,FormTextArea:ee.FormTextArea,draggable:Oa},data(){return{addValue:"",addContent:"",addError:"",existingOptions:[],dataJson:[],displayList:!1}},mounted(){this.existingOptions=JSON.parse(JSON.stringify(this.options))},watch:{displayList(){this.displayList&&(this.dataJson=this.options?JSON.stringify(this.options):"")},options(){this.existingOptions=JSON.parse(JSON.stringify(this.options))}},props:["label","options","helper"],model:{prop:"options",event:"change"},computed:{deleteIf(){return this.options.length>1},isValidJson(){try{return JSON.parse(this.dataJson),!0}catch{return!1}}},methods:{saveDataJson(){this.isValidJson&&this.$emit("change",JSON.parse(this.dataJson))},updateSort(){this.existingOptions.forEach((e,r)=>{e.value=r+1});let t=JSON.parse(JSON.stringify(this.existingOptions));this.$emit("change",t)},resetAdd(){this.addValue="",this.addContent="",this.addError=""},addNewOption(t){let e=JSON.parse(JSON.stringify(this.options));if(isNaN(this.addContent)){this.addError=this.$t("This value must be numeric"),t.preventDefault();return}if(!(0<this.addContent&&this.addContent<13)){this.addError=this.$t("This value must be between 1-12"),t.preventDefault();return}let r=0,a=0;if(this.existingOptions.forEach(i=>{r++,a+=Number(i.content),i.value=r}),a+Number(this.addContent)>12){this.addError=this.$t("The total size of the columns exceeds 12"),t.preventDefault();return}e.push({value:r+1,content:this.addContent}),this.$emit("change",e),this.resetAdd()},removeOption(t){let e=JSON.parse(JSON.stringify(this.options));e.splice(t,1),e.forEach((r,a)=>{r.value=a+1}),this.$emit("change",e)}}};var PY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("h3",[e._v(e._s(e.label))]),r("form-checkbox",{attrs:{name:"type",toggle:"true",label:e.$t("Show in Json Format"),helper:"","data-cy":"inspector-jsonFormat"},model:{value:e.displayList,callback:function(a){e.displayList=a},expression:"displayList"}}),e.displayList?[r("div",{staticClass:"alert",class:{"alert-success":e.isValidJson,"alert-danger":!e.isValidJson}},[e.isValidJson?r("span",[e._v("Valid JSON Data Object")]):r("span",[e._v("Invalid JSON Data Object")])]),r("form-text-area",{attrs:{name:"dataJson",label:e.$t("Json Options"),rows:"8",helper:e.$t("It must be a correct json format"),"data-cy":"inspector-dataJson"},model:{value:e.dataJson,callback:function(a){e.dataJson=a},expression:"dataJson"}}),r("b-btn",{attrs:{disabled:!e.isValidJson,"data-cy":"inspector-dataJson-save"},on:{click:e.saveDataJson}},[e._v(e._s(e.$t("Save")))])]:[r("table",{staticClass:"table table-sm"},[r("thead",{staticClass:"thead-dark"},[r("tr",[r("th",[e._v(e._s(e.$t("Column")))]),r("th",[e._v(e._s(e.$t("Colspan")))]),r("th",[e._v(e._s(e.$t("Remove")))])])]),r("draggable",{attrs:{element:"tbody",group:"options"},on:{update:e.updateSort},model:{value:e.existingOptions,callback:function(a){e.existingOptions=a},expression:"existingOptions"}},e._l(e.existingOptions,function(a,i){return r("tr",{key:i,attrs:{"data-cy":`inspector-columns-tr-${i}`}},[r("td",[e._v(e._s(a.value))]),r("td",[e._v(e._s(a.content))]),r("td",[e.deleteIf?r("button",{staticClass:"btn btn-danger btn-sm",attrs:{"data-cy":"inspector-columns-remove","aria-label":e.$t("Delete")},on:{click:function(n){return e.removeOption(i)}}},[e._v("x ")]):e._e()])])}),0)],1),r("b-btn",{directives:[{name:"b-modal",rawName:"v-b-modal.addOptionModal",modifiers:{addOptionModal:!0}}],attrs:{"data-cy":"inspector-columns-add"}},[e._v(e._s(e.$t("Add Column")))]),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.helper)))]):e._e(),r("b-modal",{attrs:{"ok-title":e.$t("Ok"),"cancel-title":e.$t("Cancel"),id:"addOptionModal",title:e.$t("Add New Column"),"data-cy":"inspector-add-column-modal"},on:{cancel:e.resetAdd,ok:e.addNewOption}},[r("form-input",{attrs:{label:e.$t("Column Width"),validate:"required|numeric|between:1,12",error:this.addError,"data-cy":"inspector-add-column-width"},model:{value:e.addContent,callback:function(a){e.addContent=a},expression:"addContent"}})],1)]],2)},DY=[],IY=oe($Y,PY,DY,!1,null,null,null,null);const Cx=IY.exports,Lte="",zY={components:{MustacheHelper:Hi},mixins:[],props:{value:String},data(){return{field:"",dataMapping:[],options:[]}},methods:{loadOptions(){const t=this.getConfig();let e=t.endpoint;this.options=[],window.ProcessMaker.apiClient.get(`/data_sources/${t.dataSource}`).then(r=>{let a=window._.get(r,`data.endpoints.${e}`,null);if(this.dsEndpoint=a,a===null)return;let i=window._.get(a,"dataMapping",[]);this.options=i.map(n=>n.key)})},getConfig(){try{return JSON.parse(this.value)}catch{return{}}},setConfig(t,e){const r=this.getConfig();JSON.stringify(r[t])!==JSON.stringify(e)&&(r[t]=e,this.$emit("input",JSON.stringify(r)))},removeRowIndex(t){this.dataMapping.splice(t,1)},addMapping(){this.dataMapping.push({key:"",value:""})}},watch:{dataMapping:{deep:!0,immediate:!0,handler(t){this.setConfig("dataMapping",t)}},value:{immediate:!0,handler(){const t=this.getConfig().dataMapping;t&&(this.dataMapping.splice(0),t.forEach(e=>{this.dataMapping.push(e)}))}}}};var LY=function(){var e=this,r=e._self._c;return r("div",[r("div",{staticClass:"d-flex mb-1"},[r("label",{staticClass:"flex-grow-1 m-0"},[e._v(e._s(e.$t("Output Variable Property Mapping")))]),r("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm px-2",attrs:{type:"button"},on:{click:e.addMapping}},[e._v("+ "+e._s(e.$t("Property"))+" ")])]),r("table",{staticClass:"table table-striped table-sm border mb-1"},[r("thead",[r("tr",[r("th",{attrs:{scope:"col"}},[r("div",{staticClass:"float-left"},[e._v(e._s(e.$t("Source")))]),e._v(" "),r("mustache-helper",{staticClass:"float-left ml-2"})],1),r("th",{attrs:{scope:"col"}},[r("div",{staticClass:"float-left"},[e._v(e._s(e.$t("Form Variable")))]),e._v(" "),r("mustache-helper",{staticClass:"float-left ml-2"})],1),r("th",{attrs:{scope:"col"}},[e._v(" ")])])]),r("tbody",e._l(e.dataMapping,function(a,i){return r("tr",{key:i},[r("td",{staticClass:"p-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:a.value,expression:"row.value"}],staticClass:"form-control",attrs:{name:"value",placeholder:e.$t("Leave blank to map all response data"),type:"text"},domProps:{value:a.value},on:{input:function(n){n.target.composing||e.$set(a,"value",n.target.value)}}})]),r("td",{staticClass:"p-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:a.key,expression:"row.key"}],staticClass:"form-control",attrs:{name:"key",placeholder:e.$t("The Request variable is a new/existing variable"),type:"text"},domProps:{value:a.key},on:{input:function(n){n.target.composing||e.$set(a,"key",n.target.value)}}})]),r("td",{staticClass:"align-middle text-right p-1"},[r("a",{staticClass:"btn btn-sm btn-danger",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.removeRowIndex(i)}}},[r("i",{staticClass:"fa fa-trash-alt"})])])])}),0)]),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(" "+e._s(e.$t("Properties to map from the Data Connector into the output variable"))+" "),r("br"),e._v(" "+e._s(e.$t("(If empty, all data returned will be mapped to the output variable)"))+" ")])])},jY=[],NY=oe(zY,LY,jY,!1,null,"831d025b",null,null);const Xp=NY.exports,jte="",RY={props:["value","helper"],components:{MonacoEditor:_a},data(){return{mode:"basic",jsValue:"",basicValue:"",monacoOptions:{lineNumbers:"off",glyphMargin:!1,folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:0,minimap:{enabled:!1},fixedOverflowWidgets:!0,automaticLayout:!0}}},watch:{value:{handler(){H.isEqual(this.configValue,this.value)||(this.mode="basic",this.basicValue="",this.jsValue="",this.value&&(typeof this.value=="string"?(this.mode="basic",this.effectiveValue=this.value):(this.mode=this.value.mode,this.effectiveValue=this.value.value)))},immediate:!0},mode(){this.emit()},jsValue(){this.emit()},basicValue(){this.emit()}},computed:{effectiveValue:{get(){return this.mode==="js"?this.jsValue:this.basicValue},set(t){this.mode==="js"?this.jsValue=t:this.basicValue=t}},configValue(){return{mode:this.mode,value:this.effectiveValue}}},methods:{emit(){this.$emit("input",this.configValue)}}};var FY=function(){var e=this,r=e._self._c;return r("div",[r("label",[e._v(e._s(e.$t("Default Value"))+" ")]),r("div",{staticClass:"float-right buttons"},[r("b-button",{class:{active:e.mode==="basic"},attrs:{title:e.$t("Basic Mode"),variant:"light",size:"sm","data-cy":"inspector-defaultValue-basic"},on:{click:function(a){e.mode="basic"}}},[r("i",{staticClass:"fas fa-i-cursor"})]),r("b-button",{class:{active:e.mode==="js"},attrs:{title:e.$t("Javascript"),variant:"light",size:"sm","data-cy":"inspector-defaultValue-js"},on:{click:function(a){e.mode="js"}}},[r("i",{staticClass:"fab fa-js-square"})])],1),e.mode==="basic"?r("div",[r("b-form-input",{attrs:{"data-cy":"inspector-defaultValue-basicValue"},model:{value:e.basicValue,callback:function(a){e.basicValue=a},expression:"basicValue"}}),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t(e.helper)))]):e._e()],1):e._e(),e.mode==="js"?r("div",[r("MonacoEditor",{staticClass:"editor",attrs:{options:e.monacoOptions,language:"javascript","data-cy":"inspector-defaultValue-jsValue"},model:{value:e.jsValue,callback:function(a){e.jsValue=a},expression:"jsValue"}}),e.helper?r("small",{staticClass:"form-text text-muted mt-2"},[e._v(e._s(e.$t(e.helper)))]):e._e()],1):e._e()])},qY=[],BY=oe(RY,FY,qY,!1,null,"ae4176b8",null,null);const ef=BY.exports,WY={props:["optionValue","optionContent"],data(){},watch:{},computed:{},mounted(){},methods:{}};var VY=function(){var e=this,r=e._self._c;return e.showOptionCard?r("div",{staticClass:"card"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header pl-2"},[e._v(" "+e._s(e.$t("Add Option"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Option"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass},model:{value:e.optionValue,callback:function(a){e.optionValue=a},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e(),r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Content")))]),r("b-form-input",{attrs:{id:"option-content"},model:{value:e.optionContent,callback:function(a){e.optionContent=a},expression:"optionContent"}}),r("div",{staticClass:"card-footer pr-1 mt-3 text-right"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-3",attrs:{type:"button"},on:{click:function(a){e.showOptionCard=!1}}},[e._v(" "+e._s(e.$t("Close"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button"},on:{click:function(a){return e.addOption()}}},[e._v(" "+e._s(e.$t("Save"))+" ")])])],1)]):e._e()},UY=[],GY=oe(WY,VY,UY,!1,null,null,null,null);const Tx=GY.exports,Nte="",HY={components:{RequiredAsterisk:ee.RequiredAsterisk},mixins:[ee.ValidationMixin],inheritAttrs:!1,props:["label","error","options","helper","name","value","selectedControl"],computed:{classList(){return{"has-errors":this.validator&&this.validator.errorCount||this.error}}},methods:{getLabelFromValue(t){const e=this.options.find(r=>r.value==t);return e?e.content:null}}};var YY=function(){var e=this,r=e._self._c;return r("div",[r("required-asterisk"),r("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),r("multiselect",e._g(e._b({class:e.classList,attrs:{value:e.value,placeholder:e.$t("Select..."),"show-labels":!1,options:e.options.map(a=>a.value),"custom-label":e.getLabelFromValue}},"multiselect",e.$attrs,!1),e.$listeners),[r("template",{slot:"noResult"},[e._v(" "+e._s(e.$t("No elements found. Consider changing the search query."))+" ")]),r("template",{slot:"noOptions"},[e._v(" "+e._s(e.$t("No Data Available"))+" ")])],2),e.validator&&e.validator.errorCount||e.error?r("div",{staticClass:"invalid-feedback d-block"},[e._l(e.validator.errors.get(e.name),function(a,i){return r("div",{key:i},[e._v(" "+e._s(a)+" ")])}),e.error?r("div",[e._v(e._s(e.error))]):e._e()],2):e._e(),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]):e._e()],1)},QY=[],KY=oe(HY,YY,QY,!1,null,null,null,null);const tf=KY.exports,Rte="",JY={props:["value"],components:{FileUpload:Gf},data(){return{files:[]}},computed:{owner(){return this.$parent.$parent.inspection.config}},methods:{editSave(t){let e=new FileReader;e.readAsDataURL(t.file),e.addEventListener("load",()=>{let r=t.file.name.split(".");this.owner.name=escape(r[0]),this.$emit("input",e.result)},!1)}}};var ZY=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("file-upload",{ref:"upload",staticClass:"btn btn-sm btn-primary",attrs:{extensions:"gif,jpg,jpeg,png,webp",accept:"image/png,image/gif,image/jpeg,image/webp",name:"avatar"},on:{"input-file":e.editSave},model:{value:e.files,callback:function(a){e.files=a},expression:"files"}},[e._v(" "+e._s(e.$t("Upload"))+" ")]),r("small",{staticClass:"form-text text-muted",attrs:{"data-v-7779e22f":""}},[e._v(e._s(e.$t("Preview")))]),r("div",{staticClass:"image-preview"},[r("img",{staticStyle:{height:"4em"},attrs:{src:e.value}})])],1)},XY=[],eQ=oe(JY,ZY,XY,!1,null,"70a59c9a",null,null);const Ax=eQ.exports,tQ={props:["value","selectedControl"],components:{FormInput:ee.FormInput,FormCheckbox:ee.FormCheckbox},data(){return{imageName:null}},computed:{renderImage:{get(){return this.selectedControl.config.renderImage},set(t){this.selectedControl.config.renderImage=t}},mode(){return this.$root.$children[0].mode}},watch:{value(){this.value==null?this.renderImage=!1:(this.renderImage=!0,this.imageName=this.value)},imageName(){this.$emit("input",this.imageName)},renderImage(){this.renderImage||(this.renderImage=!1,this.imageName=null,this.$emit("input",this.imageName))}},mounted(){this.value&&(this.renderImage=!0,this.imageName=this.value)}};var rQ=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("form-checkbox",{attrs:{label:e.$t("Render image from a variable name"),"data-cy":"inspector-renderImage"},model:{value:e.renderImage,callback:function(a){e.renderImage=a},expression:"renderImage"}}),e.renderImage?r("form-input",{attrs:{label:e.$t("Variable Name"),"data-cy":"inspector-variableName"},model:{value:e.imageName,callback:function(a){e.imageName=a},expression:"imageName"}}):e._e()],1)},aQ=[],iQ=oe(tQ,rQ,aQ,!1,null,null,null,null);const Ox=iQ.exports,Fte="",nQ={props:{builder:Object,selectedControl:Object,formConfig:Array,value:null},data(){return{suggestVariables:!1,localValue:this.value||"",open:!1}},computed:{allOptions(){const t=this.builder.variablesTree,{variables:e,prefix:r,parent_prefix:a}=this.loadVariables({items:t}),i=r.length,n=a.length;return r?[...Object.keys(e).filter(s=>s.substr(0,i)===r).map(s=>s.substr(i)),...Object.keys(e).filter(s=>s.substr(0,n)===a).map(s=>`_parent.${s.substr(n)}`)]:Object.keys(e)},options(){if(!this.localValue)return;const t=new RegExp(this.localValue.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\.\d+/g,".index"),"g");return this.allOptions.filter(e=>e.match(t)).splice(0,5).map(e=>({value:e.replace(t,this.localValue),text:e.replace(t,`<b>${this.localValue}</b>`)}))}},methods:{loadVariables(t,e="",r={},a={prefix:"",parent_prefix:""}){const i=e;return t.items?(e+=t.prefix||"",t.items.forEach(n=>{n.config===this.selectedControl.config&&(a.prefix=e,a.parent_prefix=i),this.loadVariables(n,e,r,a)})):r[`${e}${t.name}`]=null,{variables:r,...a}},choose(t){this.localValue=t.value,this.$emit("input",this.localValue),this.$emit("change",this.localValue),this.open=!1},blur(){setTimeout(()=>this.open=!1,500)},focus(){this.open=!0},input(){this.$emit("input",this.localValue)},change(){this.open=!0,this.$emit("change",this.localValue)}},watch:{value(t){t!=this.localValue&&(this.localValue=t)}}};var sQ=function(){var e=this,r=e._self._c;return r("b-input-group",{scopedSlots:e._u([e.suggestVariables?{key:"append",fn:function(){return[r("b-dropdown",{ref:"dropdown",attrs:{text:"(x)",right:"","no-caret":"",variant:"outline-secondary","menu-class":{"input-variable-open":e.open}}},e._l(e.options,function(a){return r("b-dropdown-item",{key:a.value,staticClass:"text-small",on:{click:function(i){return e.choose(a)}}},[r("small",[r("code",{domProps:{innerHTML:e._s(a.text)}})])])}),1)]},proxy:!0}:null],null,!0)},[r("b-form-input",e._b({on:{focus:e.focus,input:e.input,blur:e.blur,change:e.change},model:{value:e.localValue,callback:function(a){e.localValue=a},expression:"localValue"}},"b-form-input",e.$attrs,!1))],1)},oQ=[],lQ=oe(nQ,sQ,oQ,!1,null,null,null,null);const rf=lQ.exports,qte="",uQ={props:["value","screenType"],inheritAttrs:!1,components:{FormInput:ee.FormInput,FormCheckbox:ee.FormCheckbox},data(){return{options:[{value:"new",text:this.$t("New Array of Objects")},{value:"existing",text:this.$t("Existing Array")}],settings:{type:"new",varname:"",times:"3",add:!1}}},watch:{settings:{handler(){this.$emit("input",this.settings),this.$emit("setName",this.settings.varname)},deep:!0},value:{handler(){this.settings=this.value},immediate:!0}},computed:{}};var cQ=function(){var e=this,r=e._self._c;return r("div",[e.screenType=="form"?r("div",{staticClass:"form-group border-bottom pb-3"},[r("label",{attrs:{for:"type"}},[e._v(e._s(e.$t("Data Source")))]),r("b-form-select",{attrs:{id:"type",options:e.options,"data-cy":"inspector-source"},model:{value:e.settings.type,callback:function(a){e.$set(e.settings,"type",a)},expression:"settings.type"}})],1):e._e(),r("div",{staticClass:"form-group border-bottom"},[r("FormInput",{attrs:{label:e.$t("Variable Name"),name:e.$t("Variable Name"),helper:e.$t("This variable will contain an array of objects"),validation:"regex:/^(?:[A-Z_.a-z])(?:[0-9A-Z_.a-z])*$/|required","data-cy":"inspector-name"},model:{value:e.settings.varname,callback:function(a){e.$set(e.settings,"varname",a)},expression:"settings.varname"}})],1),e.screenType=="form"&&e.settings.type==="new"?r("div",{staticClass:"form-group border-bottom"},[r("FormInput",{attrs:{label:e.$t("Default Loop Count"),name:e.$t("Default Loop Count"),helper:e.$t("Number of times to show the loop. Value must be greater than zero."),validation:"required|integer|min:1|max:100","data-cy":"inspector-times"},model:{value:e.settings.times,callback:function(a){e.$set(e.settings,"times",a)},expression:"settings.times"}})],1):e._e(),e.screenType=="form"?r("form-checkbox",{attrs:{name:"add",label:e.$t("Allow additional loops"),helper:e.$t("Check this box to allow task assignee to add additional loops"),"data-cy":"inspector-add"},model:{value:e.settings.add,callback:function(a){e.$set(e.settings,"add",a)},expression:"settings.add"}}):e._e()],1)},dQ=[],pQ=oe(uQ,cQ,dQ,!1,null,null,null,null);const Ex=pQ.exports,Bte="",fQ={components:{draggable:Oa,MonacoEditor:_a,MustacheHelper:Hi,CollectionSelectList:Zp},props:["options","selectedControl"],model:{prop:"options",event:"change"},data(){return{optionError:"",dragging:!1,dataSourceValues:ea,dataSources:Ts,dataSource:ea.provideData,jsonData:"",key:null,value:null,dataName:"",collectionOptions:null,selectedDataSource:"",dataSourcesList:[],selectedEndPoint:"",endpoints:{},pmqlQuery:"",optionsList:[],showOptionCard:!1,showRemoveWarning:!1,showJsonEditor:!1,optionCardType:"",editIndex:null,removeIndex:null,optionValue:"",optionContent:"",showRenderAs:!1,renderAs:"dropdown",allowMultiSelect:!1,defaultOptionKey:!1,selectedOptions:[],renderAsOptions:[{text:this.$t("Dropdown/Multiselect"),value:"dropdown"},{text:this.$t("Radio/Checkbox Group"),value:"checkbox"}],monacoOptions:{automaticLayout:!0,fontSize:8,language:"json",formatOnPaste:!0,formatOnType:!0},monacoLargeOptions:{automaticLayout:!0},showPopup:!1,returnValueOptions:[{text:this.$t("Single Value"),value:"single"},{text:this.$t("Object"),value:"object"}],valueTypeReturned:""}},watch:{allowMultiSelect(t){this.selectedControl.config.dataFormat=t?"array":"string"},options(t){Object.keys(t).forEach(e=>{typeof t[e]<"u"&&this.$set(this,e,t[e])})},dataSource(t){switch(this.showRenderAs=!0,t){case"dataConnector":this.jsonData="",this.dataName="",this.collectionOptions=null,this.getDataSourceList();break;case"dataObject":this.jsonData="",this.selectedDataSource="",this.collectionOptions=null;break;case"provideData":this.dataName="",this.selectedDataSource="",this.collectionOptions=null;break;case"collection":this.showRenderAs=!1,this.jsonData="",this.dataName="",this.selectedDataSource="";break}},dataObjectOptions(t){this.$emit("change",t)},dataSourcesList(){this.dataSourcesList.some(t=>t.value===this.selectedDataSource)||this.dataSourcesList.length>0&&(this.selectedDataSource=this.dataSourcesList[0].value)},endPointList(){this.endPointList.some(t=>t.value===this.selectedEndPoint)||this.endPointList.length>0&&(this.selectedEndPoint=this.endPointList[0].value)}},computed:{showTypeOfValueReturned(){return this.dataSource!==ea.collection},endPointList(){return H.get(this.endpoints,this.selectedDataSource,[])},dataSourceTypes(){return typeof this.options.allowMultiSelect>"u"?[this.dataSources[0],this.$t(this.dataSources[1])]:this.dataSources.map(t=>({value:t.value,text:this.$t(t.text)}))},optionKeyClass(){return this.optionError?"is-invalid":""},keyField(){return this.key||"value"},valueField(){return this.value||"content"},currentItemToDelete(){if(this.removeIndex!==null&&this.optionsList.length>0&&this.optionsList[this.removeIndex]!==void 0){let t=this.optionsList[this.removeIndex][this.valueField];return this.$t('Are you sure you want to delete "{{item}}" option?',{item:t})}return""},dataObjectOptions(){return this.dataName||(this.dataName=this.options.dataName?this.options.dataName:"response"),{dataSource:this.dataSource,jsonData:this.jsonData,dataName:this.dataName,collectionOptions:this.collectionOptions,selectedDataSource:this.selectedDataSource,selectedEndPoint:this.selectedEndPoint,key:this.key,value:this.value,pmqlQuery:this.pmqlQuery,defaultOptionKey:this.defaultOptionKey,selectedOptions:this.selectedOptions,optionsList:this.optionsList,showRenderAs:this.showRenderAs,renderAs:this.renderAs,allowMultiSelect:this.allowMultiSelect,showOptionCard:this.showOptionCard,showRemoveWarning:this.showRemoveWarning,showJsonEditor:this.showJsonEditor,editIndex:this.editIndex,removeIndex:this.removeIndex,valueTypeReturned:this.valueTypeReturned}}},created(){this.onDebouncedPmqlChange=H.debounce(t=>{this.onPmqlChange(t)},1500)},mounted(){this.dataSource=this.options.dataSource,this.jsonData=this.options.jsonData,this.dataName=this.options.dataName,this.collectionOptions=this.options.collectionOptions,this.selectedDataSource=this.options.selectedDataSource,this.selectedEndPoint=this.options.selectedEndPoint,this.key=this.options.key,this.value=this.options.value,this.pmqlQuery=this.options.pmqlQuery,this.defaultOptionKey=this.options.defaultOptionKey,this.selectedOptions=this.options.selectedOptions,this.optionsList=this.options.optionsList?this.options.optionsList:[],this.jsonData=JSON.stringify(this.optionsList),this.showRenderAs=this.options.showRenderAs,this.renderAs=this.options.renderAs,this.allowMultiSelect=this.options.allowMultiSelect,this.valueTypeReturned=this.options.valueTypeReturned},methods:{monacoMounted(t){t.getAction("editor.action.formatDocument").run()},getDataSourceList(){this.$dataProvider.get("/data_sources").then(t=>{let e=t.data.data;this.dataSourcesList=[{value:null,text:this.$t("Select...")}].concat(e.map(this.convertToSelectOptions)),this.setEndpointList(e)})},setEndpointList(t){const e={};t.forEach(r=>{const a=r.endpoints?r.endpoints:[];e[r.id]=[{value:null,text:this.$t("Select...")}].concat(Object.keys(a).map(i=>({text:i,value:i})))}),this.endpoints=e},convertToSelectOptions(t){return{value:t.id,text:t.name}},jsonDataChange(){let t=[];try{if(t=JSON.parse(this.jsonData),t.constructor!==Array&&t.constructor!==Object)throw Error("String does not represent a valid JSON")}catch(r){this.jsonError=r.message;return}this.optionsList=[];const e=this;t.forEach(r=>{e.optionsList.push({[e.keyField]:r[e.keyField],[e.valueField]:r[e.valueField]})}),this.jsonError=""},defaultOptionClick(){this.defaultOptionKey===event.target.value&&(this.defaultOptionKey=!1)},rowCss(t){return t%2===0?"striped":"bg-default"},keyChanged(){this.jsonDataChange()},valueChanged(){this.jsonDataChange()},updateSort(){this.jsonData=JSON.stringify(this.optionsList),this.$emit("change",this.dataObjectOptions)},showEditOption(t){this.optionCardType="edit",this.editIndex=t,this.optionContent=this.optionsList[t][this.valueField],this.optionValue=this.optionsList[t][this.keyField],this.optionError=""},showAddOption(){this.optionCardType="insert",this.optionContent="",this.optionValue="",this.showOptionCard=!0,this.optionError="",this.editIndex=null},addOption(){const t=this;if(this.optionCardType==="insert"){if(this.optionsList.find(e=>e[t.keyField]===this.optionValue)){this.optionError="An item with the same key already exists";return}this.optionsList.push({[this.valueField]:this.optionContent,[this.keyField]:this.optionValue})}else{if(this.optionsList.find((e,r)=>e[t.keyField]===this.optionValue&&r!==this.editIndex)){this.optionError="An item with the same key already exists";return}this.optionsList[this.editIndex][this.keyField]=this.optionValue,this.optionsList[this.editIndex][this.valueField]=this.optionContent}this.jsonData=JSON.stringify(this.optionsList),this.showOptionCard=!1,this.optionError="",this.editIndex=null},deleteOption(){this.optionsList.splice(this.removeIndex,1),this.jsonData=JSON.stringify(this.optionsList),this.showRemoveWarning=!1,this.removeIndex=null},removeOption(t){this.removeIndex=t,this.showRemoveWarning=!0},expandEditor(){this.showPopup=!0},closePopup(){this.showPopup=!1},onNLQConversion(t){this.pmqlQuery=t},onPmqlChange(t){this.pmqlQuery=t}}};var hQ=function(){var e=this,r=e._self._c;return r("div",[r("label",{attrs:{for:"data-sources"}},[e._v(e._s(e.$t("Data Source")))]),r("b-form-select",{staticClass:"mb-3",attrs:{id:"data-sources",options:e.dataSourceTypes,"data-cy":"inspector-data-sources"},model:{value:e.dataSource,callback:function(a){e.dataSource=a},expression:"dataSource"}}),!e.showJsonEditor&&e.dataSource===e.dataSourceValues.provideData?r("div",[r("div",{staticClass:"row"},[r("div",{staticClass:"col-10"},[r("label",{attrs:{for:"data-sources"}},[r("b",[e._v(e._s(e.$t("Options")))])])]),r("div",{staticClass:"col-2"},[r("a",{staticClass:"fas fa-plus-square",attrs:{"data-cy":"inspector-add-option"},on:{click:e.showAddOption}})])]),e.showOptionCard?r("div",{staticClass:"card mb-2"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Add Option"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Option"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass,"data-cy":"inspector-option-value"},model:{value:e.optionValue,callback:function(a){e.optionValue=a},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e(),r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Content")))]),r("b-form-input",{attrs:{id:"option-content","data-cy":"inspector-option-content"},model:{value:e.optionContent,callback:function(a){e.optionContent=a},expression:"optionContent"}})],1),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-2",attrs:{type:"button","data-cy":"inspector-option-cancel"},on:{click:function(a){e.showOptionCard=!1}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button","data-cy":"inspector-option-save"},on:{click:function(a){return e.addOption()}}},[e._v(" "+e._s(e.$t("Save"))+" ")])])]):e._e(),r("div",{staticClass:"row"},[r("div",{staticClass:"col"},[r("draggable",{attrs:{element:"div",group:"options"},on:{update:e.updateSort,start:function(a){e.drag=!0},end:function(a){e.drag=!1}},model:{value:e.optionsList,callback:function(a){e.optionsList=a},expression:"optionsList"}},e._l(e.optionsList,function(a,i){return r("div",{key:a.value},[e.removeIndex===i?r("div",[r("div",{staticClass:"card mb-3 bg-danger text-white text-left mt-2"},[r("div",{staticClass:"card-body p-2",domProps:{innerHTML:e._s(e.currentItemToDelete)}}),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-light mr-2",attrs:{type:"button","data-cy":"inspector-options-remove-cancel"},on:{click:function(n){e.removeIndex=null}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-danger",attrs:{type:"button","data-cy":"inspector-options-remove-confirm"},on:{click:function(n){return e.deleteOption()}}},[e._v(" "+e._s(e.$t("Delete"))+" ")])])])]):e._e(),e.editIndex===i?r("div",[r("div",{staticClass:"card my-2"},[e.optionCardType=="insert"?r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Add Option"))+" ")]):r("div",{staticClass:"card-header"},[e._v(" "+e._s(e.$t("Edit Option"))+" ")]),r("div",{staticClass:"card-body p-2"},[r("label",{attrs:{for:"option-value"}},[e._v(e._s(e.$t("Value")))]),r("b-form-input",{attrs:{id:"option-value",classs:e.optionKeyClass,"data-cy":"inspector-option-value"},model:{value:e.optionValue,callback:function(n){e.optionValue=n},expression:"optionValue"}}),e.optionError?r("div",{staticClass:"invalid-feedback d-block text-right"},[r("div",[e._v(e._s(e.optionError))])]):e._e(),r("label",{staticClass:"mt-3",attrs:{for:"option-content"}},[e._v(e._s(e.$t("Content")))]),r("b-form-input",{attrs:{id:"option-content","data-cy":"inspector-option-content"},model:{value:e.optionContent,callback:function(n){e.optionContent=n},expression:"optionContent"}})],1),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-outline-secondary mr-2",attrs:{type:"button"},on:{click:function(n){e.editIndex=null}}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-secondary",attrs:{type:"button","data-cy":"inspector-option-save"},on:{click:function(n){return e.addOption()}}},[e._v(" "+e._s(e.$t("Update"))+" ")])])])]):e._e(),r("div",{staticClass:"row border-top",class:e.rowCss(i)},[r("div",{staticClass:"col-1",staticStyle:{cursor:"grab"}},[r("span",{staticClass:"fas fa-arrows-alt-v"})]),r("div",{staticClass:"col-1 d-flex align-items-center"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.defaultOptionKey,expression:"defaultOptionKey"}],staticClass:"form-check",attrs:{type:"radio",name:"defaultOptionGroup"},domProps:{value:a[e.keyField],checked:e._q(e.defaultOptionKey,a[e.keyField])},on:{click:e.defaultOptionClick,change:function(n){e.defaultOptionKey=a[e.keyField]}}})]),r("div",{staticClass:"col-5",staticStyle:{cursor:"grab"}},[e._v(" "+e._s(a[e.valueField])+" ")]),r("div",{staticClass:"col-1"},[r("a",{staticClass:"fas fa-cog",staticStyle:{cursor:"pointer"},attrs:{"data-cy":"inspector-options-edit"},on:{click:function(n){return e.showEditOption(i)}}})]),r("div",{staticClass:"col-1"},[r("a",{staticClass:"fas fa-trash-alt",staticStyle:{cursor:"pointer"},attrs:{"data-cy":"inspector-options-remove"},on:{click:function(n){return e.removeOption(i)}}})])])])}),0)],1)]),r("div",{staticClass:"row"},[r("div",{staticClass:"col text-right"},[r("button",{staticClass:"edit-json text-muted mt-1 mb-3",attrs:{type:"button","data-cy":"inspector-edit-json"},on:{click:function(a){e.showJsonEditor=!0}}},[r("i",{staticClass:"fas fa-code",attrs:{"aria-hidden":"true"}}),e._v(" "+e._s(e.$t("Edit as JSON"))+" ")])])])]):e._e(),e.dataSource===e.dataSourceValues.dataObject||e.dataSource===e.dataSourceValues.dataConnector?r("div",[r("label",{attrs:{for:"element-name"}},[e._v(e._s(e.$t("Options Variable")))]),r("mustache-helper"),r("b-form-input",{attrs:{id:"element-name",placeholder:"Request Variable Name","data-cy":"inspector-options-variable"},model:{value:e.dataName,callback:function(a){e.dataName=a},expression:"dataName"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Get options from this variable. Must be an array.")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataObject?r("div",[r("label",{attrs:{for:"value"}},[e._v(e._s(e.$t("Option Label Shown")))]),r("b-form-input",{attrs:{id:"value",placeholder:"Request Variable Property","data-cy":"inspector-options-label"},on:{change:e.valueChanged},model:{value:e.value,callback:function(a){e.value=a},expression:"value"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Enter the property name from the Request data variable that displays to the user on the screen.")))])],1):e._e(),e.dataSource===e.dataSourceValues.collection?r("div",[r("collection-select-list",{model:{value:e.collectionOptions,callback:function(a){e.collectionOptions=a},expression:"collectionOptions"}})],1):e._e(),e.showRenderAs?r("div",[r("div",{staticClass:"row mb-3"},[r("div",{staticClass:"col"},[r("label",{attrs:{for:"render-as"}},[e._v(e._s(e.$t("Show Control As")))]),r("b-form-select",{attrs:{id:"render-as",options:e.renderAsOptions,"data-cy":"inspector-render-as"},model:{value:e.renderAs,callback:function(a){e.renderAs=a},expression:"renderAs"}})],1)]),r("div",{staticClass:"row mb-3"},[r("div",{staticClass:"col-12"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.allowMultiSelect,expression:"allowMultiSelect"}],attrs:{type:"checkbox","data-cy":"inspector-allow-multi-select"},domProps:{checked:Array.isArray(e.allowMultiSelect)?e._i(e.allowMultiSelect,null)>-1:e.allowMultiSelect},on:{change:function(a){var i=e.allowMultiSelect,n=a.target,s=!!n.checked;if(Array.isArray(i)){var o=null,u=e._i(i,o);n.checked?u<0&&(e.allowMultiSelect=i.concat([o])):u>-1&&(e.allowMultiSelect=i.slice(0,u).concat(i.slice(u+1)))}else e.allowMultiSelect=s}}}),e._v(" "+e._s(e.$t("Allow Multiple Selections"))+" ")])])]):e._e(),e.showJsonEditor&&e.dataSource===e.dataSourceValues.provideData?r("div",[r("div",{staticClass:"mb-2"},[r("label",{attrs:{for:"json-data"}},[e._v(e._s(e.$t("JSON Data")))]),r("button",{staticClass:"btn-sm float-right",attrs:{type:"button","data-cy":"inspector-monaco-json-expand"},on:{click:e.expandEditor}},[r("i",{staticClass:"fas fa-expand"})])]),r("div",{staticClass:"small-editor-container"},[r("monaco-editor",{staticClass:"editor",attrs:{options:e.monacoOptions,language:"json","data-cy":"inspector-monaco-json"},on:{change:e.jsonDataChange,editorDidMount:e.monacoMounted},model:{value:e.jsonData,callback:function(a){e.jsonData=a},expression:"jsonData"}})],1),r("b-modal",{attrs:{size:"lg",centered:"",title:e.$t("Script Config Editor")},model:{value:e.showPopup,callback:function(a){e.showPopup=a},expression:"showPopup"}},[r("div",{staticClass:"editor-container"},[r("monaco-editor",{staticClass:"editor",attrs:{options:e.monacoLargeOptions,language:"json","data-cy":"inspector-monaco-json-expanded"},on:{change:e.jsonDataChange},model:{value:e.jsonData,callback:function(a){e.jsonData=a},expression:"jsonData"}})],1),r("div",{attrs:{slot:"modal-footer"},slot:"modal-footer"},[r("b-button",{staticClass:"btn btn-secondary text-uppercase",attrs:{"data-cy":"inspector-monaco-json-expanded-close"},on:{click:e.closePopup}},[e._v(" "+e._s(e.$t("Close"))+" ")])],1)]),r("button",{staticClass:"edit-json text-muted mt-1 mb-3",attrs:{type:"button"},on:{click:function(a){e.showJsonEditor=!1}}},[r("i",{staticClass:"fas fa-code",attrs:{"aria-hidden":"true"}}),e._v(" "+e._s(e.$t("Edit as Option List"))+" ")])],1):e._e(),e.showTypeOfValueReturned?r("div",[r("label",{attrs:{for:"value-type-returned"}},[e._v(e._s(e.$t("Type of Value Returned")))]),r("b-form-select",{attrs:{id:"value-type-returded",options:e.returnValueOptions,"data-cy":"inspector-value-returned"},model:{value:e.valueTypeReturned,callback:function(a){e.valueTypeReturned=a},expression:"valueTypeReturned"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Select 'Single Value' to use parts of the selected object. Select 'Object' to use the entire selected value.")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataConnector?r("div",[e.valueTypeReturned==="single"?r("div",[r("label",{attrs:{for:"key"}},[e._v(e._s(e.$t("Value")))]),r("mustache-helper"),r("b-form-input",{attrs:{id:"key","data-cy":"inspector-datasource-value"},on:{change:e.keyChanged},model:{value:e.key,callback:function(a){e.key=a},expression:"key"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Key name in the selected object to use as the value of this control. Leave blank to use the entire selected value.")))])],1):e._e(),r("label",{attrs:{for:"value"}},[e._v(e._s(e.$t("Content")))]),r("mustache-helper"),r("b-form-input",{attrs:{id:"value","data-cy":"inspector-datasource-content"},on:{change:e.valueChanged},model:{value:e.value,callback:function(a){e.value=a},expression:"value"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Content to display to the user in the select list.")))])],1):e._e(),e.valueTypeReturned==="single"&&e.dataSource===e.dataSourceValues.dataObject?r("div",[r("label",{attrs:{for:"key"}},[e._v(e._s(e.$t("Variable Data Property")))]),r("b-form-input",{attrs:{id:"key",placeholder:"Request Variable Property","data-cy":"inspector-options-value"},on:{change:e.keyChanged},model:{value:e.key,callback:function(a){e.key=a},expression:"key"}}),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Enter the property name from the Request data variable that will be passed as the value when selected.")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataConnector?r("div",[r("label",{attrs:{for:"data-sources-list"}},[e._v(e._s(e.$t("Data Connector")))]),r("b-form-select",{class:e.selectedDataSource?"":"is-invalid",attrs:{id:"data-sources-list",options:e.dataSourcesList,"data-cy":"inspector-data-connector"},model:{value:e.selectedDataSource,callback:function(a){e.selectedDataSource=a},expression:"selectedDataSource"}}),e.selectedDataSource?e._e():r("div",{staticClass:"invalid-feedback"},[e._v(e._s(e.$t("An Data Connector must be selected")))]),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Data Connector to use")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataConnector?r("div",[r("label",{attrs:{for:"endpoint-list"}},[e._v(e._s(e.$t("End Point")))]),r("b-form-select",{class:e.selectedDataSource&&!e.selectedEndPoint?"is-invalid":"",attrs:{id:"endpoint-list",options:e.endPointList,"data-cy":"inspector-endpoint"},model:{value:e.selectedEndPoint,callback:function(a){e.selectedEndPoint=a},expression:"selectedEndPoint"}}),e.selectedDataSource&&!e.selectedEndPoint?r("div",{staticClass:"invalid-feedback"},[e._v(e._s(e.$t("An Endpoint must be selected")))]):e._e(),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(e._s(e.$t("Endpoint to populate select")))])],1):e._e(),e.dataSource===e.dataSourceValues.dataConnector?r("div",[r("pmql-input",{staticClass:"mb-1",attrs:{"search-type":"collections","input-label":"PMQL",condensed:!0,"ai-enabled":!0,placeholder:e.$t("PMQL")},model:{value:e.pmqlQuery,callback:function(a){e.pmqlQuery=a},expression:"pmqlQuery"}}),r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.$t("Advanced data search")))])],1):e._e()],1)},mQ=[],gQ=oe(fQ,hQ,mQ,!1,null,"e0acf8b1",null,null);const Mx=gQ.exports,Wte="",vQ={components:{MustacheHelper:Hi},mixins:[],props:{value:String},data(){return{field:"",outboundConfig:[],types:["PARAM","HEADER","BODY"],apiProperties:[],type:null}},watch:{outboundConfig:{deep:!0,immediate:!0,handler(t){this.setConfig("outboundConfig",t)}},value:{immediate:!0,handler(){const{outboundConfig:t}=this.getConfig();t&&(this.outboundConfig.splice(0),t.forEach(e=>{this.outboundConfig.push(e)}))}}},methods:{getConfig(){try{return JSON.parse(this.value)}catch{return{}}},setConfig(t,e){const r=this.getConfig();JSON.stringify(r[t])!==JSON.stringify(e)&&(r[t]=e,this.$emit("input",JSON.stringify(r)))},removeRowIndex(t){this.outboundConfig.splice(t,1)},addMapping(){this.outboundConfig.push({type:"PARAM",key:"",value:""})},loadOptions(t){const e=this.getConfig();if(this.apiProperties=[],H.isNil(e.dataSource)||H.isNil(e.endpoint))return;let{endpoint:r}=e;const a=e.endpoint.split(":");a.length>1&&(a.shift(),r=a.join("").trim()),window.ProcessMaker.apiClient.get(`/data_sources/${e.dataSource}`).then(i=>{const n=this.outboundConfig[t].type,s=H.get(i,`data.endpoints.${r}`,null);if(s!==null){if(this.apiProperties=[],n==="HEADER"){const o=H.get(s,"headers",[]);this.apiProperties=o.reduce((u,l)=>(H.findIndex(this.apiProperties,{key:l.key})<0&&u.push(l.key),u),[])}if(n==="PARAM"){const o=H.get(s,"params",[]);this.apiProperties=o.reduce((l,c)=>(H.findIndex(this.apiProperties,{key:c.key})<0&&l.push(c.key),l),[]);const u=(s.url||"").matchAll(/\{\{(.+?)}}/gm);for(const l of u){const c=l[1];this.apiProperties.every(d=>d!==c)&&this.apiProperties.push(c)}}if(n==="BODY"){const o=(s.body||"").matchAll(/\{\{(.+?)}}/gm);for(const u of o){const l=u[1];this.apiProperties.every(c=>c!==l)&&this.apiProperties.push(l)}}}})}}};var bQ=function(){var e=this,r=e._self._c;return r("div",[r("div",{staticClass:"d-flex mb-1"},[r("label",{staticClass:"flex-grow-1 m-0"},[e._v(e._s(e.$t("Outbound Configuration")))]),r("button",{staticClass:"btn-special-assignment-action btn btn-secondary btn-sm px-2",attrs:{type:"button"},on:{click:e.addMapping}},[e._v(" + "+e._s(e.$t("Property"))+" ")])]),r("table",{staticClass:"table table-striped table-sm border mb-1"},[r("thead",[r("tr",[r("th",{attrs:{scope:"col"}},[e._v(e._s(e.$t("Type")))]),r("th",{attrs:{scope:"col"}},[e._v(e._s(e.$t("Key")))]),r("th",{attrs:{scope:"col"}},[r("div",{staticClass:"float-left"},[e._v(e._s(e.$t("Value")))]),r("mustache-helper",{staticClass:"float-left ml-2"})],1),r("th",{attrs:{scope:"col"}},[e._v(" ")])])]),r("tbody",e._l(e.outboundConfig,function(a,i){return r("tr",{key:i},[r("td",{staticClass:"p-1"},[r("multiselect",{attrs:{placeholder:e.$t("Select a parameter type"),options:e.types,multiple:!1,"show-labels":!1,searchable:!0,"internal-search":!1},model:{value:a.type,callback:function(n){e.$set(a,"type",n)},expression:"row.type"}})],1),r("td",{staticClass:"p-1"},[r("multiselect",{attrs:{placeholder:e.$t("Select a connector property"),options:e.apiProperties,multiple:!1,"show-labels":!1,searchable:!0,"internal-search":!1},on:{"search-change":function(n){return e.loadOptions(i)},open:function(n){return e.loadOptions(i)}},model:{value:a.key,callback:function(n){e.$set(a,"key",n)},expression:"row.key"}},[r("template",{slot:"noResult"},[e._t("noResult",function(){return[e._v(e._s(e.$t("Not found")))]})],2),r("template",{slot:"noOptions"},[e._t("noOptions",function(){return[e._v(e._s(e.$t("Not available")))]})],2)],2)],1),r("td",{staticClass:"p-1"},[r("input",{directives:[{name:"model",rawName:"v-model",value:a.value,expression:"row.value"}],staticClass:"form-control",attrs:{name:"value",placeholder:e.$t("New Value"),type:"text"},domProps:{value:a.value},on:{input:function(n){n.target.composing||e.$set(a,"value",n.target.value)}}})]),r("td",{staticClass:"align-middle text-right p-1"},[r("a",{staticClass:"btn btn-sm btn-danger",attrs:{href:"javascript:void(0)"},on:{click:function(n){return e.removeRowIndex(i)}}},[r("i",{staticClass:"fa fa-trash-alt"})])])])}),0)]),r("small",{staticClass:"form-text text-muted mb-3"},[e._v(" "+e._s(e.$t("Properties to map from a request variable to a Data Connector property"))+" "),r("br"),e._v(" "+e._s(e.$t("The value can be a string or a mustache expression."))+" "+e._s(e.$t("For example"))+" "),r("span",{pre:!0},[e._v(" {{ var1 }} ")]),e._v(" "+e._s(e.$t("will use the value stored in variable var1"))+" ")])])},yQ=[],SQ=oe(vQ,bQ,yQ,!1,null,"8e9c415d",null,null);const af=SQ.exports,xQ={inheritAttrs:!1,props:["label","helper","formConfig","currentPage"],methods:{getLabelFromValue(t){const e=this.options.find(r=>r.value==t);return e?e.content:null}},computed:{options(){return Object.keys(this.formConfig).filter(t=>t!=this.currentPage).map(t=>({value:t,content:this.formConfig[t].name}))}}};var kQ=function(){var e=this,r=e._self._c;return r("div",[r("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),r("multiselect",e._g(e._b({attrs:{placeholder:e.$t("Select..."),"show-labels":!1,options:e.options.map(a=>a.value),"custom-label":e.getLabelFromValue}},"multiselect",e.$attrs,!1),e.$listeners),[r("template",{slot:"noResult"},[e._v(" "+e._s(e.$t("No elements found. Consider changing the search query."))+" ")]),r("template",{slot:"noOptions"},[e._v(" "+e._s(e.$t("No Data Available"))+" ")])],2),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]):e._e()],1)},_Q=[],wQ=oe(xQ,kQ,_Q,!1,null,null,null,null);const $x=wQ.exports,As={form:"form",display:"display"},CQ=[{inspector:[{type:"FormInput",field:"conditionalHide",config:{label:"Visibility Rule",helper:"This control is hidden until this expression is true"}},{type:"DeviceVisibility",field:"deviceVisibility",config:{label:"Device Visibility",helper:"This control is hidden until this expression is true"}},{type:"FormInput",field:"customFormatter",config:{label:"Custom Format String",helper:"Use the Mask Pattern format <br> Date ##/##/#### <br> SSN ###-##-#### <br> Phone (###) ###-####",validation:""}},{type:"FormInput",field:"customCssSelector",config:{label:"CSS Selector Name",helper:"Use this in your custom css rules",validation:"regex: [-?[_a-zA-Z]+[_-a-zA-Z0-9]*]"}},{type:"FormInput",field:"ariaLabel",config:{label:"Aria Label",helper:"Attribute designed to help assistive technology (e.g. screen readers) attach a label"}},{type:"FormInput",field:"tabindex",config:{label:"Tab Order",helper:"Order in which a user will move focus from one control to another by pressing the Tab key",validation:"regex: [0-9]*"}}]}],TQ=typeof window>"u"?global:window,AQ={mixins:[nb],props:{api:{type:String,default:"screens"},builder:{type:Object,required:!0},screenType:{type:String,default:As.form},validateNested:{type:Boolean,default:!1}},mounted(){this.$root.$on("remove-nested",e=>{this.value===e&&this.$emit("input",null)});let t='(type = "FORM" or type = "DISPLAY")';this.screenType===As.display&&(t='(type = "DISPLAY")'),this.builder.screen&&(t+=` and id != ${this.builder.screen.id}`),this.pmql=t,this.fields="screens.id,title"},methods:{isNavButton(t){return t.config&&t.component==="FormButton"&&t.config.event==="pageNavigate"},containsNavbutton(t){t.forEach(e=>{Array.isArray(e)&&this.containsNavbutton(e),e.items&&this.containsNavbutton(e.items),this.isNavButton(e)&&(this.nav=!0)})},change(t){if(t&&this.validateNested&&(this.nav=!1,this.containsNavbutton(t.config),this.nav))return TQ.ProcessMaker.alert(this.$t("The nested form contains navigation buttons"),"warning"),!1;const e=this.storeId?H.get(t,this.trackBy):t;this.$dataProvider.flushScreenCache(),this.$emit("input",e)}}};var OQ=function(){var e=this,r=e._self._c;return r("div",[r("label",{staticClass:"typo__label"},[e._v(e._s(e.label))]),r("multiselect",{attrs:{value:e.selectedOption,placeholder:e.placeholder,options:e.options,multiple:e.multiple,"track-by":e.trackBy,"show-labels":!1,searchable:!0,"internal-search":!1,label:"title"},on:{input:e.change,"search-change":e.loadOptions,open:function(a){return e.loadOptions()}}},[r("template",{slot:"noResult"},[e._t("noResult",function(){return[e._v(e._s(e.$t("Not found")))]})],2),r("template",{slot:"noOptions"},[e._t("noOptions",function(){return[e._v(e._s(e.$t("No Data Available")))]})],2)],2),e.value?r("div",{staticClass:"screen-link mt-2"},[r("a",{attrs:{href:`/designer/screen-builder/${e.value}/edit`,target:"_blank"}},[e._v(" "+e._s(e.$t("Open Screen"))+" "),r("i",{staticClass:"ml-1 fas fa-external-link-alt"})])]):e._e()],1)},EQ=[],MQ=oe(AQ,OQ,EQ,!1,null,null,null,null);const Px=MQ.exports,Dx={defaultMask:{label:"Data Format",options:[],config:{}},currency:{label:"Currency Format",options:du,optionsLabel:"code",config:du}},$Q={extends:tf,computed:{isVisible(){return this.selectedControl.config.dataFormat==="currency"},maskConfig(){return Dx[this.selectedControl.config.dataFormat]||Dx.defaultMask},maskLabel(){return this.$t(this.maskConfig.label||"Data Format")},maskOptions(){return this.maskConfig.options},maskOptionsLabel(){return this.maskConfig.optionsLabel}}};var PQ=function(){var e=this,r=e._self._c;return r("div",{directives:[{name:"show",rawName:"v-show",value:e.isVisible,expression:"isVisible"}]},[r("label",{staticClass:"typo__label"},[e._v(e._s(e.maskLabel))]),r("multiselect",e._g(e._b({class:e.classList,attrs:{value:e.value,placeholder:e.$t("Select..."),"show-labels":!1,options:e.maskOptions,label:e.maskOptionsLabel}},"multiselect",e.$attrs,!1),e.$listeners),[r("template",{slot:"noResult"},[e._v(e._s(e.$t("No elements found. Consider changing the search query.")))]),r("template",{slot:"noOptions"},[e._v(e._s(e.$t("No Data Available")))])],2),e.validator&&e.validator.errorCount||e.error?r("div",{staticClass:"invalid-feedback d-block"},[e._l(e.validator.errors.get(this.name),function(a,i){return r("div",{key:i},[e._v(e._s(a))])}),e.error?r("div",[e._v(e._s(e.error))]):e._e()],2):e._e(),e.helper?r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]):e._e()],1)},DQ=[],IQ=oe($Q,PQ,DQ,!1,null,null,null,null);const nf=IQ.exports,Vte="",zQ={components:{FormInput:ee.FormInput,InputVariable:rf,FormCheckbox:ee.FormCheckbox},props:["label","value","helper","name","builder","selectedControl","formConfig"],data(){return{rules:[],showCard:!1,showDeleteConfirmCard:!1,selectedOption:"",confirmMessage:"",removeIndex:null,optionError:"",disableBtn:!1,cloneRules:[],options:[{value:"accepted",content:this.$t("Accepted"),helper:this.$t("The field under validation must be yes, on, 1 or true.")},{value:"alpha",content:this.$t("Alpha"),helper:this.$t("The field under validation must be entirely alphabetic characters.")},{value:"alpha_num",content:this.$t("Alpha-Numeric"),helper:this.$t("The field under validation must be entirely alpha-numeric characters.")},{value:"",field:"between:",content:this.$t("Between Min & Max"),helper:this.$t("The field under validation must have a size between the given min and max."),visible:!0,configs:[{type:"FormInput",label:this.$t("Min"),helper:"",validation:"required|integer"},{type:"FormInput",label:this.$t("Max"),helper:"",validation:"required|integer"}]},{value:"email",content:this.$t("Email"),helper:this.$t("The field under validation must be formatted as an e-mail address.")},{value:"",field:"in:",content:this.$t("In"),helper:this.$t("The field under validation must be included in the given list of values. The field can be an array or string."),visible:!0,configs:[{type:"FormInput",label:this.$t("Values"),helper:"",validation:"required"}]},{value:"",field:"max:",content:this.$t("Max Length"),helper:"",visible:!0,configs:[{type:"FormInput",label:this.$t("Max Input"),helper:this.$t("Validate that an attribute is no greater than a given length."),validation:"required|integer"}]},{value:"",field:"min:",content:this.$t("Min Length"),helper:"",visible:!0,configs:[{type:"FormInput",label:this.$t("Min Input"),helper:this.$t("Validate that an attribute is at least a given length."),validation:"required|integer"}]},{value:"",field:"not_in:",content:this.$t("Not In"),helper:this.$t("The field under validation must not be included in the given list of values."),visible:!0,configs:[{type:"FormInput",label:this.$t("Values"),helper:"",validation:"required"}]},{value:"required",content:this.$t("Required"),helper:this.$t("Checks if the length of the String representation of the value is >")},{value:"",field:"required_if:",content:this.$t("Required If"),helper:this.$t("The field under validation must be present and not empty if the Variable Name field is equal to any value."),visible:!0,configs:[{type:"InputVariable",name:"variable-name",label:this.$t("Variable Name"),helper:"",validation:"required"},{type:"FormInput",name:"variable-value",label:this.$t("Variable Value"),helper:"",validation:""}]},{value:"",field:"required_unless:",content:this.$t("Required Unless"),helper:this.$t("The field under validation must be present and not empty unless the Variable Name field is equal to any value."),visible:!0,configs:[{type:"InputVariable",name:"variable-name",label:this.$t("Variable Name"),helper:"",validation:"required"},{type:"FormInput",name:"variable-value",label:this.$t("Variable Value"),helper:""}]},{value:"",field:"same:",content:this.$t("Same"),helper:this.$t("The given field must match the field under validation."),visible:!0,configs:[{type:"InputVariable",name:"variable-name",label:this.$t("Variable Name"),helper:"",validation:"required"}]},{value:"url",content:"URL",helper:this.$t("Validate that an attribute has a valid URL format.")},{value:"custom_date",content:"Date",helper:this.$t("The field under validation must be a valid date format which is acceptable by Javascript's Date object.")},{value:"",field:"after:",content:this.$t("After Date"),helper:this.$t("The field under validation must be after the given date."),visible:!0,configs:[{type:"FormInput",label:this.$t("Date"),helper:"",validation:"required"}]},{value:"",field:"after_or_equal:",content:this.$t("After or Equal to Date"),helper:this.$t("The field unter validation must be after or equal to the given field."),visible:!0,configs:[{type:"FormInput",label:this.$t("Date"),helper:"",validation:"required"}]},{value:"",field:"before:",content:this.$t("Before Date"),helper:this.$t("The field unter validation must be before the given date."),visible:!0,configs:[{type:"FormInput",label:this.$t("Date"),helper:"",validation:"required"}]},{value:"",field:"before_or_equal:",content:this.$t("Before or Equal to Date"),helper:this.$t("The field unter validation must be before or equal to the given field."),visible:!0,configs:[{type:"FormInput",label:this.$t("Date"),helper:"",validation:"required"}]},{value:"",field:"regex:",content:this.$t("Regex"),helper:this.$t("The field under validation must match the given regular expression."),visible:!0,configs:[{type:"FormInput",label:this.$t("Regex Pattern"),helper:"",validation:"required"}]}].sort((t,e)=>t.content>e.content?1:-1)}},computed:{fieldClass(){return this.optionError?"is-invalid":""},hasRules(){return!!(this.rules&&this.rules.length)},requiredCheckbox:{get(){return this.rules.some(t=>t.value==="required")},set(t){t?this.rules.push(this.options.find(e=>e.value==="required")):this.rules=this.rules.filter(e=>e.value!=="required")}}},watch:{rules:{deep:!0,handler(t){this.showCard=!1,this.selectedOption="",(typeof t=="string"||t===void 0)&&(this.rules=[]),this.rules&&this.setRuleConfigs(),this.$emit("input",t)}},value(){this.rules=this.value||[],this.cloneSetRules()},selectedOption:{deep:!0,handler(t){var e;this.disableBtn=!0,this.optionError="",t&&((e=this.rules)!=null&&e.find(r=>r.content===t.content)?(this.optionError=this.$t("This field already exists"),this.disableBtn=!0):this.disableBtn=!1)}}},mounted(){this.rules=this.value||[],this.cloneSetRules()},methods:{showAddCard(){this.showCard=!0,this.selectedOption||(this.disableBtn=!0)},hideCard(){this.showCard=!1,this.selectedOption="",this.optionError=""},saveRule(){const t=H.cloneDeep(this.selectedOption);this.rules.push(t),this.hideCard(),this.selectedOption=""},confirmDelete(t){this.removeIndex=t,this.showDeleteConfirmCard=!0,this.confirmMessage=H.unescape(this.$t('Are you sure you want to delete the "{{item}}" rule?',{item:this.rules[t].content}))},hideDeleteConfirmCard(){this.removeIndex=null,this.showDeleteConfirmCard=!1},deleteRule(t){this.rules.splice(t,1),this.cloneRules.splice(t,1),this.hideDeleteConfirmCard()},setRuleConfigs(){this.rules.forEach(t=>{if(t.configs){let e=[];t.configs.forEach(r=>{r.value&&e.push(r.value)}),e.length>1&&(e=e.join(",")),e.length&&(t.value=t.field+e)}})},onUpdate(t,e){const r=this.formatRuleContentAsId(t.content);this.$root.$emit("bv::toggle::collapse",r),this.$set(this.rules[e],"visible",!1),this.cloneRules=JSON.parse(JSON.stringify(this.rules))},onCancel(t,e){const r=this.formatRuleContentAsId(t.content);this.cloneRules&&this.cloneRules[e]?H.isEqual(t,this.cloneRules[e])||Object.assign(this.rules[e],JSON.parse(JSON.stringify(this.cloneRules[e]))):(t.configs.forEach(a=>{a.value&&(a.value="")}),this.rules[e].configs=t.configs),this.$root.$emit("bv::toggle::collapse",r)},formatRuleContentAsId(t){return t.toLowerCase().split(" ").join("-")},cloneSetRules(){this.cloneRules=JSON.parse(JSON.stringify(this.rules))}}};var LQ=function(){var e=this,r=e._self._c;return r("div",{staticClass:"form-group"},[r("div",{staticClass:"d-flex justify-content-between align-items-center mb-3"},[r("label",{staticClass:"m-0"},[e._v(e._s(e.label))]),r("b-button",{attrs:{variant:"secondary",size:"sm","data-cy":"add-rule"},on:{click:e.showAddCard}},[e._v(e._s(e.$t("Add Rule")))])],1),e.showCard?r("div",{staticClass:"card mb-2"},[r("div",{staticClass:"card-body p-2"},[r("multiselect",{class:e.fieldClass,attrs:{label:"content","track-by":"content",placeholder:e.$t("Select..."),"show-labels":!1,options:e.options,"data-cy":"select-rule"},model:{value:e.selectedOption,callback:function(a){e.selectedOption=a},expression:"selectedOption"}},[r("template",{slot:"noResult"},[e._v(e._s(e.$t("No elements found. Consider changing the search query.")))]),r("template",{slot:"noOptions"},[e._v(e._s(e.$t("No Data Available")))])],2),e.optionError?r("div",{staticClass:"invalid-feedback d-block"},[r("div",[e._v(e._s(e.optionError))])]):e._e()],1),r("div",{staticClass:"card-footer text-right p-2"},[r("b-button",{staticClass:"mr-2",attrs:{variant:"outline-secondary",size:"sm","data-cy":"cancel-rule"},on:{click:e.hideCard}},[e._v(e._s(e.$t("Cancel")))]),r("b-button",{attrs:{disabled:e.disableBtn,variant:"secondary",size:"sm","data-cy":"save-rule"},on:{click:e.saveRule}},[e._v(e._s(e.$t("Save")))])],1)]):e._e(),!e.hasRules&&!e.showCard?r("p",[e._v(e._s(e.$t("No validation rule(s)")))]):e._e(),e.hasRules?r("div",[r("div",{attrs:{role:"tablist"}},e._l(e.rules,function(a,i){return r("b-card",{key:i,staticClass:"mb-2 border-1",class:{"border-0":e.showDeleteConfirmCard,"border-top-1":e.showDeleteConfirmCard,"border-1":!e.showDeleteConfirmCard}},[e.showDeleteConfirmCard&&e.removeIndex==i?r("div",{staticClass:"card mb-3 bg-danger text-white text-right"},[r("div",{staticClass:"card-body p-2 text-left"},[e._v(" "+e._s(e.confirmMessage)+" ")]),r("div",{staticClass:"card-footer text-right p-2"},[r("button",{staticClass:"btn btn-sm btn-light mr-2",attrs:{type:"button","data-cy":"cancel-confirm-delete-rule"},on:{click:e.hideDeleteConfirmCard}},[e._v(" "+e._s(e.$t("Cancel"))+" ")]),r("button",{staticClass:"btn btn-sm btn-danger",attrs:{type:"button","data-cy":"confirm-delete-rule"},on:{click:function(n){return e.deleteRule(i)}}},[e._v(" "+e._s(e.$t("Delete"))+" ")])])]):e._e(),r("b-card-header",{staticClass:"p-0",attrs:{"header-tag":"header",role:"tab"}},[r("div",{staticClass:"p-1 d-flex justify-content-between align-items-center"},[e._v(" "+e._s(a.content)+" "),r("div",{staticClass:"actions"},[a.configs?r("b-button",{directives:[{name:"b-toggle",rawName:"v-b-toggle",value:e.formatRuleContentAsId(a.content),expression:"formatRuleContentAsId(rule.content)"}],staticClass:"p-0 mr-1 secondary",attrs:{"aria-label":e.$t("Toggle Configuration"),variant:"link","data-cy":"edit-rule"}},[r("i",{staticClass:"fas fa-cog fa-fw text-secondary"})]):e._e(),r("b-button",{staticClass:"p-0",attrs:{"aria-label":e.$t("Delete"),variant:"link","data-cy":"remove-rule"},on:{click:function(n){return e.confirmDelete(i)}}},[r("i",{staticClass:"fas fa-trash-alt fa-fw text-secondary"})])],1)])]),r("b-collapse",{attrs:{id:e.formatRuleContentAsId(a.content),accordion:e.formatRuleContentAsId(a.content),visible:a.visible,role:"tabpanel"}},[r("b-card-body",[r("div",{staticClass:"p-2"},[e._l(a.configs,function(n){return r("div",{key:n.label,staticClass:"mb-2"},[n.type==="FormInput"?r("div",[r("form-input",{attrs:{label:n.label,name:n.name||n.label,validation:n.validation,helper:n.helper},model:{value:n.value,callback:function(s){e.$set(n,"value",s)},expression:"config.value"}})],1):r(n.type,{tag:"component",attrs:{label:n.label,name:n.name||n.label,validation:n.validation,helper:n.helper,builder:e.builder,"selected-control":e.selectedControl,"form-config":e.formConfig},model:{value:n.value,callback:function(s){e.$set(n,"value",s)},expression:"config.value"}})],1)}),r("div",[r("small",{staticClass:"form-text text-muted"},[e._v(e._s(a.helper))])])],2),r("b-card-footer",{staticClass:"text-right"},[r("b-button",{staticClass:"mr-2",attrs:{variant:"outline-secondary",size:"sm","data-cy":"cancel-rule"},on:{click:function(n){return e.onCancel(a,i)}}},[e._v(e._s(e.$t("Cancel")))]),r("b-button",{attrs:{variant:"secondary",size:"sm","data-cy":"update-rule"},on:{click:function(n){return e.onUpdate(a,i)}}},[e._v(e._s(e.$t("Update")))])],1)],1)],1)],1)}),1)]):e._e(),r("small",{staticClass:"form-text text-muted"},[e._v(e._s(e.helper))]),r("div",{staticClass:"mt-4 required-checkbox"},[r("form-checkbox",{attrs:{label:e.$t("Make Required")},model:{value:e.requiredCheckbox,callback:function(a){e.requiredCheckbox=a},expression:"requiredCheckbox"}})],1)])},jQ=[],NQ=oe(zQ,LQ,jQ,!1,null,"a2315d60",null,null);const Ix=NQ.exports,RQ={components:{FormCheckbox:ee.FormCheckbox},props:["value","selectedControl"],data(){return{event:"",loading:null}},computed:{mode(){return this.$root.$children[0].mode}},watch:{loading(){this.$emit("input",this.loading)},value(){this.loading=this.value},"selectedControl.config.event":function(t){this.event=t}},mounted(){this.event=this.selectedControl.config.event,this.loading=this.value}};var FQ=function(){var e=this,r=e._self._c;return e.event==="submit"?r("div",{staticStyle:{"border-style":"none !important"}},[r("div",[r("form-checkbox",{attrs:{label:e.$t("Loading Submit Button"),toggle:!1,helper:e.$t("Loading Submit Button")},model:{value:e.loading,callback:function(a){e.loading=a},expression:"loading"}})],1)]):e._e()},qQ=[],BQ=oe(RQ,FQ,qQ,!1,null,null,null,null);const zx=BQ.exports,WQ={components:{FormInput:ee.FormInput},props:["value","selectedControl"],data(){return{event:"",loadingLabel:null}},computed:{mode(){return this.$root.$children[0].mode}},watch:{loadingLabel(){this.$emit("input",this.loadingLabel)},value(){this.loadingLabel=this.value},"selectedControl.config.event":function(t){this.event=t}},mounted(){this.event=this.selectedControl.config.event,this.loadingLabel=this.value}};var VQ=function(){var e=this,r=e._self._c;return e.event==="submit"?r("div",{staticStyle:{"padding-top":"0px !important"}},[r("div",[r("form-input",{staticClass:"mb-3",attrs:{type:"text",label:e.$t("Loading Label")},model:{value:e.loadingLabel,callback:function(a){e.loadingLabel=a},expression:"loadingLabel"}})],1)]):e._e()},UQ=[],GQ=oe(WQ,VQ,UQ,!1,null,null,null,null);const Lx=GQ.exports,HQ={props:["value"],data(){return{selectedOption:null,formattedOptions:[{name:"",link:""}]}},watch:{selectedOption(t){this.$emit("input",t)},value(){this.selectedOption=this.value}},mounted(){this.fetchChartData(),this.selectedOption=this.value},methods:{fetchChartData(){try{ProcessMaker.apiClient.get("analytics-reporting-all").then(t=>{this.formattedOptions=t.data.data.map(e=>({name:e.name,link:e.link}))})}catch(t){console.error("Error fetching data:",t)}}}};var YQ=function(){var e=this,r=e._self._c;return r("div",[r("label",{staticClass:"typo__label"},[e._v(e._s(e.$t("Analytics Management")))]),r("multiselect",{attrs:{placeholder:e.$t("Select Chart"),"internal-search":!1,"show-labels":!1,options:e.formattedOptions,label:"name","track-by":"link",multiple:!1,"allow-empty":!1},model:{value:e.selectedOption,callback:function(a){e.selectedOption=a},expression:"selectedOption"}})],1)},QQ=[],KQ=oe(HQ,YQ,QQ,!1,null,null,null,null);const jx=KQ.exports,Nx=Object.freeze(Object.defineProperty({__proto__:null,AnalyticsSelector:jx,CollectionSelectList:Zp,ColorSelect:_x,ColumnSetup:wx,ContainerColumns:Cx,DataMapping:Xp,DefaultValueEditor:ef,DeviceVisibility:ed,EditOption:Tx,FormMultiselect:tf,ImageUpload:Ax,ImageVariable:Ox,InputVariable:rf,LabelSubmitButton:Lx,LoadingSubmitButton:zx,LoopInspector:Ex,MustacheHelper:Hi,OptionsList:Mx,OutboundConfig:af,PageSelect:$x,ScreenSelector:Px,SelectDataTypeMask:nf,Tooltip:Xc,ValidationSelect:Ix,dataSourceValues:ea,dataSources:Ts},Symbol.toStringTag,{value:"Module"})),Ute="",Rx=[{name:"Variable",fields:[{name:"name",hideFor:"FormImage"},"fieldValue","label","dataFormat","dataMask","validation","readonly","disabled","initiallyChecked","screen","multipleUpload"],open:!0},{name:"Configuration",fields:[{name:"name",showFor:"FormImage"},"image","eventData","tooltip","type","placeholder","content","helper","Multiselect checkbox (doesn’t exist)","richtext","rows",{name:"options",showFor:"FormMultiColumn"},"form","editable"],open:!1},{name(t){return t.component==="AiSection"?"AI Section":t.component==="FormRecordList"?"Columns":"Data Source"},fields:["fields",{name:"options",hideFor:"FormMultiColumn"}],open:!1},{name:"Design",fields:["color","bgcolor","variant","toggle","height","width"],open:!1},{name:"Advanced",fields:["conditionalHide","deviceVisibility","customCssSelector","defaultValue","showForDesktop",{name:"customFormatter",showFor:"FormInput"},{name:"ariaLabel",showFor:"FormInput"},{name:"ariaLabel",showFor:"FormSelectList"},{name:"ariaLabel",showFor:"FormDatePicker"},{name:"ariaLabel",showFor:"FormCheckbox"},{name:"ariaLabel",showFor:"FormDatePicker"},{name:"ariaLabel",showFor:"FileUpload"},{name:"ariaLabel",showFor:"FileDownload"},{name:"ariaLabel",showFor:"FormSelectList"},{name:"ariaLabel",showFor:"FormButton"},{name:"ariaLabel",showFor:"FormTextArea"},{name:"tabindex",showFor:"FormInput"},{name:"tabindex",showFor:"FormSelectList"},{name:"tabindex",showFor:"FormDatePicker"},{name:"tabindex",showFor:"FormCheckbox"},{name:"tabindex",showFor:"FormDatePicker"},{name:"tabindex",showFor:"FileUpload"},{name:"tabindex",showFor:"FileDownload"},{name:"tabindex",showFor:"FormSelectList"},{name:"tabindex",showFor:"FormButton"},{name:"tabindex",showFor:"FormTextArea"}],open:!1}];class Fx{constructor(){se(this,"names",[]);se(this,"generateNameId",(e,r)=>{let a=e+"_"+r;return this.names.indexOf(a)!==-1&&(r++,a=this.generateNameId(e,r)),a})}GetVariableNames(e){e.forEach(r=>{Array.isArray(r)&&this.GetVariableNames(r),r.items&&this.GetVariableNames(r.items),r.config&&r.config.name&&this.names.push(`${r.config.name}`)})}generate(e,r){this.names=[],this.GetVariableNames(e);let a=this.generateNameId(this.snakeCase(r),1);return this.names.push(a),[this.names,a]}snakeCase(e){return e.replace(/\W+/g," ").split(/ |\B(?=[A-Z])/).map(r=>r.toLowerCase()).join("_")}}const Gte="",JQ={name:"PagesDropdown",props:{data:{type:Array,default:null},boundary:{type:String,default:"viewport"}},methods:{onAddPage(){this.$emit("addPage")},onSeeAllPages(){this.$emit("seeAllPages")},onClickPage(t){this.$emit("clickPage",this.data[t])}}};var ZQ=function(){var e=this,r=e._self._c;return r("b-dropdown",{ref:"pageDropdown",attrs:{"data-test":"page-dropdown",variant:"platform",boundary:e.boundary,"menu-class":"page-dropdown-menu"},scopedSlots:e._u([{key:"button-content",fn:function(){return[r("i",{staticClass:"fa fa-file"})]},proxy:!0}])},[r("b-dropdown-item",{attrs:{"data-test":"add-page"},on:{click:e.onAddPage}},[r("i",{staticClass:"fa fa-plus platform-dropdown-item-icon"}),e._v(" "+e._s(e.$t("Create Page"))+" ")]),r("b-dropdown-item",{attrs:{"data-test":"see-all-pages"},on:{click:e.onSeeAllPages}},[r("i",{staticClass:"fa fa-eye platform-dropdown-item-icon"}),e._v(" "+e._s(e.$t("See all pages"))+" ")]),r("b-dropdown-divider"),e._l(e.data,function(a,i){return r("b-dropdown-item",{key:i,attrs:{"data-test":"page-"+a.name,"data-cy":"page-"+i},on:{click:function(n){return e.onClickPage(i)}}},[e._v(" "+e._s(a.name)+" ")])})],2)},XQ=[],eK=oe(JQ,ZQ,XQ,!1,null,"18f6828f",null,null);const tK=eK.exports,rK={name:"required-checkbox",props:["value"],data(){return{required:!1}},watch:{value:{handler(){this.value&&this.value==="required"?this.required=!0:this.required=!1},immediate:!0},required:{handler(){this.$emit("input",this.required?"required":"")}}}};var aK=function(){var e=this,r=e._self._c;return r("div",[r("b-form-checkbox",{model:{value:e.required,callback:function(a){e.required=a},expression:"required"}},[e._v(e._s(e.$t("Required")))])],1)},iK=[],nK=oe(rK,aK,iK,!1,null,null,null,null);const qx=nK.exports,sK={name:"multiple-upload-checkbox",props:["value"],data(){return{selected:!1}},watch:{value:{handler(){this.value?this.selected=!0:this.selected=!1},immediate:!0},selected:{handler(){this.$emit("input",this.selected)}}}};var oK=function(){var e=this,r=e._self._c;return r("div",[r("b-form-checkbox",{model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}},[e._v(e._s(e.$t("Upload multiple files")))])],1)},lK=[],uK=oe(sK,oK,lK,!1,null,null,null,null);const Bx=uK.exports,Wx=200,cK={props:{pages:{type:Array,required:!0},initialOpenedPages:{type:Array,default:()=>[0]},buttonIcon:{type:String,default:()=>"fa fa-file"}},data(){return{tabsListOverflow:!1,showLeftScroll:!0,showRightScroll:!0,updates:0,activeTab:0,localOpenedPages:this.initialOpenedPages}},computed:{validLocalOpenedPages(){return this.localOpenedPages.filter(t=>this.pages[t])}},watch:{openedPages:{handler(t){this.localOpenedPages=t},deep:!0},pages:{handler(){this.localOpenedPages=this.localOpenedPages.filter(t=>this.pages[t])},deep:!0}},mounted(){this.$nextTick(()=>{window.addEventListener("resize",this.checkTabsOverflow),this.$refs.tabs.$el.querySelector(".nav-tabs").addEventListener("scroll",this.checkScrollPosition),Promise.resolve().then(()=>{this.checkTabsOverflow(),this.checkScrollPosition()})})},beforeDestroy(){window.removeEventListener("resize",this.checkTabsOverflow)},updated(){this.checkTabsOverflow()},methods:{tabOpened(){const t=this.localOpenedPages[this.activeTab];this.$emit("tab-opened",t)},pageNumber(t){return t+1},checkScrollPosition(){const t=this.$refs.tabs.$el.querySelector(".nav-tabs");this.showLeftScroll=t.scrollLeft>0,this.showRightScroll=t.scrollWidth-t.clientWidth>t.scrollLeft},scrollTabsLeft(){const t=this.$refs.tabs.$el.querySelector(".nav-tabs");t.scrollLeft-=Wx},scrollTabsRight(){const t=this.$refs.tabs.$el.querySelector(".nav-tabs");t.scrollLeft+=Wx},tabsUpdated(){this.updates++},waitUpdates(t,e,r=80){return new Promise(a=>{const i=Date.now(),n=setInterval(()=>{(this.updates>=t||Date.now()-i>e)&&(clearInterval(n),a())},r)})},closeTab(t){const e=this.localOpenedPages[t];this.localOpenedPages.splice(t,1),this.$emit("tab-closed",this.pages[e],this.localOpenedPages)},updateTabsReferences(t){this.localOpenedPages=this.localOpenedPages.map(e=>e>t?e-1:e)},async openPageByIndex(t){if(t===-1)return;const e=this.localOpenedPages.indexOf(t*1);e===-1?(this.localOpenedPages.push(t),await this.waitUpdates(this.updates+2,1e3),this.activeTab=this.localOpenedPages.length-1):this.activeTab=e},closePageByIndex(t){const e=this.localOpenedPages.indexOf(t);e!==-1&&this.localOpenedPages.splice(e,1)},checkTabsOverflow(){const t=this.$refs.tabs.$el.querySelector(".nav-tabs");this.tabsListOverflow=t.scrollWidth>t.clientWidth}}};var dK=function(){var e=this,r=e._self._c;return r("b-tabs",{ref:"tabs",staticClass:"h-100 w-100 flat-tabs",attrs:{"content-class":"h-tab","nav-class":"nav-tabs-nowrap",lazy:""},on:{changed:e.tabsUpdated,input:e.tabOpened},scopedSlots:e._u([{key:"tabs-start",fn:function(){return[r("div",{staticClass:"tabs-sticky d-flex flex-row tabs-start"},[r("div",{directives:[{name:"show",rawName:"v-show",value:e.tabsListOverflow,expression:"tabsListOverflow"}],staticClass:"position-relative overflow-visible"},[r("div",{staticClass:"nav-scroll nav-scroll-left",attrs:{role:"link","data-test":"scroll-left"},on:{click:e.scrollTabsLeft}},[r("i",{staticClass:"fas fa-chevron-left"})])])]),r("div",{class:{"dd-ml":e.tabsListOverflow}},[e._t("tabs-start")],2)]},proxy:!0},{key:"tabs-end",fn:function(){return[e.tabsListOverflow?r("div",{staticClass:"tabs-sticky overflow-visible"},[r("div",{staticClass:"nav-scroll nav-scroll-right",attrs:{role:"link","data-test":"scroll-right"},on:{click:e.scrollTabsRight}},[r("i",{staticClass:"fas fa-chevron-right"})])]):e._e()]},proxy:!0},{key:"empty",fn:function(){return[r("p",{staticClass:"text-center m-5 text-secondary",attrs:{"data-test":"tab-content"}},[e._v(" "+e._s(e.$t("There are no open pages."))),r("br"),e._v(" "+e._s(e.$t("Open a new page above using the button"))+" "),r("i",{class:e.buttonIcon})])]},proxy:!0}],null,!0),model:{value:e.activeTab,callback:function(a){e.activeTab=a},expression:"activeTab"}},e._l(e.validLocalOpenedPages,function(a,i){return r("b-tab",{key:`tab-${i}`,staticClass:"h-100 w-100",scopedSlots:e._u([{key:"title",fn:function(){var n;return[r("b-badge",{staticClass:"mr-1",attrs:{variant:"primary"}},[e._v(" "+e._s(e.pageNumber(a))+" ")]),r("span",{attrs:{"data-test":`tab-${i}`}},[e._v(" "+e._s((n=e.pages[a])==null?void 0:n.name)+" ")]),r("span",{staticClass:"close-tab",attrs:{"data-test":`close-tab-${i}`,role:"link"},on:{click:function(s){return s.stopPropagation(),e.closeTab(i)}}},[r("i",{staticClass:"fas fa-times"})])]},proxy:!0},{key:"default",fn:function(){return[r("div",{staticClass:"h-100 w-100",attrs:{"data-test":"tab-content"}},[e._t("default",null,{currentPage:a})],2)]},proxy:!0}],null,!0)})}),1)},pK=[],fK=oe(cK,dK,pK,!1,null,null,null,null);const hK=fK.exports,Hte="",mK={name:"SortableList",props:{items:{type:Array,required:!0},filteredItems:{type:Array,required:!0}},data(){return{refreshSort:1,newName:"",draggedItem:0,draggedOverItem:0,editRowIndex:null}},computed:{sortedItems(){return this.refreshSort&&[...this.filteredItems].sort((e,r)=>e.order-r.order)}},methods:{validateState(t,e){const r=!(t!=null&&t.trim()),a=this.items.filter(i=>i!==e).find(i=>i.name===t);return r||a?!1:null},validateError(t,e){return t!=null&&t.trim()?this.$t("The Page Name field is required."):this.items.filter(i=>i!==e).find(i=>i.name===t)?this.$t("Must be unique."):""},onFocus(t){this.newName=t.name},async onBlur(t,e){this.validateState(t,e)===!1?this.newName=e.name:e.name=t,await this.$nextTick(),setTimeout(()=>{this.editRowIndex=null},250)},async onCancel(t){this.newName=t.name,this.editRowIndex=null},onClick(t,e){this.editRowIndex=e,this.$emit("item-edit",t)},dragStart(t,e){this.editRowIndex=null,this.draggedItem=e,t.target.classList.add("dragging")},dragEnter(t,e){this.draggedOverItem=e},dragEnd(t){t.target.classList.remove("dragging");const e=[...this.items].sort((i,n)=>i.order-n.order),r=e.findIndex(i=>i.order===this.draggedItem),a=e.findIndex(i=>i.order===this.draggedOverItem);if(r!==a){const i=e[a].order,n=this.draggedItem>this.draggedOverItem?1:-1;if(r<a){for(let o=r+1;o<=a;o++){const u=e[o].order;e[o].order=u+n}e[r].order=i}else if(r>a){for(let o=a;o<=r-1;o++){const u=e[o].order;e[o].order=u+n}e[r].order=i}const s=[...e];s.sort((o,u)=>o.order-u.order),s.forEach((o,u)=>{o.order=u+1})}this.refreshSort++,this.$emit("ordered",e)},dragOver(t){t.preventDefault()}}};var gK=function(){var e=this,r=e._self._c;return r("div",{staticClass:"row mt-3"},[r("div",{staticClass:"col p-0 border rounded-lg sortable-list"},[e._m(0),r("div",{staticClass:"sortable-container",on:{dragover:e.dragOver}},e._l(e.sortedItems,function(a,i){return r("div",{key:i,staticClass:"sortable-item sortable-draggable",attrs:{"data-order":a.order,"data-test":`item-${a.order}`,title:a.name,draggable:"true"},on:{dragstart:n=>e.dragStart(n,a.order),dragenter:n=>e.dragEnter(n,a.order),dragend:e.dragEnd}},[e._m(1,!0),r("div",{staticClass:"rounded sortable-item-name"},[e.editRowIndex===i?r("b-form-input",{attrs:{type:"text",autofocus:"",required:"",state:e.validateState(e.newName,a),error:e.validateError(e.newName,a)},on:{blur:function(n){return n.stopPropagation(),e.onBlur(e.newName,a)},keydown:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:(n.stopPropagation(),e.onBlur(e.newName,a))},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"esc",27,n.key,["Esc","Escape"])?null:(n.stopPropagation(),e.onCancel(a))}],focus:function(n){return e.onFocus(a)}},model:{value:e.newName,callback:function(n){e.newName=n},expression:"newName"}}):r("span",[e._v(e._s(a.name))])],1),r("div",{staticClass:"border rounded-lg sortable-item-action"},[e.editRowIndex===i?r("button",{staticClass:"btn"},[r("i",{staticClass:"fas fa-check"})]):r("button",{staticClass:"btn",on:{click:function(n){return n.stopPropagation(),e.onClick(a,i)}}},[r("i",{staticClass:"fas fa-edit"})]),r("div",{staticClass:"sortable-item-vr"}),r("button",{staticClass:"btn",on:{click:function(n){return e.$emit("item-delete",a)}}},[r("i",{staticClass:"fas fa-trash-alt"})])])])}),0)])])},vK=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"sortable-list-header"},[e("div",{staticClass:"sortable-item-icon"}),e("div",{staticClass:"sortable-list-title"},[t._v("PAGE NAME")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"sortable-item-icon"},[e("i",{staticClass:"fas fa-bars"})])}],bK=oe(mK,gK,vK,!1,null,"dabf2ccb",null,null);const yK=bK.exports,Yte="",SK={name:"Sortable",components:{SortableList:yK},props:{items:{type:Array,required:!0},filterKey:{type:String,required:!0}},data(){return{search:"",filteredItems:[...this.items].map((t,e)=>(t.order===void 0&&this.$set(t,"order",e+1),t))}},watch:{search(t){this.filteredItems=this.filterItems(t,this.items)},items:{handler(t){this.filteredItems=[...t],this.search.length>0&&(this.filteredItems=this.filterItems(this.search,t))},deep:!0}},methods:{clearSearch(t){return t.trim().toLowerCase()},filterItems(t,e){const r=this.clearSearch(t);return e.filter(a=>a[this.filterKey].toLowerCase().includes(r))}}};var xK=function(){var e=this,r=e._self._c;return r("div",{staticClass:"container sortable-box"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-sm border rounded-lg p-0 mr-3 sortable-search-box"},[r("i",{staticClass:"fa fa-search sortable-search-icon"}),r("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"form-control border-0 shadow-none px-0",attrs:{id:"search",placeholder:e.$t("Search here"),"data-test":"search"},domProps:{value:e.search},on:{input:function(a){a.target.composing||(e.search=a.target.value)}}})]),r("div",[r("button",{staticClass:"btn sortable-btn-new",attrs:{type:"button"},on:{click:function(a){return e.$emit("add-page",a)}}},[r("i",{staticClass:"fa fa-plus"})])])]),r("SortableList",{attrs:{items:e.items,"filtered-items":e.filteredItems},on:{ordered:function(a){return e.$emit("ordered",a)},"item-edit":function(a){return e.$emit("item-edit",a)},"item-delete":function(a){return e.$emit("item-delete",a)}}})],1)},kK=[],_K=oe(SK,xK,kK,!1,null,"679e087a",null,null);const wK=_K.exports,Qte="",Kte="",Jte="",Qa=typeof window>"u"?global:window;Qa.ProcessMaker&&Qa.ProcessMaker.user&&Qa.ProcessMaker.user.lang&&Lt.useLang(Qa.ProcessMaker.user.lang),Lt.register("columns-adds-to-12",t=>t.reduce((r,a)=>r+parseInt(a.content),0)===12,"Columns must add to 12");const CK=[{name:"Default",items:[]}],TK={"Input Fields":1,"Content Fields":2,Dashboards:2.5,Navigation:3,Files:4,Advanced:5},AK="Advanced",OK={components:{TabsBar:hK,draggable:Oa,FormInput:ee.FormInput,FormSelectList:ee.FormSelectList,FormCheckbox:ee.FormCheckbox,FormTextArea:ee.FormTextArea,FormDatePicker:ee.FormDatePicker,FormHtmlEditor:ee.FormHtmlEditor,FormHtmlViewer:ee.FormHtmlViewer,RequiredCheckbox:qx,MultipleUploadsCheckbox:Bx,defaultValueEditor:ef,...Nx,...Cs,PagesDropdown:tK,Sortable:wK},mixins:[gn,lb],props:{renderControls:{type:Boolean,default:!0},validationErrors:{type:Array},initialConfig:{type:Array},title:{type:String},screenType:{type:String,default:As.form},screen:{type:Object},processId:{default:0}},data(){const t=this.initialConfig||CK;this.migrateConfig(t);const e=new Fx,r=e.GetVariableNames(t);return this.title&&t[0].name==="Default"&&(t[0].name=this.title),{showAddPageValidations:!1,openedPages:[0],currentPage:0,selected:null,display:"editor",inspection:{},controls:[],pageAddModal:!1,addPageName:"",editPageIndex:null,editPageName:"",originalPageName:null,config:t,confirmMessage:"",pageDelete:0,translated:[],showAssignment:!1,showVariable:!1,showDesign:!1,filterQuery:"",accordions:Rx,variables:r,generator:e,variablesTree:[],language:"en",collator:null,editorContentKey:0,cancelledJobs:[],collapse:{},groupOrder:{}}},computed:{sortedPages(){return[...this.config].sort((t,e)=>t.order-e.order)},builder(){return this},displayDelete(){return this.config.length>1},filteredControls(){return this.controls.filter(e=>e.label.toLowerCase().includes(this.filterQuery.toLowerCase()))},filteredControlsGrouped(){const t=this.filteredControls.reduce((e,r)=>{let a=H.get(r,"group",null);a||(a=AK);let i=e.findIndex(n=>n.name===a);return i===-1&&(e.push({name:a,order:this.getGroupOrder(a),elements:[]}),i=e.length-1),e[i].elements.push(r),e},[]);return t.sort((e,r)=>e.order-r.order),t.forEach((e,r)=>{t[r].elements.sort((a,i)=>{const n=a.order!==void 0?a.order:Number.POSITIVE_INFINITY,s=i.order!==void 0?i.order:Number.POSITIVE_INFINITY;return n-s})}),t},showToolbar(){return this.screenType===As.form}},watch:{config:{handler(){this.checkForCaptchaInLoops(),this.$emit("change",this.config)},deep:!0},currentPage(){this.inspect()},inspection(t){if(!this.translated.includes(t)){for(const e in t.inspector)if(t.inspector[e].config.label=this.$t(t.inspector[e].config.label),t.inspector[e].config.helper=this.$t(t.inspector[e].config.helper),t.inspector[e].config.options)for(const r in t.inspector[e].config.options)t.inspector[e].config.options[r].content=this.$t(t.inspector[e].config.options[r].content);this.translated.push(t)}},controls(){this.processId!==0&&this.processId!==void 0&&!this.config[this.currentPage].items.length&&this.addDefaultAiControl()}},created(){this.$store.dispatch("undoRedoModule/pushState",{config:JSON.stringify(this.config),currentPage:this.currentPage}),this.initiateLanguageSupport()},mounted(){!localStorage.getItem("cancelledJobs")||localStorage.getItem("cancelledJobs")==="null"?this.cancelledJobs=[]:this.cancelledJobs=JSON.parse(localStorage.getItem("cancelledJobs")),this.checkForCaptchaInLoops(),this.$root.$on("nested-screen-updated",()=>{this.checkForCaptchaInLoops()}),this.$root.$on("ai-form-generated",(t,e)=>{this.previewAiChanges(t,e)}),this.$root.$on("apply-ai-changes",t=>{this.applyAiChanges(t)}),this.$root.$on("ai-form-progress-updated",(t,e)=>{this.updateProgress(t,e)}),this.setGroupOrder(TK)},methods:{isCurrentPageEmpty(t){var e,r;return((r=(e=this.config[t])==null?void 0:e.items)==null?void 0:r.length)===0},onClick(t){this.$refs.tabsBar.openPageByIndex(this.config.indexOf(t))},checkPageName(t,e=!1){return!e&&!this.showAddPageValidations?null:t.trim()?this.config.map(a=>a.name).filter(a=>a!==this.originalPageName).includes(t)?this.$t("Must be unique."):"":this.$t("The Page Name field is required.")},getGroupOrder(t){return H.get(this.groupOrder,t,Number.POSITIVE_INFINITY)},setGroupOrder(t){this.groupOrder={...this.groupOrder,...t}},toggleCollapse(t){this.collapse[t]&&this.collapse[t]===!0?this.collapse[t]=!1:this.collapse[t]=!0},isCollapsed(t){return this.collapse[t]},refreshContent(){this.editorContentKey++},checkForCaptchaInLoops(){this.config.forEach(t=>{this.checkForCaptcha(t.items)})},checkForCaptcha(t,e=!1,r=null){t.forEach(a=>{if(!a.items&&a.component==="Captcha"&&e&&(r&&r.config.screen?(this.$root.$emit("remove-nested",r.config.screen),r.config.screen=null,Qa.ProcessMaker.alert(this.$t("You are trying to place a nested screen within CAPTCHA elements inside a loop. CAPTCHA controls cannot be placed within a Loop control."),"danger")):(t.splice(t.indexOf(a),1),Qa.ProcessMaker.alert(this.$t("CAPTCHA controls cannot be placed within a Loop control."),"danger"))),a.items&&this.checkForCaptcha(a.items,!0,r),a.component==="FormNestedScreen"&&a.config.screen&&window.nestedScreens){const i=window.nestedScreens[`id_${a.config.screen}`];i&&i.forEach(n=>{this.checkForCaptcha(n.items,e,a)})}})},loadVariablesTree(){const t={config:this.$parent.config,computed:this.$parent.computed,customCSS:this.$parent.customCSS,watchers:this.$parent.watchers};this.variablesTree=this.$refs.treeOfVariables.getVariablesTree(t),this.$refs.treeOfVariables.getVariablesTree({config:[]})},accordionName(t){return t.name instanceof Function?t.name(this.inspection):t.name},toggleAccordion(t){this.accordions.forEach(e=>{e!==t&&(e.open=!1)}),t.open=!t.open},openAccordion(t){this.accordions.forEach(e=>{e.open=!1}),t.open=!0},migrateConfig(t=this.config){t.forEach(e=>this.replaceFormText(e.items)),t.forEach(e=>this.migrateFormSubmit(e.items)),t.forEach(e=>this.updateFieldNameValidation(e.items)),this.updatePageOrder(t),t.forEach(e=>this.removeDataVariableFromNestedScreens(e.items)),t.forEach((e,r)=>{e.order=e.order||r+1})},updatePageOrder(t){const e=[...t];e.sort((r,a)=>{const i=r.order||t.indexOf(r)+1,n=a.order||t.indexOf(a)+1;return i-n}),e.forEach((r,a)=>{r.order=a+1})},updateFieldNameValidation(t){t.forEach(e=>{e.inspector&&e.inspector.forEach(r=>{r.field==="name"&&"validation"in r.config&&r.config.name!=="DataVariable"&&e.component!=="FileUpload"&&e.component!=="FormButton"&&(r.config.validation=Yt.config.validation)}),e.items instanceof Array&&this.replaceFormText(e.items)})},removeDataVariableFromNestedScreens(t){t.forEach(e=>{if(e.inspector){const r=e.inspector.find(a=>a.config.name==="DataVariable");e.inspector=e.inspector.filter(a=>a.config.name!=="DataVariable"),r&&delete e.config.name}})},replaceFormText(t){t.forEach(e=>{if(e.component==="FormText"){e.component="FormHtmlEditor",e["editor-component"]="FormHtmlEditor";const r=(e.config.fontSize?`font-size: ${e.config.fontSize};`:"")+(e.config.fontWeight?`font-weight: ${e.config.fontWeight};`:"")+(e.config.textAlign?`text-align: ${e.config.textAlign};`:"");e.config={content:'<div style="'+r+'">'+e.config.label+"</div>",interactive:!0}}e.items instanceof Array&&this.replaceFormText(e.items)})},migrateFormSubmit(t){t.forEach(e=>{e["editor-control"]!=="FormSubmit"&&(e["editor-control"]=e["editor-component"]),e.config.event==="submit"&&(e["editor-component"]==="FormNestedScreen"?(delete e.config.event,e["editor-control"]="FormNestedScreen",e.config.name="Nested Screen"):e["editor-control"]!=="FormImage"&&(e["editor-control"]="FormSubmit")),e.config.event==="pageNavigate"&&(e["editor-control"]="PageNavigation"),e.items instanceof Array&&e.component==="FormMultiColumn"&&(e["editor-control"]="FormMultiColumn",e.items.forEach(r=>this.migrateFormSubmit(r)))})},getAllAccordionizedFields(){return this._allAccordionizedFields?this._allAccordionizedFields:(this._allAccordionizedFields=this.accordions.flatMap(t=>t.fields.map(e=>typeof e=="string"?e:e.name)),this._allAccordionizedFields)},knownField(t){return this.getAllAccordionizedFields().includes(t)},getInspectorFields(t){if(!this.inspection.inspector)return[];const e=t.fields.filter(a=>{if(typeof a!="string"){const{component:i}=this.inspection,{showFor:n,hideFor:s}=a;if(n)return n===i;if(s)return s!==i}return!0}).map(a=>typeof a!="string"?a.name:a);return(this.controls.find(a=>a["editor-control"]===this.inspection["editor-control"])||this.controls.find(a=>a.component===this.inspection.component)||{inspector:[]}).inspector.filter(a=>!!(e.includes(a.field)||!this.knownField(a.field)&&t.name==="Configuration"))},updateState(){this.$store.dispatch("undoRedoModule/pushState",{config:JSON.stringify(this.config),currentPage:this.currentPage})},async undo(){this.inspect(),this.$store.dispatch("undoRedoModule/undo"),this.config=JSON.parse(this.$store.getters["undoRedoModule/currentState"].config),await this.$nextTick(),this.$refs.tabsBar.openPageByIndex(this.$store.getters["undoRedoModule/currentState"].currentPage)},async redo(){this.inspect(),this.$store.dispatch("undoRedoModule/redo"),this.config=JSON.parse(this.$store.getters["undoRedoModule/currentState"].config),await this.$nextTick(),this.$refs.tabsBar.openPageByIndex(this.$store.getters["undoRedoModule/currentState"].currentPage)},updateConfig(t){this.config[this.currentPage].items=t,this.updateState()},hasError(t){return this.validationErrors.some(({item:e})=>e===t)},focusInspector(t){this.showConfiguration=!0,this.$refs.tabsBar.openPageByIndex(this.config.indexOf(t.page)),this.$nextTick(()=>{this.inspect(t.item),this.$nextTick(()=>{const e=this.$el.querySelector(`[field-name="${t.field}"]`);if(e){const r=this.$el.querySelector(`[accordion-name="${e.getAttribute("field-accordion")}"]`);r&&r.getAttribute("is-open")==="0"&&r.click(),e.focus instanceof Function&&e.focus()}})})},confirmDelete(t=this.config[this.currentPage]){this.confirmMessage=this.$t("Are you sure you want to delete {{item}}?",{item:t.name}),this.config.length!==1&&(this.pageDelete=this.config.indexOf(t),this.$refs.confirm.show())},hideConfirmModal(){this.$refs.confirm.hide()},addControl(t){this.controls.push(t)},deleteItem(t){this.config[this.currentPage].items.splice(t,1),this.inspection.inspector.splice(0,this.inspection.inspector.length),this.updateState()},duplicateItem(t){const e=H.cloneDeep(this.config[this.currentPage].items[t]);this.config[this.currentPage].items.push(e)},openEditPageModal(t){this.editPageIndex=t;const e=this.config[t].name;this.originalPageName=e,this.editPageName=e,this.$refs.editPageModal.show()},editPage(t){if(this.$refs.editPageInput.validator.errorCount){t.preventDefault();return}this.config[this.editPageIndex].name=this.editPageName,this.updateState()},addPage(t){if(this.checkPageName(this.addPageName,!0)){this.showAddPageValidations=!0,t.preventDefault();return}const r=this.config.reduce((a,i)=>i.order>a?i.order:a,0);this.config.push({name:this.addPageName,order:r+1,items:[]}),this.addPageName="",this.currentPage=this.config.length-1,this.updateState(),this.$refs.tabsBar.openPageByIndex(this.config.length-1)},calcNewIndexFor(t,e){if(t===this.pageDelete)throw new Error(`${this.$t("Can not delete this page, it is referenced by")}: ${e}`);return t>this.pageDelete?t-1:t},updateRecordListReferences(){this.config.forEach(t=>{t.items.forEach(e=>{e.component==="FormRecordList"&&(e.config.form=this.calcNewIndexFor(e.config.form*1,e.config.label))})})},updateNavigationButtonsReferences(){this.config.forEach(t=>{t.items.forEach(e=>{e.component==="FormButton"&&e.config.event==="pageNavigate"&&(e.config.eventData=this.calcNewIndexFor(e.config.eventData*1,e.config.label))})})},async deletePage(){const t=H.cloneDeep(this.config);try{this.updateRecordListReferences(),this.updateNavigationButtonsReferences(),this.$refs.tabsBar.closePageByIndex(this.pageDelete),this.$refs.tabsBar.updateTabsReferences(this.pageDelete),await this.$nextTick(),this.config.splice(this.pageDelete,1)}catch(e){this.config=t,Qa.ProcessMaker.alert(e.message,"danger");return}this.updatePageOrder(this.config),this.$store.dispatch("undoRedoModule/pushState",{config:JSON.stringify(this.config),currentPage:this.currentPage,deletedPage:!0})},inspect(t={}){this.inspection=t,this.selected=t;const e=this.accordions.find(r=>this.getInspectorFields(r).length>0);e&&this.openAccordion(e)},cloneControl(t){const e={config:JSON.parse(JSON.stringify(t.config)),inspector:JSON.parse(JSON.stringify(t.inspector)),component:t.component,"editor-component":t["editor-component"],"editor-control":t["editor-control"],label:t.label,value:t.value};if(t.component==="FormDatePicker"&&e.config.phrases&&(e.config.phrases.ok=this.$t(e.config.phrases.ok),e.config.phrases.cancel=this.$t(e.config.phrases.cancel)),e.config.label=this.$t(e.config.label),Array.isArray(e.config.options))for(const r in e.config.options)e.config.options[r].content=this.$t(e.config.options[r].content);return t.container&&(e.items=JSON.parse(JSON.stringify(t.items)),e.container=!0),(H.findIndex(t.inspector,Yt)!==-1||t.component==="FormLoop")&&([this.variables,e.config.name]=this.generator.generate(this.config,e["editor-control"]?e["editor-control"]:e.component),H.has(e,"config.settings.varname")&&(e.config.settings.varname=e.config.name)),e},initiateLanguageSupport(){document.documentElement.lang&&(this.language=document.documentElement.lang),this.collator=Intl.Collator(this.language)},isAiSection(t){return t.component==="AiSection"},aiPreview(t){return t.items&&t.items[0]&&t.items[0].length},previewAiChanges(t,e){this.config.forEach((r,a)=>{r.items.forEach((i,n)=>{i.component==="AiSection"&&e===i.config.aiConfig.nonce&&this.$set(i,"items",JSON.parse(JSON.stringify(t)))})})},applyAiChanges(t){t.component="FormMultiColumn",t.label="Multicolumn / Table",t["editor-control"]="MultiColumn",t["editor-component"]="MultiColumn",t.inspector=[{type:"ContainerColumns",field:"options",config:{label:"Column Width",validation:"columns-adds-to-12"}}],t.config={icon:"fas fa-table",options:[{value:"1",content:"12"}]}},updateProgress(t,e){this.config.forEach(r=>{r.items.forEach(a=>{if(a.component==="AiSection"&&e===a.config.aiConfig.nonce){if(this.cancelledJobs.some(i=>i===e))return;this.$set(a.config.aiConfig,"progress",t)}})})},addDefaultAiControl(){const t=this.builder.controls.find(r=>r.component==="AiSection"),e=this.cloneControl(t);e.config.aiConfig.autofocus=!0,e.config.aiConfig.screenTitle=this.screen.title,e.config.aiConfig.screenDescription=this.screen.description,this.config[this.currentPage].items.push(e),this.updateState(),this.inspect(e)}}};var EK=function(){var e=this,r=e._self._c;return r("b-row",{staticClass:"custom-row h-100 m-0"},[r("b-col",{staticClass:"overflow-hidden h-100 p-0 controls-column"},[r("b-card",{staticClass:"h-100 rounded-0 border-top-0 border-bottom-0 border-left-0",attrs:{"no-body":""}},[r("b-input-group",{staticStyle:{height:"42px"},attrs:{size:"sm"}},[r("b-input-group-prepend",[r("span",{staticClass:"input-group-text rounded-0 border-left-0 border-top-0 border-bottom-0"},[r("i",{staticClass:"fas fa-search icon"})])]),r("b-form-input",{staticClass:"border-0 rounded-0",staticStyle:{height:"42px"},attrs:{type:"text",size:"lg",placeholder:e.$t("Search Here")},model:{value:e.filterQuery,callback:function(a){e.filterQuery=a},expression:"filterQuery"}})],1),r("b-card-body",{staticClass:"p-0 overflow-auto",attrs:{"no-body":""}},[e._l(e.filteredControlsGrouped,function({name:a,elements:i},n){return[r("b-button",{staticClass:"w-100 rounded-0 text-left",staticStyle:{"font-size":"smaller",height:"42px",color:"grey","border-color":"rgb(224, 224, 224)","background-color":"rgb(235, 238, 242)"},attrs:{"aria-controls":`collapse-${n+1}`},on:{click:function(s){return e.toggleCollapse(n)}}},[r("strong",[e._v(e._s(e.$t(a)))]),r("b-icon",{staticClass:"float-right",attrs:{icon:e.isCollapsed(n)?"chevron-down":"chevron-up"}})],1),r("b-collapse",{staticClass:"mt-2",model:{value:e.collapse[n],callback:function(s){e.$set(e.collapse,n,s)},expression:"collapse[index]"}},[r("b-list-group",[e.renderControls?r("draggable",e._b({staticClass:"controls list-group w-auto list-group-flush",attrs:{id:"controls","data-cy":"controls",clone:e.cloneControl},model:{value:e.filteredControlsGrouped[n].elements,callback:function(s){e.$set(e.filteredControlsGrouped[n],"elements",s)},expression:"filteredControlsGrouped[index].elements"}},"draggable",{sort:!1,group:{name:"controls",pull:"clone",put:!1}},!1),e._l(i,function(s,o){return r("b-list-group-item",{directives:[{name:"b-popover",rawName:"v-b-popover.hover.right",value:{content:e.$t(s.popoverContent),customClass:"custom-popover",boundaryPadding:16},expression:`{
|
|
341
341
|
content: $t(element.popoverContent),
|
|
342
342
|
customClass: 'custom-popover',
|
|
343
343
|
boundaryPadding: 16
|