diff --git a/SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED.js b/SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED.js new file mode 100644 index 0000000..617131d --- /dev/null +++ b/SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED.js @@ -0,0 +1,143 @@ +(self.webpackChunkCCDStock=self.webpackChunkCCDStock||[]).push([[27],{52027:(e,a,r)=>{"use strict";r.r(a),r.d(a,{VisualSearchEnabledItem:()=>Ta,VisualSearchModal:()=>Oa,VisualSearchModalWithSearchEnabled:()=>Va});var t=r(23469),i=r.n(t),o=r(28216),s=r(83389),n=r(87462),l=r(59361),u="function"==typeof Symbol&&Symbol.for,d=u?Symbol.for("react.element"):60103,c=u?Symbol.for("react.portal"):60106,p=u?Symbol.for("react.fragment"):60107,h=u?Symbol.for("react.strict_mode"):60108,g=u?Symbol.for("react.profiler"):60114,v=u?Symbol.for("react.provider"):60109,f=u?Symbol.for("react.context"):60110,m=u?Symbol.for("react.async_mode"):60111,b=u?Symbol.for("react.concurrent_mode"):60111,y=u?Symbol.for("react.forward_ref"):60112,k=u?Symbol.for("react.suspense"):60113,z=u?Symbol.for("react.suspense_list"):60120,T=u?Symbol.for("react.memo"):60115,w=u?Symbol.for("react.lazy"):60116,E=u?Symbol.for("react.block"):60121,S=u?Symbol.for("react.fundamental"):60117,M=u?Symbol.for("react.responder"):60118,L=u?Symbol.for("react.scope"):60119;function F(e){if("object"==typeof e&&null!==e){var a=e.$$typeof;switch(a){case d:switch(e=e.type){case m:case b:case p:case g:case h:case k:return e;default:switch(e=e&&e.$$typeof){case f:case y:case w:case T:case v:return e;default:return a}}case c:return a}}}function j(e){return F(e)===b}var x={AsyncMode:m,ConcurrentMode:b,ContextConsumer:f,ContextProvider:v,Element:d,ForwardRef:y,Fragment:p,Lazy:w,Memo:T,Portal:c,Profiler:g,StrictMode:h,Suspense:k,isAsyncMode:function(e){return j(e)||F(e)===m},isConcurrentMode:j,isContextConsumer:function(e){return F(e)===f},isContextProvider:function(e){return F(e)===v},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===d},isForwardRef:function(e){return F(e)===y},isFragment:function(e){return F(e)===p},isLazy:function(e){return F(e)===w},isMemo:function(e){return F(e)===T},isPortal:function(e){return F(e)===c},isProfiler:function(e){return F(e)===g},isStrictMode:function(e){return F(e)===h},isSuspense:function(e){return F(e)===k},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===p||e===b||e===g||e===h||e===k||e===z||"object"==typeof e&&null!==e&&(e.$$typeof===w||e.$$typeof===T||e.$$typeof===v||e.$$typeof===f||e.$$typeof===y||e.$$typeof===S||e.$$typeof===M||e.$$typeof===L||e.$$typeof===E)},typeOf:F};(0,l.i4)((function(e,a){})),(0,l.i4)((function(e){e.exports=x})),Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var a={},r=0;r<10;r++)a["_"+String.fromCharCode(r)]=r;var t=Object.getOwnPropertyNames(a).map((function(e){return a[e]}));if("0123456789"!==t.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}})()&&Object.assign;function C(){}function D(){}Function.call.bind(Object.prototype.hasOwnProperty),D.resetWarningCache=C;var Z=(0,l.i4)((function(e){e.exports=function(){function e(e,a,r,t,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function a(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:a,element:e,elementType:e,instanceOf:a,node:e,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:D,resetWarningCache:C};return r.PropTypes=r,r}()})),B=r(89320),P=r(55590),R=r(55652),A=r(61298),N=r.n(A),O=r(81356),I=r(95745),q=r(16630),_=r(24910),V=r(45968),U=r(17209),$=r(77249),H=r.n($);function W(e){var a,r,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e))for(a=0;a{};Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);let K=new Map;function Y(e,a){if(e===a)return e;let r=K.get(e);if(r)return r(a),a;let t=K.get(a);return t?(t(e),e):a}function X(...e){return(...a)=>{for(let r of e)"function"==typeof r&&r(...a)}}new Set(["id"]),new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),new Set(["href","target","rel","download","ping","referrerPolicy"]);function Q(e){var a;return"undefined"!=typeof window&&null!=window.navigator&&((null===(a=window.navigator.userAgentData)||void 0===a?void 0:a.brands.some((a=>e.test(a.brand))))||e.test(window.navigator.userAgent))}function ee(e){var a;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(a=window.navigator.userAgentData)||void 0===a?void 0:a.platform)||window.navigator.platform)}function ae(){return ee(/^Mac/i)}let re=new Map,te=new Set;function ie(){if("undefined"==typeof window)return;let e=a=>{let r=re.get(a.target);if(r&&(r.delete(a.propertyName),0===r.size&&(a.target.removeEventListener("transitioncancel",e),re.delete(a.target)),0===re.size)){for(let e of te)e();te.clear()}};document.body.addEventListener("transitionrun",(a=>{let r=re.get(a.target);r||(r=new Set,re.set(a.target,r),a.target.addEventListener("transitioncancel",e)),r.add(a.propertyName)})),document.body.addEventListener("transitionend",e)}"undefined"!=typeof document&&("loading"!==document.readyState?ie():document.addEventListener("DOMContentLoaded",ie)),"undefined"!=typeof document&&window.visualViewport,new Map,new WeakMap;t.createContext({register:()=>{}}).displayName="PressResponderContext",Symbol("linkClicked"),new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);class oe{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,a){this.nativeEvent=a,this.target=a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget,this.bubbles=a.bubbles,this.cancelable=a.cancelable,this.defaultPrevented=a.defaultPrevented,this.eventPhase=a.eventPhase,this.isTrusted=a.isTrusted,this.timeStamp=a.timeStamp,this.type=e}}function se(e){let a=(0,t.useRef)({isFocused:!1,observer:null});G((()=>{const e=a.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}}),[]);let r=function(e){const a=(0,t.useRef)(null);return G((()=>{a.current=e}),[e]),(0,t.useCallback)(((...e)=>(0,a.current)(...e)),[])}((a=>{null==e||e(a)}));return(0,t.useCallback)((e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){a.current.isFocused=!0;let t=e.target,i=e=>{a.current.isFocused=!1,t.disabled&&r(new oe("blur",e)),a.current.observer&&(a.current.observer.disconnect(),a.current.observer=null)};t.addEventListener("focusout",i,{once:!0}),a.current.observer=new MutationObserver((()=>{if(a.current.isFocused&&t.disabled){var e;null===(e=a.current.observer)||void 0===e||e.disconnect();let r=t===document.activeElement?null:document.activeElement;t.dispatchEvent(new FocusEvent("blur",{relatedTarget:r})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:r}))}})),a.current.observer.observe(t,{attributes:!0,attributeFilter:["disabled"]})}}),[r])}let ne=null,le=new Set,ue=!1,de=!1,ce=!1;const pe={Tab:!0,Escape:!0};function he(e,a){for(let r of le)r(e,a)}function ge(e){de=!0,function(e){return!(e.metaKey||!ae()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(ne="keyboard",he("keyboard",e))}function ve(e){ne="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(de=!0,he("pointer",e))}function fe(e){var a;(0===(a=e).mozInputSource&&a.isTrusted||(Q(/Android/i)&&a.pointerType?"click"===a.type&&1===a.buttons:0===a.detail&&!a.pointerType))&&(de=!0,ne="virtual")}function me(e){e.target!==window&&e.target!==document&&(de||ce||(ne="virtual",he("virtual",e)),de=!1,ce=!1)}function be(){de=!1,ce=!0}function ye(){if("undefined"==typeof window||ue)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){de=!0,e.apply(this,arguments)},document.addEventListener("keydown",ge,!0),document.addEventListener("keyup",ge,!0),document.addEventListener("click",fe,!0),window.addEventListener("focus",me,!0),window.addEventListener("blur",be,!1),"undefined"!=typeof PointerEvent?(document.addEventListener("pointerdown",ve,!0),document.addEventListener("pointermove",ve,!0),document.addEventListener("pointerup",ve,!0)):(document.addEventListener("mousedown",ve,!0),document.addEventListener("mousemove",ve,!0),document.addEventListener("mouseup",ve,!0)),ue=!0}function ke(){return"pointer"!==ne}"undefined"!=typeof document&&("loading"!==document.readyState?ye():document.addEventListener("DOMContentLoaded",ye));const ze=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);const Te=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"];function we(e,a){return!!e&&!!a&&a.some((a=>a.contains(e)))}Te.join(":not([hidden]),"),Te.push('[tabindex]:not([tabindex="-1"]):not([disabled])'),Te.join(':not([hidden]):not([tabindex="-1"]),');class Ee{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,a,r){let t=this.fastMap.get(null!=a?a:null);if(!t)return;let i=new Se({scopeRef:e});t.addChild(i),i.parent=t,this.fastMap.set(e,i),r&&(i.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let a=this.fastMap.get(e);if(!a)return;let r=a.parent;for(let e of this.traverse())e!==a&&a.nodeToRestore&&e.nodeToRestore&&a.scopeRef&&a.scopeRef.current&&we(e.nodeToRestore,a.scopeRef.current)&&(e.nodeToRestore=a.nodeToRestore);let t=a.children;r&&(r.removeChild(a),t.size>0&&t.forEach((e=>r&&r.addChild(e)))),this.fastMap.delete(a.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let a of e.children)yield*this.traverse(a)}clone(){var e;let a=new Ee;var r;for(let t of this.traverse())a.addTreeNode(t.scopeRef,null!==(r=null===(e=t.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==r?r:null,t.nodeToRestore);return a}constructor(){this.fastMap=new Map,this.root=new Se({scopeRef:null}),this.fastMap.set(null,this.root)}}class Se{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}function Me(e={}){let{autoFocus:a=!1,isTextInput:r,within:i}=e,o=(0,t.useRef)({isFocused:!1,isFocusVisible:a||ke()}),[s,n]=(0,t.useState)(!1),[l,u]=(0,t.useState)((()=>o.current.isFocused&&o.current.isFocusVisible)),d=(0,t.useCallback)((()=>u(o.current.isFocused&&o.current.isFocusVisible)),[]),c=(0,t.useCallback)((e=>{o.current.isFocused=e,n(e),d()}),[d]);var p,h,g;p=e=>{o.current.isFocusVisible=e,d()},h=[],g={isTextInput:r},ye(),(0,t.useEffect)((()=>{let e=(e,a)=>{(function(e,a,r){var t;return!((e=e||(null==r?void 0:r.target)instanceof HTMLInputElement&&!ze.has(null==r||null===(t=r.target)||void 0===t?void 0:t.type)||(null==r?void 0:r.target)instanceof HTMLTextAreaElement||(null==r?void 0:r.target)instanceof HTMLElement&&(null==r?void 0:r.target.isContentEditable))&&"keyboard"===a&&r instanceof KeyboardEvent&&!pe[r.key])})(!!(null==g?void 0:g.isTextInput),e,a)&&p(ke())};return le.add(e),()=>{le.delete(e)}}),h);let{focusProps:v}=function(e){let{isDisabled:a,onFocus:r,onBlur:i,onFocusChange:o}=e;const s=(0,t.useCallback)((e=>{if(e.target===e.currentTarget)return i&&i(e),o&&o(!1),!0}),[i,o]),n=se(s),l=(0,t.useCallback)((e=>{e.target===e.currentTarget&&document.activeElement===e.target&&(r&&r(e),o&&o(!0),n(e))}),[o,r,n]);return{focusProps:{onFocus:!a&&(r||o||i)?l:void 0,onBlur:a||!i&&!o?void 0:s}}}({isDisabled:i,onFocusChange:c}),{focusWithinProps:f}=function(e){let{isDisabled:a,onBlurWithin:r,onFocusWithin:i,onFocusWithinChange:o}=e,s=(0,t.useRef)({isFocusWithin:!1}),n=(0,t.useCallback)((e=>{s.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(s.current.isFocusWithin=!1,r&&r(e),o&&o(!1))}),[r,o,s]),l=se(n),u=(0,t.useCallback)((e=>{s.current.isFocusWithin||document.activeElement!==e.target||(i&&i(e),o&&o(!0),s.current.isFocusWithin=!0,l(e))}),[i,o,l]);return a?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:n}}}({isDisabled:!i,onFocusWithinChange:c});return{isFocused:s,isFocusVisible:l,focusProps:i?f:v}}function Le(e){let{children:a,focusClass:r,focusRingClass:i}=e,{isFocused:o,isFocusVisible:s,focusProps:n}=Me(e),l=t.Children.only(a);return t.cloneElement(l,function(...e){let a={...e[0]};for(let r=1;r=65&&e.charCodeAt(2)<=90?a[e]=X(r,i):"className"!==e&&"UNSAFE_className"!==e||"string"!=typeof r||"string"!=typeof i?"id"===e&&r&&i?a.id=Y(r,i):a[e]=void 0!==i?i:r:a[e]=J(r,i)}}return a}(l.props,{...n,className:J({[r||""]:o,[i||""]:s})}))}new Ee;var Fe=r(87228),je=r(17861),xe=r(93256);const Ce=_.iv` + outline: thin dotted; + outline: -webkit-focus-ring-color auto 1px; +`;_.iv` + /* todo: STK-59540 - Dotted line is added for Firefox for now until we figure out why + keyboard navigation is not working in Firefox */ + /* Keyboard focus style for browsers that do not support :focus-visible (Safari and Firefox) */ + &:focus { + ${Ce}; + } + + /* Keyboard focus style for browsers that do support :focus-visible (Chrome) */ + &:focus-visible { + ${Ce}; + } + + /* Hide focus styles via mouse click for certain browsers */ + &:not(:focus-visible) { + outline: none; + } +`;var De=r(33624),Ze=r(6205),Be=r(79828),Pe=r(46824);const Re="error",Ae="info",Ne="success",Oe="warning";var Ie=r(92652),qe=r(54214);const _e={[Re]:V.LL,[Ae]:V.HM},Ve=_.F4` + from { + bottom: -100%; + } + + to { + bottom: 0px; + } +`,Ue=_.ZP.div` + margin-bottom: 15px; + display: flex; + justify-content: center; + text-align: center; + + &.sticky { + display: table; + left: 50%; + position: fixed; + transform: translateX(-50%); + width: fit-content; + z-index: ${({zIndex:e})=>e}; + + &.bottom { + bottom: 0; + + &.animated { + animation: ${Ve} ${qe.H} ${qe.pK}; + } + } + + &.top { + top: 122px; + } + } + + span { + font-size: 15px; + } +`,$e=(0,_.ZP)(Ie.Z)` + &&& { + flex: 1; + font-weight: ${xe.DC}; + background-color: ${({alertType:e})=>_e[e]||""}; + } +`,He=_.ZP.span` + display: block; + float: left; + margin-right: 12px; +`;Ue.defaultProps={alertType:null},Ue.propTypes={alertType:q.i.oneOf([Re,Ae,Ne,Oe])};const We="alert_closed",Je={[Re]:Ze.Z,[Ae]:Be.Z};function Ge({variant:e,alertBody:a,position:r,actionLabel:o,onAction:s,closable:n,onClose:l,stickyBelowClassName:u,offsetTop:d,iconType:c,dismissForSession:p,alertName:h,zIndex:g,dataT:v}){const f=(0,t.useRef)(),m=Pe._t.get("session"),b=`${h}:${We}`,y=Je[c];return function({stickyBelowClassName:e,ref:a,offsetTop:r,forceStickyBelowWindowTop:i=!1}){const o=(0,t.useRef)(document.getElementsByClassName(e)[0]);(0,t.useEffect)((()=>{function t(){a.current&&window.requestAnimationFrame((()=>{var e;const{top:t=0,height:s=0}=(null===(e=o.current)||void 0===e?void 0:e.getBoundingClientRect())||{};let n=t+s+r;i&&t+s<0&&(n=r),a.current.offsetTop!==n&&(a.current.style.top=`${n}px`)}))}if(e)return window.addEventListener("touchmove",t),window.addEventListener("scroll",t),t(),()=>{window.removeEventListener("touchmove",t),window.removeEventListener("scroll",t)}}),[a.current])}({stickyBelowClassName:u,ref:f,offsetTop:d}),p&&m.get(b)?null:i().createElement(Ue,{className:r,ref:f,zIndex:g,"data-t":v},i().createElement($e,{alertType:e,actionLabel:o,onAction:s,closable:n,onClose:e=>{p&&!m.get(b)&&m.set(b,!0),l(e)}},y&&i().createElement(He,null,i().createElement(y,{size:"S","data-t":`${v}-icon`})),i().createElement("span",{"data-t":`${v}-body`},a)))}Ge.defaultProps={variant:null,alertBody:null,actionLabel:"",onAction:null,closable:!1,onClose:null,position:"",stickyBelowClassName:"",offsetTop:0,iconType:Re,dismissForSession:!1,alertName:"",zIndex:"auto",dataT:"alert"},Ge.propTypes={variant:q.i.oneOf([Re,Ae,Oe,Ne]),alertBody:q.i.node,actionLabel:q.i.string,onAction:q.i.func,closable:q.i.bool,onClose:q.i.func,position:q.i.string,stickyBelowClassName:q.i.string,offsetTop:q.i.number,iconType:q.i.oneOf([Re,Ae,Oe,Ne]),dismissForSession:q.i.bool,alertName:q.i.string,zIndex:q.i.oneOfType([q.i.number,q.i.string]),dataT:q.i.string};const Ke=_.ZP.input.attrs((e=>({type:"file",accept:e.acceptedFileTypes})))` + display: none; +`,Ye=_.ZP.button` + border: none; + background-color: transparent; + color: ${V.HM}; + cursor: pointer; + font-family: inherit; + font-size: inherit; + padding: 0; + position: relative; + + &.focus-ring { + ${Ce}; + } +`,Xe=_.ZP.p` + font-size: ${xe.PS}px; + font-weight: ${xe.vS}; + line-height: 1.5; + margin: 0; + color: ${V.W5}; +`,Qe=_.ZP.div` + text-align: center; + margin-top: 20px; +`,ea=_.ZP.div` + background-color: ${({bgColor:e})=>e}; + padding: ${({isLargeLoadingModal:e})=>e?`${je.ay}px ${je.s6}px`:`${je.s6}px`}; + + @media (max-width: 768px) { + padding: 72px 10px; + } +`,aa=_.ZP.div` + background-color: ${({bgColor:e})=>e}; + border-radius: 4px; + + @media (max-width: 768px) { + .upload_modal_dropzone { + padding-left: 10px; + padding-right: 10px; + } + } +`;function ra({color:e}){const{329489273093:{value:a=!1}={}}=(0,De.g)();return i().createElement(t.Fragment,null,a?i().createElement("svg",{height:"125",viewBox:"0 0 60 60",width:"160",className:"spectrum-IllustratedMessage-illustration",style:{fill:e,stroke:"none"}},i().createElement("path",{d:"M26,13.84109a.997.997,0,0,0,.731-.31738L29,11.09207V21.77273a1,1,0,0,0,2,0V11.09109l2.26905,2.43164A1.00013,1.00013,0,1,0,34.731,12.1575L31.187,8.35964a1.53647,1.53647,0,0,0-.723-.42382.89982.89982,0,0,0-.92817,0,1.53455,1.53455,0,0,0-.72046.42187l-3.54638,3.80078A1,1,0,0,0,26,13.84109Z"}),i().createElement("path",{d:"M42.67579,27.34109a.75.75,0,0,0-1.01661.30176L37.95752,34.472a.74984.74984,0,1,0,1.31836.71484l3.70166-6.8291A.74927.74927,0,0,0,42.67579,27.34109Z"}),i().createElement("path",{d:"M40.07374,28.08621a.74911.74911,0,0,0-1.01661.30175l-1.82519,3.36817a.74984.74984,0,1,0,1.31836.71484l1.82519-3.36816A.74927.74927,0,0,0,40.07374,28.08621Z"}),i().createElement("path",{d:"M34.5337,27.98757a.99837.99837,0,0,0,1.354-.4082l5.3457-9.96875a1.44885,1.44885,0,0,1,.86621-.71,1.41516,1.41516,0,0,1,1.09375.11719L53.68067,22.762a1.72765,1.72765,0,0,1,.8208,1.02734l1.43457,4.915a1.73534,1.73534,0,0,1-.13672,1.31543l-8.0708,15.05176a1.44973,1.44973,0,0,1-.8667.71,1.41373,1.41373,0,0,1-1.09326-.11719l-7.68848-4.21094a.99995.99995,0,0,0-.96093,1.75391l7.68847,4.21094a3.40935,3.40935,0,0,0,1.64307.42383,3.45329,3.45329,0,0,0,3.04053-1.8252L57.562,30.96511a3.72525,3.72525,0,0,0,.29394-2.82129l-1.43457-4.915a3.74455,3.74455,0,0,0-1.78027-2.22071L44.15381,15.26394a3.4365,3.4365,0,0,0-4.6831,1.40137L34.125,26.63406A.99976.99976,0,0,0,34.5337,27.98757Z"}),i().createElement("path",{d:"M45.84473,29.60379a.74872.74872,0,0,0-1.0166.30175L41.647,35.77468a.74985.74985,0,1,0,1.31836.71485l3.18115-5.86914A.74927.74927,0,0,0,45.84473,29.60379Z"}),i().createElement("path",{d:"M43.48584,29.91433a.75116.75116,0,0,0-1.01709.30078L40.645,33.56863a.74989.74989,0,1,0,1.31739.7168l1.82373-3.35352A.75016.75016,0,0,0,43.48584,29.91433Z"}),i().createElement("path",{d:"M48.15479,29.42605a.75116.75116,0,0,0-1.01709.30078l-4.249,7.8125a.74988.74988,0,1,0,1.31738.7168l4.249-7.8125A.75015.75015,0,0,0,48.15479,29.42605Z"}),i().createElement("path",{d:"M48.335,33.11843a.749.749,0,0,0-1.01661.30176l-1.38818,2.56152a.74985.74985,0,1,0,1.31836.71485L48.63672,34.135A.74928.74928,0,0,0,48.335,33.11843Z"}),i().createElement("path",{d:"M47.24512,39.18386a.74941.74941,0,0,0,1.0166-.30175L51.0376,33.76a.74985.74985,0,1,0-1.31836-.71485l-2.77588,5.12207A.74927.74927,0,0,0,47.24512,39.18386Z"}),i().createElement("path",{d:"M24.21192,26.20632a2.75,2.75,0,0,0,1.57568,5.26954h.001a2.75018,2.75018,0,0,0-1.57666-5.26954Zm1.14648,3.832a1.25,1.25,0,1,1,.83887-1.55469A1.25654,1.25654,0,0,1,25.3584,30.03836Z"}),i().createElement("path",{d:"M6.1001,47.42312a1.98538,1.98538,0,0,0,2.48389,1.332l25.67725-7.73633a1.996,1.996,0,0,0,1.33544-2.48046L32.2959,27.38308a1.00021,1.00021,0,0,0-1.918.56836l3.11341,10.50073L26.12647,34.305a1.70911,1.70911,0,0,0-2.3457.71484l-1.63428,3.36133a.72525.72525,0,0,0-.04791.18506l-6.872-3.2749a1.55294,1.55294,0,0,0-2.13916.63476L7.75306,45.9783,2.99073,30.21218l22.05908-6.52832a1.00007,1.00007,0,1,0-.56738-1.918L2.419,28.29519a1.9965,1.9965,0,0,0-1.334,2.48438Zm17.395-8.38574,1.62647-3.3457a.20191.20191,0,0,1,.11865-.09082.19789.19789,0,0,1,.15039.01074l6.93121,3.90332-5.04193,1.52051L23.38611,39.18A.7207.7207,0,0,0,23.49512,39.03738Zm-9.08252-2.4082.12451-.00684,10.6084,5.05688L9.17688,46.49563Z"})):i().createElement("svg",{height:"120",viewBox:"0 0 160 120",width:"160",className:"spectrum-IllustratedMessage-illustration",style:{fill:e,stroke:e}},i().createElement("path",{d:"M92.591,105.6a1.5,1.5,0,0,0-2.121,0L82,114.036V90.5a1.5,1.5,0,0,0-3,0v23.54L70.529,105.6a1.5,1.5,0,0,0-2.117,2.125L78.68,117.956a2.582,2.582,0,0,0,3.636,0l10.271-10.234A1.5,1.5,0,0,0,92.591,105.6Z"}),i().createElement("path",{d:"M120.509,31a1.5,1.5,0,0,1-1.492-1.5V26.373c0-.124-.112-.373-.25-.373H42.233c-.138,0-.25.249-.25.373V29.5A1.492,1.492,0,1,1,39,29.5V26.373a3.233,3.233,0,0,1,3.233-3.225h76.534A3.233,3.233,0,0,1,122,26.373V29.5A1.5,1.5,0,0,1,120.509,31Z"}),i().createElement("path",{d:"M111.522,22a1.49,1.49,0,0,1-1.478-1.5V18.237c0-.125-.562-.237-.7-.237H51.478c-.137,0-.522.112-.522.237V20.5A1.478,1.478,0,1,1,48,20.5V18.237a3.219,3.219,0,0,1,3.2-3.227H109.8a3.219,3.219,0,0,1,3.2,3.227V20.5A1.489,1.489,0,0,1,111.522,22Z"}),i().createElement("path",{d:"M110.48,61.311h-.018A9.207,9.207,0,1,1,110.48,42.9h.02a9.207,9.207,0,1,1-.02,18.414Zm-.014-2h.014a7.234,7.234,0,0,0,7.244-7.192,7.244,7.244,0,1,0-12.375,5.066,7.213,7.213,0,0,0,5.117,2.126Z"}),i().createElement("path",{d:"M127.749,32.081h-94.5A3.243,3.243,0,0,0,30,35.308V94.774A3.242,3.242,0,0,0,33.251,98H74.737a1.5,1.5,0,0,0,0-3H35.327L66.271,64.931a1.878,1.878,0,0,1,2.646.008L99.135,95H86.121a1.5,1.5,0,1,0,0,3h39.9a.91.91,0,0,0,1.158,0h.568A3.242,3.242,0,0,0,131,94.774V35.308A3.243,3.243,0,0,0,127.749,32.081ZM91.085,84.172,99.691,75.2a2.629,2.629,0,0,1,3.566.006L122.989,95H101.97ZM128,94.774a.24.24,0,0,1-.251.226h-1.936l-21.14-21.211a4.6,4.6,0,0,0-6.408,0l-8.6,8.968L70.329,63.523A3.879,3.879,0,0,0,64.87,63.5L33,94.474V35.308c0-.125.113-.308.251-.308h94.5c.138,0,.251.183.251.308Z"})))}function ta({onFileSelected:e,error:a,isLoading:r,isLargeLoadingModal:o,errorMessage:s,dropZoneBackgroundColor:n,dropZoneSVGColor:l,dropZoneTitle:u,dropZoneSubtitleOrText:d,dropZoneSubtitleSelectText:c,dropZoneSubtitleDragText:p,loadingTitle:h,dataTLoadingTitle:g,dataTLoadingWaitComponent:v,dataTDropZone:f,dataTDropZoneContainer:m,dataTSelectFile:b,lastFocusableElemRef:y,acceptedFileTypes:k,isUploadModalSelected:z}){function T(a,r){e(a,r)}const w=(0,t.useRef)(null),E=(0,t.useCallback)((()=>{w.current&&w.current.click()}),[w]),S=i().createElement(ra,{className:"spectrum-IllustratedMessage-illustration",color:l});return i().createElement(t.Fragment,null,a&&i().createElement(Ge,{alertBody:s}),r?i().createElement(ea,{bgColor:n,isLargeLoadingModal:o},i().createElement(Fe.default,{heading:h,"data-t":g}),i().createElement(Qe,null,i().createElement(H(),{"data-t":v}))):i().createElement(aa,{bgColor:n,"data-t":m},i().createElement(U.default,{onDrop:function(e){T(e.dataTransfer,!0)},"data-t":f},i().createElement(Fe.default,{illustration:S,heading:u,ariaLabel:3}),i().createElement(Xe,null,p),i().createElement(Xe,null,d,i().createElement(Le,{focusRingClass:"focus-ring"},i().createElement(Ye,{"data-t":b,onClick:E,ref:y,autoFocus:z}," ",c," ")),i().createElement(Ke,{acceptedFileTypes:k,onChange:function(e){T(e.currentTarget,!1)},ref:w})))))}ra.propTypes={color:q.i.string.isRequired},ta.propTypes={errorMessage:q.i.node.isRequired,error:q.i.bool,onFileSelected:q.i.func.isRequired,isLoading:q.i.bool,isLargeLoadingModal:q.i.bool,dropZoneSVGColor:q.i.string,dropZoneBackgroundColor:q.i.string,dropZoneTitle:q.i.node.isRequired,dropZoneSubtitleOrText:q.i.node.isRequired,dropZoneSubtitleSelectText:q.i.node.isRequired,dropZoneSubtitleDragText:q.i.node.isRequired,loadingTitle:q.i.node.isRequired,dataTLoadingTitle:q.i.string.isRequired,dataTLoadingWaitComponent:q.i.string.isRequired,dataTDropZone:q.i.string.isRequired,dataTDropZoneContainer:q.i.string.isRequired,dataTSelectFile:q.i.string.isRequired,acceptedFileTypes:q.i.string,isUploadModalSelected:q.i.bool,lastFocusableElemRef:q.i.shape({current:q.i.any})},ta.defaultProps={dropZoneBackgroundColor:"",dropZoneSVGColor:"",error:!1,isLoading:!1,isLargeLoadingModal:!1,lastFocusableElemRef:null,acceptedFileTypes:"image/png, image/jpeg, image/jpg",isUploadModalSelected:!1};const ia=_.ZP.button` + border: none; + background-color: transparent; + top: 45px; + right: 40px; + color: ${V.wD}; + padding: 0; + position: absolute; + cursor: pointer; +`,oa=_.ZP.div` + .upload-modal-maximum-z-index { + z-index: ${998}; + } +`,sa=_.ZP.div` + background: rgba(0, 0, 0, .5); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + overflow: hidden; + z-index: ${998}; +`,na=()=>i().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 10 10"},i().createElement("g",{id:"rPbFT7.tif_2_",transform:"translate(0.001)"}),i().createElement("g",{id:"j0eSts.tif_1_",transform:"translate(0 0)"},i().createElement("g",{id:"Group_1","data-name":"Group 1"},i().createElement("path",{id:"Path_1","data-name":"Path 1",d:"M1513.6,1807.365c-.354-.334-.7-.658-1.042-.991-.756-.744-1.5-1.487-2.248-2.24a.979.979,0,0,1,.449-1.7.963.963,0,0,1,.947.324c.822.81,1.635,1.63,2.448,2.44.268.267.516.534.784.82a1.186,1.186,0,0,0,.191-.162l2.955-2.945a2.714,2.714,0,0,1,.239-.229.952.952,0,0,1,1.339.01.939.939,0,0,1,.077,1.315c-.268.315-.574.6-.861.887l-2.353,2.345a2.375,2.375,0,0,0-.172.2c.354.333.7.657,1.033.991.755.743,1.5,1.487,2.248,2.24a.977.977,0,0,1-.335,1.668.954.954,0,0,1-1.062-.286c-.956-.953-1.922-1.906-2.879-2.859-.4-.4-.392-.4-.794,0-.966.963-1.922,1.925-2.888,2.878a.935.935,0,0,1-1.062.267.974.974,0,0,1-.325-1.639c.392-.4.784-.791,1.186-1.182.65-.648,1.3-1.287,1.941-1.935C1513.478,1807.518,1513.516,1807.461,1513.6,1807.365Z",transform:"translate(-1509.975 -1802.41)",fill:"#c5c6c6"}))));function la({closeModal:e,closeBtnLabel:a,onFileSelected:r,error:o,isLoading:s,errorMessage:n,renderBackground:l,modalTitle:u,dropZoneTitle:d,dropZoneSubtitleOrText:c,dropZoneSubtitleSelectText:p,dropZoneSubtitleDragText:h,loadingTitle:g,dataTCloseModalButton:v,dataTLoadingTitle:f,dataTLoadingWaitComponent:m,dataTDropZone:b,dataTDropZoneContainer:y,dataTDialogTitle:k,dataTBackground:z,dataTSelectFile:T,acceptedFileTypes:w}){const E=(0,t.useRef)(null),S=(0,t.useRef)(null),M=(0,t.useRef)(null);return(0,O.m)({dialogRef:E,handleClose:e}),function({firstFocusableElemRef:e,lastFocusableElemRef:a}){(0,t.useEffect)((()=>{const r=e&&e.current,t=a&&a.current,i=e=>{const{key:a,shiftKey:i,target:o}=e;if(a===I.nW){let a;i&&o===r&&(a=t),i||o!==t||(a=r),a&&a!==document.activeElement&&(e.preventDefault(),a.focus())}};if(r&&t)return setTimeout((()=>{r.focus()}),0),window.addEventListener(I.QB,i),()=>{window.removeEventListener(I.QB,i)}}),[e,a])}({firstFocusableElemRef:S,lastFocusableElemRef:M}),i().createElement(t.Fragment,null,l&&i().createElement(sa,{"data-t":z}),i().createElement(oa,{ref:E,tabIndex:0},i().createElement(N(),{title:u,"data-t":k,className:"upload-modal-maximum-z-index"},i().createElement(ta,{errorMessage:n,error:o,onFileSelected:r,isLoading:s,dropZoneTitle:d,dropZoneSubtitleOrText:c,dropZoneSubtitleSelectText:p,dropZoneSubtitleDragText:h,loadingTitle:g,dataTLoadingTitle:f,dataTLoadingWaitComponent:m,dataTDropZone:b,dataTDropZoneContainer:y,dataTSelectFile:T,lastFocusableElemRef:M,acceptedFileTypes:w,isUploadModalSelected:!0}),i().createElement(ia,{onClick:e,"data-t":v,id:"upload-modal-close-modal-button",ref:S,"aria-label":a},i().createElement(na,null)))))}la.propTypes={modalTitle:q.i.node.isRequired,errorMessage:q.i.node.isRequired,error:q.i.bool,onFileSelected:q.i.func.isRequired,closeModal:q.i.func.isRequired,closeBtnLabel:q.i.string.isRequired,isLoading:q.i.bool,renderBackground:q.i.bool,dropZoneTitle:q.i.node.isRequired,dropZoneSubtitleOrText:q.i.node.isRequired,dropZoneSubtitleSelectText:q.i.node.isRequired,dropZoneSubtitleDragText:q.i.node.isRequired,loadingTitle:q.i.node.isRequired,dataTCloseModalButton:q.i.string.isRequired,dataTLoadingTitle:q.i.string.isRequired,dataTLoadingWaitComponent:q.i.string.isRequired,dataTDropZone:q.i.string.isRequired,dataTDropZoneContainer:q.i.string.isRequired,dataTDialogTitle:q.i.string.isRequired,dataTBackground:q.i.string.isRequired,dataTSelectFile:q.i.string.isRequired,acceptedFileTypes:q.i.string.isRequired},la.defaultProps={error:!1,isLoading:!1,renderBackground:!1};const ua=la;var da=r(15558);const ca="image/png, image/jpeg, image/jpg";var pa=r(59273),ha=r(98820),ga=r(74887),va=r(45987),fa=r(16550),ma=r(97779),ba=r(13295),ya=r(94950),ka=r(84879),za=r(83348);r(18446),r(88227),r(34857),r(74682);const Ta=e=>{const a=(0,o.I0)();return r=>i().createElement("span",{"data-t":"visual-search-enabled-item-container",onDragStart:()=>(e=>{a((0,s.S$)({items:{[e.contentId]:{is_similarity_search_allowed:!0}}}))})(r)},e(r))},wa="visual.search.zone.heading",Ea="visual.search.closeBtn.label",Sa="visual.search.title",Ma="visual.search.title.find.similar",La="visual.search.drop.zone.title",Fa="visual.search.drop.zone.title.generic",ja="visual.search.drop.zone.sub.title",xa="visual.search.drop.zone.sub.title.or",Ca="visual.search.drop.zone.sub.title.select",Da="visual.search.loading.title",Za=(0,pa.defineMessages)({[wa]:{id:wa,defaultMessage:"Try out these features today"},[Ea]:{id:Ea,defaultMessage:"Close find similar"},[Sa]:{id:Sa,defaultMessage:"Search with an image"},[Ma]:{id:Ma,defaultMessage:"Find similar"},[Fa]:{id:Fa,defaultMessage:"Drag & drop an image or audio file"},[La]:{id:La,defaultMessage:"Drag and Drop Your File"},[ja]:{id:ja,defaultMessage:"Drag an image here"},[xa]:{id:xa,defaultMessage:"or"},[Ca]:{id:Ca,defaultMessage:"select a file"},[Da]:{id:Da,defaultMessage:"Uploading your file..."}}),Ba=_.ZP.div` + align-items: center; + background-color: ${V.To}; + display: flex; + flex-direction: column; + justify-content: center; + width: 100%; +`,Pa=_.ZP.div` + margin-bottom: 35px; + margin-top: 20px; + width: 515px; +`;function Ra({onFileSelected:e,error:a,intl:r,isLoading:t,errorMessage:o,dropZoneTitle:s,dropZoneSubtitleOrText:n,dropZoneSubtitleSelectText:l,dropZoneSubtitleDragText:u,loadingTitle:d,dataTLoadingTitle:c,dataTLoadingWaitComponent:p,dataTDropZone:h,dataTDropZoneContainer:g,dataTSelectFile:v,acceptedFileTypes:f}){const m=r.formatMessage(Za[wa]);return i().createElement(Ba,null,i().createElement(ga.X,{align:"center",dataT:"visual-search-zone-heading-title",size:"2",element:"h2"},m),i().createElement(Pa,null,i().createElement(ta,{onFileSelected:e,error:a,isLoading:t,isLargeLoadingModal:!0,errorMessage:o,dropZoneBackgroundColor:ha.S,dropZoneSVGColor:V.SW,dropZoneTitle:s,dropZoneSubtitleOrText:n,dropZoneSubtitleSelectText:l,dropZoneSubtitleDragText:u,loadingTitle:d,dataTLoadingTitle:c,dataTLoadingWaitComponent:p,dataTDropZone:h,dataTDropZoneContainer:g,dataTSelectFile:v,acceptedFileTypes:f})))}Ra.propTypes={onFileSelected:Z.func.isRequired,error:Z.bool,intl:Z.shape(B.Z).isRequired,isLoading:Z.bool.isRequired,errorMessage:Z.node.isRequired,dropZoneTitle:Z.node.isRequired,dropZoneSubtitleOrText:Z.node.isRequired,dropZoneSubtitleSelectText:Z.node.isRequired,dropZoneSubtitleDragText:Z.node.isRequired,loadingTitle:Z.node.isRequired,dataTLoadingTitle:Z.string.isRequired,dataTLoadingWaitComponent:Z.string.isRequired,dataTDropZone:Z.string.isRequired,dataTDropZoneContainer:Z.string.isRequired,dataTSelectFile:Z.string.isRequired,acceptedFileTypes:Z.string.isRequired},Ra.defaultProps={error:!1};var Aa=(0,pa.injectIntl)(Ra);function Na({isVisualSearchZone:e,showModal:a,isModalLoading:r,modalUploadError:o,modalUploadErrorMessage:s,isVsZoneLoading:l,vsZoneUploadError:u,vsZoneUploadErrorMessage:d,hideModal:c,initFileProcessing:p,intl:h}){const g=document.activeElement,v=(0,da.hW)(),{329489273093:f={value:!1}}=(0,De.g)(),m=f&&f.value&&!v,b=m?Fa:La,y={onFileSelected:a=>{p({isVisualSearchZone:e,dataTransfer:a})},modalTitle:m?h.formatMessage(Za[Ma]):h.formatMessage(Za[Sa]),dropZoneTitle:h.formatMessage(Za[b]),dropZoneSubtitleDragText:m?"":h.formatMessage(Za[ja]),dropZoneSubtitleOrText:h.formatMessage(Za[xa]),dropZoneSubtitleSelectText:h.formatMessage(Za[Ca]),loadingTitle:h.formatMessage(Za[Da])},k=m?`${ca}, audio/*`:ca;return i().createElement(t.Fragment,null,e?i().createElement(Aa,(0,n.Z)({},y,{error:u,errorMessage:d,dataTCloseModalButton:"visual-search-close-modal-button",dataTLoadingTitle:"visual-search-zone-loading-title",dataTLoadingWaitComponent:"visual-search-zone-wait-component",dataTDropZone:"visual-search-zone-drop",dataTDropZoneContainer:"visual-search-zone-container",dataTBackground:"visual-search-zone-overlay",dataTSelectFile:"visual-search-zone-select-file",isLoading:l,acceptedFileTypes:k})):a&&i().createElement(ua,(0,n.Z)({},y,{closeModal:()=>{g&&g.focus(),c()},error:o,errorMessage:s,renderBackground:!0,dataTCloseModalButton:"visual-search-close-modal-button",dataTLoadingTitle:"visual-search-loading-title",dataTLoadingWaitComponent:"visual-search-wait-component",dataTDropZone:"visual-search-drop-zone",dataTDropZoneContainer:"visual-search-drop-zone-container",dataTDialogTitle:"visual-search-dialog-title",dataTBackground:"visual-search-overlay",dataTSelectFile:"visual-search-select-file",isLoading:r,closeBtnLabel:h.formatMessage(Za[Ea]),acceptedFileTypes:k})))}Na.defaultProps={isVisualSearchZone:!1},Na.propTypes={isVisualSearchZone:Z.bool,showModal:Z.bool.isRequired,isModalLoading:Z.bool.isRequired,modalUploadError:Z.bool.isRequired,modalUploadErrorMessage:Z.oneOfType([Z.object,Z.string]).isRequired,isVsZoneLoading:Z.bool.isRequired,vsZoneUploadError:Z.bool.isRequired,vsZoneUploadErrorMessage:Z.string.isRequired,hideModal:Z.func.isRequired,initFileProcessing:Z.func.isRequired,intl:Z.shape(B.Z).isRequired};var Oa=(0,o.$j)((function(e){const{visualSearchModal:{showModal:a,isLoading:r,uploadError:t,uploadErrorMessage:i,pageData:o,visualSearchZone:{isLoading:s,uploadError:n,uploadErrorMessage:l}}}=e;return{showModal:a,isModalLoading:r,modalUploadError:t,modalUploadErrorMessage:i,pageData:o,isVsZoneLoading:s,vsZoneUploadError:n,vsZoneUploadErrorMessage:l}}),(function(e){return{hideModal:()=>{e((0,s.vv)())},initFileProcessing:({isVisualSearchZone:a,dataTransfer:r,pageSearchData:t,multiImageUpload:i,searchCallBack:o})=>{e((0,l.$E)({isVisualSearchZone:a,dataTransfer:r,pageSearchData:t,multiImageUpload:i,searchCallBack:o}))}}}))((0,P.Z)(Na,{"cs-CZ":{"visual.search.zone.heading":"Vyzkoušejte tyto funkce ještě dnes","visual.search.closeBtn.label":"Zavřít hledání podobných","visual.search.title":"Vyhledávání pomocí obrázku","visual.search.title.find.similar":"Hledat podobné","visual.search.drop.zone.title.generic":"Sem přetáhněte pokusný obrázek nebo zvukový soubor","visual.search.drop.zone.title":"Přetáhněte soubor","visual.search.drop.zone.sub.title":"Obrázek přetáhněte zde","visual.search.drop.zone.sub.title.or":"nebo","visual.search.drop.zone.sub.title.select":"vyberte některý soubor","visual.search.loading.title":"Nahrávání souboru..."},"da-DK":{"visual.search.zone.heading":"Prøv disse funktioner i dag","visual.search.closeBtn.label":"Luk find lignende","visual.search.title":"Søg med et billede","visual.search.title.find.similar":"Find lignende","visual.search.drop.zone.title.generic":"Træk og slip en billed- eller lydfil","visual.search.drop.zone.title":"Træk og slip filen","visual.search.drop.zone.sub.title":"Træk et billede her","visual.search.drop.zone.sub.title.or":"eller","visual.search.drop.zone.sub.title.select":"vælg en fil","visual.search.loading.title":"Din fil uploades..."},"de-DE":{"visual.search.zone.heading":"Probiere diese Funktionen heute noch aus","visual.search.closeBtn.label":"„Ähnliche suchen” schließen","visual.search.title":"Anhand eines Bilds suchen","visual.search.title.find.similar":"Ähnliche suchen","visual.search.drop.zone.title.generic":"Bild- oder Audiodatei hierher ziehen","visual.search.drop.zone.title":"Datei hierher ziehen","visual.search.drop.zone.sub.title":"Bild hierher ziehen","visual.search.drop.zone.sub.title.or":"oder","visual.search.drop.zone.sub.title.select":"Datei auswählen","visual.search.loading.title":"Datei wird hochgeladen…"},"en-US":{"visual.search.zone.heading":"Try out these features today","visual.search.closeBtn.label":"Close find similar","visual.search.title":"Search with an image","visual.search.title.find.similar":"Find similar","visual.search.drop.zone.title.generic":"Drag & drop an image or audio file","visual.search.drop.zone.title":"Drag and Drop Your File","visual.search.drop.zone.sub.title":"Drag an image here","visual.search.drop.zone.sub.title.or":"or","visual.search.drop.zone.sub.title.select":"select a file","visual.search.loading.title":"Uploading your file..."},"es-ES":{"visual.search.zone.heading":"Prueba ya estas funciones","visual.search.closeBtn.label":"Cerrar Buscar similares","visual.search.title":"Buscar con una imagen","visual.search.title.find.similar":"Buscar similares","visual.search.drop.zone.title.generic":"Arrastra y suelta un archivo de imagen o audio","visual.search.drop.zone.title":"Arrastra y suelta tu archivo","visual.search.drop.zone.sub.title":"Arrastra una imagen aquí","visual.search.drop.zone.sub.title.or":"o","visual.search.drop.zone.sub.title.select":"Selecciona un archivo","visual.search.loading.title":"Subiendo tu archivo..."},"fi-FI":{"visual.search.zone.heading":"Kokeile näitä ominaisuuksia jo tänään","visual.search.closeBtn.label":"Sulje Etsi samankaltaisia -ikkuna","visual.search.title":"Hae kuvan avulla","visual.search.title.find.similar":"Etsi samankaltaisia","visual.search.drop.zone.title.generic":"Vedä ja pudota kuva- tai äänitiedosto","visual.search.drop.zone.title":"Vedä ja pudota tiedosto","visual.search.drop.zone.sub.title":"Pudota kuva tähän","visual.search.drop.zone.sub.title.or":"tai","visual.search.drop.zone.sub.title.select":"valitse tiedosto","visual.search.loading.title":"Lähetetään tiedostoa..."},"fr-FR":{"visual.search.zone.heading":"Essayez ces fonctionnalités dès aujourd’hui","visual.search.closeBtn.label":"Fermer la recherche de fichiers similaires","visual.search.title":"Effectuez une recherche avec une image","visual.search.title.find.similar":"Éléments similaires","visual.search.drop.zone.title.generic":"Glisser-déposer une image ou un fichier audio","visual.search.drop.zone.title":"Glisser-déposer votre fichier","visual.search.drop.zone.sub.title":"Faire glisser une image ici","visual.search.drop.zone.sub.title.or":"ou","visual.search.drop.zone.sub.title.select":"sélectionner un fichier","visual.search.loading.title":"Chargement de votre fichier..."},"hu-HU":{"visual.search.zone.heading":"Próbálja ki ezeket a funkciókat még ma","visual.search.closeBtn.label":"Hasonló keresésének bezárása","visual.search.title":"Keresés képpel","visual.search.title.find.similar":"Hasonló keresése","visual.search.drop.zone.title.generic":"Húzzon ide képet vagy hangfájlt","visual.search.drop.zone.title":"Húzza ide a fájlt","visual.search.drop.zone.sub.title":"Húzzon ide egy képet","visual.search.drop.zone.sub.title.or":"vagy","visual.search.drop.zone.sub.title.select":"fájl kiválasztása","visual.search.loading.title":"Fájl feltöltése..."},"id-ID":{"visual.search.zone.heading":"Coba fitur-fitur ini sekarang","visual.search.closeBtn.label":"Tutup cari yang serupa","visual.search.title":"Cari menggunakan gambar","visual.search.title.find.similar":"Cari yang sama","visual.search.drop.zone.title.generic":"Tarik & letakkan file gambar atau audio","visual.search.drop.zone.title":"Tarik dan Letakkan File Anda","visual.search.drop.zone.sub.title":"Tarik gambar ke sini","visual.search.drop.zone.sub.title.or":"atau","visual.search.drop.zone.sub.title.select":"pilih file","visual.search.loading.title":"Mengunggah file Anda..."},"it-IT":{"visual.search.zone.heading":"Prova oggi stesso queste funzionalità","visual.search.closeBtn.label":"Chiudi trova simile","visual.search.title":"Cerca con un’immagine","visual.search.title.find.similar":"Trova simile","visual.search.drop.zone.title.generic":"Trascina e rilascia un’immagine o un file audio","visual.search.drop.zone.title":"Trascina il tuo file","visual.search.drop.zone.sub.title":"Trascina un’immagine qui","visual.search.drop.zone.sub.title.or":"o","visual.search.drop.zone.sub.title.select":"seleziona un file","visual.search.loading.title":"Caricamento del file in corso..."},"ja-JP":{"visual.search.zone.heading":"これらの機能を今すぐお試しください","visual.search.closeBtn.label":"類似した検索項目を閉じる","visual.search.title":"画像で検索","visual.search.title.find.similar":"類似を検索","visual.search.drop.zone.title.generic":"画像やオーディオファイルのドラッグ&ドロップ","visual.search.drop.zone.title":"ファイルをドラッグ&ドロップ","visual.search.drop.zone.sub.title":"画像をここにドラッグ","visual.search.drop.zone.sub.title.or":"または","visual.search.drop.zone.sub.title.select":"ファイルを選択","visual.search.loading.title":"ファイルをアップロード中..."},"ko-KR":{"visual.search.zone.heading":"지금 이들 기능을 사용해 보세요.","visual.search.closeBtn.label":"유사 항목 찾기 닫기","visual.search.title":"이미지로 검색","visual.search.title.find.similar":"유사 항목 찾기","visual.search.drop.zone.title.generic":"이미지 또는 오디오 파일 드래그 앤 드롭","visual.search.drop.zone.title":"파일 드래그 앤 드롭","visual.search.drop.zone.sub.title":"여기로 이미지 드래그","visual.search.drop.zone.sub.title.or":"또는","visual.search.drop.zone.sub.title.select":"파일 선택","visual.search.loading.title":"파일 업로드 중..."},"ms-MY":{"visual.search.zone.heading":"Cubalah ciri-ciri ini hari ini","visual.search.closeBtn.label":"Tutup cari yang serupa","visual.search.title":"Cari dengan imej","visual.search.title.find.similar":"Cari yang serupa","visual.search.drop.zone.title.generic":"Seret & lepaskan fail imej atau audio","visual.search.drop.zone.title":"Seret dan Lepaskan Fail Anda","visual.search.drop.zone.sub.title":"Seret imej ke sini","visual.search.drop.zone.sub.title.or":"atau","visual.search.drop.zone.sub.title.select":"pilih fail","visual.search.loading.title":"Memuat naik fail anda..."},"nb-NO":{"visual.search.zone.heading":"Prøv ut disse funksjonene i dag","visual.search.closeBtn.label":"Lukk Finn lignende","visual.search.title":"Søk med et bilde","visual.search.title.find.similar":"Finn lignende","visual.search.drop.zone.title.generic":"Dra og slipp et bilde eller en lydfil","visual.search.drop.zone.title":"Dra og slipp filen","visual.search.drop.zone.sub.title":"Dra et bilde hit","visual.search.drop.zone.sub.title.or":"eller","visual.search.drop.zone.sub.title.select":"velg en fil","visual.search.loading.title":"Filen din lastes opp ..."},"nl-NL":{"visual.search.zone.heading":"Probeer deze functies vandaag nog","visual.search.closeBtn.label":"Sluit Vergelijkbare zoeken","visual.search.title":"Zoeken met een afbeelding","visual.search.title.find.similar":"Vergelijkbare items zoeken","visual.search.drop.zone.title.generic":"Sleep een afbeelding of audiobestand","visual.search.drop.zone.title":"Sleep je bestand","visual.search.drop.zone.sub.title":"Sleep een afbeelding hierheen","visual.search.drop.zone.sub.title.or":"of","visual.search.drop.zone.sub.title.select":"selecteer een bestand","visual.search.loading.title":"Je bestand wordt geüpload..."},"pl-PL":{"visual.search.zone.heading":"Wypróbuj te funkcje już dziś","visual.search.closeBtn.label":"Zamknij okno Znajdź podobne","visual.search.title":"Wyszukiwanie na podstawie obrazu","visual.search.title.find.similar":"Znajdź podobne","visual.search.drop.zone.title.generic":"Przeciągnij obraz lub plik audio","visual.search.drop.zone.title":"Przeciągnij plik","visual.search.drop.zone.sub.title":"Przeciągnij tutaj obraz","visual.search.drop.zone.sub.title.or":"lub","visual.search.drop.zone.sub.title.select":"wybierz plik","visual.search.loading.title":"Trwa przesyłanie pliku..."},"pt-BR":{"visual.search.zone.heading":"Experimente estes recursos hoje mesmo","visual.search.closeBtn.label":"Fechar Encontrar semelhantes","visual.search.title":"Pesquisar com uma imagem","visual.search.title.find.similar":"Encontrar semelhantes","visual.search.drop.zone.title.generic":"Arrastar e soltar um arquivo de imagem ou de áudio","visual.search.drop.zone.title":"Arrastar e soltar o arquivo","visual.search.drop.zone.sub.title":"Arraste uma imagem aqui","visual.search.drop.zone.sub.title.or":"ou","visual.search.drop.zone.sub.title.select":"selecione um arquivo","visual.search.loading.title":"Carregando seu arquivo..."},"pt-PT":{"visual.search.zone.heading":"Experimente estas funcionalidades hoje mesmo","visual.search.closeBtn.label":"Fechar Encontrar semelhantes","visual.search.title":"Procure com uma imagem","visual.search.title.find.similar":"Encontrar semelhantes","visual.search.drop.zone.title.generic":"Arraste e largue um ficheiro de imagem ou áudio","visual.search.drop.zone.title":"Arraste e Largue o Ficheiro","visual.search.drop.zone.sub.title":"Arraste uma imagem para aqui","visual.search.drop.zone.sub.title.or":"ou","visual.search.drop.zone.sub.title.select":"selecione um ficheiro","visual.search.loading.title":"A carregar o seu ficheiro..."},"ru-RU":{"visual.search.zone.heading":"Опробуйте эти возможности уже сегодня","visual.search.closeBtn.label":"Закрыть «Найти подобные»","visual.search.title":"Поиск похожего изображения","visual.search.title.find.similar":"Найти подобные","visual.search.drop.zone.title.generic":"Перетащите изображение или аудиофайл","visual.search.drop.zone.title":"Перетащить файл","visual.search.drop.zone.sub.title":"Перетащите сюда изображение","visual.search.drop.zone.sub.title.or":"или","visual.search.drop.zone.sub.title.select":"выберите файл","visual.search.loading.title":"Отправка файла..."},"sv-SE":{"visual.search.zone.heading":"Prova funktionerna idag","visual.search.closeBtn.label":"Stäng Sök liknande","visual.search.title":"Sök med en bild","visual.search.title.find.similar":"Sök liknande","visual.search.drop.zone.title.generic":"Dra och släpp en bild eller ljudfil","visual.search.drop.zone.title":"Dra och släpp din fil","visual.search.drop.zone.sub.title":"Dra en bild hit","visual.search.drop.zone.sub.title.or":"eller","visual.search.drop.zone.sub.title.select":"välj en fil","visual.search.loading.title":"Överför din fil ..."},"th-TH":{"visual.search.zone.heading":"ลองใช้ฟีเจอร์เหล่านี้เลย","visual.search.closeBtn.label":"ปิด “ค้นหารายการที่คล้ายกัน”","visual.search.title":"ค้นหาด้วยภาพ","visual.search.title.find.similar":"ค้นหาที่คล้ายกัน","visual.search.drop.zone.title.generic":"ลากและวางไฟล์ภาพหรือเสียง","visual.search.drop.zone.title":"ลากและวางไฟล์ของคุณ","visual.search.drop.zone.sub.title":"ลากภาพมาไว้ที่นี่","visual.search.drop.zone.sub.title.or":"หรือ","visual.search.drop.zone.sub.title.select":"เลือกไฟล์","visual.search.loading.title":"กำลังอัปโหลดไฟล์ของคุณ..."},"tr-TR":{"visual.search.zone.heading":"Bu özellikleri hemen deneyin","visual.search.closeBtn.label":"Benzerini bul özelliğini kapat","visual.search.title":"Görüntü ile arayın","visual.search.title.find.similar":"Benzerini bul","visual.search.drop.zone.title.generic":"Bir görüntüyü veya ses dosyasını sürükleyip bırakın","visual.search.drop.zone.title":"Dosyanızı Sürükleyip Bırakın","visual.search.drop.zone.sub.title":"Görüntüyü buraya sürükleyin","visual.search.drop.zone.sub.title.or":"veya","visual.search.drop.zone.sub.title.select":"bir dosya seçin","visual.search.loading.title":"Dosyanız yükleniyor..."},"uk-UA":{"visual.search.zone.heading":"Спробуйте ці функції сьогодні","visual.search.closeBtn.label":"Закрити «Знайти подібні»","visual.search.title":"Пошук із зображенням","visual.search.title.find.similar":"Знайти подібні","visual.search.drop.zone.title.generic":"Перетягніть зображення або аудіофайл","visual.search.drop.zone.title":"Перетягніть файл","visual.search.drop.zone.sub.title":"Перетягніть зображення сюди","visual.search.drop.zone.sub.title.or":"або","visual.search.drop.zone.sub.title.select":"виберіть файл","visual.search.loading.title":"Файл завантажується…"},"zh-Hans":{"visual.search.zone.heading":"立即试用这些功能","visual.search.closeBtn.label":"关闭视觉搜索模式","visual.search.title":"使用图像搜索","visual.search.title.find.similar":"查找相似内容","visual.search.drop.zone.title.generic":"拖放图像或音频文件","visual.search.drop.zone.title":"拖放您的文件","visual.search.drop.zone.sub.title":"将图像从计算机","visual.search.drop.zone.sub.title.or":"或者","visual.search.drop.zone.sub.title.select":"选择文件","visual.search.loading.title":"正在上传您的文件..."},"zh-Hant":{"visual.search.zone.heading":"立即試用這些功能","visual.search.closeBtn.label":"關閉尋找類似內容","visual.search.title":"使用影像搜尋","visual.search.title.find.similar":"尋找類似內容","visual.search.drop.zone.title.generic":"拖放影像或音訊檔案","visual.search.drop.zone.title":"拖放您的檔案","visual.search.drop.zone.sub.title":"拖曳影像到這裡","visual.search.drop.zone.sub.title.or":"或","visual.search.drop.zone.sub.title.select":"選取檔案","visual.search.loading.title":"正在上傳您的檔案…"},"zz-ZZ":{"visual.search.zone.heading":"[qW] ȮTry out these features todayü_","visual.search.closeBtn.label":"[qO] ȮClose find similarü_","visual.search.title":"[qV] ȮSearch with an imageü_","visual.search.title.find.similar":"[rI] ȮFind similarü_","visual.search.drop.zone.title.generic":"[rc] ȮDrag & drop an image or audio fileü_","visual.search.drop.zone.title":"[qT] ȮDrag and Drop Your Fileü_","visual.search.drop.zone.sub.title":"[qP] ȮDrag an image hereü_","visual.search.drop.zone.sub.title.or":"[qR] Ȯorü_","visual.search.drop.zone.sub.title.select":"[qS] Ȯselect a fileü_","visual.search.loading.title":"[qU] ȮUploading your file...ü_"}},{"cs-CZ":{"visual.search.error.unsupported.file.type":"Nepodporovaný typ souboru – odešlete soubor ve formátu JPEG nebo PNG.","visual.search.error.unsupported.page":"Funkce Najít podobné není pro tuto stránku k dispozici.","visual.search.error.unsupported.audioImageFile.type":"Typ souboru není podporován. Nahrajte soubor ve zvukovém nebo obrazovém formátu.","visual.search.error.unable.to.process":"Nepodařilo se zpracovat přetažený obrázek. Pokud budete chtít použít funkci vizuálního vyhledávání, přetáhněte některý z výsledků hledání nebo obrázek ze svého počítače.","visual.search.error.same.image.searched.with":"Tento obrázek už hledáte.","visual.search.error.image.too.large":"Přetažený obrázek je pro vizuální vyhledávání příliš velký.","audio.visual.search.error.unable.to.process":"Vložený zvukový soubor nelze zpracovat. Chcete -li použít vyhledávání podobnosti, přetáhněte zvukový soubor z počítače.","audio.find.similar.error.audio.too.large":"Soubor je příliš velký a nelze jej proto nahrát. Snižte jeho velikost na méně než 10 MB.","visual.search.error.general":"Došlo k chybě. Zkuste to znovu později."},"da-DK":{"visual.search.error.unsupported.file.type":"Ikke-understøttet filtype – upload en .jpeg eller .png.","visual.search.error.unsupported.page":"Find lignende er ikke tilgængelig for denne side.","visual.search.error.unsupported.audioImageFile.type":"Ikke-understøttet filtype – upload i lyd- eller billedformat.","visual.search.error.unable.to.process":"Det anbragte billede kunne ikke behandles. Hvis du vil bruge visuel søgning, skal du slippe ét af søgeresultaterne eller et billede fra din computer.","visual.search.error.same.image.searched.with":"Du søger allerede med det billede.","visual.search.error.image.too.large":"Billedet er for stort til visuel søgning.","audio.visual.search.error.unable.to.process":"Lydfilen kunne ikke behandles. Hvis du vil bruge lighedssøgning, skal du slippe en lydfil fra din computer.","audio.find.similar.error.audio.too.large":"Filen er for stor og kan ikke uploades. Filen skal være under 10 MB.","visual.search.error.general":"Der opstod en fejl. Prøv venligst igen senere."},"de-DE":{"visual.search.error.unsupported.file.type":"Dateityp wird nicht unterstützt. Lade eine JPEG- oder PNG-Datei hoch.","visual.search.error.unsupported.page":"„Ähnliches suchen“ ist für diese Seite nicht verfügbar.","visual.search.error.unsupported.audioImageFile.type":"Nicht unterstützter Dateityp – bitte im Audio- oder Bildformat hochladen.","visual.search.error.unable.to.process":"Das abgelegte Bild konnte nicht verarbeitet werden. Um die visuelle Suche zu verwenden, ziehe ein Bild aus den Suchergebnissen in das Feld oder wähle ein Bild auf deinem Computer aus.","visual.search.error.same.image.searched.with":"Dieses Bild wird bereits in der Suche verwendet.","visual.search.error.image.too.large":"Das abgelegte Bild ist für die visuelle Suche zu groß.","audio.visual.search.error.unable.to.process":"Die abgelegte Audiodatei konnte nicht verarbeitet werden. Um die Ähnlichkeitssuche zu verwenden, lege bitte eine auf deinem Computer gespeicherte Audiodatei ab.","audio.find.similar.error.audio.too.large":"Die Datei ist zu groß und kann nicht hochgeladen werden. Verwende eine Datei mit weniger als 10 MB.","visual.search.error.general":"Fehler. Versuche es später erneut."},"en-US":{"visual.search.error.unsupported.file.type":"Unsupported File Type - please upload a .jpeg or .png.","visual.search.error.unsupported.page":"Find Similar not available for this page.","visual.search.error.unsupported.audioImageFile.type":"Unsupported file type - please upload in audio or image format.","visual.search.error.unable.to.process":"Could not process the dropped image. To use visual search please drop one of the search results or an image from your computer.","visual.search.error.same.image.searched.with":"You're already searching with that image.","visual.search.error.image.too.large":"Image dropped is too large for visual search.","audio.visual.search.error.unable.to.process":"Could not process the dropped audio file. To use similarity search please drop an audio file from your computer.","audio.find.similar.error.audio.too.large":"The file is too large and cannot be uploaded. Please limit size to under 10MB.","visual.search.error.general":"An error occurred. Please try again later."},"es-ES":{"visual.search.error.unsupported.file.type":"Tipo de archivo no admitido: suba un .jpeg or .png.","visual.search.error.unsupported.page":"Buscar similares no está disponible para esta página.","visual.search.error.unsupported.audioImageFile.type":"Tipo de archivo no admitido: súbelo en formato de audio o imagen.","visual.search.error.unable.to.process":"No se ha podido procesar la imagen soltada. Para usar la búsqueda visual, suelta uno de los resultados de la búsqueda o una imagen de tu ordenador.","visual.search.error.same.image.searched.with":"Ya estás realizando una búsqueda con esa imagen.","visual.search.error.image.too.large":"La imagen que se ha soltado es demasiado grande para hacer una búsqueda visual.","audio.visual.search.error.unable.to.process":"No se ha podido procesar el archivo de audio que has soltado. Para utilizar la búsqueda por similitud, suelta un archivo de audio del equipo.","audio.find.similar.error.audio.too.large":"El archivo es demasiado grande y no se puede cargar. Usa uno que tenga menos de 10 MB.","visual.search.error.general":"Se ha producido un error. Vuelve a intentarlo más tarde."},"fi-FI":{"visual.search.error.unsupported.file.type":"Tiedostotyyppiä ei tueta – lähetä .jpeg- tai .png-tiedosto.","visual.search.error.unsupported.page":"Etsi samankaltaisia -toiminto ei ole käytettävissä tällä sivulla.","visual.search.error.unsupported.audioImageFile.type":"Tiedostotyyppiä ei tueta – lähetä ääni- tai kuvamuodossa.","visual.search.error.unable.to.process":"Pudotetun kuvan käsittely epäonnistui. Jos haluat käyttää visuaalista hakua, pudota jokin hakutuloksista tai kuva tietokoneesta.","visual.search.error.same.image.searched.with":"Haet jo tällä kuvalla.","visual.search.error.image.too.large":"Pudotettu kuva on liian suuri visuaaliseen hakuun.","audio.visual.search.error.unable.to.process":"Pudotettua äänitiedostoa ei voitu käsitellä. Jos haluat käyttää samankaltaisuushakua, pudota äänitiedosto tietokoneeltasi.","audio.find.similar.error.audio.too.large":"Tiedosto on liian suuri eikä sitä voi lähettää. Varmista, että koko on alle 10 Mt.","visual.search.error.general":"Virhe tapahtui. Yritä myöhemmin uudelleen."},"fr-FR":{"visual.search.error.unsupported.file.type":"Type de fichier non pris en charge, veuillez transférer un fichier .jpeg ou .png.","visual.search.error.unsupported.page":"Fonction Rechercher des fichiers similaires non disponible pour cette page.","visual.search.error.unsupported.audioImageFile.type":"Type de fichier non pris en charge. Chargez un fichier au format audio ou image.","visual.search.error.unable.to.process":"Impossible de traiter l’image déposée. Pour utiliser la recherche visuelle, déposez un des résultats de recherche ou une image provenant de votre ordinateur.","visual.search.error.same.image.searched.with":"Vous avez déjà effectué une recherche à partir de cette image.","visual.search.error.image.too.large":"L’image déposée est trop grande pour une recherche visuelle.","audio.visual.search.error.unable.to.process":"Impossible de traiter le fichier audio déposé. Pour utiliser la recherche par similarité, déposez un fichier audio issu de votre ordinateur.","audio.find.similar.error.audio.too.large":"Le fichier est trop volumineux et ne peut être téléchargé. Veuillez limiter la taille du fichier à moins de 10 Mo.","visual.search.error.general":"Une erreur est survenue. Veuillez réessayer ultérieurement."},"hu-HU":{"visual.search.error.unsupported.file.type":"Nem támogatott fájltípus – kérjük, töltsön fel .jpeg vagy .png fájlt.","visual.search.error.unsupported.page":"A Hasonló keresése nem érhető el ezen az oldalon.","visual.search.error.unsupported.audioImageFile.type":"Nem támogatott fájltípus – kérjük, töltse fel hang- vagy képformátumban.","visual.search.error.unable.to.process":"A behúzott képet nem sikerült feldolgozni. A vizuális keresés használatához húzza ide az egyik keresési eredményt vagy egy képet a számítógépéről.","visual.search.error.same.image.searched.with":"Már keres ezzel a képpel.","visual.search.error.image.too.large":"A behúzott kép túl nagy a vizuális kereséshez.","audio.visual.search.error.unable.to.process":"A behúzott hangfájlt nem sikerült feldolgozni. A hasonlóságon alapuló keresés használatához húzzon ide egy hangfájlt a számítógépéről.","audio.find.similar.error.audio.too.large":"A fájl túl nagy és nem tölthető fel. A fájlméret nem érheti el a 10 MB-ot.","visual.search.error.general":"Hiba történt, kérjük, próbálja később újra."},"id-ID":{"visual.search.error.unsupported.file.type":"Jenis File Tidak Didukung - harap unggah .jpeg atau .png.","visual.search.error.unsupported.page":"Cari yang Serupa tidak tersedia untuk halaman ini.","visual.search.error.unsupported.audioImageFile.type":"Jenis file tidak didukung - harap unggah dalam format audio atau gambar.","visual.search.error.unable.to.process":"Tidak dapat memproses gambar yang diletakkan. Untuk menggunakan pencarian visual, letakkan satu hasil pencarian atau gambar dari komputer Anda.","visual.search.error.same.image.searched.with":"Anda sudah mencari dengan gambar itu.","visual.search.error.image.too.large":"Gambar yang diletakkan terlalu besar untuk penelusuran visual.","audio.visual.search.error.unable.to.process":"Tidak dapat memproses file audio yang diletakkan. Untuk menggunakan pencarian kemiripan harap letakkan file audio dari komputer Anda.","audio.find.similar.error.audio.too.large":"File terlalu besar dan tidak bisa diunggah. Batasi ukuran di bawah 10MB.","visual.search.error.general":"Kesalahan terjadi. Coba lagi nanti."},"it-IT":{"visual.search.error.unsupported.file.type":"Tipo di file non supportato: carica un file .jpeg o .png.","visual.search.error.unsupported.page":"Trova simile non è disponibile per questa pagina.","visual.search.error.unsupported.audioImageFile.type":"Tipo di file non supportato - carica in formato audio o immagine.","visual.search.error.unable.to.process":"Impossibile elaborare l’immagine rilasciata. Per utilizzare la ricerca visiva, rilascia uno dei risultati di ricerca o un’immagine dal tuo computer.","visual.search.error.same.image.searched.with":"Stai già cercando con questa immagine.","visual.search.error.image.too.large":"L'immagine rilasciata è troppo grande per la ricerca visiva.","audio.visual.search.error.unable.to.process":"Impossibile elaborare il file audio rilasciato. Per utilizzare la ricerca per similitudine, trascina un file audio dal tuo computer.","audio.find.similar.error.audio.too.large":"Il file è troppo grande e non può essere caricato. Ridurre le dimensioni a meno di 10 MB.","visual.search.error.general":"Si è verificato un errore. Riprova più tardi."},"ja-JP":{"visual.search.error.unsupported.file.type":"サポートされていない種類のファイルです。.jpeg または .png をアップロードしてください。","visual.search.error.unsupported.page":"「類似項目を検索」はこちらのページではご利用いただけません。","visual.search.error.unsupported.audioImageFile.type":"サポートされていないファイルタイプ - オーディオまたは画像フォーマットでアップロードしてください。","visual.search.error.unable.to.process":"読み込んだ画像を処理できませんでした。ビジュアルサーチを使用するには、検索結果のサムネイル画像か、ご使用のコンピューターからの画像を検索ボックスにドロップしてください。","visual.search.error.same.image.searched.with":"画像の検索は既に開始されています。","visual.search.error.image.too.large":"ドロップされた画像が大きすぎるため、視覚的検索を実行できません。","audio.visual.search.error.unable.to.process":"ドロップされたオーディオファイルを処理できませんでした。類似検索を使用するには、コンピューターからオーディオファイルをドロップしてください。","audio.find.similar.error.audio.too.large":"ファイルが大きすぎるためアップロードできませんでした。ファイルのサイズを 10 MB 未満にしてください。","visual.search.error.general":"エラーが発生しました。後で再試行してください。"},"ko-KR":{"visual.search.error.unsupported.file.type":"지원되지 않는 파일 유형 - .jpeg 또는 .png 파일을 업로드해 주십시오.","visual.search.error.unsupported.page":"이 페이지에서는 유사한 항목을 찾을 수 없습니다.","visual.search.error.unsupported.audioImageFile.type":"지원되지 않는 파일 유형 - 오디오 또는 이미지 포맷으로 업로드해 주십시오.","visual.search.error.unable.to.process":"드롭한 이미지를 처리할 수 없습니다. 비주얼 검색 기능을 사용하려면 검색 결과 중 하나 또는 컴퓨터에서 하나의 이미지를 드롭해 주십시오.","visual.search.error.same.image.searched.with":"이미 해당 이미지로 검색 중입니다.","visual.search.error.image.too.large":"드롭한 이미지가 너무 커 비주얼 검색을 수행할 수 없습니다.","audio.visual.search.error.unable.to.process":"드롭한 오디오 파일을 처리할 수 없습니다. 유사 항목 검색 기능을 사용하려면 컴퓨터에서 오디오 파일을 드롭하십시오.","audio.find.similar.error.audio.too.large":"파일이 너무 커 업로드할 수 없습니다. 10MB 미만으로 크기를 제한해 주십시오.","visual.search.error.general":"오류가 발생했습니다. 나중에 다시 시도해 주십시오."},"ms-MY":{"visual.search.error.unsupported.file.type":"Jenis Fail Tidak Disokong - sila muat naik .jpeg atau .png.","visual.search.error.unsupported.page":"Cari yang Serupa tidak tersedia untuk halaman ini.","visual.search.error.unsupported.audioImageFile.type":"Jenis fail tidak disokong - sila muat naik dalam format audio atau imej.","visual.search.error.unable.to.process":"Tidak dapat memproses imej yang dilepaskan. Untuk menggunakan carian visual, sila lepaskan salah satu hasil carian atau imej daripada komputer anda.","visual.search.error.same.image.searched.with":"Anda sudah mencari dengan imej itu.","visual.search.error.image.too.large":"Imej yang dilepaskan terlalu besar untuk carian visual.","audio.visual.search.error.unable.to.process":"Tidak dapat memproses fail audio yang dilepaskan. Untuk menggunakan carian keserupaan, sila lepaskan fail audio daripada komputer anda.","audio.find.similar.error.audio.too.large":"Fail terlalu besar dan tidak boleh dimuat naik. Sila hadkan saiz di bawah 10 MB.","visual.search.error.general":"Ralat telah berlaku. Sila cuba lagi kemudian."},"nb-NO":{"visual.search.error.unsupported.file.type":"Filtypen støttes ikke – last opp en JPEG- eller PNG-fil.","visual.search.error.unsupported.page":"Finn lignende er ikke tilgjengelig for denne siden.","visual.search.error.unsupported.audioImageFile.type":"Filtypen støttes ikke – last opp i lyd- eller bildeformat.","visual.search.error.unable.to.process":"Kan ikke behandle bildet. Hvis du vil bruke visuelt søk, kan du dra inn et av søkeresultatene eller et bilde fra datamaskinen.","visual.search.error.same.image.searched.with":"Du søker allerede med dette bildet.","visual.search.error.image.too.large":"Bildet er for stort for visuelt søk.","audio.visual.search.error.unable.to.process":"Kunne ikke behandle den slupne lydfilen. Slipp en lydfil fra datamaskin for å bruke likhetssøk.","audio.find.similar.error.audio.too.large":"Filen er for stor til å kunne lastes opp. Begrens størrelsen til under 10 MB.","visual.search.error.general":"Det har oppstått en feil. Prøv på nytt senere."},"nl-NL":{"visual.search.error.unsupported.file.type":"Niet-ondersteund bestandstype. Upload een .jpeg- of .png-bestand.","visual.search.error.unsupported.page":"Vergelijkbare zoeken is niet beschikbaar voor deze pagina.","visual.search.error.unsupported.audioImageFile.type":"Niet-ondersteund bestandstype. Upload een bestand in een audio- of afbeeldingsindeling.","visual.search.error.unable.to.process":"De gesleepte afbeelding kan niet worden verwerkt. Als je visueel zoeken wilt gebruiken, sleep dan een van de zoekresultaten of een afbeelding op je computer.","visual.search.error.same.image.searched.with":"Je zoekt al met die afbeelding.","visual.search.error.image.too.large":"De gesleepte afbeelding is te groot voor visueel zoeken.","audio.visual.search.error.unable.to.process":"Het versleepte audiobestand kan niet worden verwerkt. Als je wilt zoeken op gelijkenis, sleep je een audiobestand vanaf je computer.","audio.find.similar.error.audio.too.large":"Het bestand is te groot en kan niet worden geüpload. Zorg dat het bestand kleiner is dan 10 MB.","visual.search.error.general":"Er is een fout opgetreden. Probeer het later opnieuw."},"pl-PL":{"visual.search.error.unsupported.file.type":"Nieobsługiwany typ pliku — prześlij plik .jpeg lub .png.","visual.search.error.unsupported.page":"Funkcja Znajdź podobne nie działa na tej stronie.","visual.search.error.unsupported.audioImageFile.type":"Nieobsługiwany typ pliku — prześlij plik w formacie dźwiękowym lub graficznym.","visual.search.error.unable.to.process":"Nie udało się przetworzyć przeciągniętego obrazu. Aby użyć wyszukiwania wizualnego, przeciągnij jeden z wyników wyszukiwania lub obraz z komputera.","visual.search.error.same.image.searched.with":"Już szukasz na podstawie tego obrazu.","visual.search.error.image.too.large":"Przeciągnięty obraz jest za duży i nie można go użyć do wyszukiwania wizualnego.","audio.visual.search.error.unable.to.process":"Nie można przetworzyć przeciągniętego pliku audio. Aby skorzystać z wyszukiwania podobnych, przeciągnij plik audio ze swojego komputera.","audio.find.similar.error.audio.too.large":"Ten plik jest zbyt duży i nie można go przesłać. Plik musi mieć mniej niż 10 MB.","visual.search.error.general":"Wystąpił błąd. Spróbuj ponownie później."},"pt-BR":{"visual.search.error.unsupported.file.type":"Tipo de arquivo sem suporte. Faça upload de um .jpeg ou .png.","visual.search.error.unsupported.page":"Encontrar semelhantes não está disponível para esta página.","visual.search.error.unsupported.audioImageFile.type":"Tipo de arquivo não compatível - faça upload em formato de áudio ou imagem.","visual.search.error.unable.to.process":"Não foi possível processar a imagem adicionada. Para usar a busca visual, adicione um dos resultados da pesquisa ou uma imagem do seu computador.","visual.search.error.same.image.searched.with":"Você já está pesquisando com esta imagem.","visual.search.error.image.too.large":"A imagem usada é muito grande para pesquisa visual.","audio.visual.search.error.unable.to.process":"Não foi possível processar o arquivo de áudio. Para usar a pesquisa por similaridade, envie um arquivo de áudio do seu computador.","audio.find.similar.error.audio.too.large":"O arquivo é muito grande e não pode ser enviado. O limite máximo é menor do que 10 MB.","visual.search.error.general":"Ocorreu um erro. Tente novamente mais tarde."},"pt-PT":{"visual.search.error.unsupported.file.type":"Tipo de Ficheiro Não Suportado - carregue um .jpeg ou .png.","visual.search.error.unsupported.page":"Encontrar Semelhantes não está disponível para esta página.","visual.search.error.unsupported.audioImageFile.type":"Tipo de ficheiro não suportado. Carregue no formato de áudio ou imagem.","visual.search.error.unable.to.process":"Não foi possível processar a imagem largada. Para utilizar a pesquisa visual, largue um dos resultados da pesquisa ou uma imagem existente no seu computador.","visual.search.error.same.image.searched.with":"Já está a efetuar uma pesquisa com essa imagem.","visual.search.error.image.too.large":"A imagem que largou é demasiado grande para a pesquisa visual.","audio.visual.search.error.unable.to.process":"Não foi possível processar o ficheiro de áudio que largou. Para utilizar a pesquisa por semelhança, largue um ficheiro de áudio do seu computador.","audio.find.similar.error.audio.too.large":"O ficheiro é demasiado grande e não é possível carregá-lo. Limite o tamanho a menos de 10 MB.","visual.search.error.general":"Ocorreu um erro. Tente novamente mais tarde."},"ru-RU":{"visual.search.error.unsupported.file.type":"Неподдерживаемый тип файлов. Загрузите в формате JPEG или PNG.","visual.search.error.unsupported.page":"Функция «Найти подобные» недоступна на этой странице.","visual.search.error.unsupported.audioImageFile.type":"Неподдерживаемый тип файла — загрузите в формате аудио или изображения.","visual.search.error.unable.to.process":"Не удалось обработать перетащенное изображение. Для использования визуального поиска перетащите один из результатов поиска или изображение со своего компьютера.","visual.search.error.same.image.searched.with":"Поиск с этим изображением уже выполнялся.","visual.search.error.image.too.large":"Перетащенное изображение имеет слишком большой размер для визуального поиска.","audio.visual.search.error.unable.to.process":"Не удалось обработать аудиофайл, который вы перетащили. Чтобы воспользоваться поиском по сходству, перетащите аудиофайл со своего компьютера.","audio.find.similar.error.audio.too.large":"Файл слишком большой для отправки. Размер файла не должен превышать 10 МБ. ","visual.search.error.general":"Произошла ошибка. Повторите попытку позже."},"sv-SE":{"visual.search.error.unsupported.file.type":"Filtypen stöds inte. Använd formatet JPEG eller PNG.","visual.search.error.unsupported.page":"Hitta liknande är inte tillgängligt för den här sidan.","visual.search.error.unsupported.audioImageFile.type":"Filtypen stöds inte – överför i ljud- eller bildformat.","visual.search.error.unable.to.process":"Det gick inte att behandla bilden. Använd en bild från sökresultaten eller en bild från din dator om du vill göra en visuell sökning.","visual.search.error.same.image.searched.with":"Du söker redan med den bilden.","visual.search.error.image.too.large":"Den släppta bilden är för stor för visuell sökning.","audio.visual.search.error.unable.to.process":"Det gick inte att behandla den släppta ljudfilen. Släpp en ljudfil från din dator om du vill använda likhetssökning.","audio.find.similar.error.audio.too.large":"Filen är för stor och går inte att överföra. Använd bara högst 10 MB stora filer.","visual.search.error.general":"Ett fel inträffade. Försök igen senare."},"th-TH":{"visual.search.error.unsupported.file.type":"ระบบไม่รองรับประเภทของไฟล์ โปรดอัปโหลดไฟล์ .jpeg หรือ .png","visual.search.error.unsupported.page":"การค้นหารายการที่ใกล้เคียงไม่พร้อมให้ใช้งานสำหรับหน้านี้","visual.search.error.unsupported.audioImageFile.type":"ระบบไม่รองรับประเภทของไฟล์ โปรดอัปโหลดไฟล์ในรูปแบบเสียงหรือภาพ","visual.search.error.unable.to.process":"ไม่สามารถประมวลผลภาพที่ให้ไว้ได้ หากต้องการใช้การค้นหาด้วยภาพ โปรดเลือกผลการค้นหาหรือภาพจากคอมพิวเตอร์ของคุณมาวาง","visual.search.error.same.image.searched.with":"คุณกำลังค้นหาด้วยภาพนั้นอยู่แล้ว","visual.search.error.image.too.large":"รูปภาพที่ป้อนมีขนาดใหญ่เกินไปสำหรับการค้นหาด้วยภาพ","audio.visual.search.error.unable.to.process":"ไม่สามารถประมวลผลไฟล์เสียงที่ให้ไว้ได้ หากต้องการใช้การค้นหารายการที่คล้ายกัน โปรดวางไฟล์เสียงจากคอมพิวเตอร์ของคุณ","audio.find.similar.error.audio.too.large":"ไฟล์มีขนาดใหญ่เกินไปและไม่สามารถอัปโหลดได้ โปรดเลือกไฟล์ที่มีขนาดไม่เกิน 10MB","visual.search.error.general":"เกิดข้อผิดพลาด โปรดลองอีกครั้งในภายหลัง"},"tr-TR":{"visual.search.error.unsupported.file.type":"Desteklenmeyen Dosya Türü, lütfen bir .jpeg veya .png dosyası yükleyin.","visual.search.error.unsupported.page":"Benzerini Bul özelliği bu sayfada kullanılamıyor.","visual.search.error.unsupported.audioImageFile.type":"Dosya türü desteklenmiyor, lütfen ses veya görüntü formatında yükleyin.","visual.search.error.unable.to.process":"Bırakılan görüntü işlenemedi. Görsel aramayı kullanmak için lütfen arama sonuçlarından birini veya bilgisayarınızdan bir görüntü bırakın.","visual.search.error.same.image.searched.with":"Zaten bu görüntüyle arama yapıyorsunuz.","visual.search.error.image.too.large":"Bırakılan görüntü, görsel arama için çok büyük.","audio.visual.search.error.unable.to.process":"Bırakılan ses dosyası işlenemedi. Benzerlik aramasını kullanmak için lütfen bilgisayarınızdan bir ses dosyası bırakın.","audio.find.similar.error.audio.too.large":"Dosya çok büyük ve yüklenemiyor. Lütfen boyutu 10 MB'nin altında tutun.","visual.search.error.general":"Bir hata oluştu. Lütfen daha sonra tekrar deneyin."},"uk-UA":{"visual.search.error.unsupported.file.type":"Непідтримуваний тип файлу. Завантажте файл формату .jpeg або .png.","visual.search.error.unsupported.page":"Функція «Знайти схожі» недоступна для цієї сторінки.","visual.search.error.unsupported.audioImageFile.type":"Непідтримуваний тип файлу — завантажте у форматі аудіо чи зображення.","visual.search.error.unable.to.process":"Не вдалось обробити перетягнуте зображення. Для використання візуального пошуку перетягніть одне з зображень із результатів пошуку або виберіть зображення на комп’ютері.","visual.search.error.same.image.searched.with":"Ви вже здійснюєте пошук за цим зображенням.","visual.search.error.image.too.large":"Перетягнуте зображення завелике для візуального пошуку.","audio.visual.search.error.unable.to.process":"Не вдалося обробити перетягнутий аудіофайл. Щоб скористатися пошуком подібних ресурсів, перетягніть аудіофайл зі свого комп'ютера.","audio.find.similar.error.audio.too.large":"Файл завеликий і не може бути передано. Обмежте розмір файлу до 10 МБ.","visual.search.error.general":"Сталася помилка. Спробуйте ще раз пізніше."},"zh-Hans":{"visual.search.error.unsupported.file.type":"文件类型不受支持 - 请上传 .jpeg 或 .png。","visual.search.error.unsupported.audioImageFile.type":"不支持的文件类型 - 请以音频或图像格式上传。","visual.search.error.unable.to.process":"无法处理放置的图像。要使用视觉搜索,请从计算机中放置搜索结果之一或放置一个图像。","visual.search.error.same.image.searched.with":"您已在通过该图像进行搜索。","visual.search.error.image.too.large":"放置的图像太大,无法执行视觉搜索。","audio.visual.search.error.unable.to.process":"无法处理放置的音频文件。要使用相似性搜索,请从您的计算机中放置音频文件。","audio.find.similar.error.audio.too.large":"文件太大,无法上传。请将大小限制在 10MB 以下。","visual.search.error.general":"出错。请稍后重试。"},"zh-Hant":{"visual.search.error.unsupported.file.type":"不支援檔案類型,請上傳 .jpeg 或 .png 檔案。","visual.search.error.unsupported.page":"無法在此頁面尋找類似內容。","visual.search.error.unsupported.audioImageFile.type":"不支援此檔案類型 - 請上傳音訊或是影像格式。","visual.search.error.unable.to.process":"無法處理拖放的影像。如要使用影像搜尋功能,請拖放其中一個搜尋結果或電腦上的影像。","visual.search.error.same.image.searched.with":"您已在使用該影像進行搜尋。","visual.search.error.image.too.large":"提供的影像太大,無法進行視覺搜尋。","audio.visual.search.error.unable.to.process":"無法處理提供的音訊檔。如要使用類似的搜尋功能,請從電腦上拖曳一個音訊檔案。","audio.find.similar.error.audio.too.large":"檔案太大,無法上傳。請將檔案大小限制在 10MB 以下。","visual.search.error.general":"發生錯誤,請稍後重試。"},"zz-ZZ":{"visual.search.error.unsupported.file.type":"[pY] ȮUnsupported File Type - please upload a .jpeg or .png.ü_","visual.search.error.unsupported.page":"[1X] ȮFind Similar not available for this page.ü_","visual.search.error.unsupported.audioImageFile.type":"[qN] ȮUnsupported file type - please upload in audio or image format.ü_","visual.search.error.unable.to.process":"[pX] ȮCould not process the dropped image. To use visual search please drop one of the search results or an image from your computer.ü_","visual.search.error.same.image.searched.with":"[pW] ȮYou're already searching with that image.ü_","visual.search.error.image.too.large":"[pV] ȮImage dropped is too large for visual search.ü_","audio.visual.search.error.unable.to.process":"[qx] ȮCould not process the dropped audio file. To use similarity search please drop an audio file from your computer.ü_","audio.find.similar.error.audio.too.large":"[rj] ȮThe file is too large and cannot be uploaded. Please limit size to under 10MB.ü_","visual.search.error.general":"[pU] ȮAn error occurred. Please try again later.ü_"}}));const Ia=["setBasename"];function qa(e){let{setBasename:a}=e,r=(0,va.Z)(e,Ia);const n=(0,o.I0)(),{[ya.wo.id]:{value:u=!1}={}}=(0,De.g)();(0,t.useEffect)((()=>{n((0,l.Kz)({isAudioFscEnabled:u}))}),[n,u]);const d=(0,fa.k6)();return(()=>{(0,ba.hb)({key:za.cT,saga:ka.lt}),(0,ba.vp)({key:za.cT,reducer:ka.yC});const e=(0,o.I0)();(0,t.useEffect)((()=>{e((0,s.Mm)(!0))}),[e])})(),(0,t.useEffect)((()=>{a((0,R.Z)(d))}),[]),i().createElement(Oa,r)}const _a=(0,ba.y3)({key:l.cT,saga:l.wK});qa.propTypes={setBasename:Z.func.isRequired};var Va=(0,ma.qC)(_a)((0,o.$j)(null,(function(e){return{setBasename:a=>{e((0,l.C1)(a))}}}))(qa))},17209:(e,a,r)=>{e.exports=r(65481)},65481:(e,a,r)=>{"use strict";var t=r(64836);a.default=void 0;var i,o,s,n=t(r(10434)),l=t(r(70215)),u=t(r(56690)),d=t(r(89728)),c=t(r(94993)),p=t(r(73808)),h=t(r(61655)),g=t(r(38416)),v=t(r(96521)),f=t(r(94184)),m=t(r(2330)),b=t(r(45697)),y=t(r(23469));r(45372),r(55761),r(25313);var k=(0,v.default)((s=o=function(e){function a(e){var r;return(0,u.default)(this,a),(r=(0,c.default)(this,(0,p.default)(a).call(this,e))).state={draggingOver:!1},r.debouncedDragLeave=null,r}return(0,h.default)(a,e),(0,d.default)(a,[{key:"clearDebouncedDragLeave",value:function(){this.debouncedDragLeave&&(clearTimeout(this.debouncedDragLeave),this.debouncedDragLeave=null)}},{key:"onDragOver",value:function(e){!this.props.shouldAccept||this.props.shouldAccept(e)?(e.preventDefault(),this.clearDebouncedDragLeave(),this.state.draggingOver||this.setState({draggingOver:!0}),e.dataTransfer.dropEffect=this.props.dropEffect,this.props.onDragOver&&this.props.onDragOver(e)):e.dataTransfer.dropEffect="none"}},{key:"onDragLeave",value:function(e){var a=this;this.clearDebouncedDragLeave(),this.debouncedDragLeave=setTimeout((function(){a.state.draggingOver&&a.setState({draggingOver:!1}),a.props.onDragLeave&&a.props.onDragLeave(e)}),100)}},{key:"onDrop",value:function(e){e.preventDefault(),this.clearDebouncedDragLeave(),this.state.draggingOver&&this.setState({draggingOver:!1}),this.props.onDrop&&this.props.onDrop(e)}},{key:"render",value:function(){var e=this.props,a=e.children,r=e.className,t=(0,l.default)(e,["children","className"]);return y.default.createElement("div",(0,n.default)({},(0,m.default)(t),{className:(0,f.default)("spectrum-Dropzone",{"is-dragged":this.state.draggingOver},r),onDrop:this.onDrop,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave}),a)}}]),a}(y.default.Component),(0,g.default)(o,"defaultProps",{dropEffect:"copy"}),(0,g.default)(o,"propTypes",{dropEffect:b.default.oneOf(["copy","move","link","none"]),shouldAccept:b.default.func,onDragLeave:b.default.func,onDragOver:b.default.func,onDrop:b.default.func,className:b.default.string}),i=s))||i;a.default=k},12740:(e,a,r)=>{"use strict";var t=r(23469);e.exports=t.createElement("svg",{viewBox:"0 0 36 36"},t.createElement("path",{d:"M17.127 2.579L.4 32.512A1 1 0 0 0 1.272 34h33.456a1 1 0 0 0 .873-1.488L18.873 2.579a1 1 0 0 0-1.746 0zM20 29.5a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5zm0-6a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-12a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5z"}))},81285:(e,a,r)=>{"use strict";var t=r(23469);e.exports=t.createElement("svg",{viewBox:"0 0 48 48"},t.createElement("path",{d:"M44.37 39.036L25.752 5.186a2 2 0 0 0-3.5 0L3.63 39.036A2 2 0 0 0 5.383 42h37.234a2 2 0 0 0 1.753-2.964zM24 39a3 3 0 1 1 3-3 3 3 0 0 1-3 3zm-2.4-10V15a1 1 0 0 1 1-1h2.8a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-2.8a1 1 0 0 1-1-1z"}))},6205:(e,a,r)=>{"use strict";var t=Object.assign||function(e){for(var a=1;a{"use strict";var t=r(23469);e.exports=t.createElement("svg",{viewBox:"0 0 36 36"},t.createElement("path",{d:"M18 2a16 16 0 1 0 16 16A16 16 0 0 0 18 2zm-.3 4.3a2.718 2.718 0 0 1 2.864 2.824 2.665 2.665 0 0 1-2.864 2.863 2.706 2.706 0 0 1-2.864-2.864A2.717 2.717 0 0 1 17.7 6.3zM22 27a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-6h-1a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v9h1a1 1 0 0 1 1 1z"}))},49292:(e,a,r)=>{"use strict";var t=r(23469);e.exports=t.createElement("svg",{viewBox:"0 0 48 48"},t.createElement("path",{d:"M24 4.1A19.9 19.9 0 1 0 43.9 24 19.9 19.9 0 0 0 24 4.1zm-.3 6.2a2.718 2.718 0 0 1 2.864 2.824 2.665 2.665 0 0 1-2.864 2.863 2.706 2.706 0 0 1-2.864-2.864A2.717 2.717 0 0 1 23.7 10.3zM28 35a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8h-1a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v11h1a1 1 0 0 1 1 1z"}))},79828:(e,a,r)=>{"use strict";var t=Object.assign||function(e){for(var a=1;a{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var t=o(r(45592)),i=o(r(23469));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return i.default.createElement(t.default,e,i.default.createElement("svg",{className:"spectrum-UIIcon-CrossMedium"},i.default.createElement("path",{d:"M7.77 6.709L5.061 4 7.77 1.291A.75.75 0 1 0 6.709.23L4 2.939 1.291.23A.75.75 0 1 0 .23 1.291L2.939 4 .23 6.709A.75.75 0 1 0 1.291 7.77L4 5.061 6.709 7.77A.75.75 0 1 0 7.77 6.709z",className:"spectrum-UIIcon--medium"}),i.default.createElement("path",{d:"M9.77 8.709L6.061 5 9.77 1.291A.75.75 0 1 0 8.709.23L5 3.939 1.291.23A.75.75 0 1 0 .23 1.291L3.939 5 .23 8.709A.75.75 0 1 0 1.291 9.77L5 6.061 8.709 9.77A.75.75 0 1 0 9.77 8.709z",className:"spectrum-UIIcon--large"})))};s.displayName="CrossMedium",a.default=s},72206:(e,a,r)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var t=o(r(45592)),i=o(r(23469));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return i.default.createElement(t.default,e,i.default.createElement("svg",{className:"spectrum-UIIcon-InfoMedium"},i.default.createElement("path",{d:"M9 1a8 8 0 1 0 8 8 8 8 0 0 0-8-8zm-.15 2.15a1.359 1.359 0 0 1 1.431 1.283v.129a1.332 1.332 0 0 1-1.223 1.432 1.444 1.444 0 0 1-.208 0 1.353 1.353 0 0 1-1.432-1.269 1.5 1.5 0 0 1 0-.164 1.359 1.359 0 0 1 1.3-1.412c.047-.002.089-.001.132.001zM11 13.5a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5H8V9h-.5a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V12h.5a.5.5 0 0 1 .5.5z",className:"spectrum-UIIcon--medium"}),i.default.createElement("path",{d:"M11 2a9 9 0 1 0 9 9 9 9 0 0 0-9-9zm-.15 2.65a1.359 1.359 0 0 1 1.431 1.283v.129a1.332 1.332 0 0 1-1.224 1.432 1.444 1.444 0 0 1-.208 0 1.353 1.353 0 0 1-1.431-1.269 1.5 1.5 0 0 1 0-.164 1.359 1.359 0 0 1 1.3-1.412c.047-.002.089-.001.132.001zM13.5 16a.5.5 0 0 1-.5.5H9a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h1v-4H9a.5.5 0 0 1-.5-.5V9a.5.5 0 0 1 .5-.5h2.5a.5.5 0 0 1 .5.5v5.5h1a.5.5 0 0 1 .5.5z",className:"spectrum-UIIcon--large"})))};s.displayName="InfoMedium",a.default=s},10456:(e,a,r)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var t=o(r(45592)),i=o(r(23469));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){return i.default.createElement(t.default,e,i.default.createElement("svg",{className:"spectrum-UIIcon-SuccessMedium"},i.default.createElement("path",{d:"M9 1a8 8 0 1 0 8 8 8 8 0 0 0-8-8zm5.333 4.54l-6.324 8.13a.6.6 0 0 1-.437.23h-.037a.6.6 0 0 1-.425-.176l-3.893-3.9a.6.6 0 0 1 0-.849l.663-.663a.6.6 0 0 1 .848 0L7.4 10.991l5.256-6.754a.6.6 0 0 1 .843-.1l.728.566a.6.6 0 0 1 .106.837z",className:"spectrum-UIIcon--medium"}),i.default.createElement("path",{d:"M11 2a9 9 0 1 0 9 9 9 9 0 0 0-9-9zm5.638 5.609L10.1 15.652a.5.5 0 0 1-.7.073.44.44 0 0 1-.039-.035L5.086 11.5a.5.5 0 0 1 0-.707l.707-.707a.5.5 0 0 1 .707 0L9.6 13.1l5.486-6.751a.5.5 0 0 1 .7-.073l.776.631a.5.5 0 0 1 .076.702z",className:"spectrum-UIIcon--large"})))};s.displayName="SuccessMedium",a.default=s},87228:(e,a,r)=>{e.exports=r(38969)},38969:(e,a,r)=>{"use strict";var t=r(64836);a.default=void 0;var i=t(r(10434)),o=t(r(70215)),s=t(r(56690)),n=t(r(89728)),l=t(r(94993)),u=t(r(73808)),d=t(r(61655)),c=t(r(38416)),p=t(r(94184)),h=t(r(2330)),g=t(r(57765)),v=t(r(45697)),f=t(r(23469));r(30539),r(17270),r(17733);var m=function(e){function a(){return(0,s.default)(this,a),(0,l.default)(this,(0,u.default)(a).apply(this,arguments))}return(0,d.default)(a,e),(0,n.default)(a,[{key:"isIllustrationDecorative",value:function(){var e=this.props,a=e.illustration,r=e.heading,t=e.description;if(a){var i=a.props,o=i["aria-label"],s=i["aria-labelledby"],n=i["aria-hidden"];if(null!=n)return n;if(o||s)return!1}return!(!r&&!t)}},{key:"render",value:function(){var e=this.props,a=e.illustration,r=void 0===a?null:a,t=e.className,s=e.heading,n=e.description,l=e.ariaLevel,u=(0,o.default)(e,["illustration","className","heading","description","ariaLevel"]);return!r||r.props.className&&r.props.className.includes("spectrum-IllustratedMessage-illustration")||(r=f.default.cloneElement(r,{className:(0,p.default)(r.props.className,"spectrum-IllustratedMessage-illustration"),"aria-hidden":this.isIllustrationDecorative()||null})),f.default.createElement("div",(0,i.default)({},(0,h.default)(u),{className:(0,p.default)("spectrum-IllustratedMessage",t)}),r,s&&f.default.createElement(g.default,{variant:"pageTitle",className:"spectrum-IllustratedMessage-heading","aria-level":l},s),n&&f.default.createElement("p",{className:"spectrum-Body--secondary spectrum-IllustratedMessage-description"},n))}}]),a}(f.default.Component);a.default=m,(0,c.default)(m,"propTypes",{heading:v.default.string,description:v.default.oneOfType([v.default.string,v.default.element]),illustration:v.default.element,ariaLevel:v.default.number}),(0,c.default)(m,"defaultProps",{heading:null,description:null})},92652:(e,a,r)=>{"use strict";var t=r(64836);a.Z=T;var i=t(r(10434)),o=t(r(38416)),s=t(r(70215)),n=t(r(64836)),l=t(r(39519)),u=t(r(97915)),d=t(r(94184)),c=t(r(4186)),p=t(r(2330)),h=t(r(72206)),g=r(78285),v=t(r(45697)),f=t(r(23469)),m=t(r(10456)),b={"cs-CZ":(0,n.default)(r(79245)).default,"da-DK":(0,n.default)(r(28646)).default,"de-DE":(0,n.default)(r(28675)).default,"en-US":(0,n.default)(r(45644)).default,"es-ES":(0,n.default)(r(17425)).default,"fi-FI":(0,n.default)(r(28994)).default,"fr-FR":(0,n.default)(r(26240)).default,"hu-HU":(0,n.default)(r(15042)).default,"it-IT":(0,n.default)(r(56923)).default,"ja-JP":(0,n.default)(r(60583)).default,"ko-KR":(0,n.default)(r(62216)).default,"nb-NO":(0,n.default)(r(47829)).default,"nl-NL":(0,n.default)(r(11768)).default,"pl-PL":(0,n.default)(r(76592)).default,"pt-BR":(0,n.default)(r(74904)).default,"ru-RU":(0,n.default)(r(20599)).default,"sv-SE":(0,n.default)(r(63218)).default,"tr-TR":(0,n.default)(r(35191)).default,"uk-UA":(0,n.default)(r(22488)).default,"zh-CN":(0,n.default)(r(63522)).default,"zh-TW":(0,n.default)(r(15666)).default};r(13792),r(8631),r(54506);var y=(0,g.messageFormatter)(b),k={error:l.default,warning:l.default,info:h.default,success:m.default},z="alert";function T(e){var a=e.variant,r=e.children,t=e.closable,n=e.onClose,l=e.onAction,h=e.className,g=(e.timeout,e.actionLabel),v=e.closeOnAction,m=(0,s.default)(e,["variant","children","closable","onClose","onAction","className","timeout","actionLabel","closeOnAction"]),b=k[a],T=m.role||z;return f.default.createElement("div",(0,i.default)({role:T,className:(0,d.default)("spectrum-Toast",(0,o.default)({},"spectrum-Toast--"+a,a),h)},(0,p.default)(m)),b&&f.default.createElement(b,{size:null,className:"spectrum-Toast-typeIcon",alt:y(a)}),f.default.createElement("div",{className:"spectrum-Toast-body"},f.default.createElement("div",{className:"spectrum-Toast-content"},r),g&&f.default.createElement(u.default,{label:g,quiet:!0,variant:"overBackground",onClick:function(){l&&l.apply(void 0,arguments),v&&n&&n.apply(void 0,arguments)}})),t&&f.default.createElement("div",{className:"spectrum-Toast-buttons"},f.default.createElement("button",{"aria-label":y("close"),className:"spectrum-ClearButton spectrum-ClearButton--medium spectrum-ClearButton--overBackground",onClick:n},f.default.createElement(c.default,{size:null}))))}T.propTypes={children:v.default.node,variant:v.default.oneOf(["error","warning","info","success"]),closable:v.default.bool,actionLabel:v.default.string,closeOnAction:v.default.bool,onClose:v.default.func,onAction:v.default.func,timeout:v.default.number}},46384:(e,a,r)=>{var t=r(38407),i=r(37465),o=r(63779),s=r(67599),n=r(44758),l=r(34309);function u(e){var a=this.__data__=new t(e);this.size=a.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=s,u.prototype.has=n,u.prototype.set=l,e.exports=u},11149:(e,a,r)=>{var t=r(55639).Uint8Array;e.exports=t},34963:e=>{e.exports=function(e,a){for(var r=-1,t=null==e?0:e.length,i=0,o=[];++r{e.exports=function(e,a){for(var r=-1,t=null==e?0:e.length;++r{var t=r(62488),i=r(1469);e.exports=function(e,a,r){var o=a(e);return i(e)?o:t(o,r(e))}},90939:(e,a,r)=>{var t=r(21299),i=r(37005);e.exports=function e(a,r,o,s,n){return a===r||(null==a||null==r||!i(a)&&!i(r)?a!=a&&r!=r:t(a,r,o,s,e,n))}},21299:(e,a,r)=>{var t=r(46384),i=r(67114),o=r(18351),s=r(16096),n=r(64160),l=r(1469),u=r(44144),d=r(36719),c="[object Arguments]",p="[object Array]",h="[object Object]",g=Object.prototype.hasOwnProperty;e.exports=function(e,a,r,v,f,m){var b=l(e),y=l(a),k=b?p:n(e),z=y?p:n(a),T=(k=k==c?h:k)==h,w=(z=z==c?h:z)==h,E=k==z;if(E&&u(e)){if(!u(a))return!1;b=!0,T=!1}if(E&&!T)return m||(m=new t),b||d(e)?i(e,a,r,v,f,m):o(e,a,k,r,v,f,m);if(!(1&r)){var S=T&&g.call(e,"__wrapped__"),M=w&&g.call(a,"__wrapped__");if(S||M){var L=S?e.value():e,F=M?a.value():a;return m||(m=new t),f(L,F,r,v,m)}}return!!E&&(m||(m=new t),s(e,a,r,v,f,m))}},67114:(e,a,r)=>{var t=r(88668),i=r(82908),o=r(74757);e.exports=function(e,a,r,s,n,l){var u=1&r,d=e.length,c=a.length;if(d!=c&&!(u&&c>d))return!1;var p=l.get(e),h=l.get(a);if(p&&h)return p==a&&h==e;var g=-1,v=!0,f=2&r?new t:void 0;for(l.set(e,a),l.set(a,e);++g{var t=r(62705),i=r(11149),o=r(77813),s=r(67114),n=r(68776),l=r(21814),u=t?t.prototype:void 0,d=u?u.valueOf:void 0;e.exports=function(e,a,r,t,u,c,p){switch(r){case"[object DataView]":if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=a.byteLength||!c(new i(e),new i(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+a);case"[object Error]":return e.name==a.name&&e.message==a.message;case"[object RegExp]":case"[object String]":return e==a+"";case"[object Map]":var h=n;case"[object Set]":var g=1&t;if(h||(h=l),e.size!=a.size&&!g)return!1;var v=p.get(e);if(v)return v==a;t|=2,p.set(e,a);var f=s(h(e),h(a),t,u,c,p);return p.delete(e),f;case"[object Symbol]":if(d)return d.call(e)==d.call(a)}return!1}},16096:(e,a,r)=>{var t=r(58234),i=Object.prototype.hasOwnProperty;e.exports=function(e,a,r,o,s,n){var l=1&r,u=t(e),d=u.length;if(d!=t(a).length&&!l)return!1;for(var c=d;c--;){var p=u[c];if(!(l?p in a:i.call(a,p)))return!1}var h=n.get(e),g=n.get(a);if(h&&g)return h==a&&g==e;var v=!0;n.set(e,a),n.set(a,e);for(var f=l;++c{var t=r(68866),i=r(99551),o=r(3674);e.exports=function(e){return t(e,o,i)}},99551:(e,a,r)=>{var t=r(34963),i=r(70479),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,n=s?function(e){return null==e?[]:(e=Object(e),t(s(e),(function(a){return o.call(e,a)})))}:i;e.exports=n},68776:e=>{e.exports=function(e){var a=-1,r=Array(e.size);return e.forEach((function(e,t){r[++a]=[t,e]})),r}},21814:e=>{e.exports=function(e){var a=-1,r=Array(e.size);return e.forEach((function(e){r[++a]=e})),r}},37465:(e,a,r)=>{var t=r(38407);e.exports=function(){this.__data__=new t,this.size=0}},63779:e=>{e.exports=function(e){var a=this.__data__,r=a.delete(e);return this.size=a.size,r}},67599:e=>{e.exports=function(e){return this.__data__.get(e)}},44758:e=>{e.exports=function(e){return this.__data__.has(e)}},34309:(e,a,r)=>{var t=r(38407),i=r(57071),o=r(83369);e.exports=function(e,a){var r=this.__data__;if(r instanceof t){var s=r.__data__;if(!i||s.length<199)return s.push([e,a]),this.size=++r.size,this;r=this.__data__=new o(s)}return r.set(e,a),this.size=r.size,this}},18446:(e,a,r)=>{var t=r(90939);e.exports=function(e,a){return t(e,a)}},70479:e=>{e.exports=function(){return[]}},45372:()=>{},25313:()=>{},55761:()=>{},30539:()=>{},17733:()=>{},17270:()=>{},13792:()=>{},54506:()=>{},8631:()=>{},79245:e=>{"use strict";e.exports=JSON.parse('{"close":"Zavřít","error":"Chyba","info":"Informace","success":"Úspěch","warning":"Upozornění"}')},28646:e=>{"use strict";e.exports=JSON.parse('{"close":"Luk","error":"Fejl","info":"Oplysninger","success":"Fuldført","warning":"Advarsel"}')},28675:e=>{"use strict";e.exports=JSON.parse('{"close":"Schließen","error":"Fehler","info":"Informationen","success":"Erfolg","warning":"Warnung"}')},45644:e=>{"use strict";e.exports=JSON.parse('{"close":"Close","error":"Error","warning":"Warning","success":"Success","info":"Information"}')},17425:e=>{"use strict";e.exports=JSON.parse('{"close":"Cerrar","error":"Error","info":"Información","success":"Éxito","warning":"Advertencia"}')},28994:e=>{"use strict";e.exports=JSON.parse('{"close":"Sulje","error":"Virhe","info":"Tiedot","success":"Onnistui","warning":"Varoitus"}')},26240:e=>{"use strict";e.exports=JSON.parse('{"close":"Fermer","error":"Erreur","info":"Informations","success":"Succès","warning":"Avertissement"}')},15042:e=>{"use strict";e.exports=JSON.parse('{"close":"Bezárás","error":"Hiba","info":"Információ","success":"Siker","warning":"Figyelmeztetés"}')},56923:e=>{"use strict";e.exports=JSON.parse('{"close":"Chiudi","error":"Errore","info":"Informazioni","success":"Operazione riuscita","warning":"Avvertenza"}')},60583:e=>{"use strict";e.exports=JSON.parse('{"close":"閉じる","error":"エラー","info":"情報","success":"成功","warning":"警告"}')},62216:e=>{"use strict";e.exports=JSON.parse('{"close":"닫기","error":"오류","info":"정보","success":"성공","warning":"경고"}')},47829:e=>{"use strict";e.exports=JSON.parse('{"close":"Lukk","error":"Feil","info":"Informasjon","success":"Vellykket","warning":"Advarsel"}')},11768:e=>{"use strict";e.exports=JSON.parse('{"close":"Sluiten","error":"Fout","info":"Informatie","success":"Geslaagd","warning":"Waarschuwing"}')},76592:e=>{"use strict";e.exports=JSON.parse('{"close":"Zamknij","error":"Błąd","info":"Informacja","success":"Powodzenie","warning":"Ostrzeżenie"}')},74904:e=>{"use strict";e.exports=JSON.parse('{"close":"Fechar","error":"Erro","info":"Informação","success":"Sucesso","warning":"Aviso"}')},20599:e=>{"use strict";e.exports=JSON.parse('{"close":"Закрыть","error":"Ошибка","info":"Информация","success":"Успешно","warning":"Предупреждение"}')},63218:e=>{"use strict";e.exports=JSON.parse('{"close":"Stäng","error":"Fel","info":"Information","success":"Lyckades","warning":"Varning"}')},35191:e=>{"use strict";e.exports=JSON.parse('{"close":"Kapat","error":"Hata","info":"Bilgiler","success":"Başarılı","warning":"Uyarı"}')},22488:e=>{"use strict";e.exports=JSON.parse('{"close":"Закрити","error":"Помилка","info":"Інформація","success":"Успішно","warning":"Попередження"}')},63522:e=>{"use strict";e.exports=JSON.parse('{"close":"关闭","error":"错误","info":"信息","success":"成功","warning":"警告"}')},15666:e=>{"use strict";e.exports=JSON.parse('{"close":"關閉","error":"錯誤","info":"資訊","success":"成功","warning":"警告"}')}}]); diff --git a/badlistenermoz.js b/badlistenermoz.js new file mode 100644 index 0000000..9ba6860 --- /dev/null +++ b/badlistenermoz.js @@ -0,0 +1,393 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const BAD_LISTENER = "The event listener must be a function."; + +const eventListeners = Symbol("EventEmitter/listeners"); +const onceResolvers = Symbol("EventEmitter/once-resolvers"); +loader.lazyRequireGetter(this, "flags", "resource://devtools/shared/flags.js"); + +class EventEmitter { + /** + * Decorate an object with event emitter functionality; basically using the + * class' prototype as mixin. + * + * @param Object target + * The object to decorate. + * @return Object + * The object given, mixed. + */ + static decorate(target) { + const descriptors = Object.getOwnPropertyDescriptors(this.prototype); + delete descriptors.constructor; + return Object.defineProperties(target, descriptors); + } + + /** + * Registers an event `listener` that is called every time events of + * specified `type` is emitted on this instance. + * + * @param {string} type + * The type of event. + * @param {Function} listener + * The listener that processes the event. + * @param {object} options + * @param {AbortSignal} options.signal + * The listener will be removed when linked AbortController’s abort() method is called + * @returns {Function} + * A function that removes the listener when called. + */ + on(type, listener, { signal } = {}) { + if (typeof listener !== "function") { + throw new Error(BAD_LISTENER); + } + + if (signal?.aborted === true) { + // The signal is already aborted so don't setup the listener. + // We return an empty function as it's the expected returned value. + return () => {}; + } + + if (!(eventListeners in this)) { + this[eventListeners] = new Map(); + } + + const events = this[eventListeners]; + + if (events.has(type)) { + events.get(type).add(listener); + } else { + events.set(type, new Set([listener])); + } + + const offFn = () => this.off(type, listener); + + if (signal) { + signal.addEventListener("abort", offFn, { once: true }); + } + + return offFn; + } + + /** + * Removes an event `listener` for the given event `type` on this instance + * If no `listener` is passed removes all listeners of the given + * `type`. If `type` is not passed removes all the listeners of this instance. + * + * @param {string} [type] + * The type of event. + * @param {Function} [listener] + * The listener that processes the event. + */ + off(type, listener) { + const length = arguments.length; + const events = this[eventListeners]; + + if (!events) { + return; + } + + if (length >= 2) { + // Trying to remove from `this` the `listener` specified for the event's `type` given. + const listenersForType = events.get(type); + + // If we don't have listeners for the event's type, we bail out. + if (!listenersForType) { + return; + } + + // If the listeners list contains the listener given, we just remove it. + if (listenersForType.has(listener)) { + listenersForType.delete(listener); + delete listener[onceResolvers]; + } + } else if (length === 1) { + // No listener was given, it means we're removing all the listeners from + // the given event's `type`. + if (events.has(type)) { + events.delete(type); + } + } else if (length === 0) { + // With no parameter passed, we're removing all the listeners from this. + events.clear(); + } + } + + clearEvents() { + const events = this[eventListeners]; + if (!events) { + return; + } + events.clear(); + } + + /** + * Registers an event `listener` that is called only the next time an event + * of the specified `type` is emitted on this instance. + * It returns a Promise resolved once the specified event `type` is emitted. + * + * @param {string} type + * The type of the event. + * @param {Function} [listener] + * The listener that processes the event. + * @param {object} options + * @param {AbortSignal} options.signal + * The listener will be removed when linked AbortController’s abort() method is called + * @return {Promise} + * The promise resolved once the event `type` is emitted. + */ + once(type, listener = function () {}, options) { + const { promise, resolve } = Promise.withResolvers(); + if (!listener[onceResolvers]) { + listener[onceResolvers] = []; + } + listener[onceResolvers].push(resolve); + this.on(type, listener, options); + return promise; + } + + emit(type, ...rest) { + this._emit(type, false, rest); + } + + emitAsync(type, ...rest) { + return this._emit(type, true, rest); + } + + emitForTests(type, ...rest) { + if (flags.testing) { + this.emit(type, ...rest); + } + } + + /** + * Emit an event of a given `type` on this instance. + * + * @param {string} type + * The type of the event. + * @param {boolean} async + * If true, this function will wait for each listener completion. + * Each listener has to return a promise, which will be awaited for. + * @param {Array} args + * The arguments to pass to each listener function. + * @return {Promise|undefined} + * If `async` argument is true, returns the promise resolved once all listeners have resolved. + * Otherwise, this function returns undefined; + */ + _emit(type, async, args) { + if (loggingEnabled) { + logEvent(type, args); + } + + const targetEventListeners = this[eventListeners]; + if (!targetEventListeners) { + return undefined; + } + + const listeners = targetEventListeners.get(type); + if (!listeners?.size) { + return undefined; + } + + const promises = async ? [] : null; + + // Creating a temporary Set with the original listeners, to avoiding side effects + // in emit. + for (const listener of new Set(listeners)) { + // If the object was destroyed during event emission, stop emitting. + if (!(eventListeners in this)) { + break; + } + + // If listeners were removed during emission, make sure the + // event handler we're going to fire wasn't removed. + if (listeners && listeners.has(listener)) { + try { + // If this was a one-off listener (add via `EventEmitter#once`), unregister the + // listener right away, before firing the listener, to prevent re-entry in case + // the listener fires the same event again. + const resolvers = listener[onceResolvers]; + if (resolvers) { + this.off(type, listener); + } + const promise = listener.apply(this, args); + // Resolve the promise returned by `EventEmitter#once` only after having called + // the listener. + if (resolvers) { + for (const resolver of resolvers) { + // Resolve with the first argument fired on the listened event + // (`EventEmitter#once` listeners don't have access to all the other arguments). + resolver(args[0]); + } + } + if (async) { + // Assert the name instead of `constructor != Promise` in order + // to avoid cross compartment issues where Promise can be multiple. + if (!promise || promise.constructor.name != "Promise") { + console.warn( + `Listener for event '${type}' did not return a promise.` + ); + } else { + promises.push(promise); + } + } + } catch (ex) { + // Prevent a bad listener from interfering with the others. + console.error(ex); + const msg = ex + ": " + ex.stack; + dump(msg + "\n"); + } + } + } + + if (async) { + return Promise.all(promises); + } + + return undefined; + } + + /** + * Returns a number of event listeners registered for the given event `type` on this instance. + * + * @param {string} type + * The type of event. + * @return {number} + * The number of event listeners. + */ + count(type) { + if (eventListeners in this) { + const listenersForType = this[eventListeners].get(type); + + if (listenersForType) { + return listenersForType.size; + } + } + + return 0; + } +} + +module.exports = EventEmitter; + +const { + getNthPathExcluding, +} = require("resource://devtools/shared/platform/stack.js"); +let loggingEnabled = false; + +if (!isWorker) { + loggingEnabled = Services.prefs.getBoolPref("devtools.dump.emit", false); + const observer = { + observe: () => { + loggingEnabled = Services.prefs.getBoolPref("devtools.dump.emit"); + }, + }; + Services.prefs.addObserver("devtools.dump.emit", observer); + + // Also listen for Loader unload to unregister the pref observer and + // prevent leaking + const unloadObserver = function (subject) { + if (subject.wrappedJSObject == require("@loader/unload")) { + Services.prefs.removeObserver("devtools.dump.emit", observer); + Services.obs.removeObserver(unloadObserver, "devtools:loader:destroy"); + } + }; + Services.obs.addObserver(unloadObserver, "devtools:loader:destroy"); +} + +function serialize(target) { + const MAXLEN = 60; + + // Undefined + if (typeof target === "undefined") { + return "undefined"; + } + + if (target === null) { + return "null"; + } + + // Number / String + if (typeof target === "string" || typeof target === "number") { + return truncate(target, MAXLEN); + } + + // HTML Node + if (target.nodeName) { + let out = target.nodeName; + + if (target.id) { + out += "#" + target.id; + } + if (target.className) { + out += "." + target.className; + } + + return out; + } + + // Array + if (Array.isArray(target)) { + return truncate(target.toSource(), MAXLEN); + } + + // Function + if (typeof target === "function") { + return `function ${target.name ? target.name : "anonymous"}()`; + } + + // Window + if (target?.constructor?.name === "Window") { + return `window (${target.location.origin})`; + } + + // Object + if (typeof target === "object") { + let out = "{"; + + const entries = Object.entries(target); + for (let i = 0; i < Math.min(10, entries.length); i++) { + const [name, value] = entries[i]; + + if (i > 0) { + out += ", "; + } + + out += `${name}: ${truncate(value, MAXLEN)}`; + } + + return out + "}"; + } + + // Other + return truncate(target.toSource(), MAXLEN); +} + +function truncate(value, maxLen) { + // We don't use value.toString() because it can throw. + const str = String(value); + return str.length > maxLen ? str.substring(0, maxLen) + "..." : str; +} + +function logEvent(type, args) { + let argsOut = ""; + + // We need this try / catch to prevent any dead object errors. + try { + argsOut = `${args.map(serialize).join(", ")}`; + } catch (e) { + // Object is dead so the toolbox is most likely shutting down, + // do nothing. + } + + const path = getNthPathExcluding(0, "devtools/shared/event-emitter.js"); + + if (args.length) { + dump(`EMITTING: emit(${type}, ${argsOut}) from ${path}\n`); + } else { + dump(`EMITTING: emit(${type}) from ${path}\n`); + } +} diff --git a/skipevenifchromecancelledthismoz.ja b/skipevenifchromecancelledthismoz.ja new file mode 100644 index 0000000..7f6e075 --- /dev/null +++ b/skipevenifchromecancelledthismoz.ja @@ -0,0 +1,1087 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +// This is loaded into chrome windows with the subscript loader. Wrap in +// a block to prevent accidentally leaking globals onto `window`. +{ + const { AppConstants } = ChromeUtils.importESModule( + "resource://gre/modules/AppConstants.sys.mjs" + ); + + let imports = {}; + ChromeUtils.defineESModuleGetters(imports, { + ShortcutUtils: "resource://gre/modules/ShortcutUtils.sys.mjs", + }); + + const DIRECTION_BACKWARD = -1; + const DIRECTION_FORWARD = 1; + + class MozTabbox extends MozXULElement { + constructor() { + super(); + this._handleMetaAltArrows = AppConstants.platform == "macosx"; + this.disconnectedCallback = this.disconnectedCallback.bind(this); + } + + connectedCallback() { + document.addEventListener("keydown", this, { mozSystemGroup: true }); + window.addEventListener("unload", this.disconnectedCallback, { + once: true, + }); + } + + disconnectedCallback() { + document.removeEventListener("keydown", this, { mozSystemGroup: true }); + window.removeEventListener("unload", this.disconnectedCallback); + } + + set handleCtrlTab(val) { + this.setAttribute("handleCtrlTab", val); + } + + get handleCtrlTab() { + return this.getAttribute("handleCtrlTab") != "false"; + } + + get tabs() { + if (this.hasAttribute("tabcontainer")) { + return document.getElementById(this.getAttribute("tabcontainer")); + } + return this.getElementsByTagNameNS( + "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", + "tabs" + ).item(0); + } + + get tabpanels() { + return this.getElementsByTagNameNS( + "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", + "tabpanels" + ).item(0); + } + + set selectedIndex(val) { + let tabs = this.tabs; + if (tabs) { + tabs.selectedIndex = val; + } + this.setAttribute("selectedIndex", val); + } + + get selectedIndex() { + let tabs = this.tabs; + return tabs ? tabs.selectedIndex : -1; + } + + set selectedTab(val) { + if (val) { + let tabs = this.tabs; + if (tabs) { + tabs.selectedItem = val; + } + } + } + + get selectedTab() { + let tabs = this.tabs; + return tabs && tabs.selectedItem; + } + + set selectedPanel(val) { + if (val) { + let tabpanels = this.tabpanels; + if (tabpanels) { + tabpanels.selectedPanel = val; + } + } + } + + get selectedPanel() { + let tabpanels = this.tabpanels; + return tabpanels && tabpanels.selectedPanel; + } + + handleEvent(event) { + if (!event.isTrusted) { + // Don't let untrusted events mess with tabs. + return; + } + + // Skip this only if something has explicitly cancelled it. + if (event.defaultCancelled) { + return; + } + + // Skip if chrome code has cancelled this: + if (event.defaultPreventedByChrome) { + return; + } + + // Don't check if the event was already consumed because tab + // navigation should always work for better user experience. + + const { ShortcutUtils } = imports; + + switch (ShortcutUtils.getSystemActionForEvent(event)) { + case ShortcutUtils.CYCLE_TABS: + Glean.browserUiInteraction.keyboard["ctrl-tab"].add(1); + Services.prefs.setBoolPref( + "browser.engagement.ctrlTab.has-used", + true + ); + if (this.tabs && this.handleCtrlTab) { + this.tabs.advanceSelectedTab( + event.shiftKey ? DIRECTION_BACKWARD : DIRECTION_FORWARD, + true + ); + event.preventDefault(); + } + break; + case ShortcutUtils.PREVIOUS_TAB: + if (this.tabs) { + this.tabs.advanceSelectedTab(DIRECTION_BACKWARD, true); + event.preventDefault(); + } + break; + case ShortcutUtils.NEXT_TAB: + if (this.tabs) { + this.tabs.advanceSelectedTab(DIRECTION_FORWARD, true); + event.preventDefault(); + } + break; + } + } + } + + customElements.define("tabbox", MozTabbox); + + class MozDeck extends MozXULElement { + get isAsync() { + return this.getAttribute("async") == "true"; + } + + connectedCallback() { + if (this.delayConnectedCallback()) { + return; + } + this._selectedPanel = null; + this._inAsyncOperation = false; + + let selectCurrentIndex = () => { + // Try to select the new node if any. + let index = this.selectedIndex; + let oldPanel = this._selectedPanel; + this._selectedPanel = this.children.item(index) || null; + this.updateSelectedIndex(index, oldPanel); + }; + + this._mutationObserver = new MutationObserver(records => { + let anyRemovals = records.some(record => !!record.removedNodes.length); + if (anyRemovals) { + // Try to keep the current selected panel in-place first. + let index = Array.from(this.children).indexOf(this._selectedPanel); + if (index != -1) { + // Try to keep the same node selected. + this.setAttribute("selectedIndex", index); + } + } + // Select the current index if needed in case mutations have made that + // available where it wasn't before. + if (!this._inAsyncOperation) { + selectCurrentIndex(); + } + }); + + this._mutationObserver.observe(this, { + childList: true, + }); + + selectCurrentIndex(); + } + + disconnectedCallback() { + this._mutationObserver?.disconnect(); + this._mutationObserver = null; + } + + updateSelectedIndex( + val, + oldPanel = this.querySelector(":scope > .deck-selected") + ) { + this._inAsyncOperation = false; + if (oldPanel != this._selectedPanel) { + oldPanel?.classList.remove("deck-selected"); + this._selectedPanel?.classList.add("deck-selected"); + } + this.setAttribute("selectedIndex", val); + } + + set selectedIndex(val) { + if (val < 0 || val >= this.children.length) { + return; + } + + let oldPanel = this._selectedPanel; + this._selectedPanel = this.children[val]; + + this._inAsyncOperation = this.isAsync; + if (!this._inAsyncOperation) { + this.updateSelectedIndex(val, oldPanel); + } + + if (this._selectedPanel != oldPanel) { + let event = document.createEvent("Events"); + event.initEvent("select", true, true); + this.dispatchEvent(event); + } + } + + get selectedIndex() { + let indexStr = this.getAttribute("selectedIndex"); + return indexStr ? parseInt(indexStr) : 0; + } + + set selectedPanel(val) { + this.selectedIndex = Array.from(this.children).indexOf(val); + } + + get selectedPanel() { + return this._selectedPanel; + } + } + + customElements.define("deck", MozDeck); + + class MozTabpanels extends MozDeck { + /** + * Panels that are currently within an active Split View. + * + * @type {string[]} + */ + #splitViewPanels = []; + + /** + * The splitter placed in between Split View panels. + * + * @type {XULElement} + */ + #splitViewSplitter = null; + + static #SPLIT_VIEW_PANEL_EVENTS = Object.freeze([ + "click", + "focus", + "mouseover", + "mouseout", + ]); + + constructor() { + super(); + this._tabbox = null; + } + + handleEvent(e) { + const browser = e.currentTarget; + const tabbrowser = browser.getTabBrowser(); + switch (e.type) { + case "click": + case "focus": { + const tab = tabbrowser.getTabForBrowser(browser); + const tabstrip = this.tabbox.tabs; + tabstrip.selectedItem = tab; + break; + } + case "mouseover": + tabbrowser.appendStatusPanel(browser); + break; + case "mouseout": + tabbrowser.appendStatusPanel(); + break; + } + } + + get tabbox() { + // Memoize the result rather than replacing this getter, so that + // it can be reset if the parent changes. + if (this._tabbox) { + return this._tabbox; + } + + return (this._tabbox = this.closest("tabbox")); + } + + get splitViewSplitter() { + if (!this.#splitViewSplitter) { + const splitter = document.createXULElement("splitter"); + splitter.className = "split-view-splitter"; + splitter.setAttribute("resizebefore", "sibling"); + splitter.setAttribute("resizeafter", "none"); + this.#splitViewSplitter = splitter; + } + return this.#splitViewSplitter; + } + + /** + * nsIDOMXULRelatedElement + */ + getRelatedElement(aTabPanelElm) { + if (!aTabPanelElm) { + return null; + } + + let tabboxElm = this.tabbox; + if (!tabboxElm) { + return null; + } + + let tabsElm = tabboxElm.tabs; + if (!tabsElm) { + return null; + } + + // Return tab element having 'linkedpanel' attribute equal to the id + // of the tab panel or the same index as the tab panel element. + let tabpanelIdx = Array.prototype.indexOf.call( + this.children, + aTabPanelElm + ); + if (tabpanelIdx == -1) { + return null; + } + + let tabElms = tabsElm.allTabs; + let tabElmFromIndex = tabElms[tabpanelIdx]; + + let tabpanelId = aTabPanelElm.id; + if (tabpanelId) { + for (let idx = 0; idx < tabElms.length; idx++) { + let tabElm = tabElms[idx]; + if (tabElm.linkedPanel == tabpanelId) { + return tabElm; + } + } + } + + return tabElmFromIndex; + } + + set splitViewPanels(newPanels) { + const oldPanels = this.#splitViewPanels; + for (const panel of oldPanels) { + this.removePanelFromSplitView(panel, false); + } + for (const [i, panel] of newPanels.entries()) { + const panelEl = document.getElementById(panel); + panelEl?.classList.add("split-view-panel"); + panelEl?.setAttribute("column", i); + const browser = panelEl?.querySelector("browser"); + for (const eventType of MozTabpanels.#SPLIT_VIEW_PANEL_EVENTS) { + browser?.addEventListener(eventType, this); + } + } + this.#splitViewPanels = newPanels; + this.#isSplitViewActive = !!newPanels.length; + } + + get splitViewPanels() { + return this.#splitViewPanels; + } + + /** + * Remove split view attributes from a panel, and optionally remove it from + * the splitViewPanels array. + * + * @param {string} panel + * @param {boolean} [updateArray] + */ + removePanelFromSplitView(panel, updateArray = true) { + const panelEl = document.getElementById(panel); + panelEl?.classList.remove("split-view-panel"); + panelEl?.removeAttribute("column"); + const browser = panelEl?.querySelector("browser"); + for (const eventType of MozTabpanels.#SPLIT_VIEW_PANEL_EVENTS) { + browser?.removeEventListener(eventType, this); + } + if (updateArray) { + const index = this.#splitViewPanels.indexOf(panel); + if (index !== -1) { + this.#splitViewPanels.splice(index, 1); + } + } + this.#isSplitViewActive = !!this.#splitViewPanels.length; + } + + set #isSplitViewActive(isActive) { + this.toggleAttribute("splitview", isActive); + this.splitViewSplitter.hidden = !isActive; + if (isActive) { + // Place splitter after first panel, so that it can be resized. + const firstPanel = document.getElementById(this.splitViewPanels[0]); + firstPanel?.after(this.#splitViewSplitter); + } + } + } + + MozXULElement.implementCustomInterface(MozTabpanels, [ + Ci.nsIDOMXULRelatedElement, + ]); + customElements.define("tabpanels", MozTabpanels); + + MozElements.MozTab = class MozTab extends MozElements.BaseText { + static get markup() { + return ` + + + + + `; + } + + constructor() { + super(); + + this.addEventListener("mousedown", this); + this.addEventListener("keydown", this); + + this.arrowKeysShouldWrap = AppConstants.platform == "macosx"; + } + + static get inheritedAttributes() { + return { + ".tab-middle": "align,dir,pack,orient,selected,visuallyselected", + ".tab-icon": "validate,src=image", + ".tab-text": "value=label,accesskey,crop,disabled", + }; + } + + connectedCallback() { + if (!this._initialized) { + this.textContent = ""; + this.appendChild(this.constructor.fragment); + this.initializeAttributeInheritance(); + this._initialized = true; + } + } + + on_mousedown(event) { + if (event.button != 0 || this.disabled) { + return; + } + + this.container.ariaFocusedItem = null; + + if (this == this.container.selectedItem) { + // This tab is already selected and we will fall + // through to mousedown behavior which sets focus on the current tab, + // Only a click on an already selected tab should focus the tab itself. + return; + } + + let stopwatchid = this.container.getAttribute("stopwatchid"); + let timerId; + if (stopwatchid) { + timerId = Glean.browserTimings[stopwatchid].start(); + } + + // Call this before setting the 'ignorefocus' attribute because this + // will pass on focus if the formerly selected tab was focused as well. + this.container._selectNewTab(this); + + var isTabFocused = false; + try { + isTabFocused = document.commandDispatcher.focusedElement == this; + } catch (e) {} + + // Set '-moz-user-focus' to 'ignore' so that PostHandleEvent() can't + // focus the tab; we only want tabs to be focusable by the mouse if + // they are already focused. After a short timeout we'll reset + // '-moz-user-focus' so that tabs can be focused by keyboard again. + if (!isTabFocused) { + this.setAttribute("ignorefocus", "true"); + setTimeout(tab => tab.removeAttribute("ignorefocus"), 0, this); + } + + if (stopwatchid) { + Glean.browserTimings[stopwatchid].stopAndAccumulate(timerId); + } + } + + /** + * @returns {"ltr"|"rtl"} + */ + #getDirection() { + return window.getComputedStyle(this).direction; + } + + /** + * @param {KeyEvent} event + */ + on_keydown(event) { + if (event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) { + return; + } + + // Handles some keyboard interactions when the active tab is in focus. + switch (event.keyCode) { + case KeyEvent.DOM_VK_LEFT: { + this.container.advanceSelectedItem( + this.#getDirection() == "ltr" + ? DIRECTION_BACKWARD + : DIRECTION_FORWARD, + this.arrowKeysShouldWrap + ); + event.preventDefault(); + break; + } + + case KeyEvent.DOM_VK_RIGHT: { + this.container.advanceSelectedItem( + this.#getDirection() == "ltr" + ? DIRECTION_FORWARD + : DIRECTION_BACKWARD, + this.arrowKeysShouldWrap + ); + event.preventDefault(); + break; + } + + case KeyEvent.DOM_VK_UP: + this.container.advanceSelectedItem( + DIRECTION_BACKWARD, + this.arrowKeysShouldWrap + ); + event.preventDefault(); + break; + + case KeyEvent.DOM_VK_DOWN: + this.container.advanceSelectedItem( + DIRECTION_FORWARD, + this.arrowKeysShouldWrap + ); + event.preventDefault(); + break; + + case KeyEvent.DOM_VK_HOME: + this.container._selectNewTab(this.allTabs.at(0), DIRECTION_FORWARD); + event.preventDefault(); + break; + + case KeyEvent.DOM_VK_END: { + this.container._selectNewTab(this.allTabs.at(-1), DIRECTION_BACKWARD); + event.preventDefault(); + break; + } + } + } + + set value(val) { + this.setAttribute("value", val); + } + + get value() { + return this.getAttribute("value") || ""; + } + + get container() { + return this.closest("tabs"); + } + + // nsIDOMXULSelectControlItemElement + get control() { + return this.container; + } + + get selected() { + return this.getAttribute("selected") == "true"; + } + + set _selected(val) { + if (val) { + this.setAttribute("selected", "true"); + this.setAttribute("visuallyselected", "true"); + } else { + this.removeAttribute("selected"); + this.removeAttribute("visuallyselected"); + } + } + + /** @returns {boolean} */ + get visible() { + return !this.hidden; + } + + set linkedPanel(val) { + this.setAttribute("linkedpanel", val); + } + + get linkedPanel() { + return this.getAttribute("linkedpanel"); + } + }; + + MozXULElement.implementCustomInterface(MozElements.MozTab, [ + Ci.nsIDOMXULSelectControlItemElement, + ]); + customElements.define("tab", MozElements.MozTab); + + const ARIA_FOCUSED_CLASS_NAME = "tablist-keyboard-focus"; + + class TabsBase extends MozElements.BaseControl { + constructor() { + super(); + + this.addEventListener("DOMMouseScroll", event => { + if (Services.prefs.getBoolPref("toolkit.tabbox.switchByScrolling")) { + if (event.detail > 0) { + this.advanceSelectedTab(DIRECTION_FORWARD, false); + } else { + this.advanceSelectedTab(DIRECTION_BACKWARD, false); + } + event.stopPropagation(); + } + }); + } + + // to be called from derived class connectedCallback + baseConnect() { + this._tabbox = null; + this.ACTIVE_DESCENDANT_ID = `${ARIA_FOCUSED_CLASS_NAME}-${Math.trunc( + Math.random() * 1000000 + )}`; + + if (!this.hasAttribute("orient")) { + this.setAttribute("orient", "horizontal"); + } + + if (this.tabbox && this.tabbox.hasAttribute("selectedIndex")) { + let selectedIndex = parseInt(this.tabbox.getAttribute("selectedIndex")); + this.selectedIndex = selectedIndex > 0 ? selectedIndex : 0; + return; + } + + let children = this.allTabs; + let length = children.length; + for (var i = 0; i < length; i++) { + if (children[i].getAttribute("selected") == "true") { + this.selectedIndex = i; + return; + } + } + + var value = this.value; + if (value) { + this.value = value; + } else { + this.selectedIndex = 0; + } + } + + /** + * nsIDOMXULSelectControlElement + */ + get itemCount() { + return this.allTabs.length; + } + + set value(val) { + this.setAttribute("value", val); + var children = this.allTabs; + for (var c = children.length - 1; c >= 0; c--) { + if (children[c].value == val) { + this.selectedIndex = c; + break; + } + } + } + + get value() { + return this.getAttribute("value") || ""; + } + + get tabbox() { + if (!this._tabbox) { + // Memoize the result in a field rather than replacing this property, + // so that it can be reset along with the binding. + this._tabbox = this.closest("tabbox"); + } + + return this._tabbox; + } + + /** + * @param {number} val + */ + set selectedIndex(val) { + var tab = this.getItemAtIndex(val); + if (!tab) { + return; + } + for (let otherTab of this.allTabs) { + if (otherTab != tab && otherTab.selected) { + otherTab._selected = false; + } + } + tab._selected = true; + + this.setAttribute("value", tab.value); + + let linkedPanel = this.getRelatedElement(tab); + if (linkedPanel) { + this.tabbox.setAttribute("selectedIndex", val); + + // This will cause an onselect event to fire for the tabpanel + // element. + this.tabbox.tabpanels.selectedPanel = linkedPanel; + } + } + + /** + * @returns {number} + */ + get selectedIndex() { + const tabs = this.allTabs; + for (var i = 0; i < tabs.length; i++) { + if (tabs[i].selected) { + return i; + } + } + return -1; + } + + /** + * @param {MozTab|null} [val] + */ + set selectedItem(val) { + if (val && !val.selected) { + // The selectedIndex setter ignores invalid values + // such as -1 if |val| isn't one of our child nodes. + this.selectedIndex = this.getIndexOfItem(val); + } + } + + /** + * @returns {MozTab|null} + */ + get selectedItem() { + const tabs = this.allTabs; + for (var i = 0; i < tabs.length; i++) { + if (tabs[i].selected) { + return tabs[i]; + } + } + return null; + } + + /** + * @returns {MozTab[]} + */ + get ariaFocusableItems() { + return this.allTabs; + } + + /** + * @returns {number} + */ + get ariaFocusedIndex() { + const items = this.ariaFocusableItems; + for (var i = 0; i < items.length; i++) { + if (items[i].id == this.ACTIVE_DESCENDANT_ID) { + return i; + } + } + return -1; + } + + /** + * @param {MozTab|null} [val] + */ + set ariaFocusedItem(val) { + let setNewItem = val && this.ariaFocusableItems.includes(val); + let clearExistingItem = this.ariaFocusedItem && (!val || setNewItem); + + if (clearExistingItem) { + let ariaFocusedItem = this.ariaFocusedItem; + ariaFocusedItem.classList.remove(ARIA_FOCUSED_CLASS_NAME); + ariaFocusedItem.id = ""; + this.selectedItem.removeAttribute("aria-activedescendant"); + let evt = new CustomEvent("AriaFocus"); + this.selectedItem.dispatchEvent(evt); + } + + if (setNewItem) { + val.id = this.ACTIVE_DESCENDANT_ID; + val.classList.add(ARIA_FOCUSED_CLASS_NAME); + this.selectedItem.setAttribute( + "aria-activedescendant", + this.ACTIVE_DESCENDANT_ID + ); + let evt = new CustomEvent("AriaFocus"); + val.dispatchEvent(evt); + } + } + + /** + * @returns {MozTab|null} + */ + get ariaFocusedItem() { + return document.getElementById(this.ACTIVE_DESCENDANT_ID); + } + + /** + * nsIDOMXULRelatedElement + */ + getRelatedElement(aTabElm) { + if (!aTabElm) { + return null; + } + + let tabboxElm = this.tabbox; + if (!tabboxElm) { + return null; + } + + let tabpanelsElm = tabboxElm.tabpanels; + if (!tabpanelsElm) { + return null; + } + + // Get linked tab panel by 'linkedpanel' attribute on the given tab + // element. + let linkedPanelId = aTabElm.linkedPanel; + if (linkedPanelId) { + return this.ownerDocument.getElementById(linkedPanelId); + } + + // otherwise linked tabpanel element has the same index as the given + // tab element. + let tabElmIdx = this.getIndexOfItem(aTabElm); + return tabpanelsElm.children[tabElmIdx]; + } + + /** + * @param {MozTab} item + * @returns {number} + */ + getIndexOfItem(item) { + return Array.prototype.indexOf.call(this.allTabs, item); + } + + /** + * @param {numb} index + * @returns {MozTab|null} + */ + getItemAtIndex(index) { + return this.allTabs[index] || null; + } + + /** + * Find an adjacent tab. + * + * @param {MozTab} startTab + * A `` element to start searching from. + * @param {object} opts + * @param {number} [opts.direction=1] + * 1 to search forward, -1 to search backward. + * @param {boolean} [opts.wrap=false] + * If true, wrap around if the search reaches the end (or beginning) + * of the tab strip. + * @param {boolean} [opts.startWithAdjacent=true] + * If true (which is the default), start searching from the next tab + * after (or before) `startTab`. If false, `startTab` may be returned + * if it passes the filter. + * @param {function(MozTab):boolean} [opts.filter] + * A function to select which tabs to return. + * @return {MozTab|null} + * The next `` element or, if none exists, null. + */ + findNextTab(startTab, opts = {}) { + let { + direction = 1, + wrap = false, + startWithAdjacent = true, + filter = () => true, + } = opts; + + let tab = startTab; + if (!startWithAdjacent && filter(tab)) { + return tab; + } + + let children = this.allTabs; + let i = children.indexOf(tab); + if (i < 0) { + return null; + } + + while (true) { + i += direction; + if (wrap) { + if (i < 0) { + i = children.length - 1; + } else if (i >= children.length) { + i = 0; + } + } else if (i < 0 || i >= children.length) { + return null; + } + + tab = children[i]; + if (tab == startTab) { + return null; + } + if (filter(tab)) { + return tab; + } + } + } + + /** + * @param {MozTab} aNewTab + * @param {-1|1} [aFallbackDir] + * @param {boolean} [aWrap] + * @returns + */ + _selectNewTab(aNewTab, aFallbackDir, aWrap) { + this.ariaFocusedItem = null; + + aNewTab = this.findNextTab(aNewTab, { + direction: aFallbackDir, + wrap: aWrap, + startWithAdjacent: false, + filter: tab => + !tab.hidden && !tab.disabled && this._canAdvanceToTab(tab), + }); + + var isTabFocused = false; + try { + isTabFocused = + document.commandDispatcher.focusedElement == this.selectedItem; + } catch (e) {} + this.selectedItem = aNewTab; + if (isTabFocused) { + aNewTab.focus(); + } else if (this.getAttribute("setfocus") != "false") { + let selectedPanel = this.tabbox.selectedPanel; + document.commandDispatcher.advanceFocusIntoSubtree(selectedPanel); + + // Make sure that the focus doesn't move outside the tabbox + if (this.tabbox) { + try { + let el = document.commandDispatcher.focusedElement; + while (el && el != this.tabbox.tabpanels) { + if (el == this.tabbox || el == selectedPanel) { + return; + } + el = el.parentNode; + } + aNewTab.focus(); + } catch (e) {} + } + } + } + + _canAdvanceToTab() { + return true; + } + + /** + * Selects the next visible tab in this list of tabs. + * + * @param {-1|1} [aDir] + * @param {boolean} [aWrap] + */ + advanceSelectedTab(aDir, aWrap) { + let { ariaFocusedItem } = this; + let startTab = ariaFocusedItem; + if (!ariaFocusedItem || !this.allTabs.includes(ariaFocusedItem)) { + startTab = this.selectedItem; + } + let newTab = null; + + // Handle keyboard navigation for a hidden tab that can be selected, like the Firefox View tab, + // which has a random placement in this.allTabs. + if (startTab.hidden) { + if (aDir == 1) { + newTab = this.allTabs.find(tab => tab.visible); + } else { + newTab = this.allTabs.findLast(tab => tab.visible); + } + } else { + newTab = this.findNextTab(startTab, { + direction: aDir, + wrap: aWrap, + filter: tab => tab.visible, + }); + } + + if (newTab && newTab != startTab) { + this._selectNewTab(newTab, aDir, aWrap); + } + } + + /** + * Selects the next visible item in this list of items. + * + * This provides an extension point for code to mix non-tab items inside + * of this tab list and be able to appropriately and logically advance to + * the next tab or non-tab. + * + * @param {-1|1} [aDir] + * @param {boolean} [aWrap] + */ + advanceSelectedItem(aDir, aWrap) { + this.advanceSelectedTab(aDir, aWrap); + } + + appendItem(label, value) { + var tab = document.createXULElement("tab"); + tab.setAttribute("label", label); + tab.setAttribute("value", value); + this.appendChild(tab); + return tab; + } + } + + MozXULElement.implementCustomInterface(TabsBase, [ + Ci.nsIDOMXULSelectControlElement, + Ci.nsIDOMXULRelatedElement, + ]); + + MozElements.TabsBase = TabsBase; + + class MozTabs extends TabsBase { + connectedCallback() { + if (this.delayConnectedCallback()) { + return; + } + + let start = MozXULElement.parseXULToFragment( + `` + ); + this.insertBefore(start, this.firstChild); + + let end = MozXULElement.parseXULToFragment( + `` + ); + this.insertBefore(end, null); + + this.baseConnect(); + } + + // Accessor for tabs. This element has spacers as the first and + // last elements and s are everything in between. + get allTabs() { + let children = Array.from(this.children); + return children.splice(1, children.length - 2); + } + + appendChild(tab) { + // insert before the end spacer. + this.insertBefore(tab, this.lastChild); + } + } + + customElements.define("tabs", MozTabs); +}