dbf-mirador-annotation-editor 1.5.0-testing10 → 1.5.0-testing11

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.
@@ -262,5 +262,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
262
262
  40% { opacity: 1; }
263
263
  `]))),Pie=function(e,t){var r=e.isFocused,i=e.size,a=e.theme,s=a.colors,u=a.spacing.baseUnit;return qt({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?s.neutral60:s.neutral20,padding:u*2})},XE=function(e){var t=e.delay,r=e.offset;return Gt.jsx("span",{css:Gt.css({animation:"".concat(Lie," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdX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OiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */")})},kie=function(e){var t=e.innerProps,r=e.isRtl,i=e.size,a=i===void 0?4:i,s=eu(e,Tie);return Gt.jsx("div",Kt({},Ci(qt(qt({},s),{},{innerProps:t,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Gt.jsx(XE,{delay:0,offset:r}),Gt.jsx(XE,{delay:160,offset:!0}),Gt.jsx(XE,{delay:320,offset:!r}))},jie=function(e,t){var r=e.isDisabled,i=e.isFocused,a=e.theme,s=a.colors,u=a.borderRadius,c=a.spacing;return qt({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},Fie=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,a=e.innerRef,s=e.innerProps,u=e.menuIsOpen;return Gt.jsx("div",Kt({ref:a},Ci(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":u}),s,{"aria-disabled":r||void 0}),t)},Bie=Fie,Gie=["data"],Hie=function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},zie=function(e){var t=e.children,r=e.cx,i=e.getStyles,a=e.getClassNames,s=e.Heading,u=e.headingProps,c=e.innerProps,h=e.label,g=e.theme,v=e.selectProps;return Gt.jsx("div",Kt({},Ci(e,"group",{group:!0}),c),Gt.jsx(s,Kt({},u,{selectProps:v,theme:g,getStyles:i,getClassNames:a,cx:r}),h),Gt.jsx("div",null,t))},qie=function(e,t){var r=e.theme,i=r.colors,a=r.spacing;return qt({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},Uie=function(e){var t=FM(e);t.data;var r=eu(t,Gie);return Gt.jsx("div",Kt({},Ci(e,"groupHeading",{"group-heading":!0}),r))},Vie=zie,Wie=["innerRef","isDisabled","isHidden","inputClassName"],Xie=function(e,t){var r=e.isDisabled,i=e.value,a=e.theme,s=a.spacing,u=a.colors;return qt(qt({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},Yie),t?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:u.neutral80})},XM={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Yie={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":qt({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},XM)},Zie=function(e){return qt({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},XM)},Jie=function(e){var t=e.cx,r=e.value,i=FM(e),a=i.innerRef,s=i.isDisabled,u=i.isHidden,c=i.inputClassName,h=eu(i,Wie);return Gt.jsx("div",Kt({},Ci(e,"input",{"input-container":!0}),{"data-value":r||""}),Gt.jsx("input",Kt({className:t({input:!0},c),ref:a,style:Zie(u),disabled:s},h)))},Kie=Jie,$ie=function(e,t){var r=e.theme,i=r.spacing,a=r.borderRadius,s=r.colors;return qt({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:s.neutral10,borderRadius:a/2,margin:i.baseUnit/2})},Qie=function(e,t){var r=e.theme,i=r.borderRadius,a=r.colors,s=e.cropWithEllipsis;return qt({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},eae=function(e,t){var r=e.theme,i=r.spacing,a=r.borderRadius,s=r.colors,u=e.isFocused;return qt({alignItems:"center",display:"flex"},t?{}:{borderRadius:a/2,backgroundColor:u?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},YM=function(e){var t=e.children,r=e.innerProps;return Gt.jsx("div",r,t)},tae=YM,nae=YM;function rae(n){var e=n.children,t=n.innerProps;return Gt.jsx("div",Kt({role:"button"},t),e||Gt.jsx(V4,{size:14}))}var iae=function(e){var t=e.children,r=e.components,i=e.data,a=e.innerProps,s=e.isDisabled,u=e.removeProps,c=e.selectProps,h=r.Container,g=r.Label,v=r.Remove;return Gt.jsx(h,{data:i,innerProps:qt(qt({},Ci(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),a),selectProps:c},Gt.jsx(g,{data:i,innerProps:qt({},Ci(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},t),Gt.jsx(v,{data:i,innerProps:qt(qt({},Ci(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},u),selectProps:c}))},aae=iae,sae=function(e,t){var r=e.isDisabled,i=e.isFocused,a=e.isSelected,s=e.theme,u=s.spacing,c=s.colors;return qt({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:a?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:a?c.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?c.primary:c.primary50}})},oae=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,a=e.isSelected,s=e.innerRef,u=e.innerProps;return Gt.jsx("div",Kt({},Ci(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":a}),{ref:s,"aria-disabled":r},u),t)},lae=oae,uae=function(e,t){var r=e.theme,i=r.spacing,a=r.colors;return qt({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:a.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},cae=function(e){var t=e.children,r=e.innerProps;return Gt.jsx("div",Kt({},Ci(e,"placeholder",{placeholder:!0}),r),t)},dae=cae,fae=function(e,t){var r=e.isDisabled,i=e.theme,a=i.spacing,s=i.colors;return qt({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?s.neutral40:s.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},hae=function(e){var t=e.children,r=e.isDisabled,i=e.innerProps;return Gt.jsx("div",Kt({},Ci(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),t)},pae=hae,gae={ClearIndicator:Die,Control:Bie,DropdownIndicator:Iie,DownChevron:VM,CrossIcon:V4,Group:Vie,GroupHeading:Uie,IndicatorsContainer:Eie,IndicatorSeparator:Mie,Input:Kie,LoadingIndicator:kie,Menu:uie,MenuList:die,MenuPortal:vie,LoadingMessage:gie,NoOptionsMessage:pie,MultiValue:aae,MultiValueContainer:tae,MultiValueLabel:nae,MultiValueRemove:rae,Option:lae,Placeholder:dae,SelectContainer:bie,SingleValue:pae,ValueContainer:Sie},mae=function(e){return qt(qt({},gae),e.components)},JI=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function vae(n,e){return!!(n===e||JI(n)&&JI(e))}function yae(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!vae(n[t],e[t]))return!1;return!0}function bae(n,e){e===void 0&&(e=yae);var t=null;function r(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(t&&t.lastThis===this&&e(i,t.lastArgs))return t.lastResult;var s=n.apply(this,i);return t={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){t=null},r}function xae(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Sae=process.env.NODE_ENV==="production"?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IEpTWCB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:xae},Cae=function(e){return Gt.jsx("span",Kt({css:Sae},e))},KI=Cae,Eae={guidance:function(e){var t=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,a=e.context,s=e.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,r=e.label,i=r===void 0?"":r,a=e.labels,s=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,i=e.options,a=e.label,s=a===void 0?"":a,u=e.selectValue,c=e.isDisabled,h=e.isSelected,g=e.isAppleDevice,v=function(O,E){return O&&O.length?"".concat(O.indexOf(E)+1," of ").concat(O.length):""};if(t==="value"&&u)return"value ".concat(s," focused, ").concat(v(u,r),".");if(t==="menu"&&g){var y=c?" disabled":"",S="".concat(h?" selected":"").concat(y);return"".concat(s).concat(S,", ").concat(v(i,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},_ae=function(e){var t=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,a=e.focusableOptions,s=e.isFocused,u=e.selectValue,c=e.selectProps,h=e.id,g=e.isAppleDevice,v=c.ariaLiveMessages,y=c.getOptionLabel,S=c.inputValue,_=c.isMulti,O=c.isOptionDisabled,E=c.isSearchable,w=c.menuIsOpen,N=c.options,L=c.screenReaderStatus,P=c.tabSelectsValue,z=c.isLoading,B=c["aria-label"],G=c["aria-live"],V=D.useMemo(function(){return qt(qt({},Eae),v||{})},[v]),Y=D.useMemo(function(){var ee="";if(t&&V.onChange){var $=t.option,se=t.options,Q=t.removedValue,le=t.removedValues,oe=t.value,be=function(at){return Array.isArray(at)?null:at},ge=Q||$||be(oe),Oe=ge?y(ge):"",Te=se||le||void 0,ke=Te?Te.map(y):[],Ze=qt({isDisabled:ge&&O(ge,u),label:Oe,labels:ke},t);ee=V.onChange(Ze)}return ee},[t,V,O,u,y]),J=D.useMemo(function(){var ee="",$=r||i,se=!!(r&&u&&u.includes(r));if($&&V.onFocus){var Q={focused:$,label:y($),isDisabled:O($,u),isSelected:se,options:a,context:$===r?"menu":"value",selectValue:u,isAppleDevice:g};ee=V.onFocus(Q)}return ee},[r,i,y,O,V,a,u,g]),k=D.useMemo(function(){var ee="";if(w&&N.length&&!z&&V.onFilter){var $=L({count:a.length});ee=V.onFilter({inputValue:S,resultsMessage:$})}return ee},[a,S,w,V,N,L,z]),H=t?.action==="initial-input-focus",q=D.useMemo(function(){var ee="";if(V.guidance){var $=i?"value":w?"menu":"input";ee=V.guidance({"aria-label":B,context:$,isDisabled:r&&O(r,u),isMulti:_,isSearchable:E,tabSelectsValue:P,isInitialFocus:H})}return ee},[B,r,i,_,O,E,w,V,u,P,H]),te=Gt.jsx(D.Fragment,null,Gt.jsx("span",{id:"aria-selection"},Y),Gt.jsx("span",{id:"aria-focused"},J),Gt.jsx("span",{id:"aria-results"},k),Gt.jsx("span",{id:"aria-guidance"},q));return Gt.jsx(D.Fragment,null,Gt.jsx(KI,{id:h},H&&te),Gt.jsx(KI,{"aria-live":G,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!H&&te))},Tae=_ae,r5=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],wae=new RegExp("["+r5.map(function(n){return n.letters}).join("")+"]","g"),ZM={};for(var YE=0;YE<r5.length;YE++)for(var ZE=r5[YE],JE=0;JE<ZE.letters.length;JE++)ZM[ZE.letters[JE]]=ZE.base;var JM=function(e){return e.replace(wae,function(t){return ZM[t]})},Aae=bae(JM),$I=function(e){return e.replace(/^\s+|\s+$/g,"")},Rae=function(e){return"".concat(e.label," ").concat(e.value)},Iae=function(e){return function(t,r){if(t.data.__isNew__)return!0;var i=qt({ignoreCase:!0,ignoreAccents:!0,stringify:Rae,trim:!0,matchFrom:"any"},e),a=i.ignoreCase,s=i.ignoreAccents,u=i.stringify,c=i.trim,h=i.matchFrom,g=c?$I(r):r,v=c?$I(u(t)):u(t);return a&&(g=g.toLowerCase(),v=v.toLowerCase()),s&&(g=Aae(g),v=JM(v)),h==="start"?v.substr(0,g.length)===g:v.indexOf(g)>-1}},Oae=["innerRef"];function Dae(n){var e=n.innerRef,t=eu(n,Oae),r=tie(t,"onExited","in","enter","exit","appear");return Gt.jsx("input",Kt({ref:e},r,{css:Gt.css({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},process.env.NODE_ENV==="production"?"":";label:DummyInput;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyByZW1vdmVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gRHVtbXlJbnB1dCh7XG4gIGlubmVyUmVmLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydpbnB1dCddICYge1xuICByZWFkb25seSBpbm5lclJlZjogUmVmPEhUTUxJbnB1dEVsZW1lbnQ+O1xufSkge1xuICAvLyBSZW1vdmUgYW5pbWF0aW9uIHByb3BzIG5vdCBtZWFudCBmb3IgSFRNTCBlbGVtZW50c1xuICBjb25zdCBmaWx0ZXJlZFByb3BzID0gcmVtb3ZlUHJvcHMoXG4gICAgcHJvcHMsXG4gICAgJ29uRXhpdGVkJyxcbiAgICAnaW4nLFxuICAgICdlbnRlcicsXG4gICAgJ2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.preventDefault(),e.stopPropagation()};function Mae(n){var e=n.isEnabled,t=n.onBottomArrive,r=n.onBottomLeave,i=n.onTopArrive,a=n.onTopLeave,s=D.useRef(!1),u=D.useRef(!1),c=D.useRef(0),h=D.useRef(null),g=D.useCallback(function(E,w){if(h.current!==null){var N=h.current,L=N.scrollTop,P=N.scrollHeight,z=N.clientHeight,B=h.current,G=w>0,V=P-z-L,Y=!1;V>w&&s.current&&(r&&r(E),s.current=!1),G&&u.current&&(a&&a(E),u.current=!1),G&&w>V?(t&&!s.current&&t(E),B.scrollTop=P,Y=!0,s.current=!0):!G&&-w>L&&(i&&!u.current&&i(E),B.scrollTop=0,Y=!0,u.current=!0),Y&&Nae(E)}},[t,r,i,a]),v=D.useCallback(function(E){g(E,E.deltaY)},[g]),y=D.useCallback(function(E){c.current=E.changedTouches[0].clientY},[]),S=D.useCallback(function(E){var w=c.current-E.changedTouches[0].clientY;g(E,w)},[g]),_=D.useCallback(function(E){if(E){var w=$re?{passive:!1}:!1;E.addEventListener("wheel",v,w),E.addEventListener("touchstart",y,w),E.addEventListener("touchmove",S,w)}},[S,y,v]),O=D.useCallback(function(E){E&&(E.removeEventListener("wheel",v,!1),E.removeEventListener("touchstart",y,!1),E.removeEventListener("touchmove",S,!1))},[S,y,v]);return D.useEffect(function(){if(e){var E=h.current;return _(E),function(){O(E)}}},[e,_,O]),function(E){h.current=E}}var QI=["boxSizing","height","overflow","paddingRight","position"],e7={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function t7(n){n.cancelable&&n.preventDefault()}function n7(n){n.stopPropagation()}function r7(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function i7(){return"ontouchstart"in window||navigator.maxTouchPoints}var a7=!!(typeof window<"u"&&window.document&&window.document.createElement),Yg=0,Ah={capture:!1,passive:!1};function Lae(n){var e=n.isEnabled,t=n.accountForScrollbars,r=t===void 0?!0:t,i=D.useRef({}),a=D.useRef(null),s=D.useCallback(function(c){if(a7){var h=document.body,g=h&&h.style;if(r&&QI.forEach(function(_){var O=g&&g[_];i.current[_]=O}),r&&Yg<1){var v=parseInt(i.current.paddingRight,10)||0,y=document.body?document.body.clientWidth:0,S=window.innerWidth-y+v||0;Object.keys(e7).forEach(function(_){var O=e7[_];g&&(g[_]=O)}),g&&(g.paddingRight="".concat(S,"px"))}h&&i7()&&(h.addEventListener("touchmove",t7,Ah),c&&(c.addEventListener("touchstart",r7,Ah),c.addEventListener("touchmove",n7,Ah))),Yg+=1}},[r]),u=D.useCallback(function(c){if(a7){var h=document.body,g=h&&h.style;Yg=Math.max(Yg-1,0),r&&Yg<1&&QI.forEach(function(v){var y=i.current[v];g&&(g[v]=y)}),h&&i7()&&(h.removeEventListener("touchmove",t7,Ah),c&&(c.removeEventListener("touchstart",r7,Ah),c.removeEventListener("touchmove",n7,Ah)))}},[r]);return D.useEffect(function(){if(e){var c=a.current;return s(c),function(){u(c)}}},[e,s,u]),function(c){a.current=c}}function Pae(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var kae=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},jae=process.env.NODE_ENV==="production"?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcm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9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:Pae};function Fae(n){var e=n.children,t=n.lockEnabled,r=n.captureEnabled,i=r===void 0?!0:r,a=n.onBottomArrive,s=n.onBottomLeave,u=n.onTopArrive,c=n.onTopLeave,h=Mae({isEnabled:i,onBottomArrive:a,onBottomLeave:s,onTopArrive:u,onTopLeave:c}),g=Lae({isEnabled:t}),v=function(S){h(S),g(S)};return Gt.jsx(D.Fragment,null,t&&Gt.jsx("div",{onClick:kae,css:jae}),e(v))}function Bae(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Gae=process.env.NODE_ENV==="production"?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:Bae},Hae=function(e){var t=e.name,r=e.onFocus;return Gt.jsx("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Gae,value:"",onChange:function(){}})},zae=Hae;function W4(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function qae(){return W4(/^iPhone/i)}function KM(){return W4(/^Mac/i)}function Uae(){return W4(/^iPad/i)||KM()&&navigator.maxTouchPoints>1}function Vae(){return qae()||Uae()}function Wae(){return KM()||Vae()}var Xae=function(e){return e.label},$M=function(e){return e.label},QM=function(e){return e.value},Yae=function(e){return!!e.isDisabled},Zae={clearIndicator:Oie,container:yie,control:jie,dropdownIndicator:Rie,group:Hie,groupHeading:qie,indicatorsContainer:Cie,indicatorSeparator:Nie,input:Xie,loadingIndicator:Pie,loadingMessage:hie,menu:sie,menuList:cie,menuPortal:mie,multiValue:$ie,multiValueLabel:Qie,multiValueRemove:eae,noOptionsMessage:fie,option:sae,placeholder:uae,singleValue:fae,valueContainer:xie},Jae={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Kae=4,eL=4,$ae=38,Qae=eL*2,ese={baseUnit:eL,controlHeight:$ae,menuGutter:Qae},KE={borderRadius:Kae,colors:Jae,spacing:ese},tse={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:YI(),captureMenuScroll:!YI(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Iae(),formatGroupLabel:Xae,getOptionLabel:$M,getOptionValue:QM,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Yae,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Jre(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function s7(n,e,t,r){var i=rL(n,e,t),a=iL(n,e,t),s=nL(n,e),u=py(n,e);return{type:"option",data:e,isDisabled:i,isSelected:a,label:s,value:u,index:r}}function U1(n,e){return n.options.map(function(t,r){if("options"in t){var i=t.options.map(function(s,u){return s7(n,s,e,u)}).filter(function(s){return l7(n,s)});return i.length>0?{type:"group",data:t,options:i,index:r}:void 0}var a=s7(n,t,e,r);return l7(n,a)?a:void 0}).filter(Qre)}function tL(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,ip(t.options.map(function(r){return r.data}))):e.push(t.data),e},[])}function o7(n,e){return n.reduce(function(t,r){return r.type==="group"?t.push.apply(t,ip(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):t.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),t},[])}function nse(n,e){return tL(U1(n,e))}function l7(n,e){var t=n.inputValue,r=t===void 0?"":t,i=e.data,a=e.isSelected,s=e.label,u=e.value;return(!sL(n)||!a)&&aL(n,{label:s,value:u,data:i},r)}function rse(n,e){var t=n.focusedValue,r=n.selectValue,i=r.indexOf(t);if(i>-1){var a=e.indexOf(t);if(a>-1)return t;if(i<e.length)return e[i]}return null}function ise(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var $E=function(e,t){var r,i=(r=e.find(function(a){return a.data===t}))===null||r===void 0?void 0:r.id;return i||null},nL=function(e,t){return e.getOptionLabel(t)},py=function(e,t){return e.getOptionValue(t)};function rL(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function iL(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var r=py(n,e);return t.some(function(i){return py(n,i)===r})}function aL(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var sL=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return t===void 0?r:t},ase=1,oL=(function(n){xre(t,n);var e=Ere(t);function t(r){var i;if(yre(this,t),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,h){var g=i.props,v=g.onChange,y=g.name;h.name=y,i.ariaOnChange(c,h),v(c,h)},i.setValue=function(c,h,g){var v=i.props,y=v.closeMenuOnSelect,S=v.isMulti,_=v.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:_}),y&&(i.setState({inputIsHiddenAfterUpdate:!S}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:h,option:g})},i.selectOption=function(c){var h=i.props,g=h.blurInputOnSelect,v=h.isMulti,y=h.name,S=i.state.selectValue,_=v&&i.isOptionSelected(c,S),O=i.isOptionDisabled(c,S);if(_){var E=i.getOptionValue(c);i.setValue(S.filter(function(w){return i.getOptionValue(w)!==E}),"deselect-option",c)}else if(!O)v?i.setValue([].concat(ip(S),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:y});return}g&&i.blurInput()},i.removeValue=function(c){var h=i.props.isMulti,g=i.state.selectValue,v=i.getOptionValue(c),y=g.filter(function(_){return i.getOptionValue(_)!==v}),S=Sm(h,y,y[0]||null);i.onChange(S,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange(Sm(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,h=i.state.selectValue,g=h[h.length-1],v=h.slice(0,h.length-1),y=Sm(c,v,v[0]||null);g&&i.onChange(y,{action:"pop-value",removedValue:g})},i.getFocusedOptionId=function(c){return $E(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return o7(U1(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return Vre.apply(void 0,[i.props.classNamePrefix].concat(h))},i.getOptionLabel=function(c){return nL(i.props,c)},i.getOptionValue=function(c){return py(i.props,c)},i.getStyles=function(c,h){var g=i.props.unstyled,v=Zae[c](h,g);v.boxSizing="border-box";var y=i.props.styles[c];return y?y(v,h):v},i.getClassNames=function(c,h){var g,v;return(g=(v=i.props.classNames)[c])===null||g===void 0?void 0:g.call(v,h)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return mae(i.props)},i.buildCategorizedOptions=function(){return U1(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return tL(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,h){i.setState({ariaSelection:qt({value:c},h)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var h=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():h&&i.openMenu("first"):(h&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var h=i.props,g=h.isMulti,v=h.menuIsOpen;i.focusInput(),v?(i.setState({inputIsHiddenAfterUpdate:!g}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&Uy(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var h=c.touches,g=h&&h.item(0);g&&(i.initialTouchX=g.clientX,i.initialTouchY=g.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var h=c.touches,g=h&&h.item(0);if(g){var v=Math.abs(g.clientX-i.initialTouchX),y=Math.abs(g.clientY-i.initialTouchY),S=5;i.userIsDragging=v>S||y>S}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var h=i.props.inputValue,g=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(g,{action:"input-change",prevInputValue:h}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var h=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:h}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var h=i.getFocusableOptions(),g=h.indexOf(c);i.setState({focusedOption:c,focusedOptionId:g>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return sL(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var h=i.props,g=h.isMulti,v=h.backspaceRemovesValue,y=h.escapeClearsValue,S=h.inputValue,_=h.isClearable,O=h.isDisabled,E=h.menuIsOpen,w=h.onKeyDown,N=h.tabSelectsValue,L=h.openMenuOnFocus,P=i.state,z=P.focusedOption,B=P.focusedValue,G=P.selectValue;if(!O&&!(typeof w=="function"&&(w(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!g||S)return;i.focusValue("previous");break;case"ArrowRight":if(!g||S)return;i.focusValue("next");break;case"Delete":case"Backspace":if(S)return;if(B)i.removeValue(B);else{if(!v)return;g?i.popValue():_&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!E||!N||!z||L&&i.isOptionSelected(z,G))return;i.selectOption(z);break;case"Enter":if(c.keyCode===229)break;if(E){if(!z||i.isComposing)return;i.selectOption(z);break}return;case"Escape":E?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:S}),i.onMenuClose()):_&&y&&i.clearValue();break;case" ":if(S)return;if(!E){i.openMenu("first");break}if(!z)return;i.selectOption(z);break;case"ArrowUp":E?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":E?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!E)return;i.focusOption("pageup");break;case"PageDown":if(!E)return;i.focusOption("pagedown");break;case"Home":if(!E)return;i.focusOption("first");break;case"End":if(!E)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++ase),i.state.selectValue=fy(r.value),r.menuIsOpen&&i.state.selectValue.length){var a=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),u=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=a,i.state.focusedOption=s[u],i.state.focusedOptionId=$E(a,s[u])}return i}return bre(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&XI(this.menuListRef,this.focusedOptionRef),Wae()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var a=this.props,s=a.isDisabled,u=a.menuIsOpen,c=this.state.isFocused;(c&&!s&&i.isDisabled||c&&u&&!i.menuIsOpen)&&this.focusInput(),c&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(XI(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,a){this.props.onInputChange(i,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var a=this,s=this.state,u=s.selectValue,c=s.isFocused,h=this.buildFocusableOptions(),g=i==="first"?0:h.length-1;if(!this.props.isMulti){var v=h.indexOf(u[0]);v>-1&&(g=v)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:h[g],focusedOptionId:this.getFocusedOptionId(h[g])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(i){var a=this.state,s=a.selectValue,u=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=s.indexOf(u);u||(c=-1);var h=s.length-1,g=-1;if(s.length){switch(i){case"previous":c===0?g=0:c===-1?g=h:g=c-1;break;case"next":c>-1&&c<h&&(g=c+1);break}this.setState({inputIsHidden:g!==-1,focusedValue:s[g]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,s=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var c=0,h=u.indexOf(s);s||(h=-1),i==="up"?c=h>0?h-1:u.length-1:i==="down"?c=(h+1)%u.length:i==="pageup"?(c=h-a,c<0&&(c=0)):i==="pagedown"?(c=h+a,c>u.length-1&&(c=u.length-1)):i==="last"&&(c=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(KE):qt(qt({},KE),this.props.theme):KE}},{key:"getCommonProps",value:function(){var i=this.clearValue,a=this.cx,s=this.getStyles,u=this.getClassNames,c=this.getValue,h=this.selectOption,g=this.setValue,v=this.props,y=v.isMulti,S=v.isRtl,_=v.options,O=this.hasValue();return{clearValue:i,cx:a,getStyles:s,getClassNames:u,getValue:c,hasValue:O,isMulti:y,isRtl:S,options:_,selectOption:h,selectProps:v,setValue:g,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,a=i.isClearable,s=i.isMulti;return a===void 0?s:a}},{key:"isOptionDisabled",value:function(i,a){return rL(this.props,i,a)}},{key:"isOptionSelected",value:function(i,a){return iL(this.props,i,a)}},{key:"filterOption",value:function(i,a){return aL(this.props,i,a)}},{key:"formatOptionLabel",value:function(i,a){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(i,{context:a,inputValue:s,selectValue:u})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,a=i.isDisabled,s=i.isSearchable,u=i.inputId,c=i.inputValue,h=i.tabIndex,g=i.form,v=i.menuIsOpen,y=i.required,S=this.getComponents(),_=S.Input,O=this.state,E=O.inputIsHidden,w=O.ariaSelection,N=this.commonProps,L=u||this.getElementId("input"),P=qt(qt(qt({"aria-autocomplete":"list","aria-expanded":v,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":y,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},v&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?dn.createElement(_,Kt({},N,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:L,innerRef:this.getInputRef,isDisabled:a,isHidden:E,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:h,form:g,type:"text",value:c},P)):dn.createElement(Dae,Kt({id:L,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:dy,onFocus:this.onInputFocus,disabled:a,tabIndex:h,inputMode:"none",form:g,value:""},P))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,a=this.getComponents(),s=a.MultiValue,u=a.MultiValueContainer,c=a.MultiValueLabel,h=a.MultiValueRemove,g=a.SingleValue,v=a.Placeholder,y=this.commonProps,S=this.props,_=S.controlShouldRenderValue,O=S.isDisabled,E=S.isMulti,w=S.inputValue,N=S.placeholder,L=this.state,P=L.selectValue,z=L.focusedValue,B=L.isFocused;if(!this.hasValue()||!_)return w?null:dn.createElement(v,Kt({},y,{key:"placeholder",isDisabled:O,isFocused:B,innerProps:{id:this.getElementId("placeholder")}}),N);if(E)return P.map(function(V,Y){var J=V===z,k="".concat(i.getOptionLabel(V),"-").concat(i.getOptionValue(V));return dn.createElement(s,Kt({},y,{components:{Container:u,Label:c,Remove:h},isFocused:J,isDisabled:O,key:k,index:Y,removeProps:{onClick:function(){return i.removeValue(V)},onTouchEnd:function(){return i.removeValue(V)},onMouseDown:function(q){q.preventDefault()}},data:V}),i.formatOptionLabel(V,"value"))});if(w)return null;var G=P[0];return dn.createElement(g,Kt({},y,{data:G,isDisabled:O}),this.formatOptionLabel(G,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),a=i.ClearIndicator,s=this.commonProps,u=this.props,c=u.isDisabled,h=u.isLoading,g=this.state.isFocused;if(!this.isClearable()||!a||c||!this.hasValue()||h)return null;var v={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return dn.createElement(a,Kt({},s,{innerProps:v,isFocused:g}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),a=i.LoadingIndicator,s=this.commonProps,u=this.props,c=u.isDisabled,h=u.isLoading,g=this.state.isFocused;if(!a||!h)return null;var v={"aria-hidden":"true"};return dn.createElement(a,Kt({},s,{innerProps:v,isDisabled:c,isFocused:g}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator,s=i.IndicatorSeparator;if(!a||!s)return null;var u=this.commonProps,c=this.props.isDisabled,h=this.state.isFocused;return dn.createElement(s,Kt({},u,{isDisabled:c,isFocused:h}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator;if(!a)return null;var s=this.commonProps,u=this.props.isDisabled,c=this.state.isFocused,h={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return dn.createElement(a,Kt({},s,{innerProps:h,isDisabled:u,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,a=this.getComponents(),s=a.Group,u=a.GroupHeading,c=a.Menu,h=a.MenuList,g=a.MenuPortal,v=a.LoadingMessage,y=a.NoOptionsMessage,S=a.Option,_=this.commonProps,O=this.state.focusedOption,E=this.props,w=E.captureMenuScroll,N=E.inputValue,L=E.isLoading,P=E.loadingMessage,z=E.minMenuHeight,B=E.maxMenuHeight,G=E.menuIsOpen,V=E.menuPlacement,Y=E.menuPosition,J=E.menuPortalTarget,k=E.menuShouldBlockScroll,H=E.menuShouldScrollIntoView,q=E.noOptionsMessage,te=E.onMenuScrollToTop,ee=E.onMenuScrollToBottom;if(!G)return null;var $=function(Oe,Te){var ke=Oe.type,Ze=Oe.data,pt=Oe.isDisabled,at=Oe.isSelected,mt=Oe.label,Et=Oe.value,ft=O===Ze,Rt=pt?void 0:function(){return i.onOptionHover(Ze)},yt=pt?void 0:function(){return i.selectOption(Ze)},ht="".concat(i.getElementId("option"),"-").concat(Te),ot={id:ht,onClick:yt,onMouseMove:Rt,onMouseOver:Rt,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:at};return dn.createElement(S,Kt({},_,{innerProps:ot,data:Ze,isDisabled:pt,isSelected:at,key:ht,label:mt,type:ke,value:Et,isFocused:ft,innerRef:ft?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(Oe.data,"menu"))},se;if(this.hasOptions())se=this.getCategorizedOptions().map(function(ge){if(ge.type==="group"){var Oe=ge.data,Te=ge.options,ke=ge.index,Ze="".concat(i.getElementId("group"),"-").concat(ke),pt="".concat(Ze,"-heading");return dn.createElement(s,Kt({},_,{key:Ze,data:Oe,options:Te,Heading:u,headingProps:{id:pt,data:ge.data},label:i.formatGroupLabel(ge.data)}),ge.options.map(function(at){return $(at,"".concat(ke,"-").concat(at.index))}))}else if(ge.type==="option")return $(ge,"".concat(ge.index))});else if(L){var Q=P({inputValue:N});if(Q===null)return null;se=dn.createElement(v,_,Q)}else{var le=q({inputValue:N});if(le===null)return null;se=dn.createElement(y,_,le)}var oe={minMenuHeight:z,maxMenuHeight:B,menuPlacement:V,menuPosition:Y,menuShouldScrollIntoView:H},be=dn.createElement(oie,Kt({},_,oe),function(ge){var Oe=ge.ref,Te=ge.placerProps,ke=Te.placement,Ze=Te.maxHeight;return dn.createElement(c,Kt({},_,oe,{innerRef:Oe,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:L,placement:ke}),dn.createElement(Fae,{captureEnabled:w,onTopArrive:te,onBottomArrive:ee,lockEnabled:k},function(pt){return dn.createElement(h,Kt({},_,{innerRef:function(mt){i.getMenuListRef(mt),pt(mt)},innerProps:{role:"listbox","aria-multiselectable":_.isMulti,id:i.getElementId("listbox")},isLoading:L,maxHeight:Ze,focusedOption:O}),se)}))});return J||Y==="fixed"?dn.createElement(g,Kt({},_,{appendTo:J,controlElement:this.controlRef,menuPlacement:V,menuPosition:Y}),be):be}},{key:"renderFormField",value:function(){var i=this,a=this.props,s=a.delimiter,u=a.isDisabled,c=a.isMulti,h=a.name,g=a.required,v=this.state.selectValue;if(g&&!this.hasValue()&&!u)return dn.createElement(zae,{name:h,onFocus:this.onValueInputFocus});if(!(!h||u))if(c)if(s){var y=v.map(function(O){return i.getOptionValue(O)}).join(s);return dn.createElement("input",{name:h,type:"hidden",value:y})}else{var S=v.length>0?v.map(function(O,E){return dn.createElement("input",{key:"i-".concat(E),name:h,type:"hidden",value:i.getOptionValue(O)})}):dn.createElement("input",{name:h,type:"hidden",value:""});return dn.createElement("div",null,S)}else{var _=v[0]?this.getOptionValue(v[0]):"";return dn.createElement("input",{name:h,type:"hidden",value:_})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,a=this.state,s=a.ariaSelection,u=a.focusedOption,c=a.focusedValue,h=a.isFocused,g=a.selectValue,v=this.getFocusableOptions();return dn.createElement(Tae,Kt({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:u,focusedValue:c,isFocused:h,selectValue:g,focusableOptions:v,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),a=i.Control,s=i.IndicatorsContainer,u=i.SelectContainer,c=i.ValueContainer,h=this.props,g=h.className,v=h.id,y=h.isDisabled,S=h.menuIsOpen,_=this.state.isFocused,O=this.commonProps=this.getCommonProps();return dn.createElement(u,Kt({},O,{className:g,innerProps:{id:v,onKeyDown:this.onKeyDown},isDisabled:y,isFocused:_}),this.renderLiveRegion(),dn.createElement(a,Kt({},O,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:y,isFocused:_,menuIsOpen:S}),dn.createElement(c,Kt({},O,{isDisabled:y}),this.renderPlaceholderOrValue(),this.renderInput()),dn.createElement(s,Kt({},O,{isDisabled:y}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,a){var s=a.prevProps,u=a.clearFocusValueOnUpdate,c=a.inputIsHiddenAfterUpdate,h=a.ariaSelection,g=a.isFocused,v=a.prevWasFocused,y=a.instancePrefix,S=i.options,_=i.value,O=i.menuIsOpen,E=i.inputValue,w=i.isMulti,N=fy(_),L={};if(s&&(_!==s.value||S!==s.options||O!==s.menuIsOpen||E!==s.inputValue)){var P=O?nse(i,N):[],z=O?o7(U1(i,N),"".concat(y,"-option")):[],B=u?rse(a,N):null,G=ise(a,P),V=$E(z,G);L={selectValue:N,focusedOption:G,focusedOptionId:V,focusableOptionsWithIds:z,focusedValue:B,clearFocusValueOnUpdate:!1}}var Y=c!=null&&i!==s?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},J=h,k=g&&v;return g&&!k&&(J={value:Sm(w,N,N[0]||null),options:N,action:"initial-input-focus"},k=!v),h?.action==="initial-input-focus"&&(J=null),qt(qt(qt({},L),Y),{},{prevProps:i,ariaSelection:J,prevWasFocused:k})}}]),t})(D.Component);oL.defaultProps=tse;var sse=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function ose(n){var e=n.defaultInputValue,t=e===void 0?"":e,r=n.defaultMenuIsOpen,i=r===void 0?!1:r,a=n.defaultValue,s=a===void 0?null:a,u=n.inputValue,c=n.menuIsOpen,h=n.onChange,g=n.onInputChange,v=n.onMenuClose,y=n.onMenuOpen,S=n.value,_=eu(n,sse),O=D.useState(u!==void 0?u:t),E=Ou(O,2),w=E[0],N=E[1],L=D.useState(c!==void 0?c:i),P=Ou(L,2),z=P[0],B=P[1],G=D.useState(S!==void 0?S:s),V=Ou(G,2),Y=V[0],J=V[1],k=D.useCallback(function(Q,le){typeof h=="function"&&h(Q,le),J(Q)},[h]),H=D.useCallback(function(Q,le){var oe;typeof g=="function"&&(oe=g(Q,le)),N(oe!==void 0?oe:Q)},[g]),q=D.useCallback(function(){typeof y=="function"&&y(),B(!0)},[y]),te=D.useCallback(function(){typeof v=="function"&&v(),B(!1)},[v]),ee=u!==void 0?u:w,$=c!==void 0?c:z,se=S!==void 0?S:Y;return qt(qt({},_),{},{inputValue:ee,menuIsOpen:$,onChange:k,onInputChange:H,onMenuClose:te,onMenuOpen:q,value:se})}var lse=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],u7=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(e).toLowerCase(),a=String(r.getOptionValue(t)).toLowerCase(),s=String(r.getOptionLabel(t)).toLowerCase();return a===i||s===i},QE={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,r,i){return!(!e||t.some(function(a){return u7(e,a,i)})||r.some(function(a){return u7(e,a,i)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function use(n){var e=n.allowCreateWhileLoading,t=e===void 0?!1:e,r=n.createOptionPosition,i=r===void 0?"last":r,a=n.formatCreateLabel,s=a===void 0?QE.formatCreateLabel:a,u=n.isValidNewOption,c=u===void 0?QE.isValidNewOption:u,h=n.getNewOptionData,g=h===void 0?QE.getNewOptionData:h,v=n.onCreateOption,y=n.options,S=y===void 0?[]:y,_=n.onChange,O=eu(n,lse),E=O.getOptionValue,w=E===void 0?QM:E,N=O.getOptionLabel,L=N===void 0?$M:N,P=O.inputValue,z=O.isLoading,B=O.isMulti,G=O.value,V=O.name,Y=D.useMemo(function(){return c(P,fy(G),S,{getOptionValue:w,getOptionLabel:L})?g(P,s(P)):void 0},[s,g,L,w,P,c,S,G]),J=D.useMemo(function(){return(t||!z)&&Y?i==="first"?[Y].concat(ip(S)):[].concat(ip(S),[Y]):S},[t,i,z,Y,S]),k=D.useCallback(function(H,q){if(q.action!=="select-option")return _(H,q);var te=Array.isArray(H)?H:[H];if(te[te.length-1]===Y){if(v)v(P);else{var ee=g(P,P),$={action:"create-option",name:V,option:ee};_(Sm(B,[].concat(ip(fy(G)),[ee]),ee),$)}return}_(H,q)},[g,P,B,V,Y,v,_,G]);return qt(qt({},O),{},{options:J,onChange:k})}var cse=D.forwardRef(function(n,e){var t=ose(n),r=use(t);return dn.createElement(oL,Kt({ref:e},r))}),lL=cse;function c7(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function dse(n){if(Array.isArray(n))return n}function fse(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,a,s,u=[],c=!0,h=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(g){h=!0,i=g}finally{try{if(!c&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(h)throw i}}return u}}function hse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
264
264
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pse(n,e){return dse(n)||fse(n,e)||gse(n,e)||hse()}function gse(n,e){if(n){if(typeof n=="string")return c7(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c7(n,e):void 0}}const uL=Object.entries,d7=Object.setPrototypeOf,mse=Object.isFrozen,vse=Object.getPrototypeOf,yse=Object.getOwnPropertyDescriptor;let oa=Object.freeze,ya=Object.seal,$h=Object.create,cL=typeof Reflect<"u"&&Reflect,i5=cL.apply,a5=cL.construct;oa||(oa=function(e){return e});ya||(ya=function(e){return e});i5||(i5=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];return e.apply(t,i)});a5||(a5=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const Ed=Gi(Array.prototype.forEach),bse=Gi(Array.prototype.lastIndexOf),f7=Gi(Array.prototype.pop),Zg=Gi(Array.prototype.push),xse=Gi(Array.prototype.splice),ap=Array.isArray,Cm=Gi(String.prototype.toLowerCase),e_=Gi(String.prototype.toString),h7=Gi(String.prototype.match),Jg=Gi(String.prototype.replace),p7=Gi(String.prototype.indexOf),Sse=Gi(String.prototype.trim),Cse=Gi(Number.prototype.toString),Ese=Gi(Boolean.prototype.toString),g7=typeof BigInt>"u"?null:Gi(BigInt.prototype.toString),m7=typeof Symbol>"u"?null:Gi(Symbol.prototype.toString),ks=Gi(Object.prototype.hasOwnProperty),Kg=Gi(Object.prototype.toString),Za=Gi(RegExp.prototype.test),bd=_se(TypeError);function Gi(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return i5(n,e,r)}}function _se(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a5(n,t)}}function er(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Cm;if(d7&&d7(n,null),!ap(e))return n;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=t(i);a!==i&&(mse(e)||(e[r]=a),i=a)}n[i]=!0}return n}function Tse(n){for(let e=0;e<n.length;e++)ks(n,e)||(n[e]=null);return n}function ao(n){const e=$h(null);for(const r of uL(n)){var t=pse(r,2);const i=t[0],a=t[1];ks(n,i)&&(ap(a)?e[i]=Tse(a):a&&typeof a=="object"&&a.constructor===Object?e[i]=ao(a):e[i]=a)}return e}function wse(n){switch(typeof n){case"string":return n;case"number":return Cse(n);case"boolean":return Ese(n);case"bigint":return g7?g7(n):"0";case"symbol":return m7?m7(n):"Symbol()";case"undefined":return Kg(n);case"function":case"object":{if(n===null)return Kg(n);const e=n,t=al(e,"toString");if(typeof t=="function"){const r=t(e);return typeof r=="string"?r:Kg(r)}return Kg(n)}default:return Kg(n)}}function al(n,e){for(;n!==null;){const r=yse(n,e);if(r){if(r.get)return Gi(r.get);if(typeof r.value=="function")return Gi(r.value)}n=vse(n)}function t(){return null}return t}function Ase(n){try{return Za(n,""),!0}catch{return!1}}const v7=oa(["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"]),t_=oa(["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"]),n_=oa(["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"]),Rse=oa(["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"]),r_=oa(["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"]),Ise=oa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),y7=oa(["#text"]),b7=oa(["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"]),i_=oa(["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"]),x7=oa(["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"]),P1=oa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ose=ya(/{{[\w\W]*|^[\w\W]*}}/g),Dse=ya(/<%[\w\W]*|^[\w\W]*%>/g),Nse=ya(/\${[\w\W]*/g),Mse=ya(/^data-[\-\w.\u00B7-\uFFFF]+$/),Lse=ya(/^aria-[\-\w]+$/),S7=ya(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pse=ya(/^(?:\w+script|data):/i),kse=ya(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jse=ya(/^html$/i),Fse=ya(/^[a-z][.\w]*(-[.\w]+)+$/i),C7=ya(/<[/\w!]/g),E7=ya(/<[/\w]/g),Bse=ya(/<\/no(script|embed|frames)/i),Gse=ya(/\/>/i),to={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},dL=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Hse=oa(er({},dL)),zse=(function(){const n={};return Ed(dL,e=>{n[e]=ya(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),oa(n)})(),qse=function(){return typeof window>"u"?null:window},Use=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},_7=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},yc=function(e,t,r,i){return ks(e,t)&&ap(e[t])?er(i.base?ao(i.base):{},e[t],i.transform):r},a_=function(e,t,r){const i=ks(e,t)?e[t]:void 0;return i&&typeof i=="object"?ao(i):r()};function fL(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qse();const e=Le=>fL(Le);if(e.version="3.4.14",e.removed=[],!n||!n.document||n.document.nodeType!==to.document||!n.Element)return e.isSupported=!1,e;let t=n.document;const r=t,i=r.currentScript;n.DocumentFragment;const a=n.HTMLTemplateElement,s=n.Node,u=n.Element,c=n.NodeFilter,h=n.NamedNodeMap;h===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const g=n.DOMParser,v=n.trustedTypes,y=u.prototype,S=al(y,"cloneNode"),_=al(y,"remove"),O=al(y,"nextSibling"),E=al(y,"childNodes"),w=al(y,"parentNode"),N=al(y,"shadowRoot"),L=al(y,"attributes"),P=s&&s.prototype?al(s.prototype,"nodeType"):null,z=s&&s.prototype?al(s.prototype,"nodeName"):null,B=s&&s.prototype?al(s.prototype,"ownerDocument"):null,G=function(K){return P?P(K):K.nodeType},V=function(K){return z?z(K):K.nodeName};if(typeof a=="function"){const Le=t.createElement("template");Le.content&&Le.content.ownerDocument&&(t=Le.content.ownerDocument)}let Y,J="",k,H=!1,q=0;const te=function(){if(q>0)throw bd('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.')},ee=function(K){te(),q++;try{return Y.createHTML(K)}finally{q--}},$=function(K){te(),q++;try{return Y.createScriptURL(K)}finally{q--}},se=function(){return H||(k=Use(v,i),H=!0),k},Q=t,le=Q.implementation,oe=Q.createNodeIterator,be=Q.createDocumentFragment,ge=Q.getElementsByTagName,Oe=r.importNode;let Te=_7();e.isSupported=typeof uL=="function"&&typeof w=="function"&&le&&le.createHTMLDocument!==void 0;const ke=Ose,Ze=Dse,pt=Nse,at=Mse,mt=Lse,Et=Pse,ft=kse,Rt=Fse;let yt=S7,ht=null;const ot=er({},[...v7,...t_,...n_,...r_,...y7]);let jt=null;const _t=er({},[...b7,...i_,...x7,...P1]);let pn=Object.seal($h(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}})),It=null,Yt=null;const Nt=Object.seal($h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Un=!0,vn=!0,In=!1,ar=!0,dr=!1,Jn=!0,On=!1,Kn=!1,Me=null,Qe=null,Lt=!1,Ye=!1,Ut=!1,Vn=!1,st=!0,Ve=!1;const Vt="user-content-";let Wt=!0,He=!1,lt={},Tt=null;const fn=er({},["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 $e=null;const Fe=er({},["audio","video","img","source","image","track"]);let bt=null;const $t=er({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yn="http://www.w3.org/1998/Math/MathML",gn="http://www.w3.org/2000/svg",an="http://www.w3.org/1999/xhtml";let Vr=an,zi=!1,qi=null;const sr=er({},[yn,gn,an],e_),Ei=oa(["mi","mo","mn","ms","mtext"]);let fr=er({},Ei);const la=oa(["annotation-xml"]);let li=er({},la);const La=er({},["title","style","font","a","script"]);let ui=null;const ba=["application/xhtml+xml","text/html"],Cr="text/html";let Wn=null,Ii=null;const Pa=t.createElement("form"),ci=function(K){return K instanceof RegExp||K instanceof Function},Cs=function(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ii&&Ii===K)return;(!K||typeof K!="object")&&(K={}),K=ao(K),ui=ba.indexOf(K.PARSER_MEDIA_TYPE)===-1?Cr:K.PARSER_MEDIA_TYPE,Wn=ui==="application/xhtml+xml"?e_:Cm,ht=yc(K,"ALLOWED_TAGS",ot,{transform:Wn}),jt=yc(K,"ALLOWED_ATTR",_t,{transform:Wn}),qi=yc(K,"ALLOWED_NAMESPACES",sr,{transform:e_}),bt=yc(K,"ADD_URI_SAFE_ATTR",$t,{transform:Wn,base:$t}),$e=yc(K,"ADD_DATA_URI_TAGS",Fe,{transform:Wn,base:Fe}),Tt=yc(K,"FORBID_CONTENTS",fn,{transform:Wn}),It=yc(K,"FORBID_TAGS",ao({}),{transform:Wn}),Yt=yc(K,"FORBID_ATTR",ao({}),{transform:Wn}),lt=ks(K,"USE_PROFILES")?K.USE_PROFILES&&typeof K.USE_PROFILES=="object"?ao(K.USE_PROFILES):K.USE_PROFILES:!1,Un=K.ALLOW_ARIA_ATTR!==!1,vn=K.ALLOW_DATA_ATTR!==!1,In=K.ALLOW_UNKNOWN_PROTOCOLS||!1,ar=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,dr=K.SAFE_FOR_TEMPLATES||!1,Jn=K.SAFE_FOR_XML!==!1,On=K.WHOLE_DOCUMENT||!1,Ye=K.RETURN_DOM||!1,Ut=K.RETURN_DOM_FRAGMENT||!1,Vn=K.RETURN_TRUSTED_TYPE||!1,Lt=K.FORCE_BODY||!1,st=K.SANITIZE_DOM!==!1,Ve=K.SANITIZE_NAMED_PROPS||!1,Wt=K.KEEP_CONTENT!==!1,He=K.IN_PLACE||!1,yt=Ase(K.ALLOWED_URI_REGEXP)?K.ALLOWED_URI_REGEXP:S7,Vr=typeof K.NAMESPACE=="string"?K.NAMESPACE:an,fr=a_(K,"MATHML_TEXT_INTEGRATION_POINTS",()=>er({},Ei)),li=a_(K,"HTML_INTEGRATION_POINTS",()=>er({},la));const fe=a_(K,"CUSTOM_ELEMENT_HANDLING",()=>$h(null));if(pn=$h(null),ks(fe,"tagNameCheck")&&ci(fe.tagNameCheck)&&(pn.tagNameCheck=fe.tagNameCheck),ks(fe,"attributeNameCheck")&&ci(fe.attributeNameCheck)&&(pn.attributeNameCheck=fe.attributeNameCheck),ks(fe,"allowCustomizedBuiltInElements")&&typeof fe.allowCustomizedBuiltInElements=="boolean"&&(pn.allowCustomizedBuiltInElements=fe.allowCustomizedBuiltInElements),ya(pn),dr&&(vn=!1),Ut&&(Ye=!0),lt&&(ht=er({},y7),jt=$h(null),lt.html===!0&&(er(ht,v7),er(jt,b7)),lt.svg===!0&&(er(ht,t_),er(jt,i_),er(jt,P1)),lt.svgFilters===!0&&(er(ht,n_),er(jt,i_),er(jt,P1)),lt.mathMl===!0&&(er(ht,r_),er(jt,x7),er(jt,P1))),Nt.tagCheck=null,Nt.attributeCheck=null,ks(K,"ADD_TAGS")&&(typeof K.ADD_TAGS=="function"?Nt.tagCheck=K.ADD_TAGS:ap(K.ADD_TAGS)&&(ht===ot&&(ht=ao(ht)),er(ht,K.ADD_TAGS,Wn))),ks(K,"ADD_ATTR")&&(typeof K.ADD_ATTR=="function"?Nt.attributeCheck=K.ADD_ATTR:ap(K.ADD_ATTR)&&(jt===_t&&(jt=ao(jt)),er(jt,K.ADD_ATTR,Wn))),ks(K,"ADD_FORBID_CONTENTS")&&ap(K.ADD_FORBID_CONTENTS)&&(Tt===fn&&(Tt=ao(Tt)),er(Tt,K.ADD_FORBID_CONTENTS,Wn)),Wt&&(ht["#text"]=!0),On&&er(ht,["html","head","body"]),ht.table&&(er(ht,["tbody"]),delete It.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw bd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw bd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const _e=Y;Y=K.TRUSTED_TYPES_POLICY;try{J=ee("")}catch(Xe){throw Y=_e,Xe}}else K.TRUSTED_TYPES_POLICY===null?(Y=void 0,J=""):(Y===void 0&&(Y=se()),Y&&typeof J=="string"&&(J=ee("")));oa&&oa(K),Ii=K},xr=er({},[...t_,...n_,...Rse]),Hs=er({},[...r_,...Ise]),Fo=function(K,fe,_e){return fe.namespaceURI===an?K==="svg":fe.namespaceURI===yn?K==="svg"&&(_e==="annotation-xml"||fr[_e]):!!xr[K]},zs=function(K,fe,_e){return fe.namespaceURI===an?K==="math":fe.namespaceURI===gn?K==="math"&&li[_e]:!!Hs[K]},$a=function(K,fe,_e){return fe.namespaceURI===gn&&!li[_e]||fe.namespaceURI===yn&&!fr[_e]?!1:!Hs[K]&&(La[K]||!xr[K])},ua=function(K){let fe=w(K);(!fe||!fe.tagName)&&(fe={namespaceURI:Vr,tagName:"template"});const _e=Cm(K.tagName),Xe=Cm(fe.tagName);return qi[K.namespaceURI]?K.namespaceURI===gn?Fo(_e,fe,Xe):K.namespaceURI===yn?zs(_e,fe,Xe):K.namespaceURI===an?$a(_e,fe,Xe):!!(ui==="application/xhtml+xml"&&qi[K.namespaceURI]):!1},it=function(K){Zg(e.removed,{element:K});try{w(K).removeChild(K)}catch{if(_(K),!w(K))throw bd("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},bn=function(K,fe,_e){try{K.removeAttributeNode(fe)}catch{try{K.removeAttribute(_e)}catch{}}},Sr=function(K){Kr(K);const fe=E(K);if(fe){const Xe=[];Ed(fe,je=>{Zg(Xe,je)}),Ed(Xe,je=>{try{_(je)}catch{}})}const _e=L(K);if(_e)for(let Xe=_e.length-1;Xe>=0;--Xe){const je=_e[Xe],Mt=je&&je.name;typeof Mt=="string"&&bn(K,je,Mt)}},Fn=function(K,fe,_e){if(!_e)try{_e=fe.getAttributeNode(K)}catch{_e=null}Zg(e.removed,{attribute:_e||null,from:fe});try{_e?fe.removeAttributeNode(_e):fe.removeAttribute(K)}catch{try{fe.removeAttribute(K)}catch{}}if(K==="is")if(Ye||Ut)try{it(fe)}catch{}else try{fe.setAttribute(K,"")}catch{}},Tn=function(K){const fe=L(K);if(fe)for(let _e=fe.length-1;_e>=0;--_e){const Xe=fe[_e],je=Xe&&Xe.name;typeof je!="string"||jt[Wn(je)]||bn(K,Xe,je)}},Kr=function(K){const fe=[K];for(;fe.length>0;){const _e=fe.pop();G(_e)===to.element&&Tn(_e);const je=E(_e);if(je)for(let Mt=je.length-1;Mt>=0;--Mt)fe.push(je[Mt])}},wn=function(K,fe){return Jn?K==="patchsrc"?!0:K==="for"&&fe!=="label"&&fe!=="output":!1},An=function(K){if(!Jn)return;const fe=[K];for(;fe.length>0;){const _e=fe.pop(),Xe=G(_e);if(Xe===to.processingInstruction||Xe===to.comment&&Za(E7,_e.data)){try{_(_e)}catch{}continue}if(Xe===to.element){const Mt=_e,Dn=Wn(V(_e));try{Mt.hasAttribute&&Mt.hasAttribute("patchsrc")&&Mt.removeAttribute("patchsrc"),Mt.hasAttribute&&Mt.hasAttribute("for")&&wn("for",Dn)&&Mt.removeAttribute("for")}catch{}}const je=E(_e);if(je)for(let Mt=je.length-1;Mt>=0;--Mt)fe.push(je[Mt])}},Ui=function(K){let fe=null,_e=null;if(Lt)K="<remove></remove>"+K;else{const Mt=h7(K,/^[\r\n\t ]+/);_e=Mt&&Mt[0]}ui==="application/xhtml+xml"&&Vr===an&&(K='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+K+"</body></html>");const Xe=Y?ee(K):K;if(Vr===an)try{fe=new g().parseFromString(Xe,ui)}catch{}if(!fe||!fe.documentElement){fe=le.createDocument(Vr,"template",null);try{fe.documentElement.innerHTML=zi?J:Xe}catch{}}const je=fe.body||fe.documentElement;return K&&_e&&je.insertBefore(t.createTextNode(_e),je.childNodes[0]||null),Vr===an?ge.call(fe,On?"html":"body")[0]:On?fe.documentElement:je},vr=function(K){const fe=B?B(K):K.ownerDocument;return oe.call(fe||K,K,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},tr=function(K){return K=Jg(K,ke," "),K=Jg(K,Ze," "),K=Jg(K,pt," "),K},Wr=function(K){var fe;K.normalize();const _e=B?B(K):K.ownerDocument,Xe=oe.call(_e||K,K,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let je=Xe.nextNode();for(;je;)je.data=tr(je.data),je=Xe.nextNode();const Mt=(fe=K.querySelectorAll)===null||fe===void 0?void 0:fe.call(K,"template");Mt&&Ed(Mt,Dn=>{or(Dn.content)&&Wr(Dn.content)})},jr=function(K){const fe=z?z(K):null;return typeof fe!="string"||Wn(fe)!=="form"?!1:typeof K.nodeName!="string"||typeof K.textContent!="string"||typeof K.removeChild!="function"||K.attributes!==L(K)||typeof K.removeAttribute!="function"||typeof K.setAttribute!="function"||typeof K.namespaceURI!="string"||typeof K.insertBefore!="function"||typeof K.hasChildNodes!="function"||K.nodeType!==P(K)||K.childNodes!==E(K)},or=function(K){if(!P||typeof K!="object"||K===null)return!1;try{return P(K)===to.documentFragment}catch{return!1}},_i=function(K){if(!P||typeof K!="object"||K===null)return!1;try{return typeof P(K)=="number"}catch{return!1}};function Xr(Le,K,fe){Le.length!==0&&Ed(Le,_e=>{_e.call(e,K,fe,Ii)})}const Qa=function(K,fe){return!!(Jn&&K.hasChildNodes()&&!_i(K.firstElementChild)&&Za(C7,K.textContent)&&Za(C7,K.innerHTML)||Jn&&K.namespaceURI===an&&Hse[fe]&&(_i(K.firstElementChild)||typeof K.textContent=="string"&&Za(zse[fe],K.textContent))||K.nodeType===to.processingInstruction||Jn&&K.nodeType===to.comment&&Za(E7,K.data))},Vi=function(K,fe){if(K instanceof RegExp)return Za(K,fe);if(K instanceof Function){for(var _e=arguments.length,Xe=new Array(_e>2?_e-2:0),je=2;je<_e;je++)Xe[je-2]=arguments[je];return!!K(fe,...Xe)}return!1},es=function(K,fe,_e){if(!It[fe]&&Wi(fe)&&Vi(pn.tagNameCheck,fe))return!1;if(Wt&&!Tt[fe]){const Xe=w(K),je=E(K);if(je&&Xe){const Mt=je.length;for(let Dn=Mt-1;Dn>=0;--Dn){const Xn=K===_e?S(je[Dn],!0):je[Dn];Xe.insertBefore(Xn,O(K))}}}return it(K),!0},Fr=function(K,fe,_e,Xe){return K.length===0?fe:fe===_e||fe===Xe?ao(fe):fe},yl=function(K,fe){return K===fe||w(K)!==null?!1:(He&&Kr(K),!0)},di=function(K,fe){if(Xr(Te.beforeSanitizeElements,K,null),yl(K,fe))return!0;if(jr(K))return it(K),!0;const _e=Wn(V(K));if(ht=Fr(Te.uponSanitizeElement,ht,ot,Me),Xr(Te.uponSanitizeElement,K,{tagName:_e,allowedTags:ht}),yl(K,fe))return!0;if(Qa(K,_e))return it(K),!0;if(It[_e]||!(Nt.tagCheck instanceof Function&&Nt.tagCheck(_e))&&!ht[_e]){const je=es(K,_e,fe);return je===!1&&Xr(Te.afterSanitizeElements,K,null),je}if(G(K)===to.element&&!ua(K)||(_e==="noscript"||_e==="noembed"||_e==="noframes")&&Za(Bse,K.innerHTML))return it(K),!0;if(dr&&K.nodeType===to.text){const je=tr(K.textContent);K.textContent!==je&&(Zg(e.removed,{element:K.cloneNode()}),K.textContent=je)}return Xr(Te.afterSanitizeElements,K,null),!1},xa=function(K,fe,_e){if(Yt[fe]||wn(fe,K)||st&&(fe==="id"||fe==="name")&&(_e in t||_e in Pa))return!1;const Xe=jt[fe]||Nt.attributeCheck instanceof Function&&Nt.attributeCheck(fe,K);return vn&&Za(at,fe)||Un&&Za(mt,fe)?!0:Xe?bt[fe]||Za(yt,Jg(_e,ft,""))||(fe==="src"||fe==="xlink:href"||fe==="href")&&K!=="script"&&p7(_e,"data:")===0&&$e[K]||In&&!Za(Et,Jg(_e,ft,""))?!0:!_e:Wi(K)&&Vi(pn.tagNameCheck,K)&&Vi(pn.attributeNameCheck,fe,K)||fe==="is"&&pn.allowCustomizedBuiltInElements&&Vi(pn.tagNameCheck,_e)},lr=er({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Wi=function(K){return!lr[Cm(K)]&&Za(Rt,K)},Xi=function(K,fe,_e,Xe){if(Y&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!_e)switch(v.getAttributeType(K,fe)){case"TrustedHTML":return ee(Xe);case"TrustedScriptURL":return $(Xe)}return Xe},fo=function(K,fe,_e,Xe){try{_e?K.setAttributeNS(_e,fe,Xe):K.setAttribute(fe,Xe),jr(K)?it(K):f7(e.removed)}catch{Fn(fe,K)}},Sa=function(K){Xr(Te.beforeSanitizeAttributes,K,null);const fe=K.attributes;if(!fe||jr(K))return;jt=Fr(Te.uponSanitizeAttribute,jt,_t,Qe);const _e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:jt,forceKeepAttr:void 0};let Xe=fe.length;const je=Wn(K.nodeName);for(;Xe--;){const Mt=fe[Xe],Dn=Mt.name,Xn=Mt.namespaceURI,fi=Mt.value,$r=Wn(Dn),hr=fi;let Rr=Dn==="value"?hr:Sse(hr);if(_e.attrName=$r,_e.attrValue=Rr,_e.keepAttr=!0,_e.forceKeepAttr=void 0,Xr(Te.uponSanitizeAttribute,K,_e),Rr=_e.attrValue,Ve&&($r==="id"||$r==="name")&&p7(Rr,Vt)!==0&&(Fn(Dn,K,Mt),Rr=Vt+Rr),Jn&&Za(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Rr)){Fn(Dn,K,Mt);continue}if($r==="attributename"&&h7(Rr,"href")){Fn(Dn,K,Mt);continue}if(!_e.forceKeepAttr){if(!_e.keepAttr){Fn(Dn,K,Mt);continue}if(!ar&&Za(Gse,Rr)){Fn(Dn,K,Mt);continue}if(dr&&(Rr=tr(Rr)),!xa(je,$r,Rr)){Fn(Dn,K,Mt);continue}Rr=Xi(je,$r,Xn,Rr),Rr!==hr&&fo(K,Dn,Xn,Rr)}}Xr(Te.afterSanitizeAttributes,K,null)},ho=function(K){let fe=null;const _e=vr(K);for(Xr(Te.beforeSanitizeShadowDOM,K,null);fe=_e.nextNode();)if(Xr(Te.uponSanitizeShadowNode,fe,null),di(fe,K),Sa(fe),or(fe.content)&&ho(fe.content),G(fe)===to.element){const Xe=N(fe);or(Xe)&&(qs(Xe),ho(Xe))}Xr(Te.afterSanitizeShadowDOM,K,null)},qs=function(K){const fe=[{node:K,shadow:null}];for(;fe.length>0;){const _e=fe.pop();if(_e.shadow){ho(_e.shadow);continue}const Xe=_e.node,Mt=G(Xe)===to.element,Dn=E(Xe);if(Dn)for(let Xn=Dn.length-1;Xn>=0;--Xn)fe.push({node:Dn[Xn],shadow:null});if(Mt){const Xn=z?z(Xe):null;if(typeof Xn=="string"&&Wn(Xn)==="template"){const fi=Xe.content;or(fi)&&fe.push({node:fi,shadow:null})}}if(Mt){const Xn=N(Xe);or(Xn)&&fe.push({node:null,shadow:Xn},{node:Xn,shadow:null})}}};return e.sanitize=function(Le){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},fe=null,_e=null,Xe=null,je=null;if(zi=!Le,zi&&(Le="<!-->"),typeof Le!="string"&&!_i(Le)&&(Le=wse(Le),typeof Le!="string"))throw bd("dirty is not a string, aborting");if(!e.isSupported)return Le;Kn?(ht=Me,jt=Qe):Cs(K),(Te.uponSanitizeElement.length>0||Te.uponSanitizeAttribute.length>0)&&(ht=ao(ht)),Te.uponSanitizeAttribute.length>0&&(jt=ao(jt)),e.removed=[];const Mt=He&&typeof Le!="string"&&_i(Le);if(Mt){An(Le);const fi=V(Le);if(typeof fi=="string"){const $r=Wn(fi);if(!ht[$r]||It[$r])throw Sr(Le),bd("root node is forbidden and cannot be sanitized in-place")}if(jr(Le))throw Sr(Le),bd("root node is clobbered and cannot be sanitized in-place");try{qs(Le)}catch($r){throw Sr(Le),$r}}else if(_i(Le))fe=Ui("<!---->"),_e=fe.ownerDocument.importNode(Le,!0),_e.nodeType===to.element&&_e.nodeName==="BODY"||_e.nodeName==="HTML"?fe=_e:fe.appendChild(_e),qs(_e);else{if(!Ye&&!dr&&!On&&Le.indexOf("<")===-1)return Y&&Vn?ee(Le):Le;if(fe=Ui(Le),!fe)return Ye?null:Vn?J:""}fe&&Lt&&it(fe.firstChild);const Dn=Mt?Le:fe;try{const fi=vr(Dn);for(;Xe=fi.nextNode();)di(Xe,Dn),Sa(Xe),or(Xe.content)&&ho(Xe.content)}catch(fi){throw Mt&&(Sr(Le),Ed(e.removed,$r=>{$r.element&&Kr($r.element)})),fi}if(Mt)return Ed(e.removed,fi=>{fi.element&&Kr(fi.element)}),dr&&Wr(Le),Le;if(Ye){if(dr&&Wr(fe),Ut)for(je=be.call(fe.ownerDocument);fe.firstChild;)je.appendChild(fe.firstChild);else je=fe;return(jt.shadowroot||jt.shadowrootmode)&&(je=Oe.call(r,je,!0)),je}let Xn=On?fe.outerHTML:fe.innerHTML;return On&&ht["!doctype"]&&fe.ownerDocument&&fe.ownerDocument.doctype&&fe.ownerDocument.doctype.name&&Za(jse,fe.ownerDocument.doctype.name)&&(Xn="<!DOCTYPE "+fe.ownerDocument.doctype.name+`>
265
- `+Xn),dr&&(Xn=tr(Xn)),Y&&Vn?ee(Xn):Xn},e.setConfig=function(){let Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cs(Le),Kn=!0,Me=ht,Qe=jt},e.clearConfig=function(){Ii=null,Kn=!1,Me=null,Qe=null,Y=k,J=""},e.isValidAttribute=function(Le,K,fe){Ii||Cs({});const _e=Wn(Le),Xe=Wn(K);return xa(_e,Xe,fe)},e.addHook=function(Le,K){typeof K=="function"&&ks(Te,Le)&&Zg(Te[Le],K)},e.removeHook=function(Le,K){if(ks(Te,Le)){if(K!==void 0){const fe=bse(Te[Le],K);return fe===-1?void 0:xse(Te[Le],fe,1)[0]}return f7(Te[Le])}},e.removeHooks=function(Le){ks(Te,Le)&&(Te[Le]=[])},e.removeAllHooks=function(){Te=_7()},e}var Vse=fL();const Wse=n=>Vse.sanitize(n);function hL({comment:n,onChangeTemplate:e,setComment:t,t:r}){const i=E=>I.jsx("div",{title:E.title,children:E.label}),s=Ka.useSelector(E=>kt.getConfig(E)).annotation.commentTemplates??[],[u,c]=D.useState(null),[h,g]=D.useState(""),[v,y]=D.useState(0),S=E=>{if(E){if(n.trim().length>0){c(E),g(n);return}e(E.value)}},_=()=>{e({...u.value,content:h}),c(null),g("")},O=()=>{c(null),g(""),y(E=>E+1)};return I.jsxs(I.Fragment,{children:[I.jsx(ce.Grid,{container:!0,children:I.jsx(ce.Typography,{variant:"formSectionTitle",children:r("note")})}),s.length>0&&I.jsx(ce.Grid,{style:{marginBottom:"10px"},children:I.jsx(lL,{options:s.map(E=>({label:E.title,title:E.content,value:E})),placeholder:r("useTemplate"),onChange:S,isClearable:!0,isSearchable:!0,formatOptionLabel:i,styles:{marginBottom:"20px"}},v)}),I.jsx(ce.Grid,{container:!0,children:I.jsx(oy,{text:n,setText:t})}),I.jsxs(ce.Dialog,{"aria-labelledby":"confirm-template-selection-title",fullWidth:!0,maxWidth:"sm",onClose:O,open:u!==null,children:[I.jsx(ce.DialogTitle,{id:"confirm-template-selection-title",children:I.jsx(ce.Typography,{variant:"h2",component:"span",children:r("confirmTemplateSelectionTitle")})}),I.jsxs(ce.DialogContent,{children:[I.jsx(ce.DialogContentText,{variant:"body1",color:"inherit",children:r("confirmTemplateSelectionContent")}),I.jsx(ce.Typography,{variant:"subtitle2",sx:{marginTop:"16px"},children:r("selectedTemplateContent")}),I.jsx(ce.Box,{sx:{border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:"4px",marginBottom:"16px",maxHeight:"150px",overflowY:"auto",padding:"8px 12px"},dangerouslySetInnerHTML:{__html:Wse(u?.value.content??"")}}),I.jsx(ce.Typography,{variant:"subtitle2",children:r("currentNoteContent")}),I.jsx(oy,{text:h,setText:g})]}),I.jsxs(ce.DialogActions,{children:[I.jsx(ce.Button,{onClick:O,children:r("cancel")}),I.jsx(ce.Button,{color:"primary",onClick:_,variant:"contained",children:r("applyMerge")})]})]})]})}hL.propTypes={comment:C.string.isRequired,onChangeTemplate:C.func.isRequired,setComment:C.func.isRequired,t:C.func.isRequired};function pL({setTags:n,t:e,tags:t,tagsSuggestions:r}){return I.jsxs(I.Fragment,{children:[I.jsx(ce.Typography,{variant:"formSectionTitle",children:e("tags")}),I.jsx(lL,{isMulti:!0,options:r,value:t,onChange:n,closeMenuOnSelect:!1,placeholder:e("tagsPlaceholder")}),I.jsx(ce.Divider,{spacing:2})]})}pL.propTypes={setTags:C.func.isRequired,t:C.func.isRequired,tags:C.any.isRequired,tagsSuggestions:C.arrayOf(C.shape({label:C.string,value:C.string})).isRequired};const Fc={AnnotationFormFooter:A5,MultiTagsInput:pL,TargetFormSection:I4,TextCommentInput:hL,TextFormSection:AM},{AnnotationFormFooter:Xse}=Fc,Yse=async n=>n;function gL({annotation:n,canvases:e,closeFormCompanionWindow:t,saveAnnotation:r,t:i}){const[a,s]=D.useState(n),u=()=>{e.forEach(async c=>{r(a.newData,c.id)}),t()};return I.jsxs(I.Fragment,{children:[I.jsx(ce.Paper,{elevation:0,style:{minHeight:"300px"},children:I.jsx(DH,{data:a,onUpdate:s})}),I.jsx(Xse,{closeFormCompanionWindow:t,saveAnnotation:u,t:i,annotationState:a})]})}gL.propTypes={annotation:C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,maeData:C.object,manifestNetwork:C.string,motivation:C.string,target:C.string}).isRequired,canvases:C.arrayOf(C.object).isRequired,closeFormCompanionWindow:C.func.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired};const Zse=mr.createSvgIcon(I.jsx("path",{d:"M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3z"}),"Audiotrack"),Jse=mr.createSvgIcon(I.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),T7=mr.createSvgIcon(I.jsx("path",{d:"m18 4 2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z"}),"Movie"),Kse=mr.createSvgIcon(I.jsx("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf"),$se=300,Qse={audio:Zse,"research-pdf":Kse,"uploaded-video":T7,"youtube-video":T7},w7={borderRadius:1,flexShrink:0,height:40,objectFit:"cover",width:40};function s5({media:n}){if(n.thumbnailUrl)return I.jsx(ce.Box,{component:"img",src:n.thumbnailUrl,alt:"","data-testid":"media-selection-thumbnail",sx:w7});const e=n.source==="media-item"&&Qse[n.mediaType]||(n.source==="upload"?kD:Jse);return I.jsx(ce.Box,{sx:{...w7,alignItems:"center",bgcolor:"action.hover",color:"action.active",display:"flex",justifyContent:"center"},children:I.jsx(e,{fontSize:"small"})})}s5.propTypes={media:C.shape({mediaType:C.string,source:C.string,thumbnailUrl:C.string}).isRequired};const s_={"iiif-image":{normalize:n=>({id:n.documentId,source:"iiif-image",thumbnailUrl:n.thumbnailUrl??null,title:n.displayTitle}),titleKey:"poi_media_source_iiif_image"},upload:{normalize:n=>({id:String(n.id),source:"upload",thumbnailUrl:n.thumbnailUrl??null,title:n.name}),titleKey:"poi_media_source_upload"},"media-item":{normalize:n=>({id:n.documentId,mediaType:n.mediaType??null,source:"media-item",thumbnailUrl:n.thumbnailUrl??null,title:n.titleEn}),titleKey:"poi_media_source_media_item"}};function t0({dialogContainer:n,label:e,onChange:t,onSearchIiifImages:r,onSearchMediaItems:i,onSearchUploads:a,t:s,value:u}){const c=D.useMemo(()=>({"iiif-image":r,"media-item":i,upload:a}),[r,i,a]),h=D.useMemo(()=>Object.keys(s_).filter(G=>typeof c[G]=="function"),[c]),[g,v]=D.useState((u&&h.includes(u.source)?u.source:h[0])??null),[y,S]=D.useState(u?.title??""),[_,O]=D.useState(u?[u]:[]),[E,w]=D.useState(!1),N=D.useRef(null),L=D.useRef(0);D.useEffect(()=>()=>{clearTimeout(N.current),L.current+=1},[]);const P=(G,V)=>{const Y=c[G];if(typeof Y!="function")return;const J=L.current+1;L.current=J,w(!0),Promise.resolve(Y(V)).then(k=>{L.current===J&&O(k.map(s_[G].normalize))}).finally(()=>{L.current===J&&w(!1)})},z=(G,V)=>{clearTimeout(N.current),N.current=setTimeout(()=>P(G,V),$se)},B=(G,V)=>{V&&(L.current+=1,clearTimeout(N.current),v(V),S(""),O([]),w(!1))};return h.length===0?null:I.jsxs(ce.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[u&&I.jsxs(ce.Box,{sx:{alignItems:"center",display:"flex",gap:1},children:[I.jsx(s5,{media:u}),I.jsx(ce.Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:u.title})]}),h.length>1&&I.jsx(ce.ToggleButtonGroup,{value:g,exclusive:!0,onChange:B,size:"small",color:"primary",children:h.map(G=>I.jsx(ce.ToggleButton,{value:G,children:s(s_[G].titleKey)},G))}),I.jsx(ce.Autocomplete,{filterOptions:G=>G,getOptionKey:G=>G.id,getOptionLabel:G=>G.title,inputValue:y,isOptionEqualToValue:(G,V)=>G.source===V.source&&G.id===V.id,loading:E,noOptionsText:s(y?"poi_media_no_results":"poi_media_search_prompt"),onChange:(G,V)=>t(V),onInputChange:(G,V)=>{S(V),z(g,V)},onOpen:()=>P(g,y),options:_,renderInput:G=>I.jsx(ce.TextField,{...G,label:e,variant:"outlined",InputProps:{...G.InputProps,endAdornment:I.jsxs(I.Fragment,{children:[E?I.jsx(ce.CircularProgress,{color:"inherit",size:16}):null,G.InputProps.endAdornment]})}}),renderOption:(G,V)=>D.createElement(ce.Box,{component:"li",...G,key:V.id,sx:{alignItems:"center",display:"flex",gap:1}},I.jsx(s5,{media:{...V,source:g}}),V.title),slotProps:{popper:{container:n}},value:u&&u.source===g?u:null})]})}t0.propTypes={dialogContainer:C.func.isRequired,label:C.string.isRequired,onChange:C.func.isRequired,onSearchIiifImages:C.func,onSearchMediaItems:C.func,onSearchUploads:C.func,t:C.func.isRequired,value:C.shape({id:C.string.isRequired,mediaType:C.string,source:C.oneOf(["upload","iiif-image","media-item"]).isRequired,thumbnailUrl:C.string,title:C.string})};t0.defaultProps={onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0,value:null};const eoe=["showBlocks","|","heading","|","superscript","bold","italic","underline","strikethrough","|","bulletedList","numberedList","link","insertTable","codeBlock","specialCharacters","horizontalLine","subscript","|","undo","redo"],toe=[{class:"ck-heading_paragraph",model:"paragraph",title:"Paragraph"},{class:"ck-heading_heading2",model:"heading2",title:"Heading 2",view:"h2"},{class:"ck-heading_heading3",model:"heading3",title:"Heading 3",view:"h3"},{class:"ck-heading_heading4",model:"heading4",title:"Heading 4",view:"h4"},{class:"ck-heading_heading5",model:"heading5",title:"Heading 5",view:"h5"},{class:"ck-heading_heading6",model:"heading6",title:"Heading 6",view:"h6"}],noe=[ji.Autoformat,ji.Bold,ji.CodeBlock,ji.Essentials,ji.Heading,ji.HorizontalLine,ji.Italic,ji.Link,ji.List,ji.Paragraph,ji.ShowBlocks,ji.SpecialCharacters,ji.SpecialCharactersEssentials,ji.Strikethrough,ji.Subscript,ji.Superscript,ji.Table,ji.TableToolbar,ji.Underline];function n0({onChange:n,placeholder:e,rtl:t,value:r}){return I.jsx(ce.Box,{sx:{"& .ck-content":{overflowWrap:"break-word"},"& .ck-content *":t?{direction:"rtl",textAlign:"right"}:void 0,"& .ck-content img, & .ck-content table":{maxWidth:"100%"},"& .ck-editor, & .ck-editor__editable":{maxWidth:"100%"},"& .ck-editor__editable":{minHeight:"150px"},"& .ck-editor__editable, & .ck-content":t?{direction:"rtl",textAlign:"right",unicodeBidi:"plaintext"}:void 0,maxWidth:"100%",minWidth:0},children:I.jsx(wF.CKEditor,{config:{heading:{options:toe},language:{content:t?"ar":"en",ui:"en"},licenseKey:"GPL",placeholder:e,plugins:noe,toolbar:{items:eoe,shouldNotGroupWhenFull:!0}},data:r,editor:ji.ClassicEditor,onChange:(i,a)=>n(a.getData())})})}n0.propTypes={onChange:C.func.isRequired,placeholder:C.string,rtl:C.bool,value:C.string};n0.defaultProps={placeholder:void 0,rtl:!1,value:""};const{AnnotationFormFooter:roe,TargetFormSection:ioe}=Fc,o5="TextualBody",mL=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),aoe={description:"",title:""},vL=(n,e)=>n[e]??aoe,X4=n=>{const e={},t=new Set;return n.forEach(r=>{const i=r.language;if(!i)return;const a=e[i]??{description:"",title:""};r.purpose==="identifying"?a.title=r.value??"":r.purpose==="describing"&&r.type===o5&&!t.has(i)&&(a.description=r.value??"",t.add(i)),e[i]=a}),e},yL=n=>{const e=n?.target?.drawingState?.shapes;return Array.isArray(e)&&e.length===1&&e[0].type===Xt.POI},Y4=n=>{const e=n,{contentByLocale:t}=e.maeData;return e.body=Object.entries(t).flatMap(([r,i])=>{const{description:a,title:s}=i;return[{language:r,purpose:"identifying",type:o5,value:op(s)?Lm():s},...op(a)?[]:[{language:r,purpose:"describing",type:o5,value:a}]]}),e},soe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=Y4(n);return Wm(i,e,t,r)};function bL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const{contentLocales:s=[],searchMediaItems:u,searchIiifImages:c,searchUploads:h}=Ka.useSelector(H=>kt.getConfig(H)).annotation??{};let g=n;g.id?(g.maeData.target.drawingState&&typeof g.maeData.target.drawingState=="string"&&(g.maeData.target.drawingState={...JSON.parse(g.maeData.target.drawingState),currentShape:null}),g.maeData.contentByLocale=X4(g.body)):g={body:[],"dbf:kind":"POI","dbf:media":null,maeData:{contentByLocale:{},target:null,templateType:jn.POI_TYPE},motivation:"identifying",target:null};const[v,y]=D.useState(g),[S,_]=D.useState(!1),[O,E]=D.useState(!1),[w,N]=D.useState(Object.keys(v.maeData.contentByLocale)[0]??s[0]?.code),L=D.useRef(null),P=()=>L.current?.closest('[role="dialog"]')??document.body,z=vL(v.maeData.contentByLocale,w),B=mL(w),G=H=>{y({...v,maeData:{...v.maeData,...H}})},V=H=>{G({target:H})},Y=H=>{G({contentByLocale:{...v.maeData.contentByLocale,[w]:{...z,...H}}})},J=H=>{y({...v,"dbf:media":H})},k=async()=>{if(!yL(v.maeData)){_(!0);return}_(!1),Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),E(!0);try{await r(v)}finally{E(!1)}};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,ref:L,children:[I.jsxs(ce.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("poi")})}),s.length>1&&I.jsx(ce.Grid,{children:I.jsxs(ce.FormControl,{size:"small",sx:{minWidth:160},children:[I.jsx(ce.InputLabel,{id:"poi-language-label",children:i("poi_language")}),I.jsx(ce.Select,{labelId:"poi-language-label",label:i("poi_language"),value:w??"",onChange:H=>N(H.target.value),MenuProps:{container:P},children:s.map(({code:H,name:q})=>I.jsx(ce.MenuItem,{value:H,children:q??H},H))})]})})]}),I.jsx(ce.Grid,{children:I.jsx(ce.TextField,{fullWidth:!0,label:i("poi_title"),value:z.title,variant:"outlined",onChange:H=>Y({title:H.target.value}),slotProps:{htmlInput:{dir:B?"rtl":"ltr",style:{textAlign:B?"right":"left"}}}})}),(u||c||h)&&I.jsx(ce.Grid,{children:I.jsx(t0,{dialogContainer:P,label:i("poi_media"),onChange:J,onSearchIiifImages:c,onSearchMediaItems:u,onSearchUploads:h,t:i,value:v["dbf:media"]??null})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("poi_description_section")})}),I.jsx(ce.Grid,{children:I.jsx(n0,{onChange:H=>Y({description:H}),placeholder:i("poi_description_placeholder"),rtl:B,value:z.description})}),I.jsxs(ce.Grid,{children:[I.jsx(ioe,{onChangeTarget:V,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:v.maeData.target,windowId:a}),S&&I.jsx(mn,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),I.jsx(ce.Grid,{children:I.jsx(roe,{closeFormCompanionWindow:e,saveAnnotation:k,saving:O,t:i,annotationState:v})})]})}bL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:ooe}=Fc,loe=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),uoe={description:"",title:""},coe=(n,e)=>n[e]??uoe,doe=async(n,{canvas:e})=>{const t=Y4(n);return t.target=e.id,t};function xL({annotation:n,closeFormCompanionWindow:e,saveAnnotation:t,t:r}){const{contentLocales:i=[],searchMediaItems:a,searchIiifImages:s,searchUploads:u}=Ka.useSelector(G=>kt.getConfig(G)).annotation??{};let c=n;c.id?c.maeData.contentByLocale=X4(c.body):c={body:[],"dbf:kind":"Journey","dbf:media":null,maeData:{contentByLocale:{},target:{},templateType:jn.JOURNEY_TYPE},motivation:"identifying",target:null};const[h,g]=D.useState(c),[v,y]=D.useState(!1),[S,_]=D.useState(Object.keys(h.maeData.contentByLocale)[0]??i[0]?.code),O=D.useRef(null),E=()=>O.current?.closest('[role="dialog"]')??document.body,w=coe(h.maeData.contentByLocale,S),N=loe(S),L=G=>{g({...h,maeData:{...h.maeData,...G}})},P=G=>{L({contentByLocale:{...h.maeData.contentByLocale,[S]:{...w,...G}}})},z=G=>{g({...h,"dbf:media":G})},B=async()=>{y(!0);try{await t(h)}finally{y(!1)}};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,ref:O,children:[I.jsxs(ce.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:r("journey")})}),i.length>1&&I.jsx(ce.Grid,{children:I.jsxs(ce.FormControl,{size:"small",sx:{minWidth:160},children:[I.jsx(ce.InputLabel,{id:"journey-language-label",children:r("journey_language")}),I.jsx(ce.Select,{labelId:"journey-language-label",label:r("journey_language"),value:S??"",onChange:G=>_(G.target.value),MenuProps:{container:E},children:i.map(({code:G,name:V})=>I.jsx(ce.MenuItem,{value:G,children:V??G},G))})]})})]}),I.jsx(ce.Grid,{children:I.jsx(ce.TextField,{fullWidth:!0,label:r("journey_title"),value:w.title,variant:"outlined",onChange:G=>P({title:G.target.value}),slotProps:{htmlInput:{dir:N?"rtl":"ltr",style:{textAlign:N?"right":"left"}}}})}),(a||s||u)&&I.jsx(ce.Grid,{children:I.jsx(t0,{dialogContainer:E,label:r("journey_media"),onChange:z,onSearchIiifImages:s,onSearchMediaItems:a,onSearchUploads:u,t:r,value:h["dbf:media"]??null})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:r("journey_description_section")})}),I.jsx(ce.Grid,{children:I.jsx(n0,{onChange:G=>P({description:G}),placeholder:r("journey_description_placeholder"),rtl:N,value:w.description})}),I.jsx(ce.Grid,{children:I.jsx(ooe,{closeFormCompanionWindow:e,saveAnnotation:B,saving:v,t:r,annotationState:h})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"subFormSectionTitle",children:r("journey_hint")})})]})}xL.propTypes={annotation:C.shape({body:C.arrayOf(C.shape({type:C.string})),id:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired};const{AnnotationFormFooter:foe,MultiTagsInput:hoe,TargetFormSection:poe,TextCommentInput:goe}=Fc,moe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=bO(n);return Wm(i,e,t,r)};function SL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const s=Ka.useSelector(N=>kt.getConfig(N)),c=s.annotation.tagsSuggestions??[];let h=n;if(h.id)h.maeData.target.drawingState&&typeof h.maeData.target.drawingState=="string"&&(h.maeData.target.drawingState=JSON.parse(h.maeData.target.drawingState),console.debug("Parsed drawingState:",h.maeData.target.drawingState),h.maeData.target.drawingState={...h.maeData.target.drawingState,currentShape:null}),h.maeData.textBody=h.body.find(N=>N.purpose==="describing"),h.maeData.tags=h.body.filter(N=>N.purpose==="tagging").map(N=>({label:N.value,value:N.value})),h.maeData.textBody===void 0&&(h.maeData.textBody={purpose:"describing",type:"TextualBody",value:""});else{const{defaultTags:N}=Um(s),L=N.map(P=>({label:P,value:P}));h={body:[],maeData:{tags:L,target:null,templateType:jn.MULTIPLE_BODY_TYPE,textBody:{purpose:"describing",type:"TextualBody",value:""}},motivation:"commenting",target:null}}const[g,v]=D.useState(h),y=N=>{v({...g,maeData:{...g.maeData,textBody:{...g.maeData.textBody,value:N}}})},S=N=>{v({...g,maeData:{...g.maeData,tags:N}})},_=N=>{const L=g.maeData;L.target=N,v({...g,maeData:L})},O=async()=>{Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(g)},E=c.map(N=>({label:N,value:N})),w=N=>{const L=E.find(P=>P.value===N.title);if(L&&!g.maeData.tags.find(P=>P.value===L.value)){v({...g,maeData:{...g.maeData,tags:[...g.maeData.tags,L],textBody:{...g.maeData.textBody,value:N.content}}});return}y(N.content)};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,children:[I.jsx(ce.Grid,{children:I.jsx(goe,{comment:g.maeData.textBody.value,setComment:y,onChangeTemplate:w,t:i})}),I.jsx(ce.Grid,{children:I.jsx(hoe,{t:i,tags:g.maeData.tags,setTags:S,tagsSuggestions:E})}),I.jsx(ce.Grid,{children:I.jsx(poe,{onChangeTarget:_,playerReferences:t,spatialTarget:!0,t:i,target:g.maeData.target,timeTarget:!0,windowId:a})}),I.jsx(ce.Grid,{children:I.jsx(foe,{closeFormCompanionWindow:e,saveAnnotation:O,t:i,annotationState:g})})]})}SL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const voe=300;function Z4({dialogContainer:n,label:e,onChange:t,onSearch:r,t:i,value:a}){const[s,u]=D.useState(a?.titleEn??""),[c,h]=D.useState(a?[a]:[]),[g,v]=D.useState(!1),y=D.useRef(null),S=D.useRef(0);D.useEffect(()=>()=>{clearTimeout(y.current),S.current+=1},[]);const _=E=>{const w=S.current+1;S.current=w,v(!0),Promise.resolve(r(E)).then(N=>{S.current===w&&h(N)}).finally(()=>{S.current===w&&v(!1)})},O=E=>{clearTimeout(y.current),y.current=setTimeout(()=>_(E),voe)};return I.jsx(ce.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:I.jsx(ce.Autocomplete,{filterOptions:E=>E,getOptionKey:E=>E.documentId,getOptionLabel:E=>E.titleEn,inputValue:s,isOptionEqualToValue:(E,w)=>E.documentId===w.documentId,loading:g,noOptionsText:i(s?"map_relation_no_results":"map_relation_search_prompt"),onChange:(E,w)=>t(w),onInputChange:(E,w)=>{u(w),O(w)},onOpen:()=>_(s),options:c,renderInput:E=>I.jsx(ce.TextField,{...E,label:e,variant:"outlined",InputProps:{...E.InputProps,endAdornment:I.jsxs(I.Fragment,{children:[g?I.jsx(ce.CircularProgress,{color:"inherit",size:16}):null,E.InputProps.endAdornment]})}}),slotProps:{popper:{container:n}},value:a})})}Z4.propTypes={dialogContainer:C.func.isRequired,label:C.string.isRequired,onChange:C.func.isRequired,onSearch:C.func.isRequired,t:C.func.isRequired,value:C.shape({documentId:C.string.isRequired,titleEn:C.string.isRequired})};Z4.defaultProps={value:null};const{AnnotationFormFooter:yoe,TargetFormSection:boe}=Fc,xoe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=Y4(n);return Wm(i,e,t,r)};function CL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const{contentLocales:s=[],searchMediaItems:u,searchMaps:c,searchIiifImages:h,searchUploads:g}=Ka.useSelector(se=>kt.getConfig(se)).annotation??{};let v=n;v.id?(v.maeData.target.drawingState&&typeof v.maeData.target.drawingState=="string"&&(v.maeData.target.drawingState={...JSON.parse(v.maeData.target.drawingState),currentShape:null}),v.maeData.contentByLocale=X4(v.body)):v={body:[],"dbf:kind":"POI","dbf:linkedMap":null,"dbf:media":null,maeData:{contentByLocale:{},target:null,templateType:jn.NESTED_MAP_TYPE},motivation:"identifying",target:null};const[y,S]=D.useState(v),[_,O]=D.useState(!1),[E,w]=D.useState(!1),[N,L]=D.useState(!1),[P,z]=D.useState(Object.keys(y.maeData.contentByLocale)[0]??s[0]?.code),B=D.useRef(null),G=()=>B.current?.closest('[role="dialog"]')??document.body,V=vL(y.maeData.contentByLocale,P),Y=mL(P),J=y["dbf:linkedMap"]??null,k=se=>{S({...y,maeData:{...y.maeData,...se}})},H=se=>{k({target:se})},q=se=>{k({contentByLocale:{...y.maeData.contentByLocale,[P]:{...V,...se}}})},te=se=>{S({...y,"dbf:linkedMap":se?{id:se.documentId,titleEn:se.titleEn}:null})},ee=se=>{S({...y,"dbf:media":se})},$=async()=>{const se=yL(y.maeData),Q=!!y["dbf:linkedMap"];if(O(!se),w(!Q),!(!se||!Q)){Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),L(!0);try{await r(y)}finally{L(!1)}}};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,ref:B,children:[I.jsxs(ce.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("nested_map")})}),s.length>1&&I.jsx(ce.Grid,{children:I.jsxs(ce.FormControl,{size:"small",sx:{minWidth:160},children:[I.jsx(ce.InputLabel,{id:"nested-map-language-label",children:i("poi_language")}),I.jsx(ce.Select,{labelId:"nested-map-language-label",label:i("poi_language"),value:P??"",onChange:se=>z(se.target.value),MenuProps:{container:G},children:s.map(({code:se,name:Q})=>I.jsx(ce.MenuItem,{value:se,children:Q??se},se))})]})})]}),I.jsx(ce.Grid,{children:I.jsx(ce.TextField,{fullWidth:!0,label:i("poi_title"),value:V.title,variant:"outlined",onChange:se=>q({title:se.target.value}),slotProps:{htmlInput:{dir:Y?"rtl":"ltr",style:{textAlign:Y?"right":"left"}}}})}),(u||h||g)&&I.jsx(ce.Grid,{children:I.jsx(t0,{dialogContainer:G,label:i("poi_media"),onChange:ee,onSearchIiifImages:h,onSearchMediaItems:u,onSearchUploads:g,t:i,value:y["dbf:media"]??null})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("poi_description_section")})}),I.jsx(ce.Grid,{children:I.jsx(n0,{onChange:se=>q({description:se}),placeholder:i("poi_description_placeholder"),rtl:Y,value:V.description})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("nested_map_linked_map")})}),typeof c=="function"&&I.jsxs(ce.Grid,{children:[I.jsx(Z4,{dialogContainer:G,label:i("nested_map_linked_map"),onChange:te,onSearch:c,t:i,value:J?{documentId:J.id,titleEn:J.titleEn}:null}),E&&I.jsx(mn,{color:"error",variant:"caption",children:i("nested_map_linked_map_required")})]}),I.jsxs(ce.Grid,{children:[I.jsx(boe,{onChangeTarget:H,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:y.maeData.target,windowId:a}),_&&I.jsx(mn,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),I.jsx(ce.Grid,{children:I.jsx(yoe,{closeFormCompanionWindow:e,saveAnnotation:$,saving:N,t:i,annotationState:y})})]})}CL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:Soe,TargetFormSection:Coe}=Fc,Eoe=yO;function EL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const s=Ka.useSelector(S=>kt.getConfig(S));let u=n;if(u.id)u.maeData.target.drawingState&&typeof u.maeData.target.drawingState=="string"&&(u.maeData.target.drawingState=JSON.parse(u.maeData.target.drawingState));else{const{defaultTags:S}=Um(s);u={body:{type:"Image",value:S.length>0?S[0]:""},maeData:{target:null,templateType:jn.TAGGING_TYPE},motivation:"tagging",target:null}}const[c,h]=D.useState(u),g=S=>{const _=c.body;_.value=S,h({...c,body:_})},v=S=>{const _=c.maeData;_.target=S,h({...c,maeData:_})},y=async()=>{Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(c)};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,children:[I.jsx(ce.Grid,{children:I.jsxs(mn,{variant:"formSectionTitle",children:[i("tag")," "]})}),I.jsx(ce.Grid,{children:I.jsx(ce.TextField,{id:"outlined-basic",label:i("your_tag_here"),value:c.body.value,variant:"outlined",onChange:S=>g(S.target.value)})}),I.jsx(ce.Grid,{children:I.jsx(Coe,{onChangeTarget:v,playerReferences:t,spatialTarget:!0,target:c.maeData.target,windowId:a})}),I.jsx(ce.Grid,{children:I.jsx(Soe,{closeFormCompanionWindow:e,saveAnnotation:y,t:i,annotationState:c})})]})}EL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:_oe,TargetFormSection:Toe,TextCommentInput:woe}=Fc,Aoe="Annotation",Roe=yO;function _L({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){let s=n;s.id?s.maeData.target.drawingState&&typeof s.maeData.target.drawingState=="string"&&(s.maeData.target.drawingState=JSON.parse(s.maeData.target.drawingState)):s={body:{id:ys(),type:"TextualBody",value:""},maeData:{target:null,templateType:jn.TEXT_TYPE},motivation:"commenting",target:null};const[u,c]=D.useState(s),h=S=>{const _=u.body;_.value=S,c({...u,body:_})},g=S=>{h(S.content)},v=S=>{const _=u.maeData;_.target=S,c({...u,maeData:_})},y=()=>{Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),u.body.value===void 0&&(u.body.value=Aoe),r(u)};return D.useEffect(()=>{},[u.maeData.target]),I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,children:[I.jsx(ce.Grid,{children:I.jsx(woe,{comment:u.body.value,setComment:h,onChangeTemplate:g,t:i})}),I.jsx(ce.Grid,{children:I.jsx(Toe,{onChangeTarget:v,playerReferences:t,spatialTarget:!0,target:u.maeData.target,windowId:a})}),I.jsx(ce.Grid,{children:I.jsx(_oe,{closeFormCompanionWindow:e,saveAnnotation:y,t:i,annotationState:u})})]})}_L.propTypes={annotation:C.object.isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const xd=n=>n===Bi.IMAGE,J4=(n,e=[])=>{const t=[{Component:SL,convertToAnnotation:moe,description:n("textual_note_with_target"),icon:I.jsx(VG,{}),id:jn.MULTIPLE_BODY_TYPE,isCompatibleWithMediaType:xd,label:n("note"),selectable:!0},{Component:EL,convertToAnnotation:Eoe,description:n("tag_with_target"),icon:I.jsx(WG,{fontSize:"small"}),id:jn.TAGGING_TYPE,isCompatibleWithMediaType:xd,label:n("tag"),selectable:!0},{Component:bL,convertToAnnotation:soe,description:n("poi_description"),icon:I.jsx(JG,{fontSize:"small"}),id:jn.POI_TYPE,isCompatibleWithMediaType:xd,label:n("poi"),selectable:!0},{Component:CL,convertToAnnotation:xoe,description:n("nested_map_description"),icon:I.jsx(ZG,{fontSize:"small"}),id:jn.NESTED_MAP_TYPE,isCompatibleWithMediaType:xd,label:n("nested_map"),selectable:!0},{Component:xL,convertToAnnotation:doe,description:n("journey_description"),icon:I.jsx(YG,{fontSize:"small"}),id:jn.JOURNEY_TYPE,isCompatibleWithMediaType:xd,label:n("journey"),selectable:!0},{Component:gL,convertToAnnotation:Yse,description:n("edit_iiif_json_code"),icon:I.jsx(XG,{fontSize:"small"}),id:jn.IIIF_TYPE,isCompatibleWithMediaType:xd,label:n("expert_mode"),selectable:!0},{Component:_L,convertToAnnotation:Roe,description:"",icon:null,id:jn.TEXT_TYPE,isCompatibleWithMediaType:xd,label:"",selectable:!1}],r=new Set(t.map(a=>a.id)),i=e.filter(a=>r.has(a.id)?(console.warn(`Ignoring external annotation template with id "${a.id}": it collides with a built-in template id.`),!1):typeof a.id!="string"||typeof a.Component!="function"||typeof a.convertToAnnotation!="function"||typeof a.isCompatibleWithMediaType!="function"?(console.warn(`Ignoring external annotation template with id "${a.id}": it does not follow the TEMPLATE_REGISTRY contract (id: string, Component/convertToAnnotation/isCompatibleWithMediaType: function are all required).`),!1):!0);return[...t,...i]},TL=(n,e=[],t=null)=>J4(n,e).filter(r=>r.selectable).filter(r=>!Array.isArray(t)||t.length===0?!0:t.includes(r.id)),$g=(n,e,t=[])=>J4(n,t).find(r=>r.id===e);function wL({mediaType:n,setCommentingType:e}){const{t}=Bs.useTranslation(),r=u=>e(u),{enabledTemplateTypes:i,externalTemplates:a}=Ka.useSelector(u=>kt.getConfig(u)).annotation,s=TL(t,a,i);return I.jsx(Ioe,{children:n===Bi.AUDIO?I.jsx(ce.Grid,{container:!0,spacing:1,direction:"column",children:I.jsx(ce.Grid,{children:I.jsx(mn,{children:t("audio_not_supported")})})}):s.map(u=>u.isCompatibleWithMediaType(n)&&I.jsx(Ooe,{children:I.jsx(Doe,{id:u.id,onClick:()=>r(u),children:I.jsxs(ce.CardContent,{children:[I.jsxs(Noe,{component:"div",children:[t(u.label),u.icon]}),I.jsx(Moe,{component:"div",variant:"body2",children:t(u.description)})]})})},u.id))})}const Ioe=xs.styled("div")(({theme:n})=>({display:"flex",flexDirection:"column",gap:n.spacing(3.75),margin:n.spacing(1.25)})),Ooe=xs.styled(ce.Card)(({theme:n})=>({borderRadius:n.shape.borderRadius,boxShadow:n.shadows[1],border:`1px solid ${xs.alpha(n.palette.primary?.main??"#5A8264",.25)}`,transition:"box-shadow 120ms ease, transform 120ms ease, border-color 120ms ease","&:hover":{boxShadow:n.shadows[3],borderColor:xs.alpha(n.palette.primary?.main??"#5A8264",.5),transform:"translateY(-1px)"}})),Doe=xs.styled(ce.CardActionArea)(({theme:n})=>({borderRadius:n.shape.borderRadius,"&:hover":{backgroundColor:xs.alpha(n.palette.primary?.main??"#5A8264",.06)}})),Noe=xs.styled(mn)(({theme:n})=>{const e=n.typography.formSectionTitle??{};return{display:"flex",justifyContent:"space-between",alignItems:"center",gap:n.spacing(1),color:e.color??n.palette.primary?.main??"#5A8264",fontSize:e.fontSize??n.typography.h6.fontSize,fontWeight:e.fontWeight??600,letterSpacing:e.letterSpacing??"0.02em",textTransform:e.textTransform??"none",lineHeight:1.25,marginBottom:n.spacing(.5)}}),Moe=xs.styled(mn)(({theme:n})=>{const e=n.typography.subFormSectionTitle??{};return{color:n.palette.text.secondary,fontSize:e.fontSize??n.typography.body2.fontSize,fontWeight:e.fontWeight??300,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??n.typography.body2.lineHeight,textTransform:e.textTransform??"none"}});wL.propTypes={mediaType:C.string.isRequired,setCommentingType:C.func.isRequired};const Loe=mr.createSvgIcon(I.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");function AL({templateType:n,setCommentingType:e,annotation:t}){const r=()=>{e(null)};return I.jsxs(ce.Grid,{container:!0,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{marginRight:"10px"},spacing:2,children:[I.jsx(ce.Grid,{children:t.id==null&&I.jsx(kt.MiradorMenuButton,{"aria-label":"back",TooltipProps:{title:"back"},children:I.jsx(Loe,{onClick:r})})}),I.jsx(ce.Grid,{children:n.icon})]})}AL.propTypes={annotation:C.oneOfType([C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string}),C.string]).isRequired,setCommentingType:C.func.isRequired,templateType:C.shape({description:C.string,icon:C.element,id:C.string,label:C.string}).isRequired};function RL({playerReferences:n,t:e}){return I.jsxs(I.Fragment,{children:[I.jsx("h4",{children:"Debug info "}),I.jsx("p",{children:"Only visible in debug mode"}),I.jsx(mn,{children:n.getMediaType()}),I.jsxs(mn,{children:[e("scale"),":",n.getScale()]}),I.jsxs(mn,{children:[e("zoom"),":",n.getZoom()]}),I.jsxs(mn,{children:[e("image_true_size"),":",n.getMediaTrueWidth()," ","x",n.getMediaTrueHeight()]}),I.jsxs(mn,{children:[e("container_size"),":",n.getContainerWidth()," ","x",n.getContainerHeight()]}),I.jsxs(mn,{children:[e("image_displayed"),":",n.getDisplayedMediaWidth()," ","x",n.getDisplayedMediaHeight()]})]})}RL.propTypes={playerReferences:C.any.isRequired,t:C.func.isRequired};function IL({annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,templateType:a,windowId:s}){const{t:u}=Bs.useTranslation(),c=Ka.useSelector(y=>kt.getConfig(y)).annotation,h=c.debug??!1,{externalTemplates:g}=c,v=D.useMemo(()=>J4(u,g).find(y=>y.id===a.id)?.Component,[u,a.id,g]);return I.jsxs(ce.Grid,{container:!0,direction:"column",children:[I.jsx(Poe,{children:v&&I.jsx(v,{annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,t:u,windowId:s})}),h&&I.jsx(RL,{playerReferences:r,t:u})]})}const Poe=xs.styled(ce.Grid)({margin:"0 10px"});IL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,canvases:C.arrayOf(C.shape({id:C.string,index:C.number})).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,templateType:C.shape({description:C.string,icon:C.element,id:C.string,label:C.string}).isRequired,windowId:C.string.isRequired};function OL({id:n,windowId:e,mediaType:t}){const{t:r}=Bs.useTranslation();return I.jsx(kt.CompanionWindow,{title:r("media_not_supported"),windowId:e,id:n,children:I.jsxs(ce.Grid,{container:!0,padding:1,spacing:1,children:[I.jsx(ce.Grid,{children:I.jsx(mn,{children:r("media_not_supported")})}),I.jsx(ce.Grid,{children:I.jsx(mn,{children:r("detected_media_type",{mediaType:t})})})]})})}OL.propTypes={id:C.string.isRequired,mediaType:C.string.isRequired,windowId:C.string.isRequired};function DL({annotation:n,canvases:e,closeCompanionWindow:t,config:r,id:i,playerReferences:a,receiveAnnotation:s,windowId:u}){const{t:c}=Bs.useTranslation(),{enabledTemplateTypes:h,externalTemplates:g}=r.annotation,[v,y]=D.useState(null),[S,_]=D.useState(a.getMediaType()),[O,E]=D.useState(0),[,w]=D.useReducer(G=>G+1,0);!a.isInitializedCorrectly()&&O<10&&(console.log("AnnotationForm.js: retryCount",O),setTimeout(()=>{E(O+1),w()},100));const[N,L]=D.useState({height:window.innerHeight,width:window.innerWidth});if(!v)if(n.id)n.maeData&&n.maeData.templateType?y($g(c,n.maeData.templateType,g)??$g(c,jn.IIIF_TYPE)):y($g(c,jn.IIIF_TYPE));else{const{defaultForm:G}=Um(r),V=TL(c,g,h).filter(Y=>Y.isCompatibleWithMediaType(S));G&&gA[G]?y($g(c,gA[G])):V.length===1&&y(V[0])}if(D.useEffect(()=>{y(null),_(a.getMediaType())},[e[0].index]),D.useEffect(()=>{const G=()=>{L({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}},[]),a.isInitCorrectly||a.isInitializedCorrectly(),!a.isInitCorrectly)return I.jsx(OL,{id:i,mediaType:S,windowId:u});const P=D.useCallback(()=>{t("annotationCreation",{id:i,position:"right"})},[t,i]),z=D.useRef(n);z.current=n;const B=G=>{const V=G,Y=V?.maeData?.templateType?$g(c,V.maeData.templateType,g):void 0,J=a.getCanvases().map(async k=>{let H;V?.maeData&&V.maeData.templateType?H=Y?await Y.convertToAnnotation(V,{canvas:k,playerReferences:a,windowId:u}):await HG(V,k,u,a):H=V;const q=r.annotation.adapter(k.id);return TG(k.id,q,s,H)});return Promise.all(J).then(()=>{P()})};return I.jsx(kt.ConnectedCompanionWindow,{title:n.id?c("edit_annotation"):c("new_annotation"),windowId:u,id:i,children:v===null?I.jsx(wL,{setCommentingType:y,mediaType:S}):I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:1,children:[I.jsx(ce.Grid,{container:!0,children:I.jsx(AL,{setCommentingType:y,templateType:v,annotation:n})}),I.jsx(ce.Grid,{children:I.jsx(IL,{annotation:n,canvases:e,closeFormCompanionWindow:P,playerReferences:a,saveAnnotation:B,templateType:v,windowId:u})})]})})}DL.propTypes={annotation:C.oneOfType([C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string}),C.string]).isRequired,canvases:C.arrayOf(C.shape({id:C.string})).isRequired,closeCompanionWindow:C.func.isRequired,config:C.shape({annotation:C.shape({adapter:C.func,debug:C.bool,defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),enabledTemplateTypes:C.arrayOf(C.string),externalTemplates:C.arrayOf(C.object)}),language:C.string,translations:C.objectOf(C.object)}).isRequired,id:C.string.isRequired,playerReferences:C.object.isRequired,receiveAnnotation:C.func.isRequired,windowId:C.string.isRequired};class koe{actions;mediaType;canvases;windowId;overlay;isInitCorrectly;constructor(e,t,r,i){this.actions=i,this.media=r,this.mediaType=joe(e,t),this.canvases=kt.getVisibleCanvases(e,{windowId:t}),this.windowId=t,this.isInitCorrectly=!1,this.isInitializedCorrectly()&&(this.mediaType===Bi.IMAGE?this.overlay={canvasHeight:this.media.current.canvas.clientHeight,canvasWidth:this.media.current.canvas.clientWidth,containerHeight:this.media.current.canvas.clientHeight,containerWidth:this.media.current.canvas.clientWidth}:console.error("Unknown media type"))}sleep(e){return new Promise(t=>{setTimeout(t,e)})}isInitializedCorrectly(){return this.isInitCorrectly=this.media&&(this.mediaType===Bi.IMAGE&&this.media.current&&this.media.current.canvas||this.mediaType===Bi.VIDEO&&this.media.video)&&this.mediaType!==Bi.UNKNOWN&&this.mediaType!==Bi.AUDIO,this.isInitCorrectly}getMediaType(){return this.mediaType}getCanvases(){return this.canvases}getAudioElement(){return this.mediaType===Bi.AUDIO?document.querySelector("audio"):(console.error("Something is wrong with audio ressource"),null)}getWindowId(){return this.windowId}getCanvasHeight(){return this.overlay.canvasHeight}getCanvasWidth(){return this.overlay.canvasWidth}getContainer(){return this.mediaType===Bi.IMAGE?this.media.current.container:null}getContainerHeight(){return this.overlay.containerHeight}getContainerWidth(){return this.overlay.containerWidth}getDisplayedMediaHeight(){if(this.mediaType===Bi.IMAGE){const e=this.media.current;if(e){const t=this.getMediaTrueHeight()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getDisplayedMediaWidth(){if(this.mediaType===Bi.IMAGE){const e=this.media.current;if(e&&e.world.getItemCount()>0){const t=this.getMediaTrueWidth()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getMediaTrueHeight(){if(this.mediaType===Bi.IMAGE)return this.canvases[0].__jsonld.height;console.error("Unknown media type")}getMediaTrueWidth(){if(this.mediaType===Bi.IMAGE)return this.canvases[0].__jsonld.width}getScale(){return this.isInitializedCorrectly()?this.getDisplayedMediaWidth()/this.getMediaTrueWidth():null}getZoom(){if(this.mediaType===Bi.IMAGE){const e=this.media.current.viewport.getZoom(),t=this.media.current.viewport.getMaxZoom();let r=e/t;return r=Math.round(r*100)/100,r}}getImagePosition(){if(this.mediaType===Bi.IMAGE){const e=this.media.current;if(e){const r=e.world.getItemAt(0).getBounds(),i=e.viewport.viewportToViewerElementCoordinates(r.getTopLeft());return{x:Math.round(i.x),y:Math.round(i.y)}}}}getTargetStrokeWidth(){return Math.max(this.getDisplayedMediaWidth()/500,3)}}function joe(n,e){const t=kt.getVisibleCanvasAudioResources(n,{windowId:e})||[];return(kt.getVisibleCanvasVideoResources(n,{windowId:e})||[]).length>0?Bi.VIDEO:t.length>0?Bi.AUDIO:Bi.IMAGE}const Foe=(n,{id:e,windowId:t})=>({closeCompanionWindow:()=>n(kt.removeCompanionWindow(t,e)),receiveAnnotation:(r,i,a)=>n(kt.receiveAnnotation(r,i,a))});function Boe(n,{id:e,windowId:t}){const i=kt.getCompanionWindow(n,{companionWindowId:e,windowId:t}),{annotationid:a}=i,s=kt.OSDReferences.get(t),u=new koe(n,t,s,AF),c=kt.getVisibleCanvases(n,{windowId:t});let h=kt.getPresentAnnotationsOnSelectedCanvases(n,{windowId:t}).flatMap(g=>g.json.items||[]).find(g=>g.id===a);return h||(h={id:null,maeData:{templateType:null}}),{annotation:h,canvases:c,config:{...n.config,translations:f5},currentTime:null,playerReferences:u}}const NL={companionWindowKey:"annotationCreation",component:DL,mapDispatchToProps:Foe,mapStateToProps:Boe};function ML({PluginComponents:n=[],TargetComponent:e,targetProps:t}){return t.hasAnyAnnotations=!0,I.jsx(e,{...t,PluginComponents:n})}ML.propTypes={PluginComponents:C.array.isRequired,TargetComponent:C.oneOfType([C.func,C.node]).isRequired,targetProps:C.object.isRequired};const LL={component:ML,mode:"wrap",target:"WindowSideBarButtons"};var PL=function(e){return"@@redux-saga/"+e},Goe=PL("IO"),Hoe=PL("MULTICAST"),zoe=function(e){return e==null},qoe=function(e){return e!==void 0},Pd=function(e){return typeof e=="function"},kL=function(e){return typeof e=="string"},jL=Array.isArray,l5=function(e){return e&&(kL(e)||Voe(e)||Pd(e)||jL(e)&&e.every(l5))},K4=function(e){return e&&Pd(e.take)&&Pd(e.close)},Uoe=function(e){return Pd(e)&&e.hasOwnProperty("toString")},Voe=function(e){return!!e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype},Woe=function(e){return K4(e)&&e[Hoe]},Xoe=function(e){return e},Yoe=function(e){throw e},Zoe=function(e){return{value:e,done:!0}};function Joe(n,e,t){e===void 0&&(e=Yoe),t===void 0&&(t="iterator");var r={meta:{name:t},next:n,throw:e,return:Zoe,isSagaIterator:!0};return typeof Symbol<"u"&&(r[Symbol.iterator]=function(){return r}),r}var o_="TAKE",Koe="PUT",$oe="ALL",Qoe="CALL",ele="FORK",tle="SELECT",Rc=function(e,t){var r;return r={},r[Goe]=!0,r.combinator=!1,r.type=e,r.payload=t,r};function nle(n,e){if(n===void 0&&(n="*"),l5(n))return Rc(o_,{pattern:n});if(Woe(n)&&qoe(e)&&l5(e))return Rc(o_,{channel:n,pattern:e});if(K4(n))return Rc(o_,{channel:n})}function rle(n,e){return zoe(e)&&(e=n,n=void 0),Rc(Koe,{channel:n,action:e})}function ile(n){var e=Rc($oe,n);return e.combinator=!0,e}function FL(n,e){var t=null,r;return Pd(n)?r=n:(jL(n)?(t=n[0],r=n[1]):(t=n.context,r=n.fn),t&&kL(r)&&Pd(t[r])&&(r=t[r])),{context:t,fn:r,args:e}}function BL(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(Qoe,FL(n,t))}function GL(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(ele,FL(n,t))}function ale(n){n===void 0&&(n=Xoe);for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(tle,{selector:n,args:t})}var A7=function(e){return{done:!0,value:e}},l_={};function sle(n){return K4(n)?"channel":Uoe(n)?String(n):Pd(n)?n.name:String(n)}function ole(n,e,t){var r,i,a,s=e;function u(c,h){if(s===l_)return A7(c);if(h&&!i)throw s=l_,h;r&&r(c);var g=h?n[i](h):n[s]();return s=g.nextState,a=g.effect,r=g.stateUpdater,i=g.errorState,s===l_?A7(c):a}return Joe(u,function(c){return u(null,c)},t)}function lle(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var a={done:!1,value:nle(n)},s=function(g){return{done:!1,value:GL.apply(void 0,[e].concat(r,[g]))}},u,c=function(g){return u=g};return ole({q1:function(){return{nextState:"q2",effect:a,stateUpdater:c}},q2:function(){return{nextState:"q1",effect:s(u)}}},"q1","takeEvery("+sle(n)+", "+e.name+")")}function ule(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];return GL.apply(void 0,[lle,n,e].concat(r))}function*cle(n){const e=yield ale(kt.getConfig);if(e&&e.annotation.adapter){const t=e.annotation.adapter(n),r=yield BL([t,t.all]);r&&(yield rle(kt.receiveAnnotation(n,t.annotationPageId,r)))}}function*dle(n){const{canvasId:e}=n;yield BL(cle,e)}function*fle(){yield ile([ule(kt.ActionTypes.SET_CANVAS,dle)])}const hle={saga:fle},ple=(n,e)=>{console.error(`AiinotateAdapter.${n} error: `,e)},gle=async n=>{if(!n.ok)throw new Error(`Fetch error: response ${n.status} on url: ${n.url}`)};class mle{constructor(e,t,r,i){if(![2,3].includes(t))throw new Error(`AiiinotateAdapter: unrecognized value for 'iiifPresentationVersion'. expected one of [2,3], got '${t}'`);this.user=i||V1,this.canvasId=r,this.iiifPresentationVersion=t,this.endpointUrl=e,this.endpointUrlAnnotations=`${this.endpointUrl}/annotations/${t}`,this.endpointUrlManifests=`${this.endpointUrl}/manifests/${t}`}getStorageAdapterUser(){return this.user}get annotationPageId(){return`${this.endpointUrlAnnotations}/search?canvasUri=${this.canvasId}`}maybeConvert(e){return this.iiifPresentationVersion===2?zG(e):e}handleResponse=async(e,t)=>(await gle(t),this.all());handleError=(e,t)=>(ple(e,t),this.all());async create(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/create`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("create",t)).catch(t=>this.handleError("create",t))}async update(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/update`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("update",t)).catch(t=>this.handleError("update",t))}async delete(e){return fetch(`${this.endpointUrlAnnotations}/delete?uri=${e}`,{method:"DELETE"}).then(async t=>await this.handleResponse("delete",t)).catch(t=>this.handleError("delete",t))}async get(e){return await fetch(e)}async all(){let e=[],t=this.annotationPageId,r,i;for(;t&&t.length;)r=await fetch(this.annotationPageId),i=await r.json(),e=[...e,...i.resources],t=i.next;const a=await this.iiifPresentationVersion===2?UG(e,this.annotationPageId):e;return a.items=a.items.map(vO),a}}const vle={AiiinotateAdapter:mle,LocalStorageAdapter:j7},yle=[B7,H7,fO,NL,LL,hle];exports.annotationAdapters=vle;exports.annotationCreationCompanionWindowPlugin=NL;exports.canvasAnnotationsPlugin=fO;exports.convertIIIFAnnoToMaeData=vO;exports.default=yle;exports.externalStorageAnnotationPlugin=H7;exports.miradorAnnotationPlugin=B7;exports.templateKit=Fc;exports.windowSideBarButtonsPlugin=LL;
265
+ `+Xn),dr&&(Xn=tr(Xn)),Y&&Vn?ee(Xn):Xn},e.setConfig=function(){let Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cs(Le),Kn=!0,Me=ht,Qe=jt},e.clearConfig=function(){Ii=null,Kn=!1,Me=null,Qe=null,Y=k,J=""},e.isValidAttribute=function(Le,K,fe){Ii||Cs({});const _e=Wn(Le),Xe=Wn(K);return xa(_e,Xe,fe)},e.addHook=function(Le,K){typeof K=="function"&&ks(Te,Le)&&Zg(Te[Le],K)},e.removeHook=function(Le,K){if(ks(Te,Le)){if(K!==void 0){const fe=bse(Te[Le],K);return fe===-1?void 0:xse(Te[Le],fe,1)[0]}return f7(Te[Le])}},e.removeHooks=function(Le){ks(Te,Le)&&(Te[Le]=[])},e.removeAllHooks=function(){Te=_7()},e}var Vse=fL();const Wse=n=>Vse.sanitize(n);function hL({comment:n,onChangeTemplate:e,setComment:t,t:r}){const i=E=>I.jsx("div",{title:E.title,children:E.label}),s=Ka.useSelector(E=>kt.getConfig(E)).annotation.commentTemplates??[],[u,c]=D.useState(null),[h,g]=D.useState(""),[v,y]=D.useState(0),S=E=>{if(E){if(n.trim().length>0){c(E),g(n);return}e(E.value)}},_=()=>{e({...u.value,content:h}),c(null),g("")},O=()=>{c(null),g(""),y(E=>E+1)};return I.jsxs(I.Fragment,{children:[I.jsx(ce.Grid,{container:!0,children:I.jsx(ce.Typography,{variant:"formSectionTitle",children:r("note")})}),s.length>0&&I.jsx(ce.Grid,{style:{marginBottom:"10px"},children:I.jsx(lL,{options:s.map(E=>({label:E.title,title:E.content,value:E})),placeholder:r("useTemplate"),onChange:S,isClearable:!0,isSearchable:!0,formatOptionLabel:i,styles:{marginBottom:"20px"}},v)}),I.jsx(ce.Grid,{container:!0,children:I.jsx(oy,{text:n,setText:t})}),I.jsxs(ce.Dialog,{"aria-labelledby":"confirm-template-selection-title",fullWidth:!0,maxWidth:"sm",onClose:O,open:u!==null,children:[I.jsx(ce.DialogTitle,{id:"confirm-template-selection-title",children:I.jsx(ce.Typography,{variant:"h2",component:"span",children:r("confirmTemplateSelectionTitle")})}),I.jsxs(ce.DialogContent,{children:[I.jsx(ce.DialogContentText,{variant:"body1",color:"inherit",children:r("confirmTemplateSelectionContent")}),I.jsx(ce.Typography,{variant:"subtitle2",sx:{marginTop:"16px"},children:r("selectedTemplateContent")}),I.jsx(ce.Box,{sx:{border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:"4px",marginBottom:"16px",maxHeight:"150px",overflowY:"auto",padding:"8px 12px"},dangerouslySetInnerHTML:{__html:Wse(u?.value.content??"")}}),I.jsx(ce.Typography,{variant:"subtitle2",children:r("currentNoteContent")}),I.jsx(oy,{text:h,setText:g})]}),I.jsxs(ce.DialogActions,{children:[I.jsx(ce.Button,{onClick:O,children:r("cancel")}),I.jsx(ce.Button,{color:"primary",onClick:_,variant:"contained",children:r("applyMerge")})]})]})]})}hL.propTypes={comment:C.string.isRequired,onChangeTemplate:C.func.isRequired,setComment:C.func.isRequired,t:C.func.isRequired};function pL({setTags:n,t:e,tags:t,tagsSuggestions:r}){return I.jsxs(I.Fragment,{children:[I.jsx(ce.Typography,{variant:"formSectionTitle",children:e("tags")}),I.jsx(lL,{isMulti:!0,options:r,value:t,onChange:n,closeMenuOnSelect:!1,placeholder:e("tagsPlaceholder")}),I.jsx(ce.Divider,{spacing:2})]})}pL.propTypes={setTags:C.func.isRequired,t:C.func.isRequired,tags:C.any.isRequired,tagsSuggestions:C.arrayOf(C.shape({label:C.string,value:C.string})).isRequired};const Fc={AnnotationFormFooter:A5,MultiTagsInput:pL,TargetFormSection:I4,TextCommentInput:hL,TextFormSection:AM},{AnnotationFormFooter:Xse}=Fc,Yse=async n=>n;function gL({annotation:n,canvases:e,closeFormCompanionWindow:t,saveAnnotation:r,t:i}){const[a,s]=D.useState(n),u=()=>{e.forEach(async c=>{r(a.newData,c.id)}),t()};return I.jsxs(I.Fragment,{children:[I.jsx(ce.Paper,{elevation:0,style:{minHeight:"300px"},children:I.jsx(DH,{data:a,onUpdate:s})}),I.jsx(Xse,{closeFormCompanionWindow:t,saveAnnotation:u,t:i,annotationState:a})]})}gL.propTypes={annotation:C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,maeData:C.object,manifestNetwork:C.string,motivation:C.string,target:C.string}).isRequired,canvases:C.arrayOf(C.object).isRequired,closeFormCompanionWindow:C.func.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired};const Zse=mr.createSvgIcon(I.jsx("path",{d:"M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3z"}),"Audiotrack"),Jse=mr.createSvgIcon(I.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),T7=mr.createSvgIcon(I.jsx("path",{d:"m18 4 2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z"}),"Movie"),Kse=mr.createSvgIcon(I.jsx("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf"),$se=300,Qse={audio:Zse,"research-pdf":Kse,"uploaded-video":T7,"youtube-video":T7},w7={borderRadius:1,flexShrink:0,height:40,objectFit:"cover",width:40};function s5({media:n}){if(n.thumbnailUrl)return I.jsx(ce.Box,{component:"img",src:n.thumbnailUrl,alt:"","data-testid":"media-selection-thumbnail",sx:w7});const e=n.source==="media-item"&&Qse[n.mediaType]||(n.source==="upload"?kD:Jse);return I.jsx(ce.Box,{sx:{...w7,alignItems:"center",bgcolor:"action.hover",color:"action.active",display:"flex",justifyContent:"center"},children:I.jsx(e,{fontSize:"small"})})}s5.propTypes={media:C.shape({mediaType:C.string,source:C.string,thumbnailUrl:C.string}).isRequired};const s_={"iiif-image":{normalize:n=>({id:n.documentId,source:"iiif-image",thumbnailUrl:n.thumbnailUrl??null,title:n.displayTitle}),titleKey:"poi_media_source_iiif_image"},upload:{normalize:n=>({id:String(n.id),source:"upload",thumbnailUrl:n.thumbnailUrl??null,title:n.name}),titleKey:"poi_media_source_upload"},"media-item":{normalize:n=>({id:n.documentId,mediaType:n.mediaType??null,source:"media-item",thumbnailUrl:n.thumbnailUrl??null,title:n.titleEn}),titleKey:"poi_media_source_media_item"}};function t0({dialogContainer:n,label:e,onChange:t,onSearchIiifImages:r,onSearchMediaItems:i,onSearchUploads:a,t:s,value:u}){const c=D.useMemo(()=>({"iiif-image":r,"media-item":i,upload:a}),[r,i,a]),h=D.useMemo(()=>Object.keys(s_).filter(G=>typeof c[G]=="function"),[c]),[g,v]=D.useState((u&&h.includes(u.source)?u.source:h[0])??null),[y,S]=D.useState(u?.title??""),[_,O]=D.useState(u?[u]:[]),[E,w]=D.useState(!1),N=D.useRef(null),L=D.useRef(0);D.useEffect(()=>()=>{clearTimeout(N.current),L.current+=1},[]);const P=(G,V)=>{const Y=c[G];if(typeof Y!="function")return;const J=L.current+1;L.current=J,w(!0),Promise.resolve(Y(V)).then(k=>{L.current===J&&O(k.map(s_[G].normalize))}).finally(()=>{L.current===J&&w(!1)})},z=(G,V)=>{clearTimeout(N.current),N.current=setTimeout(()=>P(G,V),$se)},B=(G,V)=>{V&&(L.current+=1,clearTimeout(N.current),v(V),S(""),O([]),w(!1))};return h.length===0?null:I.jsxs(ce.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[h.length>1&&I.jsx(ce.ToggleButtonGroup,{value:g,exclusive:!0,onChange:B,size:"small",color:"primary",children:h.map(G=>I.jsx(ce.ToggleButton,{value:G,children:s(s_[G].titleKey)},G))}),I.jsx(ce.Autocomplete,{filterOptions:G=>G,getOptionKey:G=>G.id,getOptionLabel:G=>G.title,inputValue:y,isOptionEqualToValue:(G,V)=>G.source===V.source&&G.id===V.id,loading:E,noOptionsText:s(y?"poi_media_no_results":"poi_media_search_prompt"),onChange:(G,V)=>t(V),onInputChange:(G,V)=>{S(V),z(g,V)},onOpen:()=>P(g,y),options:_,renderInput:G=>I.jsx(ce.TextField,{...G,label:e,variant:"outlined",InputProps:{...G.InputProps,endAdornment:I.jsxs(I.Fragment,{children:[E?I.jsx(ce.CircularProgress,{color:"inherit",size:16}):null,G.InputProps.endAdornment]})}}),renderOption:(G,V)=>D.createElement(ce.Box,{component:"li",...G,key:V.id,sx:{alignItems:"center",display:"flex",gap:1}},I.jsx(s5,{media:{...V,source:g}}),V.title),slotProps:{popper:{container:n}},value:u&&u.source===g?u:null}),u&&I.jsxs(ce.Box,{sx:{alignItems:"center",display:"flex",gap:1},children:[I.jsx(s5,{media:u}),I.jsx(ce.Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:u.title})]})]})}t0.propTypes={dialogContainer:C.func.isRequired,label:C.string.isRequired,onChange:C.func.isRequired,onSearchIiifImages:C.func,onSearchMediaItems:C.func,onSearchUploads:C.func,t:C.func.isRequired,value:C.shape({id:C.string.isRequired,mediaType:C.string,source:C.oneOf(["upload","iiif-image","media-item"]).isRequired,thumbnailUrl:C.string,title:C.string})};t0.defaultProps={onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0,value:null};const eoe=["showBlocks","|","heading","|","superscript","bold","italic","underline","strikethrough","|","bulletedList","numberedList","link","insertTable","codeBlock","specialCharacters","horizontalLine","subscript","|","undo","redo"],toe=[{class:"ck-heading_paragraph",model:"paragraph",title:"Paragraph"},{class:"ck-heading_heading2",model:"heading2",title:"Heading 2",view:"h2"},{class:"ck-heading_heading3",model:"heading3",title:"Heading 3",view:"h3"},{class:"ck-heading_heading4",model:"heading4",title:"Heading 4",view:"h4"},{class:"ck-heading_heading5",model:"heading5",title:"Heading 5",view:"h5"},{class:"ck-heading_heading6",model:"heading6",title:"Heading 6",view:"h6"}],noe=[ji.Autoformat,ji.Bold,ji.CodeBlock,ji.Essentials,ji.Heading,ji.HorizontalLine,ji.Italic,ji.Link,ji.List,ji.Paragraph,ji.ShowBlocks,ji.SpecialCharacters,ji.SpecialCharactersEssentials,ji.Strikethrough,ji.Subscript,ji.Superscript,ji.Table,ji.TableToolbar,ji.Underline];function n0({onChange:n,placeholder:e,rtl:t,value:r}){return I.jsx(ce.Box,{sx:{"& .ck-content":{overflowWrap:"break-word"},"& .ck-content *":t?{direction:"rtl",textAlign:"right"}:void 0,"& .ck-content img, & .ck-content table":{maxWidth:"100%"},"& .ck-editor, & .ck-editor__editable":{maxWidth:"100%"},"& .ck-editor__editable":{minHeight:"150px"},"& .ck-editor__editable, & .ck-content":t?{direction:"rtl",textAlign:"right",unicodeBidi:"plaintext"}:void 0,maxWidth:"100%",minWidth:0},children:I.jsx(wF.CKEditor,{config:{heading:{options:toe},language:{content:t?"ar":"en",ui:"en"},licenseKey:"GPL",placeholder:e,plugins:noe,toolbar:{items:eoe,shouldNotGroupWhenFull:!0}},data:r,editor:ji.ClassicEditor,onChange:(i,a)=>n(a.getData())})})}n0.propTypes={onChange:C.func.isRequired,placeholder:C.string,rtl:C.bool,value:C.string};n0.defaultProps={placeholder:void 0,rtl:!1,value:""};const{AnnotationFormFooter:roe,TargetFormSection:ioe}=Fc,o5="TextualBody",mL=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),aoe={description:"",title:""},vL=(n,e)=>n[e]??aoe,X4=n=>{const e={},t=new Set;return n.forEach(r=>{const i=r.language;if(!i)return;const a=e[i]??{description:"",title:""};r.purpose==="identifying"?a.title=r.value??"":r.purpose==="describing"&&r.type===o5&&!t.has(i)&&(a.description=r.value??"",t.add(i)),e[i]=a}),e},yL=n=>{const e=n?.target?.drawingState?.shapes;return Array.isArray(e)&&e.length===1&&e[0].type===Xt.POI},Y4=n=>{const e=n,{contentByLocale:t}=e.maeData;return e.body=Object.entries(t).flatMap(([r,i])=>{const{description:a,title:s}=i;return[{language:r,purpose:"identifying",type:o5,value:op(s)?Lm():s},...op(a)?[]:[{language:r,purpose:"describing",type:o5,value:a}]]}),e},soe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=Y4(n);return Wm(i,e,t,r)};function bL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const{contentLocales:s=[],searchMediaItems:u,searchIiifImages:c,searchUploads:h}=Ka.useSelector(H=>kt.getConfig(H)).annotation??{};let g=n;g.id?(g.maeData.target.drawingState&&typeof g.maeData.target.drawingState=="string"&&(g.maeData.target.drawingState={...JSON.parse(g.maeData.target.drawingState),currentShape:null}),g.maeData.contentByLocale=X4(g.body)):g={body:[],"dbf:kind":"POI","dbf:media":null,maeData:{contentByLocale:{},target:null,templateType:jn.POI_TYPE},motivation:"identifying",target:null};const[v,y]=D.useState(g),[S,_]=D.useState(!1),[O,E]=D.useState(!1),[w,N]=D.useState(Object.keys(v.maeData.contentByLocale)[0]??s[0]?.code),L=D.useRef(null),P=()=>L.current?.closest('[role="dialog"]')??document.body,z=vL(v.maeData.contentByLocale,w),B=mL(w),G=H=>{y({...v,maeData:{...v.maeData,...H}})},V=H=>{G({target:H})},Y=H=>{G({contentByLocale:{...v.maeData.contentByLocale,[w]:{...z,...H}}})},J=H=>{y({...v,"dbf:media":H})},k=async()=>{if(!yL(v.maeData)){_(!0);return}_(!1),Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),E(!0);try{await r(v)}finally{E(!1)}};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,ref:L,children:[I.jsxs(ce.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("poi")})}),s.length>1&&I.jsx(ce.Grid,{children:I.jsxs(ce.FormControl,{size:"small",sx:{minWidth:160},children:[I.jsx(ce.InputLabel,{id:"poi-language-label",children:i("poi_language")}),I.jsx(ce.Select,{labelId:"poi-language-label",label:i("poi_language"),value:w??"",onChange:H=>N(H.target.value),MenuProps:{container:P},children:s.map(({code:H,name:q})=>I.jsx(ce.MenuItem,{value:H,children:q??H},H))})]})})]}),I.jsx(ce.Grid,{children:I.jsx(ce.TextField,{fullWidth:!0,label:i("poi_title"),value:z.title,variant:"outlined",onChange:H=>Y({title:H.target.value}),slotProps:{htmlInput:{dir:B?"rtl":"ltr",style:{textAlign:B?"right":"left"}}}})}),(u||c||h)&&I.jsx(ce.Grid,{children:I.jsx(t0,{dialogContainer:P,label:i("poi_media"),onChange:J,onSearchIiifImages:c,onSearchMediaItems:u,onSearchUploads:h,t:i,value:v["dbf:media"]??null})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("poi_description_section")})}),I.jsx(ce.Grid,{children:I.jsx(n0,{onChange:H=>Y({description:H}),placeholder:i("poi_description_placeholder"),rtl:B,value:z.description})}),I.jsxs(ce.Grid,{children:[I.jsx(ioe,{onChangeTarget:V,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:v.maeData.target,windowId:a}),S&&I.jsx(mn,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),I.jsx(ce.Grid,{children:I.jsx(roe,{closeFormCompanionWindow:e,saveAnnotation:k,saving:O,t:i,annotationState:v})})]})}bL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:ooe}=Fc,loe=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),uoe={description:"",title:""},coe=(n,e)=>n[e]??uoe,doe=async(n,{canvas:e})=>{const t=Y4(n);return t.target=e.id,t};function xL({annotation:n,closeFormCompanionWindow:e,saveAnnotation:t,t:r}){const{contentLocales:i=[],searchMediaItems:a,searchIiifImages:s,searchUploads:u}=Ka.useSelector(G=>kt.getConfig(G)).annotation??{};let c=n;c.id?c.maeData.contentByLocale=X4(c.body):c={body:[],"dbf:kind":"Journey","dbf:media":null,maeData:{contentByLocale:{},target:{},templateType:jn.JOURNEY_TYPE},motivation:"identifying",target:null};const[h,g]=D.useState(c),[v,y]=D.useState(!1),[S,_]=D.useState(Object.keys(h.maeData.contentByLocale)[0]??i[0]?.code),O=D.useRef(null),E=()=>O.current?.closest('[role="dialog"]')??document.body,w=coe(h.maeData.contentByLocale,S),N=loe(S),L=G=>{g({...h,maeData:{...h.maeData,...G}})},P=G=>{L({contentByLocale:{...h.maeData.contentByLocale,[S]:{...w,...G}}})},z=G=>{g({...h,"dbf:media":G})},B=async()=>{y(!0);try{await t(h)}finally{y(!1)}};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,ref:O,children:[I.jsxs(ce.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:r("journey")})}),i.length>1&&I.jsx(ce.Grid,{children:I.jsxs(ce.FormControl,{size:"small",sx:{minWidth:160},children:[I.jsx(ce.InputLabel,{id:"journey-language-label",children:r("journey_language")}),I.jsx(ce.Select,{labelId:"journey-language-label",label:r("journey_language"),value:S??"",onChange:G=>_(G.target.value),MenuProps:{container:E},children:i.map(({code:G,name:V})=>I.jsx(ce.MenuItem,{value:G,children:V??G},G))})]})})]}),I.jsx(ce.Grid,{children:I.jsx(ce.TextField,{fullWidth:!0,label:r("journey_title"),value:w.title,variant:"outlined",onChange:G=>P({title:G.target.value}),slotProps:{htmlInput:{dir:N?"rtl":"ltr",style:{textAlign:N?"right":"left"}}}})}),(a||s||u)&&I.jsx(ce.Grid,{children:I.jsx(t0,{dialogContainer:E,label:r("journey_media"),onChange:z,onSearchIiifImages:s,onSearchMediaItems:a,onSearchUploads:u,t:r,value:h["dbf:media"]??null})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:r("journey_description_section")})}),I.jsx(ce.Grid,{children:I.jsx(n0,{onChange:G=>P({description:G}),placeholder:r("journey_description_placeholder"),rtl:N,value:w.description})}),I.jsx(ce.Grid,{children:I.jsx(ooe,{closeFormCompanionWindow:e,saveAnnotation:B,saving:v,t:r,annotationState:h})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"subFormSectionTitle",children:r("journey_hint")})})]})}xL.propTypes={annotation:C.shape({body:C.arrayOf(C.shape({type:C.string})),id:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired};const{AnnotationFormFooter:foe,MultiTagsInput:hoe,TargetFormSection:poe,TextCommentInput:goe}=Fc,moe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=bO(n);return Wm(i,e,t,r)};function SL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const s=Ka.useSelector(N=>kt.getConfig(N)),c=s.annotation.tagsSuggestions??[];let h=n;if(h.id)h.maeData.target.drawingState&&typeof h.maeData.target.drawingState=="string"&&(h.maeData.target.drawingState=JSON.parse(h.maeData.target.drawingState),console.debug("Parsed drawingState:",h.maeData.target.drawingState),h.maeData.target.drawingState={...h.maeData.target.drawingState,currentShape:null}),h.maeData.textBody=h.body.find(N=>N.purpose==="describing"),h.maeData.tags=h.body.filter(N=>N.purpose==="tagging").map(N=>({label:N.value,value:N.value})),h.maeData.textBody===void 0&&(h.maeData.textBody={purpose:"describing",type:"TextualBody",value:""});else{const{defaultTags:N}=Um(s),L=N.map(P=>({label:P,value:P}));h={body:[],maeData:{tags:L,target:null,templateType:jn.MULTIPLE_BODY_TYPE,textBody:{purpose:"describing",type:"TextualBody",value:""}},motivation:"commenting",target:null}}const[g,v]=D.useState(h),y=N=>{v({...g,maeData:{...g.maeData,textBody:{...g.maeData.textBody,value:N}}})},S=N=>{v({...g,maeData:{...g.maeData,tags:N}})},_=N=>{const L=g.maeData;L.target=N,v({...g,maeData:L})},O=async()=>{Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(g)},E=c.map(N=>({label:N,value:N})),w=N=>{const L=E.find(P=>P.value===N.title);if(L&&!g.maeData.tags.find(P=>P.value===L.value)){v({...g,maeData:{...g.maeData,tags:[...g.maeData.tags,L],textBody:{...g.maeData.textBody,value:N.content}}});return}y(N.content)};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,children:[I.jsx(ce.Grid,{children:I.jsx(goe,{comment:g.maeData.textBody.value,setComment:y,onChangeTemplate:w,t:i})}),I.jsx(ce.Grid,{children:I.jsx(hoe,{t:i,tags:g.maeData.tags,setTags:S,tagsSuggestions:E})}),I.jsx(ce.Grid,{children:I.jsx(poe,{onChangeTarget:_,playerReferences:t,spatialTarget:!0,t:i,target:g.maeData.target,timeTarget:!0,windowId:a})}),I.jsx(ce.Grid,{children:I.jsx(foe,{closeFormCompanionWindow:e,saveAnnotation:O,t:i,annotationState:g})})]})}SL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const voe=300;function Z4({dialogContainer:n,label:e,onChange:t,onSearch:r,t:i,value:a}){const[s,u]=D.useState(a?.titleEn??""),[c,h]=D.useState(a?[a]:[]),[g,v]=D.useState(!1),y=D.useRef(null),S=D.useRef(0);D.useEffect(()=>()=>{clearTimeout(y.current),S.current+=1},[]);const _=E=>{const w=S.current+1;S.current=w,v(!0),Promise.resolve(r(E)).then(N=>{S.current===w&&h(N)}).finally(()=>{S.current===w&&v(!1)})},O=E=>{clearTimeout(y.current),y.current=setTimeout(()=>_(E),voe)};return I.jsx(ce.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:I.jsx(ce.Autocomplete,{filterOptions:E=>E,getOptionKey:E=>E.documentId,getOptionLabel:E=>E.titleEn,inputValue:s,isOptionEqualToValue:(E,w)=>E.documentId===w.documentId,loading:g,noOptionsText:i(s?"map_relation_no_results":"map_relation_search_prompt"),onChange:(E,w)=>t(w),onInputChange:(E,w)=>{u(w),O(w)},onOpen:()=>_(s),options:c,renderInput:E=>I.jsx(ce.TextField,{...E,label:e,variant:"outlined",InputProps:{...E.InputProps,endAdornment:I.jsxs(I.Fragment,{children:[g?I.jsx(ce.CircularProgress,{color:"inherit",size:16}):null,E.InputProps.endAdornment]})}}),slotProps:{popper:{container:n}},value:a})})}Z4.propTypes={dialogContainer:C.func.isRequired,label:C.string.isRequired,onChange:C.func.isRequired,onSearch:C.func.isRequired,t:C.func.isRequired,value:C.shape({documentId:C.string.isRequired,titleEn:C.string.isRequired})};Z4.defaultProps={value:null};const{AnnotationFormFooter:yoe,TargetFormSection:boe}=Fc,xoe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=Y4(n);return Wm(i,e,t,r)};function CL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const{contentLocales:s=[],searchMediaItems:u,searchMaps:c,searchIiifImages:h,searchUploads:g}=Ka.useSelector(se=>kt.getConfig(se)).annotation??{};let v=n;v.id?(v.maeData.target.drawingState&&typeof v.maeData.target.drawingState=="string"&&(v.maeData.target.drawingState={...JSON.parse(v.maeData.target.drawingState),currentShape:null}),v.maeData.contentByLocale=X4(v.body)):v={body:[],"dbf:kind":"POI","dbf:linkedMap":null,"dbf:media":null,maeData:{contentByLocale:{},target:null,templateType:jn.NESTED_MAP_TYPE},motivation:"identifying",target:null};const[y,S]=D.useState(v),[_,O]=D.useState(!1),[E,w]=D.useState(!1),[N,L]=D.useState(!1),[P,z]=D.useState(Object.keys(y.maeData.contentByLocale)[0]??s[0]?.code),B=D.useRef(null),G=()=>B.current?.closest('[role="dialog"]')??document.body,V=vL(y.maeData.contentByLocale,P),Y=mL(P),J=y["dbf:linkedMap"]??null,k=se=>{S({...y,maeData:{...y.maeData,...se}})},H=se=>{k({target:se})},q=se=>{k({contentByLocale:{...y.maeData.contentByLocale,[P]:{...V,...se}}})},te=se=>{S({...y,"dbf:linkedMap":se?{id:se.documentId,titleEn:se.titleEn}:null})},ee=se=>{S({...y,"dbf:media":se})},$=async()=>{const se=yL(y.maeData),Q=!!y["dbf:linkedMap"];if(O(!se),w(!Q),!(!se||!Q)){Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),L(!0);try{await r(y)}finally{L(!1)}}};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,ref:B,children:[I.jsxs(ce.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("nested_map")})}),s.length>1&&I.jsx(ce.Grid,{children:I.jsxs(ce.FormControl,{size:"small",sx:{minWidth:160},children:[I.jsx(ce.InputLabel,{id:"nested-map-language-label",children:i("poi_language")}),I.jsx(ce.Select,{labelId:"nested-map-language-label",label:i("poi_language"),value:P??"",onChange:se=>z(se.target.value),MenuProps:{container:G},children:s.map(({code:se,name:Q})=>I.jsx(ce.MenuItem,{value:se,children:Q??se},se))})]})})]}),I.jsx(ce.Grid,{children:I.jsx(ce.TextField,{fullWidth:!0,label:i("poi_title"),value:V.title,variant:"outlined",onChange:se=>q({title:se.target.value}),slotProps:{htmlInput:{dir:Y?"rtl":"ltr",style:{textAlign:Y?"right":"left"}}}})}),(u||h||g)&&I.jsx(ce.Grid,{children:I.jsx(t0,{dialogContainer:G,label:i("poi_media"),onChange:ee,onSearchIiifImages:h,onSearchMediaItems:u,onSearchUploads:g,t:i,value:y["dbf:media"]??null})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("poi_description_section")})}),I.jsx(ce.Grid,{children:I.jsx(n0,{onChange:se=>q({description:se}),placeholder:i("poi_description_placeholder"),rtl:Y,value:V.description})}),I.jsx(ce.Grid,{children:I.jsx(mn,{variant:"formSectionTitle",children:i("nested_map_linked_map")})}),typeof c=="function"&&I.jsxs(ce.Grid,{children:[I.jsx(Z4,{dialogContainer:G,label:i("nested_map_linked_map"),onChange:te,onSearch:c,t:i,value:J?{documentId:J.id,titleEn:J.titleEn}:null}),E&&I.jsx(mn,{color:"error",variant:"caption",children:i("nested_map_linked_map_required")})]}),I.jsxs(ce.Grid,{children:[I.jsx(boe,{onChangeTarget:H,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:y.maeData.target,windowId:a}),_&&I.jsx(mn,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),I.jsx(ce.Grid,{children:I.jsx(yoe,{closeFormCompanionWindow:e,saveAnnotation:$,saving:N,t:i,annotationState:y})})]})}CL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:Soe,TargetFormSection:Coe}=Fc,Eoe=yO;function EL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const s=Ka.useSelector(S=>kt.getConfig(S));let u=n;if(u.id)u.maeData.target.drawingState&&typeof u.maeData.target.drawingState=="string"&&(u.maeData.target.drawingState=JSON.parse(u.maeData.target.drawingState));else{const{defaultTags:S}=Um(s);u={body:{type:"Image",value:S.length>0?S[0]:""},maeData:{target:null,templateType:jn.TAGGING_TYPE},motivation:"tagging",target:null}}const[c,h]=D.useState(u),g=S=>{const _=c.body;_.value=S,h({...c,body:_})},v=S=>{const _=c.maeData;_.target=S,h({...c,maeData:_})},y=async()=>{Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(c)};return I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,children:[I.jsx(ce.Grid,{children:I.jsxs(mn,{variant:"formSectionTitle",children:[i("tag")," "]})}),I.jsx(ce.Grid,{children:I.jsx(ce.TextField,{id:"outlined-basic",label:i("your_tag_here"),value:c.body.value,variant:"outlined",onChange:S=>g(S.target.value)})}),I.jsx(ce.Grid,{children:I.jsx(Coe,{onChangeTarget:v,playerReferences:t,spatialTarget:!0,target:c.maeData.target,windowId:a})}),I.jsx(ce.Grid,{children:I.jsx(Soe,{closeFormCompanionWindow:e,saveAnnotation:y,t:i,annotationState:c})})]})}EL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:_oe,TargetFormSection:Toe,TextCommentInput:woe}=Fc,Aoe="Annotation",Roe=yO;function _L({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){let s=n;s.id?s.maeData.target.drawingState&&typeof s.maeData.target.drawingState=="string"&&(s.maeData.target.drawingState=JSON.parse(s.maeData.target.drawingState)):s={body:{id:ys(),type:"TextualBody",value:""},maeData:{target:null,templateType:jn.TEXT_TYPE},motivation:"commenting",target:null};const[u,c]=D.useState(s),h=S=>{const _=u.body;_.value=S,c({...u,body:_})},g=S=>{h(S.content)},v=S=>{const _=u.maeData;_.target=S,c({...u,maeData:_})},y=()=>{Vm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),u.body.value===void 0&&(u.body.value=Aoe),r(u)};return D.useEffect(()=>{},[u.maeData.target]),I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:2,children:[I.jsx(ce.Grid,{children:I.jsx(woe,{comment:u.body.value,setComment:h,onChangeTemplate:g,t:i})}),I.jsx(ce.Grid,{children:I.jsx(Toe,{onChangeTarget:v,playerReferences:t,spatialTarget:!0,target:u.maeData.target,windowId:a})}),I.jsx(ce.Grid,{children:I.jsx(_oe,{closeFormCompanionWindow:e,saveAnnotation:y,t:i,annotationState:u})})]})}_L.propTypes={annotation:C.object.isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const xd=n=>n===Bi.IMAGE,J4=(n,e=[])=>{const t=[{Component:SL,convertToAnnotation:moe,description:n("textual_note_with_target"),icon:I.jsx(VG,{}),id:jn.MULTIPLE_BODY_TYPE,isCompatibleWithMediaType:xd,label:n("note"),selectable:!0},{Component:EL,convertToAnnotation:Eoe,description:n("tag_with_target"),icon:I.jsx(WG,{fontSize:"small"}),id:jn.TAGGING_TYPE,isCompatibleWithMediaType:xd,label:n("tag"),selectable:!0},{Component:bL,convertToAnnotation:soe,description:n("poi_description"),icon:I.jsx(JG,{fontSize:"small"}),id:jn.POI_TYPE,isCompatibleWithMediaType:xd,label:n("poi"),selectable:!0},{Component:CL,convertToAnnotation:xoe,description:n("nested_map_description"),icon:I.jsx(ZG,{fontSize:"small"}),id:jn.NESTED_MAP_TYPE,isCompatibleWithMediaType:xd,label:n("nested_map"),selectable:!0},{Component:xL,convertToAnnotation:doe,description:n("journey_description"),icon:I.jsx(YG,{fontSize:"small"}),id:jn.JOURNEY_TYPE,isCompatibleWithMediaType:xd,label:n("journey"),selectable:!0},{Component:gL,convertToAnnotation:Yse,description:n("edit_iiif_json_code"),icon:I.jsx(XG,{fontSize:"small"}),id:jn.IIIF_TYPE,isCompatibleWithMediaType:xd,label:n("expert_mode"),selectable:!0},{Component:_L,convertToAnnotation:Roe,description:"",icon:null,id:jn.TEXT_TYPE,isCompatibleWithMediaType:xd,label:"",selectable:!1}],r=new Set(t.map(a=>a.id)),i=e.filter(a=>r.has(a.id)?(console.warn(`Ignoring external annotation template with id "${a.id}": it collides with a built-in template id.`),!1):typeof a.id!="string"||typeof a.Component!="function"||typeof a.convertToAnnotation!="function"||typeof a.isCompatibleWithMediaType!="function"?(console.warn(`Ignoring external annotation template with id "${a.id}": it does not follow the TEMPLATE_REGISTRY contract (id: string, Component/convertToAnnotation/isCompatibleWithMediaType: function are all required).`),!1):!0);return[...t,...i]},TL=(n,e=[],t=null)=>J4(n,e).filter(r=>r.selectable).filter(r=>!Array.isArray(t)||t.length===0?!0:t.includes(r.id)),$g=(n,e,t=[])=>J4(n,t).find(r=>r.id===e);function wL({mediaType:n,setCommentingType:e}){const{t}=Bs.useTranslation(),r=u=>e(u),{enabledTemplateTypes:i,externalTemplates:a}=Ka.useSelector(u=>kt.getConfig(u)).annotation,s=TL(t,a,i);return I.jsx(Ioe,{children:n===Bi.AUDIO?I.jsx(ce.Grid,{container:!0,spacing:1,direction:"column",children:I.jsx(ce.Grid,{children:I.jsx(mn,{children:t("audio_not_supported")})})}):s.map(u=>u.isCompatibleWithMediaType(n)&&I.jsx(Ooe,{children:I.jsx(Doe,{id:u.id,onClick:()=>r(u),children:I.jsxs(ce.CardContent,{children:[I.jsxs(Noe,{component:"div",children:[t(u.label),u.icon]}),I.jsx(Moe,{component:"div",variant:"body2",children:t(u.description)})]})})},u.id))})}const Ioe=xs.styled("div")(({theme:n})=>({display:"flex",flexDirection:"column",gap:n.spacing(3.75),margin:n.spacing(1.25)})),Ooe=xs.styled(ce.Card)(({theme:n})=>({borderRadius:n.shape.borderRadius,boxShadow:n.shadows[1],border:`1px solid ${xs.alpha(n.palette.primary?.main??"#5A8264",.25)}`,transition:"box-shadow 120ms ease, transform 120ms ease, border-color 120ms ease","&:hover":{boxShadow:n.shadows[3],borderColor:xs.alpha(n.palette.primary?.main??"#5A8264",.5),transform:"translateY(-1px)"}})),Doe=xs.styled(ce.CardActionArea)(({theme:n})=>({borderRadius:n.shape.borderRadius,"&:hover":{backgroundColor:xs.alpha(n.palette.primary?.main??"#5A8264",.06)}})),Noe=xs.styled(mn)(({theme:n})=>{const e=n.typography.formSectionTitle??{};return{display:"flex",justifyContent:"space-between",alignItems:"center",gap:n.spacing(1),color:e.color??n.palette.primary?.main??"#5A8264",fontSize:e.fontSize??n.typography.h6.fontSize,fontWeight:e.fontWeight??600,letterSpacing:e.letterSpacing??"0.02em",textTransform:e.textTransform??"none",lineHeight:1.25,marginBottom:n.spacing(.5)}}),Moe=xs.styled(mn)(({theme:n})=>{const e=n.typography.subFormSectionTitle??{};return{color:n.palette.text.secondary,fontSize:e.fontSize??n.typography.body2.fontSize,fontWeight:e.fontWeight??300,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??n.typography.body2.lineHeight,textTransform:e.textTransform??"none"}});wL.propTypes={mediaType:C.string.isRequired,setCommentingType:C.func.isRequired};const Loe=mr.createSvgIcon(I.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");function AL({templateType:n,setCommentingType:e,annotation:t}){const r=()=>{e(null)};return I.jsxs(ce.Grid,{container:!0,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{marginRight:"10px"},spacing:2,children:[I.jsx(ce.Grid,{children:t.id==null&&I.jsx(kt.MiradorMenuButton,{"aria-label":"back",TooltipProps:{title:"back"},children:I.jsx(Loe,{onClick:r})})}),I.jsx(ce.Grid,{children:n.icon})]})}AL.propTypes={annotation:C.oneOfType([C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string}),C.string]).isRequired,setCommentingType:C.func.isRequired,templateType:C.shape({description:C.string,icon:C.element,id:C.string,label:C.string}).isRequired};function RL({playerReferences:n,t:e}){return I.jsxs(I.Fragment,{children:[I.jsx("h4",{children:"Debug info "}),I.jsx("p",{children:"Only visible in debug mode"}),I.jsx(mn,{children:n.getMediaType()}),I.jsxs(mn,{children:[e("scale"),":",n.getScale()]}),I.jsxs(mn,{children:[e("zoom"),":",n.getZoom()]}),I.jsxs(mn,{children:[e("image_true_size"),":",n.getMediaTrueWidth()," ","x",n.getMediaTrueHeight()]}),I.jsxs(mn,{children:[e("container_size"),":",n.getContainerWidth()," ","x",n.getContainerHeight()]}),I.jsxs(mn,{children:[e("image_displayed"),":",n.getDisplayedMediaWidth()," ","x",n.getDisplayedMediaHeight()]})]})}RL.propTypes={playerReferences:C.any.isRequired,t:C.func.isRequired};function IL({annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,templateType:a,windowId:s}){const{t:u}=Bs.useTranslation(),c=Ka.useSelector(y=>kt.getConfig(y)).annotation,h=c.debug??!1,{externalTemplates:g}=c,v=D.useMemo(()=>J4(u,g).find(y=>y.id===a.id)?.Component,[u,a.id,g]);return I.jsxs(ce.Grid,{container:!0,direction:"column",children:[I.jsx(Poe,{children:v&&I.jsx(v,{annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,t:u,windowId:s})}),h&&I.jsx(RL,{playerReferences:r,t:u})]})}const Poe=xs.styled(ce.Grid)({margin:"0 10px"});IL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,canvases:C.arrayOf(C.shape({id:C.string,index:C.number})).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,templateType:C.shape({description:C.string,icon:C.element,id:C.string,label:C.string}).isRequired,windowId:C.string.isRequired};function OL({id:n,windowId:e,mediaType:t}){const{t:r}=Bs.useTranslation();return I.jsx(kt.CompanionWindow,{title:r("media_not_supported"),windowId:e,id:n,children:I.jsxs(ce.Grid,{container:!0,padding:1,spacing:1,children:[I.jsx(ce.Grid,{children:I.jsx(mn,{children:r("media_not_supported")})}),I.jsx(ce.Grid,{children:I.jsx(mn,{children:r("detected_media_type",{mediaType:t})})})]})})}OL.propTypes={id:C.string.isRequired,mediaType:C.string.isRequired,windowId:C.string.isRequired};function DL({annotation:n,canvases:e,closeCompanionWindow:t,config:r,id:i,playerReferences:a,receiveAnnotation:s,windowId:u}){const{t:c}=Bs.useTranslation(),{enabledTemplateTypes:h,externalTemplates:g}=r.annotation,[v,y]=D.useState(null),[S,_]=D.useState(a.getMediaType()),[O,E]=D.useState(0),[,w]=D.useReducer(G=>G+1,0);!a.isInitializedCorrectly()&&O<10&&(console.log("AnnotationForm.js: retryCount",O),setTimeout(()=>{E(O+1),w()},100));const[N,L]=D.useState({height:window.innerHeight,width:window.innerWidth});if(!v)if(n.id)n.maeData&&n.maeData.templateType?y($g(c,n.maeData.templateType,g)??$g(c,jn.IIIF_TYPE)):y($g(c,jn.IIIF_TYPE));else{const{defaultForm:G}=Um(r),V=TL(c,g,h).filter(Y=>Y.isCompatibleWithMediaType(S));G&&gA[G]?y($g(c,gA[G])):V.length===1&&y(V[0])}if(D.useEffect(()=>{y(null),_(a.getMediaType())},[e[0].index]),D.useEffect(()=>{const G=()=>{L({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}},[]),a.isInitCorrectly||a.isInitializedCorrectly(),!a.isInitCorrectly)return I.jsx(OL,{id:i,mediaType:S,windowId:u});const P=D.useCallback(()=>{t("annotationCreation",{id:i,position:"right"})},[t,i]),z=D.useRef(n);z.current=n;const B=G=>{const V=G,Y=V?.maeData?.templateType?$g(c,V.maeData.templateType,g):void 0,J=a.getCanvases().map(async k=>{let H;V?.maeData&&V.maeData.templateType?H=Y?await Y.convertToAnnotation(V,{canvas:k,playerReferences:a,windowId:u}):await HG(V,k,u,a):H=V;const q=r.annotation.adapter(k.id);return TG(k.id,q,s,H)});return Promise.all(J).then(()=>{P()})};return I.jsx(kt.ConnectedCompanionWindow,{title:n.id?c("edit_annotation"):c("new_annotation"),windowId:u,id:i,children:v===null?I.jsx(wL,{setCommentingType:y,mediaType:S}):I.jsxs(ce.Grid,{container:!0,direction:"column",spacing:1,children:[I.jsx(ce.Grid,{container:!0,children:I.jsx(AL,{setCommentingType:y,templateType:v,annotation:n})}),I.jsx(ce.Grid,{children:I.jsx(IL,{annotation:n,canvases:e,closeFormCompanionWindow:P,playerReferences:a,saveAnnotation:B,templateType:v,windowId:u})})]})})}DL.propTypes={annotation:C.oneOfType([C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string}),C.string]).isRequired,canvases:C.arrayOf(C.shape({id:C.string})).isRequired,closeCompanionWindow:C.func.isRequired,config:C.shape({annotation:C.shape({adapter:C.func,debug:C.bool,defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),enabledTemplateTypes:C.arrayOf(C.string),externalTemplates:C.arrayOf(C.object)}),language:C.string,translations:C.objectOf(C.object)}).isRequired,id:C.string.isRequired,playerReferences:C.object.isRequired,receiveAnnotation:C.func.isRequired,windowId:C.string.isRequired};class koe{actions;mediaType;canvases;windowId;overlay;isInitCorrectly;constructor(e,t,r,i){this.actions=i,this.media=r,this.mediaType=joe(e,t),this.canvases=kt.getVisibleCanvases(e,{windowId:t}),this.windowId=t,this.isInitCorrectly=!1,this.isInitializedCorrectly()&&(this.mediaType===Bi.IMAGE?this.overlay={canvasHeight:this.media.current.canvas.clientHeight,canvasWidth:this.media.current.canvas.clientWidth,containerHeight:this.media.current.canvas.clientHeight,containerWidth:this.media.current.canvas.clientWidth}:console.error("Unknown media type"))}sleep(e){return new Promise(t=>{setTimeout(t,e)})}isInitializedCorrectly(){return this.isInitCorrectly=this.media&&(this.mediaType===Bi.IMAGE&&this.media.current&&this.media.current.canvas||this.mediaType===Bi.VIDEO&&this.media.video)&&this.mediaType!==Bi.UNKNOWN&&this.mediaType!==Bi.AUDIO,this.isInitCorrectly}getMediaType(){return this.mediaType}getCanvases(){return this.canvases}getAudioElement(){return this.mediaType===Bi.AUDIO?document.querySelector("audio"):(console.error("Something is wrong with audio ressource"),null)}getWindowId(){return this.windowId}getCanvasHeight(){return this.overlay.canvasHeight}getCanvasWidth(){return this.overlay.canvasWidth}getContainer(){return this.mediaType===Bi.IMAGE?this.media.current.container:null}getContainerHeight(){return this.overlay.containerHeight}getContainerWidth(){return this.overlay.containerWidth}getDisplayedMediaHeight(){if(this.mediaType===Bi.IMAGE){const e=this.media.current;if(e){const t=this.getMediaTrueHeight()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getDisplayedMediaWidth(){if(this.mediaType===Bi.IMAGE){const e=this.media.current;if(e&&e.world.getItemCount()>0){const t=this.getMediaTrueWidth()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getMediaTrueHeight(){if(this.mediaType===Bi.IMAGE)return this.canvases[0].__jsonld.height;console.error("Unknown media type")}getMediaTrueWidth(){if(this.mediaType===Bi.IMAGE)return this.canvases[0].__jsonld.width}getScale(){return this.isInitializedCorrectly()?this.getDisplayedMediaWidth()/this.getMediaTrueWidth():null}getZoom(){if(this.mediaType===Bi.IMAGE){const e=this.media.current.viewport.getZoom(),t=this.media.current.viewport.getMaxZoom();let r=e/t;return r=Math.round(r*100)/100,r}}getImagePosition(){if(this.mediaType===Bi.IMAGE){const e=this.media.current;if(e){const r=e.world.getItemAt(0).getBounds(),i=e.viewport.viewportToViewerElementCoordinates(r.getTopLeft());return{x:Math.round(i.x),y:Math.round(i.y)}}}}getTargetStrokeWidth(){return Math.max(this.getDisplayedMediaWidth()/500,3)}}function joe(n,e){const t=kt.getVisibleCanvasAudioResources(n,{windowId:e})||[];return(kt.getVisibleCanvasVideoResources(n,{windowId:e})||[]).length>0?Bi.VIDEO:t.length>0?Bi.AUDIO:Bi.IMAGE}const Foe=(n,{id:e,windowId:t})=>({closeCompanionWindow:()=>n(kt.removeCompanionWindow(t,e)),receiveAnnotation:(r,i,a)=>n(kt.receiveAnnotation(r,i,a))});function Boe(n,{id:e,windowId:t}){const i=kt.getCompanionWindow(n,{companionWindowId:e,windowId:t}),{annotationid:a}=i,s=kt.OSDReferences.get(t),u=new koe(n,t,s,AF),c=kt.getVisibleCanvases(n,{windowId:t});let h=kt.getPresentAnnotationsOnSelectedCanvases(n,{windowId:t}).flatMap(g=>g.json.items||[]).find(g=>g.id===a);return h||(h={id:null,maeData:{templateType:null}}),{annotation:h,canvases:c,config:{...n.config,translations:f5},currentTime:null,playerReferences:u}}const NL={companionWindowKey:"annotationCreation",component:DL,mapDispatchToProps:Foe,mapStateToProps:Boe};function ML({PluginComponents:n=[],TargetComponent:e,targetProps:t}){return t.hasAnyAnnotations=!0,I.jsx(e,{...t,PluginComponents:n})}ML.propTypes={PluginComponents:C.array.isRequired,TargetComponent:C.oneOfType([C.func,C.node]).isRequired,targetProps:C.object.isRequired};const LL={component:ML,mode:"wrap",target:"WindowSideBarButtons"};var PL=function(e){return"@@redux-saga/"+e},Goe=PL("IO"),Hoe=PL("MULTICAST"),zoe=function(e){return e==null},qoe=function(e){return e!==void 0},Pd=function(e){return typeof e=="function"},kL=function(e){return typeof e=="string"},jL=Array.isArray,l5=function(e){return e&&(kL(e)||Voe(e)||Pd(e)||jL(e)&&e.every(l5))},K4=function(e){return e&&Pd(e.take)&&Pd(e.close)},Uoe=function(e){return Pd(e)&&e.hasOwnProperty("toString")},Voe=function(e){return!!e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype},Woe=function(e){return K4(e)&&e[Hoe]},Xoe=function(e){return e},Yoe=function(e){throw e},Zoe=function(e){return{value:e,done:!0}};function Joe(n,e,t){e===void 0&&(e=Yoe),t===void 0&&(t="iterator");var r={meta:{name:t},next:n,throw:e,return:Zoe,isSagaIterator:!0};return typeof Symbol<"u"&&(r[Symbol.iterator]=function(){return r}),r}var o_="TAKE",Koe="PUT",$oe="ALL",Qoe="CALL",ele="FORK",tle="SELECT",Rc=function(e,t){var r;return r={},r[Goe]=!0,r.combinator=!1,r.type=e,r.payload=t,r};function nle(n,e){if(n===void 0&&(n="*"),l5(n))return Rc(o_,{pattern:n});if(Woe(n)&&qoe(e)&&l5(e))return Rc(o_,{channel:n,pattern:e});if(K4(n))return Rc(o_,{channel:n})}function rle(n,e){return zoe(e)&&(e=n,n=void 0),Rc(Koe,{channel:n,action:e})}function ile(n){var e=Rc($oe,n);return e.combinator=!0,e}function FL(n,e){var t=null,r;return Pd(n)?r=n:(jL(n)?(t=n[0],r=n[1]):(t=n.context,r=n.fn),t&&kL(r)&&Pd(t[r])&&(r=t[r])),{context:t,fn:r,args:e}}function BL(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(Qoe,FL(n,t))}function GL(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(ele,FL(n,t))}function ale(n){n===void 0&&(n=Xoe);for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(tle,{selector:n,args:t})}var A7=function(e){return{done:!0,value:e}},l_={};function sle(n){return K4(n)?"channel":Uoe(n)?String(n):Pd(n)?n.name:String(n)}function ole(n,e,t){var r,i,a,s=e;function u(c,h){if(s===l_)return A7(c);if(h&&!i)throw s=l_,h;r&&r(c);var g=h?n[i](h):n[s]();return s=g.nextState,a=g.effect,r=g.stateUpdater,i=g.errorState,s===l_?A7(c):a}return Joe(u,function(c){return u(null,c)},t)}function lle(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var a={done:!1,value:nle(n)},s=function(g){return{done:!1,value:GL.apply(void 0,[e].concat(r,[g]))}},u,c=function(g){return u=g};return ole({q1:function(){return{nextState:"q2",effect:a,stateUpdater:c}},q2:function(){return{nextState:"q1",effect:s(u)}}},"q1","takeEvery("+sle(n)+", "+e.name+")")}function ule(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];return GL.apply(void 0,[lle,n,e].concat(r))}function*cle(n){const e=yield ale(kt.getConfig);if(e&&e.annotation.adapter){const t=e.annotation.adapter(n),r=yield BL([t,t.all]);r&&(yield rle(kt.receiveAnnotation(n,t.annotationPageId,r)))}}function*dle(n){const{canvasId:e}=n;yield BL(cle,e)}function*fle(){yield ile([ule(kt.ActionTypes.SET_CANVAS,dle)])}const hle={saga:fle},ple=(n,e)=>{console.error(`AiinotateAdapter.${n} error: `,e)},gle=async n=>{if(!n.ok)throw new Error(`Fetch error: response ${n.status} on url: ${n.url}`)};class mle{constructor(e,t,r,i){if(![2,3].includes(t))throw new Error(`AiiinotateAdapter: unrecognized value for 'iiifPresentationVersion'. expected one of [2,3], got '${t}'`);this.user=i||V1,this.canvasId=r,this.iiifPresentationVersion=t,this.endpointUrl=e,this.endpointUrlAnnotations=`${this.endpointUrl}/annotations/${t}`,this.endpointUrlManifests=`${this.endpointUrl}/manifests/${t}`}getStorageAdapterUser(){return this.user}get annotationPageId(){return`${this.endpointUrlAnnotations}/search?canvasUri=${this.canvasId}`}maybeConvert(e){return this.iiifPresentationVersion===2?zG(e):e}handleResponse=async(e,t)=>(await gle(t),this.all());handleError=(e,t)=>(ple(e,t),this.all());async create(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/create`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("create",t)).catch(t=>this.handleError("create",t))}async update(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/update`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("update",t)).catch(t=>this.handleError("update",t))}async delete(e){return fetch(`${this.endpointUrlAnnotations}/delete?uri=${e}`,{method:"DELETE"}).then(async t=>await this.handleResponse("delete",t)).catch(t=>this.handleError("delete",t))}async get(e){return await fetch(e)}async all(){let e=[],t=this.annotationPageId,r,i;for(;t&&t.length;)r=await fetch(this.annotationPageId),i=await r.json(),e=[...e,...i.resources],t=i.next;const a=await this.iiifPresentationVersion===2?UG(e,this.annotationPageId):e;return a.items=a.items.map(vO),a}}const vle={AiiinotateAdapter:mle,LocalStorageAdapter:j7},yle=[B7,H7,fO,NL,LL,hle];exports.annotationAdapters=vle;exports.annotationCreationCompanionWindowPlugin=NL;exports.canvasAnnotationsPlugin=fO;exports.convertIIIFAnnoToMaeData=vO;exports.default=yle;exports.externalStorageAnnotationPlugin=H7;exports.miradorAnnotationPlugin=B7;exports.templateKit=Fc;exports.windowSideBarButtonsPlugin=LL;
266
266
  //# sourceMappingURL=mirador-annotation-editor.cjs.js.map