From 24acfab325ba362a20260b1f5689e55a4e4a96b0 Mon Sep 17 00:00:00 2001 From: Nick Diego Date: Wed, 2 Nov 2022 12:28:46 -0500 Subject: [PATCH] Fresh build. --- ...visibility-contextual-indicator-styles.css | 2 +- build/block-visibility-editor.asset.php | 2 +- build/block-visibility-editor.js | 32 ++++++++++++------- build/block-visibility-settings.asset.php | 2 +- build/block-visibility-settings.js | 26 +++++++++------ 5 files changed, 40 insertions(+), 24 deletions(-) diff --git a/build/block-visibility-contextual-indicator-styles.css b/build/block-visibility-contextual-indicator-styles.css index 73df0fb5..da3ede94 100644 --- a/build/block-visibility-contextual-indicator-styles.css +++ b/build/block-visibility-contextual-indicator-styles.css @@ -1 +1 @@ -.block-visibility__has-visibility,.block-visibility__has-visibility.components-placeholder,.block-visibility__has-visibility.components-placeholder.components-placeholder{outline:1px dashed var(--wp-admin-theme-color)}.block-visibility__has-visibility:after{background-color:var(--wp-admin-theme-color);content:"";height:100%;left:0;mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-position:calc(100% - 4px) 4px;mask-position:calc(100% - 4px) 4px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:24px 24px;mask-size:24px 24px;min-height:29px;min-width:28px;position:absolute;top:0;width:100%;z-index:1}.block-visibility__has-visibility.block-visibility__has-date-time:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-user-role:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-screen-size:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-query-string:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-wp-fusion:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-acf:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-location:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-referral-source:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-url-path:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-browser-device:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-metadata:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-cookie:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-edd:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-woocommerce:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-2-controls:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-3-controls:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-4-controls:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__has-5-controls:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility.block-visibility__is-hidden:after{mask-image:url("data:image/svg+xml;utf8,")!important;-webkit-mask-image:url("data:image/svg+xml;utf8,")!important}.block-visibility__has-visibility.has-child-selected,.block-visibility__has-visibility.is-selected{outline:none}.block-visibility__has-visibility.has-child-selected:after,.block-visibility__has-visibility.is-selected:after{background:none!important;mask-image:none!important;-webkit-mask-image:none!important}.is-outline-mode .wp-block.block-visibility__has-visibility.is-hovered{outline:none}.is-outline-mode .wp-block.block-visibility__has-visibility.is-hovered:after{background:none!important;mask-image:none!important;-webkit-mask-image:none!important}.is-outline-mode .wp-block>.block-visibility__has-visibility.is-hovered{outline:none}.is-outline-mode .wp-block>.block-visibility__has-visibility.is-hovered:after{background:none!important;mask-image:none!important;-webkit-mask-image:none!important} +.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected),.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).components-placeholder,.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).components-placeholder.components-placeholder{outline:1px dashed var(--wp-admin-theme-color)}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected):after{background-color:var(--wp-admin-theme-color);content:"";mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-position:calc(100% - 4px) 4px;mask-position:calc(100% - 4px) 4px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:24px 24px;mask-size:24px 24px;min-height:29px;min-width:28px;position:absolute;right:0;top:0;z-index:1}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-date-time:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-user-role:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-screen-size:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-query-string:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-wp-fusion:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-acf:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-location:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-referral-source:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-url-path:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-browser-device:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-metadata:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-cookie:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-edd:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-woocommerce:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-2-controls:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-3-controls:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-4-controls:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__has-5-controls:after{mask-image:url("data:image/svg+xml;utf8,");-webkit-mask-image:url("data:image/svg+xml;utf8,")}.block-visibility__has-visibility:not(.is-selected):not(.has-child-selected).block-visibility__is-hidden:after{mask-image:url("data:image/svg+xml;utf8,")!important;-webkit-mask-image:url("data:image/svg+xml;utf8,")!important}.is-outline-mode .wp-block.block-visibility__has-visibility.is-hovered:not(.is-selected):not(.has-child-selected){outline-style:solid}.is-outline-mode .wp-block.block-visibility__has-visibility.is-hovered:not(.is-selected):not(.has-child-selected):after{content:none}.is-outline-mode .wp-block>.block-visibility__has-visibility.is-hovered:not(.is-selected):not(.has-child-selected){outline-style:solid}.is-outline-mode .wp-block>.block-visibility__has-visibility.is-hovered:not(.is-selected):not(.has-child-selected):after{content:none} diff --git a/build/block-visibility-editor.asset.php b/build/block-visibility-editor.asset.php index 48f9b7ab..81af9500 100644 --- a/build/block-visibility-editor.asset.php +++ b/build/block-visibility-editor.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '63975b5e49cf44daf8f5'); + array('lodash', 'react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '8e987d439e90a8530430'); diff --git a/build/block-visibility-editor.js b/build/block-visibility-editor.js index ee3b441b..fe8deb88 100644 --- a/build/block-visibility-editor.js +++ b/build/block-visibility-editor.js @@ -1,11 +1,21 @@ -!function(){var e={184:function(e,t){var n;!function(){"use strict";var i={}.hasOwnProperty;function l(){for(var e=[],t=0;t"hide_block"===e.settingSlug)))return null;const{blockVisibility:c}=o,u=null!==(l=null==c?void 0:c.hideBlock)&&void 0!==l&&l;return(0,e.createElement)("div",{className:"visibility-control__group hide-block-control"},(0,e.createElement)("div",{className:"visibility-control"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide block","block-visibility"),checked:u,onChange:()=>{r({blockVisibility:(0,t.assign)({...c},{hideBlock:!u})})},help:(0,i.__)("Hide the block from everyone.","block-visibility")})))}var p=n(184),v=n.n(p),m=window.wp.primitives,b=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"})),f=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),h=function(t){let{icon:n,size:i=24,...l}=t;return(0,e.cloneElement)(n,{width:i,height:i,...l})},g=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),y=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));const _={};_.logo=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},(0,e.createElement)(a.Path,{d:"M128,0 C198.692448,0 256,57.307552 256,128 C256,198.692448 198.692448,256 128,256 C57.307552,256 0,198.692448 0,128 C0,57.307552 57.307552,0 128,0 Z M128,67 C88.7744776,67 54.0129388,90.9022691 39.4355448,126.649105 L39,127.735956 L39,128.264044 L39.4740036,129.445062 C54.0740078,165.139702 88.8089313,189 128,189 C167.225522,189 201.987061,165.097731 216.564455,129.350895 L217,128.264044 L217,127.735956 L216.525996,126.554938 C201.925992,90.8602984 167.191069,67 128,67 Z M128,88 C150.09139,88 168,105.90861 168,128 C168,150.09139 150.09139,168 128,168 C105.90861,168 88,150.09139 88,128 C88,105.90861 105.90861,88 128,88 Z M136,104 C127.163444,104 120,111.163444 120,120 C120,128.836556 127.163444,136 136,136 C144.836556,136 152,128.836556 152,120 C152,111.163444 144.836556,104 136,104 Z"})),_.error=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M12,2 C6.48,2 2,6.48 2,12 C2,17.52 6.48,22 12,22 C17.52,22 22,17.52 22,12 C22,6.48 17.52,2 12,2 Z M13,17 L11,17 L11,15 L13,15 L13,17 Z M13,13 L11,13 L11,7 L13,7 L13,13 Z","fill-rule":"nonzero"})),_.errorOutline=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M13,17 L11,17 L11,15 L13,15 L13,17 Z M13,13 L11,13 L11,7 L13,7 L13,13 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,20 C7.581722,20 4,16.418278 4,12 C4,7.581722 7.581722,4 12,4 C16.418278,4 20,7.581722 20,12 C20,16.418278 16.418278,20 12,20 Z","fill-rule":"nonzero"})),_.trash=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M20,5.5 L14.3,5.5 C14.3,4.2 13.3,3.2 12,3.2 C10.7,3.2 9.7,4.2 9.7,5.5 L4,5.5 L4,7.5 L5.5,7.5 L5.5,7.8 L7.2,18.9 C7.3,19.9 8.2,20.6 9.2,20.6 L14.9,20.6 C15.9,20.6 16.7,19.9 16.9,18.9 L18.6,7.8 L18.6,7.5 L20,7.5 L20,5.5 Z M16.8,7.5 L15.1,18.6 C15.1,18.7 15,18.8 14.8,18.8 L9.1,18.8 C9,18.8 8.8,18.7 8.8,18.6 L7.2,7.5 L16.8,7.5 Z"})),_.warning=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M1,21 L23,21 L12,2 L1,21 Z M13,18 L11,18 L11,16 L13,16 L13,18 Z M13,14 L11,14 L11,10 L13,10 L13,14 Z","fill-rule":"nonzero"})),_.image=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),_.replaceImage=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",width:"20",height:"20"},(0,e.createElement)("rect",{x:"11",y:"3",width:"7",height:"5",rx:"1"}),(0,e.createElement)("rect",{x:"2",y:"12",width:"7",height:"5",rx:"1"}),(0,e.createElement)(a.Path,{d:"M13,12h1a3,3,0,0,1-3,3v2a5,5,0,0,0,5-5h1L15,9Z"}),(0,e.createElement)(a.Path,{d:"M4,8H3l2,3L7,8H6A3,3,0,0,1,9,5V3A5,5,0,0,0,4,8Z"})),_.link=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),_.help=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M2,12 C2,6.48 6.48,2 12,2 C17.52,2 22,6.48 22,12 C22,17.52 17.52,22 12,22 C6.48,22 2,17.52 2,12 Z M12,20 C16.41,20 20,16.41 20,12 C20,7.59001 16.41,4.00002 12,4.00002 C7.59,4.00002 4,7.59001 4,12 C4,16.41 7.59,20 12,20 Z"}),(0,e.createElement)("polygon",{points:"13 16 13 18 11 18 11 16"}),(0,e.createElement)(a.Path,{d:"M8,10 C8,7.79 9.79,6 12,6 C14.21,6 16,7.79 16,10 C16,11.28291 15.21,11.97331 14.4408,12.6455 C13.711,13.2833 13,13.9046 13,15 L11,15 C11,13.1787 11.94212,12.4566 12.7704,11.82167 C13.4202,11.3236 14,10.87921 14,10 C14,8.9 13.1,8 12,8 C10.9,8 10,8.9 10,10 L8,10 Z"})),_.star=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)("polygon",{points:"12 17.7371778 5.81966011 21.5 7.49246652 14.4659011 2 9.75735421 9.2141911 9.1728642 12 2.5 14.7858089 9.1728642 22 9.75735421 16.5075335 14.4659011 18.1803399 21.5"})),_.school=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z"})),_.support=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M12,2C6.48,2,2,6.48,2,12c0,5.52,4.48,10,10,10s10-4.48,10-10C22,6.48,17.52,2,12,2z M19.46,9.12l-2.78,1.15 c-0.51-1.36-1.58-2.44-2.95-2.94l1.15-2.78C16.98,5.35,18.65,7.02,19.46,9.12z M12,15c-1.66,0-3-1.34-3-3s1.34-3,3-3s3,1.34,3,3 S13.66,15,12,15z M9.13,4.54l1.17,2.78c-1.38,0.5-2.47,1.59-2.98,2.97L4.54,9.13C5.35,7.02,7.02,5.35,9.13,4.54z M4.54,14.87 l2.78-1.15c0.51,1.38,1.59,2.46,2.97,2.96l-1.17,2.78C7.02,18.65,5.35,16.98,4.54,14.87z M14.88,19.46l-1.15-2.78 c1.37-0.51,2.45-1.59,2.95-2.97l2.78,1.17C18.65,16.98,16.98,18.65,14.88,19.46z"})),_.cloud=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M18.3529412,9.83333333 C20.4705882,10.0666667 22,11.8166667 22,13.9166667 C22,16.1333333 20.1176471,18 17.8823529,18 L6.11764706,18 C3.88235294,18 2,16.1333333 2,13.9166667 C2,11.8166667 3.52941176,10.1833333 5.64705882,9.83333333 C5.52941176,9.71666667 5.52941176,9.48333333 5.52941176,9.25 C5.52941176,7.61666667 6.82352941,6.33333333 8.47058824,6.33333333 C8.82352941,6.33333333 9.29411765,6.45 9.52941176,6.56666667 C10.3529412,5.05 11.8823529,4 13.7647059,4 C16.3529412,4 18.4705882,6.1 18.4705882,8.66666667 C18.4705882,9.13333333 18.3529412,9.48333333 18.3529412,9.83333333 Z"})),_.visibility=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M12,5 C17,5 21.27,8.11 23,12.5 C21.27,16.89 17,20 12,20 C7,20 2.73,16.89 1,12.5 C2.73,8.11 7,5 12,5 Z M12,17.5 C14.76,17.5 17,15.26 17,12.5 C17,9.74 14.76,7.5 12,7.5 C9.24,7.5 7,9.74 7,12.5 C7,15.26 9.24,17.5 12,17.5 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M12,9.5 C10.34,9.5 9,10.84 9,12.5 C9,14.16 10.34,15.5 12,15.5 C13.66,15.5 15,14.16 15,12.5 C15,10.84 13.66,9.5 12,9.5 Z","fill-rule":"nonzero"})),_.visibilityHidden=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M19.1145976,17.6145976 C17.1357397,19.111758 14.6721169,20 12,20 C7,20 2.73,16.89 1,12.5 C2.1681438,9.53575071 4.49435577,7.15509483 7.42141271,5.92141271 L9.60854669,8.10854669 C8.05477185,8.95699413 7,10.6060682 7,12.5 C7,15.26 9.24,17.5 12,17.5 C13.8939318,17.5 15.5430059,16.4452281 16.3914533,14.8914533 L19.1145976,17.6145976 L19.1145976,17.6145976 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M20.6043865,16.2759593 L16.9972006,12.6687735 C16.9990619,12.6127432 17,12.5564805 17,12.5 C17,9.74 14.76,7.5 12,7.5 C11.9435195,7.5 11.8872568,7.50093805 11.8312265,7.50279942 L9.57740803,5.2489809 C10.3592736,5.08578831 11.1695684,5 12,5 C17,5 21.27,8.11 23,12.5 C22.4438856,13.9111805 21.6253071,15.1900957 20.6043865,16.2759593 L20.6043865,16.2759593 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M13.6675474,14.9959745 C13.1910334,15.314476 12.6176688,15.5 12,15.5 C10.34,15.5 9,14.16 9,12.5 C9,11.8823312 9.18552396,11.3089666 9.50402547,10.8324526 L2.66116524,3.98959236 C2.27064094,3.59906807 2.27064094,2.96590309 2.66116524,2.5753788 C3.05168953,2.18485451 3.68485451,2.18485451 4.0753788,2.5753788 L21.0459415,19.5459415 C21.4364658,19.9364658 21.4364658,20.5696308 21.0459415,20.9601551 C20.6554173,21.3506794 20.0222523,21.3506794 19.631728,20.9601551 L13.6675474,14.9959745 L13.6675474,14.9959745 Z","fill-rule":"nonzero"})),_.visibilityAlt=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M12,16 C14.208,16 16,14.208 16,12 C16,9.792 14.208,8 12,8 C9.792,8 8,9.792 8,12 C8,14.208 9.792,16 12,16 Z M12,14.5 C10.6204271,14.5 9.5,13.3795729 9.5,12 C9.5,10.6204271 10.6204271,9.5 12,9.5 C13.3795729,9.5 14.5,10.6204271 14.5,12 C14.5,13.3795729 13.3795729,14.5 12,14.5 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M12,16 C14.208,16 16,14.208 16,12 C16,9.792 14.208,8 12,8 C9.792,8 8,9.792 8,12 C8,14.208 9.792,16 12,16 Z M12,14.5 C10.6204271,14.5 9.5,13.3795729 9.5,12 C9.5,10.6204271 10.6204271,9.5 12,9.5 C13.3795729,9.5 14.5,10.6204271 14.5,12 C14.5,13.3795729 13.3795729,14.5 12,14.5 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M12,4.5 C17,4.5 21.27,7.61 23,12 C21.27,16.39 17,19.5 12,19.5 C7,19.5 2.73,16.39 1,12 C2.73,7.61 7,4.5 12,4.5 Z M21.3473903,12 C19.6713562,8.45851492 16.065323,6.10714286 12,6.10714286 C7.934677,6.10714286 4.32864381,8.45851492 2.65260973,12 C4.32864381,15.5414851 7.934677,17.8928571 12,17.8928571 C16.065323,17.8928571 19.6713562,15.5414851 21.3473903,12 Z","fill-rule":"nonzero"})),_.visibilityHiddenAlt=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M13.9708958,15.4810143 C13.389064,15.8113365 12.7164305,16 12,16 C9.792,16 8,14.208 8,12 C8,11.3082051 8.17591163,10.6572469 8.48541416,10.089446 L9.62711077,11.2115964 C9.54465452,11.4595008 9.5,11.7245863 9.5,12 C9.5,13.3795729 10.6204271,14.5 12,14.5 C12.2905966,14.5 12.5696948,14.4502864 12.8292449,14.3589089 L13.9708958,15.4810143 L13.9708958,15.4810143 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M15.8136867,13.2093721 L14.4986393,11.9168387 C14.4551273,10.5889421 13.3734522,9.52129787 12.040023,9.50031471 L10.7249635,8.20776951 C11.1254753,8.07302998 11.554261,8 12,8 C14.208,8 16,9.792 16,12 C16,12.4214718 15.9347055,12.8277859 15.8136867,13.2093721 L15.8136867,13.2093721 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M16.9542237,18.4124655 C15.4477475,19.1104464 13.7695931,19.5 12,19.5 C7,19.5 2.73,16.39 1,12 C1.83549245,9.87987753 3.26340063,8.05829526 5.0798477,6.74138281 L6.22058871,7.86259395 C4.69709513,8.8848633 3.45414836,10.3063369 2.65260973,12 C4.32864381,15.5414851 7.934677,17.8928571 12,17.8928571 C13.3051937,17.8928571 14.5630455,17.6504858 15.7248846,17.2041731 L16.9542237,18.4124655 L16.9542237,18.4124655 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M19.489889,16.8185998 L18.3656404,15.7135987 C19.6222382,14.7364947 20.6512781,13.4708955 21.3473903,12 C19.6713562,8.45851492 16.065323,6.10714286 12,6.10714286 C10.9730526,6.10714286 9.97541373,6.25718996 9.03079081,6.53856491 L7.75659725,5.28618597 C9.07339857,4.77839975 10.5040254,4.5 12,4.5 C17,4.5 21.27,7.61 23,12 C22.2539458,13.8931665 21.0355216,15.5482882 19.489889,16.8185998 L19.489889,16.8185998 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M2.72426842,4.42613185 L19.2242684,20.6436463 C19.5196795,20.9339998 19.9945355,20.9298999 20.2848891,20.6344888 C20.5752426,20.3390777 20.5711426,19.8642217 20.2757316,19.5738682 L3.77573158,3.35635373 C3.48032051,3.0660002 3.00546447,3.07010014 2.71511094,3.36551121 C2.42475741,3.66092228 2.42885735,4.13577832 2.72426842,4.42613185 Z","fill-rule":"nonzero"})),_.wpFusion=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M5.05263158,0 L24,0 L24,0 L24,18.9473684 C24,21.7378598 21.7378598,24 18.9473684,24 L0,24 L0,24 L0,5.05263158 C0,2.26214021 2.26214021,0 5.05263158,0 Z",fill:"#E55B10"}),(0,e.createElement)(a.Path,{d:"M19.5789474,9.78947368 C19.5789474,10.3126908 19.1547961,10.7368421 18.6315789,10.7368421 L11.0526316,10.7362105 L11.0526316,18.3157895 C11.0526316,18.8390066 10.6284803,19.2631579 10.1052632,19.2631579 L9.47368421,19.2631579 C8.95046709,19.2631579 8.52631579,18.8390066 8.52631579,18.3157895 L8.52631579,9.47368421 C8.52631579,9.13121956 8.70802977,8.83119651 8.98029891,8.66477387 C9.14698598,8.39224029 9.44700903,8.21052632 9.78947368,8.21052632 L18.6315789,8.21052632 C19.1547961,8.21052632 19.5789474,8.63467762 19.5789474,9.15789474 L19.5789474,9.78947368 Z",fill:"#FFFFFF"}),(0,e.createElement)(a.Path,{d:"M5.05263158,14.5263158 C5.05263158,14.0030987 5.47678287,13.5789474 6,13.5789474 L13.5789474,13.5795789 L13.5789474,6 C13.5789474,5.47678287 14.0030987,5.05263158 14.5263158,5.05263158 L15.1578947,5.05263158 C15.6811119,5.05263158 16.1052632,5.47678287 16.1052632,6 L16.1052632,14.8421053 C16.1052632,15.1845699 15.9235492,15.484593 15.65128,15.6510156 C15.484593,15.9235492 15.1845699,16.1052632 14.8421053,16.1052632 L6,16.1052632 C5.47678287,16.1052632 5.05263158,15.6811119 5.05263158,15.1578947 L5.05263158,14.5263158 Z",fill:"#FFFFFF"})),_.acf=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M19.2,0 C21.8509668,0 24,2.1490332 24,4.8 L24,19.2 C24,21.8509668 21.8509668,24 19.2,24 L4.8,24 C2.1490332,24 0,21.8509668 0,19.2 L0,4.8 C0,2.1490332 2.1490332,0 4.8,0 L19.2,0 Z M6.89048872,7.2 L5.10930627,7.2 L1.24499674,16.9860194 L1.24732975,16.9866974 L1.2,17.1 L3.65563145,17.1 L4.2996,15.468 L7.7016,15.4704 L8.34587867,17.1 L10.8,17.1 L10.7526702,16.9866974 L10.7550033,16.9860194 L10.6063073,16.6130016 C11.2549234,16.9251163 11.9820385,17.1 12.75,17.1 C14.249715,17.1 15.5936573,16.433058 16.5014094,15.3795917 L16.5,17.1 L18.9,17.1 L18.9,13.5 L22.65,13.5 L22.65,11.1 L18.9,11.0988 L18.9,9.5988 L22.8,9.6 L22.8,7.2 L16.5,7.2 L16.5014746,8.92048398 C15.5937217,7.86697391 14.2497509,7.2 12.75,7.2 C10.6493455,7.2 8.85431186,8.50851842 8.13552383,10.3549305 L6.89048872,7.2 Z M12.75,9.48 C13.89314,9.48 14.8684898,10.1983951 15.2492094,11.2083452 L15.3135218,11.4010233 L16.5,11.4 L16.5,13.2012 L15.2051151,13.2011741 C14.8224969,14.0936466 13.9674734,14.7355294 12.9545886,14.8122785 L12.75,14.82 C11.2753997,14.82 10.08,13.6246003 10.08,12.15 C10.08,10.6753997 11.2753997,9.48 12.75,9.48 Z M6.0012,11.16 L6.8916,13.4172 L5.1108,13.416 L6.0012,11.16 Z",fill:"#5DE8BF"}));var C=_;const E=(0,a.withFilters)("blockVisibility.addControlSetOptions")((t=>(0,e.createElement)(e.Fragment,null))),k=(0,a.withFilters)("blockVisibility.addControlSetModals")((t=>(0,e.createElement)(e.Fragment,null)));function w(n){var l,o;const[r,s]=(0,e.useState)(!1),{type:u,controls:d,controlSets:p,controlSetAtts:v,defaultControls:m,setControlSetAtts:y}=n;function _(e){let n;n=e.active?(0,t.omit)({...v.controls},[e.attributeSlug]):(0,t.assign)({...v.controls},{[e.attributeSlug]:{}});const i=(0,t.assign)({...v},{controls:{...n}});y(i)}function k(e,t){y({...v,[e]:t})}const w=d.filter((e=>"core"===e.type)),x=d.filter((e=>"integration"===e.type)),M=null!==(l=null==v?void 0:v.title)&&void 0!==l?l:"",L=null===(o=null==v?void 0:v.enable)||void 0===o||o;let P=M;P||(P="single"===u?(0,i.__)("Enabled Controls","block-visibility"):(0,i.__)("Control Set","block-visibility"));const V=(0,e.createElement)(a.DropdownMenu,{className:"settings-dropdown",label:(0,i.__)("Settings","block-visibility"),icon:b,popoverProps:{className:"block-visibility__control-popover control-settings",focusOnMount:"container"}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h3",null,(0,i.__)("Settings","block-visibility")),(0,e.createElement)(a.TextControl,{value:M,label:(0,i.__)("Control set title","block-visibility"),placeholder:P,onChange:e=>k("title",e)}),(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Enable control set","block-visibility"),checked:L,onChange:()=>k("enable",!L)})))),N=(0,e.createElement)(a.DropdownMenu,{className:"controls-dropdown",label:(0,i.__)("Visibility Controls","block-visibility"),icon:C.visibilityAlt,popoverProps:{className:"block-visibility__control-popover control-set",focusOnMount:"container"}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Controls","block-visibility")},w.map(((t,n)=>(0,e.createElement)(O,{key:n,control:t,toggleControls:_})))),0!==x.length&&(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Integrations","block-visibility")},x.map(((t,n)=>(0,e.createElement)(O,{key:n,control:t,toggleControls:_}))))))),T=(0,e.createElement)(a.DropdownMenu,{className:"options-dropdown",label:(0,i.__)("Options","block-visibility"),icon:f,popoverProps:{focusOnMount:"container"}},(l=>{let{onClose:o}=l;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"ControlSetOptionsTop"}),(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Tools","block-visibility")},(0,e.createElement)(a.Slot,{name:"ControlSetOptionsToolsTop"}),"multiple"===u&&(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=Math.max(...p.map((e=>e.id)),0)+1,t={...v,id:e};y(t)}(),o()}},(0,i.__)("Duplicate","block-visibility")),(0,e.createElement)(a.Slot,{name:"ControlSetOptionsToolsMiddle"}),(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=(0,t.assign)({...v},{controls:m});y(e)}(),o()}},(0,i.__)("Reset all controls","block-visibility")),(0,e.createElement)(a.Slot,{name:"ControlSetOptionsToolsBottom"}),(0,e.createElement)("a",{href:"https://www.blockvisibilitywp.com/knowledge-base/guide-to-visibility-controls-and-control-sets?bv_query=learn_more&utm_source=plugin&utm_medium=editor&utm_campaign=plugin_referrals",target:"_blank",role:"menuitem",rel:"noopener noreferrer",className:"components-button components-menu-item__button"},(0,e.createElement)("span",{className:"components-menu-item__item"},(0,i.__)("Help","block-visibility"),(0,e.createElement)(a.VisuallyHidden,null,(0,i.__)("(opens in a new tab)","block-visibility"))),(0,e.createElement)(h,{icon:g,size:20}))),(0,e.createElement)(a.Slot,{name:"ControlSetOptionsBottom"}),"multiple"===u&&(0,e.createElement)(a.MenuGroup,null,(0,e.createElement)(a.MenuItem,{onClick:()=>{y(v,!0),o()}},(0,i.__)("Remove control set","block-visibility"))),(0,e.createElement)(E,c({modalOpen:r,setModalOpen:s,toggleControls:_,coreControls:w,integrationControls:x,onClose:o},n)))}));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"control-set__header section-header main"},(0,e.createElement)("span",{className:"section-header__title"},P),(0,e.createElement)("div",{className:"section-header__toolbar"},N,"multiple"===u&&V,T)),r&&(0,e.createElement)(S,c({modalOpen:r,setModalOpen:s,toggleControls:_,coreControls:w,integrationControls:x},n)))}function S(t){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"ControlSetModals"}),(0,e.createElement)(k,t))}function O(t){const{control:n,toggleControls:i}=t;return(0,e.createElement)(a.MenuItem,{key:n.attributeSlug,className:v()({disabled:!n.active}),icon:n.active?y:"",onClick:()=>i(n)},n.icon&&(0,e.createElement)(h,{className:"control-branding-icon",icon:n.icon}),n.label)}var x=window.React,M=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?I(G,--j):0,B--,10===$&&(B=1,z--),$}function Y(){return $=j2||J($)>3?"":" "}function le(e,t){for(;--t&&Y()&&!($<48||$>102||$>57&&$<65||$>70&&$<97););return K(e,Q()+(t<6&&32==X()&&32==Y()))}function oe(e){for(;Y();)switch($){case e:return j;case 34:case 39:34!==e&&39!==e&&oe($);break;case 40:41===e&&oe(e);break;case 92:Y()}return j}function re(e,t){for(;Y()&&e+$!==57&&(e+$!==84||47!==X()););return"/*"+K(t,j-1)+"*"+P(47===e?e:Y())}function se(e){for(;!J(X());)Y();return K(e,j)}var ae="-ms-",ce="-moz-",ue="-webkit-",de="comm",pe="rule",ve="decl",me="@keyframes";function be(e,t){for(var n="",i=A(e),l=0;l6)switch(I(e,t+1)){case 109:if(45!==I(e,t+4))break;case 102:return T(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+ce+(108==I(e,t+3)?"$3":"$2-$3"))+e;case 115:return~F(e,"stretch")?he(T(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==I(e,t+1))break;case 6444:switch(I(e,D(e)-3-(~F(e,"!important")&&10))){case 107:return T(e,":",":"+ue)+e;case 101:return T(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ue+(45===I(e,14)?"inline-":"")+"box$3$1"+ue+"$2$3$1"+ae+"$2box$3")+e}break;case 5936:switch(I(e,t+11)){case 114:return ue+e+ae+T(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ue+e+ae+T(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ue+e+ae+T(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ue+e+ae+e+e}return e}function ge(e){var t=A(e);return function(n,i,l,o){for(var r="",s=0;s-1&&!e.return)switch(e.type){case ve:e.return=he(e.value,e.length);break;case me:return be([Z(e,{value:T(e.value,"@","@"+ue)})],i);case pe:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return be([Z(e,{props:[T(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return be([Z(e,{props:[T(t,/:(plac\w+)/,":-webkit-input-$1")]}),Z(e,{props:[T(t,/:(plac\w+)/,":-moz-$1")]}),Z(e,{props:[T(t,/:(plac\w+)/,ae+"input-$1")]})],i)}return""}))}}function Ce(e){return te(Ee("",null,null,null,[""],e=ee(e),0,[0],e))}function Ee(e,t,n,i,l,o,r,s,a){for(var c=0,u=0,d=r,p=0,v=0,m=0,b=1,f=1,h=1,g=0,y="",_=l,C=o,E=i,k=y;f;)switch(m=g,g=Y()){case 40:if(108!=m&&58==k.charCodeAt(d-1)){-1!=F(k+=T(ne(g),"&","&\f"),"&\f")&&(h=-1);break}case 34:case 39:case 91:k+=ne(g);break;case 9:case 10:case 13:case 32:k+=ie(m);break;case 92:k+=le(Q()-1,7);continue;case 47:switch(X()){case 42:case 47:H(we(re(Y(),Q()),t,n),a);break;default:k+="/"}break;case 123*b:s[c++]=D(k)*h;case 125*b:case 59:case 0:switch(g){case 0:case 125:f=0;case 59+u:v>0&&D(k)-d&&H(v>32?Se(k+";",i,n,d-1):Se(T(k," ","")+";",i,n,d-2),a);break;case 59:k+=";";default:if(H(E=ke(k,t,n,c,u,l,s,y,_=[],C=[],d),o),123===g)if(0===u)Ee(k,t,E,E,_,o,d,s,C);else switch(p){case 100:case 109:case 115:Ee(e,E,E,i&&H(ke(e,E,E,0,0,l,s,y,l,_=[],d),C),l,C,d,s,i?_:C);break;default:Ee(k,E,E,E,[""],C,0,s,C)}}c=u=v=0,b=h=1,y=k="",d=r;break;case 58:d=1+D(k),v=m;default:if(b<1)if(123==g)--b;else if(125==g&&0==b++&&125==W())continue;switch(k+=P(g),g*b){case 38:h=u>0?1:(k+="\f",-1);break;case 44:s[c++]=(D(k)-1)*h,h=1;break;case 64:45===X()&&(k+=ne(Y())),p=X(),u=d=D(y=k+=se(Q())),g++;break;case 45:45===m&&2==D(k)&&(b=0)}}return o}function ke(e,t,n,i,l,o,r,s,a,c,u){for(var d=l-1,p=0===l?o:[""],v=A(p),m=0,b=0,f=0;m0?p[h]+" "+g:T(g,/&\f/g,p[h])))&&(a[f++]=y);return q(e,t,n,0===l?pe:s,a,c,u)}function we(e,t,n){return q(e,t,n,de,P($),R(e,2,-2),0)}function Se(e,t,n,i){return q(e,t,n,ve,R(e,0,i),R(e,i+1,-1),i)}var Oe=function(e,t,n){for(var i=0,l=0;i=l,l=X(),38===i&&12===l&&(t[n]=1),!J(l);)Y();return K(e,j)},xe=new WeakMap,Me=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||xe.get(n))&&!i){xe.set(e,!0);for(var l=[],o=function(e,t){return te(function(e,t){var n=-1,i=44;do{switch(J(i)){case 0:38===i&&12===X()&&(t[n]=1),e[n]+=Oe(j-1,t,n);break;case 2:e[n]+=ne(i);break;case 4:if(44===i){e[++n]=58===X()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=P(i)}}while(i=Y());return e}(ee(e),t))}(t,l),r=n.props,s=0,a=0;s=4;++i,l-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(l){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Re={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},De=/[A-Z]|^ms/g,Ae=/_EMO_([^_]+?)_([^]*?)_EMO_/g,He=function(e){return 45===e.charCodeAt(1)},ze=function(e){return null!=e&&"boolean"!=typeof e},Be=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=He(n=e)?n:n.replace(De,"-$&").toLowerCase()),t[e];var n}}(),Ue=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ae,(function(e,t,n){return $e={name:t,styles:n,next:$e},t}))}return 1===Re[e]||He(e)||"number"!=typeof t||0===t?t:t+"px"};function je(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return $e={name:n.name,styles:n.styles,next:$e},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)$e={name:i.name,styles:i.styles,next:$e},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var l=0;l=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n-1}function Ft(e){return Tt(e)?window.pageYOffset:e.scrollTop}function It(e,t){Tt(e)?window.scrollTo(0,t):e.scrollTop=t}function Rt(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Dt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mt,l=Ft(e),o=t-l,r=10,s=0;function a(){var t=Rt(s+=r,l,o,n);It(e,t),s=m)return{placement:"bottom",maxHeight:t};if(w>=m&&!r)return o&&Dt(a,S,x),{placement:"bottom",maxHeight:t};if(!r&&w>=i||r&&E>=i)return o&&Dt(a,S,x),{placement:"bottom",maxHeight:r?E-y:w-y};if("auto"===l||r){var M=t,L=r?C:k;return L>=i&&(M=Math.min(L-y-s.controlHeight,t)),{placement:"top",maxHeight:M}}if("bottom"===l)return o&&It(a,S),{placement:"bottom",maxHeight:t};break;case"top":if(C>=m)return{placement:"top",maxHeight:t};if(k>=m&&!r)return o&&Dt(a,O,x),{placement:"top",maxHeight:t};if(!r&&k>=i||r&&C>=i){var P=t;return(!r&&k>=i||r&&C>=i)&&(P=r?C-_:k-_),o&&Dt(a,O,x),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(l,'".'))}return c}var qt=function(e){return"auto"===e?"bottom":e},Zt=(0,x.createContext)({getPortalPlacement:null}),Wt=function(e){gt(n,e);var t=Ot(n);function n(){var e;mt(this,n);for(var i=arguments.length,l=new Array(i),o=0;o1?"s":""," ").concat(l.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,l=e.label,o=void 0===l?"":l,r=e.selectValue,s=e.isDisabled,a=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&r)return"value ".concat(o," focused, ").concat(c(r,n),".");if("menu"===t){var u=s?" disabled":"",d="".concat(a?"selected":"focused").concat(u);return"option ".concat(o," ").concat(d,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Vn=function(e){var t=e.ariaSelection,n=e.focusedOption,i=e.focusedValue,l=e.focusableOptions,o=e.isFocused,r=e.selectValue,s=e.selectProps,a=e.id,c=s.ariaLiveMessages,u=s.getOptionLabel,d=s.inputValue,p=s.isMulti,v=s.isOptionDisabled,m=s.isSearchable,b=s.menuIsOpen,f=s.options,h=s.screenReaderStatus,g=s.tabSelectsValue,y=s["aria-label"],_=s["aria-live"],C=(0,x.useMemo)((function(){return kt(kt({},Pn),c||{})}),[c]),E=(0,x.useMemo)((function(){var e,n="";if(t&&C.onChange){var i=t.option,l=t.options,o=t.removedValue,s=t.removedValues,a=t.value,c=o||i||(e=a,Array.isArray(e)?null:e),d=c?u(c):"",p=l||s||void 0,m=p?p.map(u):[],b=kt({isDisabled:c&&v(c,r),label:d,labels:m},t);n=C.onChange(b)}return n}),[t,C,v,r,u]),k=(0,x.useMemo)((function(){var e="",t=n||i,l=!!(n&&r&&r.includes(n));if(t&&C.onFocus){var o={focused:t,label:u(t),isDisabled:v(t,r),isSelected:l,options:f,context:t===n?"menu":"value",selectValue:r};e=C.onFocus(o)}return e}),[n,i,u,v,C,f,r]),w=(0,x.useMemo)((function(){var e="";if(b&&f.length&&C.onFilter){var t=h({count:l.length});e=C.onFilter({inputValue:d,resultsMessage:t})}return e}),[l,d,b,C,f,h]),S=(0,x.useMemo)((function(){var e="";if(C.guidance){var t=i?"value":b?"menu":"input";e=C.guidance({"aria-label":y,context:t,isDisabled:n&&v(n,r),isMulti:p,isSearchable:m,tabSelectsValue:g})}return e}),[y,n,i,p,v,m,b,C,r,g]),O="".concat(k," ").concat(w," ").concat(S),M=it(x.Fragment,null,it("span",{id:"aria-selection"},E),it("span",{id:"aria-context"},O)),L="initial-input-focus"===(null==t?void 0:t.action);return it(x.Fragment,null,it(Ln,{id:a},L&&M),it(Ln,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},o&&!L&&M))},Nn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Tn=new RegExp("["+Nn.map((function(e){return e.letters})).join("")+"]","g"),Fn={},In=0;In1?t-1:0),i=1;i0,b=d-p-u,f=!1;b>t&&r.current&&(i&&i(e),r.current=!1),m&&s.current&&(o&&o(e),s.current=!1),m&&t>b?(n&&!r.current&&n(e),v.scrollTop=d,f=!0,r.current=!0):!m&&-t>u&&(l&&!s.current&&l(e),v.scrollTop=0,f=!0,s.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,i,l,o]),d=(0,x.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,x.useCallback)((function(e){a.current=e.changedTouches[0].clientY}),[]),v=(0,x.useCallback)((function(e){var t=a.current-e.changedTouches[0].clientY;u(e,t)}),[u]),m=(0,x.useCallback)((function(e){if(e){var t=!!Ut&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",v,t)}}),[v,p,d]),b=(0,x.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",v,!1))}),[v,p,d]);return(0,x.useEffect)((function(){if(t){var e=c.current;return m(e),function(){b(e)}}}),[t,m,b]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),o=function(e){var t=e.isEnabled,n=e.accountForScrollbars,i=void 0===n||n,l=(0,x.useRef)({}),o=(0,x.useRef)(null),r=(0,x.useCallback)((function(e){if(Xn){var t=document.body,n=t&&t.style;if(i&&$n.forEach((function(e){var t=n&&n[e];l.current[e]=t})),i&&Qn<1){var o=parseInt(l.current.paddingRight,10)||0,r=document.body?document.body.clientWidth:0,s=window.innerWidth-r+o||0;Object.keys(Gn).forEach((function(e){var t=Gn[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(s,"px"))}t&&Yn()&&(t.addEventListener("touchmove",qn,Kn),e&&(e.addEventListener("touchstart",Wn,Kn),e.addEventListener("touchmove",Zn,Kn))),Qn+=1}}),[i]),s=(0,x.useCallback)((function(e){if(Xn){var t=document.body,n=t&&t.style;Qn=Math.max(Qn-1,0),i&&Qn<1&&$n.forEach((function(e){var t=l.current[e];n&&(n[e]=t)})),t&&Yn()&&(t.removeEventListener("touchmove",qn,Kn),e&&(e.removeEventListener("touchstart",Wn,Kn),e.removeEventListener("touchmove",Zn,Kn)))}}),[i]);return(0,x.useEffect)((function(){if(t){var e=o.current;return r(e),function(){s(e)}}}),[t,r,s]),function(e){o.current=e}}({isEnabled:n});return it(x.Fragment,null,n&&it("div",{onClick:Jn,css:ei}),t((function(e){l(e),o(e)})))}var ni={clearIndicator:pn,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,i=e.theme,l=i.colors,o=i.borderRadius,r=i.spacing;return{label:"control",alignItems:"center",backgroundColor:t?l.neutral5:l.neutral0,borderColor:t?l.neutral10:n?l.primary:l.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(l.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?l.primary:l.neutral30}}},dropdownIndicator:dn,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing.baseUnit,l=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?l.neutral10:l.neutral20,marginBottom:2*i,marginTop:2*i,width:1}},input:function(e){var t=e.isDisabled,n=e.value,i=e.theme,l=i.spacing,o=i.colors;return kt({margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,visibility:t?"hidden":"visible",color:o.neutral80,transform:n?"translateZ(0)":""},yn)},loadingIndicator:function(e){var t=e.isFocused,n=e.size,i=e.theme,l=i.colors,o=i.spacing.baseUnit;return{label:"loadingIndicator",color:t?l.neutral60:l.neutral20,display:"flex",padding:2*o,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:Qt,menu:function(e){var t,n=e.placement,i=e.theme,l=i.borderRadius,o=i.spacing,r=i.colors;return yt(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),yt(t,"backgroundColor",r.neutral0),yt(t,"borderRadius",l),yt(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),yt(t,"marginBottom",o.menuGutter),yt(t,"marginTop",o.menuGutter),yt(t,"position","absolute"),yt(t,"width","100%"),yt(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:i/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,i=t.colors,l=e.cropWithEllipsis;return{borderRadius:n/2,color:i.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:l||void 0===l?"ellipsis":void 0,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius,l=t.colors;return{alignItems:"center",borderRadius:i/2,backgroundColor:e.isFocused?l.dangerLight:void 0,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}}},noOptionsMessage:Xt,option:function(e){var t=e.isDisabled,n=e.isFocused,i=e.isSelected,l=e.theme,o=l.spacing,r=l.colors;return{label:"option",backgroundColor:i?r.primary:n?r.primary25:"transparent",color:t?r.neutral20:i?r.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:t?void 0:i?r.primary:r.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2}},singleValue:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing,l=n.colors;return{label:"singleValue",color:t?l.neutral40:l.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},valueContainer:function(e){var t=e.theme.spacing,n=e.isMulti,i=e.hasValue,l=e.selectProps.controlShouldRenderValue;return{alignItems:"center",display:n&&i&&l?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},ii={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},li={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:At(),captureMenuScroll:!At(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=kt({ignoreCase:!0,ignoreAccents:!0,stringify:Bn,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,l=n.ignoreAccents,o=n.stringify,r=n.trim,s=n.matchFrom,a=r?zn(t):t,c=r?zn(o(e)):o(e);return i&&(a=a.toLowerCase(),c=c.toLowerCase()),l&&(a=Hn(a),c=An(c)),"start"===s?c.substr(0,a.length)===a:c.indexOf(a)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function oi(e,t,n,i){return{type:"option",data:t,isDisabled:di(e,t,n),isSelected:pi(e,t,n),label:ci(e,t),value:ui(e,t),index:i}}function ri(e,t){return e.options.map((function(n,i){if("options"in n){var l=n.options.map((function(n,i){return oi(e,n,t,i)})).filter((function(t){return ai(e,t)}));return l.length>0?{type:"group",data:n,options:l,index:i}:void 0}var o=oi(e,n,t,i);return ai(e,o)?o:void 0})).filter(jt)}function si(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Sn(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function ai(e,t){var n=e.inputValue,i=void 0===n?"":n,l=t.data,o=t.isSelected,r=t.label,s=t.value;return(!mi(e)||!o)&&vi(e,{label:r,value:s,data:l},i)}var ci=function(e,t){return e.getOptionLabel(t)},ui=function(e,t){return e.getOptionValue(t)};function di(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function pi(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=ui(e,t);return n.some((function(t){return ui(e,t)===i}))}function vi(e,t,n){return!e.filterOption||e.filterOption(t,n)}var mi=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},bi=1,fi=function(e){gt(n,e);var t=Ot(n);function n(e){var i;return mt(this,n),(i=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.instancePrefix="",i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(e){i.controlRef=e},i.focusedOptionRef=null,i.getFocusedOptionRef=function(e){i.focusedOptionRef=e},i.menuListRef=null,i.getMenuListRef=function(e){i.menuListRef=e},i.inputRef=null,i.getInputRef=function(e){i.inputRef=e},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(e,t){var n=i.props,l=n.onChange,o=n.name;t.name=o,i.ariaOnChange(e,t),l(e,t)},i.setValue=function(e,t,n){var l=i.props,o=l.closeMenuOnSelect,r=l.isMulti,s=l.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(i.setState({inputIsHiddenAfterUpdate:!r}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(e,{action:t,option:n})},i.selectOption=function(e){var t=i.props,n=t.blurInputOnSelect,l=t.isMulti,o=t.name,r=i.state.selectValue,s=l&&i.isOptionSelected(e,r),a=i.isOptionDisabled(e,r);if(s){var c=i.getOptionValue(e);i.setValue(r.filter((function(e){return i.getOptionValue(e)!==c})),"deselect-option",e)}else{if(a)return void i.ariaOnChange(e,{action:"select-option",option:e,name:o});l?i.setValue([].concat(Sn(r),[e]),"select-option",e):i.setValue(e,"select-option")}n&&i.blurInput()},i.removeValue=function(e){var t=i.props.isMulti,n=i.state.selectValue,l=i.getOptionValue(e),o=n.filter((function(e){return i.getOptionValue(e)!==l})),r=$t(t,o,o[0]||null);i.onChange(r,{action:"remove-value",removedValue:e}),i.focusInput()},i.clearValue=function(){var e=i.state.selectValue;i.onChange($t(i.props.isMulti,[],null),{action:"clear",removedValues:e})},i.popValue=function(){var e=i.props.isMulti,t=i.state.selectValue,n=t[t.length-1],l=t.slice(0,t.length-1),o=$t(e,l,l[0]||null);i.onChange(o,{action:"pop-value",removedValue:n})},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n5||o>5}},i.onTouchEnd=function(e){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(e.target)&&i.menuListRef&&!i.menuListRef.contains(e.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(e){i.userIsDragging||i.onControlMouseDown(e)},i.onClearIndicatorTouchEnd=function(e){i.userIsDragging||i.onClearIndicatorMouseDown(e)},i.onDropdownIndicatorTouchEnd=function(e){i.userIsDragging||i.onDropdownIndicatorMouseDown(e)},i.handleInputChange=function(e){var t=i.props.inputValue,n=e.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(n,{action:"input-change",prevInputValue:t}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(e){i.props.onFocus&&i.props.onFocus(e),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(e){var t=i.props.inputValue;i.menuListRef&&i.menuListRef.contains(document.activeElement)?i.inputRef.focus():(i.props.onBlur&&i.props.onBlur(e),i.onInputChange("",{action:"input-blur",prevInputValue:t}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1}))},i.onOptionHover=function(e){i.blockOptionHover||i.state.focusedOption===e||i.setState({focusedOption:e})},i.shouldHideSelectedOptions=function(){return mi(i.props)},i.onKeyDown=function(e){var t=i.props,n=t.isMulti,l=t.backspaceRemovesValue,o=t.escapeClearsValue,r=t.inputValue,s=t.isClearable,a=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,v=i.state,m=v.focusedOption,b=v.focusedValue,f=v.selectValue;if(!(a||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(i.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||r)return;i.focusValue("previous");break;case"ArrowRight":if(!n||r)return;i.focusValue("next");break;case"Delete":case"Backspace":if(r)return;if(b)i.removeValue(b);else{if(!l)return;n?i.popValue():s&&i.clearValue()}break;case"Tab":if(i.isComposing)return;if(e.shiftKey||!c||!d||!m||p&&i.isOptionSelected(m,f))return;i.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(i.isComposing)return;i.selectOption(m);break}return;case"Escape":c?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:r}),i.onMenuClose()):s&&o&&i.clearValue();break;case" ":if(r)return;if(!c){i.openMenu("first");break}if(!m)return;i.selectOption(m);break;case"ArrowUp":c?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":c?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!c)return;i.focusOption("pageup");break;case"PageDown":if(!c)return;i.focusOption("pagedown");break;case"Home":if(!c)return;i.focusOption("first");break;case"End":if(!c)return;i.focusOption("last");break;default:return}e.preventDefault()}},i.instancePrefix="react-select-"+(i.props.instanceId||++bi),i.state.selectValue=Vt(e.value),i}return ft(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,i,l,o,r=this.props,s=r.isDisabled,a=r.menuIsOpen,c=this.state.isFocused;(c&&!s&&e.isDisabled||c&&a&&!e.menuIsOpen)&&this.focusInput(),c&&s&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,i=t.getBoundingClientRect(),l=n.getBoundingClientRect(),o=n.offsetHeight/3,l.bottom+o>i.bottom?It(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+o,t.scrollHeight)):l.top-o-1&&(r=s)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[r]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=n.indexOf(i);i||(l=-1);var o=n.length-1,r=-1;if(n.length){switch(e){case"previous":r=0===l?0:-1===l?o:l-1;break;case"next":l>-1&&l0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var l=0,o=i.indexOf(n);n||(o=-1),"up"===e?l=o>0?o-1:i.length-1:"down"===e?l=(o+1)%i.length:"pageup"===e?(l=o-t)<0&&(l=0):"pagedown"===e?(l=o+t)>i.length-1&&(l=i.length-1):"last"===e&&(l=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[l],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(ii):kt(kt({},ii),this.props.theme):ii}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getValue,l=this.selectOption,o=this.setValue,r=this.props,s=r.isMulti,a=r.isRtl,c=r.options;return{clearValue:e,cx:t,getStyles:n,getValue:i,hasValue:this.hasValue(),isMulti:s,isRtl:a,options:c,selectOption:l,selectProps:r,setValue:o,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return di(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return pi(this.props,e,t)}},{key:"filterOption",value:function(e,t){return vi(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,l=e.inputValue,o=e.tabIndex,r=e.form,s=e.menuIsOpen,a=this.getComponents().Input,u=this.state,d=u.inputIsHidden,p=u.ariaSelection,v=this.commonProps,m=i||this.getElementId("input"),b=kt(kt(kt({"aria-autocomplete":"list","aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},s&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==p?void 0:p.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?x.createElement(a,c({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:o,form:r,type:"text",value:l},b)):x.createElement(jn,c({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Mt,onFocus:this.onInputFocus,disabled:t,tabIndex:o,inputMode:"none",form:r,value:""},b))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,l=t.MultiValueLabel,o=t.MultiValueRemove,r=t.SingleValue,s=t.Placeholder,a=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,v=u.isMulti,m=u.inputValue,b=u.placeholder,f=this.state,h=f.selectValue,g=f.focusedValue,y=f.isFocused;if(!this.hasValue()||!d)return m?null:x.createElement(s,c({},a,{key:"placeholder",isDisabled:p,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return h.map((function(t,r){var s=t===g,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return x.createElement(n,c({},a,{components:{Container:i,Label:l,Remove:o},isFocused:s,isDisabled:p,key:u,index:r,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(m)return null;var _=h[0];return x.createElement(r,c({},a,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,l=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||l)return null;var r={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return x.createElement(e,c({},t,{innerProps:r,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,l=n.isLoading,o=this.state.isFocused;return e&&l?x.createElement(e,c({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:o})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,l=this.props.isDisabled,o=this.state.isFocused;return x.createElement(n,c({},i,{isDisabled:l,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return x.createElement(e,c({},t,{innerProps:l,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,l=t.Menu,o=t.MenuList,r=t.MenuPortal,s=t.LoadingMessage,a=t.NoOptionsMessage,u=t.Option,d=this.commonProps,p=this.state.focusedOption,v=this.props,m=v.captureMenuScroll,b=v.inputValue,f=v.isLoading,h=v.loadingMessage,g=v.minMenuHeight,y=v.maxMenuHeight,_=v.menuIsOpen,C=v.menuPlacement,E=v.menuPosition,k=v.menuPortalTarget,w=v.menuShouldBlockScroll,S=v.menuShouldScrollIntoView,O=v.noOptionsMessage,M=v.onMenuScrollToTop,L=v.onMenuScrollToBottom;if(!_)return null;var P,V=function(t,n){var i=t.type,l=t.data,o=t.isDisabled,r=t.isSelected,s=t.label,a=t.value,v=p===l,m=o?void 0:function(){return e.onOptionHover(l)},b=o?void 0:function(){return e.selectOption(l)},f="".concat(e.getElementId("option"),"-").concat(n),h={id:f,onClick:b,onMouseMove:m,onMouseOver:m,tabIndex:-1};return x.createElement(u,c({},d,{innerProps:h,data:l,isDisabled:o,isSelected:r,key:f,label:s,type:i,value:a,isFocused:v,innerRef:v?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())P=this.getCategorizedOptions().map((function(t){if("group"===t.type){var l=t.data,o=t.options,r=t.index,s="".concat(e.getElementId("group"),"-").concat(r),a="".concat(s,"-heading");return x.createElement(n,c({},d,{key:s,data:l,options:o,Heading:i,headingProps:{id:a,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return V(e,"".concat(r,"-").concat(e.index))})))}if("option"===t.type)return V(t,"".concat(t.index))}));else if(f){var N=h({inputValue:b});if(null===N)return null;P=x.createElement(s,d,N)}else{var T=O({inputValue:b});if(null===T)return null;P=x.createElement(a,d,T)}var F={minMenuHeight:g,maxMenuHeight:y,menuPlacement:C,menuPosition:E,menuShouldScrollIntoView:S},I=x.createElement(Wt,c({},d,F),(function(t){var n=t.ref,i=t.placerProps,r=i.placement,s=i.maxHeight;return x.createElement(l,c({},d,F,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:f,placement:r}),x.createElement(ti,{captureEnabled:m,onTopArrive:M,onBottomArrive:L,lockEnabled:w},(function(t){return x.createElement(o,c({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:f,maxHeight:s,focusedOption:p}),P)})))}));return k||"fixed"===E?x.createElement(r,c({},d,{appendTo:k,controlElement:this.controlRef,menuPlacement:C,menuPosition:E}),I):I}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,l=t.isMulti,o=t.name,r=this.state.selectValue;if(o&&!i){if(l){if(n){var s=r.map((function(t){return e.getOptionValue(t)})).join(n);return x.createElement("input",{name:o,type:"hidden",value:s})}var a=r.length>0?r.map((function(t,n){return x.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})})):x.createElement("input",{name:o,type:"hidden"});return x.createElement("div",null,a)}var c=r[0]?this.getOptionValue(r[0]):"";return x.createElement("input",{name:o,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,l=t.focusedValue,o=t.isFocused,r=t.selectValue,s=this.getFocusableOptions();return x.createElement(Vn,c({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:l,isFocused:o,selectValue:r,focusableOptions:s}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,l=e.ValueContainer,o=this.props,r=o.className,s=o.id,a=o.isDisabled,u=o.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return x.createElement(i,c({},p,{className:r,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:a,isFocused:d}),this.renderLiveRegion(),x.createElement(t,c({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:a,isFocused:d,menuIsOpen:u}),x.createElement(l,c({},p,{isDisabled:a}),this.renderPlaceholderOrValue(),this.renderInput()),x.createElement(n,c({},p,{isDisabled:a}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,l=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,r=t.isFocused,s=t.prevWasFocused,a=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,v=Vt(c),m={};if(n&&(c!==n.value||a!==n.options||u!==n.menuIsOpen||d!==n.inputValue)){var b=u?function(e,t){return si(ri(e,t))}(e,v):[],f=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i-1?n:t[0]}(t,b);m={selectValue:v,focusedOption:h,focusedValue:f,clearFocusValueOnUpdate:!1}}var g=null!=l&&e!==n?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},y=o,_=r&&s;return r&&!_&&(y={value:$t(p,v,v[0]||null),options:v,action:"initial-input-focus"},_=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(y=null),kt(kt(kt({},m),g),{},{prevProps:e,ariaSelection:y,prevWasFocused:_})}}]),n}(x.Component);fi.defaultProps=li;var hi=(0,x.forwardRef)((function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,i=e.defaultMenuIsOpen,l=void 0!==i&&i,o=e.defaultValue,r=void 0===o?null:o,s=e.inputValue,a=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,v=e.value,m=ct(e,wn),b=pt((0,x.useState)(void 0!==s?s:n),2),f=b[0],h=b[1],g=pt((0,x.useState)(void 0!==a?a:l),2),y=g[0],_=g[1],C=pt((0,x.useState)(void 0!==v?v:r),2),E=C[0],k=C[1],w=(0,x.useCallback)((function(e,t){"function"==typeof c&&c(e,t),k(e)}),[c]),S=(0,x.useCallback)((function(e,t){var n;"function"==typeof u&&(n=u(e,t)),h(void 0!==n?n:e)}),[u]),O=(0,x.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),M=(0,x.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),L=void 0!==s?s:f,P=void 0!==a?a:y,V=void 0!==v?v:E;return kt(kt({},m),{},{inputValue:L,menuIsOpen:P,onChange:w,onInputChange:S,onMenuClose:M,onMenuOpen:O,value:V})}(e);return x.createElement(fi,c({ref:t},n))})),gi=(x.Component,hi);function yi(n){var l,o,r;const{variables:s,userRole:c,setControlAtts:u}=n,d=null!==(l=null==c?void 0:c.restrictedRoles)&&void 0!==l?l:[],p=null!==(o=null==c?void 0:c.hideOnRestrictedRoles)&&void 0!==o&&o,v=null!==(r=null==s?void 0:s.user_roles)&&void 0!==r?r:[],m=p?(0,i.__)("Hide the block from","block-visibility"):(0,i.__)("Show the block to","block-visibility"),b=v.filter((e=>d.includes(e.value)));return(0,e.createElement)("div",{className:"visibility-control__container"},(0,e.createElement)("div",{className:"visibility-control restricted-roles"},(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)(// Translators: Whether the block is hidden or visible. -(0,i.__)("%s users with at least one of the selected roles.","block-visibility"),m)),(0,e.createElement)(gi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:v,value:b,placeholder:(0,i.__)("Select Role…","block-visibility"),onChange:e=>(e=>{const n=[];0!==e.length&&e.forEach((e=>{n.push(e.value)})),u("userRole",(0,t.assign)({...c},{restrictedRoles:n}))})(e),isMulti:!0})),(0,e.createElement)("div",{className:"visibility-control hide-on-restricted-roles"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide from selected roles","block-visibility"),checked:p,onChange:()=>u("userRole",(0,t.assign)({...c},{hideOnRestrictedRoles:!p}))})))}var _i=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),Ci=window.wp.date;function Ei(t){const{value:n,onDateChange:i,setPopoverOpen:l,includeTime:o}=t,r=(0,Ci.__experimentalGetSettings)(),s=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,e.createElement)(a.Popover,{className:"block-visibility__date-time-popover",onClose:l.bind(null,!1)},[o&&(0,e.createElement)(a.DateTimePicker,{currentDate:n,onChange:e=>{i(e),l(!1)},is12Hour:s}),!o&&(0,e.createElement)(a.DatePicker,{currentDate:n,onChange:e=>{i(e),l(!1)},is12Hour:s})])}var ki=(0,e.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(m.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"}));function wi(t){const{value:n,setPopoverOpen:l,onClearDateTime:o,includeTime:r}=t;let s=r?(0,i.__)("Select Date and Time…","block-visibility"):(0,i.__)("Select Date…","block-visibility");const c=(0,Ci.__experimentalGetSettings)();if(n){const e=r?`${c.formats.date} ${c.formats.time}`:`${c.formats.date}`;s=(0,Ci.format)(e,n)}return(0,e.createElement)("div",{className:v()("date-time__date-time-field",{"has-value":n})},(0,e.createElement)(a.Button,{icon:ki,title:(0,i.__)("Select date/time","block-visibility"),onClick:()=>l((e=>!e)),isLink:!0},(0,e.createElement)("span",null,s)),n&&(0,e.createElement)(a.Button,{icon:_i,className:"clear-date-time",title:(0,i.__)("Clear date/time","block-visibility"),onClick:()=>o("")}))}function Si(t){const{value:n,onChange:i,includeTime:l}=t,[o,r]=(0,e.useState)(!1);return(0,e.createElement)("div",{className:"date-time"},(0,e.createElement)(wi,{value:n,setPopoverOpen:r,onClearDateTime:()=>i(""),includeTime:l}),o&&(0,e.createElement)(Ei,{value:n,onDateChange:e=>i(e),setPopoverOpen:r,includeTime:l}))}function Oi(t){const{rule:n,fieldType:l,fieldName:o,valueType:r,options:s,placeholder:c,handleRuleChange:u,triggerReset:d,hasGroupedOptions:p}=t;if(!n.field&&"ruleField"!==l)return null;let m="";var b;if("ruleField"===l)m=null!==(b=null==n?void 0:n.field)&&void 0!==b?b:"";else if("subField"===l){var f,h;m=null!=n&&n.subFields?null!==(f=n.subFields[o])&&void 0!==f?f:"":null!==(h=null==n?void 0:n.subField)&&void 0!==h?h:""}else{var g;m=null!==(g=n["operatorField"===l?"operator":"value"])&&void 0!==g?g:""}if("select"===r||"multiSelect"===r){let e="",t=s;if(p){const e=[];s.forEach((t=>{e.push(...t.options)})),t=e}"multiSelect"===r?e=t.filter((e=>m.includes(e.value))):(e=t.filter((e=>e.value===m)),0!==e.length&&(e=e[0])),m=e}const y="field__"+l;if("select"===r||"multiSelect"===r){const t=c||(0,i.__)("Select…","block-visibility");return(0,e.createElement)(gi,{className:v()("block-visibility__react-select",y),classNamePrefix:"react-select",value:m,options:s,placeholder:t,onChange:e=>u(e,r,l,o,d),isMulti:"multiSelect"===r})}return"date"===r||"dateTime"===r?(0,e.createElement)(Si,{className:y,value:m,onChange:e=>u(e,r,l,o,d),includeTime:"dateTime"===r}):"toggle"===r?(0,e.createElement)(a.ToggleControl,{className:y,label:c,checked:m,onChange:()=>u(!m,r,l,o,d)}):(0,e.createElement)(a.TextControl,{className:y,type:r,min:"number"===r?0:"",value:m,placeholder:c,onChange:e=>u(e,"text",l,o,d)})}function xi(n){var l,o,r,s,c,u,d,p;const{rule:m,ruleIndex:b,ruleSet:f,ruleSetIndex:h,ruleSets:g,hideOnRuleSets:y,rulePlaceholder:_,ruleLabel:C,controlName:E,controlAtts:k,setControlAtts:w,groupedFields:S,allFields:O}=n;let x=O.filter((e=>e.value===m.field));0!==x.length&&(x=x[0]);const M=null!==(l=null===(o=x)||void 0===o?void 0:o.fields)&&void 0!==l?l:[],L=null!==(r=null===(s=x)||void 0===s?void 0:s.help)&&void 0!==r&&r,P=null!==(c=null===(u=x)||void 0===u?void 0:u.hasMultipleSubFields)&&void 0!==c&&c,V=null!==(d=null===(p=x)||void 0===p?void 0:p.hasSimplifiedLayout)&&void 0!==d&&d;let N=C;N||(N=()=>0===b?(0,i.sprintf)(// Translators: Whether the block is hidden or visible. -(0,i.__)("%s the block if","block-visibility"),y?(0,i.__)("Hide","block-visibility"):(0,i.__)("Show","block-visibility")):(0,i.__)("And if","block-visibility"));const T=(0,e.createElement)(a.Button,{label:f.rules.length<=1?(0,i.__)("Clear Rule","block-visibility"):(0,i.__)("Delete Rule","block-visibility"),icon:_i,className:"toolbar__delete",onClick:()=>(()=>{const e=[...g],n=f.rules.filter(((e,t)=>t!==b));e[h]=(0,t.assign)({...f},{rules:[...n]}),w(E,(0,t.assign)({...k},{ruleSets:[...e]}))})()}),F=function(e,n,i){let l,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];"select"===n?l=e.value:"multiSelect"===n?(l=[],0!==e.length&&e.forEach((e=>{l.push(e.value)}))):l=e;const s=[...g],a=[...f.rules];if("ruleField"===i)a[b]={field:l};else if("subField"===i)a[b]=P?(0,t.assign)({...a[b]},{subFields:{...a[b].subFields,[o]:l}}):(0,t.assign)({...a[b]},{subField:l}),r&&delete a[b].value;else{const e="operatorField"===i?"operator":"value";a[b]=(0,t.assign)({...a[b]},{[e]:l})}s[h]=(0,t.assign)({...f},{rules:a}),w(E,(0,t.assign)({...k},{ruleSets:[...s]}))};return(0,e.createElement)("div",{key:b,className:"rule"},(0,e.createElement)("div",{className:"rule__header"},(0,e.createElement)("span",null,N(b)),T),(0,e.createElement)("div",{className:"rule__fields"},(0,e.createElement)("div",{className:v()("fields-container",{"is-simplified":V})},(0,e.createElement)(Oi,{rule:m,fieldType:"ruleField",valueType:"select",options:S,placeholder:null!=_?_:(0,i.__)("Select Rule…","block-visibility"),handleRuleChange:F,hasGroupedOptions:!0}),M.map((t=>{var n,i,l,o,r,s,a,c;const u=null!==(n=null==t?void 0:t.displayConditions)&&void 0!==n?n:[];if(0!==u.length){const e=[];if(u.forEach((t=>{let n;if(P&&"subField"===t.dependencyType){var i,l;const e=null!==(i=null==m?void 0:m.subFields)&&void 0!==i?i:[];n=null!==(l=e[t.dependencyName])&&void 0!==l?l:""}else{var o;const e="operatorField"===t.dependencyType?"operator":"subField";n=null!==(o=m[e])&&void 0!==o?o:""}var r;"dynamic"===t.dependencyValues?0!==(null!==(r=null==t?void 0:t.options)&&void 0!==r?r:[]).filter((e=>e.value===n)).length&&e.push(!0):t.dependencyValues.includes(n)&&e.push(!0)})),0===e.length)return null}let d,p;const v=null!==(i=null==t?void 0:t.conditionalOptions)&&void 0!==i?i:[];var b,f;return 0!==v.length?v.forEach((e=>{let t;if(P&&"subField"===e.dependencyType){var n,i;const l=null!==(n=null==m?void 0:m.subFields)&&void 0!==n?n:[];t=null!==(i=l[e.dependencyName])&&void 0!==i?i:""}else{var l;t=null!==(l=m[e.dependencyType])&&void 0!==l?l:""}if("dynamic"===e.dependencyValues){var o,r,s,a;const n=(null!==(o=null==e?void 0:e.options)&&void 0!==o?o:[]).filter((e=>e.value===t));d=null!==(r=null===(s=n[0])||void 0===s?void 0:s.valueOptions)&&void 0!==r?r:[],p=null!==(a=null==e?void 0:e.placeholder)&&void 0!==a?a:""}else if(e.dependencyValues.includes(t)){var c,u;d=null!==(c=null==e?void 0:e.options)&&void 0!==c?c:[],p=null!==(u=null==e?void 0:e.placeholder)&&void 0!==u?u:""}})):(d=null!==(b=null==t?void 0:t.options)&&void 0!==b?b:[],p=null!==(f=null==t?void 0:t.placeholder)&&void 0!==f?f:""),(0,e.createElement)(Oi,{key:null!==(l=null==t?void 0:t.type)&&void 0!==l?l:"valueField",rule:m,fieldType:null!==(o=null==t?void 0:t.type)&&void 0!==o?o:"valueField",fieldName:null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"",valueType:null!==(s=null==t?void 0:t.valueType)&&void 0!==s?s:"text",options:d,placeholder:p,handleRuleChange:F,triggerReset:null!==(a=null==t?void 0:t.triggerReset)&&void 0!==a&&a,hasGroupedOptions:null!==(c=null==t?void 0:t.hasGroupedOptions)&&void 0!==c&&c})}))),L&&(0,e.createElement)("div",{className:"visibility-control__help"},x.help)))}function Mi(n){var l,o,r;const{ruleSet:s,ruleSetIndex:u,ruleSets:d,controlName:p,controlAtts:m,setControlAtts:h}=n,g=null!==(l=null==s?void 0:s.title)&&void 0!==l?l:"",y=g||(0,i.__)("Rule Set","block-visibility"),_=null===(o=null==s?void 0:s.enable)||void 0===o||o,C=null!==(r=null==s?void 0:s.rules)&&void 0!==r?r:[];0===C.length&&C.push({field:""});const E=(e,n)=>{const i={...s},l=[...d];i[e]=n,l[u]=i,h(p,(0,t.assign)({...m},{ruleSets:[...l]}))},k=(0,e.createElement)(a.DropdownMenu,{className:"settings-dropdown",label:(0,i.__)("Settings","block-visibility"),icon:b,popoverProps:{className:"block-visibility__control-popover control-settings",focusOnMount:"container"}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h3",null,(0,i.__)("Settings","block-visibility")),(0,e.createElement)(a.TextControl,{value:g,label:(0,i.__)("Rule set title","block-visibility"),placeholder:(0,i.__)("Rule Set","block-visibility"),onChange:e=>E("title",e)}),(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Enable rule set","block-visibility"),checked:_,onChange:()=>E("enable",!_)})))),w=d.length<=1?(0,i.__)("Clear rule set","block-visibility"):(0,i.__)("Remove rule set","block-visibility"),S=(0,e.createElement)(a.DropdownMenu,{className:"options-dropdown",label:(0,i.__)("Options","block-visibility"),icon:f,popoverProps:{focusOnMount:"container"}},(n=>{let{onClose:l}=n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"RuleSetOptionsTop"}),(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Tools","block-visibility")},(0,e.createElement)(a.Slot,{name:"RuleSetMoreSettingsTools"}),(0,e.createElement)(a.MenuItem,{className:"more-settings__tools-duplicate",onClick:()=>{!function(){const e=[...d,s];h(p,(0,t.assign)({...m},{ruleSets:[...e]}))}(),l()}},(0,i.__)("Duplicate","block-visibility"))),(0,e.createElement)(a.Slot,{name:"RuleSetOptionsMiddle"}),(0,e.createElement)(a.MenuGroup,null,(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=d.filter(((e,t)=>t!==u));h(p,(0,t.assign)({...m},{ruleSets:[...e]}))}(),l()}},w)),(0,e.createElement)(a.Slot,{name:"RuleSetOptionsBottom"}))}));let O=(0,e.createElement)("div",{className:"rule-set__fields"},(0,e.createElement)("div",{className:"rule-set__rules"},C.map(((t,i)=>(0,e.createElement)(xi,c({key:i,rule:t,ruleIndex:i,ruleSet:s,ruleSetIndex:u,ruleSets:d},n))))),(0,e.createElement)("div",{className:"rule-set__add-rule"},(0,e.createElement)(a.Button,{onClick:()=>function(){const e=[...d],n=[...s.rules,{field:""}];e[u]=(0,t.assign)({...s},{rules:n}),h(p,(0,t.assign)({...m},{ruleSets:[...e]}))}(),isLink:!0},(0,i.__)("Add rule","block-visibility"))));return _||(O=(0,e.createElement)(a.Disabled,null,O)),(0,e.createElement)("div",{key:u,className:v()("rule-sets__rule-set",{disabled:!_})},(0,e.createElement)("div",{className:"rule-set__header section-header"},(0,e.createElement)("span",{className:"section-header__title"},y),(0,e.createElement)("div",{className:"section-header__toolbar"},k,S)),O)}var Li=window.wp.coreData;function Pi(e){var t;let n=null!==(t=null==e?void 0:e.user_roles)&&void 0!==t?t:[];n=n.filter((e=>"logged-out"!==e.value));const o=(0,l.useSelect)((e=>{const t=e(Li.store).getUsers({per_page:-1}),n=[];return t&&0!==t.length&&t.forEach((e=>{const t={value:e.id,label:e.name};n.push(t)})),n}),[]),r=[{value:"any",label:(0,i.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,i.__)("Is none of the selected","block-visibility")}],s=[{value:"atLeastOne",label:(0,i.__)("Is at least one of the selected","block-visibility")},{value:"all",label:(0,i.__)("Is all of the selected","block-visibility")},{value:"none",label:(0,i.__)("Is none of the selected","block-visibility")}],a=(0,i.__)("Select Condition…","block-visibility");return[{value:"logged-out",label:(0,i.__)("User is logged-out","block-visibility"),group:"type"},{value:"logged-in",label:(0,i.__)("User is logged-in","block-visibility"),group:"type"},{value:"user-role",label:(0,i.__)("User's role","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:s,placeholder:a},{type:"valueField",valueType:"multiSelect",options:n,placeholder:(0,i.__)("Select User Roles…","block-visibility"),isMulti:!0}]},{value:"users",label:(0,i.__)("User","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:r,placeholder:a},{type:"valueField",valueType:"multiSelect",options:o,placeholder:(0,i.__)("Select Users…","block-visibility"),isMulti:!0}]}]}function Vi(n){var l,o,r,s;const{variables:u,userRole:d,setControlAtts:p}=n,v=null!==(l=null==d?void 0:d.hideOnRuleSets)&&void 0!==l&&l,m=null!==(o=null==d?void 0:d.ruleSets)&&void 0!==o?o:[];0===m.length&&m.push({enable:!0,rules:[{field:""}]});const b=function(e){const t=[{value:"type",label:(0,i.__)("User Rule Type","block-visibility")}],n=Pi(e),l=[];return t.forEach((e=>{var t,i;const o=null!==(t=null==e?void 0:e.value)&&void 0!==t?t:"",r=null!==(i=null==e?void 0:e.label)&&void 0!==i?i:"",s=n.filter((e=>e.group===o));l.push({value:o,label:r,options:s})})),l}(),f=Pi(u);return null!==(s=(null!==(r=null==u?void 0:u.current_users_roles)&&void 0!==r?r:[]).includes("administrator"))&&void 0!==s&&s?(0,e.createElement)("div",{className:"visibility-control__container"},(0,e.createElement)("div",{className:"visibility-control user-rule-sets"},(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)(// Translators: Whether the block is hidden or visible. -(0,i.__)("%s the block if at least one user rule set applies.","block-visibility"),v?(0,i.__)("Hide","block-visibility"):(0,i.__)("Show","block-visibility"))),(0,e.createElement)("div",{className:"rule-sets"},m.map(((t,i)=>(0,e.createElement)(Mi,c({key:i,ruleSet:t,ruleSetIndex:i,ruleSets:m,groupedFields:b,allFields:f,controlName:"userRole",controlAtts:d,hideOnRuleSets:v},n))))),(0,e.createElement)("div",{className:"rule-sets__add-rule-set"},(0,e.createElement)(a.Button,{onClick:()=>(()=>{const e=[...m,{enable:!0,rules:[{field:""}]}];p("userRole",(0,t.assign)({...d},{ruleSets:[...e]}))})(),isSecondary:!0},(0,i.__)("Add rule set","block-visibility"))),(0,e.createElement)("div",{className:"hide-on-rule-sets"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide when rules apply","block-visibility"),checked:v,onChange:()=>p("userRole",(0,t.assign)({...d},{hideOnRuleSets:!v}))})))):(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("The User rule sets option can only be configured by website Administrators. Please choose another option.","block-visibility"))}function Ni(n){var o,r,s,c;const{variables:u,userRole:d,setControlAtts:p}=n,v=null!==(o=null==d?void 0:d.restrictedUsers)&&void 0!==o?o:[],m=null!==(r=null==d?void 0:d.hideOnRestrictedUsers)&&void 0!==r&&r,b=(0,l.useSelect)((e=>{const t=e(Li.store).getUsers({per_page:-1}),n=[];return t&&0!==t.length&&t.forEach((e=>{const t={value:e.id,label:e.name};n.push(t)})),n}),[]);if(null===(c=(null!==(s=null==u?void 0:u.current_users_roles)&&void 0!==s?s:[]).includes("administrator"))||void 0===c||!c)return(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("The Users option can only be configured by website Administrators. Please choose another option.","block-visibility"));const f=m?(0,i.__)("Hide the block from","block-visibility"):(0,i.__)("Show the block to","block-visibility"),h=b.filter((e=>v.includes(e.value)));return(0,e.createElement)("div",{className:"visibility-control__container"},(0,e.createElement)("div",{className:"visibility-control restricted-users"},(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)(// Translators: Whether the block is hidden or visible. -(0,i.__)("%s the selected users.","block-visibility"),f)),(0,e.createElement)(gi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:b,value:h,placeholder:(0,i.__)("Select Users…","block-visibility"),onChange:e=>(e=>{const n=[];0!==e.length&&e.forEach((e=>{n.push(e.value)})),p("userRole",(0,t.assign)({...d},{restrictedUsers:n}))})(e),isMulti:!0,isLoading:0===b.length})),(0,e.createElement)("div",{className:"visibility-control hide-on-restricted-users"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide from selected users","block-visibility"),checked:m,onChange:()=>p("userRole",(0,t.assign)({...d},{hideOnRestrictedUsers:!m}))})))}function Ti(e,n,i){let l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e||0===e.length)return!1;const o=e.visibility_controls,r=(0,t.has)(o,n);if(!r)return l;const s=(0,t.has)(o[n],i);return s?o[n][i]:l}function Fi(e,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||0===e.length)return!1;const l=e.plugin_settings,o=(0,t.has)(l,n);return o?l[n]:i}var Ii=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function Ri(t){const{message:n,subMessage:l,link:o,position:r}=t,s=null!=r?r:"middle left";return(0,e.createElement)("div",{className:"information-popover"},(0,e.createElement)(a.DropdownMenu,{label:(0,i.__)("More Information","block-visibility"),icon:Ii,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:s,noArrow:!1}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,n),l&&(0,e.createElement)("p",null,l),o&&(0,e.createElement)(a.ExternalLink,{href:o},(0,i.__)("Learn More","block-visibility"))))))}function Di(n){var l,o,r,s,u,d,p;const{settings:v,variables:m,enabledControls:b,setControlAtts:f,controlSetAtts:h}=n,g=b.some((e=>"visibility_by_role"===e.settingSlug)),y=null!==(l=null==h?void 0:h.controls.hasOwnProperty("userRole"))&&void 0!==l&&l;if(!g||!y)return null;const _=null!==(o=null==h||null===(r=h.controls)||void 0===r?void 0:r.userRole)&&void 0!==o?o:{},C=null!==(s=null==_?void 0:_.visibilityByRole)&&void 0!==s?s:"public",E=null!==(u=null==m?void 0:m.plugin_variables.settings_url)&&void 0!==u?u:"",k=Ti(v,"visibility_by_role","enable_user_roles"),w=Ti(v,"visibility_by_role","enable_users"),S=Ti(v,"visibility_by_role","enable_user_rule_sets");let O=[{label:(0,i.__)("Public","block-visibility"),value:"public"},{label:(0,i.__)("Logged-out","block-visibility"),value:"logged-out"},{label:(0,i.__)("Logged-in","block-visibility"),value:"logged-in"},{label:(0,i.__)("User roles","block-visibility"),value:"user-role"},{label:(0,i.__)("Users","block-visibility"),value:"users"},{label:(0,i.__)("User rule sets","block-visibility"),value:"user-rule-sets"}];const x=[{label:(0,i.__)("Block is visible to everyone.","block-visibility"),value:"public"},{label:(0,i.__)("Block is only visible to logged-out users.","block-visibility"),value:"logged-out"},{label:(0,i.__)("Block is only visible to logged-in users.","block-visibility"),value:"logged-in"}];k||(O=O.filter((e=>"user-role"!==e.value))),w||(O=O.filter((e=>"users"!==e.value))),S||(O=O.filter((e=>"user-rule-sets"!==e.value)));const M=O.filter((e=>e.value===C)),L=null!==(d=null===(p=x.filter((e=>e.value===C))[0])||void 0===p?void 0:p.label)&&void 0!==d?d:"";return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group user-role-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)("span",null,(0,i.__)("User Role","block-visibility")),(0,e.createElement)(Ri,{message:(0,i.__)("The User Role control allows you to conditionally display the block based on the current user's role and/or specific users.","block-visibility-pro"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__group-fields"},(0,e.createElement)("div",{className:"visibility-control visibility-by-role"},(0,e.createElement)(gi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:O,value:M,onChange:e=>f("userRole",(0,t.assign)({..._},{visibilityByRole:e.value}))}),L&&(0,e.createElement)("div",{className:"visibility-control__help"},L)),"user-role"===C&&k&&(0,e.createElement)(yi,c({variables:m,userRole:_,setControlAtts:f},n)),"users"===C&&w&&(0,e.createElement)(Ni,c({variables:m,userRole:_,setControlAtts:f},n)),"user-rule-sets"===C&&S&&(0,e.createElement)(Vi,c({variables:m,userRole:_,setControlAtts:f},n))),!O.some((e=>e.value===C))&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,e.createInterpolateElement)((0,i.__)("The User Role option that was previously selected has been disabled. Choose another option or update the Visibility Control settings.","block-visibility"),{a:(0,e.createElement)("a",{href:E+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function Ai(t){const{label:n,currentDate:i,onDateChange:l,isOpen:o,highlightedDate:r}=t,s=(0,Ci.__experimentalGetSettings)(),c=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,e.createElement)(a.Popover,{className:"block-visibility__date-time-popover",onClose:o.bind(null,!1)},(0,e.createElement)("div",{className:"date-time-header"},(0,e.createElement)("span",null,n)),(0,e.createElement)(a.DateTimePicker,{currentDate:i,onChange:e=>l(e),is12Hour:c,events:[{date:r}]}))}function Hi(t){const{label:n,title:l,hasDateTime:o,onOpenPopover:r,onClearDateTime:s}=t;return(0,e.createElement)("div",{className:"schedule__date-time-field"},(0,e.createElement)(a.Button,{icon:ki,title:l,onClick:()=>r((e=>!e)),isLink:!0},(0,e.createElement)("span",null,n)),o&&(0,e.createElement)(a.Button,{icon:_i,className:"clear-date-time",title:(0,i.__)("Clear date/time","block-visibility"),onClick:()=>s()}))}function zi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,i.__)("No time selected","block-visibility");const n=(0,Ci.__experimentalGetSettings)();let l=t;return e&&(l=(0,Ci.format)(`${n.formats.date} ${n.formats.time}`,e)),l}const Bi=(0,a.withFilters)("blockVisibility.addDateTimeScheduleControls")((t=>(0,e.createElement)(e.Fragment,null)));function Ui(n){var l,o,r,s;const{type:u,dateTime:d,schedules:p,scheduleIndex:m,scheduleAtts:h,controlSetAtts:g,setControlAtts:y,hideOnSchedules:_}=n,[C,E]=(0,e.useState)(!1),[k,w]=(0,e.useState)(!1),S="single"===u?u+"-"+m:u+"-"+(null==g?void 0:g.id)+"-"+m,O=null!==(l=null==h?void 0:h.title)&&void 0!==l?l:"",x=null===(o=null==h?void 0:h.enable)||void 0===o||o,M=null!==(r=null==h?void 0:h.start)&&void 0!==r?r:null,L=null!==(s=null==h?void 0:h.end)&&void 0!==s?s:null,P=new Date((new Date).setHours(0,0,0,0)),V=O||(0,i.__)("Schedule","block-visibility"),N=zi(M,(0,i.__)("Now","block-visibility")),T=zi(L,(0,i.__)("Never","block-visibility"));let F=!1;M&&L&&(F=M>=L);const I=(e,n)=>{const i={...h},l=[...p];i[e]=n,l[m]=i,y("dateTime",(0,t.assign)({...d},{schedules:[...l]}))},R=(0,e.createElement)(a.DropdownMenu,{className:"settings-dropdown",label:(0,i.__)("Settings","block-visibility"),icon:b,popoverProps:{className:"block-visibility__control-popover control-settings",focusOnMount:"container"}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h3",null,(0,i.__)("Settings","block-visibility")),(0,e.createElement)(a.TextControl,{value:O,label:(0,i.__)("Schedule title","block-visibility"),placeholder:(0,i.__)("Schedule","block-visibility"),onChange:e=>I("title",e)}),(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Enable schedule","block-visibility"),checked:x,onChange:()=>I("enable",!x)}),(0,e.createElement)(a.Slot,{name:"DateTimeScheduleControlsSettings-"+S})))),D=p.length<=1?(0,i.__)("Clear schedule","block-visibility"):(0,i.__)("Delete schedule","block-visibility"),A=(0,e.createElement)(a.DropdownMenu,{className:"options-dropdown",label:(0,i.__)("Options","block-visibility"),icon:f,popoverProps:{focusOnMount:"container"}},(n=>{let{onClose:l}=n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"ScheduleOptionsTop"}),(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Tools","block-visibility")},(0,e.createElement)(a.Slot,{name:"ScheduleOptionsTools"}),(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=[...p,h];y("dateTime",(0,t.assign)({...d},{schedules:[...e]}))}(),l()}},(0,i.__)("Duplicate","block-visibility"))),(0,e.createElement)(a.Slot,{name:"ScheduleOptionsMiddle"}),(0,e.createElement)(a.MenuGroup,null,(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=p.filter(((e,t)=>t!==m));y("dateTime",(0,t.assign)({...d},{schedules:[...e]}))}(),l()}},D)),(0,e.createElement)(a.Slot,{name:"ScheduleOptionsBottom"}))}));let H=(0,e.createElement)("div",{className:"schedule__fields"},(0,e.createElement)(a.Slot,{name:"DateTimeScheduleControlsTop-"+S}),(0,e.createElement)("div",{className:"fields__date-time"},(0,e.createElement)("div",{className:"date-time__schedule-start"},(0,e.createElement)("div",{className:"visibility-control__label"},_?(0,i.__)("Stop showing","block-visibility"):(0,i.__)("Start showing","block-visibility")),(0,e.createElement)(Hi,{label:N,title:(0,i.__)("Choose a start date/time","block-visibility"),hasDateTime:M,onOpenPopover:E,onClearDateTime:()=>I("start","")})),C&&(0,e.createElement)(Ai,{label:(0,i.__)("Start Date/Time","block-visibility"),currentDate:((e,t,n)=>{if(e)return e;const i=t?new Date(t):new Date(n);return t&&(i.setHours(0,0,0,0),i.setDate(i.getDate()-1)),i})(M,L,P),onDateChange:e=>I("start",e),isOpen:E,highlightedDate:L}),(0,e.createElement)("div",{className:"date-time__schedule-end"},(0,e.createElement)("div",{className:"visibility-control__label"},_?(0,i.__)("Resume showing","block-visibility"):(0,i.__)("Stop showing","block-visibility")),(0,e.createElement)(Hi,{label:T,title:(0,i.__)("Choose an end date/time","block-visibility"),hasDateTime:L,onOpenPopover:w,onClearDateTime:()=>I("end","")})),k&&(0,e.createElement)(Ai,{label:(0,i.__)("End Date/Time","block-visibility"),currentDate:((e,t,n)=>{if(t)return t;const i=e?new Date(e):new Date(n);return i.setHours(0,0,0,0),i.setDate(i.getDate()+1),i})(M,L,P),onDateChange:e=>I("end",e),isOpen:w,highlightedDate:M}),F&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("The start time is after the stop time. Please fix for date/time settings to function properly.","block-visibility"))),(0,e.createElement)(a.Slot,{name:"DateTimeScheduleControlsBottom-"+S}));return x||(H=(0,e.createElement)(a.Disabled,null,H)),(0,e.createElement)("div",{className:v()("schedules__schedule",{disabled:!x})},(0,e.createElement)("div",{className:"schedule__header section-header"},(0,e.createElement)("span",{className:"section-header__title"},V),(0,e.createElement)("div",{className:"section-header__toolbar"},R,A)),H,(0,e.createElement)(Bi,c({uniqueIndex:S},n)))}function ji(n){var l,o,r,s,u;const{enabledControls:d,controlSetAtts:p,setControlAtts:v}=n,m=d.some((e=>"date_time"===e.settingSlug)),b=null!==(l=null==p?void 0:p.controls.hasOwnProperty("dateTime"))&&void 0!==l&&l;if(!m||!b)return null;const f=null!==(o=null==p||null===(r=p.controls)||void 0===r?void 0:r.dateTime)&&void 0!==o?o:{},h=null!==(s=null==f?void 0:f.hideOnSchedules)&&void 0!==s&&s;let g=null!==(u=null==f?void 0:f.schedules)&&void 0!==u?u:[];if(0===g.length){const e={enable:!0,start:"",end:""};f.schedules=[e],g=f.schedules}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group date-time-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)("span",null,(0,i.__)("Date & Time","block-visibility")),(0,e.createElement)(Ri,{message:(0,i.__)("The Date & Time control allows you to automatically schedule when the block should be visible on your website.","block-visibility-pro"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-date-time-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)(// Translators: Whether the block is hidden or visible. -(0,i.__)("%s the block if at least one schedule applies.","block-visibility"),h?(0,i.__)("Hide","block-visibility"):(0,i.__)("Show","block-visibility"))),(0,e.createElement)("div",{className:"date-time-control__schedules"},g.map(((t,i)=>(0,e.createElement)(Ui,c({key:i,dateTime:f,schedules:g,scheduleIndex:i,scheduleAtts:t,hideOnSchedules:h},n))))),(0,e.createElement)("div",{className:"date-time-control__add-schedule"},(0,e.createElement)(a.Button,{onClick:()=>(()=>{const e=[...g];e.push({enable:!0,start:"",end:""}),v("dateTime",(0,t.assign)({...f},{schedules:[...e]}))})(),isSecondary:!0},(0,i.__)("Add schedule","block-visibility"))),(0,e.createElement)("div",{className:"date-time-control__hide-on-schedules"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide when schedules apply","block-visibility"),checked:h,onChange:()=>v("dateTime",(0,t.assign)({...f},{hideOnSchedules:!h}))})),(0,e.createElement)(a.Slot,{name:"DateTimeControls"})),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function $i(n){var l,o,r,s,c,u,d,p,v,m,b,f;const{name:h,settings:g,enabledControls:y,controlSetAtts:_,setControlAtts:C}=n,E=y.some((e=>"screen_size"===e.settingSlug)),k=null!==(l=null==_?void 0:_.controls.hasOwnProperty("screenSize"))&&void 0!==l&&l;if(!E||!k)return null;const w=null!==(o=null==_||null===(r=_.controls)||void 0===r?void 0:r.screenSize)&&void 0!==o?o:{},S=null!==(s=null==w?void 0:w.hideOnScreenSize)&&void 0!==s?s:{},O=Ti(g,"screen_size","enable_advanced_controls",!1),x=null!==(c=null==g||null===(u=g.visibility_controls)||void 0===u||null===(d=u.screen_size)||void 0===d?void 0:d.controls)&&void 0!==c?c:{extraLarge:!0,large:!0,medium:!0,small:!0,extraSmall:!0},M=(e,n)=>C("screenSize",(0,t.assign)({...w},{hideOnScreenSize:(0,t.assign)({...S},{[e]:n})})),L=null!==(p=null==S?void 0:S.extraLarge)&&void 0!==p&&p,P=null!==(v=null==S?void 0:S.large)&&void 0!==v&&v,V=null!==(m=null==S?void 0:S.medium)&&void 0!==m&&m,N=null!==(b=null==S?void 0:S.small)&&void 0!==b&&b,T=null!==(f=null==S?void 0:S.extraSmall)&&void 0!==f&&f;let F=(0,e.createElement)(e.Fragment,null,O&&x.extra_large&&(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide on large desktop","block-visibility"),checked:L,onChange:()=>{M("extraLarge",!L)}}),x.large&&(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide on desktop","block-visibility"),checked:P,onChange:()=>{M("large",!P)}}),x.medium&&(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide on tablet","block-visibility"),checked:V,onChange:()=>{M("medium",!V)}}),x.small&&(0,e.createElement)(a.ToggleControl,{label:[!O&&(0,i.__)("Hide on mobile","block-visibility"),O&&(0,i.__)("Hide on mobile (landscape)","block-visibility")],checked:N,onChange:()=>{M("small",!N)}}),O&&x.extra_small&&(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide on mobile (portrait)","block-visibility"),checked:T,onChange:()=>{M("extraSmall",!T)}}));const I="core/shortcode"===h||"core/html"===h;return I&&(F=(0,e.createElement)(a.Disabled,null,F)),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group screen-size-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)("span",null,(0,i.__)("Screen Size","block-visibility")),(0,e.createElement)(Ri,{message:(0,i.__)("The Screen Size control allows you to conditionally display the block based on the width of the current screen.","block-visibility-pro"),link:"https://blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),F,I&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,e.createInterpolateElement)((0,i.__)("The Screen Size control is unfortunately not compatible with this block type. For more information, and a workaround, visit the Knowledge Base.","block-visibility"),{a:(0,e.createElement)(a.ExternalLink,{href:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=editor&utm_campaign=plugin_referrals#limitations",target:"_blank",rel:"noreferrer"})}))),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function Gi(n){var l,o,r,s,c,u;const{enabledControls:d,controlSetAtts:p,setControlAtts:v}=n,m=d.some((e=>"query_string"===e.settingSlug)),b=null!==(l=null==p?void 0:p.controls.hasOwnProperty("queryString"))&&void 0!==l&&l;if(!m||!b)return null;const f=null!==(o=null==p||null===(r=p.controls)||void 0===r?void 0:r.queryString)&&void 0!==o?o:{},h=null!==(s=null==f?void 0:f.queryStringAny)&&void 0!==s?s:"",g=null!==(c=null==f?void 0:f.queryStringAll)&&void 0!==c?c:"",y=null!==(u=null==f?void 0:f.queryStringNot)&&void 0!==u?u:"",_=(e,n)=>v("queryString",(0,t.assign)({...f},{[e]:n}));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group query-string-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)("span",null,(0,i.__)("Query String","block-visibility")),(0,e.createElement)(Ri,{message:(0,i.__)("The Query String control allows you to configure block visibility based on URL query strings.","block-visibility-pro"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-query-string-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.__)("Enter one URL query string per line.","block-visibility")),(0,e.createElement)(a.TextareaControl,{label:(0,i.__)("Required Queries (Any)","block-visibility"),help:(0,i.__)("Only visible when least one of the provided URL query strings is present.","block-visibility"),value:h,onChange:e=>_("queryStringAny",e),rows:"2"}),(0,e.createElement)(a.TextareaControl,{label:(0,i.__)("Required Queries (All)","block-visibility"),help:(0,e.createInterpolateElement)((0,i.__)("Only visible when all of the provided URL query strings are present.","block-visibility"),{strong:(0,e.createElement)("strong",null)}),value:g,onChange:e=>_("queryStringAll",e),rows:"2"}),(0,e.createElement)(a.TextareaControl,{label:(0,i.__)("Required Queries (Not)","block-visibility"),help:(0,i.__)("Hide when at least one of the provided URL query strings is present.","block-visibility"),value:y,onChange:e=>_("queryStringNot",e),rows:"2"})),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function qi(e){var t,n,l;const o=null!==(t=null==e||null===(n=e.integrations)||void 0===n||null===(l=n.acf)||void 0===l?void 0:l.fields)&&void 0!==t?t:[],r=[],s=[{value:"notEmpty",label:(0,i.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,i.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,i.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,i.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,i.__)("Value contains","block-visibility")},{value:"notContain",label:(0,i.__)("Value does not contain","block-visibility")}];return 0!==o.length&&o.forEach((e=>{var t,n;const l=null!==(t=null==e?void 0:e.key)&&void 0!==t?t:"",o=null!==(n=null==e?void 0:e.fields)&&void 0!==n?n:[];0!==o.length&&o.forEach((e=>{var t,n;const o=null!==(t=null==e?void 0:e.key)&&void 0!==t?t:"",a=null!==(n=null==e?void 0:e.label)&&void 0!==n?n:"";r.push({value:o,label:a,group:l,fields:[{type:"subField",name:"isUserField",valueType:"toggle",placeholder:(0,i.__)("Evaluate as user field","block-visibility")},{type:"operatorField",valueType:"select",options:s,placeholder:(0,i.__)("Select Condition…","block-visibility")},{type:"valueField",valueType:"text",placeholder:(0,i.__)("Enter Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","contains","notContain"]}]}]})}))})),r}function Zi(n){var l,o,r,s,u,d,p,v,m,b,f,g;const{variables:y,enabledControls:_,controlSetAtts:E,setControlAtts:k}=n,w=null!==(l=null==y||null===(o=y.integrations)||void 0===o||null===(r=o.acf)||void 0===r?void 0:r.active)&&void 0!==l&&l,S=_.some((e=>"acf"===e.settingSlug)),O=null!==(s=null==E?void 0:E.controls.hasOwnProperty("acf"))&&void 0!==s&&s;if(!S||!O||!w)return null;const x=null!==(u=null==y||null===(d=y.integrations)||void 0===d||null===(p=d.acf)||void 0===p?void 0:p.fields)&&void 0!==u?u:[],M=null!==(v=null==E||null===(m=E.controls)||void 0===m?void 0:m.acf)&&void 0!==v?v:{},L=null!==(b=null==M?void 0:M.hideOnRuleSets)&&void 0!==b&&b;let P=null!==(f=null==M?void 0:M.ruleSets)&&void 0!==f?f:[];if(0===P.length)P.push({enable:!0,rules:[{field:""}]});else if(1===P.length&&(null===(g=P[0])||void 0===g||!g.rules)){const e=P[0];0!==e.length&&e.forEach((e=>{var t;const n=null!==(t=null==e?void 0:e.operator)&&void 0!==t?t:"";e.operator="!=empty"===n?"notEmpty":"==empty"===n?"empty":"=="===n?"equal":"!="===n?"notEqual":"==contains"===n?"contains":"!=contains"===n?"notContain":""})),P=[{enable:!0,rules:e}]}const V=function(e){const t=function(e){var t,n,i;const l=null!==(t=null==e||null===(n=e.integrations)||void 0===n||null===(i=n.acf)||void 0===i?void 0:i.fields)&&void 0!==t?t:[],o=[];return 0!==l.length&&l.forEach((e=>{var t,n;const i=null!==(t=null==e?void 0:e.key)&&void 0!==t?t:"",l=null!==(n=null==e?void 0:e.title)&&void 0!==n?n:"";o.push({value:i,label:l})})),o}(e),n=qi(e),i=[];return t.forEach((e=>{var t,l;const o=null!==(t=null==e?void 0:e.value)&&void 0!==t?t:"",r=null!==(l=null==e?void 0:e.label)&&void 0!==l?l:"",s=n.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(y),N=qi(y);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group acf-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)(h,{icon:C.acf}),(0,e.createElement)("span",null,(0,i.__)("Advanced Custom Fields","block-visibility")),(0,e.createElement)(Ri,{message:(0,i.__)("The Advanced Custom Fields (ACF) control allows you configure block visibility based on a variety of field-related rules, which form rule sets.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-advanced-custom-fields-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)(// Translators: Whether the block is hidden or visible. -(0,i.__)("%s the block if at least one rule set applies. Rules targeting user fields will fail if the current user is not logged in.","block-visibility"),L?(0,i.__)("Hide","block-visibility"):(0,i.__)("Show","block-visibility"))),0===x.length&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("It does not appear that your website contains any published fields yet.","block-visibility")),(0,e.createElement)("div",{className:"rule-sets"},P.map(((t,l)=>(0,e.createElement)(Mi,c({key:l,ruleSet:t,ruleSetIndex:l,ruleSets:P,groupedFields:V,allFields:N,controlName:"acf",controlAtts:M,hideOnRuleSets:L,rulePlaceholder:(0,i.__)("Select Field…","block-visibility")},n))))),(0,e.createElement)("div",{className:"rule-sets__add-rule-set"},(0,e.createElement)(a.Button,{onClick:()=>(()=>{const e=[...P,{enable:!0,rules:[{field:""}]}];k("acf",(0,t.assign)({...M},{ruleSets:[...e]}))})(),isSecondary:!0},(0,i.__)("Add rule set","block-visibility"))),(0,e.createElement)("div",{className:"hide-on-rule-sets"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide when rules apply","block-visibility"),checked:L,onChange:()=>k("acf",(0,t.assign)({...M},{hideOnRuleSets:!L}))}))),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function Wi(n){var l,o,r,s,c,u,d,p,v,m,b,f,g,y,_,E;const{variables:k,enabledControls:w,controlSetAtts:S,setControlAtts:O}=n,x=null!==(l=null==k||null===(o=k.integrations)||void 0===o||null===(r=o.wp_fusion)||void 0===r?void 0:r.active)&&void 0!==l&&l,M=w.some((e=>"wp_fusion"===e.settingSlug)),L=null!==(s=null==S?void 0:S.controls.hasOwnProperty("wpFusion"))&&void 0!==s&&s;if(!M||!L||!x)return null;const P=null!==(c=null==S?void 0:S.controls.hasOwnProperty("userRole"))&&void 0!==c&&c,V=null!==(u=null==S||null===(d=S.controls)||void 0===d||null===(p=d.userRole)||void 0===p?void 0:p.visibilityByRole)&&void 0!==u?u:"public",N=null!==(v=null==k||null===(m=k.integrations)||void 0===m||null===(b=m.wp_fusion)||void 0===b?void 0:b.tags)&&void 0!==v?v:[],T=e=>N.filter((t=>e.includes(t.value))),F=null!==(f=null==S||null===(g=S.controls)||void 0===g?void 0:g.wpFusion)&&void 0!==f?f:{},I=T(null!==(y=null==F?void 0:F.tagsAny)&&void 0!==y?y:[]),R=T(null!==(_=null==F?void 0:F.tagsAll)&&void 0!==_?_:[]),D=T(null!==(E=null==F?void 0:F.tagsNot)&&void 0!==E?E:[]),A=(e,n)=>{const i=[];0!==n.length&&n.forEach((e=>{i.push(e.value)})),O("wpFusion",(0,t.assign)({...F},{[e]:i}))};let H=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control wp-fusion__tags-any"},(0,e.createElement)("div",{className:"visibility-control__label"},(0,i.__)("Required Tags (Any)","block-visibility")),(0,e.createElement)(gi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:N,value:I,placeholder:(0,i.__)("Select Tag…","block-visibility"),onChange:e=>A("tagsAny",e),isMulti:!0}),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.__)("Only visible to logged-in users with at least one of the selected tags.","block-visibility"))),(0,e.createElement)("div",{className:"visibility-control wp-fusion__tags-all"},(0,e.createElement)("div",{className:"visibility-control__label"},(0,i.__)("Required Tags (All)","block-visibility")),(0,e.createElement)(gi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:N,value:R,placeholder:(0,i.__)("Select Tag…","block-visibility"),onChange:e=>A("tagsAll",e),isMulti:!0}),(0,e.createElement)("div",{className:"visibility-control__help"},(0,e.createInterpolateElement)((0,i.__)("Only visible to logged-in users with all of the selected tags.","block-visibility"),{strong:(0,e.createElement)("strong",null)}))));"public"!==V&&"logged-out"!==V||(H=(0,e.createElement)(a.Disabled,null,H));let z=(0,e.createElement)("div",{className:"visibility-control wp-fusion__tags-not"},(0,e.createElement)("div",{className:"visibility-control__label"},(0,i.__)("Required Tags (Not)","block-visibility")),(0,e.createElement)(gi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:N,value:D,placeholder:(0,i.__)("Select Tag…","block-visibility"),onChange:e=>A("tagsNot",e),isMulti:!0}),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.__)("Hide from logged-in users with at least one of the selected tags.","block-visibility")));return"logged-out"===V&&(z=(0,e.createElement)(a.Disabled,null,z)),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group wp-fusion-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)(h,{icon:C.wpFusion}),(0,e.createElement)("span",null,(0,i.__)("WP Fusion","block-visibility")),(0,e.createElement)(Ri,{message:(0,i.__)("The WP Fusion control allows you to configure block visibility based on WP Fusion tags.","block-visibility"),subMessage:(0,i.__)("Note that the available fields depend on the User Role control settings. If the User Role control is disabled, only the Required Tags (Not) field will be available.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-wp-fusion-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__group-fields"},H,z),!P&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("The WP Fusion control works best in coordination with the User Role control, which has been disabled. To re-enable, click the eye icon in the Controls Toolbar above.","block-visibility"))),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function Yi(t){return(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,e.createInterpolateElement)((0,i.__)("Looks like all Visibility Controls have been disabled. To control block visibility again, re-enable some Visibility Controls.","block-visibility"),{a:(0,e.createElement)("a",{href:t+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))}function Xi(){return(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("All visibility controls have been disabled for this block. Add controls using the three dots icon above.","block-visibility"))}function Qi(t){const n="core/legacy-widget"===t.name?(0,i.__)("Legacy Widget","block-visibility"):(0,i.__)("Current","block-visibility");return(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,e.createElement)("p",null,(0,i.sprintf)(// Translators: The current block name. -(0,i.__)("Unfortunately the %1$s block does not support custom attributes. Therefore it is not compatible with Block Visibility.","block-visibility"),n)),(0,e.createElement)("p",null,(0,i.sprintf)(// Translators: The current block name. -(0,i.__)("As a workaround, wrap the %1$s block in a Group block. Then apply the desired visibility controls to the Group block.","block-visibility"),n)))}const Ki=(0,a.withFilters)("blockVisibility.addControlSetControls")((t=>(0,e.createElement)(e.Fragment,null)));function Ji(n){var i,l,o;const{type:r,controlSetAtts:s,setControlSetAtts:u,enabledControls:d,variables:p}=n,v=null!==(i=null==p||null===(l=p.plugin_variables)||void 0===l?void 0:l.settings_url)&&void 0!==i?i:"",m=null===(o=null==s?void 0:s.enable)||void 0===o||o,b="single"===r?r:r+"-"+(null==s?void 0:s.id),f=1===d.length&&d.some((e=>"hide_block"===e.settingSlug));if(f)return null;const h=[];d.forEach((e=>{var t;"hide_block"!==e.settingSlug&&h.push({label:e.label,type:e.type,attributeSlug:e.attributeSlug,settingSlug:e.settingSlug,icon:null!==(t=null==e?void 0:e.icon)&&void 0!==t&&t,active:null==s?void 0:s.controls.hasOwnProperty(e.attributeSlug)})}));const g=Object.keys(s.controls),y=h.filter((e=>!(!e.active||!g.includes(e.attributeSlug))));function _(e,n){var i;const l=null!==(i=null==s?void 0:s.controls)&&void 0!==i?i:{},o=(0,t.assign)({...s},{controls:(0,t.assign)({...l},{[e]:n})});u(o)}let C=(0,e.createElement)("div",{className:"control-set__controls"},(0,e.createElement)(a.Slot,{name:"ControlSetControlsTop-"+b}),(0,e.createElement)(ji,c({setControlAtts:_},n)),(0,e.createElement)(Di,c({setControlAtts:_},n)),(0,e.createElement)($i,c({setControlAtts:_},n)),(0,e.createElement)(Gi,c({setControlAtts:_},n)),(0,e.createElement)(a.Slot,{name:"ControlSetControlsMiddle-"+b}),(0,e.createElement)(Zi,c({setControlAtts:_},n)),(0,e.createElement)(Wi,c({setControlAtts:_},n)),(0,e.createElement)(a.Slot,{name:"ControlSetControlsBottom-"+b}));return m||(C=(0,e.createElement)(a.Disabled,null,C)),(0,e.createElement)("div",{className:"control-set"},(0,e.createElement)(w,c({controls:h,setControlSetAtts:u},n)),C,(0,e.createElement)(Ki,c({uniqueIndex:b,setControlAtts:_},n)),!f&&(0,t.isEmpty)(y)&&(0,e.createElement)(Xi,{settingsUrl:v}))}function el(e,t){if(!e||0===e.length)return!1;const n=e.disabled_blocks.includes(t),i=(0,r.getBlockSupport)(t,"blockVisibility",!1);return!(n||!i)}function tl(e,t){var n,i,l,o,r;let s=!0;if(null===(n=null==e||null===(i=e.plugin_settings)||void 0===i?void 0:i.enable_user_role_restrictions)||void 0===n||!n)return s;const a=null!==(l=null==e||null===(o=e.plugin_settings)||void 0===o?void 0:o.enabled_user_roles)&&void 0!==l?l:[];-1===a.indexOf("administrator")&&a.push("administrator");const c=null!==(r=null==t?void 0:t.current_users_roles)&&void 0!==r?r:[];return s=0!==c.length&&c.every((e=>-1!==a.indexOf(e))),s}function nl(e,n){var l;let r=[];if(!e||!n||0===e.length||0===n.length)return r;let s=function(){let e=[{label:(0,i.__)("Hide Block","block-visibility"),type:"core",attributeSlug:"hideBlock",settingSlug:"hide_block"},{label:(0,i.__)("Date & Time","block-visibility"),type:"core",attributeSlug:"dateTime",settingSlug:"date_time"},{label:(0,i.__)("User Role","block-visibility"),type:"core",attributeSlug:"userRole",settingSlug:"visibility_by_role"},{label:(0,i.__)("Screen Size","block-visibility"),type:"core",attributeSlug:"screenSize",settingSlug:"screen_size"},{label:(0,i.__)("Query String","block-visibility"),type:"core",attributeSlug:"queryString",settingSlug:"query_string"}];e=(0,o.applyFilters)("blockVisibility.coreControls",e),e.sort(((e,t)=>e.attributeSlug.localeCompare(t.attributeSlug)));let t=[{label:(0,i.__)("Advanced Custom Fields","block-visibility"),type:"integration",attributeSlug:"acf",settingSlug:"acf",icon:C.acf},{label:(0,i.__)("WP Fusion","block-visibility"),type:"integration",attributeSlug:"wpFusion",settingSlug:"wp_fusion",icon:C.wpFusion}];t=(0,o.applyFilters)("blockVisibility.integrationControls",t),t.sort(((e,t)=>e.attributeSlug.localeCompare(t.attributeSlug)));let n=[...e,...t];return n=(0,o.applyFilters)("blockVisibility.controls",n),n}();s.forEach((function(e){"integration"!==e.type||(e=>{let t=!1;var i,l;return null!=n&&n.integrations&&(t=null!==(i=null==n||null===(l=n.integrations[e])||void 0===l?void 0:l.active)&&void 0!==i&&i),t})(e.settingSlug)||(s=s.filter((t=>t.settingSlug!==e.settingSlug)))}));const a=null!==(l=null==e?void 0:e.visibility_controls)&&void 0!==l?l:{};return(0,t.isEmpty)(a)||s.forEach((function(e){var n,i;let l=!1;(0,t.has)(a,e.settingSlug)||(l=!0),(null===(n=null===(i=a[e.settingSlug])||void 0===i?void 0:i.enable)||void 0===n||n)&&(l=!0),l&&r.push(e)})),r=(0,o.applyFilters)("blockVisibility.enabledControls",r,e,n),r}const il=(0,a.withFilters)("blockVisibility.addInspectorControls")((t=>(0,e.createElement)(e.Fragment,null)));var ll=(0,l.withSelect)((e=>{var t,n;const{getEntityRecord:i}=e("core");return{settings:null!==(t=i("block-visibility/v1","settings"))&&void 0!==t?t:"fetching",variables:null!==(n=i("block-visibility/v1","variables"))&&void 0!==n?n:"fetching"}}))((function(n){var l,o,r,s,p,v,m,b,f,h,g;const{attributes:y,setAttributes:_,name:C,settings:E,variables:k,clientId:w}=n;if("fetching"===E||"fetching"===k)return null;if(!tl(E,k)||!el(E,C))return null;let S=nl(E,k);const O=null!==(l=null==E||null===(o=E.plugin_settings)||void 0===o?void 0:o.default_controls)&&void 0!==l?l:{};let x={};(0,t.isEmpty)(O)?x={dateTime:{},userRole:{},screenSize:{}}:S.forEach((e=>{O.includes(e.settingSlug)&&(x[e.attributeSlug]={})}));const M={...y};let L=null==M?void 0:M.blockVisibility,P=null!==(r=null===(s=L)||void 0===s?void 0:s.controlSets)&&void 0!==r?r:[];0===P.length&&(P=[{id:1,enable:!0,controls:x}],L=(0,t.assign)({...L},{controlSets:P}));const V=null==k||!k.is_pro||null===(p=null==E||null===(v=E.visibility_controls)||void 0===v||null===(m=v.general)||void 0===m?void 0:m.enable_local_controls)||void 0===p||p;V||(S=S.filter((e=>"hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug)));const N=null!==(b=null==k||null===(f=k.plugin_variables)||void 0===f?void 0:f.settings_url)&&void 0!==b?b:"",T=null!==(h=null===(g=L)||void 0===g?void 0:g.hideBlock)&&void 0!==h&&h,F=S.some((e=>"hide_block"===e.settingSlug))&&T,I=["core/legacy-widget"].includes(C);function R(e){_({blockVisibility:(0,t.assign)({...y.blockVisibility},{controlSets:[e]})})}return(0,e.createElement)(u.InspectorControls,null,(0,e.createElement)(a.PanelBody,{title:(0,i.__)("Visibility","block-visibility"),className:"block-visibility",initialOpen:!1},(0,e.createElement)("div",{className:"visibility-controls__container"},0!==S.length&&!I&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"InspectorControlsTop"}),(0,e.createElement)(d,c({enabledControls:S},n)),(0,e.createElement)(a.Slot,{name:"InspectorControlsMiddle"}),!F&&V&&P.map(((t,i)=>(0,e.createElement)(Ji,c({key:w+i,type:"single",controlSets:P,controlSetAtts:t,setControlSetAtts:R,enabledControls:S,defaultControls:x},n)))),(0,e.createElement)(a.Slot,{name:"InspectorControlsBottom"})),0===S.length&&!I&&(0,e.createElement)(Yi,{settingsUrl:N}),I&&(0,e.createElement)(Qi,{name:C}))),(0,e.createElement)(il,c({blockAtts:L,enabledControls:S},n)))})),ol=(0,l.withSelect)((e=>{var t,n;const{getEntityRecord:i}=e("core"),{getBlockName:l,getSelectedBlockClientIds:o,getBlockAttributes:r,hasMultiSelection:s}=e("core/block-editor"),{getBlockType:a}=e("core/blocks"),c=!s(),u=o(),d=0===u.length?null:u[0];return{enableMenuItem:c,clientId:d,blockType:a(l(d)),blockAttributes:r(d),settings:null!==(t=i("block-visibility/v1","settings"))&&void 0!==t?t:"fetching",variables:null!==(n=i("block-visibility/v1","variables"))&&void 0!==n?n:"fetching"}}))((function(n){var o;const{flashBlock:r,updateBlockAttributes:s}=(0,l.useDispatch)("core/block-editor"),{createSuccessNotice:c}=(0,l.useDispatch)("core/notices"),{enableMenuItem:d,clientId:p,blockType:v,blockAttributes:m,settings:b,variables:f}=n;if("fetching"===b||"fetching"===f)return null;if(!tl(b,f))return null;if(!d||!v)return null;if(["core/legacy-widget"].includes(v.name))return null;const h=Fi(b,"enable_toolbar_controls"),g=el(b,v.name),y=nl(b,f);if(!h||!g||!y.some((e=>"hide_block"===e.settingSlug)))return null;const{blockVisibility:_}=m,E=null!==(o=null==_?void 0:_.hideBlock)&&void 0!==o&&o,k=E?C.visibilityAlt:C.visibilityHiddenAlt,w=E?(0,i.__)("Enable block","block-visibility"):(0,i.__)("Hide block","block-visibility"),S=v.title,O=E?(0,i.sprintf)(// Translators: Name of the block being made visible, e.g. "Paragraph". -(0,i.__)('"%s" is now visible.'),S):(0,i.sprintf)(// Translators: Name of the block being hidden, e.g. "Paragraph". -(0,i.__)('"%s" is now hidden.'),S);return(0,e.createElement)(u.BlockSettingsMenuControls,null,(0,e.createElement)(a.MenuItem,{onClick:()=>{s(p,{blockVisibility:(0,t.assign)({..._},{hideBlock:!E})}),r(p),c(O,{type:"snackbar"})},icon:k,label:w},w))}));function rl(e,t,n){if(t&&!e.hasOwnProperty("dateTime"))return!1;if(!n.some((e=>"date_time"===e.settingSlug)))return!1;let i=[],l=!1;var r,s,a,c;if(t?(i=null!==(r=null===(s=e.dateTime)||void 0===s?void 0:s.schedules)&&void 0!==r?r:[],l=null!==(a=null===(c=e.dateTime)||void 0===c?void 0:c.hideOnSchedules)&&void 0!==a&&a):i=null!=e&&e.scheduling?[null==e?void 0:e.scheduling]:[],0===i.length)return!1;const u=[];i.forEach((e=>{var t,n,i;const r=null!==(t=null==e?void 0:e.enable)&&void 0!==t&&t,s=null!==(n=null==e?void 0:e.start)&&void 0!==n?n:"",a=null!==(i=null==e?void 0:e.end)&&void 0!==i?i:"";let c=!0;r||(c=!1),l||!r||s||a||(c=!1),c=(0,o.applyFilters)("blockVisibility.hasDateTimeScheduleIndicator",c,e),r&&s&&a&&s>=a&&(c=!1),u.push(c)}));let d=u.includes(!0);return d=(0,o.applyFilters)("blockVisibility.hasDateTimeIndicator",d,e,t,n),d}function sl(e,t,n){var i,l,r,s,a,c;if(t&&!e.hasOwnProperty("userRole"))return!1;const u=t?e.userRole:e,d=null!==(i=null==u?void 0:u.visibilityByRole)&&void 0!==i?i:"public",p=null!==(l=null==u?void 0:u.restrictedRoles)&&void 0!==l?l:[],v=null!==(r=null==u?void 0:u.hideOnRestrictedRoles)&&void 0!==r&&r,m=null!==(s=null==u?void 0:u.restrictedUsers)&&void 0!==s?s:[],b=null!==(a=null==u?void 0:u.hideOnRestrictedUsers)&&void 0!==a&&a,f=null!==(c=null==u?void 0:u.ruleSets)&&void 0!==c?c:[];let h=!0;return n.some((e=>"visibility_by_role"===e.settingSlug))&&d&&"public"!==d&&"all"!==d||(h=!1),"user-role"===d&&0===p.length&&v&&(h=!1),"users"===d&&0===m.length&&b&&(h=!1),"user-rule-sets"===d&&0===f.length&&(h=!1),h=(0,o.applyFilters)("blockVisibility.hasUserRoleIndicator",h,e,t,n),h}function al(e,t,n,i){var l,r,s,a;if(t&&!e.hasOwnProperty("screenSize"))return!1;const c=t?e.screenSize:e,u=null!==(l=null==c?void 0:c.hideOnScreenSize)&&void 0!==l?l:{extraLarge:!1,large:!1,medium:!1,small:!1,extraSmall:!1},d=null!==(r=null==i||null===(s=i.visibility_controls)||void 0===s||null===(a=s.screen_size)||void 0===a?void 0:a.controls)&&void 0!==r?r:{extra_large:!0,large:!0,medium:!0,small:!0,extra_small:!0},p=[!(!u.extraLarge||!d.extra_large),!(!u.large||!d.large),!(!u.medium||!d.medium),!(!u.small||!d.small),!(!u.extraSmall||!d.extra_small)];let v=!0;return n.some((e=>"screen_size"===e.settingSlug))&&p.includes(!0)||(v=!1),v=(0,o.applyFilters)("blockVisibility.hasScreenSizeIndicator",v,e,t,n,i),v}function cl(e,t,n){var i,l,r,s,a,c;if(t&&!e.hasOwnProperty("queryString"))return!1;if(!n.some((e=>"query_string"===e.settingSlug)))return!1;const u=null!==(i=null==e||null===(l=e.queryString)||void 0===l?void 0:l.queryStringAny)&&void 0!==i?i:"",d=null!==(r=null==e||null===(s=e.queryString)||void 0===s?void 0:s.queryStringAll)&&void 0!==r?r:"",p=null!==(a=null==e||null===(c=e.queryString)||void 0===c?void 0:c.queryStringNot)&&void 0!==a?a:"";let v=!0;return u||d||p||(v=!1),v=(0,o.applyFilters)("blockVisibility.hasQueryStringIndicator",v,e,t,n),v}function ul(e,t,n,i){var l,r,s,a,c;if(null===(l=null==i||null===(r=i.integrations)||void 0===r||null===(s=r.acf)||void 0===s?void 0:s.active)||void 0===l||!l||!n.some((e=>"acf"===e.settingSlug)))return!1;if(t&&!e.hasOwnProperty("acf"))return!1;let u=!0;return 0===(null!==(a=null==e||null===(c=e.acf)||void 0===c?void 0:c.ruleSets)&&void 0!==a?a:[]).length&&(u=!1),u=(0,o.applyFilters)("blockVisibility.hasACFIndicator",u,e,t,n,i),u}function dl(e,t,n,i){var l,r,s,a,c,u,d,p,v,m,b,f;if(null===(l=null==i||null===(r=i.integrations)||void 0===r||null===(s=r.wp_fusion)||void 0===s?void 0:s.active)||void 0===l||!l||!n.some((e=>"wp_fusion"===e.settingSlug)))return!1;if(t&&!e.hasOwnProperty("wpFusion"))return!1;const h=null!==(a=e.hasOwnProperty("userRole"))&&void 0!==a&&a,g=null!==(c=null==e||null===(u=e.userRole)||void 0===u?void 0:u.visibilityByRole)&&void 0!==c?c:"public",y="public"===g||"logged-out"===g,_=null!==(d=null==e||null===(p=e.wpFusion)||void 0===p?void 0:p.tagsAny)&&void 0!==d?d:[],C=null!==(v=null==e||null===(m=e.wpFusion)||void 0===m?void 0:m.tagsAll)&&void 0!==v?v:[],E=null!==(b=null==e||null===(f=e.wpFusion)||void 0===f?void 0:f.tagsNot)&&void 0!==b?b:[];let k=!0;return(!h&&0===E.length||"public"===g&&0===E.length||"logged-out"===g)&&(k=!1),y||0!==_.length||0!==C.length||0!==E.length||(k=!1),k=(0,o.applyFilters)("blockVisibility.hasWPFusionIndicator",k,e,t,n,i),k}function pl(e){const{data:t="fetching"}=(0,l.useSelect)((t=>{const{getEntityRecord:n}=t("core");return{data:n("block-visibility/v1",e)}}),[]);return t}(0,o.addFilter)("editor.BlockListBlock","block-visibility/contextual-indicators",(function(t){return n=>{var i,l,r,s,a;const u=pl("settings"),d=pl("variables");if("fetching"===u)return(0,e.createElement)(t,n);const{name:p,attributes:m}=n,b=Fi(u,"enable_contextual_indicators"),f=el(u,p),h=nl(u,d);if(!b||!f||0===h.length)return(0,e.createElement)(t,n);const{blockVisibility:g}=m,y=null!==(i=null==g?void 0:g.hideBlock)&&void 0!==i&&i&&h.some((e=>"hide_block"===e.settingSlug)),_=null!==(l=null==g?void 0:g.controlSets)&&void 0!==l&&l;let C=null!=g?g:{};var E;_&&(C=0!==g.controlSets.length&&null!==(E=g.controlSets[0])&&void 0!==E&&E.controls?g.controlSets[0].controls:{});let k={"date-time":rl(C,_,h),"user-role":sl(C,_,h),"screen-size":al(C,_,h,u),"query-string":cl(C,_,h)};k=(0,o.applyFilters)("blockVisibility.conditionalIndicatorActiveCoreControls",k,g,C,_,h,d);let w={acf:ul(C,_,h,d),"wp-fusion":dl(C,_,h,d)};w=(0,o.applyFilters)("blockVisibility.conditionalIndicatorActiveIntegrationControls",w,C,_,h,d);let S={...k,...w};S=Object.keys(S).filter((e=>!0===S[e])),null==d||!d.is_pro||null===(r=null==u||null===(s=u.visibility_controls)||void 0===s||null===(a=s.general)||void 0===a?void 0:a.enable_local_controls)||void 0===r||r||(S=S.filter((e=>"hide-block"===e||"visibility-presets"===e))),S.sort();let O="";S.length>1?O="block-visibility__has-"+S.length+"-controls":0!==S.length&&(O="block-visibility__has-"+S.join("-"));let x=v()({"block-visibility__is-hidden":y},O);return x&&(x+=" block-visibility__has-visibility"),x=(0,o.applyFilters)("blockVisibility.conditionalIndicatorClasses",x),(0,e.createElement)(t,c({},n,{className:x}))}})),(0,l.dispatch)("core").addEntities([{label:(0,i.__)("Block Visibility Settings","block-visibility"),kind:"block-visibility/v1",name:"settings",baseURL:"/block-visibility/v1/settings"},{label:(0,i.__)("Block Visibility Variables","block-visibility"),kind:"block-visibility/v1",name:"variables",baseURL:"/block-visibility/v1/variables"}]),(0,o.addFilter)("blocks.registerBlockType","block-visibility/add-attributes",(function(e){if("core/freeform"===e.name)return e;const n=blockVisibilityFullControlMode;let i={blockVisibility:{type:"object",properties:{hideBlock:{type:"boolean"},controlSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},controls:{type:"object",properties:{dateTime:{type:"object",properties:{schedules:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},start:{type:"string"},end:{type:"string"}}}},hideOnSchedules:{type:"boolean"}}},userRole:{type:"object",properties:{enable:{type:"boolean"},visibilityByRole:{type:"string"},hideOnRestrictedRoles:{type:"boolean"},restrictedRoles:{type:"array",items:{type:"string"}},hideOnRestrictedUsers:{type:"boolean"},restrictedUsers:{type:"array",items:{type:"string"}},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},subFields:{type:"object"},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},screenSize:{type:"object",properties:{enable:{type:"boolean"},hideOnScreenSize:{type:"object",properties:{extraLarge:{type:"boolean"},large:{type:"boolean"},medium:{type:"boolean"},small:{type:"boolean"},extraSmall:{type:"boolean"}}}}},queryString:{type:"object",properties:{enable:{type:"boolean"},queryStringAny:{type:"string"},queryStringAll:{type:"string"},queryStringNot:{type:"string"}}},acf:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:["array","object"],items:{type:"object",properties:{field:{type:"string"},operator:{type:"string"},value:{type:"string"}}},properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},wpFusion:{type:"object",properties:{enable:{type:"boolean"},tagsAny:{type:"array",items:{type:["number","string"]}},tagsAll:{type:"array",items:{type:["number","string"]}},tagsNot:{type:"array",items:{type:["number","string"]}}}}}}}}}}}};return i=(0,o.applyFilters)("blockVisibility.attributes",i),(n||(0,r.hasBlockSupport)(e,"inserter",!0)&&!e.hasOwnProperty("parent"))&&(e.attributes=(0,t.assign)(e.attributes,i),e.supports=(0,t.assign)(e.supports,{blockVisibility:!0})),e})),(0,o.addFilter)("editor.BlockEdit","block-visibility/add-inspector-controls",(function(t){return n=>n.isSelected?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,n),(0,e.createElement)(ll,n)):(0,e.createElement)(t,n)}),100),(0,s.registerPlugin)("block-visibility-toolbar-options-hide-block",{render:ol}),(0,o.addFilter)("blockVisibilityPro.addPresetManagerControlSet","block-visibility/preset-manager-control-set",(function(){return t=>{const{index:n,type:i}=t;return(0,e.createElement)(a.Fill,{name:"PresetManagerControlSet-"+i+"-"+n},(0,e.createElement)(Ji,t))}}))}()}(); \ No newline at end of file +!function(){var e={184:function(e,t){var n;!function(){"use strict";var i={}.hasOwnProperty;function l(){for(var e=[],t=0;t"hide_block"===e.settingSlug)))return null;const{blockVisibility:c}=o,u=null!==(l=null==c?void 0:c.hideBlock)&&void 0!==l&&l;return(0,e.createElement)("div",{className:"visibility-control__group hide-block-control"},(0,e.createElement)("div",{className:"visibility-control"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide block","block-visibility"),checked:u,onChange:()=>{r({blockVisibility:(0,t.assign)({...c},{hideBlock:!u})})},help:(0,i.__)("Hide the block from everyone.","block-visibility")})))}var p=n(184),v=n.n(p),m=window.wp.primitives,b=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"})),f=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),h=function(t){let{icon:n,size:i=24,...l}=t;return(0,e.cloneElement)(n,{width:i,height:i,...l})},g=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),y=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));const _={};_.logo=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},(0,e.createElement)(a.Path,{d:"M128,0 C198.692448,0 256,57.307552 256,128 C256,198.692448 198.692448,256 128,256 C57.307552,256 0,198.692448 0,128 C0,57.307552 57.307552,0 128,0 Z M128,67 C88.7744776,67 54.0129388,90.9022691 39.4355448,126.649105 L39,127.735956 L39,128.264044 L39.4740036,129.445062 C54.0740078,165.139702 88.8089313,189 128,189 C167.225522,189 201.987061,165.097731 216.564455,129.350895 L217,128.264044 L217,127.735956 L216.525996,126.554938 C201.925992,90.8602984 167.191069,67 128,67 Z M128,88 C150.09139,88 168,105.90861 168,128 C168,150.09139 150.09139,168 128,168 C105.90861,168 88,150.09139 88,128 C88,105.90861 105.90861,88 128,88 Z M136,104 C127.163444,104 120,111.163444 120,120 C120,128.836556 127.163444,136 136,136 C144.836556,136 152,128.836556 152,120 C152,111.163444 144.836556,104 136,104 Z"})),_.error=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M12,2 C6.48,2 2,6.48 2,12 C2,17.52 6.48,22 12,22 C17.52,22 22,17.52 22,12 C22,6.48 17.52,2 12,2 Z M13,17 L11,17 L11,15 L13,15 L13,17 Z M13,13 L11,13 L11,7 L13,7 L13,13 Z","fill-rule":"nonzero"})),_.errorOutline=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M13,17 L11,17 L11,15 L13,15 L13,17 Z M13,13 L11,13 L11,7 L13,7 L13,13 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M12,22 C17.5228475,22 22,17.5228475 22,12 C22,6.4771525 17.5228475,2 12,2 C6.4771525,2 2,6.4771525 2,12 C2,17.5228475 6.4771525,22 12,22 Z M12,20 C7.581722,20 4,16.418278 4,12 C4,7.581722 7.581722,4 12,4 C16.418278,4 20,7.581722 20,12 C20,16.418278 16.418278,20 12,20 Z","fill-rule":"nonzero"})),_.trash=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M20,5.5 L14.3,5.5 C14.3,4.2 13.3,3.2 12,3.2 C10.7,3.2 9.7,4.2 9.7,5.5 L4,5.5 L4,7.5 L5.5,7.5 L5.5,7.8 L7.2,18.9 C7.3,19.9 8.2,20.6 9.2,20.6 L14.9,20.6 C15.9,20.6 16.7,19.9 16.9,18.9 L18.6,7.8 L18.6,7.5 L20,7.5 L20,5.5 Z M16.8,7.5 L15.1,18.6 C15.1,18.7 15,18.8 14.8,18.8 L9.1,18.8 C9,18.8 8.8,18.7 8.8,18.6 L7.2,7.5 L16.8,7.5 Z"})),_.warning=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M1,21 L23,21 L12,2 L1,21 Z M13,18 L11,18 L11,16 L13,16 L13,18 Z M13,14 L11,14 L11,10 L13,10 L13,14 Z","fill-rule":"nonzero"})),_.image=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),_.replaceImage=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",width:"20",height:"20"},(0,e.createElement)("rect",{x:"11",y:"3",width:"7",height:"5",rx:"1"}),(0,e.createElement)("rect",{x:"2",y:"12",width:"7",height:"5",rx:"1"}),(0,e.createElement)(a.Path,{d:"M13,12h1a3,3,0,0,1-3,3v2a5,5,0,0,0,5-5h1L15,9Z"}),(0,e.createElement)(a.Path,{d:"M4,8H3l2,3L7,8H6A3,3,0,0,1,9,5V3A5,5,0,0,0,4,8Z"})),_.link=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),_.help=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M2,12 C2,6.48 6.48,2 12,2 C17.52,2 22,6.48 22,12 C22,17.52 17.52,22 12,22 C6.48,22 2,17.52 2,12 Z M12,20 C16.41,20 20,16.41 20,12 C20,7.59001 16.41,4.00002 12,4.00002 C7.59,4.00002 4,7.59001 4,12 C4,16.41 7.59,20 12,20 Z"}),(0,e.createElement)("polygon",{points:"13 16 13 18 11 18 11 16"}),(0,e.createElement)(a.Path,{d:"M8,10 C8,7.79 9.79,6 12,6 C14.21,6 16,7.79 16,10 C16,11.28291 15.21,11.97331 14.4408,12.6455 C13.711,13.2833 13,13.9046 13,15 L11,15 C11,13.1787 11.94212,12.4566 12.7704,11.82167 C13.4202,11.3236 14,10.87921 14,10 C14,8.9 13.1,8 12,8 C10.9,8 10,8.9 10,10 L8,10 Z"})),_.star=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)("polygon",{points:"12 17.7371778 5.81966011 21.5 7.49246652 14.4659011 2 9.75735421 9.2141911 9.1728642 12 2.5 14.7858089 9.1728642 22 9.75735421 16.5075335 14.4659011 18.1803399 21.5"})),_.school=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z"})),_.support=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M12,2C6.48,2,2,6.48,2,12c0,5.52,4.48,10,10,10s10-4.48,10-10C22,6.48,17.52,2,12,2z M19.46,9.12l-2.78,1.15 c-0.51-1.36-1.58-2.44-2.95-2.94l1.15-2.78C16.98,5.35,18.65,7.02,19.46,9.12z M12,15c-1.66,0-3-1.34-3-3s1.34-3,3-3s3,1.34,3,3 S13.66,15,12,15z M9.13,4.54l1.17,2.78c-1.38,0.5-2.47,1.59-2.98,2.97L4.54,9.13C5.35,7.02,7.02,5.35,9.13,4.54z M4.54,14.87 l2.78-1.15c0.51,1.38,1.59,2.46,2.97,2.96l-1.17,2.78C7.02,18.65,5.35,16.98,4.54,14.87z M14.88,19.46l-1.15-2.78 c1.37-0.51,2.45-1.59,2.95-2.97l2.78,1.17C18.65,16.98,16.98,18.65,14.88,19.46z"})),_.cloud=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M18.3529412,9.83333333 C20.4705882,10.0666667 22,11.8166667 22,13.9166667 C22,16.1333333 20.1176471,18 17.8823529,18 L6.11764706,18 C3.88235294,18 2,16.1333333 2,13.9166667 C2,11.8166667 3.52941176,10.1833333 5.64705882,9.83333333 C5.52941176,9.71666667 5.52941176,9.48333333 5.52941176,9.25 C5.52941176,7.61666667 6.82352941,6.33333333 8.47058824,6.33333333 C8.82352941,6.33333333 9.29411765,6.45 9.52941176,6.56666667 C10.3529412,5.05 11.8823529,4 13.7647059,4 C16.3529412,4 18.4705882,6.1 18.4705882,8.66666667 C18.4705882,9.13333333 18.3529412,9.48333333 18.3529412,9.83333333 Z"})),_.visibility=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M12,5 C17,5 21.27,8.11 23,12.5 C21.27,16.89 17,20 12,20 C7,20 2.73,16.89 1,12.5 C2.73,8.11 7,5 12,5 Z M12,17.5 C14.76,17.5 17,15.26 17,12.5 C17,9.74 14.76,7.5 12,7.5 C9.24,7.5 7,9.74 7,12.5 C7,15.26 9.24,17.5 12,17.5 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M12,9.5 C10.34,9.5 9,10.84 9,12.5 C9,14.16 10.34,15.5 12,15.5 C13.66,15.5 15,14.16 15,12.5 C15,10.84 13.66,9.5 12,9.5 Z","fill-rule":"nonzero"})),_.visibilityHidden=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M19.1145976,17.6145976 C17.1357397,19.111758 14.6721169,20 12,20 C7,20 2.73,16.89 1,12.5 C2.1681438,9.53575071 4.49435577,7.15509483 7.42141271,5.92141271 L9.60854669,8.10854669 C8.05477185,8.95699413 7,10.6060682 7,12.5 C7,15.26 9.24,17.5 12,17.5 C13.8939318,17.5 15.5430059,16.4452281 16.3914533,14.8914533 L19.1145976,17.6145976 L19.1145976,17.6145976 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M20.6043865,16.2759593 L16.9972006,12.6687735 C16.9990619,12.6127432 17,12.5564805 17,12.5 C17,9.74 14.76,7.5 12,7.5 C11.9435195,7.5 11.8872568,7.50093805 11.8312265,7.50279942 L9.57740803,5.2489809 C10.3592736,5.08578831 11.1695684,5 12,5 C17,5 21.27,8.11 23,12.5 C22.4438856,13.9111805 21.6253071,15.1900957 20.6043865,16.2759593 L20.6043865,16.2759593 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M13.6675474,14.9959745 C13.1910334,15.314476 12.6176688,15.5 12,15.5 C10.34,15.5 9,14.16 9,12.5 C9,11.8823312 9.18552396,11.3089666 9.50402547,10.8324526 L2.66116524,3.98959236 C2.27064094,3.59906807 2.27064094,2.96590309 2.66116524,2.5753788 C3.05168953,2.18485451 3.68485451,2.18485451 4.0753788,2.5753788 L21.0459415,19.5459415 C21.4364658,19.9364658 21.4364658,20.5696308 21.0459415,20.9601551 C20.6554173,21.3506794 20.0222523,21.3506794 19.631728,20.9601551 L13.6675474,14.9959745 L13.6675474,14.9959745 Z","fill-rule":"nonzero"})),_.visibilityAlt=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M12,16 C14.208,16 16,14.208 16,12 C16,9.792 14.208,8 12,8 C9.792,8 8,9.792 8,12 C8,14.208 9.792,16 12,16 Z M12,14.5 C10.6204271,14.5 9.5,13.3795729 9.5,12 C9.5,10.6204271 10.6204271,9.5 12,9.5 C13.3795729,9.5 14.5,10.6204271 14.5,12 C14.5,13.3795729 13.3795729,14.5 12,14.5 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M12,16 C14.208,16 16,14.208 16,12 C16,9.792 14.208,8 12,8 C9.792,8 8,9.792 8,12 C8,14.208 9.792,16 12,16 Z M12,14.5 C10.6204271,14.5 9.5,13.3795729 9.5,12 C9.5,10.6204271 10.6204271,9.5 12,9.5 C13.3795729,9.5 14.5,10.6204271 14.5,12 C14.5,13.3795729 13.3795729,14.5 12,14.5 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M12,4.5 C17,4.5 21.27,7.61 23,12 C21.27,16.39 17,19.5 12,19.5 C7,19.5 2.73,16.39 1,12 C2.73,7.61 7,4.5 12,4.5 Z M21.3473903,12 C19.6713562,8.45851492 16.065323,6.10714286 12,6.10714286 C7.934677,6.10714286 4.32864381,8.45851492 2.65260973,12 C4.32864381,15.5414851 7.934677,17.8928571 12,17.8928571 C16.065323,17.8928571 19.6713562,15.5414851 21.3473903,12 Z","fill-rule":"nonzero"})),_.visibilityHiddenAlt=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M13.9708958,15.4810143 C13.389064,15.8113365 12.7164305,16 12,16 C9.792,16 8,14.208 8,12 C8,11.3082051 8.17591163,10.6572469 8.48541416,10.089446 L9.62711077,11.2115964 C9.54465452,11.4595008 9.5,11.7245863 9.5,12 C9.5,13.3795729 10.6204271,14.5 12,14.5 C12.2905966,14.5 12.5696948,14.4502864 12.8292449,14.3589089 L13.9708958,15.4810143 L13.9708958,15.4810143 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M15.8136867,13.2093721 L14.4986393,11.9168387 C14.4551273,10.5889421 13.3734522,9.52129787 12.040023,9.50031471 L10.7249635,8.20776951 C11.1254753,8.07302998 11.554261,8 12,8 C14.208,8 16,9.792 16,12 C16,12.4214718 15.9347055,12.8277859 15.8136867,13.2093721 L15.8136867,13.2093721 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M16.9542237,18.4124655 C15.4477475,19.1104464 13.7695931,19.5 12,19.5 C7,19.5 2.73,16.39 1,12 C1.83549245,9.87987753 3.26340063,8.05829526 5.0798477,6.74138281 L6.22058871,7.86259395 C4.69709513,8.8848633 3.45414836,10.3063369 2.65260973,12 C4.32864381,15.5414851 7.934677,17.8928571 12,17.8928571 C13.3051937,17.8928571 14.5630455,17.6504858 15.7248846,17.2041731 L16.9542237,18.4124655 L16.9542237,18.4124655 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M19.489889,16.8185998 L18.3656404,15.7135987 C19.6222382,14.7364947 20.6512781,13.4708955 21.3473903,12 C19.6713562,8.45851492 16.065323,6.10714286 12,6.10714286 C10.9730526,6.10714286 9.97541373,6.25718996 9.03079081,6.53856491 L7.75659725,5.28618597 C9.07339857,4.77839975 10.5040254,4.5 12,4.5 C17,4.5 21.27,7.61 23,12 C22.2539458,13.8931665 21.0355216,15.5482882 19.489889,16.8185998 L19.489889,16.8185998 Z","fill-rule":"nonzero"}),(0,e.createElement)(a.Path,{d:"M2.72426842,4.42613185 L19.2242684,20.6436463 C19.5196795,20.9339998 19.9945355,20.9298999 20.2848891,20.6344888 C20.5752426,20.3390777 20.5711426,19.8642217 20.2757316,19.5738682 L3.77573158,3.35635373 C3.48032051,3.0660002 3.00546447,3.07010014 2.71511094,3.36551121 C2.42475741,3.66092228 2.42885735,4.13577832 2.72426842,4.42613185 Z","fill-rule":"nonzero"})),_.wpFusion=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M5.05263158,0 L24,0 L24,0 L24,18.9473684 C24,21.7378598 21.7378598,24 18.9473684,24 L0,24 L0,24 L0,5.05263158 C0,2.26214021 2.26214021,0 5.05263158,0 Z",fill:"#E55B10"}),(0,e.createElement)(a.Path,{d:"M19.5789474,9.78947368 C19.5789474,10.3126908 19.1547961,10.7368421 18.6315789,10.7368421 L11.0526316,10.7362105 L11.0526316,18.3157895 C11.0526316,18.8390066 10.6284803,19.2631579 10.1052632,19.2631579 L9.47368421,19.2631579 C8.95046709,19.2631579 8.52631579,18.8390066 8.52631579,18.3157895 L8.52631579,9.47368421 C8.52631579,9.13121956 8.70802977,8.83119651 8.98029891,8.66477387 C9.14698598,8.39224029 9.44700903,8.21052632 9.78947368,8.21052632 L18.6315789,8.21052632 C19.1547961,8.21052632 19.5789474,8.63467762 19.5789474,9.15789474 L19.5789474,9.78947368 Z",fill:"#FFFFFF"}),(0,e.createElement)(a.Path,{d:"M5.05263158,14.5263158 C5.05263158,14.0030987 5.47678287,13.5789474 6,13.5789474 L13.5789474,13.5795789 L13.5789474,6 C13.5789474,5.47678287 14.0030987,5.05263158 14.5263158,5.05263158 L15.1578947,5.05263158 C15.6811119,5.05263158 16.1052632,5.47678287 16.1052632,6 L16.1052632,14.8421053 C16.1052632,15.1845699 15.9235492,15.484593 15.65128,15.6510156 C15.484593,15.9235492 15.1845699,16.1052632 14.8421053,16.1052632 L6,16.1052632 C5.47678287,16.1052632 5.05263158,15.6811119 5.05263158,15.1578947 L5.05263158,14.5263158 Z",fill:"#FFFFFF"})),_.acf=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M19.2,0 C21.8509668,0 24,2.1490332 24,4.8 L24,19.2 C24,21.8509668 21.8509668,24 19.2,24 L4.8,24 C2.1490332,24 0,21.8509668 0,19.2 L0,4.8 C0,2.1490332 2.1490332,0 4.8,0 L19.2,0 Z M6.89048872,7.2 L5.10930627,7.2 L1.24499674,16.9860194 L1.24732975,16.9866974 L1.2,17.1 L3.65563145,17.1 L4.2996,15.468 L7.7016,15.4704 L8.34587867,17.1 L10.8,17.1 L10.7526702,16.9866974 L10.7550033,16.9860194 L10.6063073,16.6130016 C11.2549234,16.9251163 11.9820385,17.1 12.75,17.1 C14.249715,17.1 15.5936573,16.433058 16.5014094,15.3795917 L16.5,17.1 L18.9,17.1 L18.9,13.5 L22.65,13.5 L22.65,11.1 L18.9,11.0988 L18.9,9.5988 L22.8,9.6 L22.8,7.2 L16.5,7.2 L16.5014746,8.92048398 C15.5937217,7.86697391 14.2497509,7.2 12.75,7.2 C10.6493455,7.2 8.85431186,8.50851842 8.13552383,10.3549305 L6.89048872,7.2 Z M12.75,9.48 C13.89314,9.48 14.8684898,10.1983951 15.2492094,11.2083452 L15.3135218,11.4010233 L16.5,11.4 L16.5,13.2012 L15.2051151,13.2011741 C14.8224969,14.0936466 13.9674734,14.7355294 12.9545886,14.8122785 L12.75,14.82 C11.2753997,14.82 10.08,13.6246003 10.08,12.15 C10.08,10.6753997 11.2753997,9.48 12.75,9.48 Z M6.0012,11.16 L6.8916,13.4172 L5.1108,13.416 L6.0012,11.16 Z",fill:"#5DE8BF"}));var w=_;const E=(0,a.withFilters)("blockVisibility.addControlSetOptions")((t=>(0,e.createElement)(e.Fragment,null))),C=(0,a.withFilters)("blockVisibility.addControlSetModals")((t=>(0,e.createElement)(e.Fragment,null)));function k(n){var l,o;const[r,s]=(0,e.useState)(!1),{type:u,controls:d,controlSets:p,controlSetAtts:v,defaultControls:m,setControlSetAtts:y}=n;function _(e){let n;n=e.active?(0,t.omit)({...v.controls},[e.attributeSlug]):(0,t.assign)({...v.controls},{[e.attributeSlug]:{}});const i=(0,t.assign)({...v},{controls:{...n}});y(i)}function C(e,t){y({...v,[e]:t})}const k=d.filter((e=>"core"===e.type)),x=d.filter((e=>"integration"===e.type)),M=null!==(l=null==v?void 0:v.title)&&void 0!==l?l:"",L=null===(o=null==v?void 0:v.enable)||void 0===o||o;let P=M;P||(P="single"===u?(0,i.__)("Enabled Controls","block-visibility"):(0,i.__)("Control Set","block-visibility"));const V=(0,e.createElement)(a.DropdownMenu,{className:"settings-dropdown",label:(0,i.__)("Settings","block-visibility"),icon:b,popoverProps:{className:"block-visibility__control-popover control-settings",focusOnMount:"container"}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h3",null,(0,i.__)("Settings","block-visibility")),(0,e.createElement)(a.TextControl,{value:M,label:(0,i.__)("Control set title","block-visibility"),placeholder:P,onChange:e=>C("title",e)}),(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Enable control set","block-visibility"),checked:L,onChange:()=>C("enable",!L)})))),N=(0,e.createElement)(a.DropdownMenu,{className:"controls-dropdown",label:(0,i.__)("Visibility Controls","block-visibility"),icon:w.visibilityAlt,popoverProps:{className:"block-visibility__control-popover control-set",focusOnMount:"container"}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Controls","block-visibility")},k.map(((t,n)=>(0,e.createElement)(O,{key:n,control:t,toggleControls:_})))),0!==x.length&&(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Integrations","block-visibility")},x.map(((t,n)=>(0,e.createElement)(O,{key:n,control:t,toggleControls:_}))))))),T=(0,e.createElement)(a.DropdownMenu,{className:"options-dropdown",label:(0,i.__)("Options","block-visibility"),icon:f,popoverProps:{focusOnMount:"container"}},(l=>{let{onClose:o}=l;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"ControlSetOptionsTop"}),(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Tools","block-visibility")},(0,e.createElement)(a.Slot,{name:"ControlSetOptionsToolsTop"}),"multiple"===u&&(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=Math.max(...p.map((e=>e.id)),0)+1,t={...v,id:e};y(t)}(),o()}},(0,i.__)("Duplicate","block-visibility")),(0,e.createElement)(a.Slot,{name:"ControlSetOptionsToolsMiddle"}),(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=(0,t.assign)({...v},{controls:m});y(e)}(),o()}},(0,i.__)("Reset all controls","block-visibility")),(0,e.createElement)(a.Slot,{name:"ControlSetOptionsToolsBottom"}),(0,e.createElement)("a",{href:"https://www.blockvisibilitywp.com/knowledge-base/guide-to-visibility-controls-and-control-sets?bv_query=learn_more&utm_source=plugin&utm_medium=editor&utm_campaign=plugin_referrals",target:"_blank",role:"menuitem",rel:"noopener noreferrer",className:"components-button components-menu-item__button"},(0,e.createElement)("span",{className:"components-menu-item__item"},(0,i.__)("Help","block-visibility"),(0,e.createElement)(a.VisuallyHidden,null,(0,i.__)("(opens in a new tab)","block-visibility"))),(0,e.createElement)(h,{icon:g,size:20}))),(0,e.createElement)(a.Slot,{name:"ControlSetOptionsBottom"}),"multiple"===u&&(0,e.createElement)(a.MenuGroup,null,(0,e.createElement)(a.MenuItem,{onClick:()=>{y(v,!0),o()}},(0,i.__)("Remove control set","block-visibility"))),(0,e.createElement)(E,c({modalOpen:r,setModalOpen:s,toggleControls:_,coreControls:k,integrationControls:x,onClose:o},n)))}));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"control-set__header section-header main"},(0,e.createElement)("span",{className:"section-header__title"},P),(0,e.createElement)("div",{className:"section-header__toolbar"},N,"multiple"===u&&V,T)),r&&(0,e.createElement)(S,c({modalOpen:r,setModalOpen:s,toggleControls:_,coreControls:k,integrationControls:x},n)))}function S(t){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"ControlSetModals"}),(0,e.createElement)(C,t))}function O(t){const{control:n,toggleControls:i}=t;return(0,e.createElement)(a.MenuItem,{key:n.attributeSlug,className:v()({disabled:!n.active}),icon:n.active?y:"",onClick:()=>i(n)},n.icon&&(0,e.createElement)(h,{className:"control-branding-icon",icon:n.icon}),n.label)}var x=window.React,M=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?F(G,--j):0,B--,10===$&&(B=1,z--),$}function Y(){return $=j2||J($)>3?"":" "}function le(e,t){for(;--t&&Y()&&!($<48||$>102||$>57&&$<65||$>70&&$<97););return K(e,Q()+(t<6&&32==X()&&32==Y()))}function oe(e){for(;Y();)switch($){case e:return j;case 34:case 39:34!==e&&39!==e&&oe($);break;case 40:41===e&&oe(e);break;case 92:Y()}return j}function re(e,t){for(;Y()&&e+$!==57&&(e+$!==84||47!==X()););return"/*"+K(t,j-1)+"*"+P(47===e?e:Y())}function se(e){for(;!J(X());)Y();return K(e,j)}var ae="-ms-",ce="-moz-",ue="-webkit-",de="comm",pe="rule",ve="decl",me="@keyframes";function be(e,t){for(var n="",i=A(e),l=0;l6)switch(F(e,t+1)){case 109:if(45!==F(e,t+4))break;case 102:return T(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+ce+(108==F(e,t+3)?"$3":"$2-$3"))+e;case 115:return~R(e,"stretch")?he(T(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==F(e,t+1))break;case 6444:switch(F(e,D(e)-3-(~R(e,"!important")&&10))){case 107:return T(e,":",":"+ue)+e;case 101:return T(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ue+(45===F(e,14)?"inline-":"")+"box$3$1"+ue+"$2$3$1"+ae+"$2box$3")+e}break;case 5936:switch(F(e,t+11)){case 114:return ue+e+ae+T(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ue+e+ae+T(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ue+e+ae+T(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ue+e+ae+e+e}return e}function ge(e){return te(ye("",null,null,null,[""],e=ee(e),0,[0],e))}function ye(e,t,n,i,l,o,r,s,a){for(var c=0,u=0,d=r,p=0,v=0,m=0,b=1,f=1,h=1,g=0,y="",_=l,w=o,E=i,C=y;f;)switch(m=g,g=Y()){case 40:if(108!=m&&58==C.charCodeAt(d-1)){-1!=R(C+=T(ne(g),"&","&\f"),"&\f")&&(h=-1);break}case 34:case 39:case 91:C+=ne(g);break;case 9:case 10:case 13:case 32:C+=ie(m);break;case 92:C+=le(Q()-1,7);continue;case 47:switch(X()){case 42:case 47:H(we(re(Y(),Q()),t,n),a);break;default:C+="/"}break;case 123*b:s[c++]=D(C)*h;case 125*b:case 59:case 0:switch(g){case 0:case 125:f=0;case 59+u:v>0&&D(C)-d&&H(v>32?Ee(C+";",i,n,d-1):Ee(T(C," ","")+";",i,n,d-2),a);break;case 59:C+=";";default:if(H(E=_e(C,t,n,c,u,l,s,y,_=[],w=[],d),o),123===g)if(0===u)ye(C,t,E,E,_,o,d,s,w);else switch(p){case 100:case 109:case 115:ye(e,E,E,i&&H(_e(e,E,E,0,0,l,s,y,l,_=[],d),w),l,w,d,s,i?_:w);break;default:ye(C,E,E,E,[""],w,0,s,w)}}c=u=v=0,b=h=1,y=C="",d=r;break;case 58:d=1+D(C),v=m;default:if(b<1)if(123==g)--b;else if(125==g&&0==b++&&125==W())continue;switch(C+=P(g),g*b){case 38:h=u>0?1:(C+="\f",-1);break;case 44:s[c++]=(D(C)-1)*h,h=1;break;case 64:45===X()&&(C+=ne(Y())),p=X(),u=d=D(y=C+=se(Q())),g++;break;case 45:45===m&&2==D(C)&&(b=0)}}return o}function _e(e,t,n,i,l,o,r,s,a,c,u){for(var d=l-1,p=0===l?o:[""],v=A(p),m=0,b=0,f=0;m0?p[h]+" "+g:T(g,/&\f/g,p[h])))&&(a[f++]=y);return q(e,t,n,0===l?pe:s,a,c,u)}function we(e,t,n){return q(e,t,n,de,P($),I(e,2,-2),0)}function Ee(e,t,n,i){return q(e,t,n,ve,I(e,0,i),I(e,i+1,-1),i)}var Ce=function(e,t,n){for(var i=0,l=0;i=l,l=X(),38===i&&12===l&&(t[n]=1),!J(l);)Y();return K(e,j)},ke=new WeakMap,Se=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ke.get(n))&&!i){ke.set(e,!0);for(var l=[],o=function(e,t){return te(function(e,t){var n=-1,i=44;do{switch(J(i)){case 0:38===i&&12===X()&&(t[n]=1),e[n]+=Ce(j-1,t,n);break;case 2:e[n]+=ne(i);break;case 4:if(44===i){e[++n]=58===X()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=P(i)}}while(i=Y());return e}(ee(e),t))}(t,l),r=n.props,s=0,a=0;s-1&&!e.return)switch(e.type){case ve:e.return=he(e.value,e.length);break;case me:return be([Z(e,{value:T(e.value,"@","@"+ue)})],i);case pe:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return be([Z(e,{props:[T(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return be([Z(e,{props:[T(t,/:(plac\w+)/,":-webkit-input-$1")]}),Z(e,{props:[T(t,/:(plac\w+)/,":-moz-$1")]}),Z(e,{props:[T(t,/:(plac\w+)/,ae+"input-$1")]})],i)}return""}))}}],Me=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,l,o=e.stylisPlugins||xe,r={},s=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++i,l-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(l){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Te={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Re=/[A-Z]|^ms/g,Fe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ie=function(e){return 45===e.charCodeAt(1)},De=function(e){return null!=e&&"boolean"!=typeof e},Ae=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Ie(n=e)?n:n.replace(Re,"-$&").toLowerCase()),t[e];var n}}(),He=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Fe,(function(e,t,n){return Be={name:t,styles:n,next:Be},t}))}return 1===Te[e]||Ie(e)||"number"!=typeof t||0===t?t:t+"px"};function ze(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Be={name:n.name,styles:n.styles,next:Be},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)Be={name:i.name,styles:i.styles,next:Be},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var l=0;l=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.brand+"/"+e.version)).join(" "):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const St=Math.round;function Ot(e,t,n){var i,l,o,r;void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect();let a=1,c=1;t&&wt(e)&&(a=e.offsetWidth>0&&St(s.width)/e.offsetWidth||1,c=e.offsetHeight>0&&St(s.height)/e.offsetHeight||1);const u=Et(e)?yt(e):window,d=!kt()&&n,p=(s.left+(d&&null!=(i=null==(l=u.visualViewport)?void 0:l.offsetLeft)?i:0))/a,v=(s.top+(d&&null!=(o=null==(r=u.visualViewport)?void 0:r.offsetTop)?o:0))/c,m=s.width/a,b=s.height/c;return{width:m,height:b,top:v,right:p+m,bottom:v+b,left:p,x:p,y:v}}function xt(e){return"html"===_t(e)?e:e.assignedSlot||e.parentNode||(function(e){return"undefined"!=typeof ShadowRoot&&(e instanceof yt(e).ShadowRoot||e instanceof ShadowRoot)}(e)?e.host:null)||function(e){return(t=e,(t instanceof yt(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}(e)}function Mt(e){const t=xt(e);return function(e){return["html","body","#document"].includes(_t(e))}(t)?e.ownerDocument.body:wt(t)&&Ct(t)?t:Mt(t)}function Lt(e,t){var n;void 0===t&&(t=[]);const i=Mt(e),l=i===(null==(n=e.ownerDocument)?void 0:n.body),o=yt(i),r=l?[o].concat(o.visualViewport||[],Ct(i)?i:[]):i,s=t.concat(r);return l?s:s.concat(Lt(r))}var Pt=x.useLayoutEffect;function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Tt(e){for(var t=1;t-1}function $t(e){return jt(e)?window.pageYOffset:e.scrollTop}function Gt(e,t){jt(e)?window.scrollTo(0,t):e.scrollTop=t}function qt(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Zt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:At,l=$t(e),o=t-l,r=10,s=0;function a(){var t=qt(s+=r,l,o,n);Gt(e,t),s=m)return{placement:"bottom",maxHeight:t};if(k>=m&&!r)return o&&Zt(a,S,x),{placement:"bottom",maxHeight:t};if(!r&&k>=i||r&&E>=i)return o&&Zt(a,S,x),{placement:"bottom",maxHeight:r?E-y:k-y};if("auto"===l||r){var M=t,L=r?w:C;return L>=i&&(M=Math.min(L-y-s.controlHeight,t)),{placement:"top",maxHeight:M}}if("bottom"===l)return o&&Gt(a,S),{placement:"bottom",maxHeight:t};break;case"top":if(w>=m)return{placement:"top",maxHeight:t};if(C>=m&&!r)return o&&Zt(a,O,x),{placement:"top",maxHeight:t};if(!r&&C>=i||r&&w>=i){var P=t;return(!r&&C>=i||r&&w>=i)&&(P=r?w-_:C-_),o&&Zt(a,O,x),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(l,'".'))}return c}var nn=function(e){return"auto"===e?"bottom":e},ln=(0,x.createContext)({getPortalPlacement:null}),on=function(e){bt(n,e);var t=It(n);function n(){var e;dt(this,n);for(var i=arguments.length,l=new Array(i),o=0;o{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));let u,d=null;if(r){let i=!0;d=new ResizeObserver((()=>{i||n(),i=!1})),Et(e)&&!s&&d.observe(e),d.observe(t)}let p=s?Ot(e):null;return s&&function t(){const i=Ot(e);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n(),p=i,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,s&&cancelAnimationFrame(u)}}(l,d.current,_,{elementResize:"ResizeObserver"in window}))}),[l,_]);Pt((function(){w()}),[w]);var E=(0,x.useCallback)((function(e){d.current=e,w()}),[w]);if(!t&&"fixed"!==a||!h)return null;var C=et("div",c({ref:E,css:u("menuPortal",{offset:h.offset,position:a,rect:h.rect}),className:o({"menu-portal":!0},i)},r),n);return et(ln.Provider,{value:{getPortalPlacement:y}},t?(0,ht.createPortal)(C,t):C)},LoadingMessage:un,NoOptionsMessage:cn,MultiValue:function(e){var t=e.children,n=e.className,i=e.components,l=e.cx,o=e.data,r=e.getStyles,s=e.innerProps,a=e.isDisabled,c=e.removeProps,u=e.selectProps,d=i.Container,p=i.Label,v=i.Remove;return et(ot,null,(function(i){var m=i.css,b=i.cx;return et(d,{data:o,innerProps:Tt({className:b(m(r("multiValue",e)),l({"multi-value":!0,"multi-value--is-disabled":a},n))},s),selectProps:u},et(p,{data:o,innerProps:{className:b(m(r("multiValueLabel",e)),l({"multi-value__label":!0},n))},selectProps:u},t),et(v,{data:o,innerProps:Tt({className:b(m(r("multiValueRemove",e)),l({"multi-value__remove":!0},n)),"aria-label":"Remove ".concat(t||"option")},c),selectProps:u}))}))},MultiValueContainer:Vn,MultiValueLabel:Vn,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return et("div",c({role:"button"},n),t||et(hn,{size:14}))},Option:function(e){var t=e.children,n=e.className,i=e.cx,l=e.getStyles,o=e.isDisabled,r=e.isFocused,s=e.isSelected,a=e.innerRef,u=e.innerProps;return et("div",c({css:l("option",e),className:i({option:!0,"option--is-disabled":o,"option--is-focused":r,"option--is-selected":s},n),ref:a,"aria-disabled":o},u),t)},Placeholder:function(e){var t=e.children,n=e.className,i=e.cx,l=e.getStyles,o=e.innerProps;return et("div",c({css:l("placeholder",e),className:i({placeholder:!0},n)},o),t)},SelectContainer:function(e){var t=e.children,n=e.className,i=e.cx,l=e.getStyles,o=e.innerProps,r=e.isDisabled,s=e.isRtl;return et("div",c({css:l("container",e),className:i({"--is-disabled":r,"--is-rtl":s},n)},o),t)},SingleValue:function(e){var t=e.children,n=e.className,i=e.cx,l=e.getStyles,o=e.isDisabled,r=e.innerProps;return et("div",c({css:l("singleValue",e),className:i({"single-value":!0,"single-value--is-disabled":o},n)},r),t)},ValueContainer:function(e){var t=e.children,n=e.className,i=e.cx,l=e.innerProps,o=e.isMulti,r=e.getStyles,s=e.hasValue;return et("div",c({css:r("valueContainer",e),className:i({"value-container":!0,"value-container--is-multi":o,"value-container--has-value":s},n)},l),t)}},Tn=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Rn(e){return function(e){if(Array.isArray(e))return st(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||at(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Fn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function In(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(l.join(","),", selected.");case"select-option":return"option ".concat(i,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,l=e.label,o=void 0===l?"":l,r=e.selectValue,s=e.isDisabled,a=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&r)return"value ".concat(o," focused, ").concat(c(r,n),".");if("menu"===t){var u=s?" disabled":"",d="".concat(a?"selected":"focused").concat(u);return"option ".concat(o," ").concat(d,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},zn=function(e){var t=e.ariaSelection,n=e.focusedOption,i=e.focusedValue,l=e.focusableOptions,o=e.isFocused,r=e.selectValue,s=e.selectProps,a=e.id,c=s.ariaLiveMessages,u=s.getOptionLabel,d=s.inputValue,p=s.isMulti,v=s.isOptionDisabled,m=s.isSearchable,b=s.menuIsOpen,f=s.options,h=s.screenReaderStatus,g=s.tabSelectsValue,y=s["aria-label"],_=s["aria-live"],w=(0,x.useMemo)((function(){return Tt(Tt({},Hn),c||{})}),[c]),E=(0,x.useMemo)((function(){var e,n="";if(t&&w.onChange){var i=t.option,l=t.options,o=t.removedValue,s=t.removedValues,a=t.value,c=o||i||(e=a,Array.isArray(e)?null:e),d=c?u(c):"",p=l||s||void 0,m=p?p.map(u):[],b=Tt({isDisabled:c&&v(c,r),label:d,labels:m},t);n=w.onChange(b)}return n}),[t,w,v,r,u]),C=(0,x.useMemo)((function(){var e="",t=n||i,l=!!(n&&r&&r.includes(n));if(t&&w.onFocus){var o={focused:t,label:u(t),isDisabled:v(t,r),isSelected:l,options:f,context:t===n?"menu":"value",selectValue:r};e=w.onFocus(o)}return e}),[n,i,u,v,w,f,r]),k=(0,x.useMemo)((function(){var e="";if(b&&f.length&&w.onFilter){var t=h({count:l.length});e=w.onFilter({inputValue:d,resultsMessage:t})}return e}),[l,d,b,w,f,h]),S=(0,x.useMemo)((function(){var e="";if(w.guidance){var t=i?"value":b?"menu":"input";e=w.guidance({"aria-label":y,context:t,isDisabled:n&&v(n,r),isMulti:p,isSearchable:m,tabSelectsValue:g})}return e}),[y,n,i,p,v,m,b,w,r,g]),O="".concat(C," ").concat(k," ").concat(S),M=et(x.Fragment,null,et("span",{id:"aria-selection"},E),et("span",{id:"aria-context"},O)),L="initial-input-focus"===(null==t?void 0:t.action);return et(x.Fragment,null,et(An,{id:a},L&&M),et(An,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text"},o&&!L&&M))},Bn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Un=new RegExp("["+Bn.map((function(e){return e.letters})).join("")+"]","g"),jn={},$n=0;$n1?t-1:0),i=1;i0,b=d-p-u,f=!1;b>t&&r.current&&(i&&i(e),r.current=!1),m&&s.current&&(o&&o(e),s.current=!1),m&&t>b?(n&&!r.current&&n(e),v.scrollTop=d,f=!0,r.current=!0):!m&&-t>u&&(l&&!s.current&&l(e),v.scrollTop=0,f=!0,s.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,i,l,o]),d=(0,x.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,x.useCallback)((function(e){a.current=e.changedTouches[0].clientY}),[]),v=(0,x.useCallback)((function(e){var t=a.current-e.changedTouches[0].clientY;u(e,t)}),[u]),m=(0,x.useCallback)((function(e){if(e){var t=!!Kt&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",v,t)}}),[v,p,d]),b=(0,x.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",v,!1))}),[v,p,d]);return(0,x.useEffect)((function(){if(t){var e=c.current;return m(e),function(){b(e)}}}),[t,m,b]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),o=function(e){var t=e.isEnabled,n=e.accountForScrollbars,i=void 0===n||n,l=(0,x.useRef)({}),o=(0,x.useRef)(null),r=(0,x.useCallback)((function(e){if(oi){var t=document.body,n=t&&t.style;if(i&&Jn.forEach((function(e){var t=n&&n[e];l.current[e]=t})),i&&ri<1){var o=parseInt(l.current.paddingRight,10)||0,r=document.body?document.body.clientWidth:0,s=window.innerWidth-r+o||0;Object.keys(ei).forEach((function(e){var t=ei[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(s,"px"))}t&&li()&&(t.addEventListener("touchmove",ti,si),e&&(e.addEventListener("touchstart",ii,si),e.addEventListener("touchmove",ni,si))),ri+=1}}),[i]),s=(0,x.useCallback)((function(e){if(oi){var t=document.body,n=t&&t.style;ri=Math.max(ri-1,0),i&&ri<1&&Jn.forEach((function(e){var t=l.current[e];n&&(n[e]=t)})),t&&li()&&(t.removeEventListener("touchmove",ti,si),e&&(e.removeEventListener("touchstart",ii,si),e.removeEventListener("touchmove",ni,si)))}}),[i]);return(0,x.useEffect)((function(){if(t){var e=o.current;return r(e),function(){s(e)}}}),[t,r,s]),function(e){o.current=e}}({isEnabled:n});return et(x.Fragment,null,n&&et("div",{onClick:ai,css:ci}),t((function(e){l(e),o(e)})))}var di={clearIndicator:En,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,i=e.theme,l=i.colors,o=i.borderRadius,r=i.spacing;return{label:"control",alignItems:"center",backgroundColor:t?l.neutral5:l.neutral0,borderColor:t?l.neutral10:n?l.primary:l.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(l.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?l.primary:l.neutral30}}},dropdownIndicator:wn,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing.baseUnit,l=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?l.neutral10:l.neutral20,marginBottom:2*i,marginTop:2*i,width:1}},input:function(e){var t=e.isDisabled,n=e.value,i=e.theme,l=i.spacing,o=i.colors;return Tt({margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,visibility:t?"hidden":"visible",color:o.neutral80,transform:n?"translateZ(0)":""},Ln)},loadingIndicator:function(e){var t=e.isFocused,n=e.size,i=e.theme,l=i.colors,o=i.spacing.baseUnit;return{label:"loadingIndicator",color:t?l.neutral60:l.neutral20,display:"flex",padding:2*o,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:an,menu:function(e){var t,n=e.placement,i=e.theme,l=i.borderRadius,o=i.spacing,r=i.colors;return ft(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),ft(t,"backgroundColor",r.neutral0),ft(t,"borderRadius",l),ft(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),ft(t,"marginBottom",o.menuGutter),ft(t,"marginTop",o.menuGutter),ft(t,"position","absolute"),ft(t,"width","100%"),ft(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:i/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,i=t.colors,l=e.cropWithEllipsis;return{borderRadius:n/2,color:i.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:l||void 0===l?"ellipsis":void 0,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius,l=t.colors;return{alignItems:"center",borderRadius:i/2,backgroundColor:e.isFocused?l.dangerLight:void 0,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}}},noOptionsMessage:sn,option:function(e){var t=e.isDisabled,n=e.isFocused,i=e.isSelected,l=e.theme,o=l.spacing,r=l.colors;return{label:"option",backgroundColor:i?r.primary:n?r.primary25:"transparent",color:t?r.neutral20:i?r.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:t?void 0:i?r.primary:r.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2}},singleValue:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing,l=n.colors;return{label:"singleValue",color:t?l.neutral40:l.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},valueContainer:function(e){var t=e.theme.spacing,n=e.isMulti,i=e.hasValue,l=e.selectProps.controlShouldRenderValue;return{alignItems:"center",display:n&&i&&l?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},pi={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},vi={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Wt(),captureMenuScroll:!Wt(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=Tt({ignoreCase:!0,ignoreAccents:!0,stringify:Xn,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,l=n.ignoreAccents,o=n.stringify,r=n.trim,s=n.matchFrom,a=r?Yn(t):t,c=r?Yn(o(e)):o(e);return i&&(a=a.toLowerCase(),c=c.toLowerCase()),l&&(a=Wn(a),c=Zn(c)),"start"===s?c.substr(0,a.length)===a:c.indexOf(a)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function mi(e,t,n,i){return{type:"option",data:t,isDisabled:_i(e,t,n),isSelected:wi(e,t,n),label:gi(e,t),value:yi(e,t),index:i}}function bi(e,t){return e.options.map((function(n,i){if("options"in n){var l=n.options.map((function(n,i){return mi(e,n,t,i)})).filter((function(t){return hi(e,t)}));return l.length>0?{type:"group",data:n,options:l,index:i}:void 0}var o=mi(e,n,t,i);return hi(e,o)?o:void 0})).filter(Jt)}function fi(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Rn(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function hi(e,t){var n=e.inputValue,i=void 0===n?"":n,l=t.data,o=t.isSelected,r=t.label,s=t.value;return(!Ci(e)||!o)&&Ei(e,{label:r,value:s,data:l},i)}var gi=function(e,t){return e.getOptionLabel(t)},yi=function(e,t){return e.getOptionValue(t)};function _i(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function wi(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=yi(e,t);return n.some((function(t){return yi(e,t)===i}))}function Ei(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Ci=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},ki=1,Si=function(e){bt(n,e);var t=It(n);function n(e){var i;return dt(this,n),(i=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.instancePrefix="",i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(e){i.controlRef=e},i.focusedOptionRef=null,i.getFocusedOptionRef=function(e){i.focusedOptionRef=e},i.menuListRef=null,i.getMenuListRef=function(e){i.menuListRef=e},i.inputRef=null,i.getInputRef=function(e){i.inputRef=e},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(e,t){var n=i.props,l=n.onChange,o=n.name;t.name=o,i.ariaOnChange(e,t),l(e,t)},i.setValue=function(e,t,n){var l=i.props,o=l.closeMenuOnSelect,r=l.isMulti,s=l.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(i.setState({inputIsHiddenAfterUpdate:!r}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(e,{action:t,option:n})},i.selectOption=function(e){var t=i.props,n=t.blurInputOnSelect,l=t.isMulti,o=t.name,r=i.state.selectValue,s=l&&i.isOptionSelected(e,r),a=i.isOptionDisabled(e,r);if(s){var c=i.getOptionValue(e);i.setValue(r.filter((function(e){return i.getOptionValue(e)!==c})),"deselect-option",e)}else{if(a)return void i.ariaOnChange(e,{action:"select-option",option:e,name:o});l?i.setValue([].concat(Rn(r),[e]),"select-option",e):i.setValue(e,"select-option")}n&&i.blurInput()},i.removeValue=function(e){var t=i.props.isMulti,n=i.state.selectValue,l=i.getOptionValue(e),o=n.filter((function(e){return i.getOptionValue(e)!==l})),r=en(t,o,o[0]||null);i.onChange(r,{action:"remove-value",removedValue:e}),i.focusInput()},i.clearValue=function(){var e=i.state.selectValue;i.onChange(en(i.props.isMulti,[],null),{action:"clear",removedValues:e})},i.popValue=function(){var e=i.props.isMulti,t=i.state.selectValue,n=t[t.length-1],l=t.slice(0,t.length-1),o=en(e,l,l[0]||null);i.onChange(o,{action:"pop-value",removedValue:n})},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n5||o>5}},i.onTouchEnd=function(e){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(e.target)&&i.menuListRef&&!i.menuListRef.contains(e.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(e){i.userIsDragging||i.onControlMouseDown(e)},i.onClearIndicatorTouchEnd=function(e){i.userIsDragging||i.onClearIndicatorMouseDown(e)},i.onDropdownIndicatorTouchEnd=function(e){i.userIsDragging||i.onDropdownIndicatorMouseDown(e)},i.handleInputChange=function(e){var t=i.props.inputValue,n=e.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(n,{action:"input-change",prevInputValue:t}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(e){i.props.onFocus&&i.props.onFocus(e),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(e){var t=i.props.inputValue;i.menuListRef&&i.menuListRef.contains(document.activeElement)?i.inputRef.focus():(i.props.onBlur&&i.props.onBlur(e),i.onInputChange("",{action:"input-blur",prevInputValue:t}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1}))},i.onOptionHover=function(e){i.blockOptionHover||i.state.focusedOption===e||i.setState({focusedOption:e})},i.shouldHideSelectedOptions=function(){return Ci(i.props)},i.onKeyDown=function(e){var t=i.props,n=t.isMulti,l=t.backspaceRemovesValue,o=t.escapeClearsValue,r=t.inputValue,s=t.isClearable,a=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,v=i.state,m=v.focusedOption,b=v.focusedValue,f=v.selectValue;if(!(a||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(i.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||r)return;i.focusValue("previous");break;case"ArrowRight":if(!n||r)return;i.focusValue("next");break;case"Delete":case"Backspace":if(r)return;if(b)i.removeValue(b);else{if(!l)return;n?i.popValue():s&&i.clearValue()}break;case"Tab":if(i.isComposing)return;if(e.shiftKey||!c||!d||!m||p&&i.isOptionSelected(m,f))return;i.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(i.isComposing)return;i.selectOption(m);break}return;case"Escape":c?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:r}),i.onMenuClose()):s&&o&&i.clearValue();break;case" ":if(r)return;if(!c){i.openMenu("first");break}if(!m)return;i.selectOption(m);break;case"ArrowUp":c?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":c?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!c)return;i.focusOption("pageup");break;case"PageDown":if(!c)return;i.focusOption("pagedown");break;case"Home":if(!c)return;i.focusOption("first");break;case"End":if(!c)return;i.focusOption("last");break;default:return}e.preventDefault()}},i.instancePrefix="react-select-"+(i.props.instanceId||++ki),i.state.selectValue=Bt(e.value),i}return vt(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,i,l,o,r=this.props,s=r.isDisabled,a=r.menuIsOpen,c=this.state.isFocused;(c&&!s&&e.isDisabled||c&&a&&!e.menuIsOpen)&&this.focusInput(),c&&s&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,i=t.getBoundingClientRect(),l=n.getBoundingClientRect(),o=n.offsetHeight/3,l.bottom+o>i.bottom?Gt(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+o,t.scrollHeight)):l.top-o-1&&(r=s)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[r]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=n.indexOf(i);i||(l=-1);var o=n.length-1,r=-1;if(n.length){switch(e){case"previous":r=0===l?0:-1===l?o:l-1;break;case"next":l>-1&&l0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var l=0,o=i.indexOf(n);n||(o=-1),"up"===e?l=o>0?o-1:i.length-1:"down"===e?l=(o+1)%i.length:"pageup"===e?(l=o-t)<0&&(l=0):"pagedown"===e?(l=o+t)>i.length-1&&(l=i.length-1):"last"===e&&(l=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[l],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(pi):Tt(Tt({},pi),this.props.theme):pi}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getValue,l=this.selectOption,o=this.setValue,r=this.props,s=r.isMulti,a=r.isRtl,c=r.options;return{clearValue:e,cx:t,getStyles:n,getValue:i,hasValue:this.hasValue(),isMulti:s,isRtl:a,options:c,selectOption:l,selectProps:r,setValue:o,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return _i(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return wi(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Ei(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,l=e.inputValue,o=e.tabIndex,r=e.form,s=e.menuIsOpen,a=this.getComponents().Input,u=this.state,d=u.inputIsHidden,p=u.ariaSelection,v=this.commonProps,m=i||this.getElementId("input"),b=Tt(Tt(Tt({"aria-autocomplete":"list","aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},s&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==p?void 0:p.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?x.createElement(a,c({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:o,form:r,type:"text",value:l},b)):x.createElement(Kn,c({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:At,onFocus:this.onInputFocus,disabled:t,tabIndex:o,inputMode:"none",form:r,value:""},b))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,l=t.MultiValueLabel,o=t.MultiValueRemove,r=t.SingleValue,s=t.Placeholder,a=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,v=u.isMulti,m=u.inputValue,b=u.placeholder,f=this.state,h=f.selectValue,g=f.focusedValue,y=f.isFocused;if(!this.hasValue()||!d)return m?null:x.createElement(s,c({},a,{key:"placeholder",isDisabled:p,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return h.map((function(t,r){var s=t===g,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return x.createElement(n,c({},a,{components:{Container:i,Label:l,Remove:o},isFocused:s,isDisabled:p,key:u,index:r,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(m)return null;var _=h[0];return x.createElement(r,c({},a,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,l=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||l)return null;var r={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return x.createElement(e,c({},t,{innerProps:r,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,l=n.isLoading,o=this.state.isFocused;return e&&l?x.createElement(e,c({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:o})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,l=this.props.isDisabled,o=this.state.isFocused;return x.createElement(n,c({},i,{isDisabled:l,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return x.createElement(e,c({},t,{innerProps:l,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,l=t.Menu,o=t.MenuList,r=t.MenuPortal,s=t.LoadingMessage,a=t.NoOptionsMessage,u=t.Option,d=this.commonProps,p=this.state.focusedOption,v=this.props,m=v.captureMenuScroll,b=v.inputValue,f=v.isLoading,h=v.loadingMessage,g=v.minMenuHeight,y=v.maxMenuHeight,_=v.menuIsOpen,w=v.menuPlacement,E=v.menuPosition,C=v.menuPortalTarget,k=v.menuShouldBlockScroll,S=v.menuShouldScrollIntoView,O=v.noOptionsMessage,M=v.onMenuScrollToTop,L=v.onMenuScrollToBottom;if(!_)return null;var P,V=function(t,n){var i=t.type,l=t.data,o=t.isDisabled,r=t.isSelected,s=t.label,a=t.value,v=p===l,m=o?void 0:function(){return e.onOptionHover(l)},b=o?void 0:function(){return e.selectOption(l)},f="".concat(e.getElementId("option"),"-").concat(n),h={id:f,onClick:b,onMouseMove:m,onMouseOver:m,tabIndex:-1};return x.createElement(u,c({},d,{innerProps:h,data:l,isDisabled:o,isSelected:r,key:f,label:s,type:i,value:a,isFocused:v,innerRef:v?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())P=this.getCategorizedOptions().map((function(t){if("group"===t.type){var l=t.data,o=t.options,r=t.index,s="".concat(e.getElementId("group"),"-").concat(r),a="".concat(s,"-heading");return x.createElement(n,c({},d,{key:s,data:l,options:o,Heading:i,headingProps:{id:a,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return V(e,"".concat(r,"-").concat(e.index))})))}if("option"===t.type)return V(t,"".concat(t.index))}));else if(f){var N=h({inputValue:b});if(null===N)return null;P=x.createElement(s,d,N)}else{var T=O({inputValue:b});if(null===T)return null;P=x.createElement(a,d,T)}var R={minMenuHeight:g,maxMenuHeight:y,menuPlacement:w,menuPosition:E,menuShouldScrollIntoView:S},F=x.createElement(on,c({},d,R),(function(t){var n=t.ref,i=t.placerProps,r=i.placement,s=i.maxHeight;return x.createElement(l,c({},d,R,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:f,placement:r}),x.createElement(ui,{captureEnabled:m,onTopArrive:M,onBottomArrive:L,lockEnabled:k},(function(t){return x.createElement(o,c({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:f,maxHeight:s,focusedOption:p}),P)})))}));return C||"fixed"===E?x.createElement(r,c({},d,{appendTo:C,controlElement:this.controlRef,menuPlacement:w,menuPosition:E}),F):F}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,l=t.isMulti,o=t.name,r=this.state.selectValue;if(o&&!i){if(l){if(n){var s=r.map((function(t){return e.getOptionValue(t)})).join(n);return x.createElement("input",{name:o,type:"hidden",value:s})}var a=r.length>0?r.map((function(t,n){return x.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})})):x.createElement("input",{name:o,type:"hidden"});return x.createElement("div",null,a)}var c=r[0]?this.getOptionValue(r[0]):"";return x.createElement("input",{name:o,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,l=t.focusedValue,o=t.isFocused,r=t.selectValue,s=this.getFocusableOptions();return x.createElement(zn,c({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:l,isFocused:o,selectValue:r,focusableOptions:s}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,l=e.ValueContainer,o=this.props,r=o.className,s=o.id,a=o.isDisabled,u=o.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return x.createElement(i,c({},p,{className:r,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:a,isFocused:d}),this.renderLiveRegion(),x.createElement(t,c({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:a,isFocused:d,menuIsOpen:u}),x.createElement(l,c({},p,{isDisabled:a}),this.renderPlaceholderOrValue(),this.renderInput()),x.createElement(n,c({},p,{isDisabled:a}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,l=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,r=t.isFocused,s=t.prevWasFocused,a=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,v=Bt(c),m={};if(n&&(c!==n.value||a!==n.options||u!==n.menuIsOpen||d!==n.inputValue)){var b=u?function(e,t){return fi(bi(e,t))}(e,v):[],f=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i-1?n:t[0]}(t,b);m={selectValue:v,focusedOption:h,focusedValue:f,clearFocusValueOnUpdate:!1}}var g=null!=l&&e!==n?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},y=o,_=r&&s;return r&&!_&&(y={value:en(p,v,v[0]||null),options:v,action:"initial-input-focus"},_=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(y=null),Tt(Tt(Tt({},m),g),{},{prevProps:e,ariaSelection:y,prevWasFocused:_})}}]),n}(x.Component);Si.defaultProps=vi;var Oi=(0,x.forwardRef)((function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,i=e.defaultMenuIsOpen,l=void 0!==i&&i,o=e.defaultValue,r=void 0===o?null:o,s=e.inputValue,a=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,v=e.value,m=rt(e,Tn),b=ct((0,x.useState)(void 0!==s?s:n),2),f=b[0],h=b[1],g=ct((0,x.useState)(void 0!==a?a:l),2),y=g[0],_=g[1],w=ct((0,x.useState)(void 0!==v?v:r),2),E=w[0],C=w[1],k=(0,x.useCallback)((function(e,t){"function"==typeof c&&c(e,t),C(e)}),[c]),S=(0,x.useCallback)((function(e,t){var n;"function"==typeof u&&(n=u(e,t)),h(void 0!==n?n:e)}),[u]),O=(0,x.useCallback)((function(){"function"==typeof p&&p(),_(!0)}),[p]),M=(0,x.useCallback)((function(){"function"==typeof d&&d(),_(!1)}),[d]),L=void 0!==s?s:f,P=void 0!==a?a:y,V=void 0!==v?v:E;return Tt(Tt({},m),{},{inputValue:L,menuIsOpen:P,onChange:k,onInputChange:S,onMenuClose:M,onMenuOpen:O,value:V})}(e);return x.createElement(Si,c({ref:t},n))})),xi=(x.Component,Oi);function Mi(n){var l,o,r;const{variables:s,userRole:c,setControlAtts:u}=n,d=null!==(l=null==c?void 0:c.restrictedRoles)&&void 0!==l?l:[],p=null!==(o=null==c?void 0:c.hideOnRestrictedRoles)&&void 0!==o&&o,v=null!==(r=null==s?void 0:s.user_roles)&&void 0!==r?r:[],m=p?(0,i.__)("Hide the block from","block-visibility"):(0,i.__)("Show the block to","block-visibility"),b=v.filter((e=>d.includes(e.value)));return(0,e.createElement)("div",{className:"visibility-control__container"},(0,e.createElement)("div",{className:"visibility-control restricted-roles"},(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)( +// Translators: Whether the block is hidden or visible. +(0,i.__)("%s users with at least one of the selected roles.","block-visibility"),m)),(0,e.createElement)(xi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:v,value:b,placeholder:(0,i.__)("Select Role…","block-visibility"),onChange:e=>(e=>{const n=[];0!==e.length&&e.forEach((e=>{n.push(e.value)})),u("userRole",(0,t.assign)({...c},{restrictedRoles:n}))})(e),isMulti:!0})),(0,e.createElement)("div",{className:"visibility-control hide-on-restricted-roles"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide from selected roles","block-visibility"),checked:p,onChange:()=>u("userRole",(0,t.assign)({...c},{hideOnRestrictedRoles:!p}))})))}var Li=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),Pi=window.wp.date;function Vi(t){const{value:n,onDateChange:i,setPopoverOpen:l,includeTime:o}=t,r=(0,Pi.__experimentalGetSettings)(),s=/a(?!\\)/i.test(r.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,e.createElement)(a.Popover,{className:"block-visibility__date-time-popover",onClose:l.bind(null,!1)},[o&&(0,e.createElement)(a.DateTimePicker,{currentDate:n,onChange:e=>{i(e),l(!1)},is12Hour:s}),!o&&(0,e.createElement)(a.DatePicker,{currentDate:n,onChange:e=>{i(e),l(!1)},is12Hour:s})])}var Ni=(0,e.createElement)(m.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(m.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"}));function Ti(t){const{value:n,setPopoverOpen:l,onClearDateTime:o,includeTime:r}=t;let s=r?(0,i.__)("Select Date and Time…","block-visibility"):(0,i.__)("Select Date…","block-visibility");const c=(0,Pi.__experimentalGetSettings)();if(n){const e=r?`${c.formats.date} ${c.formats.time}`:`${c.formats.date}`;s=(0,Pi.format)(e,n)}return(0,e.createElement)("div",{className:v()("date-time__date-time-field",{"has-value":n})},(0,e.createElement)(a.Button,{icon:Ni,title:(0,i.__)("Select date/time","block-visibility"),onClick:()=>l((e=>!e)),isLink:!0},(0,e.createElement)("span",null,s)),n&&(0,e.createElement)(a.Button,{icon:Li,className:"clear-date-time",title:(0,i.__)("Clear date/time","block-visibility"),onClick:()=>o("")}))}function Ri(t){const{value:n,onChange:i,includeTime:l}=t,[o,r]=(0,e.useState)(!1);return(0,e.createElement)("div",{className:"date-time"},(0,e.createElement)(Ti,{value:n,setPopoverOpen:r,onClearDateTime:()=>i(""),includeTime:l}),o&&(0,e.createElement)(Vi,{value:n,onDateChange:e=>i(e),setPopoverOpen:r,includeTime:l}))}function Fi(t){const{rule:n,fieldType:l,fieldName:o,valueType:r,options:s,placeholder:c,handleRuleChange:u,triggerReset:d,hasGroupedOptions:p}=t;if(!n.field&&"ruleField"!==l)return null;let m="";var b;if("ruleField"===l)m=null!==(b=null==n?void 0:n.field)&&void 0!==b?b:"";else if("subField"===l){var f,h;m=null!=n&&n.subFields?null!==(f=n.subFields[o])&&void 0!==f?f:"":null!==(h=null==n?void 0:n.subField)&&void 0!==h?h:""}else{var g;m=null!==(g=n["operatorField"===l?"operator":"value"])&&void 0!==g?g:""}if("select"===r||"multiSelect"===r){let e="",t=s;if(p){const e=[];s.forEach((t=>{e.push(...t.options)})),t=e}"multiSelect"===r?e=t.filter((e=>m.includes(e.value))):(e=t.filter((e=>e.value===m)),0!==e.length&&(e=e[0])),m=e}const y="field__"+l;if("select"===r||"multiSelect"===r){const t=c||(0,i.__)("Select…","block-visibility");return(0,e.createElement)(xi,{className:v()("block-visibility__react-select",y),classNamePrefix:"react-select",value:m,options:s,placeholder:t,onChange:e=>u(e,r,l,o,d),isMulti:"multiSelect"===r})}return"date"===r||"dateTime"===r?(0,e.createElement)(Ri,{className:y,value:m,onChange:e=>u(e,r,l,o,d),includeTime:"dateTime"===r}):"toggle"===r?(0,e.createElement)(a.ToggleControl,{className:y,label:c,checked:m,onChange:()=>u(!m,r,l,o,d)}):(0,e.createElement)(a.TextControl,{className:y,type:r,min:"number"===r?0:"",value:m,placeholder:c,onChange:e=>u(e,"text",l,o,d)})}function Ii(n){var l,o,r,s,c,u,d,p;const{rule:m,ruleIndex:b,ruleSet:f,ruleSetIndex:h,ruleSets:g,hideOnRuleSets:y,rulePlaceholder:_,ruleLabel:w,controlName:E,controlAtts:C,setControlAtts:k,groupedFields:S,allFields:O}=n;let x=O.filter((e=>e.value===m.field));0!==x.length&&(x=x[0]);const M=null!==(l=null===(o=x)||void 0===o?void 0:o.fields)&&void 0!==l?l:[],L=null!==(r=null===(s=x)||void 0===s?void 0:s.help)&&void 0!==r&&r,P=null!==(c=null===(u=x)||void 0===u?void 0:u.hasMultipleSubFields)&&void 0!==c&&c,V=null!==(d=null===(p=x)||void 0===p?void 0:p.hasSimplifiedLayout)&&void 0!==d&&d;let N=w;N||(N=()=>0===b?(0,i.sprintf)( +// Translators: Whether the block is hidden or visible. +(0,i.__)("%s the block if","block-visibility"),y?(0,i.__)("Hide","block-visibility"):(0,i.__)("Show","block-visibility")):(0,i.__)("And if","block-visibility"));const T=(0,e.createElement)(a.Button,{label:f.rules.length<=1?(0,i.__)("Clear Rule","block-visibility"):(0,i.__)("Delete Rule","block-visibility"),icon:Li,className:"toolbar__delete",onClick:()=>(()=>{const e=[...g],n=f.rules.filter(((e,t)=>t!==b));e[h]=(0,t.assign)({...f},{rules:[...n]}),k(E,(0,t.assign)({...C},{ruleSets:[...e]}))})()}),R=function(e,n,i){let l,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];"select"===n?l=e.value:"multiSelect"===n?(l=[],0!==e.length&&e.forEach((e=>{l.push(e.value)}))):l=e;const s=[...g],a=[...f.rules];if("ruleField"===i)a[b]={field:l};else if("subField"===i)a[b]=P?(0,t.assign)({...a[b]},{subFields:{...a[b].subFields,[o]:l}}):(0,t.assign)({...a[b]},{subField:l}),r&&delete a[b].value;else{const e="operatorField"===i?"operator":"value";a[b]=(0,t.assign)({...a[b]},{[e]:l})}s[h]=(0,t.assign)({...f},{rules:a}),k(E,(0,t.assign)({...C},{ruleSets:[...s]}))};return(0,e.createElement)("div",{key:b,className:"rule"},(0,e.createElement)("div",{className:"rule__header"},(0,e.createElement)("span",null,N(b)),T),(0,e.createElement)("div",{className:"rule__fields"},(0,e.createElement)("div",{className:v()("fields-container",{"is-simplified":V})},(0,e.createElement)(Fi,{rule:m,fieldType:"ruleField",valueType:"select",options:S,placeholder:null!=_?_:(0,i.__)("Select Rule…","block-visibility"),handleRuleChange:R,hasGroupedOptions:!0}),M.map((t=>{var n,i,l,o,r,s,a,c;const u=null!==(n=null==t?void 0:t.displayConditions)&&void 0!==n?n:[];if(0!==u.length){const e=[];if(u.forEach((t=>{let n;if(P&&"subField"===t.dependencyType){var i,l;const e=null!==(i=null==m?void 0:m.subFields)&&void 0!==i?i:[];n=null!==(l=e[t.dependencyName])&&void 0!==l?l:""}else{var o;const e="operatorField"===t.dependencyType?"operator":"subField";n=null!==(o=m[e])&&void 0!==o?o:""}var r;"dynamic"===t.dependencyValues?0!==(null!==(r=null==t?void 0:t.options)&&void 0!==r?r:[]).filter((e=>e.value===n)).length&&e.push(!0):t.dependencyValues.includes(n)&&e.push(!0)})),0===e.length)return null}let d,p;const v=null!==(i=null==t?void 0:t.conditionalOptions)&&void 0!==i?i:[];var b,f;return 0!==v.length?v.forEach((e=>{let t;if(P&&"subField"===e.dependencyType){var n,i;const l=null!==(n=null==m?void 0:m.subFields)&&void 0!==n?n:[];t=null!==(i=l[e.dependencyName])&&void 0!==i?i:""}else{var l;t=null!==(l=m[e.dependencyType])&&void 0!==l?l:""}if("dynamic"===e.dependencyValues){var o,r,s,a;const n=(null!==(o=null==e?void 0:e.options)&&void 0!==o?o:[]).filter((e=>e.value===t));d=null!==(r=null===(s=n[0])||void 0===s?void 0:s.valueOptions)&&void 0!==r?r:[],p=null!==(a=null==e?void 0:e.placeholder)&&void 0!==a?a:""}else if(e.dependencyValues.includes(t)){var c,u;d=null!==(c=null==e?void 0:e.options)&&void 0!==c?c:[],p=null!==(u=null==e?void 0:e.placeholder)&&void 0!==u?u:""}})):(d=null!==(b=null==t?void 0:t.options)&&void 0!==b?b:[],p=null!==(f=null==t?void 0:t.placeholder)&&void 0!==f?f:""),(0,e.createElement)(Fi,{key:null!==(l=null==t?void 0:t.type)&&void 0!==l?l:"valueField",rule:m,fieldType:null!==(o=null==t?void 0:t.type)&&void 0!==o?o:"valueField",fieldName:null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"",valueType:null!==(s=null==t?void 0:t.valueType)&&void 0!==s?s:"text",options:d,placeholder:p,handleRuleChange:R,triggerReset:null!==(a=null==t?void 0:t.triggerReset)&&void 0!==a&&a,hasGroupedOptions:null!==(c=null==t?void 0:t.hasGroupedOptions)&&void 0!==c&&c})}))),L&&(0,e.createElement)("div",{className:"visibility-control__help"},x.help)))}function Di(n){var l,o,r;const{ruleSet:s,ruleSetIndex:u,ruleSets:d,controlName:p,controlAtts:m,setControlAtts:h}=n,g=null!==(l=null==s?void 0:s.title)&&void 0!==l?l:"",y=g||(0,i.__)("Rule Set","block-visibility"),_=null===(o=null==s?void 0:s.enable)||void 0===o||o,w=null!==(r=null==s?void 0:s.rules)&&void 0!==r?r:[];0===w.length&&w.push({field:""});const E=(e,n)=>{const i={...s},l=[...d];i[e]=n,l[u]=i,h(p,(0,t.assign)({...m},{ruleSets:[...l]}))},C=(0,e.createElement)(a.DropdownMenu,{className:"settings-dropdown",label:(0,i.__)("Settings","block-visibility"),icon:b,popoverProps:{className:"block-visibility__control-popover control-settings",focusOnMount:"container"}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h3",null,(0,i.__)("Settings","block-visibility")),(0,e.createElement)(a.TextControl,{value:g,label:(0,i.__)("Rule set title","block-visibility"),placeholder:(0,i.__)("Rule Set","block-visibility"),onChange:e=>E("title",e)}),(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Enable rule set","block-visibility"),checked:_,onChange:()=>E("enable",!_)})))),k=d.length<=1?(0,i.__)("Clear rule set","block-visibility"):(0,i.__)("Remove rule set","block-visibility"),S=(0,e.createElement)(a.DropdownMenu,{className:"options-dropdown",label:(0,i.__)("Options","block-visibility"),icon:f,popoverProps:{focusOnMount:"container"}},(n=>{let{onClose:l}=n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"RuleSetOptionsTop"}),(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Tools","block-visibility")},(0,e.createElement)(a.Slot,{name:"RuleSetMoreSettingsTools"}),(0,e.createElement)(a.MenuItem,{className:"more-settings__tools-duplicate",onClick:()=>{!function(){const e=[...d,s];h(p,(0,t.assign)({...m},{ruleSets:[...e]}))}(),l()}},(0,i.__)("Duplicate","block-visibility"))),(0,e.createElement)(a.Slot,{name:"RuleSetOptionsMiddle"}),(0,e.createElement)(a.MenuGroup,null,(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=d.filter(((e,t)=>t!==u));h(p,(0,t.assign)({...m},{ruleSets:[...e]}))}(),l()}},k)),(0,e.createElement)(a.Slot,{name:"RuleSetOptionsBottom"}))}));let O=(0,e.createElement)("div",{className:"rule-set__fields"},(0,e.createElement)("div",{className:"rule-set__rules"},w.map(((t,i)=>(0,e.createElement)(Ii,c({key:i,rule:t,ruleIndex:i,ruleSet:s,ruleSetIndex:u,ruleSets:d},n))))),(0,e.createElement)("div",{className:"rule-set__add-rule"},(0,e.createElement)(a.Button,{onClick:()=>function(){const e=[...d],n=[...s.rules,{field:""}];e[u]=(0,t.assign)({...s},{rules:n}),h(p,(0,t.assign)({...m},{ruleSets:[...e]}))}(),isLink:!0},(0,i.__)("Add rule","block-visibility"))));return _||(O=(0,e.createElement)(a.Disabled,null,O)),(0,e.createElement)("div",{key:u,className:v()("rule-sets__rule-set",{disabled:!_})},(0,e.createElement)("div",{className:"rule-set__header section-header"},(0,e.createElement)("span",{className:"section-header__title"},y),(0,e.createElement)("div",{className:"section-header__toolbar"},C,S)),O)}var Ai=window.wp.coreData;function Hi(e){var t;let n=null!==(t=null==e?void 0:e.user_roles)&&void 0!==t?t:[];n=n.filter((e=>"logged-out"!==e.value));const o=(0,l.useSelect)((e=>{const t=e(Ai.store).getUsers({per_page:-1}),n=[];return t&&0!==t.length&&t.forEach((e=>{const t={value:e.id,label:e.name};n.push(t)})),n}),[]),r=[{value:"any",label:(0,i.__)("Is any of the selected","block-visibility")},{value:"none",label:(0,i.__)("Is none of the selected","block-visibility")}],s=[{value:"atLeastOne",label:(0,i.__)("Is at least one of the selected","block-visibility")},{value:"all",label:(0,i.__)("Is all of the selected","block-visibility")},{value:"none",label:(0,i.__)("Is none of the selected","block-visibility")}],a=(0,i.__)("Select Condition…","block-visibility");return[{value:"logged-out",label:(0,i.__)("User is logged-out","block-visibility"),group:"type"},{value:"logged-in",label:(0,i.__)("User is logged-in","block-visibility"),group:"type"},{value:"user-role",label:(0,i.__)("User's role","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:s,placeholder:a},{type:"valueField",valueType:"multiSelect",options:n,placeholder:(0,i.__)("Select User Roles…","block-visibility"),isMulti:!0}]},{value:"users",label:(0,i.__)("User","block-visibility"),group:"type",fields:[{type:"operatorField",valueType:"select",options:r,placeholder:a},{type:"valueField",valueType:"multiSelect",options:o,placeholder:(0,i.__)("Select Users…","block-visibility"),isMulti:!0}]}]}function zi(n){var l,o,r,s;const{variables:u,userRole:d,setControlAtts:p}=n,v=null!==(l=null==d?void 0:d.hideOnRuleSets)&&void 0!==l&&l,m=null!==(o=null==d?void 0:d.ruleSets)&&void 0!==o?o:[];0===m.length&&m.push({enable:!0,rules:[{field:""}]});const b=function(e){const t=[{value:"type",label:(0,i.__)("User Rule Type","block-visibility")}],n=Hi(e),l=[];return t.forEach((e=>{var t,i;const o=null!==(t=null==e?void 0:e.value)&&void 0!==t?t:"",r=null!==(i=null==e?void 0:e.label)&&void 0!==i?i:"",s=n.filter((e=>e.group===o));l.push({value:o,label:r,options:s})})),l}(),f=Hi(u);return null!==(s=(null!==(r=null==u?void 0:u.current_users_roles)&&void 0!==r?r:[]).includes("administrator"))&&void 0!==s&&s?(0,e.createElement)("div",{className:"visibility-control__container"},(0,e.createElement)("div",{className:"visibility-control user-rule-sets"},(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)( +// Translators: Whether the block is hidden or visible. +(0,i.__)("%s the block if at least one user rule set applies.","block-visibility"),v?(0,i.__)("Hide","block-visibility"):(0,i.__)("Show","block-visibility"))),(0,e.createElement)("div",{className:"rule-sets"},m.map(((t,i)=>(0,e.createElement)(Di,c({key:i,ruleSet:t,ruleSetIndex:i,ruleSets:m,groupedFields:b,allFields:f,controlName:"userRole",controlAtts:d,hideOnRuleSets:v},n))))),(0,e.createElement)("div",{className:"rule-sets__add-rule-set"},(0,e.createElement)(a.Button,{onClick:()=>(()=>{const e=[...m,{enable:!0,rules:[{field:""}]}];p("userRole",(0,t.assign)({...d},{ruleSets:[...e]}))})(),isSecondary:!0},(0,i.__)("Add rule set","block-visibility"))),(0,e.createElement)("div",{className:"hide-on-rule-sets"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide when rules apply","block-visibility"),checked:v,onChange:()=>p("userRole",(0,t.assign)({...d},{hideOnRuleSets:!v}))})))):(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("The User rule sets option can only be configured by website Administrators. Please choose another option.","block-visibility"))}function Bi(n){var o,r,s,c;const{variables:u,userRole:d,setControlAtts:p}=n,v=null!==(o=null==d?void 0:d.restrictedUsers)&&void 0!==o?o:[],m=null!==(r=null==d?void 0:d.hideOnRestrictedUsers)&&void 0!==r&&r,b=(0,l.useSelect)((e=>{const t=e(Ai.store).getUsers({per_page:-1}),n=[];return t&&0!==t.length&&t.forEach((e=>{const t={value:e.id,label:e.name};n.push(t)})),n}),[]);if(null===(c=(null!==(s=null==u?void 0:u.current_users_roles)&&void 0!==s?s:[]).includes("administrator"))||void 0===c||!c)return(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("The Users option can only be configured by website Administrators. Please choose another option.","block-visibility"));const f=m?(0,i.__)("Hide the block from","block-visibility"):(0,i.__)("Show the block to","block-visibility"),h=b.filter((e=>v.includes(e.value)));return(0,e.createElement)("div",{className:"visibility-control__container"},(0,e.createElement)("div",{className:"visibility-control restricted-users"},(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)( +// Translators: Whether the block is hidden or visible. +(0,i.__)("%s the selected users.","block-visibility"),f)),(0,e.createElement)(xi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:b,value:h,placeholder:(0,i.__)("Select Users…","block-visibility"),onChange:e=>(e=>{const n=[];0!==e.length&&e.forEach((e=>{n.push(e.value)})),p("userRole",(0,t.assign)({...d},{restrictedUsers:n}))})(e),isMulti:!0,isLoading:0===b.length})),(0,e.createElement)("div",{className:"visibility-control hide-on-restricted-users"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide from selected users","block-visibility"),checked:m,onChange:()=>p("userRole",(0,t.assign)({...d},{hideOnRestrictedUsers:!m}))})))}function Ui(e,n,i){let l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(!e||0===e.length)return!1;const o=e.visibility_controls,r=(0,t.has)(o,n);if(!r)return l;const s=(0,t.has)(o[n],i);return s?o[n][i]:l}function ji(e,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||0===e.length)return!1;const l=e.plugin_settings,o=(0,t.has)(l,n);return o?l[n]:i}var $i=(0,e.createElement)(m.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(m.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function Gi(t){const{message:n,subMessage:l,link:o,position:r}=t,s=null!=r?r:"middle left";return(0,e.createElement)("div",{className:"information-popover"},(0,e.createElement)(a.DropdownMenu,{label:(0,i.__)("More Information","block-visibility"),icon:$i,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:s,noArrow:!1}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,n),l&&(0,e.createElement)("p",null,l),o&&(0,e.createElement)(a.ExternalLink,{href:o},(0,i.__)("Learn More","block-visibility"))))))}function qi(n){var l,o,r,s,u,d,p;const{settings:v,variables:m,enabledControls:b,setControlAtts:f,controlSetAtts:h}=n,g=b.some((e=>"visibility_by_role"===e.settingSlug)),y=null!==(l=null==h?void 0:h.controls.hasOwnProperty("userRole"))&&void 0!==l&&l;if(!g||!y)return null;const _=null!==(o=null==h||null===(r=h.controls)||void 0===r?void 0:r.userRole)&&void 0!==o?o:{},w=null!==(s=null==_?void 0:_.visibilityByRole)&&void 0!==s?s:"public",E=null!==(u=null==m?void 0:m.plugin_variables.settings_url)&&void 0!==u?u:"",C=Ui(v,"visibility_by_role","enable_user_roles"),k=Ui(v,"visibility_by_role","enable_users"),S=Ui(v,"visibility_by_role","enable_user_rule_sets");let O=[{label:(0,i.__)("Public","block-visibility"),value:"public"},{label:(0,i.__)("Logged-out","block-visibility"),value:"logged-out"},{label:(0,i.__)("Logged-in","block-visibility"),value:"logged-in"},{label:(0,i.__)("User roles","block-visibility"),value:"user-role"},{label:(0,i.__)("Users","block-visibility"),value:"users"},{label:(0,i.__)("User rule sets","block-visibility"),value:"user-rule-sets"}];const x=[{label:(0,i.__)("Block is visible to everyone.","block-visibility"),value:"public"},{label:(0,i.__)("Block is only visible to logged-out users.","block-visibility"),value:"logged-out"},{label:(0,i.__)("Block is only visible to logged-in users.","block-visibility"),value:"logged-in"}];C||(O=O.filter((e=>"user-role"!==e.value))),k||(O=O.filter((e=>"users"!==e.value))),S||(O=O.filter((e=>"user-rule-sets"!==e.value)));const M=O.filter((e=>e.value===w)),L=null!==(d=null===(p=x.filter((e=>e.value===w))[0])||void 0===p?void 0:p.label)&&void 0!==d?d:"";return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group user-role-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)("span",null,(0,i.__)("User Role","block-visibility")),(0,e.createElement)(Gi,{message:(0,i.__)("The User Role control allows you to conditionally display the block based on the current user's role and/or specific users.","block-visibility-pro"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__group-fields"},(0,e.createElement)("div",{className:"visibility-control visibility-by-role"},(0,e.createElement)(xi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:O,value:M,onChange:e=>f("userRole",(0,t.assign)({..._},{visibilityByRole:e.value}))}),L&&(0,e.createElement)("div",{className:"visibility-control__help"},L)),"user-role"===w&&C&&(0,e.createElement)(Mi,c({variables:m,userRole:_,setControlAtts:f},n)),"users"===w&&k&&(0,e.createElement)(Bi,c({variables:m,userRole:_,setControlAtts:f},n)),"user-rule-sets"===w&&S&&(0,e.createElement)(zi,c({variables:m,userRole:_,setControlAtts:f},n))),!O.some((e=>e.value===w))&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,e.createInterpolateElement)((0,i.__)("The User Role option that was previously selected has been disabled. Choose another option or update the Visibility Control settings.","block-visibility"),{a:(0,e.createElement)("a",{href:E+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function Zi(t){const{label:n,currentDate:i,onDateChange:l,isOpen:o,highlightedDate:r}=t,s=(0,Pi.__experimentalGetSettings)(),c=/a(?!\\)/i.test(s.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,e.createElement)(a.Popover,{className:"block-visibility__date-time-popover",onClose:o.bind(null,!1)},(0,e.createElement)("div",{className:"date-time-header"},(0,e.createElement)("span",null,n)),(0,e.createElement)(a.DateTimePicker,{currentDate:i,onChange:e=>l(e),is12Hour:c,events:[{date:r}]}))}function Wi(t){const{label:n,title:l,hasDateTime:o,onOpenPopover:r,onClearDateTime:s}=t;return(0,e.createElement)("div",{className:"schedule__date-time-field"},(0,e.createElement)(a.Button,{icon:Ni,title:l,onClick:()=>r((e=>!e)),isLink:!0},(0,e.createElement)("span",null,n)),o&&(0,e.createElement)(a.Button,{icon:Li,className:"clear-date-time",title:(0,i.__)("Clear date/time","block-visibility"),onClick:()=>s()}))}function Yi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,i.__)("No time selected","block-visibility");const n=(0,Pi.__experimentalGetSettings)();let l=t;return e&&(l=(0,Pi.format)(`${n.formats.date} ${n.formats.time}`,e)),l}const Xi=(0,a.withFilters)("blockVisibility.addDateTimeScheduleControls")((t=>(0,e.createElement)(e.Fragment,null)));function Qi(n){var l,o,r,s;const{type:u,dateTime:d,schedules:p,scheduleIndex:m,scheduleAtts:h,controlSetAtts:g,setControlAtts:y,hideOnSchedules:_}=n,[w,E]=(0,e.useState)(!1),[C,k]=(0,e.useState)(!1),S="single"===u?u+"-"+m:u+"-"+(null==g?void 0:g.id)+"-"+m,O=null!==(l=null==h?void 0:h.title)&&void 0!==l?l:"",x=null===(o=null==h?void 0:h.enable)||void 0===o||o,M=null!==(r=null==h?void 0:h.start)&&void 0!==r?r:null,L=null!==(s=null==h?void 0:h.end)&&void 0!==s?s:null,P=new Date((new Date).setHours(0,0,0,0)),V=O||(0,i.__)("Schedule","block-visibility"),N=Yi(M,(0,i.__)("Now","block-visibility")),T=Yi(L,(0,i.__)("Never","block-visibility"));let R=!1;M&&L&&(R=M>=L);const F=(e,n)=>{const i={...h},l=[...p];i[e]=n,l[m]=i,y("dateTime",(0,t.assign)({...d},{schedules:[...l]}))},I=(0,e.createElement)(a.DropdownMenu,{className:"settings-dropdown",label:(0,i.__)("Settings","block-visibility"),icon:b,popoverProps:{className:"block-visibility__control-popover control-settings",focusOnMount:"container"}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h3",null,(0,i.__)("Settings","block-visibility")),(0,e.createElement)(a.TextControl,{value:O,label:(0,i.__)("Schedule title","block-visibility"),placeholder:(0,i.__)("Schedule","block-visibility"),onChange:e=>F("title",e)}),(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Enable schedule","block-visibility"),checked:x,onChange:()=>F("enable",!x)}),(0,e.createElement)(a.Slot,{name:"DateTimeScheduleControlsSettings-"+S})))),D=p.length<=1?(0,i.__)("Clear schedule","block-visibility"):(0,i.__)("Delete schedule","block-visibility"),A=(0,e.createElement)(a.DropdownMenu,{className:"options-dropdown",label:(0,i.__)("Options","block-visibility"),icon:f,popoverProps:{focusOnMount:"container"}},(n=>{let{onClose:l}=n;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"ScheduleOptionsTop"}),(0,e.createElement)(a.MenuGroup,{label:(0,i.__)("Tools","block-visibility")},(0,e.createElement)(a.Slot,{name:"ScheduleOptionsTools"}),(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=[...p,h];y("dateTime",(0,t.assign)({...d},{schedules:[...e]}))}(),l()}},(0,i.__)("Duplicate","block-visibility"))),(0,e.createElement)(a.Slot,{name:"ScheduleOptionsMiddle"}),(0,e.createElement)(a.MenuGroup,null,(0,e.createElement)(a.MenuItem,{onClick:()=>{!function(){const e=p.filter(((e,t)=>t!==m));y("dateTime",(0,t.assign)({...d},{schedules:[...e]}))}(),l()}},D)),(0,e.createElement)(a.Slot,{name:"ScheduleOptionsBottom"}))}));let H=(0,e.createElement)("div",{className:"schedule__fields"},(0,e.createElement)(a.Slot,{name:"DateTimeScheduleControlsTop-"+S}),(0,e.createElement)("div",{className:"fields__date-time"},(0,e.createElement)("div",{className:"date-time__schedule-start"},(0,e.createElement)("div",{className:"visibility-control__label"},_?(0,i.__)("Stop showing","block-visibility"):(0,i.__)("Start showing","block-visibility")),(0,e.createElement)(Wi,{label:N,title:(0,i.__)("Choose a start date/time","block-visibility"),hasDateTime:M,onOpenPopover:E,onClearDateTime:()=>F("start","")})),w&&(0,e.createElement)(Zi,{label:(0,i.__)("Start Date/Time","block-visibility"),currentDate:((e,t,n)=>{if(e)return e;const i=t?new Date(t):new Date(n);return t&&(i.setHours(0,0,0,0),i.setDate(i.getDate()-1)),i})(M,L,P),onDateChange:e=>F("start",e),isOpen:E,highlightedDate:L}),(0,e.createElement)("div",{className:"date-time__schedule-end"},(0,e.createElement)("div",{className:"visibility-control__label"},_?(0,i.__)("Resume showing","block-visibility"):(0,i.__)("Stop showing","block-visibility")),(0,e.createElement)(Wi,{label:T,title:(0,i.__)("Choose an end date/time","block-visibility"),hasDateTime:L,onOpenPopover:k,onClearDateTime:()=>F("end","")})),C&&(0,e.createElement)(Zi,{label:(0,i.__)("End Date/Time","block-visibility"),currentDate:((e,t,n)=>{if(t)return t;const i=e?new Date(e):new Date(n);return i.setHours(0,0,0,0),i.setDate(i.getDate()+1),i})(M,L,P),onDateChange:e=>F("end",e),isOpen:k,highlightedDate:M}),R&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("The start time is after the stop time. Please fix for date/time settings to function properly.","block-visibility"))),(0,e.createElement)(a.Slot,{name:"DateTimeScheduleControlsBottom-"+S}));return x||(H=(0,e.createElement)(a.Disabled,null,H)),(0,e.createElement)("div",{className:v()("schedules__schedule",{disabled:!x})},(0,e.createElement)("div",{className:"schedule__header section-header"},(0,e.createElement)("span",{className:"section-header__title"},V),(0,e.createElement)("div",{className:"section-header__toolbar"},I,A)),H,(0,e.createElement)(Xi,c({uniqueIndex:S},n)))}function Ki(n){var l,o,r,s,u;const{enabledControls:d,controlSetAtts:p,setControlAtts:v}=n,m=d.some((e=>"date_time"===e.settingSlug)),b=null!==(l=null==p?void 0:p.controls.hasOwnProperty("dateTime"))&&void 0!==l&&l;if(!m||!b)return null;const f=null!==(o=null==p||null===(r=p.controls)||void 0===r?void 0:r.dateTime)&&void 0!==o?o:{},h=null!==(s=null==f?void 0:f.hideOnSchedules)&&void 0!==s&&s;let g=null!==(u=null==f?void 0:f.schedules)&&void 0!==u?u:[];if(0===g.length){const e={enable:!0,start:"",end:""};f.schedules=[e],g=f.schedules}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group date-time-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)("span",null,(0,i.__)("Date & Time","block-visibility")),(0,e.createElement)(Gi,{message:(0,i.__)("The Date & Time control allows you to automatically schedule when the block should be visible on your website.","block-visibility-pro"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-date-time-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)( +// Translators: Whether the block is hidden or visible. +(0,i.__)("%s the block if at least one schedule applies.","block-visibility"),h?(0,i.__)("Hide","block-visibility"):(0,i.__)("Show","block-visibility"))),(0,e.createElement)("div",{className:"date-time-control__schedules"},g.map(((t,i)=>(0,e.createElement)(Qi,c({key:i,dateTime:f,schedules:g,scheduleIndex:i,scheduleAtts:t,hideOnSchedules:h},n))))),(0,e.createElement)("div",{className:"date-time-control__add-schedule"},(0,e.createElement)(a.Button,{onClick:()=>(()=>{const e=[...g];e.push({enable:!0,start:"",end:""}),v("dateTime",(0,t.assign)({...f},{schedules:[...e]}))})(),isSecondary:!0},(0,i.__)("Add schedule","block-visibility"))),(0,e.createElement)("div",{className:"date-time-control__hide-on-schedules"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide when schedules apply","block-visibility"),checked:h,onChange:()=>v("dateTime",(0,t.assign)({...f},{hideOnSchedules:!h}))})),(0,e.createElement)(a.Slot,{name:"DateTimeControls"})),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function Ji(n){var l,o,r,s,c,u,d,p,v,m,b,f;const{name:h,settings:g,enabledControls:y,controlSetAtts:_,setControlAtts:w}=n,E=y.some((e=>"screen_size"===e.settingSlug)),C=null!==(l=null==_?void 0:_.controls.hasOwnProperty("screenSize"))&&void 0!==l&&l;if(!E||!C)return null;const k=null!==(o=null==_||null===(r=_.controls)||void 0===r?void 0:r.screenSize)&&void 0!==o?o:{},S=null!==(s=null==k?void 0:k.hideOnScreenSize)&&void 0!==s?s:{},O=Ui(g,"screen_size","enable_advanced_controls",!1),x=null!==(c=null==g||null===(u=g.visibility_controls)||void 0===u||null===(d=u.screen_size)||void 0===d?void 0:d.controls)&&void 0!==c?c:{extraLarge:!0,large:!0,medium:!0,small:!0,extraSmall:!0},M=(e,n)=>w("screenSize",(0,t.assign)({...k},{hideOnScreenSize:(0,t.assign)({...S},{[e]:n})})),L=null!==(p=null==S?void 0:S.extraLarge)&&void 0!==p&&p,P=null!==(v=null==S?void 0:S.large)&&void 0!==v&&v,V=null!==(m=null==S?void 0:S.medium)&&void 0!==m&&m,N=null!==(b=null==S?void 0:S.small)&&void 0!==b&&b,T=null!==(f=null==S?void 0:S.extraSmall)&&void 0!==f&&f;let R=(0,e.createElement)(e.Fragment,null,O&&x.extra_large&&(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide on large desktop","block-visibility"),checked:L,onChange:()=>{M("extraLarge",!L)}}),x.large&&(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide on desktop","block-visibility"),checked:P,onChange:()=>{M("large",!P)}}),x.medium&&(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide on tablet","block-visibility"),checked:V,onChange:()=>{M("medium",!V)}}),x.small&&(0,e.createElement)(a.ToggleControl,{label:[!O&&(0,i.__)("Hide on mobile","block-visibility"),O&&(0,i.__)("Hide on mobile (landscape)","block-visibility")],checked:N,onChange:()=>{M("small",!N)}}),O&&x.extra_small&&(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide on mobile (portrait)","block-visibility"),checked:T,onChange:()=>{M("extraSmall",!T)}}));const F="core/shortcode"===h||"core/html"===h;return F&&(R=(0,e.createElement)(a.Disabled,null,R)),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group screen-size-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)("span",null,(0,i.__)("Screen Size","block-visibility")),(0,e.createElement)(Gi,{message:(0,i.__)("The Screen Size control allows you to conditionally display the block based on the width of the current screen.","block-visibility-pro"),link:"https://blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),R,F&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,e.createInterpolateElement)((0,i.__)("The Screen Size control is unfortunately not compatible with this block type. For more information, and a workaround, visit the Knowledge Base.","block-visibility"),{a:(0,e.createElement)(a.ExternalLink,{href:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=editor&utm_campaign=plugin_referrals#limitations",target:"_blank",rel:"noreferrer"})}))),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function el(n){var l,o,r,s,c,u;const{enabledControls:d,controlSetAtts:p,setControlAtts:v}=n,m=d.some((e=>"query_string"===e.settingSlug)),b=null!==(l=null==p?void 0:p.controls.hasOwnProperty("queryString"))&&void 0!==l&&l;if(!m||!b)return null;const f=null!==(o=null==p||null===(r=p.controls)||void 0===r?void 0:r.queryString)&&void 0!==o?o:{},h=null!==(s=null==f?void 0:f.queryStringAny)&&void 0!==s?s:"",g=null!==(c=null==f?void 0:f.queryStringAll)&&void 0!==c?c:"",y=null!==(u=null==f?void 0:f.queryStringNot)&&void 0!==u?u:"",_=(e,n)=>v("queryString",(0,t.assign)({...f},{[e]:n}));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group query-string-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)("span",null,(0,i.__)("Query String","block-visibility")),(0,e.createElement)(Gi,{message:(0,i.__)("The Query String control allows you to configure block visibility based on URL query strings.","block-visibility-pro"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-query-string-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.__)("Enter one URL query string per line.","block-visibility")),(0,e.createElement)(a.TextareaControl,{label:(0,i.__)("Required Queries (Any)","block-visibility"),help:(0,i.__)("Only visible when least one of the provided URL query strings is present.","block-visibility"),value:h,onChange:e=>_("queryStringAny",e),rows:"2"}),(0,e.createElement)(a.TextareaControl,{label:(0,i.__)("Required Queries (All)","block-visibility"),help:(0,e.createInterpolateElement)((0,i.__)("Only visible when all of the provided URL query strings are present.","block-visibility"),{strong:(0,e.createElement)("strong",null)}),value:g,onChange:e=>_("queryStringAll",e),rows:"2"}),(0,e.createElement)(a.TextareaControl,{label:(0,i.__)("Required Queries (Not)","block-visibility"),help:(0,i.__)("Hide when at least one of the provided URL query strings is present.","block-visibility"),value:y,onChange:e=>_("queryStringNot",e),rows:"2"})),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function tl(e){var t,n,l;const o=null!==(t=null==e||null===(n=e.integrations)||void 0===n||null===(l=n.acf)||void 0===l?void 0:l.fields)&&void 0!==t?t:[],r=[],s=[{value:"notEmpty",label:(0,i.__)("Has any value","block-visibility"),disableValue:!0},{value:"empty",label:(0,i.__)("Has no value","block-visibility"),disableValue:!0},{value:"equal",label:(0,i.__)("Value is equal to","block-visibility")},{value:"notEqual",label:(0,i.__)("Value is not equal to","block-visibility")},{value:"contains",label:(0,i.__)("Value contains","block-visibility")},{value:"notContain",label:(0,i.__)("Value does not contain","block-visibility")}];return 0!==o.length&&o.forEach((e=>{var t,n;const l=null!==(t=null==e?void 0:e.key)&&void 0!==t?t:"",o=null!==(n=null==e?void 0:e.fields)&&void 0!==n?n:[];0!==o.length&&o.forEach((e=>{var t,n;const o=null!==(t=null==e?void 0:e.key)&&void 0!==t?t:"",a=null!==(n=null==e?void 0:e.label)&&void 0!==n?n:"";r.push({value:o,label:a,group:l,fields:[{type:"subField",name:"isUserField",valueType:"toggle",placeholder:(0,i.__)("Evaluate as user field","block-visibility")},{type:"operatorField",valueType:"select",options:s,placeholder:(0,i.__)("Select Condition…","block-visibility")},{type:"valueField",valueType:"text",placeholder:(0,i.__)("Enter Value…","block-visibility"),displayConditions:[{dependencyType:"operatorField",dependencyValues:["equal","notEqual","contains","notContain"]}]}]})}))})),r}function nl(n){var l,o,r,s,u,d,p,v,m,b,f,g;const{variables:y,enabledControls:_,controlSetAtts:E,setControlAtts:C}=n,k=null!==(l=null==y||null===(o=y.integrations)||void 0===o||null===(r=o.acf)||void 0===r?void 0:r.active)&&void 0!==l&&l,S=_.some((e=>"acf"===e.settingSlug)),O=null!==(s=null==E?void 0:E.controls.hasOwnProperty("acf"))&&void 0!==s&&s;if(!S||!O||!k)return null;const x=null!==(u=null==y||null===(d=y.integrations)||void 0===d||null===(p=d.acf)||void 0===p?void 0:p.fields)&&void 0!==u?u:[],M=null!==(v=null==E||null===(m=E.controls)||void 0===m?void 0:m.acf)&&void 0!==v?v:{},L=null!==(b=null==M?void 0:M.hideOnRuleSets)&&void 0!==b&&b;let P=null!==(f=null==M?void 0:M.ruleSets)&&void 0!==f?f:[];if(0===P.length)P.push({enable:!0,rules:[{field:""}]});else if(1===P.length&&(null===(g=P[0])||void 0===g||!g.rules)){const e=P[0];0!==e.length&&e.forEach((e=>{var t;const n=null!==(t=null==e?void 0:e.operator)&&void 0!==t?t:"";e.operator="!=empty"===n?"notEmpty":"==empty"===n?"empty":"=="===n?"equal":"!="===n?"notEqual":"==contains"===n?"contains":"!=contains"===n?"notContain":""})),P=[{enable:!0,rules:e}]}const V=function(e){const t=function(e){var t,n,i;const l=null!==(t=null==e||null===(n=e.integrations)||void 0===n||null===(i=n.acf)||void 0===i?void 0:i.fields)&&void 0!==t?t:[],o=[];return 0!==l.length&&l.forEach((e=>{var t,n;const i=null!==(t=null==e?void 0:e.key)&&void 0!==t?t:"",l=null!==(n=null==e?void 0:e.title)&&void 0!==n?n:"";o.push({value:i,label:l})})),o}(e),n=tl(e),i=[];return t.forEach((e=>{var t,l;const o=null!==(t=null==e?void 0:e.value)&&void 0!==t?t:"",r=null!==(l=null==e?void 0:e.label)&&void 0!==l?l:"",s=n.filter((e=>e.group===o));i.push({value:o,label:r,options:s})})),i}(y),N=tl(y);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group acf-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)(h,{icon:w.acf}),(0,e.createElement)("span",null,(0,i.__)("Advanced Custom Fields","block-visibility")),(0,e.createElement)(Gi,{message:(0,i.__)("The Advanced Custom Fields (ACF) control allows you configure block visibility based on a variety of field-related rules, which form rule sets.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-advanced-custom-fields-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.sprintf)( +// Translators: Whether the block is hidden or visible. +(0,i.__)("%s the block if at least one rule set applies. Rules targeting user fields will fail if the current user is not logged in.","block-visibility"),L?(0,i.__)("Hide","block-visibility"):(0,i.__)("Show","block-visibility"))),0===x.length&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("It does not appear that your website contains any published fields yet.","block-visibility")),(0,e.createElement)("div",{className:"rule-sets"},P.map(((t,l)=>(0,e.createElement)(Di,c({key:l,ruleSet:t,ruleSetIndex:l,ruleSets:P,groupedFields:V,allFields:N,controlName:"acf",controlAtts:M,hideOnRuleSets:L,rulePlaceholder:(0,i.__)("Select Field…","block-visibility")},n))))),(0,e.createElement)("div",{className:"rule-sets__add-rule-set"},(0,e.createElement)(a.Button,{onClick:()=>(()=>{const e=[...P,{enable:!0,rules:[{field:""}]}];C("acf",(0,t.assign)({...M},{ruleSets:[...e]}))})(),isSecondary:!0},(0,i.__)("Add rule set","block-visibility"))),(0,e.createElement)("div",{className:"hide-on-rule-sets"},(0,e.createElement)(a.ToggleControl,{label:(0,i.__)("Hide when rules apply","block-visibility"),checked:L,onChange:()=>C("acf",(0,t.assign)({...M},{hideOnRuleSets:!L}))}))),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function il(n){var l,o,r,s,c,u,d,p,v,m,b,f,g,y,_,E;const{variables:C,enabledControls:k,controlSetAtts:S,setControlAtts:O}=n,x=null!==(l=null==C||null===(o=C.integrations)||void 0===o||null===(r=o.wp_fusion)||void 0===r?void 0:r.active)&&void 0!==l&&l,M=k.some((e=>"wp_fusion"===e.settingSlug)),L=null!==(s=null==S?void 0:S.controls.hasOwnProperty("wpFusion"))&&void 0!==s&&s;if(!M||!L||!x)return null;const P=null!==(c=null==S?void 0:S.controls.hasOwnProperty("userRole"))&&void 0!==c&&c,V=null!==(u=null==S||null===(d=S.controls)||void 0===d||null===(p=d.userRole)||void 0===p?void 0:p.visibilityByRole)&&void 0!==u?u:"public",N=null!==(v=null==C||null===(m=C.integrations)||void 0===m||null===(b=m.wp_fusion)||void 0===b?void 0:b.tags)&&void 0!==v?v:[],T=e=>N.filter((t=>e.includes(t.value))),R=null!==(f=null==S||null===(g=S.controls)||void 0===g?void 0:g.wpFusion)&&void 0!==f?f:{},F=T(null!==(y=null==R?void 0:R.tagsAny)&&void 0!==y?y:[]),I=T(null!==(_=null==R?void 0:R.tagsAll)&&void 0!==_?_:[]),D=T(null!==(E=null==R?void 0:R.tagsNot)&&void 0!==E?E:[]),A=(e,n)=>{const i=[];0!==n.length&&n.forEach((e=>{i.push(e.value)})),O("wpFusion",(0,t.assign)({...R},{[e]:i}))};let H=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control wp-fusion__tags-any"},(0,e.createElement)("div",{className:"visibility-control__label"},(0,i.__)("Required Tags (Any)","block-visibility")),(0,e.createElement)(xi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:N,value:F,placeholder:(0,i.__)("Select Tag…","block-visibility"),onChange:e=>A("tagsAny",e),isMulti:!0}),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.__)("Only visible to logged-in users with at least one of the selected tags.","block-visibility"))),(0,e.createElement)("div",{className:"visibility-control wp-fusion__tags-all"},(0,e.createElement)("div",{className:"visibility-control__label"},(0,i.__)("Required Tags (All)","block-visibility")),(0,e.createElement)(xi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:N,value:I,placeholder:(0,i.__)("Select Tag…","block-visibility"),onChange:e=>A("tagsAll",e),isMulti:!0}),(0,e.createElement)("div",{className:"visibility-control__help"},(0,e.createInterpolateElement)((0,i.__)("Only visible to logged-in users with all of the selected tags.","block-visibility"),{strong:(0,e.createElement)("strong",null)}))));"public"!==V&&"logged-out"!==V||(H=(0,e.createElement)(a.Disabled,null,H));let z=(0,e.createElement)("div",{className:"visibility-control wp-fusion__tags-not"},(0,e.createElement)("div",{className:"visibility-control__label"},(0,i.__)("Required Tags (Not)","block-visibility")),(0,e.createElement)(xi,{className:"block-visibility__react-select",classNamePrefix:"react-select",options:N,value:D,placeholder:(0,i.__)("Select Tag…","block-visibility"),onChange:e=>A("tagsNot",e),isMulti:!0}),(0,e.createElement)("div",{className:"visibility-control__help"},(0,i.__)("Hide from logged-in users with at least one of the selected tags.","block-visibility")));return"logged-out"===V&&(z=(0,e.createElement)(a.Disabled,null,z)),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"visibility-control__group wp-fusion-control"},(0,e.createElement)("h3",{className:"visibility-control__group-heading has-icon"},(0,e.createElement)(h,{icon:w.wpFusion}),(0,e.createElement)("span",null,(0,i.__)("WP Fusion","block-visibility")),(0,e.createElement)(Gi,{message:(0,i.__)("The WP Fusion control allows you to configure block visibility based on WP Fusion tags.","block-visibility"),subMessage:(0,i.__)("Note that the available fields depend on the User Role control settings. If the User Role control is disabled, only the Required Tags (Not) field will be available.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-wp-fusion-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",position:"bottom center"})),(0,e.createElement)("div",{className:"visibility-control__group-fields"},H,z),!P&&(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("The WP Fusion control works best in coordination with the User Role control, which has been disabled. To re-enable, click the eye icon in the Controls Toolbar above.","block-visibility"))),(0,e.createElement)("div",{className:"control-separator"},(0,e.createElement)("span",null,(0,i.__)("AND","block-visibility"))))}function ll(t){return(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,e.createInterpolateElement)((0,i.__)("Looks like all Visibility Controls have been disabled. To control block visibility again, re-enable some Visibility Controls.","block-visibility"),{a:(0,e.createElement)("a",{href:t+"&tab=visibility-controls",target:"_blank",rel:"noreferrer"})}))}function ol(){return(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,i.__)("All visibility controls have been disabled for this block. Add controls using the three dots icon above.","block-visibility"))}function rl(t){const n="core/legacy-widget"===t.name?(0,i.__)("Legacy Widget","block-visibility"):(0,i.__)("Current","block-visibility");return(0,e.createElement)(a.Notice,{status:"warning",isDismissible:!1},(0,e.createElement)("p",null,(0,i.sprintf)( +// Translators: The current block name. +(0,i.__)("Unfortunately the %1$s block does not support custom attributes. Therefore it is not compatible with Block Visibility.","block-visibility"),n)),(0,e.createElement)("p",null,(0,i.sprintf)( +// Translators: The current block name. +(0,i.__)("As a workaround, wrap the %1$s block in a Group block. Then apply the desired visibility controls to the Group block.","block-visibility"),n)))}const sl=(0,a.withFilters)("blockVisibility.addControlSetControls")((t=>(0,e.createElement)(e.Fragment,null)));function al(n){var i,l,o;const{type:r,controlSetAtts:s,setControlSetAtts:u,enabledControls:d,variables:p}=n,v=null!==(i=null==p||null===(l=p.plugin_variables)||void 0===l?void 0:l.settings_url)&&void 0!==i?i:"",m=null===(o=null==s?void 0:s.enable)||void 0===o||o,b="single"===r?r:r+"-"+(null==s?void 0:s.id),f=1===d.length&&d.some((e=>"hide_block"===e.settingSlug));if(f)return null;const h=[];d.forEach((e=>{var t;"hide_block"!==e.settingSlug&&h.push({label:e.label,type:e.type,attributeSlug:e.attributeSlug,settingSlug:e.settingSlug,icon:null!==(t=null==e?void 0:e.icon)&&void 0!==t&&t,active:null==s?void 0:s.controls.hasOwnProperty(e.attributeSlug)})}));const g=Object.keys(s.controls),y=h.filter((e=>!(!e.active||!g.includes(e.attributeSlug))));function _(e,n){var i;const l=null!==(i=null==s?void 0:s.controls)&&void 0!==i?i:{},o=(0,t.assign)({...s},{controls:(0,t.assign)({...l},{[e]:n})});u(o)}let w=(0,e.createElement)("div",{className:"control-set__controls"},(0,e.createElement)(a.Slot,{name:"ControlSetControlsTop-"+b}),(0,e.createElement)(Ki,c({setControlAtts:_},n)),(0,e.createElement)(qi,c({setControlAtts:_},n)),(0,e.createElement)(Ji,c({setControlAtts:_},n)),(0,e.createElement)(el,c({setControlAtts:_},n)),(0,e.createElement)(a.Slot,{name:"ControlSetControlsMiddle-"+b}),(0,e.createElement)(nl,c({setControlAtts:_},n)),(0,e.createElement)(il,c({setControlAtts:_},n)),(0,e.createElement)(a.Slot,{name:"ControlSetControlsBottom-"+b}));return m||(w=(0,e.createElement)(a.Disabled,null,w)),(0,e.createElement)("div",{className:"control-set"},(0,e.createElement)(k,c({controls:h,setControlSetAtts:u},n)),w,(0,e.createElement)(sl,c({uniqueIndex:b,setControlAtts:_},n)),!f&&(0,t.isEmpty)(y)&&(0,e.createElement)(ol,{settingsUrl:v}))}function cl(e,t){if(!e||0===e.length)return!1;const n=e.disabled_blocks.includes(t),i=(0,r.getBlockSupport)(t,"blockVisibility",!1);return!(n||!i)}function ul(e,t){var n,i,l,o,r;let s=!0;if(null===(n=null==e||null===(i=e.plugin_settings)||void 0===i?void 0:i.enable_user_role_restrictions)||void 0===n||!n)return s;const a=null!==(l=null==e||null===(o=e.plugin_settings)||void 0===o?void 0:o.enabled_user_roles)&&void 0!==l?l:[];-1===a.indexOf("administrator")&&a.push("administrator");const c=null!==(r=null==t?void 0:t.current_users_roles)&&void 0!==r?r:[];return s=0!==c.length&&c.every((e=>-1!==a.indexOf(e))),s}function dl(e,n){var l;let r=[];if(!e||!n||0===e.length||0===n.length)return r;let s=function(){let e=[{label:(0,i.__)("Hide Block","block-visibility"),type:"core",attributeSlug:"hideBlock",settingSlug:"hide_block"},{label:(0,i.__)("Date & Time","block-visibility"),type:"core",attributeSlug:"dateTime",settingSlug:"date_time"},{label:(0,i.__)("User Role","block-visibility"),type:"core",attributeSlug:"userRole",settingSlug:"visibility_by_role"},{label:(0,i.__)("Screen Size","block-visibility"),type:"core",attributeSlug:"screenSize",settingSlug:"screen_size"},{label:(0,i.__)("Query String","block-visibility"),type:"core",attributeSlug:"queryString",settingSlug:"query_string"}];e=(0,o.applyFilters)("blockVisibility.coreControls",e),e.sort(((e,t)=>e.attributeSlug.localeCompare(t.attributeSlug)));let t=[{label:(0,i.__)("Advanced Custom Fields","block-visibility"),type:"integration",attributeSlug:"acf",settingSlug:"acf",icon:w.acf},{label:(0,i.__)("WP Fusion","block-visibility"),type:"integration",attributeSlug:"wpFusion",settingSlug:"wp_fusion",icon:w.wpFusion}];t=(0,o.applyFilters)("blockVisibility.integrationControls",t),t.sort(((e,t)=>e.attributeSlug.localeCompare(t.attributeSlug)));let n=[...e,...t];return n=(0,o.applyFilters)("blockVisibility.controls",n),n}();s.forEach((function(e){"integration"!==e.type||(e=>{let t=!1;var i,l;return null!=n&&n.integrations&&(t=null!==(i=null==n||null===(l=n.integrations[e])||void 0===l?void 0:l.active)&&void 0!==i&&i),t})(e.settingSlug)||(s=s.filter((t=>t.settingSlug!==e.settingSlug)))}));const a=null!==(l=null==e?void 0:e.visibility_controls)&&void 0!==l?l:{};return(0,t.isEmpty)(a)||s.forEach((function(e){var n,i;let l=!1;(0,t.has)(a,e.settingSlug)||(l=!0),(null===(n=null===(i=a[e.settingSlug])||void 0===i?void 0:i.enable)||void 0===n||n)&&(l=!0),l&&r.push(e)})),r=(0,o.applyFilters)("blockVisibility.enabledControls",r,e,n),r}const pl=(0,a.withFilters)("blockVisibility.addInspectorControls")((t=>(0,e.createElement)(e.Fragment,null)));var vl=(0,l.withSelect)((e=>{var t,n;const{getEntityRecord:i}=e("core");return{settings:null!==(t=i("block-visibility/v1","settings"))&&void 0!==t?t:"fetching",variables:null!==(n=i("block-visibility/v1","variables"))&&void 0!==n?n:"fetching"}}))((function(n){var l,o,r,s,p,v,m,b,f,h,g;const{attributes:y,setAttributes:_,name:w,settings:E,variables:C,clientId:k}=n;if("fetching"===E||"fetching"===C)return null;if(!ul(E,C)||!cl(E,w))return null;let S=dl(E,C);const O=null!==(l=null==E||null===(o=E.plugin_settings)||void 0===o?void 0:o.default_controls)&&void 0!==l?l:{};let x={};(0,t.isEmpty)(O)?x={dateTime:{},userRole:{},screenSize:{}}:S.forEach((e=>{O.includes(e.settingSlug)&&(x[e.attributeSlug]={})}));const M={...y};let L=null==M?void 0:M.blockVisibility,P=null!==(r=null===(s=L)||void 0===s?void 0:s.controlSets)&&void 0!==r?r:[];0===P.length&&(P=[{id:1,enable:!0,controls:x}],L=(0,t.assign)({...L},{controlSets:P}));const V=null==C||!C.is_pro||null===(p=null==E||null===(v=E.visibility_controls)||void 0===v||null===(m=v.general)||void 0===m?void 0:m.enable_local_controls)||void 0===p||p;V||(S=S.filter((e=>"hideBlock"===e.attributeSlug||"visibilityPresets"===e.attributeSlug)));const N=null!==(b=null==C||null===(f=C.plugin_variables)||void 0===f?void 0:f.settings_url)&&void 0!==b?b:"",T=null!==(h=null===(g=L)||void 0===g?void 0:g.hideBlock)&&void 0!==h&&h,R=S.some((e=>"hide_block"===e.settingSlug))&&T,F=["core/legacy-widget"].includes(w);function I(e){_({blockVisibility:(0,t.assign)({...y.blockVisibility},{controlSets:[e]})})}return(0,e.createElement)(u.InspectorControls,null,(0,e.createElement)(a.PanelBody,{title:(0,i.__)("Visibility","block-visibility"),className:"block-visibility",initialOpen:!1},(0,e.createElement)("div",{className:"visibility-controls__container"},0!==S.length&&!F&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(a.Slot,{name:"InspectorControlsTop"}),(0,e.createElement)(d,c({enabledControls:S},n)),(0,e.createElement)(a.Slot,{name:"InspectorControlsMiddle"}),!R&&V&&P.map(((t,i)=>(0,e.createElement)(al,c({key:k+i,type:"single",controlSets:P,controlSetAtts:t,setControlSetAtts:I,enabledControls:S,defaultControls:x},n)))),(0,e.createElement)(a.Slot,{name:"InspectorControlsBottom"})),0===S.length&&!F&&(0,e.createElement)(ll,{settingsUrl:N}),F&&(0,e.createElement)(rl,{name:w}))),(0,e.createElement)(pl,c({blockAtts:L,enabledControls:S},n)))})),ml=(0,l.withSelect)((e=>{var t,n;const{getEntityRecord:i}=e("core"),{getBlockName:l,getSelectedBlockClientIds:o,getBlockAttributes:r,hasMultiSelection:s}=e("core/block-editor"),{getBlockType:a}=e("core/blocks"),c=!s(),u=o(),d=0===u.length?null:u[0];return{enableMenuItem:c,clientId:d,blockType:a(l(d)),blockAttributes:r(d),settings:null!==(t=i("block-visibility/v1","settings"))&&void 0!==t?t:"fetching",variables:null!==(n=i("block-visibility/v1","variables"))&&void 0!==n?n:"fetching"}}))((function(n){var o;const{flashBlock:r,updateBlockAttributes:s}=(0,l.useDispatch)("core/block-editor"),{createSuccessNotice:c}=(0,l.useDispatch)("core/notices"),{enableMenuItem:d,clientId:p,blockType:v,blockAttributes:m,settings:b,variables:f}=n;if("fetching"===b||"fetching"===f)return null;if(!ul(b,f))return null;if(!d||!v)return null;if(["core/legacy-widget"].includes(v.name))return null;const h=ji(b,"enable_toolbar_controls"),g=cl(b,v.name),y=dl(b,f);if(!h||!g||!y.some((e=>"hide_block"===e.settingSlug)))return null;const{blockVisibility:_}=m,E=null!==(o=null==_?void 0:_.hideBlock)&&void 0!==o&&o,C=E?w.visibilityAlt:w.visibilityHiddenAlt,k=E?(0,i.__)("Enable block","block-visibility"):(0,i.__)("Hide block","block-visibility"),S=v.title,O=E?(0,i.sprintf)( +// Translators: Name of the block being made visible, e.g. "Paragraph". +(0,i.__)('"%s" is now visible.'),S):(0,i.sprintf)( +// Translators: Name of the block being hidden, e.g. "Paragraph". +(0,i.__)('"%s" is now hidden.'),S);return(0,e.createElement)(u.BlockSettingsMenuControls,null,(0,e.createElement)(a.MenuItem,{onClick:()=>{s(p,{blockVisibility:(0,t.assign)({..._},{hideBlock:!E})}),r(p),c(O,{type:"snackbar"})},icon:C,label:k},k))}));function bl(e,t,n){if(t&&!e.hasOwnProperty("dateTime"))return!1;if(!n.some((e=>"date_time"===e.settingSlug)))return!1;let i=[],l=!1;var r,s,a,c;if(t?(i=null!==(r=null===(s=e.dateTime)||void 0===s?void 0:s.schedules)&&void 0!==r?r:[],l=null!==(a=null===(c=e.dateTime)||void 0===c?void 0:c.hideOnSchedules)&&void 0!==a&&a):i=null!=e&&e.scheduling?[null==e?void 0:e.scheduling]:[],0===i.length)return!1;const u=[];i.forEach((e=>{var t,n,i;const r=null!==(t=null==e?void 0:e.enable)&&void 0!==t&&t,s=null!==(n=null==e?void 0:e.start)&&void 0!==n?n:"",a=null!==(i=null==e?void 0:e.end)&&void 0!==i?i:"";let c=!0;r||(c=!1),l||!r||s||a||(c=!1),c=(0,o.applyFilters)("blockVisibility.hasDateTimeScheduleIndicator",c,e),r&&s&&a&&s>=a&&(c=!1),u.push(c)}));let d=u.includes(!0);return d=(0,o.applyFilters)("blockVisibility.hasDateTimeIndicator",d,e,t,n),d}function fl(e,t,n){var i,l,r,s,a,c;if(t&&!e.hasOwnProperty("userRole"))return!1;const u=t?e.userRole:e,d=null!==(i=null==u?void 0:u.visibilityByRole)&&void 0!==i?i:"public",p=null!==(l=null==u?void 0:u.restrictedRoles)&&void 0!==l?l:[],v=null!==(r=null==u?void 0:u.hideOnRestrictedRoles)&&void 0!==r&&r,m=null!==(s=null==u?void 0:u.restrictedUsers)&&void 0!==s?s:[],b=null!==(a=null==u?void 0:u.hideOnRestrictedUsers)&&void 0!==a&&a,f=null!==(c=null==u?void 0:u.ruleSets)&&void 0!==c?c:[];let h=!0;return n.some((e=>"visibility_by_role"===e.settingSlug))&&d&&"public"!==d&&"all"!==d||(h=!1),"user-role"===d&&0===p.length&&v&&(h=!1),"users"===d&&0===m.length&&b&&(h=!1),"user-rule-sets"===d&&0===f.length&&(h=!1),h=(0,o.applyFilters)("blockVisibility.hasUserRoleIndicator",h,e,t,n),h}function hl(e,t,n,i){var l,r,s,a;if(t&&!e.hasOwnProperty("screenSize"))return!1;const c=t?e.screenSize:e,u=null!==(l=null==c?void 0:c.hideOnScreenSize)&&void 0!==l?l:{extraLarge:!1,large:!1,medium:!1,small:!1,extraSmall:!1},d=null!==(r=null==i||null===(s=i.visibility_controls)||void 0===s||null===(a=s.screen_size)||void 0===a?void 0:a.controls)&&void 0!==r?r:{extra_large:!0,large:!0,medium:!0,small:!0,extra_small:!0},p=[!(!u.extraLarge||!d.extra_large),!(!u.large||!d.large),!(!u.medium||!d.medium),!(!u.small||!d.small),!(!u.extraSmall||!d.extra_small)];let v=!0;return n.some((e=>"screen_size"===e.settingSlug))&&p.includes(!0)||(v=!1),v=(0,o.applyFilters)("blockVisibility.hasScreenSizeIndicator",v,e,t,n,i),v}function gl(e,t,n){var i,l,r,s,a,c;if(t&&!e.hasOwnProperty("queryString"))return!1;if(!n.some((e=>"query_string"===e.settingSlug)))return!1;const u=null!==(i=null==e||null===(l=e.queryString)||void 0===l?void 0:l.queryStringAny)&&void 0!==i?i:"",d=null!==(r=null==e||null===(s=e.queryString)||void 0===s?void 0:s.queryStringAll)&&void 0!==r?r:"",p=null!==(a=null==e||null===(c=e.queryString)||void 0===c?void 0:c.queryStringNot)&&void 0!==a?a:"";let v=!0;return u||d||p||(v=!1),v=(0,o.applyFilters)("blockVisibility.hasQueryStringIndicator",v,e,t,n),v}function yl(e,t,n,i){var l,r,s,a,c;if(null===(l=null==i||null===(r=i.integrations)||void 0===r||null===(s=r.acf)||void 0===s?void 0:s.active)||void 0===l||!l||!n.some((e=>"acf"===e.settingSlug)))return!1;if(t&&!e.hasOwnProperty("acf"))return!1;let u=!0;return 0===(null!==(a=null==e||null===(c=e.acf)||void 0===c?void 0:c.ruleSets)&&void 0!==a?a:[]).length&&(u=!1),u=(0,o.applyFilters)("blockVisibility.hasACFIndicator",u,e,t,n,i),u}function _l(e,t,n,i){var l,r,s,a,c,u,d,p,v,m,b,f;if(null===(l=null==i||null===(r=i.integrations)||void 0===r||null===(s=r.wp_fusion)||void 0===s?void 0:s.active)||void 0===l||!l||!n.some((e=>"wp_fusion"===e.settingSlug)))return!1;if(t&&!e.hasOwnProperty("wpFusion"))return!1;const h=null!==(a=e.hasOwnProperty("userRole"))&&void 0!==a&&a,g=null!==(c=null==e||null===(u=e.userRole)||void 0===u?void 0:u.visibilityByRole)&&void 0!==c?c:"public",y="public"===g||"logged-out"===g,_=null!==(d=null==e||null===(p=e.wpFusion)||void 0===p?void 0:p.tagsAny)&&void 0!==d?d:[],w=null!==(v=null==e||null===(m=e.wpFusion)||void 0===m?void 0:m.tagsAll)&&void 0!==v?v:[],E=null!==(b=null==e||null===(f=e.wpFusion)||void 0===f?void 0:f.tagsNot)&&void 0!==b?b:[];let C=!0;return(!h&&0===E.length||"public"===g&&0===E.length||"logged-out"===g)&&(C=!1),y||0!==_.length||0!==w.length||0!==E.length||(C=!1),C=(0,o.applyFilters)("blockVisibility.hasWPFusionIndicator",C,e,t,n,i),C}function wl(e){const{data:t="fetching"}=(0,l.useSelect)((t=>{const{getEntityRecord:n}=t("core");return{data:n("block-visibility/v1",e)}}),[]);return t}(0,o.addFilter)("editor.BlockListBlock","block-visibility/contextual-indicators",(function(t){return n=>{var i,l,r,s,a;const u=wl("settings"),d=wl("variables");if("fetching"===u)return(0,e.createElement)(t,n);const{name:p,attributes:m}=n,b=ji(u,"enable_contextual_indicators"),f=cl(u,p),h=dl(u,d);if(!b||!f||0===h.length)return(0,e.createElement)(t,n);const{blockVisibility:g}=m,y=null!==(i=null==g?void 0:g.hideBlock)&&void 0!==i&&i&&h.some((e=>"hide_block"===e.settingSlug)),_=null!==(l=null==g?void 0:g.controlSets)&&void 0!==l&&l;let w=null!=g?g:{};var E;_&&(w=0!==g.controlSets.length&&null!==(E=g.controlSets[0])&&void 0!==E&&E.controls?g.controlSets[0].controls:{});let C={"date-time":bl(w,_,h),"user-role":fl(w,_,h),"screen-size":hl(w,_,h,u),"query-string":gl(w,_,h)};C=(0,o.applyFilters)("blockVisibility.conditionalIndicatorActiveCoreControls",C,g,w,_,h,d);let k={acf:yl(w,_,h,d),"wp-fusion":_l(w,_,h,d)};k=(0,o.applyFilters)("blockVisibility.conditionalIndicatorActiveIntegrationControls",k,w,_,h,d);let S={...C,...k};S=Object.keys(S).filter((e=>!0===S[e])),null==d||!d.is_pro||null===(r=null==u||null===(s=u.visibility_controls)||void 0===s||null===(a=s.general)||void 0===a?void 0:a.enable_local_controls)||void 0===r||r||(S=S.filter((e=>"hide-block"===e||"visibility-presets"===e))),S.sort();let O="";S.length>1?O="block-visibility__has-"+S.length+"-controls":0!==S.length&&(O="block-visibility__has-"+S.join("-"));let x=v()({"block-visibility__is-hidden":y},O);return x&&(x+=" block-visibility__has-visibility"),x=(0,o.applyFilters)("blockVisibility.conditionalIndicatorClasses",x),(0,e.createElement)(t,c({},n,{className:x}))}})),(0,l.dispatch)("core").addEntities([{label:(0,i.__)("Block Visibility Settings","block-visibility"),kind:"block-visibility/v1",name:"settings",baseURL:"/block-visibility/v1/settings"},{label:(0,i.__)("Block Visibility Variables","block-visibility"),kind:"block-visibility/v1",name:"variables",baseURL:"/block-visibility/v1/variables"}]),(0,o.addFilter)("blocks.registerBlockType","block-visibility/add-attributes",(function(e){if("core/freeform"===e.name)return e;const n=blockVisibilityFullControlMode;let i={blockVisibility:{type:"object",properties:{hideBlock:{type:"boolean"},controlSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},controls:{type:"object",properties:{dateTime:{type:"object",properties:{schedules:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},start:{type:"string"},end:{type:"string"}}}},hideOnSchedules:{type:"boolean"}}},userRole:{type:"object",properties:{enable:{type:"boolean"},visibilityByRole:{type:"string"},hideOnRestrictedRoles:{type:"boolean"},restrictedRoles:{type:"array",items:{type:"string"}},hideOnRestrictedUsers:{type:"boolean"},restrictedUsers:{type:"array",items:{type:"string"}},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:"object",properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},subFields:{type:"object"},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},screenSize:{type:"object",properties:{enable:{type:"boolean"},hideOnScreenSize:{type:"object",properties:{extraLarge:{type:"boolean"},large:{type:"boolean"},medium:{type:"boolean"},small:{type:"boolean"},extraSmall:{type:"boolean"}}}}},queryString:{type:"object",properties:{enable:{type:"boolean"},queryStringAny:{type:"string"},queryStringAll:{type:"string"},queryStringNot:{type:"string"}}},acf:{type:"object",properties:{enable:{type:"boolean"},hideOnRuleSets:{type:"boolean"},ruleSets:{type:"array",items:{type:["array","object"],items:{type:"object",properties:{field:{type:"string"},operator:{type:"string"},value:{type:"string"}}},properties:{id:{type:"number"},title:{type:"string"},enable:{type:"boolean"},rules:{type:"array",items:{type:"object",properties:{field:{type:"string"},subField:{type:["string","integer","array"]},operator:{type:"string"},value:{type:["string","integer","array"]}}}}}}}}},wpFusion:{type:"object",properties:{enable:{type:"boolean"},tagsAny:{type:"array",items:{type:["number","string"]}},tagsAll:{type:"array",items:{type:["number","string"]}},tagsNot:{type:"array",items:{type:["number","string"]}}}}}}}}}}}};return i=(0,o.applyFilters)("blockVisibility.attributes",i),(n||(0,r.hasBlockSupport)(e,"inserter",!0)&&!e.hasOwnProperty("parent"))&&(e.attributes=(0,t.assign)(e.attributes,i),e.supports=(0,t.assign)(e.supports,{blockVisibility:!0})),e})),(0,o.addFilter)("editor.BlockEdit","block-visibility/add-inspector-controls",(function(t){return n=>n.isSelected?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t,n),(0,e.createElement)(vl,n)):(0,e.createElement)(t,n)}),100),(0,s.registerPlugin)("block-visibility-toolbar-options-hide-block",{render:ml}),(0,o.addFilter)("blockVisibilityPro.addPresetManagerControlSet","block-visibility/preset-manager-control-set",(function(){return t=>{const{index:n,type:i}=t;return(0,e.createElement)(a.Fill,{name:"PresetManagerControlSet-"+i+"-"+n},(0,e.createElement)(al,t))}}))}()}(); \ No newline at end of file diff --git a/build/block-visibility-settings.asset.php b/build/block-visibility-settings.asset.php index 314e9888..abcd6d43 100644 --- a/build/block-visibility-settings.asset.php +++ b/build/block-visibility-settings.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-block-editor', 'wp-block-library', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'dc254e7aceadbab3c337'); + array('lodash', 'react', 'react-dom', 'wp-block-editor', 'wp-block-library', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'a178d9b2b557a0038b55'); diff --git a/build/block-visibility-settings.js b/build/block-visibility-settings.js index 78016dda..95be4da9 100644 --- a/build/block-visibility-settings.js +++ b/build/block-visibility-settings.js @@ -1,10 +1,16 @@ -!function(){var e={184:function(e,t){var n;!function(){"use strict";var i={}.hasOwnProperty;function o(){for(var e=[],t=0;t{var n;const i=null!==(n=u[t].rel)&&void 0!==n?n:"noreferrer";return(0,e.createElement)("a",{key:t,href:u[t].url,className:"plugin-links__"+t,target:"_blank",rel:i},(0,e.createElement)(c,{icon:d[u[t].icon]}),(0,e.createElement)("span",null,u[t].title))}));return(0,e.createElement)("div",{className:"masthead"},(0,e.createElement)("div",{className:"inner-container"},(0,e.createElement)("div",{className:"masthead__branding"},(0,e.createElement)("h1",null,d.logo,(0,e.createElement)("span",null,(0,r.__)("Block Visibility","block-visibility")),l&&(0,e.createElement)("span",{className:"pro-badge"},"Pro"))),(0,e.createElement)("div",{className:"masthead__plugin-links"},p)))}function m(t){var n;const{variables:i}=t,o=null!==(n=null==i?void 0:i.plugin_variables)&&void 0!==n?n:[],l={plugin:{title:(0,r.__)("Block Visibility","block-visibility")+" "+o.version,url:"https://www.blockvisibilitywp.com/?utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",rel:"external"},docs:{title:(0,r.__)("Knowledge Base","block-visibility"),url:"https://www.blockvisibilitywp.com/knowledge-base/?bv_query=knowledge_base&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",rel:"external"},support:{title:(0,r.__)("Support","block-visibility"),url:o.support_url},repo:{title:(0,r.__)("GitHub","block-visibility"),url:"https://github.com/ndiego/block-visibility"},twitter:{title:(0,r.__)("Twitter","block-visibility"),url:"https://twitter.com/BlockVisibility"}};(0,s.applyFilters)("blockVisibility.FooterLinks",l);const a=Object.keys(l).map((t=>{var n;const i=null!==(n=l[t].rel)&&void 0!==n?n:"noreferrer";return(0,e.createElement)("a",{key:t,href:l[t].url,className:"footer-links__"+t,target:"_blank",rel:i},l[t].title)}));return(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("div",{className:"inner-container"},a))}function b(){return b=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"save",n="";"reset"===e?(l("resetting"),n={reset:f}):"resetAll"===e?(l("resetting"),n={reset:"all"}):(l("saving"),n=(0,t.assign)({...p},{[f]:v}));const i=`${blockVisibilityRestUrl}block-visibility/v1/settings`,o=await fetch(i,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json","X-WP-Nonce":wpApiSettings.nonce}});if(o.ok){const t=await o.json();m(t),"reset"===e||"resetAll"===e?(l("reset"),u(!1)):(l("saved"),g(!1))}else l("error")}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-controls__save-settings"},["saving"===i&&(0,e.createElement)(a.Animate,{type:"loading"},(t=>{let{className:n}=t;return(0,e.createElement)("span",{className:o()("message",n)},(0,e.createElement)(c,{icon:d.cloud}),(0,r.__)("Saving","block-visibility"))})),"error"===i&&(0,e.createElement)("span",{className:"message update-failed"},(0,r.__)("Update failed. Try again or contact support.","block-visibility"))],"saving"!==i&&(0,e.createElement)(a.Button,{className:"reset-settings__save-button",onClick:()=>u(!0),isTertiary:!0},(0,r.__)("Reset Settings","block-visibility")),(0,e.createElement)(a.Button,{className:o()("save-settings__save-button",{"is-busy":"saving"===i}),onClick:()=>y(),disabled:!b&&"error"!==i,isPrimary:!0},h)),s&&(0,e.createElement)(a.Modal,{className:"block-visibility__reset-modal",title:(0,r.__)("Reset Settings","block-visibility"),onRequestClose:()=>u(!1)},(0,e.createElement)("p",null,(0,r.__)("Resetting will restore all configured settings on the current tab to their default values. To restore all plugin settings, choose Reset All.","block-visibility")),(0,e.createElement)("div",{className:"block-visibility__reset-modal--buttons"},(0,e.createElement)("div",{className:"block-visibility__reset-modal--buttons-reset"},(0,e.createElement)(a.Button,{isPrimary:!0,onClick:()=>y("reset")},(0,r.__)("Reset","block-visibility")),(0,e.createElement)(a.Button,{isSecondary:!0,onClick:()=>y("resetAll")},(0,r.__)("Reset All","block-visibility")),"resetting"===i&&(0,e.createElement)(a.Spinner,null)),(0,e.createElement)(a.Button,{isTertiary:!0,onClick:()=>u(!1)},(0,r.__)("Cancel","block-visibility"))),"error"===i&&(0,e.createElement)("div",{className:"message update-failed"},(0,r.__)("Reset failed. Try again or contact support.","block-visibility"))))}var f=window.wp.primitives,v=(0,e.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(f.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function h(t){const{message:n,subMessage:i,link:o,position:l}=t,s=null!=l?l:"middle left";return(0,e.createElement)("div",{className:"information-popover"},(0,e.createElement)(a.DropdownMenu,{label:(0,r.__)("More Information","block-visibility"),icon:v,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:s,noArrow:!1}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,n),i&&(0,e.createElement)("p",null,i),o&&(0,e.createElement)(a.ExternalLink,{href:o},(0,r.__)("Learn More","block-visibility"))))))}var y=window.React,_=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?O(A,--F):0,T--,10===R&&(T=1,N--),R}function H(){return R=F2||G(R)>3?"":" "}function K(e,t){for(;--t&&H()&&!(R<48||R>102||R>57&&R<65||R>70&&R<97););return j(e,U()+(t<6&&32==$()&&32==H()))}function X(e){for(;H();)switch(R){case e:return F;case 34:case 39:34!==e&&39!==e&&X(R);break;case 40:41===e&&X(e);break;case 92:H()}return F}function Q(e,t){for(;H()&&e+R!==57&&(e+R!==84||47!==$()););return"/*"+j(t,F-1)+"*"+k(47===e?e:H())}function J(e){for(;!G($());)H();return j(e,F)}var ee="-ms-",te="-moz-",ne="-webkit-",ie="comm",oe="rule",re="decl",le="@keyframes";function ae(e,t){for(var n="",i=V(e),o=0;o6)switch(O(e,t+1)){case 109:if(45!==O(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+te+(108==O(e,t+3)?"$3":"$2-$3"))+e;case 115:return~x(e,"stretch")?ce(S(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==O(e,t+1))break;case 6444:switch(O(e,M(e)-3-(~x(e,"!important")&&10))){case 107:return S(e,":",":"+ne)+e;case 101:return S(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ne+(45===O(e,14)?"inline-":"")+"box$3$1"+ne+"$2$3$1"+ee+"$2box$3")+e}break;case 5936:switch(O(e,t+11)){case 114:return ne+e+ee+S(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ne+e+ee+S(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ne+e+ee+S(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ne+e+ee+e+e}return e}function ue(e){var t=V(e);return function(n,i,o,r){for(var l="",a=0;a-1&&!e.return)switch(e.type){case re:e.return=ce(e.value,e.length);break;case le:return ae([D(e,{value:S(e.value,"@","@"+ne)})],i);case oe:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return ae([D(e,{props:[S(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return ae([D(e,{props:[S(t,/:(plac\w+)/,":-webkit-input-$1")]}),D(e,{props:[S(t,/:(plac\w+)/,":-moz-$1")]}),D(e,{props:[S(t,/:(plac\w+)/,ee+"input-$1")]})],i)}return""}))}}function me(e){return q(be("",null,null,null,[""],e=Z(e),0,[0],e))}function be(e,t,n,i,o,r,l,a,s){for(var c=0,u=0,d=l,p=0,m=0,b=0,g=1,f=1,v=1,h=0,y="",_=o,w=r,E=i,C=y;f;)switch(b=h,h=H()){case 40:if(108!=b&&58==C.charCodeAt(d-1)){-1!=x(C+=S(W(h),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:C+=W(h);break;case 9:case 10:case 13:case 32:C+=Y(b);break;case 92:C+=K(U()-1,7);continue;case 47:switch($()){case 42:case 47:P(fe(Q(H(),U()),t,n),s);break;default:C+="/"}break;case 123*g:a[c++]=M(C)*v;case 125*g:case 59:case 0:switch(h){case 0:case 125:f=0;case 59+u:m>0&&M(C)-d&&P(m>32?ve(C+";",i,n,d-1):ve(S(C," ","")+";",i,n,d-2),s);break;case 59:C+=";";default:if(P(E=ge(C,t,n,c,u,o,a,y,_=[],w=[],d),r),123===h)if(0===u)be(C,t,E,E,_,r,d,a,w);else switch(p){case 100:case 109:case 115:be(e,E,E,i&&P(ge(e,E,E,0,0,o,a,y,o,_=[],d),w),o,w,d,a,i?_:w);break;default:be(C,E,E,E,[""],w,0,a,w)}}c=u=m=0,g=v=1,y=C="",d=l;break;case 58:d=1+M(C),m=b;default:if(g<1)if(123==h)--g;else if(125==h&&0==g++&&125==z())continue;switch(C+=k(h),h*g){case 38:v=u>0?1:(C+="\f",-1);break;case 44:a[c++]=(M(C)-1)*v,v=1;break;case 64:45===$()&&(C+=W(H())),p=$(),u=d=M(y=C+=J(U())),h++;break;case 45:45===b&&2==M(C)&&(g=0)}}return r}function ge(e,t,n,i,o,r,l,a,s,c,u){for(var d=o-1,p=0===o?r:[""],m=V(p),b=0,g=0,f=0;b0?p[v]+" "+h:S(h,/&\f/g,p[v])))&&(s[f++]=y);return B(e,t,n,0===o?oe:a,s,c,u)}function fe(e,t,n){return B(e,t,n,ie,k(R),L(e,2,-2),0)}function ve(e,t,n,i){return B(e,t,n,re,L(e,0,i),L(e,i+1,-1),i)}var he=function(e,t,n){for(var i=0,o=0;i=o,o=$(),38===i&&12===o&&(t[n]=1),!G(o);)H();return j(e,F)},ye=new WeakMap,_e=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ye.get(n))&&!i){ye.set(e,!0);for(var o=[],r=function(e,t){return q(function(e,t){var n=-1,i=44;do{switch(G(i)){case 0:38===i&&12===$()&&(t[n]=1),e[n]+=he(F-1,t,n);break;case 2:e[n]+=W(i);break;case 4:if(44===i){e[++n]=58===$()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=k(i)}}while(i=H());return e}(Z(e),t))}(t,o),l=n.props,a=0,s=0;a=4;++i,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Le={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Me=/[A-Z]|^ms/g,Ve=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Pe=function(e){return 45===e.charCodeAt(1)},Ne=function(e){return null!=e&&"boolean"!=typeof e},Te=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Pe(n=e)?n:n.replace(Me,"-$&").toLowerCase()),t[e];var n}}(),Ie=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ve,(function(e,t,n){return Re={name:t,styles:n,next:Re},t}))}return 1===Le[e]||Pe(e)||"number"!=typeof t||0===t?t:t+"px"};function Fe(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Re={name:n.name,styles:n.styles,next:Re},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)Re={name:i.name,styles:i.styles,next:Re},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var o=0;o=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n-1}function xt(e){return St(e)?window.pageYOffset:e.scrollTop}function Ot(e,t){St(e)?window.scrollTo(0,t):e.scrollTop=t}function Lt(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Mt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_t,o=xt(e),r=t-o,l=10,a=0;function s(){var t=Lt(a+=l,o,r,n);Ot(e,t),a=b)return{placement:"bottom",maxHeight:t};if(C>=b&&!l)return r&&Mt(s,S,O),{placement:"bottom",maxHeight:t};if(!l&&C>=i||l&&k>=i)return r&&Mt(s,S,O),{placement:"bottom",maxHeight:l?k-y:C-y};if("auto"===o||l){var L=t,M=l?w:E;return M>=i&&(L=Math.min(M-y-a.controlHeight,t)),{placement:"top",maxHeight:L}}if("bottom"===o)return r&&Ot(s,S),{placement:"bottom",maxHeight:t};break;case"top":if(w>=b)return{placement:"top",maxHeight:t};if(E>=b&&!l)return r&&Mt(s,x,O),{placement:"top",maxHeight:t};if(!l&&E>=i||l&&w>=i){var V=t;return(!l&&E>=i||l&&w>=i)&&(V=l?w-_:E-_),r&&Mt(s,x,O),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}var Bt=function(e){return"auto"===e?"bottom":e},Dt=(0,y.createContext)({getPortalPlacement:null}),zt=function(e){ut(n,e);var t=ht(n);function n(){var e;lt(this,n);for(var i=arguments.length,o=new Array(i),r=0;r1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(i,r?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,o=e.label,r=void 0===o?"":o,l=e.selectValue,a=e.isDisabled,s=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&l)return"value ".concat(r," focused, ").concat(c(l,n),".");if("menu"===t){var u=a?" disabled":"",d="".concat(s?"selected":"focused").concat(u);return"option ".concat(r," ").concat(d,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},En=function(e){var t=e.ariaSelection,n=e.focusedOption,i=e.focusedValue,o=e.focusableOptions,r=e.isFocused,l=e.selectValue,a=e.selectProps,s=e.id,c=a.ariaLiveMessages,u=a.getOptionLabel,d=a.inputValue,p=a.isMulti,m=a.isOptionDisabled,b=a.isSearchable,g=a.menuIsOpen,f=a.options,v=a.screenReaderStatus,h=a.tabSelectsValue,_=a["aria-label"],w=a["aria-live"],k=(0,y.useMemo)((function(){return gt(gt({},kn),c||{})}),[c]),E=(0,y.useMemo)((function(){var e,n="";if(t&&k.onChange){var i=t.option,o=t.options,r=t.removedValue,a=t.removedValues,s=t.value,c=r||i||(e=s,Array.isArray(e)?null:e),d=c?u(c):"",p=o||a||void 0,b=p?p.map(u):[],g=gt({isDisabled:c&&m(c,l),label:d,labels:b},t);n=k.onChange(g)}return n}),[t,k,m,l,u]),C=(0,y.useMemo)((function(){var e="",t=n||i,o=!!(n&&l&&l.includes(n));if(t&&k.onFocus){var r={focused:t,label:u(t),isDisabled:m(t,l),isSelected:o,options:f,context:t===n?"menu":"value",selectValue:l};e=k.onFocus(r)}return e}),[n,i,u,m,k,f,l]),S=(0,y.useMemo)((function(){var e="";if(g&&f.length&&k.onFilter){var t=v({count:o.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[o,d,g,k,f,v]),x=(0,y.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":g?"menu":"input";e=k.guidance({"aria-label":_,context:t,isDisabled:n&&m(n,l),isMulti:p,isSearchable:b,tabSelectsValue:h})}return e}),[_,n,i,p,m,b,g,k,l,h]),O="".concat(C," ").concat(S," ").concat(x),L=Ye(y.Fragment,null,Ye("span",{id:"aria-selection"},E),Ye("span",{id:"aria-context"},O)),M="initial-input-focus"===(null==t?void 0:t.action);return Ye(y.Fragment,null,Ye(wn,{id:s},M&&L),Ye(wn,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text"},r&&!M&&L))},Cn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Sn=new RegExp("["+Cn.map((function(e){return e.letters})).join("")+"]","g"),xn={},On=0;On1?t-1:0),i=1;i0,g=d-p-u,f=!1;g>t&&l.current&&(i&&i(e),l.current=!1),b&&a.current&&(r&&r(e),a.current=!1),b&&t>g?(n&&!l.current&&n(e),m.scrollTop=d,f=!0,l.current=!0):!b&&-t>u&&(o&&!a.current&&o(e),m.scrollTop=0,f=!0,a.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,i,o,r]),d=(0,y.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,y.useCallback)((function(e){s.current=e.changedTouches[0].clientY}),[]),m=(0,y.useCallback)((function(e){var t=s.current-e.changedTouches[0].clientY;u(e,t)}),[u]),b=(0,y.useCallback)((function(e){if(e){var t=!!It&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",m,t)}}),[m,p,d]),g=(0,y.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",m,!1))}),[m,p,d]);return(0,y.useEffect)((function(){if(t){var e=c.current;return b(e),function(){g(e)}}}),[t,b,g]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),r=function(e){var t=e.isEnabled,n=e.accountForScrollbars,i=void 0===n||n,o=(0,y.useRef)({}),r=(0,y.useRef)(null),l=(0,y.useCallback)((function(e){if($n){var t=document.body,n=t&&t.style;if(i&&Rn.forEach((function(e){var t=n&&n[e];o.current[e]=t})),i&&Un<1){var r=parseInt(o.current.paddingRight,10)||0,l=document.body?document.body.clientWidth:0,a=window.innerWidth-l+r||0;Object.keys(An).forEach((function(e){var t=An[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(a,"px"))}t&&Hn()&&(t.addEventListener("touchmove",Bn,jn),e&&(e.addEventListener("touchstart",zn,jn),e.addEventListener("touchmove",Dn,jn))),Un+=1}}),[i]),a=(0,y.useCallback)((function(e){if($n){var t=document.body,n=t&&t.style;Un=Math.max(Un-1,0),i&&Un<1&&Rn.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&Hn()&&(t.removeEventListener("touchmove",Bn,jn),e&&(e.removeEventListener("touchstart",zn,jn),e.removeEventListener("touchmove",Dn,jn)))}}),[i]);return(0,y.useEffect)((function(){if(t){var e=r.current;return l(e),function(){a(e)}}}),[t,l,a]),function(e){r.current=e}}({isEnabled:n});return Ye(y.Fragment,null,n&&Ye("div",{onClick:Gn,css:Zn}),t((function(e){o(e),r(e)})))}var Wn={clearIndicator:on,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,i=e.theme,o=i.colors,r=i.borderRadius,l=i.spacing;return{label:"control",alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(o.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:nn,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing.baseUnit,o=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*i,marginTop:2*i,width:1}},input:function(e){var t=e.isDisabled,n=e.value,i=e.theme,o=i.spacing,r=i.colors;return gt({margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,visibility:t?"hidden":"visible",color:r.neutral80,transform:n?"translateZ(0)":""},dn)},loadingIndicator:function(e){var t=e.isFocused,n=e.size,i=e.theme,o=i.colors,r=i.spacing.baseUnit;return{label:"loadingIndicator",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*r,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:Ut,menu:function(e){var t,n=e.placement,i=e.theme,o=i.borderRadius,r=i.spacing,l=i.colors;return dt(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),dt(t,"backgroundColor",l.neutral0),dt(t,"borderRadius",o),dt(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),dt(t,"marginBottom",r.menuGutter),dt(t,"marginTop",r.menuGutter),dt(t,"position","absolute"),dt(t,"width","100%"),dt(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:i/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,i=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:i.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:i/2,backgroundColor:e.isFocused?o.dangerLight:void 0,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:$t,option:function(e){var t=e.isDisabled,n=e.isFocused,i=e.isSelected,o=e.theme,r=o.spacing,l=o.colors;return{label:"option",backgroundColor:i?l.primary:n?l.primary25:"transparent",color:t?l.neutral20:i?l.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:t?void 0:i?l.primary:l.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2}},singleValue:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing,o=n.colors;return{label:"singleValue",color:t?o.neutral40:o.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},valueContainer:function(e){var t=e.theme.spacing,n=e.isMulti,i=e.hasValue,o=e.selectProps.controlShouldRenderValue;return{alignItems:"center",display:n&&i&&o?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},Yn={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Kn={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Vt(),captureMenuScroll:!Vt(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=gt({ignoreCase:!0,ignoreAccents:!0,stringify:Tn,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,o=n.ignoreAccents,r=n.stringify,l=n.trim,a=n.matchFrom,s=l?Nn(t):t,c=l?Nn(r(e)):r(e);return i&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=Pn(s),c=Vn(c)),"start"===a?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function Xn(e,t,n,i){return{type:"option",data:t,isDisabled:ii(e,t,n),isSelected:oi(e,t,n),label:ti(e,t),value:ni(e,t),index:i}}function Qn(e,t){return e.options.map((function(n,i){if("options"in n){var o=n.options.map((function(n,i){return Xn(e,n,t,i)})).filter((function(t){return ei(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:i}:void 0}var r=Xn(e,n,t,i);return ei(e,r)?r:void 0})).filter(Ft)}function Jn(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,fn(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function ei(e,t){var n=e.inputValue,i=void 0===n?"":n,o=t.data,r=t.isSelected,l=t.label,a=t.value;return(!li(e)||!r)&&ri(e,{label:l,value:a,data:o},i)}var ti=function(e,t){return e.getOptionLabel(t)},ni=function(e,t){return e.getOptionValue(t)};function ii(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function oi(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=ni(e,t);return n.some((function(t){return ni(e,t)===i}))}function ri(e,t,n){return!e.filterOption||e.filterOption(t,n)}var li=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},ai=1,si=function(e){ut(n,e);var t=ht(n);function n(e){var i;return lt(this,n),(i=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.instancePrefix="",i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(e){i.controlRef=e},i.focusedOptionRef=null,i.getFocusedOptionRef=function(e){i.focusedOptionRef=e},i.menuListRef=null,i.getMenuListRef=function(e){i.menuListRef=e},i.inputRef=null,i.getInputRef=function(e){i.inputRef=e},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(e,t){var n=i.props,o=n.onChange,r=n.name;t.name=r,i.ariaOnChange(e,t),o(e,t)},i.setValue=function(e,t,n){var o=i.props,r=o.closeMenuOnSelect,l=o.isMulti,a=o.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:a}),r&&(i.setState({inputIsHiddenAfterUpdate:!l}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(e,{action:t,option:n})},i.selectOption=function(e){var t=i.props,n=t.blurInputOnSelect,o=t.isMulti,r=t.name,l=i.state.selectValue,a=o&&i.isOptionSelected(e,l),s=i.isOptionDisabled(e,l);if(a){var c=i.getOptionValue(e);i.setValue(l.filter((function(e){return i.getOptionValue(e)!==c})),"deselect-option",e)}else{if(s)return void i.ariaOnChange(e,{action:"select-option",option:e,name:r});o?i.setValue([].concat(fn(l),[e]),"select-option",e):i.setValue(e,"select-option")}n&&i.blurInput()},i.removeValue=function(e){var t=i.props.isMulti,n=i.state.selectValue,o=i.getOptionValue(e),r=n.filter((function(e){return i.getOptionValue(e)!==o})),l=Rt(t,r,r[0]||null);i.onChange(l,{action:"remove-value",removedValue:e}),i.focusInput()},i.clearValue=function(){var e=i.state.selectValue;i.onChange(Rt(i.props.isMulti,[],null),{action:"clear",removedValues:e})},i.popValue=function(){var e=i.props.isMulti,t=i.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),r=Rt(e,o,o[0]||null);i.onChange(r,{action:"pop-value",removedValue:n})},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n5||r>5}},i.onTouchEnd=function(e){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(e.target)&&i.menuListRef&&!i.menuListRef.contains(e.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(e){i.userIsDragging||i.onControlMouseDown(e)},i.onClearIndicatorTouchEnd=function(e){i.userIsDragging||i.onClearIndicatorMouseDown(e)},i.onDropdownIndicatorTouchEnd=function(e){i.userIsDragging||i.onDropdownIndicatorMouseDown(e)},i.handleInputChange=function(e){var t=i.props.inputValue,n=e.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(n,{action:"input-change",prevInputValue:t}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(e){i.props.onFocus&&i.props.onFocus(e),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(e){var t=i.props.inputValue;i.menuListRef&&i.menuListRef.contains(document.activeElement)?i.inputRef.focus():(i.props.onBlur&&i.props.onBlur(e),i.onInputChange("",{action:"input-blur",prevInputValue:t}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1}))},i.onOptionHover=function(e){i.blockOptionHover||i.state.focusedOption===e||i.setState({focusedOption:e})},i.shouldHideSelectedOptions=function(){return li(i.props)},i.onKeyDown=function(e){var t=i.props,n=t.isMulti,o=t.backspaceRemovesValue,r=t.escapeClearsValue,l=t.inputValue,a=t.isClearable,s=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,m=i.state,b=m.focusedOption,g=m.focusedValue,f=m.selectValue;if(!(s||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(i.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||l)return;i.focusValue("previous");break;case"ArrowRight":if(!n||l)return;i.focusValue("next");break;case"Delete":case"Backspace":if(l)return;if(g)i.removeValue(g);else{if(!o)return;n?i.popValue():a&&i.clearValue()}break;case"Tab":if(i.isComposing)return;if(e.shiftKey||!c||!d||!b||p&&i.isOptionSelected(b,f))return;i.selectOption(b);break;case"Enter":if(229===e.keyCode)break;if(c){if(!b)return;if(i.isComposing)return;i.selectOption(b);break}return;case"Escape":c?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:l}),i.onMenuClose()):a&&r&&i.clearValue();break;case" ":if(l)return;if(!c){i.openMenu("first");break}if(!b)return;i.selectOption(b);break;case"ArrowUp":c?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":c?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!c)return;i.focusOption("pageup");break;case"PageDown":if(!c)return;i.focusOption("pagedown");break;case"Home":if(!c)return;i.focusOption("first");break;case"End":if(!c)return;i.focusOption("last");break;default:return}e.preventDefault()}},i.instancePrefix="react-select-"+(i.props.instanceId||++ai),i.state.selectValue=Et(e.value),i}return st(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,i,o,r,l=this.props,a=l.isDisabled,s=l.menuIsOpen,c=this.state.isFocused;(c&&!a&&e.isDisabled||c&&s&&!e.menuIsOpen)&&this.focusInput(),c&&a&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,i=t.getBoundingClientRect(),o=n.getBoundingClientRect(),r=n.offsetHeight/3,o.bottom+r>i.bottom?Ot(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+r,t.scrollHeight)):o.top-r-1&&(l=a)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:r[l]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(i);i||(o=-1);var r=n.length-1,l=-1;if(n.length){switch(e){case"previous":l=0===o?0:-1===o?r:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var o=0,r=i.indexOf(n);n||(r=-1),"up"===e?o=r>0?r-1:i.length-1:"down"===e?o=(r+1)%i.length:"pageup"===e?(o=r-t)<0&&(o=0):"pagedown"===e?(o=r+t)>i.length-1&&(o=i.length-1):"last"===e&&(o=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Yn):gt(gt({},Yn),this.props.theme):Yn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getValue,o=this.selectOption,r=this.setValue,l=this.props,a=l.isMulti,s=l.isRtl,c=l.options;return{clearValue:e,cx:t,getStyles:n,getValue:i,hasValue:this.hasValue(),isMulti:a,isRtl:s,options:c,selectOption:o,selectProps:l,setValue:r,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return ii(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return oi(this.props,e,t)}},{key:"filterOption",value:function(e,t){return ri(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,o=e.inputValue,r=e.tabIndex,l=e.form,a=e.menuIsOpen,s=this.getComponents().Input,c=this.state,u=c.inputIsHidden,d=c.ariaSelection,p=this.commonProps,m=i||this.getElementId("input"),g=gt(gt(gt({"aria-autocomplete":"list","aria-expanded":a,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},a&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==d?void 0:d.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?y.createElement(s,b({},p,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:l,type:"text",value:o},g)):y.createElement(Fn,b({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_t,onFocus:this.onInputFocus,disabled:t,tabIndex:r,inputMode:"none",form:l,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,o=t.MultiValueLabel,r=t.MultiValueRemove,l=t.SingleValue,a=t.Placeholder,s=this.commonProps,c=this.props,u=c.controlShouldRenderValue,d=c.isDisabled,p=c.isMulti,m=c.inputValue,g=c.placeholder,f=this.state,v=f.selectValue,h=f.focusedValue,_=f.isFocused;if(!this.hasValue()||!u)return m?null:y.createElement(a,b({},s,{key:"placeholder",isDisabled:d,isFocused:_,innerProps:{id:this.getElementId("placeholder")}}),g);if(p)return v.map((function(t,l){var a=t===h,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return y.createElement(n,b({},s,{components:{Container:i,Label:o,Remove:r},isFocused:a,isDisabled:d,key:c,index:l,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(m)return null;var w=v[0];return y.createElement(l,b({},s,{data:w,isDisabled:d}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,r=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||o)return null;var l={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return y.createElement(e,b({},t,{innerProps:l,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,r=this.state.isFocused;return e&&o?y.createElement(e,b({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return y.createElement(n,b({},i,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return y.createElement(e,b({},t,{innerProps:o,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,o=t.Menu,r=t.MenuList,l=t.MenuPortal,a=t.LoadingMessage,s=t.NoOptionsMessage,c=t.Option,u=this.commonProps,d=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,g=p.inputValue,f=p.isLoading,v=p.loadingMessage,h=p.minMenuHeight,_=p.maxMenuHeight,w=p.menuIsOpen,k=p.menuPlacement,E=p.menuPosition,C=p.menuPortalTarget,S=p.menuShouldBlockScroll,x=p.menuShouldScrollIntoView,O=p.noOptionsMessage,L=p.onMenuScrollToTop,M=p.onMenuScrollToBottom;if(!w)return null;var V,P=function(t,n){var i=t.type,o=t.data,r=t.isDisabled,l=t.isSelected,a=t.label,s=t.value,p=d===o,m=r?void 0:function(){return e.onOptionHover(o)},g=r?void 0:function(){return e.selectOption(o)},f="".concat(e.getElementId("option"),"-").concat(n),v={id:f,onClick:g,onMouseMove:m,onMouseOver:m,tabIndex:-1};return y.createElement(c,b({},u,{innerProps:v,data:o,isDisabled:r,isSelected:l,key:f,label:a,type:i,value:s,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())V=this.getCategorizedOptions().map((function(t){if("group"===t.type){var o=t.data,r=t.options,l=t.index,a="".concat(e.getElementId("group"),"-").concat(l),s="".concat(a,"-heading");return y.createElement(n,b({},u,{key:a,data:o,options:r,Heading:i,headingProps:{id:s,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return P(e,"".concat(l,"-").concat(e.index))})))}if("option"===t.type)return P(t,"".concat(t.index))}));else if(f){var N=v({inputValue:g});if(null===N)return null;V=y.createElement(a,u,N)}else{var T=O({inputValue:g});if(null===T)return null;V=y.createElement(s,u,T)}var I={minMenuHeight:h,maxMenuHeight:_,menuPlacement:k,menuPosition:E,menuShouldScrollIntoView:x},F=y.createElement(zt,b({},u,I),(function(t){var n=t.ref,i=t.placerProps,l=i.placement,a=i.maxHeight;return y.createElement(o,b({},u,I,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:f,placement:l}),y.createElement(qn,{captureEnabled:m,onTopArrive:L,onBottomArrive:M,lockEnabled:S},(function(t){return y.createElement(r,b({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:f,maxHeight:a,focusedOption:d}),V)})))}));return C||"fixed"===E?y.createElement(l,b({},u,{appendTo:C,controlElement:this.controlRef,menuPlacement:k,menuPosition:E}),F):F}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,o=t.isMulti,r=t.name,l=this.state.selectValue;if(r&&!i){if(o){if(n){var a=l.map((function(t){return e.getOptionValue(t)})).join(n);return y.createElement("input",{name:r,type:"hidden",value:a})}var s=l.length>0?l.map((function(t,n){return y.createElement("input",{key:"i-".concat(n),name:r,type:"hidden",value:e.getOptionValue(t)})})):y.createElement("input",{name:r,type:"hidden"});return y.createElement("div",null,s)}var c=l[0]?this.getOptionValue(l[0]):"";return y.createElement("input",{name:r,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,o=t.focusedValue,r=t.isFocused,l=t.selectValue,a=this.getFocusableOptions();return y.createElement(En,b({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:o,isFocused:r,selectValue:l,focusableOptions:a}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,o=e.ValueContainer,r=this.props,l=r.className,a=r.id,s=r.isDisabled,c=r.menuIsOpen,u=this.state.isFocused,d=this.commonProps=this.getCommonProps();return y.createElement(i,b({},d,{className:l,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:u}),this.renderLiveRegion(),y.createElement(t,b({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:u,menuIsOpen:c}),y.createElement(o,b({},d,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),y.createElement(n,b({},d,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,r=t.ariaSelection,l=t.isFocused,a=t.prevWasFocused,s=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,m=Et(c),b={};if(n&&(c!==n.value||s!==n.options||u!==n.menuIsOpen||d!==n.inputValue)){var g=u?function(e,t){return Jn(Qn(e,t))}(e,m):[],f=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i-1?n:t[0]}(t,g);b={selectValue:m,focusedOption:v,focusedValue:f,clearFocusValueOnUpdate:!1}}var h=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},y=r,_=l&&a;return l&&!_&&(y={value:Rt(p,m,m[0]||null),options:m,action:"initial-input-focus"},_=!a),"initial-input-focus"===(null==r?void 0:r.action)&&(y=null),gt(gt(gt({},b),h),{},{prevProps:e,ariaSelection:y,prevWasFocused:_})}}]),n}(y.Component);si.defaultProps=Kn;var ci=(0,y.forwardRef)((function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,i=e.defaultMenuIsOpen,o=void 0!==i&&i,r=e.defaultValue,l=void 0===r?null:r,a=e.inputValue,s=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,m=e.value,b=tt(e,gn),g=ot((0,y.useState)(void 0!==a?a:n),2),f=g[0],v=g[1],h=ot((0,y.useState)(void 0!==s?s:o),2),_=h[0],w=h[1],k=ot((0,y.useState)(void 0!==m?m:l),2),E=k[0],C=k[1],S=(0,y.useCallback)((function(e,t){"function"==typeof c&&c(e,t),C(e)}),[c]),x=(0,y.useCallback)((function(e,t){var n;"function"==typeof u&&(n=u(e,t)),v(void 0!==n?n:e)}),[u]),O=(0,y.useCallback)((function(){"function"==typeof p&&p(),w(!0)}),[p]),L=(0,y.useCallback)((function(){"function"==typeof d&&d(),w(!1)}),[d]),M=void 0!==a?a:f,V=void 0!==s?s:_,P=void 0!==m?m:E;return gt(gt({},b),{},{inputValue:M,menuIsOpen:V,onChange:S,onInputChange:x,onMenuClose:L,onMenuOpen:O,value:P})}(e);return y.createElement(si,b({ref:t},n))})),ui=(y.Component,ci);function di(n){var i,o;const{settings:l,setSettings:c,setHasUpdates:u,variables:p}=n,m=null!==(i=null==l?void 0:l.plugin_settings)&&void 0!==i?i:{};let b=function(e,n){var i;let o=[];if(!e||!n||0===e.length||0===n.length)return o;let l=function(){let e=[{label:(0,r.__)("Hide Block","block-visibility"),type:"core",attributeSlug:"hideBlock",settingSlug:"hide_block"},{label:(0,r.__)("Date & Time","block-visibility"),type:"core",attributeSlug:"dateTime",settingSlug:"date_time"},{label:(0,r.__)("User Role","block-visibility"),type:"core",attributeSlug:"userRole",settingSlug:"visibility_by_role"},{label:(0,r.__)("Screen Size","block-visibility"),type:"core",attributeSlug:"screenSize",settingSlug:"screen_size"},{label:(0,r.__)("Query String","block-visibility"),type:"core",attributeSlug:"queryString",settingSlug:"query_string"}];e=(0,s.applyFilters)("blockVisibility.coreControls",e),e.sort(((e,t)=>e.attributeSlug.localeCompare(t.attributeSlug)));let t=[{label:(0,r.__)("Advanced Custom Fields","block-visibility"),type:"integration",attributeSlug:"acf",settingSlug:"acf",icon:d.acf},{label:(0,r.__)("WP Fusion","block-visibility"),type:"integration",attributeSlug:"wpFusion",settingSlug:"wp_fusion",icon:d.wpFusion}];t=(0,s.applyFilters)("blockVisibility.integrationControls",t),t.sort(((e,t)=>e.attributeSlug.localeCompare(t.attributeSlug)));let n=[...e,...t];return n=(0,s.applyFilters)("blockVisibility.controls",n),n}();l.forEach((function(e){"integration"!==e.type||(e=>{let t=!1;var i,o;return null!=n&&n.integrations&&(t=null!==(i=null==n||null===(o=n.integrations[e])||void 0===o?void 0:o.active)&&void 0!==i&&i),t})(e.settingSlug)||(l=l.filter((t=>t.settingSlug!==e.settingSlug)))}));const a=null!==(i=null==e?void 0:e.visibility_controls)&&void 0!==i?i:{};return(0,t.isEmpty)(a)||l.forEach((function(e){var n,i;let r=!1;(0,t.has)(a,e.settingSlug)||(r=!0),(null===(n=null===(i=a[e.settingSlug])||void 0===i?void 0:i.enable)||void 0===n||n)&&(r=!0),r&&o.push(e)})),o=(0,s.applyFilters)("blockVisibility.enabledControls",o,e,n),o}(l,p);b=b.filter((e=>"hide_block"!==e.settingSlug&&"visibility_presets"!==e.settingSlug));const g=[];b.forEach((e=>{g.push({label:e.label,value:e.settingSlug})}));const f=null!==(o=null==m?void 0:m.default_controls)&&void 0!==o?o:["date_time","visibility_by_role","screen_size"],v=g.filter((e=>f.includes(e.value)));return(0,e.createElement)("div",{className:"setting-tabs__settings-panel two-columns"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("General","block-visibility"))),(0,e.createElement)(a.Slot,{name:"VisibilityControlsGeneralTop"}),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__select has-info-popover"},(0,e.createElement)("div",null,(0,e.createElement)("span",null,(0,r.__)("Default visibility controls","block-visibility")),(0,e.createElement)(ui,{className:"block-visibility__react-select",classNamePrefix:"react-select",placeholder:(0,r.__)("Select Controls…","block-visibility"),options:g,value:v,onChange:e=>(e=>{const t=[];0!==e.length&&e.forEach((e=>{t.push(e.value)})),c({...l,plugin_settings:{...m,default_controls:t}}),u(!0)})(e),isMulti:!0}),(0,e.createElement)("div",{className:"settings-panel__help"},(0,r.__)("If no controls are selected, the plugin will default to Date & Time, User Role, and Screen Size.","block-visibility"))),(0,e.createElement)(h,{message:(0,r.__)("Optionally set the default controls that will be available when editing a block's visibility for the first time. This can be useful if you find yourself using the same few controls frequently. Controls can be disabled entirely on the Visibility Controls tab.","block-visibility")})),(0,e.createElement)(a.Slot,{name:"VisibilityControlsGeneralBottom"})))}function pi(t){var n,i;const{visibilityControls:o,setVisibilityControls:l}=t,s=null===(n=null==o||null===(i=o.hide_block)||void 0===i?void 0:i.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Hide Block","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Hide Block control.","block-visibility"),checked:s,onChange:()=>{l({...o,hide_block:{...o.hide_block,enable:!s}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Hide Block control allows you easily hide blocks on the frontend of your website. This control overrides all other controls when enabled on a block. Visit the plugin Knowledge Base for more information and examples of how this control can be used for content management.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-hide-block-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function mi(t){var n,i;const{visibilityControls:o,setVisibilityControls:l}=t,s=null===(n=null==o||null===(i=o.date_time)||void 0===i?void 0:i.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Date & Time","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Date & Time controls.","block-visibility"),checked:s,onChange:()=>{l({...o,date_time:{...o.date_time,enable:!s}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Date & Time control allows you to conditionally display blocks based on time and date settings, which includes the ability to schedule blocks. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-date-time-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(a.Slot,{name:"DateTimeControls"})))}function bi(t){var n,i,o,l,s,c,u,d;const{visibilityControls:p,setVisibilityControls:m}=t,b=null===(n=null==p||null===(i=p.visibility_by_role)||void 0===i?void 0:i.enable)||void 0===n||n,g=null===(o=null==p||null===(l=p.visibility_by_role)||void 0===l?void 0:l.enable_user_roles)||void 0===o||o,f=null===(s=null==p||null===(c=p.visibility_by_role)||void 0===c?void 0:c.enable_users)||void 0===s||s,v=null===(u=null==p||null===(d=p.visibility_by_role)||void 0===d?void 0:d.enable_user_rule_sets)||void 0===u||u;let y=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable individual user role restrictions (Administrator, Editor, Subscriber, etc.)","block-visibility"),checked:g,onChange:()=>{m({...p,visibility_by_role:{...p.visibility_by_role,enable_user_roles:!g}})}}),_=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable individual user restrictions.","block-visibility"),checked:f,onChange:()=>{m({...p,visibility_by_role:{...p.visibility_by_role,enable_users:!f}})}}),w=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable advanced user role restrictions (User rule sets)","block-visibility"),checked:v,onChange:()=>{m({...p,visibility_by_role:{...p.visibility_by_role,enable_user_rule_sets:!v}})}});return b||(y=(0,e.createElement)(a.Disabled,null,y),_=(0,e.createElement)(a.Disabled,null,_),w=(0,e.createElement)(a.Disabled,null,w)),(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("User Role","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the User Role controls.","block-visibility"),checked:b,onChange:()=>{m({...p,visibility_by_role:{...p.visibility_by_role,enable:!b}})}}),(0,e.createElement)(h,{message:(0,r.__)("The User Role control allows you to conditionally display blocks based on whether a user is logged-in, logged-out, and more. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("hr",null),(0,e.createElement)("div",{className:"settings-type__toggle first has-info-popover subsetting"},y,(0,e.createElement)(h,{message:(0,r.__)("Restrict visibility by any user role (Administrator, Editor, Subscriber, etc.). Roles that are added by third-party plugins will also be available to choose from.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},_,(0,e.createElement)(h,{message:(0,r.__)("Restrict visibility to specific individual users on your website based on user ID. Multiple users can be selected at once.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},w,(0,e.createElement)(h,{message:(0,r.__)("This functionality allows you to create user-based rule sets, which provide extensive configuration options and greater flexibilty.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(a.Slot,{name:"VisibilityByRoleControls"})))}function gi(t){const[n,i]=(0,e.useState)(!1),{screenSize:o,enableAdvancedControls:l}=t,s=function(e){const t=e.breakpoints.large,n=e.breakpoints.medium,i=e.controls.large,o=e.controls.medium,r=e.controls.small;let l="";return i&&(l=`/* Large screens (desktops, ${t} and up) */\n@media ( min-width: ${t} ) {\n\t.block-visibility-hide-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),o&&(l=(l?l+"\n\n":l)+`/* Medium screens (tablets, between ${n} and ${t}) */\n@media ( min-width: ${n} ) and ( max-width: ${fi(t)} ) {\n\t.block-visibility-hide-medium-screen {\n\t\tdisplay: none !important;\n\t}\n}`),r&&(l=(l?l+"\n\n":l)+`/* Small screens (mobile devices, less than ${n}) */\n@media ( max-width: ${fi(n)} ) {\n\t.block-visibility-hide-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),l||(l="/* All screen size controls have been disabled. */"),l}(o),c=function(e){const t=e.breakpoints.extra_large,n=e.breakpoints.large,i=e.breakpoints.medium,o=e.breakpoints.small,r=e.controls.extra_large,l=e.controls.large,a=e.controls.medium,s=e.controls.small,c=e.controls.extra_small,u="\n\n";let d="";return r&&(d=`/* Extra large screens (large desktops, ${t} and up) */\n@media ( min-width: ${t} ) {\n\t.block-visibility-hide-extra-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),l&&(d=(d?d+u:d)+`/* Large screens (desktops, between ${n} and ${t}) */\n@media ( min-width: ${n} ) and (max-width: ${fi(t)} ) {\n\t.block-visibility-hide-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),a&&(d=(d?d+u:d)+`/* Medium screens (tablets, between ${i} and ${n}) */\n@media ( min-width: ${i} ) and ( max-width: ${fi(n)} ) {\n\t.block-visibility-hide-medium-screen {\n\t\tdisplay: none !important;\n\t}\n}`),s&&(d=(d?d+u:d)+`/* Small screens (landscape mobile devices, between ${o} and ${n}) */\n@media ( min-width: ${o} ) and ( max-width: ${fi(i)} ) {\n\t.block-visibility-hide-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),c&&(d=(d?d+u:d)+`/* Extra small screens (portrait mobile devices, less than ${o}) */\n@media ( max-width: ${fi(o)} ) {\n\t.block-visibility-hide-extra-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),d||(d="/* All screen size controls have been disabled. */"),d}(o);return(0,e.createElement)("div",{className:"breakpoint-css-preview subsetting"},(0,e.createElement)(a.Button,{onClick:()=>i(!n),isSecondary:!0},[!n&&(0,r.__)("Preview Frontend CSS","block-visibility"),n&&(0,r.__)("Hide Preview","block-visibility")]),n&&(0,e.createElement)("pre",null,[l&&c,!l&&s]))}function fi(e){return(0,t.trim)(e,"px")-.02+"px"}function vi(t){const{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:l}=t,s={extra_large:{title:(0,r.__)("Extra Large","block-visibility"),description:(0,r.__)("Large desktop screen sizes.")},large:{title:(0,r.__)("Large","block-visibility"),description:(0,r.__)("Desktop and tablet (landscape) screen sizes.","block-visibility")},medium:{title:(0,r.__)("Medium","block-visibility"),description:(0,r.__)("Tablet (portrait) screen sizes.","block-visibility")},small:{title:(0,r.__)("Small","block-visibility"),description:(0,r.__)("Mobile (landscape) screen sizes.","block-visibility")}};return(0,e.createElement)("div",{className:"breakpoints-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Breakpoints","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The plugin sets a series of breakpoints which enable the Screen Size control automatically. However for best results, you can configure the breakpoints to correspond with the media breakpoints of your current theme.","block-visibility"),subMessage:(0,r.__)("The default breakpoints are Large (992px) and Medium (768px). Advanced screen size controls add Extra Large (1200px) and Small (576px).","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),Object.entries(s).map((t=>{let[r,s]=t;const c=o.breakpoints[r];return"extra_large"!==r&&"small"!==r||l?(0,e.createElement)("div",{className:"breakpoint",key:r},(0,e.createElement)("div",{className:"breakpoint-inputs"},(0,e.createElement)(a.__experimentalUnitControl,{label:s.title,value:c,onChange:e=>function(e,t){i({...n,screen_size:{...o,breakpoints:{...o.breakpoints,[e]:t}}})}(r,e),units:[{value:"px",label:"px"}]}),(0,e.createElement)("div",{className:"settings-panel__help"},s.description))):null})))}function hi(t){const{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:l}=t;function s(e,t){i({...n,screen_size:{...o,controls:{...o.controls,[e]:t}}})}return(0,e.createElement)("div",{className:"controls-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Controls","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The settings below allow you to restrict which controls are available to users in the Block/Site Editor. Disabling controls will remove the corresponding CSS from the frontend of your website.","block-visibility"),subMessage:(0,r.__)("The default controls are Desktop, Tablet, and Mobile. Advanced screen size controls add Large Desktop and Mobile (portrait).","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),l&&(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable large desktop control","block-visibility"),help:(0,r.sprintf)(// translators: %s: extra large breakpoint -(0,r.__)("Allows users to hide blocks on extra large screen sizes, %s and up.","block-visibility"),o.breakpoints.extra_large),checked:o.controls.extra_large,onChange:()=>s("extra_large",!o.controls.extra_large)}),(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable desktop control","block-visibility"),help:[!l&&(0,r.sprintf)(// translators: %s large breakpoint -(0,r.__)("Allows users to hide blocks on large screen sizes, %s and up.","block-visibility"),o.breakpoints.large),l&&(0,r.sprintf)(// translators: %1$s: large breakpoint %2$s: extra large breakpoint -(0,r.__)("Allows users to hide blocks on large screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.large,o.breakpoints.extra_large)],checked:o.controls.large,onChange:()=>s("large",!o.controls.large)}),(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable tablet control","block-visibility"),help:(0,r.sprintf)(// translators: %1$s: medium breakpoint %2$s: large breakpoint -(0,r.__)("Allows users to hide blocks on medium screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.medium,o.breakpoints.large),checked:o.controls.medium,onChange:()=>s("medium",!o.controls.medium)}),(0,e.createElement)(a.ToggleControl,{label:[!l&&(0,r.__)("Enable mobile control","block-visibility"),l&&(0,r.__)("Enable mobile (landscape) control","block-visibility")],help:[!l&&(0,r.sprintf)(// translators: %s: medium breakpoint -(0,r.__)("Allows users to hide blocks on small screen sizes, less than %s.","block-visibility"),o.breakpoints.medium),l&&(0,r.sprintf)(// translators: %1$s: small breakpoint %2$s: medium breakpoint -(0,r.__)("Allows users to hide blocks on small screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.small,o.breakpoints.medium)],checked:o.controls.small,onChange:()=>s("small",!o.controls.small)}),l&&(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable mobile (portrait) control","block-visibility"),help:(0,r.sprintf)(// translators: %s: small breakpoint -(0,r.__)("Allows users to hide blocks on extra small screen sizes, less than %s.","block-visibility"),o.breakpoints.small),checked:o.controls.extra_small,onChange:()=>s("extra_small",!o.controls.extra_small)}))}function yi(t){const{visibilityControls:n,setVisibilityControls:i}=t;let o;o=null!=n&&n.screen_size?n.screen_size:{enable:!0,breakpoints:{extra_large:"1200px",large:"992px",medium:"768px",small:"576px"},controls:{extra_large:!0,large:!0,medium:!0,small:!0,extra_small:!0},enable_advanced_controls:!1,enable_frontend_css:!0};let l=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"breakpoint-control-container subsetting"},(0,e.createElement)(vi,{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:o.enable_advanced_controls}),(0,e.createElement)(hi,{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:o.enable_advanced_controls})),(0,e.createElement)(gi,{screenSize:o,enableAdvancedControls:o.enable_advanced_controls})),s=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable advanced screen size controls.","block-visibility"),checked:o.enable_advanced_controls,onChange:()=>{i({...n,screen_size:{...o,enable_advanced_controls:!o.enable_advanced_controls}})}}),c=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Load screen size CSS on the frontend of this website.","block-visibility"),checked:o.enable_frontend_css,onChange:()=>{i({...n,screen_size:{...o,enable_frontend_css:!o.enable_frontend_css}})}});return o.enable||(l=(0,e.createElement)(a.Disabled,null,l),s=(0,e.createElement)(a.Disabled,null,s),c=(0,e.createElement)(a.Disabled,null,c)),(0,e.createElement)("div",{className:"setting-tabs__settings-panel two-columns"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Screen Size","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Screen Size controls.","block-visibility"),checked:o.enable,onChange:()=>{i({...n,screen_size:{...o,enable:!o.enable}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Screen Size control allows you to conditionally display blocks on the current width of the browser window, or in other words, the screen size of a user's device. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("hr",null),l,(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},s,(0,e.createElement)(h,{message:(0,r.__)("By default, the Screen Size control includes two breakpoints and three controls for users to hide blocks. There are certain situations where you may need more control over when a block should be visible, for example in the case of very large or small screens. Enabling advanced controls provides these options.","block-visibility"),subMessage:(0,r.__)("Note that once enabled, any block that is only using the advanced controls to hide at extra large, or extra small, breakpoints will become visible again if this setting is ever disabled in the future.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},c,(0,e.createElement)(h,{message:(0,r.__)('By default, the CSS needed for the Screen Size controls is loaded on the frontend of your website. If disabled, you will need to add the CSS manually to your theme in order for the Screen Size controls to work properly. This CSS code is available via the "Preview Frontend CSS" button on this page.',"block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(a.Slot,{name:"ScreenSizeControls"})))}function _i(t){var n,i;const{visibilityControls:o,setVisibilityControls:l}=t,s=null===(n=null==o||null===(i=o.query_string)||void 0===i?void 0:i.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Query String","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Query String control.","block-visibility"),checked:s,onChange:()=>{l({...o,query_string:{...o.query_string,enable:!s}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Query String control allows you to conditionally display blocks based on URL query strings. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-query-string-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function wi(t){var n,i,o,l,s;const{variables:u,visibilityControls:p,setVisibilityControls:m}=t;if(null===(n=null==u||null===(i=u.integrations)||void 0===i||null===(o=i.acf)||void 0===o?void 0:o.active)||void 0===n||!n)return null;const b=null===(l=null==p||null===(s=p.acf)||void 0===s?void 0:s.enable)||void 0===l||l;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(c,{icon:d.acf}),(0,r.__)("Advanced Custom Fields","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Advanced Custom Fields control.","block-visibility"),checked:b,onChange:()=>{m({...p,acf:{...p.acf,enable:!b}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Advanced Custom Fields (ACF) control allows you to conditionally display blocks, including ACF blocks, based on ACF fields. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-advanced-custom-fields-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function ki(t){var n,i,o,l,s;const{variables:u,visibilityControls:p,setVisibilityControls:m}=t;if(null===(n=null==u||null===(i=u.integrations)||void 0===i||null===(o=i.wp_fusion)||void 0===o?void 0:o.active)||void 0===n||!n)return null;const b=null===(l=null==p||null===(s=p.wp_fusion)||void 0===s?void 0:s.enable)||void 0===l||l;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(c,{icon:d.wpFusion}),(0,r.__)("WP Fusion","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the WP Fusion control.","block-visibility"),checked:b,onChange:()=>{m({...p,wp_fusion:{...p.wp_fusion,enable:!b}})}}),(0,e.createElement)(h,{message:(0,r.__)("The WP Fusion control allows you to conditionally display blocks based on WP Fusion tags. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-wp-fusion-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function Ei(t){var n;const{variables:i,visibilityControls:o}=t;let l=null!==(n=null==i?void 0:i.integrations)&&void 0!==n?n:{};return l=Object.keys(l).map((e=>l[e])),l=l.filter((e=>!0===e.active)),0===l.length?null:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-tabs__setting-controls integrations"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,r.__)("Third-Party Integration Controls","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The settings below allow you to configure all third-party integration controls for Block Visibility. If you are looking for an integration, and do not see it below, make sure the respective third-party plugin is installed and activated on your website.","block-visibility"),subMessage:(0,r.__)("Visit the plugin Knowledge Base for more information on configuring third-party integration controls and what integrations are currently available in Block Visibility.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/guide-to-third-party-integrations-in-block-visibility/?utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(g,b({tabSlug:"visibility_controls",tabSettings:o},t))),(0,e.createElement)(a.Slot,{name:"VisibilityControlsIntegrationsTop"}),(0,e.createElement)(wi,t),(0,e.createElement)(ki,t),(0,e.createElement)(a.Slot,{name:"VisibilityControlsIntegrationsBottom"}))}const Ci=(0,a.withFilters)("blockVisibility.VisibilityControls")((t=>(0,e.createElement)(e.Fragment,null)));function Si(t){var n;const[i,o]=(0,e.useState)(!1),{settings:l,setSettings:s}=t,c=null!==(n=null==l?void 0:l.visibility_controls)&&void 0!==n?n:{};function u(e){s({...l,visibility_controls:e}),o(!0)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-tabs__visibility-controls inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,r.__)("Visibility Controls","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The settings below allow you to configure the visibility controls that power Block Visibility. Pick and choose which controls you would like to enable and how you would like them to function.","block-visibility"),subMessage:(0,r.__)("When a visibility control is disabled, blocks that relied on the disabled control will become visible again unless they are hidden by other enabled controls. Visit the plugin Knowledge Base for more information on configuring visibility controls.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/guide-to-visibility-controls-in-block-visibility/?utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(g,b({tabSlug:"visibility_controls",tabSettings:c,hasUpdates:i,setHasUpdates:o},t))),(0,e.createElement)(a.Slot,{name:"VisibilityControlsTop"}),(0,e.createElement)(di,b({visibilityControls:c,setVisibilityControls:u,setHasUpdates:o},t)),(0,e.createElement)(pi,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(_i,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(mi,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(bi,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(yi,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(a.Slot,{name:"VisibilityControlsMiddle"}),(0,e.createElement)(Ei,b({visibilityControls:c,setVisibilityControls:u,hasUpdates:i,setHasUpdates:o},t)),(0,e.createElement)(a.Slot,{name:"VisibilityControlsBottom"}),(0,e.createElement)(Ci,b({visibilityControls:c,setVisibilityControls:u},t))),(0,e.createElement)(a.Slot,{name:"SettingsTabPanelBottom"}))}var xi=window.wp.data,Oi=window.wp.blockEditor;function Li(t){const{blockType:n,disabledBlocks:i,handleBlockTypeChange:o}=t,r=!i.includes(n.name);return(0,e.createElement)("li",{key:n.name,className:"blocks-category__block"},(0,e.createElement)(a.CheckboxControl,{checked:r,onChange:e=>function(e){o(e,n.name)}(e),label:(0,e.createElement)("span",null,n.title,n.icon&&(0,e.createElement)(Oi.BlockIcon,{icon:n.icon}))}))}function Mi(n){const{blockTypes:i,category:o,disabledBlocks:r,handleBlockCategoryChange:l,handleBlockTypeChange:s}=n;if(!i.length)return null;const c=(0,t.map)(i,"name"),u=(0,t.without)(c,...r),d=u.length===c.length;let p;p=d?"true":u.length>0?"mixed":"false";const m="block-manager__category-title-"+o.slug;return(0,e.createElement)("div",{role:"group","aria-labelledby":m,className:"block-manager__block-category"},(0,e.createElement)("div",{className:"block-category__title"},(0,e.createElement)(a.CheckboxControl,{checked:d,onChange:e=>function(e){const n=(0,t.map)(i,"name");l(e,n)}(e),"aria-checked":p,label:(0,e.createElement)("span",{id:m},o.title,o.icon&&(0,e.createElement)(Oi.BlockIcon,{icon:o.icon}))})),(0,e.createElement)("ul",{className:"block-category__blocks-list"},i.map((t=>(0,e.createElement)(Li,{key:t,blockType:t,handleBlockTypeChange:s,disabledBlocks:r})))))}var Vi=(0,xi.withSelect)((e=>{const{getCategories:t,getBlockTypes:n,hasBlockSupport:i,isMatchingSearchTerm:o}=e("core/blocks");return{blockTypes:n(),categories:t(),hasBlockSupport:i,isMatchingSearchTerm:o}}))((function(n){var i,o,l;const[s,c]=(0,e.useState)(!1),[u,p]=(0,e.useState)(""),{settings:m,setSettings:f,blockTypes:v,categories:y,hasBlockSupport:_,isMatchingSearchTerm:w}=n,k=null!==(i=null==m?void 0:m.disabled_blocks)&&void 0!==i?i:{};function E(e){f({...m,disabled_blocks:e}),c(!0)}function C(e,n){let i=[...k];i=e?(0,t.difference)(i,n):(0,t.union)(i,n),E(i),c(!0)}function S(e,n){let i=[...k];e?i=(0,t.without)(i,n):i.push(n),E(i),c(!0)}let x;x=null!==(o=null==m||null===(l=m.plugin_settings)||void 0===l?void 0:l.enable_full_control_mode)&&void 0!==o&&o?v:v.filter((e=>_(e,"inserter",!0)&&!e.parent));const O=["core/freeform"];x=x.filter((e=>!O.includes(e.name)));const L=x.filter((e=>!u||w(e,u))),M=(0,t.intersection)(k,(0,t.map)(L,"name")),V=(0,t.intersection)(k,(0,t.map)(x,"name"));let P=d.visibility,N=(0,r.__)("Visibility is enabled for all blocks","block-visibility");return V.length&&(P=d.visibilityHidden,N=(0,r.sprintf)( -/* translators: %s: The total number of visible block types */ -(0,r._n)("Visibility is disabled for %s block type","Visibility is disabled for %s block types",V.length,"block-visibility"),V.length)),(0,e.createElement)("div",{className:"setting-tabs__block-manager inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,r.__)("Block Manager","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("Not every block type may need visibility controls. The Block Manager allows you to restrict visibility controls to specific block types. If you are looking for a block, and do not see it listed, you may need to enable Full Control Mode on the General Settings tab.","block-visibility"),subMessage:(0,r.__)("To learn more about the Block Manager, review the plugin documentation using the link below.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-block-manager/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(g,b({tabSlug:"disabled_blocks",tabSettings:k,hasUpdates:s,setHasUpdates:c},n))),(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)(a.TextControl,{className:"setting-controls__search-blocks",type:"search",placeholder:(0,r.__)("Search for a block","block-visibility"),value:u,onChange:e=>p(e)}),(0,e.createElement)("span",{className:"message"},(0,e.createElement)(a.Icon,{icon:P}),N)),(0,e.createElement)("div",{className:"block-manager__category-container"},y.map((n=>(0,e.createElement)(Mi,{key:n.slug,category:n,blockTypes:(0,t.filter)(L,{category:n.slug}),disabledBlocks:M,handleBlockCategoryChange:C,handleBlockTypeChange:S})))))}));function Pi(t){var n,i,o,l,s;const{pluginSettings:c,setPluginSettings:u}=t,d=null===(n=null==c?void 0:c.enable_contextual_indicators)||void 0===n||n,p=null!==(i=null==c?void 0:c.contextual_indicator_color)&&void 0!==i?i:"",m=null!==(o=null==c?void 0:c.enable_block_opacity)&&void 0!==o&&o,b=null!==(l=null==c?void 0:c.block_opacity)&&void 0!==l?l:100,g=null===(s=null==c?void 0:c.enable_toolbar_controls)||void 0===s||s,f=[{name:(0,r.__)("Black","block-visibility"),color:"#121212"},{name:(0,r.__)("Light Grey","block-visibility"),color:"#F1F1F1"},{name:(0,r.__)("Red","block-visibility"),color:"#DC3232"},{name:(0,r.__)("Orange","block-visibility"),color:"#F56E28"},{name:(0,r.__)("Yellow","block-visibility"),color:"#FFB900"},{name:(0,r.__)("Green","block-visibility"),color:"#46B450"},{name:(0,r.__)("Medium Blue","block-visibility"),color:"#00A0D2"},{name:(0,r.__)("WordPress Blue","block-visibility"),color:"#0073AA"},{name:(0,r.__)("Purple","block-visibility"),color:"#826EB4"}],v=p||"var(--wp-admin-theme-color)";let y=(0,e.createElement)("div",{className:"settings-type__color"},(0,e.createElement)("div",null,(0,e.createElement)(a.BaseControl,{id:"indicator-color",className:"settings-type__color-selected",label:(0,r.__)("Indicator color","block-visibility")},(0,e.createElement)(a.ColorIndicator,{colorValue:v})),(0,e.createElement)(a.ColorPalette,{colors:f,value:p,onChange:e=>{u({...c,contextual_indicator_color:e})}})));d||(y=(0,e.createElement)(a.Disabled,null,y));let _=(0,e.createElement)("div",{className:"settings-type__range"},(0,e.createElement)(a.RangeControl,{label:(0,r.__)("Block Opacity","block-visibility"),value:b,onChange:e=>{u({...c,block_opacity:e})},min:10,max:100,step:10}));return m||(_=(0,e.createElement)(a.Disabled,null,_)),(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Block Editor","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("Settings that impact the Block Editor, such as contextual indicators for when a block has visibility controls, as well as additional toolbar options. Click the link below for complete details.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Contextual Indicators","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable contextual indicators.","block-visibility"),checked:d,onChange:()=>{u({...c,enable_contextual_indicators:!d})}}),(0,e.createElement)(h,{message:(0,r.__)("Contextual indicators allow users to quickly tell which blocks in the Block Editor have active visibility controls.","block-visibility")})),y,(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Contextual Block Opacity","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Reduce block opacity when visibility controls are applied.","block-visibility"),checked:m,onChange:()=>{u({...c,enable_block_opacity:!m})}}),(0,e.createElement)(h,{message:(0,r.__)("Reducing block opacity, coupled with contextual indicators, can further help users quickly tell which blocks in the Block Editor have active visibility controls.","block-visibility")})),_,(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Toolbar Controls","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable block toolbar controls for visibility settings.","block-visibility"),checked:g,onChange:()=>{u({...c,enable_toolbar_controls:!g})}}),(0,e.createElement)(h,{message:(0,r.__)("Some visibility controls (currently just the Hide Block control) can be made available in the toolbar of each block. This provides a more streamlined workflow and can improve content management.","block-visibility")})),(0,e.createElement)(a.Slot,{name:"BlockEditorSettings"})))}function Ni(n){var i;const{pluginSettings:o,setPluginSettings:l}=n,s=null!==(i=null==o?void 0:o.enabled_user_roles)&&void 0!==i?i:[];return(0,e.createElement)("div",{className:"subsetting"},["editor","author","contributor"].map((n=>{const i=[...s],r=s.includes(n);if(r){const e=i.indexOf(n);e>-1&&i.splice(e,1)}else-1===i.indexOf(n)&&i.push(n);return(0,e.createElement)(a.CheckboxControl,{key:n,checked:r,label:(0,e.createElement)("span",null,(0,t.startCase)(n)+"s"),onChange:()=>{l({...o,enabled_user_roles:i})}})})),(0,e.createElement)("div",{className:"settings-panel__help"},(0,r.__)("Choose which user roles should be allowed to control visibility settings in the Block Editor. Administrators will always have permission.","block-visibility")))}function Ti(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,l=null!==(n=null==i?void 0:i.enable_user_role_restrictions)&&void 0!==n&&n;let s=(0,e.createElement)(Ni,{pluginSettings:i,setPluginSettings:o});return l||(s=(0,e.createElement)(a.Disabled,null,s)),(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("User Permissions","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Restrict block visibility controls to selected user roles.","block-visibility"),checked:l,onChange:()=>{o({...i,enable_user_role_restrictions:!l})}}),(0,e.createElement)(h,{message:(0,r.__)("By default, all users that can edit blocks in Block Editor will be able to use the visibility settings provided by Block Visibility. You can limit permissions by user role with these settings.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),s,(0,e.createElement)(a.Slot,{name:"UserPermissionSettings"})))}function Ii(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,l=null!==(n=null==i?void 0:i.enable_full_control_mode)&&void 0!==n&&n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Full Control Mode","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,e.createInterpolateElement)((0,r.__)("Enable Full Control Mode to add visibility controls to every block. Use with caution.","block-visibility"),{strong:(0,e.createElement)("strong",null),a:(0,e.createElement)(a.ExternalLink,{href:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",target:"_blank",rel:"noreferrer"})}),checked:l,onChange:()=>{o({...i,enable_full_control_mode:!l})}}),(0,e.createElement)(h,{message:(0,r.__)("By default, not all blocks are provided with visibility controls. These include child blocks and blocks that may exist in WordPress, but cannot actually be added directly to the editor. Most of the time, you will not need Full Control Mode, but it's there in case you do. Use with caution. Click the link below for complete details.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function Fi(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,l=null!==(n=null==i?void 0:i.remove_on_uninstall)&&void 0!==n&&n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Uninstall","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("Settings that impact what happens when the Block Visibility plugin is uninstalled.","block-visibility")})),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Remove all plugin settings when Block Visibility is uninstalled.","block-visibility"),checked:l,onChange:()=>{o({...i,remove_on_uninstall:!l})}}))))}const Ri=(0,a.withFilters)("blockVisibility.PluginSettings")((t=>(0,e.createElement)(e.Fragment,null)));function Ai(t){var n;const[i,o]=(0,e.useState)(!1),{settings:l,setSettings:s}=t,c=null!==(n=null==l?void 0:l.plugin_settings)&&void 0!==n?n:{};function u(e){s({...l,plugin_settings:e}),o(!0)}return(0,e.createElement)("div",{className:"settings-tab__plugin-settings inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,r.__)("General Settings","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The settings below allow you to configure general functionality of the Block Visibility plugin. To learn more about General Settings, review the plugin documentation using the link below.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(g,b({tabSlug:"plugin_settings",tabSettings:c,hasUpdates:i,setHasUpdates:o},t))),(0,e.createElement)(a.Slot,{name:"PluginSettingsTop"}),(0,e.createElement)(Pi,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(Ti,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(a.Slot,{name:"PluginSettingsMiddle"}),(0,e.createElement)(Ii,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(Fi,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(a.Slot,{name:"PluginSettingsBottom"}),(0,e.createElement)(Ri,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)))}function Bi(t){const{variables:n}=t;return null!=n&&n.is_pro?null:(0,e.createElement)("div",{className:"ads-container"},(0,e.createElement)("div",{className:"ads-container__pro"},(0,e.createElement)("span",{className:"ads-container__header"},(0,r.__)("Upgrade to Pro","block-visibility")),(0,e.createElement)("p",null,(0,r.__)("Enhance the power of Block Visibility with the Pro add-on.","block-visibility")),(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,r.__)("Location control","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("Advanced scheduling","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("Referral Source control","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("eCommerce integrations","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("Premium email support","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("No ads!","block-visibility"))),(0,e.createElement)(a.Button,{href:"https://www.blockvisibilitywp.com/pro/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",target:"__blank",isPrimary:!0},(0,r.__)("Get Block Visibility Pro","block-visibility")," →")),(0,e.createElement)("div",{className:"ads-container__support"},(0,e.createElement)("span",{className:"ads-container__header"},(0,r.__)("Need Support?","block-visibility")),(0,e.createElement)("p",null,(0,r.__)("Whether you need help or have a new feature request, please create a topic in the support forum on WordPress.org.","block-visibility"),(0,e.createElement)(a.ExternalLink,{href:"https://wordpress.org/support/plugin/block-visibility/",target:"_blank",rel:"noreferrer"},(0,r.__)("Support Forum","block-visibility"))),(0,e.createElement)("p",null,(0,r.__)("Detailed documentation is also available on the plugin website.","block-visibility"),(0,e.createElement)(a.ExternalLink,{href:"https://www.blockvisibilitywp.com/knowledge-base/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",target:"_blank"},(0,r.__)("View Knowledge Base","block-visibility")))),(0,e.createElement)("div",{className:"ads-container__reviews"},(0,e.createElement)("span",{className:"ads-container__header"},(0,r.__)("Share Your Feedback","block-visibility")),(0,e.createElement)("p",null,(0,r.__)("If you are enjoying Block Visibility and find it useful, please consider leaving a ★★★★★ review on WordPress.org. Your feedback is greatly appreciated and helps others discover the plugin.","block-visibility"),(0,e.createElement)(a.ExternalLink,{href:"https://wordpress.org/support/plugin/block-visibility/reviews/?filter=5",target:"_blank",rel:"noreferrer"},(0,r.__)("Submit a Review","block-visibility")))))}const Di=(0,a.withFilters)("blockVisibility.MainSettings")((t=>(0,e.createElement)(e.Fragment,null)));function zi(){const[n,i]=(0,e.useState)("idle"),[l,c]=(0,e.useState)(null),[u,d]=(0,e.useState)(null);function b(e){c(e)}if((0,e.useEffect)((()=>{async function e(e,t){i("fetching");const n=`${blockVisibilityRestUrl}block-visibility/v1/${e}`,o=await fetch(n,{method:"GET"});o.ok?(t(await o.json()),i("fetched")):i("error")}e("settings",c),e("variables?type=simplified",d)}),[]),!l||!u||"fetched"!==n)return(0,e.createElement)(e.Fragment,null,"error"===n&&(0,e.createElement)("div",{className:"notice notice-error"},(0,e.createElement)("p",null,(0,r.__)("Something went wrong when trying to load the Block Visibility settings. Try refreshing the page. If the error persists, please contact support.","block-visibility"))),(0,e.createElement)("div",{className:"loading-settings"},(0,e.createElement)(a.Spinner,null),(0,e.createElement)("span",{className:"description"},(0,r.__)("Loading settings…","block-visibility"))));const g=[{name:"plugin-settings",title:(0,r.__)("General Settings","block-visibility"),className:"setting-tabs__plugin-settings"},{name:"visibility-controls",title:(0,r.__)("Visibility Controls","block-visibility"),className:"setting-tabs__visibility-controls"},{name:"block-manager",title:(0,r.__)("Block Manager","block-visibility"),className:"setting-tabs__blocks-manager"}];(0,s.applyFilters)("blockVisibility.SettingTabs",g);const f=new URLSearchParams(window.location.search),v=f.get("tab"),h=(0,t.findKey)(g,["name",v])?v:"plugin-settings";return(0,e.createElement)(a.SlotFillProvider,null,(0,e.createElement)(Di,null),(0,e.createElement)(p,{variables:u}),(0,e.createElement)(a.TabPanel,{className:o()({"setting-tabs":!0,is_pro:null==u?void 0:u.is_pro}),activeClass:"active-tab",initialTabName:h,tabs:g,onSelect:e=>(e=>{if(f.set("tab",e),history.pushState){const e=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+f.toString()+window.location.hash;window.history.replaceState({path:e},"",e)}else window.location.search=f.toString()})(e)},(t=>{switch(t.name){case"visibility-controls":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Bi,{variables:u}),(0,e.createElement)(Si,{settings:l,setSettings:b,variables:u}));case"block-manager":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Bi,{variables:u}),(0,e.createElement)(Vi,{settings:l,setSettings:b,variables:u}));case"plugin-settings":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Bi,{variables:u}),(0,e.createElement)(Ai,{settings:l,setSettings:b,variables:u}));default:return(0,e.createElement)(a.Slot,{name:"SettingsTabs"})}})),(0,e.createElement)(m,{variables:u}))}wp.domReady((()=>{(0,l.registerCoreBlocks)(),(0,e.render)((0,e.createElement)(zi,null),document.getElementById("block-visibility-settings-container"))}))}()}(); \ No newline at end of file +!function(){var e={184:function(e,t){var n;!function(){"use strict";var i={}.hasOwnProperty;function o(){for(var e=[],t=0;t{var n;const i=null!==(n=u[t].rel)&&void 0!==n?n:"noreferrer";return(0,e.createElement)("a",{key:t,href:u[t].url,className:"plugin-links__"+t,target:"_blank",rel:i},(0,e.createElement)(c,{icon:d[u[t].icon]}),(0,e.createElement)("span",null,u[t].title))}));return(0,e.createElement)("div",{className:"masthead"},(0,e.createElement)("div",{className:"inner-container"},(0,e.createElement)("div",{className:"masthead__branding"},(0,e.createElement)("h1",null,d.logo,(0,e.createElement)("span",null,(0,r.__)("Block Visibility","block-visibility")),l&&(0,e.createElement)("span",{className:"pro-badge"},"Pro"))),(0,e.createElement)("div",{className:"masthead__plugin-links"},p)))}function m(t){var n;const{variables:i}=t,o=null!==(n=null==i?void 0:i.plugin_variables)&&void 0!==n?n:[],l={plugin:{title:(0,r.__)("Block Visibility","block-visibility")+" "+o.version,url:"https://www.blockvisibilitywp.com/?utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",rel:"external"},docs:{title:(0,r.__)("Knowledge Base","block-visibility"),url:"https://www.blockvisibilitywp.com/knowledge-base/?bv_query=knowledge_base&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",rel:"external"},support:{title:(0,r.__)("Support","block-visibility"),url:o.support_url},repo:{title:(0,r.__)("GitHub","block-visibility"),url:"https://github.com/ndiego/block-visibility"},twitter:{title:(0,r.__)("Twitter","block-visibility"),url:"https://twitter.com/BlockVisibility"}};(0,s.applyFilters)("blockVisibility.FooterLinks",l);const a=Object.keys(l).map((t=>{var n;const i=null!==(n=l[t].rel)&&void 0!==n?n:"noreferrer";return(0,e.createElement)("a",{key:t,href:l[t].url,className:"footer-links__"+t,target:"_blank",rel:i},l[t].title)}));return(0,e.createElement)("div",{className:"footer"},(0,e.createElement)("div",{className:"inner-container"},a))}function b(){return b=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"save",n="";"reset"===e?(l("resetting"),n={reset:f}):"resetAll"===e?(l("resetting"),n={reset:"all"}):(l("saving"),n=(0,t.assign)({...p},{[f]:v}));const i=`${blockVisibilityRestUrl}block-visibility/v1/settings`,o=await fetch(i,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json","X-WP-Nonce":wpApiSettings.nonce}});if(o.ok){const t=await o.json();m(t),"reset"===e||"resetAll"===e?(l("reset"),u(!1)):(l("saved"),g(!1))}else l("error")}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-controls__save-settings"},["saving"===i&&(0,e.createElement)(a.Animate,{type:"loading"},(t=>{let{className:n}=t;return(0,e.createElement)("span",{className:o()("message",n)},(0,e.createElement)(c,{icon:d.cloud}),(0,r.__)("Saving","block-visibility"))})),"error"===i&&(0,e.createElement)("span",{className:"message update-failed"},(0,r.__)("Update failed. Try again or contact support.","block-visibility"))],"saving"!==i&&(0,e.createElement)(a.Button,{className:"reset-settings__save-button",onClick:()=>u(!0),isTertiary:!0},(0,r.__)("Reset Settings","block-visibility")),(0,e.createElement)(a.Button,{className:o()("save-settings__save-button",{"is-busy":"saving"===i}),onClick:()=>y(),disabled:!b&&"error"!==i,isPrimary:!0},h)),s&&(0,e.createElement)(a.Modal,{className:"block-visibility__reset-modal",title:(0,r.__)("Reset Settings","block-visibility"),onRequestClose:()=>u(!1)},(0,e.createElement)("p",null,(0,r.__)("Resetting will restore all configured settings on the current tab to their default values. To restore all plugin settings, choose Reset All.","block-visibility")),(0,e.createElement)("div",{className:"block-visibility__reset-modal--buttons"},(0,e.createElement)("div",{className:"block-visibility__reset-modal--buttons-reset"},(0,e.createElement)(a.Button,{isPrimary:!0,onClick:()=>y("reset")},(0,r.__)("Reset","block-visibility")),(0,e.createElement)(a.Button,{isSecondary:!0,onClick:()=>y("resetAll")},(0,r.__)("Reset All","block-visibility")),"resetting"===i&&(0,e.createElement)(a.Spinner,null)),(0,e.createElement)(a.Button,{isTertiary:!0,onClick:()=>u(!1)},(0,r.__)("Cancel","block-visibility"))),"error"===i&&(0,e.createElement)("div",{className:"message update-failed"},(0,r.__)("Reset failed. Try again or contact support.","block-visibility"))))}var f=window.wp.primitives,v=(0,e.createElement)(f.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(f.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function h(t){const{message:n,subMessage:i,link:o,position:l}=t,s=null!=l?l:"middle left";return(0,e.createElement)("div",{className:"information-popover"},(0,e.createElement)(a.DropdownMenu,{label:(0,r.__)("More Information","block-visibility"),icon:v,toggleProps:{className:"information-popover__button"},popoverProps:{className:"information-popover__popover",focusOnMount:"container",position:s,noArrow:!1}},(()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,n),i&&(0,e.createElement)("p",null,i),o&&(0,e.createElement)(a.ExternalLink,{href:o},(0,r.__)("Learn More","block-visibility"))))))}var y=window.React,_=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?O(A,--F):0,T--,10===R&&(T=1,N--),R}function H(){return R=F2||G(R)>3?"":" "}function K(e,t){for(;--t&&H()&&!(R<48||R>102||R>57&&R<65||R>70&&R<97););return j(e,U()+(t<6&&32==$()&&32==H()))}function X(e){for(;H();)switch(R){case e:return F;case 34:case 39:34!==e&&39!==e&&X(R);break;case 40:41===e&&X(e);break;case 92:H()}return F}function Q(e,t){for(;H()&&e+R!==57&&(e+R!==84||47!==$()););return"/*"+j(t,F-1)+"*"+k(47===e?e:H())}function J(e){for(;!G($());)H();return j(e,F)}var ee="-ms-",te="-moz-",ne="-webkit-",ie="comm",oe="rule",re="decl",le="@keyframes";function ae(e,t){for(var n="",i=V(e),o=0;o6)switch(O(e,t+1)){case 109:if(45!==O(e,t+4))break;case 102:return S(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+te+(108==O(e,t+3)?"$3":"$2-$3"))+e;case 115:return~x(e,"stretch")?ce(S(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==O(e,t+1))break;case 6444:switch(O(e,M(e)-3-(~x(e,"!important")&&10))){case 107:return S(e,":",":"+ne)+e;case 101:return S(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ne+(45===O(e,14)?"inline-":"")+"box$3$1"+ne+"$2$3$1"+ee+"$2box$3")+e}break;case 5936:switch(O(e,t+11)){case 114:return ne+e+ee+S(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ne+e+ee+S(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ne+e+ee+S(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ne+e+ee+e+e}return e}function ue(e){return q(de("",null,null,null,[""],e=Z(e),0,[0],e))}function de(e,t,n,i,o,r,l,a,s){for(var c=0,u=0,d=l,p=0,m=0,b=0,g=1,f=1,v=1,h=0,y="",_=o,w=r,E=i,C=y;f;)switch(b=h,h=H()){case 40:if(108!=b&&58==C.charCodeAt(d-1)){-1!=x(C+=S(W(h),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:C+=W(h);break;case 9:case 10:case 13:case 32:C+=Y(b);break;case 92:C+=K(U()-1,7);continue;case 47:switch($()){case 42:case 47:P(me(Q(H(),U()),t,n),s);break;default:C+="/"}break;case 123*g:a[c++]=M(C)*v;case 125*g:case 59:case 0:switch(h){case 0:case 125:f=0;case 59+u:m>0&&M(C)-d&&P(m>32?be(C+";",i,n,d-1):be(S(C," ","")+";",i,n,d-2),s);break;case 59:C+=";";default:if(P(E=pe(C,t,n,c,u,o,a,y,_=[],w=[],d),r),123===h)if(0===u)de(C,t,E,E,_,r,d,a,w);else switch(p){case 100:case 109:case 115:de(e,E,E,i&&P(pe(e,E,E,0,0,o,a,y,o,_=[],d),w),o,w,d,a,i?_:w);break;default:de(C,E,E,E,[""],w,0,a,w)}}c=u=m=0,g=v=1,y=C="",d=l;break;case 58:d=1+M(C),m=b;default:if(g<1)if(123==h)--g;else if(125==h&&0==g++&&125==z())continue;switch(C+=k(h),h*g){case 38:v=u>0?1:(C+="\f",-1);break;case 44:a[c++]=(M(C)-1)*v,v=1;break;case 64:45===$()&&(C+=W(H())),p=$(),u=d=M(y=C+=J(U())),h++;break;case 45:45===b&&2==M(C)&&(g=0)}}return r}function pe(e,t,n,i,o,r,l,a,s,c,u){for(var d=o-1,p=0===o?r:[""],m=V(p),b=0,g=0,f=0;b0?p[v]+" "+h:S(h,/&\f/g,p[v])))&&(s[f++]=y);return D(e,t,n,0===o?oe:a,s,c,u)}function me(e,t,n){return D(e,t,n,ie,k(R),L(e,2,-2),0)}function be(e,t,n,i){return D(e,t,n,re,L(e,0,i),L(e,i+1,-1),i)}var ge=function(e,t,n){for(var i=0,o=0;i=o,o=$(),38===i&&12===o&&(t[n]=1),!G(o);)H();return j(e,F)},fe=new WeakMap,ve=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||fe.get(n))&&!i){fe.set(e,!0);for(var o=[],r=function(e,t){return q(function(e,t){var n=-1,i=44;do{switch(G(i)){case 0:38===i&&12===$()&&(t[n]=1),e[n]+=ge(F-1,t,n);break;case 2:e[n]+=W(i);break;case 4:if(44===i){e[++n]=58===$()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=k(i)}}while(i=H());return e}(Z(e),t))}(t,o),l=n.props,a=0,s=0;a-1&&!e.return)switch(e.type){case re:e.return=ce(e.value,e.length);break;case le:return ae([B(e,{value:S(e.value,"@","@"+ne)})],i);case oe:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return ae([B(e,{props:[S(t,/:(read-\w+)/,":-moz-$1")]})],i);case"::placeholder":return ae([B(e,{props:[S(t,/:(plac\w+)/,":-webkit-input-$1")]}),B(e,{props:[S(t,/:(plac\w+)/,":-moz-$1")]}),B(e,{props:[S(t,/:(plac\w+)/,ee+"input-$1")]})],i)}return""}))}}],_e=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,o,r=e.stylisPlugins||ye,l={},a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++i,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},Se={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},xe=/[A-Z]|^ms/g,Oe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Le=function(e){return 45===e.charCodeAt(1)},Me=function(e){return null!=e&&"boolean"!=typeof e},Ve=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=Le(n=e)?n:n.replace(xe,"-$&").toLowerCase()),t[e];var n}}(),Pe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Oe,(function(e,t,n){return Te={name:t,styles:n,next:Te},t}))}return 1===Se[e]||Le(e)||"number"!=typeof t||0===t?t:t+"px"};function Ne(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Te={name:n.name,styles:n.styles,next:Te},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)Te={name:i.name,styles:i.styles,next:Te},i=i.next;return n.styles+";"}return function(e,t,n){var i="";if(Array.isArray(n))for(var o=0;o=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.brand+"/"+e.version)).join(" "):navigator.userAgent}())}["top","right","bottom","left"].reduce(((e,t)=>e.concat(t,t+"-start",t+"-end")),[]),Math.min,Math.max;const vt=Math.round;function ht(e,t,n){var i,o,r,l;void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect();let s=1,c=1;t&&mt(e)&&(s=e.offsetWidth>0&&vt(a.width)/e.offsetWidth||1,c=e.offsetHeight>0&&vt(a.height)/e.offsetHeight||1);const u=bt(e)?dt(e):window,d=!ft()&&n,p=(a.left+(d&&null!=(i=null==(o=u.visualViewport)?void 0:o.offsetLeft)?i:0))/s,m=(a.top+(d&&null!=(r=null==(l=u.visualViewport)?void 0:l.offsetTop)?r:0))/c,b=a.width/s,g=a.height/c;return{width:b,height:g,top:m,right:p+b,bottom:m+g,left:p,x:p,y:m}}function yt(e){return"html"===pt(e)?e:e.assignedSlot||e.parentNode||(function(e){return"undefined"!=typeof ShadowRoot&&(e instanceof dt(e).ShadowRoot||e instanceof ShadowRoot)}(e)?e.host:null)||function(e){return(t=e,(t instanceof dt(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}(e)}function _t(e){const t=yt(e);return function(e){return["html","body","#document"].includes(pt(e))}(t)?e.ownerDocument.body:mt(t)&>(t)?t:_t(t)}function wt(e,t){var n;void 0===t&&(t=[]);const i=_t(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),r=dt(i),l=o?[r].concat(r.visualViewport||[],gt(i)?i:[]):i,a=t.concat(l);return o?a:a.concat(wt(l))}var kt=y.useLayoutEffect;function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function St(e){for(var t=1;t-1}function Rt(e){return Ft(e)?window.pageYOffset:e.scrollTop}function At(e,t){Ft(e)?window.scrollTo(0,t):e.scrollTop=t}function Dt(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Bt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Vt,o=Rt(e),r=t-o,l=10,a=0;function s(){var t=Dt(a+=l,o,r,n);At(e,t),a=b)return{placement:"bottom",maxHeight:t};if(C>=b&&!l)return r&&Bt(s,S,O),{placement:"bottom",maxHeight:t};if(!l&&C>=i||l&&k>=i)return r&&Bt(s,S,O),{placement:"bottom",maxHeight:l?k-y:C-y};if("auto"===o||l){var L=t,M=l?w:E;return M>=i&&(L=Math.min(M-y-a.controlHeight,t)),{placement:"top",maxHeight:L}}if("bottom"===o)return r&&At(s,S),{placement:"bottom",maxHeight:t};break;case"top":if(w>=b)return{placement:"top",maxHeight:t};if(E>=b&&!l)return r&&Bt(s,x,O),{placement:"top",maxHeight:t};if(!l&&E>=i||l&&w>=i){var V=t;return(!l&&E>=i||l&&w>=i)&&(V=l?w-_:E-_),r&&Bt(s,x,O),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}var Wt=function(e){return"auto"===e?"bottom":e},Yt=(0,y.createContext)({getPortalPlacement:null}),Kt=function(e){at(n,e);var t=Lt(n);function n(){var e;it(this,n);for(var i=arguments.length,o=new Array(i),r=0;r{s&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n)}));let u,d=null;if(l){let i=!0;d=new ResizeObserver((()=>{i||n(),i=!1})),bt(e)&&!a&&d.observe(e),d.observe(t)}let p=a?ht(e):null;return a&&function t(){const i=ht(e);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n(),p=i,u=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{s&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(u)}}(o,u.current,w,{elementResize:"ResizeObserver"in window}))}),[o,w]);kt((function(){k()}),[k]);var E=(0,y.useCallback)((function(e){u.current=e,k()}),[k]);if(!t&&"fixed"!==s||!v)return null;var C=Ze("div",b({ref:E,css:c("menuPortal",{offset:v.offset,position:s,rect:v.rect}),className:r({"menu-portal":!0},i)},l),n);return Ze(Yt.Provider,{value:{getPortalPlacement:_}},t?(0,ct.createPortal)(C,t):C)},LoadingMessage:tn,NoOptionsMessage:en,MultiValue:function(e){var t=e.children,n=e.className,i=e.components,o=e.cx,r=e.data,l=e.getStyles,a=e.innerProps,s=e.isDisabled,c=e.removeProps,u=e.selectProps,d=i.Container,p=i.Label,m=i.Remove;return Ze(Xe,null,(function(i){var b=i.css,g=i.cx;return Ze(d,{data:r,innerProps:St({className:g(b(l("multiValue",e)),o({"multi-value":!0,"multi-value--is-disabled":s},n))},a),selectProps:u},Ze(p,{data:r,innerProps:{className:g(b(l("multiValueLabel",e)),o({"multi-value__label":!0},n))},selectProps:u},t),Ze(m,{data:r,innerProps:St({className:g(b(l("multiValueRemove",e)),o({"multi-value__remove":!0},n)),"aria-label":"Remove ".concat(t||"option")},c),selectProps:u}))}))},MultiValueContainer:En,MultiValueLabel:En,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({role:"button"},n),t||Ze(cn,{size:14}))},Option:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.isDisabled,l=e.isFocused,a=e.isSelected,s=e.innerRef,c=e.innerProps;return Ze("div",b({css:o("option",e),className:i({option:!0,"option--is-disabled":r,"option--is-focused":l,"option--is-selected":a},n),ref:s,"aria-disabled":r},c),t)},Placeholder:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps;return Ze("div",b({css:o("placeholder",e),className:i({placeholder:!0},n)},r),t)},SelectContainer:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.innerProps,l=e.isDisabled,a=e.isRtl;return Ze("div",b({css:o("container",e),className:i({"--is-disabled":l,"--is-rtl":a},n)},r),t)},SingleValue:function(e){var t=e.children,n=e.className,i=e.cx,o=e.getStyles,r=e.isDisabled,l=e.innerProps;return Ze("div",b({css:o("singleValue",e),className:i({"single-value":!0,"single-value--is-disabled":r},n)},l),t)},ValueContainer:function(e){var t=e.children,n=e.className,i=e.cx,o=e.innerProps,r=e.isMulti,l=e.getStyles,a=e.hasValue;return Ze("div",b({css:l("valueContainer",e),className:i({"value-container":!0,"value-container--is-multi":r,"value-container--has-value":a},n)},o),t)}},Sn=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function xn(e){return function(e){if(Array.isArray(e))return Je(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||et(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var On=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ln(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(i,r?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,i=e.options,o=e.label,r=void 0===o?"":o,l=e.selectValue,a=e.isDisabled,s=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&l)return"value ".concat(r," focused, ").concat(c(l,n),".");if("menu"===t){var u=a?" disabled":"",d="".concat(s?"selected":"focused").concat(u);return"option ".concat(r," ").concat(d,", ").concat(c(i,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Nn=function(e){var t=e.ariaSelection,n=e.focusedOption,i=e.focusedValue,o=e.focusableOptions,r=e.isFocused,l=e.selectValue,a=e.selectProps,s=e.id,c=a.ariaLiveMessages,u=a.getOptionLabel,d=a.inputValue,p=a.isMulti,m=a.isOptionDisabled,b=a.isSearchable,g=a.menuIsOpen,f=a.options,v=a.screenReaderStatus,h=a.tabSelectsValue,_=a["aria-label"],w=a["aria-live"],k=(0,y.useMemo)((function(){return St(St({},Pn),c||{})}),[c]),E=(0,y.useMemo)((function(){var e,n="";if(t&&k.onChange){var i=t.option,o=t.options,r=t.removedValue,a=t.removedValues,s=t.value,c=r||i||(e=s,Array.isArray(e)?null:e),d=c?u(c):"",p=o||a||void 0,b=p?p.map(u):[],g=St({isDisabled:c&&m(c,l),label:d,labels:b},t);n=k.onChange(g)}return n}),[t,k,m,l,u]),C=(0,y.useMemo)((function(){var e="",t=n||i,o=!!(n&&l&&l.includes(n));if(t&&k.onFocus){var r={focused:t,label:u(t),isDisabled:m(t,l),isSelected:o,options:f,context:t===n?"menu":"value",selectValue:l};e=k.onFocus(r)}return e}),[n,i,u,m,k,f,l]),S=(0,y.useMemo)((function(){var e="";if(g&&f.length&&k.onFilter){var t=v({count:o.length});e=k.onFilter({inputValue:d,resultsMessage:t})}return e}),[o,d,g,k,f,v]),x=(0,y.useMemo)((function(){var e="";if(k.guidance){var t=i?"value":g?"menu":"input";e=k.guidance({"aria-label":_,context:t,isDisabled:n&&m(n,l),isMulti:p,isSearchable:b,tabSelectsValue:h})}return e}),[_,n,i,p,m,b,g,k,l,h]),O="".concat(C," ").concat(S," ").concat(x),L=Ze(y.Fragment,null,Ze("span",{id:"aria-selection"},E),Ze("span",{id:"aria-context"},O)),M="initial-input-focus"===(null==t?void 0:t.action);return Ze(y.Fragment,null,Ze(Vn,{id:s},M&&L),Ze(Vn,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text"},r&&!M&&L))},Tn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],In=new RegExp("["+Tn.map((function(e){return e.letters})).join("")+"]","g"),Fn={},Rn=0;Rn1?t-1:0),i=1;i0,g=d-p-u,f=!1;g>t&&l.current&&(i&&i(e),l.current=!1),b&&a.current&&(r&&r(e),a.current=!1),b&&t>g?(n&&!l.current&&n(e),m.scrollTop=d,f=!0,l.current=!0):!b&&-t>u&&(o&&!a.current&&o(e),m.scrollTop=0,f=!0,a.current=!0),f&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,i,o,r]),d=(0,y.useCallback)((function(e){u(e,e.deltaY)}),[u]),p=(0,y.useCallback)((function(e){s.current=e.changedTouches[0].clientY}),[]),m=(0,y.useCallback)((function(e){var t=s.current-e.changedTouches[0].clientY;u(e,t)}),[u]),b=(0,y.useCallback)((function(e){if(e){var t=!!jt&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",m,t)}}),[m,p,d]),g=(0,y.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",m,!1))}),[m,p,d]);return(0,y.useEffect)((function(){if(t){var e=c.current;return b(e),function(){g(e)}}}),[t,b,g]),function(e){c.current=e}}({isEnabled:void 0===i||i,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),r=function(e){var t=e.isEnabled,n=e.accountForScrollbars,i=void 0===n||n,o=(0,y.useRef)({}),r=(0,y.useRef)(null),l=(0,y.useCallback)((function(e){if(Xn){var t=document.body,n=t&&t.style;if(i&&Gn.forEach((function(e){var t=n&&n[e];o.current[e]=t})),i&&Qn<1){var r=parseInt(o.current.paddingRight,10)||0,l=document.body?document.body.clientWidth:0,a=window.innerWidth-l+r||0;Object.keys(Zn).forEach((function(e){var t=Zn[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(a,"px"))}t&&Kn()&&(t.addEventListener("touchmove",qn,Jn),e&&(e.addEventListener("touchstart",Yn,Jn),e.addEventListener("touchmove",Wn,Jn))),Qn+=1}}),[i]),a=(0,y.useCallback)((function(e){if(Xn){var t=document.body,n=t&&t.style;Qn=Math.max(Qn-1,0),i&&Qn<1&&Gn.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&Kn()&&(t.removeEventListener("touchmove",qn,Jn),e&&(e.removeEventListener("touchstart",Yn,Jn),e.removeEventListener("touchmove",Wn,Jn)))}}),[i]);return(0,y.useEffect)((function(){if(t){var e=r.current;return l(e),function(){a(e)}}}),[t,l,a]),function(e){r.current=e}}({isEnabled:n});return Ze(y.Fragment,null,n&&Ze("div",{onClick:ei,css:ti}),t((function(e){o(e),r(e)})))}var ii={clearIndicator:mn,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,i=e.theme,o=i.colors,r=i.borderRadius,l=i.spacing;return{label:"control",alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(o.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:pn,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing.baseUnit,o=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*i,marginTop:2*i,width:1}},input:function(e){var t=e.isDisabled,n=e.value,i=e.theme,o=i.spacing,r=i.colors;return St({margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,visibility:t?"hidden":"visible",color:r.neutral80,transform:n?"translateZ(0)":""},wn)},loadingIndicator:function(e){var t=e.isFocused,n=e.size,i=e.theme,o=i.colors,r=i.spacing.baseUnit;return{label:"loadingIndicator",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*r,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:Jt,menu:function(e){var t,n=e.placement,i=e.theme,o=i.borderRadius,r=i.spacing,l=i.colors;return st(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),st(t,"backgroundColor",l.neutral0),st(t,"borderRadius",o),st(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),st(t,"marginBottom",r.menuGutter),st(t,"marginTop",r.menuGutter),st(t,"position","absolute"),st(t,"width","100%"),st(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,i=e.position;return{left:t.left,position:i,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:i/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,i=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:i.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,i=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:i/2,backgroundColor:e.isFocused?o.dangerLight:void 0,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:Qt,option:function(e){var t=e.isDisabled,n=e.isFocused,i=e.isSelected,o=e.theme,r=o.spacing,l=o.colors;return{label:"option",backgroundColor:i?l.primary:n?l.primary25:"transparent",color:t?l.neutral20:i?l.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:t?void 0:i?l.primary:l.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2}},singleValue:function(e){var t=e.isDisabled,n=e.theme,i=n.spacing,o=n.colors;return{label:"singleValue",color:t?o.neutral40:o.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},valueContainer:function(e){var t=e.theme.spacing,n=e.isMulti,i=e.hasValue,o=e.selectProps.controlShouldRenderValue;return{alignItems:"center",display:n&&i&&o?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},oi={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},ri={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:zt(),captureMenuScroll:!zt(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=St({ignoreCase:!0,ignoreAccents:!0,stringify:$n,trim:!0,matchFrom:"any"},undefined),i=n.ignoreCase,o=n.ignoreAccents,r=n.stringify,l=n.trim,a=n.matchFrom,s=l?Hn(t):t,c=l?Hn(r(e)):r(e);return i&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=zn(s),c=Bn(c)),"start"===a?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function li(e,t,n,i){return{type:"option",data:t,isDisabled:pi(e,t,n),isSelected:mi(e,t,n),label:ui(e,t),value:di(e,t),index:i}}function ai(e,t){return e.options.map((function(n,i){if("options"in n){var o=n.options.map((function(n,i){return li(e,n,t,i)})).filter((function(t){return ci(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:i}:void 0}var r=li(e,n,t,i);return ci(e,r)?r:void 0})).filter(Gt)}function si(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,xn(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function ci(e,t){var n=e.inputValue,i=void 0===n?"":n,o=t.data,r=t.isSelected,l=t.label,a=t.value;return(!gi(e)||!r)&&bi(e,{label:l,value:a,data:o},i)}var ui=function(e,t){return e.getOptionLabel(t)},di=function(e,t){return e.getOptionValue(t)};function pi(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function mi(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var i=di(e,t);return n.some((function(t){return di(e,t)===i}))}function bi(e,t,n){return!e.filterOption||e.filterOption(t,n)}var gi=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},fi=1,vi=function(e){at(n,e);var t=Lt(n);function n(e){var i;return it(this,n),(i=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.instancePrefix="",i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(e){i.controlRef=e},i.focusedOptionRef=null,i.getFocusedOptionRef=function(e){i.focusedOptionRef=e},i.menuListRef=null,i.getMenuListRef=function(e){i.menuListRef=e},i.inputRef=null,i.getInputRef=function(e){i.inputRef=e},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(e,t){var n=i.props,o=n.onChange,r=n.name;t.name=r,i.ariaOnChange(e,t),o(e,t)},i.setValue=function(e,t,n){var o=i.props,r=o.closeMenuOnSelect,l=o.isMulti,a=o.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:a}),r&&(i.setState({inputIsHiddenAfterUpdate:!l}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(e,{action:t,option:n})},i.selectOption=function(e){var t=i.props,n=t.blurInputOnSelect,o=t.isMulti,r=t.name,l=i.state.selectValue,a=o&&i.isOptionSelected(e,l),s=i.isOptionDisabled(e,l);if(a){var c=i.getOptionValue(e);i.setValue(l.filter((function(e){return i.getOptionValue(e)!==c})),"deselect-option",e)}else{if(s)return void i.ariaOnChange(e,{action:"select-option",option:e,name:r});o?i.setValue([].concat(xn(l),[e]),"select-option",e):i.setValue(e,"select-option")}n&&i.blurInput()},i.removeValue=function(e){var t=i.props.isMulti,n=i.state.selectValue,o=i.getOptionValue(e),r=n.filter((function(e){return i.getOptionValue(e)!==o})),l=Zt(t,r,r[0]||null);i.onChange(l,{action:"remove-value",removedValue:e}),i.focusInput()},i.clearValue=function(){var e=i.state.selectValue;i.onChange(Zt(i.props.isMulti,[],null),{action:"clear",removedValues:e})},i.popValue=function(){var e=i.props.isMulti,t=i.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),r=Zt(e,o,o[0]||null);i.onChange(r,{action:"pop-value",removedValue:n})},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n5||r>5}},i.onTouchEnd=function(e){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(e.target)&&i.menuListRef&&!i.menuListRef.contains(e.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(e){i.userIsDragging||i.onControlMouseDown(e)},i.onClearIndicatorTouchEnd=function(e){i.userIsDragging||i.onClearIndicatorMouseDown(e)},i.onDropdownIndicatorTouchEnd=function(e){i.userIsDragging||i.onDropdownIndicatorMouseDown(e)},i.handleInputChange=function(e){var t=i.props.inputValue,n=e.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(n,{action:"input-change",prevInputValue:t}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(e){i.props.onFocus&&i.props.onFocus(e),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(e){var t=i.props.inputValue;i.menuListRef&&i.menuListRef.contains(document.activeElement)?i.inputRef.focus():(i.props.onBlur&&i.props.onBlur(e),i.onInputChange("",{action:"input-blur",prevInputValue:t}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1}))},i.onOptionHover=function(e){i.blockOptionHover||i.state.focusedOption===e||i.setState({focusedOption:e})},i.shouldHideSelectedOptions=function(){return gi(i.props)},i.onKeyDown=function(e){var t=i.props,n=t.isMulti,o=t.backspaceRemovesValue,r=t.escapeClearsValue,l=t.inputValue,a=t.isClearable,s=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,m=i.state,b=m.focusedOption,g=m.focusedValue,f=m.selectValue;if(!(s||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(i.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||l)return;i.focusValue("previous");break;case"ArrowRight":if(!n||l)return;i.focusValue("next");break;case"Delete":case"Backspace":if(l)return;if(g)i.removeValue(g);else{if(!o)return;n?i.popValue():a&&i.clearValue()}break;case"Tab":if(i.isComposing)return;if(e.shiftKey||!c||!d||!b||p&&i.isOptionSelected(b,f))return;i.selectOption(b);break;case"Enter":if(229===e.keyCode)break;if(c){if(!b)return;if(i.isComposing)return;i.selectOption(b);break}return;case"Escape":c?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:l}),i.onMenuClose()):a&&r&&i.clearValue();break;case" ":if(l)return;if(!c){i.openMenu("first");break}if(!b)return;i.selectOption(b);break;case"ArrowUp":c?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":c?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!c)return;i.focusOption("pageup");break;case"PageDown":if(!c)return;i.focusOption("pagedown");break;case"Home":if(!c)return;i.focusOption("first");break;case"End":if(!c)return;i.focusOption("last");break;default:return}e.preventDefault()}},i.instancePrefix="react-select-"+(i.props.instanceId||++fi),i.state.selectValue=Tt(e.value),i}return rt(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,i,o,r,l=this.props,a=l.isDisabled,s=l.menuIsOpen,c=this.state.isFocused;(c&&!a&&e.isDisabled||c&&s&&!e.menuIsOpen)&&this.focusInput(),c&&a&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,i=t.getBoundingClientRect(),o=n.getBoundingClientRect(),r=n.offsetHeight/3,o.bottom+r>i.bottom?At(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+r,t.scrollHeight)):o.top-r-1&&(l=a)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:r[l]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,i=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(i);i||(o=-1);var r=n.length-1,l=-1;if(n.length){switch(e){case"previous":l=0===o?0:-1===o?r:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,i=this.getFocusableOptions();if(i.length){var o=0,r=i.indexOf(n);n||(r=-1),"up"===e?o=r>0?r-1:i.length-1:"down"===e?o=(r+1)%i.length:"pageup"===e?(o=r-t)<0&&(o=0):"pagedown"===e?(o=r+t)>i.length-1&&(o=i.length-1):"last"===e&&(o=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(oi):St(St({},oi),this.props.theme):oi}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,i=this.getValue,o=this.selectOption,r=this.setValue,l=this.props,a=l.isMulti,s=l.isRtl,c=l.options;return{clearValue:e,cx:t,getStyles:n,getValue:i,hasValue:this.hasValue(),isMulti:a,isRtl:s,options:c,selectOption:o,selectProps:l,setValue:r,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return pi(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return mi(this.props,e,t)}},{key:"filterOption",value:function(e,t){return bi(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:i})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,i=e.inputId,o=e.inputValue,r=e.tabIndex,l=e.form,a=e.menuIsOpen,s=this.getComponents().Input,c=this.state,u=c.inputIsHidden,d=c.ariaSelection,p=this.commonProps,m=i||this.getElementId("input"),g=St(St(St({"aria-autocomplete":"list","aria-expanded":a,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},a&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==d?void 0:d.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?y.createElement(s,b({},p,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:u,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:l,type:"text",value:o},g)):y.createElement(jn,b({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Vt,onFocus:this.onInputFocus,disabled:t,tabIndex:r,inputMode:"none",form:l,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,i=t.MultiValueContainer,o=t.MultiValueLabel,r=t.MultiValueRemove,l=t.SingleValue,a=t.Placeholder,s=this.commonProps,c=this.props,u=c.controlShouldRenderValue,d=c.isDisabled,p=c.isMulti,m=c.inputValue,g=c.placeholder,f=this.state,v=f.selectValue,h=f.focusedValue,_=f.isFocused;if(!this.hasValue()||!u)return m?null:y.createElement(a,b({},s,{key:"placeholder",isDisabled:d,isFocused:_,innerProps:{id:this.getElementId("placeholder")}}),g);if(p)return v.map((function(t,l){var a=t===h,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return y.createElement(n,b({},s,{components:{Container:i,Label:o,Remove:r},isFocused:a,isDisabled:d,key:c,index:l,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(m)return null;var w=v[0];return y.createElement(l,b({},s,{data:w,isDisabled:d}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,r=this.state.isFocused;if(!this.isClearable()||!e||i||!this.hasValue()||o)return null;var l={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return y.createElement(e,b({},t,{innerProps:l,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,i=n.isDisabled,o=n.isLoading,r=this.state.isFocused;return e&&o?y.createElement(e,b({},t,{innerProps:{"aria-hidden":"true"},isDisabled:i,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var i=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return y.createElement(n,b({},i,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return y.createElement(e,b({},t,{innerProps:o,isDisabled:n,isFocused:i}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,i=t.GroupHeading,o=t.Menu,r=t.MenuList,l=t.MenuPortal,a=t.LoadingMessage,s=t.NoOptionsMessage,c=t.Option,u=this.commonProps,d=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,g=p.inputValue,f=p.isLoading,v=p.loadingMessage,h=p.minMenuHeight,_=p.maxMenuHeight,w=p.menuIsOpen,k=p.menuPlacement,E=p.menuPosition,C=p.menuPortalTarget,S=p.menuShouldBlockScroll,x=p.menuShouldScrollIntoView,O=p.noOptionsMessage,L=p.onMenuScrollToTop,M=p.onMenuScrollToBottom;if(!w)return null;var V,P=function(t,n){var i=t.type,o=t.data,r=t.isDisabled,l=t.isSelected,a=t.label,s=t.value,p=d===o,m=r?void 0:function(){return e.onOptionHover(o)},g=r?void 0:function(){return e.selectOption(o)},f="".concat(e.getElementId("option"),"-").concat(n),v={id:f,onClick:g,onMouseMove:m,onMouseOver:m,tabIndex:-1};return y.createElement(c,b({},u,{innerProps:v,data:o,isDisabled:r,isSelected:l,key:f,label:a,type:i,value:s,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())V=this.getCategorizedOptions().map((function(t){if("group"===t.type){var o=t.data,r=t.options,l=t.index,a="".concat(e.getElementId("group"),"-").concat(l),s="".concat(a,"-heading");return y.createElement(n,b({},u,{key:a,data:o,options:r,Heading:i,headingProps:{id:s,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return P(e,"".concat(l,"-").concat(e.index))})))}if("option"===t.type)return P(t,"".concat(t.index))}));else if(f){var N=v({inputValue:g});if(null===N)return null;V=y.createElement(a,u,N)}else{var T=O({inputValue:g});if(null===T)return null;V=y.createElement(s,u,T)}var I={minMenuHeight:h,maxMenuHeight:_,menuPlacement:k,menuPosition:E,menuShouldScrollIntoView:x},F=y.createElement(Kt,b({},u,I),(function(t){var n=t.ref,i=t.placerProps,l=i.placement,a=i.maxHeight;return y.createElement(o,b({},u,I,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:f,placement:l}),y.createElement(ni,{captureEnabled:m,onTopArrive:L,onBottomArrive:M,lockEnabled:S},(function(t){return y.createElement(r,b({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:f,maxHeight:a,focusedOption:d}),V)})))}));return C||"fixed"===E?y.createElement(l,b({},u,{appendTo:C,controlElement:this.controlRef,menuPlacement:k,menuPosition:E}),F):F}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,i=t.isDisabled,o=t.isMulti,r=t.name,l=this.state.selectValue;if(r&&!i){if(o){if(n){var a=l.map((function(t){return e.getOptionValue(t)})).join(n);return y.createElement("input",{name:r,type:"hidden",value:a})}var s=l.length>0?l.map((function(t,n){return y.createElement("input",{key:"i-".concat(n),name:r,type:"hidden",value:e.getOptionValue(t)})})):y.createElement("input",{name:r,type:"hidden"});return y.createElement("div",null,s)}var c=l[0]?this.getOptionValue(l[0]):"";return y.createElement("input",{name:r,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,i=t.focusedOption,o=t.focusedValue,r=t.isFocused,l=t.selectValue,a=this.getFocusableOptions();return y.createElement(Nn,b({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:i,focusedValue:o,isFocused:r,selectValue:l,focusableOptions:a}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,i=e.SelectContainer,o=e.ValueContainer,r=this.props,l=r.className,a=r.id,s=r.isDisabled,c=r.menuIsOpen,u=this.state.isFocused,d=this.commonProps=this.getCommonProps();return y.createElement(i,b({},d,{className:l,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:u}),this.renderLiveRegion(),y.createElement(t,b({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:u,menuIsOpen:c}),y.createElement(o,b({},d,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),y.createElement(n,b({},d,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,i=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,r=t.ariaSelection,l=t.isFocused,a=t.prevWasFocused,s=e.options,c=e.value,u=e.menuIsOpen,d=e.inputValue,p=e.isMulti,m=Tt(c),b={};if(n&&(c!==n.value||s!==n.options||u!==n.menuIsOpen||d!==n.inputValue)){var g=u?function(e,t){return si(ai(e,t))}(e,m):[],f=i?function(e,t){var n=e.focusedValue,i=e.selectValue.indexOf(n);if(i>-1){if(t.indexOf(n)>-1)return n;if(i-1?n:t[0]}(t,g);b={selectValue:m,focusedOption:v,focusedValue:f,clearFocusValueOnUpdate:!1}}var h=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},y=r,_=l&&a;return l&&!_&&(y={value:Zt(p,m,m[0]||null),options:m,action:"initial-input-focus"},_=!a),"initial-input-focus"===(null==r?void 0:r.action)&&(y=null),St(St(St({},b),h),{},{prevProps:e,ariaSelection:y,prevWasFocused:_})}}]),n}(y.Component);vi.defaultProps=ri;var hi=(0,y.forwardRef)((function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,i=e.defaultMenuIsOpen,o=void 0!==i&&i,r=e.defaultValue,l=void 0===r?null:r,a=e.inputValue,s=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,m=e.value,b=Qe(e,Sn),g=tt((0,y.useState)(void 0!==a?a:n),2),f=g[0],v=g[1],h=tt((0,y.useState)(void 0!==s?s:o),2),_=h[0],w=h[1],k=tt((0,y.useState)(void 0!==m?m:l),2),E=k[0],C=k[1],S=(0,y.useCallback)((function(e,t){"function"==typeof c&&c(e,t),C(e)}),[c]),x=(0,y.useCallback)((function(e,t){var n;"function"==typeof u&&(n=u(e,t)),v(void 0!==n?n:e)}),[u]),O=(0,y.useCallback)((function(){"function"==typeof p&&p(),w(!0)}),[p]),L=(0,y.useCallback)((function(){"function"==typeof d&&d(),w(!1)}),[d]),M=void 0!==a?a:f,V=void 0!==s?s:_,P=void 0!==m?m:E;return St(St({},b),{},{inputValue:M,menuIsOpen:V,onChange:S,onInputChange:x,onMenuClose:L,onMenuOpen:O,value:P})}(e);return y.createElement(vi,b({ref:t},n))})),yi=(y.Component,hi);function _i(n){var i,o;const{settings:l,setSettings:c,setHasUpdates:u,variables:p}=n,m=null!==(i=null==l?void 0:l.plugin_settings)&&void 0!==i?i:{};let b=function(e,n){var i;let o=[];if(!e||!n||0===e.length||0===n.length)return o;let l=function(){let e=[{label:(0,r.__)("Hide Block","block-visibility"),type:"core",attributeSlug:"hideBlock",settingSlug:"hide_block"},{label:(0,r.__)("Date & Time","block-visibility"),type:"core",attributeSlug:"dateTime",settingSlug:"date_time"},{label:(0,r.__)("User Role","block-visibility"),type:"core",attributeSlug:"userRole",settingSlug:"visibility_by_role"},{label:(0,r.__)("Screen Size","block-visibility"),type:"core",attributeSlug:"screenSize",settingSlug:"screen_size"},{label:(0,r.__)("Query String","block-visibility"),type:"core",attributeSlug:"queryString",settingSlug:"query_string"}];e=(0,s.applyFilters)("blockVisibility.coreControls",e),e.sort(((e,t)=>e.attributeSlug.localeCompare(t.attributeSlug)));let t=[{label:(0,r.__)("Advanced Custom Fields","block-visibility"),type:"integration",attributeSlug:"acf",settingSlug:"acf",icon:d.acf},{label:(0,r.__)("WP Fusion","block-visibility"),type:"integration",attributeSlug:"wpFusion",settingSlug:"wp_fusion",icon:d.wpFusion}];t=(0,s.applyFilters)("blockVisibility.integrationControls",t),t.sort(((e,t)=>e.attributeSlug.localeCompare(t.attributeSlug)));let n=[...e,...t];return n=(0,s.applyFilters)("blockVisibility.controls",n),n}();l.forEach((function(e){"integration"!==e.type||(e=>{let t=!1;var i,o;return null!=n&&n.integrations&&(t=null!==(i=null==n||null===(o=n.integrations[e])||void 0===o?void 0:o.active)&&void 0!==i&&i),t})(e.settingSlug)||(l=l.filter((t=>t.settingSlug!==e.settingSlug)))}));const a=null!==(i=null==e?void 0:e.visibility_controls)&&void 0!==i?i:{};return(0,t.isEmpty)(a)||l.forEach((function(e){var n,i;let r=!1;(0,t.has)(a,e.settingSlug)||(r=!0),(null===(n=null===(i=a[e.settingSlug])||void 0===i?void 0:i.enable)||void 0===n||n)&&(r=!0),r&&o.push(e)})),o=(0,s.applyFilters)("blockVisibility.enabledControls",o,e,n),o}(l,p);b=b.filter((e=>"hide_block"!==e.settingSlug&&"visibility_presets"!==e.settingSlug));const g=[];b.forEach((e=>{g.push({label:e.label,value:e.settingSlug})}));const f=null!==(o=null==m?void 0:m.default_controls)&&void 0!==o?o:["date_time","visibility_by_role","screen_size"],v=g.filter((e=>f.includes(e.value)));return(0,e.createElement)("div",{className:"setting-tabs__settings-panel two-columns"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("General","block-visibility"))),(0,e.createElement)(a.Slot,{name:"VisibilityControlsGeneralTop"}),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__select has-info-popover"},(0,e.createElement)("div",null,(0,e.createElement)("span",null,(0,r.__)("Default visibility controls","block-visibility")),(0,e.createElement)(yi,{className:"block-visibility__react-select",classNamePrefix:"react-select",placeholder:(0,r.__)("Select Controls…","block-visibility"),options:g,value:v,onChange:e=>(e=>{const t=[];0!==e.length&&e.forEach((e=>{t.push(e.value)})),c({...l,plugin_settings:{...m,default_controls:t}}),u(!0)})(e),isMulti:!0}),(0,e.createElement)("div",{className:"settings-panel__help"},(0,r.__)("If no controls are selected, the plugin will default to Date & Time, User Role, and Screen Size.","block-visibility"))),(0,e.createElement)(h,{message:(0,r.__)("Optionally set the default controls that will be available when editing a block's visibility for the first time. This can be useful if you find yourself using the same few controls frequently. Controls can be disabled entirely on the Visibility Controls tab.","block-visibility")})),(0,e.createElement)(a.Slot,{name:"VisibilityControlsGeneralBottom"})))}function wi(t){var n,i;const{visibilityControls:o,setVisibilityControls:l}=t,s=null===(n=null==o||null===(i=o.hide_block)||void 0===i?void 0:i.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Hide Block","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Hide Block control.","block-visibility"),checked:s,onChange:()=>{l({...o,hide_block:{...o.hide_block,enable:!s}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Hide Block control allows you easily hide blocks on the frontend of your website. This control overrides all other controls when enabled on a block. Visit the plugin Knowledge Base for more information and examples of how this control can be used for content management.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-hide-block-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function ki(t){var n,i;const{visibilityControls:o,setVisibilityControls:l}=t,s=null===(n=null==o||null===(i=o.date_time)||void 0===i?void 0:i.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Date & Time","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Date & Time controls.","block-visibility"),checked:s,onChange:()=>{l({...o,date_time:{...o.date_time,enable:!s}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Date & Time control allows you to conditionally display blocks based on time and date settings, which includes the ability to schedule blocks. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-date-time-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(a.Slot,{name:"DateTimeControls"})))}function Ei(t){var n,i,o,l,s,c,u,d;const{visibilityControls:p,setVisibilityControls:m}=t,b=null===(n=null==p||null===(i=p.visibility_by_role)||void 0===i?void 0:i.enable)||void 0===n||n,g=null===(o=null==p||null===(l=p.visibility_by_role)||void 0===l?void 0:l.enable_user_roles)||void 0===o||o,f=null===(s=null==p||null===(c=p.visibility_by_role)||void 0===c?void 0:c.enable_users)||void 0===s||s,v=null===(u=null==p||null===(d=p.visibility_by_role)||void 0===d?void 0:d.enable_user_rule_sets)||void 0===u||u;let y=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable individual user role restrictions (Administrator, Editor, Subscriber, etc.)","block-visibility"),checked:g,onChange:()=>{m({...p,visibility_by_role:{...p.visibility_by_role,enable_user_roles:!g}})}}),_=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable individual user restrictions.","block-visibility"),checked:f,onChange:()=>{m({...p,visibility_by_role:{...p.visibility_by_role,enable_users:!f}})}}),w=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable advanced user role restrictions (User rule sets)","block-visibility"),checked:v,onChange:()=>{m({...p,visibility_by_role:{...p.visibility_by_role,enable_user_rule_sets:!v}})}});return b||(y=(0,e.createElement)(a.Disabled,null,y),_=(0,e.createElement)(a.Disabled,null,_),w=(0,e.createElement)(a.Disabled,null,w)),(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("User Role","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the User Role controls.","block-visibility"),checked:b,onChange:()=>{m({...p,visibility_by_role:{...p.visibility_by_role,enable:!b}})}}),(0,e.createElement)(h,{message:(0,r.__)("The User Role control allows you to conditionally display blocks based on whether a user is logged-in, logged-out, and more. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("hr",null),(0,e.createElement)("div",{className:"settings-type__toggle first has-info-popover subsetting"},y,(0,e.createElement)(h,{message:(0,r.__)("Restrict visibility by any user role (Administrator, Editor, Subscriber, etc.). Roles that are added by third-party plugins will also be available to choose from.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},_,(0,e.createElement)(h,{message:(0,r.__)("Restrict visibility to specific individual users on your website based on user ID. Multiple users can be selected at once.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},w,(0,e.createElement)(h,{message:(0,r.__)("This functionality allows you to create user-based rule sets, which provide extensive configuration options and greater flexibilty.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-user-role-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(a.Slot,{name:"VisibilityByRoleControls"})))}function Ci(t){const[n,i]=(0,e.useState)(!1),{screenSize:o,enableAdvancedControls:l}=t,s=function(e){const t=e.breakpoints.large,n=e.breakpoints.medium,i=e.controls.large,o=e.controls.medium,r=e.controls.small;let l="";return i&&(l=`/* Large screens (desktops, ${t} and up) */\n@media ( min-width: ${t} ) {\n\t.block-visibility-hide-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),o&&(l=(l?l+"\n\n":l)+`/* Medium screens (tablets, between ${n} and ${t}) */\n@media ( min-width: ${n} ) and ( max-width: ${Si(t)} ) {\n\t.block-visibility-hide-medium-screen {\n\t\tdisplay: none !important;\n\t}\n}`),r&&(l=(l?l+"\n\n":l)+`/* Small screens (mobile devices, less than ${n}) */\n@media ( max-width: ${Si(n)} ) {\n\t.block-visibility-hide-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),l||(l="/* All screen size controls have been disabled. */"),l}(o),c=function(e){const t=e.breakpoints.extra_large,n=e.breakpoints.large,i=e.breakpoints.medium,o=e.breakpoints.small,r=e.controls.extra_large,l=e.controls.large,a=e.controls.medium,s=e.controls.small,c=e.controls.extra_small,u="\n\n";let d="";return r&&(d=`/* Extra large screens (large desktops, ${t} and up) */\n@media ( min-width: ${t} ) {\n\t.block-visibility-hide-extra-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),l&&(d=(d?d+u:d)+`/* Large screens (desktops, between ${n} and ${t}) */\n@media ( min-width: ${n} ) and (max-width: ${Si(t)} ) {\n\t.block-visibility-hide-large-screen {\n\t\tdisplay: none !important;\n\t}\n}`),a&&(d=(d?d+u:d)+`/* Medium screens (tablets, between ${i} and ${n}) */\n@media ( min-width: ${i} ) and ( max-width: ${Si(n)} ) {\n\t.block-visibility-hide-medium-screen {\n\t\tdisplay: none !important;\n\t}\n}`),s&&(d=(d?d+u:d)+`/* Small screens (landscape mobile devices, between ${o} and ${n}) */\n@media ( min-width: ${o} ) and ( max-width: ${Si(i)} ) {\n\t.block-visibility-hide-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),c&&(d=(d?d+u:d)+`/* Extra small screens (portrait mobile devices, less than ${o}) */\n@media ( max-width: ${Si(o)} ) {\n\t.block-visibility-hide-extra-small-screen {\n\t\tdisplay: none !important;\n\t}\n}`),d||(d="/* All screen size controls have been disabled. */"),d}(o);return(0,e.createElement)("div",{className:"breakpoint-css-preview subsetting"},(0,e.createElement)(a.Button,{onClick:()=>i(!n),isSecondary:!0},[!n&&(0,r.__)("Preview Frontend CSS","block-visibility"),n&&(0,r.__)("Hide Preview","block-visibility")]),n&&(0,e.createElement)("pre",null,[l&&c,!l&&s]))}function Si(e){return(0,t.trim)(e,"px")-.02+"px"}function xi(t){const{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:l}=t,s={extra_large:{title:(0,r.__)("Extra Large","block-visibility"),description:(0,r.__)("Large desktop screen sizes.")},large:{title:(0,r.__)("Large","block-visibility"),description:(0,r.__)("Desktop and tablet (landscape) screen sizes.","block-visibility")},medium:{title:(0,r.__)("Medium","block-visibility"),description:(0,r.__)("Tablet (portrait) screen sizes.","block-visibility")},small:{title:(0,r.__)("Small","block-visibility"),description:(0,r.__)("Mobile (landscape) screen sizes.","block-visibility")}};return(0,e.createElement)("div",{className:"breakpoints-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Breakpoints","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The plugin sets a series of breakpoints which enable the Screen Size control automatically. However for best results, you can configure the breakpoints to correspond with the media breakpoints of your current theme.","block-visibility"),subMessage:(0,r.__)("The default breakpoints are Large (992px) and Medium (768px). Advanced screen size controls add Extra Large (1200px) and Small (576px).","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),Object.entries(s).map((t=>{let[r,s]=t;const c=o.breakpoints[r];return"extra_large"!==r&&"small"!==r||l?(0,e.createElement)("div",{className:"breakpoint",key:r},(0,e.createElement)("div",{className:"breakpoint-inputs"},(0,e.createElement)(a.__experimentalUnitControl,{label:s.title,value:c,onChange:e=>function(e,t){i({...n,screen_size:{...o,breakpoints:{...o.breakpoints,[e]:t}}})}(r,e),units:[{value:"px",label:"px"}]}),(0,e.createElement)("div",{className:"settings-panel__help"},s.description))):null})))}function Oi(t){const{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:l}=t;function s(e,t){i({...n,screen_size:{...o,controls:{...o.controls,[e]:t}}})}return(0,e.createElement)("div",{className:"controls-container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Controls","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The settings below allow you to restrict which controls are available to users in the Block/Site Editor. Disabling controls will remove the corresponding CSS from the frontend of your website.","block-visibility"),subMessage:(0,r.__)("The default controls are Desktop, Tablet, and Mobile. Advanced screen size controls add Large Desktop and Mobile (portrait).","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),l&&(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable large desktop control","block-visibility"),help:(0,r.sprintf)( +// translators: %s: extra large breakpoint +(0,r.__)("Allows users to hide blocks on extra large screen sizes, %s and up.","block-visibility"),o.breakpoints.extra_large),checked:o.controls.extra_large,onChange:()=>s("extra_large",!o.controls.extra_large)}),(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable desktop control","block-visibility"),help:[!l&&(0,r.sprintf)( +// translators: %s large breakpoint +(0,r.__)("Allows users to hide blocks on large screen sizes, %s and up.","block-visibility"),o.breakpoints.large),l&&(0,r.sprintf)( +// translators: %1$s: large breakpoint %2$s: extra large breakpoint +(0,r.__)("Allows users to hide blocks on large screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.large,o.breakpoints.extra_large)],checked:o.controls.large,onChange:()=>s("large",!o.controls.large)}),(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable tablet control","block-visibility"),help:(0,r.sprintf)( +// translators: %1$s: medium breakpoint %2$s: large breakpoint +(0,r.__)("Allows users to hide blocks on medium screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.medium,o.breakpoints.large),checked:o.controls.medium,onChange:()=>s("medium",!o.controls.medium)}),(0,e.createElement)(a.ToggleControl,{label:[!l&&(0,r.__)("Enable mobile control","block-visibility"),l&&(0,r.__)("Enable mobile (landscape) control","block-visibility")],help:[!l&&(0,r.sprintf)( +// translators: %s: medium breakpoint +(0,r.__)("Allows users to hide blocks on small screen sizes, less than %s.","block-visibility"),o.breakpoints.medium),l&&(0,r.sprintf)( +// translators: %1$s: small breakpoint %2$s: medium breakpoint +(0,r.__)("Allows users to hide blocks on small screen sizes, between %1$s and %2$s.","block-visibility"),o.breakpoints.small,o.breakpoints.medium)],checked:o.controls.small,onChange:()=>s("small",!o.controls.small)}),l&&(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable mobile (portrait) control","block-visibility"),help:(0,r.sprintf)( +// translators: %s: small breakpoint +(0,r.__)("Allows users to hide blocks on extra small screen sizes, less than %s.","block-visibility"),o.breakpoints.small),checked:o.controls.extra_small,onChange:()=>s("extra_small",!o.controls.extra_small)}))}function Li(t){const{visibilityControls:n,setVisibilityControls:i}=t;let o;o=null!=n&&n.screen_size?n.screen_size:{enable:!0,breakpoints:{extra_large:"1200px",large:"992px",medium:"768px",small:"576px"},controls:{extra_large:!0,large:!0,medium:!0,small:!0,extra_small:!0},enable_advanced_controls:!1,enable_frontend_css:!0};let l=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"breakpoint-control-container subsetting"},(0,e.createElement)(xi,{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:o.enable_advanced_controls}),(0,e.createElement)(Oi,{visibilityControls:n,setVisibilityControls:i,screenSize:o,enableAdvancedControls:o.enable_advanced_controls})),(0,e.createElement)(Ci,{screenSize:o,enableAdvancedControls:o.enable_advanced_controls})),s=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable advanced screen size controls.","block-visibility"),checked:o.enable_advanced_controls,onChange:()=>{i({...n,screen_size:{...o,enable_advanced_controls:!o.enable_advanced_controls}})}}),c=(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Load screen size CSS on the frontend of this website.","block-visibility"),checked:o.enable_frontend_css,onChange:()=>{i({...n,screen_size:{...o,enable_frontend_css:!o.enable_frontend_css}})}});return o.enable||(l=(0,e.createElement)(a.Disabled,null,l),s=(0,e.createElement)(a.Disabled,null,s),c=(0,e.createElement)(a.Disabled,null,c)),(0,e.createElement)("div",{className:"setting-tabs__settings-panel two-columns"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Screen Size","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Screen Size controls.","block-visibility"),checked:o.enable,onChange:()=>{i({...n,screen_size:{...o,enable:!o.enable}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Screen Size control allows you to conditionally display blocks on the current width of the browser window, or in other words, the screen size of a user's device. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("hr",null),l,(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},s,(0,e.createElement)(h,{message:(0,r.__)("By default, the Screen Size control includes two breakpoints and three controls for users to hide blocks. There are certain situations where you may need more control over when a block should be visible, for example in the case of very large or small screens. Enabling advanced controls provides these options.","block-visibility"),subMessage:(0,r.__)("Note that once enabled, any block that is only using the advanced controls to hide at extra large, or extra small, breakpoints will become visible again if this setting is ever disabled in the future.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover subsetting"},c,(0,e.createElement)(h,{message:(0,r.__)('By default, the CSS needed for the Screen Size controls is loaded on the frontend of your website. If disabled, you will need to add the CSS manually to your theme in order for the Screen Size controls to work properly. This CSS code is available via the "Preview Frontend CSS" button on this page.',"block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-screen-size-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(a.Slot,{name:"ScreenSizeControls"})))}function Mi(t){var n,i;const{visibilityControls:o,setVisibilityControls:l}=t,s=null===(n=null==o||null===(i=o.query_string)||void 0===i?void 0:i.enable)||void 0===n||n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Query String","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Query String control.","block-visibility"),checked:s,onChange:()=>{l({...o,query_string:{...o.query_string,enable:!s}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Query String control allows you to conditionally display blocks based on URL query strings. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-query-string-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function Vi(t){var n,i,o,l,s;const{variables:u,visibilityControls:p,setVisibilityControls:m}=t;if(null===(n=null==u||null===(i=u.integrations)||void 0===i||null===(o=i.acf)||void 0===o?void 0:o.active)||void 0===n||!n)return null;const b=null===(l=null==p||null===(s=p.acf)||void 0===s?void 0:s.enable)||void 0===l||l;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(c,{icon:d.acf}),(0,r.__)("Advanced Custom Fields","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the Advanced Custom Fields control.","block-visibility"),checked:b,onChange:()=>{m({...p,acf:{...p.acf,enable:!b}})}}),(0,e.createElement)(h,{message:(0,r.__)("The Advanced Custom Fields (ACF) control allows you to conditionally display blocks, including ACF blocks, based on ACF fields. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-advanced-custom-fields-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function Pi(t){var n,i,o,l,s;const{variables:u,visibilityControls:p,setVisibilityControls:m}=t;if(null===(n=null==u||null===(i=u.integrations)||void 0===i||null===(o=i.wp_fusion)||void 0===o?void 0:o.active)||void 0===n||!n)return null;const b=null===(l=null==p||null===(s=p.wp_fusion)||void 0===s?void 0:s.enable)||void 0===l||l;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,e.createElement)(c,{icon:d.wpFusion}),(0,r.__)("WP Fusion","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable the WP Fusion control.","block-visibility"),checked:b,onChange:()=>{m({...p,wp_fusion:{...p.wp_fusion,enable:!b}})}}),(0,e.createElement)(h,{message:(0,r.__)("The WP Fusion control allows you to conditionally display blocks based on WP Fusion tags. Visit the plugin Knowledge Base for more information.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-use-the-wp-fusion-control/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function Ni(t){var n;const{variables:i,visibilityControls:o}=t;let l=null!==(n=null==i?void 0:i.integrations)&&void 0!==n?n:{};return l=Object.keys(l).map((e=>l[e])),l=l.filter((e=>!0===e.active)),0===l.length?null:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-tabs__setting-controls integrations"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,r.__)("Third-Party Integration Controls","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The settings below allow you to configure all third-party integration controls for Block Visibility. If you are looking for an integration, and do not see it below, make sure the respective third-party plugin is installed and activated on your website.","block-visibility"),subMessage:(0,r.__)("Visit the plugin Knowledge Base for more information on configuring third-party integration controls and what integrations are currently available in Block Visibility.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/guide-to-third-party-integrations-in-block-visibility/?utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(g,b({tabSlug:"visibility_controls",tabSettings:o},t))),(0,e.createElement)(a.Slot,{name:"VisibilityControlsIntegrationsTop"}),(0,e.createElement)(Vi,t),(0,e.createElement)(Pi,t),(0,e.createElement)(a.Slot,{name:"VisibilityControlsIntegrationsBottom"}))}const Ti=(0,a.withFilters)("blockVisibility.VisibilityControls")((t=>(0,e.createElement)(e.Fragment,null)));function Ii(t){var n;const[i,o]=(0,e.useState)(!1),{settings:l,setSettings:s}=t,c=null!==(n=null==l?void 0:l.visibility_controls)&&void 0!==n?n:{};function u(e){s({...l,visibility_controls:e}),o(!0)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"setting-tabs__visibility-controls inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,r.__)("Visibility Controls","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The settings below allow you to configure the visibility controls that power Block Visibility. Pick and choose which controls you would like to enable and how you would like them to function.","block-visibility"),subMessage:(0,r.__)("When a visibility control is disabled, blocks that relied on the disabled control will become visible again unless they are hidden by other enabled controls. Visit the plugin Knowledge Base for more information on configuring visibility controls.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/guide-to-visibility-controls-in-block-visibility/?utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(g,b({tabSlug:"visibility_controls",tabSettings:c,hasUpdates:i,setHasUpdates:o},t))),(0,e.createElement)(a.Slot,{name:"VisibilityControlsTop"}),(0,e.createElement)(_i,b({visibilityControls:c,setVisibilityControls:u,setHasUpdates:o},t)),(0,e.createElement)(wi,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(Mi,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(ki,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(Ei,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(Li,b({visibilityControls:c,setVisibilityControls:u},t)),(0,e.createElement)(a.Slot,{name:"VisibilityControlsMiddle"}),(0,e.createElement)(Ni,b({visibilityControls:c,setVisibilityControls:u,hasUpdates:i,setHasUpdates:o},t)),(0,e.createElement)(a.Slot,{name:"VisibilityControlsBottom"}),(0,e.createElement)(Ti,b({visibilityControls:c,setVisibilityControls:u},t))),(0,e.createElement)(a.Slot,{name:"SettingsTabPanelBottom"}))}var Fi=window.wp.data,Ri=window.wp.blockEditor;function Ai(t){const{blockType:n,disabledBlocks:i,handleBlockTypeChange:o}=t,r=!i.includes(n.name);return(0,e.createElement)("li",{key:n.name,className:"blocks-category__block"},(0,e.createElement)(a.CheckboxControl,{checked:r,onChange:e=>function(e){o(e,n.name)}(e),label:(0,e.createElement)("span",null,n.title,n.icon&&(0,e.createElement)(Ri.BlockIcon,{icon:n.icon}))}))}function Di(n){const{blockTypes:i,category:o,disabledBlocks:r,handleBlockCategoryChange:l,handleBlockTypeChange:s}=n;if(!i.length)return null;const c=(0,t.map)(i,"name"),u=(0,t.without)(c,...r),d=u.length===c.length;let p;p=d?"true":u.length>0?"mixed":"false";const m="block-manager__category-title-"+o.slug;return(0,e.createElement)("div",{role:"group","aria-labelledby":m,className:"block-manager__block-category"},(0,e.createElement)("div",{className:"block-category__title"},(0,e.createElement)(a.CheckboxControl,{checked:d,onChange:e=>function(e){const n=(0,t.map)(i,"name");l(e,n)}(e),"aria-checked":p,label:(0,e.createElement)("span",{id:m},o.title,o.icon&&(0,e.createElement)(Ri.BlockIcon,{icon:o.icon}))})),(0,e.createElement)("ul",{className:"block-category__blocks-list"},i.map((t=>(0,e.createElement)(Ai,{key:t,blockType:t,handleBlockTypeChange:s,disabledBlocks:r})))))}var Bi=(0,Fi.withSelect)((e=>{const{getCategories:t,getBlockTypes:n,hasBlockSupport:i,isMatchingSearchTerm:o}=e("core/blocks");return{blockTypes:n(),categories:t(),hasBlockSupport:i,isMatchingSearchTerm:o}}))((function(n){var i,o,l;const[s,c]=(0,e.useState)(!1),[u,p]=(0,e.useState)(""),{settings:m,setSettings:f,blockTypes:v,categories:y,hasBlockSupport:_,isMatchingSearchTerm:w}=n,k=null!==(i=null==m?void 0:m.disabled_blocks)&&void 0!==i?i:{};function E(e){f({...m,disabled_blocks:e}),c(!0)}function C(e,n){let i=[...k];i=e?(0,t.difference)(i,n):(0,t.union)(i,n),E(i),c(!0)}function S(e,n){let i=[...k];e?i=(0,t.without)(i,n):i.push(n),E(i),c(!0)}let x;x=null!==(o=null==m||null===(l=m.plugin_settings)||void 0===l?void 0:l.enable_full_control_mode)&&void 0!==o&&o?v:v.filter((e=>_(e,"inserter",!0)&&!e.parent));const O=["core/freeform"];x=x.filter((e=>!O.includes(e.name)));const L=x.filter((e=>!u||w(e,u))),M=(0,t.intersection)(k,(0,t.map)(L,"name")),V=(0,t.intersection)(k,(0,t.map)(x,"name"));let P=d.visibility,N=(0,r.__)("Visibility is enabled for all blocks","block-visibility");return V.length&&(P=d.visibilityHidden,N=(0,r.sprintf)(/* translators: %s: The total number of visible block types */ +(0,r._n)("Visibility is disabled for %s block type","Visibility is disabled for %s block types",V.length,"block-visibility"),V.length)),(0,e.createElement)("div",{className:"setting-tabs__block-manager inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,r.__)("Block Manager","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("Not every block type may need visibility controls. The Block Manager allows you to restrict visibility controls to specific block types. If you are looking for a block, and do not see it listed, you may need to enable Full Control Mode on the General Settings tab.","block-visibility"),subMessage:(0,r.__)("To learn more about the Block Manager, review the plugin documentation using the link below.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-block-manager/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(g,b({tabSlug:"disabled_blocks",tabSettings:k,hasUpdates:s,setHasUpdates:c},n))),(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)(a.TextControl,{className:"setting-controls__search-blocks",type:"search",placeholder:(0,r.__)("Search for a block","block-visibility"),value:u,onChange:e=>p(e)}),(0,e.createElement)("span",{className:"message"},(0,e.createElement)(a.Icon,{icon:P}),N)),(0,e.createElement)("div",{className:"block-manager__category-container"},y.map((n=>(0,e.createElement)(Di,{key:n.slug,category:n,blockTypes:(0,t.filter)(L,{category:n.slug}),disabledBlocks:M,handleBlockCategoryChange:C,handleBlockTypeChange:S})))))}));function zi(t){var n,i,o,l,s;const{pluginSettings:c,setPluginSettings:u}=t,d=null===(n=null==c?void 0:c.enable_contextual_indicators)||void 0===n||n,p=null!==(i=null==c?void 0:c.contextual_indicator_color)&&void 0!==i?i:"",m=null!==(o=null==c?void 0:c.enable_block_opacity)&&void 0!==o&&o,b=null!==(l=null==c?void 0:c.block_opacity)&&void 0!==l?l:100,g=null===(s=null==c?void 0:c.enable_toolbar_controls)||void 0===s||s,f=[{name:(0,r.__)("Black","block-visibility"),color:"#121212"},{name:(0,r.__)("Light Grey","block-visibility"),color:"#F1F1F1"},{name:(0,r.__)("Red","block-visibility"),color:"#DC3232"},{name:(0,r.__)("Orange","block-visibility"),color:"#F56E28"},{name:(0,r.__)("Yellow","block-visibility"),color:"#FFB900"},{name:(0,r.__)("Green","block-visibility"),color:"#46B450"},{name:(0,r.__)("Medium Blue","block-visibility"),color:"#00A0D2"},{name:(0,r.__)("WordPress Blue","block-visibility"),color:"#0073AA"},{name:(0,r.__)("Purple","block-visibility"),color:"#826EB4"}],v=p||"var(--wp-admin-theme-color)";let y=(0,e.createElement)("div",{className:"settings-type__color"},(0,e.createElement)("div",null,(0,e.createElement)(a.BaseControl,{id:"indicator-color",className:"settings-type__color-selected",label:(0,r.__)("Indicator color","block-visibility")},(0,e.createElement)(a.ColorIndicator,{colorValue:v})),(0,e.createElement)(a.ColorPalette,{colors:f,value:p,onChange:e=>{u({...c,contextual_indicator_color:e})}})));d||(y=(0,e.createElement)(a.Disabled,null,y));let _=(0,e.createElement)("div",{className:"settings-type__range"},(0,e.createElement)(a.RangeControl,{label:(0,r.__)("Block Opacity","block-visibility"),value:b,onChange:e=>{u({...c,block_opacity:e})},min:10,max:100,step:10}));return m||(_=(0,e.createElement)(a.Disabled,null,_)),(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Block Editor","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("Settings that impact the Block Editor, such as contextual indicators for when a block has visibility controls, as well as additional toolbar options. Click the link below for complete details.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Contextual Indicators","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable contextual indicators.","block-visibility"),checked:d,onChange:()=>{u({...c,enable_contextual_indicators:!d})}}),(0,e.createElement)(h,{message:(0,r.__)("Contextual indicators allow users to quickly tell which blocks in the Block Editor have active visibility controls.","block-visibility")})),y,(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Contextual Block Opacity","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Reduce block opacity when visibility controls are applied.","block-visibility"),checked:m,onChange:()=>{u({...c,enable_block_opacity:!m})}}),(0,e.createElement)(h,{message:(0,r.__)("Reducing block opacity, coupled with contextual indicators, can further help users quickly tell which blocks in the Block Editor have active visibility controls.","block-visibility")})),_,(0,e.createElement)("div",{className:"settings-label"},(0,e.createElement)("span",null,(0,r.__)("Toolbar Controls","block-visibility"))),(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Enable block toolbar controls for visibility settings.","block-visibility"),checked:g,onChange:()=>{u({...c,enable_toolbar_controls:!g})}}),(0,e.createElement)(h,{message:(0,r.__)("Some visibility controls (currently just the Hide Block control) can be made available in the toolbar of each block. This provides a more streamlined workflow and can improve content management.","block-visibility")})),(0,e.createElement)(a.Slot,{name:"BlockEditorSettings"})))}function Hi(n){var i;const{pluginSettings:o,setPluginSettings:l}=n,s=null!==(i=null==o?void 0:o.enabled_user_roles)&&void 0!==i?i:[];return(0,e.createElement)("div",{className:"subsetting"},["editor","author","contributor"].map((n=>{const i=[...s],r=s.includes(n);if(r){const e=i.indexOf(n);e>-1&&i.splice(e,1)}else-1===i.indexOf(n)&&i.push(n);return(0,e.createElement)(a.CheckboxControl,{key:n,checked:r,label:(0,e.createElement)("span",null,(0,t.startCase)(n)+"s"),onChange:()=>{l({...o,enabled_user_roles:i})}})})),(0,e.createElement)("div",{className:"settings-panel__help"},(0,r.__)("Choose which user roles should be allowed to control visibility settings in the Block Editor. Administrators will always have permission.","block-visibility")))}function $i(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,l=null!==(n=null==i?void 0:i.enable_user_role_restrictions)&&void 0!==n&&n;let s=(0,e.createElement)(Hi,{pluginSettings:i,setPluginSettings:o});return l||(s=(0,e.createElement)(a.Disabled,null,s)),(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("User Permissions","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Restrict block visibility controls to selected user roles.","block-visibility"),checked:l,onChange:()=>{o({...i,enable_user_role_restrictions:!l})}}),(0,e.createElement)(h,{message:(0,r.__)("By default, all users that can edit blocks in Block Editor will be able to use the visibility settings provided by Block Visibility. You can limit permissions by user role with these settings.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),s,(0,e.createElement)(a.Slot,{name:"UserPermissionSettings"})))}function Ui(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,l=null!==(n=null==i?void 0:i.enable_full_control_mode)&&void 0!==n&&n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Full Control Mode","block-visibility"))),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle has-info-popover"},(0,e.createElement)(a.ToggleControl,{label:(0,e.createInterpolateElement)((0,r.__)("Enable Full Control Mode to add visibility controls to every block. Use with caution.","block-visibility"),{strong:(0,e.createElement)("strong",null),a:(0,e.createElement)(a.ExternalLink,{href:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",target:"_blank",rel:"noreferrer"})}),checked:l,onChange:()=>{o({...i,enable_full_control_mode:!l})}}),(0,e.createElement)(h,{message:(0,r.__)("By default, not all blocks are provided with visibility controls. These include child blocks and blocks that may exist in WordPress, but cannot actually be added directly to the editor. Most of the time, you will not need Full Control Mode, but it's there in case you do. Use with caution. Click the link below for complete details.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"}))))}function ji(t){var n;const{pluginSettings:i,setPluginSettings:o}=t,l=null!==(n=null==i?void 0:i.remove_on_uninstall)&&void 0!==n&&n;return(0,e.createElement)("div",{className:"setting-tabs__settings-panel"},(0,e.createElement)("div",{className:"settings-panel__header"},(0,e.createElement)("span",{className:"settings-panel__header-title"},(0,r.__)("Uninstall","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("Settings that impact what happens when the Block Visibility plugin is uninstalled.","block-visibility")})),(0,e.createElement)("div",{className:"settings-panel__container"},(0,e.createElement)("div",{className:"settings-type__toggle"},(0,e.createElement)(a.ToggleControl,{label:(0,r.__)("Remove all plugin settings when Block Visibility is uninstalled.","block-visibility"),checked:l,onChange:()=>{o({...i,remove_on_uninstall:!l})}}))))}const Gi=(0,a.withFilters)("blockVisibility.PluginSettings")((t=>(0,e.createElement)(e.Fragment,null)));function Zi(t){var n;const[i,o]=(0,e.useState)(!1),{settings:l,setSettings:s}=t,c=null!==(n=null==l?void 0:l.plugin_settings)&&void 0!==n?n:{};function u(e){s({...l,plugin_settings:e}),o(!0)}return(0,e.createElement)("div",{className:"settings-tab__plugin-settings inner-container"},(0,e.createElement)("div",{className:"setting-tabs__setting-controls"},(0,e.createElement)("div",{className:"setting-controls__title"},(0,e.createElement)("span",null,(0,r.__)("General Settings","block-visibility")),(0,e.createElement)(h,{message:(0,r.__)("The settings below allow you to configure general functionality of the Block Visibility plugin. To learn more about General Settings, review the plugin documentation using the link below.","block-visibility"),link:"https://www.blockvisibilitywp.com/knowledge-base/how-to-configure-the-general-settings/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals"})),(0,e.createElement)(g,b({tabSlug:"plugin_settings",tabSettings:c,hasUpdates:i,setHasUpdates:o},t))),(0,e.createElement)(a.Slot,{name:"PluginSettingsTop"}),(0,e.createElement)(zi,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)($i,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(a.Slot,{name:"PluginSettingsMiddle"}),(0,e.createElement)(Ui,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(ji,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)),(0,e.createElement)(a.Slot,{name:"PluginSettingsBottom"}),(0,e.createElement)(Gi,b({pluginSettings:c,setPluginSettings:u,setHasUpdates:o},t)))}function qi(t){const{variables:n}=t;return null!=n&&n.is_pro?null:(0,e.createElement)("div",{className:"ads-container"},(0,e.createElement)("div",{className:"ads-container__pro"},(0,e.createElement)("span",{className:"ads-container__header"},(0,r.__)("Upgrade to Pro","block-visibility")),(0,e.createElement)("p",null,(0,r.__)("Enhance the power of Block Visibility with the Pro add-on.","block-visibility")),(0,e.createElement)("ul",null,(0,e.createElement)("li",null,(0,r.__)("Location control","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("Advanced scheduling","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("Referral Source control","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("eCommerce integrations","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("Premium email support","block-visibility")),(0,e.createElement)("li",null,(0,r.__)("No ads!","block-visibility"))),(0,e.createElement)(a.Button,{href:"https://www.blockvisibilitywp.com/pro/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",target:"__blank",isPrimary:!0},(0,r.__)("Get Block Visibility Pro","block-visibility")," →")),(0,e.createElement)("div",{className:"ads-container__support"},(0,e.createElement)("span",{className:"ads-container__header"},(0,r.__)("Need Support?","block-visibility")),(0,e.createElement)("p",null,(0,r.__)("Whether you need help or have a new feature request, please create a topic in the support forum on WordPress.org.","block-visibility"),(0,e.createElement)(a.ExternalLink,{href:"https://wordpress.org/support/plugin/block-visibility/",target:"_blank",rel:"noreferrer"},(0,r.__)("Support Forum","block-visibility"))),(0,e.createElement)("p",null,(0,r.__)("Detailed documentation is also available on the plugin website.","block-visibility"),(0,e.createElement)(a.ExternalLink,{href:"https://www.blockvisibilitywp.com/knowledge-base/?bv_query=learn_more&utm_source=plugin&utm_medium=settings&utm_campaign=plugin_referrals",target:"_blank"},(0,r.__)("View Knowledge Base","block-visibility")))),(0,e.createElement)("div",{className:"ads-container__reviews"},(0,e.createElement)("span",{className:"ads-container__header"},(0,r.__)("Share Your Feedback","block-visibility")),(0,e.createElement)("p",null,(0,r.__)("If you are enjoying Block Visibility and find it useful, please consider leaving a ★★★★★ review on WordPress.org. Your feedback is greatly appreciated and helps others discover the plugin.","block-visibility"),(0,e.createElement)(a.ExternalLink,{href:"https://wordpress.org/support/plugin/block-visibility/reviews/?filter=5",target:"_blank",rel:"noreferrer"},(0,r.__)("Submit a Review","block-visibility")))))}const Wi=(0,a.withFilters)("blockVisibility.MainSettings")((t=>(0,e.createElement)(e.Fragment,null)));function Yi(){const[n,i]=(0,e.useState)("idle"),[l,c]=(0,e.useState)(null),[u,d]=(0,e.useState)(null);function b(e){c(e)}if((0,e.useEffect)((()=>{async function e(e,t){i("fetching");const n=`${blockVisibilityRestUrl}block-visibility/v1/${e}`,o=await fetch(n,{method:"GET"});o.ok?(t(await o.json()),i("fetched")):i("error")}e("settings",c),e("variables?type=simplified",d)}),[]),!l||!u||"fetched"!==n)return(0,e.createElement)(e.Fragment,null,"error"===n&&(0,e.createElement)("div",{className:"notice notice-error"},(0,e.createElement)("p",null,(0,r.__)("Something went wrong when trying to load the Block Visibility settings. Try refreshing the page. If the error persists, please contact support.","block-visibility"))),(0,e.createElement)("div",{className:"loading-settings"},(0,e.createElement)(a.Spinner,null),(0,e.createElement)("span",{className:"description"},(0,r.__)("Loading settings…","block-visibility"))));const g=[{name:"plugin-settings",title:(0,r.__)("General Settings","block-visibility"),className:"setting-tabs__plugin-settings"},{name:"visibility-controls",title:(0,r.__)("Visibility Controls","block-visibility"),className:"setting-tabs__visibility-controls"},{name:"block-manager",title:(0,r.__)("Block Manager","block-visibility"),className:"setting-tabs__blocks-manager"}];(0,s.applyFilters)("blockVisibility.SettingTabs",g);const f=new URLSearchParams(window.location.search),v=f.get("tab"),h=(0,t.findKey)(g,["name",v])?v:"plugin-settings";return(0,e.createElement)(a.SlotFillProvider,null,(0,e.createElement)(Wi,null),(0,e.createElement)(p,{variables:u}),(0,e.createElement)(a.TabPanel,{className:o()({"setting-tabs":!0,is_pro:null==u?void 0:u.is_pro}),activeClass:"active-tab",initialTabName:h,tabs:g,onSelect:e=>(e=>{if(f.set("tab",e),history.pushState){const e=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+f.toString()+window.location.hash;window.history.replaceState({path:e},"",e)}else window.location.search=f.toString()})(e)},(t=>{switch(t.name){case"visibility-controls":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(qi,{variables:u}),(0,e.createElement)(Ii,{settings:l,setSettings:b,variables:u}));case"block-manager":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(qi,{variables:u}),(0,e.createElement)(Bi,{settings:l,setSettings:b,variables:u}));case"plugin-settings":return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(qi,{variables:u}),(0,e.createElement)(Zi,{settings:l,setSettings:b,variables:u}));default:return(0,e.createElement)(a.Slot,{name:"SettingsTabs"})}})),(0,e.createElement)(m,{variables:u}))}wp.domReady((()=>{(0,l.registerCoreBlocks)(),(0,e.render)((0,e.createElement)(Yi,null),document.getElementById("block-visibility-settings-container"))}))}()}(); \ No newline at end of file