@siratik/wp-component-library 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +5 -0
- package/README.md +43 -5
- package/components/attachment-image/README.md +118 -0
- package/components/attachment-image/index.js +105 -0
- package/components/attributes-panel/README.md +92 -0
- package/components/attributes-panel/index.js +324 -0
- package/components/badge/README.md +61 -0
- package/components/badge/index.js +105 -0
- package/components/block-appender/README.md +158 -0
- package/components/block-appender/index.js +135 -0
- package/components/block-extension/index.js +214 -0
- package/components/business-hours/SpecialHoursControl.js +211 -0
- package/components/business-hours/WeeklyHoursControl.js +419 -0
- package/components/business-hours/index.js +8 -0
- package/components/button/README.md +172 -0
- package/components/button/index.js +84 -0
- package/components/captcha-placeholder/CloudflareTurnstile.js +111 -0
- package/components/captcha-placeholder/GoogleRecaptcha.js +132 -0
- package/components/captcha-placeholder/HCaptcha.js +99 -0
- package/components/captcha-placeholder/README.md +228 -0
- package/components/captcha-placeholder/index.js +39 -0
- package/components/captcha-placeholder/styles.js +33 -0
- package/components/geocoder/AddressEntryControl.js +390 -0
- package/components/geocoder/GeocoderSearchControl.js +353 -0
- package/components/geocoder/countryOptions.js +66 -0
- package/components/geocoder/geocoder.js +400 -0
- package/components/geocoder/index.js +16 -0
- package/components/icon-picker/Icon.js +53 -0
- package/components/icon-picker/IconPicker.js +70 -0
- package/components/icon-picker/IconPickerModal.js +474 -0
- package/components/icon-picker/IconPickerToolbarButton.js +60 -0
- package/components/icon-picker/InlineIconPicker.js +92 -0
- package/components/icon-picker/api.js +181 -0
- package/components/icon-picker/config-bootstrap.js +108 -0
- package/components/icon-picker/hooks.js +157 -0
- package/components/icon-picker/index.js +39 -0
- package/components/icon-picker/load-script.js +33 -0
- package/components/icon-picker/loaders.js +79 -0
- package/components/icon-picker/store.js +223 -0
- package/components/icon-picker/styles.js +232 -0
- package/components/icon-picker/utils.js +138 -0
- package/components/layout/README.md +268 -0
- package/components/link-tools-panel/README.md +49 -0
- package/components/link-tools-panel/index.js +198 -0
- package/components/link-tools-panel/styles.js +90 -0
- package/components/media/README.md +288 -0
- package/components/media/SettingsMediaUpload.js +186 -0
- package/components/media/editor-media-upload.js +65 -0
- package/components/media/image-controls.js +196 -0
- package/components/media/index.js +13 -0
- package/components/media/inspector-media-upload.js +290 -0
- package/components/media/toolbar-media-upload.js +53 -0
- package/components/media/utils/aspect-ratios.js +118 -0
- package/components/meta/MetaPanel.js +75 -0
- package/components/meta/README.md +46 -0
- package/components/meta/index.js +6 -0
- package/components/meta/meta-gated-editor.js +282 -0
- package/components/query/README.md +340 -0
- package/components/query/cardTemplatePartPanel.js +69 -0
- package/components/query/cardTemplatePartSelect.js +165 -0
- package/components/query/cardTemplatePartUtils.js +119 -0
- package/components/query/columnCountControl.js +63 -0
- package/components/query/displayTypeSelect.js +52 -0
- package/components/query/examples.js +166 -0
- package/components/query/hideCurrentPostControl.js +47 -0
- package/components/query/index.js +20 -0
- package/components/query/manualPostSelector.js +125 -0
- package/components/query/manualTermSelector.js +141 -0
- package/components/query/orderBySelect.js +95 -0
- package/components/query/postTypeSelect.js +67 -0
- package/components/query/postsPerPageControl.js +51 -0
- package/components/query/selectionModeControl.js +61 -0
- package/components/query/taxonomySelect.js +139 -0
- package/components/query/utils.js +75 -0
- package/components/repeater/README.md +159 -0
- package/components/repeater/index.js +829 -0
- package/components/segmented-bar/README.md +30 -0
- package/components/segmented-bar/index.js +68 -0
- package/components/sortable-select/README.md +153 -0
- package/components/sortable-select/custom-sortable-token.js +127 -0
- package/components/sortable-select/index.js +693 -0
- package/components/style-picker/README.md +36 -0
- package/components/style-picker/index.js +92 -0
- package/components/variable-field/README.md +299 -0
- package/components/variable-field/index.js +592 -0
- package/components/variable-field/value-to-chip-html.js +38 -0
- package/components/variable-inserter/README.md +68 -0
- package/components/variable-inserter/index.js +168 -0
- package/constants/statusColors.js +1 -1
- package/editor.js +16 -0
- package/index.js +127 -0
- package/package.json +21 -13
- package/utils/kitaris-localize.js +128 -0
- package/utils/slug-aware-color-setter.js +27 -0
- package/build/index.asset.php +0 -20
- package/build/index.js +0 -1242
package/build/index.js
DELETED
|
@@ -1,1242 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@emotion/react"),require("@emotion/styled"),require("@wordpress/icons")):"function"==typeof define&&define.amd?define(["@emotion/react","@emotion/styled","@wordpress/icons"],t):"object"==typeof exports?exports["@siratik/wp-component-library"]=t(require("@emotion/react"),require("@emotion/styled"),require("@wordpress/icons")):e["@siratik/wp-component-library"]=t(e.builtnorthEmotion.react,e.builtnorthEmotion.styled,e.wp.icons)}(globalThis,(e,t,n)=>(()=>{var r={694(e,t,n){"use strict";var r=n(925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},556(e,t,n){e.exports=n(694)()},925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},802(t){"use strict";t.exports=e},868(e){"use strict";e.exports=t},953(e){"use strict";e.exports=n}};const o={};function i(e){const t=o[e];if(void 0!==t)return t.exports;const n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.hasOwn(e,t),i.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};let a={};return(()=>{"use strict";i.r(a),i.d(a,{ADMIN_COLOR:()=>le,AttachmentImage:()=>n,AttributesPanel:()=>xr,Badge:()=>Ar,ButtonFrontend:()=>v,CaptchaPlaceholder:()=>uo,CardTemplatePartPanel:()=>$o,CardTemplatePartSelect:()=>Fo,ColumnCountControl:()=>po,CustomBlockAppender:()=>h,CustomColumnAppender:()=>b,CustomInlineAppender:()=>x,CustomInspectorAppender:()=>g,DisplayTypeSelect:()=>fo,DragHandle:()=>dr,EditorMediaUpload:()=>w,HideCurrentPostControl:()=>mo,ICON_STORE_NAME:()=>_i,Icon:()=>fl,IconPicker:()=>Ts,IconPickerModal:()=>ks,IconPickerToolbarButton:()=>Is,ImageControls:()=>G,InlineIconPicker:()=>Es,InspectorMediaUpload:()=>R,LINK_DEFAULTS:()=>Go,LinkToolsPanel:()=>Ko,LinkToolsPanelItems:()=>qo,ManualPostSelector:()=>jo,ManualTermSelector:()=>No,MetaPanel:()=>ae,OrderBySelect:()=>Mo,PostTypeSelect:()=>zo,PostsPerPageControl:()=>Po,RemoveButton:()=>pr,Repeater:()=>hr,SKIN_CHANGED_EVENT:()=>fi,STATUS_COLOR_FALLBACKS:()=>vr,SegmentedBar:()=>Mr,SelectionModeControl:()=>Uo,SettingsMediaUpload:()=>F,SortableSelect:()=>Ao,TaxonomySelect:()=>Ho,ToolbarMediaUpload:()=>U,VariableField:()=>ai,VariableInserter:()=>pi,defaultChartStatusColors:()=>Dr,defaultOrderOptions:()=>Oo,getBadgeIntentColors:()=>Er,getDefaultCardSlugForPostType:()=>Bo,getEditorExperiencePatterns:()=>xi,getEditorExperienceSectionDivider:()=>vi,getKitarisLocalize:()=>wi,getKitarisLocalizeWindow:()=>yi,getLocalize:()=>bi,getLocalizeWindow:()=>gi,getScoreChartColors:()=>Ir,getScoreStatusTier:()=>kr,getScoreSurfaceColors:()=>Tr,getStatusSurfaceColors:()=>Cr,iconStore:()=>ki,isMetaValueEmpty:()=>Q,isTemplateEditorSurface:()=>X,loadAllIconSets:()=>ji,loadIconSet:()=>Ai,registerBlockExtension:()=>c,registerConfigIconSets:()=>Mi,registerIconSet:()=>Di,registerIcons:()=>Ri,removeIconSet:()=>Ni,reorderByIds:()=>Wo,statusColor:()=>_r,statusVar:()=>Sr,tokensToString:()=>Eo,unregisterBlockExtension:()=>u,useAllIcons:()=>Li,useAspectRatioOptions:()=>V,useAttributes:()=>br,useGroupedIcons:()=>zi,useIcon:()=>Fi,useIconPickerGroups:()=>$i,useIconSets:()=>Pi,useIcons:()=>Bi,useMetaGatedEditorVisibility:()=>re,useOrderedTerms:()=>Vo});const e=window.wp.data,t=window.ReactJSXRuntime;function n({imageId:n,className:r="image",customAlt:o=null,showCaption:i=!1,wrapClass:a=null,includeFigure:l=!0,size:s="full",maxWidth:c="100px",aspectRatio:u="4/3",objectFit:d=null,caption:p=null,...f}){const{image:m}=(0,e.useSelect)(e=>({image:e("core").getEntityRecord("postType","attachment",n)}));if(!n||0===n||!m)return null;const h=(e,t)=>{const n=e.split(" ");return n.length>0&&(n[0]=`${n[0]}${t}`),n.join(" ")},g=(0,t.jsx)("img",{...(()=>{const e={className:h(r,"__img"),src:m.source_url,alt:o||m.alt_text,width:m.media_details.width,height:m.media_details.height,sizes:`(max-width: ${c}) 100vw, ${c}`,style:{aspectRatio:u,...d?{objectFit:d}:{}}};return m.media_details&&m.media_details.sizes&&m.media_details.sizes[s]&&(e.src=m.media_details.sizes[s].source_url,e.srcSet=m.media_details.sizes[s].source_url,e.width=m.media_details.sizes[s].width,e.height=m.media_details.sizes[s].height),{...e,...f}})()}),b=i&&p?(0,t.jsx)("figcaption",{className:h(r,"__caption"),children:p}):null;if(l){const e=a?`${h(r,"__figure")} ${a}`:h(r,"__figure");return(0,t.jsxs)("figure",{className:e,children:[g,b]})}return(0,t.jsxs)(t.Fragment,{children:[g,b]})}const r=window.wp.hooks,o=window.wp.compose,l=window.wp.element;function s(...e){return e.filter(Boolean).join(" ").trim()}function c(e,{attributes:t={},classNameGenerator:n=()=>"",inlineStyleGenerator:i,Edit:a,extensionName:c,order:u="after"}){const d=Array.isArray(e);"*"===e&&(e="all");const p=t=>"all"===e||(d?e.includes(t):t===e),f=`wpcl/${d?e.join("-"):e}/${c}`;(0,r.addFilter)("blocks.registerBlockType",`${f}/addAttributesToBlock`,(e,n)=>p(n)?{...e,attributes:{...e.attributes,...t}}:e);const m=(0,o.createHigherOrderComponent)(e=>t=>{const{name:n,isSelected:r}=t;if(!p(n))return(0,l.createElement)(e,t);const o="before"===u&&r,i="after"===u&&r,s=!o&&!i&&r;return(0,l.createElement)(l.Fragment,null,o&&(0,l.createElement)(a,t),(0,l.createElement)(e,t),i&&(0,l.createElement)(a,t),s&&(0,l.createElement)(a,t))},"addSettingsToBlock");(0,r.addFilter)("editor.BlockEdit",`${f}/addSettingsToBlock`,m);const h=(0,o.createHigherOrderComponent)(e=>t=>{const{name:r,attributes:o,className:a="",style:c={},wrapperProps:u}=t;if(!p(r))return(0,l.createElement)(e,t);const d=n(o);let f={...c},m=null;if("function"==typeof i&&(m=i(o),f={...c,...u?.style??{},...m}),!d&&!m)return(0,l.createElement)(e,t);const h=s(a,d);return(0,l.createElement)(e,{...t,className:h,wrapperProps:{...u,style:f}})},"addAdditionalPropertiesInEditor");(0,r.addFilter)("editor.BlockListBlock",`${f}/addAdditionalPropertiesInEditor`,h),(0,r.addFilter)("blocks.getSaveContent.extraProps",`${f}/addAdditionalPropertiesToSavedMarkup`,(e,t,r)=>{const{className:o="",style:a={}}=e;if(!p(t.name))return e;const l=n(r);let c={...a},u=null;if("function"==typeof i&&(u=i(r),c={...a,...u}),!l&&!u)return e;const d=s(o,l);return{...e,className:d,style:c}})}function u(e,t){if(!e||!t)return;"*"===e&&(e="all");const n=`wpcl/${Array.isArray(e)?e.join("-"):e}/${t}`;(0,r.removeFilter)("blocks.registerBlockType",`${n}/addAttributesToBlock`),(0,r.removeFilter)("editor.BlockEdit",`${n}/addSettingsToBlock`),(0,r.removeFilter)("editor.BlockListBlock",`${n}/addAdditionalPropertiesInEditor`),(0,r.removeFilter)("blocks.getSaveContent.extraProps",`${n}/addAdditionalPropertiesToSavedMarkup`)}const d=window.wp.blockEditor,p=window.wp.components;var f=i(953);const m=window.wp.i18n;function h({rootClientId:e,appenderTitle:n,appenderLabel:r,appenderClassModifier:o}){return(0,t.jsx)(d.Inserter,{__experimentalIsQuick:!0,rootClientId:e,renderToggle:({onToggle:e,disabled:i})=>(0,t.jsx)(p.Button,{showTooltip:!0,className:`block-list-appender__toggle built-block-appender--${o} `,onClick:e,disabled:i,label:r,icon:f.plus,children:n}),isAppender:!0})}function g({rootClientId:e,appenderTitle:n,appenderLabel:r,appenderClassModifier:o}){return(0,t.jsx)(d.Inserter,{__experimentalIsQuick:!0,rootClientId:e,renderToggle:({onToggle:e,disabled:i})=>(0,t.jsxs)(p.Button,{className:`built-block-appender built-block-appender--${o} `,onClick:e,disabled:i,label:r,variant:"secondary",children:[(0,t.jsx)(f.Icon,{icon:f.plus}),n]}),isAppender:!0})}function b({rootClientId:e,appenderTitle:n,appenderLabel:r,appenderClassModifier:o}){return(0,t.jsx)(d.Inserter,{__experimentalIsQuick:!0,rootClientId:e,renderToggle:({onToggle:e,disabled:i})=>(0,t.jsx)("div",{className:" built-block-appender-column__wrapper",children:(0,t.jsx)(p.Button,{showTooltip:!0,className:`block-list-appender__toggle built-block-appender-column__appender built-block-appender--${o} `,onClick:e,disabled:i,label:r,icon:f.plus,children:n})}),isAppender:!0})}const x=({clientId:n,label:r=(0,m.__)("Add Block","wp-component-library")})=>(0,e.useSelect)(e=>{const{isBlockSelected:t,hasSelectedInnerBlock:r}=e(d.store);return t(n)||r(n,!0)},[n])?(0,t.jsx)(d.Inserter,{__experimentalIsQuick:!0,rootClientId:n,renderToggle:({onToggle:e,disabled:n})=>(0,t.jsx)(p.Button,{className:"block-list-appender__toggle",icon:f.plus,label:r,onClick:e,disabled:n}),isAppender:!0}):null;function v({className:e=null,size:n="default",style:r="default",text:o="Button Text",screenReader:i=null}){const a=i?(0,t.jsx)("span",{className:"screen-reader-only",children:i}):null,l=e?`${e}__button is-size-${n}`:`wp-block-kitaris-button is-style-${r} is-size-${n}`,s=e?"wp-block-kitaris-button__link wp-block-kitaris-button__text":"wp-block-kitaris-button__text";return(0,t.jsx)("span",{className:l,children:(0,t.jsxs)("span",{className:s,children:[o,a]})})}const y=["image"];function w({mediaIDs:e,onSelect:n,gallery:r,multiple:o,buttonTitle:i,style:a}){const l=(s=e)?"number"==typeof s?s:"object"==typeof s&&s.id?s.id:null:null;var s;return(0,t.jsx)(p.Placeholder,{style:a,withIllustration:!0,className:"placeholder-image placeholder-image--built",children:(0,t.jsx)(d.MediaUploadCheck,{children:(0,t.jsx)(d.MediaUpload,{onSelect:n,allowedTypes:y,value:l,render:({open:e})=>(0,t.jsx)(p.Button,{icon:f.upload,variant:"primary",label:"Upload or Select Image(s)",showTooltip:!0,tooltipPosition:"top center",onClick:e,children:i}),gallery:r,multiple:o})})})}var _=i(868),S=i.n(_);const C=/^(auto|\d+(\.\d+)?(\s*\/\s*\d+(\.\d+)?)?)$/,k=/^\d+(\.\d+)?(px|em|rem|%|vw|ch)?$/,T=S().div`
|
|
2
|
-
max-width: ${e=>{return"number"==typeof(t=e.maxWidth)&&Number.isFinite(t)&&t>=0?`${t}px`:"string"==typeof t&&k.test(t.trim())?t.trim():"none";var t}};
|
|
3
|
-
|
|
4
|
-
/* Shared frame so placeholder and selected image occupy the same box. */
|
|
5
|
-
.built-inspector-media-preview {
|
|
6
|
-
width: 100%;
|
|
7
|
-
aspect-ratio: ${e=>e.$aspectRatio};
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
background: #f0f0f0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.built-inspector-media-preview .components-placeholder {
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
min-height: 0 !important;
|
|
17
|
-
margin: 0;
|
|
18
|
-
padding: 0;
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.built-inspector-media-preview img {
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
object-fit: cover;
|
|
26
|
-
object-position: center;
|
|
27
|
-
display: block;
|
|
28
|
-
}
|
|
29
|
-
`,I=S().div`
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
|
|
33
|
-
.components-flex {
|
|
34
|
-
height: auto;
|
|
35
|
-
}
|
|
36
|
-
`,E=S().div`
|
|
37
|
-
margin-top: 12px;
|
|
38
|
-
`,D=["image"];function R({mediaIDs:e,onSelect:r,onRemove:o,multiple:i,buttonTitle:a,variant:s,showFeatureImage:c=!1,featureImage:u=null,label:d=null,help:f=null,showImagePlaceholder:h,aspectRatio:g=16/9,maxWidth:b=null}){const x=e=>e?"number"==typeof e?e:"string"==typeof e&&/^\d+$/.test(e)?parseInt(e,10):Array.isArray(e)?x(e[0]):"object"==typeof e&&e.id?e.id:null:null,v=x(e),y=!!v,w=!(!c||!u||0===u),_="number"==typeof(S=g)&&Number.isFinite(S)&&S>0?String(S):"string"==typeof S&&C.test(S.trim())?S.trim():String(16/9);var S;const k=`inspector-media-upload-${v||"new"}`,R=function({onSelect:e,multiple:t,allowedTypes:n}){return(0,l.useCallback)(()=>{if("undefined"==typeof wp||!wp.media)return;const r=wp.media({title:(0,m.__)("Select or Upload Media","wp-component-library"),multiple:t||!1,library:{type:n||["image"]},button:{text:(0,m.__)("Select","wp-component-library")}});r.on("select",()=>{const n=r.state().get("selection");e(t?n.map(e=>e.toJSON()):n.first().toJSON())}),r.open()},[e,t,n])}({onSelect:r,multiple:i,allowedTypes:D}),A=(0,t.jsxs)(t.Fragment,{children:[h&&!y&&!w&&(0,t.jsx)("div",{className:"built-inspector-media-preview",children:(0,t.jsx)(p.Placeholder,{withIllustration:!0,className:"built-editor-panel-image placeholder-image placeholder-image--built"})}),h&&y&&(0,t.jsx)("div",{className:"built-inspector-media-preview",children:(0,t.jsx)(I,{className:"built-editor-panel-image",children:(0,t.jsx)(n,{className:"built-editor-panel-image",imageId:v,size:"wide_medium",includeFigure:!1,aspectRatio:_})})}),h&&w&&!y&&(0,t.jsx)("div",{className:"built-inspector-media-preview",children:(0,t.jsx)(I,{className:"built-editor-panel-image",children:(0,t.jsx)(n,{className:"built-editor-panel-image",imageId:u.id||u,size:"wide_medium",includeFigure:!1,aspectRatio:_})})})]}),j=(0,t.jsx)(E,{children:y?(0,t.jsxs)(p.Flex,{children:[(0,t.jsx)(p.Button,{__next40pxDefaultSize:!0,size:"default",className:"is-full-width",variant:"secondary",onClick:R,children:(0,m.__)("Edit/Replace","wp-component-library")}),(0,t.jsx)(p.Button,{__next40pxDefaultSize:!0,size:"default",variant:"secondary",className:"is-full-width",onClick:o,isDestructive:!0,children:(0,m.__)("Remove","wp-component-library")})]}):(0,t.jsx)(p.Button,{__next40pxDefaultSize:!0,className:"is-full-width",size:"default",variant:s||"secondary",onClick:R,children:a||(0,m.__)("Select or Upload Media","wp-component-library")})});return d||f?(0,t.jsxs)(T,{maxWidth:b,$aspectRatio:_,children:[(0,t.jsx)(p.BaseControl,{id:k,label:d,help:f,children:A}),j]}):(0,t.jsx)(T,{maxWidth:b,$aspectRatio:_,children:(0,t.jsxs)(p.Flex,{direction:"column",expanded:!0,style:{flexGrow:1},children:[A,j]})})}const A=window.wp.mediaUtils,j=["image"],N=S().div`
|
|
39
|
-
&__header {
|
|
40
|
-
margin-bottom: 12px;
|
|
41
|
-
}
|
|
42
|
-
`,O=S().h4`
|
|
43
|
-
margin: 0 0 4px 0;
|
|
44
|
-
font-size: 13px;
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
color: #1e1e1e;
|
|
47
|
-
`,M=S().p`
|
|
48
|
-
margin: 0;
|
|
49
|
-
font-size: 13px;
|
|
50
|
-
color: #757575;
|
|
51
|
-
line-height: 1.4;
|
|
52
|
-
`,P=S().div`
|
|
53
|
-
margin-bottom: 12px;
|
|
54
|
-
border: 1px solid #ddd;
|
|
55
|
-
border-radius: 4px;
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
background: #f9f9f9;
|
|
58
|
-
`,z=S().img`
|
|
59
|
-
max-width: 100%;
|
|
60
|
-
height: auto;
|
|
61
|
-
display: block;
|
|
62
|
-
max-height: 200px;
|
|
63
|
-
object-fit: cover;
|
|
64
|
-
`,L=S()(p.Placeholder)`
|
|
65
|
-
min-height: 120px;
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
|
|
70
|
-
.components-placeholder__label {
|
|
71
|
-
font-size: 13px;
|
|
72
|
-
color: #757575;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.components-placeholder__icon {
|
|
76
|
-
margin-bottom: 8px;
|
|
77
|
-
opacity: 0.3;
|
|
78
|
-
}
|
|
79
|
-
`,B=S().div`
|
|
80
|
-
.components-flex {
|
|
81
|
-
align-items: center;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.components-button {
|
|
85
|
-
min-width: 100px;
|
|
86
|
-
}
|
|
87
|
-
`;function F({imageId:n,onSelect:r,onRemove:o,label:i=null,help:a=null,buttonTitle:l=null,showImagePlaceholder:s=!0}){const c=(0,e.useSelect)(e=>n?e("core").getEntityRecord("postType","attachment",n):null,[n]),u=!!n;return(0,t.jsxs)(N,{children:[(i||a)&&(0,t.jsxs)("div",{className:"settings-media-upload__header",children:[i&&(0,t.jsx)(O,{children:i}),a&&(0,t.jsx)(M,{children:a})]}),s&&(0,t.jsx)(P,{children:u&&c?(0,t.jsx)(z,{src:c.source_url,alt:c.alt_text||"Selected image"}):(0,t.jsx)(L,{icon:"format-image",label:(0,m.__)("No image selected","wp-component-library")})}),(0,t.jsx)(B,{children:(0,t.jsx)(A.MediaUploadCheck,{children:(0,t.jsxs)(p.Flex,{gap:2,children:[(0,t.jsx)(A.MediaUpload,{onSelect:r,allowedTypes:j,value:n,render:({open:e})=>(0,t.jsx)(p.Button,{variant:"secondary",onClick:e,size:"default",children:l||(u?(0,m.__)("Change Image","wp-component-library"):(0,m.__)("Upload Image","wp-component-library"))})}),u&&(0,t.jsx)(p.Button,{variant:"secondary",isDestructive:!0,onClick:o,size:"default",children:(0,m.__)("Remove Image","wp-component-library")})]})})})]})}const $=["image"];function U({mediaIDs:e,onSelect:n,gallery:r,multiple:o}){const i=(a=e)?"number"==typeof a?a:"object"==typeof a&&a.id?a.id:null:null;var a;return(0,t.jsx)(d.MediaUploadCheck,{children:(0,t.jsx)(d.MediaUpload,{onSelect:n,allowedTypes:$,value:i,render:({open:e})=>(0,t.jsx)(p.ToolbarButton,{icon:f.pencil,label:(0,m.__)("Edit/Replace Media","wp-component-library"),onClick:e}),gallery:r,multiple:o})})}const H=()=>[{name:(0,m.__)("Square","wp-component-library"),ratio:"1"},{name:(0,m.__)("Standard","wp-component-library"),ratio:"4/3"},{name:(0,m.__)("Portrait","wp-component-library"),ratio:"3/4"},{name:(0,m.__)("Classic","wp-component-library"),ratio:"3/2"},{name:(0,m.__)("Classic Portrait","wp-component-library"),ratio:"2/3"},{name:(0,m.__)("Wide","wp-component-library"),ratio:"16/9"},{name:(0,m.__)("Extra Wide","wp-component-library"),ratio:"21/9"},{name:(0,m.__)("Tall","wp-component-library"),ratio:"9/16"}];function W(e){if(!e)return[];if(Array.isArray(e))return e;if("object"!=typeof e)return[];const t=[];for(const n of["default","theme","custom"])Array.isArray(e[n])&&t.push(...e[n]);return t}function V(){const[e,t,n,r]=(0,d.useSettings)(["dimensions.aspectRatios","dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"]);return(0,l.useMemo)(()=>{const o={label:(0,m.__)("Original","wp-component-library"),value:"original"};let i=[...W(e),...W(t),...W(n)];const a=new Set;return i=i.filter(e=>!!(e&&"object"==typeof e&&e.name&&e.ratio)&&!a.has(e.ratio)&&(a.add(e.ratio),!0)),0===i.length&&!1!==r&&(i=H()),[o,...i.filter(e=>"original"!==e.ratio&&"auto"!==e.ratio).map(e=>({label:e.name,value:e.ratio}))]},[e,t,n,r])}const Y={cover:(0,m.__)("Image covers the space evenly.","wp-component-library"),contain:(0,m.__)("Image is contained without cropping.","wp-component-library")},G=({aspectRatio:n="4/3",width:r="auto",height:o="auto",showCaption:i=!1,scale:a="cover",imageSize:l="",setAttributes:s})=>{const c=V(),u=(0,e.useSelect)(e=>{const t=e("core/block-editor").getSettings().imageSizes||[];return[{value:"",label:(0,m.__)("Auto","wp-component-library")},...t.map(({name:e,slug:t})=>({value:t,label:e}))]},[]),d=e=>({...e,aspectRatio:"4/3",width:"auto",height:"auto",showCaption:!1,scale:"cover",imageSize:""});return(0,t.jsxs)(p.__experimentalToolsPanel,{label:(0,m.__)("Image Settings","wp-component-library"),resetAllFilter:d,panelId:"image-settings",children:[(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>"4/3"!==n,label:(0,m.__)("Aspect Ratio","wp-component-library"),onDeselect:()=>s({aspectRatio:"4/3"}),resetAllFilter:d,isShownByDefault:!0,panelId:"image-settings",children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Aspect Ratio","wp-component-library"),value:n,onChange:e=>s({aspectRatio:e}),options:c})}),(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>"cover"!==a,label:(0,m.__)("Scale","wp-component-library"),onDeselect:()=>s({scale:"cover"}),resetAllFilter:d,isShownByDefault:!0,panelId:"image-settings",children:(0,t.jsxs)(p.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Scale","wp-component-library"),value:a,onChange:e=>s({scale:e}),isBlock:!0,help:Y[a]??"",children:[(0,t.jsx)(p.__experimentalToggleGroupControlOption,{value:"cover",label:(0,m.__)("Cover","wp-component-library")}),(0,t.jsx)(p.__experimentalToggleGroupControlOption,{value:"contain",label:(0,m.__)("Contain","wp-component-library")})]})}),(0,t.jsxs)(p.Flex,{gap:4,style:{minWidth:250},children:[(0,t.jsx)(p.FlexBlock,{children:(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>"auto"!==r,label:(0,m.__)("Width","wp-component-library"),onDeselect:()=>s({width:"auto"}),resetAllFilter:d,panelId:"image-settings",children:(0,t.jsx)(p.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,m.__)("Width","wp-component-library"),onChange:e=>s({width:e}),value:r,placeholder:(0,m.__)("Auto","wp-component-library")})})}),(0,t.jsx)(p.FlexBlock,{children:(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>"auto"!==o,label:(0,m.__)("Height","wp-component-library"),onDeselect:()=>s({height:"auto"}),resetAllFilter:d,panelId:"image-settings",children:(0,t.jsx)(p.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,m.__)("Height","wp-component-library"),onChange:e=>s({height:e}),value:o,placeholder:(0,m.__)("Auto","wp-component-library")})})})]}),(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>!1!==i,label:(0,m.__)("Show Caption","wp-component-library"),onDeselect:()=>s({showCaption:!1}),resetAllFilter:d,isShownByDefault:!1,panelId:"image-settings",children:(0,t.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Show Caption","wp-component-library"),checked:i,onChange:e=>s({showCaption:e})})}),(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>!!l,label:(0,m.__)("Resolution","wp-component-library"),onDeselect:()=>s({imageSize:""}),resetAllFilter:d,isShownByDefault:!1,panelId:"image-settings",children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Resolution","wp-component-library"),value:l,options:u,onChange:e=>s({imageSize:e}),help:(0,m.__)("Override the default image resolution. Leave as Auto for smart sizing.","wp-component-library")})})]})},q=window.wp.blocks,K=window.wp.coreData;function X(e){return!e||"wp_template"===e||"wp_template_part"===e||"wp_block"===e}const Z=/^[ \t\n\r\0\x0B]+|[ \t\n\r\0\x0B]+$/g;function J(e){return!e||"0"===e||Array.isArray(e)&&0===e.length}function Q(e){return null==e||!1===e||""===e||!!Array.isArray(e)||("object"==typeof e?J(e.name)||J(e.source):"string"==typeof e&&""===e.replace(Z,""))}const ee="core/post-meta";function te(e,t,n){if("string"!=typeof t||""===t||t.startsWith("_"))return;const r=e(K.store),o=(r.getEditedEntityRecord??r.getEntityRecord)("postType",n.postType,n.postId),i=o?.meta?.[t];return 0===i?"":i}function ne(e,t,n,r,o,i){const a=function(e,t,n,r,o){const i=e(d.store).getSettings?.()?.__experimentalBlockBindingsSupportedAttributes?.[t],a=[];for(const[t,l]of Object.entries(n||{})){if(Array.isArray(i)&&!i.includes(t))continue;if("string"!=typeof l?.source)continue;const n=l.args&&"object"==typeof l.args?l.args:{};if(l.source===ee){a.push(te(e,n.key,r));continue}const s=(0,q.getBlockBindingsSource)(l.source);if(!s?.getValues)continue;const c=s.getValues({select:e,context:r,bindings:{[t]:{...l,args:n}},clientId:o});a.push(c?.[t])}return a.length>0?a:null}(e,t,n,o,i);if(null!==a)return a;let l=null;for(const t of r||[]){const n=ne(e,t.name,t.attributes?.metadata?.bindings,t.innerBlocks,o,i);null!==n&&(l=[...l??[],...n])}return l}function re({attributes:t,clientId:n,context:r}){const{hideWhenMetaEmpty:o,metaField:i,metadata:a}=t||{},l=a?.bindings,s=r?.postId,c=r?.postType;return(0,e.useSelect)(e=>{const t={shouldHide:!1,isTemplateSurface:!1,isLoopPreview:!1};if(!o)return t;const r=e("core/editor"),a=r?.getCurrentPostType?.()??null,u=r?.getCurrentPostId?.()??null;if(X(a))return{shouldHide:!1,isTemplateSurface:!0,isLoopPreview:!1};if(!Boolean(s&&c)||null===u||Number(s)===Number(u))return t;const p=n?e(d.store).getBlock(n):null,f=ne(e,p?.name,l,p?.innerBlocks??[],{postId:s,postType:c},n);if(null!==f)return{shouldHide:f.every(Q),isTemplateSurface:!1,isLoopPreview:!0};if(!i)return t;const m=e(K.store).getEntityRecord("postType",c,s);return{shouldHide:!!(i.startsWith("_")||m?.meta&&Object.prototype.hasOwnProperty.call(m.meta,i))&&Q(te(e,i,{postType:c,postId:s})),isTemplateSurface:!1,isLoopPreview:!0}},[o,i,l,n,s,c])}const oe=window.wp.editor,ie=(0,l.memo)(({title:e,postType:n,children:r,buttonText:o="Edit Meta Details",currentPostType:i})=>{const[a,s]=(0,l.useState)(!1);return n&&n!==i?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(oe.PluginPostStatusInfo,{children:(0,t.jsx)(p.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>s(!0),style:{flexGrow:1,justifyContent:"center"},children:o})}),a&&(0,t.jsxs)(p.Modal,{title:e||"Meta Details",size:"medium",onRequestClose:()=>s(!1),children:[(0,t.jsx)("div",{style:{padding:"16px"},children:r}),(0,t.jsx)(p.Button,{variant:"secondary",onClick:()=>s(!1),children:"Close"})]})]})}),ae=(0,o.compose)([(0,e.withSelect)(e=>{const{getCurrentPostType:t}=e("core/editor");return{currentPostType:t()}})])(ie),le={text:"var(--wpds-color-foreground-content-neutral, #333333)",muted:"var(--wpds-color-foreground-content-neutral-weak, #757575)",surface:"var(--wpds-color-background-surface-neutral-strong, #ffffff)",surfaceSubtle:"var(--wpds-color-background-surface-neutral-weak, #f0f0f0)",page:"var(--wpds-color-background-surface-neutral, rgb(247, 247, 247))",border:"var(--wpds-color-stroke-surface-neutral, rgb(217, 219, 222))",borderSubtle:"var(--wpds-color-stroke-surface-neutral-weak, #f0f0f0)",brand:"var(--wpds-color-foreground-interactive-brand, var(--wp-admin-theme-color, #3858e9))",brandFill:"var(--wpds-color-background-interactive-brand-strong, var(--wp-admin-theme-color, #3858e9))",brandFillHover:"var(--wpds-color-background-interactive-brand-strong-active, var(--wp-admin-theme-color-darker-10, #2145e6))",brandStroke:"var(--wpds-color-stroke-interactive-brand, var(--wp-admin-theme-color, #3858e9))",onBrand:"var(--wpds-color-foreground-interactive-brand-strong, #ffffff)",secondary:"var(--kitaris-admin-color-secondary, #0F9C90)"},se=window.React;var ce=i.n(se);const ue=window.ReactDOM,de="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function pe(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function fe(e){return"nodeType"in e}function me(e){var t,n;return e?pe(e)?e:fe(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function he(e){const{Document:t}=me(e);return e instanceof t}function ge(e){return!pe(e)&&e instanceof me(e).HTMLElement}function be(e){return e instanceof me(e).SVGElement}function xe(e){return e?pe(e)?e.document:fe(e)?he(e)?e:ge(e)||be(e)?e.ownerDocument:document:document:document}const ve=de?se.useLayoutEffect:se.useEffect;function ye(e){const t=(0,se.useRef)(e);return ve(()=>{t.current=e}),(0,se.useCallback)(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function we(e,t){void 0===t&&(t=[e]);const n=(0,se.useRef)(e);return ve(()=>{n.current!==e&&(n.current=e)},t),n}function _e(e,t){const n=(0,se.useRef)();return(0,se.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Se(e){const t=ye(e),n=(0,se.useRef)(null),r=(0,se.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Ce(e){const t=(0,se.useRef)();return(0,se.useEffect)(()=>{t.current=e},[e]),t.current}let ke={};function Te(e,t){return(0,se.useMemo)(()=>{if(t)return t;const n=null==ke[e]?0:ke[e]+1;return ke[e]=n,e+"-"+n},[e,t])}function Ie(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t},{...t})}}const Ee=Ie(1),De=Ie(-1);function Re(e){if(!e)return!1;const{KeyboardEvent:t}=me(e.target);return t&&e instanceof t}function Ae(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=me(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[je.Translate.toString(e),je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ne="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Oe(e){return e.matches(Ne)?e:e.querySelector(Ne)}const Me={display:"none"};function Pe(e){let{id:t,value:n}=e;return ce().createElement("div",{id:t,style:Me},n)}function ze(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return ce().createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const Le=(0,se.createContext)(null),Be={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Fe={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $e(e){let{announcements:t=Fe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Be}=e;const{announce:i,announcement:a}=function(){const[e,t]=(0,se.useState)("");return{announce:(0,se.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),l=Te("DndLiveRegion"),[s,c]=(0,se.useState)(!1);if((0,se.useEffect)(()=>{c(!0)},[]),function(e){const t=(0,se.useContext)(Le);(0,se.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,se.useMemo)(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t])),!s)return null;const u=ce().createElement(ce().Fragment,null,ce().createElement(Pe,{id:r,value:o.draggable}),ce().createElement(ze,{id:l,announcement:a}));return n?(0,ue.createPortal)(u,n):u}var Ue;function He(){}function We(e,t){return(0,se.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function Ve(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,se.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Ue||(Ue={}));const Ye=Object.freeze({x:0,y:0});function Ge(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function qe(e,t){const n=Ae(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function Ke(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Xe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Ze(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Je(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function Qe(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const et=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Qe(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ge(Qe(r),o);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Ke)};function tt(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const nt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=tt(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Xe)};function rt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ye}function ot(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const it=ot(1);function at(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const lt={ignoreTransform:!1};function st(e,t){void 0===t&&(t=lt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=me(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=at(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:s}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:s}}function ct(e){return st(e,{ignoreTransform:!0})}function ut(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(he(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ge(o)||be(o))return n;if(n.includes(o))return n;const i=me(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=me(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=me(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function dt(e){const[t]=ut(e,1);return null!=t?t:null}function pt(e){return de&&e?pe(e)?e:fe(e)?he(e)||e===xe(e).scrollingElement?window:ge(e)?e:null:null:null}function ft(e){return pe(e)?e.scrollX:e.scrollLeft}function mt(e){return pe(e)?e.scrollY:e.scrollTop}function ht(e){return{x:ft(e),y:mt(e)}}var gt;function bt(e){return!(!de||!e)&&e===document.scrollingElement}function xt(e){const t={x:0,y:0},n=bt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(gt||(gt={}));const vt={x:.2,y:.2};function yt(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=vt);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=xt(e),f={x:0,y:0},m={x:0,y:0},h=t.height*o.y,g=t.width*o.x;return!c&&i<=t.top+h?(f.y=gt.Backward,m.y=r*Math.abs((t.top+h-i)/h)):!u&&s>=t.bottom-h&&(f.y=gt.Forward,m.y=r*Math.abs((t.bottom-h-s)/h)),!p&&l>=t.right-g?(f.x=gt.Forward,m.x=r*Math.abs((t.right-g-l)/g)):!d&&a<=t.left+g&&(f.x=gt.Backward,m.x=r*Math.abs((t.left+g-a)/g)),{direction:f,speed:m}}function wt(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function _t(e){return e.reduce((e,t)=>Ee(e,ht(t)),Ye)}function St(e,t){if(void 0===t&&(t=st),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);dt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ct=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+ft(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+mt(t),0)}]];class kt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ut(t),r=_t(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Ct)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Tt{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function It(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var Et,Dt;function Rt(e){e.preventDefault()}function At(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Et||(Et={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(Dt||(Dt={}));const jt={start:[Dt.Space,Dt.Enter],cancel:[Dt.Esc],end:[Dt.Space,Dt.Enter,Dt.Tab]},Nt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Dt.Right:return{...n,x:n.x+25};case Dt.Left:return{...n,x:n.x-25};case Dt.Down:return{...n,y:n.y+25};case Dt.Up:return{...n,y:n.y-25}}};class Ot{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Tt(xe(t)),this.windowListeners=new Tt(me(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Et.Resize,this.handleCancel),this.windowListeners.add(Et.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Et.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&St(n),t(Ye)}handleKeyDown(e){if(Re(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=jt,coordinateGetter:i=Nt,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:s}=n.current,c=s?{x:s.left,y:s.top}:Ye;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=De(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:s,isBottom:c,maxScroll:d,minScroll:p}=xt(n),f=wt(n),m={x:Math.min(o===Dt.Right?f.right-f.width/2:f.right,Math.max(o===Dt.Right?f.left:f.left+f.width/2,u.x)),y:Math.min(o===Dt.Down?f.bottom-f.height/2:f.bottom,Math.max(o===Dt.Down?f.top:f.top+f.height/2,u.y))},h=o===Dt.Right&&!l||o===Dt.Left&&!s,g=o===Dt.Down&&!c||o===Dt.Up&&!i;if(h&&m.x!==u.x){const e=n.scrollLeft+t.x,i=o===Dt.Right&&e<=d.x||o===Dt.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Dt.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&m.y!==u.y){const e=n.scrollTop+t.y,i=o===Dt.Down&&e<=d.y||o===Dt.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Dt.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Ee(De(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Mt(e){return Boolean(e&&"distance"in e)}function Pt(e){return Boolean(e&&"delay"in e)}Ot.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=jt,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class zt{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=me(e);return e instanceof t?e:xe(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=xe(i),this.documentListeners=new Tt(this.document),this.listeners=new Tt(n),this.windowListeners=new Tt(me(i)),this.initialCoordinates=null!=(r=Ae(o))?r:Ye,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Et.Resize,this.handleCancel),this.windowListeners.add(Et.DragStart,Rt),this.windowListeners.add(Et.VisibilityChange,this.handleCancel),this.windowListeners.add(Et.ContextMenu,Rt),this.documentListeners.add(Et.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Pt(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(Mt(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Et.Click,At,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Et.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=Ae(e))?t:Ye,s=De(r,l);if(!n&&a){if(Mt(a)){if(null!=a.tolerance&&It(s,a.tolerance))return this.handleCancel();if(It(s,a.distance))return this.handleStart()}return Pt(a)&&It(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Dt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Lt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Bt extends zt{constructor(e){const{event:t}=e,n=xe(t.target);super(e,Lt,n)}}Bt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const Ft={move:{name:"mousemove"},end:{name:"mouseup"}};var $t;!function(e){e[e.RightClick=2]="RightClick"}($t||($t={})),class extends zt{constructor(e){super(e,Ft,xe(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==$t.RightClick&&(null==r||r({event:n}),!0)}}];const Ut={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var Ht,Wt;(class extends zt{constructor(e){super(e,Ut)}static setup(){return window.addEventListener(Ut.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ut.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Ht||(Ht={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Wt||(Wt={}));const Vt={x:{[gt.Backward]:!1,[gt.Forward]:!1},y:{[gt.Backward]:!1,[gt.Forward]:!1}};var Yt,Gt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Yt||(Yt={})),function(e){e.Optimized="optimized"}(Gt||(Gt={}));const qt=new Map;function Kt(e,t){return _e(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function Xt(e){let{callback:t,disabled:n}=e;const r=ye(t),o=(0,se.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return(0,se.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Zt(e){return new kt(st(e),e)}function Jt(e,t,n){void 0===t&&(t=Zt);const[r,o]=(0,se.useState)(null);function i(){o(r=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}const a=function(e){let{callback:t,disabled:n}=e;const r=ye(t),o=(0,se.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,se.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),l=Xt({callback:i});return ve(()=>{i(),e?(null==l||l.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==a||a.disconnect())},[e]),r}const Qt=[];function en(e,t){void 0===t&&(t=[]);const n=(0,se.useRef)(null);return(0,se.useEffect)(()=>{n.current=null},t),(0,se.useEffect)(()=>{const t=e!==Ye;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?De(e,n.current):Ye}function tn(e){return(0,se.useMemo)(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const nn=[];function rn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ge(t)?t:e}const on=[{sensor:Bt,options:{}},{sensor:Ot,options:{}}],an={current:{}},ln={draggable:{measure:ct},droppable:{measure:ct,strategy:Yt.WhileDragging,frequency:Gt.Optimized},dragOverlay:{measure:st}};class sn extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const cn={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:He},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ln,measureDroppableContainers:He,windowRect:null,measuringScheduled:!1},un={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:He,draggableNodes:new Map,over:null,measureDroppableContainers:He},dn=(0,se.createContext)(un),pn=(0,se.createContext)(cn);function fn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sn}}}function mn(e,t){switch(t.type){case Ue.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ue.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Ue.DragEnd:case Ue.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ue.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new sn(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Ue.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new sn(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Ue.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new sn(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function hn(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=(0,se.useContext)(dn),i=Ce(r),a=Ce(null==n?void 0:n.id);return(0,se.useEffect)(()=>{if(!t&&!r&&i&&null!=a){if(!Re(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Oe(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function gn(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const bn=(0,se.createContext)({...Ye,scaleX:1,scaleY:1});var xn;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(xn||(xn={}));const vn=(0,se.memo)(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:l=!0,children:s,sensors:c=on,collisionDetection:u=nt,measuring:d,modifiers:p,...f}=e;const m=(0,se.useReducer)(mn,void 0,fn),[h,g]=m,[b,x]=function(){const[e]=(0,se.useState)(()=>new Set),t=(0,se.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]),n=(0,se.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]);return[n,t]}(),[v,y]=(0,se.useState)(xn.Uninitialized),w=v===xn.Initialized,{draggable:{active:_,nodes:S,translate:C},droppable:{containers:k}}=h,T=null!=_?S.get(_):null,I=(0,se.useRef)({initial:null,translated:null}),E=(0,se.useMemo)(()=>{var e;return null!=_?{id:_,data:null!=(e=null==T?void 0:T.data)?e:an,rect:I}:null},[_,T]),D=(0,se.useRef)(null),[R,A]=(0,se.useState)(null),[j,N]=(0,se.useState)(null),O=we(f,Object.values(f)),M=Te("DndDescribedBy",i),P=(0,se.useMemo)(()=>k.getEnabled(),[k]),z=(L=d,(0,se.useMemo)(()=>({draggable:{...ln.draggable,...null==L?void 0:L.draggable},droppable:{...ln.droppable,...null==L?void 0:L.droppable},dragOverlay:{...ln.dragOverlay,...null==L?void 0:L.dragOverlay}}),[null==L?void 0:L.draggable,null==L?void 0:L.droppable,null==L?void 0:L.dragOverlay]));var L;const{droppableRects:B,measureDroppableContainers:F,measuringScheduled:$}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=(0,se.useState)(null),{frequency:l,measure:s,strategy:c}=o,u=(0,se.useRef)(e),d=function(){switch(c){case Yt.Always:return!1;case Yt.BeforeDragging:return n;default:return!n}}(),p=we(d),f=(0,se.useCallback)(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),m=(0,se.useRef)(null),h=_e(t=>{if(d&&!n)return qt;if(!t||t===qt||u.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new kt(s(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,s]);return(0,se.useEffect)(()=>{u.current=e},[e]),(0,se.useEffect)(()=>{d||f()},[n,d]),(0,se.useEffect)(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),(0,se.useEffect)(()=>{d||"number"!=typeof l||null!==m.current||(m.current=setTimeout(()=>{f(),m.current=null},l))},[l,d,f,...r]),{droppableRects:h,measureDroppableContainers:f,measuringScheduled:null!=i}}(P,{dragging:w,dependencies:[C.x,C.y],config:z.droppable}),U=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return _e(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(S,_),H=(0,se.useMemo)(()=>j?Ae(j):null,[j]),W=function(){const e=!1===(null==R?void 0:R.autoScrollEnabled),t="object"==typeof l?!1===l.enabled:!1===l,n=w&&!e&&!t;return"object"==typeof l?{...l,enabled:n}:{enabled:n}}(),V=function(e,t){return Kt(e,t)}(U,z.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=(0,se.useRef)(!1),{x:a,y:l}="boolean"==typeof o?{x:o,y:o}:o;ve(()=>{if(!a&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=rt(n(e),r);if(a||(o.x=0),l||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=dt(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,l,r,n])}({activeNode:null!=_?S.get(_):null,config:W.layoutShiftCompensation,initialRect:V,measure:z.draggable.measure});const Y=Jt(U,z.draggable.measure,V),G=Jt(U?U.parentElement:null),q=(0,se.useRef)({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),K=k.getNodeFor(null==(t=q.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,r]=(0,se.useState)(null),o=(0,se.useCallback)(e=>{for(const{target:n}of e)if(ge(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),i=Xt({callback:o}),a=(0,se.useCallback)(e=>{const n=rn(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[l,s]=Se(a);return(0,se.useMemo)(()=>({nodeRef:l,rect:n,setRef:s}),[n,l,s])}({measure:z.dragOverlay.measure}),Z=null!=(n=X.nodeRef.current)?n:U,J=w?null!=(r=X.rect)?r:Y:null,Q=Boolean(X.nodeRef.current&&X.rect),ee=rt(te=Q?null:Y,Kt(te));var te;const ne=tn(Z?me(Z):null),re=function(e){const t=(0,se.useRef)(e),n=_e(n=>e?n&&n!==Qt&&e&&t.current&&e.parentNode===t.current.parentNode?n:ut(e):Qt,[e]);return(0,se.useEffect)(()=>{t.current=e},[e]),n}(w?null!=K?K:U:null),oe=function(e,t){void 0===t&&(t=st);const[n]=e,r=tn(n?me(n):null),[o,i]=(0,se.useState)(nn);function a(){i(()=>e.length?e.map(e=>bt(e)?r:new kt(t(e),e)):nn)}const l=Xt({callback:a});return ve(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(re),ie=gn(p,{transform:{x:C.x-ee.x,y:C.y-ee.y,scaleX:1,scaleY:1},activatorEvent:j,active:E,activeNodeRect:Y,containerNodeRect:G,draggingNodeRect:J,over:q.current.over,overlayNodeRect:X.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=H?Ee(H,C):null,le=function(e){const[t,n]=(0,se.useState)(null),r=(0,se.useRef)(e),o=(0,se.useCallback)(e=>{const t=pt(e.target);t&&n(e=>e?(e.set(t,ht(t)),new Map(e)):null)},[]);return(0,se.useEffect)(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=pt(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,ht(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=pt(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),(0,se.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Ee(e,t),Ye):_t(e):Ye,[e,t])}(re),pe=en(le),fe=en(le,[Y]),he=Ee(ie,pe),be=J?it(J,ie):null,xe=E&&be?u({active:E,collisionRect:be,droppableRects:B,droppableContainers:P,pointerCoordinates:ae}):null,ye=Je(xe,"id"),[ke,Ie]=(0,se.useState)(null),De=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Q?ie:Ee(ie,fe),null!=(o=null==ke?void 0:ke.rect)?o:null,Y),Re=(0,se.useRef)(null),je=(0,se.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==D.current)return;const o=S.get(D.current);if(!o)return;const i=e.nativeEvent,a=new n({active:D.current,activeNode:o,event:i,options:r,context:q,onAbort(e){if(!S.get(e))return;const{onDragAbort:t}=O.current,n={id:e};null==t||t(n),b({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!S.get(e))return;const{onDragPending:o}=O.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),b({type:"onDragPending",event:i})},onStart(e){const t=D.current;if(null==t)return;const n=S.get(t);if(!n)return;const{onDragStart:r}=O.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:I}};(0,ue.unstable_batchedUpdates)(()=>{null==r||r(o),y(xn.Initializing),g({type:Ue.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:o}),A(Re.current),N(i)})},onMove(e){g({type:Ue.DragMove,coordinates:e})},onEnd:l(Ue.DragEnd),onCancel:l(Ue.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=q.current;let a=null;if(t&&o){const{cancelDrop:l}=O.current;a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Ue.DragEnd&&"function"==typeof l&&await Promise.resolve(l(a))&&(e=Ue.DragCancel)}D.current=null,(0,ue.unstable_batchedUpdates)(()=>{g({type:e}),y(xn.Uninitialized),Ie(null),A(null),N(null),Re.current=null;const t=e===Ue.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=O.current[t];null==e||e(a),b({type:t,event:a})}})}}Re.current=a},[S]),Ne=(0,se.useCallback)((e,t)=>(n,r)=>{const o=n.nativeEvent,i=S.get(r);if(null!==D.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},D.current=r,je(n,t))},[S,je]),Oe=function(e,t){return(0,se.useMemo)(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,Ne);!function(e){(0,se.useEffect)(()=>{if(!de)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),ve(()=>{Y&&v===xn.Initializing&&y(xn.Initialized)},[Y,v]),(0,se.useEffect)(()=>{const{onDragMove:e}=O.current,{active:t,activatorEvent:n,collisions:r,over:o}=q.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:he.x,y:he.y},over:o};(0,ue.unstable_batchedUpdates)(()=>{null==e||e(i),b({type:"onDragMove",event:i})})},[he.x,he.y]),(0,se.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=q.current;if(!e||null==D.current||!t||!o)return;const{onDragOver:i}=O.current,a=r.get(ye),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};(0,ue.unstable_batchedUpdates)(()=>{Ie(l),null==i||i(s),b({type:"onDragOver",event:s})})},[ye]),ve(()=>{q.current={activatorEvent:j,active:E,activeNode:U,collisionRect:be,collisions:xe,droppableRects:B,draggableNodes:S,draggingNode:Z,draggingNodeRect:J,droppableContainers:k,over:ke,scrollableAncestors:re,scrollAdjustedTranslate:he},I.current={initial:J,translated:be}},[E,U,xe,be,S,Z,J,B,k,ke,re,he]),function(e){let{acceleration:t,activator:n=Ht.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=Wt.TreeOrder,pointerCoordinates:s,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const f=function(e){let{delta:t,disabled:n}=e;const r=Ce(t);return _e(e=>{if(n||!r||!e)return Vt;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[gt.Backward]:e.x[gt.Backward]||-1===o,[gt.Forward]:e.x[gt.Forward]||1===o},y:{[gt.Backward]:e.y[gt.Backward]||-1===i,[gt.Forward]:e.y[gt.Forward]||1===i}}},[n,t,r])}({delta:d,disabled:!i}),[m,h]=function(){const e=(0,se.useRef)(null);return[(0,se.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,se.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),g=(0,se.useRef)({x:0,y:0}),b=(0,se.useRef)({x:0,y:0}),x=(0,se.useMemo)(()=>{switch(n){case Ht.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case Ht.DraggableRect:return o}},[n,o,s]),v=(0,se.useRef)(null),y=(0,se.useCallback)(()=>{const e=v.current;if(!e)return;const t=g.current.x*b.current.x,n=g.current.y*b.current.y;e.scrollBy(t,n)},[]),w=(0,se.useMemo)(()=>l===Wt.TreeOrder?[...c].reverse():c,[l,c]);(0,se.useEffect)(()=>{if(i&&c.length&&x){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:l}=yt(e,o,x,t,p);for(const e of["x","y"])f[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return h(),v.current=e,m(y,a),g.current=l,void(b.current=i)}g.current={x:0,y:0},b.current={x:0,y:0},h()}else h()},[t,y,r,h,i,a,JSON.stringify(x),JSON.stringify(f),m,c,w,u,JSON.stringify(p)])}({...W,delta:C,draggingRect:be,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const Me=(0,se.useMemo)(()=>({active:E,activeNode:U,activeNodeRect:Y,activatorEvent:j,collisions:xe,containerNodeRect:G,dragOverlay:X,draggableNodes:S,droppableContainers:k,droppableRects:B,over:ke,measureDroppableContainers:F,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:z,measuringScheduled:$,windowRect:ne}),[E,U,Y,j,xe,G,X,S,k,B,ke,F,re,oe,z,$,ne]),Pe=(0,se.useMemo)(()=>({activatorEvent:j,activators:Oe,active:E,activeNodeRect:Y,ariaDescribedById:{draggable:M},dispatch:g,draggableNodes:S,over:ke,measureDroppableContainers:F}),[j,Oe,E,Y,g,M,S,ke,F]);return ce().createElement(Le.Provider,{value:x},ce().createElement(dn.Provider,{value:Pe},ce().createElement(pn.Provider,{value:Me},ce().createElement(bn.Provider,{value:De},s)),ce().createElement(hn,{disabled:!1===(null==a?void 0:a.restoreFocus)})),ce().createElement($e,{...a,hiddenTextDescribedById:M}))}),yn=(0,se.createContext)(null),wn="button";function Sn(){return(0,se.useContext)(pn)}const Cn={timeout:25};function kn(e){let{animation:t,children:n}=e;const[r,o]=(0,se.useState)(null),[i,a]=(0,se.useState)(null),l=Ce(n);return n||r||!l||o(l),ve(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),ce().createElement(ce().Fragment,null,n,r?(0,se.cloneElement)(r,{ref:a}):null)}const Tn={x:0,y:0,scaleX:1,scaleY:1};function In(e){let{children:t}=e;return ce().createElement(dn.Provider,{value:un},ce().createElement(bn.Provider,{value:Tn},t))}const En={position:"fixed",touchAction:"none"},Dn=e=>Re(e)?"transform 250ms ease":void 0,Rn=(0,se.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:l,style:s,transform:c,transition:u=Dn}=e;if(!l)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...En,width:l.width,height:l.height,top:l.top,left:l.left,transform:je.Transform.toString(d),transformOrigin:o&&r?qe(r,l):void 0,transition:"function"==typeof u?u(r):u,...s};return ce().createElement(n,{className:a,style:p,ref:t},i)}),An=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,t]of Object.entries(i.active))void 0!==t&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=i&&i.dragOverlay)for(const[e,t]of Object.entries(i.dragOverlay))void 0!==t&&r.node.style.setProperty(e,t);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},jn={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:je.Transform.toString(t)},{transform:je.Transform.toString(n)}]},sideEffects:An({styles:{active:{opacity:"0"}}})};let Nn=0;function On(e){return(0,se.useMemo)(()=>{if(null!=e)return Nn++,Nn},[e])}const Mn=ce().memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:a,wrapperElement:l="div",className:s,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:f,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:b,measuringConfiguration:x,scrollableAncestors:v,scrollableAncestorRects:y,windowRect:w}=Sn(),_=(0,se.useContext)(bn),S=On(null==d?void 0:d.id),C=gn(a,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:f,draggingNodeRect:g.rect,over:b,overlayNodeRect:g.rect,scrollableAncestors:v,scrollableAncestorRects:y,transform:_,windowRect:w}),k=Kt(p),T=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return ye((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const l=a.node.current;if(!l)return;const s=rn(i);if(!s)return;const{transform:c}=me(i).getComputedStyle(i),u=at(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...jn,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...s}=e;if(!t)return;const c=a.rect.left-i.rect.left,u=a.rect.top-i.rect.top,d={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},p={x:l.x-c,y:l.y-u,...d},f=o({...s,active:i,dragOverlay:a,transform:{initial:l,final:p}}),[m]=f,h=f[f.length-1];if(JSON.stringify(m)===JSON.stringify(h))return;const g=null==r?void 0:r({active:i,dragOverlay:a,...s}),b=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{b.onfinish=()=>{null==g||g(),e()}})}}(t);return St(l,o.draggable.measure),d({active:{id:e,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(s)},droppableContainers:r,measuringConfiguration:o,transform:u})})}({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:x}),I=k?g.setRef:void 0;return ce().createElement(In,null,ce().createElement(kn,{animation:T},d&&S?ce().createElement(Rn,{key:S,id:d.id,ref:I,as:l,activatorEvent:u,adjustScale:t,className:s,transition:i,rect:k,style:{zIndex:c,...o},transform:C},n):null))});const Pn=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?function(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(r,n,t):r},zn=e=>{let{transform:t}=e;return{...t,x:0}};function Ln(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Bn(e,t){return e.reduce((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e},Array(e.length))}function Fn(e){return null!==e&&e>=0}const $n=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Ln(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},Un={scaleX:1,scaleY:1},Hn=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:n<a?e.top+e.height-(l.top+l.height):e.top-l.top,...Un}:null}const s=function(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}(i,o,n);return o>n&&o<=a?{x:0,y:-l.height-s,...Un}:o<n&&o>=a?{x:0,y:l.height+s,...Un}:{x:0,y:0,...Un}},Wn="Sortable",Vn=ce().createContext({activeIndex:-1,containerId:Wn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$n,disabled:{draggable:!1,droppable:!1}});function Yn(e){let{children:t,id:n,items:r,strategy:o=$n,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:s,over:c,measureDroppableContainers:u}=Sn(),d=Te(Wn,n),p=Boolean(null!==l.rect),f=(0,se.useMemo)(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),m=null!=a,h=a?f.indexOf(a.id):-1,g=c?f.indexOf(c.id):-1,b=(0,se.useRef)(f),x=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(f,b.current),v=-1!==g&&-1===h||x,y=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);ve(()=>{x&&m&&u(f)},[x,f,m,u]),(0,se.useEffect)(()=>{b.current=f},[f]);const w=(0,se.useMemo)(()=>({activeIndex:h,containerId:d,disabled:y,disableTransforms:v,items:f,overIndex:g,useDragOverlay:p,sortedRects:Bn(f,s),strategy:o}),[h,d,y.draggable,y.droppable,v,f,g,s,p,o]);return ce().createElement(Vn.Provider,{value:w},t)}const Gn=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Ln(n,r,o).indexOf(t)},qn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:c}=e;return!(!c||!r||l!==i&&o===a||!n&&(a===o||t!==s))},Kn={duration:200,easing:"ease"},Xn="transform",Zn=je.Transition.toString({property:Xn,duration:0,easing:"linear"}),Jn={roleDescription:"sortable"};function Qn(e){let{animateLayoutChanges:t=qn,attributes:n,disabled:r,data:o,getNewIndex:i=Gn,id:a,strategy:l,resizeObserverConfig:s,transition:c=Kn}=e;const{items:u,containerId:d,activeIndex:p,disabled:f,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:b,strategy:x}=(0,se.useContext)(Vn),v=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,f),y=u.indexOf(a),w=(0,se.useMemo)(()=>({sortable:{containerId:d,index:y,items:u},...o}),[d,o,y,u]),_=(0,se.useMemo)(()=>u.slice(u.indexOf(a)),[u,a]),{rect:S,node:C,isOver:k,setNodeRef:T}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Te("Droppable"),{active:a,dispatch:l,over:s,measureDroppableContainers:c}=(0,se.useContext)(dn),u=(0,se.useRef)({disabled:n}),d=(0,se.useRef)(!1),p=(0,se.useRef)(null),f=(0,se.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Cn,...o},b=we(null!=h?h:r),x=Xt({callback:(0,se.useCallback)(()=>{d.current?(null!=f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),f.current=null},g)):d.current=!0},[g]),disabled:m||!a}),v=(0,se.useCallback)((e,t)=>{x&&(t&&(x.unobserve(t),d.current=!1),e&&x.observe(e))},[x]),[y,w]=Se(v),_=we(t);return(0,se.useEffect)(()=>{x&&y.current&&(x.disconnect(),d.current=!1,x.observe(y.current))},[y,x]),(0,se.useEffect)(()=>(l({type:Ue.RegisterDroppable,element:{id:r,key:i,disabled:n,node:y,rect:p,data:_}}),()=>l({type:Ue.UnregisterDroppable,key:i,id:r})),[r]),(0,se.useEffect)(()=>{n!==u.current.disabled&&(l({type:Ue.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,l]),{active:a,rect:p,isOver:(null==s?void 0:s.id)===r,node:y,over:s,setNodeRef:w}}({id:a,data:w,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...s}}),{active:I,activatorEvent:E,activeNodeRect:D,attributes:R,setNodeRef:A,listeners:j,isDragging:N,over:O,setActivatorNodeRef:M,transform:P}=function(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Te("Draggable"),{activators:a,activatorEvent:l,active:s,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=(0,se.useContext)(dn),{role:f=wn,roleDescription:m="draggable",tabIndex:h=0}=null!=o?o:{},g=(null==s?void 0:s.id)===t,b=(0,se.useContext)(g?bn:yn),[x,v]=Se(),[y,w]=Se(),_=function(e,t){return(0,se.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),S=we(n);return ve(()=>(d.set(t,{id:t,key:i,node:x,activatorNode:y,data:S}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]),{active:s,activatorEvent:l,activeNodeRect:c,attributes:(0,se.useMemo)(()=>({role:f,tabIndex:h,"aria-disabled":r,"aria-pressed":!(!g||f!==wn)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,f,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:_,node:x,over:p,setNodeRef:v,setActivatorNodeRef:w,transform:b}}({id:a,data:w,attributes:{...Jn,...n},disabled:v.draggable}),z=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,se.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(T,A),L=Boolean(I),B=L&&!m&&Fn(p)&&Fn(g),F=!b&&N,$=F&&B?P:null,U=B?null!=$?$:(null!=l?l:x)({rects:h,activeNodeRect:D,activeIndex:p,overIndex:g,index:y}):null,H=Fn(p)&&Fn(g)?i({id:a,items:u,activeIndex:p,overIndex:g}):y,W=null==I?void 0:I.id,V=(0,se.useRef)({activeId:W,items:u,newIndex:H,containerId:d}),Y=u!==V.current.items,G=t({active:I,containerId:d,isDragging:N,isSorting:L,id:a,index:y,items:u,newIndex:V.current.newIndex,previousItems:V.current.items,previousContainerId:V.current.containerId,transition:c,wasDragging:null!=V.current.activeId}),q=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=(0,se.useState)(null),l=(0,se.useRef)(n);return ve(()=>{if(!t&&n!==l.current&&r.current){const e=o.current;if(e){const t=st(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==l.current&&(l.current=n)},[t,n,r,o]),(0,se.useEffect)(()=>{i&&a(null)},[i]),i}({disabled:!G,index:y,node:C,rect:S});return(0,se.useEffect)(()=>{L&&V.current.newIndex!==H&&(V.current.newIndex=H),d!==V.current.containerId&&(V.current.containerId=d),u!==V.current.items&&(V.current.items=u)},[L,H,d,u]),(0,se.useEffect)(()=>{if(W===V.current.activeId)return;if(null!=W&&null==V.current.activeId)return void(V.current.activeId=W);const e=setTimeout(()=>{V.current.activeId=W},50);return()=>clearTimeout(e)},[W]),{active:I,activeIndex:p,attributes:R,data:w,rect:S,index:y,newIndex:H,items:u,isOver:k,isSorting:L,isDragging:N,listeners:j,node:C,overIndex:g,over:O,setNodeRef:z,setActivatorNodeRef:M,setDroppableNodeRef:T,setDraggableNodeRef:A,transform:null!=q?q:U,transition:q||Y&&V.current.newIndex===y?Zn:F&&!Re(E)||!c?void 0:L||G?je.Transition.toString({...c,property:Xn}):void 0}}function er(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const tr=[Dt.Down,Dt.Right,Dt.Up,Dt.Left],nr=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(tr.includes(e.code)){if(e.preventDefault(),!n||!r)return;const t=[];i.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const i=o.get(n.id);if(i)switch(e.code){case Dt.Down:r.top<i.top&&t.push(n);break;case Dt.Up:r.top>i.top&&t.push(n);break;case Dt.Left:r.left>i.left&&t.push(n);break;case Dt.Right:r.left<i.left&&t.push(n)}});const u=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ze(t),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=Ze(r),a=o.reduce((e,t,r)=>e+Ge(n[r],t),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(Ke)})({active:n,collisionRect:r,droppableRects:o,droppableContainers:t,pointerCoordinates:null});let d=Je(u,"id");if(d===(null==a?void 0:a.id)&&u.length>1&&(d=u[1].id),null!=d){const e=i.get(n.id),t=i.get(d),a=t?o.get(t.id):null,u=null==t?void 0:t.node.current;if(u&&a&&e&&t){const n=ut(u).some((e,t)=>l[t]!==e),o=rr(e,t),i=(c=t,!(!er(s=e)||!er(c))&&!!rr(s,c)&&s.data.current.sortable.index<c.data.current.sortable.index),d=n||!o?{x:0,y:0}:{x:i?r.width-a.width:0,y:i?r.height-a.height:0},p={x:a.left,y:a.top};return d.x&&d.y?p:De(p,d)}}}var s,c};function rr(e,t){return!(!er(e)||!er(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var or=i(556),ir=i.n(or);const ar=S().div`
|
|
88
|
-
.built-repeater__items {
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: 1.5rem;
|
|
92
|
-
margin-bottom: 3rem;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&.wpcl-repeater--collapsible .built-repeater__items {
|
|
96
|
-
gap: 0.75rem;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.built-repeater__empty-state {
|
|
100
|
-
padding: 1rem;
|
|
101
|
-
background: #f0f0f0;
|
|
102
|
-
border-radius: 4px;
|
|
103
|
-
margin-bottom: 1rem;
|
|
104
|
-
opacity: 0.75;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.built-repeater__drag-overlay {
|
|
108
|
-
opacity: 0.95;
|
|
109
|
-
box-shadow:
|
|
110
|
-
0 15px 30px rgba(0, 0, 0, 0.15),
|
|
111
|
-
0 5px 15px rgba(0, 0, 0, 0.08);
|
|
112
|
-
border-radius: 8px;
|
|
113
|
-
background: ${le.surface};
|
|
114
|
-
cursor: grabbing;
|
|
115
|
-
transition: transform 0.2s ease;
|
|
116
|
-
|
|
117
|
-
> div {
|
|
118
|
-
background: ${le.surface};
|
|
119
|
-
border-radius: 8px;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
`,lr=S().div`
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: flex-start;
|
|
125
|
-
gap: 1rem;
|
|
126
|
-
background-color: ${le.surface};
|
|
127
|
-
border: 1px solid ${le.border};
|
|
128
|
-
border-radius: 4px;
|
|
129
|
-
padding: 1rem;
|
|
130
|
-
transition: all 0.2s ease;
|
|
131
|
-
position: relative;
|
|
132
|
-
|
|
133
|
-
&.wpcl-repeater__item--dragging {
|
|
134
|
-
opacity: 0.3;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&.wpcl-repeater__item--integrated {
|
|
138
|
-
/* In integrated mode, ensure proper flex layout */
|
|
139
|
-
> * {
|
|
140
|
-
flex-grow: 1;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/* Drag handle, row actions, and remove button should not grow */
|
|
144
|
-
.built-repeater__drag-handle,
|
|
145
|
-
.built-repeater__remove-item,
|
|
146
|
-
.built-repeater__item-action {
|
|
147
|
-
flex-grow: 0;
|
|
148
|
-
flex-shrink: 0;
|
|
149
|
-
margin-top: 26px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.built-repeater__item-action.components-button {
|
|
153
|
-
width: auto;
|
|
154
|
-
min-width: 36px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/* Inline toggles beside labeled TextControl / SelectControl rows. */
|
|
158
|
-
.built-repeater__inline-toggle {
|
|
159
|
-
flex-grow: 0;
|
|
160
|
-
flex-shrink: 0;
|
|
161
|
-
align-self: flex-end;
|
|
162
|
-
|
|
163
|
-
.components-toggle-control {
|
|
164
|
-
margin-bottom: 0;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&.built-repeater__inline-toggle--category-selected
|
|
168
|
-
.components-base-control__help {
|
|
169
|
-
visibility: hidden;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/* Read-only summary rows — meta left, actions right. */
|
|
174
|
-
&:has(.built-repeater__summary) {
|
|
175
|
-
align-items: center;
|
|
176
|
-
justify-content: space-between;
|
|
177
|
-
gap: 1rem;
|
|
178
|
-
|
|
179
|
-
> * {
|
|
180
|
-
flex-grow: 0;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.built-repeater__summary {
|
|
184
|
-
display: flex;
|
|
185
|
-
align-items: center;
|
|
186
|
-
flex-wrap: wrap;
|
|
187
|
-
gap: 0.75rem;
|
|
188
|
-
flex: 1 1 auto;
|
|
189
|
-
min-width: 0;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.built-repeater__summary-actions {
|
|
193
|
-
display: flex;
|
|
194
|
-
align-items: center;
|
|
195
|
-
gap: 0.75rem;
|
|
196
|
-
flex-shrink: 0;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.built-repeater__summary-name {
|
|
200
|
-
flex-shrink: 1;
|
|
201
|
-
min-width: 0;
|
|
202
|
-
font-weight: 500;
|
|
203
|
-
overflow: hidden;
|
|
204
|
-
text-overflow: ellipsis;
|
|
205
|
-
white-space: nowrap;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.built-repeater__drag-handle,
|
|
209
|
-
.built-repeater__remove-item,
|
|
210
|
-
.built-repeater__item-action {
|
|
211
|
-
margin-top: 0;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.built-repeater__item-handle {
|
|
217
|
-
cursor: grab;
|
|
218
|
-
flex-shrink: 0;
|
|
219
|
-
transition:
|
|
220
|
-
transform 0.15s ease,
|
|
221
|
-
opacity 0.15s ease;
|
|
222
|
-
|
|
223
|
-
&:active {
|
|
224
|
-
cursor: grabbing;
|
|
225
|
-
opacity: 0.7;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
button {
|
|
229
|
-
transition:
|
|
230
|
-
background-color 0.15s ease,
|
|
231
|
-
color 0.15s ease;
|
|
232
|
-
|
|
233
|
-
&:hover {
|
|
234
|
-
background-color: ${le.brandFill};
|
|
235
|
-
color: ${le.onBrand};
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.built-repeater__item-content {
|
|
241
|
-
flex-grow: 1;
|
|
242
|
-
width: 100%;
|
|
243
|
-
box-sizing: border-box;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.built-repeater__item-actions {
|
|
247
|
-
flex-shrink: 0;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&.wpcl-repeater__item--collapsible {
|
|
251
|
-
flex-direction: column;
|
|
252
|
-
align-items: stretch;
|
|
253
|
-
gap: 0;
|
|
254
|
-
padding: 0;
|
|
255
|
-
|
|
256
|
-
.built-repeater__item-header {
|
|
257
|
-
display: flex;
|
|
258
|
-
align-items: center;
|
|
259
|
-
gap: 0.75rem;
|
|
260
|
-
padding: 0.75rem 1rem;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
&.wpcl-repeater__item--expanded .built-repeater__item-header {
|
|
264
|
-
border-bottom: 1px solid ${le.border};
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
.built-repeater__summary {
|
|
268
|
-
display: flex;
|
|
269
|
-
align-items: center;
|
|
270
|
-
flex-wrap: wrap;
|
|
271
|
-
gap: 0.75rem;
|
|
272
|
-
flex: 1 1 auto;
|
|
273
|
-
min-width: 0;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.built-repeater__summary-name {
|
|
277
|
-
flex-shrink: 1;
|
|
278
|
-
min-width: 0;
|
|
279
|
-
font-weight: 500;
|
|
280
|
-
overflow: hidden;
|
|
281
|
-
text-overflow: ellipsis;
|
|
282
|
-
white-space: nowrap;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.built-repeater__item-header .components-toggle-control {
|
|
286
|
-
margin-bottom: 0;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.built-repeater__item-toggle,
|
|
290
|
-
.built-repeater__item-handle,
|
|
291
|
-
.built-repeater__item-actions,
|
|
292
|
-
.built-repeater__drag-handle,
|
|
293
|
-
.built-repeater__remove-item {
|
|
294
|
-
flex-shrink: 0;
|
|
295
|
-
margin-top: 0;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.built-repeater__item-content {
|
|
299
|
-
padding: 1rem;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
`,sr=S().div`
|
|
303
|
-
margin-top: 26px;
|
|
304
|
-
flex-shrink: 0;
|
|
305
|
-
`,cr={variant:"secondary",iconSize:20},ur=(0,l.createContext)(),dr=({label:e=(0,m.__)("Drag to reorder","wp-component-library"),...n})=>{const r=(0,l.useContext)(ur);if(!r)return console.warn("DragHandle must be used within a Repeater item"),null;const{attributes:o,listeners:i}=r;return(0,t.jsx)(sr,{className:"built-repeater__drag-handle",...o,...i,children:(0,t.jsx)(p.Button,{icon:f.dragHandle,label:e,tabIndex:-1,...cr,...n})})},pr=({label:e=(0,m.__)("Remove","wp-component-library"),...n})=>{const r=(0,l.useContext)(ur);if(!r)return console.warn("RemoveButton must be used within a Repeater item"),null;const{onRemove:o,id:i,canRemove:a}=r;return a?(0,t.jsx)(p.Button,{className:"built-repeater__remove-item",label:e,icon:f.trash,isDestructive:!0,onClick:()=>o(i),...cr,...n}):null},fr=({isExpanded:e,onToggle:n})=>(0,t.jsx)(p.Button,{className:"built-repeater__item-toggle",icon:e?f.chevronUp:f.chevronDown,label:e?(0,m.__)("Collapse","wp-component-library"):(0,m.__)("Expand","wp-component-library"),onClick:e=>{e.preventDefault(),e.stopPropagation(),n?.()},"aria-expanded":e,...cr}),mr=({id:e,children:n,onRemove:r,canRemove:o,isDragOverlay:i=!1,renderMode:a="default",enableReorder:l=!0,collapsible:s=!1,isExpanded:c=!1,onToggle:u,summary:d=null})=>{const{attributes:h,listeners:g,setNodeRef:b,transform:x,transition:v,isDragging:y}=Qn({id:e,disabled:!l}),w={transform:je.Transform.toString(x),transition:v},_=l?{...h,...g}:{},S={attributes:l?h:{},listeners:l?g:{},onRemove:r,id:e,canRemove:o},C=["integrated"!==a||s?"":"wpcl-repeater__item--integrated",s?"wpcl-repeater__item--collapsible":"",s&&c?"wpcl-repeater__item--expanded":"",y?"wpcl-repeater__item--dragging":""].filter(Boolean).join(" ");return s?(0,t.jsx)(ur.Provider,{value:S,children:(0,t.jsxs)(lr,{ref:b,style:w,className:C,children:[(0,t.jsxs)("div",{className:"built-repeater__item-header",children:[l&&(0,t.jsx)(dr,{}),d?(0,t.jsx)("div",{className:"built-repeater__summary",children:d}):(0,t.jsx)("div",{className:"built-repeater__summary"}),!i&&(0,t.jsx)(fr,{isExpanded:c,onToggle:u}),!i&&(0,t.jsx)(pr,{})]}),c&&n?(0,t.jsx)("div",{className:"built-repeater__item-content",children:n}):null]})}):"integrated"===a?(0,t.jsx)(ur.Provider,{value:S,children:(0,t.jsx)(lr,{ref:b,style:w,className:"wpcl-repeater__item--integrated "+(y?"wpcl-repeater__item--dragging":""),children:n})}):(0,t.jsxs)(lr,{ref:b,style:w,className:y?"wpcl-repeater__item--dragging":"",children:[l&&(0,t.jsx)("div",{className:"built-repeater__item-handle",..._,children:(0,t.jsx)(p.Button,{icon:f.dragHandle,label:(0,m.__)("Drag to reorder","wp-component-library"),tabIndex:-1,...cr})}),(0,t.jsx)("div",{className:"built-repeater__item-content",children:n}),!i&&o&&(0,t.jsx)("div",{className:"built-repeater__item-actions",children:(0,t.jsx)(p.Button,{label:(0,m.__)("Remove","wp-component-library"),icon:f.trash,isDestructive:!0,onClick:()=>r(e),...cr})})]})},hr=({items:e=[],renderItem:n,onAdd:r,onRemove:o,onReorder:i,className:a="",addButtonText:s=(0,m.__)("Add Item","wp-component-library"),emptyStateText:c=(0,m.__)("No items added yet. Click the button below to add one.","wp-component-library"),maxItems:u=null,minItems:d=0,renderMode:h="default",enableReorder:g=!0,collapsible:b=!1,renderSummary:x=null,defaultExpanded:v=!1,expandNewItems:y=!0})=>{const[w,_]=(0,l.useState)(null),[S,C]=(0,l.useState)(()=>b&&v?new Set(e.map(e=>e.id)):new Set),k=(0,l.useRef)(null),T=e.map(e=>e.id).join("\0");(0,l.useEffect)(()=>{const e=T?T.split("\0"):[];if(!b)return void(k.current=e);if(null===k.current)return void(k.current=e);const t=new Set(k.current),n=e.filter(e=>!t.has(e)),r=new Set(e);C(e=>{const t=new Set;return e.forEach(e=>{r.has(e)&&t.add(e)}),y&&1===n.length&&t.add(n[0]),t.size===e.size&&[...t].every(t=>e.has(t))?e:t}),k.current=e},[b,y,T]);const I=Ve(We(Bt,{activationConstraint:{distance:8}}),We(Ot,{coordinateGetter:nr})),E=t=>{e.length>d&&o(t)},D=null===u||e.length<u,R=e.length>d,A=w?e.find(e=>e.id===w):null,j=A?e.findIndex(e=>e.id===w):-1,N=[a,b?"wpcl-repeater--collapsible":""].filter(Boolean).join(" ");return(0,t.jsxs)(ar,{className:N,children:[(0,t.jsxs)(vn,{sensors:I,collisionDetection:et,onDragStart:e=>{g&&_(e.active.id)},onDragEnd:t=>{if(!g)return;const{active:n,over:r}=t;if(n.id!==r.id){const t=e.findIndex(e=>e.id===n.id),o=e.findIndex(e=>e.id===r.id),a=Ln(e,t,o);i(a)}_(null)},modifiers:[zn,Pn],children:[0===e.length?(0,t.jsx)("div",{className:"built-repeater__empty-state",children:c}):(0,t.jsx)(Yn,{items:e.map(e=>e.id),strategy:Hn,children:(0,t.jsx)("div",{className:"built-repeater__items",children:e.map((e,r)=>{const o=!b||S.has(e.id);return(0,t.jsx)(mr,{id:e.id,onRemove:E,canRemove:R,renderMode:h,enableReorder:g,collapsible:b,isExpanded:o,onToggle:()=>{return t=e.id,void C(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},summary:b&&x?x(e,r):null,children:o?n(e,r):null},e.id)})})}),(0,t.jsx)(Mn,{children:w&&A?(0,t.jsx)("div",{className:"built-repeater__drag-overlay",children:(0,t.jsx)(mr,{id:w,isDragOverlay:!0,renderMode:h,canRemove:R,onRemove:E,enableReorder:g,collapsible:b,isExpanded:!1,summary:b&&x?x(A,j):null,children:b?null:n(A,j)})}):null})]}),D&&(0,t.jsx)("div",{className:"built-repeater__add-button",children:(0,t.jsx)(p.Button,{variant:"secondary",icon:f.plusCircle,iconPosition:"left",onClick:r,children:s})})]})};hr.propTypes={items:ir().arrayOf(ir().shape({id:ir().string.isRequired})).isRequired,renderItem:ir().func.isRequired,onAdd:ir().func.isRequired,onRemove:ir().func.isRequired,onReorder:(e,t,n)=>!1===e.enableReorder?null:"function"!=typeof e[t]?new Error(`\`${t}\` is required in \`${n}\` unless \`enableReorder\` is false.`):null,className:ir().string,addButtonText:ir().string,emptyStateText:ir().string,maxItems:ir().number,minItems:ir().number,renderMode:ir().oneOf(["default","integrated"]),enableReorder:ir().bool,collapsible:ir().bool,renderSummary:ir().func,defaultExpanded:ir().bool,expandNewItems:ir().bool};const gr=["href","src","xlink:href","action","formaction","poster","srcset"];function br(e=[]){const[t,n]=(0,l.useState)(e);return{attributes:t,setAttributes:n,updateAttribute:(e,t)=>{n(n=>n.map(n=>n.id===e?{...n,value:t}:n))},addAttribute:(e,t="")=>{const r={id:`custom-${Date.now()}`,label:e,value:t,isCustom:!0};return n(e=>[...e,r]),r},removeAttribute:e=>{n(t=>t.filter(t=>t.id!==e))},resetAttributes:()=>{n(e=>e.map(e=>({...e,value:""})))},getAttributeValue:e=>t.find(t=>t.id===e)?.value||""}}const xr=function({attributes:n=[],onChange:r,panelId:o="attributes-panel"}){const[i,a]=(0,l.useState)(n),s=(0,e.useSelect)(e=>{const{getEditedPostAttribute:t}=e("core/editor"),n=t?.("meta")||{},r=new Set;return Object.keys(n).forEach(e=>r.add(e)),["_thumbnail_id","_wp_page_template","_wp_attachment_metadata","_wp_attached_file","_edit_lock","_edit_last"].forEach(e=>r.add(e)),Array.from(r).map(e=>({value:e,label:e.replace(/_/g," ").replace(/^\w/,e=>e.toUpperCase())}))},[]),c=(0,l.useMemo)(()=>{const e=[{value:"id",label:(0,m.__)("ID","wp-component-library")},{value:"class",label:(0,m.__)("Class","wp-component-library")},{value:"style",label:(0,m.__)("Style","wp-component-library")},{value:"title",label:(0,m.__)("Title","wp-component-library")},{value:"alt",label:(0,m.__)("Alt Text","wp-component-library")},{value:"rel",label:(0,m.__)("Rel","wp-component-library")},{value:"target",label:(0,m.__)("Target","wp-component-library")},{value:"href",label:(0,m.__)("Href","wp-component-library")},{value:"src",label:(0,m.__)("Src","wp-component-library")},{value:"data-id",label:(0,m.__)("Data ID","wp-component-library")},{value:"data-type",label:(0,m.__)("Data Type","wp-component-library")},{value:"data-value",label:(0,m.__)("Data Value","wp-component-library")},{value:"aria-label",label:(0,m.__)("ARIA Label","wp-component-library")},{value:"aria-describedby",label:(0,m.__)("ARIA Described By","wp-component-library")},{value:"aria-hidden",label:(0,m.__)("ARIA Hidden","wp-component-library")},...s.map(e=>({...e,label:`Meta: ${e.label}`}))];return i.forEach(t=>{e.find(e=>e.value===t.id)||e.push({value:t.id,label:t.label||t.id})}),e},[s,i]);(0,l.useEffect)(()=>{a(n)},[n]);const u=(e,t)=>{if(function(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;if(!gr.includes(e.trim().toLowerCase()))return!1;const n=t.replace(/[\u0000-\u0020]/g,"").toLowerCase();return/(^|,)(javascript|vbscript|data):/.test(n)}(e,t))return;const n=i.map(n=>n.id===e?{...n,value:t}:n);a(n),r?.(n)};return(0,t.jsxs)(p.__experimentalToolsPanel,{label:(0,m.__)("Attributes","wp-component-library"),panelId:o,hasInnerWrapper:!0,className:"attributes-tools-panel",resetAll:()=>{const e=i.map(e=>({...e,value:""}));a(e),r?.(e)},dropdownMenuProps:{popoverProps:{placement:"left-start",offset:10}},children:[i.map(e=>(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>!!e.value,label:e.label||(0,m.__)("Select attribute","wp-component-library"),onDeselect:()=>(e=>{const t=i.filter(t=>t.id!==e);a(t),r?.(t)})(e.id),resetAllFilter:()=>{return t=e.id,void u(t,"");var t},panelId:o,children:(0,t.jsx)("div",{style:{display:"flex",gap:"8px",alignItems:"flex-end"},children:(0,t.jsxs)("div",{style:{flex:1},children:[(0,t.jsx)(p.ComboboxControl,{label:e.isNew?(0,m.__)("Attribute","wp-component-library"):e.label,value:e.isNew?"":e.id,onChange:t=>((e,t)=>{var n;if(t&&("string"!=typeof(n=t)||!/^\s*on/i.test(n)))if(i.find(t=>t.id===e))u(e,t);else{const n=c.find(e=>e.value===t),o=n?.label||t,l=i.map(n=>n.id===e?{...n,id:t,label:o}:n);a(l),r?.(l)}})(e.id,t),options:c,allowReset:!1,placeholder:(0,m.__)("Select or type attribute","wp-component-library")}),!e.isNew&&(0,t.jsx)(p.ComboboxControl,{label:(0,m.__)("Value","wp-component-library"),value:e.value||"",onChange:t=>u(e.id,t),options:[],allowReset:!1,placeholder:(0,m.__)("Enter value","wp-component-library"),help:e.id.startsWith("meta:")?(0,m.__)("This will pull from post meta","wp-component-library"):null})]})})},e.id)),(0,t.jsx)("div",{style:{padding:"16px 16px 8px"},children:(0,t.jsx)(p.Button,{variant:"secondary",size:"small",onClick:()=>{const e={id:`attr-${Date.now()}`,label:"",value:"",isNew:!0},t=[...i,e];a(t),r?.(t)},style:{width:"100%"},children:(0,m.__)("Add attribute","wp-component-library")})})]})},vr={success:{base:"#4ab866",light:"#edfaef",dark:"#007017"},warning:{base:"#f0b849",light:"#fef8e6",dark:"#b26200"},error:{base:"#cc1818",light:"#fcebea",dark:"#8a0000"},info:{base:"#3858e9",light:"#e6f2ff",dark:"#005cb8"}},yr={success:"success",warning:"caution",error:"error",info:"info"},wr={content:["foreground-content-%s","dark"],accent:["foreground-content-%s-weak","base"],stroke:["stroke-surface-%s-strong","base"],surface:["background-surface-%s-weak","light"]},_r=(e,t="accent")=>{if("fill"===t)return vr[e]?.base??vr.error.base;const[n,r]=wr[t]??wr.accent,o=yr[e]??"error",i=vr[e]?.[r]??"#646970";return`var(--wpds-color-${n.replace("%s",o)}, ${i})`},Sr=(e,t="base")=>_r(e,{base:"accent",light:"surface",dark:"content"}[t]??"accent"),Cr=e=>({bg:_r(e,"surface"),text:_r(e,"content"),border:_r(e,"stroke")}),kr=e=>{const t=Number(e);return Number.isFinite(t)?t>=90?"success":t>=70?"info":t>=50?"warning":"error":"error"},Tr=e=>Cr(kr(e)),Ir=e=>{const t=kr(e);return{chart:_r(t,"fill"),text:_r(t,"content")}},Er=e=>{switch(e){case"error":case"critical":return{background:_r("error","surface"),color:_r("error","accent")};case"warning":return{background:_r("warning","surface"),color:_r("warning","content")};case"info":case"suggestion":return{background:_r("info","surface"),color:_r("info","content")};case"success":case"passed":return{background:_r("success","surface"),color:_r("success","content")};default:return{background:le.surfaceSubtle,color:le.text}}},Dr=[le.brandFill,"#646970",_r("success","fill"),_r("warning","fill"),_r("error","fill"),"#8b5cf6"],Rr=S().span`
|
|
306
|
-
display: inline-flex;
|
|
307
|
-
align-items: center;
|
|
308
|
-
gap: 4px;
|
|
309
|
-
padding: 0 8px;
|
|
310
|
-
height: 24px;
|
|
311
|
-
border-radius: 2px;
|
|
312
|
-
font-size: 12px;
|
|
313
|
-
font-weight: 400;
|
|
314
|
-
line-height: 24px;
|
|
315
|
-
white-space: nowrap;
|
|
316
|
-
|
|
317
|
-
// Intent-based color schemes matching Gutenberg Badge
|
|
318
|
-
${e=>{const{background:t,color:n}=Er(e.intent);return`\n\t\t\tbackground-color: ${t};\n\t\t\tcolor: ${n};\n\t\t`}}
|
|
319
|
-
|
|
320
|
-
// Icon styling to match text color
|
|
321
|
-
svg {
|
|
322
|
-
fill: currentColor;
|
|
323
|
-
width: 18px;
|
|
324
|
-
height: 18px;
|
|
325
|
-
flex-shrink: 0;
|
|
326
|
-
}
|
|
327
|
-
`;function Ar({children:e,intent:n="default",showIcon:r=!0,icon:o=null,className:i="",...a}){const l=(()=>{if(o)return o;if(!r)return null;switch(n){case"error":case"critical":case"warning":return f.caution;case"info":case"suggestion":default:return f.info;case"success":case"passed":return f.check}})();return(0,t.jsxs)(Rr,{intent:n,className:`wp-component-library-badge ${i}`,...a,children:[l&&(0,t.jsx)(p.Icon,{icon:l,size:16}),e]})}const jr=S().div`
|
|
328
|
-
display: flex;
|
|
329
|
-
gap: 6px;
|
|
330
|
-
width: 100%;
|
|
331
|
-
`,Nr=S().span`
|
|
332
|
-
flex: 1;
|
|
333
|
-
height: ${({$height:e})=>e}px;
|
|
334
|
-
border-radius: ${({$height:e})=>e/2}px;
|
|
335
|
-
background: ${({$color:e})=>e};
|
|
336
|
-
`,Or="var(--wpds-color-background-surface-neutral-weak, #f0f0f0)";function Mr({segments:e,label:n,height:r=6,className:o=""}){return(0,t.jsx)(jr,{role:"img","aria-label":n,className:`siratik-segmented-bar ${o}`.trim(),children:e.map(e=>{return(0,t.jsx)(Nr,{$height:r,$color:(n=e.intent,["success","warning","error","info"].includes(n)?_r(n,"fill"):Or)},e.key);var n})})}const Pr=S().div`
|
|
337
|
-
display: flex;
|
|
338
|
-
align-items: center;
|
|
339
|
-
justify-content: flex-start;
|
|
340
|
-
margin-bottom: 16px;
|
|
341
|
-
`,zr=S().div`
|
|
342
|
-
width: 24px;
|
|
343
|
-
height: 24px;
|
|
344
|
-
border: 2px solid #c1c1c1;
|
|
345
|
-
border-radius: 2px;
|
|
346
|
-
margin-right: 12px;
|
|
347
|
-
background: white;
|
|
348
|
-
position: relative;
|
|
349
|
-
`,Lr=S().div`
|
|
350
|
-
padding: 12px 16px;
|
|
351
|
-
background: #f0f9ff;
|
|
352
|
-
border: 1px solid #bae6fd;
|
|
353
|
-
border-radius: 4px;
|
|
354
|
-
color: #0369a1;
|
|
355
|
-
font-size: 13px;
|
|
356
|
-
text-align: center;
|
|
357
|
-
`,Br="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6IiBmaWxsPSIjNDI4NUY0Ii8+Cjwvc3ZnPg==",Fr=S().div`
|
|
358
|
-
display: inline-flex;
|
|
359
|
-
align-items: center;
|
|
360
|
-
background: ${e=>"dark"===e.theme?"#222":"#f9f9f9"};
|
|
361
|
-
border: 1px solid ${e=>"dark"===e.theme?"#555":"#d3d3d3"};
|
|
362
|
-
color: ${e=>"dark"===e.theme?"#e8eaed":"inherit"};
|
|
363
|
-
border-radius: 3px;
|
|
364
|
-
padding: ${e=>"compact"===e.size?"6px 8px":"10px 12px"};
|
|
365
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
366
|
-
font-family: Roboto, Arial, sans-serif;
|
|
367
|
-
position: relative;
|
|
368
|
-
cursor: not-allowed;
|
|
369
|
-
font-size: ${e=>"compact"===e.size?"12px":"14px"};
|
|
370
|
-
`,$r=S().div`
|
|
371
|
-
margin-right: 12px;
|
|
372
|
-
font-size: 14px;
|
|
373
|
-
color: #555;
|
|
374
|
-
`,Ur=S().div`
|
|
375
|
-
margin-left: auto;
|
|
376
|
-
display: flex;
|
|
377
|
-
align-items: center;
|
|
378
|
-
gap: 8px;
|
|
379
|
-
|
|
380
|
-
img {
|
|
381
|
-
width: 32px;
|
|
382
|
-
height: 32px;
|
|
383
|
-
}
|
|
384
|
-
`,Hr=S().div`
|
|
385
|
-
display: flex;
|
|
386
|
-
flex-direction: column;
|
|
387
|
-
font-size: 10px;
|
|
388
|
-
color: #555;
|
|
389
|
-
line-height: 1.2;
|
|
390
|
-
|
|
391
|
-
span {
|
|
392
|
-
font-weight: 500;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
small {
|
|
396
|
-
color: #1a73e8;
|
|
397
|
-
}
|
|
398
|
-
`,Wr=S().div`
|
|
399
|
-
display: inline-flex;
|
|
400
|
-
align-items: center;
|
|
401
|
-
background: white;
|
|
402
|
-
border: 1px solid #ddd;
|
|
403
|
-
border-radius: 3px;
|
|
404
|
-
padding: 8px 12px;
|
|
405
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
406
|
-
font-size: 9px;
|
|
407
|
-
color: #555;
|
|
408
|
-
`,Vr=S().div`
|
|
409
|
-
margin-right: 8px;
|
|
410
|
-
|
|
411
|
-
img {
|
|
412
|
-
width: 24px;
|
|
413
|
-
height: 24px;
|
|
414
|
-
}
|
|
415
|
-
`,Yr=S().div`
|
|
416
|
-
line-height: 1.2;
|
|
417
|
-
|
|
418
|
-
strong {
|
|
419
|
-
font-size: 10px;
|
|
420
|
-
}
|
|
421
|
-
`,Gr=S().div`
|
|
422
|
-
color: #1a73e8;
|
|
423
|
-
margin-top: 2px;
|
|
424
|
-
`;function qr({theme:e,size:n}){return(0,t.jsx)(Pr,{children:(0,t.jsxs)(Fr,{theme:e,size:n,children:[(0,t.jsx)(zr,{}),(0,t.jsx)($r,{children:(0,m.__)("I'm not a robot","wp-component-library")}),(0,t.jsxs)(Ur,{children:[(0,t.jsx)("img",{src:Br,alt:"reCAPTCHA"}),(0,t.jsxs)(Hr,{children:[(0,t.jsx)("span",{children:"reCAPTCHA"}),(0,t.jsx)("small",{children:"Privacy - Terms"})]})]})]})})}function Kr(){return(0,t.jsx)(Pr,{children:(0,t.jsxs)(Wr,{children:[(0,t.jsx)(Vr,{children:(0,t.jsx)("img",{src:Br,alt:"reCAPTCHA"})}),(0,t.jsxs)(Yr,{children:["protected by",(0,t.jsx)("br",{}),(0,t.jsx)("strong",{children:"reCAPTCHA"}),(0,t.jsx)(Gr,{children:"Privacy - Terms"})]})]})})}const Xr=S().div`
|
|
425
|
-
display: inline-flex;
|
|
426
|
-
align-items: center;
|
|
427
|
-
background: ${e=>"dark"===e.theme?"#333":"#fafafa"};
|
|
428
|
-
border: 1px solid ${e=>"dark"===e.theme?"#555":"#e0e0e0"};
|
|
429
|
-
color: ${e=>"dark"===e.theme?"#fff":"inherit"};
|
|
430
|
-
border-radius: 4px;
|
|
431
|
-
padding: ${e=>"compact"===e.size?"8px 10px":"12px 14px"};
|
|
432
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
433
|
-
position: relative;
|
|
434
|
-
cursor: not-allowed;
|
|
435
|
-
font-size: ${e=>"compact"===e.size?"13px":"15px"};
|
|
436
|
-
`,Zr=S().div`
|
|
437
|
-
width: 28px;
|
|
438
|
-
height: 28px;
|
|
439
|
-
border: 2px solid #0074bf;
|
|
440
|
-
border-radius: 4px;
|
|
441
|
-
margin-right: 12px;
|
|
442
|
-
background: white;
|
|
443
|
-
position: relative;
|
|
444
|
-
`,Jr=S().div`
|
|
445
|
-
margin-right: 12px;
|
|
446
|
-
font-size: 15px;
|
|
447
|
-
color: ${e=>"dark"===e.theme?"#fff":"#333"};
|
|
448
|
-
`,Qr=S().div`
|
|
449
|
-
margin-left: auto;
|
|
450
|
-
display: flex;
|
|
451
|
-
align-items: center;
|
|
452
|
-
gap: 8px;
|
|
453
|
-
`,eo=S().div`
|
|
454
|
-
width: 24px;
|
|
455
|
-
height: 24px;
|
|
456
|
-
background: #0074bf;
|
|
457
|
-
color: white;
|
|
458
|
-
border-radius: 4px;
|
|
459
|
-
display: flex;
|
|
460
|
-
align-items: center;
|
|
461
|
-
justify-content: center;
|
|
462
|
-
font-weight: bold;
|
|
463
|
-
font-size: 16px;
|
|
464
|
-
`,to=S().div`
|
|
465
|
-
display: flex;
|
|
466
|
-
flex-direction: column;
|
|
467
|
-
font-size: 10px;
|
|
468
|
-
color: #666;
|
|
469
|
-
line-height: 1.2;
|
|
470
|
-
|
|
471
|
-
span {
|
|
472
|
-
font-weight: 500;
|
|
473
|
-
color: ${e=>"dark"===e.theme?"#fff":"#333"};
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
small {
|
|
477
|
-
color: #0074bf;
|
|
478
|
-
}
|
|
479
|
-
`;function no({theme:e,size:n}){return(0,t.jsx)(Pr,{children:(0,t.jsxs)(Xr,{theme:e,size:n,children:[(0,t.jsx)(Zr,{}),(0,t.jsx)(Jr,{theme:e,children:(0,m.__)("I am human","wp-component-library")}),(0,t.jsxs)(Qr,{children:[(0,t.jsx)(eo,{children:"h"}),(0,t.jsxs)(to,{theme:e,children:[(0,t.jsx)("span",{children:"hCaptcha"}),(0,t.jsx)("small",{children:"Privacy - Terms"})]})]})]})})}const ro=S().div`
|
|
480
|
-
display: inline-flex;
|
|
481
|
-
align-items: center;
|
|
482
|
-
background: ${e=>"dark"===e.theme?"#1f1f1f":"non-interactive"===e.mode?"#f9fafb":"white"};
|
|
483
|
-
border: 1px solid ${e=>"dark"===e.theme?"#444":"#ddd"};
|
|
484
|
-
color: ${e=>"dark"===e.theme?"#fff":"inherit"};
|
|
485
|
-
border-radius: 8px;
|
|
486
|
-
padding: 12px 16px;
|
|
487
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|
488
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
489
|
-
position: relative;
|
|
490
|
-
min-width: 300px;
|
|
491
|
-
cursor: not-allowed;
|
|
492
|
-
|
|
493
|
-
${e=>"auto"===e.theme&&"\n\t\t@media (prefers-color-scheme: dark) {\n\t\t\tbackground: #1f1f1f;\n\t\t\tborder-color: #444;\n\t\t\tcolor: #fff;\n\t\t}\n\t"}
|
|
494
|
-
`,oo=S().div`
|
|
495
|
-
width: 24px;
|
|
496
|
-
height: 24px;
|
|
497
|
-
border: 2px solid #d1d5db;
|
|
498
|
-
border-radius: 4px;
|
|
499
|
-
margin-right: 12px;
|
|
500
|
-
background: white;
|
|
501
|
-
`,io=S().div`
|
|
502
|
-
flex: 1;
|
|
503
|
-
font-size: 14px;
|
|
504
|
-
color: ${e=>"dark"===e.theme?"#fff":"#374151"};
|
|
505
|
-
`,ao=S().div`
|
|
506
|
-
display: flex;
|
|
507
|
-
align-items: center;
|
|
508
|
-
gap: 12px;
|
|
509
|
-
`,lo=S().div`
|
|
510
|
-
width: 24px;
|
|
511
|
-
height: 24px;
|
|
512
|
-
border: 3px solid #e5e7eb;
|
|
513
|
-
border-top-color: #f97316;
|
|
514
|
-
border-radius: 50%;
|
|
515
|
-
animation: spin 1s linear infinite;
|
|
516
|
-
|
|
517
|
-
@keyframes spin {
|
|
518
|
-
to { transform: rotate(360deg); }
|
|
519
|
-
}
|
|
520
|
-
`,so=S().div`
|
|
521
|
-
font-size: 12px;
|
|
522
|
-
color: #f97316;
|
|
523
|
-
font-weight: 600;
|
|
524
|
-
`;function co({theme:e,mode:n}){return"invisible"===n?(0,t.jsx)(Lr,{children:(0,m.__)("Invisible captcha - runs automatically on form submission","wp-component-library")}):(0,t.jsx)(Pr,{children:(0,t.jsxs)(ro,{theme:e,mode:n,children:["managed"===n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(oo,{}),(0,t.jsx)(io,{theme:e,children:(0,m.__)("Verify you are human","wp-component-library")})]}),"non-interactive"===n&&(0,t.jsxs)(ao,{children:[(0,t.jsx)(lo,{}),(0,t.jsx)(io,{theme:e,children:(0,m.__)("Verifying…","wp-component-library")})]}),(0,t.jsx)(so,{children:"Cloudflare"})]})})}function uo({provider:e,theme:n="light",size:r="normal",version:o="v2",mode:i="managed"}){return"google-recaptcha"===e&&"v2"===o?(0,t.jsx)(qr,{theme:n,size:r}):"google-recaptcha"===e&&"v3"===o?(0,t.jsx)(Kr,{}):"hcaptcha"===e?(0,t.jsx)(no,{theme:n,size:r}):"cloudflare-turnstile"===e?(0,t.jsx)(co,{theme:n,mode:i}):null}function po({attributes:{columnCount:e,displayAs:n},setAttributes:r,min:o=1,max:i=6,isShownByDefault:a=!1}){if("list"===n||"pills"===n)return null;const l="grid"===n?(0,m.__)("Columns"):(0,m.__)("Slides to Show");return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>3!==e,label:(0,m.__)("Columns/Slides","built_starter"),onDeselect:()=>r({columnCount:3}),isShownByDefault:a,children:(0,t.jsx)(p.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:l,value:e,onChange:e=>r({columnCount:e}),min:o,max:i})})}function fo({attributes:{displayAs:e},setAttributes:n,allowedDisplayOptions:r=["grid","slider","list","pills"],isShownByDefault:o=!0}){const i="grid",a=[{label:"Grid",value:"grid"},{label:"Slider",value:"slider"},{label:"List",value:"list"},{label:"Pills",value:"pills"},{label:"Marquee",value:"marquee"}].filter(e=>r.includes(e.value));return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>e!==i,label:(0,m.__)("Display Type","built_starter"),onDeselect:()=>n({displayAs:i}),isShownByDefault:o,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:"Display As",value:e,options:a,onChange:e=>n({displayAs:e})})})}function mo({attributes:{hideCurrentPost:e=!0},setAttributes:n,isShownByDefault:r=!0}){const o=!0;return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>e!==o,label:(0,m.__)("Hide Current Post","built_starter"),onDeselect:()=>n({hideCurrentPost:o}),isShownByDefault:r,children:(0,t.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Hide Current Post","built_starter"),checked:e,onChange:e=>n({hideCurrentPost:e}),help:(0,m.__)("On single posts and templates, exclude the post being viewed from this feed.","built_starter")})})}const ho=window.wp.keycodes,go=S().span`
|
|
525
|
-
display: inline-flex;
|
|
526
|
-
align-items: center;
|
|
527
|
-
gap: 2px;
|
|
528
|
-
padding: 0 2px 0 6px;
|
|
529
|
-
height: 24px;
|
|
530
|
-
background: #ddd;
|
|
531
|
-
border-radius: 2px;
|
|
532
|
-
font-size: 13px;
|
|
533
|
-
cursor: grab;
|
|
534
|
-
position: relative;
|
|
535
|
-
|
|
536
|
-
&.is-dragging {
|
|
537
|
-
opacity: 0.5;
|
|
538
|
-
cursor: grabbing;
|
|
539
|
-
z-index: 1000;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
&.is-plain-text {
|
|
543
|
-
background: transparent;
|
|
544
|
-
border-radius: 0;
|
|
545
|
-
padding: 0;
|
|
546
|
-
cursor: move;
|
|
547
|
-
|
|
548
|
-
.sortable-select__token-text {
|
|
549
|
-
font-weight: normal;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
&.is-variable {
|
|
554
|
-
background: #e0e0e0;
|
|
555
|
-
border: 1px solid #ccc;
|
|
556
|
-
font-family: monospace;
|
|
557
|
-
font-size: 12px;
|
|
558
|
-
}
|
|
559
|
-
`,bo=S().span`
|
|
560
|
-
max-width: 200px;
|
|
561
|
-
overflow: hidden;
|
|
562
|
-
text-overflow: ellipsis;
|
|
563
|
-
white-space: nowrap;
|
|
564
|
-
`,xo=S()(p.Button)`
|
|
565
|
-
padding: 0;
|
|
566
|
-
height: 18px;
|
|
567
|
-
width: 18px;
|
|
568
|
-
min-width: 18px;
|
|
569
|
-
background: transparent;
|
|
570
|
-
border: none;
|
|
571
|
-
cursor: pointer;
|
|
572
|
-
|
|
573
|
-
// Override WordPress button styles
|
|
574
|
-
&.components-button.has-icon {
|
|
575
|
-
padding: 0;
|
|
576
|
-
width: 24px;
|
|
577
|
-
min-width: 24px;
|
|
578
|
-
}
|
|
579
|
-
`;function vo({id:e,value:n,onRemove:r,disabled:o=!1,isPlainText:i=!1,isVariable:a=!1}){const{attributes:l,listeners:s,setNodeRef:c,transform:u,transition:d,isDragging:p}=Qn({id:e,disabled:o}),m={transform:je.Translate.toString(u),transition:d};return(0,t.jsxs)(go,{ref:c,style:m,className:`${p?"is-dragging":""} ${i?"is-plain-text":""} ${a?"is-variable":""}`,...l,...s,children:[(0,t.jsx)(bo,{children:n}),(0,t.jsx)(xo,{icon:f.closeSmall,label:"Remove",onClick:e=>{e.stopPropagation(),r()},disabled:o,size:"small"})]})}const yo=S().div`
|
|
580
|
-
position: relative;
|
|
581
|
-
`,wo=S().div`
|
|
582
|
-
box-sizing: border-box;
|
|
583
|
-
display: flex;
|
|
584
|
-
flex-wrap: wrap;
|
|
585
|
-
gap: 4px;
|
|
586
|
-
align-items: center;
|
|
587
|
-
min-height: 40px;
|
|
588
|
-
padding: 4px 8px;
|
|
589
|
-
border: 1px solid #949494;
|
|
590
|
-
border-radius: 2px;
|
|
591
|
-
background: #fff;
|
|
592
|
-
|
|
593
|
-
&:focus-within {
|
|
594
|
-
border-color: var(--wp-admin-theme-color, #007cba);
|
|
595
|
-
box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #007cba);
|
|
596
|
-
outline: 2px solid transparent;
|
|
597
|
-
}
|
|
598
|
-
`,_o=S().input`
|
|
599
|
-
flex: 1;
|
|
600
|
-
min-width: 60px;
|
|
601
|
-
border: none;
|
|
602
|
-
outline: none;
|
|
603
|
-
box-shadow: none !important;
|
|
604
|
-
background: transparent;
|
|
605
|
-
margin: 0;
|
|
606
|
-
font-size: 13px;
|
|
607
|
-
font-family: inherit;
|
|
608
|
-
|
|
609
|
-
// wp-admin's input[type="text"] (forms.css) outranks one class: the box
|
|
610
|
-
// is the wrapper's, so the field itself has none.
|
|
611
|
-
&& {
|
|
612
|
-
border: none;
|
|
613
|
-
padding: 0;
|
|
614
|
-
min-height: 0;
|
|
615
|
-
background: transparent;
|
|
616
|
-
}
|
|
617
|
-
`,So=S().textarea`
|
|
618
|
-
flex: 1;
|
|
619
|
-
min-width: 60px;
|
|
620
|
-
border: none;
|
|
621
|
-
outline: none;
|
|
622
|
-
box-shadow: none !important;
|
|
623
|
-
background: transparent;
|
|
624
|
-
margin: 0;
|
|
625
|
-
font-size: 13px;
|
|
626
|
-
font-family: inherit;
|
|
627
|
-
resize: vertical;
|
|
628
|
-
min-height: 80px;
|
|
629
|
-
max-height: 140px;
|
|
630
|
-
line-height: 1.4;
|
|
631
|
-
padding-top: 2px;
|
|
632
|
-
`,Co=S().div`
|
|
633
|
-
position: absolute;
|
|
634
|
-
top: 100%;
|
|
635
|
-
left: 0;
|
|
636
|
-
right: 0;
|
|
637
|
-
z-index: 1000;
|
|
638
|
-
margin-top: 4px;
|
|
639
|
-
background: #fff;
|
|
640
|
-
border: 1px solid #ccc;
|
|
641
|
-
border-radius: 2px;
|
|
642
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
|
|
643
|
-
`,ko=S().div`
|
|
644
|
-
max-height: 200px;
|
|
645
|
-
overflow-y: auto;
|
|
646
|
-
padding: 4px 0;
|
|
647
|
-
`,To=S().button`
|
|
648
|
-
display: block;
|
|
649
|
-
width: 100%;
|
|
650
|
-
padding: 6px 12px;
|
|
651
|
-
text-align: left;
|
|
652
|
-
border: none;
|
|
653
|
-
background: none;
|
|
654
|
-
cursor: pointer;
|
|
655
|
-
font-size: 13px;
|
|
656
|
-
|
|
657
|
-
&:hover,
|
|
658
|
-
&.is-selected {
|
|
659
|
-
background: var(--wp-admin-theme-color, #007cba);
|
|
660
|
-
color: #fff;
|
|
661
|
-
}
|
|
662
|
-
`,Io=S().div`
|
|
663
|
-
display: flex;
|
|
664
|
-
align-items: center;
|
|
665
|
-
justify-content: center;
|
|
666
|
-
gap: 8px;
|
|
667
|
-
padding: 12px;
|
|
668
|
-
font-size: 13px;
|
|
669
|
-
`;function Eo(e,t,n){return e.map((r,o)=>{const i=n(r),a=t(r)||i,l=e[o-1],s=/^[\-–—.,;:!?]$/.test(a.trim());let c=a;if(l&&!s&&!/^[\s\-–—.,;:!?]/.test(a)){const e=t(l)||n(l);/[\s\-–—.,;:!?]$/.test(e)||(c=" "+c)}return c}).join("")}const Do=(0,l.memo)(function({inputRef:e,inputValue:n,setInputValue:r,setShowSuggestions:o,suggestions:i,handleKeyDown:a,handleBlur:l,onFocusOpen:s,onBlurClose:c,placeholder:u,isDisabled:d,isDragging:p,inputType:f="text"}){const m="textarea"===f?So:_o,h={ref:e,value:n,onChange:e=>r(e.target.value),onFocus:()=>{s(),o(i.length>0)},onBlur:e=>{if(p)return e.preventDefault(),void e.target.focus();l(),c()},onKeyDown:a,placeholder:u,disabled:d};return"textarea"!==f&&(h.type="text"),(0,t.jsx)(m,{...h})}),Ro=(0,l.memo)((0,l.forwardRef)(function({value:e,onChange:n,options:r,loadOptions:o,getOptionLabel:i,getOptionValue:a,placeholder:s,isDisabled:c,maxItems:u,requirePrefix:d,inputType:f},h){const[g,b]=(0,l.useState)([]),[x,v]=(0,l.useState)(!1),[y,w]=(0,l.useState)(""),[_,S]=(0,l.useState)(!1),[C,k]=(0,l.useState)(0),[,T]=(0,l.useState)([]),[I,E]=(0,l.useState)(!1),[D,R]=(0,l.useState)(!1),A=(0,l.useRef)(),j=(0,l.useRef)(),N=(0,l.useRef)(),O=(0,l.useCallback)(()=>{clearTimeout(N.current),R(!0)},[]),M=(0,l.useCallback)(()=>{clearTimeout(N.current),N.current=setTimeout(()=>{S(!1),R(!1)},200)},[]);(0,l.useEffect)(()=>()=>clearTimeout(N.current),[]),(0,l.useImperativeHandle)(h,()=>({focus:()=>{A.current?.focus()}}),[]);const P=Ve(We(Bt,{activationConstraint:{distance:8}}),We(Ot,{coordinateGetter:nr}));(0,l.useEffect)(()=>{if(!y&&(d||!D))return b([]),void S(!1);const t=!d||y.startsWith("@"),n=d&&y.startsWith("@")?y.slice(1).trim():y;if(d&&"@"===y&&!o)return b(r),void S(r.length>0);if(!t)return b([]),void S(!1);if(!o){const t=(n?r.filter(e=>i(e).toLowerCase().includes(n.toLowerCase())):r).filter(t=>{const n=a(t);return!e.some(e=>a(e)===n)});return b(t),void S(t.length>0)}const l=setTimeout(async()=>{v(!0);try{const t=await o(n),r=t.filter(t=>{const n=a(t);return!e.some(e=>a(e)===n)});T(e=>{const n=[...e];return t.forEach(e=>{n.some(t=>a(t)===a(e))||n.push(e)}),n}),b(r),S(r.length>0)}catch(e){console.error("Error loading options:",e),b([]),S(!1)}finally{v(!1)}},y?300:0);return()=>clearTimeout(l)},[y,D,o]);const z=(0,l.useCallback)(t=>{u&&e.length>=u||(n([...e,t]),w(""),A.current?.focus())},[n,e,u]),L=(0,l.useCallback)(t=>{const r=e.filter((e,n)=>n!==t);n(r)},[n,e]),B=(0,l.useCallback)(t=>{switch(t.keyCode){case ho.BACKSPACE:if(""===y&&e.length>0){t.preventDefault();const r=e.slice(0,-1);n(r)}break;case ho.ENTER:if(t.preventDefault(),d&&y&&!y.startsWith("@"))return void z({label:y,value:y,isPlainText:!0});_&&g.length>0&&g[C]&&z(g[C]);break;case ho.UP:_&&g.length>0&&(t.preventDefault(),k(e=>Math.max(0,e-1)));break;case ho.DOWN:_&&g.length>0&&(t.preventDefault(),k(e=>Math.min(g.length-1,e+1)));break;case ho.ESCAPE:t.preventDefault(),S(!1)}},[_,g,C,z,d,y,i,a,e,n]),F=(0,l.useCallback)(()=>{d&&y&&!y.startsWith("@")&&z({label:y,value:y,isPlainText:!0})},[d,y,z]),$=(0,l.useCallback)(()=>{E(!0),A.current&&A.current.focus()},[]),U=(0,l.useCallback)(t=>{E(!1);const{active:r,over:o}=t;if(!o||r.id===o.id)return;const i=e.findIndex(e=>String(a(e))===r.id),l=e.findIndex(e=>String(a(e))===o.id);if(-1!==i&&-1!==l){const t=Ln(e,i,l);n(t)}},[e,n,a]);(0,l.useEffect)(()=>{if(!I&&A.current&&A.current.ownerDocument.activeElement!==A.current){const e=A.current.ownerDocument.activeElement?.closest(".sortable-select__input-wrapper");e&&A.current.focus()}},[I]);const H=(0,l.useMemo)(()=>e.map(e=>String(a(e))),[e,a]);return(0,t.jsxs)(yo,{ref:j,onClick:e=>{e.target!==A.current&&A.current?.focus()},children:[(0,t.jsx)(vn,{sensors:P,collisionDetection:et,onDragStart:$,onDragEnd:U,modifiers:[Pn],children:(0,t.jsxs)(wo,{children:[(0,t.jsx)(Yn,{items:H,strategy:$n,children:e.map((e,n)=>(0,t.jsx)(vo,{id:String(a(e)),value:i(e),onRemove:()=>L(n),disabled:c,isPlainText:e.isPlainText,isVariable:e.isVariable},a(e)))}),(0,t.jsx)(Do,{inputRef:A,inputValue:y,setInputValue:w,setShowSuggestions:S,suggestions:g,handleKeyDown:B,handleBlur:F,onFocusOpen:O,onBlurClose:M,placeholder:0===e.length?s:"",isDisabled:c,isDragging:I,inputType:f})]})}),_&&(0,t.jsx)(Co,{children:(0,t.jsx)(ko,{children:x?(0,t.jsxs)(Io,{children:[(0,t.jsx)(p.Spinner,{}),(0,t.jsx)("span",{children:(0,m.__)("Loading…","wp-component-library")})]}):g.filter(t=>{const n=a(t);return!e.some(e=>a(e)===n)}).map((e,n)=>(0,t.jsx)(To,{className:n===C?"is-selected":"",onClick:()=>z(e),onMouseEnter:()=>k(n),children:i(e)},a(e)))})})]})}));function Ao({value:e=[],onChange:n,options:r=[],loadOptions:o,getOptionLabel:i=e=>e.label||e.name||e.title,getOptionValue:a=e=>e.value||e.id,placeholder:s=(0,m.__)("Search and select…","wp-component-library"),label:c,help:u,isDisabled:d=!1,className:f="",maxItems:h,requirePrefix:g=!1,inputType:b="text"}){const x=(0,l.useRef)();return(0,t.jsx)(p.BaseControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultMarginBottom:!0,label:c,help:u,className:`sortable-select ${f}`,onClick:()=>{x.current?.focus()},children:(0,t.jsx)(Ro,{ref:x,value:e,onChange:n,options:r,loadOptions:o,getOptionLabel:i,getOptionValue:a,placeholder:s,isDisabled:d,maxItems:h,requirePrefix:g,inputType:b})})}function jo({attributes:{selectedPosts:n=[]},setAttributes:r,postType:o="post",isShownByDefault:i=!0}){const a=[],s=(0,e.useSelect)(e=>o&&0!==n.length&&e("core").getEntityRecords("postType",o,{include:n,per_page:n.length})||[],[o,n]),c=(0,l.useCallback)(async e=>{if(!o)return[];try{const t={per_page:20,status:"publish",search:e||""};return await wp.data.resolveSelect("core").getEntityRecords("postType",o,t)||[]}catch(e){return console.error("Error loading posts:",e),[]}},[o]),u=(0,l.useCallback)(e=>{const t=e.map(e=>e.id);r({selectedPosts:t})},[r]),d=(0,l.useMemo)(()=>n.map(e=>s.find(t=>t.id===e)).filter(Boolean),[s,n]),f=(0,t.jsx)(Ao,{value:d,onChange:u,loadOptions:c,getOptionLabel:e=>e.title?.rendered||`Post #${e.id}`,getOptionValue:e=>e.id,placeholder:(0,m.__)("Type to search posts…","built"),label:(0,m.__)("Select Posts","built"),help:(0,m.__)("Start typing to search for posts, then select them from the dropdown. Drag to reorder.","built"),isMulti:!0,isClearable:!1,isSearchable:!0,hideDropdownIndicator:!0});return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>n&&n.length>0,label:(0,m.__)("Select Posts","built"),onDeselect:()=>r({selectedPosts:a}),isShownByDefault:i,children:f})}function No({attributes:{selectedTerms:n=[]},setAttributes:r,selectedTaxonomy:o,renderAsToolsPanelItem:i=!0,isShownByDefault:a=!0}){const s=[],c=(0,e.useSelect)(e=>o&&0!==n.length&&e("core").getEntityRecords("taxonomy",o,{include:n,per_page:n.length})||[],[o,n]),u=(0,l.useCallback)(async e=>{if(!o)return[];try{const t={per_page:20,hide_empty:!1,search:e||""};return await wp.data.resolveSelect("core").getEntityRecords("taxonomy",o,t)||[]}catch(e){return console.error("Error loading terms:",e),[]}},[o]),d=(0,l.useCallback)(e=>{const t=e.map(e=>e.id);r({selectedTerms:t})},[r]),f=(0,l.useMemo)(()=>n.map(e=>c.find(t=>t.id===e)).filter(Boolean),[c,n]),h=(0,t.jsx)(Ao,{value:f,onChange:d,loadOptions:u,getOptionLabel:e=>e.name||`Term #${e.id}`,getOptionValue:e=>e.id,placeholder:(0,m.__)("Type to search terms…","built"),label:(0,m.__)("Select Terms","built"),help:(0,m.__)("Start typing to search for taxonomy terms, then select them from the dropdown. Drag to reorder.","built"),isMulti:!0,isClearable:!1,isSearchable:!0,hideDropdownIndicator:!0,renderSelectedItem:e=>(0,t.jsxs)("span",{children:[e.name,void 0!==e.count&&(0,t.jsxs)("span",{style:{color:"#666",marginLeft:"4px"},children:["(",e.count,")"]})]})});return i?(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>n&&n.length>0,label:(0,m.__)("Select Terms","built"),onDeselect:()=>r({selectedTerms:s}),isShownByDefault:a,children:h}):h}const Oo=[{label:"Custom Order",value:"menu_order_asc"},{label:"Date (Newest → Oldest)",value:"date_desc"},{label:"Date (Oldest → Newest)",value:"date_asc"},{label:"Title (A → Z)",value:"title_asc"},{label:"Title (Z → A)",value:"title_desc"},{label:"Random",value:"rand_asc"}];function Mo({attributes:{orderPostsBy:e,orderPostsDirection:n},setAttributes:r,orderOptions:o,additionalOrderOptions:i=[],isShownByDefault:a=!0}){const l="date",s="desc";let c;return c=o||(i.length>0?[...Oo,...i]:Oo),(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>e!==l||n!==s,label:(0,m.__)("Order By","built_starter"),onDeselect:()=>r({orderPostsBy:l,orderPostsDirection:s}),isShownByDefault:a,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:"Order By",value:`${e}_${n}`,options:c,onChange:e=>r(function(e){const t=e.lastIndexOf("_");return{orderPostsBy:e.slice(0,t),orderPostsDirection:e.slice(t+1)}}(e))})})}function Po({attributes:{postsPerPage:e},setAttributes:n,label:r="Amount to Display",min:o=1,max:i=50,isShownByDefault:a=!1}){return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>6!==e,label:r,onDeselect:()=>n({postsPerPage:6}),isShownByDefault:a,children:(0,t.jsx)(p.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:r,value:e,onChange:e=>n({postsPerPage:e}),min:o,max:i})})}function zo({attributes:{postType:n},setAttributes:r,isShownByDefault:o=!0}){const i="post",a=(0,e.useSelect)(e=>e("core").getPostTypes({per_page:20}));return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>n!==i,label:(0,m.__)("Select Post Type","built_starter"),onDeselect:()=>r({postType:i}),isShownByDefault:o,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Select Post Type","built_starter"),onChange:e=>r({postType:e}),options:(()=>{let e=[],t=[];return a&&(e=a.filter(e=>!0===e.viewable&&"media"!==e.rest_base&&"pages"!==e.rest_base),t=e.map(e=>({label:e.name,value:e.slug}))),t})(),value:n})})}function Lo(e){if(!e)return["card-"];const t="undefined"!=typeof window&&window.kitaris_localize?.blocks?.editor_experience?.card_templates?.[e];if(Array.isArray(t)&&t.length>0)return t.map(e=>"string"==typeof e?e:e?.slug).filter(Boolean);const n={kitaris_service:["card-service"],kitaris_team:["card-team"],kitaris_promotion:["card-promotion"],kitaris_coupon:["card-promotion"],kitaris_listing:["kitaris_listing-card","card-listing"],kitaris_review:["kitaris_review-card","card-review"],post:["post-card","card-post"],page:["page-card","card-page"],search:["search-result-card","card-search"]};return n[e]?n[e]:[`card-${e.replace(/^kitaris_/,"")}`,`${e}-card`]}function Bo(e){const t={kitaris_service:"card-service-001",kitaris_team:"card-team-001",kitaris_promotion:"card-promotion-001",kitaris_coupon:"card-promotion-001",kitaris_location:"card-location-001"};return t[e]?t[e]:Lo(e)[0]||`${e}-card`}function Fo({attributes:n,setAttributes:r,postType:o,area:i="kitaris-cards",defaultSlug:a,slugFilter:s,onSlugChange:c,isShownByDefault:u=!0,textDomain:d="built_starter",disableAutoFill:f=!1,usePersistedSlugOnly:h=!1}){const g=o||n?.postType||"post",b=n?.templatePartSlug||"",x=a||Bo(g),v=(0,e.useSelect)(e=>e("core").getEntityRecords("postType","wp_template_part",{per_page:200,area:i}),[i]),y=(0,l.useMemo)(()=>{const e=function(e,t,n){if(!e?.length)return[];const r=e.filter(e=>function(e,t,n){return"function"==typeof n?n(e,t):!!e&&Lo(t).some(t=>e===t||e.startsWith(`${t}-`))}(e.slug,t,n));return r.map(e=>({label:e.title?.rendered||e.title||e.slug,value:e.slug}))}(v,g,s);if(!b||e.some(e=>e.value===b))return e;const t=v?.find(e=>e.slug===b);return t?[{label:t.title?.rendered||t.title||t.slug,value:t.slug},...e]:e},[v,g,s,b]),w=h?b:b||x;return(0,l.useEffect)(()=>{!f&&!b&&x&&y.length>0&&y.some(e=>e.value===x)&&r({templatePartSlug:x})},[b,x,y,r,f]),y.length?(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>!!b&&b!==x,label:(0,m.__)("Card layout",d),onDeselect:()=>{r({templatePartSlug:x}),c&&c(x)},isShownByDefault:u,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Card layout",d),help:(0,m.__)("Choose which card template part to use for each post in the loop.",d),value:w,options:y,onChange:e=>{e&&e!==b&&(r({templatePartSlug:e}),c&&c(e))}})}):null}function $o({attributes:e,setAttributes:n,postType:r,area:o,defaultSlug:i,slugFilter:a,onSlugChange:l,textDomain:s="built_starter",disableAutoFill:c=!1,usePersistedSlugOnly:u=!1}){const d=r||e?.postType||"post",f=i||Bo(d);return(0,t.jsx)(p.__experimentalToolsPanel,{label:(0,m.__)("Card layout",s),resetAll:()=>{n({templatePartSlug:f}),l&&l(f)},children:(0,t.jsx)(Fo,{attributes:e,setAttributes:n,postType:d,area:o,defaultSlug:f,slugFilter:a,onSlugChange:l,textDomain:s,disableAutoFill:c,usePersistedSlugOnly:u})})}function Uo({attributes:{selectionMode:e="auto"},setAttributes:n,isShownByDefault:r=!0}){const o="auto";return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>e!==o,label:(0,m.__)("Selection Mode","built_starter"),onDeselect:()=>n({selectionMode:o}),isShownByDefault:r,children:(0,t.jsxs)(p.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,m.__)("Selection Mode","built_starter"),value:e,onChange:e=>{n({selectionMode:e})},isBlock:!0,children:[(0,t.jsx)(p.__experimentalToggleGroupControlOption,{label:(0,m.__)("Auto","built_starter"),value:"auto"}),(0,t.jsx)(p.__experimentalToggleGroupControlOption,{label:(0,m.__)("Manual","built_starter"),value:"manual"})]})})}function Ho({attributes:{selectedTaxonomy:n},setAttributes:r,postType:o,showNoneOption:i=!1,noneOptionLabel:a="No Taxonomy Filter",isShownByDefault:s=!1}){const c=(0,e.useSelect)(e=>e("core").getTaxonomies({per_page:-1}),[]),u=(0,l.useMemo)(()=>o&&c?c.filter(e=>e.types.includes(o)):[],[c,o]);(0,l.useEffect)(()=>{if(u.length>0)if(""===n||u.some(e=>e.slug===n))!i&&!n&&u.length>0&&r({selectedTaxonomy:u[0].slug,selectedTerms:[]});else{const e=i?"":u[0].slug;r({selectedTaxonomy:e,selectedTerms:[]})}else 0===u.length&&n&&r({selectedTaxonomy:"",selectedTerms:[]})},[u,n,r,i]);const d=(0,l.useMemo)(()=>u.map(e=>({label:e.labels.singular_name||e.name,value:e.slug})),[u]),f=(0,l.useMemo)(()=>i?[{label:a,value:""},...d]:d,[i,a,d]);return(0,t.jsx)(p.__experimentalToolsPanelItem,{hasValue:()=>""!==n,label:(0,m.__)("Select Taxonomy","built"),onDeselect:()=>r({selectedTaxonomy:"",selectedTerms:[]}),isShownByDefault:s,children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,m.__)("Select Taxonomy","built"),value:n,options:f,onChange:e=>r({selectedTaxonomy:e,selectedTerms:[]}),disabled:!o||0===u.length,help:o?0===u.length?(0,m.__)("No taxonomies available for this post type","built"):void 0:(0,m.__)("Please select a post type first","built")})})}function Wo(e,t,n=e=>e.id){if(!e||!t||0===t.length)return e||[];const r=new Map;e.forEach(e=>{r.set(n(e),e)});const o=[];return t.forEach(e=>{const t=r.get(e);t&&o.push(t)}),o}function Vo(t,n){const{terms:r}=(0,e.useSelect)(e=>n&&t&&0!==t.length?{terms:e("core").getEntityRecords("taxonomy",n,{include:t,per_page:t.length})||[]}:{terms:[]},[t,n]);return(0,l.useMemo)(()=>Wo(r,t),[r,t])}const Yo=S().div`
|
|
670
|
-
.block-editor-link-control {
|
|
671
|
-
min-width: 0;
|
|
672
|
-
width: 100%;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
.block-editor-link-control__search-input-wrapper {
|
|
676
|
-
margin-bottom: 0;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
.block-editor-link-control__field {
|
|
680
|
-
margin: 0;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
.block-editor-url-input {
|
|
684
|
-
min-width: 0;
|
|
685
|
-
width: 100%;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
/* A chosen link: its preview row. */
|
|
689
|
-
.block-editor-link-control__preview {
|
|
690
|
-
padding: 0;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
.block-editor-link-control__search-actions {
|
|
694
|
-
padding: 8px 0 0;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
/* Search results: a bordered list under the field, as wide as the panel. */
|
|
698
|
-
.block-editor-link-control__search-results-wrapper {
|
|
699
|
-
margin-top: 4px;
|
|
700
|
-
|
|
701
|
-
/* Core's scroll fades are positioned for the popover's gutters. */
|
|
702
|
-
&::before,
|
|
703
|
-
&::after {
|
|
704
|
-
display: none;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
.block-editor-link-control__search-results {
|
|
709
|
-
margin: 0;
|
|
710
|
-
padding: 4px;
|
|
711
|
-
max-height: 240px;
|
|
712
|
-
overflow-x: hidden;
|
|
713
|
-
background: var(--wp-components-color-background, #fff);
|
|
714
|
-
border: 1px solid var(--wp-components-color-gray-300, #ddd);
|
|
715
|
-
border-radius: 2px;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
.block-editor-link-control__search-item.components-button {
|
|
719
|
-
width: 100%;
|
|
720
|
-
min-width: 0;
|
|
721
|
-
height: auto;
|
|
722
|
-
padding: 6px 8px;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
.block-editor-link-control__search-item .components-menu-item__item,
|
|
726
|
-
.block-editor-link-control__search-item .components-menu-item__info-wrapper {
|
|
727
|
-
min-width: 0;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
/* One line each for the title and URL, truncated to the panel's width. */
|
|
731
|
-
.block-editor-link-control__search-item .components-menu-item__info-wrapper > * {
|
|
732
|
-
display: block;
|
|
733
|
-
overflow: hidden;
|
|
734
|
-
text-overflow: ellipsis;
|
|
735
|
-
white-space: nowrap;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
/* The type label ("Page", "Attachment") doesn't fit; the icon shows the type. */
|
|
739
|
-
.block-editor-link-control__search-item .components-menu-item__shortcut {
|
|
740
|
-
display: none;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
.block-editor-link-control__help {
|
|
744
|
-
padding: 0;
|
|
745
|
-
}
|
|
746
|
-
`,Go={link:"",opensInNewTab:!1,isPermalink:!1,rel:""};function qo({link:e=Go.link,opensInNewTab:n=Go.opensInNewTab,isPermalink:r=Go.isPermalink,onChange:o,panelId:i,isShownByDefault:a=!0,showPermalink:l=!0,permalinkHelp:s=(0,m.__)("Automatically use the current post's permalink as the link.","wp-component-library"),newTabHelp:c,showRel:u=!1,rel:f=Go.rel}){return(0,t.jsxs)(t.Fragment,{children:[l&&(0,t.jsx)(p.__experimentalToolsPanelItem,{panelId:i,hasValue:()=>r!==Go.isPermalink,label:(0,m.__)("Use post permalink","wp-component-library"),onDeselect:()=>o({isPermalink:Go.isPermalink}),isShownByDefault:!1,children:(0,t.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Use post permalink","wp-component-library"),checked:r,onChange:e=>o({isPermalink:e}),help:s})}),!r&&(0,t.jsx)(p.__experimentalToolsPanelItem,{panelId:i,hasValue:()=>e!==Go.link,label:(0,m.__)("URL","wp-component-library"),onDeselect:()=>o({link:Go.link}),isShownByDefault:a,children:(0,t.jsx)(Yo,{children:(0,t.jsx)(d.__experimentalLinkControl,{searchInputPlaceholder:(0,m.__)("Search content or type URL","wp-component-library"),value:{url:e},onChange:({url:e})=>o({link:e}),onRemove:()=>o({link:Go.link}),showInitialSuggestions:!0,settings:[]})})}),(0,t.jsx)(p.__experimentalToolsPanelItem,{panelId:i,hasValue:()=>n!==Go.opensInNewTab,label:(0,m.__)("Open in new tab","wp-component-library"),onDeselect:()=>o({opensInNewTab:Go.opensInNewTab}),isShownByDefault:a,children:(0,t.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,m.__)("Open in new tab","wp-component-library"),checked:n,onChange:e=>o({opensInNewTab:e}),help:n?c:void 0})}),u&&(0,t.jsx)(p.__experimentalToolsPanelItem,{panelId:i,hasValue:()=>!!f,label:(0,m.__)("Link rel","wp-component-library"),onDeselect:()=>o({rel:Go.rel}),isShownByDefault:!1,children:(0,t.jsx)(p.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,m.__)("Link rel","wp-component-library"),help:(0,m.__)("Space-separated values, e.g. nofollow or sponsored.","wp-component-library"),value:f,onChange:e=>o({rel:e})})})]})}function Ko({label:e=(0,m.__)("Link","wp-component-library"),panelId:n="link-tools-panel",className:r,onChange:o,...i}){return(0,t.jsx)(p.__experimentalToolsPanel,{label:e,panelId:n,resetAll:()=>{const{rel:e,...t}=Go;o(i.showRel?{...t,rel:e}:t)},className:r,children:(0,t.jsx)(qo,{...i,onChange:o,panelId:n})})}const Xo=/\{\{([a-zA-Z0-9_.-]+)\}\}|\{([a-zA-Z0-9_.-]+)\}/g,Zo=e=>`{{${e}}}`,Jo=e=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),Qo=S().div`
|
|
747
|
-
position: relative;
|
|
748
|
-
`,ei=S().div`
|
|
749
|
-
width: 100%;
|
|
750
|
-
min-height: ${e=>e.rows>1?28*e.rows+16+"px":"36px"};
|
|
751
|
-
padding: 6px 8px;
|
|
752
|
-
border: 1px solid #757575;
|
|
753
|
-
border-radius: 2px;
|
|
754
|
-
background: #fff;
|
|
755
|
-
font-size: 13px;
|
|
756
|
-
font-family: inherit;
|
|
757
|
-
margin: 0;
|
|
758
|
-
line-height: 24px;
|
|
759
|
-
cursor: text;
|
|
760
|
-
display: inline-block;
|
|
761
|
-
word-wrap: break-word;
|
|
762
|
-
white-space: pre-wrap;
|
|
763
|
-
overflow-wrap: break-word;
|
|
764
|
-
position: relative;
|
|
765
|
-
box-sizing: border-box;
|
|
766
|
-
|
|
767
|
-
&:empty:before {
|
|
768
|
-
content: attr(data-placeholder);
|
|
769
|
-
color: #757575;
|
|
770
|
-
pointer-events: none;
|
|
771
|
-
display: block;
|
|
772
|
-
position: absolute;
|
|
773
|
-
top: 0;
|
|
774
|
-
left: 0;
|
|
775
|
-
right: 0;
|
|
776
|
-
padding: inherit;
|
|
777
|
-
word-wrap: break-word;
|
|
778
|
-
white-space: normal;
|
|
779
|
-
line-height: 24px;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
&:focus {
|
|
783
|
-
border-color: var(--wp-admin-theme-color, #007cba);
|
|
784
|
-
box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #007cba);
|
|
785
|
-
outline: 2px solid transparent;
|
|
786
|
-
caret-color: var(--wp-admin-theme-color, #007cba);
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
&.is-disabled {
|
|
790
|
-
background: #f0f0f0;
|
|
791
|
-
cursor: not-allowed;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
.variable-chip {
|
|
795
|
-
display: inline-block;
|
|
796
|
-
background: #e0e0e0;
|
|
797
|
-
color: #1e1e1e;
|
|
798
|
-
border-radius: 4px;
|
|
799
|
-
padding: 2px 6px;
|
|
800
|
-
margin: 0 2px;
|
|
801
|
-
font-size: 12px;
|
|
802
|
-
white-space: nowrap;
|
|
803
|
-
user-select: none;
|
|
804
|
-
position: relative;
|
|
805
|
-
padding-right: 20px;
|
|
806
|
-
vertical-align: middle;
|
|
807
|
-
line-height: 20px;
|
|
808
|
-
transition: background-color 0.15s ease;
|
|
809
|
-
|
|
810
|
-
&:hover {
|
|
811
|
-
background: #d0d0d0;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
&::before,
|
|
815
|
-
&::after {
|
|
816
|
-
content: '\\200B';
|
|
817
|
-
display: inline;
|
|
818
|
-
width: 0;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
.chip-remove {
|
|
823
|
-
position: absolute;
|
|
824
|
-
right: 4px;
|
|
825
|
-
top: 50%;
|
|
826
|
-
transform: translateY(-50%);
|
|
827
|
-
cursor: pointer;
|
|
828
|
-
font-size: 14px;
|
|
829
|
-
line-height: 1;
|
|
830
|
-
opacity: 0.6;
|
|
831
|
-
display: inline-flex;
|
|
832
|
-
align-items: center;
|
|
833
|
-
justify-content: center;
|
|
834
|
-
width: 14px;
|
|
835
|
-
height: 14px;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
.chip-remove:hover {
|
|
839
|
-
opacity: 1;
|
|
840
|
-
background: rgba(0, 0, 0, 0.1);
|
|
841
|
-
border-radius: 2px;
|
|
842
|
-
}
|
|
843
|
-
`,ti=S().div`
|
|
844
|
-
position: absolute;
|
|
845
|
-
top: 100%;
|
|
846
|
-
left: 0;
|
|
847
|
-
right: 0;
|
|
848
|
-
z-index: 100100; /* Higher than WordPress panels (100000) */
|
|
849
|
-
margin-top: 4px;
|
|
850
|
-
background: #fff;
|
|
851
|
-
border: 1px solid #ccc;
|
|
852
|
-
border-radius: 2px;
|
|
853
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
854
|
-
animation: fadeIn 0.15s ease-in-out;
|
|
855
|
-
|
|
856
|
-
@keyframes fadeIn {
|
|
857
|
-
from {
|
|
858
|
-
opacity: 0;
|
|
859
|
-
transform: translateY(-4px);
|
|
860
|
-
}
|
|
861
|
-
to {
|
|
862
|
-
opacity: 1;
|
|
863
|
-
transform: translateY(0);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
`,ni=S().div`
|
|
867
|
-
max-height: 200px;
|
|
868
|
-
overflow-y: auto;
|
|
869
|
-
padding: 4px 0;
|
|
870
|
-
`,ri=S().button`
|
|
871
|
-
display: block;
|
|
872
|
-
width: 100%;
|
|
873
|
-
padding: 6px 12px;
|
|
874
|
-
text-align: left;
|
|
875
|
-
border: none;
|
|
876
|
-
background: none;
|
|
877
|
-
cursor: pointer;
|
|
878
|
-
font-size: 13px;
|
|
879
|
-
|
|
880
|
-
&:hover,
|
|
881
|
-
&.is-selected {
|
|
882
|
-
background: var(--wp-admin-theme-color, #007cba);
|
|
883
|
-
color: #fff;
|
|
884
|
-
}
|
|
885
|
-
`,oi=S().input`
|
|
886
|
-
position: absolute;
|
|
887
|
-
left: -9999px;
|
|
888
|
-
opacity: 0;
|
|
889
|
-
pointer-events: none;
|
|
890
|
-
`,ii=e=>(e?.ownerDocument?.defaultView??window).getSelection(),ai=(0,l.forwardRef)(function({value:e="",onChange:n,options:r=[],getOptionLabel:o=e=>e.label||e.name||e.title,getOptionValue:i=e=>e.value||e.id,placeholder:a=(0,m.__)("Type @ to view variable suggestions","wp-component-library"),label:s,help:c,isDisabled:u=!1,className:d="",rows:f=1,...h},g){const[b,x]=(0,l.useState)([]),[v,y]=(0,l.useState)(!1),[w,_]=(0,l.useState)(0),S=(0,l.useRef)(),C=(0,l.useRef)(),k=(0,l.useRef)(),T=(0,l.useCallback)(e=>{const t=Zo(e),n=r.find(n=>{const r=i(n),o=r.replace(/^\{\{?/,"").replace(/\}\}?$/g,"");return r===t||o===e});return n?o(n):e},[r,o,i]),I=(0,l.useCallback)(e=>((e,t)=>{if(!e)return"";let n=Jo(e).replace(Xo,(e,n,r)=>{const o=n||r;return`<span class="variable-chip" contenteditable="false" data-variable="${o}">${Jo(t(o))}<span class="chip-remove">×</span></span>`});return n.endsWith("")||(n+=""),n})(e,T),[T]),E=(0,l.useCallback)(()=>{if(!S.current)return"";let e="";return S.current.childNodes.forEach(t=>{if(t.nodeType===window.Node.TEXT_NODE)e+=t.textContent.replace(/\u200B/g,"");else if(t.classList&&t.classList.contains("variable-chip")){const n=t.getAttribute("data-variable")||t.firstChild.textContent;e+=Zo(n.replace(/^\{\{?|\}\}?$/g,""))}}),e.trim()},[]);(0,l.useEffect)(()=>{if(S.current&&S.current.ownerDocument.activeElement!==S.current){const t=S.current.innerHTML,n=I(e);t!==n&&(S.current.innerHTML=n)}},[e,I]);const D=(0,l.useCallback)(()=>{const e=ii(S.current),t=E();if(e.rangeCount>0){const t=e.getRangeAt(0),n=t.startContainer;if(n.nodeType===window.Node.TEXT_NODE){const e=n.textContent,i=t.startOffset,a=e.substring(0,i),l=a.lastIndexOf("@");if(-1!==l){const e=a.substring(l+1).toLowerCase();if(""===e)x(r),y(!0),_(0);else{const t=r.filter(t=>o(t).toLowerCase().includes(e));x(t),y(t.length>0),_(0)}}else y(!1)}else y(!1)}n(t),k.current&&(k.current.value=t)},[E,n,r,o]),R=(0,l.useCallback)(e=>{const t=ii(S.current);if(t.rangeCount>0){const r=t.getRangeAt(0),o=r.startContainer;if(o.nodeType===window.Node.TEXT_NODE){const t=o.textContent,a=r.startOffset,l=t.substring(0,a).lastIndexOf("@");if(-1!==l){const r=t.substring(0,l),s=t.substring(a),c=i(e).replace(/^\{\{?/,"").replace(/\}\}?$/g,""),u=Zo(c);o.textContent=r+u+" "+s;const d=E();n(d),S.current.innerHTML=I(d);const p=Array.from(S.current.childNodes);let f=null,m=0;for(let e=p.length-1;e>=0;e--)if(p[e].nodeType===window.Node.TEXT_NODE){f=p[e],m=f.textContent.length;break}if(f){const e=ii(S.current),t=document.createRange();t.setStart(f,m),t.collapse(!0),e.removeAllRanges(),e.addRange(t)}S.current.focus()}}}y(!1)},[i,n,I,E]),A=(0,l.useCallback)(e=>{if(v&&b.length>0)switch(e.keyCode){case ho.UP:return e.preventDefault(),void _(e=>Math.max(0,e-1));case ho.DOWN:return e.preventDefault(),void _(e=>Math.min(b.length-1,e+1));case ho.ENTER:return e.preventDefault(),void(b[w]&&R(b[w]));case ho.ESCAPE:return e.preventDefault(),void y(!1)}if("Backspace"===e.key){const t=ii(S.current);if(t.rangeCount>0){const r=t.getRangeAt(0);if(r.collapsed&&0===r.startOffset){const t=r.startContainer;if(t.previousSibling&&t.previousSibling.classList?.contains("variable-chip")){e.preventDefault(),t.previousSibling.remove();const r=E();n(r)}}}}},[v,b,w,R,E,n]),j=(0,l.useCallback)(e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain");if(!t)return;const r=ii(S.current);if(!r.rangeCount)return;const o=r.getRangeAt(0);o.deleteContents(),o.insertNode(document.createTextNode(t)),o.collapse(!1),r.removeAllRanges(),r.addRange(o);const i=E();n(i),k.current&&(k.current.value=i)},[E,n]);return(0,l.useEffect)(()=>{const e=e=>{if(e.target.classList.contains("chip-remove")){e.preventDefault(),e.stopPropagation();const t=e.target.parentElement,r=ii(S.current),o=r.focusNode,i=r.focusOffset;t.remove();const a=E();if(n(a),k.current&&(k.current.value=a),S.current.focus(),o&&S.current.contains(o.parentNode)){const e=document.createRange();e.setStart(o,Math.min(i,o.textContent.length)),e.collapse(!0),r.removeAllRanges(),r.addRange(e)}}},t=S.current;if(t)return t.addEventListener("click",e),()=>t.removeEventListener("click",e)},[E,n]),(0,l.useEffect)(()=>{const e=e=>{C.current&&!C.current.contains(e.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,l.useImperativeHandle)(g,()=>({focus:()=>{S.current?.focus()}}),[]),(0,t.jsx)(p.BaseControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:s,help:c,className:`variable-field ${d}`,children:(0,t.jsxs)(Qo,{ref:C,children:[(0,t.jsx)(oi,{ref:k,type:"hidden",value:e,name:h.name}),(0,t.jsx)(ei,{ref:S,contentEditable:!u,suppressContentEditableWarning:!0,className:u?"is-disabled":"",onInput:D,onKeyDown:A,onPaste:j,spellCheck:!1,"data-placeholder":e?"":a,rows:f}),v&&b.length>0&&(0,t.jsx)(ti,{children:(0,t.jsx)(ni,{children:b.map((e,n)=>(0,t.jsx)(ri,{className:n===w?"is-selected":"",onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),R(e)},onMouseEnter:()=>_(n),children:o(e)},i(e)))})})]})})}),li=S().div`
|
|
891
|
-
display: inline-flex;
|
|
892
|
-
align-items: flex-start;
|
|
893
|
-
margin-top: 1.5rem;
|
|
894
|
-
align-self: flex-start;
|
|
895
|
-
`,si=S()(p.Popover)`
|
|
896
|
-
&.components-popover {
|
|
897
|
-
.components-popover__content {
|
|
898
|
-
min-width: 280px;
|
|
899
|
-
max-width: min(440px, 92vw);
|
|
900
|
-
padding: 0;
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
`,ci=S().div`
|
|
904
|
-
padding: 14px 16px;
|
|
905
|
-
display: flex;
|
|
906
|
-
flex-wrap: wrap;
|
|
907
|
-
gap: 8px;
|
|
908
|
-
max-height: 300px;
|
|
909
|
-
overflow-y: auto;
|
|
910
|
-
background-color: #f6f7f7;
|
|
911
|
-
border-radius: 2px;
|
|
912
|
-
`,ui=S().button`
|
|
913
|
-
display: inline-flex;
|
|
914
|
-
align-items: center;
|
|
915
|
-
margin: 0;
|
|
916
|
-
padding: 7px 14px;
|
|
917
|
-
border: 1px solid var(--wp-admin-theme-color, #3858e9);
|
|
918
|
-
border-radius: 999px;
|
|
919
|
-
background: #fff;
|
|
920
|
-
color: var(--wp-admin-theme-color, #3858e9);
|
|
921
|
-
font-family: inherit;
|
|
922
|
-
font-size: 11px;
|
|
923
|
-
font-weight: 400;
|
|
924
|
-
line-height: 1.35;
|
|
925
|
-
cursor: pointer;
|
|
926
|
-
transition:
|
|
927
|
-
background-color 0.15s ease,
|
|
928
|
-
color 0.15s ease,
|
|
929
|
-
border-color 0.15s ease;
|
|
930
|
-
|
|
931
|
-
&:hover,
|
|
932
|
-
&:focus-visible {
|
|
933
|
-
background: var(--wp-admin-theme-color, #3858e9);
|
|
934
|
-
border-color: var(--wp-admin-theme-color, #3858e9);
|
|
935
|
-
color: #fff;
|
|
936
|
-
outline: none;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
@media (prefers-color-scheme: dark) {
|
|
940
|
-
background: #1e1e1e;
|
|
941
|
-
color: #fff;
|
|
942
|
-
border-color: var(--wp-admin-theme-color, #3858e9);
|
|
943
|
-
|
|
944
|
-
&:hover,
|
|
945
|
-
&:focus-visible {
|
|
946
|
-
background: var(--wp-admin-theme-color, #3858e9);
|
|
947
|
-
color: #fff;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
`,di=S().div`
|
|
951
|
-
padding: 16px 20px;
|
|
952
|
-
text-align: center;
|
|
953
|
-
color: #646970;
|
|
954
|
-
font-size: 13px;
|
|
955
|
-
font-style: italic;
|
|
956
|
-
line-height: 1.4;
|
|
957
|
-
|
|
958
|
-
@media (prefers-color-scheme: dark) {
|
|
959
|
-
color: #c3c4c7;
|
|
960
|
-
}
|
|
961
|
-
`,pi=({variables:e=[],currentValue:n="",onChange:r,buttonProps:o={},placeholder:i=(0,m.__)("Insert variable","wp-component-library"),className:a="",size:s="default",variant:c="tertiary",...u})=>{const[d,h]=(0,l.useState)(!1),g=(0,l.useRef)(null);return(0,t.jsxs)(li,{className:a,...u,children:[(0,t.jsx)(p.Button,{ref:g,icon:(0,t.jsx)(f.Icon,{icon:f.plusCircle}),label:i,onClick:()=>h(e=>!e),size:s,variant:c,...o}),d&&(0,t.jsx)(si,{className:"variable-inserter-popover",anchor:g.current,onClose:()=>h(!1),placement:"bottom-start",children:(0,t.jsx)(ci,{className:"variable-inserter-chips",children:0===e.length?(0,t.jsx)(di,{children:(0,m.__)("No variables available","wp-component-library")}):e.map(e=>(0,t.jsx)(ui,{type:"button",className:"variable-inserter-chip",onClick:()=>(e=>{r(n+e.value),h(!1)})(e),children:e.label},e.value))})})]})},fi="themeSkinSwitcherChanged";function mi(e){try{return!!e.document}catch{return!1}}function hi(){const e=[window];try{let t=window;for(;t.parent&&t.parent!==t&&(t=t.parent,mi(t));)e.push(t)}catch{}return e}function gi(e=""){const t=hi();if(e){for(let n=t.length-1;n>=0;n--){const r=t[n].kitaris_localize?.blocks?.editor_experience?.patterns?.pattern_urls?.[e];if(r)return t[n]}for(let n=t.length-1;n>=0;n--){const r=t[n].kitaris_localize?.blocks?.editor_experience?.patterns;if(r?.available_patterns?.[e])return t[n]}}for(let e=t.length-1;e>=0;e--)if(t[e].kitaris_localize?.blocks?.editor_experience?.patterns)return t[e];return window}function bi(e=""){return gi(e).kitaris_localize}function xi(e=""){return bi(e)?.blocks?.editor_experience?.patterns}function vi(){const e=hi();for(let t=e.length-1;t>=0;t--){const n=e[t].kitaris_localize?.blocks?.editor_experience?.section_divider;if(n)return n}}const yi=gi,wi=bi,_i="wpcl/icons",Si={iconSets:{}},Ci={getIconSets(e){const t=[...Object.values(e.iconSets)].sort((e,t)=>{const n=e.priority??0,r=t.priority??0;return r!==n?r-n:e.name.localeCompare(t.name)});return(0,r.applyFilters)("wpcl.icons.iconSets",t)},getIconSet:(e,t)=>e.iconSets[t]??null,isIconSetsLoading:e=>Object.values(e.iconSets).some(e=>"loading"===e.loadStatus),hasPendingIconSets:e=>Object.values(e.iconSets).some(e=>"idle"===e.loadStatus||"loading"===e.loadStatus),getIcons(e,t){const n=e.iconSets[t];return n?n.icons.reduce((e,t)=>{const o=(0,r.applyFilters)("wpcl.icons.icon",t,n);return!1!==o&&e.push(o),e},[]):[]},getIcon(e,t,n){const r=e.iconSets[t];if(r)return r.icons.find(e=>e.name===n)}},ki=(0,e.createReduxStore)(_i,{reducer:function(e=Si,t){switch(t.type){case"REGISTER_ICON_SET":{const n=(0,r.applyFilters)("wpcl.icons.iconSet",t.iconSet),o=e.iconSets[n.name],i=n.icons??(o?.icons?.length?o.icons:[]);return{...e,iconSets:{...e.iconSets,[n.name]:{...n,icons:i,loadStatus:n.loadStatus??"loaded",loadError:null}}}}case"SET_ICON_SET_LOADING":{const n=e.iconSets[t.name];return n?{...e,iconSets:{...e.iconSets,[t.name]:{...n,loadStatus:"loading",loadError:null}}}:e}case"SET_ICON_SET_ICONS":{const n=e.iconSets[t.name];return n?{...e,iconSets:{...e.iconSets,[t.name]:{...n,icons:t.icons,loadStatus:"loaded",loadError:null}}}:e}case"SET_ICON_SET_ERROR":{const n=e.iconSets[t.name];return n?{...e,iconSets:{...e.iconSets,[t.name]:{...n,loadStatus:"error",loadError:t.message}}}:e}case"REMOVE_ICON_SET":{if(!e.iconSets[t.name])return e;const n={...e,iconSets:{...e.iconSets}};return delete n.iconSets[t.name],n}default:return e}},selectors:Ci,actions:{registerIconSet:e=>({type:"REGISTER_ICON_SET",iconSet:e}),setIconSetLoading:e=>({type:"SET_ICON_SET_LOADING",name:e}),setIconSetIcons:(e,t)=>({type:"SET_ICON_SET_ICONS",name:e,icons:t}),setIconSetError:(e,t)=>({type:"SET_ICON_SET_ERROR",name:e,message:t}),removeIconSet:e=>({type:"REMOVE_ICON_SET",name:e})}});function Ti(){return"undefined"!=typeof window?(window.wpcl=window.wpcl||{},window.wpcl._iconSetLoaders||(window.wpcl._iconSetLoaders=new Map),window.wpcl._iconSetLoaders):Ti.fallbackMap||(Ti.fallbackMap=new Map)}function Ii(){return"undefined"!=typeof window?(window.wpcl=window.wpcl||{},window.wpcl._iconSetLoadsInFlight||(window.wpcl._iconSetLoadsInFlight=new Map),window.wpcl._iconSetLoadsInFlight):Ii.fallbackMap||(Ii.fallbackMap=new Map)}function Ei(e){Ti().delete(e),Ii().delete(e)}function Di(t){const{load:n,icons:r,...o}=t;if("function"==typeof n){i=o.name,a=n,Ti().set(i,a);const t=(0,e.select)(_i)?.getIconSet?.(o.name),l=o.libraryUrl??"",s=t?.libraryUrl===l&&""!==l;return void(0,e.dispatch)(_i).registerIconSet({...o,libraryUrl:l,priority:o.priority??0,icons:r??(s&&t?.icons?.length?t.icons:[]),loadStatus:s&&"loaded"===t?.loadStatus?"loaded":"idle"})}var i,a;Ei(o.name),(0,e.dispatch)(_i).registerIconSet({...o,priority:o.priority??0,icons:r??[],loadStatus:"loaded"})}(0,e.select)(_i)||(0,e.register)(ki);const Ri=Di;async function Ai(t){const n=(0,e.select)(_i).getIconSet(t);if(!n||"loaded"===n.loadStatus)return;const r=function(e){return Ii().get(e)}(t);if(r)return r;const o=function(e){return Ti().get(e)}(t);if(!o)return void(0,e.dispatch)(_i).setIconSetError(t,"Icon set loader is not registered.");const i=(async()=>{(0,e.dispatch)(_i).setIconSetLoading(t);try{const r=(n=await o(),Array.isArray(n)?n:n?.icons&&Array.isArray(n.icons)?n.icons:n?.default&&Array.isArray(n.default)?n.default:[]);(0,e.dispatch)(_i).setIconSetIcons(t,r),Ei(t)}catch(n){const r=n instanceof Error?n.message:String(n);throw(0,e.dispatch)(_i).setIconSetError(t,r),n}finally{!function(e){Ii().delete(e)}(t)}var n})();return function(e,t){Ii().set(e,t)}(t,i),i}async function ji(){const t=(0,e.select)(_i).getIconSets().filter(e=>"idle"===e.loadStatus||"error"===e.loadStatus).map(e=>e.name);await Promise.all(t.map(e=>Ai(e)))}function Ni(t){Ei(t),(0,e.dispatch)(_i).removeIconSet(t)}const Oi=new Map;function Mi(t){if(!t||"object"!=typeof t)return;const n=[];Array.isArray(t.sets)&&t.sets.length?n.push(...t.sets):t.library_url&&n.push({name:t.set_name??"theme-icons",label:t.set_label??"Theme Icons",priority:t.priority??100,library_url:t.library_url}),n.forEach(t=>{if(!t?.name||!t.library_url)return;const n=t.library_url;Di({name:t.name,label:t.label??t.name,priority:t.priority??0,libraryUrl:n,load:()=>async function(t,n){if("undefined"!=typeof window&&window.wpcl?.iconSetExports?.[n])return window.wpcl.iconSetExports[n];if(await function(e){if(!e)return Promise.reject(new Error("Icon library URL is missing."));const t=Oi.get(e);if(t)return t;const n=new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>t(),r.onerror=()=>{Oi.delete(e),n(new Error(`Failed to load icon library: ${e}`))},document.head.appendChild(r)});return Oi.set(e,n),n}(t),"undefined"!=typeof window&&window.wpcl?.iconSetExports?.[n])return window.wpcl.iconSetExports[n];const r=(0,e.select)(_i),o=r?.getIconSet?.(n);return o?.icons?.length?o.icons:[]}(n,t.name).then(e=>{return t=e,Array.isArray(t)?t:t?.icons&&Array.isArray(t.icons)?t.icons:t?.default&&Array.isArray(t.default)?t.default:[];var t})})})}function Pi(){return(0,e.useSelect)(e=>e(_i).getIconSets(),[])}function zi(){return(0,e.useSelect)(e=>{const t=e(_i);return t.getIconSets().map(e=>({...e,icons:t.getIcons(e.name).map(t=>({...t,iconSet:e.name}))}))},[])}function Li(){return(0,e.useSelect)(e=>{const t=e(_i);return t.getIconSets().flatMap(e=>t.getIcons(e.name).map(t=>({...t,iconSet:e.name})))},[])}function Bi(t=""){return(0,e.useSelect)(e=>{const n=e(_i);return t?n.getIcons(t).map(e=>({...e,iconSet:t})):n.getIconSets().flatMap(e=>n.getIcons(e.name).map(t=>({...t,iconSet:e.name})))},[t])}function Fi(t,n){return(0,e.useSelect)(e=>e(_i).getIcon(t,n),[t,n])}function $i(){const{groups:t,isLoading:n,hasPending:r,pendingKey:o}=(0,e.useSelect)(e=>{const t=e(_i),n=t.getIconSets();return{groups:n.map(e=>({...e,icons:t.getIcons(e.name).map(t=>({...t,iconSet:e.name}))})),isLoading:t.isIconSetsLoading(),hasPending:t.hasPendingIconSets(),pendingKey:n.filter(e=>"idle"===e.loadStatus||"loading"===e.loadStatus).map(e=>e.name).join("\0")}},[]);(0,l.useEffect)(()=>{o&&ji().catch(()=>{})},[o]);const i=t.reduce((e,t)=>e+t.icons.length,0);return{groups:t,isLoading:r||n,isInitialLoad:(r||n)&&0===i,hasPending:r}}function Ui(e,t){this.v=e,this.k=t}function Hi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Wi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Hi(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vi(e){var t,n;function r(t,n){try{var i=e[t](n),a=i.value,l=a instanceof Ui;Promise.resolve(l?a.v:a).then(function(n){if(l){var s="return"===t&&a.k?t:"next";if(!a.k||n.done)return r(s,n);n=e[s](n).value}o(!!i.done,n)},function(e){r("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(i,a){var l={key:e,arg:o,resolve:i,reject:a,next:null};n?n=n.next=l:(t=n=l,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}Vi.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Vi.prototype.next=function(e){return this._invoke("next",e)},Vi.prototype.throw=function(e){return this._invoke("throw",e)},Vi.prototype.return=function(e){return this._invoke("return",e)};const Yi=Object.entries,Gi=Object.setPrototypeOf,qi=Object.isFrozen,Ki=Object.getPrototypeOf,Xi=Object.getOwnPropertyDescriptor;let Zi=Object.freeze,Ji=Object.seal,Qi=Object.create,ea="undefined"!=typeof Reflect&&Reflect,ta=ea.apply,na=ea.construct;Zi||(Zi=function(e){return e}),Ji||(Ji=function(e){return e}),ta||(ta=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),na||(na=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const ra=Ia(Array.prototype.forEach);Array.prototype.indexOf;const oa=Ia(Array.prototype.lastIndexOf),ia=Ia(Array.prototype.pop),aa=Ia(Array.prototype.push),la=Ia(Array.prototype.slice),sa=Ia(Array.prototype.splice),ca=Array.isArray,ua=Ea(Set),da=Ia(Set.prototype.add),pa=Ia(Set.prototype.has),fa=Ia(String.prototype.toLowerCase),ma=Ia(String.prototype.toString),ha=Ia(String.prototype.match),ga=Ia(String.prototype.replace),ba=Ia(String.prototype.indexOf),xa=Ia(String.prototype.trim),va=Ia(Number.prototype.toString),ya=Ia(Boolean.prototype.toString),wa="undefined"==typeof BigInt?null:Ia(BigInt.prototype.toString),_a="undefined"==typeof Symbol?null:Ia(Symbol.prototype.toString),Sa=Ia(Object.prototype.hasOwnProperty),Ca=Ia(Object.prototype.toString),ka=Ia(RegExp.prototype.test),Ta=Ea(TypeError);function Ia(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return ta(e,t,r)}}function Ea(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return na(e,n)}}function Da(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fa;if(Gi&&Gi(e,null),!ca(t))return e;let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(qi(t)||(t[r]=e),o=e)}e[o]=!0}return e}function Ra(e){for(let t=0;t<e.length;t++)Sa(e,t)||(e[t]=null);return e}function Aa(e){const t=Qi(null);for(const r of Yi(e)){var n=Wi(r,2);const o=n[0],i=n[1];Sa(e,o)&&(ca(i)?t[o]=Ra(i):i&&"object"==typeof i&&i.constructor===Object?t[o]=Aa(i):t[o]=i)}return t}function ja(e,t){for(;null!==e;){const n=Xi(e,t);if(n){if(n.get)return Ia(n.get);if("function"==typeof n.value)return Ia(n.value)}e=Ki(e)}return function(){return null}}const Na=Zi(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Oa=Zi(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ma=Zi(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Pa=Zi(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),za=Zi(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),La=Zi(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ba=Zi(["#text"]),Fa=Zi(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),$a=Zi(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ua=Zi(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ha=Zi(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Wa=Ji(/{{[\w\W]*|^[\w\W]*}}/g),Va=Ji(/<%[\w\W]*|^[\w\W]*%>/g),Ya=Ji(/\${[\w\W]*/g),Ga=Ji(/^data-[\-\w.\u00B7-\uFFFF]+$/),qa=Ji(/^aria-[\-\w]+$/),Ka=Ji(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xa=Ji(/^(?:\w+script|data):/i),Za=Ji(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ja=Ji(/^html$/i),Qa=Ji(/^[a-z][.\w]*(-[.\w]+)+$/i),el=Ji(/<[/\w!]/g),tl=Ji(/<[/\w]/g),nl=Ji(/<\/no(script|embed|frames)/i),rl=Ji(/\/>/i),ol=Zi(Da({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),il=function(){return"undefined"==typeof window?null:window},al=function(e,t,n,r){return Sa(e,t)&&ca(e[t])?Da(r.base?Aa(r.base):{},e[t],r.transform):n},ll=function(e,t,n){const r=Sa(e,t)?e[t]:void 0;return r&&"object"==typeof r?Aa(r):n()};var sl=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:il();const n=t=>e(t);if(n.version="3.4.17",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let r=t.document;const o=r,i=o.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,l=t.Node,s=t.Element,c=t.NodeFilter;void 0===t.NamedNodeMap&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const u=t.DOMParser,d=t.trustedTypes,p=s.prototype,f=ja(p,"cloneNode"),m=ja(p,"remove"),h=ja(p,"removeAttributeNode"),g=ja(p,"nextSibling"),b=ja(p,"childNodes"),x=ja(p,"parentNode"),v=ja(p,"shadowRoot"),y=ja(p,"attributes"),w=l&&l.prototype?ja(l.prototype,"nodeType"):null,_=l&&l.prototype?ja(l.prototype,"nodeName"):null,S=l&&l.prototype?ja(l.prototype,"ownerDocument"):null,C=function(e){return w?w(e):e.nodeType},k=function(e){return _?_(e):e.nodeName},T=function(e){for(;null!==e;){const t=Xi(e,"namespaceURI");if(t)return t.get?Ia(t.get):null;e=Ki(e)}return null}(p),I=function(e){return T?T(e):e.namespaceURI};if("function"==typeof a){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let E,D,R="",A=!1,j=0;const N=function(){if(j>0)throw Ta('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},O=function(e){N(),j++;try{return E.createHTML(e)}finally{j--}},M=r,P=M.implementation,z=M.createNodeIterator,L=M.createDocumentFragment,B=M.getElementsByTagName,F=o.importNode;let $={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Yi&&"function"==typeof x&&P&&void 0!==P.createHTMLDocument;const U=Wa,H=Va,W=Ya,V=Ga,Y=qa,G=Xa,q=Za,K=Qa;let X=Ka,Z=null;const J=Da({},[...Na,...Oa,...Ma,...za,...Ba]);let Q=null;const ee=Da({},[...Fa,...$a,...Ua,...Ha]);let te=Object.seal(Qi(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ne=null,re=null;const oe=Object.seal(Qi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ie=!0,ae=!0,le=!1,se=!0,ce=!1,ue=!0,de=!1,pe=!1,fe=null,me=null,he=!1,ge=!1,be=!1,xe=!1,ve=!0,ye=!1;const we="user-content-";let _e=!0,Se=!1,Ce=null,ke={},Te=null;const Ie=Da({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ee=null;const De=Da({},["audio","video","img","source","image","track"]);let Re=null;const Ae=Da({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),je="http://www.w3.org/1998/Math/MathML",Ne="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml";let Me=Oe,Pe=!1,ze=null;const Le=Da({},[je,Ne,Oe],ma),Be=Zi(["mi","mo","mn","ms","mtext"]);let Fe=Da({},Be);const $e=Zi(["annotation-xml"]);let Ue=Da({},$e);const He=Da({},["title","style","font","a","script"]);let We=null;const Ve=["application/xhtml+xml","text/html"];let Ye=null,Ge=null;const qe=r.createElement("form"),Ke=function(e){return e instanceof RegExp||e instanceof Function},Xe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ge&&Ge===e)return;e&&"object"==typeof e||(e={}),e=Aa(e),We=-1===Ve.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ye="application/xhtml+xml"===We?ma:fa,Z=al(e,"ALLOWED_TAGS",J,{transform:Ye}),Q=al(e,"ALLOWED_ATTR",ee,{transform:Ye}),ze=al(e,"ALLOWED_NAMESPACES",Le,{transform:ma}),Re=al(e,"ADD_URI_SAFE_ATTR",Ae,{transform:Ye,base:Ae}),Ee=al(e,"ADD_DATA_URI_TAGS",De,{transform:Ye,base:De}),Te=al(e,"FORBID_CONTENTS",Ie,{transform:Ye}),ne=al(e,"FORBID_TAGS",Aa({}),{transform:Ye}),re=al(e,"FORBID_ATTR",Aa({}),{transform:Ye}),ke=!!Sa(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?Aa(e.USE_PROFILES):e.USE_PROFILES),ie=!1!==e.ALLOW_ARIA_ATTR,ae=!1!==e.ALLOW_DATA_ATTR,le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,se=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ce=e.SAFE_FOR_TEMPLATES||!1,ue=!1!==e.SAFE_FOR_XML,de=e.WHOLE_DOCUMENT||!1,ge=e.RETURN_DOM||!1,be=e.RETURN_DOM_FRAGMENT||!1,xe=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,ve=!1!==e.SANITIZE_DOM,ye=e.SANITIZE_NAMED_PROPS||!1,_e=!1!==e.KEEP_CONTENT,Se=e.IN_PLACE||!1,X=function(e){try{return ka(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ka,Me="string"==typeof e.NAMESPACE?e.NAMESPACE:Oe,Fe=ll(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>Da({},Be)),Ue=ll(e,"HTML_INTEGRATION_POINTS",()=>Da({},$e));const t=ll(e,"CUSTOM_ELEMENT_HANDLING",()=>Qi(null));if(te=Qi(null),Sa(t,"tagNameCheck")&&Ke(t.tagNameCheck)&&(te.tagNameCheck=t.tagNameCheck),Sa(t,"attributeNameCheck")&&Ke(t.attributeNameCheck)&&(te.attributeNameCheck=t.attributeNameCheck),Sa(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(te.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Ji(te),ce&&(ae=!1),be&&(ge=!0),ke&&(Z=Da({},Ba),Q=Qi(null),!0===ke.html&&(Da(Z,Na),Da(Q,Fa)),!0===ke.svg&&(Da(Z,Oa),Da(Q,$a),Da(Q,Ha)),!0===ke.svgFilters&&(Da(Z,Ma),Da(Q,$a),Da(Q,Ha)),!0===ke.mathMl&&(Da(Z,za),Da(Q,Ua),Da(Q,Ha))),oe.tagCheck=null,oe.attributeCheck=null,Sa(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?oe.tagCheck=e.ADD_TAGS:ca(e.ADD_TAGS)&&(Z===J&&(Z=Aa(Z)),Da(Z,e.ADD_TAGS,Ye))),Sa(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?oe.attributeCheck=e.ADD_ATTR:ca(e.ADD_ATTR)&&(Q===ee&&(Q=Aa(Q)),Da(Q,e.ADD_ATTR,Ye))),Sa(e,"ADD_FORBID_CONTENTS")&&ca(e.ADD_FORBID_CONTENTS)&&(Te===Ie&&(Te=Aa(Te)),Da(Te,e.ADD_FORBID_CONTENTS,Ye)),_e&&(Z["#text"]=!0),de&&Da(Z,["html","head","body"]),Z.table&&(Da(Z,["tbody"]),delete ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Ta('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Ta('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=E;E=e.TRUSTED_TYPES_POLICY;try{R=O("")}catch(e){throw E=t,e}}else null===e.TRUSTED_TYPES_POLICY?(E=void 0,R=""):(void 0===E&&(A||(D=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(d,i),A=!0),E=D),E&&"string"==typeof R&&(R=O("")));Zi&&Zi(e),Ge=e},Ze=Da({},[...Oa,...Ma,...Pa]),Je=Da({},[...za,...La]),Qe=function(e){aa(n.removed,{element:e});try{x(e).removeChild(e)}catch(t){if(m(e),!x(e))throw Ta("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},et=function(e,t,n){try{h(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},tt=function(e){it(e);const t=b(e);t&&ra(la(t),e=>{try{m(e)}catch(e){}});const n=1===C(e)?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){const r=n[t],o=r&&r.name;"string"==typeof o&&et(e,r,o)}},nt=function(e,t,r){if(!r)try{r=t.getAttributeNode(e)}catch(e){r=null}aa(n.removed,{attribute:r||null,from:t});try{r?h(t,r):t.removeAttribute(e)}catch(n){try{t.removeAttribute(e)}catch(e){}}if("is"===e)if(ge||be)try{Qe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},rt=function(e){const t=y(e);if(t)for(let n=t.length-1;n>=0;--n){const r=t[n],o=r&&r.name;"string"!=typeof o||Q[Ye(o)]||et(e,r,o)}},ot=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[e];for(;r.length>0;){const e=r.pop();if(!1===t(e))continue;if(n&&1===C(e)){const t=v(e);gt(t)&&r.push(t)}const o=b(e);if(o)for(let e=o.length-1;e>=0;--e)r.push(o[e])}},it=function(e){ot(e,e=>{1===C(e)&&rt(e)})},at=function(e){const t=[];return ot(e,e=>{t.push(e)},!0),t},lt=function(e,t){let r=!1;return ra(n.removed,t=>{t.element&&(r=r||t.element===e,it(t.element))}),function(e,t){const n=ua();ra(at(e),e=>{1===C(e)&&da(n,e)}),ra(t,e=>{1!==C(e)||pa(n,e)||rt(e)})}(e,t),r},st=function(e,t,n,r){const o=dt(e);let i;for(;i=o.nextNode();)pa(r,i)&&!pa(Ce,i)&&(t&&xt($.uponSanitizeShadowNode,i,null),_t(i,n),Dt(i,n),gt(i.content)&&Rt(i.content))},ct=function(e,t){return!!ue&&("patchsrc"===e||"for"===e&&"label"!==t&&"output"!==t)},ut=function(e){let t=null,n=null;if(he)e="<remove></remove>"+e;else{const t=ha(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===We&&Me===Oe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=E?O(e):e;if(Me===Oe)try{t=(new u).parseFromString(o,We)}catch(e){}if(!t||!t.documentElement){t=P.createDocument(Me,"template",null);try{t.documentElement.innerHTML=Pe?R:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Me===Oe?B.call(t,de?"html":"body")[0]:de?t.documentElement:i},dt=function(e){const t=S?S(e):e.ownerDocument;return z.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pt=function(e){return e=ga(e,U," "),e=ga(e,H," "),ga(e,W," ")},ft=function(e){var t;mt(e);const n=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");n&&ra(n,e=>{gt(e.content)&&ft(e.content)})},mt=function(e){e.normalize();const t=S?S(e):e.ownerDocument,n=z.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=pt(r.data),r=n.nextNode()},ht=function(e){const t=_?_(e):null;return"string"==typeof t&&"form"===Ye(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==y(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.removeAttributeNode||"function"!=typeof e.getAttributeNode||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==w(e)||e.childNodes!==b(e))},gt=function(e){if(!w||"object"!=typeof e||null===e)return!1;try{return 11===w(e)}catch(e){return!1}},bt=function(e){if(!w||"object"!=typeof e||null===e)return!1;try{return"number"==typeof w(e)}catch(e){return!1}};function xt(e,t,r){0!==e.length&&ra(e,e=>{e.call(n,t,r,Ge)})}const vt=function(e,t){if(e instanceof RegExp)return ka(e,t);if(e instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Boolean(e(t,...r))}return!1},yt=function(e,t,n,r){return 0===e.length?t:t===n||t===r?Aa(t):t},wt=function(e,t){return e!==t&&null===x(e)&&(Se&&it(e),!0)},_t=function(e,t){if(Ce&&da(Ce,e),xt($.beforeSanitizeElements,e,null),wt(e,t))return!0;if(ht(e))return Qe(e),!0;const r=Ye(k(e));if(Z=yt($.uponSanitizeElement,Z,J,fe),xt($.uponSanitizeElement,e,{tagName:r,allowedTags:Z}),wt(e,t))return!0;if(function(e,t){return!!(ue&&e.hasChildNodes()&&!bt(e.firstElementChild)&&ka(el,e.textContent)&&ka(el,e.innerHTML))||!!(ue&&ol[t]&&1===C(e)&&I(e)===Oe&&(bt(e.firstElementChild)||"string"==typeof e.textContent&&ka(el,e.textContent)))||7===e.nodeType||!(!ue||8!==e.nodeType||!ka(tl,e.data))}(e,r))return Qe(e),!0;if(ne[r]||!(oe.tagCheck instanceof Function&&oe.tagCheck(r))&&!Z[r]){const n=function(e,t,n){if(!ne[t]&&kt(t)&&vt(te.tagNameCheck,t))return!1;if(_e&&!Te[t]&&!Te[fa(t)]){const t=x(e),r=b(e);if(r&&t)for(let o=r.length-1;o>=0;--o){const i=e===n?f(r[o],!0):r[o];t.insertBefore(i,g(e))}}return Qe(e),!0}(e,r,t);return!(!1!==n||(xt($.afterSanitizeElements,e,null),!wt(e,t)))||n}if(1===C(e)&&!function(e){const t=I(e),n=fa(k(e)),r=x(e);let o,i;return r&&1===C(r)?(o={namespaceURI:I(r)},i=fa(k(r))):(o={namespaceURI:Me},i="template"),!!ze[t]&&(t===Ne?function(e,t,n){return t.namespaceURI===Oe?"svg"===e:t.namespaceURI===je?"svg"===e&&("annotation-xml"===n||Fe[n]):Boolean(Ze[e])}(n,o,i):t===je?function(e,t,n){return t.namespaceURI===Oe?"math"===e:t.namespaceURI===Ne?"math"===e&&Ue[n]:Boolean(Je[e])}(n,o,i):t===Oe?function(e,t,n){return!(t.namespaceURI===Ne&&!Ue[n])&&!(t.namespaceURI===je&&!Fe[n])&&!Je[e]&&(He[e]||!Ze[e])}(n,o,i):!("application/xhtml+xml"!==We||!ze[t]))}(e))return Qe(e),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&ka(nl,e.innerHTML))return Qe(e),!0;if(ce&&3===e.nodeType){const t=pt(e.textContent);e.textContent!==t&&(aa(n.removed,{element:e.cloneNode()}),e.textContent=t)}return xt($.afterSanitizeElements,e,null),wt(e,t)},St=function(e,t,n){if(re[t])return!1;if(ct(t,e))return!1;if(ve&&("id"===t||"name"===t)&&(n in r||n in qe))return!1;const o=Q[t]||oe.attributeCheck instanceof Function&&oe.attributeCheck(t,e);return!(!ae||!ka(V,t))||!(!ie||!ka(Y,t))||(o?!(!Re[t]&&!ka(X,ga(n,q,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==ba(n,"data:")||!Ee[e])&&(!le||ka(G,ga(n,q,"")))&&n):kt(e)&&vt(te.tagNameCheck,e)&&vt(te.attributeNameCheck,t,e)||"is"===t&&te.allowCustomizedBuiltInElements&&vt(te.tagNameCheck,n))},Ct=Da({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),kt=function(e){return!Ct[fa(e)]&&ka(K,e)},Tt=function(e,t,n,r){if(E&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!n)switch(d.getAttributeType(e,t)){case"TrustedHTML":return O(r);case"TrustedScriptURL":return function(e){N(),j++;try{return E.createScriptURL(e)}finally{j--}}(r)}return r},It=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!ht(e)||(Qe(e),!1)}catch(n){return nt(t,e),!1}},Et=function(e,t){return!(!ue||!ka(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t))||"attributename"===fa(e)&&null!==ha(t,"href")},Dt=function(e,t){if(xt($.beforeSanitizeAttributes,e,null),wt(e,t))return;const r=e.attributes;if(!r||ht(e))return;Q=yt($.uponSanitizeAttribute,Q,ee,me);const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let i=r.length;const a=Ye(e.nodeName);for(;i--;){const t=r[i],l=t.name,s=t.namespaceURI,c=t.value,u=Ye(l),d=c;let p="value"===l?d:xa(d),f=!1;o.attrName=u,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,xt($.uponSanitizeAttribute,e,o),p=o.attrValue,!ye||"id"!==u&&"name"!==u||0===ba(p,we)||(nt(l,e,t),p=we+p,f=!0),Et(l,p)?nt(l,e,t):o.forceKeepAttr||(!o.keepAttr||!se&&ka(rl,p)?nt(l,e,t):(ce&&(p=pt(p)),St(a,u,p)?(p=Tt(a,u,s,p),p!==d&&It(e,l,s,p)&&f&&ia(n.removed)):nt(l,e,t)))}xt($.afterSanitizeAttributes,e,null),wt(e,t)},Rt=function(e){let t=null;const n=dt(e);for(xt($.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(xt($.uponSanitizeShadowNode,t,null),_t(t,e),Dt(t,e),gt(t.content)&&Rt(t.content),1===C(t)){const e=v(t);gt(e)&&(At(e),Rt(e))}ce&&mt(e),xt($.afterSanitizeShadowDOM,e,null)},At=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){Rt(e.shadow);continue}const n=e.node,r=1===C(n),o=b(n);if(o)for(let e=o.length-1;e>=0;--e)t.push({node:o[e],shadow:null});if(r){const e=_?_(n):null;if("string"==typeof e&&"template"===Ye(e)){const e=n.content;gt(e)&&t.push({node:e,shadow:null})}}if(r){const e=v(n);gt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(Pe=!e,Pe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!bt(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return va(e);case"boolean":return ya(e);case"bigint":return wa?wa(e):"0";case"symbol":return _a?_a(e):"Symbol()";case"undefined":default:return Ca(e);case"function":case"object":{if(null===e)return Ca(e);const t=e,n=ja(t,"toString");if("function"==typeof n){const e=n(t);return"string"==typeof e?e:Ca(e)}return Ca(e)}}}(e)))throw Ta("dirty is not a string, aborting");if(!n.isSupported)return e;pe?(Z=fe,Q=me):Xe(t),($.uponSanitizeElement.length>0||$.uponSanitizeAttribute.length>0)&&(Z=Aa(Z)),$.uponSanitizeAttribute.length>0&&(Q=Aa(Q)),n.removed=[];const s=Se&&"string"!=typeof e&&bt(e);let c=[];const u=Ce;if(s){ue&&ot(e,e=>{const t=C(e);if(7===t||8===t&&ka(tl,e.data)){try{m(e)}catch(e){}return!1}if(1===t){const t=e,n=Ye(k(e));try{t.hasAttribute&&t.hasAttribute("patchsrc")&&t.removeAttribute("patchsrc"),t.hasAttribute&&t.hasAttribute("for")&&ct("for",n)&&t.removeAttribute("for")}catch(e){}}return!0});const t=k(e);if("string"==typeof t){const n=Ye(t);if(!Z[n]||ne[n])throw tt(e),Ta("root node is forbidden and cannot be sanitized in-place")}if(ht(e))throw tt(e),Ta("root node is clobbered and cannot be sanitized in-place");c=at(e),Ce=ua()}else if(bt(e))r=ut("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i),At(r);else{if(!ge&&!ce&&!de&&-1===e.indexOf("<"))return E&&xe?O(e):e;if(r=ut(e),!r)return ge?null:xe?R:""}r&&he&&Qe(r.firstChild);const d=s?e:r;try{s&&At(e);const t=dt(d);for(;a=t.nextNode();)_t(a,d),Dt(a,d),gt(a.content)&&Rt(a.content);s&&function(e,t){const n=Ce;let r=null;const o=()=>(r||(r=ua(),ra(t,e=>{da(r,e)})),r);for(let t=0;;t++){const r=at(e),i=[e];let a=!1;if(ra(r,e=>{11===C(e)?aa(i,e):a||pa(n,e)||(a=pa(o(),e))}),!a)return;if(t>=8)throw Ta("the tree kept changing during in-place sanitization; refusing to return it");ra(i,(t,n)=>{st(t,n>0,e,o())})}}(e,c)}catch(t){throw s&&(tt(e),lt(e,c)),t}finally{Ce=u}if(s){if(lt(e,c))throw Ta("a node selected for removal could not be safely returned; refusing to sanitize in place");return ce&&ft(e),e}if(ge){if(ce&&ft(r),be)for(l=L.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(Q.shadowroot||Q.shadowrootmode)&&(l=F.call(o,l,!0)),l}let p=de?r.outerHTML:r.innerHTML;return de&&Z["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&ka(Ja,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),ce&&(p=pt(p)),E&&xe?O(p):p},n.setConfig=function(){Xe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),pe=!0,fe=Z,me=Q},n.clearConfig=function(){Ge=null,pe=!1,fe=null,me=null,E=D,R=""},n.isValidAttribute=function(e,t,n){Ge||Xe({});const r=Ye(e),o=Ye(t);return("string"!=typeof n||!(Et(t,n)||!se&&ka(rl,n)))&&St(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&Sa($,e)&&aa($[e],t)},n.removeHook=function(e,t){if(Sa($,e)){if(void 0!==t){const n=oa($[e],t);return-1===n?void 0:sa($[e],n,1)[0]}return ia($[e])}},n.removeHooks=function(e){Sa($,e)&&($[e]=[])},n.removeAllHooks=function(){$={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const cl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"/></svg>';function ul(e){if("string"!=typeof e)return"";let t=e.trim().replace(/^(\s*<!--[\s\S]*?-->\s*)+/,"").trim();if(!t.startsWith("<svg")){const e=t.match(/<svg[\s\S]*<\/svg>/i);t=e?e[0]:""}if(!t)return"";const n=pl||("undefined"==typeof window?null:(pl=sl(window),pl.addHook("afterSanitizeAttributes",e=>{if(!e.hasAttribute)return;["href","xlink:href"].forEach(t=>{const n=e.getAttribute(t);null===n||n.trim().startsWith("#")||e.removeAttribute(t)});const t=e.getAttribute("style");null!==t&&dl.test(t)&&e.removeAttribute("style")}),pl));return n?n.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["style","image"]}):""}const dl=/url\s*\(|image|@|\\|expression/i;let pl=null;const fl=(0,l.forwardRef)(function({name:e,iconSet:n,source:r,onClick:o,className:i="",style:a,...l},s){const c=Fi(n,e),u=ul(r||c?.source||"");if(!u)return null;const d={};return"function"==typeof o&&(d.role="button",d.tabIndex=0,d["aria-label"]="Change Icon",d.onClick=o,d.onKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o(e))}),(0,t.jsx)("div",{ref:s,className:"wpcl-icon"+(i?` ${i}`:""),dangerouslySetInnerHTML:{__html:u},style:a,...d,...l})});var ml=i(802);const hl=(e,t)=>e>t?1:e<t?-1:0,gl=1/0,bl=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),xl="eexxaacctt",vl=/\p{P}/gu,yl=["en",{numeric:!0,sensitivity:"base"}],wl=(e,t,n)=>e.replace("A-Z",t).replace("a-z",n),_l={unicode:!1,alpha:null,interSplit:"[^A-Za-z\\d']+",intraSplit:"[a-z][A-Z]",interBound:"[^A-Za-z\\d]",intraBound:"[A-Za-z]\\d|\\d[A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:gl,intraChars:"[a-z\\d']",intraIns:null,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,gl],intraSub:null,intraTrn:null,intraDel:null,intraFilt:(e,t,n)=>!0,toUpper:e=>e.toLocaleUpperCase(),toLower:e=>e.toLocaleLowerCase(),compare:null,sort:(e,t,n,r=hl)=>{let{idx:o,chars:i,terms:a,interLft2:l,interLft1:s,start:c,intraIns:u,interIns:d,cases:p}=e;return o.map((e,t)=>t).sort((e,n)=>i[n]-i[e]||u[e]-u[n]||a[n]+l[n]+.5*s[n]-(a[e]+l[e]+.5*s[e])||d[e]-d[n]||c[e]-c[n]||p[n]-p[e]||r(t[o[e]],t[o[n]]))}},Sl=(e,t)=>0==t?"":1==t?e+"??":t==gl?e+"*?":e+`{0,${t}}?`,Cl="(?:\\b|_)";function kl(e){e=Object.assign({},_l,e);let{unicode:t,interLft:n,interRgt:r,intraMode:o,intraSlice:i,intraIns:a,intraSub:l,intraTrn:s,intraDel:c,intraContr:u,intraSplit:d,interSplit:p,intraBound:f,interBound:m,intraChars:h,toUpper:g,toLower:b,compare:x}=e;a??=o,l??=o,s??=o,c??=o,x??="undefined"==typeof Intl?hl:new Intl.Collator(...yl).compare;let v=e.letters??e.alpha;if(null!=v){let e=g(v),t=b(v);p=wl(p,e,t),d=wl(d,e,t),m=wl(m,e,t),f=wl(f,e,t),h=wl(h,e,t),u=wl(u,e,t)}let y=t?"u":"";const w='".+?"',_=new RegExp(w,"gi"+y),S=new RegExp(`(?:\\s+|^)-(?:${h}+|${w})`,"gi"+y);let{intraRules:C}=e;null==C&&(C=e=>{let t=_l.intraSlice,n=0,r=0,o=0,u=0;if(/[^\d]/.test(e)){let d=e.length;d<=4?d>=3&&(o=Math.min(s,1),4==d&&(n=Math.min(a,1))):(t=i,n=a,r=l,o=s,u=c)}return{intraSlice:t,intraIns:n,intraSub:r,intraTrn:o,intraDel:u}});let k=!!d,T=new RegExp(d,"g"+y),I=new RegExp(p,"g"+y),E=new RegExp("^"+p+"|"+p+"$","g"+y),D=new RegExp(u,"gi"+y);const R=(e,t=!1)=>{let n=[];e=(e=e.replace(_,e=>(n.push(e),xl))).replace(E,""),t||(e=b(e)),k&&(e=e.replace(T,e=>e[0]+" "+e[1]));let r=0;return e.split(I).filter(e=>""!=e).map(e=>e===xl?n[r++]:e)},A=/[^\d]+|\d+/g,j=(t,i=0,l=!1)=>{let s=R(t);if(0==s.length)return[];let c,u=Array(s.length).fill("");if(s=s.map((e,t)=>e.replace(D,e=>(u[t]=e,""))),1==o)c=s.map((e,t)=>{if('"'===e[0])return bl(e.slice(1,-1));let n="";for(let r of e.matchAll(A)){let e=r[0],{intraSlice:o,intraIns:i,intraSub:a,intraTrn:l,intraDel:s}=C(e);if(i+a+l+s==0)n+=e+u[t];else{let[r,c]=o,d=e.slice(0,r),p=e.slice(c),f=e.slice(r,c);1==i&&1==d.length&&d!=f[0]&&(d+="(?!"+d+")");let m=f.length,g=[e];if(a)for(let e=0;e<m;e++)g.push(d+f.slice(0,e)+h+f.slice(e+1)+p);if(l)for(let e=0;e<m-1;e++)f[e]!=f[e+1]&&g.push(d+f.slice(0,e)+f[e+1]+f[e]+f.slice(e+2)+p);if(s)for(let e=0;e<m;e++)g.push(d+f.slice(0,e+1)+"?"+f.slice(e+1)+p);if(i){let e=Sl(h,1);for(let t=0;t<m;t++)g.push(d+f.slice(0,t)+e+f.slice(t)+p)}n+="(?:"+g.join("|")+")"+u[t]}}return n});else{let e=Sl(h,a);2==i&&a>0&&(e=")("+e+")("),c=s.map((t,n)=>'"'===t[0]?bl(t.slice(1,-1)):t.split("").map((e,t,n)=>(1==a&&0==t&&n.length>1&&e!=n[t+1]&&(e+="(?!"+e+")"),e)).join(e)+u[n])}let d=2==n?Cl:"",p=2==r?Cl:"",f=p+Sl(e.interChars,e.interIns)+d;return i>0?l?c=d+"("+c.join(")"+p+"|"+d+"(")+")"+p:(c="("+c.join(")("+f+")(")+")",c="(.??"+d+")"+c+"("+p+".*)"):(c=c.join(f),c=d+c+p),[new RegExp(c,"i"+y),s,u]},N=(e,t,n)=>{let[r]=j(t);if(null==r)return null;let o=[];if(null!=n)for(let t=0;t<n.length;t++){let i=n[t];r.test(e[i])&&o.push(i)}else for(let t=0;t<e.length;t++)r.test(e[t])&&o.push(t);return o};let O=!!f,M=new RegExp(m,y),P=new RegExp(f,y);const z=(t,o,i)=>{let[a,l,s]=j(i,1),c=R(i,!0),[u]=j(i,2),d=l.length,p=Array(d),f=Array(d);for(let e=0;e<d;e++){let t=l[e],n=c[e],r='"'==t[0]?t.slice(1,-1):t+s[e],o='"'==n[0]?n.slice(1,-1):n+s[e];p[e]=r,f[e]=o}let m=t.length,h=Array(m).fill(0),g={idx:Array(m),start:h.slice(),chars:h.slice(),cases:h.slice(),terms:h.slice(),interIns:h.slice(),intraIns:h.slice(),interLft2:h.slice(),interRgt2:h.slice(),interLft1:h.slice(),interRgt1:h.slice(),ranges:Array(m)},x=1==n||1==r,v=0;for(let i=0;i<t.length;i++){let l=o[t[i]],s=l.match(a),c=s.index+s[1].length,m=c,h=!1,w=0,_=0,S=0,C=0,k=0,T=0,I=0,E=0,D=0,R=[];for(let t=0,o=2;t<d;t++,o+=2){let i=b(s[o]),a=p[t],u=f[t],g=a.length,v=i.length,A=i==a;if(s[o]==u&&I++,!A&&s[o+1].length>=g){let e=b(s[o+1]).indexOf(a);e>-1&&(R.push(m,v,e,g),m+=L(s,o,e,g),i=a,v=g,A=!0,0==t&&(c=m))}if(x||A){let e=m-1,u=m+v,d=!1,p=!1;if(-1==e||M.test(l[e]))A&&w++,d=!0;else{if(2==n){h=!0;break}if(O&&P.test(l[e]+l[e+1]))A&&_++,d=!0;else if(1==n){let e=s[o+1],n=m+v;if(e.length>=g){let r,u=0,p=!1,f=new RegExp(a,"ig"+y);for(;r=f.exec(e);){u=r.index;let e=n+u,t=e-1;if(-1==t||M.test(l[t])){w++,p=!0;break}if(P.test(l[t]+l[e])){_++,p=!0;break}}p&&(d=!0,R.push(m,v,u,g),m+=L(s,o,u,g),i=a,v=g,A=!0,0==t&&(c=m))}if(!d){h=!0;break}}}if(u==l.length||M.test(l[u]))A&&S++,p=!0;else{if(2==r){h=!0;break}if(O&&P.test(l[u-1]+l[u]))A&&C++,p=!0;else if(1==r){h=!0;break}}A&&(k+=g,d&&p&&T++)}if(v>g&&(D+=v-g),t>0&&(E+=s[o-1].length),!e.intraFilt(a,i,m)){h=!0;break}t<d-1&&(m+=v+s[o+1].length)}if(!h){g.idx[v]=t[i],g.interLft2[v]=w,g.interLft1[v]=_,g.interRgt2[v]=S,g.interRgt1[v]=C,g.chars[v]=k,g.terms[v]=T,g.cases[v]=I,g.interIns[v]=E,g.intraIns[v]=D,g.start[v]=c;let e=l.match(u),n=e.index+e[1].length,r=R.length,o=r>0?0:1/0,a=r-4;for(let t=2;t<e.length;){let r=e[t].length;if(o<=a&&R[o]==n){let r=R[o+1],i=R[o+2],a=R[o+3],l=t,s="";for(let t=0;t<r;l++)s+=e[l],t+=e[l].length;e.splice(t,l-t,s),n+=L(e,t,i,a),o+=4}else n+=r,t++}n=e.index+e[1].length;let s=g.ranges[v]=[],d=n,p=n;for(let t=2;t<e.length;t++){let r=e[t].length;n+=r,t%2==0?p=n:r>0&&(s.push(d,p),d=p=n)}p>d&&s.push(d,p),v++}}if(v<t.length)for(let e in g)g[e]=g[e].slice(0,v);return g},L=(e,t,n,r)=>{let o=e[t]+e[t+1].slice(0,n);return e[t-1]+=o,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),o.length};return{search:(...t)=>((t,n,r,o=1e3,i)=>{r=r?!0===r?5:r:0;let a=null,l=null,s=[];n=n.replace(S,e=>{let t=e.trim().slice(1);return t='"'===t[0]?bl(t.slice(1,-1)):t.replace(vl,""),""!=t&&s.push(t),""});let c,u=R(n);if(s.length>0){if(c=new RegExp(s.join("|"),"i"+y),0==u.length){let e=[];for(let n=0;n<t.length;n++)c.test(t[n])||e.push(n);return[e,null,null]}}else if(0==u.length)return[null,null,null];if(r>0){let e=R(n);if(e.length>1){let n=e.slice().sort((e,t)=>t.length-e.length);for(let e=0;e<n.length;e++){if(0==i?.length)return[[],null,null];i=N(t,n[e],i)}if(e.length>r)return[i,null,null];a=Il(e).map(e=>e.join(" ")),l=[];let o=new Set;for(let e=0;e<a.length;e++)if(o.size<i.length){let n=i.filter(e=>!o.has(e)),r=N(t,a[e],n);for(let e=0;e<r.length;e++)o.add(r[e]);l.push(r)}else l.push([])}}null==a&&(a=[n],l=[i?.length>0?i:N(t,n)]);let d=null,p=null;if(s.length>0&&(l=l.map(e=>e.filter(e=>!c.test(t[e])))),l.reduce((e,t)=>e+t.length,0)<=o){d={},p=[];for(let n=0;n<l.length;n++){let r=l[n];if(null==r||0==r.length)continue;let o=a[n],i=z(r,t,o),s=e.sort(i,t,o,x);if(n>0)for(let e=0;e<s.length;e++)s[e]+=p.length;for(let e in i)d[e]=(d[e]??[]).concat(i[e]);p=p.concat(s)}}return[[].concat(...l),d,p]})(...t),split:R,filter:N,info:z,sort:e.sort}}const Tl=(()=>{let e={A:"ÁÀÃÂÄĄĂÅ",a:"áàãâäąăå",E:"ÉÈÊËĖĚ",e:"éèêëęě",I:"ÍÌÎÏĮİ",i:"íìîïįı",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲŮŰ",u:"úùûüūųůű",C:"ÇČĆ",c:"çčć",D:"Ď",d:"ď",G:"Ğ",g:"ğ",L:"Ł",l:"ł",N:"ÑŃŇ",n:"ñńň",S:"ŠŚȘŞ",s:"šśșş",T:"ŢȚŤ",t:"ţțť",Y:"Ý",y:"ý",Z:"ŻŹŽ",z:"żźž"},t={},n="";for(let r in e)e[r].split("").forEach(e=>{n+=e,t[e]=r});let r=new RegExp(`[${n}]`,"g"),o=e=>t[e];return e=>{if("string"==typeof e)return e.replace(r,o);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n].replace(r,o);return t}})();function Il(e){let t,n,r=(e=e.slice()).length,o=[e.slice()],i=new Array(r).fill(0),a=1;for(;a<r;)i[a]<a?(t=a%2&&i[a],n=e[a],e[a]=e[t],e[t]=n,++i[a],a=1,o.push(e.slice())):(i[a]=0,++a);return o}const El=(e,t)=>t?`<mark>${e}</mark>`:e,Dl=(e,t)=>e+t;function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rl.apply(null,arguments)}function Al(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jl(e,t){return jl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jl(e,t)}kl.latinize=Tl,kl.permute=e=>Il([...Array(e.length).keys()]).sort((e,t)=>{for(let n=0;n<e.length;n++)if(e[n]!=t[n])return e[n]-t[n];return 0}).map(t=>t.map(t=>e[t])),kl.highlight=function(e,t,n=El,r="",o=Dl){r=o(r,n(e.substring(0,t[0]),!1))??r;for(let i=0;i<t.length;i+=2){let a=t[i],l=t[i+1];r=o(r,n(e.substring(a,l),!0))??r,i<t.length-3&&(r=o(r,n(e.substring(t[i+1],t[i+2]),!1))??r)}return o(r,n(e.substring(t[t.length-1]),!1))??r};var Nl=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ol(e,t){return e===t||!(!Nl(e)||!Nl(t))}function Ml(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Ol(e[n],t[n]))return!1;return!0}const Pl=function(e,t){var n;void 0===t&&(t=Ml);var r,o=[],i=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&n===this&&t(a,o)||(r=e.apply(this,a),i=!0,n=this,o=a),r}};var zl="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function Ll(e){cancelAnimationFrame(e.id)}var Bl=-1;function Fl(e){if(void 0===e&&(e=!1),-1===Bl||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Bl=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Bl}var $l=null;function Ul(e){if(void 0===e&&(e=!1),null===$l||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?$l="positive-descending":(t.scrollLeft=1,$l=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),$l}return $l}var Hl=function(e,t){return e};function Wl(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,s=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){var t,d;function p(t){var r;return(r=e.call(this,t)||this)._instanceProps=s(r.props,Al(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:Al(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Pl(function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})}),r._callOnScroll=void 0,r._callOnScroll=Pl(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,i=r.props,a=i.direction,l=i.itemSize,s=i.layout,u=r._getItemStyleCache(c&&l,c&&s,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),p=o(r.props,e,r._instanceProps),f="horizontal"===a||"horizontal"===s,m="rtl"===a,h=f?d:0;u[e]=t={position:"absolute",left:m?void 0:h,right:m?h:void 0,top:f?0:d,height:f?"100%":p,width:f?p:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=Pl(function(e,__,t){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===o)return null;var t=r.props.direction,a=o;if("rtl"===t)switch(Ul()){case"negative":a=-o;break;case"positive-descending":a=i-n-o}return a=Math.max(0,Math.min(a,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;r.setState(function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){var e,t,n,o;null!==r._resetIsScrollingTimeoutId&&Ll(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=(e=r._resetIsScrolling,t=150,n=zl(),o={id:requestAnimationFrame(function r(){zl()-n>=t?e.call(null):o.id=requestAnimationFrame(r)})})},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}d=e,(t=p).prototype=Object.create(d.prototype),t.prototype.constructor=t,jl(t,d),p.getDerivedStateFromProps=function(e,t){return Vl(e,t),u(e),null};var f=p.prototype;return f.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},f.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,o=n.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var l=0;if(this._outerRef){var s=this._outerRef;l="vertical"===o?s.scrollWidth>s.clientWidth?Fl():0:s.scrollHeight>s.clientHeight?Fl():0}this.scrollTo(i(this.props,e,t,a,this._instanceProps,l))},f.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===r?o.scrollLeft=n:o.scrollTop=n}this._callPropsCallbacks()},f.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,o=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(Ul()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},f.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Ll(this._resetIsScrollingTimeoutId)},f.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,i=e.height,a=e.innerRef,l=e.innerElementType,s=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,p=void 0===d?Hl:d,f=e.layout,m=e.outerElementType,h=e.outerTagName,g=e.style,b=e.useIsScrolling,x=e.width,v=this.state.isScrolling,y="horizontal"===o||"horizontal"===f,w=y?this._onScrollHorizontal:this._onScrollVertical,_=this._getRangeToRender(),S=_[0],C=_[1],k=[];if(c>0)for(var T=S;T<=C;T++)k.push((0,se.createElement)(t,{data:u,key:p(T,u),index:T,isScrolling:b?v:void 0,style:this._getItemStyle(T)}));var I=r(this.props,this._instanceProps);return(0,se.createElement)(m||h||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:Rl({position:"relative",height:i,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},g)},(0,se.createElement)(l||s||"div",{children:k,ref:a,style:{height:y?"100%":I,pointerEvents:v?"none":void 0,width:y?I:"100%"}}))},f._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],o=e[3];this._callOnItemsRendered(t,n,r,o)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,l=i.scrollOffset,s=i.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},f._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,o=r.isScrolling,i=r.scrollDirection,s=r.scrollOffset;if(0===t)return[0,0,0,0];var c=a(this.props,s,this._instanceProps),u=l(this.props,c,s,this._instanceProps),d=o&&"backward"!==i?1:Math.max(1,n),p=o&&"forward"!==i?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+p)),c,u]},p}(se.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Vl=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Yl=function(e,t,n){var r=e.itemSize,o=n.itemMetadataMap,i=n.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var l=o[i];a=l.offset+l.size}for(var s=i+1;s<=t;s++){var c=r(s);o[s]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return o[t]},Gl=function(e,t,n,r,o){for(;r<=n;){var i=r+Math.floor((n-r)/2),a=Yl(e,i,t).offset;if(a===o)return i;a<o?r=i+1:a>o&&(n=i-1)}return r>0?r-1:0},ql=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=n&&(i=n-1),i>=0){var l=r[i];a=l.offset+l.size}return a+(n-i-1)*o},Kl=Wl({getItemOffset:function(e,t,n){return Yl(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:ql,getOffsetForIndexAndAlignment:function(e,t,n,r,o,i){var a=e.direction,l=e.height,s=e.layout,c=e.width,u="horizontal"===a||"horizontal"===s?c:l,d=Yl(e,t,o),p=ql(e,o),f=Math.max(0,Math.min(p-u,d.offset)),m=Math.max(0,d.offset-u+d.size+i);switch("smart"===n&&(n=r>=m-u&&r<=f+u?"auto":"center"),n){case"start":return f;case"end":return m;case"center":return Math.round(m+(f-m)/2);default:return r>=m&&r<=f?r:r<m?m:f}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?r[o].offset:0)>=n?Gl(e,t,o,0,n):function(e,t,n,r){for(var o=e.itemCount,i=1;n<o&&Yl(e,n,t).offset<r;)n+=i,i*=2;return Gl(e,t,Math.min(n,o-1),Math.floor(n/2),r)}(e,t,Math.max(0,o),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var o=e.direction,i=e.height,a=e.itemCount,l=e.layout,s=e.width,c="horizontal"===o||"horizontal"===l?s:i,u=Yl(e,t,r),d=n+c,p=u.offset+u.size,f=t;f<a-1&&p<d;)f++,p+=Yl(e,f,r).size;return f},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});const Xl=ml.css`
|
|
962
|
-
svg[fill="none"] {
|
|
963
|
-
fill: none;
|
|
964
|
-
stroke: currentColor;
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
svg:not([fill="none"]) {
|
|
968
|
-
fill: currentColor;
|
|
969
|
-
}
|
|
970
|
-
`,Zl=ml.css`
|
|
971
|
-
.wpcl-icon-picker-modal {
|
|
972
|
-
display: flex;
|
|
973
|
-
flex-direction: column;
|
|
974
|
-
max-height: 85vh;
|
|
975
|
-
|
|
976
|
-
.components-modal__content {
|
|
977
|
-
padding: 0;
|
|
978
|
-
/* Single scroll container (the icon grid). Avoid nested scroll with search. */
|
|
979
|
-
overflow: hidden;
|
|
980
|
-
display: flex;
|
|
981
|
-
flex-direction: column;
|
|
982
|
-
flex: 1;
|
|
983
|
-
min-height: 0;
|
|
984
|
-
}
|
|
985
|
-
.components-modal__header {
|
|
986
|
-
padding: 8px 16px;
|
|
987
|
-
border-bottom: 1px solid #e0e0e0;
|
|
988
|
-
flex-shrink: 0;
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
`,Jl=S().div`
|
|
992
|
-
display: flex;
|
|
993
|
-
flex-direction: column;
|
|
994
|
-
gap: 8px;
|
|
995
|
-
padding: 12px 16px 16px;
|
|
996
|
-
flex: 1;
|
|
997
|
-
min-height: 0;
|
|
998
|
-
overflow: hidden;
|
|
999
|
-
`,Ql=S().div`
|
|
1000
|
-
flex-shrink: 0;
|
|
1001
|
-
display: flex;
|
|
1002
|
-
flex-direction: column;
|
|
1003
|
-
gap: 8px;
|
|
1004
|
-
position: sticky;
|
|
1005
|
-
top: 0;
|
|
1006
|
-
z-index: 2;
|
|
1007
|
-
background: #fff;
|
|
1008
|
-
`,es=S().div`
|
|
1009
|
-
display: flex;
|
|
1010
|
-
gap: 8px;
|
|
1011
|
-
align-items: center;
|
|
1012
|
-
|
|
1013
|
-
/* SearchControl takes remaining width */
|
|
1014
|
-
.components-search-control {
|
|
1015
|
-
flex: 1;
|
|
1016
|
-
margin-bottom: 0 !important;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
/* Normalize input/select heights so they visually align */
|
|
1020
|
-
.components-search-control__input,
|
|
1021
|
-
.components-select-control__input {
|
|
1022
|
-
height: 36px !important;
|
|
1023
|
-
min-height: 36px !important;
|
|
1024
|
-
box-sizing: border-box;
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
.components-base-control {
|
|
1028
|
-
margin-bottom: 0 !important;
|
|
1029
|
-
}
|
|
1030
|
-
`,ts=S().div`
|
|
1031
|
-
flex-shrink: 0;
|
|
1032
|
-
width: 180px;
|
|
1033
|
-
`,ns=S().p`
|
|
1034
|
-
margin: 0;
|
|
1035
|
-
font-size: 11px;
|
|
1036
|
-
color: #757575;
|
|
1037
|
-
`,rs=S().div`
|
|
1038
|
-
box-sizing: border-box;
|
|
1039
|
-
height: 100%;
|
|
1040
|
-
`,os=S().div`
|
|
1041
|
-
display: flex;
|
|
1042
|
-
align-items: center;
|
|
1043
|
-
padding: 0 4px;
|
|
1044
|
-
font-size: 11px;
|
|
1045
|
-
font-weight: 600;
|
|
1046
|
-
text-transform: uppercase;
|
|
1047
|
-
letter-spacing: 0.06em;
|
|
1048
|
-
color: #757575;
|
|
1049
|
-
border-bottom: 1px solid #f0f0f0;
|
|
1050
|
-
box-sizing: border-box;
|
|
1051
|
-
margin-bottom: 0.5rem;
|
|
1052
|
-
padding-bottom: 0.5rem;
|
|
1053
|
-
margin-top: 1rem;
|
|
1054
|
-
`,is=S().div`
|
|
1055
|
-
flex: 1;
|
|
1056
|
-
min-height: 520px;
|
|
1057
|
-
overflow: hidden;
|
|
1058
|
-
display: flex;
|
|
1059
|
-
flex-direction: column;
|
|
1060
|
-
|
|
1061
|
-
/* Scrollbar for the react-window outer div */
|
|
1062
|
-
.wpcl-icon-picker-modal__list::-webkit-scrollbar {
|
|
1063
|
-
width: 6px;
|
|
1064
|
-
}
|
|
1065
|
-
.wpcl-icon-picker-modal__list::-webkit-scrollbar-thumb {
|
|
1066
|
-
background: #c7c7c7;
|
|
1067
|
-
border-radius: 3px;
|
|
1068
|
-
}
|
|
1069
|
-
`,as=S().div`
|
|
1070
|
-
display: grid;
|
|
1071
|
-
grid-template-columns: repeat(8, 1fr);
|
|
1072
|
-
gap: 8px;
|
|
1073
|
-
padding: 4px 0;
|
|
1074
|
-
box-sizing: border-box;
|
|
1075
|
-
align-items: stretch;
|
|
1076
|
-
height: 100%;
|
|
1077
|
-
overflow: hidden;
|
|
1078
|
-
`,ls=S().button`
|
|
1079
|
-
display: flex;
|
|
1080
|
-
flex-direction: column;
|
|
1081
|
-
align-items: center;
|
|
1082
|
-
justify-content: flex-start;
|
|
1083
|
-
gap: 6px;
|
|
1084
|
-
padding: 14px 6px 8px;
|
|
1085
|
-
height: 108px;
|
|
1086
|
-
background: #fff;
|
|
1087
|
-
border: 1px solid #e0e0e0;
|
|
1088
|
-
border-radius: 6px;
|
|
1089
|
-
cursor: pointer;
|
|
1090
|
-
color: #1e1e1e;
|
|
1091
|
-
width: 100%;
|
|
1092
|
-
box-sizing: border-box;
|
|
1093
|
-
transition: border-color 0.1s ease;
|
|
1094
|
-
|
|
1095
|
-
&:hover,
|
|
1096
|
-
&:focus-visible {
|
|
1097
|
-
border-color: #c7c7c7;
|
|
1098
|
-
|
|
1099
|
-
.cell-name {
|
|
1100
|
-
text-decoration: underline;
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
&:focus-visible {
|
|
1105
|
-
outline: 2px solid var(--wp-admin-theme-color, #007cba);
|
|
1106
|
-
outline-offset: -2px;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
&.is-selected {
|
|
1110
|
-
border-color: var(--wp-admin-theme-color, #007cba);
|
|
1111
|
-
background: color-mix(
|
|
1112
|
-
in srgb,
|
|
1113
|
-
var(--wp-admin-theme-color, #007cba) 8%,
|
|
1114
|
-
#fff
|
|
1115
|
-
);
|
|
1116
|
-
|
|
1117
|
-
.cell-name {
|
|
1118
|
-
color: var(--wp-admin-theme-color, #007cba);
|
|
1119
|
-
text-decoration: none;
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
`,ss=S().span`
|
|
1123
|
-
display: flex;
|
|
1124
|
-
align-items: center;
|
|
1125
|
-
justify-content: center;
|
|
1126
|
-
width: 24px;
|
|
1127
|
-
height: 24px;
|
|
1128
|
-
flex-shrink: 0;
|
|
1129
|
-
overflow: hidden;
|
|
1130
|
-
|
|
1131
|
-
svg {
|
|
1132
|
-
width: 24px;
|
|
1133
|
-
height: 24px;
|
|
1134
|
-
min-width: 24px;
|
|
1135
|
-
min-height: 24px;
|
|
1136
|
-
display: block;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
${Xl}
|
|
1140
|
-
`,cs=S().span`
|
|
1141
|
-
font-size: 11px;
|
|
1142
|
-
line-height: 1.3;
|
|
1143
|
-
text-align: center;
|
|
1144
|
-
width: 100%;
|
|
1145
|
-
display: -webkit-box;
|
|
1146
|
-
-webkit-box-orient: vertical;
|
|
1147
|
-
-webkit-line-clamp: 4;
|
|
1148
|
-
overflow: hidden;
|
|
1149
|
-
color: #757575;
|
|
1150
|
-
`,us=S().div`
|
|
1151
|
-
flex: 1;
|
|
1152
|
-
display: flex;
|
|
1153
|
-
align-items: center;
|
|
1154
|
-
justify-content: center;
|
|
1155
|
-
padding: 32px 16px;
|
|
1156
|
-
text-align: center;
|
|
1157
|
-
color: #757575;
|
|
1158
|
-
font-size: 13px;
|
|
1159
|
-
`,ds=S().div`
|
|
1160
|
-
display: flex;
|
|
1161
|
-
align-items: center;
|
|
1162
|
-
gap: 5px;
|
|
1163
|
-
font-size: 11px;
|
|
1164
|
-
color: #757575;
|
|
1165
|
-
white-space: nowrap;
|
|
1166
|
-
margin-right: 8px;
|
|
1167
|
-
padding: 0.25rem 0.5rem;
|
|
1168
|
-
background: #f0f0f0;
|
|
1169
|
-
border-radius: 3px;
|
|
1170
|
-
`,ps=S().span`
|
|
1171
|
-
display: flex;
|
|
1172
|
-
align-items: center;
|
|
1173
|
-
justify-content: center;
|
|
1174
|
-
width: 20px;
|
|
1175
|
-
height: 20px;
|
|
1176
|
-
overflow: hidden;
|
|
1177
|
-
flex-shrink: 0;
|
|
1178
|
-
color: #1e1e1e;
|
|
1179
|
-
|
|
1180
|
-
svg {
|
|
1181
|
-
width: 20px;
|
|
1182
|
-
height: 20px;
|
|
1183
|
-
display: block;
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
${Xl}
|
|
1187
|
-
`,fs=S().span`
|
|
1188
|
-
display: flex;
|
|
1189
|
-
align-items: center;
|
|
1190
|
-
justify-content: center;
|
|
1191
|
-
width: 20px;
|
|
1192
|
-
height: 20px;
|
|
1193
|
-
overflow: hidden;
|
|
1194
|
-
flex-shrink: 0;
|
|
1195
|
-
color: inherit;
|
|
1196
|
-
|
|
1197
|
-
svg {
|
|
1198
|
-
width: 20px;
|
|
1199
|
-
height: 20px;
|
|
1200
|
-
display: block;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
${Xl}
|
|
1204
|
-
`,ms=S().span`
|
|
1205
|
-
overflow: hidden;
|
|
1206
|
-
text-overflow: ellipsis;
|
|
1207
|
-
white-space: nowrap;
|
|
1208
|
-
`,hs=S().span`
|
|
1209
|
-
display: flex;
|
|
1210
|
-
align-items: center;
|
|
1211
|
-
justify-content: center;
|
|
1212
|
-
width: 24px;
|
|
1213
|
-
height: 24px;
|
|
1214
|
-
overflow: hidden;
|
|
1215
|
-
flex-shrink: 0;
|
|
1216
|
-
|
|
1217
|
-
/* Match wp-blocks toolbar rules; overrides SVG width/height attributes. */
|
|
1218
|
-
svg {
|
|
1219
|
-
display: block;
|
|
1220
|
-
width: 24px !important;
|
|
1221
|
-
height: 24px !important;
|
|
1222
|
-
min-width: 0;
|
|
1223
|
-
min-height: 0;
|
|
1224
|
-
max-width: 24px;
|
|
1225
|
-
max-height: 24px;
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
${Xl}
|
|
1229
|
-
`,gs=S().div`
|
|
1230
|
-
display: inline-flex;
|
|
1231
|
-
align-items: center;
|
|
1232
|
-
justify-content: center;
|
|
1233
|
-
cursor: pointer;
|
|
1234
|
-
|
|
1235
|
-
svg {
|
|
1236
|
-
display: block;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
${Xl}
|
|
1240
|
-
`,bs=new kl,xs=8,vs=116,ys=48,ws=520,_s=200,Ss=(0,l.memo)(function({icon:e,isSelected:n,onSelect:r}){const o=(0,l.useCallback)(()=>r(e),[e,r]),i=(0,l.useCallback)(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r(e))},[e,r]),a=e.label||e.name;return(0,t.jsxs)(ls,{type:"button",className:n?"is-selected":void 0,onClick:o,onKeyDown:i,title:a,"aria-label":a,"aria-pressed":n,children:[(0,t.jsx)(ss,{dangerouslySetInnerHTML:{__html:ul(e.source)}}),(0,t.jsx)(cs,{className:"cell-name",children:a})]})}),Cs=(0,l.memo)(function({index:e,style:n,data:r}){const{rows:o,selectedIcon:i,onSelect:a}=r,l=o[e];return"header"===l.type?(0,t.jsx)(rs,{style:n,children:(0,t.jsx)(os,{children:l.label})}):(0,t.jsx)(as,{style:n,children:l.items.map(e=>(0,t.jsx)(Ss,{icon:e,isSelected:i?.name===e.name&&i?.iconSet===e.iconSet,onSelect:a},`${e.iconSet}::${e.name}`))})});function ks({value:e,onChange:n,onClose:r}){const[o,i]=(0,l.useState)(""),[a,s]=(0,l.useState)(""),{groups:c,isLoading:u,isInitialLoad:d}=$i(),f=(0,l.useMemo)(()=>[{label:(0,m.__)("All Libraries","wp-component-library"),value:""},...c.map(e=>({label:e.label,value:e.name}))],[c]),h=(0,l.useMemo)(()=>c.flatMap(e=>e.icons),[c]),g=(0,l.useMemo)(()=>h.map(e=>`${e.label??""} ${e.name}`),[h]),b=(0,l.useMemo)(()=>{const e=a?c.filter(e=>e.name===a):c,t=o.trim();if(!t)return e;const n=bs.filter(g,t);if(!n||!n.length)return[];const r=new Set(n.map(e=>`${h[e].iconSet}::${h[e].name}`));return e.map(e=>({...e,icons:e.icons.filter(e=>r.has(`${e.iconSet}::${e.name}`))})).filter(e=>e.icons.length>0)},[o,a,c,h,g]),x=(0,l.useMemo)(()=>function(e){const t=[];for(const n of e)if(n.icons.length){t.push({type:"header",label:n.label});for(let e=0;e<n.icons.length;e+=xs)t.push({type:"icons",items:n.icons.slice(e,e+xs)})}return t}(b),[b]),v=(0,l.useMemo)(()=>`${a}\0${o.trim()}\0${x.map(e=>"header"===e.type?`h:${e.label}`:`i:${e.items.map(e=>e.name).join(",")}`).join("\n")}`,[a,o,x]),y=(0,l.useRef)(null),w=(0,l.useRef)(null),[_,S]=(0,l.useState)(ws);(0,l.useLayoutEffect)(()=>{const e=w.current;if(!e)return;const t=()=>{const t=Math.floor(e.getBoundingClientRect().height);t>=_s&&S(t)};t();const n=new window.ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const C=(0,l.useCallback)(()=>{y.current?.scrollTo(0);let e=w.current?.parentElement;for(;e;){const{overflowY:t}=window.getComputedStyle(e);"auto"!==t&&"scroll"!==t||(e.scrollTop=0),e=e.parentElement}},[]);(0,l.useEffect)(()=>{C()},[v,C]);const k=(0,l.useCallback)(e=>{const t=x[e];return t?"header"===t.type?`header:${t.label}`:`icons:${t.items.map(e=>`${e.iconSet}::${e.name}`).join("|")}`:`row-${e}`},[x]),T=(0,l.useCallback)(e=>"header"===x[e]?.type?ys:vs,[x]),I=(0,l.useMemo)(()=>b.reduce((e,t)=>e+t.icons.length,0),[b]),E=(0,l.useCallback)(e=>{n({name:e.name,iconSet:e.iconSet,source:e.source,label:e.label}),r()},[n,r]),D=(0,l.useMemo)(()=>({rows:x,selectedIcon:e,onSelect:E}),[x,e,E]),R=e?.source?(0,t.jsxs)(ds,{children:[(0,m.__)("Selected:","wp-component-library"),(0,t.jsx)(ps,{dangerouslySetInnerHTML:{__html:ul(e.source)}})]}):void 0;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ml.Global,{styles:Zl}),(0,t.jsx)(p.Modal,{title:(0,m.__)("Choose Icon","wp-component-library"),headerActions:R,size:"large",onRequestClose:r,className:"wpcl-icon-picker-modal",children:(0,t.jsxs)(Jl,{children:[(0,t.jsxs)(Ql,{children:[(0,t.jsxs)(es,{children:[(0,t.jsx)(p.SearchControl,{__nextHasNoMarginBottom:!0,value:o,onChange:i,placeholder:(0,m.__)("Search icons…","wp-component-library")}),c.length>1&&(0,t.jsx)(ts,{children:(0,t.jsx)(p.SelectControl,{__nextHasNoMarginBottom:!0,value:a,options:f,onChange:s,"aria-label":(0,m.__)("Filter by icon library","wp-component-library")})})]}),(0,t.jsx)(ns,{children:u&&I>0?(0,m.sprintf)(/* translators: %d = number of icons loaded so far */ /* translators: %d = number of icons loaded so far */
|
|
1241
|
-
(0,m.__)("%d icon(s) loaded — loading more…","wp-component-library"),I):I>0?(0,m.sprintf)(/* translators: %d = number of icons found */ /* translators: %d = number of icons found */
|
|
1242
|
-
(0,m.__)("%d icon(s) found","wp-component-library"),I):d?(0,m.__)("Loading icons…","wp-component-library"):(0,m.__)("No icons found.","wp-component-library")})]}),(0,t.jsx)(is,{ref:w,children:d?(0,t.jsx)(us,{children:(0,m.__)("Loading icons…","wp-component-library")}):x.length>0?(0,t.jsx)(Kl,{ref:y,height:_,itemCount:x.length,itemSize:T,itemData:D,itemKey:k,width:"100%",className:"wpcl-icon-picker-modal__list",children:Cs},v):(0,t.jsx)(us,{children:0===c.length?(0,m.__)("No icon sets registered.","wp-component-library"):(0,m.__)("No icons match your search.","wp-component-library")})})]})})]})}function Ts({value:e,onChange:n,label:r="",className:o=""}){const[i,a]=(0,l.useState)(!1),s=(0,l.useCallback)(()=>a(!0),[]),c=(0,l.useCallback)(()=>a(!1),[]),u=e?.source,d=u&&ul(e.source)||cl;return(0,t.jsxs)(p.BaseControl,{label:r||(0,m.__)("Icon","wp-component-library"),className:o||void 0,__nextHasNoMarginBottom:!0,children:[(0,t.jsxs)(p.Button,{variant:"secondary",onClick:s,style:{width:"100%",justifyContent:"flex-start",gap:"8px"},"aria-label":u?(0,m.__)("Change icon","wp-component-library"):(0,m.__)("Choose icon","wp-component-library"),children:[(0,t.jsx)(fs,{dangerouslySetInnerHTML:{__html:d}}),(0,t.jsx)(ms,{children:u?e.label||e.name:(0,m.__)("Choose icon…","wp-component-library")})]}),i&&(0,t.jsx)(ks,{value:e,onChange:n,onClose:c})]})}function Is({value:e,onChange:n,buttonLabel:r=(0,m.__)("Select Icon","wp-component-library"),text:o}){const[i,a]=(0,l.useState)(!1),s=(0,l.useCallback)(()=>a(!0),[]),c=(0,l.useCallback)(()=>a(!1),[]),u=ul(e?.source??cl)||cl,d=(0,t.jsx)(hs,{dangerouslySetInnerHTML:{__html:u}});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.ToolbarButton,{icon:d,label:r,text:o,onClick:s}),i&&(0,t.jsx)(ks,{value:e,onChange:n,onClose:c})]})}function Es({value:e,onChange:n,className:r="",isInteractive:o=!0}){const[i,a]=(0,l.useState)(!1),s=(0,l.useCallback)(()=>a(!0),[]),c=(0,l.useCallback)(()=>a(!1),[]),u=(0,l.useCallback)(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a(!0))},[]),d=e?.source,p=d&&ul(e.source)||cl;return o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(gs,{as:"div",role:"button",tabIndex:0,className:r||void 0,onClick:s,onKeyDown:u,"aria-label":d?(0,m.__)("Change icon","wp-component-library"):(0,m.__)("Choose icon","wp-component-library"),dangerouslySetInnerHTML:{__html:p}}),i&&(0,t.jsx)(ks,{value:e,onChange:n,onClose:c})]}):(0,t.jsx)(gs,{as:"div",className:r||void 0,style:{cursor:"inherit"},dangerouslySetInnerHTML:{__html:p}})}})(),a})());
|